file
stringlengths
18
26
data
stringlengths
3
1.04M
the_stack_data/137657.c
#include <stdio.h> void swap(int *x, int *y) { if (*x > *y) { int temp = *x; *x = *y; *y = temp; } } void sort3(int *x, int *y, int *z) { swap(x, y); swap(x, z); swap(y, z); } int main(int argc, char const *argv[]) { puts("输入三个整数,程序将按从小到大的顺序排列。"); int i, j, k; scanf("%d", &i); scanf("%d", &j); scanf("%d", &k); sort3(&i, &j, &k); printf("%4d%4d%4d\n", i, j, k); return 0; }
the_stack_data/110111.c
/* --Welcome-- ----SMALL USER MANAGEMENT PROGRAM--- */ //Header file section #include<stdio.h> #include<stdlib.h> #include<string.h> //Function declaration int date,month,year,id,id1; char name[200],sex[200]; int choice,age,currentyear = 2020; float salary,salary1; char name1[200]; char sex1[200]; int date1,month1,year1,age1,choice1,main_exit; //Main function int main() { int result; char password[200]; int main_exit1; char code[200] = "pavan"; //Password for this program is "pavan" printf("\n\n\n\t\t ENTER THE PASSWORD FOR LOGIN TO PAVANS PROGRAMM: "); scanf(" %s",password); result = strcmp(password,code); //check whether given password to unlock program is right or wrong if (result == 0) { printf(" \n\t PASSWORD MATCH!"); printf(" \n\t PLEASE WAIT LOADING: "); //code for loading sensation for(int i=0;i<=6;i++) { printf("."); for(int il = 0;il<99999999;il++); } disply(); } else { system("cls"); printf(" \n\n\tINVALID PASSWORD"); printf(" \n\n\t\tenter 0 to login again and 1 to exit: "); scanf(" %d",&main_exit1); if( main_exit1 == 0) { system("cls"); main(); } if( main_exit1 == 1) { close(); } } return 0; } //display function void disply(void) { system("cls"); printf("\n\n\n\n\n \t\t\t\t welcome to small user management program"); printf("\n\n\t\t\t\t\t\t by pavan"); printf("\n\t\t1. add employee\n\t\t2. update existing employee details\n\t\t3. view employee list\n\t\t4. delete employee\n\t\t5. exit\n\n"); scanf(" %d",&choice); //menu for update,add view and delete data of the employees switch(choice) { case 1: addemployee();//function calling break; case 2: updateemployee(); break; case 3: employeedetails(); break; case 4: de();//delete employee break; case 5: close(); break; default : printf("enter a valid choice!"); printf(" \n\nenter 0 to go to main menu and 1 to exit: "); scanf(" %d",&main_exit); //exiting the program if (main_exit == 0) { disply(); } if (main_exit == 1) { close(); } } return; } //Function to add employee details void addemployee(void) /*if we use void addemployee() we need to inilaize void addemployee(); at top or if we use void addemloyee(void) we noneed to inilaize */ { int idd; int it1; system("cls"); int main_exit2; printf(" \n\tenter employee ID: "); scanf(" %d",&idd); if(2>1) { FILE *zz; zz = fopen("employeedetails.txt","r"); // scanning employee id, employee name , epmloyee sex,date,month,year age and salary while(fscanf(zz,"%d %s %s %d/%d/%d %d %f",&id,name,sex,&date,&month,&year,&age,&salary)!=EOF) { if(idd == id) { printf(" \n\tthe employee id already in use"); fclose(zz);//calling closing function printf(" \n\n\tto view employee list enter 0 and 1 to goto main menu : "); scanf(" %d",&it1); if(it1 == 0) { employeedetails(); } if(it1 == 1) { disply(); } } } } printf(" \n\twhat is your name: ");//scanning employee name scanf(" %s",name); printf(" \n\tenter your sex: ");//scanning employee sex scanf(" %s",sex); printf("\n\tenter your date of birth (in the format dd/mm/yyyy): ");//employee data birth scanf(" %d/%d/%d",&date,&month,&year); age = currentyear - year; printf("\n\t enter the employee salary: ");//scanning employee salary scanf(" %f",&salary); printf("\n\n\t\t EMPLOYEE REGISTRED SUCESFULLY"); puts("\n\n"); FILE * empdet; empdet = fopen("employeedetails.txt","a+"); fprintf(empdet," \n%d %s %s %d/%d/%d %d %f",idd,name,sex,date,month,year,age,salary); fclose(empdet); printf(" \n\tenter '1' to main menu and '0' to exit: "); scanf(" %d",&main_exit2); if (main_exit2 == 1 ) { system("cls"); disply(); } if (main_exit2 == 0) { close(); } return; } //function to update salary void updateemployee(void) { system("cls"); int main_exit3; FILE * updtemp; FILE * temp; updtemp = fopen("employeedetails.txt","r"); temp = fopen("employeetemp.txt","a+"); printf("\n\t enter the employee id that you want to change information "); printf("\n\n\t if you do not remember you id enter '0' to view employee list: "); scanf(" %d",&id1); if (id1 == 0) { employeedetails(); } while(fscanf(updtemp,"%d %s %s %d/%d/%d %d %f",&id,name,sex,&date,&month,&year,&age,&salary)!=EOF)//scanning employee details to be updated { if(id1 == id) { printf("\n\nwhich information do you want to change:"); printf("\n\n\t 1.NAME \n\n\t 2. SEX \n\n\t 3. DATE OF BIRTH \n\n\t 4. SALARY\n"); scanf(" %d",&choice1); //to update name if(choice1 == 1) { printf(" \nENTER THE NEW NAME: "); scanf(" %s",&name1); fprintf(temp," \n%d %s %s %d/%d/%d %d %f",id,name1,sex,date,month,year,age,salary); } //to update sex if (choice1 == 2) { printf(" \nENTER THE SEX: "); scanf(" %s",&sex1); fprintf(temp," \n%d %s %s %d/%d/%d %d %f",id,name,sex1,date,month,year,age,salary); } // to update date of birth if ( choice1 == 3) { printf(" \nENTER THE DATE OF BIRTH (DD/MM/YYYY): "); scanf(" %d/%d/%d",&date1,&month1,&year1); age1 = currentyear - year1; fprintf(temp," \n%d %s %s %d/%d/%d %d %f",id,name,sex,date1,month1,year1,age1,salary); } //to update salary if (choice1 == 4) { printf(" \nENTER THE NEW SALARY: "); scanf(" %f",&salary1); fprintf(temp," \n%d %s %s %d/%d/%d %d %f",id,name,sex,date,month,year,age,salary1); } }else { fprintf(temp," \n%d %s %s %d/%d/%d %d %f",id,name,sex,date,month,year,age,salary); } } fclose(updtemp); fclose(temp); remove("employeedetails.txt"); rename("employeetemp.txt","employeedetails.txt");//changing file name printf(" \n\n\t CHANGED SUCSESFULLY"); puts("\n\n"); printf(" \n\tenter '1' to main menu \n\n enter '2' to go back and '0' to exit: "); scanf(" %d",&main_exit3); if (main_exit3 == 1 ) { system("cls"); disply(); } if (main_exit3 == 2) { updateemployee(); } if (main_exit3 == 0) { close(); } } //to display employee details void employeedetails(void) { system("cls"); int main_exit4; FILE* rempdet; rempdet = fopen("employeedetails.txt","r"); printf("\n | ID | NAME | SEX | DATE OF BIRTH | AGE | SALARY |"); while(fscanf(rempdet,"%d %s %s %d/%d/%d %d %f",&id,name,sex,&date,&month,&year,&age,&salary)!= EOF) { printf("\n %d",id); printf(" %s",name); printf(" %s",sex); printf(" %d/%d/%d",date,month,year); printf(" %d",age); printf(" %.2f",salary); } fclose(rempdet); puts("\n\n"); printf(" \n\tenter '1' to main menu and '0' to exit: "); scanf(" %d",&main_exit4); if (main_exit4 == 1 ) { system("cls"); disply(); } if (main_exit4 == 0) { close(); } return; } //closing function void close(void) { printf("\n\n\n\n\t\tThis is c mini employee manegement program by pavan!"); puts("\n\n"); getch(); return; } //function to delete employee data void de(void) { int del; FILE *empdel; FILE * emptemp; int main_exit5; empdel = fopen("employeedetails.txt","r"); emptemp = fopen("employeetemp.txt","a+"); printf("\t enter the employee id to delete "); printf("\n\nif you do not remember you id enter '0' to view employee list: "); scanf(" %d",&del); if (del == 0) { employeedetails(); } while(fscanf(empdel,"%d %s %s %d/%d/%d %d %f",&id,name,sex,&date,&month,&year,&age,&salary)!=EOF) { if (del != id) { fprintf(emptemp," \n%d %s %s %d/%d/%d %d %f",id,name,sex,date,month,year,age,salary); } } fclose(empdel); fclose(emptemp); remove("employeedetails.txt"); rename("employeetemp.txt","employeedetails.txt"); printf(" \n\n\t REMOVED SUCSESFULLY"); puts("\n\n"); printf(" \n\tenter '1' to main menu and '0' to exit: "); scanf(" %d",&main_exit5); if (main_exit5 == 1 ) { system("cls"); disply(); } if (main_exit5 == 0) { close(); } return; }
the_stack_data/1106882.c
#include <netinet/in.h> #include <sys/types.h> #include <sys/socket.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define BUFSIZE 2048 #define PORT 50000 // Can be "*" or "192.168.56.10" #define LISTEN "192.168.56.10" int main(int argc, char **argv) { int sockfd; struct sockaddr_in srvaddr; struct sockaddr_in cliaddr; socklen_t clilen; char buf[BUFSIZE]; ssize_t nbytes; /* * Création du socket */ sockfd = socket(AF_INET, SOCK_DGRAM, 0); if (sockfd < 0) { perror("socket"); exit(EXIT_FAILURE); } /* * Affectation du nom au socket * on définit l'adresse et le port d'écoute */ srvaddr.sin_family = AF_INET; srvaddr.sin_port = htons(PORT); if ( strncmp(LISTEN, "*", sizeof("*")) == 0) { srvaddr.sin_addr.s_addr = htonl(INADDR_ANY); } else { srvaddr.sin_addr.s_addr = inet_addr(LISTEN); } if (bind(sockfd, (struct sockaddr *)&srvaddr, sizeof srvaddr) < 0) { perror("bind"); exit(EXIT_FAILURE); } /* * Attente de la réception d'un message */ bzero(buf, BUFSIZE); bzero((char *) &cliaddr, sizeof cliaddr); clilen = sizeof cliaddr; nbytes = recvfrom(sockfd, buf, BUFSIZE, 0, (struct sockaddr *) &cliaddr, &clilen); printf("%ld bytes received\n", (long)nbytes); printf("From:\t %s:%hu\n", inet_ntoa(cliaddr.sin_addr), ntohs(cliaddr.sin_port)); printf("Data:\t %s\n", buf); /* * Envoi de la réponse au client */ nbytes = sendto(sockfd, buf, nbytes, 0, (struct sockaddr*) &cliaddr, clilen); if (nbytes < 0) { perror("sendto"); exit(EXIT_FAILURE); } printf("%d bytes sent\n", nbytes); /* * Fermeture du socket */ if (close(sockfd) < 0) { perror("close"); } return 0; }
the_stack_data/14201046.c
#ifdef CONFIG_CPU_SUP_INTEL /* * Not sure about some of these */ static const u64 p6_perfmon_event_map[] = { [PERF_COUNT_HW_CPU_CYCLES] = 0x0079, [PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0, [PERF_COUNT_HW_CACHE_REFERENCES] = 0x0f2e, [PERF_COUNT_HW_CACHE_MISSES] = 0x012e, [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c4, [PERF_COUNT_HW_BRANCH_MISSES] = 0x00c5, [PERF_COUNT_HW_BUS_CYCLES] = 0x0062, }; static u64 p6_pmu_event_map(int hw_event) { return p6_perfmon_event_map[hw_event]; } /* * Event setting that is specified not to count anything. * We use this to effectively disable a counter. * * L2_RQSTS with 0 MESI unit mask. */ #define P6_NOP_EVENT 0x0000002EULL static u64 p6_pmu_raw_event(u64 hw_event) { #define P6_EVNTSEL_EVENT_MASK 0x000000FFULL #define P6_EVNTSEL_UNIT_MASK 0x0000FF00ULL #define P6_EVNTSEL_EDGE_MASK 0x00040000ULL #define P6_EVNTSEL_INV_MASK 0x00800000ULL #define P6_EVNTSEL_REG_MASK 0xFF000000ULL #define P6_EVNTSEL_MASK \ (P6_EVNTSEL_EVENT_MASK | \ P6_EVNTSEL_UNIT_MASK | \ P6_EVNTSEL_EDGE_MASK | \ P6_EVNTSEL_INV_MASK | \ P6_EVNTSEL_REG_MASK) return hw_event & P6_EVNTSEL_MASK; } static struct event_constraint p6_event_constraints[] = { INTEL_EVENT_CONSTRAINT(0xc1, 0x1), /* FLOPS */ INTEL_EVENT_CONSTRAINT(0x10, 0x1), /* FP_COMP_OPS_EXE */ INTEL_EVENT_CONSTRAINT(0x11, 0x1), /* FP_ASSIST */ INTEL_EVENT_CONSTRAINT(0x12, 0x2), /* MUL */ INTEL_EVENT_CONSTRAINT(0x13, 0x2), /* DIV */ INTEL_EVENT_CONSTRAINT(0x14, 0x1), /* CYCLES_DIV_BUSY */ EVENT_CONSTRAINT_END }; static void p6_pmu_disable_all(void) { u64 val; /* p6 only has one enable register */ rdmsrl(MSR_P6_EVNTSEL0, val); val &= ~ARCH_PERFMON_EVENTSEL_ENABLE; wrmsrl(MSR_P6_EVNTSEL0, val); } static void p6_pmu_enable_all(void) { unsigned long val; /* p6 only has one enable register */ rdmsrl(MSR_P6_EVNTSEL0, val); val |= ARCH_PERFMON_EVENTSEL_ENABLE; wrmsrl(MSR_P6_EVNTSEL0, val); } static inline void p6_pmu_disable_event(struct perf_event *event) { struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); struct hw_perf_event *hwc = &event->hw; u64 val = P6_NOP_EVENT; if (cpuc->enabled) val |= ARCH_PERFMON_EVENTSEL_ENABLE; (void)checking_wrmsrl(hwc->config_base + hwc->idx, val); } static void p6_pmu_enable_event(struct perf_event *event) { struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); struct hw_perf_event *hwc = &event->hw; u64 val; val = hwc->config; if (cpuc->enabled) val |= ARCH_PERFMON_EVENTSEL_ENABLE; (void)checking_wrmsrl(hwc->config_base + hwc->idx, val); } static __initconst struct x86_pmu p6_pmu = { .name = "p6", .handle_irq = x86_pmu_handle_irq, .disable_all = p6_pmu_disable_all, .enable_all = p6_pmu_enable_all, .enable = p6_pmu_enable_event, .disable = p6_pmu_disable_event, .eventsel = MSR_P6_EVNTSEL0, .perfctr = MSR_P6_PERFCTR0, .event_map = p6_pmu_event_map, .raw_event = p6_pmu_raw_event, .max_events = ARRAY_SIZE(p6_perfmon_event_map), .apic = 1, .max_period = (1ULL << 31) - 1, .version = 0, .num_events = 2, /* * Events have 40 bits implemented. However they are designed such * that bits [32-39] are sign extensions of bit 31. As such the * effective width of a event for P6-like PMU is 32 bits only. * * See IA-32 Intel Architecture Software developer manual Vol 3B */ .event_bits = 32, .event_mask = (1ULL << 32) - 1, .get_event_constraints = x86_get_event_constraints, .event_constraints = p6_event_constraints, }; static __init int p6_pmu_init(void) { switch (boot_cpu_data.x86_model) { case 1: case 3: /* Pentium Pro */ case 5: case 6: /* Pentium II */ case 7: case 8: case 11: /* Pentium III */ case 9: case 13: /* Pentium M */ break; default: pr_cont("unsupported p6 CPU model %d ", boot_cpu_data.x86_model); return -ENODEV; } x86_pmu = p6_pmu; return 0; } #endif /* CONFIG_CPU_SUP_INTEL */
the_stack_data/28262392.c
/* DataToC output of file <thumb_png> */ extern int datatoc_thumb_png_size; extern char datatoc_thumb_png[]; int datatoc_thumb_png_size = 6754; char datatoc_thumb_png[] = { 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 96, 0, 0, 0, 96, 8, 2, 0, 0, 0,109,250,224,111, 0, 0, 0, 4,103, 65, 77, 65, 0, 0,177,143, 11,252, 97, 5, 0, 0, 0, 9,112, 72, 89,115, 0, 0, 13,215, 0, 0, 13,215, 1, 66, 40,155,120, 0, 0, 0, 7,116, 73, 77, 69, 7,218, 7, 19, 0, 34, 14,207,247,218,175, 0, 0, 0, 6, 98, 75, 71, 68, 0, 0, 0, 0, 0, 0,249, 67,187,127, 0, 0, 25,223, 73, 68, 65, 84,120,218,237,124, 91,140,101,231, 89,229,250,190,127,239,125,234,126,237,170,234, 46,183,221, 55,187,219,118,219,224,132,216,206,152,196, 33,204, 76, 76, 50,147, 40,177,132, 24,105, 6, 17,241, 52, 8, 9,144, 64, 72,243, 48,154, 65, 26,205, 19, 18, 72,240, 54,243,198, 3,210, 32,132, 4, 15, 8, 41, 92, 34, 16, 3, 74, 2, 56, 33,196, 38,182,219, 78,183,221,238,110,219, 93,118,187,221, 93, 85,231,255, 22, 15,255,253, 84,181, 19,199,118,220, 70,125,108,117, 87,159, 58,103,215,217,107,127,151,181,214,247,237,146, 71, 31,125, 20,183, 30, 55,126,116, 0, 46, 95,190,188,181,181, 37, 34,183,224,200, 15,146, 75, 75, 75,203,203,203, 29,128,173,173,173,179,103,207,222, 2,101,239, 99,121,121, 89, 1,220,138,157,125, 31, 1, 22,189, 5,196, 91, 63,110, 1,116, 11,160, 91, 0,221, 2,232, 22, 64,183, 0,186, 5,208,219,126,204,173,108,168,235,110, 1,116,195,199, 27,175, 94,248,244, 47,255,214, 71, 30,255,185,197,131, 71,110,102,128,220,145, 35, 71,182,182,182, 94,123,237,181, 31,252,207, 62,247,143,127,243,169, 95,248,245, 31,254,137,159, 94,185,227,228,165,231,254,105,251,234,235, 55, 21, 52,139,139,139, 75, 75, 75,239,103, 13,186,246,218, 43,127,240,107, 63, 61,183,122,240,129,207,252,204,127,253,157, 39, 62,243, 43,191, 61, 53,183,244,175, 54,130,156,234,161,149,197,213,133,185,190,239,118,199,222,204,190, 71,140, 46, 62,251,205,123,126,236,113,136,172,159,184,255,225,159,250,197,209,236,194,155, 91, 47, 95,189,124,241, 38,137,160,119, 7, 32, 1, 62,247,232,199,127,241,179,143,158, 60,180,124,124, 99,245,232,218,242,226,220,236,214,155,215,183,119,119,191,235,123, 95, 61,247,244,181, 43,151,143, 63,244,239,195, 63, 55,239,121,240,158, 79,124,225,182,211, 15, 93,185,244,226,235, 23,207,253, 43, 1,104,212,247,191,249,203,191,180,121,224,192,149,203,231,119,118,199,163, 78,215, 23,102,238,187, 99, 99,117, 97,225,133, 87,182,198,254,187, 68,211, 75,255,252, 15, 7,142,156, 58,112,199, 41,136, 0,232,250,209,202,237,119,221,255,216,127, 62,254,224,191, 59,255,228,215,222,220,186,244,129, 7,104,125,105,225,103, 30,251,196,194,250,209,157,215, 47, 92,187,126,109,215,219,216,140,228,226,244,112,255,145, 67,139,179, 51,215,119,199,111, 92,223,190,241, 1,248,204,223,254,201,157, 31,253,244,236,242, 58,200, 0, 19,200,249,181,205, 15,125,246,103,215, 79,220,127,253,245, 87,175, 93,185,236,119,182, 63,168, 69,250,209,251,239,180,237,171,162,221,193, 59,238, 93, 91,154, 95,156,157,158, 25, 13,157,115,170, 34,130, 59, 15,174, 60,246,192,201,199, 62,124,247,242,252,236,141,142, 48,222,190,254,255,254,219,227, 87, 94,126, 17,217,156, 18, 1, 9,224,174, 71, 62,243,147,255,251,247, 14,159,254,232, 7,152, 7, 61,114,234,136,223,189,182,243,230,214,252,129,195,135, 14, 29, 93,158,159,153,159,153,154, 25, 13, 67,215,117,170, 2, 12,157, 59,188, 60,255,249, 7,239,125,248,212,177, 27, 29,228,234,229, 75,127,248,191,126,118,247,250,155, 33,124,234,111, 61,245,151,127,244,204,223,254,201, 7,181,139,173, 46,204,125,241,199, 31, 26,186,190,235, 71, 93, 63, 51,154,158,247,111, 94,222,222,217, 54, 51,134,115, 37, 73,134,200, 88, 91,152,190,243,208,218,181,157,221,173,171,215,246, 30,234,202,165, 23,198,219,215,142,125,228,223,198, 8, 2, 32,242,157, 39,254,234,247,255,251,127,250, 0,215,160, 71,238, 57,246,241,123,143, 15,125,239,186,145, 58, 55, 76,207,247, 93,191,123,245,213,237,177, 55, 26, 32, 1, 36, 11,167, 76, 12,157,222,126, 96,233,208,242,226,133,215,222,216, 25,143, 39,142,246,226,183,190,218, 79,205,220,118,250,225, 80,140,182,206, 63,247, 7,255,243,191,188, 47, 28,242, 93,171, 65,143,158, 62,209, 59, 85,215,153,223, 29,239,188, 57,222,185, 54,187,178,121,112,243,216,202,252,244,236,212,104,106,212, 79,141,250,169,161, 31,156, 83, 81, 85, 21,209,206,233,193,229,185,207, 63,116,239,241,131, 7,116,143, 35,254, 23,255,231,127,156,249,202,159, 66,196,143,119,190,244,219,191,250,254, 54,251,119, 10,208,252,204,244,198,210,156,186, 94,187, 17, 32,126,119,199,239, 94,163, 31, 47,172, 29,217, 88,219, 12,213,122,106,232,167, 70,195,212, 48, 12, 93, 0, 73, 68, 68, 69, 58,167, 31,191,251,200,163,167, 79, 44,207,207, 76, 28,246,143,127,227, 23,182, 94, 60,243,229,255,251,107,207,126,229, 75,239, 47, 93,124,167,122,122,117,126,102,105,118,186,235, 71,218, 13,234,122, 8,108,188,237,181, 83, 55,172, 30, 60,182,125,253,170,247, 70, 66, 0, 17,136, 64,119,101,103,236, 3,209, 54, 64, 21, 71,215, 22, 55,150,102,191,241,157,139,255,244,157,243, 69,202,190,124,254,119,127,229,179, 87, 94,126,241,125,231,211,239, 20,160,163,235, 43,203,179,179,221, 48,173,221,148,235,134, 48, 42,177,241, 14, 68,186,169,185,181, 67,199,119,119,119, 60, 13, 32, 0,129,168,136,136,236,122, 63,246, 6, 51, 2, 20,153,238,251, 7, 79,108, 30,219, 88,253,210, 19, 79,109,239, 68,242,125, 51,160,243, 78, 1, 18,145, 59, 15,173,141, 70, 35,215, 77,185,110,208,126, 16, 40, 0,210, 56,222, 21,215, 79,205,173,172, 31, 60,226,237, 89, 18, 16, 72,122,232, 88, 4, 99, 0, 70, 51,163,170,144, 88,155, 27,125,225,225,251,254,254,204,139, 79,157,187,112,243,136,213,119, 8, 16, 30,251,240,221,253,104, 78,251, 41,237, 70,234,122, 81, 23,240, 33,141,244, 2,157, 94, 92, 95, 31,111,143,253, 89,130, 33,209, 20, 80, 17,129,136,140,199, 94,198,176,208,227, 0, 76,117,250,240,137,195, 39, 55,215,255,236, 27,223,190,122,237,250, 7, 30,160,199,255,205, 3,135,214, 15,186,169,121,215, 79,107, 55,168,235, 68, 21, 34,176, 16, 25, 30,164,115,253,236,210,161,245,157,109,242,130,132, 48,138,177, 4, 17,168,120,120,120,111, 0, 8, 24,224, 28, 86,103,135, 47, 60,116,239, 95, 62,249,252,217, 75,175, 70, 46,245, 65, 4,232,244,209,195, 63,255,248,103,135,185,149,110,152,114,253,148,118,189,170, 19, 17, 64, 40, 6,161, 82,105, 30,102,174, 31,205,175,222,102,230,201, 75, 40,121, 6, 17, 81, 21,217,149, 93,248,177,121,111, 80, 17, 51,138,160, 83,124,226,222, 99,207, 93, 92,250,250,243, 47,109,189,113,245, 3, 6,208, 48, 12, 63,245,227, 31,251,226,103, 62,189,180,180, 44,174,119,218,137,115,170, 78, 84, 3, 45, 4, 13, 98, 48, 8,196,224,149,236, 71, 51,243, 43,155,102, 99,227,229,236,144, 72, 40, 99, 1,178, 49, 4,230, 73, 81,152, 17, 34, 74, 28, 91, 95,222, 92, 89,248,234,153,243, 79,159,123,233,102, 7,104,102, 52, 44,204,206,220,117,248,208, 79,126,242, 99, 15,156, 60, 57, 63,191,226,134, 25,215,247,162, 42, 68,234, 78, 0,132, 52,161,144, 18, 90,151,144,116, 42,116,253,212,236,194,242, 33,243, 30,160,198,174, 47, 34, 99, 5, 2, 45, 18, 25,195,123,111, 80, 85, 35, 5, 32, 56,213,185,143,223,117,248,240,234,226,255,255,214,179,185,193,221, 68, 0,173, 47, 45,252,200, 93, 71,143,111,110,252,208,241,163,119, 31, 61, 50, 51, 61,215, 77,205,185,209, 76, 55, 76,171,235, 68,156,136, 8, 8,128,136,194, 11, 20,154, 1, 16, 33,132, 80,138, 57,168, 41,187,126,106,126, 97,121,195,104, 0, 40, 34,216, 77, 48, 65, 83,105,218,245,222,123,131,192,140, 96,148,244, 71, 87,230,215, 30,188,239,239,207,188,240,244,139, 23,111, 22,128, 62,245,225,211,159,123,228, 71, 78,220,182, 57, 59, 61, 59,140,102,220, 48,229,250,145,118,163,110,152,118,161, 30, 59, 39,162, 10, 33,136,136,142,209, 40, 48, 40, 96,132, 40,132,148,240,140, 19, 82,186,126,152, 94, 92, 88, 26,135,174,165,165,241, 3,226, 19, 88, 50,198,120,108,132,146,102, 36, 33, 32, 57, 59,114,143,220,117,251,209,141,213, 47,127,227,219,187,123, 20,220,123, 10, 16,107,221,112,100,227,192, 23, 62,246,145, 31,251,161,211, 51, 51, 51,226, 6, 17,231,250,145,106,167,221, 16,254,119, 93,175,206,137, 58, 17, 85,213,236,110, 9,141, 80, 40,105, 16,144,177, 95, 9, 2, 18, 38,128,168, 40, 93, 63, 76, 47,206,251,221,212,158, 36,134, 14, 68, 33,128,104,120,143,247,226,205,171, 26, 25, 45, 52, 82,157, 28, 94,154,253,252, 71,239,251,242, 63, 62,115,233,181, 55, 72,254, 96, 0,146,177,183, 19,155, 27,159,126,232, 67, 15,223,123,242,206,219, 54,213, 13,226, 28,160,234, 58,113,157,170, 83,215,171,115, 18,254, 20, 69, 44, 55, 8, 38, 70, 22, 18, 65,183,139,128, 20,196,204, 3, 68,132,194, 0, 19, 85, 68, 53, 98, 52,142,244, 58,101, 89,202,181,128,150,236,138,135,121,241, 48,192, 24,152, 38, 8,206, 14,238,177, 7, 78, 61,253,210, 43,127,247,236,185, 31, 64, 85,234,140,252,226, 79,124,242, 83,247,223, 51, 61, 51,171,154,206, 95, 21, 18, 27,147,104,248,194,137,104, 66, 1,164,133,216, 96,236, 91, 32, 72, 18, 68,248,163, 14,204,128, 32, 40, 8,213,156, 78,187, 97,152, 89,156, 51,111, 41, 10, 2, 62, 85,210,137, 64,116, 44,187,244, 32,163, 40, 33, 33, 66,162, 83,158, 60,184,186,185,186,240,167, 79, 60,253, 94,147,128, 14,228,194,252,226,194,210,129,208,117,163, 96,210,208, 88, 20,170, 42, 42,226, 32, 26,194,159, 68,228, 42, 34, 20, 75, 17, 20, 30, 70, 35,104,241,138,151, 20, 96, 59, 1,129,136,115,110, 24,166, 23,230, 45, 66, 20, 47, 74, 66, 9,145, 47, 1, 2,241,222, 67,189, 89, 54, 97, 65,136,114,126,232, 62,247,224,221, 95,123,246,252, 83,231, 46,140,189,127, 15,139,180,104,231,186,129,249,195,171, 32,102,145, 70,106,163, 34, 18,172, 65,147, 28, 17,225,196,165, 54, 76,136,160, 49,200,228, 35, 50,182, 56, 0,194, 10, 36,137,185, 54, 53, 55,103, 62, 36, 80, 48, 16, 53, 6, 15,116,236, 67,222,170,200,238,216, 35, 37,154, 37, 91,159,160, 66, 62,114,252,208,145, 3, 75,127,253,212,115, 91,111,188,249,222, 1,164,218,245, 68, 78, 23, 64, 84,162,233, 25,163, 61,207, 26, 16,203, 65,112, 81,165,173,148, 33,112,140, 12,161, 20, 96, 50,132,104,138, 72, 49,209, 68, 17,117,210,245,195,104,102, 46, 74, 49,148,159, 23,165,136,100,159, 68,198,240,198,177,249,208, 55, 13, 16,104,200,186,181,249,233,255,248,225, 83, 95, 61,243,210,147,103,207,191, 71, 0, 57,117, 93, 57,211, 28, 28, 37,119, 2,118, 6, 19, 19, 17, 34, 58,204, 1, 52,201, 85, 40,154,171, 1, 38,144, 52, 31, 48,170,162, 9,128,228, 47, 84, 28,221, 48, 12, 83,179,180,120,164,221,177,198,144, 21,149,134, 8,136, 55, 0,193, 75, 82,130,130, 88,147, 68,156,211, 7,143, 31, 90,153,155,254,187,103,206, 94,127, 87, 43,119, 23,146, 10,174, 67,236,187, 44, 40, 17,137, 4,134,144,153,140, 21, 73, 54, 79,122, 31,195,139, 72,130,150, 18,205,104,198,128, 87,124, 65,129, 42,128,164,174,239,251, 97, 38, 61, 43, 41,146, 66, 85,210, 20, 75,241,127, 15,111, 22,102,145,132, 9,132,164, 64, 84,112, 98,125,113,121,102,244,196,243, 23,206,189,252,234,187,156, 98, 78,156, 87,203,245, 34,164, 78, 98, 32, 49,193,132,160,196,228,170,106,111, 58, 45, 70, 30, 13,230,118,102, 0, 19, 58, 33,239, 44,125,183, 2, 72, 20,162,234,250,206,249,233,161, 39, 1,236,164,252, 70,238,104,137, 15,120,137, 27,204,102, 52,129,122, 90,200,116, 17, 81,232,234,252,244,199, 78,221,254,245,153, 81,237, 79,190, 99,128, 32,226, 84, 77,114, 8,128,177, 77,197,188, 16,137,127,208,192,146, 75, 37,249, 98,224, 4,136, 45, 97,101, 9, 42, 99,244,124,234, 26, 30, 98, 10,150,106,143,115,174,167, 77, 13, 29,130,115, 52,206, 92, 51,154, 40,154,200,150,248,192, 37,225, 65, 23,133,155,196, 26, 74, 12,189,251,208,145,141,197,153,169,127, 56,243,194,181,237,157,119, 67,106,136,136, 56,137,234, 50, 10,171,152, 83, 34,169, 30, 39, 90, 24, 62, 72, 64, 42, 60, 99, 12,113, 20,206, 25, 41,126, 74, 52,165,246, 79,146,102,104, 95, 38,129,222, 64, 32,170,162,189, 3,187, 24, 98, 33,116, 52,215,160,240,207, 16, 71, 34, 99,120, 49, 63,182,144,233, 97,170, 20,251,140,115,122, 98,125,105,117,126,230,171,207,188,240,210,171, 91,239,188, 6, 37, 26, 75,129,146, 70,149,106, 68, 94,138,106,140, 40, 41, 89, 66, 51, 74,242, 16, 5, 52, 75,113, 72, 75,175, 76,149, 40,132, 76, 42, 73,233, 16, 41, 12, 99,235, 23,165,116, 78,141, 29, 1, 96,156, 74, 82, 67, 32, 75,179, 53,129,247,222,155, 65, 45, 16,165,132,145, 10,150,166,135, 79,158, 62,246,215, 79,191,240,252,249,139,239, 44,130,162, 30, 16,130, 18,162, 21, 34,128,133,234, 19,148, 55,131,101, 74, 41,115,225,112,241,145,207,214,104, 49,205,218,103,170, 10,109,168, 75, 82,236,110, 70, 24,179,122, 23,168,106,231, 72, 58, 18,144,113, 34, 78, 16,116,177, 96, 71, 56,199,226, 99, 63,241,102, 16, 53,163, 68, 50, 41,162,193,163,228,143,222,117,219,234,194,236, 19, 79, 63,239,189,125,223, 0, 73,162, 32, 8, 24,197, 43,106, 49,201,104,161,233,179, 92,239,144,131, 65,193,147, 18,176, 64,170, 56, 25, 20, 51,128, 1, 20, 34, 48,236,240, 93,143, 2, 83,148, 39,146, 11, 30, 40, 42,206,105, 71, 18,142,137,113,132, 86,149,131, 72, 4, 2, 31,171,183, 23,120, 19, 49,111, 76,123, 15, 34,128, 42, 96, 60,185,182,184, 60,115,247,159, 63,241,228,247,184,214,181,159,221, 33, 72, 20, 57, 82, 94, 38,169,153,227, 37,138,197,100,251,164, 84,130, 0, 22, 24,118,100,137, 76,148,218, 8,138,121,166, 20,203,168, 5,128, 44,214,163,132,145, 16, 22, 63,140, 18, 38,226, 84, 73,210,101,114, 22,175, 35,210,140, 36, 54,187,113, 76,190,177, 7,132, 62,162, 16,243, 64, 84, 0, 91,159,237,255,195,131,167,255,226,155,103,174,188,241,198,247, 85,164, 33,150,172,175, 20, 28,130, 18,175,146,171,142, 36,166,196,200,146, 42,238,131, 10, 29, 50,122, 32, 21, 58, 57,197, 82,203,247, 33,221, 64, 3, 12, 86, 83, 36, 9,226, 95,169,142, 36,181,226,176, 0,186, 76, 78, 37,196,143, 71,164,221,240, 18,132, 91,196, 91, 68,168, 42,128,206,245,248,228,253,199,255,230,201,231, 47, 94,126,237,237, 70, 80, 99,172, 20,125,205,172, 11, 40, 64,178, 65,131,207,103, 13,217,203,106, 62, 54,248,136,145, 20, 46, 80,148, 71,128, 73, 42,188, 34, 15,200,177, 90, 36, 62, 52,197, 81,112, 14,170,207,216,197,120,218,205, 53,194, 98,222, 69, 67,210,104,146, 85,158, 10,160, 58, 3,251,209,123,142,124,229,153, 23,207, 93,120,249,237, 59,138, 65, 65,132,118,222,168,111, 6,104, 68, 4,102, 16,132,154, 4, 41,151, 59,159, 92, 44,219,153, 56,166, 34,149,180,171,197, 87,195, 24, 83,204,199,166, 6, 31, 89,194,158,209, 91, 48, 22, 40, 80, 17,138,168,138,131, 35, 61,186, 14, 69,218,165, 23, 39, 1, 52,134, 0,222, 91,224, 34,209,169,232, 84, 65,255,209, 19,155,223,156,158,250,214,115,231,222, 38, 64, 12,244,167, 17, 19,251, 60, 98, 55, 67, 69,167, 89, 17,168, 74, 81, 32, 55,114, 86,184, 89,218, 24,178,244,124,133, 96,171, 97,114, 21, 12,130, 67, 69,160, 10,146,138, 14, 14, 48,118,221,168,177,158,242,204, 13,144, 80,137,204,155, 5, 33,160,113,238,230,232,253,169,141,165,157,157,157,103,206, 95,194,119,179, 37, 27, 79, 90, 50, 44,169, 98,239,247,246,214, 14,107,227, 94, 74,248, 68,116, 10, 50,129, 91,163, 82,173,165, 66, 91, 52,195,204,138,162, 75, 71, 77,227,106, 42,132,158, 26, 50,142,222,169, 2, 96,231, 88,191,114, 12, 56, 15, 56,241,209, 9, 0,224,141, 70, 38,127,137, 42, 50, 56,189,239,240,129,165,217,153,175,125,251,185,183, 99,218,135,118,139,212, 85, 16, 89, 78,134,161,250, 43, 67, 80, 48,144,164, 68,242,177, 36, 31, 52,215,168,216,206,173, 2, 63, 89, 33,165,251,236,115,101,146,245, 33,138, 72,237, 85, 65, 74,167, 74, 23, 91,157,192, 3,128,135,208,242,141,184, 2, 17,248,113,196,136, 10,165,130,176,193,185,219,150,166,199,199, 15,127,253,204, 11,111, 97,111,119,123, 12,191,208,107, 41,146, 42,134, 32,233, 47,166,254, 95,171, 84,230,215,228, 60, 99,198, 4,108, 74, 84,173,227, 51,123,200,123,122, 81,213,132,159,205,252, 76,110,157, 65,142,249,160, 75, 85, 97, 70, 21, 66, 29, 9, 7, 84,121, 47,128,152,161,115, 34, 34,230, 33,192, 24, 99,139, 44, 73, 85, 72,161, 74,239,220,237, 43,243,219,187, 27, 79,158,125,233,187, 70, 80,102, 56,229,196,227,186, 65, 58, 45, 73, 24, 36,159,140,217, 1,149, 12, 73,219, 12,179,241, 90, 9,138,137,126, 87,146, 83, 8, 75,102, 92, 5,162, 52, 14, 76,242, 58, 37,194, 4,146, 78,149,132, 3,251, 64,153, 74,117, 76, 37,149,144, 14,226, 65,210,147,130,208, 25,161,194, 94,229,196,218,162,115,238,155,207,189,240, 86, 0, 21,226, 23,129,201, 74, 61, 21, 90, 22,155, 57, 48,192,137,186,148, 16,182, 10, 41, 10, 98, 20,150,196,201,121,137, 26,184,246,120, 21, 64,161,163, 50, 11, 34, 97,112, 25,178,127, 30,189, 97, 21, 71,165, 75, 29,193, 19,112,128, 31, 83, 58,167, 85,118, 8,198,227,177,177,188,133,236, 29,111, 95,154,125,253,192,242,217,151, 47,191, 5, 15, 98,195, 17,195,206,101,106,206,241,195,198, 17, 97, 80,240,185, 90, 39, 18, 76, 54,207,212,229,137, 37, 65,115,163, 67,211,200,234,162,159,107, 59, 38,250, 89,179,152,148,220,222, 80,191,197, 66,251, 23, 82,233, 92,184, 84,241, 71,122, 75, 24,121, 66, 65, 71,250, 32,170,157, 10,161,158,236, 59,158,218, 92,221, 30,251,139, 91,175,223,120, 71, 49,126, 40, 9, 65,148, 44,179,160,144, 91,102,195,156,138, 41, 16,136, 9, 27,172, 86, 37,172,131, 40, 35, 80, 93,151,183,104,181,220,243, 77,169,115, 77, 80, 22,215,226,104, 68, 85,195,160, 74, 92,248,194,169, 83,233,156,118, 78,157,168,115,174,119,154, 74,184, 56,213,206,169, 83, 29,117,122,223,225, 3, 43, 11,179, 55, 0, 40,250, 24, 32, 76, 66,190,101, 8,104,209,184, 65, 37,202, 83, 12, 84, 78,107,186,242, 81, 94,212,116, 32, 89,210, 81,169, 21,246, 84,167, 88, 98,145,209,103,217, 11, 90,162, 72,251,236,113, 73,218,128, 80,129, 19,113, 78,156,115,249,228,195,226,168,115,174,235,212,169, 56,231,250,206,169, 72, 32,231,157,104,152,142, 14,157,222,119,219,218,244, 48, 76, 2, 20, 91, 71,134, 4, 85, 56, 48,243,106,146, 81,197,166,169,106, 69, 2, 83, 18, 73,197,121, 74,174, 37,244, 18, 80, 86, 61, 99,165,173,229,164,201, 65,179, 31, 80,123, 2,170, 20,168,108, 27,169,168,170,184, 48,210, 83,117, 26,199,123, 49,142, 52, 62,153,169,131, 83,237, 84,156,186,161,119,247,221,177, 49,244, 93, 14,253, 42,130, 42, 2, 23,174, 85, 96, 43,169,190,160, 20,216,170,185, 35,182, 51, 68,106, 83,113,232,204,143, 83,108, 89, 33,236, 25,190, 82,173, 27,112,195, 83, 82,120,151, 52,164, 96,159, 40,170, 26, 92,222,132, 12,143,160, 78, 84,157,138,134, 1, 78, 78,189,228, 45, 1, 80,167, 1,190,249, 81,119,106,115, 45,163,210, 85,109,136,249,182,129,228,123,149,231, 26,149, 96, 81, 52,153, 81, 64, 16,150,134, 95, 69,112,165,122, 79, 80,144, 36, 88, 50, 91, 65, 18,150, 11, 87,246,193,147,101, 18,113,178, 82,244,173,110,112,156,196,134,146,105,132, 68,105,226, 68, 8,168, 8, 85, 72,177,232, 86,154, 19,161,115, 70, 26, 37,148,243, 49, 77, 84,196,196,137,116,226,172,227,234,236,232,216,198,202, 46, 41, 34, 93,250,177,198,200, 67, 34,169, 17, 6,141, 26, 79, 61, 54, 49,214,140,192, 66,183, 99, 19, 11,193,204,206,211, 11,155, 64, 13,245, 0,191,170, 95,168, 52, 8,193,102, 26, 64,214,140,187, 29,106, 75,171,196, 26, 90,169,162, 97,142, 39, 26, 54,113, 40, 97,244, 65,113,170,193,199, 84, 53,101, 28, 28,137,168, 83,118, 84, 83,183,185, 60,119, 69,166, 83,138,133,159,108,100,219,155, 82, 5, 98,118,198,136,130, 96,242,168, 9,154, 72,169,195,101,242,197,154, 59,213, 10, 54, 44,145,167,137,134,196,100, 74,253,179,146, 27,194,186,206, 99,130, 14,236,211,242, 18, 33,137, 83, 69,166,153, 90,189, 24,169, 97, 78,162, 42, 78,196,197,123,182,210,200, 91, 68, 68,156,211,222,233,194,244, 80,215,160,232,156,238,177,147,227,160, 20,128,133,204,138, 9, 21,123, 82, 72,206,240, 45, 97,177,130,114,246,196,204,138, 13,219, 88, 30,225,248,177,116, 5, 7, 62,113, 39, 41,202, 31,117, 78,213, 6, 2,177, 39,219,138,235, 81,153, 31, 42,162, 72, 51,147,224, 10,168, 6,111, 32, 98,164,234,202, 16, 55,110, 7,132,117, 22,166, 8,202,189,171,105, 76, 33,124,170,147, 76, 89,147, 74, 81, 6, 84, 80,193, 81,250, 87,112,197, 82,133,142, 1, 97,197,223,136,189, 43,229, 94,158, 85,112, 98,120, 84,120, 99,235,109,112, 79,107,171,110,198, 67, 61, 27, 23, 13,149, 74,210, 45, 71, 85, 80,105,252, 79, 84, 69,195, 6,144,194, 69,106, 21,218,124,221, 83, 18, 46,169,154,132, 20,179,116, 66, 54,129, 99,213,170,210, 0,195,114,128, 36, 90, 20, 23, 25,242,132,158, 82, 70, 99,181,222, 72,199,157,136,152, 70, 35, 87,204,113, 95,249,151,105,100,181, 13,209,174,178,229,173,140, 60,184,133,198,192, 81,173,182,126,234,223, 64, 85,182, 85,162, 79, 90,237,175, 68,229, 69, 10,125,122,129,229,137, 96,174, 46,197,240, 66,162,145,176,194,130, 10,195, 52,214, 35, 49,214, 84,170,200,215, 60,248, 70,115, 41,138,181,196,188, 57,208,172, 69,188,197, 93, 1,217,111,132, 22,110, 89, 77, 37,211,200, 68, 85,157, 74,166,233,147, 41, 38, 85,125,173,174,104,197,104,170, 64,200,207, 32,167, 97,172, 51, 70, 18,102,176, 52,252,201, 33, 83,188,125,212, 30, 74,117,230,137,154,178,217, 3, 64, 38, 93,133,126,223,200,242,156, 88, 24,152,136, 46, 97,189,235,159,247,217, 43,200, 84, 85, 53,206, 39,181,162,137,147,177, 3,180, 75, 26,197, 24, 37,170,177, 95, 84, 35,153, 34,193, 0,171,230, 63, 62, 78,240,152, 92,103, 43,123, 14,213,206, 67, 81, 18,147, 78,109, 91, 32,203,182,141,212, 41,150, 13,219, 54, 65, 39,210,149,168, 38,179,113,151,173, 12, 5,243,216, 86,160, 97,167, 52,168,249,192,249,164,152,194,141, 85,220,162, 99, 68, 26,130,230,150, 23, 23, 19, 44,122, 29,121, 65, 1, 97,202,156, 7,170,209,171,175,246, 63, 64, 48, 44,225, 69,166, 84, 89,109,141,144,173, 76, 77,182,121,219,120, 17,117,130, 86,140,128,251,201,183, 70,251,150,165,173, 52, 29,148, 58,130,154,193,150,165, 89, 85,134,192,210, 21,141,161, 1,132, 40, 72,118, 50, 76, 96,225, 6, 22,137, 3, 47,171,135, 25,233, 32,121,253, 37,234,182,120, 98, 73,154, 74,110, 91, 20, 67,170,236,144,170, 59,214,187,162, 45,243,223,195, 5,178,116, 78,236,180,149,111,108,176, 74,136,164,219,144, 16, 86, 36, 74, 4,165, 1,121,200, 50,139,196, 47, 71,138,193,164,170,194,217,126,143,120, 49,242,160,192,166, 82,217, 14,231, 24,166,131, 44,238, 79,233, 94, 77,196, 22,150, 93,169,192,170,205, 87,149, 18, 13, 11,202, 49,100,173, 70,174,144,146,202,165,137,161,202, 61,115, 27,169,141,130, 88,207, 37,123,210,140,151, 55, 12,145, 43,116,146,248,102, 44,186,193,195, 79,104, 6,242,205,178,161, 16,199,237,177, 54,199, 69,142, 18,134,165,238,131,197,220, 64,227, 86, 2,233,221, 81, 14, 91,222, 70, 34,154,165, 26,162, 38,237,147, 53,167,221,241,170, 33,106,168,129,220,136,102, 38, 17,211, 53,196,221, 76, 18, 71,206,180, 48, 57,233,105, 98,131,128,142,193, 72,196,132, 74,159,186,192, 81,102,202, 52,210, 51, 86,159,220, 17,163,216,171, 48, 42, 46, 73, 57, 87,105, 86, 64,107,186, 56,241,150, 42, 2,171,205,183,214,147,202, 28, 74,246, 55, 79, 88, 99,147, 57, 65,151,181, 42,205, 75,252, 76, 22,239,210, 49,139,243, 5, 75,203, 62, 22,178,198,104,165, 6,131, 4,125, 10,110, 95,202, 13, 98, 16, 33,199, 96,107,154,228,120,178, 90,174,137, 88,236,128, 18,230,209,105,171,180,134,168, 6,171,181,224,154,105, 92,163, 2,163,113, 83,124,153, 27, 85,240,102, 72, 16,107, 80, 89,237,137, 13,136,102,217,220,136,129, 99,102,121, 31,168,204, 79,243, 10, 75, 89,139,178,208,212,210, 59, 83,145, 10,152,195,234, 41, 89, 80,129,201,235,159,104, 69, 13,160,169,174, 91,181, 10,218,248, 87,245, 16,188,142,178, 50,226,176, 92, 97,246,207,177,201,233, 24,235,185, 88,209, 80,150, 75, 94,234,235,136,193, 18,126,174,229,220, 41,237,169,249,194,210, 58,135,249,108,119,148,125,199, 16,136,169, 20, 89, 52,252, 99, 68,229, 78, 95,218, 79,177, 66, 88,187,121,181,100,101,229,249,161, 18, 36, 19,147,201,232,224,160,161, 74,172,119,158,246, 51, 46,187,116, 11,129,183,236, 99,228,195,160, 44,214,149, 78,148,229, 66, 40,198,176,106,209,215,104,169,103, 37,246,204,252, 27, 60,172,157, 31, 81,226,206, 21, 37, 68,107,195,109,154,236, 40,207,149, 5,219,172,142, 81,185, 44,104, 11, 58,106, 1, 68,105,134, 6,104, 14,139, 27,186, 40, 93,113,233,172,217,158,139,161,159,168, 94, 30,162, 87, 11,100,177,151, 37,117,149,105,161, 15, 81,150, 55, 21, 43,127,160,152,245,197,214,167,177,246,139,128, 9,207,191,221, 9,109,109,135,186,196,231,195, 54, 29,171, 48, 3,107,122, 90, 59,224,229,196,224, 38,143, 10,211, 92, 44,153,126,185,103,148, 13,222,202, 42,181,178, 54,159, 75,175,165,101, 58,171, 87,164,210, 86, 89,101, 3, 86,244,151, 77, 59,171,170, 98,202,232, 84,107,144,230,223,121,236, 26, 94, 67, 78,212,157, 61, 51,168,230,246,135,102, 56, 85, 91,120,141,121,208,140,237,216,206,230, 9,243,180, 56, 19,143, 12,200, 88,204, 13,230,126, 20, 78,220,167,212,243,177, 30,103,116,232, 11, 58,220,103,144,214,176,185,214,118, 76,212, 40, 57,220,113,132, 27,122,172, 37,154,103,141, 55,157, 45,184,102,111,139,100, 61,198,101, 51,132, 1,172,145,111,147, 8,197,155, 46,218, 20, 11, 85,167,250, 89,141, 61, 22,208,105,228, 85,106,106,117,221,241,200, 47,171, 62, 99, 46,186, 21, 51,206,249, 83, 91,144,160,148,190, 30,159,147,154,221,160, 97,242,181,178,175,164, 47,107, 71,164,102,225,147,211, 91,178, 58,102,213, 23,235, 42,196,106,244, 28,101, 65,158, 39, 88,188, 58,176,252,155, 20,194,125, 5,129, 58,150,253,203,232,195,250,102, 77,179,174, 29,173, 34, 98,221,123, 38,157, 84, 86, 81, 22, 62,176,228, 59,128, 51,231,170,181, 44,247,161, 3,205, 79,105,253,128,218,226,171, 37,238,158,173,158,170,132,181, 82,163,241,107,242,126,111,165, 75,107,226, 19, 99,199,194,190,106,212,171,137,227, 89,186, 68, 22, 71,143, 12,119,195,199, 30,137,196,183, 66, 23, 8, 35,221,116,155, 67,108, 11,101,102, 34,129,100,212,217, 82, 34,181, 41,234,133, 74, 89,123, 39, 54,200,184,214,220,208,158,122,205,164,225, 12,249,170,133, 20,139,191, 70, 34,189,165,150,242, 89,103, 86,238, 79, 85,149,145,248, 78,206,195,230,228, 89, 45, 83, 35,111,228,215,205,154,213, 32,133, 85,175, 73, 16, 52, 33, 82, 15,137, 38,236,176, 73, 35,171, 4,114,161, 16, 50, 17, 80,237, 39,168, 15,202,186, 72, 75,188, 41,180, 30,236,161, 22, 86,153, 1,177,146, 87,169,229,199, 58, 29,213, 71,156,158, 53, 41, 94,247,209,106, 11, 41,189, 72, 98,184, 17,205, 34, 68,186,143,195, 80, 43,220,216,215, 38,183,105, 91,131, 19,121,119, 32,154,164, 86,221, 80,155,142,209,204,161,246,152, 36, 69,242, 37,187,195, 82,147,138,126, 24,146, 4, 77,178, 43,173,205, 39,138, 28,122, 75,115,191, 92, 77, 76, 80,251, 24,237,223,101, 90,132,230,198,205, 61, 50,162,216,102, 33, 63,243,168,105,162,161, 84,166, 62, 27,247,182, 28, 58,134, 82,154, 82,161,158,222,212,150,114, 46,243,249, 64, 93, 58,152,175, 12, 8, 75,194, 59,139, 47,219,199,211, 40,164,145,205, 86,107, 94, 1, 97,190, 3,177, 9,230,118, 36, 82,215,111,169,103,221, 5,238,104,149,215,128, 23,129, 52,185, 38, 82, 51,160,156,170, 72, 91, 79,156, 52,141, 56, 57, 40,173,168, 84,237, 7, 5,226, 87,187, 28,123,155, 87,254, 34,129,229,155,147,177, 56,131,176,166,195, 84, 54, 85,201,139,182, 16, 84,191,185,161,209, 89,137, 40, 38, 5, 23,151,179,227, 28,160,109,246,237, 92, 37,239,218,192,154, 89, 64,238,234,146, 73, 44, 48, 89,149, 42, 10, 90, 69,144,192,135,110, 1,180,134, 97, 20,104,209,244, 17, 36,165, 14,171,106, 25,243, 46, 88,189, 6, 82, 51,161,118,253,177,208,253, 80, 81,130,249,106, 13,155,102,101,249,212, 51,105,150, 59,158,130, 28, 40,139,198,153,128,179, 29,182,229, 79, 83,166,152,213,154, 91,178,255, 43,174, 86,187, 78,157, 8,158,190,248, 74,216,217, 33,171,101,151,154,112, 52,167,105,123, 12,245,246, 9,214,207,212,205,179, 62,205,218, 1,172,150,146,234,239,150, 38, 93, 49,164, 9,170, 89, 21,183,124, 4,171,216,105, 99,137, 38,160,140,194,240,251,105,168,201,121,112, 4, 40,102, 26,111, 48, 49, 51,239,134, 0,144,124,251,194, 43,255,252,210, 43,251, 90, 36, 55,255, 67,190,159,119,200,247,248,180,144,255, 2,129, 8,204, 72, 71,143, 37,161, 0, 0, 0, 0, 73, 69, 78, 68,174, 66, 96,130,0 };
the_stack_data/111299.c
#include <stdio.h> int main () { int a = 3 * 5 - 2 + 1; printf("a = %d\n", a); int b = 4 + a * 3; printf("b = %d\n", b); int c = a * b * - 1; printf("c = %d\n", c); int d = c * a + b * c - a; printf("d = %d\n", d); int e = a - b + c * -d; printf("e = %d\n", e); return 0; }
the_stack_data/19728.c
// KASAN: use-after-free Read in erspan_build_header // https://syzkaller.appspot.com/bug?id=685f059b7e5b6ed6e4dd6c92755ea01acedf5302 // status:fixed // autogenerated by syzkaller (http://github.com/google/syzkaller) #define _GNU_SOURCE #include <arpa/inet.h> #include <endian.h> #include <errno.h> #include <errno.h> #include <fcntl.h> #include <linux/if.h> #include <linux/if_ether.h> #include <linux/if_tun.h> #include <linux/ip.h> #include <linux/tcp.h> #include <net/if_arp.h> #include <sched.h> #include <signal.h> #include <stdarg.h> #include <stdarg.h> #include <stdbool.h> #include <stdbool.h> #include <stdio.h> #include <stdio.h> #include <stdlib.h> #include <sys/ioctl.h> #include <sys/prctl.h> #include <sys/resource.h> #include <sys/stat.h> #include <sys/syscall.h> #include <sys/time.h> #include <sys/uio.h> #include <sys/wait.h> #include <unistd.h> __attribute__((noreturn)) static void doexit(int status) { volatile unsigned i; syscall(__NR_exit_group, status); for (i = 0;; i++) { } } #include <stdint.h> #include <string.h> const int kFailStatus = 67; const int kRetryStatus = 69; static void fail(const char* msg, ...) { int e = errno; va_list args; va_start(args, msg); vfprintf(stderr, msg, args); va_end(args); fprintf(stderr, " (errno %d)\n", e); doexit((e == ENOMEM || e == EAGAIN) ? kRetryStatus : kFailStatus); } #define BITMASK_LEN(type, bf_len) (type)((1ull << (bf_len)) - 1) #define BITMASK_LEN_OFF(type, bf_off, bf_len) \ (type)(BITMASK_LEN(type, (bf_len)) << (bf_off)) #define STORE_BY_BITMASK(type, addr, val, bf_off, bf_len) \ if ((bf_off) == 0 && (bf_len) == 0) { \ *(type*)(addr) = (type)(val); \ } else { \ type new_val = *(type*)(addr); \ new_val &= ~BITMASK_LEN_OFF(type, (bf_off), (bf_len)); \ new_val |= ((type)(val)&BITMASK_LEN(type, (bf_len))) << (bf_off); \ *(type*)(addr) = new_val; \ } struct csum_inet { uint32_t acc; }; static void csum_inet_init(struct csum_inet* csum) { csum->acc = 0; } static void csum_inet_update(struct csum_inet* csum, const uint8_t* data, size_t length) { if (length == 0) return; size_t i; for (i = 0; i < length - 1; i += 2) csum->acc += *(uint16_t*)&data[i]; if (length & 1) csum->acc += (uint16_t)data[length - 1]; while (csum->acc > 0xffff) csum->acc = (csum->acc & 0xffff) + (csum->acc >> 16); } static uint16_t csum_inet_digest(struct csum_inet* csum) { return ~csum->acc; } static void vsnprintf_check(char* str, size_t size, const char* format, va_list args) { int rv; rv = vsnprintf(str, size, format, args); if (rv < 0) fail("tun: snprintf failed"); if ((size_t)rv >= size) fail("tun: string '%s...' doesn't fit into buffer", str); } static void snprintf_check(char* str, size_t size, const char* format, ...) { va_list args; va_start(args, format); vsnprintf_check(str, size, format, args); va_end(args); } #define COMMAND_MAX_LEN 128 #define PATH_PREFIX \ "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin " #define PATH_PREFIX_LEN (sizeof(PATH_PREFIX) - 1) static void execute_command(bool panic, const char* format, ...) { va_list args; char command[PATH_PREFIX_LEN + COMMAND_MAX_LEN]; int rv; va_start(args, format); memcpy(command, PATH_PREFIX, PATH_PREFIX_LEN); vsnprintf_check(command + PATH_PREFIX_LEN, COMMAND_MAX_LEN, format, args); rv = system(command); if (panic && rv != 0) fail("tun: command \"%s\" failed with code %d", &command[0], rv); va_end(args); } static int tunfd = -1; static int tun_frags_enabled; #define SYZ_TUN_MAX_PACKET_SIZE 1000 #define MAX_PIDS 32 #define ADDR_MAX_LEN 32 #define LOCAL_MAC "aa:aa:aa:aa:%02hx:aa" #define REMOTE_MAC "aa:aa:aa:aa:%02hx:bb" #define LOCAL_IPV4 "172.20.%d.170" #define REMOTE_IPV4 "172.20.%d.187" #define LOCAL_IPV6 "fe80::%02hx:aa" #define REMOTE_IPV6 "fe80::%02hx:bb" #define IFF_NAPI 0x0010 #define IFF_NAPI_FRAGS 0x0020 static void initialize_tun(int id) { if (id >= MAX_PIDS) fail("tun: no more than %d executors", MAX_PIDS); 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; } char iface[IFNAMSIZ]; snprintf_check(iface, sizeof(iface), "syz%d", id); struct ifreq ifr; memset(&ifr, 0, sizeof(ifr)); strncpy(ifr.ifr_name, iface, IFNAMSIZ); ifr.ifr_flags = IFF_TAP | IFF_NO_PI | IFF_NAPI | IFF_NAPI_FRAGS; if (ioctl(tunfd, TUNSETIFF, (void*)&ifr) < 0) { ifr.ifr_flags = IFF_TAP | IFF_NO_PI; if (ioctl(tunfd, TUNSETIFF, (void*)&ifr) < 0) fail("tun: ioctl(TUNSETIFF) failed"); } if (ioctl(tunfd, TUNGETIFF, (void*)&ifr) < 0) fail("tun: ioctl(TUNGETIFF) failed"); tun_frags_enabled = (ifr.ifr_flags & IFF_NAPI_FRAGS) != 0; char local_mac[ADDR_MAX_LEN]; snprintf_check(local_mac, sizeof(local_mac), LOCAL_MAC, id); char remote_mac[ADDR_MAX_LEN]; snprintf_check(remote_mac, sizeof(remote_mac), REMOTE_MAC, id); char local_ipv4[ADDR_MAX_LEN]; snprintf_check(local_ipv4, sizeof(local_ipv4), LOCAL_IPV4, id); char remote_ipv4[ADDR_MAX_LEN]; snprintf_check(remote_ipv4, sizeof(remote_ipv4), REMOTE_IPV4, id); char local_ipv6[ADDR_MAX_LEN]; snprintf_check(local_ipv6, sizeof(local_ipv6), LOCAL_IPV6, id); char remote_ipv6[ADDR_MAX_LEN]; snprintf_check(remote_ipv6, sizeof(remote_ipv6), REMOTE_IPV6, id); execute_command(1, "sysctl -w net.ipv6.conf.%s.accept_dad=0", iface); execute_command(1, "sysctl -w net.ipv6.conf.%s.router_solicitations=0", iface); execute_command(1, "ip link set dev %s address %s", iface, local_mac); execute_command(1, "ip addr add %s/24 dev %s", local_ipv4, iface); execute_command(1, "ip -6 addr add %s/120 dev %s", local_ipv6, iface); execute_command(1, "ip neigh add %s lladdr %s dev %s nud permanent", remote_ipv4, remote_mac, iface); execute_command(1, "ip -6 neigh add %s lladdr %s dev %s nud permanent", remote_ipv6, remote_mac, iface); execute_command(1, "ip link set dev %s up", iface); } #define DEV_IPV4 "172.20.%d.%d" #define DEV_IPV6 "fe80::%02hx:%02hx" #define DEV_MAC "aa:aa:aa:aa:%02hx:%02hx" static void initialize_netdevices(int id) { unsigned i; const char* devtypes[] = {"ip6gretap", "bridge", "vcan"}; const char* devnames[] = {"lo", "sit0", "bridge0", "vcan0", "tunl0", "gre0", "gretap0", "ip_vti0", "ip6_vti0", "ip6tnl0", "ip6gre0", "ip6gretap0", "erspan0"}; for (i = 0; i < sizeof(devtypes) / (sizeof(devtypes[0])); i++) execute_command(0, "ip link add dev %s0 type %s", devtypes[i], devtypes[i]); for (i = 0; i < sizeof(devnames) / (sizeof(devnames[0])); i++) { char addr[ADDR_MAX_LEN]; snprintf_check(addr, sizeof(addr), DEV_IPV4, id, id + 10); execute_command(0, "ip -4 addr add %s/24 dev %s", addr, devnames[i]); snprintf_check(addr, sizeof(addr), DEV_IPV6, id, id + 10); execute_command(0, "ip -6 addr add %s/120 dev %s", addr, devnames[i]); snprintf_check(addr, sizeof(addr), DEV_MAC, id, id + 10); execute_command(0, "ip link set dev %s address %s", devnames[i], addr); execute_command(0, "ip link set dev %s up", devnames[i]); } } static void setup_tun(uint64_t pid, bool enable_tun) { if (enable_tun) { initialize_tun(pid); initialize_netdevices(pid); } } #define MAX_FRAGS 4 struct vnet_fragmentation { uint32_t full; uint32_t count; uint32_t frags[MAX_FRAGS]; }; static uintptr_t syz_emit_ethernet(uintptr_t a0, uintptr_t a1, uintptr_t a2) { if (tunfd < 0) return (uintptr_t)-1; uint32_t length = a0; char* data = (char*)a1; struct vnet_fragmentation* frags = (struct vnet_fragmentation*)a2; struct iovec vecs[MAX_FRAGS + 1]; uint32_t nfrags = 0; if (!tun_frags_enabled || frags == NULL) { vecs[nfrags].iov_base = data; vecs[nfrags].iov_len = length; nfrags++; } else { bool full = true; uint32_t i, count = 0; full = frags->full; count = frags->count; if (count > MAX_FRAGS) count = MAX_FRAGS; for (i = 0; i < count && length != 0; i++) { uint32_t size = 0; size = frags->frags[i]; if (size > length) size = length; vecs[nfrags].iov_base = data; vecs[nfrags].iov_len = size; nfrags++; data += size; length -= size; } if (length != 0 && (full || nfrags == 0)) { vecs[nfrags].iov_base = data; vecs[nfrags].iov_len = length; nfrags++; } } return writev(tunfd, vecs, nfrags); } static void loop(); static void sandbox_common() { prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); setpgrp(); setsid(); struct rlimit rlim; rlim.rlim_cur = rlim.rlim_max = 128 << 20; setrlimit(RLIMIT_AS, &rlim); rlim.rlim_cur = rlim.rlim_max = 8 << 20; setrlimit(RLIMIT_MEMLOCK, &rlim); rlim.rlim_cur = rlim.rlim_max = 1 << 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); #define CLONE_NEWCGROUP 0x02000000 if (unshare(CLONE_NEWNS)) { } if (unshare(CLONE_NEWIPC)) { } if (unshare(CLONE_NEWCGROUP)) { } if (unshare(CLONE_NEWUTS)) { } if (unshare(CLONE_SYSVSEM)) { } } static int do_sandbox_none(int executor_pid, bool enable_tun) { if (unshare(CLONE_NEWPID)) { } int pid = fork(); if (pid < 0) fail("sandbox fork failed"); if (pid) return pid; sandbox_common(); if (unshare(CLONE_NEWNET)) { } setup_tun(executor_pid, enable_tun); loop(); doexit(1); } static void test(); void loop() { while (1) { test(); } } long r[1]; void test() { memset(r, -1, sizeof(r)); syscall(__NR_mmap, 0x20000000, 0xfff000, 3, 0x32, -1, 0); r[0] = syscall(__NR_socket, 0x11, 2, 0x300); *(uint32_t*)0x20010ffc = 1; syscall(__NR_setsockopt, r[0], 0x107, 0x14, 0x20010ffc, 4); *(uint16_t*)0x20008000 = 0xa; *(uint16_t*)0x20008002 = htobe16(0x4e23); *(uint32_t*)0x20008004 = 5; *(uint8_t*)0x20008008 = 0xfe; *(uint8_t*)0x20008009 = 0x80; *(uint8_t*)0x2000800a = 0; *(uint8_t*)0x2000800b = 0; *(uint8_t*)0x2000800c = 0; *(uint8_t*)0x2000800d = 0; *(uint8_t*)0x2000800e = 0; *(uint8_t*)0x2000800f = 0; *(uint8_t*)0x20008010 = 0; *(uint8_t*)0x20008011 = 0; *(uint8_t*)0x20008012 = 0; *(uint8_t*)0x20008013 = 0; *(uint8_t*)0x20008014 = 0; *(uint8_t*)0x20008015 = 0; *(uint8_t*)0x20008016 = 0; *(uint8_t*)0x20008017 = 0xaa; *(uint32_t*)0x20008018 = 0; syscall(__NR_sendto, r[0], 0x20003fd9, 0, 0, 0x20008000, 0x1c); *(uint8_t*)0x206eef62 = 0xaa; *(uint8_t*)0x206eef63 = 0xaa; *(uint8_t*)0x206eef64 = 0xaa; *(uint8_t*)0x206eef65 = 0xaa; *(uint8_t*)0x206eef66 = 0; *(uint8_t*)0x206eef67 = 0xaa; *(uint8_t*)0x206eef68 = -1; *(uint8_t*)0x206eef69 = -1; *(uint8_t*)0x206eef6a = -1; *(uint8_t*)0x206eef6b = -1; *(uint8_t*)0x206eef6c = -1; *(uint8_t*)0x206eef6d = -1; *(uint16_t*)0x206eef6e = htobe16(0x800); STORE_BY_BITMASK(uint8_t, 0x206eef70, 0xbd, 0, 4); STORE_BY_BITMASK(uint8_t, 0x206eef70, 4, 4, 4); STORE_BY_BITMASK(uint8_t, 0x206eef71, 0, 0, 2); STORE_BY_BITMASK(uint8_t, 0x206eef71, 0, 2, 6); *(uint16_t*)0x206eef72 = htobe16(0x34); *(uint16_t*)0x206eef74 = 0; *(uint16_t*)0x206eef76 = htobe16(0); *(uint8_t*)0x206eef78 = 0; *(uint8_t*)0x206eef79 = 1; *(uint16_t*)0x206eef7a = 0; *(uint32_t*)0x206eef7c = htobe32(0xfffffe02); *(uint8_t*)0x206eef80 = 0xac; *(uint8_t*)0x206eef81 = 0x14; *(uint8_t*)0x206eef82 = 0; *(uint8_t*)0x206eef83 = 0; *(uint8_t*)0x206eef84 = 0x83; *(uint8_t*)0x206eef85 = 0xa3; *(uint8_t*)0x206eef86 = 0; *(uint8_t*)0x206eef88 = 3; *(uint8_t*)0x206eef89 = 0; *(uint16_t*)0x206eef8a = 0; *(uint8_t*)0x206eef8c = 0; *(uint8_t*)0x206eef8d = 0; *(uint16_t*)0x206eef8e = htobe16(0); STORE_BY_BITMASK(uint8_t, 0x206eef90, 5, 0, 4); STORE_BY_BITMASK(uint8_t, 0x206eef90, 4, 4, 4); STORE_BY_BITMASK(uint8_t, 0x206eef91, 0, 0, 2); STORE_BY_BITMASK(uint8_t, 0x206eef91, 0, 2, 6); *(uint16_t*)0x206eef92 = htobe16(0); *(uint16_t*)0x206eef94 = 0; *(uint16_t*)0x206eef96 = htobe16(0); *(uint8_t*)0x206eef98 = 0; *(uint8_t*)0x206eef99 = 0; *(uint16_t*)0x206eef9a = htobe16(0); *(uint32_t*)0x206eef9c = htobe32(-1); *(uint8_t*)0x206eefa0 = 0xac; *(uint8_t*)0x206eefa1 = 0x14; *(uint8_t*)0x206eefa2 = 0; *(uint8_t*)0x206eefa3 = 0; *(uint32_t*)0x205ecff8 = 0; *(uint32_t*)0x205ecffc = 0; struct csum_inet csum_1; csum_inet_init(&csum_1); csum_inet_update(&csum_1, (const uint8_t*)0x206eef88, 28); *(uint16_t*)0x206eef8a = csum_inet_digest(&csum_1); struct csum_inet csum_2; csum_inet_init(&csum_2); csum_inet_update(&csum_2, (const uint8_t*)0x206eef70, 24); *(uint16_t*)0x206eef7a = csum_inet_digest(&csum_2); syz_emit_ethernet(0x42, 0x206eef62, 0x205ecff8); } int main() { for (;;) { int pid = do_sandbox_none(0, true); int status = 0; while (waitpid(pid, &status, __WALL) != pid) { } } }
the_stack_data/247017159.c
/* vi: set sw=4 ts=4: */ /* * getresuid() for uClibc * * Copyright (C) 2000-2006 Erik Andersen <[email protected]> * * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ #include <sys/syscall.h> #ifdef __USE_GNU #include <unistd.h> #if defined(__NR_getresuid32) # undef __NR_getresuid # define __NR_getresuid __NR_getresuid32 _syscall3(int, getresuid, uid_t *, ruid, uid_t *, euid, uid_t *, suid) #elif defined(__NR_getresuid) # define __NR___syscall_getresuid __NR_getresuid static inline _syscall3(int, __syscall_getresuid, __kernel_uid_t *, ruid, __kernel_uid_t *, euid, __kernel_uid_t *, suid); int getresuid(uid_t * ruid, uid_t * euid, uid_t * suid) { int result; __kernel_uid_t k_ruid, k_euid, k_suid; result = __syscall_getresuid(&k_ruid, &k_euid, &k_suid); if (result == 0) { *ruid = (uid_t) k_ruid; *euid = (uid_t) k_euid; *suid = (uid_t) k_suid; } return result; } #endif #endif
the_stack_data/73039.c
#include <stdio.h> #include <signal.h> void my_signal_func(int signum) { static int n = 0; printf("signal = %d, times = %d\n", signum, ++n); } int main() { signal(SIGUSR1, my_signal_func); while(1) { sleep(1000); } return 0; }
the_stack_data/1084928.c
/* PR regression/21897 */ /* This testcase generates MMX instructions together with x87 instructions. Currently, there is no "emms" generated to switch between register sets, so the testcase fails for targets where MMX insns are enabled. */ /* { dg-options "-mno-mmx" { target { x86_64-*-* i?86-*-* } } } */ extern void abort (void); typedef short v4hi __attribute__ ((vector_size (8))); typedef float v4sf __attribute__ ((vector_size (16))); union { v4hi v; short s[4]; } u; union { v4sf v; float f[4]; } v; void foo (void) { unsigned int i; for (i = 0; i < 2; i++) u.v += (v4hi) { 12, 14 }; for (i = 0; i < 2; i++) v.v += (v4sf) { 18.0, 20.0, 22 }; } int main (void) { foo (); if (u.s[0] != 24 || u.s[1] != 28 || u.s[2] || u.s[3]) abort (); if (v.f[0] != 36.0 || v.f[1] != 40.0 || v.f[2] != 44.0 || v.f[3] != 0.0) abort (); return 0; }
the_stack_data/176705089.c
#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h> #define ARRAY_TYPE_INDEX 3 #define ARRAY_NAME_INDEX 4 int main(int argc, char **argv){ if(argc != 5){ fprintf(stderr, "Usage: %s <input> <output> <array_type> <array_name>\n", argv[0]); return 1; } FILE *input = fopen(argv[1], "r"); if(input == NULL){ fprintf(stderr, "File %s doesn't exist.\n", argv[1]); return 2; } FILE *output = fopen(argv[2], "w"); if(output == NULL){ fprintf(stderr, "File %s cannot be created.\n", argv[2]); return 3; } char *line = NULL; size_t len = 0; ssize_t read; fprintf(output, "%s %s[] = {\n", argv[ARRAY_TYPE_INDEX], argv[ARRAY_NAME_INDEX]); while((read = getline(&line, &len, input) != -1)){ char *c = strchr(line, '\n'); if(c){ *c = ','; } fprintf(output, "\t%s\n", line); } fprintf(output, "};\n"); fclose(input); fclose(output); }
the_stack_data/161079537.c
#include <stdio.h> #include <math.h> int main() { float x1, y1; float x2, y2; scanf("%f %f", &x1, &y1); scanf("%f %f", &x2, &y2); float distancia; distancia = sqrt((pow(x2 - x1, 2)) + (pow(y2 - y1, 2))); printf("%.4f\n", distancia); return 0; }
the_stack_data/143382.c
// printf関数、及びscanf関数を使用するために必要 #include <stdio.h> // マクロ宣言。マクロで使用する変数には計算順序を維持するために // カッコをつけることに注意する。 // 三項演算子は 条件文?真の時の実行文:偽の時の実行文 という書式 // 大きい方を返すマクロ #define MIN(a, b) ((a) < (b) ? (a) : (b)) // 小さい方を返すマクロ #define MAX(a, b) ((a) > (b) ? (a) : (b)) // 2乗を返すマクロ #define POW(a) (a)*(a) // int型を返すmain関数の宣言 int main() { // 変数の宣言 // 配列の宣言は name[size] で行う。添字は0〜(size-1)まで占有している。 int i, j; int score[100]; int sum, max, min; float ave, var; float tmpsum; // iの初期化。一番初めのデータはscore[0]に格納される i = 0; // scanf関数。標準入力から入力を取得する。 // scanfには変数のアドレスを渡すため、& を語頭に付与する。 // scanf(フォーマット指定子, 変数) scanf("%d", &score[i]); // 一番初めの値を暫定的に、最大値であり、最小値であり、合計だとする。 max = score[i]; min = score[i]; sum = score[i]; // 無限ループ。break文によって抜け出す。 while(1){ // iのインクリメント i++; // iのインクリメントにより、score[1], score[2],,,に格納される scanf("%d", &score[i]); if (score[i] < 0) { // 負の値を受けとったときbreak文を実行する。 break; } // 前述のマクロを使って、maxとminを更新していく max = MAX(max, score[i]); min = MIN(min, score[i]); // sumの更新。sum = sum + score[i]の省略形 sum += score[i]; } // 平均値を求める。floatで欲しいため、演算項のどちらかをfloatにキャストする。 // 書式は (型名)変数名 でキャスト出来る ave = (float)sum / (i); // tmpsumの初期化。 tmpsum = 0; for (j = 0; j < i; j++) { // 前述のPOWマクロを使って、平均とのずれの2乗を合計する。 tmpsum += POW(score[j] - ave); } // 分散を求める。平均とのずれの2乗の合計の平均が分散である。 var = tmpsum / i; // printf関数。フォーマット指定子に従って標準出力に出力する // printf(フォーマット指定子, 変数) // 平均点と分散の出力が小数点以下4桁だったため、%.4fというフォーマットを指定した。 printf("人数 : %d\n", i); printf("最高点 : %d\n", max); printf("最低点 : %d\n", min); printf("平均点 : %.4f\n", ave); printf("分散 : %.4f\n", var); return 0; }
the_stack_data/198580836.c
/* Este programa vai ler dados inteiros e ira armazenalos em uma matriz 3x4, e em seguida ira mostrar quantidade de numeros impares e pares armazenados na matriz */ #include <stdio.h> int main(){ int mat[3][4],lin, col,contpar=0,contimpar=0; printf ("\nDigite valor para os elementos da matriz\n\n"); for ( lin=0; lin<3; lin++ ) for ( col=0; col<4; col++ ) { printf ("\nElemento[%d][%d] = ", lin, col); scanf ("%d", &mat[lin][col]); } printf("\n\n********* Saida de Dados ********* \n\n"); for ( lin=0; lin<3; lin++ ) for ( col=0; col<4; col++ ) { if (mat[lin][col] % 2==0) contpar++; else contimpar++; } printf ("\nPares: %d ",contpar); printf ("\nImpares: %d ",contimpar); }
the_stack_data/15763151.c
/* $OpenBSD: ualarm.c,v 1.7 2005/08/08 08:05:34 espie Exp $ */ /* * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include <sys/types.h> #include <sys/time.h> #include <unistd.h> #define USPS 1000000 /* # of microseconds in a second */ /* * Generate a SIGALRM signal in ``usecs'' microseconds. * If ``reload'' is non-zero, keep generating SIGALRM * every ``reload'' microseconds after the first signal. */ useconds_t ualarm(useconds_t usecs, useconds_t reload) { struct itimerval new, old; new.it_interval.tv_usec = reload % USPS; new.it_interval.tv_sec = reload / USPS; new.it_value.tv_usec = usecs % USPS; new.it_value.tv_sec = usecs / USPS; if (setitimer(ITIMER_REAL, &new, &old) == 0) return ((useconds_t)(old.it_value.tv_sec * USPS + old.it_value.tv_usec)); /* else */ return ((useconds_t)-1); }
the_stack_data/1013760.c
int sub(int a,int b) { int diff = 0; diff = a - b; return diff; }
the_stack_data/744774.c
#include <stdio.h> long global = 10; /* Initialized global variable stored in DS */ int main(void) { static long i = 100; /* Initialized static variable stored in DS */ return 0; }
the_stack_data/21069.c
/* mbed Microcontroller Library * Copyright (c) 2017 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if defined(DEVICE_ITM) #include "hal/itm_api.h" #include "cmsis.h" #include <stdbool.h> #ifndef ITM_STIM_FIFOREADY_Msk #define ITM_STIM_FIFOREADY_Msk 1 #endif #define ITM_ENABLE_WRITE 0xC5ACCE55 #define SWO_NRZ 0x02 #define SWO_STIMULUS_PORT 0x01 void mbed_itm_init(void) { static bool do_init = true; if (do_init) { do_init = false; itm_init(); /* Enable write access to ITM registers. */ ITM->LAR = ITM_ENABLE_WRITE; /* Trace Port Interface Selected Pin Protocol Register. */ TPI->SPPR = (SWO_NRZ << TPI_SPPR_TXMODE_Pos); /* Trace Port Interface Formatter and Flush Control Register */ TPI->FFCR = (1 << TPI_FFCR_TrigIn_Pos); /* Data Watchpoint and Trace Control Register */ DWT->CTRL = (1 << DWT_CTRL_CYCTAP_Pos) | (0xF << DWT_CTRL_POSTINIT_Pos) | (0xF << DWT_CTRL_POSTPRESET_Pos) | (1 << DWT_CTRL_CYCCNTENA_Pos); /* Trace Privilege Register. * Disable access to trace channel configuration from non-privileged mode. */ ITM->TPR = 0x0; /* Trace Control Register */ ITM->TCR = (1 << ITM_TCR_TraceBusID_Pos) | (1 << ITM_TCR_DWTENA_Pos) | (1 << ITM_TCR_SYNCENA_Pos) | (1 << ITM_TCR_ITMENA_Pos); /* Trace Enable Register */ ITM->TER = SWO_STIMULUS_PORT; } } static void itm_out8(uint32_t port, uint8_t data) { /* Wait until port is available */ while ((ITM->PORT[port].u32 & ITM_STIM_FIFOREADY_Msk) == 0) { __NOP(); } /* write data to port */ ITM->PORT[port].u8 = data; } static void itm_out32(uint32_t port, uint32_t data) { /* Wait until port is available */ while ((ITM->PORT[port].u32 & ITM_STIM_FIFOREADY_Msk) == 0) { __NOP(); } /* write data to port */ ITM->PORT[port].u32 = data; } uint32_t mbed_itm_send(uint32_t port, uint32_t data) { /* Check if ITM and port is enabled */ if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */ ((ITM->TER & (1UL << port)) != 0UL)) { /* ITM Port enabled */ itm_out32(port, data); } return data; } void mbed_itm_send_block(uint32_t port, const void *data, size_t len) { const char *ptr = data; /* Check if ITM and port is enabled */ if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */ ((ITM->TER & (1UL << port)) != 0UL)) { /* ITM Port enabled */ /* Output single byte at a time until data is aligned */ while ((((uintptr_t) ptr) & 3) && len != 0) { itm_out8(port, *ptr++); len--; } /* Output bulk of data one word at a time */ while (len >= 4) { itm_out32(port, *(const uint32_t *) ptr); ptr += 4; len -= 4; } /* Output any trailing bytes */ while (len != 0) { itm_out8(port, *ptr++); len--; } } } #endif // defined(DEVICE_ITM)
the_stack_data/7950494.c
#include <stdio.h> /****************************** * SUM: * Adds two number togethers ******************************/ int sum (int a, int b) { // Declare a variable to store the sum int res; // Add a and b together and store it in res and return it res = a + b; return res; } /****************************** * MAIN: * Where the program starts ******************************/ void main (void) { // Declare the variable to store the starting values int y = 2; // Call sum and store the return in z int z = sum (5, y); // Output the results to the user printf ("The sum of 5 and %d is %d\n", y, z); }
the_stack_data/688919.c
/* * sooner_date.c * * Created on: Jun 17, 2013 * Author: delmadord */ #include <stdio.h> struct date { int day, month, year; }; int day_of_year(struct date d); int compare_dates(struct date d1, struct date d2); // Which date is sooner int main(void) { struct date d1, d2; printf("Enter first date: "); scanf("%d/%d/%d", &d1.day, &d1.month, &d1.year); printf("Enter second date: "); scanf("%d/%d/%d", &d2.day, &d2.month, &d2.year); if (compare_dates(d1, d2) < 0) printf("%d/%d/%d is earlier than %d/%d/%d.", d1.day, d1.month, d1.year, d2.day, d2.month, d2.year); else if (compare_dates(d1, d2) > 0) printf("%d/%d/%d is earlier than %d/%d/%d.", d2.day, d2.month, d2.year, d1.day, d1.month, d1.year); else printf("Dates are the same."); return 0; } int day_of_year(struct date d) { int feb = (d.year % 4 == 0) ? 29 : 28; int days_in_months[] = {0, 31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; int i, days = d.day; for (i = 1; i < d.month; i++) days += days_in_months[i]; return days; } int compare_dates(struct date d1, struct date d2) { // Trasnforms date into days int days1 = day_of_year(d1) + d1.year * 365 + (d1.year % 4); int days2 = day_of_year(d2) + d2.year * 365 + (d2.year % 4); if (days1 < days2) return -1; else if (days1 == days2) return 0; else return 1; }
the_stack_data/1191781.c
#include <stdio.h> #include <string.h> #define SIZE 21 void mystrcpy(char *s1, char *s2){ while(*s2 != '\0') *s1++ = *s2++; } char deCode(char ch){ switch(ch){ case 'A':case 'E':case 'I':case 'O': case 'U':case 'Y':case 'W':case 'H': ch = '\0'; break; case 'B':case 'P':case 'F':case 'V': ch = '1'; break; case 'C':case 'S':case 'K':case 'G': case 'J':case 'Q':case 'X':case 'Z': ch = '2'; break; case 'D': case 'T': ch = '3'; break; case 'L': ch = '4'; break; case 'M': case 'N': ch = '5'; break; case 'R': ch = '6'; break; default: ch = '\0'; break; } return ch; } static inline void solve(){ char name[SIZE]; register char *p, *code, *end, temp; puts("NAME SOUNDEX CODE"); while(gets(name) != NULL){ char output[39] = " 000"; mystrcpy(output + 9, name); p = name; end = output + 38; code = output + 34; *code++ = *p++; while(*p != '\0'){ temp = deCode(*p); if(temp && (temp != deCode(*(p - 1)))){ *code++ = temp; if(code == end)break; } p++; } puts(output); } puts(" END OF OUTPUT"); } int main(){ solve(); return 0; }
the_stack_data/128650.c
#include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <string.h> void init(); void debug_stack_dump(unsigned long rsp, unsigned long rbp); char str_head[] = "hello "; char str_tail[] = "!\n"; void win() { puts("Congratulation!"); system("/bin/sh"); exit(0); } void vuln() { char target[] = "HACKASE"; char name[10]; char *p; int ret; printf("What's your name?: "); ret = read(0, name, 0x100); name[ret - 1] = 0; write(0, str_head, strlen(str_head)); write(0, name, strlen(name)); write(0, str_tail, strlen(str_tail)); if (strncmp(target, "WANI", 4) == 0) { win(); } else { printf("target = %s\n", target); } { //for learning stack register unsigned long rsp asm("rsp"); register unsigned long rbp asm("rbp"); debug_stack_dump(rsp, rbp); } } int main() { init(); while (1) { vuln(); } } void init() { alarm(30); setbuf(stdin, NULL); setbuf(stdout, NULL); setbuf(stderr, NULL); } void debug_stack_dump(unsigned long rsp, unsigned long rbp) { unsigned long i; printf("\n***start stack dump***\n"); i = rsp; while (i <= rbp + 8) { unsigned long *p; p = (unsigned long *)i; printf("0x%lx: 0x%016lx", i, *p); if (i == rsp) { printf(" <- rsp"); } else if (i == rbp) { printf(" <- rbp"); } else if (i == rbp + 8) { printf(" <- return address"); } printf("\n"); i += 8; } printf("***end stack dump***\n\n"); }
the_stack_data/234518587.c
/*************************************************************************\ * Copyright (C) Michael Kerrisk, 2016. * * * * This program is free software. You may use, modify, and redistribute it * * under the terms of the GNU General Public License as published by the * * Free Software Foundation, either version 3 or (at your option) any * * later version. This program is distributed without any warranty. See * * the file COPYING.gpl-v3 for details. * \*************************************************************************/ /* Supplementary program for Chapter Z-Z */ #define _GNU_SOURCE #include <fcntl.h> #include <sched.h> #include <unistd.h> #include <stdlib.h> #include <stdio.h> #include <sys/wait.h> /* A simple error-handling function: print an error message based on the value in 'errno' and terminate the calling process */ #define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \ } while (0) int main(int argc, char *argv[]) { int fd; if (argc < 3) { fprintf(stderr, "%s /proc/PID/ns/FILE cmd [arg...]\n", argv[0]); exit(EXIT_FAILURE); } fd = open(argv[1], O_RDONLY); /* Get descriptor for namespace */ if (fd == -1) errExit("open"); if (setns(fd, 0) == -1) /* Join that namespace */ errExit("setns"); execvp(argv[2], &argv[2]); /* Execute a command in namespace */ errExit("execvp"); }
the_stack_data/136494.c
#include<stdio.h> #include<math.h> #define REP(i,m,n) for(i=m;i<n;i++) #define rep(i,n) REP(i,0,n) int Dx[]={1,0,-1,0},Dy[]={0,1,0,-1}; int dfs(int,int); int boad[110][110]; int w,h,xs,ys,xg,yg,n,c,d; int main(void){ int x,y,i,j,a,b; while(1){ scanf("%d %d",&w,&h); if(w==0 && h==0)break; scanf("%d %d",&xs,&ys); scanf("%d %d",&xg,&yg); scanf("%d",&n); for(i=0;i<110;i++){ for(j=0;j<110;j++){ boad[i][j]=-1; } } int k; for(k=0;k<n;k++){ scanf("%d %d %d %d",&c,&d,&x,&y); if(d){a=4;b=2;} else {a=2;b=4;} for(i=y;i<y+a;i++){ for(j=x;j<x+b;j++){ boad[i][j]=c; } } } c=boad[ys][xs]; if(c && dfs(xs,ys))printf("OK\n"); else printf("NG\n"); } return 0; } int dfs(int x,int y) { int i; if(x<=0||x>w||y<=0||y>h||boad[y][x]!=c)return 0; if(x==xg&&y==yg)return 1; boad[y][x]=0; rep(i,4)if(dfs(x+Dx[i],y+Dy[i]))return 1; return 0; }
the_stack_data/19663.c
/*- * Copyright (c) 2002-2004 Gunter Burchardt, Local-Web AG * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any * redistribution must be conditioned upon including a substantially * similar Disclaimer requirement for further binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * Alternatively, this software may be distributed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * * NO WARRANTY * 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 NONINFRINGEMENT, MERCHANTIBILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. * * $Id: athctrl.c 1436 2006-02-03 12:03:03Z mrenzmann $ */ /* * Simple Atheros-specific tool to inspect and set atheros specific values * athctrl [-i interface] [-d distance] * (default interface is wifi0). */ #include <sys/types.h> #include <sys/file.h> #include <getopt.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <err.h> #include <net/if.h> static int setsysctrl(const char *dev, const char *control , u_long value) { char buffer[256]; FILE * fd; snprintf(buffer, sizeof(buffer), "/proc/sys/dev/%s/%s", dev, control); fd = fopen(buffer, "w"); if (fd != NULL) { fprintf(fd, "%li", value); fclose(fd); } else fprintf(stderr, "Could not open %s for writing!\n", buffer); return 0; } static void usage(void) { fprintf(stderr, "Atheros driver control\n" "Copyright (c) 2002-2004 Gunter Burchardt, Local-Web AG\n" "\n" "usage: athctrl [-i interface] [-d distance]\n" "\n" "options:\n" " -h show this usage\n" " -i interface (default interface is wifi0)\n" " -d specify the maximum distance of a sta or the distance\n" " of the master\n"); exit(1); } int main(int argc, char *argv[]) { char device[IFNAMSIZ + 1]; int distance = -1; int c; strncpy(device, "wifi0", sizeof (device)); for (;;) { c = getopt(argc, argv, "d:i:h"); if (c < 0) break; switch (c) { case 'h': usage(); break; case 'd': distance = atoi(optarg); break; case 'i': strncpy(device, optarg, sizeof (device)); break; default: usage(); break; } } if (distance >= 0) { int slottime = 9 + (distance / 300) + ((distance % 300) ? 1 : 0); int acktimeout = slottime * 2 + 3; int ctstimeout = slottime * 2 + 3; printf("Setting distance on interface %s to %i meters\n", device, distance); setsysctrl(device, "slottime", slottime); setsysctrl(device, "acktimeout", acktimeout); setsysctrl(device, "ctstimeout", ctstimeout); } else usage(); return 0; }
the_stack_data/91967.c
/// Check the behavior of toolchain for NEC Aurora VE /// REQUIRES: ve-registered-target /// UNSUPPORTED: system-windows ///----------------------------------------------------------------------------- /// Checking dwarf-version // RUN: %clang -### -g -target ve %s 2>&1 | FileCheck -check-prefix=DWARF_VER %s // DWARF_VER: "-dwarf-version=5" ///----------------------------------------------------------------------------- /// Checking include-path // RUN: %clang -### -target ve --sysroot %S/Inputs/basic_ve_tree %s \ // RUN: -resource-dir=%S/Inputs/basic_ve_tree/resource_dir \ // RUN: 2>&1 | FileCheck -check-prefix=DEFINC %s // DEFINC: clang{{.*}} "-cc1" // DEFINC-SAME: "-nostdsysteminc" // DEFINC-SAME: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" // DEFINC-SAME: "-isysroot" "[[SYSROOT:[^"]+]]" // DEFINC-SAME: "-internal-isystem" "[[RESOURCE_DIR]]/include" // DEFINC-SAME: "-internal-isystem" "[[SYSROOT]]/opt/nec/ve/include" // RUN: %clang -### -target ve --sysroot %S/Inputs/basic_ve_tree %s \ // RUN: -resource-dir=%S/Inputs/basic_ve_tree/resource_dir \ // RUN: -nostdlibinc 2>&1 | FileCheck -check-prefix=NOSTDLIBINC %s // NOSTDLIBINC: clang{{.*}} "-cc1" // NOSTDLIBINC-SAME: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" // NOSTDLIBINC-SAME: "-isysroot" "[[SYSROOT:[^"]+]]" // NOSTDLIBINC-SAME: "-internal-isystem" "[[RESOURCE_DIR]]/include" // NOSTDLIBINC-NOT: "-internal-isystem" "[[SYSROOT]]/opt/nec/ve/include" // RUN: %clang -### -target ve --sysroot %S/Inputs/basic_ve_tree %s \ // RUN: -resource-dir=%S/Inputs/basic_ve_tree/resource_dir \ // RUN: -nobuiltininc 2>&1 | FileCheck -check-prefix=NOBUILTININC %s // NOBUILTININC: clang{{.*}} "-cc1" // NOBUILTININC-SAME: "-nobuiltininc" // NOBUILTININC-SAME: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" // NOBUILTININC-SAME: "-isysroot" "[[SYSROOT:[^"]+]]" // NOBUILTININC-NOT: "-internal-isystem" "[[RESOURCE_DIR]]/include" // NOBUILTININC-SAME: "-internal-isystem" "[[SYSROOT]]/opt/nec/ve/include" // RUN: %clang -### -target ve --sysroot %S/Inputs/basic_ve_tree %s \ // RUN: -resource-dir=%S/Inputs/basic_ve_tree/resource_dir \ // RUN: -nostdinc 2>&1 | FileCheck -check-prefix=NOSTDINC %s // NOSTDINC: clang{{.*}} "-cc1" // NOSTDINC-SAME: "-nobuiltininc" // NOSTDINC-SAME: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" // NOSTDINC-SAME: "-isysroot" "[[SYSROOT:[^"]+]]" // NOSTDINC-NOT: "-internal-isystem" "[[RESOURCE_DIR]]/include" // NOSTDINC-NOT: "-internal-isystem" "[[SYSROOT]]/opt/nec/ve/include" ///----------------------------------------------------------------------------- /// Checking -faddrsig // RUN: %clang -### -target ve %s 2>&1 | FileCheck -check-prefix=DEFADDRSIG %s // DEFADDRSIG: clang{{.*}} "-cc1" // DEFADDRSIG-NOT: "-faddrsig" ///----------------------------------------------------------------------------- /// Checking -fintegrated-as // RUN: %clang -### -target ve \ // RUN: -x assembler -fuse-ld=ld %s 2>&1 | \ // RUN: FileCheck -check-prefix=AS %s // RUN: %clang -### -target ve \ // RUN: -fno-integrated-as -fuse-ld=ld -x assembler %s 2>&1 | \ // RUN: FileCheck -check-prefix=NAS %s // AS: clang{{.*}} "-cc1as" // AS: nld{{.*}} // NAS: nas{{.*}} // NAS: nld{{.*}} ///----------------------------------------------------------------------------- /// Checking default behavior: /// - dynamic linker /// - library paths /// - nld VE specific options /// - sjlj exception // RUN: %clang -### -target ve-unknown-linux-gnu \ // RUN: --sysroot %S/Inputs/basic_ve_tree \ // RUN: -resource-dir=%S/Inputs/basic_ve_tree/resource_dir \ // RUN: --unwindlib=none \ // RUN: -fuse-ld=ld \ // RUN: %s 2>&1 | FileCheck -check-prefix=DEF %s // DEF: clang{{.*}}" "-cc1" // DEF-SAME: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" // DEF-SAME: "-isysroot" "[[SYSROOT:[^"]+]]" // DEF-SAME: "-exception-model=sjlj" // DEF: nld" // DEF-SAME: "--sysroot=[[SYSROOT]]" // DEF-SAME: "-dynamic-linker" "/opt/nec/ve/lib/ld-linux-ve.so.1" // DEF-SAME: "[[SYSROOT]]/opt/nec/ve/lib/crt1.o" // DEF-SAME: "[[SYSROOT]]/opt/nec/ve/lib/crti.o" // DEF-SAME: "-z" "max-page-size=0x4000000" // DEF-SAME: "[[RESOURCE_DIR]]/lib/linux/clang_rt.crtbegin-ve.o" // DEF-SAME: "[[RESOURCE_DIR]]/lib/linux/libclang_rt.builtins-ve.a" "-lc" // DEF-SAME: "[[RESOURCE_DIR]]/lib/linux/libclang_rt.builtins-ve.a" // DEF-SAME: "[[RESOURCE_DIR]]/lib/linux/clang_rt.crtend-ve.o" // DEF-SAME: "[[SYSROOT]]/opt/nec/ve/lib/crtn.o"
the_stack_data/247017012.c
#include <stdio.h> #include <ctype.h> // This program is supposed to print out sizes of various types. int main(void) { printf("This is the size of an int %zu \n", sizeof(int)); // %zu can show the size without an int cast. printf("This is the size of a short %zu \n", sizeof(short)); printf("This is the size of an long %zu \n", sizeof(long)); printf("This is the size of an float %zu \n", sizeof(float)); printf("This is the size of an double %zu \n", sizeof(double)); printf("This is the size of an long double %zu \n", sizeof(long double)); return 0; }
the_stack_data/36075499.c
#include <stdio.h> #include <math.h> /* Exercise 1-14. Horizontal Histogram of frequencies of different characters in input */ int main() { int n_digit[10], n_small_alphabet[26], n_big_alphabet[26]; int i, l, c, nc, freq; char *atoz = "abcdefghijklmnopqrstuvwxyz"; char *AtoZ = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; nc = 0; for (i = 0; i < 26; i++) { if (i < 10) n_digit[i] = 0; n_small_alphabet[i] = 0; n_big_alphabet[i] = 0; } while ((c = getchar()) != EOF) { if (c != ' ' && c != '\t' && c != '\n') { nc++; if (c >= '0' && c <= '9') ++n_digit[c - '0']; if (c >= 'a' && c <= 'z') ++n_small_alphabet[c - 'a']; if (c >= 'A' && c <= 'Z') ++n_big_alphabet[c - 'A']; } } for (i = 0; i < 10; i++) { if (n_digit[i] != 0) { printf("%d : ", i); freq = 10.0 * (log10(nc) + 1) * (float) n_digit[i] / (float) nc; for (l = 0; l < freq; l++) printf("-"); printf("\n"); } } for (i = 0; i < 26; i++) { if (n_small_alphabet[i] != 0) { printf("%c : ", atoz[i]); freq = 10.0 * (log10(nc) + 1) * (float) n_small_alphabet[i] / (float) nc; for (l = 0; l < freq; l++) printf("-"); printf("\n"); } } for (i = 0; i < 26; i++) { if (n_big_alphabet[i] != 0) { printf("%c : ", AtoZ[i]); freq = 10.0 * (log10(nc) + 1) * (float) n_big_alphabet[i] / (float) nc; for (l = 0; l < freq; l++) printf("-"); printf("\n"); } } return 0; }
the_stack_data/716724.c
#define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef size_t u8 ; typedef size_t u32 ; struct rtl_priv {int dummy; } ; struct rtl_hal {scalar_t__ reloadtxpowerindex; } ; struct rtl_efuse {int eeprom_thermalmeter; } ; struct rtl_dm {int txpower_trackinginit; int swing_idx_cck_base; int* swing_idx_ofdm_base; size_t* thermalvalue_avg; size_t thermalvalue_avg_index; size_t thermalvalue; size_t thermalvalue_lck; size_t thermalvalue_iqk; size_t* delta_power_index_last; size_t* delta_power_index; size_t* absolute_ofdm_swing_idx; scalar_t__* power_index_offset; int* ofdm_index; int cck_index; int swing_idx_cck; int* swing_idx_ofdm; int /*<<< orphan*/ txpower_track_control; int /*<<< orphan*/ default_ofdm_index; } ; struct ieee80211_hw {int dummy; } ; /* Variables and functions */ size_t AVG_THERMAL_NUM_8812A ; int /*<<< orphan*/ COMP_POWER_TRACKING ; int /*<<< orphan*/ DBG_LOUD ; size_t IQK_THRESHOLD ; size_t MAX_PATH_NUM_8812A ; int /*<<< orphan*/ MIX_MODE ; size_t RF90_PATH_A ; size_t RF90_PATH_B ; int /*<<< orphan*/ RF_T_METER_8812A ; int /*<<< orphan*/ RT_TRACE (struct rtl_priv*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,char*,...) ; size_t TXPWR_TRACK_TABLE_SIZE ; int TXSCALE_TABLE_SIZE ; int /*<<< orphan*/ rtl8812ae_dm_txpwr_track_set_pwr (struct ieee80211_hw*,int /*<<< orphan*/ ,size_t,size_t) ; int /*<<< orphan*/ rtl8812ae_do_iqk (struct ieee80211_hw*,size_t,size_t,int) ; int /*<<< orphan*/ rtl8812ae_get_delta_swing_table (struct ieee80211_hw*,size_t**,size_t**,size_t**,size_t**) ; int /*<<< orphan*/ rtl8821ae_phy_lc_calibrate (struct ieee80211_hw*) ; struct rtl_dm* rtl_dm (struct rtl_priv*) ; struct rtl_efuse* rtl_efuse (struct rtl_priv*) ; scalar_t__ rtl_get_rfreg (struct ieee80211_hw*,size_t,int /*<<< orphan*/ ,int) ; struct rtl_hal* rtl_hal (struct rtl_priv*) ; struct rtl_priv* rtl_priv (struct ieee80211_hw*) ; void rtl8812ae_dm_txpower_tracking_callback_thermalmeter( struct ieee80211_hw *hw) { struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); struct rtl_dm *rtldm = rtl_dm(rtl_priv(hw)); struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); u8 thermal_value = 0, delta, delta_lck, delta_iqk, p = 0, i = 0; u8 thermal_value_avg_count = 0; u32 thermal_value_avg = 0; /* OFDM BB Swing should be less than +3.0dB, */ u8 ofdm_min_index = 6; /* GetRightChnlPlaceforIQK(pHalData->CurrentChannel)*/ u8 index_for_channel = 0; /* 1. The following TWO tables decide * the final index of OFDM/CCK swing table. */ u8 *delta_swing_table_idx_tup_a; u8 *delta_swing_table_idx_tdown_a; u8 *delta_swing_table_idx_tup_b; u8 *delta_swing_table_idx_tdown_b; /*2. Initilization ( 7 steps in total )*/ rtl8812ae_get_delta_swing_table(hw, (u8 **)&delta_swing_table_idx_tup_a, (u8 **)&delta_swing_table_idx_tdown_a, (u8 **)&delta_swing_table_idx_tup_b, (u8 **)&delta_swing_table_idx_tdown_b); rtldm->txpower_trackinginit = true; RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "pDM_Odm->BbSwingIdxCckBase: %d, pDM_Odm->BbSwingIdxOfdmBase[A]:%d, pDM_Odm->DefaultOfdmIndex: %d\n", rtldm->swing_idx_cck_base, rtldm->swing_idx_ofdm_base[RF90_PATH_A], rtldm->default_ofdm_index); thermal_value = (u8)rtl_get_rfreg(hw, RF90_PATH_A, /*0x42: RF Reg[15:10] 88E*/ RF_T_METER_8812A, 0xfc00); RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "Thermal Meter = 0x%X, EFUSE Thermal Base = 0x%X\n", thermal_value, rtlefuse->eeprom_thermalmeter); if (!rtldm->txpower_track_control || rtlefuse->eeprom_thermalmeter == 0 || rtlefuse->eeprom_thermalmeter == 0xFF) return; /* 3. Initialize ThermalValues of RFCalibrateInfo*/ if (rtlhal->reloadtxpowerindex) RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "reload ofdm index for band switch\n"); /*4. Calculate average thermal meter*/ rtldm->thermalvalue_avg[rtldm->thermalvalue_avg_index] = thermal_value; rtldm->thermalvalue_avg_index++; if (rtldm->thermalvalue_avg_index == AVG_THERMAL_NUM_8812A) /*Average times = c.AverageThermalNum*/ rtldm->thermalvalue_avg_index = 0; for (i = 0; i < AVG_THERMAL_NUM_8812A; i++) { if (rtldm->thermalvalue_avg[i]) { thermal_value_avg += rtldm->thermalvalue_avg[i]; thermal_value_avg_count++; } } /*Calculate Average ThermalValue after average enough times*/ if (thermal_value_avg_count) { thermal_value = (u8)(thermal_value_avg / thermal_value_avg_count); RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "AVG Thermal Meter = 0x%X, EFUSE Thermal Base = 0x%X\n", thermal_value, rtlefuse->eeprom_thermalmeter); } /*5. Calculate delta, delta_LCK, delta_IQK. *"delta" here is used to determine whether *thermal value changes or not. */ delta = (thermal_value > rtldm->thermalvalue) ? (thermal_value - rtldm->thermalvalue) : (rtldm->thermalvalue - thermal_value); delta_lck = (thermal_value > rtldm->thermalvalue_lck) ? (thermal_value - rtldm->thermalvalue_lck) : (rtldm->thermalvalue_lck - thermal_value); delta_iqk = (thermal_value > rtldm->thermalvalue_iqk) ? (thermal_value - rtldm->thermalvalue_iqk) : (rtldm->thermalvalue_iqk - thermal_value); RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "(delta, delta_LCK, delta_IQK) = (%d, %d, %d)\n", delta, delta_lck, delta_iqk); /* 6. If necessary, do LCK. * Delta temperature is equal to or larger than 20 centigrade. */ if (delta_lck >= IQK_THRESHOLD) { RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "delta_LCK(%d) >= Threshold_IQK(%d)\n", delta_lck, IQK_THRESHOLD); rtldm->thermalvalue_lck = thermal_value; rtl8821ae_phy_lc_calibrate(hw); } /*7. If necessary, move the index of swing table to adjust Tx power.*/ if (delta > 0 && rtldm->txpower_track_control) { /* "delta" here is used to record the * absolute value of differrence. */ delta = thermal_value > rtlefuse->eeprom_thermalmeter ? (thermal_value - rtlefuse->eeprom_thermalmeter) : (rtlefuse->eeprom_thermalmeter - thermal_value); if (delta >= TXPWR_TRACK_TABLE_SIZE) delta = TXPWR_TRACK_TABLE_SIZE - 1; /*7.1 The Final Power Index = BaseIndex + PowerIndexOffset*/ if (thermal_value > rtlefuse->eeprom_thermalmeter) { RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "delta_swing_table_idx_tup_a[%d] = %d\n", delta, delta_swing_table_idx_tup_a[delta]); rtldm->delta_power_index_last[RF90_PATH_A] = rtldm->delta_power_index[RF90_PATH_A]; rtldm->delta_power_index[RF90_PATH_A] = delta_swing_table_idx_tup_a[delta]; rtldm->absolute_ofdm_swing_idx[RF90_PATH_A] = delta_swing_table_idx_tup_a[delta]; /*Record delta swing for mix mode power tracking*/ RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "******Temp is higher and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] = %d\n", rtldm->absolute_ofdm_swing_idx[RF90_PATH_A]); RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "delta_swing_table_idx_tup_b[%d] = %d\n", delta, delta_swing_table_idx_tup_b[delta]); rtldm->delta_power_index_last[RF90_PATH_B] = rtldm->delta_power_index[RF90_PATH_B]; rtldm->delta_power_index[RF90_PATH_B] = delta_swing_table_idx_tup_b[delta]; rtldm->absolute_ofdm_swing_idx[RF90_PATH_B] = delta_swing_table_idx_tup_b[delta]; /*Record delta swing for mix mode power tracking*/ RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "******Temp is higher and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_B] = %d\n", rtldm->absolute_ofdm_swing_idx[RF90_PATH_B]); } else { RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "delta_swing_table_idx_tdown_a[%d] = %d\n", delta, delta_swing_table_idx_tdown_a[delta]); rtldm->delta_power_index_last[RF90_PATH_A] = rtldm->delta_power_index[RF90_PATH_A]; rtldm->delta_power_index[RF90_PATH_A] = -1 * delta_swing_table_idx_tdown_a[delta]; rtldm->absolute_ofdm_swing_idx[RF90_PATH_A] = -1 * delta_swing_table_idx_tdown_a[delta]; /* Record delta swing for mix mode power tracking*/ RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "******Temp is lower and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] = %d\n", rtldm->absolute_ofdm_swing_idx[RF90_PATH_A]); RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "deltaSwingTableIdx_TDOWN_B[%d] = %d\n", delta, delta_swing_table_idx_tdown_b[delta]); rtldm->delta_power_index_last[RF90_PATH_B] = rtldm->delta_power_index[RF90_PATH_B]; rtldm->delta_power_index[RF90_PATH_B] = -1 * delta_swing_table_idx_tdown_b[delta]; rtldm->absolute_ofdm_swing_idx[RF90_PATH_B] = -1 * delta_swing_table_idx_tdown_b[delta]; /*Record delta swing for mix mode power tracking*/ RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "******Temp is lower and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_B] = %d\n", rtldm->absolute_ofdm_swing_idx[RF90_PATH_B]); } for (p = RF90_PATH_A; p < MAX_PATH_NUM_8812A; p++) { RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "============================= [Path-%c]Calculating PowerIndexOffset =============================\n", (p == RF90_PATH_A ? 'A' : 'B')); if (rtldm->delta_power_index[p] == rtldm->delta_power_index_last[p]) /*If Thermal value changes but lookup table value still the same*/ rtldm->power_index_offset[p] = 0; else rtldm->power_index_offset[p] = rtldm->delta_power_index[p] - rtldm->delta_power_index_last[p]; /* Power Index Diff between 2 * times Power Tracking */ RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "[Path-%c] PowerIndexOffset(%d) =DeltaPowerIndex(%d) -DeltaPowerIndexLast(%d)\n", (p == RF90_PATH_A ? 'A' : 'B'), rtldm->power_index_offset[p], rtldm->delta_power_index[p] , rtldm->delta_power_index_last[p]); rtldm->ofdm_index[p] = rtldm->swing_idx_ofdm_base[p] + rtldm->power_index_offset[p]; rtldm->cck_index = rtldm->swing_idx_cck_base + rtldm->power_index_offset[p]; rtldm->swing_idx_cck = rtldm->cck_index; rtldm->swing_idx_ofdm[p] = rtldm->ofdm_index[p]; /****Print BB Swing Base and Index Offset */ RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "The 'CCK' final index(%d) = BaseIndex(%d) + PowerIndexOffset(%d)\n", rtldm->swing_idx_cck, rtldm->swing_idx_cck_base, rtldm->power_index_offset[p]); RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "The 'OFDM' final index(%d) = BaseIndex[%c](%d) + PowerIndexOffset(%d)\n", rtldm->swing_idx_ofdm[p], (p == RF90_PATH_A ? 'A' : 'B'), rtldm->swing_idx_ofdm_base[p], rtldm->power_index_offset[p]); /*7.1 Handle boundary conditions of index.*/ if (rtldm->ofdm_index[p] > TXSCALE_TABLE_SIZE - 1) rtldm->ofdm_index[p] = TXSCALE_TABLE_SIZE - 1; else if (rtldm->ofdm_index[p] < ofdm_min_index) rtldm->ofdm_index[p] = ofdm_min_index; } RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "\n\n====================================================================================\n"); if (rtldm->cck_index > TXSCALE_TABLE_SIZE - 1) rtldm->cck_index = TXSCALE_TABLE_SIZE - 1; else if (rtldm->cck_index < 0) rtldm->cck_index = 0; } else { RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "The thermal meter is unchanged or TxPowerTracking OFF(%d): ThermalValue: %d , pDM_Odm->RFCalibrateInfo.ThermalValue: %d\n", rtldm->txpower_track_control, thermal_value, rtldm->thermalvalue); for (p = RF90_PATH_A; p < MAX_PATH_NUM_8812A; p++) rtldm->power_index_offset[p] = 0; } /*Print Swing base & current*/ RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "TxPowerTracking: [CCK] Swing Current Index: %d,Swing Base Index: %d\n", rtldm->cck_index, rtldm->swing_idx_cck_base); for (p = RF90_PATH_A; p < MAX_PATH_NUM_8812A; p++) { RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "TxPowerTracking: [OFDM] Swing Current Index: %d,Swing Base Index[%c]: %d\n", rtldm->ofdm_index[p], (p == RF90_PATH_A ? 'A' : 'B'), rtldm->swing_idx_ofdm_base[p]); } if ((rtldm->power_index_offset[RF90_PATH_A] != 0 || rtldm->power_index_offset[RF90_PATH_B] != 0) && rtldm->txpower_track_control) { /*7.2 Configure the Swing Table to adjust Tx Power. *Always TRUE after Tx Power is adjusted by power tracking. * *2012/04/23 MH According to Luke's suggestion, *we can not write BB digital *to increase TX power. Otherwise, EVM will be bad. * *2012/04/25 MH Add for tx power tracking to set *tx power in tx agc for 88E. */ if (thermal_value > rtldm->thermalvalue) { RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "Temperature Increasing(A): delta_pi: %d , delta_t: %d, Now_t: %d,EFUSE_t: %d, Last_t: %d\n", rtldm->power_index_offset[RF90_PATH_A], delta, thermal_value, rtlefuse->eeprom_thermalmeter, rtldm->thermalvalue); RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "Temperature Increasing(B): delta_pi: %d ,delta_t: %d, Now_t: %d, EFUSE_t: %d, Last_t: %d\n", rtldm->power_index_offset[RF90_PATH_B], delta, thermal_value, rtlefuse->eeprom_thermalmeter, rtldm->thermalvalue); } else if (thermal_value < rtldm->thermalvalue) { /*Low temperature*/ RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "Temperature Decreasing(A): delta_pi: %d , delta_t: %d, Now_t: %d, EFUSE_t: %d, Last_t: %d\n", rtldm->power_index_offset[RF90_PATH_A], delta, thermal_value, rtlefuse->eeprom_thermalmeter, rtldm->thermalvalue); RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "Temperature Decreasing(B): delta_pi: %d , delta_t: %d, Now_t: %d, EFUSE_t: %d, Last_t: %d\n", rtldm->power_index_offset[RF90_PATH_B], delta, thermal_value, rtlefuse->eeprom_thermalmeter, rtldm->thermalvalue); } if (thermal_value > rtlefuse->eeprom_thermalmeter) { RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "Temperature(%d) higher than PG value(%d)\n", thermal_value, rtlefuse->eeprom_thermalmeter); RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "**********Enter POWER Tracking MIX_MODE**********\n"); for (p = RF90_PATH_A; p < MAX_PATH_NUM_8812A; p++) rtl8812ae_dm_txpwr_track_set_pwr(hw, MIX_MODE, p, 0); } else { RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "Temperature(%d) lower than PG value(%d)\n", thermal_value, rtlefuse->eeprom_thermalmeter); RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "**********Enter POWER Tracking MIX_MODE**********\n"); for (p = RF90_PATH_A; p < MAX_PATH_NUM_8812A; p++) rtl8812ae_dm_txpwr_track_set_pwr(hw, MIX_MODE, p, index_for_channel); } /*Record last time Power Tracking result as base.*/ rtldm->swing_idx_cck_base = rtldm->swing_idx_cck; for (p = RF90_PATH_A; p < MAX_PATH_NUM_8812A; p++) rtldm->swing_idx_ofdm_base[p] = rtldm->swing_idx_ofdm[p]; RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "pDM_Odm->RFCalibrateInfo.ThermalValue =%d ThermalValue= %d\n", rtldm->thermalvalue, thermal_value); /*Record last Power Tracking Thermal Value*/ rtldm->thermalvalue = thermal_value; } /*Delta temperature is equal to or larger than 20 centigrade (When threshold is 8).*/ if (delta_iqk >= IQK_THRESHOLD) rtl8812ae_do_iqk(hw, delta_iqk, thermal_value, 8); RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "<===rtl8812ae_dm_txpower_tracking_callback_thermalmeter\n"); }
the_stack_data/36074711.c
// SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2013 - 2021 Intel Corporation. */ #ifdef CONFIG_I40E_DCB #include "i40e.h" #include <net/dcbnl.h> #define I40E_DCBNL_STATUS_SUCCESS 0 #define I40E_DCBNL_STATUS_ERROR 1 static bool i40e_dcbnl_find_app(struct i40e_dcbx_config *cfg, struct i40e_dcb_app_priority_table *app); /** * i40e_get_pfc_delay - retrieve PFC Link Delay * @hw: pointer to hardware struct * @delay: holds the PFC Link delay value * * Returns PFC Link Delay from the PRTDCB_GENC.PFCLDA **/ static void i40e_get_pfc_delay(struct i40e_hw *hw, u16 *delay) { u32 val; val = rd32(hw, I40E_PRTDCB_GENC); *delay = (u16)((val & I40E_PRTDCB_GENC_PFCLDA_MASK) >> I40E_PRTDCB_GENC_PFCLDA_SHIFT); } /** * i40e_dcbnl_ieee_getets - retrieve local IEEE ETS configuration * @dev: the corresponding netdev * @ets: structure to hold the ETS information * * Returns local IEEE ETS configuration **/ static int i40e_dcbnl_ieee_getets(struct net_device *dev, struct ieee_ets *ets) { struct i40e_pf *pf = i40e_netdev_to_pf(dev); struct i40e_dcbx_config *dcbxcfg; if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_IEEE)) return -EINVAL; dcbxcfg = &pf->hw.local_dcbx_config; ets->willing = dcbxcfg->etscfg.willing; ets->ets_cap = I40E_MAX_TRAFFIC_CLASS; ets->cbs = dcbxcfg->etscfg.cbs; memcpy(ets->tc_tx_bw, dcbxcfg->etscfg.tcbwtable, sizeof(ets->tc_tx_bw)); memcpy(ets->tc_rx_bw, dcbxcfg->etscfg.tcbwtable, sizeof(ets->tc_rx_bw)); memcpy(ets->tc_tsa, dcbxcfg->etscfg.tsatable, sizeof(ets->tc_tsa)); memcpy(ets->prio_tc, dcbxcfg->etscfg.prioritytable, sizeof(ets->prio_tc)); memcpy(ets->tc_reco_bw, dcbxcfg->etsrec.tcbwtable, sizeof(ets->tc_reco_bw)); memcpy(ets->tc_reco_tsa, dcbxcfg->etsrec.tsatable, sizeof(ets->tc_reco_tsa)); memcpy(ets->reco_prio_tc, dcbxcfg->etscfg.prioritytable, sizeof(ets->reco_prio_tc)); return 0; } /** * i40e_dcbnl_ieee_getpfc - retrieve local IEEE PFC configuration * @dev: the corresponding netdev * @pfc: structure to hold the PFC information * * Returns local IEEE PFC configuration **/ static int i40e_dcbnl_ieee_getpfc(struct net_device *dev, struct ieee_pfc *pfc) { struct i40e_pf *pf = i40e_netdev_to_pf(dev); struct i40e_dcbx_config *dcbxcfg; struct i40e_hw *hw = &pf->hw; int i; if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_IEEE)) return -EINVAL; dcbxcfg = &hw->local_dcbx_config; pfc->pfc_cap = dcbxcfg->pfc.pfccap; pfc->pfc_en = dcbxcfg->pfc.pfcenable; pfc->mbc = dcbxcfg->pfc.mbc; i40e_get_pfc_delay(hw, &pfc->delay); /* Get Requests/Indications */ for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) { pfc->requests[i] = pf->stats.priority_xoff_tx[i]; pfc->indications[i] = pf->stats.priority_xoff_rx[i]; } return 0; } /** * i40e_dcbnl_ieee_setets - set IEEE ETS configuration * @netdev: the corresponding netdev * @ets: structure to hold the ETS information * * Set IEEE ETS configuration **/ static int i40e_dcbnl_ieee_setets(struct net_device *netdev, struct ieee_ets *ets) { struct i40e_pf *pf = i40e_netdev_to_pf(netdev); struct i40e_dcbx_config *old_cfg; int i, ret; if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_IEEE) || (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) return -EINVAL; old_cfg = &pf->hw.local_dcbx_config; /* Copy current config into temp */ pf->tmp_cfg = *old_cfg; /* Update the ETS configuration for temp */ pf->tmp_cfg.etscfg.willing = ets->willing; pf->tmp_cfg.etscfg.maxtcs = I40E_MAX_TRAFFIC_CLASS; pf->tmp_cfg.etscfg.cbs = ets->cbs; for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) { pf->tmp_cfg.etscfg.tcbwtable[i] = ets->tc_tx_bw[i]; pf->tmp_cfg.etscfg.tsatable[i] = ets->tc_tsa[i]; pf->tmp_cfg.etscfg.prioritytable[i] = ets->prio_tc[i]; pf->tmp_cfg.etsrec.tcbwtable[i] = ets->tc_reco_bw[i]; pf->tmp_cfg.etsrec.tsatable[i] = ets->tc_reco_tsa[i]; pf->tmp_cfg.etsrec.prioritytable[i] = ets->reco_prio_tc[i]; } /* Commit changes to HW */ ret = i40e_hw_dcb_config(pf, &pf->tmp_cfg); if (ret) { dev_info(&pf->pdev->dev, "Failed setting DCB ETS configuration err %s aq_err %s\n", i40e_stat_str(&pf->hw, ret), i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); return -EINVAL; } return 0; } /** * i40e_dcbnl_ieee_setpfc - set local IEEE PFC configuration * @netdev: the corresponding netdev * @pfc: structure to hold the PFC information * * Sets local IEEE PFC configuration **/ static int i40e_dcbnl_ieee_setpfc(struct net_device *netdev, struct ieee_pfc *pfc) { struct i40e_pf *pf = i40e_netdev_to_pf(netdev); struct i40e_dcbx_config *old_cfg; int ret; if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_IEEE) || (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) return -EINVAL; old_cfg = &pf->hw.local_dcbx_config; /* Copy current config into temp */ pf->tmp_cfg = *old_cfg; if (pfc->pfc_cap) pf->tmp_cfg.pfc.pfccap = pfc->pfc_cap; else pf->tmp_cfg.pfc.pfccap = I40E_MAX_TRAFFIC_CLASS; pf->tmp_cfg.pfc.pfcenable = pfc->pfc_en; ret = i40e_hw_dcb_config(pf, &pf->tmp_cfg); if (ret) { dev_info(&pf->pdev->dev, "Failed setting DCB PFC configuration err %s aq_err %s\n", i40e_stat_str(&pf->hw, ret), i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); return -EINVAL; } return 0; } /** * i40e_dcbnl_ieee_setapp - set local IEEE App configuration * @netdev: the corresponding netdev * @app: structure to hold the Application information * * Sets local IEEE App configuration **/ static int i40e_dcbnl_ieee_setapp(struct net_device *netdev, struct dcb_app *app) { struct i40e_pf *pf = i40e_netdev_to_pf(netdev); struct i40e_dcb_app_priority_table new_app; struct i40e_dcbx_config *old_cfg; int ret; if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_IEEE) || (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) return -EINVAL; old_cfg = &pf->hw.local_dcbx_config; if (old_cfg->numapps == I40E_DCBX_MAX_APPS) return -EINVAL; ret = dcb_ieee_setapp(netdev, app); if (ret) return ret; new_app.selector = app->selector; new_app.protocolid = app->protocol; new_app.priority = app->priority; /* Already internally available */ if (i40e_dcbnl_find_app(old_cfg, &new_app)) return 0; /* Copy current config into temp */ pf->tmp_cfg = *old_cfg; /* Add the app */ pf->tmp_cfg.app[pf->tmp_cfg.numapps++] = new_app; ret = i40e_hw_dcb_config(pf, &pf->tmp_cfg); if (ret) { dev_info(&pf->pdev->dev, "Failed setting DCB configuration err %s aq_err %s\n", i40e_stat_str(&pf->hw, ret), i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); return -EINVAL; } return 0; } /** * i40e_dcbnl_ieee_delapp - delete local IEEE App configuration * @netdev: the corresponding netdev * @app: structure to hold the Application information * * Deletes local IEEE App configuration other than the first application * required by firmware **/ static int i40e_dcbnl_ieee_delapp(struct net_device *netdev, struct dcb_app *app) { struct i40e_pf *pf = i40e_netdev_to_pf(netdev); struct i40e_dcbx_config *old_cfg; int i, j, ret; if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_IEEE) || (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) return -EINVAL; ret = dcb_ieee_delapp(netdev, app); if (ret) return ret; old_cfg = &pf->hw.local_dcbx_config; /* Need one app for FW so keep it */ if (old_cfg->numapps == 1) return 0; /* Copy current config into temp */ pf->tmp_cfg = *old_cfg; /* Find and reset the app */ for (i = 1; i < pf->tmp_cfg.numapps; i++) { if (app->selector == pf->tmp_cfg.app[i].selector && app->protocol == pf->tmp_cfg.app[i].protocolid && app->priority == pf->tmp_cfg.app[i].priority) { /* Reset the app data */ pf->tmp_cfg.app[i].selector = 0; pf->tmp_cfg.app[i].protocolid = 0; pf->tmp_cfg.app[i].priority = 0; break; } } /* If the specific DCB app not found */ if (i == pf->tmp_cfg.numapps) return -EINVAL; pf->tmp_cfg.numapps--; /* Overwrite the tmp_cfg app */ for (j = i; j < pf->tmp_cfg.numapps; j++) pf->tmp_cfg.app[j] = old_cfg->app[j + 1]; ret = i40e_hw_dcb_config(pf, &pf->tmp_cfg); if (ret) { dev_info(&pf->pdev->dev, "Failed setting DCB configuration err %s aq_err %s\n", i40e_stat_str(&pf->hw, ret), i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); return -EINVAL; } return 0; } /** * i40e_dcbnl_getstate - Get DCB enabled state * @netdev: the corresponding netdev * * Get the current DCB enabled state **/ static u8 i40e_dcbnl_getstate(struct net_device *netdev) { struct i40e_pf *pf = i40e_netdev_to_pf(netdev); dev_dbg(&pf->pdev->dev, "DCB state=%d\n", !!(pf->flags & I40E_FLAG_DCB_ENABLED)); return !!(pf->flags & I40E_FLAG_DCB_ENABLED); } /** * i40e_dcbnl_setstate - Set DCB state * @netdev: the corresponding netdev * @state: enable or disable * * Set the DCB state **/ static u8 i40e_dcbnl_setstate(struct net_device *netdev, u8 state) { struct i40e_pf *pf = i40e_netdev_to_pf(netdev); int ret = I40E_DCBNL_STATUS_SUCCESS; if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_CEE) || (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) return ret; dev_dbg(&pf->pdev->dev, "new state=%d current state=%d\n", state, (pf->flags & I40E_FLAG_DCB_ENABLED) ? 1 : 0); /* Nothing to do */ if (!state == !(pf->flags & I40E_FLAG_DCB_ENABLED)) return ret; if (i40e_is_sw_dcb(pf)) { if (state) { pf->flags |= I40E_FLAG_DCB_ENABLED; memcpy(&pf->hw.desired_dcbx_config, &pf->hw.local_dcbx_config, sizeof(struct i40e_dcbx_config)); } else { pf->flags &= ~I40E_FLAG_DCB_ENABLED; } } else { /* Cannot directly manipulate FW LLDP Agent */ ret = I40E_DCBNL_STATUS_ERROR; } return ret; } /** * i40e_dcbnl_set_pg_tc_cfg_tx - Set CEE PG Tx config * @netdev: the corresponding netdev * @tc: the corresponding traffic class * @prio_type: the traffic priority type * @bwg_id: the BW group id the traffic class belongs to * @bw_pct: the BW percentage for the corresponding BWG * @up_map: prio mapped to corresponding tc * * Set Tx PG settings for CEE mode **/ static void i40e_dcbnl_set_pg_tc_cfg_tx(struct net_device *netdev, int tc, u8 prio_type, u8 bwg_id, u8 bw_pct, u8 up_map) { struct i40e_pf *pf = i40e_netdev_to_pf(netdev); int i; if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_CEE) || (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) return; /* LLTC not supported yet */ if (tc >= I40E_MAX_TRAFFIC_CLASS) return; /* prio_type, bwg_id and bw_pct per UP are not supported */ /* Use only up_map to map tc */ for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) { if (up_map & BIT(i)) pf->tmp_cfg.etscfg.prioritytable[i] = tc; } pf->tmp_cfg.etscfg.tsatable[tc] = I40E_IEEE_TSA_ETS; dev_dbg(&pf->pdev->dev, "Set PG config tc=%d bwg_id=%d prio_type=%d bw_pct=%d up_map=%d\n", tc, bwg_id, prio_type, bw_pct, up_map); } /** * i40e_dcbnl_set_pg_tc_cfg_tx - Set CEE PG Tx BW config * @netdev: the corresponding netdev * @pgid: the corresponding traffic class * @bw_pct: the BW percentage for the specified traffic class * * Set Tx BW settings for CEE mode **/ static void i40e_dcbnl_set_pg_bwg_cfg_tx(struct net_device *netdev, int pgid, u8 bw_pct) { struct i40e_pf *pf = i40e_netdev_to_pf(netdev); if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_CEE) || (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) return; /* LLTC not supported yet */ if (pgid >= I40E_MAX_TRAFFIC_CLASS) return; pf->tmp_cfg.etscfg.tcbwtable[pgid] = bw_pct; dev_dbg(&pf->pdev->dev, "Set PG BW config tc=%d bw_pct=%d\n", pgid, bw_pct); } /** * i40e_dcbnl_set_pg_tc_cfg_rx - Set CEE PG Rx config * @netdev: the corresponding netdev * @prio: the corresponding traffic class * @prio_type: the traffic priority type * @pgid: the BW group id the traffic class belongs to * @bw_pct: the BW percentage for the corresponding BWG * @up_map: prio mapped to corresponding tc * * Set Rx BW settings for CEE mode. The hardware does not support this * so we won't allow setting of this parameter. **/ static void i40e_dcbnl_set_pg_tc_cfg_rx(struct net_device *netdev, int __always_unused prio, u8 __always_unused prio_type, u8 __always_unused pgid, u8 __always_unused bw_pct, u8 __always_unused up_map) { struct i40e_pf *pf = i40e_netdev_to_pf(netdev); dev_dbg(&pf->pdev->dev, "Rx TC PG Config Not Supported.\n"); } /** * i40e_dcbnl_set_pg_bwg_cfg_rx - Set CEE PG Rx config * @netdev: the corresponding netdev * @pgid: the corresponding traffic class * @bw_pct: the BW percentage for the specified traffic class * * Set Rx BW settings for CEE mode. The hardware does not support this * so we won't allow setting of this parameter. **/ static void i40e_dcbnl_set_pg_bwg_cfg_rx(struct net_device *netdev, int pgid, u8 bw_pct) { struct i40e_pf *pf = i40e_netdev_to_pf(netdev); dev_dbg(&pf->pdev->dev, "Rx BWG PG Config Not Supported.\n"); } /** * i40e_dcbnl_get_pg_tc_cfg_tx - Get CEE PG Tx config * @netdev: the corresponding netdev * @prio: the corresponding user priority * @prio_type: traffic priority type * @pgid: the BW group ID the traffic class belongs to * @bw_pct: BW percentage for the corresponding BWG * @up_map: prio mapped to corresponding TC * * Get Tx PG settings for CEE mode **/ static void i40e_dcbnl_get_pg_tc_cfg_tx(struct net_device *netdev, int prio, u8 __always_unused *prio_type, u8 *pgid, u8 __always_unused *bw_pct, u8 __always_unused *up_map) { struct i40e_pf *pf = i40e_netdev_to_pf(netdev); if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_CEE) || (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) return; if (prio >= I40E_MAX_USER_PRIORITY) return; *pgid = pf->hw.local_dcbx_config.etscfg.prioritytable[prio]; dev_dbg(&pf->pdev->dev, "Get PG config prio=%d tc=%d\n", prio, *pgid); } /** * i40e_dcbnl_get_pg_bwg_cfg_tx - Get CEE PG BW config * @netdev: the corresponding netdev * @pgid: the corresponding traffic class * @bw_pct: the BW percentage for the corresponding TC * * Get Tx BW settings for given TC in CEE mode **/ static void i40e_dcbnl_get_pg_bwg_cfg_tx(struct net_device *netdev, int pgid, u8 *bw_pct) { struct i40e_pf *pf = i40e_netdev_to_pf(netdev); if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_CEE) || (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) return; if (pgid >= I40E_MAX_TRAFFIC_CLASS) return; *bw_pct = pf->hw.local_dcbx_config.etscfg.tcbwtable[pgid]; dev_dbg(&pf->pdev->dev, "Get PG BW config tc=%d bw_pct=%d\n", pgid, *bw_pct); } /** * i40e_dcbnl_get_pg_tc_cfg_rx - Get CEE PG Rx config * @netdev: the corresponding netdev * @prio: the corresponding user priority * @prio_type: the traffic priority type * @pgid: the PG ID * @bw_pct: the BW percentage for the corresponding BWG * @up_map: prio mapped to corresponding TC * * Get Rx PG settings for CEE mode. The UP2TC map is applied in same * manner for Tx and Rx (symmetrical) so return the TC information for * given priority accordingly. **/ static void i40e_dcbnl_get_pg_tc_cfg_rx(struct net_device *netdev, int prio, u8 *prio_type, u8 *pgid, u8 *bw_pct, u8 *up_map) { struct i40e_pf *pf = i40e_netdev_to_pf(netdev); if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_CEE) || (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) return; if (prio >= I40E_MAX_USER_PRIORITY) return; *pgid = pf->hw.local_dcbx_config.etscfg.prioritytable[prio]; } /** * i40e_dcbnl_get_pg_bwg_cfg_rx - Get CEE PG BW Rx config * @netdev: the corresponding netdev * @pgid: the corresponding traffic class * @bw_pct: the BW percentage for the corresponding TC * * Get Rx BW settings for given TC in CEE mode * The adapter doesn't support Rx ETS and runs in strict priority * mode in Rx path and hence just return 0. **/ static void i40e_dcbnl_get_pg_bwg_cfg_rx(struct net_device *netdev, int pgid, u8 *bw_pct) { struct i40e_pf *pf = i40e_netdev_to_pf(netdev); if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_CEE) || (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) return; *bw_pct = 0; } /** * i40e_dcbnl_set_pfc_cfg - Set CEE PFC configuration * @netdev: the corresponding netdev * @prio: the corresponding user priority * @setting: the PFC setting for given priority * * Set the PFC enabled/disabled setting for given user priority **/ static void i40e_dcbnl_set_pfc_cfg(struct net_device *netdev, int prio, u8 setting) { struct i40e_pf *pf = i40e_netdev_to_pf(netdev); if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_CEE) || (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) return; if (prio >= I40E_MAX_USER_PRIORITY) return; pf->tmp_cfg.pfc.pfccap = I40E_MAX_TRAFFIC_CLASS; if (setting) pf->tmp_cfg.pfc.pfcenable |= BIT(prio); else pf->tmp_cfg.pfc.pfcenable &= ~BIT(prio); dev_dbg(&pf->pdev->dev, "Set PFC Config up=%d setting=%d pfcenable=0x%x\n", prio, setting, pf->tmp_cfg.pfc.pfcenable); } /** * i40e_dcbnl_get_pfc_cfg - Get CEE PFC configuration * @netdev: the corresponding netdev * @prio: the corresponding user priority * @setting: the PFC setting for given priority * * Get the PFC enabled/disabled setting for given user priority **/ static void i40e_dcbnl_get_pfc_cfg(struct net_device *netdev, int prio, u8 *setting) { struct i40e_pf *pf = i40e_netdev_to_pf(netdev); if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_CEE) || (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) return; if (prio >= I40E_MAX_USER_PRIORITY) return; *setting = (pf->hw.local_dcbx_config.pfc.pfcenable >> prio) & 0x1; dev_dbg(&pf->pdev->dev, "Get PFC Config up=%d setting=%d pfcenable=0x%x\n", prio, *setting, pf->hw.local_dcbx_config.pfc.pfcenable); } /** * i40e_dcbnl_cee_set_all - Commit CEE DCB settings to hardware * @netdev: the corresponding netdev * * Commit the current DCB configuration to hardware **/ static u8 i40e_dcbnl_cee_set_all(struct net_device *netdev) { struct i40e_pf *pf = i40e_netdev_to_pf(netdev); int err; if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_CEE) || (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) return I40E_DCBNL_STATUS_ERROR; dev_dbg(&pf->pdev->dev, "Commit DCB Configuration to the hardware\n"); err = i40e_hw_dcb_config(pf, &pf->tmp_cfg); return err ? I40E_DCBNL_STATUS_ERROR : I40E_DCBNL_STATUS_SUCCESS; } /** * i40e_dcbnl_get_cap - Get DCBX capabilities of adapter * @netdev: the corresponding netdev * @capid: the capability type * @cap: the capability value * * Return the capability value for a given capability type **/ static u8 i40e_dcbnl_get_cap(struct net_device *netdev, int capid, u8 *cap) { struct i40e_pf *pf = i40e_netdev_to_pf(netdev); if (!(pf->flags & I40E_FLAG_DCB_CAPABLE)) return I40E_DCBNL_STATUS_ERROR; switch (capid) { case DCB_CAP_ATTR_PG: case DCB_CAP_ATTR_PFC: *cap = true; break; case DCB_CAP_ATTR_PG_TCS: case DCB_CAP_ATTR_PFC_TCS: *cap = 0x80; break; case DCB_CAP_ATTR_DCBX: *cap = pf->dcbx_cap; break; case DCB_CAP_ATTR_UP2TC: case DCB_CAP_ATTR_GSP: case DCB_CAP_ATTR_BCN: default: *cap = false; break; } dev_dbg(&pf->pdev->dev, "Get Capability cap=%d capval=0x%x\n", capid, *cap); return I40E_DCBNL_STATUS_SUCCESS; } /** * i40e_dcbnl_getnumtcs - Get max number of traffic classes supported * @netdev: the corresponding netdev * @tcid: the TC id * @num: total number of TCs supported by the device * * Return the total number of TCs supported by the adapter **/ static int i40e_dcbnl_getnumtcs(struct net_device *netdev, int tcid, u8 *num) { struct i40e_pf *pf = i40e_netdev_to_pf(netdev); if (!(pf->flags & I40E_FLAG_DCB_CAPABLE)) return -EINVAL; *num = I40E_MAX_TRAFFIC_CLASS; return 0; } /** * i40e_dcbnl_setnumtcs - Set CEE number of traffic classes * @netdev: the corresponding netdev * @tcid: the TC id * @num: total number of TCs * * Set the total number of TCs (Unsupported) **/ static int i40e_dcbnl_setnumtcs(struct net_device *netdev, int tcid, u8 num) { return -EINVAL; } /** * i40e_dcbnl_getpfcstate - Get CEE PFC mode * @netdev: the corresponding netdev * * Get the current PFC enabled state **/ static u8 i40e_dcbnl_getpfcstate(struct net_device *netdev) { struct i40e_pf *pf = i40e_netdev_to_pf(netdev); /* Return enabled if any PFC enabled UP */ if (pf->hw.local_dcbx_config.pfc.pfcenable) return 1; else return 0; } /** * i40e_dcbnl_setpfcstate - Set CEE PFC mode * @netdev: the corresponding netdev * @state: required state * * The PFC state to be set; this is enabled/disabled based on the PFC * priority settings and not via this call for i40e driver **/ static void i40e_dcbnl_setpfcstate(struct net_device *netdev, u8 state) { struct i40e_pf *pf = i40e_netdev_to_pf(netdev); dev_dbg(&pf->pdev->dev, "PFC State is modified via PFC config.\n"); } /** * i40e_dcbnl_getapp - Get CEE APP * @netdev: the corresponding netdev * @idtype: the App selector * @id: the App ethtype or port number * * Return the CEE mode app for the given idtype and id **/ static int i40e_dcbnl_getapp(struct net_device *netdev, u8 idtype, u16 id) { struct i40e_pf *pf = i40e_netdev_to_pf(netdev); struct dcb_app app = { .selector = idtype, .protocol = id, }; if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_CEE) || (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) return -EINVAL; return dcb_getapp(netdev, &app); } /** * i40e_dcbnl_setdcbx - set required DCBx capability * @netdev: the corresponding netdev * @mode: new DCB mode managed or CEE+IEEE * * Set DCBx capability features **/ static u8 i40e_dcbnl_setdcbx(struct net_device *netdev, u8 mode) { struct i40e_pf *pf = i40e_netdev_to_pf(netdev); /* Do not allow to set mode if managed by Firmware */ if (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED) return I40E_DCBNL_STATUS_ERROR; /* No support for LLD_MANAGED modes or CEE+IEEE */ if ((mode & DCB_CAP_DCBX_LLD_MANAGED) || ((mode & DCB_CAP_DCBX_VER_IEEE) && (mode & DCB_CAP_DCBX_VER_CEE)) || !(mode & DCB_CAP_DCBX_HOST)) return I40E_DCBNL_STATUS_ERROR; /* Already set to the given mode no change */ if (mode == pf->dcbx_cap) return I40E_DCBNL_STATUS_SUCCESS; pf->dcbx_cap = mode; if (mode & DCB_CAP_DCBX_VER_CEE) pf->hw.local_dcbx_config.dcbx_mode = I40E_DCBX_MODE_CEE; else pf->hw.local_dcbx_config.dcbx_mode = I40E_DCBX_MODE_IEEE; dev_dbg(&pf->pdev->dev, "mode=%d\n", mode); return I40E_DCBNL_STATUS_SUCCESS; } /** * i40e_dcbnl_getdcbx - retrieve current DCBx capability * @dev: the corresponding netdev * * Returns DCBx capability features **/ static u8 i40e_dcbnl_getdcbx(struct net_device *dev) { struct i40e_pf *pf = i40e_netdev_to_pf(dev); return pf->dcbx_cap; } /** * i40e_dcbnl_get_perm_hw_addr - MAC address used by DCBx * @dev: the corresponding netdev * @perm_addr: buffer to store the MAC address * * Returns the SAN MAC address used for LLDP exchange **/ static void i40e_dcbnl_get_perm_hw_addr(struct net_device *dev, u8 *perm_addr) { struct i40e_pf *pf = i40e_netdev_to_pf(dev); int i, j; memset(perm_addr, 0xff, MAX_ADDR_LEN); for (i = 0; i < dev->addr_len; i++) perm_addr[i] = pf->hw.mac.perm_addr[i]; for (j = 0; j < dev->addr_len; j++, i++) perm_addr[i] = pf->hw.mac.san_addr[j]; } static const struct dcbnl_rtnl_ops dcbnl_ops = { .ieee_getets = i40e_dcbnl_ieee_getets, .ieee_getpfc = i40e_dcbnl_ieee_getpfc, .getdcbx = i40e_dcbnl_getdcbx, .getpermhwaddr = i40e_dcbnl_get_perm_hw_addr, .ieee_setets = i40e_dcbnl_ieee_setets, .ieee_setpfc = i40e_dcbnl_ieee_setpfc, .ieee_setapp = i40e_dcbnl_ieee_setapp, .ieee_delapp = i40e_dcbnl_ieee_delapp, .getstate = i40e_dcbnl_getstate, .setstate = i40e_dcbnl_setstate, .setpgtccfgtx = i40e_dcbnl_set_pg_tc_cfg_tx, .setpgbwgcfgtx = i40e_dcbnl_set_pg_bwg_cfg_tx, .setpgtccfgrx = i40e_dcbnl_set_pg_tc_cfg_rx, .setpgbwgcfgrx = i40e_dcbnl_set_pg_bwg_cfg_rx, .getpgtccfgtx = i40e_dcbnl_get_pg_tc_cfg_tx, .getpgbwgcfgtx = i40e_dcbnl_get_pg_bwg_cfg_tx, .getpgtccfgrx = i40e_dcbnl_get_pg_tc_cfg_rx, .getpgbwgcfgrx = i40e_dcbnl_get_pg_bwg_cfg_rx, .setpfccfg = i40e_dcbnl_set_pfc_cfg, .getpfccfg = i40e_dcbnl_get_pfc_cfg, .setall = i40e_dcbnl_cee_set_all, .getcap = i40e_dcbnl_get_cap, .getnumtcs = i40e_dcbnl_getnumtcs, .setnumtcs = i40e_dcbnl_setnumtcs, .getpfcstate = i40e_dcbnl_getpfcstate, .setpfcstate = i40e_dcbnl_setpfcstate, .getapp = i40e_dcbnl_getapp, .setdcbx = i40e_dcbnl_setdcbx, }; /** * i40e_dcbnl_set_all - set all the apps and ieee data from DCBx config * @vsi: the corresponding vsi * * Set up all the IEEE APPs in the DCBNL App Table and generate event for * other settings **/ void i40e_dcbnl_set_all(struct i40e_vsi *vsi) { struct net_device *dev = vsi->netdev; struct i40e_pf *pf = i40e_netdev_to_pf(dev); struct i40e_dcbx_config *dcbxcfg; struct i40e_hw *hw = &pf->hw; struct dcb_app sapp; u8 prio, tc_map; int i; /* SW DCB taken care by DCBNL set calls */ if (pf->dcbx_cap & DCB_CAP_DCBX_HOST) return; /* DCB not enabled */ if (!(pf->flags & I40E_FLAG_DCB_ENABLED)) return; /* MFP mode but not an iSCSI PF so return */ if ((pf->flags & I40E_FLAG_MFP_ENABLED) && !(hw->func_caps.iscsi)) return; dcbxcfg = &hw->local_dcbx_config; /* Set up all the App TLVs if DCBx is negotiated */ for (i = 0; i < dcbxcfg->numapps; i++) { prio = dcbxcfg->app[i].priority; tc_map = BIT(dcbxcfg->etscfg.prioritytable[prio]); /* Add APP only if the TC is enabled for this VSI */ if (tc_map & vsi->tc_config.enabled_tc) { sapp.selector = dcbxcfg->app[i].selector; sapp.protocol = dcbxcfg->app[i].protocolid; sapp.priority = prio; dcb_ieee_setapp(dev, &sapp); } } /* Notify user-space of the changes */ dcbnl_ieee_notify(dev, RTM_SETDCB, DCB_CMD_IEEE_SET, 0, 0); } /** * i40e_dcbnl_vsi_del_app - Delete APP for given VSI * @vsi: the corresponding vsi * @app: APP to delete * * Delete given APP from the DCBNL APP table for given * VSI **/ static int i40e_dcbnl_vsi_del_app(struct i40e_vsi *vsi, struct i40e_dcb_app_priority_table *app) { struct net_device *dev = vsi->netdev; struct dcb_app sapp; if (!dev) return -EINVAL; sapp.selector = app->selector; sapp.protocol = app->protocolid; sapp.priority = app->priority; return dcb_ieee_delapp(dev, &sapp); } /** * i40e_dcbnl_del_app - Delete APP on all VSIs * @pf: the corresponding PF * @app: APP to delete * * Delete given APP from all the VSIs for given PF **/ static void i40e_dcbnl_del_app(struct i40e_pf *pf, struct i40e_dcb_app_priority_table *app) { int v, err; for (v = 0; v < pf->num_alloc_vsi; v++) { if (pf->vsi[v] && pf->vsi[v]->netdev) { err = i40e_dcbnl_vsi_del_app(pf->vsi[v], app); dev_dbg(&pf->pdev->dev, "Deleting app for VSI seid=%d err=%d sel=%d proto=0x%x prio=%d\n", pf->vsi[v]->seid, err, app->selector, app->protocolid, app->priority); } } } /** * i40e_dcbnl_find_app - Search APP in given DCB config * @cfg: DCBX configuration data * @app: APP to search for * * Find given APP in the DCB configuration **/ static bool i40e_dcbnl_find_app(struct i40e_dcbx_config *cfg, struct i40e_dcb_app_priority_table *app) { int i; for (i = 0; i < cfg->numapps; i++) { if (app->selector == cfg->app[i].selector && app->protocolid == cfg->app[i].protocolid && app->priority == cfg->app[i].priority) return true; } return false; } /** * i40e_dcbnl_flush_apps - Delete all removed APPs * @pf: the corresponding PF * @old_cfg: old DCBX configuration data * @new_cfg: new DCBX configuration data * * Find and delete all APPs that are not present in the passed * DCB configuration **/ void i40e_dcbnl_flush_apps(struct i40e_pf *pf, struct i40e_dcbx_config *old_cfg, struct i40e_dcbx_config *new_cfg) { struct i40e_dcb_app_priority_table app; int i; /* MFP mode but not an iSCSI PF so return */ if ((pf->flags & I40E_FLAG_MFP_ENABLED) && !(pf->hw.func_caps.iscsi)) return; for (i = 0; i < old_cfg->numapps; i++) { app = old_cfg->app[i]; /* The APP is not available anymore delete it */ if (!i40e_dcbnl_find_app(new_cfg, &app)) i40e_dcbnl_del_app(pf, &app); } } /** * i40e_dcbnl_setup - DCBNL setup * @vsi: the corresponding vsi * * Set up DCBNL ops and initial APP TLVs **/ void i40e_dcbnl_setup(struct i40e_vsi *vsi) { struct net_device *dev = vsi->netdev; struct i40e_pf *pf = i40e_netdev_to_pf(dev); /* Not DCB capable */ if (!(pf->flags & I40E_FLAG_DCB_CAPABLE)) return; dev->dcbnl_ops = &dcbnl_ops; /* Set initial IEEE DCB settings */ i40e_dcbnl_set_all(vsi); } #endif /* CONFIG_I40E_DCB */
the_stack_data/98575166.c
#include <stdio.h> #include <string.h> /* - steps: - read the file into the buffer: https://stackoverflow.com/questions/51224682/read-file-byte-by-byte-using-c - iterate over the buffer, xorring the bits, then covert to little endian - store the contents into the comm_packet structure */ struct comm_packet { // Offset char Id[4]; // 0 char NodeName[8]; // 4 int NodeNumber; // 12 int tx_packet_nbr; // 16 int rx_packet_nbr; // 20 int track_object_nbr; // 24 int track_object_x_pos; // 28 int track_object_y_pos; // 32 int track_object_z_pos; // 36 int track_object_velocity; // 40 int status_code; // 44 unsigned char msg_length; // 48 char status_msg[128]; // 49 }; int main() { unsigned char key[9] = {0x36, 0x13, 0x92, 0xa5, 0x5a, 0x27, 0xf3, 0x00, 0x32}; // // struct comm_packet packet; FILE *fp; fp = fopen("../inputs/packet", "rb"); char buffer[180]; fread(&buffer, 1, 180, fp); fclose(fp); printf("\n"); int index = 0; for (int i = 0; i < 180; ++i) { buffer[i] = buffer[i] ^ key[index % 9]; index++; } for (int i = 0; i < 180; ++i) { printf("%c", buffer[i]); } printf("\n"); return 0; }
the_stack_data/28263151.c
// Celsius to Kelvin converter #include <stdio.h> int main(void) { double c, k; printf("Enter the desired temperature in Celsius:\n"); scanf("%lf", &c); k = c + 273.15; printf("Converted value in Kelvin: %f\n", k); return 0; }
the_stack_data/731062.c
#include<stdio.h> double f(double x) { return x; } double simpson(double(*f)(double),double a,double b,int n) { float h=(b-a)/n; double x=a+h; double z=a+h/2; double I1=0; double I2=f(z); for(int i=0; i<n-1; i++) { z=z+h; I1=I1+f(x); I2=I2+f(z); x=x+h; } return (h/6)*(f(a)+f(b)+2*I1+4*I2); } int main() { double s; double a=0; double b=1; int n=100; s=simpson(f,a,b,n); printf("le resultat est %f",s); return 0; }
the_stack_data/14200285.c
/* Taxonomy Classification: 0000000100000013000010 */ /* * WRITE/READ 0 write * WHICH BOUND 0 upper * DATA TYPE 0 char * MEMORY LOCATION 0 stack * SCOPE 0 same * CONTAINER 0 no * POINTER 0 no * INDEX COMPLEXITY 1 variable * ADDRESS COMPLEXITY 0 constant * LENGTH COMPLEXITY 0 N/A * ADDRESS ALIAS 0 none * INDEX ALIAS 0 none * LOCAL CONTROL FLOW 0 none * SECONDARY CONTROL FLOW 0 none * LOOP STRUCTURE 1 for * LOOP COMPLEXITY 3 two * ASYNCHRONY 0 no * TAINT 0 no * RUNTIME ENV. DEPENDENCE 0 no * MAGNITUDE 0 no overflow * CONTINUOUS/DISCRETE 1 continuous * SIGNEDNESS 0 no */ /* Copyright 2005 Massachusetts Institute of Technology All rights reserved. Redistribution and use of software 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 set of conditions and the disclaimer below. - Redistributions in binary form must reproduce the copyright notice, this set of conditions, and the disclaimer below in the documentation and/or other materials provided with the distribution. - Neither the name of the Massachusetts Institute of Technology 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". ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ int main(int argc, char *argv[]) { int init_value; int test_value; int loop_counter; char buf[10]; init_value = 0; test_value = 9; for(loop_counter = init_value; loop_counter <= test_value; loop_counter++) { /* OK */ buf[loop_counter] = 'A'; } return 0; }
the_stack_data/1084863.c
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { char nome[30][30]; float av1[30]; int i, j; //"x" eh a variavel auxiliar char y[30];// outra variavel auxiliar float x; printf("\nOlá, meu nome é Igor de Andrade e este programa pode ser visto no seguinte endereço do github: https://github.com/igorioshi/trabalhoAv2/blob/master/trabalho.c \n"); for(i=0; i<=29; i++) { //Entrar com o nome e nota do aluno printf("\nEntre com o nome do aluno %d: ", i+1); scanf("%s", nome[i]); printf("Entre com a AV1 do %s: ", nome[i]); scanf("%f", &av1[i]); } //ordenaçao em bolha for(i=0; i<=29; i++) { for(j=i+1;j<=29; j++) { if(av1[j] > av1[i]) { x = av1[j]; av1[j] = av1[i]; av1[i] = x; strcpy(y, nome[j]); strcpy(nome[j], nome[i]); strcpy(nome[i], y); } } } //Listagem printf("\nAluno\t\t\tAV1"); printf("\n----------------------------"); //Relatorio for(i=0; i<=29; i++) { printf("\n%s \t\t\t%.2f", nome[i], av1[i]); } printf("\n-----------------------------"); return 0; }
the_stack_data/435212.c
#include <stdlib.h> #include <stdio.h> #define N 10 //solve ly=B float *descente(float l[N][N], float B[N], int n) { float *x; x = malloc(sizeof(float) * n); x[0]=B[0]/l[0][0]; for(int i=1; i<n; i++){ float sum=0; for(int j=0; j<=i-1;j++){ sum+=l[i][j]*x[j]; } x[i]=(B[i]-sum)/l[i][i]; } return (x); } //solve ux=y float *remontee(float u[N][N], float y[N], int n) { float *x; x = malloc(sizeof(float) * n); /******Implement the solution here******/ x[n-1]=y[n-1]/u[n-1][n-1]; for(int i=n-2;i>=0;i--){ float sum=0; for(int j=i;j<n;j++){ sum+=u[i][j]*x[j]; } x[i]=(y[i]-sum)/u[i][i]; } return x; } float *lu(float a[N][N], float B[N], int n) { /******Implement the solution here******/ /***************************************/ float u[N][N]; float l[N][N]; float *y; float *x; for(int i=0;i<n; i++){ for(int j=0;j<n;j++){ if(i==j) l[i][j]=1; } } for(int i=0;i<n;i++){ u[0][i]=a[0][i]; } for(int k=0;k<n-1; k++){ for(int i=k+1;i<n;i++){ l[i][k]=a[i][k]/a[k][k]; for(int j=k+1; j<n; j++){ a[i][j]=a[i][j]-l[i][k]*a[k][j]; if(i<=j) u[i][j]=a[i][j]; } } y=descente(l, B, n); x=remontee(u, y, n); } /***************************************/ return (x); } int main() { float A[N][N], B[N]; float *x; int n; printf("Enter the size of the matrix: "); scanf("%d", &n); /* Filling the matrix A */ printf("Filling the matrix A\n"); for(int i = 0; i < n; i++) { for(int j = 0; j < n; j++) { printf("A[%d][%d] = ", i, j); scanf("%f", &A[i][j]); } } /* Filling the vector B*/ printf("Filling the matrix B\n"); for (int i = 0; i < n; i++) { printf("B[%d] = ", i); scanf("%f", &B[i]); } /* The calculation of the result */ x = lu(A, B, n); /* Printing the results */ printf("\nThe resulting vector: ["); for (int i = 0; i < n; i++) printf("%f%c", x[i], ",]"[i == n - 1]); }
the_stack_data/93434.c
/*numPass=2, numTotal=9 Verdict:WRONG_ANSWER, Visibility:1, Input:"abcxy b hi", ExpOutput:"ahibcxy", Output:"ahi" Verdict:WRONG_ANSWER, Visibility:1, Input:"jhggd g sdfghjk", ExpOutput:"jhsdfghjkggd", Output:"jhsdf" Verdict:WRONG_ANSWER, Visibility:1, Input:"dfghj j cvb", ExpOutput:"dfghcvbj", Output:"dfghc" Verdict:WRONG_ANSWER, Visibility:1, Input:"d d asdfg", ExpOutput:"asdfgd", Output:"a" Verdict:WRONG_ANSWER, Visibility:1, Input:"Thisproblemhasnoautomatedtestcases. . ----isn'tit?", ExpOutput:"Thisproblemhasnoautomatedtestcases----isn'tit?.", Output:"Thisproblemhasnoautomatedtestcases-" Verdict:WRONG_ANSWER, Visibility:0, Input:"qwerty q zxcvb", ExpOutput:"zxcvbqwerty", Output:"zxcvb" Verdict:ACCEPTED, Visibility:0, Input:"qwerty a zxcvb", ExpOutput:"qwerty", Output:"qwerty" Verdict:ACCEPTED, Visibility:0, Input:"Thisproblemhasnoautomatedtestcases. , zxcvb", ExpOutput:"Thisproblemhasnoautomatedtestcases.", Output:"Thisproblemhasnoautomatedtestcases." Verdict:WRONG_ANSWER, Visibility:0, Input:"Thisproblemhasnoautomatedtestcases. . ,,isn'tit?", ExpOutput:"Thisproblemhasnoautomatedtestcases,,isn'tit?.", Output:"Thisproblemhasnoautomatedtestcases," */ #include <stdio.h> int main() { int flag=-1,i,j,l1,l2; char c1,s1[100],s2[50]; scanf("%s\n",s1); scanf("%c\n",&c1); scanf("%s\n",s2); for(i=0;s1[i]!='\0';i++); l1=i; for(i=0;s2[i]!='\0';i++); l2=i; for(i=0;i<l1;i++) { if(s1[i]==c1) { flag=i; break; } } if(flag==-1) printf("%s",s1); else { for(j=l1-1;j>=flag;j--) { s1[j+l2]=s1[j]; } int c=0; for(i=flag;i<l1;i++) { s1[i]=s2[c]; c++; } printf("%s",s1); } return 0; }
the_stack_data/554825.c
#include <stdio.h> int main() { foo(); return 0; } void foo() { printf("Hello world"); }
the_stack_data/200142910.c
//SJF program in C //.::SJF::. #include<stdio.h> int main() { int n,j,temp,temp1,temp2,pr[10],b[10],t[10],w[10],p[10],i; float att=0,awt=0; for(i=0;i<10;i++) { b[i]=0;w[i]=0; } printf(".::SJF::."); printf("\n\nEnter the number of processes :"); scanf("%d",&n); printf("Enter the burst times :"); for(i=0;i<n;i++) { scanf("%d",&b[i]); p[i]=i; } for(i=0;i<n;i++) { for(j=i;j<n;j++) { if(b[i]>b[j]) { temp=b[i]; temp1=p[i]; b[i]=b[j]; p[i]=p[j]; b[j]=temp; p[j]=temp1; } } } w[0]=0; for(i=0;i<n;i++) w[i+1]=w[i]+b[i]; for(i=0;i<n;i++) { t[i]=w[i]+b[i]; awt=awt+w[i]; att=att+t[i]; } awt=awt/n; att=att/n; printf("\nProcess \t Waiting time \t Turn around time \n"); for(i=0;i<n;i++) printf("p[%d] \t\t %d \t\t %d \n",p[i],w[i],t[i]); printf("\nThe average waiting time is %f\n",awt); printf("The average turn around time is %f\n",att); return 1; }
the_stack_data/54634.c
#include <stdio.h> #include <stdlib.h> #define true 1 void swap(int *a, int *b) { int tmp = *a; *a = *b; *b = tmp; } unsigned partition(int *a, unsigned l, unsigned r) { int pivot = a[r-1]; unsigned i = l-1; for (unsigned j = l; j < r; j++) { if (a[j-1] <= pivot) { i++; swap(&a[i-1], &a[j-1]); //++i; } } swap(&a[i+1-1], &a[r-1]); return i+1; } int quicksort(int *a, unsigned l, unsigned r) { if (l < r) { unsigned q = partition(a, l, r); quicksort(a, l, q-1); quicksort(a, q+1, r); } return 0; } void read_array(int *a, unsigned n) { int x; for (unsigned i = 0; i < n; ++i) { scanf("%d", &x); a[i] = x; } } void print_array(int *a, unsigned n) { for (unsigned i = 0; i < n; ++i) { printf("%d", a[i]); if (i != n-1) { printf(" "); } } printf("\n"); } int main() { unsigned n; scanf("%d", &n); int *a = malloc(n * sizeof(int)); read_array(a, n); quicksort(a, 1, n); print_array(a, n); return 0; }
the_stack_data/218892366.c
#include<stdio.h> #include<string.h> #include<stdlib.h> #include<math.h> #define Employee struct emp void add(FILE * fp); //to add to list FILE * del(FILE * fp);//to delete from list void modify(FILE * fp);//to modify a record void displayList(FILE * fp);//display whole list void searchRecord(FILE *fp);//find a particular record void printChar(char ch,int n);//printing a character ch n times void printHead(); struct emp { int id; char name[100]; float sal; char psaddr[200]; char prtaddr[200]; char phone[15]; char mail[20]; }; int main() { FILE * fp; Employee e; int option; char another; if((fp=fopen("employeeInfo.txt","rb+"))==NULL) { if((fp=fopen("employeeInfo.txt","wb+"))==NULL) { printf("can't open file"); return 0; } } char username[10],password[10]; printHead(); welcome(); printHead(); printf("\n\t\t\t\t Login Screen"); printf("\n\t\t\t Enter Your Credential"); printf("\n\n\n\t\tUsername: "); scanf("%s",username); printf("\n\t\tPassword: "); int i; i=0; do { password[i] = getch(); if(password[i] == 13 ) { break; } else if(password[i]==8 && i>0) { printf("%c%c%c",8,32,8); i--; } else { printf("*"); i++; } }while(password[i]!=13); password[i] = '\0'; if(((strcasecmp(username,"admin"))==0)&&((strcasecmp(password,"pass")==0))) { while(1) { printHead(); printf("\n\t\t\t\tMain Menu"); printf("\n\n\n"); printf("\n\n\t\t\t1. Add Employee"); printf("\n\n\t\t\t2. Delete Employee"); printf("\n\n\t\t\t3. Modify Employee"); printf("\n\n\t\t\t4. Display Employee List"); printf("\n\n\t\t\t5. Search Record"); printf("\n\n\t\t\t6. Display Basic Info"); printf("\n\n\t\t\t0. EXIT"); printf("\n\n\t\tEnter Your Option :--> "); scanf("%d",&option); switch(option) { case 0: return 1; break; case 1: add(fp); break; case 2: fp=del(fp); break; case 3: modify(fp); break; case 4: displayList(fp); break; case 5: searchRecord(fp); break; case 6: displaybasic(fp); break; default: printf("\n\t\tYou Pressed wrong key"); printf("\n\t\tProgram terminated"); getch(); exit(0); } } } else { printf("\n\t\tLogin Failed"); } return 1; } //====Welcome Screen===== void welcome() { printf("\n\n\n\n\n\t\t[ [ [ WELCOME TO OUR EMPLOYEE MANAGEMENT SYSTEM ] ] ]\n\n\n\n\n\n\n\t"); system("pause"); } //----printing character ch at n times ------ void printChar(char ch,int n) { while(n--) { putchar(ch); } } //-----Printing Head Line of the program ----- void printHead() { system("cls"); printf("\t"); printChar('=',65); printf("\n\t"); printChar('=',16); printf("[EMPLOYEE] [MANAGEMENT] [SYSTEM]"); printChar('=',16); printf("\n\t"); printChar('=',65); }
the_stack_data/73172.c
/* * Licensed under the BSD license * * font.c - Default Font. * * Copyright (c) 2005 Marcus R. Brown <[email protected]> * Copyright (c) 2005 James Forshaw <[email protected]> * Copyright (c) 2005 John Kelley <[email protected]> */ const unsigned char msx[]= "\x00\x00\x00\x00\x00\x00\x00\x00\x3c\x42\xa5\x81\xa5\x99\x42\x3c" "\x3c\x7e\xdb\xff\xff\xdb\x66\x3c\x6c\xfe\xfe\xfe\x7c\x38\x10\x00" "\x10\x38\x7c\xfe\x7c\x38\x10\x00\x10\x38\x54\xfe\x54\x10\x38\x00" "\x10\x38\x7c\xfe\xfe\x10\x38\x00\x00\x00\x00\x30\x30\x00\x00\x00" "\xff\xff\xff\xe7\xe7\xff\xff\xff\x38\x44\x82\x82\x82\x44\x38\x00" "\xc7\xbb\x7d\x7d\x7d\xbb\xc7\xff\x0f\x03\x05\x79\x88\x88\x88\x70" "\x38\x44\x44\x44\x38\x10\x7c\x10\x30\x28\x24\x24\x28\x20\xe0\xc0" "\x3c\x24\x3c\x24\x24\xe4\xdc\x18\x10\x54\x38\xee\x38\x54\x10\x00" "\x10\x10\x10\x7c\x10\x10\x10\x10\x10\x10\x10\xff\x00\x00\x00\x00" "\x00\x00\x00\xff\x10\x10\x10\x10\x10\x10\x10\xf0\x10\x10\x10\x10" "\x10\x10\x10\x1f\x10\x10\x10\x10\x10\x10\x10\xff\x10\x10\x10\x10" "\x10\x10\x10\x10\x10\x10\x10\x10\x00\x00\x00\xff\x00\x00\x00\x00" "\x00\x00\x00\x1f\x10\x10\x10\x10\x00\x00\x00\xf0\x10\x10\x10\x10" "\x10\x10\x10\x1f\x00\x00\x00\x00\x10\x10\x10\xf0\x00\x00\x00\x00" "\x81\x42\x24\x18\x18\x24\x42\x81\x01\x02\x04\x08\x10\x20\x40\x80" "\x80\x40\x20\x10\x08\x04\x02\x01\x00\x10\x10\xff\x10\x10\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x20\x20\x20\x20\x00\x00\x20\x00" "\x50\x50\x50\x00\x00\x00\x00\x00\x50\x50\xf8\x50\xf8\x50\x50\x00" "\x20\x78\xa0\x70\x28\xf0\x20\x00\xc0\xc8\x10\x20\x40\x98\x18\x00" "\x40\xa0\x40\xa8\x90\x98\x60\x00\x10\x20\x40\x00\x00\x00\x00\x00" "\x10\x20\x40\x40\x40\x20\x10\x00\x40\x20\x10\x10\x10\x20\x40\x00" "\x20\xa8\x70\x20\x70\xa8\x20\x00\x00\x20\x20\xf8\x20\x20\x00\x00" "\x00\x00\x00\x00\x00\x20\x20\x40\x00\x00\x00\x78\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x60\x60\x00\x00\x00\x08\x10\x20\x40\x80\x00" "\x70\x88\x98\xa8\xc8\x88\x70\x00\x20\x60\xa0\x20\x20\x20\xf8\x00" "\x70\x88\x08\x10\x60\x80\xf8\x00\x70\x88\x08\x30\x08\x88\x70\x00" "\x10\x30\x50\x90\xf8\x10\x10\x00\xf8\x80\xe0\x10\x08\x10\xe0\x00" "\x30\x40\x80\xf0\x88\x88\x70\x00\xf8\x88\x10\x20\x20\x20\x20\x00" "\x70\x88\x88\x70\x88\x88\x70\x00\x70\x88\x88\x78\x08\x10\x60\x00" "\x00\x00\x20\x00\x00\x20\x00\x00\x00\x00\x20\x00\x00\x20\x20\x40" "\x18\x30\x60\xc0\x60\x30\x18\x00\x00\x00\xf8\x00\xf8\x00\x00\x00" "\xc0\x60\x30\x18\x30\x60\xc0\x00\x70\x88\x08\x10\x20\x00\x20\x00" "\x70\x88\x08\x68\xa8\xa8\x70\x00\x20\x50\x88\x88\xf8\x88\x88\x00" "\xf0\x48\x48\x70\x48\x48\xf0\x00\x30\x48\x80\x80\x80\x48\x30\x00" "\xe0\x50\x48\x48\x48\x50\xe0\x00\xf8\x80\x80\xf0\x80\x80\xf8\x00" "\xf8\x80\x80\xf0\x80\x80\x80\x00\x70\x88\x80\xb8\x88\x88\x70\x00" "\x88\x88\x88\xf8\x88\x88\x88\x00\x70\x20\x20\x20\x20\x20\x70\x00" "\x38\x10\x10\x10\x90\x90\x60\x00\x88\x90\xa0\xc0\xa0\x90\x88\x00" "\x80\x80\x80\x80\x80\x80\xf8\x00\x88\xd8\xa8\xa8\x88\x88\x88\x00" "\x88\xc8\xc8\xa8\x98\x98\x88\x00\x70\x88\x88\x88\x88\x88\x70\x00" "\xf0\x88\x88\xf0\x80\x80\x80\x00\x70\x88\x88\x88\xa8\x90\x68\x00" "\xf0\x88\x88\xf0\xa0\x90\x88\x00\x70\x88\x80\x70\x08\x88\x70\x00" "\xf8\x20\x20\x20\x20\x20\x20\x00\x88\x88\x88\x88\x88\x88\x70\x00" "\x88\x88\x88\x88\x50\x50\x20\x00\x88\x88\x88\xa8\xa8\xd8\x88\x00" "\x88\x88\x50\x20\x50\x88\x88\x00\x88\x88\x88\x70\x20\x20\x20\x00" "\xf8\x08\x10\x20\x40\x80\xf8\x00\x70\x40\x40\x40\x40\x40\x70\x00" "\x00\x00\x80\x40\x20\x10\x08\x00\x70\x10\x10\x10\x10\x10\x70\x00" "\x20\x50\x88\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf8\x00" "\x40\x20\x10\x00\x00\x00\x00\x00\x00\x00\x70\x08\x78\x88\x78\x00" "\x80\x80\xb0\xc8\x88\xc8\xb0\x00\x00\x00\x70\x88\x80\x88\x70\x00" "\x08\x08\x68\x98\x88\x98\x68\x00\x00\x00\x70\x88\xf8\x80\x70\x00" "\x10\x28\x20\xf8\x20\x20\x20\x00\x00\x00\x68\x98\x98\x68\x08\x70" "\x80\x80\xf0\x88\x88\x88\x88\x00\x20\x00\x60\x20\x20\x20\x70\x00" "\x10\x00\x30\x10\x10\x10\x90\x60\x40\x40\x48\x50\x60\x50\x48\x00" "\x60\x20\x20\x20\x20\x20\x70\x00\x00\x00\xd0\xa8\xa8\xa8\xa8\x00" "\x00\x00\xb0\xc8\x88\x88\x88\x00\x00\x00\x70\x88\x88\x88\x70\x00" "\x00\x00\xb0\xc8\xc8\xb0\x80\x80\x00\x00\x68\x98\x98\x68\x08\x08" "\x00\x00\xb0\xc8\x80\x80\x80\x00\x00\x00\x78\x80\xf0\x08\xf0\x00" "\x40\x40\xf0\x40\x40\x48\x30\x00\x00\x00\x90\x90\x90\x90\x68\x00" "\x00\x00\x88\x88\x88\x50\x20\x00\x00\x00\x88\xa8\xa8\xa8\x50\x00" "\x00\x00\x88\x50\x20\x50\x88\x00\x00\x00\x88\x88\x98\x68\x08\x70" "\x00\x00\xf8\x10\x20\x40\xf8\x00\x18\x20\x20\x40\x20\x20\x18\x00" "\x20\x20\x20\x00\x20\x20\x20\x00\xc0\x20\x20\x10\x20\x20\xc0\x00" "\x40\xa8\x10\x00\x00\x00\x00\x00\x00\x00\x20\x50\xf8\x00\x00\x00" "\x70\x88\x80\x80\x88\x70\x20\x60\x90\x00\x00\x90\x90\x90\x68\x00" "\x10\x20\x70\x88\xf8\x80\x70\x00\x20\x50\x70\x08\x78\x88\x78\x00" "\x48\x00\x70\x08\x78\x88\x78\x00\x20\x10\x70\x08\x78\x88\x78\x00" "\x20\x00\x70\x08\x78\x88\x78\x00\x00\x70\x80\x80\x80\x70\x10\x60" "\x20\x50\x70\x88\xf8\x80\x70\x00\x50\x00\x70\x88\xf8\x80\x70\x00" "\x20\x10\x70\x88\xf8\x80\x70\x00\x50\x00\x00\x60\x20\x20\x70\x00" "\x20\x50\x00\x60\x20\x20\x70\x00\x40\x20\x00\x60\x20\x20\x70\x00" "\x50\x00\x20\x50\x88\xf8\x88\x00\x20\x00\x20\x50\x88\xf8\x88\x00" "\x10\x20\xf8\x80\xf0\x80\xf8\x00\x00\x00\x6c\x12\x7e\x90\x6e\x00" "\x3e\x50\x90\x9c\xf0\x90\x9e\x00\x60\x90\x00\x60\x90\x90\x60\x00" "\x90\x00\x00\x60\x90\x90\x60\x00\x40\x20\x00\x60\x90\x90\x60\x00" "\x40\xa0\x00\xa0\xa0\xa0\x50\x00\x40\x20\x00\xa0\xa0\xa0\x50\x00" "\x90\x00\x90\x90\xb0\x50\x10\xe0\x50\x00\x70\x88\x88\x88\x70\x00" "\x50\x00\x88\x88\x88\x88\x70\x00\x20\x20\x78\x80\x80\x78\x20\x20" "\x18\x24\x20\xf8\x20\xe2\x5c\x00\x88\x50\x20\xf8\x20\xf8\x20\x00" "\xc0\xa0\xa0\xc8\x9c\x88\x88\x8c\x18\x20\x20\xf8\x20\x20\x20\x40" "\x10\x20\x70\x08\x78\x88\x78\x00\x10\x20\x00\x60\x20\x20\x70\x00" "\x20\x40\x00\x60\x90\x90\x60\x00\x20\x40\x00\x90\x90\x90\x68\x00" "\x50\xa0\x00\xa0\xd0\x90\x90\x00\x28\x50\x00\xc8\xa8\x98\x88\x00" "\x00\x70\x08\x78\x88\x78\x00\xf8\x00\x60\x90\x90\x90\x60\x00\xf0" "\x20\x00\x20\x40\x80\x88\x70\x00\x00\x00\x00\xf8\x80\x80\x00\x00" "\x00\x00\x00\xf8\x08\x08\x00\x00\x84\x88\x90\xa8\x54\x84\x08\x1c" "\x84\x88\x90\xa8\x58\xa8\x3c\x08\x20\x00\x00\x20\x20\x20\x20\x00" "\x00\x00\x24\x48\x90\x48\x24\x00\x00\x00\x90\x48\x24\x48\x90\x00" "\x28\x50\x20\x50\x88\xf8\x88\x00\x28\x50\x70\x08\x78\x88\x78\x00" "\x28\x50\x00\x70\x20\x20\x70\x00\x28\x50\x00\x20\x20\x20\x70\x00" "\x28\x50\x00\x70\x88\x88\x70\x00\x50\xa0\x00\x60\x90\x90\x60\x00" "\x28\x50\x00\x88\x88\x88\x70\x00\x50\xa0\x00\xa0\xa0\xa0\x50\x00" "\xfc\x48\x48\x48\xe8\x08\x50\x20\x00\x50\x00\x50\x50\x50\x10\x20" "\xc0\x44\xc8\x54\xec\x54\x9e\x04\x10\xa8\x40\x00\x00\x00\x00\x00" "\x00\x20\x50\x88\x50\x20\x00\x00\x88\x10\x20\x40\x80\x28\x00\x00" "\x7c\xa8\xa8\x68\x28\x28\x28\x00\x38\x40\x30\x48\x48\x30\x08\x70" "\x00\x00\x00\x00\x00\x00\xff\xff\xf0\xf0\xf0\xf0\x0f\x0f\x0f\x0f" "\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x3c\x3c\x00\x00\x00\xff\xff\xff\xff\xff\xff\x00\x00" "\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\x0f\x0f\x0f\x0f\xf0\xf0\xf0\xf0" "\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\x03\x03\x03\x03\x03\x03\x03\x03" "\x3f\x3f\x3f\x3f\x3f\x3f\x3f\x3f\x11\x22\x44\x88\x11\x22\x44\x88" "\x88\x44\x22\x11\x88\x44\x22\x11\xfe\x7c\x38\x10\x00\x00\x00\x00" "\x00\x00\x00\x00\x10\x38\x7c\xfe\x80\xc0\xe0\xf0\xe0\xc0\x80\x00" "\x01\x03\x07\x0f\x07\x03\x01\x00\xff\x7e\x3c\x18\x18\x3c\x7e\xff" "\x81\xc3\xe7\xff\xff\xe7\xc3\x81\xf0\xf0\xf0\xf0\x00\x00\x00\x00" "\x00\x00\x00\x00\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x00\x00\x00\x00" "\x00\x00\x00\x00\xf0\xf0\xf0\xf0\x33\x33\xcc\xcc\x33\x33\xcc\xcc" "\x00\x20\x20\x50\x50\x88\xf8\x00\x20\x20\x70\x20\x70\x20\x20\x00" "\x00\x00\x00\x50\x88\xa8\x50\x00\xff\xff\xff\xff\xff\xff\xff\xff" "\x00\x00\x00\x00\xff\xff\xff\xff\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0" "\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\xff\xff\xff\xff\x00\x00\x00\x00" "\x00\x00\x68\x90\x90\x90\x68\x00\x30\x48\x48\x70\x48\x48\x70\xc0" "\xf8\x88\x80\x80\x80\x80\x80\x00\xf8\x50\x50\x50\x50\x50\x98\x00" "\xf8\x88\x40\x20\x40\x88\xf8\x00\x00\x00\x78\x90\x90\x90\x60\x00" "\x00\x50\x50\x50\x50\x68\x80\x80\x00\x50\xa0\x20\x20\x20\x20\x00" "\xf8\x20\x70\xa8\xa8\x70\x20\xf8\x20\x50\x88\xf8\x88\x50\x20\x00" "\x70\x88\x88\x88\x50\x50\xd8\x00\x30\x40\x40\x20\x50\x50\x50\x20" "\x00\x00\x00\x50\xa8\xa8\x50\x00\x08\x70\xa8\xa8\xa8\x70\x80\x00" "\x38\x40\x80\xf8\x80\x40\x38\x00\x70\x88\x88\x88\x88\x88\x88\x00" "\x00\xf8\x00\xf8\x00\xf8\x00\x00\x20\x20\xf8\x20\x20\x00\xf8\x00" "\xc0\x30\x08\x30\xc0\x00\xf8\x00\x18\x60\x80\x60\x18\x00\xf8\x00" "\x10\x28\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\xa0\x40" "\x00\x20\x00\xf8\x00\x20\x00\x00\x00\x50\xa0\x00\x50\xa0\x00\x00" "\x00\x18\x24\x24\x18\x00\x00\x00\x00\x30\x78\x78\x30\x00\x00\x00" "\x00\x00\x00\x00\x30\x00\x00\x00\x3e\x20\x20\x20\xa0\x60\x20\x00" "\xa0\x50\x50\x50\x00\x00\x00\x00\x40\xa0\x20\x40\xe0\x00\x00\x00" "\x00\x38\x38\x38\x38\x38\x38\x00\x00\x00\x00\x00\x00\x00\x00";
the_stack_data/1253479.c
/** * Problem * https://leetcode.com/problems/squares-of-a-sorted-array/ * * Input: [-4,-1,0,3,10] * Output: [0,1,9,16,100] * * Input: [-7,-3,2,3,11] * Output: [4,9,9,49,121] * */ /** * Note: The returned array must be malloced, assume caller calls free(). */ /** * Explain: * * nums = [-4,-1,0,3,10] => Compare (-4) and 10 * V V => low pointer and high pointer * * Add the greater one into last place of return array. * retAry = [0,0,0,0,100] => 10^2 is greater than (-4)^2 * * nums = [-4,-1,0,3,10] => Move high pointer to next place. * V V Compare (-4) and 3 * * Add the greater one into (last place - 1) of return array. * retAry = [0,0,0,16,100] => (-4)^2 is greater than 3^2 * * nums = [-4,-1,0,3,10] => Move low pointer to next place. * V V Compare (-1) and 3 * * ************************************************************* * Time complexity: O(n) * Worst case: * while -> O(n) * ************************************************************* * Space complexity: O(n) * Worst case: * retAry -> O(n) * nums -> O(n) * O(2n) -> O(n) */ /** * Readable & Scalable */ int* sortedSquares(int* nums, int numsSize, int* returnSize) { int* retAry = calloc(numsSize, sizeof(int)); int posLow = 0; int posHigh = numsSize - 1; int squareLow = 0; int squareHigh = 0; *returnSize = numsSize; while (numsSize-- > 0) { squareLow = nums[posLow] * nums[posLow]; squareHigh = nums[posHigh] * nums[posHigh]; if (squareLow > squareHigh) { retAry[numsSize] = squareLow; posLow++; } else { retAry[numsSize] = squareHigh; posHigh--; } } return retAry; }
the_stack_data/225143677.c
#include <stdio.h> #include <stdlib.h> #include <stdint.h> #define LV_ATTRIBUTE_MEM_ALIGN #define LV_ATTRIBUTE_IMG_ALARM_16PX #define LV_COLOR_DEPTH 32 //#define LV_COLOR_DEPTH 16 #define LV_IMG_PX_SIZE_ALPHA_BYTE 4 /* for 32 bit color */ //#define LV_IMG_PX_SIZE_ALPHA_BYTE 3 /* for 16 bit color */ #define LV_IMG_CF_TRUE_COLOR_ALPHA 5 /* for 32 bit color */ // #define LV_IMG_CF_TRUE_COLOR_ALPHA 3 /* for 16 bit color */ // #define LV_COLOR_16_SWAP 1 /** Image header it is compatible with * the result from image converter utility*/ typedef struct { uint32_t cf : 5; /* Color format: See `lv_img_color_format_t`*/ uint32_t always_zero : 3; /*It the upper bits of the first byte. Always zero to look like a non-printable character*/ uint32_t reserved : 2; /*Reserved to be used later*/ uint32_t w : 11; /*Width of the image map*/ uint32_t h : 11; /*Height of the image map*/ } lv_img_header_t; typedef struct { lv_img_header_t header; uint32_t data_size; const uint8_t * data; } lv_img_dsc_t; #ifndef LV_ATTRIBUTE_MEM_ALIGN #define LV_ATTRIBUTE_MEM_ALIGN #endif #ifndef LV_ATTRIBUTE_IMG_SOUND_MUTE_32PX #define LV_ATTRIBUTE_IMG_SOUND_MUTE_32PX #endif const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMG_SOUND_MUTE_32PX uint8_t sound_mute_32px_map[] = { #if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8 /*Pixel format: Alpha 8 bit, Red: 3 bit, Green: 3 bit, Blue: 2 bit*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x8f, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x60, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x60, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0xff, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x60, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x60, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xa0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xa0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xa0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xa0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xa0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x90, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, #endif #if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP == 0 /*Pixel format: Alpha 8 bit, Red: 5 bit, Green: 6 bit, Blue: 5 bit*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x90, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, #endif #if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP != 0 /*Pixel format: Alpha 8 bit, Red: 5 bit, Green: 6 bit, Blue: 5 bit BUT the 2 color bytes are swapped*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x90, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, #endif #if LV_COLOR_DEPTH == 32 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xa0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xa0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xa0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xa0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xa0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x90, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, #endif }; const lv_img_dsc_t sound_mute_32px = { .header.always_zero = 0, .header.w = 32, .header.h = 32, .data_size = 1024 * LV_IMG_PX_SIZE_ALPHA_BYTE, .header.cf = LV_IMG_CF_TRUE_COLOR_ALPHA, .data = sound_mute_32px_map, }; /* * writing the pixel map */ int main(int argc, char **argv) { FILE *fp; char *binFile; binFile="sound_mute_32px_argb8888.bin"; /* 32 bit color */ fp = fopen(binFile, "wb"); fwrite(sound_mute_32px_map,sound_mute_32px.data_size,1,fp); fclose(fp); }
the_stack_data/15762392.c
/* * Level_2 Exercise 1.9.1: * C-program that reads the characters from the keyboard and shows them on screen * * @file InputPractice.c * @author Chunyu Yuan * @version 1.0 02/01/2021 * */ // Preprocessor for include file #include <stdio.h> // C tyle I/O /* * Controls operation of the program * Return type of main() expects an int * * @function main() * @param none * @return 0 */ int main() { printf("Please input the character\n"); printf("Hit 'Enter' to display the input \n"); printf("CTRL+A ending the input \n"); char c; //declare character c which record the character typed while ((c=getchar())!=1) //check if the typed character is ^A { if (c != '\n') //if the character is not enter { //display one character //please note that the terminal is line-buffered //only submits input to the program when a newline character is encountered. putchar(c); } else { printf("\n");// new line } } return 0;// return 0 to end program }
the_stack_data/50139098.c
#include "stdio.h" extern int StrLen(char *str); int main() { char src[] = "hello world"; printf("string length is: %d\n", StrLen(src)); return 0; }
the_stack_data/142141.c
int mod (register int num1, register int num2) { register int result = 0; if (num1 + num2 != 0) result = num1 % num2; return result; }
the_stack_data/104828071.c
/* $XFree86$ */ /* * $Workfile: gfx_msr.c $ * * This file contains routines to read machine-specific registers (MSRs) * * Routines: * * gfx_msr_init * gfx_id_msr_device * gfx_get_msr_dev_address * gfx_get_glink_id_at_address * gfx_msr_read * gfx_msr_write * * NSC_LIC_ALTERNATIVE_PREAMBLE * * Revision 1.0 * * National Semiconductor Alternative GPL-BSD License * * National Semiconductor Corporation licenses this software * ("Software"): * * Durango * * under one of the two following licenses, depending on how the * Software is received by the Licensee. * * If this Software is received as part of the Linux Framebuffer or * other GPL licensed software, then the GPL license designated * NSC_LIC_GPL applies to this Software; in all other circumstances * then the BSD-style license designated NSC_LIC_BSD shall apply. * * END_NSC_LIC_ALTERNATIVE_PREAMBLE */ /* NSC_LIC_BSD * * National Semiconductor Corporation Open Source License for Durango * * (BSD License with Export Notice) * * Copyright (c) 1999-2001 * National Semiconductor Corporation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * * Neither the name of the National Semiconductor Corporation nor * the names of its contributors may be used to endorse or promote * products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * NATIONAL SEMICONDUCTOR CORPORATION 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, * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF * YOUR JURISDICTION. It is licensee's responsibility to comply with * any export regulations applicable in licensee's jurisdiction. Under * CURRENT (2001) U.S. export regulations this software * is eligible for export from the U.S. and can be downloaded by or * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed * destinations which include Cuba, Iraq, Libya, North Korea, Iran, * Syria, Sudan, Afghanistan and any other country to which the U.S. * has embargoed goods and services. * * END_NSC_LIC_BSD */ /* NSC_LIC_GPL * * National Semiconductor Corporation Gnu General Public License for Durango * * (GPL License with Export Notice) * * Copyright (c) 1999-2001 * National Semiconductor Corporation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the GNU General * Public License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version * * In addition to the terms of the GNU General Public License, neither * the name of the National Semiconductor Corporation nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * NATIONAL SEMICONDUCTOR CORPORATION 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, * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. See the GNU General Public License for more details. * * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF * YOUR JURISDICTION. It is licensee's responsibility to comply with * any export regulations applicable in licensee's jurisdiction. Under * CURRENT (2001) U.S. export regulations this software * is eligible for export from the U.S. and can be downloaded by or * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed * destinations which include Cuba, Iraq, Libya, North Korea, Iran, * Syria, Sudan, Afghanistan and any other country to which the U.S. * has embargoed goods and services. * * You should have received a copy of the GNU General Public License * along with this file; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * END_NSC_LIC_GPL */ /* INCLUDE SUPPORT FOR REDCLOUD, IF SPECIFIED */ #if GFX_MSR_REDCLOUD #include "msr_rdcl.c" #endif /* EXTRA WRAPPERS FOR DYNAMIC SELECTION */ #if GFX_MSR_DYNAMIC /*----------------------------------------------------------------------------- * gfx_msr_init *----------------------------------------------------------------------------- */ int gfx_msr_init() { int ret_value = 0; # if GFX_MSR_REDCLOUD if (gfx_msr_type & GFX_MSR_TYPE_REDCLOUD) ret_value = redcloud_msr_init(); # endif return ret_value; } /*----------------------------------------------------------------------------- * gfx_id_msr_device *----------------------------------------------------------------------------- */ DEV_STATUS gfx_id_msr_device(MSR * pDev, unsigned long address) { DEV_STATUS ret_value = NOT_KNOWN; # if GFX_MSR_REDCLOUD if (gfx_msr_type & GFX_MSR_TYPE_REDCLOUD) ret_value = redcloud_id_msr_device(pDev, address); # endif return ret_value; } /*----------------------------------------------------------------------------- * gfx_get_msr_dev_address *----------------------------------------------------------------------------- */ DEV_STATUS gfx_get_msr_dev_address(unsigned int device, unsigned long *address) { DEV_STATUS ret_value = NOT_KNOWN; # if GFX_MSR_REDCLOUD if (gfx_msr_type & GFX_MSR_TYPE_REDCLOUD) ret_value = redcloud_get_msr_dev_address(device, address); # endif return ret_value; } /*----------------------------------------------------------------------------- * gfx_get_glink_id_at_address *----------------------------------------------------------------------------- */ DEV_STATUS gfx_get_glink_id_at_address(unsigned int *device, unsigned long address) { DEV_STATUS ret_value = NOT_KNOWN; # if GFX_MSR_REDCLOUD if (gfx_msr_type & GFX_MSR_TYPE_REDCLOUD) ret_value = redcloud_get_glink_id_at_address(device, address); # endif return ret_value; } /*----------------------------------------------------------------------------- * gfx_msr_read *----------------------------------------------------------------------------- */ DEV_STATUS gfx_msr_read(unsigned int device, unsigned int msrRegister, Q_WORD * msrValue) { DEV_STATUS ret_value = NOT_KNOWN; # if GFX_MSR_REDCLOUD if (gfx_msr_type & GFX_MSR_TYPE_REDCLOUD) ret_value = redcloud_msr_read(device, msrRegister, msrValue); # endif return ret_value; } /*----------------------------------------------------------------------------- * gfx_msr_write *----------------------------------------------------------------------------- */ DEV_STATUS gfx_msr_write(unsigned int device, unsigned int msrRegister, Q_WORD * msrValue) { DEV_STATUS ret_value = NOT_KNOWN; # if GFX_MSR_REDCLOUD if (gfx_msr_type & GFX_MSR_TYPE_REDCLOUD) ret_value = redcloud_msr_write(device, msrRegister, msrValue); # endif return ret_value; } #endif
the_stack_data/165607.c
/* * SpanDSP - a series of DSP components for telephony * * make_cielab_luts.c - Create the look up tables for CIELab colour management * * Written by Steve Underwood <[email protected]> * * Copyright (C) 2011 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #include <inttypes.h> #include <stdlib.h> #include <stdio.h> #include <fcntl.h> #include <unistd.h> #include <memory.h> #include <math.h> typedef struct { float L; float a; float b; } cielab_t; int main(int argc, char *argv[]) { float r; uint8_t srgb; int i; printf("/* THIS FILE WAS AUTOMATICALLY GENERATED - ANY MODIFICATIONS MADE TO THIS"); printf(" FILE MAY BE OVERWRITTEN DURING FUTURE BUILDS OF THE SOFTWARE */\n"); printf("\n"); printf("static const float srgb_to_linear[256] =\n"); printf("{\n"); for (i = 0; i < 256; i++) { /* Start with "i" as the sRGB value */ r = i/256.0f; /* sRGB to Linear RGB */ r = (r > 0.04045f) ? powf((r + 0.055f)/1.055f, 2.4f) : r/12.92f; printf((i < 255) ? " %f,\n" : " %f\n", r); } printf("};\n"); printf("static const uint8_t linear_to_srgb[4096] =\n"); printf("{\n"); for (i = 0; i < 4096; i++) { /* Start with "i" as the linear RGB value */ /* Linear RGB to sRGB */ r = i/4096.0f; r = (r > 0.0031308f) ? (1.055f*powf(r, 1.0f/2.4f) - 0.055f) : r*12.92f; r = floorf(r*256.0f); srgb = (uint8_t) ((r < 0) ? 0 : (r <= 255) ? r : 255); printf((i < 4095) ? " %d,\n" : " %d\n", srgb); } printf("};\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/
the_stack_data/50138310.c
// WARNING in kernfs_get // https://syzkaller.appspot.com/bug?id=3e37a29a0fa96ecc18985d71582d26ca566289b3 // status:open // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include <dirent.h> #include <endian.h> #include <errno.h> #include <fcntl.h> #include <signal.h> #include <stdarg.h> #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/prctl.h> #include <sys/stat.h> #include <sys/syscall.h> #include <sys/types.h> #include <sys/wait.h> #include <time.h> #include <unistd.h> 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 bool write_file(const char* file, const char* what, ...) { char buf[1024]; va_list args; va_start(args, what); vsnprintf(buf, sizeof(buf), what, args); va_end(args); buf[sizeof(buf) - 1] = 0; int len = strlen(buf); int fd = open(file, O_WRONLY | O_CLOEXEC); if (fd == -1) return false; if (write(fd, buf, len) != len) { int err = errno; close(fd); errno = err; return false; } close(fd); return true; } static void kill_and_wait(int pid, int* status) { kill(-pid, SIGKILL); kill(pid, SIGKILL); int i; for (i = 0; i < 100; i++) { if (waitpid(-1, status, WNOHANG | __WALL) == pid) return; usleep(1000); } DIR* dir = opendir("/sys/fs/fuse/connections"); if (dir) { for (;;) { struct dirent* ent = readdir(dir); if (!ent) break; if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0) continue; char abort[300]; snprintf(abort, sizeof(abort), "/sys/fs/fuse/connections/%s/abort", ent->d_name); int fd = open(abort, O_WRONLY); if (fd == -1) { continue; } if (write(fd, abort, 1) < 0) { } close(fd); } closedir(dir); } else { } while (waitpid(-1, status, __WALL) != pid) { } } #define SYZ_HAVE_SETUP_TEST 1 static void setup_test() { prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); setpgrp(); write_file("/proc/self/oom_score_adj", "1000"); } static void execute_one(void); #define WAIT_FLAGS __WALL static void loop(void) { int iter; for (iter = 0;; iter++) { 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 < 5 * 1000) continue; kill_and_wait(pid, &status); break; } } } uint64_t r[1] = {0xffffffffffffffff}; void execute_one(void) { long res = 0; memcpy((void*)0x200012c0, "/dev/vhci\000", 10); res = syscall(__NR_openat, 0xffffffffffffff9c, 0x200012c0, 0x246, 0); if (res != -1) r[0] = res; memcpy((void*)0x200000c0, "\xff\x81", 2); syscall(__NR_write, r[0], 0x200000c0, 2); } int main(void) { syscall(__NR_mmap, 0x20000000, 0x1000000, 3, 0x32, -1, 0); for (procid = 0; procid < 6; procid++) { if (fork() == 0) { loop(); } } sleep(1000000); return 0; }
the_stack_data/11074575.c
#include <stdlib.h> void merge(int a[], int n, int m) { int i, j, k; int *x = malloc(n * sizeof(int)); for (i = 0, j = m, k = 0; k < n; k++) { x[k] = j == n ? a[i++] : i == m ? a[j++] : a[j] > a[i] ? a[j++] : a[i++]; // < ascending } for (i = 0; i < n; i++) { a[i] = x[i]; } free(x); } // @klee[inArraySize=6,outArraySize=6](sym,6) int* sort(int a[], int n) { if (n < 2) return a; int m = n / 2; sort(a, m); sort(a + m, n - m); merge(a, n, m); return a; }
the_stack_data/50137306.c
void tester_parser() { //tester // printf("Begin Test\n"); // int i; // int j = 0; // printf("count_subcommands = %d \n", count_subcommands); // for(i = 0; argv[i]; i++) { // printf("%d - %s \n", i, argv[i]); // } // printf("End Test\n"); // return; //endtester }
the_stack_data/63028.c
/* * Phoenix-RTOS * * libphoenix * * perror.c * * Copyright 2018 Phoenix Systems * Author: Kamil Amanowicz * * This file is part of Phoenix-RTOS. * * %LICENSE% */ void perror(const char *str) { }
the_stack_data/107952517.c
#include <string.h> #include <stdio.h> #include <stdlib.h> #include <math.h> int main(int argc, char** argv) { const int n = atoi(argv[1]); int i = 1; // value in spiral int l = 1; // length of side for current spiral level int s = 3; // side number going CCW from LHS int x = 0; int y = 0; while (i != n) { int d; if (i > n) { // Gone too far on current line int back = i - n; switch (--s) { case 0: y -= back; break; case 1: x += back; break; case 2: y += back; break; case 3: default: x -= back; break; } break; } switch (s) { case 0: d = l - 2; y += d; break; case 1: d = l - 1; x -= d; break; case 2: d = l - 1; y -= d; break; case 3: d = l; x += l; l += 2; break; } i += d; ++s; s %= 4; } int moves = abs(x) + abs(y); printf("%d moves required from cell containing %d\n", moves, n); return 0; }
the_stack_data/1094939.c
#include <stdio.h> int main() { int n,s,i,a; int arr[500]; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&arr[i]); } s=i-1; i=0; while(i<s) { a=arr[i]; arr[i] = arr[s]; arr[s]=a; i++; s--; } for(i=0;i<n;i++) { printf("%d\n",arr[i]); } }
the_stack_data/938834.c
/* BSD 3-Clause License * * Copyright (c) 2018, Quansight and Sameer Deshmukh * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * * Neither the name of the copyright holder nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* File for various operations on the MemoryBlockObject struct. */
the_stack_data/104827067.c
/*--------------------------------------------------------------*/ /* */ /* compute_saturation_vapor_pressure */ /* */ /* */ /* NAME */ /* compute_saturation_vapor_pressure */ /* */ /* */ /* SYNOPSIS */ /* double compute_saturation_vapor_pressure( */ /* double temperature) */ /* */ /* returns: */ /* vapor pressure at saturation (Pa) */ /* */ /* OPTIONS */ /* double temperature (Celsius) /* */ /* DESCRIPTION */ /* */ /* Saturation Vapour Pressure (Pa) */ /* */ /* Note the original rehssys code supplied es in mbar. */ /* c.f. eq. 1 Running and Coughlan , 1987, p. 133. */ /* */ /* Since 1 bar = 100 kpa (approx) ; a millibar = 100 Pa approx.*/ /* This explains why the es from the original code was: */ /* */ /* 6.1078 * exp((17.269*z[0].metv.tday)/(237.3 + */ /* z[0].metv.tday)) */ /* */ /* Which is approx 100 times that of the es here. */ /* */ /* Eq. 5.12 p. 110, Jones, "Plants and Microclimate" */ /* */ /* PROGRAMMER NOTES */ /* */ /*--------------------------------------------------------------*/ #include <stdio.h> #include <math.h> double compute_saturation_vapor_pressure(double temperature) { double es = 613.75 * exp( (17.502 * temperature) / ( 240.97 + temperature) ); return es; }
the_stack_data/29824270.c
/* Exercise 5-3. Write a pointer version of the function strcat that we showed in Chapter 2: strcat(s,t) copies the string t to the end of s. implementation from chapter 2: / * strcat: concatenate t to end of s; s must be big enough * / void strcat(char s[], char t[]) { int i, j; i = j = 0; while (s[i] != '\0') / * find end of s * / i++; while ((s[i++] = t[j++]) != '\0') / * copy t * / ; } Author : Bryan Williams */ /* strcat: concatenate t to end of s; s must be big enough; pointer version */ void mystrcat(char *s, char *t) { /* run through the destination string until we point at the terminating '\0' */ while ('\0' != *s) { ++s; } /* now copy until we run out of string to copy */ while ('\0' != (*s = *t)) { ++s; ++t; } } // concise version of strcat void mystrcat2(char *dest, const char *source) { while (*dest) dest++; while ((*dest++ = *source++)) ; } #define DRIVER 6 #if DRIVER #include <assert.h> #include <stdio.h> #include <string.h> int main(void) { char S1[33] = "String One"; char S2[11] = "String Two"; printf("String one is (%s)\n", S1); printf("String two is (%s)\n", S2); mystrcat(S1, S2); //"The combined string is (String OneString Two)" printf("The combined string is (%s)\n", S1); // before copying again, assert there is space in S1 assert(sizeof(S1) > strlen(S1) + strlen(S2)); mystrcat2(S1, S2); //"The combined string is (String OneString TwoString Two)" printf("The combined string is (%s)\n", S1); // before copying again, assert there is space in S1 assert(sizeof(S1) > strlen(S1) + strlen(S2)); mystrcat2(S1, S2); // will not execute, since assert will abort printf("The combined string is (%s)\n", S1); return 0; } #endif
the_stack_data/153393.c
/* Check that TRT happens for a signal sent to a non-existent process/thread, more than one thread. #cc: additional_flags=-pthread #notarget: cris*-*-elf */ #include <stdlib.h> #include <stddef.h> #include <stdio.h> #include <unistd.h> #include <pthread.h> #include <sys/types.h> #include <signal.h> #include <errno.h> static void * process (void *arg) { int i; for (i = 0; i < 100; i++) sched_yield (); return NULL; } int main (void) { pthread_t th_a; int retcode; void *retval; if (pthread_create (&th_a, NULL, process, (void *) "a") != 0) abort (); if (kill (getpid () - 1, SIGBUS) != -1 || errno != ESRCH || pthread_join (th_a, &retval) != 0) abort (); printf ("pass\n"); exit (0); }
the_stack_data/3725.c
#include<stdio.h> #include<string.h> struct node { char data[100]; int top; }; int empty(struct node *p) { return (p->top == -1); } int top(struct node *p) { return p->data[p->top]; } void push(struct node *p,char x) { p->data[++(p->top)]=x; } void pop(struct node *p) { if(!empty(p)) { (p->top)= (p->top)-1; } } void main() { struct node s; s.top=-1; char ch,str[100]; printf("Enter string:-> "); gets(str); int i,len=strlen(str); for(i=0;i<len;i++) { push(&s,str[i]); } while(!empty(&s)) { printf("%c ",top(&s)); pop(&s); } }
the_stack_data/57950582.c
#include <stdio.h> #include <stdlib.h> // variaveis globais char opcao; int i, n = 0, soma; float MAv1, MAv2, media[3]; // definindo estrutura BES typedef struct { float media, av1, av2; char nome[20]; long int matricula; }BES; // definindo variavel do tipo estrutura BES alunos[2]; // funcao principal int main() { // rebendo dados dos alunos for (i = 0; i < 3; i++) { printf("Digite o nome do aluno %d: ", i + 1); scanf("%s", &alunos[i].nome); printf("Digite a matricula do aluno %d: ", i + 1); scanf("%ld", &alunos[i].matricula); printf("Digite a nota da av1: "); scanf("%f", &alunos[i].av1); printf("Digite a nota da av2: "); scanf("%f", &alunos[i].av2); } // laco do-while para repeticao do menu do { //interface do menu printf("\n=-=-=-=--=-= Comparador de Notas =-=-=-=--=-="); printf("\n[ a ] Aluno com maior nota na Av1"); printf("\n[ b ] Aluno com maior nota na Av2"); printf("\n[ c ] Aluno com maior media geral"); printf("\n[ d ] Sair"); setbuf(stdin, NULL); // recebendo escolha do cliente printf("\nEscolha uma opcao: "); scanf("%c", &opcao); switch (opcao) { case 'a': maiorAv1(); // chamando funcao de calculo maior nota av1 break; case 'b': maiorAv2(); // chamando funcao de calculo maior nota av2 break; case 'c': mediaGeral(); // chamando funcao de calculo maior media geral break; case 'd': return 0; // encerrandoi o programa break; default: printf("\nOpcao invalida"); // caso a opcao escolhida nao esteja dentre os valores definidos break; } } while (opcao != 'a' || opcao != 'b' || opcao != 'c' || opcao != 'd'); // regra para continuar rodando o menu { system("Pause"); } return 0; } // funcao para calcular maior nota av1 void maiorAv1() { for (i = 0; i < 3; i++) { if (alunos[i].av1 > n)\ { MAv1 = alunos[i].av1; n = i; } } printf("A maior nota na AV1 eh do aluno %s", alunos[n].nome); } // funcao para calcular maior nota av2 void maiorAv2() { for (i = 0; i < 3; i++) { if (alunos[i].av1 > n) { MAv2 = alunos[i].av2; n = i; } } printf("A maior nota eh do aluno %s", alunos[n].nome); } // funcao para calcular maior media geral void mediaGeral() { for (i = 0; i < 3; i++) { soma = alunos[i].av1 + alunos[i].av2; media[i] = soma / 2; if (media[i] > n) { n = media[i]; n = i; } } printf("A maior media foi do alunp %s", alunos[n].nome); }
the_stack_data/1003771.c
#include <stdio.h> #include <string.h> int main(int argc, char const *argv[]) { char str[80] = "Hello how are you -my name is -Przemek"; const char s[2] = "-"; char *token; //get the first token token = strtok(str, s); // walk through other tokens while(token != NULL) { printf(" %s\n", token); token = strtok(NULL, s); } return 0; }
the_stack_data/514537.c
#include <stdio.h> void printd ( int n ); void main () { int i = 0; i = 123; printd ( i ); printf ( "\n" ); printf ( "1 \% 10 = %d;\n", 1 % 10 ); } void printd ( int n ) { if ( n < 0 ) { putchar ( '-' ); n = -n; } if ( n / 10 ) { printf ( "inside second check n = %d;\n", n ); printd ( n / 10 ); }; printf ( "at this step n = %d;\n", n ); putchar ( n % 10 + '0' ); printf ( "\n\n" ); }
the_stack_data/70450085.c
#include<stdio.h> void main() { int a,b,c,d,e,f; printf("enter the withdrawal amount..."); scanf("%d",&a); b=a%100; c=a/100; d=b%50; e=b/50; f=d/10; printf("\n no. of 100 rupees notes=%d",c); printf("\n no. of 50 rupees notes=%d",e); printf("\n no. of 10 rupees notes=%d",f); }
the_stack_data/12639112.c
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <CL/cl.h> unsigned char *read_buffer(char *file_name, size_t *size_ptr) { FILE *f; unsigned char *buf; size_t size; /* Open file */ f = fopen(file_name, "rb"); if (!f) return NULL; /* Obtain file size */ fseek(f, 0, SEEK_END); size = ftell(f); fseek(f, 0, SEEK_SET); /* Allocate and read buffer */ buf = malloc(size + 1); fread(buf, 1, size, f); buf[size] = '\0'; /* Return size of buffer */ if (size_ptr) *size_ptr = size; /* Return buffer */ return buf; } void write_buffer(char *file_name, const char *buffer, size_t buffer_size) { FILE *f; /* Open file */ f = fopen(file_name, "w+"); /* Write buffer */ if(buffer) fwrite(buffer, 1, buffer_size, f); /* Close file */ fclose(f); } int main(int argc, char const *argv[]) { /* Get platform */ cl_platform_id platform; cl_uint num_platforms; cl_int ret = clGetPlatformIDs(1, &platform, &num_platforms); if (ret != CL_SUCCESS) { printf("error: call to 'clGetPlatformIDs' failed\n"); exit(1); } printf("Number of platforms: %d\n", num_platforms); printf("platform=%p\n", platform); /* Get platform name */ char platform_name[100]; ret = clGetPlatformInfo(platform, CL_PLATFORM_NAME, sizeof(platform_name), platform_name, NULL); if (ret != CL_SUCCESS) { printf("error: call to 'clGetPlatformInfo' failed\n"); exit(1); } printf("platform.name='%s'\n\n", platform_name); /* Get device */ cl_device_id device; cl_uint num_devices; ret = clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, 1, &device, &num_devices); if (ret != CL_SUCCESS) { printf("error: call to 'clGetDeviceIDs' failed\n"); exit(1); } printf("Number of devices: %d\n", num_devices); printf("device=%p\n", device); /* Get device name */ char device_name[100]; ret = clGetDeviceInfo(device, CL_DEVICE_NAME, sizeof(device_name), device_name, NULL); if (ret != CL_SUCCESS) { printf("error: call to 'clGetDeviceInfo' failed\n"); exit(1); } printf("device.name='%s'\n", device_name); printf("\n"); /* Create a Context Object */ cl_context context; context = clCreateContext(NULL, 1, &device, NULL, NULL, &ret); if (ret != CL_SUCCESS) { printf("error: call to 'clCreateContext' failed\n"); exit(1); } printf("context=%p\n", context); /* Create a Command Queue Object*/ cl_command_queue command_queue; command_queue = clCreateCommandQueue(context, device, 0, &ret); if (ret != CL_SUCCESS) { printf("error: call to 'clCreateCommandQueue' failed\n"); exit(1); } printf("command_queue=%p\n", command_queue); printf("\n"); /* Program source */ unsigned char *source_code; size_t source_length; /* Read program from 'divide_short4short4.cl' */ source_code = read_buffer("divide_short4short4.cl", &source_length); /* Create a program */ cl_program program; program = clCreateProgramWithSource(context, 1, (const char **)&source_code, &source_length, &ret); if (ret != CL_SUCCESS) { printf("error: call to 'clCreateProgramWithSource' failed\n"); exit(1); } printf("program=%p\n", program); /* Build program */ ret = clBuildProgram(program, 1, &device, NULL, NULL, NULL); if (ret != CL_SUCCESS ) { size_t size; char *log; /* Get log size */ clGetProgramBuildInfo(program, device, CL_PROGRAM_BUILD_LOG,0, NULL, &size); /* Allocate log and print */ log = malloc(size); clGetProgramBuildInfo(program, device, CL_PROGRAM_BUILD_LOG,size, log, NULL); printf("error: call to 'clBuildProgram' failed:\n%s\n", log); /* Free log and exit */ free(log); exit(1); } printf("program built\n"); printf("\n"); /* Create a Kernel Object */ cl_kernel kernel; kernel = clCreateKernel(program, "divide_short4short4", &ret); if (ret != CL_SUCCESS) { printf("error: call to 'clCreateKernel' failed\n"); exit(1); } /* Create and allocate host buffers */ size_t num_elem = 10; /* Create and init host side src buffer 0 */ cl_short4 *src_0_host_buffer; src_0_host_buffer = malloc(num_elem * sizeof(cl_short4)); for (int i = 0; i < num_elem; i++) src_0_host_buffer[i] = (cl_short4){{2, 2, 2, 2}}; /* Create and init device side src buffer 0 */ cl_mem src_0_device_buffer; src_0_device_buffer = clCreateBuffer(context, CL_MEM_READ_ONLY, num_elem * sizeof(cl_short4), NULL, &ret); if (ret != CL_SUCCESS) { printf("error: could not create source buffer\n"); exit(1); } ret = clEnqueueWriteBuffer(command_queue, src_0_device_buffer, CL_TRUE, 0, num_elem * sizeof(cl_short4), src_0_host_buffer, 0, NULL, NULL); if (ret != CL_SUCCESS) { printf("error: call to 'clEnqueueWriteBuffer' failed\n"); exit(1); } /* Create and init host side src buffer 1 */ cl_short4 *src_1_host_buffer; src_1_host_buffer = malloc(num_elem * sizeof(cl_short4)); for (int i = 0; i < num_elem; i++) src_1_host_buffer[i] = (cl_short4){{2, 2, 2, 2}}; /* Create and init device side src buffer 1 */ cl_mem src_1_device_buffer; src_1_device_buffer = clCreateBuffer(context, CL_MEM_READ_ONLY, num_elem * sizeof(cl_short4), NULL, &ret); if (ret != CL_SUCCESS) { printf("error: could not create source buffer\n"); exit(1); } ret = clEnqueueWriteBuffer(command_queue, src_1_device_buffer, CL_TRUE, 0, num_elem * sizeof(cl_short4), src_1_host_buffer, 0, NULL, NULL); if (ret != CL_SUCCESS) { printf("error: call to 'clEnqueueWriteBuffer' failed\n"); exit(1); } /* Create host dst buffer */ cl_float4 *dst_host_buffer; dst_host_buffer = malloc(num_elem * sizeof(cl_float4)); memset((void *)dst_host_buffer, 1, num_elem * sizeof(cl_float4)); /* Create device dst buffer */ cl_mem dst_device_buffer; dst_device_buffer = clCreateBuffer(context, CL_MEM_WRITE_ONLY, num_elem *sizeof(cl_float4), NULL, &ret); if (ret != CL_SUCCESS) { printf("error: could not create dst buffer\n"); exit(1); } /* Set kernel arguments */ ret = CL_SUCCESS; ret |= clSetKernelArg(kernel, 0, sizeof(cl_mem), &src_0_device_buffer); ret |= clSetKernelArg(kernel, 1, sizeof(cl_mem), &src_1_device_buffer); ret |= clSetKernelArg(kernel, 2, sizeof(cl_mem), &dst_device_buffer); if (ret != CL_SUCCESS) { printf("error: call to 'clSetKernelArg' failed\n"); exit(1); } /* Launch the kernel */ size_t global_work_size = num_elem; size_t local_work_size = num_elem; ret = clEnqueueNDRangeKernel(command_queue, kernel, 1, NULL, &global_work_size, &local_work_size, 0, NULL, NULL); if (ret != CL_SUCCESS) { printf("error: call to 'clEnqueueNDRangeKernel' failed\n"); exit(1); } /* Wait for it to finish */ clFinish(command_queue); /* Read results from GPU */ ret = clEnqueueReadBuffer(command_queue, dst_device_buffer, CL_TRUE,0, num_elem * sizeof(cl_float4), dst_host_buffer, 0, NULL, NULL); if (ret != CL_SUCCESS) { printf("error: call to 'clEnqueueReadBuffer' failed\n"); exit(1); } /* Dump dst buffer to file */ char dump_file[100]; sprintf((char *)&dump_file, "%s.result", argv[0]); write_buffer(dump_file, (const char *)dst_host_buffer, num_elem * sizeof(cl_float4)); printf("Result dumped to %s\n", dump_file); /* Free host dst buffer */ free(dst_host_buffer); /* Free device dst buffer */ ret = clReleaseMemObject(dst_device_buffer); if (ret != CL_SUCCESS) { printf("error: call to 'clReleaseMemObject' failed\n"); exit(1); } /* Free host side src buffer 0 */ free(src_0_host_buffer); /* Free device side src buffer 0 */ ret = clReleaseMemObject(src_0_device_buffer); if (ret != CL_SUCCESS) { printf("error: call to 'clReleaseMemObject' failed\n"); exit(1); } /* Free host side src buffer 1 */ free(src_1_host_buffer); /* Free device side src buffer 1 */ ret = clReleaseMemObject(src_1_device_buffer); if (ret != CL_SUCCESS) { printf("error: call to 'clReleaseMemObject' failed\n"); exit(1); } /* Release kernel */ ret = clReleaseKernel(kernel); if (ret != CL_SUCCESS) { printf("error: call to 'clReleaseKernel' failed\n"); exit(1); } /* Release program */ ret = clReleaseProgram(program); if (ret != CL_SUCCESS) { printf("error: call to 'clReleaseProgram' failed\n"); exit(1); } /* Release command queue */ ret = clReleaseCommandQueue(command_queue); if (ret != CL_SUCCESS) { printf("error: call to 'clReleaseCommandQueue' failed\n"); exit(1); } /* Release context */ ret = clReleaseContext(context); if (ret != CL_SUCCESS) { printf("error: call to 'clReleaseContext' failed\n"); exit(1); } return 0; }
the_stack_data/125140921.c
#include<stdio.h> #include<stdlib.h> typedef struct node { int value; //this is the value the node stores struct node* next;//this is the node the current node points to. this is how the nodes link } node_t; node_t * construct_3() { //Allocate three pointers: //x for the first Node, and temporary pointers y and z for the other two Nodes. node_t *x; node_t *y; node_t *z; //Allocate three Node pointees and store references to them in the three pointers. x = malloc(sizeof(struct node)); y = malloc(sizeof(struct node)); z = malloc(sizeof(struct node)); //Dereference each pointer to store the appropriate number into the value field in its pointee. //Dereference each pointer to access the .next field in its pointee, //and use pointer assignment to set the .next field to point to the appropriate Node. x -> value = 1; y -> value = 2; z -> value = 3; x -> next = y; y -> next = z; z -> next = x; return x; } //You can ignore the following code for testing int dump_all(node_t*); int main (int argc, char ** argv) { node_t * x = construct_3(); return dump_all(x); } int dump_all(node_t * x) { printf("x -> %d\n", x->value); node_t * y = x->next; printf("%d -> %d\n", x->value, y->value); node_t * z = y->next; printf("%d -> %d\n", y->value, z->value); if(z->next != x) { printf("failed"); free(x); free(y); free(z); return -1; } else { printf("%d -> %d\n", z->value, x->value); free(x); free(y); free(z); return 0; } }
the_stack_data/95451702.c
/* { dg-do compile } */ /* { dg-options "-march=corei7 -O2" } */ #include <emmintrin.h> double a[8]; __m128d load_1 () { __m128d res; res = _mm_load_sd (&a[1]); res = _mm_loadh_pd (res, &a[2]); return res; } __m128d load_2 (double *a) { __m128d res; res = _mm_load_sd (&a[1]); res = _mm_loadh_pd (res, &a[2]); return res; } /* { dg-final { scan-assembler-times "movup" 2 } } */
the_stack_data/559560.c
#define _XOPEN_SOURCE 500 #include <stdio.h> #include <string.h> #include <ftw.h> #include <stdlib.h> #include <unistd.h> /* one directory is the directory to traverse itself */ int regular = 0, directory = -1, symbolic = 0, unknown = 0; int populateCounts(const char *fpath, const struct stat *sb, int typeflag, struct FTW *ftwbuf) { switch (typeflag) { case FTW_F: regular++; break; case FTW_D: case FTW_DNR: case FTW_DP: directory++; break; case FTW_NS: unknown++; break; case FTW_SL: case FTW_SLN: symbolic++; break; } return 0; } int main(int argc, char *argv[]) { if (argc < 2 || !strcmp(argv[1], "--help")) { printf("Usage: %s <path>\n", argv[0]); exit(EXIT_FAILURE); } if (nftw(argv[1], &populateCounts, sysconf(_SC_OPEN_MAX), FTW_PHYS) == 0) { puts("directory traversal finished"); } float sum = regular + directory + symbolic + unknown; printf("Regular files: %.2f%% %d)\n", (regular / sum) * 100, regular); printf("Directory files: %.2f%% %d)\n", (directory / sum) * 100, directory); printf("Symbolic files: %.2f%% %d)\n", (symbolic / sum) * 100, symbolic); printf("Unknown files: %.2f%% %d)\n", (unknown / sum) * 100, unknown); }
the_stack_data/1069060.c
int atoi(const char *nptr); int isalnum(int c); typedef int foo_fn(const char *); int foo(foo_fn fn) { int (*p)(const char *) = fn; return p("10"); } typedef int bar_fn(int); int bar(bar_fn fn) { return !!fn('a'); } int main(void) { return !(foo(atoi) + bar(isalnum) == 11); }
the_stack_data/247018004.c
#include <stdio.h> int factoriel(int k) { int i, fact_num = 1; for (i = 1; i <= k; i++) fact_num *= i; return fact_num; } int suma(int k) { int i, zbir = 0; for (i = 1; i <= k; i++) zbir += i; return zbir; } int main() { int i, n, rezultat = 0; printf("Vnesete eden pozitiven cel broj \n"); if (scanf("%d", &n) && n > 0) { for (i = 1; i < n; i++) { rezultat += factoriel(suma(i)); printf("%d! + ", suma(i)); } rezultat += factoriel(suma(n)); printf("%d! = %d", suma(n), rezultat); } else printf("Vnesena e pogresna vrednost \n"); return 0; }
the_stack_data/31133.c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_isalpha.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: jihhan <[email protected]> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/09/03 11:49:04 by jihhan #+# #+# */ /* Updated: 2020/09/03 14:27:27 by jihhan ### ########.fr */ /* */ /* ************************************************************************** */ int ft_isalpha(int c) { return ( ( (c > 64) && (c < 91) ) || ( (c > 96) && (c < 123) ) ? 1 : 0); }
the_stack_data/16675.c
/** * ppjC je programski jezik podskup jezika C definiran u dokumentu * https://github.com/fer-ppj/ppj-labosi/raw/master/upute/ppj-labos-upute.pdf * * ova skripta poziva ppjC kompajler (za sada samo analizator) pritiskom * na tipku [Ctrl+S], [Shift+Enter] ili [Alt+3] i prikazuje rezultat analize. * * ne garantiram tocnost leksera, sintaksnog niti semantickog analizatora koji * se ovdje pokrece. * * URL skripte prati verzije izvornog programa, tako da je moguca razmjena * izvornih programa u timu putem URL-ova. */ int printf(const char format[]) { /* i wish i could printf */ return 0; } int FI(int n) { int i, fib, f1, f2; if (n <= 1) { fib = 1; } else { f1 = 1; f2 = 1; // predzadnji i zadnji broj for (i = 2; i <= n; i++) { fib = f1 + f2; // novi broj if (fib < 0) { printf ("Ne moze se prikazati %d. Fibonaccijev broj!\n"); (void) getch(); exit (1); } f1 = f2; // zadnji postaje predzadnji f2 = fib; // novi postaje zadnji } } return fib; } int main(void) { int n, brojac, fib; while (1) { brojac = 0; printf("Upisite broj >"); // Primjeri: n=5,40,50 n=556; if (n < 0) { printf ("gotovo!\n"); break; } else { fib = FI (n); printf("%d. Fibonaccijev broj = %d , Izravno! \n"); } } return 0; }
the_stack_data/139482.c
/* Examples of math functions * * To compile: * gcc -ansi -pedantic -Wall math.c -lm */ #include<stdio.h> #include<math.h> /* PI & E are not defined in the C standard. * POSIX implementations include PI & E in math.h */ #define E 2.718282 #define PI 3.141593 int main () { double a = 64.0; double b, c; b = -1.0 * sqrt(a); c = sqrt(14.2); printf("Initial values: \n"); printf(" a=%.2f, b=%.2f, c=%.2f\n", a, b, c); printf(" e=%f, pi=%f\n", E, PI); printf("\nPower function:\n"); printf(" pow(3,2)=%.2f, pow(3,-2)=%.2f, pow(3,2.5)=%.2f\n", pow(3,2), pow(3,-2), pow(3,2.5)); printf("\nLogarithms:\n"); printf(" log(E)=%.2f, log(10.0)=%.2f, log(100.0)=%.2f\n", log(E), log(10.0), log(100.0)); printf(" log10(E)=%.2f, log10(10.0)=%.2f, log10(100.0)=%.2f\n", log10(E), log10(10.0), log10(100.0)); printf("\nFloor & celiling function results: \n"); printf(" floor(a)=%.2f, floor(b)=%.2f, floor(c)=%.2f\n", floor(a), floor(b), floor(c)); printf(" ceil(a)=%.2f, ceil(b)=%.2f, ceil(c)=%.2f\n", ceil(a), ceil(b), ceil(c)); printf(" fabs(a)=%.2f, fabs(b)=%.2f, fabs(c)=%.2f\n", fabs(a), fabs(b), fabs(c)); printf("\nTrig\n"); a = PI / 4.0; b = PI / 2.0; c = PI; printf(" a=PI/4=%.2f, b=PI/2=%.2f, c=PI=%.2f\n", a, b, c); printf(" cos(a)=%.2f, cos(b)=%.2f, cos(c)=%.2f\n", cos(a), cos(b), cos(c)); printf(" sin(a)=%.2f, sin(b)=%.2f, sin(c)=%.2f\n", sin(a), sin(b), sin(c)); printf(" tan(a)=%.2f, tan(b)=%.2f, tan(c)=%.2f\n", tan(a), tan(b), tan(c)); return 0; }
the_stack_data/516864.c
/* -*-c-*- */ /********************************************************************** thread_pthread.c - $Author: nagachika $ Copyright (C) 2004-2007 Koichi Sasada **********************************************************************/ #ifdef THREAD_SYSTEM_DEPENDENT_IMPLEMENTATION #include "gc.h" #ifdef HAVE_SYS_RESOURCE_H #include <sys/resource.h> #endif #ifdef HAVE_THR_STKSEGMENT #include <thread.h> #endif #if HAVE_FCNTL_H #include <fcntl.h> #elif HAVE_SYS_FCNTL_H #include <sys/fcntl.h> #endif #ifdef HAVE_SYS_PRCTL_H #include <sys/prctl.h> #endif #if defined(__native_client__) && defined(NACL_NEWLIB) # include "nacl/select.h" #endif #if defined(HAVE_SYS_TIME_H) #include <sys/time.h> #endif static void native_mutex_lock(pthread_mutex_t *lock); static void native_mutex_unlock(pthread_mutex_t *lock); static int native_mutex_trylock(pthread_mutex_t *lock); static void native_mutex_initialize(pthread_mutex_t *lock); static void native_mutex_destroy(pthread_mutex_t *lock); static void native_cond_signal(rb_nativethread_cond_t *cond); static void native_cond_broadcast(rb_nativethread_cond_t *cond); static void native_cond_wait(rb_nativethread_cond_t *cond, pthread_mutex_t *mutex); static void native_cond_initialize(rb_nativethread_cond_t *cond, int flags); static void native_cond_destroy(rb_nativethread_cond_t *cond); static void rb_thread_wakeup_timer_thread_low(void); static pthread_t timer_thread_id; #define RB_CONDATTR_CLOCK_MONOTONIC 1 #if defined(HAVE_PTHREAD_CONDATTR_SETCLOCK) && defined(HAVE_CLOCKID_T) && \ defined(CLOCK_REALTIME) && defined(CLOCK_MONOTONIC) && \ defined(HAVE_CLOCK_GETTIME) && defined(HAVE_PTHREAD_CONDATTR_INIT) #define USE_MONOTONIC_COND 1 #else #define USE_MONOTONIC_COND 0 #endif #if defined(HAVE_POLL) && defined(HAVE_FCNTL) && defined(F_GETFL) && defined(F_SETFL) && defined(O_NONBLOCK) && !defined(__native_client__) /* The timer thread sleeps while only one Ruby thread is running. */ # define USE_SLEEPY_TIMER_THREAD 1 #else # define USE_SLEEPY_TIMER_THREAD 0 #endif static void gvl_acquire_common(rb_vm_t *vm) { if (vm->gvl.acquired) { vm->gvl.waiting++; if (vm->gvl.waiting == 1) { /* * Wake up timer thread iff timer thread is slept. * When timer thread is polling mode, we don't want to * make confusing timer thread interval time. */ rb_thread_wakeup_timer_thread_low(); } while (vm->gvl.acquired) { native_cond_wait(&vm->gvl.cond, &vm->gvl.lock); } vm->gvl.waiting--; if (vm->gvl.need_yield) { vm->gvl.need_yield = 0; native_cond_signal(&vm->gvl.switch_cond); } } vm->gvl.acquired = 1; } static void gvl_acquire(rb_vm_t *vm, rb_thread_t *th) { native_mutex_lock(&vm->gvl.lock); gvl_acquire_common(vm); native_mutex_unlock(&vm->gvl.lock); } static void gvl_release_common(rb_vm_t *vm) { vm->gvl.acquired = 0; if (vm->gvl.waiting > 0) native_cond_signal(&vm->gvl.cond); } static void gvl_release(rb_vm_t *vm) { native_mutex_lock(&vm->gvl.lock); gvl_release_common(vm); native_mutex_unlock(&vm->gvl.lock); } static void gvl_yield(rb_vm_t *vm, rb_thread_t *th) { native_mutex_lock(&vm->gvl.lock); gvl_release_common(vm); /* An another thread is processing GVL yield. */ if (UNLIKELY(vm->gvl.wait_yield)) { while (vm->gvl.wait_yield) native_cond_wait(&vm->gvl.switch_wait_cond, &vm->gvl.lock); goto acquire; } if (vm->gvl.waiting > 0) { /* Wait until another thread task take GVL. */ vm->gvl.need_yield = 1; vm->gvl.wait_yield = 1; while (vm->gvl.need_yield) native_cond_wait(&vm->gvl.switch_cond, &vm->gvl.lock); vm->gvl.wait_yield = 0; } else { native_mutex_unlock(&vm->gvl.lock); sched_yield(); native_mutex_lock(&vm->gvl.lock); } native_cond_broadcast(&vm->gvl.switch_wait_cond); acquire: gvl_acquire_common(vm); native_mutex_unlock(&vm->gvl.lock); } static void gvl_init(rb_vm_t *vm) { native_mutex_initialize(&vm->gvl.lock); native_cond_initialize(&vm->gvl.cond, RB_CONDATTR_CLOCK_MONOTONIC); native_cond_initialize(&vm->gvl.switch_cond, RB_CONDATTR_CLOCK_MONOTONIC); native_cond_initialize(&vm->gvl.switch_wait_cond, RB_CONDATTR_CLOCK_MONOTONIC); vm->gvl.acquired = 0; vm->gvl.waiting = 0; vm->gvl.need_yield = 0; vm->gvl.wait_yield = 0; } static void gvl_destroy(rb_vm_t *vm) { native_cond_destroy(&vm->gvl.switch_wait_cond); native_cond_destroy(&vm->gvl.switch_cond); native_cond_destroy(&vm->gvl.cond); native_mutex_destroy(&vm->gvl.lock); } static void gvl_atfork(rb_vm_t *vm) { gvl_init(vm); gvl_acquire(vm, GET_THREAD()); } #define NATIVE_MUTEX_LOCK_DEBUG 0 static void mutex_debug(const char *msg, pthread_mutex_t *lock) { if (NATIVE_MUTEX_LOCK_DEBUG) { int r; static pthread_mutex_t dbglock = PTHREAD_MUTEX_INITIALIZER; if ((r = pthread_mutex_lock(&dbglock)) != 0) {exit(EXIT_FAILURE);} fprintf(stdout, "%s: %p\n", msg, (void *)lock); if ((r = pthread_mutex_unlock(&dbglock)) != 0) {exit(EXIT_FAILURE);} } } static void native_mutex_lock(pthread_mutex_t *lock) { int r; mutex_debug("lock", lock); if ((r = pthread_mutex_lock(lock)) != 0) { rb_bug_errno("pthread_mutex_lock", r); } } static void native_mutex_unlock(pthread_mutex_t *lock) { int r; mutex_debug("unlock", lock); if ((r = pthread_mutex_unlock(lock)) != 0) { rb_bug_errno("pthread_mutex_unlock", r); } } static inline int native_mutex_trylock(pthread_mutex_t *lock) { int r; mutex_debug("trylock", lock); if ((r = pthread_mutex_trylock(lock)) != 0) { if (r == EBUSY) { return EBUSY; } else { rb_bug_errno("pthread_mutex_trylock", r); } } return 0; } static void native_mutex_initialize(pthread_mutex_t *lock) { int r = pthread_mutex_init(lock, 0); mutex_debug("init", lock); if (r != 0) { rb_bug_errno("pthread_mutex_init", r); } } static void native_mutex_destroy(pthread_mutex_t *lock) { int r = pthread_mutex_destroy(lock); mutex_debug("destroy", lock); if (r != 0) { rb_bug_errno("pthread_mutex_destroy", r); } } static void native_cond_initialize(rb_nativethread_cond_t *cond, int flags) { #ifdef HAVE_PTHREAD_COND_INIT int r; # if USE_MONOTONIC_COND pthread_condattr_t attr; pthread_condattr_init(&attr); cond->clockid = CLOCK_REALTIME; if (flags & RB_CONDATTR_CLOCK_MONOTONIC) { r = pthread_condattr_setclock(&attr, CLOCK_MONOTONIC); if (r == 0) { cond->clockid = CLOCK_MONOTONIC; } } r = pthread_cond_init(&cond->cond, &attr); pthread_condattr_destroy(&attr); # else r = pthread_cond_init(&cond->cond, NULL); # endif if (r != 0) { rb_bug_errno("pthread_cond_init", r); } return; #endif } static void native_cond_destroy(rb_nativethread_cond_t *cond) { #ifdef HAVE_PTHREAD_COND_INIT int r = pthread_cond_destroy(&cond->cond); if (r != 0) { rb_bug_errno("pthread_cond_destroy", r); } #endif } /* * In OS X 10.7 (Lion), pthread_cond_signal and pthread_cond_broadcast return * EAGAIN after retrying 8192 times. You can see them in the following page: * * http://www.opensource.apple.com/source/Libc/Libc-763.11/pthreads/pthread_cond.c * * The following native_cond_signal and native_cond_broadcast functions * need to retrying until pthread functions don't return EAGAIN. */ static void native_cond_signal(rb_nativethread_cond_t *cond) { int r; do { r = pthread_cond_signal(&cond->cond); } while (r == EAGAIN); if (r != 0) { rb_bug_errno("pthread_cond_signal", r); } } static void native_cond_broadcast(rb_nativethread_cond_t *cond) { int r; do { r = pthread_cond_broadcast(&cond->cond); } while (r == EAGAIN); if (r != 0) { rb_bug_errno("native_cond_broadcast", r); } } static void native_cond_wait(rb_nativethread_cond_t *cond, pthread_mutex_t *mutex) { int r = pthread_cond_wait(&cond->cond, mutex); if (r != 0) { rb_bug_errno("pthread_cond_wait", r); } } static int native_cond_timedwait(rb_nativethread_cond_t *cond, pthread_mutex_t *mutex, struct timespec *ts) { int r; /* * An old Linux may return EINTR. Even though POSIX says * "These functions shall not return an error code of [EINTR]". * http://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_cond_timedwait.html * Let's hide it from arch generic code. */ do { r = pthread_cond_timedwait(&cond->cond, mutex, ts); } while (r == EINTR); if (r != 0 && r != ETIMEDOUT) { rb_bug_errno("pthread_cond_timedwait", r); } return r; } static struct timespec native_cond_timeout(rb_nativethread_cond_t *cond, struct timespec timeout_rel) { int ret; struct timeval tv; struct timespec timeout; struct timespec now; #if USE_MONOTONIC_COND if (cond->clockid == CLOCK_MONOTONIC) { ret = clock_gettime(cond->clockid, &now); if (ret != 0) rb_sys_fail("clock_gettime()"); goto out; } if (cond->clockid != CLOCK_REALTIME) rb_bug("unsupported clockid %"PRIdVALUE, (SIGNED_VALUE)cond->clockid); #endif ret = gettimeofday(&tv, 0); if (ret != 0) rb_sys_fail(0); now.tv_sec = tv.tv_sec; now.tv_nsec = tv.tv_usec * 1000; #if USE_MONOTONIC_COND out: #endif timeout.tv_sec = now.tv_sec; timeout.tv_nsec = now.tv_nsec; timeout.tv_sec += timeout_rel.tv_sec; timeout.tv_nsec += timeout_rel.tv_nsec; if (timeout.tv_nsec >= 1000*1000*1000) { timeout.tv_sec++; timeout.tv_nsec -= 1000*1000*1000; } if (timeout.tv_sec < now.tv_sec) timeout.tv_sec = TIMET_MAX; return timeout; } #define native_cleanup_push pthread_cleanup_push #define native_cleanup_pop pthread_cleanup_pop #ifdef HAVE_SCHED_YIELD #define native_thread_yield() (void)sched_yield() #else #define native_thread_yield() ((void)0) #endif #if defined(SIGVTALRM) && !defined(__CYGWIN__) && !defined(__SYMBIAN32__) #define USE_SIGNAL_THREAD_LIST 1 #endif #ifdef USE_SIGNAL_THREAD_LIST static void add_signal_thread_list(rb_thread_t *th); static void remove_signal_thread_list(rb_thread_t *th); static rb_nativethread_lock_t signal_thread_list_lock; #endif static pthread_key_t ruby_native_thread_key; static void null_func(int i) { /* null */ } static rb_thread_t * ruby_thread_from_native(void) { return pthread_getspecific(ruby_native_thread_key); } static int ruby_thread_set_native(rb_thread_t *th) { return pthread_setspecific(ruby_native_thread_key, th) == 0; } static void native_thread_init(rb_thread_t *th); void Init_native_thread(void) { rb_thread_t *th = GET_THREAD(); pthread_key_create(&ruby_native_thread_key, NULL); th->thread_id = pthread_self(); native_thread_init(th); #ifdef USE_SIGNAL_THREAD_LIST native_mutex_initialize(&signal_thread_list_lock); #endif #ifndef __native_client__ posix_signal(SIGVTALRM, null_func); #endif } static void native_thread_init(rb_thread_t *th) { native_cond_initialize(&th->native_thread_data.sleep_cond, RB_CONDATTR_CLOCK_MONOTONIC); ruby_thread_set_native(th); } static void native_thread_destroy(rb_thread_t *th) { native_cond_destroy(&th->native_thread_data.sleep_cond); } #ifndef USE_THREAD_CACHE #define USE_THREAD_CACHE 0 #endif #if USE_THREAD_CACHE static rb_thread_t *register_cached_thread_and_wait(void); #endif #if defined HAVE_PTHREAD_GETATTR_NP || defined HAVE_PTHREAD_ATTR_GET_NP #define STACKADDR_AVAILABLE 1 #elif defined HAVE_PTHREAD_GET_STACKADDR_NP && defined HAVE_PTHREAD_GET_STACKSIZE_NP #define STACKADDR_AVAILABLE 1 #undef MAINSTACKADDR_AVAILABLE #define MAINSTACKADDR_AVAILABLE 1 void *pthread_get_stackaddr_np(pthread_t); size_t pthread_get_stacksize_np(pthread_t); #elif defined HAVE_THR_STKSEGMENT || defined HAVE_PTHREAD_STACKSEG_NP #define STACKADDR_AVAILABLE 1 #elif defined HAVE_PTHREAD_GETTHRDS_NP #define STACKADDR_AVAILABLE 1 #elif defined __ia64 && defined _HPUX_SOURCE #include <sys/dyntune.h> #define STACKADDR_AVAILABLE 1 /* * Do not lower the thread's stack to PTHREAD_STACK_MIN, * otherwise one would receive a 'sendsig: useracc failed.' * and a coredump. */ #undef PTHREAD_STACK_MIN #define HAVE_PTHREAD_ATTR_GET_NP 1 #undef HAVE_PTHREAD_ATTR_GETSTACK /* * As the PTHREAD_STACK_MIN is undefined and * noone touches the default stacksize, * it is just fine to use the default. */ #define pthread_attr_get_np(thid, attr) 0 /* * Using value of sp is very rough... To make it more real, * addr would need to be aligned to vps_pagesize. * The vps_pagesize is 'Default user page size (kBytes)' * and could be retrieved by gettune(). */ static int hpux_attr_getstackaddr(const pthread_attr_t *attr, void **addr) { static uint64_t pagesize; size_t size; if (!pagesize) { if (gettune("vps_pagesize", &pagesize)) { pagesize = 16; } pagesize *= 1024; } pthread_attr_getstacksize(attr, &size); *addr = (void *)((size_t)((char *)_Asm_get_sp() - size) & ~(pagesize - 1)); return 0; } #define pthread_attr_getstackaddr(attr, addr) hpux_attr_getstackaddr(attr, addr) #endif #ifndef MAINSTACKADDR_AVAILABLE # ifdef STACKADDR_AVAILABLE # define MAINSTACKADDR_AVAILABLE 1 # else # define MAINSTACKADDR_AVAILABLE 0 # endif #endif #if MAINSTACKADDR_AVAILABLE && !defined(get_main_stack) # define get_main_stack(addr, size) get_stack(addr, size) #endif #ifdef STACKADDR_AVAILABLE /* * Get the initial address and size of current thread's stack */ static int get_stack(void **addr, size_t *size) { #define CHECK_ERR(expr) \ {int err = (expr); if (err) return err;} #ifdef HAVE_PTHREAD_GETATTR_NP /* Linux */ pthread_attr_t attr; size_t guard = 0; STACK_GROW_DIR_DETECTION; CHECK_ERR(pthread_getattr_np(pthread_self(), &attr)); # ifdef HAVE_PTHREAD_ATTR_GETSTACK CHECK_ERR(pthread_attr_getstack(&attr, addr, size)); STACK_DIR_UPPER((void)0, (void)(*addr = (char *)*addr + *size)); # else CHECK_ERR(pthread_attr_getstackaddr(&attr, addr)); CHECK_ERR(pthread_attr_getstacksize(&attr, size)); # endif CHECK_ERR(pthread_attr_getguardsize(&attr, &guard)); *size -= guard; pthread_attr_destroy(&attr); #elif defined HAVE_PTHREAD_ATTR_GET_NP /* FreeBSD, DragonFly BSD, NetBSD */ pthread_attr_t attr; CHECK_ERR(pthread_attr_init(&attr)); CHECK_ERR(pthread_attr_get_np(pthread_self(), &attr)); # ifdef HAVE_PTHREAD_ATTR_GETSTACK CHECK_ERR(pthread_attr_getstack(&attr, addr, size)); # else CHECK_ERR(pthread_attr_getstackaddr(&attr, addr)); CHECK_ERR(pthread_attr_getstacksize(&attr, size)); # endif STACK_DIR_UPPER((void)0, (void)(*addr = (char *)*addr + *size)); pthread_attr_destroy(&attr); #elif (defined HAVE_PTHREAD_GET_STACKADDR_NP && defined HAVE_PTHREAD_GET_STACKSIZE_NP) /* MacOS X */ pthread_t th = pthread_self(); *addr = pthread_get_stackaddr_np(th); *size = pthread_get_stacksize_np(th); #elif defined HAVE_THR_STKSEGMENT || defined HAVE_PTHREAD_STACKSEG_NP stack_t stk; # if defined HAVE_THR_STKSEGMENT /* Solaris */ CHECK_ERR(thr_stksegment(&stk)); # else /* OpenBSD */ CHECK_ERR(pthread_stackseg_np(pthread_self(), &stk)); # endif *addr = stk.ss_sp; *size = stk.ss_size; #elif defined HAVE_PTHREAD_GETTHRDS_NP /* AIX */ pthread_t th = pthread_self(); struct __pthrdsinfo thinfo; char reg[256]; int regsiz=sizeof(reg); CHECK_ERR(pthread_getthrds_np(&th, PTHRDSINFO_QUERY_ALL, &thinfo, sizeof(thinfo), &reg, &regsiz)); *addr = thinfo.__pi_stackaddr; *size = thinfo.__pi_stacksize; STACK_DIR_UPPER((void)0, (void)(*addr = (char *)*addr + *size)); #else #error STACKADDR_AVAILABLE is defined but not implemented. #endif return 0; #undef CHECK_ERR } #endif static struct { rb_nativethread_id_t id; size_t stack_maxsize; VALUE *stack_start; #ifdef __ia64 VALUE *register_stack_start; #endif } native_main_thread; #ifdef STACK_END_ADDRESS extern void *STACK_END_ADDRESS; #endif enum { RUBY_STACK_SPACE_LIMIT = 1024 * 1024, /* 1024KB */ RUBY_STACK_SPACE_RATIO = 5 }; static size_t space_size(size_t stack_size) { size_t space_size = stack_size / RUBY_STACK_SPACE_RATIO; if (space_size > RUBY_STACK_SPACE_LIMIT) { return RUBY_STACK_SPACE_LIMIT; } else { return space_size; } } #undef ruby_init_stack /* Set stack bottom of Ruby implementation. * * You must call this function before any heap allocation by Ruby implementation. * Or GC will break living objects */ void ruby_init_stack(volatile VALUE *addr #ifdef __ia64 , void *bsp #endif ) { native_main_thread.id = pthread_self(); #if MAINSTACKADDR_AVAILABLE if (native_main_thread.stack_maxsize) return; { void* stackaddr; size_t size; if (get_main_stack(&stackaddr, &size) == 0) { native_main_thread.stack_maxsize = size; native_main_thread.stack_start = stackaddr; return; } } #endif #ifdef STACK_END_ADDRESS native_main_thread.stack_start = STACK_END_ADDRESS; #else if (!native_main_thread.stack_start || STACK_UPPER((VALUE *)(void *)&addr, native_main_thread.stack_start > addr, native_main_thread.stack_start < addr)) { native_main_thread.stack_start = (VALUE *)addr; } #endif #ifdef __ia64 if (!native_main_thread.register_stack_start || (VALUE*)bsp < native_main_thread.register_stack_start) { native_main_thread.register_stack_start = (VALUE*)bsp; } #endif { #if defined(HAVE_GETRLIMIT) #if defined(PTHREAD_STACK_DEFAULT) # if PTHREAD_STACK_DEFAULT < RUBY_STACK_SPACE*5 # error "PTHREAD_STACK_DEFAULT is too small" # endif size_t size = PTHREAD_STACK_DEFAULT; #else size_t size = RUBY_VM_THREAD_VM_STACK_SIZE; #endif size_t space; int pagesize = getpagesize(); struct rlimit rlim; STACK_GROW_DIR_DETECTION; if (getrlimit(RLIMIT_STACK, &rlim) == 0) { size = (size_t)rlim.rlim_cur; } addr = native_main_thread.stack_start; if (IS_STACK_DIR_UPPER()) { space = ((size_t)((char *)addr + size) / pagesize) * pagesize - (size_t)addr; } else { space = (size_t)addr - ((size_t)((char *)addr - size) / pagesize + 1) * pagesize; } native_main_thread.stack_maxsize = space; #endif } /* If addr is out of range of main-thread stack range estimation, */ /* it should be on co-routine (alternative stack). [Feature #2294] */ { void *start, *end; STACK_GROW_DIR_DETECTION; if (IS_STACK_DIR_UPPER()) { start = native_main_thread.stack_start; end = (char *)native_main_thread.stack_start + native_main_thread.stack_maxsize; } else { start = (char *)native_main_thread.stack_start - native_main_thread.stack_maxsize; end = native_main_thread.stack_start; } if ((void *)addr < start || (void *)addr > end) { /* out of range */ native_main_thread.stack_start = (VALUE *)addr; native_main_thread.stack_maxsize = 0; /* unknown */ } } } #define CHECK_ERR(expr) \ {int err = (expr); if (err) {rb_bug_errno(#expr, err);}} static int native_thread_init_stack(rb_thread_t *th) { rb_nativethread_id_t curr = pthread_self(); if (pthread_equal(curr, native_main_thread.id)) { th->machine.stack_start = native_main_thread.stack_start; th->machine.stack_maxsize = native_main_thread.stack_maxsize; } else { #ifdef STACKADDR_AVAILABLE void *start; size_t size; if (get_stack(&start, &size) == 0) { th->machine.stack_start = start; th->machine.stack_maxsize = size; } #elif defined get_stack_of if (!th->machine.stack_maxsize) { native_mutex_lock(&th->interrupt_lock); native_mutex_unlock(&th->interrupt_lock); } #else rb_raise(rb_eNotImpError, "ruby engine can initialize only in the main thread"); #endif } #ifdef __ia64 th->machine.register_stack_start = native_main_thread.register_stack_start; th->machine.stack_maxsize /= 2; th->machine.register_stack_maxsize = th->machine.stack_maxsize; #endif return 0; } #ifndef __CYGWIN__ #define USE_NATIVE_THREAD_INIT 1 #endif static void * thread_start_func_1(void *th_ptr) { #if USE_THREAD_CACHE thread_start: #endif { rb_thread_t *th = th_ptr; #if !defined USE_NATIVE_THREAD_INIT VALUE stack_start; #endif #if defined USE_NATIVE_THREAD_INIT native_thread_init_stack(th); #endif native_thread_init(th); /* run */ #if defined USE_NATIVE_THREAD_INIT thread_start_func_2(th, th->machine.stack_start, rb_ia64_bsp()); #else thread_start_func_2(th, &stack_start, rb_ia64_bsp()); #endif } #if USE_THREAD_CACHE if (1) { /* cache thread */ rb_thread_t *th; if ((th = register_cached_thread_and_wait()) != 0) { th_ptr = (void *)th; th->thread_id = pthread_self(); goto thread_start; } } #endif return 0; } struct cached_thread_entry { volatile rb_thread_t **th_area; rb_nativethread_cond_t *cond; struct cached_thread_entry *next; }; #if USE_THREAD_CACHE static pthread_mutex_t thread_cache_lock = PTHREAD_MUTEX_INITIALIZER; struct cached_thread_entry *cached_thread_root; static rb_thread_t * register_cached_thread_and_wait(void) { rb_nativethread_cond_t cond = { PTHREAD_COND_INITIALIZER, }; volatile rb_thread_t *th_area = 0; struct timeval tv; struct timespec ts; struct cached_thread_entry *entry = (struct cached_thread_entry *)malloc(sizeof(struct cached_thread_entry)); if (entry == 0) { return 0; /* failed -> terminate thread immediately */ } gettimeofday(&tv, 0); ts.tv_sec = tv.tv_sec + 60; ts.tv_nsec = tv.tv_usec * 1000; pthread_mutex_lock(&thread_cache_lock); { entry->th_area = &th_area; entry->cond = &cond; entry->next = cached_thread_root; cached_thread_root = entry; native_cond_timedwait(&cond, &thread_cache_lock, &ts); { struct cached_thread_entry *e, **prev = &cached_thread_root; while ((e = *prev) != 0) { if (e == entry) { *prev = e->next; break; } prev = &e->next; } } free(entry); /* ok */ native_cond_destroy(&cond); } pthread_mutex_unlock(&thread_cache_lock); return (rb_thread_t *)th_area; } #endif static int use_cached_thread(rb_thread_t *th) { int result = 0; #if USE_THREAD_CACHE struct cached_thread_entry *entry; if (cached_thread_root) { pthread_mutex_lock(&thread_cache_lock); entry = cached_thread_root; { if (cached_thread_root) { cached_thread_root = entry->next; *entry->th_area = th; result = 1; } } if (result) { native_cond_signal(entry->cond); } pthread_mutex_unlock(&thread_cache_lock); } #endif return result; } static int native_thread_create(rb_thread_t *th) { int err = 0; if (use_cached_thread(th)) { thread_debug("create (use cached thread): %p\n", (void *)th); } else { #ifdef HAVE_PTHREAD_ATTR_INIT pthread_attr_t attr; pthread_attr_t *const attrp = &attr; #else pthread_attr_t *const attrp = NULL; #endif const size_t stack_size = th->vm->default_params.thread_machine_stack_size; const size_t space = space_size(stack_size); th->machine.stack_maxsize = stack_size - space; #ifdef __ia64 th->machine.stack_maxsize /= 2; th->machine.register_stack_maxsize = th->machine.stack_maxsize; #endif #ifdef HAVE_PTHREAD_ATTR_INIT CHECK_ERR(pthread_attr_init(&attr)); # ifdef PTHREAD_STACK_MIN thread_debug("create - stack size: %lu\n", (unsigned long)stack_size); CHECK_ERR(pthread_attr_setstacksize(&attr, stack_size)); # endif # ifdef HAVE_PTHREAD_ATTR_SETINHERITSCHED CHECK_ERR(pthread_attr_setinheritsched(&attr, PTHREAD_INHERIT_SCHED)); # endif CHECK_ERR(pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED)); #endif #ifdef get_stack_of native_mutex_lock(&th->interrupt_lock); #endif err = pthread_create(&th->thread_id, attrp, thread_start_func_1, th); #ifdef get_stack_of if (!err) { get_stack_of(th->thread_id, &th->machine.stack_start, &th->machine.stack_maxsize); } native_mutex_unlock(&th->interrupt_lock); #endif thread_debug("create: %p (%d)\n", (void *)th, err); #ifdef HAVE_PTHREAD_ATTR_INIT CHECK_ERR(pthread_attr_destroy(&attr)); #endif } return err; } static void native_thread_join(pthread_t th) { int err = pthread_join(th, 0); if (err) { rb_raise(rb_eThreadError, "native_thread_join() failed (%d)", err); } } #if USE_NATIVE_THREAD_PRIORITY static void native_thread_apply_priority(rb_thread_t *th) { #if defined(_POSIX_PRIORITY_SCHEDULING) && (_POSIX_PRIORITY_SCHEDULING > 0) struct sched_param sp; int policy; int priority = 0 - th->priority; int max, min; pthread_getschedparam(th->thread_id, &policy, &sp); max = sched_get_priority_max(policy); min = sched_get_priority_min(policy); if (min > priority) { priority = min; } else if (max < priority) { priority = max; } sp.sched_priority = priority; pthread_setschedparam(th->thread_id, policy, &sp); #else /* not touched */ #endif } #endif /* USE_NATIVE_THREAD_PRIORITY */ static int native_fd_select(int n, rb_fdset_t *readfds, rb_fdset_t *writefds, rb_fdset_t *exceptfds, struct timeval *timeout, rb_thread_t *th) { return rb_fd_select(n, readfds, writefds, exceptfds, timeout); } static void ubf_pthread_cond_signal(void *ptr) { rb_thread_t *th = (rb_thread_t *)ptr; thread_debug("ubf_pthread_cond_signal (%p)\n", (void *)th); native_cond_signal(&th->native_thread_data.sleep_cond); } static void native_sleep(rb_thread_t *th, struct timeval *timeout_tv) { struct timespec timeout; pthread_mutex_t *lock = &th->interrupt_lock; rb_nativethread_cond_t *cond = &th->native_thread_data.sleep_cond; if (timeout_tv) { struct timespec timeout_rel; timeout_rel.tv_sec = timeout_tv->tv_sec; timeout_rel.tv_nsec = timeout_tv->tv_usec * 1000; /* Solaris cond_timedwait() return EINVAL if an argument is greater than * current_time + 100,000,000. So cut up to 100,000,000. This is * considered as a kind of spurious wakeup. The caller to native_sleep * should care about spurious wakeup. * * See also [Bug #1341] [ruby-core:29702] * http://download.oracle.com/docs/cd/E19683-01/816-0216/6m6ngupgv/index.html */ if (timeout_rel.tv_sec > 100000000) { timeout_rel.tv_sec = 100000000; timeout_rel.tv_nsec = 0; } timeout = native_cond_timeout(cond, timeout_rel); } GVL_UNLOCK_BEGIN(); { pthread_mutex_lock(lock); th->unblock.func = ubf_pthread_cond_signal; th->unblock.arg = th; if (RUBY_VM_INTERRUPTED(th)) { /* interrupted. return immediate */ thread_debug("native_sleep: interrupted before sleep\n"); } else { if (!timeout_tv) native_cond_wait(cond, lock); else native_cond_timedwait(cond, lock, &timeout); } th->unblock.func = 0; th->unblock.arg = 0; pthread_mutex_unlock(lock); } GVL_UNLOCK_END(); thread_debug("native_sleep done\n"); } #ifdef USE_SIGNAL_THREAD_LIST struct signal_thread_list { rb_thread_t *th; struct signal_thread_list *prev; struct signal_thread_list *next; }; static struct signal_thread_list signal_thread_list_anchor = { 0, 0, 0, }; #define FGLOCK(lock, body) do { \ native_mutex_lock(lock); \ { \ body; \ } \ native_mutex_unlock(lock); \ } while (0) #if 0 /* for debug */ static void print_signal_list(char *str) { struct signal_thread_list *list = signal_thread_list_anchor.next; thread_debug("list (%s)> ", str); while (list) { thread_debug("%p (%p), ", list->th, list->th->thread_id); list = list->next; } thread_debug("\n"); } #endif static void add_signal_thread_list(rb_thread_t *th) { if (!th->native_thread_data.signal_thread_list) { FGLOCK(&signal_thread_list_lock, { struct signal_thread_list *list = malloc(sizeof(struct signal_thread_list)); if (list == 0) { fprintf(stderr, "[FATAL] failed to allocate memory\n"); exit(EXIT_FAILURE); } list->th = th; list->prev = &signal_thread_list_anchor; list->next = signal_thread_list_anchor.next; if (list->next) { list->next->prev = list; } signal_thread_list_anchor.next = list; th->native_thread_data.signal_thread_list = list; }); } } static void remove_signal_thread_list(rb_thread_t *th) { if (th->native_thread_data.signal_thread_list) { FGLOCK(&signal_thread_list_lock, { struct signal_thread_list *list = (struct signal_thread_list *) th->native_thread_data.signal_thread_list; list->prev->next = list->next; if (list->next) { list->next->prev = list->prev; } th->native_thread_data.signal_thread_list = 0; list->th = 0; free(list); /* ok */ }); } } static void ubf_select_each(rb_thread_t *th) { thread_debug("ubf_select_each (%p)\n", (void *)th->thread_id); if (th) { pthread_kill(th->thread_id, SIGVTALRM); } } static void ubf_select(void *ptr) { rb_thread_t *th = (rb_thread_t *)ptr; add_signal_thread_list(th); /* * ubf_select_each() doesn't guarantee to wake up the target thread. * Therefore, we need to activate timer thread when called from * Thread#kill etc. * In the other hands, we shouldn't call rb_thread_wakeup_timer_thread() * if running on timer thread because it may make endless wakeups. */ if (pthread_self() != timer_thread_id) rb_thread_wakeup_timer_thread(); ubf_select_each(th); } static void ping_signal_thread_list(void) { if (signal_thread_list_anchor.next) { FGLOCK(&signal_thread_list_lock, { struct signal_thread_list *list; list = signal_thread_list_anchor.next; while (list) { ubf_select_each(list->th); list = list->next; } }); } } static int check_signal_thread_list(void) { if (signal_thread_list_anchor.next) return 1; else return 0; } #else /* USE_SIGNAL_THREAD_LIST */ #define add_signal_thread_list(th) (void)(th) #define remove_signal_thread_list(th) (void)(th) #define ubf_select 0 static void ping_signal_thread_list(void) { return; } static int check_signal_thread_list(void) { return 0; } #endif /* USE_SIGNAL_THREAD_LIST */ #define TT_DEBUG 0 #define WRITE_CONST(fd, str) (void)(write((fd),(str),sizeof(str)-1)<0) /* 100ms. 10ms is too small for user level thread scheduling * on recent Linux (tested on 2.6.35) */ #define TIME_QUANTUM_USEC (100 * 1000) #if USE_SLEEPY_TIMER_THREAD static int timer_thread_pipe[2] = {-1, -1}; static int timer_thread_pipe_low[2] = {-1, -1}; /* low priority */ static int timer_thread_pipe_owner_process; /* only use signal-safe system calls here */ static void rb_thread_wakeup_timer_thread_fd(int fd) { ssize_t result; /* already opened */ if (timer_thread_pipe_owner_process == getpid()) { const char *buff = "!"; retry: if ((result = write(fd, buff, 1)) <= 0) { switch (errno) { case EINTR: goto retry; case EAGAIN: #if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN case EWOULDBLOCK: #endif break; default: rb_async_bug_errno("rb_thread_wakeup_timer_thread - write", errno); } } if (TT_DEBUG) WRITE_CONST(2, "rb_thread_wakeup_timer_thread: write\n"); } else { /* ignore wakeup */ } } void rb_thread_wakeup_timer_thread(void) { rb_thread_wakeup_timer_thread_fd(timer_thread_pipe[1]); } static void rb_thread_wakeup_timer_thread_low(void) { rb_thread_wakeup_timer_thread_fd(timer_thread_pipe_low[1]); } /* VM-dependent API is not available for this function */ static void consume_communication_pipe(int fd) { #define CCP_READ_BUFF_SIZE 1024 /* buffer can be shared because no one refers to them. */ static char buff[CCP_READ_BUFF_SIZE]; ssize_t result; while (1) { result = read(fd, buff, sizeof(buff)); if (result == 0) { return; } else if (result < 0) { switch (errno) { case EINTR: continue; /* retry */ case EAGAIN: return; default: rb_async_bug_errno("consume_communication_pipe: read\n", errno); } } } } static void close_communication_pipe(int pipes[2]) { if (close(pipes[0]) < 0) { rb_bug_errno("native_stop_timer_thread - close(ttp[0])", errno); } if (close(pipes[1]) < 0) { rb_bug_errno("native_stop_timer_thread - close(ttp[1])", errno); } pipes[0] = pipes[1] = -1; } static void set_nonblock(int fd) { int oflags; int err; oflags = fcntl(fd, F_GETFL); if (oflags == -1) rb_sys_fail(0); oflags |= O_NONBLOCK; err = fcntl(fd, F_SETFL, oflags); if (err == -1) rb_sys_fail(0); } static void setup_communication_pipe_internal(int pipes[2]) { int err; if (pipes[0] != -1) { /* close pipe of parent process */ close_communication_pipe(pipes); } err = rb_cloexec_pipe(pipes); if (err != 0) { rb_bug_errno("setup_communication_pipe: Failed to create communication pipe for timer thread", errno); } rb_update_max_fd(pipes[0]); rb_update_max_fd(pipes[1]); set_nonblock(pipes[0]); set_nonblock(pipes[1]); } /* communication pipe with timer thread and signal handler */ static void setup_communication_pipe(void) { if (timer_thread_pipe_owner_process == getpid()) { /* already set up. */ return; } setup_communication_pipe_internal(timer_thread_pipe); setup_communication_pipe_internal(timer_thread_pipe_low); /* validate pipe on this process */ timer_thread_pipe_owner_process = getpid(); } /** * Let the timer thread sleep a while. * * The timer thread sleeps until woken up by rb_thread_wakeup_timer_thread() if only one Ruby thread is running. * @pre the calling context is in the timer thread. */ static inline void timer_thread_sleep(rb_global_vm_lock_t* gvl) { int result; int need_polling; struct pollfd pollfds[2]; pollfds[0].fd = timer_thread_pipe[0]; pollfds[0].events = POLLIN; pollfds[1].fd = timer_thread_pipe_low[0]; pollfds[1].events = POLLIN; need_polling = check_signal_thread_list(); if (gvl->waiting > 0 || need_polling) { /* polling (TIME_QUANTUM_USEC usec) */ result = poll(pollfds, 1, TIME_QUANTUM_USEC/1000); } else { /* wait (infinite) */ result = poll(pollfds, numberof(pollfds), -1); } if (result == 0) { /* maybe timeout */ } else if (result > 0) { consume_communication_pipe(timer_thread_pipe[0]); consume_communication_pipe(timer_thread_pipe_low[0]); } else { /* result < 0 */ switch (errno) { case EBADF: case EINVAL: case ENOMEM: /* from Linux man */ case EFAULT: /* from FreeBSD man */ rb_async_bug_errno("thread_timer: select", errno); default: /* ignore */; } } } #else /* USE_SLEEPY_TIMER_THREAD */ # define PER_NANO 1000000000 void rb_thread_wakeup_timer_thread(void) {} static void rb_thread_wakeup_timer_thread_low(void) {} static pthread_mutex_t timer_thread_lock; static rb_nativethread_cond_t timer_thread_cond; static inline void timer_thread_sleep(rb_global_vm_lock_t* unused) { struct timespec ts; ts.tv_sec = 0; ts.tv_nsec = TIME_QUANTUM_USEC * 1000; ts = native_cond_timeout(&timer_thread_cond, ts); native_cond_timedwait(&timer_thread_cond, &timer_thread_lock, &ts); } #endif /* USE_SLEEPY_TIMER_THREAD */ #if defined(__linux__) && defined(PR_SET_NAME) # undef SET_THREAD_NAME # define SET_THREAD_NAME(name) prctl(PR_SET_NAME, name) #elif !defined(SET_THREAD_NAME) # define SET_THREAD_NAME(name) (void)0 #endif static void * thread_timer(void *p) { rb_global_vm_lock_t *gvl = (rb_global_vm_lock_t *)p; if (TT_DEBUG) WRITE_CONST(2, "start timer thread\n"); SET_THREAD_NAME("ruby-timer-thr"); #if !USE_SLEEPY_TIMER_THREAD native_mutex_initialize(&timer_thread_lock); native_cond_initialize(&timer_thread_cond, RB_CONDATTR_CLOCK_MONOTONIC); native_mutex_lock(&timer_thread_lock); #endif while (system_working > 0) { /* timer function */ ping_signal_thread_list(); timer_thread_function(0); if (TT_DEBUG) WRITE_CONST(2, "tick\n"); /* wait */ timer_thread_sleep(gvl); } #if !USE_SLEEPY_TIMER_THREAD native_mutex_unlock(&timer_thread_lock); native_cond_destroy(&timer_thread_cond); native_mutex_destroy(&timer_thread_lock); #endif if (TT_DEBUG) WRITE_CONST(2, "finish timer thread\n"); return NULL; } static void rb_thread_create_timer_thread(void) { if (!timer_thread_id) { int err; #ifdef HAVE_PTHREAD_ATTR_INIT pthread_attr_t attr; err = pthread_attr_init(&attr); if (err != 0) { fprintf(stderr, "[FATAL] Failed to initialize pthread attr: %s\n", strerror(err)); exit(EXIT_FAILURE); } # ifdef PTHREAD_STACK_MIN { const size_t min_size = (4096 * 4); /* Allocate the machine stack for the timer thread * at least 16KB (4 pages). FreeBSD 8.2 AMD64 causes * machine stack overflow only with PTHREAD_STACK_MIN. */ size_t stack_size = PTHREAD_STACK_MIN; /* may be dynamic, get only once */ if (stack_size < min_size) stack_size = min_size; if (THREAD_DEBUG) stack_size += BUFSIZ; pthread_attr_setstacksize(&attr, stack_size); } # endif #endif #if USE_SLEEPY_TIMER_THREAD setup_communication_pipe(); #endif /* USE_SLEEPY_TIMER_THREAD */ /* create timer thread */ if (timer_thread_id) { rb_bug("rb_thread_create_timer_thread: Timer thread was already created\n"); } #ifdef HAVE_PTHREAD_ATTR_INIT err = pthread_create(&timer_thread_id, &attr, thread_timer, &GET_VM()->gvl); #else err = pthread_create(&timer_thread_id, NULL, thread_timer, &GET_VM()->gvl); #endif if (err != 0) { fprintf(stderr, "[FATAL] Failed to create timer thread: %s\n", strerror(err)); exit(EXIT_FAILURE); } #ifdef HAVE_PTHREAD_ATTR_INIT pthread_attr_destroy(&attr); #endif } } static int native_stop_timer_thread(int close_anyway) { int stopped; stopped = --system_working <= 0; if (TT_DEBUG) fprintf(stderr, "stop timer thread\n"); if (stopped) { /* join */ rb_thread_wakeup_timer_thread(); native_thread_join(timer_thread_id); if (TT_DEBUG) fprintf(stderr, "joined timer thread\n"); timer_thread_id = 0; /* close communication pipe */ if (close_anyway) { /* TODO: Uninstall all signal handlers or mask all signals. * This pass is cleaning phase (terminate ruby process). * To avoid such race, we skip to close communication * pipe. OS will close it at process termination. * It may not good practice, but pragmatic. * We remain it is TODO. */ /* close_communication_pipe(); */ } } return stopped; } static void native_reset_timer_thread(void) { if (TT_DEBUG) fprintf(stderr, "reset timer thread\n"); } #ifdef HAVE_SIGALTSTACK int ruby_stack_overflowed_p(const rb_thread_t *th, const void *addr) { void *base; size_t size; const size_t water_mark = 1024 * 1024; STACK_GROW_DIR_DETECTION; #ifdef STACKADDR_AVAILABLE if (get_stack(&base, &size) == 0) { # ifdef __APPLE__ if (pthread_equal(th->thread_id, native_main_thread.id)) { struct rlimit rlim; if (getrlimit(RLIMIT_STACK, &rlim) == 0 && rlim.rlim_cur > size) { size = (size_t)rlim.rlim_cur; } } # endif base = (char *)base + STACK_DIR_UPPER(+size, -size); } else #endif if (th) { size = th->machine.stack_maxsize; base = (char *)th->machine.stack_start - STACK_DIR_UPPER(0, size); } else { return 0; } size /= RUBY_STACK_SPACE_RATIO; if (size > water_mark) size = water_mark; if (IS_STACK_DIR_UPPER()) { if (size > ~(size_t)base+1) size = ~(size_t)base+1; if (addr > base && addr <= (void *)((char *)base + size)) return 1; } else { if (size > (size_t)base) size = (size_t)base; if (addr > (void *)((char *)base - size) && addr <= base) return 1; } return 0; } #endif int rb_reserved_fd_p(int fd) { #if USE_SLEEPY_TIMER_THREAD if (fd == timer_thread_pipe[0] || fd == timer_thread_pipe[1] || fd == timer_thread_pipe_low[0] || fd == timer_thread_pipe_low[1]) { return 1; } else { return 0; } #else return 0; #endif } rb_nativethread_id_t rb_nativethread_self(void) { return pthread_self(); } #endif /* THREAD_SYSTEM_DEPENDENT_IMPLEMENTATION */
the_stack_data/32950171.c
/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison implementation for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ #define YYBISON_VERSION "3.0.4" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Push parsers. */ #define YYPUSH 0 /* Pull parsers. */ #define YYPULL 1 /* Copy the first part of user declarations. */ #line 1 "ring.y" /* yacc.c:339 */ #include<stdio.h> #include<stdlib.h> int yylex(); int yyerror(); extern FILE *yyin; extern char arr[100]; extern int i; #line 76 "ring.tab.c" /* yacc.c:339 */ # ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus # define YY_NULLPTR nullptr # else # define YY_NULLPTR 0 # endif # endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 1 #endif /* In a future release of Bison, this section will be replaced by #include "ring.tab.h". */ #ifndef YY_YY_RING_TAB_H_INCLUDED # define YY_YY_RING_TAB_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif #if YYDEBUG extern int yydebug; #endif /* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { IF = 258, ELSE = 259, ELSEIF = 260, FOR = 261, TO = 262, STEP = 263, FUNC = 264, ENDFUNC = 265, WHILE = 266, END = 267, DO = 268, AGAIN = 269, TRY = 270, CATCH = 271, SWITCH = 272, CASE = 273, OTHER = 274, PACKAGE = 275, DOT = 276, ENDPACKAGE = 277, SEE = 278, LITERAL = 279, GIVE = 280, CLASS = 281, FROM = 282, ENDCLASS = 283, LOAD = 284, IDENTIFIER = 285, OPERATOR = 286, LBR = 287, RBR = 288, COMMA = 289, LR = 290, RR = 291, EOP = 292 }; #endif /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { #line 12 "ring.y" /* yacc.c:355 */ char *str; #line 158 "ring.tab.c" /* yacc.c:355 */ }; typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif extern YYSTYPE yylval; int yyparse (void); #endif /* !YY_YY_RING_TAB_H_INCLUDED */ /* Copy the second part of user declarations. */ #line 175 "ring.tab.c" /* yacc.c:358 */ #ifdef short # undef short #endif #ifdef YYTYPE_UINT8 typedef YYTYPE_UINT8 yytype_uint8; #else typedef unsigned char yytype_uint8; #endif #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; #else typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else typedef unsigned short int yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else typedef short int yytype_int16; #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif ! defined YYSIZE_T # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned int # endif #endif #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ # define YY_(Msgid) dgettext ("bison-runtime", Msgid) # endif # endif # ifndef YY_ # define YY_(Msgid) Msgid # endif #endif #ifndef YY_ATTRIBUTE # if (defined __GNUC__ \ && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C # define YY_ATTRIBUTE(Spec) __attribute__(Spec) # else # define YY_ATTRIBUTE(Spec) /* empty */ # endif #endif #ifndef YY_ATTRIBUTE_PURE # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) #endif #ifndef YY_ATTRIBUTE_UNUSED # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) #endif #if !defined _Noreturn \ && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) # if defined _MSC_VER && 1200 <= _MSC_VER # define _Noreturn __declspec (noreturn) # else # define _Noreturn YY_ATTRIBUTE ((__noreturn__)) # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(E) ((void) (E)) #else # define YYUSE(E) /* empty */ #endif #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else # define YY_INITIAL_VALUE(Value) Value #endif #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_END #endif #ifndef YY_INITIAL_VALUE # define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include <malloc.h> /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's 'empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yytype_int16 yyss_alloc; YYSTYPE yyvs_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) # define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) #endif #if defined YYCOPY_NEEDED && YYCOPY_NEEDED /* Copy COUNT objects from SRC to DST. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(Dst, Src, Count) \ __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) # else # define YYCOPY(Dst, Src, Count) \ do \ { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ #define YYFINAL 42 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 137 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 38 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 47 /* YYNRULES -- Number of rules. */ #define YYNRULES 100 /* YYNSTATES -- Number of states. */ #define YYNSTATES 150 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 292 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM as returned by yylex, without out-of-bounds checking. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 89, 89, 92, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 109, 114, 121, 127, 134, 141, 147, 154, 157, 163, 165, 171, 179, 183, 186, 190, 193, 196, 197, 200, 203, 206, 210, 213, 216, 217, 220, 223, 226, 229, 232, 235, 238, 239, 242, 245, 246, 249, 252, 253, 256, 259, 262, 265, 266, 269, 272, 273, 276, 279, 282, 285, 286, 289, 296, 301, 304, 307, 310, 313, 316, 320, 322, 325, 326, 330, 333, 336, 339, 343, 344, 346, 349, 352, 355, 356, 359, 362, 365, 366, 369, 372, 375, 376, 379 }; #endif #if YYDEBUG || YYERROR_VERBOSE || 1 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "IF", "ELSE", "ELSEIF", "FOR", "TO", "STEP", "FUNC", "ENDFUNC", "WHILE", "END", "DO", "AGAIN", "TRY", "CATCH", "SWITCH", "CASE", "OTHER", "PACKAGE", "DOT", "ENDPACKAGE", "SEE", "LITERAL", "GIVE", "CLASS", "FROM", "ENDCLASS", "LOAD", "IDENTIFIER", "OPERATOR", "LBR", "RBR", "COMMA", "LR", "RR", "EOP", "$accept", "stmt", "program", "Statement", "if_statement", "for_loop", "while_loop", "do_again_loop", "try_catch_statement", "switch_statement", "package_statement", "see_statement", "give_statement", "class_statement", "from_colon_lt_id_prime", "lbr_stmt_rbr_d1", "stmt_prime_2", "dot_id_p", "lbr_stmt_rbr_d", "stmt_prime_1", "lbr_d1", "case_expr_statement_p", "other_STMT_d", "STMT_prime_2", "stmt_prime_5", "stmt_prime_9", "lbr_d5", "stmt_prime_10", "stmt_prime_8", "lbr_d4", "stmt_prime_7", "function_statement", "paralist_d", "lr_d", "rr_d", "lbr_stmt_rbr_d2", "stmt_prime_3", "step_expr_d", "lbr_d2", "STMT_prime_3", "lbr_d", "stmt_prime_4", "elseif_expr_stmt_p", "STMT_p", "else_STMT_d", "STMT_prime_1", "expr", YY_NULLPTR }; #endif # ifdef YYPRINT /* YYTOKNUM[NUM] -- (External) token number corresponding to the (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292 }; # endif #define YYPACT_NINF -25 #define yypact_value_is_default(Yystate) \ (!!((Yystate) == (-25))) #define YYTABLE_NINF -74 #define yytable_value_is_error(Yytable_value) \ 0 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const yytype_int8 yypact[] = { 102, -23, -23, -13, -23, -25, -25, -23, -3, -20, -19, 5, -2, 40, 18, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, 10, 53, -10, 29, -12, -9, 31, 41, 102, 102, 102, 102, 37, 35, -25, -25, -25, -25, -23, -25, 34, 38, -25, -25, -23, -2, -25, -2, -25, 55, -25, -25, -25, 42, 43, -25, -25, -25, -25, 46, 45, -25, 48, 65, -25, 70, 47, 4, 102, -25, 30, 41, -25, 60, -25, -25, 56, -2, 54, -25, -23, 51, 11, 102, 58, -2, 102, -25, -25, 17, -23, -25, 52, -25, 23, 102, 24, -25, -25, -23, 57, -25, -25, -25, -2, -25, -25, -25, 50, -25, -2, 102, -25, -25, 102, 102, -2, -25, -25, -25, -2, -25, -25, 102, -25, 102, 13, -25, -25, -25, 61, -25, -25, -25, 102, -25, 102, -25, -2, -25, -25, -25 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. Performed when YYTABLE does not specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { 0, 0, 0, 0, 0, 63, 55, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 6, 15, 88, 0, 71, 65, 0, 57, 43, 36, 0, 0, 0, 0, 29, 0, 1, 2, 87, 91, 0, 72, 77, 0, 64, 68, 0, 61, 62, 53, 56, 0, 54, 42, 45, 0, 38, 24, 23, 26, 25, 0, 31, 100, 93, 82, 80, 0, 0, 0, 0, 60, 47, 36, 41, 0, 28, 34, 0, 89, 97, 90, 0, 84, 0, 0, 0, 66, 0, 67, 19, 0, 0, 49, 0, 35, 0, 0, 0, 27, 99, 0, 0, 81, 83, 86, 78, 76, 79, 69, 75, 18, 58, 0, 59, 52, 46, 0, 39, 37, 40, 22, 32, 30, 33, 96, 95, 0, 0, 74, 70, 20, 44, 48, 21, 98, 92, 16, 0, 85, 50, 51, 94, 17 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -25, -25, -25, -24, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, 14, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -1 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 68, 84, 104, 62, 81, 102, 60, 78, 100, 122, 138, 33, 57, 97, 32, 51, 75, 26, 48, 49, 136, 73, 90, 89, 111, 134, 45, 70, 86, 142, 108, 131, 27 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule whose number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { 28, 29, 52, 31, 36, 38, 34, 12, 37, 39, 12, 12, 63, 64, 65, 66, 1, 30, 53, 2, -73, 55, 3, 56, 4, 47, 5, 35, 6, 41, 7, 54, 58, 8, 93, 40, 9, 94, 10, 11, 42, 112, 44, 12, 113, 71, 144, 118, 98, 99, 119, 76, 96, 124, 128, 43, 125, 129, 106, 107, 46, 50, 61, 59, 67, 69, 72, 115, 74, 87, 117, 77, 79, 88, 95, 80, 82, 83, 85, 127, 91, 92, 103, 110, 105, 123, 135, 109, 116, 114, 133, 146, 0, 101, 0, 137, 120, 121, 139, 140, 0, 126, 0, 130, 0, 1, 132, 141, 2, 143, 145, 3, 0, 4, 0, 5, 0, 6, 148, 7, 149, 0, 8, 0, 0, 9, 0, 10, 11, 0, 0, 0, 12, 0, 0, 0, 0, 147 }; static const yytype_int16 yycheck[] = { 1, 2, 14, 4, 24, 24, 7, 30, 9, 10, 30, 30, 36, 37, 38, 39, 3, 30, 30, 6, 30, 30, 9, 32, 11, 35, 13, 30, 15, 31, 17, 32, 33, 20, 30, 30, 23, 33, 25, 26, 0, 30, 32, 30, 33, 46, 33, 30, 18, 19, 33, 52, 76, 30, 30, 37, 33, 33, 4, 5, 7, 32, 21, 32, 27, 30, 32, 91, 30, 70, 94, 16, 30, 8, 75, 32, 30, 32, 30, 103, 10, 34, 22, 32, 28, 33, 36, 88, 30, 90, 33, 30, -1, 79, -1, 119, 97, 98, 122, 123, -1, 102, -1, 104, -1, 3, 107, 131, 6, 133, 134, 9, -1, 11, -1, 13, -1, 15, 142, 17, 144, -1, 20, -1, -1, 23, -1, 25, 26, -1, -1, -1, 30, -1, -1, -1, -1, 138 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 3, 6, 9, 11, 13, 15, 17, 20, 23, 25, 26, 30, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 69, 84, 84, 84, 30, 84, 66, 63, 84, 30, 24, 84, 24, 84, 30, 31, 0, 37, 32, 78, 7, 35, 70, 71, 32, 67, 14, 30, 84, 30, 32, 64, 84, 32, 58, 21, 55, 41, 41, 41, 41, 27, 52, 30, 79, 84, 32, 73, 30, 68, 84, 16, 59, 30, 32, 56, 30, 32, 53, 30, 80, 84, 8, 75, 74, 10, 34, 30, 33, 84, 41, 65, 18, 19, 60, 55, 57, 22, 54, 28, 4, 5, 82, 84, 32, 76, 30, 33, 84, 41, 30, 41, 30, 33, 84, 84, 61, 33, 30, 33, 84, 41, 30, 33, 84, 83, 84, 33, 77, 36, 72, 41, 62, 41, 41, 41, 81, 41, 33, 41, 30, 84, 41, 41 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { 0, 38, 39, 40, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 42, 43, 44, 45, 46, 47, 48, 49, 49, 50, 50, 51, 52, 52, 53, 53, 54, 54, 54, 55, 55, 56, 56, 57, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 62, 63, 63, 63, 64, 64, 65, 65, 65, 66, 66, 66, 67, 67, 68, 68, 68, 69, 70, 70, 71, 71, 72, 72, 73, 73, 74, 74, 74, 75, 75, 76, 76, 77, 77, 78, 78, 79, 79, 79, 80, 80, 81, 81, 82, 82, 83, 83, 84 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8, 9, 6, 5, 7, 7, 6, 3, 3, 3, 3, 5, 2, 0, 3, 0, 2, 2, 0, 3, 0, 3, 0, 2, 2, 0, 1, 0, 4, 0, 2, 0, 2, 0, 2, 2, 0, 2, 2, 0, 1, 0, 2, 2, 0, 2, 2, 0, 1, 0, 2, 2, 0, 6, 5, 0, 1, 0, 1, 0, 3, 0, 2, 2, 0, 2, 0, 1, 0, 2, 0, 1, 0, 2, 2, 0, 4, 0, 2, 0, 2, 0, 2, 0, 3 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY) \ { \ yychar = (Token); \ yylval = (Value); \ YYPOPSTACK (yylen); \ yystate = *yyssp; \ goto yybackup; \ } \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (0) /* Error token number */ #define YYTERROR 1 #define YYERRCODE 256 /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (0) /* This macro is provided for backward compatibility. */ #ifndef YY_LOCATION_PRINT # define YY_LOCATION_PRINT(File, Loc) ((void) 0) #endif # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Type, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) /*----------------------------------------. | Print this symbol's value on YYOUTPUT. | `----------------------------------------*/ static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) { FILE *yyo = yyoutput; YYUSE (yyo); if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # endif YYUSE (yytype); } /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) { YYFPRINTF (yyoutput, "%s %s (", yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep); YYFPRINTF (yyoutput, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) { int yybot = *yybottom; YYFPRINTF (stderr, " %d", yybot); } YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ static void yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) { unsigned long int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yystos[yyssp[yyi + 1 - yynrhs]], &(yyvsp[(yyi + 1) - (yynrhs)]) ); YYFPRINTF (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyssp, yyvsp, Rule); \ } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ static YYSIZE_T yystrlen (const char *yystr) { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; } # endif # endif # ifndef yystpcpy # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ static char * yystpcpy (char *yydest, const char *yysrc) { char *yyd = yydest; const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif # ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an apostrophe, a comma, or backslash (other than backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ static YYSIZE_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { YYSIZE_T yyn = 0; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; /* Fall through. */ default: if (yyres) yyres[yyn] = *yyp; yyn++; break; case '"': if (yyres) yyres[yyn] = '\0'; return yyn; } do_not_strip_quotes: ; } if (! yyres) return yystrlen (yystr); return yystpcpy (yyres, yystr) - yyres; } # endif /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message about the unexpected token YYTOKEN for the state stack whose top is YYSSP. Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is not large enough to hold the message. In that case, also set *YYMSG_ALLOC to the required number of bytes. Return 2 if the required number of bytes is too large to store. */ static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); YYSIZE_T yysize = yysize0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ const char *yyformat = YY_NULLPTR; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per "expected"). */ int yycount = 0; /* There are many possibilities here to consider: - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected tokens because there are none. - The only way there can be no lookahead present (in yychar) is if this state is a consistent state with a default action. Thus, detecting the absence of a lookahead is sufficient to determine that there is no unexpected or expected token to report. In that case, just report a simple "syntax error". - Don't assume there isn't a lookahead just because this state is a consistent state with a default action. There might have been a previous inconsistent state, consistent state with a non-default action, or user semantic action that manipulated yychar. - Of course, the expected token list depends on states to have correct lookahead information, and it depends on the parser not to perform extra reductions after fetching a lookahead from the scanner and before detecting a syntax error. Thus, state merging (from LALR or IELR) and default reductions corrupt the expected token list. However, the list is correct for canonical LR with one exception: it will still contain any token that will not be accepted due to an error action in a later state. */ if (yytoken != YYEMPTY) { int yyn = yypact[*yyssp]; yyarg[yycount++] = yytname[yytoken]; if (!yypact_value_is_default (yyn)) { /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. In other words, skip the first -YYN actions for this state because they are default actions. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn + 1; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yyx; for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR && !yytable_value_is_error (yytable[yyx + yyn])) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { yycount = 1; yysize = yysize0; break; } yyarg[yycount++] = yytname[yyx]; { YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; yysize = yysize1; } } } } switch (yycount) { # define YYCASE_(N, S) \ case N: \ yyformat = S; \ break YYCASE_(0, YY_("syntax error")); YYCASE_(1, YY_("syntax error, unexpected %s")); YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); # undef YYCASE_ } { YYSIZE_T yysize1 = yysize + yystrlen (yyformat); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; yysize = yysize1; } if (*yymsg_alloc < yysize) { *yymsg_alloc = 2 * yysize; if (! (yysize <= *yymsg_alloc && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; return 1; } /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ { char *yyp = *yymsg; int yyi = 0; while ((*yyp = *yyformat) != '\0') if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) { yyp += yytnamerr (yyp, yyarg[yyi++]); yyformat += 2; } else { yyp++; yyformat++; } } return 0; } #endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) { YYUSE (yyvaluep); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YYUSE (yytype); YY_IGNORE_MAYBE_UNINITIALIZED_END } /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /*----------. | yyparse. | `----------*/ int yyparse (void) { int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* The stacks and their tools: 'yyss': related to states. 'yyvs': related to semantic values. Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 *yyss; yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs; YYSTYPE *yyvsp; YYSIZE_T yystacksize; int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ int yytoken = 0; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; yyssp = yyss = yyssa; yyvsp = yyvs = yyvsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); if (yystate == YYFINAL) YYACCEPT; goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = yylex (); } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yytable_value_is_error (yyn)) goto yyerrlab; yyn = -yyn; goto yyreduce; } /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the shifted token. */ yychar = YYEMPTY; yystate = yyn; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 16: #line 109 "ring.y" /* yacc.c:1646 */ { printf("\nKeyword\t\t%s", (yyvsp[-7].str)); printf("\nSS\t\t%s",(yyvsp[-1].str));} #line 1369 "ring.tab.c" /* yacc.c:1646 */ break; case 17: #line 114 "ring.y" /* yacc.c:1646 */ { printf("\nKEYWORD\t\t%s", (yyvsp[-8].str)); printf("\nKEYWORD\t\t%s",(yyvsp[-6].str)); printf("\nSS\t\t%s",(yyvsp[-1].str)); } #line 1379 "ring.tab.c" /* yacc.c:1646 */ break; case 18: #line 121 "ring.y" /* yacc.c:1646 */ { printf("\nKEYWORD\t\t%s", (yyvsp[-5].str)); printf("\nSS\t\t%s",(yyvsp[-1].str)); } #line 1388 "ring.tab.c" /* yacc.c:1646 */ break; case 19: #line 127 "ring.y" /* yacc.c:1646 */ { printf("\nKEYWORD\t\t%s",(yyvsp[-4].str)); printf("\nKEYWORD %s",(yyvsp[-2].str)); } #line 1397 "ring.tab.c" /* yacc.c:1646 */ break; case 20: #line 134 "ring.y" /* yacc.c:1646 */ { printf("\nKEYWORD\t\t%s",(yyvsp[-6].str)); printf("\nKEYWORD\t\t%s",(yyvsp[-3].str)); printf("\nSS\t\t%s",(yyvsp[-1].str)); } #line 1407 "ring.tab.c" /* yacc.c:1646 */ break; case 21: #line 141 "ring.y" /* yacc.c:1646 */ { printf("\nKEYWORD\t\t%s",(yyvsp[-6].str)); printf("\nSS\t\t%s",(yyvsp[-1].str)); } #line 1416 "ring.tab.c" /* yacc.c:1646 */ break; case 22: #line 147 "ring.y" /* yacc.c:1646 */ { printf("\nKEYWORD\t\t%s",(yyvsp[-5].str)); printf("\nID\t\t%s",(yyvsp[-4].str)); printf("\nKEYWORD\t\t%s",(yyvsp[-1].str)); } #line 1426 "ring.tab.c" /* yacc.c:1646 */ break; case 23: #line 154 "ring.y" /* yacc.c:1646 */ { printf("\nKEYWORD\t\t%s",(yyvsp[-2].str)); } #line 1434 "ring.tab.c" /* yacc.c:1646 */ break; case 24: #line 157 "ring.y" /* yacc.c:1646 */ { printf("\nKEYWORD\t\t%s",(yyvsp[-2].str)); printf("\nLITERAL\t\t%s",(yyvsp[-1].str)); } #line 1443 "ring.tab.c" /* yacc.c:1646 */ break; case 25: #line 163 "ring.y" /* yacc.c:1646 */ { printf("\nKEYWORD\t\t%s",(yyvsp[-2].str));} #line 1450 "ring.tab.c" /* yacc.c:1646 */ break; case 26: #line 165 "ring.y" /* yacc.c:1646 */ { printf("\nKEYWORD\t\t%s",(yyvsp[-2].str)); printf("\nLITERAL\t\t%s",(yyvsp[-1].str)); } #line 1459 "ring.tab.c" /* yacc.c:1646 */ break; case 27: #line 171 "ring.y" /* yacc.c:1646 */ { printf("\nKEYWORD\t\t%s",(yyvsp[-4].str)); printf("\nID\t\t%s",(yyvsp[-3].str)); printf("\nKEYWORD\t\t%s",(yyvsp[0].str)); } #line 1469 "ring.tab.c" /* yacc.c:1646 */ break; case 28: #line 179 "ring.y" /* yacc.c:1646 */ { printf("\nKEYWORD\t\t%s",(yyvsp[-1].str)); printf("\nID\t\t%s",(yyvsp[0].str)); } #line 1478 "ring.tab.c" /* yacc.c:1646 */ break; case 30: #line 186 "ring.y" /* yacc.c:1646 */ { printf("\nSS\t\t%s",(yyvsp[-2].str)); printf("\nSS\t\t%s",(yyvsp[0].str)); } #line 1487 "ring.tab.c" /* yacc.c:1646 */ break; case 32: #line 193 "ring.y" /* yacc.c:1646 */ { printf("\nID\t\t%s",(yyvsp[0].str)); } #line 1495 "ring.tab.c" /* yacc.c:1646 */ break; case 35: #line 200 "ring.y" /* yacc.c:1646 */ { printf("\nID\t\t%s",(yyvsp[-2].str)); } #line 1503 "ring.tab.c" /* yacc.c:1646 */ break; case 37: #line 206 "ring.y" /* yacc.c:1646 */ { printf("\nSS\t\t%s",(yyvsp[-2].str)); printf("\nSS\t\t%s",(yyvsp[0].str)); } #line 1512 "ring.tab.c" /* yacc.c:1646 */ break; case 39: #line 213 "ring.y" /* yacc.c:1646 */ { printf("\nID\t\t%s",(yyvsp[0].str)); } #line 1520 "ring.tab.c" /* yacc.c:1646 */ break; case 42: #line 220 "ring.y" /* yacc.c:1646 */ { printf("\nSS\t\t%s",(yyvsp[0].str)); } #line 1528 "ring.tab.c" /* yacc.c:1646 */ break; case 44: #line 226 "ring.y" /* yacc.c:1646 */ { printf("\nKEYWORD\t\t%s",(yyvsp[-2].str)); } #line 1536 "ring.tab.c" /* yacc.c:1646 */ break; case 46: #line 232 "ring.y" /* yacc.c:1646 */ { printf("\nKEYWORD\t\t%s",(yyvsp[-1].str)); } #line 1544 "ring.tab.c" /* yacc.c:1646 */ break; case 50: #line 242 "ring.y" /* yacc.c:1646 */ { printf("\nID\t\t%s",(yyvsp[0].str)); } #line 1552 "ring.tab.c" /* yacc.c:1646 */ break; case 53: #line 249 "ring.y" /* yacc.c:1646 */ { printf("\nID\t\t%s",(yyvsp[0].str)); } #line 1560 "ring.tab.c" /* yacc.c:1646 */ break; case 56: #line 256 "ring.y" /* yacc.c:1646 */ { printf("\nSS\t\t%s",(yyvsp[0].str)); } #line 1568 "ring.tab.c" /* yacc.c:1646 */ break; case 58: #line 262 "ring.y" /* yacc.c:1646 */ { printf("\nID\t\t%s",(yyvsp[0].str)); } #line 1576 "ring.tab.c" /* yacc.c:1646 */ break; case 61: #line 269 "ring.y" /* yacc.c:1646 */ { printf("\nID\t\t%s",(yyvsp[0].str)); } #line 1584 "ring.tab.c" /* yacc.c:1646 */ break; case 64: #line 276 "ring.y" /* yacc.c:1646 */ { printf("\nSS\t\t%s",(yyvsp[0].str)); } #line 1592 "ring.tab.c" /* yacc.c:1646 */ break; case 66: #line 282 "ring.y" /* yacc.c:1646 */ { printf("\nID\t\t%s",(yyvsp[0].str)); } #line 1600 "ring.tab.c" /* yacc.c:1646 */ break; case 69: #line 289 "ring.y" /* yacc.c:1646 */ { printf("\nKEYWORD\t\t%s",(yyvsp[-5].str)); printf("\nID\t\t%s",(yyvsp[-4].str)); printf("\nKEYWORD\t\t%s",(yyvsp[-1].str)); } #line 1610 "ring.tab.c" /* yacc.c:1646 */ break; case 70: #line 296 "ring.y" /* yacc.c:1646 */ { printf("\nID\t\t%s",(yyvsp[-3].str)); printf("\nSS\t\t%s",(yyvsp[-2].str)); printf("\nID\t\t%s",(yyvsp[-1].str)); } #line 1620 "ring.tab.c" /* yacc.c:1646 */ break; case 72: #line 304 "ring.y" /* yacc.c:1646 */ { printf("\nSS\t\t%s",(yyvsp[0].str)); } #line 1628 "ring.tab.c" /* yacc.c:1646 */ break; case 74: #line 310 "ring.y" /* yacc.c:1646 */ { printf("\nSS\t\t%s",(yyvsp[0].str)); } #line 1636 "ring.tab.c" /* yacc.c:1646 */ break; case 76: #line 316 "ring.y" /* yacc.c:1646 */ { printf("\nSS\t\t%s",(yyvsp[-2].str)); printf("\nSS\t\t%s",(yyvsp[0].str)); } #line 1645 "ring.tab.c" /* yacc.c:1646 */ break; case 78: #line 322 "ring.y" /* yacc.c:1646 */ { printf("\nID\t\t%s",(yyvsp[0].str)); } #line 1653 "ring.tab.c" /* yacc.c:1646 */ break; case 81: #line 330 "ring.y" /* yacc.c:1646 */ { printf("\nKEYWORD\t\t%s",(yyvsp[-1].str)); } #line 1661 "ring.tab.c" /* yacc.c:1646 */ break; case 83: #line 336 "ring.y" /* yacc.c:1646 */ { printf("\nSS\t\t%s",(yyvsp[0].str)); } #line 1669 "ring.tab.c" /* yacc.c:1646 */ break; case 87: #line 346 "ring.y" /* yacc.c:1646 */ { printf("\nSS\t\t%s",(yyvsp[0].str)); } #line 1677 "ring.tab.c" /* yacc.c:1646 */ break; case 89: #line 352 "ring.y" /* yacc.c:1646 */ { printf("\nID\t\t%s",(yyvsp[0].str)); } #line 1685 "ring.tab.c" /* yacc.c:1646 */ break; case 92: #line 359 "ring.y" /* yacc.c:1646 */ { printf("\nKEYWORD\t\t%s",(yyvsp[-2].str)); } #line 1693 "ring.tab.c" /* yacc.c:1646 */ break; case 96: #line 369 "ring.y" /* yacc.c:1646 */ { printf("\nKEYWORD\t\t%s",(yyvsp[-1].str)); } #line 1701 "ring.tab.c" /* yacc.c:1646 */ break; case 100: #line 379 "ring.y" /* yacc.c:1646 */ { printf("\nID\t\t%s",(yyvsp[-2].str)); printf("\nOP\t\t%s",(yyvsp[-1].str)); printf("\nID\t\t%s",(yyvsp[0].str)); } #line 1711 "ring.tab.c" /* yacc.c:1646 */ break; #line 1715 "ring.tab.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires that yytoken be updated with the new translation. We take the approach of translating immediately before every use of yytoken. One alternative is translating here after every semantic action, but that translation would be missed if the semantic action invokes YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an incorrect destructor might then be invoked immediately. In the case of YYERROR or YYBACKUP, subsequent parser actions might lead to an incorrect destructor call or verbose syntax error message before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*--------------------------------------. | yyerrlab -- here on detecting error. | `--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ yyssp, yytoken) { char const *yymsgp = YY_("syntax error"); int yysyntax_error_status; yysyntax_error_status = YYSYNTAX_ERROR; if (yysyntax_error_status == 0) yymsgp = yymsg; else if (yysyntax_error_status == 1) { if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); if (!yymsg) { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; yysyntax_error_status = 2; } else { yysyntax_error_status = YYSYNTAX_ERROR; yymsgp = yymsg; } } yyerror (yymsgp); if (yysyntax_error_status == 2) goto yyexhaustedlab; } # undef YYSYNTAX_ERROR #endif } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers like GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (/*CONSTCOND*/ 0) goto yyerrorlab; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yydestruct ("Error: popping", yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #if !defined yyoverflow || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: if (yychar != YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = YYTRANSLATE (yychar); yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); } /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif #if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif return yyresult; } #line 385 "ring.y" /* yacc.c:1906 */ void main() { char filename[15]; printf("Enter filename: "); scanf("%s",filename); yyin=fopen(filename,"r"); printf("\nType\t\tToken"); do { if(yyparse()) { printf("\nFailure:\n"); exit(0); } }while(!feof(yyin)); printf("\nSuccess\n"); }
the_stack_data/190769192.c
/* *************************************************************************** * Ralink Tech Inc. * 4F, No. 2 Technology 5th Rd. * Science-based Industrial Park * Hsin-chu, Taiwan, R.O.C. * * (c) Copyright 2002-2004, Ralink Technology, Inc. * * All rights reserved. Ralink's source code is an unpublished work and the * use of a copyright notice does not imply otherwise. This source code * contains confidential trade secret material of Ralink Tech. Any attemp * or participation in deciphering, decoding, reverse engineering or in any * way altering the source code is stricitly prohibited, unless the prior * written consent of Ralink Technology, Inc. is obtained. *************************************************************************** Module Name: Abstract: Revision History: Who When What -------- ---------- ---------------------------------------------- */ #ifdef RLT_RF #include "rt_config.h" static inline BOOLEAN rf_csr_poll_idle(RTMP_ADAPTER *pAd, UINT32 *rfcsr) { RF_CSR_CFG_STRUC *csr_val; BOOLEAN idle = BUSY; INT i = 0; do { if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)) break; RTMP_IO_READ32(pAd, RF_CSR_CFG, rfcsr); csr_val = (RF_CSR_CFG_STRUC *)rfcsr; #ifdef RT6352 if (IS_RT6352(pAd)) idle = csr_val->bank_6352.RF_CSR_KICK; else #endif /* RT6352 */ #ifdef RT65xx if (IS_RT65XX(pAd)) idle = csr_val->bank_65xx.RF_CSR_KICK; else #endif /* RT65xx */ idle = csr_val->non_bank.RF_CSR_KICK; if (idle == IDLE) break; i++; } while (i < MAX_BUSY_COUNT); if ((i == MAX_BUSY_COUNT) || (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST))) { DBGPRINT_RAW(RT_DEBUG_ERROR, ("Retry count exhausted or device removed(cnt=%d)!\n", i)); } return idle; } NDIS_STATUS rlt_rf_write( IN PRTMP_ADAPTER pAd, IN UCHAR bank, IN UCHAR regID, IN UCHAR value) { RF_CSR_CFG_STRUC rfcsr = { { 0 } }; NDIS_STATUS ret; #ifdef RTMP_MAC_PCI if ((pAd->bPCIclkOff == TRUE) || (pAd->LastMCUCmd == SLEEP_MCU_CMD)) { DBGPRINT_ERR(("rlt_rf_write. Not allow to write RF 0x%x : fail\n", regID)); return STATUS_UNSUCCESSFUL; } #endif /* RTMP_MAC_PCI */ #ifdef RLT_MAC // TODO: shiang-usw, why we need to check this for MT7601?? Get these code from MT7601! if (pAd->chipCap.hif_type == HIF_RLT) { if (pAd->WlanFunCtrl.field.WLAN_EN == 0) { DBGPRINT_ERR(("rlt_rf_write. Not allow to write RF 0x%x : fail\n", regID)); return STATUS_UNSUCCESSFUL; } } #endif /* RLT_MAC */ ASSERT((regID <= pAd->chipCap.MaxNumOfRfId)); ret = STATUS_UNSUCCESSFUL; if (rf_csr_poll_idle(pAd, &rfcsr.word) != IDLE) goto done; #ifdef RT6352 if (IS_RT6352(pAd)) { rfcsr.bank_6352.RF_CSR_WR = 1; rfcsr.bank_6352.RF_CSR_KICK = 1; rfcsr.bank_6352.TESTCSR_RFACC_REGNUM = (regID | (bank << 6)); rfcsr.bank_6352.RF_CSR_DATA = value; } else #endif /* RT6352 */ #ifdef RT65xx if (IS_RT65XX(pAd)) { rfcsr.bank_65xx.RF_CSR_WR = 1; rfcsr.bank_65xx.RF_CSR_KICK = 1; rfcsr.bank_65xx.RF_CSR_REG_BANK = bank; rfcsr.bank_65xx.RF_CSR_REG_ID = regID; rfcsr.bank_65xx.RF_CSR_DATA = value; } else #endif /* RT65xx */ { DBGPRINT_ERR(("%s():RF write with wrong handler!\n", __FUNCTION__)); goto done; } RTMP_IO_WRITE32(pAd, RF_CSR_CFG, rfcsr.word); ret = NDIS_STATUS_SUCCESS; done: return ret; } /* ======================================================================== Routine Description: Read RF register through MAC Arguments: Return Value: IRQL = Note: ======================================================================== */ NDIS_STATUS rlt_rf_read( IN RTMP_ADAPTER *pAd, IN UCHAR bank, IN UCHAR regID, IN UCHAR *pValue) { RF_CSR_CFG_STRUC rfcsr = { { 0 } }; UINT i=0, k=0; BOOLEAN rf_status; NDIS_STATUS ret = STATUS_UNSUCCESSFUL; #ifdef RTMP_MAC_PCI if ((pAd->bPCIclkOff == TRUE) || (pAd->LastMCUCmd == SLEEP_MCU_CMD)) { DBGPRINT_ERR(("RT30xxReadRFRegister. Not allow to read RF 0x%x : fail\n", regID)); return STATUS_UNSUCCESSFUL; } #endif /* RTMP_MAC_PCI */ ASSERT((regID <= pAd->chipCap.MaxNumOfRfId)); rfcsr.word = 0; for (i=0; i<MAX_BUSY_COUNT; i++) { if(RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)) goto done; rf_status = rf_csr_poll_idle(pAd, &rfcsr.word); if ( rf_status == BUSY) break; rfcsr.word = 0; #ifdef RT6352 if (IS_RT6352(pAd)) { rfcsr.bank_6352.RF_CSR_WR = 0; rfcsr.bank_6352.RF_CSR_KICK = 1; rfcsr.bank_6352.TESTCSR_RFACC_REGNUM = (regID | (bank << 6)); } else #endif /* RT6352 */ #ifdef RT65xx if (IS_RT65XX(pAd)) { rfcsr.bank_65xx.RF_CSR_WR = 0; rfcsr.bank_65xx.RF_CSR_KICK = 1; rfcsr.bank_65xx.RF_CSR_REG_ID = regID; rfcsr.bank_65xx.RF_CSR_REG_BANK = bank; } else #endif /* RT65xx */ { DBGPRINT_ERR(("RF[%d] read function for non-supported chip[0x%x]\n", regID, pAd->MACVersion)); break; } RTMP_IO_WRITE32(pAd, RF_CSR_CFG, rfcsr.word); rf_status = rf_csr_poll_idle(pAd, &rfcsr.word); if (rf_status == IDLE) { #ifdef RT6352 if (IS_RT6352(pAd) && ((rfcsr.bank_6352.TESTCSR_RFACC_REGNUM & 0x3F) == regID)) { *pValue = (UCHAR)(rfcsr.bank_6352.RF_CSR_DATA); break; } #endif /* RT6352 */ #ifdef RT65xx if (IS_RT65XX(pAd) && (rfcsr.bank_65xx.RF_CSR_REG_ID == regID) && (rfcsr.bank_65xx.RF_CSR_REG_BANK == bank)) { *pValue = (UCHAR)(rfcsr.bank_65xx.RF_CSR_DATA); break; } #endif /* RT65xx */ } } if (rf_status == BUSY) { DBGPRINT_ERR(("RF read R%d=0x%X fail, i[%d], k[%d]\n", regID, rfcsr.word,i,k)); goto done; } ret = STATUS_SUCCESS; done: return ret; } #endif /* RLT_RF */
the_stack_data/127646.c
/** ****************************************************************************** * @file stm32l0xx_hal_cryp_ex.c * @author MCD Application Team * @brief CRYPEx HAL module driver. * * This file provides firmware functions to manage the following * functionalities of the Cryptography (CRYP) extension peripheral: * + Computation completed callback. * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright(c) 2016 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 (STM32L021xx) || defined (STM32L041xx) || defined (STM32L062xx) || defined (STM32L063xx) || defined (STM32L081xx) || defined (STM32L082xx) || defined (STM32L083xx) /* Includes ------------------------------------------------------------------*/ #include "stm32l0xx_hal.h" /** @addtogroup STM32L0xx_HAL_Driver * @{ */ #ifdef HAL_CRYP_MODULE_ENABLED /** @addtogroup CRYPEx * @brief CRYP HAL Extended module driver. * @{ */ /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ /** @addtogroup CRYPEx_Exported_Functions * @{ */ /** @addtogroup CRYPEx_Exported_Functions_Group1 * @brief Extended features functions. * @verbatim =============================================================================== ##### Extended features functions ##### =============================================================================== [..] This section provides callback functions: (+) Computation completed. @endverbatim * @{ */ /** * @brief Computation completed callbacks. * @param hcryp pointer to a CRYP_HandleTypeDef structure that contains * the configuration information for CRYP module * @retval None */ __weak void HAL_CRYPEx_ComputationCpltCallback(CRYP_HandleTypeDef *hcryp) { /* Prevent unused argument(s) compilation warning */ UNUSED(hcryp); /* NOTE : This function Should not be modified, when the callback is needed, the HAL_CRYP_ComputationCpltCallback could be implemented in the user file */ } /** * @} */ /** * @} */ /** * @} */ #endif /* HAL_CRYP_MODULE_ENABLED */ /** * @} */ #endif /* STM32L021xx || STM32L041xx || STM32L062xx || STM32L063xx || STM32L081xx || STM32L082xx || STM32L083xx */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
the_stack_data/148579291.c
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ____ ___ __ _ // / __// o |,'_/ .' \ // / _/ / _,'/ /_n / o / _ __ _ ___ _ _ __ // /_/ /_/ |__,'/_n_/ / \,' /.' \ ,' _/,' \ / |/ / // / \,' // o /_\ `./ o // || / // /_/ /_//_n_//___,'|_,'/_/|_/ // //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Author : Wesley Taylor-Rendal (WTR) // Design history : Review git logs. // Description : Function clockKeeper, time roll over to day roll over // Concepts : // : //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #include <stdio.h> #include <stdbool.h> // ----------------------------------- // Global Variables // -------------------------------fold struct sTime { int hour; int minutes; int seconds; }; struct sDate { int day; int month; int year; }; struct sDateAndTime { struct sDate s_date; struct sTime s_time; }; bool gMidnightFlag; // -------------------------------fold // ----------------------------------- // Updating the Time // -------------------------------fold struct sTime timeUpdate (struct sTime now) { // reset on each call gMidnightFlag = false; ++now.seconds; // check second limit if (now.seconds == 60) { now.seconds = 0; ++now.minutes; if (now.minutes == 60) { now.minutes = 0; ++now.hour; if (now.hour == 24) { now.hour = 0; //midnight gMidnightFlag = true; } } } return now; } // -------------------------------fold // ----------------------------------- // Updating the Date if it is required // -------------------------------fold struct sDate dateUpdate (struct sDate today) { struct sDate tomorrow; int numberOfDays (struct sDate d); // check day limit in month if (today.day != numberOfDays(today)) { tomorrow.day = today.day + 1; tomorrow.month = today.month; tomorrow.year = today.year; } // check end of year else if (today.month == 12) { tomorrow.day = 1; tomorrow.month = 1; tomorrow.year = today.year+1; } // Assume its just a month iteration. else { tomorrow.day = 1; tomorrow.month = today.month+1; tomorrow.year = today.year; } return tomorrow; } int numberOfDays (struct sDate d) // why struct date had to be globally declared. { int days; bool isLeapYear (struct sDate d); const int daysPerMonth[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; if (isLeapYear (d) == true && d.month == 2) days = 29; else days = daysPerMonth[d.month]; return days; } bool isLeapYear(struct sDate d) { bool leapYearFlag; if ( (d.year % 4 == 0 && d.year % 100 != 0) || (d.year % 400 == 0) ) leapYearFlag = true; else leapYearFlag = false; return leapYearFlag; } // -------------------------------fold // ----------------------------------- // Clockkeeper for date and time // -------------------------------fold struct sDateAndTime clockKeeper(struct sDateAndTime dt) { struct sDate dateUpdate (struct sDate today); struct sTime timeUpdate (struct sTime now); dt.s_time = timeUpdate(dt.s_time); if (gMidnightFlag) // Alternatively I could check dt.s_time = 0,0,0 dt.s_date = dateUpdate(dt.s_date); return dt; } // -------------------------------fold // ----------------------------------- // Main // -------------------------------fold int main(void) { struct sDateAndTime clockKeeper(struct sDateAndTime dt); //Testcase - Second Tickover const struct sDateAndTime testdata1 = (struct sDateAndTime) {.s_date={7,11,2001}, .s_time={22,58,58}}; //Testcase - Minute Tickover const struct sDateAndTime testdata2 = (struct sDateAndTime) {.s_date={9,2,2004}, .s_time={22,58,59}}; //Testcase - Hour Tickover const struct sDateAndTime testdata3 = (struct sDateAndTime) {.s_date={9,8,1997}, .s_time={22,59,59}}; //Testcase - Day Tickover const struct sDateAndTime testdata4 = (struct sDateAndTime) {.s_date={21,11,2001}, .s_time={23,59,59}}; //Testcase - Month Tickover const struct sDateAndTime testdata5 = (struct sDateAndTime) {.s_date={30,9,2001}, .s_time={23,59,59}}; //Testcase - Year Tickover const struct sDateAndTime testdata6 = (struct sDateAndTime) {.s_date={31,12,2001}, .s_time={23,59,59}}; //Testcase - Leap year Tickover const struct sDateAndTime testdata7 = (struct sDateAndTime) {.s_date={28,2,2004}, .s_time={23,59,59}}; //Testcase - Non Leap year Tickover const struct sDateAndTime testdata8 = (struct sDateAndTime) {.s_date={28,2,2001}, .s_time={23,59,59}}; struct sDateAndTime edit1; printf("----------Second Tickover-----------------------------------------------------------------------\n"); printf("----------Original--------------------------------------------------Updated---------------------\n"); printf("Date = %.2d/%.2d/%.2d, Time = %.2d:%.2d:%.2d", testdata1.s_date.day, testdata1.s_date.month, testdata1.s_date.year, testdata1.s_time.hour, testdata1.s_time.minutes, testdata1.s_time.seconds); printf("\t\t"); edit1 = clockKeeper(testdata1); printf("Date = %.2d/%.2d/%.2d, Time = %.2d:%.2d:%.2d", edit1.s_date.day, edit1.s_date.month, edit1.s_date.year, edit1.s_time.hour, edit1.s_time.minutes, edit1.s_time.seconds); printf("\n"); printf("----------Minute Tickover-----------------------------------------------------------------------\n"); printf("----------Original--------------------------------------------------Updated---------------------\n"); printf("Date = %.2d/%.2d/%.2d, Time = %.2d:%.2d:%.2d", testdata2.s_date.day, testdata2.s_date.month, testdata2.s_date.year, testdata2.s_time.hour, testdata2.s_time.minutes, testdata2.s_time.seconds); printf("\t\t"); edit1 = clockKeeper(testdata2); printf("Date = %.2d/%.2d/%.2d, Time = %.2d:%.2d:%.2d", edit1.s_date.day, edit1.s_date.month, edit1.s_date.year, edit1.s_time.hour, edit1.s_time.minutes, edit1.s_time.seconds); printf("\n"); printf("----------Hour Tickover-------------------------------------------------------------------------\n"); printf("----------Original--------------------------------------------------Updated---------------------\n"); printf("Date = %.2d/%.2d/%.2d, Time = %.2d:%.2d:%.2d", testdata3.s_date.day, testdata3.s_date.month, testdata3.s_date.year, testdata3.s_time.hour, testdata3.s_time.minutes, testdata3.s_time.seconds); printf("\t\t"); edit1 = clockKeeper(testdata3); printf("Date = %.2d/%.2d/%.2d, Time = %.2d:%.2d:%.2d", edit1.s_date.day, edit1.s_date.month, edit1.s_date.year, edit1.s_time.hour, edit1.s_time.minutes, edit1.s_time.seconds); printf("\n"); printf("----------Day Tickover--------------------------------------------------------------------------\n"); printf("----------Original--------------------------------------------------Updated---------------------\n"); printf("Date = %.2d/%.2d/%.2d, Time = %.2d:%.2d:%.2d", testdata4.s_date.day, testdata4.s_date.month, testdata4.s_date.year, testdata4.s_time.hour, testdata4.s_time.minutes, testdata4.s_time.seconds); printf("\t\t"); edit1 = clockKeeper(testdata4); printf("Date = %.2d/%.2d/%.2d, Time = %.2d:%.2d:%.2d", edit1.s_date.day, edit1.s_date.month, edit1.s_date.year, edit1.s_time.hour, edit1.s_time.minutes, edit1.s_time.seconds); printf("\n"); printf("----------Month Tickover------------------------------------------------------------------------\n"); printf("----------Original--------------------------------------------------Updated---------------------\n"); printf("Date = %.2d/%.2d/%.2d, Time = %.2d:%.2d:%.2d", testdata5.s_date.day, testdata5.s_date.month, testdata5.s_date.year, testdata5.s_time.hour, testdata5.s_time.minutes, testdata5.s_time.seconds); printf("\t\t"); edit1 = clockKeeper(testdata5); printf("Date = %.2d/%.2d/%.2d, Time = %.2d:%.2d:%.2d", edit1.s_date.day, edit1.s_date.month, edit1.s_date.year, edit1.s_time.hour, edit1.s_time.minutes, edit1.s_time.seconds); printf("\n"); printf("----------Year Tickover-------------------------------------------------------------------------\n"); printf("----------Original--------------------------------------------------Updated---------------------\n"); printf("Date = %.2d/%.2d/%.2d, Time = %.2d:%.2d:%.2d", testdata6.s_date.day, testdata6.s_date.month, testdata6.s_date.year, testdata6.s_time.hour, testdata6.s_time.minutes, testdata6.s_time.seconds); printf("\t\t"); edit1 = clockKeeper(testdata6); printf("Date = %.2d/%.2d/%.2d, Time = %.2d:%.2d:%.2d", edit1.s_date.day, edit1.s_date.month, edit1.s_date.year, edit1.s_time.hour, edit1.s_time.minutes, edit1.s_time.seconds); printf("\n"); printf("----------Leap Year Tickover--------------------------------------------------------------------\n"); printf("----------Original--------------------------------------------------Updated---------------------\n"); printf("Date = %.2d/%.2d/%.2d, Time = %.2d:%.2d:%.2d", testdata7.s_date.day, testdata7.s_date.month, testdata7.s_date.year, testdata7.s_time.hour, testdata7.s_time.minutes, testdata7.s_time.seconds); printf("\t\t"); edit1 = clockKeeper(testdata7); printf("Date = %.2d/%.2d/%.2d, Time = %.2d:%.2d:%.2d", edit1.s_date.day, edit1.s_date.month, edit1.s_date.year, edit1.s_time.hour, edit1.s_time.minutes, edit1.s_time.seconds); printf("\n"); printf("----------Non Leap Year Feb Tickover------------------------------------------------------------\n"); printf("----------Original--------------------------------------------------Updated---------------------\n"); printf("Date = %.2d/%.2d/%.2d, Time = %.2d:%.2d:%.2d", testdata8.s_date.day, testdata8.s_date.month, testdata8.s_date.year, testdata8.s_time.hour, testdata8.s_time.minutes, testdata8.s_time.seconds); printf("\t\t"); edit1 = clockKeeper(testdata8); printf("Date = %.2d/%.2d/%.2d, Time = %.2d:%.2d:%.2d", edit1.s_date.day, edit1.s_date.month, edit1.s_date.year, edit1.s_time.hour, edit1.s_time.minutes, edit1.s_time.seconds); printf("\n"); return 0; }
the_stack_data/100100.c
#include <string.h> int main () { char str[] = "This is a sample string"; char * pch; pch=strrchr(str,'s'); assert((pch-str+1) == 18); return 0; }
the_stack_data/975863.c
/* Test step/next in presence of #line directives. Copyright (C) 2001-2019 Free Software Foundation, Inc. This file is part of GDB. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ void dummy (int, int); int f1 (int); int f2 (int); int main (int argc, char **argv) { int i; i = f1 (4); i = f1 (i); dummy (0, i); return 0; } int f1 (int i) { #line 40 "step-line.c" dummy (1, i); #line 24 "step-line.inp" i = f2 (i); #line 44 "step-line.c" dummy (2, i); #line 25 "step-line.inp" i = f2 (i); #line 48 "step-line.c" dummy (3, i); #line 26 "step-line.inp" return i; #line 52 "step-line.c" } int f2 (int i) { #line 31 "step-line.inp" int j; #line 60 "step-line.c" dummy (4, i); #line 32 "step-line.inp" j = i; #line 64 "step-line.c" dummy (5, i); dummy (6, j); #line 33 "step-line.inp" j = j + 1; #line 69 "step-line.c" dummy (7, i); dummy (8, j); #line 34 "step-line.inp" j = j - i; #line 74 "step-line.c" dummy (9, i); dummy (10, j); #line 35 "step-line.inp" return i; #line 79 "step-line.c" } void dummy (int num, int i) { }
the_stack_data/641887.c
// Copyright 2022 PingCAP, Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #define _GNU_SOURCE #include <sched.h> int __sched_cpucount(size_t size, const cpu_set_t *set) { size_t i, j, cnt=0; const unsigned char *p = (const void *)set; for (i=0; i<size; i++) for (j=0; j<8; j++) if (p[i] & (1<<j)) cnt++; return cnt; }
the_stack_data/234517591.c
/* Copyright (c) 2017, Alexey Frunze 2-clause BSD license. */ #ifdef __SMALLER_C_32__ #include <stdlib.h> double strtod(char* nptr, char** endptr) { return strtof(nptr, endptr); } #endif
the_stack_data/100141646.c
/* { dg-do compile } */ /* { dg-options "-O2 -fcheck-pointer-bounds -mmpx" } */ union jsval_layout { void *asPtr; }; union jsval_layout a; union jsval_layout b; union jsval_layout __inline__ fn1() { return b; } void fn2() { a = fn1(); }
the_stack_data/101288.c
// this source is derived from CHILL AST originally from file '/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/polybench/polybench-code/stencils/heat-3d/kernel.c' as parsed by frontend compiler rose void kernel_heat_3d(int tsteps, int n, double A[200 + 0][200 + 0][200 + 0], double B[200 + 0][200 + 0][200 + 0]) { int t12; int t10; int t8; int t6; int t4; int t2; for (t2 = 1; t2 <= 1000; t2 += 1) { #pragma omp parallel for private(t4,t6,t8,t10,t12) for (t4 = 1; t4 <= n - 2; t4 += 8) for (t6 = 1; t6 <= n - 2; t6 += 8) for (t8 = t4; t8 <= (t4 + 7 < n - 2 ? t4 + 7 : n - 2); t8 += 1) for (t10 = t6; t10 <= (t6 + 7 < n - 2 ? t6 + 7 : n - 2); t10 += 1) for (t12 = 1; t12 <= n - 2; t12 += 1) B[t8][t10][t12] = 0.125 * (A[t8 + 1][t10][t12] - 2 * A[t8][t10][t12] + A[t8 - 1][t10][t12]) + 0.125 * (A[t8][t10 + 1][t12] - 2 * A[t8][t10][t12] + A[t8][t10 - 1][t12]) + 0.125 * (A[t8][t10][t12 + 1] - 2 * A[t8][t10][t12] + A[t8][t10][t12 - 1]) + A[t8][t10][t12]; #pragma omp parallel for private(t4,t6,t8,t10,t12) for (t4 = 1; t4 <= n - 2; t4 += 8) for (t6 = 1; t6 <= n - 2; t6 += 8) for (t8 = t4; t8 <= (t4 + 7 < n - 2 ? t4 + 7 : n - 2); t8 += 1) for (t10 = t6; t10 <= (t6 + 7 < n - 2 ? t6 + 7 : n - 2); t10 += 1) for (t12 = 1; t12 <= n - 2; t12 += 1) A[t8][t10][t12] = 0.125 * (B[t8 + 1][t10][t12] - 2 * B[t8][t10][t12] + B[t8 - 1][t10][t12]) + 0.125 * (B[t8][t10 + 1][t12] - 2 * B[t8][t10][t12] + B[t8][t10 - 1][t12]) + 0.125 * (B[t8][t10][t12 + 1] - 2 * B[t8][t10][t12] + B[t8][t10][t12 - 1]) + B[t8][t10][t12]; } }
the_stack_data/148578119.c
// program to generate all permutation of the given string #include <stdio.h> #include <string.h> #include <stdlib.h> //declare permutation and swap functions void permutation(char *,int,int); void swap(char *,char *); int main() { char *s; // dynamically creating string length s=(char*)malloc(sizeof(char)*1000); printf("Enter a string "); // getting string gets(s); // changing size to the length of string+1 to store null at end s=realloc(s,strlen(s)+1); //calling permutation printf("The Permutation of string are: \n"); permutation(s,0,strlen(s)-1); return 0; } void permutation(char *str,int s,int e) { //declare variables static int count; int i; //base condition if(s==e) { count++; //Printing the string permutation's printf("%d(%s)\n",count,str); } else { for(i=s;i<=e;i++) { //swapping variables value swap(str+s,str+i); //calling permutation function permutation(str,s+1,e); //now swap the variables value and make it before one swap(str+s,str+i); } } } //swap function void swap(char *a,char *b) { char temp; //putting value in temp temp=*a; // putting value in a pointer *a=*b; //now putting value of temp in b pointer *b=temp; //swapping done } /*Example: Input: Enter a string abc Output: The Permutation of string are: 1(abc) 2(acb) 3(bac) 4(bca) 5(cba) 6(cab) Time Complexity: O(n*n!) Space Complexity: O(n*n!) */
the_stack_data/232956220.c
#include <sched.h> int sched_yield(void) { return 0; } /* POSIX(199309) LINK(rt) */
the_stack_data/92325624.c
struct module; struct lock_class_key; struct class_interface; struct class; extern struct class *__class_create(struct module *owner, const char *name, struct lock_class_key *key); extern int class_interface_register(struct class_interface *); extern void class_interface_unregister(struct class_interface *); extern void class_destroy(struct class *cls); const int ERR_PTR = 2012; long is_err(const void *ptr) { return ((unsigned long)ptr > ERR_PTR); } void *err_ptr(long error) { return (void *)(ERR_PTR - error); } long ptr_err(const void *ptr) { return (long)(ERR_PTR - (unsigned long)ptr); } long is_err_or_null(const void *ptr) { return !ptr || is_err((unsigned long)ptr); } void ldv_check_final_state(void); void main(void) { struct module *cur_module; struct class *cur_class; struct lock_class_key *key; struct class_interface *interface; int is_registered = 0; cur_class = __class_create(cur_module, "test", key); // check for ERR_PTR if (is_err(cur_class)) { return; } class_destroy(cur_class); // no checks - it is fine cur_class = __class_create(cur_module, "test", key); class_destroy(cur_class); cur_class = __class_create(cur_module, "test", key); if (cur_class == ((struct class *)0)) { // unreached class_interface_unregister(interface); class_interface_unregister(interface); } else if (is_err(cur_class)) { // ERR_PTR class_destroy(cur_class); } else { // success class_interface_unregister(interface); } is_registered = class_interface_register(interface); if (is_registered == 0) { // success class_interface_unregister(interface); } else if (is_registered < 0) { // error code } else { // positive - unreached class_interface_unregister(interface); class_interface_unregister(interface); } ldv_check_final_state(); }
the_stack_data/26646.c
//LABA 3-0-heap //by Dimonchik0036 #define _CRT_SECURE_NO_WARNINGS #include <stdlib.h> #include <stdio.h> //Меняет ячейки в массиве void swap(int *arr, int i, int j); //Начинка сортировки void shiftDown(int *arr, int i, int j); //Пирамидальная сортировка void heapSort(int *arr, int arrSize); int main() { int n; //Количество чисел в массиве scanf("%d", &n); //Массив из n чисел int *numberArray; numberArray = (int*)malloc(n * sizeof(*numberArray)); if (numberArray == NULL) { printf("not memory"); return 0; } int i; //Переменная для цикла for (i = 0; i < n; i++) { scanf("%d", &numberArray[i]); //Ввод данных в массив } //Сортировка heapSort(numberArray, n); //Вывод массива for (i = 0; i < n; i++) { printf("%d ", numberArray[i]); } return 0; } void swap(int *arr, int i, int j) { int keys = arr[i]; arr[i] = arr[j]; arr[j] = keys; } void shiftDown(int *arr, int i, int j) { int left = 2 * i + 1; int right = left + 1; int maximum = left; while (maximum < j) { if (right < j) { if (arr[left] < arr[right]) { maximum = right; } } if (arr[i] < arr[maximum]) { swap(arr, i, maximum); } else { break; } i = maximum; left = 2 * i + 1; right = left + 1; maximum = left; } } void heapSort(int *arr, int arrSize) { int i; int len = arrSize; for (i = len / 2 - 1; i >= 0; i--) { shiftDown(arr, i, len); } for (i = len - 1; i > 0; i--) { swap(arr, 0, i); shiftDown(arr, 0, i); } }
the_stack_data/248581139.c
// Compile with debug info: // gcc -g -o valgrind_memory_leak valgrind_memory_leak.c // Test with valgrind: // valgrind --leak-check=full ./valgrind_memory_leak #include <stdlib.h> #include <stdio.h> #include <string.h> void leak() { void *ptr = malloc(100); } int main() { printf("#Let's leak 100 bytes"); leak(); printf("#100 bytes leaked"); return 0; }
the_stack_data/25137554.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. */ #include <stdio.h> #include <stdlib.h> /* Arrays passed as function parameters */ void foo1(double o1[], double c[], int len) { int i; long long int AI1[6]; AI1[0] = len + -1; AI1[1] = 8 * AI1[0]; AI1[2] = AI1[1] + 8; AI1[3] = AI1[2] / 8; AI1[4] = (AI1[3] > 0); AI1[5] = (AI1[4] ? AI1[3] : 0); char RST_AI1 = 0; RST_AI1 |= !(((void*) (c + 0) > (void*) (o1 + AI1[5])) || ((void*) (o1 + 0) > (void*) (c + AI1[5]))); #pragma omp target data map(to: c[0:AI1[5]]) map(tofrom: o1[0:AI1[5]]) if(!RST_AI1) { #pragma omp target parallel for for (i = 0; i < len; ++i) { double volnew_o8 = 0.5 * c[i]; o1[i] = volnew_o8; } } } double o1[100]; double c[100]; int main() { int i; int len = 100; char RST_AI1 = 0; RST_AI1 |= !(((void*) (c + 0) > (void*) (o1 + 100)) || ((void*) (o1 + 0) > (void*) (c + 100))); #pragma omp target data map(tofrom: c[0:100],o1[0:100]) if(!RST_AI1) { #pragma omp target parallel for for (i = 0; i < len; ++i) { c[i] = i + 1.01; o1[i] = i + 1.01; } } foo1(o1, c, 100); for (i = 0; i < len; ++i) { printf("%lf\n", o1[i]); } return 0; }
the_stack_data/173577395.c
/* $OpenBSD: dirname.c,v 1.15 2013/09/30 12:02:33 millert Exp $ */ /* * Copyright (c) 1997, 2004 Todd C. Miller <[email protected]> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include <errno.h> #include <limits.h> #include <string.h> /* A slightly modified copy of this file exists in libexec/ld.so */ char * dirname(const char *path) { static char dname[PATH_MAX]; size_t len; const char *endp; /* Empty or NULL string gets treated as "." */ if (path == NULL || *path == '\0') { dname[0] = '.'; dname[1] = '\0'; return (dname); } /* Strip any trailing slashes */ endp = path + strlen(path) - 1; while (endp > path && *endp == '/') endp--; /* Find the start of the dir */ while (endp > path && *endp != '/') endp--; /* Either the dir is "/" or there are no slashes */ if (endp == path) { dname[0] = *endp == '/' ? '/' : '.'; dname[1] = '\0'; return (dname); } else { /* Move forward past the separating slashes */ do { endp--; } while (endp > path && *endp == '/'); } len = endp - path + 1; if (len >= sizeof(dname)) { errno = ENAMETOOLONG; return (NULL); } memcpy(dname, path, len); dname[len] = '\0'; return (dname); }
the_stack_data/31386734.c
#include <stdio.h> int partition(int x[],int lb,int ub){ int up,down,pivot,temp; pivot=x[lb]; up=ub; down=lb; while(down<up) { while(x[down]<=pivot && down<ub){ down++; } while(x[up]>pivot){ up--; } if(down<up) { temp=x[down]; x[down]=x[up]; x[up]=temp; } } x[lb]=x[up]; x[up]=pivot; return up; } void quicksort(int arr[], int lb, int ub){ int j; if (lb>=ub) return; j = partition(arr,lb,ub); quicksort(arr,lb,j-1); quicksort(arr,j+1,ub); } int main() { int n,i,v,arr[100]; printf("enter the total no of elements: "); scanf("%d",&n); printf("enter the values: \n"); for(i=0;i<n;i++){ scanf("%d",&arr[i]); } quicksort(arr,0,n-1); printf("Order of Sorted elements using quick sort:\n "); for(i=0;i<n;i++) printf(" %d",arr[i]); return 0; }
the_stack_data/108739.c
#include<stdio.h> struct STACK{ int top; int A[100000]; int size; }; int STACK_EMPTY(struct STACK *S){ if((S->top)<=-1){ return -1; } return 1; } int STACK_FULL(struct STACK *S){ if((S->top)>=(S->size - 1)){ return 1; } return 0; } void PUSH(struct STACK *S,int k){ if( !STACK_FULL(S) ){ S->top++; S->A[S->top]=k; } } int POP(struct STACK *S ){ if(STACK_EMPTY(S)==-1){ return -1; } S->top--; int popped = S->A[(S->top)+1]; return popped; } int main(){ char ch; // stack creation struct STACK S; S.top=-1; int k,n,del; int is_empty;// if the stack is empty // read size of stack scanf("%d",&n); S.size=n; do{ // menu //read a character scanf("%c",&ch); switch(ch){ case 'i': scanf("%d",&k); // the val to be inserted PUSH(&S,k); break; case 'd': del=POP(&S); // deleted element printf("%d\n",del); break; case 'e': is_empty=STACK_EMPTY(&S); printf("%d\n",is_empty); break; } }while(ch!='t'); return 0; }
the_stack_data/1219201.c
/* Struct memeory and manipulation demo program. * Author: Chris Kearns * Date: 23 Aug 2016 */ #include <stdio.h> #include<stdlib.h> #include<math.h> struct myStruct { int var_1; int var_2; }; struct myStruct* allocMem() { struct myStruct *ptr = (struct myStruct *)malloc(sizeof(struct myStruct) * 3); return ptr; } void fillStructs(struct myStruct* aStruct) { aStruct->var_1 = 1; aStruct->var_2 = 11; (aStruct + 1)->var_1 = 2; (aStruct + 1)->var_2 = 22; (aStruct + 2)->var_1 = 3; (aStruct + 2)->var_2 = 33; } void printStruct(struct myStruct* aStruct) { int i; for (i = 0; i < 3; i++) { printf("%i %i\n", (aStruct + i)->var_1, (aStruct + i)->var_2); } } int main() { struct myStruct* theStruct = NULL; theStruct = allocMem(); fillStructs(theStruct); printStruct(theStruct); return 0; }
the_stack_data/287496.c
/* Generated by CIL v. 1.3.6 */ /* print_CIL_Input is true */ void error(void) { assert(0); return; } int m_pc = 0; int t1_pc = 0; int m_st ; int t1_st ; int m_i ; int t1_i ; int M_E = 2; int T1_E = 2; int E_M = 2; int E_1 = 2; int is_master_triggered(void) ; int is_transmit1_triggered(void) ; void immediate_notify(void) ; int token ; int local ; void master(void) { int tmp_var ; { if (m_pc == 0) { goto M_ENTRY; } else { if (m_pc == 1) { goto M_WAIT; } else { } } M_ENTRY: ; { int i=0, loop1 = __VERIFIER_nondet_int(); while (i<loop1) { while_0_continue: /* CIL Label */ ; { token = __VERIFIER_nondet_int(); local = token; E_1 = 1; immediate_notify(); E_1 = 2; m_pc = 1; m_st = 2; } goto return_label; M_WAIT: ; if (token != local + 1) { { error(); } } else { if(tmp_var <= 5){ if(tmp_var >= 5){ } } if(tmp_var <= 5){ if(tmp_var >= 5){ if(tmp_var == 5){ error(); } } } } i++; } while_0_break: /* CIL Label */ ; } return_label: /* CIL Label */ return; } } void transmit1(void) { { if (t1_pc == 0) { goto T1_ENTRY; } else { if (t1_pc == 1) { goto T1_WAIT; } else { } } T1_ENTRY: ; { int i=0, loop2 = __VERIFIER_nondet_int(); while (i<loop2) { while_1_continue: /* CIL Label */ ; t1_pc = 1; t1_st = 2; goto return_label; T1_WAIT: { token += 1; E_M = 1; immediate_notify(); E_M = 2; } i++; } while_1_break: /* CIL Label */ ; } return_label: /* CIL Label */ return; } } int is_master_triggered(void) { int __retres1 ; { if (m_pc == 1) { if (E_M == 1) { __retres1 = 1; goto return_label; } else { } } else { } __retres1 = 0; return_label: /* CIL Label */ return (__retres1); } } int is_transmit1_triggered(void) { int __retres1 ; { if (t1_pc == 1) { if (E_1 == 1) { __retres1 = 1; goto return_label; } else { } } else { } __retres1 = 0; return_label: /* CIL Label */ return (__retres1); } } void update_channels(void) { { return; } } void init_threads(void) { { if (m_i == 1) { m_st = 0; } else { m_st = 2; } if (t1_i == 1) { t1_st = 0; } else { t1_st = 2; } return; } } int exists_runnable_thread(void) { int __retres1 ; { if (m_st == 0) { __retres1 = 1; goto return_label; } else { if (t1_st == 0) { __retres1 = 1; goto return_label; } else { } } __retres1 = 0; return_label: /* CIL Label */ return (__retres1); } } void eval(void) { int tmp ; { { int i=0, loop3 = __VERIFIER_nondet_int(); while (i<loop3) { while_2_continue: /* CIL Label */ ; { tmp = exists_runnable_thread(); } if (tmp) { } else { goto while_2_break; } if (m_st == 0) { int tmp_ndt_1; tmp_ndt_1 = __VERIFIER_nondet_int(); if (tmp_ndt_1) { { m_st = 1; master(); } } else { } } else { } if (t1_st == 0) { int tmp_ndt_2; tmp_ndt_2 = __VERIFIER_nondet_int(); if (tmp_ndt_2) { { t1_st = 1; transmit1(); } } else { } } else { } i++; } while_2_break: /* CIL Label */ ; } return; } } void fire_delta_events(void) { { if (M_E == 0) { M_E = 1; } else { } if (T1_E == 0) { T1_E = 1; } else { } if (E_M == 0) { E_M = 1; } else { } if (E_1 == 0) { E_1 = 1; } else { } return; } } void reset_delta_events(void) { { if (M_E == 1) { M_E = 2; } else { } if (T1_E == 1) { T1_E = 2; } else { } if (E_M == 1) { E_M = 2; } else { } if (E_1 == 1) { E_1 = 2; } else { } return; } } void activate_threads(void) { int tmp ; int tmp___0 ; { { tmp = is_master_triggered(); } if (tmp) { m_st = 0; } else { } { tmp___0 = is_transmit1_triggered(); } if (tmp___0) { t1_st = 0; } else { } return; } } void immediate_notify(void) { { { activate_threads(); } return; } } void fire_time_events(void) { { M_E = 1; return; } } void reset_time_events(void) { { if (M_E == 1) { M_E = 2; } else { } if (T1_E == 1) { T1_E = 2; } else { } if (E_M == 1) { E_M = 2; } else { } if (E_1 == 1) { E_1 = 2; } else { } return; } } void init_model(void) { { m_i = 1; t1_i = 1; return; } } int stop_simulation(void) { int tmp ; int __retres2 ; { { tmp = exists_runnable_thread(); } if (tmp) { __retres2 = 0; goto return_label; } else { } __retres2 = 1; return_label: /* CIL Label */ return (__retres2); } } void start_simulation(void) { int kernel_st ; int tmp ; int tmp___0 ; { { kernel_st = 0; update_channels(); init_threads(); fire_delta_events(); activate_threads(); reset_delta_events(); } { int i=0, loop4 = __VERIFIER_nondet_int(); while (i<loop4) { while_3_continue: /* CIL Label */ ; { kernel_st = 1; eval(); } { kernel_st = 2; update_channels(); } { kernel_st = 3; fire_delta_events(); activate_threads(); reset_delta_events(); } { tmp = exists_runnable_thread(); } if (tmp == 0) { { kernel_st = 4; fire_time_events(); activate_threads(); reset_time_events(); } } else { } { tmp___0 = stop_simulation(); } if (tmp___0) { goto while_3_break; } else { } i++; } while_3_break: /* CIL Label */ ; } return; } } int main(void) { int __retres1 ; { { init_model(); start_simulation(); } __retres1 = 0; return (__retres1); } }
the_stack_data/1059053.c
/* BEGIN_ICS_COPYRIGHT5 **************************************** Copyright (c) 2015, Intel Corporation Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ** END_ICS_COPYRIGHT5 ****************************************/ extern void test_compare_swap_1 (void); int main (void) { test_compare_swap_1 (); return 0; }
the_stack_data/170453925.c
/* * io-exit.c -- * * Copyright (c) 2006 CodeSourcery Inc * * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this * notice is included verbatim in any distributions. No written agreement, * license, or royalty fee is required for any of the authorized uses. * Modifications to this software may be copyrighted by their authors * and need not follow the licensing terms described here, provided that * the new terms are clearly indicated on the first page of each file where * they apply. */ #if HOSTED #include "io.h" /* * _exit -- Exit from the application. */ void __attribute__ ((noreturn)) _exit (int code) { while (1) __hosted (HOSTED_EXIT, (void *)code); } #endif
the_stack_data/77986.c
/* 3.4 Häufigkeitsberechnung mit Pointerarithmetik (17%) Author: Juergen Zangerl */ #include <stdio.h> int main(int argc, char **argv) { int i, n; int str_length, counter; int mystring[51]; if (argc > 1) { //da leerzeichen als mehrere Parameter zählen, werden die einzelnen Parameter zu einer Zeichenkette zusammengebaut str_length = 0; for(int i=1; i < argc; i++) { n=0; if(i>1) { mystring[str_length] = ' '; str_length++; } while( *(argv[i]+n) != '\0' ) { mystring[str_length] = *(argv[i]+n); n++; str_length++; } } //bubblesort der Zeichenkette char var_dump; for(n=0; n < str_length-1; n++){ for(i=0; i < str_length-1-n; i++) { if ( *(mystring+i) > *(mystring+i+1)) { var_dump = *(mystring+i); *(mystring+i) = *(mystring+i+1); *(mystring+i+1) = var_dump; } } } i = 0; while(i < str_length){ counter = 1; // iteriert bis ans ende und überprüft, ob zählt gleiche zeichen in der variable counter for(n = 1; n < str_length-i; n++){ if(*(mystring+i) == *(mystring+i+n)) counter++; } printf("\n> Zeichen: '%c' - Haeufigkeit: %d",mystring[i],counter); i = i + counter; } } else { printf("\nFehler! Es wurde keine Zeichenkette für die Häufigkeitsberechnung als Kommandozeilenparameter übergeben.\n"); return 1; } printf("\n"); return 0; }
the_stack_data/220456969.c
#include <stdio.h> int main() { int a = 6; printf("sizeof(long double)=%ld\n", sizeof(long double)); printf("sizeof(double)=%ld\n", sizeof(double)); printf("sizeof(int)=%ld\n", sizeof(int)); printf("sizeof(a)=%ld\n", sizeof(a)); printf("sizeof(a++)=%ld\n", sizeof(a++)); // 整数和double计算会的结果是double printf("sizeof(a+1.0)=%ld\n", sizeof(a + 1.0)); // sizeof 是静态运算符,在括号里面做的运算都不生效 printf("a=%ld\n", a); return 0; }
the_stack_data/23575300.c
#include <stdio.h> #define array_size 15 int main(void) { char c; printf("Enter phone number: "); char counter=0; char array[array_size]; for(unsigned char i=0;i<array_size;array[i++]=0); while (((c = toupper(getchar())) != '\n') && (counter<array_size)) { switch (c) { case 'A': case 'B': case 'C': array[counter++]='2'; break; case 'D': case 'E': case 'F': array[counter++]='3'; break; case 'G': case 'H': case 'I': array[counter++]='4'; break; case 'J': case 'K': case 'L': array[counter++]='5'; break; case 'M': case 'N': case 'O': array[counter++]='6'; break; case 'P': case 'R': case 'S': array[counter++]='7'; break; case 'T': case 'U': case 'V': array[counter++]='8'; break; case 'W': case 'X': case 'Y': array[counter++]='9'; break; default: array[counter++]=c; break; } } printf("In numeric form: "); for(unsigned char i=0;i<array_size;i++) printf("%c",array[i]); printf("\n"); return 0; }