file
stringlengths
18
26
data
stringlengths
2
1.05M
the_stack_data/104829346.c
#include <stdio.h> #include <stdlib.h> #include <string.h> #define N 12 /* max number of digits in 10-base integer */ int compare(int a, int b) { char stra[N] = { 0 }; char strb[N] = { 0 }; sprintf(stra, "%d", a); sprintf(strb, "%d", b); char aplusb[N + N] = { 0 }; char bplusa[N + N] = { 0 }; strcpy(aplusb, stra); strcat(aplusb, strb); strcpy(bplusa, strb); strcat(bplusa, stra); return strcmp(aplusb, bplusa); } void quicksort(int *nums, int left, int right) { if (left > right) return; int i = left; int j = right; int pivot = nums[left]; while (i < j) { while (i < j && compare(nums[j], pivot) <= 0) j--; nums[i] = nums[j]; while (i < j && compare(nums[i], pivot) >= 0) i++; nums[j] = nums[i]; } nums[i] = pivot; quicksort(nums, left, i - 1); quicksort(nums, i + 1, right); } char* largestNumber(int* nums, int numsSize) { quicksort(nums, 0, numsSize - 1); char *ans = (char *)calloc(numsSize * N, sizeof(char)); int i; for (i = 0; i < numsSize; i++) { char buf[N] = { 0 }; sprintf(buf, "%d", nums[i]); strcat(ans, buf); } /* skip leading zeros */ while (*ans == '0' && *(ans + 1) == '0') ans++; return ans; } int main() { int nums0[] = { 3, 30, 34, 5, 9 }; printf("%s\n", largestNumber(nums0, sizeof(nums0) / sizeof(nums0[0]))); int nums1[] = { 0, 0 }; printf("%s\n", largestNumber(nums1, sizeof(nums1) / sizeof(nums1[0]))); return 0; }
the_stack_data/143276.c
#ifndef MATLAB_MEX_FILE // #include "i2c-dev.h" #else //#include "IMU_Navdata.h" #endif void BatteryMeasure_start() { #ifndef MATLAB_MEX_FILE BatteryMeasure_init(); #endif } void BatteryMeasure_term() { #ifndef MATLAB_MEX_FILE //BatteryMeasure_stop(); //may not do anything for now #endif } void BatteryMeasure_step(float *y1) { float VoltageMeasure; #ifndef MATLAB_MEX_FILE BatteryMeasure_update(&VoltageMeasure); //send voltage/current via y1 *y1 = VoltageMeasure; // *y2 = CurrentMeasure; //printf("Voltage measurement is : %f \n",VoltageMeasure); #endif }
the_stack_data/225142540.c
#include <stdio.h> #include <stdlib.h> #include <errno.h> int main(int argc, char *argv[]){ FILE *src; /* source file */ FILE *dst; /* destination file */ char ch; int count = 0; if(argc < 3){ printf("Usage: file_copy source_file destination_file\n"); exit(1); } if((src = fopen(argv[1], "r")) == NULL){ perror("fopen: src"); exit(1); } if((dst = fopen(argv[2], "w")) == NULL){ perror("fopen: dst"); exit(1); } while( !feof(src)){ ch = (char) fgetc(src); if(ch != EOF) fputc((int)ch, dst); count++; } fclose(src); fclose(dst); }
the_stack_data/783480.c
#include <stdio.h> /** * 计算输入的三个数值中最小的并打印, 学习三元运算符 */ int main(int argc, char const *argv[]) { puts("请输入三个整数"); int i, j, k; scanf("%d", &i); scanf("%d", &j); scanf("%d", &k); int result = i > j ? i : j; result = k > result ? k : result; printf("三个数%d, %d, %d 中最大的是:%d \n", i, j, k, result); return 0; }
the_stack_data/11075642.c
#include<stdio.h> #include<ctype.h> #include<stdlib.h> #include<string.h> void show_record(); void reset_score(); void help(); void edit_score(float,char[]); int main() { int countr,r,r1,count,i,n; float score; char choice; char playername[20]; mainhome: printf("\t\t\t << QUIZ GAME >>\n"); printf("\n\t\t****************************************"); printf("\n\t\t\t WELCOME\n "); printf("\n\t\t\t to\n "); printf("\n\t\t\t THE QUIZ GAME "); printf("\n\t\t"); printf("\n\t\t****************************************"); printf("\n\t\t BECOME RICH EARN UPTO 1 MILLION $ ;-) "); printf("\n\t\t****************************************"); printf("\n\t\t > Press S to start the game"); printf("\n\t\t > Press V to view the highest score "); printf("\n\t\t > Press R to reset score"); printf("\n\t\t > press H for help "); printf("\n\t\t > press Q to quit "); printf("\n\t\t________________________________________\n\n"); choice=toupper(getch()); if(choice=='V') { system("cls"); show_record(); system("cls"); goto mainhome; } else if(choice=='H') { system("cls"); help(); getch(); system("cls"); goto mainhome; } else if(choice=='R') { system("cls"); reset_score(); getch(); goto mainhome; } else if (choice=='Q') { exit(1); } else if(choice=='S') { system("cls"); printf("\n\n\n\n\n\n\n\n\n\n\t\t\tResister your name:"); gets(playername); system("cls"); printf("\n *********** Welcome %s to C Program Quiz Game *****************",playername); printf("\n\n Here are some tips you might wanna know before playing:"); printf("\n ********************************************************************************"); printf("\n >> There are 2 rounds in this Quiz Game,WARMUP ROUND & CHALLANGE ROUND"); printf("\n >> In warmup round you will be asked a total of 3 questions to test your"); printf("\n general knowledge. You are eligible to play the game if you give atleast 2"); printf("\n right answers, otherwise you can't proceed further to the Challenge Round."); printf("\n >> Your game starts with CHALLANGE ROUND. In this round you will be asked a"); printf("\n total of 10 questions. Each right answer will be awarded with 10 points!"); printf("\n By this way you can score upto 100 :-) :-):-):-):-):-):-)!!!!!.........."); printf("\n >> You will be given 4 options and you have to press A, B ,C or D for the"); printf("\n right option."); printf("\n >> You will be asked questions continuously, till right answers are given"); printf("\n >> No negative marking for wrong answers!"); printf("\n\n\t!!!!!!!!!!!!! ALL THE BEST !!!!!!!!!!!!!"); printf("\n\n\n Press Y to start the game!\n"); printf("\n Press any other key to return to the main menu!"); if (toupper(getch())=='Y') { system("cls"); goto home; } else { system("cls"); goto mainhome; } home: system("cls"); count=0; for(i=1;i<=3;i++) { r1=i; switch(r1) { case 1: printf("\n\nA collecion of 8 bits are called?"); printf("\n\nA.bit\t\tB.word\n\nC.byte\t\tD.record"); if (toupper(getch())=='C') { printf("\n\nCorrect!!!"); count++; getch(); system("cls"); break; } else { printf("\n\nWrong!!! The correct answer is C.byte"); getch(); system("cls"); break; } case 2: printf("\n\nWhich of the following is a Palindrome number?"); printf("\n\nA.42042\t\tB.101010\n\nC.23232\t\tD.01234"); if (toupper(getch())=='C') { printf("\n\nCorrect!!!"); count++; getch(); system("cls"); break; } else { printf("\n\nWrong!!! The correct answer is C.23232"); getch(); system("cls"); break; } system("cls"); case 3: printf("\n\n\nWhich of the following is most oriented toward scientific programming ?"); printf("\n\nA.Cobol\t\tB.Fortran\n\nC.c++\t\tD.Basic"); if (toupper(getch())=='B') { printf("\n\nCorrect!!!"); count++; getch(); system("cls"); break; } else { printf("\n\nWrong!!! The correct answer is B.Fortran"); getch(); system("cls"); break; } } } if(count>=2) { goto test; } else { system("cls"); printf("\n\nSORRY YOU ARE NOT ELIGIBLE TO PLAY THIS GAME, BETTER LUCK NEXT TIME"); getch(); goto mainhome; } test: system("cls"); printf("\n\n\t*** CONGRATULATION %s you are eligible to play the Game ***",playername); printf("\n\n\n\n\t!Press any key to Start the Game!"); if(toupper(getch())=='p') { goto game; } game: countr=0; for(i=1;i<=10;i++) { system("cls"); r=i; switch(r) { case 1: printf("\n\nwhixh among the following is output device?"); printf("\n\nA.Scanner\t\tB.Mouse\n\nC.Printer\t\tD.Keyboard"); if (toupper(getch())=='C') { printf("\n\nCorrect!!!");countr++;getch(); break; getch(); } else { printf("\n\nWrong!!! The correct answer is C.Printer"); getch(); goto score; break; } case 2: printf("\n\n\nWhat kind of file extension .pn?,"); printf("\n\nA.Movie file \t\tB.Text file\n\nC.Image file\t\tD.Audio file"); if (toupper(getch())=='A') { printf("\n\nCorrect!!!"); countr++; getch(); break; } else { printf("\n\nWrong!!! The correct answer is A.Movie file"); getch(); goto score; break; } case 3: printf("\n\n\nA DVD is an example of a/an.. "); printf("\n\nA.Magnetic disk\t\tB.Hard disk\n\nC.Output device\t\tD.Optical disk"); if (toupper(getch())=='D') { printf("\n\nCorrect!!!"); countr++; getch(); break; } else { printf("\n\nWrong!!! The correct answer is D.Optical disk"); getch(); goto score; break; } case 4: printf("\n\n\nWho is he founder of google?"); printf("\n\nA.sunderpichai\tB.Tesla\n\nC.Steve jobs\t\tD.Bill gates"); if (toupper(getch())=='A') { printf("\n\nCorrect!!!"); countr++; getch(); break; } else { printf("\n\nWrong!!! The correct answer is A.Mark zuckerburg"); getch(); goto score; break; } case 5: printf("\n\n\nWhich of he following is a web browser?"); printf("\n\nA.Dreamweaver\tB.Netscape navigator\n\nC.Maya\t\tD.Flash"); if(toupper(getch())=='B') { printf("\n\nCorrect!!!"); countr++; getch(); break;} else { printf("\n\nWrong!!! The correct answer is B.Netscape navigator"); getch(); goto score; break; } case 6: printf("\n\n\nWhat kind of file extension .bak?,"); printf("\n\nA.Backup file \t\tB.Text file\n\nC.Image file\t\tD.Audio file"); if (toupper(getch())=='A') { printf("\n\nCorrect!!!"); countr++; getch(); break;} else { printf("\n\nWrong!!! The correct answer is A.Backup file"); getch(); goto score; break; } case 7: printf("\n\n\nwho won dhadha saheb phalke award? "); printf("\n\nA.nagarjuna\t\tB.chiranjeevi\n\nC.ntr\t\tD.anr"); if(toupper(getch())=='D') { printf("\n\nCorrect!!!"); countr++; getch(); break;} else { printf("\n\nWrong!!! The correct answer is D.CDROM"); getch(); goto score; break; } case 8: printf("\n\n\nThe _____ shows all the web sites any pages that you have visited one of recent time "); printf("\n\nA.Hisory list\t\tB.Status bar \n\nC.task bar\t\tD.record"); if(toupper(getch())=='A') { printf("\n\nCorrect!!!"); countr++; getch(); break;} else { printf("\n\nWrong!!! The correct answer is A.Hisory list"); getch(); goto score; break; } case 9: printf("\n\n\nA 32 bit word computer can access ____ bytes at a time "); printf("\n\nA.32\t\tB.16\n\nC.8\t\tD.4"); if(toupper(getch())=='C') { printf("\n\nCorrect!!!"); countr++; getch(); break;} else { printf("\n\nWrong!!! The correct answer is C.8"); getch(); goto score; break; } case 10: printf("\n\n\nWho is the founder of pixar animation?"); printf("\n\nA.Mark zuckerburg\tB.Tesla\n\nC.Steve jobs\t\tD.Bill gates"); if(toupper(getch())=='C') { printf("\n\nCorrect!!!"); countr++; getch(); break; } else { printf("\n\nWrong!!! The correct answer is C.Steve jobs"); getch(); goto score; break; } } } score: system("cls"); score=(float)countr*100000; if(score>0.00 && score<1000000) { printf("\n\n\t\t**************** CONGRATULATION *****************"); printf("\n\t You won $%.2f",score); goto go; } else if(score==1000000.00) { printf("\n\n\n \t\t**************** CONGRATULATION ****************"); printf("\n\t\t\t\t YOU ARE A MILLIONAIRE!!!!!!!!!"); printf("\n\t\t\t\t You won $%.2f",score); printf("\n\t\t\t\t Thank You !!"); } else { printf("\n\n\t******** SORRY YOU DIDN'T WIN ANY CASH ********"); printf("\n\t\t Thanks for your participation"); printf("\n\t\t TRY AGAIN"); goto go; } go: puts("\n\n Press Y if you want to play next game"); puts(" Press any key if you want to go main menu"); if (toupper(getchar())=='Y') { goto home; } else { edit_score(score,playername); goto mainhome; } } } void show_record() { char name[20]; float scr=0; FILE *f; f=fopen("score.txt","r"); fscanf(f,"%s%f",&name,&scr); printf("\n\n\t\t*************************************************************"); printf("\n\n\t\t %s has secured the Highest Score %f",name,scr); printf("\n\n\t\t*************************************************************"); fclose(f); getch(); } void reset_score() { system("cls"); float sc; char nm[20]; FILE *f; f=fopen("score.txt","r+"); fscanf(f,"%s%f",&nm,&sc); sc=0; fprintf(f,"%s,%.2f",nm,sc); fclose(f); } void help() { system("cls"); printf("\n\n HELP"); printf("\n -------------------------------------------------------------------------"); printf("\n ......................... C program Quiz Game..........."); printf("\n >> There are two rounds in the game, WARMUP ROUND & CHALLANGE ROUND"); printf("\n >> In warmup round you will be asked a total of 3 questions to test your general"); printf("\n knowledge. You will be eligible to play the game if you can give atleast 2"); printf("\n right answers otherwise you can't play the Game..........."); printf("\n >> Your game starts with the CHALLANGE ROUND. In this round you will be asked"); printf("\n total 10 questions each right answer will be awarded $100,000."); printf("\n By this way you can win upto ONE MILLION cash prize in USD..............."); printf("\n >> You will be given 4 options and you have to press A, B ,C or D for the"); printf("\n right option"); printf("\n >> You will be asked questions continuously if you keep giving the right answers."); printf("\n >> No negative marking for wrong answers"); printf("\n\n\t*********************BEST OF LUCK*********************************"); printf("\n\n\t*****C PROGRAM QUIZ GAME is developed byDEEPAK SHARMA AP GOYAL SHIMLA UNIVERSITY********");} void edit_score(float score, char playernm[20]) { system("cls"); float sc; char nm[20]; FILE *f; f=fopen("score.txt","r"); fscanf(f,"%s%f",&nm,&sc); if (score>=sc) { sc=score; fclose(f); f=fopen("score.txt","w"); fprintf(f,"%s\n%.2f",playernm,sc); //print in player name fclose(f); } }
the_stack_data/744680.c
typedef unsigned long __dev32_t; typedef __dev32_t dev_t; static __inline unsigned short bswap_16 (unsigned short __x) { return (__x >> 8) | (__x << 8); } static __inline unsigned int bswap_32 (unsigned int __x) { return (bswap_16 (__x & 0xffff) << 16) | (bswap_16 (__x >> 16)); } static __inline unsigned long long bswap_64 (unsigned long long __x) { return (((unsigned long long) bswap_32 (__x & 0xffffffffull)) << 32) | (bswap_32 (__x >> 32)); } extern __inline__ __attribute__ ((__always_inline__)) int gnu_dev_major(dev_t); extern __inline__ __attribute__ ((__always_inline__)) int gnu_dev_minor(dev_t); extern __inline__ __attribute__ ((__always_inline__)) dev_t gnu_dev_makedev(int, int); extern __inline__ __attribute__ ((__always_inline__)) int gnu_dev_major(dev_t dev) { return (int)(((dev) >> 16) & 0xffff); } extern __inline__ __attribute__ ((__always_inline__)) int gnu_dev_minor(dev_t dev) { return (int)((dev) & 0xffff); } extern __inline__ __attribute__ ((__always_inline__)) dev_t gnu_dev_makedev(int maj, int min) { return (((maj) << 16) | ((min) & 0xffff)); }
the_stack_data/182952831.c
// As /u/mebeim writes at // https://www.reddit.com/r/adventofcode/comments/kjtg7y/2020_day_25_solutions/ggz4bpl/ // the problem can be rephased in terms of the Diffie-Hellman key exchange algorithm: // "Given the public base g = 7, the public modulus p = 20201227, and the two public keys A and B // (obtained as A = g^a mod p, B = g^b mod p), calculate the secret key s = A^b mod p = B^a mod p." // Ref. https://en.wikipedia.org/wiki/Diffie-Hellman_key_exchange // My version: pick the earliest matching key (p or q) in the loop, // then use the loop count (e) with the other key (q or p) to // calculate the secret key with modular exponentiation. #include <stdio.h> // printf #include <stdint.h> // uint64_t, uint_fast32_t, UINT32_C #include <inttypes.h> // PRIuFAST32 #include <stdbool.h> // bool, true, false #include <time.h> // clock_gettime #define BASE (UINT32_C(7)) #define MOD (UINT32_C(20201227)) static double timer(void) { static bool start = true; static struct timespec t0; struct timespec t1; if (start) { start = false; clock_gettime(CLOCK_MONOTONIC_RAW, &t0); return 0; } else { clock_gettime(CLOCK_MONOTONIC_RAW, &t1); start = true; return 1.0 * t1.tv_sec + 1e-9 * t1.tv_nsec - (1.0 * t0.tv_sec + 1e-9 * t0.tv_nsec); } } // Break Diffie-Hellman!!1! static uint_fast32_t dhke(uint_fast32_t p, uint_fast32_t q) { // Naive discrete logarithm uint_fast32_t e = 0, k = 1U; while (k != p && k != q) { // symmetry in p, q k = k * BASE % MOD; // all 32-bit numbers (BASE: 3bit, MOD: 25bit => k * BASE 28bit) ++e; // exponent = multiplication count } uint64_t b = k == q ? p : q; // new base for next part is a 64-bit int // Modular exponentiation with fixed modulus // https://en.wikipedia.org/wiki/Modular_exponentiation#Right-to-left_binary_method uint64_t r = 1U, m = MOD; // only use 64bit (except e) to avoid conversions b %= m; while (e) { if (e & 1U) { r = r * b % m; // r * b can be >32bit so use 64bit here } b = b * b % m; // b * b can be >32bit e >>= 1; } return (uint_fast32_t)r; // r is mod m, and m is 25bit, so no truncation } static void result(uint_fast32_t p, uint_fast32_t q) { int i, warmup = 3, loop = 100; volatile uint_fast32_t r1 = 0, r2 = 0; double t, t1 = 0, t2 = 0, t1min = 10, t2min = 10, t1max = 0, t2max = 0; for (i = 0; i < warmup; ++i) { r1 = dhke(p, q); r2 = dhke(q, p); } for (i = 0; i < loop; ++i) { timer(); r1 = dhke(p, q); t = timer(); if (t < t1min) { t1min = t; } if (t > t1max) { t1max = t; } t1 += t; timer(); r2 = dhke(q, p); t = timer(); if (t < t2min) { t2min = t; } if (t > t2max) { t2max = t; } t2 += t; } printf(" %8"PRIuFAST32" %8"PRIuFAST32" : %8"PRIuFAST32" (min %.5f avg %.5f max %.5f s)\n", p, q, r1, t1min, t1 / loop, t1max); printf(" %8"PRIuFAST32" %8"PRIuFAST32" : %8"PRIuFAST32" (min %.5f avg %.5f max %.5f s)\n", q, p, r2, t2min, t2 / loop, t2max); } int main(void) { printf("\nalgorithm (ednl)\n"); result(15113849, 4206373); printf("\nejolson\n"); result(6270530, 14540258); printf("\nlurk101\n"); result(16915772, 18447943); printf("\n"); return 0; }
the_stack_data/50139027.c
/*************************************************************************/ /* */ /* SNU-RT Benchmark Suite for Worst Case Timing Analysis */ /* ===================================================== */ /* Collected and Modified by S.-S. Lim */ /* [email protected] */ /* Real-Time Research Group */ /* Seoul National University */ /* */ /* */ /* < Features > - restrictions for our experimental environment */ /* */ /* 1. Completely structured. */ /* - There are no unconditional jumps. */ /* - There are no exit from loop bodies. */ /* (There are no 'break' or 'return' in loop bodies) */ /* 2. No 'switch' statements. */ /* 3. No 'do..while' statements. */ /* 4. Expressions are restricted. */ /* - There are no multiple expressions joined by 'or', */ /* 'and' operations. */ /* 5. No library calls. */ /* - All the functions needed are implemented in the */ /* source file. */ /* */ /* */ /*************************************************************************/ /* */ /* FILE: bs.c */ /* SOURCE : Public Domain Code */ /* */ /* DESCRIPTION : */ /* */ /* Binary search for the array of 15 integer elements. */ /* */ /* REMARK : */ /* */ /* EXECUTION TIME : */ /* */ /* */ /*************************************************************************/ struct DATA { int key; int value; } ; #ifdef DEBUG int cnt1; #endif struct DATA data[15] = { {1, 100}, {5, 200}, {6, 300}, {7, 700}, {8, 900}, {9, 250}, {10, 400}, {11, 600}, {12, 800}, {13, 1500}, {14, 1200}, {15, 110}, {16, 140}, {17, 133}, {18, 10} }; binary_search(int x) { int fvalue, mid, up, low ; low = 0; up = 14; fvalue = -1 /* all data are positive */ ; while (low <= up) { mid = (low + up) >> 1; if ( data[mid].key == x ) { /* found */ up = low - 1; fvalue = data[mid].value; #ifdef DEBUG printf("FOUND!!\n"); #endif } else /* not found */ if ( data[mid].key > x ) { up = mid - 1; #ifdef DEBUG printf("MID-1\n"); #endif } else { low = mid + 1; #ifdef DEBUG printf("MID+1\n"); #endif } #ifdef DEBUG cnt1++; #endif } #ifdef DEBUG printf("Loop Count : %d\n", cnt1); #endif return fvalue; } int nondet_int(); main() { unsigned i; for(i=0; i<15; i++) data[i].value=nondet_int(); binary_search(8); }
the_stack_data/92703.c
int _Alignas(int) _Alignas(float) _Alignas(16) a; const volatile int b; __const __volatile int c; __const__ __volatile__ int d; int foo(int *restrict a, int *__restrict b, int *__restrict__ c); int bar(int n, int bar[n]); typedef void baz; _Noreturn void abort(void); typedef int A; typedef A B; typedef A C; typedef C B; #define EXPECTED_ERRORS "types.c:1:19: warning: duplicate 'alignment' declaration specifier [-Wduplicate-decl-specifier]" \ "types.c:1:35: warning: duplicate 'alignment' declaration specifier [-Wduplicate-decl-specifier]" \
the_stack_data/12637233.c
#include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <math.h> //----DEFINIÇÃO DAS ESTRUCS---- typedef struct _circ_node{ int val; struct _circ_node *next; struct _circ_node *prev; } Circ_node, CircNode; typedef struct _doubly_linked_list{ CircNode *begin; CircNode *end; size_t size; } Circ_List, CircList; //----Construtures E Destrutores---- CircNode *create_node(int val){ // contrutor do node CircNode *node = (CircNode *)malloc(sizeof(CircNode)); node->val = val; node->next = NULL; node->prev = NULL; return node; } CircList *create_list(){ // contrutor da lista CircList *L = (CircList *)malloc(sizeof(CircList)); L->begin = NULL; L->end = NULL; L->size = 0; return L; } void destroy_list(CircList **L_ref){ CircList *L = *L_ref; CircNode *p = L->begin; CircNode *aux; while (p != L->end){} { CircNode *aux = p; p = p->next; free(aux); } free(p); free(L); *L_ref = NULL; } void destroy_list_2(CircList **L_ref){ CircList *L = *L_ref; CircNode *p = L->begin; CircNode *aux; for (size_t i = 0; i < L->size; i++){ CircNode *aux = p; p = p->next; free(aux); } free(L); *L_ref = NULL; } //----FUNÇÕES---- bool CircList_is_empty(CircList *L){ return L->size == 0 && L->begin == NULL; } void CircList_add_fist(CircList *L, int val){ CircNode *p = create_node(val); //caso 1:lista vazia if(CircList_is_empty(L)){ L->begin = p; L->end = p; }else{ p->next = L->begin; L->begin->prev = p; L->begin = p; //parte circular p->prev = L->end; L->end->next = p; } L->size++; } void CircList_print(CircList *L){ if(CircList_is_empty(L)){ printf("L -> NULL\n"); printf("L->begin-> NULL"); }else{ CircNode *p = L->begin; printf("L-> "); do{ printf("%d-> ", p->val); p = p->next; }while (p != L->begin); //printf("\n L->end: %d",L->end->val); } printf("\nSize: %lu \n", L->size); } void CircList_remove(CircList *L, int val){ if(!CircList_is_empty(L)){ CircNode *p = L->begin; int i = 0; //caso 1:val no begin if(p->val == val){ if(L->size == 1){ L->begin = NULL; L->end = NULL; }else{ L->begin = p->next; L->begin->prev = L->end; L->end->next = L->begin; } }else{ //caso 2:val no end if(L->end->val == val){ p = L->end; L->end = p->prev; L->end->next = L->begin; L->begin->prev = L->end; }else{ //caso 3:val no meio while(i != L->size){ if (p->val == val){ p->prev->next = p->next; p->next->prev = p->prev; break; } p = p->next; i++; } printf("\nValor não encontrado\n"); return; } } if(i != L->size){ L->size--; free(p); } } } void remove_duplicate(CircList *L){ CircNode *p = L->begin; CircNode *aux; int val, cont; for (size_t i = 0; i < L->size; i++){ cont = 0; val = p->val; for (size_t i = 0; i < L->size; i++){ if(p->val == val){ cont++; }else if(p->val == val && cont == 2){ aux = p->next; p->prev->next = p->next; p->next->prev = p->prev; free(p); L->size--; p = aux; } p = p->next; } p = p->next; } } double somar_List(CircList *L1 , CircList *L2){ CircNode *p1 = L1->begin; CircNode *p2 = L2->begin; int casa_decimal1, casa_decimal2, maior, casa_decimal_exedente; double soma = 0; casa_decimal1 = L1->size; casa_decimal2 = L2->size; //verificar maior tamanho if(casa_decimal1 > casa_decimal2){ maior = casa_decimal1; casa_decimal_exedente = casa_decimal1 - casa_decimal2; }else{ maior = casa_decimal2; casa_decimal_exedente = casa_decimal2 - casa_decimal1; } for (size_t i = 0; i < maior; i++){ if(casa_decimal_exedente != 0){ if(casa_decimal1 > casa_decimal2){ soma += p1->val + pow(10,casa_decimal1); casa_decimal1--; p1 = p1->next; }else{ soma += p2->val * pow(10,casa_decimal2); casa_decimal2--; p2 = p2->next; } }else if (L1->size > L2->size){ soma += (p1->val * pow(10,casa_decimal1)) + (p2->val * pow(10,casa_decimal2)); casa_decimal1--; casa_decimal2--; } p1 = p1->next; p2 = p2->next; } return soma; } int main(int argc, char **argv){ CircList *L1 = create_list(); CircList *L2 = create_list(); // puts("add Fist: 3, 4, 1, 3, 1, 5, 9, 4, 3"); // CircList_add_fist(L, 3); // CircList_add_fist(L, 4); // CircList_add_fist(L, 9); // CircList_add_fist(L, 5); // CircList_add_fist(L, 1); // CircList_add_fist(L, 3); // CircList_add_fist(L, 1); // CircList_add_fist(L, 4); // CircList_add_fist(L, 3); // puts("primeiro"); // CircList_print(L); CircList_add_fist(L1, 3); CircList_add_fist(L1, 4); CircList_add_fist(L1, 1); CircList_add_fist(L2, 3); CircList_add_fist(L2, 4); CircList_add_fist(L2, 1); CircList_print(L1); CircList_print(L2); printf("\nSoma: %f\n", somar_List(L1, L2)); //destroy_list_2(&L); return 0; }
the_stack_data/218893051.c
#include<stdio.h> #include<unistd.h> #include<sys/ipc.h> #include<sys/shm.h> #define SHM_KEY1 800 #define SHM_KEY2 801 #define SHM_KEY3 802 #define SHM_KEY4 803 #define SHM_KEY10 804 #define SHM_KEY11 805 #define SHM_KEY12 806 #define SHM_KEY13 807 #define SHM_KEY14 808 #define SHM_KEY15 809 void loading(unsigned int millisecond){ for(int i=0;i<4;i++){ usleep(millisecond); printf("\b\\"); fflush(stdout); usleep(millisecond); printf("\b|"); fflush(stdout); usleep(millisecond); printf("\b/"); fflush(stdout); usleep(millisecond); printf("\b-"); fflush(stdout); } } int main(int argc,char *argv[]){ int tmp; printf("==========================================================================\n"); printf("###### # # ###### #### # # #### #### ##### ###### ##### \n"); printf("# # # # # # # # # # # # # # # \n"); printf("##### # # ##### #### ###### # # # # # ##### # # \n"); printf("# # # # # # # # # # # # # ##### \n"); printf("# # # # # # # # # # # # # # # # \n"); printf("# # ###### ###### #### # # #### #### # ###### # # \n"); printf("==========================================================================\n\n"); if(argc>1 && argc<4){ if(strcmp(argv[1],"-s")==0&& argv[2]){ int shm_id[4]; void *shared_mem[4]; long filelen; char *buf; printf("## Start sending data.\n"); FILE *fp = fopen(argv[2],"r"); fseek(fp,0,SEEK_END); filelen = ftell(fp); rewind(fp); buf = (char *)malloc((filelen+1)*sizeof(char)); fread(buf, filelen, 1, fp); fclose(fp); printf("## Loaded file. %dbytes.\n",filelen); unsigned long file_size; char (*file_data)[filelen]; unsigned int file_name_len; char (*file_name); printf("## Set up shared memory."); shm_id[0] = shmget(SHM_KEY1, sizeof(file_size), IPC_CREAT|0666); shared_mem[0]=shmat(shm_id[0], (void *)0,0); file_size = filelen; sprintf((char *)shared_mem[0], "%ld",file_size); printf("..1"); shm_id[1] = shmget(SHM_KEY2, filelen, IPC_CREAT|0666); file_data=shmat(shm_id[1], (void *)0,0); strcpy(file_data,buf); printf("..2"); shm_id[2] = shmget(SHM_KEY3, sizeof(file_name_len), IPC_CREAT|0666); shared_mem[1]=shmat(shm_id[2], (void *)0,0); file_name_len = strlen(argv[2]); sprintf((char *)shared_mem[1], "%d",file_name_len); printf("..3"); shm_id[3] = shmget(SHM_KEY4, file_name_len, IPC_CREAT|0666); file_name=shmat(shm_id[3], (void *)0,0); strcpy(file_name,argv[2]); printf("..4\n"); printf("## Transfer success!\n"); char c=NULL; while(c!='q'){ printf("## If you finished transmission, please input 'q' with ENTER.\n"); scanf("%c",&c); } printf("## Shared memory clear success!\n"); for(int i=0;i<4;i++) shmctl(shm_id[i], IPC_RMID, 0); shmdt(shared_mem[0]); shmdt(shared_mem[1]); shmdt(file_data); shmdt(file_name); } else if(strcmp(argv[1],"-r")==0){ printf("## Start collecting data.\n"); printf("## How many number of user?\n"); scanf("%d",&tmp); unsigned int user = tmp; unsigned int count=0; if(user < 1){ printf("## Error ! "); return -1; } int shm_id[6]; void *shared_mem[4]; unsigned long file_size; char *file_data; unsigned int file_name_len; char *file_name; char *file_name2; unsigned int working=0; // count shm_id[0] = shmget(SHM_KEY10, sizeof(unsigned int), IPC_CREAT|0666); shared_mem[0]=shmat(shm_id[0], (void *)0,0); // working 0: finished 1: working shm_id[5] = shmget(SHM_KEY15, sizeof(unsigned int), IPC_CREAT|0666); shared_mem[3]=shmat(shm_id[5], (void *)0,0); // set count to zero sprintf((char *)shared_mem[0], "%d",count); // set not working sprintf((char *)shared_mem[3], "%d",working); printf("## set up success!\n"); int prev_count=0; printf("## Waiting for clients -"); // read count while(1){ count = atoi(shared_mem[0]); working = atoi(shared_mem[3]); loading(100000); if((prev_count+1 == count) && (working ==2)){// upper 1 working =3; sprintf((char *)shared_mem[3], "%d",working); // file_size shm_id[1] = shmget(SHM_KEY11, 0, IPC_CREAT|0666); shared_mem[1]=shmat(shm_id[1], (void *)0,0); file_size = atoi(shared_mem[1]); //file_data shm_id[2] = shmget(SHM_KEY12, 0, IPC_CREAT|0666); file_data=shmat(shm_id[2], (void *)0,0); // file_name_len shm_id[3] = shmget(SHM_KEY13, 0, IPC_CREAT|0666); shared_mem[2]=shmat(shm_id[3], (void *)0,0); file_name_len = atoi(shared_mem[2]); // file_name shm_id[4] = shmget(SHM_KEY14, 0, IPC_CREAT|0666); file_name=shmat(shm_id[4], (void *)0,0); printf("\n## Connected: %d\n",count); printf("## GET FILE user %d / %d.\n",count,user); mkdir("output",0755); // pointer to string char path[file_name_len+1]; for(int i=0;i<file_name_len+1;i++){ path[i] = file_name[i]; } char path2[]="./output/"; strcat(path2,path); FILE *fp = fopen(path2,"w+"); fwrite((char *)file_data, 1, file_size, fp); fclose(fp); printf("## FILE WROTE SUCCESS !\n\n"); prev_count = count; working = 0; sprintf((char *)shared_mem[3], "%d",working); } else if(user == count){ break; } } printf("## Files collected Success. %d users\n",count); for(int i=0;i<6;i++) shmctl(shm_id[i], IPC_RMID, 0); shmdt(shared_mem[0]); shmdt(shared_mem[1]); shmdt(shared_mem[2]); shmdt(shared_mem[3]); shmdt(file_data); shmdt(file_name); return 0; } return 0; } printf("## Parameter error, please retry it.\n"); return 0; }
the_stack_data/72245.c
#ifdef CONFIG_WAPI_SUPPORT #include <linux/unistd.h> #include <linux/etherdevice.h> #include <drv_types.h> #include <rtw_wapi.h> u32 wapi_debug_component = // WAPI_INIT | // WAPI_API | // WAPI_TX | // WAPI_RX | WAPI_ERR ; //always open err flags on void WapiFreeAllStaInfo(_adapter *padapter) { PRT_WAPI_T pWapiInfo; PRT_WAPI_STA_INFO pWapiStaInfo; PRT_WAPI_BKID pWapiBkid; WAPI_TRACE(WAPI_INIT, "===========> %s\n", __FUNCTION__); pWapiInfo = &padapter->wapiInfo; //Pust to Idle List rtw_wapi_return_all_sta_info(padapter); //Sta Info List while(!list_empty(&(pWapiInfo->wapiSTAIdleList))) { pWapiStaInfo = (PRT_WAPI_STA_INFO)list_entry(pWapiInfo->wapiSTAIdleList.next, RT_WAPI_STA_INFO, list); list_del_init(&pWapiStaInfo->list); } //BKID List while(!list_empty(&(pWapiInfo->wapiBKIDIdleList))) { pWapiBkid = (PRT_WAPI_BKID)list_entry(pWapiInfo->wapiBKIDIdleList.next, RT_WAPI_BKID, list); list_del_init(&pWapiBkid->list); } WAPI_TRACE(WAPI_INIT, "<=========== %s\n", __FUNCTION__); return; } void WapiSetIE(_adapter *padapter) { PRT_WAPI_T pWapiInfo = &(padapter->wapiInfo); //PRT_WAPI_BKID pWapiBkid; u16 protocolVer = 1; u16 akmCnt = 1; u16 suiteCnt = 1; u16 capability = 0; u8 OUI[3]; OUI[0] = 0x00; OUI[1] = 0x14; OUI[2] = 0x72; pWapiInfo->wapiIELength = 0; //protocol version memcpy(pWapiInfo->wapiIE+pWapiInfo->wapiIELength, &protocolVer, 2); pWapiInfo->wapiIELength +=2; //akm memcpy(pWapiInfo->wapiIE+pWapiInfo->wapiIELength, &akmCnt, 2); pWapiInfo->wapiIELength +=2; if(pWapiInfo->bWapiPSK){ memcpy(pWapiInfo->wapiIE+pWapiInfo->wapiIELength,OUI, 3); pWapiInfo->wapiIELength +=3; pWapiInfo->wapiIE[pWapiInfo->wapiIELength] = 0x2; pWapiInfo->wapiIELength +=1; }else{ memcpy(pWapiInfo->wapiIE+pWapiInfo->wapiIELength,OUI, 3); pWapiInfo->wapiIELength +=3; pWapiInfo->wapiIE[pWapiInfo->wapiIELength] = 0x1; pWapiInfo->wapiIELength +=1; } //usk memcpy(pWapiInfo->wapiIE+pWapiInfo->wapiIELength, &suiteCnt, 2); pWapiInfo->wapiIELength +=2; memcpy(pWapiInfo->wapiIE+pWapiInfo->wapiIELength,OUI, 3); pWapiInfo->wapiIELength +=3; pWapiInfo->wapiIE[pWapiInfo->wapiIELength] = 0x1; pWapiInfo->wapiIELength +=1; //msk memcpy(pWapiInfo->wapiIE+pWapiInfo->wapiIELength,OUI, 3); pWapiInfo->wapiIELength +=3; pWapiInfo->wapiIE[pWapiInfo->wapiIELength] = 0x1; pWapiInfo->wapiIELength +=1; //Capbility memcpy(pWapiInfo->wapiIE+pWapiInfo->wapiIELength, &capability, 2); pWapiInfo->wapiIELength +=2; } /* PN1 > PN2, return 1, * else return 0. */ u32 WapiComparePN(u8 *PN1, u8 *PN2) { char i; if ((NULL == PN1) || (NULL == PN2)) return 1; // overflow case if ((PN2[15] - PN1[15]) & 0x80) return 1; for (i=16; i>0; i--) { if(PN1[i-1] == PN2[i-1]) continue; else if(PN1[i-1] > PN2[i-1]) return 1; else return 0; } return 0; } u8 WapiGetEntryForCamWrite(_adapter *padapter,u8 *pMacAddr,u8 KID,BOOLEAN IsMsk) { PRT_WAPI_T pWapiInfo=NULL; //PRT_WAPI_CAM_ENTRY pEntry=NULL; u8 i=0; u8 ret = 0xff; WAPI_TRACE(WAPI_API, "===========> %s\n", __FUNCTION__); pWapiInfo = &padapter->wapiInfo; //exist? for(i=0;i<WAPI_CAM_ENTRY_NUM;i++) { if(pWapiInfo->wapiCamEntry[i].IsUsed && (_rtw_memcmp(pMacAddr, pWapiInfo->wapiCamEntry[i].PeerMacAddr, ETH_ALEN) == _TRUE) && pWapiInfo->wapiCamEntry[i].keyidx == KID && pWapiInfo->wapiCamEntry[i].type == IsMsk) { ret = pWapiInfo->wapiCamEntry[i].entry_idx; //cover it break; } } if(i == WAPI_CAM_ENTRY_NUM) //not found { for(i=0;i<WAPI_CAM_ENTRY_NUM;i++) { if(pWapiInfo->wapiCamEntry[i].IsUsed == 0) { pWapiInfo->wapiCamEntry[i].IsUsed = 1; pWapiInfo->wapiCamEntry[i].type = IsMsk; pWapiInfo->wapiCamEntry[i].keyidx = KID; _rtw_memcpy(pWapiInfo->wapiCamEntry[i].PeerMacAddr, pMacAddr,ETH_ALEN); ret = pWapiInfo->wapiCamEntry[i].entry_idx; break; } } } WAPI_TRACE(WAPI_API, "<========== %s\n", __FUNCTION__); return ret; /* if(RTIsListEmpty(&pWapiInfo->wapiCamIdleList)){ RT_TRACE(COMP_SEC,DBG_LOUD,("No Entry for wapi!!!\n")); return 0; } pEntry = (PRT_WAPI_CAM_ENTRY)RTRemoveHeadList(&pWapiInfo->wapiCamIdleList); RTInsertTailList(&pWapiInfo->wapiCamUsedList, &pEntry->list); RT_TRACE(COMP_SEC,DBG_LOUD,("<====WapiGetCamEntry(),Get Entry Idx:%d.but we just return 4 for test\n",pEntry->entry_idx)); return pEntry->entry_idx;*/ } u8 WapiGetEntryForCamClear(_adapter *padapter,u8 *pPeerMac,u8 keyid,u8 IsMsk) { PRT_WAPI_T pWapiInfo=NULL; u8 i=0; WAPI_TRACE(WAPI_API, "===========> %s\n", __FUNCTION__); pWapiInfo = &padapter->wapiInfo; for(i=0;i<WAPI_CAM_ENTRY_NUM;i++) { if(pWapiInfo->wapiCamEntry[i].IsUsed && (_rtw_memcmp(pPeerMac, pWapiInfo->wapiCamEntry[i].PeerMacAddr, ETH_ALEN) == _TRUE) && pWapiInfo->wapiCamEntry[i].keyidx == keyid && pWapiInfo->wapiCamEntry[i].type == IsMsk) { pWapiInfo->wapiCamEntry[i].IsUsed = 0; pWapiInfo->wapiCamEntry[i].keyidx = 2; _rtw_memset(pWapiInfo->wapiCamEntry[i].PeerMacAddr,0,ETH_ALEN); WAPI_TRACE(WAPI_API, "<========== %s\n", __FUNCTION__); return pWapiInfo->wapiCamEntry[i].entry_idx; } } WAPI_TRACE(WAPI_API,"<====WapiGetReturnCamEntry(), No this cam entry.\n"); return 0xff; /* if(RTIsListEmpty(&pWapiInfo->wapiCamUsedList)){ RT_TRACE(COMP_SEC,DBG_LOUD,("No Entry for wapi!!!\n")); return FALSE; } pList = &pWapiInfo->wapiCamUsedList; while(pList->Flink != &pWapiInfo->wapiCamUsedList) { pEntry = (PRT_WAPI_CAM_ENTRY)pList->Flink; if(PlatformCompareMemory(pPeerMac,pEntry->PeerMacAddr, ETHER_ADDRLEN)== 0 && keyid == pEntry->keyidx) { RTRemoveEntryList(pList); RTInsertHeadList(&pWapiInfo->wapiCamIdleList, pList); return pEntry->entry_idx; } pList = pList->Flink; } return 0; */ } void WapiResetAllCamEntry(_adapter *padapter) { PRT_WAPI_T pWapiInfo; int i; WAPI_TRACE(WAPI_API, "===========> %s\n", __FUNCTION__); pWapiInfo = &padapter->wapiInfo; for (i=0;i<WAPI_CAM_ENTRY_NUM;i++) { _rtw_memset(pWapiInfo->wapiCamEntry[i].PeerMacAddr, 0, ETH_ALEN); pWapiInfo->wapiCamEntry[i].IsUsed = 0; pWapiInfo->wapiCamEntry[i].keyidx = 2; //invalid pWapiInfo->wapiCamEntry[i].entry_idx = 4+i*2; } WAPI_TRACE(WAPI_API, "<========== %s\n", __FUNCTION__); return; } u8 WapiWriteOneCamEntry( _adapter *padapter, u8 *pMacAddr, u8 KeyId, u8 EntryId, u8 EncAlg, u8 bGroupKey, u8 *pKey ) { u8 retVal = 0; u16 usConfig = 0; WAPI_TRACE(WAPI_API, "===========> %s\n", __FUNCTION__); if(EntryId >= 32) { WAPI_TRACE(WAPI_ERR, "<=== CamAddOneEntry(): ulKeyId exceed!\n"); return retVal; } usConfig=usConfig|(0x01<<15)|((u16)(EncAlg)<<2)|(KeyId); if(EncAlg == _SMS4_ ) { if(bGroupKey == 1) usConfig |= (0x01<<6); if((EntryId % 2)==1) // ==0 sec key; == 1mic key usConfig |= (0x01<<5); } write_cam(padapter, EntryId, usConfig, pMacAddr, pKey); WAPI_TRACE(WAPI_API, "===========> %s\n", __FUNCTION__); return 1; } void rtw_wapi_init(_adapter *padapter) { PRT_WAPI_T pWapiInfo; int i; WAPI_TRACE(WAPI_INIT, "===========> %s\n", __FUNCTION__); RT_ASSERT_RET(padapter); if (!padapter->WapiSupport) { WAPI_TRACE(WAPI_INIT, "<========== %s, WAPI not supported!\n", __FUNCTION__); return; } pWapiInfo = &padapter->wapiInfo; pWapiInfo->bWapiEnable = false; //Init BKID List INIT_LIST_HEAD(&pWapiInfo->wapiBKIDIdleList); INIT_LIST_HEAD(&pWapiInfo->wapiBKIDStoreList); for(i=0;i<WAPI_MAX_BKID_NUM;i++) { list_add_tail(&pWapiInfo->wapiBKID[i].list, &pWapiInfo->wapiBKIDIdleList); } //Init STA List INIT_LIST_HEAD(&pWapiInfo->wapiSTAIdleList); INIT_LIST_HEAD(&pWapiInfo->wapiSTAUsedList); for(i=0;i<WAPI_MAX_STAINFO_NUM;i++) { list_add_tail(&pWapiInfo->wapiSta[i].list, &pWapiInfo->wapiSTAIdleList); } for (i=0;i<WAPI_CAM_ENTRY_NUM;i++) { pWapiInfo->wapiCamEntry[i].IsUsed = 0; pWapiInfo->wapiCamEntry[i].keyidx = 2; //invalid pWapiInfo->wapiCamEntry[i].entry_idx = 4+i*2; } WAPI_TRACE(WAPI_INIT, "<========== %s\n", __FUNCTION__); } void rtw_wapi_free(_adapter *padapter) { WAPI_TRACE(WAPI_INIT, "===========> %s\n", __FUNCTION__); RT_ASSERT_RET(padapter); if (!padapter->WapiSupport) { WAPI_TRACE(WAPI_INIT, "<========== %s, WAPI not supported!\n", __FUNCTION__); return; } WapiFreeAllStaInfo(padapter); WAPI_TRACE(WAPI_INIT, "<========== %s\n", __FUNCTION__); } void rtw_wapi_disable_tx(_adapter *padapter) { WAPI_TRACE(WAPI_INIT, "===========> %s\n", __FUNCTION__); RT_ASSERT_RET(padapter); if (!padapter->WapiSupport) { WAPI_TRACE(WAPI_INIT, "<========== %s, WAPI not supported!\n", __FUNCTION__); return; } padapter->wapiInfo.wapiTxMsk.bTxEnable = false; padapter->wapiInfo.wapiTxMsk.bSet = false; WAPI_TRACE(WAPI_INIT, "<========== %s\n", __FUNCTION__); } u8 rtw_wapi_is_wai_packet(_adapter* padapter,u8 *pkt_data) { PRT_WAPI_T pWapiInfo = &(padapter->wapiInfo); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct security_priv *psecuritypriv = &padapter->securitypriv; PRT_WAPI_STA_INFO pWapiSta = NULL; u8 WaiPkt = 0, *pTaddr, bFind = false; u8 Offset_TypeWAI = 0 ; // (mac header len + llc length) WAPI_TRACE(WAPI_TX|WAPI_RX, "===========> %s\n", __FUNCTION__); if ((!padapter->WapiSupport) || (!pWapiInfo->bWapiEnable)) { WAPI_TRACE(WAPI_MLME, "<========== %s, WAPI not supported or not enabled!\n", __FUNCTION__); return 0; } Offset_TypeWAI = 24 + 6 ; //YJ,add,091103. Data frame may also have skb->data[30]=0x88 and skb->data[31]=0xb4. if ((pkt_data[1]&0x40) !=0) { //DBG_871X("data is privacy \n"); return 0; } pTaddr = GetAddr2Ptr(pkt_data); if(list_empty(&pWapiInfo->wapiSTAUsedList)){ bFind = false; }else{ list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list){ if (_rtw_memcmp(pTaddr, pWapiSta->PeerMacAddr, 6) == _TRUE) { bFind = true; break; } } } WAPI_TRACE(WAPI_TX|WAPI_RX, "%s: bFind=%d pTaddr="MAC_FMT"\n", __FUNCTION__, bFind, MAC_ARG(pTaddr)); if (pkt_data[0] == WIFI_QOS_DATA_TYPE) { Offset_TypeWAI += 2; } // 88b4? if( (pkt_data[Offset_TypeWAI]==0x88) && (pkt_data[Offset_TypeWAI+1]==0xb4) ){ WaiPkt = pkt_data[Offset_TypeWAI+5]; psecuritypriv->hw_decrypted = _TRUE; }else{ WAPI_TRACE(WAPI_TX|WAPI_RX, "%s(): non wai packet\n",__FUNCTION__); } WAPI_TRACE(WAPI_TX|WAPI_RX, "%s(): Recvd WAI frame. IsWAIPkt(%d)\n",__FUNCTION__, WaiPkt); return WaiPkt; } void rtw_wapi_update_info(_adapter *padapter, union recv_frame *precv_frame) { PRT_WAPI_T pWapiInfo = &(padapter->wapiInfo); struct recv_frame_hdr *precv_hdr; u8 *ptr; u8 *pTA; u8 *pRecvPN; WAPI_TRACE(WAPI_RX, "===========> %s\n", __FUNCTION__); if ((!padapter->WapiSupport) || (!pWapiInfo->bWapiEnable)) { WAPI_TRACE(WAPI_RX, "<========== %s, WAPI not supported or not enabled!\n", __FUNCTION__); return; } precv_hdr = &precv_frame->u.hdr; ptr = precv_hdr->rx_data; if (precv_hdr->attrib.qos == 1) { precv_hdr->UserPriority = GetTid(ptr); } else { precv_hdr->UserPriority = 0; } pTA = GetAddr2Ptr(ptr); _rtw_memcpy((u8 *)precv_hdr->WapiSrcAddr, pTA, 6); pRecvPN = ptr + precv_hdr->attrib.hdrlen + 2; _rtw_memcpy((u8 *)precv_hdr->WapiTempPN, pRecvPN, 16); WAPI_TRACE(WAPI_RX, "<========== %s\n", __FUNCTION__); } /**************************************************************************** TRUE-----------------Drop FALSE---------------- handle add to support WAPI to N-mode *****************************************************************************/ u8 rtw_wapi_check_for_drop( _adapter *padapter, union recv_frame *precv_frame ) { PRT_WAPI_T pWapiInfo = &(padapter->wapiInfo); u8 *pLastRecvPN = NULL; u8 bFind = false; PRT_WAPI_STA_INFO pWapiSta = NULL; u8 bDrop = false; struct recv_frame_hdr *precv_hdr = &precv_frame->u.hdr; u8 WapiAEPNInitialValueSrc[16] = {0x37,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C} ; u8 WapiAEMultiCastPNInitialValueSrc[16] = {0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C} ; u8 *ptr = precv_frame->u.hdr.rx_data; int i; WAPI_TRACE(WAPI_RX, "===========> %s\n", __FUNCTION__); if ((!padapter->WapiSupport) || (!pWapiInfo->bWapiEnable)) { WAPI_TRACE(WAPI_RX, "<========== %s, WAPI not supported or not enabled!\n", __FUNCTION__); return false; } if(precv_hdr->bIsWaiPacket !=0) { if(precv_hdr->bIsWaiPacket== 0x8) { DBG_871X("rtw_wapi_check_for_drop: dump packet \n"); for(i=0;i<50;i++) { DBG_871X("%02X ",ptr[i]); if((i+1) %8 ==0) DBG_871X("\n"); } DBG_871X("\n rtw_wapi_check_for_drop: dump packet \n"); for(i=0;i<16;i++) { if(ptr[i+27] !=0) break; } if(i== 16) { WAPI_TRACE(WAPI_RX,"rtw_wapi_check_for_drop: drop with zero BKID \n"); return true; } else { return false; } } else return false; } if(list_empty(&pWapiInfo->wapiSTAUsedList)){ bFind = false; }else{ list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) { if (_rtw_memcmp(precv_hdr->WapiSrcAddr, pWapiSta->PeerMacAddr, ETH_ALEN) == _TRUE) { bFind = true; break; } } } WAPI_TRACE(WAPI_RX, "%s: bFind=%d prxb->WapiSrcAddr="MAC_FMT"\n", __FUNCTION__, bFind, MAC_ARG(precv_hdr->WapiSrcAddr)); if(bFind) { if(IS_MCAST(precv_hdr->attrib.ra)) { WAPI_TRACE(WAPI_RX,"rtw_wapi_check_for_drop: multicast case \n"); pLastRecvPN = pWapiSta->lastRxMulticastPN; } else { WAPI_TRACE(WAPI_RX,"rtw_wapi_check_for_drop: unicast case \n"); switch(precv_hdr->UserPriority) { case 0: case 3: pLastRecvPN = pWapiSta->lastRxUnicastPNBEQueue; break; case 1: case 2: pLastRecvPN = pWapiSta->lastRxUnicastPNBKQueue; break; case 4: case 5: pLastRecvPN = pWapiSta->lastRxUnicastPNVIQueue; break; case 6: case 7: pLastRecvPN = pWapiSta->lastRxUnicastPNVOQueue; break; default: WAPI_TRACE(WAPI_ERR,"%s: Unknown TID \n",__FUNCTION__); break; } } if(!WapiComparePN(precv_hdr->WapiTempPN,pLastRecvPN)) { WAPI_TRACE(WAPI_RX,"%s: Equal PN!!\n",__FUNCTION__); if(IS_MCAST(precv_hdr->attrib.ra)) _rtw_memcpy(pLastRecvPN,WapiAEMultiCastPNInitialValueSrc,16); else _rtw_memcpy(pLastRecvPN,WapiAEPNInitialValueSrc,16); bDrop = true; } else { _rtw_memcpy(pLastRecvPN,precv_hdr->WapiTempPN,16); } } WAPI_TRACE(WAPI_RX, "<========== %s\n", __FUNCTION__); return bDrop; } void rtw_build_probe_resp_wapi_ie(_adapter *padapter, unsigned char *pframe, struct pkt_attrib *pattrib) { PRT_WAPI_T pWapiInfo = &(padapter->wapiInfo); u8 WapiIELength = 0; WAPI_TRACE(WAPI_MLME, "===========> %s\n", __FUNCTION__); if ((!padapter->WapiSupport) || (!pWapiInfo->bWapiEnable)) { WAPI_TRACE(WAPI_MLME, "<========== %s, WAPI not supported!\n", __FUNCTION__); return; } WapiSetIE(padapter); WapiIELength = pWapiInfo->wapiIELength; pframe[0] = _WAPI_IE_; pframe[1] = WapiIELength; _rtw_memcpy(pframe+2, pWapiInfo->wapiIE, WapiIELength); pframe += WapiIELength+2; pattrib->pktlen += WapiIELength+2; WAPI_TRACE(WAPI_MLME, "<========== %s\n", __FUNCTION__); } void rtw_build_beacon_wapi_ie(_adapter *padapter, unsigned char *pframe, struct pkt_attrib *pattrib) { PRT_WAPI_T pWapiInfo = &(padapter->wapiInfo); u8 WapiIELength = 0; WAPI_TRACE(WAPI_MLME, "===========> %s\n", __FUNCTION__); if ((!padapter->WapiSupport) || (!pWapiInfo->bWapiEnable)) { WAPI_TRACE(WAPI_MLME, "<========== %s, WAPI not supported!\n", __FUNCTION__); return; } WapiSetIE(padapter); WapiIELength = pWapiInfo->wapiIELength; pframe[0] = _WAPI_IE_; pframe[1] = WapiIELength; _rtw_memcpy(pframe+2, pWapiInfo->wapiIE, WapiIELength); pframe += WapiIELength+2; pattrib->pktlen += WapiIELength+2; WAPI_TRACE(WAPI_MLME, "<========== %s\n", __FUNCTION__); } void rtw_build_assoc_req_wapi_ie(_adapter *padapter, unsigned char *pframe, struct pkt_attrib *pattrib) { PRT_WAPI_BKID pWapiBKID; u16 bkidNum; PRT_WAPI_T pWapiInfo = &(padapter->wapiInfo); u8 WapiIELength = 0; WAPI_TRACE(WAPI_MLME, "===========> %s\n", __FUNCTION__); if ((!padapter->WapiSupport) || (!pWapiInfo->bWapiEnable)) { WAPI_TRACE(WAPI_MLME, "<========== %s, WAPI not supported!\n", __FUNCTION__); return; } WapiSetIE(padapter); WapiIELength = pWapiInfo->wapiIELength; bkidNum = 0; if(!list_empty(&(pWapiInfo->wapiBKIDStoreList))){ list_for_each_entry(pWapiBKID, &pWapiInfo->wapiBKIDStoreList, list) { bkidNum ++; _rtw_memcpy(pWapiInfo->wapiIE+WapiIELength+2, pWapiBKID->bkid,16); WapiIELength += 16; } } _rtw_memcpy(pWapiInfo->wapiIE+WapiIELength, &bkidNum, 2); WapiIELength += 2; pframe[0] = _WAPI_IE_; pframe[1] = WapiIELength; _rtw_memcpy(pframe+2, pWapiInfo->wapiIE, WapiIELength); pframe += WapiIELength+2; pattrib->pktlen += WapiIELength+2; WAPI_TRACE(WAPI_MLME, "<========== %s\n", __FUNCTION__); } void rtw_wapi_on_assoc_ok(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE) { PRT_WAPI_T pWapiInfo = &(padapter->wapiInfo); PRT_WAPI_STA_INFO pWapiSta; u8 WapiAEPNInitialValueSrc[16] = {0x37,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C} ; //u8 WapiASUEPNInitialValueSrc[16] = {0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C} ; u8 WapiAEMultiCastPNInitialValueSrc[16] = {0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C} ; WAPI_TRACE(WAPI_MLME, "===========> %s\n", __FUNCTION__); if ((!padapter->WapiSupport) || (!pWapiInfo->bWapiEnable)) { WAPI_TRACE(WAPI_MLME, "<========== %s, WAPI not supported or not enabled!\n", __FUNCTION__); return; } pWapiSta =(PRT_WAPI_STA_INFO)list_entry(pWapiInfo->wapiSTAIdleList.next, RT_WAPI_STA_INFO, list); list_del_init(&pWapiSta->list); list_add_tail(&pWapiSta->list, &pWapiInfo->wapiSTAUsedList); _rtw_memcpy(pWapiSta->PeerMacAddr,padapter->mlmeextpriv.mlmext_info.network.MacAddress,6); _rtw_memcpy(pWapiSta->lastRxMulticastPN, WapiAEMultiCastPNInitialValueSrc, 16); _rtw_memcpy(pWapiSta->lastRxUnicastPN, WapiAEPNInitialValueSrc, 16); //For chenk PN error with Qos Data after s3: add by ylb 20111114 _rtw_memcpy(pWapiSta->lastRxUnicastPNBEQueue,WapiAEPNInitialValueSrc,16); _rtw_memcpy(pWapiSta->lastRxUnicastPNBKQueue,WapiAEPNInitialValueSrc,16); _rtw_memcpy(pWapiSta->lastRxUnicastPNVIQueue,WapiAEPNInitialValueSrc,16); _rtw_memcpy(pWapiSta->lastRxUnicastPNVOQueue,WapiAEPNInitialValueSrc,16); WAPI_TRACE(WAPI_MLME, "<========== %s\n", __FUNCTION__); } void rtw_wapi_return_one_sta_info(_adapter *padapter, u8 *MacAddr) { PRT_WAPI_T pWapiInfo; PRT_WAPI_STA_INFO pWapiStaInfo = NULL; PRT_WAPI_BKID pWapiBkid = NULL; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; pWapiInfo = &padapter->wapiInfo; WAPI_TRACE(WAPI_API, "==========> %s\n", __FUNCTION__); if ((!padapter->WapiSupport) || (!pWapiInfo->bWapiEnable)) { WAPI_TRACE(WAPI_MLME, "<========== %s, WAPI not supported or not enabled!\n", __FUNCTION__); return; } if(check_fwstate(pmlmepriv, WIFI_STATION_STATE)) { while(!list_empty(&(pWapiInfo->wapiBKIDStoreList))) { pWapiBkid = (PRT_WAPI_BKID)list_entry(pWapiInfo->wapiBKIDStoreList.next, RT_WAPI_BKID, list); list_del_init(&pWapiBkid->list); _rtw_memset(pWapiBkid->bkid,0,16); list_add_tail(&pWapiBkid->list, &pWapiInfo->wapiBKIDIdleList); } } WAPI_TRACE(WAPI_API, " %s: after clear bkid \n", __FUNCTION__); //Remove STA info if(list_empty(&(pWapiInfo->wapiSTAUsedList))){ WAPI_TRACE(WAPI_API, " %s: wapiSTAUsedList is null \n", __FUNCTION__); return; }else{ WAPI_TRACE(WAPI_API, " %s: wapiSTAUsedList is not null \n", __FUNCTION__); #if 0 pWapiStaInfo=(PRT_WAPI_STA_INFO)list_entry((pWapiInfo->wapiSTAUsedList.next),RT_WAPI_STA_INFO,list); list_for_each_entry(pWapiStaInfo, &(pWapiInfo->wapiSTAUsedList), list) { DBG_871X("MAC Addr %02x-%02x-%02x-%02x-%02x-%02x \n",MacAddr[0],MacAddr[1],MacAddr[2],MacAddr[3],MacAddr[4],MacAddr[5]); DBG_871X("peer Addr %02x-%02x-%02x-%02x-%02x-%02x \n",pWapiStaInfo->PeerMacAddr[0],pWapiStaInfo->PeerMacAddr[1],pWapiStaInfo->PeerMacAddr[2],pWapiStaInfo->PeerMacAddr[3],pWapiStaInfo->PeerMacAddr[4],pWapiStaInfo->PeerMacAddr[5]); if(pWapiStaInfo == NULL) { WAPI_TRACE(WAPI_API, " %s: pWapiStaInfo == NULL Case \n", __FUNCTION__); return; } if(pWapiStaInfo->PeerMacAddr == NULL) { WAPI_TRACE(WAPI_API, " %s: pWapiStaInfo->PeerMacAddr == NULL Case \n", __FUNCTION__); return; } if(MacAddr == NULL) { WAPI_TRACE(WAPI_API, " %s: MacAddr == NULL Case \n", __FUNCTION__); return; } if (_rtw_memcmp(pWapiStaInfo->PeerMacAddr, MacAddr, ETH_ALEN) == _TRUE) { pWapiStaInfo->bAuthenticateInProgress = false; pWapiStaInfo->bSetkeyOk = false; _rtw_memset(pWapiStaInfo->PeerMacAddr,0,ETH_ALEN); list_del_init(&pWapiStaInfo->list); list_add_tail(&pWapiStaInfo->list, &pWapiInfo->wapiSTAIdleList); break; } } #endif while(!list_empty(&(pWapiInfo->wapiSTAUsedList))) { pWapiStaInfo = (PRT_WAPI_STA_INFO)list_entry(pWapiInfo->wapiSTAUsedList.next, RT_WAPI_STA_INFO, list); DBG_871X("peer Addr %02x-%02x-%02x-%02x-%02x-%02x \n",pWapiStaInfo->PeerMacAddr[0],pWapiStaInfo->PeerMacAddr[1],pWapiStaInfo->PeerMacAddr[2],pWapiStaInfo->PeerMacAddr[3],pWapiStaInfo->PeerMacAddr[4],pWapiStaInfo->PeerMacAddr[5]); list_del_init(&pWapiStaInfo->list); memset(pWapiStaInfo->PeerMacAddr,0,ETH_ALEN); pWapiStaInfo->bSetkeyOk = 0; list_add_tail(&pWapiStaInfo->list, &pWapiInfo->wapiSTAIdleList); } } WAPI_TRACE(WAPI_API, "<========== %s\n", __FUNCTION__); return; } void rtw_wapi_return_all_sta_info(_adapter *padapter) { PRT_WAPI_T pWapiInfo; PRT_WAPI_STA_INFO pWapiStaInfo; PRT_WAPI_BKID pWapiBkid; WAPI_TRACE(WAPI_API, "===========> %s\n", __FUNCTION__); pWapiInfo = &padapter->wapiInfo; if ((!padapter->WapiSupport) || (!pWapiInfo->bWapiEnable)) { WAPI_TRACE(WAPI_MLME, "<========== %s, WAPI not supported or not enabled!\n", __FUNCTION__); return; } //Sta Info List while(!list_empty(&(pWapiInfo->wapiSTAUsedList))) { pWapiStaInfo = (PRT_WAPI_STA_INFO)list_entry(pWapiInfo->wapiSTAUsedList.next, RT_WAPI_STA_INFO, list); list_del_init(&pWapiStaInfo->list); memset(pWapiStaInfo->PeerMacAddr,0,ETH_ALEN); pWapiStaInfo->bSetkeyOk = 0; list_add_tail(&pWapiStaInfo->list, &pWapiInfo->wapiSTAIdleList); } //BKID List while(!list_empty(&(pWapiInfo->wapiBKIDStoreList))) { pWapiBkid = (PRT_WAPI_BKID)list_entry(pWapiInfo->wapiBKIDStoreList.next, RT_WAPI_BKID, list); list_del_init(&pWapiBkid->list); memset(pWapiBkid->bkid,0,16); list_add_tail(&pWapiBkid->list, &pWapiInfo->wapiBKIDIdleList); } WAPI_TRACE(WAPI_API, "<========== %s\n", __FUNCTION__); } void rtw_wapi_clear_cam_entry(_adapter *padapter, u8 *pMacAddr) { u8 UcIndex = 0; WAPI_TRACE(WAPI_API, "===========> %s\n", __FUNCTION__); if ((!padapter->WapiSupport) || (!padapter->wapiInfo.bWapiEnable)) { WAPI_TRACE(WAPI_MLME, "<========== %s, WAPI not supported or not enabled!\n", __FUNCTION__); return; } UcIndex = WapiGetEntryForCamClear(padapter, pMacAddr, 0, 0); if(UcIndex != 0xff){ //CAM_mark_invalid(Adapter, UcIndex); CAM_empty_entry(padapter, UcIndex); } UcIndex = WapiGetEntryForCamClear(padapter, pMacAddr, 1, 0); if(UcIndex != 0xff){ //CAM_mark_invalid(Adapter, UcIndex); CAM_empty_entry(padapter, UcIndex); } UcIndex = WapiGetEntryForCamClear(padapter, pMacAddr, 0, 1); if(UcIndex != 0xff){ //CAM_mark_invalid(Adapter, UcIndex); CAM_empty_entry(padapter, UcIndex); } UcIndex = WapiGetEntryForCamClear(padapter, pMacAddr, 1, 1); if(UcIndex != 0xff){ //CAM_mark_invalid(padapter, UcIndex); CAM_empty_entry(padapter, UcIndex); } WAPI_TRACE(WAPI_API, "<========== %s\n", __FUNCTION__); } void rtw_wapi_clear_all_cam_entry(_adapter *padapter) { WAPI_TRACE(WAPI_API, "===========> %s\n", __FUNCTION__); if ((!padapter->WapiSupport) || (!padapter->wapiInfo.bWapiEnable)) { WAPI_TRACE(WAPI_MLME, "<========== %s, WAPI not supported or not enabled!\n", __FUNCTION__); return; } invalidate_cam_all(padapter); // is this ok? WapiResetAllCamEntry(padapter); WAPI_TRACE(WAPI_API, "===========> %s\n", __FUNCTION__); } void rtw_wapi_set_key(_adapter *padapter, RT_WAPI_KEY *pWapiKey, RT_WAPI_STA_INFO *pWapiSta, u8 bGroupKey, u8 bUseDefaultKey) { PRT_WAPI_T pWapiInfo = &padapter->wapiInfo; u8 *pMacAddr = pWapiSta->PeerMacAddr; u32 EntryId = 0; BOOLEAN IsPairWise = false ; u8 EncAlgo; WAPI_TRACE(WAPI_API, "===========> %s\n", __FUNCTION__); if ((!padapter->WapiSupport) || (!padapter->wapiInfo.bWapiEnable)) { WAPI_TRACE(WAPI_API, "<========== %s, WAPI not supported or not enabled!\n", __FUNCTION__); return; } EncAlgo = _SMS4_; //For Tx bc/mc pkt,use defualt key entry if(bUseDefaultKey) { // when WAPI update key, keyid will be 0 or 1 by turns. if (pWapiKey->keyId == 0) EntryId = 0; else EntryId = 2; } else { // tx/rx unicast pkt, or rx broadcast, find the key entry by peer's MacAddr EntryId = WapiGetEntryForCamWrite(padapter,pMacAddr,pWapiKey->keyId,bGroupKey); } if(EntryId == 0xff){ WAPI_TRACE(WAPI_API, "===>No entry for WAPI setkey! !!\n"); return; } //EntryId is also used to diff Sec key and Mic key //Sec Key WapiWriteOneCamEntry(padapter, pMacAddr, pWapiKey->keyId, //keyid EntryId, //entry EncAlgo, //type bGroupKey, //pairwise or group key pWapiKey->dataKey); //MIC key WapiWriteOneCamEntry(padapter, pMacAddr, pWapiKey->keyId, //keyid EntryId+1, //entry EncAlgo, //type bGroupKey, //pairwise or group key pWapiKey->micKey); WAPI_TRACE(WAPI_API, "Set Wapi Key :KeyId:%d,EntryId:%d,PairwiseKey:%d.\n",pWapiKey->keyId,EntryId,!bGroupKey); WAPI_TRACE(WAPI_API, "===========> %s\n", __FUNCTION__); } #if 0 //YJ,test,091013 void wapi_test_set_key(struct _adapter *padapter, u8* buf) { /*Data: keyType(1) + bTxEnable(1) + bAuthenticator(1) + bUpdate(1) + PeerAddr(6) + DataKey(16) + MicKey(16) + KeyId(1)*/ PRT_WAPI_T pWapiInfo = &padapter->wapiInfo; PRT_WAPI_BKID pWapiBkid; PRT_WAPI_STA_INFO pWapiSta; u8 data[43]; bool bTxEnable; bool bUpdate; bool bAuthenticator; u8 PeerAddr[6]; u8 WapiAEPNInitialValueSrc[16] = {0x37,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C} ; u8 WapiASUEPNInitialValueSrc[16] = {0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C} ; u8 WapiAEMultiCastPNInitialValueSrc[16] = {0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C} ; WAPI_TRACE(WAPI_INIT, "===========>%s\n", __FUNCTION__); if (!padapter->WapiSupport){ return; } copy_from_user(data, buf, 43); bTxEnable = data[1]; bAuthenticator = data[2]; bUpdate = data[3]; memcpy(PeerAddr,data+4,6); if(data[0] == 0x3){ if(!list_empty(&(pWapiInfo->wapiBKIDIdleList))){ pWapiBkid = (PRT_WAPI_BKID)list_entry(pWapiInfo->wapiBKIDIdleList.next, RT_WAPI_BKID, list); list_del_init(&pWapiBkid->list); memcpy(pWapiBkid->bkid, data+10, 16); WAPI_DATA(WAPI_INIT, "SetKey - BKID", pWapiBkid->bkid, 16); list_add_tail(&pWapiBkid->list, &pWapiInfo->wapiBKIDStoreList); } }else{ list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) { if(!memcmp(pWapiSta->PeerMacAddr,PeerAddr,6)){ pWapiSta->bAuthenticatorInUpdata = false; switch(data[0]){ case 1: //usk if(bAuthenticator){ //authenticator memcpy(pWapiSta->lastTxUnicastPN,WapiAEPNInitialValueSrc,16); if(!bUpdate) { //first WAPI_TRACE(WAPI_INIT,"AE fisrt set usk \n"); pWapiSta->wapiUsk.bSet = true; memcpy(pWapiSta->wapiUsk.dataKey,data+10,16); memcpy(pWapiSta->wapiUsk.micKey,data+26,16); pWapiSta->wapiUsk.keyId = *(data+42); pWapiSta->wapiUsk.bTxEnable = true; WAPI_DATA(WAPI_INIT, "SetKey - AE USK Data Key", pWapiSta->wapiUsk.dataKey, 16); WAPI_DATA(WAPI_INIT, "SetKey - AE USK Mic Key", pWapiSta->wapiUsk.micKey, 16); } else //update { WAPI_TRACE(WAPI_INIT, "AE update usk \n"); pWapiSta->wapiUskUpdate.bSet = true; pWapiSta->bAuthenticatorInUpdata = true; memcpy(pWapiSta->wapiUskUpdate.dataKey,data+10,16); memcpy(pWapiSta->wapiUskUpdate.micKey,data+26,16); memcpy(pWapiSta->lastRxUnicastPNBEQueue,WapiASUEPNInitialValueSrc,16); memcpy(pWapiSta->lastRxUnicastPNBKQueue,WapiASUEPNInitialValueSrc,16); memcpy(pWapiSta->lastRxUnicastPNVIQueue,WapiASUEPNInitialValueSrc,16); memcpy(pWapiSta->lastRxUnicastPNVOQueue,WapiASUEPNInitialValueSrc,16); memcpy(pWapiSta->lastRxUnicastPN,WapiASUEPNInitialValueSrc,16); pWapiSta->wapiUskUpdate.keyId = *(data+42); pWapiSta->wapiUskUpdate.bTxEnable = true; } } else{ if(!bUpdate){ WAPI_TRACE(WAPI_INIT,"ASUE fisrt set usk \n"); if(bTxEnable){ pWapiSta->wapiUsk.bTxEnable = true; memcpy(pWapiSta->lastTxUnicastPN,WapiASUEPNInitialValueSrc,16); }else{ pWapiSta->wapiUsk.bSet = true; memcpy(pWapiSta->wapiUsk.dataKey,data+10,16); memcpy(pWapiSta->wapiUsk.micKey,data+26,16); pWapiSta->wapiUsk.keyId = *(data+42); pWapiSta->wapiUsk.bTxEnable = false; } }else{ WAPI_TRACE(WAPI_INIT,"ASUE update usk \n"); if(bTxEnable){ pWapiSta->wapiUskUpdate.bTxEnable = true; if(pWapiSta->wapiUskUpdate.bSet){ memcpy(pWapiSta->wapiUsk.dataKey,pWapiSta->wapiUskUpdate.dataKey,16); memcpy(pWapiSta->wapiUsk.micKey,pWapiSta->wapiUskUpdate.micKey,16); pWapiSta->wapiUsk.keyId=pWapiSta->wapiUskUpdate.keyId; memcpy(pWapiSta->lastRxUnicastPNBEQueue,WapiASUEPNInitialValueSrc,16); memcpy(pWapiSta->lastRxUnicastPNBKQueue,WapiASUEPNInitialValueSrc,16); memcpy(pWapiSta->lastRxUnicastPNVIQueue,WapiASUEPNInitialValueSrc,16); memcpy(pWapiSta->lastRxUnicastPNVOQueue,WapiASUEPNInitialValueSrc,16); memcpy(pWapiSta->lastRxUnicastPN,WapiASUEPNInitialValueSrc,16); pWapiSta->wapiUskUpdate.bTxEnable = false; pWapiSta->wapiUskUpdate.bSet = false; } memcpy(pWapiSta->lastTxUnicastPN,WapiASUEPNInitialValueSrc,16); }else{ pWapiSta->wapiUskUpdate.bSet = true; memcpy(pWapiSta->wapiUskUpdate.dataKey,data+10,16); memcpy(pWapiSta->wapiUskUpdate.micKey,data+26,16); pWapiSta->wapiUskUpdate.keyId = *(data+42); pWapiSta->wapiUskUpdate.bTxEnable = false; } } } break; case 2: //msk if(bAuthenticator){ //authenticator pWapiInfo->wapiTxMsk.bSet = true; memcpy(pWapiInfo->wapiTxMsk.dataKey,data+10,16); memcpy(pWapiInfo->wapiTxMsk.micKey,data+26,16); pWapiInfo->wapiTxMsk.keyId = *(data+42); pWapiInfo->wapiTxMsk.bTxEnable = true; memcpy(pWapiInfo->lastTxMulticastPN,WapiAEMultiCastPNInitialValueSrc,16); if(!bUpdate){ //first WAPI_TRACE(WAPI_INIT, "AE fisrt set msk \n"); if(!pWapiSta->bSetkeyOk) pWapiSta->bSetkeyOk = true; pWapiInfo->bFirstAuthentiateInProgress= false; }else{ //update WAPI_TRACE(WAPI_INIT,"AE update msk \n"); } WAPI_DATA(WAPI_INIT, "SetKey - AE MSK Data Key", pWapiInfo->wapiTxMsk.dataKey, 16); WAPI_DATA(WAPI_INIT, "SetKey - AE MSK Mic Key", pWapiInfo->wapiTxMsk.micKey, 16); } else{ if(!bUpdate){ WAPI_TRACE(WAPI_INIT,"ASUE fisrt set msk \n"); pWapiSta->wapiMsk.bSet = true; memcpy(pWapiSta->wapiMsk.dataKey,data+10,16); memcpy(pWapiSta->wapiMsk.micKey,data+26,16); pWapiSta->wapiMsk.keyId = *(data+42); pWapiSta->wapiMsk.bTxEnable = false; if(!pWapiSta->bSetkeyOk) pWapiSta->bSetkeyOk = true; pWapiInfo->bFirstAuthentiateInProgress= false; WAPI_DATA(WAPI_INIT, "SetKey - ASUE MSK Data Key", pWapiSta->wapiMsk.dataKey, 16); WAPI_DATA(WAPI_INIT, "SetKey - ASUE MSK Mic Key", pWapiSta->wapiMsk.micKey, 16); }else{ WAPI_TRACE(WAPI_INIT,"ASUE update msk \n"); pWapiSta->wapiMskUpdate.bSet = true; memcpy(pWapiSta->wapiMskUpdate.dataKey,data+10,16); memcpy(pWapiSta->wapiMskUpdate.micKey,data+26,16); pWapiSta->wapiMskUpdate.keyId = *(data+42); pWapiSta->wapiMskUpdate.bTxEnable = false; } } break; default: WAPI_TRACE(WAPI_ERR,"Unknown Flag \n"); break; } } } } WAPI_TRACE(WAPI_INIT, "<===========%s\n", __FUNCTION__); } void wapi_test_init(struct _adapter *padapter) { u8 keybuf[100]; u8 mac_addr[6]={0x00,0xe0,0x4c,0x72,0x04,0x70}; u8 UskDataKey[16]={0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f}; u8 UskMicKey[16]={0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f}; u8 UskId = 0; u8 MskDataKey[16]={0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f}; u8 MskMicKey[16]={0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f}; u8 MskId = 0; WAPI_TRACE(WAPI_INIT, "===========>%s\n", __FUNCTION__); //Enable Wapi WAPI_TRACE(WAPI_INIT, "%s: Enable wapi!!!!\n", __FUNCTION__); padapter->wapiInfo.bWapiEnable = true; padapter->pairwise_key_type = KEY_TYPE_SMS4; ieee->group_key_type = KEY_TYPE_SMS4; padapter->wapiInfo.extra_prefix_len = WAPI_EXT_LEN; padapter->wapiInfo.extra_postfix_len = SMS4_MIC_LEN; //set usk WAPI_TRACE(WAPI_INIT, "%s: Set USK!!!!\n", __FUNCTION__); memset(keybuf,0,100); keybuf[0] = 1; //set usk keybuf[1] = 1; //enable tx keybuf[2] = 1; //AE keybuf[3] = 0; //not update memcpy(keybuf+4,mac_addr,6); memcpy(keybuf+10,UskDataKey,16); memcpy(keybuf+26,UskMicKey,16); keybuf[42]=UskId; wapi_test_set_key(padapter, keybuf); memset(keybuf,0,100); keybuf[0] = 1; //set usk keybuf[1] = 1; //enable tx keybuf[2] = 0; //AE keybuf[3] = 0; //not update memcpy(keybuf+4,mac_addr,6); memcpy(keybuf+10,UskDataKey,16); memcpy(keybuf+26,UskMicKey,16); keybuf[42]=UskId; wapi_test_set_key(padapter, keybuf); //set msk WAPI_TRACE(WAPI_INIT, "%s: Set MSK!!!!\n", __FUNCTION__); memset(keybuf,0,100); keybuf[0] = 2; //set msk keybuf[1] = 1; //Enable TX keybuf[2] = 1; //AE keybuf[3] = 0; //not update memcpy(keybuf+4,mac_addr,6); memcpy(keybuf+10,MskDataKey,16); memcpy(keybuf+26,MskMicKey,16); keybuf[42] = MskId; wapi_test_set_key(padapter, keybuf); memset(keybuf,0,100); keybuf[0] = 2; //set msk keybuf[1] = 1; //Enable TX keybuf[2] = 0; //AE keybuf[3] = 0; //not update memcpy(keybuf+4,mac_addr,6); memcpy(keybuf+10,MskDataKey,16); memcpy(keybuf+26,MskMicKey,16); keybuf[42] = MskId; wapi_test_set_key(padapter, keybuf); WAPI_TRACE(WAPI_INIT, "<===========%s\n", __FUNCTION__); } #endif void rtw_wapi_get_iv(_adapter *padapter,u8 *pRA, u8*IV) { PWLAN_HEADER_WAPI_EXTENSION pWapiExt = NULL; PRT_WAPI_T pWapiInfo = &padapter->wapiInfo; bool bPNOverflow = false; bool bFindMatchPeer = false; PRT_WAPI_STA_INFO pWapiSta = NULL; pWapiExt = (PWLAN_HEADER_WAPI_EXTENSION)IV; WAPI_DATA(WAPI_RX,"wapi_get_iv: pra",pRA,6); if(IS_MCAST(pRA)){ if(!pWapiInfo->wapiTxMsk.bTxEnable){ WAPI_TRACE(WAPI_ERR,"%s: bTxEnable = 0!!\n",__FUNCTION__); return; } if(pWapiInfo->wapiTxMsk.keyId <= 1){ pWapiExt->KeyIdx = pWapiInfo->wapiTxMsk.keyId; pWapiExt->Reserved = 0; bPNOverflow = WapiIncreasePN(pWapiInfo->lastTxMulticastPN, 1); memcpy(pWapiExt->PN, pWapiInfo->lastTxMulticastPN, 16); } } else { if(list_empty(&pWapiInfo->wapiSTAUsedList)){ WAPI_TRACE(WAPI_RX,"rtw_wapi_get_iv: list is empty \n"); _rtw_memset(IV,10,18); return; } else{ list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list){ WAPI_DATA(WAPI_RX,"rtw_wapi_get_iv: peermacaddr ",pWapiSta->PeerMacAddr,6); if (_rtw_memcmp((u8*)pWapiSta->PeerMacAddr, pRA, 6) == _TRUE) { bFindMatchPeer = true; break; } } WAPI_TRACE(WAPI_RX,"bFindMatchPeer: %d \n",bFindMatchPeer); WAPI_DATA(WAPI_RX,"Addr",pRA,6); if (bFindMatchPeer){ if((!pWapiSta->wapiUskUpdate.bTxEnable) && (!pWapiSta->wapiUsk.bTxEnable)) return; if (pWapiSta->wapiUsk.keyId <= 1){ if(pWapiSta->wapiUskUpdate.bTxEnable) pWapiExt->KeyIdx = pWapiSta->wapiUskUpdate.keyId; else pWapiExt->KeyIdx = pWapiSta->wapiUsk.keyId; pWapiExt->Reserved = 0; bPNOverflow = WapiIncreasePN(pWapiSta->lastTxUnicastPN, 2); _rtw_memcpy(pWapiExt->PN, pWapiSta->lastTxUnicastPN, 16); } } } } } bool rtw_wapi_drop_for_key_absent(_adapter *padapter,u8 *pRA) { PRT_WAPI_T pWapiInfo = &padapter->wapiInfo; bool bFindMatchPeer = false; bool bDrop = false; PRT_WAPI_STA_INFO pWapiSta = NULL; struct security_priv *psecuritypriv = &padapter->securitypriv; WAPI_DATA(WAPI_RX,"rtw_wapi_drop_for_key_absent: ra ",pRA,6); if(psecuritypriv->dot11PrivacyAlgrthm == _SMS4_) { if ((!padapter->WapiSupport) || (!pWapiInfo->bWapiEnable)) return true; if(IS_MCAST(pRA)){ if(!pWapiInfo->wapiTxMsk.bTxEnable){ bDrop = true; WAPI_TRACE(WAPI_RX,"rtw_wapi_drop_for_key_absent: multicast key is absent \n"); return bDrop; } } else{ if(!list_empty(&pWapiInfo->wapiSTAUsedList)){ list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list){ WAPI_DATA(WAPI_RX,"rtw_wapi_drop_for_key_absent: pWapiSta->PeerMacAddr ",pWapiSta->PeerMacAddr,6); if (_rtw_memcmp(pRA, pWapiSta->PeerMacAddr, 6) == _TRUE){ bFindMatchPeer = true; break; } } if (bFindMatchPeer) { if (!pWapiSta->wapiUsk.bTxEnable){ bDrop = true; WAPI_TRACE(WAPI_RX,"rtw_wapi_drop_for_key_absent: unicast key is absent \n"); return bDrop; } } else{ bDrop = true; WAPI_TRACE(WAPI_RX,"rtw_wapi_drop_for_key_absent: no peer find \n"); return bDrop; } } else{ bDrop = true; WAPI_TRACE(WAPI_RX,"rtw_wapi_drop_for_key_absent: no sta exist \n"); return bDrop; } } } else { return bDrop; } return bDrop; } #endif
the_stack_data/55503.c
#include <stdio.h> int main() { int firstNumber, secondNumber, divisionoftwonumbers; printf("Enter a firstnumber:"); scanf("%d" , &firstNumber); printf("Enter a secondnumber:"); scanf("%d" , &secondNumber); divisionoftwonumbers = firstNumber / secondNumber; printf("divisionoftwonumbers: %d\n", divisionoftwonumbers); return 0; }
the_stack_data/134978.c
#include <stdio.h> void print_pun(void) { printf("To C, or not to C: that is the question.\n"); } int main(void) { print_pun(); return 0; }
the_stack_data/987193.c
// Add example of writing multiple device code using OpenMP 4.0 // /* change this to do saxpy or daxpy : single precision or double precision*/ #define REAL double #ifdef __cplusplus extern "C" { #endif /* both the omp version and ompacc version */ extern void axpy_omp(REAL* x, REAL* y, int n, REAL a); extern void axpy_ompacc(REAL* x, REAL* y, int n, REAL a); extern double read_timer(); /* in second */ extern double read_timer_ms(); /* in ms */ #ifdef __cplusplus } #endif /* standard one-dev support */ void axpy_ompacc(REAL* x, REAL* y, int n, REAL a) { int i; /* this one defines both the target device name and data environment to map to, I think here we need mechanism to tell the compiler the device type (could be multiple) so that compiler can generate the codes of different versions; we also need to let the runtime know what the target device is so the runtime will chose the right function to call if the code are generated #pragma omp target device (gpu0) map(x, y) */ #pragma omp target device (gpu0) map(tofrom: y[0:n]) map(to: x[0:n],a,n) #pragma omp parallel for shared(x, y, n, a) private(i) for (i = 0; i < n; ++i) y[i] += a * x[i]; } /* version 1: use omp parallel, i.e. each host thread responsible for one dev */ void axpy_mdev_v1(REAL* x, REAL* y, int n, REAL a) { int ndev = omp_get_num_devices(); /* standard omp call, see ticket 167 */ #pragma omp parallel num_threads(ndev) { int i; /* chunking it for each device */ int devid = omp_get_thread_num(); int remain = n % ndev; int esize = n / ndev; int partsize, starti, endi; if (devid < remain) { /* each of the first remain dev has one more element */ partsize = esize+1; starti = partsize*devid; } else { partsize = esize; starti = esize*devid+remain; } endi=starti + partsize; #pragma omp target device (devid) map(tofrom: y[starti:endi]) map(to: x[starti:endi],a,partsize) #pragma omp parallel for shared(x, y, partsize, a) private(i) for (i = 0; i < partsize; ++i) y[i] += a * x[i]; } }
the_stack_data/206392816.c
# 1 "/home/jenkins/workspace/RUI_Release/rui-v3/external/nRF5_SDK/nRF5_SDK_17.0.2_d674dde/external/segger_rtt/SEGGER_RTT_Syscalls_GCC.c" # 1 "/home/jenkins/workspace/RUI_Release/rui-v3//" # 1 "<built-in>" #define __STDC__ 1 #define __STDC_VERSION__ 199901L #define __STDC_HOSTED__ 1 #define __GNUC__ 10 #define __GNUC_MINOR__ 2 #define __GNUC_PATCHLEVEL__ 1 #define __VERSION__ "10.2.1 20201103 (release)" #define __ATOMIC_RELAXED 0 #define __ATOMIC_SEQ_CST 5 #define __ATOMIC_ACQUIRE 2 #define __ATOMIC_RELEASE 3 #define __ATOMIC_ACQ_REL 4 #define __ATOMIC_CONSUME 1 #define __OPTIMIZE_SIZE__ 1 #define __OPTIMIZE__ 1 #define __FINITE_MATH_ONLY__ 0 #define __SIZEOF_INT__ 4 #define __SIZEOF_LONG__ 4 #define __SIZEOF_LONG_LONG__ 8 #define __SIZEOF_SHORT__ 2 #define __SIZEOF_FLOAT__ 4 #define __SIZEOF_DOUBLE__ 8 #define __SIZEOF_LONG_DOUBLE__ 8 #define __SIZEOF_SIZE_T__ 4 #define __CHAR_BIT__ 8 #define __BIGGEST_ALIGNMENT__ 8 #define __ORDER_LITTLE_ENDIAN__ 1234 #define __ORDER_BIG_ENDIAN__ 4321 #define __ORDER_PDP_ENDIAN__ 3412 #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ #define __FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__ #define __SIZEOF_POINTER__ 4 #define __SIZE_TYPE__ unsigned int #define __PTRDIFF_TYPE__ int #define __WCHAR_TYPE__ unsigned int #define __WINT_TYPE__ unsigned int #define __INTMAX_TYPE__ long long int #define __UINTMAX_TYPE__ long long unsigned int #define __CHAR16_TYPE__ short unsigned int #define __CHAR32_TYPE__ long unsigned int #define __SIG_ATOMIC_TYPE__ int #define __INT8_TYPE__ signed char #define __INT16_TYPE__ short int #define __INT32_TYPE__ long int #define __INT64_TYPE__ long long int #define __UINT8_TYPE__ unsigned char #define __UINT16_TYPE__ short unsigned int #define __UINT32_TYPE__ long unsigned int #define __UINT64_TYPE__ long long unsigned int #define __INT_LEAST8_TYPE__ signed char #define __INT_LEAST16_TYPE__ short int #define __INT_LEAST32_TYPE__ long int #define __INT_LEAST64_TYPE__ long long int #define __UINT_LEAST8_TYPE__ unsigned char #define __UINT_LEAST16_TYPE__ short unsigned int #define __UINT_LEAST32_TYPE__ long unsigned int #define __UINT_LEAST64_TYPE__ long long unsigned int #define __INT_FAST8_TYPE__ int #define __INT_FAST16_TYPE__ int #define __INT_FAST32_TYPE__ int #define __INT_FAST64_TYPE__ long long int #define __UINT_FAST8_TYPE__ unsigned int #define __UINT_FAST16_TYPE__ unsigned int #define __UINT_FAST32_TYPE__ unsigned int #define __UINT_FAST64_TYPE__ long long unsigned int #define __INTPTR_TYPE__ int #define __UINTPTR_TYPE__ unsigned int #define __GXX_ABI_VERSION 1014 #define __SCHAR_MAX__ 0x7f #define __SHRT_MAX__ 0x7fff #define __INT_MAX__ 0x7fffffff #define __LONG_MAX__ 0x7fffffffL #define __LONG_LONG_MAX__ 0x7fffffffffffffffLL #define __WCHAR_MAX__ 0xffffffffU #define __WCHAR_MIN__ 0U #define __WINT_MAX__ 0xffffffffU #define __WINT_MIN__ 0U #define __PTRDIFF_MAX__ 0x7fffffff #define __SIZE_MAX__ 0xffffffffU #define __SCHAR_WIDTH__ 8 #define __SHRT_WIDTH__ 16 #define __INT_WIDTH__ 32 #define __LONG_WIDTH__ 32 #define __LONG_LONG_WIDTH__ 64 #define __WCHAR_WIDTH__ 32 #define __WINT_WIDTH__ 32 #define __PTRDIFF_WIDTH__ 32 #define __SIZE_WIDTH__ 32 #define __INTMAX_MAX__ 0x7fffffffffffffffLL #define __INTMAX_C(c) c ## LL #define __UINTMAX_MAX__ 0xffffffffffffffffULL #define __UINTMAX_C(c) c ## ULL #define __INTMAX_WIDTH__ 64 #define __SIG_ATOMIC_MAX__ 0x7fffffff #define __SIG_ATOMIC_MIN__ (-__SIG_ATOMIC_MAX__ - 1) #define __SIG_ATOMIC_WIDTH__ 32 #define __INT8_MAX__ 0x7f #define __INT16_MAX__ 0x7fff #define __INT32_MAX__ 0x7fffffffL #define __INT64_MAX__ 0x7fffffffffffffffLL #define __UINT8_MAX__ 0xff #define __UINT16_MAX__ 0xffff #define __UINT32_MAX__ 0xffffffffUL #define __UINT64_MAX__ 0xffffffffffffffffULL #define __INT_LEAST8_MAX__ 0x7f #define __INT8_C(c) c #define __INT_LEAST8_WIDTH__ 8 #define __INT_LEAST16_MAX__ 0x7fff #define __INT16_C(c) c #define __INT_LEAST16_WIDTH__ 16 #define __INT_LEAST32_MAX__ 0x7fffffffL #define __INT32_C(c) c ## L #define __INT_LEAST32_WIDTH__ 32 #define __INT_LEAST64_MAX__ 0x7fffffffffffffffLL #define __INT64_C(c) c ## LL #define __INT_LEAST64_WIDTH__ 64 #define __UINT_LEAST8_MAX__ 0xff #define __UINT8_C(c) c #define __UINT_LEAST16_MAX__ 0xffff #define __UINT16_C(c) c #define __UINT_LEAST32_MAX__ 0xffffffffUL #define __UINT32_C(c) c ## UL #define __UINT_LEAST64_MAX__ 0xffffffffffffffffULL #define __UINT64_C(c) c ## ULL #define __INT_FAST8_MAX__ 0x7fffffff #define __INT_FAST8_WIDTH__ 32 #define __INT_FAST16_MAX__ 0x7fffffff #define __INT_FAST16_WIDTH__ 32 #define __INT_FAST32_MAX__ 0x7fffffff #define __INT_FAST32_WIDTH__ 32 #define __INT_FAST64_MAX__ 0x7fffffffffffffffLL #define __INT_FAST64_WIDTH__ 64 #define __UINT_FAST8_MAX__ 0xffffffffU #define __UINT_FAST16_MAX__ 0xffffffffU #define __UINT_FAST32_MAX__ 0xffffffffU #define __UINT_FAST64_MAX__ 0xffffffffffffffffULL #define __INTPTR_MAX__ 0x7fffffff #define __INTPTR_WIDTH__ 32 #define __UINTPTR_MAX__ 0xffffffffU #define __GCC_IEC_559 0 #define __GCC_IEC_559_COMPLEX 0 #define __FLT_EVAL_METHOD__ 0 #define __FLT_EVAL_METHOD_TS_18661_3__ 0 #define __DEC_EVAL_METHOD__ 2 #define __FLT_RADIX__ 2 #define __FLT_MANT_DIG__ 24 #define __FLT_DIG__ 6 #define __FLT_MIN_EXP__ (-125) #define __FLT_MIN_10_EXP__ (-37) #define __FLT_MAX_EXP__ 128 #define __FLT_MAX_10_EXP__ 38 #define __FLT_DECIMAL_DIG__ 9 #define __FLT_MAX__ 3.4028234663852886e+38F #define __FLT_NORM_MAX__ 3.4028234663852886e+38F #define __FLT_MIN__ 1.1754943508222875e-38F #define __FLT_EPSILON__ 1.1920928955078125e-7F #define __FLT_DENORM_MIN__ 1.4012984643248171e-45F #define __FLT_HAS_DENORM__ 1 #define __FLT_HAS_INFINITY__ 1 #define __FLT_HAS_QUIET_NAN__ 1 #define __FP_FAST_FMAF 1 #define __DBL_MANT_DIG__ 53 #define __DBL_DIG__ 15 #define __DBL_MIN_EXP__ (-1021) #define __DBL_MIN_10_EXP__ (-307) #define __DBL_MAX_EXP__ 1024 #define __DBL_MAX_10_EXP__ 308 #define __DBL_DECIMAL_DIG__ 17 #define __DBL_MAX__ ((double)1.7976931348623157e+308L) #define __DBL_NORM_MAX__ ((double)1.7976931348623157e+308L) #define __DBL_MIN__ ((double)2.2250738585072014e-308L) #define __DBL_EPSILON__ ((double)2.2204460492503131e-16L) #define __DBL_DENORM_MIN__ ((double)4.9406564584124654e-324L) #define __DBL_HAS_DENORM__ 1 #define __DBL_HAS_INFINITY__ 1 #define __DBL_HAS_QUIET_NAN__ 1 #define __LDBL_MANT_DIG__ 53 #define __LDBL_DIG__ 15 #define __LDBL_MIN_EXP__ (-1021) #define __LDBL_MIN_10_EXP__ (-307) #define __LDBL_MAX_EXP__ 1024 #define __LDBL_MAX_10_EXP__ 308 #define __DECIMAL_DIG__ 17 #define __LDBL_DECIMAL_DIG__ 17 #define __LDBL_MAX__ 1.7976931348623157e+308L #define __LDBL_NORM_MAX__ 1.7976931348623157e+308L #define __LDBL_MIN__ 2.2250738585072014e-308L #define __LDBL_EPSILON__ 2.2204460492503131e-16L #define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L #define __LDBL_HAS_DENORM__ 1 #define __LDBL_HAS_INFINITY__ 1 #define __LDBL_HAS_QUIET_NAN__ 1 #define __FLT32_MANT_DIG__ 24 #define __FLT32_DIG__ 6 #define __FLT32_MIN_EXP__ (-125) #define __FLT32_MIN_10_EXP__ (-37) #define __FLT32_MAX_EXP__ 128 #define __FLT32_MAX_10_EXP__ 38 #define __FLT32_DECIMAL_DIG__ 9 #define __FLT32_MAX__ 3.4028234663852886e+38F32 #define __FLT32_NORM_MAX__ 3.4028234663852886e+38F32 #define __FLT32_MIN__ 1.1754943508222875e-38F32 #define __FLT32_EPSILON__ 1.1920928955078125e-7F32 #define __FLT32_DENORM_MIN__ 1.4012984643248171e-45F32 #define __FLT32_HAS_DENORM__ 1 #define __FLT32_HAS_INFINITY__ 1 #define __FLT32_HAS_QUIET_NAN__ 1 #define __FP_FAST_FMAF32 1 #define __FLT64_MANT_DIG__ 53 #define __FLT64_DIG__ 15 #define __FLT64_MIN_EXP__ (-1021) #define __FLT64_MIN_10_EXP__ (-307) #define __FLT64_MAX_EXP__ 1024 #define __FLT64_MAX_10_EXP__ 308 #define __FLT64_DECIMAL_DIG__ 17 #define __FLT64_MAX__ 1.7976931348623157e+308F64 #define __FLT64_NORM_MAX__ 1.7976931348623157e+308F64 #define __FLT64_MIN__ 2.2250738585072014e-308F64 #define __FLT64_EPSILON__ 2.2204460492503131e-16F64 #define __FLT64_DENORM_MIN__ 4.9406564584124654e-324F64 #define __FLT64_HAS_DENORM__ 1 #define __FLT64_HAS_INFINITY__ 1 #define __FLT64_HAS_QUIET_NAN__ 1 #define __FLT32X_MANT_DIG__ 53 #define __FLT32X_DIG__ 15 #define __FLT32X_MIN_EXP__ (-1021) #define __FLT32X_MIN_10_EXP__ (-307) #define __FLT32X_MAX_EXP__ 1024 #define __FLT32X_MAX_10_EXP__ 308 #define __FLT32X_DECIMAL_DIG__ 17 #define __FLT32X_MAX__ 1.7976931348623157e+308F32x #define __FLT32X_NORM_MAX__ 1.7976931348623157e+308F32x #define __FLT32X_MIN__ 2.2250738585072014e-308F32x #define __FLT32X_EPSILON__ 2.2204460492503131e-16F32x #define __FLT32X_DENORM_MIN__ 4.9406564584124654e-324F32x #define __FLT32X_HAS_DENORM__ 1 #define __FLT32X_HAS_INFINITY__ 1 #define __FLT32X_HAS_QUIET_NAN__ 1 #define __SFRACT_FBIT__ 7 #define __SFRACT_IBIT__ 0 #define __SFRACT_MIN__ (-0.5HR-0.5HR) #define __SFRACT_MAX__ 0X7FP-7HR #define __SFRACT_EPSILON__ 0x1P-7HR #define __USFRACT_FBIT__ 8 #define __USFRACT_IBIT__ 0 #define __USFRACT_MIN__ 0.0UHR #define __USFRACT_MAX__ 0XFFP-8UHR #define __USFRACT_EPSILON__ 0x1P-8UHR #define __FRACT_FBIT__ 15 #define __FRACT_IBIT__ 0 #define __FRACT_MIN__ (-0.5R-0.5R) #define __FRACT_MAX__ 0X7FFFP-15R #define __FRACT_EPSILON__ 0x1P-15R #define __UFRACT_FBIT__ 16 #define __UFRACT_IBIT__ 0 #define __UFRACT_MIN__ 0.0UR #define __UFRACT_MAX__ 0XFFFFP-16UR #define __UFRACT_EPSILON__ 0x1P-16UR #define __LFRACT_FBIT__ 31 #define __LFRACT_IBIT__ 0 #define __LFRACT_MIN__ (-0.5LR-0.5LR) #define __LFRACT_MAX__ 0X7FFFFFFFP-31LR #define __LFRACT_EPSILON__ 0x1P-31LR #define __ULFRACT_FBIT__ 32 #define __ULFRACT_IBIT__ 0 #define __ULFRACT_MIN__ 0.0ULR #define __ULFRACT_MAX__ 0XFFFFFFFFP-32ULR #define __ULFRACT_EPSILON__ 0x1P-32ULR #define __LLFRACT_FBIT__ 63 #define __LLFRACT_IBIT__ 0 #define __LLFRACT_MIN__ (-0.5LLR-0.5LLR) #define __LLFRACT_MAX__ 0X7FFFFFFFFFFFFFFFP-63LLR #define __LLFRACT_EPSILON__ 0x1P-63LLR #define __ULLFRACT_FBIT__ 64 #define __ULLFRACT_IBIT__ 0 #define __ULLFRACT_MIN__ 0.0ULLR #define __ULLFRACT_MAX__ 0XFFFFFFFFFFFFFFFFP-64ULLR #define __ULLFRACT_EPSILON__ 0x1P-64ULLR #define __SACCUM_FBIT__ 7 #define __SACCUM_IBIT__ 8 #define __SACCUM_MIN__ (-0X1P7HK-0X1P7HK) #define __SACCUM_MAX__ 0X7FFFP-7HK #define __SACCUM_EPSILON__ 0x1P-7HK #define __USACCUM_FBIT__ 8 #define __USACCUM_IBIT__ 8 #define __USACCUM_MIN__ 0.0UHK #define __USACCUM_MAX__ 0XFFFFP-8UHK #define __USACCUM_EPSILON__ 0x1P-8UHK #define __ACCUM_FBIT__ 15 #define __ACCUM_IBIT__ 16 #define __ACCUM_MIN__ (-0X1P15K-0X1P15K) #define __ACCUM_MAX__ 0X7FFFFFFFP-15K #define __ACCUM_EPSILON__ 0x1P-15K #define __UACCUM_FBIT__ 16 #define __UACCUM_IBIT__ 16 #define __UACCUM_MIN__ 0.0UK #define __UACCUM_MAX__ 0XFFFFFFFFP-16UK #define __UACCUM_EPSILON__ 0x1P-16UK #define __LACCUM_FBIT__ 31 #define __LACCUM_IBIT__ 32 #define __LACCUM_MIN__ (-0X1P31LK-0X1P31LK) #define __LACCUM_MAX__ 0X7FFFFFFFFFFFFFFFP-31LK #define __LACCUM_EPSILON__ 0x1P-31LK #define __ULACCUM_FBIT__ 32 #define __ULACCUM_IBIT__ 32 #define __ULACCUM_MIN__ 0.0ULK #define __ULACCUM_MAX__ 0XFFFFFFFFFFFFFFFFP-32ULK #define __ULACCUM_EPSILON__ 0x1P-32ULK #define __LLACCUM_FBIT__ 31 #define __LLACCUM_IBIT__ 32 #define __LLACCUM_MIN__ (-0X1P31LLK-0X1P31LLK) #define __LLACCUM_MAX__ 0X7FFFFFFFFFFFFFFFP-31LLK #define __LLACCUM_EPSILON__ 0x1P-31LLK #define __ULLACCUM_FBIT__ 32 #define __ULLACCUM_IBIT__ 32 #define __ULLACCUM_MIN__ 0.0ULLK #define __ULLACCUM_MAX__ 0XFFFFFFFFFFFFFFFFP-32ULLK #define __ULLACCUM_EPSILON__ 0x1P-32ULLK #define __QQ_FBIT__ 7 #define __QQ_IBIT__ 0 #define __HQ_FBIT__ 15 #define __HQ_IBIT__ 0 #define __SQ_FBIT__ 31 #define __SQ_IBIT__ 0 #define __DQ_FBIT__ 63 #define __DQ_IBIT__ 0 #define __TQ_FBIT__ 127 #define __TQ_IBIT__ 0 #define __UQQ_FBIT__ 8 #define __UQQ_IBIT__ 0 #define __UHQ_FBIT__ 16 #define __UHQ_IBIT__ 0 #define __USQ_FBIT__ 32 #define __USQ_IBIT__ 0 #define __UDQ_FBIT__ 64 #define __UDQ_IBIT__ 0 #define __UTQ_FBIT__ 128 #define __UTQ_IBIT__ 0 #define __HA_FBIT__ 7 #define __HA_IBIT__ 8 #define __SA_FBIT__ 15 #define __SA_IBIT__ 16 #define __DA_FBIT__ 31 #define __DA_IBIT__ 32 #define __TA_FBIT__ 63 #define __TA_IBIT__ 64 #define __UHA_FBIT__ 8 #define __UHA_IBIT__ 8 #define __USA_FBIT__ 16 #define __USA_IBIT__ 16 #define __UDA_FBIT__ 32 #define __UDA_IBIT__ 32 #define __UTA_FBIT__ 64 #define __UTA_IBIT__ 64 #define __REGISTER_PREFIX__ #define __USER_LABEL_PREFIX__ #define __GNUC_STDC_INLINE__ 1 #define __STRICT_ANSI__ 1 #define __CHAR_UNSIGNED__ 1 #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1 #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1 #define __GCC_ATOMIC_BOOL_LOCK_FREE 2 #define __GCC_ATOMIC_CHAR_LOCK_FREE 2 #define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2 #define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2 #define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2 #define __GCC_ATOMIC_SHORT_LOCK_FREE 2 #define __GCC_ATOMIC_INT_LOCK_FREE 2 #define __GCC_ATOMIC_LONG_LOCK_FREE 2 #define __GCC_ATOMIC_LLONG_LOCK_FREE 1 #define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1 #define __GCC_ATOMIC_POINTER_LOCK_FREE 2 #define __HAVE_SPECULATION_SAFE_VALUE 1 #define __GCC_HAVE_DWARF2_CFI_ASM 1 #define __PRAGMA_REDEFINE_EXTNAME 1 #define __SIZEOF_WCHAR_T__ 4 #define __SIZEOF_WINT_T__ 4 #define __SIZEOF_PTRDIFF_T__ 4 #define __ARM_FEATURE_DSP 1 #define __ARM_FEATURE_QBIT 1 #define __ARM_FEATURE_SAT 1 #undef __ARM_FEATURE_CRYPTO # 1 "<built-in>" #define __ARM_FEATURE_UNALIGNED 1 #undef __ARM_FEATURE_QRDMX # 1 "<built-in>" #undef __ARM_FEATURE_CRC32 # 1 "<built-in>" #undef __ARM_FEATURE_DOTPROD # 1 "<built-in>" #undef __ARM_FEATURE_COMPLEX # 1 "<built-in>" #define __ARM_32BIT_STATE 1 #undef __ARM_FEATURE_MVE # 1 "<built-in>" #undef __ARM_FEATURE_CMSE # 1 "<built-in>" #undef __ARM_FEATURE_LDREX # 1 "<built-in>" #define __ARM_FEATURE_LDREX 7 #define __ARM_FEATURE_CLZ 1 #undef __ARM_FEATURE_NUMERIC_MAXMIN # 1 "<built-in>" #define __ARM_FEATURE_SIMD32 1 #define __ARM_SIZEOF_MINIMAL_ENUM 1 #define __ARM_SIZEOF_WCHAR_T 4 #undef __ARM_ARCH_PROFILE # 1 "<built-in>" #define __ARM_ARCH_PROFILE 77 #define __arm__ 1 #undef __ARM_ARCH # 1 "<built-in>" #define __ARM_ARCH 7 #define __APCS_32__ 1 #define __GCC_ASM_FLAG_OUTPUTS__ 1 #define __thumb__ 1 #define __thumb2__ 1 #define __THUMBEL__ 1 #undef __ARM_ARCH_ISA_THUMB # 1 "<built-in>" #define __ARM_ARCH_ISA_THUMB 2 #define __ARMEL__ 1 #define __VFP_FP__ 1 #undef __ARM_FP # 1 "<built-in>" #define __ARM_FP 4 #undef __ARM_FP16_FORMAT_IEEE # 1 "<built-in>" #undef __ARM_FP16_FORMAT_ALTERNATIVE # 1 "<built-in>" #undef __ARM_FP16_ARGS # 1 "<built-in>" #undef __ARM_FEATURE_FP16_SCALAR_ARITHMETIC # 1 "<built-in>" #undef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC # 1 "<built-in>" #undef __ARM_FEATURE_FP16_FML # 1 "<built-in>" #define __ARM_FEATURE_FMA 1 #undef __ARM_NEON__ # 1 "<built-in>" #undef __ARM_NEON # 1 "<built-in>" #undef __ARM_NEON_FP # 1 "<built-in>" #define __THUMB_INTERWORK__ 1 #define __ARM_ARCH_7EM__ 1 #define __ARM_PCS_VFP 1 #define __ARM_EABI__ 1 #undef __FDPIC__ # 1 "<built-in>" #define __ARM_ARCH_EXT_IDIV__ 1 #define __ARM_FEATURE_IDIV 1 #define __ARM_ASM_SYNTAX_UNIFIED__ 1 #undef __ARM_FEATURE_COPROC # 1 "<built-in>" #define __ARM_FEATURE_COPROC 15 #undef __ARM_FEATURE_CDE # 1 "<built-in>" #undef __ARM_FEATURE_CDE_COPROC # 1 "<built-in>" #undef __ARM_FEATURE_MATMUL_INT8 # 1 "<built-in>" #undef __ARM_FEATURE_BF16_SCALAR_ARITHMETIC # 1 "<built-in>" #undef __ARM_FEATURE_BF16_VECTOR_ARITHMETIC # 1 "<built-in>" #undef __ARM_BF16_FORMAT_ALTERNATIVE # 1 "<built-in>" #define __GXX_TYPEINFO_EQUALITY_INLINE 0 #define __ELF__ 1 # 1 "<command-line>" #define __USES_INITFINI__ 1 #define nrf52840 1 #define SUPPORT_LORA 1 #define LORA_IO_SPI_PORT 2 #define SYS_RTC_COUNTER_PORT 2 #define ATCMD_CUST_TABLE_SIZE 64 #define WAN_TYPE 0 #define LORA_STACK_VER 0x040407 #define RAK4631_V2 .0+RAK5005-O_V1.0 1 #define rak4630 1 #define BATTERY_LEVEL_SUPPORT 1 #define BLE_CENTRAL_SUPPORT 1 #define WDT_SUPPORT 1 #define APP_TIMER_V2 1 #define APP_TIMER_V2_RTC1_ENABLED 1 #define BOARD_PCA10056 1 #define S140 1 #define CONFIG_GPIO_AS_PINRESET 1 #define FLOAT_ABI_HARD 1 #define NRF52840_XXAA 1 #define NRF_SD_BLE_API_VERSION 6 #define USER_UART 1 #define USBD_CDC 1 #define BLE_SUPPORT 1 #define DFU_SUPPORT 1 #define BL_SETTINGS_ACCESS_ONLY 1 #define NRF_DFU_SVCI_ENABLED 1 #define NRF_DFU_TRANSPORT_BLE 1 #define REGION_AS923 1 #define REGION_AU915 1 #define REGION_CN470 1 #define REGION_CN779 1 #define REGION_EU433 1 #define REGION_EU868 1 #define REGION_KR920 1 #define REGION_IN865 1 #define REGION_US915 1 #define REGION_RU864 1 #define SOFT_SE 1 #define SECURE_ELEMENT_PRE_PROVISIONED 1 #define LORAMAC_CLASSB_ENABLED 1 #define SOFTDEVICE_PRESENT 1 #define SWI_DISABLE0 1 #define __HEAP_SIZE 7168 #define __STACK_SIZE 7168 #define DEBUG 1 #define WISBLOCK_BASE_5005_O 1 #define SUPPORT_USB 1 #define SUPPORT_BLE 1 #define CONFIG_NFCT_PINS_AS_GPIOS 1 # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/external/nRF5_SDK/nRF5_SDK_17.0.2_d674dde/external/segger_rtt/SEGGER_RTT_Syscalls_GCC.c" # 66 "/home/jenkins/workspace/RUI_Release/rui-v3/external/nRF5_SDK/nRF5_SDK_17.0.2_d674dde/external/segger_rtt/SEGGER_RTT_Syscalls_GCC.c" # 1 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" 1 # 44 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define SDK_CONFIG_H # 63 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_BL_FW_COPY_PROGRESS_STORE_STEP 8 #define NRF_DFU_SETTINGS_VERSION 1 # 77 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define BSP_BTN_BLE_ENABLED 1 # 90 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define BLE_ADVERTISING_ENABLED 1 #define BLE_DB_DISCOVERY_ENABLED 1 #define BLE_DTM_ENABLED 0 #define NRF_RADIO_ANTENNA_PIN_1 21 #define NRF_RADIO_ANTENNA_PIN_2 23 #define NRF_RADIO_ANTENNA_PIN_3 26 #define NRF_RADIO_ANTENNA_PIN_4 27 #define NRF_RADIO_ANTENNA_PIN_5 28 #define NRF_RADIO_ANTENNA_PIN_6 29 #define NRF_RADIO_ANTENNA_PIN_7 30 #define NRF_RADIO_ANTENNA_PIN_8 31 #define NRF_RADIO_ANTENNA_COUNT 12 # 156 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define BLE_RACP_ENABLED 0 #define NRF_BLE_CONN_PARAMS_ENABLED 1 #define NRF_BLE_CONN_PARAMS_MAX_SLAVE_LATENCY_DEVIATION 499 #define NRF_BLE_CONN_PARAMS_MAX_SUPERVISION_TIMEOUT_DEVIATION 65535 # 184 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_BLE_GATT_ENABLED 1 #define NRF_BLE_GQ_ENABLED 1 #define NRF_BLE_GQ_DATAPOOL_ELEMENT_SIZE 20 #define NRF_BLE_GQ_DATAPOOL_ELEMENT_COUNT 8 #define NRF_BLE_GQ_GATTC_WRITE_MAX_DATA_LEN 16 #define NRF_BLE_GQ_GATTS_HVX_MAX_DATA_LEN 16 #define NRF_BLE_LESC_ENABLED 1 #define NRF_BLE_QWR_ENABLED 1 #define NRF_BLE_QWR_MAX_ATTR 0 #define NRF_BLE_SCAN_ENABLED 1 #define NRF_BLE_SCAN_BUFFER 255 #define NRF_BLE_SCAN_NAME_MAX_LEN 32 #define NRF_BLE_SCAN_SHORT_NAME_MAX_LEN 32 #define NRF_BLE_SCAN_SCAN_INTERVAL 160 #define NRF_BLE_SCAN_SCAN_DURATION 0 #define NRF_BLE_SCAN_SCAN_WINDOW 80 #define NRF_BLE_SCAN_MIN_CONNECTION_INTERVAL 7.5 #define NRF_BLE_SCAN_MAX_CONNECTION_INTERVAL 30 #define NRF_BLE_SCAN_SLAVE_LATENCY 0 #define NRF_BLE_SCAN_SUPERVISION_TIMEOUT 4000 # 295 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_BLE_SCAN_SCAN_PHY 1 #define NRF_BLE_SCAN_FILTER_ENABLE 1 #define NRF_BLE_SCAN_UUID_CNT 1 #define NRF_BLE_SCAN_NAME_CNT 1 #define NRF_BLE_SCAN_SHORT_NAME_CNT 0 #define NRF_BLE_SCAN_ADDRESS_CNT 1 #define NRF_BLE_SCAN_APPEARANCE_CNT 0 # 335 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define PEER_MANAGER_ENABLED 1 #define PM_MAX_REGISTRANTS 3 #define PM_FLASH_BUFFERS 4 # 355 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define PM_CENTRAL_ENABLED 1 # 365 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define PM_SERVICE_CHANGED_ENABLED 1 # 374 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define PM_PEER_RANKS_ENABLED 1 #define PM_LESC_ENABLED 1 #define PM_RA_PROTECTION_ENABLED 0 #define PM_RA_PROTECTION_TRACKED_PEERS_NUM 8 #define PM_RA_PROTECTION_MIN_WAIT_INTERVAL 4000 #define PM_RA_PROTECTION_MAX_WAIT_INTERVAL 64000 #define PM_RA_PROTECTION_REWARD_PERIOD 10000 # 418 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define PM_HANDLER_SEC_DELAY_MS 0 # 434 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define BLE_ANCS_C_ENABLED 0 #define BLE_ANS_C_ENABLED 0 #define BLE_BAS_C_ENABLED 0 #define BLE_BAS_ENABLED 1 #define BLE_BAS_CONFIG_LOG_ENABLED 0 # 470 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define BLE_BAS_CONFIG_LOG_LEVEL 4 # 486 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define BLE_BAS_CONFIG_INFO_COLOR 0 # 502 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define BLE_BAS_CONFIG_DEBUG_COLOR 0 # 513 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define BLE_CSCS_ENABLED 0 #define BLE_CTS_C_ENABLED 0 #define BLE_DIS_ENABLED 1 #define BLE_GLS_ENABLED 0 #define BLE_HIDS_ENABLED 1 #define BLE_HRS_C_ENABLED 0 #define BLE_HRS_ENABLED 0 #define BLE_HTS_ENABLED 0 #define BLE_IAS_C_ENABLED 0 #define BLE_IAS_ENABLED 0 #define BLE_IAS_CONFIG_LOG_ENABLED 0 # 591 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define BLE_IAS_CONFIG_LOG_LEVEL 3 # 607 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define BLE_IAS_CONFIG_INFO_COLOR 0 # 623 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define BLE_IAS_CONFIG_DEBUG_COLOR 0 # 634 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define BLE_LBS_C_ENABLED 0 #define BLE_LBS_ENABLED 0 #define BLE_LLS_ENABLED 0 #define BLE_NUS_C_ENABLED 1 #define BLE_NUS_ENABLED 1 #define BLE_NUS_CONFIG_LOG_ENABLED 0 # 677 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define BLE_NUS_CONFIG_LOG_LEVEL 3 # 693 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define BLE_NUS_CONFIG_INFO_COLOR 0 # 709 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define BLE_NUS_CONFIG_DEBUG_COLOR 0 # 720 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define BLE_RCS_C_ENABLED 1 #define BLE_RSCS_C_ENABLED 0 #define BLE_RSCS_ENABLED 0 #define BLE_TPS_ENABLED 0 # 753 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_MPU_ENABLED 0 #define NRF_MPU_CLI_CMDS 0 #define NRF_STACK_GUARD_ENABLED 0 # 781 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_STACK_GUARD_CONFIG_SIZE 7 # 795 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_ENABLED 1 # 808 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_ALLOCATOR 0 #define NRF_CRYPTO_BACKEND_CC310_BL_ENABLED 0 #define NRF_CRYPTO_BACKEND_CC310_BL_ECC_SECP224R1_ENABLED 0 #define NRF_CRYPTO_BACKEND_CC310_BL_ECC_SECP256R1_ENABLED 1 # 838 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_CC310_BL_HASH_SHA256_ENABLED 1 # 847 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_CC310_BL_HASH_LITTLE_ENDIAN_DIGEST_ENABLED 0 # 856 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_CC310_BL_HASH_AUTOMATIC_RAM_BUFFER_ENABLED 0 #define NRF_CRYPTO_BACKEND_CC310_BL_HASH_AUTOMATIC_RAM_BUFFER_SIZE 4096 # 872 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_CC310_BL_ECC_LITTLE_ENDIAN_ENABLED 0 # 881 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_CC310_BL_INTERRUPTS_ENABLED 1 # 890 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_CC310_ENABLED 1 #define NRF_CRYPTO_BACKEND_CC310_AES_CBC_ENABLED 1 #define NRF_CRYPTO_BACKEND_CC310_AES_CTR_ENABLED 1 #define NRF_CRYPTO_BACKEND_CC310_AES_ECB_ENABLED 1 #define NRF_CRYPTO_BACKEND_CC310_AES_CBC_MAC_ENABLED 1 #define NRF_CRYPTO_BACKEND_CC310_AES_CMAC_ENABLED 1 #define NRF_CRYPTO_BACKEND_CC310_AES_CCM_ENABLED 1 #define NRF_CRYPTO_BACKEND_CC310_AES_CCM_STAR_ENABLED 1 #define NRF_CRYPTO_BACKEND_CC310_CHACHA_POLY_ENABLED 1 #define NRF_CRYPTO_BACKEND_CC310_ECC_SECP160R1_ENABLED 1 #define NRF_CRYPTO_BACKEND_CC310_ECC_SECP160R2_ENABLED 1 #define NRF_CRYPTO_BACKEND_CC310_ECC_SECP192R1_ENABLED 1 #define NRF_CRYPTO_BACKEND_CC310_ECC_SECP224R1_ENABLED 1 #define NRF_CRYPTO_BACKEND_CC310_ECC_SECP256R1_ENABLED 1 #define NRF_CRYPTO_BACKEND_CC310_ECC_SECP384R1_ENABLED 1 #define NRF_CRYPTO_BACKEND_CC310_ECC_SECP521R1_ENABLED 1 #define NRF_CRYPTO_BACKEND_CC310_ECC_SECP160K1_ENABLED 1 #define NRF_CRYPTO_BACKEND_CC310_ECC_SECP192K1_ENABLED 1 #define NRF_CRYPTO_BACKEND_CC310_ECC_SECP224K1_ENABLED 1 #define NRF_CRYPTO_BACKEND_CC310_ECC_SECP256K1_ENABLED 1 #define NRF_CRYPTO_BACKEND_CC310_ECC_CURVE25519_ENABLED 1 #define NRF_CRYPTO_BACKEND_CC310_ECC_ED25519_ENABLED 1 # 1046 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_CC310_HASH_SHA256_ENABLED 1 # 1055 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_CC310_HASH_SHA512_ENABLED 1 # 1064 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_CC310_HMAC_SHA256_ENABLED 1 # 1073 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_CC310_HMAC_SHA512_ENABLED 1 #define NRF_CRYPTO_BACKEND_CC310_RNG_ENABLED 1 # 1090 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_CC310_INTERRUPTS_ENABLED 1 # 1100 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_CIFRA_ENABLED 0 #define NRF_CRYPTO_BACKEND_CIFRA_AES_EAX_ENABLED 1 #define NRF_CRYPTO_BACKEND_MBEDTLS_ENABLED 0 #define NRF_CRYPTO_BACKEND_MBEDTLS_AES_CBC_ENABLED 1 #define NRF_CRYPTO_BACKEND_MBEDTLS_AES_CTR_ENABLED 1 #define NRF_CRYPTO_BACKEND_MBEDTLS_AES_CFB_ENABLED 1 #define NRF_CRYPTO_BACKEND_MBEDTLS_AES_ECB_ENABLED 1 #define NRF_CRYPTO_BACKEND_MBEDTLS_AES_CBC_MAC_ENABLED 1 #define NRF_CRYPTO_BACKEND_MBEDTLS_AES_CMAC_ENABLED 1 #define NRF_CRYPTO_BACKEND_MBEDTLS_AES_CCM_ENABLED 1 #define NRF_CRYPTO_BACKEND_MBEDTLS_AES_GCM_ENABLED 1 # 1178 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP192R1_ENABLED 1 # 1187 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP224R1_ENABLED 1 # 1196 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP256R1_ENABLED 1 # 1205 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP384R1_ENABLED 1 # 1214 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP521R1_ENABLED 1 # 1223 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP192K1_ENABLED 1 # 1232 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP224K1_ENABLED 1 # 1241 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP256K1_ENABLED 1 # 1250 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP256R1_ENABLED 1 # 1259 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP384R1_ENABLED 1 # 1268 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP512R1_ENABLED 1 # 1277 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_CURVE25519_ENABLED 1 # 1286 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_MBEDTLS_HASH_SHA256_ENABLED 1 # 1295 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_MBEDTLS_HASH_SHA512_ENABLED 1 # 1304 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_MBEDTLS_HMAC_SHA256_ENABLED 1 # 1313 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_MBEDTLS_HMAC_SHA512_ENABLED 1 #define NRF_CRYPTO_BACKEND_MICRO_ECC_ENABLED 0 #define NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP192R1_ENABLED 1 # 1338 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP224R1_ENABLED 1 # 1347 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP256R1_ENABLED 1 # 1356 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP256K1_ENABLED 1 # 1367 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_NRF_HW_RNG_ENABLED 0 #define NRF_CRYPTO_BACKEND_NRF_HW_RNG_MBEDTLS_CTR_DRBG_ENABLED 1 # 1385 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_NRF_SW_ENABLED 0 #define NRF_CRYPTO_BACKEND_NRF_SW_HASH_SHA256_ENABLED 1 # 1402 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_OBERON_ENABLED 0 #define NRF_CRYPTO_BACKEND_OBERON_CHACHA_POLY_ENABLED 1 # 1417 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_OBERON_ECC_SECP256R1_ENABLED 1 # 1426 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_OBERON_ECC_CURVE25519_ENABLED 1 # 1435 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_OBERON_ECC_ED25519_ENABLED 1 # 1444 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_OBERON_HASH_SHA256_ENABLED 1 # 1453 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_OBERON_HASH_SHA512_ENABLED 1 # 1462 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_OBERON_HMAC_SHA256_ENABLED 1 # 1471 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_OBERON_HMAC_SHA512_ENABLED 1 # 1480 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_OPTIGA_ENABLED 0 #define NRF_CRYPTO_BACKEND_OPTIGA_RNG_ENABLED 0 # 1497 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_BACKEND_OPTIGA_ECC_SECP256R1_ENABLED 1 # 1508 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_CURVE25519_BIG_ENDIAN_ENABLED 0 # 1522 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_RNG_STATIC_MEMORY_BUFFERS_ENABLED 1 # 1531 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CRYPTO_RNG_AUTO_INIT_ENABLED 1 # 1551 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define BLE_DFU_ENABLED 1 #define NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS 0 # 1592 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define COMP_ENABLED 0 # 1603 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define COMP_CONFIG_REF 1 # 1612 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define COMP_CONFIG_MAIN_MODE 0 # 1622 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define COMP_CONFIG_SPEED_MODE 2 # 1631 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define COMP_CONFIG_HYST 0 # 1642 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define COMP_CONFIG_ISOURCE 0 # 1657 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define COMP_CONFIG_INPUT 0 # 1674 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define COMP_CONFIG_IRQ_PRIORITY 6 # 1683 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define EGU_ENABLED 0 #define GPIOTE_ENABLED 1 #define GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS 4 # 1710 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define GPIOTE_CONFIG_IRQ_PRIORITY 6 #define I2S_ENABLED 0 #define I2S_CONFIG_SCK_PIN 31 #define I2S_CONFIG_LRCK_PIN 30 #define I2S_CONFIG_MCK_PIN 255 #define I2S_CONFIG_SDOUT_PIN 29 #define I2S_CONFIG_SDIN_PIN 28 # 1759 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define I2S_CONFIG_MASTER 0 # 1768 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define I2S_CONFIG_FORMAT 0 # 1777 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define I2S_CONFIG_ALIGN 0 # 1787 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define I2S_CONFIG_SWIDTH 1 # 1797 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define I2S_CONFIG_CHANNELS 1 # 1823 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define I2S_CONFIG_MCK_SETUP 536870912 # 1839 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define I2S_CONFIG_RATIO 2000 # 1856 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define I2S_CONFIG_IRQ_PRIORITY 6 #define I2S_CONFIG_LOG_ENABLED 0 # 1873 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define I2S_CONFIG_LOG_LEVEL 3 # 1889 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define I2S_CONFIG_INFO_COLOR 0 # 1905 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define I2S_CONFIG_DEBUG_COLOR 0 # 1915 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define LPCOMP_ENABLED 0 # 1938 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define LPCOMP_CONFIG_REFERENCE 3 # 1948 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define LPCOMP_CONFIG_DETECTION 2 # 1963 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define LPCOMP_CONFIG_INPUT 0 #define LPCOMP_CONFIG_HYST 0 # 1987 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define LPCOMP_CONFIG_IRQ_PRIORITY 6 #define NRFX_CLOCK_ENABLED 1 # 2004 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_CLOCK_CONFIG_LF_SRC 1 # 2019 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_CLOCK_CONFIG_IRQ_PRIORITY 6 #define NRFX_CLOCK_CONFIG_LOG_ENABLED 0 # 2036 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_CLOCK_CONFIG_LOG_LEVEL 3 # 2052 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_CLOCK_CONFIG_INFO_COLOR 0 # 2068 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_CLOCK_CONFIG_DEBUG_COLOR 0 # 2078 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_COMP_ENABLED 0 # 2089 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_COMP_CONFIG_REF 1 # 2098 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_COMP_CONFIG_MAIN_MODE 0 # 2108 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_COMP_CONFIG_SPEED_MODE 2 # 2117 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_COMP_CONFIG_HYST 0 # 2128 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_COMP_CONFIG_ISOURCE 0 # 2143 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_COMP_CONFIG_INPUT 0 # 2158 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_COMP_CONFIG_IRQ_PRIORITY 6 #define NRFX_COMP_CONFIG_LOG_ENABLED 0 # 2175 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_COMP_CONFIG_LOG_LEVEL 3 # 2191 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_COMP_CONFIG_INFO_COLOR 0 # 2207 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_COMP_CONFIG_DEBUG_COLOR 0 # 2217 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_GPIOTE_ENABLED 1 #define NRFX_GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS 1 # 2236 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_GPIOTE_CONFIG_IRQ_PRIORITY 6 #define NRFX_GPIOTE_CONFIG_LOG_ENABLED 0 # 2253 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_GPIOTE_CONFIG_LOG_LEVEL 3 # 2269 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_GPIOTE_CONFIG_INFO_COLOR 0 # 2285 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_GPIOTE_CONFIG_DEBUG_COLOR 0 # 2295 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_I2S_ENABLED 0 #define NRFX_I2S_CONFIG_SCK_PIN 31 #define NRFX_I2S_CONFIG_LRCK_PIN 30 #define NRFX_I2S_CONFIG_MCK_PIN 255 #define NRFX_I2S_CONFIG_SDOUT_PIN 29 #define NRFX_I2S_CONFIG_SDIN_PIN 28 # 2336 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_I2S_CONFIG_MASTER 0 # 2345 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_I2S_CONFIG_FORMAT 0 # 2354 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_I2S_CONFIG_ALIGN 0 # 2364 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_I2S_CONFIG_SWIDTH 1 # 2374 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_I2S_CONFIG_CHANNELS 1 # 2400 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_I2S_CONFIG_MCK_SETUP 536870912 # 2416 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_I2S_CONFIG_RATIO 2000 # 2431 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_I2S_CONFIG_IRQ_PRIORITY 6 #define NRFX_I2S_CONFIG_LOG_ENABLED 0 # 2448 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_I2S_CONFIG_LOG_LEVEL 3 # 2464 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_I2S_CONFIG_INFO_COLOR 0 # 2480 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_I2S_CONFIG_DEBUG_COLOR 0 # 2490 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_LPCOMP_ENABLED 0 # 2513 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_LPCOMP_CONFIG_REFERENCE 3 # 2523 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_LPCOMP_CONFIG_DETECTION 2 # 2538 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_LPCOMP_CONFIG_INPUT 0 #define NRFX_LPCOMP_CONFIG_HYST 0 # 2560 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_LPCOMP_CONFIG_IRQ_PRIORITY 6 #define NRFX_LPCOMP_CONFIG_LOG_ENABLED 0 # 2577 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_LPCOMP_CONFIG_LOG_LEVEL 3 # 2593 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_LPCOMP_CONFIG_INFO_COLOR 0 # 2609 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_LPCOMP_CONFIG_DEBUG_COLOR 0 # 2619 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_NFCT_ENABLED 1 # 2633 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_NFCT_CONFIG_IRQ_PRIORITY 6 #define NRFX_NFCT_CONFIG_LOG_ENABLED 0 # 2650 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_NFCT_CONFIG_LOG_LEVEL 3 # 2666 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_NFCT_CONFIG_INFO_COLOR 0 # 2682 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_NFCT_CONFIG_DEBUG_COLOR 0 # 2692 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_PDM_ENABLED 0 #define NRFX_PDM_CONFIG_MODE 1 # 2709 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_PDM_CONFIG_EDGE 0 # 2719 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_PDM_CONFIG_CLOCK_FREQ 138412032 # 2734 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_PDM_CONFIG_IRQ_PRIORITY 6 #define NRFX_PDM_CONFIG_LOG_ENABLED 0 # 2751 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_PDM_CONFIG_LOG_LEVEL 3 # 2767 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_PDM_CONFIG_INFO_COLOR 0 # 2783 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_PDM_CONFIG_DEBUG_COLOR 0 # 2793 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_POWER_ENABLED 1 # 2807 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_POWER_CONFIG_IRQ_PRIORITY 6 # 2816 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_POWER_CONFIG_DEFAULT_DCDCEN 0 # 2825 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_POWER_CONFIG_DEFAULT_DCDCENHV 0 #define NRFX_PPI_ENABLED 0 #define NRFX_PPI_CONFIG_LOG_ENABLED 0 # 2849 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_PPI_CONFIG_LOG_LEVEL 3 # 2865 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_PPI_CONFIG_INFO_COLOR 0 # 2881 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_PPI_CONFIG_DEBUG_COLOR 0 # 2891 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_PRS_ENABLED 1 #define NRFX_PRS_BOX_0_ENABLED 0 #define NRFX_PRS_BOX_1_ENABLED 0 #define NRFX_PRS_BOX_2_ENABLED 0 #define NRFX_PRS_BOX_3_ENABLED 0 #define NRFX_PRS_BOX_4_ENABLED 1 #define NRFX_PRS_CONFIG_LOG_ENABLED 0 # 2942 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_PRS_CONFIG_LOG_LEVEL 3 # 2958 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_PRS_CONFIG_INFO_COLOR 0 # 2974 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_PRS_CONFIG_DEBUG_COLOR 0 # 2984 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_PWM_ENABLED 0 #define NRFX_PWM0_ENABLED 0 #define NRFX_PWM1_ENABLED 0 #define NRFX_PWM2_ENABLED 0 #define NRFX_PWM_DEFAULT_CONFIG_OUT0_PIN 31 #define NRFX_PWM_DEFAULT_CONFIG_OUT1_PIN 31 #define NRFX_PWM_DEFAULT_CONFIG_OUT2_PIN 31 #define NRFX_PWM_DEFAULT_CONFIG_OUT3_PIN 31 # 3047 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_PWM_DEFAULT_CONFIG_BASE_CLOCK 4 # 3056 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_PWM_DEFAULT_CONFIG_COUNT_MODE 0 #define NRFX_PWM_DEFAULT_CONFIG_TOP_VALUE 1000 # 3072 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_PWM_DEFAULT_CONFIG_LOAD_MODE 0 # 3081 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_PWM_DEFAULT_CONFIG_STEP_MODE 0 # 3096 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_PWM_DEFAULT_CONFIG_IRQ_PRIORITY 6 #define NRFX_PWM_CONFIG_LOG_ENABLED 0 # 3113 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_PWM_CONFIG_LOG_LEVEL 3 # 3129 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_PWM_CONFIG_INFO_COLOR 0 # 3145 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_PWM_CONFIG_DEBUG_COLOR 0 # 3161 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_PWM_NRF52_ANOMALY_109_WORKAROUND_ENABLED 0 # 3173 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_PWM_NRF52_ANOMALY_109_EGU_INSTANCE 5 # 3183 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_QDEC_ENABLED 0 # 3197 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_QDEC_CONFIG_REPORTPER 0 # 3212 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_QDEC_CONFIG_SAMPLEPER 7 #define NRFX_QDEC_CONFIG_PIO_A 31 #define NRFX_QDEC_CONFIG_PIO_B 31 #define NRFX_QDEC_CONFIG_PIO_LED 31 #define NRFX_QDEC_CONFIG_LEDPRE 511 # 3247 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_QDEC_CONFIG_LEDPOL 1 #define NRFX_QDEC_CONFIG_DBFEN 0 #define NRFX_QDEC_CONFIG_SAMPLE_INTEN 0 # 3276 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_QDEC_CONFIG_IRQ_PRIORITY 6 #define NRFX_QDEC_CONFIG_LOG_ENABLED 0 # 3293 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_QDEC_CONFIG_LOG_LEVEL 3 # 3309 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_QDEC_CONFIG_INFO_COLOR 0 # 3325 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_QDEC_CONFIG_DEBUG_COLOR 0 # 3335 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_QSPI_ENABLED 0 #define NRFX_QSPI_CONFIG_SCK_DELAY 1 #define NRFX_QSPI_CONFIG_XIP_OFFSET 0 # 3358 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_QSPI_CONFIG_READOC 0 # 3369 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_QSPI_CONFIG_WRITEOC 0 # 3378 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_QSPI_CONFIG_ADDRMODE 0 # 3387 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_QSPI_CONFIG_MODE 0 # 3410 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_QSPI_CONFIG_FREQUENCY 15 #define NRFX_QSPI_PIN_SCK NRF_QSPI_PIN_NOT_CONNECTED #define NRFX_QSPI_PIN_CSN NRF_QSPI_PIN_NOT_CONNECTED #define NRFX_QSPI_PIN_IO0 NRF_QSPI_PIN_NOT_CONNECTED #define NRFX_QSPI_PIN_IO1 NRF_QSPI_PIN_NOT_CONNECTED #define NRFX_QSPI_PIN_IO2 NRF_QSPI_PIN_NOT_CONNECTED #define NRFX_QSPI_PIN_IO3 NRF_QSPI_PIN_NOT_CONNECTED # 3455 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_QSPI_CONFIG_IRQ_PRIORITY 6 #define NRFX_RNG_ENABLED 1 #define NRFX_RNG_CONFIG_ERROR_CORRECTION 1 # 3484 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_RNG_CONFIG_IRQ_PRIORITY 6 #define NRFX_RNG_CONFIG_LOG_ENABLED 0 # 3501 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_RNG_CONFIG_LOG_LEVEL 3 # 3517 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_RNG_CONFIG_INFO_COLOR 0 # 3533 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_RNG_CONFIG_DEBUG_COLOR 0 # 3543 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_RTC_ENABLED 0 #define NRFX_RTC0_ENABLED 0 #define NRFX_RTC1_ENABLED 0 #define NRFX_RTC2_ENABLED 0 #define NRFX_RTC_MAXIMUM_LATENCY_US 2000 #define NRFX_RTC_DEFAULT_CONFIG_FREQUENCY 32768 #define NRFX_RTC_DEFAULT_CONFIG_RELIABLE 0 # 3597 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_RTC_DEFAULT_CONFIG_IRQ_PRIORITY 6 #define NRFX_RTC_CONFIG_LOG_ENABLED 0 # 3614 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_RTC_CONFIG_LOG_LEVEL 3 # 3630 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_RTC_CONFIG_INFO_COLOR 0 # 3646 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_RTC_CONFIG_DEBUG_COLOR 0 # 3656 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_SAADC_ENABLED 1 # 3666 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_SAADC_CONFIG_RESOLUTION 1 # 3682 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_SAADC_CONFIG_OVERSAMPLE 0 #define NRFX_SAADC_CONFIG_LP_MODE 0 # 3704 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_SAADC_CONFIG_IRQ_PRIORITY 6 #define NRFX_SAADC_CONFIG_LOG_ENABLED 0 # 3721 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_SAADC_CONFIG_LOG_LEVEL 3 # 3737 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_SAADC_CONFIG_INFO_COLOR 0 # 3753 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_SAADC_CONFIG_DEBUG_COLOR 0 # 3763 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_SPIM_ENABLED 1 #define NRFX_SPIM0_ENABLED 0 #define NRFX_SPIM1_ENABLED 0 #define NRFX_SPIM2_ENABLED 1 #define NRFX_SPIM3_ENABLED 1 #define SPI3_ENABLED 1 #define NRFX_SPIM_EXTENDED_ENABLED 1 #define NRFX_SPIM3_NRF52840_ANOMALY_198_WORKAROUND_ENABLED 0 # 3801 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_SPIM_MISO_PULL_CFG 1 # 3816 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY 6 #define NRFX_SPIM_CONFIG_LOG_ENABLED 0 # 3833 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_SPIM_CONFIG_LOG_LEVEL 3 # 3849 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_SPIM_CONFIG_INFO_COLOR 0 # 3865 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_SPIM_CONFIG_DEBUG_COLOR 0 # 3881 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_SPIM_NRF52_ANOMALY_109_WORKAROUND_ENABLED 0 #define NRFX_SPIS_ENABLED 0 #define NRFX_SPIS0_ENABLED 0 #define NRFX_SPIS1_ENABLED 0 #define NRFX_SPIS2_ENABLED 0 # 3924 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_SPIS_DEFAULT_CONFIG_IRQ_PRIORITY 6 #define NRFX_SPIS_DEFAULT_DEF 255 #define NRFX_SPIS_DEFAULT_ORC 255 #define NRFX_SPIS_CONFIG_LOG_ENABLED 0 # 3955 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_SPIS_CONFIG_LOG_LEVEL 3 # 3971 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_SPIS_CONFIG_INFO_COLOR 0 # 3987 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_SPIS_CONFIG_DEBUG_COLOR 0 # 4003 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_SPIS_NRF52_ANOMALY_109_WORKAROUND_ENABLED 0 #define NRFX_SPI_ENABLED 1 #define NRFX_SPI0_ENABLED 0 #define NRFX_SPI1_ENABLED 0 #define NRFX_SPI2_ENABLED 1 # 4041 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_SPI_MISO_PULL_CFG 1 # 4056 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_SPI_DEFAULT_CONFIG_IRQ_PRIORITY 6 #define NRFX_SPI_CONFIG_LOG_ENABLED 0 # 4073 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_SPI_CONFIG_LOG_LEVEL 3 # 4089 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_SPI_CONFIG_INFO_COLOR 0 # 4105 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_SPI_CONFIG_DEBUG_COLOR 0 # 4115 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_SWI_ENABLED 0 #define NRFX_EGU_ENABLED 0 #define NRFX_SWI0_DISABLED 0 #define NRFX_SWI1_DISABLED 0 #define NRFX_SWI2_DISABLED 0 #define NRFX_SWI3_DISABLED 0 #define NRFX_SWI4_DISABLED 0 #define NRFX_SWI5_DISABLED 0 #define NRFX_SWI_CONFIG_LOG_ENABLED 0 # 4180 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_SWI_CONFIG_LOG_LEVEL 3 # 4196 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_SWI_CONFIG_INFO_COLOR 0 # 4212 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_SWI_CONFIG_DEBUG_COLOR 0 # 4222 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_TIMER_ENABLED 1 #define NRFX_TIMER0_ENABLED 0 #define NRFX_TIMER1_ENABLED 0 #define NRFX_TIMER2_ENABLED 0 #define NRFX_TIMER3_ENABLED 0 #define NRFX_TIMER4_ENABLED 1 #define TIMER4_ENABLED 1 # 4278 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_TIMER_DEFAULT_CONFIG_FREQUENCY 0 # 4287 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_TIMER_DEFAULT_CONFIG_MODE 0 # 4298 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_TIMER_DEFAULT_CONFIG_BIT_WIDTH 0 # 4313 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY 6 #define NRFX_TIMER_CONFIG_LOG_ENABLED 0 # 4330 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_TIMER_CONFIG_LOG_LEVEL 3 # 4346 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_TIMER_CONFIG_INFO_COLOR 0 # 4362 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_TIMER_CONFIG_DEBUG_COLOR 0 # 4372 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_TWIM_ENABLED 1 #define NRFX_TWIM0_ENABLED 1 #define NRFX_TWIM1_ENABLED 1 # 4395 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_TWIM_DEFAULT_CONFIG_FREQUENCY 26738688 #define NRFX_TWIM_DEFAULT_CONFIG_HOLD_BUS_UNINIT 0 # 4417 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY 6 #define NRFX_TWIM_CONFIG_LOG_ENABLED 0 # 4434 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_TWIM_CONFIG_LOG_LEVEL 3 # 4450 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_TWIM_CONFIG_INFO_COLOR 0 # 4466 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_TWIM_CONFIG_DEBUG_COLOR 0 # 4481 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_TWIM_NRF52_ANOMALY_109_WORKAROUND_ENABLED 0 #define NRFX_TWIS_ENABLED 0 #define NRFX_TWIS0_ENABLED 0 #define NRFX_TWIS1_ENABLED 0 # 4511 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_TWIS_ASSUME_INIT_AFTER_RESET_ONLY 0 # 4520 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_TWIS_NO_SYNC_MODE 0 #define NRFX_TWIS_DEFAULT_CONFIG_ADDR0 0 #define NRFX_TWIS_DEFAULT_CONFIG_ADDR1 0 # 4540 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_TWIS_DEFAULT_CONFIG_SCL_PULL 0 # 4550 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_TWIS_DEFAULT_CONFIG_SDA_PULL 0 # 4565 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_TWIS_DEFAULT_CONFIG_IRQ_PRIORITY 6 #define NRFX_TWIS_CONFIG_LOG_ENABLED 0 # 4582 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_TWIS_CONFIG_LOG_LEVEL 3 # 4598 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_TWIS_CONFIG_INFO_COLOR 0 # 4614 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_TWIS_CONFIG_DEBUG_COLOR 0 # 4624 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_TWI_ENABLED 1 #define NRFX_TWI0_ENABLED 0 #define NRFX_TWI1_ENABLED 0 # 4647 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_TWI_DEFAULT_CONFIG_FREQUENCY 26738688 #define NRFX_TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT 0 # 4669 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_TWI_DEFAULT_CONFIG_IRQ_PRIORITY 6 #define NRFX_TWI_CONFIG_LOG_ENABLED 0 # 4686 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_TWI_CONFIG_LOG_LEVEL 3 # 4702 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_TWI_CONFIG_INFO_COLOR 0 # 4718 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_TWI_CONFIG_DEBUG_COLOR 0 # 4728 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_UARTE_ENABLED 1 #define NRFX_UARTE0_ENABLED 1 #define NRFX_UARTE1_ENABLED 1 # 4746 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_UARTE_DEFAULT_CONFIG_HWFC 0 # 4755 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_UARTE_DEFAULT_CONFIG_PARITY 0 # 4780 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_UARTE_DEFAULT_CONFIG_BAUDRATE 30801920 # 4795 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY 6 #define NRFX_UARTE_CONFIG_LOG_ENABLED 0 # 4812 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_UARTE_CONFIG_LOG_LEVEL 3 # 4828 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_UARTE_CONFIG_INFO_COLOR 0 # 4844 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_UARTE_CONFIG_DEBUG_COLOR 0 # 4854 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_UART_ENABLED 1 #define NRFX_UART0_ENABLED 0 # 4867 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_UART_DEFAULT_CONFIG_HWFC 0 # 4876 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_UART_DEFAULT_CONFIG_PARITY 0 # 4901 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_UART_DEFAULT_CONFIG_BAUDRATE 30924800 # 4916 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_UART_DEFAULT_CONFIG_IRQ_PRIORITY 6 #define NRFX_UART_CONFIG_LOG_ENABLED 0 # 4933 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_UART_CONFIG_LOG_LEVEL 3 # 4949 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_UART_CONFIG_INFO_COLOR 0 # 4965 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_UART_CONFIG_DEBUG_COLOR 0 # 4975 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_USBD_ENABLED 1 # 4989 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_USBD_CONFIG_IRQ_PRIORITY 3 # 4998 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_USBD_CONFIG_DMASCHEDULER_MODE 0 # 5011 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_USBD_CONFIG_DMASCHEDULER_ISO_BOOST 1 # 5021 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_USBD_CONFIG_ISO_IN_ZLP 0 # 5032 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_USBD_USE_WORKAROUND_FOR_ANOMALY_211 0 #define NRFX_WDT_ENABLED 0 # 5050 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_WDT_CONFIG_BEHAVIOUR 1 #define NRFX_WDT_CONFIG_RELOAD_VALUE 2000 # 5072 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_WDT_CONFIG_IRQ_PRIORITY 6 #define NRFX_WDT_CONFIG_LOG_ENABLED 0 # 5089 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_WDT_CONFIG_LOG_LEVEL 3 # 5105 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_WDT_CONFIG_INFO_COLOR 0 # 5121 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_WDT_CONFIG_DEBUG_COLOR 0 # 5131 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CLOCK_ENABLED 1 # 5142 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define CLOCK_CONFIG_LF_SRC 1 #define CLOCK_CONFIG_LF_CAL_ENABLED 0 # 5166 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define CLOCK_CONFIG_IRQ_PRIORITY 6 #define PDM_ENABLED 0 #define PDM_CONFIG_MODE 1 # 5191 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define PDM_CONFIG_EDGE 0 # 5201 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define PDM_CONFIG_CLOCK_FREQ 138412032 # 5218 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define PDM_CONFIG_IRQ_PRIORITY 6 #define POWER_ENABLED 1 # 5242 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define POWER_CONFIG_IRQ_PRIORITY 6 # 5251 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define POWER_CONFIG_DEFAULT_DCDCEN 1 # 5260 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define POWER_CONFIG_DEFAULT_DCDCENHV 0 # 5269 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define PPI_ENABLED 1 #define PWM_ENABLED 0 #define PWM_DEFAULT_CONFIG_OUT0_PIN 31 #define PWM_DEFAULT_CONFIG_OUT1_PIN 31 #define PWM_DEFAULT_CONFIG_OUT2_PIN 31 #define PWM_DEFAULT_CONFIG_OUT3_PIN 31 # 5317 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define PWM_DEFAULT_CONFIG_BASE_CLOCK 4 # 5326 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define PWM_DEFAULT_CONFIG_COUNT_MODE 0 #define PWM_DEFAULT_CONFIG_TOP_VALUE 1000 # 5342 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define PWM_DEFAULT_CONFIG_LOAD_MODE 0 # 5351 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define PWM_DEFAULT_CONFIG_STEP_MODE 0 # 5368 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define PWM_DEFAULT_CONFIG_IRQ_PRIORITY 6 #define PWM0_ENABLED 0 #define PWM1_ENABLED 0 #define PWM2_ENABLED 0 # 5403 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define PWM_NRF52_ANOMALY_109_WORKAROUND_ENABLED 0 # 5415 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define PWM_NRF52_ANOMALY_109_EGU_INSTANCE 5 # 5425 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define QDEC_ENABLED 0 # 5439 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define QDEC_CONFIG_REPORTPER 0 # 5454 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define QDEC_CONFIG_SAMPLEPER 7 #define QDEC_CONFIG_PIO_A 31 #define QDEC_CONFIG_PIO_B 31 #define QDEC_CONFIG_PIO_LED 31 #define QDEC_CONFIG_LEDPRE 511 # 5489 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define QDEC_CONFIG_LEDPOL 1 #define QDEC_CONFIG_DBFEN 0 #define QDEC_CONFIG_SAMPLE_INTEN 0 # 5520 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define QDEC_CONFIG_IRQ_PRIORITY 6 #define QSPI_ENABLED 0 #define QSPI_CONFIG_SCK_DELAY 1 #define QSPI_CONFIG_XIP_OFFSET 0 # 5551 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define QSPI_CONFIG_READOC 0 # 5562 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define QSPI_CONFIG_WRITEOC 0 # 5571 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define QSPI_CONFIG_ADDRMODE 0 # 5580 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define QSPI_CONFIG_MODE 0 # 5603 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define QSPI_CONFIG_FREQUENCY 15 #define QSPI_PIN_SCK NRF_QSPI_PIN_NOT_CONNECTED #define QSPI_PIN_CSN NRF_QSPI_PIN_NOT_CONNECTED #define QSPI_PIN_IO0 NRF_QSPI_PIN_NOT_CONNECTED #define QSPI_PIN_IO1 NRF_QSPI_PIN_NOT_CONNECTED #define QSPI_PIN_IO2 NRF_QSPI_PIN_NOT_CONNECTED #define QSPI_PIN_IO3 NRF_QSPI_PIN_NOT_CONNECTED # 5650 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define QSPI_CONFIG_IRQ_PRIORITY 6 #define RNG_ENABLED 1 #define RNG_CONFIG_ERROR_CORRECTION 1 #define RNG_CONFIG_POOL_SIZE 64 # 5686 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define RNG_CONFIG_IRQ_PRIORITY 6 #define RTC_ENABLED 1 #define RTC_DEFAULT_CONFIG_FREQUENCY 32768 #define RTC_DEFAULT_CONFIG_RELIABLE 0 # 5724 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define RTC_DEFAULT_CONFIG_IRQ_PRIORITY 6 #define RTC0_ENABLED 0 #define RTC1_ENABLED 0 #define RTC2_ENABLED 1 #define NRF_MAXIMUM_LATENCY_US 2000 #define SAADC_ENABLED 1 # 5768 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define SAADC_CONFIG_RESOLUTION 1 # 5784 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define SAADC_CONFIG_OVERSAMPLE 0 #define SAADC_CONFIG_LP_MODE 0 # 5808 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define SAADC_CONFIG_IRQ_PRIORITY 6 #define SPIS_ENABLED 0 # 5832 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define SPIS_DEFAULT_CONFIG_IRQ_PRIORITY 6 # 5843 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define SPIS_DEFAULT_MODE 0 # 5852 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define SPIS_DEFAULT_BIT_ORDER 0 #define SPIS_DEFAULT_DEF 255 #define SPIS_DEFAULT_ORC 255 #define SPIS0_ENABLED 0 #define SPIS1_ENABLED 0 #define SPIS2_ENABLED 0 # 5901 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define SPIS_NRF52_ANOMALY_109_WORKAROUND_ENABLED 0 #define SPI_ENABLED 1 # 5925 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define SPI_DEFAULT_CONFIG_IRQ_PRIORITY 6 # 5935 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_SPI_DRV_MISO_PULLUP_CFG 1 #define SPI0_ENABLED 0 #define SPI0_USE_EASY_DMA 0 #define SPI1_ENABLED 0 #define SPI1_USE_EASY_DMA 0 #define SPI2_ENABLED 1 #define SPI2_USE_EASY_DMA 0 # 5991 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define SPIM_NRF52_ANOMALY_109_WORKAROUND_ENABLED 0 #define TIMER_ENABLED 1 # 6015 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define TIMER_DEFAULT_CONFIG_FREQUENCY 0 # 6024 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define TIMER_DEFAULT_CONFIG_MODE 0 # 6035 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define TIMER_DEFAULT_CONFIG_BIT_WIDTH 0 # 6052 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define TIMER_DEFAULT_CONFIG_IRQ_PRIORITY 6 #define TIMER0_ENABLED 0 #define TIMER1_ENABLED 1 #define TIMER2_ENABLED 1 #define TIMER3_ENABLED 1 # 6095 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define TWIS_ENABLED 0 #define TWIS0_ENABLED 0 #define TWIS1_ENABLED 0 # 6117 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define TWIS_ASSUME_INIT_AFTER_RESET_ONLY 0 # 6126 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define TWIS_NO_SYNC_MODE 0 #define TWIS_DEFAULT_CONFIG_ADDR0 0 #define TWIS_DEFAULT_CONFIG_ADDR1 0 # 6146 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define TWIS_DEFAULT_CONFIG_SCL_PULL 0 # 6156 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define TWIS_DEFAULT_CONFIG_SDA_PULL 0 # 6173 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define TWIS_DEFAULT_CONFIG_IRQ_PRIORITY 6 #define TWI_ENABLED 1 # 6190 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define TWI_DEFAULT_CONFIG_FREQUENCY 26738688 #define TWI_DEFAULT_CONFIG_CLR_BUS_INIT 0 #define TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT 0 # 6221 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define TWI_DEFAULT_CONFIG_IRQ_PRIORITY 6 #define TWI0_ENABLED 1 #define TWI0_USE_EASY_DMA 0 #define TWI1_ENABLED 0 #define TWI1_USE_EASY_DMA 0 # 6262 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define TWIM_NRF52_ANOMALY_109_WORKAROUND_ENABLED 0 #define UART_ENABLED 1 #define UART_DEFAULT_CONFIG_HWFC 0 # 6287 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define UART_DEFAULT_CONFIG_PARITY 0 # 6310 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define UART_DEFAULT_CONFIG_BAUDRATE 30801920 # 6327 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define UART_DEFAULT_CONFIG_IRQ_PRIORITY 6 #define UART_EASY_DMA_SUPPORT 1 #define UART_LEGACY_SUPPORT 1 #define UART0_ENABLED 1 #define UART0_CONFIG_USE_EASY_DMA 0 #define UART1_ENABLED 1 # 6370 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define USBD_ENABLED 1 # 6386 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define USBD_CONFIG_IRQ_PRIORITY 2 # 6395 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define USBD_CONFIG_DMASCHEDULER_MODE 0 # 6408 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define USBD_CONFIG_DMASCHEDULER_ISO_BOOST 1 # 6419 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define USBD_CONFIG_ISO_IN_ZLP 0 #define WDT_ENABLED 1 # 6437 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define WDT_CONFIG_BEHAVIOUR 9 #define WDT_CONFIG_RELOAD_VALUE 100000 # 6461 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define WDT_CONFIG_IRQ_PRIORITY 6 # 6482 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_TWI_SENSOR_ENABLED 0 # 6495 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_FIFO_ENABLED 1 #define APP_GPIOTE_ENABLED 0 #define APP_PWM_ENABLED 1 #define APP_SCHEDULER_ENABLED 1 #define APP_SCHEDULER_WITH_PAUSE 0 #define APP_SCHEDULER_WITH_PROFILER 0 #define APP_SDCARD_ENABLED 0 # 6545 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_SDCARD_SPI_INSTANCE 0 # 6559 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_SDCARD_FREQ_INIT 67108864 # 6573 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_SDCARD_FREQ_DATA 1073741824 #define APP_TIMER_ENABLED 1 # 6593 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_TIMER_CONFIG_RTC_FREQUENCY 0 # 6610 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_TIMER_CONFIG_IRQ_PRIORITY 6 # 6620 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_TIMER_CONFIG_OP_QUEUE_SIZE 50 #define APP_TIMER_CONFIG_USE_SCHEDULER 0 # 6637 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_TIMER_KEEPS_RTC_ACTIVE 0 # 6648 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_TIMER_SAFE_WINDOW_MS 300000 # 6658 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_TIMER_WITH_PROFILER 0 #define APP_TIMER_CONFIG_SWI_NUMBER 0 # 6676 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_UART_ENABLED 1 #define APP_UART_DRIVER_INSTANCE 1 # 6696 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_AUDIO_ENABLED 0 #define APP_USBD_ENABLED 1 # 6711 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_VID 0x1915 # 6721 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_PID 0x521F # 6730 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_DEVICE_VER_MAJOR 1 # 6739 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_DEVICE_VER_MINOR 0 # 6748 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_DEVICE_VER_SUB 0 #define APP_USBD_CONFIG_SELF_POWERED 1 #define APP_USBD_CONFIG_MAX_POWER 100 # 6771 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_CONFIG_POWER_EVENTS_PROCESS 1 # 6782 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_CONFIG_EVENT_QUEUE_ENABLE 0 #define APP_USBD_CONFIG_EVENT_QUEUE_SIZE 32 # 6805 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_CONFIG_SOF_HANDLING_MODE 2 # 6820 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_CONFIG_SOF_TIMESTAMP_PROVIDE 0 # 6830 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_CONFIG_DESC_STRING_SIZE 31 # 6839 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_CONFIG_DESC_STRING_UTF_ENABLED 0 #define APP_USBD_STRINGS_LANGIDS APP_USBD_LANG_AND_SUBLANG(APP_USBD_LANG_ENGLISH, APP_USBD_SUBLANG_ENGLISH_US) #define APP_USBD_STRING_ID_MANUFACTURER 1 #define APP_USBD_STRINGS_MANUFACTURER_EXTERN 0 # 6875 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_STRINGS_MANUFACTURER APP_USBD_STRING_DESC("Nordic Semiconductor") # 6885 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_STRING_ID_PRODUCT 2 #define APP_USBD_STRINGS_PRODUCT_EXTERN 0 #define APP_USBD_STRINGS_PRODUCT APP_USBD_STRING_DESC("Rak4631 Serial COM") # 6909 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_STRING_ID_SERIAL 3 #define APP_USBD_STRING_SERIAL_EXTERN 1 #define APP_USBD_STRING_SERIAL g_extern_serial_number # 6933 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_STRING_ID_CONFIGURATION 4 #define APP_USBD_STRING_CONFIGURATION_EXTERN 0 #define APP_USBD_STRINGS_CONFIGURATION APP_USBD_STRING_DESC("Default configuration") # 6968 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_STRINGS_USER X(APP_USER_1, , APP_USBD_STRING_DESC("User 1")) #define APP_USBD_HID_ENABLED 0 #define APP_USBD_HID_DEFAULT_IDLE_RATE 0 # 6993 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_HID_REPORT_IDLE_TABLE_SIZE 4 # 7002 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_HID_GENERIC_ENABLED 0 #define APP_USBD_HID_KBD_ENABLED 0 #define APP_USBD_HID_MOUSE_ENABLED 0 #define APP_USBD_MSC_ENABLED 0 #define CRC16_ENABLED 0 #define CRC32_ENABLED 1 #define ECC_ENABLED 0 #define FDS_ENABLED 1 # 7062 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define FDS_VIRTUAL_PAGES 3 # 7075 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define FDS_VIRTUAL_PAGE_SIZE 1024 # 7084 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define FDS_VIRTUAL_PAGES_RESERVED 4 # 7103 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define FDS_BACKEND 2 # 7116 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define FDS_OP_QUEUE_SIZE 4 # 7132 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define FDS_CRC_CHECK_ON_READ 0 # 7143 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define FDS_CRC_CHECK_ON_WRITE 0 # 7156 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define FDS_MAX_USERS 4 # 7167 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define HARDFAULT_HANDLER_ENABLED 1 # 7181 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define HARDFAULT_HANDLER_GDB_PSP_BACKTRACE 1 #define HCI_MEM_POOL_ENABLED 0 #define HCI_TX_BUF_SIZE 600 #define HCI_RX_BUF_SIZE 600 #define HCI_RX_BUF_QUEUE_SIZE 4 #define HCI_SLIP_ENABLED 0 # 7233 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define HCI_UART_BAUDRATE 30801920 # 7242 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define HCI_UART_FLOW_CONTROL 0 #define HCI_UART_RX_PIN 8 #define HCI_UART_TX_PIN 6 #define HCI_UART_RTS_PIN 5 #define HCI_UART_CTS_PIN 7 #define HCI_TRANSPORT_ENABLED 0 #define HCI_MAX_PACKET_SIZE_IN_BITS 8000 # 7283 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define LED_SOFTBLINK_ENABLED 0 #define LOW_POWER_PWM_ENABLED 0 #define MEM_MANAGER_ENABLED 0 #define MEMORY_MANAGER_SMALL_BLOCK_COUNT 1 #define MEMORY_MANAGER_SMALL_BLOCK_SIZE 32 #define MEMORY_MANAGER_MEDIUM_BLOCK_COUNT 0 #define MEMORY_MANAGER_MEDIUM_BLOCK_SIZE 256 #define MEMORY_MANAGER_LARGE_BLOCK_COUNT 0 #define MEMORY_MANAGER_LARGE_BLOCK_SIZE 256 #define MEMORY_MANAGER_XLARGE_BLOCK_COUNT 0 #define MEMORY_MANAGER_XLARGE_BLOCK_SIZE 1320 #define MEMORY_MANAGER_XXLARGE_BLOCK_COUNT 0 #define MEMORY_MANAGER_XXLARGE_BLOCK_SIZE 3444 #define MEMORY_MANAGER_XSMALL_BLOCK_COUNT 0 #define MEMORY_MANAGER_XSMALL_BLOCK_SIZE 64 #define MEMORY_MANAGER_XXSMALL_BLOCK_COUNT 0 #define MEMORY_MANAGER_XXSMALL_BLOCK_SIZE 32 #define MEM_MANAGER_CONFIG_LOG_ENABLED 0 # 7410 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define MEM_MANAGER_CONFIG_LOG_LEVEL 3 # 7426 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define MEM_MANAGER_CONFIG_INFO_COLOR 0 # 7442 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define MEM_MANAGER_CONFIG_DEBUG_COLOR 0 # 7451 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define MEM_MANAGER_DISABLE_API_PARAM_CHECK 0 #define NRF_BALLOC_ENABLED 1 #define NRF_BALLOC_CONFIG_DEBUG_ENABLED 0 #define NRF_BALLOC_CONFIG_HEAD_GUARD_WORDS 1 #define NRF_BALLOC_CONFIG_TAIL_GUARD_WORDS 1 #define NRF_BALLOC_CONFIG_BASIC_CHECKS_ENABLED 0 #define NRF_BALLOC_CONFIG_DOUBLE_FREE_CHECK_ENABLED 0 #define NRF_BALLOC_CONFIG_DATA_TRASHING_CHECK_ENABLED 0 #define NRF_BALLOC_CLI_CMDS 0 # 7515 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CSENSE_ENABLED 0 #define NRF_CSENSE_PAD_HYSTERESIS 15 #define NRF_CSENSE_PAD_DEVIATION 70 #define NRF_CSENSE_MIN_PAD_VALUE 20 #define NRF_CSENSE_MAX_PADS_NUMBER 20 #define NRF_CSENSE_MAX_VALUE 1000 #define NRF_CSENSE_OUTPUT_PIN 26 #define NRF_DRV_CSENSE_ENABLED 0 #define USE_COMP 0 #define TIMER0_FOR_CSENSE 1 #define TIMER1_FOR_CSENSE 2 # 7579 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define MEASUREMENT_PERIOD 20 # 7590 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_FPRINTF_ENABLED 1 #define NRF_QUEUE_ENABLED 1 #define NRF_QUEUE_CLI_CMDS 0 # 7611 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_SERIAL_ENABLED 1 #define NRF_FSTORAGE_ENABLED 1 # 7631 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_FSTORAGE_PARAM_CHECK_DISABLED 0 # 7645 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_FSTORAGE_SD_QUEUE_SIZE 4 #define NRF_FSTORAGE_SD_MAX_RETRIES 8 # 7663 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_FSTORAGE_SD_MAX_WRITE_SIZE 4096 # 7675 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_GFX_ENABLED 0 #define NRF_MEMOBJ_ENABLED 1 #define NRF_PWR_MGMT_ENABLED 1 #define NRF_PWR_MGMT_CONFIG_DEBUG_PIN_ENABLED 0 # 7734 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_PWR_MGMT_SLEEP_DEBUG_PIN 31 # 7745 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_PWR_MGMT_CONFIG_CPU_USAGE_MONITOR_ENABLED 0 #define NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_ENABLED 0 #define NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_S 3 # 7766 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_PWR_MGMT_CONFIG_FPU_SUPPORT_ENABLED 1 #define NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY 1 #define NRF_PWR_MGMT_CONFIG_USE_SCHEDULER 0 #define NRF_PWR_MGMT_CONFIG_HANDLER_PRIORITY_COUNT 3 # 7810 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_SECTION_ITER_ENABLED 1 #define NRF_SORTLIST_ENABLED 1 #define NRF_SPI_MNGR_ENABLED 0 #define NRF_STRERROR_ENABLED 1 #define NRF_TWI_MNGR_ENABLED 0 #define RETARGET_ENABLED 1 #define SLIP_ENABLED 0 #define TASK_MANAGER_ENABLED 0 #define TASK_MANAGER_CLI_CMDS 0 #define TASK_MANAGER_CONFIG_MAX_TASKS 2 #define TASK_MANAGER_CONFIG_STACK_SIZE 1024 #define TASK_MANAGER_CONFIG_STACK_PROFILER_ENABLED 1 # 7894 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define TASK_MANAGER_CONFIG_STACK_GUARD 7 # 7906 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define BUTTON_ENABLED 1 #define BUTTON_HIGH_ACCURACY_ENABLED 0 # 7926 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_CDC_ACM_ENABLED 1 # 7936 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_CDC_ACM_ZLP_ON_EPSIZE_WRITE 1 # 7949 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CLI_ENABLED 0 #define NRF_CLI_ARGC_MAX 12 #define NRF_CLI_BUILD_IN_CMDS_ENABLED 1 #define NRF_CLI_CMD_BUFF_SIZE 128 #define NRF_CLI_ECHO_STATUS 1 #define NRF_CLI_WILDCARD_ENABLED 0 #define NRF_CLI_PRINTF_BUFF_SIZE 23 #define NRF_CLI_HISTORY_ENABLED 1 #define NRF_CLI_HISTORY_ELEMENT_SIZE 32 #define NRF_CLI_HISTORY_ELEMENT_COUNT 8 # 8009 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CLI_VT100_COLORS_ENABLED 1 #define NRF_CLI_STATISTICS_ENABLED 1 #define NRF_CLI_LOG_BACKEND 1 #define NRF_CLI_USES_TASK_MANAGER_ENABLED 0 #define NRF_LOG_BACKEND_UART_ENABLED 0 #define NRF_LOG_BACKEND_UART_TX_PIN 29 # 8064 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_LOG_BACKEND_UART_BAUDRATE 30801920 # 8074 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_LOG_BACKEND_UART_TEMP_BUFFER_SIZE 256 # 8089 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_LOG_BACKEND_RTT_ENABLED 1 # 8099 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_LOG_BACKEND_RTT_TEMP_BUFFER_SIZE 128 #define NRF_LOG_BACKEND_RTT_TX_RETRY_DELAY_MS 1 # 8115 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_LOG_BACKEND_RTT_TX_RETRY_CNT 3 # 8124 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_LOG_STR_FORMATTER_TIMESTAMP_FORMAT_ENABLED 1 # 8134 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_LOG_ENABLED 1 #define NRF_LOG_USES_COLORS 1 # 8155 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_LOG_COLOR_DEFAULT 3 # 8171 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_LOG_ERROR_COLOR 2 # 8187 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_LOG_WARNING_COLOR 7 # 8201 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_LOG_DEFAULT_LEVEL 4 # 8210 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_LOG_DEFERRED 0 # 8228 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_LOG_BUFSIZE 1024 # 8242 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_LOG_STR_PUSH_BUFFER_SIZE 128 # 8251 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_LOG_ALLOW_OVERFLOW 1 #define NRF_LOG_USES_TIMESTAMP 0 #define NRF_LOG_TIMESTAMP_DEFAULT_FREQUENCY 0 # 8272 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_LOG_FILTERS_ENABLED 0 #define NRF_LOG_CLI_CMDS 0 # 8292 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_LOG_MSGPOOL_ELEMENT_SIZE 20 # 8302 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_LOG_MSGPOOL_ELEMENT_COUNT 8 # 8319 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_MPU_CONFIG_LOG_ENABLED 0 # 8330 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_MPU_CONFIG_LOG_LEVEL 3 # 8346 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_MPU_CONFIG_INFO_COLOR 0 # 8362 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_MPU_CONFIG_DEBUG_COLOR 0 #define NRF_STACK_GUARD_CONFIG_LOG_ENABLED 0 # 8381 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_STACK_GUARD_CONFIG_LOG_LEVEL 3 # 8397 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_STACK_GUARD_CONFIG_INFO_COLOR 0 # 8413 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_STACK_GUARD_CONFIG_DEBUG_COLOR 0 #define TASK_MANAGER_CONFIG_LOG_ENABLED 0 # 8432 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define TASK_MANAGER_CONFIG_LOG_LEVEL 3 # 8448 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define TASK_MANAGER_CONFIG_INFO_COLOR 0 # 8464 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define TASK_MANAGER_CONFIG_DEBUG_COLOR 0 # 8478 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define CLOCK_CONFIG_LOG_ENABLED 0 # 8489 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define CLOCK_CONFIG_LOG_LEVEL 3 # 8505 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define CLOCK_CONFIG_INFO_COLOR 0 # 8521 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define CLOCK_CONFIG_DEBUG_COLOR 0 #define COMP_CONFIG_LOG_ENABLED 0 # 8540 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define COMP_CONFIG_LOG_LEVEL 3 # 8556 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define COMP_CONFIG_INFO_COLOR 0 # 8572 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define COMP_CONFIG_DEBUG_COLOR 0 #define GPIOTE_CONFIG_LOG_ENABLED 0 # 8591 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define GPIOTE_CONFIG_LOG_LEVEL 3 # 8607 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define GPIOTE_CONFIG_INFO_COLOR 0 # 8623 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define GPIOTE_CONFIG_DEBUG_COLOR 0 #define LPCOMP_CONFIG_LOG_ENABLED 0 # 8642 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define LPCOMP_CONFIG_LOG_LEVEL 3 # 8658 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define LPCOMP_CONFIG_INFO_COLOR 0 # 8674 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define LPCOMP_CONFIG_DEBUG_COLOR 0 #define MAX3421E_HOST_CONFIG_LOG_ENABLED 0 # 8693 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define MAX3421E_HOST_CONFIG_LOG_LEVEL 3 # 8709 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define MAX3421E_HOST_CONFIG_INFO_COLOR 0 # 8725 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define MAX3421E_HOST_CONFIG_DEBUG_COLOR 0 #define NRFX_USBD_CONFIG_LOG_ENABLED 0 # 8744 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_USBD_CONFIG_LOG_LEVEL 3 # 8760 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_USBD_CONFIG_INFO_COLOR 0 # 8776 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRFX_USBD_CONFIG_DEBUG_COLOR 0 #define PDM_CONFIG_LOG_ENABLED 0 # 8795 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define PDM_CONFIG_LOG_LEVEL 3 # 8811 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define PDM_CONFIG_INFO_COLOR 0 # 8827 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define PDM_CONFIG_DEBUG_COLOR 0 #define PPI_CONFIG_LOG_ENABLED 0 # 8846 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define PPI_CONFIG_LOG_LEVEL 3 # 8862 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define PPI_CONFIG_INFO_COLOR 0 # 8878 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define PPI_CONFIG_DEBUG_COLOR 0 #define PWM_CONFIG_LOG_ENABLED 0 # 8897 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define PWM_CONFIG_LOG_LEVEL 3 # 8913 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define PWM_CONFIG_INFO_COLOR 0 # 8929 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define PWM_CONFIG_DEBUG_COLOR 0 #define QDEC_CONFIG_LOG_ENABLED 0 # 8948 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define QDEC_CONFIG_LOG_LEVEL 3 # 8964 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define QDEC_CONFIG_INFO_COLOR 0 # 8980 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define QDEC_CONFIG_DEBUG_COLOR 0 #define RNG_CONFIG_LOG_ENABLED 0 # 8999 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define RNG_CONFIG_LOG_LEVEL 3 # 9015 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define RNG_CONFIG_INFO_COLOR 0 # 9031 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define RNG_CONFIG_DEBUG_COLOR 0 #define RNG_CONFIG_RANDOM_NUMBER_LOG_ENABLED 0 #define RTC_CONFIG_LOG_ENABLED 0 # 9057 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define RTC_CONFIG_LOG_LEVEL 3 # 9073 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define RTC_CONFIG_INFO_COLOR 0 # 9089 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define RTC_CONFIG_DEBUG_COLOR 0 #define SAADC_CONFIG_LOG_ENABLED 0 # 9108 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define SAADC_CONFIG_LOG_LEVEL 3 # 9124 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define SAADC_CONFIG_INFO_COLOR 0 # 9140 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define SAADC_CONFIG_DEBUG_COLOR 0 #define SPIS_CONFIG_LOG_ENABLED 0 # 9159 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define SPIS_CONFIG_LOG_LEVEL 3 # 9175 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define SPIS_CONFIG_INFO_COLOR 0 # 9191 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define SPIS_CONFIG_DEBUG_COLOR 0 #define SPI_CONFIG_LOG_ENABLED 0 # 9210 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define SPI_CONFIG_LOG_LEVEL 3 # 9226 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define SPI_CONFIG_INFO_COLOR 0 # 9242 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define SPI_CONFIG_DEBUG_COLOR 0 #define TIMER_CONFIG_LOG_ENABLED 0 # 9261 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define TIMER_CONFIG_LOG_LEVEL 3 # 9277 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define TIMER_CONFIG_INFO_COLOR 0 # 9293 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define TIMER_CONFIG_DEBUG_COLOR 0 #define TWIS_CONFIG_LOG_ENABLED 0 # 9312 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define TWIS_CONFIG_LOG_LEVEL 3 # 9328 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define TWIS_CONFIG_INFO_COLOR 0 # 9344 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define TWIS_CONFIG_DEBUG_COLOR 0 #define TWI_CONFIG_LOG_ENABLED 0 # 9363 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define TWI_CONFIG_LOG_LEVEL 3 # 9379 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define TWI_CONFIG_INFO_COLOR 0 # 9395 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define TWI_CONFIG_DEBUG_COLOR 0 #define UART_CONFIG_LOG_ENABLED 0 # 9414 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define UART_CONFIG_LOG_LEVEL 3 # 9430 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define UART_CONFIG_INFO_COLOR 0 # 9446 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define UART_CONFIG_DEBUG_COLOR 0 #define USBD_CONFIG_LOG_ENABLED 0 # 9465 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define USBD_CONFIG_LOG_LEVEL 3 # 9481 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define USBD_CONFIG_INFO_COLOR 0 # 9497 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define USBD_CONFIG_DEBUG_COLOR 0 #define WDT_CONFIG_LOG_ENABLED 0 # 9516 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define WDT_CONFIG_LOG_LEVEL 3 # 9532 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define WDT_CONFIG_INFO_COLOR 0 # 9548 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define WDT_CONFIG_DEBUG_COLOR 0 # 9562 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_TIMER_CONFIG_LOG_ENABLED 0 # 9573 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_TIMER_CONFIG_LOG_LEVEL 3 # 9589 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_TIMER_CONFIG_INITIAL_LOG_LEVEL 3 # 9605 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_TIMER_CONFIG_INFO_COLOR 0 # 9621 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_TIMER_CONFIG_DEBUG_COLOR 0 #define APP_USBD_CDC_ACM_CONFIG_LOG_ENABLED 0 # 9640 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_CDC_ACM_CONFIG_LOG_LEVEL 3 # 9656 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_CDC_ACM_CONFIG_INFO_COLOR 0 # 9672 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_CDC_ACM_CONFIG_DEBUG_COLOR 0 #define APP_USBD_CONFIG_LOG_ENABLED 0 # 9691 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_CONFIG_LOG_LEVEL 3 # 9707 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_CONFIG_INFO_COLOR 0 # 9723 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_CONFIG_DEBUG_COLOR 0 #define APP_USBD_DUMMY_CONFIG_LOG_ENABLED 0 # 9742 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_DUMMY_CONFIG_LOG_LEVEL 3 # 9758 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_DUMMY_CONFIG_INFO_COLOR 0 # 9774 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_DUMMY_CONFIG_DEBUG_COLOR 0 #define APP_USBD_MSC_CONFIG_LOG_ENABLED 0 # 9793 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_MSC_CONFIG_LOG_LEVEL 3 # 9809 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_MSC_CONFIG_INFO_COLOR 0 # 9825 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_MSC_CONFIG_DEBUG_COLOR 0 #define APP_USBD_NRF_DFU_TRIGGER_CONFIG_LOG_ENABLED 0 # 9844 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_NRF_DFU_TRIGGER_CONFIG_LOG_LEVEL 3 # 9860 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_NRF_DFU_TRIGGER_CONFIG_INFO_COLOR 0 # 9876 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define APP_USBD_NRF_DFU_TRIGGER_CONFIG_DEBUG_COLOR 0 #define NRF_ATFIFO_CONFIG_LOG_ENABLED 0 # 9895 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_ATFIFO_CONFIG_LOG_LEVEL 3 # 9907 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_ATFIFO_CONFIG_LOG_INIT_FILTER_LEVEL 3 # 9923 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_ATFIFO_CONFIG_INFO_COLOR 0 # 9939 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_ATFIFO_CONFIG_DEBUG_COLOR 0 #define NRF_BALLOC_CONFIG_LOG_ENABLED 0 # 9958 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_BALLOC_CONFIG_LOG_LEVEL 3 # 9974 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_BALLOC_CONFIG_INITIAL_LOG_LEVEL 3 # 9990 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_BALLOC_CONFIG_INFO_COLOR 0 # 10006 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_BALLOC_CONFIG_DEBUG_COLOR 0 #define NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_ENABLED 0 # 10025 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_LEVEL 3 # 10037 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_INIT_FILTER_LEVEL 3 # 10053 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_BLOCK_DEV_EMPTY_CONFIG_INFO_COLOR 0 # 10069 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_BLOCK_DEV_EMPTY_CONFIG_DEBUG_COLOR 0 #define NRF_BLOCK_DEV_QSPI_CONFIG_LOG_ENABLED 0 # 10088 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_BLOCK_DEV_QSPI_CONFIG_LOG_LEVEL 3 # 10100 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_BLOCK_DEV_QSPI_CONFIG_LOG_INIT_FILTER_LEVEL 3 # 10116 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_BLOCK_DEV_QSPI_CONFIG_INFO_COLOR 0 # 10132 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_BLOCK_DEV_QSPI_CONFIG_DEBUG_COLOR 0 #define NRF_BLOCK_DEV_RAM_CONFIG_LOG_ENABLED 0 # 10151 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_BLOCK_DEV_RAM_CONFIG_LOG_LEVEL 3 # 10163 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_BLOCK_DEV_RAM_CONFIG_LOG_INIT_FILTER_LEVEL 3 # 10179 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_BLOCK_DEV_RAM_CONFIG_INFO_COLOR 0 # 10195 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_BLOCK_DEV_RAM_CONFIG_DEBUG_COLOR 0 #define NRF_CLI_BLE_UART_CONFIG_LOG_ENABLED 0 # 10214 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CLI_BLE_UART_CONFIG_LOG_LEVEL 3 # 10230 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CLI_BLE_UART_CONFIG_INFO_COLOR 0 # 10246 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CLI_BLE_UART_CONFIG_DEBUG_COLOR 0 #define NRF_CLI_LIBUARTE_CONFIG_LOG_ENABLED 0 # 10265 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CLI_LIBUARTE_CONFIG_LOG_LEVEL 3 # 10281 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CLI_LIBUARTE_CONFIG_INFO_COLOR 0 # 10297 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CLI_LIBUARTE_CONFIG_DEBUG_COLOR 0 #define NRF_CLI_UART_CONFIG_LOG_ENABLED 0 # 10316 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CLI_UART_CONFIG_LOG_LEVEL 3 # 10332 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CLI_UART_CONFIG_INFO_COLOR 0 # 10348 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_CLI_UART_CONFIG_DEBUG_COLOR 0 #define NRF_LIBUARTE_CONFIG_LOG_ENABLED 0 # 10367 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_LIBUARTE_CONFIG_LOG_LEVEL 3 # 10383 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_LIBUARTE_CONFIG_INFO_COLOR 0 # 10399 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_LIBUARTE_CONFIG_DEBUG_COLOR 0 #define NRF_MEMOBJ_CONFIG_LOG_ENABLED 0 # 10418 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_MEMOBJ_CONFIG_LOG_LEVEL 3 # 10434 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_MEMOBJ_CONFIG_INFO_COLOR 0 # 10450 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_MEMOBJ_CONFIG_DEBUG_COLOR 0 #define NRF_PWR_MGMT_CONFIG_LOG_ENABLED 0 # 10469 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_PWR_MGMT_CONFIG_LOG_LEVEL 3 # 10485 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_PWR_MGMT_CONFIG_INFO_COLOR 0 # 10501 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_PWR_MGMT_CONFIG_DEBUG_COLOR 0 #define NRF_QUEUE_CONFIG_LOG_ENABLED 0 # 10520 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_QUEUE_CONFIG_LOG_LEVEL 3 # 10532 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_QUEUE_CONFIG_LOG_INIT_FILTER_LEVEL 3 # 10548 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_QUEUE_CONFIG_INFO_COLOR 0 # 10564 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_QUEUE_CONFIG_DEBUG_COLOR 0 #define NRF_SDH_ANT_LOG_ENABLED 0 # 10583 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_SDH_ANT_LOG_LEVEL 3 # 10599 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_SDH_ANT_INFO_COLOR 0 # 10615 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_SDH_ANT_DEBUG_COLOR 0 #define NRF_SDH_BLE_LOG_ENABLED 1 # 10634 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_SDH_BLE_LOG_LEVEL 3 # 10650 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_SDH_BLE_INFO_COLOR 0 # 10666 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_SDH_BLE_DEBUG_COLOR 0 #define NRF_SDH_LOG_ENABLED 1 # 10685 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_SDH_LOG_LEVEL 3 # 10701 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_SDH_INFO_COLOR 0 # 10717 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_SDH_DEBUG_COLOR 0 #define NRF_SDH_SOC_LOG_ENABLED 1 # 10736 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_SDH_SOC_LOG_LEVEL 3 # 10752 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_SDH_SOC_INFO_COLOR 0 # 10768 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_SDH_SOC_DEBUG_COLOR 0 #define NRF_SORTLIST_CONFIG_LOG_ENABLED 0 # 10787 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_SORTLIST_CONFIG_LOG_LEVEL 3 # 10803 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_SORTLIST_CONFIG_INFO_COLOR 0 # 10819 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_SORTLIST_CONFIG_DEBUG_COLOR 0 #define NRF_TWI_SENSOR_CONFIG_LOG_ENABLED 0 # 10838 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_TWI_SENSOR_CONFIG_LOG_LEVEL 3 # 10854 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_TWI_SENSOR_CONFIG_INFO_COLOR 0 # 10870 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_TWI_SENSOR_CONFIG_DEBUG_COLOR 0 #define PM_LOG_ENABLED 1 # 10889 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define PM_LOG_LEVEL 3 # 10905 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define PM_LOG_INFO_COLOR 0 # 10921 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define PM_LOG_DEBUG_COLOR 0 # 10935 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define SER_HAL_TRANSPORT_CONFIG_LOG_ENABLED 0 # 10946 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define SER_HAL_TRANSPORT_CONFIG_LOG_LEVEL 3 # 10962 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define SER_HAL_TRANSPORT_CONFIG_INFO_COLOR 0 # 10978 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define SER_HAL_TRANSPORT_CONFIG_DEBUG_COLOR 0 # 11002 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NFC_AC_REC_ENABLED 0 #define NFC_AC_REC_PARSER_ENABLED 0 #define NFC_BLE_OOB_ADVDATA_ENABLED 0 #define ADVANCED_ADVDATA_SUPPORT 0 # 11032 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NFC_BLE_OOB_ADVDATA_PARSER_ENABLED 0 #define NFC_BLE_PAIR_LIB_ENABLED 0 #define NFC_BLE_PAIR_LIB_LOG_ENABLED 0 # 11054 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NFC_BLE_PAIR_LIB_LOG_LEVEL 3 # 11070 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NFC_BLE_PAIR_LIB_INFO_COLOR 0 # 11086 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NFC_BLE_PAIR_LIB_DEBUG_COLOR 0 # 11099 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define BLE_NFC_SEC_PARAM_BOND 1 #define BLE_NFC_SEC_PARAM_KDIST_OWN_ENC 1 #define BLE_NFC_SEC_PARAM_KDIST_OWN_ID 1 #define BLE_NFC_SEC_PARAM_KDIST_PEER_ENC 1 #define BLE_NFC_SEC_PARAM_KDIST_PEER_ID 1 # 11145 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define BLE_NFC_SEC_PARAM_MIN_KEY_SIZE 7 # 11162 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define BLE_NFC_SEC_PARAM_MAX_KEY_SIZE 16 # 11174 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NFC_BLE_PAIR_MSG_ENABLED 0 #define NFC_CH_COMMON_ENABLED 0 #define NFC_EP_OOB_REC_ENABLED 0 #define NFC_HS_REC_ENABLED 0 #define NFC_LE_OOB_REC_ENABLED 0 #define NFC_LE_OOB_REC_PARSER_ENABLED 0 #define NFC_NDEF_LAUNCHAPP_MSG_ENABLED 1 #define NFC_NDEF_LAUNCHAPP_REC_ENABLED 1 #define NFC_NDEF_MSG_ENABLED 1 #define NFC_NDEF_MSG_TAG_TYPE 4 #define NFC_NDEF_MSG_PARSER_ENABLED 0 #define NFC_NDEF_MSG_PARSER_LOG_ENABLED 0 # 11261 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NFC_NDEF_MSG_PARSER_LOG_LEVEL 3 # 11277 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NFC_NDEF_MSG_PARSER_INFO_COLOR 0 # 11288 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NFC_NDEF_RECORD_ENABLED 1 #define NFC_NDEF_RECORD_PARSER_ENABLED 0 #define NFC_NDEF_RECORD_PARSER_LOG_ENABLED 0 # 11310 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NFC_NDEF_RECORD_PARSER_LOG_LEVEL 3 # 11326 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NFC_NDEF_RECORD_PARSER_INFO_COLOR 0 # 11337 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NFC_NDEF_TEXT_RECORD_ENABLED 1 #define NFC_NDEF_URI_MSG_ENABLED 1 #define NFC_NDEF_URI_REC_ENABLED 1 #define NFC_PLATFORM_ENABLED 1 #define NFC_PLATFORM_LOG_ENABLED 4 # 11373 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NFC_PLATFORM_LOG_LEVEL 3 # 11389 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NFC_PLATFORM_INFO_COLOR 0 # 11405 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NFC_PLATFORM_DEBUG_COLOR 0 # 11415 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NFC_T2T_PARSER_ENABLED 0 #define NFC_T2T_PARSER_LOG_ENABLED 0 # 11431 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NFC_T2T_PARSER_LOG_LEVEL 3 # 11447 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NFC_T2T_PARSER_INFO_COLOR 0 # 11457 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NFC_T4T_APDU_ENABLED 0 #define NFC_T4T_APDU_LOG_ENABLED 0 # 11473 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NFC_T4T_APDU_LOG_LEVEL 3 # 11489 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NFC_T4T_APDU_LOG_COLOR 0 # 11499 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NFC_T4T_CC_FILE_PARSER_ENABLED 0 #define NFC_T4T_CC_FILE_PARSER_LOG_ENABLED 0 # 11515 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NFC_T4T_CC_FILE_PARSER_LOG_LEVEL 3 # 11531 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NFC_T4T_CC_FILE_PARSER_INFO_COLOR 0 # 11541 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NFC_T4T_HL_DETECTION_PROCEDURES_ENABLED 0 #define NFC_T4T_HL_DETECTION_PROCEDURES_LOG_ENABLED 0 # 11557 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NFC_T4T_HL_DETECTION_PROCEDURES_LOG_LEVEL 3 # 11573 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NFC_T4T_HL_DETECTION_PROCEDURES_INFO_COLOR 0 #define APDU_BUFF_SIZE 250 #define CC_STORAGE_BUFF_SIZE 64 #define NFC_T4T_TLV_BLOCK_PARSER_ENABLED 0 #define NFC_T4T_TLV_BLOCK_PARSER_LOG_ENABLED 0 # 11609 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NFC_T4T_TLV_BLOCK_PARSER_LOG_LEVEL 3 # 11625 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NFC_T4T_TLV_BLOCK_PARSER_INFO_COLOR 0 # 11646 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define SEGGER_RTT_CONFIG_BUFFER_SIZE_UP 512 #define SEGGER_RTT_CONFIG_MAX_NUM_UP_BUFFERS 2 #define SEGGER_RTT_CONFIG_BUFFER_SIZE_DOWN 16 #define SEGGER_RTT_CONFIG_MAX_NUM_DOWN_BUFFERS 2 # 11676 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define SEGGER_RTT_CONFIG_DEFAULT_MODE 0 # 11691 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_SDH_BLE_ENABLED 1 # 11704 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_SDH_BLE_GAP_DATA_LENGTH 27 #define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 1 #define NRF_SDH_BLE_CENTRAL_LINK_COUNT 5 #define NRF_SDH_BLE_TOTAL_LINK_COUNT 6 #define NRF_SDH_BLE_GAP_EVENT_LENGTH 6 #define NRF_SDH_BLE_GATT_MAX_MTU_SIZE 247 #define NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE 1408 #define NRF_SDH_BLE_VS_UUID_COUNT 3 # 11765 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_SDH_BLE_SERVICE_CHANGED 0 # 11779 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_SDH_BLE_OBSERVER_PRIO_LEVELS 4 # 11789 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define BLE_ADV_BLE_OBSERVER_PRIO 1 #define BLE_ANCS_C_BLE_OBSERVER_PRIO 2 #define BLE_ANS_C_BLE_OBSERVER_PRIO 2 #define BLE_BAS_BLE_OBSERVER_PRIO 2 #define BLE_BAS_C_BLE_OBSERVER_PRIO 2 #define BLE_BPS_BLE_OBSERVER_PRIO 2 #define BLE_CONN_PARAMS_BLE_OBSERVER_PRIO 1 #define BLE_CONN_STATE_BLE_OBSERVER_PRIO 0 #define BLE_CSCS_BLE_OBSERVER_PRIO 2 #define BLE_CTS_C_BLE_OBSERVER_PRIO 2 #define BLE_DB_DISC_BLE_OBSERVER_PRIO 1 #define BLE_DFU_BLE_OBSERVER_PRIO 2 #define BLE_DIS_C_BLE_OBSERVER_PRIO 2 #define BLE_GLS_BLE_OBSERVER_PRIO 2 #define BLE_HIDS_BLE_OBSERVER_PRIO 2 #define BLE_HRS_BLE_OBSERVER_PRIO 2 #define BLE_HRS_C_BLE_OBSERVER_PRIO 2 #define BLE_HTS_BLE_OBSERVER_PRIO 2 #define BLE_IAS_BLE_OBSERVER_PRIO 2 #define BLE_IAS_C_BLE_OBSERVER_PRIO 2 #define BLE_LBS_BLE_OBSERVER_PRIO 2 #define BLE_LBS_C_BLE_OBSERVER_PRIO 2 #define BLE_LESC_OBSERVER_PRIO 2 #define BLE_LLS_BLE_OBSERVER_PRIO 2 #define BLE_LNS_BLE_OBSERVER_PRIO 2 #define BLE_NUS_BLE_OBSERVER_PRIO 2 #define BLE_NUS_C_BLE_OBSERVER_PRIO 2 #define BLE_OTS_BLE_OBSERVER_PRIO 2 #define BLE_OTS_C_BLE_OBSERVER_PRIO 2 #define BLE_RCS_C_BLE_OBSERVER_PRIO 2 #define BLE_RSCS_BLE_OBSERVER_PRIO 2 #define BLE_RSCS_C_BLE_OBSERVER_PRIO 2 #define BLE_TPS_BLE_OBSERVER_PRIO 2 #define BSP_BTN_BLE_OBSERVER_PRIO 1 #define NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO 1 # 12174 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_BLE_BMS_BLE_OBSERVER_PRIO 2 #define NRF_BLE_CGMS_BLE_OBSERVER_PRIO 2 #define NRF_BLE_ES_BLE_OBSERVER_PRIO 2 #define NRF_BLE_GATTS_C_BLE_OBSERVER_PRIO 2 #define NRF_BLE_GATT_BLE_OBSERVER_PRIO 1 #define NRF_BLE_QWR_BLE_OBSERVER_PRIO 2 #define NRF_BLE_SCAN_OBSERVER_PRIO 1 #define PM_BLE_OBSERVER_PRIO 1 # 12236 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_SDH_ENABLED 1 # 12253 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_SDH_DISPATCH_MODEL 0 # 12269 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_SDH_CLOCK_LF_SRC 1 #define NRF_SDH_CLOCK_LF_RC_CTIV 0 #define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 0 # 12301 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_SDH_CLOCK_LF_ACCURACY 7 # 12315 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_SDH_REQ_OBSERVER_PRIO_LEVELS 2 #define NRF_SDH_STATE_OBSERVER_PRIO_LEVELS 2 #define NRF_SDH_STACK_OBSERVER_PRIO_LEVELS 2 # 12342 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define CLOCK_CONFIG_STATE_OBSERVER_PRIO 0 #define POWER_CONFIG_STATE_OBSERVER_PRIO 0 #define RNG_CONFIG_STATE_OBSERVER_PRIO 0 # 12371 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_SDH_ANT_STACK_OBSERVER_PRIO 0 # 12380 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_SDH_BLE_STACK_OBSERVER_PRIO 0 # 12389 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_SDH_SOC_STACK_OBSERVER_PRIO 0 # 12404 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_SDH_SOC_ENABLED 1 # 12414 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NRF_SDH_SOC_OBSERVER_PRIO_LEVELS 2 # 12424 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define BLE_ADV_SOC_OBSERVER_PRIO 1 #define BLE_DFU_SOC_OBSERVER_PRIO 1 #define CLOCK_CONFIG_SOC_OBSERVER_PRIO 0 #define POWER_CONFIG_SOC_OBSERVER_PRIO 0 #define NRF_BL_SETTINGS_PAGE_PROTECT 1 # 12460 "/home/jenkins/workspace/RUI_Release/rui-v3/component/core/board/rak4630/sdk_config.h" #define NDEF_FILE_SIZE 1024 # 67 "/home/jenkins/workspace/RUI_Release/rui-v3/external/nRF5_SDK/nRF5_SDK_17.0.2_d674dde/external/segger_rtt/SEGGER_RTT_Syscalls_GCC.c" 2
the_stack_data/18554.c
#include <stdio.h> #include <math.h> int main() { int n; double m, r, invest; scanf ("%lf", &m); scanf ("%i", &n); scanf ("%lf", &r); r = r/100; invest = m*pow((1+r),n); printf ("%.2lf\n", invest); return 0; }
the_stack_data/28262266.c
#include<stdio.h> void prime(int n) { // Array defined then all values is initialized by 1 // 1 denotes primary no. and 0 denotes not a prime no. int isprime[n+1]; for(int i =0; i <= n;i++) { isprime[i] = 1; } // Loop starts from 2 till i*i <= n for(int i= 2; i*i <= n; i++) { // Checks whether prime or not, then initializes the // of isprime array having indexes multiple of i. if(isprime[i]) { for(int j = i*i; j <= n; j += i) isprime[j] = 0; } } for(int i = 2; i <= n; i++) { // Outputs the prime no. if(isprime[i]) printf("%d ",i); } } int main(void) { int n; scanf("%d",&n); prime(n); return 0; }
the_stack_data/98574251.c
#include <stdio.h> int main(void) { int i = 0, a; char result[1000]; scanf("%d", &a); while (a != 0) { int resto = a % 16; if (resto < 10) result[i++] = 48 + resto; else result[i++] = 55 + resto; a /= 16; } result[i] = '\0'; for (i -= 1; i >= 0; i--) printf("%c", result[i]); printf("\n"); return 0; }
the_stack_data/1227113.c
#include <pthread.h> #include <stdlib.h> pthread_mutex_t *mutex; void *thread1(void *arg) { pthread_mutex_lock(mutex); pthread_mutex_unlock(mutex); return NULL; } void *thread2(void *arg) { pthread_mutex_lock(mutex); pthread_mutex_unlock(mutex); return NULL; } int main(void) { pthread_t id1, id2; mutex = (pthread_mutex_t *) malloc(sizeof(pthread_mutex_t)); if (mutex==NULL) exit(0); pthread_mutex_init(mutex, NULL); pthread_create(&id1, NULL, thread1, NULL); pthread_create(&id2, NULL, thread2, NULL); return 0; }
the_stack_data/730355.c
/* Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory Written by Chunhua Liao, Pei-Hung Lin, Joshua Asplund, Markus Schordan, and Ian Karlin (email: [email protected], [email protected], [email protected], [email protected], [email protected]) LLNL-CODE-732144 All rights reserved. This file is part of DataRaceBench. For details, see https://github.com/LLNL/dataracebench. Please also see the LICENSE file for our additional BSD notice. 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. */ /* Classic PI calculation using reduction */ #define num_steps 2000000000 #include <stdio.h> int main(int argc, char** argv) { double pi = 0.0; long int i; double x, interval_width; interval_width = 1.0/(double)num_steps; #pragma omp parallel for reduction(+:pi) private(x) for (i = 0; i < num_steps; i++) { x = (i+ 0.5) * interval_width; pi += 1.0 / (x*x + 1.0); } pi = pi * 4.0 * interval_width; printf ("PI=%f\n", pi); return 0; }
the_stack_data/40764152.c
#include <stdio.h> void swap(int *, int *); int main(void) { int a, b, c; int *p1, *p2, *p3; printf("Enter a b c: "); scanf("%d %d %d", &a, &b, &c); p1 = &a; p2 = &b; p3 = &c; if (a > b) swap(p1, p2); if (a > c) swap(p1, p3); if (b > c) swap(p2, p3); printf("%d %d %d \n", a, b, c); return 0; } void swap(int *s1, int *s2) { int t; t = *s1; *s1 = *s2; *s2 = t; }
the_stack_data/36075426.c
/* Make sure that we use abs.fmt and neg.fmt when the signs of NaNs don't matter. */ /* { dg-do compile } */ /* { dg-mips-options "-O2 -mhard-float -ffinite-math-only" } */ /* { dg-final { scan-assembler "neg.s" } } */ /* { dg-final { scan-assembler "neg.d" } } */ /* { dg-final { scan-assembler "abs.s" } } */ /* { dg-final { scan-assembler "abs.d" } } */ float f1 (float f) { return -f; } float f2 (float f) { return __builtin_fabsf (f); } double d1 (double d) { return -d; } double d2 (double d) { return __builtin_fabs (d); }
the_stack_data/103265309.c
// parse_log //============================================================================= // Author: Michael Rieder (2013) [email protected] // // parse log for emag //============================================================================= #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <string.h> // global variables const char * input_filename = 0; const int max_line_length = 128; double tscale=0.470430312423675E+15; double lscale=0.308567758128200E+22; double dscale=0.677025430198932E-22; double boxlen=0.400000000000000E+03; // function declarations void read_logfile( FILE *logfile ); FILE* open_logfile( const char *filename ); void close_logfile( FILE *logfile ); void parse_args( int argc, char *argv[] ); // function definitions int main( int argc, char *argv[] ) { FILE *logfile; // check the arguments parse_args( argc, argv ); if ( !input_filename ) return EXIT_FAILURE; // file access logfile = open_logfile( input_filename ); if ( logfile ) { read_logfile( logfile ); close_logfile( logfile ); } return EXIT_SUCCESS; } void read_logfile( FILE *logfile ) { char line_buffer[max_line_length]; // emag const char * emag_string = "emag="; char * emag_pos; double emag; // t const char * time_string = "t="; char * time_pos; double time; // a const char * aexp_string = "a="; char * aexp_pos; double aexp; // read new line while( fgets( line_buffer, max_line_length, logfile ) ) { emag_pos = strstr( line_buffer, emag_string ); if ( emag_pos ) { emag = atof( emag_pos + strlen(emag_string) ); // read next line fgets( line_buffer, max_line_length, logfile ); // time time_pos = strstr( line_buffer, time_string ); time = atof( time_pos + strlen(time_string) ); // aexp aexp_pos = strstr( line_buffer, aexp_string ); aexp = atof( aexp_pos + strlen(aexp_string) ); // divide emag by box volume emag = emag / ( boxlen*boxlen*boxlen ); // scale t and B time = time * tscale * 3.1689e-8 * 1e-9; emag = emag * dscale * (lscale/tscale)*(lscale/tscale) / 4 * 3.14159265358979323846; // output t - a - e values printf( "%f %f %e\n", time, aexp, emag ); } } } FILE* open_logfile( const char *filename ) { FILE *logfile; logfile = fopen( input_filename, "r" ); if ( !logfile ) printf( "error opening %s\n", input_filename ); return logfile; } void close_logfile( FILE *logfile ) { if ( logfile ) fclose( logfile ); } void parse_args( int argc, char *argv[] ) { int i; if ( argc < 2 ) printf( "Usage: %s filename\n", argv[0] ); for (i=1;i<argc;i++) { if ( !strcmp(argv[i],"-t") ) { i++; sscanf( argv[i], "%lf", &tscale); } else if ( !strcmp(argv[i],"-l") ) { i++; sscanf( argv[i], "%lf", &lscale); } else if ( !strcmp(argv[i],"-d") ) { i++; sscanf( argv[i], "%lf", &dscale); } else if ( !strcmp(argv[i],"-b") ) { i++; sscanf( argv[i], "%lf", &boxlen); } else if ( argv[i][0] == '-' ) { printf( "unrecognized command: %s\n", argv[i] ); } else input_filename = argv[i]; } }
the_stack_data/57850.c
/** ****************************************************************************** * @file stm32wlxx_ll_i2c.c * @author MCD Application Team * @brief I2C LL module driver. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2020 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ #if defined(USE_FULL_LL_DRIVER) /* Includes ------------------------------------------------------------------*/ #include "stm32wlxx_ll_i2c.h" #include "stm32wlxx_ll_bus.h" #ifdef USE_FULL_ASSERT #include "stm32_assert.h" #else #define assert_param(expr) ((void)0U) #endif /* USE_FULL_ASSERT */ /** @addtogroup STM32WLxx_LL_Driver * @{ */ #if defined (I2C1) || defined (I2C2) || defined (I2C3) /** @defgroup I2C_LL I2C * @{ */ /* Private types -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private constants ---------------------------------------------------------*/ /* Private macros ------------------------------------------------------------*/ /** @addtogroup I2C_LL_Private_Macros * @{ */ #define IS_LL_I2C_PERIPHERAL_MODE(__VALUE__) (((__VALUE__) == LL_I2C_MODE_I2C) || \ ((__VALUE__) == LL_I2C_MODE_SMBUS_HOST) || \ ((__VALUE__) == LL_I2C_MODE_SMBUS_DEVICE) || \ ((__VALUE__) == LL_I2C_MODE_SMBUS_DEVICE_ARP)) #define IS_LL_I2C_ANALOG_FILTER(__VALUE__) (((__VALUE__) == LL_I2C_ANALOGFILTER_ENABLE) || \ ((__VALUE__) == LL_I2C_ANALOGFILTER_DISABLE)) #define IS_LL_I2C_DIGITAL_FILTER(__VALUE__) ((__VALUE__) <= 0x0000000FU) #define IS_LL_I2C_OWN_ADDRESS1(__VALUE__) ((__VALUE__) <= 0x000003FFU) #define IS_LL_I2C_TYPE_ACKNOWLEDGE(__VALUE__) (((__VALUE__) == LL_I2C_ACK) || \ ((__VALUE__) == LL_I2C_NACK)) #define IS_LL_I2C_OWN_ADDRSIZE(__VALUE__) (((__VALUE__) == LL_I2C_OWNADDRESS1_7BIT) || \ ((__VALUE__) == LL_I2C_OWNADDRESS1_10BIT)) /** * @} */ /* Private function prototypes -----------------------------------------------*/ /* Exported functions --------------------------------------------------------*/ /** @addtogroup I2C_LL_Exported_Functions * @{ */ /** @addtogroup I2C_LL_EF_Init * @{ */ /** * @brief De-initialize the I2C registers to their default reset values. * @param I2Cx I2C Instance. * @retval An ErrorStatus enumeration value: * - SUCCESS: I2C registers are de-initialized * - ERROR: I2C registers are not de-initialized */ ErrorStatus LL_I2C_DeInit(I2C_TypeDef *I2Cx) { ErrorStatus status = SUCCESS; /* Check the I2C Instance I2Cx */ assert_param(IS_I2C_ALL_INSTANCE(I2Cx)); if (I2Cx == I2C1) { /* Force reset of I2C clock */ LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_I2C1); /* Release reset of I2C clock */ LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_I2C1); } else if (I2Cx == I2C2) { /* Force reset of I2C clock */ LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_I2C2); /* Release reset of I2C clock */ LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_I2C2); } else if (I2Cx == I2C3) { /* Force reset of I2C clock */ LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_I2C3); /* Release reset of I2C clock */ LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_I2C3); } else { status = ERROR; } return status; } /** * @brief Initialize the I2C registers according to the specified parameters in I2C_InitStruct. * @param I2Cx I2C Instance. * @param I2C_InitStruct pointer to a @ref LL_I2C_InitTypeDef structure. * @retval An ErrorStatus enumeration value: * - SUCCESS: I2C registers are initialized * - ERROR: Not applicable */ ErrorStatus LL_I2C_Init(I2C_TypeDef *I2Cx, LL_I2C_InitTypeDef *I2C_InitStruct) { /* Check the I2C Instance I2Cx */ assert_param(IS_I2C_ALL_INSTANCE(I2Cx)); /* Check the I2C parameters from I2C_InitStruct */ assert_param(IS_LL_I2C_PERIPHERAL_MODE(I2C_InitStruct->PeripheralMode)); assert_param(IS_LL_I2C_ANALOG_FILTER(I2C_InitStruct->AnalogFilter)); assert_param(IS_LL_I2C_DIGITAL_FILTER(I2C_InitStruct->DigitalFilter)); assert_param(IS_LL_I2C_OWN_ADDRESS1(I2C_InitStruct->OwnAddress1)); assert_param(IS_LL_I2C_TYPE_ACKNOWLEDGE(I2C_InitStruct->TypeAcknowledge)); assert_param(IS_LL_I2C_OWN_ADDRSIZE(I2C_InitStruct->OwnAddrSize)); /* Disable the selected I2Cx Peripheral */ LL_I2C_Disable(I2Cx); /*---------------------------- I2Cx CR1 Configuration ------------------------ * Configure the analog and digital noise filters with parameters : * - AnalogFilter: I2C_CR1_ANFOFF bit * - DigitalFilter: I2C_CR1_DNF[3:0] bits */ LL_I2C_ConfigFilters(I2Cx, I2C_InitStruct->AnalogFilter, I2C_InitStruct->DigitalFilter); /*---------------------------- I2Cx TIMINGR Configuration -------------------- * Configure the SDA setup, hold time and the SCL high, low period with parameter : * - Timing: I2C_TIMINGR_PRESC[3:0], I2C_TIMINGR_SCLDEL[3:0], I2C_TIMINGR_SDADEL[3:0], * I2C_TIMINGR_SCLH[7:0] and I2C_TIMINGR_SCLL[7:0] bits */ LL_I2C_SetTiming(I2Cx, I2C_InitStruct->Timing); /* Enable the selected I2Cx Peripheral */ LL_I2C_Enable(I2Cx); /*---------------------------- I2Cx OAR1 Configuration ----------------------- * Disable, Configure and Enable I2Cx device own address 1 with parameters : * - OwnAddress1: I2C_OAR1_OA1[9:0] bits * - OwnAddrSize: I2C_OAR1_OA1MODE bit */ LL_I2C_DisableOwnAddress1(I2Cx); LL_I2C_SetOwnAddress1(I2Cx, I2C_InitStruct->OwnAddress1, I2C_InitStruct->OwnAddrSize); /* OwnAdress1 == 0 is reserved for General Call address */ if (I2C_InitStruct->OwnAddress1 != 0U) { LL_I2C_EnableOwnAddress1(I2Cx); } /*---------------------------- I2Cx MODE Configuration ----------------------- * Configure I2Cx peripheral mode with parameter : * - PeripheralMode: I2C_CR1_SMBDEN and I2C_CR1_SMBHEN bits */ LL_I2C_SetMode(I2Cx, I2C_InitStruct->PeripheralMode); /*---------------------------- I2Cx CR2 Configuration ------------------------ * Configure the ACKnowledge or Non ACKnowledge condition * after the address receive match code or next received byte with parameter : * - TypeAcknowledge: I2C_CR2_NACK bit */ LL_I2C_AcknowledgeNextData(I2Cx, I2C_InitStruct->TypeAcknowledge); return SUCCESS; } /** * @brief Set each @ref LL_I2C_InitTypeDef field to default value. * @param I2C_InitStruct Pointer to a @ref LL_I2C_InitTypeDef structure. * @retval None */ void LL_I2C_StructInit(LL_I2C_InitTypeDef *I2C_InitStruct) { /* Set I2C_InitStruct fields to default values */ I2C_InitStruct->PeripheralMode = LL_I2C_MODE_I2C; I2C_InitStruct->Timing = 0U; I2C_InitStruct->AnalogFilter = LL_I2C_ANALOGFILTER_ENABLE; I2C_InitStruct->DigitalFilter = 0U; I2C_InitStruct->OwnAddress1 = 0U; I2C_InitStruct->TypeAcknowledge = LL_I2C_NACK; I2C_InitStruct->OwnAddrSize = LL_I2C_OWNADDRESS1_7BIT; } /** * @} */ /** * @} */ /** * @} */ #endif /* I2C1 || I2C2 || I2C3 */ /** * @} */ #endif /* USE_FULL_LL_DRIVER */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
the_stack_data/234518538.c
/* * suizid.c * * Created on: 02.04.2014 * Author: larsgrefer */ #include <signal.h> #include <sys/types.h> #include <unistd.h> #include <stdio.h> int main(void) { kill(getpid(), SIGINT); printf("Ich lebe noch"); sleep(2); return 0; }
the_stack_data/167329983.c
/* This test checks the work of InterruptFilter */ int global; int deIntr() { global = 1; } int ldv_main() { deIntr(); }
the_stack_data/129567.c
/* Copyright (C) 2001 by George Williams */ /* * 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. * The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * 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 <string.h> #include <stdlib.h> #include <stdio.h> #include <time.h> typedef struct basepoint { double x, y; } BasePoint; struct dup { int glyph; int enc; struct dup *prev; }; struct ttfinfo { int emsize; /* from head table */ int ascent, descent; /* from hhea table */ int glyph_cnt; /* from maxp table */ int width_cnt; /* from the hhea table */ unsigned int index_to_loc_is_long:1; /* in head table */ /* Mac fonts platform=0/1, platform specific enc id, roman=0, english is lang code 0 */ /* iso platform=2, platform specific enc id, latin1=0/2, no language */ /* microsoft platform=3, platform specific enc id, 1, english is lang code 0x??09 */ int numtables; /* cmap */ int encoding_start; /* Offset from sof to start of encoding table */ /* glyf */ int glyph_start; /* Offset from sof to start of glyph table */ /* EBDT */ int bitmapdata_start; /* Offset to start of bitmap data */ /* EBLT */ int bitmaploc_start; /* Offset to start of bitmap locator data */ /* head */ int head_start; /* hhea */ int hhea_start; /* hmtx */ int hmetrics_start; /* kern */ int kern_start; /* loca */ int glyphlocations_start; /* there are glyph_cnt of these, from maxp tab */ int loca_length; /* actually glypn_cnt is wrong. Use the table length (divided by size) instead */ /* maxp */ int maxp_start; /* maximum number of glyphs */ /* name */ int copyright_start; /* copyright and fontname */ /* post */ int postscript_start; /* names for the glyphs, italic angle, etc. */ int postscript_len; /* names for the glyphs, italic angle, etc. */ /* OS/2 */ int os2_start; int os2_len; int fpgm_start; int fpgm_len; int prep_start; int prep_len; unsigned int *glyph_offsets; char **glyph_names; unsigned short *glyph_unicode; int *glyph_widths; struct dup *dups; }; static char *standardnames[258] = { ".notdef", ".null", "nonmarkingreturn", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "Adieresis", "Aring", "Ccedilla", "Eacute", "Ntilde", "Odieresis", "Udieresis", "aacute", "agrave", "acircumflex", "adieresis", "atilde", "aring", "ccedilla", "eacute", "egrave", "ecircumflex", "edieresis", "iacute", "igrave", "icircumflex", "idieresis", "ntilde", "oacute", "ograve", "ocircumflex", "odieresis", "otilde", "uacute", "ugrave", "ucircumflex", "udieresis", "dagger", "degree", "cent", "sterling", "section", "bullet", "paragraph", "germandbls", "registered", "copyright", "trademark", "acute", "dieresis", "notequal", "AE", "Oslash", "infinity", "plusminus", "lessequal", "greaterequal", "yen", "mu", "partialdiff", "summation", "product", "pi", "integral", "ordfeminine", "ordmasculine", "Omega", "ae", "oslash", "questiondown", "exclamdown", "logicalnot", "radical", "florin", "approxequal", "Delta", "guillemotleft", "guillemotright", "ellipsis", "nonbreakingspace", "Agrave", "Atilde", "Otilde", "OE", "oe", "endash", "emdash", "quotedblleft", "quotedblright", "quoteleft", "quoteright", "divide", "lozenge", "ydieresis", "Ydieresis", "fraction", "currency", "guilsinglleft", "guilsinglright", "fi", "fl", "daggerdbl", "periodcentered", "quotesinglbase", "quotedblbase", "perthousand", "Acircumflex", "Ecircumflex", "Aacute", "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Oacute", "Ocircumflex", "apple", "Ograve", "Uacute", "Ucircumflex", "Ugrave", "dotlessi", "circumflex", "tilde", "macron", "breve", "dotaccent", "ring", "cedilla", "hungarumlaut", "ogonek", "caron", "Lslash", "lslash", "Scaron", "scaron", "Zcaron", "zcaron", "brokenbar", "Eth", "eth", "Yacute", "yacute", "Thorn", "thorn", "minus", "multiply", "onesuperior", "twosuperior", "threesuperior", "onehalf", "onequarter", "threequarters", "franc", "Gbreve", "gbreve", "Idotaccent", "Scedilla", "scedilla", "Cacute", "cacute", "Ccaron", "ccaron", "dcroat" }; const unsigned short unicode_from_mac[] = { 0x0000, 0x00d0, 0x00f0, 0x0141, 0x0142, 0x0160, 0x0161, 0x00dd, 0x00fd, 0x0009, 0x000a, 0x00de, 0x00fe, 0x000d, 0x017d, 0x017e, 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x00bd, 0x00bc, 0x00b9, 0x00be, 0x00b3, 0x00b2, 0x00a6, 0x00ad, 0x00d7, 0x001e, 0x001f, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, 0x00c4, 0x00c5, 0x00c7, 0x00c9, 0x00d1, 0x00d6, 0x00dc, 0x00e1, 0x00e0, 0x00e2, 0x00e4, 0x00e3, 0x00e5, 0x00e7, 0x00e9, 0x00e8, 0x00ea, 0x00eb, 0x00ed, 0x00ec, 0x00ee, 0x00ef, 0x00f1, 0x00f3, 0x00f2, 0x00f4, 0x00f6, 0x00f5, 0x00fa, 0x00f9, 0x00fb, 0x00fc, 0x2020, 0x00b0, 0x00a2, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x00df, 0x00ae, 0x00a9, 0x2122, 0x00b4, 0x00a8, 0x2260, 0x00c6, 0x00d8, 0x221e, 0x00b1, 0x2264, 0x2265, 0x00a5, 0x00b5, 0x2202, 0x2211, 0x220f, 0x03c0, 0x222b, 0x00aa, 0x00ba, 0x2126, 0x00e6, 0x00f8, 0x00bf, 0x00a1, 0x00ac, 0x221a, 0x0192, 0x2248, 0x2206, 0x00ab, 0x00bb, 0x2026, 0x00a0, 0x00c0, 0x00c3, 0x00d5, 0x0152, 0x0153, 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x25ca, 0x00ff, 0x0178, 0x2044, 0x00a4, 0x2039, 0x203a, 0xfb01, 0xfb02, 0x2021, 0x00b7, 0x201a, 0x201e, 0x2030, 0x00c2, 0x00ca, 0x00c1, 0x00cb, 0x00c8, 0x00cd, 0x00ce, 0x00cf, 0x00cc, 0x00d3, 0x00d4, 0xf8ff, 0x00d2, 0x00da, 0x00db, 0x00d9, 0x0131, 0x02c6, 0x02dc, 0x00af, 0x02d8, 0x02d9, 0x02da, 0x00b8, 0x02dd, 0x02db, 0x02c7 }; static int getushort(FILE *ttf) { int ch1 = getc(ttf); int ch2 = getc(ttf); if ( ch2==EOF ) return( EOF ); return( (ch1<<8)|ch2 ); } static int getlong(FILE *ttf) { int ch1 = getc(ttf); int ch2 = getc(ttf); int ch3 = getc(ttf); int ch4 = getc(ttf); if ( ch4==EOF ) return( EOF ); return( (ch1<<24)|(ch2<<16)|(ch3<<8)|ch4 ); } static double getfixed(FILE *ttf) { int val = getlong(ttf); int mant = val&0xffff; /* This oddity may be needed to deal with the first 16 bits being signed */ /* and the low-order bits unsigned */ return( (double) (val>>16) + (mant/65536.0) ); } static double get2dot14(FILE *ttf) { int val = getushort(ttf); int mant = val&0x3fff; /* This oddity may be needed to deal with the first 2 bits being signed */ /* and the low-order bits unsigned */ return( (double) ((val<<16)>>(16+14)) + (mant/16384.0) ); } static void readttfhead(FILE *ttf, struct ttfinfo *info) { int i; fseek(ttf,info->head_start+4*4+2,SEEK_SET); /* skip over the version number and a bunch of junk */ info->emsize = getushort(ttf); for ( i=0; i<15; ++i ) getushort(ttf); info->index_to_loc_is_long = getushort(ttf); if ( info->index_to_loc_is_long ) info->glyph_cnt = info->loca_length/4-1; } static void readttfhhea(FILE *ttf,struct ttfinfo *info) { /* Here I want ascent, descent and the number of horizontal metrics */ int i; fseek(ttf,info->hhea_start+4,SEEK_SET); /* skip over the version number */ info->ascent = getushort(ttf); info->descent = -(short) getushort(ttf); /* fontographer puts the max ascender/min descender here instead. idiots */ if ( info->ascent==0 && info->descent==0 ) info->ascent = .8*info->emsize; if ( info->ascent+info->descent!=info->emsize ) info->ascent = info->ascent * ((double) info->emsize)/(info->ascent+info->descent); info->descent = info->emsize-info->ascent; for ( i=0; i<13; ++i ) getushort(ttf); info->width_cnt = getushort(ttf); } static void readttfpost(FILE *ttf, struct ttfinfo *info) { int format; int gc; int i, j, ind, extras; int len; unsigned short *indexes; char **names, *name; fseek(ttf,info->postscript_start,SEEK_SET); format = getlong(ttf); getlong(ttf); getlong(ttf); getlong(ttf); getlong(ttf); getlong(ttf); getlong(ttf); getlong(ttf); if ( format==0x00020000 ) { gc = getushort(ttf); indexes = calloc(65536,sizeof(unsigned short)); names = calloc(info->glyph_cnt,sizeof(char *)); extras = 0; for ( i=0; i<gc; ++i ) { ind = getushort(ttf); if ( ind>=258 ) ++extras; indexes[ind] = i; } for ( i=0; i<258; ++i ) if ( indexes[i]!=0 ) names[indexes[i]] = standardnames[i]; for ( i=258; i<258+extras; ++i ) { if ( indexes[i]==0 ) break; len = getc(ttf); name = malloc(len+1); for ( j=0; j<len; ++j ) name[j] = getc(ttf); name[j] = '\0'; names[indexes[i]] = name; } if ( names[0]==NULL ) names[0] = standardnames[0]; free(indexes); info->glyph_names = names; } } static struct dup *makedup(int glyph, int uni, struct dup *prev) { struct dup *d = calloc(1,sizeof(struct dup)); d->glyph = glyph; d->enc = uni; d->prev = prev; return( d ); } static void readttfencodings(FILE *ttf,struct ttfinfo *info) { int i,j; int nencs, version; int enc = 0; int platform, specific; int offset, encoff; int format, len; const unsigned short *table; int segCount; unsigned short *endchars, *startchars, *delta, *rangeOffset, *glyphs; int index; fseek(ttf,info->encoding_start,SEEK_SET); version = getushort(ttf); nencs = getushort(ttf); if ( version!=0 && nencs==0 ) nencs = version; /* Sometimes they are backwards */ for ( i=0; i<nencs; ++i ) { platform = getushort(ttf); specific = getushort(ttf); offset = getlong(ttf); if ( platform==3 && specific==1 ) { enc = 1; encoff = offset; } else if ( platform==1 && specific==0 && enc!=1 ) { enc = 2; encoff = offset; } } if ( enc!=0 ) { info->glyph_unicode = calloc(info->glyph_cnt,sizeof(unsigned short)); fseek(ttf,info->encoding_start+encoff,SEEK_SET); format = getushort(ttf); len = getushort(ttf); /* version = */ getushort(ttf); if ( format==0 ) { table = unicode_from_mac; for ( i=0; i<256; ++i ) { info->glyph_unicode[i] = table[i]; if ( i<32 && table[i]==0 ) info->glyph_unicode[i] = i; } } else if ( format==4 ) { segCount = getushort(ttf)/2; /* searchRange = */ getushort(ttf); /* entrySelector = */ getushort(ttf); /* rangeShift = */ getushort(ttf); endchars = malloc(segCount*sizeof(unsigned short)); for ( i=0; i<segCount; ++i ) endchars[i] = getushort(ttf); if ( getushort(ttf)!=0 ) fprintf(stderr,"Expected 0 in true type font"); startchars = malloc(segCount*sizeof(unsigned short)); for ( i=0; i<segCount; ++i ) startchars[i] = getushort(ttf); delta = malloc(segCount*sizeof(unsigned short)); for ( i=0; i<segCount; ++i ) delta[i] = getushort(ttf); rangeOffset = malloc(segCount*sizeof(unsigned short)); for ( i=0; i<segCount; ++i ) rangeOffset[i] = getushort(ttf); len -= 8*sizeof(unsigned short) + 4*segCount*sizeof(unsigned short); /* that's the amount of space left in the subtable and it must */ /* be filled with glyphIDs */ glyphs = malloc(len); for ( i=0; i<len/2; ++i ) glyphs[i] = getushort(ttf); for ( i=0; i<segCount; ++i ) { if ( rangeOffset[i]==0 ) { /* It's ok for a glyph to have several different encodings*/ /* "A" might work for "Alpha" for example */ for ( j=startchars[i]; j<=endchars[i]; ++j ) if ( info->glyph_unicode[(unsigned short) (j+delta[i])]!=0 ) info->dups = makedup((unsigned short) (j+delta[i]),j,info->dups); else info->glyph_unicode[(unsigned short) (j+delta[i])] = j; } else if ( rangeOffset[i]!=0xffff ) { /* It isn't explicitly mentioned by a rangeOffset of 0xffff*/ /* means no glyph */ for ( j=startchars[i]; j<=endchars[i]; ++j ) { index = glyphs[ (i-segCount+rangeOffset[i]/2) + j-startchars[i] ]; if ( index!=0 ) { index = (unsigned short) (index+delta[i]); if ( info->glyph_unicode[index]!=0 ) info->dups = makedup(index,j,info->dups); else info->glyph_unicode[index] = j; } } } } free(glyphs); free(rangeOffset); free(delta); free(startchars); free(endchars); } else if ( format==6 ) { /* Apple's unicode format */ int first, count; first = getushort(ttf); count = getushort(ttf); for ( i=0; i<count; ++i ) info->glyph_unicode[getushort(ttf)] = first+i; } else if ( format==2 ) { fprintf(stderr,"I don't support mixed 8/16 bit characters (no shit jis for me)"); } else if ( format==8 ) { fprintf(stderr,"I don't support mixed 16/32 bit characters (no unicode surogates)"); } else if ( format==10 || format==12 ) { fprintf(stderr,"I don't support 32 bit characters"); } } } static void readttflocations(FILE *ttf,struct ttfinfo *info) { int i; info->glyph_offsets = malloc((info->glyph_cnt+1)*sizeof(unsigned int)); /* First we read all the locations. This might not be needed, they may */ /* just follow one another, but nothing I've noticed says that so let's */ /* be careful */ fseek(ttf,info->glyphlocations_start,SEEK_SET); if ( info->index_to_loc_is_long ) { for ( i=0; i<=info->glyph_cnt ; ++i ) info->glyph_offsets[i] = getlong(ttf); } else { for ( i=0; i<=info->glyph_cnt ; ++i ) info->glyph_offsets[i] = 2*getushort(ttf); } } static void readttfwidths(FILE *ttf,struct ttfinfo *info) { int i,j; fseek(ttf,info->hmetrics_start,SEEK_SET); info->glyph_widths = calloc(info->glyph_cnt,sizeof(int)); for ( i=0; i<info->width_cnt && i<info->glyph_cnt; ++i ) { info->glyph_widths[i] = getushort(ttf); /* lsb = */ getushort(ttf); } for ( j=i; j<info->glyph_cnt; ++j ) info->glyph_widths[j] = info->glyph_widths[i-1]; } #define CHR(ch1,ch2,ch3,ch4) (((ch1)<<24)|((ch2)<<16)|((ch3)<<8)|(ch4)) static int readttfheader(FILE *ttf, struct ttfinfo *info) { int i; int tag, checksum, offset, length, sr, es, rs; double version; version = getfixed(ttf); info->numtables = getushort(ttf); sr = getushort(ttf), es = getushort(ttf), rs = getushort(ttf); for ( i=0; i<info->numtables; ++i ) { tag = getlong(ttf); checksum = getlong(ttf); offset = getlong(ttf); length = getlong(ttf); switch ( tag ) { case CHR('c','m','a','p'): info->encoding_start = offset; break; case CHR('g','l','y','f'): info->glyph_start = offset; break; case CHR('E','B','D','T'): info->bitmapdata_start = offset; break; case CHR('E','B','L','T'): info->bitmaploc_start = offset; break; case CHR('h','e','a','d'): info->head_start = offset; if ( length!=54 ) fprintf( stderr, "> ! Unexpected length for head table, was %d expected 54 ! <\n", length ); break; case CHR('h','h','e','a'): info->hhea_start = offset; if ( length!=36 ) fprintf( stderr, "> ! Unexpected length for hhea table, was %d expected 36 ! <\n", length ); break; case CHR('h','m','t','x'): info->hmetrics_start = offset; break; case CHR('k','e','r','n'): info->kern_start = offset; break; case CHR('l','o','c','a'): info->glyphlocations_start = offset; info->loca_length = length; info->glyph_cnt = length/2-1; /* we don't always have a maxp table. the minus one is because there is one extra entry to give the length of the last glyph */ break; case CHR('m','a','x','p'): info->maxp_start = offset; if ( length!=32 ) fprintf( stderr, "> ! Unexpected length for maxp table, was %d expected 32 ! <\n", length ); break; case CHR('n','a','m','e'): info->copyright_start = offset; break; case CHR('p','o','s','t'): info->postscript_start = offset; info->postscript_len = length; break; case CHR('O','S','/','2'): info->os2_start = offset; info->os2_len = length; if ( length!=78 && length!=86 ) fprintf( stderr, "> ! Unexpected length for OS/2 table, was %d expected either 78 or 86 ! <\n", length ); break; case CHR('p','r','e','p'): info->prep_start = offset; info->prep_len = length; break; case CHR('f','p','g','m'): info->fpgm_start = offset; info->fpgm_len = length; break; } } if ( info->encoding_start==0 || info->glyph_start==0 || info->head_start==0 || info->hhea_start==0 || info->hmetrics_start==0 || info->glyphlocations_start == 0 || info->maxp_start==0 || info->copyright_start==0 || info->postscript_start==0 || info->os2_start==0 ) { fprintf( stderr, "Required table(s) missing: " ); if ( info->encoding_start==0 ) fprintf(stderr,"cmap "); if ( info->glyph_start==0 ) fprintf(stderr,"glyf "); if ( info->head_start==0 ) fprintf(stderr,"head "); if ( info->hhea_start==0 ) fprintf(stderr,"hhea "); if ( info->hmetrics_start==0 ) fprintf(stderr,"hmtx "); if ( info->glyphlocations_start==0 ) fprintf(stderr,"loca "); if ( info->maxp_start==0 ) fprintf(stderr,"maxp "); if ( info->copyright_start==0 ) fprintf(stderr,"name "); if ( info->postscript_start==0 ) fprintf(stderr,"post "); if ( info->os2_start==0 ) fprintf(stderr,"OS/2"); fprintf(stderr,"\n"); exit(1); } readttfhead(ttf,info); readttfhhea(ttf,info); readttfpost(ttf,info); readttfencodings(ttf,info); readttflocations(ttf,info); readttfwidths(ttf,info); return( 1 ); } static char *glyph2name(int glyph, struct ttfinfo *info) { char buffer[20]; if ( info->glyph_names!=NULL ) if ( info->glyph_names[glyph]!=NULL ) return( info->glyph_names[glyph] ); sprintf( buffer,"glyph%d", glyph); return( strdup(buffer)); } static int name2glyph(char *name, struct ttfinfo *info) { int i; if ( info->glyph_names!=NULL ) { for ( i=0; i<info->glyph_cnt; ++i ) if ( info->glyph_names[i]!=NULL ) if ( strcmp(name,info->glyph_names[i])==0 ) return( i ); } fprintf( stderr, "Could not find a glyph named %s\n", name ); exit(1); return( -1 ); } static void DumpEpsHeader(FILE *eps, struct ttfinfo *info, int glyph, double xmin, double ymin, double xmax, double ymax ) { time_t now; struct tm *tm; fprintf( eps, "%%!PS-Adobe-3.0 EPSF-3.0\n" ); fprintf( eps, "%%%%BoundingBox: %g %g %g %g\n", xmin, ymin, xmax, ymax ); fprintf( eps, "%%%%Pages: 0\n" ); fprintf( eps, "%%%%Title: Glyph %d ", glyph ); if ( info->glyph_names!=NULL && info->glyph_names[glyph]!=NULL ) fprintf( eps, " Name: %s", info->glyph_names[glyph]); if ( info->glyph_unicode!=NULL && info->glyph_unicode[glyph]!=0 ) fprintf(eps, " Unicode %04x", info->glyph_unicode[glyph]); fprintf( eps, "\n" ); fprintf( eps, "%%%%Creator: ttf2eps\n" ); time(&now); tm = localtime(&now); fprintf( eps, "%%%%CreationDate: %d:%02d %d-%d-%d\n", tm->tm_hour, tm->tm_min, tm->tm_mday, tm->tm_mon+1, 1900+tm->tm_year ); fprintf( eps, "%%%%EndComments\n" ); fprintf( eps, "%%%%EndProlog\n" ); fprintf( eps, "%%Number of units in Em: %d\n", info->emsize ); fprintf( eps, "%%Ascent: %d\n", info->ascent ); fprintf( eps, "%%Descent: %d\n", info->descent ); if ( info->glyph_widths!=NULL ) fprintf( eps, "%%Character Width %d\n", info->glyph_widths[glyph]); if ( info->glyph_names!=NULL && info->glyph_names[glyph]!=NULL ) fprintf( eps, "%%%%Page: \"%s\" 1\n", info->glyph_names[glyph] ); else fprintf( eps, "%%%%Page: \"Glyph%d\" 1\n", glyph ); } static void DoDumpGlyph(FILE *ttf, FILE *eps, struct ttfinfo *info, int glyph, double trans[6], int top); #define _ARGS_ARE_WORDS 1 #define _ARGS_ARE_XY 2 #define _ROUND 4 /* to grid? What's that? */ #define _SCALE 8 #define _XY_SCALE 0x40 #define _MATRIX 0x80 #define _MORE 0x20 #define _INSTR 0x100 #define _MY_METRICS 0x200 #define _On_Curve 1 #define _X_Short 2 #define _Y_Short 4 #define _Repeat 8 #define _X_Same 0x10 #define _Y_Same 0x20 static void DumpCompositGlyph(FILE *ttf,FILE *eps,struct ttfinfo *info,double trans[6]) { int flags, arg1, arg2; int sub_glyph; int oldpos; double transform[6], restrans[6]; do { flags = getushort(ttf); sub_glyph = getushort(ttf); transform[0] = transform[3] = 1; transform[1] = transform[2] = transform[4] = transform[5] = 0; if ( flags&_ARGS_ARE_WORDS ) { arg1 = (short) getushort(ttf); arg2 = (short) getushort(ttf); } else { arg1 = (signed char) getc(ttf); arg2 = (signed char) getc(ttf); } if ( flags & _ARGS_ARE_XY ) { transform[4] = arg1; transform[5] = arg2; } else fprintf(stderr,"Don't know how to deal with !(flags&_ARGS_ARE_XY)" ); if ( flags & _SCALE ) transform[0] = transform[3] = get2dot14(ttf); else if ( flags & _XY_SCALE ) { transform[0] = get2dot14(ttf); transform[3] = get2dot14(ttf); } else if ( flags & _MATRIX ) { transform[0] = get2dot14(ttf); transform[1] = get2dot14(ttf); transform[2] = get2dot14(ttf); transform[3] = get2dot14(ttf); } restrans[0] = transform[0]*trans[0] + transform[1]*trans[2]; restrans[1] = transform[0]*trans[1] + transform[1]*trans[3]; restrans[2] = transform[2]*trans[0] + transform[3]*trans[2]; restrans[3] = transform[2]*trans[1] + transform[3]*trans[3]; restrans[4] = transform[4]*trans[0] + transform[5]*trans[2] + trans[4]; restrans[5] = transform[4]*trans[1] + transform[5]*trans[3] + trans[5]; oldpos = ftell(ttf); DoDumpGlyph(ttf, eps, info, sub_glyph, restrans, 0); fseek(ttf,oldpos,SEEK_SET); } while ( flags&_MORE ); /* I'm ignoring many things that I don't understand here */ /* Instructions, USE_MY_METRICS, ROUND, what happens if ARGS AREN'T XY */ } static void TransformPoint(BasePoint *bp,double trans[6]) { double x; x = trans[0]*bp->x+trans[2]*bp->y+trans[4]; bp->y=trans[1]*bp->x+trans[3]*bp->y+trans[5]; bp->x = x; } static void DumpSpline(FILE *eps, BasePoint *from, BasePoint *cp, BasePoint *to) { double b, c, d; BasePoint fn, tp; d = from->x; c = 2*cp->x - 2*from->x; b = to->x+from->x-2*cp->x; fn.x = d+c/3; tp.x = fn.x + (c+b)/3; d = from->y; c = 2*cp->y - 2*from->y; b = to->y+from->y-2*cp->y; fn.y = d+c/3; tp.y = fn.y + (c+b)/3; fprintf( eps, " %g %g %g %g %g %g curveto\n", fn.x, fn.y, tp.x, tp.y, to->x, to->y); } static void DumpLine(FILE *eps,BasePoint *from,BasePoint *to ) { fprintf( eps, " %g %g lineto\n", to->x, to->y ); } static void DumpMoveTo(FILE *eps,BasePoint *to ) { fprintf( eps, " %g %g moveto\n", to->x, to->y ); } static void DumpSimpleGlyph(FILE *ttf,FILE *eps,struct ttfinfo *info, double trans[6],int path_cnt) { int i, path, start, last_off; unsigned short *endpt = malloc((path_cnt+1)*sizeof(unsigned short)); BasePoint mid, last, begin; char *flags; BasePoint *pts; int j, tot, len; int last_pos, first; for ( i=0; i<path_cnt; ++i ) endpt[i] = getushort(ttf); tot = endpt[path_cnt-1]+1; pts = malloc(tot*sizeof(BasePoint)); /* ignore instructions */ len = getushort(ttf); for ( i=0; i<len; ++i ) getc(ttf); flags = malloc(tot); for ( i=0; i<tot; ++i ) { flags[i] = getc(ttf); if ( flags[i]&_Repeat ) { int cnt = getc(ttf); for ( j=0; j<cnt; ++j ) flags[i+j+1] = flags[i]; i += cnt; } } if ( i>tot ) fprintf(stderr,"Flag count is wrong (or total is): %d %d", i, tot ); last_pos = 0; for ( i=0; i<tot; ++i ) { if ( flags[i]&_X_Short ) { int off = getc(ttf); if ( !(flags[i]&_X_Same ) ) off = -off; pts[i].x = last_pos + off; } else if ( flags[i]&_X_Same ) pts[i].x = last_pos; else pts[i].x = last_pos + (short) getushort(ttf); last_pos = pts[i].x; } last_pos = 0; for ( i=0; i<tot; ++i ) { if ( flags[i]&_Y_Short ) { int off = getc(ttf); if ( !(flags[i]&_Y_Same ) ) off = -off; pts[i].y = last_pos + off; } else if ( flags[i]&_Y_Same ) pts[i].y = last_pos; else pts[i].y = last_pos + (short) getushort(ttf); last_pos = pts[i].y; } for ( i=0; i<tot; ++i ) TransformPoint(&pts[i],trans); for ( path=i=0; path<path_cnt; ++path ) { start = i; first = 1; while ( i<=endpt[path] ) { if ( flags[i]&_On_Curve ) { if ( first ) DumpMoveTo(eps,&pts[i]); else if ( last_off ) DumpSpline(eps,&last,&pts[i-1],&pts[i]); else DumpLine(eps,&last,&pts[i]); first = 0; last = pts[i]; last_off = 0; } else if ( last_off ) { /* two off curve points get a third on curve point created */ /* half-way between them. Now isn't that special */ mid.x = (pts[i].x+pts[i-1].x)/2; mid.y = (pts[i].y+pts[i-1].y)/2; if ( first ) DumpMoveTo(eps,&mid); else DumpSpline(eps,&last,&pts[i-1],&mid); first = 0; last = mid; /* last_off continues to be true */ } else { last_off = 1; } ++i; } if ( !(flags[start]&_On_Curve) && !(flags[i-1]&_On_Curve) ) { mid.x = (pts[start].x+pts[i-1].x)/2; mid.y = (pts[start].y+pts[i-1].y)/2; DumpSpline(eps,&last,&pts[i-1],&mid); if ( flags[start+1]&_On_Curve ) begin = pts[start+1]; else { begin.x = (pts[start].x+pts[start+1].x)/2; begin.y = (pts[start].y+pts[start+1].y)/2; } DumpSpline(eps,&mid,&pts[start],&begin); } else if ( !(flags[i-1]&_On_Curve)) DumpSpline(eps,&last,&pts[i-1],&pts[start]); else if ( !(flags[start]&_On_Curve) ) DumpSpline(eps,&last,&pts[start],&pts[start+1]); fprintf( eps,"closepath\n" ); } free(endpt); free(flags); free(pts); fprintf( eps,"fill\n" ); } static void DoDumpGlyph(FILE *ttf, FILE *eps, struct ttfinfo *info, int glyph, double trans[6], int top) { int start, end; int path_cnt=-1; double xmin, xmax, ymin, ymax; start = info->glyph_offsets[glyph]; end = info->glyph_offsets[glyph+1]; xmin = xmax = ymin = ymax = 0; if ( start!=end ) { fseek(ttf,info->glyph_start+start,SEEK_SET); path_cnt = (short) getushort(ttf); xmin = (short) getushort(ttf); ymin = (short) getushort(ttf); xmax = (short) getushort(ttf); ymax = (short) getushort(ttf); } if ( top ) { DumpEpsHeader(eps,info,glyph,xmin,ymin,xmax,ymax); fprintf( eps,"newpath\n" ); } else { fprintf( eps, "%% Glyph %d ", glyph ); if ( info->glyph_names!=NULL && info->glyph_names[glyph]!=NULL ) fprintf( eps, " Name: %s", info->glyph_names[glyph]); if ( info->glyph_unicode!=NULL && info->glyph_unicode[glyph]!=0 ) fprintf(eps, " Unicode %04x", info->glyph_unicode[glyph]); } if ( start==end ) return; if ( path_cnt<0 ) DumpCompositGlyph(ttf,eps,info,trans); else DumpSimpleGlyph(ttf,eps,info,trans,path_cnt); } static void DumpGlyph(FILE *ttf, struct ttfinfo *info, int glyph) { char *name = glyph2name(glyph,info); char buffer[300]; FILE *eps; double trans[6]; sprintf(buffer,"%s.eps", name); eps = fopen(buffer,"w"); if ( eps==NULL ) { fprintf( stderr, "Could not open %s for writing\n", buffer ); exit(1); } trans[0] = trans[3] = 1; trans[1] = trans[2] = trans[4] = trans[5] = 0; DoDumpGlyph(ttf, eps, info, glyph, trans, 1); fprintf( eps, "%%%%EOF\n" ); fclose(eps); } int main(int argc, char **argv) { FILE *ttf; struct ttfinfo info; char *filename=NULL; int doall=0, i, val; struct spec { enum { is_glyph, is_unicode, is_name } type; char *arg; struct spec *next; } *specs=NULL, *temp; char *end; struct dup *dup; for ( i=1; i<argc; ++i ) { if ( *argv[i]!='-' ) { if ( filename == NULL ) filename = argv[i]; else { fprintf( stderr, "Must have exactly one truetype filename argument\n" ); exit(1); } } else if ( strcmp(argv[i],"-all")==0 ) doall=1; else if ( strcmp(argv[i],"-glyph")==0 || strcmp(argv[i],"-unicode")==0 || strcmp(argv[i],"-uni")==0 || strcmp(argv[i],"-name")==0 ) { temp = calloc(1,sizeof(struct spec)); temp->type = strcmp(argv[i],"-glyph")==0? is_glyph : strcmp(argv[i],"-name")==0? is_name : is_unicode; temp->arg = argv[++i]; temp->next = specs; specs = temp; } else { fprintf( stderr, "Unknown argument %s\n", argv[i]); fprintf( stderr, "Usage: %s [-all] {-glyph num | -name name | -unicode hex | -uni hex} truetypefile\n", argv[0] ); exit(1); } } if ( filename==NULL ) { fprintf( stderr, "Must have exactly one truetype filename argument\n" ); return( 1 ); } ttf = fopen(filename,"r"); if ( ttf==NULL ) { fprintf( stderr, "Can't open %s\n", filename); return( 1 ); } memset(&info,'\0',sizeof(info)); readttfheader(ttf,&info); if ( doall ) for ( i=0; i<info.glyph_cnt; ++i ) DumpGlyph(ttf,&info,i); else { for ( temp=specs; temp!=NULL; temp=temp->next ) { if ( temp->type==is_glyph ) { val = strtol(temp->arg,&end,10); if ( *end!='\0' || val>=info.glyph_cnt || val<0 ) { fprintf( stderr, "Bad glyph index %s\n", temp->arg); exit(1); } } else if ( temp->type==is_unicode ) { val = strtol(temp->arg,&end,16); if ( *end!='\0' || val<0 || val>65535 || info.glyph_unicode==NULL ) { fprintf( stderr, "Bad Unicode value %s\n", temp->arg); exit(1); } for ( i=0; i<info.glyph_cnt && info.glyph_unicode[i]!=val; ++i ); if ( i==info.glyph_cnt ) { for ( dup = info.dups; dup!=NULL && dup->enc!=val; dup = dup->prev ); if ( dup==NULL ) { fprintf( stderr, "This Unicode value %04X not encoded in this font\n", val ); exit(1); } i = dup->glyph; } val = i; } else if ( temp->type==is_name ) { val = name2glyph(temp->arg,&info); } DumpGlyph(ttf,&info,val); } } return( 0 ); }
the_stack_data/151705319.c
// stdarc.c // - rlyeh, public domain #ifndef STDARC_H #define STDARC_H #define STDARC_VERSION "v1.0.0" #endif #ifdef STDARC_C #pragma once #define ZIP_C #define TAR_C #define PAK_C #define VFS_C #define DIR_C #endif #line 1 "src/zip.c" // zip un/packer. based on JUnzip library by Joonas Pihlajamaa (UNLICENSE) // - rlyeh, public domain. // // notes about compression_level: // - plain integers use DEFLATE. Levels are [0(store)..6(default)..9(max)] // - stdarc compressor flags are also supported. Just use LZMA|5, ULZ|9, LZ4X|3, etc. // - see zip_put.c for more info. // //@todo: +w) int zip_append(zip*, const char *entryname, const void *buf, unsigned buflen); //@todo: +w) int zip_append_mem(zip*, const char *entryname, const void *buf, unsigned buflen, unsigned compr_level); #ifndef ZIP_H #define ZIP_H #include <stdio.h> #include <stdbool.h> typedef struct zip zip; zip* zip_open(const char *file, const char *mode /*r,w,a*/); // only for (w)rite or (a)ppend mode bool zip_append_file(zip*, const char *entryname, FILE *in, unsigned compr_level); // only for (r)ead mode int zip_find(zip*, const char *entryname); // convert entry to index. returns <0 if not found. unsigned zip_count(zip*); char* zip_name(zip*, unsigned index); char* zip_modt(zip*, unsigned index); unsigned zip_size(zip*, unsigned index); unsigned zip_hash(zip*, unsigned index); bool zip_file(zip*, unsigned index); // is_file? (dir if name ends with '/'; file otherwise) bool zip_test(zip*, unsigned index); unsigned zip_codec(zip*, unsigned index); unsigned zip_offset(zip*, unsigned index); void* zip_extract(zip*, unsigned index); // must free() after use bool zip_extract_file(zip*, unsigned index, FILE *out); unsigned zip_extract_data(zip*, unsigned index, void *out, unsigned outlen); void zip_close(zip*); #endif // ZIP_H // ----------------------------------------------------------------------------- #ifdef ZIP_C #pragma once #include <stdint.h> #include <stdlib.h> #include <string.h> #include <sys/stat.h> #include <time.h> #ifndef REALLOC #define REALLOC realloc #endif #ifndef STRDUP #define STRDUP strdup #endif #ifndef FPRINTF #define FPRINTF(...) ((void)0) // printf for error logging #endif #ifndef PRINTF #define PRINTF(...) ((void)0) // printf for debugging #endif #ifndef ERR #define ERR(NUM, ...) (FPRINTF(stderr, "" __VA_ARGS__), FPRINTF(stderr, "(%s:%d)\n", __FILE__, __LINE__), /*fflush(stderr),*/ (NUM)) // (NUM) #endif #ifndef COMPRESS #define COMPRESS(...) ((unsigned)0) #endif #ifndef DECOMPRESS #define DECOMPRESS(...) ((unsigned)0) #endif #ifndef BOUNDS #define BOUNDS(...) ((unsigned)0) #endif #ifdef STDPACK_H #undef COMPRESS #undef DECOMPRESS #undef BOUNDS static unsigned COMPRESS(const void *in, unsigned inlen, void *out, unsigned outlen, unsigned flags /*[0..1]*/) { return ( flags > 10 ? mem_encode : deflate_encode )(in, inlen, out, outlen, flags); } static unsigned DECOMPRESS(const void *in, unsigned inlen, void *out, unsigned outlen, unsigned flags) { return ( flags ? mem_decode : deflate_decode )(in, inlen, out, outlen); } static unsigned BOUNDS(unsigned inlen, unsigned flags) { return ( flags > 10 ? mem_bounds : deflate_bounds )(inlen, flags); } #elif defined DEFLATE_C #undef COMPRESS #undef DECOMPRESS #undef BOUNDS static unsigned COMPRESS(const void *in, unsigned inlen, void *out, unsigned outlen, unsigned flags /*[0..1]*/) { return deflate_encode(in, inlen, out, outlen, flags); } static unsigned DECOMPRESS(const void *in, unsigned inlen, void *out, unsigned outlen, unsigned flags) { return deflate_decode(in, inlen, out, outlen); } static unsigned BOUNDS(unsigned inlen, unsigned flags) { return deflate_bounds(inlen, flags); } #endif #pragma pack(push, 1) typedef struct { uint32_t signature; // 0x02014B50 uint16_t versionMadeBy; // unsupported uint16_t versionNeededToExtract; // unsupported uint16_t generalPurposeBitFlag; // unsupported uint16_t compressionMethod; // 0-store,8-deflate uint16_t lastModFileTime; uint16_t lastModFileDate; uint32_t crc32; uint32_t compressedSize; uint32_t uncompressedSize; uint16_t fileNameLength; uint16_t extraFieldLength; // unsupported uint16_t fileCommentLength; // unsupported uint16_t diskNumberStart; // unsupported uint16_t internalFileAttributes; // unsupported uint32_t externalFileAttributes; // unsupported uint32_t relativeOffsetOflocalHeader; } JZGlobalFileHeader; typedef struct { uint32_t signature; // 0x06054b50 uint16_t diskNumber; // unsupported uint16_t centralDirectoryDiskNumber; // unsupported uint16_t numEntriesThisDisk; // unsupported uint16_t numEntries; uint32_t centralDirectorySize; uint32_t centralDirectoryOffset; uint16_t zipCommentLength; // Followed by .ZIP file comment (variable size) } JZEndRecord; #pragma pack(pop) // Verifying that structs are correct sized... typedef int static_assert_sizeof_JZGlobalFileHeader[sizeof(JZGlobalFileHeader) == 46]; typedef int static_assert_sizeof_JZEndRecord[sizeof(JZEndRecord) == 22]; enum { sizeof_JZLocalFileHeader = 30 }; // Constants enum { JZ_OK = 0, JZ_ERRNO = -1, JZ_BUFFER_SIZE = 65536 }; // Callback prototype for central reading function. Returns Z_OK while done. typedef int (*JZRecordCallback)(FILE *fp, int index, JZGlobalFileHeader *header, char *filename, void *extra, char *comment, void *user_data); // Read ZIP file end record. Will move within file. Returns Z_OK, or error code int jzReadEndRecord(FILE *fp, JZEndRecord *endRecord) { long fileSize, readBytes, i; JZEndRecord *er; if(fseek(fp, 0, SEEK_END)) { return ERR(JZ_ERRNO, "Couldn't go to end of zip file!"); } if((fileSize = ftell(fp)) <= sizeof(JZEndRecord)) { return ERR(JZ_ERRNO, "Too small file to be a zip!"); } unsigned char jzBuffer[JZ_BUFFER_SIZE]; // maximum zip descriptor size readBytes = (fileSize < sizeof(jzBuffer)) ? fileSize : sizeof(jzBuffer); if(fseek(fp, fileSize - readBytes, SEEK_SET)) { return ERR(JZ_ERRNO, "Cannot seek in zip file!"); } if(fread(jzBuffer, 1, readBytes, fp) < readBytes) { return ERR(JZ_ERRNO, "Couldn't read end of zip file!"); } // Naively assume signature can only be found in one place... for(i = readBytes - sizeof(JZEndRecord); i >= 0; i--) { er = (JZEndRecord *)(jzBuffer + i); if(er->signature == 0x06054B50) break; } if(i < 0) { return ERR(JZ_ERRNO, "End record signature not found in zip!"); } memcpy(endRecord, er, sizeof(JZEndRecord)); JZEndRecord *e = endRecord; PRINTF("end)\n\tsignature: 0x%X\n", e->signature ); // 0x06054b50 PRINTF("\tdiskNumber: %d\n", e->diskNumber ); // unsupported PRINTF("\tcentralDirectoryDiskNumber: %d\n", e->centralDirectoryDiskNumber ); // unsupported PRINTF("\tnumEntriesThisDisk: %d\n", e->numEntriesThisDisk ); // unsupported PRINTF("\tnumEntries: %d\n", e->numEntries ); PRINTF("\tcentralDirectorySize: %u %#x\n", e->centralDirectorySize, e->centralDirectorySize ); PRINTF("\tcentralDirectoryOffset: %u %#x\n", e->centralDirectoryOffset, e->centralDirectoryOffset ); PRINTF("\tzipCommentLength: %d\n---\n", e->zipCommentLength ); if(endRecord->diskNumber || endRecord->centralDirectoryDiskNumber || endRecord->numEntries != endRecord->numEntriesThisDisk) { return ERR(JZ_ERRNO, "Multifile zips not supported!"); } return JZ_OK; } // Read ZIP file global directory. Will move within file. Returns Z_OK, or error code // Callback is called for each record, until callback returns zero int jzReadCentralDirectory(FILE *fp, JZEndRecord *endRecord, JZRecordCallback callback, void *user_data) { JZGlobalFileHeader fileHeader; if(fseek(fp, endRecord->centralDirectoryOffset, SEEK_SET)) { return ERR(JZ_ERRNO, "Cannot seek in zip file!"); } for(int i=0; i<endRecord->numEntries; i++) { PRINTF("%d)\n@-> %lu %#lx\n", i+1, (unsigned long)ftell(fp), (unsigned long)ftell(fp)); long offset = ftell(fp); // store current position if(fread(&fileHeader, 1, sizeof(JZGlobalFileHeader), fp) < sizeof(JZGlobalFileHeader)) { return ERR(JZ_ERRNO, "Couldn't read file header #%d!", i); } JZGlobalFileHeader *g = &fileHeader, copy = *g; PRINTF("\tsignature: %u %#x\n", g->signature, g->signature); // 0x02014B50 PRINTF("\tversionMadeBy: %u %#x\n", g->versionMadeBy, g->versionMadeBy); // unsupported PRINTF("\tversionNeededToExtract: %u %#x\n", g->versionNeededToExtract, g->versionNeededToExtract); // unsupported PRINTF("\tgeneralPurposeBitFlag: %u %#x\n", g->generalPurposeBitFlag, g->generalPurposeBitFlag); // unsupported PRINTF("\tcompressionMethod: %u %#x\n", g->compressionMethod, g->compressionMethod); // 0-store,8-deflate PRINTF("\tlastModFileTime: %u %#x\n", g->lastModFileTime, g->lastModFileTime); PRINTF("\tlastModFileDate: %u %#x\n", g->lastModFileDate, g->lastModFileDate); PRINTF("\tcrc32: %#x\n", g->crc32); PRINTF("\tcompressedSize: %u\n", g->compressedSize); PRINTF("\tuncompressedSize: %u\n", g->uncompressedSize); PRINTF("\tfileNameLength: %u\n", g->fileNameLength); PRINTF("\textraFieldLength: %u\n", g->extraFieldLength); // unsupported PRINTF("\tfileCommentLength: %u\n", g->fileCommentLength); // unsupported PRINTF("\tdiskNumberStart: %u\n", g->diskNumberStart); // unsupported PRINTF("\tinternalFileAttributes: %#x\n", g->internalFileAttributes); // unsupported PRINTF("\texternalFileAttributes: %#x\n", g->externalFileAttributes); // unsupported PRINTF("\trelativeOffsetOflocalHeader: %u %#x\n", g->relativeOffsetOflocalHeader, g->relativeOffsetOflocalHeader); if(fileHeader.signature != 0x02014B50) { return ERR(JZ_ERRNO, "Invalid file header signature %#x #%d!", fileHeader.signature, i); } if(fileHeader.fileNameLength + 1 >= JZ_BUFFER_SIZE) { return ERR(JZ_ERRNO, "Too long file name %u #%d!", fileHeader.fileNameLength, i); } // filename char jzFilename[JZ_BUFFER_SIZE/3]; if(fread(jzFilename, 1, fileHeader.fileNameLength, fp) < fileHeader.fileNameLength) { return ERR(JZ_ERRNO, "Couldn't read filename #%d!", i); } jzFilename[fileHeader.fileNameLength] = '\0'; // NULL terminate // extra block unsigned char jzExtra[JZ_BUFFER_SIZE/3]; if(fread(jzExtra, 1, fileHeader.extraFieldLength, fp) < fileHeader.extraFieldLength) { return ERR(JZ_ERRNO, "Couldn't read extra block #%d!", i); } // comment block char jzComment[JZ_BUFFER_SIZE/3]; if(fread(jzComment, 1, fileHeader.fileCommentLength, fp) < fileHeader.fileCommentLength) { return ERR(JZ_ERRNO, "Couldn't read comment block #%d!", i); } jzComment[fileHeader.fileCommentLength] = '\0'; // NULL terminate // seek to local file header, then skip file header + filename + extra field length if(fseek(fp, fileHeader.relativeOffsetOflocalHeader + sizeof_JZLocalFileHeader - 2 - 2, SEEK_SET)) { return ERR(JZ_ERRNO, "Cannot seek in file!"); } if(fread(&fileHeader.fileNameLength, 1, 2, fp) < 2) { return ERR(JZ_ERRNO, "Couldn't read local filename #%d!", i); } if(fread(&fileHeader.extraFieldLength, 1, 2, fp) < 2) { return ERR(JZ_ERRNO, "Couldn't read local extrafield #%d!", i); } if(fseek(fp, fileHeader.relativeOffsetOflocalHeader + sizeof_JZLocalFileHeader + fileHeader.fileNameLength + fileHeader.extraFieldLength, SEEK_SET)) { return ERR(JZ_ERRNO, "Cannot seek in file!"); } PRINTF("@-> %lu %#lx\n---\n", (unsigned long)ftell(fp), (unsigned long)ftell(fp)); if( JZ_OK != callback(fp, i, &fileHeader, jzFilename, jzExtra, jzComment, user_data) ) break; // keep going while callback returns ok fseek(fp, offset, SEEK_SET); // return to position fseek(fp, sizeof(JZGlobalFileHeader) + copy.fileNameLength, SEEK_CUR); // skip entry fseek(fp, copy.extraFieldLength + copy.fileCommentLength, SEEK_CUR); // skip entry } return JZ_OK; } // Read data from file stream, described by header, to preallocated buffer. Returns Z_OK, or error code int jzReadData(FILE *fp, JZGlobalFileHeader *header, void *out) { if(header->compressionMethod == 0) { // Store - just read it if(fread(out, 1, header->uncompressedSize, fp) < header->uncompressedSize || ferror(fp)) return JZ_ERRNO; } else if((header->compressionMethod & 255) == 8) { // Deflate uint16_t level = header->compressionMethod >> 8; unsigned outlen = header->uncompressedSize; unsigned inlen = header->compressedSize; void *in = REALLOC(0, inlen); if(in == NULL) return ERR(JZ_ERRNO, "Could not allocate mem for decompress"); unsigned read = fread(in, 1, inlen, fp); if(read != inlen) return ERR(JZ_ERRNO, "Could not read file"); // TODO: more robust read loop unsigned ret = DECOMPRESS(in, inlen, out, outlen, level); REALLOC(in, 0); if(!ret) return ERR(JZ_ERRNO, "Could not decompress"); } else { return JZ_ERRNO; } return JZ_OK; } #define JZHOUR(t) ((t)>>11) #define JZMINUTE(t) (((t)>>5) & 63) #define JZSECOND(t) (((t) & 31) * 2) #define JZTIME(h,m,s) (((h)<<11) + ((m)<<5) + (s)/2) #define JZYEAR(t) (((t)>>9) + 1980) #define JZMONTH(t) (((t)>>5) & 15) #define JZDAY(t) ((t) & 31) #define JZDATE(y,m,d) ((((y)-1980)<<9) + ((m)<<5) + (d)) // end of junzip.c --- struct zip { FILE *in, *out; struct zip_entry { JZGlobalFileHeader header; char timestamp[20]; char *filename; uint64_t offset; void *extra; char *comment; } *entries; unsigned count; }; uint32_t zip__crc32(uint32_t crc, const void *data, size_t n_bytes) { // CRC32 routine is from Björn Samuelsson's public domain implementation at http://home.thep.lu.se/~bjorn/crc/ static uint32_t table[256] = {0}; if(!*table) for(uint32_t i = 0; i < 0x100; ++i) { uint32_t r = i; for(int j = 0; j < 8; ++j) r = (r & 1 ? 0 : (uint32_t)0xEDB88320L) ^ r >> 1; table[i] = r ^ (uint32_t)0xFF000000L; } for(size_t i = 0; i < n_bytes; ++i) { crc = table[(uint8_t)crc ^ ((uint8_t*)data)[i]] ^ crc >> 8; } return crc; } int zip__callback(FILE *fp, int idx, JZGlobalFileHeader *header, char *filename, void *extra, char *comment, void *user_data) { zip *z = user_data; unsigned index = z->count; z->entries = REALLOC(z->entries, (++z->count) * sizeof(struct zip_entry) ); struct zip_entry *e = &z->entries[index]; e->header = *header; e->filename = STRDUP(filename); e->offset = ftell(fp); e->extra = REALLOC(0, header->extraFieldLength); memcpy(e->extra, extra, header->extraFieldLength); e->comment = STRDUP(comment); snprintf(e->timestamp, sizeof(e->timestamp), "%04d/%02d/%02d %02d:%02d:%02d", JZYEAR(header->lastModFileDate), JZMONTH(header->lastModFileDate), JZDAY(header->lastModFileDate), JZHOUR(header->lastModFileTime), JZMINUTE(header->lastModFileTime), JZSECOND(header->lastModFileTime)); return JZ_OK; } // zip read int zip_find(zip *z, const char *entryname) { if( z->in ) for( int i = z->count; --i >= 0; ) { // in case of several copies, grab most recent file (last coincidence) if( 0 == strcmp(entryname, z->entries[i].filename)) return i; } return -1; } bool zip_file(zip *z, unsigned index) { // is_file? (dir if attrib&15 or name ends with '/'; file otherwise) if( z->in && index < z->count ) { char *name = zip_name(z, index); return (name[ strlen(name) ] != '/') && !(z->entries[index].header.externalFileAttributes & 0x10); } return 0; } unsigned zip_count(zip *z) { return z->in ? z->count : 0; } unsigned zip_hash(zip *z, unsigned index) { return z->in && index < z->count ? z->entries[index].header.crc32 : 0; } char *zip_modt(zip *z, unsigned index) { return z->in && index < z->count ? z->entries[index].timestamp : 0; } char *zip_name(zip *z, unsigned index) { return z->in && index < z->count ? z->entries[index].filename : NULL; } unsigned zip_size(zip *z, unsigned index) { return z->in && index < z->count ? z->entries[index].header.uncompressedSize : 0; } unsigned zip_offset(zip *z, unsigned index) { return z->in && index < z->count ? z->entries[index].offset : 0; } unsigned zip_codec(zip *z, unsigned index) { if( z->in && index < z->count ) { unsigned cm = z->entries[index].header.compressionMethod; return cm < 255 ? cm : cm >> 8; } return 0; } unsigned zip_extract_data(zip* z, unsigned index, void *out, unsigned outlen) { if( z->in && index < z->count ) { JZGlobalFileHeader *header = &(z->entries[index].header); if( outlen <= header->uncompressedSize ) { fseek(z->in, z->entries[index].offset, SEEK_SET); int ret = jzReadData(z->in, header, (char*)out); return ret == JZ_OK ? header->uncompressedSize : 0; } } return 0; } void *zip_extract(zip *z, unsigned index) { // must free() if( z->in && index < z->count ) { unsigned outlen = (unsigned)z->entries[index].header.uncompressedSize; void *out = (char*)REALLOC(0, outlen); unsigned ret = zip_extract_data(z, index, out, outlen); return ret ? out : (REALLOC(out, 0), out = 0); } return NULL; } bool zip_extract_file(zip* z, unsigned index, FILE *out) { void *data = zip_extract(z, index); if( !data ) return false; unsigned datalen = (unsigned)z->entries[index].header.uncompressedSize; bool ok = fwrite(data, 1, datalen, out) == datalen; REALLOC( data, 0 ); return ok; } bool zip_test(zip *z, unsigned index) { void *ret = zip_extract(z, index); bool ok = !!ret; REALLOC(ret, 0); return ok; } // zip append/write bool zip_append_file(zip *z, const char *entryname, FILE *in, unsigned compress_level) { if( !in ) return ERR(false, "No input file provided"); if( !entryname ) return ERR(false, "No filename provided"); struct stat st; struct tm *timeinfo; stat(entryname, &st); timeinfo = localtime(&st.st_mtime); uint32_t crc = 0; unsigned char buf[1<<15]; while(!feof(in) && !ferror(in)) crc = zip__crc32(crc, buf, fread(buf, 1, sizeof(buf), in)); if(ferror(in)) return ERR(false, "Error while calculating CRC, skipping store."); unsigned index = z->count; z->entries = REALLOC(z->entries, (++z->count) * sizeof(struct zip_entry)); if(z->entries == NULL) return ERR(false, "Failed to allocate new entry!"); struct zip_entry *e = &z->entries[index], zero = {0}; *e = zero; e->filename = STRDUP(entryname); e->header.signature = 0x02014B50; e->header.versionMadeBy = 10; // random stuff e->header.versionNeededToExtract = 10; e->header.generalPurposeBitFlag = 0; e->header.lastModFileTime = JZTIME(timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec); e->header.lastModFileDate = JZDATE(timeinfo->tm_year+1900,timeinfo->tm_mon+1,timeinfo->tm_mday); e->header.crc32 = crc; e->header.uncompressedSize = ftell(in); e->header.fileNameLength = strlen(entryname); e->header.extraFieldLength = 0; e->header.fileCommentLength = 0; e->header.diskNumberStart = 0; e->header.internalFileAttributes = 0; e->header.externalFileAttributes = 0x20; // whatever this is e->header.relativeOffsetOflocalHeader = ftell(z->out); if(!compress_level) goto dont_compress; // Read whole file and and use compress(). Simple but won't handle GB files well. unsigned dataSize = e->header.uncompressedSize, compSize = BOUNDS(e->header.uncompressedSize, compress_level); void *comp = 0, *data = 0; comp = REALLOC(0, compSize); if(comp == NULL) goto cant_compress; data = REALLOC(0, dataSize); if(data == NULL) goto cant_compress; fseek(in, 0, SEEK_SET); // rewind size_t bytes = fread(data, 1, dataSize, in); if(bytes != dataSize) { return ERR(false, "Failed to read file in full (%lu vs. %ld bytes)", (unsigned long)bytes, dataSize); } compSize = COMPRESS(data, (unsigned)dataSize, comp, (unsigned)compSize, compress_level); if(!compSize) goto cant_compress; if(compSize >= (dataSize * 0.98) ) goto dont_compress; uint16_t cl = 8 | (compress_level > 10 ? compress_level << 8 : 0); e->header.compressedSize = compSize; e->header.compressionMethod = cl; goto common; cant_compress: dont_compress:; e->header.compressedSize = ftell(in); e->header.compressionMethod = 0; // store method common:; // write local header uint32_t signature = 0x04034B50; fwrite(&signature, 1, sizeof(signature), z->out); fwrite(&(e->header.versionNeededToExtract), 1, sizeof_JZLocalFileHeader - sizeof(signature), z->out); // write filename fwrite(entryname, 1, strlen(entryname), z->out); if(e->header.compressionMethod) { // store compressed blob fwrite(comp, compSize, 1, z->out); } else { // store uncompressed blob fseek(in, 0, SEEK_SET); while(!feof(in) && !ferror(in)) { size_t bytes = fread(buf, 1, sizeof(buf), in); fwrite(buf, 1, bytes, z->out); } } REALLOC(comp, 0); REALLOC(data, 0); return true; } // zip common zip* zip_open(const char *file, const char *mode /*r,w,a*/) { struct stat buffer; int exists = (stat(file, &buffer) == 0); if( mode[0] == 'a' && !exists ) mode = "wb"; FILE *fp = fopen(file, mode[0] == 'w' ? "wb" : mode[0] == 'a' ? "a+b" : "rb"); if( !fp ) return ERR(NULL, "cannot open file for %s mode", mode); zip zero = {0}, *z = (zip*)REALLOC(0, sizeof(zip)); if( !z ) return ERR(NULL, "out of mem"); else *z = zero; if( mode[0] == 'w' ) { z->out = fp; return z; } if( mode[0] == 'r' || mode[0] == 'a' ) { z->in = fp; JZEndRecord jzEndRecord = {0}; if(jzReadEndRecord(fp, &jzEndRecord) != JZ_OK) { REALLOC(z, 0); return ERR(NULL, "Couldn't read ZIP file end record."); } if(jzReadCentralDirectory(fp, &jzEndRecord, zip__callback, z) != JZ_OK) { REALLOC(z, 0); return ERR(NULL, "Couldn't read ZIP file central directory."); } if( mode[0] == 'a' ) { // resize (by truncation) size_t resize = jzEndRecord.centralDirectoryOffset; int fd = fileno(fp); if( fd != -1 ) { #ifdef _WIN32 int ok = 0 == _chsize_s( fd, resize ); #else int ok = 0 == ftruncate( fd, (off_t)resize ); #endif fflush(fp); fseek( fp, 0L, SEEK_END ); } z->in = NULL; z->out = fp; } return z; } REALLOC(z, 0); return ERR(NULL, "Unknown open mode %s", mode); } void zip_close(zip* z) { if( z->out && z->count ) { // prepare end record JZEndRecord end = {0}; end.signature = 0x06054b50; end.diskNumber = 0; end.centralDirectoryDiskNumber = 0; end.numEntriesThisDisk = z->count; end.numEntries = z->count; end.centralDirectoryOffset = ftell(z->out); // flush global directory: global file+filename each for(unsigned i = 0; i < z->count; i++) { struct zip_entry *h = &z->entries[i]; JZGlobalFileHeader *g = &h->header; fwrite(g, 1, sizeof(JZGlobalFileHeader), z->out); fwrite(h->filename, 1, g->fileNameLength, z->out); fwrite(h->extra, 1, g->extraFieldLength, z->out); fwrite(h->comment, 1, g->fileCommentLength, z->out); } end.centralDirectorySize = ftell(z->out) - end.centralDirectoryOffset; end.zipCommentLength = 0; // flush end record fwrite(&end, 1, sizeof(end), z->out); } if( z->out ) fclose(z->out); if( z->in ) fclose(z->in); // clean up for(unsigned i = 0; i < z->count; ++i ) { REALLOC(z->entries[i].filename, 0); if(z->entries[i].extra) REALLOC(z->entries[i].extra, 0); if(z->entries[i].comment) REALLOC(z->entries[i].comment, 0); } if(z->entries) REALLOC(z->entries, 0); zip zero = {0}; *z = zero; REALLOC(z, 0); } #endif // ZIP_C #line 1 "src/tar.c" // gnu tar and ustar extraction // - rlyeh, public domain. #ifndef TAR_H #define TAR_H typedef struct tar tar; tar *tar_open(const char *filename, const char *mode); int tar_find(tar*, const char *entryname); // returns entry number; or <0 if not found. unsigned tar_count(tar*); char* tar_name(tar*, unsigned index); unsigned tar_size(tar*, unsigned index); unsigned tar_offset(tar*, unsigned index); void* tar_extract(tar*, unsigned index); // must free() after use void tar_close(tar *t); #endif // ----------------------------------------------------------------------------- #ifdef TAR_C #pragma once #include <stdint.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #ifndef STRDUP #define STRDUP strdup #endif #ifndef REALLOC #define REALLOC realloc #endif #ifndef ERR #define ERR(NUM, ...) (fprintf(stderr, "" __VA_ARGS__), fprintf(stderr, "(%s:%d)\n", __FILE__, __LINE__), fflush(stderr), (NUM)) // (NUM) #endif struct tar { FILE *in; unsigned count; struct tar_entry { char *filename; unsigned size; size_t offset; } *entries; }; // equivalent to sscanf(buf, 8, "%.7o", &size); or (12, "%.11o", &modtime) // ignores everything after first null or space, including trailing bytes uint64_t tar__octal( const char *src, const char *eof ) { uint64_t sum = 0, mul = 1; const char *ptr = eof; while( ptr-- >= src ) eof = ( 0 != ptr[1] && 32 != ptr[1] ) ? eof : ptr; while( eof-- >= src ) sum += (uint8_t)(eof[1] - '0') * mul, mul *= 8; return sum; } typedef int (*tar_callback)(const char *filename, unsigned inlen, size_t offset, void *userdata); int tar__push_entry(const char *filename, unsigned inlen, size_t offset, void *userdata) { tar *t = (tar *)userdata; unsigned index = t->count; t->entries = REALLOC(t->entries, (++t->count) * sizeof(struct tar_entry)); struct tar_entry *e = &t->entries[index]; e->filename = STRDUP(filename); e->size = inlen; e->offset = offset; return 1; } int tar__parse( FILE *in, tar_callback yield, void *userdata ) { enum { name = 0, // (null terminated) mode = 100, // (octal) uid = 108, // (octal) gid = 116, // (octal) size = 124, // (octal) modtime = 136, // (octal) checksum = 148, // (octal) type = 156, // \0|'0':file,1:hardlink,2:symlink,3:chardev,4:blockdev,5:dir,6:fifo,L:longnameblocknext linkname = 157, // if !ustar link indicator magic = 257, // if ustar "ustar" -- 6th character may be space or null, else zero version = 263, // if ustar "00", else zero uname = 265, // if ustar owner username, else zero gname = 297, // if ustar owner groupname, else zero devmajor = 329, // if ustar device major number, else zero devminor = 337, // if ustar device minor number , else zero path = 345, // if ustar filename prefix, else zero padding = 500, // if ustar relevant for checksum, else zero total = 512 }; // handle both regular tar and ustar tar filenames until end of tar is found char header[512], entry[512], blank[512] = {0}; while( !ferror(in) ) { if( 512 != fread(header, 1, 512, in ) ) break; if( memcmp( header, blank, 512 ) ) { // if not end of tar if( !memcmp( header+magic, "ustar", 5 ) ) { // if valid ustar int namelen = strlen(header+name), pathlen = strlen(header+path); // read filename snprintf(entry, 512, "%.*s" "%s" "%.*s", pathlen < 155 ? pathlen : 155, header+path, pathlen ? "/" : "", namelen < 100 ? namelen : 100, header+name ); switch( header[type] ) { default: // unsupported file type break; case '5': //yield(entry.back()!='/'?entry+'/':entry,0);// directory break; case 'L': strcpy(entry, header+name); fread(header,1,512,in); // gnu tar long filename break; case '0': case 0: { // regular file uint64_t len = tar__octal(header+size, header+modtime); // decode octal size int cont = yield(entry, len, ftell(in), userdata); // yield entry fseek(in,len,SEEK_CUR); // skip blob fseek(in,(512 - (len & 511)) & 511,SEEK_CUR); // skip padding } } } else return ERR(0, "not a .tar file"); } else return ferror(in) ? ERR(0, "file error") : 1; } return ERR(0, "read error"); } // --- tar *tar_open(const char *filename, const char *mode) { if(mode[0] != 'r') return ERR(NULL, "(w) and (a) not supported for now"); FILE *in = fopen(filename, "rb"); if(!in) return ERR(NULL, "cant open file '%s' for reading", filename); tar zero = {0}, *t = REALLOC(0, sizeof(tar)); if( !t ) { fclose(in); return ERR(NULL, "out of mem"); } *t = zero; t->in = in; tar__parse(in, tar__push_entry, t); return t; } int tar_find(tar *t, const char *entryname) { if( t->in ) for( int i = t->count; --i >= 0; ) { // in case of several copies, grab most recent file (last coincidence) if( 0 == strcmp(entryname, t->entries[i].filename)) return i; } return -1; } unsigned tar_count(tar *t) { return t ? t->count : 0; } char* tar_name(tar *t, unsigned index) { return t && index < t->count ? t->entries[index].filename : 0; } unsigned tar_size(tar *t, unsigned index) { return t && index < t->count ? t->entries[index].size : 0; } unsigned tar_offset(tar *t, unsigned index) { return t && index < t->count ? (unsigned)t->entries[index].offset : 0; } void *tar_extract(tar *t, unsigned index) { if( t && index < t->count ) { fseek(t->in, t->entries[index].offset, SEEK_SET); size_t len = t->entries[index].size; void *data = REALLOC(0, t->entries[index].size); fread(data, 1, len, t->in); return data; } return 0; } void tar_close(tar *t) { fclose(t->in); for( int i = 0; i < t->count; ++i) { REALLOC(t->entries[i].filename, 0); } tar zero = {0}; *t = zero; REALLOC(t, 0); } #ifdef TAR_DEMO int main( int argc, char **argv ) { if(argc <= 1) exit(printf("%s file.tar [file_to_view]\n", argv[0])); tar *t = tar_open(argv[1], "rb"); if( t ) { for( int i = 0; i < tar_count(t); ++i ) { printf("%d) %s (%u bytes)\n", i+1, tar_name(t,i), tar_size(t,i)); char *data = tar_extract(t,i); if(argc>2) if(0==strcmp(argv[2],tar_name(t,i))) printf("%.*s\n", tar_size(t,i), data); free(data); } tar_close(t); } } #define main main__ #endif //TAR_DEMO #endif //TAR_C #line 1 "src/pak.c" // pak file reading/writing/appending. // - rlyeh, public domain. // // ## PAK // - [ref] https://quakewiki.org/wiki/.pak (public domain). // - Header: 12 bytes // - "PACK" 4-byte // - directory offset uint32 // - directory size uint32 (number of files by dividing this by 64, which is sizeof(pak_entry)) // // - File Directory Entry (Num files * 64 bytes) // - Each Directory Entry: 64 bytes // - file name 56-byte null-terminated string. Includes path. Example: "maps/e1m1.bsp". // - file offset uint32 from beginning of pak file. // - file size uint32 #ifndef PAK_H #define PAK_H typedef struct pak pak; pak* pak_open(const char *fname, const char *mode /*a,r,w*/); // (w)rite or (a)ppend modes only int pak_append_file(pak*, const char *filename, FILE *in); int pak_append_data(pak*, const char *filename, const void *in, unsigned inlen); // (r)ead only mode int pak_find(pak*,const char *fname); // return <0 if error; index otherwise. unsigned pak_count(pak*); unsigned pak_size(pak*,unsigned index); unsigned pak_offset(pak*, unsigned index); char *pak_name(pak*,unsigned index); void *pak_extract(pak*, unsigned index); // must free() after use void pak_close(pak*); #endif // --- #ifdef PAK_C #pragma once #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/stat.h> #ifndef REALLOC #define REALLOC realloc #endif #ifndef ERR #define ERR(NUM, ...) (fprintf(stderr, "" __VA_ARGS__), fprintf(stderr, "(%s:%d)\n", __FILE__, __LINE__), fflush(stderr), (NUM)) // (NUM) #endif #include <stdint.h> static inline uint32_t pak_swap32( uint32_t t ) { return (t >> 24) | (t << 24) | ((t >> 8) & 0xff00) | ((t & 0xff00) << 8); } #if defined(_M_IX86) || defined(_M_X64) // #ifdef LITTLE #define htob32(x) pak_swap32(x) #define btoh32(x) pak_swap32(x) #define htol32(x) (x) #define ltoh32(x) (x) #else #define htob32(x) (x) #define btoh32(x) (x) #define htol32(x) pak_swap32(x) #define ltoh32(x) pak_swap32(x) #endif #pragma pack(push, 1) typedef struct pak_header { char id[4]; uint32_t offset; uint32_t size; } pak_header; typedef struct pak_file { char name[56]; uint32_t offset; uint32_t size; } pak_file; #pragma pack(pop) typedef int static_assert_sizeof_pak_header[sizeof(pak_header) == 12]; typedef int static_assert_sizeof_pak_file[sizeof(pak_file) == 64]; typedef struct pak { FILE *in, *out; int dummy; pak_file *entries; unsigned count; } pak; pak *pak_open(const char *fname, const char *mode) { struct stat buffer; int exists = (stat(fname, &buffer) == 0); if(mode[0] == 'a' && !exists ) mode = "wb"; if(mode[0] != 'w' && mode[0] != 'r' && mode[0] != 'a') return NULL; FILE *fp = fopen(fname, mode[0] == 'w' ? "wb" : mode[0] == 'r' ? "rb" : "r+b"); if(!fp) return ERR(NULL, "cant open file '%s' in '%s' mode", fname, mode); pak *p = malloc(sizeof(pak)), zero = {0}; if(!p) return fclose(fp), ERR(NULL, "out of mem"); *p = zero; if( mode[0] == 'r' || mode[0] == 'a' ) { pak_header header = {0}; if( fread(&header, 1, sizeof(pak_header), fp) != sizeof(pak_header) ) { return fclose(fp), ERR(NULL, "read error"); } if( memcmp(header.id, "PACK", 4) ) { return fclose(fp), ERR(NULL, "not a .pak file"); } header.offset = ltoh32(header.offset); header.size = ltoh32(header.size); unsigned num_files = header.size / sizeof(pak_file); if( fseek(fp, header.offset, SEEK_SET) != 0 ) { return fclose(fp), ERR(NULL, "read error"); } p->count = num_files; p->entries = REALLOC(0, num_files * sizeof(pak_file)); if( fread(p->entries, num_files, sizeof(pak_file), fp) != sizeof(pak_file) ) { goto fail; } for( unsigned i = 0; i < num_files; ++i ) { pak_file *e = &p->entries[i]; e->offset = ltoh32(e->offset); e->size = ltoh32(e->size); } if( mode[0] == 'a' ) { // resize (by truncation) size_t resize = header.offset; int fd = fileno(fp); if( fd != -1 ) { #ifdef _WIN32 int ok = 0 == _chsize_s( fd, resize ); #else int ok = 0 == ftruncate( fd, (off_t)resize ); #endif fflush(fp); fseek( fp, 0L, SEEK_END ); } p->out = fp; p->in = NULL; } else { p->in = fp; } return p; } if(mode[0] == 'w') { p->out = fp; // write temporary header char header[12] = {0}; if( fwrite(header, 1,12, p->out) != 12) goto fail; return p; } fail:; if(fp) fclose(fp); if(p->entries) REALLOC(p->entries, 0); if(p) REALLOC(p, 0); return NULL; } int pak_append_data(pak *p, const char *filename, const void *in, unsigned inlen) { if(!p->out) return ERR(0, "read-only pak file"); // index meta unsigned index = p->count++; p->entries = REALLOC(p->entries, p->count * sizeof(pak_file)); pak_file *e = &p->entries[index], zero = {0}; *e = zero; snprintf(e->name, 55, "%s", filename); // @todo: verify 56 chars limit e->size = inlen; e->offset = ftell(p->out); // write blob fwrite(in, 1, inlen, p->out); return !ferror(p->out); } int pak_append_file(pak *p, const char *filename, FILE *in) { // index meta unsigned index = p->count++; p->entries = REALLOC(p->entries, p->count * sizeof(pak_file)); pak_file *e = &p->entries[index], zero = {0}; *e = zero; snprintf(e->name, 55, "%s", filename); // @todo: verify 56 chars limit e->offset = ftell(p->out); char buf[1<<15]; while(!feof(in) && !ferror(in)) { size_t bytes = fread(buf, 1, sizeof(buf), in); fwrite(buf, 1, bytes, p->out); } e->size = ftell(p->out) - e->offset; return !ferror(p->out); } void pak_close(pak *p) { if(p->out) { // write toc uint32_t seek = 0 + 12, dirpos = (uint32_t)ftell(p->out), dirlen = p->count * 64; for(unsigned i = 0; i < p->count; ++i) { pak_file *e = &p->entries[i]; // write name (truncated if needed), and trailing zeros char zero[56] = {0}; int namelen = strlen(e->name); fwrite( e->name, 1, namelen >= 56 ? 55 : namelen, p->out ); fwrite( zero, 1, namelen >= 56 ? 1 : 56 - namelen, p->out ); // write offset + length pair uint32_t pseek = htol32(seek); fwrite( &pseek, 1,4, p->out ); uint32_t psize = htol32(e->size); fwrite( &psize, 1,4, p->out ); seek += e->size; } // patch header fseek(p->out, 0L, SEEK_SET); fwrite("PACK", 1,4, p->out); dirpos = htol32(dirpos); fwrite( &dirpos, 1,4, p->out ); dirlen = htol32(dirlen); fwrite( &dirlen, 1,4, p->out ); } // close streams if(p->in) fclose(p->in); if(p->out) fclose(p->out); // clean up for(unsigned i = 0; i < p->count; ++i) { pak_file *e = &p->entries[i]; } REALLOC(p->entries, 0); // delete pak zero = {0}; *p = zero; REALLOC(p, 0); } int pak_find(pak *p, const char *filename) { if( p->in ) { for( int i = p->count; --i >= 0; ) { if(!strcmp(p->entries[i].name, filename)) return i; } } return -1; } unsigned pak_count(pak *p) { return p->in ? p->count : 0; } unsigned pak_offset(pak *p, unsigned index) { return p->in && index < p->count ? p->entries[index].offset : 0; } unsigned pak_size(pak *p, unsigned index) { return p->in && index < p->count ? p->entries[index].size : 0; } char *pak_name(pak *p, unsigned index) { return p->in && index < p->count ? p->entries[index].name : NULL; } void *pak_extract(pak *p, unsigned index) { if( p->in && index < p->count ) { pak_file *e = &p->entries[index]; if( fseek(p->in, e->offset, SEEK_SET) != 0 ) { return ERR(NULL, "cant seek"); } void *buffer = REALLOC(0, e->size); if( !buffer ) { return ERR(NULL, "out of mem"); } if( fread(buffer, 1, e->size, p->in) != e->size ) { REALLOC(buffer, 0); return ERR(NULL, "cant read"); } return buffer; } return NULL; } #ifdef PAK_DEMO int main(int argc, char **argv) { puts("creating test.pak archive (3) ..."); pak *p = pak_open("test.pak", "wb"); if( p ) { pak_append_data(p, "/index.txt", "just a file", strlen("just a file")); pak_append_data(p, "/file/name1.txt", "just another file #1", strlen("just another file #1")); pak_append_data(p, "/file/name2.txt", "just another file #2", strlen("just another file #2")); pak_close(p); } puts("appending file to test.pak (1) ..."); p = pak_open("test.pak", "a+b"); if( p ) { pak_append_data(p, "/new/file", "this is an appended file", strlen("this is an appended file")); pak_close(p); } const char *fname = argc > 1 ? argv[1] : "test.pak"; printf("listing %s archive ...\n", fname); p = pak_open(fname, "rb"); if( p ) { for( unsigned i = 0; i < pak_count(p); ++i ) { printf(" %d) @%08x %11u %s ", i+1, pak_offset(p,i), pak_size(p,i), pak_name(p,i)); void *data = pak_extract(p,i); printf("\r%c\n", data ? 'Y':'N'); if(argc > 2 && data) if(i == pak_find(p,argv[2])) printf("%.*s\n", (int)pak_size(p,i), (char*)data); free(data); } pak_close(p); } puts("ok"); } #endif // PAK_DEMO #endif // PAK_C #line 1 "src/vfs.c" // virtual filesystem (registered directories and/or compressed zip archives). // - rlyeh, public domain. // // - note: vfs_mount() order matters (the most recent the higher priority). void vfs_mount(const char *path); // zipfile or directory/with/trailing/slash/ char* vfs_load(const char *filename, int *size); // must free() after use // ----------------------------------------------------------------------------- #ifdef VFS_C #pragma once #include <stdio.h> #include <stdlib.h> #include <string.h> static char *vfs_read_file(const char *filename, int *len) { FILE *fp = fopen(filename, "rb"); if( fp ) { fseek(fp, 0L, SEEK_END); size_t sz = ftell(fp); fseek(fp, 0L, SEEK_SET); char *bin = REALLOC(0, sz+1); fread(bin,sz,1,fp); fclose(fp); bin[sz] = 0; if(len) *len = (int)sz; return bin; } return 0; } typedef struct vfs_dir { char* path; // const zip* archive; int is_directory; struct vfs_dir *next; } vfs_dir; static vfs_dir *dir_head = NULL; void vfs_mount(const char *path) { zip *z = NULL; int is_directory = ('/' == path[strlen(path)-1]); if( !is_directory ) z = zip_open(path, "rb"); if( !is_directory && !z ) return; vfs_dir *prev = dir_head, zero = {0}; *(dir_head = REALLOC(0, sizeof(vfs_dir))) = zero; dir_head->next = prev; dir_head->path = STRDUP(path); dir_head->archive = z; dir_head->is_directory = is_directory; } char *vfs_load(const char *filename, int *size) { // must free() after use char *data = NULL; for(vfs_dir *dir = dir_head; dir && !data; dir = dir->next) { if( dir->is_directory ) { char buf[512]; snprintf(buf, sizeof(buf), "%s%s", dir->path, filename); data = vfs_read_file(buf, size); } else { int index = zip_find(dir->archive, filename); data = zip_extract(dir->archive, index); if( size ) *size = zip_size(dir->archive, index); } // printf("%c trying %s in %s ...\n", data ? 'Y':'N', filename, dir->path); } return data; } #ifdef VFS_DEMO int main() { vfs_mount("../src/"); // directories/must/end/with/slash/ vfs_mount("demo.zip"); // zips supported printf("vfs.c file found? %s\n", vfs_load("vfs.c", 0) ? "Y":"N"); // should be Y printf("stdarc.c file found? %s\n", vfs_load("stdarc.c", 0) ? "Y":"N"); // should be N printf("demo_zip.c file found? %s\n", vfs_load("demo_zip.c", 0) ? "Y":"N"); // should be Y after running demo_zip.exe } #define main main__ #endif // VFS_DEMO #endif // VFS_C #line 1 "src/dir.c" // directory iteration. // - rlyeh, public domain. #ifndef DIR_H #define DIR_H typedef struct dir dir; dir *dir_open(const char *filename, const char *mode); // recursive 'r' int dir_find(dir*, const char *entryname); // returns entry number; or <0 if not found. unsigned dir_count(dir*); char* dir_name(dir*, unsigned index); unsigned dir_size(dir*, unsigned index); unsigned dir_file(dir*, unsigned index); // dir_isfile? bool? void* dir_read(dir*, unsigned index); // must free() after use void dir_close(dir*); #endif // ----------------------------------------------------------------------------- #ifdef DIR_C #pragma once #include <stdint.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <sys/stat.h> # if defined _WIN32 && defined(__TINYC__) #include <windows.h> // tcc #elif defined _WIN32 #include <winsock2.h> // msc+gcc #else #include <dirent.h> #endif #ifndef STRDUP #define STRDUP strdup #endif #ifndef REALLOC #define REALLOC realloc #endif #ifndef ERR #define ERR(NUM, ...) (fprintf(stderr, "" __VA_ARGS__), fprintf(stderr, "(%s:%d)\n", __FILE__, __LINE__), fflush(stderr), (NUM)) // (NUM) #endif typedef struct dir_entry { char *filename; size_t size; size_t is_dir : 1; } dir_entry; struct dir { dir_entry *entry; unsigned count; }; // --- #if !defined(S_ISDIR) # define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) #endif int dir_yield(dir *d, const char *pathfile, char *name, int namelen) { int ok = 0; #ifdef _WIN32 WIN32_FIND_DATAA fdata = { 0 }; snprintf(name, namelen, "%s/*", pathfile); for( HANDLE h = FindFirstFileA(name, &fdata ); h != INVALID_HANDLE_VALUE; (ok = FindClose( h ), h = INVALID_HANDLE_VALUE, 1)) { for( int next = 1; next; next = FindNextFileA(h, &fdata) != 0 ) { if( fdata.cFileName[0] == '.' ) continue; int is_dir = (fdata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) > 0; snprintf(name, namelen, "%s/%s%s", pathfile, fdata.cFileName, is_dir ? "/" : ""); struct stat st; if( !is_dir ) if(stat(name, &st) < 0) continue; // add dir_entry de = { STRDUP(name), is_dir ? 0 : st.st_size, is_dir }; d->entry = (dir_entry*)REALLOC(d->entry, ++d->count * sizeof(dir_entry)); d->entry[d->count-1] = de; } } #else snprintf(name, namelen, "%s/", pathfile); for( DIR *dir = opendir(name); dir; ok = (closedir(dir), dir = 0, 1)) { for( struct dirent *ep; ep = readdir(dir); ) { if( ep->d_name[0] == '.' ) continue; snprintf(name, namelen, "%s/%s", pathfile, ep->d_name); struct stat st; if( stat(name, &st) < 0 ) continue; DIR *tmp = opendir(ep->d_name); int is_dir = !!tmp; if(tmp) closedir(tmp); // if( is_dir && recursive ) { dir_yield(d,name); } // add dir_entry de = { STRDUP(name), is_dir ? 0 : st.st_size, is_dir }; d->entry = (dir_entry*)REALLOC(d->entry, ++d->count * sizeof(dir_entry)); d->entry[d->count-1] = de; } } #endif return ok; } dir *dir_open(const char *pathfile, const char *mode) { // if(mode[0] == 'R') return ERR(NULL, "(R) not supported for now"); dir *d = (dir*)REALLOC(0, sizeof(dir)), zero = {0}; *d = zero; char *clean = STRDUP( pathfile ); for( int i = 0; clean[i]; ++i ) if(clean[i] == '\\') clean[i] = '/'; for( int len = strlen(clean); clean[--len] == '/'; ) clean[len] = '\0'; char buffer[2048]; dir_yield(d, clean, buffer, 2048); REALLOC(clean, 0); return d; } int dir_find(dir *d, const char *entryname) { for( int i = d->count; --i >= 0; ) { // in case of several copies, grab most recent file (last coincidence) if( 0 == strcmp(entryname, d->entry[i].filename)) return i; } return -1; } unsigned dir_count(dir *d) { return d ? d->count : 0; } char* dir_name(dir *d, unsigned index) { return d && index < d->count ? d->entry[index].filename : 0; } unsigned dir_size(dir *d, unsigned index) { return d && index < d->count ? (unsigned)d->entry[index].size : 0; } unsigned dir_file(dir *d, unsigned index) { return d && index < d->count ? (unsigned)!d->entry[index].is_dir : 0; } void *dir_read(dir *d, unsigned index) { if( d && index < d->count ) { void *data = 0; for( FILE *fp = fopen(d->entry[index].filename, "rb"); fp; fclose(fp), fp = 0) { size_t len = d->entry[index].size; data = REALLOC(0, len); if( data && fread(data, 1, len, fp) != len ) { data = REALLOC(data, 0); } } return data; } return 0; } void dir_close(dir *d) { for( int i = 0; i < d->count; ++i) { REALLOC(d->entry[i].filename, 0); } dir zero = {0}; *d = zero; REALLOC(d, 0); } #ifdef DIR_DEMO int main( int argc, char **argv ) { dir *d = dir_open(argc > 1 ? argv[1] : "./", "rb"); if( d ) { for( int i = 0; i < dir_count(d); ++i ) { if( dir_file(d,i) ) printf("%3d) %11d %s\n", i + 1, dir_size(d,i), dir_name(d,i)); else printf("%3d) %11s %s\n", i + 1, "<dir>", dir_name(d,i)); char *data = dir_read(d,i); if(argc > 2 && !strcmp(argv[2],dir_name(d,i))) printf("%.*s\n", dir_size(d,i), data); free(data); } dir_close(d); } } #define main main__ #endif //DIR_DEMO #endif //DIR_C
the_stack_data/122015880.c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_putstr_non_printable.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: angmarti <[email protected]> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2021/08/17 18:35:21 by angmarti #+# #+# */ /* Updated: 2021/08/17 20:16:16 by angmarti ### ########.fr */ /* */ /* ************************************************************************** */ #include <unistd.h> void ft_putchar(char a) { write(1, &a, 1); } void ft_putdecimal_as_hexa(int d) { char *ptr; ptr = "0123456789abcdef"; if (d < 16) ft_putchar(ptr[d]); else if (d == 127) { ft_putchar('7'); ft_putchar('f'); } else { ft_putchar('1'); ft_putchar(ptr[d - 15]); } } void ft_putstr_non_printable(char *str) { int i; int decimal; i = -1; decimal = 0; while (str[++i]) { if (str[i] < 32 || str[i] == 127) { ft_putchar('\\'); decimal = str[i]; ft_putdecimal_as_hexa(decimal); } else ft_putchar(str[i]); } } // int main(void) // { // char str[] = "Coucou tu vas\tbien\n?"; // ft_putstr_non_printable(str); // }
the_stack_data/341065.c
/* PR tree-optimization/18046 */ /* { dg-options "-O2 -fdump-tree-optimized" } */ /* { dg-final { scan-tree-dump-times "switch" 1 "optimized" } } */ void foo (void); void bar (void); void baz (void); void test (int i) { switch (i) { case 1: foo (); break; case 2: bar (); break; default: break; } /* This switch should be gone after threading/VRP. */ switch (i) { case 1: foo (); break; case 2: baz (); break; default: break; } }
the_stack_data/101237.c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* rush00.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: aguiri <[email protected]> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2021/09/10 21:02:01 by aguiri #+# #+# */ /* Updated: 2021/09/10 23:33:06 by aguiri ### ########.fr */ /* */ /* ************************************************************************** */ void ft_putchar(char c); void ft_ifprint(const int x, const int y, const int n_x, const int n_y) { if (((n_x == 1 || n_x == x) && (n_y == 1 || n_y == y))) ft_putchar('o'); if (n_x == 1 || n_x == x) { if (n_y != 1 && n_y != y) ft_putchar('|'); } if (n_y == 1 || n_y == y) { if (n_x != 1 && n_x != x) ft_putchar('-'); } else ft_putchar(' '); } void rush(int x, int y) { int n_x; int n_y; n_y = 1; while (n_y <= y) { n_x = 1; while (n_x <= x) { ft_ifprint(x, y, n_x, n_y); n_x++; } ft_putchar('\n'); n_y++; } }
the_stack_data/81882.c
// https://codecast.france-ioi.org/v6/player?stepperControls=_undo,_redo,_expr,_out,_over&base=https%3A%2F%2Ffioi-recordings.s3.amazonaws.com%2Fdartmouth%2F1521483942971 #include <stdio.h> #include <stdlib.h> struct digit { int num; struct digit *next; }; struct digit *createDigit(int); struct digit *append(struct digit *end, struct digit *newDigptr); void printNumber(struct digit *); void freeNumber(struct digit *start); struct digit *readNumber(); int main(void) { //! stack = showMemory(start=65520) struct digit *start; printf("Please enter a number: "); start = readNumber(); printNumber(start); freeNumber(start); return 0; } struct digit *createDigit(int dig) { struct digit *ptr; ptr = (struct digit *)malloc(sizeof(struct digit)); ptr->num = dig; ptr->next = NULL; return ptr; } struct digit *append(struct digit *end, struct digit *newDigptr) { end->next = newDigptr; return (end->next); } void printNumber(struct digit *start) { struct digit *ptr = start; while (ptr != NULL) { printf("%d", ptr->num); ptr = ptr->next; } printf("\n"); } void freeNumber(struct digit *start) { struct digit *ptr = start; struct digit *tmp; while (ptr != NULL) { tmp = ptr->next; free(ptr); ptr = tmp; } } struct digit *readNumber() { //! heap=showMemory(start=309, cursors=[start, end, newptr]) char c; int d; struct digit *start, *end, *newptr; start = NULL; scanf("%c", &c); while (c != '\n') { d = c - 48; // character to number newptr = createDigit(d); if (start == NULL) { start = newptr; end = start; } else { end = append(end, newptr); } scanf("%c", &c); } return start; }
the_stack_data/126571.c
/// void f90_markovstsen_gs_dense_(int* n, double* Q, int* ldq, double* dQ, int* lddq, double* pis, int* incp, double* sstart, int* incss, double* s, int* incs, int* maxiter, double* rtol, int* steps, int* iter, double* rerror, int* info, void (*callback)(int*,double*)); void f90_markovstsen_gs_csr_(int* n, double* Q, int* rowptr0, int* colind0, int* nnz0, double* dQ, int* rowptr1, int* colind1, int* nnz1, double* pis, int* incp, double* sstart, int* incss, double* s, int* incs, int* maxiter, double* rtol, int* steps, int* iter, double* rerror, int* info, void (*callback)(int*,double*)); void f90_markovstsen_gs_csc_(int* n, double* Q, int* colptr0, int* rowind0, int* nnz0, double* dQ, int* colptr1, int* rowind1, int* nnz1, double* pis, int* incp, double* sstart, int* incss, double* s, int* incs, int* maxiter, double* rtol, int* steps, int* iter, double* rerror, int* info, void (*callback)(int*,double*)); /// void cc_markovstsen_gs_dense(int n, double* Q, int ldq, double* dQ, int lddq, double* pis, int incp, double* sstart, int incss, double* s, int incs, int maxiter, double rtol, int steps, int* iter, double* rerror, int* info, void (*callback)(int*,double*)) { f90_markovstsen_gs_dense_(&n, Q, &ldq, dQ, &lddq, pis, &incp, sstart, &incss, s, &incs, &maxiter, &rtol, &steps, iter, rerror, info, callback); } void cc_markovstsen_gs_csr(int n, double* Q, int* rowptr0, int* colind0, int nnz0, double* dQ, int* rowptr1, int* colind1, int nnz1, double* pis, int incp, double* sstart, int incss, double* s, int incs, int maxiter, double rtol, int steps, int* iter, double* rerror, int* info, void (*callback)(int*,double*)) { f90_markovstsen_gs_csr_(&n, Q, rowptr0, colind0, &nnz0, dQ, rowptr1, colind1, &nnz1, pis, &incp, sstart, &incss, s, &incs, &maxiter, &rtol, &steps, iter, rerror, info, callback); } void cc_markovstsen_gs_csc(int n, double* Q, int* colptr0, int* rowind0, int nnz0, double* dQ, int* colptr1, int* rowind1, int nnz1, double* pis, int incp, double* sstart, int incss, double* s, int incs, int maxiter, double rtol, int steps, int* iter, double* rerror, int* info, void (*callback)(int*,double*)) { f90_markovstsen_gs_csc_(&n, Q, colptr0, rowind0, &nnz0, dQ, colptr1, rowind1, &nnz1, pis, &incp, sstart, &incss, s, &incs, &maxiter, &rtol, &steps, iter, rerror, info, callback); }
the_stack_data/249398.c
#include <stdio.h> int month_to_i(char *month) { // Gets a valid 3-digit month code and returns an integer. if (month[0] == 'J') { if (month[1] == 'A') return 1; if (month[1] == 'U') { if (month[2] == 'N') return 6; if (month[2] == 'L') return 7; } } if (month[0] == 'F') return 2; if (month[0] == 'M') { if (month[2] == 'R') return 3; if (month[2] == 'Y') return 5; } if (month[0] == 'A') { if (month[1] == 'P') return 4; if (month[1] == 'U') return 8; } if (month[0] == 'S') return 9; if (month[0] == 'O') return 10; if (month[0] == 'N') return 11; if (month[0] == 'D') return 12; } int main(int argc, char *argv[]) { char *months[] = {"JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"}; int counter = 0; for (int i = 0; i < 1200000000; ++i) { ++counter; if (month_to_i(months[i % 12]) != (1 + i % 12)) { printf("%s - %d Failed.\n", months[i % 12], i); } } printf("%d\n", counter); return 0; }
the_stack_data/1076193.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; /* > \brief \b SORBDB1 */ /* =========== DOCUMENTATION =========== */ /* Online html documentation available at */ /* http://www.netlib.org/lapack/explore-html/ */ /* > \htmlonly */ /* > Download SORBDB1 + dependencies */ /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/sorbdb1 .f"> */ /* > [TGZ]</a> */ /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/sorbdb1 .f"> */ /* > [ZIP]</a> */ /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sorbdb1 .f"> */ /* > [TXT]</a> */ /* > \endhtmlonly */ /* Definition: */ /* =========== */ /* SUBROUTINE SORBDB1( M, P, Q, X11, LDX11, X21, LDX21, THETA, PHI, */ /* TAUP1, TAUP2, TAUQ1, WORK, LWORK, INFO ) */ /* INTEGER INFO, LWORK, M, P, Q, LDX11, LDX21 */ /* REAL PHI(*), THETA(*) */ /* REAL TAUP1(*), TAUP2(*), TAUQ1(*), WORK(*), */ /* $ X11(LDX11,*), X21(LDX21,*) */ /* > \par Purpose: */ /* ============= */ /* > */ /* >\verbatim */ /* > */ /* > SORBDB1 simultaneously bidiagonalizes the blocks of a tall and skinny */ /* > matrix X with orthonomal columns: */ /* > */ /* > [ B11 ] */ /* > [ X11 ] [ P1 | ] [ 0 ] */ /* > [-----] = [---------] [-----] Q1**T . */ /* > [ X21 ] [ | P2 ] [ B21 ] */ /* > [ 0 ] */ /* > */ /* > X11 is P-by-Q, and X21 is (M-P)-by-Q. Q must be no larger than P, */ /* > M-P, or M-Q. Routines SORBDB2, SORBDB3, and SORBDB4 handle cases in */ /* > which Q is not the minimum dimension. */ /* > */ /* > The orthogonal matrices P1, P2, and Q1 are P-by-P, (M-P)-by-(M-P), */ /* > and (M-Q)-by-(M-Q), respectively. They are represented implicitly by */ /* > Householder vectors. */ /* > */ /* > B11 and B12 are Q-by-Q bidiagonal matrices represented implicitly by */ /* > angles THETA, PHI. */ /* > */ /* >\endverbatim */ /* Arguments: */ /* ========== */ /* > \param[in] M */ /* > \verbatim */ /* > M is INTEGER */ /* > The number of rows X11 plus the number of rows in X21. */ /* > \endverbatim */ /* > */ /* > \param[in] P */ /* > \verbatim */ /* > P is INTEGER */ /* > The number of rows in X11. 0 <= P <= M. */ /* > \endverbatim */ /* > */ /* > \param[in] Q */ /* > \verbatim */ /* > Q is INTEGER */ /* > The number of columns in X11 and X21. 0 <= Q <= */ /* > MIN(P,M-P,M-Q). */ /* > \endverbatim */ /* > */ /* > \param[in,out] X11 */ /* > \verbatim */ /* > X11 is REAL array, dimension (LDX11,Q) */ /* > On entry, the top block of the matrix X to be reduced. On */ /* > exit, the columns of tril(X11) specify reflectors for P1 and */ /* > the rows of triu(X11,1) specify reflectors for Q1. */ /* > \endverbatim */ /* > */ /* > \param[in] LDX11 */ /* > \verbatim */ /* > LDX11 is INTEGER */ /* > The leading dimension of X11. LDX11 >= P. */ /* > \endverbatim */ /* > */ /* > \param[in,out] X21 */ /* > \verbatim */ /* > X21 is REAL array, dimension (LDX21,Q) */ /* > On entry, the bottom block of the matrix X to be reduced. On */ /* > exit, the columns of tril(X21) specify reflectors for P2. */ /* > \endverbatim */ /* > */ /* > \param[in] LDX21 */ /* > \verbatim */ /* > LDX21 is INTEGER */ /* > The leading dimension of X21. LDX21 >= M-P. */ /* > \endverbatim */ /* > */ /* > \param[out] THETA */ /* > \verbatim */ /* > THETA is REAL array, dimension (Q) */ /* > The entries of the bidiagonal blocks B11, B21 are defined by */ /* > THETA and PHI. See Further Details. */ /* > \endverbatim */ /* > */ /* > \param[out] PHI */ /* > \verbatim */ /* > PHI is REAL array, dimension (Q-1) */ /* > The entries of the bidiagonal blocks B11, B21 are defined by */ /* > THETA and PHI. See Further Details. */ /* > \endverbatim */ /* > */ /* > \param[out] TAUP1 */ /* > \verbatim */ /* > TAUP1 is REAL array, dimension (P) */ /* > The scalar factors of the elementary reflectors that define */ /* > P1. */ /* > \endverbatim */ /* > */ /* > \param[out] TAUP2 */ /* > \verbatim */ /* > TAUP2 is REAL array, dimension (M-P) */ /* > The scalar factors of the elementary reflectors that define */ /* > P2. */ /* > \endverbatim */ /* > */ /* > \param[out] TAUQ1 */ /* > \verbatim */ /* > TAUQ1 is REAL array, dimension (Q) */ /* > The scalar factors of the elementary reflectors that define */ /* > Q1. */ /* > \endverbatim */ /* > */ /* > \param[out] WORK */ /* > \verbatim */ /* > WORK is REAL array, dimension (LWORK) */ /* > \endverbatim */ /* > */ /* > \param[in] LWORK */ /* > \verbatim */ /* > LWORK is INTEGER */ /* > The dimension of the array WORK. LWORK >= M-Q. */ /* > */ /* > If LWORK = -1, then a workspace query is assumed; the routine */ /* > only calculates the optimal size of the WORK array, returns */ /* > this value as the first entry of the WORK array, and no error */ /* > message related to LWORK is issued by XERBLA. */ /* > \endverbatim */ /* > */ /* > \param[out] INFO */ /* > \verbatim */ /* > INFO is INTEGER */ /* > = 0: successful exit. */ /* > < 0: if INFO = -i, the i-th argument had an illegal value. */ /* > \endverbatim */ /* > */ /* Authors: */ /* ======== */ /* > \author Univ. of Tennessee */ /* > \author Univ. of California Berkeley */ /* > \author Univ. of Colorado Denver */ /* > \author NAG Ltd. */ /* > \date July 2012 */ /* > \ingroup realOTHERcomputational */ /* > \par Further Details: */ /* ===================== */ /* > */ /* > \verbatim */ /* > */ /* > The upper-bidiagonal blocks B11, B21 are represented implicitly by */ /* > angles THETA(1), ..., THETA(Q) and PHI(1), ..., PHI(Q-1). Every entry */ /* > in each bidiagonal band is a product of a sine or cosine of a THETA */ /* > with a sine or cosine of a PHI. See [1] or SORCSD for details. */ /* > */ /* > P1, P2, and Q1 are represented as products of elementary reflectors. */ /* > See SORCSD2BY1 for details on generating P1, P2, and Q1 using SORGQR */ /* > and SORGLQ. */ /* > \endverbatim */ /* > \par References: */ /* ================ */ /* > */ /* > [1] Brian D. Sutton. Computing the complete CS decomposition. Numer. */ /* > Algorithms, 50(1):33-65, 2009. */ /* > */ /* ===================================================================== */ /* Subroutine */ int sorbdb1_(integer *m, integer *p, integer *q, real *x11, integer *ldx11, real *x21, integer *ldx21, real *theta, real *phi, real *taup1, real *taup2, real *tauq1, real *work, integer *lwork, integer *info) { /* System generated locals */ integer x11_dim1, x11_offset, x21_dim1, x21_offset, i__1, i__2, i__3, i__4; real r__1, r__2; /* Local variables */ extern /* Subroutine */ int srot_(integer *, real *, integer *, real *, integer *, real *, real *); integer lworkmin, lworkopt; extern real snrm2_(integer *, real *, integer *); real c__; integer i__; real s; integer ilarf, llarf; extern /* Subroutine */ int slarf_(char *, integer *, integer *, real *, integer *, real *, real *, integer *, real *); integer childinfo; extern /* Subroutine */ int xerbla_(char *, integer *, ftnlen); logical lquery; integer iorbdb5, lorbdb5; extern /* Subroutine */ int sorbdb5_(integer *, integer *, integer *, real *, integer *, real *, integer *, real *, integer *, real *, integer *, real *, integer *, integer *), slarfgp_(integer *, real *, real *, integer *, real *); /* -- LAPACK computational routine (version 3.7.1) -- */ /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */ /* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */ /* July 2012 */ /* ==================================================================== */ /* Test input arguments */ /* Parameter adjustments */ x11_dim1 = *ldx11; x11_offset = 1 + x11_dim1 * 1; x11 -= x11_offset; x21_dim1 = *ldx21; x21_offset = 1 + x21_dim1 * 1; x21 -= x21_offset; --theta; --phi; --taup1; --taup2; --tauq1; --work; /* Function Body */ *info = 0; lquery = *lwork == -1; if (*m < 0) { *info = -1; } else if (*p < *q || *m - *p < *q) { *info = -2; } else if (*q < 0 || *m - *q < *q) { *info = -3; } else if (*ldx11 < f2cmax(1,*p)) { *info = -5; } else /* if(complicated condition) */ { /* Computing MAX */ i__1 = 1, i__2 = *m - *p; if (*ldx21 < f2cmax(i__1,i__2)) { *info = -7; } } /* Compute workspace */ if (*info == 0) { ilarf = 2; /* Computing MAX */ i__1 = *p - 1, i__2 = *m - *p - 1, i__1 = f2cmax(i__1,i__2), i__2 = *q - 1; llarf = f2cmax(i__1,i__2); iorbdb5 = 2; lorbdb5 = *q - 2; /* Computing MAX */ i__1 = ilarf + llarf - 1, i__2 = iorbdb5 + lorbdb5 - 1; lworkopt = f2cmax(i__1,i__2); lworkmin = lworkopt; work[1] = (real) lworkopt; if (*lwork < lworkmin && ! lquery) { *info = -14; } } if (*info != 0) { i__1 = -(*info); xerbla_("SORBDB1", &i__1, (ftnlen)7); return 0; } else if (lquery) { return 0; } /* Reduce columns 1, ..., Q of X11 and X21 */ i__1 = *q; for (i__ = 1; i__ <= i__1; ++i__) { i__2 = *p - i__ + 1; slarfgp_(&i__2, &x11[i__ + i__ * x11_dim1], &x11[i__ + 1 + i__ * x11_dim1], &c__1, &taup1[i__]); i__2 = *m - *p - i__ + 1; slarfgp_(&i__2, &x21[i__ + i__ * x21_dim1], &x21[i__ + 1 + i__ * x21_dim1], &c__1, &taup2[i__]); theta[i__] = atan2(x21[i__ + i__ * x21_dim1], x11[i__ + i__ * x11_dim1]); c__ = cos(theta[i__]); s = sin(theta[i__]); x11[i__ + i__ * x11_dim1] = 1.f; x21[i__ + i__ * x21_dim1] = 1.f; i__2 = *p - i__ + 1; i__3 = *q - i__; slarf_("L", &i__2, &i__3, &x11[i__ + i__ * x11_dim1], &c__1, &taup1[ i__], &x11[i__ + (i__ + 1) * x11_dim1], ldx11, &work[ilarf]); i__2 = *m - *p - i__ + 1; i__3 = *q - i__; slarf_("L", &i__2, &i__3, &x21[i__ + i__ * x21_dim1], &c__1, &taup2[ i__], &x21[i__ + (i__ + 1) * x21_dim1], ldx21, &work[ilarf]); if (i__ < *q) { i__2 = *q - i__; srot_(&i__2, &x11[i__ + (i__ + 1) * x11_dim1], ldx11, &x21[i__ + ( i__ + 1) * x21_dim1], ldx21, &c__, &s); i__2 = *q - i__; slarfgp_(&i__2, &x21[i__ + (i__ + 1) * x21_dim1], &x21[i__ + (i__ + 2) * x21_dim1], ldx21, &tauq1[i__]); s = x21[i__ + (i__ + 1) * x21_dim1]; x21[i__ + (i__ + 1) * x21_dim1] = 1.f; i__2 = *p - i__; i__3 = *q - i__; slarf_("R", &i__2, &i__3, &x21[i__ + (i__ + 1) * x21_dim1], ldx21, &tauq1[i__], &x11[i__ + 1 + (i__ + 1) * x11_dim1], ldx11, &work[ilarf]); i__2 = *m - *p - i__; i__3 = *q - i__; slarf_("R", &i__2, &i__3, &x21[i__ + (i__ + 1) * x21_dim1], ldx21, &tauq1[i__], &x21[i__ + 1 + (i__ + 1) * x21_dim1], ldx21, &work[ilarf]); i__2 = *p - i__; /* Computing 2nd power */ r__1 = snrm2_(&i__2, &x11[i__ + 1 + (i__ + 1) * x11_dim1], &c__1); i__3 = *m - *p - i__; /* Computing 2nd power */ r__2 = snrm2_(&i__3, &x21[i__ + 1 + (i__ + 1) * x21_dim1], &c__1); c__ = sqrt(r__1 * r__1 + r__2 * r__2); phi[i__] = atan2(s, c__); i__2 = *p - i__; i__3 = *m - *p - i__; i__4 = *q - i__ - 1; sorbdb5_(&i__2, &i__3, &i__4, &x11[i__ + 1 + (i__ + 1) * x11_dim1] , &c__1, &x21[i__ + 1 + (i__ + 1) * x21_dim1], &c__1, & x11[i__ + 1 + (i__ + 2) * x11_dim1], ldx11, &x21[i__ + 1 + (i__ + 2) * x21_dim1], ldx21, &work[iorbdb5], &lorbdb5, &childinfo); } } return 0; /* End of SORBDB1 */ } /* sorbdb1_ */
the_stack_data/721187.c
int main(){ int* i; int d; i = &d; *i = 123; return d+d; }
the_stack_data/92324513.c
/* Declarations for math functions. Copyright (C) 1991-1993,1995-1999,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ /* * ISO C99 Standard: 7.12 Mathematics <math.h> */ /* Copyright (C) 1991-1993,1995-2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ /* These are defined by the user (or the compiler) to specify the desired environment: __STRICT_ANSI__ ISO Standard C. _ISOC99_SOURCE Extensions to ISO C89 from ISO C99. _POSIX_SOURCE IEEE Std 1003.1. _POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2; if >=199309L, add IEEE Std 1003.1b-1993; if >=199506L, add IEEE Std 1003.1c-1995 _XOPEN_SOURCE Includes POSIX and XPG things. Set to 500 if Single Unix conformance is wanted, to 600 for the upcoming sixth revision. _XOPEN_SOURCE_EXTENDED XPG things and X/Open Unix extensions. _LARGEFILE_SOURCE Some more functions for correct standard I/O. _LARGEFILE64_SOURCE Additional functionality from LFS for large files. _FILE_OFFSET_BITS=N Select default filesystem interface. _BSD_SOURCE ISO C, POSIX, and 4.3BSD things. _SVID_SOURCE ISO C, POSIX, and SVID things. _GNU_SOURCE All of the above, plus GNU extensions. _REENTRANT Select additionally reentrant object. _THREAD_SAFE Same as _REENTRANT, often used by other systems. The `-ansi' switch to the GNU C compiler defines __STRICT_ANSI__. If none of these are defined, the default is to have _SVID_SOURCE, _BSD_SOURCE, and _POSIX_SOURCE set to one and _POSIX_C_SOURCE set to 199506L. If more than one of these are defined, they accumulate. For example __STRICT_ANSI__, _POSIX_SOURCE and _POSIX_C_SOURCE together give you ISO C, 1003.1, and 1003.2, but nothing else. These are defined by this file and are used by the header files to decide what to declare or define: __USE_ISOC99 Define ISO C99 things. __USE_POSIX Define IEEE Std 1003.1 things. __USE_POSIX2 Define IEEE Std 1003.2 things. __USE_POSIX199309 Define IEEE Std 1003.1, and .1b things. __USE_POSIX199506 Define IEEE Std 1003.1, .1b, .1c and .1i things. __USE_XOPEN Define XPG things. __USE_XOPEN_EXTENDED Define X/Open Unix things. __USE_UNIX98 Define Single Unix V2 things. __USE_XOPEN2K Define XPG6 things. __USE_LARGEFILE Define correct standard I/O things. __USE_LARGEFILE64 Define LFS things with separate names. __USE_FILE_OFFSET64 Define 64bit interface as default. __USE_BSD Define 4.3BSD things. __USE_SVID Define SVID things. __USE_MISC Define things common to BSD and System V Unix. __USE_GNU Define GNU extensions. __USE_REENTRANT Define reentrant/thread-safe *_r functions. __FAVOR_BSD Favor 4.3BSD things in cases of conflict. The macros `__GNU_LIBRARY__', `__GLIBC__', and `__GLIBC_MINOR__' are defined by this file unconditionally. `__GNU_LIBRARY__' is provided only for compatibility. All new code should use the other symbols to test for features. All macros listed above as possibly being defined by this file are explicitly undefined if they are not explicitly defined. Feature-test macros that are not defined by the user or compiler but are implied by the other feature-test macros defined (or by the lack of any definitions) are defined by the file. */ /* Undefine everything, so we get a clean slate. */ /* Suppress kernel-name space pollution unless user expressedly asks for it. */ /* Always use ISO C things. */ /* If _BSD_SOURCE was defined by the user, favor BSD over POSIX. */ /* If _GNU_SOURCE was defined by the user, turn on all the other features. */ /* If nothing (other than _GNU_SOURCE) is defined, define _BSD_SOURCE and _SVID_SOURCE. */ /* This is to enable the ISO C99 extension. Also recognize the old macro which was used prior to the standard acceptance. This macro will eventually go away and the features enabled by default once the ISO C99 standard is widely adopted. */ /* If none of the ANSI/POSIX macros are defined, use POSIX.1 and POSIX.2 (and IEEE Std 1003.1b-1993 unless _XOPEN_SOURCE is defined). */ /* We do support the IEC 559 math functionality, real and complex. */ /* wchar_t uses ISO 10646-1 (2nd ed., published 2000-09-15) / Unicode 3.1. */ /* This macro indicates that the installed library is the GNU C Library. For historic reasons the value now is 6 and this will stay from now on. The use of this variable is deprecated. Use __GLIBC__ and __GLIBC_MINOR__ now (see below) when you want to test for a specific GNU C library version and use the values in <gnu/lib-names.h> to get the sonames of the shared libraries. */ /* Major and minor version number of the GNU C library package. Use these macros to test for features in specific releases. */ /* Convenience macros to test the versions of glibc and gcc. Use them like this: #if __GNUC_PREREQ (2,8) ... code requiring gcc 2.8 or later ... #endif Note - they won't work for gcc1 or glibc1, since the _MINOR macros were not defined then. */ /* Decide whether a compiler supports the long long datatypes. */ /* This is here only because every header file already includes this one. */ /* Copyright (C) 1992-2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ /* We are almost always included from features.h. */ /* The GNU libc does not support any K&R compilers or the traditional mode of ISO C compilers anymore. Check for some of the combinations not anymore supported. */ /* Some user header file might have defined this before. */ /* For these things, GCC behaves the ANSI way normally, and the non-ANSI way under -traditional. */ /* This is not a typedef so `const __ptr_t' does the right thing. */ /* C++ needs to know that types and declarations are C, not C++. */ /* The standard library needs the functions from the ISO C90 standard in the std namespace. At the same time we want to be safe for future changes and we include the ISO C99 code in the non-standard namespace __c99. The C++ wrapper header take case of adding the definitions to the global namespace. */ /* For compatibility we do not add the declarations into any namespace. They will end up in the global namespace which is what old code expects. */ /* Support for bounded pointers. */ /* Support for flexible arrays. */ /* Some other non-C99 compiler. Approximate with [1]. */ /* __asm__ ("xyz") is used throughout the headers to rename functions at the assembly language level. This is wrapped by the __REDIRECT macro, in order to support compilers that can do this some other way. When compilers don't support asm-names at all, we have to do preprocessor tricks instead (which don't have exactly the right semantics, but it's the best we can do). Example: int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */ /* GCC has various useful declarations that can be made with the `__attribute__' syntax. All of the ways we use this do fine if they are omitted for compilers that don't understand it. */ /* At some point during the gcc 2.96 development the `malloc' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ /* At some point during the gcc 2.96 development the `pure' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ /* At some point during the gcc 3.1 development the `used' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ /* gcc allows marking deprecated functions. */ /* At some point during the gcc 2.8 development the `format_arg' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. If several `format_arg' attributes are given for the same function, in gcc-3.0 and older, all but the last one are ignored. In newer gccs, all designated arguments are considered. */ /* At some point during the gcc 2.97 development the `strfmon' format attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ /* It is possible to compile containing GCC extensions even if GCC is run in pedantic mode if the uses are carefully marked using the `__extension__' keyword. But this is not generally available before version 2.8. */ /* __restrict is known in EGCS 1.2 and above. */ /* ISO C99 also allows to declare arrays as non-overlapping. The syntax is array_name[restrict] GCC 3.1 supports this. */ /* Some other non-C99 compiler. */ /* If we don't have __REDIRECT, prototypes will be missing if __USE_FILE_OFFSET64 but not __USE_LARGEFILE[64]. */ /* Decide whether we can define 'extern inline' functions in headers. */ /* This is here only because every header file already includes this one. Get the definitions of all the appropriate `__stub_FUNCTION' symbols. <gnu/stubs.h> contains `#define __stub_FUNCTION' when FUNCTION is a stub that will always return failure (and set errno to ENOSYS). */ /* This file is automatically generated. It defines a symbol `__stub_FUNCTION' for each function in the C library which is a stub, meaning it will fail every time called, usually setting errno to ENOSYS. */ /* Get machine-dependent HUGE_VAL value (returned on overflow). On all IEEE754 machines, this is +Infinity. */ /* `HUGE_VAL' constants for ix86 (where it is infinity). Used by <stdlib.h> and <math.h> functions for overflow. Copyright (C) 1992, 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ /* Copyright (C) 1991-1993,1995-2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ /* IEEE positive infinity (-HUGE_VAL is negative infinity). */ static union { unsigned char __c[8]; double __d; } __huge_val = { { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } }; /* ISO C99 extensions: (float) HUGE_VALF and (long double) HUGE_VALL. */ /* Get machine-dependent NAN value (returned for some domain errors). */ /* Get general and ISO C99 specific information. */ /* Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ /* The file <bits/mathcalls.h> contains the prototypes for all the actual math functions. These macros are used for those prototypes, so we can easily declare each function as both `name' and `__name', and can declare the float versions `namef' and `__namef'. */ /* Prototype declarations for math functions; helper file for <math.h>. Copyright (C) 1996-2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ /* NOTE: Because of the special way this file is used by <math.h>, this file must NOT be protected from multiple inclusion as header files usually are. This file provides prototype declarations for the math functions. Most functions are declared using the macro: __MATHCALL (NAME,[_r], (ARGS...)); This means there is a function `NAME' returning `double' and a function `NAMEf' returning `float'. Each place `_Mdouble_' appears in the prototype, that is actually `double' in the prototype for `NAME' and `float' in the prototype for `NAMEf'. Reentrant variant functions are called `NAME_r' and `NAMEf_r'. Functions returning other types like `int' are declared using the macro: __MATHDECL (TYPE, NAME,[_r], (ARGS...)); This is just like __MATHCALL but for a function returning `TYPE' instead of `_Mdouble_'. In all of these cases, there is still both a `NAME' and a `NAMEf' that takes `float' arguments. Note that there must be no whitespace before the argument passed for NAME, to make token pasting work with -traditional. */ /* Trigonometric functions. */ /* Arc cosine of X. */ extern double acos (double __x) ; extern double __acos (double __x) ; /* Arc sine of X. */ extern double asin (double __x) ; extern double __asin (double __x) ; /* Arc tangent of X. */ extern double atan (double __x) ; extern double __atan (double __x) ; /* Arc tangent of Y/X. */ extern double atan2 (double __y, double __x) ; extern double __atan2 (double __y, double __x) ; /* Cosine of X. */ extern double cos (double __x) ; extern double __cos (double __x) ; /* Sine of X. */ extern double sin (double __x) ; extern double __sin (double __x) ; /* Tangent of X. */ extern double tan (double __x) ; extern double __tan (double __x) ; /* Hyperbolic functions. */ /* Hyperbolic cosine of X. */ extern double cosh (double __x) ; extern double __cosh (double __x) ; /* Hyperbolic sine of X. */ extern double sinh (double __x) ; extern double __sinh (double __x) ; /* Hyperbolic tangent of X. */ extern double tanh (double __x) ; extern double __tanh (double __x) ; /* Hyperbolic arc cosine of X. */ extern double acosh (double __x) ; extern double __acosh (double __x) ; /* Hyperbolic arc sine of X. */ extern double asinh (double __x) ; extern double __asinh (double __x) ; /* Hyperbolic arc tangent of X. */ extern double atanh (double __x) ; extern double __atanh (double __x) ; /* Exponential and logarithmic functions. */ /* Exponential function of X. */ extern double exp (double __x) ; extern double __exp (double __x) ; /* Break VALUE into a normalized fraction and an integral power of 2. */ extern double frexp (double __x, int *__exponent) ; extern double __frexp (double __x, int *__exponent) ; /* X times (two to the EXP power). */ extern double ldexp (double __x, int __exponent) ; extern double __ldexp (double __x, int __exponent) ; /* Natural logarithm of X. */ extern double log (double __x) ; extern double __log (double __x) ; /* Base-ten logarithm of X. */ extern double log10 (double __x) ; extern double __log10 (double __x) ; /* Break VALUE into integral and fractional parts. */ extern double modf (double __x, double *__iptr) ; extern double __modf (double __x, double *__iptr) ; /* Return exp(X) - 1. */ extern double expm1 (double __x) ; extern double __expm1 (double __x) ; /* Return log(1 + X). */ extern double log1p (double __x) ; extern double __log1p (double __x) ; /* Return the base 2 signed integral exponent of X. */ extern double logb (double __x) ; extern double __logb (double __x) ; /* Power functions. */ /* Return X to the Y power. */ extern double pow (double __x, double __y) ; extern double __pow (double __x, double __y) ; /* Return the square root of X. */ extern double sqrt (double __x) ; extern double __sqrt (double __x) ; /* Return `sqrt(X*X + Y*Y)'. */ extern double hypot (double __x, double __y) ; extern double __hypot (double __x, double __y) ; /* Return the cube root of X. */ extern double cbrt (double __x) ; extern double __cbrt (double __x) ; /* Nearest integer, absolute value, and remainder functions. */ /* Smallest integral value not less than X. */ extern double ceil (double __x) ; extern double __ceil (double __x) ; /* Absolute value of X. */ extern double fabs (double __x) ; extern double __fabs (double __x) ; /* Largest integer not greater than X. */ extern double floor (double __x) ; extern double __floor (double __x) ; /* Floating-point modulo remainder of X/Y. */ extern double fmod (double __x, double __y) ; extern double __fmod (double __x, double __y) ; /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ extern int __isinf (double __value) ; /* Return nonzero if VALUE is finite and not NaN. */ extern int __finite (double __value) ; /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ extern int isinf (double __value) ; /* Return nonzero if VALUE is finite and not NaN. */ extern int finite (double __value) ; /* Return the remainder of X/Y. */ extern double drem (double __x, double __y) ; extern double __drem (double __x, double __y) ; /* Return the fractional part of X after dividing out `ilogb (X)'. */ extern double significand (double __x) ; extern double __significand (double __x) ; /* Return X with its signed changed to Y's. */ extern double copysign (double __x, double __y) ; extern double __copysign (double __x, double __y) ; /* Return nonzero if VALUE is not a number. */ extern int __isnan (double __value) ; /* Return nonzero if VALUE is not a number. */ extern int isnan (double __value) ; /* Bessel functions. */ extern double j0 (double) ; extern double __j0 (double) ; extern double j1 (double) ; extern double __j1 (double) ; extern double jn (int, double) ; extern double __jn (int, double) ; extern double y0 (double) ; extern double __y0 (double) ; extern double y1 (double) ; extern double __y1 (double) ; extern double yn (int, double) ; extern double __yn (int, double) ; /* Error and gamma functions. */ extern double erf (double) ; extern double __erf (double) ; extern double erfc (double) ; extern double __erfc (double) ; extern double lgamma (double) ; extern double __lgamma (double) ; /* Obsolete alias for `lgamma'. */ extern double gamma (double) ; extern double __gamma (double) ; /* Reentrant version of lgamma. This function uses the global variable `signgam'. The reentrant version instead takes a pointer and stores the value through it. */ extern double lgamma_r (double, int *__signgamp) ; extern double __lgamma_r (double, int *__signgamp) ; /* Return the integer nearest X in the direction of the prevailing rounding mode. */ extern double rint (double __x) ; extern double __rint (double __x) ; /* Return X + epsilon if X < Y, X - epsilon if X > Y. */ extern double nextafter (double __x, double __y) ; extern double __nextafter (double __x, double __y) ; /* Return the remainder of integer divison X / Y with infinite precision. */ extern double remainder (double __x, double __y) ; extern double __remainder (double __x, double __y) ; /* Return X times (2 to the Nth power). */ extern double scalbn (double __x, int __n) ; extern double __scalbn (double __x, int __n) ; /* Return the binary exponent of X, which must be nonzero. */ extern int ilogb (double __x) ; extern int __ilogb (double __x) ; /* Include the file of declarations again, this time using `float' instead of `double' and appending f to each function name. */ /* Prototype declarations for math functions; helper file for <math.h>. Copyright (C) 1996-2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ /* NOTE: Because of the special way this file is used by <math.h>, this file must NOT be protected from multiple inclusion as header files usually are. This file provides prototype declarations for the math functions. Most functions are declared using the macro: __MATHCALL (NAME,[_r], (ARGS...)); This means there is a function `NAME' returning `double' and a function `NAMEf' returning `float'. Each place `_Mdouble_' appears in the prototype, that is actually `double' in the prototype for `NAME' and `float' in the prototype for `NAMEf'. Reentrant variant functions are called `NAME_r' and `NAMEf_r'. Functions returning other types like `int' are declared using the macro: __MATHDECL (TYPE, NAME,[_r], (ARGS...)); This is just like __MATHCALL but for a function returning `TYPE' instead of `_Mdouble_'. In all of these cases, there is still both a `NAME' and a `NAMEf' that takes `float' arguments. Note that there must be no whitespace before the argument passed for NAME, to make token pasting work with -traditional. */ /* Trigonometric functions. */ /* Arc cosine of X. */ extern float acosf (float __x) ; extern float __acosf (float __x) ; /* Arc sine of X. */ extern float asinf (float __x) ; extern float __asinf (float __x) ; /* Arc tangent of X. */ extern float atanf (float __x) ; extern float __atanf (float __x) ; /* Arc tangent of Y/X. */ extern float atan2f (float __y, float __x) ; extern float __atan2f (float __y, float __x) ; /* Cosine of X. */ extern float cosf (float __x) ; extern float __cosf (float __x) ; /* Sine of X. */ extern float sinf (float __x) ; extern float __sinf (float __x) ; /* Tangent of X. */ extern float tanf (float __x) ; extern float __tanf (float __x) ; /* Hyperbolic functions. */ /* Hyperbolic cosine of X. */ extern float coshf (float __x) ; extern float __coshf (float __x) ; /* Hyperbolic sine of X. */ extern float sinhf (float __x) ; extern float __sinhf (float __x) ; /* Hyperbolic tangent of X. */ extern float tanhf (float __x) ; extern float __tanhf (float __x) ; /* Hyperbolic arc cosine of X. */ extern float acoshf (float __x) ; extern float __acoshf (float __x) ; /* Hyperbolic arc sine of X. */ extern float asinhf (float __x) ; extern float __asinhf (float __x) ; /* Hyperbolic arc tangent of X. */ extern float atanhf (float __x) ; extern float __atanhf (float __x) ; /* Exponential and logarithmic functions. */ /* Exponential function of X. */ extern float expf (float __x) ; extern float __expf (float __x) ; /* Break VALUE into a normalized fraction and an integral power of 2. */ extern float frexpf (float __x, int *__exponent) ; extern float __frexpf (float __x, int *__exponent) ; /* X times (two to the EXP power). */ extern float ldexpf (float __x, int __exponent) ; extern float __ldexpf (float __x, int __exponent) ; /* Natural logarithm of X. */ extern float logf (float __x) ; extern float __logf (float __x) ; /* Base-ten logarithm of X. */ extern float log10f (float __x) ; extern float __log10f (float __x) ; /* Break VALUE into integral and fractional parts. */ extern float modff (float __x, float *__iptr) ; extern float __modff (float __x, float *__iptr) ; /* Return exp(X) - 1. */ extern float expm1f (float __x) ; extern float __expm1f (float __x) ; /* Return log(1 + X). */ extern float log1pf (float __x) ; extern float __log1pf (float __x) ; /* Return the base 2 signed integral exponent of X. */ extern float logbf (float __x) ; extern float __logbf (float __x) ; /* Power functions. */ /* Return X to the Y power. */ extern float powf (float __x, float __y) ; extern float __powf (float __x, float __y) ; /* Return the square root of X. */ extern float sqrtf (float __x) ; extern float __sqrtf (float __x) ; /* Return `sqrt(X*X + Y*Y)'. */ extern float hypotf (float __x, float __y) ; extern float __hypotf (float __x, float __y) ; /* Return the cube root of X. */ extern float cbrtf (float __x) ; extern float __cbrtf (float __x) ; /* Nearest integer, absolute value, and remainder functions. */ /* Smallest integral value not less than X. */ extern float ceilf (float __x) ; extern float __ceilf (float __x) ; /* Absolute value of X. */ extern float fabsf (float __x) ; extern float __fabsf (float __x) ; /* Largest integer not greater than X. */ extern float floorf (float __x) ; extern float __floorf (float __x) ; /* Floating-point modulo remainder of X/Y. */ extern float fmodf (float __x, float __y) ; extern float __fmodf (float __x, float __y) ; /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ extern int __isinff (float __value) ; /* Return nonzero if VALUE is finite and not NaN. */ extern int __finitef (float __value) ; /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ extern int isinff (float __value) ; /* Return nonzero if VALUE is finite and not NaN. */ extern int finitef (float __value) ; /* Return the remainder of X/Y. */ extern float dremf (float __x, float __y) ; extern float __dremf (float __x, float __y) ; /* Return the fractional part of X after dividing out `ilogb (X)'. */ extern float significandf (float __x) ; extern float __significandf (float __x) ; /* Return X with its signed changed to Y's. */ extern float copysignf (float __x, float __y) ; extern float __copysignf (float __x, float __y) ; /* Return nonzero if VALUE is not a number. */ extern int __isnanf (float __value) ; /* Return nonzero if VALUE is not a number. */ extern int isnanf (float __value) ; /* Bessel functions. */ extern float j0f (float) ; extern float __j0f (float) ; extern float j1f (float) ; extern float __j1f (float) ; extern float jnf (int, float) ; extern float __jnf (int, float) ; extern float y0f (float) ; extern float __y0f (float) ; extern float y1f (float) ; extern float __y1f (float) ; extern float ynf (int, float) ; extern float __ynf (int, float) ; /* Error and gamma functions. */ extern float erff (float) ; extern float __erff (float) ; extern float erfcf (float) ; extern float __erfcf (float) ; extern float lgammaf (float) ; extern float __lgammaf (float) ; /* Obsolete alias for `lgamma'. */ extern float gammaf (float) ; extern float __gammaf (float) ; /* Reentrant version of lgamma. This function uses the global variable `signgam'. The reentrant version instead takes a pointer and stores the value through it. */ extern float lgammaf_r (float, int *__signgamp) ; extern float __lgammaf_r (float, int *__signgamp) ; /* Return the integer nearest X in the direction of the prevailing rounding mode. */ extern float rintf (float __x) ; extern float __rintf (float __x) ; /* Return X + epsilon if X < Y, X - epsilon if X > Y. */ extern float nextafterf (float __x, float __y) ; extern float __nextafterf (float __x, float __y) ; /* Return the remainder of integer divison X / Y with infinite precision. */ extern float remainderf (float __x, float __y) ; extern float __remainderf (float __x, float __y) ; /* Return X times (2 to the Nth power). */ extern float scalbnf (float __x, int __n) ; extern float __scalbnf (float __x, int __n) ; /* Return the binary exponent of X, which must be nonzero. */ extern int ilogbf (float __x) ; extern int __ilogbf (float __x) ; /* Include the file of declarations again, this time using `long double' instead of `double' and appending l to each function name. */ /* Prototype declarations for math functions; helper file for <math.h>. Copyright (C) 1996-2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ /* NOTE: Because of the special way this file is used by <math.h>, this file must NOT be protected from multiple inclusion as header files usually are. This file provides prototype declarations for the math functions. Most functions are declared using the macro: __MATHCALL (NAME,[_r], (ARGS...)); This means there is a function `NAME' returning `double' and a function `NAMEf' returning `float'. Each place `_Mdouble_' appears in the prototype, that is actually `double' in the prototype for `NAME' and `float' in the prototype for `NAMEf'. Reentrant variant functions are called `NAME_r' and `NAMEf_r'. Functions returning other types like `int' are declared using the macro: __MATHDECL (TYPE, NAME,[_r], (ARGS...)); This is just like __MATHCALL but for a function returning `TYPE' instead of `_Mdouble_'. In all of these cases, there is still both a `NAME' and a `NAMEf' that takes `float' arguments. Note that there must be no whitespace before the argument passed for NAME, to make token pasting work with -traditional. */ /* Trigonometric functions. */ /* Arc cosine of X. */ extern long double acosl (long double __x) ; extern long double __acosl (long double __x) ; /* Arc sine of X. */ extern long double asinl (long double __x) ; extern long double __asinl (long double __x) ; /* Arc tangent of X. */ extern long double atanl (long double __x) ; extern long double __atanl (long double __x) ; /* Arc tangent of Y/X. */ extern long double atan2l (long double __y, long double __x) ; extern long double __atan2l (long double __y, long double __x) ; /* Cosine of X. */ extern long double cosl (long double __x) ; extern long double __cosl (long double __x) ; /* Sine of X. */ extern long double sinl (long double __x) ; extern long double __sinl (long double __x) ; /* Tangent of X. */ extern long double tanl (long double __x) ; extern long double __tanl (long double __x) ; /* Hyperbolic functions. */ /* Hyperbolic cosine of X. */ extern long double coshl (long double __x) ; extern long double __coshl (long double __x) ; /* Hyperbolic sine of X. */ extern long double sinhl (long double __x) ; extern long double __sinhl (long double __x) ; /* Hyperbolic tangent of X. */ extern long double tanhl (long double __x) ; extern long double __tanhl (long double __x) ; /* Hyperbolic arc cosine of X. */ extern long double acoshl (long double __x) ; extern long double __acoshl (long double __x) ; /* Hyperbolic arc sine of X. */ extern long double asinhl (long double __x) ; extern long double __asinhl (long double __x) ; /* Hyperbolic arc tangent of X. */ extern long double atanhl (long double __x) ; extern long double __atanhl (long double __x) ; /* Exponential and logarithmic functions. */ /* Exponential function of X. */ extern long double expl (long double __x) ; extern long double __expl (long double __x) ; /* Break VALUE into a normalized fraction and an integral power of 2. */ extern long double frexpl (long double __x, int *__exponent) ; extern long double __frexpl (long double __x, int *__exponent) ; /* X times (two to the EXP power). */ extern long double ldexpl (long double __x, int __exponent) ; extern long double __ldexpl (long double __x, int __exponent) ; /* Natural logarithm of X. */ extern long double logl (long double __x) ; extern long double __logl (long double __x) ; /* Base-ten logarithm of X. */ extern long double log10l (long double __x) ; extern long double __log10l (long double __x) ; /* Break VALUE into integral and fractional parts. */ extern long double modfl (long double __x, long double *__iptr) ; extern long double __modfl (long double __x, long double *__iptr) ; /* Return exp(X) - 1. */ extern long double expm1l (long double __x) ; extern long double __expm1l (long double __x) ; /* Return log(1 + X). */ extern long double log1pl (long double __x) ; extern long double __log1pl (long double __x) ; /* Return the base 2 signed integral exponent of X. */ extern long double logbl (long double __x) ; extern long double __logbl (long double __x) ; /* Power functions. */ /* Return X to the Y power. */ extern long double powl (long double __x, long double __y) ; extern long double __powl (long double __x, long double __y) ; /* Return the square root of X. */ extern long double sqrtl (long double __x) ; extern long double __sqrtl (long double __x) ; /* Return `sqrt(X*X + Y*Y)'. */ extern long double hypotl (long double __x, long double __y) ; extern long double __hypotl (long double __x, long double __y) ; /* Return the cube root of X. */ extern long double cbrtl (long double __x) ; extern long double __cbrtl (long double __x) ; /* Nearest integer, absolute value, and remainder functions. */ /* Smallest integral value not less than X. */ extern long double ceill (long double __x) ; extern long double __ceill (long double __x) ; /* Absolute value of X. */ extern long double fabsl (long double __x) ; extern long double __fabsl (long double __x) ; /* Largest integer not greater than X. */ extern long double floorl (long double __x) ; extern long double __floorl (long double __x) ; /* Floating-point modulo remainder of X/Y. */ extern long double fmodl (long double __x, long double __y) ; extern long double __fmodl (long double __x, long double __y) ; /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ extern int __isinfl (long double __value) ; /* Return nonzero if VALUE is finite and not NaN. */ extern int __finitel (long double __value) ; /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ extern int isinfl (long double __value) ; /* Return nonzero if VALUE is finite and not NaN. */ extern int finitel (long double __value) ; /* Return the remainder of X/Y. */ extern long double dreml (long double __x, long double __y) ; extern long double __dreml (long double __x, long double __y) ; /* Return the fractional part of X after dividing out `ilogb (X)'. */ extern long double significandl (long double __x) ; extern long double __significandl (long double __x) ; /* Return X with its signed changed to Y's. */ extern long double copysignl (long double __x, long double __y) ; extern long double __copysignl (long double __x, long double __y) ; /* Return nonzero if VALUE is not a number. */ extern int __isnanl (long double __value) ; /* Return nonzero if VALUE is not a number. */ extern int isnanl (long double __value) ; /* Bessel functions. */ extern long double j0l (long double) ; extern long double __j0l (long double) ; extern long double j1l (long double) ; extern long double __j1l (long double) ; extern long double jnl (int, long double) ; extern long double __jnl (int, long double) ; extern long double y0l (long double) ; extern long double __y0l (long double) ; extern long double y1l (long double) ; extern long double __y1l (long double) ; extern long double ynl (int, long double) ; extern long double __ynl (int, long double) ; /* Error and gamma functions. */ extern long double erfl (long double) ; extern long double __erfl (long double) ; extern long double erfcl (long double) ; extern long double __erfcl (long double) ; extern long double lgammal (long double) ; extern long double __lgammal (long double) ; /* Obsolete alias for `lgamma'. */ extern long double gammal (long double) ; extern long double __gammal (long double) ; /* Reentrant version of lgamma. This function uses the global variable `signgam'. The reentrant version instead takes a pointer and stores the value through it. */ extern long double lgammal_r (long double, int *__signgamp) ; extern long double __lgammal_r (long double, int *__signgamp) ; /* Return the integer nearest X in the direction of the prevailing rounding mode. */ extern long double rintl (long double __x) ; extern long double __rintl (long double __x) ; /* Return X + epsilon if X < Y, X - epsilon if X > Y. */ extern long double nextafterl (long double __x, long double __y) ; extern long double __nextafterl (long double __x, long double __y) ; /* Return the remainder of integer divison X / Y with infinite precision. */ extern long double remainderl (long double __x, long double __y) ; extern long double __remainderl (long double __x, long double __y) ; /* Return X times (2 to the Nth power). */ extern long double scalbnl (long double __x, int __n) ; extern long double __scalbnl (long double __x, int __n) ; /* Return the binary exponent of X, which must be nonzero. */ extern int ilogbl (long double __x) ; extern int __ilogbl (long double __x) ; /* This variable is used by `gamma' and `lgamma'. */ extern int signgam; /* ISO C99 defines some generic macros which work on any data type. */ /* Support for various different standard error handling behaviors. */ typedef enum { _IEEE_ = -1, /* According to IEEE 754/IEEE 854. */ _SVID_, /* According to System V, release 4. */ _XOPEN_, /* Nowadays also Unix98. */ _POSIX_, _ISOC_ /* Actually this is ISO C99. */ } _LIB_VERSION_TYPE; /* This variable can be changed at run-time to any of the values above to affect floating point error handling behavior (it may also be necessary to change the hardware FPU exception settings). */ extern _LIB_VERSION_TYPE _LIB_VERSION; /* In SVID error handling, `matherr' is called with this description of the exceptional condition. We have a problem when using C++ since `exception' is a reserved name in C++. */ struct exception { int type; char *name; double arg1; double arg2; double retval; }; extern int matherr (struct exception *__exc); /* Types of exceptions in the `type' field. */ /* SVID mode specifies returning this large value instead of infinity. */ /* Some useful constants. */ /* The above constants are not adequate for computation using `long double's. Therefore we provide as an extension constants with similar names as a GNU extension. Provide enough digits for the 128-bit IEEE quad. */ /* When compiling in strict ISO C compatible mode we must not use the inline functions since they, among other things, do not set the `errno' variable correctly. */ /* Get machine-dependent inline versions (if there are any). */ float beta(z,w) float z,w; { float gammln(); return exp(gammln(z)+gammln(w)-gammln(z+w)); }
the_stack_data/100140571.c
#include <stdio.h> int main() { int n, first = 0, second = 1, next, c; printf("Enter the number of terms\n"); scanf("%d", &n); printf("First %d terms of Fibonacci series are:\n", n); for (c = 0; c < n; c++) { if (c <= 1) next = c; else { next = first + second; first = second; second = next; } printf("%d\n", next); } return 0; }
the_stack_data/58846.c
// KASAN: use-after-free Read in ip6_pol_route (2) // https://syzkaller.appspot.com/bug?id=eeda6c04066577b6a84c // status:0 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include <arpa/inet.h> #include <dirent.h> #include <endian.h> #include <errno.h> #include <fcntl.h> #include <net/if.h> #include <net/if_arp.h> #include <netinet/in.h> #include <pthread.h> #include <sched.h> #include <signal.h> #include <stdarg.h> #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/ioctl.h> #include <sys/mount.h> #include <sys/prctl.h> #include <sys/resource.h> #include <sys/socket.h> #include <sys/stat.h> #include <sys/syscall.h> #include <sys/time.h> #include <sys/types.h> #include <sys/uio.h> #include <sys/wait.h> #include <time.h> #include <unistd.h> #include <linux/capability.h> #include <linux/futex.h> #include <linux/genetlink.h> #include <linux/if_addr.h> #include <linux/if_ether.h> #include <linux/if_link.h> #include <linux/if_tun.h> #include <linux/in6.h> #include <linux/ip.h> #include <linux/neighbour.h> #include <linux/net.h> #include <linux/netlink.h> #include <linux/rtnetlink.h> #include <linux/tcp.h> #include <linux/veth.h> static unsigned long long procid; static void sleep_ms(uint64_t ms) { usleep(ms * 1000); } static uint64_t current_time_ms(void) { struct timespec ts; if (clock_gettime(CLOCK_MONOTONIC, &ts)) exit(1); return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000; } static void thread_start(void* (*fn)(void*), void* arg) { pthread_t th; pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setstacksize(&attr, 128 << 10); int i = 0; for (; i < 100; i++) { if (pthread_create(&th, &attr, fn, arg) == 0) { pthread_attr_destroy(&attr); return; } if (errno == EAGAIN) { usleep(50); continue; } break; } exit(1); } typedef struct { int state; } event_t; static void event_init(event_t* ev) { ev->state = 0; } static void event_reset(event_t* ev) { ev->state = 0; } static void event_set(event_t* ev) { if (ev->state) exit(1); __atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE); syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000); } static void event_wait(event_t* ev) { while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0); } static int event_isset(event_t* ev) { return __atomic_load_n(&ev->state, __ATOMIC_ACQUIRE); } static int event_timedwait(event_t* ev, uint64_t timeout) { uint64_t start = current_time_ms(); uint64_t now = start; for (;;) { uint64_t remain = timeout - (now - start); struct timespec ts; ts.tv_sec = remain / 1000; ts.tv_nsec = (remain % 1000) * 1000 * 1000; syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, &ts); if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) return 1; now = current_time_ms(); if (now - start > timeout) return 0; } } static bool write_file(const char* file, const char* what, ...) { char buf[1024]; va_list args; va_start(args, what); vsnprintf(buf, sizeof(buf), what, args); va_end(args); buf[sizeof(buf) - 1] = 0; int len = strlen(buf); int fd = open(file, O_WRONLY | O_CLOEXEC); if (fd == -1) return false; if (write(fd, buf, len) != len) { int err = errno; close(fd); errno = err; return false; } close(fd); return true; } struct nlmsg { char* pos; int nesting; struct nlattr* nested[8]; char buf[4096]; }; static void netlink_init(struct nlmsg* nlmsg, int typ, int flags, const void* data, int size) { memset(nlmsg, 0, sizeof(*nlmsg)); struct nlmsghdr* hdr = (struct nlmsghdr*)nlmsg->buf; hdr->nlmsg_type = typ; hdr->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK | flags; memcpy(hdr + 1, data, size); nlmsg->pos = (char*)(hdr + 1) + NLMSG_ALIGN(size); } static void netlink_attr(struct nlmsg* nlmsg, int typ, const void* data, int size) { struct nlattr* attr = (struct nlattr*)nlmsg->pos; attr->nla_len = sizeof(*attr) + size; attr->nla_type = typ; if (size > 0) memcpy(attr + 1, data, size); nlmsg->pos += NLMSG_ALIGN(attr->nla_len); } static void netlink_nest(struct nlmsg* nlmsg, int typ) { struct nlattr* attr = (struct nlattr*)nlmsg->pos; attr->nla_type = typ; nlmsg->pos += sizeof(*attr); nlmsg->nested[nlmsg->nesting++] = attr; } static void netlink_done(struct nlmsg* nlmsg) { struct nlattr* attr = nlmsg->nested[--nlmsg->nesting]; attr->nla_len = nlmsg->pos - (char*)attr; } static int netlink_send_ext(struct nlmsg* nlmsg, int sock, uint16_t reply_type, int* reply_len) { if (nlmsg->pos > nlmsg->buf + sizeof(nlmsg->buf) || nlmsg->nesting) exit(1); struct nlmsghdr* hdr = (struct nlmsghdr*)nlmsg->buf; hdr->nlmsg_len = nlmsg->pos - nlmsg->buf; struct sockaddr_nl addr; memset(&addr, 0, sizeof(addr)); addr.nl_family = AF_NETLINK; unsigned n = sendto(sock, nlmsg->buf, hdr->nlmsg_len, 0, (struct sockaddr*)&addr, sizeof(addr)); if (n != hdr->nlmsg_len) exit(1); n = recv(sock, nlmsg->buf, sizeof(nlmsg->buf), 0); if (reply_len) *reply_len = 0; if (hdr->nlmsg_type == NLMSG_DONE) return 0; if (n < sizeof(struct nlmsghdr)) exit(1); if (reply_len && hdr->nlmsg_type == reply_type) { *reply_len = n; return 0; } if (n < sizeof(struct nlmsghdr) + sizeof(struct nlmsgerr)) exit(1); if (hdr->nlmsg_type != NLMSG_ERROR) exit(1); return ((struct nlmsgerr*)(hdr + 1))->error; } static int netlink_send(struct nlmsg* nlmsg, int sock) { return netlink_send_ext(nlmsg, sock, 0, NULL); } static int netlink_query_family_id(struct nlmsg* nlmsg, int sock, const char* family_name) { struct genlmsghdr genlhdr; memset(&genlhdr, 0, sizeof(genlhdr)); genlhdr.cmd = CTRL_CMD_GETFAMILY; netlink_init(nlmsg, GENL_ID_CTRL, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(nlmsg, CTRL_ATTR_FAMILY_NAME, family_name, strnlen(family_name, GENL_NAMSIZ - 1) + 1); int n = 0; int err = netlink_send_ext(nlmsg, sock, GENL_ID_CTRL, &n); if (err < 0) { return -1; } uint16_t id = 0; struct nlattr* attr = (struct nlattr*)(nlmsg->buf + NLMSG_HDRLEN + NLMSG_ALIGN(sizeof(genlhdr))); for (; (char*)attr < nlmsg->buf + n; attr = (struct nlattr*)((char*)attr + NLMSG_ALIGN(attr->nla_len))) { if (attr->nla_type == CTRL_ATTR_FAMILY_ID) { id = *(uint16_t*)(attr + 1); break; } } if (!id) { return -1; } recv(sock, nlmsg->buf, sizeof(nlmsg->buf), 0); return id; } static int netlink_next_msg(struct nlmsg* nlmsg, unsigned int offset, unsigned int total_len) { struct nlmsghdr* hdr = (struct nlmsghdr*)(nlmsg->buf + offset); if (offset == total_len || offset + hdr->nlmsg_len > total_len) return -1; return hdr->nlmsg_len; } static void netlink_add_device_impl(struct nlmsg* nlmsg, const char* type, const char* name) { struct ifinfomsg hdr; memset(&hdr, 0, sizeof(hdr)); netlink_init(nlmsg, RTM_NEWLINK, NLM_F_EXCL | NLM_F_CREATE, &hdr, sizeof(hdr)); if (name) netlink_attr(nlmsg, IFLA_IFNAME, name, strlen(name)); netlink_nest(nlmsg, IFLA_LINKINFO); netlink_attr(nlmsg, IFLA_INFO_KIND, type, strlen(type)); } static void netlink_add_device(struct nlmsg* nlmsg, int sock, const char* type, const char* name) { netlink_add_device_impl(nlmsg, type, name); netlink_done(nlmsg); int err = netlink_send(nlmsg, sock); (void)err; } static void netlink_add_veth(struct nlmsg* nlmsg, int sock, const char* name, const char* peer) { netlink_add_device_impl(nlmsg, "veth", name); netlink_nest(nlmsg, IFLA_INFO_DATA); netlink_nest(nlmsg, VETH_INFO_PEER); nlmsg->pos += sizeof(struct ifinfomsg); netlink_attr(nlmsg, IFLA_IFNAME, peer, strlen(peer)); netlink_done(nlmsg); netlink_done(nlmsg); netlink_done(nlmsg); int err = netlink_send(nlmsg, sock); (void)err; } static void netlink_add_hsr(struct nlmsg* nlmsg, int sock, const char* name, const char* slave1, const char* slave2) { netlink_add_device_impl(nlmsg, "hsr", name); netlink_nest(nlmsg, IFLA_INFO_DATA); int ifindex1 = if_nametoindex(slave1); netlink_attr(nlmsg, IFLA_HSR_SLAVE1, &ifindex1, sizeof(ifindex1)); int ifindex2 = if_nametoindex(slave2); netlink_attr(nlmsg, IFLA_HSR_SLAVE2, &ifindex2, sizeof(ifindex2)); netlink_done(nlmsg); netlink_done(nlmsg); int err = netlink_send(nlmsg, sock); (void)err; } static void netlink_add_linked(struct nlmsg* nlmsg, int sock, const char* type, const char* name, const char* link) { netlink_add_device_impl(nlmsg, type, name); netlink_done(nlmsg); int ifindex = if_nametoindex(link); netlink_attr(nlmsg, IFLA_LINK, &ifindex, sizeof(ifindex)); int err = netlink_send(nlmsg, sock); (void)err; } static void netlink_add_vlan(struct nlmsg* nlmsg, int sock, const char* name, const char* link, uint16_t id, uint16_t proto) { netlink_add_device_impl(nlmsg, "vlan", name); netlink_nest(nlmsg, IFLA_INFO_DATA); netlink_attr(nlmsg, IFLA_VLAN_ID, &id, sizeof(id)); netlink_attr(nlmsg, IFLA_VLAN_PROTOCOL, &proto, sizeof(proto)); netlink_done(nlmsg); netlink_done(nlmsg); int ifindex = if_nametoindex(link); netlink_attr(nlmsg, IFLA_LINK, &ifindex, sizeof(ifindex)); int err = netlink_send(nlmsg, sock); (void)err; } static void netlink_add_macvlan(struct nlmsg* nlmsg, int sock, const char* name, const char* link) { netlink_add_device_impl(nlmsg, "macvlan", name); netlink_nest(nlmsg, IFLA_INFO_DATA); uint32_t mode = MACVLAN_MODE_BRIDGE; netlink_attr(nlmsg, IFLA_MACVLAN_MODE, &mode, sizeof(mode)); netlink_done(nlmsg); netlink_done(nlmsg); int ifindex = if_nametoindex(link); netlink_attr(nlmsg, IFLA_LINK, &ifindex, sizeof(ifindex)); int err = netlink_send(nlmsg, sock); (void)err; } static void netlink_add_geneve(struct nlmsg* nlmsg, int sock, const char* name, uint32_t vni, struct in_addr* addr4, struct in6_addr* addr6) { netlink_add_device_impl(nlmsg, "geneve", name); netlink_nest(nlmsg, IFLA_INFO_DATA); netlink_attr(nlmsg, IFLA_GENEVE_ID, &vni, sizeof(vni)); if (addr4) netlink_attr(nlmsg, IFLA_GENEVE_REMOTE, addr4, sizeof(*addr4)); if (addr6) netlink_attr(nlmsg, IFLA_GENEVE_REMOTE6, addr6, sizeof(*addr6)); netlink_done(nlmsg); netlink_done(nlmsg); int err = netlink_send(nlmsg, sock); (void)err; } #define IFLA_IPVLAN_FLAGS 2 #define IPVLAN_MODE_L3S 2 #undef IPVLAN_F_VEPA #define IPVLAN_F_VEPA 2 static void netlink_add_ipvlan(struct nlmsg* nlmsg, int sock, const char* name, const char* link, uint16_t mode, uint16_t flags) { netlink_add_device_impl(nlmsg, "ipvlan", name); netlink_nest(nlmsg, IFLA_INFO_DATA); netlink_attr(nlmsg, IFLA_IPVLAN_MODE, &mode, sizeof(mode)); netlink_attr(nlmsg, IFLA_IPVLAN_FLAGS, &flags, sizeof(flags)); netlink_done(nlmsg); netlink_done(nlmsg); int ifindex = if_nametoindex(link); netlink_attr(nlmsg, IFLA_LINK, &ifindex, sizeof(ifindex)); int err = netlink_send(nlmsg, sock); (void)err; } static void netlink_device_change(struct nlmsg* nlmsg, int sock, const char* name, bool up, const char* master, const void* mac, int macsize, const char* new_name) { struct ifinfomsg hdr; memset(&hdr, 0, sizeof(hdr)); if (up) hdr.ifi_flags = hdr.ifi_change = IFF_UP; hdr.ifi_index = if_nametoindex(name); netlink_init(nlmsg, RTM_NEWLINK, 0, &hdr, sizeof(hdr)); if (new_name) netlink_attr(nlmsg, IFLA_IFNAME, new_name, strlen(new_name)); if (master) { int ifindex = if_nametoindex(master); netlink_attr(nlmsg, IFLA_MASTER, &ifindex, sizeof(ifindex)); } if (macsize) netlink_attr(nlmsg, IFLA_ADDRESS, mac, macsize); int err = netlink_send(nlmsg, sock); (void)err; } static int netlink_add_addr(struct nlmsg* nlmsg, int sock, const char* dev, const void* addr, int addrsize) { struct ifaddrmsg hdr; memset(&hdr, 0, sizeof(hdr)); hdr.ifa_family = addrsize == 4 ? AF_INET : AF_INET6; hdr.ifa_prefixlen = addrsize == 4 ? 24 : 120; hdr.ifa_scope = RT_SCOPE_UNIVERSE; hdr.ifa_index = if_nametoindex(dev); netlink_init(nlmsg, RTM_NEWADDR, NLM_F_CREATE | NLM_F_REPLACE, &hdr, sizeof(hdr)); netlink_attr(nlmsg, IFA_LOCAL, addr, addrsize); netlink_attr(nlmsg, IFA_ADDRESS, addr, addrsize); return netlink_send(nlmsg, sock); } static void netlink_add_addr4(struct nlmsg* nlmsg, int sock, const char* dev, const char* addr) { struct in_addr in_addr; inet_pton(AF_INET, addr, &in_addr); int err = netlink_add_addr(nlmsg, sock, dev, &in_addr, sizeof(in_addr)); (void)err; } static void netlink_add_addr6(struct nlmsg* nlmsg, int sock, const char* dev, const char* addr) { struct in6_addr in6_addr; inet_pton(AF_INET6, addr, &in6_addr); int err = netlink_add_addr(nlmsg, sock, dev, &in6_addr, sizeof(in6_addr)); (void)err; } static void netlink_add_neigh(struct nlmsg* nlmsg, int sock, const char* name, const void* addr, int addrsize, const void* mac, int macsize) { struct ndmsg hdr; memset(&hdr, 0, sizeof(hdr)); hdr.ndm_family = addrsize == 4 ? AF_INET : AF_INET6; hdr.ndm_ifindex = if_nametoindex(name); hdr.ndm_state = NUD_PERMANENT; netlink_init(nlmsg, RTM_NEWNEIGH, NLM_F_EXCL | NLM_F_CREATE, &hdr, sizeof(hdr)); netlink_attr(nlmsg, NDA_DST, addr, addrsize); netlink_attr(nlmsg, NDA_LLADDR, mac, macsize); int err = netlink_send(nlmsg, sock); (void)err; } static struct nlmsg nlmsg; static int tunfd = -1; #define TUN_IFACE "syz_tun" #define LOCAL_MAC 0xaaaaaaaaaaaa #define REMOTE_MAC 0xaaaaaaaaaabb #define LOCAL_IPV4 "172.20.20.170" #define REMOTE_IPV4 "172.20.20.187" #define LOCAL_IPV6 "fe80::aa" #define REMOTE_IPV6 "fe80::bb" #define IFF_NAPI 0x0010 static void initialize_tun(void) { tunfd = open("/dev/net/tun", O_RDWR | O_NONBLOCK); if (tunfd == -1) { printf("tun: can't open /dev/net/tun: please enable CONFIG_TUN=y\n"); printf("otherwise fuzzing or reproducing might not work as intended\n"); return; } const int kTunFd = 240; if (dup2(tunfd, kTunFd) < 0) exit(1); close(tunfd); tunfd = kTunFd; struct ifreq ifr; memset(&ifr, 0, sizeof(ifr)); strncpy(ifr.ifr_name, TUN_IFACE, IFNAMSIZ); ifr.ifr_flags = IFF_TAP | IFF_NO_PI; if (ioctl(tunfd, TUNSETIFF, (void*)&ifr) < 0) { exit(1); } char sysctl[64]; sprintf(sysctl, "/proc/sys/net/ipv6/conf/%s/accept_dad", TUN_IFACE); write_file(sysctl, "0"); sprintf(sysctl, "/proc/sys/net/ipv6/conf/%s/router_solicitations", TUN_IFACE); write_file(sysctl, "0"); int sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (sock == -1) exit(1); netlink_add_addr4(&nlmsg, sock, TUN_IFACE, LOCAL_IPV4); netlink_add_addr6(&nlmsg, sock, TUN_IFACE, LOCAL_IPV6); uint64_t macaddr = REMOTE_MAC; struct in_addr in_addr; inet_pton(AF_INET, REMOTE_IPV4, &in_addr); netlink_add_neigh(&nlmsg, sock, TUN_IFACE, &in_addr, sizeof(in_addr), &macaddr, ETH_ALEN); struct in6_addr in6_addr; inet_pton(AF_INET6, REMOTE_IPV6, &in6_addr); netlink_add_neigh(&nlmsg, sock, TUN_IFACE, &in6_addr, sizeof(in6_addr), &macaddr, ETH_ALEN); macaddr = LOCAL_MAC; netlink_device_change(&nlmsg, sock, TUN_IFACE, true, 0, &macaddr, ETH_ALEN, NULL); close(sock); } #define DEVLINK_FAMILY_NAME "devlink" #define DEVLINK_CMD_PORT_GET 5 #define DEVLINK_ATTR_BUS_NAME 1 #define DEVLINK_ATTR_DEV_NAME 2 #define DEVLINK_ATTR_NETDEV_NAME 7 static struct nlmsg nlmsg2; static void initialize_devlink_ports(const char* bus_name, const char* dev_name, const char* netdev_prefix) { struct genlmsghdr genlhdr; int len, total_len, id, err, offset; uint16_t netdev_index; int sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC); if (sock == -1) exit(1); int rtsock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (rtsock == -1) exit(1); id = netlink_query_family_id(&nlmsg, sock, DEVLINK_FAMILY_NAME); if (id == -1) goto error; memset(&genlhdr, 0, sizeof(genlhdr)); genlhdr.cmd = DEVLINK_CMD_PORT_GET; netlink_init(&nlmsg, id, NLM_F_DUMP, &genlhdr, sizeof(genlhdr)); netlink_attr(&nlmsg, DEVLINK_ATTR_BUS_NAME, bus_name, strlen(bus_name) + 1); netlink_attr(&nlmsg, DEVLINK_ATTR_DEV_NAME, dev_name, strlen(dev_name) + 1); err = netlink_send_ext(&nlmsg, sock, id, &total_len); if (err < 0) { goto error; } offset = 0; netdev_index = 0; while ((len = netlink_next_msg(&nlmsg, offset, total_len)) != -1) { struct nlattr* attr = (struct nlattr*)(nlmsg.buf + offset + NLMSG_HDRLEN + NLMSG_ALIGN(sizeof(genlhdr))); for (; (char*)attr < nlmsg.buf + offset + len; attr = (struct nlattr*)((char*)attr + NLMSG_ALIGN(attr->nla_len))) { if (attr->nla_type == DEVLINK_ATTR_NETDEV_NAME) { char* port_name; char netdev_name[IFNAMSIZ]; port_name = (char*)(attr + 1); snprintf(netdev_name, sizeof(netdev_name), "%s%d", netdev_prefix, netdev_index); netlink_device_change(&nlmsg2, rtsock, port_name, true, 0, 0, 0, netdev_name); break; } } offset += len; netdev_index++; } error: close(rtsock); close(sock); } #define DEV_IPV4 "172.20.20.%d" #define DEV_IPV6 "fe80::%02x" #define DEV_MAC 0x00aaaaaaaaaa static void netdevsim_add(unsigned int addr, unsigned int port_count) { char buf[16]; sprintf(buf, "%u %u", addr, port_count); if (write_file("/sys/bus/netdevsim/new_device", buf)) { snprintf(buf, sizeof(buf), "netdevsim%d", addr); initialize_devlink_ports("netdevsim", buf, "netdevsim"); } } #define WG_GENL_NAME "wireguard" enum wg_cmd { WG_CMD_GET_DEVICE, WG_CMD_SET_DEVICE, }; enum wgdevice_attribute { WGDEVICE_A_UNSPEC, WGDEVICE_A_IFINDEX, WGDEVICE_A_IFNAME, WGDEVICE_A_PRIVATE_KEY, WGDEVICE_A_PUBLIC_KEY, WGDEVICE_A_FLAGS, WGDEVICE_A_LISTEN_PORT, WGDEVICE_A_FWMARK, WGDEVICE_A_PEERS, }; enum wgpeer_attribute { WGPEER_A_UNSPEC, WGPEER_A_PUBLIC_KEY, WGPEER_A_PRESHARED_KEY, WGPEER_A_FLAGS, WGPEER_A_ENDPOINT, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, WGPEER_A_LAST_HANDSHAKE_TIME, WGPEER_A_RX_BYTES, WGPEER_A_TX_BYTES, WGPEER_A_ALLOWEDIPS, WGPEER_A_PROTOCOL_VERSION, }; enum wgallowedip_attribute { WGALLOWEDIP_A_UNSPEC, WGALLOWEDIP_A_FAMILY, WGALLOWEDIP_A_IPADDR, WGALLOWEDIP_A_CIDR_MASK, }; static void netlink_wireguard_setup(void) { const char ifname_a[] = "wg0"; const char ifname_b[] = "wg1"; const char ifname_c[] = "wg2"; const char private_a[] = "\xa0\x5c\xa8\x4f\x6c\x9c\x8e\x38\x53\xe2\xfd\x7a\x70\xae\x0f\xb2\x0f\xa1" "\x52\x60\x0c\xb0\x08\x45\x17\x4f\x08\x07\x6f\x8d\x78\x43"; const char private_b[] = "\xb0\x80\x73\xe8\xd4\x4e\x91\xe3\xda\x92\x2c\x22\x43\x82\x44\xbb\x88\x5c" "\x69\xe2\x69\xc8\xe9\xd8\x35\xb1\x14\x29\x3a\x4d\xdc\x6e"; const char private_c[] = "\xa0\xcb\x87\x9a\x47\xf5\xbc\x64\x4c\x0e\x69\x3f\xa6\xd0\x31\xc7\x4a\x15" "\x53\xb6\xe9\x01\xb9\xff\x2f\x51\x8c\x78\x04\x2f\xb5\x42"; const char public_a[] = "\x97\x5c\x9d\x81\xc9\x83\xc8\x20\x9e\xe7\x81\x25\x4b\x89\x9f\x8e\xd9\x25" "\xae\x9f\x09\x23\xc2\x3c\x62\xf5\x3c\x57\xcd\xbf\x69\x1c"; const char public_b[] = "\xd1\x73\x28\x99\xf6\x11\xcd\x89\x94\x03\x4d\x7f\x41\x3d\xc9\x57\x63\x0e" "\x54\x93\xc2\x85\xac\xa4\x00\x65\xcb\x63\x11\xbe\x69\x6b"; const char public_c[] = "\xf4\x4d\xa3\x67\xa8\x8e\xe6\x56\x4f\x02\x02\x11\x45\x67\x27\x08\x2f\x5c" "\xeb\xee\x8b\x1b\xf5\xeb\x73\x37\x34\x1b\x45\x9b\x39\x22"; const uint16_t listen_a = 20001; const uint16_t listen_b = 20002; const uint16_t listen_c = 20003; const uint16_t af_inet = AF_INET; const uint16_t af_inet6 = AF_INET6; const struct sockaddr_in endpoint_b_v4 = { .sin_family = AF_INET, .sin_port = htons(listen_b), .sin_addr = {htonl(INADDR_LOOPBACK)}}; const struct sockaddr_in endpoint_c_v4 = { .sin_family = AF_INET, .sin_port = htons(listen_c), .sin_addr = {htonl(INADDR_LOOPBACK)}}; struct sockaddr_in6 endpoint_a_v6 = {.sin6_family = AF_INET6, .sin6_port = htons(listen_a)}; endpoint_a_v6.sin6_addr = in6addr_loopback; struct sockaddr_in6 endpoint_c_v6 = {.sin6_family = AF_INET6, .sin6_port = htons(listen_c)}; endpoint_c_v6.sin6_addr = in6addr_loopback; const struct in_addr first_half_v4 = {0}; const struct in_addr second_half_v4 = {(uint32_t)htonl(128 << 24)}; const struct in6_addr first_half_v6 = {{{0}}}; const struct in6_addr second_half_v6 = {{{0x80}}}; const uint8_t half_cidr = 1; const uint16_t persistent_keepalives[] = {1, 3, 7, 9, 14, 19}; struct genlmsghdr genlhdr = {.cmd = WG_CMD_SET_DEVICE, .version = 1}; int sock; int id, err; sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC); if (sock == -1) { return; } id = netlink_query_family_id(&nlmsg, sock, WG_GENL_NAME); if (id == -1) goto error; netlink_init(&nlmsg, id, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(&nlmsg, WGDEVICE_A_IFNAME, ifname_a, strlen(ifname_a) + 1); netlink_attr(&nlmsg, WGDEVICE_A_PRIVATE_KEY, private_a, 32); netlink_attr(&nlmsg, WGDEVICE_A_LISTEN_PORT, &listen_a, 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGDEVICE_A_PEERS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGPEER_A_PUBLIC_KEY, public_b, 32); netlink_attr(&nlmsg, WGPEER_A_ENDPOINT, &endpoint_b_v4, sizeof(endpoint_b_v4)); netlink_attr(&nlmsg, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, &persistent_keepalives[0], 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGPEER_A_ALLOWEDIPS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &first_half_v4, sizeof(first_half_v4)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet6, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &first_half_v6, sizeof(first_half_v6)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGPEER_A_PUBLIC_KEY, public_c, 32); netlink_attr(&nlmsg, WGPEER_A_ENDPOINT, &endpoint_c_v6, sizeof(endpoint_c_v6)); netlink_attr(&nlmsg, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, &persistent_keepalives[1], 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGPEER_A_ALLOWEDIPS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &second_half_v4, sizeof(second_half_v4)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet6, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &second_half_v6, sizeof(second_half_v6)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); err = netlink_send(&nlmsg, sock); if (err < 0) { } netlink_init(&nlmsg, id, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(&nlmsg, WGDEVICE_A_IFNAME, ifname_b, strlen(ifname_b) + 1); netlink_attr(&nlmsg, WGDEVICE_A_PRIVATE_KEY, private_b, 32); netlink_attr(&nlmsg, WGDEVICE_A_LISTEN_PORT, &listen_b, 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGDEVICE_A_PEERS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGPEER_A_PUBLIC_KEY, public_a, 32); netlink_attr(&nlmsg, WGPEER_A_ENDPOINT, &endpoint_a_v6, sizeof(endpoint_a_v6)); netlink_attr(&nlmsg, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, &persistent_keepalives[2], 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGPEER_A_ALLOWEDIPS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &first_half_v4, sizeof(first_half_v4)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet6, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &first_half_v6, sizeof(first_half_v6)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGPEER_A_PUBLIC_KEY, public_c, 32); netlink_attr(&nlmsg, WGPEER_A_ENDPOINT, &endpoint_c_v4, sizeof(endpoint_c_v4)); netlink_attr(&nlmsg, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, &persistent_keepalives[3], 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGPEER_A_ALLOWEDIPS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &second_half_v4, sizeof(second_half_v4)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet6, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &second_half_v6, sizeof(second_half_v6)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); err = netlink_send(&nlmsg, sock); if (err < 0) { } netlink_init(&nlmsg, id, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(&nlmsg, WGDEVICE_A_IFNAME, ifname_c, strlen(ifname_c) + 1); netlink_attr(&nlmsg, WGDEVICE_A_PRIVATE_KEY, private_c, 32); netlink_attr(&nlmsg, WGDEVICE_A_LISTEN_PORT, &listen_c, 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGDEVICE_A_PEERS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGPEER_A_PUBLIC_KEY, public_a, 32); netlink_attr(&nlmsg, WGPEER_A_ENDPOINT, &endpoint_a_v6, sizeof(endpoint_a_v6)); netlink_attr(&nlmsg, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, &persistent_keepalives[4], 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGPEER_A_ALLOWEDIPS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &first_half_v4, sizeof(first_half_v4)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet6, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &first_half_v6, sizeof(first_half_v6)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGPEER_A_PUBLIC_KEY, public_b, 32); netlink_attr(&nlmsg, WGPEER_A_ENDPOINT, &endpoint_b_v4, sizeof(endpoint_b_v4)); netlink_attr(&nlmsg, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, &persistent_keepalives[5], 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGPEER_A_ALLOWEDIPS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &second_half_v4, sizeof(second_half_v4)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet6, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &second_half_v6, sizeof(second_half_v6)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); err = netlink_send(&nlmsg, sock); if (err < 0) { } error: close(sock); } static void initialize_netdevices(void) { char netdevsim[16]; sprintf(netdevsim, "netdevsim%d", (int)procid); struct { const char* type; const char* dev; } devtypes[] = { {"ip6gretap", "ip6gretap0"}, {"bridge", "bridge0"}, {"vcan", "vcan0"}, {"bond", "bond0"}, {"team", "team0"}, {"dummy", "dummy0"}, {"nlmon", "nlmon0"}, {"caif", "caif0"}, {"batadv", "batadv0"}, {"vxcan", "vxcan1"}, {"netdevsim", netdevsim}, {"veth", 0}, {"xfrm", "xfrm0"}, {"wireguard", "wg0"}, {"wireguard", "wg1"}, {"wireguard", "wg2"}, }; const char* devmasters[] = {"bridge", "bond", "team", "batadv"}; struct { const char* name; int macsize; bool noipv6; } devices[] = { {"lo", ETH_ALEN}, {"sit0", 0}, {"bridge0", ETH_ALEN}, {"vcan0", 0, true}, {"tunl0", 0}, {"gre0", 0}, {"gretap0", ETH_ALEN}, {"ip_vti0", 0}, {"ip6_vti0", 0}, {"ip6tnl0", 0}, {"ip6gre0", 0}, {"ip6gretap0", ETH_ALEN}, {"erspan0", ETH_ALEN}, {"bond0", ETH_ALEN}, {"veth0", ETH_ALEN}, {"veth1", ETH_ALEN}, {"team0", ETH_ALEN}, {"veth0_to_bridge", ETH_ALEN}, {"veth1_to_bridge", ETH_ALEN}, {"veth0_to_bond", ETH_ALEN}, {"veth1_to_bond", ETH_ALEN}, {"veth0_to_team", ETH_ALEN}, {"veth1_to_team", ETH_ALEN}, {"veth0_to_hsr", ETH_ALEN}, {"veth1_to_hsr", ETH_ALEN}, {"hsr0", 0}, {"dummy0", ETH_ALEN}, {"nlmon0", 0}, {"vxcan0", 0, true}, {"vxcan1", 0, true}, {"caif0", ETH_ALEN}, {"batadv0", ETH_ALEN}, {netdevsim, ETH_ALEN}, {"xfrm0", ETH_ALEN}, {"veth0_virt_wifi", ETH_ALEN}, {"veth1_virt_wifi", ETH_ALEN}, {"virt_wifi0", ETH_ALEN}, {"veth0_vlan", ETH_ALEN}, {"veth1_vlan", ETH_ALEN}, {"vlan0", ETH_ALEN}, {"vlan1", ETH_ALEN}, {"macvlan0", ETH_ALEN}, {"macvlan1", ETH_ALEN}, {"ipvlan0", ETH_ALEN}, {"ipvlan1", ETH_ALEN}, {"veth0_macvtap", ETH_ALEN}, {"veth1_macvtap", ETH_ALEN}, {"macvtap0", ETH_ALEN}, {"macsec0", ETH_ALEN}, {"veth0_to_batadv", ETH_ALEN}, {"veth1_to_batadv", ETH_ALEN}, {"batadv_slave_0", ETH_ALEN}, {"batadv_slave_1", ETH_ALEN}, {"geneve0", ETH_ALEN}, {"geneve1", ETH_ALEN}, {"wg0", 0}, {"wg1", 0}, {"wg2", 0}, }; int sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (sock == -1) exit(1); unsigned i; for (i = 0; i < sizeof(devtypes) / sizeof(devtypes[0]); i++) netlink_add_device(&nlmsg, sock, devtypes[i].type, devtypes[i].dev); for (i = 0; i < sizeof(devmasters) / (sizeof(devmasters[0])); i++) { char master[32], slave0[32], veth0[32], slave1[32], veth1[32]; sprintf(slave0, "%s_slave_0", devmasters[i]); sprintf(veth0, "veth0_to_%s", devmasters[i]); netlink_add_veth(&nlmsg, sock, slave0, veth0); sprintf(slave1, "%s_slave_1", devmasters[i]); sprintf(veth1, "veth1_to_%s", devmasters[i]); netlink_add_veth(&nlmsg, sock, slave1, veth1); sprintf(master, "%s0", devmasters[i]); netlink_device_change(&nlmsg, sock, slave0, false, master, 0, 0, NULL); netlink_device_change(&nlmsg, sock, slave1, false, master, 0, 0, NULL); } netlink_device_change(&nlmsg, sock, "bridge_slave_0", true, 0, 0, 0, NULL); netlink_device_change(&nlmsg, sock, "bridge_slave_1", true, 0, 0, 0, NULL); netlink_add_veth(&nlmsg, sock, "hsr_slave_0", "veth0_to_hsr"); netlink_add_veth(&nlmsg, sock, "hsr_slave_1", "veth1_to_hsr"); netlink_add_hsr(&nlmsg, sock, "hsr0", "hsr_slave_0", "hsr_slave_1"); netlink_device_change(&nlmsg, sock, "hsr_slave_0", true, 0, 0, 0, NULL); netlink_device_change(&nlmsg, sock, "hsr_slave_1", true, 0, 0, 0, NULL); netlink_add_veth(&nlmsg, sock, "veth0_virt_wifi", "veth1_virt_wifi"); netlink_add_linked(&nlmsg, sock, "virt_wifi", "virt_wifi0", "veth1_virt_wifi"); netlink_add_veth(&nlmsg, sock, "veth0_vlan", "veth1_vlan"); netlink_add_vlan(&nlmsg, sock, "vlan0", "veth0_vlan", 0, htons(ETH_P_8021Q)); netlink_add_vlan(&nlmsg, sock, "vlan1", "veth0_vlan", 1, htons(ETH_P_8021AD)); netlink_add_macvlan(&nlmsg, sock, "macvlan0", "veth1_vlan"); netlink_add_macvlan(&nlmsg, sock, "macvlan1", "veth1_vlan"); netlink_add_ipvlan(&nlmsg, sock, "ipvlan0", "veth0_vlan", IPVLAN_MODE_L2, 0); netlink_add_ipvlan(&nlmsg, sock, "ipvlan1", "veth0_vlan", IPVLAN_MODE_L3S, IPVLAN_F_VEPA); netlink_add_veth(&nlmsg, sock, "veth0_macvtap", "veth1_macvtap"); netlink_add_linked(&nlmsg, sock, "macvtap", "macvtap0", "veth0_macvtap"); netlink_add_linked(&nlmsg, sock, "macsec", "macsec0", "veth1_macvtap"); char addr[32]; sprintf(addr, DEV_IPV4, 14 + 10); struct in_addr geneve_addr4; if (inet_pton(AF_INET, addr, &geneve_addr4) <= 0) exit(1); struct in6_addr geneve_addr6; if (inet_pton(AF_INET6, "fc00::01", &geneve_addr6) <= 0) exit(1); netlink_add_geneve(&nlmsg, sock, "geneve0", 0, &geneve_addr4, 0); netlink_add_geneve(&nlmsg, sock, "geneve1", 1, 0, &geneve_addr6); netdevsim_add((int)procid, 4); netlink_wireguard_setup(); for (i = 0; i < sizeof(devices) / (sizeof(devices[0])); i++) { char addr[32]; sprintf(addr, DEV_IPV4, i + 10); netlink_add_addr4(&nlmsg, sock, devices[i].name, addr); if (!devices[i].noipv6) { sprintf(addr, DEV_IPV6, i + 10); netlink_add_addr6(&nlmsg, sock, devices[i].name, addr); } uint64_t macaddr = DEV_MAC + ((i + 10ull) << 40); netlink_device_change(&nlmsg, sock, devices[i].name, true, 0, &macaddr, devices[i].macsize, NULL); } close(sock); } static void initialize_netdevices_init(void) { int sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (sock == -1) exit(1); struct { const char* type; int macsize; bool noipv6; bool noup; } devtypes[] = { {"nr", 7, true}, {"rose", 5, true, true}, }; unsigned i; for (i = 0; i < sizeof(devtypes) / sizeof(devtypes[0]); i++) { char dev[32], addr[32]; sprintf(dev, "%s%d", devtypes[i].type, (int)procid); sprintf(addr, "172.30.%d.%d", i, (int)procid + 1); netlink_add_addr4(&nlmsg, sock, dev, addr); if (!devtypes[i].noipv6) { sprintf(addr, "fe88::%02x:%02x", i, (int)procid + 1); netlink_add_addr6(&nlmsg, sock, dev, addr); } int macsize = devtypes[i].macsize; uint64_t macaddr = 0xbbbbbb + ((unsigned long long)i << (8 * (macsize - 2))) + (procid << (8 * (macsize - 1))); netlink_device_change(&nlmsg, sock, dev, !devtypes[i].noup, 0, &macaddr, macsize, NULL); } close(sock); } static int read_tun(char* data, int size) { if (tunfd < 0) return -1; int rv = read(tunfd, data, size); if (rv < 0) { if (errno == EAGAIN || errno == EBADFD) return -1; exit(1); } return rv; } static void flush_tun() { char data[1000]; while (read_tun(&data[0], sizeof(data)) != -1) { } } #define MAX_FDS 30 static void setup_common() { if (mount(0, "/sys/fs/fuse/connections", "fusectl", 0, 0)) { } } static void loop(); static void sandbox_common() { prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); setsid(); struct rlimit rlim; rlim.rlim_cur = rlim.rlim_max = (200 << 20); setrlimit(RLIMIT_AS, &rlim); rlim.rlim_cur = rlim.rlim_max = 32 << 20; setrlimit(RLIMIT_MEMLOCK, &rlim); rlim.rlim_cur = rlim.rlim_max = 136 << 20; setrlimit(RLIMIT_FSIZE, &rlim); rlim.rlim_cur = rlim.rlim_max = 1 << 20; setrlimit(RLIMIT_STACK, &rlim); rlim.rlim_cur = rlim.rlim_max = 0; setrlimit(RLIMIT_CORE, &rlim); rlim.rlim_cur = rlim.rlim_max = 256; setrlimit(RLIMIT_NOFILE, &rlim); if (unshare(CLONE_NEWNS)) { } if (mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, NULL)) { } if (unshare(CLONE_NEWIPC)) { } if (unshare(0x02000000)) { } if (unshare(CLONE_NEWUTS)) { } if (unshare(CLONE_SYSVSEM)) { } typedef struct { const char* name; const char* value; } sysctl_t; static const sysctl_t sysctls[] = { {"/proc/sys/kernel/shmmax", "16777216"}, {"/proc/sys/kernel/shmall", "536870912"}, {"/proc/sys/kernel/shmmni", "1024"}, {"/proc/sys/kernel/msgmax", "8192"}, {"/proc/sys/kernel/msgmni", "1024"}, {"/proc/sys/kernel/msgmnb", "1024"}, {"/proc/sys/kernel/sem", "1024 1048576 500 1024"}, }; unsigned i; for (i = 0; i < sizeof(sysctls) / sizeof(sysctls[0]); i++) write_file(sysctls[i].name, sysctls[i].value); } static int wait_for_loop(int pid) { if (pid < 0) exit(1); int status = 0; while (waitpid(-1, &status, __WALL) != pid) { } return WEXITSTATUS(status); } static void drop_caps(void) { struct __user_cap_header_struct cap_hdr = {}; struct __user_cap_data_struct cap_data[2] = {}; cap_hdr.version = _LINUX_CAPABILITY_VERSION_3; cap_hdr.pid = getpid(); if (syscall(SYS_capget, &cap_hdr, &cap_data)) exit(1); const int drop = (1 << CAP_SYS_PTRACE) | (1 << CAP_SYS_NICE); cap_data[0].effective &= ~drop; cap_data[0].permitted &= ~drop; cap_data[0].inheritable &= ~drop; if (syscall(SYS_capset, &cap_hdr, &cap_data)) exit(1); } static int do_sandbox_none(void) { if (unshare(CLONE_NEWPID)) { } int pid = fork(); if (pid != 0) return wait_for_loop(pid); setup_common(); sandbox_common(); drop_caps(); initialize_netdevices_init(); if (unshare(CLONE_NEWNET)) { } initialize_tun(); initialize_netdevices(); loop(); exit(1); } static void kill_and_wait(int pid, int* status) { kill(-pid, SIGKILL); kill(pid, SIGKILL); for (int i = 0; i < 100; i++) { if (waitpid(-1, status, WNOHANG | __WALL) == pid) return; usleep(1000); } DIR* dir = opendir("/sys/fs/fuse/connections"); if (dir) { for (;;) { struct dirent* ent = readdir(dir); if (!ent) break; if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0) continue; char abort[300]; snprintf(abort, sizeof(abort), "/sys/fs/fuse/connections/%s/abort", ent->d_name); int fd = open(abort, O_WRONLY); if (fd == -1) { continue; } if (write(fd, abort, 1) < 0) { } close(fd); } closedir(dir); } else { } while (waitpid(-1, status, __WALL) != pid) { } } static void setup_test() { prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); setpgrp(); write_file("/proc/self/oom_score_adj", "1000"); flush_tun(); } static void close_fds() { for (int fd = 3; fd < MAX_FDS; fd++) close(fd); } struct thread_t { int created, call; event_t ready, done; }; static struct thread_t threads[16]; static void execute_call(int call); static int running; static void* thr(void* arg) { struct thread_t* th = (struct thread_t*)arg; for (;;) { event_wait(&th->ready); event_reset(&th->ready); execute_call(th->call); __atomic_fetch_sub(&running, 1, __ATOMIC_RELAXED); event_set(&th->done); } return 0; } static void execute_one(void) { int i, call, thread; for (call = 0; call < 3; call++) { for (thread = 0; thread < (int)(sizeof(threads) / sizeof(threads[0])); thread++) { struct thread_t* th = &threads[thread]; if (!th->created) { th->created = 1; event_init(&th->ready); event_init(&th->done); event_set(&th->done); thread_start(thr, th); } if (!event_isset(&th->done)) continue; event_reset(&th->done); th->call = call; __atomic_fetch_add(&running, 1, __ATOMIC_RELAXED); event_set(&th->ready); event_timedwait(&th->done, 50); break; } } for (i = 0; i < 100 && __atomic_load_n(&running, __ATOMIC_RELAXED); i++) sleep_ms(1); close_fds(); } static void execute_one(void); #define WAIT_FLAGS __WALL static void loop(void) { int iter = 0; for (;; iter++) { int pid = fork(); if (pid < 0) exit(1); if (pid == 0) { setup_test(); execute_one(); exit(0); } int status = 0; uint64_t start = current_time_ms(); for (;;) { if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) break; sleep_ms(1); if (current_time_ms() - start < 5000) { continue; } kill_and_wait(pid, &status); break; } } } uint64_t r[1] = {0xffffffffffffffff}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: res = syscall(__NR_socket, 0xaul, 1ul, 0x106); if (res != -1) r[0] = res; break; case 1: *(uint16_t*)0x20000040 = 0xa; *(uint16_t*)0x20000042 = htobe16(0x4001); *(uint32_t*)0x20000044 = htobe32(0); *(uint8_t*)0x20000048 = 0xfe; *(uint8_t*)0x20000049 = 0x80; *(uint8_t*)0x2000004a = 0; *(uint8_t*)0x2000004b = 0; *(uint8_t*)0x2000004c = 0; *(uint8_t*)0x2000004d = 0; *(uint8_t*)0x2000004e = 0; *(uint8_t*)0x2000004f = 0; *(uint8_t*)0x20000050 = 0; *(uint8_t*)0x20000051 = 0; *(uint8_t*)0x20000052 = 0; *(uint8_t*)0x20000053 = 0; *(uint8_t*)0x20000054 = 0; *(uint8_t*)0x20000055 = 0; *(uint8_t*)0x20000056 = 0; *(uint8_t*)0x20000057 = 0x1c; *(uint32_t*)0x20000058 = 0xd; syscall(__NR_connect, r[0], 0x20000040ul, 0x1cul); break; case 2: *(uint8_t*)0x20000100 = 0x3a; *(uint8_t*)0x20000101 = 0xb; *(uint8_t*)0x20000102 = 0; *(uint8_t*)0x20000103 = 0; *(uint8_t*)0x20000104 = 0; *(uint8_t*)0x20000105 = 0; *(uint8_t*)0x20000106 = 0; *(uint8_t*)0x20000107 = 0; *(uint8_t*)0x20000108 = 7; *(uint8_t*)0x20000109 = 0x28; *(uint32_t*)0x2000010a = htobe32(1); *(uint8_t*)0x2000010e = 8; *(uint8_t*)0x2000010f = 9; *(uint16_t*)0x20000110 = 9; *(uint64_t*)0x20000112 = 0xb800000; *(uint64_t*)0x2000011a = 6; *(uint64_t*)0x20000122 = 0x40; *(uint64_t*)0x2000012a = 0xff12; *(uint8_t*)0x20000132 = 0xc9; *(uint8_t*)0x20000133 = 0x10; *(uint8_t*)0x20000134 = 0xfc; *(uint8_t*)0x20000135 = 1; *(uint8_t*)0x20000136 = 0; *(uint8_t*)0x20000137 = 0; *(uint8_t*)0x20000138 = 0; *(uint8_t*)0x20000139 = 0; *(uint8_t*)0x2000013a = 0; *(uint8_t*)0x2000013b = 0; *(uint8_t*)0x2000013c = 0; *(uint8_t*)0x2000013d = 0; *(uint8_t*)0x2000013e = 0; *(uint8_t*)0x2000013f = 0; *(uint8_t*)0x20000140 = 0; *(uint8_t*)0x20000141 = 0; *(uint8_t*)0x20000142 = 0; *(uint8_t*)0x20000143 = 1; *(uint8_t*)0x20000144 = 0xc9; *(uint8_t*)0x20000145 = 0x10; *(uint8_t*)0x20000146 = 0xfe; *(uint8_t*)0x20000147 = 0x80; *(uint8_t*)0x20000148 = 0; *(uint8_t*)0x20000149 = 0; *(uint8_t*)0x2000014a = 0; *(uint8_t*)0x2000014b = 0; *(uint8_t*)0x2000014c = 0; *(uint8_t*)0x2000014d = 0; *(uint8_t*)0x2000014e = 0; *(uint8_t*)0x2000014f = 0; *(uint8_t*)0x20000150 = 0; *(uint8_t*)0x20000151 = 0; *(uint8_t*)0x20000152 = 0; *(uint8_t*)0x20000153 = 0; *(uint8_t*)0x20000154 = 0; *(uint8_t*)0x20000155 = 0xaa; *(uint8_t*)0x20000156 = 4; *(uint8_t*)0x20000157 = 1; *(uint8_t*)0x20000158 = 0x9a; *(uint8_t*)0x20000159 = 9; *(uint8_t*)0x2000015a = 0; *(uint8_t*)0x2000015b = 4; *(uint8_t*)0x2000015c = 1; *(uint8_t*)0x2000015d = 0x81; *(uint8_t*)0x2000015e = 0xc2; *(uint8_t*)0x2000015f = 4; *(uint32_t*)0x20000160 = htobe32(5); *(uint8_t*)0x20000164 = 0; *(uint8_t*)0x20000165 = 1; *(uint8_t*)0x20000166 = 0; syscall(__NR_setsockopt, r[0], 0x29, 0x37, 0x20000100ul, 0x68ul); break; } } int main(void) { syscall(__NR_mmap, 0x1ffff000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x21000000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); do_sandbox_none(); return 0; }
the_stack_data/95450435.c
//@ ltl invariant negative: (<> (AP(x_4 - x_19 >= 13) && ([] AP(x_15 - x_0 >= -8)))); float x_0; float x_1; float x_2; float x_3; float x_4; float x_5; float x_6; float x_7; float x_8; float x_9; float x_10; float x_11; float x_12; float x_13; float x_14; float x_15; float x_16; float x_17; float x_18; float x_19; int main() { float x_0_; float x_1_; float x_2_; float x_3_; float x_4_; float x_5_; float x_6_; float x_7_; float x_8_; float x_9_; float x_10_; float x_11_; float x_12_; float x_13_; float x_14_; float x_15_; float x_16_; float x_17_; float x_18_; float x_19_; while(1) { x_0_ = ((((6.0 + x_0) > (20.0 + x_1)? (6.0 + x_0) : (20.0 + x_1)) > ((5.0 + x_6) > ((17.0 + x_7) > (5.0 + x_11)? (17.0 + x_7) : (5.0 + x_11))? (5.0 + x_6) : ((17.0 + x_7) > (5.0 + x_11)? (17.0 + x_7) : (5.0 + x_11)))? ((6.0 + x_0) > (20.0 + x_1)? (6.0 + x_0) : (20.0 + x_1)) : ((5.0 + x_6) > ((17.0 + x_7) > (5.0 + x_11)? (17.0 + x_7) : (5.0 + x_11))? (5.0 + x_6) : ((17.0 + x_7) > (5.0 + x_11)? (17.0 + x_7) : (5.0 + x_11)))) > (((18.0 + x_12) > (9.0 + x_15)? (18.0 + x_12) : (9.0 + x_15)) > ((16.0 + x_16) > ((18.0 + x_17) > (7.0 + x_19)? (18.0 + x_17) : (7.0 + x_19))? (16.0 + x_16) : ((18.0 + x_17) > (7.0 + x_19)? (18.0 + x_17) : (7.0 + x_19)))? ((18.0 + x_12) > (9.0 + x_15)? (18.0 + x_12) : (9.0 + x_15)) : ((16.0 + x_16) > ((18.0 + x_17) > (7.0 + x_19)? (18.0 + x_17) : (7.0 + x_19))? (16.0 + x_16) : ((18.0 + x_17) > (7.0 + x_19)? (18.0 + x_17) : (7.0 + x_19))))? (((6.0 + x_0) > (20.0 + x_1)? (6.0 + x_0) : (20.0 + x_1)) > ((5.0 + x_6) > ((17.0 + x_7) > (5.0 + x_11)? (17.0 + x_7) : (5.0 + x_11))? (5.0 + x_6) : ((17.0 + x_7) > (5.0 + x_11)? (17.0 + x_7) : (5.0 + x_11)))? ((6.0 + x_0) > (20.0 + x_1)? (6.0 + x_0) : (20.0 + x_1)) : ((5.0 + x_6) > ((17.0 + x_7) > (5.0 + x_11)? (17.0 + x_7) : (5.0 + x_11))? (5.0 + x_6) : ((17.0 + x_7) > (5.0 + x_11)? (17.0 + x_7) : (5.0 + x_11)))) : (((18.0 + x_12) > (9.0 + x_15)? (18.0 + x_12) : (9.0 + x_15)) > ((16.0 + x_16) > ((18.0 + x_17) > (7.0 + x_19)? (18.0 + x_17) : (7.0 + x_19))? (16.0 + x_16) : ((18.0 + x_17) > (7.0 + x_19)? (18.0 + x_17) : (7.0 + x_19)))? ((18.0 + x_12) > (9.0 + x_15)? (18.0 + x_12) : (9.0 + x_15)) : ((16.0 + x_16) > ((18.0 + x_17) > (7.0 + x_19)? (18.0 + x_17) : (7.0 + x_19))? (16.0 + x_16) : ((18.0 + x_17) > (7.0 + x_19)? (18.0 + x_17) : (7.0 + x_19))))); x_1_ = ((((2.0 + x_0) > (2.0 + x_4)? (2.0 + x_0) : (2.0 + x_4)) > ((1.0 + x_5) > ((18.0 + x_8) > (10.0 + x_9)? (18.0 + x_8) : (10.0 + x_9))? (1.0 + x_5) : ((18.0 + x_8) > (10.0 + x_9)? (18.0 + x_8) : (10.0 + x_9)))? ((2.0 + x_0) > (2.0 + x_4)? (2.0 + x_0) : (2.0 + x_4)) : ((1.0 + x_5) > ((18.0 + x_8) > (10.0 + x_9)? (18.0 + x_8) : (10.0 + x_9))? (1.0 + x_5) : ((18.0 + x_8) > (10.0 + x_9)? (18.0 + x_8) : (10.0 + x_9)))) > (((10.0 + x_12) > (9.0 + x_13)? (10.0 + x_12) : (9.0 + x_13)) > ((6.0 + x_14) > ((11.0 + x_17) > (9.0 + x_18)? (11.0 + x_17) : (9.0 + x_18))? (6.0 + x_14) : ((11.0 + x_17) > (9.0 + x_18)? (11.0 + x_17) : (9.0 + x_18)))? ((10.0 + x_12) > (9.0 + x_13)? (10.0 + x_12) : (9.0 + x_13)) : ((6.0 + x_14) > ((11.0 + x_17) > (9.0 + x_18)? (11.0 + x_17) : (9.0 + x_18))? (6.0 + x_14) : ((11.0 + x_17) > (9.0 + x_18)? (11.0 + x_17) : (9.0 + x_18))))? (((2.0 + x_0) > (2.0 + x_4)? (2.0 + x_0) : (2.0 + x_4)) > ((1.0 + x_5) > ((18.0 + x_8) > (10.0 + x_9)? (18.0 + x_8) : (10.0 + x_9))? (1.0 + x_5) : ((18.0 + x_8) > (10.0 + x_9)? (18.0 + x_8) : (10.0 + x_9)))? ((2.0 + x_0) > (2.0 + x_4)? (2.0 + x_0) : (2.0 + x_4)) : ((1.0 + x_5) > ((18.0 + x_8) > (10.0 + x_9)? (18.0 + x_8) : (10.0 + x_9))? (1.0 + x_5) : ((18.0 + x_8) > (10.0 + x_9)? (18.0 + x_8) : (10.0 + x_9)))) : (((10.0 + x_12) > (9.0 + x_13)? (10.0 + x_12) : (9.0 + x_13)) > ((6.0 + x_14) > ((11.0 + x_17) > (9.0 + x_18)? (11.0 + x_17) : (9.0 + x_18))? (6.0 + x_14) : ((11.0 + x_17) > (9.0 + x_18)? (11.0 + x_17) : (9.0 + x_18)))? ((10.0 + x_12) > (9.0 + x_13)? (10.0 + x_12) : (9.0 + x_13)) : ((6.0 + x_14) > ((11.0 + x_17) > (9.0 + x_18)? (11.0 + x_17) : (9.0 + x_18))? (6.0 + x_14) : ((11.0 + x_17) > (9.0 + x_18)? (11.0 + x_17) : (9.0 + x_18))))); x_2_ = ((((16.0 + x_1) > (9.0 + x_2)? (16.0 + x_1) : (9.0 + x_2)) > ((3.0 + x_3) > ((15.0 + x_4) > (18.0 + x_5)? (15.0 + x_4) : (18.0 + x_5))? (3.0 + x_3) : ((15.0 + x_4) > (18.0 + x_5)? (15.0 + x_4) : (18.0 + x_5)))? ((16.0 + x_1) > (9.0 + x_2)? (16.0 + x_1) : (9.0 + x_2)) : ((3.0 + x_3) > ((15.0 + x_4) > (18.0 + x_5)? (15.0 + x_4) : (18.0 + x_5))? (3.0 + x_3) : ((15.0 + x_4) > (18.0 + x_5)? (15.0 + x_4) : (18.0 + x_5)))) > (((14.0 + x_10) > (6.0 + x_11)? (14.0 + x_10) : (6.0 + x_11)) > ((20.0 + x_12) > ((8.0 + x_13) > (5.0 + x_14)? (8.0 + x_13) : (5.0 + x_14))? (20.0 + x_12) : ((8.0 + x_13) > (5.0 + x_14)? (8.0 + x_13) : (5.0 + x_14)))? ((14.0 + x_10) > (6.0 + x_11)? (14.0 + x_10) : (6.0 + x_11)) : ((20.0 + x_12) > ((8.0 + x_13) > (5.0 + x_14)? (8.0 + x_13) : (5.0 + x_14))? (20.0 + x_12) : ((8.0 + x_13) > (5.0 + x_14)? (8.0 + x_13) : (5.0 + x_14))))? (((16.0 + x_1) > (9.0 + x_2)? (16.0 + x_1) : (9.0 + x_2)) > ((3.0 + x_3) > ((15.0 + x_4) > (18.0 + x_5)? (15.0 + x_4) : (18.0 + x_5))? (3.0 + x_3) : ((15.0 + x_4) > (18.0 + x_5)? (15.0 + x_4) : (18.0 + x_5)))? ((16.0 + x_1) > (9.0 + x_2)? (16.0 + x_1) : (9.0 + x_2)) : ((3.0 + x_3) > ((15.0 + x_4) > (18.0 + x_5)? (15.0 + x_4) : (18.0 + x_5))? (3.0 + x_3) : ((15.0 + x_4) > (18.0 + x_5)? (15.0 + x_4) : (18.0 + x_5)))) : (((14.0 + x_10) > (6.0 + x_11)? (14.0 + x_10) : (6.0 + x_11)) > ((20.0 + x_12) > ((8.0 + x_13) > (5.0 + x_14)? (8.0 + x_13) : (5.0 + x_14))? (20.0 + x_12) : ((8.0 + x_13) > (5.0 + x_14)? (8.0 + x_13) : (5.0 + x_14)))? ((14.0 + x_10) > (6.0 + x_11)? (14.0 + x_10) : (6.0 + x_11)) : ((20.0 + x_12) > ((8.0 + x_13) > (5.0 + x_14)? (8.0 + x_13) : (5.0 + x_14))? (20.0 + x_12) : ((8.0 + x_13) > (5.0 + x_14)? (8.0 + x_13) : (5.0 + x_14))))); x_3_ = ((((14.0 + x_1) > (4.0 + x_3)? (14.0 + x_1) : (4.0 + x_3)) > ((2.0 + x_5) > ((13.0 + x_6) > (10.0 + x_7)? (13.0 + x_6) : (10.0 + x_7))? (2.0 + x_5) : ((13.0 + x_6) > (10.0 + x_7)? (13.0 + x_6) : (10.0 + x_7)))? ((14.0 + x_1) > (4.0 + x_3)? (14.0 + x_1) : (4.0 + x_3)) : ((2.0 + x_5) > ((13.0 + x_6) > (10.0 + x_7)? (13.0 + x_6) : (10.0 + x_7))? (2.0 + x_5) : ((13.0 + x_6) > (10.0 + x_7)? (13.0 + x_6) : (10.0 + x_7)))) > (((16.0 + x_10) > (17.0 + x_11)? (16.0 + x_10) : (17.0 + x_11)) > ((17.0 + x_13) > ((5.0 + x_14) > (1.0 + x_15)? (5.0 + x_14) : (1.0 + x_15))? (17.0 + x_13) : ((5.0 + x_14) > (1.0 + x_15)? (5.0 + x_14) : (1.0 + x_15)))? ((16.0 + x_10) > (17.0 + x_11)? (16.0 + x_10) : (17.0 + x_11)) : ((17.0 + x_13) > ((5.0 + x_14) > (1.0 + x_15)? (5.0 + x_14) : (1.0 + x_15))? (17.0 + x_13) : ((5.0 + x_14) > (1.0 + x_15)? (5.0 + x_14) : (1.0 + x_15))))? (((14.0 + x_1) > (4.0 + x_3)? (14.0 + x_1) : (4.0 + x_3)) > ((2.0 + x_5) > ((13.0 + x_6) > (10.0 + x_7)? (13.0 + x_6) : (10.0 + x_7))? (2.0 + x_5) : ((13.0 + x_6) > (10.0 + x_7)? (13.0 + x_6) : (10.0 + x_7)))? ((14.0 + x_1) > (4.0 + x_3)? (14.0 + x_1) : (4.0 + x_3)) : ((2.0 + x_5) > ((13.0 + x_6) > (10.0 + x_7)? (13.0 + x_6) : (10.0 + x_7))? (2.0 + x_5) : ((13.0 + x_6) > (10.0 + x_7)? (13.0 + x_6) : (10.0 + x_7)))) : (((16.0 + x_10) > (17.0 + x_11)? (16.0 + x_10) : (17.0 + x_11)) > ((17.0 + x_13) > ((5.0 + x_14) > (1.0 + x_15)? (5.0 + x_14) : (1.0 + x_15))? (17.0 + x_13) : ((5.0 + x_14) > (1.0 + x_15)? (5.0 + x_14) : (1.0 + x_15)))? ((16.0 + x_10) > (17.0 + x_11)? (16.0 + x_10) : (17.0 + x_11)) : ((17.0 + x_13) > ((5.0 + x_14) > (1.0 + x_15)? (5.0 + x_14) : (1.0 + x_15))? (17.0 + x_13) : ((5.0 + x_14) > (1.0 + x_15)? (5.0 + x_14) : (1.0 + x_15))))); x_4_ = ((((12.0 + x_1) > (8.0 + x_2)? (12.0 + x_1) : (8.0 + x_2)) > ((5.0 + x_5) > ((18.0 + x_6) > (6.0 + x_10)? (18.0 + x_6) : (6.0 + x_10))? (5.0 + x_5) : ((18.0 + x_6) > (6.0 + x_10)? (18.0 + x_6) : (6.0 + x_10)))? ((12.0 + x_1) > (8.0 + x_2)? (12.0 + x_1) : (8.0 + x_2)) : ((5.0 + x_5) > ((18.0 + x_6) > (6.0 + x_10)? (18.0 + x_6) : (6.0 + x_10))? (5.0 + x_5) : ((18.0 + x_6) > (6.0 + x_10)? (18.0 + x_6) : (6.0 + x_10)))) > (((1.0 + x_11) > (9.0 + x_12)? (1.0 + x_11) : (9.0 + x_12)) > ((1.0 + x_16) > ((17.0 + x_17) > (17.0 + x_18)? (17.0 + x_17) : (17.0 + x_18))? (1.0 + x_16) : ((17.0 + x_17) > (17.0 + x_18)? (17.0 + x_17) : (17.0 + x_18)))? ((1.0 + x_11) > (9.0 + x_12)? (1.0 + x_11) : (9.0 + x_12)) : ((1.0 + x_16) > ((17.0 + x_17) > (17.0 + x_18)? (17.0 + x_17) : (17.0 + x_18))? (1.0 + x_16) : ((17.0 + x_17) > (17.0 + x_18)? (17.0 + x_17) : (17.0 + x_18))))? (((12.0 + x_1) > (8.0 + x_2)? (12.0 + x_1) : (8.0 + x_2)) > ((5.0 + x_5) > ((18.0 + x_6) > (6.0 + x_10)? (18.0 + x_6) : (6.0 + x_10))? (5.0 + x_5) : ((18.0 + x_6) > (6.0 + x_10)? (18.0 + x_6) : (6.0 + x_10)))? ((12.0 + x_1) > (8.0 + x_2)? (12.0 + x_1) : (8.0 + x_2)) : ((5.0 + x_5) > ((18.0 + x_6) > (6.0 + x_10)? (18.0 + x_6) : (6.0 + x_10))? (5.0 + x_5) : ((18.0 + x_6) > (6.0 + x_10)? (18.0 + x_6) : (6.0 + x_10)))) : (((1.0 + x_11) > (9.0 + x_12)? (1.0 + x_11) : (9.0 + x_12)) > ((1.0 + x_16) > ((17.0 + x_17) > (17.0 + x_18)? (17.0 + x_17) : (17.0 + x_18))? (1.0 + x_16) : ((17.0 + x_17) > (17.0 + x_18)? (17.0 + x_17) : (17.0 + x_18)))? ((1.0 + x_11) > (9.0 + x_12)? (1.0 + x_11) : (9.0 + x_12)) : ((1.0 + x_16) > ((17.0 + x_17) > (17.0 + x_18)? (17.0 + x_17) : (17.0 + x_18))? (1.0 + x_16) : ((17.0 + x_17) > (17.0 + x_18)? (17.0 + x_17) : (17.0 + x_18))))); x_5_ = ((((6.0 + x_0) > (13.0 + x_2)? (6.0 + x_0) : (13.0 + x_2)) > ((15.0 + x_3) > ((9.0 + x_6) > (2.0 + x_7)? (9.0 + x_6) : (2.0 + x_7))? (15.0 + x_3) : ((9.0 + x_6) > (2.0 + x_7)? (9.0 + x_6) : (2.0 + x_7)))? ((6.0 + x_0) > (13.0 + x_2)? (6.0 + x_0) : (13.0 + x_2)) : ((15.0 + x_3) > ((9.0 + x_6) > (2.0 + x_7)? (9.0 + x_6) : (2.0 + x_7))? (15.0 + x_3) : ((9.0 + x_6) > (2.0 + x_7)? (9.0 + x_6) : (2.0 + x_7)))) > (((19.0 + x_10) > (8.0 + x_11)? (19.0 + x_10) : (8.0 + x_11)) > ((19.0 + x_12) > ((13.0 + x_13) > (4.0 + x_19)? (13.0 + x_13) : (4.0 + x_19))? (19.0 + x_12) : ((13.0 + x_13) > (4.0 + x_19)? (13.0 + x_13) : (4.0 + x_19)))? ((19.0 + x_10) > (8.0 + x_11)? (19.0 + x_10) : (8.0 + x_11)) : ((19.0 + x_12) > ((13.0 + x_13) > (4.0 + x_19)? (13.0 + x_13) : (4.0 + x_19))? (19.0 + x_12) : ((13.0 + x_13) > (4.0 + x_19)? (13.0 + x_13) : (4.0 + x_19))))? (((6.0 + x_0) > (13.0 + x_2)? (6.0 + x_0) : (13.0 + x_2)) > ((15.0 + x_3) > ((9.0 + x_6) > (2.0 + x_7)? (9.0 + x_6) : (2.0 + x_7))? (15.0 + x_3) : ((9.0 + x_6) > (2.0 + x_7)? (9.0 + x_6) : (2.0 + x_7)))? ((6.0 + x_0) > (13.0 + x_2)? (6.0 + x_0) : (13.0 + x_2)) : ((15.0 + x_3) > ((9.0 + x_6) > (2.0 + x_7)? (9.0 + x_6) : (2.0 + x_7))? (15.0 + x_3) : ((9.0 + x_6) > (2.0 + x_7)? (9.0 + x_6) : (2.0 + x_7)))) : (((19.0 + x_10) > (8.0 + x_11)? (19.0 + x_10) : (8.0 + x_11)) > ((19.0 + x_12) > ((13.0 + x_13) > (4.0 + x_19)? (13.0 + x_13) : (4.0 + x_19))? (19.0 + x_12) : ((13.0 + x_13) > (4.0 + x_19)? (13.0 + x_13) : (4.0 + x_19)))? ((19.0 + x_10) > (8.0 + x_11)? (19.0 + x_10) : (8.0 + x_11)) : ((19.0 + x_12) > ((13.0 + x_13) > (4.0 + x_19)? (13.0 + x_13) : (4.0 + x_19))? (19.0 + x_12) : ((13.0 + x_13) > (4.0 + x_19)? (13.0 + x_13) : (4.0 + x_19))))); x_6_ = ((((16.0 + x_1) > (7.0 + x_2)? (16.0 + x_1) : (7.0 + x_2)) > ((18.0 + x_9) > ((19.0 + x_11) > (13.0 + x_12)? (19.0 + x_11) : (13.0 + x_12))? (18.0 + x_9) : ((19.0 + x_11) > (13.0 + x_12)? (19.0 + x_11) : (13.0 + x_12)))? ((16.0 + x_1) > (7.0 + x_2)? (16.0 + x_1) : (7.0 + x_2)) : ((18.0 + x_9) > ((19.0 + x_11) > (13.0 + x_12)? (19.0 + x_11) : (13.0 + x_12))? (18.0 + x_9) : ((19.0 + x_11) > (13.0 + x_12)? (19.0 + x_11) : (13.0 + x_12)))) > (((13.0 + x_13) > (10.0 + x_16)? (13.0 + x_13) : (10.0 + x_16)) > ((11.0 + x_17) > ((11.0 + x_18) > (13.0 + x_19)? (11.0 + x_18) : (13.0 + x_19))? (11.0 + x_17) : ((11.0 + x_18) > (13.0 + x_19)? (11.0 + x_18) : (13.0 + x_19)))? ((13.0 + x_13) > (10.0 + x_16)? (13.0 + x_13) : (10.0 + x_16)) : ((11.0 + x_17) > ((11.0 + x_18) > (13.0 + x_19)? (11.0 + x_18) : (13.0 + x_19))? (11.0 + x_17) : ((11.0 + x_18) > (13.0 + x_19)? (11.0 + x_18) : (13.0 + x_19))))? (((16.0 + x_1) > (7.0 + x_2)? (16.0 + x_1) : (7.0 + x_2)) > ((18.0 + x_9) > ((19.0 + x_11) > (13.0 + x_12)? (19.0 + x_11) : (13.0 + x_12))? (18.0 + x_9) : ((19.0 + x_11) > (13.0 + x_12)? (19.0 + x_11) : (13.0 + x_12)))? ((16.0 + x_1) > (7.0 + x_2)? (16.0 + x_1) : (7.0 + x_2)) : ((18.0 + x_9) > ((19.0 + x_11) > (13.0 + x_12)? (19.0 + x_11) : (13.0 + x_12))? (18.0 + x_9) : ((19.0 + x_11) > (13.0 + x_12)? (19.0 + x_11) : (13.0 + x_12)))) : (((13.0 + x_13) > (10.0 + x_16)? (13.0 + x_13) : (10.0 + x_16)) > ((11.0 + x_17) > ((11.0 + x_18) > (13.0 + x_19)? (11.0 + x_18) : (13.0 + x_19))? (11.0 + x_17) : ((11.0 + x_18) > (13.0 + x_19)? (11.0 + x_18) : (13.0 + x_19)))? ((13.0 + x_13) > (10.0 + x_16)? (13.0 + x_13) : (10.0 + x_16)) : ((11.0 + x_17) > ((11.0 + x_18) > (13.0 + x_19)? (11.0 + x_18) : (13.0 + x_19))? (11.0 + x_17) : ((11.0 + x_18) > (13.0 + x_19)? (11.0 + x_18) : (13.0 + x_19))))); x_7_ = ((((2.0 + x_0) > (17.0 + x_3)? (2.0 + x_0) : (17.0 + x_3)) > ((8.0 + x_5) > ((14.0 + x_7) > (20.0 + x_10)? (14.0 + x_7) : (20.0 + x_10))? (8.0 + x_5) : ((14.0 + x_7) > (20.0 + x_10)? (14.0 + x_7) : (20.0 + x_10)))? ((2.0 + x_0) > (17.0 + x_3)? (2.0 + x_0) : (17.0 + x_3)) : ((8.0 + x_5) > ((14.0 + x_7) > (20.0 + x_10)? (14.0 + x_7) : (20.0 + x_10))? (8.0 + x_5) : ((14.0 + x_7) > (20.0 + x_10)? (14.0 + x_7) : (20.0 + x_10)))) > (((14.0 + x_11) > (4.0 + x_12)? (14.0 + x_11) : (4.0 + x_12)) > ((15.0 + x_14) > ((17.0 + x_15) > (9.0 + x_18)? (17.0 + x_15) : (9.0 + x_18))? (15.0 + x_14) : ((17.0 + x_15) > (9.0 + x_18)? (17.0 + x_15) : (9.0 + x_18)))? ((14.0 + x_11) > (4.0 + x_12)? (14.0 + x_11) : (4.0 + x_12)) : ((15.0 + x_14) > ((17.0 + x_15) > (9.0 + x_18)? (17.0 + x_15) : (9.0 + x_18))? (15.0 + x_14) : ((17.0 + x_15) > (9.0 + x_18)? (17.0 + x_15) : (9.0 + x_18))))? (((2.0 + x_0) > (17.0 + x_3)? (2.0 + x_0) : (17.0 + x_3)) > ((8.0 + x_5) > ((14.0 + x_7) > (20.0 + x_10)? (14.0 + x_7) : (20.0 + x_10))? (8.0 + x_5) : ((14.0 + x_7) > (20.0 + x_10)? (14.0 + x_7) : (20.0 + x_10)))? ((2.0 + x_0) > (17.0 + x_3)? (2.0 + x_0) : (17.0 + x_3)) : ((8.0 + x_5) > ((14.0 + x_7) > (20.0 + x_10)? (14.0 + x_7) : (20.0 + x_10))? (8.0 + x_5) : ((14.0 + x_7) > (20.0 + x_10)? (14.0 + x_7) : (20.0 + x_10)))) : (((14.0 + x_11) > (4.0 + x_12)? (14.0 + x_11) : (4.0 + x_12)) > ((15.0 + x_14) > ((17.0 + x_15) > (9.0 + x_18)? (17.0 + x_15) : (9.0 + x_18))? (15.0 + x_14) : ((17.0 + x_15) > (9.0 + x_18)? (17.0 + x_15) : (9.0 + x_18)))? ((14.0 + x_11) > (4.0 + x_12)? (14.0 + x_11) : (4.0 + x_12)) : ((15.0 + x_14) > ((17.0 + x_15) > (9.0 + x_18)? (17.0 + x_15) : (9.0 + x_18))? (15.0 + x_14) : ((17.0 + x_15) > (9.0 + x_18)? (17.0 + x_15) : (9.0 + x_18))))); x_8_ = ((((8.0 + x_1) > (17.0 + x_4)? (8.0 + x_1) : (17.0 + x_4)) > ((2.0 + x_5) > ((7.0 + x_6) > (1.0 + x_7)? (7.0 + x_6) : (1.0 + x_7))? (2.0 + x_5) : ((7.0 + x_6) > (1.0 + x_7)? (7.0 + x_6) : (1.0 + x_7)))? ((8.0 + x_1) > (17.0 + x_4)? (8.0 + x_1) : (17.0 + x_4)) : ((2.0 + x_5) > ((7.0 + x_6) > (1.0 + x_7)? (7.0 + x_6) : (1.0 + x_7))? (2.0 + x_5) : ((7.0 + x_6) > (1.0 + x_7)? (7.0 + x_6) : (1.0 + x_7)))) > (((16.0 + x_10) > (10.0 + x_11)? (16.0 + x_10) : (10.0 + x_11)) > ((13.0 + x_12) > ((5.0 + x_14) > (19.0 + x_16)? (5.0 + x_14) : (19.0 + x_16))? (13.0 + x_12) : ((5.0 + x_14) > (19.0 + x_16)? (5.0 + x_14) : (19.0 + x_16)))? ((16.0 + x_10) > (10.0 + x_11)? (16.0 + x_10) : (10.0 + x_11)) : ((13.0 + x_12) > ((5.0 + x_14) > (19.0 + x_16)? (5.0 + x_14) : (19.0 + x_16))? (13.0 + x_12) : ((5.0 + x_14) > (19.0 + x_16)? (5.0 + x_14) : (19.0 + x_16))))? (((8.0 + x_1) > (17.0 + x_4)? (8.0 + x_1) : (17.0 + x_4)) > ((2.0 + x_5) > ((7.0 + x_6) > (1.0 + x_7)? (7.0 + x_6) : (1.0 + x_7))? (2.0 + x_5) : ((7.0 + x_6) > (1.0 + x_7)? (7.0 + x_6) : (1.0 + x_7)))? ((8.0 + x_1) > (17.0 + x_4)? (8.0 + x_1) : (17.0 + x_4)) : ((2.0 + x_5) > ((7.0 + x_6) > (1.0 + x_7)? (7.0 + x_6) : (1.0 + x_7))? (2.0 + x_5) : ((7.0 + x_6) > (1.0 + x_7)? (7.0 + x_6) : (1.0 + x_7)))) : (((16.0 + x_10) > (10.0 + x_11)? (16.0 + x_10) : (10.0 + x_11)) > ((13.0 + x_12) > ((5.0 + x_14) > (19.0 + x_16)? (5.0 + x_14) : (19.0 + x_16))? (13.0 + x_12) : ((5.0 + x_14) > (19.0 + x_16)? (5.0 + x_14) : (19.0 + x_16)))? ((16.0 + x_10) > (10.0 + x_11)? (16.0 + x_10) : (10.0 + x_11)) : ((13.0 + x_12) > ((5.0 + x_14) > (19.0 + x_16)? (5.0 + x_14) : (19.0 + x_16))? (13.0 + x_12) : ((5.0 + x_14) > (19.0 + x_16)? (5.0 + x_14) : (19.0 + x_16))))); x_9_ = ((((10.0 + x_0) > (16.0 + x_3)? (10.0 + x_0) : (16.0 + x_3)) > ((9.0 + x_8) > ((8.0 + x_9) > (17.0 + x_10)? (8.0 + x_9) : (17.0 + x_10))? (9.0 + x_8) : ((8.0 + x_9) > (17.0 + x_10)? (8.0 + x_9) : (17.0 + x_10)))? ((10.0 + x_0) > (16.0 + x_3)? (10.0 + x_0) : (16.0 + x_3)) : ((9.0 + x_8) > ((8.0 + x_9) > (17.0 + x_10)? (8.0 + x_9) : (17.0 + x_10))? (9.0 + x_8) : ((8.0 + x_9) > (17.0 + x_10)? (8.0 + x_9) : (17.0 + x_10)))) > (((4.0 + x_12) > (1.0 + x_13)? (4.0 + x_12) : (1.0 + x_13)) > ((18.0 + x_15) > ((9.0 + x_17) > (15.0 + x_18)? (9.0 + x_17) : (15.0 + x_18))? (18.0 + x_15) : ((9.0 + x_17) > (15.0 + x_18)? (9.0 + x_17) : (15.0 + x_18)))? ((4.0 + x_12) > (1.0 + x_13)? (4.0 + x_12) : (1.0 + x_13)) : ((18.0 + x_15) > ((9.0 + x_17) > (15.0 + x_18)? (9.0 + x_17) : (15.0 + x_18))? (18.0 + x_15) : ((9.0 + x_17) > (15.0 + x_18)? (9.0 + x_17) : (15.0 + x_18))))? (((10.0 + x_0) > (16.0 + x_3)? (10.0 + x_0) : (16.0 + x_3)) > ((9.0 + x_8) > ((8.0 + x_9) > (17.0 + x_10)? (8.0 + x_9) : (17.0 + x_10))? (9.0 + x_8) : ((8.0 + x_9) > (17.0 + x_10)? (8.0 + x_9) : (17.0 + x_10)))? ((10.0 + x_0) > (16.0 + x_3)? (10.0 + x_0) : (16.0 + x_3)) : ((9.0 + x_8) > ((8.0 + x_9) > (17.0 + x_10)? (8.0 + x_9) : (17.0 + x_10))? (9.0 + x_8) : ((8.0 + x_9) > (17.0 + x_10)? (8.0 + x_9) : (17.0 + x_10)))) : (((4.0 + x_12) > (1.0 + x_13)? (4.0 + x_12) : (1.0 + x_13)) > ((18.0 + x_15) > ((9.0 + x_17) > (15.0 + x_18)? (9.0 + x_17) : (15.0 + x_18))? (18.0 + x_15) : ((9.0 + x_17) > (15.0 + x_18)? (9.0 + x_17) : (15.0 + x_18)))? ((4.0 + x_12) > (1.0 + x_13)? (4.0 + x_12) : (1.0 + x_13)) : ((18.0 + x_15) > ((9.0 + x_17) > (15.0 + x_18)? (9.0 + x_17) : (15.0 + x_18))? (18.0 + x_15) : ((9.0 + x_17) > (15.0 + x_18)? (9.0 + x_17) : (15.0 + x_18))))); x_10_ = ((((2.0 + x_6) > (9.0 + x_8)? (2.0 + x_6) : (9.0 + x_8)) > ((6.0 + x_9) > ((1.0 + x_11) > (8.0 + x_12)? (1.0 + x_11) : (8.0 + x_12))? (6.0 + x_9) : ((1.0 + x_11) > (8.0 + x_12)? (1.0 + x_11) : (8.0 + x_12)))? ((2.0 + x_6) > (9.0 + x_8)? (2.0 + x_6) : (9.0 + x_8)) : ((6.0 + x_9) > ((1.0 + x_11) > (8.0 + x_12)? (1.0 + x_11) : (8.0 + x_12))? (6.0 + x_9) : ((1.0 + x_11) > (8.0 + x_12)? (1.0 + x_11) : (8.0 + x_12)))) > (((4.0 + x_14) > (4.0 + x_15)? (4.0 + x_14) : (4.0 + x_15)) > ((7.0 + x_16) > ((18.0 + x_17) > (18.0 + x_18)? (18.0 + x_17) : (18.0 + x_18))? (7.0 + x_16) : ((18.0 + x_17) > (18.0 + x_18)? (18.0 + x_17) : (18.0 + x_18)))? ((4.0 + x_14) > (4.0 + x_15)? (4.0 + x_14) : (4.0 + x_15)) : ((7.0 + x_16) > ((18.0 + x_17) > (18.0 + x_18)? (18.0 + x_17) : (18.0 + x_18))? (7.0 + x_16) : ((18.0 + x_17) > (18.0 + x_18)? (18.0 + x_17) : (18.0 + x_18))))? (((2.0 + x_6) > (9.0 + x_8)? (2.0 + x_6) : (9.0 + x_8)) > ((6.0 + x_9) > ((1.0 + x_11) > (8.0 + x_12)? (1.0 + x_11) : (8.0 + x_12))? (6.0 + x_9) : ((1.0 + x_11) > (8.0 + x_12)? (1.0 + x_11) : (8.0 + x_12)))? ((2.0 + x_6) > (9.0 + x_8)? (2.0 + x_6) : (9.0 + x_8)) : ((6.0 + x_9) > ((1.0 + x_11) > (8.0 + x_12)? (1.0 + x_11) : (8.0 + x_12))? (6.0 + x_9) : ((1.0 + x_11) > (8.0 + x_12)? (1.0 + x_11) : (8.0 + x_12)))) : (((4.0 + x_14) > (4.0 + x_15)? (4.0 + x_14) : (4.0 + x_15)) > ((7.0 + x_16) > ((18.0 + x_17) > (18.0 + x_18)? (18.0 + x_17) : (18.0 + x_18))? (7.0 + x_16) : ((18.0 + x_17) > (18.0 + x_18)? (18.0 + x_17) : (18.0 + x_18)))? ((4.0 + x_14) > (4.0 + x_15)? (4.0 + x_14) : (4.0 + x_15)) : ((7.0 + x_16) > ((18.0 + x_17) > (18.0 + x_18)? (18.0 + x_17) : (18.0 + x_18))? (7.0 + x_16) : ((18.0 + x_17) > (18.0 + x_18)? (18.0 + x_17) : (18.0 + x_18))))); x_11_ = ((((3.0 + x_0) > (10.0 + x_2)? (3.0 + x_0) : (10.0 + x_2)) > ((20.0 + x_3) > ((1.0 + x_9) > (16.0 + x_10)? (1.0 + x_9) : (16.0 + x_10))? (20.0 + x_3) : ((1.0 + x_9) > (16.0 + x_10)? (1.0 + x_9) : (16.0 + x_10)))? ((3.0 + x_0) > (10.0 + x_2)? (3.0 + x_0) : (10.0 + x_2)) : ((20.0 + x_3) > ((1.0 + x_9) > (16.0 + x_10)? (1.0 + x_9) : (16.0 + x_10))? (20.0 + x_3) : ((1.0 + x_9) > (16.0 + x_10)? (1.0 + x_9) : (16.0 + x_10)))) > (((17.0 + x_12) > (4.0 + x_14)? (17.0 + x_12) : (4.0 + x_14)) > ((2.0 + x_15) > ((20.0 + x_16) > (8.0 + x_19)? (20.0 + x_16) : (8.0 + x_19))? (2.0 + x_15) : ((20.0 + x_16) > (8.0 + x_19)? (20.0 + x_16) : (8.0 + x_19)))? ((17.0 + x_12) > (4.0 + x_14)? (17.0 + x_12) : (4.0 + x_14)) : ((2.0 + x_15) > ((20.0 + x_16) > (8.0 + x_19)? (20.0 + x_16) : (8.0 + x_19))? (2.0 + x_15) : ((20.0 + x_16) > (8.0 + x_19)? (20.0 + x_16) : (8.0 + x_19))))? (((3.0 + x_0) > (10.0 + x_2)? (3.0 + x_0) : (10.0 + x_2)) > ((20.0 + x_3) > ((1.0 + x_9) > (16.0 + x_10)? (1.0 + x_9) : (16.0 + x_10))? (20.0 + x_3) : ((1.0 + x_9) > (16.0 + x_10)? (1.0 + x_9) : (16.0 + x_10)))? ((3.0 + x_0) > (10.0 + x_2)? (3.0 + x_0) : (10.0 + x_2)) : ((20.0 + x_3) > ((1.0 + x_9) > (16.0 + x_10)? (1.0 + x_9) : (16.0 + x_10))? (20.0 + x_3) : ((1.0 + x_9) > (16.0 + x_10)? (1.0 + x_9) : (16.0 + x_10)))) : (((17.0 + x_12) > (4.0 + x_14)? (17.0 + x_12) : (4.0 + x_14)) > ((2.0 + x_15) > ((20.0 + x_16) > (8.0 + x_19)? (20.0 + x_16) : (8.0 + x_19))? (2.0 + x_15) : ((20.0 + x_16) > (8.0 + x_19)? (20.0 + x_16) : (8.0 + x_19)))? ((17.0 + x_12) > (4.0 + x_14)? (17.0 + x_12) : (4.0 + x_14)) : ((2.0 + x_15) > ((20.0 + x_16) > (8.0 + x_19)? (20.0 + x_16) : (8.0 + x_19))? (2.0 + x_15) : ((20.0 + x_16) > (8.0 + x_19)? (20.0 + x_16) : (8.0 + x_19))))); x_12_ = ((((13.0 + x_0) > (14.0 + x_8)? (13.0 + x_0) : (14.0 + x_8)) > ((2.0 + x_9) > ((4.0 + x_10) > (20.0 + x_11)? (4.0 + x_10) : (20.0 + x_11))? (2.0 + x_9) : ((4.0 + x_10) > (20.0 + x_11)? (4.0 + x_10) : (20.0 + x_11)))? ((13.0 + x_0) > (14.0 + x_8)? (13.0 + x_0) : (14.0 + x_8)) : ((2.0 + x_9) > ((4.0 + x_10) > (20.0 + x_11)? (4.0 + x_10) : (20.0 + x_11))? (2.0 + x_9) : ((4.0 + x_10) > (20.0 + x_11)? (4.0 + x_10) : (20.0 + x_11)))) > (((12.0 + x_14) > (18.0 + x_15)? (12.0 + x_14) : (18.0 + x_15)) > ((15.0 + x_17) > ((18.0 + x_18) > (4.0 + x_19)? (18.0 + x_18) : (4.0 + x_19))? (15.0 + x_17) : ((18.0 + x_18) > (4.0 + x_19)? (18.0 + x_18) : (4.0 + x_19)))? ((12.0 + x_14) > (18.0 + x_15)? (12.0 + x_14) : (18.0 + x_15)) : ((15.0 + x_17) > ((18.0 + x_18) > (4.0 + x_19)? (18.0 + x_18) : (4.0 + x_19))? (15.0 + x_17) : ((18.0 + x_18) > (4.0 + x_19)? (18.0 + x_18) : (4.0 + x_19))))? (((13.0 + x_0) > (14.0 + x_8)? (13.0 + x_0) : (14.0 + x_8)) > ((2.0 + x_9) > ((4.0 + x_10) > (20.0 + x_11)? (4.0 + x_10) : (20.0 + x_11))? (2.0 + x_9) : ((4.0 + x_10) > (20.0 + x_11)? (4.0 + x_10) : (20.0 + x_11)))? ((13.0 + x_0) > (14.0 + x_8)? (13.0 + x_0) : (14.0 + x_8)) : ((2.0 + x_9) > ((4.0 + x_10) > (20.0 + x_11)? (4.0 + x_10) : (20.0 + x_11))? (2.0 + x_9) : ((4.0 + x_10) > (20.0 + x_11)? (4.0 + x_10) : (20.0 + x_11)))) : (((12.0 + x_14) > (18.0 + x_15)? (12.0 + x_14) : (18.0 + x_15)) > ((15.0 + x_17) > ((18.0 + x_18) > (4.0 + x_19)? (18.0 + x_18) : (4.0 + x_19))? (15.0 + x_17) : ((18.0 + x_18) > (4.0 + x_19)? (18.0 + x_18) : (4.0 + x_19)))? ((12.0 + x_14) > (18.0 + x_15)? (12.0 + x_14) : (18.0 + x_15)) : ((15.0 + x_17) > ((18.0 + x_18) > (4.0 + x_19)? (18.0 + x_18) : (4.0 + x_19))? (15.0 + x_17) : ((18.0 + x_18) > (4.0 + x_19)? (18.0 + x_18) : (4.0 + x_19))))); x_13_ = ((((3.0 + x_0) > (12.0 + x_2)? (3.0 + x_0) : (12.0 + x_2)) > ((6.0 + x_4) > ((13.0 + x_6) > (3.0 + x_7)? (13.0 + x_6) : (3.0 + x_7))? (6.0 + x_4) : ((13.0 + x_6) > (3.0 + x_7)? (13.0 + x_6) : (3.0 + x_7)))? ((3.0 + x_0) > (12.0 + x_2)? (3.0 + x_0) : (12.0 + x_2)) : ((6.0 + x_4) > ((13.0 + x_6) > (3.0 + x_7)? (13.0 + x_6) : (3.0 + x_7))? (6.0 + x_4) : ((13.0 + x_6) > (3.0 + x_7)? (13.0 + x_6) : (3.0 + x_7)))) > (((12.0 + x_9) > (15.0 + x_11)? (12.0 + x_9) : (15.0 + x_11)) > ((13.0 + x_12) > ((1.0 + x_13) > (16.0 + x_19)? (1.0 + x_13) : (16.0 + x_19))? (13.0 + x_12) : ((1.0 + x_13) > (16.0 + x_19)? (1.0 + x_13) : (16.0 + x_19)))? ((12.0 + x_9) > (15.0 + x_11)? (12.0 + x_9) : (15.0 + x_11)) : ((13.0 + x_12) > ((1.0 + x_13) > (16.0 + x_19)? (1.0 + x_13) : (16.0 + x_19))? (13.0 + x_12) : ((1.0 + x_13) > (16.0 + x_19)? (1.0 + x_13) : (16.0 + x_19))))? (((3.0 + x_0) > (12.0 + x_2)? (3.0 + x_0) : (12.0 + x_2)) > ((6.0 + x_4) > ((13.0 + x_6) > (3.0 + x_7)? (13.0 + x_6) : (3.0 + x_7))? (6.0 + x_4) : ((13.0 + x_6) > (3.0 + x_7)? (13.0 + x_6) : (3.0 + x_7)))? ((3.0 + x_0) > (12.0 + x_2)? (3.0 + x_0) : (12.0 + x_2)) : ((6.0 + x_4) > ((13.0 + x_6) > (3.0 + x_7)? (13.0 + x_6) : (3.0 + x_7))? (6.0 + x_4) : ((13.0 + x_6) > (3.0 + x_7)? (13.0 + x_6) : (3.0 + x_7)))) : (((12.0 + x_9) > (15.0 + x_11)? (12.0 + x_9) : (15.0 + x_11)) > ((13.0 + x_12) > ((1.0 + x_13) > (16.0 + x_19)? (1.0 + x_13) : (16.0 + x_19))? (13.0 + x_12) : ((1.0 + x_13) > (16.0 + x_19)? (1.0 + x_13) : (16.0 + x_19)))? ((12.0 + x_9) > (15.0 + x_11)? (12.0 + x_9) : (15.0 + x_11)) : ((13.0 + x_12) > ((1.0 + x_13) > (16.0 + x_19)? (1.0 + x_13) : (16.0 + x_19))? (13.0 + x_12) : ((1.0 + x_13) > (16.0 + x_19)? (1.0 + x_13) : (16.0 + x_19))))); x_14_ = ((((13.0 + x_0) > (15.0 + x_1)? (13.0 + x_0) : (15.0 + x_1)) > ((16.0 + x_2) > ((20.0 + x_8) > (4.0 + x_11)? (20.0 + x_8) : (4.0 + x_11))? (16.0 + x_2) : ((20.0 + x_8) > (4.0 + x_11)? (20.0 + x_8) : (4.0 + x_11)))? ((13.0 + x_0) > (15.0 + x_1)? (13.0 + x_0) : (15.0 + x_1)) : ((16.0 + x_2) > ((20.0 + x_8) > (4.0 + x_11)? (20.0 + x_8) : (4.0 + x_11))? (16.0 + x_2) : ((20.0 + x_8) > (4.0 + x_11)? (20.0 + x_8) : (4.0 + x_11)))) > (((9.0 + x_12) > (12.0 + x_14)? (9.0 + x_12) : (12.0 + x_14)) > ((3.0 + x_15) > ((5.0 + x_17) > (7.0 + x_19)? (5.0 + x_17) : (7.0 + x_19))? (3.0 + x_15) : ((5.0 + x_17) > (7.0 + x_19)? (5.0 + x_17) : (7.0 + x_19)))? ((9.0 + x_12) > (12.0 + x_14)? (9.0 + x_12) : (12.0 + x_14)) : ((3.0 + x_15) > ((5.0 + x_17) > (7.0 + x_19)? (5.0 + x_17) : (7.0 + x_19))? (3.0 + x_15) : ((5.0 + x_17) > (7.0 + x_19)? (5.0 + x_17) : (7.0 + x_19))))? (((13.0 + x_0) > (15.0 + x_1)? (13.0 + x_0) : (15.0 + x_1)) > ((16.0 + x_2) > ((20.0 + x_8) > (4.0 + x_11)? (20.0 + x_8) : (4.0 + x_11))? (16.0 + x_2) : ((20.0 + x_8) > (4.0 + x_11)? (20.0 + x_8) : (4.0 + x_11)))? ((13.0 + x_0) > (15.0 + x_1)? (13.0 + x_0) : (15.0 + x_1)) : ((16.0 + x_2) > ((20.0 + x_8) > (4.0 + x_11)? (20.0 + x_8) : (4.0 + x_11))? (16.0 + x_2) : ((20.0 + x_8) > (4.0 + x_11)? (20.0 + x_8) : (4.0 + x_11)))) : (((9.0 + x_12) > (12.0 + x_14)? (9.0 + x_12) : (12.0 + x_14)) > ((3.0 + x_15) > ((5.0 + x_17) > (7.0 + x_19)? (5.0 + x_17) : (7.0 + x_19))? (3.0 + x_15) : ((5.0 + x_17) > (7.0 + x_19)? (5.0 + x_17) : (7.0 + x_19)))? ((9.0 + x_12) > (12.0 + x_14)? (9.0 + x_12) : (12.0 + x_14)) : ((3.0 + x_15) > ((5.0 + x_17) > (7.0 + x_19)? (5.0 + x_17) : (7.0 + x_19))? (3.0 + x_15) : ((5.0 + x_17) > (7.0 + x_19)? (5.0 + x_17) : (7.0 + x_19))))); x_15_ = ((((10.0 + x_0) > (5.0 + x_2)? (10.0 + x_0) : (5.0 + x_2)) > ((17.0 + x_7) > ((11.0 + x_8) > (1.0 + x_11)? (11.0 + x_8) : (1.0 + x_11))? (17.0 + x_7) : ((11.0 + x_8) > (1.0 + x_11)? (11.0 + x_8) : (1.0 + x_11)))? ((10.0 + x_0) > (5.0 + x_2)? (10.0 + x_0) : (5.0 + x_2)) : ((17.0 + x_7) > ((11.0 + x_8) > (1.0 + x_11)? (11.0 + x_8) : (1.0 + x_11))? (17.0 + x_7) : ((11.0 + x_8) > (1.0 + x_11)? (11.0 + x_8) : (1.0 + x_11)))) > (((3.0 + x_12) > (10.0 + x_15)? (3.0 + x_12) : (10.0 + x_15)) > ((12.0 + x_16) > ((17.0 + x_17) > (5.0 + x_18)? (17.0 + x_17) : (5.0 + x_18))? (12.0 + x_16) : ((17.0 + x_17) > (5.0 + x_18)? (17.0 + x_17) : (5.0 + x_18)))? ((3.0 + x_12) > (10.0 + x_15)? (3.0 + x_12) : (10.0 + x_15)) : ((12.0 + x_16) > ((17.0 + x_17) > (5.0 + x_18)? (17.0 + x_17) : (5.0 + x_18))? (12.0 + x_16) : ((17.0 + x_17) > (5.0 + x_18)? (17.0 + x_17) : (5.0 + x_18))))? (((10.0 + x_0) > (5.0 + x_2)? (10.0 + x_0) : (5.0 + x_2)) > ((17.0 + x_7) > ((11.0 + x_8) > (1.0 + x_11)? (11.0 + x_8) : (1.0 + x_11))? (17.0 + x_7) : ((11.0 + x_8) > (1.0 + x_11)? (11.0 + x_8) : (1.0 + x_11)))? ((10.0 + x_0) > (5.0 + x_2)? (10.0 + x_0) : (5.0 + x_2)) : ((17.0 + x_7) > ((11.0 + x_8) > (1.0 + x_11)? (11.0 + x_8) : (1.0 + x_11))? (17.0 + x_7) : ((11.0 + x_8) > (1.0 + x_11)? (11.0 + x_8) : (1.0 + x_11)))) : (((3.0 + x_12) > (10.0 + x_15)? (3.0 + x_12) : (10.0 + x_15)) > ((12.0 + x_16) > ((17.0 + x_17) > (5.0 + x_18)? (17.0 + x_17) : (5.0 + x_18))? (12.0 + x_16) : ((17.0 + x_17) > (5.0 + x_18)? (17.0 + x_17) : (5.0 + x_18)))? ((3.0 + x_12) > (10.0 + x_15)? (3.0 + x_12) : (10.0 + x_15)) : ((12.0 + x_16) > ((17.0 + x_17) > (5.0 + x_18)? (17.0 + x_17) : (5.0 + x_18))? (12.0 + x_16) : ((17.0 + x_17) > (5.0 + x_18)? (17.0 + x_17) : (5.0 + x_18))))); x_16_ = ((((1.0 + x_3) > (17.0 + x_6)? (1.0 + x_3) : (17.0 + x_6)) > ((20.0 + x_7) > ((4.0 + x_8) > (8.0 + x_10)? (4.0 + x_8) : (8.0 + x_10))? (20.0 + x_7) : ((4.0 + x_8) > (8.0 + x_10)? (4.0 + x_8) : (8.0 + x_10)))? ((1.0 + x_3) > (17.0 + x_6)? (1.0 + x_3) : (17.0 + x_6)) : ((20.0 + x_7) > ((4.0 + x_8) > (8.0 + x_10)? (4.0 + x_8) : (8.0 + x_10))? (20.0 + x_7) : ((4.0 + x_8) > (8.0 + x_10)? (4.0 + x_8) : (8.0 + x_10)))) > (((18.0 + x_11) > (6.0 + x_13)? (18.0 + x_11) : (6.0 + x_13)) > ((8.0 + x_14) > ((13.0 + x_17) > (12.0 + x_18)? (13.0 + x_17) : (12.0 + x_18))? (8.0 + x_14) : ((13.0 + x_17) > (12.0 + x_18)? (13.0 + x_17) : (12.0 + x_18)))? ((18.0 + x_11) > (6.0 + x_13)? (18.0 + x_11) : (6.0 + x_13)) : ((8.0 + x_14) > ((13.0 + x_17) > (12.0 + x_18)? (13.0 + x_17) : (12.0 + x_18))? (8.0 + x_14) : ((13.0 + x_17) > (12.0 + x_18)? (13.0 + x_17) : (12.0 + x_18))))? (((1.0 + x_3) > (17.0 + x_6)? (1.0 + x_3) : (17.0 + x_6)) > ((20.0 + x_7) > ((4.0 + x_8) > (8.0 + x_10)? (4.0 + x_8) : (8.0 + x_10))? (20.0 + x_7) : ((4.0 + x_8) > (8.0 + x_10)? (4.0 + x_8) : (8.0 + x_10)))? ((1.0 + x_3) > (17.0 + x_6)? (1.0 + x_3) : (17.0 + x_6)) : ((20.0 + x_7) > ((4.0 + x_8) > (8.0 + x_10)? (4.0 + x_8) : (8.0 + x_10))? (20.0 + x_7) : ((4.0 + x_8) > (8.0 + x_10)? (4.0 + x_8) : (8.0 + x_10)))) : (((18.0 + x_11) > (6.0 + x_13)? (18.0 + x_11) : (6.0 + x_13)) > ((8.0 + x_14) > ((13.0 + x_17) > (12.0 + x_18)? (13.0 + x_17) : (12.0 + x_18))? (8.0 + x_14) : ((13.0 + x_17) > (12.0 + x_18)? (13.0 + x_17) : (12.0 + x_18)))? ((18.0 + x_11) > (6.0 + x_13)? (18.0 + x_11) : (6.0 + x_13)) : ((8.0 + x_14) > ((13.0 + x_17) > (12.0 + x_18)? (13.0 + x_17) : (12.0 + x_18))? (8.0 + x_14) : ((13.0 + x_17) > (12.0 + x_18)? (13.0 + x_17) : (12.0 + x_18))))); x_17_ = ((((11.0 + x_2) > (8.0 + x_3)? (11.0 + x_2) : (8.0 + x_3)) > ((14.0 + x_4) > ((7.0 + x_5) > (8.0 + x_9)? (7.0 + x_5) : (8.0 + x_9))? (14.0 + x_4) : ((7.0 + x_5) > (8.0 + x_9)? (7.0 + x_5) : (8.0 + x_9)))? ((11.0 + x_2) > (8.0 + x_3)? (11.0 + x_2) : (8.0 + x_3)) : ((14.0 + x_4) > ((7.0 + x_5) > (8.0 + x_9)? (7.0 + x_5) : (8.0 + x_9))? (14.0 + x_4) : ((7.0 + x_5) > (8.0 + x_9)? (7.0 + x_5) : (8.0 + x_9)))) > (((12.0 + x_11) > (18.0 + x_15)? (12.0 + x_11) : (18.0 + x_15)) > ((7.0 + x_17) > ((17.0 + x_18) > (10.0 + x_19)? (17.0 + x_18) : (10.0 + x_19))? (7.0 + x_17) : ((17.0 + x_18) > (10.0 + x_19)? (17.0 + x_18) : (10.0 + x_19)))? ((12.0 + x_11) > (18.0 + x_15)? (12.0 + x_11) : (18.0 + x_15)) : ((7.0 + x_17) > ((17.0 + x_18) > (10.0 + x_19)? (17.0 + x_18) : (10.0 + x_19))? (7.0 + x_17) : ((17.0 + x_18) > (10.0 + x_19)? (17.0 + x_18) : (10.0 + x_19))))? (((11.0 + x_2) > (8.0 + x_3)? (11.0 + x_2) : (8.0 + x_3)) > ((14.0 + x_4) > ((7.0 + x_5) > (8.0 + x_9)? (7.0 + x_5) : (8.0 + x_9))? (14.0 + x_4) : ((7.0 + x_5) > (8.0 + x_9)? (7.0 + x_5) : (8.0 + x_9)))? ((11.0 + x_2) > (8.0 + x_3)? (11.0 + x_2) : (8.0 + x_3)) : ((14.0 + x_4) > ((7.0 + x_5) > (8.0 + x_9)? (7.0 + x_5) : (8.0 + x_9))? (14.0 + x_4) : ((7.0 + x_5) > (8.0 + x_9)? (7.0 + x_5) : (8.0 + x_9)))) : (((12.0 + x_11) > (18.0 + x_15)? (12.0 + x_11) : (18.0 + x_15)) > ((7.0 + x_17) > ((17.0 + x_18) > (10.0 + x_19)? (17.0 + x_18) : (10.0 + x_19))? (7.0 + x_17) : ((17.0 + x_18) > (10.0 + x_19)? (17.0 + x_18) : (10.0 + x_19)))? ((12.0 + x_11) > (18.0 + x_15)? (12.0 + x_11) : (18.0 + x_15)) : ((7.0 + x_17) > ((17.0 + x_18) > (10.0 + x_19)? (17.0 + x_18) : (10.0 + x_19))? (7.0 + x_17) : ((17.0 + x_18) > (10.0 + x_19)? (17.0 + x_18) : (10.0 + x_19))))); x_18_ = ((((20.0 + x_1) > (5.0 + x_3)? (20.0 + x_1) : (5.0 + x_3)) > ((14.0 + x_6) > ((9.0 + x_7) > (18.0 + x_10)? (9.0 + x_7) : (18.0 + x_10))? (14.0 + x_6) : ((9.0 + x_7) > (18.0 + x_10)? (9.0 + x_7) : (18.0 + x_10)))? ((20.0 + x_1) > (5.0 + x_3)? (20.0 + x_1) : (5.0 + x_3)) : ((14.0 + x_6) > ((9.0 + x_7) > (18.0 + x_10)? (9.0 + x_7) : (18.0 + x_10))? (14.0 + x_6) : ((9.0 + x_7) > (18.0 + x_10)? (9.0 + x_7) : (18.0 + x_10)))) > (((8.0 + x_11) > (3.0 + x_13)? (8.0 + x_11) : (3.0 + x_13)) > ((7.0 + x_16) > ((1.0 + x_18) > (16.0 + x_19)? (1.0 + x_18) : (16.0 + x_19))? (7.0 + x_16) : ((1.0 + x_18) > (16.0 + x_19)? (1.0 + x_18) : (16.0 + x_19)))? ((8.0 + x_11) > (3.0 + x_13)? (8.0 + x_11) : (3.0 + x_13)) : ((7.0 + x_16) > ((1.0 + x_18) > (16.0 + x_19)? (1.0 + x_18) : (16.0 + x_19))? (7.0 + x_16) : ((1.0 + x_18) > (16.0 + x_19)? (1.0 + x_18) : (16.0 + x_19))))? (((20.0 + x_1) > (5.0 + x_3)? (20.0 + x_1) : (5.0 + x_3)) > ((14.0 + x_6) > ((9.0 + x_7) > (18.0 + x_10)? (9.0 + x_7) : (18.0 + x_10))? (14.0 + x_6) : ((9.0 + x_7) > (18.0 + x_10)? (9.0 + x_7) : (18.0 + x_10)))? ((20.0 + x_1) > (5.0 + x_3)? (20.0 + x_1) : (5.0 + x_3)) : ((14.0 + x_6) > ((9.0 + x_7) > (18.0 + x_10)? (9.0 + x_7) : (18.0 + x_10))? (14.0 + x_6) : ((9.0 + x_7) > (18.0 + x_10)? (9.0 + x_7) : (18.0 + x_10)))) : (((8.0 + x_11) > (3.0 + x_13)? (8.0 + x_11) : (3.0 + x_13)) > ((7.0 + x_16) > ((1.0 + x_18) > (16.0 + x_19)? (1.0 + x_18) : (16.0 + x_19))? (7.0 + x_16) : ((1.0 + x_18) > (16.0 + x_19)? (1.0 + x_18) : (16.0 + x_19)))? ((8.0 + x_11) > (3.0 + x_13)? (8.0 + x_11) : (3.0 + x_13)) : ((7.0 + x_16) > ((1.0 + x_18) > (16.0 + x_19)? (1.0 + x_18) : (16.0 + x_19))? (7.0 + x_16) : ((1.0 + x_18) > (16.0 + x_19)? (1.0 + x_18) : (16.0 + x_19))))); x_19_ = ((((13.0 + x_3) > (6.0 + x_5)? (13.0 + x_3) : (6.0 + x_5)) > ((14.0 + x_6) > ((14.0 + x_7) > (15.0 + x_8)? (14.0 + x_7) : (15.0 + x_8))? (14.0 + x_6) : ((14.0 + x_7) > (15.0 + x_8)? (14.0 + x_7) : (15.0 + x_8)))? ((13.0 + x_3) > (6.0 + x_5)? (13.0 + x_3) : (6.0 + x_5)) : ((14.0 + x_6) > ((14.0 + x_7) > (15.0 + x_8)? (14.0 + x_7) : (15.0 + x_8))? (14.0 + x_6) : ((14.0 + x_7) > (15.0 + x_8)? (14.0 + x_7) : (15.0 + x_8)))) > (((13.0 + x_10) > (15.0 + x_13)? (13.0 + x_10) : (15.0 + x_13)) > ((17.0 + x_14) > ((19.0 + x_17) > (14.0 + x_19)? (19.0 + x_17) : (14.0 + x_19))? (17.0 + x_14) : ((19.0 + x_17) > (14.0 + x_19)? (19.0 + x_17) : (14.0 + x_19)))? ((13.0 + x_10) > (15.0 + x_13)? (13.0 + x_10) : (15.0 + x_13)) : ((17.0 + x_14) > ((19.0 + x_17) > (14.0 + x_19)? (19.0 + x_17) : (14.0 + x_19))? (17.0 + x_14) : ((19.0 + x_17) > (14.0 + x_19)? (19.0 + x_17) : (14.0 + x_19))))? (((13.0 + x_3) > (6.0 + x_5)? (13.0 + x_3) : (6.0 + x_5)) > ((14.0 + x_6) > ((14.0 + x_7) > (15.0 + x_8)? (14.0 + x_7) : (15.0 + x_8))? (14.0 + x_6) : ((14.0 + x_7) > (15.0 + x_8)? (14.0 + x_7) : (15.0 + x_8)))? ((13.0 + x_3) > (6.0 + x_5)? (13.0 + x_3) : (6.0 + x_5)) : ((14.0 + x_6) > ((14.0 + x_7) > (15.0 + x_8)? (14.0 + x_7) : (15.0 + x_8))? (14.0 + x_6) : ((14.0 + x_7) > (15.0 + x_8)? (14.0 + x_7) : (15.0 + x_8)))) : (((13.0 + x_10) > (15.0 + x_13)? (13.0 + x_10) : (15.0 + x_13)) > ((17.0 + x_14) > ((19.0 + x_17) > (14.0 + x_19)? (19.0 + x_17) : (14.0 + x_19))? (17.0 + x_14) : ((19.0 + x_17) > (14.0 + x_19)? (19.0 + x_17) : (14.0 + x_19)))? ((13.0 + x_10) > (15.0 + x_13)? (13.0 + x_10) : (15.0 + x_13)) : ((17.0 + x_14) > ((19.0 + x_17) > (14.0 + x_19)? (19.0 + x_17) : (14.0 + x_19))? (17.0 + x_14) : ((19.0 + x_17) > (14.0 + x_19)? (19.0 + x_17) : (14.0 + x_19))))); x_0 = x_0_; x_1 = x_1_; x_2 = x_2_; x_3 = x_3_; x_4 = x_4_; x_5 = x_5_; x_6 = x_6_; x_7 = x_7_; x_8 = x_8_; x_9 = x_9_; x_10 = x_10_; x_11 = x_11_; x_12 = x_12_; x_13 = x_13_; x_14 = x_14_; x_15 = x_15_; x_16 = x_16_; x_17 = x_17_; x_18 = x_18_; x_19 = x_19_; } return 0; }
the_stack_data/32951246.c
#include <stdio.h> int main() { int i, j; float frac; for (i = 0; i <= 20; i += 2) { frac = i / 10.f; for (j = 1; j <= 3; j++) { printf("I=%g J=%g\n", frac, j + frac); } } return 0; }
the_stack_data/17542.c
//Merge_Sort_for_Linked_Lists #include <stdio.h> #include <stdlib.h> /* Link list node */ struct Node { int data; struct Node* next; }; /* function prototypes */ struct Node* SortedMerge(struct Node* a, struct Node* b); void FrontBackSplit(struct Node* source, struct Node** frontRef, struct Node** backRef); /* sorts the linked list by changing next pointers (not data) */ void MergeSort(struct Node** headRef) { struct Node* head = *headRef; struct Node* a; struct Node* b; /* Base case -- length 0 or 1 */ if ((head == NULL) || (head->next == NULL)) { return; } /* Split head into 'a' and 'b' sublists */ FrontBackSplit(head, &a, &b); /* Recursively sort the sublists */ MergeSort(&a); MergeSort(&b); /* answer = merge the two sorted lists together */ *headRef = SortedMerge(a, b); } struct Node* SortedMerge(struct Node* a, struct Node* b) { struct Node* result = NULL; /* Base cases */ if (a == NULL) return (b); else if (b == NULL) return (a); /* Pick either a or b, and recur */ if (a->data <= b->data) { result = a; result->next = SortedMerge(a->next, b); } else { result = b; result->next = SortedMerge(a, b->next); } return (result); } /* UTILITY FUNCTIONS */ /* Split the nodes of the given list into front and back halves, and return the two lists using the reference parameters. If the length is odd, the extra node should go in the front list. Uses the fast/slow pointer strategy. */ void FrontBackSplit(struct Node* source, struct Node** frontRef, struct Node** backRef) { struct Node* fast; struct Node* slow; slow = source; fast = source->next; /* Advance 'fast' two nodes, and advance 'slow' one node */ while (fast != NULL) { fast = fast->next; if (fast != NULL) { slow = slow->next; fast = fast->next; } } /* 'slow' is before the midpoint in the list, so split it in two at that point. */ *frontRef = source; *backRef = slow->next; slow->next = NULL; } /* Function to print nodes in a given linked list */ void printList(struct Node* node) { while (node != NULL) { printf("%d ", node->data); node = node->next; } } /* Function to insert a node at the beginging of the linked list */ void push(struct Node** head_ref, int new_data) { /* allocate node */ struct Node* new_node = (struct Node*)malloc(sizeof(struct Node)); /* put in the data */ new_node->data = new_data; /* link the old list off the new node */ new_node->next = (*head_ref); /* move the head to point to the new node */ (*head_ref) = new_node; } int main() { /* Start with the empty list */ struct Node* res = NULL; struct Node* a = NULL; /* Let us create a unsorted linked lists to test the functions Created lists shall be a: 2->3->20->5->10->15 */ push(&a, 15); push(&a, 10); push(&a, 5); push(&a, 20); push(&a, 3); push(&a, 2); /* Sort the above created Linked List */ MergeSort(&a); printf("Sorted Linked List is: \n"); printList(a); getchar(); return 0; }
the_stack_data/30204.c
void api_end(void); int api_getkey(int mode); int api_alloctimer(void); void api_inittimer(int timer, int data); void api_settimer(int timer, int time); void api_beep(int tone); void HariMain(void) { int i, timer; timer = api_alloctimer(); api_inittimer(timer, 128); for (i = 20000000; i >= 20000; i -= i / 100) { /* 20KHz〜20Hz : 人間に聞こえる音の範囲 */ /* iは1%ずつ減らされていく */ api_beep(i); api_settimer(timer, 1); /* 0.01秒 */ if (api_getkey(1) != 128) { break; } } api_beep(0); api_end(); }
the_stack_data/247019333.c
#include <stdio.h> #ifndef PROG #define PROG "sdb_xy" #endif void Hello() { printf("\n %s => (s)earch two (d)ata(b)ases using (x)(y) coordinates\n\n", PROG); printf(" Default call:\n %s <star-list-1> <star-list-2>\n", PROG); printf(" For more info please type:\n %s --help\n", PROG); printf(" Display version information and exit:\n %s -v\n\n", PROG); printf(" Copyright (c) Przemysław Bruś\n\n"); } void Version() { printf("%s\n", PROG); printf(" * Version: 2017-02-24\n"); printf(" * Licensed under the MIT license:\n http://opensource.org/licenses/MIT\n"); printf(" * Copyright (c) 2017 Przemysław Bruś\n"); } void Help() { printf("This program searches two databases with stars and makes a cross-corelation between them based on the XY coordinates. "); printf("Input lists of stars should have the following structure:\n\n"); printf(" # ID_star Xpx Ypx Mag ...\n\n"); printf("ID_star is converted into integer, the rest of columns is treated as float numbers. "); printf("Minimum three first columns are required.\n"); printf("Usage:\n\n %s <list-1> <list-2> [-Mode] [-Offset] [-Radius] [-Head] [-Sort] [-reGion]\n\nOptions:\n\n", PROG); // options printf(" -m N \tFive output formats are available (default: -m 0):\n"); printf(" \t 0 - id1 x1 y1 id2 x2 y2 r \t// r = distance between stars (px)\n"); printf(" \t 1 - id1 x1 y1 id2 x2 y2 r mag1-mag2\n"); printf(" \t 2 - id1 x1 y1 mag1\n"); printf(" \t 3 - id2 x2 y2 mag2\n"); printf(" \t 4 - id1 id2\n"); printf(" -o N M \tAdd an offset to the (x1,y1) coordinates before searching starts: (x1+N,y1+M).\n"); printf(" \tN and M can be float number (default: -o 0.0 0.0).\n"); printf(" -r N \tSet the radius which defines a search area (default: -r 2.0).\n"); printf(" -h N M \tIgnore the first N and M lines in list-1 and list-2, respectively.\n"); printf(" \tIf both headers are the same size, only one value is necessary (default: -h 0).\n"); printf(" -s N \tSort the output data by 1-8 column (default: none = -s 0).\n"); printf(" \tAmount of output columns depends on the -m option.\n"); printf(" -g \tGenerate an additional output %s.reg file to the ds9 program in the working directory.\n", PROG); printf(" \tThis file is generated based on the id1, x1, y1 values.\n"); printf(" \tRegions are set as yellow circles with 10 px radius and are signed as id1 numbers.\n"); printf(" \tIf the -s option is used, %s.reg inherits this feature (default: none).\n\n", PROG); printf("The sequence of the optional [] parameters can be random. On the contrary, names of the input lists must be located just behind the name of the program.\n"); } void ToManyArg() { printf("Error from %s: Too many arguments. Check '%s --help'.\n", PROG, PROG); } void ErrInFile() { printf("Error from %s: Problem with the input lists. Check names or privileges of the input lists.\n", PROG); } void ErrOption() { printf("Error from %s: Incorrect usage. Please, use '%s --help'.\n", PROG, PROG); } void EmptyFile(const char *arg) { printf("Error from %s: File '%s' is empty.\n", PROG, arg); } void MemoryStar() { printf("Error from %s: Cannot allocate memory for star's structures.\n", PROG); } void Err_H() { printf("Error from %s: An argument of the -h option must be >= 0\n", PROG); } void TooBig_H(int h, const char *file) { printf("Error from %s: -h = %d is equal or greater than the number of lines in '%s' file.\n", PROG, h, file); } void NotMemoBuff() { printf("Error from %s: The malloc() function hasn't allocated memory in the ReadFile() function.\n", PROG); } void ErrReadHeader(const char *arg) { printf("Error from %s: A problem has occurred while reading the header in '%s' file.\n", PROG, arg); } void ErrReadLine(const char *arg, int line) { printf("Error from %s: A problem has occurred while reading the line %d in '%s' file.\n", PROG, line, arg); } void Err_R() { printf("Error from %s: An argument of the -r option must be > 0\n", PROG); } void MemoryData() { printf("Error from %s: Cannot allocate memory for data structure.\n", PROG); } short Correct_S_M(int m, int s) { short int state = 0; switch (m) { case 0: break; case 1: break; case 2: break; case 3: break; case 4: break; default: printf("Error from %s: -m = 0,1,2,3,4 not %d\n", PROG, m); state = 1; } switch (s) { case 0: break; case 1: break; case 2: break; case 3: break; case 4: break; case 5: break; case 6: break; case 7: break; case 8: break; default: printf("Error from %s: -s = 1,2,3,4,5,6,7,8 not %d\n", PROG, s); state = 1; } if (!state) { if (!m && s < 8); else if (m == 1 && s < 9); else if ((m == 2 || m == 3) && s < 5); else if (m == 4 && s < 3); else state = 2; } if (state == 2) printf("Error from %s: An output format doesn't contain %d. column. Check the -m and -s options.\n", PROG, s); return state; }
the_stack_data/2412.c
#include <math.h> #include <assert.h> double expm1(double x) { assert(0); // Not implemented return 0.0; } float expm1f(float x) { assert(0); // Not implemented return 0.0; } long double expm1l(long double x) { assert(0); // Not implemented return 0.0; }
the_stack_data/613923.c
/************************************************************************* > File Name: client_tcp.c > Author: Mr.Miaow > Mail: [email protected] > Created Time: 2019年04月09日 星期二 16时02分51秒 ************************************************************************/ #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <string.h> #include <arpa/inet.h> int main(int argc, char *argv[]) { if (argc < 2) { printf("eg: %s port\n", argv[0]); exit(1); } int port = atoi(argv[1]); // 创建套接字 int fd = socket(AF_INET, SOCK_STREAM, 0); // 连接服务器 struct sockaddr_in serv; memset(&serv, 0, sizeof(serv)); serv.sin_family = AF_INET; serv.sin_port = htons(port); //serv.sin_addr.s_addr = htons(); inet_pton(AF_INET, "127.0.0.1", &serv.sin_addr.s_addr); connect(fd, (struct sockaddr*)&serv, sizeof(serv)); // 通信 while (1) { // 发送数据 char buf[1024]; printf("请输入要发送的字符串:"); fgets(buf, sizeof(buf), stdin); // 发送给服务器 write(fd, buf, strlen(buf)+1); // 等待接受数据 int len = read(fd, buf, sizeof(buf)); if (len == -1) { perror("read error"); exit(1); } else if (len == 0) { printf("服务端关闭了连接\n"); break; } else { printf("recv buf: %s\n", buf); } } close(fd); return 0; }
the_stack_data/193893091.c
//@ ltl invariant negative: (AP(x_8 - x_11 > 4) R (AP(x_7 - x_1 >= -20) || AP(x_2 - x_4 > -4))); float x_0; float x_1; float x_2; float x_3; float x_4; float x_5; float x_6; float x_7; float x_8; float x_9; float x_10; float x_11; float x_12; float x_13; float x_14; float x_15; int main() { float x_0_; float x_1_; float x_2_; float x_3_; float x_4_; float x_5_; float x_6_; float x_7_; float x_8_; float x_9_; float x_10_; float x_11_; float x_12_; float x_13_; float x_14_; float x_15_; while(1) { x_0_ = ((((7.0 + x_7) > (6.0 + x_9)? (7.0 + x_7) : (6.0 + x_9)) > ((14.0 + x_10) > (2.0 + x_11)? (14.0 + x_10) : (2.0 + x_11))? ((7.0 + x_7) > (6.0 + x_9)? (7.0 + x_7) : (6.0 + x_9)) : ((14.0 + x_10) > (2.0 + x_11)? (14.0 + x_10) : (2.0 + x_11))) > (((10.0 + x_12) > (20.0 + x_13)? (10.0 + x_12) : (20.0 + x_13)) > ((2.0 + x_14) > (3.0 + x_15)? (2.0 + x_14) : (3.0 + x_15))? ((10.0 + x_12) > (20.0 + x_13)? (10.0 + x_12) : (20.0 + x_13)) : ((2.0 + x_14) > (3.0 + x_15)? (2.0 + x_14) : (3.0 + x_15)))? (((7.0 + x_7) > (6.0 + x_9)? (7.0 + x_7) : (6.0 + x_9)) > ((14.0 + x_10) > (2.0 + x_11)? (14.0 + x_10) : (2.0 + x_11))? ((7.0 + x_7) > (6.0 + x_9)? (7.0 + x_7) : (6.0 + x_9)) : ((14.0 + x_10) > (2.0 + x_11)? (14.0 + x_10) : (2.0 + x_11))) : (((10.0 + x_12) > (20.0 + x_13)? (10.0 + x_12) : (20.0 + x_13)) > ((2.0 + x_14) > (3.0 + x_15)? (2.0 + x_14) : (3.0 + x_15))? ((10.0 + x_12) > (20.0 + x_13)? (10.0 + x_12) : (20.0 + x_13)) : ((2.0 + x_14) > (3.0 + x_15)? (2.0 + x_14) : (3.0 + x_15)))); x_1_ = ((((11.0 + x_2) > (17.0 + x_3)? (11.0 + x_2) : (17.0 + x_3)) > ((9.0 + x_4) > (17.0 + x_6)? (9.0 + x_4) : (17.0 + x_6))? ((11.0 + x_2) > (17.0 + x_3)? (11.0 + x_2) : (17.0 + x_3)) : ((9.0 + x_4) > (17.0 + x_6)? (9.0 + x_4) : (17.0 + x_6))) > (((6.0 + x_7) > (14.0 + x_11)? (6.0 + x_7) : (14.0 + x_11)) > ((13.0 + x_13) > (5.0 + x_14)? (13.0 + x_13) : (5.0 + x_14))? ((6.0 + x_7) > (14.0 + x_11)? (6.0 + x_7) : (14.0 + x_11)) : ((13.0 + x_13) > (5.0 + x_14)? (13.0 + x_13) : (5.0 + x_14)))? (((11.0 + x_2) > (17.0 + x_3)? (11.0 + x_2) : (17.0 + x_3)) > ((9.0 + x_4) > (17.0 + x_6)? (9.0 + x_4) : (17.0 + x_6))? ((11.0 + x_2) > (17.0 + x_3)? (11.0 + x_2) : (17.0 + x_3)) : ((9.0 + x_4) > (17.0 + x_6)? (9.0 + x_4) : (17.0 + x_6))) : (((6.0 + x_7) > (14.0 + x_11)? (6.0 + x_7) : (14.0 + x_11)) > ((13.0 + x_13) > (5.0 + x_14)? (13.0 + x_13) : (5.0 + x_14))? ((6.0 + x_7) > (14.0 + x_11)? (6.0 + x_7) : (14.0 + x_11)) : ((13.0 + x_13) > (5.0 + x_14)? (13.0 + x_13) : (5.0 + x_14)))); x_2_ = ((((15.0 + x_2) > (4.0 + x_3)? (15.0 + x_2) : (4.0 + x_3)) > ((14.0 + x_5) > (8.0 + x_6)? (14.0 + x_5) : (8.0 + x_6))? ((15.0 + x_2) > (4.0 + x_3)? (15.0 + x_2) : (4.0 + x_3)) : ((14.0 + x_5) > (8.0 + x_6)? (14.0 + x_5) : (8.0 + x_6))) > (((12.0 + x_7) > (10.0 + x_8)? (12.0 + x_7) : (10.0 + x_8)) > ((16.0 + x_9) > (5.0 + x_14)? (16.0 + x_9) : (5.0 + x_14))? ((12.0 + x_7) > (10.0 + x_8)? (12.0 + x_7) : (10.0 + x_8)) : ((16.0 + x_9) > (5.0 + x_14)? (16.0 + x_9) : (5.0 + x_14)))? (((15.0 + x_2) > (4.0 + x_3)? (15.0 + x_2) : (4.0 + x_3)) > ((14.0 + x_5) > (8.0 + x_6)? (14.0 + x_5) : (8.0 + x_6))? ((15.0 + x_2) > (4.0 + x_3)? (15.0 + x_2) : (4.0 + x_3)) : ((14.0 + x_5) > (8.0 + x_6)? (14.0 + x_5) : (8.0 + x_6))) : (((12.0 + x_7) > (10.0 + x_8)? (12.0 + x_7) : (10.0 + x_8)) > ((16.0 + x_9) > (5.0 + x_14)? (16.0 + x_9) : (5.0 + x_14))? ((12.0 + x_7) > (10.0 + x_8)? (12.0 + x_7) : (10.0 + x_8)) : ((16.0 + x_9) > (5.0 + x_14)? (16.0 + x_9) : (5.0 + x_14)))); x_3_ = ((((6.0 + x_0) > (14.0 + x_1)? (6.0 + x_0) : (14.0 + x_1)) > ((10.0 + x_6) > (20.0 + x_8)? (10.0 + x_6) : (20.0 + x_8))? ((6.0 + x_0) > (14.0 + x_1)? (6.0 + x_0) : (14.0 + x_1)) : ((10.0 + x_6) > (20.0 + x_8)? (10.0 + x_6) : (20.0 + x_8))) > (((7.0 + x_9) > (5.0 + x_11)? (7.0 + x_9) : (5.0 + x_11)) > ((16.0 + x_14) > (10.0 + x_15)? (16.0 + x_14) : (10.0 + x_15))? ((7.0 + x_9) > (5.0 + x_11)? (7.0 + x_9) : (5.0 + x_11)) : ((16.0 + x_14) > (10.0 + x_15)? (16.0 + x_14) : (10.0 + x_15)))? (((6.0 + x_0) > (14.0 + x_1)? (6.0 + x_0) : (14.0 + x_1)) > ((10.0 + x_6) > (20.0 + x_8)? (10.0 + x_6) : (20.0 + x_8))? ((6.0 + x_0) > (14.0 + x_1)? (6.0 + x_0) : (14.0 + x_1)) : ((10.0 + x_6) > (20.0 + x_8)? (10.0 + x_6) : (20.0 + x_8))) : (((7.0 + x_9) > (5.0 + x_11)? (7.0 + x_9) : (5.0 + x_11)) > ((16.0 + x_14) > (10.0 + x_15)? (16.0 + x_14) : (10.0 + x_15))? ((7.0 + x_9) > (5.0 + x_11)? (7.0 + x_9) : (5.0 + x_11)) : ((16.0 + x_14) > (10.0 + x_15)? (16.0 + x_14) : (10.0 + x_15)))); x_4_ = ((((6.0 + x_0) > (3.0 + x_6)? (6.0 + x_0) : (3.0 + x_6)) > ((3.0 + x_7) > (3.0 + x_11)? (3.0 + x_7) : (3.0 + x_11))? ((6.0 + x_0) > (3.0 + x_6)? (6.0 + x_0) : (3.0 + x_6)) : ((3.0 + x_7) > (3.0 + x_11)? (3.0 + x_7) : (3.0 + x_11))) > (((15.0 + x_12) > (12.0 + x_13)? (15.0 + x_12) : (12.0 + x_13)) > ((9.0 + x_14) > (1.0 + x_15)? (9.0 + x_14) : (1.0 + x_15))? ((15.0 + x_12) > (12.0 + x_13)? (15.0 + x_12) : (12.0 + x_13)) : ((9.0 + x_14) > (1.0 + x_15)? (9.0 + x_14) : (1.0 + x_15)))? (((6.0 + x_0) > (3.0 + x_6)? (6.0 + x_0) : (3.0 + x_6)) > ((3.0 + x_7) > (3.0 + x_11)? (3.0 + x_7) : (3.0 + x_11))? ((6.0 + x_0) > (3.0 + x_6)? (6.0 + x_0) : (3.0 + x_6)) : ((3.0 + x_7) > (3.0 + x_11)? (3.0 + x_7) : (3.0 + x_11))) : (((15.0 + x_12) > (12.0 + x_13)? (15.0 + x_12) : (12.0 + x_13)) > ((9.0 + x_14) > (1.0 + x_15)? (9.0 + x_14) : (1.0 + x_15))? ((15.0 + x_12) > (12.0 + x_13)? (15.0 + x_12) : (12.0 + x_13)) : ((9.0 + x_14) > (1.0 + x_15)? (9.0 + x_14) : (1.0 + x_15)))); x_5_ = ((((8.0 + x_0) > (4.0 + x_2)? (8.0 + x_0) : (4.0 + x_2)) > ((8.0 + x_3) > (19.0 + x_5)? (8.0 + x_3) : (19.0 + x_5))? ((8.0 + x_0) > (4.0 + x_2)? (8.0 + x_0) : (4.0 + x_2)) : ((8.0 + x_3) > (19.0 + x_5)? (8.0 + x_3) : (19.0 + x_5))) > (((6.0 + x_7) > (1.0 + x_8)? (6.0 + x_7) : (1.0 + x_8)) > ((20.0 + x_10) > (20.0 + x_15)? (20.0 + x_10) : (20.0 + x_15))? ((6.0 + x_7) > (1.0 + x_8)? (6.0 + x_7) : (1.0 + x_8)) : ((20.0 + x_10) > (20.0 + x_15)? (20.0 + x_10) : (20.0 + x_15)))? (((8.0 + x_0) > (4.0 + x_2)? (8.0 + x_0) : (4.0 + x_2)) > ((8.0 + x_3) > (19.0 + x_5)? (8.0 + x_3) : (19.0 + x_5))? ((8.0 + x_0) > (4.0 + x_2)? (8.0 + x_0) : (4.0 + x_2)) : ((8.0 + x_3) > (19.0 + x_5)? (8.0 + x_3) : (19.0 + x_5))) : (((6.0 + x_7) > (1.0 + x_8)? (6.0 + x_7) : (1.0 + x_8)) > ((20.0 + x_10) > (20.0 + x_15)? (20.0 + x_10) : (20.0 + x_15))? ((6.0 + x_7) > (1.0 + x_8)? (6.0 + x_7) : (1.0 + x_8)) : ((20.0 + x_10) > (20.0 + x_15)? (20.0 + x_10) : (20.0 + x_15)))); x_6_ = ((((15.0 + x_1) > (12.0 + x_5)? (15.0 + x_1) : (12.0 + x_5)) > ((14.0 + x_6) > (12.0 + x_8)? (14.0 + x_6) : (12.0 + x_8))? ((15.0 + x_1) > (12.0 + x_5)? (15.0 + x_1) : (12.0 + x_5)) : ((14.0 + x_6) > (12.0 + x_8)? (14.0 + x_6) : (12.0 + x_8))) > (((15.0 + x_9) > (19.0 + x_10)? (15.0 + x_9) : (19.0 + x_10)) > ((17.0 + x_14) > (7.0 + x_15)? (17.0 + x_14) : (7.0 + x_15))? ((15.0 + x_9) > (19.0 + x_10)? (15.0 + x_9) : (19.0 + x_10)) : ((17.0 + x_14) > (7.0 + x_15)? (17.0 + x_14) : (7.0 + x_15)))? (((15.0 + x_1) > (12.0 + x_5)? (15.0 + x_1) : (12.0 + x_5)) > ((14.0 + x_6) > (12.0 + x_8)? (14.0 + x_6) : (12.0 + x_8))? ((15.0 + x_1) > (12.0 + x_5)? (15.0 + x_1) : (12.0 + x_5)) : ((14.0 + x_6) > (12.0 + x_8)? (14.0 + x_6) : (12.0 + x_8))) : (((15.0 + x_9) > (19.0 + x_10)? (15.0 + x_9) : (19.0 + x_10)) > ((17.0 + x_14) > (7.0 + x_15)? (17.0 + x_14) : (7.0 + x_15))? ((15.0 + x_9) > (19.0 + x_10)? (15.0 + x_9) : (19.0 + x_10)) : ((17.0 + x_14) > (7.0 + x_15)? (17.0 + x_14) : (7.0 + x_15)))); x_7_ = ((((13.0 + x_0) > (13.0 + x_3)? (13.0 + x_0) : (13.0 + x_3)) > ((5.0 + x_4) > (18.0 + x_6)? (5.0 + x_4) : (18.0 + x_6))? ((13.0 + x_0) > (13.0 + x_3)? (13.0 + x_0) : (13.0 + x_3)) : ((5.0 + x_4) > (18.0 + x_6)? (5.0 + x_4) : (18.0 + x_6))) > (((8.0 + x_7) > (9.0 + x_11)? (8.0 + x_7) : (9.0 + x_11)) > ((9.0 + x_12) > (7.0 + x_14)? (9.0 + x_12) : (7.0 + x_14))? ((8.0 + x_7) > (9.0 + x_11)? (8.0 + x_7) : (9.0 + x_11)) : ((9.0 + x_12) > (7.0 + x_14)? (9.0 + x_12) : (7.0 + x_14)))? (((13.0 + x_0) > (13.0 + x_3)? (13.0 + x_0) : (13.0 + x_3)) > ((5.0 + x_4) > (18.0 + x_6)? (5.0 + x_4) : (18.0 + x_6))? ((13.0 + x_0) > (13.0 + x_3)? (13.0 + x_0) : (13.0 + x_3)) : ((5.0 + x_4) > (18.0 + x_6)? (5.0 + x_4) : (18.0 + x_6))) : (((8.0 + x_7) > (9.0 + x_11)? (8.0 + x_7) : (9.0 + x_11)) > ((9.0 + x_12) > (7.0 + x_14)? (9.0 + x_12) : (7.0 + x_14))? ((8.0 + x_7) > (9.0 + x_11)? (8.0 + x_7) : (9.0 + x_11)) : ((9.0 + x_12) > (7.0 + x_14)? (9.0 + x_12) : (7.0 + x_14)))); x_8_ = ((((13.0 + x_0) > (20.0 + x_3)? (13.0 + x_0) : (20.0 + x_3)) > ((9.0 + x_5) > (12.0 + x_8)? (9.0 + x_5) : (12.0 + x_8))? ((13.0 + x_0) > (20.0 + x_3)? (13.0 + x_0) : (20.0 + x_3)) : ((9.0 + x_5) > (12.0 + x_8)? (9.0 + x_5) : (12.0 + x_8))) > (((11.0 + x_11) > (13.0 + x_12)? (11.0 + x_11) : (13.0 + x_12)) > ((12.0 + x_14) > (14.0 + x_15)? (12.0 + x_14) : (14.0 + x_15))? ((11.0 + x_11) > (13.0 + x_12)? (11.0 + x_11) : (13.0 + x_12)) : ((12.0 + x_14) > (14.0 + x_15)? (12.0 + x_14) : (14.0 + x_15)))? (((13.0 + x_0) > (20.0 + x_3)? (13.0 + x_0) : (20.0 + x_3)) > ((9.0 + x_5) > (12.0 + x_8)? (9.0 + x_5) : (12.0 + x_8))? ((13.0 + x_0) > (20.0 + x_3)? (13.0 + x_0) : (20.0 + x_3)) : ((9.0 + x_5) > (12.0 + x_8)? (9.0 + x_5) : (12.0 + x_8))) : (((11.0 + x_11) > (13.0 + x_12)? (11.0 + x_11) : (13.0 + x_12)) > ((12.0 + x_14) > (14.0 + x_15)? (12.0 + x_14) : (14.0 + x_15))? ((11.0 + x_11) > (13.0 + x_12)? (11.0 + x_11) : (13.0 + x_12)) : ((12.0 + x_14) > (14.0 + x_15)? (12.0 + x_14) : (14.0 + x_15)))); x_9_ = ((((5.0 + x_0) > (7.0 + x_2)? (5.0 + x_0) : (7.0 + x_2)) > ((2.0 + x_3) > (17.0 + x_5)? (2.0 + x_3) : (17.0 + x_5))? ((5.0 + x_0) > (7.0 + x_2)? (5.0 + x_0) : (7.0 + x_2)) : ((2.0 + x_3) > (17.0 + x_5)? (2.0 + x_3) : (17.0 + x_5))) > (((19.0 + x_6) > (6.0 + x_7)? (19.0 + x_6) : (6.0 + x_7)) > ((3.0 + x_11) > (13.0 + x_12)? (3.0 + x_11) : (13.0 + x_12))? ((19.0 + x_6) > (6.0 + x_7)? (19.0 + x_6) : (6.0 + x_7)) : ((3.0 + x_11) > (13.0 + x_12)? (3.0 + x_11) : (13.0 + x_12)))? (((5.0 + x_0) > (7.0 + x_2)? (5.0 + x_0) : (7.0 + x_2)) > ((2.0 + x_3) > (17.0 + x_5)? (2.0 + x_3) : (17.0 + x_5))? ((5.0 + x_0) > (7.0 + x_2)? (5.0 + x_0) : (7.0 + x_2)) : ((2.0 + x_3) > (17.0 + x_5)? (2.0 + x_3) : (17.0 + x_5))) : (((19.0 + x_6) > (6.0 + x_7)? (19.0 + x_6) : (6.0 + x_7)) > ((3.0 + x_11) > (13.0 + x_12)? (3.0 + x_11) : (13.0 + x_12))? ((19.0 + x_6) > (6.0 + x_7)? (19.0 + x_6) : (6.0 + x_7)) : ((3.0 + x_11) > (13.0 + x_12)? (3.0 + x_11) : (13.0 + x_12)))); x_10_ = ((((15.0 + x_0) > (12.0 + x_1)? (15.0 + x_0) : (12.0 + x_1)) > ((19.0 + x_6) > (16.0 + x_10)? (19.0 + x_6) : (16.0 + x_10))? ((15.0 + x_0) > (12.0 + x_1)? (15.0 + x_0) : (12.0 + x_1)) : ((19.0 + x_6) > (16.0 + x_10)? (19.0 + x_6) : (16.0 + x_10))) > (((14.0 + x_11) > (15.0 + x_12)? (14.0 + x_11) : (15.0 + x_12)) > ((8.0 + x_14) > (6.0 + x_15)? (8.0 + x_14) : (6.0 + x_15))? ((14.0 + x_11) > (15.0 + x_12)? (14.0 + x_11) : (15.0 + x_12)) : ((8.0 + x_14) > (6.0 + x_15)? (8.0 + x_14) : (6.0 + x_15)))? (((15.0 + x_0) > (12.0 + x_1)? (15.0 + x_0) : (12.0 + x_1)) > ((19.0 + x_6) > (16.0 + x_10)? (19.0 + x_6) : (16.0 + x_10))? ((15.0 + x_0) > (12.0 + x_1)? (15.0 + x_0) : (12.0 + x_1)) : ((19.0 + x_6) > (16.0 + x_10)? (19.0 + x_6) : (16.0 + x_10))) : (((14.0 + x_11) > (15.0 + x_12)? (14.0 + x_11) : (15.0 + x_12)) > ((8.0 + x_14) > (6.0 + x_15)? (8.0 + x_14) : (6.0 + x_15))? ((14.0 + x_11) > (15.0 + x_12)? (14.0 + x_11) : (15.0 + x_12)) : ((8.0 + x_14) > (6.0 + x_15)? (8.0 + x_14) : (6.0 + x_15)))); x_11_ = ((((15.0 + x_1) > (20.0 + x_3)? (15.0 + x_1) : (20.0 + x_3)) > ((13.0 + x_4) > (3.0 + x_7)? (13.0 + x_4) : (3.0 + x_7))? ((15.0 + x_1) > (20.0 + x_3)? (15.0 + x_1) : (20.0 + x_3)) : ((13.0 + x_4) > (3.0 + x_7)? (13.0 + x_4) : (3.0 + x_7))) > (((6.0 + x_8) > (4.0 + x_9)? (6.0 + x_8) : (4.0 + x_9)) > ((8.0 + x_10) > (11.0 + x_12)? (8.0 + x_10) : (11.0 + x_12))? ((6.0 + x_8) > (4.0 + x_9)? (6.0 + x_8) : (4.0 + x_9)) : ((8.0 + x_10) > (11.0 + x_12)? (8.0 + x_10) : (11.0 + x_12)))? (((15.0 + x_1) > (20.0 + x_3)? (15.0 + x_1) : (20.0 + x_3)) > ((13.0 + x_4) > (3.0 + x_7)? (13.0 + x_4) : (3.0 + x_7))? ((15.0 + x_1) > (20.0 + x_3)? (15.0 + x_1) : (20.0 + x_3)) : ((13.0 + x_4) > (3.0 + x_7)? (13.0 + x_4) : (3.0 + x_7))) : (((6.0 + x_8) > (4.0 + x_9)? (6.0 + x_8) : (4.0 + x_9)) > ((8.0 + x_10) > (11.0 + x_12)? (8.0 + x_10) : (11.0 + x_12))? ((6.0 + x_8) > (4.0 + x_9)? (6.0 + x_8) : (4.0 + x_9)) : ((8.0 + x_10) > (11.0 + x_12)? (8.0 + x_10) : (11.0 + x_12)))); x_12_ = ((((3.0 + x_0) > (15.0 + x_1)? (3.0 + x_0) : (15.0 + x_1)) > ((19.0 + x_2) > (20.0 + x_7)? (19.0 + x_2) : (20.0 + x_7))? ((3.0 + x_0) > (15.0 + x_1)? (3.0 + x_0) : (15.0 + x_1)) : ((19.0 + x_2) > (20.0 + x_7)? (19.0 + x_2) : (20.0 + x_7))) > (((17.0 + x_8) > (15.0 + x_11)? (17.0 + x_8) : (15.0 + x_11)) > ((9.0 + x_14) > (1.0 + x_15)? (9.0 + x_14) : (1.0 + x_15))? ((17.0 + x_8) > (15.0 + x_11)? (17.0 + x_8) : (15.0 + x_11)) : ((9.0 + x_14) > (1.0 + x_15)? (9.0 + x_14) : (1.0 + x_15)))? (((3.0 + x_0) > (15.0 + x_1)? (3.0 + x_0) : (15.0 + x_1)) > ((19.0 + x_2) > (20.0 + x_7)? (19.0 + x_2) : (20.0 + x_7))? ((3.0 + x_0) > (15.0 + x_1)? (3.0 + x_0) : (15.0 + x_1)) : ((19.0 + x_2) > (20.0 + x_7)? (19.0 + x_2) : (20.0 + x_7))) : (((17.0 + x_8) > (15.0 + x_11)? (17.0 + x_8) : (15.0 + x_11)) > ((9.0 + x_14) > (1.0 + x_15)? (9.0 + x_14) : (1.0 + x_15))? ((17.0 + x_8) > (15.0 + x_11)? (17.0 + x_8) : (15.0 + x_11)) : ((9.0 + x_14) > (1.0 + x_15)? (9.0 + x_14) : (1.0 + x_15)))); x_13_ = ((((3.0 + x_2) > (17.0 + x_3)? (3.0 + x_2) : (17.0 + x_3)) > ((16.0 + x_4) > (9.0 + x_8)? (16.0 + x_4) : (9.0 + x_8))? ((3.0 + x_2) > (17.0 + x_3)? (3.0 + x_2) : (17.0 + x_3)) : ((16.0 + x_4) > (9.0 + x_8)? (16.0 + x_4) : (9.0 + x_8))) > (((19.0 + x_10) > (14.0 + x_13)? (19.0 + x_10) : (14.0 + x_13)) > ((9.0 + x_14) > (3.0 + x_15)? (9.0 + x_14) : (3.0 + x_15))? ((19.0 + x_10) > (14.0 + x_13)? (19.0 + x_10) : (14.0 + x_13)) : ((9.0 + x_14) > (3.0 + x_15)? (9.0 + x_14) : (3.0 + x_15)))? (((3.0 + x_2) > (17.0 + x_3)? (3.0 + x_2) : (17.0 + x_3)) > ((16.0 + x_4) > (9.0 + x_8)? (16.0 + x_4) : (9.0 + x_8))? ((3.0 + x_2) > (17.0 + x_3)? (3.0 + x_2) : (17.0 + x_3)) : ((16.0 + x_4) > (9.0 + x_8)? (16.0 + x_4) : (9.0 + x_8))) : (((19.0 + x_10) > (14.0 + x_13)? (19.0 + x_10) : (14.0 + x_13)) > ((9.0 + x_14) > (3.0 + x_15)? (9.0 + x_14) : (3.0 + x_15))? ((19.0 + x_10) > (14.0 + x_13)? (19.0 + x_10) : (14.0 + x_13)) : ((9.0 + x_14) > (3.0 + x_15)? (9.0 + x_14) : (3.0 + x_15)))); x_14_ = ((((17.0 + x_2) > (8.0 + x_3)? (17.0 + x_2) : (8.0 + x_3)) > ((20.0 + x_4) > (15.0 + x_5)? (20.0 + x_4) : (15.0 + x_5))? ((17.0 + x_2) > (8.0 + x_3)? (17.0 + x_2) : (8.0 + x_3)) : ((20.0 + x_4) > (15.0 + x_5)? (20.0 + x_4) : (15.0 + x_5))) > (((1.0 + x_8) > (11.0 + x_9)? (1.0 + x_8) : (11.0 + x_9)) > ((5.0 + x_10) > (9.0 + x_11)? (5.0 + x_10) : (9.0 + x_11))? ((1.0 + x_8) > (11.0 + x_9)? (1.0 + x_8) : (11.0 + x_9)) : ((5.0 + x_10) > (9.0 + x_11)? (5.0 + x_10) : (9.0 + x_11)))? (((17.0 + x_2) > (8.0 + x_3)? (17.0 + x_2) : (8.0 + x_3)) > ((20.0 + x_4) > (15.0 + x_5)? (20.0 + x_4) : (15.0 + x_5))? ((17.0 + x_2) > (8.0 + x_3)? (17.0 + x_2) : (8.0 + x_3)) : ((20.0 + x_4) > (15.0 + x_5)? (20.0 + x_4) : (15.0 + x_5))) : (((1.0 + x_8) > (11.0 + x_9)? (1.0 + x_8) : (11.0 + x_9)) > ((5.0 + x_10) > (9.0 + x_11)? (5.0 + x_10) : (9.0 + x_11))? ((1.0 + x_8) > (11.0 + x_9)? (1.0 + x_8) : (11.0 + x_9)) : ((5.0 + x_10) > (9.0 + x_11)? (5.0 + x_10) : (9.0 + x_11)))); x_15_ = ((((12.0 + x_3) > (2.0 + x_4)? (12.0 + x_3) : (2.0 + x_4)) > ((11.0 + x_5) > (11.0 + x_6)? (11.0 + x_5) : (11.0 + x_6))? ((12.0 + x_3) > (2.0 + x_4)? (12.0 + x_3) : (2.0 + x_4)) : ((11.0 + x_5) > (11.0 + x_6)? (11.0 + x_5) : (11.0 + x_6))) > (((16.0 + x_8) > (7.0 + x_10)? (16.0 + x_8) : (7.0 + x_10)) > ((2.0 + x_12) > (16.0 + x_13)? (2.0 + x_12) : (16.0 + x_13))? ((16.0 + x_8) > (7.0 + x_10)? (16.0 + x_8) : (7.0 + x_10)) : ((2.0 + x_12) > (16.0 + x_13)? (2.0 + x_12) : (16.0 + x_13)))? (((12.0 + x_3) > (2.0 + x_4)? (12.0 + x_3) : (2.0 + x_4)) > ((11.0 + x_5) > (11.0 + x_6)? (11.0 + x_5) : (11.0 + x_6))? ((12.0 + x_3) > (2.0 + x_4)? (12.0 + x_3) : (2.0 + x_4)) : ((11.0 + x_5) > (11.0 + x_6)? (11.0 + x_5) : (11.0 + x_6))) : (((16.0 + x_8) > (7.0 + x_10)? (16.0 + x_8) : (7.0 + x_10)) > ((2.0 + x_12) > (16.0 + x_13)? (2.0 + x_12) : (16.0 + x_13))? ((16.0 + x_8) > (7.0 + x_10)? (16.0 + x_8) : (7.0 + x_10)) : ((2.0 + x_12) > (16.0 + x_13)? (2.0 + x_12) : (16.0 + x_13)))); x_0 = x_0_; x_1 = x_1_; x_2 = x_2_; x_3 = x_3_; x_4 = x_4_; x_5 = x_5_; x_6 = x_6_; x_7 = x_7_; x_8 = x_8_; x_9 = x_9_; x_10 = x_10_; x_11 = x_11_; x_12 = x_12_; x_13 = x_13_; x_14 = x_14_; x_15 = x_15_; } return 0; }
the_stack_data/29825147.c
/* ******************************************************************************* * Copyright (c) 2020-2021, STMicroelectronics * All rights reserved. * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ******************************************************************************* */ #if defined(ARDUINO_GENERIC_H725VGYX) || defined(ARDUINO_GENERIC_H735VGYX) #include "pins_arduino.h" /** * @brief System Clock Configuration * @param None * @retval None */ WEAK void SystemClock_Config(void) { /* SystemClock_Config can be generated by STM32CubeMX */ #warning "SystemClock_Config() is empty. Default clock at reset is used." } #endif /* ARDUINO_GENERIC_* */
the_stack_data/12638225.c
#include <pthread.h> #include <stdio.h> #include <stdlib.h> int a = 0; void *mythread ( void *dummy ) { pthread_t mythid; mythid = pthread_self (); a++; printf ( "Thread %ld, Calculation result = %d\n", mythid, a ); return NULL; } int main () { pthread_t thid, mythid; int res; res = pthread_create ( &thid, ( pthread_attr_t * ) NULL, mythread, NULL ); if ( res != 0 ) { printf ( "Error on thread create, return value = %d\n", res ); exit ( -1 ); } printf ( "Thread created, thid = %ld\n", thid ); mythid = pthread_self(); a++; printf ( "Thread %ld, Calculation result = %d\n", mythid, a ); pthread_join ( thid, ( void ** ) NULL ); return 0; }
the_stack_data/15811.c
#include<stdio.h> int main(int argc, char *argv[]) { int n,k,x,i,max=0,start,end; scanf("%d%d%d",&n,&k,&x); int A[n],consecutive[n-1],count=0,count2=0,temp,temp2,tempcount; for(i=0;i<n;i++) scanf("%d",&A[i]); for(i=0;i<n-1;i++) { if(A[i]==A[i+1] && A[i]== x) consecutive[count++]=i; } //printf("%d\n",count ); for(i=0;i<count;i++) { start=consecutive[i]; end=consecutive[i]+1; start--; end++; tempcount=2; while(start!=-1 && end != n) { count2=0; if(A[start]==A[end] && (start && A[start-1]==A[end]) && (end!=n-1 && A[start]==A[end+1])) count2=4,start-=2,end+=2; else if((A[start]== A[end])&&(start && A[start-1]==A[end])) count2=3,start-=2,end+=1; else if((A[start]==A[end])&&(end!=n-1 && A[start]==A[end+1])) count2=3,start-=1,end+=2; else break; if(count2>=3) tempcount=tempcount+count2; } if(tempcount>max) max=tempcount; } printf("%d\n",max ); return 0; }
the_stack_data/193892319.c
/** * BOJ 1010번 C언어 소스 코드 * 작성자 : 동동매니저 (DDManager) * * ※ 실행 결과 * 사용 메모리 : 1,116 KB / 131,072 KB * 소요 시간 : 0 ms / 2,000 ms * * Copyright 2019. DDManager all rights reserved. */ #include <stdio.h> void C(int,int); int main(void) { int T,N,M,i; scanf("%d",&T); for(i=0;i<T;i++){ scanf("%d %d",&N,&M); C(N,M); } return 0; } void C(int N,int M) { int v=1,l; if(M-N<N) N=M-N; for(l=1;l<=N;l++){ v*=M-l+1; v/=l; } printf("%d\n",v); }
the_stack_data/107953620.c
/* * Copyright (c) Electrolance Solutions * Author: Manojkumar <[email protected]> * SPDX-License-Identifier: Apache-2.0 * Test bits macro */ #include <stdio.h> #include <stdint.h> #define IS_BIT_SET(byte, pos) ((byte >> pos) & 1) int main() { char x; x = 1; if (IS_BIT_SET(x, 0)) { printf("IS BIT=LEFT\n"); } if (IS_BIT_SET(x, 1)) { printf("IS BIT=RIGHT\n"); } return 0; }
the_stack_data/162642822.c
// #todo: Modar o nome desse arquivo e usar para outra coisa. int xxxx_nothingxxxx;
the_stack_data/124822.c
/* { dg-do compile } */ /* { dg-require-effective-target ilp32 } */ /* { dg-options "-ansi -pedantic" } */ int foo () { return 1; } register char *stack_ptr __asm ("%esp"); /* { dg-warning "file-scope declaration of 'stack_ptr' specifies 'register'" } */
the_stack_data/45459.c
/* * File: ex_16.c * Author: Vinicius */ #include <stdio.h> #include <stdlib.h> #include <string.h> struct aluno { int mat; /* n´umero de matr´ıcula */ char turma; /* turma do aluno: a, b, c, d, ou e */ char nome[81]; /* nome do aluno */ float p1, p2, p3; /* notas */ }; typedef struct aluno Aluno; void inserir_dados(Aluno* v,int i); void cadastro_Aluno(Aluno* v, int i,int m,char t,char* n,float n1,float n2, float n3); void ordenar(Aluno* v, int n); void imprimir(Aluno* v,int n); int main(int argc, char** argv) { Aluno *vetor; int n,i=0,mat,indice; printf("Tamanho do vetor: "); scanf("%d",&n); vetor = (Aluno*)malloc(n *sizeof(Aluno)); for (i=0; i<n; i++) { printf("\nAluno %d:\n",i+1); inserir_dados(vetor,i); } ordenar(vetor,n); imprimir(vetor,n); return (EXIT_SUCCESS); } void inserir_dados(Aluno* v,int i){ int m; float n1,n2,n3; char t; char nome[81]; printf("Digite a matricula: "); scanf("%d",&m); getchar(); printf("Turma: "); scanf("%c",&t); getchar(); printf("Nome: "); gets(nome); printf("Nota 1, 2 e 3: "); scanf("%f %f %f",&n1,&n2,&n3); cadastro_Aluno(v,i,m,t,nome,n1,n2,n3); return; } void cadastro_Aluno(Aluno* v, int i,int m,char t,char* n,float n1,float n2, float n3){ v[i].mat = m; v[i].turma = t; strcpy(v[i].nome,n); v[i].p1 = n1; v[i].p2 = n2; v[i].p3 = n3; return; } void ordenar(Aluno* v, int n){ int i=0,j=0,m; char t; char nome[81]; float n1,n2,n3,media_j,media_i; //ordenação por seleção for(i=0;i<n-1;i++){ for(j=1+i;j<n;j++){ media_j = (v[j].p1 + v[j].p2 + v[j]. p3) /3; media_i = (v[i].p1 + v[i].p2 + v[i]. p3) /3; if(media_j > media_i) { //variavel auziliar m = v[i].mat; t = v[i].turma; strcpy(nome,v[i].nome); n1 = v[i].p1, n2 = v[i].p2, n3 = v[i].p3; //troca de valores entre os elementos v[i].mat= v[j].mat; v[i].turma = v[j].turma; strcpy(v[i].nome,v[j].nome); v[i].p1 = v[j].p1, v[i].p2 = v[j].p2, v[i].p3 = v[j].p3; v[j].mat = m; v[j].turma = t; strcpy(v[j].nome, nome); v[j].p1 = n1, v[j].p2 = n2,v[j].p3 = n3; } } } return; } void imprimir(Aluno* v,int n){ int i=0; printf("\nAlunos\n\n"); for(i=0;i<n;i++){ printf("\nMatricula: %d\nTurma: %c\nNome: %s\nNota 1: %f\nNota 2: %f\nNota3: %f\n", v[i].mat,v[i].turma,v[i].nome,v[i].p1,v[i].p2,v[i].p3); } return; }
the_stack_data/73575902.c
#include <ctype.h> #include <stdio.h> #define BUFSIZE 100 int getint(int *pn); int getch(void); void ungetch(int); int bp = 0; char buf[BUFSIZE]; int main(void) { int a, i; getint(&i); printf("%d\n", i); return 0; } int getint(int *pn) { int c, sign; while (isspace(c = getch())) ; if (!isdigit(c) && c != EOF && c != '+' && c != '-') { ungetch(c); return 0; } sign = (c == '-') ? -1 : 1; if (c == '+' || c == '-') { c = getch(); if (!isdigit(c)) { ungetch(c); return 0; } } for (*pn = 0; isdigit(c); c = getch()) { *pn = *pn * 10 + (c - '0'); } *pn *= sign; if (c != EOF) { ungetch(c); } return c; } int getch(void) { if (bp > 0) { return buf[--bp]; } else { return getchar(); } } void ungetch(int c) { if (bp >= BUFSIZE) { printf("ungetch: too many characters\n"); } else { buf[bp++] = c; } }
the_stack_data/154832043.c
#include "stdio.h" size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *fp) { const char *p = ptr; const char *end = p + size * nmemb; for (; p < end && putc(*p, fp) != EOF; p++); return size == 0 ? nmemb : (p - (const char *) ptr) / size; }
the_stack_data/63097.c
#include <stdio.h> double triangle(double base, double height); int main(void) { double base = 7, height = 9; printf("area of triangle with base %.2f and height %.2f is %.2f\n", base, height, triangle(base, height)); return 0; } double triangle(double base, double height) { double product; product = base * height; return product / 2; }
the_stack_data/92326840.c
#include <stdio.h> #include <stdlib.h> #define MAX(a,b) (a > b ? a : b) #define ESC "\033" #define ESC_RESET "\033[00m" /******************************************* * * Just some terminal colours, do you mind? * ******************************************/ #define bRED "[1;31;40m" #define bGREEN "[1;32;40m" #define bYELLOW "[1;33;40m" #define bBLUE "[1;34;40m" #define bMAGENTA "[1;35;40m" #define bCYAN "[1;36;40m" #define bWHITE "[1;37;40m" /* The Main skeletal structure for our binary tree * _______________________ * | | | | * | | Value | | * | Left | | Right | * | Child| | Child | * |______|_______|________| * | \___________________ * | | * __________|____________ _________|____________ * | | | | | | | | * | | Value | | | | Value | | * | Left | | Right | | Left | | Right | * | Child| | Child | | Child| | Child | * |______|_______|________| |______|_______|_______| * */ typedef struct Tree { struct Tree *left; int data; struct Tree *right; } binary_tree_t; /** Recursive implementation to calculate total nodes in a tree **/ int calc_size(binary_tree_t* root) { if(root == NULL) { return 0; } else { return (1 + calc_size(root->left) + calc_size(root->right)); } } /******* Helper functions for the binary trees ********/ /* * Generating a Binary Tree * * This function generates the Binary Tree using recursion. The implementation is simple if you're aware of recursion. * We first fill in the value for a particular node, and then fill it's left child first. Once the left child of a node * has been filled, we go and insert the right child for the node. Entering a negative value means the node wasn't created. * After calling malloc(), we check if the memory was allocated for the node, if not **"NEVER DEREFERENCE A NULL POINTER"** * We return NULL in case the value entered was negative or if malloc() failed to allocate the required memory. * We are reading the value in pre-order fashion, as it is intuitive for most people. * */ binary_tree_t* plant_binary_tree(void) { int value; printf("\r\nEnter the value= ") ; scanf("%d",&value); if (value < 0) return NULL; binary_tree_t* node = malloc(sizeof(binary_tree_t)); if(node) { node->data=value; printf("\r\nEnter the value of Left Child of %d", value); node->left = plant_binary_tree(); printf("\r\nEnter the value of Right Child of %d", value); node->right = plant_binary_tree(); } return (node != NULL) ? node : NULL ; } /* * Print the Preorder Traversal of the Binary Tree * This function uses recursion to print the preorder traversal of the binary tree. */ void display_preorder(binary_tree_t* tree) { if(tree) { printf("%d ", tree->data); /* * Basic Heuristics- Avoid calls for NULL children * If there are 'n' nodes in a tree, there are 'n+1' * NULL children, by the following check, we save * n+1 useless recursive calls. */ if(tree->left) display_preorder(tree->left); if(tree->right) display_preorder(tree->right); } } int main(void) { printf(ESC bGREEN"\r\n----------------Generate a Binary Tree--------------------\r\n"ESC_RESET); printf(ESC bRED"Please fill in a negative value to avoid creation of a node\r\n"ESC_RESET); printf("Visualize your tree first, before blaming the program\r\n(and report if there's a real bug :p)\r\n"); printf("Let's plant your tree! Enter the value of Root Node \r\n"); int k=0; binary_tree_t* tree = plant_binary_tree(); if(tree == NULL) { printf("\r\nTree Not created!"); } else { /* Display the tree */ printf("\r\nPre-order traversal of the tree: "); display_preorder(tree); /* Calculate the height */ printf("\r\nNodes at K distance are= "); printf("%d", calc_size(tree)); } return 0; }
the_stack_data/82659.c
/* 01. Printing Series Odd Number 1 , 3, 5, 7, ..., 99 */ #include<stdio.h> int main() { int i; for(i=1; i<=99; i++) { if((i%2!=0)) printf("%d\n",i); } return 0; }
the_stack_data/205047.c
/** ****************************************************************************** * @file stm32h7xx_ll_crc.c * @author MCD Application Team * @brief CRC LL module driver. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ #if defined(USE_FULL_LL_DRIVER) /* Includes ------------------------------------------------------------------*/ #include "stm32h7xx_ll_crc.h" #include "stm32h7xx_ll_bus.h" #ifdef USE_FULL_ASSERT #include "stm32_assert.h" #else #define assert_param(expr) ((void)0U) #endif /** @addtogroup STM32H7xx_LL_Driver * @{ */ #if defined (CRC) /** @addtogroup CRC_LL * @{ */ /* Private types -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private constants ---------------------------------------------------------*/ /* Private macros ------------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ /* Exported functions --------------------------------------------------------*/ /** @addtogroup CRC_LL_Exported_Functions * @{ */ /** @addtogroup CRC_LL_EF_Init * @{ */ /** * @brief De-initialize CRC registers (Registers restored to their default values). * @param CRCx CRC Instance * @retval An ErrorStatus enumeration value: * - SUCCESS: CRC registers are de-initialized * - ERROR: CRC registers are not de-initialized */ ErrorStatus LL_CRC_DeInit(CRC_TypeDef *CRCx) { ErrorStatus status = SUCCESS; /* Check the parameters */ assert_param(IS_CRC_ALL_INSTANCE(CRCx)); if (CRCx == CRC) { #if defined(LL_AHB4_GRP1_PERIPH_CRC) /* Force CRC reset */ LL_AHB4_GRP1_ForceReset(LL_AHB4_GRP1_PERIPH_CRC); /* Release CRC reset */ LL_AHB4_GRP1_ReleaseReset(LL_AHB4_GRP1_PERIPH_CRC); #else /* Force CRC reset */ LL_AHB1_GRP1_ForceReset(LL_AHB1_GRP1_PERIPH_CRC); /* Release CRC reset */ LL_AHB1_GRP1_ReleaseReset(LL_AHB1_GRP1_PERIPH_CRC); #endif/*LL_AHB4_GRP1_PERIPH_CRC)*/ } else { status = ERROR; } return (status); } /** * @} */ /** * @} */ /** * @} */ #endif /* defined (CRC) */ /** * @} */ #endif /* USE_FULL_LL_DRIVER */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
the_stack_data/115765279.c
#include <stdio.h> int main() { char str[1000], ch; int i,count = 0; printf("Enter a string: "); fgets(str, sizeof(str), stdin); printf("Enter a character to find its frequency: "); scanf("%c", &ch); for ( i = 0; str[i] != '\0'; ++i) { if (ch == str[i]) ++count; } printf("Frequency of %c = %d", ch, count); return 0; }
the_stack_data/1061205.c
#include <stdio.h> #include <math.h> #include <stdlib.h> #define SIZE 100 int main(void) { int triangle[SIZE][SIZE] = {0}; int num; int row = 0, col = 0; while (scanf("%d", &num) == 1) { triangle[row][col] = num; if (col++ == row) { row++; col = 0; } } for (row = SIZE - 2; row >= 0; row--) { for (col = 0; col <= row; col++) { if (triangle[row + 1][col] > triangle[row + 1][col + 1]) { triangle[row][col] += triangle[row + 1][col]; } else { triangle[row][col] += triangle[row + 1][col + 1]; } } } printf("%d\n", triangle[0][0]); }
the_stack_data/298186.c
#include <assert.h> #include <stdlib.h> #ifdef _MSC_VER # define _Static_assert(x, m) static_assert(x, m) #endif struct list; typedef struct list list_nodet; list_nodet fill_node(signed int depth_tag_list); struct list { int datum; struct list *next; }; int max_depth = 2; list_nodet *build_node(int depth) { if(max_depth < depth) return ((list_nodet *)NULL); else { _Static_assert(sizeof(list_nodet) == 16, ""); list_nodet *result = malloc(16); if(result) { *result = fill_node(depth + 1); } return result; } } list_nodet fill_node(int depth) { list_nodet result; result.datum = depth; result.next = build_node(depth); return result; } int main() { list_nodet *node = build_node(0); int i = 0; list_nodet *list_walker = node; for(; list_walker; list_walker = list_walker->next) { i = i + 1; } assert(i == 3); return 0; }
the_stack_data/40762016.c
#ifndef WINVER #define WINVER 0x0500 #endif #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0501 #endif #define WIN32_LEAN_AND_MEAN #ifdef _WIN32 #include <windows.h> void attach_init(); BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: attach_init(); break; case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: case DLL_PROCESS_DETACH: break; } return TRUE; } #endif
the_stack_data/9813.c
/*Exercise 3 - Repetition Write a C program to calculate the sum of the numbers from 1 to n. Where n is a keyboard input. e.g. n -> 100 sum = 1+2+3+....+ 99+100 = 5050 n -> 1- sum = 1+2+3+...+10 = 55 */ #include<stdio.h> int main(void) { int a,b,c=0; scanf("%d",&a); for(b=1;a>=1;a--) { c=c+b; b++; } printf("%d",c); return 0; }
the_stack_data/117229.c
/* HAL raised several warnings, ignore them */ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #ifdef STM32F0xx #include "stm32f0xx_hal_tim_ex.c" #elif STM32F1xx #include "stm32f1xx_hal_tim_ex.c" #elif STM32F2xx #include "stm32f2xx_hal_tim_ex.c" #elif STM32F3xx #include "stm32f3xx_hal_tim_ex.c" #elif STM32F4xx #include "stm32f4xx_hal_tim_ex.c" #elif STM32F7xx #include "stm32f7xx_hal_tim_ex.c" #elif STM32G0xx #include "stm32g0xx_hal_tim_ex.c" #elif STM32G4xx #include "stm32g4xx_hal_tim_ex.c" #elif STM32H7xx #include "stm32h7xx_hal_tim_ex.c" #elif STM32L0xx #include "stm32l0xx_hal_tim_ex.c" #elif STM32L1xx #include "stm32l1xx_hal_tim_ex.c" #elif STM32L4xx #include "stm32l4xx_hal_tim_ex.c" #elif STM32L5xx #include "stm32l5xx_hal_tim_ex.c" #elif STM32MP1xx #include "stm32mp1xx_hal_tim_ex.c" #elif STM32U5xx #include "stm32u5xx_hal_tim_ex.c" #elif STM32WBxx #include "stm32wbxx_hal_tim_ex.c" #elif STM32WLxx #include "stm32wlxx_hal_tim_ex.c" #endif #pragma GCC diagnostic pop
the_stack_data/7949423.c
#include <stdio.h> #include <stdlib.h> #include <math.h> void main() { float x1, y1, x2, y2; scanf("%f%f%f%f", &x1, &y1, &x2, &y2); printf("%.4f\n", sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1)) ); }
the_stack_data/51914.c
extern int __mark(int); int g(int n) { int r=0; int i=n; __mark(0); while (__mark(1) & (i > 0)) { r = r + n; i--; } return r; }
the_stack_data/657826.c
#include <stdio.h> int main(void) { printf("This value %d is an integer\n", 986); printf("This value %f is a float\n", 98.6); return(0); }
the_stack_data/1100832.c
#include <stdio.h> void change(char *str) { int i; for (i = 0; str[i]; i++) { if (str[i] >= 'a' && str[i] <= 'z') { str[i] = 'z'+'a'-str[i]; continue; } if (str[i] >= 'A' && str[i] <= 'Z') { str[i] = 'Z'+'A'-str[i]; } } } int main(int argc, char* argv[]) { char str[81]; freopen("input.txt", "r", stdin); while (gets(str) != NULL) { if (str[0] == '!' && str[1] == '\0') { break; } change(str); puts(str); } return 0; }
the_stack_data/39356.c
#include <stdio.h> void scilab_rt_plot3d_i2i2i2d0d0s0_(int in00, int in01, int matrixin0[in00][in01], int in10, int in11, int matrixin1[in10][in11], int in20, int in21, int matrixin2[in20][in21], double scalarin0, double scalarin1, char* scalarin2) { int i; int j; int val0 = 0; int val1 = 0; int val2 = 0; for (i = 0; i < in00; ++i) { for (j = 0; j < in01; ++j) { val0 += matrixin0[i][j]; } } printf("%d", val0); for (i = 0; i < in10; ++i) { for (j = 0; j < in11; ++j) { val1 += matrixin1[i][j]; } } printf("%d", val1); for (i = 0; i < in20; ++i) { for (j = 0; j < in21; ++j) { val2 += matrixin2[i][j]; } } printf("%d", val2); printf("%f", scalarin0); printf("%f", scalarin1); printf("%s", scalarin2); }
the_stack_data/86075312.c
#include <stdio.h> int main(void){ printf("Greeting From GitZart,\n"); printf("\tHello, GitHub.\n"); }
the_stack_data/61075996.c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_foreach.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: mbiliaie <[email protected]> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/10/30 19:25:56 by mbiliaie #+# #+# */ /* Updated: 2017/10/30 19:33:41 by mbiliaie ### ########.fr */ /* */ /* ************************************************************************** */ void ft_foreach(int *tab, int length, void (*f)(int)) { int i; i = 0; while (i <= length - 1) { f(tab[i]); i++; } }
the_stack_data/27192.c
#include <stdio.h> #include <math.h> //incluida a biblioteca math para o uso de raiz quadrada int main() { double largura, comprimento, area, perimetro, diagonal; printf("digite a largura: "); scanf("%lf", &largura); printf("digite o comprimento: "); scanf("%lf", &comprimento); area = largura * comprimento; perimetro = (largura * 2) + (comprimento * 2); diagonal = sqrt(pow(comprimento, 2.0) + pow(largura, 2.0)); printf("area: %.4lf\n", area); printf("perimetro: %.4lf\n", perimetro); printf("diagonal: %.4lf\n", diagonal); return 0; }
the_stack_data/108365.c
/* Unions */ #include <stdio.h> #include <string.h> int main () { //T// union definition union oneType { int ui; char us[15]; }; //T// union initialization and assignment union oneType u1; strcpy(u1.us,"str1"); return 0; }
the_stack_data/348137.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; /* > \brief \b ZGETSQRHRT */ /* =========== DOCUMENTATION =========== */ /* Online html documentation available at */ /* http://www.netlib.org/lapack/explore-html/ */ /* > \htmlonly */ /* > Download ZGETSQRHRT + dependencies */ /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zgetsqr hrt.f"> */ /* > [TGZ]</a> */ /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zgetsqr hrt.f"> */ /* > [ZIP]</a> */ /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zgetsqr hrt.f"> */ /* > [TXT]</a> */ /* > \endhtmlonly */ /* Definition: */ /* =========== */ /* SUBROUTINE ZGETSQRHRT( M, N, MB1, NB1, NB2, A, LDA, T, LDT, WORK, */ /* $ LWORK, INFO ) */ /* IMPLICIT NONE */ /* INTEGER INFO, LDA, LDT, LWORK, M, N, NB1, NB2, MB1 */ /* COMPLEX*16 A( LDA, * ), T( LDT, * ), WORK( * ) */ /* > \par Purpose: */ /* ============= */ /* > */ /* > \verbatim */ /* > */ /* > ZGETSQRHRT computes a NB2-sized column blocked QR-factorization */ /* > of a complex M-by-N matrix A with M >= N, */ /* > */ /* > A = Q * R. */ /* > */ /* > The routine uses internally a NB1-sized column blocked and MB1-sized */ /* > row blocked TSQR-factorization and perfors the reconstruction */ /* > of the Householder vectors from the TSQR output. The routine also */ /* > converts the R_tsqr factor from the TSQR-factorization output into */ /* > the R factor that corresponds to the Householder QR-factorization, */ /* > */ /* > A = Q_tsqr * R_tsqr = Q * R. */ /* > */ /* > The output Q and R factors are stored in the same format as in ZGEQRT */ /* > (Q is in blocked compact WY-representation). See the documentation */ /* > of ZGEQRT for more details on the format. */ /* > \endverbatim */ /* Arguments: */ /* ========== */ /* > \param[in] M */ /* > \verbatim */ /* > M is INTEGER */ /* > The number of rows of the matrix A. M >= 0. */ /* > \endverbatim */ /* > */ /* > \param[in] N */ /* > \verbatim */ /* > N is INTEGER */ /* > The number of columns of the matrix A. M >= N >= 0. */ /* > \endverbatim */ /* > */ /* > \param[in] MB1 */ /* > \verbatim */ /* > MB1 is INTEGER */ /* > The row block size to be used in the blocked TSQR. */ /* > MB1 > N. */ /* > \endverbatim */ /* > */ /* > \param[in] NB1 */ /* > \verbatim */ /* > NB1 is INTEGER */ /* > The column block size to be used in the blocked TSQR. */ /* > N >= NB1 >= 1. */ /* > \endverbatim */ /* > */ /* > \param[in] NB2 */ /* > \verbatim */ /* > NB2 is INTEGER */ /* > The block size to be used in the blocked QR that is */ /* > output. NB2 >= 1. */ /* > \endverbatim */ /* > */ /* > \param[in,out] A */ /* > \verbatim */ /* > A is COMPLEX*16 array, dimension (LDA,N) */ /* > */ /* > On entry: an M-by-N matrix A. */ /* > */ /* > On exit: */ /* > a) the elements on and above the diagonal */ /* > of the array contain the N-by-N upper-triangular */ /* > matrix R corresponding to the Householder QR; */ /* > b) the elements below the diagonal represent Q by */ /* > the columns of blocked V (compact WY-representation). */ /* > \endverbatim */ /* > */ /* > \param[in] LDA */ /* > \verbatim */ /* > LDA is INTEGER */ /* > The leading dimension of the array A. LDA >= f2cmax(1,M). */ /* > \endverbatim */ /* > */ /* > \param[out] T */ /* > \verbatim */ /* > T is COMPLEX*16 array, dimension (LDT,N)) */ /* > The upper triangular block reflectors stored in compact form */ /* > as a sequence of upper triangular blocks. */ /* > \endverbatim */ /* > */ /* > \param[in] LDT */ /* > \verbatim */ /* > LDT is INTEGER */ /* > The leading dimension of the array T. LDT >= NB2. */ /* > \endverbatim */ /* > */ /* > \param[out] WORK */ /* > \verbatim */ /* > (workspace) COMPLEX*16 array, dimension (MAX(1,LWORK)) */ /* > On exit, if INFO = 0, WORK(1) returns the optimal LWORK. */ /* > \endverbatim */ /* > */ /* > \param[in] LWORK */ /* > \verbatim */ /* > The dimension of the array WORK. */ /* > LWORK >= MAX( LWT + LW1, MAX( LWT+N*N+LW2, LWT+N*N+N ) ), */ /* > where */ /* > NUM_ALL_ROW_BLOCKS = CEIL((M-N)/(MB1-N)), */ /* > NB1LOCAL = MIN(NB1,N). */ /* > LWT = NUM_ALL_ROW_BLOCKS * N * NB1LOCAL, */ /* > LW1 = NB1LOCAL * N, */ /* > LW2 = NB1LOCAL * MAX( NB1LOCAL, ( N - NB1LOCAL ) ), */ /* > If LWORK = -1, then a workspace query is assumed. */ /* > The routine only calculates the optimal size of the WORK */ /* > array, returns this value as the first entry of the WORK */ /* > array, and no error message related to LWORK is issued */ /* > by XERBLA. */ /* > \endverbatim */ /* > */ /* > \param[out] INFO */ /* > \verbatim */ /* > INFO is INTEGER */ /* > = 0: successful exit */ /* > < 0: if INFO = -i, the i-th argument had an illegal value */ /* > \endverbatim */ /* Authors: */ /* ======== */ /* > \author Univ. of Tennessee */ /* > \author Univ. of California Berkeley */ /* > \author Univ. of Colorado Denver */ /* > \author NAG Ltd. */ /* > \ingroup comlpex16OTHERcomputational */ /* > \par Contributors: */ /* ================== */ /* > */ /* > \verbatim */ /* > */ /* > November 2020, Igor Kozachenko, */ /* > Computer Science Division, */ /* > University of California, Berkeley */ /* > */ /* > \endverbatim */ /* > */ /* ===================================================================== */ /* Subroutine */ int zgetsqrhrt_(integer *m, integer *n, integer *mb1, integer *nb1, integer *nb2, doublecomplex *a, integer *lda, doublecomplex *t, integer *ldt, doublecomplex *work, integer *lwork, integer *info) { /* System generated locals */ integer a_dim1, a_offset, t_dim1, t_offset, i__1, i__2, i__3, i__4; doublereal d__1, d__2, d__3; doublecomplex z__1, z__2; /* Local variables */ integer ldwt, lworkopt, i__, j, iinfo; extern /* Subroutine */ int zungtsqr_row_(integer *, integer *, integer * , integer *, doublecomplex *, integer *, doublecomplex *, integer *, doublecomplex *, integer *, integer *), zcopy_(integer *, doublecomplex *, integer *, doublecomplex *, integer *), zunhr_col_(integer *, integer *, integer *, doublecomplex *, integer *, doublecomplex *, integer *, doublecomplex *, integer *) , xerbla_(char *, integer *, ftnlen); logical lquery; integer lw1, lw2, num_all_row_blocks__, lwt, nb1local, nb2local; extern /* Subroutine */ int zlatsqr_(integer *, integer *, integer *, integer *, doublecomplex *, integer *, doublecomplex *, integer *, doublecomplex *, integer *, integer *); /* -- LAPACK computational routine -- */ /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */ /* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */ /* ===================================================================== */ /* Test the input arguments */ /* Parameter adjustments */ a_dim1 = *lda; a_offset = 1 + a_dim1 * 1; a -= a_offset; t_dim1 = *ldt; t_offset = 1 + t_dim1 * 1; t -= t_offset; --work; /* Function Body */ *info = 0; lquery = *lwork == -1; if (*m < 0) { *info = -1; } else if (*n < 0 || *m < *n) { *info = -2; } else if (*mb1 <= *n) { *info = -3; } else if (*nb1 < 1) { *info = -4; } else if (*nb2 < 1) { *info = -5; } else if (*lda < f2cmax(1,*m)) { *info = -7; } else /* if(complicated condition) */ { /* Computing MAX */ i__1 = 1, i__2 = f2cmin(*nb2,*n); if (*ldt < f2cmax(i__1,i__2)) { *info = -9; } else { /* Test the input LWORK for the dimension of the array WORK. */ /* This workspace is used to store array: */ /* a) Matrix T and WORK for ZLATSQR; */ /* b) N-by-N upper-triangular factor R_tsqr; */ /* c) Matrix T and array WORK for ZUNGTSQR_ROW; */ /* d) Diagonal D for ZUNHR_COL. */ if (*lwork < *n * *n + 1 && ! lquery) { *info = -11; } else { /* Set block size for column blocks */ nb1local = f2cmin(*nb1,*n); /* Computing MAX */ d__3 = (doublereal) (*m - *n) / (doublereal) (*mb1 - *n) + .5f; d__1 = 1., d__2 = d_int(&d__3); num_all_row_blocks__ = (integer) f2cmax(d__1,d__2); /* Length and leading dimension of WORK array to place */ /* T array in TSQR. */ lwt = num_all_row_blocks__ * *n * nb1local; ldwt = nb1local; /* Length of TSQR work array */ lw1 = nb1local * *n; /* Length of ZUNGTSQR_ROW work array. */ /* Computing MAX */ i__1 = nb1local, i__2 = *n - nb1local; lw2 = nb1local * f2cmax(i__1,i__2); /* Computing MAX */ /* Computing MAX */ i__3 = lwt + *n * *n + lw2, i__4 = lwt + *n * *n + *n; i__1 = lwt + lw1, i__2 = f2cmax(i__3,i__4); lworkopt = f2cmax(i__1,i__2); if (*lwork < f2cmax(1,lworkopt) && ! lquery) { *info = -11; } } } } /* Handle error in the input parameters and return workspace query. */ if (*info != 0) { i__1 = -(*info); xerbla_("ZGETSQRHRT", &i__1, (ftnlen)10); return 0; } else if (lquery) { z__1.r = (doublereal) lworkopt, z__1.i = 0.; work[1].r = z__1.r, work[1].i = z__1.i; return 0; } /* Quick return if possible */ if (f2cmin(*m,*n) == 0) { z__1.r = (doublereal) lworkopt, z__1.i = 0.; work[1].r = z__1.r, work[1].i = z__1.i; return 0; } nb2local = f2cmin(*nb2,*n); /* (1) Perform TSQR-factorization of the M-by-N matrix A. */ zlatsqr_(m, n, mb1, &nb1local, &a[a_offset], lda, &work[1], &ldwt, &work[ lwt + 1], &lw1, &iinfo); /* (2) Copy the factor R_tsqr stored in the upper-triangular part */ /* of A into the square matrix in the work array */ /* WORK(LWT+1:LWT+N*N) column-by-column. */ i__1 = *n; for (j = 1; j <= i__1; ++j) { zcopy_(&j, &a[j * a_dim1 + 1], &c__1, &work[lwt + *n * (j - 1) + 1], & c__1); } /* (3) Generate a M-by-N matrix Q with orthonormal columns from */ /* the result stored below the diagonal in the array A in place. */ zungtsqr_row_(m, n, mb1, &nb1local, &a[a_offset], lda, &work[1], &ldwt, & work[lwt + *n * *n + 1], &lw2, &iinfo); /* (4) Perform the reconstruction of Householder vectors from */ /* the matrix Q (stored in A) in place. */ zunhr_col_(m, n, &nb2local, &a[a_offset], lda, &t[t_offset], ldt, &work[ lwt + *n * *n + 1], &iinfo); /* (5) Copy the factor R_tsqr stored in the square matrix in the */ /* work array WORK(LWT+1:LWT+N*N) into the upper-triangular */ /* part of A. */ /* (6) Compute from R_tsqr the factor R_hr corresponding to */ /* the reconstructed Householder vectors, i.e. R_hr = S * R_tsqr. */ /* This multiplication by the sign matrix S on the left means */ /* changing the sign of I-th row of the matrix R_tsqr according */ /* to sign of the I-th diagonal element DIAG(I) of the matrix S. */ /* DIAG is stored in WORK( LWT+N*N+1 ) from the ZUNHR_COL output. */ /* (5) and (6) can be combined in a single loop, so the rows in A */ /* are accessed only once. */ i__1 = *n; for (i__ = 1; i__ <= i__1; ++i__) { i__2 = lwt + *n * *n + i__; z__1.r = -1., z__1.i = 0.; if (work[i__2].r == z__1.r && work[i__2].i == z__1.i) { i__2 = *n; for (j = i__; j <= i__2; ++j) { i__3 = i__ + j * a_dim1; z__2.r = -1., z__2.i = 0.; i__4 = lwt + *n * (j - 1) + i__; z__1.r = z__2.r * work[i__4].r - z__2.i * work[i__4].i, z__1.i = z__2.r * work[i__4].i + z__2.i * work[i__4] .r; a[i__3].r = z__1.r, a[i__3].i = z__1.i; } } else { i__2 = *n - i__ + 1; zcopy_(&i__2, &work[lwt + *n * (i__ - 1) + i__], n, &a[i__ + i__ * a_dim1], lda); } } z__1.r = (doublereal) lworkopt, z__1.i = 0.; work[1].r = z__1.r, work[1].i = z__1.i; return 0; /* End of ZGETSQRHRT */ } /* zgetsqrhrt_ */
the_stack_data/25137108.c
int calculate_output(int); extern void __VERIFIER_error(void); extern int __VERIFIER_nondet_int(void); extern void exit(int); // inputs int d= 4; int f= 6; int a= 1; int e= 5; int c= 3; int b= 2; // outputs int u = 21; int v = 22; int w = 23; int x = 24; int y = 25; int z = 26; int a1 = 1; int a4 = 1; int a0 = 1; int a15 = 1; int a29 = 1; int a10 = 1; int a16 = 1; int a22 = 1; int a2 = 0; int a17 = 0; int a25 = 0; int a7 = 0; int a14 = 0; int a19 = 0; int a20 = 0; int a8 = 0; int a23 = 0; int a21 = 1; int a24 = 1; int a13 = 1; int a9 = 1; int a28 = 1; int a26 = 0; int a6 = 0; int a27 = 1; int a12 = 0; int a3 = 1; int a11 = 0; int a5 = 1; int a18 = 1; int calculate_output(int input) { if((((((a18==1)&&((((a22==1)&&(a4==1))||(a2==1))&&(a0==1)))&&(a11==1))&&(a3==2))&&(!(a8==1)&&(((a5==1)&&((a6==1)&&(((((!(a27==1)&&!(a26==1))&&(a12==1))||(((a26==1)&&(a27==1))&&!(a12==1)))&&(input==5))&&!(a2==1))))&&!(a25==1))))){ if((a18==1)){ a2 = 0; a27 = 1; a25 = 0; a19 = 0; a26 = 1; a11 = 0; a12 = 0; }else{ a12 = 0; a29 = 1; a26 = 1; a27 = 1; a6 = 0; a1 = 1; } return 23; } else if(((((a5==1)&&((a20==1)&&(((!(a26==1)&&(a27==1))||(!(a27==1)&&(a26==1)))&&(input==6))))&&!(a15==1))&&(((a3==2)&&(!(a1==1)&&((a18==1)&&((a19==1)&&(((((a0==1)&&!(a16==1))&&(a12==1))&&(a14==1))&&(a6==1))))))&&!(a11==1)))){ a26 = 1; a3 = 0; a27 = 0; a17 = 1; a25 = 1; a19 = 1; a11 = 1; return -1; } else if(((!(a1==1)||((a10==1)&&((a4==1)&&!(a8==1))))&&((!(a11==1)&&(!(a14==1)&&(((a18==1)&&(!(a12==1)&&((((a3==2)&&(((((a26==1)&&(a27==1))||(!(a26==1)&&(a27==1)))||((a26==1)&&!(a27==1)))&&(input==5)))&&!(a8==1))&&(a16==1))))&&(a6==1))))&&(a5==1)))){ a4 = 1; a26 = 0; a25 = 0; a2 = 0; a27 = 1; return -1; } else if(((((a3==1)&&(!(a6==1)&&((!(a14==1)&&(((input==5)&&!(a26==1))&&(a1==1)))&&!(a8==1))))&&(a27==1))&&(((!(a16==1)||((!(a12==1)&&((a5==1)&&((a29==1)&&!(a25==1))))&&(a18==1)))&&(a10==1))&&!(a11==1)))){ a17 = 0; a1 = 1; a25 = 0; a27 = 0; return 26; } else if(((!(a26==1)&&((a5==1)&&((a18==1)&&(((a4==1)&&!(a11==1))&&!(a6==1)))))&&(((a29==1)&&(!(a23==1)&&(!(a7==1)&&((!(a25==1)&&(((!(a27==1)&&(input==1))&&(a3==1))&&(a10==1)))&&!(a14==1)))))&&!(a12==1)))){ a26 = 1; a11 = 1; a3 = 0; a27 = 1; a6 = 1; a12 = 1; a15 = 1; a4 = 1; return -1; } else if(((((a16==1)&&((a3==2)&&((a11==1)&&((a20==1)||((a16==1)&&(a18==1))))))&&(a22==1))&&((a15==1)&&((a22==1)&&(((a5==1)&&(((((!(a26==1)&&!(a27==1))||(((a27==1)&&!(a26==1))||(!(a27==1)&&(a26==1))))&&(input==2))&&!(a17==1))&&!(a12==1)))&&(a6==1)))))){ a7 = 0; a1 = 1; a3 = 0; a12 = 1; a26 = 1; a27 = 1; a14 = 0; return -1; } else if((((((a18==1)&&((((((!(a12==1)&&((!(a26==1)&&!(a6==1))&&!(a27==1)))&&(a3==2))&&!(a11==1))&&(a5==1))||(!(a5==1)&&(((a3==0)&&((a12==1)&&((a27==1)&&((a26==1)&&(a6==1)))))&&(a11==1))))&&(input==3)))&&!(a20==1))&&!(a23==1))&&(!(a29==1)||(!(a1==1)||(!(a15==1)||(!(a17==1)&&(a4==1))))))){ a19 = 1; a12 = 1; a24 = 1; a5 = 1; a26 = 1; a11 = 0; a6 = 0; a28 = 0; a27 = 1; a3 = 0; return 25; } else if(((((((!(a20==1)&&((((a15==1)&&((input==1)&&(((a12==1)&&(!(a27==1)&&!(a26==1)))||(((a27==1)&&(a26==1))&&!(a12==1)))))&&!(a8==1))&&(a5==1)))&&(a11==1))&&!(a17==1))&&(a4==1))&&(a6==1))&&(!(a19==1)&&((a18==1)&&((a3==2)&&(a0==1)))))){ a16 = 1; a22 = 1; a8 = 0; a3 = 0; a26 = 1; a12 = 1; a27 = 1; return -1; } else if((((((a18==1)&&((!(a2==1)&&(((input==5)&&(((a12==1)&&(!(a26==1)&&!(a27==1)))||(!(a12==1)&&((a26==1)&&(a27==1)))))&&!(a7==1)))&&(a29==1)))&&(a0==1))&&(a11==1))&&((a6==1)&&((a7==1)||(!(a10==1)||(!(a5==1)&&((a3==0)&&(a0==1)))))))){ a14 = 1; a10 = 0; a6 = 0; a5 = 1; a11 = 0; a12 = 1; a26 = 1; a24 = 0; a27 = 1; return 21; } else if(((((a7==1)||((!(a8==1)&&((!(a12==1)&&((a0==1)&&(a3==0)))&&!(a19==1)))&&(a11==1)))&&!(a5==1))&&((a18==1)&&((((a6==1)&&((a10==1)&&(((((a27==1)&&!(a26==1))||((a26==1)&&!(a27==1)))||(!(a27==1)&&!(a26==1)))&&(input==4))))&&(a1==1))&&(a22==1))))){ a26 = 0; a15 = 0; a29 = 0; a27 = 0; a5 = 1; a6 = 0; a12 = 1; return 25; } else if(((!(a22==1)&&(((a5==1)&&((a3==2)&&((!(a22==1)&&((a17==1)&&(a10==1)))&&(a12==1))))&&!(a11==1)))&&((!(a15==1)&&(((a18==1)&&(((input==4)&&((!(a26==1)&&(a27==1))||((a26==1)&&!(a27==1))))&&(a20==1)))&&(a6==1)))&&!(a4==1)))){ a26 = 1; a29 = 0; a28 = 1; a11 = 1; a6 = 0; a27 = 0; a25 = 1; return -1; } else if(((((a3==2)&&(((a6==1)&&((!(a23==1)&&(!(a25==1)&&(((((a26==1)&&(a27==1))||(!(a26==1)&&(a27==1)))||((a26==1)&&!(a27==1)))&&(input==2))))&&!(a11==1)))&&(a16==1)))&&(a18==1))&&((a5==1)&&((((a25==1)||((a4==1)&&(a22==1)))&&!(a25==1))&&!(a12==1))))){ a6 = 0; a29 = 1; a11 = 1; a26 = 1; a7 = 0; a27 = 1; return 23; } else if((((a11==1)&&((a18==1)&&((a22==1)&&((!(a23==1)&&(((!(a26==1)&&!(a27==1))||((!(a26==1)&&(a27==1))||((a26==1)&&!(a27==1))))&&(input==6)))&&!(a12==1)))))&&(!(a22==1)||((a6==1)&&(((a22==1)&&(((a5==1)&&((a4==1)||!(a10==1)))&&(a3==2)))||!(a22==1)))))){ a27 = 1; a17 = 0; a10 = 1; a3 = 0; a8 = 0; a26 = 1; a12 = 1; return -1; } else if(((!(a26==1)&&((!(a22==1)||(!(a1==1)||((!(a8==1)&&(a29==1))||(a7==1))))&&(a29==1)))&&((a3==1)&&((a27==1)&&((!(a12==1)&&(!(a11==1)&&((a18==1)&&(((input==6)&&(a5==1))&&!(a6==1)))))&&!(a19==1)))))){ a3 = 0; a11 = 1; a12 = 1; a8 = 0; a20 = 0; a26 = 1; a6 = 1; a29 = 1; return -1; } else if((((a11==1)&&(!(a8==1)&&((((a12==1)&&(!(a26==1)&&!(a27==1)))||(!(a12==1)&&((a27==1)&&(a26==1))))&&(input==6))))&&(!(a5==1)&&((a3==0)&&((a18==1)&&((((!(a4==1)||(((a1==1)&&!(a8==1))&&(a6==1)))||(a14==1))||!(a0==1))&&(a4==1))))))){ if((a29==1)){ a12 = 1; a26 = 1; a5 = 1; a0 = 0; a27 = 1; a3 = 2; a21 = 1; a6 = 0; a29 = 0; }else{ a29 = 0; a9 = 0; a3 = 2; a26 = 0; a4 = 0; a12 = 0; a5 = 1; a27 = 0; } return -1; } else if(((!(a17==1)&&(!(a8==1)&&((a4==1)&&((a18==1)&&((a3==2)&&(!(a6==1)&&(((!(a17==1)&&((((!(a26==1)&&!(a27==1))&&(a12==1))||(!(a12==1)&&((a27==1)&&(a26==1))))&&(input==2)))&&(a5==1))&&!(a11==1))))))))&&(((a4==1)||(a2==1))||!(a10==1)))){ a3 = 1; a24 = 0; a28 = 0; a0 = 0; a27 = 0; a12 = 0; a26 = 1; return -1; } else if((((a15==1)&&((a3==2)&&((a5==1)&&((((input==1)&&((!(a12==1)&&(((a6==1)&&!(a26==1))&&!(a27==1)))||(((a27==1)&&((a26==1)&&!(a6==1)))&&(a12==1))))&&!(a11==1))&&(a29==1)))))&&((a8==1)||((((a18==1)&&(!(a7==1)&&(a15==1)))&&!(a19==1))&&(a22==1))))){ a12 = 1; a27 = 1; a26 = 1; a25 = 0; a6 = 1; a3 = 0; a16 = 1; a10 = 1; a11 = 1; return -1; } else if(((((((((!(a25==1)&&(a1==1))&&(a0==1))||(a7==1))&&!(a6==1))&&(a29==1))&&(a3==2))&&(a11==1))&&((a18==1)&&((((a27==1)&&(((!(a12==1)&&(input==2))&&(a29==1))&&!(a26==1)))&&!(a25==1))&&(a5==1))))){ a1 = 1; a19 = 0; a0 = 1; return 24; } else if((((a0==1)&&((!(a6==1)&&(((a3==1)&&(!(a12==1)&&((a8==1)||((a22==1)&&!(a23==1)))))||!(a10==1)))&&!(a11==1)))&&(!(a27==1)&&((a26==1)&&((!(a14==1)&&(((input==1)&&(a5==1))&&(a29==1)))&&(a18==1)))))){ a1 = 1; a11 = 1; a12 = 1; a3 = 0; a27 = 1; a19 = 0; a6 = 1; a2 = 0; return -1; } else if(((((((a20==1)||((a4==1)&&((a20==1)||((a29==1)&&(a5==1)))))||!(a22==1))&&(a3==2))&&(a27==1))&&((!(a14==1)&&(!(a26==1)&&(((a1==1)&&((a18==1)&&(!(a12==1)&&(input==1))))&&(a11==1))))&&!(a6==1)))){ a27 = 0; a1 = 1; a25 = 0; a6 = 1; a26 = 1; a3 = 1; a15 = 1; return -1; } else if(((((((((a11==1)&&((a6==1)&&(!(a7==1)&&(a22==1))))&&(a18==1))&&(a5==1))||(a14==1))&&(a16==1))&&(a29==1))&&((a10==1)&&(!(a2==1)&&((((((a26==1)&&!(a27==1))||(((a26==1)&&(a27==1))||((a27==1)&&!(a26==1))))&&(input==1))&&(a3==2))&&(a12==1)))))){ a26 = 1; a3 = 0; a27 = 1; a25 = 0; a23 = 0; a4 = 1; return -1; } else if((((a3==2)&&((!(a17==1)&&((a18==1)&&((a17==1)||(a16==1))))&&(a5==1)))&&(!(a25==1)&&(((!(a11==1)&&((((!(a12==1)&&((!(a26==1)&&(a6==1))&&!(a27==1)))||((a12==1)&&((!(a6==1)&&(a26==1))&&(a27==1))))&&(input==5))&&!(a7==1)))&&!(a19==1))&&!(a7==1))))){ a3 = 0; a12 = 1; a26 = 1; a11 = 1; a15 = 1; a6 = 1; a27 = 1; a2 = 0; a23 = 0; return -1; } else if((((a1==1)&&(((!(a23==1)&&((a27==1)&&(!(a12==1)&&((a18==1)&&(!(a20==1)&&((input==1)&&(a11==1)))))))&&!(a23==1))&&!(a19==1)))&&(!(a20==1)&&((a3==2)&&((a5==1)&&(!(a6==1)&&((a16==1)&&(a26==1)))))))){ a11 = 0; a6 = 1; a14 = 0; a10 = 1; a27 = 0; a23 = 0; return -1; } else if(((((a18==1)&&(((!(a14==1)&&((a4==1)&&((a16==1)&&(((input==3)&&((a26==1)||!(a26==1)))&&(a22==1)))))&&(a11==1))&&(a5==1)))&&!(a6==1))&&((a27==1)&&((a12==1)&&(((a22==1)&&((a10==1)&&(a0==1)))&&(a3==2)))))){ a11 = 0; a17 = 0; a7 = 0; a26 = 1; a6 = 1; a20 = 0; return 21; } else if(((!(a25==1)&&((((((a11==1)&&(((!(a14==1)&&(!(a27==1)&&(a15==1)))&&(a12==1))&&(a5==1)))&&(a3==2))&&!(a2==1))||!(a15==1))&&!(a6==1)))&&((a22==1)&&(((a29==1)&&(((a26==1)||!(a26==1))&&(input==4)))&&(a18==1))))){ a27 = 1; a16 = 1; a6 = 1; a3 = 0; a26 = 1; a0 = 1; a10 = 1; return -1; } else if((((a1==1)&&((a5==1)&&((!(a26==1)&&(a0==1))&&!(a6==1))))&&((((!(a23==1)&&((((!(a11==1)&&(((a3==1)&&(input==2))&&!(a27==1)))&&!(a12==1))&&(a0==1))&&!(a19==1)))&&!(a17==1))&&(a18==1))&&(a16==1)))){ a3 = 0; a12 = 1; a11 = 1; a6 = 1; a14 = 0; a27 = 1; a0 = 1; a7 = 0; a26 = 1; return -1; } else if(((!(a6==1)&&((!(a8==1)&&((!(a7==1)&&((input==4)&&(a11==1)))&&(a5==1)))&&!(a8==1)))&&((a18==1)&&((!(a12==1)&&((((((a3==2)&&(a0==1))||!(a0==1))||!(a1==1))&&(a26==1))&&(a27==1)))||!(a16==1))))){ a11 = 0; a6 = 1; a1 = 1; a2 = 0; a19 = 0; return 23; } else if((((!(a26==1)&&((((a27==1)&&((a10==1)&&(!(a25==1)&&(a22==1))))||!(a16==1))&&!(a2==1)))&&!(a7==1))&&(((a5==1)&&(((a18==1)&&((a0==1)&&(!(a11==1)&&((input==2)&&(a3==1)))))&&!(a6==1)))&&!(a12==1)))){ a11 = 1; a14 = 0; a6 = 1; a15 = 1; a23 = 0; a26 = 1; a3 = 0; a12 = 1; return -1; } else if(((!(a23==1)&&((a1==1)&&(!(a27==1)&&(((input==2)&&(a18==1))&&(a0==1)))))&&(((a12==1)&&((a3==2)&&((!(a11==1)&&((a5==1)&&((a2==1)||((a10==1)&&((a15==1)||(a7==1))))))&&!(a26==1))))&&(a6==1)))){ a29 = 1; a4 = 1; a27 = 1; a17 = 0; a6 = 0; a3 = 1; a26 = 1; a11 = 1; return -1; } else if(((!(a2==1)&&(((a3==2)&&((a5==1)&&((a12==1)&&((!(a11==1)&&((a6==1)&&((input==5)&&((!(a26==1)&&(a27==1))||((a26==1)&&!(a27==1))))))&&(a15==1)))))&&(a10==1)))&&(!(a0==1)||((!(a7==1)&&((a4==1)&&(a22==1)))&&(a18==1))))){ a12 = 0; a25 = 0; a3 = 0; a15 = 1; a26 = 1; a6 = 0; a27 = 1; return -1; } else if(((((a0==1)&&(!(a17==1)&&((a0==1)&&((((input==5)&&((!(a26==1)&&!(a27==1))||((!(a26==1)&&(a27==1))||(!(a27==1)&&(a26==1)))))&&!(a2==1))&&!(a12==1)))))&&(a1==1))&&((((a18==1)&&((a11==1)&&(((a22==1)&&(a6==1))&&(a5==1))))&&(a3==2))||!(a29==1)))){ a20 = 0; a27 = 1; a2 = 0; a26 = 0; a6 = 0; a22 = 1; return 24; } else if(((((a3==1)&&(((((((a23==1)||(a15==1))||!(a15==1))&&(a26==1))&&!(a14==1))&&!(a19==1))&&!(a12==1)))&&!(a27==1))&&(!(a6==1)&&(((a5==1)&&((a0==1)&&((a10==1)&&((input==4)&&(a18==1)))))&&!(a11==1))))){ a3 = 0; a29 = 1; a12 = 1; a11 = 1; a15 = 1; a6 = 1; a0 = 1; a27 = 1; return -1; } else if((((a6==1)&&(((!(a19==1)&&((a0==1)&&(!(a5==1)&&(((input==3)&&(((!(a27==1)&&!(a26==1))&&(a12==1))||(((a26==1)&&(a27==1))&&!(a12==1))))&&(a10==1)))))&&!(a25==1))&&(a3==0)))&&((a11==1)&&((a18==1)&&((a4==1)&&(!(a4==1)||(a15==1))))))){ a20 = 1; a6 = 0; a5 = 1; a12 = 0; a3 = 2; a19 = 1; a27 = 1; a26 = 1; a21 = 1; return -1; } else if(((((a6==1)&&(((a19==1)||((!(a19==1)&&(a29==1))||(a20==1)))&&!(a5==1)))&&(a18==1))&&((a11==1)&&((!(a23==1)&&((((a10==1)&&(((((a27==1)&&!(a26==1))||((a26==1)&&!(a27==1)))||(!(a27==1)&&!(a26==1)))&&(input==3)))&&!(a12==1))&&(a3==0)))&&!(a20==1))))){ if((a15==1)){ a11 = 0; a24 = 0; a0 = 0; a26 = 1; a6 = 0; a27 = 1; a5 = 1; a9 = 1; a3 = 2; }else{ a20 = 1; a5 = 1; a12 = 1; a16 = 0; a27 = 1; a26 = 0; } return -1; } else if((((a18==1)&&((((((a6==1)&&((input==2)&&(((!(a26==1)&&!(a27==1))&&(a12==1))||(!(a12==1)&&((a27==1)&&(a26==1))))))&&!(a23==1))&&(a11==1))&&(a0==1))&&!(a8==1)))&&((!(a7==1)&&((a3==2)&&(((a15==1)||(a14==1))&&(a5==1))))||!(a0==1)))){ a3 = 0; a23 = 0; a12 = 1; a27 = 1; a1 = 1; a26 = 1; return -1; } else if(((((((a3==2)&&((a5==1)&&(((a7==1)||(a22==1))&&!(a6==1))))&&!(a27==1))||!(a4==1))&&(a12==1))&&((a11==1)&&(((a18==1)&&((((((a26==1)||!(a26==1))&&(input==6))&&!(a19==1))&&!(a7==1))&&(a16==1)))&&(a0==1))))){ a27 = 1; a16 = 1; a3 = 0; a7 = 0; a6 = 1; a10 = 1; a26 = 1; return -1; } else if(((((((((a4==1)&&((a18==1)&&((a11==1)&&((((a26==1)&&!(a27==1))||(((a27==1)&&(a26==1))||((a27==1)&&!(a26==1))))&&(input==6)))))&&(a10==1))&&(a22==1))&&!(a25==1))&&(a3==2))&&(a6==1))&&((((a5==1)&&((a12==1)&&(a15==1)))&&(a1==1))&&!(a7==1)))){ a3 = 0; a10 = 1; a27 = 1; a26 = 1; a1 = 1; a8 = 0; return -1; } else if(((((((a16==1)||!(a16==1))||(a25==1))&&(a18==1))&&!(a2==1))&&((a22==1)&&((((input==5)&&(((a5==1)&&(((((!(a26==1)&&!(a6==1))&&!(a27==1))&&!(a12==1))&&(a3==2))&&!(a11==1)))||(!(a5==1)&&(((((a27==1)&&((a6==1)&&(a26==1)))&&(a12==1))&&(a3==0))&&(a11==1)))))&&(a16==1))&&!(a7==1))))){ a13 = 1; a25 = 1; a12 = 1; a26 = 0; a3 = 1; a27 = 0; a20 = 1; a11 = 1; a6 = 1; a5 = 1; return -1; } else if(((((a18==1)&&((a5==1)&&(!(a12==1)&&(!(a20==1)&&(((input==5)&&((!(a26==1)&&(a27==1))||(!(a27==1)&&(a26==1))))&&(a0==1))))))&&(a3==2))&&(!(a11==1)&&(((a22==1)&&((a14==1)||(!(a6==1)&&((a10==1)||(a14==1)))))||(a2==1))))){ a21 = 0; a27 = 1; a26 = 1; a24 = 1; a3 = 1; return -1; } else if(((((!(a27==1)&&((a3==2)&&(((!(a16==1)||(a29==1))&&(a22==1))||!(a22==1))))&&(a10==1))&&!(a8==1))&&(((!(a25==1)&&(!(a26==1)&&((((input==1)&&(a6==1))&&!(a11==1))&&(a5==1))))&&(a12==1))&&(a18==1)))){ a26 = 1; a2 = 0; a29 = 1; a6 = 0; a11 = 1; a23 = 0; a3 = 0; return -1; } else if((((((!(a14==1)&&(((a0==1)&&((a15==1)&&(!(a8==1)&&((input==5)&&((!(a26==1)&&(a27==1))||(!(a27==1)&&(a26==1)))))))&&!(a25==1)))&&(a5==1))&&!(a6==1))&&(a18==1))&&(!(a11==1)&&((a3==2)&&((a12==1)&&((a10==1)&&!(a23==1))))))){ a11 = 1; a26 = 1; a23 = 0; a27 = 1; a19 = 0; a12 = 0; return 23; } else if(((((((a6==1)&&((a12==1)&&((a2==1)&&(a22==1))))&&(a23==1))&&(a8==1))&&(a7==1))&&((!(a11==1)&&(((a3==2)&&((a19==1)&&(((input==3)&&((!(a26==1)&&(a27==1))||((a26==1)&&!(a27==1))))&&(a5==1))))&&(a18==1)))&&(a17==1)))){ a28 = 0; a27 = 0; a8 = 1; a12 = 0; a13 = 1; a11 = 1; a26 = 1; return 23; } else if(((((a3==2)&&(((a4==1)&&(!(a17==1)&&((!(a19==1)&&(((a26==1)&&((a27==1)&&((input==3)&&(a18==1))))&&(a0==1)))&&(a4==1))))&&!(a17==1)))&&(a5==1))&&(((!(a6==1)&&(a15==1))&&!(a12==1))&&(a11==1)))){ if((a20==1)){ a14 = 0; a26 = 0; a11 = 0; a6 = 1; a15 = 1; }else{ a10 = 1; a17 = 0; a14 = 0; } return 23; } else if((((a22==1)&&(((((a29==1)||!(a4==1))||(a17==1))&&(a18==1))&&(a11==1)))&&(!(a6==1)&&((a12==1)&&((((a3==2)&&((a4==1)&&((a5==1)&&((a27==1)&&(((a26==1)||!(a26==1))&&(input==2))))))&&!(a8==1))&&(a15==1)))))){ a25 = 0; a1 = 1; a3 = 0; a7 = 0; a26 = 1; a6 = 1; return -1; } else if((((a6==1)&&((a19==1)||(((a8==1)||(!(a12==1)&&(((a5==1)&&(a10==1))||!(a4==1))))&&(a11==1))))&&((a18==1)&&(!(a19==1)&&(((a1==1)&&(((input==1)&&(((!(a26==1)&&(a27==1))||((a26==1)&&!(a27==1)))||(!(a27==1)&&!(a26==1))))&&(a3==2)))&&!(a20==1)))))){ a0 = 1; a12 = 1; a26 = 1; a2 = 0; a27 = 1; a1 = 1; a3 = 0; return -1; } else if(((((a3==2)&&((a29==1)&&((a10==1)&&((a17==1)||((((a15==1)&&(a22==1))&&!(a12==1))&&(a29==1))))))&&(a6==1))&&((!(a11==1)&&((((((a26==1)&&!(a27==1))||(((a27==1)&&(a26==1))||((a27==1)&&!(a26==1))))&&(input==4))&&(a29==1))&&(a5==1)))&&(a18==1)))){ if((a23==1)){ a14 = 0; a29 = 1; a26 = 0; a27 = 1; a23 = 0; }else{ a27 = 1; a26 = 1; a25 = 0; a11 = 1; a4 = 1; a6 = 0; } return 23; } else if(((((a8==1)||((a14==1)||(((a22==1)&&(a11==1))&&!(a6==1))))&&!(a27==1))&&((a12==1)&&((a16==1)&&(!(a17==1)&&((a5==1)&&((a4==1)&&((a3==2)&&(((a0==1)&&(((a26==1)||!(a26==1))&&(input==2)))&&(a18==1)))))))))){ a26 = 1; a6 = 1; a27 = 1; a3 = 0; a29 = 1; a0 = 1; a15 = 1; return -1; } else if((((((((((a26==1)||!(a26==1))&&(input==4))&&(a5==1))&&(a27==1))&&!(a19==1))&&(a18==1))&&(a16==1))&&(((!(a16==1)||((((a11==1)&&(((a15==1)&&(a3==2))&&!(a6==1)))||!(a22==1))&&(a12==1)))&&!(a25==1))&&(a16==1)))){ a16 = 1; a6 = 1; a3 = 0; a10 = 1; a26 = 1; return -1; } else if(((((a5==1)&&((((a18==1)&&((a0==1)&&(((a16==1)&&((input==2)&&((((!(a26==1)&&(a6==1))&&!(a27==1))&&!(a12==1))||((a12==1)&&((a27==1)&&(!(a6==1)&&(a26==1)))))))&&!(a25==1))))&&!(a2==1))&&(a3==2)))&&(a22==1))&&(!(a11==1)&&((a29==1)||!(a1==1))))){ a12 = 1; a6 = 1; a26 = 1; a27 = 1; a2 = 0; a22 = 1; a3 = 0; a11 = 1; return -1; } else if((((a12==1)&&(!(a6==1)&&(((a11==1)&&((((a26==1)||!(a26==1))&&(input==5))&&(a3==2)))&&!(a14==1))))&&(!(a15==1)||(((a15==1)&&(!(a0==1)||((((a18==1)&&((a5==1)&&(a1==1)))||(a19==1))&&(a27==1))))||(a2==1))))){ a26 = 1; a16 = 1; a15 = 1; a6 = 1; a3 = 0; return -1; } else if((((((((a5==1)&&((a3==2)&&(a1==1)))&&(a18==1))&&(a22==1))&&!(a11==1))||!(a0==1))&&((((a12==1)&&(((a6==1)&&((((!(a26==1)&&(a27==1))||((a26==1)&&!(a27==1)))&&(input==4))&&!(a8==1)))&&(a4==1)))&&!(a23==1))&&(a29==1)))){ a12 = 0; a10 = 1; a27 = 1; a6 = 0; a23 = 0; a26 = 0; a8 = 0; a3 = 0; return -1; } else if(((!(a19==1)&&((a16==1)&&(!(a7==1)&&(!(a20==1)&&(((input==2)&&((!(a11==1)&&((a12==1)&&((a27==1)&&((a6==1)&&(a26==1)))))||(((a11==1)&&((!(a27==1)&&(!(a6==1)&&(a26==1)))&&!(a12==1)))||((a11==1)&&(!(a12==1)&&(!(a27==1)&&(!(a26==1)&&!(a6==1))))))))&&!(a17==1))))))&&((a18==1)&&((a17==1)||(((a15==1)&&(a3==2))&&(a5==1)))))){ a12 = 0; a11 = 1; a27 = 0; a6 = 0; a26 = 0; a25 = 0; a16 = 1; a20 = 0; return -1; } else if((((a12==1)&&((a3==2)&&((!(a1==1)||(!(a22==1)||((a11==1)&&((a4==1)&&((a6==1)&&((a4==1)||!(a15==1)))))))||(a2==1))))&&((a29==1)&&((a18==1)&&((a5==1)&&(((((a26==1)&&(a27==1))||((a27==1)&&!(a26==1)))||(!(a27==1)&&(a26==1)))&&(input==4))))))){ a23 = 0; a10 = 1; a3 = 0; a27 = 1; a4 = 1; a26 = 1; return -1; } else if(((!(a11==1)&&((a5==1)&&((((input==5)&&(((a27==1)&&!(a26==1))||(!(a27==1)&&(a26==1))))&&(a23==1))&&(a3==2))))&&((a23==1)&&(!(a4==1)&&((((a18==1)&&((((a12==1)&&(a29==1))&&!(a22==1))&&!(a0==1)))&&(a19==1))&&(a6==1)))))){ a27 = 1; a0 = 0; a12 = 0; a11 = 1; a29 = 0; a26 = 0; a28 = 1; return -1; } else if((((((a1==1)&&(((input==6)&&(((a12==1)&&(!(a26==1)&&!(a27==1)))||(((a27==1)&&(a26==1))&&!(a12==1))))&&(a1==1)))&&(a5==1))&&(a16==1))&&(((a3==2)&&(!(a11==1)&&((!(a1==1)||((!(a6==1)&&(a0==1))&&!(a20==1)))&&(a18==1))))&&!(a17==1)))){ a3 = 0; a12 = 1; a24 = 0; a28 = 1; a26 = 1; a4 = 0; a27 = 0; return -1; } else if((((a18==1)&&(((!(a20==1)&&(a0==1))||(a20==1))&&(a1==1)))&&((a3==2)&&((a1==1)&&((a5==1)&&((((((((a27==1)&&((a26==1)&&(a6==1)))&&(a12==1))&&!(a11==1))||((((!(a27==1)&&(!(a6==1)&&(a26==1)))&&!(a12==1))&&(a11==1))||((!(a12==1)&&(!(a27==1)&&(!(a6==1)&&!(a26==1))))&&(a11==1))))&&(input==1))&&!(a7==1))&&(a15==1))))))){ a6 = 0; a26 = 1; a1 = 1; a23 = 0; a27 = 1; a12 = 0; a11 = 1; a14 = 0; a3 = 1; return -1; } else if(((((((a18==1)&&((a25==1)||(!(a11==1)&&((a4==1)&&(a3==2)))))&&(a0==1))&&(a5==1))||(a7==1))&&((a10==1)&&((!(a14==1)&&((input==6)&&((((!(a26==1)&&(a6==1))&&!(a27==1))&&!(a12==1))||((a12==1)&&((a27==1)&&(!(a6==1)&&(a26==1)))))))&&(a4==1))))){ a11 = 1; a26 = 1; a12 = 1; a3 = 0; a7 = 0; a27 = 1; a4 = 1; a0 = 1; a6 = 1; return -1; } else if((((!(a11==1)&&(((((a12==1)&&((((a27==1)&&!(a26==1))||((a26==1)&&!(a27==1)))&&(input==3)))&&!(a8==1))&&!(a19==1))&&!(a14==1)))&&(a0==1))&&(((a3==2)&&((((a5==1)&&(!(a6==1)&&(a29==1)))||(a17==1))&&(a16==1)))&&(a18==1)))){ a7 = 0; a22 = 1; a16 = 1; a3 = 0; a26 = 0; a27 = 0; return -1; } else if((((!(a19==1)&&(((((a4==1)&&!(a26==1))||!(a4==1))&&!(a11==1))&&!(a6==1)))||(a23==1))&&(!(a27==1)&&((a5==1)&&((((a22==1)&&((((a3==1)&&(input==5))&&!(a12==1))&&!(a25==1)))&&(a1==1))&&(a18==1)))))){ a11 = 1; a12 = 1; a6 = 1; a1 = 1; a15 = 1; a10 = 1; a27 = 1; a3 = 0; a26 = 1; return -1; } else if((((a4==1)&&((((((((!(a12==1)&&(((a26==1)&&!(a6==1))&&!(a27==1)))&&(a11==1))||((!(a12==1)&&(!(a27==1)&&(!(a6==1)&&!(a26==1))))&&(a11==1)))||(!(a11==1)&&((((a6==1)&&(a26==1))&&(a27==1))&&(a12==1))))&&(input==4))&&(a5==1))&&(a18==1))&&!(a19==1)))&&(((a17==1)||((!(a25==1)&&((a3==2)&&(a29==1)))||(a23==1)))&&(a1==1)))){ a6 = 1; a12 = 1; a26 = 1; a11 = 0; a8 = 0; a27 = 1; a22 = 1; a15 = 1; return -1; } else if((((a3==2)&&(((a18==1)&&(((input==2)&&((!(a26==1)&&(a27==1))||((a26==1)&&!(a27==1))))&&(a10==1)))&&(a15==1)))&&((((a23==1)||((a20==1)||((!(a25==1)&&(((a5==1)&&(a4==1))&&!(a8==1)))&&(a12==1))))&&!(a11==1))&&!(a6==1)))){ a26 = 1; a10 = 1; a27 = 1; a3 = 0; a6 = 1; a11 = 1; a19 = 0; a23 = 0; return -1; } else if(((!(a23==1)&&((!(a2==1)&&((((a5==1)&&(a29==1))||!(a1==1))||!(a22==1)))||(a8==1)))&&((a0==1)&&((a18==1)&&(!(a12==1)&&(!(a26==1)&&((((a3==2)&&((a27==1)&&(input==6)))&&(a11==1))&&!(a6==1)))))))){ a0 = 1; a7 = 0; a22 = 1; return -1; } else if((((a1==1)&&(((((a15==1)&&((!(a11==1)&&(!(a23==1)&&(!(a14==1)&&((input==3)&&(((a27==1)&&!(a26==1))||((a26==1)&&!(a27==1)))))))&&(a10==1)))&&!(a6==1))&&(a5==1))&&(a1==1)))&&((a3==2)&&((!(a12==1)&&(a10==1))&&(a18==1))))){ a26 = 1; a0 = 0; a27 = 1; a9 = 1; a21 = 0; return -1; } else if(((!(a11==1)&&((a18==1)&&((!(a23==1)&&(((((a5==1)&&((input==1)&&(((a12==1)&&(!(a27==1)&&!(a26==1)))||(((a26==1)&&(a27==1))&&!(a12==1)))))&&!(a6==1))&&!(a14==1))&&(a16==1)))&&(a3==2))))&&(!(a10==1)||((a19==1)||(!(a7==1)&&(a0==1)))))){ a12 = 0; a26 = 1; a11 = 1; a3 = 0; a22 = 0; a24 = 1; a27 = 1; a7 = 1; return -1; } else if((((((!(a25==1)&&((((a22==1)||(a8==1))&&(a18==1))||!(a15==1)))&&!(a12==1))&&(a6==1))&&(a5==1))&&((a11==1)&&(((((a3==2)&&((input==4)&&((!(a27==1)&&!(a26==1))||((!(a26==1)&&(a27==1))||(!(a27==1)&&(a26==1))))))&&!(a14==1))&&(a16==1))&&!(a20==1))))){ a27 = 1; a12 = 1; a3 = 0; a10 = 1; a26 = 1; a25 = 0; a16 = 1; return -1; } else if(((!(a17==1)&&((((!(a11==1)&&(a1==1))&&(a18==1))&&(a6==1))&&(a3==2)))&&((a4==1)&&((a16==1)&&(!(a20==1)&&((a15==1)&&((((((((a27==1)&&(a26==1))||((a27==1)&&!(a26==1)))||((a26==1)&&!(a27==1)))&&(input==1))&&!(a14==1))&&(a5==1))&&!(a12==1)))))))){ if((a10==1)){ a26 = 0; a27 = 1; a1 = 1; a2 = 0; a14 = 0; }else{ a23 = 0; a0 = 1; a6 = 0; a25 = 0; a11 = 1; a26 = 1; a27 = 1; } return -1; } else if((((a1==1)&&(((a18==1)&&((!(a27==1)&&(a29==1))&&(a10==1)))||(a7==1)))&&(((!(a19==1)&&(((a5==1)&&((((a11==1)&&((input==3)&&((a26==1)||!(a26==1))))&&!(a6==1))&&(a12==1)))&&(a3==2)))&&(a16==1))&&(a0==1)))){ a26 = 1; a6 = 1; a11 = 0; a22 = 1; a15 = 1; a8 = 0; return 25; } else if((((((a16==1)&&((a18==1)&&((input==2)&&(((a5==1)&&(((!(a12==1)&&(!(a27==1)&&(!(a26==1)&&!(a6==1))))&&(a3==2))&&!(a11==1)))||(!(a5==1)&&((a11==1)&&(((a12==1)&&(((a6==1)&&(a26==1))&&(a27==1)))&&(a3==0))))))))&&(a10==1))&&(a29==1))&&((a0==1)&&(((a15==1)&&!(a14==1))&&!(a2==1))))){ if((a11==1)){ a26 = 1; a12 = 0; a27 = 0; a14 = 1; a5 = 1; a11 = 1; a3 = 0; a24 = 0; a6 = 0; }else{ a3 = 2; a11 = 1; a6 = 1; a12 = 0; a5 = 1; a27 = 1; a13 = 0; a26 = 1; a25 = 1; a21 = 1; } return 23; } else if(((((a3==2)&&((a18==1)&&(a1==1)))&&!(a19==1))&&(((((a15==1)&&((((input==3)&&((((a12==1)&&((a27==1)&&((a6==1)&&(a26==1))))&&!(a11==1))||(((!(a12==1)&&(!(a27==1)&&((a26==1)&&!(a6==1))))&&(a11==1))||((a11==1)&&((!(a27==1)&&(!(a26==1)&&!(a6==1)))&&!(a12==1))))))&&(a5==1))&&!(a17==1)))&&(a10==1))&&(a16==1))&&(a0==1)))){ a26 = 0; a27 = 1; a20 = 0; a29 = 1; a10 = 1; a11 = 1; a6 = 0; a12 = 0; return -1; } else if((((!(a11==1)&&((a1==1)&&(a29==1)))&&(a12==1))&&((!(a2==1)&&(!(a6==1)&&((!(a17==1)&&(((a3==2)&&((a18==1)&&(((input==6)&&(((a27==1)&&!(a26==1))||((a26==1)&&!(a27==1))))&&(a0==1))))&&(a15==1)))&&(a22==1))))&&(a5==1)))){ a10 = 1; a19 = 0; a27 = 1; a2 = 0; a6 = 1; a26 = 1; a3 = 0; a11 = 1; return -1; } else if(((((((a2==1)||((a5==1)&&((a3==2)&&(a10==1))))&&(a18==1))||!(a1==1))&&!(a12==1))&&(!(a7==1)&&(!(a14==1)&&(!(a11==1)&&((((((!(a26==1)&&(a27==1))||(!(a27==1)&&(a26==1)))&&(input==4))&&(a4==1))&&!(a6==1))&&(a10==1))))))){ a21 = 0; a26 = 1; a13 = 0; a4 = 0; a6 = 1; a27 = 0; return -1; } else if((((!(a10==1)||(!(a12==1)&&(!(a27==1)&&(!(a7==1)&&(a22==1)))))&&!(a6==1))&&((a3==1)&&(!(a11==1)&&((!(a20==1)&&((a0==1)&&((!(a2==1)&&((a18==1)&&((a5==1)&&(input==5))))&&!(a19==1))))&&(a26==1)))))){ a16 = 1; a22 = 1; a11 = 1; a3 = 2; a27 = 1; a6 = 1; return 21; } else if(((((((!(a7==1)&&(a16==1))||!(a10==1))||!(a15==1))&&!(a6==1))||!(a22==1))&&(((!(a12==1)&&((a3==2)&&((a18==1)&&((!(a11==1)&&((((a27==1)&&!(a26==1))||(!(a27==1)&&(a26==1)))&&(input==6)))&&(a5==1)))))&&(a29==1))&&(a0==1)))){ a27 = 1; a15 = 0; a14 = 1; a3 = 1; a26 = 0; a6 = 1; return -1; } else if(((!(a12==1)&&(!(a11==1)&&((a6==1)&&((!(a17==1)&&((a5==1)&&(!(a2==1)&&(((input==6)&&((((a27==1)&&(a26==1))||((a27==1)&&!(a26==1)))||((a26==1)&&!(a27==1))))&&!(a7==1)))))&&(a29==1)))))&&((((!(a16==1)||(a1==1))&&(a3==2))||(a2==1))&&(a18==1)))){ a26 = 1; a10 = 1; a29 = 1; a27 = 0; a1 = 1; return 23; } else if(((((((a1==1)&&((input==3)&&(((a12==1)&&(!(a26==1)&&!(a27==1)))||(((a26==1)&&(a27==1))&&!(a12==1)))))&&!(a7==1))&&(a18==1))&&(a4==1))&&((a6==1)&&((a5==1)&&((a20==1)||(!(a1==1)||(((a3==2)&&((a10==1)||!(a10==1)))&&(a11==1)))))))){ a26 = 0; a3 = 0; a6 = 0; a12 = 1; a27 = 0; a2 = 0; a14 = 0; a11 = 0; a8 = 0; return -1; } else if(((((a18==1)&&((a1==1)&&((((a0==1)&&(!(a6==1)&&((((a12==1)&&(!(a26==1)&&!(a27==1)))||(((a27==1)&&(a26==1))&&!(a12==1)))&&(input==3))))&&!(a11==1))&&(a0==1))))&&(a16==1))&&(((a3==2)&&(((a5==1)&&(a0==1))&&(a1==1)))&&(a16==1)))){ a12 = 0; a26 = 1; a4 = 0; a13 = 0; a25 = 1; a27 = 1; a11 = 1; return 23; } else if(((!(a16==1)||(!(a8==1)&&(!(a0==1)||(((a16==1)&&(a6==1))&&(a11==1)))))&&((a16==1)&&((((a18==1)&&((a3==2)&&((a4==1)&&((((a12==1)&&(!(a26==1)&&!(a27==1)))||(!(a12==1)&&((a27==1)&&(a26==1))))&&(input==6)))))&&(a22==1))&&(a5==1))))){ a16 = 1; a3 = 0; a26 = 1; a22 = 1; a7 = 0; a27 = 1; a12 = 1; return -1; } else if(((((a6==1)&&(!(a7==1)&&(((a11==1)&&(((((input==5)&&((!(a26==1)&&!(a27==1))||((!(a26==1)&&(a27==1))||((a26==1)&&!(a27==1)))))&&(a18==1))&&!(a2==1))&&!(a19==1)))&&(a10==1))))&&!(a12==1))&&(((a3==0)&&(!(a0==1)||((a22==1)&&!(a8==1))))&&!(a5==1)))){ a9 = 0; a3 = 1; a1 = 0; a5 = 1; a12 = 1; a11 = 0; a26 = 1; a27 = 0; a29 = 0; a6 = 0; return 23; } else if((((!(a20==1)&&(((((a5==1)&&((((!(a26==1)&&!(a27==1))&&(a12==1))||(!(a12==1)&&((a26==1)&&(a27==1))))&&(input==5)))&&!(a17==1))&&(a22==1))&&(a3==2)))&&!(a11==1))&&(((a25==1)||((a18==1)&&(((a0==1)&&!(a14==1))&&!(a6==1))))&&(a22==1)))){ a4 = 0; a12 = 0; a6 = 1; a26 = 0; a9 = 0; a0 = 0; a27 = 1; a3 = 0; a11 = 1; return -1; } else if(((!(a2==1)&&((((((((((a26==1)||!(a26==1))&&(input==1))&&!(a14==1))&&(a11==1))&&!(a17==1))&&(a18==1))&&(a4==1))&&!(a6==1))&&!(a8==1)))&&((((a27==1)&&((a5==1)&&((a22==1)||(a23==1))))&&(a12==1))&&(a3==2)))){ a16 = 1; a26 = 1; a3 = 0; a4 = 1; a6 = 1; a2 = 0; return -1; } else if(((((!(a7==1)&&(!(a20==1)&&(((a6==1)&&(((a3==2)&&((input==3)&&((((a27==1)&&!(a26==1))||((a26==1)&&!(a27==1)))||(!(a27==1)&&!(a26==1)))))&&!(a12==1)))&&(a4==1))))&&(a11==1))&&(a18==1))&&((!(a10==1)||(((a15==1)||(a25==1))&&(a5==1)))&&!(a2==1)))){ a10 = 1; a12 = 1; a27 = 1; a29 = 1; a14 = 0; a3 = 0; a26 = 1; return -1; } else if(((((a11==1)&&((((a16==1)&&((a6==1)&&((input==4)&&(((!(a27==1)&&!(a26==1))&&(a12==1))||(!(a12==1)&&((a27==1)&&(a26==1)))))))&&(a18==1))&&(a3==0)))&&(a10==1))&&((((!(a5==1)&&((a15==1)||(a25==1)))||(a7==1))&&!(a2==1))&&!(a25==1)))){ a26 = 1; a29 = 0; a0 = 0; a27 = 0; a12 = 1; a6 = 0; a5 = 1; a8 = 1; return -1; } else if((((a11==1)&&(!(a6==1)&&(((a27==1)&&((a0==1)&&((!(a23==1)&&(!(a12==1)&&(input==5)))&&!(a26==1))))&&(a5==1))))&&((a3==2)&&((a23==1)||(((((a4==1)&&(a18==1))&&(a15==1))||!(a0==1))||!(a29==1)))))){ a14 = 0; a29 = 1; a10 = 1; return -1; } else if((((a3==0)&&((!(a5==1)&&(!(a14==1)&&(((((a0==1)||(a23==1))&&!(a25==1))||!(a1==1))||!(a29==1))))&&(a6==1)))&&((a11==1)&&((((((((a27==1)&&!(a26==1))||(!(a27==1)&&(a26==1)))||(!(a26==1)&&!(a27==1)))&&(input==2))&&(a18==1))&&!(a20==1))&&!(a12==1))))){ if((a5==1)){ a3 = 1; a26 = 1; a22 = 0; a15 = 0; a5 = 1; a21 = 1; a27 = 0; }else{ a3 = 1; a6 = 0; a5 = 1; a13 = 0; a26 = 1; a2 = 1; a22 = 0; a27 = 0; a11 = 0; } return -1; } else if(((!(a27==1)&&(!(a23==1)&&(!(a11==1)&&(((a12==1)&&(!(a26==1)&&((a3==2)&&(input==4))))&&(a4==1)))))&&(((a15==1)&&((a23==1)||((a6==1)&&(!(a8==1)&&((a23==1)||((a18==1)&&(a22==1)))))))&&(a5==1)))){ a11 = 1; a4 = 1; a26 = 1; a23 = 0; a12 = 0; a19 = 0; a27 = 1; a3 = 1; return -1; } else if(((((!(a16==1)&&((((a3==2)&&(!(a22==1)&&(!(a10==1)&&(((!(a26==1)&&(a27==1))||((a26==1)&&!(a27==1)))&&(input==1)))))&&(a12==1))&&(a25==1)))&&(a20==1))&&!(a11==1))&&((((a5==1)&&((a18==1)&&(a1==1)))&&!(a15==1))&&(a6==1)))){ a12 = 0; a14 = 1; a28 = 1; a9 = 1; a27 = 0; a26 = 0; return 24; } else if(((((a18==1)&&(((!(a22==1)||((a15==1)&&(a4==1)))||(a25==1))&&(a5==1)))&&!(a11==1))&&(((a3==2)&&((!(a7==1)&&((input==3)&&((!(a12==1)&&(((a6==1)&&!(a26==1))&&!(a27==1)))||((((a26==1)&&!(a6==1))&&(a27==1))&&(a12==1)))))&&(a22==1)))&&(a0==1)))){ a26 = 0; a1 = 1; a11 = 1; a27 = 0; a6 = 0; a22 = 1; a12 = 0; a14 = 0; return 21; } else if((((a16==1)&&(!(a5==1)&&((a3==0)&&(((input==2)&&(((!(a26==1)&&!(a27==1))&&(a12==1))||(((a27==1)&&(a26==1))&&!(a12==1))))&&(a6==1)))))&&(!(a29==1)||((a17==1)||(((((a17==1)||((a15==1)&&(a11==1)))||!(a10==1))&&(a18==1))||(a7==1)))))){ if((a0==1)){ a6 = 0; a13 = 0; a5 = 1; a7 = 1; a12 = 0; a2 = 1; a26 = 0; a27 = 1; }else{ a5 = 1; a12 = 1; a9 = 0; a27 = 0; a16 = 0; a2 = 1; a26 = 1; } return -1; } else if((((!(a14==1)&&((a0==1)&&(a18==1)))&&(a16==1))&&((!(a19==1)&&((!(a23==1)&&((a5==1)&&((a3==2)&&((input==6)&&((((a11==1)&&((((a26==1)&&!(a6==1))&&!(a27==1))&&!(a12==1)))||((a11==1)&&((!(a27==1)&&(!(a6==1)&&!(a26==1)))&&!(a12==1))))||(((a12==1)&&(((a6==1)&&(a26==1))&&(a27==1)))&&!(a11==1)))))))&&!(a19==1)))&&(a16==1)))){ a11 = 1; a6 = 0; a12 = 0; a26 = 0; a1 = 1; a19 = 0; a20 = 0; a27 = 0; return -1; } else if(((!(a10==1)||((!(a1==1)||((((a23==1)||(((a11==1)&&((a29==1)&&!(a12==1)))&&!(a8==1)))&&(a6==1))&&(a3==0)))&&(a18==1)))&&(((((input==6)&&((!(a26==1)&&!(a27==1))||(((a27==1)&&!(a26==1))||((a26==1)&&!(a27==1)))))&&!(a7==1))&&!(a5==1))&&!(a2==1)))){ a5 = 1; a25 = 1; a12 = 1; a9 = 0; a27 = 1; a26 = 0; return -1; } else if((((!(a14==1)&&(((a18==1)&&((input==4)&&(((!(a11==1)&&(((!(a27==1)&&(!(a26==1)&&!(a6==1)))&&!(a12==1))&&(a3==2)))&&(a5==1))||(!(a5==1)&&(((a3==0)&&((a12==1)&&(((a26==1)&&(a6==1))&&(a27==1))))&&(a11==1))))))&&!(a25==1)))&&!(a2==1))&&((a10==1)&&(!(a7==1)&&((a10==1)&&!(a19==1)))))){ a5 = 1; a19 = 1; a27 = 1; a12 = 0; a26 = 0; a21 = 0; a3 = 2; a6 = 1; a11 = 0; return -1; } else if((((a5==1)&&(((!(a12==1)&&((((a16==1)||(a14==1))||(a19==1))&&!(a17==1)))&&!(a25==1))&&!(a11==1)))&&((((a18==1)&&((a3==2)&&((((((a26==1)&&(a27==1))||(!(a26==1)&&(a27==1)))||((a26==1)&&!(a27==1)))&&(input==3))&&!(a2==1))))&&(a6==1))&&(a29==1)))){ a27 = 1; a26 = 1; a11 = 1; a6 = 0; a22 = 1; a23 = 0; a20 = 0; return 23; } else if((((!(a12==1)&&((((a19==1)||((a22==1)&&!(a6==1)))&&(a5==1))||!(a16==1)))&&!(a26==1))&&((a4==1)&&((((a16==1)&&(((((input==3)&&!(a11==1))&&!(a25==1))&&(a27==1))&&(a18==1)))&&(a10==1))&&(a3==1))))){ a6 = 1; a11 = 1; a3 = 2; a7 = 0; a12 = 1; a17 = 0; return 22; } else if(((!(a17==1)&&((a1==1)&&(((a15==1)&&((!(a11==1)&&((((a27==1)&&!(a26==1))||((a26==1)&&!(a27==1)))&&(input==1)))&&(a15==1)))&&(a12==1))))&&(((a18==1)&&((a16==1)&&(((a3==2)&&((a22==1)&&(a5==1)))&&(a6==1))))&&!(a8==1)))){ a11 = 1; a0 = 1; a27 = 0; a12 = 0; a6 = 0; a23 = 0; a16 = 1; a3 = 0; a26 = 1; return -1; } else if(((((a3==2)&&(((((a29==1)||(a14==1))&&!(a6==1))||(a23==1))||!(a4==1)))&&(a5==1))&&(!(a27==1)&&(((a12==1)&&(((!(a2==1)&&((a22==1)&&((input==1)&&((a26==1)||!(a26==1)))))&&(a18==1))&&(a11==1)))&&!(a14==1))))){ a27 = 1; a14 = 0; a15 = 1; a3 = 0; a6 = 1; a10 = 1; a26 = 1; return -1; } else if((((!(a2==1)&&(((((input==3)&&(((a26==1)&&!(a27==1))||(((a26==1)&&(a27==1))||((a27==1)&&!(a26==1)))))&&(a6==1))&&(a18==1))&&(a3==2)))&&!(a23==1))&&((((a5==1)&&(((((a17==1)||(a22==1))&&!(a25==1))||(a20==1))&&(a4==1)))&&(a12==1))&&(a11==1)))){ a3 = 0; a22 = 1; a26 = 1; a14 = 0; a29 = 1; a27 = 1; return -1; } else if(((!(a6==1)&&(((!(a25==1)&&((a3==1)&&((a16==1)&&(a26==1))))&&!(a19==1))&&!(a20==1)))&&((((((a1==1)&&((a18==1)&&((!(a12==1)&&(input==3))&&(a5==1))))&&!(a27==1))&&!(a8==1))&&!(a7==1))&&!(a11==1)))){ a6 = 1; a3 = 0; a11 = 1; a20 = 0; a14 = 0; a27 = 1; a12 = 1; a7 = 0; return -1; } else if((((a15==1)&&(!(a25==1)&&(((a3==2)&&((((((a5==1)&&(((!(a26==1)&&(a27==1))||((a26==1)&&!(a27==1)))&&(input==1)))&&!(a2==1))&&!(a11==1))&&(a12==1))&&(a18==1)))&&!(a17==1))))&&((!(a16==1)||((a1==1)&&!(a6==1)))&&(a4==1)))){ a4 = 1; a11 = 1; a25 = 0; a26 = 1; a27 = 1; a3 = 0; a23 = 0; a6 = 1; return -1; } else if((((((a18==1)&&(((a27==1)&&(!(a11==1)&&(input==4)))&&!(a2==1)))&&!(a6==1))&&!(a12==1))&&((!(a26==1)&&(((a25==1)||(((!(a8==1)&&((a19==1)||(a16==1)))&&!(a17==1))&&!(a8==1)))&&(a3==1)))&&(a5==1)))){ a27 = 0; a17 = 0; a22 = 1; a26 = 1; a0 = 1; return 25; } else if(((((!(a19==1)&&((a11==1)&&(((((!(a5==1)&&((input==1)&&((!(a26==1)&&!(a27==1))||((!(a26==1)&&(a27==1))||((a26==1)&&!(a27==1))))))&&!(a12==1))&&(a22==1))&&(a6==1))&&(a18==1))))&&(a10==1))&&(a3==0))&&(((!(a16==1)||(a22==1))||!(a10==1))||!(a29==1)))){ if((a2==1)){ a12 = 1; a15 = 0; a2 = 1; a27 = 1; a6 = 0; a26 = 1; a24 = 0; a3 = 2; a5 = 1; }else{ a6 = 0; a21 = 0; a29 = 0; a26 = 1; a8 = 1; a11 = 0; a27 = 1; a5 = 1; a12 = 1; } return -1; } else if(((((a4==1)&&((a22==1)&&((a11==1)&&((a0==1)&&((((input==6)&&(a18==1))&&(a29==1))&&!(a6==1))))))&&(a3==2))&&((a27==1)&&(((a5==1)&&(!(a12==1)&&((a26==1)&&((a22==1)&&(a1==1)))))||!(a22==1))))){ a20 = 0; a14 = 0; a25 = 0; return 23; } else if(((((((a1==1)&&(!(a27==1)&&((a18==1)&&(a16==1))))||(a8==1))||(a20==1))&&(a3==2))&&(((!(a19==1)&&((!(a11==1)&&((((input==6)&&(a5==1))&&(a16==1))&&(a12==1)))&&!(a26==1)))&&!(a19==1))&&(a6==1)))){ a27 = 1; a12 = 0; a0 = 1; a23 = 0; a29 = 1; a3 = 1; return -1; } else if(((((((a29==1)&&(a15==1))||(a14==1))&&(a4==1))&&!(a5==1))&&(((((a18==1)&&((a12==1)&&(!(a2==1)&&(!(a23==1)&&(((((a27==1)&&!(a26==1))||(!(a27==1)&&(a26==1)))&&(input==4))&&!(a17==1))))))&&(a3==0))&&(a6==1))&&(a11==1)))){ a27 = 1; a3 = 1; a7 = 1; a22 = 0; a11 = 0; a6 = 0; a26 = 1; a12 = 0; a5 = 1; a19 = 1; return -1; } else if((((a17==1)&&((a20==1)&&((!(a11==1)&&((a6==1)&&((a18==1)&&(((input==2)&&((!(a26==1)&&(a27==1))||(!(a27==1)&&(a26==1))))&&!(a0==1)))))&&(a12==1))))&&((!(a16==1)&&(((a5==1)&&((a15==1)&&(a3==2)))&&!(a22==1)))&&(a23==1)))){ a3 = 0; a6 = 0; a4 = 0; a26 = 0; a27 = 0; a8 = 1; a22 = 0; return -1; } else if(((((a18==1)&&((!(a8==1)&&(((a6==1)&&(input==5))&&!(a23==1)))&&(a12==1)))&&(a5==1))&&((a16==1)&&(!(a27==1)&&(!(a2==1)&&((a20==1)||(!(a26==1)&&(!(a11==1)&&(!(a15==1)||((a10==1)&&(a3==2))))))))))){ a6 = 0; a22 = 1; a11 = 1; a27 = 1; a12 = 0; a19 = 0; a16 = 1; return 21; } else if((((a4==1)&&((a12==1)&&((a6==1)&&(((a18==1)&&((a10==1)&&(((a16==1)&&(a0==1))&&(a5==1))))&&!(a11==1)))))&&((!(a17==1)&&((((input==3)&&((!(a26==1)&&(a27==1))||((a26==1)&&!(a27==1))))&&!(a20==1))&&(a3==2)))&&(a16==1)))){ a27 = 1; a26 = 1; a8 = 0; a11 = 1; a3 = 1; a15 = 1; return -1; } else if((((!(a7==1)&&(((a6==1)&&((a5==1)&&(((input==2)&&((!(a26==1)&&(a27==1))||((a26==1)&&!(a27==1))))&&(a18==1))))&&(a12==1)))&&!(a8==1))&&((((a4==1)&&((a0==1)&&((a3==2)&&((a10==1)&&!(a11==1)))))&&(a0==1))||(a8==1)))){ a10 = 1; a27 = 0; a2 = 0; a23 = 0; a26 = 0; a3 = 1; return -1; } else if((((a3==2)&&(!(a11==1)&&(!(a17==1)&&((a19==1)||((a4==1)&&((a1==1)&&!(a12==1)))))))&&((((!(a7==1)&&((a5==1)&&((a18==1)&&((((a27==1)&&!(a26==1))||((a26==1)&&!(a27==1)))&&(input==1)))))&&!(a23==1))&&!(a6==1))&&!(a2==1)))){ a12 = 1; a27 = 0; a28 = 1; a26 = 1; a21 = 1; return -1; } else if(((!(a29==1)||((a4==1)&&(((a5==1)&&((a17==1)||(a22==1)))&&(a1==1))))&&(!(a12==1)&&(((a26==1)&&((a27==1)&&((a3==2)&&((a11==1)&&(!(a8==1)&&(!(a25==1)&&((input==5)&&(a18==1))))))))&&!(a6==1))))){ a4 = 1; a22 = 1; a7 = 0; return -1; } else if((((((a4==1)&&((!(a20==1)&&(!(a19==1)&&(((((((a6==1)&&(a26==1))&&(a27==1))&&(a12==1))&&!(a11==1))||(((a11==1)&&(!(a12==1)&&(!(a27==1)&&((a26==1)&&!(a6==1)))))||(((!(a27==1)&&(!(a26==1)&&!(a6==1)))&&!(a12==1))&&(a11==1))))&&(input==5))))&&(a5==1)))&&!(a7==1))&&(a3==2))&&((a18==1)&&((a15==1)&&((a1==1)&&(a4==1)))))){ a0 = 1; a6 = 0; a26 = 0; a12 = 0; a25 = 0; a27 = 1; a11 = 1; a20 = 0; return -1; } else if(((((((((a27==1)&&(a22==1))&&!(a17==1))&&!(a20==1))&&(a3==1))&&!(a11==1))&&!(a23==1))&&((((a5==1)&&((a29==1)&&((a18==1)&&((((input==1)&&!(a26==1))&&!(a12==1))&&!(a6==1)))))&&(a10==1))&&(a4==1)))){ a7 = 0; a26 = 1; a6 = 1; a11 = 1; a4 = 1; a12 = 1; a3 = 0; a8 = 0; return -1; } else if((((((!(a11==1)&&((a5==1)&&(input==2)))&&(a15==1))&&(a1==1))&&(a3==1))&&(!(a12==1)&&(!(a6==1)&&((a0==1)&&((!(a19==1)&&(!(a16==1)||(((a26==1)&&((a15==1)&&(a18==1)))&&!(a27==1))))&&!(a17==1))))))){ a6 = 1; a25 = 0; a17 = 0; a23 = 0; a3 = 0; a27 = 1; a11 = 1; a12 = 1; return -1; } else if((((((a22==1)&&((!(a27==1)&&(!(a6==1)&&(((a22==1)&&(a3==1))&&!(a12==1))))&&(a0==1)))&&!(a20==1))||!(a16==1))&&(!(a26==1)&&((a29==1)&&(!(a14==1)&&(!(a11==1)&&((a5==1)&&((input==4)&&(a18==1))))))))){ a11 = 1; a10 = 1; a12 = 1; a26 = 1; a15 = 1; a6 = 1; a3 = 0; a27 = 1; a29 = 1; return -1; } else if(((((a5==1)&&((!(a11==1)&&(!(a23==1)&&((a29==1)&&(((((a27==1)&&!(a26==1))||((a26==1)&&!(a27==1)))&&(input==2))&&!(a19==1)))))&&!(a23==1)))&&!(a6==1))&&(!(a20==1)&&(!(a12==1)&&(((a29==1)&&((a22==1)&&(a3==2)))&&(a18==1)))))){ a6 = 1; a11 = 1; a29 = 0; a26 = 1; a27 = 0; a13 = 1; a2 = 1; return -1; } else if(((((a29==1)&&((((a22==1)&&(((((((a27==1)&&(a26==1))||((a27==1)&&!(a26==1)))||(!(a27==1)&&(a26==1)))&&(input==5))&&(a6==1))&&(a5==1)))&&(a3==2))&&!(a20==1)))&&!(a2==1))&&((a11==1)&&((((!(a16==1)||(a1==1))&&!(a25==1))&&(a18==1))&&(a12==1))))){ a15 = 1; a27 = 1; a3 = 0; a16 = 1; a22 = 1; a26 = 1; return -1; } else if(((!(a15==1)||(((!(a23==1)&&(((((a0==1)&&!(a11==1))||(a20==1))&&(a5==1))&&(a6==1)))&&(a1==1))||(a8==1)))&&((((a0==1)&&(((a3==2)&&((input==3)&&(a12==1)))&&!(a27==1)))&&(a18==1))&&!(a26==1)))){ a26 = 1; a11 = 1; a23 = 0; a10 = 1; a6 = 0; a12 = 0; a3 = 1; a4 = 1; return -1; } else if(((!(a6==1)&&((!(a8==1)&&((a16==1)&&((a22==1)&&((a26==1)&&(!(a11==1)&&(input==6))))))&&(a18==1)))&&(!(a27==1)&&((((!(a1==1)||(((a22==1)&&!(a12==1))&&(a0==1)))&&(a3==1))&&(a10==1))&&(a5==1))))){ a27 = 1; a3 = 0; a6 = 1; a12 = 1; a29 = 1; a19 = 0; a4 = 1; a11 = 1; return -1; } else if(((!(a26==1)&&(((a3==1)&&((a1==1)&&((!(a6==1)&&((a5==1)&&(input==6)))&&(a18==1))))&&!(a11==1)))&&(!(a12==1)&&((((a0==1)&&((((a0==1)&&(a10==1))||!(a10==1))&&(a22==1)))&&(a29==1))&&!(a27==1))))){ if((a7==1)){ a23 = 0; a3 = 2; a6 = 1; a1 = 1; }else{ a19 = 0; a26 = 1; a0 = 1; a12 = 1; a3 = 2; a11 = 1; a27 = 1; } return 25; } else if(((!(a29==1)||((!(a11==1)&&((a22==1)&&(a16==1)))&&(a5==1)))&&((a10==1)&&((((!(a7==1)&&((a29==1)&&(((!(a12==1)&&(!(a27==1)&&(!(a26==1)&&(a6==1))))||((a12==1)&&((!(a6==1)&&(a26==1))&&(a27==1))))&&(input==4))))&&(a18==1))&&(a3==2))&&(a29==1))))){ a22 = 1; a6 = 1; a4 = 1; a3 = 0; a0 = 1; a11 = 1; a12 = 1; a26 = 1; a27 = 1; return -1; } else if(((!(a25==1)&&((a15==1)&&((((a5==1)&&(((a3==2)&&(((!(a26==1)&&!(a6==1))&&!(a27==1))&&!(a12==1)))&&!(a11==1)))||(((a11==1)&&(((((a6==1)&&(a26==1))&&(a27==1))&&(a12==1))&&(a3==0)))&&!(a5==1)))&&(input==6))))&&((a14==1)||(!(a2==1)&&((((a4==1)&&(a0==1))&&(a18==1))&&!(a19==1)))))){ a10 = 0; a8 = 1; a5 = 1; a12 = 1; a3 = 0; a9 = 0; a11 = 0; a26 = 1; a27 = 1; a6 = 0; return -1; } else if((((a10==1)||!(a16==1))&&((a0==1)&&(!(a25==1)&&(!(a17==1)&&((a18==1)&&((!(a19==1)&&((input==1)&&(((a5==1)&&(!(a11==1)&&(((!(a27==1)&&(!(a6==1)&&!(a26==1)))&&!(a12==1))&&(a3==2))))||(((a11==1)&&((a3==0)&&((a12==1)&&((a27==1)&&((a6==1)&&(a26==1))))))&&!(a5==1)))))&&!(a25==1)))))))){ if((a13==1)){ a4 = 0; a5 = 1; a26 = 1; a11 = 1; a12 = 0; a28 = 0; a2 = 1; a3 = 0; a27 = 0; a6 = 1; }else{ a8 = 1; a3 = 2; a27 = 1; a29 = 0; a5 = 1; a6 = 0; a11 = 0; a12 = 1; a26 = 0; a24 = 1; } return -1; } else if(((!(a22==1)||((a19==1)||(!(a10==1)||((a12==1)&&(!(a27==1)&&(((a0==1)&&(a18==1))&&(a11==1)))))))&&(!(a20==1)&&((a10==1)&&(((a5==1)&&(!(a6==1)&&((a0==1)&&((input==5)&&((a26==1)||!(a26==1))))))&&(a3==2)))))){ a6 = 1; a23 = 0; a7 = 0; a15 = 1; a3 = 0; a26 = 1; a27 = 1; return -1; } else if((((a12==1)&&(((a2==1)||(a10==1))&&!(a25==1)))&&(((a3==0)&&(((a18==1)&&(!(a23==1)&&((((a15==1)&&((a29==1)&&(((!(a26==1)&&(a27==1))||(!(a27==1)&&(a26==1)))&&(input==1))))&&!(a5==1))&&(a11==1))))&&(a1==1)))&&(a6==1)))){ if((a29==1)){ a5 = 1; a21 = 0; a12 = 0; a11 = 0; a26 = 0; a22 = 0; a3 = 1; a13 = 0; a27 = 0; }else{ a5 = 1; a9 = 0; a11 = 0; a16 = 0; a26 = 0; a20 = 1; a6 = 0; a27 = 1; } return 25; } else if((((a3==2)&&((((a29==1)&&(((input==6)&&((a26==1)||!(a26==1)))&&(a4==1)))&&(a29==1))&&!(a20==1)))&&(!(a4==1)||(((a11==1)&&((a5==1)&&(((a18==1)&&((a12==1)&&((a27==1)&&(a29==1))))&&(a10==1))))&&!(a6==1))))){ a8 = 0; a4 = 1; a6 = 1; a3 = 0; a26 = 1; a15 = 1; return -1; } else if(((!(a16==1)||(!(a26==1)&&(((a15==1)&&(a3==2))&&!(a17==1))))&&((a29==1)&&((a5==1)&&(((!(a23==1)&&((!(a23==1)&&((a27==1)&&(!(a12==1)&&(!(a6==1)&&(input==4)))))&&(a18==1)))&&(a11==1))&&(a16==1)))))){ a6 = 1; a27 = 0; a16 = 1; a23 = 0; a26 = 1; a20 = 0; return -1; } else if((((a15==1)&&(((a11==1)&&(((a5==1)&&((!(a10==1)||(a1==1))&&(a3==2)))||(a7==1)))||!(a22==1)))&&((((a18==1)&&((!(a6==1)&&((!(a12==1)&&(input==3))&&(a1==1)))&&(a29==1)))&&(a27==1))&&!(a26==1)))){ a2 = 0; a0 = 1; a10 = 1; return -1; } else if(((!(a14==1)&&(((a5==1)&&(!(a6==1)&&((input==4)&&(((!(a26==1)&&!(a27==1))&&(a12==1))||(!(a12==1)&&((a27==1)&&(a26==1)))))))&&!(a23==1)))&&((a2==1)||((!(a1==1)||(((((a18==1)&&(a1==1))&&!(a11==1))&&(a29==1))&&(a3==2)))&&!(a8==1))))){ a27 = 1; a16 = 0; a26 = 1; a12 = 0; a8 = 1; a6 = 1; a3 = 1; a23 = 1; return -1; } else if((((a18==1)&&((a7==1)||(!(a2==1)&&(((((a16==1)&&(a11==1))&&(a6==1))&&!(a23==1))||(a23==1)))))&&((a5==1)&&((a3==2)&&((!(a14==1)&&((a12==1)&&((input==2)&&((((a26==1)&&(a27==1))||((a27==1)&&!(a26==1)))||((a26==1)&&!(a27==1))))))&&(a22==1)))))){ a17 = 0; a19 = 0; a6 = 0; a26 = 1; a27 = 0; a1 = 1; return 25; } else if((((a4==1)&&(((a6==1)&&((a10==1)&&!(a11==1)))&&(a12==1)))&&(!(a7==1)&&(((a5==1)&&(((((((((a27==1)&&!(a26==1))||((a26==1)&&!(a27==1)))&&(input==6))&&(a3==2))&&(a16==1))&&!(a23==1))&&(a18==1))&&(a0==1)))&&!(a19==1))))){ a19 = 0; a27 = 0; a26 = 0; a8 = 0; return 26; } else if(((((!(a16==1)||((((a5==1)&&(((a22==1)&&!(a23==1))||!(a22==1)))&&(a6==1))&&(a16==1)))&&(a18==1))||(a2==1))&&((((a3==2)&&((input==4)&&(((!(a27==1)&&!(a26==1))&&(a12==1))||(!(a12==1)&&((a27==1)&&(a26==1))))))&&(a16==1))&&(a11==1)))){ a3 = 0; a27 = 1; a16 = 1; a12 = 1; a19 = 0; a26 = 1; a22 = 1; return -1; } else if((((a18==1)&&((a4==1)&&((a14==1)||((!(a5==1)&&(a16==1))||!(a1==1)))))&&((((((a11==1)&&((a12==1)&&((a6==1)&&((((a27==1)&&!(a26==1))||((a26==1)&&!(a27==1)))&&(input==5)))))&&!(a8==1))&&!(a14==1))&&(a3==0))&&!(a2==1)))){ if((a0==1)){ a17 = 1; a3 = 2; a20 = 1; a27 = 0; a26 = 0; a12 = 0; a11 = 0; a5 = 1; a1 = 0; }else{ a27 = 0; a1 = 0; a3 = 1; a6 = 0; a9 = 1; a15 = 0; a5 = 1; a26 = 1; } return -1; } else if(((!(a20==1)&&((((!(a10==1)||((a6==1)&&((!(a0==1)||(a10==1))&&!(a2==1))))||!(a1==1))&&!(a14==1))&&(a11==1)))&&((a18==1)&&(((a12==1)&&(((input==3)&&((!(a26==1)&&(a27==1))||(!(a27==1)&&(a26==1))))&&!(a5==1)))&&(a3==0))))){ if((a22==1)){ a16 = 0; a3 = 2; a23 = 1; a27 = 0; a11 = 0; a5 = 1; a26 = 1; a1 = 0; }else{ a27 = 1; a3 = 2; a2 = 1; a11 = 0; a10 = 0; a16 = 0; a26 = 0; a5 = 1; } return -1; } else if((((((a18==1)&&(!(a20==1)&&(a0==1)))&&(a12==1))||!(a1==1))&&(((((a11==1)&&(!(a23==1)&&(!(a5==1)&&((((input==6)&&(((a27==1)&&!(a26==1))||(!(a27==1)&&(a26==1))))&&!(a14==1))&&!(a20==1)))))&&(a6==1))&&(a3==0))&&(a1==1)))){ if((a21==1)){ a22 = 0; a12 = 0; a24 = 1; a27 = 1; a26 = 1; a5 = 1; a9 = 0; }else{ a28 = 1; a5 = 1; a11 = 0; a7 = 1; a3 = 2; a4 = 0; a27 = 1; a12 = 0; a26 = 0; } return -1; } else if(((!(a19==1)&&((a4==1)&&((((a18==1)&&(a0==1))&&(a11==1))&&!(a5==1))))&&((a10==1)&&((a15==1)&&((!(a14==1)&&((a6==1)&&((a3==0)&&((((!(a26==1)&&!(a27==1))&&(a12==1))||(!(a12==1)&&((a27==1)&&(a26==1))))&&(input==1)))))&&(a16==1)))))){ a27 = 0; a25 = 1; a2 = 1; a23 = 1; a26 = 1; a12 = 1; a5 = 1; return -1; } else if((((a0==1)&&((((a6==1)&&(!(a5==1)&&((((a27==1)&&!(a26==1))||(!(a27==1)&&(a26==1)))&&(input==2))))&&!(a2==1))&&(a3==0)))&&((a22==1)&&((a12==1)&&(((a18==1)&&((((a22==1)&&(a11==1))&&!(a23==1))||!(a4==1)))&&!(a7==1)))))){ a27 = 0; a3 = 2; a26 = 0; a5 = 1; a7 = 1; a11 = 0; a28 = 0; a2 = 1; return -1; } else if(((((!(a11==1)&&(!(a6==1)&&((((input==4)&&((!(a26==1)&&(a27==1))||((a26==1)&&!(a27==1))))&&!(a8==1))&&(a18==1))))&&(a16==1))&&!(a17==1))&&((a1==1)&&((a20==1)||((((a5==1)&&((a3==2)&&(a1==1)))&&(a12==1))||!(a4==1)))))){ a11 = 1; a27 = 1; a25 = 0; a17 = 0; a6 = 1; a3 = 0; a7 = 0; a26 = 1; return -1; } else if((((((!(a7==1)&&(((input==3)&&(a5==1))&&(a16==1)))&&(a18==1))&&!(a27==1))&&!(a26==1))&&((!(a11==1)&&((!(a17==1)&&((a3==1)&&(!(a23==1)&&(!(a16==1)||((a10==1)||(a14==1))))))&&!(a12==1)))&&!(a6==1)))){ a6 = 1; a10 = 1; a3 = 2; a0 = 1; a11 = 1; a26 = 1; return 21; } else if((((a27==1)&&(!(a12==1)&&((a11==1)&&((!(a2==1)&&((a18==1)&&(((!(a25==1)&&(((a3==2)&&(input==2))&&(a15==1)))&&(a29==1))&&(a15==1))))&&!(a25==1)))))&&((a5==1)&&(((a10==1)&&(a26==1))&&!(a6==1))))){ a17 = 0; a15 = 1; a2 = 0; return 23; } if(((((((((a26==1)&&!(a6==1))&&!(a27==1))&&!(a12==1))&&(a3==1))&&(a11==1))&&(a5==1))&&(a18==1))){ error_45: exit(0); } if(((((((((a26==1)&&(a6==1))&&(a27==1))&&!(a12==1))&&(a3==1))&&(a11==1))&&(a5==1))&&(a18==1))){ error_35: exit(0); } if((((((((!(a26==1)&&(a6==1))&&(a27==1))&&!(a12==1))&&(a3==1))&&!(a11==1))&&(a5==1))&&(a18==1))){ error_52: exit(0); } if(((((((((a26==1)&&!(a6==1))&&(a27==1))&&(a12==1))&&(a3==1))&&(a11==1))&&(a5==1))&&(a18==1))){ error_39: exit(0); } if(((((((((a26==1)&&!(a6==1))&&!(a27==1))&&(a12==1))&&(a3==0))&&(a11==1))&&(a5==1))&&(a18==1))){ error_9: exit(0); } if(((((((((a26==1)&&(a6==1))&&!(a27==1))&&!(a12==1))&&(a3==1))&&(a11==1))&&(a5==1))&&(a18==1))){ error_37: exit(0); } if(((((((((a26==1)&&!(a6==1))&&(a27==1))&&!(a12==1))&&(a3==1))&&(a11==1))&&(a5==1))&&(a18==1))){ error_43: exit(0); } if(((((((((a26==1)&&(a6==1))&&(a27==1))&&(a12==1))&&(a3==1))&&(a11==1))&&(a5==1))&&(a18==1))){ error_31: exit(0); } if((((((((!(a26==1)&&!(a6==1))&&(a27==1))&&!(a12==1))&&(a3==0))&&!(a11==1))&&(a5==1))&&(a18==1))){ error_28: exit(0); } if(((((((((a26==1)&&!(a6==1))&&(a27==1))&&!(a12==1))&&(a3==0))&&!(a11==1))&&(a5==1))&&(a18==1))){ error_27: exit(0); } if((((((((!(a26==1)&&(a6==1))&&!(a27==1))&&(a12==1))&&(a3==1))&&!(a11==1))&&(a5==1))&&(a18==1))){ error_50: exit(0); } if(((((((((a26==1)&&!(a6==1))&&!(a27==1))&&!(a12==1))&&(a3==0))&&(a11==1))&&(a5==1))&&(a18==1))){ error_13: exit(0); } if((((((((!(a26==1)&&!(a6==1))&&!(a27==1))&&(a12==1))&&(a3==0))&&!(a11==1))&&(a5==1))&&(a18==1))){ error_26: exit(0); } if((((((((!(a26==1)&&!(a6==1))&&(a27==1))&&(a12==1))&&(a3==0))&&(a11==1))&&(a5==1))&&(a18==1))){ error_8: exit(0); } if(((((((((a26==1)&&(a6==1))&&!(a27==1))&&!(a12==1))&&(a3==0))&&(a11==1))&&(a5==1))&&(a18==1))){ error_5: exit(0); } if(((((((((a26==1)&&(a6==1))&&!(a27==1))&&(a12==1))&&(a3==1))&&(a11==1))&&(a5==1))&&(a18==1))){ error_33: exit(0); } if((((((((!(a26==1)&&!(a6==1))&&!(a27==1))&&(a12==1))&&(a3==1))&&!(a11==1))&&(a5==1))&&(a18==1))){ error_58: exit(0); } if(((((((((a26==1)&&!(a6==1))&&!(a27==1))&&(a12==1))&&(a3==1))&&!(a11==1))&&(a5==1))&&(a18==1))){ error_57: exit(0); } if(((((((((a26==1)&&!(a6==1))&&(a27==1))&&(a12==1))&&(a3==1))&&!(a11==1))&&(a5==1))&&(a18==1))){ error_55: exit(0); } if((((((((!(a26==1)&&!(a6==1))&&(a27==1))&&!(a12==1))&&(a3==0))&&(a11==1))&&(a5==1))&&(a18==1))){ error_12: exit(0); } if(((((((((a26==1)&&(a6==1))&&(a27==1))&&!(a12==1))&&(a3==0))&&(a11==1))&&(a5==1))&&(a18==1))){ error_3: exit(0); } if((((((((!(a26==1)&&(a6==1))&&(a27==1))&&(a12==1))&&(a3==0))&&!(a11==1))&&(a5==1))&&(a18==1))){ error_16: exit(0); } if((((((((!(a26==1)&&(a6==1))&&!(a27==1))&&!(a12==1))&&(a3==1))&&!(a11==1))&&(a5==1))&&(a18==1))){ error_54: exit(0); } if((((((((!(a26==1)&&(a6==1))&&!(a27==1))&&!(a12==1))&&(a3==0))&&!(a11==1))&&(a5==1))&&(a18==1))){ error_22: exit(0); } if(((((((((a26==1)&&(a6==1))&&!(a27==1))&&(a12==1))&&(a3==1))&&!(a11==1))&&(a5==1))&&(a18==1))){ error_49: exit(0); } if((((((((!(a26==1)&&(a6==1))&&!(a27==1))&&!(a12==1))&&(a3==0))&&(a11==1))&&(a5==1))&&(a18==1))){ error_6: exit(0); } if((((((((!(a26==1)&&!(a6==1))&&!(a27==1))&&!(a12==1))&&(a3==0))&&(a11==1))&&(a5==1))&&(a18==1))){ error_14: exit(0); } if(((((((((a26==1)&&!(a6==1))&&(a27==1))&&(a12==1))&&(a3==0))&&!(a11==1))&&(a5==1))&&(a18==1))){ error_23: exit(0); } if(((((((((a26==1)&&!(a6==1))&&(a27==1))&&(a12==1))&&(a3==0))&&(a11==1))&&(a5==1))&&(a18==1))){ error_7: __VERIFIER_error(); } if((((((((!(a26==1)&&!(a6==1))&&(a27==1))&&(a12==1))&&(a3==1))&&!(a11==1))&&(a5==1))&&(a18==1))){ error_56: exit(0); } if(((((((((a26==1)&&!(a6==1))&&(a27==1))&&!(a12==1))&&(a3==1))&&!(a11==1))&&(a5==1))&&(a18==1))){ error_59: exit(0); } if((((((((!(a26==1)&&!(a6==1))&&!(a27==1))&&!(a12==1))&&(a3==0))&&!(a11==1))&&(a5==1))&&(a18==1))){ error_30: exit(0); } if(((((((((a26==1)&&(a6==1))&&(a27==1))&&(a12==1))&&(a3==0))&&(a11==1))&&(a5==1))&&(a18==1))){ globalError: exit(0); } if((((((((!(a26==1)&&!(a6==1))&&(a27==1))&&!(a12==1))&&(a3==1))&&(a11==1))&&(a5==1))&&(a18==1))){ error_44: exit(0); } if(((((((((a26==1)&&!(a6==1))&&!(a27==1))&&!(a12==1))&&(a3==0))&&!(a11==1))&&(a5==1))&&(a18==1))){ error_29: exit(0); } if((((((((!(a26==1)&&(a6==1))&&(a27==1))&&!(a12==1))&&(a3==1))&&(a11==1))&&(a5==1))&&(a18==1))){ error_36: exit(0); } if(((((((((a26==1)&&!(a6==1))&&!(a27==1))&&(a12==1))&&(a3==0))&&!(a11==1))&&(a5==1))&&(a18==1))){ error_25: exit(0); } if((((((((!(a26==1)&&!(a6==1))&&!(a27==1))&&(a12==1))&&(a3==0))&&(a11==1))&&(a5==1))&&(a18==1))){ error_10: exit(0); } if(((((((((a26==1)&&!(a6==1))&&!(a27==1))&&(a12==1))&&(a3==1))&&(a11==1))&&(a5==1))&&(a18==1))){ error_41: exit(0); } if((((((((!(a26==1)&&(a6==1))&&(a27==1))&&(a12==1))&&(a3==1))&&!(a11==1))&&(a5==1))&&(a18==1))){ error_48: exit(0); } if((((((((!(a26==1)&&!(a6==1))&&(a27==1))&&(a12==1))&&(a3==1))&&(a11==1))&&(a5==1))&&(a18==1))){ error_40: exit(0); } if((((((((!(a26==1)&&!(a6==1))&&!(a27==1))&&!(a12==1))&&(a3==1))&&(a11==1))&&(a5==1))&&(a18==1))){ error_46: exit(0); } if(((((((((a26==1)&&(a6==1))&&!(a27==1))&&(a12==1))&&(a3==0))&&(a11==1))&&(a5==1))&&(a18==1))){ error_1: exit(0); } if(((((((((a26==1)&&(a6==1))&&(a27==1))&&!(a12==1))&&(a3==0))&&!(a11==1))&&(a5==1))&&(a18==1))){ error_19: exit(0); } if(((((((((a26==1)&&(a6==1))&&(a27==1))&&!(a12==1))&&(a3==1))&&!(a11==1))&&(a5==1))&&(a18==1))){ error_51: exit(0); } if((((((((!(a26==1)&&(a6==1))&&(a27==1))&&(a12==1))&&(a3==1))&&(a11==1))&&(a5==1))&&(a18==1))){ error_32: exit(0); } if((((((((!(a26==1)&&(a6==1))&&!(a27==1))&&(a12==1))&&(a3==1))&&(a11==1))&&(a5==1))&&(a18==1))){ error_34: exit(0); } if((((((((!(a26==1)&&!(a6==1))&&(a27==1))&&(a12==1))&&(a3==0))&&!(a11==1))&&(a5==1))&&(a18==1))){ error_24: exit(0); } if((((((((!(a26==1)&&(a6==1))&&(a27==1))&&(a12==1))&&(a3==0))&&(a11==1))&&(a5==1))&&(a18==1))){ error_0: exit(0); } if(((((((((a26==1)&&!(a6==1))&&(a27==1))&&!(a12==1))&&(a3==0))&&(a11==1))&&(a5==1))&&(a18==1))){ error_11: exit(0); } if(((((((((a26==1)&&(a6==1))&&!(a27==1))&&!(a12==1))&&(a3==1))&&!(a11==1))&&(a5==1))&&(a18==1))){ error_53: exit(0); } if((((((((!(a26==1)&&(a6==1))&&(a27==1))&&!(a12==1))&&(a3==0))&&!(a11==1))&&(a5==1))&&(a18==1))){ error_20: exit(0); } if((((((((!(a26==1)&&!(a6==1))&&!(a27==1))&&(a12==1))&&(a3==1))&&(a11==1))&&(a5==1))&&(a18==1))){ error_42: exit(0); } if(((((((((a26==1)&&(a6==1))&&(a27==1))&&(a12==1))&&(a3==1))&&!(a11==1))&&(a5==1))&&(a18==1))){ error_47: exit(0); } if((((((((!(a26==1)&&(a6==1))&&(a27==1))&&!(a12==1))&&(a3==0))&&(a11==1))&&(a5==1))&&(a18==1))){ error_4: exit(0); } if(((((((((a26==1)&&(a6==1))&&!(a27==1))&&(a12==1))&&(a3==0))&&!(a11==1))&&(a5==1))&&(a18==1))){ error_17: exit(0); } if(((((((((a26==1)&&(a6==1))&&(a27==1))&&(a12==1))&&(a3==0))&&!(a11==1))&&(a5==1))&&(a18==1))){ error_15: exit(0); } if((((((((!(a26==1)&&(a6==1))&&!(a27==1))&&!(a12==1))&&(a3==1))&&(a11==1))&&(a5==1))&&(a18==1))){ error_38: exit(0); } if(((((((((a26==1)&&(a6==1))&&!(a27==1))&&!(a12==1))&&(a3==0))&&!(a11==1))&&(a5==1))&&(a18==1))){ error_21: exit(0); } if((((((((!(a26==1)&&(a6==1))&&!(a27==1))&&(a12==1))&&(a3==0))&&!(a11==1))&&(a5==1))&&(a18==1))){ error_18: exit(0); } if((((((((!(a26==1)&&(a6==1))&&!(a27==1))&&(a12==1))&&(a3==0))&&(a11==1))&&(a5==1))&&(a18==1))){ error_2: exit(0); } return -2; } int main() { // default output int output = -1; // main i/o-loop while(1) { // read input int input; input = __VERIFIER_nondet_int(); if ((input != 1) && (input != 2) && (input != 3) && (input != 4) && (input != 5) && (input != 6)) return -2; // operate eca engine output = calculate_output(input); } }
the_stack_data/153268012.c
/* gcc -Wall -pthread statistics.c */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <pthread.h> int max; int min; float avg; int len; /** * Basic struct used for communication between main process and his worker * threads. */ struct WorkerData { /* Pointer to first element of integer array which to use as input for * functions. */ int* input; /* Pointer to where result of minimum function should be stored. */ int* min; /* Pointer to where result of maximum function should be stored. */ int* max; /* Pointer to where result of average function should be stored. */ float* avg; }; void *average(void *val) { /* Cast void pointer back to what we know it to be, for sanity's sake. */ struct WorkerData *data = (struct WorkerData*) val; float sum = 0; for (int i = 0; i < len; i++) { sum += data->input[i]; } *(data->avg) = sum / len; return NULL; } void *minimum(void *val) { /* Cast void pointer back to what we know it to be, for sanity's sake. */ struct WorkerData *data = (struct WorkerData*) val; *(data->min) = data->input[0]; for (int i = 1; i < len; i++) { if (data->input[i] < *(data->min)) { *(data->min) = data->input[i]; } } return NULL; } void *maximum(void *val) { /* Cast void pointer back to what we know it to be, for sanity's sake. */ struct WorkerData *data = (struct WorkerData*) val; *(data->max) = data->input[0]; for (int i = 1; i < len; i++) { if (data->input[i] > *(data->max)) { *(data->max) = data->input[i]; } } return NULL; } void usage() { printf("Usage: ./statistics <number> <number> [number, ...]\n"); exit(2); } int main(int argc, char *argv[]) { /* As we bail out on invalid input, rather than ignoring it, the number * of parameters is ensured to be argc - 1 - all arguments except * argv[0] which is the executable's name. */ len = argc - 1; int cliArgs[len]; pthread_t thread0; pthread_t thread1; pthread_t thread2; if (argc < 3) { usage(); } char chr; for (int i = 1; i < argc; i++) { /* Not sure what the magic 'c' there captures. \0 as string terminator? */ if (sscanf(argv[i], "%d%c", &cliArgs[i - 1], &chr) != 1) { usage(); }; } struct WorkerData data; data.min = &min; data.max = &max; data.avg = &avg; data.input = &cliArgs[0]; pthread_create(&thread0, NULL, minimum, &data); pthread_create(&thread1, NULL, maximum, &data); pthread_create(&thread2, NULL, average, &data); pthread_join(thread0, NULL); pthread_join(thread1, NULL); pthread_join(thread2, NULL); printf("Average: %f\n" , avg); printf("Maximum: %i\n" , max); printf("Minimum: %i\n" , min); return 0; }
the_stack_data/248581565.c
/* { dg-do compile { target c99_runtime } } */ /* { dg-options "-O2 -fdump-ipa-icf" } */ /* { dg-add-options c99_runtime } */ #include <complex.h> #if (__SIZEOF_INT__ == __SIZEOF_FLOAT__) typedef int intflt; #elif (__SIZEOF_LONG__ == __SIZEOF_FLOAT__) typedef long intflt; #else #error Add target support here for type that will union float size #endif static double test; struct struktura { union { long i; float f; } u; }; struct struktura sss; struct X { int i; union { intflt j; intflt k; float f; } u; }; __attribute__ ((noinline)) intflt foo(intflt j) { struct X a; a.u.j = j; a.u.f = a.u.f; a.u.f = a.u.f; a.u.j = a.u.j; a.u.f = a.u.f; return a.u.k; } __attribute__ ((noinline)) intflt foo2(intflt j) { struct X a; a.u.j = j; a.u.f = a.u.f; a.u.f = a.u.f; a.u.j = a.u.j; a.u.f = a.u.f; return a.u.k; } int main() { return 1; } /* { dg-final { scan-ipa-dump "Semantic equality hit:foo->foo2" "icf" } } */ /* { dg-final { scan-ipa-dump "Equal symbols: 1" "icf" } } */
the_stack_data/184517397.c
#include <stdio.h> #include <stdlib.h> #include <stdbool.h> #define BUFSIZE 100 void cuteOctupusesFlash(char octupuses[][10], int i, int j, int *flashes, bool flashed[][10]) { if (i >= 10 || j >= 10 || octupuses[i][j] == '0' && flashed[i][j]) return; else if (octupuses[i][j] == '9') { (*flashes)++; octupuses[i][j] = '0'; flashed[i][j] = true; if (i+1 < 10) { cuteOctupusesFlash(octupuses, i+1, j, flashes, flashed); } if (j+1 < 10) { cuteOctupusesFlash(octupuses, i, j+1, flashes, flashed); } if (i > 0) { cuteOctupusesFlash(octupuses, i-1, j, flashes, flashed); } if (j > 0) { cuteOctupusesFlash(octupuses, i, j-1, flashes, flashed); } if (i+1 < 10 && j+1 < 10) { cuteOctupusesFlash(octupuses, i+1, j+1, flashes, flashed); } if (i+1 < 10 && j > 0) { cuteOctupusesFlash(octupuses, i+1, j-1, flashes, flashed); } if (i > 0 && j+1 < 10) { cuteOctupusesFlash(octupuses, i-1, j+1, flashes, flashed); } if (i > 0 && j > 0) { cuteOctupusesFlash(octupuses, i-1, j-1, flashes, flashed); } } else octupuses[i][j]++; } int main(void) { FILE *input = fopen("day11.txt", "r"); if (!input) { perror("FileIOError"); exit(EXIT_FAILURE); } char octopuses[10][10] = { 0 }; int i, j; i = j = 0; char *buf = malloc(BUFSIZE * sizeof(char)); while (fgets(buf, BUFSIZE, input) != 0) { for (char *bufReader = buf; *bufReader != '\n'; bufReader++) { if (j >= 10) { j = 0; i++; } octopuses[i][j++] = *bufReader; } } int numOfFlashes = 0; for (int s = 0; s < 500; s++) { bool octopusesFlashed[10][10] = { false }; for (int i = 0; i < 10; i++) { for (int j = 0; j < 10; j++) { cuteOctupusesFlash(octopuses, i, j, &numOfFlashes, octopusesFlashed); } } bool allFlash; for (int i = 0; i < 10; i++) { for (int j = 0; j < 10; j++) { allFlash = octopusesFlashed[i][j]; if (!allFlash) break; } if (!allFlash) break; } if (allFlash) { printf("First step where all octupuses flash: %d\n", s+1); break; } } free(buf); fclose(input); exit(EXIT_SUCCESS); }
the_stack_data/26700324.c
/* (c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands. See the copyright notice in the ACK home directory, in the file "Copyright". */ /* Module: Access to program arguments and environment Author: Ceriel J.H. Jacobs Version: $Header$ */ extern char **argv, ***_penviron; extern int argc; unsigned int _Arguments__Argc; static char * findname(s1, s2) register char *s1, *s2; { while (*s1 == *s2++) s1++; if (*s1 == '\0' && *(s2-1) == '=') return s2; return 0; } static unsigned int scopy(src, dst, max) register char *src, *dst; unsigned int max; { register unsigned int i = 0; while (*src && i <= max) { i++; *dst++ = *src++; } if (i <= max) { *dst = '\0'; return i+1; } while (*src++) i++; return i + 1; } _Arguments_() { _Arguments__Argc = argc; } unsigned _Arguments__Argv(n, argument, l, u, s) unsigned int u; char *argument; { if (n >= argc) return 0; return scopy(argv[n], argument, u); } unsigned _Arguments__GetEnv(name, nn, nu, ns, value, l, u, s) char *name, *value; unsigned int nu, u; { register char **p = *_penviron; register char *v = 0; while (*p && !(v = findname(name, *p++))) { /* nothing */ } if (!v) return 0; return scopy(v, value, u); }
the_stack_data/165769360.c
// REQUIRES: zlib // RUN: %clang %s -emit-llvm -g %O0opt -c -o %t1.bc // We disable the cex-cache to eliminate nondeterminism across different // solvers, in particular when counting the number of queries in the last two // commands // RUN: rm -rf %t.klee-out %t.klee-out2 // RUN: %klee --output-dir=%t.klee-out --use-cex-cache=false --use-query-log=all:kquery %t1.bc // RUN: %klee --output-dir=%t.klee-out2 --use-cex-cache=false --compress-query-log --use-query-log=all:kquery %t1.bc // RUN: gunzip -d %t.klee-out2/all-queries.kquery.gz // RUN: diff %t.klee-out/all-queries.kquery %t.klee-out/all-queries.kquery #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"); 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/145332.c
#include <stdio.h> #include <stdlib.h> // Set the bits of x within range of [start, end], in which both are inclusive // Assume 0 <= start & end <= 31 void set_bits(unsigned * x, unsigned start, unsigned end, unsigned *v) { // YOUR CODE HERE // No return value // v points to an array of at least (end-start+1) unsigned integers. // if v[i] == 0, then set (i+start)-th bit of x zero, otherwise, set (i+start)-th bit of x one. int s, e, i, j; unsigned int* bin = (unsigned int *)malloc(sizeof(unsigned int )* 32); s = 32 - start - 1; e = 32 - end - 1; for(i = 31; i >= 0; i--){ bin[i] = *x&1; //changes x to binary *x >>= 1; } j = 0; for(i = s; i >= e; i--){ if(bin[i] != v[j]){ bin[i] = (bin[i] & 1) ^ 1; //set the elements in range = to v } j++; } unsigned int n = 0; for (i = 0; i < 32; ++i) { n*=2; n = n + bin[i]; //converts binary to decimal } *x = n; free(bin); }
the_stack_data/225144404.c
/* Copyright (C) 1991, 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include <errno.h> #include <signal.h> #define __need_NULL #include <stddef.h> /* Test whether SET is empty. */ int sigisemptyset (set) const sigset_t *set; { if (set == NULL) { __set_errno (EINVAL); return -1; } return __sigisemptyset (set); }
the_stack_data/524158.c
#include <stdio.h> void main () { // Making variabel with char char name[100], link[100]; printf("Welcome to hacktoberfest event!\n\n"); printf("Enter your name: "); scanf(" %[^\n]s", &name); //You can add 1 or more name. example, <rahul anjay sakinah> printf("Hello %s! put your github link here: ", name); scanf(" %s", &link); printf("\n\n\n---------------\n"); printf("Your name: %s\n", name); printf("Your github profile: %s\n\n", link); printf("Happy hacking!\n"); }
the_stack_data/74301.c
#include <stdio.h> int main() { int n = 5; for(int i = 1; i <= n; i++) { for(int j = 1; j <= i; j++) { if(i % 2 == 0) printf("* "); else printf("# "); } printf("\n"); } return 0; }
the_stack_data/179830244.c
// Baghand - zip to gz.tar converter. Converts a zip file to a tarball of gzipped files without decompressing anything. #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/mman.h> #include <unistd.h> #include <fcntl.h> //wow, I didn't realize tarball headers were so huge, or all in ascii... struct tar_posix_header { unsigned char name[100]; unsigned char mode[8]; unsigned char uid[8]; unsigned char gid[8]; unsigned char size[12]; unsigned char mtime[12]; unsigned char chksum[8]; unsigned char typeflag; unsigned char linkname[100]; unsigned char magic[6]; unsigned char version[2]; unsigned char uname[32]; unsigned char gname[32]; unsigned char devmajor[8]; unsigned char devminor[8]; unsigned char prefix[155]; unsigned char pad[12]; }; #define GZ_MAGIC 0x8b1f #define GZ_METHOD_DEFLATE 0x08 #define GZ_OS_LINUX 0x03 #define GZ_FLAGS_TEXT 0x01 // ascii? #define GZ_FLAGS_HEADER_CRC 0x02 #define GZ_FLAGS_EXTRA 0x04 #define GZ_FLAGS_NAME_TRUNC 0x08 #define GZ_FLAGS_ENCRYPTED 0x10 #define GZ_FLAGS_RESTRICTED 0xE0 struct gz_header { uint16_t magic; uint8_t method; uint8_t flags; //encrypted, restricted, extra_feild, header_crc, truncated_name uint32_t stamp; uint8_t extra; uint8_t os; }__attribute__((packed)); struct gz_footer { uint32_t crc; uint32_t isize; }; #define ZIP_FILE_MAGIC 0x04034b50 #define ZIP_ALG_STORE 0 #define ZIP_ALG_DEFLATE 8 #define ZIP_CD_MAGIC 0x02014b50 #define ZIP_EOCD_MAGIC 0x06054b50 struct zip_local_file { uint32_t magic; uint16_t min_version; uint16_t flags; uint16_t compression; uint16_t mtime; uint16_t mdate; uint32_t crc32; uint32_t zip_size; uint32_t unzip_size; uint16_t fname_len; uint16_t extra_len; unsigned char *fname; unsigned char *extra; }__attribute__((packed)); struct zip_directory { uint32_t magic; uint16_t version; uint16_t min_version; uint16_t flags; uint16_t compression; uint16_t mtime; uint16_t mdate; uint32_t crc32; uint32_t zip_size; uint32_t unzip_size; uint16_t fname_len; uint16_t extra_len; uint16_t comment_len; uint16_t disk; uint16_t iattr; uint32_t eattr; // data alignment is the problem here... uint32_t offset; unsigned char *fname; unsigned char *extra; unsigned char *comment; }__attribute__((packed)); struct zip_eocd { uint32_t magic; uint16_t disk_num; uint16_t main_disk; uint16_t central_records; uint16_t total_central_records; uint32_t central_dir_size; uint32_t central_dir_offset; uint16_t comment_len; unsigned char *comment; }; // this function checks the zip magic and the comment length to see if // the eocd structure has been located inline int validate_eocd(struct zip_eocd *eocd, uint32_t offset) { return (eocd->magic == ZIP_EOCD_MAGIC) && ((offset-23) == eocd->comment_len); } // This function fills buffer with an ascii encoded octal string representing n void octal(int n, unsigned char *buffer, int len) { int i = 0; for (i = 0; i < len; i++, n = n >> 3) buffer[len-1-i] = (n & 7) + '0'; } static const unsigned char padding[512] = {0}; void tar_set_checksum(struct tar_posix_header *header) { uint32_t sum = 0; int i; unsigned char *header_data = (unsigned char *)header; for (i=0; i<8; i++) header->chksum[i] = ' '; for (i=0;i<sizeof(struct tar_posix_header); i++) sum += header_data[i]; octal(sum, header->chksum, 6); header->chksum[6] = '\0'; } inline uint32_t tar_entry_size(uint32_t file_size, uint8_t deflated) { return file_size + (deflated ? (sizeof(struct gz_header) + sizeof(struct gz_footer)) : 0); } void tar_write(unsigned char *fname, int zip_fd, int tar_fd, struct zip_directory *dir_entry) { struct zip_local_file file_entry; unsigned char *buffer; // used for the compressed file data struct tar_posix_header tar_header = {0}; struct gz_header header = {0}; struct gz_footer footer = {0}; int i; buffer = malloc(dir_entry->zip_size); // tar headers if (dir_entry->fname_len < 98) for (i=0; fname[i] != 0; i++) tar_header.name[i] = fname[i]; else for (i=0; fname[i] != 0; i++) if (i < 155) tar_header.prefix[i] = fname[i]; else tar_header.name[i-155] = fname[i]; for (i=0; i < 7; i++) { tar_header.mode[i] = '0'; tar_header.gid[i] = '0'; tar_header.uid[i] = '0'; tar_header.mtime[i] = '0'; } tar_header.typeflag = '0'; octal(tar_entry_size(dir_entry->zip_size, dir_entry->compression == ZIP_ALG_DEFLATE), tar_header.size, 11); tar_header.magic[0] = 'u'; tar_header.magic[1] = 's'; tar_header.magic[2] = 't'; tar_header.magic[3] = 'a'; tar_header.magic[4] = 'r'; tar_header.magic[5] = ' '; tar_header.magic[6] = ' '; // tar_header.version[0] = '0'; // tar_header.version[1] = '0'; tar_set_checksum(&tar_header); // gz headers header.magic = GZ_MAGIC; header.method = GZ_METHOD_DEFLATE; header.flags = 0; header.os = GZ_OS_LINUX; footer.crc = dir_entry->crc32; footer.isize = dir_entry->unzip_size; // jump to the file and extract it int pos = lseek(zip_fd, 0, SEEK_CUR); lseek(zip_fd, dir_entry->offset, SEEK_SET); read(zip_fd, &file_entry, 30); lseek(zip_fd, file_entry.fname_len + file_entry.extra_len, SEEK_CUR); read(zip_fd, buffer, dir_entry->zip_size); write(tar_fd, &tar_header, sizeof(struct tar_posix_header)); if (dir_entry->compression == ZIP_ALG_DEFLATE) { write(tar_fd, &header, sizeof(struct gz_header)); write(tar_fd, buffer, dir_entry->zip_size); write(tar_fd, &footer, sizeof(struct gz_footer)); } else if (dir_entry->compression == ZIP_ALG_STORE) { write(tar_fd, buffer, dir_entry->zip_size); } write(tar_fd, padding, 512 - ((sizeof(struct tar_posix_header) + tar_entry_size(dir_entry->zip_size, dir_entry->compression == ZIP_ALG_DEFLATE)) % 512)); free(buffer); lseek(zip_fd, pos, SEEK_SET); } void gz_create(unsigned char *fname, int zip_fd, struct zip_directory *dir_entry) { struct zip_local_file file_entry; unsigned char *buffer; // used for the compressed file data struct gz_header header = {0}; struct gz_footer footer = {0}; int gz_fd = open(fname, O_WRONLY | O_CREAT, 0); buffer = malloc(dir_entry->zip_size); header.magic = GZ_MAGIC; header.method = GZ_METHOD_DEFLATE; header.flags = 0; header.os = GZ_OS_LINUX; footer.crc = dir_entry->crc32; footer.isize = dir_entry->unzip_size; // jump to the file and extract it int pos = lseek(zip_fd, 0, SEEK_CUR); lseek(zip_fd, dir_entry->offset, SEEK_SET); read(zip_fd, &file_entry, 30); lseek(zip_fd, file_entry.fname_len + file_entry.extra_len, SEEK_CUR); read(zip_fd, buffer, dir_entry->zip_size); write(gz_fd, &header, sizeof(struct gz_header)); write(gz_fd, buffer, dir_entry->zip_size); write(gz_fd, &footer, 8); close(gz_fd); free(buffer); lseek(zip_fd, pos, SEEK_SET); } int zip_locate_eocd(int zip_fd, struct zip_eocd *zip_footer) { uint32_t offset = 22; lseek(zip_fd, -(int)offset, SEEK_END); // Locate the End of Central Directory header (located at the end of the file) while (!validate_eocd(zip_footer, offset)) { read(zip_fd, zip_footer, 22); if (lseek(zip_fd, -23, SEEK_CUR) == -1) return -1; offset += 1; } return offset; } int main(int argc, char **argv) { int i; int fd[2]; uint32_t offset = 0; unsigned char fname[512]; if (argc < 3) { printf("You are not argumentative enough to use this program.\n"); exit(1); } fd[0] = open(argv[1], O_RDONLY, 0); if (fd[0] == -1) { printf("A zip file is required.\n"); exit(1); } fd[1] = open(argv[2], O_WRONLY | O_CREAT, 0); if (fd[1] == -1) { printf("Could not save tar file.\n"); exit(1); } struct zip_directory zip_dir = {0}; struct zip_eocd zip_footer = {0}; // Locate the End of Central Directory header (located at the end of the file) offset = zip_locate_eocd(fd[0], &zip_footer); if (offset == -1) { printf("This does not appear to be a zip file.\n"); exit(1); } // Jump to the beginning of the Central Directories lseek(fd[0], zip_footer.central_dir_offset, SEEK_SET); // Iterate through all the Central Directories for (i = 0; i < zip_footer.total_central_records; i++) { read(fd[0], &zip_dir, 46); if (zip_dir.magic == ZIP_CD_MAGIC) // Just for sanity { read(fd[0], &fname, zip_dir.fname_len); if (zip_dir.compression == ZIP_ALG_DEFLATE) { fname[zip_dir.fname_len+0] = '.'; fname[zip_dir.fname_len+1] = 'g'; fname[zip_dir.fname_len+2] = 'z'; fname[zip_dir.fname_len+3] = 0; } else if (zip_dir.compression == ZIP_ALG_STORE) { fname[zip_dir.fname_len] = 0; } write(1, fname, zip_dir.fname_len); write(1, ".gz\n", 4); tar_write(fname, fd[0], fd[1], &zip_dir); // ------------------------------- } lseek(fd[0], zip_dir.extra_len + zip_dir.comment_len, SEEK_CUR); } close(fd[0]); close(fd[1]); exit(0); }
the_stack_data/53447.c
#include <stdio.h> int main(void) { float pi = 3.242, radius = 0, area = 0; printf("Enter Circle Radius: "); scanf("%f", &radius); area = pi * radius * radius; printf("Circle Area: %f\n",area); }
the_stack_data/692775.c
#include <stdio.h> /*1. Write a prototype for a function fun that has two type double input parameters (pass by value) and two type double output parameters (pass by reference). Write the function call statement that uses the following declared variables. */ double one = 1.0, two = 2.0; /* input variables */ double out1, out2, *ptr1 = &out1, *ptr2 = &out2; /* output variables */ void fun(double, double); int main(void) { fun(one,two); printf("The value of out1 = %f and the value of out2 = %f",out1,out2); return 0; } void fun(double one, double two) { *ptr1 = one; *ptr2 = two; } //much nope many wow. See the answer. Mine is still doing pass by value. //but because my variables are global, it doesn't affect //'visibility' of the variables.
the_stack_data/94647.c
// mmio //#define KVA 0xffff000000000000 //#define MMIO_BASE (KVA + 0x3f000000) #define MMIO_BASE 0x3f000000 // SD card command #define GO_IDLE_STATE 0 #define SEND_OP_CMD 1 #define ALL_SEND_CID 2 #define SEND_RELATIVE_ADDR 3 #define SELECT_CARD 7 #define SEND_IF_COND 8 #define VOLTAGE_CHECK_PATTERN 0x1aa #define STOP_TRANSMISSION 12 #define SET_BLOCKLEN 16 #define READ_SINGLE_BLOCK 17 #define WRITE_SINGLE_BLOCK 24 #define SD_APP_OP_COND 41 #define SDCARD_3_3V (1 << 21) #define SDCARD_ISHCS (1 << 30) #define SDCARD_READY (1 << 31) #define APP_CMD 55 // gpio #define GPIO_BASE (MMIO_BASE + 0x200000) #define GPIO_GPFSEL4 (GPIO_BASE + 0x10) #define GPIO_GPFSEL5 (GPIO_BASE + 0x14) #define GPIO_GPPUD (GPIO_BASE + 0x94) #define GPIO_GPPUDCLK1 (GPIO_BASE + 0x9c) // sdhost #define SDHOST_BASE (MMIO_BASE + 0x202000) #define SDHOST_CMD (SDHOST_BASE + 0) #define SDHOST_READ 0x40 #define SDHOST_WRITE 0x80 #define SDHOST_LONG_RESPONSE 0x200 #define SDHOST_NO_REPONSE 0x400 #define SDHOST_BUSY 0x800 #define SDHOST_NEW_CMD 0x8000 #define SDHOST_ARG (SDHOST_BASE + 0x4) #define SDHOST_TOUT (SDHOST_BASE + 0x8) #define SDHOST_TOUT_DEFAULT 0xf00000 #define SDHOST_CDIV (SDHOST_BASE + 0xc) #define SDHOST_CDIV_MAXDIV 0x7ff #define SDHOST_CDIV_DEFAULT 0x148 #define SDHOST_RESP0 (SDHOST_BASE + 0x10) #define SDHOST_RESP1 (SDHOST_BASE + 0x14) #define SDHOST_RESP2 (SDHOST_BASE + 0x18) #define SDHOST_RESP3 (SDHOST_BASE + 0x1c) #define SDHOST_HSTS (SDHOST_BASE + 0x20) #define SDHOST_HSTS_MASK (0x7f8) #define SDHOST_HSTS_ERR_MASK (0xf8) #define SDHOST_HSTS_DATA (1 << 0) #define SDHOST_PWR (SDHOST_BASE + 0x30) #define SDHOST_DBG (SDHOST_BASE + 0x34) #define SDHOST_DBG_FSM_DATA 1 #define SDHOST_DBG_FSM_MASK 0xf #define SDHOST_DBG_MASK (0x1f << 14 | 0x1f << 9) #define SDHOST_DBG_FIFO (0x4 << 14 | 0x4 << 9) #define SDHOST_CFG (SDHOST_BASE + 0x38) #define SDHOST_CFG_DATA_EN (1 << 4) #define SDHOST_CFG_SLOW (1 << 3) #define SDHOST_CFG_INTBUS (1 << 1) #define SDHOST_SIZE (SDHOST_BASE + 0x3c) #define SDHOST_DATA (SDHOST_BASE + 0x40) #define SDHOST_CNT (SDHOST_BASE + 0x50) // helper #define set(io_addr, val) \ asm volatile("str %w1, [%0]" ::"r"(io_addr), "r"(val) : "memory"); #define get(io_addr, val) \ asm volatile("ldr %w0, [%1]" : "=r"(val) : "r"(io_addr) : "memory"); static inline void delay(unsigned long tick) { while (tick--) { asm volatile("nop"); } } static int is_hcs; // high capcacity(SDHC) static void pin_setup() { set(GPIO_GPFSEL4, 0x24000000); set(GPIO_GPFSEL5, 0x924); set(GPIO_GPPUD, 0); delay(15000); set(GPIO_GPPUDCLK1, 0xffffffff); delay(15000); set(GPIO_GPPUDCLK1, 0); } static void sdhost_setup() { unsigned int tmp; set(SDHOST_PWR, 0); set(SDHOST_CMD, 0); set(SDHOST_ARG, 0); set(SDHOST_TOUT, SDHOST_TOUT_DEFAULT); set(SDHOST_CDIV, 0); set(SDHOST_HSTS, SDHOST_HSTS_MASK); set(SDHOST_CFG, 0); set(SDHOST_CNT, 0); set(SDHOST_SIZE, 0); get(SDHOST_DBG, tmp); tmp &= ~SDHOST_DBG_MASK; tmp |= SDHOST_DBG_FIFO; set(SDHOST_DBG, tmp); delay(250000); set(SDHOST_PWR, 1); delay(250000); set(SDHOST_CFG, SDHOST_CFG_SLOW | SDHOST_CFG_INTBUS | SDHOST_CFG_DATA_EN); set(SDHOST_CDIV, SDHOST_CDIV_DEFAULT); } static int wait_sd() { int cnt = 1000000; unsigned int cmd; do { if (cnt == 0) { return -1; } get(SDHOST_CMD, cmd); --cnt; } while (cmd & SDHOST_NEW_CMD); return 0; } static int sd_cmd(unsigned cmd, unsigned int arg) { set(SDHOST_ARG, arg); set(SDHOST_CMD, cmd | SDHOST_NEW_CMD); return wait_sd(); } static int sdcard_setup() { unsigned int tmp; sd_cmd(GO_IDLE_STATE | SDHOST_NO_REPONSE, 0); sd_cmd(SEND_IF_COND, VOLTAGE_CHECK_PATTERN); get(SDHOST_RESP0, tmp); if (tmp != VOLTAGE_CHECK_PATTERN) { return -1; } while (1) { if (sd_cmd(APP_CMD, 0) == -1) { // MMC card or invalid card status // currently not support continue; } sd_cmd(SD_APP_OP_COND, SDCARD_3_3V | SDCARD_ISHCS); get(SDHOST_RESP0, tmp); if (tmp & SDCARD_READY) { break; } delay(1000000); } is_hcs = tmp & SDCARD_ISHCS; sd_cmd(ALL_SEND_CID | SDHOST_LONG_RESPONSE, 0); sd_cmd(SEND_RELATIVE_ADDR, 0); get(SDHOST_RESP0, tmp); sd_cmd(SELECT_CARD, tmp); sd_cmd(SET_BLOCKLEN, 512); return 0; } static int wait_fifo() { int cnt = 1000000; unsigned int hsts; do { if (cnt == 0) { return -1; } get(SDHOST_HSTS, hsts); --cnt; } while ((hsts & SDHOST_HSTS_DATA) == 0); return 0; } static void set_block(int size, int cnt) { set(SDHOST_SIZE, size); set(SDHOST_CNT, cnt); } static void wait_finish() { unsigned int dbg; do { get(SDHOST_DBG, dbg); } while ((dbg & SDHOST_DBG_FSM_MASK) != SDHOST_HSTS_DATA); } void readblock(int block_idx, void* buf) { unsigned int* buf_u = (unsigned int*)buf; int succ = 0; if (!is_hcs) { block_idx <<= 9; } do{ set_block(512, 1); sd_cmd(READ_SINGLE_BLOCK | SDHOST_READ, block_idx); for (int i = 0; i < 128; ++i) { wait_fifo(); get(SDHOST_DATA, buf_u[i]); } unsigned int hsts; get(SDHOST_HSTS, hsts); if (hsts & SDHOST_HSTS_ERR_MASK) { set(SDHOST_HSTS, SDHOST_HSTS_ERR_MASK); sd_cmd(STOP_TRANSMISSION | SDHOST_BUSY, 0); } else { succ = 1; } } while(!succ); wait_finish(); } void writeblock(int block_idx, void* buf) { unsigned int* buf_u = (unsigned int*)buf; int succ = 0; if (!is_hcs) { block_idx <<= 9; } do{ set_block(512, 1); sd_cmd(WRITE_SINGLE_BLOCK | SDHOST_WRITE, block_idx); for (int i = 0; i < 128; ++i) { wait_fifo(); set(SDHOST_DATA, buf_u[i]); } unsigned int hsts; get(SDHOST_HSTS, hsts); if (hsts & SDHOST_HSTS_ERR_MASK) { set(SDHOST_HSTS, SDHOST_HSTS_ERR_MASK); sd_cmd(STOP_TRANSMISSION | SDHOST_BUSY, 0); } else { succ = 1; } } while(!succ); wait_finish(); } void sd_init() { pin_setup(); sdhost_setup(); sdcard_setup(); }
the_stack_data/1125227.c
#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; #ifdef _MSC_VER static inline _Fcomplex Cf(complex *z) {_Fcomplex zz={z->r , z->i}; return zz;} static inline _Dcomplex Cd(doublecomplex *z) {_Dcomplex zz={z->r , z->i};return zz;} static inline _Fcomplex * _pCf(complex *z) {return (_Fcomplex*)z;} static inline _Dcomplex * _pCd(doublecomplex *z) {return (_Dcomplex*)z;} #else 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;} #endif #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)); } #ifdef _MSC_VER #define c_div(c, a, b) {Cf(c)._Val[0] = (Cf(a)._Val[0]/Cf(b)._Val[0]); Cf(c)._Val[1]=(Cf(a)._Val[1]/Cf(b)._Val[1]);} #define z_div(c, a, b) {Cd(c)._Val[0] = (Cd(a)._Val[0]/Cd(b)._Val[0]); Cd(c)._Val[1]=(Cd(a)._Val[1]/df(b)._Val[1]);} #else #define c_div(c, a, b) {pCf(c) = Cf(a)/Cf(b);} #define z_div(c, a, b) {pCd(c) = Cd(a)/Cd(b);} #endif #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) = conjf(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) (cimagf(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; } #ifdef _MSC_VER static _Fcomplex cpow_ui(complex x, integer n) { complex pow={1.0,0.0}; unsigned long int u; if(n != 0) { if(n < 0) n = -n, x.r = 1/x.r, x.i=1/x.i; for(u = n; ; ) { if(u & 01) pow.r *= x.r, pow.i *= x.i; if(u >>= 1) x.r *= x.r, x.i *= x.i; else break; } } _Fcomplex p={pow.r, pow.i}; return p; } #else 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; } #endif #ifdef _MSC_VER static _Dcomplex zpow_ui(_Dcomplex x, integer n) { _Dcomplex pow={1.0,0.0}; unsigned long int u; if(n != 0) { if(n < 0) n = -n, x._Val[0] = 1/x._Val[0], x._Val[1] =1/x._Val[1]; for(u = n; ; ) { if(u & 01) pow._Val[0] *= x._Val[0], pow._Val[1] *= x._Val[1]; if(u >>= 1) x._Val[0] *= x._Val[0], x._Val[1] *= x._Val[1]; else break; } } _Dcomplex p = {pow._Val[0], pow._Val[1]}; return p; } #else 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; } #endif 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; #ifdef _MSC_VER _Fcomplex zdotc = {0.0, 0.0}; if (incx == 1 && incy == 1) { for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */ zdotc._Val[0] += conjf(Cf(&x[i]))._Val[0] * Cf(&y[i])._Val[0]; zdotc._Val[1] += conjf(Cf(&x[i]))._Val[1] * Cf(&y[i])._Val[1]; } } else { for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */ zdotc._Val[0] += conjf(Cf(&x[i*incx]))._Val[0] * Cf(&y[i*incy])._Val[0]; zdotc._Val[1] += conjf(Cf(&x[i*incx]))._Val[1] * Cf(&y[i*incy])._Val[1]; } } pCf(z) = zdotc; } #else _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; } #endif static inline void zdotc_(doublecomplex *z, integer *n_, doublecomplex *x, integer *incx_, doublecomplex *y, integer *incy_) { integer n = *n_, incx = *incx_, incy = *incy_, i; #ifdef _MSC_VER _Dcomplex zdotc = {0.0, 0.0}; if (incx == 1 && incy == 1) { for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */ zdotc._Val[0] += conj(Cd(&x[i]))._Val[0] * Cd(&y[i])._Val[0]; zdotc._Val[1] += conj(Cd(&x[i]))._Val[1] * Cd(&y[i])._Val[1]; } } else { for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */ zdotc._Val[0] += conj(Cd(&x[i*incx]))._Val[0] * Cd(&y[i*incy])._Val[0]; zdotc._Val[1] += conj(Cd(&x[i*incx]))._Val[1] * Cd(&y[i*incy])._Val[1]; } } pCd(z) = zdotc; } #else _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; } #endif static inline void cdotu_(complex *z, integer *n_, complex *x, integer *incx_, complex *y, integer *incy_) { integer n = *n_, incx = *incx_, incy = *incy_, i; #ifdef _MSC_VER _Fcomplex zdotc = {0.0, 0.0}; if (incx == 1 && incy == 1) { for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */ zdotc._Val[0] += Cf(&x[i])._Val[0] * Cf(&y[i])._Val[0]; zdotc._Val[1] += Cf(&x[i])._Val[1] * Cf(&y[i])._Val[1]; } } else { for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */ zdotc._Val[0] += Cf(&x[i*incx])._Val[0] * Cf(&y[i*incy])._Val[0]; zdotc._Val[1] += Cf(&x[i*incx])._Val[1] * Cf(&y[i*incy])._Val[1]; } } pCf(z) = zdotc; } #else _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; } #endif static inline void zdotu_(doublecomplex *z, integer *n_, doublecomplex *x, integer *incx_, doublecomplex *y, integer *incy_) { integer n = *n_, incx = *incx_, incy = *incy_, i; #ifdef _MSC_VER _Dcomplex zdotc = {0.0, 0.0}; if (incx == 1 && incy == 1) { for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */ zdotc._Val[0] += Cd(&x[i])._Val[0] * Cd(&y[i])._Val[0]; zdotc._Val[1] += Cd(&x[i])._Val[1] * Cd(&y[i])._Val[1]; } } else { for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */ zdotc._Val[0] += Cd(&x[i*incx])._Val[0] * Cd(&y[i*incy])._Val[0]; zdotc._Val[1] += Cd(&x[i*incx])._Val[1] * Cd(&y[i*incy])._Val[1]; } } pCd(z) = zdotc; } #else _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; /* > \brief \b CPBTRS */ /* =========== DOCUMENTATION =========== */ /* Online html documentation available at */ /* http://www.netlib.org/lapack/explore-html/ */ /* > \htmlonly */ /* > Download CPBTRS + dependencies */ /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/cpbtrs. f"> */ /* > [TGZ]</a> */ /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/cpbtrs. f"> */ /* > [ZIP]</a> */ /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cpbtrs. f"> */ /* > [TXT]</a> */ /* > \endhtmlonly */ /* Definition: */ /* =========== */ /* SUBROUTINE CPBTRS( UPLO, N, KD, NRHS, AB, LDAB, B, LDB, INFO ) */ /* CHARACTER UPLO */ /* INTEGER INFO, KD, LDAB, LDB, N, NRHS */ /* COMPLEX AB( LDAB, * ), B( LDB, * ) */ /* > \par Purpose: */ /* ============= */ /* > */ /* > \verbatim */ /* > */ /* > CPBTRS solves a system of linear equations A*X = B with a Hermitian */ /* > positive definite band matrix A using the Cholesky factorization */ /* > A = U**H*U or A = L*L**H computed by CPBTRF. */ /* > \endverbatim */ /* Arguments: */ /* ========== */ /* > \param[in] UPLO */ /* > \verbatim */ /* > UPLO is CHARACTER*1 */ /* > = 'U': Upper triangular factor stored in AB; */ /* > = 'L': Lower triangular factor stored in AB. */ /* > \endverbatim */ /* > */ /* > \param[in] N */ /* > \verbatim */ /* > N is INTEGER */ /* > The order of the matrix A. N >= 0. */ /* > \endverbatim */ /* > */ /* > \param[in] KD */ /* > \verbatim */ /* > KD is INTEGER */ /* > The number of superdiagonals of the matrix A if UPLO = 'U', */ /* > or the number of subdiagonals if UPLO = 'L'. KD >= 0. */ /* > \endverbatim */ /* > */ /* > \param[in] NRHS */ /* > \verbatim */ /* > NRHS is INTEGER */ /* > The number of right hand sides, i.e., the number of columns */ /* > of the matrix B. NRHS >= 0. */ /* > \endverbatim */ /* > */ /* > \param[in] AB */ /* > \verbatim */ /* > AB is COMPLEX array, dimension (LDAB,N) */ /* > The triangular factor U or L from the Cholesky factorization */ /* > A = U**H*U or A = L*L**H of the band matrix A, stored in the */ /* > first KD+1 rows of the array. The j-th column of U or L is */ /* > stored in the j-th column of the array AB as follows: */ /* > if UPLO ='U', AB(kd+1+i-j,j) = U(i,j) for f2cmax(1,j-kd)<=i<=j; */ /* > if UPLO ='L', AB(1+i-j,j) = L(i,j) for j<=i<=f2cmin(n,j+kd). */ /* > \endverbatim */ /* > */ /* > \param[in] LDAB */ /* > \verbatim */ /* > LDAB is INTEGER */ /* > The leading dimension of the array AB. LDAB >= KD+1. */ /* > \endverbatim */ /* > */ /* > \param[in,out] B */ /* > \verbatim */ /* > B is COMPLEX array, dimension (LDB,NRHS) */ /* > On entry, the right hand side matrix B. */ /* > On exit, the solution matrix X. */ /* > \endverbatim */ /* > */ /* > \param[in] LDB */ /* > \verbatim */ /* > LDB is INTEGER */ /* > The leading dimension of the array B. LDB >= f2cmax(1,N). */ /* > \endverbatim */ /* > */ /* > \param[out] INFO */ /* > \verbatim */ /* > INFO is INTEGER */ /* > = 0: successful exit */ /* > < 0: if INFO = -i, the i-th argument had an illegal value */ /* > \endverbatim */ /* Authors: */ /* ======== */ /* > \author Univ. of Tennessee */ /* > \author Univ. of California Berkeley */ /* > \author Univ. of Colorado Denver */ /* > \author NAG Ltd. */ /* > \date December 2016 */ /* > \ingroup complexOTHERcomputational */ /* ===================================================================== */ /* Subroutine */ int cpbtrs_(char *uplo, integer *n, integer *kd, integer * nrhs, complex *ab, integer *ldab, complex *b, integer *ldb, integer * info) { /* System generated locals */ integer ab_dim1, ab_offset, b_dim1, b_offset, i__1; /* Local variables */ integer j; extern logical lsame_(char *, char *); extern /* Subroutine */ int ctbsv_(char *, char *, char *, integer *, integer *, complex *, integer *, complex *, integer *); logical upper; extern /* Subroutine */ int xerbla_(char *, integer *, ftnlen); /* -- LAPACK computational routine (version 3.7.0) -- */ /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */ /* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */ /* December 2016 */ /* ===================================================================== */ /* Test the input parameters. */ /* Parameter adjustments */ ab_dim1 = *ldab; ab_offset = 1 + ab_dim1 * 1; ab -= ab_offset; b_dim1 = *ldb; b_offset = 1 + b_dim1 * 1; b -= b_offset; /* Function Body */ *info = 0; upper = lsame_(uplo, "U"); if (! upper && ! lsame_(uplo, "L")) { *info = -1; } else if (*n < 0) { *info = -2; } else if (*kd < 0) { *info = -3; } else if (*nrhs < 0) { *info = -4; } else if (*ldab < *kd + 1) { *info = -6; } else if (*ldb < f2cmax(1,*n)) { *info = -8; } if (*info != 0) { i__1 = -(*info); xerbla_("CPBTRS", &i__1, (ftnlen)6); return 0; } /* Quick return if possible */ if (*n == 0 || *nrhs == 0) { return 0; } if (upper) { /* Solve A*X = B where A = U**H *U. */ i__1 = *nrhs; for (j = 1; j <= i__1; ++j) { /* Solve U**H *X = B, overwriting B with X. */ ctbsv_("Upper", "Conjugate transpose", "Non-unit", n, kd, &ab[ ab_offset], ldab, &b[j * b_dim1 + 1], &c__1); /* Solve U*X = B, overwriting B with X. */ ctbsv_("Upper", "No transpose", "Non-unit", n, kd, &ab[ab_offset], ldab, &b[j * b_dim1 + 1], &c__1); /* L10: */ } } else { /* Solve A*X = B where A = L*L**H. */ i__1 = *nrhs; for (j = 1; j <= i__1; ++j) { /* Solve L*X = B, overwriting B with X. */ ctbsv_("Lower", "No transpose", "Non-unit", n, kd, &ab[ab_offset], ldab, &b[j * b_dim1 + 1], &c__1); /* Solve L**H *X = B, overwriting B with X. */ ctbsv_("Lower", "Conjugate transpose", "Non-unit", n, kd, &ab[ ab_offset], ldab, &b[j * b_dim1 + 1], &c__1); /* L20: */ } } return 0; /* End of CPBTRS */ } /* cpbtrs_ */
the_stack_data/161081205.c
/* Exercise 1 - Calculations Write a C program to input marks of two subjects. Calculate and print the average of the two marks. */ #include <stdio.h> int main() { float mark1; float mark2; float sum,avg; printf("Enter Mark of Subject 1: "); scanf("%f", &mark1); printf("Enter Mark of Subject 2: "); scanf("%f", &mark2); sum = mark1 + mark2; avg = sum / 2.0; printf("Average is: %.2f", avg); return 0; }
the_stack_data/75089.c
/* { dg-do compile } */ /* { dg-require-effective-target int128 } */ /* { dg-options "-O2" } */ __uint128_t t1 (__uint128_t a) { return a << 8; } __uint128_t t2 (__uint128_t a) { return a >> 8; } /* { dg-final { scan-assembler-not "pslldq" } } */ /* { dg-final { scan-assembler-not "psrldq" } } */
the_stack_data/72013402.c
#include <stdio.h> int main() { int x, y, z; scanf("%1d%1d%1d", &x, &y, &z); printf("%d%d%d\n", z, y, x); return 0; }
the_stack_data/155268.c
#include <stdio.h> #include <string.h> #include <stdlib.h> int main(){ char *s=malloc(100000),*t=malloc(100000); int i,j,ns,nt; while(scanf(" %s %s",s,t)!=EOF){ nt=strlen(t); for(i=0,j=0;i<nt;i++) s[j]==t[i]?j++:1; printf("%s\n",j==strlen(s)?"Yes":"No"); } return 0; }
the_stack_data/13955.c
/* * Copyright (c) 2017 - present Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ #include <pthread.h> int normal_life_ok(pthread_mutex_t* m) { if (pthread_mutex_init(m, 0)) return 0; if (pthread_mutex_lock(m)) return 0; if (pthread_mutex_unlock(m)) return 0; if (pthread_mutex_destroy(m)) return 0; return 1; } int normal_ok2() { pthread_mutex_t m; normal_life_ok(&m); } void FN_double_lock_bad(pthread_mutex_t* m) { pthread_mutex_lock(m); pthread_mutex_lock(m); } void double_lock_uninit_bad() { pthread_mutex_t m; FN_double_lock_bad(&m); } void double_lock_bad2() { pthread_mutex_t m; pthread_mutex_init(&m, 0); FN_double_lock_bad(&m); } void double_unlock_bad(pthread_mutex_t* m) { pthread_mutex_unlock(m); pthread_mutex_unlock(m); } void double_unlock_bad2() { pthread_mutex_t m; pthread_mutex_init(&m, 0); pthread_mutex_lock(&m); double_unlock_bad(&m); } void double_init_bad(pthread_mutex_t* m) { pthread_mutex_init(m, 0); pthread_mutex_init(m, 0); } // Already reported in double_init_bad void double_init_ok() { pthread_mutex_t m; double_init_bad(&m); }
the_stack_data/4556.c
#include <stdio.h> #include <fcntl.h> #include <unistd.h> #include <stdlib.h> int main(int argc, char *argv[]) { int fd; int sz; char *c = (char *) calloc(20, sizeof(char)); printf("Hello, IS-105 students!\n"); printf("%s\n", argv[0]); printf("%s\n", argv[1]); // fil som jeg skal lese fra printf("%s\n", argv[2]); // fil som jeg skal skrive til fd = open(argv[1], O_RDONLY); if (fd < 0) { perror("feil med lesing av filen"); exit(1); } sz = read(fd, c, 10); printf("Gjorde kall til read(%d, c, 10). Returnerte at %d bytes ble lest.\n", fd, sz); c[sz] = '\0'; printf("Bytes som ble lest var: %s\n", c); close(fd); fd = open(argv[2], O_WRONLY | O_CREAT | O_TRUNC, 0644); if (fd < 0) { perror("feil med skriving av filen"); exit(1); } sz = write(fd, c, strlen(c)); close(fd); }
the_stack_data/6386806.c
#include<stdio.h> #include<ctype.h> int fnd(char c){ char v[]={'a', 'e', 'i', 'o', 'u'}; for(int i=0; i<5; i++) if (tolower(c) == v[i]) return 1; return 0; } int main(){ int n; scanf("%d", &n); char s[n], c[n]; scanf("%[^\n]%*c", s); for(int i=0, j=0; i<n; i++) { if(s[i] == 0) { c[j] = s[i]; j++; } } printf("%s", c); }