file
stringlengths
18
26
data
stringlengths
3
1.04M
the_stack_data/62638266.c
//Classification: n/DAM/NP/sS/D(v)/lc/rp+cd //Written by: Sergey Pomelov //Reviewed by: Igor Eremeev //Comment: #include <stdio.h> int main(void) { int *p; static int a = 1; int c = 1; int i; scanf("%d",&c); for(i=1; i<100; i++) { if (c==i) a = *p; } printf("%d %d",a,c); return 0; }
the_stack_data/776094.c
// RUN: %llvmgcc %s -emit-llvm -g -O0 -c -o %t1.bc // RUN: %klee --use-query-pc-log --write-pcs --write-cvcs %t1.bc 2> %t2.log // RUN: %kleaver -print-ast klee-last/queries.pc > %t3.log // RUN: %kleaver -print-ast %t3.log > %t4.log // RUN: diff %t3.log %t4.log #include <assert.h> int constantArr[16 ] = { 1 << 0, 1 << 1, 1 << 2, 1 << 3, 1 << 4, 1 << 5, 1 << 6, 1 << 7, 1 << 8, 1 << 9, 1 << 10, 1 << 11, 1 << 12, 1 << 13, 1 << 14, 1 << 15 }; int main() { char buf[4]; klee_make_symbolic(buf, sizeof buf); buf[1] = 'a'; constantArr[klee_range(0, 16, "idx.0")] = buf[0]; // Use this to trigger an interior update list usage. int y = constantArr[klee_range(0, 16, "idx.1")]; constantArr[klee_range(0, 16, "idx.2")] = buf[3]; buf[klee_range(0, 4, "idx.3")] = 0; klee_assume(buf[0] == 'h'); int x = *((int*) buf); klee_assume(x > 2); klee_assume(x == constantArr[12]); klee_assume(y != (1 << 5)); assert(0); return 0; }
the_stack_data/243893029.c
/* ************************************************************************** */ /* */ /* :::::::: */ /* i_ft_main.c :+: :+: */ /* +:+ */ /* By: hyilmaz <[email protected]> +#+ */ /* +#+ */ /* Created: 2020/12/30 18:36:08 by hyilmaz #+# #+# */ /* Updated: 2021/03/11 10:32:54 by hyilmaz ######## odam.nl */ /* */ /* ************************************************************************** */ #include <stdio.h> #include <stdlib.h> int ft_printf(const char *fmt, ...); int main(void) { FILE *fd; int res; fd = fopen("logs/results/i_ft_return_val", "a+"); if (fd == NULL) { printf("Couldn't open file\n"); exit(1); } /* ** Printing positive numbers */ res = ft_printf("%i\n", 999);//1 fprintf(fd, "%d\n", res); res = ft_printf("%7i\n", 999);//2 fprintf(fd, "%d\n", res); res = ft_printf("%.7i\n", 12345);//3 fprintf(fd, "%d\n", res); res = ft_printf("%.i\n", 12345);//4 fprintf(fd, "%d\n", res); res = ft_printf("%010.i\n", 12345);//5 fprintf(fd, "%d\n", res); res = ft_printf("%0.7i\n", 12345);//6 fprintf(fd, "%d\n", res); res = ft_printf("%7.5i\n", 123);//7 fprintf(fd, "%d\n", res); res = ft_printf("%7.2i\n", 123);//8 fprintf(fd, "%d\n", res); res = ft_printf("%4.3i\n", 12345);//9 fprintf(fd, "%d\n", res); res = ft_printf("%3.4i\n", 12345);//10 fprintf(fd, "%d\n", res); res = ft_printf("%6.7i\n", 12345);//11 fprintf(fd, "%d\n", res); res = ft_printf("%2.7i\n", 12345);//12 fprintf(fd, "%d\n", res); res = ft_printf("%-7.5i\n", 123);//13 fprintf(fd, "%d\n", res); res = ft_printf("%-7.2i\n", 123);//14 fprintf(fd, "%d\n", res); res = ft_printf("%-4.3i\n", 12345);//15 fprintf(fd, "%d\n", res); res = ft_printf("%-3.4i\n", 12345);//16 fprintf(fd, "%d\n", res); res = ft_printf("%-6.7i\n", 12345);//17 fprintf(fd, "%d\n", res); res = ft_printf("%-2.7i\n", 12345);//18 fprintf(fd, "%d\n", res); res = ft_printf("%07.5i\n", 123);//19 fprintf(fd, "%d\n", res); res = ft_printf("%07.2i\n", 123);//20 fprintf(fd, "%d\n", res); res = ft_printf("%04.3i\n", 12345);//21 fprintf(fd, "%d\n", res); res = ft_printf("%03.4i\n", 12345);//22 fprintf(fd, "%d\n", res); res = ft_printf("%06.7i\n", 12345);//23 fprintf(fd, "%d\n", res); res = ft_printf("%02.7i\n", 12345);//24 fprintf(fd, "%d\n", res); /* ** Printing negative numbers */ res = ft_printf("%7.5i\n", -123);//25 fprintf(fd, "%d\n", res); res = ft_printf("%7.2i\n", -123);//26 fprintf(fd, "%d\n", res); res = ft_printf("%4.3i\n", -12345);//27 fprintf(fd, "%d\n", res); res = ft_printf("%3.4i\n", -12345);//28 fprintf(fd, "%d\n", res); res = ft_printf("%7.9i\n", -12345);//29 fprintf(fd, "%d\n", res); res = ft_printf("%2.9i\n", -12345);//30 fprintf(fd, "%d\n", res); res = ft_printf("%-7.5i\n", -123);//31 fprintf(fd, "%d\n", res); res = ft_printf("%-7.2i\n", -123);//32 fprintf(fd, "%d\n", res); res = ft_printf("%-4.3i\n", -12345);//33 fprintf(fd, "%d\n", res); res = ft_printf("%-3.4i\n", -12345);//34 fprintf(fd, "%d\n", res); res = ft_printf("%-7.9i\n", -12345);//35 fprintf(fd, "%d\n", res); res = ft_printf("%-2.9i\n", -12345);//36 fprintf(fd, "%d\n", res); res = ft_printf("%07.5i\n", -123);//37 fprintf(fd, "%d\n", res); res = ft_printf("%07.2i\n", -123);//38 fprintf(fd, "%d\n", res); res = ft_printf("%04.3i\n", -12345);//39 fprintf(fd, "%d\n", res); res = ft_printf("%03.4i\n", -12345);//40 fprintf(fd, "%d\n", res); res = ft_printf("%07.9i\n", -12345);//41 fprintf(fd, "%d\n", res); res = ft_printf("%02.9i\n", -12345);//42 fprintf(fd, "%d\n", res); /* ** Printing with equal parameters with dash = 0 ** The parameters are: field width, precision and number length. ** The number length includes the '-' sign. ** Thus -123 has length 4. */ res = ft_printf("%7.7i\n", 123);//43 fprintf(fd, "%d\n", res); res = ft_printf("%2.2i\n", 123);//44 fprintf(fd, "%d\n", res); res = ft_printf("%4.3i\n", 1234);//45 fprintf(fd, "%d\n", res); res = ft_printf("%3.4i\n", 1234);//46 fprintf(fd, "%d\n", res); res = ft_printf("%2.2i\n", 12);//47 fprintf(fd, "%d\n", res); res = ft_printf("%7.7i\n", -123);//48 fprintf(fd, "%d\n", res); res = ft_printf("%2.2i\n", -123);//49 fprintf(fd, "%d\n", res); res = ft_printf("%5.3i\n", -1234);//50 fprintf(fd, "%d\n", res); res = ft_printf("%3.5i\n", -1234);//51 fprintf(fd, "%d\n", res); res = ft_printf("%3.3i\n", -12);//52 fprintf(fd, "%d\n", res); res = ft_printf("%-7.7i\n", 123);//53 fprintf(fd, "%d\n", res); res = ft_printf("%-2.2i\n", 123);//54 fprintf(fd, "%d\n", res); res = ft_printf("%-4.3i\n", 1234);//55 fprintf(fd, "%d\n", res); res = ft_printf("%-3.4i\n", 1234);//56 fprintf(fd, "%d\n", res); res = ft_printf("%-2.2i\n", 12);//57 fprintf(fd, "%d\n", res); res = ft_printf("%-7.7i\n", -123);//58 fprintf(fd, "%d\n", res); res = ft_printf("%-2.2i\n", -123);//59 fprintf(fd, "%d\n", res); res = ft_printf("%-5.3i\n", -1234);//60 fprintf(fd, "%d\n", res); res = ft_printf("%-3.5i\n", -1234);//61 fprintf(fd, "%d\n", res); res = ft_printf("%-3.3i\n", -12);//62 fprintf(fd, "%d\n", res); res = ft_printf("%07.7i\n", 123);//63 fprintf(fd, "%d\n", res); res = ft_printf("%02.2i\n", 123);//64 fprintf(fd, "%d\n", res); res = ft_printf("%04.3i\n", 1234);//65 fprintf(fd, "%d\n", res); res = ft_printf("%03.4i\n", 1234);//66 fprintf(fd, "%d\n", res); res = ft_printf("%02.2i\n", 12);//67 fprintf(fd, "%d\n", res); res = ft_printf("%07.7i\n", -123);//68 fprintf(fd, "%d\n", res); res = ft_printf("%02.2i\n", -123);//69 fprintf(fd, "%d\n", res); res = ft_printf("%05.3i\n", -1234);//70 fprintf(fd, "%d\n", res); res = ft_printf("%03.5i\n", -1234);//71 fprintf(fd, "%d\n", res); res = ft_printf("%03.3i\n", -12);//72 fprintf(fd, "%d\n", res); /* ** Printing with 0 parameters */ res = ft_printf("%0.5i\n", 123);//73 fprintf(fd, "%d\n", res); res = ft_printf("%7.0i\n", 123);//74 fprintf(fd, "%d\n", res); res = ft_printf("%0.3i\n", 12345);//75 fprintf(fd, "%d\n", res); res = ft_printf("%3.0i\n", 12345);//76 fprintf(fd, "%d\n", res); res = ft_printf("%0.5i\n", -123);//77 fprintf(fd, "%d\n", res); res = ft_printf("%7.0i\n", -123);//78 fprintf(fd, "%d\n", res); res = ft_printf("%0.3i\n", -12345);//79 fprintf(fd, "%d\n", res); res = ft_printf("%3.0i\n", -12345);//80 fprintf(fd, "%d\n", res); res = ft_printf("%6.0i\n", 0);//81 fprintf(fd, "%d\n", res); res = ft_printf("%6.i\n", 0);//82 fprintf(fd, "%d\n", res); res = ft_printf("%0.7i\n", 0);//83 fprintf(fd, "%d\n", res); res = ft_printf("%0.0i\n", 0);//84 fprintf(fd, "%d\n", res); res = ft_printf("%0.i\n", 0);//85 fprintf(fd, "%d\n", res); res = ft_printf("%-7.0i\n", 123);//86 fprintf(fd, "%d\n", res); res = ft_printf("%-3.0i\n", 12345);//87 fprintf(fd, "%d\n", res); res = ft_printf("%-7.0i\n", -123);//88 fprintf(fd, "%d\n", res); res = ft_printf("%-3.0i\n", -12345);//89 fprintf(fd, "%d\n", res); res = ft_printf("%-6.0i\n", 0);//90 fprintf(fd, "%d\n", res); res = ft_printf("%-6.i\n", 0);//91 fprintf(fd, "%d\n", res); res = ft_printf("%00.5i\n", 123);//92 fprintf(fd, "%d\n", res); res = ft_printf("%07.0i\n", 123);//93 fprintf(fd, "%d\n", res); res = ft_printf("%00.3i\n", 12345);//94 fprintf(fd, "%d\n", res); res = ft_printf("%03.0i\n", 12345);//95 fprintf(fd, "%d\n", res); res = ft_printf("%00.5i\n", -123);//96 fprintf(fd, "%d\n", res); res = ft_printf("%07.0i\n", -123);//97 fprintf(fd, "%d\n", res); res = ft_printf("%00.3i\n", -12345);//98 fprintf(fd, "%d\n", res); res = ft_printf("%03.0i\n", -12345);//99 fprintf(fd, "%d\n", res); res = ft_printf("%06.0i\n", 0);//100 fprintf(fd, "%d\n", res); res = ft_printf("%06.i\n", 0);//101 fprintf(fd, "%d\n", res); res = ft_printf("%00.7i\n", 0);//102 fprintf(fd, "%d\n", res); res = ft_printf("%00.0i\n", 0);//103 fprintf(fd, "%d\n", res); res = ft_printf("%00.i\n", 0);//104 fprintf(fd, "%d\n", res); /* ** Print extreme values */ res = ft_printf("%15.5i\n", 2147483647);//105 fprintf(fd, "%d\n", res); res = ft_printf("%15.15i\n", 2147483647);//106 fprintf(fd, "%d\n", res); res = ft_printf("%15.5i\n", -2147483647);//107 fprintf(fd, "%d\n", res); res = ft_printf("%15.15i\n", -2147483647);//108 fprintf(fd, "%d\n", res); res = ft_printf("%-15.5i\n", 2147483647);//109 fprintf(fd, "%d\n", res); res = ft_printf("%-15.15i\n", 2147483647);//110 fprintf(fd, "%d\n", res); res = ft_printf("%-15.5i\n", -2147483647);//111 fprintf(fd, "%d\n", res); res = ft_printf("%-15.15i\n", -2147483647);//112 fprintf(fd, "%d\n", res); res = ft_printf("%015.5i\n", 2147483647);//113 fprintf(fd, "%d\n", res); res = ft_printf("%015.15i\n", 2147483647);//114 fprintf(fd, "%d\n", res); res = ft_printf("%015.5i\n", -2147483647);//115 fprintf(fd, "%d\n", res); res = ft_printf("%015.15i\n", -2147483647);//116 fprintf(fd, "%d\n", res); /* ** Printing with extra zeros */ res = ft_printf("%i\n", 001);//117 fprintf(fd, "%d\n", res); res = ft_printf("%i\n", -001);//118 fprintf(fd, "%d\n", res); res = ft_printf("%15.5i\n", 001);//119 fprintf(fd, "%d\n", res); res = ft_printf("%15.15i\n", -001);//120 fprintf(fd, "%d\n", res); res = ft_printf("%-i\n", 001);//121 fprintf(fd, "%d\n", res); res = ft_printf("%-i\n", -001);//122 fprintf(fd, "%d\n", res); res = ft_printf("%-15.5i\n", 001);//123 fprintf(fd, "%d\n", res); res = ft_printf("%-15.15i\n", -001);//124 fprintf(fd, "%d\n", res); res = ft_printf("%0i\n", 001);//125 fprintf(fd, "%d\n", res); res = ft_printf("%0i\n", -001);//126 fprintf(fd, "%d\n", res); res = ft_printf("%015.5i\n", 001);//127 fprintf(fd, "%d\n", res); res = ft_printf("%015.15i\n", -001);//128 fprintf(fd, "%d\n", res); /* ** Printing with '+' */ res = ft_printf("%i\n", +123);//129 fprintf(fd, "%d\n", res); res = ft_printf("%i\n", +0);//130 fprintf(fd, "%d\n", res); res = ft_printf("%-i\n", +123);//131 fprintf(fd, "%d\n", res); res = ft_printf("%-i\n", +0);//132 fprintf(fd, "%d\n", res); res = ft_printf("%0i\n", +123);//133 fprintf(fd, "%d\n", res); res = ft_printf("%0i\n", +0);//134 fprintf(fd, "%d\n", res); /* ** Printing with * */ res = ft_printf("%*.5i\n", 7, 123);//135 fprintf(fd, "%d\n", res); res = ft_printf("%7.*i\n", 2, 123);//136 fprintf(fd, "%d\n", res); res = ft_printf("%*.*i\n", 4, 3, 12345);//137 fprintf(fd, "%d\n", res); res = ft_printf("%*.*i\n", -4, 3, 12345);//138 fprintf(fd, "%d\n", res); res = ft_printf("%-*.*i\n", -4, 3, 12345);//139 fprintf(fd, "%d\n", res); res = ft_printf("%*.*i\n", -8, 3, 12345);//140 fprintf(fd, "%d\n", res); res = ft_printf("%-*.*i\n", -8, 3, 12345);//141 fprintf(fd, "%d\n", res); res = ft_printf("%*.*i\n", -4, -3, 12345);//142 fprintf(fd, "%d\n", res); res = ft_printf("%-*.*i\n", -4, -3, 12345);//143 fprintf(fd, "%d\n", res); res = ft_printf("%*.*i\n", -8, -3, 12345);//144 fprintf(fd, "%d\n", res); res = ft_printf("%-*.*i\n", -8, -3, 12345);//145 fprintf(fd, "%d\n", res); res = ft_printf("%*.*i\n", -4, -10, 12345);//146 fprintf(fd, "%d\n", res); res = ft_printf("%-*.*i\n", -4, -10, 12345);//147 fprintf(fd, "%d\n", res); res = ft_printf("%*.*i\n", -8, -10, 12345);//148 fprintf(fd, "%d\n", res); res = ft_printf("%-*.*i\n", -8, -10, 12345);//149 fprintf(fd, "%d\n", res); res = ft_printf("%0*.*i\n", -8, -10, 12345);//150 fprintf(fd, "%d\n", res); res = ft_printf("%0*.*i\n", -8, -10, 12345);//151 fprintf(fd, "%d\n", res); /* ** Printing with text */ res = ft_printf("Hello i am %i years old and my length is %i cm\n", 22, 190);//152 fprintf(fd, "%d\n", res); res = ft_printf("Hello i am %10i years old and my length is %10i cm\n", 22, 190);//153 fprintf(fd, "%d\n", res); res = ft_printf("Hello i am %-10i years old and my length is %010i cm\n", 22, 190);//154 fprintf(fd, "%d\n", res); res = ft_printf("Hello i am %.10i years old and my length is %-.15i cm\n", 22, 190);//155 fprintf(fd, "%d\n", res); res = ft_printf("Hello i am %.i years old and my length is %-.i cm\n", 22, 190);//156 fprintf(fd, "%d\n", res); res = ft_printf("Hello i am %-20.10i years old and my length is %-10.20i cm\n", 22, 190);//157 fprintf(fd, "%d\n", res); res = ft_printf("Hello i am %20.10i years old and my length is %10.20i cm\n", 22, 190);//158 fprintf(fd, "%d\n", res); /* ** Extra tests */ res = ft_printf("%0*i\n", -7, -54);//159 fprintf(fd, "%d\n", res); res = ft_printf("%0*.*i\n", 2, -2, 0);//160 fprintf(fd, "%d\n", res); res = ft_printf("%0*.*i\n", 2, -2, 8);//161 fprintf(fd, "%d\n", res); res = ft_printf("%0*.*i\n", 2, -2, -8);//162 fprintf(fd, "%d\n", res); res = ft_printf("%0*.*i\n", 2, -2, 12);//163 fprintf(fd, "%d\n", res); res = ft_printf("%0*.*i\n", 2, -2, -12);//164 fprintf(fd, "%d\n", res); res = ft_printf("%0*.*i\n", 2, -2, 456);//165 fprintf(fd, "%d\n", res); res = ft_printf("%0*.*i\n", 2, -2, -456);//166 fprintf(fd, "%d\n", res); res = ft_printf("%0*.*i\n", 3, -2, 0);//167 fprintf(fd, "%d\n", res); res = ft_printf("%0*.*i\n", 3, -2, 8);//168 fprintf(fd, "%d\n", res); res = ft_printf("%0*.*i\n", 3, -2, -8);//169 fprintf(fd, "%d\n", res); res = ft_printf("%0*.*i\n", 3, -2, 12);//170 fprintf(fd, "%d\n", res); res = ft_printf("%0*.*i\n", 3, -2, -12);//171 fprintf(fd, "%d\n", res); res = ft_printf("%0*.*i\n", 3, -2, 456);//172 fprintf(fd, "%d\n", res); res = ft_printf("%0*.*i\n", 3, -2, -456);//173 fprintf(fd, "%d\n", res); res = ft_printf("%0*.*i\n", 4, -2, 0);//174 fprintf(fd, "%d\n", res); res = ft_printf("%0*.*i\n", 4, -2, 8);//175 fprintf(fd, "%d\n", res); res = ft_printf("%0*.*i\n", 4, -2, -8);//176 fprintf(fd, "%d\n", res); res = ft_printf("%0*.*i\n", 4, -2, 12);//177 fprintf(fd, "%d\n", res); res = ft_printf("%0*.*i\n", 4, -2, -12);//178 fprintf(fd, "%d\n", res); res = ft_printf("%0*.*i\n", 4, -2, 456);//179 fprintf(fd, "%d\n", res); res = ft_printf("%0*.*i\n", 4, -2, -456);//180 fprintf(fd, "%d\n", res); res = ft_printf("%0*.*i\n", 4, -6, 0);//181 fprintf(fd, "%d\n", res); res = ft_printf("%0*.*i\n", 4, -6, 8);//182 fprintf(fd, "%d\n", res); res = ft_printf("%0*.*i\n", 4, -6, -8);//183 fprintf(fd, "%d\n", res); res = ft_printf("%0*.*i\n", 4, -6, 12);//184 fprintf(fd, "%d\n", res); res = ft_printf("%0*.*i\n", 4, -6, -12);//185 fprintf(fd, "%d\n", res); res = ft_printf("%0*.*i\n", 4, -6, 456);//186 fprintf(fd, "%d\n", res); res = ft_printf("%0*.*i\n", 4, -6, -456);//187 fprintf(fd, "%d\n", res); res = ft_printf("%i\n", 0);//188 fprintf(fd, "%d\n", res); res = ft_printf("%3i\n", 0);//189 fprintf(fd, "%d\n", res); res = ft_printf("%-3i\n", 0);//189 fprintf(fd, "%d\n", res); return (0); }
the_stack_data/154828107.c
#define _GNU_SOURCE #include <errno.h> #include <inttypes.h> #include <netdb.h> #include <netinet/in.h> #include <string.h> #include <sys/socket.h> int gethostbyaddr_r(const void* a, socklen_t l, int af, struct hostent* h, char* buf, size_t buflen, struct hostent** res, int* err) { union { struct sockaddr_in sin; struct sockaddr_in6 sin6; } sa = {.sin.sin_family = af}; socklen_t sl = af == AF_INET6 ? sizeof sa.sin6 : sizeof sa.sin; int i; *res = 0; /* Load address argument into sockaddr structure */ if (af == AF_INET6 && l == 16) memcpy(&sa.sin6.sin6_addr, a, 16); else if (af == AF_INET && l == 4) memcpy(&sa.sin.sin_addr, a, 4); else { *err = NO_RECOVERY; return EINVAL; } /* Align buffer and check for space for pointers and ip address */ i = (uintptr_t)buf & (sizeof(char*) - 1); if (!i) i = sizeof(char*); if (buflen <= 5 * sizeof(char*) - i + l) return ERANGE; buf += sizeof(char*) - i; buflen -= 5 * sizeof(char*) - i + l; h->h_addr_list = (void*)buf; buf += 2 * sizeof(char*); h->h_aliases = (void*)buf; buf += 2 * sizeof(char*); h->h_addr_list[0] = buf; memcpy(h->h_addr_list[0], a, l); buf += l; h->h_addr_list[1] = 0; h->h_aliases[0] = buf; h->h_aliases[1] = 0; switch (getnameinfo((void*)&sa, sl, buf, buflen, 0, 0, 0)) { case EAI_AGAIN: *err = TRY_AGAIN; return EAGAIN; case EAI_OVERFLOW: return ERANGE; default: case EAI_MEMORY: case EAI_SYSTEM: case EAI_FAIL: *err = NO_RECOVERY; return errno; case 0: break; } h->h_addrtype = af; h->h_length = l; h->h_name = h->h_aliases[0]; *res = h; return 0; }
the_stack_data/149268.c
#include <stdio.h> int main() { printf("welcome to CSE 31!\n"); return 0; }
the_stack_data/173578848.c
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #define KiB * 1024 void read_line(FILE *file, char *line_buffer) { if (file == NULL || line_buffer == NULL) { printf("Error: file or line buffer pointer is null."); exit(1); } int ch = getc(file); int count = 0; while ((ch != '\n') && (ch != EOF)) { line_buffer[count] = ch; count++; ch = getc(file); } line_buffer[count] = '\0'; } char source[16 KiB]; void extract(char *fname) { char *buffer = (char *)source; char fence[4]; FILE *fp; int inBlock; inBlock = 0; fp = fopen(fname, "r"); if (fp == NULL) return; while (!feof(fp)) { read_line(fp, buffer); strncpy(fence, buffer, 3); fence[3] = '\0'; if (!strcmp(fence, "```")) { if (inBlock == 0) inBlock = 1; else inBlock = 0; } else { if ((inBlock == 1) && (strlen(buffer) != 0)) printf("%s\n", buffer); } } fclose(fp); } int main(int argc, char **argv) { int i = 1; if (argc > 1) { while (i < argc) { extract(argv[i++]); } } else printf("unu\n(c) 2013-2017 charles childers\n\nTry:\n %s filename\n", argv[0]); return 0; }
the_stack_data/406731.c
#include <stdlib.h> #include <string.h> // create graph typedef struct GraphNode { int node; struct GraphNode *next; } GraphNode; GraphNode *createNode(int val) { GraphNode *node = (GraphNode *)malloc(sizeof(GraphNode)); node->node = val; node->next = NULL; return node; } void preorder(GraphNode **graph, int N, int *nodecount, int from, int at, int *dis) { for (GraphNode *to = graph[at]; to; to = to->next) { if (from != to->node) //don't go back to parent { dis[to->node] = dis[at] + N - 2 * nodecount[to->node]; preorder(graph, N, nodecount, at, to->node, dis); } } } int postorder(GraphNode **graph, int from, int at, int *nodecount) { int res = 0; for (GraphNode *to = graph[at]; to; to = to->next) { if (from != to->node) //don't go back to parent { res += postorder(graph, at, to->node, nodecount); nodecount[at] += nodecount[to->node]; res += nodecount[to->node]; } } return res; } /** * Note: The returned array must be malloced, assume caller calls free(). */ int *sumOfDistancesInTree(int N, int **edges, int edgesSize, int *edgesColSize, int *returnSize) { GraphNode *graph[N]; memset(graph, 0, sizeof(graph)); for (int i = 0; i < edgesSize; ++i) { GraphNode *node = createNode(edges[i][1]); node->next = graph[edges[i][0]]; graph[edges[i][0]] = node; node = createNode(edges[i][0]); node->next = graph[edges[i][1]]; graph[edges[i][1]] = node; } int nodecount[N]; for (int i = 0; i < N; ++i) nodecount[i] = 1; *returnSize = N; int *res = (int *)malloc(sizeof(int) * (*returnSize)); res[0] = postorder(graph, -1, 0, nodecount); preorder(graph, N, nodecount, -1, 0, res); return res; }
the_stack_data/87651.c
/* Copyright (c) 2015-2019, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory Written by Simone Atzeni ([email protected]), Joachim Protze ([email protected]), Jonas Hahnfeld ([email protected]), Ganesh Gopalakrishnan, Zvonimir Rakamaric, Dong H. Ahn, Gregory L. Lee, Ignacio Laguna, and Martin Schulz. LLNL-CODE-773957 All rights reserved. This file is part of Archer. For details, see https://pruners.github.io/archer. Please also read https://github.com/PRUNERS/archer/blob/master/LICENSE. 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 disclaimer below. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the disclaimer (as noted below) in the documentation and/or other materials provided with the distribution. Neither the name of the LLNS/LLNL 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 LAWRENCE LIVERMORE NATIONAL SECURITY, LLC, THE U.S. DEPARTMENT OF ENERGY 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. */ // RUN: %libarcher-compile-and-run-race | FileCheck %s #include <omp.h> #include <stdio.h> #include <unistd.h> #define NUM_THREADS 2 int main(int argc, char* argv[]) { int var = 0; int i; #pragma omp parallel for num_threads(NUM_THREADS) shared(var) schedule(static,1) { for (i = 0; i < NUM_THREADS; i++) { #pragma omp task shared(var) if(0) { var++; // Sleep so that each thread executes one single task. // sleep(1); } } } int error = (var != 2); fprintf(stderr, "DONE\n"); return error; } // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Write of size 4 // CHECK: #0 .omp_outlined. // CHECK: #1 .omp_task_entry. // CHECK: Previous write of size 4 // CHECK: #0 .omp_outlined. // CHECK: #1 .omp_task_entry. // CHECK: DONE
the_stack_data/227709.c
#include<stdio.h> #include<stdlib.h> #include<unistd.h> #include<sys/types.h> #include<sys/socket.h> #include<sys/un.h> #include<errno.h> #include<fcntl.h> #define SOCK_FILE "yangzd" int create_local_sock(char *sockfile) { int local_fd; struct sockaddr_un myaddr; if(-1==(local_fd=socket(AF_LOCAL,SOCK_STREAM,0))) { perror("socket");exit(EXIT_FAILURE); } bzero(&myaddr,sizeof(myaddr)); myaddr.sun_family=AF_LOCAL; strncpy(myaddr.sun_path, sockfile,strlen(sockfile)); if(-1==bind(local_fd,(struct sockaddr *)&myaddr,sizeof(myaddr))) { perror("bind");exit(EXIT_FAILURE); } if(-1==listen(local_fd,5)) { perror("listen");exit(EXIT_FAILURE); } int new_fd; struct sockaddr_un peeraddr; int len=sizeof(peeraddr); new_fd=accept(local_fd,(struct sockaddr *)&peeraddr,&len); if(-1==new_fd) { perror("accept");exit(EXIT_FAILURE); } return new_fd; } send_fd(int sock_fd,char *file) { int fd_to_send; if(-1==(fd_to_send=open(file,O_RDWR|O_APPEND))) { perror("open");exit(EXIT_FAILURE); } struct cmsghdr *cmsg; cmsg = alloca(sizeof(struct cmsghdr)+sizeof(fd_to_send)); cmsg->cmsg_len = sizeof(struct cmsghdr)+sizeof(fd_to_send); cmsg->cmsg_level = SOL_SOCKET; cmsg->cmsg_type = SCM_RIGHTS; memcpy(CMSG_DATA(cmsg), &fd_to_send, sizeof(fd_to_send)); struct msghdr msg; msg.msg_control = cmsg; msg.msg_controllen = cmsg->cmsg_len; msg.msg_name= NULL; msg.msg_namelen = 0; struct iovec iov[3]; iov[0].iov_base = "hello "; iov[0].iov_len = strlen("hello "); iov[1].iov_base = "this is yangzd, "; iov[1].iov_len = strlen("this is yangzd, "); iov[2].iov_base = "and you?"; iov[2].iov_len = strlen("and you?"); msg.msg_iov = iov; msg.msg_iovlen = 3; if(sendmsg(sock_fd, &msg, 0) < 0) { printf("sendmsg error, errno is %d\n", errno); fprintf(stderr,"sendmsg failed. errno : %s\n",strerror(errno)); return errno; } return 1; } int main(int argc,char *argv[]) { int sock_fd=0; unlink(SOCK_FILE); if(argc != 2) { printf("pls usage %s file_send\n",argv[0]); exit(EXIT_FAILURE); } sock_fd=create_local_sock(SOCK_FILE); if(send_fd(sock_fd,argv[1])!=1) { printf("send error");exit(EXIT_FAILURE); } }
the_stack_data/40451.c
/* $FreeBSD: releng/9.3/sys/dev/syscons/logo/beastie.c 206362 2010-04-07 17:03:05Z jkim $ */ #define logo_width 88 #define logo_height 88 unsigned int logo_w = logo_width; unsigned int logo_h = logo_height; unsigned char logo_pal[768] = { 0x00, 0x00, 0x00, 0x33, 0x33, 0x33, 0x66, 0x66, 0x66, 0x99, 0x99, 0x99, 0xcc, 0xcc, 0xcc, 0xff, 0xff, 0xff, 0x90, 0x8f, 0x90, 0x56, 0x4b, 0x55, 0xa3, 0xa5, 0xab, 0xfd, 0xfd, 0xfd, 0x6d, 0x6e, 0x74, 0x41, 0x2b, 0x39, 0xcb, 0xc8, 0xcb, 0xcf, 0xbb, 0xba, 0x8e, 0x82, 0x87, 0x5c, 0x5d, 0x60, 0x52, 0x2a, 0x37, 0x7f, 0x76, 0x7d, 0x82, 0x82, 0x85, 0x7a, 0x3e, 0x45, 0x7f, 0x6e, 0x70, 0xef, 0xef, 0xed, 0x53, 0x41, 0x4b, 0x67, 0x2b, 0x35, 0x6a, 0x55, 0x62, 0xe7, 0xe2, 0xe3, 0x64, 0x35, 0x3f, 0xf7, 0xe0, 0xe7, 0xb1, 0xb2, 0xb2, 0x31, 0x2b, 0x35, 0x7a, 0x2d, 0x37, 0x69, 0x4c, 0x56, 0x95, 0x9d, 0xa4, 0x85, 0x61, 0x69, 0x40, 0x34, 0x41, 0x8f, 0x2e, 0x39, 0x7a, 0x50, 0x5a, 0xde, 0xe1, 0xe0, 0x32, 0x33, 0x3d, 0xa0, 0x9b, 0x9c, 0x68, 0x63, 0x67, 0x76, 0x60, 0x67, 0xba, 0xb6, 0xb8, 0x29, 0x24, 0x41, 0x38, 0x21, 0x29, 0x42, 0x21, 0x27, 0xa2, 0x2a, 0x32, 0x56, 0x55, 0x58, 0x55, 0x21, 0x2b, 0x7a, 0x20, 0x2a, 0x37, 0x16, 0x21, 0x4d, 0x18, 0x37, 0x8a, 0x3a, 0x3e, 0xc0, 0xc2, 0xc4, 0x64, 0x23, 0x2c, 0x37, 0x1a, 0x24, 0x42, 0x18, 0x20, 0x4c, 0x21, 0x2b, 0xa0, 0x23, 0x2e, 0x95, 0x6c, 0x76, 0x26, 0x16, 0x1c, 0xa5, 0x18, 0x23, 0x84, 0x20, 0x2b, 0x6d, 0x3f, 0x49, 0xae, 0xa7, 0xac, 0x2a, 0x1f, 0x24, 0x90, 0x21, 0x30, 0xa0, 0x39, 0x3e, 0x95, 0x0f, 0x1c, 0x84, 0x13, 0x1e, 0x4e, 0x17, 0x24, 0x8c, 0x56, 0x5f, 0xe0, 0xc4, 0xcb, 0xa5, 0x7f, 0x8e, 0xff, 0xff, 0xf1, 0x3d, 0x3d, 0x5d, 0x61, 0x19, 0x26, 0xd5, 0xd5, 0xd5, 0xff, 0xf1, 0xed, 0xb6, 0x9c, 0xa5, 0x87, 0x4c, 0x5a, 0xa0, 0x76, 0x76, 0xc8, 0xa0, 0xa0, 0xa2, 0xc1, 0xc8, 0x91, 0xae, 0xb6, 0x52, 0x8b, 0xae, 0xb3, 0xd2, 0xd4, 0x95, 0xb7, 0xc1, 0x54, 0x6e, 0x83, 0x67, 0x90, 0xa6, 0x44, 0x3e, 0x45, 0x23, 0x40, 0x6a, 0x41, 0x6e, 0x97, 0x7e, 0x8e, 0x91, 0x52, 0x33, 0x41, 0x39, 0x49, 0x68, 0x1d, 0x2a, 0x48, 0x17, 0x21, 0x45, 0x90, 0x17, 0x1f, 0x38, 0x54, 0x71, 0x1c, 0x33, 0x58, 0x1c, 0x1e, 0x23, 0x6c, 0x17, 0x21, 0xb0, 0xc5, 0xc1, 0x5d, 0x7f, 0x96, 0xe9, 0xbf, 0xc1, 0x96, 0x06, 0x0f, 0x78, 0x16, 0x1e, 0xab, 0x0e, 0x18, 0xa6, 0x06, 0x0e, 0x4c, 0x4c, 0x54, 0x61, 0x42, 0x4c, 0x48, 0x5f, 0x84, 0xa0, 0xb8, 0xbe, 0x5c, 0x66, 0x7f, 0x7b, 0x9e, 0xa9, 0x6f, 0x75, 0x7f, 0x45, 0x54, 0x74, 0x32, 0x3e, 0x63, 0xb1, 0xb4, 0xb3, 0x66, 0x9d, 0xb4, 0x7a, 0x9f, 0xbb, 0x82, 0xaa, 0xba, 0x13, 0x15, 0x17, 0x0b, 0x0b, 0x0a, 0x37, 0x66, 0x92, 0x4c, 0x7f, 0xa5, 0x24, 0x4c, 0x7b, 0x25, 0x5f, 0x91, 0x40, 0x7d, 0xa5, 0x1d, 0x56, 0x88, 0x2d, 0x6f, 0xa0, 0x70, 0x81, 0x8f, 0x58, 0x97, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; unsigned char logo_img[logo_width*logo_height] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x09, 0x0a, 0x0b, 0x07, 0x0c, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0d, 0x0e, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x03, 0x04, 0x05, 0x05, 0x05, 0x05, 0x09, 0x0f, 0x0b, 0x10, 0x11, 0x09, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x12, 0x13, 0x14, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x15, 0x16, 0x0b, 0x17, 0x18, 0x19, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x11, 0x13, 0x1a, 0x1b, 0x05, 0x05, 0x05, 0x04, 0x03, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x1c, 0x1d, 0x10, 0x1e, 0x1f, 0x19, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x20, 0x0b, 0x1e, 0x21, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x19, 0x22, 0x0b, 0x17, 0x23, 0x24, 0x15, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x25, 0x26, 0x10, 0x23, 0x27, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x05, 0x05, 0x05, 0x25, 0x27, 0x11, 0x28, 0x29, 0x11, 0x06, 0x0d, 0x09, 0x05, 0x2a, 0x2b, 0x2c, 0x2d, 0x1e, 0x2e, 0x21, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x2f, 0x0b, 0x30, 0x31, 0x0c, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x15, 0x06, 0x16, 0x22, 0x1d, 0x2c, 0x32, 0x33, 0x17, 0x17, 0x17, 0x22, 0x14, 0x16, 0x1d, 0x2c, 0x2d, 0x1e, 0x2e, 0x34, 0x0c, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x35, 0x2b, 0x2c, 0x36, 0x36, 0x35, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x27, 0x0b, 0x2c, 0x2c, 0x37, 0x32, 0x38, 0x2c, 0x2d, 0x39, 0x36, 0x17, 0x30, 0x2c, 0x2c, 0x2d, 0x2c, 0x2c, 0x1a, 0x3a, 0x3a, 0x3b, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0a, 0x2d, 0x2b, 0x33, 0x31, 0x0e, 0x05, 0x05, 0x05, 0x05, 0x09, 0x28, 0x2c, 0x37, 0x3c, 0x32, 0x38, 0x38, 0x37, 0x2c, 0x30, 0x36, 0x36, 0x17, 0x31, 0x36, 0x23, 0x23, 0x17, 0x2c, 0x17, 0x3a, 0x3d, 0x13, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x22, 0x2c, 0x37, 0x33, 0x3e, 0x31, 0x3f, 0x40, 0x19, 0x05, 0x11, 0x2c, 0x2c, 0x32, 0x32, 0x32, 0x38, 0x37, 0x41, 0x30, 0x3a, 0x3a, 0x2e, 0x42, 0x43, 0x17, 0x1a, 0x13, 0x23, 0x31, 0x1a, 0x2e, 0x3d, 0x1a, 0x09, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0b, 0x37, 0x32, 0x37, 0x33, 0x44, 0x44, 0x45, 0x17, 0x1a, 0x10, 0x2d, 0x37, 0x38, 0x46, 0x33, 0x46, 0x32, 0x2c, 0x23, 0x23, 0x47, 0x21, 0x13, 0x43, 0x34, 0x48, 0x19, 0x49, 0x34, 0x17, 0x1e, 0x3a, 0x13, 0x4a, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x4b, 0x32, 0x32, 0x32, 0x32, 0x4c, 0x45, 0x44, 0x44, 0x42, 0x36, 0x30, 0x33, 0x46, 0x38, 0x33, 0x46, 0x38, 0x31, 0x23, 0x27, 0x09, 0x4a, 0x4d, 0x47, 0x43, 0x0d, 0x4e, 0x4a, 0x4f, 0x34, 0x1a, 0x2e, 0x29, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x11, 0x33, 0x32, 0x32, 0x32, 0x33, 0x4c, 0x31, 0x45, 0x3e, 0x31, 0x36, 0x46, 0x46, 0x33, 0x33, 0x39, 0x30, 0x23, 0x50, 0x4a, 0x4a, 0x4a, 0x4a, 0x4d, 0x47, 0x51, 0x4e, 0x4a, 0x4a, 0x0e, 0x13, 0x1a, 0x27, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x35, 0x2b, 0x32, 0x32, 0x2b, 0x32, 0x33, 0x4c, 0x33, 0x4c, 0x4c, 0x36, 0x30, 0x30, 0x30, 0x30, 0x31, 0x23, 0x3a, 0x49, 0x4a, 0x4a, 0x4a, 0x4a, 0x4a, 0x4f, 0x50, 0x1b, 0x4e, 0x4a, 0x19, 0x50, 0x16, 0x0c, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x07, 0x32, 0x32, 0x32, 0x32, 0x2b, 0x33, 0x33, 0x30, 0x2d, 0x39, 0x30, 0x30, 0x30, 0x4c, 0x36, 0x42, 0x3a, 0x52, 0x05, 0x4a, 0x4a, 0x4a, 0x4a, 0x09, 0x3b, 0x52, 0x4e, 0x4a, 0x4a, 0x4f, 0x1a, 0x2a, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x4d, 0x2b, 0x2b, 0x32, 0x32, 0x32, 0x37, 0x2c, 0x2c, 0x2c, 0x2c, 0x2d, 0x10, 0x30, 0x30, 0x3e, 0x23, 0x3a, 0x0d, 0x4a, 0x4a, 0x4a, 0x4a, 0x4a, 0x4a, 0x40, 0x51, 0x4a, 0x4a, 0x25, 0x15, 0x1f, 0x27, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x40, 0x22, 0x2c, 0x32, 0x32, 0x32, 0x38, 0x2d, 0x2c, 0x41, 0x32, 0x39, 0x46, 0x4c, 0x31, 0x2e, 0x2e, 0x0c, 0x4a, 0x4a, 0x4a, 0x4a, 0x4a, 0x25, 0x53, 0x18, 0x4a, 0x54, 0x55, 0x56, 0x51, 0x11, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x2a, 0x22, 0x32, 0x32, 0x32, 0x38, 0x38, 0x32, 0x2c, 0x37, 0x38, 0x30, 0x30, 0x3e, 0x3a, 0x3a, 0x2a, 0x4a, 0x4a, 0x05, 0x4a, 0x57, 0x58, 0x59, 0x5a, 0x35, 0x58, 0x5b, 0x5c, 0x5d, 0x5e, 0x4a, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x4d, 0x07, 0x37, 0x32, 0x38, 0x38, 0x32, 0x32, 0x41, 0x38, 0x30, 0x30, 0x3e, 0x3a, 0x3d, 0x27, 0x05, 0x4a, 0x4a, 0x4a, 0x5c, 0x5f, 0x59, 0x1d, 0x29, 0x2f, 0x60, 0x61, 0x26, 0x0b, 0x1c, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x4e, 0x0a, 0x2d, 0x38, 0x38, 0x32, 0x37, 0x32, 0x2d, 0x39, 0x36, 0x31, 0x62, 0x3d, 0x0e, 0x4a, 0x4a, 0x4a, 0x09, 0x63, 0x64, 0x64, 0x61, 0x2d, 0x1d, 0x65, 0x61, 0x2b, 0x17, 0x16, 0x4a, 0x05, 0x05, 0x04, 0x03, 0x02, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x27, 0x2c, 0x38, 0x38, 0x37, 0x37, 0x38, 0x2d, 0x30, 0x31, 0x42, 0x3a, 0x18, 0x09, 0x05, 0x05, 0x4a, 0x63, 0x60, 0x60, 0x2b, 0x10, 0x2d, 0x41, 0x41, 0x30, 0x42, 0x3e, 0x29, 0x09, 0x05, 0x05, 0x04, 0x03, 0x03, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x2a, 0x37, 0x32, 0x38, 0x32, 0x41, 0x38, 0x38, 0x30, 0x66, 0x31, 0x3a, 0x1e, 0x67, 0x4a, 0x4a, 0x05, 0x68, 0x64, 0x61, 0x2b, 0x17, 0x36, 0x10, 0x33, 0x31, 0x42, 0x3d, 0x45, 0x06, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x1c, 0x2c, 0x32, 0x32, 0x37, 0x41, 0x2c, 0x46, 0x30, 0x36, 0x36, 0x42, 0x42, 0x29, 0x1b, 0x4a, 0x4a, 0x4d, 0x26, 0x60, 0x0b, 0x17, 0x36, 0x44, 0x45, 0x66, 0x3e, 0x44, 0x44, 0x1a, 0x05, 0x05, 0x05, 0x05, 0x05, 0x15, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0c, 0x2c, 0x32, 0x32, 0x38, 0x37, 0x32, 0x37, 0x30, 0x36, 0x4c, 0x31, 0x1e, 0x10, 0x1f, 0x52, 0x69, 0x52, 0x07, 0x2c, 0x10, 0x36, 0x62, 0x6a, 0x44, 0x6b, 0x3e, 0x44, 0x6c, 0x30, 0x09, 0x05, 0x05, 0x25, 0x54, 0x19, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x25, 0x2c, 0x37, 0x38, 0x37, 0x2c, 0x32, 0x32, 0x46, 0x30, 0x46, 0x4c, 0x31, 0x66, 0x4c, 0x36, 0x1a, 0x1a, 0x17, 0x37, 0x37, 0x10, 0x31, 0x62, 0x45, 0x4c, 0x3e, 0x44, 0x62, 0x30, 0x09, 0x05, 0x0a, 0x70, 0x71, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x22, 0x32, 0x32, 0x38, 0x41, 0x41, 0x38, 0x2d, 0x46, 0x66, 0x44, 0x6c, 0x6c, 0x6c, 0x3d, 0x3a, 0x42, 0x31, 0x32, 0x32, 0x32, 0x33, 0x33, 0x30, 0x36, 0x3e, 0x3e, 0x31, 0x07, 0x05, 0x12, 0x6e, 0x72, 0x09, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x2d, 0x2c, 0x38, 0x32, 0x41, 0x37, 0x2d, 0x46, 0x66, 0x6a, 0x6c, 0x6d, 0x6d, 0x6c, 0x3d, 0x3d, 0x31, 0x38, 0x38, 0x39, 0x33, 0x39, 0x36, 0x30, 0x30, 0x66, 0x30, 0x40, 0x4d, 0x5f, 0x4d, 0x4d, 0x05, 0x05, 0x05, 0x15, 0x04, 0x03, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x09, 0x5a, 0x2d, 0x32, 0x32, 0x37, 0x37, 0x32, 0x38, 0x46, 0x46, 0x66, 0x45, 0x44, 0x62, 0x44, 0x44, 0x3e, 0x31, 0x31, 0x31, 0x31, 0x31, 0x33, 0x37, 0x30, 0x10, 0x06, 0x05, 0x12, 0x0a, 0x05, 0x05, 0x05, 0x08, 0x68, 0x73, 0x05, 0x04, 0x03, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x35, 0x22, 0x32, 0x32, 0x32, 0x3c, 0x37, 0x37, 0x2d, 0x39, 0x39, 0x39, 0x36, 0x36, 0x6b, 0x3e, 0x3e, 0x3e, 0x3e, 0x31, 0x4c, 0x39, 0x2d, 0x10, 0x16, 0x2a, 0x05, 0x05, 0x74, 0x74, 0x05, 0x05, 0x0c, 0x75, 0x5f, 0x1c, 0x05, 0x05, 0x04, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x40, 0x2c, 0x32, 0x32, 0x32, 0x41, 0x37, 0x41, 0x2c, 0x2c, 0x41, 0x2c, 0x33, 0x36, 0x31, 0x36, 0x31, 0x31, 0x17, 0x46, 0x2c, 0x16, 0x40, 0x05, 0x05, 0x05, 0x05, 0x20, 0x5f, 0x4d, 0x72, 0x76, 0x06, 0x25, 0x4a, 0x05, 0x05, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x40, 0x0b, 0x2d, 0x37, 0x2d, 0x2c, 0x2c, 0x37, 0x37, 0x38, 0x2c, 0x37, 0x2c, 0x10, 0x10, 0x39, 0x30, 0x0b, 0x2c, 0x11, 0x09, 0x05, 0x09, 0x4a, 0x05, 0x05, 0x19, 0x1d, 0x26, 0x76, 0x08, 0x05, 0x05, 0x05, 0x15, 0x25, 0x4d, 0x53, 0x77, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x4d, 0x5a, 0x2c, 0x37, 0x2d, 0x2c, 0x37, 0x37, 0x39, 0x39, 0x33, 0x38, 0x2c, 0x2d, 0x2d, 0x2c, 0x5e, 0x2a, 0x05, 0x15, 0x3b, 0x17, 0x1f, 0x19, 0x05, 0x06, 0x26, 0x60, 0x5f, 0x0c, 0x05, 0x05, 0x05, 0x35, 0x68, 0x78, 0x56, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x35, 0x2c, 0x2c, 0x2c, 0x37, 0x32, 0x37, 0x2c, 0x37, 0x32, 0x46, 0x33, 0x46, 0x39, 0x11, 0x15, 0x05, 0x05, 0x18, 0x31, 0x44, 0x6a, 0x30, 0x6e, 0x2b, 0x4b, 0x11, 0x5f, 0x63, 0x72, 0x54, 0x20, 0x74, 0x58, 0x25, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x15, 0x0b, 0x2c, 0x38, 0x2d, 0x39, 0x39, 0x2d, 0x37, 0x3c, 0x32, 0x37, 0x0b, 0x18, 0x05, 0x05, 0x05, 0x4e, 0x26, 0x32, 0x45, 0x6a, 0x46, 0x2b, 0x72, 0x4e, 0x05, 0x35, 0x0a, 0x75, 0x5f, 0x70, 0x08, 0x09, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x35, 0x22, 0x2d, 0x30, 0x6b, 0x6b, 0x66, 0x36, 0x30, 0x36, 0x4c, 0x36, 0x30, 0x18, 0x05, 0x05, 0x05, 0x09, 0x4b, 0x32, 0x46, 0x66, 0x38, 0x0b, 0x09, 0x05, 0x05, 0x05, 0x05, 0x09, 0x05, 0x05, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0a, 0x2c, 0x2c, 0x31, 0x62, 0x62, 0x6b, 0x31, 0x45, 0x44, 0x44, 0x45, 0x31, 0x10, 0x0c, 0x4d, 0x0c, 0x08, 0x0b, 0x3c, 0x32, 0x33, 0x66, 0x17, 0x06, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x09, 0x22, 0x2c, 0x2d, 0x31, 0x45, 0x6b, 0x36, 0x31, 0x6b, 0x62, 0x45, 0x6a, 0x66, 0x30, 0x0b, 0x2c, 0x2c, 0x2c, 0x2c, 0x37, 0x46, 0x6b, 0x44, 0x62, 0x5e, 0x05, 0x05, 0x05, 0x05, 0x04, 0x03, 0x03, 0x03, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0c, 0x1d, 0x2c, 0x39, 0x36, 0x4c, 0x30, 0x30, 0x30, 0x36, 0x4c, 0x66, 0x4c, 0x36, 0x30, 0x37, 0x41, 0x2c, 0x2d, 0x2c, 0x3c, 0x33, 0x6b, 0x44, 0x44, 0x39, 0x09, 0x05, 0x05, 0x04, 0x03, 0x02, 0x02, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x2d, 0x2d, 0x2d, 0x36, 0x39, 0x2d, 0x32, 0x38, 0x38, 0x46, 0x6a, 0x6d, 0x3d, 0x62, 0x46, 0x3c, 0x37, 0x2d, 0x32, 0x32, 0x32, 0x38, 0x4c, 0x30, 0x16, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0a, 0x37, 0x38, 0x38, 0x39, 0x37, 0x2c, 0x37, 0x37, 0x30, 0x45, 0x6d, 0x6d, 0x62, 0x62, 0x38, 0x3c, 0x3c, 0x32, 0x37, 0x32, 0x32, 0x32, 0x2c, 0x14, 0x15, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x6e, 0x37, 0x38, 0x38, 0x38, 0x37, 0x2c, 0x2d, 0x30, 0x31, 0x62, 0x6a, 0x6d, 0x6a, 0x6a, 0x46, 0x32, 0x32, 0x37, 0x37, 0x32, 0x30, 0x17, 0x29, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x4a, 0x0b, 0x38, 0x38, 0x38, 0x2c, 0x2c, 0x0b, 0x2d, 0x39, 0x4c, 0x45, 0x6a, 0x6a, 0x6a, 0x6a, 0x6a, 0x38, 0x37, 0x2c, 0x41, 0x18, 0x1c, 0x0c, 0x05, 0x04, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x15, 0x0b, 0x2d, 0x38, 0x38, 0x37, 0x2c, 0x2c, 0x2c, 0x37, 0x32, 0x4c, 0x6b, 0x44, 0x44, 0x45, 0x6a, 0x45, 0x38, 0x37, 0x1c, 0x09, 0x05, 0x05, 0x04, 0x03, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x09, 0x1d, 0x38, 0x38, 0x38, 0x38, 0x2c, 0x3c, 0x37, 0x37, 0x32, 0x32, 0x46, 0x36, 0x1e, 0x6b, 0x4c, 0x46, 0x32, 0x22, 0x09, 0x05, 0x05, 0x04, 0x03, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x07, 0x37, 0x32, 0x37, 0x38, 0x38, 0x37, 0x32, 0x3c, 0x32, 0x32, 0x37, 0x38, 0x2d, 0x2d, 0x38, 0x2c, 0x2c, 0x4f, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x08, 0x3c, 0x37, 0x41, 0x38, 0x2d, 0x37, 0x37, 0x3c, 0x32, 0x3c, 0x32, 0x37, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0c, 0x41, 0x3c, 0x3c, 0x38, 0x32, 0x3c, 0x3c, 0x3c, 0x41, 0x32, 0x41, 0x37, 0x2c, 0x2c, 0x41, 0x38, 0x45, 0x18, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x2a, 0x2c, 0x3c, 0x37, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x37, 0x2c, 0x2c, 0x2c, 0x2c, 0x4c, 0x45, 0x6a, 0x1a, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x11, 0x2c, 0x37, 0x41, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x41, 0x37, 0x37, 0x4c, 0x44, 0x6d, 0x6a, 0x1a, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x5a, 0x2c, 0x41, 0x3c, 0x3c, 0x3c, 0x32, 0x2c, 0x32, 0x2c, 0x2c, 0x38, 0x38, 0x36, 0x45, 0x62, 0x44, 0x45, 0x29, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x2a, 0x2c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x37, 0x37, 0x32, 0x37, 0x39, 0x4c, 0x4c, 0x45, 0x62, 0x44, 0x62, 0x30, 0x2a, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x4a, 0x5a, 0x41, 0x3c, 0x3c, 0x3c, 0x3c, 0x32, 0x3c, 0x37, 0x37, 0x2d, 0x46, 0x4c, 0x6b, 0x6b, 0x45, 0x3e, 0x36, 0x29, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x27, 0x3c, 0x37, 0x3c, 0x3c, 0x37, 0x37, 0x32, 0x38, 0x37, 0x37, 0x37, 0x38, 0x39, 0x36, 0x4c, 0x30, 0x10, 0x16, 0x09, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x04, 0x05, 0x05, 0x25, 0x1d, 0x37, 0x37, 0x41, 0x32, 0x3c, 0x32, 0x41, 0x37, 0x32, 0x2c, 0x41, 0x37, 0x2c, 0x32, 0x37, 0x2c, 0x2c, 0x5a, 0x0c, 0x05, 0x05, 0x05, 0x04, 0x03, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x05, 0x05, 0x15, 0x5a, 0x37, 0x2c, 0x41, 0x2c, 0x2c, 0x41, 0x37, 0x41, 0x41, 0x3c, 0x2c, 0x41, 0x41, 0x3c, 0x37, 0x2c, 0x39, 0x0b, 0x0b, 0x25, 0x05, 0x05, 0x05, 0x05, 0x04, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x2a, 0x22, 0x2d, 0x37, 0x2c, 0x3c, 0x1d, 0x2c, 0x38, 0x2c, 0x41, 0x2c, 0x2c, 0x2d, 0x39, 0x37, 0x3c, 0x37, 0x30, 0x1a, 0x5e, 0x6e, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x2a, 0x6e, 0x0b, 0x2d, 0x38, 0x41, 0x41, 0x6e, 0x5a, 0x2c, 0x41, 0x32, 0x38, 0x32, 0x39, 0x3f, 0x6f, 0x16, 0x37, 0x1a, 0x1f, 0x1f, 0x16, 0x1d, 0x0c, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x09, 0x40, 0x07, 0x2c, 0x37, 0x2c, 0x2d, 0x2c, 0x1d, 0x0e, 0x09, 0x0b, 0x4b, 0x07, 0x41, 0x38, 0x2d, 0x10, 0x2d, 0x10, 0x0b, 0x2b, 0x33, 0x3f, 0x21, 0x29, 0x07, 0x5e, 0x2f, 0x12, 0x08, 0x2a, 0x0c, 0x25, 0x09, 0x09, 0x09, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x19, 0x40, 0x28, 0x22, 0x2c, 0x38, 0x32, 0x32, 0x32, 0x1d, 0x0e, 0x19, 0x05, 0x35, 0x2c, 0x4b, 0x70, 0x0b, 0x32, 0x2c, 0x16, 0x16, 0x16, 0x0b, 0x22, 0x26, 0x0b, 0x10, 0x3f, 0x29, 0x1f, 0x47, 0x1f, 0x1f, 0x5e, 0x0b, 0x4b, 0x74, 0x84, 0x74, 0x84, 0x06, 0x35, 0x09, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x09, 0x4d, 0x27, 0x0a, 0x22, 0x1d, 0x2c, 0x2c, 0x37, 0x32, 0x41, 0x41, 0x16, 0x27, 0x15, 0x09, 0x4a, 0x09, 0x28, 0x2d, 0x0b, 0x76, 0x2c, 0x37, 0x2d, 0x37, 0x32, 0x37, 0x0b, 0x0b, 0x5e, 0x5a, 0x4b, 0x0b, 0x0b, 0x07, 0x6e, 0x16, 0x5e, 0x10, 0x76, 0x5c, 0x68, 0x79, 0x7a, 0x53, 0x71, 0x54, 0x5d, 0x08, 0x4d, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x04, 0x05, 0x05, 0x05, 0x25, 0x27, 0x28, 0x0b, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x41, 0x41, 0x41, 0x22, 0x11, 0x35, 0x4d, 0x4d, 0x35, 0x1c, 0x06, 0x0a, 0x22, 0x38, 0x38, 0x37, 0x38, 0x38, 0x38, 0x2d, 0x39, 0x39, 0x39, 0x10, 0x39, 0x10, 0x4b, 0x12, 0x08, 0x35, 0x67, 0x2a, 0x08, 0x74, 0x70, 0x81, 0x55, 0x78, 0x79, 0x57, 0x53, 0x71, 0x71, 0x73, 0x84, 0x25, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x05, 0x09, 0x27, 0x16, 0x0b, 0x2c, 0x2d, 0x2c, 0x41, 0x41, 0x1d, 0x22, 0x5a, 0x0f, 0x14, 0x0a, 0x28, 0x0a, 0x28, 0x28, 0x28, 0x6e, 0x5a, 0x65, 0x1d, 0x0b, 0x2d, 0x38, 0x46, 0x38, 0x38, 0x38, 0x39, 0x2d, 0x46, 0x39, 0x30, 0x39, 0x4b, 0x68, 0x79, 0x7a, 0x57, 0x67, 0x67, 0x56, 0x53, 0x71, 0x68, 0x7e, 0x85, 0x59, 0x73, 0x79, 0x54, 0x7a, 0x54, 0x06, 0x1c, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x05, 0x4d, 0x16, 0x0b, 0x10, 0x39, 0x2d, 0x0b, 0x28, 0x06, 0x2a, 0x25, 0x35, 0x06, 0x11, 0x0a, 0x28, 0x07, 0x5a, 0x22, 0x26, 0x5a, 0x41, 0x7b, 0x7c, 0x60, 0x76, 0x22, 0x1d, 0x32, 0x38, 0x46, 0x46, 0x46, 0x38, 0x38, 0x38, 0x38, 0x2b, 0x75, 0x7d, 0x7e, 0x55, 0x78, 0x7a, 0x57, 0x57, 0x57, 0x71, 0x20, 0x68, 0x55, 0x85, 0x7a, 0x57, 0x53, 0x71, 0x57, 0x5d, 0x19, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x0c, 0x16, 0x0b, 0x30, 0x39, 0x18, 0x2a, 0x09, 0x05, 0x4e, 0x19, 0x25, 0x0c, 0x27, 0x11, 0x0a, 0x0a, 0x2f, 0x5a, 0x5a, 0x26, 0x5a, 0x7b, 0x7c, 0x7c, 0x61, 0x7f, 0x7f, 0x7f, 0x76, 0x22, 0x22, 0x0b, 0x2d, 0x0b, 0x2d, 0x2d, 0x33, 0x0b, 0x5f, 0x80, 0x7d, 0x5c, 0x81, 0x55, 0x59, 0x59, 0x73, 0x73, 0x54, 0x5c, 0x5c, 0x7e, 0x55, 0x59, 0x73, 0x7a, 0x71, 0x19, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x05, 0x05, 0x09, 0x25, 0x08, 0x07, 0x5e, 0x10, 0x22, 0x1c, 0x4a, 0x05, 0x09, 0x05, 0x15, 0x4d, 0x19, 0x19, 0x4d, 0x08, 0x12, 0x74, 0x0f, 0x6e, 0x5a, 0x26, 0x1d, 0x7b, 0x7b, 0x7c, 0x7c, 0x7c, 0x61, 0x5b, 0x82, 0x82, 0x80, 0x80, 0x82, 0x7f, 0x7f, 0x7f, 0x7f, 0x5b, 0x7f, 0x82, 0x80, 0x7d, 0x5c, 0x7e, 0x79, 0x54, 0x54, 0x7a, 0x73, 0x0f, 0x2a, 0x25, 0x19, 0x09, 0x4a, 0x05, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x09, 0x4d, 0x2a, 0x06, 0x74, 0x28, 0x22, 0x22, 0x2d, 0x2c, 0x0e, 0x05, 0x05, 0x05, 0x05, 0x05, 0x3b, 0x07, 0x19, 0x09, 0x25, 0x0c, 0x27, 0x12, 0x0f, 0x2f, 0x26, 0x26, 0x1d, 0x65, 0x65, 0x7c, 0x7c, 0x7b, 0x7c, 0x7b, 0x7b, 0x60, 0x5b, 0x7f, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x80, 0x80, 0x83, 0x83, 0x81, 0x7e, 0x59, 0x73, 0x73, 0x84, 0x5d, 0x25, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x19, 0x08, 0x12, 0x0a, 0x0f, 0x6e, 0x5a, 0x26, 0x22, 0x2c, 0x2c, 0x0b, 0x27, 0x05, 0x05, 0x05, 0x15, 0x1e, 0x1e, 0x6f, 0x0c, 0x09, 0x15, 0x0c, 0x20, 0x12, 0x0f, 0x6e, 0x5a, 0x26, 0x26, 0x26, 0x65, 0x65, 0x65, 0x65, 0x7b, 0x7c, 0x7b, 0x65, 0x7b, 0x61, 0x61, 0x60, 0x64, 0x64, 0x64, 0x5b, 0x5b, 0x5f, 0x63, 0x70, 0x63, 0x58, 0x5d, 0x2a, 0x15, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x4a, 0x4d, 0x27, 0x11, 0x0a, 0x28, 0x6e, 0x5a, 0x26, 0x65, 0x41, 0x1d, 0x2c, 0x2c, 0x5e, 0x29, 0x0e, 0x14, 0x17, 0x31, 0x6b, 0x30, 0x14, 0x25, 0x09, 0x15, 0x4d, 0x08, 0x74, 0x0a, 0x0f, 0x2f, 0x5a, 0x26, 0x26, 0x1d, 0x1d, 0x1d, 0x2b, 0x65, 0x1d, 0x41, 0x65, 0x65, 0x7b, 0x65, 0x65, 0x1d, 0x6e, 0x74, 0x5d, 0x1c, 0x25, 0x15, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x09, 0x19, 0x4d, 0x08, 0x06, 0x0a, 0x2f, 0x6e, 0x2f, 0x6e, 0x26, 0x41, 0x7b, 0x65, 0x41, 0x37, 0x33, 0x30, 0x36, 0x36, 0x4c, 0x6b, 0x66, 0x30, 0x14, 0x35, 0x4a, 0x09, 0x15, 0x15, 0x25, 0x25, 0x0c, 0x1c, 0x08, 0x06, 0x5d, 0x5d, 0x5d, 0x0e, 0x06, 0x12, 0x06, 0x08, 0x1c, 0x2a, 0x0c, 0x19, 0x09, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x09, 0x09, 0x19, 0x35, 0x08, 0x12, 0x28, 0x2f, 0x2f, 0x6e, 0x5a, 0x41, 0x7c, 0x3c, 0x3c, 0x2c, 0x41, 0x2d, 0x2d, 0x39, 0x30, 0x4c, 0x4c, 0x66, 0x66, 0x31, 0x24, 0x20, 0x4a, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x4a, 0x09, 0x4a, 0x09, 0x09, 0x05, 0x09, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x09, 0x15, 0x0c, 0x1c, 0x12, 0x28, 0x2f, 0x5a, 0x1d, 0x7c, 0x7b, 0x41, 0x7b, 0x3c, 0x7b, 0x3c, 0x41, 0x41, 0x5a, 0x16, 0x28, 0x14, 0x14, 0x14, 0x3b, 0x12, 0x05, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x4a, 0x09, 0x15, 0x1c, 0x12, 0x12, 0x0a, 0x0f, 0x2f, 0x07, 0x2f, 0x0a, 0x12, 0x27, 0x0c, 0x4d, 0x15, 0x09, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x09, 0x15, 0x15, 0x15, 0x19, 0x4e, 0x4e, 0x05, 0x4a, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; unsigned int logo_img_size = sizeof(logo_img);
the_stack_data/67317.c
/* $OpenBSD: main.c,v 1.1 2003/07/12 04:08:33 jason Exp $ */ /* * Copyright (c) 2003 Jason L. Wright ([email protected]) * 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #include <sys/types.h> #include <signal.h> #include <stdio.h> #include <err.h> #include <string.h> #include <unistd.h> struct fpquad { u_int64_t x1; u_int64_t x2; u_int64_t x3; u_int64_t x4; }; void test_ldq_f2_g0(struct fpquad *); void test_ldq_f2_simm13(struct fpquad *); void test_stq_f2_g0(struct fpquad *); void test_stq_f2_simm13(struct fpquad *); void test_ldq_f6_g0(struct fpquad *); void test_ldq_f6_simm13(struct fpquad *); void test_stq_f6_g0(struct fpquad *); void test_stq_f6_simm13(struct fpquad *); void test_ldq_f10_g0(struct fpquad *); void test_ldq_f10_simm13(struct fpquad *); void test_stq_f10_g0(struct fpquad *); void test_stq_f10_simm13(struct fpquad *); void test_ldq_f14_g0(struct fpquad *); void test_ldq_f14_simm13(struct fpquad *); void test_stq_f14_g0(struct fpquad *); void test_stq_f14_simm13(struct fpquad *); void test_ldq_f18_g0(struct fpquad *); void test_ldq_f18_simm13(struct fpquad *); void test_stq_f18_g0(struct fpquad *); void test_stq_f18_simm13(struct fpquad *); void test_ldq_f22_g0(struct fpquad *); void test_ldq_f22_simm13(struct fpquad *); void test_stq_f22_g0(struct fpquad *); void test_stq_f22_simm13(struct fpquad *); void test_ldq_f26_g0(struct fpquad *); void test_ldq_f26_simm13(struct fpquad *); void test_stq_f26_g0(struct fpquad *); void test_stq_f26_simm13(struct fpquad *); void test_ldq_f30_g0(struct fpquad *); void test_ldq_f30_simm13(struct fpquad *); void test_stq_f30_g0(struct fpquad *); void test_stq_f30_simm13(struct fpquad *); void test_ldq_f34_g0(struct fpquad *); void test_ldq_f34_simm13(struct fpquad *); void test_stq_f34_g0(struct fpquad *); void test_stq_f34_simm13(struct fpquad *); void test_ldq_f38_g0(struct fpquad *); void test_ldq_f38_simm13(struct fpquad *); void test_stq_f38_g0(struct fpquad *); void test_stq_f38_simm13(struct fpquad *); void test_ldq_f42_g0(struct fpquad *); void test_ldq_f42_simm13(struct fpquad *); void test_stq_f42_g0(struct fpquad *); void test_stq_f42_simm13(struct fpquad *); void test_ldq_f46_g0(struct fpquad *); void test_ldq_f46_simm13(struct fpquad *); void test_stq_f46_g0(struct fpquad *); void test_stq_f46_simm13(struct fpquad *); void test_ldq_f50_g0(struct fpquad *); void test_ldq_f50_simm13(struct fpquad *); void test_stq_f50_g0(struct fpquad *); void test_stq_f50_simm13(struct fpquad *); void test_ldq_f54_g0(struct fpquad *); void test_ldq_f54_simm13(struct fpquad *); void test_stq_f54_g0(struct fpquad *); void test_stq_f54_simm13(struct fpquad *); void test_ldq_f58_g0(struct fpquad *); void test_ldq_f58_simm13(struct fpquad *); void test_stq_f58_g0(struct fpquad *); void test_stq_f58_simm13(struct fpquad *); void test_ldq_f62_g0(struct fpquad *); void test_ldq_f62_simm13(struct fpquad *); void test_stq_f62_g0(struct fpquad *); void test_stq_f62_simm13(struct fpquad *); struct fptest { char *reg; char *ldst; char *dir; void (*func)(struct fpquad *); } thetests[] = { {"2", "st", "reg", test_stq_f2_g0}, {"2", "ld", "reg", test_ldq_f2_g0}, {"2", "st", "imm", test_stq_f2_simm13}, {"2", "ld", "imm", test_ldq_f2_simm13}, {"6", "st", "reg", test_stq_f6_g0}, {"6", "ld", "reg", test_ldq_f6_g0}, {"6", "st", "imm", test_stq_f6_simm13}, {"6", "ld", "imm", test_ldq_f6_simm13}, {"10", "st", "reg", test_stq_f10_g0}, {"10", "ld", "reg", test_ldq_f10_g0}, {"10", "st", "imm", test_stq_f10_simm13}, {"10", "ld", "imm", test_ldq_f10_simm13}, {"14", "st", "reg", test_stq_f14_g0}, {"14", "ld", "reg", test_ldq_f14_g0}, {"14", "st", "imm", test_stq_f14_simm13}, {"14", "ld", "imm", test_ldq_f14_simm13}, {"18", "st", "reg", test_stq_f18_g0}, {"18", "ld", "reg", test_ldq_f18_g0}, {"18", "st", "imm", test_stq_f18_simm13}, {"18", "ld", "imm", test_ldq_f18_simm13}, {"22", "st", "reg", test_stq_f22_g0}, {"22", "ld", "reg", test_ldq_f22_g0}, {"22", "st", "imm", test_stq_f22_simm13}, {"22", "ld", "imm", test_ldq_f22_simm13}, {"26", "st", "reg", test_stq_f26_g0}, {"26", "ld", "reg", test_ldq_f26_g0}, {"26", "st", "imm", test_stq_f26_simm13}, {"26", "ld", "imm", test_ldq_f26_simm13}, {"30", "st", "reg", test_stq_f30_g0}, {"30", "ld", "reg", test_ldq_f30_g0}, {"30", "st", "imm", test_stq_f30_simm13}, {"30", "ld", "imm", test_ldq_f30_simm13}, {"34", "st", "reg", test_stq_f34_g0}, {"34", "ld", "reg", test_ldq_f34_g0}, {"34", "st", "imm", test_stq_f34_simm13}, {"34", "ld", "imm", test_ldq_f34_simm13}, {"38", "st", "reg", test_stq_f38_g0}, {"38", "ld", "reg", test_ldq_f38_g0}, {"38", "st", "imm", test_stq_f38_simm13}, {"38", "ld", "imm", test_ldq_f38_simm13}, {"42", "st", "reg", test_stq_f42_g0}, {"42", "ld", "reg", test_ldq_f42_g0}, {"42", "st", "imm", test_stq_f42_simm13}, {"42", "ld", "imm", test_ldq_f42_simm13}, {"46", "st", "reg", test_stq_f46_g0}, {"46", "ld", "reg", test_ldq_f46_g0}, {"46", "st", "imm", test_stq_f46_simm13}, {"46", "ld", "imm", test_ldq_f46_simm13}, {"50", "st", "reg", test_stq_f50_g0}, {"50", "ld", "reg", test_ldq_f50_g0}, {"50", "st", "imm", test_stq_f50_simm13}, {"50", "ld", "imm", test_ldq_f50_simm13}, {"54", "st", "reg", test_stq_f54_g0}, {"54", "ld", "reg", test_ldq_f54_g0}, {"54", "st", "imm", test_stq_f54_simm13}, {"54", "ld", "imm", test_ldq_f54_simm13}, {"58", "st", "reg", test_stq_f58_g0}, {"58", "ld", "reg", test_ldq_f58_g0}, {"58", "st", "imm", test_stq_f58_simm13}, {"58", "ld", "imm", test_ldq_f58_simm13}, {"62", "st", "reg", test_stq_f62_g0}, {"62", "ld", "reg", test_ldq_f62_g0}, {"62", "st", "imm", test_stq_f62_simm13}, {"62", "ld", "imm", test_ldq_f62_simm13}, }; #define NTESTS (sizeof(thetests)/sizeof(thetests[0])) void ill_catcher(int, siginfo_t *, void *); int main(int argc, char *argv[]) { struct fptest *fpt; struct fpquad fpq; struct sigaction sa; int i; if (argc != 4) { fprintf(stderr, "badreg regnum [ld|st] [reg|imm]\n"); return (1); } for (i = 0; i < NTESTS; i++) { fpt = thetests + i; if (strcmp(fpt->reg, argv[1]) == 0 && strcmp(fpt->ldst, argv[2]) == 0 && strcmp(fpt->dir, argv[3]) == 0) break; } if (i == NTESTS) errx(1, "unknown test: %s %s %s", argv[1], argv[2], argv[3]); sa.sa_sigaction = ill_catcher; sigemptyset(&sa.sa_mask); sa.sa_flags = SA_SIGINFO; if (sigaction(SIGILL, &sa, NULL) == -1) err(1, "sigaction"); (*fpt->func)(&fpq); err(1, "%s %s %s did not generate sigill", argv[1], argv[2], argv[3]); return (0); } void ill_catcher(int sig, siginfo_t *si, void *v) { _exit(0); }
the_stack_data/700812.c
/* * Copyright 2017, Intel Corporation * * 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 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 * OWNER 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. */ /* * plugin0.c - foo multiplies by 4, bar multiplies by 6 */ static int loaded; int foo(int a) { return loaded * a * 2; } int bar(int a) { return loaded * a * 3; } struct { int (*foo)(int a); int (*bar)(int a); } plugin0_funcs = { foo, bar }; void pmem_plugin_desc(const char **module_name, const char **name, unsigned *version, void **funcs) { *module_name = "dummy"; *name = "plugin0"; *version = 1; *funcs = &plugin0_funcs; } int pmem_plugin_load(void) { loaded = 2; return 0; } void pmem_plugin_unload(void) { loaded = 3; }
the_stack_data/168892217.c
#include<stdio.h> void Mover_discos(int d, char ori ,char dest , char aux){ if(d==1){ //cout<<"mover disco"<<d<<"de"<<ori<<"para"<<dest<<endl; printf("mover disco %d de %c para % c", d,ori, dest); }else{ Mover_discos(d-1, ori,aux ,dest); printf("mover disco %d de %c para % c \n", d,ori, dest); Mover_discos(d-1,aux ,dest ,ori); } } void main(){ int discos = 4; Mover_discos(discos,'a','b','c'); }
the_stack_data/42849.c
#include <stdio.h> #include <unistd.h> #include <dirent.h> #include <string.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> void edit(char*, char**); void checkPermission(char *); void undoSetUid(int); void printUid(void); void main(int argc, char* argv[]) { char root_dir[] = "/simple_slash/home/fakeroot"; int flagRoot = 0; int uid = getuid(); int euid = geteuid(); printf("Real UID: %d\n",uid); printf("Effective UID: %d\n",euid); if(uid == euid) { flagRoot = 1; } if(argc == 3 || argc == 4) { char file[100]; if(flagRoot == 1) { if(argc == 4) { strcpy(file,argv[3]); int len = strlen(file); if(file[len-1] == '/') { strcat(file,"permission.acl"); } else { strcat(file, "/permission.acl"); } edit(file, argv); } else { strcpy(file,root_dir); strcat(file,"/permission.acl"); edit(file,argv); } } else { if(argc == 4) { strcpy(file,argv[3]); int len= strlen(file); if(file[len-1] == '/') { strcat(file,"permission.acl"); } else { strcat(file, "/permission.acl"); } checkPermission(file); undoSetUid(uid); printUid(); edit(file,argv); } else { strcpy(file,root_dir); strcat(file,"/permission.acl"); checkPermission(file); undoSetUid(uid); printUid(); edit(file,argv); } } } else { printf("Wrong Command\n"); printf("Usage: ./chmod <access-code> <username> <path-to-directory/NULL>\n"); } } void undoSetUid(int uid) { int status; status = seteuid (uid); if (status < 0) { printf("Count't set the Effective UID\n"); exit(status); } } void printUid() { int uid = getuid(); int euid = geteuid(); printf("TEffective UID Changed: %d\n",euid); } void checkPermission(char* file) { FILE* fp; fp = fopen(file,"r"); if(fp == NULL) { printf("Cannot Open Permission File\n"); exit(1); } else { char *user=getenv("USER"); if(user == NULL) { printf("Error getting logged in User\n"); exit(1); } char temp[512]; int find_result = 0; while(fgets(temp, 512, fp) != NULL) { if((strstr(temp, user)) != NULL) { find_result++; break; } } if(find_result == 0) { printf("Access Denied, Permission Not Granted\n"); exit(1); } fclose(fp); } } void edit(char* file, char** argv) { int find_result = 0; char temp_fget[100] = ""; if((strcmp(argv[1],"0"))==0) { FILE* fptr; fptr = fopen(file,"a+"); if(fptr == NULL) { printf("cannot open permission file\n"); exit(1); } int line = 0; while(fgets(temp_fget, 20, fptr)!=NULL) { if((strstr(temp_fget, argv[2])) != NULL) { find_result++; break; } line++; } if(find_result > 0) { FILE *fp1, *fp2; int c; int del_line= ++line, temp = 1; fp1 = fopen(file, "r"); c = fgetc(fp1); while (c != -1 ) { c = fgetc(fp1); } rewind(fp1); fp2 = fopen("copy.c", "w"); c = getc(fp1); if(c == EOF) { printf("empty c\n"); exit(1); } rewind(fp1); while (c != EOF) { c = getc(fp1); if (c == '\n') temp++; if (temp != del_line) { putc(c, fp2); } } fclose(fp1); fclose(fp2); remove(file); rename("copy.c", file); FILE* fp3; fp3 = fopen(file,"a+"); fseeko(fp3,-1,SEEK_END); int position = ftello(fp3); ftruncate(fileno(fp3), position); fclose(fp3); printf("Access Removed\n"); } else { printf("User does not exists\n"); } fclose(fptr); } else if((strcmp(argv[1],"rwx"))==0) { FILE* fp; fp = fopen(file, "a+"); if(fp == NULL) { printf("Cannot open permission file\n"); exit(1); } while(fgets(temp_fget, 20, fp)!=NULL) { if((strstr(temp_fget, argv[2])) != NULL) { find_result++; break; } } if(find_result > 0) { printf("User already has Access\n"); exit(1); } else { fprintf(fp, "%s rwx\n", argv[2]); } fclose(fp); printf("Access Granted\n"); } else { printf("wrong command\n"); exit(1); } }
the_stack_data/123432.c
#include <string.h> char *strcat(char *dest, char const *src) { size_t i; size_t start; if (src == NULL || dest == NULL) return (0); i = -1; start = -1; while (dest[++start] != '\0'); while (src[++i] != '\0') dest[start + i] = src[i]; dest[i + start] = '\0'; return (dest); }
the_stack_data/192329512.c
/* This is a test program from Lee Kindness which used to fail on V because gcc implements the nested function mumbo jumbo using self modifying code on the stack, at least on x86 and amd64. It now works transparently because by default V now generates self-checking translations for translations taken from stack-like segments. */ #include <stdio.h> static void call_func(void (*sel)(void)) { sel(); } void test1() { void test1_inner() { printf( "Inside test1\n" ); } call_func( test1_inner ); } void test2() { void test2_inner() { printf( "Inside test2\n" ); } call_func( test2_inner ); } int main(int argc, char** argv) { test1(); test2(); return( 0 ); }
the_stack_data/104374.c
/* MiddleWorks Version 1.0 Licensed under the MIT license Created by matthewgallant on 11/3/16 (c) 2016 Matthew Gallant */ #include <unistd.h> #include <stdio.h> int main(int argc, char **argv) { char *pythonIntrepreter="python"; // resolved using your PATH environment variable char *calledPython="/Users/Example/MiddleWorks/Interpreter.py"; // explicit path necessary, not resolved using your PATH environment variable char *pythonArgs[]={pythonIntrepreter,calledPython,"/Users/Example/MiddleWorks/Demo.mw", NULL}; execvp(pythonIntrepreter,pythonArgs); // if we get here it misfired perror("Python execution"); }
the_stack_data/224899.c
// C program for linear search operation /* program flow -- -> Enter an array. -> Enter the integer to be searched. -> Start searching from 1st to last location in the array using for loop -> Save the location at which the element found first and break the loop. -> If any location is found then print it , if not then print the "not found" message. */ #include<stdio.h> #define MAX 20 int main() { int a[MAX],i,n,val,pos=-1; printf("Enter the no. of elements\n"); //Entering the array scanf("%d",&n); printf("Enter the elements \n"); for(i=0;i<=n-1;i++) { scanf("%d",&a[i]); } printf("Enter the integer to be searched\n"); // Entering the integer to be searched. scanf("%d",&val); for(i=0;i<=n-1;i++) //search elements in loop starting from 1st to last { if(a[i]==val) // checking the equality condition { pos=i+1; // save the location & break the loop on 1st match break; } } if(pos==-1) // checking if the position is found or not . { printf("Element does not found"); } else { printf("Element is found at %d position",pos); } return 0; } /* SAMPLE OUTPUT OF THE ABOVE PROGRAM -- Enter the no. of elements 6 Enter the elements 1 2 3 4 5 6 Enter the integer to be searched 4 Element is found at 4 position */
the_stack_data/231393164.c
int secret; int checkSecret(int _secret, int _guess, int _t) { int n = 20; int time = 0; if (_guess <= _secret) { if (_t == 1) { time += 1; } else if (_t == 2) { for (int i = 0; i < n; i++) { time += 1; } } else { for (int i = 0; i < n * n * n; i++) { time += 1; } } } else { if (_t == 1) { time += 1; } else if (_t == 2) { for (int i = 0; i < n * n; i++) { time += 1; } } else { for (int i = 0; i < n * n * n; i++) { time += 1; } } } return time; } #define SECRET_MAX 1000000 void attack() { int secretMin = 0; int nSecrets = SECRET_MAX; int steps = 0; __VERIFIER_assume(secret >= 0 && secret < SECRET_MAX); while(nSecrets >= 2) { __VERIFIER_assert(secret >= secretMin && secret < secretMin + nSecrets); // Line 23: Loop invariant part 2 __VERIFIER_assume(secret >= secretMin && secret < secretMin + nSecrets); nSecrets = (nSecrets + 1) / 2; int guess = secretMin + nSecrets; int time = checkSecret(secret, guess, 2); if (time < 210) { secretMin = guess; } else { } steps++; __VERIFIER_print_hull(steps); } __VERIFIER_assert(secret == secretMin); // Line 32: does the attack work? __VERIFIER_print_hull(steps); // Line 33: how long does the attack take? } int main(int argc, char ** argv) { int secret = __VERIFIER_nondet_int(); __VERIFIER_assume(secret >= 0 && secret < SECRET_MAX); attack(); return 0; }
the_stack_data/564296.c
#include <unistd.h> #include <stdlib.h> #include <fcntl.h> #include <stdio.h> static void unexpand(int fd) { int rCount; char buff; int blanks = 0; char prev; read(fd, &prev, 1); // and check it if(prev == ' '){ blanks++; } else{ write(STDOUT_FILENO, &prev, 1); } while(rCount = read(fd, &buff, 1) != 0){ if(buff == ' '){ blanks++; if(blanks == 8){ write(STDOUT_FILENO, "\t", 1); blanks = 0; } } else if(buff != ' ' && prev == ' ' && blanks > 0 && blanks < 8){ int i; for(i=0; i < blanks; i++){ write(STDOUT_FILENO, " ", 1); } write(STDOUT_FILENO, &buff, 1); } else { write(STDOUT_FILENO, &buff, 1); } } } int main(int argc, const char* const* argv){ if (argc < 1){ unexpand(STDIN_FILENO); } else{ int i; int fd; for(i = 1; i < argc; i++){ fd = open(argv[i], O_RDONLY); if(-1 == fd){ perror("open"); exit(EXIT_FAILURE); } unexpand(fd); } } exit(EXIT_SUCCESS); }
the_stack_data/6387552.c
/* minigzip.c -- simulate gzip using the zlib compression library * Copyright (C) 1995-2006, 2010 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ /* * minigzip is a minimal implementation of the gzip utility. This is * only an example of using zlib and isn't meant to replace the * full-featured gzip. No attempt is made to deal with file systems * limiting names to 14 or 8+3 characters, etc... Error checking is * very limited. So use minigzip only for testing; use gzip for the * real thing. On MSDOS, use only on file names without extension * or in pipe mode. */ /* @(#) $Id$ */ #include "zlib.h" #include <stdio.h> #ifdef STDC # include <string.h> # include <stdlib.h> #endif #ifdef USE_MMAP # include <sys/types.h> # include <sys/mman.h> # include <sys/stat.h> #endif #if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__) # include <fcntl.h> # include <io.h> # ifdef UNDER_CE # include <stdlib.h> # endif # define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY) #else # define SET_BINARY_MODE(file) #endif #ifdef VMS # define unlink delete # define GZ_SUFFIX "-gz" #endif #ifdef RISCOS # define unlink remove # define GZ_SUFFIX "-gz" # define fileno(file) file->__file #endif #if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os # include <unix.h> /* for fileno */ #endif #if !defined(Z_HAVE_UNISTD_H) && !defined(_LARGEFILE64_SOURCE) #ifndef WIN32 /* unlink already in stdio.h for WIN32 */ extern int unlink OF((const char *)); #endif #endif #if defined(UNDER_CE) # include <windows.h> # define perror(s) pwinerror(s) /* Map the Windows error number in ERROR to a locale-dependent error message string and return a pointer to it. Typically, the values for ERROR come from GetLastError. The string pointed to shall not be modified by the application, but may be overwritten by a subsequent call to strwinerror The strwinerror function does not change the current setting of GetLastError. */ static char *strwinerror (error) DWORD error; { static char buf[1024]; wchar_t *msgbuf; DWORD lasterr = GetLastError(); DWORD chars = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, error, 0, /* Default language */ (LPVOID)&msgbuf, 0, NULL); if (chars != 0) { /* If there is an \r\n appended, zap it. */ if (chars >= 2 && msgbuf[chars - 2] == '\r' && msgbuf[chars - 1] == '\n') { chars -= 2; msgbuf[chars] = 0; } if (chars > sizeof (buf) - 1) { chars = sizeof (buf) - 1; msgbuf[chars] = 0; } wcstombs(buf, msgbuf, chars + 1); LocalFree(msgbuf); } else { sprintf(buf, "unknown win32 error (%ld)", error); } SetLastError(lasterr); return buf; } static void pwinerror (s) const char *s; { if (s && *s) fprintf(stderr, "%s: %s\n", s, strwinerror(GetLastError ())); else fprintf(stderr, "%s\n", strwinerror(GetLastError ())); } #endif /* UNDER_CE */ #ifndef GZ_SUFFIX # define GZ_SUFFIX ".gz" #endif #define SUFFIX_LEN (sizeof(GZ_SUFFIX)-1) #define BUFLEN 16384 #define MAX_NAME_LEN 1024 #ifdef MAXSEG_64K # define local static /* Needed for systems with limitation on stack size. */ #else # define local #endif char *prog; void error OF((const char *msg)); void gz_compress OF((FILE *in, gzFile out)); #ifdef USE_MMAP int gz_compress_mmap OF((FILE *in, gzFile out)); #endif void gz_uncompress OF((gzFile in, FILE *out)); void file_compress OF((char *file, char *mode)); void file_uncompress OF((char *file)); int main OF((int argc, char *argv[])); /* =========================================================================== * Display error message and exit */ void error(msg) const char *msg; { fprintf(stderr, "%s: %s\n", prog, msg); exit(1); } /* =========================================================================== * Compress input to output then close both files. */ void gz_compress(in, out) FILE *in; gzFile out; { local char buf[BUFLEN]; int len; int err; #ifdef USE_MMAP /* Try first compressing with mmap. If mmap fails (minigzip used in a * pipe), use the normal fread loop. */ if (gz_compress_mmap(in, out) == Z_OK) return; #endif for (;;) { len = (int)fread(buf, 1, sizeof(buf), in); if (ferror(in)) { perror("fread"); exit(1); } if (len == 0) break; if (gzwrite(out, buf, (unsigned)len) != len) error(gzerror(out, &err)); } fclose(in); if (gzclose(out) != Z_OK) error("failed gzclose"); } #ifdef USE_MMAP /* MMAP version, Miguel Albrecht <[email protected]> */ /* Try compressing the input file at once using mmap. Return Z_OK if * if success, Z_ERRNO otherwise. */ int gz_compress_mmap(in, out) FILE *in; gzFile out; { int len; int err; int ifd = fileno(in); caddr_t buf; /* mmap'ed buffer for the entire input file */ off_t buf_len; /* length of the input file */ struct stat sb; /* Determine the size of the file, needed for mmap: */ if (fstat(ifd, &sb) < 0) return Z_ERRNO; buf_len = sb.st_size; if (buf_len <= 0) return Z_ERRNO; /* Now do the actual mmap: */ buf = mmap((caddr_t) 0, buf_len, PROT_READ, MAP_SHARED, ifd, (off_t)0); if (buf == (caddr_t)(-1)) return Z_ERRNO; /* Compress the whole file at once: */ len = gzwrite(out, (char *)buf, (unsigned)buf_len); if (len != (int)buf_len) error(gzerror(out, &err)); munmap(buf, buf_len); fclose(in); if (gzclose(out) != Z_OK) error("failed gzclose"); return Z_OK; } #endif /* USE_MMAP */ /* =========================================================================== * Uncompress input to output then close both files. */ void gz_uncompress(in, out) gzFile in; FILE *out; { local char buf[BUFLEN]; int len; int err; for (;;) { len = gzread(in, buf, sizeof(buf)); if (len < 0) error (gzerror(in, &err)); if (len == 0) break; if ((int)fwrite(buf, 1, (unsigned)len, out) != len) { error("failed fwrite"); } } if (fclose(out)) error("failed fclose"); if (gzclose(in) != Z_OK) error("failed gzclose"); } /* =========================================================================== * Compress the given file: create a corresponding .gz file and remove the * original. */ void file_compress(file, mode) char *file; char *mode; { local char outfile[MAX_NAME_LEN]; FILE *in; gzFile out; if (strlen(file) + strlen(GZ_SUFFIX) >= sizeof(outfile)) { fprintf(stderr, "%s: filename too long\n", prog); exit(1); } strcpy(outfile, file); strcat(outfile, GZ_SUFFIX); in = fopen(file, "rb"); if (in == NULL) { perror(file); exit(1); } out = gzopen(outfile, mode); if (out == NULL) { fprintf(stderr, "%s: can't gzopen %s\n", prog, outfile); exit(1); } gz_compress(in, out); unlink(file); } /* =========================================================================== * Uncompress the given file and remove the original. */ void file_uncompress(file) char *file; { local char buf[MAX_NAME_LEN]; char *infile, *outfile; FILE *out; gzFile in; size_t len = strlen(file); if (len + strlen(GZ_SUFFIX) >= sizeof(buf)) { fprintf(stderr, "%s: filename too long\n", prog); exit(1); } strcpy(buf, file); if (len > SUFFIX_LEN && strcmp(file+len-SUFFIX_LEN, GZ_SUFFIX) == 0) { infile = file; outfile = buf; outfile[len-3] = '\0'; } else { outfile = file; infile = buf; strcat(infile, GZ_SUFFIX); } in = gzopen(infile, "rb"); if (in == NULL) { fprintf(stderr, "%s: can't gzopen %s\n", prog, infile); exit(1); } out = fopen(outfile, "wb"); if (out == NULL) { perror(file); exit(1); } gz_uncompress(in, out); unlink(infile); } /* =========================================================================== * Usage: minigzip [-c] [-d] [-f] [-h] [-r] [-1 to -9] [files...] * -c : write to standard output * -d : decompress * -f : compress with Z_FILTERED * -h : compress with Z_HUFFMAN_ONLY * -r : compress with Z_RLE * -1 to -9 : compression level */ int main(argc, argv) int argc; char *argv[]; { int copyout = 0; int uncompr = 0; gzFile file; char *bname, outmode[20]; strcpy(outmode, "wb6 "); prog = argv[0]; bname = strrchr(argv[0], '/'); if (bname) bname++; else bname = argv[0]; argc--, argv++; if (!strcmp(bname, "gunzip")) uncompr = 1; else if (!strcmp(bname, "zcat")) copyout = uncompr = 1; while (argc > 0) { if (strcmp(*argv, "-c") == 0) copyout = 1; else if (strcmp(*argv, "-d") == 0) uncompr = 1; else if (strcmp(*argv, "-f") == 0) outmode[3] = 'f'; else if (strcmp(*argv, "-h") == 0) outmode[3] = 'h'; else if (strcmp(*argv, "-r") == 0) outmode[3] = 'R'; else if ((*argv)[0] == '-' && (*argv)[1] >= '1' && (*argv)[1] <= '9' && (*argv)[2] == 0) outmode[2] = (*argv)[1]; else break; argc--, argv++; } if (outmode[3] == ' ') outmode[3] = 0; if (argc == 0) { SET_BINARY_MODE(stdin); SET_BINARY_MODE(stdout); if (uncompr) { file = gzdopen(fileno(stdin), "rb"); if (file == NULL) error("can't gzdopen stdin"); gz_uncompress(file, stdout); } else { file = gzdopen(fileno(stdout), outmode); if (file == NULL) error("can't gzdopen stdout"); gz_compress(stdin, file); } } else { if (copyout) { SET_BINARY_MODE(stdout); } do { if (uncompr) { if (copyout) { file = gzopen(*argv, "rb"); if (file == NULL) fprintf(stderr, "%s: can't gzopen %s\n", prog, *argv); else gz_uncompress(file, stdout); } else { file_uncompress(*argv); } } else { if (copyout) { FILE * in = fopen(*argv, "rb"); if (in == NULL) { perror(*argv); } else { file = gzdopen(fileno(stdout), outmode); if (file == NULL) error("can't gzdopen stdout"); gz_compress(in, file); } } else { file_compress(*argv, outmode); } } } while (argv++, --argc); } return 0; }
the_stack_data/473027.c
/* Copyright 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. Contributed by Jan Kratochvil <[email protected]>. */ void libsym (void) { } #ifdef SYMB void libsymb (void) { } #endif
the_stack_data/13789.c
/*Exercise 4 - Functions Implement the three functions minimum(), maximum() and multiply() below the main() function. Do not change the code given in the main() function when you are implementing your solution.*/ #include <stdio.h> int minimum(int num1, int num2); int maximum(int num1, int num2); int multiply(int num1, int num2); int main() { int no1, no2; printf("Enter a value for no 1 : "); scanf("%d", &no1); printf("Enter a value for no 2 : "); scanf("%d", &no2); printf("%d ", minimum(no1, no2)); printf("%d ", maximum(no1, no2)); printf("%d ", multiply(no1, no2)); return 0; } int minimum(int num1, int num2) { int min; if(num1<num2) { min = num1; return min; } else{ min = num2; return min; } } int maximum(int num1, int num2) { int max; if(num1<num2) return num2; else return num1; } int multiply(int num1, int num2) { int answer; answer = num1 * num2; return answer; }
the_stack_data/87638722.c
// Semmle test case for rule ArithmeticTainted.ql (User-controlled data in arithmetic expression). // Associated with CWE-190: Integer Overflow or Wraparound. http://cwe.mitre.org/data/definitions/190.html int atoi(const char *nptr); void startServer(int heapSize); typedef unsigned long size_t; size_t strlen(const char *s); int main(int argc, char** argv) { int maxConnections = atoi(argv[1]); // BAD: arithmetic on a user input without any validation startServer(maxConnections * 1000); // GOOD: check the user input first int maxConnections2 = atoi(argv[1]); if (maxConnections2 < 100) { startServer(maxConnections2 * 1000); } // GOOD: arithmetic on the pointer itself is OK char *ptr = argv[1]; while (*ptr != 0) { ptr++; } { int len1; len1 = atoi(argv[1]); while (len1 > 0) { len1--; // GOOD: can't underflow } } { int len2; len2 = atoi(argv[1]); while (len2) { len2--; // BAD: can underflow, if len2 is initially negative. } } { int len3; len3 = atoi(argv[1]); while (len3 != 0) { len3--; // BAD: can underflow, if len3 is initially negative. } } { size_t len4; len4 = strlen(argv[1]); while (len4 > 0) { len4--; // GOOD: can't underflow } } { size_t len5; len5 = strlen(argv[1]); while (len5) { len5--; // GOOD: can't underflow } } { size_t len6; len6 = strlen(argv[1]); while (len6 != 0) { len6--; // GOOD: can't underflow } } { size_t len7; len7 = strlen(argv[1]); while ((len7) && (1)) { len7--; // GOOD: can't underflow } } return 0; }
the_stack_data/5802.c
gcd(a,b,c) { while((a%=b)&&(b%=a)); a+=b,b=c; while((a%=b)&&(b%=a)); return (a+b)*(a+b)*(a+b); } value(a,b,c,d) { if(a!=79 && a!=47 && a!=29 && a!=82 && a!=26 && a!=22) return -1; if(b<=0 || c<=0 || d<=0)return -2; if(a==79)return 30*b*c*d*gcd(b,c,d); if(a==47)return 10*b*c*d*gcd(b,c,d); if(a==29)return 4*b*c*d*gcd(b,c,d); if(a==82)return 5*b*c*d*gcd(b,c,d); if(a==26)return 3*b*c*d*gcd(b,c,d); if(a==22)return 9*b*c*d*gcd(b,c,d); }
the_stack_data/159515064.c
#include <stdio.h> int main(void) { printf("Type int has a size of %zd bytes.\n", sizeof(int)); printf("Type char has a size of %zd bytes.\n", sizeof(char)); printf("Type long has a size of %zd bytes.\n", sizeof(long)); printf("Type long long has a size of %zd bytes\n", sizeof(long long)); printf("Type long double has a size of %zd bytes.\n", sizeof(long double)); return 0; }
the_stack_data/275759.c
#include <stdio.h> int main() { float p0 = 1000, r1 = 0.0036, r2 = 0.0225, r3 = 0.0198, p1, p2, p3; p1 = p0 * (1 + r1); p2 = p0 * (1 + r2); p3 = p0 * (1 + r3 / 2) * (1 + r3 / 2); printf("p1=%f\np2=%f\np3=%f\n", p1, p2, p3); return 0; }
the_stack_data/35347.c
#include <stdio.h> #include <sched.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <stdlib.h> #include <assert.h> #include <string.h> #include <pthread.h> #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> #include <errno.h> // compile : gcc -O0 -Og -g -o mem mem.c -D_GNU_SOURCE -lpthread /** * Get CPU info from cat /proc/cpuinfo * cpu MHz : 2591.997 * cache size : 4096 KB * */ #define CPU_CYCLE_PER_SEC 2591997000 #define CACHE_SIZE 4096*1024 #define ITERS 10000 #define TEST_PORT 9689 static __inline__ u_int64_t rdtsc(void) { // Applicable to __x86_64__ or __amd64__ //u_int64_t low, high; //__asm__ volatile("rdtsc" : "=a"(low), "=d"(high)); //return (high << 32) | low; u_int64_t msr; asm volatile ( "rdtsc\n\t" // Returns the time in EDX:EAX. "shl $32, %%rdx\n\t" // Shift the upper bits left. "or %%rdx, %0" // 'Or' in the lower bits. : "=a" (msr) : : "rdx"); return msr; } int rdtsc_cycles(void) { double x = 0; int i; for (i = 0; i < ITERS; i++) { u_int64_t a = rdtsc(); u_int64_t b = rdtsc(); x += (double) (b-a); } return (int) (x/ITERS); } int cache_read_cycles(void) { double x = 0; int i; int arr_zero; for (i = 0; i < ITERS; i++) { int *arr = (int *)malloc(CACHE_SIZE * sizeof(char)); __builtin_prefetch(arr + CACHE_SIZE); u_int64_t a = rdtsc(); asm volatile ("mov %1, %0" : "=r" (arr_zero) : "r" (arr[0])); u_int64_t b = rdtsc(); x += (double) (b-a); free(arr); } return (int) (x/ITERS); } int mem_read_cycles(void) { double x = 0; int i; for (int i = 0; i < ITERS/100; i++) { int *arr1 = (int *)malloc(CACHE_SIZE * sizeof(char)); int *arr2 = (int *)malloc(CACHE_SIZE * sizeof(char)); int arr2_zero = arr2[0]; __builtin_prefetch(arr2 + CACHE_SIZE); u_int64_t a = rdtsc(); int arr1_zero ;//= arr1[0]; __asm__ volatile ("mov %1, %0" : "=r" (arr1_zero) : "r" (arr1[0])); u_int64_t b = rdtsc(); x += (double) (b-a); free(arr1); free(arr2); } return (int) (x/(ITERS/100)); } int predicate_guess(int predicate) { if (predicate) { return 0; } else { return 1; } } int branch_pred_diff(void) { int i; int predicate = 1; double x1 = 0; for (i = 0; i < ITERS; i++) { predicate = predicate_guess(predicate); u_int64_t a = rdtsc(); if (__builtin_expect(predicate, 1)) { int *arr = (int *) malloc(CACHE_SIZE * sizeof(int)); int arr_zero = arr[0]; free(arr); } else { int *arr = (int *) malloc(CACHE_SIZE * sizeof(int)); int arr_zero = arr[0]; free(arr); } u_int64_t b = rdtsc(); x1 += b - a; } double x2 = 0; predicate = 1; for (i = 0; i < ITERS; i++) { u_int64_t a = rdtsc(); if (__builtin_expect(predicate, 1)) { int *arr = (int *) malloc(CACHE_SIZE * sizeof(int)); int arr_zero = arr[0]; free(arr); } else { int *arr = (int *) malloc(CACHE_SIZE * sizeof(int)); int arr_zero = arr[0]; free(arr); } u_int64_t b = rdtsc(); x2 += b - a; } return (int)(x1/ITERS) - (int)(x2/ITERS); } int mem_seq_read_cycles(void) { double x = 0; int i; int arr1_zero; char *dest = (char *)malloc(CACHE_SIZE * sizeof(int)); for (i = 0 ; i < ITERS/100; i++) { char *arr1 = (char *)malloc(CACHE_SIZE * sizeof(int)); int *arr2 = (int *)malloc(CACHE_SIZE * sizeof(char)); __builtin_prefetch(arr2 + CACHE_SIZE); /* int c; for (c = 0; c < CACHE_SIZE; c++) { u_int64_t a = rdtsc(); __asm__ volatile ("mov %1, %0" : "=r" (arr1_zero) : "r" (arr1[c])); u_int64_t b = rdtsc(); x += (double) (b-a); } */ u_int64_t a = rdtsc(); memcpy(dest, arr1, (CACHE_SIZE * sizeof(int))); u_int64_t b = rdtsc(); x += (double) (b-a); free(arr1); free(arr2); } return (int) (x/(ITERS/100)); } int disk_read_cycles(void) { double x = 0; char *path = "tmp"; int i; char *buf = (char *) malloc(CACHE_SIZE * sizeof(int)); for (i = 0; i < ITERS/100; i++) { int fd = open(path, O_CREAT|O_RDWR, S_IRWXU); int bytes = write(fd, buf, CACHE_SIZE * sizeof(int)); assert(bytes == (CACHE_SIZE*sizeof(int))); close(fd); fd = open(path, O_RDONLY, S_IRUSR); u_int64_t a = rdtsc(); bytes = read(fd, buf, CACHE_SIZE*sizeof(int)); u_int64_t b = rdtsc(); close(fd); unlink(path); x += (double) (b-a); } return (int) (x/(ITERS/100)); } typedef struct netdata { int port; double cycles; } netdata_t; void * client(void *data) { netdata_t *nd = (netdata_t *)data; double *x = &nd->cycles; *x = 0; int sockfd, portno, n; struct sockaddr_in serv_addr; struct hostent *server; int bufsize = CACHE_SIZE*2; char *buffer = (char *)malloc(sizeof(char) * bufsize); portno = nd->port; sockfd = socket(AF_INET, SOCK_STREAM, 0); if (sockfd < 0) { printf("Error opening socket\n"); goto error; } server = gethostbyname("localhost"); if (server == NULL) { printf("ERROR, no such host\n"); goto error; } 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); printf("[client] trying to connect\n"); if (connect(sockfd,(struct sockaddr *)&serv_addr,sizeof(serv_addr)) < 0) { printf("ERROR connecting\n"); goto error; } printf("[client] connection established\n"); int i = 0; for (i = 0; i < bufsize; i++) { buffer[i] = 'a'; } printf("[client] writing data to server\n"); u_int64_t a = rdtsc(); n = write(sockfd,buffer,bufsize); if (n < 0) { printf("ERROR writing to socket\n"); goto error; } //printf("[client] wrote %d bytes, reading data from server\n", n); n = read(sockfd,buffer,bufsize); while (n < bufsize) { int n1 = 0; n1 = read(sockfd,buffer,bufsize-n); if (n1 == 0) break; n += n1; } if (n < 0) { printf("ERROR reading from socket\n"); goto error; } u_int64_t b = rdtsc(); *x = b-a; printf("[client] done : cycles : %f\n", *x); error: free(buffer); return NULL; } void * server(void *data) { netdata_t *nd = (netdata_t *)data; double *x = &nd->cycles; *x = 0; int sockfd, newsockfd, portno, clilen; int bufsize = CACHE_SIZE*2; char *buffer = (char *)malloc(sizeof(char) * bufsize); struct sockaddr_in serv_addr, cli_addr; int n; sockfd = socket(AF_INET, SOCK_STREAM, 0); if (sockfd < 0) { printf("ERROR opening socket\n"); goto error; } bzero((char *) &serv_addr, sizeof(serv_addr)); portno = nd->port; serv_addr.sin_family = AF_INET; serv_addr.sin_addr.s_addr = INADDR_ANY; serv_addr.sin_port = htons(portno); if (bind(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { printf("ERROR on binding\n"); goto error; } listen(sockfd,5); clilen = sizeof(cli_addr); // blocking call printf("[server] waiting for client\n"); newsockfd = accept(sockfd, (struct sockaddr *) &cli_addr, &clilen); if (newsockfd < 0) { printf("ERROR on accept\n"); goto error; } printf("[server] client connection established\n"); bzero(buffer, bufsize); printf("[server] reading data from client\n"); u_int64_t a = rdtsc(); n = 0; n = read(newsockfd,buffer, bufsize); while (n < bufsize) { int n1 = 0; n1 = read(newsockfd,buffer, bufsize-n); if (n1 == 0) break; n += n1; } if (n < bufsize) { printf("ERROR reading from socket\n"); goto error; } //printf("[server] read %d bytes, writing data to client\n", n); n = write(newsockfd,buffer,bufsize); if (n < 0) { printf("ERROR writing to socket\n"); goto error; } u_int64_t b = rdtsc(); *x = b-a; printf("[server] done : cycles : %f", *x); error: free(buffer); return NULL; } int loopback_read_cycles(int port) { double x = 0; pthread_t thread1, thread2; netdata_t *client_data = (netdata_t *) malloc(sizeof(struct netdata)); netdata_t *server_data = (netdata_t *) malloc(sizeof(struct netdata)); client_data->port = server_data->port = port; int iret1, iret2; /* Create independent threads each of which will execute function */ iret2 = pthread_create( &thread2, NULL, server, (void *) server_data); sleep(1); iret1 = pthread_create( &thread1, NULL, client, (void *) client_data); /* Wait till threads are complete before main continues. Unless we */ /* wait we run the risk of executing an exit which will terminate */ /* the process and all threads before the threads have completed. */ pthread_join( thread1, NULL); pthread_join( thread2, NULL); printf("Client returns: %d\n",iret1); printf("Server returns: %d\n",iret2); x = client_data->cycles + server_data->cycles; free(client_data); free(server_data); return (int) (x); } int main() { pid_t pid = getpid(); printf("Process id : %d\n", pid); cpu_set_t set; CPU_ZERO(&set); CPU_SET(0, &set); if (sched_setaffinity(0, sizeof(set), &set) == -1) { printf("Encountered error (sched_setaffinity)"); return -1; } struct sched_param p; if (sched_getparam(pid, &p) == -1) { printf("Encountered error (sched_getparam)"); return -1; } printf("Process priority : %d\n", p.sched_priority); struct timespec tp; if (sched_rr_get_interval(pid, &tp) == -1) { printf("Encountered error (sched_rr_get_interval)"); return -1; } printf("RR interval : %ld %ld\n", tp.tv_sec, tp.tv_nsec); printf("Latency number every programmer should know\n"); int off_cycles = rdtsc_cycles(); //printf("Cycles spent in calculation : %d\n", c_cycles); int c_cycles; c_cycles = cache_read_cycles(); printf("Cycles spent in cache read : %d\n", c_cycles-off_cycles); c_cycles = branch_pred_diff(); printf("Cycles spent in branch mis-pred 50%% : %d\n", c_cycles); c_cycles = mem_read_cycles(); printf("Cycles spent in mem read : %d\n", c_cycles-off_cycles); c_cycles = mem_seq_read_cycles(); printf("Cycles seq mem %ld bytes - memcpy : %d\n", (CACHE_SIZE * sizeof(int)), c_cycles-off_cycles); c_cycles = disk_read_cycles(); printf("Cycles disk %ld bytes - read : %d\n", (CACHE_SIZE* sizeof(int)), c_cycles-off_cycles); /* int i; for (i = 0; i < 10; i++) { c_cycles = loopback_read_cycles(TEST_PORT+i); } c_cycles = c_cycles / 10; printf("Cycles loopback read %d bytes - cycles : %d\n", (CACHE_SIZE*4), c_cycles-off_cycles); */ }
the_stack_data/1184727.c
/* From: https://wiki.openssl.org/index.php/Libcrypto_API */ #include <openssl/conf.h> #include <openssl/evp.h> #include <openssl/err.h> int main(int arc, char *argv[]) { /* Load the human readable error strings for libcrypto */ ERR_load_crypto_strings(); /* Load all digest and cipher algorithms */ OpenSSL_add_all_algorithms(); /* Load config file, and other important initialisation */ OPENSSL_config(NULL); printf("OpenSSL successfully initialized.\n"); /* Clean up */ /* Removes all digests and ciphers */ EVP_cleanup(); /* if you omit the next, a small leak may be left when you make use of the BIO (low level API) for e.g. base64 transformations */ CRYPTO_cleanup_all_ex_data(); /* Remove error strings */ ERR_free_strings(); return 0; }
the_stack_data/12401.c
/* * Exercise 2-5 * * Write the function any(s1, s2), which returns the first location in the * string s1 wher any character from the string s2 occurs, or -1 if s1 * contains no characters from s2. (The standard library function strpbrk * does the same job but returns a pointer to the locations.) */ #include <stdio.h> enum bool { NO, YES }; void test(char s1[], char s2[], int expected); int any(char s1[], char s2[]); int contains(char str[], char c); int main(void) { test("abcdefghij", "aeiou", 0); test("Abcdefghij", "aeiou", 4); test("", "aeiou", -1); test("Abcdefghij", "", -1); return 0; } void test(char s1[], char s2[], int expected) { int actual = any(s1, s2); if (actual == expected) { printf("ok: \"%s\", \"%s\" -> \"%d\"\n", s1, s2, actual); } else { printf("FAIL: \"%s\", \"%s\" -> %d (expected \"%d\")\n", s1, s2, actual, expected); } } int any(char s1[], char s2[]) { int i, j; for (i = j = 0; s1[i] != '\0'; i++) if (contains(s2, s1[i])) return i; return -1; } int contains(char str[], char c) { int i = 0; while (str[i] != '\0') if (c == str[i++]) return YES; return NO; }
the_stack_data/72012956.c
/* Nom : Germain Prenom : Gauthier https://github.com/ax-IO L1-MP 2017-2018 TP5 : Les Tableaux Partie 1/2 : Tableau a une dimension */ //////////////////////////////////////// //////////////// HEADER //////////////// //////////////////////////////////////// #include<stdio.h> #include<stdlib.h> #include<math.h> //#include<string.h> #define MAXI 150 #define NB_ETU 5 //////DECLARATION DE FONCTIONS//////////// void afficherNotes (float TAB[]); float minimumNote (float TAB[]); float maximumNote (float TAB[]); float calculeMoyenne (float TAB[]); float calculeVariance (float TAB[]); float calculeEcartType (float TAB[]); int rechercherValeur (float TAB[], float val); ////////////////////////////////////////// ////////////////// MAIN ////////////////// ////////////////////////////////////////// int main (void){ printf(" TP 05-a : Tableau a une dimension\n"); // Declaration + Def. Tableau test float tab[NB_ETU] = {12.0, 13.5, 8.5, 14.7, 6.0}; printf("Partie Obligatoire : \n\n"); //1. afficherNotes(tab); //2. printf("\nLa note la plus basse est %0.2f\n", minimumNote(tab)); //3. printf("La note la plus haute est %0.2f\n", maximumNote(tab)); //4. printf("\nLa Moyenne est : %0.3f\n", calculeMoyenne(tab)); //5. printf("La Variance est : %0.3f\n", calculeVariance(tab)); //6. printf("L'Ecart-Type est : %0.3f\n", calculeEcartType(tab)); //7. float f; printf("\nValeur a rechercher ? "); scanf("%f", &f); (rechercherValeur(tab, f) == -1 )? printf("La valeur %0.2f n'a pas ete trouvee \n", f):printf("La Valeur %0.2f a ete trouve en position %d\n", f, rechercherValeur(tab, f)); printf("\nPartie Optionnelle : \nA faire...\n\nFin Exercice\n"); return 0; } /////////////////////////////////////// /////////// DEFINITION //////////////// /////////////// DES /////////////////// //////////// FONCTIONS //////////////// /////////////////////////////////////// /* 1. */ void afficherNotes (float TAB[]){ for (int i = 0; i < NB_ETU; i++){ printf("Note numero %d sur %d : \t %0.2f\n", i+1, NB_ETU, TAB[i]); } } ////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// /* 2. */ float minimumNote (float TAB[]){ float min = 20; for (int i = 0; i < NB_ETU; i++){ if (TAB[i] < min){min = TAB[i];} } return min; } ////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// /* 3. */ float maximumNote (float TAB[]){ float max = 0; for (int i = 0; i < NB_ETU; i++){ if (TAB[i] > max){max = TAB[i];} } return max; } ////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// /* 4. */ float calculeMoyenne (float TAB[]){ float moyenne = 0.0; for (int i = 0; i < NB_ETU; i++){ moyenne += TAB[i]; } return moyenne/NB_ETU; } ////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// /* 5. */ float calculeVariance (float TAB[]){ float variance = 0; for (int i = 0; i < NB_ETU; i++){ variance += pow(TAB[i] - calculeMoyenne(TAB), 2); } return variance/NB_ETU; } ////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// /* 6. */ float calculeEcartType (float TAB[]){ return sqrt(calculeVariance(TAB)); } ////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// /* 7. */ int rechercherValeur (float TAB[], float val){ int pos; for (int i = 0; i< NB_ETU; i++){ if (TAB[i] == val){return i+1;} } //Si non trouve return -1; } ////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////
the_stack_data/140766145.c
// Processus ecrivain dans le tube nommé /* ecrivain_tube_nomme.c */ #include <stdio.h> #include <string.h> #include <fcntl.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> int main(){ mode_t mode; int tube; char chaine[]="Bonjour passe dans le tube"; mode = S_IRUSR | S_IWUSR; // Création du tube nommé mkfifo("fichier_du_tube", mode); // Ouverture du tube tube = open("fichier_du_tube", O_WRONLY); // Ecritude dans le tube write(tube, chaine, strlen(chaine)); // Fermeture du tube close(tube); }
the_stack_data/211079446.c
/* * author: Mahmud Ahsan * https://github.com/mahmudahsan * blog: http://thinkdiff.net * http://banglaprogramming.com * License: MIT License */ /* * While loop * while (condition){ * statement * } */ #include <stdio.h> int main(){ int i = 1; while (i <= 10) { printf("%d\n", i); ++i; } return 0; }
the_stack_data/243893162.c
char clang___clang_cuda_intrinsics_buf [] = { 47,42,61,61,61,45,45,45,32,95,95,99,108,97,110,103, 95,99,117,100,97,95,105,110,116,114,105,110,115,105,99,115, 46,104,32,45,32,68,101,118,105,99,101,45,115,105,100,101, 32,67,85,68,65,32,105,110,116,114,105,110,115,105,99,32, 119,114,97,112,112,101,114,115,32,45,45,45,61,61,61,10, 32,42,10,32,42,32,80,101,114,109,105,115,115,105,111,110, 32,105,115,32,104,101,114,101,98,121,32,103,114,97,110,116, 101,100,44,32,102,114,101,101,32,111,102,32,99,104,97,114, 103,101,44,32,116,111,32,97,110,121,32,112,101,114,115,111, 110,32,111,98,116,97,105,110,105,110,103,32,97,32,99,111, 112,121,10,32,42,32,111,102,32,116,104,105,115,32,115,111, 102,116,119,97,114,101,32,97,110,100,32,97,115,115,111,99, 105,97,116,101,100,32,100,111,99,117,109,101,110,116,97,116, 105,111,110,32,102,105,108,101,115,32,40,116,104,101,32,34, 83,111,102,116,119,97,114,101,34,41,44,32,116,111,32,100, 101,97,108,10,32,42,32,105,110,32,116,104,101,32,83,111, 102,116,119,97,114,101,32,119,105,116,104,111,117,116,32,114, 101,115,116,114,105,99,116,105,111,110,44,32,105,110,99,108, 117,100,105,110,103,32,119,105,116,104,111,117,116,32,108,105, 109,105,116,97,116,105,111,110,32,116,104,101,32,114,105,103, 104,116,115,10,32,42,32,116,111,32,117,115,101,44,32,99, 111,112,121,44,32,109,111,100,105,102,121,44,32,109,101,114, 103,101,44,32,112,117,98,108,105,115,104,44,32,100,105,115, 116,114,105,98,117,116,101,44,32,115,117,98,108,105,99,101, 110,115,101,44,32,97,110,100,47,111,114,32,115,101,108,108, 10,32,42,32,99,111,112,105,101,115,32,111,102,32,116,104, 101,32,83,111,102,116,119,97,114,101,44,32,97,110,100,32, 116,111,32,112,101,114,109,105,116,32,112,101,114,115,111,110, 115,32,116,111,32,119,104,111,109,32,116,104,101,32,83,111, 102,116,119,97,114,101,32,105,115,10,32,42,32,102,117,114, 110,105,115,104,101,100,32,116,111,32,100,111,32,115,111,44, 32,115,117,98,106,101,99,116,32,116,111,32,116,104,101,32, 102,111,108,108,111,119,105,110,103,32,99,111,110,100,105,116, 105,111,110,115,58,10,32,42,10,32,42,32,84,104,101,32, 97,98,111,118,101,32,99,111,112,121,114,105,103,104,116,32, 110,111,116,105,99,101,32,97,110,100,32,116,104,105,115,32, 112,101,114,109,105,115,115,105,111,110,32,110,111,116,105,99, 101,32,115,104,97,108,108,32,98,101,32,105,110,99,108,117, 100,101,100,32,105,110,10,32,42,32,97,108,108,32,99,111, 112,105,101,115,32,111,114,32,115,117,98,115,116,97,110,116, 105,97,108,32,112,111,114,116,105,111,110,115,32,111,102,32, 116,104,101,32,83,111,102,116,119,97,114,101,46,10,32,42, 10,32,42,32,84,72,69,32,83,79,70,84,87,65,82,69, 32,73,83,32,80,82,79,86,73,68,69,68,32,34,65,83, 32,73,83,34,44,32,87,73,84,72,79,85,84,32,87,65, 82,82,65,78,84,89,32,79,70,32,65,78,89,32,75,73, 78,68,44,32,69,88,80,82,69,83,83,32,79,82,10,32, 42,32,73,77,80,76,73,69,68,44,32,73,78,67,76,85, 68,73,78,71,32,66,85,84,32,78,79,84,32,76,73,77, 73,84,69,68,32,84,79,32,84,72,69,32,87,65,82,82, 65,78,84,73,69,83,32,79,70,32,77,69,82,67,72,65, 78,84,65,66,73,76,73,84,89,44,10,32,42,32,70,73, 84,78,69,83,83,32,70,79,82,32,65,32,80,65,82,84, 73,67,85,76,65,82,32,80,85,82,80,79,83,69,32,65, 78,68,32,78,79,78,73,78,70,82,73,78,71,69,77,69, 78,84,46,32,73,78,32,78,79,32,69,86,69,78,84,32, 83,72,65,76,76,32,84,72,69,10,32,42,32,65,85,84, 72,79,82,83,32,79,82,32,67,79,80,89,82,73,71,72, 84,32,72,79,76,68,69,82,83,32,66,69,32,76,73,65, 66,76,69,32,70,79,82,32,65,78,89,32,67,76,65,73, 77,44,32,68,65,77,65,71,69,83,32,79,82,32,79,84, 72,69,82,10,32,42,32,76,73,65,66,73,76,73,84,89, 44,32,87,72,69,84,72,69,82,32,73,78,32,65,78,32, 65,67,84,73,79,78,32,79,70,32,67,79,78,84,82,65, 67,84,44,32,84,79,82,84,32,79,82,32,79,84,72,69, 82,87,73,83,69,44,32,65,82,73,83,73,78,71,32,70, 82,79,77,44,10,32,42,32,79,85,84,32,79,70,32,79, 82,32,73,78,32,67,79,78,78,69,67,84,73,79,78,32, 87,73,84,72,32,84,72,69,32,83,79,70,84,87,65,82, 69,32,79,82,32,84,72,69,32,85,83,69,32,79,82,32, 79,84,72,69,82,32,68,69,65,76,73,78,71,83,32,73, 78,10,32,42,32,84,72,69,32,83,79,70,84,87,65,82, 69,46,10,32,42,10,32,42,61,61,61,45,45,45,45,45, 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, 45,45,61,61,61,10,32,42,47,10,35,105,102,110,100,101, 102,32,95,95,67,76,65,78,71,95,67,85,68,65,95,73, 78,84,82,73,78,83,73,67,83,95,72,95,95,10,35,100, 101,102,105,110,101,32,95,95,67,76,65,78,71,95,67,85, 68,65,95,73,78,84,82,73,78,83,73,67,83,95,72,95, 95,10,35,105,102,110,100,101,102,32,95,95,67,85,68,65, 95,95,10,35,101,114,114,111,114,32,34,84,104,105,115,32, 102,105,108,101,32,105,115,32,102,111,114,32,67,85,68,65, 32,99,111,109,112,105,108,97,116,105,111,110,32,111,110,108, 121,46,34,10,35,101,110,100,105,102,10,10,47,47,32,115, 109,95,51,48,32,105,110,116,114,105,110,115,105,99,115,58, 32,95,95,115,104,102,108,95,123,117,112,44,100,111,119,110, 44,120,111,114,125,46,10,10,35,100,101,102,105,110,101,32, 95,95,83,77,95,51,48,95,73,78,84,82,73,78,83,73, 67,83,95,72,95,95,10,35,100,101,102,105,110,101,32,95, 95,83,77,95,51,48,95,73,78,84,82,73,78,83,73,67, 83,95,72,80,80,95,95,10,10,35,105,102,32,33,100,101, 102,105,110,101,100,40,95,95,67,85,68,65,95,65,82,67, 72,95,95,41,32,124,124,32,95,95,67,85,68,65,95,65, 82,67,72,95,95,32,62,61,32,51,48,48,10,10,35,112, 114,97,103,109,97,32,112,117,115,104,95,109,97,99,114,111, 40,34,95,95,77,65,75,69,95,83,72,85,70,70,76,69, 83,34,41,10,35,100,101,102,105,110,101,32,95,95,77,65, 75,69,95,83,72,85,70,70,76,69,83,40,95,95,70,110, 78,97,109,101,44,32,95,95,73,110,116,73,110,116,114,105, 110,115,105,99,44,32,95,95,70,108,111,97,116,73,110,116, 114,105,110,115,105,99,44,32,95,95,77,97,115,107,41,32, 32,32,32,92,10,32,32,105,110,108,105,110,101,32,95,95, 100,101,118,105,99,101,95,95,32,105,110,116,32,95,95,70, 110,78,97,109,101,40,105,110,116,32,95,95,118,97,108,44, 32,105,110,116,32,95,95,111,102,102,115,101,116,44,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,92,10,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,105,110,116,32,95,95,119,105,100, 116,104,32,61,32,119,97,114,112,83,105,122,101,41,32,123, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,92,10,32,32,32,32,114,101,116,117,114, 110,32,95,95,73,110,116,73,110,116,114,105,110,115,105,99, 40,95,95,118,97,108,44,32,95,95,111,102,102,115,101,116, 44,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,92,10,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,40,40,119,97,114,112,83,105,122,101,32,45,32,95, 95,119,105,100,116,104,41,32,60,60,32,56,41,32,124,32, 40,95,95,77,97,115,107,41,41,59,32,32,32,32,32,32, 32,32,32,32,32,32,32,92,10,32,32,125,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,92,10,32,32,105,110,108,105, 110,101,32,95,95,100,101,118,105,99,101,95,95,32,102,108, 111,97,116,32,95,95,70,110,78,97,109,101,40,102,108,111, 97,116,32,95,95,118,97,108,44,32,105,110,116,32,95,95, 111,102,102,115,101,116,44,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,92,10,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,105,110, 116,32,95,95,119,105,100,116,104,32,61,32,119,97,114,112, 83,105,122,101,41,32,123,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,92,10,32,32,32,32, 114,101,116,117,114,110,32,95,95,70,108,111,97,116,73,110, 116,114,105,110,115,105,99,40,95,95,118,97,108,44,32,95, 95,111,102,102,115,101,116,44,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,92,10,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,40,40,119,97,114,112,83, 105,122,101,32,45,32,95,95,119,105,100,116,104,41,32,60, 60,32,56,41,32,124,32,40,95,95,77,97,115,107,41,41, 59,32,32,32,32,32,32,32,32,32,32,32,92,10,32,32, 125,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,92,10,32, 32,105,110,108,105,110,101,32,95,95,100,101,118,105,99,101, 95,95,32,117,110,115,105,103,110,101,100,32,105,110,116,32, 95,95,70,110,78,97,109,101,40,117,110,115,105,103,110,101, 100,32,105,110,116,32,95,95,118,97,108,44,32,105,110,116, 32,95,95,111,102,102,115,101,116,44,32,32,32,32,92,10, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,105,110,116,32,95,95, 119,105,100,116,104,32,61,32,119,97,114,112,83,105,122,101, 41,32,123,32,32,32,32,32,32,32,32,32,32,32,32,92, 10,32,32,32,32,114,101,116,117,114,110,32,115,116,97,116, 105,99,95,99,97,115,116,60,117,110,115,105,103,110,101,100, 32,105,110,116,62,40,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 92,10,32,32,32,32,32,32,32,32,58,58,95,95,70,110, 78,97,109,101,40,115,116,97,116,105,99,95,99,97,115,116, 60,105,110,116,62,40,95,95,118,97,108,41,44,32,95,95, 111,102,102,115,101,116,44,32,95,95,119,105,100,116,104,41, 41,59,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,92,10,32,32,125,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,92,10,32,32,105,110,108,105,110,101,32,95,95,100, 101,118,105,99,101,95,95,32,108,111,110,103,32,108,111,110, 103,32,95,95,70,110,78,97,109,101,40,108,111,110,103,32, 108,111,110,103,32,95,95,118,97,108,44,32,105,110,116,32, 95,95,111,102,102,115,101,116,44,32,32,32,32,32,32,32, 32,32,32,92,10,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,105,110,116,32, 95,95,119,105,100,116,104,32,61,32,119,97,114,112,83,105, 122,101,41,32,123,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,92,10,32,32,32,32,115,116,114,117,99,116, 32,95,95,66,105,116,115,32,123,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,92,10,32,32,32,32,32,32,105,110,116, 32,95,95,97,44,32,95,95,98,59,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,92,10,32,32,32,32,125,59,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,92,10,32,32,32,32,95,83,116, 97,116,105,99,95,97,115,115,101,114,116,40,115,105,122,101, 111,102,40,95,95,118,97,108,41,32,61,61,32,115,105,122, 101,111,102,40,95,95,66,105,116,115,41,41,59,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,92,10,32,32,32,32,95,83, 116,97,116,105,99,95,97,115,115,101,114,116,40,115,105,122, 101,111,102,40,95,95,66,105,116,115,41,32,61,61,32,50, 32,42,32,115,105,122,101,111,102,40,105,110,116,41,41,59, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,92,10,32,32,32,32,95, 95,66,105,116,115,32,95,95,116,109,112,59,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,92,10,32,32,32,32, 109,101,109,99,112,121,40,38,95,95,118,97,108,44,32,38, 95,95,116,109,112,44,32,115,105,122,101,111,102,40,95,95, 118,97,108,41,41,59,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,92,10,32,32,32, 32,95,95,116,109,112,46,95,95,97,32,61,32,58,58,95, 95,70,110,78,97,109,101,40,95,95,116,109,112,46,95,95, 97,44,32,95,95,111,102,102,115,101,116,44,32,95,95,119, 105,100,116,104,41,59,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,92,10,32,32, 32,32,95,95,116,109,112,46,95,95,98,32,61,32,58,58, 95,95,70,110,78,97,109,101,40,95,95,116,109,112,46,95, 95,98,44,32,95,95,111,102,102,115,101,116,44,32,95,95, 119,105,100,116,104,41,59,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,92,10,32, 32,32,32,108,111,110,103,32,108,111,110,103,32,95,95,114, 101,116,59,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,92,10, 32,32,32,32,109,101,109,99,112,121,40,38,95,95,114,101, 116,44,32,38,95,95,116,109,112,44,32,115,105,122,101,111, 102,40,95,95,116,109,112,41,41,59,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,92, 10,32,32,32,32,114,101,116,117,114,110,32,95,95,114,101, 116,59,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 92,10,32,32,125,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,92,10,32,32,105,110,108,105,110,101,32,95,95,100,101, 118,105,99,101,95,95,32,117,110,115,105,103,110,101,100,32, 108,111,110,103,32,108,111,110,103,32,95,95,70,110,78,97, 109,101,40,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,92,10,32,32,32,32,32,32,117,110,115,105,103,110, 101,100,32,108,111,110,103,32,108,111,110,103,32,95,95,118, 97,108,44,32,105,110,116,32,95,95,111,102,102,115,101,116, 44,32,105,110,116,32,95,95,119,105,100,116,104,32,61,32, 119,97,114,112,83,105,122,101,41,32,123,32,32,32,32,32, 32,32,32,92,10,32,32,32,32,114,101,116,117,114,110,32, 115,116,97,116,105,99,95,99,97,115,116,60,117,110,115,105, 103,110,101,100,32,108,111,110,103,32,108,111,110,103,62,40, 58,58,95,95,70,110,78,97,109,101,40,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,92,10,32,32,32,32,32,32,32,32,115,116, 97,116,105,99,95,99,97,115,116,60,117,110,115,105,103,110, 101,100,32,108,111,110,103,32,108,111,110,103,62,40,95,95, 118,97,108,41,44,32,95,95,111,102,102,115,101,116,44,32, 95,95,119,105,100,116,104,41,41,59,32,32,32,32,32,32, 32,32,32,32,32,92,10,32,32,125,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,92,10,32,32,105,110,108,105,110,101, 32,95,95,100,101,118,105,99,101,95,95,32,100,111,117,98, 108,101,32,95,95,70,110,78,97,109,101,40,100,111,117,98, 108,101,32,95,95,118,97,108,44,32,105,110,116,32,95,95, 111,102,102,115,101,116,44,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,92,10,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,105,110,116, 32,95,95,119,105,100,116,104,32,61,32,119,97,114,112,83, 105,122,101,41,32,123,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,92,10,32,32,32,32,108,111, 110,103,32,108,111,110,103,32,95,95,116,109,112,59,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,92,10,32,32,32,32,95, 83,116,97,116,105,99,95,97,115,115,101,114,116,40,115,105, 122,101,111,102,40,95,95,116,109,112,41,32,61,61,32,115, 105,122,101,111,102,40,95,95,118,97,108,41,41,59,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,92,10,32,32,32,32, 109,101,109,99,112,121,40,38,95,95,116,109,112,44,32,38, 95,95,118,97,108,44,32,115,105,122,101,111,102,40,95,95, 118,97,108,41,41,59,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,92,10,32,32,32, 32,95,95,116,109,112,32,61,32,58,58,95,95,70,110,78, 97,109,101,40,95,95,116,109,112,44,32,95,95,111,102,102, 115,101,116,44,32,95,95,119,105,100,116,104,41,59,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,92,10,32,32, 32,32,100,111,117,98,108,101,32,95,95,114,101,116,59,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,92,10,32, 32,32,32,109,101,109,99,112,121,40,38,95,95,114,101,116, 44,32,38,95,95,116,109,112,44,32,115,105,122,101,111,102, 40,95,95,114,101,116,41,41,59,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,92,10, 32,32,32,32,114,101,116,117,114,110,32,95,95,114,101,116, 59,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,92, 10,32,32,125,10,10,95,95,77,65,75,69,95,83,72,85, 70,70,76,69,83,40,95,95,115,104,102,108,44,32,95,95, 110,118,118,109,95,115,104,102,108,95,105,100,120,95,105,51, 50,44,32,95,95,110,118,118,109,95,115,104,102,108,95,105, 100,120,95,102,51,50,44,32,48,120,49,102,41,59,10,47, 47,32,87,101,32,117,115,101,32,48,32,114,97,116,104,101, 114,32,116,104,97,110,32,51,49,32,97,115,32,111,117,114, 32,109,97,115,107,44,32,98,101,99,97,117,115,101,32,115, 104,102,108,46,117,112,32,97,112,112,108,105,101,115,32,116, 111,32,108,97,110,101,115,32,62,61,10,47,47,32,109,97, 120,76,97,110,101,46,10,95,95,77,65,75,69,95,83,72, 85,70,70,76,69,83,40,95,95,115,104,102,108,95,117,112, 44,32,95,95,110,118,118,109,95,115,104,102,108,95,117,112, 95,105,51,50,44,32,95,95,110,118,118,109,95,115,104,102, 108,95,117,112,95,102,51,50,44,32,48,41,59,10,95,95, 77,65,75,69,95,83,72,85,70,70,76,69,83,40,95,95, 115,104,102,108,95,100,111,119,110,44,32,95,95,110,118,118, 109,95,115,104,102,108,95,100,111,119,110,95,105,51,50,44, 32,95,95,110,118,118,109,95,115,104,102,108,95,100,111,119, 110,95,102,51,50,44,32,48,120,49,102,41,59,10,95,95, 77,65,75,69,95,83,72,85,70,70,76,69,83,40,95,95, 115,104,102,108,95,120,111,114,44,32,95,95,110,118,118,109, 95,115,104,102,108,95,98,102,108,121,95,105,51,50,44,32, 95,95,110,118,118,109,95,115,104,102,108,95,98,102,108,121, 95,102,51,50,44,32,48,120,49,102,41,59,10,10,35,112, 114,97,103,109,97,32,112,111,112,95,109,97,99,114,111,40, 34,95,95,77,65,75,69,95,83,72,85,70,70,76,69,83, 34,41,10,10,35,101,110,100,105,102,32,47,47,32,33,100, 101,102,105,110,101,100,40,95,95,67,85,68,65,95,65,82, 67,72,95,95,41,32,124,124,32,95,95,67,85,68,65,95, 65,82,67,72,95,95,32,62,61,32,51,48,48,10,10,47, 47,32,115,109,95,51,50,32,105,110,116,114,105,110,115,105, 99,115,58,32,95,95,108,100,103,32,97,110,100,32,95,95, 102,117,110,110,101,108,115,104,105,102,116,95,123,108,44,108, 99,44,114,44,114,99,125,46,10,10,47,47,32,80,114,101, 118,101,110,116,32,116,104,101,32,118,97,110,105,108,108,97, 32,115,109,95,51,50,32,105,110,116,114,105,110,115,105,99, 115,32,104,101,97,100,101,114,32,102,114,111,109,32,98,101, 105,110,103,32,105,110,99,108,117,100,101,100,46,10,35,100, 101,102,105,110,101,32,95,95,83,77,95,51,50,95,73,78, 84,82,73,78,83,73,67,83,95,72,95,95,10,35,100,101, 102,105,110,101,32,95,95,83,77,95,51,50,95,73,78,84, 82,73,78,83,73,67,83,95,72,80,80,95,95,10,10,35, 105,102,32,33,100,101,102,105,110,101,100,40,95,95,67,85, 68,65,95,65,82,67,72,95,95,41,32,124,124,32,95,95, 67,85,68,65,95,65,82,67,72,95,95,32,62,61,32,51, 50,48,10,10,105,110,108,105,110,101,32,95,95,100,101,118, 105,99,101,95,95,32,99,104,97,114,32,95,95,108,100,103, 40,99,111,110,115,116,32,99,104,97,114,32,42,112,116,114, 41,32,123,32,114,101,116,117,114,110,32,95,95,110,118,118, 109,95,108,100,103,95,99,40,112,116,114,41,59,32,125,10, 105,110,108,105,110,101,32,95,95,100,101,118,105,99,101,95, 95,32,115,104,111,114,116,32,95,95,108,100,103,40,99,111, 110,115,116,32,115,104,111,114,116,32,42,112,116,114,41,32, 123,32,114,101,116,117,114,110,32,95,95,110,118,118,109,95, 108,100,103,95,115,40,112,116,114,41,59,32,125,10,105,110, 108,105,110,101,32,95,95,100,101,118,105,99,101,95,95,32, 105,110,116,32,95,95,108,100,103,40,99,111,110,115,116,32, 105,110,116,32,42,112,116,114,41,32,123,32,114,101,116,117, 114,110,32,95,95,110,118,118,109,95,108,100,103,95,105,40, 112,116,114,41,59,32,125,10,105,110,108,105,110,101,32,95, 95,100,101,118,105,99,101,95,95,32,108,111,110,103,32,95, 95,108,100,103,40,99,111,110,115,116,32,108,111,110,103,32, 42,112,116,114,41,32,123,32,114,101,116,117,114,110,32,95, 95,110,118,118,109,95,108,100,103,95,108,40,112,116,114,41, 59,32,125,10,105,110,108,105,110,101,32,95,95,100,101,118, 105,99,101,95,95,32,108,111,110,103,32,108,111,110,103,32, 95,95,108,100,103,40,99,111,110,115,116,32,108,111,110,103, 32,108,111,110,103,32,42,112,116,114,41,32,123,10,32,32, 114,101,116,117,114,110,32,95,95,110,118,118,109,95,108,100, 103,95,108,108,40,112,116,114,41,59,10,125,10,105,110,108, 105,110,101,32,95,95,100,101,118,105,99,101,95,95,32,117, 110,115,105,103,110,101,100,32,99,104,97,114,32,95,95,108, 100,103,40,99,111,110,115,116,32,117,110,115,105,103,110,101, 100,32,99,104,97,114,32,42,112,116,114,41,32,123,10,32, 32,114,101,116,117,114,110,32,95,95,110,118,118,109,95,108, 100,103,95,117,99,40,112,116,114,41,59,10,125,10,105,110, 108,105,110,101,32,95,95,100,101,118,105,99,101,95,95,32, 117,110,115,105,103,110,101,100,32,115,104,111,114,116,32,95, 95,108,100,103,40,99,111,110,115,116,32,117,110,115,105,103, 110,101,100,32,115,104,111,114,116,32,42,112,116,114,41,32, 123,10,32,32,114,101,116,117,114,110,32,95,95,110,118,118, 109,95,108,100,103,95,117,115,40,112,116,114,41,59,10,125, 10,105,110,108,105,110,101,32,95,95,100,101,118,105,99,101, 95,95,32,117,110,115,105,103,110,101,100,32,105,110,116,32, 95,95,108,100,103,40,99,111,110,115,116,32,117,110,115,105, 103,110,101,100,32,105,110,116,32,42,112,116,114,41,32,123, 10,32,32,114,101,116,117,114,110,32,95,95,110,118,118,109, 95,108,100,103,95,117,105,40,112,116,114,41,59,10,125,10, 105,110,108,105,110,101,32,95,95,100,101,118,105,99,101,95, 95,32,117,110,115,105,103,110,101,100,32,108,111,110,103,32, 95,95,108,100,103,40,99,111,110,115,116,32,117,110,115,105, 103,110,101,100,32,108,111,110,103,32,42,112,116,114,41,32, 123,10,32,32,114,101,116,117,114,110,32,95,95,110,118,118, 109,95,108,100,103,95,117,108,40,112,116,114,41,59,10,125, 10,105,110,108,105,110,101,32,95,95,100,101,118,105,99,101, 95,95,32,117,110,115,105,103,110,101,100,32,108,111,110,103, 32,108,111,110,103,32,95,95,108,100,103,40,99,111,110,115, 116,32,117,110,115,105,103,110,101,100,32,108,111,110,103,32, 108,111,110,103,32,42,112,116,114,41,32,123,10,32,32,114, 101,116,117,114,110,32,95,95,110,118,118,109,95,108,100,103, 95,117,108,108,40,112,116,114,41,59,10,125,10,105,110,108, 105,110,101,32,95,95,100,101,118,105,99,101,95,95,32,102, 108,111,97,116,32,95,95,108,100,103,40,99,111,110,115,116, 32,102,108,111,97,116,32,42,112,116,114,41,32,123,32,114, 101,116,117,114,110,32,95,95,110,118,118,109,95,108,100,103, 95,102,40,112,116,114,41,59,32,125,10,105,110,108,105,110, 101,32,95,95,100,101,118,105,99,101,95,95,32,100,111,117, 98,108,101,32,95,95,108,100,103,40,99,111,110,115,116,32, 100,111,117,98,108,101,32,42,112,116,114,41,32,123,32,114, 101,116,117,114,110,32,95,95,110,118,118,109,95,108,100,103, 95,100,40,112,116,114,41,59,32,125,10,10,105,110,108,105, 110,101,32,95,95,100,101,118,105,99,101,95,95,32,99,104, 97,114,50,32,95,95,108,100,103,40,99,111,110,115,116,32, 99,104,97,114,50,32,42,112,116,114,41,32,123,10,32,32, 116,121,112,101,100,101,102,32,99,104,97,114,32,99,50,32, 95,95,97,116,116,114,105,98,117,116,101,95,95,40,40,101, 120,116,95,118,101,99,116,111,114,95,116,121,112,101,40,50, 41,41,41,59,10,32,32,47,47,32,87,101,32,99,97,110, 32,97,115,115,117,109,101,32,116,104,97,116,32,112,116,114, 32,105,115,32,97,108,105,103,110,101,100,32,97,116,32,108, 101,97,115,116,32,116,111,32,99,104,97,114,50,39,115,32, 97,108,105,103,110,109,101,110,116,44,32,98,117,116,32,116, 104,101,10,32,32,47,47,32,108,111,97,100,32,119,105,108, 108,32,97,115,115,117,109,101,32,116,104,97,116,32,112,116, 114,32,105,115,32,97,108,105,103,110,101,100,32,116,111,32, 99,104,97,114,50,39,115,32,97,108,105,103,110,109,101,110, 116,46,32,32,84,104,105,115,32,105,115,32,111,110,108,121, 10,32,32,47,47,32,115,97,102,101,32,105,102,32,97,108, 105,103,110,111,102,40,99,50,41,32,60,61,32,97,108,105, 103,110,111,102,40,99,104,97,114,50,41,46,10,32,32,99, 50,32,114,118,32,61,32,95,95,110,118,118,109,95,108,100, 103,95,99,50,40,114,101,105,110,116,101,114,112,114,101,116, 95,99,97,115,116,60,99,111,110,115,116,32,99,50,32,42, 62,40,112,116,114,41,41,59,10,32,32,99,104,97,114,50, 32,114,101,116,59,10,32,32,114,101,116,46,120,32,61,32, 114,118,91,48,93,59,10,32,32,114,101,116,46,121,32,61, 32,114,118,91,49,93,59,10,32,32,114,101,116,117,114,110, 32,114,101,116,59,10,125,10,105,110,108,105,110,101,32,95, 95,100,101,118,105,99,101,95,95,32,99,104,97,114,52,32, 95,95,108,100,103,40,99,111,110,115,116,32,99,104,97,114, 52,32,42,112,116,114,41,32,123,10,32,32,116,121,112,101, 100,101,102,32,99,104,97,114,32,99,52,32,95,95,97,116, 116,114,105,98,117,116,101,95,95,40,40,101,120,116,95,118, 101,99,116,111,114,95,116,121,112,101,40,52,41,41,41,59, 10,32,32,99,52,32,114,118,32,61,32,95,95,110,118,118, 109,95,108,100,103,95,99,52,40,114,101,105,110,116,101,114, 112,114,101,116,95,99,97,115,116,60,99,111,110,115,116,32, 99,52,32,42,62,40,112,116,114,41,41,59,10,32,32,99, 104,97,114,52,32,114,101,116,59,10,32,32,114,101,116,46, 120,32,61,32,114,118,91,48,93,59,10,32,32,114,101,116, 46,121,32,61,32,114,118,91,49,93,59,10,32,32,114,101, 116,46,122,32,61,32,114,118,91,50,93,59,10,32,32,114, 101,116,46,119,32,61,32,114,118,91,51,93,59,10,32,32, 114,101,116,117,114,110,32,114,101,116,59,10,125,10,105,110, 108,105,110,101,32,95,95,100,101,118,105,99,101,95,95,32, 115,104,111,114,116,50,32,95,95,108,100,103,40,99,111,110, 115,116,32,115,104,111,114,116,50,32,42,112,116,114,41,32, 123,10,32,32,116,121,112,101,100,101,102,32,115,104,111,114, 116,32,115,50,32,95,95,97,116,116,114,105,98,117,116,101, 95,95,40,40,101,120,116,95,118,101,99,116,111,114,95,116, 121,112,101,40,50,41,41,41,59,10,32,32,115,50,32,114, 118,32,61,32,95,95,110,118,118,109,95,108,100,103,95,115, 50,40,114,101,105,110,116,101,114,112,114,101,116,95,99,97, 115,116,60,99,111,110,115,116,32,115,50,32,42,62,40,112, 116,114,41,41,59,10,32,32,115,104,111,114,116,50,32,114, 101,116,59,10,32,32,114,101,116,46,120,32,61,32,114,118, 91,48,93,59,10,32,32,114,101,116,46,121,32,61,32,114, 118,91,49,93,59,10,32,32,114,101,116,117,114,110,32,114, 101,116,59,10,125,10,105,110,108,105,110,101,32,95,95,100, 101,118,105,99,101,95,95,32,115,104,111,114,116,52,32,95, 95,108,100,103,40,99,111,110,115,116,32,115,104,111,114,116, 52,32,42,112,116,114,41,32,123,10,32,32,116,121,112,101, 100,101,102,32,115,104,111,114,116,32,115,52,32,95,95,97, 116,116,114,105,98,117,116,101,95,95,40,40,101,120,116,95, 118,101,99,116,111,114,95,116,121,112,101,40,52,41,41,41, 59,10,32,32,115,52,32,114,118,32,61,32,95,95,110,118, 118,109,95,108,100,103,95,115,52,40,114,101,105,110,116,101, 114,112,114,101,116,95,99,97,115,116,60,99,111,110,115,116, 32,115,52,32,42,62,40,112,116,114,41,41,59,10,32,32, 115,104,111,114,116,52,32,114,101,116,59,10,32,32,114,101, 116,46,120,32,61,32,114,118,91,48,93,59,10,32,32,114, 101,116,46,121,32,61,32,114,118,91,49,93,59,10,32,32, 114,101,116,46,122,32,61,32,114,118,91,50,93,59,10,32, 32,114,101,116,46,119,32,61,32,114,118,91,51,93,59,10, 32,32,114,101,116,117,114,110,32,114,101,116,59,10,125,10, 105,110,108,105,110,101,32,95,95,100,101,118,105,99,101,95, 95,32,105,110,116,50,32,95,95,108,100,103,40,99,111,110, 115,116,32,105,110,116,50,32,42,112,116,114,41,32,123,10, 32,32,116,121,112,101,100,101,102,32,105,110,116,32,105,50, 32,95,95,97,116,116,114,105,98,117,116,101,95,95,40,40, 101,120,116,95,118,101,99,116,111,114,95,116,121,112,101,40, 50,41,41,41,59,10,32,32,105,50,32,114,118,32,61,32, 95,95,110,118,118,109,95,108,100,103,95,105,50,40,114,101, 105,110,116,101,114,112,114,101,116,95,99,97,115,116,60,99, 111,110,115,116,32,105,50,32,42,62,40,112,116,114,41,41, 59,10,32,32,105,110,116,50,32,114,101,116,59,10,32,32, 114,101,116,46,120,32,61,32,114,118,91,48,93,59,10,32, 32,114,101,116,46,121,32,61,32,114,118,91,49,93,59,10, 32,32,114,101,116,117,114,110,32,114,101,116,59,10,125,10, 105,110,108,105,110,101,32,95,95,100,101,118,105,99,101,95, 95,32,105,110,116,52,32,95,95,108,100,103,40,99,111,110, 115,116,32,105,110,116,52,32,42,112,116,114,41,32,123,10, 32,32,116,121,112,101,100,101,102,32,105,110,116,32,105,52, 32,95,95,97,116,116,114,105,98,117,116,101,95,95,40,40, 101,120,116,95,118,101,99,116,111,114,95,116,121,112,101,40, 52,41,41,41,59,10,32,32,105,52,32,114,118,32,61,32, 95,95,110,118,118,109,95,108,100,103,95,105,52,40,114,101, 105,110,116,101,114,112,114,101,116,95,99,97,115,116,60,99, 111,110,115,116,32,105,52,32,42,62,40,112,116,114,41,41, 59,10,32,32,105,110,116,52,32,114,101,116,59,10,32,32, 114,101,116,46,120,32,61,32,114,118,91,48,93,59,10,32, 32,114,101,116,46,121,32,61,32,114,118,91,49,93,59,10, 32,32,114,101,116,46,122,32,61,32,114,118,91,50,93,59, 10,32,32,114,101,116,46,119,32,61,32,114,118,91,51,93, 59,10,32,32,114,101,116,117,114,110,32,114,101,116,59,10, 125,10,105,110,108,105,110,101,32,95,95,100,101,118,105,99, 101,95,95,32,108,111,110,103,108,111,110,103,50,32,95,95, 108,100,103,40,99,111,110,115,116,32,108,111,110,103,108,111, 110,103,50,32,42,112,116,114,41,32,123,10,32,32,116,121, 112,101,100,101,102,32,108,111,110,103,32,108,111,110,103,32, 108,108,50,32,95,95,97,116,116,114,105,98,117,116,101,95, 95,40,40,101,120,116,95,118,101,99,116,111,114,95,116,121, 112,101,40,50,41,41,41,59,10,32,32,108,108,50,32,114, 118,32,61,32,95,95,110,118,118,109,95,108,100,103,95,108, 108,50,40,114,101,105,110,116,101,114,112,114,101,116,95,99, 97,115,116,60,99,111,110,115,116,32,108,108,50,32,42,62, 40,112,116,114,41,41,59,10,32,32,108,111,110,103,108,111, 110,103,50,32,114,101,116,59,10,32,32,114,101,116,46,120, 32,61,32,114,118,91,48,93,59,10,32,32,114,101,116,46, 121,32,61,32,114,118,91,49,93,59,10,32,32,114,101,116, 117,114,110,32,114,101,116,59,10,125,10,10,105,110,108,105, 110,101,32,95,95,100,101,118,105,99,101,95,95,32,117,99, 104,97,114,50,32,95,95,108,100,103,40,99,111,110,115,116, 32,117,99,104,97,114,50,32,42,112,116,114,41,32,123,10, 32,32,116,121,112,101,100,101,102,32,117,110,115,105,103,110, 101,100,32,99,104,97,114,32,117,99,50,32,95,95,97,116, 116,114,105,98,117,116,101,95,95,40,40,101,120,116,95,118, 101,99,116,111,114,95,116,121,112,101,40,50,41,41,41,59, 10,32,32,117,99,50,32,114,118,32,61,32,95,95,110,118, 118,109,95,108,100,103,95,117,99,50,40,114,101,105,110,116, 101,114,112,114,101,116,95,99,97,115,116,60,99,111,110,115, 116,32,117,99,50,32,42,62,40,112,116,114,41,41,59,10, 32,32,117,99,104,97,114,50,32,114,101,116,59,10,32,32, 114,101,116,46,120,32,61,32,114,118,91,48,93,59,10,32, 32,114,101,116,46,121,32,61,32,114,118,91,49,93,59,10, 32,32,114,101,116,117,114,110,32,114,101,116,59,10,125,10, 105,110,108,105,110,101,32,95,95,100,101,118,105,99,101,95, 95,32,117,99,104,97,114,52,32,95,95,108,100,103,40,99, 111,110,115,116,32,117,99,104,97,114,52,32,42,112,116,114, 41,32,123,10,32,32,116,121,112,101,100,101,102,32,117,110, 115,105,103,110,101,100,32,99,104,97,114,32,117,99,52,32, 95,95,97,116,116,114,105,98,117,116,101,95,95,40,40,101, 120,116,95,118,101,99,116,111,114,95,116,121,112,101,40,52, 41,41,41,59,10,32,32,117,99,52,32,114,118,32,61,32, 95,95,110,118,118,109,95,108,100,103,95,117,99,52,40,114, 101,105,110,116,101,114,112,114,101,116,95,99,97,115,116,60, 99,111,110,115,116,32,117,99,52,32,42,62,40,112,116,114, 41,41,59,10,32,32,117,99,104,97,114,52,32,114,101,116, 59,10,32,32,114,101,116,46,120,32,61,32,114,118,91,48, 93,59,10,32,32,114,101,116,46,121,32,61,32,114,118,91, 49,93,59,10,32,32,114,101,116,46,122,32,61,32,114,118, 91,50,93,59,10,32,32,114,101,116,46,119,32,61,32,114, 118,91,51,93,59,10,32,32,114,101,116,117,114,110,32,114, 101,116,59,10,125,10,105,110,108,105,110,101,32,95,95,100, 101,118,105,99,101,95,95,32,117,115,104,111,114,116,50,32, 95,95,108,100,103,40,99,111,110,115,116,32,117,115,104,111, 114,116,50,32,42,112,116,114,41,32,123,10,32,32,116,121, 112,101,100,101,102,32,117,110,115,105,103,110,101,100,32,115, 104,111,114,116,32,117,115,50,32,95,95,97,116,116,114,105, 98,117,116,101,95,95,40,40,101,120,116,95,118,101,99,116, 111,114,95,116,121,112,101,40,50,41,41,41,59,10,32,32, 117,115,50,32,114,118,32,61,32,95,95,110,118,118,109,95, 108,100,103,95,117,115,50,40,114,101,105,110,116,101,114,112, 114,101,116,95,99,97,115,116,60,99,111,110,115,116,32,117, 115,50,32,42,62,40,112,116,114,41,41,59,10,32,32,117, 115,104,111,114,116,50,32,114,101,116,59,10,32,32,114,101, 116,46,120,32,61,32,114,118,91,48,93,59,10,32,32,114, 101,116,46,121,32,61,32,114,118,91,49,93,59,10,32,32, 114,101,116,117,114,110,32,114,101,116,59,10,125,10,105,110, 108,105,110,101,32,95,95,100,101,118,105,99,101,95,95,32, 117,115,104,111,114,116,52,32,95,95,108,100,103,40,99,111, 110,115,116,32,117,115,104,111,114,116,52,32,42,112,116,114, 41,32,123,10,32,32,116,121,112,101,100,101,102,32,117,110, 115,105,103,110,101,100,32,115,104,111,114,116,32,117,115,52, 32,95,95,97,116,116,114,105,98,117,116,101,95,95,40,40, 101,120,116,95,118,101,99,116,111,114,95,116,121,112,101,40, 52,41,41,41,59,10,32,32,117,115,52,32,114,118,32,61, 32,95,95,110,118,118,109,95,108,100,103,95,117,115,52,40, 114,101,105,110,116,101,114,112,114,101,116,95,99,97,115,116, 60,99,111,110,115,116,32,117,115,52,32,42,62,40,112,116, 114,41,41,59,10,32,32,117,115,104,111,114,116,52,32,114, 101,116,59,10,32,32,114,101,116,46,120,32,61,32,114,118, 91,48,93,59,10,32,32,114,101,116,46,121,32,61,32,114, 118,91,49,93,59,10,32,32,114,101,116,46,122,32,61,32, 114,118,91,50,93,59,10,32,32,114,101,116,46,119,32,61, 32,114,118,91,51,93,59,10,32,32,114,101,116,117,114,110, 32,114,101,116,59,10,125,10,105,110,108,105,110,101,32,95, 95,100,101,118,105,99,101,95,95,32,117,105,110,116,50,32, 95,95,108,100,103,40,99,111,110,115,116,32,117,105,110,116, 50,32,42,112,116,114,41,32,123,10,32,32,116,121,112,101, 100,101,102,32,117,110,115,105,103,110,101,100,32,105,110,116, 32,117,105,50,32,95,95,97,116,116,114,105,98,117,116,101, 95,95,40,40,101,120,116,95,118,101,99,116,111,114,95,116, 121,112,101,40,50,41,41,41,59,10,32,32,117,105,50,32, 114,118,32,61,32,95,95,110,118,118,109,95,108,100,103,95, 117,105,50,40,114,101,105,110,116,101,114,112,114,101,116,95, 99,97,115,116,60,99,111,110,115,116,32,117,105,50,32,42, 62,40,112,116,114,41,41,59,10,32,32,117,105,110,116,50, 32,114,101,116,59,10,32,32,114,101,116,46,120,32,61,32, 114,118,91,48,93,59,10,32,32,114,101,116,46,121,32,61, 32,114,118,91,49,93,59,10,32,32,114,101,116,117,114,110, 32,114,101,116,59,10,125,10,105,110,108,105,110,101,32,95, 95,100,101,118,105,99,101,95,95,32,117,105,110,116,52,32, 95,95,108,100,103,40,99,111,110,115,116,32,117,105,110,116, 52,32,42,112,116,114,41,32,123,10,32,32,116,121,112,101, 100,101,102,32,117,110,115,105,103,110,101,100,32,105,110,116, 32,117,105,52,32,95,95,97,116,116,114,105,98,117,116,101, 95,95,40,40,101,120,116,95,118,101,99,116,111,114,95,116, 121,112,101,40,52,41,41,41,59,10,32,32,117,105,52,32, 114,118,32,61,32,95,95,110,118,118,109,95,108,100,103,95, 117,105,52,40,114,101,105,110,116,101,114,112,114,101,116,95, 99,97,115,116,60,99,111,110,115,116,32,117,105,52,32,42, 62,40,112,116,114,41,41,59,10,32,32,117,105,110,116,52, 32,114,101,116,59,10,32,32,114,101,116,46,120,32,61,32, 114,118,91,48,93,59,10,32,32,114,101,116,46,121,32,61, 32,114,118,91,49,93,59,10,32,32,114,101,116,46,122,32, 61,32,114,118,91,50,93,59,10,32,32,114,101,116,46,119, 32,61,32,114,118,91,51,93,59,10,32,32,114,101,116,117, 114,110,32,114,101,116,59,10,125,10,105,110,108,105,110,101, 32,95,95,100,101,118,105,99,101,95,95,32,117,108,111,110, 103,108,111,110,103,50,32,95,95,108,100,103,40,99,111,110, 115,116,32,117,108,111,110,103,108,111,110,103,50,32,42,112, 116,114,41,32,123,10,32,32,116,121,112,101,100,101,102,32, 117,110,115,105,103,110,101,100,32,108,111,110,103,32,108,111, 110,103,32,117,108,108,50,32,95,95,97,116,116,114,105,98, 117,116,101,95,95,40,40,101,120,116,95,118,101,99,116,111, 114,95,116,121,112,101,40,50,41,41,41,59,10,32,32,117, 108,108,50,32,114,118,32,61,32,95,95,110,118,118,109,95, 108,100,103,95,117,108,108,50,40,114,101,105,110,116,101,114, 112,114,101,116,95,99,97,115,116,60,99,111,110,115,116,32, 117,108,108,50,32,42,62,40,112,116,114,41,41,59,10,32, 32,117,108,111,110,103,108,111,110,103,50,32,114,101,116,59, 10,32,32,114,101,116,46,120,32,61,32,114,118,91,48,93, 59,10,32,32,114,101,116,46,121,32,61,32,114,118,91,49, 93,59,10,32,32,114,101,116,117,114,110,32,114,101,116,59, 10,125,10,10,105,110,108,105,110,101,32,95,95,100,101,118, 105,99,101,95,95,32,102,108,111,97,116,50,32,95,95,108, 100,103,40,99,111,110,115,116,32,102,108,111,97,116,50,32, 42,112,116,114,41,32,123,10,32,32,116,121,112,101,100,101, 102,32,102,108,111,97,116,32,102,50,32,95,95,97,116,116, 114,105,98,117,116,101,95,95,40,40,101,120,116,95,118,101, 99,116,111,114,95,116,121,112,101,40,50,41,41,41,59,10, 32,32,102,50,32,114,118,32,61,32,95,95,110,118,118,109, 95,108,100,103,95,102,50,40,114,101,105,110,116,101,114,112, 114,101,116,95,99,97,115,116,60,99,111,110,115,116,32,102, 50,32,42,62,40,112,116,114,41,41,59,10,32,32,102,108, 111,97,116,50,32,114,101,116,59,10,32,32,114,101,116,46, 120,32,61,32,114,118,91,48,93,59,10,32,32,114,101,116, 46,121,32,61,32,114,118,91,49,93,59,10,32,32,114,101, 116,117,114,110,32,114,101,116,59,10,125,10,105,110,108,105, 110,101,32,95,95,100,101,118,105,99,101,95,95,32,102,108, 111,97,116,52,32,95,95,108,100,103,40,99,111,110,115,116, 32,102,108,111,97,116,52,32,42,112,116,114,41,32,123,10, 32,32,116,121,112,101,100,101,102,32,102,108,111,97,116,32, 102,52,32,95,95,97,116,116,114,105,98,117,116,101,95,95, 40,40,101,120,116,95,118,101,99,116,111,114,95,116,121,112, 101,40,52,41,41,41,59,10,32,32,102,52,32,114,118,32, 61,32,95,95,110,118,118,109,95,108,100,103,95,102,52,40, 114,101,105,110,116,101,114,112,114,101,116,95,99,97,115,116, 60,99,111,110,115,116,32,102,52,32,42,62,40,112,116,114, 41,41,59,10,32,32,102,108,111,97,116,52,32,114,101,116, 59,10,32,32,114,101,116,46,120,32,61,32,114,118,91,48, 93,59,10,32,32,114,101,116,46,121,32,61,32,114,118,91, 49,93,59,10,32,32,114,101,116,46,122,32,61,32,114,118, 91,50,93,59,10,32,32,114,101,116,46,119,32,61,32,114, 118,91,51,93,59,10,32,32,114,101,116,117,114,110,32,114, 101,116,59,10,125,10,105,110,108,105,110,101,32,95,95,100, 101,118,105,99,101,95,95,32,100,111,117,98,108,101,50,32, 95,95,108,100,103,40,99,111,110,115,116,32,100,111,117,98, 108,101,50,32,42,112,116,114,41,32,123,10,32,32,116,121, 112,101,100,101,102,32,100,111,117,98,108,101,32,100,50,32, 95,95,97,116,116,114,105,98,117,116,101,95,95,40,40,101, 120,116,95,118,101,99,116,111,114,95,116,121,112,101,40,50, 41,41,41,59,10,32,32,100,50,32,114,118,32,61,32,95, 95,110,118,118,109,95,108,100,103,95,100,50,40,114,101,105, 110,116,101,114,112,114,101,116,95,99,97,115,116,60,99,111, 110,115,116,32,100,50,32,42,62,40,112,116,114,41,41,59, 10,32,32,100,111,117,98,108,101,50,32,114,101,116,59,10, 32,32,114,101,116,46,120,32,61,32,114,118,91,48,93,59, 10,32,32,114,101,116,46,121,32,61,32,114,118,91,49,93, 59,10,32,32,114,101,116,117,114,110,32,114,101,116,59,10, 125,10,10,47,47,32,84,79,68,79,58,32,73,109,112,108, 101,109,101,110,116,32,116,104,101,115,101,32,97,115,32,105, 110,116,114,105,110,115,105,99,115,44,32,115,111,32,116,104, 101,32,98,97,99,107,101,110,100,32,99,97,110,32,119,111, 114,107,32,105,116,115,32,109,97,103,105,99,32,111,110,10, 47,47,32,116,104,101,115,101,46,32,32,65,108,116,101,114, 110,97,116,105,118,101,108,121,44,32,119,101,32,99,111,117, 108,100,32,105,109,112,108,101,109,101,110,116,32,116,104,101, 115,101,32,97,115,32,112,108,97,105,110,32,67,32,97,110, 100,32,116,114,121,32,116,111,32,103,101,116,10,47,47,32, 108,108,118,109,32,116,111,32,114,101,99,111,103,110,105,122, 101,32,116,104,101,32,114,101,108,101,118,97,110,116,32,112, 97,116,116,101,114,110,115,46,10,105,110,108,105,110,101,32, 95,95,100,101,118,105,99,101,95,95,32,117,110,115,105,103, 110,101,100,32,95,95,102,117,110,110,101,108,115,104,105,102, 116,95,108,40,117,110,115,105,103,110,101,100,32,108,111,119, 51,50,44,32,117,110,115,105,103,110,101,100,32,104,105,103, 104,51,50,44,10,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 117,110,115,105,103,110,101,100,32,115,104,105,102,116,87,105, 100,116,104,41,32,123,10,32,32,117,110,115,105,103,110,101, 100,32,114,101,115,117,108,116,59,10,32,32,97,115,109,40, 34,115,104,102,46,108,46,119,114,97,112,46,98,51,50,32, 37,48,44,32,37,49,44,32,37,50,44,32,37,51,59,34, 10,32,32,32,32,32,32,58,32,34,61,114,34,40,114,101, 115,117,108,116,41,10,32,32,32,32,32,32,58,32,34,114, 34,40,108,111,119,51,50,41,44,32,34,114,34,40,104,105, 103,104,51,50,41,44,32,34,114,34,40,115,104,105,102,116, 87,105,100,116,104,41,41,59,10,32,32,114,101,116,117,114, 110,32,114,101,115,117,108,116,59,10,125,10,105,110,108,105, 110,101,32,95,95,100,101,118,105,99,101,95,95,32,117,110, 115,105,103,110,101,100,32,95,95,102,117,110,110,101,108,115, 104,105,102,116,95,108,99,40,117,110,115,105,103,110,101,100, 32,108,111,119,51,50,44,32,117,110,115,105,103,110,101,100, 32,104,105,103,104,51,50,44,10,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,117,110,115,105,103,110,101,100,32,115,104, 105,102,116,87,105,100,116,104,41,32,123,10,32,32,117,110, 115,105,103,110,101,100,32,114,101,115,117,108,116,59,10,32, 32,97,115,109,40,34,115,104,102,46,108,46,99,108,97,109, 112,46,98,51,50,32,37,48,44,32,37,49,44,32,37,50, 44,32,37,51,59,34,10,32,32,32,32,32,32,58,32,34, 61,114,34,40,114,101,115,117,108,116,41,10,32,32,32,32, 32,32,58,32,34,114,34,40,108,111,119,51,50,41,44,32, 34,114,34,40,104,105,103,104,51,50,41,44,32,34,114,34, 40,115,104,105,102,116,87,105,100,116,104,41,41,59,10,32, 32,114,101,116,117,114,110,32,114,101,115,117,108,116,59,10, 125,10,105,110,108,105,110,101,32,95,95,100,101,118,105,99, 101,95,95,32,117,110,115,105,103,110,101,100,32,95,95,102, 117,110,110,101,108,115,104,105,102,116,95,114,40,117,110,115, 105,103,110,101,100,32,108,111,119,51,50,44,32,117,110,115, 105,103,110,101,100,32,104,105,103,104,51,50,44,10,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,117,110,115,105,103,110,101, 100,32,115,104,105,102,116,87,105,100,116,104,41,32,123,10, 32,32,117,110,115,105,103,110,101,100,32,114,101,115,117,108, 116,59,10,32,32,97,115,109,40,34,115,104,102,46,114,46, 119,114,97,112,46,98,51,50,32,37,48,44,32,37,49,44, 32,37,50,44,32,37,51,59,34,10,32,32,32,32,32,32, 58,32,34,61,114,34,40,114,101,115,117,108,116,41,10,32, 32,32,32,32,32,58,32,34,114,34,40,108,111,119,51,50, 41,44,32,34,114,34,40,104,105,103,104,51,50,41,44,32, 34,114,34,40,115,104,105,102,116,87,105,100,116,104,41,41, 59,10,32,32,114,101,116,117,114,110,32,114,101,115,117,108, 116,59,10,125,10,105,110,108,105,110,101,32,95,95,100,101, 118,105,99,101,95,95,32,117,110,115,105,103,110,101,100,32, 95,95,102,117,110,110,101,108,115,104,105,102,116,95,114,99, 40,117,110,115,105,103,110,101,100,32,108,111,119,51,50,44, 32,117,110,115,105,103,110,101,100,32,104,105,103,104,51,50, 44,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,117,110, 115,105,103,110,101,100,32,115,104,105,102,116,87,105,100,116, 104,41,32,123,10,32,32,117,110,115,105,103,110,101,100,32, 114,101,116,59,10,32,32,97,115,109,40,34,115,104,102,46, 114,46,99,108,97,109,112,46,98,51,50,32,37,48,44,32, 37,49,44,32,37,50,44,32,37,51,59,34,10,32,32,32, 32,32,32,58,32,34,61,114,34,40,114,101,116,41,10,32, 32,32,32,32,32,58,32,34,114,34,40,108,111,119,51,50, 41,44,32,34,114,34,40,104,105,103,104,51,50,41,44,32, 34,114,34,40,115,104,105,102,116,87,105,100,116,104,41,41, 59,10,32,32,114,101,116,117,114,110,32,114,101,116,59,10, 125,10,10,35,101,110,100,105,102,32,47,47,32,33,100,101, 102,105,110,101,100,40,95,95,67,85,68,65,95,65,82,67, 72,95,95,41,32,124,124,32,95,95,67,85,68,65,95,65, 82,67,72,95,95,32,62,61,32,51,50,48,10,10,35,101, 110,100,105,102,32,47,47,32,100,101,102,105,110,101,100,40, 95,95,67,76,65,78,71,95,67,85,68,65,95,73,78,84, 82,73,78,83,73,67,83,95,72,95,95,41,10, }; unsigned int clang___clang_cuda_intrinsics_buf_size = sizeof(clang___clang_cuda_intrinsics_buf);
the_stack_data/7551.c
#include <stdio.h> #include <stdlib.h> int main(int argc, char* argv[]) { unsigned char x; unsigned char c = argv[1][0]; if (c > 127) x = c / 3; else x = c * 2; if (x > 63) printf("if-2-win\n"); else printf("if-2-lose\n"); return 0; }
the_stack_data/3263041.c
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. /*depending if the symbol GB_TIME_INTERCEPT is defined, this file does the following a) if GB_TIME_INTERCEPT is NOT defined, then the file shall be empty (almost:) b) if GB_TIME_INTERCEPT is defined, then the file shall call to the 'real' time.h functions from their gb_* synonyms*/ static const int avoid_a_warning_C4206 = 0; /* warning C4206: nonstandard extension used: translation unit is empty*/ #ifdef GB_TIME_INTERCEPT #ifdef __cplusplus #include <ctime> #else #include <time.h> #endif #include "azure_c_shared_utility/gb_time.h" /*this is time*/ time_t gb_time(time_t *timer); { return time(timer); } /*this is localtime*/ struct tm *gb_localtime(const time_t *timer) { return gb_localtime(timer); } size_t gb_strftime(char * s, size_t maxsize, const char * format, const struct tm * timeptr) { return strftime(s, maxsize, format, timeptr); } #endif
the_stack_data/78310.c
#include <stdio.h> int main () { /*локальна змінна */ int i = 5; /* цикл while */ while( i < 12 ) { printf("i = %d;\n", i); i++; // те саме що a =a+1 } } /* i = 5; i = 6; i = 7; i = 8; i = 9; i = 10; i = 11; */
the_stack_data/1141874.c
// // This module was automatically generated by PIPS // void pthread_exit(void *__retval);
the_stack_data/79098.c
#include<stdio.h> #include<stdlib.h> #include<stdint.h> #include<unistd.h> #include<string.h> extern void A(); int main(){ A(); return 0; }
the_stack_data/98656.c
#include <stdio.h> #include <string.h> #include <stdlib.h> char* strip(char* str) { // Strips spaces from both the front and back of a string, // leaving any internal spaces alone. int size; int num_spaces; int first_non_space, last_non_space, i; char* result; size = strlen(str); // This counts the number of leading and trailing spaces // so we can figure out how big the result array should be. num_spaces = 0; first_non_space = 0; while (first_non_space<size && str[first_non_space] == ' ') { ++num_spaces; ++first_non_space; } last_non_space = size-1; while (last_non_space>=0 && str[last_non_space] == ' ') { ++num_spaces; --last_non_space; } // If num_spaces >= size then that means that the string // consisted of nothing but spaces, so we'll return the // empty string. if (num_spaces >= size) { return ""; } // Allocate a slot for all the "saved" characters // plus one extra for the null terminator. result = calloc(size-num_spaces+1, sizeof(char)); // Copy in the "saved" characters. for (i=first_non_space; i<=last_non_space; ++i) { result[i-first_non_space] = str[i]; } // Place the null terminator at the end of the result string. result[i-first_non_space] = '\0'; return result; } /* * Return true (1) if the given string is "clean", i.e., has * no spaces at the front or the back of the string. */ int is_clean(char* str) { char* cleaned; int result; // We check if it's clean by calling strip and seeing if the // result is the same as the original string. cleaned = strip(str); // strcmp compares two strings, returning a negative value if // the first is less than the second (in alphabetical order), // 0 if they're equal, and a positive value if the first is // greater than the second. result = strcmp(str, cleaned); if(strcmp("",cleaned)){ return result == 0; } free(cleaned); return result == 0; } int main() { int i; int NUM_STRINGS = 7; // Makes an array of 7 string constants for testing. char* strings[] = { "Morris", " stuff", "Minnesota", "nonsense ", "USA", " ", " silliness " }; for (i=0; i<NUM_STRINGS; ++i) { if (is_clean(strings[i])) { printf("The string '%s' is clean.\n", strings[i]); } else { printf("The string '%s' is NOT clean.\n", strings[i]); } } return 0; }
the_stack_data/419736.c
/* Taxonomy Classification: 0000000100000142000310 */ /* * WRITE/READ 0 write * WHICH BOUND 0 upper * DATA TYPE 0 char * MEMORY LOCATION 0 stack * SCOPE 0 same * CONTAINER 0 no * POINTER 0 no * INDEX COMPLEXITY 1 variable * ADDRESS COMPLEXITY 0 constant * LENGTH COMPLEXITY 0 N/A * ADDRESS ALIAS 0 none * INDEX ALIAS 0 none * LOCAL CONTROL FLOW 0 none * SECONDARY CONTROL FLOW 1 if * LOOP STRUCTURE 4 non-standard for * LOOP COMPLEXITY 2 one * ASYNCHRONY 0 no * TAINT 0 no * RUNTIME ENV. DEPENDENCE 0 no * MAGNITUDE 3 4096 bytes * CONTINUOUS/DISCRETE 1 continuous * SIGNEDNESS 0 no */ /* Copyright 2004 M.I.T. Permission is hereby granted, without written agreement or royalty fee, to use, copy, modify, and distribute this software and its documentation for any purpose, provided that the above copyright notice and the following three paragraphs appear in all copies of this software. IN NO EVENT SHALL M.I.T. BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF M.I.T. HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMANGE. M.I.T. SPECIFICALLY DISCLAIMS ANY WARRANTIES INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THE SOFTWARE IS PROVIDED ON AN "AS-IS" BASIS AND M.I.T. HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ int main(int argc, char *argv[]) { int test_value; int loop_counter; char buf[10]; test_value = 4105; for(loop_counter = 0; ; loop_counter++) { if (loop_counter > test_value) break; /* BAD */ buf[loop_counter] = 'A'; } return 0; }
the_stack_data/10952.c
#if HAVE_CONFIG_H # include <config.h> #endif #ifndef PATHNAME_SEPARATOR # define PATHNAME_SEPARATOR '/' #endif #include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <string.h> #include <errno.h> int is_static = 1; int is_const = 1; static void * fmalloc(int size) { void *p = malloc(size); if (!p) { fputs("giftoc: Out of memory!\n", stderr); exit(1); } return p; } void print_reckless(FILE *f, char *gifrecname) { unsigned long size = 0; int c; int lasthex = 0; printf("\n%sGifRecord %s = { (unsigned char *)\"", is_static ? "static " : "", gifrecname); size = 0; c = getc(f); while (c != EOF) { if (size % 60 == 0) printf("\"\n \""); switch (c) { case '\\': fputs("\\\\", stdout); lasthex = 0; break; case '\"': fputs("\\\"", stdout); lasthex = 0; break; case '\b': fputs("\\b", stdout); lasthex = 0; break; case '\r': fputs("\\r", stdout); lasthex = 0; break; case '\n': fputs("\\n", stdout); lasthex = 0; break; case '\f': fputs("\\f", stdout); lasthex = 0; break; case '\t': fputs("\\t", stdout); lasthex = 0; break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': if (lasthex) printf("\\%o", c); else putchar(c); break; default: if (isprint(c)) { putchar(c); lasthex = 0; } else { printf("\\%o", c); lasthex = 1; } break; } size++; c = getc(f); } printf("\",\n %lu\n};\n", size); } void print_unreckless(FILE *f, char *gifrecname) { unsigned long size = 0; int c; printf("\nstatic %sunsigned char %s_data[] = {", (is_const ? "const " : ""), gifrecname); size = 0; c = getc(f); while (c != EOF) { if (size % 20 == 0) printf("\n"); printf("%d,", c); size++; c = getc(f); } printf("};\n%s%sGif_Record %s = { %s_data, %lu };\n", (is_static ? "static " : ""), (is_const ? "const " : ""), gifrecname, gifrecname, size); } int main(int argc, char *argv[]) { int reckless = 0; int make_name = 0; const char *directory = ""; argc--, argv++; while (argv[0] && argv[0][0] == '-') { if (!strcmp(argv[0], "-reckless")) reckless = 1, argc--, argv++; else if (!strcmp(argv[0], "-static")) is_static = 1, argc--, argv++; else if (!strcmp(argv[0], "-extern")) is_static = 0, argc--, argv++; else if (!strcmp(argv[0], "-makename")) make_name = 1, argc--, argv++; else if (!strcmp(argv[0], "-nonconst")) is_const = 0, argc--, argv++; else if (!strcmp(argv[0], "-const")) is_const = 1, argc--, argv++; else if (!strcmp(argv[0], "-dir") && argc > 1) { directory = argv[1], argc -= 2, argv += 2; /* make sure directory is slash-terminated */ if (directory[ strlen(directory) - 1 ] != PATHNAME_SEPARATOR && directory[0]) { char *ndirectory = (char *)fmalloc(strlen(directory) + 2); sprintf(ndirectory, "%s%c", directory, PATHNAME_SEPARATOR); directory = ndirectory; } } else break; } if ((!make_name && argc % 2 != 0) || argc < 1 || (argv[0] && argv[0][0] == '-')) { fprintf(stderr, "\ usage: giftoc [OPTIONS] FILE NAME [FILE NAME...]\n\ or: giftoc -makename [OPTIONS] FILE [FILE...]\n\ OPTIONS are -reckless, -extern, -nonconst, -dir DIR\n"); exit(1); } if (!is_static) printf("#include \"config.h\"\n#include <lcdfgif/gif.h>\n\n"); for (; argc > 0; argc--, argv++) { FILE *f; char *rec_name = 0; char *file_name = (char *)fmalloc(strlen(argv[0]) + strlen(directory) + 1); strcpy(file_name, directory); strcat(file_name, argv[0]); f = fopen(file_name, "rb"); if (!f) { fprintf(stderr, "%s: %s\n", file_name, strerror(errno)); goto done; } if (make_name) { char *sin, *sout; sin = strrchr(file_name, PATHNAME_SEPARATOR) + 1; if (!sin) sin = file_name; sout = rec_name = (char *)fmalloc(strlen(sin) + 2); if (isdigit(*sin)) *sout++ = 'N'; for (; *sin; sin++, sout++) if (isalnum(*sin)) *sout = *sin; else *sout = '_'; *sout = 0; } else { argv++, argc--; rec_name = argv[0]; } if (reckless) print_reckless(f, rec_name); else print_unreckless(f, rec_name); done: if (make_name) free(rec_name); free(file_name); if (f) fclose(f); } exit(0); }
the_stack_data/1259593.c
/* Pthreads test program. Copyright 1996-2015 Free Software Foundation, Inc. Written by Keith Seitz of Red Hat. Copied from gdb.threads/pthreads.c. Contributed by Red Hat. This file is part of GDB. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <stdio.h> #include <stdlib.h> #include <pthread.h> #include <unistd.h> /* Under HPUX 10, the second arg of pthread_create is prototyped to be just a "pthread_attr_t", while under Solaris it is a "pthread_attr_t *". Arg! */ #if defined (__hpux__) #define PTHREAD_CREATE_ARG2(arg) arg #define PTHREAD_CREATE_NULL_ARG2 null_attr static pthread_attr_t null_attr; #else #define PTHREAD_CREATE_ARG2(arg) &arg #define PTHREAD_CREATE_NULL_ARG2 NULL #endif void * routine (void *arg) { /* When gdb is running, it sets hidden breakpoints in the thread library. The signals caused by these hidden breakpoints can cause system calls such as 'sleep' to return early. Pay attention to the return value from 'sleep' to get the full sleep. */ int unslept = 9; while (unslept > 0) unslept = sleep (unslept); printf ("hello thread\n"); } /* Marker function for the testsuite */ void done_making_threads (void) { /* Nothing */ } void create_thread (void) { pthread_t tid; if (pthread_create (&tid, PTHREAD_CREATE_NULL_ARG2, routine, (void *) 0xfeedface)) { perror ("pthread_create 1"); exit (1); } } int main (int argc, char *argv[]) { int i; /* Create a few threads */ for (i = 0; i < 5; i++) create_thread (); done_making_threads (); printf ("hello\n"); printf ("hello\n"); return 0; }
the_stack_data/165765371.c
#include <stdio.h> #include <math.h> int main(void){ float peso, altura, imc; printf("Qual o peso? "); scanf("%f", &peso); printf("Qual a altura? "); scanf("%f", &altura); imc = peso/pow(altura, 2); printf("IMC = %.1f\n", imc); if (imc <= 30){ printf("Nao esta obesa!\n"); } else{ printf("Esta obesa!\n"); } return 0; }
the_stack_data/121961.c
#include <pthread.h> #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <sys/types.h> struct arguments{ int first_num; int second_num; }; void * sum(void * arg){ struct arguments *args = (struct arguments *) arg; printf("Sum: %d\n", args->first_num + args->second_num); return NULL; } void * diff(void * arg){ struct arguments *args = (struct arguments *) arg; printf("Diff: %d\n", args->first_num - args->second_num); return NULL; } void * mult(void * arg){ struct arguments *args = (struct arguments *) arg; printf("Mult: %d\n", args->first_num * args->second_num); return NULL; } void * division(void * arg){ struct arguments *args = (struct arguments *) arg; printf("Division: %d\n", args->first_num / args->second_num); return NULL; } int main(){ struct arguments * args = malloc(sizeof(struct arguments)); pthread_t tsum, tdiff, tmult, tdivi; scanf("%d", &args->first_num); scanf("%d", &args->second_num); pthread_create(&tsum, NULL, sum, args); pthread_create(&tdiff, NULL, diff, args); pthread_create(&tmult, NULL, mult, args); pthread_create(&tdivi, NULL, division, args); pthread_exit(0); }
the_stack_data/86492.c
#include <stdio.h> #include <stdlib.h> #include <string.h> //This function is used to figure out the ordering //of the strings in qsort. You do not need //to modify it. int stringOrder(const void * vp1, const void * vp2) { const char * const * p1 = vp1; const char * const * p2 = vp2; return strcmp(*p1, *p2); } //This function will sort and print data (whose length is count). void sortData(char ** data, size_t count) { qsort(data, count, sizeof(char *), stringOrder); } int main(int argc, char ** argv) { if (argc == 0) { fprintf(stderr,"few arguments \n"); return EXIT_FAILURE; } else if (argc == 1){ //read from stdio char** arr=NULL; char* line=NULL; size_t sz=0; int i =0; while(getline(&line ,&sz,stdin)>=0){ arr=realloc(arr,(i+1)*sizeof(*arr)); arr[i]=line; line=NULL; i++; } free(line); sortData(arr, i); for(int j=0;j<i;j++){ printf("%s",arr[j]); free(arr[j]); } free(arr); } else { for(int x=1;x<argc;x++){ char** arr=NULL; char* line=NULL; size_t sz=0; int i =0; FILE * f=fopen(argv[x],"r"); if (f == NULL){ perror("Could not open file"); return EXIT_FAILURE; } while(getline(&line ,&sz,f)>=0){ arr=realloc(arr,(i+1)*sizeof(*arr)); arr[i]=line; line=NULL; i++; } free(line); sortData(arr, i); for(int j=0;j<i;j++){ printf("%s",arr[j]); free(arr[j]); } free(arr); if (fclose(f) != 0) { perror("Failed to close the input file!"); return EXIT_FAILURE; } //read from file } //WRITE YOUR CODE HERE! return EXIT_SUCCESS; } }
the_stack_data/95448969.c
/*Sahaana Iyer SE Comp Batch B 8609*/ #include<stdio.h> #include<stdlib.h> #include<string.h> int main() { int m,n,i,j,k; char x[10], y[10], P[10]; int c[10][10]={0}; char b[10][10]; printf("Enter the length of the string X :\t"); scanf("%d",&m); printf("Enter the string X :\t"); scanf("%s",&x); printf("Enter the length of the string Y :\t"); scanf("%d",&n); printf("Enter the string Y :\t"); scanf("%s",&y); for(i=0; i<=m; i++) { c[i][0]=0; b[i][0]='.'; } for(i=0; i<=n; i++) { c[0][i]=0; b[0][i]='.'; } for(i=1; i<=m; i++) { for(j=1; j<=n; j++) { if(x[i-1]==y[j-1]) { c[i][j]=c[i-1][j-1] + 1; b[i][j]='\\' ; } else if(c[i-1][j]>=c[i][j-1]) { c[i][j]=c[i-1][j]; b[i][j]='|'; } else { c[i][j]=c[i][j-1]; b[i][j]='-'; } } } for(i=0; i<=m; i++) { for(j=0; j<=n; j++) printf("%d \t",c[i][j]); printf("\n"); } printf("\n"); for(i=0; i<=m; i++) { for(j=0; j<=n; j++) printf("%c \t",b[i][j]); printf("\n"); } i=0; while(1) { if(b[m][n]=='.') break; else if(b[m][n]=='\\') { P[i]=x[m-1]; i++; m--; n--; } else if(b[m][n]=='|') m--; else if(b[m][n]=='-') n--; } int len=strlen(P); printf("\nThe Longest Common Subsequence is : \n"); for(i=len;i>=0;i--) printf("%c",P[i]); return 0; } /* OUTPUT : Enter the length of the string X : 6 Enter the string X : acbaed Enter the length of the string Y : 6 Enter the string Y : abcabe 0 0 0 0 0 0 0 0 1 1 1 1 1 1 0 1 1 2 2 2 2 0 1 2 2 2 3 3 0 1 2 2 3 3 3 0 1 2 2 3 3 4 0 1 2 2 3 3 4 . . . . . . . . \ - - \ - - . | | \ - - - . | \ | | \ - . \ | | \ | | . | | | | | \ . | | | | | | The Longest Common Subsequence is : acbe */
the_stack_data/82950826.c
/* * NB - This file is a modified version of one by Eric Young. * It was modifed by jimmikaelkael <[email protected]> */ /* Copyright (C) 1995 Eric Young ([email protected]) * All rights reserved. * * This file is part of an SSL implementation written * by Eric Young ([email protected]). * The implementation was written so as to conform with Netscapes SSL * specification. This library and applications are * FREE FOR COMMERCIAL AND NON-COMMERCIAL USE * as long as the following conditions are aheared to. * * Copyright remains Eric Young's, and as such any Copyright notices in * the code are not to be removed. If this code is used in a product, * Eric Young should be given attribution as the author of the parts used. * This can be in the form of a textual message at program startup or * in documentation (online or textual) provided with the package. * * 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 copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by Eric Young ([email protected]) * * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR 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. * * The licence and distribution terms for any publically available version or * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] */ #define c2l(c,l) (l =((unsigned long)(*((c)++))), \ l|=((unsigned long)(*((c)++)))<< 8, \ l|=((unsigned long)(*((c)++)))<<16, \ l|=((unsigned long)(*((c)++)))<<24) #define l2c(l,c) (*((c)++)=(unsigned char)(((l) )&0xff), \ *((c)++)=(unsigned char)(((l)>> 8)&0xff), \ *((c)++)=(unsigned char)(((l)>>16)&0xff), \ *((c)++)=(unsigned char)(((l)>>24)&0xff)) #define ITERATIONS 16 #define HPERM_OP(a,t,n,m) ((t)=((((a)<<(16-(n)))^(a))&(m)),\ (a)=(a)^(t)^(t>>(16-(n)))) unsigned long des_SPtrans[8][64]={ /* nibble 0 */ { 0x00820200, 0x00020000, 0x80800000, 0x80820200, 0x00800000, 0x80020200, 0x80020000, 0x80800000, 0x80020200, 0x00820200, 0x00820000, 0x80000200, 0x80800200, 0x00800000, 0x00000000, 0x80020000, 0x00020000, 0x80000000, 0x00800200, 0x00020200, 0x80820200, 0x00820000, 0x80000200, 0x00800200, 0x80000000, 0x00000200, 0x00020200, 0x80820000, 0x00000200, 0x80800200, 0x80820000, 0x00000000, 0x00000000, 0x80820200, 0x00800200, 0x80020000, 0x00820200, 0x00020000, 0x80000200, 0x00800200, 0x80820000, 0x00000200, 0x00020200, 0x80800000, 0x80020200, 0x80000000, 0x80800000, 0x00820000, 0x80820200, 0x00020200, 0x00820000, 0x80800200, 0x00800000, 0x80000200, 0x80020000, 0x00000000, 0x00020000, 0x00800000, 0x80800200, 0x00820200, 0x80000000, 0x80820000, 0x00000200, 0x80020200 }, /* nibble 1 */ { 0x10042004, 0x00000000, 0x00042000, 0x10040000, 0x10000004, 0x00002004, 0x10002000, 0x00042000, 0x00002000, 0x10040004, 0x00000004, 0x10002000, 0x00040004, 0x10042000, 0x10040000, 0x00000004, 0x00040000, 0x10002004, 0x10040004, 0x00002000, 0x00042004, 0x10000000, 0x00000000, 0x00040004, 0x10002004, 0x00042004, 0x10042000, 0x10000004, 0x10000000, 0x00040000, 0x00002004, 0x10042004, 0x00040004, 0x10042000, 0x10002000, 0x00042004, 0x10042004, 0x00040004, 0x10000004, 0x00000000, 0x10000000, 0x00002004, 0x00040000, 0x10040004, 0x00002000, 0x10000000, 0x00042004, 0x10002004, 0x10042000, 0x00002000, 0x00000000, 0x10000004, 0x00000004, 0x10042004, 0x00042000, 0x10040000, 0x10040004, 0x00040000, 0x00002004, 0x10002000, 0x10002004, 0x00000004, 0x10040000, 0x00042000 }, /* nibble 2 */ { 0x41000000, 0x01010040, 0x00000040, 0x41000040, 0x40010000, 0x01000000, 0x41000040, 0x00010040, 0x01000040, 0x00010000, 0x01010000, 0x40000000, 0x41010040, 0x40000040, 0x40000000, 0x41010000, 0x00000000, 0x40010000, 0x01010040, 0x00000040, 0x40000040, 0x41010040, 0x00010000, 0x41000000, 0x41010000, 0x01000040, 0x40010040, 0x01010000, 0x00010040, 0x00000000, 0x01000000, 0x40010040, 0x01010040, 0x00000040, 0x40000000, 0x00010000, 0x40000040, 0x40010000, 0x01010000, 0x41000040, 0x00000000, 0x01010040, 0x00010040, 0x41010000, 0x40010000, 0x01000000, 0x41010040, 0x40000000, 0x40010040, 0x41000000, 0x01000000, 0x41010040, 0x00010000, 0x01000040, 0x41000040, 0x00010040, 0x01000040, 0x00000000, 0x41010000, 0x40000040, 0x41000000, 0x40010040, 0x00000040, 0x01010000 }, /* nibble 3 */ { 0x00100402, 0x04000400, 0x00000002, 0x04100402, 0x00000000, 0x04100000, 0x04000402, 0x00100002, 0x04100400, 0x04000002, 0x04000000, 0x00000402, 0x04000002, 0x00100402, 0x00100000, 0x04000000, 0x04100002, 0x00100400, 0x00000400, 0x00000002, 0x00100400, 0x04000402, 0x04100000, 0x00000400, 0x00000402, 0x00000000, 0x00100002, 0x04100400, 0x04000400, 0x04100002, 0x04100402, 0x00100000, 0x04100002, 0x00000402, 0x00100000, 0x04000002, 0x00100400, 0x04000400, 0x00000002, 0x04100000, 0x04000402, 0x00000000, 0x00000400, 0x00100002, 0x00000000, 0x04100002, 0x04100400, 0x00000400, 0x04000000, 0x04100402, 0x00100402, 0x00100000, 0x04100402, 0x00000002, 0x04000400, 0x00100402, 0x00100002, 0x00100400, 0x04100000, 0x04000402, 0x00000402, 0x04000000, 0x04000002, 0x04100400 }, /* nibble 4 */ { 0x02000000, 0x00004000, 0x00000100, 0x02004108, 0x02004008, 0x02000100, 0x00004108, 0x02004000, 0x00004000, 0x00000008, 0x02000008, 0x00004100, 0x02000108, 0x02004008, 0x02004100, 0x00000000, 0x00004100, 0x02000000, 0x00004008, 0x00000108, 0x02000100, 0x00004108, 0x00000000, 0x02000008, 0x00000008, 0x02000108, 0x02004108, 0x00004008, 0x02004000, 0x00000100, 0x00000108, 0x02004100, 0x02004100, 0x02000108, 0x00004008, 0x02004000, 0x00004000, 0x00000008, 0x02000008, 0x02000100, 0x02000000, 0x00004100, 0x02004108, 0x00000000, 0x00004108, 0x02000000, 0x00000100, 0x00004008, 0x02000108, 0x00000100, 0x00000000, 0x02004108, 0x02004008, 0x02004100, 0x00000108, 0x00004000, 0x00004100, 0x02004008, 0x02000100, 0x00000108, 0x00000008, 0x00004108, 0x02004000, 0x02000008 }, /* nibble 5 */ { 0x20000010, 0x00080010, 0x00000000, 0x20080800, 0x00080010, 0x00000800, 0x20000810, 0x00080000, 0x00000810, 0x20080810, 0x00080800, 0x20000000, 0x20000800, 0x20000010, 0x20080000, 0x00080810, 0x00080000, 0x20000810, 0x20080010, 0x00000000, 0x00000800, 0x00000010, 0x20080800, 0x20080010, 0x20080810, 0x20080000, 0x20000000, 0x00000810, 0x00000010, 0x00080800, 0x00080810, 0x20000800, 0x00000810, 0x20000000, 0x20000800, 0x00080810, 0x20080800, 0x00080010, 0x00000000, 0x20000800, 0x20000000, 0x00000800, 0x20080010, 0x00080000, 0x00080010, 0x20080810, 0x00080800, 0x00000010, 0x20080810, 0x00080800, 0x00080000, 0x20000810, 0x20000010, 0x20080000, 0x00080810, 0x00000000, 0x00000800, 0x20000010, 0x20000810, 0x20080800, 0x20080000, 0x00000810, 0x00000010, 0x20080010 }, /* nibble 6 */ { 0x00001000, 0x00000080, 0x00400080, 0x00400001, 0x00401081, 0x00001001, 0x00001080, 0x00000000, 0x00400000, 0x00400081, 0x00000081, 0x00401000, 0x00000001, 0x00401080, 0x00401000, 0x00000081, 0x00400081, 0x00001000, 0x00001001, 0x00401081, 0x00000000, 0x00400080, 0x00400001, 0x00001080, 0x00401001, 0x00001081, 0x00401080, 0x00000001, 0x00001081, 0x00401001, 0x00000080, 0x00400000, 0x00001081, 0x00401000, 0x00401001, 0x00000081, 0x00001000, 0x00000080, 0x00400000, 0x00401001, 0x00400081, 0x00001081, 0x00001080, 0x00000000, 0x00000080, 0x00400001, 0x00000001, 0x00400080, 0x00000000, 0x00400081, 0x00400080, 0x00001080, 0x00000081, 0x00001000, 0x00401081, 0x00400000, 0x00401080, 0x00000001, 0x00001001, 0x00401081, 0x00400001, 0x00401080, 0x00401000, 0x00001001 }, /* nibble 7 */ { 0x08200020, 0x08208000, 0x00008020, 0x00000000, 0x08008000, 0x00200020, 0x08200000, 0x08208020, 0x00000020, 0x08000000, 0x00208000, 0x00008020, 0x00208020, 0x08008020, 0x08000020, 0x08200000, 0x00008000, 0x00208020, 0x00200020, 0x08008000, 0x08208020, 0x08000020, 0x00000000, 0x00208000, 0x08000000, 0x00200000, 0x08008020, 0x08200020, 0x00200000, 0x00008000, 0x08208000, 0x00000020, 0x00200000, 0x00008000, 0x08000020, 0x08208020, 0x00008020, 0x08000000, 0x00000000, 0x00208000, 0x08200020, 0x08008020, 0x08008000, 0x00200020, 0x08208000, 0x00000020, 0x00200020, 0x08008000, 0x08208020, 0x00200000, 0x08200000, 0x08000020, 0x00208000, 0x00008020, 0x08008020, 0x08200000, 0x00000020, 0x08208000, 0x00208020, 0x00000000, 0x08000000, 0x08200020, 0x00008000, 0x00208020 }}; unsigned long des_skb[8][64]={ /* for C bits (numbered as per FIPS 46) 1 2 3 4 5 6 */ { 0x00000000,0x00000010,0x20000000,0x20000010, 0x00010000,0x00010010,0x20010000,0x20010010, 0x00000800,0x00000810,0x20000800,0x20000810, 0x00010800,0x00010810,0x20010800,0x20010810, 0x00000020,0x00000030,0x20000020,0x20000030, 0x00010020,0x00010030,0x20010020,0x20010030, 0x00000820,0x00000830,0x20000820,0x20000830, 0x00010820,0x00010830,0x20010820,0x20010830, 0x00080000,0x00080010,0x20080000,0x20080010, 0x00090000,0x00090010,0x20090000,0x20090010, 0x00080800,0x00080810,0x20080800,0x20080810, 0x00090800,0x00090810,0x20090800,0x20090810, 0x00080020,0x00080030,0x20080020,0x20080030, 0x00090020,0x00090030,0x20090020,0x20090030, 0x00080820,0x00080830,0x20080820,0x20080830, 0x00090820,0x00090830,0x20090820,0x20090830 }, /* for C bits (numbered as per FIPS 46) 7 8 10 11 12 13 */ { 0x00000000,0x02000000,0x00002000,0x02002000, 0x00200000,0x02200000,0x00202000,0x02202000, 0x00000004,0x02000004,0x00002004,0x02002004, 0x00200004,0x02200004,0x00202004,0x02202004, 0x00000400,0x02000400,0x00002400,0x02002400, 0x00200400,0x02200400,0x00202400,0x02202400, 0x00000404,0x02000404,0x00002404,0x02002404, 0x00200404,0x02200404,0x00202404,0x02202404, 0x10000000,0x12000000,0x10002000,0x12002000, 0x10200000,0x12200000,0x10202000,0x12202000, 0x10000004,0x12000004,0x10002004,0x12002004, 0x10200004,0x12200004,0x10202004,0x12202004, 0x10000400,0x12000400,0x10002400,0x12002400, 0x10200400,0x12200400,0x10202400,0x12202400, 0x10000404,0x12000404,0x10002404,0x12002404, 0x10200404,0x12200404,0x10202404,0x12202404 }, /* for C bits (numbered as per FIPS 46) 14 15 16 17 19 20 */ { 0x00000000,0x00000001,0x00040000,0x00040001, 0x01000000,0x01000001,0x01040000,0x01040001, 0x00000002,0x00000003,0x00040002,0x00040003, 0x01000002,0x01000003,0x01040002,0x01040003, 0x00000200,0x00000201,0x00040200,0x00040201, 0x01000200,0x01000201,0x01040200,0x01040201, 0x00000202,0x00000203,0x00040202,0x00040203, 0x01000202,0x01000203,0x01040202,0x01040203, 0x08000000,0x08000001,0x08040000,0x08040001, 0x09000000,0x09000001,0x09040000,0x09040001, 0x08000002,0x08000003,0x08040002,0x08040003, 0x09000002,0x09000003,0x09040002,0x09040003, 0x08000200,0x08000201,0x08040200,0x08040201, 0x09000200,0x09000201,0x09040200,0x09040201, 0x08000202,0x08000203,0x08040202,0x08040203, 0x09000202,0x09000203,0x09040202,0x09040203 }, /* for C bits (numbered as per FIPS 46) 21 23 24 26 27 28 */ { 0x00000000,0x00100000,0x00000100,0x00100100, 0x00000008,0x00100008,0x00000108,0x00100108, 0x00001000,0x00101000,0x00001100,0x00101100, 0x00001008,0x00101008,0x00001108,0x00101108, 0x04000000,0x04100000,0x04000100,0x04100100, 0x04000008,0x04100008,0x04000108,0x04100108, 0x04001000,0x04101000,0x04001100,0x04101100, 0x04001008,0x04101008,0x04001108,0x04101108, 0x00020000,0x00120000,0x00020100,0x00120100, 0x00020008,0x00120008,0x00020108,0x00120108, 0x00021000,0x00121000,0x00021100,0x00121100, 0x00021008,0x00121008,0x00021108,0x00121108, 0x04020000,0x04120000,0x04020100,0x04120100, 0x04020008,0x04120008,0x04020108,0x04120108, 0x04021000,0x04121000,0x04021100,0x04121100, 0x04021008,0x04121008,0x04021108,0x04121108 }, /* for D bits (numbered as per FIPS 46) 1 2 3 4 5 6 */ { 0x00000000,0x10000000,0x00010000,0x10010000, 0x00000004,0x10000004,0x00010004,0x10010004, 0x20000000,0x30000000,0x20010000,0x30010000, 0x20000004,0x30000004,0x20010004,0x30010004, 0x00100000,0x10100000,0x00110000,0x10110000, 0x00100004,0x10100004,0x00110004,0x10110004, 0x20100000,0x30100000,0x20110000,0x30110000, 0x20100004,0x30100004,0x20110004,0x30110004, 0x00001000,0x10001000,0x00011000,0x10011000, 0x00001004,0x10001004,0x00011004,0x10011004, 0x20001000,0x30001000,0x20011000,0x30011000, 0x20001004,0x30001004,0x20011004,0x30011004, 0x00101000,0x10101000,0x00111000,0x10111000, 0x00101004,0x10101004,0x00111004,0x10111004, 0x20101000,0x30101000,0x20111000,0x30111000, 0x20101004,0x30101004,0x20111004,0x30111004 }, /* for D bits (numbered as per FIPS 46) 8 9 11 12 13 14 */ { 0x00000000,0x08000000,0x00000008,0x08000008, 0x00000400,0x08000400,0x00000408,0x08000408, 0x00020000,0x08020000,0x00020008,0x08020008, 0x00020400,0x08020400,0x00020408,0x08020408, 0x00000001,0x08000001,0x00000009,0x08000009, 0x00000401,0x08000401,0x00000409,0x08000409, 0x00020001,0x08020001,0x00020009,0x08020009, 0x00020401,0x08020401,0x00020409,0x08020409, 0x02000000,0x0A000000,0x02000008,0x0A000008, 0x02000400,0x0A000400,0x02000408,0x0A000408, 0x02020000,0x0A020000,0x02020008,0x0A020008, 0x02020400,0x0A020400,0x02020408,0x0A020408, 0x02000001,0x0A000001,0x02000009,0x0A000009, 0x02000401,0x0A000401,0x02000409,0x0A000409, 0x02020001,0x0A020001,0x02020009,0x0A020009, 0x02020401,0x0A020401,0x02020409,0x0A020409 }, /* for D bits (numbered as per FIPS 46) 16 17 18 19 20 21 */ { 0x00000000,0x00000100,0x00080000,0x00080100, 0x01000000,0x01000100,0x01080000,0x01080100, 0x00000010,0x00000110,0x00080010,0x00080110, 0x01000010,0x01000110,0x01080010,0x01080110, 0x00200000,0x00200100,0x00280000,0x00280100, 0x01200000,0x01200100,0x01280000,0x01280100, 0x00200010,0x00200110,0x00280010,0x00280110, 0x01200010,0x01200110,0x01280010,0x01280110, 0x00000200,0x00000300,0x00080200,0x00080300, 0x01000200,0x01000300,0x01080200,0x01080300, 0x00000210,0x00000310,0x00080210,0x00080310, 0x01000210,0x01000310,0x01080210,0x01080310, 0x00200200,0x00200300,0x00280200,0x00280300, 0x01200200,0x01200300,0x01280200,0x01280300, 0x00200210,0x00200310,0x00280210,0x00280310, 0x01200210,0x01200310,0x01280210,0x01280310 }, /* for D bits (numbered as per FIPS 46) 22 23 24 25 27 28 */ { 0x00000000,0x04000000,0x00040000,0x04040000, 0x00000002,0x04000002,0x00040002,0x04040002, 0x00002000,0x04002000,0x00042000,0x04042000, 0x00002002,0x04002002,0x00042002,0x04042002, 0x00000020,0x04000020,0x00040020,0x04040020, 0x00000022,0x04000022,0x00040022,0x04040022, 0x00002020,0x04002020,0x00042020,0x04042020, 0x00002022,0x04002022,0x00042022,0x04042022, 0x00000800,0x04000800,0x00040800,0x04040800, 0x00000802,0x04000802,0x00040802,0x04040802, 0x00002800,0x04002800,0x00042800,0x04042800, 0x00002802,0x04002802,0x00042802,0x04042802, 0x00000820,0x04000820,0x00040820,0x04040820, 0x00000822,0x04000822,0x00040822,0x04040822, 0x00002820,0x04002820,0x00042820,0x04042820, 0x00002822,0x04002822,0x00042822,0x04042822 }}; /* The changes to this macro may help or hinder, depending on the * compiler and the achitecture. gcc2 always seems to do well :-). * Inspired by Dana How <[email protected]> * DO NOT use the alternative version on machines with 8 byte longs. */ /* original version */ #define D_ENCRYPT(L,R,S) \ u=(R^s[S ]); \ t=R^s[S+1]; \ t=((t>>4)+(t<<28)); \ L^= des_SPtrans[1][(t )&0x3f]| \ des_SPtrans[3][(t>> 8)&0x3f]| \ des_SPtrans[5][(t>>16)&0x3f]| \ des_SPtrans[7][(t>>24)&0x3f]| \ des_SPtrans[0][(u )&0x3f]| \ des_SPtrans[2][(u>> 8)&0x3f]| \ des_SPtrans[4][(u>>16)&0x3f]| \ des_SPtrans[6][(u>>24)&0x3f]; /* IP and FP * The problem is more of a geometric problem that random bit fiddling. 0 1 2 3 4 5 6 7 62 54 46 38 30 22 14 6 8 9 10 11 12 13 14 15 60 52 44 36 28 20 12 4 16 17 18 19 20 21 22 23 58 50 42 34 26 18 10 2 24 25 26 27 28 29 30 31 to 56 48 40 32 24 16 8 0 32 33 34 35 36 37 38 39 63 55 47 39 31 23 15 7 40 41 42 43 44 45 46 47 61 53 45 37 29 21 13 5 48 49 50 51 52 53 54 55 59 51 43 35 27 19 11 3 56 57 58 59 60 61 62 63 57 49 41 33 25 17 9 1 The output has been subject to swaps of the form 0 1 -> 3 1 but the odd and even bits have been put into 2 3 2 0 different words. The main trick is to remember that t=((l>>size)^r)&(mask); r^=t; l^=(t<<size); can be used to swap and move bits between words. So l = 0 1 2 3 r = 16 17 18 19 4 5 6 7 20 21 22 23 8 9 10 11 24 25 26 27 12 13 14 15 28 29 30 31 becomes (for size == 2 and mask == 0x3333) t = 2^16 3^17 -- -- l = 0 1 16 17 r = 2 3 18 19 6^20 7^21 -- -- 4 5 20 21 6 7 22 23 10^24 11^25 -- -- 8 9 24 25 10 11 24 25 14^28 15^29 -- -- 12 13 28 29 14 15 28 29 Thanks for hints from Richard Outerbridge - he told me IP&FP could be done in 15 xor, 10 shifts and 5 ands. When I finally started to think of the problem in 2D I first got ~42 operations without xors. When I remembered how to use xors :-) I got it to its final state. */ #define PERM_OP(a,b,t,n,m) ((t)=((((a)>>(n))^(b))&(m)),\ (b)^=(t),\ (a)^=((t)<<(n))) static unsigned char *key7TOkey8(unsigned char *key7, unsigned char *key8) { int i; key8[0] = ((key7[0] >> 1) & 0xff); key8[1] = ((((key7[0] & 0x01) << 6) | (((key7[1] & 0xff) >> 2) & 0xff)) & 0xff); key8[2] = ((((key7[1] & 0x03) << 5) | (((key7[2] & 0xff) >> 3) & 0xff)) & 0xff); key8[3] = ((((key7[2] & 0x07) << 4) | (((key7[3] & 0xff) >> 4) & 0xff)) & 0xff); key8[4] = ((((key7[3] & 0x0F) << 3) | (((key7[4] & 0xff) >> 5) & 0xff)) & 0xff); key8[5] = ((((key7[4] & 0x1F) << 2) | (((key7[5] & 0xff) >> 6) & 0xff)) & 0xff); key8[6] = ((((key7[5] & 0x3F) << 1) | (((key7[6] & 0xff) >> 7) & 0xff)) & 0xff); key8[7] = (key7[6] & 0x7F); for (i = 0; i < 8; i++) { key8[i] = (key8[i] << 1); } return (unsigned char *)key8; } static unsigned char DES_Keys[128] __attribute__((aligned(64))); /* * des_create_keys: take 64bit user key (key) as input and outputs * 16 48bit keys (keys) */ static unsigned char *DES_createkeys(unsigned char *key) { unsigned long c, d, t, s; unsigned char *in; unsigned long *k; unsigned char k8[8]; int i; static unsigned char shifts[16] = { 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0 }; key7TOkey8(key, k8); k = (unsigned long *)DES_Keys; in = (unsigned char *)k8; c2l(in, c); c2l(in, d); /* I now do it in 47 simple operations :-) * Thanks to John Fletcher ([email protected]) * for the inspiration. :-) */ PERM_OP (d,c,t,4,0x0f0f0f0f); HPERM_OP(c,t,-2,0xcccc0000); HPERM_OP(d,t,-2,0xcccc0000); PERM_OP (d,c,t,1,0x55555555); PERM_OP (c,d,t,8,0x00ff00ff); PERM_OP (d,c,t,1,0x55555555); d = (((d & 0x000000ff) << 16) | (d & 0x0000ff00) | ((d & 0x00ff0000) >> 16) | ((c & 0xf0000000) >> 4)); c&=0x0fffffff; for (i=0; i<ITERATIONS; i++) { if (shifts[i]) { c = ((c >> 2)|(c << 26)); d = ((d >> 2)|(d << 26)); } else { c = ((c >> 1)|(c << 27)); d = ((d >> 1)|(d << 27)); } c &= 0x0fffffff; d &= 0x0fffffff; /* could be a few less shifts but I am to lazy at this * point in time to investigate */ s = des_skb[0][ (c ) & 0x3f ] | des_skb[1][((c >> 6) & 0x03) | ((c >> 7) & 0x3c)] | des_skb[2][((c >> 13) & 0x0f) | ((c >> 14) & 0x30)] | des_skb[3][((c >> 20) & 0x01) | ((c >> 21) & 0x06) | ((c >> 22) & 0x38)]; t = des_skb[4][ (d ) & 0x3f ] | des_skb[5][((d >> 7) & 0x03) | ((d >> 8) & 0x3c)] | des_skb[6][ (d >> 15) & 0x3f ] | des_skb[7][((d >> 21) & 0x0f) | ((d >> 22) & 0x30)]; /* table contained 0213 4657 */ *(k++) = ((t << 16) | (s & 0x0000ffff)) & 0xffffffff; s = ((s >> 16) | (t & 0xffff0000)); s = (s << 4) | (s >> 28); *(k++) = s & 0xffffffff; } return (unsigned char *)DES_Keys; } unsigned char *DES(unsigned char *key, unsigned char *message, unsigned char *cipher) { unsigned long l, r, t, u; int i; unsigned long *s; unsigned char *keys; keys = DES_createkeys(key); c2l(message, l); /* get endian free long from input block */ c2l(message, r); /* get endian free long from input block */ /* do IP */ PERM_OP(r,l,t, 4,0x0f0f0f0f); PERM_OP(l,r,t,16,0x0000ffff); PERM_OP(r,l,t, 2,0x33333333); PERM_OP(l,r,t, 8,0x00ff00ff); PERM_OP(r,l,t, 1,0x55555555); /* r and l are reversed - remember that :-) - fix * it in the next step */ /* Things have been modified so that the initial rotate is * done outside the loop. This required the * des_SPtrans values in sp.h to be rotated 1 bit to the right. * One perl script later and things have a 5% speed up on a sparc2. * Thanks to Richard Outerbridge <[email protected]> * for pointing this out. */ t = (r << 1) | (r >> 31); r = (l << 1) | (l >> 31); l = t; /* clear the top bits on machines with 8byte longs */ l &= 0xffffffff; r &= 0xffffffff; s = (unsigned long *)keys; /* I don't know if it is worth the effort of loop unrolling the * inner loop */ for (i=0; i<32; i+=4) { D_ENCRYPT(l,r,i+0); /* 1 */ D_ENCRYPT(r,l,i+2); /* 2 */ } l = (l >> 1) | (l << 31); r = (r >> 1) | (r << 31); /* clear the top bits on machines with 8byte longs */ l &= 0xffffffff; r &= 0xffffffff; /* swap l and r * we will not do the swap so just remember they are * reversed for the rest of the subroutine * luckily FP fixes this problem :-) */ PERM_OP(r,l,t, 1,0x55555555); PERM_OP(l,r,t, 8,0x00ff00ff); PERM_OP(r,l,t, 2,0x33333333); PERM_OP(l,r,t,16,0x0000ffff); PERM_OP(r,l,t, 4,0x0f0f0f0f); l2c(l, cipher); /* get endian free long from input block */ l2c(r, cipher); /* get endian free long from input block */ return (unsigned char *)cipher; }
the_stack_data/173578903.c
#include <stdio.h> int main() { long N; long sum = 0; long a[3000]; scanf("%ld\n", &N); for(int i = 0; i < N; i++) { scanf("%ld", &a[i]); } for(int i = 0; i < N ; i++) { sum += a[i] - 1; } printf("%ld\n", sum); return 0; }
the_stack_data/41692.c
#include <assert.h> #include <stdio.h> #include <string.h> #include <time.h> int main() { char buf[32]; clock_t tc = clock(); struct tm ts1; time_t tt1, tt2; static char * dstr = "Sun Dec 2 06:55:15 1979\n"; tt1 = time(&tt2); assert(tt1 == tt2); ts1.tm_sec = 15; ts1.tm_min = 55; ts1.tm_hour = 6; ts1.tm_mday = 2; ts1.tm_mon = 11; ts1.tm_year = 79; ts1.tm_isdst = -1; #if !defined(_SUNOS) /* hack for bloody non standard SUNOS system */ tt1 = mktime(&ts1); assert(ts1.tm_wday == 0); assert(ts1.tm_yday == 335); ++ts1.tm_sec; tt2 = mktime(&ts1); #else tt1 = 312926115; tt2 = 312926116; #endif assert(difftime(tt1,tt2) < 0.0); assert(strcmp(asctime(localtime(&tt1)),dstr) == 0); assert(strftime(buf, sizeof(buf),"%S",gmtime(&tt2)) == 2); assert(strcmp(buf,"16") == 0); assert(tc <= clock()); /* fputs("Current date -- ", stdout); time(&tt1); fputs(ctime(&tt1),stdout); */ return 0; } #ifdef EiCTeStS main(); #endif
the_stack_data/126704277.c
extern void abort(void); __attribute__ ((noinline)) int foo(int n) { if (n < 0) n = ~n; return n; } int main(void) { if (foo (-1) != 0) abort (); return 0; }
the_stack_data/149323.c
/* { dg-do compile } */ /* { dg-options "-O2 -fdump-ipa-icf" } */ #include <stdio.h> __attribute__ ((noinline)) int fce1(int a, int b) { int swap; if(a < b) { swap = a; a = b; b = swap; } return a / b; } __attribute__ ((noinline)) int fce2(int x, int y) { int tmp; if(x < y) { tmp = x; x = y; y = tmp; } return x / y; } int main(int argc, char **argv) { printf("fce1: %d\n", fce1(argc, argc + 2)); printf("fce2: %d\n", fce2(argc, 2 * argc)); } /* { dg-final { scan-ipa-dump "Semantic equality hit:fce1->fce2" "icf" } } */ /* { dg-final { scan-ipa-dump "Equal symbols: 1" "icf" } } */
the_stack_data/111077655.c
/* * $Id: editbox.c,v 1.70 2018/06/19 22:57:01 tom Exp $ * * editbox.c -- implements the edit box * * Copyright 2007-2016,2018 Thomas E. Dickey * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License, version 2.1 * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to * Free Software Foundation, Inc. * 51 Franklin St., Fifth Floor * Boston, MA 02110, USA. */ #include <dialog.h> #include <dlg_keys.h> #include <sys/stat.h> #define sTEXT -1 static void fail_list(void) { dlg_exiterr("File too large"); } static void grow_list(char ***list, int *have, int want) { if (want > *have) { size_t last = (size_t) *have; size_t need = (size_t) (want | 31) + 3; *have = (int) need; (*list) = dlg_realloc(char *, need, *list); if ((*list) == 0) { fail_list(); } else { while (++last < need) { (*list)[last] = 0; } } } } static void load_list(const char *file, char ***list, int *rows) { FILE *fp; char *blob = 0; struct stat sb; unsigned n, pass; unsigned need; size_t size; *list = 0; *rows = 0; if (stat(file, &sb) < 0 || (sb.st_mode & S_IFMT) != S_IFREG) dlg_exiterr("Not a file: %s", file); size = (size_t) sb.st_size; if ((blob = dlg_malloc(char, size + 2)) == 0) { fail_list(); } else { blob[size] = '\0'; if ((fp = fopen(file, "r")) == 0) dlg_exiterr("Cannot open: %s", file); size = fread(blob, sizeof(char), size, fp); fclose(fp); /* * If the file is not empty, ensure that it ends with a newline. */ if (size != 0 && blob[size - 1] != '\n') { blob[++size - 1] = '\n'; blob[size] = '\0'; } for (pass = 0; pass < 2; ++pass) { int first = TRUE; need = 0; for (n = 0; n < size; ++n) { if (first && pass) { (*list)[need] = blob + n; first = FALSE; } if (blob[n] == '\n') { first = TRUE; ++need; if (pass) blob[n] = '\0'; } } if (pass) { if (need == 0) { (*list)[0] = dlg_strclone(""); (*list)[1] = 0; } else { for (n = 0; n < need; ++n) { (*list)[n] = dlg_strclone((*list)[n]); } (*list)[need] = 0; } } else { grow_list(list, rows, (int) need + 1); } } free(blob); } } static void free_list(char ***list, int *rows) { if (*list != 0) { int n; for (n = 0; n < (*rows); ++n) { if ((*list)[n] != 0) free((*list)[n]); } free(*list); *list = 0; } *rows = 0; } /* * Display a single row in the editing window: * thisrow is the actual row number that's being displayed. * show_row is the row number that's highlighted for edit. * base_row is the first row number in the window */ static bool display_one(WINDOW *win, char *text, int thisrow, int show_row, int base_row, int chr_offset) { bool result; if (text != 0) { dlg_show_string(win, text, chr_offset, ((thisrow == show_row) ? form_active_text_attr : form_text_attr), thisrow - base_row, 0, getmaxx(win), FALSE, FALSE); result = TRUE; } else { result = FALSE; } return result; } static void display_all(WINDOW *win, char **list, int show_row, int firstrow, int lastrow, int chr_offset) { int limit = getmaxy(win); int row; dlg_attr_clear(win, getmaxy(win), getmaxx(win), dialog_attr); if (lastrow - firstrow >= limit) lastrow = firstrow + limit; for (row = firstrow; row < lastrow; ++row) { if (!display_one(win, list[row], row, show_row, firstrow, (row == show_row) ? chr_offset : 0)) break; } } static int size_list(char **list) { int result = 0; if (list != 0) { while (*list++ != 0) { ++result; } } return result; } static bool scroll_to(int pagesize, int rows, int *base_row, int *this_row, int target) { bool result = FALSE; if (target < *base_row) { if (target < 0) { if (*base_row == 0 && *this_row == 0) { beep(); } else { *this_row = 0; *base_row = 0; result = TRUE; } } else { *this_row = target; *base_row = target; result = TRUE; } } else if (target >= rows) { if (*this_row < rows - 1) { *this_row = rows - 1; *base_row = rows - 1; result = TRUE; } else { beep(); } } else if (target >= *base_row + pagesize) { *this_row = target; *base_row = target; result = TRUE; } else { *this_row = target; result = FALSE; } if (pagesize < rows) { if (*base_row + pagesize >= rows) { *base_row = rows - pagesize; } } else { *base_row = 0; } return result; } static int col_to_chr_offset(const char *text, int col) { const int *cols = dlg_index_columns(text); const int *indx = dlg_index_wchars(text); bool found = FALSE; int result = 0; unsigned n; unsigned len = (unsigned) dlg_count_wchars(text); for (n = 0; n < len; ++n) { if (cols[n] <= col && cols[n + 1] > col) { result = indx[n]; found = TRUE; break; } } if (!found && len && cols[len] == col) { result = indx[len]; } return result; } #define SCROLL_TO(target) show_all = scroll_to(pagesize, listsize, &base_row, &thisrow, target) #define PREV_ROW (*list)[thisrow - 1] #define THIS_ROW (*list)[thisrow] #define NEXT_ROW (*list)[thisrow + 1] #define UPDATE_COL(input) col_offset = dlg_edit_offset(input, chr_offset, box_width) static int widest_line(char **list) { int result = MAX_LEN; char *value; if (list != 0) { while ((value = *list++) != 0) { int check = (int) strlen(value); if (check > result) result = check; } } return result; } #define NAVIGATE_BINDINGS \ DLG_KEYS_DATA( DLGK_GRID_DOWN, KEY_DOWN ), \ DLG_KEYS_DATA( DLGK_GRID_RIGHT, KEY_RIGHT ), \ DLG_KEYS_DATA( DLGK_GRID_LEFT, KEY_LEFT ), \ DLG_KEYS_DATA( DLGK_GRID_UP, KEY_UP ), \ DLG_KEYS_DATA( DLGK_FIELD_NEXT, TAB ), \ DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_BTAB ), \ DLG_KEYS_DATA( DLGK_PAGE_FIRST, KEY_HOME ), \ DLG_KEYS_DATA( DLGK_PAGE_LAST, KEY_END ), \ DLG_KEYS_DATA( DLGK_PAGE_LAST, KEY_LL ), \ DLG_KEYS_DATA( DLGK_PAGE_NEXT, KEY_NPAGE ), \ DLG_KEYS_DATA( DLGK_PAGE_NEXT, DLGK_MOUSE(KEY_NPAGE) ), \ DLG_KEYS_DATA( DLGK_PAGE_PREV, KEY_PPAGE ), \ DLG_KEYS_DATA( DLGK_PAGE_PREV, DLGK_MOUSE(KEY_PPAGE) ) /* * Display a dialog box for editing a copy of a file */ int dlg_editbox(const char *title, char ***list, int *rows, int height, int width) { /* *INDENT-OFF* */ static DLG_KEYS_BINDING binding[] = { HELPKEY_BINDINGS, ENTERKEY_BINDINGS, NAVIGATE_BINDINGS, TOGGLEKEY_BINDINGS, END_KEYS_BINDING }; static DLG_KEYS_BINDING binding2[] = { INPUTSTR_BINDINGS, HELPKEY_BINDINGS, ENTERKEY_BINDINGS, NAVIGATE_BINDINGS, /* no TOGGLEKEY_BINDINGS, since that includes space... */ END_KEYS_BINDING }; /* *INDENT-ON* */ #ifdef KEY_RESIZE int old_height = height; int old_width = width; #endif int x, y, box_y, box_x, box_height, box_width; int show_buttons; int thisrow, base_row, lastrow; int goal_col = -1; int col_offset = 0; int chr_offset = 0; int key, fkey, code; int pagesize; int listsize = size_list(*list); int result = DLG_EXIT_UNKNOWN; int state; size_t max_len = (size_t) dlg_max_input(widest_line(*list)); char *input, *buffer; bool show_all, show_one, was_mouse; bool first_trace = TRUE; WINDOW *dialog; WINDOW *editing; DIALOG_VARS save_vars; const char **buttons = dlg_ok_labels(); int mincols = (3 * COLS / 4); DLG_TRACE(("# editbox args:\n")); DLG_TRACE2S("title", title); /* FIXME dump the rows & list */ DLG_TRACE2N("height", height); DLG_TRACE2N("width", width); dlg_save_vars(&save_vars); dialog_vars.separate_output = TRUE; dlg_does_output(); buffer = dlg_malloc(char, max_len + 1); assert_ptr(buffer, "dlg_editbox"); thisrow = base_row = lastrow = 0; #ifdef KEY_RESIZE retry: #endif show_buttons = TRUE; state = dialog_vars.default_button >= 0 ? dlg_default_button() : sTEXT; fkey = 0; dlg_button_layout(buttons, &mincols); dlg_auto_size(title, "", &height, &width, 3 * LINES / 4, mincols); dlg_print_size(height, width); dlg_ctl_size(height, width); x = dlg_box_x_ordinate(width); y = dlg_box_y_ordinate(height); dialog = dlg_new_window(height, width, y, x); dlg_register_window(dialog, "editbox", binding); dlg_register_buttons(dialog, "editbox", buttons); dlg_mouse_setbase(x, y); dlg_draw_box2(dialog, 0, 0, height, width, dialog_attr, border_attr, border2_attr); dlg_draw_bottom_box2(dialog, border_attr, border2_attr, dialog_attr); dlg_draw_title(dialog, title); dlg_attrset(dialog, dialog_attr); /* Draw the editing field in a box */ box_y = MARGIN + 0; box_x = MARGIN + 1; box_width = width - 2 - (2 * MARGIN); box_height = height - (4 * MARGIN); dlg_draw_box(dialog, box_y, box_x, box_height, box_width, border_attr, border2_attr); dlg_mouse_mkbigregion(box_y + MARGIN, box_x + MARGIN, box_height - (2 * MARGIN), box_width - (2 * MARGIN), KEY_MAX, 1, 1, 3); editing = dlg_sub_window(dialog, box_height - (2 * MARGIN), box_width - (2 * MARGIN), getbegy(dialog) + box_y + 1, getbegx(dialog) + box_x + 1); dlg_register_window(editing, "editbox2", binding2); show_all = TRUE; show_one = FALSE; pagesize = getmaxy(editing); while (result == DLG_EXIT_UNKNOWN) { int edit = 0; if (show_all) { display_all(editing, *list, thisrow, base_row, listsize, chr_offset); display_one(editing, THIS_ROW, thisrow, thisrow, base_row, chr_offset); show_all = FALSE; show_one = TRUE; } else { if (thisrow != lastrow) { display_one(editing, (*list)[lastrow], lastrow, thisrow, base_row, 0); show_one = TRUE; } } if (show_one) { display_one(editing, THIS_ROW, thisrow, thisrow, base_row, chr_offset); getyx(editing, y, x); dlg_draw_scrollbar(dialog, base_row, base_row, base_row + pagesize, listsize, box_x, box_x + getmaxx(editing), box_y + 0, box_y + getmaxy(editing) + 1, border2_attr, border_attr); wmove(editing, y, x); show_one = FALSE; } lastrow = thisrow; input = THIS_ROW; /* * The last field drawn determines where the cursor is shown: */ if (show_buttons) { show_buttons = FALSE; UPDATE_COL(input); if (state != sTEXT) { display_one(editing, input, thisrow, -1, base_row, 0); wrefresh(editing); } dlg_draw_buttons(dialog, height - 2, 0, buttons, (state != sTEXT) ? state : 99, FALSE, width); if (state == sTEXT) { display_one(editing, input, thisrow, thisrow, base_row, chr_offset); } } if (first_trace) { first_trace = FALSE; dlg_trace_win(dialog); } key = dlg_mouse_wgetch((state == sTEXT) ? editing : dialog, &fkey); if (key == ERR) { result = DLG_EXIT_ERROR; break; } else if (key == ESC) { result = DLG_EXIT_ESC; break; } if (state != sTEXT) { if (dlg_result_key(key, fkey, &result)) break; } was_mouse = (fkey && is_DLGK_MOUSE(key)); if (was_mouse) key -= M_EVENT; /* * Handle mouse clicks first, since we want to know if this is a * button, or something that dlg_edit_string() should handle. */ if (fkey && was_mouse && (code = dlg_ok_buttoncode(key)) >= 0) { result = code; continue; } if (was_mouse && (key >= KEY_MAX)) { int wide = getmaxx(editing); int cell = key - KEY_MAX; int check = (cell / wide) + base_row; if (check < listsize) { thisrow = check; col_offset = (cell % wide); chr_offset = col_to_chr_offset(THIS_ROW, col_offset); show_one = TRUE; if (state != sTEXT) { state = sTEXT; show_buttons = TRUE; } } else { beep(); } continue; } else if (was_mouse && key >= KEY_MIN) { key = dlg_lookup_key(dialog, key, &fkey); } if (state == sTEXT) { /* editing box selected */ /* * Intercept scrolling keys that dlg_edit_string() does not * understand. */ if (fkey) { bool moved = TRUE; switch (key) { case DLGK_GRID_UP: SCROLL_TO(thisrow - 1); break; case DLGK_GRID_DOWN: SCROLL_TO(thisrow + 1); break; case DLGK_PAGE_FIRST: SCROLL_TO(0); break; case DLGK_PAGE_LAST: SCROLL_TO(listsize); break; case DLGK_PAGE_NEXT: SCROLL_TO(base_row + pagesize); break; case DLGK_PAGE_PREV: if (thisrow > base_row) { SCROLL_TO(base_row); } else { SCROLL_TO(base_row - pagesize); } break; case DLGK_DELETE_LEFT: if (chr_offset == 0) { if (thisrow == 0) { beep(); } else { size_t len = (strlen(THIS_ROW) + strlen(PREV_ROW) + 1); char *tmp = dlg_malloc(char, len); assert_ptr(tmp, "dlg_editbox"); chr_offset = dlg_count_wchars(PREV_ROW); UPDATE_COL(PREV_ROW); goal_col = col_offset; sprintf(tmp, "%s%s", PREV_ROW, THIS_ROW); if (len > max_len) tmp[max_len] = '\0'; free(PREV_ROW); PREV_ROW = tmp; for (y = thisrow; y < listsize; ++y) { (*list)[y] = (*list)[y + 1]; } --listsize; --thisrow; SCROLL_TO(thisrow); show_all = TRUE; } } else { /* dlg_edit_string() can handle this case */ moved = FALSE; } break; default: moved = FALSE; break; } if (moved) { if (thisrow != lastrow) { if (goal_col < 0) goal_col = col_offset; chr_offset = col_to_chr_offset(THIS_ROW, goal_col); } else { UPDATE_COL(THIS_ROW); } continue; } } strncpy(buffer, input, max_len - 1)[max_len - 1] = '\0'; edit = dlg_edit_string(buffer, &chr_offset, key, fkey, FALSE); if (edit) { goal_col = UPDATE_COL(input); if (strcmp(input, buffer)) { free(input); THIS_ROW = dlg_strclone(buffer); input = THIS_ROW; } display_one(editing, input, thisrow, thisrow, base_row, chr_offset); continue; } } /* handle non-functionkeys */ if (!fkey && (code = dlg_char_to_button(key, buttons)) >= 0) { dlg_del_window(dialog); result = dlg_ok_buttoncode(code); continue; } /* handle functionkeys */ if (fkey) { switch (key) { case DLGK_GRID_UP: case DLGK_GRID_LEFT: case DLGK_FIELD_PREV: show_buttons = TRUE; state = dlg_prev_ok_buttonindex(state, sTEXT); break; case DLGK_GRID_RIGHT: case DLGK_GRID_DOWN: case DLGK_FIELD_NEXT: show_buttons = TRUE; state = dlg_next_ok_buttonindex(state, sTEXT); break; case DLGK_ENTER: if (state == sTEXT) { const int *indx = dlg_index_wchars(THIS_ROW); int split = indx[chr_offset]; char *tmp = dlg_strclone(THIS_ROW + split); assert_ptr(tmp, "dlg_editbox"); grow_list(list, rows, listsize + 1); ++listsize; for (y = listsize; y > thisrow; --y) { (*list)[y] = (*list)[y - 1]; } THIS_ROW[split] = '\0'; ++thisrow; chr_offset = 0; col_offset = 0; THIS_ROW = tmp; SCROLL_TO(thisrow); show_all = TRUE; } else { result = dlg_ok_buttoncode(state); } break; #ifdef KEY_RESIZE case KEY_RESIZE: dlg_will_resize(dialog); /* reset data */ height = old_height; width = old_width; dlg_clear(); dlg_unregister_window(editing); dlg_del_window(editing); dlg_del_window(dialog); dlg_mouse_free_regions(); /* repaint */ goto retry; #endif case DLGK_TOGGLE: if (state != sTEXT) { result = dlg_ok_buttoncode(state); } else { beep(); } break; default: beep(); break; } } else { beep(); } } dlg_unregister_window(editing); dlg_del_window(editing); dlg_del_window(dialog); dlg_mouse_free_regions(); /* * The caller's copy of the (*list)[] array has been updated, but for * consistency with the other widgets, we put the "real" result in * the output buffer. */ if (result == DLG_EXIT_OK) { int n; for (n = 0; n < listsize; ++n) { dlg_add_result((*list)[n]); dlg_add_separator(); } dlg_add_last_key(-1); } free(buffer); dlg_restore_vars(&save_vars); return result; } int dialog_editbox(const char *title, const char *file, int height, int width) { int result; char **list; int rows; load_list(file, &list, &rows); result = dlg_editbox(title, &list, &rows, height, width); free_list(&list, &rows); return result; }
the_stack_data/309171.c
/* * 示例1 **/ #include <stdio.h> #include <stdlib.h> #include <regex.h> int main(int argc, char **argv) { int ret, i; regex_t reg; regmatch_t pmatch[1]; size_t nmatch = 1; const char *pattern = "^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(.[a-zA-Z0-9_-]+)+$"; char *text = "[email protected]"; ret = regcomp(&reg, pattern, REG_EXTENDED); if (ret != 0) { printf("regcomp failed"); exit(EXIT_FAILURE); } ret = regexec(&reg, text, nmatch, pmatch, 0); if (ret == REG_NOMATCH) { printf("NOMATCH\n"); }else if (ret == 0){ printf("MATCH\n"); for (i = pmatch[0].rm_so; i < pmatch[0].rm_eo; ++i) putchar(text[i]); printf("\n"); } regfree(&reg); return 0; }
the_stack_data/9512026.c
#include <math.h> #include <stdio.h> double f(const double x) { return x == 0 ? 1 : sin(x) / x; } int main(void) { const double a = -20, b = 20; // Intervallo asse x const int n = 100; // Numero intervalli int c = 0; // Contatore zeri double xl, xr, // Estremi intervallo k-esimo dx; dx = (b - a) / n; for (int k = 0; k < n; k++) { xl = a + k * dx; xr = xl + dx; if (f(xl) * f(xr) <= 0) { c++; printf("k = %d\txl = %f\txr = %f\n", k, xl, xr); } } printf("Numero zeri: %d", c); }
the_stack_data/248580831.c
#include <stdio.h> #include <arpa/inet.h> #include <sys/types.h> #include <sys/socket.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #define PUERTO 4950 #define MAXBUFF 512 void codificarCadena(char *cadena, int offset); int main(int argc, char *argv[]){ /* Declaramos las variables a utilizar */ struct sockaddr_in dirServer, dirClient; int descSocket, nuevoDescSocket, bytes; socklen_t longDirCliente; /* Inicializamos la direccion del servidor */ memset(&dirServer, 0, sizeof(dirServer)); dirServer.sin_family = AF_INET; dirServer.sin_addr.s_addr = INADDR_ANY; /* Acepta conexiones de cualquier IP */ dirServer.sin_port = htons(PUERTO); longDirCliente = sizeof(dirClient); /* Creamos el socket */ descSocket = socket(AF_INET, SOCK_STREAM, 0); if(descSocket < 0){ perror("No se ha podido abrir el socket"); exit(-1); } /* Vinculamos el proceso con el puerto de escucha indicado en la variable dirServer */ if(bind(descSocket, (struct sockaddr *) &dirServer, sizeof(dirServer)) < 0){ perror("Error al vincular el proceso con el puerto"); exit(-1); } if(listen(descSocket, 5) < 0){ /* Activamos el modo pasivo con una cola maxima de 5 */ perror("Error al entrar en modo pasivo"); exit(-1); } /* Bucle principal */ while(1){ printf("Servidor esperando conexion...\n"); /* Esperamos una conexion de un cliente. Dicha conexion nos es devuelta en nuevoDescSocket */ nuevoDescSocket = accept(descSocket, (struct sockaddr *) &dirClient, &longDirCliente); printf("Nueva conexion aceptada!\n"); while(1){ if(nuevoDescSocket < 0){ perror("Accept"); close(descSocket); exit(-1); } /* Ya se ha aceptado la conexion del cliente */ /* Declaramos las variables a utilizar */ int longitud, leidos; uint16_t longitudBE; char buffer[MAXBUFF]; /* Recibimos la longitud de la cadena primero */ bytes = recv(nuevoDescSocket, &longitudBE, sizeof(longitudBE), 0); if(bytes < 0){ perror("Error al recibir la longitud"); close(nuevoDescSocket); close(descSocket); exit(-1); } if(bytes == 0){ printf("Cliente desconectado. Recibir longitud.\n"); close(nuevoDescSocket); break; } else if (bytes != sizeof(longitudBE)){ perror("Error al recibir la longitud"); close(nuevoDescSocket); close(descSocket); exit(-1); } longitud = ntohs(longitudBE); printf("Longitud recibida: %d\n", longitud); /* Ahora recibimos la cadena */ bytes = recv(nuevoDescSocket, buffer, longitud, 0); if((bytes != longitud)){ perror("Error al recibir la cadena"); close(nuevoDescSocket); close(descSocket); exit(-1); } if(bytes == 0){ printf("Cliente desconectado. Recibir cadena.\n"); close(nuevoDescSocket); break; } else if (bytes != longitud){ perror("Error al recibir la cadena"); close(nuevoDescSocket); close(descSocket); exit(-1); } buffer[longitud] = '\0'; printf("Cadena recibida: %s\n", buffer); /* La codificamos */ codificarCadena(buffer, atoi(argv[1])); /* Anyadimos el sufijo y ajustamos la longitud */ strcat(buffer, "123"); longitud += 3; printf("Longitud enviada: %d\n", longitud); /* Enviamos la nueva longitud */ longitudBE = htons(longitud); if((bytes = write(nuevoDescSocket, &longitudBE, sizeof(longitudBE))) < 0){ perror("Error al enviar longitud"); close(nuevoDescSocket); close(descSocket); exit(-1); } else if( bytes == 0){ printf("Cliente desconectado\n"); close(nuevoDescSocket); break; }else if (bytes != sizeof(longitudBE)){ perror("Error al enviar longitud"); close(nuevoDescSocket); close(descSocket); exit(-1); } /* Ahora enviamos la cadena codificada */ if((bytes = write(nuevoDescSocket, buffer, longitud)) < 0){ perror("Error al enviar cadena"); close(nuevoDescSocket); close(descSocket); exit(-1); }else if( bytes == 0){ printf("Cliente desconectado\n"); close(nuevoDescSocket); break; }else if (bytes != longitud){ perror("Error al enviar cadena"); close(nuevoDescSocket); close(descSocket); exit(-1); } printf("Cadena enviada: %s\n", buffer); }/* Fin de while(1) */ }/* Fin de while(1) */ }/* Fin de main() */ void codificarCadena(char *cadena, int offset){ for(int i = 0; i < strlen(cadena); i++){ cadena[i] += offset; } }
the_stack_data/20451330.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 long input[1] , unsigned long 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 long input[1] ; unsigned long output[1] ; int randomFuns_i5 ; unsigned long 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 = strtoul(argv[randomFuns_i5 + 1], 0, 10); input[randomFuns_i5] = randomFuns_value6; randomFuns_i5 ++; } RandomFunc(input, output); if (output[0] == 4242424242UL) { printf("You win!\n"); } else { } randomFuns_main_i7 = 0; while (randomFuns_main_i7 < 1) { printf("%lu\n", output[randomFuns_main_i7]); randomFuns_main_i7 ++; } } } void megaInit(void) { { } } void RandomFunc(unsigned long input[1] , unsigned long output[1] ) { unsigned long state[1] ; unsigned long local1 ; unsigned int copy12 ; { state[0UL] = input[0UL] ^ 700325083UL; local1 = 0UL; while (local1 < 1UL) { if (state[0UL] != local1) { state[local1] = state[0UL] << (((state[0UL] >> 2UL) & 7UL) | 1UL); state[0UL] = state[local1] >> (((state[local1] >> 1UL) & 7UL) | 1UL); } else { copy12 = *((unsigned int *)(& state[local1]) + 0); *((unsigned int *)(& state[local1]) + 0) = *((unsigned int *)(& state[local1]) + 1); *((unsigned int *)(& state[local1]) + 1) = copy12; copy12 = *((unsigned int *)(& state[local1]) + 1); *((unsigned int *)(& state[local1]) + 1) = *((unsigned int *)(& state[local1]) + 0); *((unsigned int *)(& state[local1]) + 0) = copy12; } local1 += 2UL; } output[0UL] = (state[0UL] & 387166272UL) & 913307615UL; } }
the_stack_data/1030319.c
#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <stdint.h> #define nil NULL #define nul '\0' static const uint8_t debugging = 0; #define debugln if(debugging) printf("here %d\n", __LINE__) /* using a flat list of memory references * right now; would be neat to use something * like a HAMT or even just an AVL/BTree * for this, but for a simple test, it's easy * to start here. */ typedef struct MLIST { void *object; size_t size; struct MLIST *next; uint32_t count; } MList; /* technically, I could just * create a global, but this * way I can have "regions". * besides, this is just a test, * mostly to see if I can get * rid of Boehm in compiling * carML/c */ static int acall = 0, retcall = 0, relcall = 0, wcall = 0; MList *init(); void printstats(void *, MList *); void *rcalloc(size_t, MList *); void retain(void *, MList *); void release(void *, MList *); void *weakalloc(size_t, MList *); void clean(MList *); /* actual testing stuffs. */ typedef enum LTYPE { LINT, LSTRING, LNIL, LLIST } ListType; /* I know this is a strange * structure to use for a cons-cell, * but as this is a test I don't really * care all that much. */ typedef struct ULIST { ListType type; union { int i; char *s; struct ULIST *l; } object; size_t olength; size_t length; struct ULIST *next; } UList; UList *str2lst(char *, size_t, MList *); UList *int2lst(int, MList *); UList *cons(UList *, UList *, MList *); UList *car(UList *); UList *cdr(UList *); void walk(UList *); void print(UList *); int main() { char *t0 = nil, *t1 = nil, *ctmp = nil, dummy; int tmp = 0; size_t len = 0; MList *region = nil; UList *userdata = nil, *tmpnode = nil; debugln; region = init(); debugln; t0 = (char *) weakalloc(sizeof(char) * 128, region); // we turn around & retain in str2lst, so... debugln; t1 = (char *) weakalloc(sizeof(char) * 128, region); // we turn around & retain in str2lst, so... debugln; if(debugging) { printf("t0 stats: \n"); printstats(t0, region); printf("t1 stats: \n"); printstats(t1, region); } printf("Enter a string: "); ctmp = fgets(t0, 128, stdin); len = strnlen(t0, 128); t0[len - 1] = nul; printf("you entered: %s\n", t0); tmpnode = str2lst(t0, sizeof(char) * 128, region); userdata = cons(tmpnode, nil, region); while(tmp != -1) { printf("Enter an integer: "); scanf("%d", &tmp); if(tmp != -1) { tmpnode = int2lst(tmp, region); userdata = cons(tmpnode, userdata, region); } } scanf("%c", &dummy); if(debugging) { printf("t1 == nil? %s\n", t1 == nil ? "yes" : "no"); } printf("Enter a string: "); ctmp = fgets(t1, 128, stdin); len = strnlen(t1, 128); t1[len - 1] = nul; if(debugging) { if(ctmp == nil) { printf("fgets(3) returned nil!\n"); } else if(feof(stdin)) { printf("error on stdin?"); } else { printf("should have entered a string... but didn't?\n"); } printf("strlens: %lu and %lu\n", strnlen(t0, 128), strnlen(t1, 128)); } tmpnode = str2lst(t1, sizeof(char) * 128, region); userdata = cons(tmpnode, userdata, region); printf("allocated chars should work like normal strings:\n"); printf("t0: %s\nt1: %s\n", t0, t1); printf("We should be able to walk that list too:\n"); walk(userdata); tmpnode = userdata; while(tmpnode != nil) { tmpnode = car(userdata); userdata = cdr(userdata); release(tmpnode, region); } release(t0, region); release(t1, region); printf("\nsome statistics: \n"); printf("allocation calls: %d\n", acall); printf("weak allocation calls: %d\n", wcall); printf("retain calls: %d\n", retcall); printf("release calls: %d\n", relcall); clean(region); return 0; } MList *init(){ MList *tmp = (MList *)malloc(sizeof(MList)); tmp->object = nil; tmp->size = 0; tmp->next = nil; tmp->count = -1; return tmp; } void printstats(void *object, MList *region) { uint8_t flag = 0; MList *tmp = region; printf("printing stats for %p\n", object); while(tmp != nil) { if(tmp-> object == object) { flag = 1; printf("size: %lu\n", tmp->size); } tmp = tmp->next; } if(!flag) { printf("object not found\n"); } } void * rcalloc(size_t sze, MList *region) { MList *tmp = region; void *data = nil; acall += 1; while(tmp->next != nil) { tmp = tmp->next; } tmp->next = (MList *)malloc(sizeof(MList)); tmp = tmp->next; tmp->next = nil; tmp->count = 1; tmp->size = sze; data = malloc(sze); if(debugging) { printf("allocated %p and %p\n", tmp, data); } tmp->object = data; return data; } void retain(void *object, MList *region) { MList *tmp = region; retcall += 1; while(tmp != nil) { if(tmp->object == object) { tmp->count += 1; break; } tmp = tmp->next; } } void release(void *object, MList * region) { MList *tortoise = region, *hare = region; relcall += 1; while(hare != nil) { if(hare->object == object) { hare->count -= 1; if(hare->count <= 0) { tortoise->next = hare->next; if(debugging) { printf("freeing two hares: %p and %p\n", hare, hare->object); } free(hare->object); free(hare); break; } } tortoise = hare; hare = hare->next; } } void * weakalloc(size_t sze, MList *region) { MList *tmp = region; void *data = nil; wcall += 1; debugln; while(tmp->next != nil) { tmp = tmp->next; } debugln; tmp->next = (MList *)malloc(sizeof(MList)); tmp = tmp->next; tmp->next = nil; tmp->count = 0; tmp->size = sze; debugln; data = malloc(sze); tmp->object = data; debugln; if(debugging) { printf("weakly allocated %p and %p\n", tmp, data); } return data; } void clean(MList *region) { MList *tmp = region, *tmp0; while(tmp != nil) { tmp0 = tmp; tmp = tmp->next; if(debugging) { printf("cleaning two objects: %p and %p\n", tmp0, tmp0->object); } if(tmp0->object != nil && tmp0->size > 0) { free(tmp0->object); } free(tmp0); } } UList * str2lst(char * str, size_t sze, MList *region) { UList *cell = (UList *)rcalloc(sizeof(UList), region); retain(str, region); cell->type = LSTRING; cell->object.s = str; return cell; } UList * int2lst(int i, MList *region) { UList *cell = (UList *)rcalloc(sizeof(UList), region); cell->type = LINT; cell->object.i = i; return cell; } UList * cons(UList *hd, UList *tl, MList *region) { UList *cell = rcalloc(sizeof(UList), region); cell->type = LLIST; cell->object.l = hd; cell->next = tl; return cell; } UList * car(UList *hd) { if(hd != nil && hd->type == LLIST) { return hd->object.l; } return nil; } UList * cdr(UList *hd) { if(hd != nil && hd->type == LLIST) { return hd->next; } return nil; } void walk(UList *hd) { UList *tmp = hd; if(tmp->type != LLIST) { return; } printf("("); while(tmp != nil) { print(tmp->object.l); if(tmp->next != nil) { printf(" "); } tmp = tmp->next; } printf(")"); } void print(UList *hd){ if(hd->type == LINT) { printf("%d", hd->object.i); } else if(hd->type == LSTRING) { printf("\"%s\"", hd->object.s); } else { walk(hd->object.l); } }
the_stack_data/237642448.c
#include <unistd.h> #include <stdint.h> #define RIGHT 1 #define LEFT -1 char* matching_bracket(char* string, int way) { int state; state = 0; do { if (*string == '[') state++; else if (*string == ']') state--; string += way; } while (state != 0); return (string - way); } void interpret_brainfuck(char* source_code, uint8_t* buffer) { char instruction; while ((instruction = *source_code) != '\0') { switch (instruction) { case '+': (*buffer)++; break; case '-': (*buffer)--; break; case '>': buffer++; break; case '<': buffer--; break; case '.': write(1, buffer, 1); break; case '[': if (*buffer == 0) source_code = matching_bracket(source_code, RIGHT); break; case ']': if (*buffer != 0) source_code = matching_bracket(source_code, LEFT); break; } source_code++; } } int main(int ac, char** av) { uint8_t buffer[2048]; if (ac > 1) { unsigned i = sizeof buffer / sizeof *buffer; while (i --> 0) buffer[i] = 0; interpret_brainfuck(av[1], buffer); } else write(1, "\n", 1); return (0); }
the_stack_data/321621.c
#ifndef TH_GENERIC_FILE #define TH_GENERIC_FILE "generic/image.c" #else #undef MAX #define MAX(a,b) ( ((a)>(b)) ? (a) : (b) ) #undef MIN #define MIN(a,b) ( ((a)<(b)) ? (a) : (b) ) #undef TAPI #define TAPI __declspec(dllimport) #ifndef M_PI #define M_PI 3.14159265358979323846 #endif static void image_(Main_op_validate)( lua_State *L, THTensor *Tsrc, THTensor *Tdst){ long src_depth = 1; long dst_depth = 1; luaL_argcheck(L, Tsrc->nDimension==2 || Tsrc->nDimension==3, 1, "rotate: src not 2 or 3 dimensional"); luaL_argcheck(L, Tdst->nDimension==2 || Tdst->nDimension==3, 2, "rotate: dst not 2 or 3 dimensional"); if(Tdst->nDimension == 3) dst_depth = Tdst->size[0]; if(Tsrc->nDimension == 3) src_depth = Tsrc->size[0]; if( (Tdst->nDimension==3 && ( src_depth!=dst_depth)) || (Tdst->nDimension!=Tsrc->nDimension) ) luaL_error(L, "image.scale: src and dst depths do not match"); if( Tdst->nDimension==3 && ( src_depth!=dst_depth) ) luaL_error(L, "image.scale: src and dst depths do not match"); } static long image_(Main_op_stride)( THTensor *T,int i){ if (T->nDimension == 2) { if (i == 0) return 0; else return T->stride[i-1]; } return T->stride[i]; } static long image_(Main_op_depth)( THTensor *T){ if(T->nDimension == 3) return T->size[0]; /* rgb or rgba */ return 1; /* greyscale */ } static void image_(Main_scaleLinear_rowcol)(THTensor *Tsrc, THTensor *Tdst, long src_start, long dst_start, long src_stride, long dst_stride, long src_len, long dst_len ) { real *src= THTensor_(data)(Tsrc); real *dst= THTensor_(data)(Tdst); if ( dst_len > src_len ){ long di; float si_f; long si_i; float scale = (float)(src_len - 1) / (dst_len - 1); if ( src_len == 1 ) { for( di = 0; di < dst_len - 1; di++ ) { long dst_pos = dst_start + di*dst_stride; dst[dst_pos] = src[ src_start ]; } } else { for( di = 0; di < dst_len - 1; di++ ) { long dst_pos = dst_start + di*dst_stride; si_f = di * scale; si_i = (long)si_f; si_f -= si_i; dst[dst_pos] = (1 - si_f) * src[ src_start + si_i * src_stride ] + si_f * src[ src_start + (si_i + 1) * src_stride ]; } } dst[ dst_start + (dst_len - 1) * dst_stride ] = src[ src_start + (src_len - 1) * src_stride ]; } else if ( dst_len < src_len ) { long di; long si0_i = 0; float si0_f = 0; long si1_i; float si1_f; long si; float scale = (float)src_len / dst_len; float acc, n; for( di = 0; di < dst_len; di++ ) { si1_f = (di + 1) * scale; si1_i = (long)si1_f; si1_f -= si1_i; acc = (1 - si0_f) * src[ src_start + si0_i * src_stride ]; n = 1 - si0_f; for( si = si0_i + 1; si < si1_i; si++ ) { acc += src[ src_start + si * src_stride ]; n += 1; } if( si1_i < src_len ) { acc += si1_f * src[ src_start + si1_i*src_stride ]; n += si1_f; } dst[ dst_start + di*dst_stride ] = acc / n; si0_i = si1_i; si0_f = si1_f; } } else { long i; for( i = 0; i < dst_len; i++ ) dst[ dst_start + i*dst_stride ] = src[ src_start + i*src_stride ]; } } static void image_(Main_scaleCubic_rowcol)(THTensor *Tsrc, THTensor *Tdst, long src_start, long dst_start, long src_stride, long dst_stride, long src_len, long dst_len ) { real *src= THTensor_(data)(Tsrc); real *dst= THTensor_(data)(Tdst); if ( dst_len == src_len ){ long i; for( i = 0; i < dst_len; i++ ) dst[ dst_start + i*dst_stride ] = src[ src_start + i*src_stride ]; } else { long di; float si_f; long si_i; float scale; if (dst_len == 1) scale = (float)(src_len - 1); else scale = (float)(src_len - 1) / (dst_len - 1); for( di = 0; di < dst_len - 1; di++ ) { long dst_pos = dst_start + di*dst_stride; si_f = di * scale; si_i = (long)si_f; si_f -= si_i; real p0; real p1 = src[ src_start + si_i * src_stride ]; real p2 = src[ src_start + (si_i + 1) * src_stride ]; real p3; if (si_i > 0) { p0 = src[ src_start + (si_i - 1) * src_stride ]; } else { p0 = 2*p1 - p2; } if (si_i + 2 < src_len) { p3 = src[ src_start + (si_i + 2) * src_stride ]; } else { p3 = 2*p2 - p1; } real a0 = p1; real a1 = -(real)1/(real)2*p0 + (real)1/(real)2*p2; real a2 = p0 - (real)5/(real)2*p1 + (real)2*p2 - (real)1/(real)2*p3; real a3 = -(real)1/(real)2*p0 + (real)3/(real)2*p1 - (real)3/(real)2*p2 + (real)1/(real)2*p3; dst[dst_pos] = a0 + si_f * (a1 + si_f * (a2 + a3 * si_f)); } dst[ dst_start + (dst_len - 1) * dst_stride ] = src[ src_start + (src_len - 1) * src_stride ]; } } static int image_(Main_scaleBilinear)(lua_State *L) { THTensor *Tsrc = luaT_checkudata(L, 1, torch_Tensor); THTensor *Tdst = luaT_checkudata(L, 2, torch_Tensor); THTensor *Ttmp; long dst_stride0, dst_stride1, dst_stride2, dst_width, dst_height; long src_stride0, src_stride1, src_stride2, src_width, src_height; long tmp_stride0, tmp_stride1, tmp_stride2, tmp_width, tmp_height; long i, j, k; image_(Main_op_validate)(L, Tsrc,Tdst); int ndims; if (Tdst->nDimension == 3) ndims = 3; else ndims = 2; Ttmp = THTensor_(newWithSize2d)(Tsrc->size[ndims-2], Tdst->size[ndims-1]); dst_stride0= image_(Main_op_stride)(Tdst,0); dst_stride1= image_(Main_op_stride)(Tdst,1); dst_stride2= image_(Main_op_stride)(Tdst,2); src_stride0= image_(Main_op_stride)(Tsrc,0); src_stride1= image_(Main_op_stride)(Tsrc,1); src_stride2= image_(Main_op_stride)(Tsrc,2); tmp_stride0= image_(Main_op_stride)(Ttmp,0); tmp_stride1= image_(Main_op_stride)(Ttmp,1); tmp_stride2= image_(Main_op_stride)(Ttmp,2); dst_width= Tdst->size[ndims-1]; dst_height= Tdst->size[ndims-2]; src_width= Tsrc->size[ndims-1]; src_height= Tsrc->size[ndims-2]; tmp_width= Ttmp->size[1]; tmp_height= Ttmp->size[0]; for(k=0;k<image_(Main_op_depth)(Tsrc);k++) { /* compress/expand rows first */ for(j = 0; j < src_height; j++) { image_(Main_scaleLinear_rowcol)(Tsrc, Ttmp, 0*src_stride2+j*src_stride1+k*src_stride0, 0*tmp_stride2+j*tmp_stride1+k*tmp_stride0, src_stride2, tmp_stride2, src_width, tmp_width ); } /* then columns */ for(i = 0; i < dst_width; i++) { image_(Main_scaleLinear_rowcol)(Ttmp, Tdst, i*tmp_stride2+0*tmp_stride1+k*tmp_stride0, i*dst_stride2+0*dst_stride1+k*dst_stride0, tmp_stride1, dst_stride1, tmp_height, dst_height ); } } THTensor_(free)(Ttmp); return 0; } static int image_(Main_scaleBicubic)(lua_State *L) { THTensor *Tsrc = luaT_checkudata(L, 1, torch_Tensor); THTensor *Tdst = luaT_checkudata(L, 2, torch_Tensor); THTensor *Ttmp; long dst_stride0, dst_stride1, dst_stride2, dst_width, dst_height; long src_stride0, src_stride1, src_stride2, src_width, src_height; long tmp_stride0, tmp_stride1, tmp_stride2, tmp_width, tmp_height; long i, j, k; image_(Main_op_validate)(L, Tsrc,Tdst); int ndims; if (Tdst->nDimension == 3) ndims = 3; else ndims = 2; Ttmp = THTensor_(newWithSize2d)(Tsrc->size[ndims-2], Tdst->size[ndims-1]); dst_stride0= image_(Main_op_stride)(Tdst,0); dst_stride1= image_(Main_op_stride)(Tdst,1); dst_stride2= image_(Main_op_stride)(Tdst,2); src_stride0= image_(Main_op_stride)(Tsrc,0); src_stride1= image_(Main_op_stride)(Tsrc,1); src_stride2= image_(Main_op_stride)(Tsrc,2); tmp_stride0= image_(Main_op_stride)(Ttmp,0); tmp_stride1= image_(Main_op_stride)(Ttmp,1); tmp_stride2= image_(Main_op_stride)(Ttmp,2); dst_width= Tdst->size[ndims-1]; dst_height= Tdst->size[ndims-2]; src_width= Tsrc->size[ndims-1]; src_height= Tsrc->size[ndims-2]; tmp_width= Ttmp->size[1]; tmp_height= Ttmp->size[0]; for(k=0;k<image_(Main_op_depth)(Tsrc);k++) { /* compress/expand rows first */ for(j = 0; j < src_height; j++) { image_(Main_scaleCubic_rowcol)(Tsrc, Ttmp, 0*src_stride2+j*src_stride1+k*src_stride0, 0*tmp_stride2+j*tmp_stride1+k*tmp_stride0, src_stride2, tmp_stride2, src_width, tmp_width ); } /* then columns */ for(i = 0; i < dst_width; i++) { image_(Main_scaleCubic_rowcol)(Ttmp, Tdst, i*tmp_stride2+0*tmp_stride1+k*tmp_stride0, i*dst_stride2+0*dst_stride1+k*dst_stride0, tmp_stride1, dst_stride1, tmp_height, dst_height ); } } THTensor_(free)(Ttmp); return 0; } static int image_(Main_scaleSimple)(lua_State *L) { THTensor *Tsrc = luaT_checkudata(L, 1, torch_Tensor); THTensor *Tdst = luaT_checkudata(L, 2, torch_Tensor); real *src, *dst; long dst_stride0, dst_stride1, dst_stride2, dst_width, dst_height, dst_depth; long src_stride0, src_stride1, src_stride2, src_width, src_height, src_depth; long i, j, k; float scx, scy; luaL_argcheck(L, Tsrc->nDimension==2 || Tsrc->nDimension==3, 1, "image.scale: src not 2 or 3 dimensional"); luaL_argcheck(L, Tdst->nDimension==2 || Tdst->nDimension==3, 2, "image.scale: dst not 2 or 3 dimensional"); src= THTensor_(data)(Tsrc); dst= THTensor_(data)(Tdst); dst_stride0 = 0; dst_stride1 = Tdst->stride[Tdst->nDimension-2]; dst_stride2 = Tdst->stride[Tdst->nDimension-1]; dst_depth = 0; dst_height = Tdst->size[Tdst->nDimension-2]; dst_width = Tdst->size[Tdst->nDimension-1]; if(Tdst->nDimension == 3) { dst_stride0 = Tdst->stride[0]; dst_depth = Tdst->size[0]; } src_stride0 = 0; src_stride1 = Tsrc->stride[Tsrc->nDimension-2]; src_stride2 = Tsrc->stride[Tsrc->nDimension-1]; src_depth = 0; src_height = Tsrc->size[Tsrc->nDimension-2]; src_width = Tsrc->size[Tsrc->nDimension-1]; if(Tsrc->nDimension == 3) { src_stride0 = Tsrc->stride[0]; src_depth = Tsrc->size[0]; } if( (Tdst->nDimension==3 && ( src_depth!=dst_depth)) || (Tdst->nDimension!=Tsrc->nDimension) ) { printf("image.scale:%d,%d,%ld,%ld\n",Tsrc->nDimension,Tdst->nDimension,src_depth,dst_depth); luaL_error(L, "image.scale: src and dst depths do not match"); } if( Tdst->nDimension==3 && ( src_depth!=dst_depth) ) luaL_error(L, "image.scale: src and dst depths do not match"); /* printf("%d,%d -> %d,%d\n",src_width,src_height,dst_width,dst_height); */ scx=((float)src_width)/((float)dst_width); scy=((float)src_height)/((float)dst_height); #pragma omp parallel for private(j, i, k) for(j = 0; j < dst_height; j++) { for(i = 0; i < dst_width; i++) { float val = 0.0; long ii=(long) (((float)i)*scx); long jj=(long) (((float)j)*scy); if(ii>src_width-1) ii=src_width-1; if(jj>src_height-1) jj=src_height-1; if(Tsrc->nDimension==2) { val=src[ii*src_stride2+jj*src_stride1]; dst[i*dst_stride2+j*dst_stride1] = val; } else { for(k=0;k<src_depth;k++) { val=src[ii*src_stride2+jj*src_stride1+k*src_stride0]; dst[i*dst_stride2+j*dst_stride1+k*dst_stride0] = val; } } } } return 0; } static int image_(Main_rotate)(lua_State *L) { THTensor *Tsrc = luaT_checkudata(L, 1, torch_Tensor); THTensor *Tdst = luaT_checkudata(L, 2, torch_Tensor); float theta = luaL_checknumber(L, 3); float cos_theta, sin_theta; real *src, *dst; long dst_stride0, dst_stride1, dst_stride2, dst_width, dst_height, dst_depth; long src_stride0, src_stride1, src_stride2, src_width, src_height, src_depth; long i, j, k; float xc, yc; float id,jd; long ii,jj; luaL_argcheck(L, Tsrc->nDimension==2 || Tsrc->nDimension==3, 1, "rotate: src not 2 or 3 dimensional"); luaL_argcheck(L, Tdst->nDimension==2 || Tdst->nDimension==3, 2, "rotate: dst not 2 or 3 dimensional"); src= THTensor_(data)(Tsrc); dst= THTensor_(data)(Tdst); if (dst == src) { luaL_error(L, "image.rotate: in-place rotate not supported"); } dst_stride0 = 0; dst_stride1 = Tdst->stride[Tdst->nDimension-2]; dst_stride2 = Tdst->stride[Tdst->nDimension-1]; dst_depth = 0; dst_height = Tdst->size[Tdst->nDimension-2]; dst_width = Tdst->size[Tdst->nDimension-1]; if(Tdst->nDimension == 3) { dst_stride0 = Tdst->stride[0]; dst_depth = Tdst->size[0]; } src_stride0 = 0; src_stride1 = Tsrc->stride[Tsrc->nDimension-2]; src_stride2 = Tsrc->stride[Tsrc->nDimension-1]; src_depth = 0; src_height = Tsrc->size[Tsrc->nDimension-2]; src_width = Tsrc->size[Tsrc->nDimension-1]; if(Tsrc->nDimension == 3) { src_stride0 = Tsrc->stride[0]; src_depth = Tsrc->size[0]; } if( Tsrc->nDimension==3 && Tdst->nDimension==3 && ( src_depth!=dst_depth) ) luaL_error(L, "image.rotate: src and dst depths do not match"); if( (Tsrc->nDimension!=Tdst->nDimension) ) luaL_error(L, "image.rotate: src and dst depths do not match"); xc = (src_width-1)/2.0; yc = (src_height-1)/2.0; sin_theta = sin(theta); cos_theta = cos(theta); for(j = 0; j < dst_height; j++) { jd=j; for(i = 0; i < dst_width; i++) { float val = -1; id= i; ii = (long) round(cos_theta*(id-xc) - sin_theta*(jd-yc) + xc); jj = (long) round(cos_theta*(jd-yc) + sin_theta*(id-xc) + yc); /* rotated corners are blank */ if(ii>src_width-1) val=0; if(jj>src_height-1) val=0; if(ii<0) val=0; if(jj<0) val=0; if(Tsrc->nDimension==2) { if(val==-1) val=src[ii*src_stride2+jj*src_stride1]; dst[i*dst_stride2+j*dst_stride1] = val; } else { int do_copy=0; if(val==-1) do_copy=1; for(k=0;k<src_depth;k++) { if(do_copy) val=src[ii*src_stride2+jj*src_stride1+k*src_stride0]; dst[i*dst_stride2+j*dst_stride1+k*dst_stride0] = val; } } } } return 0; } static int image_(Main_rotateBilinear)(lua_State *L) { THTensor *Tsrc = luaT_checkudata(L, 1, torch_Tensor); THTensor *Tdst = luaT_checkudata(L, 2, torch_Tensor); float theta = luaL_checknumber(L, 3); real *src, *dst; long dst_stride0, dst_stride1, dst_stride2, dst_width, dst_height, dst_depth; long src_stride0, src_stride1, src_stride2, src_width, src_height, src_depth; long i, j, k; float xc, yc; float id,jd; long ii_0, ii_1, jj_0, jj_1; luaL_argcheck(L, Tsrc->nDimension==2 || Tsrc->nDimension==3, 1, "rotate: src not 2 or 3 dimensional"); luaL_argcheck(L, Tdst->nDimension==2 || Tdst->nDimension==3, 2, "rotate: dst not 2 or 3 dimensional"); src= THTensor_(data)(Tsrc); dst= THTensor_(data)(Tdst); if (dst == src) { luaL_error(L, "image.rotate: in-place rotate not supported"); } dst_stride0 = 0; dst_stride1 = Tdst->stride[Tdst->nDimension-2]; dst_stride2 = Tdst->stride[Tdst->nDimension-1]; dst_depth = 0; dst_height = Tdst->size[Tdst->nDimension-2]; dst_width = Tdst->size[Tdst->nDimension-1]; if(Tdst->nDimension == 3) { dst_stride0 = Tdst->stride[0]; dst_depth = Tdst->size[0]; } src_stride0 = 0; src_stride1 = Tsrc->stride[Tsrc->nDimension-2]; src_stride2 = Tsrc->stride[Tsrc->nDimension-1]; src_depth = 0; src_height = Tsrc->size[Tsrc->nDimension-2]; src_width = Tsrc->size[Tsrc->nDimension-1]; if(Tsrc->nDimension == 3) { src_stride0 = Tsrc->stride[0]; src_depth = Tsrc->size[0]; } if( Tsrc->nDimension==3 && Tdst->nDimension==3 && ( src_depth!=dst_depth) ) luaL_error(L, "image.rotate: src and dst depths do not match"); if( (Tsrc->nDimension!=Tdst->nDimension) ) luaL_error(L, "image.rotate: src and dst depths do not match"); xc = (src_width-1)/2.0; yc = (src_height-1)/2.0; for(j = 0; j < dst_height; j++) { jd=j; for(i = 0; i < dst_width; i++) { float val = -1; real ri, rj, wi, wj; id= i; ri = cos(theta)*(id-xc)-sin(theta)*(jd-yc); rj = cos(theta)*(jd-yc)+sin(theta)*(id-xc); ii_0 = (long)floor(ri+xc); ii_1 = ii_0 + 1; jj_0 = (long)floor(rj+yc); jj_1 = jj_0 + 1; wi = ri+xc-ii_0; wj = rj+yc-jj_0; /* default to the closest value when interpolating on image boundaries (either image pixel or 0) */ if(ii_1==src_width && wi<0.5) ii_1 = ii_0; else if(ii_1>=src_width) val=0; if(jj_1==src_height && wj<0.5) jj_1 = jj_0; else if(jj_1>=src_height) val=0; if(ii_0==-1 && wi>0.5) ii_0 = ii_1; else if(ii_0<0) val=0; if(jj_0==-1 && wj>0.5) jj_0 = jj_1; else if(jj_0<0) val=0; if(Tsrc->nDimension==2) { if(val==-1) val = (1.0 - wi) * (1.0 - wj) * src[ii_0*src_stride2+jj_0*src_stride1] + wi * (1.0 - wj) * src[ii_1*src_stride2+jj_0*src_stride1] + (1.0 - wi) * wj * src[ii_0*src_stride2+jj_1*src_stride1] + wi * wj * src[ii_1*src_stride2+jj_1*src_stride1]; dst[i*dst_stride2+j*dst_stride1] = val; } else { int do_copy=0; if(val==-1) do_copy=1; for(k=0;k<src_depth;k++) { if(do_copy) { val = (1.0 - wi) * (1.0 - wj) * src[ii_0*src_stride2+jj_0*src_stride1+k*src_stride0] + wi * (1.0 - wj) * src[ii_1*src_stride2+jj_0*src_stride1+k*src_stride0] + (1.0 - wi) * wj * src[ii_0*src_stride2+jj_1*src_stride1+k*src_stride0] + wi * wj * src[ii_1*src_stride2+jj_1*src_stride1+k*src_stride0]; } dst[i*dst_stride2+j*dst_stride1+k*dst_stride0] = val; } } } } return 0; } static int image_(Main_polar)(lua_State *L) { THTensor *Tsrc = luaT_checkudata(L, 1, torch_Tensor); THTensor *Tdst = luaT_checkudata(L, 2, torch_Tensor); float doFull = luaL_checknumber(L, 3); real *src, *dst; long dst_stride0, dst_stride1, dst_stride2, dst_width, dst_height, dst_depth; long src_stride0, src_stride1, src_stride2, src_width, src_height, src_depth; long i, j, k; float id, jd, a, r, m, midY, midX; long ii,jj; luaL_argcheck(L, Tsrc->nDimension==2 || Tsrc->nDimension==3, 1, "polar: src not 2 or 3 dimensional"); luaL_argcheck(L, Tdst->nDimension==2 || Tdst->nDimension==3, 2, "polar: dst not 2 or 3 dimensional"); src= THTensor_(data)(Tsrc); dst= THTensor_(data)(Tdst); dst_stride0 = 0; dst_stride1 = Tdst->stride[Tdst->nDimension-2]; dst_stride2 = Tdst->stride[Tdst->nDimension-1]; dst_depth = 0; dst_height = Tdst->size[Tdst->nDimension-2]; dst_width = Tdst->size[Tdst->nDimension-1]; if(Tdst->nDimension == 3) { dst_stride0 = Tdst->stride[0]; dst_depth = Tdst->size[0]; } src_stride0 = 0; src_stride1 = Tsrc->stride[Tsrc->nDimension-2]; src_stride2 = Tsrc->stride[Tsrc->nDimension-1]; src_depth = 0; src_height = Tsrc->size[Tsrc->nDimension-2]; src_width = Tsrc->size[Tsrc->nDimension-1]; if(Tsrc->nDimension == 3) { src_stride0 = Tsrc->stride[0]; src_depth = Tsrc->size[0]; } if( Tsrc->nDimension==3 && Tdst->nDimension==3 && ( src_depth!=dst_depth) ) { luaL_error(L, "image.polar: src and dst depths do not match"); } if( (Tsrc->nDimension!=Tdst->nDimension) ) { luaL_error(L, "image.polar: src and dst depths do not match"); } // compute maximum distance midY = (float) src_height / 2.0; midX = (float) src_width / 2.0; if(doFull == 1) { m = sqrt((float) src_width * (float) src_width + (float) src_height * (float) src_height) / 2.0; } else { m = (src_width < src_height) ? midX : midY; } // loop to fill polar image for(j = 0; j < dst_height; j++) { // orientation loop jd = (float) j; a = (2 * M_PI * jd) / (float) dst_height; // current angle for(i = 0; i < dst_width; i++) { // radius loop float val = -1; id = (float) i; r = (m * id) / (float) dst_width; // current distance jj = (long) floor( r * cos(a) + midY); // y-location in source image ii = (long) floor(-r * sin(a) + midX); // x-location in source image if(ii>src_width-1) val=0; if(jj>src_height-1) val=0; if(ii<0) val=0; if(jj<0) val=0; if(Tsrc->nDimension==2) { if(val==-1) val=src[ii*src_stride2+jj*src_stride1]; dst[i*dst_stride2+j*dst_stride1] = val; } else { int do_copy=0; if(val==-1) do_copy=1; for(k=0;k<src_depth;k++) { if(do_copy) val=src[ii*src_stride2+jj*src_stride1+k*src_stride0]; dst[i*dst_stride2+j*dst_stride1+k*dst_stride0] = val; } } } } return 0; } static int image_(Main_polarBilinear)(lua_State *L) { THTensor *Tsrc = luaT_checkudata(L, 1, torch_Tensor); THTensor *Tdst = luaT_checkudata(L, 2, torch_Tensor); float doFull = luaL_checknumber(L, 3); real *src, *dst; long dst_stride0, dst_stride1, dst_stride2, dst_width, dst_height, dst_depth; long src_stride0, src_stride1, src_stride2, src_width, src_height, src_depth; long i, j, k; float id, jd, a, r, m, midY, midX; long ii_0, ii_1, jj_0, jj_1; luaL_argcheck(L, Tsrc->nDimension==2 || Tsrc->nDimension==3, 1, "polar: src not 2 or 3 dimensional"); luaL_argcheck(L, Tdst->nDimension==2 || Tdst->nDimension==3, 2, "polar: dst not 2 or 3 dimensional"); src= THTensor_(data)(Tsrc); dst= THTensor_(data)(Tdst); dst_stride0 = 0; dst_stride1 = Tdst->stride[Tdst->nDimension-2]; dst_stride2 = Tdst->stride[Tdst->nDimension-1]; dst_depth = 0; dst_height = Tdst->size[Tdst->nDimension-2]; dst_width = Tdst->size[Tdst->nDimension-1]; if(Tdst->nDimension == 3) { dst_stride0 = Tdst->stride[0]; dst_depth = Tdst->size[0]; } src_stride0 = 0; src_stride1 = Tsrc->stride[Tsrc->nDimension-2]; src_stride2 = Tsrc->stride[Tsrc->nDimension-1]; src_depth = 0; src_height = Tsrc->size[Tsrc->nDimension-2]; src_width = Tsrc->size[Tsrc->nDimension-1]; if(Tsrc->nDimension == 3) { src_stride0 = Tsrc->stride[0]; src_depth = Tsrc->size[0]; } if( Tsrc->nDimension==3 && Tdst->nDimension==3 && ( src_depth!=dst_depth) ) { luaL_error(L, "image.polar: src and dst depths do not match"); } if( (Tsrc->nDimension!=Tdst->nDimension) ) { luaL_error(L, "image.polar: src and dst depths do not match"); } // compute maximum distance midY = (float) src_height / 2.0; midX = (float) src_width / 2.0; if(doFull == 1) { m = sqrt((float) src_width * (float) src_width + (float) src_height * (float) src_height) / 2.0; } else { m = (src_width < src_height) ? midX : midY; } // loop to fill polar image for(j = 0; j < dst_height; j++) { // orientation loop jd = (float) j; a = (2 * M_PI * jd) / (float) dst_height; // current angle for(i = 0; i < dst_width; i++) { // radius loop float val = -1; real ri, rj, wi, wj; id = (float) i; r = (m * id) / (float) dst_width; // current distance rj = r * cos(a) + midY; // y-location in source image ri = -r * sin(a) + midX; // x-location in source image ii_0=(long)floor(ri); ii_1=ii_0 + 1; jj_0=(long)floor(rj); jj_1=jj_0 + 1; wi = ri - ii_0; wj = rj - jj_0; // switch to nearest interpolation when bilinear is impossible if(ii_1>src_width-1 || jj_1>src_height-1 || ii_0<0 || jj_0<0) { if(ii_0>src_width-1) val=0; if(jj_0>src_height-1) val=0; if(ii_0<0) val=0; if(jj_0<0) val=0; if(Tsrc->nDimension==2) { if(val==-1) val=src[ii_0*src_stride2+jj_0*src_stride1]; dst[i*dst_stride2+j*dst_stride1] = val; } else { int do_copy=0; if(val==-1) do_copy=1; for(k=0;k<src_depth;k++) { if(do_copy) val=src[ii_0*src_stride2+jj_0*src_stride1+k*src_stride0]; dst[i*dst_stride2+j*dst_stride1+k*dst_stride0] = val; } } } // bilinear interpolation else { if(Tsrc->nDimension==2) { if(val==-1) val = (1.0 - wi) * (1.0 - wj) * src[ii_0*src_stride2+jj_0*src_stride1] + wi * (1.0 - wj) * src[ii_1*src_stride2+jj_0*src_stride1] + (1.0 - wi) * wj * src[ii_0*src_stride2+jj_1*src_stride1] + wi * wj * src[ii_1*src_stride2+jj_1*src_stride1]; dst[i*dst_stride2+j*dst_stride1] = val; } else { int do_copy=0; if(val==-1) do_copy=1; for(k=0;k<src_depth;k++) { if(do_copy) { val = (1.0 - wi) * (1.0 - wj) * src[ii_0*src_stride2+jj_0*src_stride1+k*src_stride0] + wi * (1.0 - wj) * src[ii_1*src_stride2+jj_0*src_stride1+k*src_stride0] + (1.0 - wi) * wj * src[ii_0*src_stride2+jj_1*src_stride1+k*src_stride0] + wi * wj * src[ii_1*src_stride2+jj_1*src_stride1+k*src_stride0]; } dst[i*dst_stride2+j*dst_stride1+k*dst_stride0] = val; } } } } } return 0; } static int image_(Main_logPolar)(lua_State *L) { THTensor *Tsrc = luaT_checkudata(L, 1, torch_Tensor); THTensor *Tdst = luaT_checkudata(L, 2, torch_Tensor); float doFull = luaL_checknumber(L, 3); real *src, *dst; long dst_stride0, dst_stride1, dst_stride2, dst_width, dst_height, dst_depth; long src_stride0, src_stride1, src_stride2, src_width, src_height, src_depth; long i, j, k; float id, jd, a, r, m, midY, midX, fw; long ii,jj; luaL_argcheck(L, Tsrc->nDimension==2 || Tsrc->nDimension==3, 1, "polar: src not 2 or 3 dimensional"); luaL_argcheck(L, Tdst->nDimension==2 || Tdst->nDimension==3, 2, "polar: dst not 2 or 3 dimensional"); src= THTensor_(data)(Tsrc); dst= THTensor_(data)(Tdst); dst_stride0 = 0; dst_stride1 = Tdst->stride[Tdst->nDimension-2]; dst_stride2 = Tdst->stride[Tdst->nDimension-1]; dst_depth = 0; dst_height = Tdst->size[Tdst->nDimension-2]; dst_width = Tdst->size[Tdst->nDimension-1]; if(Tdst->nDimension == 3) { dst_stride0 = Tdst->stride[0]; dst_depth = Tdst->size[0]; } src_stride0 = 0; src_stride1 = Tsrc->stride[Tsrc->nDimension-2]; src_stride2 = Tsrc->stride[Tsrc->nDimension-1]; src_depth = 0; src_height = Tsrc->size[Tsrc->nDimension-2]; src_width = Tsrc->size[Tsrc->nDimension-1]; if(Tsrc->nDimension == 3) { src_stride0 = Tsrc->stride[0]; src_depth = Tsrc->size[0]; } if( Tsrc->nDimension==3 && Tdst->nDimension==3 && ( src_depth!=dst_depth) ) { luaL_error(L, "image.polar: src and dst depths do not match"); } if( (Tsrc->nDimension!=Tdst->nDimension) ) { luaL_error(L, "image.polar: src and dst depths do not match"); } // compute maximum distance midY = (float) src_height / 2.0; midX = (float) src_width / 2.0; if(doFull == 1) { m = sqrt((float) src_width * (float) src_width + (float) src_height * (float) src_height) / 2.0; } else { m = (src_width < src_height) ? midX : midY; } // loop to fill polar image fw = log(m) / (float) dst_width; for(j = 0; j < dst_height; j++) { // orientation loop jd = (float) j; a = (2 * M_PI * jd) / (float) dst_height; // current angle for(i = 0; i < dst_width; i++) { // radius loop float val = -1; id = (float) i; r = exp(id * fw); jj = (long) floor( r * cos(a) + midY); // y-location in source image ii = (long) floor(-r * sin(a) + midX); // x-location in source image if(ii>src_width-1) val=0; if(jj>src_height-1) val=0; if(ii<0) val=0; if(jj<0) val=0; if(Tsrc->nDimension==2) { if(val==-1) val=src[ii*src_stride2+jj*src_stride1]; dst[i*dst_stride2+j*dst_stride1] = val; } else { int do_copy=0; if(val==-1) do_copy=1; for(k=0;k<src_depth;k++) { if(do_copy) val=src[ii*src_stride2+jj*src_stride1+k*src_stride0]; dst[i*dst_stride2+j*dst_stride1+k*dst_stride0] = val; } } } } return 0; } static int image_(Main_logPolarBilinear)(lua_State *L) { THTensor *Tsrc = luaT_checkudata(L, 1, torch_Tensor); THTensor *Tdst = luaT_checkudata(L, 2, torch_Tensor); float doFull = luaL_checknumber(L, 3); real *src, *dst; long dst_stride0, dst_stride1, dst_stride2, dst_width, dst_height, dst_depth; long src_stride0, src_stride1, src_stride2, src_width, src_height, src_depth; long i, j, k; float id, jd, a, r, m, midY, midX, fw; long ii_0, ii_1, jj_0, jj_1; luaL_argcheck(L, Tsrc->nDimension==2 || Tsrc->nDimension==3, 1, "polar: src not 2 or 3 dimensional"); luaL_argcheck(L, Tdst->nDimension==2 || Tdst->nDimension==3, 2, "polar: dst not 2 or 3 dimensional"); src= THTensor_(data)(Tsrc); dst= THTensor_(data)(Tdst); dst_stride0 = 0; dst_stride1 = Tdst->stride[Tdst->nDimension-2]; dst_stride2 = Tdst->stride[Tdst->nDimension-1]; dst_depth = 0; dst_height = Tdst->size[Tdst->nDimension-2]; dst_width = Tdst->size[Tdst->nDimension-1]; if(Tdst->nDimension == 3) { dst_stride0 = Tdst->stride[0]; dst_depth = Tdst->size[0]; } src_stride0 = 0; src_stride1 = Tsrc->stride[Tsrc->nDimension-2]; src_stride2 = Tsrc->stride[Tsrc->nDimension-1]; src_depth = 0; src_height = Tsrc->size[Tsrc->nDimension-2]; src_width = Tsrc->size[Tsrc->nDimension-1]; if(Tsrc->nDimension == 3) { src_stride0 = Tsrc->stride[0]; src_depth = Tsrc->size[0]; } if( Tsrc->nDimension==3 && Tdst->nDimension==3 && ( src_depth!=dst_depth) ) { luaL_error(L, "image.polar: src and dst depths do not match"); } if( (Tsrc->nDimension!=Tdst->nDimension) ) { luaL_error(L, "image.polar: src and dst depths do not match"); } // compute maximum distance midY = (float) src_height / 2.0; midX = (float) src_width / 2.0; if(doFull == 1) { m = sqrt((float) src_width * (float) src_width + (float) src_height * (float) src_height) / 2.0; } else { m = (src_width < src_height) ? midX : midY; } // loop to fill polar image fw = log(m) / (float) dst_width; for(j = 0; j < dst_height; j++) { // orientation loop jd = (float) j; a = (2 * M_PI * jd) / (float) dst_height; // current angle for(i = 0; i < dst_width; i++) { // radius loop float val = -1; real ri, rj, wi, wj; id = (float) i; r = exp(id * fw); rj = r * cos(a) + midY; // y-location in source image ri = -r * sin(a) + midX; // x-location in source image ii_0=(long)floor(ri); ii_1=ii_0 + 1; jj_0=(long)floor(rj); jj_1=jj_0 + 1; wi = ri - ii_0; wj = rj - jj_0; // switch to nearest interpolation when bilinear is impossible if(ii_1>src_width-1 || jj_1>src_height-1 || ii_0<0 || jj_0<0) { if(ii_0>src_width-1) val=0; if(jj_0>src_height-1) val=0; if(ii_0<0) val=0; if(jj_0<0) val=0; if(Tsrc->nDimension==2) { if(val==-1) val=src[ii_0*src_stride2+jj_0*src_stride1]; dst[i*dst_stride2+j*dst_stride1] = val; } else { int do_copy=0; if(val==-1) do_copy=1; for(k=0;k<src_depth;k++) { if(do_copy) val=src[ii_0*src_stride2+jj_0*src_stride1+k*src_stride0]; dst[i*dst_stride2+j*dst_stride1+k*dst_stride0] = val; } } } // bilinear interpolation else { if(Tsrc->nDimension==2) { if(val==-1) val = (1.0 - wi) * (1.0 - wj) * src[ii_0*src_stride2+jj_0*src_stride1] + wi * (1.0 - wj) * src[ii_1*src_stride2+jj_0*src_stride1] + (1.0 - wi) * wj * src[ii_0*src_stride2+jj_1*src_stride1] + wi * wj * src[ii_1*src_stride2+jj_1*src_stride1]; dst[i*dst_stride2+j*dst_stride1] = val; } else { int do_copy=0; if(val==-1) do_copy=1; for(k=0;k<src_depth;k++) { if(do_copy) { val = (1.0 - wi) * (1.0 - wj) * src[ii_0*src_stride2+jj_0*src_stride1+k*src_stride0] + wi * (1.0 - wj) * src[ii_1*src_stride2+jj_0*src_stride1+k*src_stride0] + (1.0 - wi) * wj * src[ii_0*src_stride2+jj_1*src_stride1+k*src_stride0] + wi * wj * src[ii_1*src_stride2+jj_1*src_stride1+k*src_stride0]; } dst[i*dst_stride2+j*dst_stride1+k*dst_stride0] = val; } } } } } return 0; } static int image_(Main_cropNoScale)(lua_State *L) { THTensor *Tsrc = luaT_checkudata(L, 1, torch_Tensor); THTensor *Tdst = luaT_checkudata(L, 2, torch_Tensor); long startx = luaL_checklong(L, 3); long starty = luaL_checklong(L, 4); real *src, *dst; long dst_stride0, dst_stride1, dst_stride2, dst_width, dst_height, dst_depth; long src_stride0, src_stride1, src_stride2, src_width, src_height, src_depth; long i, j, k; luaL_argcheck(L, Tsrc->nDimension==2 || Tsrc->nDimension==3, 1, "rotate: src not 2 or 3 dimensional"); luaL_argcheck(L, Tdst->nDimension==2 || Tdst->nDimension==3, 2, "rotate: dst not 2 or 3 dimensional"); src= THTensor_(data)(Tsrc); dst= THTensor_(data)(Tdst); dst_stride0 = 0; dst_stride1 = Tdst->stride[Tdst->nDimension-2]; dst_stride2 = Tdst->stride[Tdst->nDimension-1]; dst_depth = 0; dst_height = Tdst->size[Tdst->nDimension-2]; dst_width = Tdst->size[Tdst->nDimension-1]; if(Tdst->nDimension == 3) { dst_stride0 = Tdst->stride[0]; dst_depth = Tdst->size[0]; } src_stride0 = 0; src_stride1 = Tsrc->stride[Tsrc->nDimension-2]; src_stride2 = Tsrc->stride[Tsrc->nDimension-1]; src_depth = 0; src_height = Tsrc->size[Tsrc->nDimension-2]; src_width = Tsrc->size[Tsrc->nDimension-1]; if(Tsrc->nDimension == 3) { src_stride0 = Tsrc->stride[0]; src_depth = Tsrc->size[0]; } if( startx<0 || starty<0 || (startx+dst_width>src_width) || (starty+dst_height>src_height)) luaL_error(L, "image.crop: crop goes outside bounds of src"); if( Tdst->nDimension==3 && ( src_depth!=dst_depth) ) luaL_error(L, "image.crop: src and dst depths do not match"); for(j = 0; j < dst_height; j++) { for(i = 0; i < dst_width; i++) { float val = 0.0; long ii=i+startx; long jj=j+starty; if(Tsrc->nDimension==2) { val=src[ii*src_stride2+jj*src_stride1]; dst[i*dst_stride2+j*dst_stride1] = val; } else { for(k=0;k<src_depth;k++) { val=src[ii*src_stride2+jj*src_stride1+k*src_stride0]; dst[i*dst_stride2+j*dst_stride1+k*dst_stride0] = val; } } } } return 0; } static int image_(Main_translate)(lua_State *L) { THTensor *Tsrc = luaT_checkudata(L, 1, torch_Tensor); THTensor *Tdst = luaT_checkudata(L, 2, torch_Tensor); long shiftx = luaL_checklong(L, 3); long shifty = luaL_checklong(L, 4); real *src, *dst; long dst_stride0, dst_stride1, dst_stride2, dst_width, dst_height, dst_depth; long src_stride0, src_stride1, src_stride2, src_width, src_height, src_depth; long i, j, k; luaL_argcheck(L, Tsrc->nDimension==2 || Tsrc->nDimension==3, 1, "rotate: src not 2 or 3 dimensional"); luaL_argcheck(L, Tdst->nDimension==2 || Tdst->nDimension==3, 2, "rotate: dst not 2 or 3 dimensional"); src= THTensor_(data)(Tsrc); dst= THTensor_(data)(Tdst); dst_stride0 = 1; dst_stride1 = Tdst->stride[Tdst->nDimension-2]; dst_stride2 = Tdst->stride[Tdst->nDimension-1]; dst_depth = 1; dst_height = Tdst->size[Tdst->nDimension-2]; dst_width = Tdst->size[Tdst->nDimension-1]; if(Tdst->nDimension == 3) { dst_stride0 = Tdst->stride[0]; dst_depth = Tdst->size[0]; } src_stride0 = 1; src_stride1 = Tsrc->stride[Tsrc->nDimension-2]; src_stride2 = Tsrc->stride[Tsrc->nDimension-1]; src_depth = 1; src_height = Tsrc->size[Tsrc->nDimension-2]; src_width = Tsrc->size[Tsrc->nDimension-1]; if(Tsrc->nDimension == 3) { src_stride0 = Tsrc->stride[0]; src_depth = Tsrc->size[0]; } if( Tdst->nDimension==3 && ( src_depth!=dst_depth) ) luaL_error(L, "image.translate: src and dst depths do not match"); for(j = 0; j < src_height; j++) { for(i = 0; i < src_width; i++) { long ii=i+shiftx; long jj=j+shifty; // Check it's within destination bounds, else crop if(ii<dst_width && jj<dst_height && ii>=0 && jj>=0) { for(k=0;k<src_depth;k++) { dst[ii*dst_stride2+jj*dst_stride1+k*dst_stride0] = src[i*src_stride2+j*src_stride1+k*src_stride0]; } } } } return 0; } static int image_(Main_saturate)(lua_State *L) { THTensor *input = luaT_checkudata(L, 1, torch_Tensor); THTensor *output = input; TH_TENSOR_APPLY2(real, output, real, input, \ *output_data = (*input_data < 0) ? 0 : (*input_data > 1) ? 1 : *input_data;) return 1; } /* * Converts an RGB color value to HSL. Conversion formula * adapted from http://en.wikipedia.org/wiki/HSL_color_space. * Assumes r, g, and b are contained in the set [0, 1] and * returns h, s, and l in the set [0, 1]. */ int image_(Main_rgb2hsl)(lua_State *L) { THTensor *rgb = luaT_checkudata(L, 1, torch_Tensor); THTensor *hsl = luaT_checkudata(L, 2, torch_Tensor); int y,x; real r,g,b,h,s,l; for (y=0; y<rgb->size[1]; y++) { for (x=0; x<rgb->size[2]; x++) { // get Rgb r = THTensor_(get3d)(rgb, 0, y, x); g = THTensor_(get3d)(rgb, 1, y, x); b = THTensor_(get3d)(rgb, 2, y, x); real mx = max(max(r, g), b); real mn = min(min(r, g), b); h = (mx + mn) / 2; s = h; l = h; if(mx == mn) { h = 0; // achromatic s = 0; } else { real d = mx - mn; s = l > 0.5 ? d / (2 - mx - mn) : d / (mx + mn); if (mx == r) { h = (g - b) / d + (g < b ? 6 : 0); } else if (mx == g) { h = (b - r) / d + 2; } else { h = (r - g) / d + 4; } h /= 6; } // set hsl THTensor_(set3d)(hsl, 0, y, x, h); THTensor_(set3d)(hsl, 1, y, x, s); THTensor_(set3d)(hsl, 2, y, x, l); } } return 0; } // helper static inline real image_(hue2rgb)(real p, real q, real t) { if (t < 0.) t += 1; if (t > 1.) t -= 1; if (t < 1./6) return p + (q - p) * 6. * t; else if (t < 1./2) return q; else if (t < 2./3) return p + (q - p) * (2./3 - t) * 6.; else return p; } /* * Converts an HSL color value to RGB. Conversion formula * adapted from http://en.wikipedia.org/wiki/HSL_color_space. * Assumes h, s, and l are contained in the set [0, 1] and * returns r, g, and b in the set [0, 1]. */ int image_(Main_hsl2rgb)(lua_State *L) { THTensor *hsl = luaT_checkudata(L, 1, torch_Tensor); THTensor *rgb = luaT_checkudata(L, 2, torch_Tensor); int y,x; real r,g,b,h,s,l; for (y=0; y<hsl->size[1]; y++) { for (x=0; x<hsl->size[2]; x++) { // get hsl h = THTensor_(get3d)(hsl, 0, y, x); s = THTensor_(get3d)(hsl, 1, y, x); l = THTensor_(get3d)(hsl, 2, y, x); if(s == 0) { // achromatic r = l; g = l; b = l; } else { real q = (l < 0.5) ? (l * (1 + s)) : (l + s - l * s); real p = 2 * l - q; real hr = h + 1./3; real hg = h; real hb = h - 1./3; r = image_(hue2rgb)(p, q, hr); g = image_(hue2rgb)(p, q, hg); b = image_(hue2rgb)(p, q, hb); } // set rgb THTensor_(set3d)(rgb, 0, y, x, r); THTensor_(set3d)(rgb, 1, y, x, g); THTensor_(set3d)(rgb, 2, y, x, b); } } return 0; } /* * Converts an RGB color value to HSV. Conversion formula * adapted from http://en.wikipedia.org/wiki/HSV_color_space. * Assumes r, g, and b are contained in the set [0, 1] and * returns h, s, and v in the set [0, 1]. */ int image_(Main_rgb2hsv)(lua_State *L) { THTensor *rgb = luaT_checkudata(L, 1, torch_Tensor); THTensor *hsv = luaT_checkudata(L, 2, torch_Tensor); int y,x; real r,g,b,h,s,v; for (y=0; y<rgb->size[1]; y++) { for (x=0; x<rgb->size[2]; x++) { // get Rgb r = THTensor_(get3d)(rgb, 0, y, x); g = THTensor_(get3d)(rgb, 1, y, x); b = THTensor_(get3d)(rgb, 2, y, x); real mx = max(max(r, g), b); real mn = min(min(r, g), b); h = mx; v = mx; real d = mx - mn; s = (mx==0) ? 0 : d/mx; if(mx == mn) { h = 0; // achromatic } else { if (mx == r) { h = (g - b) / d + (g < b ? 6 : 0); } else if (mx == g) { h = (b - r) / d + 2; } else { h = (r - g) / d + 4; } h /= 6; } // set hsv THTensor_(set3d)(hsv, 0, y, x, h); THTensor_(set3d)(hsv, 1, y, x, s); THTensor_(set3d)(hsv, 2, y, x, v); } } return 0; } /* * Converts an HSV color value to RGB. Conversion formula * adapted from http://en.wikipedia.org/wiki/HSV_color_space. * Assumes h, s, and l are contained in the set [0, 1] and * returns r, g, and b in the set [0, 1]. */ int image_(Main_hsv2rgb)(lua_State *L) { THTensor *hsv = luaT_checkudata(L, 1, torch_Tensor); THTensor *rgb = luaT_checkudata(L, 2, torch_Tensor); int y,x; real r,g,b,h,s,v; for (y=0; y<hsv->size[1]; y++) { for (x=0; x<hsv->size[2]; x++) { // get hsv h = THTensor_(get3d)(hsv, 0, y, x); s = THTensor_(get3d)(hsv, 1, y, x); v = THTensor_(get3d)(hsv, 2, y, x); int i = floor(h*6.); real f = h*6-i; real p = v*(1-s); real q = v*(1-f*s); real t = v*(1-(1-f)*s); switch (i % 6) { case 0: r = v, g = t, b = p; break; case 1: r = q, g = v, b = p; break; case 2: r = p, g = v, b = t; break; case 3: r = p, g = q, b = v; break; case 4: r = t, g = p, b = v; break; case 5: r = v, g = p, b = q; break; default: r=0; g = 0, b = 0; break; } // set rgb THTensor_(set3d)(rgb, 0, y, x, r); THTensor_(set3d)(rgb, 1, y, x, g); THTensor_(set3d)(rgb, 2, y, x, b); } } return 0; } /* * Converts an sRGB color value to LAB. * Based on http://www.brucelindbloom.com/index.html?Equations.html. * Assumes r, g, and b are contained in the set [0, 1]. * LAB output is NOT restricted to [0, 1]! */ int image_(Main_rgb2lab)(lua_State *L) { THTensor *rgb = luaT_checkudata(L, 1, torch_Tensor); THTensor *lab = luaT_checkudata(L, 2, torch_Tensor); // CIE Standard double epsilon = 216.0/24389.0; double k = 24389.0/27.0; // D65 white point double xn = 0.950456; double zn = 1.088754; int y,x; real r,g,b,l,a,_b; for (y=0; y<rgb->size[1]; y++) { for (x=0; x<rgb->size[2]; x++) { // get RGB r = gamma_expand_sRGB(THTensor_(get3d)(rgb, 0, y, x)); g = gamma_expand_sRGB(THTensor_(get3d)(rgb, 1, y, x)); b = gamma_expand_sRGB(THTensor_(get3d)(rgb, 2, y, x)); // sRGB to XYZ double X = 0.412453 * r + 0.357580 * g + 0.180423 * b; double Y = 0.212671 * r + 0.715160 * g + 0.072169 * b; double Z = 0.019334 * r + 0.119193 * g + 0.950227 * b; // normalize for D65 white point X /= xn; Z /= zn; // XYZ normalized to CIE Lab double fx = X > epsilon ? pow(X, 1/3.0) : (k * X + 16)/116; double fy = Y > epsilon ? pow(Y, 1/3.0) : (k * Y + 16)/116; double fz = Z > epsilon ? pow(Z, 1/3.0) : (k * Z + 16)/116; l = 116 * fy - 16; a = 500 * (fx - fy); _b = 200 * (fy - fz); // set lab THTensor_(set3d)(lab, 0, y, x, l); THTensor_(set3d)(lab, 1, y, x, a); THTensor_(set3d)(lab, 2, y, x, _b); } } return 0; } /* * Converts an LAB color value to sRGB. * Based on http://www.brucelindbloom.com/index.html?Equations.html. * returns r, g, and b in the set [0, 1]. */ int image_(Main_lab2rgb)(lua_State *L) { THTensor *lab = luaT_checkudata(L, 1, torch_Tensor); THTensor *rgb = luaT_checkudata(L, 2, torch_Tensor); int y,x; real r,g,b,l,a,_b; // CIE Standard double epsilon = 216.0/24389.0; double k = 24389.0/27.0; // D65 white point double xn = 0.950456; double zn = 1.088754; for (y=0; y<lab->size[1]; y++) { for (x=0; x<lab->size[2]; x++) { // get lab l = THTensor_(get3d)(lab, 0, y, x); a = THTensor_(get3d)(lab, 1, y, x); _b = THTensor_(get3d)(lab, 2, y, x); // LAB to XYZ double fy = (l + 16) / 116; double fz = fy - _b / 200; double fx = (a / 500) + fy; double X = pow(fx, 3); if (X <= epsilon) X = (116 * fx - 16) / k; double Y = l > (k * epsilon) ? pow((l + 16) / 116, 3) : l/k; double Z = pow(fz, 3); if (Z <= epsilon) Z = (116 * fz - 16) / k; X *= xn; Z *= zn; // XYZ to sRGB r = 3.2404542 * X - 1.5371385 * Y - 0.4985314 * Z; g = -0.9692660 * X + 1.8760108 * Y + 0.0415560 * Z; b = 0.0556434 * X - 0.2040259 * Y + 1.0572252 * Z; // set rgb THTensor_(set3d)(rgb, 0, y, x, gamma_compress_sRGB(r)); THTensor_(set3d)(rgb, 1, y, x, gamma_compress_sRGB(g)); THTensor_(set3d)(rgb, 2, y, x, gamma_compress_sRGB(b)); } } return 0; } /* Vertically flip an image */ int image_(Main_vflip)(lua_State *L) { THTensor *dst = luaT_checkudata(L, 1, torch_Tensor); THTensor *src = luaT_checkudata(L, 2, torch_Tensor); int width = dst->size[2]; int height = dst->size[1]; int src_width = src->size[2]; int src_height = src->size[1]; int channels = dst->size[0]; long *is = src->stride; long *os = dst->stride; // get raw pointers real *dst_data = THTensor_(data)(dst); real *src_data = THTensor_(data)(src); long k, x, y; if (dst_data != src_data) { /* not in-place. * this branch could be removed by first duplicating the src into dst then doing inplace */ for(k=0; k<channels; k++) { for (y=0; y<height; y++) { for (x=0; x<width; x++) { dst_data[ k*os[0] + (height-1-y)*os[1] + x*os[2] ] = src_data[ k*is[0] + y*is[1] + x*is[2] ]; } } } } else { /* in-place */ real swap, * src_px, * dst_px; long half_height = height >> 1; for(k=0; k<channels; k++) { for (y=0; y < half_height; y++) { for (x=0; x<width; x++) { src_px = src_data + k*is[0] + y*is[1] + x*is[2]; dst_px = dst_data + k*is[0] + (height-1-y)*is[1] + x*is[2]; swap = *dst_px; *dst_px = *src_px; *src_px = swap; } } } } return 0; } /* Horizontally flip an image */ int image_(Main_hflip)(lua_State *L) { THTensor *dst = luaT_checkudata(L, 1, torch_Tensor); THTensor *src = luaT_checkudata(L, 2, torch_Tensor); int width = dst->size[2]; int height = dst->size[1]; int src_width = src->size[2]; int src_height = src->size[1]; int channels = dst->size[0]; long *is = src->stride; long *os = dst->stride; // get raw pointers real *dst_data = THTensor_(data)(dst); real *src_data = THTensor_(data)(src); long k, x, y; if (dst_data != src_data) { /* not in-place. * this branch could be removed by first duplicating the src into dst then doing inplace */ for(k=0; k<channels; k++) { for (y=0; y<height; y++) { for (x=0; x<width; x++) { dst_data[ k*os[0] + y*os[1] + (width-x-1)*os[2] ] = src_data[ k*is[0] + y*is[1] + x*is[2] ]; } } } } else { /* in-place */ real swap, * src_px, * dst_px; long half_width = width >> 1; for(k=0; k<channels; k++) { for (y=0; y < height; y++) { for (x=0; x<half_width; x++) { src_px = src_data + k*is[0] + y*is[1] + x*is[2]; dst_px = dst_data + k*is[0] + y*is[1] + (width-x-1)*is[2]; swap = *dst_px; *dst_px = *src_px; *src_px = swap; } } } } return 0; } /* flip an image along a specified dimension */ int image_(Main_flip)(lua_State *L) { THTensor *dst = luaT_checkudata(L, 1, torch_Tensor); THTensor *src = luaT_checkudata(L, 2, torch_Tensor); long flip_dim = luaL_checklong(L, 3); if (dst->nDimension != src->nDimension) { luaL_error(L, "image.flip: src and dst nDimension does not match"); } if (flip_dim < 1 || flip_dim > dst->nDimension) { luaL_error(L, "image.flip: flip_dim out of bounds"); } flip_dim--; // Make it zero indexed // get raw pointers real *dst_data = THTensor_(data)(dst); real *src_data = THTensor_(data)(src); if (dst_data == src_data) { luaL_error(L, "image.flip: in-place flip not supported"); } long size0 = dst->size[0]; long size1 = dst->size[1]; long size2 = dst->size[2]; long size3 = dst->size[3]; long size4 = dst->size[4]; long size_flip = dst->size[flip_dim]; if (src->size[0] != size0 || src->size[1] != size1 || src->size[2] != size2 || src->size[3] != size3 || src->size[4] != size4) { luaL_error(L, "image.flip: src and dst are not the same size"); } long *is = src->stride; long *os = dst->stride; long x, y, z, d, t, isrc, idst; for (t = 0; t < size0; t++) { for (d = 0; d < size1; d++) { for (z = 0; z < size2; z++) { for (y = 0; y < size3; y++) { for (x = 0; x < size4; x++) { isrc = t*is[0] + d*is[1] + z*is[2] + y*is[3] + x*is[4]; // The big switch statement here looks ugly, however on my machine // gcc compiles it to a skip list, so it should be fast. switch (flip_dim) { case 0: idst = (size0 - t - 1)*os[0] + d*os[1] + z*os[2] + y*os[3] + x*os[4]; break; case 1: idst = t*os[0] + (size1 - d - 1)*os[1] + z*os[2] + y*os[3] + x*os[4]; break; case 2: idst = t*os[0] + d*os[1] + (size2 - z - 1)*os[2] + y*os[3] + x*os[4]; break; case 3: idst = t*os[0] + d*os[1] + z*os[2] + (size3 - y - 1)*os[3] + x*os[4]; break; case 4: idst = t*os[0] + d*os[1] + z*os[2] + y*os[3] + (size4 - x - 1)*os[4]; break; } dst_data[ idst ] = src_data[ isrc ]; } } } } } return 0; } /* * Warps an image, according to an (x,y) flow field. The flow * field is in the space of the destination image, each vector * ponts to a source pixel in the original image. */ int image_(Main_warp)(lua_State *L) { THTensor *dst = luaT_checkudata(L, 1, torch_Tensor); THTensor *src = luaT_checkudata(L, 2, torch_Tensor); THTensor *flowfield = luaT_checkudata(L, 3, torch_Tensor); int mode = lua_tointeger(L, 4); int offset_mode = lua_toboolean(L, 5); int clamp_mode = lua_tointeger(L, 6); real pad_value = (real)lua_tonumber(L, 7); // dims int width = dst->size[2]; int height = dst->size[1]; int src_width = src->size[2]; int src_height = src->size[1]; int channels = dst->size[0]; long *is = src->stride; long *os = dst->stride; long *fs = flowfield->stride; // get raw pointers real *dst_data = THTensor_(data)(dst); real *src_data = THTensor_(data)(src); real *flow_data = THTensor_(data)(flowfield); // resample long k,x,y,jj,v,u,i,j; for (y=0; y<height; y++) { for (x=0; x<width; x++) { // subpixel position: real flow_y = flow_data[ 0*fs[0] + y*fs[1] + x*fs[2] ]; real flow_x = flow_data[ 1*fs[0] + y*fs[1] + x*fs[2] ]; float iy = offset_mode*y + flow_y; float ix = offset_mode*x + flow_x; // borders int off_image = 0; if (iy < 0 || iy > src_height - 1 || ix < 0 || ix > src_width - 1) { off_image = 1; } if (off_image == 1 && clamp_mode == 1) { // We're off the image and we're clamping the input image to 0 for (k=0; k<channels; k++) { dst_data[ k*os[0] + y*os[1] + x*os[2] ] = pad_value; } } else { ix = MAX(ix,0); ix = MIN(ix,src_width-1); iy = MAX(iy,0); iy = MIN(iy,src_height-1); // bilinear? switch (mode) { case 1: // Bilinear interpolation { // 4 nearest neighbors: long ix_nw = floor(ix); long iy_nw = floor(iy); long ix_ne = ix_nw + 1; long iy_ne = iy_nw; long ix_sw = ix_nw; long iy_sw = iy_nw + 1; long ix_se = ix_nw + 1; long iy_se = iy_nw + 1; // get surfaces to each neighbor: real nw = ((real)(ix_se-ix))*(iy_se-iy); real ne = ((real)(ix-ix_sw))*(iy_sw-iy); real sw = ((real)(ix_ne-ix))*(iy-iy_ne); real se = ((real)(ix-ix_nw))*(iy-iy_nw); // weighted sum of neighbors: for (k=0; k<channels; k++) { dst_data[ k*os[0] + y*os[1] + x*os[2] ] = src_data[ k*is[0] + iy_nw*is[1] + ix_nw*is[2] ] * nw + src_data[ k*is[0] + iy_ne*is[1] + MIN(ix_ne,src_width-1)*is[2] ] * ne + src_data[ k*is[0] + MIN(iy_sw,src_height-1)*is[1] + ix_sw*is[2] ] * sw + src_data[ k*is[0] + MIN(iy_se,src_height-1)*is[1] + MIN(ix_se,src_width-1)*is[2] ] * se; } } break; case 0: // Simple (i.e., nearest neighbor) { // 1 nearest neighbor: long ix_n = floor(ix+0.5); long iy_n = floor(iy+0.5); // weighted sum of neighbors: for (k=0; k<channels; k++) { dst_data[ k*os[0] + y*os[1] + x*os[2] ] = src_data[ k*is[0] + iy_n*is[1] + ix_n*is[2] ]; } } break; case 2: // Bicubic { // Calculate fractional and integer components long x_pix = floor(ix); long y_pix = floor(iy); real dx = ix - (real)x_pix; real dy = iy - (real)y_pix; real C[4]; for (k=0; k<channels; k++) { // Sweep by rows through the samples (to calculate final cubic coefs) for (jj = 0; jj <= 3; jj++) { v = y_pix - 1 + jj; // We need to clamp all uv values to image border: hopefully // branch prediction and compiler reordering takes care of all // the conditionals (since the branch probabilities are heavily // skewed). Alternatively an inline "getPixelSafe" function would // would be clearer here, but cannot be done with lua? v = MAX(MIN((long)(src_height-1), v), 0); long ofst = k * is[0] + v * is[1]; u = x_pix; u = MAX(MIN((long)(src_width-1), u), 0); real a0 = src_data[ofst + u * is[2]]; u = x_pix - 1; u = MAX(MIN((long)(src_width-1), u), 0); real d0 = src_data[ofst + u * is[2]] - a0; u = x_pix + 1; u = MAX(MIN((long)(src_width-1), u), 0); real d2 = src_data[ofst + u * is[2]] - a0; u = x_pix + 2; u = MAX(MIN((long)(src_width-1), u), 0); real d3 = src_data[ofst + u * is[2]] - a0; // Note: there are mostly static casts, optimizer will take care of // of it for us (prevents compiler warnings in new gcc) real a1 = -(real)1/(real)3*d0 + d2 -(real)1/(real)6*d3; real a2 = (real)1/(real)2*d0 + (real)1/(real)2*d2; real a3 = -(real)1/(real)6*d0 - (real)1/(real)2*d2 + (real)1/(real)6*d3; C[jj] = a0 + dx * (a1 + dx * (a2 + a3 * dx)); } real d0 = C[0]-C[1]; real d2 = C[2]-C[1]; real d3 = C[3]-C[1]; real a0 = C[1]; real a1 = -(real)1/(real)3*d0 + d2 - (real)1/(real)6*d3; real a2 = (real)1/(real)2*d0 + (real)1/(real)2*d2; real a3 = -(real)1/(real)6*d0 - (real)1/(real)2*d2 + (real)1/(real)6*d3; real Cc = a0 + dy * (a1 + dy * (a2 + a3 * dy)); // I assume that since the image is stored as reals we don't have // to worry about clamping to min and max int (to prevent over or // underflow) dst_data[ k*os[0] + y*os[1] + x*os[2] ] = Cc; } } break; case 3: // Lanczos { // Note: Lanczos can be made fast if the resampling period is // constant... and therefore the Lu, Lv can be cached and reused. // However, unfortunately warp makes no assumptions about resampling // and so we need to perform the O(k^2) convolution on each pixel AND // we have to re-calculate the kernel for every pixel. // See wikipedia for more info. // It is however an extremely good approximation to to full sinc // interpolation (IIR) filter. // Another note is that the version here has been optimized using // pretty aggressive code flow and explicit inlining. It might not // be very readable (contact me, Jonathan Tompson, if it is not) // Calculate fractional and integer components long x_pix = floor(ix); long y_pix = floor(iy); // Precalculate the L(x) function evaluations in the u and v direction #define rad (3) // This is a tunable parameter: 2 to 3 is OK float Lu[2 * rad]; // L(x) for u direction float Lv[2 * rad]; // L(x) for v direction for (u=x_pix-rad+1, i=0; u<=x_pix+rad; u++, i++) { float du = ix - (float)u; // Lanczos kernel x value du = du < 0 ? -du : du; // prefer not to used std absf if (du < 0.000001f) { // TODO: Is there a real eps standard? Lu[i] = 1; } else if (du > (float)rad) { Lu[i] = 0; } else { Lu[i] = ((float)rad * sin((float)M_PI * du) * sin((float)M_PI * du / (float)rad)) / ((float)(M_PI * M_PI) * du * du); } } for (v=y_pix-rad+1, i=0; v<=y_pix+rad; v++, i++) { float dv = iy - (float)v; // Lanczos kernel x value dv = dv < 0 ? -dv : dv; // prefer not to used std absf if (dv < 0.000001f) { // TODO: Is there a real eps standard? Lv[i] = 1; } else if (dv > (float)rad) { Lv[i] = 0; } else { Lv[i] = ((float)rad * sin((float)M_PI * dv) * sin((float)M_PI * dv / (float)rad)) / ((float)(M_PI * M_PI) * dv * dv); } } float sum_weights = 0; for (u=0; u<2*rad; u++) { for (v=0; v<2*rad; v++) { sum_weights += (Lu[u] * Lv[v]); } } for (k=0; k<channels; k++) { real result = 0; for (u=x_pix-rad+1, i=0; u<=x_pix+rad; u++, i++) { long curu = MAX(MIN((long)(src_width-1), u), 0); for (v=y_pix-rad+1, j=0; v<=y_pix+rad; v++, j++) { long curv = MAX(MIN((long)(src_height-1), v), 0); real Suv = src_data[k * is[0] + curv * is[1] + curu * is[2]]; real weight = (real)(Lu[i] * Lv[j]); result += (Suv * weight); } } // Normalize by the sum of the weights result = result / (float)sum_weights; // Again, I assume that since the image is stored as reals we // don't have to worry about clamping to min and max int (to // prevent over or underflow) dst_data[ k*os[0] + y*os[1] + x*os[2] ] = result; } } break; } // end switch (mode) } // end else } } // done return 0; } int image_(Main_gaussian)(lua_State *L) { THTensor *dst = luaT_checkudata(L, 1, torch_Tensor); long width = dst->size[1]; long height = dst->size[0]; long *os = dst->stride; real *dst_data = THTensor_(data)(dst); real amplitude = (real)lua_tonumber(L, 2); int normalize = (int)lua_toboolean(L, 3); real sigma_u = (real)lua_tonumber(L, 4); real sigma_v = (real)lua_tonumber(L, 5); real mean_u = (real)lua_tonumber(L, 6) * (real)width + (real)0.5; real mean_v = (real)lua_tonumber(L, 7) * (real)height + (real)0.5; // Precalculate 1/(sigma*size) for speed (for some stupid reason the pragma // omp declaration prevents gcc from optimizing the inside loop on my macine: // verified by checking the assembly output) real over_sigmau = (real)1.0 / (sigma_u * (real)width); real over_sigmav = (real)1.0 / (sigma_v * (real)height); long v, u; real du, dv; #pragma omp parallel for private(v, u, du, dv) for (v = 0; v < height; v++) { for (u = 0; u < width; u++) { du = ((real)u + 1 - mean_u) * over_sigmau; dv = ((real)v + 1 - mean_v) * over_sigmav; dst_data[ v*os[0] + u*os[1] ] = amplitude * exp(-((du*du*0.5) + (dv*dv*0.5))); } } if (normalize) { real sum = 0; // We could parallelize this, but it's more trouble than it's worth for(v = 0; v < height; v++) { for(u = 0; u < width; u++) { sum += dst_data[ v*os[0] + u*os[1] ]; } } real one_over_sum = 1.0 / sum; #pragma omp parallel for private(v, u) for(v = 0; v < height; v++) { for(u = 0; u < width; u++) { dst_data[ v*os[0] + u*os[1] ] *= one_over_sum; } } } return 0; } /* * Borrowed from github.com/clementfarabet/lua---imgraph * with Clément's permission for implementing y2jet() */ int image_(Main_colorize)(lua_State *L) { // get args THTensor *output = (THTensor *)luaT_checkudata(L, 1, torch_Tensor); THTensor *input = (THTensor *)luaT_checkudata(L, 2, torch_Tensor); THTensor *colormap = (THTensor *)luaT_checkudata(L, 3, torch_Tensor); // dims long height = input->size[0]; long width = input->size[1]; // generate color map if not given if (THTensor_(nElement)(colormap) == 0) { THTensor_(resize2d)(colormap, width*height, 3); THTensor_(fill)(colormap, -1); } // colormap channels int channels = colormap->size[1]; // generate output THTensor_(resize3d)(output, channels, height, width); int x,y,k; for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { int id = THTensor_(get2d)(input, y, x); real check = THTensor_(get2d)(colormap, id, 0); if (check == -1) { for (k = 0; k < channels; k++) { THTensor_(set2d)(colormap, id, k, ((float)rand()/(float)RAND_MAX)); } } for (k = 0; k < channels; k++) { real color = THTensor_(get2d)(colormap, id, k); THTensor_(set3d)(output, k, y, x, color); } } } // return nothing return 0; } int image_(Main_rgb2y)(lua_State *L) { THTensor *rgb = luaT_checkudata(L, 1, torch_Tensor); THTensor *yim = luaT_checkudata(L, 2, torch_Tensor); luaL_argcheck(L, rgb->nDimension == 3, 1, "image.rgb2y: src not 3D"); luaL_argcheck(L, yim->nDimension == 2, 2, "image.rgb2y: dst not 2D"); luaL_argcheck(L, rgb->size[1] == yim->size[0], 2, "image.rgb2y: src and dst not of same height"); luaL_argcheck(L, rgb->size[2] == yim->size[1], 2, "image.rgb2y: src and dst not of same width"); int y,x; real r,g,b,yc; const int height = rgb->size[1]; const int width = rgb->size[2]; for (y=0; y<height; y++) { for (x=0; x<width; x++) { // get Rgb r = THTensor_(get3d)(rgb, 0, y, x); g = THTensor_(get3d)(rgb, 1, y, x); b = THTensor_(get3d)(rgb, 2, y, x); yc = (real) ((0.299 * (float) r) + (0.587 * (float) g) + (0.114 * (float) b)); THTensor_(set2d)(yim, y, x, yc); } } return 0; } static const struct luaL_Reg image_(Main__) [] = { {"scaleSimple", image_(Main_scaleSimple)}, {"scaleBilinear", image_(Main_scaleBilinear)}, {"scaleBicubic", image_(Main_scaleBicubic)}, {"rotate", image_(Main_rotate)}, {"rotateBilinear", image_(Main_rotateBilinear)}, {"polar", image_(Main_polar)}, {"polarBilinear", image_(Main_polarBilinear)}, {"logPolar", image_(Main_logPolar)}, {"logPolarBilinear", image_(Main_logPolarBilinear)}, {"translate", image_(Main_translate)}, {"cropNoScale", image_(Main_cropNoScale)}, {"warp", image_(Main_warp)}, {"saturate", image_(Main_saturate)}, {"rgb2y", image_(Main_rgb2y)}, {"rgb2hsv", image_(Main_rgb2hsv)}, {"rgb2hsl", image_(Main_rgb2hsl)}, {"hsv2rgb", image_(Main_hsv2rgb)}, {"hsl2rgb", image_(Main_hsl2rgb)}, {"rgb2lab", image_(Main_rgb2lab)}, {"lab2rgb", image_(Main_lab2rgb)}, {"gaussian", image_(Main_gaussian)}, {"vflip", image_(Main_vflip)}, {"hflip", image_(Main_hflip)}, {"flip", image_(Main_flip)}, {"colorize", image_(Main_colorize)}, {NULL, NULL} }; void image_(Main_init)(lua_State *L) { luaT_pushmetatable(L, torch_Tensor); luaT_registeratname(L, image_(Main__), "image"); } #endif
the_stack_data/111078643.c
#include <stdio.h> #include <unistd.h> #include <sys/wait.h> #include <sys/time.h> #include <sys/mman.h> static double *glob_var; int main(void) { int fd[2]; pid_t childpid; char *rcvrs[] = {"./fast_receiver", "./slow_receiver", "./unreliable_receiver"}; char *sndrs[] = {"./fast_sender", "./slow_sender", "./unreliable_sender"}; int nrcvrs = 3; int nsndrs = 3; glob_var = mmap(NULL, nrcvrs*nsndrs*sizeof(double), PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, -1, 0); for (int i=0; i<nrcvrs; i++) { for (int j=0; j<nsndrs; j++) { childpid = fork(); if (childpid < 0) { printf("fork failed\n"); return 1; } else if (childpid == 0) { struct timeval start, end; double dt; pid_t pid1, pid2; int status1, status2; printf("testing %s with %s\n", sndrs[j], rcvrs[i]); gettimeofday(&start, NULL); pid1 = fork(); if (pid1 < 0) { printf("fork failed\n"); return 1; } else if (pid1 == 0) { execl(sndrs[j], sndrs[j], "-1", NULL); printf("exec failed\n"); return 1; } pid2 = fork(); if (pid2 < 0) { printf("fork failed\n"); return 1; } else if (pid2 == 0) { execl(rcvrs[i], rcvrs[i], "-1", NULL); printf("exec failed\n"); return 1; } printf("waiting for %s and %s to finish\n", sndrs[j], rcvrs[i]); waitpid(pid1, &status1, 0); waitpid(pid2, &status2, 0); gettimeofday(&end, NULL); dt = end.tv_sec-start.tv_sec+(end.tv_usec-start.tv_usec)/1000000.0; if (WEXITSTATUS(status1) || WEXITSTATUS(status2)) { glob_var[i*nsndrs+j] = -1; } else { glob_var[i*nsndrs+j] = dt; } printf("Done testing %s with %s, %f sec required\n", sndrs[j], rcvrs[i], glob_var[i*nsndrs+j]); return 0; } } } printf("waiting for all tests to complete\n"); for (int i=0; i<nrcvrs*nsndrs; i++) { wait(NULL); } double lowestTime = 10000; for (int i=0; i<nrcvrs; i++) { for (int j=0; j<nsndrs; j++) { if (glob_var[i*nsndrs+j] > 0) { if(glob_var[i*nsndrs+j] < lowestTime) lowestTime = glob_var[i*nsndrs+j]; } } } printf("The fastest overall runtime was %f seconds\n", lowestTime); printf("Testing complete\n"); return 0; }
the_stack_data/146335.c
/* Author: Sam Trahan, October 2011 This is the implementation of a good but simple random number generator designed by Bob Jenkins, who placed it in the public domain. His website described the algorithm and its public domain status on 2:23 AM EDT October 8, 2011 at this location: http://burtleburtle.net/bob/rand/smallprng.html And at that time, it said, "I wrote this PRNG. I place it in the public domain." (PNRG is an acronym for "psuedo-random number generator" as defined elsewhere on his website.) I modified his code to work as an array of random number generators and generate four output types (float, double, int32, int64). This code is tested on the Intel, IBM and GNU C compilers, and will successfully produce identical floating-point numbers in [0,1) on all three compilers. This code is not sensitive to optimization since all calculations are integer calculations, and hence are exact. This algorithm, unlike the common Mersenne Twister, is not cryptographically secure, so don't use it to encrypt your banking information. However, it does pass the entire suite of DIEHARD tests, so it is sufficiently random for meterological purposes. Its advantage over cryptographically secure algorithms is that it only needs 16 bytes to store its state, and is very fast, allowing us to have an independent random number generator for each gridpoint. That avoids domain decomposition issues and allows us to generate random numbers in parallel across all processes, producing the same results regardless of which process or thread has which gridpoint. Don't change any of the constants in this file without rerunning the full suite of randomness tests as described on Bob's website. Also, don't change the floating-point conversion unless you first test that it correctly produces 0, never produces 1.0, is uniformly distributed, and produces identical results on at least the Intel, GNU and IBM C compilers. */ #include <stdint.h> typedef uint32_t u4; typedef uint64_t u8; #define rot(x,k) (((x)<<(k))|((x)>>(32-(k)))) void bobranval_impl( u4 *a, u4 *b, u4 *c, u4 *d, u4 *n ) { u4 e,i,nd=*n; for(i=0;i<nd;i++) { e = a[i] - rot(b[i], 27); a[i] = b[i] ^ rot(c[i], 17); b[i] = c[i] + d[i]; c[i] = d[i] + e; d[i] = e + a[i]; } } void bob_int_hash(u4 *in, u4 *out) { u4 a=0xf1ea5eed; u4 b,c,d,e,i; b=c=d=*in; for(i=0;i<20;i++) { e = a - rot(b, 27); a = b ^ rot(c, 17); b = c + d; c = d + e; d = e + a; } *out=d; } void bobranval_r4_impl( u4 *a, u4 *b, u4 *c, u4 *d, float *result, u4 *n ) { /* 32-bit floating point implementation */ u4 i,nd=*n; bobranval_impl(a,b,c,d,n); for(i=0;i<nd;i++) { result[i]=(d[i]&0xfffff000)*2.328305e-10f; } } void bobranval_i4_impl( u4 *a, u4 *b, u4 *c, u4 *d, u4 *result, u4 *n ) { /* 32-bit integer implementation */ u4 i,nd=*n; bobranval_impl(a,b,c,d,n); for(i=0;i<nd;i++) result[i]=d[i]; } void bobranval_i8_impl( u4 *a, u4 *b, u4 *c, u4 *d, u8 *result, u4 *n ) { /* 64-bit integer implementation */ u4 i,nd=*n; bobranval_impl(a,b,c,d,n); for(i=0;i<nd;i++) result[i]=d[i]; bobranval_impl(a,b,c,d,n); for(i=0;i<nd;i++) result[i]=(result[i]<<32) | d[i]; } void bobranval_r8_impl( u4 *a, u4 *b, u4 *c, u4 *d, u8 *result, u4 *n ) { /* 64-bit floating-point implementation */ u4 i,nd=*n; bobranval_impl(a,b,c,d,n); for(i=0;i<nd;i++) result[i]=d[i]; bobranval_impl(a,b,c,d,n); for(i=0;i<nd;i++) { ((double*)result)[i] = (((result[i]<<32) | d[i]) & 0xfffffffffffffc00ll) * 5.4210108624275218691107101938441e-20; } } void bobraninit(u4 *a, u4 *b, u4 *c, u4 *d, u4 *seeds, u4 *seed2, u4 *n) { u4 i,nd=*n,one=1,iter; for(i=0;i<nd;i++) { a[i] = 0xf1ea5eed; b[i] = c[i] = d[i] = seeds[i]^*seed2; for (iter=0; iter<20; ++iter) { bobranval_impl(a+i,b+i,c+i,d+i,&one); } } } /* Aliases for various fortran compilers */ void int_hash(u4*i,u4*o) { bob_int_hash(i,o); } void int_hash_(u4*i,u4*o) { bob_int_hash(i,o); } void int_hash__(u4*i,u4*o) { bob_int_hash(i,o); } void INT_HASH(u4*i,u4*o) { bob_int_hash(i,o); } void INT_HASH_(u4*i,u4*o) { bob_int_hash(i,o); } void INT_HASH__(u4*i,u4*o) { bob_int_hash(i,o); } void bobraninit_(u4*a,u4*b,u4*c,u4*d,u4*s,u4*s2,u4*n) { bobraninit(a,b,c,d,s,s2,n); } void bobraninit__(u4*a,u4*b,u4*c,u4*d,u4*s,u4*s2,u4*n) { bobraninit(a,b,c,d,s,s2,n); } void BOBRANINIT_(u4*a,u4*b,u4*c,u4*d,u4*s,u4*s2,u4*n) { bobraninit(a,b,c,d,s,s2,n); } void BOBRANINIT__(u4*a,u4*b,u4*c,u4*d,u4*s,u4*s2,u4*n) { bobraninit(a,b,c,d,s,s2,n); } void bobranval_r4(u4*a,u4*b,u4*c,u4*d,float*f,u4*n) { bobranval_r4_impl(a,b,c,d,f,n); } void bobranval_r4_(u4*a,u4*b,u4*c,u4*d,float*f,u4*n) { bobranval_r4_impl(a,b,c,d,f,n); } void bobranval_r4__(u4*a,u4*b,u4*c,u4*d,float*f,u4*n) { bobranval_r4_impl(a,b,c,d,f,n); } void BOBRANVAL_R4_(u4*a,u4*b,u4*c,u4*d,float*f,u4*n) { bobranval_r4_impl(a,b,c,d,f,n); } void BOBRANVAL_R4__(u4*a,u4*b,u4*c,u4*d,float*f,u4*n) { bobranval_r4_impl(a,b,c,d,f,n); } void bobranval_i4(u4*a,u4*b,u4*c,u4*d,u4*i,u4*n) { bobranval_i4_impl(a,b,c,d,i,n); } void bobranval_i4_(u4*a,u4*b,u4*c,u4*d,u4*i,u4*n) { bobranval_i4_impl(a,b,c,d,i,n); } void bobranval_i4__(u4*a,u4*b,u4*c,u4*d,u4*i,u4*n) { bobranval_i4_impl(a,b,c,d,i,n); } void BOBRANVAL_I4_(u4*a,u4*b,u4*c,u4*d,u4*i,u4*n) { bobranval_i4_impl(a,b,c,d,i,n); } void BOBRANVAL_I4__(u4*a,u4*b,u4*c,u4*d,u4*i,u4*n) { bobranval_i4_impl(a,b,c,d,i,n); } void bobranval_r8(u4*a,u4*b,u4*c,u4*d,u8*f,u4*n) { bobranval_r8_impl(a,b,c,d,f,n); } void bobranval_r8_(u4*a,u4*b,u4*c,u4*d,u8*f,u4*n) { bobranval_r8_impl(a,b,c,d,f,n); } void bobranval_r8__(u4*a,u4*b,u4*c,u4*d,u8*f,u4*n) { bobranval_r8_impl(a,b,c,d,f,n); } void BOBRANVAL_R8_(u4*a,u4*b,u4*c,u4*d,u8*f,u4*n) { bobranval_r8_impl(a,b,c,d,f,n); } void BOBRANVAL_R8__(u4*a,u4*b,u4*c,u4*d,u8*f,u4*n) { bobranval_r8_impl(a,b,c,d,f,n); } void bobranval_i8(u4*a,u4*b,u4*c,u4*d,u8*i,u4*n) { bobranval_i8_impl(a,b,c,d,i,n); } void bobranval_i8_(u4*a,u4*b,u4*c,u4*d,u8*i,u4*n) { bobranval_i8_impl(a,b,c,d,i,n); } void bobranval_i8__(u4*a,u4*b,u4*c,u4*d,u8*i,u4*n) { bobranval_i8_impl(a,b,c,d,i,n); } void BOBRANVAL_I8_(u4*a,u4*b,u4*c,u4*d,u8*i,u4*n) { bobranval_i8_impl(a,b,c,d,i,n); } void BOBRANVAL_I8__(u4*a,u4*b,u4*c,u4*d,u8*i,u4*n) { bobranval_i8_impl(a,b,c,d,i,n); }
the_stack_data/173577915.c
#include <stdio.h> #include <unistd.h> #include <signal.h> #include <string.h> #include <sys/types.h> //#include <sys/wait.h> int main(){ printf("ok start\n"); char comand[512]= "ls"; char comand2 [512] = "-l -t"; for(int i =0; i<10; i++){ printf("\nmy_shell$"); fgets(comand,512,stdin); while ((getchar()) != '\n');//flushing the input buffer taken from https://www.geeksforgeeks.org/clearing-the-input-buffer-in-cc/#:~:text=Using%20%E2%80%9C%20while%20((getchar()),input%20in%20the%20desired%20container. if(strcmp(comand,"end")==0){ printf("quitting\n"); break; } else{ printf(comand); if(fork()==0){ printf("child baby\n"); execlp(comand,comand,"-l","-t",NULL); break; } else{ wait(); printf("\n\nim still kicking\n\n"); } } } return 0; // system calls is how you do this // sigaction importatn for hw 1 // kill sends any signal to the process // signal mask change sigal // man 7 signal // sigaction // dup2 important for pipe part of schell // all shell does is tweek fds for different programs // impoet bin ls // exec everingthing in the }
the_stack_data/1031091.c
/* ================================================================================= Name : .c Author : Abrantes Araújo Silva Filho [email protected] C/C++ Std. : C89/90 Version : Copyright : Course Info : Dartmouth/IMT: C Programming with Linux Professional Certificate https://www.edx.org/professional-certificate/dartmouth-imtx-c-programming-with-linux Course 01: C Programming: Getting Started https://www.edx.org/course/programming-in-c-getting-started Description : ================================================================================= */ /* Includes: */ #include <stdio.h> /* Main: */ int main(void) { printf("This is code with errors: "); printf("Fix them!"); return 0; }
the_stack_data/89484.c
#include <pthread.h> pthread_t c; int d; void *e(void *) { d = 6; } int main() { if(nondet_bool()) { pthread_create(&c, 0, e, 0); return 0; } else { d = 3; assert(d == 3); } return 0; }
the_stack_data/181135.c
//Github AIeasy peng3060,https://github.com/AIeasy/CP386-A4 #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <string.h> #include <pthread.h> #include <sys/stat.h> #include <time.h> #include <semaphore.h> void *thread_run(void *thread); typedef struct Customer{ int ID; int Allocation[4]; int max[4]; int Need[4]; }Customer; Customer *customers; int max[5][4]={{6,4,7,3},{4,2,3,2},{2,5,3,3},{6,3,3,2},{5,5,7,5}}; int Available[4]; int main(int argc, char *argv[]){ printf("Number of Customers: 5\n"); int safe_seq[5]; Customer* cus = (Customer*) malloc(sizeof(Customer)*5); customers=cus; for (int c=0;c<5;c++){//init max cus[c].ID=c; for(int r=0;r<4;r++){ cus[c].Allocation[r]=0; cus[c].max[r]=max[c][r]; cus[c].Need[r]=max[c][r]; } } int p =1; int k=0; while(argv[p]!=NULL){ k = atoi(argv[p]); Available[p-1]=k; p++; } printf("Currently Available resources: "); for(k=0;k<4;k++){ printf("%d ",Available[k]); } printf("\n"); printf("Maximum resources from file:\n"); for(int k =0;k<5;k++){ for(int i = 0;i<4;i++){ printf("%d ",customers[k].max[i]); } printf("\n"); } //read file and generate max. //safe check if (safe_check(Available,safe_seq)==0){//check if in safe condition. printf("Error: current thread list is not safe\n"); return; }else{ char* command = malloc(sizeof(char*)*300); while(1){ int input[4]; int t_id; printf("Enter command:\n"); fgets(command, 300, stdin); char* token = strtok(command," "); int i =0; int mode =0; while (token!=NULL){ if (i==0){ if(strcmp("RQ",token)==0){ mode =1; }else if (strcmp("RL",token)==0){ mode = 2; }else if (strcmp("Status\n",token)==0){ mode=3; }else if (strcmp("Run\n",token)==0){ mode= 4; }else if (strcmp("Exit\n",token)==0){ mode =5; }else{ printf("ERROR: PLEASE INPUT RIGHT MODE COMMAND\n"); return; } } else if (i==1){ t_id = atoi(token); }else{ input[i-2]=atoi(token); } token = strtok(NULL," "); i++; } if (mode ==1){ request(t_id,input,Available,safe_seq); } else if (mode ==2){ release(t_id,input,Available); } else if (mode ==3){ status(Available); }else if (mode == 4){ if(safe_check(Available,safe_seq)==1){ Run(safe_seq); for (int x=0;x<5;x++){ pthread_t my_thread; pthread_attr_t new_thread; pthread_attr_init(&new_thread); int p=safe_seq[x]; my_thread = pthread_create(&my_thread,&new_thread,thread_run,&customers[safe_seq[x]].ID); sleep(1); if (my_thread !=0){ printf("ERROR, THREAD FAIL\n"); } } pthread_exit(NULL); } else{ printf("Current thread list is not safe, can not perform run threads\n"); return; } }else if (mode == 5){ printf("Exiting Program....\n"); exit(0); } } } //wait for request //read request, process request? //RQ request,RL release,* output,Run find safe sequence. } int safe_check(int Available[],int safe_seq[]){ int work[4]; // work = avai for(int i=0;i<4;i++){ work[i] = Available[i]; } int small; int k=0; int safe[5]={0,0,0,0,0}; //safe condition, set to false when init. for(int n=0;n<5;n++){//check if all can be in safe condition if(safe[n]==0 && customers[n].Need[0] <= work[0] && customers[n].Need[1] <= work[1] && customers[n].Need[2] <= work[2] && customers[n].Need[3] <= work[3]){//try to alloc work[0] += customers[n].Allocation[0]; work[1] += customers[n].Allocation[1]; work[2] += customers[n].Allocation[2]; work[3] += customers[n].Allocation[3]; safe[n] = 1;//change safe to 1 safe_seq[k++] = n; n=-1;//check again } } for(int i=0;i<5;i++){ //check if all in safe condition if(safe[i]==0){ // return false if not. return 0; } } return 1; } void request(int n,int req[],int Available[],int safe_seq[]){ if(compare_matrix(req,customers[n].Need)==0){//check if request greater than need. printf("request greater than need\n"); return 0; } else if(compare_matrix(req,Available)==1){//if req less than Avai, try to allocation alloc(n,req,Available); if(safe_check(Available,safe_seq)==0){ rollback(n,req,Available); printf("not safe\n"); //rollback or keep going //let thread wait? } else{ printf("State is safe, and request is satisfied\n"); } } } void alloc(int n,int req[],int Available[]){//Try to allocation sources for(int i=0;i<4;i++){ Available[i] = Available[i] - req[i]; customers[n].Allocation[i] += req[i]; customers[n].Need[i] -= req[i]; } } void rollback(int n,int req[],int Available[]){//roll back to origin for(int i=0;i<4;i++){ Available[i] = Available[i] + req[i]; customers[n].Allocation[i] -= req[i]; customers[n].Need[i] += req[i]; } } int release(int n,int rel[],int Available[]){//release resources if(compare_matrix(rel,customers[n].Allocation)==1){ for(int i = 0;i<4;i++){ customers[n].Allocation[i] -= rel[i]; Available[i] += rel[i]; //need do not change? } printf("The resources have been released successfully\n"); } else{ printf("invalid release"); } } int status(int Available[]){//print all matirx printf("Available Resources:\n"); for(int i = 0;i<4;i++){ printf("%d",Available[i]); printf(" "); } printf("\n"); printf("Maximum Resources:\n"); for(int k =0;k<5;k++){ for(int i=0;i<4;i++){ printf("%d",customers[k].max[i]); printf(" "); } printf("\n"); } printf("\n"); printf("Allocated Resources:\n"); for(int k =0;k<5;k++){ for(int i=0;i<4;i++){ printf("%d",customers[k].Allocation[i]); printf(" "); } printf("\n"); } printf("\n"); printf("Need Resources:\n"); for(int k =0;k<5;k++){ for(int i=0;i<4;i++){ printf("%d",customers[k].Need[i]); printf(" "); } printf("\n"); } printf("\n"); } void Run(int safe_seq[]){ printf("Safe Sequence is:"); for(int i =0;i<5;i++){ printf("%d",safe_seq[i]); printf(" "); } printf("\n"); } int compare_matrix(int fir[],int sec[]){//compare two matrix, return 1 if first <= second, else return 0. for(int i =0;i<4;i++){ if(fir[i]>sec[i]){ return 0; } } return 1; } void logStart(int *tID) { printf(" Thread has started\n"); return; } void logFinish(int *tID) { printf(" Thread has finished\n"); return; } void logRelease(int *tID) { printf(" Thread is realseasing resources\n"); for( int x =0;x<4;x++){ Available[x]+=customers[*tID].Allocation[x]; } return; } void *thread_run(void *thread){ int *t_id = (int*)thread; printf("--> Customer/Thread %d\n",*t_id); printf(" Allocated resources:");//printing out all the allocated resources for (int x = 0; x <4 ;x++){ printf(" %d",customers[*t_id].Allocation[x]); } printf("\n"); printf(" Needed:");//all the maxinum needed resources for (int y= 0;y<4;y++){ printf(" %d",customers[*t_id].Need[y]); } printf("\n"); printf(" Available:");//available resources for(int z = 0;z<4;z++){ printf(" %d",Available[z]); } printf("\n"); logStart(t_id); logFinish(t_id); logRelease(t_id); printf(" New Available:"); for(int n=0;n<4;n++){ printf(" %d",Available[n]); } printf("\n"); return 0; }
the_stack_data/167330757.c
#include <stdio.h> #include <errno.h> #include <unistd.h> int main() { int vals[] = { _SC_PAGE_SIZE, _SC_PAGESIZE, _SC_ADVISORY_INFO, _SC_BARRIERS, _SC_ASYNCHRONOUS_IO, _SC_CLOCK_SELECTION, _SC_CPUTIME, _SC_FSYNC, _SC_IPV6, _SC_MAPPED_FILES, _SC_MEMLOCK, _SC_MEMLOCK_RANGE, _SC_MEMORY_PROTECTION, _SC_MESSAGE_PASSING, _SC_MONOTONIC_CLOCK, _SC_PRIORITIZED_IO, _SC_PRIORITY_SCHEDULING, _SC_RAW_SOCKETS, _SC_READER_WRITER_LOCKS, _SC_REALTIME_SIGNALS, _SC_SEMAPHORES, _SC_SHARED_MEMORY_OBJECTS, _SC_SPAWN, _SC_SPIN_LOCKS, _SC_SYNCHRONIZED_IO, _SC_THREAD_ATTR_STACKADDR, _SC_THREAD_ATTR_STACKSIZE, _SC_THREAD_CPUTIME, _SC_THREAD_PRIO_INHERIT, _SC_THREAD_PRIO_PROTECT, _SC_THREAD_PRIORITY_SCHEDULING, _SC_THREAD_PROCESS_SHARED, _SC_THREAD_SAFE_FUNCTIONS, _SC_THREADS, _SC_TIMEOUTS, _SC_TIMERS, _SC_VERSION, _SC_2_C_BIND, _SC_2_C_DEV, _SC_2_CHAR_TERM, _SC_2_LOCALEDEF, _SC_2_SW_DEV, _SC_2_VERSION, _SC_MQ_OPEN_MAX, _SC_XOPEN_STREAMS, _SC_XBS5_LP64_OFF64, _SC_XBS5_LPBIG_OFFBIG, _SC_AIO_LISTIO_MAX, _SC_AIO_MAX, _SC_SPORADIC_SERVER, _SC_THREAD_SPORADIC_SERVER, _SC_TRACE, _SC_TRACE_EVENT_FILTER, _SC_TRACE_EVENT_NAME_MAX, _SC_TRACE_INHERIT, _SC_TRACE_LOG, _SC_TRACE_NAME_MAX, _SC_TRACE_SYS_MAX, _SC_TRACE_USER_EVENT_MAX, _SC_TYPED_MEMORY_OBJECTS, _SC_V6_LP64_OFF64, _SC_V6_LPBIG_OFFBIG, _SC_2_FORT_DEV, _SC_2_FORT_RUN, _SC_2_PBS, _SC_2_PBS_ACCOUNTING, _SC_2_PBS_CHECKPOINT, _SC_2_PBS_LOCATE, _SC_2_PBS_MESSAGE, _SC_2_PBS_TRACK, _SC_2_UPE, _SC_THREAD_THREADS_MAX, _SC_SEM_NSEMS_MAX, _SC_SYMLOOP_MAX, _SC_TIMER_MAX, _SC_V6_ILP32_OFF32, _SC_V6_ILP32_OFFBIG, _SC_JOB_CONTROL, _SC_REGEXP, _SC_SAVED_IDS, _SC_SHELL, _SC_XBS5_ILP32_OFF32, _SC_XBS5_ILP32_OFFBIG, _SC_XOPEN_CRYPT, _SC_XOPEN_ENH_I18N, _SC_XOPEN_LEGACY, _SC_XOPEN_REALTIME, _SC_XOPEN_REALTIME_THREADS, _SC_XOPEN_SHM, _SC_XOPEN_UNIX, _SC_THREAD_KEYS_MAX, _SC_IOV_MAX, _SC_GETGR_R_SIZE_MAX, _SC_GETPW_R_SIZE_MAX, _SC_OPEN_MAX, _SC_RTSIG_MAX, _SC_EXPR_NEST_MAX, _SC_TTY_NAME_MAX, _SC_ATEXIT_MAX, _SC_DELAYTIMER_MAX, _SC_SEM_VALUE_MAX, _SC_SIGQUEUE_MAX, _SC_CHILD_MAX, _SC_BC_SCALE_MAX, _SC_BC_BASE_MAX, _SC_LINE_MAX, _SC_BC_DIM_MAX, _SC_ARG_MAX, _SC_NGROUPS_MAX, _SC_MQ_PRIO_MAX, _SC_RE_DUP_MAX, _SC_THREAD_STACK_MIN, _SC_BC_STRING_MAX, _SC_XOPEN_VERSION, _SC_LOGIN_NAME_MAX, _SC_COLL_WEIGHTS_MAX, _SC_CLK_TCK, _SC_HOST_NAME_MAX, _SC_AIO_PRIO_DELTA_MAX, _SC_STREAM_MAX, _SC_TZNAME_MAX, _SC_THREAD_DESTRUCTOR_ITERATIONS, _SC_PHYS_PAGES }; char* names[] = { "_SC_PAGE_SIZE", "_SC_PAGESIZE", "_SC_ADVISORY_INFO", "_SC_BARRIERS", "_SC_ASYNCHRONOUS_IO", "_SC_CLOCK_SELECTION", "_SC_CPUTIME", "_SC_FSYNC", "_SC_IPV6", "_SC_MAPPED_FILES", "_SC_MEMLOCK", "_SC_MEMLOCK_RANGE", "_SC_MEMORY_PROTECTION", "_SC_MESSAGE_PASSING", "_SC_MONOTONIC_CLOCK", "_SC_PRIORITIZED_IO", "_SC_PRIORITY_SCHEDULING", "_SC_RAW_SOCKETS", "_SC_READER_WRITER_LOCKS", "_SC_REALTIME_SIGNALS", "_SC_SEMAPHORES", "_SC_SHARED_MEMORY_OBJECTS", "_SC_SPAWN", "_SC_SPIN_LOCKS", "_SC_SYNCHRONIZED_IO", "_SC_THREAD_ATTR_STACKADDR", "_SC_THREAD_ATTR_STACKSIZE", "_SC_THREAD_CPUTIME", "_SC_THREAD_PRIO_INHERIT", "_SC_THREAD_PRIO_PROTECT", "_SC_THREAD_PRIORITY_SCHEDULING", "_SC_THREAD_PROCESS_SHARED", "_SC_THREAD_SAFE_FUNCTIONS", "_SC_THREADS", "_SC_TIMEOUTS", "_SC_TIMERS", "_SC_VERSION", "_SC_2_C_BIND", "_SC_2_C_DEV", "_SC_2_CHAR_TERM", "_SC_2_LOCALEDEF", "_SC_2_SW_DEV", "_SC_2_VERSION", "_SC_MQ_OPEN_MAX", "_SC_XOPEN_STREAMS", "_SC_XBS5_LP64_OFF64", "_SC_XBS5_LPBIG_OFFBIG", "_SC_AIO_LISTIO_MAX", "_SC_AIO_MAX", "_SC_SPORADIC_SERVER", "_SC_THREAD_SPORADIC_SERVER", "_SC_TRACE", "_SC_TRACE_EVENT_FILTER", "_SC_TRACE_EVENT_NAME_MAX", "_SC_TRACE_INHERIT", "_SC_TRACE_LOG", "_SC_TRACE_NAME_MAX", "_SC_TRACE_SYS_MAX", "_SC_TRACE_USER_EVENT_MAX", "_SC_TYPED_MEMORY_OBJECTS", "_SC_V6_LP64_OFF64", "_SC_V6_LPBIG_OFFBIG", "_SC_2_FORT_DEV", "_SC_2_FORT_RUN", "_SC_2_PBS", "_SC_2_PBS_ACCOUNTING", "_SC_2_PBS_CHECKPOINT", "_SC_2_PBS_LOCATE", "_SC_2_PBS_MESSAGE", "_SC_2_PBS_TRACK", "_SC_2_UPE", "_SC_THREAD_THREADS_MAX", "_SC_SEM_NSEMS_MAX", "_SC_SYMLOOP_MAX", "_SC_TIMER_MAX", "_SC_V6_ILP32_OFF32", "_SC_V6_ILP32_OFFBIG", "_SC_JOB_CONTROL", "_SC_REGEXP", "_SC_SAVED_IDS", "_SC_SHELL", "_SC_XBS5_ILP32_OFF32", "_SC_XBS5_ILP32_OFFBIG", "_SC_XOPEN_CRYPT", "_SC_XOPEN_ENH_I18N", "_SC_XOPEN_LEGACY", "_SC_XOPEN_REALTIME", "_SC_XOPEN_REALTIME_THREADS", "_SC_XOPEN_SHM", "_SC_XOPEN_UNIX", "_SC_THREAD_KEYS_MAX", "_SC_IOV_MAX", "_SC_GETGR_R_SIZE_MAX", "_SC_GETPW_R_SIZE_MAX", "_SC_OPEN_MAX", "_SC_RTSIG_MAX", "_SC_EXPR_NEST_MAX", "_SC_TTY_NAME_MAX", "_SC_ATEXIT_MAX", "_SC_DELAYTIMER_MAX", "_SC_SEM_VALUE_MAX", "_SC_SIGQUEUE_MAX", "_SC_CHILD_MAX", "_SC_BC_SCALE_MAX", "_SC_BC_BASE_MAX", "_SC_LINE_MAX", "_SC_BC_DIM_MAX", "_SC_ARG_MAX", "_SC_NGROUPS_MAX", "_SC_MQ_PRIO_MAX", "_SC_RE_DUP_MAX", "_SC_THREAD_STACK_MIN", "_SC_BC_STRING_MAX", "_SC_XOPEN_VERSION", "_SC_LOGIN_NAME_MAX", "_SC_COLL_WEIGHTS_MAX", "_SC_CLK_TCK", "_SC_HOST_NAME_MAX", "_SC_AIO_PRIO_DELTA_MAX", "_SC_STREAM_MAX", "_SC_TZNAME_MAX", "_SC_THREAD_DESTRUCTOR_ITERATIONS", "_SC_PHYS_PAGES" }; char buffer[256]; for (int i = 0; i < sizeof vals / sizeof vals[0]; i++) { printf("%s: %ld\n", names[i], sysconf(vals[i])); printf("errno: %d\n\n", errno); errno = 0; } printf("(invalid): %ld\n", sysconf(-123)); printf("errno: %d\n", errno); return 0; }
the_stack_data/597851.c
#include <stdio.h> #include <sys/types.h> #include <unistd.h> void folklore() { int queue = 15, stack = 25, map = 25, tree = 30,x,k; x = ((stack <= map) && (tree > queue)); k = ((map == queue) || (stack > tree)); //child process because return value zero if (fork() == 0) { printf("xProcess = %d \n", x); } // parent process because return value non-zero else { printf("kProcess = %d \n", ++k); } } int main() { folklore(); return 0; }
the_stack_data/237718.c
#include <stdio.h> int main(){ int vhod, result; scanf("%d", &vhod); result=vhod*vhod; printf("%d\n", result); result=vhod*vhod*vhod; printf("%d\n", result); return 0; }
the_stack_data/97640.c
#include <assert.h> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <stdint.h> // Campos da tabela de páginas #define PT_FIELDS 6 // 4 campos na tabela #define PT_FRAMEID 0 // Endereço da memória física #define PT_MAPPED 1 // Endereço presente na tabela #define PT_DIRTY 2 // Página dirty #define PT_REFERENCE_BIT 3 // Bit de referencia #define PT_REFERENCE_MODE 4 // Tipo de acesso, converter para char #define PT_AGING_COUNTER 5 // Contador para aging // Tipos de acesso #define READ 'r' #define WRITE 'w' // Define a função que simula o algoritmo da política de subst. typedef int (*eviction_f)(int8_t**, int, int, int, int, int); typedef struct { char *name; void *function; } paging_policy_t; // Codifique as reposições a partir daqui! // Cada método abaixo retorna uma página para ser trocada. Note também // que cada algoritmo recebe: // - A tabela de páginas // - O tamanho da mesma // - A última página acessada // - A primeira moldura acessada (para fifo) // - O número de molduras // - Se a última instrução gerou um ciclo de clock // // Adicione mais parâmetros caso ache necessário // Fifo int fifo(int8_t** page_table, int num_pages, int prev_page, int fifo_frm, int num_frames, int clock) { int page = 0; // Contador. // Enquanto não encontrar a primeira página acessada na tabela. while(page_table[page][PT_FRAMEID] != fifo_frm) { page++; // Incremente o contador e continue procurando. } return page; // Encontrei! ~> Retorna o número da página a ser removida. } // Second Chance // Incrementa q_start. Se q_start for igual ao número de frames, q_start incrementa para zero (contador circular). int second_chance_counter(int counter, int num_frames) { return ++counter >= num_frames ? 0 : counter; } // Verifica se o contador q_start fez um ciclo completo (ex: 0-1-2-0 <- Ciclo completo). int second_chance_full_cycle(int q_start, int fifo_frm) { return q_start == fifo_frm ? 1 : 0; } int second_chance(int8_t** page_table, int num_pages, int prev_page, int fifo_frm, int num_frames, int clock) { int page, i; // Declara uma fila com o inteiro q_start marcando a página a mais tempo na memória (início da fila). int q_start = fifo_frm; int* queue = (int*) malloc(num_frames*sizeof(int)); // Procura as páginas mapeadas na memória e insere na fila criada acima. // Incrementando q_start até que ocorra um ciclo (ex: 0-1-2-0 <- Ciclo completo) // elimina-se a necessidade de um segundo for dentro do for a seguir. // Quando o ciclo ocorrer significa que a fila contém todas as páginas mapeadas, // sendo queue[0] a mais antiga e queue[num_frames - 1] a mais recente. for(page=0, i=0; page<num_pages; page++) { //Quando encontrarmos a página que mapeia o frame marcado por q_start, adicione-a à fila. if(page_table[page][PT_FRAMEID] == q_start && page_table[page][PT_MAPPED] == 1) { queue[i++] = page; // Adiciona página à fila. q_start = second_chance_counter(q_start, num_frames); // Incrementa q_start. if(second_chance_full_cycle(q_start, fifo_frm)) { break; } else { page = -1; } //q_start fez um ciclo? } } // Percorre a fila procurando por um elemento com bit de referência igual a 0. for(i=0; i<num_frames; i++) { page = queue[i]; //Se o bit de referência for 1, torná-lo 0. Senão retornar página. if(page_table[page][PT_REFERENCE_BIT] == 1) { page_table[page][PT_REFERENCE_BIT] = 0; } else { return page; } } // A fila fez um ciclo completo zerando bits, logo queue[0] será removida por ser mais antiga. // Comportamento FIFO. return queue[0]; } // NRU int nru(int8_t** page_table, int num_pages, int prev_page, int fifo_frm, int num_frames, int clock) { int page = 0; while (page < num_pages) { // Alguma página não referenciada e não modificada? if(page_table[page][PT_MAPPED] == 1 && page_table[page][PT_REFERENCE_BIT] == 0 && page_table[page][PT_DIRTY] == 0) { return page; } page++; } page -= 1; while (page >= 0) { // Alguma página não referenciada? if(page_table[page][PT_MAPPED] == 1 && page_table[page][PT_REFERENCE_BIT] == 0 && page_table[page][PT_DIRTY] == 1) { return page; } page--; } page += 1; while (page < num_pages) { // Alguma página não modificada? if(page_table[page][PT_MAPPED] == 1 && page_table[page][PT_REFERENCE_BIT] == 1 && page_table[page][PT_DIRTY] == 0) { return page; } page++; } page -= 1; while (page >= 0) { // Então remova qualquer uma. if(page_table[page][PT_MAPPED] == 1 && page_table[page][PT_REFERENCE_BIT] == 1 && page_table[page][PT_DIRTY] == 1) { return page; } page--; } return -1; } // Aging (NFU) int aging(int8_t** page_table, int num_pages, int prev_page, int fifo_frm, int num_frames, int clock) { int page = num_pages; int lower = 0; if(clock) { // Incrementa contadores na interrupção do clock. for (page=0; page<num_pages;page++) { page_table[page][PT_AGING_COUNTER] += page_table[page][PT_REFERENCE_BIT]; if(page_table[page][PT_MAPPED] == 1) { lower = page; } } } while(--page > -1) { // Seleciona página para ser removida. if(page_table[page][PT_MAPPED] == 1) { if(page_table[page][PT_AGING_COUNTER] <= page_table[lower][PT_AGING_COUNTER]) { lower = page; } } } return lower; } // Random int random_page(int8_t** page_table, int num_pages, int prev_page, int fifo_frm, int num_frames, int clock) { int page = rand() % num_pages; while (page_table[page][PT_MAPPED] == 0) // Encontra página mapeada page = rand() % num_pages; return page; } // Simulador a partir daqui int find_next_frame(int *physical_memory, int *num_free_frames, int num_frames, int *prev_free) { if (*num_free_frames == 0) { return -1; } // Procura por um frame livre de forma circula na memória. // Não é muito eficiente, mas fazer um hash em C seria mais custoso. do { *prev_free = (*prev_free + 1) % num_frames; } while (physical_memory[*prev_free] == 1); return *prev_free; } int simulate(int8_t **page_table, int num_pages, int *prev_page, int *fifo_frm, int *physical_memory, int *num_free_frames, int num_frames, int *prev_free, int virt_addr, char access_type, eviction_f evict, int clock) { if (virt_addr >= num_pages || virt_addr < 0) { printf("Invalid access \n"); exit(1); } if (page_table[virt_addr][PT_MAPPED] == 1) { page_table[virt_addr][PT_REFERENCE_BIT] = 1; return 0; // Not Page Fault! } int next_frame_addr; if ((*num_free_frames) > 0) { // Ainda temos memória física livre! next_frame_addr = find_next_frame(physical_memory, num_free_frames, num_frames, prev_free); if (*fifo_frm == -1) *fifo_frm = next_frame_addr; *num_free_frames = *num_free_frames - 1; } else { // Precisamos liberar a memória! assert(*num_free_frames == 0); int to_free = evict(page_table, num_pages, *prev_page, *fifo_frm, num_frames, clock); assert(to_free >= 0); assert(to_free < num_pages); assert(page_table[to_free][PT_MAPPED] != 0); next_frame_addr = page_table[to_free][PT_FRAMEID]; *fifo_frm = (*fifo_frm + 1) % num_frames; // Libera pagina antiga page_table[to_free][PT_FRAMEID] = -1; page_table[to_free][PT_MAPPED] = 0; page_table[to_free][PT_DIRTY] = 0; page_table[to_free][PT_REFERENCE_BIT] = 0; page_table[to_free][PT_REFERENCE_MODE] = 0; page_table[to_free][PT_AGING_COUNTER] = 0; } // Coloca endereço físico na tabela de páginas! int8_t *page_table_data = page_table[virt_addr]; page_table_data[PT_FRAMEID] = next_frame_addr; page_table_data[PT_MAPPED] = 1; if (access_type == WRITE) { page_table_data[PT_DIRTY] = 1; } page_table_data[PT_REFERENCE_BIT] = 1; page_table_data[PT_REFERENCE_MODE] = (int8_t) access_type; *prev_page = virt_addr; if (clock == 1) { for (int i = 0; i < num_pages; i++) page_table[i][PT_REFERENCE_BIT] = 0; } return 1; // Page Fault! } void run(int8_t **page_table, int num_pages, int *prev_page, int *fifo_frm, int *physical_memory, int *num_free_frames, int num_frames, int *prev_free, eviction_f evict, int clock_freq) { int virt_addr; char access_type; int i = 0; int clock = 0; int faults = 0; while (scanf("%d", &virt_addr) == 1) { getchar(); scanf("%c", &access_type); clock = ((i+1) % clock_freq) == 0; faults += simulate(page_table, num_pages, prev_page, fifo_frm, physical_memory, num_free_frames, num_frames, prev_free, virt_addr, access_type, evict, clock); i++; } printf("%d\n", faults); } int parse(char *opt) { char* remainder; int return_val = strtol(opt, &remainder, 10); if (strcmp(remainder, opt) == 0) { printf("Error parsing: %s\n", opt); exit(1); } return return_val; } void read_header(int *num_pages, int *num_frames) { scanf("%d %d\n", num_pages, num_frames); } int main(int argc, char **argv) { if (argc < 3) { printf("Usage %s <algorithm> <clock_freq>\n", argv[0]); exit(1); } char *algorithm = argv[1]; int clock_freq = parse(argv[2]); int num_pages; int num_frames; read_header(&num_pages, &num_frames); // Aponta para cada função que realmente roda a política de parse paging_policy_t policies[] = { {"fifo", *fifo}, {"second_chance", *second_chance}, {"nru", *nru}, {"aging", *aging}, {"random", *random_page} }; int n_policies = sizeof(policies) / sizeof(policies[0]); eviction_f evict = NULL; for (int i = 0; i < n_policies; i++) { if (strcmp(policies[i].name, algorithm) == 0) { evict = policies[i].function; break; } } if (evict == NULL) { printf("Please pass a valid paging algorithm.\n"); exit(1); } // Aloca tabela de páginas int8_t **page_table = (int8_t **) malloc(num_pages * sizeof(int8_t*)); for (int i = 0; i < num_pages; i++) { page_table[i] = (int8_t *) malloc(PT_FIELDS * sizeof(int8_t)); page_table[i][PT_FRAMEID] = -1; page_table[i][PT_MAPPED] = 0; page_table[i][PT_DIRTY] = 0; page_table[i][PT_REFERENCE_BIT] = 0; page_table[i][PT_REFERENCE_MODE] = 0; page_table[i][PT_AGING_COUNTER] = 0; } // Memória Real é apenas uma tabela de bits (na verdade uso ints) indicando // quais frames/molduras estão livre. 0 == livre! int *physical_memory = (int *) malloc(num_frames * sizeof(int)); for (int i = 0; i < num_frames; i++) { physical_memory[i] = 0; } int num_free_frames = num_frames; int prev_free = -1; int prev_page = -1; int fifo_frm = -1; // int *fifo_buffer; // fifo_buffer = (int *)malloc(num_frames * sizeof(int)) // Roda o simulador srand(time(NULL)); run(page_table, num_pages, &prev_page, &fifo_frm, physical_memory, &num_free_frames, num_frames, &prev_free, evict, clock_freq); // Liberando os mallocs for (int i = 0; i < num_pages; i++) { free(page_table[i]); } free(page_table); free(physical_memory); }
the_stack_data/220457061.c
#include <stdio.h> #include <string.h> #include <stdlib.h> struct nlist { struct nlist *next; char *name; char *defn; }; #define HASHSIZE 101 static struct nlist *hashtab[HASHSIZE]; /* hash: form hash value for string s */ unsigned hash(char *s) { unsigned hashval; for (hashval = 0; *s != '\0'; s++) hashval = *s + 31 * hashval; return hashval % HASHSIZE; } /* lookup: look for s in hashtab */ struct nlist *lookup(char *s) { struct nlist *np; for (np = hashtab[hash(s)]; np != NULL; np = np->next) if (strcmp(s, np->name) == 0) return np; return NULL; } /* install: put (name, defn) in hashtab */ struct nlist *install(char *name, char *defn) { struct nlist *np; unsigned hashval; if ((np = lookup(name)) == NULL) { np = (struct nlist *) malloc(sizeof(*np)); if (np == NULL || (np->name = strdup(name)) == NULL) return NULL; hashval = hash(name); np->next = hashtab[hashval]; hashtab[hashval] = np; } else free((void *) np->defn); if ((np->defn = strdup(defn)) == NULL) return NULL; return np; } int main() { char *test_input = "MAXSIZE"; char *test_output = "100"; struct nlist *np; install(test_input, test_output); np = lookup(test_input); printf("%s\n", np->defn); }
the_stack_data/23575980.c
#include<stdio.h> int main (){ int n,m,suma=0,i; printf("Digite el numero por el cual comenzar: ");scanf("%i",&n); printf("\nDigite hasta cual numero realizar la operacion: ");scanf("%i",&m); i = n; while(i<=m){ if (i%2==0){ suma=suma+i; } i++; } printf("\nLa suma es: %i",suma); return 0; }
the_stack_data/50440.c
int main(__attribute__((private(0))) int a, __attribute__((private(1))) int b) { int arr[2] = {a, b}; return arr[0] + arr[1]; }
the_stack_data/7948977.c
#include <stdio.h> int main(){ int i; for (i=0; i<256; i++){ printf("%d - %c \n", i, i); } return 0; }
the_stack_data/77306.c
#include<stdio.h> int insbeg(int max,int* a,int element,int len) { int i=0; if(max!=len) { for(i=len+1;i>0;i--) { a[i]=a[i-1]; } a[0]=element; len+=1; return len; } else { printf("OVERFLOW"); } return -2; }
the_stack_data/8547.c
void print_hello(char *s); int main() { print_hello("Android"); return 0; }
the_stack_data/59512130.c
int maior(int a[], int tam) { // Recebe: o endereco do vetor a e o seu tamanho tam (tam > 0). // Retorna: o valor do maior elemento de a. int i, maior = a[tam - 1]; for (i = 0; i < tam - 1; i++) { if (a[i] > maior) maior = a[i]; } return maior; }
the_stack_data/156392919.c
// comment number one // too many comments already!!! void main() { ; }
the_stack_data/87637734.c
main(c,i,j,a){for(scanf("%d",&c);c--&&scanf("%d",&a);puts(""))for(i=0;i<a;i++,puts(""))for(j=0;j<a;j++)printf("%c",!i||!j||j==a-1||i==a-1?35:74);}
the_stack_data/133568.c
int main(void){ int x = 0; return x + (x, x = 3); }
the_stack_data/52913.c
/*------------------------------------------------------------------ * Simple test of the JumboMem memory server * * By Scott Pakin <[email protected]> *------------------------------------------------------------------*/ /* * Copyright (C) 2010 Los Alamos National Security, LLC * * This material was produced under U.S. Government contract * DE-AC52-06NA25396 for Los Alamos National Laboratory (LANL), which * is operated by Los Alamos National Security, LLC for the * U.S. Department of Energy. The U.S. Government has rights to use, * reproduce, and distribute this software. NEITHER THE GOVERNMENT * NOR LOS ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS * OR IMPLIED, OR ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. * If software is modified to produce derivative works, such modified * software should be clearly marked so as not to confuse it with the * version available from LANL. * * Additionally, 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; version 2.0 * of the License. Accordingly, this program is distributed in the * hope that it will be useful, but WITHOUT ANY WARRANTY; without even * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU General Public License for more details. */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <inttypes.h> #include <pthread.h> /* Define some global variables. */ size_t numwords; /* Number or words to allocate */ int *array; /* Array of words */ int correct_sum; /* Expected sum of the array's contents */ /* Sum the array. */ void *sum_array (void *arg) { int sum; /* Sum of the array's contents */ uintptr_t tid = 1 + (uintptr_t) arg; size_t i; printf("Summing the array on thread %lu ... ", tid); fflush(stdout); for (i=0, sum=0; (size_t)i<numwords; i++) sum += array[i]; printf("done.\n"); if (sum != correct_sum) { printf("FAILURE: Expected %d; saw %d on thread %lu\n", correct_sum, sum, tid); return (void *)1; } printf("SUCCESS by thread %lu!\n", tid); return NULL; } int main (int argc, char *argv[]) { long numthreads; /* Number of threads to allocate */ long numbytes; /* Number of bytes to allocate */ pthread_t *thread_ids = NULL; /* List of all of our child threads */ uintptr_t exitcode; /* Status code to return from main() */ int i; /* Parse the command line. */ if (argc < 2 || argc > 3) { fprintf(stderr, "Usage: %s <gibibytes> [<threads>]\n", argv[0]); exit(1); } numbytes = atol(argv[1]); if (numbytes <= 0) { fprintf(stderr, "%s: The number of gibibytes must be positive\n", argv[0]); exit(1); } numbytes *= 1073741824; numwords = (size_t)numbytes / sizeof(int); if (argc > 2) { numthreads = atol(argv[2]); if (numthreads <= 0) { fprintf(stderr, "%s: The number of threads must be positive\n", argv[0]); exit(1); } } else numthreads = 1; /* Allocate memory. */ printf("Allocating %lu bytes of memory ... ", numbytes); fflush(stdout); if (!(array = (int *) malloc(numbytes))) { printf("failed.\n"); fflush(stdout); perror("malloc"); exit(1); } printf("done.\n"); /* Initialize the array. */ printf("Writing %lu %lu-byte words into an array ... ", numwords, sizeof(int)); fflush(stdout); for (i=0, correct_sum=0; (size_t)i<numwords; i++) { array[i] = i + 1; correct_sum += i + 1; } printf("done.\n"); /* Spawn zero or more array-summing threads. */ if (numthreads > 1) { if (!(thread_ids=malloc((numthreads-1)*sizeof(pthread_t)))) { perror("malloc"); exit(1); } for (i=0; i<numthreads-1; i++) if (pthread_create(&thread_ids[i], NULL, sum_array, (void *)(uintptr_t)(i+1))) { fprintf(stderr, "%s: Failed to create thread %d\n", argv[0], i+1); exit(1); } } /* Sum the array locally. */ exitcode = (uintptr_t) sum_array(NULL); /* Wait for each child thread to sum the array. */ for (i=0; i<numthreads-1; i++) { void *retval; /* Child's return value */ if (pthread_join(thread_ids[i], &retval)) { fprintf(stderr, "%s: Failed to join thread %d\n", argv[0], i+1); exit(1); } exitcode |= (uintptr_t) retval; } /* Deallocate memory and exit. */ printf("Freeing %lu bytes of memory ... ", numbytes); fflush(stdout); free(array); if (numthreads > 1) free(thread_ids); printf("done.\n"); return exitcode; }
the_stack_data/6388544.c
#include <stdio.h> int entry() { printf("I am module one!\n"); return 0; }
the_stack_data/132953251.c
#include<inttypes.h> void main(){ int i; i=0; while(i<5) { putchar('V'); i=i+1; } putchar('\n'); }
the_stack_data/64200332.c
#define NULL 0 struct TYPE_20__ { unsigned long naddrs; int err; } ; typedef unsigned long ngx_uint_t ; struct TYPE_19__ { struct TYPE_23__* data; } ; struct TYPE_21__ { struct TYPE_19__ peer; int host; struct TYPE_16__* servers; } ; struct TYPE_22__ { unsigned long naddrs; unsigned long weight; } ; struct TYPE_23__ { int single; unsigned long number; int weighted; unsigned long total_weight; struct TYPE_24__* peer; int name; struct TYPE_23__* next; } ; typedef struct TYPE_23__ ngx_stream_upstream_rr_peers_t ; struct TYPE_24__ { unsigned long weight; unsigned long effective_weight; } ; typedef struct TYPE_24__ ngx_stream_upstream_rr_peer_t ; struct TYPE_15__ { int pool; } ; struct TYPE_16__ { unsigned long nelts; struct TYPE_22__* elts; } ; long NGX_ERROR ; long NGX_OK ; void* ngx_pcalloc () ; struct TYPE_15__ * ngx_stream_upstream_init_round_robin_cf; long ngx_stream_upstream_init_round_robin( void) { struct TYPE_21__ * us = 0; struct TYPE_20__ u; ngx_uint_t i, j, n, w; struct TYPE_22__ *server; ngx_stream_upstream_rr_peer_t *peer, **peerp; struct TYPE_24__ *peer_0_2; ngx_stream_upstream_rr_peers_t *peers, *backup; if (us->servers) server = us->servers->elts; i = 0; for (i; i < us->servers->nelts; i++) { n += us->servers->elts[i].naddrs; w += us->servers->elts[i].naddrs * us->servers->elts[i].weight; } peers = ngx_pcalloc(); peer = ngx_pcalloc(ngx_stream_upstream_init_round_robin_cf->pool, sizeof(ngx_stream_upstream_rr_peer_t) * n); peers->number = n; peers->weighted = 0; peers->total_weight = w; peers->name = us->host; peerp = &peers->peer; i = 0; for (0; 0 < us->servers->nelts; i++) { j = 0; for (j; j < us->servers->elts[0].naddrs; j++) { *peerp = &peer[n]; peerp = &peer_0_2; } n += us->servers->elts[0].naddrs; } backup = ngx_pcalloc(); if (backup == NULL) return NGX_ERROR; backup->number = us->servers->elts[0].naddrs; backup->weighted = 0; backup->total_weight = w; backup->name = us->host; peerp = &backup->peer; i = 0; for (0; 0 < us->servers->nelts; i++) { j = 0; for (0; 0 < us->servers->elts[0].naddrs; j++) { *peerp = &peer[us->servers->elts[0].naddrs]; peerp = &peer_0_2; } } peers->next = backup; ngx_inet_resolve_host(ngx_stream_upstream_init_round_robin_cf->pool, &u) != NGX_OK; u.err; ngx_log_error(); peers = ngx_pcalloc(); peer = ngx_pcalloc(ngx_stream_upstream_init_round_robin_cf->pool, sizeof(ngx_stream_upstream_rr_peer_t) * us->servers->elts[0].naddrs); peers->number = us->servers->elts[0].naddrs; peers->weighted = 0; peers->total_weight = us->servers->elts[0].naddrs; peers->name = us->host; peerp = &peers->peer; i = 0; for (0; 0 < u.naddrs; i++) { peer[0].weight = 1; peer[0].effective_weight = 1; *peerp = &peer[0]; } us->peer.data = peers; }
the_stack_data/735216.c
#include <stdio.h> #include <stdlib.h> #include <string.h> struct node { char *first; char *last; int age; struct node *p; struct node *left; struct node *right; }; typedef struct node *node; struct tree { node root; }; struct tree *T[128]; node Create_Node () { node x = (node) malloc (sizeof (struct node)); x -> p = x -> left = x -> right = NULL; return x; } void Insert (struct tree *T, node x) { node y, z; y = NULL; z = T -> root; while (z != NULL) { y = z; if (x -> age < z -> age) z = z -> left; else z = z -> right; } if (y == NULL) T -> root = x; else if (x -> age < y -> age) y -> left = x; else y -> right = x; x -> p = y; } int Hash (node x) { printf ("Before strlen\n"); //int len = strlen (x -> last); int len = 0; for (int i = 0; x -> last[i] != '\0'; i++) len++; int sum = 0; printf ("After strlen\n"); for (int i = 0; i < len; i++) { sum += (int) x -> last[i]; } return (sum % 128); } void Insert_Data (node x) { int pos = Hash (x); printf ("Before Insert\n"); Insert (T[pos], x); } void main () { char ch; char *first, *last; int age; node x; for (int i = 0; i < 128; i++) { T[i] = (struct tree *) malloc (sizeof (struct tree)); T[i] -> root = NULL; } while (1) { scanf ("%c", &ch); switch (ch) { case 'i': x = Create_Node(); scanf ("%s", x -> first); scanf ("%s", x -> last); scanf ("%d", x -> age); printf ("%s\n%s\n%d\n", x -> first, x -> last, x -> age); Insert_Data(x); break; case 'p': exit(0); } } }
the_stack_data/181394511.c
#include <stdio.h> #include <stdlib.h> #include <math.h> int main() { int x; float y; printf("\n Enter the number: "); scanf("%d", &x); y = sqrt(x); printf("\n The square root of %d is %0.2f \n", x, y); system("pause"); return 0; }
the_stack_data/67324982.c
/* ** EPITECH PROJECT, 2020 ** is_a_letter ** File description: ** is_a_letter */ #include <stdbool.h> bool is_capital_letter(char const c); bool is_lowercase_letter(char const c); bool is_an_alpha_letter(char const c) { return (is_capital_letter(c) && is_lowercase_letter(c)); }
the_stack_data/604469.c
/* This used to ICE because PHI-OPT would produce non-gimple code. */ int f(double d0, double d1) { return d0 > 0 == d1 > 0; }
the_stack_data/24195.c
#define CONCAT(a, b) a##b #define CONCAT2(a, b) CONCAT(a, b) #define STATIC_ASSERT(condition) \ int CONCAT2(some_array, __LINE__)[(condition) ? 1 : -1] #ifdef __GNUC__ #ifndef __clang__ int x __attribute__ ((__vector_size__ (16), __may_alias__)); int x2 __attribute__ ((__may_alias__)); int x3 __attribute__ ((__may_alias__, __vector_size__ (16))); STATIC_ASSERT(sizeof(x)==16); STATIC_ASSERT(sizeof(x2)==sizeof(int)); STATIC_ASSERT(sizeof(x3)==16); #endif #endif int main(int argc, char* argv[]) { return 0; }
the_stack_data/86076315.c
// Warning: This is a generated file, do not edit it! #include <stdint.h> #include <stddef.h> const char anim_intro_16_png[] = { 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0xf0, 0x08, 0x03, 0x00, 0x00, 0x00, 0x46, 0xf3, 0x4d, 0x59, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0b, 0x12, 0x00, 0x00, 0x0b, 0x12, 0x01, 0xd2, 0xdd, 0x7e, 0xfc, 0x00, 0x00, 0x00, 0x1b, 0x74, 0x45, 0x58, 0x74, 0x53, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x00, 0x43, 0x65, 0x6c, 0x73, 0x79, 0x73, 0x20, 0x53, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x20, 0x54, 0x6f, 0x6f, 0x6c, 0xc1, 0xa7, 0xe1, 0x7c, 0x00, 0x00, 0x00, 0x48, 0x50, 0x4c, 0x54, 0x45, 0x1c, 0x23, 0x1d, 0x1e, 0xa2, 0xc2, 0x24, 0xc3, 0xea, 0x38, 0x2e, 0x11, 0x4c, 0x4b, 0x32, 0x58, 0x53, 0x67, 0x72, 0xb2, 0x32, 0x7f, 0x7a, 0x98, 0x85, 0x30, 0xaf, 0x8a, 0x8a, 0x96, 0x8a, 0xa3, 0x97, 0x8e, 0xdc, 0x3f, 0xa6, 0x3c, 0xda, 0xb0, 0xaf, 0xbf, 0xba, 0x8d, 0x6e, 0xbc, 0xef, 0xee, 0xbe, 0x19, 0x58, 0xbf, 0xf1, 0xf1, 0xd0, 0xaa, 0x2c, 0xf3, 0xf1, 0xe7, 0xf4, 0x1f, 0x71, 0xf7, 0xbf, 0x9c, 0xfd, 0xce, 0x35, 0xff, 0xff, 0xff, 0xb2, 0xc9, 0xff, 0x9d, 0x00, 0x00, 0x0a, 0x01, 0x49, 0x44, 0x41, 0x54, 0x78, 0xda, 0xed, 0xdd, 0xeb, 0x72, 0xe3, 0x28, 0x10, 0x06, 0x50, 0x25, 0x8d, 0xc7, 0x62, 0x63, 0xbc, 0xeb, 0x28, 0xf1, 0xbc, 0xff, 0x9b, 0x2e, 0x57, 0x71, 0x47, 0x28, 0x4e, 0x95, 0x04, 0x34, 0x95, 0x9a, 0x99, 0x38, 0x99, 0x3f, 0xa7, 0x3e, 0x68, 0x6e, 0xb2, 0xa7, 0xc7, 0xb1, 0x8d, 0xc0, 0x9b, 0x6c, 0x20, 0x1b, 0x79, 0x34, 0xd7, 0xa6, 0xc3, 0x01, 0x4d, 0xbb, 0xdd, 0x9a, 0x14, 0x3c, 0x1c, 0xf0, 0xe6, 0x08, 0x72, 0x43, 0x42, 0x10, 0x70, 0x0f, 0x1f, 0xb9, 0x99, 0xa6, 0x05, 0x6f, 0x37, 0xd2, 0x96, 0xe1, 0xc1, 0x80, 0x70, 0xbb, 0x39, 0x84, 0xe6, 0x6f, 0x82, 0x80, 0xd5, 0x03, 0xa0, 0x07, 0x68, 0xbe, 0x6b, 0xa9, 0x23, 0x4f, 0xa7, 0x09, 0xa0, 0x8d, 0xa0, 0x0c, 0x21, 0x41, 0xc0, 0x9d, 0x01, 0xbc, 0xdd, 0x66, 0x57, 0xb0, 0x95, 0x7e, 0x7c, 0x2c, 0xe0, 0x7c, 0x0b, 0x05, 0xd5, 0x2b, 0xf3, 0xdc, 0x8c, 0xe0, 0x74, 0xa8, 0x5f, 0x08, 0x38, 0x9b, 0x97, 0xda, 0x11, 0x9c, 0x4e, 0x14, 0x40, 0xc9, 0x36, 0x3b, 0xff, 0x26, 0x08, 0x58, 0x04, 0x9c, 0x63, 0xc0, 0xd9, 0x49, 0xe5, 0xdc, 0x44, 0x29, 0x99, 0x4e, 0x14, 0x40, 0x1d, 0xc1, 0xf9, 0xd6, 0x52, 0x08, 0xa7, 0x13, 0x05, 0xd0, 0x1b, 0x05, 0xcd, 0xb7, 0x04, 0x01, 0x6b, 0x4b, 0x48, 0x38, 0x0a, 0xb6, 0x21, 0x38, 0x9d, 0x2a, 0x80, 0xb1, 0xa0, 0xaa, 0xc7, 0x27, 0x56, 0x9c, 0x4e, 0x15, 0xc0, 0x14, 0x20, 0x2c, 0x0b, 0x17, 0x44, 0xc0, 0x68, 0x11, 0x92, 0xf5, 0xf3, 0x69, 0x67, 0x78, 0x2e, 0xcf, 0x27, 0x17, 0x24, 0xe7, 0xdc, 0xa6, 0x99, 0x4e, 0x15, 0x40, 0xd5, 0x5f, 0x83, 0x4a, 0xfc, 0xf9, 0x14, 0x80, 0x04, 0xee, 0xf7, 0x3b, 0x39, 0x9f, 0xe2, 0x99, 0x00, 0x67, 0x31, 0x0f, 0x54, 0x3d, 0x16, 0xe6, 0xb5, 0xc1, 0xe7, 0xe7, 0xf3, 0x73, 0xdd, 0x75, 0xfd, 0xfe, 0x46, 0x40, 0xdd, 0x83, 0xe7, 0x88, 0x4e, 0xb6, 0x8f, 0xe5, 0xe3, 0xe3, 0x03, 0x6c, 0xe3, 0xaf, 0x7f, 0x7e, 0x7e, 0xf2, 0x29, 0xb5, 0xc0, 0x93, 0x8d, 0x20, 0xa0, 0x3f, 0x04, 0xae, 0x76, 0x0a, 0x50, 0x36, 0x93, 0x41, 0xfd, 0xa2, 0xe8, 0xb7, 0x64, 0x3d, 0x3e, 0x21, 0x08, 0x68, 0x7b, 0xf0, 0xec, 0xf1, 0xcd, 0x1a, 0xf0, 0x8f, 0xf4, 0xd3, 0xd1, 0xe4, 0xbf, 0xa1, 0xff, 0x97, 0x6e, 0x98, 0xc0, 0x15, 0xd0, 0xf2, 0xad, 0x23, 0x1e, 0xfc, 0xe1, 0x7e, 0x7f, 0xbc, 0x22, 0x3d, 0x9f, 0x78, 0x16, 0x73, 0x68, 0x17, 0xb6, 0x35, 0x77, 0x1d, 0x10, 0xc5, 0x2b, 0x7f, 0x78, 0xf3, 0x17, 0x74, 0x08, 0xe8, 0xeb, 0xc9, 0xd1, 0x6c, 0x96, 0x58, 0x2a, 0x79, 0xc1, 0x3c, 0x26, 0x08, 0x20, 0x02, 0x06, 0x7c, 0x26, 0x76, 0x7e, 0xf6, 0x6e, 0xde, 0x98, 0x38, 0x23, 0x60, 0xa1, 0xf7, 0x7e, 0x2d, 0xcb, 0x97, 0x4e, 0x5f, 0x72, 0x32, 0x1d, 0xed, 0x28, 0x20, 0xa0, 0x07, 0x28, 0xfc, 0xbe, 0xbe, 0x72, 0x7e, 0x26, 0x85, 0x38, 0x06, 0xe6, 0x01, 0x45, 0xfb, 0x0f, 0x20, 0xe7, 0xe7, 0x9e, 0x2e, 0x21, 0x60, 0x02, 0xf0, 0x3f, 0xd9, 0x32, 0xbb, 0x09, 0xb6, 0x96, 0x20, 0x60, 0x76, 0x0c, 0x04, 0xe5, 0x57, 0x00, 0x94, 0x3b, 0xd3, 0x08, 0x58, 0x9a, 0xc5, 0x24, 0x0a, 0x70, 0x76, 0x5b, 0x10, 0x01, 0x53, 0x29, 0xdc, 0x12, 0x44, 0xc0, 0x42, 0x83, 0x68, 0x05, 0x52, 0x8c, 0x20, 0x02, 0xc6, 0x80, 0xf7, 0x95, 0xb0, 0x22, 0x82, 0x08, 0x18, 0x01, 0x7e, 0xdf, 0xef, 0x0a, 0x71, 0x2e, 0x4c, 0x06, 0x11, 0xb0, 0x00, 0xa8, 0x04, 0xef, 0xa5, 0x10, 0xda, 0x08, 0x22, 0x60, 0x02, 0xf0, 0x5b, 0x02, 0x96, 0x04, 0x6d, 0x04, 0x4f, 0x7d, 0x36, 0x7c, 0x1c, 0xa0, 0x2b, 0x98, 0x3e, 0xa1, 0x43, 0xc0, 0x12, 0xa0, 0x88, 0xa0, 0x10, 0xbc, 0x17, 0x76, 0x15, 0xcc, 0x6d, 0x41, 0x04, 0x4c, 0x01, 0x1a, 0xc1, 0xc2, 0xbe, 0x0c, 0x02, 0x66, 0xa7, 0x31, 0x46, 0x50, 0x01, 0x92, 0x34, 0xa1, 0x29, 0x23, 0x08, 0x18, 0xaf, 0x44, 0x14, 0xa0, 0xae, 0xc4, 0x44, 0xee, 0xb2, 0xc6, 0x82, 0x08, 0x58, 0x5a, 0xcb, 0x69, 0x40, 0xb8, 0xab, 0x63, 0xca, 0x64, 0x08, 0x55, 0x1f, 0x9e, 0x11, 0x30, 0xb9, 0x18, 0xbe, 0xdf, 0x75, 0x09, 0x21, 0x7a, 0x8f, 0x21, 0x0e, 0xe1, 0x6c, 0x4e, 0x87, 0x11, 0x30, 0xb9, 0x9d, 0xa0, 0xa7, 0xd2, 0x64, 0xdd, 0xa6, 0x09, 0x42, 0xb8, 0x9e, 0xda, 0x21, 0x60, 0x6a, 0x4f, 0x4b, 0x36, 0x51, 0x40, 0x88, 0xcb, 0x3a, 0xfb, 0x37, 0x7c, 0xe1, 0xfd, 0xec, 0x8f, 0xc1, 0x1e, 0xfc, 0xb4, 0x26, 0xe1, 0x05, 0xc4, 0xfb, 0x16, 0x9c, 0x3b, 0x0b, 0x9c, 0x6f, 0x59, 0xde, 0xdf, 0x11, 0x70, 0x9f, 0xa8, 0x09, 0x21, 0x07, 0x94, 0x7e, 0x42, 0x10, 0x01, 0xf7, 0x12, 0xaa, 0x0a, 0xf2, 0x2e, 0xdb, 0x1b, 0x02, 0xee, 0xae, 0x30, 0xfa, 0x9a, 0x0c, 0x02, 0xfe, 0xbc, 0x46, 0x4b, 0xc1, 0xb7, 0x37, 0xe1, 0x87, 0x80, 0x3f, 0x1d, 0x09, 0x61, 0x7d, 0x43, 0x0a, 0x04, 0xfc, 0x09, 0x21, 0x68, 0x41, 0xac, 0xc2, 0x3f, 0x27, 0xe4, 0x82, 0x38, 0x0f, 0x7c, 0x95, 0x10, 0x01, 0x5f, 0x5f, 0xf1, 0x21, 0xe0, 0xab, 0x84, 0x08, 0xf8, 0xca, 0xa2, 0x19, 0x01, 0x5f, 0x0f, 0x21, 0x02, 0xf6, 0x2b, 0x88, 0x80, 0x03, 0x00, 0x3e, 0x08, 0x02, 0xf6, 0x2b, 0x88, 0x80, 0x43, 0x00, 0x3e, 0x10, 0xb0, 0xdb, 0x08, 0x36, 0x02, 0xf8, 0x38, 0x6d, 0x21, 0x6e, 0x05, 0x90, 0x20, 0xe0, 0xcb, 0x73, 0xc1, 0x7f, 0x11, 0xb0, 0xc7, 0x08, 0x36, 0x04, 0x78, 0x4e, 0xc1, 0x66, 0x00, 0xcf, 0x2a, 0xd8, 0x0e, 0xe0, 0x03, 0x01, 0xbb, 0x1c, 0x05, 0x1b, 0x02, 0x3c, 0x67, 0x04, 0x5b, 0x02, 0x24, 0x08, 0xd8, 0x61, 0x04, 0x9b, 0x02, 0x24, 0x08, 0xd8, 0x5f, 0x04, 0xdb, 0x02, 0x24, 0x08, 0xd8, 0x5d, 0x04, 0x1b, 0x03, 0x24, 0x08, 0xf8, 0x72, 0x04, 0x11, 0xb0, 0xaf, 0x08, 0xb6, 0x06, 0xc8, 0x05, 0x11, 0xb0, 0xab, 0x08, 0x36, 0x08, 0x08, 0x08, 0xd8, 0x53, 0x04, 0x1b, 0x04, 0x3c, 0xd7, 0x28, 0xd8, 0x1e, 0x20, 0x9f, 0xca, 0x20, 0x60, 0x47, 0x73, 0xc1, 0x16, 0x01, 0xff, 0x39, 0xd3, 0x28, 0xd8, 0x22, 0xe0, 0xa9, 0xe6, 0x82, 0x4d, 0x02, 0x9e, 0xe9, 0xae, 0x51, 0x9b, 0x80, 0x27, 0x8a, 0x60, 0x9b, 0x80, 0x0f, 0x04, 0xec, 0x26, 0x82, 0x8d, 0x02, 0x9e, 0x67, 0x2a, 0xd3, 0x2a, 0x20, 0x41, 0xc0, 0x4e, 0x16, 0x74, 0xad, 0x02, 0x3e, 0x10, 0x10, 0x01, 0x51, 0x10, 0x01, 0xc7, 0x06, 0x3c, 0x87, 0x60, 0xbb, 0x80, 0x0f, 0x04, 0x44, 0x40, 0x14, 0x6c, 0x1d, 0x10, 0x10, 0xb0, 0xf9, 0x08, 0x22, 0xe0, 0xd8, 0x80, 0x80, 0x80, 0xad, 0x47, 0x10, 0x01, 0x87, 0x06, 0x3c, 0x81, 0x20, 0x02, 0x8e, 0x0d, 0x78, 0xfc, 0x01, 0x67, 0xeb, 0x80, 0x87, 0xdf, 0xd5, 0x42, 0xc0, 0xc1, 0x01, 0x1f, 0x08, 0xd8, 0x78, 0x04, 0x9b, 0x07, 0x3c, 0xfa, 0x84, 0xb8, 0x7d, 0xc0, 0x83, 0x23, 0xd8, 0x3e, 0xe0, 0xc1, 0x73, 0xc1, 0x0e, 0x00, 0x8f, 0xad, 0x23, 0x3d, 0x00, 0x1e, 0x1a, 0xc1, 0x1e, 0x00, 0x0f, 0x8d, 0x60, 0x1f, 0x80, 0x07, 0x0a, 0x76, 0x01, 0xf8, 0x40, 0xc0, 0x76, 0x23, 0xd8, 0x07, 0x60, 0x5d, 0x04, 0x89, 0xdf, 0x10, 0x70, 0x57, 0x21, 0x26, 0xf6, 0xa3, 0x0d, 0xcc, 0x1b, 0xf4, 0x13, 0x04, 0xac, 0x8d, 0x60, 0xa0, 0xc7, 0xd8, 0xef, 0x11, 0xf6, 0x02, 0x58, 0x16, 0x54, 0x7c, 0x7f, 0xa5, 0x9d, 0x69, 0xbf, 0x44, 0x38, 0x04, 0xa0, 0xf6, 0xfb, 0xfb, 0xd7, 0x05, 0xd4, 0x86, 0xaf, 0x12, 0x76, 0x03, 0x58, 0x10, 0x34, 0xdd, 0x57, 0x08, 0x32, 0x16, 0x13, 0x22, 0xe0, 0xc6, 0x54, 0x86, 0x03, 0x2e, 0xcb, 0x62, 0x07, 0xc0, 0x5f, 0x0d, 0x61, 0x3f, 0x80, 0xa4, 0x00, 0xb8, 0x2c, 0x45, 0xc1, 0x57, 0x08, 0xfb, 0x01, 0xcc, 0x0b, 0x6a, 0x40, 0x6d, 0xc8, 0x18, 0x4b, 0x11, 0x22, 0x60, 0xb6, 0x13, 0xab, 0x1e, 0x6c, 0x08, 0x05, 0x18, 0xfb, 0xc5, 0x10, 0xf6, 0x04, 0x48, 0x72, 0x80, 0x8b, 0xd3, 0x7e, 0x3b, 0x84, 0x7d, 0x01, 0x26, 0x11, 0x7c, 0x40, 0x41, 0xa8, 0xd0, 0x7e, 0xa7, 0x98, 0xf4, 0x04, 0x98, 0x11, 0x4c, 0x03, 0x7a, 0x0b, 0x13, 0x4b, 0xb8, 0x7b, 0x91, 0xdc, 0x1b, 0x60, 0xc2, 0x20, 0x04, 0x54, 0xe3, 0x60, 0x18, 0x48, 0x07, 0x75, 0x17, 0x62, 0x77, 0x80, 0xf1, 0x2a, 0x37, 0x01, 0x98, 0xe4, 0x73, 0x1c, 0xc9, 0x98, 0x09, 0x24, 0x70, 0x01, 0xf1, 0x15, 0x94, 0x84, 0x08, 0x70, 0x81, 0x62, 0x4d, 0x81, 0xc1, 0x01, 0xaf, 0x1c, 0xe0, 0xea, 0x22, 0x78, 0xd3, 0x18, 0x9f, 0x8e, 0xff, 0x24, 0x12, 0xdc, 0x59, 0x8f, 0x3b, 0x04, 0xe4, 0x7a, 0x57, 0xf1, 0x87, 0xe9, 0xc6, 0x49, 0x40, 0xb3, 0x3a, 0x06, 0xbf, 0x1f, 0x3b, 0xa3, 0x20, 0x19, 0x17, 0xf0, 0x2a, 0x00, 0xc5, 0x5f, 0x0a, 0xa1, 0x04, 0x08, 0x90, 0x29, 0x24, 0xd5, 0xb3, 0x9a, 0x9e, 0x01, 0x75, 0x0a, 0x53, 0x80, 0x96, 0xc9, 0xd4, 0x65, 0xb7, 0x0f, 0x53, 0x4a, 0xab, 0x09, 0x3b, 0x03, 0xbc, 0xe8, 0xee, 0x7b, 0xb5, 0x84, 0xb2, 0x36, 0x6f, 0x01, 0x46, 0xc3, 0xa0, 0x30, 0xe4, 0x5f, 0x64, 0x30, 0x40, 0x99, 0x3f, 0x27, 0x82, 0xb2, 0x98, 0x40, 0x01, 0xd0, 0x99, 0x1a, 0x06, 0xa5, 0x78, 0x44, 0x40, 0x11, 0xc1, 0x6b, 0xd0, 0x02, 0x28, 0x97, 0x30, 0x98, 0x5b, 0xc7, 0x93, 0x19, 0x9e, 0x42, 0x04, 0xbc, 0xe6, 0x00, 0xfd, 0x38, 0xc6, 0x7c, 0x54, 0xb6, 0xed, 0x08, 0x76, 0x0f, 0x78, 0xdd, 0x04, 0xe4, 0x7c, 0x90, 0xce, 0xdf, 0x70, 0x80, 0x0f, 0x72, 0x49, 0x08, 0x5e, 0x37, 0x04, 0x13, 0x8b, 0x39, 0x39, 0x99, 0x19, 0x12, 0x10, 0x2e, 0x97, 0xbd, 0x80, 0x90, 0x4a, 0xe0, 0x5a, 0x89, 0xd5, 0x4c, 0x72, 0x18, 0xc0, 0x74, 0x27, 0x2e, 0x0b, 0xc2, 0x92, 0x04, 0x54, 0x82, 0xdb, 0x5b, 0x33, 0xfd, 0x01, 0x66, 0x04, 0x37, 0x46, 0x41, 0x16, 0x6f, 0xf5, 0x83, 0x99, 0x51, 0x8f, 0x04, 0x98, 0x89, 0x60, 0x31, 0x83, 0xe2, 0x27, 0xa9, 0x13, 0x3b, 0x39, 0x0e, 0x6e, 0x6e, 0x2d, 0x74, 0x08, 0x78, 0xf1, 0xe5, 0x6a, 0x00, 0xa5, 0x9c, 0xba, 0x32, 0x13, 0x1c, 0x94, 0x70, 0x42, 0x3a, 0x54, 0x02, 0x43, 0x41, 0x30, 0xcb, 0xba, 0xbc, 0xa0, 0x78, 0xdd, 0x41, 0x0b, 0x17, 0xc5, 0x74, 0x6c, 0x40, 0x99, 0xbd, 0xcd, 0x71, 0xd0, 0x8b, 0x5d, 0x90, 0x41, 0x3a, 0x56, 0x17, 0x4e, 0x0b, 0xc2, 0x86, 0x60, 0x50, 0x3c, 0x82, 0x5e, 0x3c, 0x56, 0x02, 0xa3, 0x3a, 0x22, 0xaf, 0x03, 0x8a, 0x7f, 0x4c, 0x13, 0x4c, 0x35, 0x80, 0xce, 0x89, 0xe7, 0xb0, 0x80, 0xa1, 0xa0, 0xcc, 0x20, 0xe7, 0xab, 0x14, 0x5c, 0x33, 0x58, 0x71, 0xe0, 0xde, 0x25, 0x60, 0x1c, 0x41, 0xb6, 0x09, 0xe8, 0x4d, 0x61, 0xd6, 0xb3, 0xe2, 0xed, 0x23, 0xba, 0x0e, 0x01, 0x13, 0x85, 0x58, 0x38, 0xf0, 0x3e, 0xcc, 0xa7, 0x2b, 0xd3, 0x54, 0xb3, 0x23, 0xc3, 0x4b, 0x47, 0xed, 0xfd, 0xc1, 0x3e, 0x01, 0x21, 0x02, 0x14, 0x19, 0x14, 0x76, 0x3b, 0x01, 0xb7, 0x0f, 0xe9, 0x7a, 0x04, 0x8c, 0x23, 0x28, 0x25, 0x94, 0x5d, 0x56, 0x90, 0xa5, 0x01, 0xb7, 0x3a, 0xf1, 0x38, 0x80, 0x4c, 0xd3, 0x4d, 0x49, 0xc2, 0x6c, 0x02, 0x87, 0x04, 0x0c, 0x66, 0x32, 0xe6, 0x3a, 0xd6, 0xa4, 0xa9, 0x62, 0x42, 0x08, 0xce, 0x95, 0x10, 0xd0, 0x8b, 0xe0, 0x5a, 0x53, 0x57, 0xc1, 0xa8, 0x96, 0xc0, 0x12, 0xac, 0x40, 0xa8, 0xcb, 0x39, 0x1e, 0xa0, 0x8e, 0xa0, 0x5e, 0x83, 0xac, 0x36, 0x93, 0xce, 0x1e, 0x44, 0xd5, 0x18, 0xbc, 0x3e, 0x1c, 0x00, 0x16, 0x05, 0xfb, 0x05, 0x14, 0x77, 0x3c, 0xe4, 0xf9, 0xb8, 0x05, 0x94, 0x82, 0x92, 0x4e, 0x10, 0xfa, 0x43, 0x20, 0x05, 0x77, 0xfa, 0x4c, 0x47, 0x07, 0x14, 0xa7, 0x23, 0xe2, 0x94, 0x5d, 0x11, 0x3a, 0xbd, 0x33, 0x14, 0x54, 0x4f, 0x40, 0xf0, 0x2f, 0x7d, 0x19, 0x41, 0xef, 0x61, 0xd1, 0xea, 0xfb, 0x6e, 0xdd, 0x02, 0xea, 0xab, 0x6e, 0x34, 0xd8, 0x60, 0x71, 0xfb, 0xb1, 0x96, 0x34, 0x80, 0x74, 0xd5, 0x0b, 0xfc, 0x8a, 0x11, 0xec, 0x15, 0x50, 0x44, 0x50, 0x03, 0x86, 0x27, 0x1e, 0x7e, 0x08, 0x35, 0xe0, 0xa2, 0x4e, 0x31, 0x25, 0x5f, 0xe2, 0x7c, 0x64, 0x48, 0x40, 0x93, 0xc0, 0xb8, 0x39, 0x82, 0x93, 0xdc, 0x90, 0x5e, 0x54, 0x04, 0xd5, 0xfe, 0x29, 0x02, 0xae, 0x0b, 0x3a, 0xc8, 0x00, 0x1a, 0x42, 0x29, 0x08, 0xea, 0xc2, 0xb4, 0x06, 0xa4, 0x90, 0xfc, 0x7d, 0x04, 0x4c, 0x11, 0xea, 0x10, 0xea, 0x8b, 0xaa, 0x94, 0x15, 0x04, 0xf3, 0x11, 0xec, 0x18, 0x90, 0x40, 0x6e, 0x48, 0x63, 0xce, 0xd2, 0x4e, 0x09, 0x2e, 0xaa, 0xf0, 0x66, 0x05, 0x47, 0x04, 0xd4, 0x19, 0xcc, 0x03, 0x9a, 0xc5, 0xb1, 0x5b, 0x7b, 0x29, 0x4d, 0x8b, 0x0f, 0x0c, 0x58, 0x12, 0x5c, 0x43, 0xb8, 0x66, 0x55, 0xcd, 0x65, 0x10, 0xb0, 0x32, 0x82, 0xee, 0x50, 0x28, 0x7f, 0x51, 0x96, 0xe1, 0xe8, 0x88, 0x64, 0x70, 0xc0, 0x6d, 0x41, 0x63, 0xa8, 0x00, 0xc5, 0x06, 0x7f, 0x7c, 0x48, 0x92, 0x15, 0x1c, 0x00, 0x70, 0x43, 0x50, 0x2b, 0x82, 0xb9, 0x0a, 0x93, 0x38, 0xa5, 0x1b, 0x16, 0xb0, 0x5e, 0xd0, 0x3e, 0xdf, 0xa0, 0xd2, 0xb7, 0x54, 0x3f, 0xca, 0x39, 0x04, 0x60, 0xa5, 0x20, 0x9f, 0xc0, 0x50, 0x85, 0xb7, 0x78, 0x82, 0xc5, 0x93, 0xa5, 0x31, 0x00, 0xab, 0x04, 0xcd, 0xbe, 0x8d, 0x18, 0x02, 0x97, 0xa5, 0xf6, 0x71, 0xec, 0xae, 0xa7, 0x31, 0x04, 0x00, 0x76, 0x76, 0x62, 0x01, 0xb8, 0xb0, 0x28, 0x80, 0x43, 0x02, 0x12, 0x6f, 0x83, 0x8f, 0x56, 0x03, 0x32, 0x16, 0x03, 0xb2, 0x31, 0x01, 0xf5, 0xa6, 0x6a, 0xad, 0xa0, 0x33, 0x85, 0x5e, 0xaa, 0x23, 0x38, 0x8d, 0xe1, 0x57, 0xd5, 0x89, 0x9d, 0x25, 0x88, 0x7f, 0xe3, 0x8d, 0x8d, 0x0b, 0x08, 0x60, 0x10, 0x2b, 0x22, 0xe8, 0x2c, 0xe1, 0x82, 0x2b, 0x83, 0x90, 0x9f, 0x09, 0x76, 0xbd, 0x9d, 0xa5, 0x01, 0x15, 0xe1, 0x0b, 0x80, 0xac, 0x90, 0xc1, 0xce, 0x01, 0x75, 0xab, 0xae, 0x23, 0x56, 0xd0, 0x97, 0xcd, 0x0f, 0x83, 0xe3, 0x00, 0xee, 0x13, 0x8c, 0xab, 0x08, 0x1b, 0x1e, 0x10, 0x72, 0xfb, 0xf5, 0x5b, 0x82, 0xaa, 0x0f, 0x67, 0x86, 0xc1, 0xbe, 0xe7, 0x81, 0x0e, 0xe0, 0xa5, 0x76, 0x3a, 0x1d, 0x01, 0xca, 0xeb, 0x85, 0xd9, 0xe3, 0xe1, 0x71, 0x00, 0x2f, 0xe6, 0x09, 0x4c, 0xba, 0x7f, 0x18, 0x84, 0xfc, 0x01, 0x7b, 0xdf, 0x3b, 0xd2, 0xba, 0xf7, 0x2a, 0xc0, 0xcb, 0xae, 0x75, 0x5d, 0xb8, 0x23, 0x33, 0x26, 0xa0, 0xc3, 0x66, 0x4b, 0x49, 0x0e, 0x10, 0x7e, 0x24, 0xd8, 0xf9, 0x86, 0xea, 0x5a, 0x41, 0xdc, 0x52, 0x92, 0xe9, 0xc5, 0x55, 0x80, 0x91, 0x60, 0xef, 0xdb, 0x59, 0x06, 0xee, 0xe2, 0xaf, 0xeb, 0x6a, 0xfc, 0xd8, 0x52, 0xf3, 0xb6, 0x5a, 0xfd, 0xef, 0x07, 0x9a, 0x1a, 0x62, 0xe7, 0x83, 0xc9, 0x39, 0x21, 0x54, 0x8d, 0x82, 0x6c, 0x30, 0x40, 0xbb, 0xa5, 0x75, 0xf1, 0x23, 0x18, 0xbf, 0x17, 0x2d, 0xab, 0x04, 0x0c, 0x05, 0xc7, 0x02, 0xb4, 0x33, 0xea, 0xaa, 0x52, 0x8c, 0x80, 0x56, 0xd0, 0x5f, 0x93, 0x54, 0x4e, 0x08, 0x97, 0x8a, 0x3b, 0x0a, 0xbd, 0x03, 0x86, 0x82, 0xae, 0x9f, 0x24, 0x84, 0xfd, 0x11, 0x24, 0x63, 0x01, 0x12, 0xbf, 0x1b, 0xdb, 0x08, 0xa6, 0x86, 0x42, 0x71, 0xb9, 0x63, 0x0b, 0xd0, 0x27, 0xec, 0x1e, 0xd0, 0x1d, 0x08, 0xc1, 0x5d, 0x8d, 0x64, 0x7a, 0xb0, 0xbc, 0xe0, 0xb1, 0x01, 0x28, 0xdf, 0xcb, 0x63, 0x20, 0xc0, 0x47, 0xf4, 0x59, 0x2c, 0x76, 0x1e, 0x03, 0x21, 0x9f, 0xb8, 0xe0, 0x01, 0xc5, 0x41, 0xd0, 0xff, 0x30, 0x92, 0x21, 0x00, 0xfd, 0x13, 0xba, 0xd2, 0x29, 0x13, 0x55, 0x9d, 0xbb, 0x04, 0x28, 0xcd, 0xed, 0x92, 0x64, 0x10, 0x40, 0xf9, 0x99, 0x41, 0xdb, 0x80, 0x34, 0xec, 0xdc, 0xc9, 0x9b, 0x5a, 0xde, 0xa2, 0x6e, 0x1c, 0x40, 0x70, 0x00, 0x2f, 0x49, 0x41, 0x79, 0xb9, 0x0d, 0xfc, 0xcd, 0x86, 0x1c, 0x20, 0x33, 0x9d, 0x78, 0x18, 0x40, 0xf9, 0xb1, 0x55, 0x7e, 0x31, 0xa1, 0xb6, 0xee, 0x52, 0xe3, 0x17, 0x6e, 0xd6, 0x64, 0x01, 0x4d, 0x06, 0x47, 0x01, 0x5c, 0x3f, 0xf8, 0xcb, 0xd9, 0xdb, 0xa2, 0xf6, 0x5e, 0xb4, 0xba, 0x5c, 0xa9, 0x02, 0x08, 0x75, 0x80, 0x7a, 0x4a, 0x38, 0x1a, 0xa0, 0xb7, 0x39, 0xb8, 0xb2, 0xa9, 0xda, 0xab, 0x09, 0x81, 0x56, 0x9f, 0x7e, 0x72, 0xc2, 0xe1, 0x12, 0xf8, 0x70, 0xa7, 0xd4, 0xe6, 0xe9, 0x24, 0xf3, 0x76, 0x8b, 0xb4, 0xb4, 0xd9, 0x95, 0x7e, 0x8b, 0xb7, 0x71, 0x00, 0xdd, 0x3e, 0x6c, 0x01, 0x61, 0xf5, 0x33, 0x4f, 0x26, 0xd2, 0x3d, 0x80, 0x8c, 0x8d, 0x07, 0xf8, 0x08, 0x37, 0xb7, 0x28, 0x35, 0x49, 0xd4, 0x05, 0x7a, 0xeb, 0xea, 0xd6, 0xb8, 0x80, 0x90, 0x02, 0xa4, 0xb6, 0x2b, 0xab, 0xfa, 0xcc, 0x10, 0x70, 0xb3, 0x0f, 0xc7, 0x9b, 0x5b, 0xce, 0xd1, 0x13, 0xdb, 0x25, 0x88, 0x80, 0x5e, 0xff, 0xe5, 0x2f, 0xd1, 0x7d, 0x7d, 0x78, 0x24, 0x40, 0x67, 0x26, 0x13, 0x44, 0xd0, 0xdb, 0x2f, 0xa4, 0x50, 0xbe, 0x43, 0x3d, 0x3c, 0xa0, 0x1b, 0x41, 0xf7, 0xd4, 0x53, 0x7f, 0x47, 0xd9, 0xae, 0x51, 0x70, 0x28, 0x40, 0xfd, 0x7e, 0xc6, 0x3e, 0xe0, 0x25, 0xc0, 0xcc, 0xdf, 0x40, 0x42, 0x40, 0xdb, 0x87, 0xf3, 0x7e, 0x99, 0x62, 0x9b, 0xcd, 0xe0, 0x58, 0x80, 0xc5, 0x08, 0xc2, 0x96, 0x1f, 0x1b, 0x7e, 0x0c, 0x2c, 0x47, 0x50, 0xef, 0xd1, 0xd4, 0x3d, 0x07, 0xd1, 0x09, 0xe0, 0xee, 0x8f, 0xd1, 0x2b, 0xf7, 0xe1, 0x8d, 0x00, 0x26, 0x23, 0x38, 0x35, 0xcd, 0xb7, 0xff, 0x23, 0x31, 0x4d, 0x1f, 0xce, 0xf9, 0x31, 0x96, 0x7a, 0x5a, 0xb3, 0x43, 0x40, 0x62, 0x8e, 0x2b, 0x9f, 0xbf, 0x17, 0xc1, 0xf5, 0x59, 0xcd, 0xad, 0x08, 0x42, 0xf3, 0x80, 0x0a, 0xef, 0x29, 0xdb, 0xbe, 0x08, 0xae, 0x53, 0xc1, 0xa4, 0x5f, 0x29, 0x7d, 0x16, 0xd0, 0x7f, 0x2f, 0xa9, 0x46, 0x6b, 0xc1, 0xd3, 0xb6, 0x9f, 0x45, 0x30, 0x05, 0xc8, 0x36, 0x01, 0xcd, 0x53, 0x37, 0x8d, 0x03, 0x7a, 0x7e, 0x3f, 0x02, 0x4c, 0x09, 0x56, 0x04, 0x30, 0xb1, 0xa0, 0x6b, 0x13, 0xd0, 0xf5, 0xdb, 0xdd, 0x87, 0x21, 0x58, 0x0f, 0xdb, 0x00, 0xb2, 0x6d, 0x3f, 0x16, 0x04, 0x90, 0xfd, 0x0f, 0xe2, 0x5b, 0xbe, 0x1a, 0x03, 0x3c, 0xbf, 0xb1, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 }; const size_t anim_intro_16_png_len = sizeof(anim_intro_16_png) / sizeof(char);
the_stack_data/89199737.c
#include <stdint.h> const uint8_t factory_calibration[] __attribute__((section(".calibrationSegment"))) = { 0x58,0x44,0x4D,0x32,0x30,0x34,0x31,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0x56,0x31,0x2E,0x39,0x2E,0x30,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x32,0x30,0x33,0x38,0x32,0x37,0x34,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x56,0x43,0x37,0x30,0x35,0x35,0x42,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x56,0x6F,0x6C,0x74,0x63,0x72,0x61,0x66,0x74,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x01,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4C,0x4C,0x50, 0xEA,0xE1,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x56,0x31,0x2E,0x33,0x00, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0x00,0xFF,0xFF,0xFF,0xA4,0x9E,0x0F,0x00,0x61,0x9E,0x0F,0x00, 0xE9,0xB0,0x0F,0x00,0xE3,0xD8,0x0F,0x00,0x68,0xB2,0x0F,0x00,0xC9,0xB1,0x0F,0x00, 0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00, 0x29,0xA4,0x0F,0x00,0x4B,0xB8,0x0F,0x00,0x5F,0xDE,0x0F,0x00,0x36,0xA0,0x0F,0x00, 0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00, 0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x33,0x71,0x0F,0x00,0x6F,0x70,0x0F,0x00, 0x69,0x9A,0x0F,0x00,0xE8,0x98,0x0F,0x00,0xA2,0x8B,0x12,0x00,0x21,0x8C,0x12,0x00, 0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00, 0x40,0x42,0x0F,0x00,0xE9,0x7F,0x0F,0x00,0x39,0xA6,0x0F,0x00,0xA3,0xA5,0x0F,0x00, 0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00, 0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00, 0x40,0x42,0x0F,0x00,0x1B,0xF2,0x0D,0x00,0x8F,0x6D,0x0F,0x00,0x56,0x8B,0x0F,0x00, 0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00, 0xFB,0x61,0x0F,0x00,0xA2,0x60,0x0F,0x00,0x64,0x3B,0x0F,0x00,0x40,0x42,0x0F,0x00, 0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00, 0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00, 0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00, 0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00, 0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00, 0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00, 0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x20,0x59,0x0E,0x00,0x1B,0x5D,0x0E,0x00, 0xC5,0x45,0x0F,0x00,0x85,0x93,0x0F,0x00,0x24,0x29,0x14,0x00,0xBD,0xCD,0x0E,0x00, 0x37,0xB2,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00, 0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00, 0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00, 0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00, 0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00, 0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00,0x40,0x42,0x0F,0x00, 0x37,0xF4,0xFC,0xFF,0x3A,0x1B,0xFD,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xB4,0xA8,0xFC,0xFF,0xE2,0xF7,0xFF,0xFF,0x2E,0xB9,0xFF,0xFF,0x3D,0x76,0xFD,0xFF, 0x4A,0xFC,0xFF,0xFF,0xB7,0xDA,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xCA,0x0B,0x00,0x00,0x08,0x0F,0x00,0x00,0x05,0x00,0x00,0x00,0x28,0x03,0x00,0x00, 0x74,0x10,0x00,0x00,0x04,0x00,0x00,0x00,0x2D,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x0E,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6B,0x00,0x7F,0x00,0x9E,0x06,0x00,0x00, 0x00,0x00,0x00,0x00,0xB5,0xCD,0x00,0x00,0xBC,0xEC,0xD1,0xE9,0xBA,0xCD,0x00,0x00, 0xCD,0xA8,0xB6,0xCF,0x00,0x00,0x00,0x00,0xD6,0xD0,0x00,0x00,0xCA,0xB1,0xD6,0xD3, 0x00,0x00,0x00,0x00,0xC6,0xC1,0xC4,0xBB,0xB2,0xE2,0xCA,0xD4,0x00,0x00,0x00,0x00, 0xB0,0xB4,0xBC,0xFC,0xB2,0xE2,0xCA,0xD4,0x00,0x00,0x00,0x00,0xCB,0xAB,0xCF,0xD4, 0x00,0x00,0x00,0x00,0xD3,0xEF,0xD1,0xD4,0x00,0x00,0x00,0x00,0xB9,0xD8,0x00,0x00, 0xB7,0xB5,0xBB,0xD8,0x00,0x00,0x00,0x00,0xBC,0xD3,0xD4,0xD8,0x00,0x00,0x00,0x00, 0xD6,0xDC,0xC6,0xDA,0x00,0x00,0x00,0x00,0xB6,0xFE,0xBC,0xAB,0xB9,0xDC,0x00,0x00, 0xB9,0xA6,0xC4,0xDC,0x00,0x00,0x00,0x00,0xB5,0xE7,0xC8,0xDD,0x00,0x00,0x00,0x00, 0xB8,0xDF,0x00,0x00,0xB8,0xC4,0xB1,0xE4,0x00,0x00,0x00,0x00,0xBC,0xE4,0xB8,0xF4, 0xCA,0xB1,0xBC,0xE4,0x00,0x00,0x00,0x00,0xCF,0xE0,0xB6,0xD4,0xB5,0xE7,0xD7,0xE8, 0x00,0x00,0x00,0x00,0xC1,0xBD,0xCF,0xDF,0xB5,0xE7,0xD7,0xE8,0x00,0x00,0x00,0x00, 0xCB,0xC4,0xCF,0xDF,0xB5,0xE7,0xD7,0xE8,0x00,0x00,0x00,0x00,0xD0,0xA3,0xD1,0xE9, 0x00,0x00,0x00,0x00,0xCD,0xCB,0xB3,0xF6,0x00,0x00,0x00,0x00,0xD6,0xB1,0xC1,0xF7, 0xB5,0xE7,0xC1,0xF7,0x00,0x00,0x00,0x00,0xBD,0xBB,0xC1,0xF7,0xB5,0xE7,0xC1,0xF7, 0x00,0x00,0x00,0x00,0xB7,0xE4,0xC3,0xF9,0xC6,0xF7,0x00,0x00,0xBD,0xE1,0xCA,0xF8, 0x00,0x00,0x00,0x00,0xC8,0xA1,0xCF,0xFB,0x00,0x00,0x00,0x00,0xC7,0xE5,0xB3,0xFD, 0xB6,0xC1,0xCA,0xFD,0x00,0x00,0x00,0x00,0xB5,0xE3,0xCA,0xFD,0x00,0x00,0x00,0x00, 0x6D,0x41,0x41,0x43,0x00,0x00,0x00,0x00,0x75,0x41,0x41,0x43,0x00,0x00,0x00,0x00, 0x41,0x41,0x43,0x00,0x6D,0x56,0x41,0x43,0x00,0x00,0x00,0x00,0x56,0x41,0x43,0x00, 0x6D,0x41,0x44,0x43,0x00,0x00,0x00,0x00,0x75,0x41,0x44,0x43,0x00,0x00,0x00,0x00, 0x41,0x44,0x43,0x00,0x6D,0x56,0x44,0x43,0x00,0x00,0x00,0x00,0x56,0x44,0x43,0x00, 0x6D,0x46,0x00,0x00,0x6E,0x46,0x00,0x00,0x75,0x46,0x00,0x00,0x6D,0x73,0x00,0x00, 0x75,0x73,0x00,0x00,0x73,0x00,0x00,0x00,0x4D,0x48,0x7A,0x00,0x6B,0x48,0x7A,0x00, 0x48,0x7A,0x00,0x00,0x4D,0xA6,0xB8,0x00,0x6B,0xA6,0xB8,0x00,0xA6,0xB8,0x00,0x00, 0x50,0x74,0x31,0x30,0x30,0x00,0x00,0x00,0x4B,0x49,0x54,0x53,0x39,0x30,0x00,0x00, 0x31,0x30,0x20,0x41,0x00,0x00,0x00,0x00,0x35,0x20,0x41,0x00,0x35,0x30,0x30,0x20, 0x6D,0x41,0x00,0x00,0x35,0x30,0x20,0x6D,0x41,0x00,0x00,0x00,0x35,0x20,0x6D,0x41, 0x00,0x00,0x00,0x00,0x35,0x30,0x30,0x20,0x75,0x41,0x00,0x00,0x35,0x30,0x20,0x6D, 0x46,0x00,0x00,0x00,0x35,0x20,0x6D,0x46,0x00,0x00,0x00,0x00,0x35,0x30,0x30,0x20, 0x6E,0x46,0x00,0x00,0x35,0x30,0x20,0x6E,0x46,0x00,0x00,0x00,0x35,0x30,0x30,0x20, 0x75,0x46,0x00,0x00,0x35,0x30,0x20,0x75,0x46,0x00,0x00,0x00,0x35,0x20,0x75,0x46, 0x00,0x00,0x00,0x00,0x31,0x30,0x30,0x30,0x20,0x56,0x00,0x00,0x35,0x30,0x30,0x20, 0x56,0x00,0x00,0x00,0x37,0x35,0x30,0x20,0x56,0x00,0x00,0x00,0x35,0x30,0x20,0x56, 0x00,0x00,0x00,0x00,0x35,0x20,0x56,0x00,0x35,0x30,0x30,0x20,0x6D,0x56,0x00,0x00, 0x35,0x30,0x20,0x6D,0x56,0x00,0x00,0x00,0x35,0x30,0x30,0x20,0xA6,0xB8,0x00,0x00, 0x35,0x30,0x30,0x20,0x4B,0xA6,0xB8,0x00,0x35,0x30,0x20,0x4B,0xA6,0xB8,0x00,0x00, 0x35,0x20,0x4B,0xA6,0xB8,0x00,0x00,0x00,0x31,0x30,0x30,0x20,0x4D,0xA6,0xB8,0x00, 0x35,0x30,0x20,0x4D,0xA6,0xB8,0x00,0x00,0x35,0x20,0x4D,0xA6,0xB8,0x00,0x00,0x00, 0x35,0x30,0x30,0x20,0x6B,0xA6,0xB8,0x00,0x35,0x30,0x20,0x6B,0xA6,0xB8,0x00,0x00, 0x35,0x20,0x6B,0xA6,0xB8,0x00,0x00,0x00,0x22,0x43,0x55,0x52,0x52,0x20,0x41,0x43, 0x22,0x00,0x00,0x00,0x22,0x56,0x4F,0x4C,0x54,0x20,0x41,0x43,0x22,0x00,0x00,0x00 };
the_stack_data/248579444.c
// // Created by manasabhilash on 8/27/18. // #include <stdio.h> #include <stdlib.h> struct node { int info; struct node *next; }; typedef struct node NODE; NODE* insertFront(NODE* head, int x){ NODE *p = (NODE*) malloc(sizeof(NODE)); if(head == NULL) { p->info = x; p->next = p; return p; } p->info = x; p->next = head; return p; } NODE* insertEnd(NODE* head, int x){ NODE *q = (NODE*) malloc(sizeof(NODE)); NODE *p = head; if(p == NULL) { q->info = x; q->next = q; return q; } while(p->next != head) { p = p->next; } p->next = q; q->info = x; q->next = head; return head; } NODE* deleteStart(NODE* head){ NODE *p = head; if(p == NULL) { printf("There Are No elements in the List\n"); return NULL; } if(p->next == head) { printf("The Deleted Element is %d \n",p->info); free(p); return NULL; } while(p->next != head) { p = p->next; } printf("The Deleted Element is %d \n",head->info); p->next = head->next; free(head); head = p->next; return head; } NODE* deleteEnd(NODE* head){ NODE *p = head, *q; if(p == NULL) { printf("There Are No elments in the List\n"); return head; } while(p->next != head) { q->next = p; p = p->next; } q->next = head; printf("The Deleted Element is %d \n",p->info); free(p); return head; } NODE* deleteX(NODE* head, int x){ NODE *p = head, *q; int i = 0; if(p == NULL) { printf("No Elements to Delete\n"); return p; }else { if(p->info == x) { while(p->next != head) { q->next = p; p = p->next; } q->next = head; printf("The Deleted Element is %d \n",p->info); free(p); return head; }else { while (p->info != x) { q = p; p = p->next; if (p->next == head) { i = 1; } } if (i) { printf("NO %d present in the list", x); } else { q->next = p->next; printf("Element is deleted is %d\n", p->info); free(p); } } return head; } } void display(NODE* head) { NODE *p = head; if(p == NULL) { printf("No Elements in List\n"); }else { while (p->next != head) { printf("%d\n", p->info); p = p->next; } printf("%d\n", p->info); } } NODE* insertX(NODE* head, int val, int x){ NODE *p = head; NODE *q = (NODE *) malloc(sizeof(NODE)); if(head == NULL) { printf("NO Elements present in the list\n"); free(q); return head; }else { while(p->info != x || p->next != head) { p = p->next; } if(p->info == x) { q->next = p->next; q->info = val; p->next = q; return head; } } } void main() { NODE *head = NULL; int n, val, x; while(1) { printf("Welcome to Linked List\n"); printf("Select a operation\n"); printf("1.INSERT AT START\n2.INSERT AT END\n3.INSERT AFTER X\n4.DELETE AT START\n5.DELETE AT END\n6.DELETE X\n7.DISPLAY LIST\n8.CREATE LIST\n9.EXIT\n10.INSERT BEFORE X"); scanf("%d", &n); switch (n) { case 1: printf("Enter the element\n"); scanf("%d", &val); head = insertFront(head, val); printf("%d\t",head->info); break; case 2: printf("Enter the element\n"); scanf("%d", &val); head = insertEnd(head, val); break; case 3: printf("Enter The Element after which the number should be inserted\n"); scanf("%d", &x); printf("Enter The Element to be Inserted\n"); scanf("%d", &val); head = insertX(head, val, x); break; case 4: head = deleteStart(head); break; case 5: head = deleteEnd(head); break; case 6: printf("Enter The Element which is to be Deleted\n"); scanf("%d", &x); head = deleteX(head, x); break; case 7: display(head); break; case 9: return; case 8: printf("Enter The Value of x :"); scanf("%d",&x); //head = createList(head, x); break; case 10: printf("Enter The Number to be inserted\n"); scanf("%d",&x); printf("Enter The Value Before which element should be inserted\n"); scanf("%d",&val); //head = insertBefore(head, x, val); break; default: break; } } }
the_stack_data/36074049.c
#include <sys/epoll.h> #include <signal.h> #include "syscall.h" int epoll_create(int size) { return syscall(SYS_epoll_create, size); } int epoll_create1(int flags) { return syscall(SYS_epoll_create1, flags); } int epoll_ctl(int fd, int op, int fd2, struct epoll_event *ev) { return syscall(SYS_epoll_ctl, fd, op, fd2, ev); } int epoll_pwait(int fd, struct epoll_event *ev, int cnt, int to, const sigset_t *sigs) { return syscall(SYS_epoll_pwait, fd, ev, cnt, to, sigs, _NSIG/8); } int epoll_wait(int fd, struct epoll_event *ev, int cnt, int to) { return syscall(SYS_epoll_wait, fd, ev, cnt, to); }
the_stack_data/176706841.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__1 = 1; static integer c_n1 = -1; /* > \brief <b> DSYEVX computes the eigenvalues and, optionally, the left and/or right eigenvectors for SY mat rices</b> */ /* =========== DOCUMENTATION =========== */ /* Online html documentation available at */ /* http://www.netlib.org/lapack/explore-html/ */ /* > \htmlonly */ /* > Download DSYEVX + dependencies */ /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dsyevx. f"> */ /* > [TGZ]</a> */ /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dsyevx. f"> */ /* > [ZIP]</a> */ /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dsyevx. f"> */ /* > [TXT]</a> */ /* > \endhtmlonly */ /* Definition: */ /* =========== */ /* SUBROUTINE DSYEVX( JOBZ, RANGE, UPLO, N, A, LDA, VL, VU, IL, IU, */ /* ABSTOL, M, W, Z, LDZ, WORK, LWORK, IWORK, */ /* IFAIL, INFO ) */ /* CHARACTER JOBZ, RANGE, UPLO */ /* INTEGER IL, INFO, IU, LDA, LDZ, LWORK, M, N */ /* DOUBLE PRECISION ABSTOL, VL, VU */ /* INTEGER IFAIL( * ), IWORK( * ) */ /* DOUBLE PRECISION A( LDA, * ), W( * ), WORK( * ), Z( LDZ, * ) */ /* > \par Purpose: */ /* ============= */ /* > */ /* > \verbatim */ /* > */ /* > DSYEVX computes selected eigenvalues and, optionally, eigenvectors */ /* > of a real symmetric matrix A. Eigenvalues and eigenvectors can be */ /* > selected by specifying either a range of values or a range of indices */ /* > for the desired eigenvalues. */ /* > \endverbatim */ /* Arguments: */ /* ========== */ /* > \param[in] JOBZ */ /* > \verbatim */ /* > JOBZ is CHARACTER*1 */ /* > = 'N': Compute eigenvalues only; */ /* > = 'V': Compute eigenvalues and eigenvectors. */ /* > \endverbatim */ /* > */ /* > \param[in] RANGE */ /* > \verbatim */ /* > RANGE is CHARACTER*1 */ /* > = 'A': all eigenvalues will be found. */ /* > = 'V': all eigenvalues in the half-open interval (VL,VU] */ /* > will be found. */ /* > = 'I': the IL-th through IU-th eigenvalues will be found. */ /* > \endverbatim */ /* > */ /* > \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 order of the matrix A. N >= 0. */ /* > \endverbatim */ /* > */ /* > \param[in,out] A */ /* > \verbatim */ /* > A is DOUBLE PRECISION 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. If UPLO = 'L', */ /* > the leading N-by-N lower triangular part of A contains */ /* > the lower triangular part of the matrix A. */ /* > On exit, the lower triangle (if UPLO='L') or the upper */ /* > triangle (if UPLO='U') of A, including the diagonal, is */ /* > destroyed. */ /* > \endverbatim */ /* > */ /* > \param[in] LDA */ /* > \verbatim */ /* > LDA is INTEGER */ /* > The leading dimension of the array A. LDA >= f2cmax(1,N). */ /* > \endverbatim */ /* > */ /* > \param[in] VL */ /* > \verbatim */ /* > VL is DOUBLE PRECISION */ /* > If RANGE='V', the lower bound of the interval to */ /* > be searched for eigenvalues. VL < VU. */ /* > Not referenced if RANGE = 'A' or 'I'. */ /* > \endverbatim */ /* > */ /* > \param[in] VU */ /* > \verbatim */ /* > VU is DOUBLE PRECISION */ /* > If RANGE='V', the upper bound of the interval to */ /* > be searched for eigenvalues. VL < VU. */ /* > Not referenced if RANGE = 'A' or 'I'. */ /* > \endverbatim */ /* > */ /* > \param[in] IL */ /* > \verbatim */ /* > IL is INTEGER */ /* > If RANGE='I', the index of the */ /* > smallest eigenvalue to be returned. */ /* > 1 <= IL <= IU <= N, if N > 0; IL = 1 and IU = 0 if N = 0. */ /* > Not referenced if RANGE = 'A' or 'V'. */ /* > \endverbatim */ /* > */ /* > \param[in] IU */ /* > \verbatim */ /* > IU is INTEGER */ /* > If RANGE='I', the index of the */ /* > largest eigenvalue to be returned. */ /* > 1 <= IL <= IU <= N, if N > 0; IL = 1 and IU = 0 if N = 0. */ /* > Not referenced if RANGE = 'A' or 'V'. */ /* > \endverbatim */ /* > */ /* > \param[in] ABSTOL */ /* > \verbatim */ /* > ABSTOL is DOUBLE PRECISION */ /* > The absolute error tolerance for the eigenvalues. */ /* > An approximate eigenvalue is accepted as converged */ /* > when it is determined to lie in an interval [a,b] */ /* > of width less than or equal to */ /* > */ /* > ABSTOL + EPS * f2cmax( |a|,|b| ) , */ /* > */ /* > where EPS is the machine precision. If ABSTOL is less than */ /* > or equal to zero, then EPS*|T| will be used in its place, */ /* > where |T| is the 1-norm of the tridiagonal matrix obtained */ /* > by reducing A to tridiagonal form. */ /* > */ /* > Eigenvalues will be computed most accurately when ABSTOL is */ /* > set to twice the underflow threshold 2*DLAMCH('S'), not zero. */ /* > If this routine returns with INFO>0, indicating that some */ /* > eigenvectors did not converge, try setting ABSTOL to */ /* > 2*DLAMCH('S'). */ /* > */ /* > See "Computing Small Singular Values of Bidiagonal Matrices */ /* > with Guaranteed High Relative Accuracy," by Demmel and */ /* > Kahan, LAPACK Working Note #3. */ /* > \endverbatim */ /* > */ /* > \param[out] M */ /* > \verbatim */ /* > M is INTEGER */ /* > The total number of eigenvalues found. 0 <= M <= N. */ /* > If RANGE = 'A', M = N, and if RANGE = 'I', M = IU-IL+1. */ /* > \endverbatim */ /* > */ /* > \param[out] W */ /* > \verbatim */ /* > W is DOUBLE PRECISION array, dimension (N) */ /* > On normal exit, the first M elements contain the selected */ /* > eigenvalues in ascending order. */ /* > \endverbatim */ /* > */ /* > \param[out] Z */ /* > \verbatim */ /* > Z is DOUBLE PRECISION array, dimension (LDZ, f2cmax(1,M)) */ /* > If JOBZ = 'V', then if INFO = 0, the first M columns of Z */ /* > contain the orthonormal eigenvectors of the matrix A */ /* > corresponding to the selected eigenvalues, with the i-th */ /* > column of Z holding the eigenvector associated with W(i). */ /* > If an eigenvector fails to converge, then that column of Z */ /* > contains the latest approximation to the eigenvector, and the */ /* > index of the eigenvector is returned in IFAIL. */ /* > If JOBZ = 'N', then Z is not referenced. */ /* > Note: the user must ensure that at least f2cmax(1,M) columns are */ /* > supplied in the array Z; if RANGE = 'V', the exact value of M */ /* > is not known in advance and an upper bound must be used. */ /* > \endverbatim */ /* > */ /* > \param[in] LDZ */ /* > \verbatim */ /* > LDZ is INTEGER */ /* > The leading dimension of the array Z. LDZ >= 1, and if */ /* > JOBZ = 'V', LDZ >= f2cmax(1,N). */ /* > \endverbatim */ /* > */ /* > \param[out] WORK */ /* > \verbatim */ /* > WORK is DOUBLE PRECISION 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 the array WORK. LWORK >= 1, when N <= 1; */ /* > otherwise 8*N. */ /* > For optimal efficiency, LWORK >= (NB+3)*N, */ /* > where NB is the f2cmax of the blocksize for DSYTRD and DORMTR */ /* > returned by ILAENV. */ /* > */ /* > 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] IWORK */ /* > \verbatim */ /* > IWORK is INTEGER array, dimension (5*N) */ /* > \endverbatim */ /* > */ /* > \param[out] IFAIL */ /* > \verbatim */ /* > IFAIL is INTEGER array, dimension (N) */ /* > If JOBZ = 'V', then if INFO = 0, the first M elements of */ /* > IFAIL are zero. If INFO > 0, then IFAIL contains the */ /* > indices of the eigenvectors that failed to converge. */ /* > If JOBZ = 'N', then IFAIL is not referenced. */ /* > \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, then i eigenvectors failed to converge. */ /* > Their indices are stored in array IFAIL. */ /* > \endverbatim */ /* Authors: */ /* ======== */ /* > \author Univ. of Tennessee */ /* > \author Univ. of California Berkeley */ /* > \author Univ. of Colorado Denver */ /* > \author NAG Ltd. */ /* > \date June 2016 */ /* > \ingroup doubleSYeigen */ /* ===================================================================== */ /* Subroutine */ int dsyevx_(char *jobz, char *range, char *uplo, integer *n, doublereal *a, integer *lda, doublereal *vl, doublereal *vu, integer * il, integer *iu, doublereal *abstol, integer *m, doublereal *w, doublereal *z__, integer *ldz, doublereal *work, integer *lwork, integer *iwork, integer *ifail, integer *info) { /* System generated locals */ integer a_dim1, a_offset, z_dim1, z_offset, i__1, i__2; doublereal d__1, d__2; /* Local variables */ integer indd, inde; doublereal anrm; integer imax; doublereal rmin, rmax; logical test; integer itmp1, i__, j, indee; extern /* Subroutine */ int dscal_(integer *, doublereal *, doublereal *, integer *); doublereal sigma; extern logical lsame_(char *, char *); integer iinfo; char order[1]; extern /* Subroutine */ int dcopy_(integer *, doublereal *, integer *, doublereal *, integer *), dswap_(integer *, doublereal *, integer *, doublereal *, integer *); logical lower, wantz; integer nb, jj; extern doublereal dlamch_(char *); logical alleig, indeig; integer iscale, indibl; logical valeig; extern /* Subroutine */ int dlacpy_(char *, integer *, integer *, doublereal *, integer *, doublereal *, integer *); doublereal safmin; extern integer ilaenv_(integer *, char *, char *, integer *, integer *, integer *, integer *, ftnlen, ftnlen); extern /* Subroutine */ int xerbla_(char *, integer *, ftnlen); doublereal abstll, bignum; integer indtau, indisp; extern /* Subroutine */ int dstein_(integer *, doublereal *, doublereal *, integer *, doublereal *, integer *, integer *, doublereal *, integer *, doublereal *, integer *, integer *, integer *), dsterf_(integer *, doublereal *, doublereal *, integer *); integer indiwo, indwkn; extern doublereal dlansy_(char *, char *, integer *, doublereal *, integer *, doublereal *); extern /* Subroutine */ int dstebz_(char *, char *, integer *, doublereal *, doublereal *, integer *, integer *, doublereal *, doublereal *, doublereal *, integer *, integer *, doublereal *, integer *, integer *, doublereal *, integer *, integer *); integer indwrk, lwkmin; extern /* Subroutine */ int dorgtr_(char *, integer *, doublereal *, integer *, doublereal *, doublereal *, integer *, integer *), dsteqr_(char *, integer *, doublereal *, doublereal *, doublereal *, integer *, doublereal *, integer *), dormtr_(char *, char *, char *, integer *, integer *, doublereal * , integer *, doublereal *, doublereal *, integer *, doublereal *, integer *, integer *); integer llwrkn, llwork, nsplit; doublereal smlnum; extern /* Subroutine */ int dsytrd_(char *, integer *, doublereal *, integer *, doublereal *, doublereal *, doublereal *, doublereal *, integer *, integer *); integer lwkopt; logical lquery; doublereal eps, vll, vuu, tmp1; /* -- 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..-- */ /* June 2016 */ /* ===================================================================== */ /* Test the input parameters. */ /* Parameter adjustments */ a_dim1 = *lda; a_offset = 1 + a_dim1 * 1; a -= a_offset; --w; z_dim1 = *ldz; z_offset = 1 + z_dim1 * 1; z__ -= z_offset; --work; --iwork; --ifail; /* Function Body */ lower = lsame_(uplo, "L"); wantz = lsame_(jobz, "V"); alleig = lsame_(range, "A"); valeig = lsame_(range, "V"); indeig = lsame_(range, "I"); lquery = *lwork == -1; *info = 0; if (! (wantz || lsame_(jobz, "N"))) { *info = -1; } else if (! (alleig || valeig || indeig)) { *info = -2; } else if (! (lower || lsame_(uplo, "U"))) { *info = -3; } else if (*n < 0) { *info = -4; } else if (*lda < f2cmax(1,*n)) { *info = -6; } else { if (valeig) { if (*n > 0 && *vu <= *vl) { *info = -8; } } else if (indeig) { if (*il < 1 || *il > f2cmax(1,*n)) { *info = -9; } else if (*iu < f2cmin(*n,*il) || *iu > *n) { *info = -10; } } } if (*info == 0) { if (*ldz < 1 || wantz && *ldz < *n) { *info = -15; } } if (*info == 0) { if (*n <= 1) { lwkmin = 1; work[1] = (doublereal) lwkmin; } else { lwkmin = *n << 3; nb = ilaenv_(&c__1, "DSYTRD", uplo, n, &c_n1, &c_n1, &c_n1, ( ftnlen)6, (ftnlen)1); /* Computing MAX */ i__1 = nb, i__2 = ilaenv_(&c__1, "DORMTR", uplo, n, &c_n1, &c_n1, &c_n1, (ftnlen)6, (ftnlen)1); nb = f2cmax(i__1,i__2); /* Computing MAX */ i__1 = lwkmin, i__2 = (nb + 3) * *n; lwkopt = f2cmax(i__1,i__2); work[1] = (doublereal) lwkopt; } if (*lwork < lwkmin && ! lquery) { *info = -17; } } if (*info != 0) { i__1 = -(*info); xerbla_("DSYEVX", &i__1, (ftnlen)6); return 0; } else if (lquery) { return 0; } /* Quick return if possible */ *m = 0; if (*n == 0) { return 0; } if (*n == 1) { if (alleig || indeig) { *m = 1; w[1] = a[a_dim1 + 1]; } else { if (*vl < a[a_dim1 + 1] && *vu >= a[a_dim1 + 1]) { *m = 1; w[1] = a[a_dim1 + 1]; } } if (wantz) { z__[z_dim1 + 1] = 1.; } return 0; } /* Get machine constants. */ safmin = dlamch_("Safe minimum"); eps = dlamch_("Precision"); smlnum = safmin / eps; bignum = 1. / smlnum; rmin = sqrt(smlnum); /* Computing MIN */ d__1 = sqrt(bignum), d__2 = 1. / sqrt(sqrt(safmin)); rmax = f2cmin(d__1,d__2); /* Scale matrix to allowable range, if necessary. */ iscale = 0; abstll = *abstol; if (valeig) { vll = *vl; vuu = *vu; } anrm = dlansy_("M", uplo, n, &a[a_offset], lda, &work[1]); if (anrm > 0. && anrm < rmin) { iscale = 1; sigma = rmin / anrm; } else if (anrm > rmax) { iscale = 1; sigma = rmax / anrm; } if (iscale == 1) { if (lower) { i__1 = *n; for (j = 1; j <= i__1; ++j) { i__2 = *n - j + 1; dscal_(&i__2, &sigma, &a[j + j * a_dim1], &c__1); /* L10: */ } } else { i__1 = *n; for (j = 1; j <= i__1; ++j) { dscal_(&j, &sigma, &a[j * a_dim1 + 1], &c__1); /* L20: */ } } if (*abstol > 0.) { abstll = *abstol * sigma; } if (valeig) { vll = *vl * sigma; vuu = *vu * sigma; } } /* Call DSYTRD to reduce symmetric matrix to tridiagonal form. */ indtau = 1; inde = indtau + *n; indd = inde + *n; indwrk = indd + *n; llwork = *lwork - indwrk + 1; dsytrd_(uplo, n, &a[a_offset], lda, &work[indd], &work[inde], &work[ indtau], &work[indwrk], &llwork, &iinfo); /* If all eigenvalues are desired and ABSTOL is less than or equal to */ /* zero, then call DSTERF or DORGTR and SSTEQR. If this fails for */ /* some eigenvalue, then try DSTEBZ. */ test = FALSE_; if (indeig) { if (*il == 1 && *iu == *n) { test = TRUE_; } } if ((alleig || test) && *abstol <= 0.) { dcopy_(n, &work[indd], &c__1, &w[1], &c__1); indee = indwrk + (*n << 1); if (! wantz) { i__1 = *n - 1; dcopy_(&i__1, &work[inde], &c__1, &work[indee], &c__1); dsterf_(n, &w[1], &work[indee], info); } else { dlacpy_("A", n, n, &a[a_offset], lda, &z__[z_offset], ldz); dorgtr_(uplo, n, &z__[z_offset], ldz, &work[indtau], &work[indwrk] , &llwork, &iinfo); i__1 = *n - 1; dcopy_(&i__1, &work[inde], &c__1, &work[indee], &c__1); dsteqr_(jobz, n, &w[1], &work[indee], &z__[z_offset], ldz, &work[ indwrk], info); if (*info == 0) { i__1 = *n; for (i__ = 1; i__ <= i__1; ++i__) { ifail[i__] = 0; /* L30: */ } } } if (*info == 0) { *m = *n; goto L40; } *info = 0; } /* Otherwise, call DSTEBZ and, if eigenvectors are desired, SSTEIN. */ if (wantz) { *(unsigned char *)order = 'B'; } else { *(unsigned char *)order = 'E'; } indibl = 1; indisp = indibl + *n; indiwo = indisp + *n; dstebz_(range, order, n, &vll, &vuu, il, iu, &abstll, &work[indd], &work[ inde], m, &nsplit, &w[1], &iwork[indibl], &iwork[indisp], &work[ indwrk], &iwork[indiwo], info); if (wantz) { dstein_(n, &work[indd], &work[inde], m, &w[1], &iwork[indibl], &iwork[ indisp], &z__[z_offset], ldz, &work[indwrk], &iwork[indiwo], & ifail[1], info); /* Apply orthogonal matrix used in reduction to tridiagonal */ /* form to eigenvectors returned by DSTEIN. */ indwkn = inde; llwrkn = *lwork - indwkn + 1; dormtr_("L", uplo, "N", n, m, &a[a_offset], lda, &work[indtau], &z__[ z_offset], ldz, &work[indwkn], &llwrkn, &iinfo); } /* If matrix was scaled, then rescale eigenvalues appropriately. */ L40: if (iscale == 1) { if (*info == 0) { imax = *m; } else { imax = *info - 1; } d__1 = 1. / sigma; dscal_(&imax, &d__1, &w[1], &c__1); } /* If eigenvalues are not in order, then sort them, along with */ /* eigenvectors. */ if (wantz) { i__1 = *m - 1; for (j = 1; j <= i__1; ++j) { i__ = 0; tmp1 = w[j]; i__2 = *m; for (jj = j + 1; jj <= i__2; ++jj) { if (w[jj] < tmp1) { i__ = jj; tmp1 = w[jj]; } /* L50: */ } if (i__ != 0) { itmp1 = iwork[indibl + i__ - 1]; w[i__] = w[j]; iwork[indibl + i__ - 1] = iwork[indibl + j - 1]; w[j] = tmp1; iwork[indibl + j - 1] = itmp1; dswap_(n, &z__[i__ * z_dim1 + 1], &c__1, &z__[j * z_dim1 + 1], &c__1); if (*info != 0) { itmp1 = ifail[i__]; ifail[i__] = ifail[j]; ifail[j] = itmp1; } } /* L60: */ } } /* Set WORK(1) to optimal workspace size. */ work[1] = (doublereal) lwkopt; return 0; /* End of DSYEVX */ } /* dsyevx_ */
the_stack_data/28263609.c
#include <stdio.h> #include <stdbool.h> int main(void){ unsigned long num; unsigned long div; bool isPrime; printf("Please enter an integer for analysis" " (q to quit)\n"); while (scanf("%lu", &num) == 1){ for (div=2, isPrime=true; (div*div)<=num; div++){ if ( num % div == 0){ if ((div*div) != num) printf("%lu is divisible by %lu and %lu.\n", num, div, num / div); else printf("%lu is divisible by %lu.\n", num, div); isPrime = false; } } if (isPrime) printf("%lu is prime.\n", num); printf("Please enter an integer for analysis" " (q to quit)\n"); } return 0; }
the_stack_data/110702.c
/* ___________________________________________________________ / __ _ \ | / _| (_) | | | |_ _ _ ___ _ ___ _ __ | | | _| | | / __| |/ _ \| '_ \ | | | | | |_| \__ \ | (_) | | | | | | |_| \__,_|___/_|\___/|_| |_| * | | | | The MSX C Library for SDCC | | V1.0 - 09-10-11 2018 | | | | Eric Boez & Fernando Garcia | | | | C S O U R C E C O D E | | compilation : > sdcc -mz80 -c msx_misc.c | | | \___________________________________________________________/ */ /* intswap | | Eric Boez 2018 */ void IntSwap(int *a, int *b) // Swap the content of two Int Variables { int tmp_a; tmp_a = *a; *a = *b; *b = tmp_a; }
the_stack_data/137044.c
#include <stdio.h> int main(){ float vet[10]; for (int i = 0; i < 10; i++) { printf("\nDigite um valor: "); scanf("%f", &vet[i]); printf("%f", vet[i]); } } //https://pt.stackoverflow.com/q/105109/101
the_stack_data/215767940.c
#include <stdlib.h> #include <unistd.h> int main () { int x = 0, y = 0, z = 0, err; int shared_mem = 0; #pragma omp target map(to: shared_mem) shared_mem = 1; #pragma omp parallel #pragma omp single { #pragma omp task depend(in: x) { usleep (5000); x = 1; } #pragma omp task depend(in: x) { usleep (6000); y = 2; } #pragma omp task depend(out: z) { usleep (7000); z = 3; } #pragma omp target enter data map(to: x, y, z) depend(inout: x, z) nowait #pragma omp task depend(inout: x, z) { x++; y++; z++; } #pragma omp target update to(x, y) depend(inout: x) nowait #pragma omp target enter data map(always, to: z) depend(inout: z) nowait #pragma omp target map (alloc: x, y, z) map (from: err) depend(inout: x, z) { err = x != 2 || y != 3 || z != 4; x = 5; y = 6; z = 7; } #pragma omp task depend(in: x) { usleep (5000); if (!shared_mem) x = 1; } #pragma omp task depend(in: x) { usleep (6000); if (!shared_mem) y = 2; } #pragma omp task depend(out: z) { usleep (3000); if (!shared_mem) z = 3; } #pragma omp target exit data map(release: z) depend(inout: z) nowait #pragma omp target exit data map(from: x, y) depend(inout: x) nowait #pragma omp target exit data map(from: z) depend(inout: z) nowait #pragma omp taskwait if (err || x != 5 || y != 6 || z != 7) abort (); } return 0; }
the_stack_data/103264766.c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_tolower.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: angagnie <[email protected]> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2015/11/24 09:26:01 by angagnie #+# #+# */ /* Updated: 2015/11/27 15:32:25 by angagnie ### ########.fr */ /* */ /* ************************************************************************** */ int ft_tolower(int c) { if ('A' <= c && c <= 'Z') return (c | ('A' ^ 'a')); else return (c); }
the_stack_data/28262581.c
// Write a program that asks for 2 numbers and shows the sum. // #include <stdio.h> int main() { int number01 = 0; int number02 = 0; printf("introduce numero: "); scanf_s("%i", &number01); printf("introduce number two: "); scanf_s("%i", &number02); printf("%i * %i = %i\n", number01, number02, number01 + number02); return 0; }