file
stringlengths
18
26
data
stringlengths
3
1.04M
the_stack_data/161079602.c
/* * %CopyrightBegin% * * Copyright Ericsson AB 1996-2018. All Rights Reserved. * * 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. * * %CopyrightEnd% */ /** * * File: heart.c * Purpose: Portprogram for supervision of the Erlang emulator. * * Synopsis: heart * * SPAWNING FROM ERLANG * * This program is started from Erlang as follows, * * Port = open_port({spawn, 'heart'}, [{packet, 2}]), * * ROLE OF THIS PORT PROGRAM * * This program is started by the Erlang emulator. It communicates * with the emulator through file descriptor 0 (standard input). * * MESSAGE FORMAT * * All messages have the following format (a value in parentheses * indicate field length in bytes), * * {Length(2), Operation(1)} * * START ACK * * When this program has started it sends an START ACK message to Erlang. * * HEART_BEATING * * This program expects a heart beat message. If it does not receive a * heart beat message from Erlang within heart_beat_timeout seconds, it * reboots the system. The system is rebooted by executing the command * stored in the environment variable HEART_COMMAND. * * BLOCKING DESCRIPTORS * * All file descriptors in this program are blocking. This can lead * to deadlocks. The emulator reads and writes are blocking. * * STANDARD INPUT, OUTPUT AND ERROR * * This program communicates with Erlang through the standard * input and output file descriptors (0 and 1). These descriptors * (and the standard error descriptor 2) must NOT be closed * explicitely by this program at termination (in UNIX it is * taken care of by the operating system itself). * * END OF FILE * * If a read from a file descriptor returns zero (0), it means * that there is no process at the other end of the connection * having the connection open for writing (end-of-file). * */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifdef __WIN32__ #include <windows.h> #include <io.h> #include <fcntl.h> #include <process.h> #endif /* * Implement time correction using times() call even on Linuxes * that can simulate gethrtime with clock_gettime, no use implementing * a phony gethrtime in this file as the time questions are so infrequent. */ #include <stdio.h> #include <stddef.h> #include <stdlib.h> #include <stdarg.h> #include <string.h> #include <time.h> #include <errno.h> #if !defined(__WIN32__) # include <sys/types.h> # include <netinet/in.h> # include <sys/time.h> # include <unistd.h> # include <signal.h> # if defined(OS_MONOTONIC_TIME_USING_TIMES) # include <sys/times.h> # include <limits.h> # endif #endif #define HEART_COMMAND_ENV "HEART_COMMAND" #define ERL_CRASH_DUMP_SECONDS_ENV "ERL_CRASH_DUMP_SECONDS" #define HEART_KILL_SIGNAL "HEART_KILL_SIGNAL" #define HEART_NO_KILL "HEART_NO_KILL" #define MSG_HDR_SIZE (2) #define MSG_HDR_PLUS_OP_SIZE (3) #define MSG_BODY_SIZE (2048) #define MSG_TOTAL_SIZE (2050) unsigned char cmd[MSG_BODY_SIZE]; struct msg { unsigned short len; unsigned char op; unsigned char fill[MSG_BODY_SIZE]; /* one too many */ }; /* operations */ #define HEART_ACK (1) #define HEART_BEAT (2) #define SHUT_DOWN (3) #define SET_CMD (4) #define CLEAR_CMD (5) #define GET_CMD (6) #define HEART_CMD (7) #define PREPARING_CRASH (8) /* Maybe interesting to change */ /* Times in seconds */ #define SELECT_TIMEOUT 5 /* Every 5 seconds we reset the watchdog timer */ /* heart_beat_timeout is the maximum gap in seconds between two consecutive heart beat messages from Erlang. */ int heart_beat_timeout = 60; /* All current platforms have a process identifier that fits in an unsigned long and where 0 is an impossible or invalid value */ unsigned long heart_beat_kill_pid = 0; /* reasons for reboot */ #define R_TIMEOUT (1) #define R_CLOSED (2) #define R_ERROR (3) #define R_SHUT_DOWN (4) #define R_CRASHING (5) /* Doing a crash dump and we will wait for it */ /* macros */ #define NULLFDS ((fd_set *) NULL) #define NULLTV ((struct timeval *) NULL) /* prototypes */ static int message_loop(int, int); static void do_terminate(int, int); static int notify_ack(int); static int heart_cmd_reply(int, char *); static int write_message(int, struct msg *); static int read_message(int, struct msg *); static int read_skip(int, char *, int, int); static int read_fill(int, char *, int); static void print_error(const char *,...); static void debugf(const char *,...); static void init_timestamp(void); static time_t timestamp(time_t *); static int wait_until_close_write_or_env_tmo(int); #ifdef __WIN32__ static BOOL enable_privilege(void); static BOOL do_shutdown(int); static void print_last_error(void); static HANDLE start_reader_thread(void); static DWORD WINAPI reader(LPVOID); #define read _read #define write _write #endif /* static variables */ static char program_name[256]; static int erlin_fd = 0, erlout_fd = 1; /* std in and out */ static int debug_on = 0; #ifdef __WIN32__ static HANDLE hreader_thread; static HANDLE hevent_dataready; static struct msg m, *mp = &m; static int tlen; /* total message length */ static FILE* conh; #endif static int is_env_set(char *key) { #ifdef __WIN32__ char buf[1]; DWORD sz = (DWORD) sizeof(buf); SetLastError(0); sz = GetEnvironmentVariable((LPCTSTR) key, (LPTSTR) buf, sz); return sz || GetLastError() != ERROR_ENVVAR_NOT_FOUND; #else return getenv(key) != NULL; #endif } static char * get_env(char *key) { #ifdef __WIN32__ DWORD size = 32; char *value=NULL; wchar_t *wcvalue = NULL; wchar_t wckey[256]; int len; MultiByteToWideChar(CP_UTF8, 0, key, -1, wckey, 256); while (1) { DWORD nsz; if (wcvalue) free(wcvalue); wcvalue = malloc(size*sizeof(wchar_t)); if (!wcvalue) { print_error("Failed to allocate memory. Terminating..."); exit(1); } SetLastError(0); nsz = GetEnvironmentVariableW(wckey, wcvalue, size); if (nsz == 0 && GetLastError() == ERROR_ENVVAR_NOT_FOUND) { free(wcvalue); return NULL; } if (nsz <= size) { len = WideCharToMultiByte(CP_UTF8, 0, wcvalue, -1, NULL, 0, NULL, NULL); value = malloc(len*sizeof(char)); if (!value) { print_error("Failed to allocate memory. Terminating..."); exit(1); } WideCharToMultiByte(CP_UTF8, 0, wcvalue, -1, value, len, NULL, NULL); free(wcvalue); return value; } size = nsz; } #else return getenv(key); #endif } static void free_env_val(char *value) { #ifdef __WIN32__ if (value) free(value); #endif } /* * main */ static void get_arguments(int argc, char** argv) { int i = 1; int h; unsigned long p; while (i < argc) { switch (argv[i][0]) { case '-': switch (argv[i][1]) { case 'h': if (strcmp(argv[i], "-ht") == 0) if (sscanf(argv[i+1],"%i",&h) ==1) if ((h > 10) && (h <= 65535)) { heart_beat_timeout = h; fprintf(stderr,"heart_beat_timeout = %d\n",h); i++; } break; case 'p': if (strcmp(argv[i], "-pid") == 0) if (sscanf(argv[i+1],"%lu",&p) ==1){ heart_beat_kill_pid = p; fprintf(stderr,"heart_beat_kill_pid = %lu\n",p); i++; } break; #ifdef __WIN32__ case 's': if (strcmp(argv[i], "-shutdown") == 0){ do_shutdown(1); exit(0); } break; #endif default: ; } break; default: ; } i++; } debugf("arguments -ht %d -pid %lu\n",h,p); } int main(int argc, char **argv) { if (is_env_set("HEART_DEBUG")) { fprintf(stderr, "heart: debug is ON!\r\n"); debug_on = 1; } get_arguments(argc,argv); #ifdef __WIN32__ if (debug_on) { if(!is_env_set("ERLSRV_SERVICE_NAME")) { /* this redirects stderr to a separate console (for debugging purposes)*/ erlin_fd = _dup(0); erlout_fd = _dup(1); AllocConsole(); conh = freopen("CONOUT$","w",stderr); if (conh != NULL) fprintf(conh,"console alloced\n"); } debugf("stderr\n"); } _setmode(erlin_fd,_O_BINARY); _setmode(erlout_fd,_O_BINARY); #endif strncpy(program_name, argv[0], sizeof(program_name)); program_name[sizeof(program_name)-1] = '\0'; notify_ack(erlout_fd); cmd[0] = '\0'; do_terminate(erlin_fd,message_loop(erlin_fd,erlout_fd)); return 0; } /* * message loop */ static int message_loop(erlin_fd, erlout_fd) int erlin_fd, erlout_fd; { int i; time_t now, last_received; #ifdef __WIN32__ DWORD wresult; #else fd_set read_fds; int max_fd; struct timeval timeout; int tlen; /* total message length */ struct msg m, *mp = &m; #endif init_timestamp(); timestamp(&now); last_received = now; #ifdef __WIN32__ hevent_dataready = CreateEvent(NULL,FALSE,FALSE,NULL); hreader_thread = start_reader_thread(); #else max_fd = erlin_fd; #endif while (1) { /* REFACTOR: below to select/tmo function */ #ifdef __WIN32__ wresult = WaitForSingleObject(hevent_dataready,SELECT_TIMEOUT*1000+ 2); if (wresult == WAIT_FAILED) { print_last_error(); return R_ERROR; } if (wresult == WAIT_TIMEOUT) { debugf("wait timed out\n"); i = 0; } else { debugf("wait ok\n"); i = 1; } #else FD_ZERO(&read_fds); /* ZERO on each turn */ FD_SET(erlin_fd, &read_fds); timeout.tv_sec = SELECT_TIMEOUT; /* On Linux timeout is modified by select */ timeout.tv_usec = 0; if ((i = select(max_fd + 1, &read_fds, NULLFDS, NULLFDS, &timeout)) < 0) { print_error("error in select."); return R_ERROR; } #endif /* * Maybe heart beat time-out * If we havn't got anything in 60 seconds we reboot, even if we may * have got something in the last 5 seconds. We may end up here if * the system clock is adjusted with more than 55 seconds, but we * regard this as en error and reboot anyway. */ timestamp(&now); if (now > last_received + heart_beat_timeout) { print_error("heart-beat time-out, no activity for %lu seconds", (unsigned long) (now - last_received)); return R_TIMEOUT; } /* * Do not check fd-bits if select timeout */ if (i == 0) { continue; } /* * Message from ERLANG */ #ifdef __WIN32__ if (wresult == WAIT_OBJECT_0) { if (tlen < 0) { #else if (FD_ISSET(erlin_fd, &read_fds)) { if ((tlen = read_message(erlin_fd, mp)) < 0) { #endif print_error("error in read_message."); return R_ERROR; } if ((tlen > MSG_HDR_SIZE) && (tlen <= MSG_TOTAL_SIZE)) { switch (mp->op) { case HEART_BEAT: timestamp(&last_received); break; case SHUT_DOWN: return R_SHUT_DOWN; case SET_CMD: /* override the HEART_COMMAND_ENV command */ memcpy(&cmd, &(mp->fill[0]), tlen-MSG_HDR_PLUS_OP_SIZE); cmd[tlen-MSG_HDR_PLUS_OP_SIZE] = '\0'; notify_ack(erlout_fd); break; case CLEAR_CMD: /* use the HEART_COMMAND_ENV command */ cmd[0] = '\0'; notify_ack(erlout_fd); break; case GET_CMD: /* send back command string */ { char *env = NULL; char *command = (cmd[0] ? (char *)cmd : (env = get_env(HEART_COMMAND_ENV))); /* Not set and not in env return "" */ if (!command) command = ""; heart_cmd_reply(erlout_fd, command); free_env_val(env); } break; case PREPARING_CRASH: /* Erlang has reached a crushdump point (is crashing for sure) */ print_error("Erlang is crashing .. (waiting for crash dump file)"); return R_CRASHING; default: /* ignore all other messages */ break; } } else if (tlen == 0) { /* Erlang has closed its end */ print_error("Erlang has closed."); return R_CLOSED; } /* Junk erroneous messages */ } } } #if defined(__WIN32__) static void kill_old_erlang(void){ HANDLE erlh; DWORD exit_code; char* envvar = NULL; envvar = get_env(HEART_NO_KILL); if (envvar && strcmp(envvar, "TRUE") == 0) return; if(heart_beat_kill_pid != 0){ if((erlh = OpenProcess(PROCESS_TERMINATE | SYNCHRONIZE | PROCESS_QUERY_INFORMATION , FALSE, (DWORD) heart_beat_kill_pid)) == NULL){ return; } if(!TerminateProcess(erlh, 1)){ CloseHandle(erlh); return; } if(WaitForSingleObject(erlh,5000) != WAIT_OBJECT_0){ print_error("Old process did not die, " "WaitForSingleObject timed out."); CloseHandle(erlh); return; } if(!GetExitCodeProcess(erlh, &exit_code)){ print_error("Old process did not die, " "GetExitCodeProcess failed."); } CloseHandle(erlh); } } #else static void kill_old_erlang(void){ pid_t pid; int i, res; int sig = SIGKILL; char *envvar = NULL; envvar = get_env(HEART_NO_KILL); if (envvar && strcmp(envvar, "TRUE") == 0) return; envvar = get_env(HEART_KILL_SIGNAL); if (envvar && strcmp(envvar, "SIGABRT") == 0) { print_error("kill signal SIGABRT requested"); sig = SIGABRT; } if(heart_beat_kill_pid != 0){ pid = (pid_t) heart_beat_kill_pid; res = kill(pid,sig); for(i=0; i < 5 && res == 0; ++i){ sleep(1); res = kill(pid,sig); } if(errno != ESRCH){ print_error("Unable to kill old process, " "kill failed (tried multiple times)."); } } } #endif #ifdef __WIN32__ void win_system(char *command) { char *comspec; char * cmdbuff; char * extra = " /C "; wchar_t *wccmdbuff; char *env; STARTUPINFOW start; SECURITY_ATTRIBUTES attr; PROCESS_INFORMATION info; int len; if (!debug_on) { len = MultiByteToWideChar(CP_UTF8, 0, command, -1, NULL, 0); wccmdbuff = malloc(len*sizeof(wchar_t)); if (!wccmdbuff) { print_error("Failed to allocate memory. Terminating..."); exit(1); } MultiByteToWideChar(CP_UTF8, 0, command, -1, wccmdbuff, len); _wsystem(wccmdbuff); return; } comspec = env = get_env("COMSPEC"); if (!comspec) comspec = "CMD.EXE"; cmdbuff = malloc(strlen(command) + strlen(comspec) + strlen(extra) + 1); if (!cmdbuff) { print_error("Failed to allocate memory. Terminating..."); exit(1); } strcpy(cmdbuff, comspec); strcat(cmdbuff, extra); strcat(cmdbuff, command); free_env_val(env); debugf("running \"%s\"\r\n", cmdbuff); memset (&start, 0, sizeof (start)); start.cb = sizeof (start); start.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES; start.wShowWindow = SW_HIDE; start.hStdInput = GetStdHandle(STD_INPUT_HANDLE); start.hStdOutput = GetStdHandle(STD_ERROR_HANDLE); start.hStdError = GetStdHandle(STD_ERROR_HANDLE); attr.nLength = sizeof(attr); attr.lpSecurityDescriptor = NULL; attr.bInheritHandle = TRUE; fflush(stderr); len = MultiByteToWideChar(CP_UTF8, 0, cmdbuff, -1, NULL, 0); wccmdbuff = malloc(len*sizeof(wchar_t)); if (!wccmdbuff) { print_error("Failed to allocate memory. Terminating..."); exit(1); } MultiByteToWideChar(CP_UTF8, 0, cmdbuff, -1, wccmdbuff, len); if (!CreateProcessW(NULL, wccmdbuff, &attr, NULL, TRUE, 0, NULL, NULL, &start, &info)) { debugf("Could not create process for the command %s.\r\n", cmdbuff); } WaitForSingleObject(info.hProcess,INFINITE); free(cmdbuff); free(wccmdbuff); } #endif /* defined(__WIN32__) */ /* * do_terminate */ static void do_terminate(int erlin_fd, int reason) { int ret = 0, tmo=0; char *tmo_env; switch (reason) { case R_SHUT_DOWN: break; case R_CRASHING: if (is_env_set(ERL_CRASH_DUMP_SECONDS_ENV)) { tmo_env = get_env(ERL_CRASH_DUMP_SECONDS_ENV); tmo = atoi(tmo_env); print_error("Waiting for dump - timeout set to %d seconds.", tmo); wait_until_close_write_or_env_tmo(tmo); free_env_val(tmo_env); } /* fall through */ case R_TIMEOUT: case R_CLOSED: case R_ERROR: default: { #if defined(__WIN32__) /* Not VxWorks */ if(!cmd[0]) { char *command = get_env(HEART_COMMAND_ENV); if(!command) print_error("Would reboot. Terminating."); else { kill_old_erlang(); /* High prio combined with system() works badly indeed... */ SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS); win_system(command); print_error("Executed \"%s\". Terminating.",command); } free_env_val(command); } else { kill_old_erlang(); /* High prio combined with system() works badly indeed... */ SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS); win_system(&cmd[0]); print_error("Executed \"%s\". Terminating.",cmd); } #else if(!cmd[0]) { char *command = get_env(HEART_COMMAND_ENV); if(!command) print_error("Would reboot. Terminating."); else { kill_old_erlang(); ret = system(command); print_error("Executed \"%s\" -> %d. Terminating.",command, ret); } free_env_val(command); } else { kill_old_erlang(); ret = system((char*)&cmd[0]); print_error("Executed \"%s\" -> %d. Terminating.",cmd, ret); } #endif } break; } /* switch(reason) */ } /* Waits until something happens on socket or handle * * Uses global variables erlin_fd or hevent_dataready */ int wait_until_close_write_or_env_tmo(int tmo) { int i = 0; #ifdef __WIN32__ DWORD wresult; DWORD wtmo = INFINITE; if (tmo >= 0) { wtmo = tmo*1000 + 2; } wresult = WaitForSingleObject(hevent_dataready, wtmo); if (wresult == WAIT_FAILED) { print_last_error(); return -1; } if (wresult == WAIT_TIMEOUT) { debugf("wait timed out\n"); i = 0; } else { debugf("wait ok\n"); i = 1; } #else fd_set read_fds; int max_fd; struct timeval timeout; struct timeval *tptr = NULL; max_fd = erlin_fd; /* global */ if (tmo >= 0) { timeout.tv_sec = tmo; /* On Linux timeout is modified by select */ timeout.tv_usec = 0; tptr = &timeout; } FD_ZERO(&read_fds); FD_SET(erlin_fd, &read_fds); if ((i = select(max_fd + 1, &read_fds, NULLFDS, NULLFDS, tptr)) < 0) { print_error("error in select."); return -1; } #endif return i; } /* * notify_ack * * Sends an HEART_ACK. */ static int notify_ack(fd) int fd; { struct msg m; m.op = HEART_ACK; m.len = htons(1); return write_message(fd, &m); } /* * send back current command * * Sends an HEART_CMD. */ static int heart_cmd_reply(int fd, char *s) { struct msg m; int len = strlen(s); /* if s >= MSG_BODY_SIZE, return a write * failure immediately. */ if (len >= sizeof(m.fill)) return -1; m.op = HEART_CMD; m.len = htons(len + 1); /* Include Op */ strcpy((char*)m.fill, s); return write_message(fd, &m); } /* * write_message * * Writes a message to a blocking file descriptor. Returns the total * size of the message written (always > 0), or -1 if error. * * A message which is too short or too long, is not written. The return * value is then MSG_HDR_SIZE (2), as if the message had been written. * Is this really necessary? Can't we assume that the length is ok? * FIXME. */ static int write_message(fd, mp) int fd; struct msg *mp; { int len = ntohs(mp->len); if ((len == 0) || (len > MSG_BODY_SIZE)) { return MSG_HDR_SIZE; } /* cc68k wants (char *) */ if (write(fd, (char *) mp, len + MSG_HDR_SIZE) != len + MSG_HDR_SIZE) { return -1; } return len + MSG_HDR_SIZE; } /* * read_message * * Reads a message from a blocking file descriptor. Returns the total * size of the message read (> 0), 0 if eof, and < 0 if error. * * Note: The return value MSG_HDR_SIZE means a message of total size * MSG_HDR_SIZE, i.e. without even an operation field. * * If the size of the message is larger than MSG_TOTAL_SIZE, the total * number of bytes read is returned, but the buffer contains a truncated * message. */ static int read_message(fd, mp) int fd; struct msg *mp; { int rlen, i; unsigned char* tmp; if ((i = read_fill(fd, (char *) mp, MSG_HDR_SIZE)) != MSG_HDR_SIZE) { /* < 0 is an error; = 0 is eof */ return i; } tmp = (unsigned char*) &(mp->len); rlen = (*tmp * 256) + *(tmp+1); if (rlen == 0) { return MSG_HDR_SIZE; } if (rlen > MSG_BODY_SIZE) { if ((i = read_skip(fd, (((char *) mp) + MSG_HDR_SIZE), MSG_BODY_SIZE, rlen)) != rlen) { return i; } else { return rlen + MSG_HDR_SIZE; } } if ((i = read_fill(fd, ((char *) mp + MSG_HDR_SIZE), rlen)) != rlen) { return i; } return rlen + MSG_HDR_SIZE; } /* * read_fill * * Reads len bytes into buf from a blocking fd. Returns total number of * bytes read (i.e. len) , 0 if eof, or < 0 if error. len must be > 0. */ static int read_fill(fd, buf, len) int fd, len; char *buf; { int i, got = 0; do { if ((i = read(fd, buf + got, len - got)) <= 0) { return i; } got += i; } while (got < len); return len; } /* * read_skip * * Reads len bytes into buf from a blocking fd, but puts not more than * maxlen bytes in buf. Returns total number of bytes read ( > 0), * 0 if eof, or < 0 if error. len > maxlen > 0 must hold. */ static int read_skip(fd, buf, maxlen, len) int fd, maxlen, len; char *buf; { int i, got = 0; char c; if ((i = read_fill(fd, buf, maxlen)) <= 0) { return i; } do { if ((i = read(fd, &c, 1)) <= 0) { return i; } got += i; } while (got < len - maxlen); return len; } /* * print_error */ static void print_error(const char *format,...) { va_list args; time_t now; char *timestr; va_start(args, format); time(&now); timestr = ctime(&now); fprintf(stderr, "%s: %.*s: ", program_name, (int) strlen(timestr)-1, timestr); vfprintf(stderr, format, args); va_end(args); fprintf(stderr, "\r\n"); } static void debugf(const char *format,...) { va_list args; if (debug_on) { va_start(args, format); fprintf(stderr, "Heart: "); vfprintf(stderr, format, args); va_end(args); fprintf(stderr, "\r\n"); } } #ifdef __WIN32__ void print_last_error() { LPVOID lpMsgBuf; FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */ (LPTSTR) &lpMsgBuf, 0, NULL ); /* Display the string.*/ fprintf(stderr,"GetLastError:%s\n",lpMsgBuf); /* Free the buffer. */ LocalFree( lpMsgBuf ); } static BOOL enable_privilege() { HANDLE ProcessHandle; DWORD DesiredAccess = TOKEN_ADJUST_PRIVILEGES; HANDLE TokenHandle; TOKEN_PRIVILEGES Tpriv; LUID luid; ProcessHandle = GetCurrentProcess(); OpenProcessToken(ProcessHandle, DesiredAccess, &TokenHandle); LookupPrivilegeValue(0,SE_SHUTDOWN_NAME,&luid); Tpriv.PrivilegeCount = 1; Tpriv.Privileges[0].Luid = luid; Tpriv.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; return AdjustTokenPrivileges(TokenHandle,FALSE,&Tpriv,0,0,0); } static BOOL do_shutdown(int really_shutdown) { enable_privilege(); if (really_shutdown) { if (InitiateSystemShutdown(NULL,"shutdown by HEART",10,TRUE,TRUE)) return TRUE; } else if (InitiateSystemShutdown(NULL, "shutdown by HEART\n" "will be interrupted", 30,TRUE,TRUE)) { AbortSystemShutdown(NULL); return TRUE; } return FALSE; } DWORD WINAPI reader(LPVOID lpvParam) { while (1) { debugf("reader is reading\n"); tlen = read_message(erlin_fd, mp); debugf("reader setting event\n"); SetEvent(hevent_dataready); if(tlen == 0) break; } return 0; } HANDLE start_reader_thread(void) { DWORD tid; HANDLE thandle; if ((thandle = (HANDLE) _beginthreadex(NULL,0,reader,NULL,0,&tid)) == NULL) { print_last_error(); exit(1); } return thandle; } #endif #if defined(__WIN32__) # define TICK_MASK 0x7FFFFFFFUL void init_timestamp(void) { } time_t timestamp(time_t *res) { static time_t extra = 0; static unsigned last_ticks = 0; unsigned this_ticks; time_t r; this_ticks = GetTickCount() & TICK_MASK; if (this_ticks < last_ticks) { extra += (time_t) ((TICK_MASK + 1) / 1000); } last_ticks = this_ticks; r = ((time_t) (this_ticks / 1000)) + extra; if (res != NULL) *res = r; return r; } #elif defined(OS_MONOTONIC_TIME_USING_GETHRTIME) || defined(OS_MONOTONIC_TIME_USING_CLOCK_GETTIME) #if defined(OS_MONOTONIC_TIME_USING_CLOCK_GETTIME) typedef long long SysHrTime; SysHrTime sys_gethrtime(void); SysHrTime sys_gethrtime(void) { struct timespec ts; long long result; if (clock_gettime(MONOTONIC_CLOCK_ID,&ts) != 0) { print_error("Fatal, could not get clock_monotonic value, terminating! " "errno = %d\n", errno); exit(1); } result = ((long long) ts.tv_sec) * 1000000000LL + ((long long) ts.tv_nsec); return (SysHrTime) result; } #else typedef hrtime_t SysHrTime; #define sys_gethrtime() gethrtime() #endif void init_timestamp(void) { } time_t timestamp(time_t *res) { SysHrTime ht = sys_gethrtime(); time_t r = (time_t) (ht / 1000000000); if (res != NULL) *res = r; return r; } #elif defined(OS_MONOTONIC_TIME_USING_TIMES) # ifdef NO_SYSCONF # include <sys/param.h> # define TICKS_PER_SEC() HZ # else # define TICKS_PER_SEC() sysconf(_SC_CLK_TCK) # endif # define TICK_MASK 0x7FFFFFFFUL static unsigned tps; void init_timestamp(void) { tps = TICKS_PER_SEC(); } time_t timestamp(time_t *res) { static time_t extra = 0; static clock_t last_ticks = 0; clock_t this_ticks; struct tms dummy; time_t r; this_ticks = (times(&dummy) & TICK_MASK); if (this_ticks < last_ticks) { extra += (time_t) ((TICK_MASK + 1) / tps); } last_ticks = this_ticks; r = ((time_t) (this_ticks / tps)) + extra; if (res != NULL) *res = r; return r; } #else void init_timestamp(void) { } time_t timestamp(time_t *res) { return time(res); } #endif
the_stack_data/225143409.c
#include <float.h> #include <stdio.h> #include <stdlib.h> #include <sys/time.h> #define TIMEOUT 0.1 //Return time time of day as a double-precision floating point value. double wall_time (void) { struct timeval t; gettimeofday(&t, NULL); return 1.0*t.tv_sec + 1.0e-6*t.tv_usec; } int estimate_fill (size_t m, size_t n, size_t nnz, const size_t *ptr, const size_t *ind, size_t B, double epsilon, double delta, double *fill, int verbose); int test (size_t m, size_t n, size_t nnz, const size_t *ptr, const size_t *ind, size_t B, double epsilon, double delta, int trials, int clock, int results, int verbose) { double *fill = (double*)malloc(sizeof(double) * B * B * trials); for (size_t i = 0; i < B * B * trials; i++) { fill[i] = 0; } //Load problem into cache estimate_fill(m, n, nnz, ptr, ind, B, epsilon, delta, fill, verbose); for (size_t i = 0; i < B * B; i++) { fill[i] = 0; } //Benchmark some runs double time = -wall_time(); for (int t = 0; t < trials; t++){ estimate_fill(m, n, nnz, ptr, ind, B, epsilon, delta, fill + t * B * B, verbose); } time += wall_time(); printf("{\n"); size_t i = 0; if (results) { printf(" \"results\": [\n"); for (int t = 0; t < trials; t++) { printf(" [\n"); for (size_t b_r = 1; b_r <= B; b_r++) { printf(" [\n"); for (size_t b_c = 1; b_c <= B; b_c++) { printf("%.*e%s", DECIMAL_DIG, fill[i], b_c <= B - 1 ? ", " : ""); i++; } printf(" ]%s\n", b_r <= B - 1 ? "," : ""); } printf(" ]%s\n", t < trials - 1 ? "," : ""); } printf(" ]%s\n", clock ? "," : ""); } if (clock) { printf(" \"time_total\": %.*e,\n", DECIMAL_DIG, time); printf(" \"time_mean\": %.*e%s\n", DECIMAL_DIG, time/trials, 0 ? "," : ""); } printf("\n}\n"); free(fill); return 0; }
the_stack_data/11075483.c
/******************************************************************************* * * Copyright (C) 2014-2018 Wave Computing, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of the copyright holder nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * ******************************************************************************/ #include <string.h> char *stpcpy (char *dst, const char * src) { while ((*dst++ = *src++)); return --dst; }
the_stack_data/181392848.c
#include <stdio.h> #include <stdlib.h> #ifdef DREAMCAST #include <kos.h> #include "AURAE/AURAE.h" #include "AURAE/DC/DC.h" void AURAE_Texture_Format_Convert(AURAE_Texture *texture) { int format = texture->format&0x3F; switch (format) { case AURAE_FORMAT_LUM: break; case AURAE_FORMAT_LUMA: break; case AURAE_FORMAT_RGB888: break; case AURAE_FORMAT_RGBA8888: break; case AURAE_FORMAT_RGB555: texture->psm = TA_TEXTURE_RGB1555; break; case AURAE_FORMAT_RGBA1555: texture->psm = TA_TEXTURE_RGB1555; break; case AURAE_FORMAT_8BPP: texture->psm = TA_TEXTURE_8BPP; break; case AURAE_FORMAT_4BPP: texture->psm = TA_TEXTURE_4BPP; break; case AURAE_FORMAT_2BPP: break; default: break; } } void DC_twiddle_encode(AURAE_Texture *texture); void AURAE_Texture_Convert_Internal(AURAE_Texture *texture) { int ncolor; switch (texture->format) { case AURAE_FORMAT_LUM: break; case AURAE_FORMAT_LUMA: break; case AURAE_FORMAT_RGB888: AURAE_Texture_Convert(texture,AURAE_FORMAT_BGR565); break; case AURAE_FORMAT_RGBA8888: AURAE_Texture_Convert(texture,AURAE_FORMAT_BGRA1555); break; case AURAE_FORMAT_RGB555: break; case AURAE_FORMAT_RGBA1555: break; case AURAE_FORMAT_8BPP: ncolor = AURAE_Texture_Palette_Count_Get(texture); DC_twiddle_encode(texture); if(ncolor <= 16) AURAE_Texture_Convert(texture,AURAE_FORMAT_4BPP); AURAE_Texture_Convert_Pal(texture,AURAE_FORMAT_BGRA1555); break; case AURAE_FORMAT_4BPP: AURAE_Texture_Convert_Pal(texture,AURAE_FORMAT_BGRA1555); break; case AURAE_FORMAT_2BPP: break; default: break; } } unsigned short AURAE_Convert_Pixel(unsigned short pixel) { if(pixel == 0x7C1F) pixel = 0; else pixel |= 0x8000; return pixel; } void AURAE_File_Path(char *inpath,char *outpath) { strcpy(outpath,inpath); } #endif
the_stack_data/190767139.c
/** * @FileName linux_process_fork1_5.c * @Describe Linux C/C++多进程同时写一个文件(一) * @Author vfhky 2017-10-28 13:23 https://typecodes.com/cseries/linuxmutilprocesswrite1.html * @Compile gcc linux_process_fork1_5.c -o linux_process_fork1_5 */ #include <stdio.h> #include <unistd.h> #include <string.h> #define FILE_NAME "LINUX_MUTIL_PROCESS_WRITE" static const char *p_buf = "123456789"; int main( const int argc, const char * const *argv ) { //这里使用ab,其中a表示追加,它能原子性地保证进程对应的文件表项中的当前文件偏移量每一次都等于v节点表中当前文件长度。 FILE *fp = fopen( FILE_NAME, "ab" ); if( fp == NULL ) { printf( "Can not opent [%s].\n", FILE_NAME ); return -1; } for( int i=0; i<10000000000; i++ ) { usleep( 1000 ); fwrite( p_buf, strlen( p_buf ), 1, fp ); } fclose( fp ); printf( "Write end.\n" ); return 0; }
the_stack_data/151705093.c
#include <math.h> long double nanl(char const *s) { (void)s; return NAN; }
the_stack_data/246004.c
#include<stdio.h> #include<stdlib.h> struct persona{ char nombre[25]; int edad; float salario; } empleado[5]; void main ( ) { /* guardar arreglo */ for (int i =0; i < 5; i++) { printf ("Introducir nombre: "); gets(empleado[i].nombre); printf ("Introducir edad: "); scanf ("%d", &empleado[i].edad); printf ("Introducir salario: "); scanf ("%f", &empleado[i].salario); } /* imprimir arreglo */ for (int i =0; i < 5; i++) { printf ("Nombre %s\n", empleado[i].nombre); printf ("Edad %d\n", empleado[i].edad); printf ("Salario %.2f\n", empleado[i].salario); } }
the_stack_data/128565.c
// RUN: %clang -target armv6-apple-darwin9 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-OSX %s // CHECK-VERSION-OSX: "armv6k-apple-macosx10.5.0" // RUN: %clang -target armv6-apple-darwin9 -miphoneos-version-min=2.0 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-IOS2 %s // CHECK-VERSION-IOS2: "armv6k-apple-ios2.0.0" // RUN: %clang -target armv6-apple-darwin9 -miphoneos-version-min=2.2 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-IOS22 %s // CHECK-VERSION-IOS22: "armv6k-apple-ios2.2.0" // RUN: %clang -target armv6-apple-darwin9 -miphoneos-version-min=3.0 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-IOS3 %s // CHECK-VERSION-IOS3: "armv6k-apple-ios3.0.0" // RUN: env IPHONUOS_DEPLOYMENT_TARGET=11.0 \ // RUN: %clang -target armv7-apple-darwin -c -### %s 2> %t.err // RUN: FileCheck --input-file=%t.err --check-prefix=CHECK-VERSION-IOS4 %s // CHECK-VERSION-IOS4: invalid iOS deployment version 'IPHONUOS_DEPLOYMENT_TARGET=11.0' // RUN: %clang -target armv7-apple-ios11.0 -c -### %s 2> %t.err // RUN: FileCheck --input-file=%t.err --check-prefix=CHECK-VERSION-IOS41 %s // CHECK-VERSION-IOS41: invalid iOS deployment version '--target=armv7-apple-ios11.0' // RUN: %clang -target armv7-apple-darwin -miphoneos-version-min=11.0 -c -### %s 2> %t.err // RUN: FileCheck --input-file=%t.err --check-prefix=CHECK-VERSION-IOS5 %s // CHECK-VERSION-IOS5: invalid iOS deployment version '-miphoneos-version-min=11.0' // RUN: %clang -target i386-apple-darwin -mios-simulator-version-min=11.0 -c -### %s 2> %t.err // RUN: FileCheck --input-file=%t.err --check-prefix=CHECK-VERSION-IOS6 %s // CHECK-VERSION-IOS6: invalid iOS deployment version '-mios-simulator-version-min=11.0' // RUN: %clang -target armv7-apple-ios11.1 -c -### %s 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-IOS71 %s // CHECK-VERSION-IOS71: invalid iOS deployment version // RUN: %clang -target armv7-apple-darwin -Wno-missing-sysroot -isysroot SDKs/iPhoneOS11.0.sdk -c -### %s 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-IOS7 %s // CHECK-VERSION-IOS7: thumbv7-apple-ios10.99.99 // RUN: env IPHONUOS_DEPLOYMENT_TARGET=11.0 \ // RUN: %clang -target arm64-apple-darwin -c -### %s 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-IOS8 %s // CHECK-VERSION-IOS8: arm64-apple-ios11.0.0 // RUN: %clang -target arm64-apple-ios11.0 -miphoneos-version-min=11.0 -c -### %s 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-IOS9 %s // CHECK-VERSION-IOS9: arm64-apple-ios11.0.0 // RUN: %clang -target x86_64-apple-darwin -mios-simulator-version-min=11.0 -c -### %s 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-IOS10 %s // CHECK-VERSION-IOS10: x86_64-apple-ios11.0.0-simulator // RUN: %clang -target arm64-apple-ios11.1 -c -### %s 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-IOS11 %s // CHECK-VERSION-IOS11: arm64-apple-ios11.1.0 // RUN: %clang -target armv7-apple-ios9.0 -miphoneos-version-min=11.0 -c -Wno-invalid-ios-deployment-target -### %s 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-IOS12 %s // CHECK-VERSION-IOS12: thumbv7-apple-ios9.0.0 // RUN: %clang -target i686-apple-darwin8 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-OSX4 %s // RUN: %clang -target i686-apple-darwin9 -mmacosx-version-min=10.4 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-OSX4 %s // CHECK-VERSION-OSX4: "i386-apple-macosx10.4.0" // RUN: %clang -target i686-apple-darwin9 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-OSX5 %s // RUN: %clang -target i686-apple-darwin9 -mmacosx-version-min=10.5 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-OSX5 %s // CHECK-VERSION-OSX5: "i386-apple-macosx10.5.0" // RUN: %clang -target i686-apple-darwin10 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-OSX6 %s // RUN: %clang -target i686-apple-darwin9 -mmacosx-version-min=10.6 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-OSX6 %s // CHECK-VERSION-OSX6: "i386-apple-macosx10.6.0" // RUN: %clang -target x86_64-apple-darwin14 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-OSX10 %s // RUN: %clang -target x86_64-apple-darwin -mmacosx-version-min=10.10 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-OSX10 %s // RUN: %clang -target x86_64-apple-darwin -mmacos-version-min=10.10 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-OSX10 %s // CHECK-VERSION-OSX10: "x86_64-apple-macosx10.10.0" // RUN: %clang -target x86_64-apple-darwin -mmacosx-version-min= -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-MISSING %s // RUN: %clang -target x86_64-apple-darwin -mmacos-version-min= -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-MISSING %s // CHECK-VERSION-MISSING: invalid version number // RUN: %clang -target armv7k-apple-darwin -mwatchos-version-min=2.0 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-WATCHOS20 %s // RUN: %clang -target armv7-apple-darwin -mtvos-version-min=8.3 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-TVOS83 %s // CHECK-VERSION-TVOS83: "thumbv7-apple-tvos8.3.0" // RUN: %clang -target i386-apple-darwin -mtvos-simulator-version-min=8.3 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-TVSIM83 %s // CHECK-VERSION-TVSIM83: "i386-apple-tvos8.3.0-simulator" // RUN: %clang -target armv7k-apple-darwin -mwatchos-version-min=2.0 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-WATCHOS20 %s // CHECK-VERSION-WATCHOS20: "thumbv7k-apple-watchos2.0.0" // RUN: %clang -target i386-apple-darwin -mwatchos-simulator-version-min=2.0 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-WATCHSIM20 %s // CHECK-VERSION-WATCHSIM20: "i386-apple-watchos2.0.0-simulator" // Check environment variable gets interpreted correctly // RUN: env MACOSX_DEPLOYMENT_TARGET=10.5 IPHONUOS_DEPLOYMENT_TARGET=2.0 \ // RUN: %clang -target i386-apple-darwin9 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-OSX5 %s // RUN: env MACOSX_DEPLOYMENT_TARGET=10.5 IPHONUOS_DEPLOYMENT_TARGET=2.0 \ // RUN: %clang -target armv6-apple-darwin9 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-IOS2 %s // RUN: env MACOSX_DEPLOYMENT_TARGET=10.4.10 \ // RUN: %clang -target i386-apple-darwin9 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-OSX49 %s // CHECK-VERSION-OSX49: "i386-apple-macosx10.4.10" // RUN: env IPHONUOS_DEPLOYMENT_TARGET=2.3.1 \ // RUN: %clang -target armv6-apple-darwin9 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-IOS231 %s // CHECK-VERSION-IOS231: "armv6k-apple-ios2.3.1" // RUN: env MACOSX_DEPLOYMENT_TARGET=10.5 TVOS_DEPLOYMENT_TARGET=8.3.1 \ // RUN: %clang -target armv7-apple-darwin9 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-TVOS %s // CHECK-VERSION-TVOS: "thumbv7-apple-tvos8.3.1" // RUN: env TVOS_DEPLOYMENT_TARGET=8.3.1 \ // RUN: %clang -target i386-apple-darwin9 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-TVOSSIM %s // CHECK-VERSION-TVOSSIM: "i386-apple-tvos8.3.1-simulator" // RUN: env MACOSX_DEPLOYMENT_TARGET=10.5 WATCHOS_DEPLOYMENT_TARGET=2.0 \ // RUN: %clang -target armv7-apple-darwin9 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-WATCHOS %s // CHECK-VERSION-WATCHOS: "thumbv7-apple-watchos2.0.0" // RUN: env WATCHOS_DEPLOYMENT_TARGET=2.0 \ // RUN: %clang -target i386-apple-darwin9 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-WATCHOSSIM %s // CHECK-VERSION-WATCHOSSIM: "i386-apple-watchos2.0.0-simulator" // RUN: %clang -target x86_64-apple-ios11.0.0 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-IOS-TARGET %s // CHECK-VERSION-IOS-TARGET: "x86_64-apple-ios11.0.0-simulator" // RUN: %clang -target x86_64-apple-tvos11.0 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-TVOS-TARGET %s // CHECK-VERSION-TVOS-TARGET: "x86_64-apple-tvos11.0.0-simulator" // RUN: %clang -target x86_64-apple-watchos4.0 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-WATCHOS-TARGET %s // CHECK-VERSION-WATCHOS-TARGET: "x86_64-apple-watchos4.0.0-simulator" // RUN: env MACOSX_DEPLOYMENT_TARGET=1000.1000 \ // RUN: %clang -target x86_64-apple-darwin -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-INVALID-ENV %s // CHECK-VERSION-INVALID-ENV: invalid version number in 'MACOSX_DEPLOYMENT_TARGET=1000.1000' // Target can specify the OS version: // RUN: %clang -target x86_64-apple-macos10.11.2 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-TMAC2 %s // CHECK-VERSION-TMAC2: "x86_64-apple-macosx10.11.2" // RUN: %clang -target arm64-apple-ios11.1 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-TIOS1 %s // CHECK-VERSION-TIOS1: "arm64-apple-ios11.1.0" // RUN: %clang -target arm64-apple-tvos10.3 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-TTVOS1 %s // CHECK-VERSION-TTVOS1: "arm64-apple-tvos10.3.0" // RUN: %clang -target armv7k-apple-watchos4.1 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-TWATCHOS1 %s // CHECK-VERSION-TWATCHOS1: "thumbv7k-apple-watchos4.1.0" // "darwin" always back to the -m<os>version-min and environment: // RUN: %clang -target x86_64-apple-darwin14 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-TDARWIN-FALL1 %s // CHECK-VERSION-TDARWIN-FALL1: "x86_64-apple-macosx10.10.0" // RUN: %clang -target x86_64-apple-darwin14 -miphoneos-version-min=10.1 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-TDARWIN-FALL2 %s // CHECK-VERSION-TDARWIN-FALL2: "x86_64-apple-ios10.1.0-simulator" // RUN: env IPHONUOS_DEPLOYMENT_TARGET=9.1 \ // RUN: %clang -target arm64-apple-darwin14 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-TDARWIN-FALL3 %s // CHECK-VERSION-TDARWIN-FALL3: "arm64-apple-ios9.1.0" // RUN: %clang -target arm64-apple-darwin14 -isysroot SDKs/iPhoneOS11.0.sdk -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-TDARWIN-FALL4 %s // CHECK-VERSION-TDARWIN-FALL4: "arm64-apple-ios11.0.0" // RUN: %clang -target unknown-apple-darwin12 -arch armv7 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-TDARWIN-FALL5 %s // CHECK-VERSION-TDARWIN-FALL5: "thumbv7-apple-ios5.0.0" // Warn about -m<os>-version-min when it's used with target: // RUN: %clang -target x86_64-apple-macos10.11.2 -mmacos-version-min=10.6 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-TNO-OSV1 %s // CHECK-VERSION-TNO-OSV1: overriding '-mmacosx-version-min=10.6' option with '--target=x86_64-apple-macos10.11.2' // RUN: %clang -target x86_64-apple-macos -miphoneos-version-min=9.1 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-TNO-OSV2 %s // CHECK-VERSION-TNO-OSV2: overriding '-miphoneos-version-min=9.1' option with '--target=x86_64-apple-macos' // RUN: %clang -target x86_64-apple-ios -miphonesimulator-version-min=10.0 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-TNO-OSV3 %s // CHECK-VERSION-TNO-OSV3: "x86_64-apple-ios10.0.0-simulator" // CHECK-VERSION-TNO-OSV3-NOT: overriding '-mios-simulator-version-min // CHECK-VERSION-TNO-OSV3-NOT: argument unused during compilation // RUN: %clang -target arm64-apple-ios10.1.0 -miphoneos-version-min=10.1.0.1 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-TNO-OSV4 %s // CHECK-VERSION-TNO-OSV4: overriding '-miphoneos-version-min=10.1.0.1' option with '--target=arm64-apple-ios10.1.0' // RUN: %clang -target x86_64-apple-macos10.6 -mmacos-version-min=10.6 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-TNO-SAME %s // CHECK-VERSION-TNO-SAME-NOT: overriding // CHECK-VERSION-TNO-SAME-NOT: argument unused during compilation // Target with OS version is not overridden by -m<os>-version-min variables: // RUN: %clang -target x86_64-apple-macos10.11.2 -mmacos-version-min=10.6 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-TIGNORE-OSV1 %s // CHECK-VERSION-TIGNORE-OSV1: "x86_64-apple-macosx10.11.2" // RUN: %clang -target arm64-apple-ios11.0 -mios-version-min=9.0 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-TIGNORE-OSV2 %s // CHECK-VERSION-TIGNORE-OSV2: "arm64-apple-ios11.0.0" // RUN: %clang -target arm64-apple-tvos11.0 -mtvos-version-min=9.0 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-TIGNORE-OSV3 %s // CHECK-VERSION-TIGNORE-OSV3: "arm64-apple-tvos11.0.0" // RUN: %clang -target armv7k-apple-watchos3 -mwatchos-version-min=4 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-TIGNORE-OSV4 %s // CHECK-VERSION-TIGNORE-OSV4: "thumbv7k-apple-watchos3.0.0" // Target without OS version includes the OS given by -m<os>-version-min arguments: // RUN: %clang -target x86_64-apple-macos -mmacos-version-min=10.11 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-USE-OS-ARG1 %s // CHECK-VERSION-USE-OS-ARG1: "x86_64-apple-macosx10.11.0" // RUN: %clang -target arm64-apple-ios -mios-version-min=9.0 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-USE-OS-ARG2 %s // CHECK-VERSION-USE-OS-ARG2: "arm64-apple-ios9.0.0" // RUN: %clang -target arm64-apple-tvos -mtvos-version-min=10.0 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-USE-OS-ARG3 %s // CHECK-VERSION-USE-OS-ARG3: "arm64-apple-tvos10.0.0" // RUN: %clang -target armv7k-apple-watchos -mwatchos-version-min=4 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-USE-OS-ARG4 %s // CHECK-VERSION-USE-OS-ARG4: "thumbv7k-apple-watchos4.0.0" // Target with OS version is not overridden by environment variables: // RUN: env MACOSX_DEPLOYMENT_TARGET=10.1 \ // RUN: %clang -target i386-apple-macos10.5 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-TMACOS-CMD %s // CHECK-VERSION-TMACOS-CMD: "i386-apple-macosx10.5.0" // RUN: env IPHONUOS_DEPLOYMENT_TARGET=10.1 \ // RUN: %clang -target arm64-apple-ios11 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-TIOS-CMD %s // CHECK-VERSION-TIOS-CMD: "arm64-apple-ios11.0.0" // RUN: env TVOS_DEPLOYMENT_TARGET=8.3.1 \ // RUN: %clang -target arm64-apple-tvos9 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-TTVOS-CMD %s // CHECK-VERSION-TTVOS-CMD: "arm64-apple-tvos9.0.0" // RUN: env WATCHOS_DEPLOYMENT_TARGET=2 \ // RUN: %clang -target armv7k-apple-watchos3 -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-TWATCHOS-CMD %s // CHECK-VERSION-TWATCHOS-CMD: "thumbv7k-apple-watchos3.0.0" // Target with OS version is not overridden by the SDK: // RUN: %clang -target armv7-apple-ios9 -Wno-missing-sysroot -isysroot SDKs/iPhoneOS11.0.sdk -c -### %s 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-TIOS-SDK %s // CHECK-VERSION-TIOS-SDK: thumbv7-apple-ios9 // RUN: %clang -target armv7k-apple-watchos4 -Wno-missing-sysroot -isysroot SDKs/WatchOS3.0.sdk -c -### %s 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-TWATCHOS-SDK %s // CHECK-VERSION-TWATCHOS-SDK: thumbv7k-apple-watchos4 // RUN: %clang -target armv7-apple-tvos9 -Wno-missing-sysroot -isysroot SDKs/AppleTVOS11.0.sdk -c -### %s 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-TTVOS-SDK %s // CHECK-VERSION-TTVOS-SDK: thumbv7-apple-tvos9 // Target with OS version is not overridden by arch: // RUN: %clang -target uknown-apple-macos10.11.2 -arch=armv7k -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-TIGNORE-ARCH1 %s // CHECK-VERSION-TIGNORE-ARCH1: "unknown-apple-macosx10.11.2" // Target can be used to specify the environment: // RUN: %clang -target x86_64-apple-ios11-simulator -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-TENV-SIM1 %s // CHECK-VERSION-TENV-SIM1: "x86_64-apple-ios11.0.0-simulator" // RUN: %clang -target armv7k-apple-ios10.1-simulator -c %s -### 2>&1 | \ // RUN: FileCheck --check-prefix=CHECK-VERSION-TENV-SIM2 %s // CHECK-VERSION-TENV-SIM2: "thumbv7k-apple-ios10.1.0-simulator"
the_stack_data/125139284.c
#include <stdlib.h> #include <stdio.h> /* * Class A */ struct A_class { void (* ping ) (void*); void (* pong ) (void*); }; struct A { struct A_class* class; int i; }; void A_ctor(void* thisv, int i) { struct A* this = thisv; this->i = i; } void A_ping (void* thisv) { struct A* this = thisv; printf ("A_ping %d\n", this->i); } void A_pong (void* thisv) { struct A* this = thisv; printf ("A_pong %d\n", this->i); } struct A_class A_class = {A_ping, A_pong}; void* new_A(int i) { struct A* obj = malloc (sizeof (struct A)); obj->class = &A_class; A_ctor(obj, i); return obj; } /* * Class B extends A */ struct B_class { void (* ping ) (void*); void (* pong ) (void*); void (* wiff ) (void*); }; struct B { struct B_class* class; int i; }; void B_ping (void* thisv) { struct B* this = thisv; printf ("B_ping %d\n", this->i); } void B_wiff (void* thisv) { struct B* this = thisv; printf ("B_wiff %d\n", this->i); } struct B_class B_class = {B_ping, A_pong, B_wiff}; void* new_B(i) { struct B* obj = malloc (sizeof (struct B)); obj->class = &B_class; A_ctor(obj, i); return obj; } /* * Class C extends B */ struct C_class { void (* ping ) (void*); void (* pong ) (void*); void (* wiff ) (void*); }; struct C { struct C_class* class; int i; int id; }; void C_ctor (void* thisv, int i, int id) { struct C* this = thisv; A_ctor (this, i); this->id = id; } void C_ping (void* thisv) { struct C* this = thisv; printf ("C_ping (%d,%d) calls ", this->i, this->id); B_ping (this); } struct C_class C_class = {C_ping, A_pong, B_wiff}; void* new_C (int i, int id) { struct C* obj = malloc (sizeof (struct C)); obj->class = &C_class; C_ctor(obj, i, id); return obj; } /* * Main */ void foo (void* av) { struct A* a = av; a->class->ping (a); a->class->pong (a); } void bar() { foo (new_A(10)); foo (new_B(20)); foo (new_C(30, 100)); } int main (int argc, char** argv) { bar(); }
the_stack_data/7951429.c
#include<stdio.h> #define STUDENT 7 #define CLASS 6 int score[STUDENT][CLASS]; double *avg_class(int nums_c[STUDENT][CLASS],double Avg_C[CLASS]); double *avg_student(int nums_s[STUDENT][CLASS],double Avg_S[STUDENT]); int max(int nums[STUDENT][CLASS],int MAX[2]); int main() { int i,t,Max,MAX[2]; double *s,*c; double Avg_C[CLASS],Avg_S[STUDENT]; printf("输入%d个学生%d门课程的成绩\n",STUDENT,CLASS); for(i=0;i<STUDENT;i++) { for(t=0;t<CLASS;t++) { scanf("%d",&score[i][t]); } } c=avg_class(score,Avg_C); s=avg_student(score,Avg_S); Max=max(score,MAX); for(i=0;i<STUDENT;i++) { printf("\n第%d个学生的每门课程的平均分: ",i+1); printf("%.1lf",*s); s++; } for(t=0;t<CLASS;t++) { printf("\n第%d门课程的平均分: ",t+1); printf("%.1lf",*c); c++; } printf("\n最高分是第%d个学生的第%d门成绩:%d\n",MAX[0]+1,MAX[1]+1,Max); return 0; } int max(int nums[STUDENT][CLASS],int MAX[2]) { int i,t,Max=0; for(i=0;i<STUDENT;i++) { for(t=0;t<CLASS;t++) { if(nums[i][t]>=Max) { Max=nums[i][t]; MAX[0]=i; MAX[1]=t; } } } return Max; } double *avg_class(int nums_c[STUDENT][CLASS],double Avg_C[CLASS]) { double *pc; int i,t,sum=0; for(t=0;t<CLASS;t++) { for(i=0;i<STUDENT;i++) { sum=sum+nums_c[i][t]; } Avg_C[t]=sum/STUDENT; sum=0; } pc=Avg_C; return pc; } double *avg_student(int nums_s[STUDENT][CLASS],double Avg_S[STUDENT]) { double *ps; int i,t,sum=0; for(i=0;i<STUDENT;i++) { for(t=0;t<CLASS;t++) { sum=sum+nums_s[i][t]; } Avg_S[i]=sum/CLASS; sum=0; } ps=Avg_S; return ps; }
the_stack_data/717799.c
// ************************************************************ // global variables // // sine table 0 - 64 binary degrees // rocket size of 128 calculated into table /* Description: Contains byte values for scaled rocket size values for the first quadrent of angles. */ const char sintbl[] = { 0, 3, 6, 9, 12, 15, 18, 21, 24, 28, 31, 34, 37, 40, 43, 46, 48, 51, 54, 57, 60, 63, 65, 68, 71, 73, 76, 78, 81, 83, 85, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 109, 111, 112, 114, 115, 117, 118, 119, 120, 121, 122, 123, 124, 124, 125, 126, 126, 127, 127, 127, 127, 127, 128 }; // ************************************************************ // // blitzkrieg sine routine // // enter angle to be converted // /* Description: Fast lookup table sine routine. The sine routine uses 256 units for a complete circle. The first quadrent is 0x00 - 0x3f -> 0 - 89 degrees. The second quadrent is 0x40 - 0x7f -> 90 - 179 degrees. The third quadrent is 0x80 - 0xbf -> 180 - 269 degrees. The fourth quadrent is 0xc0 - 0xff -> 270 - 359 degrees. This fuction is call as a cosine by adding 64 to the angle to return the x vector part of the rocket size. This fuction is call as a sine to return the y vector part of the rocket size. */ int bzsin(char angle) { int sine; if(angle & 0x40) angle = angle ^ 0x3F; // invert angle in second quad sine = sintbl[angle & 0x3F]; // convert char to int return (angle & 0x80) ? -sine : sine ; // change sign for 180 - 360 degrees }
the_stack_data/206393814.c
#include <stdio.h> int main(void){ int vetor10[10], vetor5[5], pvetor[10], svetor[10], i, i2, aux=0; // Seção de Comandos, procedimento, funções, operadores, etc... for (i = 1; i < 10; i++){ printf("\nDigite o %d valor do vetor de 10 posições.", i); scanf("%d",&vetor10[i]); }; for (i = 1; i < 5; i++){ printf("\nDigite o %d valor do vetor de 5 posições.", i); scanf("%d", &vetor5[i]); }; //ATRIBUIÇÃO DE VALORES PARA O PRIMEIRO VETOR RESULTANTE for (i = 1;i < 5; i++){ aux = aux + vetor5[i]; }; for(i = 1; i < 10; i++){ for(i2 = 1; i2 < 5; i2++){ if(vetor10[i] % 2 == 0){ pvetor[i] = vetor10[i] + aux; } else{ if(vetor10[i] % vetor5[i2] == 0){ svetor[i] = svetor[i] + 1; }; }; }; }; //ATRIBUIÇÃO DE VALORES PARA O SEGUNDO VETOR RESULTANTE // for(i= 1;i < 10; i++){ // if(vetor10[i] % 2 == 1){ // for(i2 = 1; i2 < 5; i2++){ // if(vetor10[i] % vetor5[i2] == 0){ // svetor[i] = svetor[i] + 1; // }; // }; // }; // }; //EXIBIÇÃO DO RESULTADO printf("\nPrimeiro vetor resultante:"); printf("\n(Soma de cada numero par do primeiro vetor com todos do segundo.)"); for(i = 1;i < 10; i++){ if(pvetor[i] != 0){ printf("\n%d",pvetor[i]); }; }; printf("\n"); printf("\nSegundo vetor resultante:"); printf("\n(Quantidade de divisores que cada numero impar no primeiro vetor tem no segundo vetor.)"); for(i = 1; i < 10; i++){ if (vetor10[i] % 2 == 1){ printf("\n%d",svetor[i]); }; }; return 0; };
the_stack_data/14201238.c
/* @author: zhihuaye Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. @cases: */ #include <stdio.h> #include <stdlib.h> struct ListNode { int val; struct ListNode *next; }; void deleteNode(struct ListNode* node) { if(node->next == NULL){ printf("can not delete last node.\n"); return; } struct ListNode *next = node->next; node->val = next->val; node->next = next->next; } //add element into the list struct ListNode* addToList(struct ListNode* list, int val){ struct ListNode *new = calloc(1, sizeof(struct ListNode)); if(new == NULL){ printf("calloc failed when init a list!\n"); return list; } new->val = val; new->next = NULL; if(list){ struct ListNode *templist = list; while(templist){ if(templist->next){ templist = templist->next; }else{ templist->next = new; break; } } }else{ list = new; } return list; } //iterate the list, return a integer array. void iterateList(struct ListNode* list){ printf("########start iterate.\n"); while(list){ printf("%d.\n", list->val); list = list->next; } printf("#######end iterate.\n"); } int main(void){ struct ListNode* list = NULL; list = addToList(list, 5); list = addToList(list, 4); list = addToList(list, 3); list = addToList(list, 2); list = addToList(list, 1); iterateList(list); struct ListNode* deleteone = NULL; deleteone = addToList(deleteone, 4); //deleteNode(deleteone); if(list){ iterateList(list); free(list); } if(deleteone) free(deleteone); return 0; }
the_stack_data/103265083.c
/* Copyright 1996, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ /* * Copyright 1995 by FUJITSU LIMITED * This is source code modified by FUJITSU LIMITED under the Joint * Development Agreement for the CDE/Motif PST. * * Modifier: Takanori Tateno FUJITSU LIMITED * */ /* $XFree86: xc/lib/X11/lcDynamic.c,v 1.6 2006/01/09 14:58:42 dawes Exp $ */ /* * A dynamically loaded locale. * Supports: All locale names. * How: Loads $(XLOCALEDIR)/xi18n.so and forwards the request to that library. * Platforms: Only those defining USE_DYNAMIC_LOADER (none known). */ #ifdef USE_DYNAMIC_LOADER #include <stdio.h> #include <string.h> #include <dlfcn.h> #include "Xlibint.h" #include "Xlcint.h" #ifndef XLOCALEDIR #define XLOCALEDIR "/usr/lib/X11/locale" #endif #define LCLIBNAME "xi18n.so" XLCd _XlcDynamicLoader( const char *name) { char libpath[1024]; XLCdMethods _XlcGenericMethods; XLCd lcd; void *nlshandler; sprintf(libpath,"%s/%s/%s", XLOCALEDIR,name,LCLIBNAME); nlshandler = dlopen(libpath,LAZY); _XlcGenericMethods = (XLCdMethods)dlsym(nlshandler,"genericMethods"); lcd = _XlcCreateLC(name,_XlcGenericMethods); return lcd; } #else typedef int dummy; #endif /* USE_DYNAMIC_LOADER */
the_stack_data/247017327.c
/* cnd_signal( cnd_t * cond ) This file is part of the Public Domain C Library (PDCLib). Permission is granted to use, modify, and / or redistribute at will. */ #ifndef REGTEST #include <threads.h> /* Implicitly casting the parameter. */ extern int pthread_cond_signal( cnd_t * ); int cnd_signal( cnd_t * cond ) { if ( pthread_cond_signal( cond ) == 0 ) { return thrd_success; } else { return thrd_error; } } #endif #ifdef TEST #include "_PDCLIB_test.h" int main( void ) { #ifndef REGTEST TESTCASE( NO_TESTDRIVER ); #endif return TEST_RESULTS; } #endif
the_stack_data/19556.c
/* * Program: circle_areas.c * Displays the Circle Areas for circles with radius * from 1.0 to 5.0 with increments of 0.5. */ #include <stdio.h> int main() { printf("Circle Areas\n"); printf("-----------------\n"); printf(" Radius: 1.0 = %4.2f\n", 3.1415 * 1.0 * 1.0); printf(" Radius: 1.5 = %4.2f\n", 3.1415 * 1.5 * 1.5); printf(" Radius: 2.0 = %4.2f\n", 3.1415 * 2.0 * 2.0); printf(" Radius: 2.5 = %4.2f\n", 3.1415 * 2.5 * 2.5); printf(" Radius: 3.0 = %4.2f\n", 3.1415 * 3.0 * 3.0); printf(" Radius: 3.5 = %4.2f\n", 3.1415 * 3.5 * 3.5); printf(" Radius: 4.0 = %4.2f\n", 3.1415 * 4.0 * 4.0); printf(" Radius: 4.5 = %4.2f\n", 3.1415 * 4.5 * 4.5); printf(" Radius: 5.0 = %4.2f\n", 3.1415 * 5.0 * 5.0); printf("-----------------\n"); return 0; }
the_stack_data/36074424.c
//Question 9: // Write a C program which prints all prime numbers between 1 and 100. #include <stdio.h> void main() { printf("THE PRIME NUMBERS FROM 1 TO 100 :\n"); int i=0, copy=0, j=0, temp; for(i=2;i<=100;i++) { temp=0; for (j=2;j<=i/2;j++) { if(i%j==0) { temp++; break; } } if(temp==0) printf("%d\n", i); } }
the_stack_data/98575253.c
/* version 0.2.1f (PM, 18/5/21) : Le serveur de conversation - crée un tube (fifo) d'écoute (avec un nom fixe : ./ecoute) - gère un maximum de maxParticipants conversations : attente (select) sur * tube d'écoute : accepter le(s) nouveau(x) participant(s) si possible -> initialiser et ouvrir les tubes de service (entrée/sortie) fournis * tubes (fifo) de service en entrée -> diffuser sur les tubes de service en sortie - détecte les déconnexions lors du select - se termine lorsqu'un client de pseudo "fin" se connecte Protocole - suppose que les clients ont créé les tubes d'entrée/sortie avant la demande de connexion, et que ces tubes sont nommés par le nom du client, suffixé par _C2S/_S2C. - les échanges par les tubes se font par blocs de taille fixe, dans l'idée d'éviter le mode non bloquant */ #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <fcntl.h> #include <stdbool.h> #include <sys/stat.h> #include <stdarg.h> //#define DEBUG #define MAXPARTICIPANTS 5 /* seuil au delà duquel la prise en compte de nouvelles connexions sera différée */ #define TAILLE_MSG 128 /* nb caractères message complet (nom+texte) */ #define TAILLE_NOM 25 /* nombre de caractères d'un pseudo */ #define NBDESC FD_SETSIZE-1 /* pour le select (macros non definies si >= FD_SETSIZE) */ #define TAILLE_RECEPTION 512 /* capacité du tampon de messages reçus */ typedef struct ptp { /* descripteur de participant */ bool actif; /* indique si le descripteur correspond à un client effectivement connecté */ char nom [TAILLE_NOM]; int in; /* tube d'entrée (C2S) */ int out; /* tube de sortie (S2C) */ } participant; participant participants [MAXPARTICIPANTS]; int fd_to_id[MAXPARTICIPANTS]; char buf[TAILLE_RECEPTION]; /* tampon de messages reçus/à rediffuser */ int nbactifs = 0; /* nombre de clients effectivement connectés */ int curcount = 0; void dprint(const char *format, ...) { #ifdef DEBUG char formated[1024]; va_list args; va_start(args, format); vsprintf(formated, format, args); printf("**DEBUG**: %s", formated); va_end(args); #endif } void proper_shutdown(int code) { dprint("Shutdown!\n"); exit(code); } void reorganize() { curcount = 0; for(int i = 0; i < MAXPARTICIPANTS; i++) { if(!participants[i].actif) { continue; } else if(i != curcount) { participants[curcount].actif = true; strcpy(participants[curcount].nom, participants[i].nom); participants[curcount].in = participants[i].in; participants[curcount].out = participants[i].out; fd_to_id[participants[curcount].out] = curcount; } curcount++; } } void effacer(int i) { /* efface le descripteur pour le participant i */ participants[i].actif = false; bzero(participants[i].nom, TAILLE_NOM*sizeof(char)); participants[i].in = -1; participants[i].out = -1; } void diffuser(char *dep) { /* envoi du message référencé par dep à tous les actifs */ for(int i = 0; i < curcount; i++) { if(!participants[i].actif) { continue; } write(participants[i].out, dep, TAILLE_MSG*sizeof(char)); } } void ajouter(char *dep) { // traite la demande de connexion du pseudo référencé par dep /* Si le participant est "fin", termine le serveur (et gère la terminaison proprement) Sinon, ajoute un participant actif, de pseudo référencé par dep */ dprint("Ajout de \"%s\"...\n", dep); if(curcount == MAXPARTICIPANTS) { reorganize(); } if(strcmp(dep, "fin") == 0) { proper_shutdown(0); } participants[curcount].actif = true; strcpy(participants[curcount].nom, dep); // Ouverture les FIFO créés par le client... char s2c[TAILLE_NOM+5], c2s[TAILLE_NOM+5]; sprintf(s2c, "./%s_s2c", dep); sprintf(c2s, "./%s_c2s", dep); dprint("Opening %s & %s...\n", c2s, s2c); participants[curcount].out = open(s2c, O_WRONLY); participants[curcount].in = open(c2s, O_RDWR | O_NONBLOCK); //hack pour select() fd_to_id[participants[curcount].in] = curcount; dprint("FIFOs opened; in = %d, out = %d!\n", participants[curcount].out, participants[curcount].in); char strbuf[TAILLE_MSG]; sprintf(strbuf, "[service] %s rejoint la conversation", participants[curcount].nom); nbactifs++; curcount++; diffuser(strbuf); } void desactiver (int p) { /* traitement d'un participant déconnecté */ participants[p].actif = false; close(participants[p].in); close(participants[p].out); nbactifs--; char strbuf[TAILLE_MSG]; sprintf(strbuf, "[service] %s a quité conversation", participants[p].nom); diffuser(strbuf); } int build_fd_sets(fd_set *readfds) { int maxfd = 0; FD_ZERO(readfds); for(int i = 0; i < curcount; i++) { if(participants[i].actif) { FD_SET(participants[i].in, readfds); maxfd = maxfd > participants[i].in ? maxfd : participants[i].in; } } return maxfd; } int main (int argc, char *argv[]) { int i,nlus,necrits,res; int ecoute; /* descripteur d'écoute */ fd_set readfds; /* ensemble de descripteurs écoutés par le select */ char * prochainMessage; /* pour parcourir le contenu du tampon de réception */ char bufDemandes [TAILLE_NOM*sizeof(char)*MAXPARTICIPANTS]; /* tampon requêtes de connexion. Inutile de lire plus de MAXPARTICIPANTS requêtes */ /* création (puis ouverture) du tube d'écoute */ mkfifo("./ecoute",S_IRUSR|S_IWUSR); // mmnémoniques sys/stat.h: S_IRUSR|S_IWUSR = 0600 ecoute = open("./ecoute", O_RDWR | O_NONBLOCK); for (i=0; i<= MAXPARTICIPANTS; i++) { effacer(i); } /* autres initialisations */ while (true) { printf("participants actifs : %d\n",nbactifs); /* boucle du serveur : traiter les requêtes en attente * sur le tube d'écoute : ajouter de nouveaux participants (tant qu'il y a moins de MAXPARTICIPANTS actifs) * sur les tubes d'entrée : lire les messages, et les diffuser. Note : - tous les messages comportent TAILLE_MSG caractères, et les tailles sont fixées pour qu'il n'y ait pas de message tronqué, pour simplifier la gestion. - un tampon peut contenir plusieurs messages (et prochainMessage est destiné à repérer le prochain message du tampon du tube c2s à diffuser) - Enfin, on ne traite pas plus de TAILLE_RECEPTION/TAILLE_MSG*sizeof(char) à chaque itération. - dans le cas où la terminaison d'un participant est détectée, gérer sa déconnexion - Attention : le serveur doit fonctionner même lorsqu'aucun client n'est connecté (de nouveaux clients peuvent se connecter à tout moment) */ int fdmax = build_fd_sets(&readfds); FD_SET(ecoute, &readfds); if(ecoute > fdmax) fdmax = ecoute; dprint("Pre select...\n"); if(select(fdmax+1, &readfds, NULL, NULL, NULL) < 0) { perror("select"); proper_shutdown(10); } dprint("Post select...\n"); if(FD_ISSET(ecoute, &readfds)) { nlus = read(ecoute, bufDemandes, sizeof(bufDemandes)); bool send = true; for(int i = 0; i < nlus; i++) { if(send) { ajouter(bufDemandes+i); send = false; continue; } if(*(bufDemandes+i) == '\0') { send = true; } } FD_CLR(ecoute, &readfds); } for(int i = 0; i < fdmax+1; i++) { if(FD_ISSET(i, &readfds)) { nlus = read(i, buf, sizeof(buf)); prochainMessage = buf; while(nlus > 0) { if(strcmp(prochainMessage, "au revoir") == 0) { desactiver(fd_to_id[i]); } char msg[TAILLE_MSG]; sprintf(msg, "[%s] %s", participants[fd_to_id[i]].nom, prochainMessage); diffuser(msg); int len = strlen(prochainMessage); prochainMessage = prochainMessage + len + 1; nlus -= len + 1; } } } } }
the_stack_data/28263264.c
#include <stdio.h> double min(double, double); int main(void) { int status; double a,b; printf("Enter number #1 and #2: "); status=scanf("%lf %lf", &a, &b); printf("a = %f, b = %f, read val = %d\n", a, b, status); printf("Minimum number = %f", min(a, b)); return 0; } double min(double x, double y) { return ((x<y)?x:y); }
the_stack_data/137429.c
#include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <stdint.h> #include <string.h> #define MAX_NAME_LEN 64 void usage(const char *pgm) { const char *name = (pgm) ? pgm : "usage"; fprintf(stderr, "%s -i <raw> -o <rgb> -s '<w>x<d>'\n", name); exit(1); } enum argmasks { ARG_IN_MASK = 1, ARG_OUT_MASK = 2, ARG_SZ_MASK = 4 }; #define BYTES_PER_PIXEL 3 static enum argmasks needed_args = ARG_OUT_MASK | ARG_SZ_MASK; int process_arg(char **argv, char pos, char token, enum argmasks mask, char *val) { if (argv[pos][0] == '-' && argv[pos][1] == token) { strncpy(val, argv[pos + 1], MAX_NAME_LEN); pos += 2; if (!(needed_args & mask)) { fprintf(stderr, "already saw arg %x\n", mask); usage(argv[0]); } needed_args &= ~mask; } return pos; } int main(int argc, char **argv) { char outfile[MAX_NAME_LEN]; char dimensions[MAX_NAME_LEN]; int width = 0, height = 0; int i = 1; uint8_t *data; dimensions[0] = 0; while (i < argc) { i = process_arg(argv, i, 'o', ARG_OUT_MASK, outfile); i = process_arg(argv, i, 's', ARG_SZ_MASK, dimensions); if (dimensions[0] != 0) { if (sscanf(dimensions, "%dx%d", &width, &height) != 2) { fprintf(stderr, "couldn't parse size: %s\n", dimensions); usage(argv[0]); } } } if (needed_args & (ARG_OUT_MASK | ARG_SZ_MASK)) usage(argv[0]); fprintf(stderr, "size: %dx%d: output: %s\n", width, height, outfile); int outfd = open(outfile, O_CREAT | O_WRONLY | O_TRUNC, S_IRUSR | S_IWUSR); if (outfd == -1) { perror(outfile); return 3; } if (!(data = malloc(BYTES_PER_PIXEL * width))) { fprintf(stderr, "malloc failed\n"); return 4; } int row = 0; for (int row = 0; row < height; row++) { ssize_t rc; memset(data, 0, BYTES_PER_PIXEL * width); for (int i = 0; i < BYTES_PER_PIXEL * width; i += BYTES_PER_PIXEL) { #if 0 int gray = i/BYTES_PER_PIXEL + row; if (gray > 255) gray = (255 - (gray - 256)); for (int p=0; p<BYTES_PER_PIXEL; p++) data[i+p] = gray; #else switch (row / 16) { case 0: data[i + 0] = i / 3; break; case 1: data[i + 1] = i / 3; break; case 2: data[i + 2] = i / 3; break; case 3: data[i + 0] = i / 3; data[i + 2] = i / 3; break; case 4: data[i + 1] = i / 3; data[i + 2] = i / 3; break; case 5: data[i + 0] = i / 3; data[i + 1] = i / 3; break; default: data[i + 0] = i / 3; data[i + 1] = i / 3; data[i + 2] = i / 3; break; } #endif } /* Once we have RGB for this row we can write it out */ if ((rc = write(outfd, data, BYTES_PER_PIXEL * width)) == -1) { perror("write"); break; } if (rc < BYTES_PER_PIXEL * width) { fprintf(stderr, "short write? %d\n", (int)rc); } } close(outfd); return 0; }
the_stack_data/56852.c
#include <stdio.h> int main(){ int calc = 20; int totalTo = 10; int i = 1; int j = 1; int result; for(i=1;i <= calc;i++){ printf("----------------------------------------- \n"); printf("| Calculing the tab of the %d number \n \n", i); for(j=1; j <= totalTo;j++){ result = (i*j); printf("| %d x %d = %d \n", i, j, result); } printf(" \n\n "); } }
the_stack_data/412661.c
#include <stdio.h> #include <unistd.h> int main() { printf("Process ID: %d\nParent Process ID: %d\n", getpid(), getppid()); return 0; }
the_stack_data/93701.c
/* * The MIT License (MIT) * * Copyright (c) 2016 IBM Corp. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "pty.h" #include <fcntl.h> #include <errno.h> #include <string.h> int openpty(int *amaster, int *aslave, char *name, const struct termios *termp, const struct winsize *winp) { const char* tty_path; int master = -1; int slave = -1; int save_errno; if(!aslave || !amaster) { errno = ENOENT; return -1; } if ((master = open("/dev/ptc", O_RDWR | O_NOCTTY)) == -1) goto error; *amaster = master; if ((tty_path = ttyname(master)) == NULL) goto error; if ((slave = open(tty_path, O_RDWR | O_NOCTTY)) == -1) goto error; *aslave = slave; if ((tty_path = ttyname(slave)) == NULL) goto error; /* Not supported in PASE */ /* if(revoke(tty_path) == -1) goto error; */ if(name != NULL) { strcpy(name, tty_path); } if(termp != NULL && tcsetattr(master, TCSANOW, termp) == -1) goto error; if(winp != NULL && ioctl(master, TIOCSWINSZ, winp) == -1) goto error; return 0; error: save_errno = errno; if(master >= 0) close(master); if(slave >= 0) close(slave); errno = save_errno; return -1; } pid_t forkpty(int *amaster, char *name, const struct termios *termp, const struct winsize *winp) { pid_t pid; int master = -1; int slave = -1; int save_errno; if(!amaster) { errno = ENOENT; return -1; } if(openpty(&master, &slave, name, termp, winp) < 0) { return (pid_t) -1; } pid = fork(); if(pid < 0) { save_errno = errno; close(master); close(slave); errno = save_errno; } else if(pid == 0) { close(master); // login_tty returns 0 or -1, which is // conveniently the same return codes we need pid = (pid_t) login_tty(slave); } else { close(slave); *amaster = master; } return pid; } int login_tty(int fd) { const char* tty_path; int slave; // make sure fd is connected to a TTY if(isatty(fd) == -1) return -1; // check fd was opened R/W if(fcntl(fd, F_GETFL) & O_RDWR != O_RDWR) return -1; // allocate a new session if(setsid() == -1) return -1; if ((tty_path = ttyname(fd)) == NULL) return -1; // NOTE: AIX does not have an IOCTL to set the controlling terminal. // When you open a TTY without a controlling terminal *and* you're // the session leader, the opened fd will automatically be set as // your controlling terminal, unless you pass O_NOCTTY to open. // // Here, we re-open the TTY using the path returned by ttyname and // make sure that O_NOCTTY is not set so that it becomes our // controlling terminal. if ((slave = open(tty_path, O_RDWR)) == -1) return -1; // Now that we've opened a new FD to the TTY, close the original close(fd); // point stdin, stdout, stderr at the terminal fd if(dup2(slave, 0) == -1) return -1; if(dup2(slave, 1) == -1) return -1; if(dup2(slave, 2) == -1) return -1; // close the terminal fd close(slave); return 0; }
the_stack_data/55689.c
#include <stdio.h> #include <stdlib.h> #define hash(v, M) (v % M) #define hashTwo(v, M) (v % 97 + 1) // saltos esquisitos hihi #define Key(x) (x.chave) #define less(a,b) (Key(a) < Key(b)) #define eq(a,b) (a == b) #define null(A) (Key(ht[A]) == Key(NULLItem)) typedef struct Item{ int chave; long e1, e2; long elemento; } Item; Item NULLItem = {0, 0, 0, 0}; static int N, M = 100; static Item *ht; void HTinsert(Item item); void expand(); Item HTsearch (int v); int main(int argc, char const *argv[]) { Item um; Item dois; Item tres; um.chave = 1; um.e1 = 1; um.elemento = 1; um.e2 = 1; dois.chave = 1; dois.e1 = 1; dois.elemento = 1; dois.e2 = 1; tres.chave = 1; tres.e1 = 1; tres.elemento = 1; tres.e2 = 1; HTinsert(um); return 0; } void expand(){ int i; Item *t = ht; ht = malloc(sizeof(Item) * M * 2); M = M * 2; for (i = 0; i < M/2; i++) if (Key(t[i]) != Key(NULLItem)) // t = ht antiga HTinsert(t[i]); free(t); } void HTinsert(Item item){ int v = Key(item); int i = hash(v, M); int k = hashTwo(v, M); while(!null(i)) i = (i + k) % M; printf("------------------------------->debug<---------------------------------------\n"); ht[i] = item; N++; if (N > M/2) //Já tenho a metade dos elementos do tamanho da minha tabela. Vamos expandir expand(); } Item HTsearch (int v){ int i = hash(v, M); int k = hashTwo(v, M); while(!null(i)) if(eq(v, Key(ht[i]))) return ht[i]; else i = (i + k) % M; return NULLItem; }
the_stack_data/555898.c
int foo(int n){ int i = 1; int sum = 0; int product = 1; if (i<=n){ sum = sum + i; product = product * i; i = i + 1; } return sum; } int main(){ int x,y,z; if (y > 0) y = y + 1; else{ y = foo(y) - 1; // y < 1, y' = 0 x = 7; // y < 1, y' = 0, x = 7 y = foo(x) + 3; // y < 1, y' = 0, x = 7, y'' = 4 x = -2; // y < 1, y' = 0, y'' = 1, x = 7, x' = -2, y = foo(x) + 5; // y < 1, y' = 0, y'' = 1, x = 7, x' = -2, y'''=0 } z = x; return z ; }
the_stack_data/54501.c
/* shellsort: sort v[0]... v[n-1] into increasing order */ /* starting with len(v[])/2, the comparision interval is cut in half at each iteration of the outermost looṕ, which means that: "In early stages far apart elements are compared, rather than adjacent ones as in similar interchange sorts. This tends to eliminate large amounts of disorder quickly, so later stages have less work to do" - K&R, page 62. */ void shellsort(int v[], int n) { int gap, i, j, temp; for (gap = n/2; gap > 0; gap /= 2) for (i = gap; i < n; i++) for (j = i-gap; j >= 0 && v[j] > v[j+gap]; j-=gap) for (j = i - gap; j >= 0 && v[j] > v[j+gap]; j-=gap){ temp = v[j]; v[j] = v[j+gap]; v[j+gap] = temp; } }
the_stack_data/218892053.c
#include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <string.h> #include <time.h> #include <sys/syscall.h> #include <unistd.h> #define TapeLenght 10 /* Struct for transition table cells. Element format: (elem, state, head) elem: Value to write to the tape (0/1) state: State to which it changes (A/B/C/H) head: Describes the movement of head (Right/Left) */ struct busyBeaver { int elem; int state; // state A = 0; state B = 1; state C = 2; state H = 3 char head; }; struct busyBeaver Ttable[3][4]; // Transition table int tape[TapeLenght] = {0}; // Initial state of tape: 0000000000 int headCell = 2; // Consider the head to be at tape cell 2 initially int step; int state; /* Our 3-state 2-symbol Transition table:(2*3 matrix) +---------+---------+--------+-------+ | | A | B | C | +---------+---------+--------+-------+ | 0 | 1RB | 0RC | 1LC | +---------+---------+--------+-------+ | 1 | 1RH | 1RB | 1LA | +---------+---------+--------+-------+ */ void Print_TT() { printf("\033[1;31m"); // Color coding: RED color printf("\t-------------------------------------------------------------------\n"); printf("\033[0m"); // Back to default color printf("\033[1;32m"); // Color coding: GREEN color printf("\t\t\tOur 3-state 2-symbol Transition table\n"); printf("\033[0m"); // Back to default color printf("\033[1;31m"); // Color coding: RED color printf("\t-------------------------------------------------------------------\n\n"); printf("\033[0m"); // Back to default color printf("\033[1;34m"); // Color coding: BLUE color printf("\t\t\t+---------+---------+--------+-------+\n"); printf("\t\t\t| | A | B | C |\n"); printf("\t\t\t+---------+---------+--------+-------+\n"); printf("\t\t\t| 0 | 1RB | 0RC | 1LC |\n"); printf("\t\t\t+---------+---------+--------+-------+\n"); printf("\t\t\t| 1 | 1RH | 1RB | 1LA |\n"); printf("\t\t\t+---------+---------+--------+-------+\n\n"); printf("\033[0m"); // Back to default color printf("\033[1;31m"); // Color coding: RED color printf("\t-------------------------------------------------------------------\n"); printf("\t-------------------------------------------------------------------\n"); printf("\033[0m"); // Back to default color return; } void displayTape() { printf("\n\t\t\t\t"); for (int i = 0; i < TapeLenght; i++) { if (i == headCell) { printf("\033[1;31m"); // Color coding: RED color printf("%d ", tape[i]); printf("\033[0m"); // Back to default color } else { printf("\033[0;33m"); // Color coding: YELLOW color printf("%d ", tape[i]); printf("\033[0m"); // Back to default color } } printf("\n"); printf("\t\t\t\t"); for (int j = 0; j < TapeLenght; j++) { if (j == headCell) { printf("\033[1;36m"); // Color coding: CYAN color printf("\u2191"); // Unicode of 'UP Arrow' symbol printf("\033[0m"); // Back to default printf("\n"); break; } printf(" "); } } void GameStats() { displayTape(); printf("\n"); printf("\033[1;35m"); // Color coding: PURPLE color printf("-->> "); printf("\033[0m"); // Back to default color printf("\033[1;34m"); // Color coding: BLUE color printf("Step: "); printf("\033[0m"); // Back to default color printf("\033[1;31m"); // Color coding: RED color printf("%d ; ", step); printf("\033[0m"); // Back to default color printf("\033[1;34m"); // Color coding: BLUE color printf("State: "); printf("\033[0m"); // Back to default color printf("\033[1;31m"); // Color coding: RED color printf("%c\n\n", state == 0 ? 'A' : (state == 1 ? 'B' : (state == 2 ? 'C' : 'H'))); printf("\033[0m"); // Back to default color } void Game() { system("clear"); step = 0; state = 0; //**************************** Initializing Transition table ******************************** // T(A, 0) = (1RB) // T(A, 1) = (1RH) Ttable[0][0].elem = 1; Ttable[1][0].elem = 1; Ttable[0][0].head = 'R'; Ttable[1][0].head = 'R'; Ttable[0][0].state = 1; Ttable[1][0].state = 3; // T(B, 0) = (0RC) // T(B, 1) = (1RB) Ttable[0][1].elem = 0; Ttable[1][1].elem = 1; Ttable[0][1].head = 'R'; Ttable[1][1].head = 'R'; Ttable[0][1].state = 2; Ttable[1][1].state = 1; // T(C, 0) = (1LC) // T(C, 1) = (1LA) Ttable[0][2].elem = 1; Ttable[1][2].elem = 1; Ttable[0][2].head = 'L'; Ttable[1][2].head = 'L'; Ttable[0][2].state = 2; Ttable[1][2].state = 0; do { system("clear"); Print_TT(); // Printed only at step 0 if(step == 0) { printf("\033[1;35m"); printf("-->> "); printf("\033[0m"); printf("\033[0;37m"); printf("Tape condition at the start"); printf("\033[0m"); } GameStats(); printf("\033[1;32m"); printf("\t*******************************************************************\n"); printf("\033[0m"); step = step + 1; // Incrementing step by 1 int Read = tape[headCell]; tape[headCell] = Ttable[tape[headCell]][state].elem; // Overwriting the tape element with the // element given in transition table. if (Ttable[Read][state].head == 'R') // Positioning head pointer headCell = headCell + 1; else headCell = headCell - 1; state = Ttable[Read][state].state; // Changing state sleep(2); } while(state != 3); // At HALT state system("clear"); Print_TT(); GameStats(); printf("\033[1;32m"); printf("\t*******************************************************************\n"); printf("\033[0m"); return; } int main() { system("clear"); char play = 'Y'; char stop = 'N'; char input; printf("--- Do you want to look at the 3-state 2-symbol busy beaver ? \n"); printf("--- Enter 'Y' to start and 'N' to exit\n"); printf("--- (Y/N): "); scanf("%c", &input); if(input != play) { printf("\033[1;32m"); printf("\n\n\t\t\t\t\033[1;31mThank You :)\033\n\n"); printf("\033[0m"); return 0; } Game(); printf("\033[1;32m"); printf("\n\n\t\t\t\t\033[1;31mThank You :)\033\n\n"); printf("\033[0m"); return 0; }
the_stack_data/73247.c
#include <stdio.h> #include <unistd.h> #include <string.h> #include <math.h> double A[80][80]; double x[80]; double y[80]; double tmp[80]; static void init_array() { int i, j; for (i = 0; i < 80;) { x[i] = i * M_PI; for (j = 0; j < 80;) { A[i][j] = ((double)i * j) / 80; j++; } i++; } } /* Define the live-out variables. Code is not executed unless POLYBENCH_DUMP_ARRAYS is defined. */ static inline void print_array(int argc, char** argv) { int i; #ifndef POLYBENCH_DUMP_ARRAYS if(argc > 42 && !strcmp(argv[0], "")) #endif { for (i = 0; i < 80; i++) { fprintf(stderr, "%0.2lf ", y[i]); if(i % 80 == 20) fprintf(stderr, "\n"); } fprintf(stderr, "\n"); } } int main(int argc, char** argv) { int i, j; /* Initialize array. */ init_array(); for (i = 0; i < 80; i++) y[i] = 0; for (i = 0; i < 80; i++) { tmp[i] = 0; for (j = 0; j < 80; j++) tmp[i] = tmp[i] + A[i][j] * x[j]; for (j = 0; j < 80; j++) y[j] = y[j] + A[i][j] * tmp[i]; } print_array(argc, argv); return 0; }
the_stack_data/92489.c
// ducts.c // version 2.1 // Fri Sep 23 00:04:54 PDT 2016 // https://github.com/ngokli/ducts // // Neal Gokli // // A Solution to the Quora Datacenter Cooling problem // // Problem statement: http://www.businessinsider.com/heres-the-test-you-have-to-pass-to-work-at-quora-silicon-valleys-hot-new-86-million-startup-2010-4 // // See https://github.com/ngokli/ducts for latest version (and other versions) // // // Version History // 1.0 Initial release // 1.1 Added this block of comments // 2.0 Using a 64-bit uint64_t instead of an array to store the room structure. // This means width*length is limited to 64. // 2.1 Performance bug fix: No longer continuing to search after reaching the // end room. // 3.0 Replace position struct with a uint64_t bitmask into the room structure. // Exactly one bit is set in a position bitmask at any time. // Finally, something faster than version 1! But only about 25% faster. // 3.1 Simplified search2() with a (kind of complicated) macro. // Performance unchanged. // 4.0 Added periodic checking for empty rooms that are cut off, using a // recursive flood-fill algorithm. The flood-fill is *much* less expensive // than the path search, so avoiding some large dead-end branches gives a // huge performance gain. // 4.1 Added forward declarations, moved functions and global variable // definitions, and fixed up comments/formatting. Sorry for the messy // diff, but rest assured there are no material changes. // 4.2 Added scanf_int_safe(), a scanf wrapper to handle error checking and // reporting. // 4.3 Added macros to replace hardcoded values. // 4.4 Replaced call_with_param() macro with call_with_params() macro (takes // variable number of parameters). Just to play with __VA_ARGS__ in // macros ^_^. Maybe I will use the added functionality later. // 4.5 Added some methods to handle input, setup, and debug output. // 4.6 Fixed another performance bug. try_flood() no longer returns success // when exactly one room is cut off. This does not affect the results, but // fixing it gives a huge performance boost. // 4.7 Fixed error message formatting. // 4.8 Bugfix: Now works for 8x8 datacenters // 4.9 Used #ifdef WITH_STATS_AND_PROGRESS to exclude that code unless it is // explicitly desired. 20% to 25% percent performance gain. // 5.0 Bugfix: Now correctly handles 64-room inputs. Also fixed scanf error // checking, and added a check for input with more than 64 rooms. #include <stdlib.h> #include <stdio.h> #include <stdarg.h> #include <string.h> #include <inttypes.h> #include <stdbool.h> #include <errno.h> #include <math.h> // ******* Constant Macros ******* // Input values #define EMPTY_ROOM_VAL 0 #define EXCLUDE_ROOM_VAL 1 #define START_ROOM_VAL 2 #define END_ROOM_VAL 3 // Threshold for printing progress dots in verbose mode #define SEARCHES_PER_DOT (1 << 30) // ******* Global Variables ******* // *** Output Verbosity *** bool quiet = false; // From command line -q bool verbose = false; // From command line -v // ** room setup ** int width; int length; int num_rooms = 0; uint64_t start_room; uint64_t end_room; // *** Bitmasks *** // For manipulating rooms and position // "largest" room position uint64_t max_pos; // Bits along the corresponding edges are set in these variables uint64_t left_edge; uint64_t right_edge; uint64_t up_edge; uint64_t down_edge; // *** Flood-Fill Check *** // Global variables to avoid passing int flood_rooms_left; int flood_rooms_left_threshold; uint64_t flood_rooms; // *** Stats *** #ifdef WITH_STATS_AND_PROGRESS // Number of calls to search() and flood_fill() uint64_t search_count = 0; uint64_t flood_fill_count = 0; // Number of times flood-filling check allows the search to stop early (or not) uint64_t flood_early_stop_count = 0; uint64_t flood_no_early_stop_count = 0; #endif // ******* Macros ******* // Allows a macro to call a function after piecing together the function name #define call_with_params(name, ...) name(__VA_ARGS__) // Move pos in the corresponding direction #define pos_left(pos) ((pos) >> 1 ) #define pos_right(pos) ((pos) << 1 ) #define pos_up(pos) ((pos) >> (width)) #define pos_down(pos) ((pos) << (width)) // call search() in a particular direction from the passed pos. // Adds the return value of search() to solution_count. // // This macro is meant to simplify the code in search2(). // An alternative is to have a helper function that takes a direction // "index" between 0 and 3. The direction macros (e.g. pos_left()) would be // accessed through an array of function pointers. The edge bitmasks would // also be accessed through an array. This may complicate things for // compiler optimization. Or not? I should try it out. // // This is also meant for me to get to play around with complicated macros #define search_in_direction(pos, direction, rooms, rooms_left, solution_count) \ do { \ if (0 == (direction ## _edge & pos)) { \ solution_count += search(call_with_params(pos_ ## direction, pos), \ rooms, rooms_left); \ } \ } while (0) // Like search_in_direction, but for flood_fill() #define flood_fill_in_direction(pos, direction, flood_rooms, flood_rooms_left) \ do { \ uint64_t next_pos = call_with_params(pos_ ## direction, pos); \ if ( (0 == (direction ## _edge & pos) ) && \ (room_free(next_pos, flood_rooms)) ) { \ flood_fill(next_pos); \ if (0 == flood_rooms_left) { \ return; \ } \ } \ } while (0) // ******* Forward Declarations ******* // *** I/O Methods *** // Prints usage info void print_usage(char *basename); // Read and handle command-line arguments void handle_cli_args(int argc, char* argv[]); // Read and handle datacenter rooms map input uint64_t handle_datacenter_input(); // Prints unless quiet is set void print_normal(char* fmt, ...); // Prints only if verbose is set void print_verbose(char* fmt, ...); // Prints rooms in a friendly way void print_rooms(uint64_t rooms); // Prints rooms and other helpful debug info void print_rooms_setup(uint64_t rooms); // Wraps scanf("%d", &var) in some error checking and reporting code. // error_string is used for context in error messages. // Returns the int value read from stdin int scanf_int_safe(char* error_string); // *** Recursive Flood-Fill Check *** // Checks whether all empty rooms can be reached from the current state // Sets flood_rooms_left_threshold. Flood-fill checks are only performed when // rooms_left is below this value. // Uses global variables to determine the value called. void set_flood_fill_threshold(); // Decides if a flood-fill check should be done bool should_flood_fill(int rooms_left); // Recursive method that fills every empty room (in flood_rooms) that can be // reached from pos. Use try_flood() to initiate this flood-fill check. // Uses flood_rooms and flood_rooms_left global variables. void flood_fill(uint64_t pos); // Do a flood-fill check. // Checks if all empty rooms can be reached from the current state. // Returns true iff it is possible. // If try_flood returns false, the current search branch should be abandoned. bool try_flood(uint64_t pos, uint64_t rooms, int rooms_left); // *** Recursive Path Search *** // The core functionality // search() checks if the current state is a solution or a possible dead end. // Otherwise, it calls search2() to continue the search. // Returns the number of solutions (paths) found. // Increments global variable search_count each time search() is called. int search(uint64_t pos, uint64_t rooms, int rooms_left); // search2() simply calls search() in the four directions, avoiding wrapping // over edges. int search2(uint64_t pos, uint64_t rooms, int rooms_left); // *** Other helper methods *** // Checks if room at pos is empty // Returns true if empty bool room_free(uint64_t pos, uint64_t rooms); // Set edges (left_edge, etc.) based on height and width void set_edges(); // ******* I/O methods ******* void print_usage(char *basename) { fprintf(stderr, "Usage: %s [-q]\n", basename); } void handle_cli_args(int argc, char* argv[]) { // Can take -q or -v as a command line argument if (argc > 2) { print_usage(argv[0]); exit(1); } if (argc == 2) { if (strcmp(argv[1], "-q") == 0) { quiet = true; } else if(strcmp(argv[1], "-v") == 0) { verbose = true; } else { print_usage(argv[0]); exit(2); } } } uint64_t handle_datacenter_input() { // Get the width and length first width = scanf_int_safe("width"); length = scanf_int_safe("length"); if (64 < width * length) { fputs("Error: width*length greater than 64.\n", stderr); exit(3); } max_pos = (uint64_t)1 << (width * length - 1); set_edges(); // Get the actual room structure uint64_t rooms = 0; uint64_t pos = 1; do { int val; char input_info[32]; snprintf(input_info, sizeof(input_info), "rooms[pos=%lu]", pos); val = scanf_int_safe(input_info); if (val == EMPTY_ROOM_VAL) { num_rooms++; } else if (val == EXCLUDE_ROOM_VAL) { rooms |= pos; } else if (val == START_ROOM_VAL) { rooms |= pos; start_room = pos; } else if (val == END_ROOM_VAL) { end_room = pos; } pos <<= 1; } while ((pos <= max_pos) && (pos != 0)); set_flood_fill_threshold(); return rooms; } void print_normal(char* fmt, ...) { if (!quiet) { va_list args; va_start(args, fmt); vprintf(fmt, args); va_end(args); } } void print_verbose(char* fmt, ...) { if (verbose) { va_list args; va_start(args, fmt); vprintf(fmt, args); va_end(args); } } void print_rooms(uint64_t rooms) { uint64_t pos = 1; do { print_verbose("%d ", !room_free(pos, rooms)); if (0 != (pos & right_edge)) { print_verbose("\n"); } pos <<= 1; } while ((pos <= max_pos) && (pos != 0)); } void print_rooms_setup(uint64_t rooms) { // Print helpful info print_verbose("width: %hd, length: %hd\n", width, length); print_verbose("start_room: %lu\n", start_room); print_verbose("end_room: %lu\n", end_room); print_rooms(rooms); print_verbose("num_rooms: %d\n", num_rooms); print_verbose("flood_rooms_left_threshold: %d\n", flood_rooms_left_threshold); } int scanf_int_safe(char* error_string) { errno = 0; int val; int scanf_count; scanf_count = scanf("%d", &val); if (scanf_count == 1 ) { return val; } if (scanf_count == EOF) { fprintf(stderr, "Mismatch when reading %s.\n", error_string); exit(4); } fprintf(stderr, "Error reading %s: %s\n", error_string, strerror(errno)); exit(errno); } // ******* Recursive Flood-Fill ******* void set_flood_fill_threshold() { // First attempt at a heuristic for a flood threshold // Flood-filling at the very begining of a search makes no sense, because it // is unlikely for the first few ducts to create a "bubble". // flood_rooms_left_threshold is used by should_flood_fill() to decide when // to start flood-filling. flood_rooms_left_threshold = num_rooms - (1.5 * sqrt((double)num_rooms) + 1); // I need to play around with threshold formulas a bit more, and try them // with more varied and complex datacenters. // Here's another attempt which seems to change the runtimes slightly (both // up and down: need to test more). Since the runtimes don't change much, // I think these are close to optimal for test cases being used. // int min_dim = (width > length) ? length : width; // flood_rooms_left_threshold = num_rooms - min_dim - 2; } bool should_flood_fill(int rooms_left) { return ( ( 0 == (rooms_left % 4) ) && ( flood_rooms_left_threshold > rooms_left) ); } void flood_fill(uint64_t pos) { #ifdef WITH_STATS_AND_PROGRESS flood_fill_count++; #endif flood_rooms_left--; if (flood_rooms_left == 0) { return; } flood_rooms |= pos; flood_fill_in_direction(pos, left, flood_rooms, flood_rooms_left); flood_fill_in_direction(pos, right, flood_rooms, flood_rooms_left); flood_fill_in_direction(pos, up, flood_rooms, flood_rooms_left); flood_fill_in_direction(pos, down, flood_rooms, flood_rooms_left); } bool try_flood(uint64_t pos, uint64_t rooms, int rooms_left) { flood_rooms = rooms; // flood_rooms_left works a bit differently from rooms_left, because the // count has to be decremented up front. Could be re-architected, but it // would be too much work for this toy project. flood_rooms_left = rooms_left + 1; flood_fill(pos); return (0 == flood_rooms_left); } // ******* Recursive Path Search ******* int search(uint64_t pos, uint64_t rooms, int rooms_left) { #ifdef WITH_STATS_AND_PROGRESS // Print some dots so we can monitor the speed search_count++; if (0 == (search_count % SEARCHES_PER_DOT)) { print_verbose("."); fflush(NULL); } #endif if (room_free(pos, rooms)) { if (0 < rooms_left) { // This room is empty, so it could be the end room if (pos == end_room) { // This is the end room, but there are still rooms left... no good! return 0; } if (should_flood_fill(rooms_left)) { // Try flood-filling (check if the end room is reachable from pos) if (!try_flood(pos, rooms, rooms_left)) { #ifdef WITH_STATS_AND_PROGRESS flood_early_stop_count++; #endif return 0; } #ifdef WITH_STATS_AND_PROGRESS else { flood_no_early_stop_count++; } #endif } // This room is empty and there are rooms left, so continue the search! return search2(pos, (rooms | pos), (rooms_left - 1)); } // This room is empty, so it could be the end room if (pos == end_room) { // No rooms left and this is the end room, so we found a solution! return 1; } // No rooms left and this is not the end room. // We should never reach here? return 0; } // This is not a free room, so this is not the way! return 0; } int search2(uint64_t pos, uint64_t rooms, int rooms_left) { int solution_count = 0; search_in_direction(pos, left, rooms, rooms_left, solution_count); search_in_direction(pos, right, rooms, rooms_left, solution_count); search_in_direction(pos, up, rooms, rooms_left, solution_count); search_in_direction(pos, down, rooms, rooms_left, solution_count); return solution_count; } // ******* Other Helper Methods ******* bool room_free(uint64_t pos, uint64_t rooms) { return (0 == (pos & rooms)); } void set_edges() { // Each of these edges has the corresponding bits set for its edge. // Set left_edge and right_edge left_edge = 0; right_edge = 0; uint64_t right_edge_start = (uint64_t)1 << (width - 1); for (int i = 0; i < length; i++) { left_edge = (left_edge << width) + 1; right_edge = (right_edge << width) + right_edge_start; } // Set up_edge and down_edge up_edge = 0; down_edge = 0; uint64_t down_edge_start = max_pos >> (width - 1); for (int i = 0; i < width; i++) { up_edge = (up_edge << 1) + 1; down_edge = (down_edge << 1) + down_edge_start; } } // ******* Main() ******* void main(int argc, char *argv[]) { handle_cli_args(argc, argv); uint64_t rooms; rooms = handle_datacenter_input(); print_rooms_setup(rooms); // Search! int solution_count = search2(start_room, rooms, num_rooms); print_verbose("\nsolutions: "); print_normal("%d\n", solution_count); #ifdef WITH_STATS_AND_PROGRESS print_verbose("search_count: %lu\n", search_count); print_verbose("flood_fill_count: %lu\n", flood_fill_count); print_verbose("flood_early_stop_count: %lu, flood_no_early_stop_count: %lu\n", flood_early_stop_count, flood_no_early_stop_count); #endif }
the_stack_data/45449915.c
// Exercises in computer graphics in OpenGL using C. The fourth semester of study. // Tomasz Wisniewski // Exercises 1-10 / Part 1 of 1 set. #include <stdio.h> #include <stdlib.h> #include <time.h> #include <string.h> #define TABSIZE 20 // --------------------------------------------------- // ZADANIE 1 // --------------------------------------------------- void rng_t(int *tab, int size) { srand(time(NULL)); for (int i = 0 ; i < size ; i++) { tab[i] = rand() % size; } } void inverse(int *tab , int size) { int tmp; for (int i = 0 ; i <= (size/2); i++) { tmp = tab[size - i - 1]; tab[size - i - 1] = tab[i]; tab[i] = tmp; } } void display_tab(int *tab, int size) { for (int i = 0 ; i < TABSIZE ; i++) printf("%3d ", tab[i]); printf("\n"); } void zad1() { int tab[TABSIZE]; rng_t(tab, TABSIZE); printf("zad 1:\n"); display_tab(tab , TABSIZE); inverse(tab, TABSIZE); display_tab(tab , TABSIZE); } // --------------------------------------------------- // ZADANIE 2 // --------------------------------------------------- struct zesp { float a , b ; }; struct zesp Dodaj(struct zesp z1 , struct zesp z2) { struct zesp z; z.a = z1.a + z2.a; z.b = z1.b + z2.b; return z; } void zad2() { struct zesp z1 , z2 , result; z1.a = 2; z1.b = 3; z2.a = 5; z2.b = 10; result = Dodaj(z1 , z2); printf("zad 2: z1 + z2 = %0.3f %0.3f\n", result.a , result.b); } // --------------------------------------------------- // ZADANIE 3 // --------------------------------------------------- long power(long a, long n) { long result = 1; for (int i = 0 ; i < n ; i++) { result = result * a; } return result; } void zad3() { printf("zad 3: power %ld\n" , power(2 , 5)); } // --------------------------------------------------- // ZADANIE 4 // --------------------------------------------------- struct maxmin { int max , min; }; struct maxmin szukaj(int *tab, int n) { struct maxmin result; int lMin , lMax; int first = 0 ; if (!first) { lMin = lMax = tab[0]; first = 1; } for (int i = 0 ; i < n ; i++) { if (tab[i] < lMin) lMin = tab[i]; if (tab[i] > lMax) lMax = tab[i]; } // sanity check printf("zad 4: min : %d\t max: %d\n", lMin, lMax); result.min = lMin; result.max = lMax; return result; } void zad4() { int tab[TABSIZE]; rng_t(tab, TABSIZE); display_tab(tab, TABSIZE); struct maxmin stru; stru = szukaj(tab , TABSIZE); } // --------------------------------------------------- // ZADANIE 5 // --------------------------------------------------- int parzysta(int a) { if (a % 2 == 0) return 1; else return 0; } void zad5(){ srand(time(NULL)); int input = rand() % 127 + 33; printf("zad 5: podana liczba ---> %d\t" , input); printf("funk parzysta ---> %d\n" , parzysta(input)); }; // --------------------------------------------------- // ZADANIE 6 // --------------------------------------------------- int sprawdz(int *tab, int n, int a) { for (int i = 0 ; i < n ; i++) { if (tab[i] == a) return i; } return -1; } void zad6() { int tab[TABSIZE]; int rng = rand() % TABSIZE; // automat do testu rng_t(tab, TABSIZE); printf("\nzad 6: a = %d , jest w tab %d \n" , rng , sprawdz(tab, TABSIZE, rng)); display_tab(tab , TABSIZE); }; // --------------------------------------------------- // ZADANIE 7 // --------------------------------------------------- int przepisz(int *tab, int *tab2 , int n) { for (int i = 0; i < n ; i++) { if (tab[i] > 0) tab2[i] = tab[i]; else tab2[i] = 0; } return n; } void zad7() { int tab[TABSIZE]; int tab2[TABSIZE]; rng_t(tab, TABSIZE); printf("\nzad 7: %d \n", przepisz(tab, tab2 , TABSIZE)); } // --------------------------------------------------- // ZADANIE 8 // --------------------------------------------------- double srednia(int *tab, int n){ double result; double sum = 0; long count; for (int i = 0 ; i < n ; i++, count++) sum = sum + tab[i]; result = sum / count; return result; } void zad8() { int tab[TABSIZE]; rng_t(tab, TABSIZE); printf("zad 8: %f \n" , srednia(tab , TABSIZE)); } // --------------------------------------------------- // ZADANIE 9 // --------------------------------------------------- int palindrom (char *tab, int n) { for (int i = 0 ; i <= (n/2) ; i++){ if (tab[i] == tab[n - i - 1]) printf("%c = %c , " , tab[i] , tab[n - i - 1]); else { printf("%c != %c , " , tab[i] , tab[n - i - 1]); printf("\n"); return -1; } } printf("\n"); return 0; } void zad9() { char *word = "kajak"; int len = strlen(word); char *word2 = "kajAk"; int len2 = strlen(word2); printf("zad 9:\n"); printf("%d \n" , palindrom(word , len)); printf("%d \n" , palindrom(word2 , len2)); } // --------------------------------------------------- // ZADANIE 10 // --------------------------------------------------- char max_znak(FILE *f, int *n) { int chars[256] = {0}; char byte; fseek(f, 0L, SEEK_END); long fend = ftell(f); fseek(f, 0L , SEEK_SET); for (long position = 0 ; position < fend; position++) { fseek(f, position , SEEK_SET); byte = getc(f); chars[byte] = chars[byte] + 1; } fclose(f); int max = 0; char result = 0; for (int i = 0 ; i < 256 ; i++) { if (max < chars[i]) { max = chars[i]; result = i ; } } *n = max; return result; } void zad10() { char *fname = "data.txt"; FILE *fout = fopen(fname, "w+"); char *line1= "When the code is executed, it creates a new file data.txt in current directory and writes two lines."; char *line2= "\nHere is the second line."; fputs(line1, fout); fputs(line2, fout); fclose(fout); int frequency = 0; char freq_c; freq_c = max_znak(fopen(fname, "rb"), &frequency); printf("zad 10: ASCII: %c %d freq: %d \n", freq_c, freq_c, frequency); } // --------------------------------------------------- // MAIN // --------------------------------------------------- int main() { zad1(); zad2(); zad3(); zad4(); zad5(); zad6(); zad7(); zad8(); zad9(); zad10(); }
the_stack_data/92328854.c
//! Faça um programa em C que possibilite calcular o peso total e o valor total a pagar de bovinos em uma //! pesagem. O programa deve solicitar a entrada do valor da arroba, e o peso de cada animal que for para //! a balança. Caso o usuário responda 0 (zero), o programa deve encerrar a entrada de dados e calcular o //! peso total acumulado bem como o preço total à pagar. O preço a pagar é dado pela seguinte fórmula: //! Preço Total = Quantidade de Arrobas * Preço Arroba; //! Peso Total Acumulado = (Peso Total/2); //! Para calcular a Quantidade de Arrobas, basta utilizar a seguinte fórmula: //! Quantidade de Arrobas = (Peso Total Acumulado/ 15); #include<stdio.h> int main(){ int i ; float peso_total,valor,arrouba,preco_arrouba,peso,total; while(i >= 1 ){ printf("digite o peso do animal : "); scanf("%f",&peso); printf("digite o valor da arrouba: "); scanf("%f",&preco_arrouba); peso_total = peso / 2 ; arrouba = peso_total / 15 ; valor = arrouba * preco_arrouba ; total += valor ; printf("deseja continuar ? (1-sim ou 0-nao) : "); scanf("%d",&i); printf("o valor deste animal e : %.2f\n",total); } printf("\nvalr acumludo e : %.2f",total); return 0 ; }
the_stack_data/181392903.c
int res_init() { return 0; }
the_stack_data/998355.c
# include <stdio.h> int main(void){ int vetor[10] = {6, 4, 1, 9, 8, 0, 5, 7, 3, 2}, i; void sortSimples(int vetor[], int n); sortSimples(vetor, 10); for(i = 0; i < 10; i++){ printf("%i ", vetor[i]); } printf("\n"); return 0; } void sortSimples(int vetor[], int n){ int i, j, temp; for (i = 0; i < n; i++){ for(j = i + 1; j < n; j++){ if(vetor[i] > vetor[j]){ temp = vetor[i]; vetor[i] = vetor[j]; vetor[j] = temp; } } } }
the_stack_data/142274.c
// REQUIRES: system-linux // RUN: clang -o %t %s -O2 // RUN: llvm-mctoll -d -I /usr/include/stdio.h %t // RUN: clang -o %t1 %t-dis.ll // RUN: %t1 2>&1 | FileCheck %s // CHECK: [Implicit AH/AL] // CHECK-NEXT: Test 0xfffffffa IDIV8r 0xfffffff0 // CHECK-NEXT: Quotient = 0xfffffff1, Remainder = 0xa // CHECK-EMPTY #include <stdio.h> // IDIVr8 int __attribute__((noinline)) test_idiv8r(char a, char b) { char quotient = 0; char remainder = 0; printf("[Implicit AH/AL]\nTest 0x%x IDIV8r 0x%x\n", a, b); asm("movzbw %2, %%ax\n" "idivb %3\n" "mov %%ah, %1\n" "mov %%al, %0\n" : "=r"(quotient), "=r"(remainder) /* output operands */ : "r"(a), "r"(b) /* input operands */ : "%ax" /* list of clobbered registers */ ); printf("Quotient = 0x%x, Remainder = 0x%x\n", quotient, remainder); return 0; } int main() { test_idiv8r(0xFA, 0xF0); return 0; }
the_stack_data/104828344.c
/* Autogenerated: 'src/ExtractionOCaml/bedrock2_word_by_word_montgomery' --lang bedrock2 --static --no-wide-int --widen-carry --widen-bytes --split-multiret --no-select p256 32 '2^256 - 2^224 + 2^192 + 2^96 - 1' mul square add sub opp from_montgomery to_montgomery nonzero selectznz to_bytes from_bytes one msat divstep divstep_precomp */ /* curve description: p256 */ /* machine_wordsize = 32 (from "32") */ /* requested operations: mul, square, add, sub, opp, from_montgomery, to_montgomery, nonzero, selectznz, to_bytes, from_bytes, one, msat, divstep, divstep_precomp */ /* m = 0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff (from "2^256 - 2^224 + 2^192 + 2^96 - 1") */ /* */ /* NOTE: In addition to the bounds specified above each function, all */ /* functions synthesized for this Montgomery arithmetic require the */ /* input to be strictly less than the prime modulus (m), and also */ /* require the input to be in the unique saturated representation. */ /* All functions also ensure that these two properties are true of */ /* return values. */ /* */ /* Computed values: */ /* eval z = z[0] + (z[1] << 32) + (z[2] << 64) + (z[3] << 96) + (z[4] << 128) + (z[5] << 160) + (z[6] << 192) + (z[7] << 224) */ /* bytes_eval z = z[0] + (z[1] << 8) + (z[2] << 16) + (z[3] << 24) + (z[4] << 32) + (z[5] << 40) + (z[6] << 48) + (z[7] << 56) + (z[8] << 64) + (z[9] << 72) + (z[10] << 80) + (z[11] << 88) + (z[12] << 96) + (z[13] << 104) + (z[14] << 112) + (z[15] << 120) + (z[16] << 128) + (z[17] << 136) + (z[18] << 144) + (z[19] << 152) + (z[20] << 160) + (z[21] << 168) + (z[22] << 176) + (z[23] << 184) + (z[24] << 192) + (z[25] << 200) + (z[26] << 208) + (z[27] << 216) + (z[28] << 224) + (z[29] << 232) + (z[30] << 240) + (z[31] << 248) */ /* twos_complement_eval z = let x1 := z[0] + (z[1] << 32) + (z[2] << 64) + (z[3] << 96) + (z[4] << 128) + (z[5] << 160) + (z[6] << 192) + (z[7] << 224) in */ /* if x1 & (2^256-1) < 2^255 then x1 & (2^256-1) else (x1 & (2^256-1)) - 2^256 */ #include <stdint.h> #include <memory.h> // LITTLE-ENDIAN memory access is REQUIRED // the following two functions are required to work around -fstrict-aliasing static inline uintptr_t _br2_load(uintptr_t a, size_t sz) { uintptr_t r = 0; memcpy(&r, (void*)a, sz); return r; } static inline void _br2_store(uintptr_t a, uintptr_t v, size_t sz) { memcpy((void*)a, &v, sz); } /* * Input Bounds: * in0: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * in1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * Output Bounds: * out0: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] */ static void internal_fiat_p256_mul(uintptr_t out0, uintptr_t in0, uintptr_t in1) { uintptr_t x1, x2, x3, x4, x5, x6, x7, x0, x23, x36, x39, x41, x37, x42, x34, x43, x45, x46, x35, x47, x32, x48, x50, x51, x33, x52, x30, x53, x55, x56, x31, x57, x28, x58, x60, x61, x29, x62, x26, x63, x65, x66, x27, x67, x24, x68, x70, x71, x25, x77, x80, x82, x78, x83, x75, x84, x86, x87, x76, x79, x89, x90, x40, x91, x81, x92, x94, x95, x44, x96, x85, x97, x99, x100, x49, x101, x88, x102, x104, x105, x54, x107, x59, x109, x64, x110, x38, x111, x113, x114, x69, x115, x73, x116, x118, x119, x72, x120, x74, x121, x123, x16, x137, x140, x142, x138, x143, x135, x144, x146, x147, x136, x148, x133, x149, x151, x152, x134, x153, x131, x154, x156, x157, x132, x158, x129, x159, x161, x162, x130, x163, x127, x164, x166, x167, x128, x168, x125, x169, x171, x172, x126, x139, x93, x175, x98, x176, x141, x177, x179, x180, x103, x181, x145, x182, x184, x185, x106, x186, x150, x187, x189, x190, x108, x191, x155, x192, x194, x195, x112, x196, x160, x197, x199, x200, x117, x201, x165, x202, x204, x205, x122, x206, x170, x207, x209, x210, x124, x211, x173, x212, x214, x220, x223, x225, x221, x226, x218, x227, x229, x230, x219, x222, x232, x233, x178, x234, x224, x235, x237, x238, x183, x239, x228, x240, x242, x243, x188, x244, x231, x245, x247, x248, x193, x250, x198, x252, x203, x253, x174, x254, x256, x257, x208, x258, x216, x259, x261, x262, x213, x263, x217, x264, x266, x267, x215, x17, x281, x284, x286, x282, x287, x279, x288, x290, x291, x280, x292, x277, x293, x295, x296, x278, x297, x275, x298, x300, x301, x276, x302, x273, x303, x305, x306, x274, x307, x271, x308, x310, x311, x272, x312, x269, x313, x315, x316, x270, x283, x236, x319, x241, x320, x285, x321, x323, x324, x246, x325, x289, x326, x328, x329, x249, x330, x294, x331, x333, x334, x251, x335, x299, x336, x338, x339, x255, x340, x304, x341, x343, x344, x260, x345, x309, x346, x348, x349, x265, x350, x314, x351, x353, x354, x268, x355, x317, x356, x358, x364, x367, x369, x365, x370, x362, x371, x373, x374, x363, x366, x376, x377, x322, x378, x368, x379, x381, x382, x327, x383, x372, x384, x386, x387, x332, x388, x375, x389, x391, x392, x337, x394, x342, x396, x347, x397, x318, x398, x400, x401, x352, x402, x360, x403, x405, x406, x357, x407, x361, x408, x410, x411, x359, x18, x425, x428, x430, x426, x431, x423, x432, x434, x435, x424, x436, x421, x437, x439, x440, x422, x441, x419, x442, x444, x445, x420, x446, x417, x447, x449, x450, x418, x451, x415, x452, x454, x455, x416, x456, x413, x457, x459, x460, x414, x427, x380, x463, x385, x464, x429, x465, x467, x468, x390, x469, x433, x470, x472, x473, x393, x474, x438, x475, x477, x478, x395, x479, x443, x480, x482, x483, x399, x484, x448, x485, x487, x488, x404, x489, x453, x490, x492, x493, x409, x494, x458, x495, x497, x498, x412, x499, x461, x500, x502, x508, x511, x513, x509, x514, x506, x515, x517, x518, x507, x510, x520, x521, x466, x522, x512, x523, x525, x526, x471, x527, x516, x528, x530, x531, x476, x532, x519, x533, x535, x536, x481, x538, x486, x540, x491, x541, x462, x542, x544, x545, x496, x546, x504, x547, x549, x550, x501, x551, x505, x552, x554, x555, x503, x19, x569, x572, x574, x570, x575, x567, x576, x578, x579, x568, x580, x565, x581, x583, x584, x566, x585, x563, x586, x588, x589, x564, x590, x561, x591, x593, x594, x562, x595, x559, x596, x598, x599, x560, x600, x557, x601, x603, x604, x558, x571, x524, x607, x529, x608, x573, x609, x611, x612, x534, x613, x577, x614, x616, x617, x537, x618, x582, x619, x621, x622, x539, x623, x587, x624, x626, x627, x543, x628, x592, x629, x631, x632, x548, x633, x597, x634, x636, x637, x553, x638, x602, x639, x641, x642, x556, x643, x605, x644, x646, x652, x655, x657, x653, x658, x650, x659, x661, x662, x651, x654, x664, x665, x610, x666, x656, x667, x669, x670, x615, x671, x660, x672, x674, x675, x620, x676, x663, x677, x679, x680, x625, x682, x630, x684, x635, x685, x606, x686, x688, x689, x640, x690, x648, x691, x693, x694, x645, x695, x649, x696, x698, x699, x647, x20, x713, x716, x718, x714, x719, x711, x720, x722, x723, x712, x724, x709, x725, x727, x728, x710, x729, x707, x730, x732, x733, x708, x734, x705, x735, x737, x738, x706, x739, x703, x740, x742, x743, x704, x744, x701, x745, x747, x748, x702, x715, x668, x751, x673, x752, x717, x753, x755, x756, x678, x757, x721, x758, x760, x761, x681, x762, x726, x763, x765, x766, x683, x767, x731, x768, x770, x771, x687, x772, x736, x773, x775, x776, x692, x777, x741, x778, x780, x781, x697, x782, x746, x783, x785, x786, x700, x787, x749, x788, x790, x796, x799, x801, x797, x802, x794, x803, x805, x806, x795, x798, x808, x809, x754, x810, x800, x811, x813, x814, x759, x815, x804, x816, x818, x819, x764, x820, x807, x821, x823, x824, x769, x826, x774, x828, x779, x829, x750, x830, x832, x833, x784, x834, x792, x835, x837, x838, x789, x839, x793, x840, x842, x843, x791, x21, x857, x860, x862, x858, x863, x855, x864, x866, x867, x856, x868, x853, x869, x871, x872, x854, x873, x851, x874, x876, x877, x852, x878, x849, x879, x881, x882, x850, x883, x847, x884, x886, x887, x848, x888, x845, x889, x891, x892, x846, x859, x812, x895, x817, x896, x861, x897, x899, x900, x822, x901, x865, x902, x904, x905, x825, x906, x870, x907, x909, x910, x827, x911, x875, x912, x914, x915, x831, x916, x880, x917, x919, x920, x836, x921, x885, x922, x924, x925, x841, x926, x890, x927, x929, x930, x844, x931, x893, x932, x934, x940, x943, x945, x941, x946, x938, x947, x949, x950, x939, x942, x952, x953, x898, x954, x944, x955, x957, x958, x903, x959, x948, x960, x962, x963, x908, x964, x951, x965, x967, x968, x913, x970, x918, x972, x923, x973, x894, x974, x976, x977, x928, x978, x936, x979, x981, x982, x933, x983, x937, x984, x986, x987, x935, x15, x14, x13, x12, x11, x10, x9, x22, x8, x1001, x1004, x1006, x1002, x1007, x999, x1008, x1010, x1011, x1000, x1012, x997, x1013, x1015, x1016, x998, x1017, x995, x1018, x1020, x1021, x996, x1022, x993, x1023, x1025, x1026, x994, x1027, x991, x1028, x1030, x1031, x992, x1032, x989, x1033, x1035, x1036, x990, x1003, x956, x1039, x961, x1040, x1005, x1041, x1043, x1044, x966, x1045, x1009, x1046, x1048, x1049, x969, x1050, x1014, x1051, x1053, x1054, x971, x1055, x1019, x1056, x1058, x1059, x975, x1060, x1024, x1061, x1063, x1064, x980, x1065, x1029, x1066, x1068, x1069, x985, x1070, x1034, x1071, x1073, x1074, x988, x1075, x1037, x1076, x1078, x1084, x1087, x1089, x1085, x1090, x1082, x1091, x1093, x1094, x1083, x1086, x1096, x1097, x1042, x1098, x1088, x1099, x1101, x1102, x1047, x1103, x1092, x1104, x1106, x1107, x1052, x1108, x1095, x1109, x1111, x1112, x1057, x1114, x1062, x1116, x1067, x1117, x1038, x1118, x1120, x1121, x1072, x1122, x1080, x1123, x1125, x1126, x1077, x1127, x1081, x1128, x1130, x1131, x1079, x1134, x1135, x1136, x1138, x1139, x1140, x1141, x1143, x1144, x1146, x1148, x1150, x1151, x1152, x1154, x1155, x1156, x1157, x1159, x1160, x1132, x1161, x1100, x1163, x1133, x1164, x1105, x1166, x1137, x1167, x1110, x1169, x1142, x1170, x1113, x1172, x1145, x1173, x1115, x1175, x1147, x1176, x1119, x1178, x1149, x1179, x1124, x1181, x1153, x1182, x1162, x1129, x1184, x1158, x1185, x1165, x1168, x1171, x1174, x1177, x1180, x1183, x1186, x1187, x1188, x1189, x1190, x1191, x1192, x1193, x1194; x0 = _br2_load((in0)+((uintptr_t)0ULL), sizeof(uintptr_t)); x1 = _br2_load((in0)+((uintptr_t)4ULL), sizeof(uintptr_t)); x2 = _br2_load((in0)+((uintptr_t)8ULL), sizeof(uintptr_t)); x3 = _br2_load((in0)+((uintptr_t)12ULL), sizeof(uintptr_t)); x4 = _br2_load((in0)+((uintptr_t)16ULL), sizeof(uintptr_t)); x5 = _br2_load((in0)+((uintptr_t)20ULL), sizeof(uintptr_t)); x6 = _br2_load((in0)+((uintptr_t)24ULL), sizeof(uintptr_t)); x7 = _br2_load((in0)+((uintptr_t)28ULL), sizeof(uintptr_t)); /*skip*/ x8 = _br2_load((in1)+((uintptr_t)0ULL), sizeof(uintptr_t)); x9 = _br2_load((in1)+((uintptr_t)4ULL), sizeof(uintptr_t)); x10 = _br2_load((in1)+((uintptr_t)8ULL), sizeof(uintptr_t)); x11 = _br2_load((in1)+((uintptr_t)12ULL), sizeof(uintptr_t)); x12 = _br2_load((in1)+((uintptr_t)16ULL), sizeof(uintptr_t)); x13 = _br2_load((in1)+((uintptr_t)20ULL), sizeof(uintptr_t)); x14 = _br2_load((in1)+((uintptr_t)24ULL), sizeof(uintptr_t)); x15 = _br2_load((in1)+((uintptr_t)28ULL), sizeof(uintptr_t)); /*skip*/ /*skip*/ x16 = x1; x17 = x2; x18 = x3; x19 = x4; x20 = x5; x21 = x6; x22 = x7; x23 = x0; x24 = (x23)*(x15); x25 = sizeof(intptr_t) == 4 ? ((uint64_t)(x23)*(x15))>>32 : ((__uint128_t)(x23)*(x15))>>64; x26 = (x23)*(x14); x27 = sizeof(intptr_t) == 4 ? ((uint64_t)(x23)*(x14))>>32 : ((__uint128_t)(x23)*(x14))>>64; x28 = (x23)*(x13); x29 = sizeof(intptr_t) == 4 ? ((uint64_t)(x23)*(x13))>>32 : ((__uint128_t)(x23)*(x13))>>64; x30 = (x23)*(x12); x31 = sizeof(intptr_t) == 4 ? ((uint64_t)(x23)*(x12))>>32 : ((__uint128_t)(x23)*(x12))>>64; x32 = (x23)*(x11); x33 = sizeof(intptr_t) == 4 ? ((uint64_t)(x23)*(x11))>>32 : ((__uint128_t)(x23)*(x11))>>64; x34 = (x23)*(x10); x35 = sizeof(intptr_t) == 4 ? ((uint64_t)(x23)*(x10))>>32 : ((__uint128_t)(x23)*(x10))>>64; x36 = (x23)*(x9); x37 = sizeof(intptr_t) == 4 ? ((uint64_t)(x23)*(x9))>>32 : ((__uint128_t)(x23)*(x9))>>64; x38 = (x23)*(x8); x39 = sizeof(intptr_t) == 4 ? ((uint64_t)(x23)*(x8))>>32 : ((__uint128_t)(x23)*(x8))>>64; x40 = (x39)+(x36); x41 = (x40)<(x39); x42 = (x41)+(x37); x43 = (x42)<(x37); x44 = (x42)+(x34); x45 = (x44)<(x34); x46 = (x43)+(x45); x47 = (x46)+(x35); x48 = (x47)<(x35); x49 = (x47)+(x32); x50 = (x49)<(x32); x51 = (x48)+(x50); x52 = (x51)+(x33); x53 = (x52)<(x33); x54 = (x52)+(x30); x55 = (x54)<(x30); x56 = (x53)+(x55); x57 = (x56)+(x31); x58 = (x57)<(x31); x59 = (x57)+(x28); x60 = (x59)<(x28); x61 = (x58)+(x60); x62 = (x61)+(x29); x63 = (x62)<(x29); x64 = (x62)+(x26); x65 = (x64)<(x26); x66 = (x63)+(x65); x67 = (x66)+(x27); x68 = (x67)<(x27); x69 = (x67)+(x24); x70 = (x69)<(x24); x71 = (x68)+(x70); x72 = (x71)+(x25); x73 = (x38)*((uintptr_t)4294967295ULL); x74 = sizeof(intptr_t) == 4 ? ((uint64_t)(x38)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x38)*((uintptr_t)4294967295ULL))>>64; x75 = (x38)*((uintptr_t)4294967295ULL); x76 = sizeof(intptr_t) == 4 ? ((uint64_t)(x38)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x38)*((uintptr_t)4294967295ULL))>>64; x77 = (x38)*((uintptr_t)4294967295ULL); x78 = sizeof(intptr_t) == 4 ? ((uint64_t)(x38)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x38)*((uintptr_t)4294967295ULL))>>64; x79 = (x38)*((uintptr_t)4294967295ULL); x80 = sizeof(intptr_t) == 4 ? ((uint64_t)(x38)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x38)*((uintptr_t)4294967295ULL))>>64; x81 = (x80)+(x77); x82 = (x81)<(x80); x83 = (x82)+(x78); x84 = (x83)<(x78); x85 = (x83)+(x75); x86 = (x85)<(x75); x87 = (x84)+(x86); x88 = (x87)+(x76); x89 = (x38)+(x79); x90 = (x89)<(x38); x91 = (x90)+(x40); x92 = (x91)<(x40); x93 = (x91)+(x81); x94 = (x93)<(x81); x95 = (x92)+(x94); x96 = (x95)+(x44); x97 = (x96)<(x44); x98 = (x96)+(x85); x99 = (x98)<(x85); x100 = (x97)+(x99); x101 = (x100)+(x49); x102 = (x101)<(x49); x103 = (x101)+(x88); x104 = (x103)<(x88); x105 = (x102)+(x104); x106 = (x105)+(x54); x107 = (x106)<(x54); x108 = (x107)+(x59); x109 = (x108)<(x59); x110 = (x109)+(x64); x111 = (x110)<(x64); x112 = (x110)+(x38); x113 = (x112)<(x38); x114 = (x111)+(x113); x115 = (x114)+(x69); x116 = (x115)<(x69); x117 = (x115)+(x73); x118 = (x117)<(x73); x119 = (x116)+(x118); x120 = (x119)+(x72); x121 = (x120)<(x72); x122 = (x120)+(x74); x123 = (x122)<(x74); x124 = (x121)+(x123); x125 = (x16)*(x15); x126 = sizeof(intptr_t) == 4 ? ((uint64_t)(x16)*(x15))>>32 : ((__uint128_t)(x16)*(x15))>>64; x127 = (x16)*(x14); x128 = sizeof(intptr_t) == 4 ? ((uint64_t)(x16)*(x14))>>32 : ((__uint128_t)(x16)*(x14))>>64; x129 = (x16)*(x13); x130 = sizeof(intptr_t) == 4 ? ((uint64_t)(x16)*(x13))>>32 : ((__uint128_t)(x16)*(x13))>>64; x131 = (x16)*(x12); x132 = sizeof(intptr_t) == 4 ? ((uint64_t)(x16)*(x12))>>32 : ((__uint128_t)(x16)*(x12))>>64; x133 = (x16)*(x11); x134 = sizeof(intptr_t) == 4 ? ((uint64_t)(x16)*(x11))>>32 : ((__uint128_t)(x16)*(x11))>>64; x135 = (x16)*(x10); x136 = sizeof(intptr_t) == 4 ? ((uint64_t)(x16)*(x10))>>32 : ((__uint128_t)(x16)*(x10))>>64; x137 = (x16)*(x9); x138 = sizeof(intptr_t) == 4 ? ((uint64_t)(x16)*(x9))>>32 : ((__uint128_t)(x16)*(x9))>>64; x139 = (x16)*(x8); x140 = sizeof(intptr_t) == 4 ? ((uint64_t)(x16)*(x8))>>32 : ((__uint128_t)(x16)*(x8))>>64; x141 = (x140)+(x137); x142 = (x141)<(x140); x143 = (x142)+(x138); x144 = (x143)<(x138); x145 = (x143)+(x135); x146 = (x145)<(x135); x147 = (x144)+(x146); x148 = (x147)+(x136); x149 = (x148)<(x136); x150 = (x148)+(x133); x151 = (x150)<(x133); x152 = (x149)+(x151); x153 = (x152)+(x134); x154 = (x153)<(x134); x155 = (x153)+(x131); x156 = (x155)<(x131); x157 = (x154)+(x156); x158 = (x157)+(x132); x159 = (x158)<(x132); x160 = (x158)+(x129); x161 = (x160)<(x129); x162 = (x159)+(x161); x163 = (x162)+(x130); x164 = (x163)<(x130); x165 = (x163)+(x127); x166 = (x165)<(x127); x167 = (x164)+(x166); x168 = (x167)+(x128); x169 = (x168)<(x128); x170 = (x168)+(x125); x171 = (x170)<(x125); x172 = (x169)+(x171); x173 = (x172)+(x126); x174 = (x93)+(x139); x175 = (x174)<(x93); x176 = (x175)+(x98); x177 = (x176)<(x98); x178 = (x176)+(x141); x179 = (x178)<(x141); x180 = (x177)+(x179); x181 = (x180)+(x103); x182 = (x181)<(x103); x183 = (x181)+(x145); x184 = (x183)<(x145); x185 = (x182)+(x184); x186 = (x185)+(x106); x187 = (x186)<(x106); x188 = (x186)+(x150); x189 = (x188)<(x150); x190 = (x187)+(x189); x191 = (x190)+(x108); x192 = (x191)<(x108); x193 = (x191)+(x155); x194 = (x193)<(x155); x195 = (x192)+(x194); x196 = (x195)+(x112); x197 = (x196)<(x112); x198 = (x196)+(x160); x199 = (x198)<(x160); x200 = (x197)+(x199); x201 = (x200)+(x117); x202 = (x201)<(x117); x203 = (x201)+(x165); x204 = (x203)<(x165); x205 = (x202)+(x204); x206 = (x205)+(x122); x207 = (x206)<(x122); x208 = (x206)+(x170); x209 = (x208)<(x170); x210 = (x207)+(x209); x211 = (x210)+(x124); x212 = (x211)<(x124); x213 = (x211)+(x173); x214 = (x213)<(x173); x215 = (x212)+(x214); x216 = (x174)*((uintptr_t)4294967295ULL); x217 = sizeof(intptr_t) == 4 ? ((uint64_t)(x174)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x174)*((uintptr_t)4294967295ULL))>>64; x218 = (x174)*((uintptr_t)4294967295ULL); x219 = sizeof(intptr_t) == 4 ? ((uint64_t)(x174)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x174)*((uintptr_t)4294967295ULL))>>64; x220 = (x174)*((uintptr_t)4294967295ULL); x221 = sizeof(intptr_t) == 4 ? ((uint64_t)(x174)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x174)*((uintptr_t)4294967295ULL))>>64; x222 = (x174)*((uintptr_t)4294967295ULL); x223 = sizeof(intptr_t) == 4 ? ((uint64_t)(x174)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x174)*((uintptr_t)4294967295ULL))>>64; x224 = (x223)+(x220); x225 = (x224)<(x223); x226 = (x225)+(x221); x227 = (x226)<(x221); x228 = (x226)+(x218); x229 = (x228)<(x218); x230 = (x227)+(x229); x231 = (x230)+(x219); x232 = (x174)+(x222); x233 = (x232)<(x174); x234 = (x233)+(x178); x235 = (x234)<(x178); x236 = (x234)+(x224); x237 = (x236)<(x224); x238 = (x235)+(x237); x239 = (x238)+(x183); x240 = (x239)<(x183); x241 = (x239)+(x228); x242 = (x241)<(x228); x243 = (x240)+(x242); x244 = (x243)+(x188); x245 = (x244)<(x188); x246 = (x244)+(x231); x247 = (x246)<(x231); x248 = (x245)+(x247); x249 = (x248)+(x193); x250 = (x249)<(x193); x251 = (x250)+(x198); x252 = (x251)<(x198); x253 = (x252)+(x203); x254 = (x253)<(x203); x255 = (x253)+(x174); x256 = (x255)<(x174); x257 = (x254)+(x256); x258 = (x257)+(x208); x259 = (x258)<(x208); x260 = (x258)+(x216); x261 = (x260)<(x216); x262 = (x259)+(x261); x263 = (x262)+(x213); x264 = (x263)<(x213); x265 = (x263)+(x217); x266 = (x265)<(x217); x267 = (x264)+(x266); x268 = (x267)+(x215); x269 = (x17)*(x15); x270 = sizeof(intptr_t) == 4 ? ((uint64_t)(x17)*(x15))>>32 : ((__uint128_t)(x17)*(x15))>>64; x271 = (x17)*(x14); x272 = sizeof(intptr_t) == 4 ? ((uint64_t)(x17)*(x14))>>32 : ((__uint128_t)(x17)*(x14))>>64; x273 = (x17)*(x13); x274 = sizeof(intptr_t) == 4 ? ((uint64_t)(x17)*(x13))>>32 : ((__uint128_t)(x17)*(x13))>>64; x275 = (x17)*(x12); x276 = sizeof(intptr_t) == 4 ? ((uint64_t)(x17)*(x12))>>32 : ((__uint128_t)(x17)*(x12))>>64; x277 = (x17)*(x11); x278 = sizeof(intptr_t) == 4 ? ((uint64_t)(x17)*(x11))>>32 : ((__uint128_t)(x17)*(x11))>>64; x279 = (x17)*(x10); x280 = sizeof(intptr_t) == 4 ? ((uint64_t)(x17)*(x10))>>32 : ((__uint128_t)(x17)*(x10))>>64; x281 = (x17)*(x9); x282 = sizeof(intptr_t) == 4 ? ((uint64_t)(x17)*(x9))>>32 : ((__uint128_t)(x17)*(x9))>>64; x283 = (x17)*(x8); x284 = sizeof(intptr_t) == 4 ? ((uint64_t)(x17)*(x8))>>32 : ((__uint128_t)(x17)*(x8))>>64; x285 = (x284)+(x281); x286 = (x285)<(x284); x287 = (x286)+(x282); x288 = (x287)<(x282); x289 = (x287)+(x279); x290 = (x289)<(x279); x291 = (x288)+(x290); x292 = (x291)+(x280); x293 = (x292)<(x280); x294 = (x292)+(x277); x295 = (x294)<(x277); x296 = (x293)+(x295); x297 = (x296)+(x278); x298 = (x297)<(x278); x299 = (x297)+(x275); x300 = (x299)<(x275); x301 = (x298)+(x300); x302 = (x301)+(x276); x303 = (x302)<(x276); x304 = (x302)+(x273); x305 = (x304)<(x273); x306 = (x303)+(x305); x307 = (x306)+(x274); x308 = (x307)<(x274); x309 = (x307)+(x271); x310 = (x309)<(x271); x311 = (x308)+(x310); x312 = (x311)+(x272); x313 = (x312)<(x272); x314 = (x312)+(x269); x315 = (x314)<(x269); x316 = (x313)+(x315); x317 = (x316)+(x270); x318 = (x236)+(x283); x319 = (x318)<(x236); x320 = (x319)+(x241); x321 = (x320)<(x241); x322 = (x320)+(x285); x323 = (x322)<(x285); x324 = (x321)+(x323); x325 = (x324)+(x246); x326 = (x325)<(x246); x327 = (x325)+(x289); x328 = (x327)<(x289); x329 = (x326)+(x328); x330 = (x329)+(x249); x331 = (x330)<(x249); x332 = (x330)+(x294); x333 = (x332)<(x294); x334 = (x331)+(x333); x335 = (x334)+(x251); x336 = (x335)<(x251); x337 = (x335)+(x299); x338 = (x337)<(x299); x339 = (x336)+(x338); x340 = (x339)+(x255); x341 = (x340)<(x255); x342 = (x340)+(x304); x343 = (x342)<(x304); x344 = (x341)+(x343); x345 = (x344)+(x260); x346 = (x345)<(x260); x347 = (x345)+(x309); x348 = (x347)<(x309); x349 = (x346)+(x348); x350 = (x349)+(x265); x351 = (x350)<(x265); x352 = (x350)+(x314); x353 = (x352)<(x314); x354 = (x351)+(x353); x355 = (x354)+(x268); x356 = (x355)<(x268); x357 = (x355)+(x317); x358 = (x357)<(x317); x359 = (x356)+(x358); x360 = (x318)*((uintptr_t)4294967295ULL); x361 = sizeof(intptr_t) == 4 ? ((uint64_t)(x318)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x318)*((uintptr_t)4294967295ULL))>>64; x362 = (x318)*((uintptr_t)4294967295ULL); x363 = sizeof(intptr_t) == 4 ? ((uint64_t)(x318)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x318)*((uintptr_t)4294967295ULL))>>64; x364 = (x318)*((uintptr_t)4294967295ULL); x365 = sizeof(intptr_t) == 4 ? ((uint64_t)(x318)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x318)*((uintptr_t)4294967295ULL))>>64; x366 = (x318)*((uintptr_t)4294967295ULL); x367 = sizeof(intptr_t) == 4 ? ((uint64_t)(x318)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x318)*((uintptr_t)4294967295ULL))>>64; x368 = (x367)+(x364); x369 = (x368)<(x367); x370 = (x369)+(x365); x371 = (x370)<(x365); x372 = (x370)+(x362); x373 = (x372)<(x362); x374 = (x371)+(x373); x375 = (x374)+(x363); x376 = (x318)+(x366); x377 = (x376)<(x318); x378 = (x377)+(x322); x379 = (x378)<(x322); x380 = (x378)+(x368); x381 = (x380)<(x368); x382 = (x379)+(x381); x383 = (x382)+(x327); x384 = (x383)<(x327); x385 = (x383)+(x372); x386 = (x385)<(x372); x387 = (x384)+(x386); x388 = (x387)+(x332); x389 = (x388)<(x332); x390 = (x388)+(x375); x391 = (x390)<(x375); x392 = (x389)+(x391); x393 = (x392)+(x337); x394 = (x393)<(x337); x395 = (x394)+(x342); x396 = (x395)<(x342); x397 = (x396)+(x347); x398 = (x397)<(x347); x399 = (x397)+(x318); x400 = (x399)<(x318); x401 = (x398)+(x400); x402 = (x401)+(x352); x403 = (x402)<(x352); x404 = (x402)+(x360); x405 = (x404)<(x360); x406 = (x403)+(x405); x407 = (x406)+(x357); x408 = (x407)<(x357); x409 = (x407)+(x361); x410 = (x409)<(x361); x411 = (x408)+(x410); x412 = (x411)+(x359); x413 = (x18)*(x15); x414 = sizeof(intptr_t) == 4 ? ((uint64_t)(x18)*(x15))>>32 : ((__uint128_t)(x18)*(x15))>>64; x415 = (x18)*(x14); x416 = sizeof(intptr_t) == 4 ? ((uint64_t)(x18)*(x14))>>32 : ((__uint128_t)(x18)*(x14))>>64; x417 = (x18)*(x13); x418 = sizeof(intptr_t) == 4 ? ((uint64_t)(x18)*(x13))>>32 : ((__uint128_t)(x18)*(x13))>>64; x419 = (x18)*(x12); x420 = sizeof(intptr_t) == 4 ? ((uint64_t)(x18)*(x12))>>32 : ((__uint128_t)(x18)*(x12))>>64; x421 = (x18)*(x11); x422 = sizeof(intptr_t) == 4 ? ((uint64_t)(x18)*(x11))>>32 : ((__uint128_t)(x18)*(x11))>>64; x423 = (x18)*(x10); x424 = sizeof(intptr_t) == 4 ? ((uint64_t)(x18)*(x10))>>32 : ((__uint128_t)(x18)*(x10))>>64; x425 = (x18)*(x9); x426 = sizeof(intptr_t) == 4 ? ((uint64_t)(x18)*(x9))>>32 : ((__uint128_t)(x18)*(x9))>>64; x427 = (x18)*(x8); x428 = sizeof(intptr_t) == 4 ? ((uint64_t)(x18)*(x8))>>32 : ((__uint128_t)(x18)*(x8))>>64; x429 = (x428)+(x425); x430 = (x429)<(x428); x431 = (x430)+(x426); x432 = (x431)<(x426); x433 = (x431)+(x423); x434 = (x433)<(x423); x435 = (x432)+(x434); x436 = (x435)+(x424); x437 = (x436)<(x424); x438 = (x436)+(x421); x439 = (x438)<(x421); x440 = (x437)+(x439); x441 = (x440)+(x422); x442 = (x441)<(x422); x443 = (x441)+(x419); x444 = (x443)<(x419); x445 = (x442)+(x444); x446 = (x445)+(x420); x447 = (x446)<(x420); x448 = (x446)+(x417); x449 = (x448)<(x417); x450 = (x447)+(x449); x451 = (x450)+(x418); x452 = (x451)<(x418); x453 = (x451)+(x415); x454 = (x453)<(x415); x455 = (x452)+(x454); x456 = (x455)+(x416); x457 = (x456)<(x416); x458 = (x456)+(x413); x459 = (x458)<(x413); x460 = (x457)+(x459); x461 = (x460)+(x414); x462 = (x380)+(x427); x463 = (x462)<(x380); x464 = (x463)+(x385); x465 = (x464)<(x385); x466 = (x464)+(x429); x467 = (x466)<(x429); x468 = (x465)+(x467); x469 = (x468)+(x390); x470 = (x469)<(x390); x471 = (x469)+(x433); x472 = (x471)<(x433); x473 = (x470)+(x472); x474 = (x473)+(x393); x475 = (x474)<(x393); x476 = (x474)+(x438); x477 = (x476)<(x438); x478 = (x475)+(x477); x479 = (x478)+(x395); x480 = (x479)<(x395); x481 = (x479)+(x443); x482 = (x481)<(x443); x483 = (x480)+(x482); x484 = (x483)+(x399); x485 = (x484)<(x399); x486 = (x484)+(x448); x487 = (x486)<(x448); x488 = (x485)+(x487); x489 = (x488)+(x404); x490 = (x489)<(x404); x491 = (x489)+(x453); x492 = (x491)<(x453); x493 = (x490)+(x492); x494 = (x493)+(x409); x495 = (x494)<(x409); x496 = (x494)+(x458); x497 = (x496)<(x458); x498 = (x495)+(x497); x499 = (x498)+(x412); x500 = (x499)<(x412); x501 = (x499)+(x461); x502 = (x501)<(x461); x503 = (x500)+(x502); x504 = (x462)*((uintptr_t)4294967295ULL); x505 = sizeof(intptr_t) == 4 ? ((uint64_t)(x462)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x462)*((uintptr_t)4294967295ULL))>>64; x506 = (x462)*((uintptr_t)4294967295ULL); x507 = sizeof(intptr_t) == 4 ? ((uint64_t)(x462)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x462)*((uintptr_t)4294967295ULL))>>64; x508 = (x462)*((uintptr_t)4294967295ULL); x509 = sizeof(intptr_t) == 4 ? ((uint64_t)(x462)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x462)*((uintptr_t)4294967295ULL))>>64; x510 = (x462)*((uintptr_t)4294967295ULL); x511 = sizeof(intptr_t) == 4 ? ((uint64_t)(x462)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x462)*((uintptr_t)4294967295ULL))>>64; x512 = (x511)+(x508); x513 = (x512)<(x511); x514 = (x513)+(x509); x515 = (x514)<(x509); x516 = (x514)+(x506); x517 = (x516)<(x506); x518 = (x515)+(x517); x519 = (x518)+(x507); x520 = (x462)+(x510); x521 = (x520)<(x462); x522 = (x521)+(x466); x523 = (x522)<(x466); x524 = (x522)+(x512); x525 = (x524)<(x512); x526 = (x523)+(x525); x527 = (x526)+(x471); x528 = (x527)<(x471); x529 = (x527)+(x516); x530 = (x529)<(x516); x531 = (x528)+(x530); x532 = (x531)+(x476); x533 = (x532)<(x476); x534 = (x532)+(x519); x535 = (x534)<(x519); x536 = (x533)+(x535); x537 = (x536)+(x481); x538 = (x537)<(x481); x539 = (x538)+(x486); x540 = (x539)<(x486); x541 = (x540)+(x491); x542 = (x541)<(x491); x543 = (x541)+(x462); x544 = (x543)<(x462); x545 = (x542)+(x544); x546 = (x545)+(x496); x547 = (x546)<(x496); x548 = (x546)+(x504); x549 = (x548)<(x504); x550 = (x547)+(x549); x551 = (x550)+(x501); x552 = (x551)<(x501); x553 = (x551)+(x505); x554 = (x553)<(x505); x555 = (x552)+(x554); x556 = (x555)+(x503); x557 = (x19)*(x15); x558 = sizeof(intptr_t) == 4 ? ((uint64_t)(x19)*(x15))>>32 : ((__uint128_t)(x19)*(x15))>>64; x559 = (x19)*(x14); x560 = sizeof(intptr_t) == 4 ? ((uint64_t)(x19)*(x14))>>32 : ((__uint128_t)(x19)*(x14))>>64; x561 = (x19)*(x13); x562 = sizeof(intptr_t) == 4 ? ((uint64_t)(x19)*(x13))>>32 : ((__uint128_t)(x19)*(x13))>>64; x563 = (x19)*(x12); x564 = sizeof(intptr_t) == 4 ? ((uint64_t)(x19)*(x12))>>32 : ((__uint128_t)(x19)*(x12))>>64; x565 = (x19)*(x11); x566 = sizeof(intptr_t) == 4 ? ((uint64_t)(x19)*(x11))>>32 : ((__uint128_t)(x19)*(x11))>>64; x567 = (x19)*(x10); x568 = sizeof(intptr_t) == 4 ? ((uint64_t)(x19)*(x10))>>32 : ((__uint128_t)(x19)*(x10))>>64; x569 = (x19)*(x9); x570 = sizeof(intptr_t) == 4 ? ((uint64_t)(x19)*(x9))>>32 : ((__uint128_t)(x19)*(x9))>>64; x571 = (x19)*(x8); x572 = sizeof(intptr_t) == 4 ? ((uint64_t)(x19)*(x8))>>32 : ((__uint128_t)(x19)*(x8))>>64; x573 = (x572)+(x569); x574 = (x573)<(x572); x575 = (x574)+(x570); x576 = (x575)<(x570); x577 = (x575)+(x567); x578 = (x577)<(x567); x579 = (x576)+(x578); x580 = (x579)+(x568); x581 = (x580)<(x568); x582 = (x580)+(x565); x583 = (x582)<(x565); x584 = (x581)+(x583); x585 = (x584)+(x566); x586 = (x585)<(x566); x587 = (x585)+(x563); x588 = (x587)<(x563); x589 = (x586)+(x588); x590 = (x589)+(x564); x591 = (x590)<(x564); x592 = (x590)+(x561); x593 = (x592)<(x561); x594 = (x591)+(x593); x595 = (x594)+(x562); x596 = (x595)<(x562); x597 = (x595)+(x559); x598 = (x597)<(x559); x599 = (x596)+(x598); x600 = (x599)+(x560); x601 = (x600)<(x560); x602 = (x600)+(x557); x603 = (x602)<(x557); x604 = (x601)+(x603); x605 = (x604)+(x558); x606 = (x524)+(x571); x607 = (x606)<(x524); x608 = (x607)+(x529); x609 = (x608)<(x529); x610 = (x608)+(x573); x611 = (x610)<(x573); x612 = (x609)+(x611); x613 = (x612)+(x534); x614 = (x613)<(x534); x615 = (x613)+(x577); x616 = (x615)<(x577); x617 = (x614)+(x616); x618 = (x617)+(x537); x619 = (x618)<(x537); x620 = (x618)+(x582); x621 = (x620)<(x582); x622 = (x619)+(x621); x623 = (x622)+(x539); x624 = (x623)<(x539); x625 = (x623)+(x587); x626 = (x625)<(x587); x627 = (x624)+(x626); x628 = (x627)+(x543); x629 = (x628)<(x543); x630 = (x628)+(x592); x631 = (x630)<(x592); x632 = (x629)+(x631); x633 = (x632)+(x548); x634 = (x633)<(x548); x635 = (x633)+(x597); x636 = (x635)<(x597); x637 = (x634)+(x636); x638 = (x637)+(x553); x639 = (x638)<(x553); x640 = (x638)+(x602); x641 = (x640)<(x602); x642 = (x639)+(x641); x643 = (x642)+(x556); x644 = (x643)<(x556); x645 = (x643)+(x605); x646 = (x645)<(x605); x647 = (x644)+(x646); x648 = (x606)*((uintptr_t)4294967295ULL); x649 = sizeof(intptr_t) == 4 ? ((uint64_t)(x606)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x606)*((uintptr_t)4294967295ULL))>>64; x650 = (x606)*((uintptr_t)4294967295ULL); x651 = sizeof(intptr_t) == 4 ? ((uint64_t)(x606)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x606)*((uintptr_t)4294967295ULL))>>64; x652 = (x606)*((uintptr_t)4294967295ULL); x653 = sizeof(intptr_t) == 4 ? ((uint64_t)(x606)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x606)*((uintptr_t)4294967295ULL))>>64; x654 = (x606)*((uintptr_t)4294967295ULL); x655 = sizeof(intptr_t) == 4 ? ((uint64_t)(x606)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x606)*((uintptr_t)4294967295ULL))>>64; x656 = (x655)+(x652); x657 = (x656)<(x655); x658 = (x657)+(x653); x659 = (x658)<(x653); x660 = (x658)+(x650); x661 = (x660)<(x650); x662 = (x659)+(x661); x663 = (x662)+(x651); x664 = (x606)+(x654); x665 = (x664)<(x606); x666 = (x665)+(x610); x667 = (x666)<(x610); x668 = (x666)+(x656); x669 = (x668)<(x656); x670 = (x667)+(x669); x671 = (x670)+(x615); x672 = (x671)<(x615); x673 = (x671)+(x660); x674 = (x673)<(x660); x675 = (x672)+(x674); x676 = (x675)+(x620); x677 = (x676)<(x620); x678 = (x676)+(x663); x679 = (x678)<(x663); x680 = (x677)+(x679); x681 = (x680)+(x625); x682 = (x681)<(x625); x683 = (x682)+(x630); x684 = (x683)<(x630); x685 = (x684)+(x635); x686 = (x685)<(x635); x687 = (x685)+(x606); x688 = (x687)<(x606); x689 = (x686)+(x688); x690 = (x689)+(x640); x691 = (x690)<(x640); x692 = (x690)+(x648); x693 = (x692)<(x648); x694 = (x691)+(x693); x695 = (x694)+(x645); x696 = (x695)<(x645); x697 = (x695)+(x649); x698 = (x697)<(x649); x699 = (x696)+(x698); x700 = (x699)+(x647); x701 = (x20)*(x15); x702 = sizeof(intptr_t) == 4 ? ((uint64_t)(x20)*(x15))>>32 : ((__uint128_t)(x20)*(x15))>>64; x703 = (x20)*(x14); x704 = sizeof(intptr_t) == 4 ? ((uint64_t)(x20)*(x14))>>32 : ((__uint128_t)(x20)*(x14))>>64; x705 = (x20)*(x13); x706 = sizeof(intptr_t) == 4 ? ((uint64_t)(x20)*(x13))>>32 : ((__uint128_t)(x20)*(x13))>>64; x707 = (x20)*(x12); x708 = sizeof(intptr_t) == 4 ? ((uint64_t)(x20)*(x12))>>32 : ((__uint128_t)(x20)*(x12))>>64; x709 = (x20)*(x11); x710 = sizeof(intptr_t) == 4 ? ((uint64_t)(x20)*(x11))>>32 : ((__uint128_t)(x20)*(x11))>>64; x711 = (x20)*(x10); x712 = sizeof(intptr_t) == 4 ? ((uint64_t)(x20)*(x10))>>32 : ((__uint128_t)(x20)*(x10))>>64; x713 = (x20)*(x9); x714 = sizeof(intptr_t) == 4 ? ((uint64_t)(x20)*(x9))>>32 : ((__uint128_t)(x20)*(x9))>>64; x715 = (x20)*(x8); x716 = sizeof(intptr_t) == 4 ? ((uint64_t)(x20)*(x8))>>32 : ((__uint128_t)(x20)*(x8))>>64; x717 = (x716)+(x713); x718 = (x717)<(x716); x719 = (x718)+(x714); x720 = (x719)<(x714); x721 = (x719)+(x711); x722 = (x721)<(x711); x723 = (x720)+(x722); x724 = (x723)+(x712); x725 = (x724)<(x712); x726 = (x724)+(x709); x727 = (x726)<(x709); x728 = (x725)+(x727); x729 = (x728)+(x710); x730 = (x729)<(x710); x731 = (x729)+(x707); x732 = (x731)<(x707); x733 = (x730)+(x732); x734 = (x733)+(x708); x735 = (x734)<(x708); x736 = (x734)+(x705); x737 = (x736)<(x705); x738 = (x735)+(x737); x739 = (x738)+(x706); x740 = (x739)<(x706); x741 = (x739)+(x703); x742 = (x741)<(x703); x743 = (x740)+(x742); x744 = (x743)+(x704); x745 = (x744)<(x704); x746 = (x744)+(x701); x747 = (x746)<(x701); x748 = (x745)+(x747); x749 = (x748)+(x702); x750 = (x668)+(x715); x751 = (x750)<(x668); x752 = (x751)+(x673); x753 = (x752)<(x673); x754 = (x752)+(x717); x755 = (x754)<(x717); x756 = (x753)+(x755); x757 = (x756)+(x678); x758 = (x757)<(x678); x759 = (x757)+(x721); x760 = (x759)<(x721); x761 = (x758)+(x760); x762 = (x761)+(x681); x763 = (x762)<(x681); x764 = (x762)+(x726); x765 = (x764)<(x726); x766 = (x763)+(x765); x767 = (x766)+(x683); x768 = (x767)<(x683); x769 = (x767)+(x731); x770 = (x769)<(x731); x771 = (x768)+(x770); x772 = (x771)+(x687); x773 = (x772)<(x687); x774 = (x772)+(x736); x775 = (x774)<(x736); x776 = (x773)+(x775); x777 = (x776)+(x692); x778 = (x777)<(x692); x779 = (x777)+(x741); x780 = (x779)<(x741); x781 = (x778)+(x780); x782 = (x781)+(x697); x783 = (x782)<(x697); x784 = (x782)+(x746); x785 = (x784)<(x746); x786 = (x783)+(x785); x787 = (x786)+(x700); x788 = (x787)<(x700); x789 = (x787)+(x749); x790 = (x789)<(x749); x791 = (x788)+(x790); x792 = (x750)*((uintptr_t)4294967295ULL); x793 = sizeof(intptr_t) == 4 ? ((uint64_t)(x750)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x750)*((uintptr_t)4294967295ULL))>>64; x794 = (x750)*((uintptr_t)4294967295ULL); x795 = sizeof(intptr_t) == 4 ? ((uint64_t)(x750)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x750)*((uintptr_t)4294967295ULL))>>64; x796 = (x750)*((uintptr_t)4294967295ULL); x797 = sizeof(intptr_t) == 4 ? ((uint64_t)(x750)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x750)*((uintptr_t)4294967295ULL))>>64; x798 = (x750)*((uintptr_t)4294967295ULL); x799 = sizeof(intptr_t) == 4 ? ((uint64_t)(x750)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x750)*((uintptr_t)4294967295ULL))>>64; x800 = (x799)+(x796); x801 = (x800)<(x799); x802 = (x801)+(x797); x803 = (x802)<(x797); x804 = (x802)+(x794); x805 = (x804)<(x794); x806 = (x803)+(x805); x807 = (x806)+(x795); x808 = (x750)+(x798); x809 = (x808)<(x750); x810 = (x809)+(x754); x811 = (x810)<(x754); x812 = (x810)+(x800); x813 = (x812)<(x800); x814 = (x811)+(x813); x815 = (x814)+(x759); x816 = (x815)<(x759); x817 = (x815)+(x804); x818 = (x817)<(x804); x819 = (x816)+(x818); x820 = (x819)+(x764); x821 = (x820)<(x764); x822 = (x820)+(x807); x823 = (x822)<(x807); x824 = (x821)+(x823); x825 = (x824)+(x769); x826 = (x825)<(x769); x827 = (x826)+(x774); x828 = (x827)<(x774); x829 = (x828)+(x779); x830 = (x829)<(x779); x831 = (x829)+(x750); x832 = (x831)<(x750); x833 = (x830)+(x832); x834 = (x833)+(x784); x835 = (x834)<(x784); x836 = (x834)+(x792); x837 = (x836)<(x792); x838 = (x835)+(x837); x839 = (x838)+(x789); x840 = (x839)<(x789); x841 = (x839)+(x793); x842 = (x841)<(x793); x843 = (x840)+(x842); x844 = (x843)+(x791); x845 = (x21)*(x15); x846 = sizeof(intptr_t) == 4 ? ((uint64_t)(x21)*(x15))>>32 : ((__uint128_t)(x21)*(x15))>>64; x847 = (x21)*(x14); x848 = sizeof(intptr_t) == 4 ? ((uint64_t)(x21)*(x14))>>32 : ((__uint128_t)(x21)*(x14))>>64; x849 = (x21)*(x13); x850 = sizeof(intptr_t) == 4 ? ((uint64_t)(x21)*(x13))>>32 : ((__uint128_t)(x21)*(x13))>>64; x851 = (x21)*(x12); x852 = sizeof(intptr_t) == 4 ? ((uint64_t)(x21)*(x12))>>32 : ((__uint128_t)(x21)*(x12))>>64; x853 = (x21)*(x11); x854 = sizeof(intptr_t) == 4 ? ((uint64_t)(x21)*(x11))>>32 : ((__uint128_t)(x21)*(x11))>>64; x855 = (x21)*(x10); x856 = sizeof(intptr_t) == 4 ? ((uint64_t)(x21)*(x10))>>32 : ((__uint128_t)(x21)*(x10))>>64; x857 = (x21)*(x9); x858 = sizeof(intptr_t) == 4 ? ((uint64_t)(x21)*(x9))>>32 : ((__uint128_t)(x21)*(x9))>>64; x859 = (x21)*(x8); x860 = sizeof(intptr_t) == 4 ? ((uint64_t)(x21)*(x8))>>32 : ((__uint128_t)(x21)*(x8))>>64; x861 = (x860)+(x857); x862 = (x861)<(x860); x863 = (x862)+(x858); x864 = (x863)<(x858); x865 = (x863)+(x855); x866 = (x865)<(x855); x867 = (x864)+(x866); x868 = (x867)+(x856); x869 = (x868)<(x856); x870 = (x868)+(x853); x871 = (x870)<(x853); x872 = (x869)+(x871); x873 = (x872)+(x854); x874 = (x873)<(x854); x875 = (x873)+(x851); x876 = (x875)<(x851); x877 = (x874)+(x876); x878 = (x877)+(x852); x879 = (x878)<(x852); x880 = (x878)+(x849); x881 = (x880)<(x849); x882 = (x879)+(x881); x883 = (x882)+(x850); x884 = (x883)<(x850); x885 = (x883)+(x847); x886 = (x885)<(x847); x887 = (x884)+(x886); x888 = (x887)+(x848); x889 = (x888)<(x848); x890 = (x888)+(x845); x891 = (x890)<(x845); x892 = (x889)+(x891); x893 = (x892)+(x846); x894 = (x812)+(x859); x895 = (x894)<(x812); x896 = (x895)+(x817); x897 = (x896)<(x817); x898 = (x896)+(x861); x899 = (x898)<(x861); x900 = (x897)+(x899); x901 = (x900)+(x822); x902 = (x901)<(x822); x903 = (x901)+(x865); x904 = (x903)<(x865); x905 = (x902)+(x904); x906 = (x905)+(x825); x907 = (x906)<(x825); x908 = (x906)+(x870); x909 = (x908)<(x870); x910 = (x907)+(x909); x911 = (x910)+(x827); x912 = (x911)<(x827); x913 = (x911)+(x875); x914 = (x913)<(x875); x915 = (x912)+(x914); x916 = (x915)+(x831); x917 = (x916)<(x831); x918 = (x916)+(x880); x919 = (x918)<(x880); x920 = (x917)+(x919); x921 = (x920)+(x836); x922 = (x921)<(x836); x923 = (x921)+(x885); x924 = (x923)<(x885); x925 = (x922)+(x924); x926 = (x925)+(x841); x927 = (x926)<(x841); x928 = (x926)+(x890); x929 = (x928)<(x890); x930 = (x927)+(x929); x931 = (x930)+(x844); x932 = (x931)<(x844); x933 = (x931)+(x893); x934 = (x933)<(x893); x935 = (x932)+(x934); x936 = (x894)*((uintptr_t)4294967295ULL); x937 = sizeof(intptr_t) == 4 ? ((uint64_t)(x894)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x894)*((uintptr_t)4294967295ULL))>>64; x938 = (x894)*((uintptr_t)4294967295ULL); x939 = sizeof(intptr_t) == 4 ? ((uint64_t)(x894)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x894)*((uintptr_t)4294967295ULL))>>64; x940 = (x894)*((uintptr_t)4294967295ULL); x941 = sizeof(intptr_t) == 4 ? ((uint64_t)(x894)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x894)*((uintptr_t)4294967295ULL))>>64; x942 = (x894)*((uintptr_t)4294967295ULL); x943 = sizeof(intptr_t) == 4 ? ((uint64_t)(x894)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x894)*((uintptr_t)4294967295ULL))>>64; x944 = (x943)+(x940); x945 = (x944)<(x943); x946 = (x945)+(x941); x947 = (x946)<(x941); x948 = (x946)+(x938); x949 = (x948)<(x938); x950 = (x947)+(x949); x951 = (x950)+(x939); x952 = (x894)+(x942); x953 = (x952)<(x894); x954 = (x953)+(x898); x955 = (x954)<(x898); x956 = (x954)+(x944); x957 = (x956)<(x944); x958 = (x955)+(x957); x959 = (x958)+(x903); x960 = (x959)<(x903); x961 = (x959)+(x948); x962 = (x961)<(x948); x963 = (x960)+(x962); x964 = (x963)+(x908); x965 = (x964)<(x908); x966 = (x964)+(x951); x967 = (x966)<(x951); x968 = (x965)+(x967); x969 = (x968)+(x913); x970 = (x969)<(x913); x971 = (x970)+(x918); x972 = (x971)<(x918); x973 = (x972)+(x923); x974 = (x973)<(x923); x975 = (x973)+(x894); x976 = (x975)<(x894); x977 = (x974)+(x976); x978 = (x977)+(x928); x979 = (x978)<(x928); x980 = (x978)+(x936); x981 = (x980)<(x936); x982 = (x979)+(x981); x983 = (x982)+(x933); x984 = (x983)<(x933); x985 = (x983)+(x937); x986 = (x985)<(x937); x987 = (x984)+(x986); x988 = (x987)+(x935); x989 = (x22)*(x15); x990 = sizeof(intptr_t) == 4 ? ((uint64_t)(x22)*(x15))>>32 : ((__uint128_t)(x22)*(x15))>>64; x991 = (x22)*(x14); x992 = sizeof(intptr_t) == 4 ? ((uint64_t)(x22)*(x14))>>32 : ((__uint128_t)(x22)*(x14))>>64; x993 = (x22)*(x13); x994 = sizeof(intptr_t) == 4 ? ((uint64_t)(x22)*(x13))>>32 : ((__uint128_t)(x22)*(x13))>>64; x995 = (x22)*(x12); x996 = sizeof(intptr_t) == 4 ? ((uint64_t)(x22)*(x12))>>32 : ((__uint128_t)(x22)*(x12))>>64; x997 = (x22)*(x11); x998 = sizeof(intptr_t) == 4 ? ((uint64_t)(x22)*(x11))>>32 : ((__uint128_t)(x22)*(x11))>>64; x999 = (x22)*(x10); x1000 = sizeof(intptr_t) == 4 ? ((uint64_t)(x22)*(x10))>>32 : ((__uint128_t)(x22)*(x10))>>64; x1001 = (x22)*(x9); x1002 = sizeof(intptr_t) == 4 ? ((uint64_t)(x22)*(x9))>>32 : ((__uint128_t)(x22)*(x9))>>64; x1003 = (x22)*(x8); x1004 = sizeof(intptr_t) == 4 ? ((uint64_t)(x22)*(x8))>>32 : ((__uint128_t)(x22)*(x8))>>64; x1005 = (x1004)+(x1001); x1006 = (x1005)<(x1004); x1007 = (x1006)+(x1002); x1008 = (x1007)<(x1002); x1009 = (x1007)+(x999); x1010 = (x1009)<(x999); x1011 = (x1008)+(x1010); x1012 = (x1011)+(x1000); x1013 = (x1012)<(x1000); x1014 = (x1012)+(x997); x1015 = (x1014)<(x997); x1016 = (x1013)+(x1015); x1017 = (x1016)+(x998); x1018 = (x1017)<(x998); x1019 = (x1017)+(x995); x1020 = (x1019)<(x995); x1021 = (x1018)+(x1020); x1022 = (x1021)+(x996); x1023 = (x1022)<(x996); x1024 = (x1022)+(x993); x1025 = (x1024)<(x993); x1026 = (x1023)+(x1025); x1027 = (x1026)+(x994); x1028 = (x1027)<(x994); x1029 = (x1027)+(x991); x1030 = (x1029)<(x991); x1031 = (x1028)+(x1030); x1032 = (x1031)+(x992); x1033 = (x1032)<(x992); x1034 = (x1032)+(x989); x1035 = (x1034)<(x989); x1036 = (x1033)+(x1035); x1037 = (x1036)+(x990); x1038 = (x956)+(x1003); x1039 = (x1038)<(x956); x1040 = (x1039)+(x961); x1041 = (x1040)<(x961); x1042 = (x1040)+(x1005); x1043 = (x1042)<(x1005); x1044 = (x1041)+(x1043); x1045 = (x1044)+(x966); x1046 = (x1045)<(x966); x1047 = (x1045)+(x1009); x1048 = (x1047)<(x1009); x1049 = (x1046)+(x1048); x1050 = (x1049)+(x969); x1051 = (x1050)<(x969); x1052 = (x1050)+(x1014); x1053 = (x1052)<(x1014); x1054 = (x1051)+(x1053); x1055 = (x1054)+(x971); x1056 = (x1055)<(x971); x1057 = (x1055)+(x1019); x1058 = (x1057)<(x1019); x1059 = (x1056)+(x1058); x1060 = (x1059)+(x975); x1061 = (x1060)<(x975); x1062 = (x1060)+(x1024); x1063 = (x1062)<(x1024); x1064 = (x1061)+(x1063); x1065 = (x1064)+(x980); x1066 = (x1065)<(x980); x1067 = (x1065)+(x1029); x1068 = (x1067)<(x1029); x1069 = (x1066)+(x1068); x1070 = (x1069)+(x985); x1071 = (x1070)<(x985); x1072 = (x1070)+(x1034); x1073 = (x1072)<(x1034); x1074 = (x1071)+(x1073); x1075 = (x1074)+(x988); x1076 = (x1075)<(x988); x1077 = (x1075)+(x1037); x1078 = (x1077)<(x1037); x1079 = (x1076)+(x1078); x1080 = (x1038)*((uintptr_t)4294967295ULL); x1081 = sizeof(intptr_t) == 4 ? ((uint64_t)(x1038)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x1038)*((uintptr_t)4294967295ULL))>>64; x1082 = (x1038)*((uintptr_t)4294967295ULL); x1083 = sizeof(intptr_t) == 4 ? ((uint64_t)(x1038)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x1038)*((uintptr_t)4294967295ULL))>>64; x1084 = (x1038)*((uintptr_t)4294967295ULL); x1085 = sizeof(intptr_t) == 4 ? ((uint64_t)(x1038)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x1038)*((uintptr_t)4294967295ULL))>>64; x1086 = (x1038)*((uintptr_t)4294967295ULL); x1087 = sizeof(intptr_t) == 4 ? ((uint64_t)(x1038)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x1038)*((uintptr_t)4294967295ULL))>>64; x1088 = (x1087)+(x1084); x1089 = (x1088)<(x1087); x1090 = (x1089)+(x1085); x1091 = (x1090)<(x1085); x1092 = (x1090)+(x1082); x1093 = (x1092)<(x1082); x1094 = (x1091)+(x1093); x1095 = (x1094)+(x1083); x1096 = (x1038)+(x1086); x1097 = (x1096)<(x1038); x1098 = (x1097)+(x1042); x1099 = (x1098)<(x1042); x1100 = (x1098)+(x1088); x1101 = (x1100)<(x1088); x1102 = (x1099)+(x1101); x1103 = (x1102)+(x1047); x1104 = (x1103)<(x1047); x1105 = (x1103)+(x1092); x1106 = (x1105)<(x1092); x1107 = (x1104)+(x1106); x1108 = (x1107)+(x1052); x1109 = (x1108)<(x1052); x1110 = (x1108)+(x1095); x1111 = (x1110)<(x1095); x1112 = (x1109)+(x1111); x1113 = (x1112)+(x1057); x1114 = (x1113)<(x1057); x1115 = (x1114)+(x1062); x1116 = (x1115)<(x1062); x1117 = (x1116)+(x1067); x1118 = (x1117)<(x1067); x1119 = (x1117)+(x1038); x1120 = (x1119)<(x1038); x1121 = (x1118)+(x1120); x1122 = (x1121)+(x1072); x1123 = (x1122)<(x1072); x1124 = (x1122)+(x1080); x1125 = (x1124)<(x1080); x1126 = (x1123)+(x1125); x1127 = (x1126)+(x1077); x1128 = (x1127)<(x1077); x1129 = (x1127)+(x1081); x1130 = (x1129)<(x1081); x1131 = (x1128)+(x1130); x1132 = (x1131)+(x1079); x1133 = (x1100)-((uintptr_t)4294967295ULL); x1134 = (x1100)<(x1133); x1135 = (x1105)-((uintptr_t)4294967295ULL); x1136 = (x1105)<(x1135); x1137 = (x1135)-(x1134); x1138 = (x1135)<(x1137); x1139 = (x1136)+(x1138); x1140 = (x1110)-((uintptr_t)4294967295ULL); x1141 = (x1110)<(x1140); x1142 = (x1140)-(x1139); x1143 = (x1140)<(x1142); x1144 = (x1141)+(x1143); x1145 = (x1113)-(x1144); x1146 = (x1113)<(x1145); x1147 = (x1115)-(x1146); x1148 = (x1115)<(x1147); x1149 = (x1119)-(x1148); x1150 = (x1119)<(x1149); x1151 = (x1124)-((uintptr_t)1ULL); x1152 = (x1124)<(x1151); x1153 = (x1151)-(x1150); x1154 = (x1151)<(x1153); x1155 = (x1152)+(x1154); x1156 = (x1129)-((uintptr_t)4294967295ULL); x1157 = (x1129)<(x1156); x1158 = (x1156)-(x1155); x1159 = (x1156)<(x1158); x1160 = (x1157)+(x1159); x1161 = (x1132)-(x1160); x1162 = (x1132)<(x1161); x1163 = ((uintptr_t)-1ULL)+((x1162)==((uintptr_t)0ULL)); x1164 = (x1163)^((uintptr_t)4294967295ULL); x1165 = ((x1100)&(x1163))|((x1133)&(x1164)); x1166 = ((uintptr_t)-1ULL)+((x1162)==((uintptr_t)0ULL)); x1167 = (x1166)^((uintptr_t)4294967295ULL); x1168 = ((x1105)&(x1166))|((x1137)&(x1167)); x1169 = ((uintptr_t)-1ULL)+((x1162)==((uintptr_t)0ULL)); x1170 = (x1169)^((uintptr_t)4294967295ULL); x1171 = ((x1110)&(x1169))|((x1142)&(x1170)); x1172 = ((uintptr_t)-1ULL)+((x1162)==((uintptr_t)0ULL)); x1173 = (x1172)^((uintptr_t)4294967295ULL); x1174 = ((x1113)&(x1172))|((x1145)&(x1173)); x1175 = ((uintptr_t)-1ULL)+((x1162)==((uintptr_t)0ULL)); x1176 = (x1175)^((uintptr_t)4294967295ULL); x1177 = ((x1115)&(x1175))|((x1147)&(x1176)); x1178 = ((uintptr_t)-1ULL)+((x1162)==((uintptr_t)0ULL)); x1179 = (x1178)^((uintptr_t)4294967295ULL); x1180 = ((x1119)&(x1178))|((x1149)&(x1179)); x1181 = ((uintptr_t)-1ULL)+((x1162)==((uintptr_t)0ULL)); x1182 = (x1181)^((uintptr_t)4294967295ULL); x1183 = ((x1124)&(x1181))|((x1153)&(x1182)); x1184 = ((uintptr_t)-1ULL)+((x1162)==((uintptr_t)0ULL)); x1185 = (x1184)^((uintptr_t)4294967295ULL); x1186 = ((x1129)&(x1184))|((x1158)&(x1185)); x1187 = x1165; x1188 = x1168; x1189 = x1171; x1190 = x1174; x1191 = x1177; x1192 = x1180; x1193 = x1183; x1194 = x1186; /*skip*/ _br2_store((out0)+((uintptr_t)0ULL), x1187, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)4ULL), x1188, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)8ULL), x1189, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)12ULL), x1190, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)16ULL), x1191, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)20ULL), x1192, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)24ULL), x1193, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)28ULL), x1194, sizeof(uintptr_t)); /*skip*/ return; } /* NOTE: The following wrapper function is not covered by Coq proofs */ static void fiat_p256_mul(uint32_t out1[8], const uint32_t arg1[8], const uint32_t arg2[8]) { internal_fiat_p256_mul((uintptr_t)out1, (uintptr_t)arg1, (uintptr_t)arg2); } /* * Input Bounds: * in0: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * Output Bounds: * out0: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] */ static void internal_fiat_p256_square(uintptr_t out0, uintptr_t in0) { uintptr_t x15, x28, x31, x33, x29, x34, x26, x35, x37, x38, x27, x39, x24, x40, x42, x43, x25, x44, x22, x45, x47, x48, x23, x49, x20, x50, x52, x53, x21, x54, x18, x55, x57, x58, x19, x59, x16, x60, x62, x63, x17, x69, x72, x74, x70, x75, x67, x76, x78, x79, x68, x71, x81, x82, x32, x83, x73, x84, x86, x87, x36, x88, x77, x89, x91, x92, x41, x93, x80, x94, x96, x97, x46, x99, x51, x101, x56, x102, x30, x103, x105, x106, x61, x107, x65, x108, x110, x111, x64, x112, x66, x113, x115, x8, x129, x132, x134, x130, x135, x127, x136, x138, x139, x128, x140, x125, x141, x143, x144, x126, x145, x123, x146, x148, x149, x124, x150, x121, x151, x153, x154, x122, x155, x119, x156, x158, x159, x120, x160, x117, x161, x163, x164, x118, x131, x85, x167, x90, x168, x133, x169, x171, x172, x95, x173, x137, x174, x176, x177, x98, x178, x142, x179, x181, x182, x100, x183, x147, x184, x186, x187, x104, x188, x152, x189, x191, x192, x109, x193, x157, x194, x196, x197, x114, x198, x162, x199, x201, x202, x116, x203, x165, x204, x206, x212, x215, x217, x213, x218, x210, x219, x221, x222, x211, x214, x224, x225, x170, x226, x216, x227, x229, x230, x175, x231, x220, x232, x234, x235, x180, x236, x223, x237, x239, x240, x185, x242, x190, x244, x195, x245, x166, x246, x248, x249, x200, x250, x208, x251, x253, x254, x205, x255, x209, x256, x258, x259, x207, x9, x273, x276, x278, x274, x279, x271, x280, x282, x283, x272, x284, x269, x285, x287, x288, x270, x289, x267, x290, x292, x293, x268, x294, x265, x295, x297, x298, x266, x299, x263, x300, x302, x303, x264, x304, x261, x305, x307, x308, x262, x275, x228, x311, x233, x312, x277, x313, x315, x316, x238, x317, x281, x318, x320, x321, x241, x322, x286, x323, x325, x326, x243, x327, x291, x328, x330, x331, x247, x332, x296, x333, x335, x336, x252, x337, x301, x338, x340, x341, x257, x342, x306, x343, x345, x346, x260, x347, x309, x348, x350, x356, x359, x361, x357, x362, x354, x363, x365, x366, x355, x358, x368, x369, x314, x370, x360, x371, x373, x374, x319, x375, x364, x376, x378, x379, x324, x380, x367, x381, x383, x384, x329, x386, x334, x388, x339, x389, x310, x390, x392, x393, x344, x394, x352, x395, x397, x398, x349, x399, x353, x400, x402, x403, x351, x10, x417, x420, x422, x418, x423, x415, x424, x426, x427, x416, x428, x413, x429, x431, x432, x414, x433, x411, x434, x436, x437, x412, x438, x409, x439, x441, x442, x410, x443, x407, x444, x446, x447, x408, x448, x405, x449, x451, x452, x406, x419, x372, x455, x377, x456, x421, x457, x459, x460, x382, x461, x425, x462, x464, x465, x385, x466, x430, x467, x469, x470, x387, x471, x435, x472, x474, x475, x391, x476, x440, x477, x479, x480, x396, x481, x445, x482, x484, x485, x401, x486, x450, x487, x489, x490, x404, x491, x453, x492, x494, x500, x503, x505, x501, x506, x498, x507, x509, x510, x499, x502, x512, x513, x458, x514, x504, x515, x517, x518, x463, x519, x508, x520, x522, x523, x468, x524, x511, x525, x527, x528, x473, x530, x478, x532, x483, x533, x454, x534, x536, x537, x488, x538, x496, x539, x541, x542, x493, x543, x497, x544, x546, x547, x495, x11, x561, x564, x566, x562, x567, x559, x568, x570, x571, x560, x572, x557, x573, x575, x576, x558, x577, x555, x578, x580, x581, x556, x582, x553, x583, x585, x586, x554, x587, x551, x588, x590, x591, x552, x592, x549, x593, x595, x596, x550, x563, x516, x599, x521, x600, x565, x601, x603, x604, x526, x605, x569, x606, x608, x609, x529, x610, x574, x611, x613, x614, x531, x615, x579, x616, x618, x619, x535, x620, x584, x621, x623, x624, x540, x625, x589, x626, x628, x629, x545, x630, x594, x631, x633, x634, x548, x635, x597, x636, x638, x644, x647, x649, x645, x650, x642, x651, x653, x654, x643, x646, x656, x657, x602, x658, x648, x659, x661, x662, x607, x663, x652, x664, x666, x667, x612, x668, x655, x669, x671, x672, x617, x674, x622, x676, x627, x677, x598, x678, x680, x681, x632, x682, x640, x683, x685, x686, x637, x687, x641, x688, x690, x691, x639, x12, x705, x708, x710, x706, x711, x703, x712, x714, x715, x704, x716, x701, x717, x719, x720, x702, x721, x699, x722, x724, x725, x700, x726, x697, x727, x729, x730, x698, x731, x695, x732, x734, x735, x696, x736, x693, x737, x739, x740, x694, x707, x660, x743, x665, x744, x709, x745, x747, x748, x670, x749, x713, x750, x752, x753, x673, x754, x718, x755, x757, x758, x675, x759, x723, x760, x762, x763, x679, x764, x728, x765, x767, x768, x684, x769, x733, x770, x772, x773, x689, x774, x738, x775, x777, x778, x692, x779, x741, x780, x782, x788, x791, x793, x789, x794, x786, x795, x797, x798, x787, x790, x800, x801, x746, x802, x792, x803, x805, x806, x751, x807, x796, x808, x810, x811, x756, x812, x799, x813, x815, x816, x761, x818, x766, x820, x771, x821, x742, x822, x824, x825, x776, x826, x784, x827, x829, x830, x781, x831, x785, x832, x834, x835, x783, x13, x849, x852, x854, x850, x855, x847, x856, x858, x859, x848, x860, x845, x861, x863, x864, x846, x865, x843, x866, x868, x869, x844, x870, x841, x871, x873, x874, x842, x875, x839, x876, x878, x879, x840, x880, x837, x881, x883, x884, x838, x851, x804, x887, x809, x888, x853, x889, x891, x892, x814, x893, x857, x894, x896, x897, x817, x898, x862, x899, x901, x902, x819, x903, x867, x904, x906, x907, x823, x908, x872, x909, x911, x912, x828, x913, x877, x914, x916, x917, x833, x918, x882, x919, x921, x922, x836, x923, x885, x924, x926, x932, x935, x937, x933, x938, x930, x939, x941, x942, x931, x934, x944, x945, x890, x946, x936, x947, x949, x950, x895, x951, x940, x952, x954, x955, x900, x956, x943, x957, x959, x960, x905, x962, x910, x964, x915, x965, x886, x966, x968, x969, x920, x970, x928, x971, x973, x974, x925, x975, x929, x976, x978, x979, x927, x7, x6, x5, x4, x3, x2, x1, x14, x0, x993, x996, x998, x994, x999, x991, x1000, x1002, x1003, x992, x1004, x989, x1005, x1007, x1008, x990, x1009, x987, x1010, x1012, x1013, x988, x1014, x985, x1015, x1017, x1018, x986, x1019, x983, x1020, x1022, x1023, x984, x1024, x981, x1025, x1027, x1028, x982, x995, x948, x1031, x953, x1032, x997, x1033, x1035, x1036, x958, x1037, x1001, x1038, x1040, x1041, x961, x1042, x1006, x1043, x1045, x1046, x963, x1047, x1011, x1048, x1050, x1051, x967, x1052, x1016, x1053, x1055, x1056, x972, x1057, x1021, x1058, x1060, x1061, x977, x1062, x1026, x1063, x1065, x1066, x980, x1067, x1029, x1068, x1070, x1076, x1079, x1081, x1077, x1082, x1074, x1083, x1085, x1086, x1075, x1078, x1088, x1089, x1034, x1090, x1080, x1091, x1093, x1094, x1039, x1095, x1084, x1096, x1098, x1099, x1044, x1100, x1087, x1101, x1103, x1104, x1049, x1106, x1054, x1108, x1059, x1109, x1030, x1110, x1112, x1113, x1064, x1114, x1072, x1115, x1117, x1118, x1069, x1119, x1073, x1120, x1122, x1123, x1071, x1126, x1127, x1128, x1130, x1131, x1132, x1133, x1135, x1136, x1138, x1140, x1142, x1143, x1144, x1146, x1147, x1148, x1149, x1151, x1152, x1124, x1153, x1092, x1155, x1125, x1156, x1097, x1158, x1129, x1159, x1102, x1161, x1134, x1162, x1105, x1164, x1137, x1165, x1107, x1167, x1139, x1168, x1111, x1170, x1141, x1171, x1116, x1173, x1145, x1174, x1154, x1121, x1176, x1150, x1177, x1157, x1160, x1163, x1166, x1169, x1172, x1175, x1178, x1179, x1180, x1181, x1182, x1183, x1184, x1185, x1186; x0 = _br2_load((in0)+((uintptr_t)0ULL), sizeof(uintptr_t)); x1 = _br2_load((in0)+((uintptr_t)4ULL), sizeof(uintptr_t)); x2 = _br2_load((in0)+((uintptr_t)8ULL), sizeof(uintptr_t)); x3 = _br2_load((in0)+((uintptr_t)12ULL), sizeof(uintptr_t)); x4 = _br2_load((in0)+((uintptr_t)16ULL), sizeof(uintptr_t)); x5 = _br2_load((in0)+((uintptr_t)20ULL), sizeof(uintptr_t)); x6 = _br2_load((in0)+((uintptr_t)24ULL), sizeof(uintptr_t)); x7 = _br2_load((in0)+((uintptr_t)28ULL), sizeof(uintptr_t)); /*skip*/ /*skip*/ x8 = x1; x9 = x2; x10 = x3; x11 = x4; x12 = x5; x13 = x6; x14 = x7; x15 = x0; x16 = (x15)*(x7); x17 = sizeof(intptr_t) == 4 ? ((uint64_t)(x15)*(x7))>>32 : ((__uint128_t)(x15)*(x7))>>64; x18 = (x15)*(x6); x19 = sizeof(intptr_t) == 4 ? ((uint64_t)(x15)*(x6))>>32 : ((__uint128_t)(x15)*(x6))>>64; x20 = (x15)*(x5); x21 = sizeof(intptr_t) == 4 ? ((uint64_t)(x15)*(x5))>>32 : ((__uint128_t)(x15)*(x5))>>64; x22 = (x15)*(x4); x23 = sizeof(intptr_t) == 4 ? ((uint64_t)(x15)*(x4))>>32 : ((__uint128_t)(x15)*(x4))>>64; x24 = (x15)*(x3); x25 = sizeof(intptr_t) == 4 ? ((uint64_t)(x15)*(x3))>>32 : ((__uint128_t)(x15)*(x3))>>64; x26 = (x15)*(x2); x27 = sizeof(intptr_t) == 4 ? ((uint64_t)(x15)*(x2))>>32 : ((__uint128_t)(x15)*(x2))>>64; x28 = (x15)*(x1); x29 = sizeof(intptr_t) == 4 ? ((uint64_t)(x15)*(x1))>>32 : ((__uint128_t)(x15)*(x1))>>64; x30 = (x15)*(x0); x31 = sizeof(intptr_t) == 4 ? ((uint64_t)(x15)*(x0))>>32 : ((__uint128_t)(x15)*(x0))>>64; x32 = (x31)+(x28); x33 = (x32)<(x31); x34 = (x33)+(x29); x35 = (x34)<(x29); x36 = (x34)+(x26); x37 = (x36)<(x26); x38 = (x35)+(x37); x39 = (x38)+(x27); x40 = (x39)<(x27); x41 = (x39)+(x24); x42 = (x41)<(x24); x43 = (x40)+(x42); x44 = (x43)+(x25); x45 = (x44)<(x25); x46 = (x44)+(x22); x47 = (x46)<(x22); x48 = (x45)+(x47); x49 = (x48)+(x23); x50 = (x49)<(x23); x51 = (x49)+(x20); x52 = (x51)<(x20); x53 = (x50)+(x52); x54 = (x53)+(x21); x55 = (x54)<(x21); x56 = (x54)+(x18); x57 = (x56)<(x18); x58 = (x55)+(x57); x59 = (x58)+(x19); x60 = (x59)<(x19); x61 = (x59)+(x16); x62 = (x61)<(x16); x63 = (x60)+(x62); x64 = (x63)+(x17); x65 = (x30)*((uintptr_t)4294967295ULL); x66 = sizeof(intptr_t) == 4 ? ((uint64_t)(x30)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x30)*((uintptr_t)4294967295ULL))>>64; x67 = (x30)*((uintptr_t)4294967295ULL); x68 = sizeof(intptr_t) == 4 ? ((uint64_t)(x30)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x30)*((uintptr_t)4294967295ULL))>>64; x69 = (x30)*((uintptr_t)4294967295ULL); x70 = sizeof(intptr_t) == 4 ? ((uint64_t)(x30)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x30)*((uintptr_t)4294967295ULL))>>64; x71 = (x30)*((uintptr_t)4294967295ULL); x72 = sizeof(intptr_t) == 4 ? ((uint64_t)(x30)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x30)*((uintptr_t)4294967295ULL))>>64; x73 = (x72)+(x69); x74 = (x73)<(x72); x75 = (x74)+(x70); x76 = (x75)<(x70); x77 = (x75)+(x67); x78 = (x77)<(x67); x79 = (x76)+(x78); x80 = (x79)+(x68); x81 = (x30)+(x71); x82 = (x81)<(x30); x83 = (x82)+(x32); x84 = (x83)<(x32); x85 = (x83)+(x73); x86 = (x85)<(x73); x87 = (x84)+(x86); x88 = (x87)+(x36); x89 = (x88)<(x36); x90 = (x88)+(x77); x91 = (x90)<(x77); x92 = (x89)+(x91); x93 = (x92)+(x41); x94 = (x93)<(x41); x95 = (x93)+(x80); x96 = (x95)<(x80); x97 = (x94)+(x96); x98 = (x97)+(x46); x99 = (x98)<(x46); x100 = (x99)+(x51); x101 = (x100)<(x51); x102 = (x101)+(x56); x103 = (x102)<(x56); x104 = (x102)+(x30); x105 = (x104)<(x30); x106 = (x103)+(x105); x107 = (x106)+(x61); x108 = (x107)<(x61); x109 = (x107)+(x65); x110 = (x109)<(x65); x111 = (x108)+(x110); x112 = (x111)+(x64); x113 = (x112)<(x64); x114 = (x112)+(x66); x115 = (x114)<(x66); x116 = (x113)+(x115); x117 = (x8)*(x7); x118 = sizeof(intptr_t) == 4 ? ((uint64_t)(x8)*(x7))>>32 : ((__uint128_t)(x8)*(x7))>>64; x119 = (x8)*(x6); x120 = sizeof(intptr_t) == 4 ? ((uint64_t)(x8)*(x6))>>32 : ((__uint128_t)(x8)*(x6))>>64; x121 = (x8)*(x5); x122 = sizeof(intptr_t) == 4 ? ((uint64_t)(x8)*(x5))>>32 : ((__uint128_t)(x8)*(x5))>>64; x123 = (x8)*(x4); x124 = sizeof(intptr_t) == 4 ? ((uint64_t)(x8)*(x4))>>32 : ((__uint128_t)(x8)*(x4))>>64; x125 = (x8)*(x3); x126 = sizeof(intptr_t) == 4 ? ((uint64_t)(x8)*(x3))>>32 : ((__uint128_t)(x8)*(x3))>>64; x127 = (x8)*(x2); x128 = sizeof(intptr_t) == 4 ? ((uint64_t)(x8)*(x2))>>32 : ((__uint128_t)(x8)*(x2))>>64; x129 = (x8)*(x1); x130 = sizeof(intptr_t) == 4 ? ((uint64_t)(x8)*(x1))>>32 : ((__uint128_t)(x8)*(x1))>>64; x131 = (x8)*(x0); x132 = sizeof(intptr_t) == 4 ? ((uint64_t)(x8)*(x0))>>32 : ((__uint128_t)(x8)*(x0))>>64; x133 = (x132)+(x129); x134 = (x133)<(x132); x135 = (x134)+(x130); x136 = (x135)<(x130); x137 = (x135)+(x127); x138 = (x137)<(x127); x139 = (x136)+(x138); x140 = (x139)+(x128); x141 = (x140)<(x128); x142 = (x140)+(x125); x143 = (x142)<(x125); x144 = (x141)+(x143); x145 = (x144)+(x126); x146 = (x145)<(x126); x147 = (x145)+(x123); x148 = (x147)<(x123); x149 = (x146)+(x148); x150 = (x149)+(x124); x151 = (x150)<(x124); x152 = (x150)+(x121); x153 = (x152)<(x121); x154 = (x151)+(x153); x155 = (x154)+(x122); x156 = (x155)<(x122); x157 = (x155)+(x119); x158 = (x157)<(x119); x159 = (x156)+(x158); x160 = (x159)+(x120); x161 = (x160)<(x120); x162 = (x160)+(x117); x163 = (x162)<(x117); x164 = (x161)+(x163); x165 = (x164)+(x118); x166 = (x85)+(x131); x167 = (x166)<(x85); x168 = (x167)+(x90); x169 = (x168)<(x90); x170 = (x168)+(x133); x171 = (x170)<(x133); x172 = (x169)+(x171); x173 = (x172)+(x95); x174 = (x173)<(x95); x175 = (x173)+(x137); x176 = (x175)<(x137); x177 = (x174)+(x176); x178 = (x177)+(x98); x179 = (x178)<(x98); x180 = (x178)+(x142); x181 = (x180)<(x142); x182 = (x179)+(x181); x183 = (x182)+(x100); x184 = (x183)<(x100); x185 = (x183)+(x147); x186 = (x185)<(x147); x187 = (x184)+(x186); x188 = (x187)+(x104); x189 = (x188)<(x104); x190 = (x188)+(x152); x191 = (x190)<(x152); x192 = (x189)+(x191); x193 = (x192)+(x109); x194 = (x193)<(x109); x195 = (x193)+(x157); x196 = (x195)<(x157); x197 = (x194)+(x196); x198 = (x197)+(x114); x199 = (x198)<(x114); x200 = (x198)+(x162); x201 = (x200)<(x162); x202 = (x199)+(x201); x203 = (x202)+(x116); x204 = (x203)<(x116); x205 = (x203)+(x165); x206 = (x205)<(x165); x207 = (x204)+(x206); x208 = (x166)*((uintptr_t)4294967295ULL); x209 = sizeof(intptr_t) == 4 ? ((uint64_t)(x166)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x166)*((uintptr_t)4294967295ULL))>>64; x210 = (x166)*((uintptr_t)4294967295ULL); x211 = sizeof(intptr_t) == 4 ? ((uint64_t)(x166)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x166)*((uintptr_t)4294967295ULL))>>64; x212 = (x166)*((uintptr_t)4294967295ULL); x213 = sizeof(intptr_t) == 4 ? ((uint64_t)(x166)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x166)*((uintptr_t)4294967295ULL))>>64; x214 = (x166)*((uintptr_t)4294967295ULL); x215 = sizeof(intptr_t) == 4 ? ((uint64_t)(x166)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x166)*((uintptr_t)4294967295ULL))>>64; x216 = (x215)+(x212); x217 = (x216)<(x215); x218 = (x217)+(x213); x219 = (x218)<(x213); x220 = (x218)+(x210); x221 = (x220)<(x210); x222 = (x219)+(x221); x223 = (x222)+(x211); x224 = (x166)+(x214); x225 = (x224)<(x166); x226 = (x225)+(x170); x227 = (x226)<(x170); x228 = (x226)+(x216); x229 = (x228)<(x216); x230 = (x227)+(x229); x231 = (x230)+(x175); x232 = (x231)<(x175); x233 = (x231)+(x220); x234 = (x233)<(x220); x235 = (x232)+(x234); x236 = (x235)+(x180); x237 = (x236)<(x180); x238 = (x236)+(x223); x239 = (x238)<(x223); x240 = (x237)+(x239); x241 = (x240)+(x185); x242 = (x241)<(x185); x243 = (x242)+(x190); x244 = (x243)<(x190); x245 = (x244)+(x195); x246 = (x245)<(x195); x247 = (x245)+(x166); x248 = (x247)<(x166); x249 = (x246)+(x248); x250 = (x249)+(x200); x251 = (x250)<(x200); x252 = (x250)+(x208); x253 = (x252)<(x208); x254 = (x251)+(x253); x255 = (x254)+(x205); x256 = (x255)<(x205); x257 = (x255)+(x209); x258 = (x257)<(x209); x259 = (x256)+(x258); x260 = (x259)+(x207); x261 = (x9)*(x7); x262 = sizeof(intptr_t) == 4 ? ((uint64_t)(x9)*(x7))>>32 : ((__uint128_t)(x9)*(x7))>>64; x263 = (x9)*(x6); x264 = sizeof(intptr_t) == 4 ? ((uint64_t)(x9)*(x6))>>32 : ((__uint128_t)(x9)*(x6))>>64; x265 = (x9)*(x5); x266 = sizeof(intptr_t) == 4 ? ((uint64_t)(x9)*(x5))>>32 : ((__uint128_t)(x9)*(x5))>>64; x267 = (x9)*(x4); x268 = sizeof(intptr_t) == 4 ? ((uint64_t)(x9)*(x4))>>32 : ((__uint128_t)(x9)*(x4))>>64; x269 = (x9)*(x3); x270 = sizeof(intptr_t) == 4 ? ((uint64_t)(x9)*(x3))>>32 : ((__uint128_t)(x9)*(x3))>>64; x271 = (x9)*(x2); x272 = sizeof(intptr_t) == 4 ? ((uint64_t)(x9)*(x2))>>32 : ((__uint128_t)(x9)*(x2))>>64; x273 = (x9)*(x1); x274 = sizeof(intptr_t) == 4 ? ((uint64_t)(x9)*(x1))>>32 : ((__uint128_t)(x9)*(x1))>>64; x275 = (x9)*(x0); x276 = sizeof(intptr_t) == 4 ? ((uint64_t)(x9)*(x0))>>32 : ((__uint128_t)(x9)*(x0))>>64; x277 = (x276)+(x273); x278 = (x277)<(x276); x279 = (x278)+(x274); x280 = (x279)<(x274); x281 = (x279)+(x271); x282 = (x281)<(x271); x283 = (x280)+(x282); x284 = (x283)+(x272); x285 = (x284)<(x272); x286 = (x284)+(x269); x287 = (x286)<(x269); x288 = (x285)+(x287); x289 = (x288)+(x270); x290 = (x289)<(x270); x291 = (x289)+(x267); x292 = (x291)<(x267); x293 = (x290)+(x292); x294 = (x293)+(x268); x295 = (x294)<(x268); x296 = (x294)+(x265); x297 = (x296)<(x265); x298 = (x295)+(x297); x299 = (x298)+(x266); x300 = (x299)<(x266); x301 = (x299)+(x263); x302 = (x301)<(x263); x303 = (x300)+(x302); x304 = (x303)+(x264); x305 = (x304)<(x264); x306 = (x304)+(x261); x307 = (x306)<(x261); x308 = (x305)+(x307); x309 = (x308)+(x262); x310 = (x228)+(x275); x311 = (x310)<(x228); x312 = (x311)+(x233); x313 = (x312)<(x233); x314 = (x312)+(x277); x315 = (x314)<(x277); x316 = (x313)+(x315); x317 = (x316)+(x238); x318 = (x317)<(x238); x319 = (x317)+(x281); x320 = (x319)<(x281); x321 = (x318)+(x320); x322 = (x321)+(x241); x323 = (x322)<(x241); x324 = (x322)+(x286); x325 = (x324)<(x286); x326 = (x323)+(x325); x327 = (x326)+(x243); x328 = (x327)<(x243); x329 = (x327)+(x291); x330 = (x329)<(x291); x331 = (x328)+(x330); x332 = (x331)+(x247); x333 = (x332)<(x247); x334 = (x332)+(x296); x335 = (x334)<(x296); x336 = (x333)+(x335); x337 = (x336)+(x252); x338 = (x337)<(x252); x339 = (x337)+(x301); x340 = (x339)<(x301); x341 = (x338)+(x340); x342 = (x341)+(x257); x343 = (x342)<(x257); x344 = (x342)+(x306); x345 = (x344)<(x306); x346 = (x343)+(x345); x347 = (x346)+(x260); x348 = (x347)<(x260); x349 = (x347)+(x309); x350 = (x349)<(x309); x351 = (x348)+(x350); x352 = (x310)*((uintptr_t)4294967295ULL); x353 = sizeof(intptr_t) == 4 ? ((uint64_t)(x310)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x310)*((uintptr_t)4294967295ULL))>>64; x354 = (x310)*((uintptr_t)4294967295ULL); x355 = sizeof(intptr_t) == 4 ? ((uint64_t)(x310)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x310)*((uintptr_t)4294967295ULL))>>64; x356 = (x310)*((uintptr_t)4294967295ULL); x357 = sizeof(intptr_t) == 4 ? ((uint64_t)(x310)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x310)*((uintptr_t)4294967295ULL))>>64; x358 = (x310)*((uintptr_t)4294967295ULL); x359 = sizeof(intptr_t) == 4 ? ((uint64_t)(x310)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x310)*((uintptr_t)4294967295ULL))>>64; x360 = (x359)+(x356); x361 = (x360)<(x359); x362 = (x361)+(x357); x363 = (x362)<(x357); x364 = (x362)+(x354); x365 = (x364)<(x354); x366 = (x363)+(x365); x367 = (x366)+(x355); x368 = (x310)+(x358); x369 = (x368)<(x310); x370 = (x369)+(x314); x371 = (x370)<(x314); x372 = (x370)+(x360); x373 = (x372)<(x360); x374 = (x371)+(x373); x375 = (x374)+(x319); x376 = (x375)<(x319); x377 = (x375)+(x364); x378 = (x377)<(x364); x379 = (x376)+(x378); x380 = (x379)+(x324); x381 = (x380)<(x324); x382 = (x380)+(x367); x383 = (x382)<(x367); x384 = (x381)+(x383); x385 = (x384)+(x329); x386 = (x385)<(x329); x387 = (x386)+(x334); x388 = (x387)<(x334); x389 = (x388)+(x339); x390 = (x389)<(x339); x391 = (x389)+(x310); x392 = (x391)<(x310); x393 = (x390)+(x392); x394 = (x393)+(x344); x395 = (x394)<(x344); x396 = (x394)+(x352); x397 = (x396)<(x352); x398 = (x395)+(x397); x399 = (x398)+(x349); x400 = (x399)<(x349); x401 = (x399)+(x353); x402 = (x401)<(x353); x403 = (x400)+(x402); x404 = (x403)+(x351); x405 = (x10)*(x7); x406 = sizeof(intptr_t) == 4 ? ((uint64_t)(x10)*(x7))>>32 : ((__uint128_t)(x10)*(x7))>>64; x407 = (x10)*(x6); x408 = sizeof(intptr_t) == 4 ? ((uint64_t)(x10)*(x6))>>32 : ((__uint128_t)(x10)*(x6))>>64; x409 = (x10)*(x5); x410 = sizeof(intptr_t) == 4 ? ((uint64_t)(x10)*(x5))>>32 : ((__uint128_t)(x10)*(x5))>>64; x411 = (x10)*(x4); x412 = sizeof(intptr_t) == 4 ? ((uint64_t)(x10)*(x4))>>32 : ((__uint128_t)(x10)*(x4))>>64; x413 = (x10)*(x3); x414 = sizeof(intptr_t) == 4 ? ((uint64_t)(x10)*(x3))>>32 : ((__uint128_t)(x10)*(x3))>>64; x415 = (x10)*(x2); x416 = sizeof(intptr_t) == 4 ? ((uint64_t)(x10)*(x2))>>32 : ((__uint128_t)(x10)*(x2))>>64; x417 = (x10)*(x1); x418 = sizeof(intptr_t) == 4 ? ((uint64_t)(x10)*(x1))>>32 : ((__uint128_t)(x10)*(x1))>>64; x419 = (x10)*(x0); x420 = sizeof(intptr_t) == 4 ? ((uint64_t)(x10)*(x0))>>32 : ((__uint128_t)(x10)*(x0))>>64; x421 = (x420)+(x417); x422 = (x421)<(x420); x423 = (x422)+(x418); x424 = (x423)<(x418); x425 = (x423)+(x415); x426 = (x425)<(x415); x427 = (x424)+(x426); x428 = (x427)+(x416); x429 = (x428)<(x416); x430 = (x428)+(x413); x431 = (x430)<(x413); x432 = (x429)+(x431); x433 = (x432)+(x414); x434 = (x433)<(x414); x435 = (x433)+(x411); x436 = (x435)<(x411); x437 = (x434)+(x436); x438 = (x437)+(x412); x439 = (x438)<(x412); x440 = (x438)+(x409); x441 = (x440)<(x409); x442 = (x439)+(x441); x443 = (x442)+(x410); x444 = (x443)<(x410); x445 = (x443)+(x407); x446 = (x445)<(x407); x447 = (x444)+(x446); x448 = (x447)+(x408); x449 = (x448)<(x408); x450 = (x448)+(x405); x451 = (x450)<(x405); x452 = (x449)+(x451); x453 = (x452)+(x406); x454 = (x372)+(x419); x455 = (x454)<(x372); x456 = (x455)+(x377); x457 = (x456)<(x377); x458 = (x456)+(x421); x459 = (x458)<(x421); x460 = (x457)+(x459); x461 = (x460)+(x382); x462 = (x461)<(x382); x463 = (x461)+(x425); x464 = (x463)<(x425); x465 = (x462)+(x464); x466 = (x465)+(x385); x467 = (x466)<(x385); x468 = (x466)+(x430); x469 = (x468)<(x430); x470 = (x467)+(x469); x471 = (x470)+(x387); x472 = (x471)<(x387); x473 = (x471)+(x435); x474 = (x473)<(x435); x475 = (x472)+(x474); x476 = (x475)+(x391); x477 = (x476)<(x391); x478 = (x476)+(x440); x479 = (x478)<(x440); x480 = (x477)+(x479); x481 = (x480)+(x396); x482 = (x481)<(x396); x483 = (x481)+(x445); x484 = (x483)<(x445); x485 = (x482)+(x484); x486 = (x485)+(x401); x487 = (x486)<(x401); x488 = (x486)+(x450); x489 = (x488)<(x450); x490 = (x487)+(x489); x491 = (x490)+(x404); x492 = (x491)<(x404); x493 = (x491)+(x453); x494 = (x493)<(x453); x495 = (x492)+(x494); x496 = (x454)*((uintptr_t)4294967295ULL); x497 = sizeof(intptr_t) == 4 ? ((uint64_t)(x454)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x454)*((uintptr_t)4294967295ULL))>>64; x498 = (x454)*((uintptr_t)4294967295ULL); x499 = sizeof(intptr_t) == 4 ? ((uint64_t)(x454)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x454)*((uintptr_t)4294967295ULL))>>64; x500 = (x454)*((uintptr_t)4294967295ULL); x501 = sizeof(intptr_t) == 4 ? ((uint64_t)(x454)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x454)*((uintptr_t)4294967295ULL))>>64; x502 = (x454)*((uintptr_t)4294967295ULL); x503 = sizeof(intptr_t) == 4 ? ((uint64_t)(x454)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x454)*((uintptr_t)4294967295ULL))>>64; x504 = (x503)+(x500); x505 = (x504)<(x503); x506 = (x505)+(x501); x507 = (x506)<(x501); x508 = (x506)+(x498); x509 = (x508)<(x498); x510 = (x507)+(x509); x511 = (x510)+(x499); x512 = (x454)+(x502); x513 = (x512)<(x454); x514 = (x513)+(x458); x515 = (x514)<(x458); x516 = (x514)+(x504); x517 = (x516)<(x504); x518 = (x515)+(x517); x519 = (x518)+(x463); x520 = (x519)<(x463); x521 = (x519)+(x508); x522 = (x521)<(x508); x523 = (x520)+(x522); x524 = (x523)+(x468); x525 = (x524)<(x468); x526 = (x524)+(x511); x527 = (x526)<(x511); x528 = (x525)+(x527); x529 = (x528)+(x473); x530 = (x529)<(x473); x531 = (x530)+(x478); x532 = (x531)<(x478); x533 = (x532)+(x483); x534 = (x533)<(x483); x535 = (x533)+(x454); x536 = (x535)<(x454); x537 = (x534)+(x536); x538 = (x537)+(x488); x539 = (x538)<(x488); x540 = (x538)+(x496); x541 = (x540)<(x496); x542 = (x539)+(x541); x543 = (x542)+(x493); x544 = (x543)<(x493); x545 = (x543)+(x497); x546 = (x545)<(x497); x547 = (x544)+(x546); x548 = (x547)+(x495); x549 = (x11)*(x7); x550 = sizeof(intptr_t) == 4 ? ((uint64_t)(x11)*(x7))>>32 : ((__uint128_t)(x11)*(x7))>>64; x551 = (x11)*(x6); x552 = sizeof(intptr_t) == 4 ? ((uint64_t)(x11)*(x6))>>32 : ((__uint128_t)(x11)*(x6))>>64; x553 = (x11)*(x5); x554 = sizeof(intptr_t) == 4 ? ((uint64_t)(x11)*(x5))>>32 : ((__uint128_t)(x11)*(x5))>>64; x555 = (x11)*(x4); x556 = sizeof(intptr_t) == 4 ? ((uint64_t)(x11)*(x4))>>32 : ((__uint128_t)(x11)*(x4))>>64; x557 = (x11)*(x3); x558 = sizeof(intptr_t) == 4 ? ((uint64_t)(x11)*(x3))>>32 : ((__uint128_t)(x11)*(x3))>>64; x559 = (x11)*(x2); x560 = sizeof(intptr_t) == 4 ? ((uint64_t)(x11)*(x2))>>32 : ((__uint128_t)(x11)*(x2))>>64; x561 = (x11)*(x1); x562 = sizeof(intptr_t) == 4 ? ((uint64_t)(x11)*(x1))>>32 : ((__uint128_t)(x11)*(x1))>>64; x563 = (x11)*(x0); x564 = sizeof(intptr_t) == 4 ? ((uint64_t)(x11)*(x0))>>32 : ((__uint128_t)(x11)*(x0))>>64; x565 = (x564)+(x561); x566 = (x565)<(x564); x567 = (x566)+(x562); x568 = (x567)<(x562); x569 = (x567)+(x559); x570 = (x569)<(x559); x571 = (x568)+(x570); x572 = (x571)+(x560); x573 = (x572)<(x560); x574 = (x572)+(x557); x575 = (x574)<(x557); x576 = (x573)+(x575); x577 = (x576)+(x558); x578 = (x577)<(x558); x579 = (x577)+(x555); x580 = (x579)<(x555); x581 = (x578)+(x580); x582 = (x581)+(x556); x583 = (x582)<(x556); x584 = (x582)+(x553); x585 = (x584)<(x553); x586 = (x583)+(x585); x587 = (x586)+(x554); x588 = (x587)<(x554); x589 = (x587)+(x551); x590 = (x589)<(x551); x591 = (x588)+(x590); x592 = (x591)+(x552); x593 = (x592)<(x552); x594 = (x592)+(x549); x595 = (x594)<(x549); x596 = (x593)+(x595); x597 = (x596)+(x550); x598 = (x516)+(x563); x599 = (x598)<(x516); x600 = (x599)+(x521); x601 = (x600)<(x521); x602 = (x600)+(x565); x603 = (x602)<(x565); x604 = (x601)+(x603); x605 = (x604)+(x526); x606 = (x605)<(x526); x607 = (x605)+(x569); x608 = (x607)<(x569); x609 = (x606)+(x608); x610 = (x609)+(x529); x611 = (x610)<(x529); x612 = (x610)+(x574); x613 = (x612)<(x574); x614 = (x611)+(x613); x615 = (x614)+(x531); x616 = (x615)<(x531); x617 = (x615)+(x579); x618 = (x617)<(x579); x619 = (x616)+(x618); x620 = (x619)+(x535); x621 = (x620)<(x535); x622 = (x620)+(x584); x623 = (x622)<(x584); x624 = (x621)+(x623); x625 = (x624)+(x540); x626 = (x625)<(x540); x627 = (x625)+(x589); x628 = (x627)<(x589); x629 = (x626)+(x628); x630 = (x629)+(x545); x631 = (x630)<(x545); x632 = (x630)+(x594); x633 = (x632)<(x594); x634 = (x631)+(x633); x635 = (x634)+(x548); x636 = (x635)<(x548); x637 = (x635)+(x597); x638 = (x637)<(x597); x639 = (x636)+(x638); x640 = (x598)*((uintptr_t)4294967295ULL); x641 = sizeof(intptr_t) == 4 ? ((uint64_t)(x598)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x598)*((uintptr_t)4294967295ULL))>>64; x642 = (x598)*((uintptr_t)4294967295ULL); x643 = sizeof(intptr_t) == 4 ? ((uint64_t)(x598)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x598)*((uintptr_t)4294967295ULL))>>64; x644 = (x598)*((uintptr_t)4294967295ULL); x645 = sizeof(intptr_t) == 4 ? ((uint64_t)(x598)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x598)*((uintptr_t)4294967295ULL))>>64; x646 = (x598)*((uintptr_t)4294967295ULL); x647 = sizeof(intptr_t) == 4 ? ((uint64_t)(x598)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x598)*((uintptr_t)4294967295ULL))>>64; x648 = (x647)+(x644); x649 = (x648)<(x647); x650 = (x649)+(x645); x651 = (x650)<(x645); x652 = (x650)+(x642); x653 = (x652)<(x642); x654 = (x651)+(x653); x655 = (x654)+(x643); x656 = (x598)+(x646); x657 = (x656)<(x598); x658 = (x657)+(x602); x659 = (x658)<(x602); x660 = (x658)+(x648); x661 = (x660)<(x648); x662 = (x659)+(x661); x663 = (x662)+(x607); x664 = (x663)<(x607); x665 = (x663)+(x652); x666 = (x665)<(x652); x667 = (x664)+(x666); x668 = (x667)+(x612); x669 = (x668)<(x612); x670 = (x668)+(x655); x671 = (x670)<(x655); x672 = (x669)+(x671); x673 = (x672)+(x617); x674 = (x673)<(x617); x675 = (x674)+(x622); x676 = (x675)<(x622); x677 = (x676)+(x627); x678 = (x677)<(x627); x679 = (x677)+(x598); x680 = (x679)<(x598); x681 = (x678)+(x680); x682 = (x681)+(x632); x683 = (x682)<(x632); x684 = (x682)+(x640); x685 = (x684)<(x640); x686 = (x683)+(x685); x687 = (x686)+(x637); x688 = (x687)<(x637); x689 = (x687)+(x641); x690 = (x689)<(x641); x691 = (x688)+(x690); x692 = (x691)+(x639); x693 = (x12)*(x7); x694 = sizeof(intptr_t) == 4 ? ((uint64_t)(x12)*(x7))>>32 : ((__uint128_t)(x12)*(x7))>>64; x695 = (x12)*(x6); x696 = sizeof(intptr_t) == 4 ? ((uint64_t)(x12)*(x6))>>32 : ((__uint128_t)(x12)*(x6))>>64; x697 = (x12)*(x5); x698 = sizeof(intptr_t) == 4 ? ((uint64_t)(x12)*(x5))>>32 : ((__uint128_t)(x12)*(x5))>>64; x699 = (x12)*(x4); x700 = sizeof(intptr_t) == 4 ? ((uint64_t)(x12)*(x4))>>32 : ((__uint128_t)(x12)*(x4))>>64; x701 = (x12)*(x3); x702 = sizeof(intptr_t) == 4 ? ((uint64_t)(x12)*(x3))>>32 : ((__uint128_t)(x12)*(x3))>>64; x703 = (x12)*(x2); x704 = sizeof(intptr_t) == 4 ? ((uint64_t)(x12)*(x2))>>32 : ((__uint128_t)(x12)*(x2))>>64; x705 = (x12)*(x1); x706 = sizeof(intptr_t) == 4 ? ((uint64_t)(x12)*(x1))>>32 : ((__uint128_t)(x12)*(x1))>>64; x707 = (x12)*(x0); x708 = sizeof(intptr_t) == 4 ? ((uint64_t)(x12)*(x0))>>32 : ((__uint128_t)(x12)*(x0))>>64; x709 = (x708)+(x705); x710 = (x709)<(x708); x711 = (x710)+(x706); x712 = (x711)<(x706); x713 = (x711)+(x703); x714 = (x713)<(x703); x715 = (x712)+(x714); x716 = (x715)+(x704); x717 = (x716)<(x704); x718 = (x716)+(x701); x719 = (x718)<(x701); x720 = (x717)+(x719); x721 = (x720)+(x702); x722 = (x721)<(x702); x723 = (x721)+(x699); x724 = (x723)<(x699); x725 = (x722)+(x724); x726 = (x725)+(x700); x727 = (x726)<(x700); x728 = (x726)+(x697); x729 = (x728)<(x697); x730 = (x727)+(x729); x731 = (x730)+(x698); x732 = (x731)<(x698); x733 = (x731)+(x695); x734 = (x733)<(x695); x735 = (x732)+(x734); x736 = (x735)+(x696); x737 = (x736)<(x696); x738 = (x736)+(x693); x739 = (x738)<(x693); x740 = (x737)+(x739); x741 = (x740)+(x694); x742 = (x660)+(x707); x743 = (x742)<(x660); x744 = (x743)+(x665); x745 = (x744)<(x665); x746 = (x744)+(x709); x747 = (x746)<(x709); x748 = (x745)+(x747); x749 = (x748)+(x670); x750 = (x749)<(x670); x751 = (x749)+(x713); x752 = (x751)<(x713); x753 = (x750)+(x752); x754 = (x753)+(x673); x755 = (x754)<(x673); x756 = (x754)+(x718); x757 = (x756)<(x718); x758 = (x755)+(x757); x759 = (x758)+(x675); x760 = (x759)<(x675); x761 = (x759)+(x723); x762 = (x761)<(x723); x763 = (x760)+(x762); x764 = (x763)+(x679); x765 = (x764)<(x679); x766 = (x764)+(x728); x767 = (x766)<(x728); x768 = (x765)+(x767); x769 = (x768)+(x684); x770 = (x769)<(x684); x771 = (x769)+(x733); x772 = (x771)<(x733); x773 = (x770)+(x772); x774 = (x773)+(x689); x775 = (x774)<(x689); x776 = (x774)+(x738); x777 = (x776)<(x738); x778 = (x775)+(x777); x779 = (x778)+(x692); x780 = (x779)<(x692); x781 = (x779)+(x741); x782 = (x781)<(x741); x783 = (x780)+(x782); x784 = (x742)*((uintptr_t)4294967295ULL); x785 = sizeof(intptr_t) == 4 ? ((uint64_t)(x742)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x742)*((uintptr_t)4294967295ULL))>>64; x786 = (x742)*((uintptr_t)4294967295ULL); x787 = sizeof(intptr_t) == 4 ? ((uint64_t)(x742)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x742)*((uintptr_t)4294967295ULL))>>64; x788 = (x742)*((uintptr_t)4294967295ULL); x789 = sizeof(intptr_t) == 4 ? ((uint64_t)(x742)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x742)*((uintptr_t)4294967295ULL))>>64; x790 = (x742)*((uintptr_t)4294967295ULL); x791 = sizeof(intptr_t) == 4 ? ((uint64_t)(x742)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x742)*((uintptr_t)4294967295ULL))>>64; x792 = (x791)+(x788); x793 = (x792)<(x791); x794 = (x793)+(x789); x795 = (x794)<(x789); x796 = (x794)+(x786); x797 = (x796)<(x786); x798 = (x795)+(x797); x799 = (x798)+(x787); x800 = (x742)+(x790); x801 = (x800)<(x742); x802 = (x801)+(x746); x803 = (x802)<(x746); x804 = (x802)+(x792); x805 = (x804)<(x792); x806 = (x803)+(x805); x807 = (x806)+(x751); x808 = (x807)<(x751); x809 = (x807)+(x796); x810 = (x809)<(x796); x811 = (x808)+(x810); x812 = (x811)+(x756); x813 = (x812)<(x756); x814 = (x812)+(x799); x815 = (x814)<(x799); x816 = (x813)+(x815); x817 = (x816)+(x761); x818 = (x817)<(x761); x819 = (x818)+(x766); x820 = (x819)<(x766); x821 = (x820)+(x771); x822 = (x821)<(x771); x823 = (x821)+(x742); x824 = (x823)<(x742); x825 = (x822)+(x824); x826 = (x825)+(x776); x827 = (x826)<(x776); x828 = (x826)+(x784); x829 = (x828)<(x784); x830 = (x827)+(x829); x831 = (x830)+(x781); x832 = (x831)<(x781); x833 = (x831)+(x785); x834 = (x833)<(x785); x835 = (x832)+(x834); x836 = (x835)+(x783); x837 = (x13)*(x7); x838 = sizeof(intptr_t) == 4 ? ((uint64_t)(x13)*(x7))>>32 : ((__uint128_t)(x13)*(x7))>>64; x839 = (x13)*(x6); x840 = sizeof(intptr_t) == 4 ? ((uint64_t)(x13)*(x6))>>32 : ((__uint128_t)(x13)*(x6))>>64; x841 = (x13)*(x5); x842 = sizeof(intptr_t) == 4 ? ((uint64_t)(x13)*(x5))>>32 : ((__uint128_t)(x13)*(x5))>>64; x843 = (x13)*(x4); x844 = sizeof(intptr_t) == 4 ? ((uint64_t)(x13)*(x4))>>32 : ((__uint128_t)(x13)*(x4))>>64; x845 = (x13)*(x3); x846 = sizeof(intptr_t) == 4 ? ((uint64_t)(x13)*(x3))>>32 : ((__uint128_t)(x13)*(x3))>>64; x847 = (x13)*(x2); x848 = sizeof(intptr_t) == 4 ? ((uint64_t)(x13)*(x2))>>32 : ((__uint128_t)(x13)*(x2))>>64; x849 = (x13)*(x1); x850 = sizeof(intptr_t) == 4 ? ((uint64_t)(x13)*(x1))>>32 : ((__uint128_t)(x13)*(x1))>>64; x851 = (x13)*(x0); x852 = sizeof(intptr_t) == 4 ? ((uint64_t)(x13)*(x0))>>32 : ((__uint128_t)(x13)*(x0))>>64; x853 = (x852)+(x849); x854 = (x853)<(x852); x855 = (x854)+(x850); x856 = (x855)<(x850); x857 = (x855)+(x847); x858 = (x857)<(x847); x859 = (x856)+(x858); x860 = (x859)+(x848); x861 = (x860)<(x848); x862 = (x860)+(x845); x863 = (x862)<(x845); x864 = (x861)+(x863); x865 = (x864)+(x846); x866 = (x865)<(x846); x867 = (x865)+(x843); x868 = (x867)<(x843); x869 = (x866)+(x868); x870 = (x869)+(x844); x871 = (x870)<(x844); x872 = (x870)+(x841); x873 = (x872)<(x841); x874 = (x871)+(x873); x875 = (x874)+(x842); x876 = (x875)<(x842); x877 = (x875)+(x839); x878 = (x877)<(x839); x879 = (x876)+(x878); x880 = (x879)+(x840); x881 = (x880)<(x840); x882 = (x880)+(x837); x883 = (x882)<(x837); x884 = (x881)+(x883); x885 = (x884)+(x838); x886 = (x804)+(x851); x887 = (x886)<(x804); x888 = (x887)+(x809); x889 = (x888)<(x809); x890 = (x888)+(x853); x891 = (x890)<(x853); x892 = (x889)+(x891); x893 = (x892)+(x814); x894 = (x893)<(x814); x895 = (x893)+(x857); x896 = (x895)<(x857); x897 = (x894)+(x896); x898 = (x897)+(x817); x899 = (x898)<(x817); x900 = (x898)+(x862); x901 = (x900)<(x862); x902 = (x899)+(x901); x903 = (x902)+(x819); x904 = (x903)<(x819); x905 = (x903)+(x867); x906 = (x905)<(x867); x907 = (x904)+(x906); x908 = (x907)+(x823); x909 = (x908)<(x823); x910 = (x908)+(x872); x911 = (x910)<(x872); x912 = (x909)+(x911); x913 = (x912)+(x828); x914 = (x913)<(x828); x915 = (x913)+(x877); x916 = (x915)<(x877); x917 = (x914)+(x916); x918 = (x917)+(x833); x919 = (x918)<(x833); x920 = (x918)+(x882); x921 = (x920)<(x882); x922 = (x919)+(x921); x923 = (x922)+(x836); x924 = (x923)<(x836); x925 = (x923)+(x885); x926 = (x925)<(x885); x927 = (x924)+(x926); x928 = (x886)*((uintptr_t)4294967295ULL); x929 = sizeof(intptr_t) == 4 ? ((uint64_t)(x886)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x886)*((uintptr_t)4294967295ULL))>>64; x930 = (x886)*((uintptr_t)4294967295ULL); x931 = sizeof(intptr_t) == 4 ? ((uint64_t)(x886)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x886)*((uintptr_t)4294967295ULL))>>64; x932 = (x886)*((uintptr_t)4294967295ULL); x933 = sizeof(intptr_t) == 4 ? ((uint64_t)(x886)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x886)*((uintptr_t)4294967295ULL))>>64; x934 = (x886)*((uintptr_t)4294967295ULL); x935 = sizeof(intptr_t) == 4 ? ((uint64_t)(x886)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x886)*((uintptr_t)4294967295ULL))>>64; x936 = (x935)+(x932); x937 = (x936)<(x935); x938 = (x937)+(x933); x939 = (x938)<(x933); x940 = (x938)+(x930); x941 = (x940)<(x930); x942 = (x939)+(x941); x943 = (x942)+(x931); x944 = (x886)+(x934); x945 = (x944)<(x886); x946 = (x945)+(x890); x947 = (x946)<(x890); x948 = (x946)+(x936); x949 = (x948)<(x936); x950 = (x947)+(x949); x951 = (x950)+(x895); x952 = (x951)<(x895); x953 = (x951)+(x940); x954 = (x953)<(x940); x955 = (x952)+(x954); x956 = (x955)+(x900); x957 = (x956)<(x900); x958 = (x956)+(x943); x959 = (x958)<(x943); x960 = (x957)+(x959); x961 = (x960)+(x905); x962 = (x961)<(x905); x963 = (x962)+(x910); x964 = (x963)<(x910); x965 = (x964)+(x915); x966 = (x965)<(x915); x967 = (x965)+(x886); x968 = (x967)<(x886); x969 = (x966)+(x968); x970 = (x969)+(x920); x971 = (x970)<(x920); x972 = (x970)+(x928); x973 = (x972)<(x928); x974 = (x971)+(x973); x975 = (x974)+(x925); x976 = (x975)<(x925); x977 = (x975)+(x929); x978 = (x977)<(x929); x979 = (x976)+(x978); x980 = (x979)+(x927); x981 = (x14)*(x7); x982 = sizeof(intptr_t) == 4 ? ((uint64_t)(x14)*(x7))>>32 : ((__uint128_t)(x14)*(x7))>>64; x983 = (x14)*(x6); x984 = sizeof(intptr_t) == 4 ? ((uint64_t)(x14)*(x6))>>32 : ((__uint128_t)(x14)*(x6))>>64; x985 = (x14)*(x5); x986 = sizeof(intptr_t) == 4 ? ((uint64_t)(x14)*(x5))>>32 : ((__uint128_t)(x14)*(x5))>>64; x987 = (x14)*(x4); x988 = sizeof(intptr_t) == 4 ? ((uint64_t)(x14)*(x4))>>32 : ((__uint128_t)(x14)*(x4))>>64; x989 = (x14)*(x3); x990 = sizeof(intptr_t) == 4 ? ((uint64_t)(x14)*(x3))>>32 : ((__uint128_t)(x14)*(x3))>>64; x991 = (x14)*(x2); x992 = sizeof(intptr_t) == 4 ? ((uint64_t)(x14)*(x2))>>32 : ((__uint128_t)(x14)*(x2))>>64; x993 = (x14)*(x1); x994 = sizeof(intptr_t) == 4 ? ((uint64_t)(x14)*(x1))>>32 : ((__uint128_t)(x14)*(x1))>>64; x995 = (x14)*(x0); x996 = sizeof(intptr_t) == 4 ? ((uint64_t)(x14)*(x0))>>32 : ((__uint128_t)(x14)*(x0))>>64; x997 = (x996)+(x993); x998 = (x997)<(x996); x999 = (x998)+(x994); x1000 = (x999)<(x994); x1001 = (x999)+(x991); x1002 = (x1001)<(x991); x1003 = (x1000)+(x1002); x1004 = (x1003)+(x992); x1005 = (x1004)<(x992); x1006 = (x1004)+(x989); x1007 = (x1006)<(x989); x1008 = (x1005)+(x1007); x1009 = (x1008)+(x990); x1010 = (x1009)<(x990); x1011 = (x1009)+(x987); x1012 = (x1011)<(x987); x1013 = (x1010)+(x1012); x1014 = (x1013)+(x988); x1015 = (x1014)<(x988); x1016 = (x1014)+(x985); x1017 = (x1016)<(x985); x1018 = (x1015)+(x1017); x1019 = (x1018)+(x986); x1020 = (x1019)<(x986); x1021 = (x1019)+(x983); x1022 = (x1021)<(x983); x1023 = (x1020)+(x1022); x1024 = (x1023)+(x984); x1025 = (x1024)<(x984); x1026 = (x1024)+(x981); x1027 = (x1026)<(x981); x1028 = (x1025)+(x1027); x1029 = (x1028)+(x982); x1030 = (x948)+(x995); x1031 = (x1030)<(x948); x1032 = (x1031)+(x953); x1033 = (x1032)<(x953); x1034 = (x1032)+(x997); x1035 = (x1034)<(x997); x1036 = (x1033)+(x1035); x1037 = (x1036)+(x958); x1038 = (x1037)<(x958); x1039 = (x1037)+(x1001); x1040 = (x1039)<(x1001); x1041 = (x1038)+(x1040); x1042 = (x1041)+(x961); x1043 = (x1042)<(x961); x1044 = (x1042)+(x1006); x1045 = (x1044)<(x1006); x1046 = (x1043)+(x1045); x1047 = (x1046)+(x963); x1048 = (x1047)<(x963); x1049 = (x1047)+(x1011); x1050 = (x1049)<(x1011); x1051 = (x1048)+(x1050); x1052 = (x1051)+(x967); x1053 = (x1052)<(x967); x1054 = (x1052)+(x1016); x1055 = (x1054)<(x1016); x1056 = (x1053)+(x1055); x1057 = (x1056)+(x972); x1058 = (x1057)<(x972); x1059 = (x1057)+(x1021); x1060 = (x1059)<(x1021); x1061 = (x1058)+(x1060); x1062 = (x1061)+(x977); x1063 = (x1062)<(x977); x1064 = (x1062)+(x1026); x1065 = (x1064)<(x1026); x1066 = (x1063)+(x1065); x1067 = (x1066)+(x980); x1068 = (x1067)<(x980); x1069 = (x1067)+(x1029); x1070 = (x1069)<(x1029); x1071 = (x1068)+(x1070); x1072 = (x1030)*((uintptr_t)4294967295ULL); x1073 = sizeof(intptr_t) == 4 ? ((uint64_t)(x1030)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x1030)*((uintptr_t)4294967295ULL))>>64; x1074 = (x1030)*((uintptr_t)4294967295ULL); x1075 = sizeof(intptr_t) == 4 ? ((uint64_t)(x1030)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x1030)*((uintptr_t)4294967295ULL))>>64; x1076 = (x1030)*((uintptr_t)4294967295ULL); x1077 = sizeof(intptr_t) == 4 ? ((uint64_t)(x1030)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x1030)*((uintptr_t)4294967295ULL))>>64; x1078 = (x1030)*((uintptr_t)4294967295ULL); x1079 = sizeof(intptr_t) == 4 ? ((uint64_t)(x1030)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x1030)*((uintptr_t)4294967295ULL))>>64; x1080 = (x1079)+(x1076); x1081 = (x1080)<(x1079); x1082 = (x1081)+(x1077); x1083 = (x1082)<(x1077); x1084 = (x1082)+(x1074); x1085 = (x1084)<(x1074); x1086 = (x1083)+(x1085); x1087 = (x1086)+(x1075); x1088 = (x1030)+(x1078); x1089 = (x1088)<(x1030); x1090 = (x1089)+(x1034); x1091 = (x1090)<(x1034); x1092 = (x1090)+(x1080); x1093 = (x1092)<(x1080); x1094 = (x1091)+(x1093); x1095 = (x1094)+(x1039); x1096 = (x1095)<(x1039); x1097 = (x1095)+(x1084); x1098 = (x1097)<(x1084); x1099 = (x1096)+(x1098); x1100 = (x1099)+(x1044); x1101 = (x1100)<(x1044); x1102 = (x1100)+(x1087); x1103 = (x1102)<(x1087); x1104 = (x1101)+(x1103); x1105 = (x1104)+(x1049); x1106 = (x1105)<(x1049); x1107 = (x1106)+(x1054); x1108 = (x1107)<(x1054); x1109 = (x1108)+(x1059); x1110 = (x1109)<(x1059); x1111 = (x1109)+(x1030); x1112 = (x1111)<(x1030); x1113 = (x1110)+(x1112); x1114 = (x1113)+(x1064); x1115 = (x1114)<(x1064); x1116 = (x1114)+(x1072); x1117 = (x1116)<(x1072); x1118 = (x1115)+(x1117); x1119 = (x1118)+(x1069); x1120 = (x1119)<(x1069); x1121 = (x1119)+(x1073); x1122 = (x1121)<(x1073); x1123 = (x1120)+(x1122); x1124 = (x1123)+(x1071); x1125 = (x1092)-((uintptr_t)4294967295ULL); x1126 = (x1092)<(x1125); x1127 = (x1097)-((uintptr_t)4294967295ULL); x1128 = (x1097)<(x1127); x1129 = (x1127)-(x1126); x1130 = (x1127)<(x1129); x1131 = (x1128)+(x1130); x1132 = (x1102)-((uintptr_t)4294967295ULL); x1133 = (x1102)<(x1132); x1134 = (x1132)-(x1131); x1135 = (x1132)<(x1134); x1136 = (x1133)+(x1135); x1137 = (x1105)-(x1136); x1138 = (x1105)<(x1137); x1139 = (x1107)-(x1138); x1140 = (x1107)<(x1139); x1141 = (x1111)-(x1140); x1142 = (x1111)<(x1141); x1143 = (x1116)-((uintptr_t)1ULL); x1144 = (x1116)<(x1143); x1145 = (x1143)-(x1142); x1146 = (x1143)<(x1145); x1147 = (x1144)+(x1146); x1148 = (x1121)-((uintptr_t)4294967295ULL); x1149 = (x1121)<(x1148); x1150 = (x1148)-(x1147); x1151 = (x1148)<(x1150); x1152 = (x1149)+(x1151); x1153 = (x1124)-(x1152); x1154 = (x1124)<(x1153); x1155 = ((uintptr_t)-1ULL)+((x1154)==((uintptr_t)0ULL)); x1156 = (x1155)^((uintptr_t)4294967295ULL); x1157 = ((x1092)&(x1155))|((x1125)&(x1156)); x1158 = ((uintptr_t)-1ULL)+((x1154)==((uintptr_t)0ULL)); x1159 = (x1158)^((uintptr_t)4294967295ULL); x1160 = ((x1097)&(x1158))|((x1129)&(x1159)); x1161 = ((uintptr_t)-1ULL)+((x1154)==((uintptr_t)0ULL)); x1162 = (x1161)^((uintptr_t)4294967295ULL); x1163 = ((x1102)&(x1161))|((x1134)&(x1162)); x1164 = ((uintptr_t)-1ULL)+((x1154)==((uintptr_t)0ULL)); x1165 = (x1164)^((uintptr_t)4294967295ULL); x1166 = ((x1105)&(x1164))|((x1137)&(x1165)); x1167 = ((uintptr_t)-1ULL)+((x1154)==((uintptr_t)0ULL)); x1168 = (x1167)^((uintptr_t)4294967295ULL); x1169 = ((x1107)&(x1167))|((x1139)&(x1168)); x1170 = ((uintptr_t)-1ULL)+((x1154)==((uintptr_t)0ULL)); x1171 = (x1170)^((uintptr_t)4294967295ULL); x1172 = ((x1111)&(x1170))|((x1141)&(x1171)); x1173 = ((uintptr_t)-1ULL)+((x1154)==((uintptr_t)0ULL)); x1174 = (x1173)^((uintptr_t)4294967295ULL); x1175 = ((x1116)&(x1173))|((x1145)&(x1174)); x1176 = ((uintptr_t)-1ULL)+((x1154)==((uintptr_t)0ULL)); x1177 = (x1176)^((uintptr_t)4294967295ULL); x1178 = ((x1121)&(x1176))|((x1150)&(x1177)); x1179 = x1157; x1180 = x1160; x1181 = x1163; x1182 = x1166; x1183 = x1169; x1184 = x1172; x1185 = x1175; x1186 = x1178; /*skip*/ _br2_store((out0)+((uintptr_t)0ULL), x1179, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)4ULL), x1180, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)8ULL), x1181, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)12ULL), x1182, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)16ULL), x1183, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)20ULL), x1184, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)24ULL), x1185, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)28ULL), x1186, sizeof(uintptr_t)); /*skip*/ return; } /* NOTE: The following wrapper function is not covered by Coq proofs */ static void fiat_p256_square(uint32_t out1[8], const uint32_t arg1[8]) { internal_fiat_p256_square((uintptr_t)out1, (uintptr_t)arg1); } /* * Input Bounds: * in0: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * in1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * Output Bounds: * out0: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] */ static void internal_fiat_p256_add(uintptr_t out0, uintptr_t in0, uintptr_t in1) { uintptr_t x8, x0, x17, x1, x9, x19, x2, x10, x21, x3, x11, x23, x4, x12, x25, x5, x13, x27, x6, x14, x29, x7, x15, x33, x35, x40, x31, x42, x16, x45, x32, x46, x18, x48, x34, x49, x20, x51, x36, x52, x22, x54, x37, x55, x24, x57, x38, x58, x26, x60, x39, x61, x28, x63, x41, x64, x44, x30, x66, x43, x67, x47, x50, x53, x56, x59, x62, x65, x68, x69, x70, x71, x72, x73, x74, x75, x76; x0 = _br2_load((in0)+((uintptr_t)0ULL), sizeof(uintptr_t)); x1 = _br2_load((in0)+((uintptr_t)4ULL), sizeof(uintptr_t)); x2 = _br2_load((in0)+((uintptr_t)8ULL), sizeof(uintptr_t)); x3 = _br2_load((in0)+((uintptr_t)12ULL), sizeof(uintptr_t)); x4 = _br2_load((in0)+((uintptr_t)16ULL), sizeof(uintptr_t)); x5 = _br2_load((in0)+((uintptr_t)20ULL), sizeof(uintptr_t)); x6 = _br2_load((in0)+((uintptr_t)24ULL), sizeof(uintptr_t)); x7 = _br2_load((in0)+((uintptr_t)28ULL), sizeof(uintptr_t)); /*skip*/ x8 = _br2_load((in1)+((uintptr_t)0ULL), sizeof(uintptr_t)); x9 = _br2_load((in1)+((uintptr_t)4ULL), sizeof(uintptr_t)); x10 = _br2_load((in1)+((uintptr_t)8ULL), sizeof(uintptr_t)); x11 = _br2_load((in1)+((uintptr_t)12ULL), sizeof(uintptr_t)); x12 = _br2_load((in1)+((uintptr_t)16ULL), sizeof(uintptr_t)); x13 = _br2_load((in1)+((uintptr_t)20ULL), sizeof(uintptr_t)); x14 = _br2_load((in1)+((uintptr_t)24ULL), sizeof(uintptr_t)); x15 = _br2_load((in1)+((uintptr_t)28ULL), sizeof(uintptr_t)); /*skip*/ /*skip*/ x16 = (x0)+(x8); x17 = ((x16)<(x0))+(x1); x18 = (x17)+(x9); x19 = (((x17)<(x1))+((x18)<(x9)))+(x2); x20 = (x19)+(x10); x21 = (((x19)<(x2))+((x20)<(x10)))+(x3); x22 = (x21)+(x11); x23 = (((x21)<(x3))+((x22)<(x11)))+(x4); x24 = (x23)+(x12); x25 = (((x23)<(x4))+((x24)<(x12)))+(x5); x26 = (x25)+(x13); x27 = (((x25)<(x5))+((x26)<(x13)))+(x6); x28 = (x27)+(x14); x29 = (((x27)<(x6))+((x28)<(x14)))+(x7); x30 = (x29)+(x15); x31 = ((x29)<(x7))+((x30)<(x15)); x32 = (x16)-((uintptr_t)4294967295ULL); x33 = (x18)-((uintptr_t)4294967295ULL); x34 = (x33)-((x16)<(x32)); x35 = (x20)-((uintptr_t)4294967295ULL); x36 = (x35)-(((x18)<(x33))+((x33)<(x34))); x37 = (x22)-(((x20)<(x35))+((x35)<(x36))); x38 = (x24)-((x22)<(x37)); x39 = (x26)-((x24)<(x38)); x40 = (x28)-((uintptr_t)1ULL); x41 = (x40)-((x26)<(x39)); x42 = (x30)-((uintptr_t)4294967295ULL); x43 = (x42)-(((x28)<(x40))+((x40)<(x41))); x44 = (x31)<((x31)-(((x30)<(x42))+((x42)<(x43)))); x45 = ((uintptr_t)-1ULL)+((x44)==((uintptr_t)0ULL)); x46 = (x45)^((uintptr_t)4294967295ULL); x47 = ((x16)&(x45))|((x32)&(x46)); x48 = ((uintptr_t)-1ULL)+((x44)==((uintptr_t)0ULL)); x49 = (x48)^((uintptr_t)4294967295ULL); x50 = ((x18)&(x48))|((x34)&(x49)); x51 = ((uintptr_t)-1ULL)+((x44)==((uintptr_t)0ULL)); x52 = (x51)^((uintptr_t)4294967295ULL); x53 = ((x20)&(x51))|((x36)&(x52)); x54 = ((uintptr_t)-1ULL)+((x44)==((uintptr_t)0ULL)); x55 = (x54)^((uintptr_t)4294967295ULL); x56 = ((x22)&(x54))|((x37)&(x55)); x57 = ((uintptr_t)-1ULL)+((x44)==((uintptr_t)0ULL)); x58 = (x57)^((uintptr_t)4294967295ULL); x59 = ((x24)&(x57))|((x38)&(x58)); x60 = ((uintptr_t)-1ULL)+((x44)==((uintptr_t)0ULL)); x61 = (x60)^((uintptr_t)4294967295ULL); x62 = ((x26)&(x60))|((x39)&(x61)); x63 = ((uintptr_t)-1ULL)+((x44)==((uintptr_t)0ULL)); x64 = (x63)^((uintptr_t)4294967295ULL); x65 = ((x28)&(x63))|((x41)&(x64)); x66 = ((uintptr_t)-1ULL)+((x44)==((uintptr_t)0ULL)); x67 = (x66)^((uintptr_t)4294967295ULL); x68 = ((x30)&(x66))|((x43)&(x67)); x69 = x47; x70 = x50; x71 = x53; x72 = x56; x73 = x59; x74 = x62; x75 = x65; x76 = x68; /*skip*/ _br2_store((out0)+((uintptr_t)0ULL), x69, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)4ULL), x70, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)8ULL), x71, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)12ULL), x72, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)16ULL), x73, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)20ULL), x74, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)24ULL), x75, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)28ULL), x76, sizeof(uintptr_t)); /*skip*/ return; } /* NOTE: The following wrapper function is not covered by Coq proofs */ static void fiat_p256_add(uint32_t out1[8], const uint32_t arg1[8], const uint32_t arg2[8]) { internal_fiat_p256_add((uintptr_t)out1, (uintptr_t)arg1, (uintptr_t)arg2); } /* * Input Bounds: * in0: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * in1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * Output Bounds: * out0: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] */ static void internal_fiat_p256_sub(uintptr_t out0, uintptr_t in0, uintptr_t in1) { uintptr_t x8, x9, x0, x10, x1, x17, x11, x2, x19, x12, x3, x21, x13, x4, x23, x14, x5, x25, x15, x6, x27, x7, x29, x16, x33, x18, x35, x20, x22, x24, x26, x40, x28, x30, x31, x32, x34, x36, x37, x38, x39, x41, x42, x43, x44, x45, x46, x47, x48, x49, x50; x0 = _br2_load((in0)+((uintptr_t)0ULL), sizeof(uintptr_t)); x1 = _br2_load((in0)+((uintptr_t)4ULL), sizeof(uintptr_t)); x2 = _br2_load((in0)+((uintptr_t)8ULL), sizeof(uintptr_t)); x3 = _br2_load((in0)+((uintptr_t)12ULL), sizeof(uintptr_t)); x4 = _br2_load((in0)+((uintptr_t)16ULL), sizeof(uintptr_t)); x5 = _br2_load((in0)+((uintptr_t)20ULL), sizeof(uintptr_t)); x6 = _br2_load((in0)+((uintptr_t)24ULL), sizeof(uintptr_t)); x7 = _br2_load((in0)+((uintptr_t)28ULL), sizeof(uintptr_t)); /*skip*/ x8 = _br2_load((in1)+((uintptr_t)0ULL), sizeof(uintptr_t)); x9 = _br2_load((in1)+((uintptr_t)4ULL), sizeof(uintptr_t)); x10 = _br2_load((in1)+((uintptr_t)8ULL), sizeof(uintptr_t)); x11 = _br2_load((in1)+((uintptr_t)12ULL), sizeof(uintptr_t)); x12 = _br2_load((in1)+((uintptr_t)16ULL), sizeof(uintptr_t)); x13 = _br2_load((in1)+((uintptr_t)20ULL), sizeof(uintptr_t)); x14 = _br2_load((in1)+((uintptr_t)24ULL), sizeof(uintptr_t)); x15 = _br2_load((in1)+((uintptr_t)28ULL), sizeof(uintptr_t)); /*skip*/ /*skip*/ x16 = (x0)-(x8); x17 = (x1)-(x9); x18 = (x17)-((x0)<(x16)); x19 = (x2)-(x10); x20 = (x19)-(((x1)<(x17))+((x17)<(x18))); x21 = (x3)-(x11); x22 = (x21)-(((x2)<(x19))+((x19)<(x20))); x23 = (x4)-(x12); x24 = (x23)-(((x3)<(x21))+((x21)<(x22))); x25 = (x5)-(x13); x26 = (x25)-(((x4)<(x23))+((x23)<(x24))); x27 = (x6)-(x14); x28 = (x27)-(((x5)<(x25))+((x25)<(x26))); x29 = (x7)-(x15); x30 = (x29)-(((x6)<(x27))+((x27)<(x28))); x31 = ((uintptr_t)-1ULL)+((((x7)<(x29))+((x29)<(x30)))==((uintptr_t)0ULL)); x32 = (x16)+(x31); x33 = ((x32)<(x16))+(x18); x34 = (x33)+(x31); x35 = (((x33)<(x18))+((x34)<(x31)))+(x20); x36 = (x35)+(x31); x37 = (((x35)<(x20))+((x36)<(x31)))+(x22); x38 = ((x37)<(x22))+(x24); x39 = ((x38)<(x24))+(x26); x40 = ((x39)<(x26))+(x28); x41 = (x40)+((x31)&((uintptr_t)1ULL)); x42 = ((((x40)<(x28))+((x41)<((x31)&((uintptr_t)1ULL))))+(x30))+(x31); x43 = x32; x44 = x34; x45 = x36; x46 = x37; x47 = x38; x48 = x39; x49 = x41; x50 = x42; /*skip*/ _br2_store((out0)+((uintptr_t)0ULL), x43, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)4ULL), x44, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)8ULL), x45, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)12ULL), x46, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)16ULL), x47, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)20ULL), x48, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)24ULL), x49, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)28ULL), x50, sizeof(uintptr_t)); /*skip*/ return; } /* NOTE: The following wrapper function is not covered by Coq proofs */ static void fiat_p256_sub(uint32_t out1[8], const uint32_t arg1[8], const uint32_t arg2[8]) { internal_fiat_p256_sub((uintptr_t)out1, (uintptr_t)arg1, (uintptr_t)arg2); } /* * Input Bounds: * in0: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * Output Bounds: * out0: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] */ static void internal_fiat_p256_opp(uintptr_t out0, uintptr_t in0) { uintptr_t x0, x1, x2, x9, x3, x11, x4, x13, x5, x15, x6, x17, x7, x19, x21, x8, x25, x10, x27, x12, x14, x16, x18, x32, x20, x22, x23, x24, x26, x28, x29, x30, x31, x33, x34, x35, x36, x37, x38, x39, x40, x41, x42; x0 = _br2_load((in0)+((uintptr_t)0ULL), sizeof(uintptr_t)); x1 = _br2_load((in0)+((uintptr_t)4ULL), sizeof(uintptr_t)); x2 = _br2_load((in0)+((uintptr_t)8ULL), sizeof(uintptr_t)); x3 = _br2_load((in0)+((uintptr_t)12ULL), sizeof(uintptr_t)); x4 = _br2_load((in0)+((uintptr_t)16ULL), sizeof(uintptr_t)); x5 = _br2_load((in0)+((uintptr_t)20ULL), sizeof(uintptr_t)); x6 = _br2_load((in0)+((uintptr_t)24ULL), sizeof(uintptr_t)); x7 = _br2_load((in0)+((uintptr_t)28ULL), sizeof(uintptr_t)); /*skip*/ /*skip*/ x8 = ((uintptr_t)0ULL)-(x0); x9 = ((uintptr_t)0ULL)-(x1); x10 = (x9)-(((uintptr_t)0ULL)<(x8)); x11 = ((uintptr_t)0ULL)-(x2); x12 = (x11)-((((uintptr_t)0ULL)<(x9))+((x9)<(x10))); x13 = ((uintptr_t)0ULL)-(x3); x14 = (x13)-((((uintptr_t)0ULL)<(x11))+((x11)<(x12))); x15 = ((uintptr_t)0ULL)-(x4); x16 = (x15)-((((uintptr_t)0ULL)<(x13))+((x13)<(x14))); x17 = ((uintptr_t)0ULL)-(x5); x18 = (x17)-((((uintptr_t)0ULL)<(x15))+((x15)<(x16))); x19 = ((uintptr_t)0ULL)-(x6); x20 = (x19)-((((uintptr_t)0ULL)<(x17))+((x17)<(x18))); x21 = ((uintptr_t)0ULL)-(x7); x22 = (x21)-((((uintptr_t)0ULL)<(x19))+((x19)<(x20))); x23 = ((uintptr_t)-1ULL)+(((((uintptr_t)0ULL)<(x21))+((x21)<(x22)))==((uintptr_t)0ULL)); x24 = (x8)+(x23); x25 = ((x24)<(x8))+(x10); x26 = (x25)+(x23); x27 = (((x25)<(x10))+((x26)<(x23)))+(x12); x28 = (x27)+(x23); x29 = (((x27)<(x12))+((x28)<(x23)))+(x14); x30 = ((x29)<(x14))+(x16); x31 = ((x30)<(x16))+(x18); x32 = ((x31)<(x18))+(x20); x33 = (x32)+((x23)&((uintptr_t)1ULL)); x34 = ((((x32)<(x20))+((x33)<((x23)&((uintptr_t)1ULL))))+(x22))+(x23); x35 = x24; x36 = x26; x37 = x28; x38 = x29; x39 = x30; x40 = x31; x41 = x33; x42 = x34; /*skip*/ _br2_store((out0)+((uintptr_t)0ULL), x35, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)4ULL), x36, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)8ULL), x37, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)12ULL), x38, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)16ULL), x39, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)20ULL), x40, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)24ULL), x41, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)28ULL), x42, sizeof(uintptr_t)); /*skip*/ return; } /* NOTE: The following wrapper function is not covered by Coq proofs */ static void fiat_p256_opp(uint32_t out1[8], const uint32_t arg1[8]) { internal_fiat_p256_opp((uintptr_t)out1, (uintptr_t)arg1); } /* * Input Bounds: * in0: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * Output Bounds: * out0: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] */ static void internal_fiat_p256_from_montgomery(uintptr_t out0, uintptr_t in0) { uintptr_t x0, x14, x16, x13, x11, x15, x17, x18, x12, x1, x19, x20, x21, x32, x34, x31, x29, x37, x24, x33, x39, x25, x35, x41, x26, x22, x36, x30, x23, x9, x45, x10, x27, x2, x38, x40, x42, x57, x59, x56, x54, x62, x49, x58, x64, x50, x60, x66, x51, x43, x61, x55, x8, x44, x70, x46, x48, x72, x47, x28, x52, x3, x63, x65, x67, x68, x69, x71, x73, x74, x53, x89, x91, x88, x86, x94, x76, x90, x96, x77, x92, x98, x78, x93, x87, x79, x80, x102, x81, x75, x104, x82, x84, x106, x83, x85, x4, x95, x97, x99, x100, x101, x103, x105, x107, x123, x125, x122, x120, x128, x110, x124, x130, x111, x126, x132, x112, x127, x121, x113, x114, x136, x115, x109, x138, x116, x118, x140, x117, x108, x119, x5, x129, x131, x133, x134, x135, x137, x139, x141, x157, x159, x156, x154, x162, x144, x158, x164, x145, x160, x166, x146, x161, x155, x147, x148, x170, x149, x143, x172, x150, x152, x174, x151, x142, x153, x6, x163, x165, x167, x168, x169, x171, x173, x175, x191, x193, x190, x188, x196, x178, x192, x198, x179, x194, x200, x180, x195, x189, x181, x182, x204, x183, x177, x206, x184, x186, x208, x185, x176, x187, x7, x197, x199, x201, x202, x203, x205, x207, x209, x225, x227, x224, x222, x230, x212, x226, x232, x213, x228, x234, x214, x229, x223, x215, x216, x238, x217, x211, x240, x218, x220, x242, x219, x210, x221, x246, x248, x253, x244, x255, x231, x258, x245, x259, x233, x261, x247, x262, x235, x264, x249, x265, x236, x267, x250, x268, x237, x270, x251, x271, x239, x273, x252, x274, x241, x276, x254, x277, x257, x243, x279, x256, x280, x260, x263, x266, x269, x272, x275, x278, x281, x282, x283, x284, x285, x286, x287, x288, x289; x0 = _br2_load((in0)+((uintptr_t)0ULL), sizeof(uintptr_t)); x1 = _br2_load((in0)+((uintptr_t)4ULL), sizeof(uintptr_t)); x2 = _br2_load((in0)+((uintptr_t)8ULL), sizeof(uintptr_t)); x3 = _br2_load((in0)+((uintptr_t)12ULL), sizeof(uintptr_t)); x4 = _br2_load((in0)+((uintptr_t)16ULL), sizeof(uintptr_t)); x5 = _br2_load((in0)+((uintptr_t)20ULL), sizeof(uintptr_t)); x6 = _br2_load((in0)+((uintptr_t)24ULL), sizeof(uintptr_t)); x7 = _br2_load((in0)+((uintptr_t)28ULL), sizeof(uintptr_t)); /*skip*/ /*skip*/ x8 = x0; x9 = (x8)*((uintptr_t)4294967295ULL); x10 = sizeof(intptr_t) == 4 ? ((uint64_t)(x8)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x8)*((uintptr_t)4294967295ULL))>>64; x11 = (x8)*((uintptr_t)4294967295ULL); x12 = sizeof(intptr_t) == 4 ? ((uint64_t)(x8)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x8)*((uintptr_t)4294967295ULL))>>64; x13 = sizeof(intptr_t) == 4 ? ((uint64_t)(x8)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x8)*((uintptr_t)4294967295ULL))>>64; x14 = sizeof(intptr_t) == 4 ? ((uint64_t)(x8)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x8)*((uintptr_t)4294967295ULL))>>64; x15 = (x14)+((x8)*((uintptr_t)4294967295ULL)); x16 = ((x15)<(x14))+(x13); x17 = (x16)+(x11); x18 = ((x16)<(x13))+((x17)<(x11)); x19 = (((x8)+((x8)*((uintptr_t)4294967295ULL)))<(x8))+(x15); x20 = ((x19)<(x15))+(x17); x21 = ((x20)<(x17))+((x18)+(x12)); x22 = (x21)<((x18)+(x12)); x23 = (x19)+(x1); x24 = ((x23)<(x19))+(x20); x25 = ((x24)<(x20))+(x21); x26 = (x25)<(x21); x27 = (x23)*((uintptr_t)4294967295ULL); x28 = sizeof(intptr_t) == 4 ? ((uint64_t)(x23)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x23)*((uintptr_t)4294967295ULL))>>64; x29 = (x23)*((uintptr_t)4294967295ULL); x30 = sizeof(intptr_t) == 4 ? ((uint64_t)(x23)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x23)*((uintptr_t)4294967295ULL))>>64; x31 = sizeof(intptr_t) == 4 ? ((uint64_t)(x23)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x23)*((uintptr_t)4294967295ULL))>>64; x32 = sizeof(intptr_t) == 4 ? ((uint64_t)(x23)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x23)*((uintptr_t)4294967295ULL))>>64; x33 = (x32)+((x23)*((uintptr_t)4294967295ULL)); x34 = ((x33)<(x32))+(x31); x35 = (x34)+(x29); x36 = ((x34)<(x31))+((x35)<(x29)); x37 = (((x23)+((x23)*((uintptr_t)4294967295ULL)))<(x23))+(x24); x38 = (x37)+(x33); x39 = (((x37)<(x24))+((x38)<(x33)))+(x25); x40 = (x39)+(x35); x41 = (((x39)<(x25))+((x40)<(x35)))+((x26)+(x22)); x42 = (x41)+((x36)+(x30)); x43 = ((x41)<((x26)+(x22)))+((x42)<((x36)+(x30))); x44 = (x9)+(x23); x45 = ((x44)<(x9))+(x10); x46 = (x45)+(x27); x47 = ((x45)<(x10))+((x46)<(x27)); x48 = (x38)+(x2); x49 = ((x48)<(x38))+(x40); x50 = ((x49)<(x40))+(x42); x51 = (x50)<(x42); x52 = (x48)*((uintptr_t)4294967295ULL); x53 = sizeof(intptr_t) == 4 ? ((uint64_t)(x48)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x48)*((uintptr_t)4294967295ULL))>>64; x54 = (x48)*((uintptr_t)4294967295ULL); x55 = sizeof(intptr_t) == 4 ? ((uint64_t)(x48)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x48)*((uintptr_t)4294967295ULL))>>64; x56 = sizeof(intptr_t) == 4 ? ((uint64_t)(x48)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x48)*((uintptr_t)4294967295ULL))>>64; x57 = sizeof(intptr_t) == 4 ? ((uint64_t)(x48)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x48)*((uintptr_t)4294967295ULL))>>64; x58 = (x57)+((x48)*((uintptr_t)4294967295ULL)); x59 = ((x58)<(x57))+(x56); x60 = (x59)+(x54); x61 = ((x59)<(x56))+((x60)<(x54)); x62 = (((x48)+((x48)*((uintptr_t)4294967295ULL)))<(x48))+(x49); x63 = (x62)+(x58); x64 = (((x62)<(x49))+((x63)<(x58)))+(x50); x65 = (x64)+(x60); x66 = (((x64)<(x50))+((x65)<(x60)))+((x51)+(x43)); x67 = (x66)+((x61)+(x55)); x68 = (((x66)<((x51)+(x43)))+((x67)<((x61)+(x55))))+(x8); x69 = ((x68)<(x8))+(x44); x70 = ((x69)<(x44))+(x46); x71 = (x70)+(x48); x72 = (((x70)<(x46))+((x71)<(x48)))+((x47)+(x28)); x73 = (x72)+(x52); x74 = ((x72)<((x47)+(x28)))+((x73)<(x52)); x75 = (x63)+(x3); x76 = ((x75)<(x63))+(x65); x77 = ((x76)<(x65))+(x67); x78 = ((x77)<(x67))+(x68); x79 = ((x78)<(x68))+(x69); x80 = ((x79)<(x69))+(x71); x81 = ((x80)<(x71))+(x73); x82 = ((x81)<(x73))+((x74)+(x53)); x83 = (x82)<((x74)+(x53)); x84 = (x75)*((uintptr_t)4294967295ULL); x85 = sizeof(intptr_t) == 4 ? ((uint64_t)(x75)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x75)*((uintptr_t)4294967295ULL))>>64; x86 = (x75)*((uintptr_t)4294967295ULL); x87 = sizeof(intptr_t) == 4 ? ((uint64_t)(x75)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x75)*((uintptr_t)4294967295ULL))>>64; x88 = sizeof(intptr_t) == 4 ? ((uint64_t)(x75)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x75)*((uintptr_t)4294967295ULL))>>64; x89 = sizeof(intptr_t) == 4 ? ((uint64_t)(x75)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x75)*((uintptr_t)4294967295ULL))>>64; x90 = (x89)+((x75)*((uintptr_t)4294967295ULL)); x91 = ((x90)<(x89))+(x88); x92 = (x91)+(x86); x93 = ((x91)<(x88))+((x92)<(x86)); x94 = (((x75)+((x75)*((uintptr_t)4294967295ULL)))<(x75))+(x76); x95 = (x94)+(x90); x96 = (((x94)<(x76))+((x95)<(x90)))+(x77); x97 = (x96)+(x92); x98 = (((x96)<(x77))+((x97)<(x92)))+(x78); x99 = (x98)+((x93)+(x87)); x100 = (((x98)<(x78))+((x99)<((x93)+(x87))))+(x79); x101 = ((x100)<(x79))+(x80); x102 = ((x101)<(x80))+(x81); x103 = (x102)+(x75); x104 = (((x102)<(x81))+((x103)<(x75)))+(x82); x105 = (x104)+(x84); x106 = (((x104)<(x82))+((x105)<(x84)))+(x83); x107 = (x106)+(x85); x108 = ((x106)<(x83))+((x107)<(x85)); x109 = (x95)+(x4); x110 = ((x109)<(x95))+(x97); x111 = ((x110)<(x97))+(x99); x112 = ((x111)<(x99))+(x100); x113 = ((x112)<(x100))+(x101); x114 = ((x113)<(x101))+(x103); x115 = ((x114)<(x103))+(x105); x116 = ((x115)<(x105))+(x107); x117 = (x116)<(x107); x118 = (x109)*((uintptr_t)4294967295ULL); x119 = sizeof(intptr_t) == 4 ? ((uint64_t)(x109)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x109)*((uintptr_t)4294967295ULL))>>64; x120 = (x109)*((uintptr_t)4294967295ULL); x121 = sizeof(intptr_t) == 4 ? ((uint64_t)(x109)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x109)*((uintptr_t)4294967295ULL))>>64; x122 = sizeof(intptr_t) == 4 ? ((uint64_t)(x109)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x109)*((uintptr_t)4294967295ULL))>>64; x123 = sizeof(intptr_t) == 4 ? ((uint64_t)(x109)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x109)*((uintptr_t)4294967295ULL))>>64; x124 = (x123)+((x109)*((uintptr_t)4294967295ULL)); x125 = ((x124)<(x123))+(x122); x126 = (x125)+(x120); x127 = ((x125)<(x122))+((x126)<(x120)); x128 = (((x109)+((x109)*((uintptr_t)4294967295ULL)))<(x109))+(x110); x129 = (x128)+(x124); x130 = (((x128)<(x110))+((x129)<(x124)))+(x111); x131 = (x130)+(x126); x132 = (((x130)<(x111))+((x131)<(x126)))+(x112); x133 = (x132)+((x127)+(x121)); x134 = (((x132)<(x112))+((x133)<((x127)+(x121))))+(x113); x135 = ((x134)<(x113))+(x114); x136 = ((x135)<(x114))+(x115); x137 = (x136)+(x109); x138 = (((x136)<(x115))+((x137)<(x109)))+(x116); x139 = (x138)+(x118); x140 = (((x138)<(x116))+((x139)<(x118)))+((x117)+(x108)); x141 = (x140)+(x119); x142 = ((x140)<((x117)+(x108)))+((x141)<(x119)); x143 = (x129)+(x5); x144 = ((x143)<(x129))+(x131); x145 = ((x144)<(x131))+(x133); x146 = ((x145)<(x133))+(x134); x147 = ((x146)<(x134))+(x135); x148 = ((x147)<(x135))+(x137); x149 = ((x148)<(x137))+(x139); x150 = ((x149)<(x139))+(x141); x151 = (x150)<(x141); x152 = (x143)*((uintptr_t)4294967295ULL); x153 = sizeof(intptr_t) == 4 ? ((uint64_t)(x143)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x143)*((uintptr_t)4294967295ULL))>>64; x154 = (x143)*((uintptr_t)4294967295ULL); x155 = sizeof(intptr_t) == 4 ? ((uint64_t)(x143)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x143)*((uintptr_t)4294967295ULL))>>64; x156 = sizeof(intptr_t) == 4 ? ((uint64_t)(x143)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x143)*((uintptr_t)4294967295ULL))>>64; x157 = sizeof(intptr_t) == 4 ? ((uint64_t)(x143)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x143)*((uintptr_t)4294967295ULL))>>64; x158 = (x157)+((x143)*((uintptr_t)4294967295ULL)); x159 = ((x158)<(x157))+(x156); x160 = (x159)+(x154); x161 = ((x159)<(x156))+((x160)<(x154)); x162 = (((x143)+((x143)*((uintptr_t)4294967295ULL)))<(x143))+(x144); x163 = (x162)+(x158); x164 = (((x162)<(x144))+((x163)<(x158)))+(x145); x165 = (x164)+(x160); x166 = (((x164)<(x145))+((x165)<(x160)))+(x146); x167 = (x166)+((x161)+(x155)); x168 = (((x166)<(x146))+((x167)<((x161)+(x155))))+(x147); x169 = ((x168)<(x147))+(x148); x170 = ((x169)<(x148))+(x149); x171 = (x170)+(x143); x172 = (((x170)<(x149))+((x171)<(x143)))+(x150); x173 = (x172)+(x152); x174 = (((x172)<(x150))+((x173)<(x152)))+((x151)+(x142)); x175 = (x174)+(x153); x176 = ((x174)<((x151)+(x142)))+((x175)<(x153)); x177 = (x163)+(x6); x178 = ((x177)<(x163))+(x165); x179 = ((x178)<(x165))+(x167); x180 = ((x179)<(x167))+(x168); x181 = ((x180)<(x168))+(x169); x182 = ((x181)<(x169))+(x171); x183 = ((x182)<(x171))+(x173); x184 = ((x183)<(x173))+(x175); x185 = (x184)<(x175); x186 = (x177)*((uintptr_t)4294967295ULL); x187 = sizeof(intptr_t) == 4 ? ((uint64_t)(x177)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x177)*((uintptr_t)4294967295ULL))>>64; x188 = (x177)*((uintptr_t)4294967295ULL); x189 = sizeof(intptr_t) == 4 ? ((uint64_t)(x177)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x177)*((uintptr_t)4294967295ULL))>>64; x190 = sizeof(intptr_t) == 4 ? ((uint64_t)(x177)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x177)*((uintptr_t)4294967295ULL))>>64; x191 = sizeof(intptr_t) == 4 ? ((uint64_t)(x177)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x177)*((uintptr_t)4294967295ULL))>>64; x192 = (x191)+((x177)*((uintptr_t)4294967295ULL)); x193 = ((x192)<(x191))+(x190); x194 = (x193)+(x188); x195 = ((x193)<(x190))+((x194)<(x188)); x196 = (((x177)+((x177)*((uintptr_t)4294967295ULL)))<(x177))+(x178); x197 = (x196)+(x192); x198 = (((x196)<(x178))+((x197)<(x192)))+(x179); x199 = (x198)+(x194); x200 = (((x198)<(x179))+((x199)<(x194)))+(x180); x201 = (x200)+((x195)+(x189)); x202 = (((x200)<(x180))+((x201)<((x195)+(x189))))+(x181); x203 = ((x202)<(x181))+(x182); x204 = ((x203)<(x182))+(x183); x205 = (x204)+(x177); x206 = (((x204)<(x183))+((x205)<(x177)))+(x184); x207 = (x206)+(x186); x208 = (((x206)<(x184))+((x207)<(x186)))+((x185)+(x176)); x209 = (x208)+(x187); x210 = ((x208)<((x185)+(x176)))+((x209)<(x187)); x211 = (x197)+(x7); x212 = ((x211)<(x197))+(x199); x213 = ((x212)<(x199))+(x201); x214 = ((x213)<(x201))+(x202); x215 = ((x214)<(x202))+(x203); x216 = ((x215)<(x203))+(x205); x217 = ((x216)<(x205))+(x207); x218 = ((x217)<(x207))+(x209); x219 = (x218)<(x209); x220 = (x211)*((uintptr_t)4294967295ULL); x221 = sizeof(intptr_t) == 4 ? ((uint64_t)(x211)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x211)*((uintptr_t)4294967295ULL))>>64; x222 = (x211)*((uintptr_t)4294967295ULL); x223 = sizeof(intptr_t) == 4 ? ((uint64_t)(x211)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x211)*((uintptr_t)4294967295ULL))>>64; x224 = sizeof(intptr_t) == 4 ? ((uint64_t)(x211)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x211)*((uintptr_t)4294967295ULL))>>64; x225 = sizeof(intptr_t) == 4 ? ((uint64_t)(x211)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x211)*((uintptr_t)4294967295ULL))>>64; x226 = (x225)+((x211)*((uintptr_t)4294967295ULL)); x227 = ((x226)<(x225))+(x224); x228 = (x227)+(x222); x229 = ((x227)<(x224))+((x228)<(x222)); x230 = (((x211)+((x211)*((uintptr_t)4294967295ULL)))<(x211))+(x212); x231 = (x230)+(x226); x232 = (((x230)<(x212))+((x231)<(x226)))+(x213); x233 = (x232)+(x228); x234 = (((x232)<(x213))+((x233)<(x228)))+(x214); x235 = (x234)+((x229)+(x223)); x236 = (((x234)<(x214))+((x235)<((x229)+(x223))))+(x215); x237 = ((x236)<(x215))+(x216); x238 = ((x237)<(x216))+(x217); x239 = (x238)+(x211); x240 = (((x238)<(x217))+((x239)<(x211)))+(x218); x241 = (x240)+(x220); x242 = (((x240)<(x218))+((x241)<(x220)))+((x219)+(x210)); x243 = (x242)+(x221); x244 = ((x242)<((x219)+(x210)))+((x243)<(x221)); x245 = (x231)-((uintptr_t)4294967295ULL); x246 = (x233)-((uintptr_t)4294967295ULL); x247 = (x246)-((x231)<(x245)); x248 = (x235)-((uintptr_t)4294967295ULL); x249 = (x248)-(((x233)<(x246))+((x246)<(x247))); x250 = (x236)-(((x235)<(x248))+((x248)<(x249))); x251 = (x237)-((x236)<(x250)); x252 = (x239)-((x237)<(x251)); x253 = (x241)-((uintptr_t)1ULL); x254 = (x253)-((x239)<(x252)); x255 = (x243)-((uintptr_t)4294967295ULL); x256 = (x255)-(((x241)<(x253))+((x253)<(x254))); x257 = (x244)<((x244)-(((x243)<(x255))+((x255)<(x256)))); x258 = ((uintptr_t)-1ULL)+((x257)==((uintptr_t)0ULL)); x259 = (x258)^((uintptr_t)4294967295ULL); x260 = ((x231)&(x258))|((x245)&(x259)); x261 = ((uintptr_t)-1ULL)+((x257)==((uintptr_t)0ULL)); x262 = (x261)^((uintptr_t)4294967295ULL); x263 = ((x233)&(x261))|((x247)&(x262)); x264 = ((uintptr_t)-1ULL)+((x257)==((uintptr_t)0ULL)); x265 = (x264)^((uintptr_t)4294967295ULL); x266 = ((x235)&(x264))|((x249)&(x265)); x267 = ((uintptr_t)-1ULL)+((x257)==((uintptr_t)0ULL)); x268 = (x267)^((uintptr_t)4294967295ULL); x269 = ((x236)&(x267))|((x250)&(x268)); x270 = ((uintptr_t)-1ULL)+((x257)==((uintptr_t)0ULL)); x271 = (x270)^((uintptr_t)4294967295ULL); x272 = ((x237)&(x270))|((x251)&(x271)); x273 = ((uintptr_t)-1ULL)+((x257)==((uintptr_t)0ULL)); x274 = (x273)^((uintptr_t)4294967295ULL); x275 = ((x239)&(x273))|((x252)&(x274)); x276 = ((uintptr_t)-1ULL)+((x257)==((uintptr_t)0ULL)); x277 = (x276)^((uintptr_t)4294967295ULL); x278 = ((x241)&(x276))|((x254)&(x277)); x279 = ((uintptr_t)-1ULL)+((x257)==((uintptr_t)0ULL)); x280 = (x279)^((uintptr_t)4294967295ULL); x281 = ((x243)&(x279))|((x256)&(x280)); x282 = x260; x283 = x263; x284 = x266; x285 = x269; x286 = x272; x287 = x275; x288 = x278; x289 = x281; /*skip*/ _br2_store((out0)+((uintptr_t)0ULL), x282, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)4ULL), x283, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)8ULL), x284, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)12ULL), x285, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)16ULL), x286, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)20ULL), x287, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)24ULL), x288, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)28ULL), x289, sizeof(uintptr_t)); /*skip*/ return; } /* NOTE: The following wrapper function is not covered by Coq proofs */ static void fiat_p256_from_montgomery(uint32_t out1[8], const uint32_t arg1[8]) { internal_fiat_p256_from_montgomery((uintptr_t)out1, (uintptr_t)arg1); } /* * Input Bounds: * in0: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * Output Bounds: * out0: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] */ static void internal_fiat_p256_to_montgomery(uintptr_t out0, uintptr_t in0) { uintptr_t x1, x2, x3, x4, x5, x6, x7, x0, x15, x26, x30, x24, x22, x32, x23, x20, x34, x21, x18, x36, x19, x16, x44, x46, x43, x41, x49, x28, x45, x51, x25, x47, x53, x29, x48, x42, x31, x33, x57, x35, x27, x59, x37, x39, x61, x38, x17, x40, x74, x77, x72, x70, x79, x71, x68, x81, x69, x66, x83, x67, x64, x8, x50, x87, x52, x75, x89, x54, x73, x91, x55, x76, x93, x56, x78, x95, x58, x80, x97, x60, x82, x99, x62, x84, x107, x109, x106, x104, x112, x88, x108, x114, x90, x110, x116, x92, x111, x105, x94, x96, x120, x98, x86, x122, x100, x102, x124, x101, x63, x85, x65, x103, x137, x140, x135, x133, x142, x134, x131, x144, x132, x129, x146, x130, x127, x9, x113, x150, x115, x138, x152, x117, x136, x154, x118, x139, x156, x119, x141, x158, x121, x143, x160, x123, x145, x162, x125, x147, x170, x172, x169, x167, x175, x151, x171, x177, x153, x173, x179, x155, x174, x168, x157, x159, x183, x161, x149, x185, x163, x165, x187, x164, x126, x148, x128, x166, x200, x203, x198, x196, x205, x197, x194, x207, x195, x192, x209, x193, x190, x10, x176, x213, x178, x201, x215, x180, x199, x217, x181, x202, x219, x182, x204, x221, x184, x206, x223, x186, x208, x225, x188, x210, x233, x235, x232, x230, x238, x214, x234, x240, x216, x236, x242, x218, x237, x231, x220, x222, x246, x224, x212, x248, x226, x228, x250, x227, x189, x211, x191, x229, x263, x266, x261, x259, x268, x260, x257, x270, x258, x255, x272, x256, x253, x11, x239, x276, x241, x264, x278, x243, x262, x280, x244, x265, x282, x245, x267, x284, x247, x269, x286, x249, x271, x288, x251, x273, x296, x298, x295, x293, x301, x277, x297, x303, x279, x299, x305, x281, x300, x294, x283, x285, x309, x287, x275, x311, x289, x291, x313, x290, x252, x274, x254, x292, x326, x329, x324, x322, x331, x323, x320, x333, x321, x318, x335, x319, x316, x12, x302, x339, x304, x327, x341, x306, x325, x343, x307, x328, x345, x308, x330, x347, x310, x332, x349, x312, x334, x351, x314, x336, x359, x361, x358, x356, x364, x340, x360, x366, x342, x362, x368, x344, x363, x357, x346, x348, x372, x350, x338, x374, x352, x354, x376, x353, x315, x337, x317, x355, x389, x392, x387, x385, x394, x386, x383, x396, x384, x381, x398, x382, x379, x13, x365, x402, x367, x390, x404, x369, x388, x406, x370, x391, x408, x371, x393, x410, x373, x395, x412, x375, x397, x414, x377, x399, x422, x424, x421, x419, x427, x403, x423, x429, x405, x425, x431, x407, x426, x420, x409, x411, x435, x413, x401, x437, x415, x417, x439, x416, x378, x400, x380, x418, x452, x455, x450, x448, x457, x449, x446, x459, x447, x444, x461, x445, x442, x14, x428, x465, x430, x453, x467, x432, x451, x469, x433, x454, x471, x434, x456, x473, x436, x458, x475, x438, x460, x477, x440, x462, x485, x487, x484, x482, x490, x466, x486, x492, x468, x488, x494, x470, x489, x483, x472, x474, x498, x476, x464, x500, x478, x480, x502, x479, x441, x463, x443, x481, x506, x508, x513, x504, x515, x491, x518, x505, x519, x493, x521, x507, x522, x495, x524, x509, x525, x496, x527, x510, x528, x497, x530, x511, x531, x499, x533, x512, x534, x501, x536, x514, x537, x517, x503, x539, x516, x540, x520, x523, x526, x529, x532, x535, x538, x541, x542, x543, x544, x545, x546, x547, x548, x549; x0 = _br2_load((in0)+((uintptr_t)0ULL), sizeof(uintptr_t)); x1 = _br2_load((in0)+((uintptr_t)4ULL), sizeof(uintptr_t)); x2 = _br2_load((in0)+((uintptr_t)8ULL), sizeof(uintptr_t)); x3 = _br2_load((in0)+((uintptr_t)12ULL), sizeof(uintptr_t)); x4 = _br2_load((in0)+((uintptr_t)16ULL), sizeof(uintptr_t)); x5 = _br2_load((in0)+((uintptr_t)20ULL), sizeof(uintptr_t)); x6 = _br2_load((in0)+((uintptr_t)24ULL), sizeof(uintptr_t)); x7 = _br2_load((in0)+((uintptr_t)28ULL), sizeof(uintptr_t)); /*skip*/ /*skip*/ x8 = x1; x9 = x2; x10 = x3; x11 = x4; x12 = x5; x13 = x6; x14 = x7; x15 = x0; x16 = (x15)*((uintptr_t)4ULL); x17 = sizeof(intptr_t) == 4 ? ((uint64_t)(x15)*((uintptr_t)4ULL))>>32 : ((__uint128_t)(x15)*((uintptr_t)4ULL))>>64; x18 = (x15)*((uintptr_t)4294967293ULL); x19 = sizeof(intptr_t) == 4 ? ((uint64_t)(x15)*((uintptr_t)4294967293ULL))>>32 : ((__uint128_t)(x15)*((uintptr_t)4294967293ULL))>>64; x20 = (x15)*((uintptr_t)4294967295ULL); x21 = sizeof(intptr_t) == 4 ? ((uint64_t)(x15)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x15)*((uintptr_t)4294967295ULL))>>64; x22 = (x15)*((uintptr_t)4294967294ULL); x23 = sizeof(intptr_t) == 4 ? ((uint64_t)(x15)*((uintptr_t)4294967294ULL))>>32 : ((__uint128_t)(x15)*((uintptr_t)4294967294ULL))>>64; x24 = sizeof(intptr_t) == 4 ? ((uint64_t)(x15)*((uintptr_t)4294967291ULL))>>32 : ((__uint128_t)(x15)*((uintptr_t)4294967291ULL))>>64; x25 = (x15)*((uintptr_t)4294967295ULL); x26 = sizeof(intptr_t) == 4 ? ((uint64_t)(x15)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x15)*((uintptr_t)4294967295ULL))>>64; x27 = (x15)*((uintptr_t)3ULL); x28 = sizeof(intptr_t) == 4 ? ((uint64_t)(x15)*((uintptr_t)3ULL))>>32 : ((__uint128_t)(x15)*((uintptr_t)3ULL))>>64; x29 = (x26)+((x15)*((uintptr_t)4294967291ULL)); x30 = ((x29)<(x26))+(x24); x31 = (x30)+(x22); x32 = (((x30)<(x24))+((x31)<(x22)))+(x23); x33 = (x32)+(x20); x34 = (((x32)<(x23))+((x33)<(x20)))+(x21); x35 = (x34)+(x18); x36 = (((x34)<(x21))+((x35)<(x18)))+(x19); x37 = (x36)+(x16); x38 = ((x36)<(x19))+((x37)<(x16)); x39 = (x27)*((uintptr_t)4294967295ULL); x40 = sizeof(intptr_t) == 4 ? ((uint64_t)(x27)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x27)*((uintptr_t)4294967295ULL))>>64; x41 = (x27)*((uintptr_t)4294967295ULL); x42 = sizeof(intptr_t) == 4 ? ((uint64_t)(x27)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x27)*((uintptr_t)4294967295ULL))>>64; x43 = sizeof(intptr_t) == 4 ? ((uint64_t)(x27)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x27)*((uintptr_t)4294967295ULL))>>64; x44 = sizeof(intptr_t) == 4 ? ((uint64_t)(x27)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x27)*((uintptr_t)4294967295ULL))>>64; x45 = (x44)+((x27)*((uintptr_t)4294967295ULL)); x46 = ((x45)<(x44))+(x43); x47 = (x46)+(x41); x48 = ((x46)<(x43))+((x47)<(x41)); x49 = (((x27)+((x27)*((uintptr_t)4294967295ULL)))<(x27))+(x28); x50 = (x49)+(x45); x51 = (((x49)<(x28))+((x50)<(x45)))+(x25); x52 = (x51)+(x47); x53 = (((x51)<(x25))+((x52)<(x47)))+(x29); x54 = (x53)+((x48)+(x42)); x55 = (((x53)<(x29))+((x54)<((x48)+(x42))))+(x31); x56 = ((x55)<(x31))+(x33); x57 = ((x56)<(x33))+(x35); x58 = (x57)+(x27); x59 = (((x57)<(x35))+((x58)<(x27)))+(x37); x60 = (x59)+(x39); x61 = (((x59)<(x37))+((x60)<(x39)))+((x38)+(x17)); x62 = (x61)+(x40); x63 = ((x61)<((x38)+(x17)))+((x62)<(x40)); x64 = (x8)*((uintptr_t)4ULL); x65 = sizeof(intptr_t) == 4 ? ((uint64_t)(x8)*((uintptr_t)4ULL))>>32 : ((__uint128_t)(x8)*((uintptr_t)4ULL))>>64; x66 = (x8)*((uintptr_t)4294967293ULL); x67 = sizeof(intptr_t) == 4 ? ((uint64_t)(x8)*((uintptr_t)4294967293ULL))>>32 : ((__uint128_t)(x8)*((uintptr_t)4294967293ULL))>>64; x68 = (x8)*((uintptr_t)4294967295ULL); x69 = sizeof(intptr_t) == 4 ? ((uint64_t)(x8)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x8)*((uintptr_t)4294967295ULL))>>64; x70 = (x8)*((uintptr_t)4294967294ULL); x71 = sizeof(intptr_t) == 4 ? ((uint64_t)(x8)*((uintptr_t)4294967294ULL))>>32 : ((__uint128_t)(x8)*((uintptr_t)4294967294ULL))>>64; x72 = sizeof(intptr_t) == 4 ? ((uint64_t)(x8)*((uintptr_t)4294967291ULL))>>32 : ((__uint128_t)(x8)*((uintptr_t)4294967291ULL))>>64; x73 = (x8)*((uintptr_t)4294967295ULL); x74 = sizeof(intptr_t) == 4 ? ((uint64_t)(x8)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x8)*((uintptr_t)4294967295ULL))>>64; x75 = sizeof(intptr_t) == 4 ? ((uint64_t)(x8)*((uintptr_t)3ULL))>>32 : ((__uint128_t)(x8)*((uintptr_t)3ULL))>>64; x76 = (x74)+((x8)*((uintptr_t)4294967291ULL)); x77 = ((x76)<(x74))+(x72); x78 = (x77)+(x70); x79 = (((x77)<(x72))+((x78)<(x70)))+(x71); x80 = (x79)+(x68); x81 = (((x79)<(x71))+((x80)<(x68)))+(x69); x82 = (x81)+(x66); x83 = (((x81)<(x69))+((x82)<(x66)))+(x67); x84 = (x83)+(x64); x85 = ((x83)<(x67))+((x84)<(x64)); x86 = (x50)+((x8)*((uintptr_t)3ULL)); x87 = ((x86)<(x50))+(x52); x88 = (x87)+(x75); x89 = (((x87)<(x52))+((x88)<(x75)))+(x54); x90 = (x89)+(x73); x91 = (((x89)<(x54))+((x90)<(x73)))+(x55); x92 = (x91)+(x76); x93 = (((x91)<(x55))+((x92)<(x76)))+(x56); x94 = (x93)+(x78); x95 = (((x93)<(x56))+((x94)<(x78)))+(x58); x96 = (x95)+(x80); x97 = (((x95)<(x58))+((x96)<(x80)))+(x60); x98 = (x97)+(x82); x99 = (((x97)<(x60))+((x98)<(x82)))+(x62); x100 = (x99)+(x84); x101 = ((x99)<(x62))+((x100)<(x84)); x102 = (x86)*((uintptr_t)4294967295ULL); x103 = sizeof(intptr_t) == 4 ? ((uint64_t)(x86)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x86)*((uintptr_t)4294967295ULL))>>64; x104 = (x86)*((uintptr_t)4294967295ULL); x105 = sizeof(intptr_t) == 4 ? ((uint64_t)(x86)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x86)*((uintptr_t)4294967295ULL))>>64; x106 = sizeof(intptr_t) == 4 ? ((uint64_t)(x86)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x86)*((uintptr_t)4294967295ULL))>>64; x107 = sizeof(intptr_t) == 4 ? ((uint64_t)(x86)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x86)*((uintptr_t)4294967295ULL))>>64; x108 = (x107)+((x86)*((uintptr_t)4294967295ULL)); x109 = ((x108)<(x107))+(x106); x110 = (x109)+(x104); x111 = ((x109)<(x106))+((x110)<(x104)); x112 = (((x86)+((x86)*((uintptr_t)4294967295ULL)))<(x86))+(x88); x113 = (x112)+(x108); x114 = (((x112)<(x88))+((x113)<(x108)))+(x90); x115 = (x114)+(x110); x116 = (((x114)<(x90))+((x115)<(x110)))+(x92); x117 = (x116)+((x111)+(x105)); x118 = (((x116)<(x92))+((x117)<((x111)+(x105))))+(x94); x119 = ((x118)<(x94))+(x96); x120 = ((x119)<(x96))+(x98); x121 = (x120)+(x86); x122 = (((x120)<(x98))+((x121)<(x86)))+(x100); x123 = (x122)+(x102); x124 = (((x122)<(x100))+((x123)<(x102)))+(((x101)+(x63))+((x85)+(x65))); x125 = (x124)+(x103); x126 = ((x124)<(((x101)+(x63))+((x85)+(x65))))+((x125)<(x103)); x127 = (x9)*((uintptr_t)4ULL); x128 = sizeof(intptr_t) == 4 ? ((uint64_t)(x9)*((uintptr_t)4ULL))>>32 : ((__uint128_t)(x9)*((uintptr_t)4ULL))>>64; x129 = (x9)*((uintptr_t)4294967293ULL); x130 = sizeof(intptr_t) == 4 ? ((uint64_t)(x9)*((uintptr_t)4294967293ULL))>>32 : ((__uint128_t)(x9)*((uintptr_t)4294967293ULL))>>64; x131 = (x9)*((uintptr_t)4294967295ULL); x132 = sizeof(intptr_t) == 4 ? ((uint64_t)(x9)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x9)*((uintptr_t)4294967295ULL))>>64; x133 = (x9)*((uintptr_t)4294967294ULL); x134 = sizeof(intptr_t) == 4 ? ((uint64_t)(x9)*((uintptr_t)4294967294ULL))>>32 : ((__uint128_t)(x9)*((uintptr_t)4294967294ULL))>>64; x135 = sizeof(intptr_t) == 4 ? ((uint64_t)(x9)*((uintptr_t)4294967291ULL))>>32 : ((__uint128_t)(x9)*((uintptr_t)4294967291ULL))>>64; x136 = (x9)*((uintptr_t)4294967295ULL); x137 = sizeof(intptr_t) == 4 ? ((uint64_t)(x9)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x9)*((uintptr_t)4294967295ULL))>>64; x138 = sizeof(intptr_t) == 4 ? ((uint64_t)(x9)*((uintptr_t)3ULL))>>32 : ((__uint128_t)(x9)*((uintptr_t)3ULL))>>64; x139 = (x137)+((x9)*((uintptr_t)4294967291ULL)); x140 = ((x139)<(x137))+(x135); x141 = (x140)+(x133); x142 = (((x140)<(x135))+((x141)<(x133)))+(x134); x143 = (x142)+(x131); x144 = (((x142)<(x134))+((x143)<(x131)))+(x132); x145 = (x144)+(x129); x146 = (((x144)<(x132))+((x145)<(x129)))+(x130); x147 = (x146)+(x127); x148 = ((x146)<(x130))+((x147)<(x127)); x149 = (x113)+((x9)*((uintptr_t)3ULL)); x150 = ((x149)<(x113))+(x115); x151 = (x150)+(x138); x152 = (((x150)<(x115))+((x151)<(x138)))+(x117); x153 = (x152)+(x136); x154 = (((x152)<(x117))+((x153)<(x136)))+(x118); x155 = (x154)+(x139); x156 = (((x154)<(x118))+((x155)<(x139)))+(x119); x157 = (x156)+(x141); x158 = (((x156)<(x119))+((x157)<(x141)))+(x121); x159 = (x158)+(x143); x160 = (((x158)<(x121))+((x159)<(x143)))+(x123); x161 = (x160)+(x145); x162 = (((x160)<(x123))+((x161)<(x145)))+(x125); x163 = (x162)+(x147); x164 = ((x162)<(x125))+((x163)<(x147)); x165 = (x149)*((uintptr_t)4294967295ULL); x166 = sizeof(intptr_t) == 4 ? ((uint64_t)(x149)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x149)*((uintptr_t)4294967295ULL))>>64; x167 = (x149)*((uintptr_t)4294967295ULL); x168 = sizeof(intptr_t) == 4 ? ((uint64_t)(x149)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x149)*((uintptr_t)4294967295ULL))>>64; x169 = sizeof(intptr_t) == 4 ? ((uint64_t)(x149)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x149)*((uintptr_t)4294967295ULL))>>64; x170 = sizeof(intptr_t) == 4 ? ((uint64_t)(x149)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x149)*((uintptr_t)4294967295ULL))>>64; x171 = (x170)+((x149)*((uintptr_t)4294967295ULL)); x172 = ((x171)<(x170))+(x169); x173 = (x172)+(x167); x174 = ((x172)<(x169))+((x173)<(x167)); x175 = (((x149)+((x149)*((uintptr_t)4294967295ULL)))<(x149))+(x151); x176 = (x175)+(x171); x177 = (((x175)<(x151))+((x176)<(x171)))+(x153); x178 = (x177)+(x173); x179 = (((x177)<(x153))+((x178)<(x173)))+(x155); x180 = (x179)+((x174)+(x168)); x181 = (((x179)<(x155))+((x180)<((x174)+(x168))))+(x157); x182 = ((x181)<(x157))+(x159); x183 = ((x182)<(x159))+(x161); x184 = (x183)+(x149); x185 = (((x183)<(x161))+((x184)<(x149)))+(x163); x186 = (x185)+(x165); x187 = (((x185)<(x163))+((x186)<(x165)))+(((x164)+(x126))+((x148)+(x128))); x188 = (x187)+(x166); x189 = ((x187)<(((x164)+(x126))+((x148)+(x128))))+((x188)<(x166)); x190 = (x10)*((uintptr_t)4ULL); x191 = sizeof(intptr_t) == 4 ? ((uint64_t)(x10)*((uintptr_t)4ULL))>>32 : ((__uint128_t)(x10)*((uintptr_t)4ULL))>>64; x192 = (x10)*((uintptr_t)4294967293ULL); x193 = sizeof(intptr_t) == 4 ? ((uint64_t)(x10)*((uintptr_t)4294967293ULL))>>32 : ((__uint128_t)(x10)*((uintptr_t)4294967293ULL))>>64; x194 = (x10)*((uintptr_t)4294967295ULL); x195 = sizeof(intptr_t) == 4 ? ((uint64_t)(x10)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x10)*((uintptr_t)4294967295ULL))>>64; x196 = (x10)*((uintptr_t)4294967294ULL); x197 = sizeof(intptr_t) == 4 ? ((uint64_t)(x10)*((uintptr_t)4294967294ULL))>>32 : ((__uint128_t)(x10)*((uintptr_t)4294967294ULL))>>64; x198 = sizeof(intptr_t) == 4 ? ((uint64_t)(x10)*((uintptr_t)4294967291ULL))>>32 : ((__uint128_t)(x10)*((uintptr_t)4294967291ULL))>>64; x199 = (x10)*((uintptr_t)4294967295ULL); x200 = sizeof(intptr_t) == 4 ? ((uint64_t)(x10)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x10)*((uintptr_t)4294967295ULL))>>64; x201 = sizeof(intptr_t) == 4 ? ((uint64_t)(x10)*((uintptr_t)3ULL))>>32 : ((__uint128_t)(x10)*((uintptr_t)3ULL))>>64; x202 = (x200)+((x10)*((uintptr_t)4294967291ULL)); x203 = ((x202)<(x200))+(x198); x204 = (x203)+(x196); x205 = (((x203)<(x198))+((x204)<(x196)))+(x197); x206 = (x205)+(x194); x207 = (((x205)<(x197))+((x206)<(x194)))+(x195); x208 = (x207)+(x192); x209 = (((x207)<(x195))+((x208)<(x192)))+(x193); x210 = (x209)+(x190); x211 = ((x209)<(x193))+((x210)<(x190)); x212 = (x176)+((x10)*((uintptr_t)3ULL)); x213 = ((x212)<(x176))+(x178); x214 = (x213)+(x201); x215 = (((x213)<(x178))+((x214)<(x201)))+(x180); x216 = (x215)+(x199); x217 = (((x215)<(x180))+((x216)<(x199)))+(x181); x218 = (x217)+(x202); x219 = (((x217)<(x181))+((x218)<(x202)))+(x182); x220 = (x219)+(x204); x221 = (((x219)<(x182))+((x220)<(x204)))+(x184); x222 = (x221)+(x206); x223 = (((x221)<(x184))+((x222)<(x206)))+(x186); x224 = (x223)+(x208); x225 = (((x223)<(x186))+((x224)<(x208)))+(x188); x226 = (x225)+(x210); x227 = ((x225)<(x188))+((x226)<(x210)); x228 = (x212)*((uintptr_t)4294967295ULL); x229 = sizeof(intptr_t) == 4 ? ((uint64_t)(x212)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x212)*((uintptr_t)4294967295ULL))>>64; x230 = (x212)*((uintptr_t)4294967295ULL); x231 = sizeof(intptr_t) == 4 ? ((uint64_t)(x212)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x212)*((uintptr_t)4294967295ULL))>>64; x232 = sizeof(intptr_t) == 4 ? ((uint64_t)(x212)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x212)*((uintptr_t)4294967295ULL))>>64; x233 = sizeof(intptr_t) == 4 ? ((uint64_t)(x212)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x212)*((uintptr_t)4294967295ULL))>>64; x234 = (x233)+((x212)*((uintptr_t)4294967295ULL)); x235 = ((x234)<(x233))+(x232); x236 = (x235)+(x230); x237 = ((x235)<(x232))+((x236)<(x230)); x238 = (((x212)+((x212)*((uintptr_t)4294967295ULL)))<(x212))+(x214); x239 = (x238)+(x234); x240 = (((x238)<(x214))+((x239)<(x234)))+(x216); x241 = (x240)+(x236); x242 = (((x240)<(x216))+((x241)<(x236)))+(x218); x243 = (x242)+((x237)+(x231)); x244 = (((x242)<(x218))+((x243)<((x237)+(x231))))+(x220); x245 = ((x244)<(x220))+(x222); x246 = ((x245)<(x222))+(x224); x247 = (x246)+(x212); x248 = (((x246)<(x224))+((x247)<(x212)))+(x226); x249 = (x248)+(x228); x250 = (((x248)<(x226))+((x249)<(x228)))+(((x227)+(x189))+((x211)+(x191))); x251 = (x250)+(x229); x252 = ((x250)<(((x227)+(x189))+((x211)+(x191))))+((x251)<(x229)); x253 = (x11)*((uintptr_t)4ULL); x254 = sizeof(intptr_t) == 4 ? ((uint64_t)(x11)*((uintptr_t)4ULL))>>32 : ((__uint128_t)(x11)*((uintptr_t)4ULL))>>64; x255 = (x11)*((uintptr_t)4294967293ULL); x256 = sizeof(intptr_t) == 4 ? ((uint64_t)(x11)*((uintptr_t)4294967293ULL))>>32 : ((__uint128_t)(x11)*((uintptr_t)4294967293ULL))>>64; x257 = (x11)*((uintptr_t)4294967295ULL); x258 = sizeof(intptr_t) == 4 ? ((uint64_t)(x11)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x11)*((uintptr_t)4294967295ULL))>>64; x259 = (x11)*((uintptr_t)4294967294ULL); x260 = sizeof(intptr_t) == 4 ? ((uint64_t)(x11)*((uintptr_t)4294967294ULL))>>32 : ((__uint128_t)(x11)*((uintptr_t)4294967294ULL))>>64; x261 = sizeof(intptr_t) == 4 ? ((uint64_t)(x11)*((uintptr_t)4294967291ULL))>>32 : ((__uint128_t)(x11)*((uintptr_t)4294967291ULL))>>64; x262 = (x11)*((uintptr_t)4294967295ULL); x263 = sizeof(intptr_t) == 4 ? ((uint64_t)(x11)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x11)*((uintptr_t)4294967295ULL))>>64; x264 = sizeof(intptr_t) == 4 ? ((uint64_t)(x11)*((uintptr_t)3ULL))>>32 : ((__uint128_t)(x11)*((uintptr_t)3ULL))>>64; x265 = (x263)+((x11)*((uintptr_t)4294967291ULL)); x266 = ((x265)<(x263))+(x261); x267 = (x266)+(x259); x268 = (((x266)<(x261))+((x267)<(x259)))+(x260); x269 = (x268)+(x257); x270 = (((x268)<(x260))+((x269)<(x257)))+(x258); x271 = (x270)+(x255); x272 = (((x270)<(x258))+((x271)<(x255)))+(x256); x273 = (x272)+(x253); x274 = ((x272)<(x256))+((x273)<(x253)); x275 = (x239)+((x11)*((uintptr_t)3ULL)); x276 = ((x275)<(x239))+(x241); x277 = (x276)+(x264); x278 = (((x276)<(x241))+((x277)<(x264)))+(x243); x279 = (x278)+(x262); x280 = (((x278)<(x243))+((x279)<(x262)))+(x244); x281 = (x280)+(x265); x282 = (((x280)<(x244))+((x281)<(x265)))+(x245); x283 = (x282)+(x267); x284 = (((x282)<(x245))+((x283)<(x267)))+(x247); x285 = (x284)+(x269); x286 = (((x284)<(x247))+((x285)<(x269)))+(x249); x287 = (x286)+(x271); x288 = (((x286)<(x249))+((x287)<(x271)))+(x251); x289 = (x288)+(x273); x290 = ((x288)<(x251))+((x289)<(x273)); x291 = (x275)*((uintptr_t)4294967295ULL); x292 = sizeof(intptr_t) == 4 ? ((uint64_t)(x275)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x275)*((uintptr_t)4294967295ULL))>>64; x293 = (x275)*((uintptr_t)4294967295ULL); x294 = sizeof(intptr_t) == 4 ? ((uint64_t)(x275)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x275)*((uintptr_t)4294967295ULL))>>64; x295 = sizeof(intptr_t) == 4 ? ((uint64_t)(x275)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x275)*((uintptr_t)4294967295ULL))>>64; x296 = sizeof(intptr_t) == 4 ? ((uint64_t)(x275)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x275)*((uintptr_t)4294967295ULL))>>64; x297 = (x296)+((x275)*((uintptr_t)4294967295ULL)); x298 = ((x297)<(x296))+(x295); x299 = (x298)+(x293); x300 = ((x298)<(x295))+((x299)<(x293)); x301 = (((x275)+((x275)*((uintptr_t)4294967295ULL)))<(x275))+(x277); x302 = (x301)+(x297); x303 = (((x301)<(x277))+((x302)<(x297)))+(x279); x304 = (x303)+(x299); x305 = (((x303)<(x279))+((x304)<(x299)))+(x281); x306 = (x305)+((x300)+(x294)); x307 = (((x305)<(x281))+((x306)<((x300)+(x294))))+(x283); x308 = ((x307)<(x283))+(x285); x309 = ((x308)<(x285))+(x287); x310 = (x309)+(x275); x311 = (((x309)<(x287))+((x310)<(x275)))+(x289); x312 = (x311)+(x291); x313 = (((x311)<(x289))+((x312)<(x291)))+(((x290)+(x252))+((x274)+(x254))); x314 = (x313)+(x292); x315 = ((x313)<(((x290)+(x252))+((x274)+(x254))))+((x314)<(x292)); x316 = (x12)*((uintptr_t)4ULL); x317 = sizeof(intptr_t) == 4 ? ((uint64_t)(x12)*((uintptr_t)4ULL))>>32 : ((__uint128_t)(x12)*((uintptr_t)4ULL))>>64; x318 = (x12)*((uintptr_t)4294967293ULL); x319 = sizeof(intptr_t) == 4 ? ((uint64_t)(x12)*((uintptr_t)4294967293ULL))>>32 : ((__uint128_t)(x12)*((uintptr_t)4294967293ULL))>>64; x320 = (x12)*((uintptr_t)4294967295ULL); x321 = sizeof(intptr_t) == 4 ? ((uint64_t)(x12)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x12)*((uintptr_t)4294967295ULL))>>64; x322 = (x12)*((uintptr_t)4294967294ULL); x323 = sizeof(intptr_t) == 4 ? ((uint64_t)(x12)*((uintptr_t)4294967294ULL))>>32 : ((__uint128_t)(x12)*((uintptr_t)4294967294ULL))>>64; x324 = sizeof(intptr_t) == 4 ? ((uint64_t)(x12)*((uintptr_t)4294967291ULL))>>32 : ((__uint128_t)(x12)*((uintptr_t)4294967291ULL))>>64; x325 = (x12)*((uintptr_t)4294967295ULL); x326 = sizeof(intptr_t) == 4 ? ((uint64_t)(x12)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x12)*((uintptr_t)4294967295ULL))>>64; x327 = sizeof(intptr_t) == 4 ? ((uint64_t)(x12)*((uintptr_t)3ULL))>>32 : ((__uint128_t)(x12)*((uintptr_t)3ULL))>>64; x328 = (x326)+((x12)*((uintptr_t)4294967291ULL)); x329 = ((x328)<(x326))+(x324); x330 = (x329)+(x322); x331 = (((x329)<(x324))+((x330)<(x322)))+(x323); x332 = (x331)+(x320); x333 = (((x331)<(x323))+((x332)<(x320)))+(x321); x334 = (x333)+(x318); x335 = (((x333)<(x321))+((x334)<(x318)))+(x319); x336 = (x335)+(x316); x337 = ((x335)<(x319))+((x336)<(x316)); x338 = (x302)+((x12)*((uintptr_t)3ULL)); x339 = ((x338)<(x302))+(x304); x340 = (x339)+(x327); x341 = (((x339)<(x304))+((x340)<(x327)))+(x306); x342 = (x341)+(x325); x343 = (((x341)<(x306))+((x342)<(x325)))+(x307); x344 = (x343)+(x328); x345 = (((x343)<(x307))+((x344)<(x328)))+(x308); x346 = (x345)+(x330); x347 = (((x345)<(x308))+((x346)<(x330)))+(x310); x348 = (x347)+(x332); x349 = (((x347)<(x310))+((x348)<(x332)))+(x312); x350 = (x349)+(x334); x351 = (((x349)<(x312))+((x350)<(x334)))+(x314); x352 = (x351)+(x336); x353 = ((x351)<(x314))+((x352)<(x336)); x354 = (x338)*((uintptr_t)4294967295ULL); x355 = sizeof(intptr_t) == 4 ? ((uint64_t)(x338)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x338)*((uintptr_t)4294967295ULL))>>64; x356 = (x338)*((uintptr_t)4294967295ULL); x357 = sizeof(intptr_t) == 4 ? ((uint64_t)(x338)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x338)*((uintptr_t)4294967295ULL))>>64; x358 = sizeof(intptr_t) == 4 ? ((uint64_t)(x338)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x338)*((uintptr_t)4294967295ULL))>>64; x359 = sizeof(intptr_t) == 4 ? ((uint64_t)(x338)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x338)*((uintptr_t)4294967295ULL))>>64; x360 = (x359)+((x338)*((uintptr_t)4294967295ULL)); x361 = ((x360)<(x359))+(x358); x362 = (x361)+(x356); x363 = ((x361)<(x358))+((x362)<(x356)); x364 = (((x338)+((x338)*((uintptr_t)4294967295ULL)))<(x338))+(x340); x365 = (x364)+(x360); x366 = (((x364)<(x340))+((x365)<(x360)))+(x342); x367 = (x366)+(x362); x368 = (((x366)<(x342))+((x367)<(x362)))+(x344); x369 = (x368)+((x363)+(x357)); x370 = (((x368)<(x344))+((x369)<((x363)+(x357))))+(x346); x371 = ((x370)<(x346))+(x348); x372 = ((x371)<(x348))+(x350); x373 = (x372)+(x338); x374 = (((x372)<(x350))+((x373)<(x338)))+(x352); x375 = (x374)+(x354); x376 = (((x374)<(x352))+((x375)<(x354)))+(((x353)+(x315))+((x337)+(x317))); x377 = (x376)+(x355); x378 = ((x376)<(((x353)+(x315))+((x337)+(x317))))+((x377)<(x355)); x379 = (x13)*((uintptr_t)4ULL); x380 = sizeof(intptr_t) == 4 ? ((uint64_t)(x13)*((uintptr_t)4ULL))>>32 : ((__uint128_t)(x13)*((uintptr_t)4ULL))>>64; x381 = (x13)*((uintptr_t)4294967293ULL); x382 = sizeof(intptr_t) == 4 ? ((uint64_t)(x13)*((uintptr_t)4294967293ULL))>>32 : ((__uint128_t)(x13)*((uintptr_t)4294967293ULL))>>64; x383 = (x13)*((uintptr_t)4294967295ULL); x384 = sizeof(intptr_t) == 4 ? ((uint64_t)(x13)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x13)*((uintptr_t)4294967295ULL))>>64; x385 = (x13)*((uintptr_t)4294967294ULL); x386 = sizeof(intptr_t) == 4 ? ((uint64_t)(x13)*((uintptr_t)4294967294ULL))>>32 : ((__uint128_t)(x13)*((uintptr_t)4294967294ULL))>>64; x387 = sizeof(intptr_t) == 4 ? ((uint64_t)(x13)*((uintptr_t)4294967291ULL))>>32 : ((__uint128_t)(x13)*((uintptr_t)4294967291ULL))>>64; x388 = (x13)*((uintptr_t)4294967295ULL); x389 = sizeof(intptr_t) == 4 ? ((uint64_t)(x13)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x13)*((uintptr_t)4294967295ULL))>>64; x390 = sizeof(intptr_t) == 4 ? ((uint64_t)(x13)*((uintptr_t)3ULL))>>32 : ((__uint128_t)(x13)*((uintptr_t)3ULL))>>64; x391 = (x389)+((x13)*((uintptr_t)4294967291ULL)); x392 = ((x391)<(x389))+(x387); x393 = (x392)+(x385); x394 = (((x392)<(x387))+((x393)<(x385)))+(x386); x395 = (x394)+(x383); x396 = (((x394)<(x386))+((x395)<(x383)))+(x384); x397 = (x396)+(x381); x398 = (((x396)<(x384))+((x397)<(x381)))+(x382); x399 = (x398)+(x379); x400 = ((x398)<(x382))+((x399)<(x379)); x401 = (x365)+((x13)*((uintptr_t)3ULL)); x402 = ((x401)<(x365))+(x367); x403 = (x402)+(x390); x404 = (((x402)<(x367))+((x403)<(x390)))+(x369); x405 = (x404)+(x388); x406 = (((x404)<(x369))+((x405)<(x388)))+(x370); x407 = (x406)+(x391); x408 = (((x406)<(x370))+((x407)<(x391)))+(x371); x409 = (x408)+(x393); x410 = (((x408)<(x371))+((x409)<(x393)))+(x373); x411 = (x410)+(x395); x412 = (((x410)<(x373))+((x411)<(x395)))+(x375); x413 = (x412)+(x397); x414 = (((x412)<(x375))+((x413)<(x397)))+(x377); x415 = (x414)+(x399); x416 = ((x414)<(x377))+((x415)<(x399)); x417 = (x401)*((uintptr_t)4294967295ULL); x418 = sizeof(intptr_t) == 4 ? ((uint64_t)(x401)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x401)*((uintptr_t)4294967295ULL))>>64; x419 = (x401)*((uintptr_t)4294967295ULL); x420 = sizeof(intptr_t) == 4 ? ((uint64_t)(x401)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x401)*((uintptr_t)4294967295ULL))>>64; x421 = sizeof(intptr_t) == 4 ? ((uint64_t)(x401)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x401)*((uintptr_t)4294967295ULL))>>64; x422 = sizeof(intptr_t) == 4 ? ((uint64_t)(x401)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x401)*((uintptr_t)4294967295ULL))>>64; x423 = (x422)+((x401)*((uintptr_t)4294967295ULL)); x424 = ((x423)<(x422))+(x421); x425 = (x424)+(x419); x426 = ((x424)<(x421))+((x425)<(x419)); x427 = (((x401)+((x401)*((uintptr_t)4294967295ULL)))<(x401))+(x403); x428 = (x427)+(x423); x429 = (((x427)<(x403))+((x428)<(x423)))+(x405); x430 = (x429)+(x425); x431 = (((x429)<(x405))+((x430)<(x425)))+(x407); x432 = (x431)+((x426)+(x420)); x433 = (((x431)<(x407))+((x432)<((x426)+(x420))))+(x409); x434 = ((x433)<(x409))+(x411); x435 = ((x434)<(x411))+(x413); x436 = (x435)+(x401); x437 = (((x435)<(x413))+((x436)<(x401)))+(x415); x438 = (x437)+(x417); x439 = (((x437)<(x415))+((x438)<(x417)))+(((x416)+(x378))+((x400)+(x380))); x440 = (x439)+(x418); x441 = ((x439)<(((x416)+(x378))+((x400)+(x380))))+((x440)<(x418)); x442 = (x14)*((uintptr_t)4ULL); x443 = sizeof(intptr_t) == 4 ? ((uint64_t)(x14)*((uintptr_t)4ULL))>>32 : ((__uint128_t)(x14)*((uintptr_t)4ULL))>>64; x444 = (x14)*((uintptr_t)4294967293ULL); x445 = sizeof(intptr_t) == 4 ? ((uint64_t)(x14)*((uintptr_t)4294967293ULL))>>32 : ((__uint128_t)(x14)*((uintptr_t)4294967293ULL))>>64; x446 = (x14)*((uintptr_t)4294967295ULL); x447 = sizeof(intptr_t) == 4 ? ((uint64_t)(x14)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x14)*((uintptr_t)4294967295ULL))>>64; x448 = (x14)*((uintptr_t)4294967294ULL); x449 = sizeof(intptr_t) == 4 ? ((uint64_t)(x14)*((uintptr_t)4294967294ULL))>>32 : ((__uint128_t)(x14)*((uintptr_t)4294967294ULL))>>64; x450 = sizeof(intptr_t) == 4 ? ((uint64_t)(x14)*((uintptr_t)4294967291ULL))>>32 : ((__uint128_t)(x14)*((uintptr_t)4294967291ULL))>>64; x451 = (x14)*((uintptr_t)4294967295ULL); x452 = sizeof(intptr_t) == 4 ? ((uint64_t)(x14)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x14)*((uintptr_t)4294967295ULL))>>64; x453 = sizeof(intptr_t) == 4 ? ((uint64_t)(x14)*((uintptr_t)3ULL))>>32 : ((__uint128_t)(x14)*((uintptr_t)3ULL))>>64; x454 = (x452)+((x14)*((uintptr_t)4294967291ULL)); x455 = ((x454)<(x452))+(x450); x456 = (x455)+(x448); x457 = (((x455)<(x450))+((x456)<(x448)))+(x449); x458 = (x457)+(x446); x459 = (((x457)<(x449))+((x458)<(x446)))+(x447); x460 = (x459)+(x444); x461 = (((x459)<(x447))+((x460)<(x444)))+(x445); x462 = (x461)+(x442); x463 = ((x461)<(x445))+((x462)<(x442)); x464 = (x428)+((x14)*((uintptr_t)3ULL)); x465 = ((x464)<(x428))+(x430); x466 = (x465)+(x453); x467 = (((x465)<(x430))+((x466)<(x453)))+(x432); x468 = (x467)+(x451); x469 = (((x467)<(x432))+((x468)<(x451)))+(x433); x470 = (x469)+(x454); x471 = (((x469)<(x433))+((x470)<(x454)))+(x434); x472 = (x471)+(x456); x473 = (((x471)<(x434))+((x472)<(x456)))+(x436); x474 = (x473)+(x458); x475 = (((x473)<(x436))+((x474)<(x458)))+(x438); x476 = (x475)+(x460); x477 = (((x475)<(x438))+((x476)<(x460)))+(x440); x478 = (x477)+(x462); x479 = ((x477)<(x440))+((x478)<(x462)); x480 = (x464)*((uintptr_t)4294967295ULL); x481 = sizeof(intptr_t) == 4 ? ((uint64_t)(x464)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x464)*((uintptr_t)4294967295ULL))>>64; x482 = (x464)*((uintptr_t)4294967295ULL); x483 = sizeof(intptr_t) == 4 ? ((uint64_t)(x464)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x464)*((uintptr_t)4294967295ULL))>>64; x484 = sizeof(intptr_t) == 4 ? ((uint64_t)(x464)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x464)*((uintptr_t)4294967295ULL))>>64; x485 = sizeof(intptr_t) == 4 ? ((uint64_t)(x464)*((uintptr_t)4294967295ULL))>>32 : ((__uint128_t)(x464)*((uintptr_t)4294967295ULL))>>64; x486 = (x485)+((x464)*((uintptr_t)4294967295ULL)); x487 = ((x486)<(x485))+(x484); x488 = (x487)+(x482); x489 = ((x487)<(x484))+((x488)<(x482)); x490 = (((x464)+((x464)*((uintptr_t)4294967295ULL)))<(x464))+(x466); x491 = (x490)+(x486); x492 = (((x490)<(x466))+((x491)<(x486)))+(x468); x493 = (x492)+(x488); x494 = (((x492)<(x468))+((x493)<(x488)))+(x470); x495 = (x494)+((x489)+(x483)); x496 = (((x494)<(x470))+((x495)<((x489)+(x483))))+(x472); x497 = ((x496)<(x472))+(x474); x498 = ((x497)<(x474))+(x476); x499 = (x498)+(x464); x500 = (((x498)<(x476))+((x499)<(x464)))+(x478); x501 = (x500)+(x480); x502 = (((x500)<(x478))+((x501)<(x480)))+(((x479)+(x441))+((x463)+(x443))); x503 = (x502)+(x481); x504 = ((x502)<(((x479)+(x441))+((x463)+(x443))))+((x503)<(x481)); x505 = (x491)-((uintptr_t)4294967295ULL); x506 = (x493)-((uintptr_t)4294967295ULL); x507 = (x506)-((x491)<(x505)); x508 = (x495)-((uintptr_t)4294967295ULL); x509 = (x508)-(((x493)<(x506))+((x506)<(x507))); x510 = (x496)-(((x495)<(x508))+((x508)<(x509))); x511 = (x497)-((x496)<(x510)); x512 = (x499)-((x497)<(x511)); x513 = (x501)-((uintptr_t)1ULL); x514 = (x513)-((x499)<(x512)); x515 = (x503)-((uintptr_t)4294967295ULL); x516 = (x515)-(((x501)<(x513))+((x513)<(x514))); x517 = (x504)<((x504)-(((x503)<(x515))+((x515)<(x516)))); x518 = ((uintptr_t)-1ULL)+((x517)==((uintptr_t)0ULL)); x519 = (x518)^((uintptr_t)4294967295ULL); x520 = ((x491)&(x518))|((x505)&(x519)); x521 = ((uintptr_t)-1ULL)+((x517)==((uintptr_t)0ULL)); x522 = (x521)^((uintptr_t)4294967295ULL); x523 = ((x493)&(x521))|((x507)&(x522)); x524 = ((uintptr_t)-1ULL)+((x517)==((uintptr_t)0ULL)); x525 = (x524)^((uintptr_t)4294967295ULL); x526 = ((x495)&(x524))|((x509)&(x525)); x527 = ((uintptr_t)-1ULL)+((x517)==((uintptr_t)0ULL)); x528 = (x527)^((uintptr_t)4294967295ULL); x529 = ((x496)&(x527))|((x510)&(x528)); x530 = ((uintptr_t)-1ULL)+((x517)==((uintptr_t)0ULL)); x531 = (x530)^((uintptr_t)4294967295ULL); x532 = ((x497)&(x530))|((x511)&(x531)); x533 = ((uintptr_t)-1ULL)+((x517)==((uintptr_t)0ULL)); x534 = (x533)^((uintptr_t)4294967295ULL); x535 = ((x499)&(x533))|((x512)&(x534)); x536 = ((uintptr_t)-1ULL)+((x517)==((uintptr_t)0ULL)); x537 = (x536)^((uintptr_t)4294967295ULL); x538 = ((x501)&(x536))|((x514)&(x537)); x539 = ((uintptr_t)-1ULL)+((x517)==((uintptr_t)0ULL)); x540 = (x539)^((uintptr_t)4294967295ULL); x541 = ((x503)&(x539))|((x516)&(x540)); x542 = x520; x543 = x523; x544 = x526; x545 = x529; x546 = x532; x547 = x535; x548 = x538; x549 = x541; /*skip*/ _br2_store((out0)+((uintptr_t)0ULL), x542, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)4ULL), x543, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)8ULL), x544, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)12ULL), x545, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)16ULL), x546, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)20ULL), x547, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)24ULL), x548, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)28ULL), x549, sizeof(uintptr_t)); /*skip*/ return; } /* NOTE: The following wrapper function is not covered by Coq proofs */ static void fiat_p256_to_montgomery(uint32_t out1[8], const uint32_t arg1[8]) { internal_fiat_p256_to_montgomery((uintptr_t)out1, (uintptr_t)arg1); } /* * Input Bounds: * in0: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * Output Bounds: * out0: [0x0 ~> 0xffffffff] */ static uintptr_t internal_fiat_p256_nonzero(uintptr_t in0) { uintptr_t x0, x1, x2, x3, x4, x5, x6, x7, x8, out0, x9; x0 = _br2_load((in0)+((uintptr_t)0ULL), sizeof(uintptr_t)); x1 = _br2_load((in0)+((uintptr_t)4ULL), sizeof(uintptr_t)); x2 = _br2_load((in0)+((uintptr_t)8ULL), sizeof(uintptr_t)); x3 = _br2_load((in0)+((uintptr_t)12ULL), sizeof(uintptr_t)); x4 = _br2_load((in0)+((uintptr_t)16ULL), sizeof(uintptr_t)); x5 = _br2_load((in0)+((uintptr_t)20ULL), sizeof(uintptr_t)); x6 = _br2_load((in0)+((uintptr_t)24ULL), sizeof(uintptr_t)); x7 = _br2_load((in0)+((uintptr_t)28ULL), sizeof(uintptr_t)); /*skip*/ /*skip*/ x8 = (x0)|((x1)|((x2)|((x3)|((x4)|((x5)|((x6)|(x7))))))); x9 = x8; out0 = x9; return out0; } /* NOTE: The following wrapper function is not covered by Coq proofs */ static void fiat_p256_nonzero(uint32_t* out1, const uint32_t arg1[8]) { *out1 = (uint32_t)internal_fiat_p256_nonzero((uintptr_t)arg1); } /* * Input Bounds: * in0: [0x0 ~> 0x1] * in1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * in2: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * Output Bounds: * out0: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] */ static void internal_fiat_p256_selectznz(uintptr_t out0, uintptr_t in0, uintptr_t in1, uintptr_t in2) { uintptr_t x8, x16, x0, x17, x9, x19, x1, x20, x10, x22, x2, x23, x11, x25, x3, x26, x12, x28, x4, x29, x13, x31, x5, x32, x14, x34, x6, x35, x15, x37, x7, x38, x18, x21, x24, x27, x30, x33, x36, x39, x40, x41, x42, x43, x44, x45, x46, x47; /*skip*/ x0 = _br2_load((in1)+((uintptr_t)0ULL), sizeof(uintptr_t)); x1 = _br2_load((in1)+((uintptr_t)4ULL), sizeof(uintptr_t)); x2 = _br2_load((in1)+((uintptr_t)8ULL), sizeof(uintptr_t)); x3 = _br2_load((in1)+((uintptr_t)12ULL), sizeof(uintptr_t)); x4 = _br2_load((in1)+((uintptr_t)16ULL), sizeof(uintptr_t)); x5 = _br2_load((in1)+((uintptr_t)20ULL), sizeof(uintptr_t)); x6 = _br2_load((in1)+((uintptr_t)24ULL), sizeof(uintptr_t)); x7 = _br2_load((in1)+((uintptr_t)28ULL), sizeof(uintptr_t)); /*skip*/ x8 = _br2_load((in2)+((uintptr_t)0ULL), sizeof(uintptr_t)); x9 = _br2_load((in2)+((uintptr_t)4ULL), sizeof(uintptr_t)); x10 = _br2_load((in2)+((uintptr_t)8ULL), sizeof(uintptr_t)); x11 = _br2_load((in2)+((uintptr_t)12ULL), sizeof(uintptr_t)); x12 = _br2_load((in2)+((uintptr_t)16ULL), sizeof(uintptr_t)); x13 = _br2_load((in2)+((uintptr_t)20ULL), sizeof(uintptr_t)); x14 = _br2_load((in2)+((uintptr_t)24ULL), sizeof(uintptr_t)); x15 = _br2_load((in2)+((uintptr_t)28ULL), sizeof(uintptr_t)); /*skip*/ /*skip*/ x16 = ((uintptr_t)-1ULL)+((in0)==((uintptr_t)0ULL)); x17 = (x16)^((uintptr_t)4294967295ULL); x18 = ((x8)&(x16))|((x0)&(x17)); x19 = ((uintptr_t)-1ULL)+((in0)==((uintptr_t)0ULL)); x20 = (x19)^((uintptr_t)4294967295ULL); x21 = ((x9)&(x19))|((x1)&(x20)); x22 = ((uintptr_t)-1ULL)+((in0)==((uintptr_t)0ULL)); x23 = (x22)^((uintptr_t)4294967295ULL); x24 = ((x10)&(x22))|((x2)&(x23)); x25 = ((uintptr_t)-1ULL)+((in0)==((uintptr_t)0ULL)); x26 = (x25)^((uintptr_t)4294967295ULL); x27 = ((x11)&(x25))|((x3)&(x26)); x28 = ((uintptr_t)-1ULL)+((in0)==((uintptr_t)0ULL)); x29 = (x28)^((uintptr_t)4294967295ULL); x30 = ((x12)&(x28))|((x4)&(x29)); x31 = ((uintptr_t)-1ULL)+((in0)==((uintptr_t)0ULL)); x32 = (x31)^((uintptr_t)4294967295ULL); x33 = ((x13)&(x31))|((x5)&(x32)); x34 = ((uintptr_t)-1ULL)+((in0)==((uintptr_t)0ULL)); x35 = (x34)^((uintptr_t)4294967295ULL); x36 = ((x14)&(x34))|((x6)&(x35)); x37 = ((uintptr_t)-1ULL)+((in0)==((uintptr_t)0ULL)); x38 = (x37)^((uintptr_t)4294967295ULL); x39 = ((x15)&(x37))|((x7)&(x38)); x40 = x18; x41 = x21; x42 = x24; x43 = x27; x44 = x30; x45 = x33; x46 = x36; x47 = x39; /*skip*/ _br2_store((out0)+((uintptr_t)0ULL), x40, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)4ULL), x41, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)8ULL), x42, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)12ULL), x43, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)16ULL), x44, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)20ULL), x45, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)24ULL), x46, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)28ULL), x47, sizeof(uintptr_t)); /*skip*/ return; } /* NOTE: The following wrapper function is not covered by Coq proofs */ static void fiat_p256_selectznz(uint32_t out1[8], uint8_t arg1, const uint32_t arg2[8], const uint32_t arg3[8]) { internal_fiat_p256_selectznz((uintptr_t)out1, (uintptr_t)arg1, (uintptr_t)arg2, (uintptr_t)arg3); } /* * Input Bounds: * in0: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * Output Bounds: * out0: [[0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff]] */ static void internal_fiat_p256_to_bytes(uintptr_t out0, uintptr_t in0) { uintptr_t x7, x6, x5, x4, x3, x2, x1, x0, x15, x17, x19, x14, x23, x25, x13, x29, x31, x12, x35, x37, x11, x41, x43, x10, x47, x49, x9, x53, x55, x8, x59, x61, x16, x18, x20, x21, x22, x24, x26, x27, x28, x30, x32, x33, x34, x36, x38, x39, x40, x42, x44, x45, x46, x48, x50, x51, x52, x54, x56, x57, x58, x60, x62, x63, x64, x65, x66, x67, x68, x69, x70, x71, x72, x73, x74, x75, x76, x77, x78, x79, x80, x81, x82, x83, x84, x85, x86, x87, x88, x89, x90, x91, x92, x93, x94, x95; x0 = _br2_load((in0)+((uintptr_t)0ULL), sizeof(uintptr_t)); x1 = _br2_load((in0)+((uintptr_t)4ULL), sizeof(uintptr_t)); x2 = _br2_load((in0)+((uintptr_t)8ULL), sizeof(uintptr_t)); x3 = _br2_load((in0)+((uintptr_t)12ULL), sizeof(uintptr_t)); x4 = _br2_load((in0)+((uintptr_t)16ULL), sizeof(uintptr_t)); x5 = _br2_load((in0)+((uintptr_t)20ULL), sizeof(uintptr_t)); x6 = _br2_load((in0)+((uintptr_t)24ULL), sizeof(uintptr_t)); x7 = _br2_load((in0)+((uintptr_t)28ULL), sizeof(uintptr_t)); /*skip*/ /*skip*/ x8 = x7; x9 = x6; x10 = x5; x11 = x4; x12 = x3; x13 = x2; x14 = x1; x15 = x0; x16 = (x15)&((uintptr_t)255ULL); x17 = (x15)>>((uintptr_t)8ULL); x18 = (x17)&((uintptr_t)255ULL); x19 = (x17)>>((uintptr_t)8ULL); x20 = (x19)&((uintptr_t)255ULL); x21 = (x19)>>((uintptr_t)8ULL); x22 = (x14)&((uintptr_t)255ULL); x23 = (x14)>>((uintptr_t)8ULL); x24 = (x23)&((uintptr_t)255ULL); x25 = (x23)>>((uintptr_t)8ULL); x26 = (x25)&((uintptr_t)255ULL); x27 = (x25)>>((uintptr_t)8ULL); x28 = (x13)&((uintptr_t)255ULL); x29 = (x13)>>((uintptr_t)8ULL); x30 = (x29)&((uintptr_t)255ULL); x31 = (x29)>>((uintptr_t)8ULL); x32 = (x31)&((uintptr_t)255ULL); x33 = (x31)>>((uintptr_t)8ULL); x34 = (x12)&((uintptr_t)255ULL); x35 = (x12)>>((uintptr_t)8ULL); x36 = (x35)&((uintptr_t)255ULL); x37 = (x35)>>((uintptr_t)8ULL); x38 = (x37)&((uintptr_t)255ULL); x39 = (x37)>>((uintptr_t)8ULL); x40 = (x11)&((uintptr_t)255ULL); x41 = (x11)>>((uintptr_t)8ULL); x42 = (x41)&((uintptr_t)255ULL); x43 = (x41)>>((uintptr_t)8ULL); x44 = (x43)&((uintptr_t)255ULL); x45 = (x43)>>((uintptr_t)8ULL); x46 = (x10)&((uintptr_t)255ULL); x47 = (x10)>>((uintptr_t)8ULL); x48 = (x47)&((uintptr_t)255ULL); x49 = (x47)>>((uintptr_t)8ULL); x50 = (x49)&((uintptr_t)255ULL); x51 = (x49)>>((uintptr_t)8ULL); x52 = (x9)&((uintptr_t)255ULL); x53 = (x9)>>((uintptr_t)8ULL); x54 = (x53)&((uintptr_t)255ULL); x55 = (x53)>>((uintptr_t)8ULL); x56 = (x55)&((uintptr_t)255ULL); x57 = (x55)>>((uintptr_t)8ULL); x58 = (x8)&((uintptr_t)255ULL); x59 = (x8)>>((uintptr_t)8ULL); x60 = (x59)&((uintptr_t)255ULL); x61 = (x59)>>((uintptr_t)8ULL); x62 = (x61)&((uintptr_t)255ULL); x63 = (x61)>>((uintptr_t)8ULL); x64 = x16; x65 = x18; x66 = x20; x67 = x21; x68 = x22; x69 = x24; x70 = x26; x71 = x27; x72 = x28; x73 = x30; x74 = x32; x75 = x33; x76 = x34; x77 = x36; x78 = x38; x79 = x39; x80 = x40; x81 = x42; x82 = x44; x83 = x45; x84 = x46; x85 = x48; x86 = x50; x87 = x51; x88 = x52; x89 = x54; x90 = x56; x91 = x57; x92 = x58; x93 = x60; x94 = x62; x95 = x63; /*skip*/ _br2_store((out0)+((uintptr_t)0ULL), x64, 1); _br2_store((out0)+((uintptr_t)1ULL), x65, 1); _br2_store((out0)+((uintptr_t)2ULL), x66, 1); _br2_store((out0)+((uintptr_t)3ULL), x67, 1); _br2_store((out0)+((uintptr_t)4ULL), x68, 1); _br2_store((out0)+((uintptr_t)5ULL), x69, 1); _br2_store((out0)+((uintptr_t)6ULL), x70, 1); _br2_store((out0)+((uintptr_t)7ULL), x71, 1); _br2_store((out0)+((uintptr_t)8ULL), x72, 1); _br2_store((out0)+((uintptr_t)9ULL), x73, 1); _br2_store((out0)+((uintptr_t)10ULL), x74, 1); _br2_store((out0)+((uintptr_t)11ULL), x75, 1); _br2_store((out0)+((uintptr_t)12ULL), x76, 1); _br2_store((out0)+((uintptr_t)13ULL), x77, 1); _br2_store((out0)+((uintptr_t)14ULL), x78, 1); _br2_store((out0)+((uintptr_t)15ULL), x79, 1); _br2_store((out0)+((uintptr_t)16ULL), x80, 1); _br2_store((out0)+((uintptr_t)17ULL), x81, 1); _br2_store((out0)+((uintptr_t)18ULL), x82, 1); _br2_store((out0)+((uintptr_t)19ULL), x83, 1); _br2_store((out0)+((uintptr_t)20ULL), x84, 1); _br2_store((out0)+((uintptr_t)21ULL), x85, 1); _br2_store((out0)+((uintptr_t)22ULL), x86, 1); _br2_store((out0)+((uintptr_t)23ULL), x87, 1); _br2_store((out0)+((uintptr_t)24ULL), x88, 1); _br2_store((out0)+((uintptr_t)25ULL), x89, 1); _br2_store((out0)+((uintptr_t)26ULL), x90, 1); _br2_store((out0)+((uintptr_t)27ULL), x91, 1); _br2_store((out0)+((uintptr_t)28ULL), x92, 1); _br2_store((out0)+((uintptr_t)29ULL), x93, 1); _br2_store((out0)+((uintptr_t)30ULL), x94, 1); _br2_store((out0)+((uintptr_t)31ULL), x95, 1); /*skip*/ return; } /* NOTE: The following wrapper function is not covered by Coq proofs */ static void fiat_p256_to_bytes(uint8_t out1[32], const uint32_t arg1[8]) { internal_fiat_p256_to_bytes((uintptr_t)out1, (uintptr_t)arg1); } /* * Input Bounds: * in0: [[0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff]] * Output Bounds: * out0: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] */ static void internal_fiat_p256_from_bytes(uintptr_t out0, uintptr_t in0) { uintptr_t x31, x30, x29, x28, x27, x26, x25, x24, x23, x22, x21, x20, x19, x18, x17, x16, x15, x14, x13, x12, x11, x10, x9, x8, x7, x6, x5, x4, x3, x2, x1, x0, x62, x63, x61, x64, x60, x65, x58, x59, x57, x67, x56, x68, x54, x55, x53, x70, x52, x71, x50, x51, x49, x73, x48, x74, x46, x47, x45, x76, x44, x77, x42, x43, x41, x79, x40, x80, x38, x39, x37, x82, x36, x83, x34, x35, x33, x85, x32, x86, x66, x69, x72, x75, x78, x81, x84, x87, x88, x89, x90, x91, x92, x93, x94, x95; x0 = _br2_load((in0)+((uintptr_t)0ULL), 1); x1 = _br2_load((in0)+((uintptr_t)1ULL), 1); x2 = _br2_load((in0)+((uintptr_t)2ULL), 1); x3 = _br2_load((in0)+((uintptr_t)3ULL), 1); x4 = _br2_load((in0)+((uintptr_t)4ULL), 1); x5 = _br2_load((in0)+((uintptr_t)5ULL), 1); x6 = _br2_load((in0)+((uintptr_t)6ULL), 1); x7 = _br2_load((in0)+((uintptr_t)7ULL), 1); x8 = _br2_load((in0)+((uintptr_t)8ULL), 1); x9 = _br2_load((in0)+((uintptr_t)9ULL), 1); x10 = _br2_load((in0)+((uintptr_t)10ULL), 1); x11 = _br2_load((in0)+((uintptr_t)11ULL), 1); x12 = _br2_load((in0)+((uintptr_t)12ULL), 1); x13 = _br2_load((in0)+((uintptr_t)13ULL), 1); x14 = _br2_load((in0)+((uintptr_t)14ULL), 1); x15 = _br2_load((in0)+((uintptr_t)15ULL), 1); x16 = _br2_load((in0)+((uintptr_t)16ULL), 1); x17 = _br2_load((in0)+((uintptr_t)17ULL), 1); x18 = _br2_load((in0)+((uintptr_t)18ULL), 1); x19 = _br2_load((in0)+((uintptr_t)19ULL), 1); x20 = _br2_load((in0)+((uintptr_t)20ULL), 1); x21 = _br2_load((in0)+((uintptr_t)21ULL), 1); x22 = _br2_load((in0)+((uintptr_t)22ULL), 1); x23 = _br2_load((in0)+((uintptr_t)23ULL), 1); x24 = _br2_load((in0)+((uintptr_t)24ULL), 1); x25 = _br2_load((in0)+((uintptr_t)25ULL), 1); x26 = _br2_load((in0)+((uintptr_t)26ULL), 1); x27 = _br2_load((in0)+((uintptr_t)27ULL), 1); x28 = _br2_load((in0)+((uintptr_t)28ULL), 1); x29 = _br2_load((in0)+((uintptr_t)29ULL), 1); x30 = _br2_load((in0)+((uintptr_t)30ULL), 1); x31 = _br2_load((in0)+((uintptr_t)31ULL), 1); /*skip*/ /*skip*/ x32 = (x31)<<((uintptr_t)24ULL); x33 = (x30)<<((uintptr_t)16ULL); x34 = (x29)<<((uintptr_t)8ULL); x35 = x28; x36 = (x27)<<((uintptr_t)24ULL); x37 = (x26)<<((uintptr_t)16ULL); x38 = (x25)<<((uintptr_t)8ULL); x39 = x24; x40 = (x23)<<((uintptr_t)24ULL); x41 = (x22)<<((uintptr_t)16ULL); x42 = (x21)<<((uintptr_t)8ULL); x43 = x20; x44 = (x19)<<((uintptr_t)24ULL); x45 = (x18)<<((uintptr_t)16ULL); x46 = (x17)<<((uintptr_t)8ULL); x47 = x16; x48 = (x15)<<((uintptr_t)24ULL); x49 = (x14)<<((uintptr_t)16ULL); x50 = (x13)<<((uintptr_t)8ULL); x51 = x12; x52 = (x11)<<((uintptr_t)24ULL); x53 = (x10)<<((uintptr_t)16ULL); x54 = (x9)<<((uintptr_t)8ULL); x55 = x8; x56 = (x7)<<((uintptr_t)24ULL); x57 = (x6)<<((uintptr_t)16ULL); x58 = (x5)<<((uintptr_t)8ULL); x59 = x4; x60 = (x3)<<((uintptr_t)24ULL); x61 = (x2)<<((uintptr_t)16ULL); x62 = (x1)<<((uintptr_t)8ULL); x63 = x0; x64 = (x62)+(x63); x65 = (x61)+(x64); x66 = (x60)+(x65); x67 = (x58)+(x59); x68 = (x57)+(x67); x69 = (x56)+(x68); x70 = (x54)+(x55); x71 = (x53)+(x70); x72 = (x52)+(x71); x73 = (x50)+(x51); x74 = (x49)+(x73); x75 = (x48)+(x74); x76 = (x46)+(x47); x77 = (x45)+(x76); x78 = (x44)+(x77); x79 = (x42)+(x43); x80 = (x41)+(x79); x81 = (x40)+(x80); x82 = (x38)+(x39); x83 = (x37)+(x82); x84 = (x36)+(x83); x85 = (x34)+(x35); x86 = (x33)+(x85); x87 = (x32)+(x86); x88 = x66; x89 = x69; x90 = x72; x91 = x75; x92 = x78; x93 = x81; x94 = x84; x95 = x87; /*skip*/ _br2_store((out0)+((uintptr_t)0ULL), x88, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)4ULL), x89, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)8ULL), x90, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)12ULL), x91, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)16ULL), x92, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)20ULL), x93, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)24ULL), x94, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)28ULL), x95, sizeof(uintptr_t)); /*skip*/ return; } /* NOTE: The following wrapper function is not covered by Coq proofs */ static void fiat_p256_from_bytes(uint32_t out1[8], const uint8_t arg1[32]) { internal_fiat_p256_from_bytes((uintptr_t)out1, (uintptr_t)arg1); } /* * Input Bounds: * Output Bounds: * out0: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] */ static void internal_fiat_p256_set_one(uintptr_t out0) { uintptr_t x0, x1, x2, x3, x4, x5, x6, x7; /*skip*/ x0 = (uintptr_t)1ULL; x1 = (uintptr_t)0ULL; x2 = (uintptr_t)0ULL; x3 = (uintptr_t)4294967295ULL; x4 = (uintptr_t)4294967295ULL; x5 = (uintptr_t)4294967295ULL; x6 = (uintptr_t)4294967294ULL; x7 = (uintptr_t)0ULL; /*skip*/ _br2_store((out0)+((uintptr_t)0ULL), x0, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)4ULL), x1, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)8ULL), x2, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)12ULL), x3, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)16ULL), x4, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)20ULL), x5, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)24ULL), x6, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)28ULL), x7, sizeof(uintptr_t)); /*skip*/ return; } /* NOTE: The following wrapper function is not covered by Coq proofs */ static void fiat_p256_set_one(uint32_t out1[8]) { internal_fiat_p256_set_one((uintptr_t)out1); } /* * Input Bounds: * Output Bounds: * out0: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] */ static void internal_fiat_p256_msat(uintptr_t out0) { uintptr_t x0, x1, x2, x3, x4, x5, x6, x7, x8; /*skip*/ x0 = (uintptr_t)4294967295ULL; x1 = (uintptr_t)4294967295ULL; x2 = (uintptr_t)4294967295ULL; x3 = (uintptr_t)0ULL; x4 = (uintptr_t)0ULL; x5 = (uintptr_t)0ULL; x6 = (uintptr_t)1ULL; x7 = (uintptr_t)4294967295ULL; x8 = (uintptr_t)0ULL; /*skip*/ _br2_store((out0)+((uintptr_t)0ULL), x0, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)4ULL), x1, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)8ULL), x2, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)12ULL), x3, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)16ULL), x4, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)20ULL), x5, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)24ULL), x6, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)28ULL), x7, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)32ULL), x8, sizeof(uintptr_t)); /*skip*/ return; } /* NOTE: The following wrapper function is not covered by Coq proofs */ static void fiat_p256_msat(uint32_t out1[9]) { internal_fiat_p256_msat((uintptr_t)out1); } /* * Input Bounds: * in0: [0x0 ~> 0xffffffff] * in1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * in2: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * in3: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * in4: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * Output Bounds: * out0: [0x0 ~> 0xffffffff] * out1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * out2: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * out3: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * out4: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] */ static uintptr_t internal_fiat_p256_divstep(uintptr_t out1, uintptr_t out2, uintptr_t out3, uintptr_t out4, uintptr_t in0, uintptr_t in1, uintptr_t in2, uintptr_t in3, uintptr_t in4) { uintptr_t x34, x36, x37, x38, x40, x41, x43, x44, x46, x47, x49, x50, x52, x53, x55, x56, x58, x59, x61, x62, x64, x65, x0, x68, x1, x70, x2, x72, x3, x74, x4, x76, x5, x78, x6, x80, x7, x82, x8, x67, x84, x9, x85, x69, x87, x10, x88, x71, x90, x11, x91, x73, x93, x12, x94, x75, x96, x13, x97, x77, x99, x14, x100, x79, x102, x15, x103, x81, x105, x16, x106, x83, x108, x17, x109, x111, x112, x114, x115, x117, x118, x120, x121, x123, x124, x126, x127, x129, x130, x132, x133, x136, x137, x138, x140, x141, x142, x143, x145, x146, x147, x148, x150, x151, x152, x153, x155, x156, x157, x158, x160, x161, x162, x163, x165, x166, x167, x168, x170, x173, x174, x175, x177, x178, x179, x180, x182, x183, x185, x187, x189, x190, x191, x193, x194, x195, x196, x198, x199, x171, x200, x25, x24, x23, x22, x21, x20, x19, x18, x210, x208, x211, x213, x214, x207, x215, x217, x218, x206, x219, x221, x222, x205, x223, x225, x226, x204, x227, x229, x230, x203, x231, x233, x234, x202, x235, x237, x238, x209, x241, x212, x242, x243, x245, x246, x216, x247, x248, x250, x251, x220, x253, x224, x255, x228, x257, x232, x258, x259, x261, x262, x236, x263, x239, x240, x265, x26, x266, x244, x268, x27, x269, x249, x271, x28, x272, x252, x274, x29, x275, x254, x277, x30, x278, x256, x280, x31, x281, x260, x283, x32, x284, x35, x264, x286, x33, x287, x290, x291, x293, x294, x296, x297, x299, x300, x302, x303, x305, x306, x308, x309, x311, x312, x314, x315, x292, x86, x318, x89, x319, x295, x320, x322, x323, x92, x324, x298, x325, x327, x328, x95, x329, x301, x330, x332, x333, x98, x334, x304, x335, x337, x338, x101, x339, x307, x340, x342, x343, x104, x344, x310, x345, x347, x348, x107, x349, x313, x350, x352, x353, x110, x354, x316, x113, x356, x357, x116, x359, x360, x119, x362, x363, x122, x365, x366, x125, x368, x369, x128, x371, x372, x131, x374, x375, x289, x134, x377, x378, x358, x267, x381, x270, x382, x361, x383, x385, x386, x273, x387, x364, x388, x390, x391, x276, x392, x367, x393, x395, x396, x279, x397, x370, x398, x400, x401, x282, x402, x373, x403, x405, x406, x285, x407, x376, x408, x410, x411, x288, x412, x379, x413, x415, x418, x419, x420, x422, x423, x424, x425, x427, x428, x430, x432, x434, x435, x436, x438, x439, x440, x441, x443, x444, x416, x445, x39, x317, x321, x326, x331, x336, x341, x346, x351, x355, x135, x457, x172, x458, x139, x460, x176, x461, x144, x463, x181, x464, x149, x466, x184, x467, x154, x469, x186, x470, x159, x472, x188, x473, x164, x475, x192, x476, x201, x169, x478, x197, x479, x380, x481, x417, x482, x384, x484, x421, x485, x389, x487, x426, x488, x394, x490, x429, x491, x399, x493, x431, x494, x404, x496, x433, x497, x409, x499, x437, x500, x446, x414, x502, x442, x503, x447, x42, x45, x48, x51, x54, x57, x60, x63, x66, x448, x449, x450, x451, x452, x453, x454, x455, x456, x459, x462, x465, x468, x471, x474, x477, x480, x483, x486, x489, x492, x495, x498, x501, x504, out0, x505, x506, x507, x508, x509, x510, x511, x512, x513, x514, x515, x516, x517, x518, x519, x520, x521, x522, x523, x524, x525, x526, x527, x528, x529, x530, x531, x532, x533, x534, x535, x536, x537, x538, x539; /*skip*/ x0 = _br2_load((in1)+((uintptr_t)0ULL), sizeof(uintptr_t)); x1 = _br2_load((in1)+((uintptr_t)4ULL), sizeof(uintptr_t)); x2 = _br2_load((in1)+((uintptr_t)8ULL), sizeof(uintptr_t)); x3 = _br2_load((in1)+((uintptr_t)12ULL), sizeof(uintptr_t)); x4 = _br2_load((in1)+((uintptr_t)16ULL), sizeof(uintptr_t)); x5 = _br2_load((in1)+((uintptr_t)20ULL), sizeof(uintptr_t)); x6 = _br2_load((in1)+((uintptr_t)24ULL), sizeof(uintptr_t)); x7 = _br2_load((in1)+((uintptr_t)28ULL), sizeof(uintptr_t)); x8 = _br2_load((in1)+((uintptr_t)32ULL), sizeof(uintptr_t)); /*skip*/ x9 = _br2_load((in2)+((uintptr_t)0ULL), sizeof(uintptr_t)); x10 = _br2_load((in2)+((uintptr_t)4ULL), sizeof(uintptr_t)); x11 = _br2_load((in2)+((uintptr_t)8ULL), sizeof(uintptr_t)); x12 = _br2_load((in2)+((uintptr_t)12ULL), sizeof(uintptr_t)); x13 = _br2_load((in2)+((uintptr_t)16ULL), sizeof(uintptr_t)); x14 = _br2_load((in2)+((uintptr_t)20ULL), sizeof(uintptr_t)); x15 = _br2_load((in2)+((uintptr_t)24ULL), sizeof(uintptr_t)); x16 = _br2_load((in2)+((uintptr_t)28ULL), sizeof(uintptr_t)); x17 = _br2_load((in2)+((uintptr_t)32ULL), sizeof(uintptr_t)); /*skip*/ x18 = _br2_load((in3)+((uintptr_t)0ULL), sizeof(uintptr_t)); x19 = _br2_load((in3)+((uintptr_t)4ULL), sizeof(uintptr_t)); x20 = _br2_load((in3)+((uintptr_t)8ULL), sizeof(uintptr_t)); x21 = _br2_load((in3)+((uintptr_t)12ULL), sizeof(uintptr_t)); x22 = _br2_load((in3)+((uintptr_t)16ULL), sizeof(uintptr_t)); x23 = _br2_load((in3)+((uintptr_t)20ULL), sizeof(uintptr_t)); x24 = _br2_load((in3)+((uintptr_t)24ULL), sizeof(uintptr_t)); x25 = _br2_load((in3)+((uintptr_t)28ULL), sizeof(uintptr_t)); /*skip*/ x26 = _br2_load((in4)+((uintptr_t)0ULL), sizeof(uintptr_t)); x27 = _br2_load((in4)+((uintptr_t)4ULL), sizeof(uintptr_t)); x28 = _br2_load((in4)+((uintptr_t)8ULL), sizeof(uintptr_t)); x29 = _br2_load((in4)+((uintptr_t)12ULL), sizeof(uintptr_t)); x30 = _br2_load((in4)+((uintptr_t)16ULL), sizeof(uintptr_t)); x31 = _br2_load((in4)+((uintptr_t)20ULL), sizeof(uintptr_t)); x32 = _br2_load((in4)+((uintptr_t)24ULL), sizeof(uintptr_t)); x33 = _br2_load((in4)+((uintptr_t)28ULL), sizeof(uintptr_t)); /*skip*/ /*skip*/ x34 = ((in0)^((uintptr_t)4294967295ULL))+((uintptr_t)1ULL); x35 = ((x34)>>((uintptr_t)31ULL))&((x9)&((uintptr_t)1ULL)); x36 = ((in0)^((uintptr_t)4294967295ULL))+((uintptr_t)1ULL); x37 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x38 = (x37)^((uintptr_t)4294967295ULL); x39 = ((x36)&(x37))|((in0)&(x38)); x40 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x41 = (x40)^((uintptr_t)4294967295ULL); x42 = ((x9)&(x40))|((x0)&(x41)); x43 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x44 = (x43)^((uintptr_t)4294967295ULL); x45 = ((x10)&(x43))|((x1)&(x44)); x46 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x47 = (x46)^((uintptr_t)4294967295ULL); x48 = ((x11)&(x46))|((x2)&(x47)); x49 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x50 = (x49)^((uintptr_t)4294967295ULL); x51 = ((x12)&(x49))|((x3)&(x50)); x52 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x53 = (x52)^((uintptr_t)4294967295ULL); x54 = ((x13)&(x52))|((x4)&(x53)); x55 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x56 = (x55)^((uintptr_t)4294967295ULL); x57 = ((x14)&(x55))|((x5)&(x56)); x58 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x59 = (x58)^((uintptr_t)4294967295ULL); x60 = ((x15)&(x58))|((x6)&(x59)); x61 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x62 = (x61)^((uintptr_t)4294967295ULL); x63 = ((x16)&(x61))|((x7)&(x62)); x64 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x65 = (x64)^((uintptr_t)4294967295ULL); x66 = ((x17)&(x64))|((x8)&(x65)); x67 = ((uintptr_t)1ULL)+((x0)^((uintptr_t)4294967295ULL)); x68 = (x67)<((uintptr_t)1ULL); x69 = (x68)+((x1)^((uintptr_t)4294967295ULL)); x70 = (x69)<((x1)^((uintptr_t)4294967295ULL)); x71 = (x70)+((x2)^((uintptr_t)4294967295ULL)); x72 = (x71)<((x2)^((uintptr_t)4294967295ULL)); x73 = (x72)+((x3)^((uintptr_t)4294967295ULL)); x74 = (x73)<((x3)^((uintptr_t)4294967295ULL)); x75 = (x74)+((x4)^((uintptr_t)4294967295ULL)); x76 = (x75)<((x4)^((uintptr_t)4294967295ULL)); x77 = (x76)+((x5)^((uintptr_t)4294967295ULL)); x78 = (x77)<((x5)^((uintptr_t)4294967295ULL)); x79 = (x78)+((x6)^((uintptr_t)4294967295ULL)); x80 = (x79)<((x6)^((uintptr_t)4294967295ULL)); x81 = (x80)+((x7)^((uintptr_t)4294967295ULL)); x82 = (x81)<((x7)^((uintptr_t)4294967295ULL)); x83 = (x82)+((x8)^((uintptr_t)4294967295ULL)); x84 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x85 = (x84)^((uintptr_t)4294967295ULL); x86 = ((x67)&(x84))|((x9)&(x85)); x87 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x88 = (x87)^((uintptr_t)4294967295ULL); x89 = ((x69)&(x87))|((x10)&(x88)); x90 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x91 = (x90)^((uintptr_t)4294967295ULL); x92 = ((x71)&(x90))|((x11)&(x91)); x93 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x94 = (x93)^((uintptr_t)4294967295ULL); x95 = ((x73)&(x93))|((x12)&(x94)); x96 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x97 = (x96)^((uintptr_t)4294967295ULL); x98 = ((x75)&(x96))|((x13)&(x97)); x99 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x100 = (x99)^((uintptr_t)4294967295ULL); x101 = ((x77)&(x99))|((x14)&(x100)); x102 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x103 = (x102)^((uintptr_t)4294967295ULL); x104 = ((x79)&(x102))|((x15)&(x103)); x105 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x106 = (x105)^((uintptr_t)4294967295ULL); x107 = ((x81)&(x105))|((x16)&(x106)); x108 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x109 = (x108)^((uintptr_t)4294967295ULL); x110 = ((x83)&(x108))|((x17)&(x109)); x111 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x112 = (x111)^((uintptr_t)4294967295ULL); x113 = ((x26)&(x111))|((x18)&(x112)); x114 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x115 = (x114)^((uintptr_t)4294967295ULL); x116 = ((x27)&(x114))|((x19)&(x115)); x117 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x118 = (x117)^((uintptr_t)4294967295ULL); x119 = ((x28)&(x117))|((x20)&(x118)); x120 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x121 = (x120)^((uintptr_t)4294967295ULL); x122 = ((x29)&(x120))|((x21)&(x121)); x123 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x124 = (x123)^((uintptr_t)4294967295ULL); x125 = ((x30)&(x123))|((x22)&(x124)); x126 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x127 = (x126)^((uintptr_t)4294967295ULL); x128 = ((x31)&(x126))|((x23)&(x127)); x129 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x130 = (x129)^((uintptr_t)4294967295ULL); x131 = ((x32)&(x129))|((x24)&(x130)); x132 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x133 = (x132)^((uintptr_t)4294967295ULL); x134 = ((x33)&(x132))|((x25)&(x133)); x135 = (x113)+(x113); x136 = (x135)<(x113); x137 = (x136)+(x116); x138 = (x137)<(x116); x139 = (x137)+(x116); x140 = (x139)<(x116); x141 = (x138)+(x140); x142 = (x141)+(x119); x143 = (x142)<(x119); x144 = (x142)+(x119); x145 = (x144)<(x119); x146 = (x143)+(x145); x147 = (x146)+(x122); x148 = (x147)<(x122); x149 = (x147)+(x122); x150 = (x149)<(x122); x151 = (x148)+(x150); x152 = (x151)+(x125); x153 = (x152)<(x125); x154 = (x152)+(x125); x155 = (x154)<(x125); x156 = (x153)+(x155); x157 = (x156)+(x128); x158 = (x157)<(x128); x159 = (x157)+(x128); x160 = (x159)<(x128); x161 = (x158)+(x160); x162 = (x161)+(x131); x163 = (x162)<(x131); x164 = (x162)+(x131); x165 = (x164)<(x131); x166 = (x163)+(x165); x167 = (x166)+(x134); x168 = (x167)<(x134); x169 = (x167)+(x134); x170 = (x169)<(x134); x171 = (x168)+(x170); x172 = (x135)-((uintptr_t)4294967295ULL); x173 = (x135)<(x172); x174 = (x139)-((uintptr_t)4294967295ULL); x175 = (x139)<(x174); x176 = (x174)-(x173); x177 = (x174)<(x176); x178 = (x175)+(x177); x179 = (x144)-((uintptr_t)4294967295ULL); x180 = (x144)<(x179); x181 = (x179)-(x178); x182 = (x179)<(x181); x183 = (x180)+(x182); x184 = (x149)-(x183); x185 = (x149)<(x184); x186 = (x154)-(x185); x187 = (x154)<(x186); x188 = (x159)-(x187); x189 = (x159)<(x188); x190 = (x164)-((uintptr_t)1ULL); x191 = (x164)<(x190); x192 = (x190)-(x189); x193 = (x190)<(x192); x194 = (x191)+(x193); x195 = (x169)-((uintptr_t)4294967295ULL); x196 = (x169)<(x195); x197 = (x195)-(x194); x198 = (x195)<(x197); x199 = (x196)+(x198); x200 = (x171)-(x199); x201 = (x171)<(x200); x202 = x25; x203 = x24; x204 = x23; x205 = x22; x206 = x21; x207 = x20; x208 = x19; x209 = x18; x210 = ((uintptr_t)0ULL)<(((uintptr_t)0ULL)-(x209)); x211 = ((uintptr_t)0ULL)<(((uintptr_t)0ULL)-(x208)); x212 = (((uintptr_t)0ULL)-(x208))-(x210); x213 = (((uintptr_t)0ULL)-(x208))<(x212); x214 = (x211)+(x213); x215 = ((uintptr_t)0ULL)<(((uintptr_t)0ULL)-(x207)); x216 = (((uintptr_t)0ULL)-(x207))-(x214); x217 = (((uintptr_t)0ULL)-(x207))<(x216); x218 = (x215)+(x217); x219 = ((uintptr_t)0ULL)<(((uintptr_t)0ULL)-(x206)); x220 = (((uintptr_t)0ULL)-(x206))-(x218); x221 = (((uintptr_t)0ULL)-(x206))<(x220); x222 = (x219)+(x221); x223 = ((uintptr_t)0ULL)<(((uintptr_t)0ULL)-(x205)); x224 = (((uintptr_t)0ULL)-(x205))-(x222); x225 = (((uintptr_t)0ULL)-(x205))<(x224); x226 = (x223)+(x225); x227 = ((uintptr_t)0ULL)<(((uintptr_t)0ULL)-(x204)); x228 = (((uintptr_t)0ULL)-(x204))-(x226); x229 = (((uintptr_t)0ULL)-(x204))<(x228); x230 = (x227)+(x229); x231 = ((uintptr_t)0ULL)<(((uintptr_t)0ULL)-(x203)); x232 = (((uintptr_t)0ULL)-(x203))-(x230); x233 = (((uintptr_t)0ULL)-(x203))<(x232); x234 = (x231)+(x233); x235 = ((uintptr_t)0ULL)<(((uintptr_t)0ULL)-(x202)); x236 = (((uintptr_t)0ULL)-(x202))-(x234); x237 = (((uintptr_t)0ULL)-(x202))<(x236); x238 = (x235)+(x237); x239 = ((uintptr_t)-1ULL)+((x238)==((uintptr_t)0ULL)); x240 = (((uintptr_t)0ULL)-(x209))+(x239); x241 = (x240)<(((uintptr_t)0ULL)-(x209)); x242 = (x241)+(x212); x243 = (x242)<(x212); x244 = (x242)+(x239); x245 = (x244)<(x239); x246 = (x243)+(x245); x247 = (x246)+(x216); x248 = (x247)<(x216); x249 = (x247)+(x239); x250 = (x249)<(x239); x251 = (x248)+(x250); x252 = (x251)+(x220); x253 = (x252)<(x220); x254 = (x253)+(x224); x255 = (x254)<(x224); x256 = (x255)+(x228); x257 = (x256)<(x228); x258 = (x257)+(x232); x259 = (x258)<(x232); x260 = (x258)+((x239)&((uintptr_t)1ULL)); x261 = (x260)<((x239)&((uintptr_t)1ULL)); x262 = (x259)+(x261); x263 = (x262)+(x236); x264 = (x263)+(x239); x265 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x266 = (x265)^((uintptr_t)4294967295ULL); x267 = ((x240)&(x265))|((x26)&(x266)); x268 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x269 = (x268)^((uintptr_t)4294967295ULL); x270 = ((x244)&(x268))|((x27)&(x269)); x271 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x272 = (x271)^((uintptr_t)4294967295ULL); x273 = ((x249)&(x271))|((x28)&(x272)); x274 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x275 = (x274)^((uintptr_t)4294967295ULL); x276 = ((x252)&(x274))|((x29)&(x275)); x277 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x278 = (x277)^((uintptr_t)4294967295ULL); x279 = ((x254)&(x277))|((x30)&(x278)); x280 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x281 = (x280)^((uintptr_t)4294967295ULL); x282 = ((x256)&(x280))|((x31)&(x281)); x283 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x284 = (x283)^((uintptr_t)4294967295ULL); x285 = ((x260)&(x283))|((x32)&(x284)); x286 = ((uintptr_t)-1ULL)+((x35)==((uintptr_t)0ULL)); x287 = (x286)^((uintptr_t)4294967295ULL); x288 = ((x264)&(x286))|((x33)&(x287)); x289 = (x86)&((uintptr_t)1ULL); x290 = ((uintptr_t)-1ULL)+((x289)==((uintptr_t)0ULL)); x291 = (x290)^((uintptr_t)4294967295ULL); x292 = ((x42)&(x290))|(((uintptr_t)0ULL)&(x291)); x293 = ((uintptr_t)-1ULL)+((x289)==((uintptr_t)0ULL)); x294 = (x293)^((uintptr_t)4294967295ULL); x295 = ((x45)&(x293))|(((uintptr_t)0ULL)&(x294)); x296 = ((uintptr_t)-1ULL)+((x289)==((uintptr_t)0ULL)); x297 = (x296)^((uintptr_t)4294967295ULL); x298 = ((x48)&(x296))|(((uintptr_t)0ULL)&(x297)); x299 = ((uintptr_t)-1ULL)+((x289)==((uintptr_t)0ULL)); x300 = (x299)^((uintptr_t)4294967295ULL); x301 = ((x51)&(x299))|(((uintptr_t)0ULL)&(x300)); x302 = ((uintptr_t)-1ULL)+((x289)==((uintptr_t)0ULL)); x303 = (x302)^((uintptr_t)4294967295ULL); x304 = ((x54)&(x302))|(((uintptr_t)0ULL)&(x303)); x305 = ((uintptr_t)-1ULL)+((x289)==((uintptr_t)0ULL)); x306 = (x305)^((uintptr_t)4294967295ULL); x307 = ((x57)&(x305))|(((uintptr_t)0ULL)&(x306)); x308 = ((uintptr_t)-1ULL)+((x289)==((uintptr_t)0ULL)); x309 = (x308)^((uintptr_t)4294967295ULL); x310 = ((x60)&(x308))|(((uintptr_t)0ULL)&(x309)); x311 = ((uintptr_t)-1ULL)+((x289)==((uintptr_t)0ULL)); x312 = (x311)^((uintptr_t)4294967295ULL); x313 = ((x63)&(x311))|(((uintptr_t)0ULL)&(x312)); x314 = ((uintptr_t)-1ULL)+((x289)==((uintptr_t)0ULL)); x315 = (x314)^((uintptr_t)4294967295ULL); x316 = ((x66)&(x314))|(((uintptr_t)0ULL)&(x315)); x317 = (x86)+(x292); x318 = (x317)<(x86); x319 = (x318)+(x89); x320 = (x319)<(x89); x321 = (x319)+(x295); x322 = (x321)<(x295); x323 = (x320)+(x322); x324 = (x323)+(x92); x325 = (x324)<(x92); x326 = (x324)+(x298); x327 = (x326)<(x298); x328 = (x325)+(x327); x329 = (x328)+(x95); x330 = (x329)<(x95); x331 = (x329)+(x301); x332 = (x331)<(x301); x333 = (x330)+(x332); x334 = (x333)+(x98); x335 = (x334)<(x98); x336 = (x334)+(x304); x337 = (x336)<(x304); x338 = (x335)+(x337); x339 = (x338)+(x101); x340 = (x339)<(x101); x341 = (x339)+(x307); x342 = (x341)<(x307); x343 = (x340)+(x342); x344 = (x343)+(x104); x345 = (x344)<(x104); x346 = (x344)+(x310); x347 = (x346)<(x310); x348 = (x345)+(x347); x349 = (x348)+(x107); x350 = (x349)<(x107); x351 = (x349)+(x313); x352 = (x351)<(x313); x353 = (x350)+(x352); x354 = (x353)+(x110); x355 = (x354)+(x316); x356 = ((uintptr_t)-1ULL)+((x289)==((uintptr_t)0ULL)); x357 = (x356)^((uintptr_t)4294967295ULL); x358 = ((x113)&(x356))|(((uintptr_t)0ULL)&(x357)); x359 = ((uintptr_t)-1ULL)+((x289)==((uintptr_t)0ULL)); x360 = (x359)^((uintptr_t)4294967295ULL); x361 = ((x116)&(x359))|(((uintptr_t)0ULL)&(x360)); x362 = ((uintptr_t)-1ULL)+((x289)==((uintptr_t)0ULL)); x363 = (x362)^((uintptr_t)4294967295ULL); x364 = ((x119)&(x362))|(((uintptr_t)0ULL)&(x363)); x365 = ((uintptr_t)-1ULL)+((x289)==((uintptr_t)0ULL)); x366 = (x365)^((uintptr_t)4294967295ULL); x367 = ((x122)&(x365))|(((uintptr_t)0ULL)&(x366)); x368 = ((uintptr_t)-1ULL)+((x289)==((uintptr_t)0ULL)); x369 = (x368)^((uintptr_t)4294967295ULL); x370 = ((x125)&(x368))|(((uintptr_t)0ULL)&(x369)); x371 = ((uintptr_t)-1ULL)+((x289)==((uintptr_t)0ULL)); x372 = (x371)^((uintptr_t)4294967295ULL); x373 = ((x128)&(x371))|(((uintptr_t)0ULL)&(x372)); x374 = ((uintptr_t)-1ULL)+((x289)==((uintptr_t)0ULL)); x375 = (x374)^((uintptr_t)4294967295ULL); x376 = ((x131)&(x374))|(((uintptr_t)0ULL)&(x375)); x377 = ((uintptr_t)-1ULL)+((x289)==((uintptr_t)0ULL)); x378 = (x377)^((uintptr_t)4294967295ULL); x379 = ((x134)&(x377))|(((uintptr_t)0ULL)&(x378)); x380 = (x267)+(x358); x381 = (x380)<(x267); x382 = (x381)+(x270); x383 = (x382)<(x270); x384 = (x382)+(x361); x385 = (x384)<(x361); x386 = (x383)+(x385); x387 = (x386)+(x273); x388 = (x387)<(x273); x389 = (x387)+(x364); x390 = (x389)<(x364); x391 = (x388)+(x390); x392 = (x391)+(x276); x393 = (x392)<(x276); x394 = (x392)+(x367); x395 = (x394)<(x367); x396 = (x393)+(x395); x397 = (x396)+(x279); x398 = (x397)<(x279); x399 = (x397)+(x370); x400 = (x399)<(x370); x401 = (x398)+(x400); x402 = (x401)+(x282); x403 = (x402)<(x282); x404 = (x402)+(x373); x405 = (x404)<(x373); x406 = (x403)+(x405); x407 = (x406)+(x285); x408 = (x407)<(x285); x409 = (x407)+(x376); x410 = (x409)<(x376); x411 = (x408)+(x410); x412 = (x411)+(x288); x413 = (x412)<(x288); x414 = (x412)+(x379); x415 = (x414)<(x379); x416 = (x413)+(x415); x417 = (x380)-((uintptr_t)4294967295ULL); x418 = (x380)<(x417); x419 = (x384)-((uintptr_t)4294967295ULL); x420 = (x384)<(x419); x421 = (x419)-(x418); x422 = (x419)<(x421); x423 = (x420)+(x422); x424 = (x389)-((uintptr_t)4294967295ULL); x425 = (x389)<(x424); x426 = (x424)-(x423); x427 = (x424)<(x426); x428 = (x425)+(x427); x429 = (x394)-(x428); x430 = (x394)<(x429); x431 = (x399)-(x430); x432 = (x399)<(x431); x433 = (x404)-(x432); x434 = (x404)<(x433); x435 = (x409)-((uintptr_t)1ULL); x436 = (x409)<(x435); x437 = (x435)-(x434); x438 = (x435)<(x437); x439 = (x436)+(x438); x440 = (x414)-((uintptr_t)4294967295ULL); x441 = (x414)<(x440); x442 = (x440)-(x439); x443 = (x440)<(x442); x444 = (x441)+(x443); x445 = (x416)-(x444); x446 = (x416)<(x445); x447 = (x39)+((uintptr_t)1ULL); x448 = ((x317)>>((uintptr_t)1ULL))|((x321)<<((uintptr_t)31ULL)); x449 = ((x321)>>((uintptr_t)1ULL))|((x326)<<((uintptr_t)31ULL)); x450 = ((x326)>>((uintptr_t)1ULL))|((x331)<<((uintptr_t)31ULL)); x451 = ((x331)>>((uintptr_t)1ULL))|((x336)<<((uintptr_t)31ULL)); x452 = ((x336)>>((uintptr_t)1ULL))|((x341)<<((uintptr_t)31ULL)); x453 = ((x341)>>((uintptr_t)1ULL))|((x346)<<((uintptr_t)31ULL)); x454 = ((x346)>>((uintptr_t)1ULL))|((x351)<<((uintptr_t)31ULL)); x455 = ((x351)>>((uintptr_t)1ULL))|((x355)<<((uintptr_t)31ULL)); x456 = ((x355)&((uintptr_t)2147483648ULL))|((x355)>>((uintptr_t)1ULL)); x457 = ((uintptr_t)-1ULL)+((x201)==((uintptr_t)0ULL)); x458 = (x457)^((uintptr_t)4294967295ULL); x459 = ((x135)&(x457))|((x172)&(x458)); x460 = ((uintptr_t)-1ULL)+((x201)==((uintptr_t)0ULL)); x461 = (x460)^((uintptr_t)4294967295ULL); x462 = ((x139)&(x460))|((x176)&(x461)); x463 = ((uintptr_t)-1ULL)+((x201)==((uintptr_t)0ULL)); x464 = (x463)^((uintptr_t)4294967295ULL); x465 = ((x144)&(x463))|((x181)&(x464)); x466 = ((uintptr_t)-1ULL)+((x201)==((uintptr_t)0ULL)); x467 = (x466)^((uintptr_t)4294967295ULL); x468 = ((x149)&(x466))|((x184)&(x467)); x469 = ((uintptr_t)-1ULL)+((x201)==((uintptr_t)0ULL)); x470 = (x469)^((uintptr_t)4294967295ULL); x471 = ((x154)&(x469))|((x186)&(x470)); x472 = ((uintptr_t)-1ULL)+((x201)==((uintptr_t)0ULL)); x473 = (x472)^((uintptr_t)4294967295ULL); x474 = ((x159)&(x472))|((x188)&(x473)); x475 = ((uintptr_t)-1ULL)+((x201)==((uintptr_t)0ULL)); x476 = (x475)^((uintptr_t)4294967295ULL); x477 = ((x164)&(x475))|((x192)&(x476)); x478 = ((uintptr_t)-1ULL)+((x201)==((uintptr_t)0ULL)); x479 = (x478)^((uintptr_t)4294967295ULL); x480 = ((x169)&(x478))|((x197)&(x479)); x481 = ((uintptr_t)-1ULL)+((x446)==((uintptr_t)0ULL)); x482 = (x481)^((uintptr_t)4294967295ULL); x483 = ((x380)&(x481))|((x417)&(x482)); x484 = ((uintptr_t)-1ULL)+((x446)==((uintptr_t)0ULL)); x485 = (x484)^((uintptr_t)4294967295ULL); x486 = ((x384)&(x484))|((x421)&(x485)); x487 = ((uintptr_t)-1ULL)+((x446)==((uintptr_t)0ULL)); x488 = (x487)^((uintptr_t)4294967295ULL); x489 = ((x389)&(x487))|((x426)&(x488)); x490 = ((uintptr_t)-1ULL)+((x446)==((uintptr_t)0ULL)); x491 = (x490)^((uintptr_t)4294967295ULL); x492 = ((x394)&(x490))|((x429)&(x491)); x493 = ((uintptr_t)-1ULL)+((x446)==((uintptr_t)0ULL)); x494 = (x493)^((uintptr_t)4294967295ULL); x495 = ((x399)&(x493))|((x431)&(x494)); x496 = ((uintptr_t)-1ULL)+((x446)==((uintptr_t)0ULL)); x497 = (x496)^((uintptr_t)4294967295ULL); x498 = ((x404)&(x496))|((x433)&(x497)); x499 = ((uintptr_t)-1ULL)+((x446)==((uintptr_t)0ULL)); x500 = (x499)^((uintptr_t)4294967295ULL); x501 = ((x409)&(x499))|((x437)&(x500)); x502 = ((uintptr_t)-1ULL)+((x446)==((uintptr_t)0ULL)); x503 = (x502)^((uintptr_t)4294967295ULL); x504 = ((x414)&(x502))|((x442)&(x503)); x505 = x447; x506 = x42; x507 = x45; x508 = x48; x509 = x51; x510 = x54; x511 = x57; x512 = x60; x513 = x63; x514 = x66; /*skip*/ x515 = x448; x516 = x449; x517 = x450; x518 = x451; x519 = x452; x520 = x453; x521 = x454; x522 = x455; x523 = x456; /*skip*/ x524 = x459; x525 = x462; x526 = x465; x527 = x468; x528 = x471; x529 = x474; x530 = x477; x531 = x480; /*skip*/ x532 = x483; x533 = x486; x534 = x489; x535 = x492; x536 = x495; x537 = x498; x538 = x501; x539 = x504; /*skip*/ out0 = x505; _br2_store((out1)+((uintptr_t)0ULL), x506, sizeof(uintptr_t)); _br2_store((out1)+((uintptr_t)4ULL), x507, sizeof(uintptr_t)); _br2_store((out1)+((uintptr_t)8ULL), x508, sizeof(uintptr_t)); _br2_store((out1)+((uintptr_t)12ULL), x509, sizeof(uintptr_t)); _br2_store((out1)+((uintptr_t)16ULL), x510, sizeof(uintptr_t)); _br2_store((out1)+((uintptr_t)20ULL), x511, sizeof(uintptr_t)); _br2_store((out1)+((uintptr_t)24ULL), x512, sizeof(uintptr_t)); _br2_store((out1)+((uintptr_t)28ULL), x513, sizeof(uintptr_t)); _br2_store((out1)+((uintptr_t)32ULL), x514, sizeof(uintptr_t)); /*skip*/ _br2_store((out2)+((uintptr_t)0ULL), x515, sizeof(uintptr_t)); _br2_store((out2)+((uintptr_t)4ULL), x516, sizeof(uintptr_t)); _br2_store((out2)+((uintptr_t)8ULL), x517, sizeof(uintptr_t)); _br2_store((out2)+((uintptr_t)12ULL), x518, sizeof(uintptr_t)); _br2_store((out2)+((uintptr_t)16ULL), x519, sizeof(uintptr_t)); _br2_store((out2)+((uintptr_t)20ULL), x520, sizeof(uintptr_t)); _br2_store((out2)+((uintptr_t)24ULL), x521, sizeof(uintptr_t)); _br2_store((out2)+((uintptr_t)28ULL), x522, sizeof(uintptr_t)); _br2_store((out2)+((uintptr_t)32ULL), x523, sizeof(uintptr_t)); /*skip*/ _br2_store((out3)+((uintptr_t)0ULL), x524, sizeof(uintptr_t)); _br2_store((out3)+((uintptr_t)4ULL), x525, sizeof(uintptr_t)); _br2_store((out3)+((uintptr_t)8ULL), x526, sizeof(uintptr_t)); _br2_store((out3)+((uintptr_t)12ULL), x527, sizeof(uintptr_t)); _br2_store((out3)+((uintptr_t)16ULL), x528, sizeof(uintptr_t)); _br2_store((out3)+((uintptr_t)20ULL), x529, sizeof(uintptr_t)); _br2_store((out3)+((uintptr_t)24ULL), x530, sizeof(uintptr_t)); _br2_store((out3)+((uintptr_t)28ULL), x531, sizeof(uintptr_t)); /*skip*/ _br2_store((out4)+((uintptr_t)0ULL), x532, sizeof(uintptr_t)); _br2_store((out4)+((uintptr_t)4ULL), x533, sizeof(uintptr_t)); _br2_store((out4)+((uintptr_t)8ULL), x534, sizeof(uintptr_t)); _br2_store((out4)+((uintptr_t)12ULL), x535, sizeof(uintptr_t)); _br2_store((out4)+((uintptr_t)16ULL), x536, sizeof(uintptr_t)); _br2_store((out4)+((uintptr_t)20ULL), x537, sizeof(uintptr_t)); _br2_store((out4)+((uintptr_t)24ULL), x538, sizeof(uintptr_t)); _br2_store((out4)+((uintptr_t)28ULL), x539, sizeof(uintptr_t)); /*skip*/ return out0; } /* NOTE: The following wrapper function is not covered by Coq proofs */ static void fiat_p256_divstep(uint32_t* out1, uint32_t out2[9], uint32_t out3[9], uint32_t out4[8], uint32_t out5[8], uint32_t arg1, const uint32_t arg2[9], const uint32_t arg3[9], const uint32_t arg4[8], const uint32_t arg5[8]) { *out1 = (uint32_t)internal_fiat_p256_divstep((uintptr_t)out2, (uintptr_t)out3, (uintptr_t)out4, (uintptr_t)out5, (uintptr_t)arg1, (uintptr_t)arg2, (uintptr_t)arg3, (uintptr_t)arg4, (uintptr_t)arg5); } /* * Input Bounds: * Output Bounds: * out0: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] */ static void internal_fiat_p256_divstep_precomp(uintptr_t out0) { uintptr_t x0, x1, x2, x3, x4, x5, x6, x7; /*skip*/ x0 = (uintptr_t)3087007744ULL; x1 = (uintptr_t)1744830463ULL; x2 = (uintptr_t)939524096ULL; x3 = (uintptr_t)3221225472ULL; x4 = (uintptr_t)2147483647ULL; x5 = (uintptr_t)3623878656ULL; x6 = (uintptr_t)4294967295ULL; x7 = (uintptr_t)805306367ULL; /*skip*/ _br2_store((out0)+((uintptr_t)0ULL), x0, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)4ULL), x1, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)8ULL), x2, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)12ULL), x3, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)16ULL), x4, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)20ULL), x5, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)24ULL), x6, sizeof(uintptr_t)); _br2_store((out0)+((uintptr_t)28ULL), x7, sizeof(uintptr_t)); /*skip*/ return; } /* NOTE: The following wrapper function is not covered by Coq proofs */ static void fiat_p256_divstep_precomp(uint32_t out1[8]) { internal_fiat_p256_divstep_precomp((uintptr_t)out1); }
the_stack_data/225143542.c
// RUN: %clang_analyze_cc1 -analyzer-checker=debug.ConfigDumper > %t 2>&1 // RUN: FileCheck --input-file=%t %s --match-full-lines // CHECK: [config] // CHECK-NEXT: add-pop-up-notes = true // CHECK-NEXT: aggressive-binary-operation-simplification = false // CHECK-NEXT: alpha.clone.CloneChecker:IgnoredFilesPattern = "" // CHECK-NEXT: alpha.clone.CloneChecker:MinimumCloneComplexity = 50 // CHECK-NEXT: alpha.clone.CloneChecker:ReportNormalClones = true // CHECK-NEXT: alpha.cplusplus.STLAlgorithmModeling:AggressiveStdFindModeling = false // CHECK-NEXT: alpha.security.MmapWriteExec:MmapProtExec = 0x04 // CHECK-NEXT: alpha.security.MmapWriteExec:MmapProtRead = 0x01 // CHECK-NEXT: alpha.security.taint.TaintPropagation:Config = "" // CHECK-NEXT: apply-fixits = false // CHECK-NEXT: avoid-suppressing-null-argument-paths = false // CHECK-NEXT: c++-allocator-inlining = true // CHECK-NEXT: c++-container-inlining = false // CHECK-NEXT: c++-inlining = destructors // CHECK-NEXT: c++-shared_ptr-inlining = false // CHECK-NEXT: c++-stdlib-inlining = true // CHECK-NEXT: c++-temp-dtor-inlining = true // CHECK-NEXT: c++-template-inlining = true // CHECK-NEXT: cfg-conditional-static-initializers = true // CHECK-NEXT: cfg-expand-default-aggr-inits = false // CHECK-NEXT: cfg-implicit-dtors = true // CHECK-NEXT: cfg-lifetime = false // CHECK-NEXT: cfg-loopexit = false // CHECK-NEXT: cfg-rich-constructors = true // CHECK-NEXT: cfg-scopes = false // CHECK-NEXT: cfg-temporary-dtors = true // CHECK-NEXT: cplusplus.Move:WarnOn = KnownsAndLocals // CHECK-NEXT: crosscheck-with-z3 = false // CHECK-NEXT: ctu-dir = "" // CHECK-NEXT: ctu-import-threshold = 100 // CHECK-NEXT: ctu-index-name = externalDefMap.txt // CHECK-NEXT: deadcode.DeadStores:ShowFixIts = false // CHECK-NEXT: deadcode.DeadStores:WarnForDeadNestedAssignments = true // CHECK-NEXT: debug.AnalysisOrder:* = false // CHECK-NEXT: debug.AnalysisOrder:Bind = false // CHECK-NEXT: debug.AnalysisOrder:EndAnalysis = false // CHECK-NEXT: debug.AnalysisOrder:EndFunction = false // CHECK-NEXT: debug.AnalysisOrder:LiveSymbols = false // CHECK-NEXT: debug.AnalysisOrder:NewAllocator = false // CHECK-NEXT: debug.AnalysisOrder:PointerEscape = false // CHECK-NEXT: debug.AnalysisOrder:PostCall = false // CHECK-NEXT: debug.AnalysisOrder:PostStmtArraySubscriptExpr = false // CHECK-NEXT: debug.AnalysisOrder:PostStmtCXXConstructExpr = false // CHECK-NEXT: debug.AnalysisOrder:PostStmtCXXDeleteExpr = false // CHECK-NEXT: debug.AnalysisOrder:PostStmtCXXNewExpr = false // CHECK-NEXT: debug.AnalysisOrder:PostStmtCastExpr = false // CHECK-NEXT: debug.AnalysisOrder:PostStmtOffsetOfExpr = false // CHECK-NEXT: debug.AnalysisOrder:PreCall = false // CHECK-NEXT: debug.AnalysisOrder:PreStmtArraySubscriptExpr = false // CHECK-NEXT: debug.AnalysisOrder:PreStmtCXXConstructExpr = false // CHECK-NEXT: debug.AnalysisOrder:PreStmtCXXDeleteExpr = false // CHECK-NEXT: debug.AnalysisOrder:PreStmtCXXNewExpr = false // CHECK-NEXT: debug.AnalysisOrder:PreStmtCastExpr = false // CHECK-NEXT: debug.AnalysisOrder:PreStmtOffsetOfExpr = false // CHECK-NEXT: debug.AnalysisOrder:RegionChanges = false // CHECK-NEXT: display-checker-name = true // CHECK-NEXT: display-ctu-progress = false // CHECK-NEXT: eagerly-assume = true // CHECK-NEXT: elide-constructors = true // CHECK-NEXT: expand-macros = false // CHECK-NEXT: experimental-enable-naive-ctu-analysis = false // CHECK-NEXT: exploration_strategy = unexplored_first_queue // CHECK-NEXT: faux-bodies = true // CHECK-NEXT: graph-trim-interval = 1000 // CHECK-NEXT: inline-lambdas = true // CHECK-NEXT: ipa = dynamic-bifurcate // CHECK-NEXT: ipa-always-inline-size = 3 // CHECK-NEXT: max-inlinable-size = 100 // CHECK-NEXT: max-nodes = 225000 // CHECK-NEXT: max-symbol-complexity = 35 // CHECK-NEXT: max-times-inline-large = 32 // CHECK-NEXT: min-cfg-size-treat-functions-as-large = 14 // CHECK-NEXT: mode = deep // CHECK-NEXT: model-path = "" // CHECK-NEXT: notes-as-events = false // CHECK-NEXT: nullability:NoDiagnoseCallsToSystemHeaders = false // CHECK-NEXT: objc-inlining = true // CHECK-NEXT: optin.cplusplus.UninitializedObject:CheckPointeeInitialization = false // CHECK-NEXT: optin.cplusplus.UninitializedObject:IgnoreGuardedFields = false // CHECK-NEXT: optin.cplusplus.UninitializedObject:IgnoreRecordsWithField = "" // CHECK-NEXT: optin.cplusplus.UninitializedObject:NotesAsWarnings = false // CHECK-NEXT: optin.cplusplus.UninitializedObject:Pedantic = false // CHECK-NEXT: optin.cplusplus.VirtualCall:PureOnly = false // CHECK-NEXT: optin.cplusplus.VirtualCall:ShowFixIts = false // CHECK-NEXT: optin.osx.cocoa.localizability.NonLocalizedStringChecker:AggressiveReport = false // CHECK-NEXT: optin.performance.Padding:AllowedPad = 24 // CHECK-NEXT: osx.NumberObjectConversion:Pedantic = false // CHECK-NEXT: osx.cocoa.RetainCount:CheckOSObject = true // CHECK-NEXT: osx.cocoa.RetainCount:TrackNSCFStartParam = false // CHECK-NEXT: prune-paths = true // CHECK-NEXT: region-store-small-struct-limit = 2 // CHECK-NEXT: report-in-main-source-file = false // CHECK-NEXT: serialize-stats = false // CHECK-NEXT: silence-checkers = "" // CHECK-NEXT: stable-report-filename = false // CHECK-NEXT: suppress-c++-stdlib = true // CHECK-NEXT: suppress-inlined-defensive-checks = true // CHECK-NEXT: suppress-null-return-paths = true // CHECK-NEXT: track-conditions = true // CHECK-NEXT: track-conditions-debug = false // CHECK-NEXT: unix.DynamicMemoryModeling:Optimistic = false // CHECK-NEXT: unroll-loops = false // CHECK-NEXT: widen-loops = false // CHECK-NEXT: [stats] // CHECK-NEXT: num-entries = 103
the_stack_data/22011485.c
void foo(char i); void foo(char i) { int c = 0; }
the_stack_data/161079749.c
// Copyright 2013 Google Inc. All Rights Reserved. // // 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 <string.h> #include <math.h> #include <stdlib.h> // mac os x const long long max_size = 2000; // max length of strings const long long N = 40; // number of closest words that will be shown const long long max_w = 50; // max length of vocabulary entries int main(int argc, char **argv) { FILE *f; char st1[max_size]; char bestw[N][max_size]; char file_name[max_size], st[100][max_size]; float dist, len, bestd[N], vec[max_size]; long long words, size, a, b, c, d, cn, bi[100]; char ch; float *M; char *vocab; if (argc < 2) { printf("Usage: ./distance <FILE>\nwhere FILE contains word projections in the BINARY FORMAT\n"); return 0; } strcpy(file_name, argv[1]); f = fopen(file_name, "rb"); if (f == NULL) { printf("Input file not found\n"); return -1; } fscanf(f, "%lld", &words); fscanf(f, "%lld", &size); vocab = (char *)malloc((long long)words * max_w * sizeof(char)); M = (float *)malloc((long long)words * (long long)size * sizeof(float)); if (M == NULL) { printf("Cannot allocate memory: %lld MB %lld %lld\n", (long long)words * size * sizeof(float) / 1048576, words, size); return -1; } for (b = 0; b < words; b++) { fscanf(f, "%s%c", &vocab[b * max_w], &ch); for (a = 0; a < size; a++) fread(&M[a + b * size], sizeof(float), 1, f); len = 0; for (a = 0; a < size; a++) len += M[a + b * size] * M[a + b * size]; len = sqrt(len); for (a = 0; a < size; a++) M[a + b * size] /= len; } fclose(f); while (1) { for (a = 0; a < N; a++) bestd[a] = 0; for (a = 0; a < N; a++) bestw[a][0] = 0; printf("Enter word or sentence (EXIT to break): "); a = 0; while (1) { st1[a] = fgetc(stdin); if ((st1[a] == '\n') || (a >= max_size - 1)) { st1[a] = 0; break; } a++; } if (!strcmp(st1, "EXIT")) break; cn = 0; b = 0; c = 0; while (1) { st[cn][b] = st1[c]; b++; c++; st[cn][b] = 0; if (st1[c] == 0) break; if (st1[c] == ' ') { cn++; b = 0; c++; } } cn++; for (a = 0; a < cn; a++) { for (b = 0; b < words; b++) if (!strcmp(&vocab[b * max_w], st[a])) break; if (b == words) b = -1; bi[a] = b; printf("\nWord: %s Position in vocabulary: %lld\n", st[a], bi[a]); if (b == -1) { printf("Out of dictionary word!\n"); break; } } if (b == -1) continue; printf("\n Word Cosine distance\n------------------------------------------------------------------------\n"); for (a = 0; a < size; a++) vec[a] = 0; for (b = 0; b < cn; b++) { if (bi[b] == -1) continue; for (a = 0; a < size; a++) vec[a] += M[a + bi[b] * size]; } len = 0; for (a = 0; a < size; a++) len += vec[a] * vec[a]; len = sqrt(len); for (a = 0; a < size; a++) vec[a] /= len; for (a = 0; a < N; a++) bestd[a] = 0; for (a = 0; a < N; a++) bestw[a][0] = 0; for (c = 0; c < words; c++) { a = 0; for (b = 0; b < cn; b++) if (bi[b] == c) a = 1; if (a == 1) continue; dist = 0; for (a = 0; a < size; a++) dist += vec[a] * M[a + c * size]; for (a = 0; a < N; a++) { if (dist > bestd[a]) { for (d = N - 1; d > a; d--) { bestd[d] = bestd[d - 1]; strcpy(bestw[d], bestw[d - 1]); } bestd[a] = dist; strcpy(bestw[a], &vocab[c * max_w]); break; } } } for (a = 0; a < N; a++) printf("%50s\t\t%f\n", bestw[a], bestd[a]); } return 0; }
the_stack_data/11074640.c
#include <stdio.h> int main() { float i = 10; float z = 3; printf("%.10f\n", i / z); }
the_stack_data/182953833.c
#include <stdio.h> int main() { int n, reversedInteger = 0, remainder, originalInteger; printf("Enter an integer: "); scanf("%d", &n); originalInteger = n; // reversed integer is stored in variable while( n!=0 ) { remainder = n%10; reversedInteger = reversedInteger*10 + remainder; n /= 10; } // palindrome if orignalInteger and reversedInteger are equal if (originalInteger == reversedInteger) printf("%d is a palindrome.", originalInteger); else printf("%d is not a palindrome.", originalInteger); return 0; }
the_stack_data/50138025.c
/*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Chris Torek. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include <stdio.h> #include <stdarg.h> int fprintf(FILE* fp, const char* fmt, ...) { int ret; va_list ap; va_start(ap, fmt); ret = vfprintf(fp, fmt, ap); va_end(ap); return (ret); }
the_stack_data/871666.c
#include <sys/types.h> #include <sys/wait.h> #include <fcntl.h> #include <unistd.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> int main() { int res = write(3, "HELLO, WORLD!\n", 14); if (res == -1) { perror("write error: "); exit(1); } else { fprintf(stderr, "res = %d\n", res); } return 0; }
the_stack_data/125820.c
/* * libc/sys/execl.c * Sys exec with a list of arguments but no environment. */ extern char **environ; /* execl(name, arg0, arg1, ..., argn, NULL) */ /* VARARGS 1 */ int execl(name, arg0) char *name; char *arg0; { return execve(name, &arg0, environ); } /* end of libc/sys/execl.c */
the_stack_data/162643820.c
#include <stdio.h> #include <stdlib.h> #include <string.h> void airports(char * fname){ FILE * f; char c; f = fopen(fname, "r"); c = fgetc(f); while (c != EOF){ printf("%c", c); c = fgetc(f); } fclose(f); } int main(int argc, char ** argv){ if (argc < 3){ printf("enter ./system <airports_file> <dists_file>\n"); return 0; } //use info from files to create a graph int dir[26][26][26]; int inv_dir[500]; FILE * f; f = fopen(argv[1], "r"); int V = 0; char buffer[50]; while (fgets(buffer, 50, f) != NULL){ buffer[3] = '\0'; dir[buffer[0] - 'A'][buffer[1] - 'A'][buffer[2] - 'A'] = V; inv_dir[V] = (buffer[0] - 'A')*10000 + (buffer[1] - 'A')*100 + buffer[2] - 'A'; V++; } int matrix[V][V]; for (int i = 0; i < V; i++){ for (int j = 0; j < V; j++){ matrix[i][j] = 0; } } int edges[8000][2]; int count = 0; FILE * g; g = fopen(argv[2], "r"); int distance; char start[4]; char end[4]; int hash_start; int hash_end; while(fscanf(g, "%s %s %d", start, end, &distance) != EOF){ hash_start = dir[start[0] - 'A'][start[1] - 'A'][start[2] - 'A']; hash_end = dir[end[0] - 'A'][end[1] - 'A'][end[2] - 'A']; matrix[hash_start][hash_end] = distance; matrix[hash_end][hash_start] = distance; edges[count][0] = hash_start; edges[count][1] = hash_end; count++; } int edge_list[count * 2][2]; for (int i = 0; i < count; i++){ edge_list[i][0] = edges[i][0]; edge_list[i][1] = edges[i][1]; edge_list[i + count][0] = edges[i][1]; edge_list[i + count][1] = edges[i][0]; } while(1){ char command[50]; printf("enter command> "); fgets(command, 50, stdin); char * cmd = NULL; char * depart = NULL; char * arrive = NULL; cmd = strtok(command, " \n"); depart = strtok(NULL, " \n"); arrive = strtok(NULL, " \n"); if (!strcmp(cmd, "help")){ printf("ALL COMMANDS ARE CASE SENSITIVE\nlist of commands\nhelp: prints this message\nquit: quits the program\nairports: prints airports serviced by FTA\ndistance <airport1> <airport2>: prints the shortest route from airport1 to airport2\n"); } else if (!strcmp(cmd, "quit")){ break; } else if (!strcmp(cmd, "airports")){ airports(argv[1]); } else if (!strcmp(cmd, "distance")){ //Bellman-Ford Implementation int dist[V]; int last[V]; for (int i = 0; i < V; i++){ dist[i] = 1000000; } int depart_hash = dir[depart[0] - 'A'][depart[1] - 'A'][depart[2] - 'A']; int arrive_hash = dir[arrive[0] - 'A'][arrive[1] - 'A'][arrive[2] - 'A']; dist[depart_hash] = 0; for (int i = 0; i < V - 1; i++){ for (int j = 0; j < 2 * count; j++){ int src = edge_list[j][0]; int dest = edge_list[j][1]; int w = matrix[src][dest]; if (dist[src] + w < dist[dest]){ dist[dest] = dist[src] + w; last[dest] = src; } } } printf("Total Distance is %d\n", dist[arrive_hash]); int backtrack = arrive_hash; int path[50]; int legs = 0; while (backtrack != depart_hash){ path[legs] = backtrack; backtrack = last[backtrack]; legs++; } int for_path[legs + 1]; for_path[0] = depart_hash; for (int i = 1; i < legs + 1; i++){ for_path[i] = path[legs - i ]; } int leave[3]; int stop[3]; char l[3]; char s[3]; for (int i = 0; i < legs; i++){ leave[0] = inv_dir[for_path[i]]/10000; leave[1] = inv_dir[for_path[i]]/100 - 100*leave[0]; leave[2] = inv_dir[for_path[i]] - 10000*leave[0] - 100*leave[1]; stop[0] = inv_dir[for_path[i+1]]/10000; stop[1] = inv_dir[for_path[i+1]]/100 - 100*stop[0]; stop[2] = inv_dir[for_path[i+1]] - 10000*stop[0] - 100*stop[1]; for (int j = 0; j < 3; j++){ l[j] = 'A' + leave[j]; s[j] = 'A' + stop[j]; } printf("%s -> %c%c%c %d\n", l, s[0], s[1], s[2], matrix[for_path[i]][for_path[i+1]]); } } else{ printf("Invalid command, type help for info\n"); } } return 0; }
the_stack_data/107952622.c
#ifdef TCP_SERVER #include "tcpiphandler.h" #include "events.h" #include "app.h" #include "tcp.h" #include "datatypeconversion.h" #include "copleySmHandler.h" #include "sys_devcon_cache.h" #include "tcpip/src/tcpip_private.h" /*Definitions*/ #define TCPIP_RECEIVE_BUF_SIZE 500 #define LEN_TCP_RX_CMD 40 #define LEN_UDP_RX_CMD 40 tcpipReceivePacket gsTcpipReceive[TCPIP_RECEIVE_BUF_SIZE]; tcpipReceivePacket gsMonitorReceive[TCPIP_RECEIVE_BUF_SIZE]; eventPtr gsTcpipReceiveEvent; eventPtr gsMonitorReceiveEvent; tcpipReceivePacket receiveData; uint8_t command[4]; uint8_t arg[40]; static uint8_t gucTCmdBuf[LEN_TCP_RX_CMD]; static uint16_t guiIndex = 0; void initTCPHandler (void) { gsTcpipReceiveEvent.uiProcessCtr = 0; gsTcpipReceiveEvent.uiOutPtr = 0; gsTcpipReceiveEvent.uiInPtr = 0; gsMonitorReceiveEvent.uiProcessCtr = 0; gsMonitorReceiveEvent.uiOutPtr = 0; gsMonitorReceiveEvent.uiInPtr = 0; } void tcpipHandlerTask() { uint8_t ucTempBuf; if (TCPIP_TCP_IsConnected(appData.tcpServerSocket) && TCPIP_TCP_GetIsReady(appData.tcpServerSocket)) { TCPIP_TCP_Get(appData.tcpServerSocket,&ucTempBuf); gucTCmdBuf[guiIndex] = ucTempBuf; if(gucTCmdBuf[guiIndex]=='\r') { guiIndex = 0; memmove(&gsTcpipReceive[gsTcpipReceiveEvent.uiInPtr].ucCommandByte[0],&gucTCmdBuf[0],LEN_TCP_RX_CMD); gsTcpipReceive[gsTcpipReceiveEvent.uiInPtr].ucCommSel = TCP_IP; gsTcpipReceiveEvent.uiInPtr ++; if (gsTcpipReceiveEvent.uiInPtr >= TCPIP_RECEIVE_BUF_SIZE) { gsTcpipReceiveEvent.uiInPtr = 0; } gsTcpipReceiveEvent.uiProcessCtr ++; } else { guiIndex ++; } } } void udpHandlerTask() { uint8_t ucTempBuf[30]; if (TCPIP_UDP_IsConnected(appData.udpServerSocket) && TCPIP_UDP_GetIsReady(appData.udpServerSocket)) { TCPIP_UDP_ArrayGetRaw(appData.udpServerSocket, &ucTempBuf[0], LEN_UDP_RX_CMD); memmove(&gsTcpipReceive[gsTcpipReceiveEvent.uiInPtr].ucCommandByte[0],&ucTempBuf[0],LEN_UDP_RX_CMD); gsTcpipReceive[gsTcpipReceiveEvent.uiInPtr].ucCommSel = UDP; gsTcpipReceiveEvent.uiInPtr ++; if (gsTcpipReceiveEvent.uiInPtr >= TCPIP_RECEIVE_BUF_SIZE) { gsTcpipReceiveEvent.uiInPtr = 0; } gsTcpipReceiveEvent.uiProcessCtr ++; } } bool getTcpipReceiveEvent(tcpipReceivePacket *psTcpipReceive) { bool bRetVal = true; if (gsTcpipReceiveEvent.uiProcessCtr > 0) { *psTcpipReceive = gsTcpipReceive[gsTcpipReceiveEvent.uiOutPtr]; } else { bRetVal = false; } return bRetVal; } void disposeTcpipReceiveEvent() { gsTcpipReceiveEvent.uiOutPtr++; if (gsTcpipReceiveEvent.uiOutPtr >= TCPIP_RECEIVE_BUF_SIZE) { gsTcpipReceiveEvent.uiOutPtr = 0; } gsTcpipReceiveEvent.uiProcessCtr--; } void processTcpipData(void) { int i = 0,j=0; if(getTcpipReceiveEvent(&receiveData)) { memcpy(&command[0],&(receiveData.ucCommandByte[0]),3); i=3; while(receiveData.ucCommandByte[i] != '\r') { arg[j++] = receiveData.ucCommandByte[i++]; } arg[j]='\0'; command[3]='\0'; //command purse function commandParse(&command[0],&arg[0],receiveData.ucCommSel); disposeTcpipReceiveEvent(); } } //bool tcpIPSendMesg(mainSmStates eCopleySmStats, uint8_t ucCopleyData[], uint8_t ucCommandChannel) //{ // bool bRetVal = true; // uint8_t ucTCPIPPutBuffer[100]; // uint16_t uiIndex; // unsignedIntToString((uint16_t) eCopleySmStats, DIGIT_3, &ucTCPIPPutBuffer[0]); // memset(&ucTCPIPPutBuffer[3], ':', 1U); // uiIndex = 0U; // // if (ucCopleyData != NULL) // { // while (ucCopleyData[uiIndex] != '\r') // { // ucTCPIPPutBuffer[uiIndex + 4U] = ucCopleyData[uiIndex]; // uiIndex++; // } // // ucTCPIPPutBuffer[uiIndex + 4U] = ucCopleyData[uiIndex]; // } // // uiIndex = uiIndex + 4U + 1U; // // if (ucCommandChannel == TCP_IP) // { // TCPIP_TCP_ArrayPut(appData.tcpServerSocket, (uint8_t *) ucTCPIPPutBuffer, uiIndex); // } // else // { // bRetVal = sendResposneViaUDP(ucTCPIPPutBuffer, uiIndex); // } // // return bRetVal; // //} bool sendResposneViaUDP(uint8_t ucUDPResponse[], uint16_t uiSize) { bool bRetval = true; TCPIP_NET_IF *pNetIf; uint16_t uiTempSocket; uint8_t ucUDpCommandFormat[50]; uint16_t uiUDPPacketSize; memmove(&ucUDpCommandFormat[0],&ucUDPResponse[0],uiSize); uiUDPPacketSize = uiSize; uiTempSocket = TCPIP_UDP_ClientOpen(IP_ADDRESS_TYPE_IPV4, appData.udpPort, 0); if (uiTempSocket == INVALID_UDP_SOCKET) { // keep the request pending, we'll try next time return false; } pNetIf = (TCPIP_NET_IF*)TCPIP_STACK_IndexToNet(0); if(TCPIP_STACK_NetworkIsLinked(pNetIf)) { // reply only if this interface is up and running TCPIP_UDP_SocketNetSet (uiTempSocket, pNetIf); TCPIP_UDP_BcastIPV4AddressSet(uiTempSocket, UDP_BCAST_NETWORK_DIRECTED, pNetIf); if ((TCPIP_UDP_IsConnected(uiTempSocket))&&(TCPIP_UDP_PutIsReady(uiTempSocket))) { TCPIP_UDP_ArrayPutRaw(uiTempSocket, &ucUDpCommandFormat[0], uiUDPPacketSize); TCPIP_UDP_Flush(uiTempSocket); TCPIP_UDP_Close(uiTempSocket); } else { bRetval = false; } } else { bRetval = false; } return bRetval; } #endif
the_stack_data/73574900.c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_putchar.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: jnawrock <[email protected]> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/10/30 15:34:49 by jnawrock #+# #+# */ /* Updated: 2019/10/30 15:34:51 by jnawrock ### ########.fr */ /* */ /* ************************************************************************** */ #include <unistd.h> void ft_putchar(char c) { write(1, &c, 1); }
the_stack_data/50137033.c
/* * 4190.203 System Programming * Shell Lab * * tsh - A tiny shell program with job control * * Name: <omitted> * Student id: <omitted> * */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <ctype.h> #include <signal.h> #include <sys/types.h> #include <sys/wait.h> #include <errno.h> /* Misc manifest constants */ #define MAXLINE 1024 /* max line size */ #define MAXARGS 128 /* max args on a command line */ #define MAXJOBS 16 /* max jobs at any point in time */ #define MAXJID 1<<16 /* max job ID */ /* Job states */ #define UNDEF 0 /* undefined */ #define FG 1 /* running in foreground */ #define BG 2 /* running in background */ #define ST 3 /* stopped */ /* * Jobs states: FG (foreground), BG (background), ST (stopped) * Job state transitions and enabling actions: * FG -> ST : ctrl-z * ST -> FG : fg command * ST -> BG : bg command * BG -> FG : fg command * At most 1 job can be in the FG state. */ /* Global variables */ extern char **environ; /* defined in libc */ char prompt[] = "tsh> "; /* command line prompt (DO NOT CHANGE) */ int verbose = 0; /* if true, print additional output */ int nextjid = 1; /* next job ID to allocate */ char sbuf[MAXLINE]; /* for composing sprintf messages */ struct job_t { /* The job struct */ pid_t pid; /* job PID */ int jid; /* job ID [1, 2, ...] */ int state; /* UNDEF, BG, FG, or ST */ char cmdline[MAXLINE]; /* command line */ }; struct job_t jobs[MAXJOBS]; /* The job list */ /* End global variables */ /* Function prototypes */ /*---------------------------------------------------------------------------- * Functions that you will implement */ void eval(char *cmdline); int builtin_cmd(char **argv); void do_bgfg(char **argv); void waitfg(pid_t pid); void sigchld_handler(int sig); void sigint_handler(int sig); void sigtstp_handler(int sig); /*----------------------------------------------------------------------------*/ /* These functions are already implemented for your convenience */ int parseline(const char *cmdline, char **argv); void sigquit_handler(int sig); void clearjob(struct job_t *job); void initjobs(struct job_t *jobs); int maxjid(struct job_t *jobs); int addjob(struct job_t *jobs, pid_t pid, int state, char *cmdline); int deletejob(struct job_t *jobs, pid_t pid); pid_t fgpid(struct job_t *jobs); struct job_t *getjobpid(struct job_t *jobs, pid_t pid); struct job_t *getjobjid(struct job_t *jobs, int jid); int pid2jid(pid_t pid); void listjobs(struct job_t *jobs); void usage(void); void unix_error(char *msg); void app_error(char *msg); typedef void handler_t(int); handler_t *Signal(int signum, handler_t *handler); /* * main - The shell's main routine */ int main(int argc, char **argv) { char c; char cmdline[MAXLINE]; int emit_prompt = 1; /* emit prompt (default) */ /* Redirect stderr to stdout (so that driver will get all output * on the pipe connected to stdout) */ dup2(1, 2); /* Parse the command line */ while ((c = getopt(argc, argv, "hvp")) != EOF) { switch (c) { case 'h': /* print help message */ usage(); break; case 'v': /* emit additional diagnostic info */ verbose = 1; break; case 'p': /* don't print a prompt */ emit_prompt = 0; /* handy for automatic testing */ break; default: usage(); } } /* Install the signal handlers */ /* These are the ones you will need to implement */ Signal(SIGINT, sigint_handler); /* ctrl-c */ Signal(SIGTSTP, sigtstp_handler); /* ctrl-z */ Signal(SIGCHLD, sigchld_handler); /* Terminated or stopped child */ /* This one provides a clean way to kill the shell */ Signal(SIGQUIT, sigquit_handler); /* Initialize the job list */ initjobs(jobs); /* Execute the shell's read/eval loop */ while (1) { /* Read command line */ if (emit_prompt) { printf("%s", prompt); fflush(stdout); } if ((fgets(cmdline, MAXLINE, stdin) == NULL) && ferror(stdin)) app_error("fgets error"); if (feof(stdin)) { /* End of file (ctrl-d) */ fflush(stdout); exit(0); } /* Evaluate the command line */ eval(cmdline); fflush(stdout); fflush(stdout); } exit(0); /* control never reaches here */ } /* * eval - Evaluate the command line that the user has just typed in * * If the user has requested a built-in command (quit, jobs, bg or fg) * then execute it immediately. Otherwise, fork a child process and * run the job in the context of the child. If the job is running in * the foreground, wait for it to terminate and then return. Note: * each child process must have a unique process group ID so that our * background children don't receive SIGINT (SIGTSTP) from the kernel * when we type ctrl-c (ctrl-z) at the keyboard. */ void eval(char *cmdline) { char* argv[MAXARGS]; int bg = parseline(cmdline, argv); // parse line if(builtin_cmd(argv)) return; // if it was a built in cmd, run and finish. sigset_t sigset; sigemptyset(&sigset); sigaddset(&sigset, SIGCHLD); sigprocmask( SIG_BLOCK, &sigset, NULL); // block SIGCHILD pid_t pid; if((pid = fork()) == 0) { setpgid(0, 0); // set group id uniquely sigprocmask( SIG_UNBLOCK, &sigset, NULL); // unblock SIGCHILD if(execve(argv[0], argv, environ) < 0) { printf("%s: Command not found\n", argv[0]); // if execve was not a success -> command not found exit(0); // exit this process } } else { if(bg) { addjob(jobs, pid, BG, cmdline); // add job sigprocmask( SIG_UNBLOCK, &sigset, NULL); // unblock SIGCHILD printf("[%d] (%d) %s", pid2jid(pid),pid, cmdline); // notify } else { addjob(jobs, pid, FG, cmdline); // add job sigprocmask( SIG_UNBLOCK, &sigset, NULL); // unblock SIGCHILD waitfg(pid); // notify } } } /* * parseline - Parse the command line and build the argv array. * * Characters enclosed in single quotes are treated as a single * argument. Return true if the user has requested a BG job, false if * the user has requested a FG job. */ int parseline(const char *cmdline, char **argv) { static char array[MAXLINE]; /* holds local copy of command line */ char *buf = array; /* ptr that traverses command line */ char *delim; /* points to first space delimiter */ int argc; /* number of args */ int bg; /* background job? */ strcpy(buf, cmdline); buf[strlen(buf)-1] = ' '; /* replace trailing '\n' with space */ while (*buf && (*buf == ' ')) /* ignore leading spaces */ buf++; /* Build the argv list */ argc = 0; if (*buf == '\'') { buf++; delim = strchr(buf, '\''); } else { delim = strchr(buf, ' '); } while (delim) { argv[argc++] = buf; *delim = '\0'; buf = delim + 1; while (*buf && (*buf == ' ')) /* ignore spaces */ buf++; if (*buf == '\'') { buf++; delim = strchr(buf, '\''); } else { delim = strchr(buf, ' '); } } argv[argc] = NULL; if (argc == 0) /* ignore blank line */ return 1; /* should the job run in the background? */ if ((bg = (*argv[argc-1] == '&')) != 0) { argv[--argc] = NULL; } return bg; } /* * builtin_cmd - If the user has typed a built-in command then execute * it immediately. */ int builtin_cmd(char **argv) { if(!strcmp(argv[0], "quit")) { exit(0); // quit } else if(!strcmp(argv[0], "fg") || !strcmp(argv[0], "bg")) { do_bgfg(argv); // do bg fg } else if(!strcmp(argv[0], "jobs")) { listjobs(jobs); // list jobs } else return 0; /* not a builtin command */ return 1; // it was a built-in command } // if string is a well-formed number int isnumber(char* s) { while(*s) { if(!isdigit(*s)) return 0; s++; } return 1; } /* * do_bgfg - Execute the builtin bg and fg commands */ void do_bgfg(char **argv) { struct job_t* job; if(argv[1] == NULL) { // too few arguments printf("%s command requires PID or %%jobid argument\n", argv[0]); return; } else if(argv[1][0] == '%') { if(!isnumber(argv[1] + 1)) { // non-proper number printf("%s: argument must be a PID or %%jobid\n", argv[0]); return; } job = getjobjid(jobs, atoi(argv[1] + 1)); if(!job) { // no such job printf("%s: No such job\n", argv[1]); return; } } else { if(!isnumber(argv[1])) { // non-proper number printf("%s: argument must be a PID or %%jobid\n", argv[0]); return; } job = getjobpid(jobs, atoi(argv[1])); if(!job) { // no such job printf("(%s): No such process\n", argv[1]); return; } } if(job->state == ST) { // send SIGCONT to the group if(kill(-(job->pid), SIGCONT) < 0) { // if kill doesn't succeed printf("Sending SIGCONT was unsuccessful\n"); exit(0); } } if(!strcmp("bg", argv[0])) { job->state = BG; printf("[%d] (%d) %s", job->jid, job->pid, job->cmdline); // notify } else { job->state = FG; waitfg(job->pid); // wait fg } } /* * waitfg - Block until process pid is no longer the foreground process */ void waitfg(pid_t pid) { struct job_t* job = getjobpid(jobs, pid); while(job->state == FG) { // busy loop while it is foreground job sleep(1); } } /***************** * Signal handlers *****************/ /* * sigchld_handler - The kernel sends a SIGCHLD to the shell whenever * a child job terminates (becomes a zombie), or stops because it * received a SIGSTOP or SIGTSTP signal. The handler reaps all * available zombie children, but doesn't wait for any other * currently running children to terminate. */ void sigchld_handler(int sig) { pid_t pid; int status, i, w; for(i=0; i<MAXJOBS; i++) { // for all jobs if(jobs[i].state == UNDEF) continue; pid = jobs[i].pid; w = waitpid(pid, &status, WNOHANG | WUNTRACED); if(w > 0) { if(WIFSTOPPED(status)) { // stopped. printf("Job [%d] (%d) stopped by signal %d\n", jobs[i].jid, pid, WSTOPSIG(status)); jobs[i].state = ST; } else { if(WIFSIGNALED(status)) // terminated by signal printf("Job [%d] (%d) terminated by signal %d\n", jobs[i].jid, pid, status); deletejob(jobs, pid); } } else if(w == 0) { } else { } } } /* * sigint_handler - The kernel sends a SIGINT to the shell whenver the * user types ctrl-c at the keyboard. Catch it and send it along * to the foreground job. */ void sigint_handler(int sig) { pid_t pid = fgpid(jobs); if(pid == 0) return; if(kill(-pid, SIGINT) < 0) { // check if kill succeeds printf("Sending SIGINT failed\n"); exit(0); } } /* * sigtstp_handler - The kernel sends a SIGTSTP to the shell whenever * the user types ctrl-z at the keyboard. Catch it and suspend the * foreground job by sending it a SIGTSTP. */ void sigtstp_handler(int sig) { pid_t pid = fgpid(jobs); if(pid == 0) return; if(kill(-pid, SIGTSTP) < 0) { printf("Sending SIGTSTP failed\n"); exit(0); } } /********************* * End signal handlers *********************/ /*********************************************** * Helper routines that manipulate the job list **********************************************/ /* clearjob - Clear the entries in a job struct */ void clearjob(struct job_t *job) { job->pid = 0; job->jid = 0; job->state = UNDEF; job->cmdline[0] = '\0'; } /* initjobs - Initialize the job list */ void initjobs(struct job_t *jobs) { int i; for (i = 0; i < MAXJOBS; i++) clearjob(&jobs[i]); } /* maxjid - Returns largest allocated job ID */ int maxjid(struct job_t *jobs) { int i, max=0; for (i = 0; i < MAXJOBS; i++) if (jobs[i].jid > max) max = jobs[i].jid; return max; } /* addjob - Add a job to the job list */ int addjob(struct job_t *jobs, pid_t pid, int state, char *cmdline) { int i; if (pid < 1) return 0; for (i = 0; i < MAXJOBS; i++) { if (jobs[i].pid == 0) { jobs[i].pid = pid; jobs[i].state = state; jobs[i].jid = nextjid++; if (nextjid > MAXJOBS) nextjid = 1; strcpy(jobs[i].cmdline, cmdline); if(verbose){ printf("Added job [%d] %d %s\n", jobs[i].jid, jobs[i].pid, jobs[i].cmdline); } return 1; } } printf("Tried to create too many jobs\n"); return 0; } /* deletejob - Delete a job whose PID=pid from the job list */ int deletejob(struct job_t *jobs, pid_t pid) { int i; if (pid < 1) return 0; for (i = 0; i < MAXJOBS; i++) { if (jobs[i].pid == pid) { clearjob(&jobs[i]); nextjid = maxjid(jobs)+1; return 1; } } return 0; } /* fgpid - Return PID of current foreground job, 0 if no such job */ pid_t fgpid(struct job_t *jobs) { int i; for (i = 0; i < MAXJOBS; i++) if (jobs[i].state == FG) return jobs[i].pid; return 0; } /* getjobpid - Find a job (by PID) on the job list */ struct job_t *getjobpid(struct job_t *jobs, pid_t pid) { int i; if (pid < 1) return NULL; for (i = 0; i < MAXJOBS; i++) if (jobs[i].pid == pid) return &jobs[i]; return NULL; } /* getjobjid - Find a job (by JID) on the job list */ struct job_t *getjobjid(struct job_t *jobs, int jid) { int i; if (jid < 1) return NULL; for (i = 0; i < MAXJOBS; i++) if (jobs[i].jid == jid) return &jobs[i]; return NULL; } /* pid2jid - Map process ID to job ID */ int pid2jid(pid_t pid) { int i; if (pid < 1) return 0; for (i = 0; i < MAXJOBS; i++) if (jobs[i].pid == pid) { return jobs[i].jid; } return 0; } /* listjobs - Print the job list */ void listjobs(struct job_t *jobs) { int i; for (i = 0; i < MAXJOBS; i++) { if (jobs[i].pid != 0) { printf("[%d] (%d) ", jobs[i].jid, jobs[i].pid); switch (jobs[i].state) { case BG: printf("Running "); break; case FG: printf("Foreground "); break; case ST: printf("Stopped "); break; default: printf("listjobs: Internal error: job[%d].state=%d ", i, jobs[i].state); } printf("%s", jobs[i].cmdline); } } } /****************************** * end job list helper routines ******************************/ /*********************** * Other helper routines ***********************/ /* * usage - print a help message */ void usage(void) { printf("Usage: shell [-hvp]\n"); printf(" -h print this message\n"); printf(" -v print additional diagnostic information\n"); printf(" -p do not emit a command prompt\n"); exit(1); } /* * unix_error - unix-style error routine */ void unix_error(char *msg) { fprintf(stdout, "%s: %s\n", msg, strerror(errno)); exit(1); } /* * app_error - application-style error routine */ void app_error(char *msg) { fprintf(stdout, "%s\n", msg); exit(1); } /* * Signal - wrapper for the sigaction function */ handler_t *Signal(int signum, handler_t *handler) { struct sigaction action, old_action; action.sa_handler = handler; sigemptyset(&action.sa_mask); /* block sigs of type being handled */ action.sa_flags = SA_RESTART; /* restart syscalls if possible */ if (sigaction(signum, &action, &old_action) < 0) unix_error("Signal error"); return (old_action.sa_handler); } /* * sigquit_handler - The driver program can gracefully terminate the * child shell by sending it a SIGQUIT signal. */ void sigquit_handler(int sig) { printf("Terminating after receipt of SIGQUIT signal\n"); exit(1); }
the_stack_data/104827352.c
#include <stdio.h> // Print Celsius-Fahrenheit table // for celsius = 0, 20, ... 300 // floating point version with for loop int main(void) { float celsius, fahr; int lower, upper, step; lower = 0; upper = 300; step = 20; printf("Celsius\tFahr\n"); printf("---------------\n"); for (celsius = upper; celsius >= lower; celsius = celsius - step) { fahr = (9.0 / 5.0) * celsius + 32.0f; printf("%3.0f\t\t%6.1f\n", celsius, fahr); } return 0; } // NOTE: Sometimes the for loop can be more explicit and more readable then the // while loop because it's more compact. The initialization and the incrementation // of the counter variable is done through the for loop params. However, the while // loop can be, sometimes, more customizable.
the_stack_data/62095.c
// 编写程序确定计算机执行的是算术右移还是逻辑右移 #include <stdio.h> int main(void){ signed int w1 = -1 % 32; signed int flag; printf("%x\n", w1); w1 >>= 1; printf("%x\n", w1); flag = w1 >> 31; if(flag == -1) printf("SAR\n"); // 算术右移 else printf("SHR\n"); // 逻辑右移 return 0; }
the_stack_data/92327842.c
#define XOPEN_SOURCE 700 #define NB_PARAMETERS 3 #define BAD_PARAMETERS -1 #define BUFFER_LEN 1024 #define RW 00600 #include <stdio.h> /* perror, fprintf */ #include <errno.h> /* errno */ #include <stdlib.h> /* atoi, EXIT_SUCCESS, EXIT_FAILLURE */ #include <sys/types.h> /* open, wait */ #include <sys/stat.h> /* open, fchmod */ #include <fcntl.h> /* open */ #include <unistd.h> /* fork, exit, read, write, sleep, execv, execl */ #include <string.h> /* memset */ int main(int argc, char** argv) { int error = 0; int fprintf_return = 0; /* int fchmod_return = 0; */ int close_return = 0; int file_to_read = 0; int file_to_write = 0; ssize_t read_return = 0; ssize_t write_return = 0; char read_buffer[BUFFER_LEN] = ""; if (argc != NB_PARAMETERS) { fprintf_return = fprintf(stdout, "Usage: %s <fichier a lire> <fichier a ecrire> \n", argv[0]); if (fprintf_return < 0) { perror("Error fprintf"); return fprintf_return; } return BAD_PARAMETERS; } file_to_read = open(argv[1], O_RDONLY); if (file_to_read == -1) { error = errno; perror("Error open"); return error; } file_to_write = open(argv[2], O_CREAT | O_EXCL | O_WRONLY | O_TRUNC, RW); if (file_to_write == -1) { error = errno; perror("Error open"); return error; } /* fchmod_return = fchmod(file_to_read, RW); if (chmod_return == -1) { error = errno; perror("Error fchmod"); return error; }*/ while ((read_return = read(file_to_read, (void*)memset((void*)read_buffer, 0, (size_t)BUFFER_LEN), (size_t)BUFFER_LEN)) != 0) { if (read_return == -1) { error = errno; perror("Error read"); return error; } write_return = write(file_to_write, (const void*)read_buffer, (size_t)read_return); if (write_return == -1) { error = errno; perror("Error write"); return error; } } close_return = close(file_to_read); if (close_return == -1) { error = errno; perror("Error close"); return error; } close_return = close(file_to_write); if (close_return == -1) { error = errno; perror("Error close"); return error; } fprintf_return = fprintf(stdout, "Fichier copie ! \n"); if (fprintf_return < 0) { perror("Error fprintf"); return fprintf_return; } return EXIT_SUCCESS; }
the_stack_data/3410.c
/* $OpenBSD: memccpy.c,v 1.7 2015/08/31 02:53:57 guenther Exp $ */ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include <string.h> void * memccpy(void *t, const void *f, int c, size_t n) { if (n) { unsigned char *tp = t; const unsigned char *fp = f; unsigned char uc = c; do { if ((*tp++ = *fp++) == uc) return (tp); } while (--n != 0); } return (0); } DEF_WEAK(memccpy);
the_stack_data/70451038.c
/* * Optimized implementation of SKIPJACK algorithm * * originally written by Panu Rissanen <[email protected]> 1998.06.24 * optimized by Mark Tillotson <[email protected]> 1998.06.25 * optimized by Paulo Barreto <[email protected]> 1998.06.30 * gnupg support by Werner Koch <[email protected]> 1998.07.02 */ /* How to compile: * gcc -Wall -O2 -shared -fPIC -o skipjack skipjack.c */ #include <stdio.h> #include <stdlib.h> #include <assert.h> /* configuration stuff */ #ifdef __alpha__ #define SIZEOF_UNSIGNED_LONG 8 #else #define SIZEOF_UNSIGNED_LONG 4 #endif #if defined(__mc68000__) || defined (__sparc__) || defined (__PPC__) \ || (defined(__mips__) && (defined(MIPSEB) || defined (__MIPSEB__)) ) #define BIG_ENDIAN_HOST 1 #else #define LITTLE_ENDIAN_HOST 1 #endif typedef unsigned long ulong; typedef unsigned short ushort; typedef unsigned char byte; typedef unsigned short u16; #if SIZEOF_UNSIGNED_LONG == 4 typedef unsigned long u32; typedef unsigned long word32; #else typedef unsigned int u32; typedef unsigned int word32; #endif /* end configurable stuff */ #ifndef DIM #define DIM(v) (sizeof(v)/sizeof((v)[0])) #define DIMof(type,member) DIM(((type *)0)->member) #endif /* imports */ void g10_log_fatal( const char *fmt, ... ); #define FNCCAST_SETKEY(f) ((void(*)(void*, byte*, unsigned))(f)) #define FNCCAST_CRYPT(f) ((void(*)(void*, byte*, byte*))(f)) typedef struct { byte tab[10][256]; } SJ_context; static void selftest(void); /** * The F-table byte permutation (see description of the G-box permutation) */ static const byte fTable[256] = { 0xa3,0xd7,0x09,0x83,0xf8,0x48,0xf6,0xf4,0xb3,0x21,0x15,0x78,0x99,0xb1,0xaf,0xf9, 0xe7,0x2d,0x4d,0x8a,0xce,0x4c,0xca,0x2e,0x52,0x95,0xd9,0x1e,0x4e,0x38,0x44,0x28, 0x0a,0xdf,0x02,0xa0,0x17,0xf1,0x60,0x68,0x12,0xb7,0x7a,0xc3,0xe9,0xfa,0x3d,0x53, 0x96,0x84,0x6b,0xba,0xf2,0x63,0x9a,0x19,0x7c,0xae,0xe5,0xf5,0xf7,0x16,0x6a,0xa2, 0x39,0xb6,0x7b,0x0f,0xc1,0x93,0x81,0x1b,0xee,0xb4,0x1a,0xea,0xd0,0x91,0x2f,0xb8, 0x55,0xb9,0xda,0x85,0x3f,0x41,0xbf,0xe0,0x5a,0x58,0x80,0x5f,0x66,0x0b,0xd8,0x90, 0x35,0xd5,0xc0,0xa7,0x33,0x06,0x65,0x69,0x45,0x00,0x94,0x56,0x6d,0x98,0x9b,0x76, 0x97,0xfc,0xb2,0xc2,0xb0,0xfe,0xdb,0x20,0xe1,0xeb,0xd6,0xe4,0xdd,0x47,0x4a,0x1d, 0x42,0xed,0x9e,0x6e,0x49,0x3c,0xcd,0x43,0x27,0xd2,0x07,0xd4,0xde,0xc7,0x67,0x18, 0x89,0xcb,0x30,0x1f,0x8d,0xc6,0x8f,0xaa,0xc8,0x74,0xdc,0xc9,0x5d,0x5c,0x31,0xa4, 0x70,0x88,0x61,0x2c,0x9f,0x0d,0x2b,0x87,0x50,0x82,0x54,0x64,0x26,0x7d,0x03,0x40, 0x34,0x4b,0x1c,0x73,0xd1,0xc4,0xfd,0x3b,0xcc,0xfb,0x7f,0xab,0xe6,0x3e,0x5b,0xa5, 0xad,0x04,0x23,0x9c,0x14,0x51,0x22,0xf0,0x29,0x79,0x71,0x7e,0xff,0x8c,0x0e,0xe2, 0x0c,0xef,0xbc,0x72,0x75,0x6f,0x37,0xa1,0xec,0xd3,0x8e,0x62,0x8b,0x86,0x10,0xe8, 0x08,0x77,0x11,0xbe,0x92,0x4f,0x24,0xc5,0x32,0x36,0x9d,0xcf,0xf3,0xa6,0xbb,0xac, 0x5e,0x6c,0xa9,0x13,0x57,0x25,0xb5,0xe3,0xbd,0xa8,0x3a,0x01,0x05,0x59,0x2a,0x46 }; /** * The key-dependent permutation G on V^16 is a four-round Feistel network. * The round function is a fixed byte-substitution table (permutation on V^8), * the F-table. Each round of G incorporates a single byte from the key. */ #define g(tab, w, i, j, k, l) \ { \ w ^= (word32)tab[i][w & 0xff] << 8; \ w ^= (word32)tab[j][w >> 8]; \ w ^= (word32)tab[k][w & 0xff] << 8; \ w ^= (word32)tab[l][w >> 8]; \ } #define g0(tab, w) g(tab, w, 0, 1, 2, 3) #define g1(tab, w) g(tab, w, 4, 5, 6, 7) #define g2(tab, w) g(tab, w, 8, 9, 0, 1) #define g3(tab, w) g(tab, w, 2, 3, 4, 5) #define g4(tab, w) g(tab, w, 6, 7, 8, 9) /** * The inverse of the G permutation. */ #define h(tab, w, i, j, k, l) \ { \ w ^= (word32)tab[l][w >> 8]; \ w ^= (word32)tab[k][w & 0xff] << 8; \ w ^= (word32)tab[j][w >> 8]; \ w ^= (word32)tab[i][w & 0xff] << 8; \ } #define h0(tab, w) h(tab, w, 0, 1, 2, 3) #define h1(tab, w) h(tab, w, 4, 5, 6, 7) #define h2(tab, w) h(tab, w, 8, 9, 0, 1) #define h3(tab, w) h(tab, w, 2, 3, 4, 5) #define h4(tab, w) h(tab, w, 6, 7, 8, 9) /** * Preprocess a user key into a table to save an XOR at each F-table access. */ static void makeKey( SJ_context *ctx, byte *key, unsigned keylen ) { int i; static int initialized; if( !initialized ) { initialized = 1; selftest(); } assert(keylen == 10); /* tab[i][c] = fTable[c ^ key[i]] */ for (i = 0; i < 10; i++) { byte *t = ctx->tab[i], k = key[i]; int c; for (c = 0; c < 256; c++) { t[c] = fTable[c ^ k]; } } } /** * Encrypt a single block of data. */ static void encrypt_block( SJ_context *ctx, byte *out, byte *in ) { word32 w1, w2, w3, w4; w1 = (in[0] << 8) + in[1]; w2 = (in[2] << 8) + in[3]; w3 = (in[4] << 8) + in[5]; w4 = (in[6] << 8) + in[7]; /* stepping rule A: */ g0((ctx->tab), w1); w4 ^= w1 ^ 1; g1((ctx->tab), w4); w3 ^= w4 ^ 2; g2((ctx->tab), w3); w2 ^= w3 ^ 3; g3((ctx->tab), w2); w1 ^= w2 ^ 4; g4((ctx->tab), w1); w4 ^= w1 ^ 5; g0((ctx->tab), w4); w3 ^= w4 ^ 6; g1((ctx->tab), w3); w2 ^= w3 ^ 7; g2((ctx->tab), w2); w1 ^= w2 ^ 8; /* stepping rule B: */ w2 ^= w1 ^ 9; g3((ctx->tab), w1); w1 ^= w4 ^ 10; g4((ctx->tab), w4); w4 ^= w3 ^ 11; g0((ctx->tab), w3); w3 ^= w2 ^ 12; g1((ctx->tab), w2); w2 ^= w1 ^ 13; g2((ctx->tab), w1); w1 ^= w4 ^ 14; g3((ctx->tab), w4); w4 ^= w3 ^ 15; g4((ctx->tab), w3); w3 ^= w2 ^ 16; g0((ctx->tab), w2); /* stepping rule A: */ g1((ctx->tab), w1); w4 ^= w1 ^ 17; g2((ctx->tab), w4); w3 ^= w4 ^ 18; g3((ctx->tab), w3); w2 ^= w3 ^ 19; g4((ctx->tab), w2); w1 ^= w2 ^ 20; g0((ctx->tab), w1); w4 ^= w1 ^ 21; g1((ctx->tab), w4); w3 ^= w4 ^ 22; g2((ctx->tab), w3); w2 ^= w3 ^ 23; g3((ctx->tab), w2); w1 ^= w2 ^ 24; /* stepping rule B: */ w2 ^= w1 ^ 25; g4((ctx->tab), w1); w1 ^= w4 ^ 26; g0((ctx->tab), w4); w4 ^= w3 ^ 27; g1((ctx->tab), w3); w3 ^= w2 ^ 28; g2((ctx->tab), w2); w2 ^= w1 ^ 29; g3((ctx->tab), w1); w1 ^= w4 ^ 30; g4((ctx->tab), w4); w4 ^= w3 ^ 31; g0((ctx->tab), w3); w3 ^= w2 ^ 32; g1((ctx->tab), w2); out[0] = (byte)(w1 >> 8); out[1] = (byte)w1; out[2] = (byte)(w2 >> 8); out[3] = (byte)w2; out[4] = (byte)(w3 >> 8); out[5] = (byte)w3; out[6] = (byte)(w4 >> 8); out[7] = (byte)w4; } /** * Decrypt a single block of data. */ static void decrypt_block( SJ_context *ctx, byte *out, byte *in) { word32 w1, w2, w3, w4; w1 = (in[0] << 8) + in[1]; w2 = (in[2] << 8) + in[3]; w3 = (in[4] << 8) + in[5]; w4 = (in[6] << 8) + in[7]; /* stepping rule A: */ h1((ctx->tab), w2); w3 ^= w2 ^ 32; h0((ctx->tab), w3); w4 ^= w3 ^ 31; h4((ctx->tab), w4); w1 ^= w4 ^ 30; h3((ctx->tab), w1); w2 ^= w1 ^ 29; h2((ctx->tab), w2); w3 ^= w2 ^ 28; h1((ctx->tab), w3); w4 ^= w3 ^ 27; h0((ctx->tab), w4); w1 ^= w4 ^ 26; h4((ctx->tab), w1); w2 ^= w1 ^ 25; /* stepping rule B: */ w1 ^= w2 ^ 24; h3((ctx->tab), w2); w2 ^= w3 ^ 23; h2((ctx->tab), w3); w3 ^= w4 ^ 22; h1((ctx->tab), w4); w4 ^= w1 ^ 21; h0((ctx->tab), w1); w1 ^= w2 ^ 20; h4((ctx->tab), w2); w2 ^= w3 ^ 19; h3((ctx->tab), w3); w3 ^= w4 ^ 18; h2((ctx->tab), w4); w4 ^= w1 ^ 17; h1((ctx->tab), w1); /* stepping rule A: */ h0((ctx->tab), w2); w3 ^= w2 ^ 16; h4((ctx->tab), w3); w4 ^= w3 ^ 15; h3((ctx->tab), w4); w1 ^= w4 ^ 14; h2((ctx->tab), w1); w2 ^= w1 ^ 13; h1((ctx->tab), w2); w3 ^= w2 ^ 12; h0((ctx->tab), w3); w4 ^= w3 ^ 11; h4((ctx->tab), w4); w1 ^= w4 ^ 10; h3((ctx->tab), w1); w2 ^= w1 ^ 9; /* stepping rule B: */ w1 ^= w2 ^ 8; h2((ctx->tab), w2); w2 ^= w3 ^ 7; h1((ctx->tab), w3); w3 ^= w4 ^ 6; h0((ctx->tab), w4); w4 ^= w1 ^ 5; h4((ctx->tab), w1); w1 ^= w2 ^ 4; h3((ctx->tab), w2); w2 ^= w3 ^ 3; h2((ctx->tab), w3); w3 ^= w4 ^ 2; h1((ctx->tab), w4); w4 ^= w1 ^ 1; h0((ctx->tab), w1); out[0] = (byte)(w1 >> 8); out[1] = (byte)w1; out[2] = (byte)(w2 >> 8); out[3] = (byte)w2; out[4] = (byte)(w3 >> 8); out[5] = (byte)w3; out[6] = (byte)(w4 >> 8); out[7] = (byte)w4; } static void selftest() { SJ_context c; byte inp[8] = { 0x33, 0x22, 0x11, 0x00, 0xdd, 0xcc, 0xbb, 0xaa }; byte key[10] = { 0x00, 0x99, 0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11 }; byte enc[8], dec[8]; byte chk[8] = { 0x25, 0x87, 0xca, 0xe2, 0x7a, 0x12, 0xd3, 0x00 }; makeKey( &c, key, 10 ); encrypt_block( &c, enc, inp); if( memcmp( enc, chk, 8 ) ) g10_log_fatal("Skipjack test encryption failed\n"); decrypt_block( &c, dec, enc); if( memcmp( dec, inp, 8 ) ) g10_log_fatal("Skipjack test decryption failed\n"); } #ifdef TEST #include <stdio.h> #include <string.h> #include <time.h> int main() { byte inp[8] = { 0x33, 0x22, 0x11, 0x00, 0xdd, 0xcc, 0xbb, 0xaa }; byte key[10] = { 0x00, 0x99, 0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11 }; byte enc[8], dec[8]; byte chk[8] = { 0x25, 0x87, 0xca, 0xe2, 0x7a, 0x12, 0xd3, 0x00 }; byte tab[10][256]; int i; clock_t elapsed; makeKey(key, tab); encrypt(tab, inp, enc); printf((memcmp(enc, chk, 8) == 0) ? "encryption OK!\n" : "encryption failure!\n"); decrypt(tab, enc, dec); printf((memcmp(dec, inp, 8) == 0) ? "decryption OK!\n" : "decryption failure!\n"); elapsed = -clock(); for (i = 0; i < 1000000; i++) { encrypt(tab, inp, enc); } elapsed += clock(); printf ("elapsed time: %.1f s.\n", (float)elapsed/CLOCKS_PER_SEC); return 0; } #endif /*TEST*/ /**************** * Return some information about the algorithm. We need algo here to * distinguish different flavors of the algorithm. * Returns: A pointer to string describing the algorithm or NULL if * the ALGO is invalid. */ const char * skipjack_get_info( int algo, size_t *keylen, size_t *blocksize, size_t *contextsize, void (**r_setkey)( void *c, byte *key, unsigned keylen ), void (**r_encrypt)( void *c, byte *outbuf, byte *inbuf ), void (**r_decrypt)( void *c, byte *outbuf, byte *inbuf ) ) { *keylen = 80; *blocksize = 8; *contextsize = sizeof(SJ_context); *r_setkey = FNCCAST_SETKEY(makeKey); *r_encrypt= FNCCAST_CRYPT(encrypt_block); *r_decrypt= FNCCAST_CRYPT(decrypt_block); if( algo == 101 ) return "SKIPJACK"; return NULL; } const char * const gnupgext_version = "Skipjack ($Revision: 1.1 $)"; static struct { int class; int version; int value; void (*func)(void); } func_table[] = { { 20, 1, 0, (void(*)(void))skipjack_get_info }, { 21, 1, 101 }, }; void * gnupgext_enum_func( int what, int *sequence, int *class, int *vers ) { void *ret; int i = *sequence; do { if( i >= DIM(func_table) || i < 0 ) { return NULL; } *class = func_table[i].class; *vers = func_table[i].version; switch( *class ) { case 11: case 21: case 31: ret = &func_table[i].value; break; default: ret = func_table[i].func; break; } i++; } while( what && what != *class ); *sequence = i; return ret; }
the_stack_data/193892093.c
/* text version of maze 'mazefiles/binary/ies90f.maz' generated by mazetool (c) Peter Harrison 2018 o---o---o---o---o---o---o---o---o---o---o---o---o---o---o---o---o | | | o o---o---o---o o---o---o---o---o---o o---o---o---o---o o | | | | o o o---o o---o o o---o o---o o---o o---o o o | | | | | | | | | | | | o o o---o o---o---o---o---o---o---o---o---o---o o---o o | | | | | | | | | | | o o---o o---o---o o o---o o---o o---o o---o o o | | | | | o o o---o---o o---o---o---o---o o---o o---o---o o o | | | | | | | | | | | o o o o---o o---o---o o o o o o o o o o | | | | | | | | | o o o---o o o o o---o---o o o o o o o o | | | | | | | | | | | o o---o---o---o---o o o o o---o---o---o o o o o | | | | | | | | o o---o o---o---o o---o---o---o---o o---o---o---o o o | | | | | | | | o o---o o---o---o o o o---o---o---o---o---o---o o o | | | | | | | o o---o o---o o---o o o o---o---o o o o o o | | | | | | | | | | | | | | o---o---o o---o o o---o o o---o---o o o o o o | | | | | | | | | o o o---o o---o---o o---o o---o---o o---o o o o | | | | | | | | | | | | | o o o o o---o---o o o---o o---o---o o---o o o | | | | | | | | | o o o o---o o o---o---o---o o---o---o---o---o---o o | | | | o---o---o---o---o---o---o---o---o---o---o---o---o---o---o---o---o */ int ies90f_maz[] ={ 0x0E, 0x0A, 0x0A, 0x09, 0x0E, 0x0A, 0x0A, 0x08, 0x0A, 0x08, 0x0A, 0x08, 0x0A, 0x0A, 0x0A, 0x09, 0x0C, 0x0A, 0x0A, 0x01, 0x0D, 0x0D, 0x0D, 0x05, 0x0C, 0x00, 0x0A, 0x03, 0x0C, 0x08, 0x09, 0x05, 0x04, 0x0A, 0x0B, 0x04, 0x00, 0x00, 0x00, 0x01, 0x05, 0x04, 0x09, 0x0C, 0x01, 0x07, 0x05, 0x05, 0x07, 0x0E, 0x0A, 0x03, 0x07, 0x07, 0x07, 0x07, 0x06, 0x01, 0x05, 0x05, 0x06, 0x0A, 0x01, 0x05, 0x0C, 0x0B, 0x0F, 0x0C, 0x0A, 0x09, 0x0D, 0x0D, 0x0C, 0x02, 0x02, 0x03, 0x0D, 0x0D, 0x04, 0x01, 0x04, 0x09, 0x0F, 0x04, 0x0B, 0x04, 0x02, 0x02, 0x02, 0x0B, 0x0D, 0x0C, 0x03, 0x06, 0x01, 0x07, 0x05, 0x06, 0x08, 0x03, 0x0C, 0x02, 0x0B, 0x0C, 0x0A, 0x09, 0x05, 0x04, 0x0B, 0x0E, 0x01, 0x0D, 0x05, 0x0E, 0x03, 0x0C, 0x02, 0x0A, 0x0B, 0x04, 0x09, 0x06, 0x01, 0x05, 0x0D, 0x0D, 0x05, 0x05, 0x05, 0x0D, 0x0C, 0x02, 0x0A, 0x09, 0x0D, 0x06, 0x03, 0x0C, 0x03, 0x04, 0x01, 0x06, 0x01, 0x05, 0x04, 0x00, 0x01, 0x0F, 0x0F, 0x05, 0x05, 0x0D, 0x0C, 0x02, 0x0A, 0x01, 0x07, 0x0D, 0x05, 0x05, 0x05, 0x05, 0x05, 0x0F, 0x0F, 0x05, 0x04, 0x01, 0x06, 0x08, 0x0B, 0x04, 0x09, 0x06, 0x00, 0x01, 0x05, 0x05, 0x06, 0x08, 0x0A, 0x01, 0x05, 0x05, 0x0E, 0x02, 0x08, 0x01, 0x07, 0x0F, 0x05, 0x05, 0x05, 0x04, 0x0B, 0x04, 0x0A, 0x01, 0x05, 0x06, 0x08, 0x0A, 0x03, 0x04, 0x0B, 0x0E, 0x01, 0x05, 0x05, 0x05, 0x0E, 0x02, 0x0A, 0x03, 0x05, 0x0E, 0x02, 0x08, 0x0B, 0x05, 0x0E, 0x0B, 0x05, 0x05, 0x05, 0x04, 0x0A, 0x0A, 0x0A, 0x08, 0x02, 0x0A, 0x0A, 0x02, 0x0A, 0x02, 0x0B, 0x0C, 0x03, 0x05, 0x06, 0x02, 0x0A, 0x0A, 0x0A, 0x02, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x02, 0x0A, 0x03, }; /* end of mazefile */
the_stack_data/29824145.c
/* test/igetest.c -*- mode:C; c-file-style: "eay" -*- */ /* ==================================================================== * Copyright (c) 2006 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. All advertising materials mentioning features or use of this * software must display the following acknowledgment: * "This product includes software developed by the OpenSSL Project * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" * * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to * endorse or promote products derived from this software without * prior written permission. For written permission, please contact * [email protected]. * * 5. Products derived from this software may not be called "OpenSSL" * nor may "OpenSSL" appear in their names without prior written * permission of the OpenSSL Project. * * 6. Redistributions of any form whatsoever must retain the following * acknowledgment: * "This product includes software developed by the OpenSSL Project * for use in the OpenSSL Toolkit (http://www.openssl.org/)" * * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * ==================================================================== * */ #include <openssl/aes.h> #include <openssl/rand.h> #include <stdio.h> #include <string.h> #include <assert.h> #define TEST_SIZE 128 #define BIG_TEST_SIZE 10240 static void hexdump(FILE *f,const char *title,const unsigned char *s,int l) { int n=0; fprintf(f,"%s",title); for( ; n < l ; ++n) { if((n%16) == 0) fprintf(f,"\n%04x",n); fprintf(f," %02x",s[n]); } fprintf(f,"\n"); } #define MAX_VECTOR_SIZE 64 struct ige_test { const unsigned char key[16]; const unsigned char iv[32]; const unsigned char in[MAX_VECTOR_SIZE]; const unsigned char out[MAX_VECTOR_SIZE]; const size_t length; const int encrypt; }; static struct ige_test const ige_test_vectors[] = { { { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, /* key */ { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f }, /* iv */ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* in */ { 0x1a, 0x85, 0x19, 0xa6, 0x55, 0x7b, 0xe6, 0x52, 0xe9, 0xda, 0x8e, 0x43, 0xda, 0x4e, 0xf4, 0x45, 0x3c, 0xf4, 0x56, 0xb4, 0xca, 0x48, 0x8a, 0xa3, 0x83, 0xc7, 0x9c, 0x98, 0xb3, 0x47, 0x97, 0xcb }, /* out */ 32, AES_ENCRYPT }, /* test vector 0 */ { { 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x65 }, /* key */ { 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x49, 0x47, 0x45, 0x20, 0x6d, 0x6f, 0x64, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x4f, 0x70, 0x65, 0x6e, 0x53, 0x53 }, /* iv */ { 0x4c, 0x2e, 0x20, 0x4c, 0x65, 0x74, 0x27, 0x73, 0x20, 0x68, 0x6f, 0x70, 0x65, 0x20, 0x42, 0x65, 0x6e, 0x20, 0x67, 0x6f, 0x74, 0x20, 0x69, 0x74, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x21, 0x0a }, /* in */ { 0x99, 0x70, 0x64, 0x87, 0xa1, 0xcd, 0xe6, 0x13, 0xbc, 0x6d, 0xe0, 0xb6, 0xf2, 0x4b, 0x1c, 0x7a, 0xa4, 0x48, 0xc8, 0xb9, 0xc3, 0x40, 0x3e, 0x34, 0x67, 0xa8, 0xca, 0xd8, 0x93, 0x40, 0xf5, 0x3b }, /* out */ 32, AES_DECRYPT }, /* test vector 1 */ }; struct bi_ige_test { const unsigned char key1[32]; const unsigned char key2[32]; const unsigned char iv[64]; const unsigned char in[MAX_VECTOR_SIZE]; const unsigned char out[MAX_VECTOR_SIZE]; const size_t keysize; const size_t length; const int encrypt; }; static struct bi_ige_test const bi_ige_test_vectors[] = { { { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, /* key1 */ { 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f }, /* key2 */ { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f }, /* iv */ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* in */ { 0x14, 0x40, 0x6f, 0xae, 0xa2, 0x79, 0xf2, 0x56, 0x1f, 0x86, 0xeb, 0x3b, 0x7d, 0xff, 0x53, 0xdc, 0x4e, 0x27, 0x0c, 0x03, 0xde, 0x7c, 0xe5, 0x16, 0x6a, 0x9c, 0x20, 0x33, 0x9d, 0x33, 0xfe, 0x12 }, /* out */ 16, 32, AES_ENCRYPT }, /* test vector 0 */ { { 0x58, 0x0a, 0x06, 0xe9, 0x97, 0x07, 0x59, 0x5c, 0x9e, 0x19, 0xd2, 0xa7, 0xbb, 0x40, 0x2b, 0x7a, 0xc7, 0xd8, 0x11, 0x9e, 0x4c, 0x51, 0x35, 0x75, 0x64, 0x28, 0x0f, 0x23, 0xad, 0x74, 0xac, 0x37 }, /* key1 */ { 0xd1, 0x80, 0xa0, 0x31, 0x47, 0xa3, 0x11, 0x13, 0x86, 0x26, 0x9e, 0x6d, 0xff, 0xaf, 0x72, 0x74, 0x5b, 0xa2, 0x35, 0x81, 0xd2, 0xa6, 0x3d, 0x21, 0x67, 0x7b, 0x58, 0xa8, 0x18, 0xf9, 0x72, 0xe4 }, /* key2 */ { 0x80, 0x3d, 0xbd, 0x4c, 0xe6, 0x7b, 0x06, 0xa9, 0x53, 0x35, 0xd5, 0x7e, 0x71, 0xc1, 0x70, 0x70, 0x74, 0x9a, 0x00, 0x28, 0x0c, 0xbf, 0x6c, 0x42, 0x9b, 0xa4, 0xdd, 0x65, 0x11, 0x77, 0x7c, 0x67, 0xfe, 0x76, 0x0a, 0xf0, 0xd5, 0xc6, 0x6e, 0x6a, 0xe7, 0x5e, 0x4c, 0xf2, 0x7e, 0x9e, 0xf9, 0x20, 0x0e, 0x54, 0x6f, 0x2d, 0x8a, 0x8d, 0x7e, 0xbd, 0x48, 0x79, 0x37, 0x99, 0xff, 0x27, 0x93, 0xa3 }, /* iv */ { 0xf1, 0x54, 0x3d, 0xca, 0xfe, 0xb5, 0xef, 0x1c, 0x4f, 0xa6, 0x43, 0xf6, 0xe6, 0x48, 0x57, 0xf0, 0xee, 0x15, 0x7f, 0xe3, 0xe7, 0x2f, 0xd0, 0x2f, 0x11, 0x95, 0x7a, 0x17, 0x00, 0xab, 0xa7, 0x0b, 0xbe, 0x44, 0x09, 0x9c, 0xcd, 0xac, 0xa8, 0x52, 0xa1, 0x8e, 0x7b, 0x75, 0xbc, 0xa4, 0x92, 0x5a, 0xab, 0x46, 0xd3, 0x3a, 0xa0, 0xd5, 0x35, 0x1c, 0x55, 0xa4, 0xb3, 0xa8, 0x40, 0x81, 0xa5, 0x0b}, /* in */ { 0x42, 0xe5, 0x28, 0x30, 0x31, 0xc2, 0xa0, 0x23, 0x68, 0x49, 0x4e, 0xb3, 0x24, 0x59, 0x92, 0x79, 0xc1, 0xa5, 0xcc, 0xe6, 0x76, 0x53, 0xb1, 0xcf, 0x20, 0x86, 0x23, 0xe8, 0x72, 0x55, 0x99, 0x92, 0x0d, 0x16, 0x1c, 0x5a, 0x2f, 0xce, 0xcb, 0x51, 0xe2, 0x67, 0xfa, 0x10, 0xec, 0xcd, 0x3d, 0x67, 0xa5, 0xe6, 0xf7, 0x31, 0x26, 0xb0, 0x0d, 0x76, 0x5e, 0x28, 0xdc, 0x7f, 0x01, 0xc5, 0xa5, 0x4c}, /* out */ 32, 64, AES_ENCRYPT }, /* test vector 1 */ }; static int run_test_vectors(void) { unsigned int n; int errs = 0; for(n=0 ; n < sizeof(ige_test_vectors)/sizeof(ige_test_vectors[0]) ; ++n) { const struct ige_test * const v = &ige_test_vectors[n]; AES_KEY key; unsigned char buf[MAX_VECTOR_SIZE]; unsigned char iv[AES_BLOCK_SIZE*2]; assert(v->length <= MAX_VECTOR_SIZE); if(v->encrypt == AES_ENCRYPT) AES_set_encrypt_key(v->key, 8*sizeof v->key, &key); else AES_set_decrypt_key(v->key, 8*sizeof v->key, &key); memcpy(iv, v->iv, sizeof iv); AES_ige_encrypt(v->in, buf, v->length, &key, iv, v->encrypt); if(memcmp(v->out, buf, v->length)) { printf("IGE test vector %d failed\n", n); hexdump(stdout, "key", v->key, sizeof v->key); hexdump(stdout, "iv", v->iv, sizeof v->iv); hexdump(stdout, "in", v->in, v->length); hexdump(stdout, "expected", v->out, v->length); hexdump(stdout, "got", buf, v->length); ++errs; } /* try with in == out */ memcpy(iv, v->iv, sizeof iv); memcpy(buf, v->in, v->length); AES_ige_encrypt(buf, buf, v->length, &key, iv, v->encrypt); if(memcmp(v->out, buf, v->length)) { printf("IGE test vector %d failed (with in == out)\n", n); hexdump(stdout, "key", v->key, sizeof v->key); hexdump(stdout, "iv", v->iv, sizeof v->iv); hexdump(stdout, "in", v->in, v->length); hexdump(stdout, "expected", v->out, v->length); hexdump(stdout, "got", buf, v->length); ++errs; } } for(n=0 ; n < sizeof(bi_ige_test_vectors)/sizeof(bi_ige_test_vectors[0]) ; ++n) { const struct bi_ige_test * const v = &bi_ige_test_vectors[n]; AES_KEY key1; AES_KEY key2; unsigned char buf[MAX_VECTOR_SIZE]; assert(v->length <= MAX_VECTOR_SIZE); if(v->encrypt == AES_ENCRYPT) { AES_set_encrypt_key(v->key1, 8*v->keysize, &key1); AES_set_encrypt_key(v->key2, 8*v->keysize, &key2); } else { AES_set_decrypt_key(v->key1, 8*v->keysize, &key1); AES_set_decrypt_key(v->key2, 8*v->keysize, &key2); } AES_bi_ige_encrypt(v->in, buf, v->length, &key1, &key2, v->iv, v->encrypt); if(memcmp(v->out, buf, v->length)) { printf("Bidirectional IGE test vector %d failed\n", n); hexdump(stdout, "key 1", v->key1, sizeof v->key1); hexdump(stdout, "key 2", v->key2, sizeof v->key2); hexdump(stdout, "iv", v->iv, sizeof v->iv); hexdump(stdout, "in", v->in, v->length); hexdump(stdout, "expected", v->out, v->length); hexdump(stdout, "got", buf, v->length); ++errs; } } return errs; } int main(int argc, char **argv) { unsigned char rkey[16]; unsigned char rkey2[16]; AES_KEY key; AES_KEY key2; unsigned char plaintext[BIG_TEST_SIZE]; unsigned char ciphertext[BIG_TEST_SIZE]; unsigned char checktext[BIG_TEST_SIZE]; unsigned char iv[AES_BLOCK_SIZE*4]; unsigned char saved_iv[AES_BLOCK_SIZE*4]; int err = 0; unsigned int n; unsigned matches; assert(BIG_TEST_SIZE >= TEST_SIZE); RAND_pseudo_bytes(rkey, sizeof rkey); RAND_pseudo_bytes(plaintext, sizeof plaintext); RAND_pseudo_bytes(iv, sizeof iv); memcpy(saved_iv, iv, sizeof saved_iv); /* Forward IGE only... */ /* Straight encrypt/decrypt */ AES_set_encrypt_key(rkey, 8*sizeof rkey, &key); AES_ige_encrypt(plaintext, ciphertext, TEST_SIZE, &key, iv, AES_ENCRYPT); AES_set_decrypt_key(rkey, 8*sizeof rkey, &key); memcpy(iv, saved_iv, sizeof iv); AES_ige_encrypt(ciphertext, checktext, TEST_SIZE, &key, iv, AES_DECRYPT); if(memcmp(checktext, plaintext, TEST_SIZE)) { printf("Encrypt+decrypt doesn't match\n"); hexdump(stdout, "Plaintext", plaintext, TEST_SIZE); hexdump(stdout, "Checktext", checktext, TEST_SIZE); ++err; } /* Now check encrypt chaining works */ AES_set_encrypt_key(rkey, 8*sizeof rkey, &key); memcpy(iv, saved_iv, sizeof iv); AES_ige_encrypt(plaintext, ciphertext, TEST_SIZE/2, &key, iv, AES_ENCRYPT); AES_ige_encrypt(plaintext+TEST_SIZE/2, ciphertext+TEST_SIZE/2, TEST_SIZE/2, &key, iv, AES_ENCRYPT); AES_set_decrypt_key(rkey, 8*sizeof rkey, &key); memcpy(iv, saved_iv, sizeof iv); AES_ige_encrypt(ciphertext, checktext, TEST_SIZE, &key, iv, AES_DECRYPT); if(memcmp(checktext, plaintext, TEST_SIZE)) { printf("Chained encrypt+decrypt doesn't match\n"); hexdump(stdout, "Plaintext", plaintext, TEST_SIZE); hexdump(stdout, "Checktext", checktext, TEST_SIZE); ++err; } /* And check decrypt chaining */ AES_set_encrypt_key(rkey, 8*sizeof rkey, &key); memcpy(iv, saved_iv, sizeof iv); AES_ige_encrypt(plaintext, ciphertext, TEST_SIZE/2, &key, iv, AES_ENCRYPT); AES_ige_encrypt(plaintext+TEST_SIZE/2, ciphertext+TEST_SIZE/2, TEST_SIZE/2, &key, iv, AES_ENCRYPT); AES_set_decrypt_key(rkey, 8*sizeof rkey, &key); memcpy(iv, saved_iv, sizeof iv); AES_ige_encrypt(ciphertext, checktext, TEST_SIZE/2, &key, iv, AES_DECRYPT); AES_ige_encrypt(ciphertext+TEST_SIZE/2, checktext+TEST_SIZE/2, TEST_SIZE/2, &key, iv, AES_DECRYPT); if(memcmp(checktext, plaintext, TEST_SIZE)) { printf("Chained encrypt+chained decrypt doesn't match\n"); hexdump(stdout, "Plaintext", plaintext, TEST_SIZE); hexdump(stdout, "Checktext", checktext, TEST_SIZE); ++err; } /* make sure garble extends forwards only */ AES_set_encrypt_key(rkey, 8*sizeof rkey, &key); memcpy(iv, saved_iv, sizeof iv); AES_ige_encrypt(plaintext, ciphertext, sizeof plaintext, &key, iv, AES_ENCRYPT); /* corrupt halfway through */ ++ciphertext[sizeof ciphertext/2]; AES_set_decrypt_key(rkey, 8*sizeof rkey, &key); memcpy(iv, saved_iv, sizeof iv); AES_ige_encrypt(ciphertext, checktext, sizeof checktext, &key, iv, AES_DECRYPT); matches=0; for(n=0 ; n < sizeof checktext ; ++n) if(checktext[n] == plaintext[n]) ++matches; if(matches > sizeof checktext/2+sizeof checktext/100) { printf("More than 51%% matches after garbling\n"); ++err; } if(matches < sizeof checktext/2) { printf("Garble extends backwards!\n"); ++err; } /* Bi-directional IGE */ /* Note that we don't have to recover the IV, because chaining isn't */ /* possible with biIGE, so the IV is not updated. */ RAND_pseudo_bytes(rkey2, sizeof rkey2); /* Straight encrypt/decrypt */ AES_set_encrypt_key(rkey, 8*sizeof rkey, &key); AES_set_encrypt_key(rkey2, 8*sizeof rkey2, &key2); AES_bi_ige_encrypt(plaintext, ciphertext, TEST_SIZE, &key, &key2, iv, AES_ENCRYPT); AES_set_decrypt_key(rkey, 8*sizeof rkey, &key); AES_set_decrypt_key(rkey2, 8*sizeof rkey2, &key2); AES_bi_ige_encrypt(ciphertext, checktext, TEST_SIZE, &key, &key2, iv, AES_DECRYPT); if(memcmp(checktext, plaintext, TEST_SIZE)) { printf("Encrypt+decrypt doesn't match\n"); hexdump(stdout, "Plaintext", plaintext, TEST_SIZE); hexdump(stdout, "Checktext", checktext, TEST_SIZE); ++err; } /* make sure garble extends both ways */ AES_set_encrypt_key(rkey, 8*sizeof rkey, &key); AES_set_encrypt_key(rkey2, 8*sizeof rkey2, &key2); AES_ige_encrypt(plaintext, ciphertext, sizeof plaintext, &key, iv, AES_ENCRYPT); /* corrupt halfway through */ ++ciphertext[sizeof ciphertext/2]; AES_set_decrypt_key(rkey, 8*sizeof rkey, &key); AES_set_decrypt_key(rkey2, 8*sizeof rkey2, &key2); AES_ige_encrypt(ciphertext, checktext, sizeof checktext, &key, iv, AES_DECRYPT); matches=0; for(n=0 ; n < sizeof checktext ; ++n) if(checktext[n] == plaintext[n]) ++matches; if(matches > sizeof checktext/100) { printf("More than 1%% matches after bidirectional garbling\n"); ++err; } /* make sure garble extends both ways (2) */ AES_set_encrypt_key(rkey, 8*sizeof rkey, &key); AES_set_encrypt_key(rkey2, 8*sizeof rkey2, &key2); AES_ige_encrypt(plaintext, ciphertext, sizeof plaintext, &key, iv, AES_ENCRYPT); /* corrupt right at the end */ ++ciphertext[sizeof ciphertext-1]; AES_set_decrypt_key(rkey, 8*sizeof rkey, &key); AES_set_decrypt_key(rkey2, 8*sizeof rkey2, &key2); AES_ige_encrypt(ciphertext, checktext, sizeof checktext, &key, iv, AES_DECRYPT); matches=0; for(n=0 ; n < sizeof checktext ; ++n) if(checktext[n] == plaintext[n]) ++matches; if(matches > sizeof checktext/100) { printf("More than 1%% matches after bidirectional garbling (2)\n"); ++err; } /* make sure garble extends both ways (3) */ AES_set_encrypt_key(rkey, 8*sizeof rkey, &key); AES_set_encrypt_key(rkey2, 8*sizeof rkey2, &key2); AES_ige_encrypt(plaintext, ciphertext, sizeof plaintext, &key, iv, AES_ENCRYPT); /* corrupt right at the start */ ++ciphertext[0]; AES_set_decrypt_key(rkey, 8*sizeof rkey, &key); AES_set_decrypt_key(rkey2, 8*sizeof rkey2, &key2); AES_ige_encrypt(ciphertext, checktext, sizeof checktext, &key, iv, AES_DECRYPT); matches=0; for(n=0 ; n < sizeof checktext ; ++n) if(checktext[n] == plaintext[n]) ++matches; if(matches > sizeof checktext/100) { printf("More than 1%% matches after bidirectional garbling (3)\n"); ++err; } err += run_test_vectors(); return err; }
the_stack_data/2798.c
#include <stdio.h> #include <stdbool.h> #define size_of_array(array) sizeof(array) / sizeof(int*) static const int MONTHS_WITH_31_DAYS[7] = {1, 3, 5, 7, 8, 10, 12}, MONTHS_WITH_30_DAYS[4] = {4, 6, 9, 11}; static const int MIN_COUNT_OF_DAYS = 28, AVERAGE_COUNT_OF_DAYS = 30, MAX_COUNT_OF_DAYS = 31; static const int MAX_COUNT_OF_MONTHS = 12; bool is_in_array(int month_number, const int array[], int array_size) { for(int i = 0; i < array_size; i++) if(month_number == array[i]) return true; return false; } bool is_bissextile(int year) { if((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) return true; return false; } void get_date(const char string[], int *day, int *month, int *year) { *day = (string[0] - '0') * 10 + (string[1] - '0'); *month = (string[3] - '0') * 10 + (string[4] - '0'); *year = (string[6] - '0') * 1000 + (string[7] - '0') * 100 + (string[8] - '0') * 10 + (string[9] - '0'); } void print_next_date(int next_day, int next_month, int next_year) { if(next_day < 10) printf("%i%i-", 0, next_day); else printf("%i-", next_day); if(next_month < 10) printf("%i%i-", 0, next_month); else printf("%i-", next_month); if(next_year < 10) printf("%i%i%i%i\n", 0, 0, 0, next_year); else if(next_year < 100) printf("%i%i%i\n", 0, 0, next_year); else if(next_year < 1000) printf("%i%i\n", 0, next_year); else printf("%i\n", next_year); } void plus_one_day(int day, int month, int year) { if(day < MIN_COUNT_OF_DAYS) print_next_date(day + 1, month, year); else if(is_in_array(day, MONTHS_WITH_30_DAYS, size_of_array(MONTHS_WITH_30_DAYS))) { if(day < AVERAGE_COUNT_OF_DAYS) print_next_date(day + 1, month, year); else if(month == MAX_COUNT_OF_MONTHS) print_next_date(1, 1, year + 1); else print_next_date(1, month + 1, year); } else if(is_in_array(day, MONTHS_WITH_31_DAYS, size_of_array(MONTHS_WITH_31_DAYS))) { if(day < MAX_COUNT_OF_DAYS) print_next_date(day + 1, month, year); else if(month == MAX_COUNT_OF_MONTHS) print_next_date(1, 1, year + 1); else print_next_date(1, month + 1, year); } else { if(is_bissextile(year)) { if(day < MIN_COUNT_OF_DAYS + 1) print_next_date(day + 1, month, year); else if(month == MAX_COUNT_OF_MONTHS) print_next_date(1, 1, year + 1); else print_next_date(1, month + 1, year); } else { if(day < MIN_COUNT_OF_DAYS) print_next_date(day + 1, month, year); else if(month == MAX_COUNT_OF_MONTHS) print_next_date(1, 1, year + 1); else print_next_date(1, month + 1, year); } } } int main() { int input_day = 0, input_month = 0, input_year = 0; char input_string[10]; scanf("%s", input_string); get_date(input_string, &input_day, &input_month, &input_year); plus_one_day(input_day, input_month, input_year); return 0; }
the_stack_data/14813.c
// main.c int main(void) { hello(); return 0; }
the_stack_data/1264150.c
// Diamond // Author: Don Brace // #include <stdio.h> #include <stdlib.h> // A bit of recursive trickery. // char * pr(char *ch, int scale, int topscale, int margin) { printf("%*.*s%*.*s%.*s", margin + 1 - scale, scale, ch, scale > 1 ? 2 * scale - 2 : 0, scale - 1, ch, scale, topscale > scale ? pr(ch, scale + 1, topscale, margin) : scale > 1 ? pr(ch, scale - 1, scale - 1, margin) : "\n"); return "\n"; } int main(int argc, char *argv[]) { char c; int scale; scanf("%c %d", &c, &scale); //printf("char %c, scale %d\n", c, scale); pr(&c, 1, scale, scale); //printf("Done\n"); return 0; }
the_stack_data/1243616.c
#include <stdio.h> #include <stdlib.h> #define N 100 int main() { int *A = (int *)malloc(N*sizeof(int)); int *B = (int *)malloc(N*sizeof(int)); int i; for (i = 0; i <= N; i++) { A[i] = 0; B[i] = i; A[i] += B[i]; } return 0; }
the_stack_data/1160320.c
/* users - list the users Author: Terrence W. Holm */ /* Usage: users * * A simple users(1) command for MINIX. Assumes tty0 * to tty9 are the only possible login devices. * See last.c for more robust code for reading wtmp. */ #include <sys/types.h> #include <utmp.h> #include <stdio.h> #ifndef WTMP #define WTMP "/usr/adm/wtmp" #endif #define min( a, b ) ( (a < b) ? a : b ) #define BUFFER_SIZE 1024 /* Room for wtmp records */ #define MAX_WTMP_COUNT ( BUFFER_SIZE / sizeof(struct utmp) ) struct utmp wtmp_buffer[MAX_WTMP_COUNT]; main() { FILE *f; long size; /* Number of wtmp records in the file */ int wtmp_count; /* How many to read into wtmp_buffer */ int used = 0; int user_count = 0; char users[10][8]; if ((f = fopen(WTMP, "r")) == NULL) /* No login/logout records kept */ exit(0); if (fseek(f, 0L, 2) != 0 || (size = ftell(f)) % sizeof(struct utmp) != 0) { fprintf(stderr, "users: invalid wtmp file\n"); exit(1); } size /= sizeof(struct utmp); /* Number of records in wtmp */ while (size > 0) { wtmp_count = (int) min(size, MAX_WTMP_COUNT); size -= (long) wtmp_count; fseek(f, size * sizeof(struct utmp), 0); if (fread(&wtmp_buffer[0], sizeof(struct utmp), wtmp_count, f) != wtmp_count) { fprintf(stderr, "users: read error on wtmp file\n"); exit(1); } while (--wtmp_count >= 0) { int tty; if (strcmp(wtmp_buffer[wtmp_count].ut_line, "~") == 0) { Print_Users(user_count, users); exit(0); } tty = wtmp_buffer[wtmp_count].ut_line[3] - '0'; if (tty < 0 || tty > 9) { fprintf(stderr, "users: encountered unknown tty in wtmp file\n"); exit(1); } if (!(used & (1 << tty))) { used |= 1 << tty; memcpy(users[user_count], wtmp_buffer[wtmp_count].ut_name, 8); if (users[user_count][0] != '\0') ++user_count; } } } /* end while( size > 0 ) */ Print_Users(user_count, users); exit(0); } Strncmp(str1, str2) char *str1; char *str2; { return(strncmp(str1, str2, 8)); } Print_Users(user_count, users) int user_count; char *users; { int i; qsort(users, user_count, 8, Strncmp); for (i = 0; i < user_count - 1; ++i) { printf("%.8s ", users); users += 8; } if (user_count > 0) printf("%.8s\n", users); }
the_stack_data/59844.c
/* * XXX This sample code was once meant to show how to use the basic Libevent * interfaces, but it never worked on non-Unix platforms, and some of the * interfaces have changed since it was first written. It should probably * be removed or replaced with something better. * * Compile with: * cc -I/usr/local/include -o event-test event-test.c -L/usr/local/lib -levent */ #include <event2/event-config.h> #include <sys/types.h> #include <sys/stat.h> #ifndef WIN32 #include <sys/queue.h> #include <unistd.h> #include <sys/time.h> #else #include <winsock2.h> #include <windows.h> #endif #include <fcntl.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <errno.h> #include <event.h> static void fifo_read(evutil_socket_t fd, short event, void *arg) { char buf[255]; int len; struct event *ev = arg; #ifdef WIN32 DWORD dwBytesRead; #endif /* Reschedule this event */ event_add(ev, NULL); fprintf(stderr, "fifo_read called with fd: %d, event: %d, arg: %p\n", (int)fd, event, arg); #ifdef WIN32 len = ReadFile((HANDLE)fd, buf, sizeof(buf) - 1, &dwBytesRead, NULL); /* Check for end of file. */ if (len && dwBytesRead == 0) { fprintf(stderr, "End Of File"); event_del(ev); return; } buf[dwBytesRead] = '\0'; #else len = read(fd, buf, sizeof(buf) - 1); if (len == -1) { perror("read"); return; } else if (len == 0) { fprintf(stderr, "Connection closed\n"); return; } buf[len] = '\0'; #endif fprintf(stdout, "Read: %s\n", buf); } int main(int argc, char **argv) { struct event evfifo; #ifdef WIN32 HANDLE socket; /* Open a file. */ socket = CreateFileA("test.txt", /* open File */ GENERIC_READ, /* open for reading */ 0, /* do not share */ NULL, /* no security */ OPEN_EXISTING, /* existing file only */ FILE_ATTRIBUTE_NORMAL, /* normal file */ NULL); /* no attr. template */ if (socket == INVALID_HANDLE_VALUE) return 1; #else struct stat st; const char *fifo = "event.fifo"; int socket; if (lstat(fifo, &st) == 0) { if ((st.st_mode & S_IFMT) == S_IFREG) { errno = EEXIST; perror("lstat"); exit(1); } } unlink(fifo); if (mkfifo(fifo, 0600) == -1) { perror("mkfifo"); exit(1); } /* Linux pipes are broken, we need O_RDWR instead of O_RDONLY */ #ifdef __linux socket = open(fifo, O_RDWR | O_NONBLOCK, 0); #else socket = open(fifo, O_RDONLY | O_NONBLOCK, 0); #endif if (socket == -1) { perror("open"); exit(1); } fprintf(stderr, "Write data to %s\n", fifo); #endif /* Initalize the event library */ event_init(); /* Initalize one event */ #ifdef WIN32 event_set(&evfifo, (evutil_socket_t)socket, EV_READ, fifo_read, &evfifo); #else event_set(&evfifo, socket, EV_READ, fifo_read, &evfifo); #endif /* Add it to the active events, without a timeout */ event_add(&evfifo, NULL); event_dispatch(); #ifdef WIN32 CloseHandle(socket); #endif return (0); }
the_stack_data/1943.c
#include <stdio.h> #include <stdlib.h> int main (int argc, char** argv) { int n = argc > 1 ? atoi (argv[1]) : 2, i, j, k, w, po2; printf ("; spatially-balanced latin squares\n"); w = 1; while ((1 << w) < n) w++; po2 = ((1 << w) == n); printf ("; n = %d, w = %d\n", n, w); printf ("(set-logic QF_BV)\n"); if (!po2) { printf ("(declare-fun n () (_ BitVec %d))\n", w); printf ("(assert (= n (_ bv%d %d)))\n", n, w); } for (i = 0; i < n; i++) for (j = 0; j < n; j++) { printf ("(declare-fun r%dc%d () (_ BitVec %d))\n", i, j, w); if (!po2) printf ("(assert (bvult r%dc%d n))\n", i, j); } for (i = 0; i < n; i++) for (j = 0; j < n - 1; j++) for (k = j + 1; k < n; k++) { printf ("(assert (distinct r%dc%d r%dc%d))\n", i, j, i, k); printf ("(assert (distinct r%dc%d r%dc%d))\n", j, i, k, i); } printf ("(check-sat)\n"); printf ("(exit)\n"); return 0; }
the_stack_data/95451437.c
/* ************************************************ username : smmehrab fullname : s.m.mehrabul islam email : [email protected] institute : university of dhaka, bangladesh session : 2017-2018 ************************************************ */ #include<stdio.h> int main() { int t; while(scanf("%d",&t)==1) { if(t==42) break; else printf("%d\n",t); } return 0; }
the_stack_data/32950244.c
// Complete the maxSubsetSum function below. int dp[100005]; //function for returning maximum element int max(int num1, int num2) { return (num1 > num2 ) ? num1 : num2; } //function for retruning max array sum int maxSubsetSum(int arr_count, int* arr) { //assigning maximum value to dp[0] dp[0]=max(0,arr[0]); //if there is only one element if(arr_count==1) {return dp[0];} //loop for finding array sum and storing it into dp for(int i=1;i<arr_count;i++) { dp[i]=max(dp[i-2],max(dp[i-1],dp[i-2]+arr[i])); } //declaring and initialising n to total no. of elements int n=arr_count; //returning max array sum return max(dp[n-1],dp[n-2]); }
the_stack_data/82949578.c
// Definition for a binary tree node. struct TreeNode { int val; struct TreeNode* left; struct TreeNode* right; }; struct TreeNode* trimBST(struct TreeNode* root, int low, int high) { if (!root) return root; root->left = trimBST(root->left, low, high); root->right = trimBST(root->right, low, high); if (root->val < low) return root->right; if (root->val > high) return root->left; return root; }
the_stack_data/1108962.c
int largestRectangleArea(int* height, int heightSize) { int *stack; int top = -1; int i; int curh; int max = 0; stack = (int *)malloc(sizeof(int) * heightSize); for(i = 0; i <= heightSize; ++i){ curh = (i == heightSize) ? -1 : height[i]; while(top != -1 && curh <= height[stack[top]]){ int h = height[stack[top--]]; int w = ((top == -1) ? i : i - stack[top] - 1); if(h * w > max) max = h * w; } stack[++top] = i; } free(stack); return max; }
the_stack_data/31206.c
/* HAL raised several warnings, ignore them */ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #ifdef STM32F0xx #include "stm32f0xx_hal_usart_ex.c" #elif STM32F3xx #include "stm32f3xx_hal_usart_ex.c" #elif STM32G0xx #include "stm32g0xx_hal_usart_ex.c" #elif STM32G4xx #include "stm32g4xx_hal_usart_ex.c" #elif STM32H7xx #include "stm32h7xx_hal_usart_ex.c" #elif STM32L4xx #include "stm32l4xx_hal_usart_ex.c" #elif STM32L5xx #include "stm32l5xx_hal_usart_ex.c" #elif STM32MP1xx #include "stm32mp1xx_hal_usart_ex.c" #elif STM32WBxx #include "stm32wbxx_hal_usart_ex.c" #elif STM32WLxx #include "stm32wlxx_hal_usart_ex.c" #endif #pragma GCC diagnostic pop
the_stack_data/16540.c
#include "stdlib.h" struct node { struct node *next; int value; }; struct stack { struct node *head; }; struct stack *create_stack() { struct stack *stack = malloc(sizeof(struct stack)); if (stack == 0) { abort(); } stack->head = 0; return stack; } int stack_get_count(struct stack *stack) { struct node *head = stack->head; struct node *n = head; int i = 0; while (n != 0) { n = n->next; i++; } return i; } void stack_push_all(struct stack *stack, struct stack *other) { struct node *head0 = other->head; free(other); struct node *n = head0; if (n != 0) { while (n->next != 0) { n = n->next; } n->next = stack->head; stack->head = head0; } } void stack_push(struct stack *stack, int value) { struct node *n = malloc(sizeof(struct node)); if (n == 0) { abort(); } n->next = stack->head; n->value = value; stack->head = n; } int stack_pop(struct stack *stack) { struct node *head = stack->head; int result = head->value; stack->head = head->next; free(head); return result; } void stack_dispose(struct stack *stack) { free(stack); } int main() { struct stack *s = create_stack(); stack_push(s, 10); stack_push(s, 20); stack_pop(s); stack_pop(s); stack_dispose(s); return 0; }
the_stack_data/247018331.c
/* { dg-do compile } */ /* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-fre-stats" } */ /* LLVM LOCAL test not applicable */ /* { dg-require-fdump "" } */ int foo (unsigned long a) { int b = __builtin_clzl (a); int c = __builtin_clzl (a); if (b == c) return 1; return 0; } /* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "fre"} } */ /* { dg-final { cleanup-tree-dump "fre" } } */
the_stack_data/122014882.c
/* * IMD0012 - T03 * ------------------------- * LISTA 02 - EXERCICIO 04 * ------------------------------------- * https://github.com/filipegmedeiros * --------------------------------------------- */
the_stack_data/546719.c
/*- * Copyright (c) 2004 Ted Unangst and Todd Miller * All rights reserved. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * $OpenBSD: strtonum.c,v 1.6 2004/08/03 19:38:01 millert Exp $ */ #include <sys/cdefs.h> #include <errno.h> #include <limits.h> #include <stdlib.h> #define INVALID 1 #define TOOSMALL 2 #define TOOLARGE 3 long long _strtonum(const char *numstr, long long minval, long long maxval, int base, const char **errstrp) { long long ll = 0; char *ep; int error = 0; struct errval { const char *errstr; int err; } ev[4] = { { NULL, 0 }, { "invalid", EINVAL }, { "too small", ERANGE }, { "too large", ERANGE }, }; ev[0].err = errno; errno = 0; if (minval > maxval) error = INVALID; else { ll = strtoll(numstr, &ep, base); if (errno == EINVAL || numstr == ep || *ep != '\0') error = INVALID; else if ((ll == LLONG_MIN && errno == ERANGE) || ll < minval) error = TOOSMALL; else if ((ll == LLONG_MAX && errno == ERANGE) || ll > maxval) error = TOOLARGE; } if (errstrp != NULL) *errstrp = ev[error].errstr; errno = ev[error].err; if (error) ll = 0; return (ll); }
the_stack_data/73576453.c
#include <stdio.h> #include <stdlib.h> #include <errno.h> #include <string.h> #include <unistd.h> #include <sys/utsname.h> #define MAX_BUF 64 /* I sistemi UNIX comprendono diverse funzioni il cui scopo e' di fornire le piu' disparate informazioni circa la natura del sistema stesso, tra queste uname() e gethostname() sono, anche dal punto di vista storico, molto importanti. La funzione gethostname() e' concettualmente molto semplice da usare, fornisce il nome host della macchina; la funzione uname() invece sfrutta la struttura 'utsname' definita in <sys/utsname>, consente di ottenere talune informazioni sul sistema (kernel) in uso: struct utsname { char sysname[_UTSNAME_SYSNAME_LENGTH]; char nodename[_UTSNAME_NODENAME_LENGTH]; char release[_UTSNAME_RELEASE_LENGTH]; char version[_UTSNAME_VERSION_LENGTH]; char machine[_UTSNAME_MACHINE_LENGTH]; }; HEADER : <sys/utsname.h> PROTOTYPE : int uname(struct utsname *name); SEMANTICS : La funzione uname() ottiene informazioni sul sistema in uso mediante il puntatore alla struttura utsname 'name'; RETURNS : 0 In caso di successo, -1 in caso di errore -------------------------------------------------------------------------------- HEADER : <unistd.h> PROTOTYPE : int gethostname(char *name, int namelen); SEMANTICS : La funzione gethostname() fornisce l'host della macchina in uso, collocandolo in 'name' di grandezza 'namelen'. RETURNS : 0 In caso di successo, -1 in caso di errore -------------------------------------------------------------------------------- */ int main(int argc, char* argv[]) { char my_host[MAX_BUF]; struct utsname my_kernel; if (gethostname(my_host, MAX_BUF) < 0) { fprintf(stderr, "Err.(%s) getting hostname\n", strerror(errno)); exit(EXIT_FAILURE); } if (uname(&my_kernel) < 0) { fprintf(stderr, "Err.(%s) getting kernel info\n", strerror(errno)); exit(EXIT_FAILURE); } printf(" host: %s\n", my_host); printf(" sysname: %s/%s\n", my_kernel.sysname, my_kernel.machine); printf("nodename: %s\n", my_kernel.nodename); printf(" release: %s\n", my_kernel.release); printf(" version: %s\n", my_kernel.version); return (EXIT_SUCCESS); }
the_stack_data/46908.c
int main(int nargs, char **args) { void ATL_buildinfo(void); ATL_buildinfo(); return(0); }
the_stack_data/92324699.c
/* * ctmf.c - Constant-time median filtering * Copyright (C) 2006 Simon Perreault * * Reference: S. Perreault and P. Hébert, "Median Filtering in Constant Time", * IEEE Transactions on Image Processing, September 2007. * * This program has been obtained from http://nomis80.org/ctmf.html. No patent * covers this program, although it is subject to the following license: * * 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/>. * * Contact: * Laboratoire de vision et systèmes numériques * Pavillon Adrien-Pouliot * Université Laval * Sainte-Foy, Québec, Canada * G1K 7P4 * * [email protected] */ /* Standard C includes */ #include <assert.h> #include <math.h> #include <stdlib.h> #include <string.h> /* Type declarations */ #ifdef _MSC_VER #include <basetsd.h> typedef UINT8 uint8_t; typedef UINT16 uint16_t; typedef UINT32 uint32_t; #pragma warning( disable: 4799 ) #else #include <stdint.h> #endif /* Intrinsic declarations */ #if defined(__SSE2__) || defined(__MMX__) #if defined(__SSE2__) #include <emmintrin.h> #define USE_SSE2 1 #elif defined(__MMX__) #include <mmintrin.h> #define USE_MMX 1 #endif #if defined(__GNUC__) /* gcc 3.4 lacks mm_malloc.h */ # if __GNUC__ >= 4 # include <mm_malloc.h> # else # include "an_mm_malloc.h" # endif # define HAVE_MM_MALLOC 1 #elif defined(_MSC_VER) #include <malloc.h> #else /* No aligned malloc - no SSE2/MMX! */ #undef USE_SSE2 #undef USE_MMX #endif #elif defined(__ALTIVEC__) #include <altivec.h> #elif defined(USE_ARM64) #include <arm_neon.h> #endif /* Compiler peculiarities */ #if defined(__GNUC__) #include <stdint.h> #define inline __inline__ #define align(x) __attribute__ ((aligned (x))) #elif defined(_MSC_VER) #define inline __inline #define align(x) __declspec(align(x)) #else #define inline #define align(x) #endif #ifndef MIN #define MIN(a,b) ((a) > (b) ? (b) : (a)) #endif #ifndef MAX #define MAX(a,b) ((a) < (b) ? (b) : (a)) #endif /** * This structure represents a two-tier histogram. The first tier (known as the * "coarse" level) is 4 bit wide and the second tier (known as the "fine" level) * is 8 bit wide. Pixels inserted in the fine level also get inserted into the * coarse bucket designated by the 4 MSBs of the fine bucket value. * * The structure is aligned on 16 bytes, which is a prerequisite for SIMD * instructions. Each bucket is 16 bit wide, which means that extra care must be * taken to prevent overflow. */ typedef struct align(16) { uint16_t coarse[16]; uint16_t fine[16][16]; } Histogram; /** * HOP is short for Histogram OPeration. This macro makes an operation \a op on * histogram \a h for pixel value \a x. It takes care of handling both levels. */ #define HOP(h,x,op) \ h.coarse[x>>4] op; \ *((uint16_t*) h.fine + x) op; #define COP(c,j,x,op) \ h_coarse[ 16*(n*c+j) + (x>>4) ] op; \ h_fine[ 16 * (n*(16*c+(x>>4)) + j) + (x & 0xF) ] op; /** * Adds histograms \a x and \a y and stores the result in \a y. Makes use of * SSE2, MMX or Altivec, if available. */ #if defined(USE_SSE2) static inline void histogram_add( const uint16_t x[16], uint16_t y[16] ) { *(__m128i*) &y[0] = _mm_add_epi16( *(__m128i*) &y[0], *(__m128i*) &x[0] ); *(__m128i*) &y[8] = _mm_add_epi16( *(__m128i*) &y[8], *(__m128i*) &x[8] ); } #elif defined(USE_MMX) static inline void histogram_add( const uint16_t x[16], uint16_t y[16] ) { *(__m64*) &y[0] = _mm_add_pi16( *(__m64*) &y[0], *(__m64*) &x[0] ); *(__m64*) &y[4] = _mm_add_pi16( *(__m64*) &y[4], *(__m64*) &x[4] ); *(__m64*) &y[8] = _mm_add_pi16( *(__m64*) &y[8], *(__m64*) &x[8] ); *(__m64*) &y[12] = _mm_add_pi16( *(__m64*) &y[12], *(__m64*) &x[12] ); } #elif defined(__ALTIVEC__) static inline void histogram_add( const uint16_t x[16], uint16_t y[16] ) { *(vector unsigned short*) &y[0] = vec_add( *(vector unsigned short*) &y[0], *(vector unsigned short*) &x[0] ); *(vector unsigned short*) &y[8] = vec_add( *(vector unsigned short*) &y[8], *(vector unsigned short*) &x[8] ); } #elif defined(USE_ARM64) static inline void histogram_add( const uint16_t x[16], uint16_t y[16] ) { *(uint16x4_t*) &y[0] = vadd_u16( *(uint16x4_t*) &y[0], *(uint16x4_t*) &x[0] ); *(uint16x4_t*) &y[4] = vadd_u16( *(uint16x4_t*) &y[4], *(uint16x4_t*) &x[4] ); *(uint16x4_t*) &y[8] = vadd_u16( *(uint16x4_t*) &y[8], *(uint16x4_t*) &x[8] ); *(uint16x4_t*) &y[12] = vadd_u16( *(uint16x4_t*) &y[12], *(uint16x4_t*) &x[12] ); } #else static inline void histogram_add( const uint16_t x[16], uint16_t y[16] ) { int i; for ( i = 0; i < 16; ++i ) { y[i] += x[i]; } } #endif /** * Subtracts histogram \a x from \a y and stores the result in \a y. Makes use * of SSE2, MMX or Altivec, if available. */ #if defined(USE_SSE2) static inline void histogram_sub( const uint16_t x[16], uint16_t y[16] ) { *(__m128i*) &y[0] = _mm_sub_epi16( *(__m128i*) &y[0], *(__m128i*) &x[0] ); *(__m128i*) &y[8] = _mm_sub_epi16( *(__m128i*) &y[8], *(__m128i*) &x[8] ); } #elif defined(USE_MMX) static inline void histogram_sub( const uint16_t x[16], uint16_t y[16] ) { *(__m64*) &y[0] = _mm_sub_pi16( *(__m64*) &y[0], *(__m64*) &x[0] ); *(__m64*) &y[4] = _mm_sub_pi16( *(__m64*) &y[4], *(__m64*) &x[4] ); *(__m64*) &y[8] = _mm_sub_pi16( *(__m64*) &y[8], *(__m64*) &x[8] ); *(__m64*) &y[12] = _mm_sub_pi16( *(__m64*) &y[12], *(__m64*) &x[12] ); } #elif defined(__ALTIVEC__) static inline void histogram_sub( const uint16_t x[16], uint16_t y[16] ) { *(vector unsigned short*) &y[0] = vec_sub( *(vector unsigned short*) &y[0], *(vector unsigned short*) &x[0] ); *(vector unsigned short*) &y[8] = vec_sub( *(vector unsigned short*) &y[8], *(vector unsigned short*) &x[8] ); } #elif defined(USE_ARM64) static inline void histogram_sub( const uint16_t x[16], uint16_t y[16] ) { *(uint16x4_t*) &y[0] = vsub_u16( *(uint16x4_t*) &y[0], *(uint16x4_t*) &x[0] ); *(uint16x4_t*) &y[4] = vsub_u16( *(uint16x4_t*) &y[4], *(uint16x4_t*) &x[4] ); *(uint16x4_t*) &y[8] = vsub_u16( *(uint16x4_t*) &y[8], *(uint16x4_t*) &x[8] ); *(uint16x4_t*) &y[12] = vsub_u16( *(uint16x4_t*) &y[12], *(uint16x4_t*) &x[12] ); } #else static inline void histogram_sub( const uint16_t x[16], uint16_t y[16] ) { int i; for ( i = 0; i < 16; ++i ) { y[i] -= x[i]; } } #endif static inline void histogram_muladd( const uint16_t a, const uint16_t x[16], uint16_t y[16] ) { int i; for ( i = 0; i < 16; ++i ) { y[i] += a * x[i]; } } static void ctmf_helper( const unsigned char* const src, unsigned char* const dst, const int width, const int height, const int src_step, const int dst_step, const int r, const int cn, const int pad_left, const int pad_right ) { const int m = height, n = width; int i, j, k, c; const unsigned char *p, *q; Histogram H[4]; uint16_t *h_coarse, *h_fine, luc[4][16]; size_t sz_coarse, sz_fine; assert( src ); assert( dst ); assert( r >= 0 ); assert( width >= 2*r+1 ); assert( height >= 2*r+1 ); assert( src_step != 0 ); assert( dst_step != 0 ); sz_coarse = (size_t)( 1 * 16) * (size_t)n * (size_t)cn * sizeof(uint16_t); sz_fine = (size_t)(16 * 16) * (size_t)n * (size_t)cn * sizeof(uint16_t); /* SSE2 and MMX need aligned memory, provided by _mm_malloc(). */ #if defined(USE_SSE2) || defined(USE_MMX) h_coarse = (uint16_t*) _mm_malloc( sz_coarse, 16 ); h_fine = (uint16_t*) _mm_malloc( sz_fine, 16 ); memset( h_coarse, 0, sz_coarse ); memset( h_fine, 0, sz_fine ); #else h_coarse = (uint16_t*) calloc( sz_coarse, 1); h_fine = (uint16_t*) calloc( sz_fine, 1); #endif /* First row initialization */ for ( j = 0; j < n; ++j ) { for ( c = 0; c < cn; ++c ) { COP( c, j, src[cn*j+c], += r+1 ); } } for ( i = 0; i < r; ++i ) { for ( j = 0; j < n; ++j ) { for ( c = 0; c < cn; ++c ) { COP( c, j, src[src_step*i+cn*j+c], ++ ); } } } for ( i = 0; i < m; ++i ) { /* Update column histograms for entire row. */ p = src + src_step * MAX( 0, i-r-1 ); q = p + cn * n; for ( j = 0; p != q; ++j ) { for ( c = 0; c < cn; ++c, ++p ) { COP( c, j, *p, -- ); } } p = src + src_step * MIN( m-1, i+r ); q = p + cn * n; for ( j = 0; p != q; ++j ) { for ( c = 0; c < cn; ++c, ++p ) { COP( c, j, *p, ++ ); } } /* First column initialization */ memset( H, 0, cn*sizeof(H[0]) ); memset( luc, 0, cn*sizeof(luc[0]) ); if ( pad_left ) { for ( c = 0; c < cn; ++c ) { histogram_muladd( r, &h_coarse[16*n*c], H[c].coarse ); } } for ( j = 0; j < (pad_left ? r : 2*r); ++j ) { for ( c = 0; c < cn; ++c ) { histogram_add( &h_coarse[16*(n*c+j)], H[c].coarse ); } } for ( c = 0; c < cn; ++c ) { for ( k = 0; k < 16; ++k ) { histogram_muladd( 2*r+1, &h_fine[16*n*(16*c+k)], &H[c].fine[k][0] ); } } for ( j = pad_left ? 0 : r; j < (pad_right ? n : n-r); ++j ) { for ( c = 0; c < cn; ++c ) { const uint16_t t = 2*r*r + 2*r; uint16_t sum = 0, *segment; int b; histogram_add( &h_coarse[16*(n*c + MIN(j+r,n-1))], H[c].coarse ); /* Find median at coarse level */ for ( k = 0; k < 16 ; ++k ) { sum += H[c].coarse[k]; if ( sum > t ) { sum -= H[c].coarse[k]; break; } } assert( k < 16 ); /* Update corresponding histogram segment */ if ( luc[c][k] <= j-r ) { memset( &H[c].fine[k], 0, 16 * sizeof(uint16_t) ); for ( luc[c][k] = j-r; luc[c][k] < MIN(j+r+1,n); ++luc[c][k] ) { histogram_add( &h_fine[16*(n*(16*c+k)+luc[c][k])], H[c].fine[k] ); } if ( luc[c][k] < j+r+1 ) { histogram_muladd( j+r+1 - n, &h_fine[16*(n*(16*c+k)+(n-1))], &H[c].fine[k][0] ); luc[c][k] = j+r+1; } } else { for ( ; luc[c][k] < j+r+1; ++luc[c][k] ) { histogram_sub( &h_fine[16*(n*(16*c+k)+MAX(luc[c][k]-2*r-1,0))], H[c].fine[k] ); histogram_add( &h_fine[16*(n*(16*c+k)+MIN(luc[c][k],n-1))], H[c].fine[k] ); } } histogram_sub( &h_coarse[16*(n*c+MAX(j-r,0))], H[c].coarse ); /* Find median in segment */ segment = H[c].fine[k]; for ( b = 0; b < 16 ; ++b ) { sum += segment[b]; if ( sum > t ) { dst[dst_step*i+cn*j+c] = 16*k + b; break; } } assert( b < 16 ); } } } #if defined(USE_SSE2) || defined(USE_MMX) _mm_empty(); _mm_free(h_coarse); _mm_free(h_fine); #else free(h_coarse); free(h_fine); #endif } void ctmf( const unsigned char* const src, unsigned char* const dst, const int width, const int height, const int src_step, const int dst_step, const int r, const int cn, const long unsigned int memsize ) { /* * Processing the image in vertical stripes is an optimization made * necessary by the limited size of the CPU cache. Each histogram is 544 * bytes big and therefore I can fit a limited number of them in the cache. * That number may sometimes be smaller than the image width, which would be * the number of histograms I would need without stripes. * * I need to keep histograms in the cache so that they are available * quickly when processing a new row. Each row needs access to the previous * row's histograms. If there are too many histograms to fit in the cache, * thrashing to RAM happens. * * To solve this problem, I figure out the maximum number of histograms * that can fit in cache. From this is determined the number of stripes in * an image. The formulas below make the stripes all the same size and use * as few stripes as possible. * * Note that each stripe causes an overlap on the neighboring stripes, as * when mowing the lawn. That overlap is proportional to r. When the overlap * is a significant size in comparison with the stripe size, then we are not * O(1) anymore, but O(r). In fact, we have been O(r) all along, but the * initialization term was neglected, as it has been (and rightly so) in B. * Weiss, "Fast Median and Bilateral Filtering", SIGGRAPH, 2006. Processing * by stripes only makes that initialization term bigger. * * Also, note that the leftmost and rightmost stripes don't need overlap. * A flag is passed to ctmf_helper() so that it treats these cases as if the * image was zero-padded. */ int stripes = (int) ceil( (double) (width - 2*r) / (memsize / sizeof(Histogram) - 2*r) ); int stripe_size = (int) ceil( (double) ( width + stripes*2*r - 2*r ) / stripes ); int i; for ( i = 0; i < width; i += stripe_size - 2*r ) { int stripe = stripe_size; /* Make sure that the filter kernel fits into one stripe. */ if ( i + stripe_size - 2*r >= width || width - (i + stripe_size - 2*r) < 2*r+1 ) { stripe = width - i; } ctmf_helper( src + cn*i, dst + cn*i, stripe, height, src_step, dst_step, r, cn, i == 0, stripe == width - i ); if ( stripe == width - i ) { break; } } }
the_stack_data/127573.c
/* This testcase is part of GDB, the GNU debugger. Copyright 2009-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/>. Contributed by Markus Deuling <[email protected]> */ #include <stdio.h> int main (unsigned long long speid, unsigned long long argp, unsigned long long envp) { int i; static int test_var; printf ("Hello World! from spu\n"); test_var = 5; i = 5; /* Marker SPUEA */ printf ("i = %d\n", i); return 0; }
the_stack_data/80880.c
/* { dg-options { -nostartfiles below100.o -Tbelow100.ld -O2 } } */ /* { dg-final { scan-assembler "bp 32533,#0" } } */ typedef struct { unsigned short b0:1; unsigned short b1:1; unsigned short b2:1; unsigned short b3:1; unsigned short b4:1; unsigned short b5:1; unsigned short b6:1; unsigned short b7:1; unsigned short b8:1; unsigned short b9:1; unsigned short b10:1; unsigned short b11:1; unsigned short b12:1; unsigned short b13:1; unsigned short b14:1; unsigned short b15:1; } BitField; #define SFRA (*((volatile BitField*)0x7f14)) unsigned short *pA = (unsigned short *) 0x7f14; #define SFRB (*((volatile BitField*)0x7f10)) unsigned short *pB = (unsigned short *) 0x7f10; char * Do (void) { if (!SFRA.b8) { if (!SFRB.b8) return "Fail"; else return "Success"; } else return "Fail"; } int main (void) { *pA = 0x1234; *pB = 0xedcb; return Do ()[0] == 'F'; }
the_stack_data/100235.c
/* Class title: Data Structure Lecturer: Prof. Dr. Rodrigo Elias Bianchi Wagner Gaspar's Example adapted by: Charles Fernandes de Souza Date: September 28, 2021 */ #include<stdio.h> #include <stdlib.h> typedef struct no{ int valor; struct no *direita, *esquerda; }NoArv; void inserirABB(NoArv **raiz, int numero){ NoArv *auxiliar = *raiz; while(auxiliar){ if(numero < auxiliar->valor) raiz = &auxiliar->esquerda; else raiz = &auxiliar->direita; auxiliar = *raiz; } auxiliar = malloc(sizeof(NoArv)); auxiliar->valor = numero; auxiliar->esquerda = NULL; auxiliar->direita = NULL; *raiz = auxiliar; } NoArv* buscarABB(NoArv *raiz, int numero){ while(raiz){ if(numero < raiz->valor) raiz = raiz->esquerda; else if(numero > raiz->valor) raiz = raiz->direita; else return raiz; } return NULL; } int altura(NoArv *raiz){ if(raiz == NULL){ return -1; } else{ int auxiliarEsquerda = altura(raiz->esquerda); int auxiliarDireita = altura(raiz->direita); if(auxiliarEsquerda > auxiliarDireita) return auxiliarEsquerda + 1; else return auxiliarDireita + 1; } } int quantidade_nos(NoArv *raiz){ if(raiz == NULL) return 0; else return 1 + quantidade_nos(raiz->esquerda) + quantidade_nos(raiz->direita); } int quantidade_folhas(NoArv *raiz){ if(raiz == NULL) return 0; else if(raiz->esquerda == NULL && raiz->direita == NULL) return 1; else return quantidade_folhas(raiz->esquerda) + quantidade_folhas(raiz->direita); } NoArv* removerABB(NoArv *raiz, int chave) { if(raiz == NULL){ printf("Valor nao encontrado!\n"); return NULL; } else { if(raiz->valor == chave) { if(raiz->esquerda == NULL && raiz->direita == NULL) { free(raiz); printf("Elemento folha removido: %d !\n", chave); return NULL; } else{ if(raiz->esquerda != NULL && raiz->direita != NULL){ NoArv *auxiliar = raiz->esquerda; while(auxiliar->direita != NULL) auxiliar = auxiliar->direita; raiz->valor = auxiliar->valor; auxiliar->valor = chave; printf("Elemento trocado: %d !\n", chave); raiz->esquerda = removerABB(raiz->esquerda, chave); return raiz; } else{ // remover nós que possuem apenas 1 filho NoArv *auxiliar; if(raiz->esquerda != NULL) auxiliar = raiz->esquerda; else auxiliar = raiz->direita; free(raiz); printf("Elemento com 1 filho removido: %d !\n", chave); return auxiliar; } } } else { if(chave < raiz->valor) raiz->esquerda = removerABB(raiz->esquerda, chave); else raiz->direita = removerABB(raiz->direita, chave); return raiz; } } } void imprimirABB(NoArv *raiz){ if(raiz){ imprimirABB(raiz->esquerda); printf("%d ", raiz->valor); imprimirABB(raiz->direita); } } int main(){ NoArv *busca, *raiz = NULL; int opcao, valor; do{ printf("\n\n--------------------------------- MENU ----------------------------------\n\n"); printf ("Digite o numero [1] para inserir valores da Arvore Binaria de Busca\n"); printf ("Digite o numero [2] para imprimir valores da Arvore Binaria de Busca\n"); printf ("Digite o numero [3] para buscar um valor da Arvore Binaria de Busca\n"); printf ("Digite o numero [4] para saber a altura da Arvore Binaria de Busca\n"); printf ("Digite o numero [5] para saber o tamanho da Arvore Binaria de Busca\n"); printf ("Digite o numero [6] para a quantidade de folhas da Arvore Binaria de Busca\n"); printf ("Digite o numero [7] para remover um valor da Arvore Binaria de Busca\n"); printf ("Digite o numero [0] para encerrar\n"); printf("\nEscolha uma opcao:> "); scanf("%d", &opcao); switch(opcao){ case 0: printf("\nFim! Volte Sempre!\n"); printf("\n"); break; case 1: printf("\n\tDigite um valor: "); scanf("%d", &valor); inserirABB(&raiz, valor); break; case 2: printf("\n\tArvore Binaria de Busca:\n\t"); imprimirABB(raiz); printf("\n"); break; case 3: printf("\n\tDigite o valor a ser buscado: "); scanf("%d", &valor); busca = buscarABB(raiz, valor); if(busca) printf("\n\tValor encontrado: %d\n", busca->valor); else printf("\n\tValor nao encontrado!\n"); break; case 4: printf("\n\tAltura da arvore: %d\n\n", altura(raiz)); break; case 5: printf("\n\tQuantidade de nos: %d\n", quantidade_nos(raiz)); break; case 6: printf("\n\tQuantidade folhas: %d\n", quantidade_folhas(raiz)); break; case 7: printf("\t"); imprimirABB(raiz); printf("\n\tDigite o valor a ser removido: "); scanf("%d", &valor); raiz = removerABB(raiz, valor); break; default: if(opcao != 0) printf("\n\tOpcao invalida!!!\n"); } }while(opcao != 0); return 0; }
the_stack_data/1077191.c
// // Created by zhangrongxiang on 2017/9/27 14:21 // File mmap // #include <sys/mman.h> #include <sys/types.h> #include <fcntl.h> #include <unistd.h> #include <stdio.h> #include <string.h> typedef struct { char name[4]; int age; } people; void main(int argc, char **argv) // map a normal file as shared mem: { int fd, i; people *p_map; char temp; fd = open(argv[1], O_CREAT | O_RDWR | O_TRUNC, 00777); lseek(fd, sizeof(people) * 5 - 1, SEEK_SET); write(fd, "", 1); p_map = (people *) mmap(NULL, sizeof(people) * 10, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); printf("-----------------------\n"); close(fd); temp = 'a'; for (i = 0; i < 10; i++) { printf("-----------------------\n"); temp += 1; memcpy((*(p_map + i)).name, &temp, 2); (*(p_map + i)).age = 20 + i; } printf(" initialize over \n "); sleep(10); munmap(p_map, sizeof(people) * 10); printf("umap ok \n"); }
the_stack_data/833627.c
/* <p>Implement <a href="http://www.cplusplus.com/reference/valarray/pow/" target="_blank">pow(<em>x</em>, <em>n</em>)</a>, which calculates&nbsp;<em>x</em> raised to the power <em>n</em> (x<sup><span style="font-size:10.8333px">n</span></sup>).</p> <p><strong>Example 1:</strong></p> <pre> <strong>Input:</strong> 2.00000, 10 <strong>Output:</strong> 1024.00000 </pre> <p><strong>Example 2:</strong></p> <pre> <strong>Input:</strong> 2.10000, 3 <strong>Output:</strong> 9.26100 </pre> <p><strong>Example 3:</strong></p> <pre> <strong>Input:</strong> 2.00000, -2 <strong>Output:</strong> 0.25000 <strong>Explanation:</strong> 2<sup>-2</sup> = 1/2<sup>2</sup> = 1/4 = 0.25 </pre> <p><strong>Note:</strong></p> <ul> <li>-100.0 &lt; <em>x</em> &lt; 100.0</li> <li><em>n</em> is a 32-bit signed integer, within the range&nbsp;[&minus;2<sup>31</sup>,&nbsp;2<sup>31&nbsp;</sup>&minus; 1]</li> </ul> <p>实现&nbsp;<a href="https://www.cplusplus.com/reference/valarray/pow/" target="_blank">pow(<em>x</em>, <em>n</em>)</a>&nbsp;,即计算 x 的 n 次幂函数。</p> <p><strong>示例 1:</strong></p> <pre><strong>输入:</strong> 2.00000, 10 <strong>输出:</strong> 1024.00000 </pre> <p><strong>示例&nbsp;2:</strong></p> <pre><strong>输入:</strong> 2.10000, 3 <strong>输出:</strong> 9.26100 </pre> <p><strong>示例&nbsp;3:</strong></p> <pre><strong>输入:</strong> 2.00000, -2 <strong>输出:</strong> 0.25000 <strong>解释:</strong> 2<sup>-2</sup> = 1/2<sup>2</sup> = 1/4 = 0.25</pre> <p><strong>说明:</strong></p> <ul> <li>-100.0 &lt;&nbsp;<em>x</em>&nbsp;&lt; 100.0</li> <li><em>n</em>&nbsp;是 32 位有符号整数,其数值范围是&nbsp;[&minus;2<sup>31</sup>,&nbsp;2<sup>31&nbsp;</sup>&minus; 1] 。</li> </ul> <p>实现&nbsp;<a href="https://www.cplusplus.com/reference/valarray/pow/" target="_blank">pow(<em>x</em>, <em>n</em>)</a>&nbsp;,即计算 x 的 n 次幂函数。</p> <p><strong>示例 1:</strong></p> <pre><strong>输入:</strong> 2.00000, 10 <strong>输出:</strong> 1024.00000 </pre> <p><strong>示例&nbsp;2:</strong></p> <pre><strong>输入:</strong> 2.10000, 3 <strong>输出:</strong> 9.26100 </pre> <p><strong>示例&nbsp;3:</strong></p> <pre><strong>输入:</strong> 2.00000, -2 <strong>输出:</strong> 0.25000 <strong>解释:</strong> 2<sup>-2</sup> = 1/2<sup>2</sup> = 1/4 = 0.25</pre> <p><strong>说明:</strong></p> <ul> <li>-100.0 &lt;&nbsp;<em>x</em>&nbsp;&lt; 100.0</li> <li><em>n</em>&nbsp;是 32 位有符号整数,其数值范围是&nbsp;[&minus;2<sup>31</sup>,&nbsp;2<sup>31&nbsp;</sup>&minus; 1] 。</li> </ul> */ double myPow(double x, int n) { }
the_stack_data/232956115.c
extern const unsigned char OAuthSwiftAlamofireVersionString[]; extern const double OAuthSwiftAlamofireVersionNumber; const unsigned char OAuthSwiftAlamofireVersionString[] __attribute__ ((used)) = "@(#)PROGRAM:OAuthSwiftAlamofire PROJECT:Pods-1" "\n"; const double OAuthSwiftAlamofireVersionNumber __attribute__ ((used)) = (double)1.;
the_stack_data/92325511.c
#include <stddef.h> size_t strlen(const char *s) { int c = 0; while(*s++) c++; return c; }
the_stack_data/100141573.c
// C program to calculate perimeter of a Rectangle #include<stdio.h> int main() { float length, width, perimeter; printf("\n Enter lenght of rectange: "); scanf("%f", &length); printf("\n Enter the width of the rectangle: "); scanf("%f", &width); //Perimeter of rectangle = 2 * (Length + Width) perimeter= 2*(length + width); printf("\n Perimeter of the rectange is: %f", perimeter); return 0; }
the_stack_data/147908.c
#include <stdio.h> #include <stdlib.h> #include <string.h> //方法一,用数组记录使用次数 int countCharacters0(char ** words, int wordsSize, char * chars){ if (words == NULL || wordsSize <= 0) { return 0; } int ans = 0; long charsL = strlen(chars); int *charsFlag = (int *)malloc(sizeof(int) * charsL); for (int i = 0; i < wordsSize; i++) { char *word = words[i]; int wordL = (int)strlen(word); int isAns = 1; for (int i = 0; i < charsL; i++) { charsFlag[i] = 0; } for (int j = 0; j < wordL; j++) { char wc = word[j]; int isExist = 0; for (int l = 0; l < charsL; l++) { if (charsFlag[l] == 0 && chars[l] == wc) { charsFlag[l] = 1; isExist = 1; break; } } if (isExist == 0) { isAns = 0; break; } } if (isAns == 1) { ans += wordL; } } free(charsFlag); return ans; } //方法二,用二十六个字母记录字母使用次数 int countCharacters(char ** words, int wordsSize, char * chars) { if (words == NULL || wordsSize <= 0) { return 0; } int ans = 0; int charFlag[26] = {0}; long charsL = strlen(chars); for (int i = 0; i < charsL; i++) { charFlag[chars[i] - 'a'] += 1; } for (int i = 0; i < wordsSize; i++) { char *word = words[i]; int wordL = (int)strlen(word); if (wordL > charsL) { continue; } int isAns = 1; int wordFlag[26] = {0}; for (int j = 0; j < wordL; j++) { wordFlag[word[j] - 'a'] += 1; } for (int l = 0; l < 26; l++) { if (charFlag[l] < wordFlag[l]) { isAns = 0; break; } } if (isAns == 1) { ans += wordL; } } return ans; } int main(int argc, const char * argv[]) { char **s = (char **)malloc(sizeof(char *)*4); s[0] = "cat"; s[1] = "bt"; s[2] = "hat"; s[3] = "tree"; char *cs = "atach"; printf("%d\n", countCharacters(s, 4, cs)); return 0; }
the_stack_data/109784.c
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <float.h> /*********************************************************************************************************/ /********************************************** PROTOTYPES ***********************************************/ /*********************************************************************************************************/ /* This function initializes episodes */ unsigned int InitializeEpisode(unsigned int number_of_non_terminal_states); /* This function selects a policy with using epsilon-greedy from the state-action-value function */ void EpsilonGreedyPolicyFromStateActionFunction(unsigned int* number_of_actions_per_non_terminal_state, double** state_action_value_function1, double** state_action_value_function2, double epsilon, unsigned int state_index, double** policy, double** policy_cumulative_sum); /* This function loops through episodes and updates the policy */ void LoopThroughEpisode(unsigned int number_of_non_terminal_states, unsigned int* number_of_actions_per_non_terminal_state, unsigned int** number_of_state_action_successor_states, unsigned int*** state_action_successor_state_indices, double*** state_action_successor_state_transition_probabilities_cumulative_sum, double*** state_action_successor_state_rewards, double** state_action_value_function1, double** state_action_value_function2, unsigned int** state_action_value_function_max_tie_stack, double** policy, double** policy_cumulative_sum, double alpha, double epsilon, double discounting_factor_gamma, unsigned int maximum_episode_length, unsigned int state_index); /* This function updates the state-action-value function */ unsigned int UpdateStateActionValueFunction(unsigned int number_of_non_terminal_states, unsigned int* number_of_actions_per_non_terminal_state, double** not_updating_state_action_value_function, unsigned int** state_action_value_function_max_tie_stack, double alpha, double discounting_factor_gamma, unsigned int state_index, unsigned int action_index, double reward, unsigned int next_state_index, double** updating_state_action_value_function); /* This function returns a random uniform number within range [0,1] */ double UnifRand(void); /*********************************************************************************************************/ /************************************************* MAIN **************************************************/ /*********************************************************************************************************/ int main(int argc, char* argv[]) { unsigned int i, j, k; int system_return; /*********************************************************************************************************/ /**************************************** READ IN THE ENVIRONMENT ****************************************/ /*********************************************************************************************************/ /* Get the number of states */ unsigned int number_of_states = 0; FILE* infile_number_of_states = fopen("inputs/number_of_states.txt", "r"); system_return = fscanf(infile_number_of_states, "%u", &number_of_states); if (system_return == -1) { printf("Failed reading file inputs/number_of_states.txt\n"); } fclose(infile_number_of_states); /* Get number of terminal states */ unsigned int number_of_terminal_states = 0; FILE* infile_number_of_terminal_states = fopen("inputs/number_of_terminal_states.txt", "r"); system_return = fscanf(infile_number_of_terminal_states, "%u", &number_of_terminal_states); if (system_return == -1) { printf("Failed reading file inputs/number_of_terminal_states.txt\n"); } fclose(infile_number_of_terminal_states); /* Get number of non-terminal states */ unsigned int number_of_non_terminal_states = number_of_states - number_of_terminal_states; /* Get the number of actions per non-terminal state */ unsigned int* number_of_actions_per_non_terminal_state; FILE* infile_number_of_actions_per_non_terminal_state = fopen("inputs/number_of_actions_per_non_terminal_state.txt", "r"); number_of_actions_per_non_terminal_state = malloc(sizeof(int) * number_of_non_terminal_states); for (i = 0; i < number_of_non_terminal_states; i++) { system_return = fscanf(infile_number_of_actions_per_non_terminal_state, "%u", &number_of_actions_per_non_terminal_state[i]); if (system_return == -1) { printf("Failed reading file inputs/number_of_actions_per_non_terminal_state.txt\n"); } } // end of i loop fclose(infile_number_of_actions_per_non_terminal_state); /* Get the number of actions per all states */ unsigned int* number_of_actions_per_state; number_of_actions_per_state = malloc(sizeof(int) * number_of_states); for (i = 0; i < number_of_non_terminal_states; i++) { number_of_actions_per_state[i] = number_of_actions_per_non_terminal_state[i]; } // end of i loop for (i = 0; i < number_of_terminal_states; i++) { number_of_actions_per_state[i + number_of_non_terminal_states] = 0; } // end of i loop /* Get the number of state-action successor states */ unsigned int** number_of_state_action_successor_states; FILE* infile_number_of_state_action_successor_states = fopen("inputs/number_of_state_action_successor_states.txt", "r"); number_of_state_action_successor_states = malloc(sizeof(int*) * number_of_non_terminal_states); for (i = 0; i < number_of_non_terminal_states; i++) { number_of_state_action_successor_states[i] = malloc(sizeof(int) * number_of_actions_per_non_terminal_state[i]); for (j = 0; j < number_of_actions_per_non_terminal_state[i]; j++) { system_return = fscanf(infile_number_of_state_action_successor_states, "%u\t", &number_of_state_action_successor_states[i][j]); if (system_return == -1) { printf("Failed reading file inputs/number_of_state_action_successor_states.txt\n"); } } // end of j loop } // end of i loop fclose(infile_number_of_state_action_successor_states); /* Get the state-action-successor state indices */ unsigned int*** state_action_successor_state_indices; FILE* infile_state_action_successor_state_indices = fopen("inputs/state_action_successor_state_indices.txt", "r"); state_action_successor_state_indices = malloc(sizeof(unsigned int**) * number_of_non_terminal_states); for (i = 0; i < number_of_non_terminal_states; i++) { state_action_successor_state_indices[i] = malloc(sizeof(unsigned int*) * number_of_actions_per_non_terminal_state[i]); for (j = 0; j < number_of_actions_per_non_terminal_state[i]; j++) { state_action_successor_state_indices[i][j] = malloc(sizeof(unsigned int*) * number_of_state_action_successor_states[i][j]); for (k = 0; k < number_of_state_action_successor_states[i][j]; k++) { system_return = fscanf(infile_state_action_successor_state_indices, "%u\t", &state_action_successor_state_indices[i][j][k]); if (system_return == -1) { printf("Failed reading file inputs/state_action_successor_state_indices.txt\n"); } } // end of k loop system_return = fscanf(infile_state_action_successor_state_indices, "\n"); if (system_return == -1) { printf("Failed reading file inputs/state_action_successor_state_indices.txt\n"); } } // end of j loop } // end of i loop fclose(infile_state_action_successor_state_indices); /* Get the state-action-successor state transition probabilities */ double*** state_action_successor_state_transition_probabilities; FILE* infile_state_action_successor_state_transition_probabilities = fopen("inputs/state_action_successor_state_transition_probabilities.txt", "r"); state_action_successor_state_transition_probabilities = malloc(sizeof(double**) * number_of_non_terminal_states); for (i = 0; i < number_of_non_terminal_states; i++) { state_action_successor_state_transition_probabilities[i] = malloc(sizeof(double*) * number_of_actions_per_non_terminal_state[i]); for (j = 0; j < number_of_actions_per_non_terminal_state[i]; j++) { state_action_successor_state_transition_probabilities[i][j] = malloc(sizeof(double*) * number_of_state_action_successor_states[i][j]); for (k = 0; k < number_of_state_action_successor_states[i][j]; k++) { system_return = fscanf(infile_state_action_successor_state_transition_probabilities, "%lf\t", &state_action_successor_state_transition_probabilities[i][j][k]); if (system_return == -1) { printf("Failed reading file inputs/state_action_successor_state_transition_probabilities.txt\n"); } } // end of k loop system_return = fscanf(infile_state_action_successor_state_transition_probabilities, "\n"); if (system_return == -1) { printf("Failed reading file inputs/state_action_successor_state_transition_probabilities.txt\n"); } } // end of j loop } // end of i loop fclose(infile_state_action_successor_state_transition_probabilities); /* Create the state-action-successor state transition probability cumulative sum array */ double*** state_action_successor_state_transition_probabilities_cumulative_sum; state_action_successor_state_transition_probabilities_cumulative_sum = malloc(sizeof(double**) * number_of_non_terminal_states); for (i = 0; i < number_of_non_terminal_states; i++) { state_action_successor_state_transition_probabilities_cumulative_sum[i] = malloc(sizeof(double*) * number_of_actions_per_non_terminal_state[i]); for (j = 0; j < number_of_actions_per_non_terminal_state[i]; j++) { state_action_successor_state_transition_probabilities_cumulative_sum[i][j] = malloc(sizeof(double*) * number_of_state_action_successor_states[i][j]); if (number_of_state_action_successor_states[i][j] > 0) { state_action_successor_state_transition_probabilities_cumulative_sum[i][j][0] = state_action_successor_state_transition_probabilities[i][j][0]; for (k = 1; k < number_of_state_action_successor_states[i][j]; k++) { state_action_successor_state_transition_probabilities_cumulative_sum[i][j][k] = state_action_successor_state_transition_probabilities_cumulative_sum[i][j][k - 1] + state_action_successor_state_transition_probabilities[i][j][k]; } // end of k loop } } // end of j loop } // end of i loop /* Get the state-action-successor state rewards */ double*** state_action_successor_state_rewards; FILE* infile_state_action_successor_state_rewards = fopen("inputs/state_action_successor_state_rewards.txt", "r"); state_action_successor_state_rewards = malloc(sizeof(double**) * number_of_non_terminal_states); for (i = 0; i < number_of_non_terminal_states; i++) { state_action_successor_state_rewards[i] = malloc(sizeof(double*) * number_of_actions_per_non_terminal_state[i]); for (j = 0; j < number_of_actions_per_non_terminal_state[i]; j++) { state_action_successor_state_rewards[i][j] = malloc(sizeof(double) * number_of_state_action_successor_states[i][j]); for (k = 0; k < number_of_state_action_successor_states[i][j]; k++) { system_return = fscanf(infile_state_action_successor_state_rewards, "%lf\t", &state_action_successor_state_rewards[i][j][k]); if (system_return == -1) { printf("Failed reading file inputs/state_action_successor_state_rewards.txt\n"); } } // end of k loop system_return = fscanf(infile_state_action_successor_state_rewards, "\n"); if (system_return == -1) { printf("Failed reading file inputs/state_action_successor_state_rewards.txt\n"); } } // end of j loop } // end of i loop fclose(infile_state_action_successor_state_rewards); /*********************************************************************************************************/ /**************************************** SETUP POLICY ITERATION *****************************************/ /*********************************************************************************************************/ /* Set the number of episodes */ unsigned int number_of_episodes = 10000; /* Set the maximum episode length */ unsigned int maximum_episode_length = 200; /* Create state-action-value function array */ double** state_action_value_function1; state_action_value_function1 = malloc(sizeof(double*) * number_of_states); for (i = 0; i < number_of_states; i++) { state_action_value_function1[i] = malloc(sizeof(double) * number_of_actions_per_state[i]); for (j = 0; j < number_of_actions_per_state[i]; j++) { state_action_value_function1[i][j] = 0.0; } // end of j loop } // end of i loop double** state_action_value_function2; state_action_value_function2 = malloc(sizeof(double*) * number_of_states); for (i = 0; i < number_of_states; i++) { state_action_value_function2[i] = malloc(sizeof(double) * number_of_actions_per_state[i]); for (j = 0; j < number_of_actions_per_state[i]; j++) { state_action_value_function2[i][j] = 0.0; } // end of j loop } // end of i loop unsigned int** state_action_value_function_max_tie_stack; state_action_value_function_max_tie_stack = malloc(sizeof(unsigned int*) * number_of_states); for (i = 0; i < number_of_states; i++) { state_action_value_function_max_tie_stack[i] = malloc(sizeof(unsigned int) * number_of_actions_per_state[i]); for (j = 0; j < number_of_actions_per_state[i]; j++) { state_action_value_function_max_tie_stack[i][j] = 0; } // end of j loop } // end of i loop /* Create policy array */ double** policy; policy = malloc(sizeof(double*) * number_of_non_terminal_states); for (i = 0; i < number_of_non_terminal_states; i++) { policy[i] = malloc(sizeof(double) * number_of_actions_per_non_terminal_state[i]); for (j = 0; j < number_of_actions_per_non_terminal_state[i]; j++) { policy[i][j] = 1.0 / number_of_actions_per_non_terminal_state[i]; } // end of j loop } // end of i loop /* Create policy cumulative sum array */ double** policy_cumulative_sum; policy_cumulative_sum = malloc(sizeof(double*) * number_of_non_terminal_states); for (i = 0; i < number_of_non_terminal_states; i++) { policy_cumulative_sum[i] = malloc(sizeof(double) * number_of_actions_per_non_terminal_state[i]); policy_cumulative_sum[i][0] = policy[i][0]; for (j = 1; j < number_of_actions_per_non_terminal_state[i]; j++) { policy_cumulative_sum[i][j] = policy_cumulative_sum[i][j - 1] + policy[i][j]; } // end of j loop } // end of i loop /* Set learning rate alpha */ double alpha = 0.1; /* Set epsilon for our epsilon level of exploration */ double epsilon = 0.1; /* Set discounting factor gamma */ double discounting_factor_gamma = 1.0; /* Set random seed */ srand(0); /*********************************************************************************************************/ /******************************************* RUN POLICY CONTROL ******************************************/ /*********************************************************************************************************/ printf("\nInitial state-action value function1:\n"); for (i = 0; i < number_of_non_terminal_states; i++) { printf("%u", i); for (j = 0; j < number_of_actions_per_non_terminal_state[i]; j++) { printf("\t%lf", state_action_value_function1[i][j]); } // end of j loop printf("\n"); } // end of i loop printf("\nInitial state-action value function2:\n"); for (i = 0; i < number_of_non_terminal_states; i++) { printf("%u", i); for (j = 0; j < number_of_actions_per_non_terminal_state[i]; j++) { printf("\t%lf", state_action_value_function2[i][j]); } // end of j loop printf("\n"); } // end of i loop printf("\nInitial policy:\n"); for (i = 0; i < number_of_non_terminal_states; i++) { printf("%u", i); for (j = 0; j < number_of_actions_per_non_terminal_state[i]; j++) { printf("\t%lf", policy[i][j]); } // end of j loop printf("\n"); } // end of i loop unsigned int initial_state_index = 0; /* Loop over episodes */ for (i = 0; i < number_of_episodes; i++) { /* Initialize episode to get initial state and action */ initial_state_index = InitializeEpisode(number_of_non_terminal_states); /* Loop through episode and update the policy */ LoopThroughEpisode(number_of_non_terminal_states, number_of_actions_per_non_terminal_state, number_of_state_action_successor_states, state_action_successor_state_indices, state_action_successor_state_transition_probabilities_cumulative_sum, state_action_successor_state_rewards, state_action_value_function1, state_action_value_function2, state_action_value_function_max_tie_stack, policy, policy_cumulative_sum, alpha, epsilon, discounting_factor_gamma, maximum_episode_length, initial_state_index); } // end of i loop /*********************************************************************************************************/ /*************************************** PRINT VALUES AND POLICIES ***************************************/ /*********************************************************************************************************/ printf("\nFinal state-action value function1:\n"); for (i = 0; i < number_of_non_terminal_states; i++) { printf("%u", i); for (j = 0; j < number_of_actions_per_non_terminal_state[i]; j++) { printf("\t%lf", state_action_value_function1[i][j]); } // end of j loop printf("\n"); } // end of i loop printf("\nFinal state-action value function2:\n"); for (i = 0; i < number_of_non_terminal_states; i++) { printf("%u", i); for (j = 0; j < number_of_actions_per_non_terminal_state[i]; j++) { printf("\t%lf", state_action_value_function2[i][j]); } // end of j loop printf("\n"); } // end of i loop printf("\nFinal policy:\n"); for (i = 0; i < number_of_non_terminal_states; i++) { printf("%u", i); for (j = 0; j < number_of_actions_per_non_terminal_state[i]; j++) { printf("\t%lf", policy[i][j]); } // end of j loop printf("\n"); } // end of i loop /*********************************************************************************************************/ /****************************************** FREE DYNAMIC MEMORY ******************************************/ /*********************************************************************************************************/ for (i = 0; i < number_of_non_terminal_states; i++) { free(policy_cumulative_sum[i]); free(policy[i]); } // end of i loop free(policy_cumulative_sum); free(policy); for (i = 0; i < number_of_states; i++) { free(state_action_value_function_max_tie_stack[i]); free(state_action_value_function2[i]); free(state_action_value_function1[i]); } // end of i loop free(state_action_value_function_max_tie_stack); free(state_action_value_function2); free(state_action_value_function1); for (i = 0; i < number_of_non_terminal_states; i++) { for (j = 0; j < number_of_actions_per_non_terminal_state[i]; j++) { free(state_action_successor_state_rewards[i][j]); free(state_action_successor_state_transition_probabilities_cumulative_sum[i][j]); free(state_action_successor_state_transition_probabilities[i][j]); free(state_action_successor_state_indices[i][j]); } // end of j loop free(state_action_successor_state_rewards[i]); free(state_action_successor_state_transition_probabilities_cumulative_sum[i]); free(state_action_successor_state_transition_probabilities[i]); free(state_action_successor_state_indices[i]); free(number_of_state_action_successor_states[i]); } // end of i loop free(state_action_successor_state_rewards); free(state_action_successor_state_transition_probabilities_cumulative_sum); free(state_action_successor_state_transition_probabilities); free(state_action_successor_state_indices); free(number_of_state_action_successor_states); free(number_of_actions_per_state); free(number_of_actions_per_non_terminal_state); return 0; } // end of main /*********************************************************************************************************/ /*********************************************** FUNCTIONS ***********************************************/ /*********************************************************************************************************/ /* This function initializes episodes */ unsigned int InitializeEpisode(unsigned int number_of_non_terminal_states) { unsigned int initial_state_index; /* Initial state */ initial_state_index = rand() % number_of_non_terminal_states; // randomly choose an initial state from all non-terminal states return initial_state_index; } // end of InitializeEpisode function /* This function selects a policy with using epsilon-greedy from the state-action-value function */ void EpsilonGreedyPolicyFromStateActionFunction(unsigned int* number_of_actions_per_non_terminal_state, double** state_action_value_function1, double** state_action_value_function2, double epsilon, unsigned int state_index, double** policy, double** policy_cumulative_sum) { unsigned int i, max_action_count = 1; double max_state_action_value = -DBL_MAX, max_policy_apportioned_probability_per_action = 1.0, remaining_apportioned_probability_per_action = 0.0; /* Update policy greedily from state-value function */ for (i = 0; i < number_of_actions_per_non_terminal_state[state_index]; i++) { /* Save max state action value and find the number of actions that have the same max state action value */ if (state_action_value_function1[state_index][i] + state_action_value_function2[state_index][i] > max_state_action_value) { max_state_action_value = state_action_value_function1[state_index][i] + state_action_value_function2[state_index][i]; max_action_count = 1; } else if (state_action_value_function1[state_index][i] + state_action_value_function2[state_index][i] == max_state_action_value) { max_action_count++; } } // end of i loop /* Apportion policy probability across ties equally for state-action pairs that have the same value and spread out epsilon otherwise */ if (max_action_count == number_of_actions_per_non_terminal_state[state_index]) { max_policy_apportioned_probability_per_action = 1.0 / max_action_count; remaining_apportioned_probability_per_action = 0.0; } else { max_policy_apportioned_probability_per_action = (1.0 - epsilon) / max_action_count; remaining_apportioned_probability_per_action = epsilon / (number_of_actions_per_non_terminal_state[state_index] - max_action_count); } /* Update policy with our apportioned probabilities */ for (i = 0; i < number_of_actions_per_non_terminal_state[state_index]; i++) { if (state_action_value_function1[state_index][i] + state_action_value_function2[state_index][i] == max_state_action_value) { policy[state_index][i] = max_policy_apportioned_probability_per_action; } else { policy[state_index][i] = remaining_apportioned_probability_per_action; } } // end of i loop /* Update policy cumulative sum */ policy_cumulative_sum[state_index][0] = policy[state_index][0]; for (i = 1; i < number_of_actions_per_non_terminal_state[state_index]; i++) { policy_cumulative_sum[state_index][i] = policy_cumulative_sum[state_index][i - 1] + policy[state_index][i]; } // end of i loop return; } // end of EpsilonGreedyPolicyFromStateActionFunction function /* This function loops through episodes and updates the policy */ void LoopThroughEpisode(unsigned int number_of_non_terminal_states, unsigned int* number_of_actions_per_non_terminal_state, unsigned int** number_of_state_action_successor_states, unsigned int*** state_action_successor_state_indices, double*** state_action_successor_state_transition_probabilities_cumulative_sum, double*** state_action_successor_state_rewards, double** state_action_value_function1, double** state_action_value_function2, unsigned int** state_action_value_function_max_tie_stack, double** policy, double** policy_cumulative_sum, double alpha, double epsilon, double discounting_factor_gamma, unsigned int maximum_episode_length, unsigned int state_index) { unsigned int t, i; unsigned int action_index, successor_state_transition_index, next_state_index; double probability, reward; /* Loop through episode steps until termination */ for (t = 0; t < maximum_episode_length; t++) { /* Get epsilon-greedy action */ probability = UnifRand(); /* Choose policy for chosen state by epsilon-greedy choosing from the state-action-value function */ EpsilonGreedyPolicyFromStateActionFunction(number_of_actions_per_non_terminal_state, state_action_value_function1, state_action_value_function2, epsilon, state_index, policy, policy_cumulative_sum); /* Find which action using probability */ for (i = 0; i < number_of_actions_per_non_terminal_state[state_index]; i++) { if (probability <= policy_cumulative_sum[state_index][i]) { action_index = i; break; // break i loop since we found our index } } // end of i loop /* Get reward */ probability = UnifRand(); for (i = 0; i < number_of_state_action_successor_states[state_index][action_index]; i++) { if (probability <= state_action_successor_state_transition_probabilities_cumulative_sum[state_index][action_index][i]) { successor_state_transition_index = i; break; // break i loop since we found our index } } // end of i loop /* Get reward from state and action */ reward = state_action_successor_state_rewards[state_index][action_index][successor_state_transition_index]; /* Get next state */ next_state_index = state_action_successor_state_indices[state_index][action_index][successor_state_transition_index]; /* Update state action value equally randomly selecting from the two state-action-value functions */ probability = UnifRand(); if (probability <= 0.5) { state_index = UpdateStateActionValueFunction(number_of_non_terminal_states, number_of_actions_per_non_terminal_state, state_action_value_function2, state_action_value_function_max_tie_stack, alpha, discounting_factor_gamma, state_index, action_index, reward, next_state_index, state_action_value_function1); } else { state_index = UpdateStateActionValueFunction(number_of_non_terminal_states, number_of_actions_per_non_terminal_state, state_action_value_function1, state_action_value_function_max_tie_stack, alpha, discounting_factor_gamma, state_index, action_index, reward, next_state_index, state_action_value_function2); } /* Check to see if we actioned into a terminal state */ if (state_index >= number_of_non_terminal_states) { break; // episode terminated since we ended up in a terminal state } } // end of t loop return; } // end of LoopThroughEpisode function /* This function updates the state-action-value function */ unsigned int UpdateStateActionValueFunction(unsigned int number_of_non_terminal_states, unsigned int* number_of_actions_per_non_terminal_state, double** not_updating_state_action_value_function, unsigned int** state_action_value_function_max_tie_stack, double alpha, double discounting_factor_gamma, unsigned int state_index, unsigned int action_index, double reward, unsigned int next_state_index, double** updating_state_action_value_function) { unsigned int i; unsigned int next_action_index, max_action_count; double max_action_value; /* Check to see if we actioned into a terminal state */ if (next_state_index >= number_of_non_terminal_states) { updating_state_action_value_function[state_index][action_index] += alpha * (reward - updating_state_action_value_function[state_index][action_index]); } else { /* Get next action, max action of next state */ max_action_value = -DBL_MAX; max_action_count = 0; for (i = 0; i < number_of_actions_per_non_terminal_state[next_state_index]; i++) { if (max_action_value < updating_state_action_value_function[next_state_index][i]) { max_action_value = updating_state_action_value_function[next_state_index][i]; state_action_value_function_max_tie_stack[next_state_index][0] = i; max_action_count = 1; } else if (max_action_value == updating_state_action_value_function[next_state_index][i]) { state_action_value_function_max_tie_stack[next_state_index][max_action_count]; max_action_count++; } } // end of i loop next_action_index = state_action_value_function_max_tie_stack[next_state_index][rand() % max_action_count]; /* Calculate state-action-function using quintuple SARSA */ updating_state_action_value_function[state_index][action_index] += alpha * (reward + discounting_factor_gamma * not_updating_state_action_value_function[next_state_index][next_action_index] - updating_state_action_value_function[state_index][action_index]); /* Update state and action to next state and action */ state_index = next_state_index; } return state_index; } // end of UpdateStateActionValueFunction function /* This function returns a random uniform number within range [0,1] */ double UnifRand(void) { return (double)rand() / (double)RAND_MAX; } // end of UnifRand function
the_stack_data/31387789.c
//multiplos de 3 desde 1 hasta n #include<stdio.h> int main(){ int n,i; printf("Digite el total de numeros a comprobar: ");scanf("%i",&n); i = 1; while(i<=n){ if(i%3==0){ printf("%i.\n",i); } i++; } return 0; }
the_stack_data/26573.c
#include <stdio.h> #include <stdlib.h> #include <string.h> void merge(char* arr[], int l, int m, int r){ int i,j,k; int lengthL = m - l+1; int lengthR = r - m; //copy arrays char* L[lengthL]; char* R[lengthR]; for(i = 0; i<lengthL; i++) L[i] = arr[l+i]; for(j = 0; j<lengthR; j++) R[j] = arr[m+1+j]; //Merge temp arrays i = 0; j = 0; k = l; while(i<lengthL&&j<lengthR){ if(strcmp(L[i],R[j])<0){ arr[k] = L[i]; i++; }else{ arr[k] = R[j]; j++; } k++; } // Copy the remaining elements of L[] while (i < lengthL){ arr[k] = L[i]; i++; k++; } // Copy the remaining elements of R[] while (j < lengthR){ arr[k] = R[j]; j++; k++; } } void mergesort(char* arr[], int l, int r){ int m = (l+r)/2; if(l==r) return; mergesort(arr, l, m); mergesort(arr, m+1, r); merge(arr, l, m, r); } void printArray(char* A[], int size){ int i; for (i=0; i < size; i++) printf("%s ", A[i]); printf("\n"); } int checkOrder(char* A[], int size){ int i; for (i=0; i < size-1; i++){ if(strcmp(A[i],A[i+1])>0) return 0; } return 1; } int main(int argc, char *argv[]) { char* arr[] = {"blabla", "asd", "zen", "fruru"}; int size = sizeof(arr)/sizeof(arr[0]); printArray(arr, size); mergesort(arr, 0, size-1); printArray(arr, size); if(checkOrder(arr, size)) printf("test passed\n"); else printf("test failed\n"); }
the_stack_data/248580184.c
#include<stdio.h> #include<stdlib.h> int MIN_INT = -32768; struct Node { int data; struct Node *next; } *firstNode; void createNodes(int array[], int numberOfNodes) { struct Node *tempNode, *lastNode; firstNode = (struct Node *) malloc(sizeof(struct Node)); firstNode->data = array[0]; firstNode->next = NULL; lastNode = firstNode; for(int i = 1; i < numberOfNodes; i++) { tempNode = (struct Node *) malloc(sizeof(struct Node)); tempNode->data = array[i]; tempNode->next = NULL; lastNode->next = tempNode; lastNode = tempNode; } } void displayNodes(struct Node *pointNode) { printf("\nDisplay Nodes:\n\n"); while(pointNode != NULL) { printf("%d ", pointNode->data); pointNode = pointNode->next; } printf("\n"); } int maxNodesElements(struct Node *pointNode) { int max = MIN_INT; while(pointNode != NULL) { if(pointNode->data > max) { max = pointNode->data; } pointNode = pointNode->next; } return max; } int main() { int array [] = {2, 4, 6, 8, 10, 12, 14, 16, 18, 20}; createNodes(array, 10); displayNodes(firstNode); printf("\nMaximum Nodes' Element Value in Given List: %d\n", maxNodesElements(firstNode)); return 0; }
the_stack_data/25137661.c
#include <stdio.h> int main() { int x; for(x=1;x<=11;x++) { x=x+2; } printf("%d",x); return 0; } //o/p //13
the_stack_data/69877.c
#include <stdio.h> #include <sys/stat.h> #include <unistd.h> #include <fcntl.h> /* header file: #include <sys/stat.h> #include <unistd.h> int fstat(int fildes, struct stat *buf); Description: fstat()用来将参数fildes 所指的文件状态, 复制到参数buf 所指的结构中(struct stat). fstat()与stat()作用完全相同, 不同处在于传入的参数为已打开的文件描述词. retrun value: 执行成功则返回0, 失败返回-1, 错误代码存于errno. * */ int main() { struct stat buf; int fd; fd = open("/etc/passwd", O_RDONLY); fstat(fd, &buf); printf("/etc/passwd file size : %ld\n", buf.st_size); return 0; }
the_stack_data/23575035.c
#include<stdio.h> int main(int argc, char* argv[]) { int n = 0, temp, i ; int sum = 0; for( i = 0; argv[1][i] != '\0'; i++) { n = n * 10 + (argv[1][i]-'0'); } temp = n; while(temp>0) { int rem = temp % 10; sum = sum * 10 + rem; temp = temp / 10 ; } printf("\n\nThe reverse of %d is - %d", n , sum); }
the_stack_data/459391.c
/*Exercise 3 - Repetition Write a C program to calculate the sum of the numbers from 1 to n. Where n is a keyboard input. e.g. n -> 100 sum = 1+2+3+....+ 99+100 = 5050 n -> 1- sum = 1+2+3+...+10 = 55 */ #include <stdio.h> int main() { int n,sum; printf("Enter the number- "); scanf("%d", &n); while(n >= 100) { n++; sum; } while( n <=1) { n++; sum; } printf("sum is %d", sum); return 0; }
the_stack_data/212642112.c
#include<stdio.h> #include<string.h> #include<stdlib.h> void main() { FILE *f1,*f2,*f3,*f4, *f5, *f6; int lc,sa,l,op1,o,len; char m1[20],la[20],op[20],otp[20]; f1=fopen("input.txt","r"); f3=fopen("symtab.txt","w"); f5=fopen("intermediate_file.txt", "w"); f6=fopen("program_length.txt", "w"); fscanf(f1,"%s %s %x",la,m1,&op1); if(strcmp(m1,"START")==0) { sa=op1; lc=sa; printf("-\t%s\t%s\t%x\n",la,m1,op1); fprintf(f5,"-\t%s\t%s\t%x\n",la,m1,op1); } else lc=0; fscanf(f1,"%s %s",la,m1); while(!feof(f1)) { fscanf(f1,"%s",op); if(strcmp(m1,"END")!=0) { fprintf(f5,"\n%x\t%s\t%s\t%s\n",lc,la,m1,op); printf("\n%x\t%s\t%s\t%s\n",lc,la,m1,op); } else { fprintf(f5,"\n-\t%s\t%s\t%s\n",la,m1,op); printf("\n-\t%s\t%s\t%s\n",la,m1,op); } if(strcmp(la,"-")!=0) { fprintf(f3,"\n%x\t%s\n",lc,la); } f2=fopen("optab.txt","r"); fscanf(f2,"%s %x",otp,&o); while(!feof(f2)) { if(strcmp(m1,otp)==0) { lc=lc+3; break; } fscanf(f2,"%s %x",otp,&o); } fclose(f2); if(strcmp(m1,"WORD")==0) { lc=lc+3; } else if(strcmp(m1,"RESW")==0) { op1=atoi(op); lc=lc+(3*op1); } else if(strcmp(m1,"BYTE")==0) { if(op[0]=='X') lc=lc+1; else { len=strlen(op)-2; lc=lc+len;} } else if(strcmp(m1,"RESB")==0) { op1=atoi(op); lc=lc+op1; } fscanf(f1,"%s%s",la,m1); } if(strcmp(m1,"END")==0) { printf("Program length = %x",lc-sa); fprintf(f6, "%x", lc-sa); } fclose(f1); fclose(f3); }
the_stack_data/150142115.c
#include <stdio.h> #include <string.h> int main(void) { char firstname[10], lastname[10]; printf("Enter your first name:\n"); scanf("%s", firstname); printf("Enter your last name:\n"); scanf("%s", lastname); printf("%-10s %-10s\n", firstname, lastname); printf("%-10d %-10d\n", strlen(firstname), strlen(lastname)); return 0; }
the_stack_data/117540.c
//perfect void printallface(char U[5],char F[5],char D[5],char L[5],char R[5],char B[5]) { printf("\n\tup "); printface(U); printf("\n\tfront"); printface(F); printf("\n\tdown"); printface(D); printf("\n\tleft"); printface(L); printf("\n\tright"); printface(R); printf("\n\tback"); printface(B); printf("\n"); }
the_stack_data/130206.c
#include <stdio.h> int main() { short int first = 0; short int second = 100; int third = -123456; printf("Variable 1 is %10d\n", first); printf("Variable 2 is %10d\n", second); printf("Variable 3 is %10d\n", third); }
the_stack_data/62636906.c
/* Tests for pread and pwrite. Copyright (C) 1998, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <[email protected]>, 1998. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #define _GNU_SOURCE #include <stdlib.h> #include <stdio.h> #include <search.h> #include <errno.h> #include <error.h> #include <string.h> #include <unistd.h> #define TESTFILE_NAME "CRAP.XXXXXX" #define STRINGIFY(s) STRINGIFY2 (s) #define STRINGIFY2(s) #s /* These are for the temporary file we generate. */ char *name; int fd; /* Test the 32-bit versions first. */ #define PREAD pread #define PWRITE pwrite int test(int argc, char *argv[]) { char buf[1000]; char res[1000]; int i; memset (buf, '\0', sizeof (buf)); memset (res, '\xff', sizeof (res)); if (write (fd, buf, sizeof (buf)) != sizeof (buf)) error (EXIT_FAILURE, errno, "during write"); for (i = 100; i < 200; ++i) buf[i] = i; if (PWRITE (fd, buf + 100, 100, 100) != 100) error (EXIT_FAILURE, errno, "during %s", STRINGIFY (PWRITE)); for (i = 450; i < 600; ++i) buf[i] = i; if (PWRITE (fd, buf + 450, 150, 450) != 150) error (EXIT_FAILURE, errno, "during %s", STRINGIFY (PWRITE)); if (PREAD (fd, res, sizeof (buf) - 50, 50) != sizeof (buf) - 50) error (EXIT_FAILURE, errno, "during %s", STRINGIFY (PREAD)); close (fd); unlink (name); return memcmp (buf + 50, res, sizeof (buf) - 50); } /* Test the 64-bit versions as well. */ #if defined __UCLIBC_HAS_LFS__ #undef PREAD #undef PWRITE #define PREAD pread64 #define PWRITE pwrite64 int test64(int argc, char *argv[]) { char buf[1000]; char res[1000]; int i; memset (buf, '\0', sizeof (buf)); memset (res, '\xff', sizeof (res)); if (write (fd, buf, sizeof (buf)) != sizeof (buf)) error (EXIT_FAILURE, errno, "during write"); for (i = 100; i < 200; ++i) buf[i] = i; if (PWRITE (fd, buf + 100, 100, 100) != 100) error (EXIT_FAILURE, errno, "during %s", STRINGIFY (PWRITE)); for (i = 450; i < 600; ++i) buf[i] = i; if (PWRITE (fd, buf + 450, 150, 450) != 150) error (EXIT_FAILURE, errno, "during %s", STRINGIFY (PWRITE)); if (PREAD (fd, res, sizeof (buf) - 50, 50) != sizeof (buf) - 50) error (EXIT_FAILURE, errno, "during %s", STRINGIFY (PREAD)); close (fd); unlink (name); return memcmp (buf + 50, res, sizeof (buf) - 50); } #endif void prepare(void) { if (!name) { name = malloc (BUFSIZ); if (name == NULL) error (EXIT_FAILURE, errno, "cannot allocate file name"); } strncpy(name, TESTFILE_NAME, BUFSIZ); /* Open our test file. */ fd = mkstemp (name); if (fd == -1) error (EXIT_FAILURE, errno, "cannot open test file `%s'", name); } int main (int argc, char **argv) { int result = 0; prepare(); result+=test(argc, argv); if (result) { fprintf(stderr, "pread/pwrite test failed.\n"); return(EXIT_FAILURE); } fprintf(stderr, "pread/pwrite test successful.\n"); #if defined __UCLIBC_HAS_LFS__ prepare(); result+=test64(argc, argv); if (result) { fprintf(stderr, "pread64/pwrite64 test failed.\n"); return(EXIT_FAILURE); } fprintf(stderr, "pread64/pwrite64 test successful.\n"); #endif return(EXIT_SUCCESS); }
the_stack_data/170452998.c
// %%cpp ld_exec_dynlib_func.c // %MD `-lsum` - подключаем динамическую библиотеку `libsum.so` // %MD `-L.` - во время компиляции ищем библиотеку в директории `.` // %MD `-Wl,-rpath -Wl,'$ORIGIN/'.` - говорим линкеру, чтобы он собрал программу так, чтобы при запуске она искала библиотеку в `'$ORIGIN/'.`. То есть около исполняемого файла программы // %run gcc -Wall -g ld_exec_dynlib_func.c -L. -lsum -Wl,-rpath -Wl,'$ORIGIN/.' -o ld_exec_dynlib_func.exe // %run ./ld_exec_dynlib_func.exe #include <stdio.h> // объявляем функции // ~ #include "sum.h" int sum(int a, int b); float sum_f(float a, float b); int main() { #define p(stmt, fmt) printf(#stmt " = " fmt "\n", stmt); p(sum(1, 1), "%d"); p(sum(40, 5000), "%d"); p(sum_f(1, 1), "%0.2f"); p(sum_f(4.0, 500.1), "%0.2f"); return 0; }
the_stack_data/458019.c
/* ******************************************************************** * USB stack and host controller driver for SGI IRIX 6.5 * * * * Programmed by BSDero * * bsdero at gmail dot com * * 2011/2012 * * * * * * File: kmaddr.c * * Description: Returns module base address * * * ******************************************************************** ******************************************************************************************************* * FIXLIST (latest at top) * *-----------------------------------------------------------------------------------------------------* * Author MM-DD-YYYY Description * *-----------------------------------------------------------------------------------------------------* * BSDero 07-19-2012 -Initial version * * * ******************************************************************************************************* */ /* This function do anything but it's address will allow us to get the kernel module base address!! Nice for crash dumps analysis!! */ unsigned int module_address(){ return(0x0BADBABE); }
the_stack_data/170451743.c
//***************************************************************************** // // startup_gcc.c - Startup code for use with GNU tools. // // Copyright (c) 2008-2013 Texas Instruments Incorporated. All rights reserved. // Software License Agreement // // Texas Instruments (TI) is supplying this software for use solely and // exclusively on TI's microcontroller products. The software is owned by // TI and/or its suppliers, and is protected under applicable copyright // laws. You may not combine this software with "viral" open-source // software in order to form a larger program. // // THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS. // NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT // NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY // CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL // DAMAGES, FOR ANY REASON WHATSOEVER. // // This is part of revision 10636 of the RDK-BDC24 Firmware Package. // //***************************************************************************** //***************************************************************************** // // Forward declaration of the default fault handlers. // //***************************************************************************** void ResetISR(void); static void NmiSR(void); static void FaultISR(void); static void IntDefaultHandler(void); //***************************************************************************** // // External declarations for the interrupt handlers used by the application. // //***************************************************************************** extern void ADCIntHandler(void); extern void CAN0IntHandler(void); extern void ServoIFIntHandler(void); extern void EncoderIntHandler(void); extern void ControllerIntHandler(void); extern void UART0IntHandler(void); extern void WatchdogIntHandler(void); //***************************************************************************** // // The entry point for the application. // //***************************************************************************** extern int main(void); //***************************************************************************** // // Reserve space for the system stack. // //***************************************************************************** static unsigned long pulStack[128]; //***************************************************************************** // // The vector table. Note that the proper constructs must be placed on this to // ensure that it ends up at physical address 0x0000.0000. // //***************************************************************************** __attribute__ ((section(".isr_vector"))) void (* const g_pfnVectors[])(void) = { (void (*)(void))((unsigned long)pulStack + sizeof(pulStack)), // The initial stack pointer ResetISR, // The reset handler NmiSR, // The NMI handler FaultISR, // The hard fault handler IntDefaultHandler, // The MPU fault handler IntDefaultHandler, // The bus fault handler IntDefaultHandler, // The usage fault handler 0, // Reserved 0, // Reserved 0, // Reserved 0, // Reserved IntDefaultHandler, // SVCall handler IntDefaultHandler, // Debug monitor handler 0, // Reserved IntDefaultHandler, // The PendSV handler IntDefaultHandler, // The SysTick handler ServoIFIntHandler, // GPIO Port A IntDefaultHandler, // GPIO Port B EncoderIntHandler, // GPIO Port C IntDefaultHandler, // GPIO Port D IntDefaultHandler, // GPIO Port E UART0IntHandler, // UART0 Rx and Tx IntDefaultHandler, // UART1 Rx and Tx IntDefaultHandler, // SSI0 Rx and Tx IntDefaultHandler, // I2C0 Master and Slave IntDefaultHandler, // PWM Fault IntDefaultHandler, // PWM Generator 0 IntDefaultHandler, // PWM Generator 1 ControllerIntHandler, // PWM Generator 2 IntDefaultHandler, // Quadrature Encoder 0 ADCIntHandler, // ADC Sequence 0 IntDefaultHandler, // ADC Sequence 1 IntDefaultHandler, // ADC Sequence 2 IntDefaultHandler, // ADC Sequence 3 WatchdogIntHandler, // Watchdog timer IntDefaultHandler, // Timer 0 subtimer A IntDefaultHandler, // Timer 0 subtimer B IntDefaultHandler, // Timer 1 subtimer A IntDefaultHandler, // Timer 1 subtimer B IntDefaultHandler, // Timer 2 subtimer A IntDefaultHandler, // Timer 2 subtimer B IntDefaultHandler, // Analog Comparator 0 IntDefaultHandler, // Analog Comparator 1 IntDefaultHandler, // Analog Comparator 2 IntDefaultHandler, // System Control (PLL, OSC, BO) IntDefaultHandler, // FLASH Control IntDefaultHandler, // GPIO Port F IntDefaultHandler, // GPIO Port G IntDefaultHandler, // GPIO Port H IntDefaultHandler, // UART2 Rx and Tx IntDefaultHandler, // SSI1 Rx and Tx IntDefaultHandler, // Timer 3 subtimer A IntDefaultHandler, // Timer 3 subtimer B IntDefaultHandler, // I2C1 Master and Slave IntDefaultHandler, // Quadrature Encoder 1 CAN0IntHandler, // CAN0 IntDefaultHandler, // CAN1 IntDefaultHandler, // CAN2 IntDefaultHandler, // Ethernet IntDefaultHandler, // Hibernate IntDefaultHandler, // USB0 IntDefaultHandler, // PWM Generator 3 IntDefaultHandler, // uDMA Software Transfer IntDefaultHandler // uDMA Error }; //***************************************************************************** // // The following are constructs created by the linker, indicating where the // the "data" and "bss" segments reside in memory. The initializers for the // for the "data" segment resides immediately following the "text" segment. // //***************************************************************************** extern unsigned long _etext; extern unsigned long _data; extern unsigned long _edata; extern unsigned long _bss; extern unsigned long _ebss; //***************************************************************************** // // This is the code that gets called when the processor first starts execution // following a reset event. Only the absolutely necessary set is performed, // after which the application supplied entry() routine is called. Any fancy // actions (such as making decisions based on the reset cause register, and // resetting the bits in that register) are left solely in the hands of the // application. // //***************************************************************************** void ResetISR(void) { unsigned long *pulSrc, *pulDest; // // Copy the data segment initializers from flash to SRAM. // pulSrc = &_etext; for(pulDest = &_data; pulDest < &_edata; ) { *pulDest++ = *pulSrc++; } // // Zero fill the bss segment. // __asm(" ldr r0, =_bss\n" " ldr r1, =_ebss\n" " mov r2, #0\n" " .thumb_func\n" "zero_loop:\n" " cmp r0, r1\n" " it lt\n" " strlt r2, [r0], #4\n" " blt zero_loop"); // // Call the application's entry point. // main(); } //***************************************************************************** // // This is the code that gets called when the processor receives a NMI. This // simply enters an infinite loop, preserving the system state for examination // by a debugger. // //***************************************************************************** static void NmiSR(void) { // // Enter an infinite loop. // while(1) { } } //***************************************************************************** // // This is the code that gets called when the processor receives a fault // interrupt. This simply enters an infinite loop, preserving the system state // for examination by a debugger. // //***************************************************************************** static void FaultISR(void) { // // Enter an infinite loop. // while(1) { } } //***************************************************************************** // // This is the code that gets called when the processor receives an unexpected // interrupt. This simply enters an infinite loop, preserving the system state // for examination by a debugger. // //***************************************************************************** static void IntDefaultHandler(void) { // // Go into an infinite loop. // while(1) { } }
the_stack_data/156393324.c
// KMSAN: uninit-value in kernel_text_address // https://syzkaller.appspot.com/bug?id=401730da81cc65b97da6fa48aa9c0d392463f1b5 // status:invalid // autogenerated by syzkaller (http://github.com/google/syzkaller) #define _GNU_SOURCE #include <arpa/inet.h> #include <endian.h> #include <errno.h> #include <errno.h> #include <errno.h> #include <errno.h> #include <fcntl.h> #include <fcntl.h> #include <fcntl.h> #include <linux/if.h> #include <linux/if_ether.h> #include <linux/if_tun.h> #include <linux/ip.h> #include <linux/tcp.h> #include <net/if_arp.h> #include <sched.h> #include <signal.h> #include <stdarg.h> #include <stdarg.h> #include <stdarg.h> #include <stdbool.h> #include <stdbool.h> #include <stdbool.h> #include <stdio.h> #include <stdio.h> #include <stdio.h> #include <stdlib.h> #include <sys/ioctl.h> #include <sys/prctl.h> #include <sys/resource.h> #include <sys/stat.h> #include <sys/stat.h> #include <sys/stat.h> #include <sys/syscall.h> #include <sys/time.h> #include <sys/types.h> #include <sys/uio.h> #include <sys/wait.h> #include <unistd.h> __attribute__((noreturn)) static void doexit(int status) { volatile unsigned i; syscall(__NR_exit_group, status); for (i = 0;; i++) { } } #include <errno.h> #include <stdarg.h> #include <stdint.h> #include <stdio.h> #include <string.h> const int kFailStatus = 67; const int kRetryStatus = 69; static void fail(const char* msg, ...) { int e = errno; va_list args; va_start(args, msg); vfprintf(stderr, msg, args); va_end(args); fprintf(stderr, " (errno %d)\n", e); doexit((e == ENOMEM || e == EAGAIN) ? kRetryStatus : kFailStatus); } static void exitf(const char* msg, ...) { int e = errno; va_list args; va_start(args, msg); vfprintf(stderr, msg, args); va_end(args); fprintf(stderr, " (errno %d)\n", e); doexit(kRetryStatus); } #define BITMASK_LEN(type, bf_len) (type)((1ull << (bf_len)) - 1) #define BITMASK_LEN_OFF(type, bf_off, bf_len) \ (type)(BITMASK_LEN(type, (bf_len)) << (bf_off)) #define STORE_BY_BITMASK(type, addr, val, bf_off, bf_len) \ if ((bf_off) == 0 && (bf_len) == 0) { \ *(type*)(addr) = (type)(val); \ } else { \ type new_val = *(type*)(addr); \ new_val &= ~BITMASK_LEN_OFF(type, (bf_off), (bf_len)); \ new_val |= ((type)(val)&BITMASK_LEN(type, (bf_len))) << (bf_off); \ *(type*)(addr) = new_val; \ } struct csum_inet { uint32_t acc; }; static void csum_inet_init(struct csum_inet* csum) { csum->acc = 0; } static void csum_inet_update(struct csum_inet* csum, const uint8_t* data, size_t length) { if (length == 0) return; size_t i; for (i = 0; i < length - 1; i += 2) csum->acc += *(uint16_t*)&data[i]; if (length & 1) csum->acc += (uint16_t)data[length - 1]; while (csum->acc > 0xffff) csum->acc = (csum->acc & 0xffff) + (csum->acc >> 16); } static uint16_t csum_inet_digest(struct csum_inet* csum) { return ~csum->acc; } static void vsnprintf_check(char* str, size_t size, const char* format, va_list args) { int rv; rv = vsnprintf(str, size, format, args); if (rv < 0) fail("tun: snprintf failed"); if ((size_t)rv >= size) fail("tun: string '%s...' doesn't fit into buffer", str); } static void snprintf_check(char* str, size_t size, const char* format, ...) { va_list args; va_start(args, format); vsnprintf_check(str, size, format, args); va_end(args); } #define COMMAND_MAX_LEN 128 #define PATH_PREFIX \ "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin " #define PATH_PREFIX_LEN (sizeof(PATH_PREFIX) - 1) static void execute_command(bool panic, const char* format, ...) { va_list args; char command[PATH_PREFIX_LEN + COMMAND_MAX_LEN]; int rv; va_start(args, format); memcpy(command, PATH_PREFIX, PATH_PREFIX_LEN); vsnprintf_check(command + PATH_PREFIX_LEN, COMMAND_MAX_LEN, format, args); va_end(args); rv = system(command); if (rv) { if (panic) fail("command '%s' failed: %d", &command[0], rv); } } static int tunfd = -1; static int tun_frags_enabled; #define SYZ_TUN_MAX_PACKET_SIZE 1000 #define TUN_IFACE "syz_tun" #define LOCAL_MAC "aa:aa:aa:aa:aa:aa" #define REMOTE_MAC "aa:aa:aa:aa:aa:bb" #define LOCAL_IPV4 "172.20.20.170" #define REMOTE_IPV4 "172.20.20.187" #define LOCAL_IPV6 "fe80::aa" #define REMOTE_IPV6 "fe80::bb" #define IFF_NAPI 0x0010 #define IFF_NAPI_FRAGS 0x0020 static void initialize_tun(void) { tunfd = open("/dev/net/tun", O_RDWR | O_NONBLOCK); if (tunfd == -1) { printf("tun: can't open /dev/net/tun: please enable CONFIG_TUN=y\n"); printf("otherwise fuzzing or reproducing might not work as intended\n"); return; } const int kTunFd = 252; if (dup2(tunfd, kTunFd) < 0) fail("dup2(tunfd, kTunFd) failed"); close(tunfd); tunfd = kTunFd; struct ifreq ifr; memset(&ifr, 0, sizeof(ifr)); strncpy(ifr.ifr_name, TUN_IFACE, IFNAMSIZ); ifr.ifr_flags = IFF_TAP | IFF_NO_PI | IFF_NAPI | IFF_NAPI_FRAGS; if (ioctl(tunfd, TUNSETIFF, (void*)&ifr) < 0) { ifr.ifr_flags = IFF_TAP | IFF_NO_PI; if (ioctl(tunfd, TUNSETIFF, (void*)&ifr) < 0) fail("tun: ioctl(TUNSETIFF) failed"); } if (ioctl(tunfd, TUNGETIFF, (void*)&ifr) < 0) fail("tun: ioctl(TUNGETIFF) failed"); tun_frags_enabled = (ifr.ifr_flags & IFF_NAPI_FRAGS) != 0; execute_command(1, "sysctl -w net.ipv6.conf.%s.accept_dad=0", TUN_IFACE); execute_command(1, "sysctl -w net.ipv6.conf.%s.router_solicitations=0", TUN_IFACE); execute_command(1, "ip link set dev %s address %s", TUN_IFACE, LOCAL_MAC); execute_command(1, "ip addr add %s/24 dev %s", LOCAL_IPV4, TUN_IFACE); execute_command(1, "ip -6 addr add %s/120 dev %s", LOCAL_IPV6, TUN_IFACE); execute_command(1, "ip neigh add %s lladdr %s dev %s nud permanent", REMOTE_IPV4, REMOTE_MAC, TUN_IFACE); execute_command(1, "ip -6 neigh add %s lladdr %s dev %s nud permanent", REMOTE_IPV6, REMOTE_MAC, TUN_IFACE); execute_command(1, "ip link set dev %s up", TUN_IFACE); } #define DEV_IPV4 "172.20.20.%d" #define DEV_IPV6 "fe80::%02hx" #define DEV_MAC "aa:aa:aa:aa:aa:%02hx" static void initialize_netdevices(void) { unsigned i; const char* devtypes[] = {"ip6gretap", "bridge", "vcan", "bond", "veth", "team"}; const char* devnames[] = { "lo", "sit0", "bridge0", "vcan0", "tunl0", "gre0", "gretap0", "ip_vti0", "ip6_vti0", "ip6tnl0", "ip6gre0", "ip6gretap0", "erspan0", "bond0", "veth0", "veth1", "team0"}; for (i = 0; i < sizeof(devtypes) / (sizeof(devtypes[0])); i++) execute_command(0, "ip link add dev %s0 type %s", devtypes[i], devtypes[i]); execute_command(0, "ip link add dev veth1 type veth"); for (i = 0; i < sizeof(devnames) / (sizeof(devnames[0])); i++) { char addr[32]; snprintf_check(addr, sizeof(addr), DEV_IPV4, i + 10); execute_command(0, "ip -4 addr add %s/24 dev %s", addr, devnames[i]); snprintf_check(addr, sizeof(addr), DEV_IPV6, i + 10); execute_command(0, "ip -6 addr add %s/120 dev %s", addr, devnames[i]); snprintf_check(addr, sizeof(addr), DEV_MAC, i + 10); execute_command(0, "ip link set dev %s address %s", devnames[i], addr); execute_command(0, "ip link set dev %s up", devnames[i]); } } #define MAX_FRAGS 4 struct vnet_fragmentation { uint32_t full; uint32_t count; uint32_t frags[MAX_FRAGS]; }; static uintptr_t syz_emit_ethernet(uintptr_t a0, uintptr_t a1, uintptr_t a2) { if (tunfd < 0) return (uintptr_t)-1; uint32_t length = a0; char* data = (char*)a1; struct vnet_fragmentation* frags = (struct vnet_fragmentation*)a2; struct iovec vecs[MAX_FRAGS + 1]; uint32_t nfrags = 0; if (!tun_frags_enabled || frags == NULL) { vecs[nfrags].iov_base = data; vecs[nfrags].iov_len = length; nfrags++; } else { bool full = true; uint32_t i, count = 0; full = frags->full; count = frags->count; if (count > MAX_FRAGS) count = MAX_FRAGS; for (i = 0; i < count && length != 0; i++) { uint32_t size = 0; size = frags->frags[i]; if (size > length) size = length; vecs[nfrags].iov_base = data; vecs[nfrags].iov_len = size; nfrags++; data += size; length -= size; } if (length != 0 && (full || nfrags == 0)) { vecs[nfrags].iov_base = data; vecs[nfrags].iov_len = length; nfrags++; } } return writev(tunfd, vecs, nfrags); } static bool write_file(const char* file, const char* what, ...) { char buf[1024]; va_list args; va_start(args, what); vsnprintf(buf, sizeof(buf), what, args); va_end(args); buf[sizeof(buf) - 1] = 0; int len = strlen(buf); int fd = open(file, O_WRONLY | O_CLOEXEC); if (fd == -1) return false; if (write(fd, buf, len) != len) { int err = errno; close(fd); errno = err; return false; } close(fd); return true; } static void loop(); static void sandbox_common() { prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); setpgrp(); setsid(); struct rlimit rlim; rlim.rlim_cur = rlim.rlim_max = 128 << 20; setrlimit(RLIMIT_AS, &rlim); rlim.rlim_cur = rlim.rlim_max = 8 << 20; setrlimit(RLIMIT_MEMLOCK, &rlim); rlim.rlim_cur = rlim.rlim_max = 32 << 20; setrlimit(RLIMIT_FSIZE, &rlim); rlim.rlim_cur = rlim.rlim_max = 1 << 20; setrlimit(RLIMIT_STACK, &rlim); rlim.rlim_cur = rlim.rlim_max = 0; setrlimit(RLIMIT_CORE, &rlim); if (unshare(CLONE_NEWNS)) { } if (unshare(CLONE_NEWIPC)) { } if (unshare(0x02000000)) { } if (unshare(CLONE_NEWUTS)) { } if (unshare(CLONE_SYSVSEM)) { } } static int do_sandbox_none(void) { if (unshare(CLONE_NEWPID)) { } int pid = fork(); if (pid < 0) fail("sandbox fork failed"); if (pid) return pid; sandbox_common(); if (unshare(CLONE_NEWNET)) { } initialize_tun(); initialize_netdevices(); loop(); doexit(1); } static int inject_fault(int nth) { int fd; char buf[16]; fd = open("/proc/thread-self/fail-nth", O_RDWR); if (fd == -1) exitf("failed to open /proc/thread-self/fail-nth"); sprintf(buf, "%d", nth + 1); if (write(fd, buf, strlen(buf)) != (ssize_t)strlen(buf)) exitf("failed to write /proc/thread-self/fail-nth"); return fd; } uint64_t r[1] = {0xffffffffffffffff}; void loop() { long res = 0; res = syscall(__NR_socket, 0xa, 2, 0); if (res != -1) r[0] = res; *(uint8_t*)0x200001c0 = 0xfe; *(uint8_t*)0x200001c1 = 0x80; *(uint8_t*)0x200001c2 = 0; *(uint8_t*)0x200001c3 = 0; *(uint8_t*)0x200001c4 = 0; *(uint8_t*)0x200001c5 = 0; *(uint8_t*)0x200001c6 = 0; *(uint8_t*)0x200001c7 = 0; *(uint8_t*)0x200001c8 = 0; *(uint8_t*)0x200001c9 = 0; *(uint8_t*)0x200001ca = 0; *(uint8_t*)0x200001cb = 0; *(uint8_t*)0x200001cc = 0; *(uint8_t*)0x200001cd = 0; *(uint8_t*)0x200001ce = 0; *(uint8_t*)0x200001cf = 0xbb; *(uint32_t*)0x200001d0 = 0; syscall(__NR_setsockopt, r[0], 0x29, 0x1b, 0x200001c0, 0x14); *(uint8_t*)0x200001c0 = 0xaa; *(uint8_t*)0x200001c1 = 0xaa; *(uint8_t*)0x200001c2 = 0xaa; *(uint8_t*)0x200001c3 = 0xaa; *(uint8_t*)0x200001c4 = 0xaa; *(uint8_t*)0x200001c5 = 0xaa; *(uint8_t*)0x200001c6 = -1; *(uint8_t*)0x200001c7 = -1; *(uint8_t*)0x200001c8 = -1; *(uint8_t*)0x200001c9 = -1; *(uint8_t*)0x200001ca = -1; *(uint8_t*)0x200001cb = -1; *(uint16_t*)0x200001cc = htobe16(0x86dd); STORE_BY_BITMASK(uint8_t, 0x200001ce, 0, 0, 4); STORE_BY_BITMASK(uint8_t, 0x200001ce, 6, 4, 4); memcpy((void*)0x200001cf, "\x4c\x91\x48", 3); *(uint16_t*)0x200001d2 = htobe16(0x14); *(uint8_t*)0x200001d4 = 0x73; *(uint8_t*)0x200001d5 = 0; *(uint8_t*)0x200001d6 = 0; *(uint8_t*)0x200001d7 = 0; *(uint8_t*)0x200001d8 = 0; *(uint8_t*)0x200001d9 = 0; *(uint8_t*)0x200001da = 0; *(uint8_t*)0x200001db = 0; *(uint8_t*)0x200001dc = 0; *(uint8_t*)0x200001dd = 0; *(uint8_t*)0x200001de = 0; *(uint8_t*)0x200001df = 0; *(uint8_t*)0x200001e0 = 0; *(uint8_t*)0x200001e1 = 0; *(uint8_t*)0x200001e2 = 0; *(uint8_t*)0x200001e3 = 0; *(uint8_t*)0x200001e4 = 0; *(uint8_t*)0x200001e5 = 0; *(uint8_t*)0x200001e6 = 0xfe; *(uint8_t*)0x200001e7 = 0x80; *(uint8_t*)0x200001e8 = 0; *(uint8_t*)0x200001e9 = 0; *(uint8_t*)0x200001ea = 0; *(uint8_t*)0x200001eb = 0; *(uint8_t*)0x200001ec = 0; *(uint8_t*)0x200001ed = 0; *(uint8_t*)0x200001ee = 0; *(uint8_t*)0x200001ef = 0; *(uint8_t*)0x200001f0 = 0; *(uint8_t*)0x200001f1 = 0; *(uint8_t*)0x200001f2 = 0; *(uint8_t*)0x200001f3 = 0; *(uint8_t*)0x200001f4 = 0; *(uint8_t*)0x200001f5 = 0xbb; *(uint16_t*)0x200001f6 = htobe16(0); *(uint16_t*)0x200001f8 = htobe16(0); *(uint32_t*)0x200001fa = 0x41424344; *(uint32_t*)0x200001fe = 0x41424344; STORE_BY_BITMASK(uint8_t, 0x20000202, 0, 0, 1); STORE_BY_BITMASK(uint8_t, 0x20000202, 0, 1, 3); STORE_BY_BITMASK(uint8_t, 0x20000202, 5, 4, 4); *(uint8_t*)0x20000203 = 0; *(uint16_t*)0x20000204 = htobe16(0); *(uint16_t*)0x20000206 = 0; *(uint16_t*)0x20000208 = htobe16(0); *(uint32_t*)0x200000c0 = 0; *(uint32_t*)0x200000c4 = 0; *(uint32_t*)0x200000c8 = 0; *(uint32_t*)0x200000cc = 0; *(uint32_t*)0x200000d0 = 0; *(uint32_t*)0x200000d4 = 0; struct csum_inet csum_1; csum_inet_init(&csum_1); csum_inet_update(&csum_1, (const uint8_t*)0x200001d6, 16); csum_inet_update(&csum_1, (const uint8_t*)0x200001e6, 16); uint32_t csum_1_chunk_2 = 0x14000000; csum_inet_update(&csum_1, (const uint8_t*)&csum_1_chunk_2, 4); uint32_t csum_1_chunk_3 = 0x6000000; csum_inet_update(&csum_1, (const uint8_t*)&csum_1_chunk_3, 4); csum_inet_update(&csum_1, (const uint8_t*)0x200001f6, 20); *(uint16_t*)0x20000206 = csum_inet_digest(&csum_1); write_file("/sys/kernel/debug/failslab/ignore-gfp-wait", "N"); write_file("/sys/kernel/debug/fail_futex/ignore-private", "N"); inject_fault(0); syz_emit_ethernet(0x4a, 0x200001c0, 0x200000c0); } int main() { syscall(__NR_mmap, 0x20000000, 0x1000000, 3, 0x32, -1, 0); int pid = do_sandbox_none(); int status = 0; while (waitpid(pid, &status, __WALL) != pid) { } return 0; }
the_stack_data/220455487.c
/* gcc -std=c17 -lc -lm -pthread -o ../_build/c/string_byte_isupper.exe ./c/string_byte_isupper.c && (cd ../_build/c/;./string_byte_isupper.exe) https://en.cppreference.com/w/c/string/byte/isupper */ #include <stdio.h> #include <ctype.h> #include <locale.h> int main(void) { unsigned char c = '\xc6'; // letter Æ in ISO-8859-1 printf("In the default C locale, \\xc6 is %suppercase\n", isupper(c) ? "" : "not " ); setlocale(LC_ALL, "en_GB.iso88591"); printf("In ISO-8859-1 locale, \\xc6 is %suppercase\n", isupper(c) ? "" : "not " ); }