file
stringlengths
18
26
data
stringlengths
3
1.04M
the_stack_data/206235.c
/* * BSD 3-Clause License * * Copyright (c) 2019, Alef Berg da Silva * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of the copyright holder nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * */ #include <arpa/inet.h> #include <stdio.h> #include <stdlib.h> #include <sys/socket.h> #include <sys/types.h> #include <unistd.h> #include <netinet/in.h> #define CLIENT_QUEUE_LEN 10 #define SERVER_PORT 7002 int main(void) { int listen_sock_fd = -1, client_sock_fd = -1; struct sockaddr_in6 server_addr, client_addr; socklen_t client_addr_len; char str_addr[INET6_ADDRSTRLEN]; int ret, flag; char ch; /* Create socket for listening (client requests) */ listen_sock_fd = socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP); if(listen_sock_fd == -1) { perror("socket()"); return EXIT_FAILURE; } /* Set socket to reuse address */ flag = 1; ret = setsockopt(listen_sock_fd, SOL_SOCKET, SO_REUSEADDR, &flag, sizeof(flag)); if(ret == -1) { perror("setsockopt()"); return EXIT_FAILURE; } server_addr.sin6_family = AF_INET6; server_addr.sin6_addr = in6addr_any; server_addr.sin6_port = htons(SERVER_PORT); /* Bind address and socket together */ ret = bind(listen_sock_fd, (struct sockaddr*)&server_addr, sizeof(server_addr)); if(ret == -1) { perror("bind()"); close(listen_sock_fd); return EXIT_FAILURE; } /* Create listening queue (client requests) */ ret = listen(listen_sock_fd, CLIENT_QUEUE_LEN); if (ret == -1) { perror("listen()"); close(listen_sock_fd); return EXIT_FAILURE; } client_addr_len = sizeof(client_addr); while(1) { /* Do TCP handshake with client */ client_sock_fd = accept(listen_sock_fd, (struct sockaddr*)&client_addr, &client_addr_len); if (client_sock_fd == -1) { perror("accept()"); close(listen_sock_fd); return EXIT_FAILURE; } inet_ntop(AF_INET6, &(client_addr.sin6_addr), str_addr, sizeof(str_addr)); printf("New connection from: %s:%d ...\n", str_addr, ntohs(client_addr.sin6_port)); /* Wait for data from client */ ret = read(client_sock_fd, &ch, 1); if (ret == -1) { perror("read()"); close(client_sock_fd); continue; } /* Do very useful thing with received data :-) */ ch++; /* Send response to client */ ret = write(client_sock_fd, &ch, 1); if (ret == -1) { perror("write()"); close(client_sock_fd); continue; } /* Do TCP teardown */ ret = close(client_sock_fd); if (ret == -1) { perror("close()"); client_sock_fd = -1; } printf("Connection closed\n"); } return EXIT_SUCCESS; }
the_stack_data/187642084.c
// #todo // x to power of y double pow (double __x, double __y) { return 0; } // returns square root of x double sqrt (double __x) { return 0; } double floor (double __x) { return 0; } double ceil (double __x) { return 0; } // arc tangent of x double atan (double __x) { return 0; } double acos (double __x) { return 0; } double asin (double __x) { return 0; } double tan (double __x) { return 0; } double cos (double __x) { return 0; } double sin (double __x) { return 0; } /* unsigned long round ( unsigned long v, unsigned long r); unsigned long round ( unsigned long v, unsigned long r){ r--; v += r; v &= ~(long)r; return (v); } */ /* double factorial(double n)// not needed by SineN2, CosineN2 functions { if (n<=1.0) return(1.0); else n=n*factorial(n-1.0); // notice we just keep calling this over until we get to 1! return(n); } */ /* // this method uses the recursion relation for the series // to generate the next coefficient from the last. // Advantages: 1) No need to find n! for each term. // 2) No need to call pow(x,n) each term. double SineN2(const double& x, const int& n, double* p_err ) { double a = 1.0*x;// 1st term double sum = 0.0; if(n > 0) { for(int j=1; j<=n; j++)// for sine { sum += a; a *= -1.0*x*x/( (2*j+1)*(2*j) );// next term from last // sum += a; } *p_err = a;// max. error = 1st term not taken for alternating series } else cout << " n must be > 0"; return sum; }// end of SineN2() */ /* double CosineN2(const double& x, const int& n, double* p_err ) { double a = 1.0;// 1st term double sum = 0.0; if(n > 0) { for(int j=0; j<n; j++)// for cosine { sum += a; a *= -1.0*x*x/( (2*j+1)*(2*j+2) );// next term from last // sum += a; } *p_err = a;// max. error = 1st term not taken for alternating series } else cout << " n must be > 0"; return sum; }// end of CosineN2() */
the_stack_data/126702146.c
/* Based on Stephen Brennan's lsh shell code (https://github.com/brenns10/lsh). */ #include <sys/types.h> #include <sys/stat.h> #include <sys/wait.h> #include <unistd.h> #include <stdlib.h> #include <stdio.h> #include <netdb.h> #include <netinet/in.h> #include <string.h> #include <ncurses.h> #include <dirent.h> #include <regex.h> #include <sys/socket.h> #define arrlen(x) (sizeof(x) / sizeof((x)[0])) /* Function Declarations for built_in shell commands. */ int shell_cd(char **args); int shell_help(char **args); int shell_exec(char **args); int shell_exit(char **args); int shell_search(char **args); int shell_commit(char **args); // Declare other functions. void server_send_data(char *data); int num_of_files(const char* path); int num_of_char(char *str, char ch); char *str_replace(char *str, char *orig, char *rep, int start); int read_directory(char **files, const char* directory, int *iterator); /* List of built_in commands, followed by their corresponding functions. */ char *built_in_str[] = { "cd", "help", "exec", "exit", "search", "commit" }; int (*built_in_func[]) (char **) = { &shell_cd, &shell_help, &shell_exec, &shell_exit, &shell_search, &shell_commit }; /* List of all the allowed commands. */ char *allowed_cmds[] = { "vim", "nano", "cat", "mkdir", "mv", "rm", "ls", "clear", "man", "echo", "tmux" }; /* built_in function implementations. */ /** @brief Bultin command: change directory. @param args List of args. args[0] is "cd". args[1] is the directory. @return Always returns 1, to continue executing. */ int shell_cd(char **args) { if (args[1] == NULL) { fprintf(stderr, "shell: Expected at least one argument\n"); } else { if (chdir(args[1]) != 0) { perror("shell"); } } return 1; } /** @brief built_in command: print help. @param args List of args. Not examined. @return Always returns 1, to continue executing. */ int shell_help(char **args) { printw("-[Shell]-\n"); printw("Type program names and arguments, and hit enter.\n"); printw("The following are built-in:\n"); int i; for (i = 0; i < arrlen(built_in_str); i++) { printw(" - %s\n", built_in_str[i]); } printw("Use the man command for information on other programs.\n\n"); printw("These are the commands you are allowed to use:\n"); for (i = 0; i < arrlen(allowed_cmds); i++) { printw(" - %s\n", allowed_cmds[i]); } return 1; } // NOTE: Likely removal. int shell_exec(char **args) { if (args[1] == NULL) { printw("Nothing was specified to execute.\n"); return 1; } if (strcmp(args[1], "") == 0) { // Nothing. } else { printw("Nothing to execute.\n"); } return 1; } /** @brief built_in command: exit. @param args List of args. Not examined. @return Always returns 0 to terminate execution. */ int shell_exit(char **args) { return 0; } void shell_search_menu(char **directories, char **names, int postCount) { // Clear screen before making the menu and set shell mode to RAW. clear(); raw(); int yMax, xMax; getmaxyx(stdscr, yMax, xMax); WINDOW * menuWin = newwin(yMax-5, xMax-12, yMax-(yMax*0.9415), 5); box(menuWin, 0, 0); refresh(); wrefresh(menuWin); curs_set(0); keypad(menuWin, true); mvprintw(yMax-(yMax%100*0.9415), (xMax*0.5215)-9, "-Results-"); int ch; int choice; int highlight = 0; while (1) { for (int i = 0; i < postCount; i++) { if (i == highlight) attron(A_REVERSE); mvprintw(yMax-(yMax%100*0.9415)+2+i, 8, names[i]); attroff(A_REVERSE); } ch = getch(); if (ch == 'Q') break; if (ch == KEY_UP) { if (highlight != 0) highlight--; } else if (ch == KEY_DOWN) { if (highlight < postCount-1) highlight++; } if (ch == '\n') { mvprintw(0, 0, "Picked: %s\n", directories[highlight]); } } // "Reset" the shell. clear(); curs_set(1); delwin(menuWin); reset_shell_mode(); } int shell_search(char **args) { // Check if user typed something to search for. if (!args[1]) { printw("You need to type something to search for.\n"); return 1; } // Get all the files in the forum. char **allFiles = NULL; int fCount = num_of_files("/home/ShellForum/Forum"); allFiles = malloc(fCount * sizeof(char*)); read_directory(allFiles, "/home/ShellForum/Forum", NULL); int rCount = 0; char **results = NULL; printw("fCount: %i\n", fCount); refresh(); // Count how many matches we got. for (int i = 0; i < fCount; i++) { char path[1024]; strcpy(path, allFiles[i]); // Number of times a forward slash occurs in the path. int slashCount = num_of_char(path, '/'); char *token = strtok(path, "/"); for (int ii = 0; ii < slashCount-1; ii++) { token = strtok(NULL, "/"); } int ii = 1; while (args[ii] != NULL) { // Compile regular expression. regex_t regex; int reti = regcomp(&regex, args[ii], 0); // Check if there is a match. reti = regexec(&regex, token, 0, NULL, 0); if (!reti) { rCount++; } ii++; } } char **resultPaths = NULL; // If any results were found, then store the results. if (rCount > 0) { int rI = 0; // Allocate memory for the results and their paths. resultPaths = malloc(fCount * sizeof(char*)); results = malloc(rCount * sizeof(char*)); for (int i = 0; i < fCount; i++) { char path[1024]; strcpy(path, allFiles[i]); // Number of times a forward slash occurs in the path. int slashCount = num_of_char(path, '/'); char *token = strtok(path, "/"); for (int ii = 0; ii < slashCount-1; ii++) { token = strtok(NULL, "/"); } int ii = 1; while (args[ii] != NULL) { // Compile regular expression. regex_t regex; int reti = regcomp(&regex, args[ii], 0); // Check if there is a match. reti = regexec(&regex, token, 0, NULL, 0); if (!reti) { // Allocate more memory for result entry, copy the path over to the list of results. results[rI] = malloc((strlen(token)+1) * sizeof(char*)); strcpy(results[rI], token); resultPaths[rI] = malloc((strlen(allFiles[i])+1) * sizeof(char*)); strcpy(resultPaths[rI], allFiles[i]); rI++; } ii++; } } } free(allFiles); if (rCount > 0) { shell_search_menu(resultPaths, results, rCount); } else { printw("No results found.\n"); } free(results); free(resultPaths); return 1; } int shell_commit(char **args) { char data[1024]; memset(data, '\0', sizeof(data)); char buffer[256]; if (!args[1]) { printw("No forum or file to commit was chosen.\n"); printw("Use "); attron(A_ITALIC); printw("commit ls"); attroff(A_ITALIC); printw(" to list all the forums.\n"); return 1; } else if (strlen(args[1]) == 2 && strcmp(args[1], "ls")) { printw("No forum to commit to was chosen.\nUse "); attron(A_ITALIC); printw("commit ls"); attroff(A_ITALIC); printw(" to list all the forums.\n"); return 1; } else if (!args[2]) { printw("No file was chosen to commit.\n"); return 1; } if (strcmp(args[1], "ls") == 0) { strncpy(data, "Action: list", sizeof(data)); printw("%s\n", data); server_send_data(data); return 1; } FILE *file = fopen(args[2], "r"); if (file) { // Type of action. strcat(data, "Action: upload\t\r\n\a"); // Name of file user is commiting. strcat(data, "Filename: "); strcat(data, args[2]); strcat(data, "\t\r\n\a"); // Name of user that is commiting. strcat(data, "User: "); strcat(data, getenv("USER")); strcat(data, "\t\r\n\a"); // The category/forum to commit to. strcat(data, "Forum: "); strcat(data, args[1]); strcat(data, "\t\r\n\a"); // The actual data of the post. strcat(data, "Data: "); char line[1024]; while (fgets(line, sizeof(line), file)) { strcat(data, line); } strcat(data, "\t\r\n\a"); fclose(file); server_send_data(data); } else { printw("No such file.\n"); return 1; } return 1; } /** @brief Launch a program and wait for it to terminate. @param args Null terminated list of arguments (including program). @return Always returns 1, to continue execution. */ int shell_launch(char **args) { pid_t pid; int status; pid = fork(); if (pid == 0) { // Child process. // Check if user is trying to run an allowed program. for (int i = 0; i < arrlen(allowed_cmds); i++) { if (strcmp(allowed_cmds[i], args[0]) == 0) { if (execvp(args[0], args) == -1) { perror("shell"); } } } exit(EXIT_FAILURE); } else if (pid < 0) { // Error forking perror("shell"); } else { // Parent process do { waitpid(pid, &status, WUNTRACED); } while (!WIFEXITED(status) && !WIFSIGNALED(status)); } return 1; } /** @brief Execute shell built-in or launch program. @param args Null terminated list of arguments. @return 1 if the shell should continue running, 0 if it should terminate */ int shell_execute(char **args) { int i; if (args[0] == NULL) { // An empty command was entered. return 1; } for (i = 0; i < arrlen(built_in_func); i++) { if (strcmp(args[0], built_in_str[i]) == 0) { return (*built_in_func[i])(args); } } return shell_launch(args); } void server_send_data(char *data) { int sockfd, portno, n; struct sockaddr_in serv_addr; struct hostent *server; //char *buffer = malloc(256); portno = 2155; /* Create a socket point */ sockfd = socket(AF_INET, SOCK_STREAM, 0); if (sockfd < 0) { perror("ERROR opening socket"); return; } server = gethostbyname("127.0.0.1"); if (server == NULL) { fprintf(stderr,"ERROR, no such host\n"); return; } bzero((char *) &serv_addr, sizeof(serv_addr)); serv_addr.sin_family = AF_INET; bcopy((char *)server->h_addr, (char *)&serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(portno); /* Now connect to the server */ if (connect(sockfd, (struct sockaddr*)&serv_addr, sizeof(serv_addr)) < 0) { perror("ERROR connecting"); return; } write(sockfd, data, strlen(data)); /* Now read server response */ int flag; /* FLAGS: - -1: Error - 0: List response - 1: Upload response */ char buffer[256]; bzero(buffer, sizeof(buffer)); while (recv(sockfd, buffer, sizeof(buffer), 0) != 0) { if (strncmp(buffer, "Action: list", 12) == 0) { flag = 0; printw("Avaiable forums:\n"); bzero(buffer, sizeof(buffer)); continue; } else if (strncmp(buffer, "Error: ", 7) == 0 ) { flag = -1; printw("%s\n", &buffer[7]); break; } if (flag == 0) { printw("- %s\n", buffer); } bzero(buffer, sizeof(buffer)); } close(sockfd); } int num_of_files(const char* path) { DIR *dir; int counter = 0; struct dirent *de; refresh(); dir = opendir(path); if (dir == NULL) { fprintf(stderr, "shell: num_of_files() could not open current directory\n"); return -1; } while ((de = readdir(dir)) != NULL) { if (strcmp(de->d_name, ".") == 0 || strcmp(de->d_name, "..") == 0) continue; counter++; if (de->d_type == DT_DIR) { char *filename = de->d_name; char *newDir = malloc(strlen(path) + strlen(filename) + 2); if (newDir != NULL) { strcpy(newDir, path); strcat(newDir, "/"); strcat(newDir, filename); } counter += num_of_files(newDir); } } closedir(dir); return counter; } int read_directory(char **files, const char* directory, int *iterator) { DIR *dir = opendir(directory); if (dir == NULL) { fprintf(stderr, "shell: read_directory() could not open current directory\n"); return -1; } int i = 0; if (iterator) i = *iterator; struct dirent *de; while ((de = readdir(dir)) != NULL) { if (strcmp(de->d_name, ".") == 0 || strcmp(de->d_name, "..") == 0) continue; char *filename = de->d_name; char *path = malloc(strlen(directory) + strlen(filename) + 2); if (path != NULL) { strcpy(path, directory); strcat(path, "/"); strcat(path, filename); } else { continue; } files[i] = malloc((strlen(path)+1) * sizeof(char)); strcpy(files[i], path); i++; if (iterator) (*iterator)++; if (de->d_type == DT_DIR) { read_directory(files, path, &i); } } closedir(dir); return 0; } void lineClearTo(int start, int end) { int x, y; getyx(stdscr, y, x); for (int i = end; i > start; i--) { mvdelch(y, i); } } #define SHELL_RL_BUFSIZE 1024 /** @brief Read a line of input from stdin. @return The line from stdin. */ char *shell_read_line(int lenPrompt) { // Set to RAW mode, used for special keys. raw(); int ch; int bufsize = SHELL_RL_BUFSIZE; int position = 0; int lenBuffer = 0; char *buffer = malloc(sizeof(char) * bufsize); if (!buffer) { fprintf(stderr, "shell: allocation error\n"); exit(EXIT_FAILURE); } char *home = getenv("HOME"); char *hFilename = "/.history"; char *hPath = malloc(strlen(home) + strlen(hFilename) + 1); if (hPath != NULL) { strcpy(hPath, home); strcat(hPath, hFilename); } int hPosition = 0; char **historyBuffer = NULL; unsigned long hbCount = 0; FILE *hFp = fopen(hPath, "r"); if (hFp) { char line[1024]; while (fgets(line, sizeof(line), hFp)) { historyBuffer = (char **)realloc(historyBuffer, (hbCount+1) * sizeof(char *)); line[strlen(line)-1] = 0; historyBuffer[hbCount] = strdup(line); hbCount++; } fclose(hFp); } while ((ch = getch()) && ch != 'Q') { int x, y; int hidePress = 0; // Special keys for navigation on the line. if (ch == KEY_UP) { getyx(stdscr, y, x); if (hbCount > 0 && hPosition < hbCount) { if (position > 0) { lineClearTo(x-position-1, x); } printw(historyBuffer[hPosition]); buffer = historyBuffer[hPosition]; lenBuffer = strlen(historyBuffer[hPosition]); position = strlen(historyBuffer[hPosition]); hPosition++; } hidePress = 1; } else if (ch == KEY_DOWN) { getyx(stdscr, y, x); if (hbCount > 0 && hPosition > 0) { if (position > 0) { lineClearTo(x-position-1, x); } hPosition -= 1; printw(historyBuffer[hPosition]); buffer = historyBuffer[hPosition]; lenBuffer = strlen(historyBuffer[hPosition]); position = strlen(historyBuffer[hPosition]); } hidePress = 1; } else if (ch == KEY_LEFT) { getyx(stdscr, y, x); if (x != lenPrompt) { move(y, x-1); refresh(); position--; } hidePress = 1; } else if (ch == KEY_RIGHT) { getyx(stdscr, y, x); if (x != lenPrompt+lenBuffer) { move(y, x+1); refresh(); position++; } hidePress = 1; } else if (ch == KEY_HOME) { getyx(stdscr, y, x); if (x != lenPrompt) { move(y, lenPrompt); position = 0; } hidePress = 1; } else if (ch == KEY_END) { getyx(stdscr, y, x); if (x != lenPrompt+lenBuffer) { move(y, lenPrompt+lenBuffer); position = lenBuffer; } hidePress = 1; } // Special keys for editing the line. if (ch == KEY_BACKSPACE) { getyx(stdscr, y, x); if (x != lenPrompt) { mvdelch(y, x-1); position--; lenBuffer--; buffer[position] = 0; strcpy(&buffer[position], &buffer[position+1]); } hidePress = 1; } else if (ch == KEY_DC) { getyx(stdscr, y, x); if (x != lenBuffer) { mvdelch(y, x); position--; lenBuffer--; buffer[position] = 0; strcpy(&buffer[position], &buffer[position+1]); } hidePress = 1; } if (ch == EOF) { exit(EXIT_SUCCESS); } else if (ch == '\n') { buffer[lenBuffer] = '\0'; // Go to a new line after user input. printw("\n"); refresh(); // Reset the shell mode to exit RAW mode. reset_shell_mode(); // Return what was typed. return buffer; } else { if (!hidePress) { if (position == lenBuffer) { buffer[position] = ch; printw("%c", ch); position++; lenBuffer++; } else { char *temp = malloc((lenBuffer) + 3); memset(temp, '\0', sizeof(temp)); getyx(stdscr, y, x); lineClearTo(x-position-1, x); position++; lenBuffer++; strcpy(&temp[0], buffer); temp[position-1] = ch; for(int i = position-1; i < lenBuffer-1; i++) { temp[i+1] = buffer[i]; } temp = realloc(temp, strlen(temp)); for (int i = lenBuffer; i < strlen(temp); i++) { temp[i] = 0; } printw("%s", temp); move(y, x+1); buffer = temp; } refresh(); } } // If we have exceeded the buffer, reallocate. if (lenBuffer >= bufsize) { bufsize += SHELL_RL_BUFSIZE; buffer = realloc(buffer, bufsize); if (!buffer) { fprintf(stderr, "shell: allocation error\n"); exit(EXIT_FAILURE); } } } } #define SHELL_TOK_BUFSIZE 64 #define SHELL_TOK_DELIM " \t\r\n\a" /** @brief Split a line into tokens (very naively). @param line The line. @return Null-terminated array of tokens. */ char **shell_split_line(char *line) { int bufsize = SHELL_TOK_BUFSIZE, position = 0; char **tokens = malloc(bufsize * sizeof(char*)); char *token, **tokens_backup; if (!tokens) { fprintf(stderr, "shell: allocation error\n"); exit(EXIT_FAILURE); } token = strtok(line, SHELL_TOK_DELIM); while (token != NULL) { tokens[position] = token; position++; if (position >= bufsize) { bufsize += SHELL_TOK_BUFSIZE; tokens_backup = tokens; tokens = realloc(tokens, bufsize * sizeof(char*)); if (!tokens) { free(tokens_backup); fprintf(stderr, "shell: allocation error\n"); exit(EXIT_FAILURE); } } token = strtok(NULL, SHELL_TOK_DELIM); } tokens[position] = NULL; return tokens; } void shell_save_command(char *cmd) { char *home = getenv("HOME"); char *filename = "/.history"; char *path = malloc(strlen(home) + strlen(filename) + 1); if (path != NULL) { strcpy(path, home); strcat(path, filename); } FILE *fp = fopen(path, "a"); fprintf(fp, "%s\n", cmd); refresh(); fclose(fp); free(path); } // NOTE: Likely removal if no other use for it. int str_starts_with(const char *restrict string, const char *restrict prefix) { while(*prefix) { if(*prefix++ != *string++) return 0; } return 1; } char *str_replace(char *str, char *orig, char *rep, int start) { static char temp[4096]; static char buffer[4096]; char *p; strcpy(temp, str + start); if(!(p = strstr(temp, orig))) // Is 'orig' even in 'temp'? return temp; strncpy(buffer, temp, p-temp); // Copy characters from 'temp' start to 'orig' str. buffer[p-temp] = '\0'; sprintf(buffer + (p - temp), "%s%s", rep, p + strlen(orig)); sprintf(str + start, "%s", buffer); return str; } int num_of_char(char *str, char ch) { int counter = 0; for (int i = 0; i < strlen(str); i++) { if (str[i] == ch) counter++; } return counter; } void shell_get_cwd(char *pCWD) { char cwd[1024]; if (getcwd(cwd, sizeof(cwd)) == NULL) perror("shell: getcwd() error"); int slashCount = num_of_char(getenv("HOME"), '/'); char *temp = malloc(strlen(cwd)+1); strncpy(temp, cwd, strlen(cwd)); char *dirUser = strtok(temp, "/"); for (int i = 0; i < slashCount-1; i++) { if (dirUser != NULL) dirUser = strtok(NULL, "/"); } int isUsersDir = 0; if (dirUser != NULL && strlen(dirUser) == strlen(getenv("USER"))) { if (strncmp(dirUser, getenv("USER"), strlen(dirUser))) isUsersDir = 1; } if (isUsersDir) { strncpy(pCWD, str_replace(cwd, getenv("HOME"), "~", 0), 1024); } else { strncpy(pCWD, cwd, 1024); } } void shell_display_motd(void) { FILE *file; // Read MOTD from the parent directory. if (file = fopen("../motd", "r")) { char buffer[1024]; // Read the contents of the file. while (fgets(buffer, sizeof buffer, file) != NULL) { printw("%s", buffer); } // Display any errors. if (!feof(file)) { perror("shell: fgets() error"); } fclose(file); } else { printw("No MOTD to display.\n"); } } /** @brief Loop getting input and executing it. */ void shell_loop(void) { char *line; char **args; int status; char cwd[1024]; do { // Get current working directory. shell_get_cwd(cwd); // Display prompt with colour. attron(COLOR_PAIR(2)); printw(getenv("USER")); attron(COLOR_PAIR(1)); printw(":"); attron(COLOR_PAIR(3)); printw(cwd); attron(COLOR_PAIR(1)); printw("$ "); refresh(); // Length of the prompt. int lenPrompt = strlen(getenv("USER")) + strlen(cwd) + 3; line = shell_read_line(lenPrompt); printw("Line: %s\n", line); refresh(); args = shell_split_line(line); status = shell_execute(args); // Add entered command into history. shell_save_command(line); free(line); free(args); } while (status); } /** @brief Main entry point. @param argc Argument count. @param argv Argument vector. @return status code */ int main(int argc, char **argv) { /* Curses Initialisations */ initscr(); start_color(); keypad(stdscr, TRUE); noecho(); // Define colours. init_color(COLOR_BLUE, 0, 400, 740); init_pair(1, COLOR_WHITE, COLOR_BLACK); init_pair(2, COLOR_GREEN, COLOR_BLACK); init_pair(3, COLOR_BLUE, COLOR_BLACK); shell_loop(); printw("\nExiting Now\n"); endwin(); return EXIT_SUCCESS; }
the_stack_data/242329848.c
#include <stdio.h> #define MAXL 10 #define MAXF 50 typedef struct{ float temperatura; float precipitacion; float viento; }TDatos; TDatos Observacion[MAXL][MAXF]; int NumeroLugares=0; char NombreLugar[MAXL][50]; int NumeroFechas=0; typedef struct{ int dia; int mes; int anio; }Fecha; Fecha FechaObservacion[MAXF]; void nuevolugar (void){ int i; if(NumeroLugares>=MAXL){ printf("No puede introducir más lugares.");} else{ printf("Introduzca el nombre del nuevo lugar: "); getchar(); scanf("%[^\n]",NombreLugar[NumeroLugares]); for(i=0;i<NumeroFechas;i++){ printf("Introduzca los datos del día %d/%d/%d en %s",FechaObservacion[i].dia,FechaObservacion[i].mes,FechaObservacion[i].anio,NombreLugar[NumeroLugares]); printf("\nTemperatura: "); scanf("%f",&Observacion[NumeroLugares][i].temperatura); printf("\nPrecipitación: "); scanf("%f",&Observacion[NumeroLugares][i].precipitacion); printf("\nViento: "); scanf("%f",&Observacion[NumeroLugares][i].viento);} NumeroLugares++;}} void nuevafecha (void){ int i; if(NumeroFechas>=MAXF){ printf("No puede introducir más fechas.");} else{ printf("Introduzca la nueva fecha (dd mm aaaa): "); scanf("%d",&FechaObservacion[NumeroFechas].dia); scanf("%d",&FechaObservacion[NumeroFechas].mes); scanf("%d",&FechaObservacion[NumeroFechas].anio); for(i=0;i<NumeroLugares;i++){ printf("Introduzca los datos de %s: ",NombreLugar[i]); printf("\nTemperatura: "); scanf("%f",&Observacion[i][NumeroFechas].temperatura); printf("\nPrecipitación: "); scanf("%f",&Observacion[i][NumeroFechas].precipitacion); printf("\nViento: "); scanf("%f",&Observacion[i][NumeroFechas].viento);} NumeroFechas++;}} float Minimo (float Vector[],int nElementos,int *Posicion); float Media (float Vector[] ,int nElementos); int elegirTipoDato (void); float Maximo (float Vector[],int nElementos,int *Posicion); void mostrarMedia (int TipoDato){ int i,j; float med[NumeroFechas]; switch(TipoDato){ case 0: for(i=0;i<NumeroLugares;i++){ for(j=0;j<NumeroFechas;j++){ med[j]=Observacion[i][j].temperatura;} printf("La media de las temperaturas en %s fue de: %.2fºC.\n", NombreLugar[i], Media (med,NumeroFechas));}break; case 1: for(i=0;i<NumeroLugares;i++){ for(j=0;j<NumeroFechas;j++){ med[j]=Observacion[i][j].precipitacion;} printf("La media de las precipitaciones en %s fue de: %.2f mm.\n", NombreLugar[i], Media (med,NumeroFechas));}break; case 2: for(i=0;i<NumeroLugares;i++){ for(j=0;j<NumeroFechas;j++){ med[j]=Observacion[i][j].viento;} printf("La media del viento en %s fue de: %.2f km/h.\n", NombreLugar[i], Media (med,NumeroFechas));}break; default: printf("La opción seleccionada no existe, por favor seleccione otra."); mostrarMedia (elegirTipoDato());break;}} float Media (float Vector[],int nElementos){ int i; float media=0; for(i=0;i<nElementos;i++){ media+=Vector[i];} media=media/nElementos; return(media);} void mostrarMaximo (int TipoDato){ int i,j; int Posicion; float max[NumeroFechas]; switch(TipoDato){ case 0: for(i=0;i<NumeroLugares;i++){ for(j=0;j<NumeroFechas;j++){ max[j]=Observacion[i][j].temperatura;} printf("La temperatura máxima en %s se registró el día %d/%d/%d y fue de: %.2fºC.\n", NombreLugar[i], FechaObservacion[Posicion].dia, FechaObservacion[Posicion].mes, FechaObservacion[Posicion].anio, Maximo (max,NumeroFechas,&Posicion));}break; case 1: for(i=0;i<NumeroLugares;i++){ for(j=0;j<NumeroFechas;j++){ max[j]=Observacion[i][j].precipitacion;} printf("La precipitación máxima en %s se registró el día %d/%d/%d y fue de: %.2f mm.\n", NombreLugar[i], FechaObservacion[Posicion].dia, FechaObservacion[Posicion].mes, FechaObservacion[Posicion].anio, Maximo (max,NumeroFechas,&Posicion));}break; case 2: for(i=0;i<NumeroLugares;i++){ for(j=0;j<NumeroFechas;j++){ max[j]=Observacion[i][j].viento;} printf("El viento máximo en %s se registró el día %d/%d/%d y fue de: %.2f km/h.\n", NombreLugar[i], FechaObservacion[Posicion].dia, FechaObservacion[Posicion].mes, FechaObservacion[Posicion].anio, Maximo (max,NumeroFechas,&Posicion));}break; default: printf("La opción seleccionada no existe, por favor seleccione otra."); mostrarMaximo (elegirTipoDato());break;}} float Maximo (float Vector[],int nElementos,int *Posicion){ int i; float maximo; *Posicion=0; maximo=Vector[0]; for(i=1;i<nElementos;i++){ if(maximo<Vector[i]){ maximo=Vector[i]; *Posicion=i;}} return(maximo);} void mostrarMinimo (int TipoDato){ int i,j; int Posicion; float min[NumeroFechas]; switch(TipoDato){ case 0: for(i=0;i<NumeroLugares;i++){ for(j=0;j<NumeroFechas;j++){ min[j]=Observacion[i][j].temperatura;} printf("La temperatura mínima en %s se registró el día %d/%d/%d y fue de: %.2fºC.\n", NombreLugar[i], FechaObservacion[Posicion].dia, FechaObservacion[Posicion].mes, FechaObservacion[Posicion].anio, Minimo (min,NumeroFechas,&Posicion));}break; case 1: for(i=0;i<NumeroLugares;i++){ for(j=0;j<NumeroFechas;j++){ min[j]=Observacion[i][j].precipitacion;} printf("La precipitación máxima en %s se registró el día %d/%d/%d y fue de: %.2f mm.\n", NombreLugar[i], FechaObservacion[Posicion].dia, FechaObservacion[Posicion].mes, FechaObservacion[Posicion].anio, Minimo (min,NumeroFechas,&Posicion));}break; case 2: for(i=0;i<NumeroLugares;i++){ for(j=0;j<NumeroFechas;j++){ min[j]=Observacion[i][j].viento;} printf("El viento mínimo en %s se registró el día %d/%d/%d y fue de: %.2f km/h.\n", NombreLugar[i], FechaObservacion[Posicion].dia, FechaObservacion[Posicion].mes, FechaObservacion[Posicion].anio, Minimo (min,NumeroFechas,&Posicion));}break; default: printf("La opción seleccionada no existe, por favor seleccione otra."); mostrarMinimo (elegirTipoDato());break;}} float Minimo (float Vector[],int nElementos,int *Posicion){ int i; float minimo; *Posicion=0; minimo=Vector[0]; for(i=1;i<nElementos;i++){ if(minimo>Vector[i]){ minimo=Vector[i]; *Posicion=i;}} return(minimo);} int elegirTipoDato (void){ int opcion; printf("\nElija el tipo de dato: "); printf("\n\t0-Temperatura."); printf("\n\t1-Precipitaciones."); printf("\n\t2-Viento."); printf("\nTipo de dato elegido: "); scanf("%d",&opcion); return(opcion);} int main (void){ int opcion,x,i,j; char nombrefichero[50]; opcion=1; x=1; while(x!=0){ printf("\nIntroduzca la ruta o nombre del fichero si se encuentra en este mismo directorio(si no existe se creará): "); scanf("%s",nombrefichero); FILE *fich; fich=fopen(nombrefichero,"r"); if(fich!=NULL){ int feof(FILE *fich); fscanf(fich,"%d\n",&NumeroLugares); for(i=0;i<NumeroLugares;i++){ fscanf(fich," %[^\n]\n",NombreLugar[i]);} while(feof(fich)==0){ fscanf(fich,"%d %d %d\n",&FechaObservacion[NumeroFechas].dia,&FechaObservacion[NumeroFechas].mes,&FechaObservacion[NumeroFechas].anio); for(i=0;i<NumeroLugares;i++){ fscanf(fich,"%f %f %f\n",&Observacion[i][NumeroFechas].temperatura,&Observacion[i][NumeroFechas].precipitacion,&Observacion[i][NumeroFechas].viento);} NumeroFechas++;} fclose(fich); x=0;} else{ printf("\nNo existe el fichero introducido asi que se la estructura de datos se iniciará vacia"); fich=fopen(nombrefichero,"a"); if(fich!=NULL){ fclose(fich); x=0;} else{printf("\nNo tiene permisos para crear o abrir el fichero");}}} printf("El numero de lugares es %d y el numero de fechas es %d\n", NumeroLugares, NumeroFechas); while(opcion!=0){ printf("\nOpciones: "); printf("\n\t0-Salir."); printf("\n\t1-Introducir nuevo lugar."); printf("\n\t2-Introducir nueva fecha."); printf("\n\t3-Mostrar valores medios."); printf("\n\t4-Mostrar valores máximos."); printf("\n\t5-Mostrar valores mínimos."); printf("\nOpción introducida: "); scanf("%d",&opcion); switch(opcion){ case 0:break; case 1:nuevolugar();break; case 2:nuevafecha();break; case 3:mostrarMedia (elegirTipoDato());break; case 4:mostrarMaximo (elegirTipoDato());break; case 5:mostrarMinimo (elegirTipoDato());break; default:printf("La opción seleccionada no existe.");break;}} x=1; while(x!=0){ FILE *fich; fich=fopen(nombrefichero,"w"); if(fich!=NULL){ int feof(FILE *fich); fprintf(fich,"%d\n",NumeroLugares); for(i=0;i<NumeroLugares;i++){ fprintf(fich,"%s\n",NombreLugar[i]);} for(j=0;j<NumeroFechas;j++){ fprintf(fich,"%d %d %d\n",FechaObservacion[j].dia,FechaObservacion[j].mes,FechaObservacion[j].anio); for(i=0;i<NumeroLugares;i++){ fprintf(fich,"%.1f %.1f %.1f\n",Observacion[i][j].temperatura,Observacion[i][j].precipitacion,Observacion[i][j].viento);}} x=0; fclose(fich);} else{ printf("\nNo tiene permisos para crear o modificar el fichero, introduzca una nueva ruta:"); scanf("%s",nombrefichero);}} printf("El fichero se ha sido guardado\n");}
the_stack_data/154831231.c
#define _GNU_SOURCE #include <sys/types.h> #include <sys/fcntl.h> #include <sys/stat.h> #include <errno.h> #include <string.h> #include <signal.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <err.h> char fname[255]; int fd; struct stat64 statter; int main() { sprintf(fname, "tfile_%d", getpid()); fd = open(fname, O_RDWR | O_CREAT, 0700); int result = fstat64(fd, &statter); if( result == -1 ) err(1,"fstat64 failed"); close(fd); unlink(fname); return 0; }
the_stack_data/234517987.c
#include <stdio.h> #include <stdlib.h> #include <string.h> void PrintfArr(int arr[],int len); /** * 将两个有序数组进行归并 */ void Merge(int *arrA,int lenA,int *arrB,int lenB,int *res){ int i=0,j=0; while(i<lenA && j<lenB){ if(arrA[i]<arrB[j]){ res[i+j]=arrA[i]; i++; }else{ res[i+j]=arrB[j]; j++; } } //谁先达到最大长度,谁先结束 if(i==lenA){ for(;j<lenB;j++){ res[i+j]=arrB[j]; } }else{ for(;i<lenA;i++){ res[i+j]=arrA[i]; } } } /** * arr排序数组 * start起始索引,结束索引 */ int *MSort(int arr[],int start,int end){ int size=end-start+1; int *res=(int *)malloc(size*sizeof(int)); memset(res,0,size*sizeof(int)); if(start==end){ res[0]=arr[start]; }else{ int mid=(end+start)/2; int *a=MSort(arr,start,mid); int *b=MSort(arr,mid+1,end); Merge(a,mid-start+1,b,end-mid,res); PrintfArr(res,size); } return res; } void PrintfArr(int arr[],int len){ for(int i=0;i<len;i++){ printf("%4d",arr[i]); } printf("\n"); } int main(){ int arr[9]={50,10,90,30,70,40,80,60,20}; //int arr[4]={50,10,90,30}; int start=0; int end=8; int *result=MSort(arr,start,end); PrintfArr(result,9); return 0; }
the_stack_data/219379.c
#include <stdio.h> int main() { int a, b, c, result; printf ("Введите а: "); scanf ("%d", &a); printf ("Введите b: "); scanf ("%d", &b); printf ("Введите c: "); scanf ("%d", &c); result = (a == b) && (c > b); printf ("(a == b) && (c > b) result is %d\n", result); result = (a == b) && (c < b); printf ("(a == b) && (c < b) result is %d\n", result); result = (a == b) || (c > b); printf ("(a == b) || (c > b) result is %d\n", result); result = (a == b) || (c < b); printf ("(a == b) || (c < b) result is %d\n", result); result = !(a != b); printf ("!(a != b) result is %d\n", result); result = !(a == b); printf ("!(a == b) is %d\n", result); return 0; }
the_stack_data/215769190.c
#include<stdio.h> #include<stdlib.h> #include<math.h> double sumUpTo(double interval, double limit){ double avg, count, sum, lowerLimit; count = limit/interval; count = trunc(count); lowerLimit = count*interval; avg = (interval+lowerLimit)/2; sum = avg*count; if(!(fmod(limit,interval))) sum-=limit; return sum; } void main(int argc, char** argv){ if (argc==3){ double interval = atof(argv[1]); double limit = atof(argv[2]); double sum = sumUpTo(interval,limit); printf("Output: %f\n", sum); } if (argc==4){ double interval1 = atof(argv[1]); double interval2 = atof(argv[2]); double limit2 = atof(argv[3]); double sum1 = sumUpTo(interval1,limit2); double sum2 = sumUpTo(interval2,limit2); double commonSum = sumUpTo(interval1*interval2,limit2); double finalSum = sum1+sum2-commonSum; printf("Output: %f\n", finalSum); } return; }
the_stack_data/139894.c
#include <stdio.h> #include <stdlib.h> typedef struct tree { struct node *root; int count; } tree; typedef struct node { int key; struct node *left; struct node *right; struct node *parent; } node; void init(tree* t) { t->root = NULL; t->count = 0; } int insert(tree* t, int value) { node *nodeNew = (node*) malloc(sizeof(node)); node *node1 = t->root, *node2 = NULL; while (node1 != NULL) { node2 = node1; if (value < node1->key) { node1 = node1->left; } else if (value == node1->key) { return 1; } else { node1 = node1->right; } } nodeNew->key = value; nodeNew->left = NULL; nodeNew->right = NULL; nodeNew->parent = node2; if (t->root == NULL) { t->root = nodeNew; } if (node2 != NULL) { if (value < node2->key) {; node2->left = nodeNew; } else { node2->right = nodeNew; } } t->count++; return 0; } void direct(node* nodeA){ if (nodeA == NULL) { printf("- "); if (nodeA->parent == NULL) { return; } } printf("%d ", nodeA->key); if (nodeA->left != NULL) { direct(nodeA->left); } if (nodeA->right != NULL) { direct(nodeA->right); } } void print_tree(tree* t) { direct(t->root); } int main() { tree t; init(&t); int a, a1, a2, a3, a4, a5, a6; scanf("%d %d %d %d %d %d %d", &a, &a1, &a2, &a3, &a4, &a5, &a6); insert(&t, a); insert(&t, a1); insert(&t, a2); insert(&t, a3); insert(&t, a4); insert(&t, a5); insert(&t, a6); print_tree(&t); printf("\n"); return 0; }
the_stack_data/29826335.c
#include <stdio.h> int main(void) { int l = 9, j = 8, mult = 0, soma = 0, resto = 0, digi; int option; int numNIF[9]; char nifchar[9]; int nif; //menu printf("1- ver nif se e valido. \n"); printf("2- calcular digito de controlo. \n"); printf("escolha uma opcao: "); scanf("%d", &option); //calcular length de array //int length = sizeof numNIF / sizeof numNIF[0]; //option menu switch (option) { //insert nif and display case 1: //convert string to integer printf("insira um numero NIF: "); scanf("%s", &nifchar); nif = atoi(nifchar); //keep the same order than the original number for (int i = 8; i >= 0; i--) { numNIF[i] = nif % 10; nif /= 10; } //display array //for (int i = 0 ; i < 9 ; i++) { // printf("%d", numNIF[i]); //} //calculate nif algorithm while (j > 1 ) { for (int i = 1 ; i < 9 ; i++){ mult = numNIF[i]*j; soma = soma + mult; j--; } } resto = soma % 11; if (numNIF[8] != digi) { printf("nif valido \n"); //control digit if (resto == 0 || resto == 1) { printf("o digito de controlo é 0 \n"); } else { digi= 11 - resto; printf("o digito de controlo é %d \n", digi); } } else { printf("nif nao e valido"); } break; //insert 8 digits of nif and get digit case 2: //convert string to integer printf("insira 8 digitos do numero NIF: "); scanf("%s", &nifchar); nif = atoi(nifchar); //keep the same order than the original number for (int i = 8; i >= 0; i--) { numNIF[i] = nif % 10; nif /= 10; } //calculate nif algorithm while (l > 1 ) { for (int i = 1 ; i < 9 ; i++){ mult = numNIF[i]*l; soma = soma + mult; l--; } } resto = soma % 11; //control digit if (resto == 0 || resto == 1) { printf("o digito de controlo é 0 \n"); } else { digi= 11 - resto; printf("o digito de controlo é %d", digi, "\n"); } break; default: printf("opcao errada!"); } return 0; }
the_stack_data/59767.c
/* * handle_segv.c * * Make a usermode process segfault by accessing invalid user/kernel-space addresses.. * This in turn will have the MMU trigger an exception condition (Data Abort on * ARM), which will lead to the OS's page fault handler being invoked. *It* will * determine the actual fault (minor or major, good or bad) and, in this case, being * a usermode 'bad' fault, will send SIGSEGV to 'current'! * * Author : Kaiwan N Billimoria, kaiwanTECH * License(s): MIT */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/types.h> #include <signal.h> #include <string.h> #include <ctype.h> #include <errno.h> /*---------------- Typedef's, constants, etc ------------------------*/ typedef unsigned int u32; typedef long unsigned int u64; /*---------------- Macros -------------------------------------------*/ #if __x86_64__ /* 64-bit; __x86_64__ works for gcc */ #define ADDR_TYPE u64 #define ADDR_FMT "%016lx" static u64 rubbish_uaddr = 0x500f60L; static u64 rubbish_kaddr = 0xffff0a8700100000L; #else #define ADDR_TYPE u32 #define ADDR_FMT "%08lx" static u32 rubbish_uaddr = 0x500ffeL; static u32 rubbish_kaddr = 0xd0c00000L; #endif /*---------------- Functions ----------------------------------------*/ static void myfault(int signum, siginfo_t * siginfo, void *rest) { static int c = 0; printf("*** %s: [%d] received signal %d. errno=%d\n" " Cause/Origin: (si_code=%d): ", __func__, ++c, signum, siginfo->si_errno, siginfo->si_code); switch (siginfo->si_code) { case SI_USER: printf("user\n"); break; case SI_KERNEL: printf("kernel\n"); break; case SI_QUEUE: printf("queue\n"); break; case SI_TIMER: printf("timer\n"); break; case SI_MESGQ: printf("mesgq\n"); break; case SI_ASYNCIO: printf("async io\n"); break; case SI_SIGIO: printf("sigio\n"); break; case SI_TKILL: printf("t[g]kill\n"); break; // other poss values si_code can have for SIGSEGV case SEGV_MAPERR: printf("SEGV_MAPERR: address not mapped to object\n"); break; case SEGV_ACCERR: printf("SEGV_ACCERR: invalid permissions for mapped object\n"); break; /* SEGV_BNDERR and SEGV_PKUERR result in compile failure ?? * Qs asked on SO here: * https://stackoverflow.com/questions/45229308/attempting-to-make-use-of-segv-bnderr-and-segv-pkuerr-in-a-sigsegv-signal-handle */ #if 0 case SEGV_BNDERR: /* 3.19 onward */ printf("SEGV_BNDERR: failed address bound checks\n"); case SEGV_PKUERR: /* 4.6 onward */ printf ("SEGV_PKUERR: access denied by memory-protection keys\n"); #endif default: printf("-none-\n"); } printf(" Faulting addr=0x" ADDR_FMT "\n", (ADDR_TYPE) siginfo->si_addr); #if 1 exit(1); #else abort(); #endif } /** * setup_altsigstack - Helper function to set alternate stack for sig-handler * @stack_sz: required stack size * * Return: 0 on success, -ve errno on failure */ int setup_altsigstack(size_t stack_sz) { stack_t ss; printf("Alt signal stack size = %zu bytes\n", stack_sz); ss.ss_sp = malloc(stack_sz); if (!ss.ss_sp){ printf("malloc(%zu) for alt sig stack failed\n", stack_sz); return -ENOMEM; } ss.ss_size = stack_sz; ss.ss_flags = 0; if (sigaltstack(&ss, NULL) == -1){ printf("sigaltstack for size %zu failed!\n", stack_sz); return -errno; } printf("Alt signal stack uva (user virt addr) = %p\n", ss.ss_sp); return 0; } static void usage(char *nm) { fprintf(stderr, "Usage: %s u|k r|w\n" "u => user mode\n" "k => kernel mode\n" " r => read attempt\n" " w => write attempt\n", nm); } int main(int argc, char **argv) { struct sigaction act; if (argc != 3) { usage(argv[0]); exit(1); } printf("Regular stack uva eg (user virt addr) = %p\n", &act); /* Use a separate stack for signal handling via the SA_ONSTACK; * This is critical, especially for handling the SIGSEGV; think on it, what * if this process crashes due to stack overflow; then it will receive the * SIGSEGV from the kernel (when it attempts to eat into unmapped memory * following the end of the stack)! The SIGSEGV signal handler must now run * But where? It cannot on the old stack - it's now corrupt! Hence, the * need for an alternate signal stack ! */ if (setup_altsigstack(10*1024*1024) < 0) { fprintf(stderr, "%s: setting up alt sig stack failed\n", argv[0]); exit(1); } memset(&act, 0, sizeof(act)); //act.sa_handler = myfault; act.sa_sigaction = myfault; act.sa_flags = SA_RESTART | SA_SIGINFO | SA_ONSTACK; sigemptyset(&act.sa_mask); if (sigaction(SIGSEGV, &act, 0) == -1) { perror("sigaction"); exit(1); } if ((tolower(argv[1][0]) == 'u') && tolower(argv[2][0] == 'r')) { ADDR_TYPE *uptr = (ADDR_TYPE *) rubbish_uaddr; // arbitrary userspace virtual addr printf ("Attempting to read contents of arbitrary usermode va uptr = 0x" ADDR_FMT ":\n", (ADDR_TYPE) uptr); printf("*uptr = 0x" ADDR_FMT "\n", *uptr); // just reading } else if ((tolower(argv[1][0]) == 'u') && tolower(argv[2][0] == 'w')) { ADDR_TYPE *uptr = (ADDR_TYPE *) & main; printf ("Attempting to write into arbitrary usermode va uptr (&main actually) = 0x" ADDR_FMT ":\n", (ADDR_TYPE) uptr); *uptr = 40; // writing } else if ((tolower(argv[1][0]) == 'k') && tolower(argv[2][0] == 'r')) { ADDR_TYPE *kptr = (ADDR_TYPE *) rubbish_kaddr; // arbitrary kernel virtual addr printf ("Attempting to read contents of arbitrary kernel va kptr = 0x" ADDR_FMT ":\n", (ADDR_TYPE) kptr); printf("*kptr = 0x" ADDR_FMT "\n", *kptr); // just reading } else if ((tolower(argv[1][0]) == 'k') && tolower(argv[2][0] == 'w')) { ADDR_TYPE *kptr = (ADDR_TYPE *) rubbish_kaddr; // arbitrary kernel virtual addr printf ("Attempting to write into arbitrary kernel va kptr = 0x" ADDR_FMT ":\n", (ADDR_TYPE) kptr); *kptr = 0x62; // writing } else usage(argv[0]); exit(0); } /* vi: ts=4 */
the_stack_data/1660.c
#include <stdio.h> int N(int x,int p[],int s,int f); int M(int y,int q[],int d,int g); int H(int m,int n,int w[]); int main(void) { int n,k,i; int max,min; scanf("%d%d",&n,&k); int a[100]; int b[100],c[100]; int h[100]; for(i=0;i<n;i++){ scanf("%d",&a[i]); } for(i=0;i<k;i++){ scanf("%d%d",&b[i],&c[i]); } for(i=0;i<k;i++){ max=(N(n,a,b[i],c[i])>M(n,a,b[i],c[i]))?N(n,a,b[i],c[i]):M(n,a,b[i],c[i]); min=(N(n,a,b[i],c[i])<M(n,a,b[i],c[i]))?N(n,a,b[i],c[i]):M(n,a,b[i],c[i]); h[i]=H(min,max,a); printf("%d\n",h[i]); } return 0; } int N(int x,int p[],int s,int f){ int sum=0,i; for(i=s;i<=f;i++){ sum+=(p[i]%x); } sum%=x; return sum; } int M(int y,int q[],int d,int g){ int sum=1,i; for(i=d;i<=g;i++){ sum*=q[i]; sum%=y; } return sum; } int H(int m,int n,int w[]){ int sum=w[m],i; for(i=m+1;i<=n;i++){ sum=(sum^w[i]); } return sum; }
the_stack_data/125140537.c
#include<stdio.h> // This file is just to show off running a binary; // i.e. a .exe in windows and regular binary in unix/macOS int main(int argc, char* argv[]){ // Prints 'Hello, World!' then exits printf("Hello, World!\n"); return 0; }
the_stack_data/215768218.c
/** * @file tft_fonts.c * @brief TFT Fonts * @author matyunin.d * @date 14.06.2019 */ #include <stdint.h> const uint8_t ch_font_1206[95][12] = { {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*" ",0*/ {0x00,0x00,0x00,0x00,0x3F,0x40,0x00,0x00,0x00,0x00,0x00,0x00},/*"!",1*/ {0x00,0x00,0x30,0x00,0x40,0x00,0x30,0x00,0x40,0x00,0x00,0x00},/*""",2*/ {0x09,0x00,0x0B,0xC0,0x3D,0x00,0x0B,0xC0,0x3D,0x00,0x09,0x00},/*"#",3*/ {0x18,0xC0,0x24,0x40,0x7F,0xE0,0x22,0x40,0x31,0x80,0x00,0x00},/*"$",4*/ {0x18,0x00,0x24,0xC0,0x1B,0x00,0x0D,0x80,0x32,0x40,0x01,0x80},/*"%",5*/ {0x03,0x80,0x1C,0x40,0x27,0x40,0x1C,0x80,0x07,0x40,0x00,0x40},/*"&",6*/ {0x10,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"'",7*/ {0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x80,0x20,0x40,0x40,0x20},/*"(",8*/ {0x00,0x00,0x40,0x20,0x20,0x40,0x1F,0x80,0x00,0x00,0x00,0x00},/*")",9*/ {0x09,0x00,0x06,0x00,0x1F,0x80,0x06,0x00,0x09,0x00,0x00,0x00},/*"*",10*/ {0x04,0x00,0x04,0x00,0x3F,0x80,0x04,0x00,0x04,0x00,0x00,0x00},/*"+",11*/ {0x00,0x10,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*",",12*/ {0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x00,0x00},/*"-",13*/ {0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*".",14*/ {0x00,0x20,0x01,0xC0,0x06,0x00,0x38,0x00,0x40,0x00,0x00,0x00},/*"/",15*/ {0x1F,0x80,0x20,0x40,0x20,0x40,0x20,0x40,0x1F,0x80,0x00,0x00},/*"0",16*/ {0x00,0x00,0x10,0x40,0x3F,0xC0,0x00,0x40,0x00,0x00,0x00,0x00},/*"1",17*/ {0x18,0xC0,0x21,0x40,0x22,0x40,0x24,0x40,0x18,0x40,0x00,0x00},/*"2",18*/ {0x10,0x80,0x20,0x40,0x24,0x40,0x24,0x40,0x1B,0x80,0x00,0x00},/*"3",19*/ {0x02,0x00,0x0D,0x00,0x11,0x00,0x3F,0xC0,0x01,0x40,0x00,0x00},/*"4",20*/ {0x3C,0x80,0x24,0x40,0x24,0x40,0x24,0x40,0x23,0x80,0x00,0x00},/*"5",21*/ {0x1F,0x80,0x24,0x40,0x24,0x40,0x34,0x40,0x03,0x80,0x00,0x00},/*"6",22*/ {0x30,0x00,0x20,0x00,0x27,0xC0,0x38,0x00,0x20,0x00,0x00,0x00},/*"7",23*/ {0x1B,0x80,0x24,0x40,0x24,0x40,0x24,0x40,0x1B,0x80,0x00,0x00},/*"8",24*/ {0x1C,0x00,0x22,0xC0,0x22,0x40,0x22,0x40,0x1F,0x80,0x00,0x00},/*"9",25*/ {0x00,0x00,0x00,0x00,0x08,0x40,0x00,0x00,0x00,0x00,0x00,0x00},/*":",26*/ {0x00,0x00,0x00,0x00,0x04,0x60,0x00,0x00,0x00,0x00,0x00,0x00},/*";",27*/ {0x00,0x00,0x04,0x00,0x0A,0x00,0x11,0x00,0x20,0x80,0x40,0x40},/*"<",28*/ {0x09,0x00,0x09,0x00,0x09,0x00,0x09,0x00,0x09,0x00,0x00,0x00},/*"=",29*/ {0x00,0x00,0x40,0x40,0x20,0x80,0x11,0x00,0x0A,0x00,0x04,0x00},/*">",30*/ {0x18,0x00,0x20,0x00,0x23,0x40,0x24,0x00,0x18,0x00,0x00,0x00},/*"?",31*/ {0x1F,0x80,0x20,0x40,0x27,0x40,0x29,0x40,0x1F,0x40,0x00,0x00},/*"@",32*/ {0x00,0x40,0x07,0xC0,0x39,0x00,0x0F,0x00,0x01,0xC0,0x00,0x40},/*"A",33*/ {0x20,0x40,0x3F,0xC0,0x24,0x40,0x24,0x40,0x1B,0x80,0x00,0x00},/*"B",34*/ {0x1F,0x80,0x20,0x40,0x20,0x40,0x20,0x40,0x30,0x80,0x00,0x00},/*"C",35*/ {0x20,0x40,0x3F,0xC0,0x20,0x40,0x20,0x40,0x1F,0x80,0x00,0x00},/*"D",36*/ {0x20,0x40,0x3F,0xC0,0x24,0x40,0x2E,0x40,0x30,0xC0,0x00,0x00},/*"E",37*/ {0x20,0x40,0x3F,0xC0,0x24,0x40,0x2E,0x00,0x30,0x00,0x00,0x00},/*"F",38*/ {0x0F,0x00,0x10,0x80,0x20,0x40,0x22,0x40,0x33,0x80,0x02,0x00},/*"G",39*/ {0x20,0x40,0x3F,0xC0,0x04,0x00,0x04,0x00,0x3F,0xC0,0x20,0x40},/*"H",40*/ {0x20,0x40,0x20,0x40,0x3F,0xC0,0x20,0x40,0x20,0x40,0x00,0x00},/*"I",41*/ {0x00,0x60,0x20,0x20,0x20,0x20,0x3F,0xC0,0x20,0x00,0x20,0x00},/*"J",42*/ {0x20,0x40,0x3F,0xC0,0x24,0x40,0x0B,0x00,0x30,0xC0,0x20,0x40},/*"K",43*/ {0x20,0x40,0x3F,0xC0,0x20,0x40,0x00,0x40,0x00,0x40,0x00,0xC0},/*"L",44*/ {0x3F,0xC0,0x3C,0x00,0x03,0xC0,0x3C,0x00,0x3F,0xC0,0x00,0x00},/*"M",45*/ {0x20,0x40,0x3F,0xC0,0x0C,0x40,0x23,0x00,0x3F,0xC0,0x20,0x00},/*"N",46*/ {0x1F,0x80,0x20,0x40,0x20,0x40,0x20,0x40,0x1F,0x80,0x00,0x00},/*"O",47*/ {0x20,0x40,0x3F,0xC0,0x24,0x40,0x24,0x00,0x18,0x00,0x00,0x00},/*"P",48*/ {0x1F,0x80,0x21,0x40,0x21,0x40,0x20,0xE0,0x1F,0xA0,0x00,0x00},/*"Q",49*/ {0x20,0x40,0x3F,0xC0,0x24,0x40,0x26,0x00,0x19,0xC0,0x00,0x40},/*"R",50*/ {0x18,0xC0,0x24,0x40,0x24,0x40,0x22,0x40,0x31,0x80,0x00,0x00},/*"S",51*/ {0x30,0x00,0x20,0x40,0x3F,0xC0,0x20,0x40,0x30,0x00,0x00,0x00},/*"T",52*/ {0x20,0x00,0x3F,0x80,0x00,0x40,0x00,0x40,0x3F,0x80,0x20,0x00},/*"U",53*/ {0x20,0x00,0x3E,0x00,0x01,0xC0,0x07,0x00,0x38,0x00,0x20,0x00},/*"V",54*/ {0x38,0x00,0x07,0xC0,0x3C,0x00,0x07,0xC0,0x38,0x00,0x00,0x00},/*"W",55*/ {0x20,0x40,0x39,0xC0,0x06,0x00,0x39,0xC0,0x20,0x40,0x00,0x00},/*"X",56*/ {0x20,0x00,0x38,0x40,0x07,0xC0,0x38,0x40,0x20,0x00,0x00,0x00},/*"Y",57*/ {0x30,0x40,0x21,0xC0,0x26,0x40,0x38,0x40,0x20,0xC0,0x00,0x00},/*"Z",58*/ {0x00,0x00,0x00,0x00,0x7F,0xE0,0x40,0x20,0x40,0x20,0x00,0x00},/*"[",59*/ {0x00,0x00,0x70,0x00,0x0C,0x00,0x03,0x80,0x00,0x40,0x00,0x00},/*"\",60*/ {0x00,0x00,0x40,0x20,0x40,0x20,0x7F,0xE0,0x00,0x00,0x00,0x00},/*"]",61*/ {0x00,0x00,0x20,0x00,0x40,0x00,0x20,0x00,0x00,0x00,0x00,0x00},/*"^",62*/ {0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10},/*"_",63*/ {0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"`",64*/ {0x00,0x00,0x02,0x80,0x05,0x40,0x05,0x40,0x03,0xC0,0x00,0x40},/*"a",65*/ {0x20,0x00,0x3F,0xC0,0x04,0x40,0x04,0x40,0x03,0x80,0x00,0x00},/*"b",66*/ {0x00,0x00,0x03,0x80,0x04,0x40,0x04,0x40,0x06,0x40,0x00,0x00},/*"c",67*/ {0x00,0x00,0x03,0x80,0x04,0x40,0x24,0x40,0x3F,0xC0,0x00,0x40},/*"d",68*/ {0x00,0x00,0x03,0x80,0x05,0x40,0x05,0x40,0x03,0x40,0x00,0x00},/*"e",69*/ {0x00,0x00,0x04,0x40,0x1F,0xC0,0x24,0x40,0x24,0x40,0x20,0x00},/*"f",70*/ {0x00,0x00,0x02,0xE0,0x05,0x50,0x05,0x50,0x06,0x50,0x04,0x20},/*"g",71*/ {0x20,0x40,0x3F,0xC0,0x04,0x40,0x04,0x00,0x03,0xC0,0x00,0x40},/*"h",72*/ {0x00,0x00,0x04,0x40,0x27,0xC0,0x00,0x40,0x00,0x00,0x00,0x00},/*"i",73*/ {0x00,0x10,0x00,0x10,0x04,0x10,0x27,0xE0,0x00,0x00,0x00,0x00},/*"j",74*/ {0x20,0x40,0x3F,0xC0,0x01,0x40,0x07,0x00,0x04,0xC0,0x04,0x40},/*"k",75*/ {0x20,0x40,0x20,0x40,0x3F,0xC0,0x00,0x40,0x00,0x40,0x00,0x00},/*"l",76*/ {0x07,0xC0,0x04,0x00,0x07,0xC0,0x04,0x00,0x03,0xC0,0x00,0x00},/*"m",77*/ {0x04,0x40,0x07,0xC0,0x04,0x40,0x04,0x00,0x03,0xC0,0x00,0x40},/*"n",78*/ {0x00,0x00,0x03,0x80,0x04,0x40,0x04,0x40,0x03,0x80,0x00,0x00},/*"o",79*/ {0x04,0x10,0x07,0xF0,0x04,0x50,0x04,0x40,0x03,0x80,0x00,0x00},/*"p",80*/ {0x00,0x00,0x03,0x80,0x04,0x40,0x04,0x50,0x07,0xF0,0x00,0x10},/*"q",81*/ {0x04,0x40,0x07,0xC0,0x02,0x40,0x04,0x00,0x04,0x00,0x00,0x00},/*"r",82*/ {0x00,0x00,0x06,0x40,0x05,0x40,0x05,0x40,0x04,0xC0,0x00,0x00},/*"s",83*/ {0x00,0x00,0x04,0x00,0x1F,0x80,0x04,0x40,0x00,0x40,0x00,0x00},/*"t",84*/ {0x04,0x00,0x07,0x80,0x00,0x40,0x04,0x40,0x07,0xC0,0x00,0x40},/*"u",85*/ {0x04,0x00,0x07,0x00,0x04,0xC0,0x01,0x80,0x06,0x00,0x04,0x00},/*"v",86*/ {0x06,0x00,0x01,0xC0,0x07,0x00,0x01,0xC0,0x06,0x00,0x00,0x00},/*"w",87*/ {0x04,0x40,0x06,0xC0,0x01,0x00,0x06,0xC0,0x04,0x40,0x00,0x00},/*"x",88*/ {0x04,0x10,0x07,0x10,0x04,0xE0,0x01,0x80,0x06,0x00,0x04,0x00},/*"y",89*/ {0x00,0x00,0x04,0x40,0x05,0xC0,0x06,0x40,0x04,0x40,0x00,0x00},/*"z",90*/ {0x00,0x00,0x00,0x00,0x04,0x00,0x7B,0xE0,0x40,0x20,0x00,0x00},/*"{",91*/ {0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xF0,0x00,0x00,0x00,0x00},/*"|",92*/ {0x00,0x00,0x40,0x20,0x7B,0xE0,0x04,0x00,0x00,0x00,0x00,0x00},/*"}",93*/ {0x40,0x00,0x80,0x00,0x40,0x00,0x20,0x00,0x20,0x00,0x40,0x00},/*"~",94*/ }; const uint8_t ch_font_1608[95][16] = { {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*" ",0*/ {0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xCC,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00},/*"!",1*/ {0x00,0x00,0x08,0x00,0x30,0x00,0x60,0x00,0x08,0x00,0x30,0x00,0x60,0x00,0x00,0x00},/*""",2*/ {0x02,0x20,0x03,0xFC,0x1E,0x20,0x02,0x20,0x03,0xFC,0x1E,0x20,0x02,0x20,0x00,0x00},/*"#",3*/ {0x00,0x00,0x0E,0x18,0x11,0x04,0x3F,0xFF,0x10,0x84,0x0C,0x78,0x00,0x00,0x00,0x00},/*"$",4*/ {0x0F,0x00,0x10,0x84,0x0F,0x38,0x00,0xC0,0x07,0x78,0x18,0x84,0x00,0x78,0x00,0x00},/*"%",5*/ {0x00,0x78,0x0F,0x84,0x10,0xC4,0x11,0x24,0x0E,0x98,0x00,0xE4,0x00,0x84,0x00,0x08},/*"&",6*/ {0x08,0x00,0x68,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"'",7*/ {0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xE0,0x18,0x18,0x20,0x04,0x40,0x02,0x00,0x00},/*"(",8*/ {0x00,0x00,0x40,0x02,0x20,0x04,0x18,0x18,0x07,0xE0,0x00,0x00,0x00,0x00,0x00,0x00},/*")",9*/ {0x02,0x40,0x02,0x40,0x01,0x80,0x0F,0xF0,0x01,0x80,0x02,0x40,0x02,0x40,0x00,0x00},/*"*",10*/ {0x00,0x80,0x00,0x80,0x00,0x80,0x0F,0xF8,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x00},/*"+",11*/ {0x00,0x01,0x00,0x0D,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*",",12*/ {0x00,0x00,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80},/*"-",13*/ {0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*".",14*/ {0x00,0x00,0x00,0x06,0x00,0x18,0x00,0x60,0x01,0x80,0x06,0x00,0x18,0x00,0x20,0x00},/*"/",15*/ {0x00,0x00,0x07,0xF0,0x08,0x08,0x10,0x04,0x10,0x04,0x08,0x08,0x07,0xF0,0x00,0x00},/*"0",16*/ {0x00,0x00,0x08,0x04,0x08,0x04,0x1F,0xFC,0x00,0x04,0x00,0x04,0x00,0x00,0x00,0x00},/*"1",17*/ {0x00,0x00,0x0E,0x0C,0x10,0x14,0x10,0x24,0x10,0x44,0x11,0x84,0x0E,0x0C,0x00,0x00},/*"2",18*/ {0x00,0x00,0x0C,0x18,0x10,0x04,0x11,0x04,0x11,0x04,0x12,0x88,0x0C,0x70,0x00,0x00},/*"3",19*/ {0x00,0x00,0x00,0xE0,0x03,0x20,0x04,0x24,0x08,0x24,0x1F,0xFC,0x00,0x24,0x00,0x00},/*"4",20*/ {0x00,0x00,0x1F,0x98,0x10,0x84,0x11,0x04,0x11,0x04,0x10,0x88,0x10,0x70,0x00,0x00},/*"5",21*/ {0x00,0x00,0x07,0xF0,0x08,0x88,0x11,0x04,0x11,0x04,0x18,0x88,0x00,0x70,0x00,0x00},/*"6",22*/ {0x00,0x00,0x1C,0x00,0x10,0x00,0x10,0xFC,0x13,0x00,0x1C,0x00,0x10,0x00,0x00,0x00},/*"7",23*/ {0x00,0x00,0x0E,0x38,0x11,0x44,0x10,0x84,0x10,0x84,0x11,0x44,0x0E,0x38,0x00,0x00},/*"8",24*/ {0x00,0x00,0x07,0x00,0x08,0x8C,0x10,0x44,0x10,0x44,0x08,0x88,0x07,0xF0,0x00,0x00},/*"9",25*/ {0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x0C,0x03,0x0C,0x00,0x00,0x00,0x00,0x00,0x00},/*":",26*/ {0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*";",27*/ {0x00,0x00,0x00,0x80,0x01,0x40,0x02,0x20,0x04,0x10,0x08,0x08,0x10,0x04,0x00,0x00},/*"<",28*/ {0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,0x02,0x20,0x00,0x00},/*"=",29*/ {0x00,0x00,0x10,0x04,0x08,0x08,0x04,0x10,0x02,0x20,0x01,0x40,0x00,0x80,0x00,0x00},/*">",30*/ {0x00,0x00,0x0E,0x00,0x12,0x00,0x10,0x0C,0x10,0x6C,0x10,0x80,0x0F,0x00,0x00,0x00},/*"?",31*/ {0x03,0xE0,0x0C,0x18,0x13,0xE4,0x14,0x24,0x17,0xC4,0x08,0x28,0x07,0xD0,0x00,0x00},/*"@",32*/ {0x00,0x04,0x00,0x3C,0x03,0xC4,0x1C,0x40,0x07,0x40,0x00,0xE4,0x00,0x1C,0x00,0x04},/*"A",33*/ {0x10,0x04,0x1F,0xFC,0x11,0x04,0x11,0x04,0x11,0x04,0x0E,0x88,0x00,0x70,0x00,0x00},/*"B",34*/ {0x03,0xE0,0x0C,0x18,0x10,0x04,0x10,0x04,0x10,0x04,0x10,0x08,0x1C,0x10,0x00,0x00},/*"C",35*/ {0x10,0x04,0x1F,0xFC,0x10,0x04,0x10,0x04,0x10,0x04,0x08,0x08,0x07,0xF0,0x00,0x00},/*"D",36*/ {0x10,0x04,0x1F,0xFC,0x11,0x04,0x11,0x04,0x17,0xC4,0x10,0x04,0x08,0x18,0x00,0x00},/*"E",37*/ {0x10,0x04,0x1F,0xFC,0x11,0x04,0x11,0x00,0x17,0xC0,0x10,0x00,0x08,0x00,0x00,0x00},/*"F",38*/ {0x03,0xE0,0x0C,0x18,0x10,0x04,0x10,0x04,0x10,0x44,0x1C,0x78,0x00,0x40,0x00,0x00},/*"G",39*/ {0x10,0x04,0x1F,0xFC,0x10,0x84,0x00,0x80,0x00,0x80,0x10,0x84,0x1F,0xFC,0x10,0x04},/*"H",40*/ {0x00,0x00,0x10,0x04,0x10,0x04,0x1F,0xFC,0x10,0x04,0x10,0x04,0x00,0x00,0x00,0x00},/*"I",41*/ {0x00,0x03,0x00,0x01,0x10,0x01,0x10,0x01,0x1F,0xFE,0x10,0x00,0x10,0x00,0x00,0x00},/*"J",42*/ {0x10,0x04,0x1F,0xFC,0x11,0x04,0x03,0x80,0x14,0x64,0x18,0x1C,0x10,0x04,0x00,0x00},/*"K",43*/ {0x10,0x04,0x1F,0xFC,0x10,0x04,0x00,0x04,0x00,0x04,0x00,0x04,0x00,0x0C,0x00,0x00},/*"L",44*/ {0x10,0x04,0x1F,0xFC,0x1F,0x00,0x00,0xFC,0x1F,0x00,0x1F,0xFC,0x10,0x04,0x00,0x00},/*"M",45*/ {0x10,0x04,0x1F,0xFC,0x0C,0x04,0x03,0x00,0x00,0xE0,0x10,0x18,0x1F,0xFC,0x10,0x00},/*"N",46*/ {0x07,0xF0,0x08,0x08,0x10,0x04,0x10,0x04,0x10,0x04,0x08,0x08,0x07,0xF0,0x00,0x00},/*"O",47*/ {0x10,0x04,0x1F,0xFC,0x10,0x84,0x10,0x80,0x10,0x80,0x10,0x80,0x0F,0x00,0x00,0x00},/*"P",48*/ {0x07,0xF0,0x08,0x18,0x10,0x24,0x10,0x24,0x10,0x1C,0x08,0x0A,0x07,0xF2,0x00,0x00},/*"Q",49*/ {0x10,0x04,0x1F,0xFC,0x11,0x04,0x11,0x00,0x11,0xC0,0x11,0x30,0x0E,0x0C,0x00,0x04},/*"R",50*/ {0x00,0x00,0x0E,0x1C,0x11,0x04,0x10,0x84,0x10,0x84,0x10,0x44,0x1C,0x38,0x00,0x00},/*"S",51*/ {0x18,0x00,0x10,0x00,0x10,0x04,0x1F,0xFC,0x10,0x04,0x10,0x00,0x18,0x00,0x00,0x00},/*"T",52*/ {0x10,0x00,0x1F,0xF8,0x10,0x04,0x00,0x04,0x00,0x04,0x10,0x04,0x1F,0xF8,0x10,0x00},/*"U",53*/ {0x10,0x00,0x1E,0x00,0x11,0xE0,0x00,0x1C,0x00,0x70,0x13,0x80,0x1C,0x00,0x10,0x00},/*"V",54*/ {0x1F,0xC0,0x10,0x3C,0x00,0xE0,0x1F,0x00,0x00,0xE0,0x10,0x3C,0x1F,0xC0,0x00,0x00},/*"W",55*/ {0x10,0x04,0x18,0x0C,0x16,0x34,0x01,0xC0,0x01,0xC0,0x16,0x34,0x18,0x0C,0x10,0x04},/*"X",56*/ {0x10,0x00,0x1C,0x00,0x13,0x04,0x00,0xFC,0x13,0x04,0x1C,0x00,0x10,0x00,0x00,0x00},/*"Y",57*/ {0x08,0x04,0x10,0x1C,0x10,0x64,0x10,0x84,0x13,0x04,0x1C,0x04,0x10,0x18,0x00,0x00},/*"Z",58*/ {0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFE,0x40,0x02,0x40,0x02,0x40,0x02,0x00,0x00},/*"[",59*/ {0x00,0x00,0x30,0x00,0x0C,0x00,0x03,0x80,0x00,0x60,0x00,0x1C,0x00,0x03,0x00,0x00},/*"\",60*/ {0x00,0x00,0x40,0x02,0x40,0x02,0x40,0x02,0x7F,0xFE,0x00,0x00,0x00,0x00,0x00,0x00},/*"]",61*/ {0x00,0x00,0x00,0x00,0x20,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x20,0x00,0x00,0x00},/*"^",62*/ {0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01},/*"_",63*/ {0x00,0x00,0x40,0x00,0x40,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"`",64*/ {0x00,0x00,0x00,0x98,0x01,0x24,0x01,0x44,0x01,0x44,0x01,0x44,0x00,0xFC,0x00,0x04},/*"a",65*/ {0x10,0x00,0x1F,0xFC,0x00,0x88,0x01,0x04,0x01,0x04,0x00,0x88,0x00,0x70,0x00,0x00},/*"b",66*/ {0x00,0x00,0x00,0x70,0x00,0x88,0x01,0x04,0x01,0x04,0x01,0x04,0x00,0x88,0x00,0x00},/*"c",67*/ {0x00,0x00,0x00,0x70,0x00,0x88,0x01,0x04,0x01,0x04,0x11,0x08,0x1F,0xFC,0x00,0x04},/*"d",68*/ {0x00,0x00,0x00,0xF8,0x01,0x44,0x01,0x44,0x01,0x44,0x01,0x44,0x00,0xC8,0x00,0x00},/*"e",69*/ {0x00,0x00,0x01,0x04,0x01,0x04,0x0F,0xFC,0x11,0x04,0x11,0x04,0x11,0x00,0x18,0x00},/*"f",70*/ {0x00,0x00,0x00,0xD6,0x01,0x29,0x01,0x29,0x01,0x29,0x01,0xC9,0x01,0x06,0x00,0x00},/*"g",71*/ {0x10,0x04,0x1F,0xFC,0x00,0x84,0x01,0x00,0x01,0x00,0x01,0x04,0x00,0xFC,0x00,0x04},/*"h",72*/ {0x00,0x00,0x01,0x04,0x19,0x04,0x19,0xFC,0x00,0x04,0x00,0x04,0x00,0x00,0x00,0x00},/*"i",73*/ {0x00,0x00,0x00,0x03,0x00,0x01,0x01,0x01,0x19,0x01,0x19,0xFE,0x00,0x00,0x00,0x00},/*"j",74*/ {0x10,0x04,0x1F,0xFC,0x00,0x24,0x00,0x40,0x01,0xB4,0x01,0x0C,0x01,0x04,0x00,0x00},/*"k",75*/ {0x00,0x00,0x10,0x04,0x10,0x04,0x1F,0xFC,0x00,0x04,0x00,0x04,0x00,0x00,0x00,0x00},/*"l",76*/ {0x01,0x04,0x01,0xFC,0x01,0x04,0x01,0x00,0x01,0xFC,0x01,0x04,0x01,0x00,0x00,0xFC},/*"m",77*/ {0x01,0x04,0x01,0xFC,0x00,0x84,0x01,0x00,0x01,0x00,0x01,0x04,0x00,0xFC,0x00,0x04},/*"n",78*/ {0x00,0x00,0x00,0xF8,0x01,0x04,0x01,0x04,0x01,0x04,0x01,0x04,0x00,0xF8,0x00,0x00},/*"o",79*/ {0x01,0x01,0x01,0xFF,0x00,0x85,0x01,0x04,0x01,0x04,0x00,0x88,0x00,0x70,0x00,0x00},/*"p",80*/ {0x00,0x00,0x00,0x70,0x00,0x88,0x01,0x04,0x01,0x04,0x01,0x05,0x01,0xFF,0x00,0x01},/*"q",81*/ {0x01,0x04,0x01,0x04,0x01,0xFC,0x00,0x84,0x01,0x04,0x01,0x00,0x01,0x80,0x00,0x00},/*"r",82*/ {0x00,0x00,0x00,0xCC,0x01,0x24,0x01,0x24,0x01,0x24,0x01,0x24,0x01,0x98,0x00,0x00},/*"s",83*/ {0x00,0x00,0x01,0x00,0x01,0x00,0x07,0xF8,0x01,0x04,0x01,0x04,0x00,0x00,0x00,0x00},/*"t",84*/ {0x01,0x00,0x01,0xF8,0x00,0x04,0x00,0x04,0x00,0x04,0x01,0x08,0x01,0xFC,0x00,0x04},/*"u",85*/ {0x01,0x00,0x01,0x80,0x01,0x70,0x00,0x0C,0x00,0x10,0x01,0x60,0x01,0x80,0x01,0x00},/*"v",86*/ {0x01,0xF0,0x01,0x0C,0x00,0x30,0x01,0xC0,0x00,0x30,0x01,0x0C,0x01,0xF0,0x01,0x00},/*"w",87*/ {0x00,0x00,0x01,0x04,0x01,0x8C,0x00,0x74,0x01,0x70,0x01,0x8C,0x01,0x04,0x00,0x00},/*"x",88*/ {0x01,0x01,0x01,0x81,0x01,0x71,0x00,0x0E,0x00,0x18,0x01,0x60,0x01,0x80,0x01,0x00},/*"y",89*/ {0x00,0x00,0x01,0x84,0x01,0x0C,0x01,0x34,0x01,0x44,0x01,0x84,0x01,0x0C,0x00,0x00},/*"z",90*/ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x3E,0xFC,0x40,0x02,0x40,0x02},/*"{",91*/ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00},/*"|",92*/ {0x00,0x00,0x40,0x02,0x40,0x02,0x3E,0xFC,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/*"}",93*/ {0x00,0x00,0x60,0x00,0x80,0x00,0x80,0x00,0x40,0x00,0x40,0x00,0x20,0x00,0x20,0x00},/*"~",94*/ };
the_stack_data/494493.c
/* APPLE LOCAL file 6515001 */ /* { dg-do compile { target i?86-*-* x86_64-*-* } } */ /* { scan-assembler-not "cmove" } */ typedef struct __NSSymbol* NSSymbol; static struct { unsigned pad[2]; unsigned n_value; NSSymbol realSymbol; } sLastLookup; void foo(void *); void* NSAddressOfSymbol(NSSymbol symbol) { if ( (void*)symbol == (void*)(&sLastLookup) ) symbol = sLastLookup.realSymbol; foo(symbol); return symbol; }
the_stack_data/192330624.c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_putendl.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: cpieri <[email protected]> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/11/08 16:40:21 by cpieri #+# #+# */ /* Updated: 2017/11/15 16:13:56 by cpieri ### ########.fr */ /* */ /* ************************************************************************** */ #include <unistd.h> void ft_putendl(char const *s) { int i; if (!s) return ; i = 0; while (s[i]) i++; write(1, s, i); write(1, "\n", 1); }
the_stack_data/453693.c
typedef int size_t; extern struct _iobuf { int _cnt; unsigned char *_ptr; unsigned char *_base; int _bufsiz; short _flag; char _file; } _iob[]; typedef struct _iobuf FILE; extern struct _iobuf *fopen(const char *, const char *); extern struct _iobuf *fdopen(int, const char *); extern struct _iobuf *freopen(const char *, const char *, FILE *); extern struct _iobuf *popen(const char *, const char *); extern struct _iobuf *tmpfile(void); extern long ftell(FILE *); extern char *fgets(char *, int, FILE *); extern char *gets(char *); extern char *sprintf(char *, const char *, ...); extern char *ctermid(char *); extern char *cuserid(char *); extern char *tempnam(const char *, const char *); extern char *tmpnam(char *); extern char _ctype_[]; extern struct _iobuf *popen(const char *, const char *), *tmpfile(void); extern int pclose(FILE *); extern void rewind(FILE *); extern void abort(void), free(void *), exit(int), perror(const char *); extern char *getenv(const char *), *malloc(size_t), *realloc(void *, size_t); extern int system(const char *); extern double atof(const char *); extern char *strcpy(char *, const char *), *strncpy(char *, const char *, size_t), *strcat(char *, const char *), *strncat(char *, const char *, size_t), *strerror(int); extern char *strpbrk(const char *, const char *), *strtok(char *, const char *), *strchr(const char *, int), *strrchr(const char *, int), *strstr(const char *, const char *); extern int strcoll(const char *, const char *), strxfrm(char *, const char *, size_t), strncmp(const char *, const char *, size_t), strlen(const char *), strspn(const char *, const char *), strcspn(const char *, const char *); extern char *memmove(void *, const void *, size_t), *memccpy(void *, const void *, int, size_t), *memchr(const void *, int, size_t), *memcpy(void *, const void *, size_t), *memset(void *, int, size_t); extern int memcmp(const void *, const void *, size_t), strcmp(const char *, const char *); extern long util_cpu_time(); extern int util_getopt(); extern void util_getopt_reset(); extern char *util_path_search(); extern char *util_file_search(); extern int util_pipefork(); extern void util_print_cpu_stats(); extern char *util_print_time(long int t); extern int util_save_image(); extern char *util_strsav(); extern char *util_tilde_expand(); extern void util_restart(); extern int util_optind; extern char *util_optarg; char * util_print_time(long int t) { static char s[40]; (void) sprintf(s, "**** sec"); return s; }
the_stack_data/89201430.c
extern int printf(const char *, ...); static char *randomletters = "agqwewbxklpfgytuorz"; int main(void) { int i; for (i = 0; i < 20; i++) { int key; key = randomletters[i]; printf("Inserting %d\n", key); } return 0; }
the_stack_data/34512546.c
/* Test __atomic routines for existence and proper execution on 8 byte values with each valid memory model. */ /* { dg-do run } */ /* { dg-options "" } */ /* Test the execution of __atomic_compare_exchange_n builtin for a long_long. */ extern void abort(void); long long v = 0; long long expected = 0; long long max = ~0; long long desired = ~0; long long zero = 0; #define STRONG 0 #define WEAK 1 int main () { if (!__atomic_compare_exchange_n (&v, &expected, max, STRONG , __ATOMIC_RELAXED, __ATOMIC_RELAXED)) abort (); if (expected != 0) abort (); if (__atomic_compare_exchange_n (&v, &expected, 0, STRONG , __ATOMIC_ACQUIRE, __ATOMIC_RELAXED)) abort (); if (expected != max) abort (); if (!__atomic_compare_exchange_n (&v, &expected, 0, STRONG , __ATOMIC_RELEASE, __ATOMIC_ACQUIRE)) abort (); if (expected != max) abort (); if (v != 0) abort (); if (__atomic_compare_exchange_n (&v, &expected, desired, WEAK, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE)) abort (); if (expected != 0) abort (); if (!__atomic_compare_exchange_n (&v, &expected, desired, STRONG , __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)) abort (); if (expected != 0) abort (); if (v != max) abort (); /* Now test the generic version. */ v = 0; if (!__atomic_compare_exchange (&v, &expected, &max, STRONG, __ATOMIC_RELAXED, __ATOMIC_RELAXED)) abort (); if (expected != 0) abort (); if (__atomic_compare_exchange (&v, &expected, &zero, STRONG , __ATOMIC_ACQUIRE, __ATOMIC_RELAXED)) abort (); if (expected != max) abort (); if (!__atomic_compare_exchange (&v, &expected, &zero, STRONG , __ATOMIC_RELEASE, __ATOMIC_ACQUIRE)) abort (); if (expected != max) abort (); if (v != 0) abort (); if (__atomic_compare_exchange (&v, &expected, &desired, WEAK, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE)) abort (); if (expected != 0) abort (); if (!__atomic_compare_exchange (&v, &expected, &desired, STRONG , __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)) abort (); if (expected != 0) abort (); if (v != max) abort (); return 0; }
the_stack_data/147014219.c
#include<stdio.h> #include<math.h> int main(){ printf("%.8f\n",1+2*sqrt(3)/(5-0.1)); return 0; }
the_stack_data/37638328.c
#include <stdio.h> #define N 10 int SetParityArray(unsigned short int* niz, int n); void printbin16(unsigned short int x) { unsigned short int m=0x8000, s=0; while(m) { printf("%s%s",m&x ? "1" : "0",++s%8 ? "" : " "); m >>= 1; } } int main() { unsigned short int niz[N] = {1,2,3,4,0x8765,0x74af,55,0,0xffff,12345}; int x,i; printf("Ulaz:\n"); for(i=0;i<N;i++) { printf("%2d:",i); printbin16(niz[i]); printf("\n"); } x = SetParityArray(niz,N); printf("Izlaz (broj postavljenih jedinica:%d):\n",x); for(i=0;i<N;i++) { printf("%2d:",i); printbin16(niz[i]); printf("\n"); } }
the_stack_data/125648.c
#include <term.h> #define exit_leftword_mode tigetstr("rlim") /** enable rightward (normal) carriage motion **/ /* TERMINFO_NAME(rlim) TERMCAP_NAME(ZS) XOPEN(400) */
the_stack_data/162643648.c
/* Generated by Lang-0x42A */ /* Warning! Your code is not optimized and runs in virtual machine mode. */ #include <stdio.h> #include <string.h> #include <stdlib.h> #define ARRAY_MAX 64000 int column, parsed; int arr[ARRAY_MAX]; int arr2[ARRAY_MAX]; int run; char *source_code; void VM(const char programm[]){ memset(arr, 0, sizeof(arr)); while (run){ int i = parsed; if (programm[i] != 0){ switch (programm[i]) { case '>': { column++; if (column > ARRAY_MAX){ column = 0; } break; } case '<': { column--; if (column < 0){ column = ARRAY_MAX; } break; } case '+': { arr[column]++; if (arr[column] > 1024){ arr[column] = 0; } break; } case '-': { arr[column]++; if (arr[column] < 0){ arr[column] = 1024; } break; } case '.': { putchar(arr[column]); break; } case ',': { arr[column] = getchar(); break; } case 'C': { memset(arr, 0, sizeof(arr)); break; } case '~': { break; } case 'S': { memcpy(arr2, arr, sizeof(arr)); break; } case 'L': { memcpy(arr, arr2, sizeof(arr)); break; } case 'Q': { puts(source_code); break; } case 'D': { break; } case 'E': { exit(0); break; } case 'J': { break; } case '$': { break; } case 'e': { VM(arr[column]); break; } case 'r': { break; } case '0': { arr[column] = 0; break; } case '1': { arr[column] = 1; break; } case '2': { arr[column] = 2; break; } case '3': { arr[column] = 3; break; } case '4': { arr[column] = 4; break; } case '5': { arr[column] = 5; break; } case '6': { arr[column] = 6; break; } case '7': { arr[column] = 7; break; } case '8': { arr[column] = 8; break; } case '9': { arr[column] = 9; break; } } } } } /* Имеет 64000 ячеек памяти Инструкции языка Ъ: + - Увеличить значение в ячейке; - - Уменьшить значение в ячейке; > - Перейти на следующую ячейку; < - Перейти на предыдущую ячейку; [ - (цикл) если значение текущей ячейки ноль, перейти вперёд по тексту программы на ячейку следующую за соответствующей ] (с учётом вложенности); ] - Конец цикла; . - Вывод текущей ячейки; , - Ввод одного символа; ~ - Отладочный символ; S - Сохранить состояние памяти; L - Загрузить память; Q - Вывести исходный код программы; D - Debug режим; E - Выход из программы; C - Очистить память; $ - Метка, программа перейдет на неё при команде J, Если метки нет, программа аварийно завершится; J - Переход на следующую метку; e - Выполнить команду соответствующую символу в текущей ячейке r - Записать в ячейку случайное число; 0 - Очищает значение в ячейке; Число от 1 до 9 - Прибавляет число к текущему значениею в ячейке; */ int main(){ run = 1; VM("D++++++++++[~>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.CE"); return 0; }
the_stack_data/90762356.c
#include <stdio.h> void exgcd(long long a, long long b, long long *x, long long *y); long long n, p; int main(void) { long long x, y, i; scanf("%lld%lld", &n, &p); for (i = 1; i <= n; ++i) { exgcd(i, p, &x, &y); x = (x % p + p) % p; printf("%lld\n", x); } return 0; } void exgcd(long long a, long long b, long long *x, long long *y) { if (!b) { *x = 1; *y = 0; } else { exgcd(b, a % b, y, x); *y -= (a / b) * *x; } }
the_stack_data/73574768.c
/*Typedef pointer to function*/ #include <stdio.h> int answer (void) { return 42 ; } int main (void) { int answer () ; //Funk deck typedef int (*FunctionPtr) (void) ; //Typedef pointer FunctionPtr h2g2, adams ; //Typedef FunctionPtr variables h2g2 = answer ; //Assigning pointer to fn variable to answer () adams = answer ; printf("Answer = %i\n", h2g2() ) ; printf("Answer = %i\n", adams() ) ; return 0 ; }
the_stack_data/145451765.c
#include <stdio.h> int main(void) { char ch; do { printf("Enter a char or q to quit: "); scanf(" %c", &ch); switch (ch) { case '\n': printf("Newline\n"); break; case '\t': printf("tab\n"); break; case '\b': printf("backspaces\n"); break; } } while (ch != 'q'); return 0; }
the_stack_data/231394096.c
#include<stdio.h> #include<string.h> #include<sys/socket.h> #include<arpa/inet.h> #include<unistd.h> short SocketCreate(void) { short hSocket; printf("Create the socket\n"); hSocket = socket(AF_INET, SOCK_STREAM, 0); return hSocket; } int BindCreatedSocket(int hSocket) { int iRetval=-1; int ClientPort = 90190; struct sockaddr_in remote= {0}; /* Internet address family */ remote.sin_family = AF_INET; /* Any incoming interface */ remote.sin_addr.s_addr = htonl(INADDR_ANY); remote.sin_port = htons(ClientPort); /* Local port */ iRetval = bind(hSocket,(struct sockaddr *)&remote,sizeof(remote)); return iRetval; } int main(int argc, char *argv[]) { int socket_desc, sock, clientLen, read_size; struct sockaddr_in server, client; char client_message[200]= {0}; char message[100] = {0}; const char *pMessage = "hello aticleworld.com"; //Create socket socket_desc = SocketCreate(); if (socket_desc == -1) { printf("Could not create socket"); return 1; } printf("Socket created\n"); //Bind if( BindCreatedSocket(socket_desc) < 0) { //print the error message perror("bind failed."); return 1; } printf("bind done\n"); //Listen listen(socket_desc, 3); //Accept and incoming connection while(1) { printf("Waiting for incoming connections...\n"); clientLen = sizeof(struct sockaddr_in); //accept connection from an incoming client sock = accept(socket_desc,(struct sockaddr *)&client,(socklen_t*)&clientLen); if (sock < 0) { perror("accept failed"); return 1; } printf("Connection accepted\n"); memset(client_message, '\0', sizeof client_message); memset(message, '\0', sizeof message); //Receive a reply from the client if( recv(sock, client_message, 200, 0) < 0) { printf("recv failed"); break; } printf("Client reply : %s\n",client_message); if(strcmp(pMessage,client_message)==0) { strcpy(message,"Hi there !"); } // else // { // strcpy(message,"Invalid Message !"); // } // Send some data if( send(sock, message, strlen(message), 0) < 0) { printf("Send failed"); return 1; } close(sock); sleep(1); } return 0; }
the_stack_data/83833.c
#include <stdio.h> #include <stdlib.h> #include <string.h> int next_permutation(int n, char **s){ // Find non-increasing suffix int i = n-1; while(i>0 && strcmp(s[i-1],s[i])>=0) i--; // find key if (i<=0) return 0; // Swap key with its successor in suffix int j = n-1; while(strcmp(s[i-1],s[j])>=0) j--; // find rightmost successor to key char *tmp = s[i-1]; s[i-1] = s[j]; s[j] = tmp; // Reverse the suffix j = n-1; while(i<j) { tmp = s[i]; s[i] = s[j]; s[j] = tmp; i++; j--; } return 1; } int main() { char **s; int n; scanf("%d", &n); s = calloc(n, sizeof(char*)); for (int i = 0; i < n; i++) { s[i] = calloc(11, sizeof(char)); scanf("%s", s[i]); } do { for (int i = 0; i < n; i++) printf("%s%c", s[i], i == n - 1 ? '\n' : ' '); } while (next_permutation(n, s)); for (int i = 0; i < n; i++) free(s[i]); free(s); return 0; }
the_stack_data/103286.c
#include <stdio.h> struct TreeNode { int val; struct TreeNode *left; struct TreeNode *right; }; struct TreeNode* insertIntoBST(struct TreeNode* root, int val){ struct TreeNode* node = root; struct TreeNode* sub; int isLeft = 0; while(1){ isLeft = val < node->val ? 1 : 0; sub = isLeft ? node->left : node->right; if(sub == NULL){ break; } node = sub; } struct TreeNode in; in.val = val; in.left = NULL; in.right = NULL; if(isLeft){ node->left = &in; }else{ node->right = &in; } return root; } int main(){ struct TreeNode root, child; root.val = 10; root.left = &child; root.right = NULL; child.val = 8; child.left = NULL; child.right = NULL; struct TreeNode* result = insertIntoBST(&root, 12); printf("rval %d\n", result->right->val); printf("lval %d\n", result->left->val); }
the_stack_data/51701174.c
// Copyright 2020 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. int foo() { return 42; } int main() { return foo(); }
the_stack_data/61026.c
/* * Copyright 2016 The Emscripten Authors. All rights reserved. * Emscripten is available under two separate licenses, the MIT license and the * University of Illinois/NCSA Open Source License. Both these licenses can be * found in the LICENSE file. */ #include <stdio.h> #include <string.h> int main() { char str[] = "memmove can be very useful....!"; memmove(str + 20, str + 15, 11); puts(str); return 0; }
the_stack_data/100140893.c
/**************************************************************************** * * Copyright 2016 Samsung Electronics 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. * ****************************************************************************/ /************************************************************************ * libc/math/lib_ldexpl.c * * This file is a part of NuttX: * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Ported by: Darcy Gong * * It derives from the Rhombs OS math library by Nick Johnson which has * a compatibile, MIT-style license: * * Copyright (C) 2009-2011 Nick Johnson <nickbjohnson4224 at gmail.com> * * 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. * ************************************************************************/ /************************************************************************ * Included Files ************************************************************************/ #include <math.h> /************************************************************************ * Public Functions ************************************************************************/ #ifdef CONFIG_HAVE_LONG_DOUBLE long double ldexpl(long double x, int n) { return (x * powl(2.0, (long double)n)); } #endif
the_stack_data/46760.c
#include <stdio.h> #include <stdlib.h> #define OK 1 #define ERROR 0 #define TRUE 1 #define FALSE 0 #define LH 1 /* 左高 */ #define EH 0 /* 等高 */ #define RH -1 /* 右高 */ typedef char ElementType; typedef int Boolean; /* 本例子中的代码借鉴了《大话数据结构》中的平衡二叉树的代码,其解法可以说是体现了平衡二叉树的本质定义: 在平衡二叉树中,任意一个节点的左右子树的高度差的绝对值<2,也就有3中可能,-1,0,1 添加一个节点时,新添加的节点平衡因子为0,这时候只需要检查新添加的节点到根节点的路径上是否存在bf==2,-2的情况, 在计算一个节点的bf值时,需要知道3点: 1.之前保存的bf值。通过结构体内的bf值得到。 2.插入元素位于当前元素的哪个子树上。通过之前插入一个元素时的路径可以得到。 3.该子树在插入后有没有长高。这个在插入元素之后,往根节点的路径上,每碰到一个节点都需要进行一次判断,并计算其最新的bf值 该例子中的所有旋转的命名都是参考中国大学MOOC《数据结构》课程中对于平衡二叉树的命名:LL旋转、LR旋转、RL旋转和RR旋转 《大话数据结构》和网络上的一些博客可能对旋转有不同的命名和区分 建议参考《大话数据结构》版本代码,其中将双旋转分解给两个单旋转的思路很值得学习 "均衡,存乎万物之间" ----暗影之拳 阿卡丽 */ typedef struct BinNode { ElementType data; int bf; /* balance factor:平衡因子*/ struct BinNode *left, *right; } BinNode, *AVLTree; // LL旋转 void ll_rotate(AVLTree *tree) { AVLTree l = (*tree)->left; // 调平衡因子 (*tree)->bf = l->bf = EH; (*tree)->left = l->right; /* l的右子树挂接为tree的左子树 */ l->right = *tree; *tree = l; /* tree指向新的根结点 */ } // LR旋转 void lr_rotate(AVLTree *tree) { AVLTree l = (*tree)->left; AVLTree lr = l->right; switch (lr->bf) { // 最后的LR旋转步骤其实是一致的,但是这里lr节点的bf值的不同会导致在旋转完成后, // 被旋转的节点的bf因子不同 case LH: (*tree)->bf = RH; l->bf = EH; lr->bf = EH; break; case EH: (*tree)->bf = l->bf = lr->bf = EH; break; case RH: (*tree)->bf = EH; l->bf = LH; lr->bf = EH; break; } (*tree)->left = lr->right; l->right = lr->left; lr->left = l; lr->right = (*tree); *tree = lr; } void left_balance(AVLTree *tree) { // 进入到这里就证明了(*tree)->bf = 2 AVLTree l; // 接下来判断插入的位置是在左子树的哪边 l = (*tree)->left; switch (l->bf) { case LH: // 插入在左子树的左子树上,做LL旋转 ll_rotate(tree); break; case RH: // 插入在左子树的右子树上,做LR旋转 lr_rotate(tree); break; } } void rr_rotate(AVLTree *tree) { AVLTree r = (*tree)->right; // 调平衡因子 (*tree)->bf = r->bf = EH; (*tree)->right = r->left; r->left = *tree; *tree = r; } // RL旋转 void rl_rotate(AVLTree *tree) { AVLTree r = (*tree)->right; AVLTree rl = r->left; switch (rl->bf) { case LH: (*tree)->bf = EH; r->bf = RH; rl->bf = EH; break; case EH: (*tree)->bf = r->bf = rl->bf = EH; break; case RH: (*tree)->bf = LH; r->bf = EH; rl->bf = EH; break; } r->left = rl->right; (*tree)->right = rl->left; rl->left = (*tree); rl->right = r; *tree = rl; } void right_balance(AVLTree *tree) { AVLTree r, rl; r = (*tree)->right; switch (r->bf) { case LH: rl_rotate(tree); break; case RH: rr_rotate(tree); break; } } int InsertAVL(AVLTree *tree, ElementType x, Boolean *taller) { if (!*tree) { *tree = (AVLTree)malloc(sizeof(BinNode)); (*tree)->data = x; (*tree)->left = (*tree)->right = NULL; (*tree)->bf = EH; *taller = TRUE; return OK; } else { // 已经存在了,就没有必要处理了 if ((*tree)->data == x) { *taller = FALSE; return FALSE; } else if (x < (*tree)->data) { // 插入都失败了,也就是插入的元素原来就有了,也就没必要判断bf值等等了,树根本就没有变化 if (!InsertAVL(&(*tree)->left, x, taller)) { return FALSE; } // 在插入之后,对应的子树(这里是左子树)长高了,重新计算bf值 if (*taller) { switch ((*tree)->bf) { case LH: // 原来左边高,这里左子树还长高了,所以这里的bf值就是2了,需要做左平衡 left_balance(tree); *taller = FALSE; break; case EH: // 原来左右高度相同,这里bf值就为1(LH)了 (*tree)->bf = LH; // 对于当前节点的父节点来说,其当前子树长高 *taller = TRUE; break; case RH: // 原来右边高,现在左右高度一致了 (*tree)->bf = EH; // 对于当前节点的父节点来说,其当前子树没有长高 *taller = FALSE; break; } } } else { if (!InsertAVL(&(*tree)->right, x, taller)) { return FALSE; } if (*taller) { switch ((*tree)->bf) { case LH: (*tree)->bf = EH; *taller = FALSE; break; case EH: (*tree)->bf = RH; *taller = TRUE; break; case RH: right_balance(tree); break; } } } } return OK; } void InOrderTraverse(AVLTree tree) { if (tree) { InOrderTraverse(tree->left); putchar(tree->data); InOrderTraverse(tree->right); } } void PreOrderTraverse(AVLTree tree) { // 这里的!=NULL可以去掉 if (tree != NULL) { // 先打印 putchar(tree->data); // 遍历左子树 PreOrderTraverse(tree->left); // 遍历右子树 PreOrderTraverse(tree->right); } } int main(int argc, char const *argv[]) { AVLTree tree = NULL; Boolean taller; // 通过中序遍历和前/后序遍历中的一个可以唯一地确定一颗二叉树 InsertAVL(&tree, 'A', &taller); InsertAVL(&tree, 'B', &taller); InsertAVL(&tree, 'C', &taller); printf("按ABC(RR旋转)插入数据,前序遍历和中序遍历分别为:\n"); PreOrderTraverse(tree); puts(""); InOrderTraverse(tree); puts(""); tree = NULL; InsertAVL(&tree, 'C', &taller); InsertAVL(&tree, 'B', &taller); InsertAVL(&tree, 'A', &taller); printf("按CBA(LL旋转)插入数据,前序遍历和中序遍历分别为:\n"); PreOrderTraverse(tree); puts(""); InOrderTraverse(tree); puts(""); tree = NULL; InsertAVL(&tree, 'I', &taller); InsertAVL(&tree, 'C', &taller); InsertAVL(&tree, 'F', &taller); printf("按ICF(LR旋转时lr->bf = EH)插入数据,前序遍历和中序遍历分别为:\n"); PreOrderTraverse(tree); puts(""); InOrderTraverse(tree); puts(""); tree = NULL; InsertAVL(&tree, 'I', &taller); InsertAVL(&tree, 'J', &taller); InsertAVL(&tree, 'C', &taller); InsertAVL(&tree, 'B', &taller); InsertAVL(&tree, 'F', &taller); InsertAVL(&tree, 'E', &taller); printf("按IJCBFE(LR旋转时lr->bf = LH)插入数据,前序遍历和中序遍历分别为:\n"); PreOrderTraverse(tree); puts(""); InOrderTraverse(tree); puts(""); tree = NULL; InsertAVL(&tree, 'I', &taller); InsertAVL(&tree, 'J', &taller); InsertAVL(&tree, 'C', &taller); InsertAVL(&tree, 'B', &taller); InsertAVL(&tree, 'F', &taller); InsertAVL(&tree, 'H', &taller); printf("按IJCBFH(LR旋转时lr->bf = RH)插入数据,前序遍历和中序遍历分别为:\n"); PreOrderTraverse(tree); puts(""); InOrderTraverse(tree); puts(""); tree = NULL; InsertAVL(&tree, 'E', &taller); InsertAVL(&tree, 'J', &taller); InsertAVL(&tree, 'H', &taller); printf("按EJH(RL旋转时rl->bf = EH)插入数据,前序遍历和中序遍历分别为:\n"); PreOrderTraverse(tree); puts(""); InOrderTraverse(tree); puts(""); tree = NULL; InsertAVL(&tree, 'E', &taller); InsertAVL(&tree, 'D', &taller); InsertAVL(&tree, 'J', &taller); InsertAVL(&tree, 'H', &taller); InsertAVL(&tree, 'K', &taller); InsertAVL(&tree, 'G', &taller); printf("按EDJHKG(RL旋转时rl->bf = LH)插入数据,前序遍历和中序遍历分别为:\n"); PreOrderTraverse(tree); puts(""); InOrderTraverse(tree); puts(""); tree = NULL; InsertAVL(&tree, 'E', &taller); InsertAVL(&tree, 'D', &taller); InsertAVL(&tree, 'J', &taller); InsertAVL(&tree, 'H', &taller); InsertAVL(&tree, 'K', &taller); InsertAVL(&tree, 'I', &taller); printf("按EDJHKI(RL旋转时rl->bf = RH)插入数据,前序遍历和中序遍历分别为:\n"); PreOrderTraverse(tree); puts(""); InOrderTraverse(tree); puts(""); return 0; }
the_stack_data/126703385.c
#include <stdio.h> int wcount(char *s) { int k, i, j; k = 0; j = 1; for (i = 0; s[i] != '\0'; i = i + 1) { if (s[i] != ' ' && j == 1) { j = 0; k = k + 1; } else if (s[i] == ' ') j = 1; } return k; } int main(int argc, char **argv) { char str[1000]; gets (str); printf ("%d", wcount (str)); return 0; }
the_stack_data/187643247.c
/*! * t-version_set.c - version_set test for lcdb * Copyright (c) 2022, Christopher Jeffrey (MIT License). * https://github.com/chjj/lcdb * * Parts of this software are based on google/leveldb: * Copyright (c) 2011, The LevelDB Authors. All rights reserved. * https://github.com/google/leveldb * * See LICENSE for more information. */ int ldb_test_version_set(void); int main(void) { return ldb_test_version_set(); }
the_stack_data/168894126.c
#include"stdio.h" #include"unistd.h" #include"fcntl.h" #include"sys/types.h" #include"errno.h" int main() { int fd1, fd2, fd3, dup2ret; char buffer[12]; printf("PID :- %ld\n",(long)getpid()); fd1 = ("read.c",O_RDONLY); fd2 = ("read.c",O_RDONLY); fd3 = ("select.c",O_RDONLY); dup2ret = dup2(fd1,19); if(dup2ret == -1) { perror("dup2 error"); return 1; } printf("Dup2 return = %d\n",dup2ret); }
the_stack_data/546971.c
#include<stdio.h> int n; void transpose(int arr[n][n],int n) { int tra[n][n],i,j; for(i=0;i<n;i++) { for(j=0;j<n;j++) { tra[i][j]=arr[j][i]; } } for(i=0;i<n;i++) { for(j=0;j<n;j++) { arr[i][j]=tra[i][j]; } } } int main() { int i,j; printf("Enter the order of matrix\n"); scanf("%d",&n); int arr[10][10]; printf("Enter the elements\n"); for(i=0;i<n;i++) { for(j=0;j<n;j++) { printf("element at a%d%d : ",i+1,j+1); scanf("%d",&arr[i][j]); } } transpose(arr,n); for(i=0;i<n;i++) { for(j=0;j<n;j++) { printf("%d\t",arr[i][j]); } printf("\n"); } return 0; }
the_stack_data/107951691.c
//lab 3 //C14427818 //30/9/14 #include <stdio.h> main() { int answer=1-5; int i=1-5; for(i=1;i<=5;i++) { answer = answer + i; } printf("the sum is %d" ,answer); getchar(); }//end main
the_stack_data/81560.c
/* Compile with: export CFLAGS="-g -Wall -std=gnu11 -O3" #the usual. make papersize */ #include <stdio.h> #include <strings.h> //strcasecmp (from POSIX) #include <math.h> //NaN typedef struct { double width, height; } size_s; size_s width_height(char *papertype){ return !strcasecmp(papertype, "A4") ? (size_s) {.width=210, .height=297} : !strcasecmp(papertype, "Letter") ? (size_s) {.width=216, .height=279} : !strcasecmp(papertype, "Legal") ? (size_s) {.width=216, .height=356} : (size_s) {.width=NAN, .height=NAN}; } int main(){ size_s a4size = width_height("a4"); printf("width= %g, height=%g\n", a4size.width, a4size.height); }
the_stack_data/126893.c
#include<stdio.h> int main() { int x; int num; int intervalo = 0; for(x = 0; x < 5; x++) { printf("Digite um número: "); scanf("%d", &num); if (num >= 10) { if (num <= 150) { intervalo = intervalo + 1; } } } printf("Ao total, foram digitados %d números no intervalo entre 10 e 150\n", intervalo); return 0; }
the_stack_data/242329903.c
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null union X { void *B; }; union X foo() { union X A; A.B = (void*)123; return A; }
the_stack_data/640652.c
#include <stdlib.h> #include <stdio.h> #include <errno.h> #include <string.h> #include <unistd.h> typedef struct flags { int verbose; int force; } flags; int ERR_STATUS = 0; int main(int argc, char *argv[]) { char *paths[argc]; int path_count = 0; flags flag = { 0, 0 }; for (int i = 1; i < argc; i++) { char *arg = argv[i]; // Double dash keyword options if (strlen(arg) > 2 && arg[0] == '-' && arg[1] == '-') { if (strcmp(arg, "--verbose") == 0) flag.verbose = 1; else if (strcmp(arg, "--force") == 0) flag.force = 1; else { fprintf(stderr, "rm: unrecognized option '%s'\n", arg); exit(EXIT_FAILURE); } continue; } // Single dash keyword letter options if (strlen(arg) > 1 && arg[0] == '-') { for (int j = 1; j < strlen(arg); j++) { char letter = arg[j]; if (letter == 'v') flag.verbose = 1; else if (letter == 'f') flag.force = 1; else { fprintf(stderr, "rm: invalid option -- '%c'\n", letter); exit(EXIT_FAILURE); } } continue; } // This argument is not an option/flag its a path to be cat'ed paths[path_count++] = arg; } if (path_count == 0 && !flag.force) { fprintf(stderr, "rm: missing operand\n"); exit(1); } for (int i = 0; i < path_count; i++) { char *path = paths[i]; if (unlink(path) == -1) { switch (errno) { case EACCES: fprintf( stderr, "rm: cannot remove '%s': Permission denied\n", path ); break; case EISDIR: fprintf( stderr, "rm: cannot remove '%s': Is a directory\n", path ); break; case ENOENT: if (!flag.force) fprintf( stderr, "rm: cannot remove '%s': No such file or directory\n", path ); } ERR_STATUS = 1; continue; } if (flag.verbose) printf("Removed '%s'\n", path); } return 0; }
the_stack_data/115766140.c
#include <stdio.h> #include <stdlib.h> // Macro for left or right direction of binary tree #define LEFT 0 #define RIGHT 1 // Macro for getter option or setter option for function `threaded` #define GET 0 #define SET 1 // type alias for byte type typedef unsigned char byte; // Threaded Tree typedef struct ThreadedTree_ { byte thread; char data; struct ThreadedTree_* left; struct ThreadedTree_* right; } ThreadedTree; // Linked list for structure Stack typedef struct List_ { ThreadedTree* tree; struct List_* next; } List; // Stack structure with linked list typedef struct { List* top; } Stack; // Pair object for finding insertion point typedef struct { ThreadedTree* tree; ThreadedTree* parent; } TreePair; // Linked list for structure Queue typedef struct PairList_ { TreePair pair; struct PairList_* next; } PairList; // Queue structure with linked list typedef struct { PairList* front; PairList* back; } Queue; // Generate empty stack Stack make_stack() { Stack stack; stack.top = NULL; return stack; } // Delete stack void delete_stack(Stack* stack) { List* next; while (stack->top) { next = stack->top->next; free(stack->top); stack->top = next; } } // Push object to stack void push(Stack* stack, ThreadedTree* tree) { List* head = malloc(sizeof(List)); head->next = stack->top; head->tree = tree; stack->top = head; } // Pop object from stack // Returns: // NULL, if stack is empty // ThreadedTree*, if otherwise ThreadedTree* pop(Stack* stack) { if (stack->top == NULL) { return NULL; } List* head = stack->top; stack->top = head->next; ThreadedTree* data = head->tree; free(head); return data; } // Get top object of stack. // Exceptions: // if stack is empty ThreadedTree* top(Stack* stack) { return stack->top->tree; } // Generate empty TreePair TreePair empty_tree_pair() { TreePair pair; pair.tree = NULL; pair.parent = NULL; return pair; } // Generate empty queue Queue make_queue() { Queue queue; queue.back = NULL; queue.front = NULL; return queue; } // Delete queue void delete_queue(Queue* queue) { PairList* pair; while (queue->front != queue->back) { pair = queue->front->next; free(queue->front); queue->front = pair; } if (queue->front != NULL) { free(queue->front); } } // Enqueue object to queue void push_back(Queue* queue, ThreadedTree* tree, ThreadedTree* parent) { PairList* list = malloc(sizeof(PairList)); list->next = NULL; list->pair.tree = tree; list->pair.parent = parent; if (queue->back == NULL) { queue->front = queue->back = list; } else { queue->back->next = list; queue->back = list; } } // Dequeue object from queue // Returns: // empty_tree_pair(), if queue is empty // TreePair, if otherwise TreePair pop_front(Queue* queue) { PairList* front = queue->front; if (front == NULL) { return empty_tree_pair(); } TreePair ret = front->pair; if (front == queue->back) { queue->back = NULL; } queue->front = front->next; free(front); return ret; } // Get front object of queue // Exceptions: // if queue is empty TreePair front(Queue* queue) { return queue->front->pair; } // Querying thread pointer from given tree // Args: // tree: ThreadedTree*, node // dir: LEFT or RIGHT, querying direction // set: GET or SET, querying method // Returns: // 1, if LEFT is set // 2, if RIGHT is set // 0, if given node doesn't have thread pointer int threaded(ThreadedTree* tree, int dir, int set) { if (set == SET) { tree->thread |= (1 << dir); } return tree->thread & (1 << dir); } // Generate empty tree ThreadedTree* make_tree(char data) { ThreadedTree* tree = malloc(sizeof(ThreadedTree)); tree->thread = 0; tree->data = data; tree->left = NULL; tree->right = NULL; return tree; } // Delete all tree nodes void delete_tree(ThreadedTree* root) { Stack stack = make_stack(); push(&stack, root); ThreadedTree* tree; while ((tree = pop(&stack))) { if (!threaded(tree, LEFT, GET) && tree->left) { push(&stack, tree->left); } if (!threaded(tree, RIGHT, GET) && tree->right) { push(&stack, tree->right); } free(tree); } delete_stack(&stack); } // Find insertion point, targeting full-complete binary tree ThreadedTree** insert_point(ThreadedTree* tree) { Queue queue = make_queue(); push_back(&queue, tree, NULL); // Level order traverse to find insertion point TreePair pair; while (1) { pair = pop_front(&queue); tree = pair.tree; if (tree == NULL) { break; } push_back(&queue, tree->left, tree); push_back(&queue, tree->right, tree); } delete_queue(&queue); if (pair.parent->left == tree) { return &pair.parent->left; } else { return &pair.parent->right; } } // Insert node with given data void insert_node(ThreadedTree* tree, char data) { ThreadedTree** node = insert_point(tree); *node = make_tree(data); } // Generate inorder thread pointer void make_inorder_threaded(ThreadedTree* node) { int already_pop = 0; ThreadedTree* prev = NULL; Stack stack = make_stack(); // In-order traverse while (1) { if (already_pop) { already_pop = 0; } else { for (; node; node = node->left) { push(&stack, node); } node = pop(&stack); } if (node == NULL) { break; } if (node->left == NULL) { threaded(node, LEFT, SET); node->left = prev; } if (node->right == NULL) { threaded(node, RIGHT, SET); node->right = pop(&stack); already_pop = 1; } prev = node; node = node->right; } delete_stack(&stack); } // Get next node based on thread pointer ThreadedTree* next_node(ThreadedTree* node) { ThreadedTree* tmp = node->right; if (!threaded(node, RIGHT, GET)) { while (!threaded(tmp, LEFT, GET)) { tmp = tmp->left; } } return tmp; } // Traverse tree in in-order and run given callback with proper data void traverse(ThreadedTree* node, void(*func)(char)) { while (!threaded(node, LEFT, GET)) { node = node->left; } while (1) { func(node->data); node = next_node(node); if (node == NULL) { break; } } } // Printer callback FILE* output; void print(char data) { fprintf(output, "%c ", data); } int main() { // Preparing File I/O output = fopen("output.txt", "w"); FILE* input = fopen("input.txt", "r"); // Get size of list int n_list; fscanf(input, "%d", &n_list); int i; char data[2]; ThreadedTree* root; if (n_list > 0) { // Generate root node fscanf(input, "%s", data); root = make_tree(data[0]); // Insert node for (i = 1; i < n_list; ++i) { fscanf(input, "%s", data); insert_node(root, data[0]); } // Make thread pointer in in-order make_inorder_threaded(root); // Traverse tree with callback `print` traverse(root, print); // Delete tree delete_tree(root); } // Delete file objects fclose(input); fclose(output); return 0; }
the_stack_data/122015562.c
/* URI Online Judge | 1117 Score Validation Adapted by Neilor Tonin, URI Brazil Timelimit: 1 Write a program that reads two scores of a student. Calculate and print the average of these scores. Your program must accept just valid scores [0..10]. Each score must be validated separately. Input The input file contains many floating-point numbers​​, positive or negative. The program execution will be finished after the input of two valid scores. Output When an invalid score is read, you should print the message "nota invalida". After the input of two valid scores, the message "media = " must be printed followed by the average of the student. The average must be printed with 2 numbers after the decimal point. @author Marcos Lima @profile https://www.urionlinejudge.com.br/judge/pt/profile/242402 @status Accepted @language C (gcc 4.8.5, -O2 -lm) [+0s] @time 0.000s @size 388 Bytes @submission 12/10/19, 9:11:42 AM */ #include <stdio.h> int main() { double nota, media = 0.0; unsigned char c = 2; do { scanf("%lf", &nota); if ((nota < 0.0) || (nota > 10.0)) { printf("nota invalida\n"); } else { media += nota; --c; } } while (c); printf("media = %.2lf\n", media / 2.0); return 0; }
the_stack_data/211080236.c
#include <stdio.h> #include <stdlib.h> int main() { int n=4 ,row,star,space; for(row=1;row<=n;row++) { for(space=1;space<=(n-row);space++) { printf(" "); } for(star=1;star<=row;star++) { printf("* "); } printf("\n"); } }
the_stack_data/215768353.c
#include <stdlib.h> void main(){ int *x; int *y; int i; int z; y = (int *) malloc(100 * sizeof(int)); x = y; i = 0; for (; i < 100; i++){ validptr(x); *x = 0; x++; } i = 0; x = y; for (; i < 100; i++){ z = *x; csolve_assert(z >= 0); x++; } return 0; }
the_stack_data/76700098.c
/* * Copyright (c) 2008 James Molloy, Jörg Pfähler, Matthew Iselin * * 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. */ #include <pwd.h> #include <stdio.h> #include <signal.h> #include <unistd.h> #include <termios.h> #include <sys/wait.h> #include <sys/stat.h> #include <signal.h> #include <stdlib.h> #include <errno.h> #include <string.h> // Pedigree function, defined in glue.c extern int login(int uid, char *password); int main(int argc, char *argv[]) { int iRunShell = 0, error = 0, help = 0, nStart = 0, i = 0; for(i = 1; i < argc; i++) { if(!strcmp(argv[i], "-s")) iRunShell = 1; else if(!strcmp(argv[i], "-h")) help = 1; else if(!nStart) nStart = i; } // If there was an error, or if the help string needs to be printed, do so if(error || help || (!nStart && !iRunShell)) { fprintf(stderr, "Usage: sudo [-h] [-s|<command>]\n"); fprintf(stderr, "\n"); fprintf(stderr, " -s: Access root shell\n"); fprintf(stderr, " -h: Show this help text\n"); return error; } // Grab the root user's pw structure struct passwd *pw = getpwnam("root"); if(!pw) { fprintf(stderr, "sudo: user 'root' doesn't exist!\n"); return 1; } // Request the root password char password[256], c; i = 0; struct termios curt; tcgetattr(0, &curt); curt.c_lflag &= ~(ECHO|ICANON); tcsetattr(0, TCSANOW, &curt); printf("[sudo] Enter password: "); fflush(stdout); while ( i < 256 && (c=getchar()) != '\n' ) { if(c == '\b') { if(i > 0) { password[--i] = '\0'; printf("\b \b"); } } else if (c != '\033') { password[i++] = c; printf("•"); } } tcgetattr(0, &curt); curt.c_lflag |= (ECHO|ICANON); tcsetattr(0, TCSANOW, &curt); printf("\n"); password[i] = '\0'; // Attempt to log in as that user if(login(pw->pw_uid, password) != 0) { fprintf(stderr, "sudo: password is incorrect\n"); return 1; } // Begin a new session so SIGINT is properly handled here setsid(); // We're now running as root, so execute whatever we're supposed to execute if(iRunShell) { // Execute root's shell int pid; if((pid = fork()) == 0) { // Run the command execlp(pw->pw_shell, pw->pw_shell, 0); // Command not found! fprintf(stderr, "sudo: couldn't run shell: %s\n", strerror(errno)); exit(errno); } else { // Wait for it to complete int status; waitpid(pid, &status, 0); // Did it exit with a non-zero status? if(status) { // Return error exit(status); } } } else { // Run the command int pid; if((pid = fork()) == 0) { // Run the command execvp(argv[nStart], &argv[nStart]); // Command not found! fprintf(stderr, "sudo: couldn't run command '%s': %s\n", argv[nStart], strerror(errno)); exit(errno); } else { // Wait for it to complete int status; waitpid(pid, &status, 0); // Did it exit with a non-zero status? if(status) { // Return error exit(status); } } } // All done! return 0; }
the_stack_data/271870.c
// RUN: %clang_cc1 -fsyntax-only -Wlogical-not-parentheses -verify %s // RUN: %clang_cc1 -fsyntax-only -Wlogical-not-parentheses -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s int getInt(); int test1(int i1, int i2) { int ret; ret = !i1 == i2; // expected-warning@-1 {{logical not is only applied to the left hand side of this comparison}} // expected-note@-2 {{add parentheses after the '!' to evaluate the comparison first}} // expected-note@-3 {{add parentheses around left hand side expression to silence this warning}} // CHECK: warn-logical-not-compare.c:[[line:[0-9]*]]:9: warning // CHECK: to evaluate the comparison first // CHECK: fix-it:"{{.*}}":{[[line]]:10-[[line]]:10}:"(" // CHECK: fix-it:"{{.*}}":{[[line]]:18-[[line]]:18}:")" // CHECK: to silence this warning // CHECK: fix-it:"{{.*}}":{[[line]]:9-[[line]]:9}:"(" // CHECK: fix-it:"{{.*}}":{[[line]]:12-[[line]]:12}:")" ret = !i1 != i2; //expected-warning@-1 {{logical not is only applied to the left hand side of this comparison}} // expected-note@-2 {{add parentheses after the '!' to evaluate the comparison first}} // expected-note@-3 {{add parentheses around left hand side expression to silence this warning}} // CHECK: warn-logical-not-compare.c:[[line:[0-9]*]]:9: warning // CHECK: to evaluate the comparison first // CHECK: fix-it:"{{.*}}":{[[line]]:10-[[line]]:10}:"(" // CHECK: fix-it:"{{.*}}":{[[line]]:18-[[line]]:18}:")" // CHECK: to silence this warning // CHECK: fix-it:"{{.*}}":{[[line]]:9-[[line]]:9}:"(" // CHECK: fix-it:"{{.*}}":{[[line]]:12-[[line]]:12}:")" ret = !i1 < i2; //expected-warning@-1 {{logical not is only applied to the left hand side of this comparison}} // expected-note@-2 {{add parentheses after the '!' to evaluate the comparison first}} // expected-note@-3 {{add parentheses around left hand side expression to silence this warning}} // CHECK: warn-logical-not-compare.c:[[line:[0-9]*]]:9: warning // CHECK: to evaluate the comparison first // CHECK: fix-it:"{{.*}}":{[[line]]:10-[[line]]:10}:"(" // CHECK: fix-it:"{{.*}}":{[[line]]:17-[[line]]:17}:")" // CHECK: to silence this warning // CHECK: fix-it:"{{.*}}":{[[line]]:9-[[line]]:9}:"(" // CHECK: fix-it:"{{.*}}":{[[line]]:12-[[line]]:12}:")" ret = !i1 > i2; //expected-warning@-1 {{logical not is only applied to the left hand side of this comparison}} // expected-note@-2 {{add parentheses after the '!' to evaluate the comparison first}} // expected-note@-3 {{add parentheses around left hand side expression to silence this warning}} // CHECK: warn-logical-not-compare.c:[[line:[0-9]*]]:9: warning // CHECK: to evaluate the comparison first // CHECK: fix-it:"{{.*}}":{[[line]]:10-[[line]]:10}:"(" // CHECK: fix-it:"{{.*}}":{[[line]]:17-[[line]]:17}:")" // CHECK: to silence this warning // CHECK: fix-it:"{{.*}}":{[[line]]:9-[[line]]:9}:"(" // CHECK: fix-it:"{{.*}}":{[[line]]:12-[[line]]:12}:")" ret = !i1 <= i2; //expected-warning@-1 {{logical not is only applied to the left hand side of this comparison}} // expected-note@-2 {{add parentheses after the '!' to evaluate the comparison first}} // expected-note@-3 {{add parentheses around left hand side expression to silence this warning}} // CHECK: warn-logical-not-compare.c:[[line:[0-9]*]]:9: warning // CHECK: to evaluate the comparison first // CHECK: fix-it:"{{.*}}":{[[line]]:10-[[line]]:10}:"(" // CHECK: fix-it:"{{.*}}":{[[line]]:18-[[line]]:18}:")" // CHECK: to silence this warning // CHECK: fix-it:"{{.*}}":{[[line]]:9-[[line]]:9}:"(" // CHECK: fix-it:"{{.*}}":{[[line]]:12-[[line]]:12}:")" ret = !i1 >= i2; //expected-warning@-1 {{logical not is only applied to the left hand side of this comparison}} // expected-note@-2 {{add parentheses after the '!' to evaluate the comparison first}} // expected-note@-3 {{add parentheses around left hand side expression to silence this warning}} // CHECK: warn-logical-not-compare.c:[[line:[0-9]*]]:9: warning // CHECK: to evaluate the comparison first // CHECK: fix-it:"{{.*}}":{[[line]]:10-[[line]]:10}:"(" // CHECK: fix-it:"{{.*}}":{[[line]]:18-[[line]]:18}:")" // CHECK: to silence this warning // CHECK: fix-it:"{{.*}}":{[[line]]:9-[[line]]:9}:"(" // CHECK: fix-it:"{{.*}}":{[[line]]:12-[[line]]:12}:")" ret = i1 == i2; ret = i1 != i2; ret = i1 < i2; ret = i1 > i2; ret = i1 <= i2; ret = i1 >= i2; // Warning silenced by parens. ret = (!i1) == i2; ret = (!i1) != i2; ret = (!i1) < i2; ret = (!i1) > i2; ret = (!i1) <= i2; ret = (!i1) >= i2; ret = !getInt() == i1; // expected-warning@-1 {{logical not is only applied to the left hand side of this comparison}} // expected-note@-2 {{add parentheses after the '!' to evaluate the comparison first}} // expected-note@-3 {{add parentheses around left hand side expression to silence this warning}} // CHECK: warn-logical-not-compare.c:[[line:[0-9]*]]:9: warning // CHECK: to evaluate the comparison first // CHECK: fix-it:"{{.*}}":{[[line]]:10-[[line]]:10}:"(" // CHECK: fix-it:"{{.*}}":{[[line]]:24-[[line]]:24}:")" // CHECK: to silence this warning // CHECK: fix-it:"{{.*}}":{[[line]]:9-[[line]]:9}:"(" // CHECK: fix-it:"{{.*}}":{[[line]]:18-[[line]]:18}:")" ret = (!getInt()) == i1; return ret; } enum E {e1, e2}; enum E getE(); int test2 (enum E e) { int ret; ret = e == e1; ret = e == getE(); ret = getE() == e1; ret = getE() == getE(); ret = !e == e1; // expected-warning@-1 {{logical not is only applied to the left hand side of this comparison}} // expected-note@-2 {{add parentheses after the '!' to evaluate the comparison first}} // expected-note@-3 {{add parentheses around left hand side expression to silence this warning}} // CHECK: warn-logical-not-compare.c:[[line:[0-9]*]]:9: warning // CHECK: to evaluate the comparison first // CHECK: fix-it:"{{.*}}":{[[line]]:10-[[line]]:10}:"(" // CHECK: fix-it:"{{.*}}":{[[line]]:17-[[line]]:17}:")" // CHECK: to silence this warning // CHECK: fix-it:"{{.*}}":{[[line]]:9-[[line]]:9}:"(" // CHECK: fix-it:"{{.*}}":{[[line]]:11-[[line]]:11}:")" ret = !e == getE(); // expected-warning@-1 {{logical not is only applied to the left hand side of this comparison}} // expected-note@-2 {{add parentheses after the '!' to evaluate the comparison first}} // expected-note@-3 {{add parentheses around left hand side expression to silence this warning}} // CHECK: warn-logical-not-compare.c:[[line:[0-9]*]]:9: warning // CHECK: to evaluate the comparison first // CHECK: fix-it:"{{.*}}":{[[line]]:10-[[line]]:10}:"(" // CHECK: fix-it:"{{.*}}":{[[line]]:21-[[line]]:21}:")" // CHECK: to silence this warning // CHECK: fix-it:"{{.*}}":{[[line]]:9-[[line]]:9}:"(" // CHECK: fix-it:"{{.*}}":{[[line]]:11-[[line]]:11}:")" ret = !getE() == e1; // expected-warning@-1 {{logical not is only applied to the left hand side of this comparison}} // expected-note@-2 {{add parentheses after the '!' to evaluate the comparison first}} // expected-note@-3 {{add parentheses around left hand side expression to silence this warning}} // CHECK: warn-logical-not-compare.c:[[line:[0-9]*]]:9: warning // CHECK: to evaluate the comparison first // CHECK: fix-it:"{{.*}}":{[[line]]:10-[[line]]:10}:"(" // CHECK: fix-it:"{{.*}}":{[[line]]:22-[[line]]:22}:")" // CHECK: to silence this warning // CHECK: fix-it:"{{.*}}":{[[line]]:9-[[line]]:9}:"(" // CHECK: fix-it:"{{.*}}":{[[line]]:16-[[line]]:16}:")" ret = !getE() == getE(); // expected-warning@-1 {{logical not is only applied to the left hand side of this comparison}} // expected-note@-2 {{add parentheses after the '!' to evaluate the comparison first}} // expected-note@-3 {{add parentheses around left hand side expression to silence this warning}} // CHECK: warn-logical-not-compare.c:[[line:[0-9]*]]:9: warning // CHECK: to evaluate the comparison first // CHECK: fix-it:"{{.*}}":{[[line]]:10-[[line]]:10}:"(" // CHECK: fix-it:"{{.*}}":{[[line]]:26-[[line]]:26}:")" // CHECK: to silence this warning // CHECK: fix-it:"{{.*}}":{[[line]]:9-[[line]]:9}:"(" // CHECK: fix-it:"{{.*}}":{[[line]]:16-[[line]]:16}:")" ret = !(e == e1); ret = !(e == getE()); ret = !(getE() == e1); ret = !(getE() == getE()); ret = (!e) == e1; ret = (!e) == getE(); ret = (!getE()) == e1; ret = (!getE()) == getE(); return ret; } int PR16673(int x) { int ret; // Make sure we don't emit a fixit for the left paren, but not the right paren. #define X(x) x ret = X(!x == 1 && 1); // expected-warning@-1 {{logical not is only applied to the left hand side of this comparison}} // expected-note@-2 {{add parentheses after the '!' to evaluate the comparison first}} // expected-note@-3 {{add parentheses around left hand side expression to silence this warning}} // CHECK: warn-logical-not-compare.c:[[line:[0-9]*]]:11: warning // CHECK: to evaluate the comparison first // CHECK-NOT: fix-it // CHECK: to silence this warning // CHECK-NOT: fix-it return ret; } int compare_pointers(int* a, int* b) { int ret; ret = !!a == !!b; ret = !!a != !!b; return ret; }
the_stack_data/925976.c
#include <stdio.h> #include <sys/socket.h> #include <stdlib.h> #include <netinet/in.h> #include <string.h> #define PORT 17425 int main(int argc, char** argv) { int server_fd, new_socket, valread; if ((server_fd = socket(AF_INET, SOCK_STREAM, 0)) == 0) { perror("socket failed"); exit(EXIT_FAILURE); } return 0; }
the_stack_data/150015.c
/************************************************************************* > File Name: Storage.c > Author: > Mail: > Created Time: 2015年04月04日 星期六 19时14分38秒 ************************************************************************/ #include<stdio.h>
the_stack_data/54826374.c
/* * Program: guess-that-number.c * This program is an implementation of the "guess that number" * game. The computer randomly chooses a number and the player * attempts to guess it. (It should never take more than 7 guesses) */ #include <stdio.h> #include <stdlib.h> #include <time.h> #include <stdbool.h> #define MAX_NUMBER 100 #define MAX_GUESSES 7 // Print a line onto the Terminal. void print_line(int len) { int i = 0; while ( i < len ) { printf("-"); i++; } printf("\n"); } // Perform the steps for the guess. Reads the value entered by the user, // outputs a message, and then returns true if the got it otherwise it returns // false. bool perform_guess(int num_guess, int target) { int guess; printf("Guess %d: ", num_guess); scanf("%d", &guess); if (target < guess) printf("The number is less than %d\n", guess); else if (target > guess) printf("The number is larger than %d\n", guess); else printf("Well done... the number was %d\n", guess); return target == guess; } // Implements a simple guessing game. The program generates // a random number, and the player tries to guess it. void play_game() { int my_number, num_guess; bool got_it; my_number = random() % MAX_NUMBER + 1; num_guess = 0; //Keep track of the number of guesses printf("I am thinking of a number between 1 and %d\n\n", MAX_NUMBER); do { num_guess++; got_it = perform_guess(num_guess, my_number); } while( num_guess < MAX_GUESSES && !got_it); if ( !got_it ) { printf("You ran out of guesses... the number was %d\n", my_number); } } // Loops the guessing game until the user decided to quite. int main() { char again; srandom(time(0)); do { play_game(); printf("\n"); print_line(50); printf("Do you want to play again [y/N]? "); scanf(" %c", &again); } while (again == 'y' || again == 'Y'); printf("\nBye\n"); return 0; }
the_stack_data/76701310.c
#include<stdio.h> #include<string.h> int main(){ int temp,N,a[3],n,t; scanf("%d",&N); while(N--){ int count = 0; memset(a,0,sizeof(a)); scanf("%d",&n); for(int i = 0;i < n;i++){ scanf("%d",&t); a[t%3]++; } if(a[2] < a[1]){temp = a[2];a[2] = a[1];a[1] = temp;} count = a[0] + a[1] + (a[2] - a[1])/3; printf("%d\n",count); } return 0; }
the_stack_data/243894090.c
#include <stdio.h> #include <stdint.h> #include <stddef.h> #include <string.h> #define CTYPELIST \ _X("c_int", int ) \ _X("c_short", short ) \ _X("c_long", long ) \ _X("c_long_long", long long ) \ _X("c_signed_char", signed char ) \ _X("c_size_t", size_t ) \ \ _X("c_int8_t", int8_t ) \ _X("c_int16_t", int16_t ) \ _X("c_int32_t", int32_t ) \ _X("c_int64_t", int64_t ) \ \ _X("c_int_least8_t", int_least8_t ) \ _X("c_int_least16_t", int_least16_t ) \ _X("c_int_least32_t", int_least32_t ) \ _X("c_int_least64_t", int_least64_t ) \ \ _X("c_int_fast8_t", int_fast8_t ) \ _X("c_int_fast16_t", int_fast16_t ) \ _X("c_int_fast32_t", int_fast32_t ) \ _X("c_int_fast64_t", int_fast64_t ) \ \ _X("c_intmax_t", intmax_t ) \ _X("c_intptr_t", intptr_t ) \ _X("c_ptrdiff_t", ptrdiff_t ) \ \ _X("c_float", float ) \ _X("c_double", double ) \ _X("c_long_double", long double ) \ \ _X("c_float_complex", float _Complex ) \ _X("c_double_complex", double _Complex ) \ _X("c_long_double_complex", long double _Complex ) \ \ _X("c_bool", _Bool ) \ _X("c_char", char ) int main(int argc, char ** argv) { int divisor = 1; #define _X(a,b) \ divisor = strstr(a,"complex") == NULL ? 1 : 2; \ printf("integer, parameter :: %s = %zu\n", a, sizeof(b)/divisor); CTYPELIST return 0; }
the_stack_data/170454257.c
#include <stdint.h> const uint8_t #if defined __GNUC__ __attribute__((aligned(4))) #elif defined _MSC_VER __declspec(align(4)) #endif mrbprcs[] = { 0x45,0x54,0x49,0x52,0x30,0x30,0x30,0x33,0x73,0x38,0x00,0x00,0x17,0xc0,0x4d,0x41, 0x54,0x5a,0x30,0x30,0x30,0x30,0x49,0x52,0x45,0x50,0x00,0x00,0x15,0x9c,0x30,0x30, 0x30,0x30,0x00,0x00,0x01,0x84,0x00,0x01,0x00,0x03,0x00,0x04,0x00,0x00,0x00,0x23, 0x02,0x00,0x80,0x00,0x12,0x00,0x80,0x00,0x82,0x00,0x80,0x00,0x92,0x00,0x80,0x00, 0x03,0x00,0xc0,0x00,0x12,0x01,0x80,0x00,0x02,0x01,0x80,0x00,0x92,0x01,0x80,0x00, 0x82,0x01,0x80,0x00,0x12,0x02,0x80,0x00,0x83,0xff,0xbf,0x00,0x92,0x02,0x80,0x00, 0x83,0xff,0xbf,0x00,0x12,0x03,0x80,0x00,0x83,0xff,0xbf,0x00,0x92,0x03,0x80,0x00, 0x83,0xff,0xbf,0x00,0x12,0x04,0x80,0x00,0x05,0x00,0x80,0x00,0x05,0x00,0x00,0x01, 0x43,0x40,0x82,0x00,0x45,0x00,0x80,0x00,0x05,0x00,0x80,0x00,0x11,0x05,0x00,0x01, 0x43,0xc0,0x82,0x00,0xc5,0x00,0x80,0x00,0x05,0x00,0x80,0x00,0x11,0x06,0x00,0x01, 0x43,0x40,0x83,0x00,0x45,0x01,0x80,0x00,0x05,0x00,0x80,0x00,0x05,0x00,0x00,0x01, 0x43,0x80,0x83,0x00,0xc5,0x01,0x80,0x00,0x4a,0x00,0x00,0x00,0x00,0x00,0x00,0x04, 0x02,0x00,0x17,0x33,0x2e,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, 0x30,0x30,0x30,0x30,0x30,0x65,0x2b,0x30,0x30,0x31,0x02,0x00,0x17,0x35,0x2e,0x30, 0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x65, 0x2b,0x30,0x30,0x30,0x01,0x00,0x07,0x31,0x32,0x38,0x36,0x36,0x35,0x36,0x01,0x00, 0x0a,0x31,0x30,0x37,0x39,0x39,0x30,0x34,0x35,0x30,0x33,0x00,0x00,0x00,0x0f,0x00, 0x0a,0x54,0x45,0x4d,0x50,0x54,0x48,0x52,0x5f,0x48,0x49,0x00,0x00,0x0a,0x54,0x45, 0x4d,0x50,0x54,0x48,0x52,0x5f,0x4c,0x4f,0x00,0x00,0x08,0x46,0x52,0x41,0x4d,0x45, 0x5f,0x49,0x44,0x00,0x00,0x08,0x41,0x44,0x44,0x36,0x34,0x5f,0x48,0x49,0x00,0x00, 0x08,0x41,0x44,0x44,0x36,0x34,0x5f,0x4c,0x4f,0x00,0x00,0x08,0x41,0x44,0x44,0x31, 0x36,0x5f,0x48,0x49,0x00,0x00,0x08,0x41,0x44,0x44,0x31,0x36,0x5f,0x4c,0x4f,0x00, 0x00,0x0a,0x42,0x52,0x4f,0x41,0x44,0x43,0x5f,0x52,0x41,0x44,0x00,0x00,0x03,0x4f, 0x50,0x54,0x00,0x00,0x03,0x46,0x61,0x6e,0x00,0x00,0x09,0x49,0x32,0x43,0x4d,0x61, 0x73,0x74,0x65,0x72,0x00,0x00,0x06,0x53,0x65,0x6e,0x73,0x6f,0x72,0x00,0x00,0x04, 0x55,0x41,0x52,0x54,0x00,0x00,0x04,0x58,0x62,0x65,0x65,0x00,0x00,0x03,0x41,0x70, 0x70,0x00,0x00,0x00,0x00,0x8f,0x00,0x01,0x00,0x03,0x00,0x05,0x00,0x00,0x00,0x11, 0x48,0x00,0x80,0x00,0xc0,0x00,0x00,0x01,0x46,0x00,0x80,0x00,0x48,0x00,0x80,0x00, 0xc0,0x02,0x00,0x01,0x46,0x40,0x80,0x00,0x48,0x00,0x80,0x00,0xc0,0x04,0x00,0x01, 0x46,0x80,0x80,0x00,0x48,0x00,0x80,0x00,0xc0,0x06,0x00,0x01,0x46,0xc0,0x80,0x00, 0x48,0x00,0x80,0x00,0xc0,0x08,0x00,0x01,0x46,0x00,0x81,0x00,0x04,0x02,0x80,0x00, 0x29,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x0a,0x69,0x6e, 0x69,0x74,0x69,0x61,0x6c,0x69,0x7a,0x65,0x00,0x00,0x02,0x6f,0x6e,0x00,0x00,0x03, 0x6f,0x66,0x66,0x00,0x00,0x0a,0x67,0x65,0x74,0x5f,0x73,0x74,0x61,0x74,0x75,0x73, 0x00,0x00,0x09,0x67,0x65,0x74,0x5f,0x6f,0x6e,0x6f,0x66,0x66,0x00,0x00,0x00,0x00, 0xe5,0x00,0x02,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x1a,0x00,0x26,0x00,0x00,0x00, 0x83,0x07,0x40,0x01,0x0e,0x00,0x00,0x01,0x03,0x08,0x40,0x01,0x8e,0x00,0x00,0x01, 0x03,0x00,0x40,0x01,0x0e,0x01,0x00,0x01,0x91,0x01,0x00,0x01,0x20,0x00,0x01,0x01, 0x8e,0x02,0x00,0x01,0x8d,0x02,0x00,0x01,0x0d,0x00,0x80,0x01,0x91,0x01,0x00,0x02, 0x93,0x03,0x00,0x02,0x20,0x81,0x01,0x01,0x8d,0x02,0x00,0x01,0x8d,0x00,0x80,0x01, 0x91,0x01,0x00,0x02,0x13,0x04,0x00,0x02,0x20,0x81,0x01,0x01,0x8d,0x02,0x00,0x01, 0x0d,0x00,0x80,0x01,0x91,0x01,0x00,0x02,0x13,0x05,0x00,0x02,0x20,0x41,0x02,0x01, 0x29,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0b,0x00,0x0b,0x40,0x70, 0x6f,0x72,0x74,0x5f,0x6f,0x6e,0x6f,0x66,0x66,0x00,0x00,0x0c,0x40,0x70,0x6f,0x72, 0x74,0x5f,0x73,0x74,0x61,0x74,0x75,0x73,0x00,0x00,0x07,0x40,0x73,0x74,0x61,0x74, 0x75,0x73,0x00,0x00,0x04,0x47,0x50,0x49,0x4f,0x00,0x00,0x03,0x6e,0x65,0x77,0x00, 0x00,0x05,0x40,0x67,0x70,0x69,0x6f,0x00,0x00,0x04,0x6d,0x6f,0x64,0x65,0x00,0x00, 0x06,0x4f,0x55,0x54,0x50,0x55,0x54,0x00,0x00,0x05,0x49,0x4e,0x50,0x55,0x54,0x00, 0x00,0x05,0x77,0x72,0x69,0x74,0x65,0x00,0x00,0x04,0x48,0x49,0x47,0x48,0x00,0x00, 0x00,0x00,0x61,0x00,0x02,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0x00, 0x26,0x00,0x00,0x00,0x0d,0x00,0x00,0x01,0x0d,0x01,0x80,0x01,0x11,0x02,0x00,0x02, 0x93,0x01,0x00,0x02,0x20,0x41,0x00,0x01,0x29,0x00,0x00,0x01,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x05,0x00,0x05,0x40,0x67,0x70,0x69,0x6f,0x00,0x00,0x05,0x77,0x72, 0x69,0x74,0x65,0x00,0x00,0x0b,0x40,0x70,0x6f,0x72,0x74,0x5f,0x6f,0x6e,0x6f,0x66, 0x66,0x00,0x00,0x03,0x4c,0x4f,0x57,0x00,0x00,0x04,0x47,0x50,0x49,0x4f,0x00,0x00, 0x00,0x00,0x62,0x00,0x02,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0x00, 0x26,0x00,0x00,0x00,0x0d,0x00,0x00,0x01,0x0d,0x01,0x80,0x01,0x11,0x02,0x00,0x02, 0x93,0x01,0x00,0x02,0x20,0x41,0x00,0x01,0x29,0x00,0x00,0x01,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x05,0x00,0x05,0x40,0x67,0x70,0x69,0x6f,0x00,0x00,0x05,0x77,0x72, 0x69,0x74,0x65,0x00,0x00,0x0b,0x40,0x70,0x6f,0x72,0x74,0x5f,0x6f,0x6e,0x6f,0x66, 0x66,0x00,0x00,0x04,0x48,0x49,0x47,0x48,0x00,0x00,0x04,0x47,0x50,0x49,0x4f,0x00, 0x00,0x00,0x00,0x83,0x00,0x03,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x0f,0x00,0x00, 0x26,0x00,0x00,0x00,0x0d,0x00,0x80,0x01,0x0d,0x01,0x00,0x02,0xa0,0x40,0x80,0x01, 0x01,0xc0,0x00,0x01,0x83,0xff,0x3f,0x02,0xb2,0xc0,0x80,0x01,0x99,0x01,0xc0,0x01, 0x03,0x00,0xc0,0x01,0x0e,0x02,0x80,0x01,0x17,0x01,0x40,0x00,0x83,0xff,0xbf,0x01, 0x0e,0x02,0x80,0x01,0x0d,0x02,0x80,0x01,0x29,0x00,0x80,0x01,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x05,0x00,0x05,0x40,0x67,0x70,0x69,0x6f,0x00,0x00,0x04,0x72,0x65, 0x61,0x64,0x00,0x00,0x0c,0x40,0x70,0x6f,0x72,0x74,0x5f,0x73,0x74,0x61,0x74,0x75, 0x73,0x00,0x00,0x02,0x3d,0x3d,0x00,0x00,0x07,0x40,0x73,0x74,0x61,0x74,0x75,0x73, 0x00,0x00,0x00,0x00,0xa6,0x00,0x03,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x15,0x00, 0x26,0x00,0x00,0x00,0x0d,0x00,0x80,0x01,0x83,0xff,0x3f,0x02,0xb2,0x40,0x80,0x01, 0x99,0x01,0xc0,0x01,0x3d,0x00,0x80,0x01,0x29,0x00,0x80,0x01,0x17,0x06,0x40,0x00, 0x0d,0x01,0x80,0x01,0x0d,0x02,0x00,0x02,0xa0,0xc0,0x80,0x01,0x01,0xc0,0x00,0x01, 0x83,0xff,0x3f,0x02,0xb2,0x40,0x80,0x01,0x99,0x01,0xc0,0x01,0xbd,0x00,0x80,0x01, 0x29,0x00,0x80,0x01,0x17,0x01,0x40,0x00,0x3d,0x01,0x80,0x01,0x29,0x00,0x80,0x01, 0x29,0x00,0x80,0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x01,0x2d,0x00,0x00,0x01,0x31, 0x00,0x00,0x01,0x30,0x00,0x00,0x00,0x05,0x00,0x07,0x40,0x73,0x74,0x61,0x74,0x75, 0x73,0x00,0x00,0x02,0x3d,0x3d,0x00,0x00,0x05,0x40,0x67,0x70,0x69,0x6f,0x00,0x00, 0x04,0x72,0x65,0x61,0x64,0x00,0x00,0x0b,0x40,0x70,0x6f,0x72,0x74,0x5f,0x6f,0x6e, 0x6f,0x66,0x66,0x00,0x00,0x00,0x00,0x85,0x00,0x01,0x00,0x03,0x00,0x04,0x00,0x00, 0x00,0x0e,0x00,0x00,0x48,0x00,0x80,0x00,0xc0,0x00,0x00,0x01,0x46,0x00,0x80,0x00, 0x48,0x00,0x80,0x00,0xc0,0x02,0x00,0x01,0x46,0x40,0x80,0x00,0x48,0x00,0x80,0x00, 0xc0,0x04,0x00,0x01,0x46,0x80,0x80,0x00,0x48,0x00,0x80,0x00,0xc0,0x06,0x00,0x01, 0x46,0xc0,0x80,0x00,0x84,0x01,0x80,0x00,0x29,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x04,0x00,0x0a,0x69,0x6e,0x69,0x74,0x69,0x61,0x6c,0x69,0x7a,0x65, 0x00,0x00,0x04,0x72,0x65,0x61,0x64,0x00,0x00,0x0a,0x67,0x65,0x74,0x5f,0x73,0x74, 0x61,0x74,0x75,0x73,0x00,0x00,0x0f,0x67,0x65,0x74,0x5f,0x74,0x65,0x6d,0x70,0x65, 0x72,0x61,0x74,0x75,0x72,0x65,0x00,0x00,0x00,0x00,0x8a,0x00,0x02,0x00,0x07,0x00, 0x00,0x00,0x00,0x00,0x0d,0x00,0x00,0x00,0x26,0x00,0x00,0x00,0x83,0x23,0x40,0x01, 0x0e,0x00,0x00,0x01,0x03,0x00,0x40,0x01,0x8e,0x00,0x00,0x01,0x91,0x01,0x80,0x01, 0x13,0x01,0x80,0x01,0x91,0x01,0x00,0x02,0x13,0x02,0x00,0x02,0x02,0x00,0x80,0x02, 0x05,0x00,0x00,0x03,0xa4,0x01,0x00,0x01,0x29,0x00,0x00,0x01,0x00,0x00,0x00,0x01, 0x01,0x00,0x06,0x31,0x30,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x05,0x00,0x0b,0x40, 0x73,0x65,0x6e,0x73,0x6f,0x72,0x5f,0x61,0x64,0x64,0x00,0x00,0x07,0x40,0x73,0x74, 0x61,0x74,0x75,0x73,0x00,0x00,0x04,0x4d,0x46,0x53,0x32,0x00,0x00,0x06,0x53,0x65, 0x6e,0x73,0x6f,0x72,0x00,0x00,0x08,0x50,0x49,0x4e,0x5f,0x4c,0x4f,0x43,0x32,0x00, 0x00,0x00,0x00,0x40,0x00,0x03,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00, 0x26,0x00,0x00,0x02,0x0d,0x00,0x00,0x02,0x01,0x40,0x80,0x02,0x05,0x00,0x00,0x03, 0x24,0x01,0x80,0x01,0x29,0x00,0x80,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x00,0x0b,0x40,0x73,0x65,0x6e,0x73,0x6f,0x72,0x5f,0x61,0x64,0x64,0x00,0x00,0x00, 0x00,0xa8,0x00,0x04,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x1b,0x26,0x00,0x00,0x00, 0x06,0x00,0x00,0x02,0x03,0x01,0xc0,0x02,0xa0,0x00,0x00,0x02,0x01,0x00,0x01,0x01, 0x83,0xff,0xbf,0x02,0xb3,0x40,0x00,0x02,0x99,0x01,0x40,0x02,0x83,0xff,0x3f,0x02, 0x0e,0x01,0x00,0x02,0x17,0x07,0x40,0x00,0x01,0x80,0x00,0x02,0x83,0x2f,0xc0,0x02, 0xa0,0xc0,0x00,0x02,0x03,0x02,0xc0,0x02,0xa0,0x00,0x01,0x02,0x01,0x00,0x81,0x01, 0x83,0x00,0xc0,0x02,0xb5,0x40,0x01,0x02,0x99,0x01,0x40,0x02,0x83,0xff,0x3f,0x02, 0x0e,0x01,0x00,0x02,0x17,0x01,0x40,0x00,0x03,0x00,0x40,0x02,0x0e,0x01,0x00,0x02, 0x0d,0x01,0x00,0x02,0x29,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06, 0x00,0x04,0x72,0x65,0x61,0x64,0x00,0x00,0x01,0x3c,0x00,0x00,0x07,0x40,0x73,0x74, 0x61,0x74,0x75,0x73,0x00,0x00,0x01,0x26,0x00,0x00,0x02,0x3e,0x3e,0x00,0x00,0x01, 0x3e,0x00,0x00,0x00,0x01,0xa3,0x00,0x07,0x00,0x0b,0x00,0x00,0x00,0x00,0x00,0x3d, 0x26,0x00,0x00,0x00,0x0d,0x00,0x80,0x03,0x83,0xff,0x3f,0x04,0xb2,0x40,0x80,0x03, 0x99,0x01,0xc0,0x03,0x3d,0x00,0x80,0x03,0x29,0x00,0x80,0x03,0x17,0x1a,0x40,0x00, 0x06,0x00,0x80,0x03,0x83,0xff,0x3f,0x04,0xa0,0x80,0x80,0x03,0x01,0xc0,0x01,0x01, 0x06,0x00,0x80,0x03,0x03,0x00,0x40,0x04,0xa0,0x80,0x80,0x03,0x01,0xc0,0x81,0x01, 0x01,0x80,0x80,0x03,0x83,0x03,0x40,0x04,0xa0,0xc0,0x80,0x03,0x01,0xc0,0x01,0x02, 0x01,0xc0,0x00,0x04,0xa0,0x00,0x81,0x03,0x01,0xc0,0x01,0x02,0x03,0x01,0x40,0x04, 0xa0,0x40,0x81,0x03,0x01,0xc0,0x01,0x02,0x83,0xff,0x47,0x04,0xa0,0x80,0x81,0x03, 0x83,0xff,0x3f,0x04,0xb5,0xc0,0x81,0x03,0x19,0x04,0xc0,0x03,0xbd,0x00,0x80,0x02, 0x01,0x00,0x81,0x03,0x83,0xff,0x4f,0x04,0xae,0x00,0x82,0x03,0x83,0x07,0x40,0x04, 0xb1,0x40,0x82,0x03,0x01,0xc0,0x01,0x03,0x97,0x02,0x40,0x00,0x3d,0x01,0x80,0x02, 0x01,0x00,0x81,0x03,0x83,0x07,0x40,0x04,0xb1,0x40,0x82,0x03,0x01,0xc0,0x01,0x03, 0x01,0x80,0x81,0x03,0x82,0x01,0x00,0x04,0xb5,0xc0,0x81,0x03,0x99,0x01,0xc0,0x03, 0x01,0x80,0x81,0x03,0x02,0x02,0x00,0x04,0xb3,0x80,0x82,0x03,0x99,0x00,0xc0,0x03, 0x3d,0x01,0x80,0x02,0x01,0x40,0x81,0x03,0xbd,0x02,0x00,0x04,0x01,0x80,0x81,0x04, 0x20,0x40,0x83,0x04,0xa0,0x00,0x03,0x04,0xac,0xc0,0x82,0x03,0x29,0x00,0x80,0x03, 0x29,0x00,0x80,0x03,0x00,0x00,0x00,0x06,0x00,0x00,0x06,0x2b,0x2d,0x2d,0x2d,0x2e, 0x2d,0x00,0x00,0x01,0x2d,0x00,0x00,0x01,0x2b,0x02,0x00,0x18,0x2d,0x35,0x2e,0x30, 0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x33,0x65, 0x2d,0x30,0x30,0x32,0x02,0x00,0x17,0x35,0x2e,0x30,0x30,0x30,0x30,0x30,0x30,0x30, 0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x33,0x65,0x2d,0x30,0x30,0x32,0x00,0x00, 0x06,0x25,0x30,0x35,0x2e,0x31,0x66,0x00,0x00,0x00,0x0e,0x00,0x07,0x40,0x73,0x74, 0x61,0x74,0x75,0x73,0x00,0x00,0x02,0x3d,0x3d,0x00,0x00,0x04,0x72,0x65,0x61,0x64, 0x00,0x00,0x02,0x3c,0x3c,0x00,0x00,0x01,0x7c,0x00,0x00,0x02,0x3e,0x3e,0x00,0x00, 0x01,0x26,0x00,0x00,0x01,0x3e,0x00,0x00,0x01,0x2d,0x00,0x00,0x01,0x2f,0x00,0x00, 0x01,0x3c,0x00,0x00,0x01,0x2b,0x00,0x00,0x01,0x25,0x00,0x00,0x03,0x61,0x62,0x73, 0x00,0x00,0x00,0x00,0xa2,0x00,0x01,0x00,0x03,0x00,0x05,0x00,0x00,0x00,0x12,0x00, 0x48,0x00,0x80,0x00,0xc0,0x00,0x00,0x01,0x46,0x00,0x80,0x00,0x48,0x00,0x80,0x00, 0xc0,0x02,0x00,0x01,0x46,0x40,0x80,0x00,0x48,0x00,0x80,0x00,0xc0,0x04,0x00,0x01, 0x46,0x80,0x80,0x00,0x48,0x00,0x80,0x00,0xc0,0x06,0x00,0x01,0x46,0xc0,0x80,0x00, 0x06,0x00,0x80,0x00,0x47,0x40,0x80,0x00,0xc0,0x08,0x00,0x01,0x46,0x00,0x81,0x00, 0x04,0x02,0x80,0x00,0x29,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05, 0x00,0x0a,0x69,0x6e,0x69,0x74,0x69,0x61,0x6c,0x69,0x7a,0x65,0x00,0x00,0x04,0x72, 0x65,0x61,0x64,0x00,0x00,0x0b,0x67,0x65,0x74,0x5f,0x6d,0x65,0x73,0x73,0x61,0x67, 0x65,0x00,0x00,0x14,0x73,0x65,0x6e,0x64,0x5f,0x66,0x72,0x61,0x6d,0x65,0x31,0x30, 0x5f,0x6d,0x65,0x73,0x73,0x61,0x67,0x65,0x00,0x00,0x04,0x6f,0x70,0x65,0x6e,0x00, 0x00,0x00,0x00,0x60,0x00,0x02,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x09,0x00,0x00, 0x26,0x00,0x00,0x00,0x91,0x00,0x80,0x01,0x13,0x00,0x80,0x01,0x91,0x00,0x00,0x02, 0x13,0x01,0x00,0x02,0x02,0x00,0x80,0x02,0x05,0x00,0x00,0x03,0xa4,0x01,0x00,0x01, 0x29,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x01,0x00,0x06,0x31,0x31,0x35,0x32,0x30, 0x30,0x00,0x00,0x00,0x03,0x00,0x04,0x4d,0x46,0x53,0x33,0x00,0x00,0x04,0x58,0x62, 0x65,0x65,0x00,0x00,0x08,0x50,0x49,0x4e,0x5f,0x4c,0x4f,0x43,0x32,0x00,0x00,0x00, 0x00,0x5b,0x00,0x03,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x0e,0x26,0x00,0x00,0x00, 0x05,0x00,0x00,0x02,0x24,0x00,0x80,0x01,0x01,0xc0,0x00,0x01,0x03,0x3e,0x40,0x02, 0xb2,0x00,0x80,0x01,0x19,0x03,0xc0,0x01,0x05,0x00,0x00,0x02,0x24,0x00,0x80,0x01, 0x01,0xc0,0x00,0x01,0x83,0x0f,0x40,0x02,0xa0,0x40,0x80,0x01,0x01,0xc0,0x00,0x01, 0x29,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,0x3d,0x3d, 0x00,0x00,0x01,0x5e,0x00,0x00,0x00,0x01,0x89,0x00,0x0b,0x00,0x10,0x00,0x05,0x00, 0x00,0x00,0x46,0x00,0x26,0x00,0x00,0x00,0x06,0x00,0x80,0x05,0x40,0x01,0x00,0x06, 0x21,0x00,0x80,0x05,0x83,0xff,0x3f,0x01,0x83,0xff,0xbf,0x05,0x03,0x00,0x40,0x06, 0x41,0xc0,0x82,0x05,0x40,0x03,0x00,0x06,0x21,0x40,0x80,0x05,0x06,0x00,0x80,0x05, 0x20,0x80,0x80,0x05,0x01,0xc0,0x82,0x02,0x83,0x47,0x40,0x06,0xb2,0xc0,0x80,0x05, 0x99,0x18,0xc0,0x05,0x37,0xc0,0x02,0x03,0x83,0x03,0xc0,0x05,0x2d,0x01,0x81,0x05, 0xad,0x00,0x81,0x05,0x40,0x05,0x00,0x06,0x21,0x40,0x81,0x05,0x01,0x80,0x80,0x05, 0x2f,0x86,0x81,0x05,0x01,0xc0,0x82,0x03,0x06,0x00,0x80,0x05,0x20,0x80,0x80,0x05, 0x01,0xc0,0x02,0x02,0x01,0x80,0x81,0x05,0x01,0x00,0x01,0x06,0xa0,0xc0,0x81,0x05, 0x01,0x00,0x81,0x05,0x20,0x00,0x82,0x05,0x01,0xc0,0x02,0x04,0x01,0xc0,0x81,0x05, 0xaf,0x80,0x81,0x05,0x40,0x07,0x00,0x06,0x21,0x40,0x81,0x05,0x06,0x00,0x80,0x05, 0x20,0x80,0x80,0x05,0x01,0xc0,0x82,0x04,0x83,0x47,0xc0,0x05,0x01,0x80,0x01,0x06, 0x40,0x09,0x80,0x06,0x21,0x40,0x02,0x06,0xac,0x00,0x81,0x05,0x01,0xc0,0x02,0x05, 0x01,0x40,0x82,0x05,0x03,0x7f,0x40,0x06,0x01,0x80,0x82,0x06,0x03,0x7f,0x40,0x07, 0xa0,0x80,0x82,0x06,0xae,0x80,0x01,0x06,0xb2,0xc0,0x80,0x05,0x99,0x02,0xc0,0x05, 0x01,0x40,0x81,0x05,0x01,0x00,0x02,0x06,0x37,0xc1,0x82,0x05,0x29,0x00,0x80,0x05, 0x17,0x02,0x40,0x00,0x01,0x40,0x81,0x05,0x3d,0x00,0x00,0x06,0x37,0xc1,0x82,0x05, 0x29,0x00,0x80,0x05,0x17,0x02,0x40,0x00,0x01,0x40,0x81,0x05,0xbd,0x00,0x00,0x06, 0x37,0xc1,0x82,0x05,0x29,0x00,0x80,0x05,0x29,0x00,0x80,0x05,0x00,0x00,0x00,0x02, 0x00,0x00,0x05,0x66,0x61,0x6c,0x73,0x65,0x00,0x00,0x0a,0x64,0x6f,0x6e,0x27,0x74, 0x20,0x63,0x61,0x72,0x65,0x00,0x00,0x00,0x0b,0x00,0x04,0x6c,0x6f,0x6f,0x70,0x00, 0x00,0x04,0x65,0x61,0x63,0x68,0x00,0x00,0x04,0x72,0x65,0x61,0x64,0x00,0x00,0x02, 0x3d,0x3d,0x00,0x00,0x01,0x2b,0x00,0x00,0x05,0x74,0x69,0x6d,0x65,0x73,0x00,0x00, 0x01,0x2d,0x00,0x00,0x02,0x3c,0x3c,0x00,0x00,0x03,0x63,0x68,0x72,0x00,0x00,0x06, 0x69,0x6e,0x6a,0x65,0x63,0x74,0x00,0x00,0x01,0x26,0x00,0x00,0x00,0x00,0x4e,0x00, 0x02,0x00,0x05,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x06,0x00,0x00,0x01, 0x20,0x00,0x00,0x01,0x01,0x80,0x80,0x00,0x83,0x3e,0xc0,0x01,0xb2,0x40,0x00,0x01, 0x19,0x01,0x40,0x01,0x29,0x40,0x00,0x01,0x97,0x00,0x40,0x00,0x05,0x00,0x00,0x01, 0x29,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x04,0x72,0x65, 0x61,0x64,0x00,0x00,0x02,0x3d,0x3d,0x00,0x00,0x00,0x00,0x72,0x00,0x01,0x00,0x08, 0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x26,0x00,0x00,0x02,0x16,0xc0,0x80,0x00, 0x06,0x00,0x00,0x01,0x20,0x00,0x00,0x01,0x16,0x00,0x01,0x01,0x15,0x80,0x00,0x01, 0x15,0x00,0x81,0x01,0x83,0x03,0x40,0x02,0x15,0xc0,0x80,0x02,0x83,0x03,0x40,0x03, 0xb0,0xc0,0x80,0x02,0xae,0x80,0x00,0x02,0xa0,0x40,0x80,0x01,0xa0,0x00,0x01,0x01, 0x16,0x80,0x00,0x01,0x29,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05, 0x00,0x04,0x72,0x65,0x61,0x64,0x00,0x00,0x02,0x3c,0x3c,0x00,0x00,0x01,0x2d,0x00, 0x00,0x01,0x2a,0x00,0x00,0x01,0x7c,0x00,0x00,0x00,0x00,0x42,0x00,0x01,0x00,0x04, 0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0x06,0x00,0x80,0x00,0x20,0x00,0x80,0x00, 0x16,0x00,0x81,0x00,0x15,0x80,0x81,0x00,0x15,0x00,0x01,0x01,0xa0,0x40,0x80,0x00, 0x29,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x04,0x72,0x65, 0x61,0x64,0x00,0x00,0x02,0x3c,0x3c,0x00,0x00,0x00,0x00,0x60,0x00,0x01,0x00,0x04, 0x00,0x00,0x00,0x00,0x00,0x0c,0x00,0x00,0x06,0x00,0x80,0x00,0x20,0x00,0x80,0x00, 0x16,0x00,0x81,0x00,0x15,0x80,0x81,0x00,0x15,0x00,0x01,0x01,0xa0,0x40,0x80,0x00, 0x15,0x00,0x82,0x00,0x15,0x00,0x01,0x01,0x20,0x80,0x00,0x01,0xac,0xc0,0x80,0x00, 0x16,0x00,0x82,0x00,0x29,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04, 0x00,0x04,0x72,0x65,0x61,0x64,0x00,0x00,0x02,0x3c,0x3c,0x00,0x00,0x03,0x63,0x68, 0x72,0x00,0x00,0x01,0x2b,0x00,0x00,0x00,0x00,0x32,0x00,0x04,0x00,0x07,0x00,0x00, 0x00,0x00,0x00,0x05,0x26,0x00,0x00,0x04,0x01,0x40,0x00,0x02,0x01,0x80,0x80,0x02, 0xac,0x00,0x00,0x02,0x29,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, 0x00,0x01,0x2b,0x00,0x00,0x00,0x01,0x92,0x00,0x0a,0x00,0x0e,0x00,0x05,0x00,0x00, 0x00,0x42,0x00,0x00,0x26,0x00,0x00,0x02,0x83,0x06,0x40,0x05,0x01,0x40,0x80,0x05, 0x20,0x40,0x80,0x05,0xac,0x00,0x00,0x05,0x01,0x80,0x82,0x01,0x83,0x3e,0x40,0x05, 0xb7,0x80,0x02,0x02,0x83,0xff,0x3f,0x05,0x03,0x00,0xc0,0x05,0x41,0x80,0x02,0x05, 0x40,0x01,0x80,0x05,0x21,0x80,0x00,0x05,0x83,0x07,0x40,0x05,0x91,0x01,0x80,0x05, 0x37,0x81,0x82,0x03,0x83,0xff,0x3f,0x05,0x03,0x01,0xc0,0x05,0x41,0x80,0x02,0x05, 0x40,0x03,0x80,0x05,0x21,0x80,0x00,0x05,0x83,0xff,0x3f,0x05,0x03,0x01,0xc0,0x05, 0x41,0x80,0x02,0x05,0x40,0x05,0x80,0x05,0x21,0x80,0x00,0x05,0x01,0xc0,0x01,0x05, 0x91,0x02,0x80,0x05,0xa0,0x00,0x01,0x05,0x11,0x03,0x80,0x05,0xa0,0x00,0x01,0x05, 0x91,0x03,0x80,0x05,0xa0,0x00,0x01,0x05,0x11,0x04,0x80,0x05,0xa0,0x00,0x01,0x05, 0x01,0xc0,0x01,0x05,0x40,0x07,0x80,0x05,0x21,0x40,0x02,0x05,0x01,0x80,0x02,0x04, 0x01,0xc0,0x01,0x05,0x01,0x40,0x80,0x05,0xa0,0x00,0x01,0x05,0x01,0x00,0x02,0x05, 0x01,0x40,0x80,0x05,0x20,0x80,0x82,0x05,0x40,0x09,0x00,0x06,0x21,0x40,0x82,0x05, 0xac,0x00,0x00,0x05,0x01,0x80,0x02,0x04,0x03,0x7f,0x40,0x05,0x01,0x00,0x82,0x05, 0x03,0x7f,0x40,0x06,0xa0,0x00,0x83,0x05,0xae,0xc0,0x02,0x05,0x01,0x80,0x02,0x03, 0x01,0xc0,0x01,0x05,0x01,0x80,0x81,0x05,0xa0,0x00,0x01,0x05,0x01,0x00,0x01,0x05, 0x01,0xc0,0x81,0x05,0xac,0x00,0x00,0x05,0x01,0x80,0x82,0x04,0x06,0x00,0x00,0x05, 0x01,0x40,0x82,0x05,0xa0,0x40,0x03,0x05,0x29,0x00,0x00,0x05,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x0e,0x00,0x01,0x2b,0x00,0x00,0x08,0x62,0x79,0x74,0x65,0x73,0x69, 0x7a,0x65,0x00,0x00,0x04,0x65,0x61,0x63,0x68,0x00,0x00,0x08,0x46,0x52,0x41,0x4d, 0x45,0x5f,0x49,0x44,0x00,0x00,0x02,0x3c,0x3c,0x00,0x00,0x08,0x41,0x44,0x44,0x31, 0x36,0x5f,0x48,0x49,0x00,0x00,0x08,0x41,0x44,0x44,0x31,0x36,0x5f,0x4c,0x4f,0x00, 0x00,0x0a,0x42,0x52,0x4f,0x41,0x44,0x43,0x5f,0x52,0x41,0x44,0x00,0x00,0x03,0x4f, 0x50,0x54,0x00,0x00,0x06,0x69,0x6e,0x6a,0x65,0x63,0x74,0x00,0x00,0x05,0x62,0x79, 0x74,0x65,0x73,0x00,0x00,0x01,0x2d,0x00,0x00,0x01,0x26,0x00,0x00,0x05,0x77,0x72, 0x69,0x74,0x65,0x00,0x00,0x00,0x00,0x70,0x00,0x01,0x00,0x07,0x00,0x00,0x00,0x00, 0x00,0x10,0x00,0x00,0x26,0x00,0x00,0x02,0x16,0x40,0x81,0x00,0x15,0xc0,0x00,0x01, 0x83,0x03,0xc0,0x01,0x15,0x40,0x01,0x02,0x83,0x03,0xc0,0x02,0xb0,0x80,0x00,0x02, 0xae,0x40,0x80,0x01,0xa0,0x00,0x00,0x01,0x03,0x7f,0xc0,0x01,0xa0,0xc0,0x00,0x01, 0x16,0x80,0x01,0x01,0x15,0x00,0x01,0x01,0x15,0x80,0x81,0x01,0xa0,0x00,0x01,0x01, 0x29,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x02,0x3e,0x3e, 0x00,0x00,0x01,0x2d,0x00,0x00,0x01,0x2a,0x00,0x00,0x01,0x26,0x00,0x00,0x02,0x3c, 0x3c,0x00,0x00,0x00,0x00,0x7b,0x00,0x01,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x10, 0x26,0x00,0x00,0x02,0x16,0x40,0x81,0x00,0x11,0x00,0x00,0x01,0x83,0x0b,0xc0,0x01, 0x15,0x40,0x01,0x02,0x83,0x03,0xc0,0x02,0xb0,0xc0,0x00,0x02,0xae,0x80,0x80,0x01, 0xa0,0x40,0x00,0x01,0x03,0x7f,0xc0,0x01,0xa0,0x00,0x01,0x01,0x16,0x80,0x01,0x01, 0x15,0xc0,0x01,0x01,0x15,0x80,0x81,0x01,0xa0,0x40,0x01,0x01,0x29,0x00,0x00,0x01, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x08,0x41,0x44,0x44,0x36,0x34,0x5f, 0x48,0x49,0x00,0x00,0x02,0x3e,0x3e,0x00,0x00,0x01,0x2d,0x00,0x00,0x01,0x2a,0x00, 0x00,0x01,0x26,0x00,0x00,0x02,0x3c,0x3c,0x00,0x00,0x00,0x00,0x7b,0x00,0x01,0x00, 0x07,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x26,0x00,0x00,0x02,0x16,0x40,0x81,0x00, 0x11,0x00,0x00,0x01,0x83,0x0b,0xc0,0x01,0x15,0x40,0x01,0x02,0x83,0x03,0xc0,0x02, 0xb0,0xc0,0x00,0x02,0xae,0x80,0x80,0x01,0xa0,0x40,0x00,0x01,0x03,0x7f,0xc0,0x01, 0xa0,0x00,0x01,0x01,0x16,0x80,0x01,0x01,0x15,0xc0,0x01,0x01,0x15,0x80,0x81,0x01, 0xa0,0x40,0x01,0x01,0x29,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06, 0x00,0x08,0x41,0x44,0x44,0x36,0x34,0x5f,0x4c,0x4f,0x00,0x00,0x02,0x3e,0x3e,0x00, 0x00,0x01,0x2d,0x00,0x00,0x01,0x2a,0x00,0x00,0x01,0x26,0x00,0x00,0x02,0x3c,0x3c, 0x00,0x00,0x00,0x00,0x32,0x00,0x04,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x05,0x00, 0x26,0x00,0x00,0x04,0x01,0x40,0x00,0x02,0x01,0x80,0x80,0x02,0xac,0x00,0x00,0x02, 0x29,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x2b,0x00, 0x00,0x00,0x00,0x32,0x00,0x04,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x00, 0x26,0x00,0x00,0x04,0x01,0x40,0x00,0x02,0x01,0x80,0x80,0x02,0xac,0x00,0x00,0x02, 0x29,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x2b,0x00, 0x00,0x00,0x00,0x37,0x00,0x02,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00, 0x26,0x00,0x00,0x00,0x11,0x00,0x00,0x01,0x20,0x40,0x00,0x01,0x29,0x00,0x00,0x01, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x04,0x58,0x62,0x65,0x65,0x00,0x00, 0x03,0x6e,0x65,0x77,0x00,0x00,0x00,0x00,0x68,0x00,0x01,0x00,0x03,0x00,0x03,0x00, 0x00,0x00,0x0b,0x00,0x48,0x00,0x80,0x00,0xc0,0x00,0x00,0x01,0x46,0x00,0x80,0x00, 0x48,0x00,0x80,0x00,0xc0,0x02,0x00,0x01,0x46,0x40,0x80,0x00,0x48,0x00,0x80,0x00, 0xc0,0x04,0x00,0x01,0x46,0x80,0x80,0x00,0x04,0x01,0x80,0x00,0x29,0x00,0x80,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x0a,0x69,0x6e,0x69,0x74,0x69,0x61, 0x6c,0x69,0x7a,0x65,0x00,0x00,0x04,0x6d,0x61,0x69,0x6e,0x00,0x00,0x0b,0x67,0x65, 0x74,0x5f,0x6d,0x65,0x73,0x73,0x61,0x67,0x65,0x00,0x00,0x00,0x00,0xe1,0x00,0x02, 0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x11,0x26,0x00,0x00,0x00,0x11,0x00,0x00,0x01, 0x8e,0x00,0x00,0x01,0x11,0x01,0x00,0x01,0x8e,0x01,0x00,0x01,0x11,0x02,0x00,0x01, 0x20,0x40,0x01,0x01,0x0e,0x03,0x00,0x01,0x91,0x03,0x00,0x01,0x20,0x40,0x01,0x01, 0x0e,0x04,0x00,0x01,0x91,0x04,0x00,0x01,0x20,0x80,0x02,0x01,0x8e,0x05,0x00,0x01, 0x11,0x06,0x00,0x01,0x20,0x40,0x03,0x01,0x29,0x00,0x00,0x01,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x0e,0x00,0x0a,0x54,0x45,0x4d,0x50,0x54,0x48,0x52,0x5f,0x48,0x49, 0x00,0x00,0x0d,0x40,0x74,0x68,0x72,0x65,0x73,0x68,0x6f,0x6c,0x64,0x5f,0x68,0x69, 0x00,0x00,0x0a,0x54,0x45,0x4d,0x50,0x54,0x48,0x52,0x5f,0x4c,0x4f,0x00,0x00,0x0d, 0x40,0x74,0x68,0x72,0x65,0x73,0x68,0x6f,0x6c,0x64,0x5f,0x6c,0x6f,0x00,0x00,0x03, 0x46,0x61,0x6e,0x00,0x00,0x03,0x6e,0x65,0x77,0x00,0x00,0x04,0x40,0x66,0x61,0x6e, 0x00,0x00,0x06,0x53,0x65,0x6e,0x73,0x6f,0x72,0x00,0x00,0x07,0x40,0x73,0x65,0x6e, 0x73,0x6f,0x72,0x00,0x00,0x04,0x58,0x62,0x65,0x65,0x00,0x00,0x04,0x6f,0x70,0x65, 0x6e,0x00,0x00,0x05,0x40,0x78,0x62,0x65,0x65,0x00,0x00,0x02,0x47,0x43,0x00,0x00, 0x05,0x73,0x74,0x61,0x72,0x74,0x00,0x00,0x00,0x01,0xd2,0x00,0x09,0x00,0x0c,0x00, 0x00,0x00,0x00,0x00,0x3d,0x00,0x00,0x00,0x26,0x00,0x00,0x00,0x0d,0x00,0x80,0x04, 0x20,0x40,0x80,0x04,0x01,0x40,0x02,0x01,0x0d,0x01,0x80,0x04,0x20,0x40,0x80,0x04, 0x01,0x40,0x82,0x01,0x01,0x80,0x80,0x04,0x03,0x00,0x40,0x05,0xa0,0xc0,0x80,0x04, 0x01,0xc0,0x00,0x05,0xa0,0x00,0x81,0x04,0x20,0x40,0x81,0x04,0x01,0x40,0x02,0x02, 0x0d,0x00,0x80,0x04,0x20,0x80,0x81,0x04,0x01,0x40,0x82,0x02,0x0d,0x01,0x80,0x04, 0x20,0xc0,0x81,0x04,0x01,0x40,0x02,0x03,0x01,0xc0,0x80,0x04,0x83,0xff,0x3f,0x05, 0xb2,0x00,0x82,0x04,0x19,0x01,0xc0,0x04,0x3d,0x00,0x80,0x03,0x97,0x07,0x40,0x00, 0x01,0x80,0x81,0x04,0x20,0x40,0x82,0x04,0x8d,0x05,0x00,0x05,0xb5,0x80,0x82,0x04, 0x19,0x01,0xc0,0x04,0xbd,0x00,0x80,0x03,0x17,0x04,0x40,0x00,0x01,0x80,0x81,0x04, 0x20,0x40,0x82,0x04,0x8d,0x06,0x00,0x05,0xb3,0x00,0x83,0x04,0x19,0x01,0xc0,0x04, 0x3d,0x01,0x80,0x03,0x97,0x00,0x40,0x00,0xbd,0x01,0x80,0x03,0x01,0x00,0x81,0x04, 0x3d,0x02,0x00,0x05,0xac,0x80,0x83,0x04,0x01,0x40,0x01,0x05,0xac,0x80,0x83,0x04, 0x3d,0x02,0x00,0x05,0xac,0x80,0x83,0x04,0x01,0x80,0x01,0x05,0xac,0x80,0x83,0x04, 0x3d,0x02,0x00,0x05,0xac,0x80,0x83,0x04,0x01,0xc0,0x01,0x05,0xac,0x80,0x83,0x04, 0x01,0x40,0x02,0x04,0x8d,0x07,0x80,0x04,0x01,0x00,0x02,0x05,0xa0,0x00,0x84,0x04, 0x91,0x08,0x80,0x04,0x20,0x80,0x84,0x04,0x29,0x00,0x80,0x04,0x00,0x00,0x00,0x05, 0x00,0x00,0x01,0x2d,0x00,0x00,0x01,0x31,0x00,0x00,0x01,0x32,0x00,0x00,0x01,0x30, 0x00,0x00,0x01,0x2c,0x00,0x00,0x00,0x13,0x00,0x04,0x40,0x66,0x61,0x6e,0x00,0x00, 0x0a,0x67,0x65,0x74,0x5f,0x73,0x74,0x61,0x74,0x75,0x73,0x00,0x00,0x07,0x40,0x73, 0x65,0x6e,0x73,0x6f,0x72,0x00,0x00,0x02,0x3c,0x3c,0x00,0x00,0x01,0x7c,0x00,0x00, 0x04,0x74,0x6f,0x5f,0x73,0x00,0x00,0x09,0x67,0x65,0x74,0x5f,0x6f,0x6e,0x6f,0x66, 0x66,0x00,0x00,0x0f,0x67,0x65,0x74,0x5f,0x74,0x65,0x6d,0x70,0x65,0x72,0x61,0x74, 0x75,0x72,0x65,0x00,0x00,0x02,0x3d,0x3d,0x00,0x00,0x04,0x74,0x6f,0x5f,0x66,0x00, 0x00,0x01,0x3e,0x00,0x00,0x0d,0x40,0x74,0x68,0x72,0x65,0x73,0x68,0x6f,0x6c,0x64, 0x5f,0x68,0x69,0x00,0x00,0x01,0x3c,0x00,0x00,0x0d,0x40,0x74,0x68,0x72,0x65,0x73, 0x68,0x6f,0x6c,0x64,0x5f,0x6c,0x6f,0x00,0x00,0x01,0x2b,0x00,0x00,0x05,0x40,0x78, 0x62,0x65,0x65,0x00,0x00,0x14,0x73,0x65,0x6e,0x64,0x5f,0x66,0x72,0x61,0x6d,0x65, 0x31,0x30,0x5f,0x6d,0x65,0x73,0x73,0x61,0x67,0x65,0x00,0x00,0x02,0x47,0x43,0x00, 0x00,0x05,0x73,0x74,0x61,0x72,0x74,0x00,0x00,0x00,0x01,0x97,0x00,0x06,0x00,0x0a, 0x00,0x01,0x00,0x00,0x00,0x39,0x00,0x00,0x26,0x00,0x00,0x00,0x0d,0x00,0x00,0x03, 0x20,0x40,0x00,0x03,0x19,0x19,0x40,0x03,0x0d,0x00,0x00,0x03,0x20,0x80,0x00,0x03, 0x3a,0x80,0x01,0x01,0xba,0x80,0x81,0x01,0x01,0x80,0x00,0x03,0x83,0x47,0xc0,0x03, 0xb2,0xc0,0x00,0x03,0x19,0x14,0x40,0x03,0x01,0xc0,0x00,0x03,0x3d,0x00,0x80,0x03, 0xa0,0x00,0x01,0x03,0x19,0x12,0x40,0x03,0x01,0xc0,0x00,0x03,0xbd,0x00,0x80,0x03, 0xa0,0x40,0x01,0x03,0x01,0x80,0x01,0x02,0x83,0xff,0x3f,0x03,0x03,0x01,0xc0,0x03, 0x41,0x80,0x01,0x03,0x40,0x01,0x80,0x03,0x21,0x80,0x01,0x03,0x01,0x00,0x01,0x03, 0x03,0x00,0xc0,0x03,0xa0,0xc0,0x01,0x03,0x03,0x00,0xc0,0x03,0x01,0x80,0x01,0x04, 0xa0,0x00,0x82,0x03,0x98,0x00,0xc0,0x03,0x97,0x01,0x40,0x00,0x8d,0x04,0x80,0x03, 0x20,0x80,0x82,0x03,0x17,0x04,0x40,0x00,0x83,0xff,0xbf,0x03,0x01,0x80,0x01,0x04, 0xa0,0x00,0x82,0x03,0x98,0x00,0xc0,0x03,0x97,0x01,0x40,0x00,0x8d,0x04,0x80,0x03, 0x20,0xc0,0x82,0x03,0x17,0x00,0x40,0x00,0x01,0x00,0x81,0x03,0x83,0x00,0x40,0x04, 0xa0,0xc0,0x81,0x03,0x0e,0x06,0x80,0x03,0x01,0x00,0x81,0x03,0x03,0x01,0x40,0x04, 0xa0,0xc0,0x81,0x03,0x8e,0x06,0x80,0x03,0x0d,0x00,0x80,0x03,0x20,0x80,0x83,0x03, 0x91,0x07,0x80,0x03,0x20,0x00,0x84,0x03,0x29,0x00,0x80,0x03,0x00,0x00,0x00,0x02, 0x00,0x00,0x05,0x66,0x61,0x6c,0x73,0x65,0x00,0x00,0x01,0x2c,0x00,0x00,0x00,0x11, 0x00,0x05,0x40,0x78,0x62,0x65,0x65,0x00,0x00,0x09,0x72,0x65,0x63,0x65,0x69,0x76, 0x65,0x64,0x3f,0x00,0x00,0x0b,0x67,0x65,0x74,0x5f,0x6d,0x65,0x73,0x73,0x61,0x67, 0x65,0x00,0x00,0x02,0x3d,0x3d,0x00,0x00,0x02,0x21,0x3d,0x00,0x00,0x05,0x73,0x70, 0x6c,0x69,0x74,0x00,0x00,0x04,0x65,0x61,0x63,0x68,0x00,0x00,0x02,0x5b,0x5d,0x00, 0x00,0x03,0x3d,0x3d,0x3d,0x00,0x00,0x04,0x40,0x66,0x61,0x6e,0x00,0x00,0x02,0x6f, 0x6e,0x00,0x00,0x03,0x6f,0x66,0x66,0x00,0x00,0x0d,0x40,0x74,0x68,0x72,0x65,0x73, 0x68,0x6f,0x6c,0x64,0x5f,0x68,0x69,0x00,0x00,0x0d,0x40,0x74,0x68,0x72,0x65,0x73, 0x68,0x6f,0x6c,0x64,0x5f,0x6c,0x6f,0x00,0x00,0x05,0x66,0x6c,0x75,0x73,0x68,0x00, 0x00,0x02,0x47,0x43,0x00,0x00,0x05,0x73,0x74,0x61,0x72,0x74,0x00,0x00,0x00,0x00, 0xa8,0x00,0x01,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x1c,0x00,0x26,0x00,0x00,0x02, 0x16,0x40,0x81,0x00,0x15,0x40,0x01,0x01,0x83,0xff,0xbf,0x01,0xb2,0x00,0x00,0x01, 0x98,0x01,0x40,0x01,0x15,0x40,0x01,0x01,0x03,0x00,0xc0,0x01,0xb2,0x00,0x00,0x01, 0x99,0x04,0x40,0x01,0x15,0x00,0x01,0x01,0x15,0x40,0x81,0x01,0xa0,0x40,0x00,0x01, 0x20,0x80,0x00,0x01,0x15,0x00,0x81,0x01,0x15,0x40,0x01,0x02,0x01,0x80,0x80,0x02, 0x20,0xc1,0x80,0x01,0x17,0x04,0x40,0x00,0x15,0x00,0x01,0x01,0x15,0x40,0x81,0x01, 0xa0,0x40,0x00,0x01,0x20,0x00,0x01,0x01,0x15,0x00,0x81,0x01,0x15,0x40,0x01,0x02, 0x01,0x80,0x80,0x02,0x20,0xc1,0x80,0x01,0x29,0x00,0x00,0x01,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x05,0x00,0x02,0x3d,0x3d,0x00,0x00,0x02,0x5b,0x5d,0x00,0x00,0x04, 0x74,0x6f,0x5f,0x69,0x00,0x00,0x03,0x5b,0x5d,0x3d,0x00,0x00,0x04,0x74,0x6f,0x5f, 0x66,0x00,0x4c,0x56,0x41,0x52,0x00,0x00,0x02,0x06,0x00,0x00,0x00,0x20,0x00,0x01, 0x64,0x00,0x05,0x6f,0x6e,0x6f,0x66,0x66,0x00,0x07,0x63,0x6f,0x6d,0x6d,0x61,0x6e, 0x64,0x00,0x03,0x73,0x74,0x61,0x00,0x05,0x76,0x61,0x6c,0x5f,0x68,0x00,0x05,0x76, 0x61,0x6c,0x5f,0x6c,0x00,0x03,0x76,0x61,0x6c,0x00,0x02,0x70,0x6d,0x00,0x01,0x61, 0x00,0x03,0x6c,0x65,0x6e,0x00,0x01,0x69,0x00,0x04,0x74,0x79,0x70,0x65,0x00,0x03, 0x61,0x72,0x72,0x00,0x07,0x70,0x6c,0x64,0x73,0x69,0x7a,0x65,0x00,0x03,0x70,0x6c, 0x64,0x00,0x03,0x63,0x68,0x73,0x00,0x05,0x62,0x79,0x73,0x75,0x6d,0x00,0x03,0x73, 0x75,0x6d,0x00,0x01,0x6e,0x00,0x03,0x6d,0x65,0x73,0x00,0x04,0x61,0x72,0x72,0x31, 0x00,0x04,0x61,0x72,0x72,0x32,0x00,0x0a,0x66,0x61,0x6e,0x5f,0x73,0x74,0x61,0x74, 0x75,0x73,0x00,0x0d,0x73,0x65,0x6e,0x73,0x6f,0x72,0x5f,0x73,0x74,0x61,0x74,0x75, 0x73,0x00,0x0d,0x64,0x65,0x76,0x69,0x63,0x65,0x5f,0x73,0x74,0x61,0x74,0x75,0x73, 0x00,0x09,0x66,0x61,0x6e,0x5f,0x6f,0x6e,0x6f,0x66,0x66,0x00,0x0b,0x74,0x65,0x6d, 0x70,0x65,0x72,0x61,0x74,0x75,0x72,0x65,0x00,0x09,0x63,0x6f,0x6e,0x64,0x69,0x74, 0x69,0x6f,0x6e,0x00,0x07,0x70,0x61,0x79,0x6c,0x6f,0x61,0x64,0x00,0x0a,0x66,0x72, 0x61,0x6d,0x65,0x5f,0x74,0x79,0x70,0x65,0x00,0x07,0x6d,0x65,0x73,0x73,0x61,0x67, 0x65,0x00,0x0d,0x72,0x65,0x63,0x65,0x69,0x76,0x65,0x64,0x5f,0x64,0x61,0x74,0x61, 0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00, 0x00,0x00,0x00,0x02,0xff,0xff,0x00,0x00,0x00,0x01,0x00,0x02,0xff,0xff,0x00,0x00, 0x00,0x02,0x00,0x01,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x02, 0x00,0x03,0x00,0x03,0xff,0xff,0x00,0x00,0x00,0x04,0x00,0x02,0x00,0x05,0x00,0x03, 0x00,0x06,0x00,0x04,0x00,0x07,0x00,0x05,0x00,0x08,0x00,0x06,0xff,0xff,0x00,0x00, 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x02,0xff,0xff,0x00,0x00,0x00,0x09,0x00,0x02, 0x00,0x0a,0x00,0x03,0x00,0x00,0x00,0x04,0x00,0x0b,0x00,0x05,0x00,0x0c,0x00,0x06, 0x00,0x0d,0x00,0x07,0x00,0x0e,0x00,0x08,0x00,0x0f,0x00,0x09,0x00,0x10,0x00,0x0a, 0x00,0x00,0x00,0x01,0x00,0x11,0x00,0x01,0x00,0x12,0x00,0x02,0xff,0xff,0x00,0x00, 0x00,0x13,0x00,0x01,0xff,0xff,0x00,0x00,0x00,0x09,0x00,0x03,0x00,0x14,0x00,0x04, 0x00,0x0a,0x00,0x05,0x00,0x00,0x00,0x06,0x00,0x15,0x00,0x07,0x00,0x10,0x00,0x08, 0x00,0x0c,0x00,0x09,0x00,0x11,0x00,0x01,0x00,0x12,0x00,0x02,0xff,0xff,0x00,0x00, 0x00,0x11,0x00,0x01,0x00,0x12,0x00,0x02,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00, 0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0x00,0x16,0x00,0x02,0x00,0x17,0x00,0x03, 0x00,0x18,0x00,0x04,0x00,0x19,0x00,0x05,0x00,0x1a,0x00,0x06,0x00,0x1b,0x00,0x07, 0x00,0x1c,0x00,0x08,0xff,0xff,0x00,0x00,0x00,0x1d,0x00,0x02,0x00,0x1e,0x00,0x03, 0x00,0x1f,0x00,0x04,0x00,0x0a,0x00,0x05,0x45,0x4e,0x44,0x00,0x00,0x00,0x00,0x08, };
the_stack_data/382.c
#include <string.h> #include <stdint.h> #include <limits.h> #define ALIGN (sizeof(size_t)) #define ONES ((size_t)-1/UCHAR_MAX) #define HIGHS (ONES * (UCHAR_MAX/2+1)) #define HASZERO(x) ((x)-ONES & ~(x) & HIGHS) char *__stpcpy(char *restrict d, const char *restrict s) { #if defined(__GNUC__) && !(defined(__CHEERP__) && !defined(__ASMJS__)) typedef size_t __attribute__((__may_alias__)) word; word *wd; const word *ws; if ((uintptr_t)s % ALIGN == (uintptr_t)d % ALIGN) { for (; (uintptr_t)s % ALIGN; s++, d++) if (!(*d=*s)) return d; wd=(void *)d; ws=(const void *)s; for (; !HASZERO(*ws); *wd++ = *ws++); d=(void *)wd; s=(const void *)ws; } #endif for (; (*d=*s); s++, d++); return d; } weak_alias(__stpcpy, stpcpy);
the_stack_data/823915.c
// REQUIRES: zlib // Value profiling is currently not supported in lightweight mode. // RUN: %clang_pgogen -o %t.normal -mllvm --disable-vp=true %s // RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t.normal // RUN: llvm-profdata merge -o %t.normal.profdata %t.profraw // RUN: %clang_pgogen -o %t -g -mllvm --debug-info-correlate -mllvm --disable-vp=true %s // RUN: env LLVM_PROFILE_FILE=%t.proflite %run %t // RUN: llvm-profdata merge -o %t.profdata --debug-info=%t.dSYM %t.proflite // RUN: diff %t.normal.profdata %t.profdata int foo(int a) { if (a % 2) return 4 * a + 1; return 0; } int bar(int a) { while (a > 100) a /= 2; return a; } typedef int (*FP)(int); FP Fps[3] = {foo, bar}; int main() { for (int i = 0; i < 5; i++) Fps[i % 2](i); return 0; }
the_stack_data/215767345.c
/* f2c.h -- Standard Fortran to C header file */ /** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed." - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */ #ifndef F2C_INCLUDE #define F2C_INCLUDE #include <math.h> #include <stdlib.h> #include <string.h> #include <stdio.h> #include <complex.h> #ifdef complex #undef complex #endif #ifdef I #undef I #endif #if defined(_WIN64) typedef long long BLASLONG; typedef unsigned long long BLASULONG; #else typedef long BLASLONG; typedef unsigned long BLASULONG; #endif #ifdef LAPACK_ILP64 typedef BLASLONG blasint; #if defined(_WIN64) #define blasabs(x) llabs(x) #else #define blasabs(x) labs(x) #endif #else typedef int blasint; #define blasabs(x) abs(x) #endif typedef blasint integer; typedef unsigned int uinteger; typedef char *address; typedef short int shortint; typedef float real; typedef double doublereal; typedef struct { real r, i; } complex; typedef struct { doublereal r, i; } doublecomplex; static inline _Complex float Cf(complex *z) {return z->r + z->i*_Complex_I;} static inline _Complex double Cd(doublecomplex *z) {return z->r + z->i*_Complex_I;} static inline _Complex float * _pCf(complex *z) {return (_Complex float*)z;} static inline _Complex double * _pCd(doublecomplex *z) {return (_Complex double*)z;} #define pCf(z) (*_pCf(z)) #define pCd(z) (*_pCd(z)) typedef int logical; typedef short int shortlogical; typedef char logical1; typedef char integer1; #define TRUE_ (1) #define FALSE_ (0) /* Extern is for use with -E */ #ifndef Extern #define Extern extern #endif /* I/O stuff */ typedef int flag; typedef int ftnlen; typedef int ftnint; /*external read, write*/ typedef struct { flag cierr; ftnint ciunit; flag ciend; char *cifmt; ftnint cirec; } cilist; /*internal read, write*/ typedef struct { flag icierr; char *iciunit; flag iciend; char *icifmt; ftnint icirlen; ftnint icirnum; } icilist; /*open*/ typedef struct { flag oerr; ftnint ounit; char *ofnm; ftnlen ofnmlen; char *osta; char *oacc; char *ofm; ftnint orl; char *oblnk; } olist; /*close*/ typedef struct { flag cerr; ftnint cunit; char *csta; } cllist; /*rewind, backspace, endfile*/ typedef struct { flag aerr; ftnint aunit; } alist; /* inquire */ typedef struct { flag inerr; ftnint inunit; char *infile; ftnlen infilen; ftnint *inex; /*parameters in standard's order*/ ftnint *inopen; ftnint *innum; ftnint *innamed; char *inname; ftnlen innamlen; char *inacc; ftnlen inacclen; char *inseq; ftnlen inseqlen; char *indir; ftnlen indirlen; char *infmt; ftnlen infmtlen; char *inform; ftnint informlen; char *inunf; ftnlen inunflen; ftnint *inrecl; ftnint *innrec; char *inblank; ftnlen inblanklen; } inlist; #define VOID void union Multitype { /* for multiple entry points */ integer1 g; shortint h; integer i; /* longint j; */ real r; doublereal d; complex c; doublecomplex z; }; typedef union Multitype Multitype; struct Vardesc { /* for Namelist */ char *name; char *addr; ftnlen *dims; int type; }; typedef struct Vardesc Vardesc; struct Namelist { char *name; Vardesc **vars; int nvars; }; typedef struct Namelist Namelist; #define abs(x) ((x) >= 0 ? (x) : -(x)) #define dabs(x) (fabs(x)) #define f2cmin(a,b) ((a) <= (b) ? (a) : (b)) #define f2cmax(a,b) ((a) >= (b) ? (a) : (b)) #define dmin(a,b) (f2cmin(a,b)) #define dmax(a,b) (f2cmax(a,b)) #define bit_test(a,b) ((a) >> (b) & 1) #define bit_clear(a,b) ((a) & ~((uinteger)1 << (b))) #define bit_set(a,b) ((a) | ((uinteger)1 << (b))) #define abort_() { sig_die("Fortran abort routine called", 1); } #define c_abs(z) (cabsf(Cf(z))) #define c_cos(R,Z) { pCf(R)=ccos(Cf(Z)); } #define c_div(c, a, b) {pCf(c) = Cf(a)/Cf(b);} #define z_div(c, a, b) {pCd(c) = Cd(a)/Cd(b);} #define c_exp(R, Z) {pCf(R) = cexpf(Cf(Z));} #define c_log(R, Z) {pCf(R) = clogf(Cf(Z));} #define c_sin(R, Z) {pCf(R) = csinf(Cf(Z));} //#define c_sqrt(R, Z) {*(R) = csqrtf(Cf(Z));} #define c_sqrt(R, Z) {pCf(R) = csqrtf(Cf(Z));} #define d_abs(x) (fabs(*(x))) #define d_acos(x) (acos(*(x))) #define d_asin(x) (asin(*(x))) #define d_atan(x) (atan(*(x))) #define d_atn2(x, y) (atan2(*(x),*(y))) #define d_cnjg(R, Z) { pCd(R) = conj(Cd(Z)); } #define r_cnjg(R, Z) { pCf(R) = conj(Cf(Z)); } #define d_cos(x) (cos(*(x))) #define d_cosh(x) (cosh(*(x))) #define d_dim(__a, __b) ( *(__a) > *(__b) ? *(__a) - *(__b) : 0.0 ) #define d_exp(x) (exp(*(x))) #define d_imag(z) (cimag(Cd(z))) #define r_imag(z) (cimag(Cf(z))) #define d_int(__x) (*(__x)>0 ? floor(*(__x)) : -floor(- *(__x))) #define r_int(__x) (*(__x)>0 ? floor(*(__x)) : -floor(- *(__x))) #define d_lg10(x) ( 0.43429448190325182765 * log(*(x)) ) #define r_lg10(x) ( 0.43429448190325182765 * log(*(x)) ) #define d_log(x) (log(*(x))) #define d_mod(x, y) (fmod(*(x), *(y))) #define u_nint(__x) ((__x)>=0 ? floor((__x) + .5) : -floor(.5 - (__x))) #define d_nint(x) u_nint(*(x)) #define u_sign(__a,__b) ((__b) >= 0 ? ((__a) >= 0 ? (__a) : -(__a)) : -((__a) >= 0 ? (__a) : -(__a))) #define d_sign(a,b) u_sign(*(a),*(b)) #define r_sign(a,b) u_sign(*(a),*(b)) #define d_sin(x) (sin(*(x))) #define d_sinh(x) (sinh(*(x))) #define d_sqrt(x) (sqrt(*(x))) #define d_tan(x) (tan(*(x))) #define d_tanh(x) (tanh(*(x))) #define i_abs(x) abs(*(x)) #define i_dnnt(x) ((integer)u_nint(*(x))) #define i_len(s, n) (n) #define i_nint(x) ((integer)u_nint(*(x))) #define i_sign(a,b) ((integer)u_sign((integer)*(a),(integer)*(b))) #define pow_dd(ap, bp) ( pow(*(ap), *(bp))) #define pow_si(B,E) spow_ui(*(B),*(E)) #define pow_ri(B,E) spow_ui(*(B),*(E)) #define pow_di(B,E) dpow_ui(*(B),*(E)) #define pow_zi(p, a, b) {pCd(p) = zpow_ui(Cd(a), *(b));} #define pow_ci(p, a, b) {pCf(p) = cpow_ui(Cf(a), *(b));} #define pow_zz(R,A,B) {pCd(R) = cpow(Cd(A),*(B));} #define s_cat(lpp, rpp, rnp, np, llp) { ftnlen i, nc, ll; char *f__rp, *lp; ll = (llp); lp = (lpp); for(i=0; i < (int)*(np); ++i) { nc = ll; if((rnp)[i] < nc) nc = (rnp)[i]; ll -= nc; f__rp = (rpp)[i]; while(--nc >= 0) *lp++ = *(f__rp)++; } while(--ll >= 0) *lp++ = ' '; } #define s_cmp(a,b,c,d) ((integer)strncmp((a),(b),f2cmin((c),(d)))) #define s_copy(A,B,C,D) { int __i,__m; for (__i=0, __m=f2cmin((C),(D)); __i<__m && (B)[__i] != 0; ++__i) (A)[__i] = (B)[__i]; } #define sig_die(s, kill) { exit(1); } #define s_stop(s, n) {exit(0);} static char junk[] = "\n@(#)LIBF77 VERSION 19990503\n"; #define z_abs(z) (cabs(Cd(z))) #define z_exp(R, Z) {pCd(R) = cexp(Cd(Z));} #define z_sqrt(R, Z) {pCd(R) = csqrt(Cd(Z));} #define myexit_() break; #define mycycle() continue; #define myceiling(w) {ceil(w)} #define myhuge(w) {HUGE_VAL} //#define mymaxloc_(w,s,e,n) {if (sizeof(*(w)) == sizeof(double)) dmaxloc_((w),*(s),*(e),n); else dmaxloc_((w),*(s),*(e),n);} #define mymaxloc(w,s,e,n) {dmaxloc_(w,*(s),*(e),n)} /* procedure parameter types for -A and -C++ */ #define F2C_proc_par_types 1 #ifdef __cplusplus typedef logical (*L_fp)(...); #else typedef logical (*L_fp)(); #endif static float spow_ui(float x, integer n) { float pow=1.0; unsigned long int u; if(n != 0) { if(n < 0) n = -n, x = 1/x; for(u = n; ; ) { if(u & 01) pow *= x; if(u >>= 1) x *= x; else break; } } return pow; } static double dpow_ui(double x, integer n) { double pow=1.0; unsigned long int u; if(n != 0) { if(n < 0) n = -n, x = 1/x; for(u = n; ; ) { if(u & 01) pow *= x; if(u >>= 1) x *= x; else break; } } return pow; } static _Complex float cpow_ui(_Complex float x, integer n) { _Complex float pow=1.0; unsigned long int u; if(n != 0) { if(n < 0) n = -n, x = 1/x; for(u = n; ; ) { if(u & 01) pow *= x; if(u >>= 1) x *= x; else break; } } return pow; } static _Complex double zpow_ui(_Complex double x, integer n) { _Complex double pow=1.0; unsigned long int u; if(n != 0) { if(n < 0) n = -n, x = 1/x; for(u = n; ; ) { if(u & 01) pow *= x; if(u >>= 1) x *= x; else break; } } return pow; } static integer pow_ii(integer x, integer n) { integer pow; unsigned long int u; if (n <= 0) { if (n == 0 || x == 1) pow = 1; else if (x != -1) pow = x == 0 ? 1/x : 0; else n = -n; } if ((n > 0) || !(n == 0 || x == 1 || x != -1)) { u = n; for(pow = 1; ; ) { if(u & 01) pow *= x; if(u >>= 1) x *= x; else break; } } return pow; } static integer dmaxloc_(double *w, integer s, integer e, integer *n) { double m; integer i, mi; for(m=w[s-1], mi=s, i=s+1; i<=e; i++) if (w[i-1]>m) mi=i ,m=w[i-1]; return mi-s+1; } static integer smaxloc_(float *w, integer s, integer e, integer *n) { float m; integer i, mi; for(m=w[s-1], mi=s, i=s+1; i<=e; i++) if (w[i-1]>m) mi=i ,m=w[i-1]; return mi-s+1; } static inline void cdotc_(complex *z, integer *n_, complex *x, integer *incx_, complex *y, integer *incy_) { integer n = *n_, incx = *incx_, incy = *incy_, i; _Complex float zdotc = 0.0; if (incx == 1 && incy == 1) { for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */ zdotc += conjf(Cf(&x[i])) * Cf(&y[i]); } } else { for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */ zdotc += conjf(Cf(&x[i*incx])) * Cf(&y[i*incy]); } } pCf(z) = zdotc; } static inline void zdotc_(doublecomplex *z, integer *n_, doublecomplex *x, integer *incx_, doublecomplex *y, integer *incy_) { integer n = *n_, incx = *incx_, incy = *incy_, i; _Complex double zdotc = 0.0; if (incx == 1 && incy == 1) { for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */ zdotc += conj(Cd(&x[i])) * Cd(&y[i]); } } else { for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */ zdotc += conj(Cd(&x[i*incx])) * Cd(&y[i*incy]); } } pCd(z) = zdotc; } static inline void cdotu_(complex *z, integer *n_, complex *x, integer *incx_, complex *y, integer *incy_) { integer n = *n_, incx = *incx_, incy = *incy_, i; _Complex float zdotc = 0.0; if (incx == 1 && incy == 1) { for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */ zdotc += Cf(&x[i]) * Cf(&y[i]); } } else { for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */ zdotc += Cf(&x[i*incx]) * Cf(&y[i*incy]); } } pCf(z) = zdotc; } static inline void zdotu_(doublecomplex *z, integer *n_, doublecomplex *x, integer *incx_, doublecomplex *y, integer *incy_) { integer n = *n_, incx = *incx_, incy = *incy_, i; _Complex double zdotc = 0.0; if (incx == 1 && incy == 1) { for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */ zdotc += Cd(&x[i]) * Cd(&y[i]); } } else { for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */ zdotc += Cd(&x[i*incx]) * Cd(&y[i*incy]); } } pCd(z) = zdotc; } #endif /* -- translated by f2c (version 20000121). You must link the resulting object file with the libraries: -lf2c -lm (in that order) */ /* Table of constant values */ static integer c_n1 = -1; /* > \brief <b> ZSYSV_ROOK computes the solution to system of linear equations A * X = B for SY matrices</b> */ /* =========== DOCUMENTATION =========== */ /* Online html documentation available at */ /* http://www.netlib.org/lapack/explore-html/ */ /* > \htmlonly */ /* > Download ZSYSV_ROOK + dependencies */ /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zsysv_r ook.f"> */ /* > [TGZ]</a> */ /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zsysv_r ook.f"> */ /* > [ZIP]</a> */ /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zsysv_r ook.f"> */ /* > [TXT]</a> */ /* > \endhtmlonly */ /* Definition: */ /* =========== */ /* SUBROUTINE ZSYSV_ROOK( UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, */ /* LWORK, INFO ) */ /* CHARACTER UPLO */ /* INTEGER INFO, LDA, LDB, LWORK, N, NRHS */ /* INTEGER IPIV( * ) */ /* COMPLEX*16 A( LDA, * ), B( LDB, * ), WORK( * ) */ /* > \par Purpose: */ /* ============= */ /* > */ /* > \verbatim */ /* > */ /* > ZSYSV_ROOK computes the solution to a complex system of linear */ /* > equations */ /* > A * X = B, */ /* > where A is an N-by-N symmetric matrix and X and B are N-by-NRHS */ /* > matrices. */ /* > */ /* > The diagonal pivoting method is used to factor A as */ /* > A = U * D * U**T, if UPLO = 'U', or */ /* > A = L * D * L**T, if UPLO = 'L', */ /* > where U (or L) is a product of permutation and unit upper (lower) */ /* > triangular matrices, and D is symmetric and block diagonal with */ /* > 1-by-1 and 2-by-2 diagonal blocks. */ /* > */ /* > ZSYTRF_ROOK is called to compute the factorization of a complex */ /* > symmetric matrix A using the bounded Bunch-Kaufman ("rook") diagonal */ /* > pivoting method. */ /* > */ /* > The factored form of A is then used to solve the system */ /* > of equations A * X = B by calling ZSYTRS_ROOK. */ /* > \endverbatim */ /* Arguments: */ /* ========== */ /* > \param[in] UPLO */ /* > \verbatim */ /* > UPLO is CHARACTER*1 */ /* > = 'U': Upper triangle of A is stored; */ /* > = 'L': Lower triangle of A is stored. */ /* > \endverbatim */ /* > */ /* > \param[in] N */ /* > \verbatim */ /* > N is INTEGER */ /* > The number of linear equations, i.e., the order of the */ /* > matrix A. N >= 0. */ /* > \endverbatim */ /* > */ /* > \param[in] NRHS */ /* > \verbatim */ /* > NRHS is INTEGER */ /* > The number of right hand sides, i.e., the number of columns */ /* > of the matrix B. NRHS >= 0. */ /* > \endverbatim */ /* > */ /* > \param[in,out] A */ /* > \verbatim */ /* > A is COMPLEX*16 array, dimension (LDA,N) */ /* > On entry, the symmetric matrix A. If UPLO = 'U', the leading */ /* > N-by-N upper triangular part of A contains the upper */ /* > triangular part of the matrix A, and the strictly lower */ /* > triangular part of A is not referenced. If UPLO = 'L', the */ /* > leading N-by-N lower triangular part of A contains the lower */ /* > triangular part of the matrix A, and the strictly upper */ /* > triangular part of A is not referenced. */ /* > */ /* > On exit, if INFO = 0, the block diagonal matrix D and the */ /* > multipliers used to obtain the factor U or L from the */ /* > factorization A = U*D*U**T or A = L*D*L**T as computed by */ /* > ZSYTRF_ROOK. */ /* > \endverbatim */ /* > */ /* > \param[in] LDA */ /* > \verbatim */ /* > LDA is INTEGER */ /* > The leading dimension of the array A. LDA >= f2cmax(1,N). */ /* > \endverbatim */ /* > */ /* > \param[out] IPIV */ /* > \verbatim */ /* > IPIV is INTEGER array, dimension (N) */ /* > Details of the interchanges and the block structure of D, */ /* > as determined by ZSYTRF_ROOK. */ /* > */ /* > If UPLO = 'U': */ /* > If IPIV(k) > 0, then rows and columns k and IPIV(k) */ /* > were interchanged and D(k,k) is a 1-by-1 diagonal block. */ /* > */ /* > If IPIV(k) < 0 and IPIV(k-1) < 0, then rows and */ /* > columns k and -IPIV(k) were interchanged and rows and */ /* > columns k-1 and -IPIV(k-1) were inerchaged, */ /* > D(k-1:k,k-1:k) is a 2-by-2 diagonal block. */ /* > */ /* > If UPLO = 'L': */ /* > If IPIV(k) > 0, then rows and columns k and IPIV(k) */ /* > were interchanged and D(k,k) is a 1-by-1 diagonal block. */ /* > */ /* > If IPIV(k) < 0 and IPIV(k+1) < 0, then rows and */ /* > columns k and -IPIV(k) were interchanged and rows and */ /* > columns k+1 and -IPIV(k+1) were inerchaged, */ /* > D(k:k+1,k:k+1) is a 2-by-2 diagonal block. */ /* > \endverbatim */ /* > */ /* > \param[in,out] B */ /* > \verbatim */ /* > B is COMPLEX*16 array, dimension (LDB,NRHS) */ /* > On entry, the N-by-NRHS right hand side matrix B. */ /* > On exit, if INFO = 0, the N-by-NRHS solution matrix X. */ /* > \endverbatim */ /* > */ /* > \param[in] LDB */ /* > \verbatim */ /* > LDB is INTEGER */ /* > The leading dimension of the array B. LDB >= f2cmax(1,N). */ /* > \endverbatim */ /* > */ /* > \param[out] WORK */ /* > \verbatim */ /* > WORK is COMPLEX*16 array, dimension (MAX(1,LWORK)) */ /* > On exit, if INFO = 0, WORK(1) returns the optimal LWORK. */ /* > \endverbatim */ /* > */ /* > \param[in] LWORK */ /* > \verbatim */ /* > LWORK is INTEGER */ /* > The length of WORK. LWORK >= 1, and for best performance */ /* > LWORK >= f2cmax(1,N*NB), where NB is the optimal blocksize for */ /* > ZSYTRF_ROOK. */ /* > */ /* > TRS will be done with Level 2 BLAS */ /* > */ /* > If LWORK = -1, then a workspace query is assumed; the routine */ /* > only calculates the optimal size of the WORK array, returns */ /* > this value as the first entry of the WORK array, and no error */ /* > message related to LWORK is issued by XERBLA. */ /* > \endverbatim */ /* > */ /* > \param[out] INFO */ /* > \verbatim */ /* > INFO is INTEGER */ /* > = 0: successful exit */ /* > < 0: if INFO = -i, the i-th argument had an illegal value */ /* > > 0: if INFO = i, D(i,i) is exactly zero. The factorization */ /* > has been completed, but the block diagonal matrix D is */ /* > exactly singular, so the solution could not be computed. */ /* > \endverbatim */ /* Authors: */ /* ======== */ /* > \author Univ. of Tennessee */ /* > \author Univ. of California Berkeley */ /* > \author Univ. of Colorado Denver */ /* > \author NAG Ltd. */ /* > \date December 2016 */ /* > \ingroup complex16SYsolve */ /* > \par Contributors: */ /* ================== */ /* > */ /* > \verbatim */ /* > */ /* > December 2016, Igor Kozachenko, */ /* > Computer Science Division, */ /* > University of California, Berkeley */ /* > */ /* > September 2007, Sven Hammarling, Nicholas J. Higham, Craig Lucas, */ /* > School of Mathematics, */ /* > University of Manchester */ /* > */ /* > \endverbatim */ /* ===================================================================== */ /* Subroutine */ int zsysv_rook_(char *uplo, integer *n, integer *nrhs, doublecomplex *a, integer *lda, integer *ipiv, doublecomplex *b, integer *ldb, doublecomplex *work, integer *lwork, integer *info) { /* System generated locals */ integer a_dim1, a_offset, b_dim1, b_offset, i__1; /* Local variables */ extern /* Subroutine */ int zsytrf_rook_(char *, integer *, doublecomplex *, integer *, integer *, doublecomplex *, integer *, integer *), zsytrs_rook_(char *, integer *, integer *, doublecomplex *, integer *, integer *, doublecomplex *, integer *, integer *); extern logical lsame_(char *, char *); extern /* Subroutine */ int xerbla_(char *, integer *, ftnlen); integer lwkopt; logical lquery; /* -- LAPACK driver routine (version 3.7.0) -- */ /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */ /* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */ /* December 2016 */ /* ===================================================================== */ /* Test the input parameters. */ /* Parameter adjustments */ a_dim1 = *lda; a_offset = 1 + a_dim1 * 1; a -= a_offset; --ipiv; b_dim1 = *ldb; b_offset = 1 + b_dim1 * 1; b -= b_offset; --work; /* Function Body */ *info = 0; lquery = *lwork == -1; if (! lsame_(uplo, "U") && ! lsame_(uplo, "L")) { *info = -1; } else if (*n < 0) { *info = -2; } else if (*nrhs < 0) { *info = -3; } else if (*lda < f2cmax(1,*n)) { *info = -5; } else if (*ldb < f2cmax(1,*n)) { *info = -8; } else if (*lwork < 1 && ! lquery) { *info = -10; } if (*info == 0) { if (*n == 0) { lwkopt = 1; } else { zsytrf_rook_(uplo, n, &a[a_offset], lda, &ipiv[1], &work[1], & c_n1, info); lwkopt = (integer) work[1].r; } work[1].r = (doublereal) lwkopt, work[1].i = 0.; } if (*info != 0) { i__1 = -(*info); xerbla_("ZSYSV_ROOK ", &i__1, (ftnlen)11); return 0; } else if (lquery) { return 0; } /* Compute the factorization A = U*D*U**T or A = L*D*L**T. */ zsytrf_rook_(uplo, n, &a[a_offset], lda, &ipiv[1], &work[1], lwork, info); if (*info == 0) { /* Solve the system A*X = B, overwriting B with X. */ /* Solve with TRS_ROOK ( Use Level 2 BLAS) */ zsytrs_rook_(uplo, n, nrhs, &a[a_offset], lda, &ipiv[1], &b[b_offset] , ldb, info); } work[1].r = (doublereal) lwkopt, work[1].i = 0.; return 0; /* End of ZSYSV_ROOK */ } /* zsysv_rook__ */
the_stack_data/18889175.c
/*-----------------------------------------------------------------------*/ /* Program: Stream */ /* Revision: $Id: stream.c,v 5.9 2009/04/11 16:35:00 mccalpin Exp $ */ /* Original code developed by John D. McCalpin */ /* Programmers: John D. McCalpin */ /* Joe R. Zagar */ /* */ /* This program measures memory transfer rates in MB/s for simple */ /* computational kernels coded in C. */ /*-----------------------------------------------------------------------*/ /* Copyright 1991-2005: John D. McCalpin */ /*-----------------------------------------------------------------------*/ /* License: */ /* 1. You are free to use this program and/or to redistribute */ /* this program. */ /* 2. You are free to modify this program for your own use, */ /* including commercial use, subject to the publication */ /* restrictions in item 3. */ /* 3. You are free to publish results obtained from running this */ /* program, or from works that you derive from this program, */ /* with the following limitations: */ /* 3a. In order to be referred to as "STREAM benchmark results", */ /* published results must be in conformance to the STREAM */ /* Run Rules, (briefly reviewed below) published at */ /* http://www.cs.virginia.edu/stream/ref.html */ /* and incorporated herein by reference. */ /* As the copyright holder, John McCalpin retains the */ /* right to determine conformity with the Run Rules. */ /* 3b. Results based on modified source code or on runs not in */ /* accordance with the STREAM Run Rules must be clearly */ /* labelled whenever they are published. Examples of */ /* proper labelling include: */ /* "tuned STREAM benchmark results" */ /* "based on a variant of the STREAM benchmark code" */ /* Other comparable, clear and reasonable labelling is */ /* acceptable. */ /* 3c. Submission of results to the STREAM benchmark web site */ /* is encouraged, but not required. */ /* 4. Use of this program or creation of derived works based on this */ /* program constitutes acceptance of these licensing restrictions. */ /* 5. Absolutely no warranty is expressed or implied. */ /*-----------------------------------------------------------------------*/ # include <stdio.h> # include <math.h> # include <float.h> # include <limits.h> # include <sys/time.h> /* INSTRUCTIONS: * * 1) Stream requires a good bit of memory to run. Adjust the * value of 'N' (below) to give a 'timing calibration' of * at least 20 clock-ticks. This will provide rate estimates * that should be good to about 5% precision. */ #ifndef N # define N 16000 #endif #ifndef NTIMES # define NTIMES 100 #endif #ifndef OFFSET # define OFFSET 0 #endif /* * 3) Compile the code with full optimization. Many compilers * generate unreasonably bad code before the optimizer tightens * things up. If the results are unreasonably good, on the * other hand, the optimizer might be too smart for me! * * Try compiling with: * cc -O stream_omp.c -o stream_omp * * This is known to work on Cray, SGI, IBM, and Sun machines. * * * 4) Mail the results to [email protected] * Be sure to include: * a) computer hardware model number and software revision * b) the compiler flags * c) all of the output from the test case. * Thanks! * */ # define HLINE "-------------------------------------------------------------\n" # ifndef MIN # define MIN(x,y) ((x)<(y)?(x):(y)) # endif # ifndef MAX # define MAX(x,y) ((x)>(y)?(x):(y)) # endif static double a[N+OFFSET], b[N+OFFSET], c[N+OFFSET]; static double avgtime[4] = {0}, maxtime[4] = {0}, mintime[4] = {FLT_MAX,FLT_MAX,FLT_MAX,FLT_MAX}; static char *label[4] = {"Copy: ", "Scale: ", "Add: ", "Triad: "}; static double bytes[4] = { 2 * sizeof(double) * N, 2 * sizeof(double) * N, 3 * sizeof(double) * N, 3 * sizeof(double) * N }; extern double mysecond(); extern void checkSTREAMresults(); int main() { int quantum, checktick(); int BytesPerWord; register int j, k; double scalar, t, times[4][NTIMES]; /* --- SETUP --- determine precision and check timing --- */ printf(HLINE); printf("STREAM version $Revision: 5.9 $\n"); printf(HLINE); BytesPerWord = sizeof(double); printf("This system uses %d bytes per DOUBLE PRECISION word.\n", BytesPerWord); printf(HLINE); printf("Array size = %llu, Offset = %d\n", (unsigned long long) N, OFFSET); printf("Total memory required = %.1f MB.\n", (3.0 * BytesPerWord) * ( (double) N / 1048576.0)); printf("Each test is run %d times, but only\n", NTIMES); printf("the *best* time for each is used.\n"); printf(HLINE); /* Get initial value for system clock. */ for (j=0; j<N; j++) { a[j] = 1.0; b[j] = 2.0; c[j] = 0.0; } printf(HLINE); if ( (quantum = checktick()) >= 1) printf("Your clock granularity/precision appears to be %d microseconds.\n", quantum); else { printf("Your clock granularity appears to be less than one microsecond.\n"); quantum = 1; } t = mysecond(); for (j = 0; j < N; j++) a[j] = 2.0E0 * a[j]; t = 1.0E6 * (mysecond() - t); printf("Each test below will take on the order of %d microseconds.\n", (int) t ); printf(" (= %d clock ticks)\n", (int) (t/quantum) ); printf("Increase the size of the arrays if this shows that\n"); printf("you are not getting at least 20 clock ticks per test.\n"); printf(HLINE); printf("WARNING -- The above is only a rough guideline.\n"); printf("For best results, please be sure you know the\n"); printf("precision of your system timer.\n"); printf(HLINE); /* --- MAIN LOOP --- repeat test cases NTIMES times --- */ printf("--- MAIN LOOP --- repeat test cases %d times ---\n", NTIMES); printf(HLINE); scalar = 3.0; for (k=0; k<NTIMES; k++) { times[0][k] = mysecond(); for (j=0; j<N; j++) c[j] = a[j]; times[0][k] = mysecond() - times[0][k]; times[1][k] = mysecond(); for (j=0; j<N; j++) b[j] = scalar*c[j]; times[1][k] = mysecond() - times[1][k]; times[2][k] = mysecond(); for (j=0; j<N; j++) c[j] = a[j]+b[j]; times[2][k] = mysecond() - times[2][k]; times[3][k] = mysecond(); for (j=0; j<N; j++) a[j] = b[j]+scalar*c[j]; times[3][k] = mysecond() - times[3][k]; // printf("Iteration(%i): Copy(%.4f), Scale(%.4f), Add(%.4f), Triad(%.4f)\n", // k, times[0][k], times[1][k], times[2][k], times[3][k]); } /* --- SUMMARY --- */ printf("--- SUMMARY ---\n"); printf(HLINE); for (k=1; k<NTIMES; k++) /* note -- skip first iteration */ { for (j=0; j<4; j++) { avgtime[j] = avgtime[j] + times[j][k]; mintime[j] = MIN(mintime[j], times[j][k]); maxtime[j] = MAX(maxtime[j], times[j][k]); } } printf("Function Rate (MB/s) Avg time Min time Max time\n"); for (j=0; j<4; j++) { avgtime[j] = avgtime[j]/(double)(NTIMES-1); printf("%s%11.4f %11.4f %11.4f %11.4f\n", label[j], 1.0E-06 * bytes[j]/mintime[j], avgtime[j], mintime[j], maxtime[j]); } printf(HLINE); /* --- Check Results --- */ printf("--- Check Results ---\n"); printf(HLINE); checkSTREAMresults(); printf(HLINE); return 0; } # define M 20 int checktick() { int i, minDelta, Delta; double t1, t2, timesfound[M]; /* Collect a sequence of M unique time values from the system. */ for (i = 0; i < M; i++) { t1 = mysecond(); while( ((t2=mysecond()) - t1) < 1.0E-6 ) ; timesfound[i] = t1 = t2; } /* * Determine the minimum difference between these M values. * This result will be our estimate (in microseconds) for the * clock granularity. */ minDelta = 1000000; for (i = 1; i < M; i++) { Delta = (int)( 1.0E6 * (timesfound[i]-timesfound[i-1])); minDelta = MIN(minDelta, MAX(Delta,0)); } return(minDelta); } /* A gettimeofday routine to give access to the wall clock timer on most UNIX-like systems. */ #include <sys/time.h> double mysecond() { struct timeval tp; // struct timezone tzp; int i; i = gettimeofday(&tp,NULL); return ( (double) tp.tv_sec + (double) tp.tv_usec * 1.e-6 ); } void checkSTREAMresults () { double aj,bj,cj,scalar; double asum,bsum,csum; double epsilon; int j,k; /* reproduce initialization */ aj = 1.0; bj = 2.0; cj = 0.0; /* a[] is modified during timing check */ aj = 2.0E0 * aj; /* now execute timing loop */ scalar = 3.0; for (k=0; k<NTIMES; k++) { cj = aj; bj = scalar*cj; cj = aj+bj; aj = bj+scalar*cj; } aj = aj * (double) (N); bj = bj * (double) (N); cj = cj * (double) (N); asum = 0.0; bsum = 0.0; csum = 0.0; for (j=0; j<N; j++) { asum += a[j]; bsum += b[j]; csum += c[j]; } #ifdef VERBOSE printf ("Results Comparison: \n"); printf (" Expected : %f %f %f \n",aj,bj,cj); printf (" Observed : %f %f %f \n",asum,bsum,csum); #endif #ifndef abs #define abs(a) ((a) >= 0 ? (a) : -(a)) #endif epsilon = 1.e-8; if (abs(aj-asum)/asum > epsilon) { printf ("Failed Validation on array a[]\n"); printf (" Expected : %f \n",aj); printf (" Observed : %f \n",asum); } else if (abs(bj-bsum)/bsum > epsilon) { printf ("Failed Validation on array b[]\n"); printf (" Expected : %f \n",bj); printf (" Observed : %f \n",bsum); } else if (abs(cj-csum)/csum > epsilon) { printf ("Failed Validation on array c[]\n"); printf (" Expected : %f \n",cj); printf (" Observed : %f \n",csum); } else { printf ("Solution Validates\n"); } }
the_stack_data/176706244.c
// All included firmware files are // INTEL CORPORATION PROPRIETARY INFORMATION // Copyright(c) 2019 Intel Corporation. All Rights Reserved const int fw_target_version[4] = {0,2,0,951}; #ifndef _MSC_VER __asm__( "#version c3940ccbb0e3045603e4aceaa2d73427f96e24bc\n" #ifdef __APPLE__ ".const_data\n" #define _ "_" #else ".section .rodata\n" #define _ "" #endif ".global "_"fw_target_data\n" _"fw_target_data:\n" ".incbin \"/home/jetson/librealsense/common/fw/target-0.2.0.951.mvcmd\"\n" ".global "_"fw_target_size\n" _"fw_target_size:\n" "1:\n" ".int 1b - "_"fw_target_data\n" ".previous" ); #undef _ #endif
the_stack_data/428350.c
extern void __VERIFIER_error() __attribute__ ((__noreturn__)); void __VERIFIER_assert(int cond) { if(!(cond)) { ERROR: __VERIFIER_error(); } } #define N 75 int main( ){ int aa [N]; int a = 0; while( aa[a] >= 0 ) { a++; } int x; for ( x = 0 ; x < a ; x++ ) { __VERIFIER_assert( aa[x] >= 0 ); } return 0; }
the_stack_data/129885.c
/* { dg-do run } */ /* { dg-options "-O2" } */ #include <stdio.h> #include <float.h> #define TEST_EQ(TYPE,X,Y,RES) \ do { \ volatile TYPE a, b; \ a = (TYPE) X; \ b = (TYPE) Y; \ if ((a == b) != RES) \ { \ printf ("Runtime computation error @%d. %g " \ "!= %g\n", __LINE__, a, b); \ error = 1; \ } \ } while (0) #ifndef __HS__ /* Special type of NaN found when using double FPX instructions. */ static const unsigned long long __nan = 0x7FF0000080000000ULL; # define W (*(double *) &__nan) #else # define W __builtin_nan ("") #endif #define Q __builtin_nan ("") #define H __builtin_inf () int main (void) { int error = 0; TEST_EQ (double, 1, 1, 1); TEST_EQ (double, 1, 2, 0); TEST_EQ (double, W, W, 0); TEST_EQ (double, Q, Q, 0); TEST_EQ (double, __DBL_MAX__, __DBL_MAX__, 1); TEST_EQ (double, __DBL_MIN__, __DBL_MIN__, 1); TEST_EQ (double, H, H, 1); if (error) __builtin_abort (); return 0; }
the_stack_data/1251477.c
/* ******************************************************************************* * Copyright (c) 2021, STMicroelectronics * All rights reserved. * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ******************************************************************************* */ /* * Automatically generated from STM32F030C8Tx.xml * CubeMX DB release 6.0.10 */ #if defined(ARDUINO_EEXTR_F030_V1) #include "Arduino.h" #include "PeripheralPins.h" /* ===== * Notes: * - The pins mentioned Px_y_ALTz are alternative possibilities which use other * HW peripheral instances. You can use them the same way as any other "normal" * pin (i.e. analogWrite(PA7_ALT1, 128);). * * - Commented lines are alternative possibilities which are not used per default. * If you change them, you will have to know what you do * ===== */ //*** ADC *** #ifdef HAL_ADC_MODULE_ENABLED WEAK const PinMap PinMap_ADC[] = { {PA_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC_IN0 {PA_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC_IN1 {PA_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC_IN2 // {PA_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC_IN3 - TC1_CS // {PA_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC_IN4 - TC2_CS // {PA_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC_IN5 - SPI // {PA_6, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC_IN6 - SPI // {PA_7, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC_IN7 - SPI // {PB_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC_IN8 - PWM0 // {PB_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC_IN9 - PWM0 {NC, NP, 0} }; #endif //*** No DAC *** //*** I2C *** #ifdef HAL_I2C_MODULE_ENABLED WEAK const PinMap PinMap_I2C_SDA[] = { {PB_7, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF1_I2C1)}, {PB_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF1_I2C1)}, // {PB_11, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF1_I2C2)}, // E0_CTL {PF_7, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF_NONE)}, {NC, NP, 0} }; #endif #ifdef HAL_I2C_MODULE_ENABLED WEAK const PinMap PinMap_I2C_SCL[] = { {PB_6, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF1_I2C1)}, {PB_8, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF1_I2C1)}, // {PB_10, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF1_I2C2)}, // E1_FAN {PF_6, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF_NONE)}, {NC, NP, 0} }; #endif //*** TIM *** #ifdef HAL_TIM_MODULE_ENABLED WEAK const PinMap PinMap_TIM[] = { {PA_2, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM15, 1, 0)}, // TIM15_CH1 // {PA_3, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM15, 2, 0)}, // TIM15_CH2 - TC1_CS // {PA_4, TIM14, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM14, 1, 0)}, // TIM14_CH1 - TC2_CS // {PA_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM3, 1, 0)}, // TIM3_CH1 - SPI // {PA_6_ALT1, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM16, 1, 0)}, // TIM16_CH1 - SPI // {PA_7, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM1, 1, 1)}, // TIM1_CH1N - SPI // {PA_7_ALT1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM3, 2, 0)}, // TIM3_CH2 - SPI // {PA_7_ALT2, TIM14, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM14, 1, 0)}, // TIM14_CH1 - SPI // {PA_7_ALT3, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM17, 1, 0)}, // TIM17_CH1 - SPI {PA_8, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM1, 1, 0)}, // TIM1_CH1 // {PA_9, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM1, 2, 0)}, // TIM1_CH2 - UART1 // {PA_10, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM1, 3, 0)}, // TIM1_CH3 - UART1 {PA_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM1, 4, 0)}, // TIM1_CH4 {PB_0, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM1, 2, 1)}, // TIM1_CH2N {PB_0_ALT1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM3, 3, 0)}, // TIM3_CH3 {PB_1, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM1, 3, 1)}, // TIM1_CH3N {PB_1_ALT1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM3, 4, 0)}, // TIM3_CH4 {PB_1_ALT2, TIM14, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM14, 1, 0)}, // TIM14_CH1 {PB_4, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM3, 1, 0)}, // TIM3_CH1 {PB_5, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM3, 2, 0)}, // TIM3_CH2 // {PB_6, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM16, 1, 1)}, // TIM16_CH1N - I2C // {PB_7, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM17, 1, 1)}, // TIM17_CH1N - I2C {PB_8, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM16, 1, 0)}, // TIM16_CH1 {PB_9, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM17, 1, 0)}, // TIM17_CH1 {PB_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM1, 1, 1)}, // TIM1_CH1N {PB_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM1, 2, 1)}, // TIM1_CH2N {PB_14_ALT1, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM15, 1, 0)}, // TIM15_CH1 {PB_15, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM1, 3, 1)}, // TIM1_CH3N {PB_15_ALT1, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM15, 1, 1)}, // TIM15_CH1N {PB_15_ALT2, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM15, 2, 0)}, // TIM15_CH2 {NC, NP, 0} }; #endif //*** UART *** #ifdef HAL_UART_MODULE_ENABLED WEAK const PinMap PinMap_UART_TX[] = { // {PA_2, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART2)}, // ADC {PA_9, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART1)}, {PA_14, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART2)}, // {PB_6, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_USART1)}, // I2C {NC, NP, 0} }; #endif #ifdef HAL_UART_MODULE_ENABLED WEAK const PinMap PinMap_UART_RX[] = { // {PA_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART2)}, // TC2_CS {PA_10, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART1)}, {PA_15, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART2)}, // {PB_7, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_USART1)}, // I2C {NC, NP, 0} }; #endif #ifdef HAL_UART_MODULE_ENABLED WEAK const PinMap PinMap_UART_RTS[] = { // {PA_1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART2)}, // ADC {PA_12, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART1)}, {NC, NP, 0} }; #endif #ifdef HAL_UART_MODULE_ENABLED WEAK const PinMap PinMap_UART_CTS[] = { // {PA_0, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART2)}, // ADC {PA_11, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART1)}, {NC, NP, 0} }; #endif //*** SPI *** #ifdef HAL_SPI_MODULE_ENABLED WEAK const PinMap PinMap_SPI_MOSI[] = { {PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, {PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, {PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI2)}, {NC, NP, 0} }; #endif #ifdef HAL_SPI_MODULE_ENABLED WEAK const PinMap PinMap_SPI_MISO[] = { {PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, {PB_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, {PB_14, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI2)}, {NC, NP, 0} }; #endif #ifdef HAL_SPI_MODULE_ENABLED WEAK const PinMap PinMap_SPI_SCLK[] = { {PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, {PB_3, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, {PB_13, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI2)}, {NC, NP, 0} }; #endif #ifdef HAL_SPI_MODULE_ENABLED WEAK const PinMap PinMap_SPI_SSEL[] = { // {PA_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, // TC2_CS {PA_15, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, // {PB_12, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI2)}, // E1_CTL {NC, NP, 0} }; #endif //*** No CAN *** //*** No ETHERNET *** //*** No QUADSPI *** //*** No USB *** //*** No SD *** #endif /* ARDUINO_EEXTR_F030_V1 */
the_stack_data/167329461.c
/* Distributed under the MIT license. See the LICENSE file. * Copyright (c) 2014--2016 Thomas Fogal */ #define _POSIX_C_SOURCE 200809L #include <inttypes.h> #include <stdarg.h> #include <stdlib.h> #include <stdio.h> #include <signal.h> #include <sys/types.h> #include <unistd.h> static float* v3darr; static size_t dims[3] = {10, 20, 30}; #define IDX3(x,y,z) v[(z)*dims[0]*dims[1] + (y)*dims[0] + x] __attribute__((noinline)) static void smooth3(float* v) { for(size_t k=1; k < dims[2]-1; ++k) { for(size_t j=1; j < dims[1]-1; ++j) { for(size_t i=1; i < dims[0]-1; ++i) { /* hack, doesn't do what it says but still 3D at least.. */ IDX3(i,j,k) = (IDX3(i-1,j,k) + IDX3(i,j,k) + IDX3(i+1,j,k)) / 3.0f; } } } } static void handle_signal(int sig) { signal(sig, SIG_DFL); psignal(sig, "sig received."); } #define whereami(prefix, ...) \ do { \ uint64_t rsp=0; asm("\t movq %%rsp, %0" : "=r"(rsp)); \ uint64_t rip=0; asm("\t movq $., %0" : "=r"(rip)); \ printf("[ c] 0x%08lx 0x%08lx ", rsp, rip); \ printf(prefix, __VA_ARGS__); \ printf("\n"); fflush(stdout); \ } while(0) int main(int argc, char* argv[]) { if(argc < 2) { fprintf(stderr, "need arg: which computation to run.\n"); return EXIT_FAILURE; } for(size_t i=0; i < (size_t)argc; i++) { printf("arg[%zu]: %s\n", i, argv[i]); } printf("[ c] my PID is %ld\n", (long)getpid()); signal(SIGUSR1, handle_signal); pause(); void* justtest; if(argc == 42) { dims[0] = 12398; } for(size_t i=1; i < (size_t)argc; ++i) { if(atoi(argv[i]) == 3) { v3darr = calloc(dims[0]*dims[1]*dims[2], sizeof(float)); whereami("back from calloc(%zu, %zu)", dims[0]*dims[1]*dims[2], sizeof(float)); smooth3(v3darr); free(v3darr); whereami("will malloc %s", "42"); justtest = malloc(42); whereami("back from malloc(42), got %p", justtest); free(justtest); } else { fprintf(stderr, "[ c] unknown computational id '%s'\n", argv[i]); } } justtest = malloc(19); whereami("malloc(19) came back: %p", justtest); free(justtest); justtest = malloc(7); whereami("malloc(7) gave: %p", justtest); free(justtest); whereami("%s finished.", argv[0]); return EXIT_SUCCESS; }
the_stack_data/855193.c
/* * * @author : Anmol Agrawal * */ #include <stdio.h> #include <stdlib.h> #include <string.h> void merge(char arr[], int l, int m, int r) { int i, j, k; int n1 = m - l + 1; int n2 = r - m; char L[n1], R[n2]; for (i = 0; i < n1; i++) L[i] = arr[l + i]; for (j = 0; j < n2; j++) R[j] = arr[m + 1+ j]; i = 0; j = 0; k = l; while (i < n1 && j < n2) { if (L[i] <= R[j]) { arr[k] = L[i]; i++; } else { arr[k] = R[j]; j++; } k++; } while (i < n1) { arr[k] = L[i]; i++; k++; } while (j < n2) { arr[k] = R[j]; j++; k++; } } void mergeSort(char arr[], int l, int r) { if (l < r) { int m = l+(r-l)/2; mergeSort(arr, l, m); mergeSort(arr, m+1, r); merge(arr, l, m, r); } } int main() { int len,count,i,freq,temp; char str[100001]; scanf("%s",str); len=strlen(str); mergeSort(str,0,len-1); temp=*str; freq=1; count=0; for(i=1;i<len;i++) { if(*(str+i)==temp) freq++; else { if(freq%2!=0) count++; temp=*(str+i); freq=1; } } if(count<=1) printf("YES"); else printf("NO"); }
the_stack_data/761177.c
/* Generated by CIL v. 1.7.0 */ /* print_CIL_Input is false */ struct _IO_FILE; struct timeval; extern float strtof(char const *str , char const *endptr ) ; extern void signal(int sig , void *func ) ; typedef struct _IO_FILE FILE; extern int atoi(char const *s ) ; extern double strtod(char const *str , char const *endptr ) ; extern int fclose(void *stream ) ; extern void *fopen(char const *filename , char const *mode ) ; extern void abort() ; extern void exit(int status ) ; extern int raise(int sig ) ; extern int fprintf(struct _IO_FILE *stream , char const *format , ...) ; extern int strcmp(char const *a , char const *b ) ; extern int rand() ; extern unsigned long strtoul(char const *str , char const *endptr , int base ) ; void RandomFunc(unsigned int input[1] , unsigned int output[1] ) ; extern int strncmp(char const *s1 , char const *s2 , unsigned long maxlen ) ; extern int gettimeofday(struct timeval *tv , void *tz , ...) ; extern int printf(char const *format , ...) ; int main(int argc , char *argv[] ) ; void megaInit(void) ; extern unsigned long strlen(char const *s ) ; extern long strtol(char const *str , char const *endptr , int base ) ; extern unsigned long strnlen(char const *s , unsigned long maxlen ) ; extern void *memcpy(void *s1 , void const *s2 , unsigned long size ) ; struct timeval { long tv_sec ; long tv_usec ; }; extern void *malloc(unsigned long size ) ; extern int scanf(char const *format , ...) ; void megaInit(void) { { } } int main(int argc , char *argv[] ) { unsigned int input[1] ; unsigned int output[1] ; int randomFuns_i5 ; unsigned int randomFuns_value6 ; int randomFuns_main_i7 ; { megaInit(); if (argc != 2) { printf("Call this program with %i arguments\n", 1); exit(-1); } else { } randomFuns_i5 = 0; while (randomFuns_i5 < 1) { randomFuns_value6 = (unsigned int )strtoul(argv[randomFuns_i5 + 1], 0, 10); input[randomFuns_i5] = randomFuns_value6; randomFuns_i5 ++; } RandomFunc(input, output); if (output[0] == 2507289478U) { printf("You win!\n"); } else { } randomFuns_main_i7 = 0; while (randomFuns_main_i7 < 1) { printf("%u\n", output[randomFuns_main_i7]); randomFuns_main_i7 ++; } } } void RandomFunc(unsigned int input[1] , unsigned int output[1] ) { unsigned int state[1] ; char copy12 ; char copy14 ; { state[0UL] = (input[0UL] + 51238316UL) + 274866410U; if ((state[0UL] >> 4U) & 1U) { if ((state[0UL] >> 3U) & 1U) { if ((state[0UL] >> 2U) & 1U) { state[0UL] += state[0UL]; } else { copy12 = *((char *)(& state[0UL]) + 0); *((char *)(& state[0UL]) + 0) = *((char *)(& state[0UL]) + 1); *((char *)(& state[0UL]) + 1) = copy12; copy12 = *((char *)(& state[0UL]) + 1); *((char *)(& state[0UL]) + 1) = *((char *)(& state[0UL]) + 0); *((char *)(& state[0UL]) + 0) = copy12; } } else { state[0UL] += state[0UL]; state[0UL] += state[0UL]; } } else { copy14 = *((char *)(& state[0UL]) + 3); *((char *)(& state[0UL]) + 3) = *((char *)(& state[0UL]) + 1); *((char *)(& state[0UL]) + 1) = copy14; } output[0UL] = state[0UL] + 1862410167U; } }
the_stack_data/49776.c
#include<stdio.h> int main() { int n, min, max; scanf("%d" , &n); if(n%7==6){ min=((n/7)*2)+1; } else{ min=(n/7)*2; } if(n%7==1){ max=min+1; } else if(n%7>=2){ if(n%7==6) max=min+1; else max=min+2; } else max=min; printf("%d %d" , min, max); return 0; }
the_stack_data/93889038.c
#include <stdio.h> int main(void) { printf("hello from iife!\n"); return 0; }
the_stack_data/22012436.c
#include<stdio.h> #include<stdlib.h> typedef struct node { int info; struct node* next; }list; list *insert(list *hd,int a) { list* temp=(list*)malloc(sizeof(list)); temp->info=a; temp->next=hd; return(temp); } void separ(list *hd) { list *i=hd,*j;int t; while(i!=NULL) { j=i->next; if((i->info)%2!=0) { while(j!=NULL){ if(((j->info)%2==0)&&((i->info)%2!=0)) { t=i->info; i->info=j->info; j->info=t; break; } j=j->next; } }i=i->next; } } void display(list *hd) { while(hd!=NULL) { printf("%d ",hd->info); hd=hd->next; } } int main() { list *head=NULL; int no,total,i=1; char ch; do { printf("Enter the element you want to insert :"); scanf("%d",&no); head=insert(head,no); fflush(stdin); printf("Do you want to insert more Y/N"); scanf("%c",&ch); }while(ch=='y'||ch=='Y'); display(head); printf("\n"); separ(head); display(head); }
the_stack_data/892393.c
/** * @file AETC_GSMS.c * Program for serial communication between Owner and TollPlaza through GSM Module. * Send Success Message * @author Puskar Kothavade, Ashish Pardhi, Mugdha Nazare, IIT Bombay * @date 10/Oct/2010 * @version 1.0 * * @section LICENSE * Copyright (c) 2010. ERTS Lab IIT Bombay * All rights reserved. * Redistribution and use in source and binary forms, with or without *modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holders nor the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * Source code can be used for academic purpose. * For commercial use permission form the author needs to be taken. */ #include<stdio.h> #include<string.h> #include<malloc.h> #include<unistd.h> #include<fcntl.h> #include<errno.h> #include<termios.h> #include <sys/time.h> #include <sys/types.h> /** * Open port for serial communication. * display error messsage if unable to open. */ int port_open(void) { int fd; fd = open("/dev/ttyS0",O_RDWR | O_NOCTTY | O_NDELAY); if(fd == -1) { perror("Unable to open the port: /dev/ttyS0"); } else { fcntl(fd,F_SETFL,0); } return(fd); //return file descriptor } /** * Configure port * @param fd File Descriptor to access serial port */ void port_config(int fd) { struct termios settings; tcgetattr(fd,&settings); cfsetispeed(&settings,9600); cfsetospeed(&settings,9600); settings.c_cflag |= (CLOCAL | CREAD); settings.c_cflag &= ~PARENB; settings.c_cflag &= ~CSTOPB; settings.c_cflag &= ~CSIZE; settings.c_cflag |= CS8; tcsetattr(fd,TCSANOW,&settings); } /** *Generate Delay of two seconds. * */ void del_2s(void) // Delay for wait { unsigned char r, s; for(r=0;r<125;r++) for(s=0;s<255;s++); void del_1s(void) { unsigned char p, q; for(p=0;p<125;p++) for(q=0;q=125;q++); } } /** *Send Message to register owner * @param fd File Descriptor to access serial port * @param *c character pointer */ void write_data(int fd,char *c) { char s[2] = ""; int n; char *charPointer; charPointer = (char *)malloc(sizeof(char) * 10);//Allocate memory sprintf(charPointer,"%x",26); n = write(fd, c, strlen(c)); if(n<0) { fputs("write() of data failed! \n",stderr); } printf("sent String: %d\n",n); n = write(fd, "\nAT\r", 4); sleep(2); n = write(fd, "AT+IPR=9600\r",12); sleep(2); n = write(fd, "AT+CSQ\r", 7); sleep(2); n = write(fd, "AT+CMGF=1\r", 10); sleep(2); n = write(fd, "AT+CMGS=\"9619821002\"\r", 21); sleep(5); n = write(fd, "Dear Customer, 100 Rupees Have Been Deducted From Your Account. Thank You!\n", 76); n = write(fd, "\x1a", 3); sleep(2); n = write(fd, "\rAT+CMGR=1\n", 11); } /** * Close port for reuse * @param fd File Descriptor to access serial port */ void port_close(int fd) { close(fd); } int main(void) { int fd;///< File Descriptor to access serial port fd = port_open(); // Open Port port_config(fd); //Configure Port write_data(fd,""); //Write Message del_2s(); //Generate Delay port_close(fd); //Close Port return 0; //Return }
the_stack_data/504930.c
/* Copyright (C) 2015 Roger Clark <www.rogerclark.net> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * * Utility to send the reset sequence on RTS and DTR and chars * which resets the libmaple and causes the bootloader to be run * * * * Terminal control code by Heiko Noordhof (see copyright below) */ /* Copyright (C) 2003 Heiko Noordhof <heikyAusers.sf.net> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include <stdio.h> #include <stdlib.h> #include <termios.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <sys/ioctl.h> #include <stdbool.h> /* Function prototypes (belong in a seperate header file) */ int openserial(char *devicename); void closeserial(void); int setDTR(unsigned short level); int setRTS(unsigned short level); /* Two globals for use by this module only */ static int fd; static struct termios oldterminfo; void closeserial(void) { tcsetattr(fd, TCSANOW, &oldterminfo); close(fd); } int openserial(char *devicename) { struct termios attr; if ((fd = open(devicename, O_RDWR)) == -1) return 0; /* Error */ atexit(closeserial); if (tcgetattr(fd, &oldterminfo) == -1) return 0; /* Error */ attr = oldterminfo; attr.c_cflag |= CRTSCTS | CLOCAL; attr.c_oflag = 0; if (tcflush(fd, TCIOFLUSH) == -1) return 0; /* Error */ if (tcsetattr(fd, TCSANOW, &attr) == -1) return 0; /* Error */ /* Set the lines to a known state, and */ /* finally return non-zero is successful. */ return setRTS(0) && setDTR(0); } /* For the two functions below: * level=0 to set line to LOW * level=1 to set line to HIGH */ int setRTS(unsigned short level) { int status; if (ioctl(fd, TIOCMGET, &status) == -1) { perror("setRTS(): TIOCMGET"); return 0; } if (level) status |= TIOCM_RTS; else status &= ~TIOCM_RTS; if (ioctl(fd, TIOCMSET, &status) == -1) { perror("setRTS(): TIOCMSET"); return 0; } return 1; } int setDTR(unsigned short level) { int status; if (ioctl(fd, TIOCMGET, &status) == -1) { perror("setDTR(): TIOCMGET"); return 0; } if (level) status |= TIOCM_DTR; else status &= ~TIOCM_DTR; if (ioctl(fd, TIOCMSET, &status) == -1) { perror("setDTR: TIOCMSET"); return 0; } return 1; } /* This portion of code was written by Roger Clark * It was informed by various other pieces of code written by Leaflabs to reset their * Maple and Maple mini boards */ main(int argc, char *argv[]) { if (argc<2 || argc >3) { printf("Usage upload-reset <serial_device> <Optional_delay_in_milliseconds>\n\r"); return; } if (openserial(argv[1])) { // Send magic sequence of DTR and RTS followed by the magic word "1EAF" setRTS(false); setDTR(false); setDTR(true); usleep(50000L); setDTR(false); setRTS(true); setDTR(true); usleep(50000L); setDTR(false); usleep(50000L); write(fd,"1EAF",4); closeserial(); if (argc==3) { usleep(atol(argv[2])*1000L); } } else { printf("Failed to open serial device.\n\r"); } }
the_stack_data/1192407.c
/* getopt_long and getopt_long_only entry points for GNU getopt. Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include "getopt.h" #if !defined __STDC__ || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ #ifndef const #define const #endif #endif #include <stdio.h> /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #define GETOPT_INTERFACE_VERSION 2 #if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 #include <gnu-versions.h> #if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION #define ELIDE_CODE #endif #endif #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ #include <stdlib.h> #endif #ifndef NULL #define NULL 0 #endif int getopt_long (argc, argv, options, long_options, opt_index) int argc; char *const *argv; const char *options; const struct option *long_options; int *opt_index; { return _getopt_internal (argc, argv, options, long_options, opt_index, 0); } /* Like getopt_long, but '-' as well as '--' can indicate a long option. If an option that starts with '-' (not '--') doesn't match a long option, but does match a short option, it is parsed as a short option instead. */ int getopt_long_only (argc, argv, options, long_options, opt_index) int argc; char *const *argv; const char *options; const struct option *long_options; int *opt_index; { return _getopt_internal (argc, argv, options, long_options, opt_index, 1); } #endif /* Not ELIDE_CODE. */ #ifdef TEST #include <stdio.h> int main (argc, argv) int argc; char **argv; { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; int option_index = 0; static struct option long_options[] = { {"add", 1, 0, 0}, {"append", 0, 0, 0}, {"delete", 1, 0, 0}, {"verbose", 0, 0, 0}, {"create", 0, 0, 0}, {"file", 1, 0, 0}, {0, 0, 0, 0} }; c = getopt_long (argc, argv, "abc:d:0123456789", long_options, &option_index); if (c == -1) break; switch (c) { case 0: printf ("option %s", long_options[option_index].name); if (optarg) printf (" with arg %s", optarg); printf ("\n"); break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case 'd': printf ("option d with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */
the_stack_data/325908.c
#include<stdio.h> int main() { int i,j,k,a[10]={0},x,y,z,t=0; scanf("%d%d%d",&x,&y,&z); for(i=1;i<987;i++) { if(x*i<=987) { a[x*i%10]++; a[x*i/10%10]++; a[x*i/100]++; } if(y*i<=987) { a[y*i%10]++; a[y*i/10%10]++; a[y*i/100]++; } if(z*i<=987) { a[z*i%10]++; a[z*i/10%10]++; a[z*i/100]++; } for(j=1;j<=9;j++) if(a[j]==0) break; if(j>=10) { printf("%d %d %d\n",x*i,y*i,z*i); t=1; } for(j=1;j<=9;j++) a[j]=0; } if(t==0) printf("No!!!"); return 0; }
the_stack_data/23067.c
#include <stdio.h> //Compiler version gcc 6.3.0 int main() { int T, i, j, x; char S[1000]; scanf("%d", &T); for(i = 0; i < T; i++) { x = 0; for(j = 0; j < 1000; j++) S[j] = 0; scanf("%s", S); for(j = 0; j < 1000; j++) { if(S[j] == 0) break; x += S[j] - 'a' + 1; } printf("%d\n", x); } return 0; }
the_stack_data/198580420.c
#include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <string.h> #include <math.h> #define forr(i, a, b) for(int i=a;i<b;i++) #define forp(i, a, b) for(int i=a;i<=b;i++) #define times(n) int _n=n;while(_n--) #define mset(d, v) memset(d,v,sizeof(d)) #define min(a, b) (((a)<=(b))?(a):(b)) #define swap(a, b) (a)^=(b)^=(a)^=(b) #define read(x) int x;scanf("%ld",&x) #define prtl() putchar('\n') #define prti(x) printf("%ld", x) #define prta(x, a, b) forr(i,a,b){if(i!=a)putchar(' ');prti(x[i]);} #define N 1000001 /* Median (25) */ int main() { long int* x = malloc(N * sizeof(long int)); if (!x) return 0; read(n); forr(i, N-n, N) scanf("%ld", &x[i]); // put to end long int *p = &x[N-n], *q = x, *end = &x[N]; read(m); forr(i, 0, m) { read(z); while (p!=end && *p<=z) *q++ = *p++; // merge *q++ = z; } while (p != end) *q++ = *p++; // fill the rest n += m; // prta(x, 0, n); prtl(); prti((n&1) ? x[n>>1] : (x[n>>1]+x[(n>>1)-1])>>1); } /* int main() { read(n); int* x = malloc(n * sizeof(long int)); forr(i, 0, n) scanf("%d", &x[i]); read(m); int* y = malloc((n + m) * sizeof(long int)); int *p = x, *q = y; forr(i, 0, m) { read(z); while ((p-x<n) && *p <= z) *q++ = *p++; // merge *q++ = z; } while (p - x < n) *q++ = *p++; n += m; prti((n&1) ? y[(n-1)>>1] : (y[n>>1]+y[(n>>1)-1])>>1); } */ /* long int x[N], y[N]; int main() { read(n); forr(i, 0, n) scanf("%d", &x[i]); read(m); forr(i, 0, n) scanf("%d", &y[i]); int xleft = 0, xright = n - 1, xlen = n; int yleft = 0, yright = m - 1, ylen = m; while (xlen>=1 && ylen>=1) { int xidx = (xleft + xright) >> 1; int xhalf = xidx - xleft + 1; double xmid = (xlen & 1) ? x[xidx] : (x[xidx] + x[xidx+1]) / 2; int yidx = (yleft + yright) >> 1; int yhalf = yidx - yleft + 1; double ymid = (ylen & 1) ? y[yidx] : (y[yidx] + y[yidx+1]) / 2; int half = min(xhalf, yhalf); if (xmid <= ymid) { xleft += half; yright -= half; } else { yleft += half; xright -= half; } } } */
the_stack_data/151706020.c
// RUN: %clang_tsan -O1 %s -o %t && not %t 2>&1 | FileCheck %s #include <pthread.h> #include <stdio.h> #include <stddef.h> #include <unistd.h> pthread_mutex_t Mtx; int Global; void *Thread1(void *x) { pthread_mutex_init(&Mtx, 0); pthread_mutex_lock(&Mtx); Global = 42; pthread_mutex_unlock(&Mtx); return NULL; } void *Thread2(void *x) { sleep(1); pthread_mutex_lock(&Mtx); Global = 43; pthread_mutex_unlock(&Mtx); return NULL; } int main() { pthread_t t[2]; pthread_create(&t[0], NULL, Thread1, NULL); pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); pthread_mutex_destroy(&Mtx); return 0; } // CHECK: WARNING: ThreadSanitizer: data race // CHECK-NEXT: Atomic read of size 1 at {{.*}} by thread T2: // CHECK-NEXT: #0 pthread_mutex_lock // CHECK-NEXT: #1 Thread2{{.*}} {{.*}}race_on_mutex.c:20{{(:3)?}} ({{.*}}) // CHECK: Previous write of size 1 at {{.*}} by thread T1: // CHECK-NEXT: #0 pthread_mutex_init {{.*}} ({{.*}}) // CHECK-NEXT: #1 Thread1{{.*}} {{.*}}race_on_mutex.c:11{{(:3)?}} ({{.*}})
the_stack_data/161079921.c
#include <stdio.h> #include <stdlib.h> int* twoSum(int* nums, int numsSize, int target, int* returnSize) { int i, j; *returnSize = 2; int* ans = malloc((*returnSize) * sizeof(int)); for (i = 0; i < numsSize; i++) { for (j = i + 1; j < numsSize; j++) { if (nums[i] + nums[j] == target) { ans[0] = i; ans[1] = j; return ans; } } } return ans; } int main() { int numbers[4] = {2, 7, 11, 15}; int returnSize = -1; int* ans = twoSum(numbers, 4, 9, &returnSize); printf("%d %d\n", ans[0], ans[1]); free(ans); }
the_stack_data/11074828.c
//***************************************************************************** // // startup_gcc.c - Startup code for use with GNU tools. // // Copyright (c) 2007-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 EK-LM3S811 Firmware Package. // //***************************************************************************** //***************************************************************************** // // Forward declaration of the default fault handlers. // //***************************************************************************** void ResetISR(void); static void NmiSR(void); static void FaultISR(void); static void IntDefaultHandler(void); //***************************************************************************** // // External declaration for the interrupt handler used by the application. // //***************************************************************************** extern void MPUFaultHandler(void); //***************************************************************************** // // The entry point for the application. // //***************************************************************************** extern int main(void); //***************************************************************************** // // Reserve space for the system stack. // //***************************************************************************** static unsigned long pulStack[64]; //***************************************************************************** // // 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 MPUFaultHandler, // The MPU fault handler IntDefaultHandler, // The bus fault handler IntDefaultHandler, // The usage fault handler 0, // Reserved 0, // Reserved 0, // Reserved 0, // Reserved IntDefaultHandler, // SVCall handler IntDefaultHandler, // Debug monitor handler 0, // Reserved IntDefaultHandler, // The PendSV handler IntDefaultHandler, // The SysTick handler IntDefaultHandler, // GPIO Port A IntDefaultHandler, // GPIO Port B IntDefaultHandler, // GPIO Port C IntDefaultHandler, // GPIO Port D IntDefaultHandler, // GPIO Port E IntDefaultHandler, // UART0 Rx and Tx IntDefaultHandler, // UART1 Rx and Tx IntDefaultHandler, // SSI0 Rx and Tx IntDefaultHandler, // I2C0 Master and Slave IntDefaultHandler, // PWM Fault IntDefaultHandler, // PWM Generator 0 IntDefaultHandler, // PWM Generator 1 IntDefaultHandler, // PWM Generator 2 IntDefaultHandler, // Quadrature Encoder 0 IntDefaultHandler, // ADC Sequence 0 IntDefaultHandler, // ADC Sequence 1 IntDefaultHandler, // ADC Sequence 2 IntDefaultHandler, // ADC Sequence 3 IntDefaultHandler, // Watchdog timer IntDefaultHandler, // Timer 0 subtimer A IntDefaultHandler, // Timer 0 subtimer B IntDefaultHandler, // Timer 1 subtimer A IntDefaultHandler, // Timer 1 subtimer B IntDefaultHandler, // Timer 2 subtimer A IntDefaultHandler, // Timer 2 subtimer B IntDefaultHandler, // Analog Comparator 0 IntDefaultHandler, // Analog Comparator 1 IntDefaultHandler, // Analog Comparator 2 IntDefaultHandler, // System Control (PLL, OSC, BO) IntDefaultHandler // FLASH Control }; //***************************************************************************** // // 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/593778.c
/* Sample UDP client */ #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <stdio.h> // exit #include <stdlib.h> // bzero #include <strings.h> // printf #include <stdio.h> // getpid #include <sys/types.h> #include <unistd.h> #define PORTNUMBER 32000 int main(int argc, char**argv) { int sockfd,c=0,pid; struct sockaddr_in servaddr; char sendline[1400]; if (argc != 2) { printf("usage: udp-client <IP address>\n"); exit(1); } sockfd=socket(AF_INET,SOCK_DGRAM,0); bzero(&servaddr,sizeof(servaddr)); servaddr.sin_family = AF_INET; servaddr.sin_addr.s_addr=inet_addr(argv[1]); servaddr.sin_port=htons(PORTNUMBER); pid = getpid(); while (1) { c++; snprintf ( (char*)&sendline, sizeof(sendline), "+wys9i9fPAzx0MvRzwe0ZqoNv1fYoqjWbGFTNE97KfewSJXsrDnWb4GX/5NbCsSS7e/O6NptAR9e oKnX0cQvji4BoGNIkm1hQ3Ux3eb0jcy7zQkdVgSGwP691a9QWzSJpE96V4Klid1se32SPHfDmAZN leapTKjCeusG2ryGtJJtUh78gl12RAWKMYu7xmL4J41zR96HHsSEEE0o2xqS4rvK7fZP92nDWRrt LDGj9eRXVulOQxUbnKS/adC2/bwgu5PNPfnfW850UXeiSUyhl1COUpy6jdDKScSUA6mPlcGGNfUq c5FZbqT6Xi9iMQ5NLjf2Umrgjr3YCrshORqSZFz6PYm3LDESwf++dFWvjTTNI/1wrEW4WyHbKQI/ UbCT+yaznys5M+vyDGCnVz5rDLVjraFEgoSyLEt6xNUtyTTPNA9j6AUXAulxpc3C4gPAGCtG4fyg AqgwETJp5BkOURWxzcUTgkc48EhS9w4Nh9jM9bU8cugROeEBl3ttgZa/PWDI8OQndF45wckOjfKA Ws/6P3xqIes41MPABHzxTiCjW6xDT2qrOM1io4RlmNEhzVPPj7c1iwAH6PhqW4ByCOLkidFi9q3D S7MF0mALxzenjrzs764p8PkalLYkYvM8RoRMNSVJh3v2I525kZrRA/hvS5h9r+Cs5q1OiBQ5TXz3 hke6Q1lTiFyVOXBxQT31HqykLBj9xbEezUAP9kvgT/Jmd8L2Aswg3aqu1wInbu2K8mwOqC/djhn5 H7qtjGLZ1cphEIVauDoOTaq17ecHwWK8Rn8CdbMBBDT6OKX517g3oO/VdqimmPl0fu7VSKmqVnF3 UqKbdJ6Ytqsu1b5YHoujjPnRdd25wryDAv36WLUl76UyVFdChHzd12U1OwdNposwDUa+nzaYJTMa a2aqsPu3gXmC1oiu/una66EA4MpV078WU1RM2szXcBXWjoFXrNl/YqRIralWhuJjFI6IF5lvupzJ : %09d", c ); sendto(sockfd,sendline,sizeof(sendline),0, (struct sockaddr *)&servaddr,sizeof(servaddr)); if ( (c % 1000000) == 0 ) { printf ( "[%d] Packets Sent: %d \n", pid, c ); } } }
the_stack_data/93969.c
// RUN: %check %s -std=c89 // RUN: echo 'long long l;' | %ucc - -std=c99 -fsyntax-only 2>&1 | grep .; [ $? -ne 0 ] long long l; // CHECK: /warning: long long is a C99 feature/ f() { return 5LL; // CHECK: /warning: long long is a C99 feature/ }
the_stack_data/26699237.c
#include <stdio.h> int wcount(char*); int main() { char string[256]={0}; int i=0; gets(string); i = wcount(string); printf("%d", i); return 0; } int wcount(char* string){ int i=0; int count=0; while(string[i]!='\0'){ if(string[i]!=' '){ count++; while(string[i]!=' ' && string[i]!='\0'){ i++; } } i++; } return count; }
the_stack_data/554578.c
/*Exercise 2 - Selection Write a program to calculate the amount to be paid for a rented vehicle. • Input the distance the van has travelled • The first 30 km is at a rate of 50/= per km. • The remaining distance is calculated at the rate of 40/= per km. e.g. Distance -> 20 Amount = 20 x 50 = 1000 Distance -> 50 Amount = 30 x 50 + (50-30) x 40 = 2300*/ #include <stdio.h> int main() { int dist,amount; printf("Enter distance in km:"); scanf("%d",&dist); if(dist<=30){ amount=dist*50; } else{ amount=(30*50)+(dist-30)*40; } printf("Amount payable:%d",amount); return 0; }
the_stack_data/375540.c
#include <stdio.h> #include <stdlib.h> #include <math.h> // 計算する関数 double f(double x) { return x+cos(x);//計算する式 } // 二分法 void bisection(double a, double b, double *solution, int *N) { int i = 0; double s; double eps = pow(2.0, -30.0);//収束条件 // 解が収束条件を満たせば終了 while (fabs(b-a)>=eps){ i++; s = (a+b)/2.0; if(f(s) * f(a)<0) b=s; else a = s; if(i==100) break; // 100回繰り返したら強制終了 }; *N = i;//繰り返し回数 *solution = s;//解 } int main() { double solution; int N; // 二分法 bisection(-10000.0, 10000.0, &solution, &N);//初期区間:a,b printf("解:%f (繰り返し回数:%d )\n",solution,N); return 0; }
the_stack_data/103266030.c
#include <stdio.h> int conta_digitos (unsigned long int num1, int num2 ) { int i,contador; while (num1 != 0) { if ((num1 % 10) == num2) { contador += 1; } num1 = num1 / 10; } return contador; } /* ----- end of function conta_digitos ----- */
the_stack_data/112054.c
#include <stdio.h> //DEMONSTRATION OF switch()... case... main() { int option = 0; do{ printf("\n\n Where is Taj Mahal?"); printf("\n 1: Mumbai \t 2: Delhi \t 3: Agra \t 4: Mathura"); printf("\n\n Select the right option (1-4) : "); scanf("%d", &option); switch( option ) { case 1: printf("\n Too Far"); break; case 2: printf("\n Close but not quite"); break; case 3: printf("\n Right Option"); break; case 4: printf("\n Almost there"); break; } }while(option != 3); getch(); return 0; }
the_stack_data/135712.c
/* * grouplist.c * * Copyright 2004 by Anthony Howe. All rights reserved. * * To build: * * gcc -o grouplist grouplist.c * * In sendmail.mc (note the tabs in the R lines): * * LOCAL_CONFIG * Kgroup program /usr/local/bin/grouplist * * LOCAL_RULESETS * SLocal_check_rcpt * R$* $: $1 $| $>CanonAddr $1 * R$* $| $+ <@ $=w .> $* $: $1 $| group: $( group $2 $: NOGROUP $) * R$* $| $+ <@ $j .> $* $: $1 $| group: $( group $2 $: NOGROUP $) * R$* $| group: NOGROUP $: $1 * R$* $| group: $+ $#local $: postmaster */ /*********************************************************************** *** No configuration below this point. ***********************************************************************/ #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sysexits.h> #include <sys/types.h> #include <grp.h> #include <pwd.h> char usage[] = "usage: grouplist ... group\n" "\n" "group\t\tthe group id or name to list\n" "\n" "grouplist/1.0 Copyright 2004 by Anthony Howe. All rights reserved.\n" ; int main(int argc, char **argv) { struct group *gr; struct passwd *pw; char *stop, *fmt, **mem; if (argc < 2) { fprintf(stderr, usage); return EX_USAGE; } if ((gr = getgrnam(argv[argc-1])) == NULL) { gid_t group_id = (gid_t) strtol(argv[argc-1], &stop, 10); if (*stop != '\0') return EX_NOUSER; if ((gr = getgrgid(group_id)) == NULL) return EX_NOUSER; } /* Primary group members. */ fmt = "%s"; setpwent(); while ((pw = getpwent()) != NULL) { if (pw->pw_gid == gr->gr_gid) { fprintf(stdout, fmt, pw->pw_name); fmt = ",%s"; } } endpwent(); /* Secondary group members. */ for (mem = gr->gr_mem; *mem != NULL; mem++) { fprintf(stdout, fmt, *mem); fmt = ",%s"; } fputs("\n", stdout); return 0; }
the_stack_data/128603.c
/** * Copyright (c) 2018 Zachary Puls <[email protected]> */ #include <string.h> /** * @brief Returns a string describing the signal number sig. * * @param sig The signal number * @return char* A pointer to a string describing sig */ char *strsignal(int sig) { return ""; }
the_stack_data/22012938.c
/* ============================================================================ Name : arr.c Author : ronak Version : Copyright : Your copyright notice Description : Hello World in C, Ansi-style ============================================================================ */ #include <stdio.h> #include <stdlib.h> int main(void) { int arr[50],i,n,key,loc; printf("Howmany elements you want to insert? : "); scanf(" %d",&n); printf("u can add %d elements in array \n",n); printf("\n enter each elements and press enter : \n"); for(i=0;i<n;i++) { scanf("%d",&arr[i]); }; printf("now your array is:"); for(i=0;i<n;i++) { printf(" %d",arr[i]); }; printf("\nwhich element u want to insert: "); scanf("%d",&key); printf("at which location? : "); scanf("%d",&loc); for(i=n-1;i>=loc;i--) { arr[i+1]=arr[i]; }; arr[loc]=key; printf("now new array is :"); for(i=0;i<=n;i++) { printf("%d ",arr[i]); }; }
the_stack_data/110009.c
/* * Copyright (C) 2001-2003 by egnite Software GmbH. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the copyright holders nor the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH 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 EGNITE * SOFTWARE GMBH 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. * * For additional information see http://www.ethernut.de/ * * Portions of the following functions are derived from material which is * Copyright (c) 1985 by Microsoft Corporation. All rights are reserved. */ /* * $Log$ * Revision 1.8 2008/08/11 06:59:40 haraldkipp * BSD types replaced by stdint types (feature request #1282721). * * Revision 1.7 2005/08/02 17:46:47 haraldkipp * Major API documentation update. * * Revision 1.6 2004/10/14 16:43:00 drsung * Fixed compiler warning "comparison between signed and unsigned" * * Revision 1.5 2003/12/19 22:26:37 drsung * Dox written. * * Revision 1.4 2003/11/27 09:17:18 drsung * Wrong comment fixed * * Revision 1.3 2003/11/26 12:45:20 drsung * Portability issues ... again * * Revision 1.2 2003/11/26 11:13:17 haraldkipp * Portability issues * * Revision 1.1 2003/11/24 18:07:37 drsung * first release * * */ #include <stdint.h> #include <time.h> #include <stddef.h> #define _DAY_SEC (24UL * 60UL * 60UL) /* secs in a day */ #define _YEAR_SEC (365L * _DAY_SEC) /* secs in a year */ #define _FOUR_YEAR_SEC (1461L * _DAY_SEC) /* secs in a 4 year interval */ #define _DEC_SEC 315532800UL /* secs in 1970-1979 */ #define _BASE_YEAR 70L /* 1970 is the base year */ #define _BASE_DOW 4 /* 01-01-70 was a Thursday */ #define _LEAP_YEAR_ADJUST 17L /* Leap years 1900 - 1970 */ #define _MAX_YEAR 138L /* 2038 is the max year */ /* static arrays used by gmtime to determine date and time * values. Shows days from being of year. ***************************************************************/ int __lpdays[] = {-1, 30, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365}; int __days[] = {-1, 30, 58, 89, 119, 150, 180, 211, 242, 272, 303, 333, 364}; int fast_gmtime_r(const time_t *timer, struct tm *ptm) { time_t ctimer = *timer; /* var to calculate with */ uint8_t isleapyear = 0; /* current year is leap year */ uint32_t tmptimer; int *mdays; /* pointer to _numdayslp or _numdays */ if (!ptm) /* check pointer */ return -1; /* First calculate the number of four-year-interval, so calculation of leap year will be simple. Btw, because 2000 IS a leap year and 2100 is out of range, this formula is so simple. */ tmptimer = (uint32_t)(ctimer / _FOUR_YEAR_SEC); ctimer -= ((time_t)tmptimer * _FOUR_YEAR_SEC); /* Determine the correct year within the interval */ tmptimer = (tmptimer * 4) + 70; /* 1970, 1974, 1978,... */ if (ctimer >= (time_t)_YEAR_SEC) { tmptimer++; /* 1971, 1975, 1979,... */ ctimer -= _YEAR_SEC; if (ctimer >= (time_t)_YEAR_SEC) { tmptimer++; /* 1972, 1976, 1980,... (all leap years!) */ ctimer -= _YEAR_SEC; /* A leap year has 366 days, so compare to _YEAR_SEC + _DAY_SEC */ if (ctimer >= (time_t)(_YEAR_SEC + _DAY_SEC)) { tmptimer++; /* 1973, 1977, 1981,... */ ctimer -= (_YEAR_SEC + _DAY_SEC); } else isleapyear = 1; /*If leap year, set the flag */ } } /* tmptimer now has the value for tm_year. ctimer now holds the number of elapsed seconds since the beginning of that year. */ ptm->tm_year = tmptimer; /* Calculate days since January 1st and store it to tm_yday. Leave ctimer with number of elapsed seconds in that day. */ ptm->tm_yday = (int)(ctimer / _DAY_SEC); ctimer -= (time_t)(ptm->tm_yday) * _DAY_SEC; /* Determine months since January (Note, range is 0 - 11) and day of month (range: 1 - 31) */ if (isleapyear) mdays = __lpdays; else mdays = __days; for (tmptimer = 1; mdays[tmptimer] < ptm->tm_yday; tmptimer++) ; ptm->tm_mon = --tmptimer; ptm->tm_mday = ptm->tm_yday - mdays[tmptimer]; /* Calculate day of week. Sunday is 0 */ ptm->tm_wday = ((int)(*timer / _DAY_SEC) + _BASE_DOW) % 7; /* Calculate the time of day from the remaining seconds */ ptm->tm_hour = (int)(ctimer / 3600); ctimer -= (time_t)ptm->tm_hour * 3600L; ptm->tm_min = (int)(ctimer / 60); ptm->tm_sec = (int)(ctimer - (ptm->tm_min) * 60); ptm->tm_isdst = 0; return 0; }
the_stack_data/697806.c
/* * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. */ #pragma ident "%Z%%M% %I% %E% SMI" #include <stdio.h> #include <ctype.h> /* * fgrep -- print all lines containing any of a set of keywords * * status returns: * 0 - ok, and some matches * 1 - ok, but no matches * 2 - some error */ #define MAXSIZ 700 #define QSIZE 400 struct words { char inp; char out; struct words *nst; struct words *link; struct words *fail; } *www, *smax, *q; char buf[2*BUFSIZ]; int nsucc; int need; char *instr; int inct; int rflag; int xargc; char **xargv; int numwords; int nfound; static int flag = 0; extern void err(); extern void *zalloc(); static void cfail(void); static void cgotofn(void); static void execute(void); static char gch(void); static int new(struct words *x); static void overflo(void); int fgrep(int argc, char **argv) { nsucc = need = inct = rflag = numwords = nfound = 0; instr = 0; flag = 0; if (www == 0) www = (struct words *)zalloc(MAXSIZ, sizeof (*www)); if (www == NULL) err(gettext("Can't get space for machines"), 0); for (q = www; q < www+MAXSIZ; q++) { q->inp = 0; q->out = 0; q->nst = 0; q->link = 0; q->fail = 0; } xargc = argc-1; xargv = argv+1; while (xargc > 0 && xargv[0][0] == '-') { switch (xargv[0][1]) { case 'r': /* return value only */ rflag++; break; case 'n': /* number of answers needed */ need = (int)xargv[1]; xargv++; xargc--; break; case 'i': instr = xargv[1]; inct = (int)xargv[2]+2; #if D2 fprintf(stderr, "inct %d xargv.2. %o %d\n", inct, xargv[2], xargv[2]); #endif xargv += 2; xargc -= 2; break; } xargv++; xargc--; } if (xargc <= 0) { write(2, "bad fgrep call\n", 15); exit(2); } #if D1 fprintf(stderr, "before cgoto\n"); #endif cgotofn(); #if D1 fprintf(stderr, "before cfail\n"); #endif cfail(); #if D1 fprintf(stderr, "before execute instr %.20s\n", instr? instr: ""); fprintf(stderr, "end of string %d %c %c %c\n", inct, instr ? instr[inct-3] : '\0', instr ? instr[inct-2] : '\0', instr ? instr[inct-1] : '\0'); #endif execute(); #if D1 fprintf(stderr, "returning nsucc %d\n", nsucc); fprintf(stderr, "fgrep done www %o\n", www); #endif return (nsucc == 0); } static void execute(void) { char *p; struct words *c; char ch; int ccount; int f; char *nlp; f = 0; ccount = instr ? inct : 0; nfound = 0; p = instr ? instr : buf; if (need == 0) need = numwords; nlp = p; c = www; #if D2 fprintf(stderr, "in execute ccount %d inct %d\n", ccount, inct); #endif for (;;) { #if D3 fprintf(stderr, "down ccount\n"); #endif if (--ccount <= 0) { #if D2 fprintf(stderr, "ex loop ccount %d instr %o\n", ccount, instr); #endif if (instr) break; if (p == &buf[2*BUFSIZ]) p = buf; if (p > &buf[BUFSIZ]) { if ((ccount = read(f, p, &buf[2*BUFSIZ] - p)) <= 0) break; } else if ((ccount = read(f, p, BUFSIZ)) <= 0) break; #if D2 fprintf(stderr, " normal read %d bytres\n", ccount); { char xx[20]; sprintf(xx, "they are %%.%ds\n", ccount); fprintf(stderr, xx, p); } #endif } nstate: ch = *p; #if D2 fprintf(stderr, "roaming along in ex ch %c c %o\n", ch, c); #endif if (isupper(ch)) ch |= 040; if (c->inp == ch) { c = c->nst; } else if (c->link != 0) { c = c->link; goto nstate; } else { c = c->fail; if (c == 0) { c = www; istate: if (c->inp == ch) { c = c->nst; } else if (c->link != 0) { c = c->link; goto istate; } } else goto nstate; } if (c->out && new(c)) { #if D2 fprintf(stderr, " found: nfound %d need %d\n", nfound, need); #endif if (++nfound >= need) { #if D1 fprintf(stderr, "found, p %o nlp %o ccount %d buf %o buf[2*BUFSIZ] %o\n", p, nlp, ccount, buf, buf+2*BUFSIZ); #endif if (instr == 0) while (*p++ != '\n') { #if D3 fprintf(stderr, "down ccount2\n"); #endif if (--ccount <= 0) { if (p == &buf[2*BUFSIZ]) p = buf; if (p > &buf[BUFSIZ]) { if ((ccount = read(f, p, &buf[2*BUFSIZ] - p)) <= 0) break; } else if ((ccount = read(f, p, BUFSIZ)) <= 0) break; #if D2 fprintf(stderr, " read %d bytes\n", ccount); { char xx[20]; sprintf(xx, "they are %%.%ds\n", ccount); fprintf(stderr, xx, p); } #endif } } nsucc = 1; if (rflag == 0) { #if D2 fprintf(stderr, "p %o nlp %o buf %o\n", p, nlp, buf); if (p > nlp) {write(2, "XX\n", 3); write(2, nlp, p-nlp); write(2, "XX\n", 3); } #endif if (p > nlp) write(1, nlp, p-nlp); else { write(1, nlp, &buf[2*BUFSIZ] - nlp); write(1, buf, p-&buf[0]); } if (p[-1] != '\n') write(1, "\n", 1); } if (instr == 0) { nlp = p; c = www; nfound = 0; } } else ccount++; continue; } #if D2 fprintf(stderr, "nr end loop p %o\n", p); #endif if (instr) p++; else if (*p++ == '\n') { nlp = p; c = www; nfound = 0; } } if (instr == 0) close(f); } static void cgotofn(void) { char c; struct words *s; s = smax = www; nword: for (;;) { #if D1 fprintf(stderr, " in for loop c now %o %c\n", c, c > ' ' ? c : ' '); #endif if ((c = gch()) == 0) return; else if (c == '\n') { s->out = 1; s = www; } else { loop: if (s->inp == c) { s = s->nst; continue; } if (s->inp == 0) goto enter; if (s->link == 0) { if (smax >= &www[MAXSIZ - 1]) overflo(); s->link = ++smax; s = smax; goto enter; } s = s->link; goto loop; } } enter: do { s->inp = c; if (smax >= &www[MAXSIZ - 1]) overflo(); s->nst = ++smax; s = smax; } while ((c = gch()) != '\n') ; smax->out = 1; s = www; numwords++; goto nword; } static char gch(void) { static char *s; if (flag == 0) { flag = 1; s = *xargv++; #if D1 fprintf(stderr, "next arg is %s xargc %d\n", xargc > 0 ? s : "", xargc); #endif if (xargc-- <= 0) return (0); } if (*s) return (*s++); for (flag = 0; flag < 2*BUFSIZ; flag++) buf[flag] = 0; flag = 0; return ('\n'); } static void overflo(void) { write(2, "wordlist too large\n", 19); exit(2); } static void cfail(void) { struct words *queue[QSIZE]; struct words **front, **rear; struct words *state; char c; struct words *s; s = www; front = rear = queue; init: if ((s->inp) != 0) { *rear++ = s->nst; if (rear >= &queue[QSIZE - 1]) overflo(); } if ((s = s->link) != 0) { goto init; } while (rear != front) { s = *front; if (front == &queue[QSIZE-1]) front = queue; else front++; cloop: if ((c = s->inp) != 0) { *rear = (q = s->nst); if (front < rear) if (rear >= &queue[QSIZE-1]) if (front == queue) overflo(); else rear = queue; else rear++; else if (++rear == front) overflo(); state = s->fail; floop: if (state == 0) state = www; if (state->inp == c) { q->fail = state->nst; if ((state->nst)->out == 1) q->out = 1; continue; } else if ((state = state->link) != 0) goto floop; } if ((s = s->link) != 0) goto cloop; } } static struct words *seen[50]; static int new(struct words *x) { int i; for (i = 0; i < nfound; i++) if (seen[i] == x) return (0); seen[i] = x; return (1); }
the_stack_data/36074742.c
/* Generated by CIL v. 1.7.0 */ /* print_CIL_Input is false */ struct _IO_FILE; struct timeval; extern float strtof(char const *str , char const *endptr ) ; extern void signal(int sig , void *func ) ; typedef struct _IO_FILE FILE; extern int atoi(char const *s ) ; extern double strtod(char const *str , char const *endptr ) ; extern int fclose(void *stream ) ; extern void *fopen(char const *filename , char const *mode ) ; extern void abort() ; extern void exit(int status ) ; extern int raise(int sig ) ; extern int fprintf(struct _IO_FILE *stream , char const *format , ...) ; extern int strcmp(char const *a , char const *b ) ; extern int rand() ; extern unsigned long strtoul(char const *str , char const *endptr , int base ) ; void RandomFunc(unsigned short input[1] , unsigned short output[1] ) ; extern int strncmp(char const *s1 , char const *s2 , unsigned long maxlen ) ; extern int gettimeofday(struct timeval *tv , void *tz , ...) ; extern int printf(char const *format , ...) ; int main(int argc , char *argv[] ) ; void megaInit(void) ; extern unsigned long strlen(char const *s ) ; extern long strtol(char const *str , char const *endptr , int base ) ; extern unsigned long strnlen(char const *s , unsigned long maxlen ) ; extern void *memcpy(void *s1 , void const *s2 , unsigned long size ) ; struct timeval { long tv_sec ; long tv_usec ; }; extern void *malloc(unsigned long size ) ; extern int scanf(char const *format , ...) ; int main(int argc , char *argv[] ) { unsigned short input[1] ; unsigned short output[1] ; int randomFuns_i5 ; unsigned short randomFuns_value6 ; int randomFuns_main_i7 ; { megaInit(); if (argc != 2) { printf("Call this program with %i arguments\n", 1); exit(-1); } else { } randomFuns_i5 = 0; while (randomFuns_i5 < 1) { randomFuns_value6 = (unsigned short )strtoul(argv[randomFuns_i5 + 1], 0, 10); input[randomFuns_i5] = randomFuns_value6; randomFuns_i5 ++; } RandomFunc(input, output); if (output[0] == (unsigned short)31026) { printf("You win!\n"); } else { } randomFuns_main_i7 = 0; while (randomFuns_main_i7 < 1) { printf("%u\n", output[randomFuns_main_i7]); randomFuns_main_i7 ++; } } } void RandomFunc(unsigned short input[1] , unsigned short output[1] ) { unsigned short state[1] ; unsigned short local1 ; char copy12 ; { state[0UL] = (input[0UL] + 51238316UL) + (unsigned short)8426; local1 = 0UL; while (local1 < input[1UL]) { if (state[0UL] < local1) { if (! (state[0UL] == local1)) { copy12 = *((char *)(& state[0UL]) + 0); *((char *)(& state[0UL]) + 0) = *((char *)(& state[0UL]) + 1); *((char *)(& state[0UL]) + 1) = copy12; copy12 = *((char *)(& state[0UL]) + 1); *((char *)(& state[0UL]) + 1) = *((char *)(& state[0UL]) + 0); *((char *)(& state[0UL]) + 0) = copy12; } } else { state[local1] += state[local1]; } local1 += 2UL; } output[0UL] = (state[0UL] + 760496316UL) + (unsigned short)39351; } } void megaInit(void) { { } }
the_stack_data/1201531.c
//Other_Binary_Search #include <stdio.h> #include <stdlib.h> #define len 5 int binarySearch(int array[], int leng, int searchX) { int pos = -1, right, left, i = 0; left = 0; right = leng - 1; for (i = 0; i < leng; i++) { pos = (left + right) / 2; if (array[pos] == searchX) return pos; else { if (array[pos] < searchX) left = pos + 1; else { right = pos - 1; } } } } void main(int argc, char *argv[]) { int array[len] = { 5, 8 , 10 , 14 ,16 }; int position; position = binarySearch(array, len, 5); if (position < 0) printf("The number %d doesnt exist in array\n", 5); else { printf("The number %d exist in array at position : %d \n", 5, position); } }
the_stack_data/98575135.c
extern float __VERIFIER_nondet_float(void); extern int __VERIFIER_nondet_int(void); typedef enum {false, true} bool; bool __VERIFIER_nondet_bool(void) { return __VERIFIER_nondet_int() != 0; } int main() { bool _EL_X_94, _x__EL_X_94; float x_3, _x_x_3; float x_1, _x_x_1; float x_2, _x_x_2; bool _EL_X_92, _x__EL_X_92; bool _EL_U_90, _x__EL_U_90; float x_0, _x_x_0; int __steps_to_fair = __VERIFIER_nondet_int(); _EL_X_94 = __VERIFIER_nondet_bool(); x_3 = __VERIFIER_nondet_float(); x_1 = __VERIFIER_nondet_float(); x_2 = __VERIFIER_nondet_float(); _EL_X_92 = __VERIFIER_nondet_bool(); _EL_U_90 = __VERIFIER_nondet_bool(); x_0 = __VERIFIER_nondet_float(); bool __ok = (1 && _EL_X_94); while (__steps_to_fair >= 0 && __ok) { if ((( !(12.0 <= (x_1 + (-1.0 * x_2)))) || ( !(( !(12.0 <= (x_1 + (-1.0 * x_2)))) || (( !(6.0 <= (x_0 + (-1.0 * x_1)))) && _EL_U_90))))) { __steps_to_fair = __VERIFIER_nondet_int(); } else { __steps_to_fair--; } _x__EL_X_94 = __VERIFIER_nondet_bool(); _x_x_3 = __VERIFIER_nondet_float(); _x_x_1 = __VERIFIER_nondet_float(); _x_x_2 = __VERIFIER_nondet_float(); _x__EL_X_92 = __VERIFIER_nondet_bool(); _x__EL_U_90 = __VERIFIER_nondet_bool(); _x_x_0 = __VERIFIER_nondet_float(); __ok = ((((((((x_0 + (-1.0 * _x_x_0)) <= -2.0) && ((x_1 + (-1.0 * _x_x_0)) <= -1.0)) && (((x_0 + (-1.0 * _x_x_0)) == -2.0) || ((x_1 + (-1.0 * _x_x_0)) == -1.0))) && ((((x_1 + (-1.0 * _x_x_1)) <= -7.0) && ((x_2 + (-1.0 * _x_x_1)) <= -12.0)) && (((x_1 + (-1.0 * _x_x_1)) == -7.0) || ((x_2 + (-1.0 * _x_x_1)) == -12.0)))) && ((((x_0 + (-1.0 * _x_x_2)) <= -5.0) && ((x_3 + (-1.0 * _x_x_2)) <= -3.0)) && (((x_0 + (-1.0 * _x_x_2)) == -5.0) || ((x_3 + (-1.0 * _x_x_2)) == -3.0)))) && ((((x_2 + (-1.0 * _x_x_3)) <= -7.0) && ((x_3 + (-1.0 * _x_x_3)) <= -17.0)) && (((x_2 + (-1.0 * _x_x_3)) == -7.0) || ((x_3 + (-1.0 * _x_x_3)) == -17.0)))) && ((_EL_X_94 == _x__EL_X_92) && ((_EL_U_90 == ((_x__EL_U_90 && ( !(6.0 <= (_x_x_0 + (-1.0 * _x_x_1))))) || ( !(12.0 <= (_x_x_1 + (-1.0 * _x_x_2)))))) && (_EL_X_92 == ((_x__EL_U_90 && ( !(6.0 <= (_x_x_0 + (-1.0 * _x_x_1))))) || ( !(12.0 <= (_x_x_1 + (-1.0 * _x_x_2))))))))); _EL_X_94 = _x__EL_X_94; x_3 = _x_x_3; x_1 = _x_x_1; x_2 = _x_x_2; _EL_X_92 = _x__EL_X_92; _EL_U_90 = _x__EL_U_90; x_0 = _x_x_0; } }
the_stack_data/28263102.c
/** * polybench.c: This file is part of the PolyBench/C 3.2 test suite. * * * Contact: Louis-Noel Pouchet <[email protected]> * Web address: http://polybench.sourceforge.net * License: /LICENSE.OSU.txt */ #include <stdio.h> #include <string.h> #include <stdlib.h> #include <unistd.h> #include <assert.h> #include <time.h> #include <sys/time.h> #include <sys/resource.h> #include <sched.h> #include <math.h> #ifdef _OPENMP # include <omp.h> #endif /* By default, collect PAPI counters on thread 0. */ #ifndef POLYBENCH_THREAD_MONITOR # define POLYBENCH_THREAD_MONITOR 0 #endif /* Total LLC cache size. By default 32+MB.. */ #ifndef POLYBENCH_CACHE_SIZE_KB # define POLYBENCH_CACHE_SIZE_KB 32770 #endif int polybench_papi_counters_threadid = POLYBENCH_THREAD_MONITOR; double polybench_program_total_flops = 0; #ifdef POLYBENCH_PAPI # include <papi.h> # define POLYBENCH_MAX_NB_PAPI_COUNTERS 96 char* _polybench_papi_eventlist[] = { #include "papi_counters.list" NULL }; int polybench_papi_eventset; int polybench_papi_eventlist[POLYBENCH_MAX_NB_PAPI_COUNTERS]; long_long polybench_papi_values[POLYBENCH_MAX_NB_PAPI_COUNTERS]; #endif /* Timer code (gettimeofday). */ double polybench_t_start, polybench_t_end; /* Timer code (RDTSC). */ unsigned long long int polybench_c_start, polybench_c_end; static double rtclock() { #ifdef POLYBENCH_TIME struct timeval Tp; int stat; stat = gettimeofday (&Tp, NULL); if (stat != 0) printf ("Error return from gettimeofday: %d", stat); return (Tp.tv_sec + Tp.tv_usec * 1.0e-6); #else return 0; #endif } #ifdef POLYBENCH_CYCLE_ACCURATE_TIMER static unsigned long long int rdtsc() { unsigned long long int ret = 0; unsigned int cycles_lo; unsigned int cycles_hi; __asm__ volatile ("RDTSC" : "=a" (cycles_lo), "=d" (cycles_hi)); ret = (unsigned long long int)cycles_hi << 32 | cycles_lo; return ret; } #endif void polybench_flush_cache() { int cs = POLYBENCH_CACHE_SIZE_KB * 1024 / sizeof(double); double* flush = (double*) calloc (cs, sizeof(double)); int i; double tmp = 0.0; #ifdef _OPENMP #endif #pragma omp parallel for reduction(+:tmp) for (i = 0; i < cs; i++) tmp += flush[i]; assert (tmp <= 10.0); free (flush); } #ifdef POLYBENCH_LINUX_FIFO_SCHEDULER void polybench_linux_fifo_scheduler() { /* Use FIFO scheduler to limit OS interference. Program must be run as root, and this works only for Linux kernels. */ struct sched_param schedParam; schedParam.sched_priority = sched_get_priority_max (SCHED_FIFO); sched_setscheduler (0, SCHED_FIFO, &schedParam); } void polybench_linux_standard_scheduler() { /* Restore to standard scheduler policy. */ struct sched_param schedParam; schedParam.sched_priority = sched_get_priority_max (SCHED_OTHER); sched_setscheduler (0, SCHED_OTHER, &schedParam); } #endif #ifdef POLYBENCH_PAPI static void test_fail(char *file, int line, char *call, int retval) { char buf[128]; memset(buf, '\0', sizeof(buf)); if (retval != 0) fprintf (stdout,"%-40s FAILED\nLine # %d\n", file, line); else { fprintf (stdout,"%-40s SKIPPED\n", file); fprintf (stdout,"Line # %d\n", line); } if (retval == PAPI_ESYS) { sprintf (buf, "System error in %s", call); perror (buf); } else if (retval > 0) fprintf (stdout,"Error: %s\n", call); else if (retval == 0) fprintf (stdout,"Error: %s\n", call); else { char errstring[PAPI_MAX_STR_LEN]; PAPI_perror (retval, errstring, PAPI_MAX_STR_LEN); fprintf (stdout,"Error in %s: %s\n", call, errstring); } fprintf (stdout,"\n"); if (PAPI_is_initialized ()) PAPI_shutdown (); exit (1); } void polybench_papi_init() { # ifdef _OPENMP { { if (omp_get_max_threads () < polybench_papi_counters_threadid) polybench_papi_counters_threadid = omp_get_max_threads () - 1; } if (omp_get_thread_num () == polybench_papi_counters_threadid) { # endif int retval; polybench_papi_eventset = PAPI_NULL; if ((retval = PAPI_library_init (PAPI_VER_CURRENT)) != PAPI_VER_CURRENT) test_fail (__FILE__, __LINE__, "PAPI_library_init", retval); if ((retval = PAPI_create_eventset (&polybench_papi_eventset)) != PAPI_OK) test_fail (__FILE__, __LINE__, "PAPI_create_eventset", retval); int k; for (k = 0; _polybench_papi_eventlist[k]; ++k) { if ((retval = PAPI_event_name_to_code (_polybench_papi_eventlist[k], &(polybench_papi_eventlist[k]))) != PAPI_OK) test_fail (__FILE__, __LINE__, "PAPI_event_name_to_code", retval); } polybench_papi_eventlist[k] = 0; # ifdef _OPENMP } } # endif } void polybench_papi_close() { # ifdef _OPENMP { if (omp_get_thread_num () == polybench_papi_counters_threadid) { # endif int retval; if ((retval = PAPI_destroy_eventset (&polybench_papi_eventset)) != PAPI_OK) test_fail (__FILE__, __LINE__, "PAPI_destroy_eventset", retval); if (PAPI_is_initialized ()) PAPI_shutdown (); # ifdef _OPENMP } } # endif } int polybench_papi_start_counter(int evid) { # ifndef POLYBENCH_NO_FLUSH_CACHE polybench_flush_cache(); # endif # ifdef _OPENMP { if (omp_get_thread_num () == polybench_papi_counters_threadid) { # endif int retval = 1; char descr[PAPI_MAX_STR_LEN]; PAPI_event_info_t evinfo; PAPI_event_code_to_name (polybench_papi_eventlist[evid], descr); if (PAPI_add_event (polybench_papi_eventset, polybench_papi_eventlist[evid]) != PAPI_OK) test_fail (__FILE__, __LINE__, "PAPI_add_event", 1); if (PAPI_get_event_info (polybench_papi_eventlist[evid], &evinfo) != PAPI_OK) test_fail (__FILE__, __LINE__, "PAPI_get_event_info", retval); if ((retval = PAPI_start (polybench_papi_eventset)) != PAPI_OK) test_fail (__FILE__, __LINE__, "PAPI_start", retval); # ifdef _OPENMP } } # endif return 0; } void polybench_papi_stop_counter(int evid) { # ifdef _OPENMP { if (omp_get_thread_num () == polybench_papi_counters_threadid) { # endif int retval; long_long values[1]; values[0] = 0; if ((retval = PAPI_read (polybench_papi_eventset, &values[0])) != PAPI_OK) test_fail (__FILE__, __LINE__, "PAPI_read", retval); if ((retval = PAPI_stop (polybench_papi_eventset, NULL)) != PAPI_OK) test_fail (__FILE__, __LINE__, "PAPI_stop", retval); polybench_papi_values[evid] = values[0]; if ((retval = PAPI_remove_event (polybench_papi_eventset, polybench_papi_eventlist[evid])) != PAPI_OK) test_fail (__FILE__, __LINE__, "PAPI_remove_event", retval); # ifdef _OPENMP } } # endif } void polybench_papi_print() { int verbose = 0; # ifdef _OPENMP { if (omp_get_thread_num() == polybench_papi_counters_threadid) { #ifdef POLYBENCH_PAPI_VERBOSE verbose = 1; #endif if (verbose) printf ("On thread %d:\n", polybench_papi_counters_threadid); #endif int evid; for (evid = 0; polybench_papi_eventlist[evid] != 0; ++evid) { if (verbose) printf ("%s=", _polybench_papi_eventlist[evid]); printf ("%llu ", polybench_papi_values[evid]); if (verbose) printf ("\n"); } printf ("\n"); # ifdef _OPENMP } } # endif } #endif /* ! POLYBENCH_PAPI */ void polybench_prepare_instruments() { #ifndef POLYBENCH_NO_FLUSH_CACHE polybench_flush_cache (); #endif #ifdef POLYBENCH_LINUX_FIFO_SCHEDULER polybench_linux_fifo_scheduler (); #endif } void polybench_timer_start() { polybench_prepare_instruments (); #ifndef POLYBENCH_CYCLE_ACCURATE_TIMER polybench_t_start = rtclock (); #else polybench_c_start = rdtsc (); #endif } void polybench_timer_stop() { #ifndef POLYBENCH_CYCLE_ACCURATE_TIMER polybench_t_end = rtclock (); #else polybench_c_end = rdtsc (); #endif #ifdef POLYBENCH_LINUX_FIFO_SCHEDULER polybench_linux_standard_scheduler (); #endif } void polybench_timer_print() { #ifdef POLYBENCH_GFLOPS if (__polybench_program_total_flops == 0) { printf ("[PolyBench][WARNING] Program flops not defined, use polybench_set_program_flops(value)\n"); printf ("%0.6lf\n", polybench_t_end - polybench_t_start); } else printf ("%0.2lf\n", (__polybench_program_total_flops / (double)(polybench_t_end - polybench_t_start)) / 1000000000); #else # ifndef POLYBENCH_CYCLE_ACCURATE_TIMER printf ("%0.6f\n", polybench_t_end - polybench_t_start); # else printf ("%Ld\n", polybench_c_end - polybench_c_start); # endif #endif } static void * xmalloc (size_t num) { void* nnew = NULL; int ret = posix_memalign (&nnew, 32, num); if (! nnew || ret) { fprintf (stderr, "[PolyBench] posix_memalign: cannot allocate memory"); exit (1); } return nnew; } void* polybench_alloc_data(unsigned long long int n, int elt_size) { /// FIXME: detect overflow! size_t val = n; val *= elt_size; void* ret = xmalloc (val); return ret; }
the_stack_data/731031.c
int main() { return 5 >= 5; }
the_stack_data/556525.c
__thread int mod_tdata1 = 1; __thread int mod_tdata2 __attribute__ ((aligned (0x10))) = 2; __thread int mod_tdata3 __attribute__ ((aligned (0x1000))) = 4; __thread int mod_tbss1; __thread int mod_tbss2 __attribute__ ((aligned (0x10))); __thread int mod_tbss3 __attribute__ ((aligned (0x1000)));
the_stack_data/19630.c
#include <stdio.h> int main(void) { long long int n_test_cases, k; scanf("%lli", &n_test_cases); for(int i = 0; i < n_test_cases; i++){ scanf("%lli", &k); printf("%lli\n", (192 + ((k - 1) * 250))); } return 0; }
the_stack_data/410854.c
/* $OpenBSD: osf1_syscalls.c,v 1.10 2003/01/30 03:32:44 millert Exp $ */ /* * System call names. * * DO NOT EDIT-- this file is automatically generated. * created from OpenBSD: syscalls.master,v 1.9 2003/01/30 03:29:49 millert Exp */ char *osf1_syscallnames[] = { "syscall", /* 0 = syscall */ "exit", /* 1 = exit */ "fork", /* 2 = fork */ "read", /* 3 = read */ "write", /* 4 = write */ "#5 (unimplemented old open)", /* 5 = unimplemented old open */ "close", /* 6 = close */ "wait4", /* 7 = wait4 */ "#8 (unimplemented old creat)", /* 8 = unimplemented old creat */ "link", /* 9 = link */ "unlink", /* 10 = unlink */ "#11 (unimplemented execv)", /* 11 = unimplemented execv */ "chdir", /* 12 = chdir */ "fchdir", /* 13 = fchdir */ "mknod", /* 14 = mknod */ "chmod", /* 15 = chmod */ "chown", /* 16 = chown */ "obreak", /* 17 = obreak */ "getfsstat", /* 18 = getfsstat */ "lseek", /* 19 = lseek */ "getpid", /* 20 = getpid */ "mount", /* 21 = mount */ "unmount", /* 22 = unmount */ "setuid", /* 23 = setuid */ "getuid", /* 24 = getuid */ "#25 (unimplemented exec_with_loader)", /* 25 = unimplemented exec_with_loader */ "#26 (unimplemented ptrace)", /* 26 = unimplemented ptrace */ "recvmsg_xopen", /* 27 = recvmsg_xopen */ "sendmsg_xopen", /* 28 = sendmsg_xopen */ "#29 (unimplemented recvfrom)", /* 29 = unimplemented recvfrom */ "#30 (unimplemented accept)", /* 30 = unimplemented accept */ "#31 (unimplemented getpeername)", /* 31 = unimplemented getpeername */ "#32 (unimplemented getsockname)", /* 32 = unimplemented getsockname */ "access", /* 33 = access */ "#34 (unimplemented chflags)", /* 34 = unimplemented chflags */ "#35 (unimplemented fchflags)", /* 35 = unimplemented fchflags */ "sync", /* 36 = sync */ "kill", /* 37 = kill */ "#38 (unimplemented old stat)", /* 38 = unimplemented old stat */ "setpgid", /* 39 = setpgid */ "#40 (unimplemented old lstat)", /* 40 = unimplemented old lstat */ "dup", /* 41 = dup */ "pipe", /* 42 = pipe */ "set_program_attributes", /* 43 = set_program_attributes */ "#44 (unimplemented profil)", /* 44 = unimplemented profil */ "open", /* 45 = open */ "#46 (obsolete sigaction)", /* 46 = obsolete sigaction */ "getgid", /* 47 = getgid */ "sigprocmask", /* 48 = sigprocmask */ "getlogin", /* 49 = getlogin */ "setlogin", /* 50 = setlogin */ "acct", /* 51 = acct */ "#52 (unimplemented sigpending)", /* 52 = unimplemented sigpending */ "classcntl", /* 53 = classcntl */ "ioctl", /* 54 = ioctl */ "reboot", /* 55 = reboot */ "revoke", /* 56 = revoke */ "symlink", /* 57 = symlink */ "readlink", /* 58 = readlink */ "execve", /* 59 = execve */ "umask", /* 60 = umask */ "chroot", /* 61 = chroot */ "#62 (unimplemented old fstat)", /* 62 = unimplemented old fstat */ "getpgrp", /* 63 = getpgrp */ "getpagesize", /* 64 = getpagesize */ "#65 (unimplemented mremap)", /* 65 = unimplemented mremap */ "vfork", /* 66 = vfork */ "stat", /* 67 = stat */ "lstat", /* 68 = lstat */ "#69 (unimplemented sbrk)", /* 69 = unimplemented sbrk */ "#70 (unimplemented sstk)", /* 70 = unimplemented sstk */ "mmap", /* 71 = mmap */ "#72 (unimplemented ovadvise)", /* 72 = unimplemented ovadvise */ "munmap", /* 73 = munmap */ "mprotect", /* 74 = mprotect */ "madvise", /* 75 = madvise */ "#76 (unimplemented old vhangup)", /* 76 = unimplemented old vhangup */ "#77 (unimplemented kmodcall)", /* 77 = unimplemented kmodcall */ "#78 (unimplemented mincore)", /* 78 = unimplemented mincore */ "getgroups", /* 79 = getgroups */ "setgroups", /* 80 = setgroups */ "#81 (unimplemented old getpgrp)", /* 81 = unimplemented old getpgrp */ "setpgrp", /* 82 = setpgrp */ "setitimer", /* 83 = setitimer */ "#84 (unimplemented old wait)", /* 84 = unimplemented old wait */ "#85 (unimplemented table)", /* 85 = unimplemented table */ "#86 (unimplemented getitimer)", /* 86 = unimplemented getitimer */ "gethostname", /* 87 = gethostname */ "sethostname", /* 88 = sethostname */ "getdtablesize", /* 89 = getdtablesize */ "dup2", /* 90 = dup2 */ "fstat", /* 91 = fstat */ "fcntl", /* 92 = fcntl */ "select", /* 93 = select */ "poll", /* 94 = poll */ "fsync", /* 95 = fsync */ "setpriority", /* 96 = setpriority */ "socket", /* 97 = socket */ "connect", /* 98 = connect */ "accept", /* 99 = accept */ "getpriority", /* 100 = getpriority */ "send", /* 101 = send */ "recv", /* 102 = recv */ "sigreturn", /* 103 = sigreturn */ "bind", /* 104 = bind */ "setsockopt", /* 105 = setsockopt */ "listen", /* 106 = listen */ "#107 (unimplemented plock)", /* 107 = unimplemented plock */ "#108 (unimplemented old sigvec)", /* 108 = unimplemented old sigvec */ "#109 (unimplemented old sigblock)", /* 109 = unimplemented old sigblock */ "#110 (unimplemented old sigsetmask)", /* 110 = unimplemented old sigsetmask */ "sigsuspend", /* 111 = sigsuspend */ "sigstack", /* 112 = sigstack */ "#113 (unimplemented old recvmsg)", /* 113 = unimplemented old recvmsg */ "#114 (unimplemented old sendmsg)", /* 114 = unimplemented old sendmsg */ "#115 (obsolete vtrace)", /* 115 = obsolete vtrace */ "gettimeofday", /* 116 = gettimeofday */ "getrusage", /* 117 = getrusage */ "getsockopt", /* 118 = getsockopt */ "#119 (unimplemented)", /* 119 = unimplemented */ "readv", /* 120 = readv */ "writev", /* 121 = writev */ "settimeofday", /* 122 = settimeofday */ "fchown", /* 123 = fchown */ "fchmod", /* 124 = fchmod */ "recvfrom", /* 125 = recvfrom */ "setreuid", /* 126 = setreuid */ "setregid", /* 127 = setregid */ "rename", /* 128 = rename */ "truncate", /* 129 = truncate */ "ftruncate", /* 130 = ftruncate */ "#131 (unimplemented flock)", /* 131 = unimplemented flock */ "setgid", /* 132 = setgid */ "sendto", /* 133 = sendto */ "shutdown", /* 134 = shutdown */ "socketpair", /* 135 = socketpair */ "mkdir", /* 136 = mkdir */ "rmdir", /* 137 = rmdir */ "utimes", /* 138 = utimes */ "#139 (obsolete 4.2 sigreturn)", /* 139 = obsolete 4.2 sigreturn */ "#140 (unimplemented adjtime)", /* 140 = unimplemented adjtime */ "getpeername", /* 141 = getpeername */ "gethostid", /* 142 = gethostid */ "sethostid", /* 143 = sethostid */ "getrlimit", /* 144 = getrlimit */ "setrlimit", /* 145 = setrlimit */ "#146 (unimplemented old killpg)", /* 146 = unimplemented old killpg */ "setsid", /* 147 = setsid */ "#148 (unimplemented quotactl)", /* 148 = unimplemented quotactl */ "quota", /* 149 = quota */ "getsockname", /* 150 = getsockname */ "#151 (unimplemented pread)", /* 151 = unimplemented pread */ "#152 (unimplemented pwrite)", /* 152 = unimplemented pwrite */ "#153 (unimplemented pid_block)", /* 153 = unimplemented pid_block */ "#154 (unimplemented pid_unblock)", /* 154 = unimplemented pid_unblock */ "#155 (unimplemented signal_urti)", /* 155 = unimplemented signal_urti */ "sigaction", /* 156 = sigaction */ "#157 (unimplemented sigwaitprim)", /* 157 = unimplemented sigwaitprim */ "#158 (unimplemented nfssvc)", /* 158 = unimplemented nfssvc */ "getdirentries", /* 159 = getdirentries */ "statfs", /* 160 = statfs */ "fstatfs", /* 161 = fstatfs */ "#162 (unimplemented)", /* 162 = unimplemented */ "#163 (unimplemented async_daemon)", /* 163 = unimplemented async_daemon */ "#164 (unimplemented getfh)", /* 164 = unimplemented getfh */ "getdomainname", /* 165 = getdomainname */ "setdomainname", /* 166 = setdomainname */ "#167 (unimplemented)", /* 167 = unimplemented */ "#168 (unimplemented)", /* 168 = unimplemented */ "#169 (unimplemented exportfs)", /* 169 = unimplemented exportfs */ "#170 (unimplemented)", /* 170 = unimplemented */ "#171 (unimplemented)", /* 171 = unimplemented */ "#172 (unimplemented alt msgctl)", /* 172 = unimplemented alt msgctl */ "#173 (unimplemented alt msgget)", /* 173 = unimplemented alt msgget */ "#174 (unimplemented alt msgrcv)", /* 174 = unimplemented alt msgrcv */ "#175 (unimplemented alt msgsnd)", /* 175 = unimplemented alt msgsnd */ "#176 (unimplemented alt semctl)", /* 176 = unimplemented alt semctl */ "#177 (unimplemented alt semget)", /* 177 = unimplemented alt semget */ "#178 (unimplemented alt semop)", /* 178 = unimplemented alt semop */ "#179 (unimplemented alt uname)", /* 179 = unimplemented alt uname */ "#180 (unimplemented)", /* 180 = unimplemented */ "#181 (unimplemented alt plock)", /* 181 = unimplemented alt plock */ "#182 (unimplemented lockf)", /* 182 = unimplemented lockf */ "#183 (unimplemented)", /* 183 = unimplemented */ "#184 (unimplemented getmnt)", /* 184 = unimplemented getmnt */ "#185 (unimplemented)", /* 185 = unimplemented */ "#186 (unimplemented unmount)", /* 186 = unimplemented unmount */ "#187 (unimplemented alt sigpending)", /* 187 = unimplemented alt sigpending */ "#188 (unimplemented alt setsid)", /* 188 = unimplemented alt setsid */ "#189 (unimplemented)", /* 189 = unimplemented */ "#190 (unimplemented)", /* 190 = unimplemented */ "#191 (unimplemented)", /* 191 = unimplemented */ "#192 (unimplemented)", /* 192 = unimplemented */ "#193 (unimplemented)", /* 193 = unimplemented */ "#194 (unimplemented)", /* 194 = unimplemented */ "#195 (unimplemented)", /* 195 = unimplemented */ "#196 (unimplemented)", /* 196 = unimplemented */ "#197 (unimplemented)", /* 197 = unimplemented */ "#198 (unimplemented)", /* 198 = unimplemented */ "#199 (unimplemented swapon)", /* 199 = unimplemented swapon */ "#200 (unimplemented msgctl)", /* 200 = unimplemented msgctl */ "#201 (unimplemented msgget)", /* 201 = unimplemented msgget */ "#202 (unimplemented msgrcv)", /* 202 = unimplemented msgrcv */ "#203 (unimplemented msgsnd)", /* 203 = unimplemented msgsnd */ "#204 (unimplemented semctl)", /* 204 = unimplemented semctl */ "#205 (unimplemented semget)", /* 205 = unimplemented semget */ "#206 (unimplemented semop)", /* 206 = unimplemented semop */ "uname", /* 207 = uname */ "lchown", /* 208 = lchown */ "shmat", /* 209 = shmat */ "shmctl", /* 210 = shmctl */ "shmdt", /* 211 = shmdt */ "shmget", /* 212 = shmget */ "#213 (unimplemented mvalid)", /* 213 = unimplemented mvalid */ "#214 (unimplemented getaddressconf)", /* 214 = unimplemented getaddressconf */ "#215 (unimplemented msleep)", /* 215 = unimplemented msleep */ "#216 (unimplemented mwakeup)", /* 216 = unimplemented mwakeup */ "#217 (unimplemented msync)", /* 217 = unimplemented msync */ "#218 (unimplemented signal)", /* 218 = unimplemented signal */ "#219 (unimplemented utc gettime)", /* 219 = unimplemented utc gettime */ "#220 (unimplemented utc adjtime)", /* 220 = unimplemented utc adjtime */ "#221 (unimplemented)", /* 221 = unimplemented */ "#222 (unimplemented security)", /* 222 = unimplemented security */ "#223 (unimplemented kloadcall)", /* 223 = unimplemented kloadcall */ "#224 (unimplemented)", /* 224 = unimplemented */ "#225 (unimplemented)", /* 225 = unimplemented */ "#226 (unimplemented)", /* 226 = unimplemented */ "#227 (unimplemented)", /* 227 = unimplemented */ "#228 (unimplemented)", /* 228 = unimplemented */ "#229 (unimplemented)", /* 229 = unimplemented */ "#230 (unimplemented)", /* 230 = unimplemented */ "#231 (unimplemented)", /* 231 = unimplemented */ "#232 (unimplemented)", /* 232 = unimplemented */ "#233 (unimplemented getpgid)", /* 233 = unimplemented getpgid */ "getsid", /* 234 = getsid */ "sigaltstack", /* 235 = sigaltstack */ "#236 (unimplemented waitid)", /* 236 = unimplemented waitid */ "#237 (unimplemented priocntlset)", /* 237 = unimplemented priocntlset */ "#238 (unimplemented sigsendset)", /* 238 = unimplemented sigsendset */ "#239 (unimplemented set_speculative)", /* 239 = unimplemented set_speculative */ "#240 (unimplemented msfs_syscall)", /* 240 = unimplemented msfs_syscall */ "sysinfo", /* 241 = sysinfo */ "#242 (unimplemented uadmin)", /* 242 = unimplemented uadmin */ "#243 (unimplemented fuser)", /* 243 = unimplemented fuser */ "#244 (unimplemented proplist_syscall)", /* 244 = unimplemented proplist_syscall */ "#245 (unimplemented ntp_adjtime)", /* 245 = unimplemented ntp_adjtime */ "#246 (unimplemented ntp_gettime)", /* 246 = unimplemented ntp_gettime */ "pathconf", /* 247 = pathconf */ "fpathconf", /* 248 = fpathconf */ "#249 (unimplemented)", /* 249 = unimplemented */ "#250 (unimplemented uswitch)", /* 250 = unimplemented uswitch */ "usleep_thread", /* 251 = usleep_thread */ "#252 (unimplemented audcntl)", /* 252 = unimplemented audcntl */ "#253 (unimplemented audgen)", /* 253 = unimplemented audgen */ "#254 (unimplemented sysfs)", /* 254 = unimplemented sysfs */ "#255 (unimplemented subsys_info)", /* 255 = unimplemented subsys_info */ "#256 (unimplemented getsysinfo)", /* 256 = unimplemented getsysinfo */ "setsysinfo", /* 257 = setsysinfo */ "#258 (unimplemented afs_syscall)", /* 258 = unimplemented afs_syscall */ "#259 (unimplemented swapctl)", /* 259 = unimplemented swapctl */ "#260 (unimplemented memcntl)", /* 260 = unimplemented memcntl */ "#261 (unimplemented fdatasync)", /* 261 = unimplemented fdatasync */ };
the_stack_data/111381.c
#include <stdio.h> int main() { int a,b,c; scanf("%d%d%d",&a,&b,&c); printf("%d+%d+%d=%d",a,b,c,a+b+c); return 0; }
the_stack_data/91934.c
// PROGRAM-NAME : sum of two numbers // By Reshmi B Joseph // PROGRAM-CODE : #include<stdio.h> int main() { int a, b, sum; printf("\nEnter two no: "); scanf("%d %d", &a, &b); sum = a + b; printf("Sum : %d", sum); return(0); }
the_stack_data/247017041.c
// A Basic C program to demonstrate the use of * pointers #include <stdio.h> int main() { // Normal integer variable declaration int var = 10; // A pointer variable to hold the address of integer -> var int *ptr = &var; // This line prints the value at address stored in ptr // Value stored is the value of variable -> var printf(" Value of var = %d\n", *ptr); // The address of the integer -> var printf(" Address of var = %p\n", ptr); // Trying to reinitialize the value at // the address *ptr = 20; // Checking if the original value has been changed or not printf(" New value of var = %d\n", var); return 0; }