file
stringlengths
18
26
data
stringlengths
3
1.04M
the_stack_data/192331271.c
#include <stdio.h> int main() { printf("Hello World \n"); return 0; }
the_stack_data/89200065.c
// array library -------------------------------------------------------------- // - rlyeh, public domain #pragma once #ifdef __cplusplus #define array_cast(x) (decltype(x)) #else #define array_cast(x) (void *) #endif #define array(t) t* #define array_init(t) ( (t) = 0 ) #define array_resize(t, n) ( array_c_ = array_count(t), array_realloc_((t),(n)), ((n)>array_c_? memset(array_c_+(t),0,((n)-array_c_)*sizeof(0[t])) : (void*)0), (t) ) #define array_push(t, ...) ( array_realloc_((t),array_count(t)+1), (t)[ array_count(t) - 1 ] = (__VA_ARGS__) ) #define array_pop(t) ( array_realloc_((t), array_count(t)-1) ) #define array_back(t) ( (t)[ array_count(t)-1 ] ) // ( (t) ? &(t)[ array_count(t)-1 ] : NULL ) #define array_data(t) (t) #define array_at(t,i) (t[i]) #define array_count(t) (int)( (t) ? array_vlen_(t) / sizeof(0[t]) : 0u ) #define array_bytes(t) (int)( (t) ? array_vlen_(t) : 0u ) #define array_sort(t, cmpfunc) qsort( t, array_count(t), sizeof(0[t]), cmpfunc ) #define array_empty(t) ( !array_count(t) ) #define array_free(t) array_clear(t) static __thread unsigned array_c_; #if 0 // original: no reserve support #define array_reserve(t, n) ((void)0) // not implemented #define array_clear(t) ( array_realloc_((t), 0), (t) = 0 ) #define array_vlen_(t) ( vlen(t) - 0 ) #define array_realloc_(t,n) ( (t) = array_cast(t) vrealloc((t), ((n)+0) * sizeof(0[t])) ) #else // new: with reserve support (buggy still?) #define array_reserve(t, n) ( array_realloc_((t),(n)), array_realloc_((t),0) ) #define array_clear(t) ( array_realloc_((t), -1), (t) = 0 ) // -1 #define array_vlen_(t) ( vlen(t) - sizeof(0[t]) ) // -1 #define array_realloc_(t,n) ( (t) = array_cast(t) vrealloc((t), ((n)+1) * sizeof(0[t])) ) // +1 #endif #define array_reverse(t) \ do if( array_count(t) ) { \ for(int l = array_count(t), e = l-1, i = (array_push(t, 0[t]), 0); i <= e/2; ++i ) \ { l[t] = i[t]; i[t] = (e-i)[t]; (e-i)[t] = l[t]; } \ array_pop(t); \ } while(0) //#define array_foreach2(t,val_t,v) \ // for( val_t *v = &0[t]; v < (&0[t] + array_count(t)); ++v ) //#define array_foreach(t, it) \ // for( void *end__ = (it = &0[t]) + array_count(t); it != end__; ++it ) #define array_foreach(t,val_t,v) \ for( val_t *it__ = &0[t]; it__ < (&0[t] + array_count(t)); ++it__ ) \ for( val_t v = *it__, *on__ = &v; on__; on__ = 0 ) #define array_search(t, key, cmpfn) /* requires sorted array beforehand */ \ bsearch(&key, t, array_count(t), sizeof(t[0]), cmpfn ) #define array_insert(t, i, n) do { \ int ac = array_count(t); \ if( i >= ac ) { \ array_push(t, n); \ } else { \ array_push(t, array_back(t)); \ memmove( &(t)[(i)+1], &(t)[i], (ac - (i)) * sizeof(t[0]) ); \ (t)[ i ] = (n); \ } \ } while(0) #define array_copy(t, src) do { /*todo: review old vrealloc call!*/ \ array_free(t); \ (t) = vrealloc( (t), array_count(src) * sizeof(0[t])); \ memcpy( (t), src, array_count(src) * sizeof(0[t])); \ } while(0) #define array_erase(t, i) do { \ memcpy( &(t)[i], &(t)[array_count(t) - 1], sizeof(0[t])); \ array_pop(t); \ } while(0) #define array_unique(t, cmpfunc) do { /*todo: review old vrealloc call!*/ \ int cnt = array_count(t), dupes = 0; \ if( cnt > 1 ) { \ const void *prev = &(t)[0]; \ array_sort(t, cmpfunc); \ for( int i = 1; i < cnt; ) { \ if( cmpfunc(&t[i], prev) == 0 ) { \ memmove( &t[i], &t[i+1], (cnt - 1 - i) * sizeof(t[0]) ) ; \ --cnt; \ ++dupes; \ } else { \ prev = &(t)[i]; \ ++i; \ } \ } \ if( dupes ) { \ (t) = vrealloc((t), (array_count(t) - dupes) * sizeof(0[t])); \ } \ } \ } while(0)
the_stack_data/32568.c
main() { struct { int a; int b;} c = { 2,4}; c.b=5; printf("%d",c.a+c.b); }
the_stack_data/34513113.c
/* SPDX-FileCopyrightText: 1998-2020 Daniel Stenberg, <[email protected]>, et al */ /* SPDX-License-Identifier: MIT */ // clang-format off /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2020, Daniel Stenberg, <[email protected]>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* Originally from: * https://github.com/curl/curl/blob/master/lib/curl_ctype.c * * Commit: * https://github.com/curl/curl/commit/ac0a88fd2552524955233198de96cc66f6b15a07 * * Date: * June 21, 2021 * * Changes: * - Renamed Curl_* to be nl_* * - Replaced FALSE with 0. */ #undef _U #define _U (1 << 0) /* upper case */ #undef _L #define _L (1 << 1) /* lower case */ #undef _N #define _N (1 << 2) /* decimal numerical digit */ #undef _S #define _S (1 << 3) /* space */ #undef _P #define _P (1 << 4) /* punctuation */ #undef _C #define _C (1 << 5) /* control */ #undef _X #define _X (1 << 6) /* hexadecimal letter */ #undef _B #define _B (1 << 7) /* blank */ // clang-format off static const unsigned char ascii[128] = { _C, _C, _C, _C, _C, _C, _C, _C, _C, _C|_S, _C|_S, _C|_S, _C|_S, _C|_S, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C, _S|_B, _P, _P, _P, _P, _P, _P, _P, _P, _P, _P, _P, _P, _P, _P, _P, _N, _N, _N, _N, _N, _N, _N, _N, _N, _N, _P, _P, _P, _P, _P, _P, _P, _U|_X, _U|_X, _U|_X, _U|_X, _U|_X, _U|_X, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _U, _P, _P, _P, _P, _P, _P, _L|_X, _L|_X, _L|_X, _L|_X, _L|_X, _L|_X, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _P, _P, _P, _P, _C }; // clang-format on int nl_isspace(int c) { if ((c < 0) || (c >= 0x80)) return 0; return (ascii[c] & _S); } int nl_isdigit(int c) { if ((c < 0) || (c >= 0x80)) return 0; return (ascii[c] & _N); } int nl_isalnum(int c) { if ((c < 0) || (c >= 0x80)) return 0; return (ascii[c] & (_N | _U | _L)); } int nl_isxdigit(int c) { if ((c < 0) || (c >= 0x80)) return 0; return (ascii[c] & (_N | _X)); } int nl_isgraph(int c) { if ((c < 0) || (c >= 0x80) || (c == ' ')) return 0; return (ascii[c] & (_N | _X | _U | _L | _P | _S)); } int nl_isprint(int c) { if ((c < 0) || (c >= 0x80)) return 0; return (ascii[c] & (_N | _X | _U | _L | _P | _S)); } int nl_isalpha(int c) { if ((c < 0) || (c >= 0x80)) return 0; return (ascii[c] & (_U | _L)); } int nl_isupper(int c) { if ((c < 0) || (c >= 0x80)) return 0; return (ascii[c] & (_U)); } int nl_islower(int c) { if ((c < 0) || (c >= 0x80)) return 0; return (ascii[c] & (_L)); } int nl_iscntrl(int c) { if ((c < 0) || (c >= 0x80)) return 0; return (ascii[c] & (_C)); } // clang-format on
the_stack_data/1183108.c
/* pe13-3.c -- file copy to upper */ #include <stdio.h> #include <stdlib.h> #include <ctype.h> int main(int argc, char *argv[]) { FILE *in, *out; char ch; char in_file[80]; char out_file[80]; printf("Input in file and out file: "); scanf("%s %s", in_file, out_file); if ((in = fopen(in_file, "r")) == NULL) { fprintf(stderr, "Can't open %s\n", in_file); exit(1); } if ((out = fopen(out_file, "w")) == NULL) { fprintf(stderr, "Can't open %s\n", out_file); exit(1); } while ((ch = getc(in)) != EOF) { putc(toupper(ch), out); } fclose(in); fclose(out); return 0; }
the_stack_data/153913.c
struct Input { int v1, v2, v3, v4, v5; }; struct Output { int x; }; void outsource(struct Input *input, struct Output *output) { output->x = (((input->v1 && input->v2) || input->v3) && input->v4) || input->v5; }
the_stack_data/193892926.c
#include <stdio.h> int a, b, u, v, n, i, j, ne = 1; int visited[10] = {0}, min, mincost = 0, cost[10][10]; int main() { printf("\n Enter the number of nodes:"); scanf("%d", &n); printf("\n Enter the adjacency matrix:\n"); for (i = 1; i <= n; i++) for (j = 1; j <= n; j++) { scanf("%d", &cost[i][j]); if (cost[i][j] == 0) cost[i][j] = 999; } visited[1] = 1; printf("\n"); while (ne < n) { for (i = 1, min = 999; i <= n; i++) for (j = 1; j <= n; j++) if (cost[i][j] < min) if (visited[i] != 0) { min = cost[i][j]; a = u = i; b = v = j; } if (visited[u] == 0 || visited[v] == 0) { printf("\n Edge %d:(%d %d) cost:%d", ne++, a, b, min); mincost += min; visited[b] = 1; } cost[a][b] = cost[b][a] = 999; } printf("\n Minimun cost=%d", mincost); return 0; } //TO DO: TO Understand this concept.
the_stack_data/808743.c
/* ******************************************************************************* * Copyright (c) 2020-2021, STMicroelectronics * All rights reserved. * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ******************************************************************************* */ #if defined(ARDUINO_GENERIC_G071R6TX) || defined(ARDUINO_GENERIC_G071R8TX) ||\ defined(ARDUINO_GENERIC_G071RBIX) || defined(ARDUINO_GENERIC_G071RBTX) ||\ defined(ARDUINO_GENERIC_G081RBIX) || defined(ARDUINO_GENERIC_G081RBTX) #include "pins_arduino.h" /** * @brief System Clock Configuration * @param None * @retval None */ WEAK void SystemClock_Config(void) { RCC_OscInitTypeDef RCC_OscInitStruct = {}; RCC_ClkInitTypeDef RCC_ClkInitStruct = {}; /** Configure the main internal regulator output voltage */ HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1); /** Initializes the RCC Oscillators according to the specified parameters * in the RCC_OscInitTypeDef structure. */ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; RCC_OscInitStruct.HSIState = RCC_HSI_ON; RCC_OscInitStruct.HSIDiv = RCC_HSI_DIV1; RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI; RCC_OscInitStruct.PLL.PLLM = RCC_PLLM_DIV1; RCC_OscInitStruct.PLL.PLLN = 8; RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV2; RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV2; if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { Error_Handler(); } /** Initializes the CPU, AHB and APB buses clocks */ RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_PCLK1; RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) { Error_Handler(); } } #endif /* ARDUINO_GENERIC_* */
the_stack_data/75137569.c
#include <stdio.h> int f(int a, int b){ if((a + b) % 2 == 0){ return a + b; } return a + b + 1; } int main(){ int a, b, x; scanf("%d %d %d", &a, &b, &x); printf("%d", f(x, f(a, b))); return 0; }
the_stack_data/845714.c
#include<stdio.h> void inicializa(int *nums, int T) { int i = 0; while (i < T) { nums[i] = 0; i++; } } void ordena(int *nums, int T) { int aux = 0, i = 0, j = 0; for (i = 0; i < 10; i++) { for (j = i+1 ; j < 10; j++) { if(nums[i] > nums[j]) { aux = nums[i]; nums[i] = nums[j]; nums[j] = aux; } } } } int main(void) { int i = 0, nums[10]; inicializa(nums, 10); while(i < 10) { printf("Digite um numero: "); scanf("%d", &nums[i]); i++; } ordena(nums, 10); printf("\n"); printf("O maior numero que voce digitou foi: %d \n", nums[9]); printf("O segundo maior numero que voce digitou foi: %d", nums[8]); printf("\n"); return 0; }
the_stack_data/18887536.c
/* Exercise 1 - Calculations Write a C program to input marks of two subjects. Calculate and print the average of the two marks. */ #include <stdio.h> //program addition //function main begins program execution int main() { float mark1, mark2, average; //Defining variables printf("Enter marks of first subject : "); //prompt scanf("%f", &mark1); //reading marks printf("Enter marks of second subject : "); //prompt scanf("%f", &mark2); //reading marks average = (mark1 + mark2) / 2.0 ; //calculating the average printf("The average of the marks is %.3f", average); //displaying average return 0; } //end of main program
the_stack_data/125141029.c
#include<stdio.h> #include<stdlib.h> #include<immintrin.h> #include<math.h> #define MAX 32 // Compile: gcc -O3 -mavx -o evalPoly evalPoly.c // pow function in C: x to the power y is given by function pow(double x, double y); double evaluate(double x, double *coefficients) { int degree; double *terms = (double *)_mm_malloc( MAX * sizeof(double), 32); for(degree = 0; degree < MAX; degree++) { double powerOfX = pow(x, degree); // evaluate each term terms[degree] = coefficients[degree] * powerOfX; } double answer = 0; // sum all the terms for(degree = 0; degree < MAX; degree++) { answer = answer + terms[degree]; } _mm_free(terms); return answer; } // Lab work: Implement using Intel Intrinsic functions double evaluateSIMD(double x, double *coefficients) { double answer = 0; return answer; } // initialize the coefficients with different values void initialize(double *coeffArr, int length) { int i; for( i = 0; i<length; i++) { coeffArr[i] = i+1; } } int main() { double x = 0.99999; size_t N_pd = (MAX * 8)/sizeof(double); double *coefficients = (double*)_mm_malloc(N_pd*sizeof(double), 32); initialize(coefficients, MAX); double answer = evaluate(x, coefficients); printf("#coefficients %lu Answer is %f \n", N_pd, answer); _mm_free(coefficients); return 0; }
the_stack_data/58279.c
/* Bitwise cyclic tag interpreter in c. Coded by Coates, 9-10th July 2016. Currently, the program is very inefficient as it takes an entire byte to store either a '1' or a '0'. */ #include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct bct { char val; // '1' or '0' struct bct* r; // Next part of string (on the right) struct bct* l; // Last part of string (on the left) } bct; bct* newbct(char val, bct* left, bct* right) { bct* b = malloc(sizeof(bct)); if(b == NULL) fprintf(stderr, "[!]: Allocating data string member failed!\n"); b -> val = val; b -> r = right; b -> l = left; if(b -> l != NULL) b -> l -> r = b; if(b -> r != NULL) b -> r -> l = b; return b; } void delbct(bct* b) { bct* r = b -> r; bct* l = b -> l; if(r != NULL && l != NULL) { // If deleted part was in the middle of others r -> l = l; l -> r = r; } else if(r != NULL && l == NULL) { // If it was the first one r -> l = NULL; } else if(r == NULL && l != NULL) { // If it was the last l -> r = NULL; } else {} // Do we need to do anything? free(b); } bct* leftbct(bct* b) { bct* e; for(e = b; e -> l != NULL; e = e -> l); // Move e to the leftmost one return e; } bct* rightbct(bct* b) { bct* e; for(e = b; e -> r != NULL; e = e -> r); return e; } int countbct(bct* b) { int i; bct* e; for(e = leftbct(b), i = 0; e -> r != NULL; e = e -> r, i++); i++; return i; } void dumpbct(bct* b, int spc) { // BCT element in the queue, number of spaces bct* t; int i; for(i = 0; i < spc; i++) { // Pad it out with spaces printf(" "); } for(t = leftbct(b); t != NULL; t = t -> r) { printf("%c", t -> val); } printf("\n"); } int isValid(char* s) { /* int i; for(i = 0; i <= strlen(s); i++) if(s[i] != '0' || s[i] != '1' || s[i] != '\0' || s[i] != '\n') return 0; // False need to redo this */ return 1; } #define BLOCKSZ 256 int main(int argc, char** argv) { int c, i, sz = BLOCKSZ; // c is an int so that it can pick up on EOF char* p, ra = 0; // Program memory, is root assigned? bct* r, *l, *t; // Root, last and temp bcts printf("Welcome to the C implementation of a BCT interpreter!\n"); printf("Enter the initial data string:\t"); /* This loop gets the initial state of the data string * * it definitely works. Note that we don't store the * * input in any array as it is immediately turned into * * the data string instead. */ while((c = getc(stdin)) != '\n' && c != '\0' && c != '\r' && c != EOF) { if(c == '1' || c == '0') { // Only adds correct characters if(!ra) { // If we have not yet made the root r = newbct(c, NULL, NULL); t = l = r; // Set up root ra = 1; } else { // We have already made root. Do this stuff now. t = newbct(c, l, NULL); // t is a pointer to the current bct (on the right) l = l -> r; } } } if(ra == 0) { printf("No initial data string entered. Setting the root value to one.\n"); r = newbct(c, NULL, NULL); t = l = r; ra = 1; } printf("Enter the program:\t"); i = 0; p = malloc(sizeof(char) * sz); // Initial allocation of program /* This loop gets the program from standard input. */ while((c = getc(stdin)) != '\n' && c != '\0' && c != '\r' && c != EOF) { if(i >= sz) { sz += BLOCKSZ; // If we have exceeded the buffer length, increase it. p = realloc(p, sz); } if(c == '1' || c == '0') { p[i] = c; // If it is an accepted character, add it. i++; } } p[i] = '\0'; // Run the program char done = 0; // Done variable. Set to 1 (true) when we are done i = 0; // Reset i so that it can be reused int len = strlen(p), spc = 0; // Optimises this so we don't have to keep computing strlen. Spaces variable allows for nice formatting. if(len == 0) { done = 1; printf("No input program!\n"); } if(!isValid(p)) { fprintf(stderr, "[!!]: Incorrect program input! Exiting NOW!\n"); done = 1; exit(-1); } while(!done) { dumpbct(leftbct(r), spc); //printf("Count is %d.\n", countbct(r)); if(countbct(r) == 0) { printf("No data left. Exiting...\n"); done = 1; break; // Don't carry on with the loop } switch(p[i % len]) { // Mod makes the program cyclic case '\0': // This shouldn't occur i = -1; break; case '0': spc++; // Increase spaces (we have deleted one of the values, but we still want the rest to line up). r = rightbct(r); delbct(leftbct(r)); if(r == NULL) done = 1; break; // Could do with checking this case '1': i++; if(leftbct(r) -> val == '1') r = newbct(p[i % len], rightbct(r), NULL); // Do I need to assign the newbct? Really? break; default: // Should there be an error message? fprintf(stderr, "Incorrect symbol '%c' at character number %d.\n", p[i%len], i%len); break; } i++; } free(p); if(r != NULL) { r = leftbct(r); // Move r furthest left while(r -> r != NULL) { delbct(rightbct(r)); // Delete bcts to the right of r } delbct(r); } printf("Done.\n"); return 0; }
the_stack_data/678785.c
// RUN: %clang -no-canonical-prefixes -target amd64-pc-dragonfly %s -### 2> %t.log // RUN: FileCheck -input-file %t.log %s // CHECK: clang{{.*}}" "-cc1" "-triple" "amd64-pc-dragonfly" // CHECK: ld{{.*}}" "-dynamic-linker" "{{.*}}ld-elf.{{.*}}" "-o" "a.out" "{{.*}}crt1.o" "{{.*}}crti.o" "{{.*}}crtbegin.o" "{{.*}}.o" "-L{{.*}}/gcc{{.*}}" {{.*}} "-lc" "-lgcc" "{{.*}}crtend.o" "{{.*}}crtn.o"
the_stack_data/76700745.c
/* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License, Version 1.0 only * (the "License"). You may not use this file except in compliance * with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright 1997 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ /* * University Copyright- Copyright (c) 1982, 1986, 1988 * The Regents of the University of California * All Rights Reserved * * University Acknowledgment- Portions of this document are derived from * software developed by the University of California, Berkeley, and its * contributors. */ #pragma ident "%Z%%M% %I% %E% SMI" /*LINTLIBRARY*/ /* * getpagesize(3C) - returns logical pagesize */ #include <sys/types.h> #include <unistd.h> int getpagesize(void) { return ((int) sysconf(_SC_PAGESIZE)); }
the_stack_data/151440.c
/* ** 2015-08-12 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** ** This SQLite extension implements JSON functions. The interface is ** modeled after MySQL JSON functions: ** ** https://dev.mysql.com/doc/refman/5.7/en/json.html ** ** For the time being, all JSON is stored as pure text. (We might add ** a JSONB type in the future which stores a binary encoding of JSON in ** a BLOB, but there is no support for JSONB in the current implementation. ** This implementation parses JSON text at 250 MB/s, so it is hard to see ** how JSONB might improve on that.) */ #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_JSON1) #if !defined(SQLITEINT_H) #include "sqlite3ext.h" #endif SQLITE_EXTENSION_INIT1 #include <assert.h> #include <string.h> #include <stdlib.h> #include <stdarg.h> /* Mark a function parameter as unused, to suppress nuisance compiler ** warnings. */ #ifndef UNUSED_PARAM # define UNUSED_PARAM(X) (void)(X) #endif #ifndef LARGEST_INT64 # define LARGEST_INT64 (0xffffffff|(((sqlite3_int64)0x7fffffff)<<32)) # define SMALLEST_INT64 (((sqlite3_int64)-1) - LARGEST_INT64) #endif /* ** Versions of isspace(), isalnum() and isdigit() to which it is safe ** to pass signed char values. */ #ifdef sqlite3Isdigit /* Use the SQLite core versions if this routine is part of the ** SQLite amalgamation */ # define safe_isdigit(x) sqlite3Isdigit(x) # define safe_isalnum(x) sqlite3Isalnum(x) # define safe_isxdigit(x) sqlite3Isxdigit(x) #else /* Use the standard library for separate compilation */ #include <ctype.h> /* amalgamator: keep */ # define safe_isdigit(x) isdigit((unsigned char)(x)) # define safe_isalnum(x) isalnum((unsigned char)(x)) # define safe_isxdigit(x) isxdigit((unsigned char)(x)) #endif /* ** Growing our own isspace() routine this way is twice as fast as ** the library isspace() function, resulting in a 7% overall performance ** increase for the parser. (Ubuntu14.10 gcc 4.8.4 x64 with -Os). */ static const char jsonIsSpace[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; #define safe_isspace(x) (jsonIsSpace[(unsigned char)x]) #ifndef SQLITE_AMALGAMATION /* Unsigned integer types. These are already defined in the sqliteInt.h, ** but the definitions need to be repeated for separate compilation. */ typedef sqlite3_uint64 u64; typedef unsigned int u32; typedef unsigned short int u16; typedef unsigned char u8; #endif /* Objects */ typedef struct JsonString JsonString; typedef struct JsonNode JsonNode; typedef struct JsonParse JsonParse; /* An instance of this object represents a JSON string ** under construction. Really, this is a generic string accumulator ** that can be and is used to create strings other than JSON. */ struct JsonString { sqlite3_context *pCtx; /* Function context - put error messages here */ char *zBuf; /* Append JSON content here */ u64 nAlloc; /* Bytes of storage available in zBuf[] */ u64 nUsed; /* Bytes of zBuf[] currently used */ u8 bStatic; /* True if zBuf is static space */ u8 bErr; /* True if an error has been encountered */ char zSpace[100]; /* Initial static space */ }; /* JSON type values */ #define JSON_NULL 0 #define JSON_TRUE 1 #define JSON_FALSE 2 #define JSON_INT 3 #define JSON_REAL 4 #define JSON_STRING 5 #define JSON_ARRAY 6 #define JSON_OBJECT 7 /* The "subtype" set for JSON values */ #define JSON_SUBTYPE 74 /* Ascii for "J" */ /* ** Names of the various JSON types: */ static const char * const jsonType[] = { "null", "true", "false", "integer", "real", "text", "array", "object" }; /* Bit values for the JsonNode.jnFlag field */ #define JNODE_RAW 0x01 /* Content is raw, not JSON encoded */ #define JNODE_ESCAPE 0x02 /* Content is text with \ escapes */ #define JNODE_REMOVE 0x04 /* Do not output */ #define JNODE_REPLACE 0x08 /* Replace with JsonNode.u.iReplace */ #define JNODE_PATCH 0x10 /* Patch with JsonNode.u.pPatch */ #define JNODE_APPEND 0x20 /* More ARRAY/OBJECT entries at u.iAppend */ #define JNODE_LABEL 0x40 /* Is a label of an object */ /* A single node of parsed JSON */ struct JsonNode { u8 eType; /* One of the JSON_ type values */ u8 jnFlags; /* JNODE flags */ u32 n; /* Bytes of content, or number of sub-nodes */ union { const char *zJContent; /* Content for INT, REAL, and STRING */ u32 iAppend; /* More terms for ARRAY and OBJECT */ u32 iKey; /* Key for ARRAY objects in json_tree() */ u32 iReplace; /* Replacement content for JNODE_REPLACE */ JsonNode *pPatch; /* Node chain of patch for JNODE_PATCH */ } u; }; /* A completely parsed JSON string */ struct JsonParse { u32 nNode; /* Number of slots of aNode[] used */ u32 nAlloc; /* Number of slots of aNode[] allocated */ JsonNode *aNode; /* Array of nodes containing the parse */ const char *zJson; /* Original JSON string */ u32 *aUp; /* Index of parent of each node */ u8 oom; /* Set to true if out of memory */ u8 nErr; /* Number of errors seen */ u16 iDepth; /* Nesting depth */ int nJson; /* Length of the zJson string in bytes */ u32 iHold; /* Replace cache line with the lowest iHold value */ }; /* ** Maximum nesting depth of JSON for this implementation. ** ** This limit is needed to avoid a stack overflow in the recursive ** descent parser. A depth of 2000 is far deeper than any sane JSON ** should go. */ #define JSON_MAX_DEPTH 2000 /************************************************************************** ** Utility routines for dealing with JsonString objects **************************************************************************/ /* Set the JsonString object to an empty string */ static void jsonZero(JsonString *p){ p->zBuf = p->zSpace; p->nAlloc = sizeof(p->zSpace); p->nUsed = 0; p->bStatic = 1; } /* Initialize the JsonString object */ static void jsonInit(JsonString *p, sqlite3_context *pCtx){ p->pCtx = pCtx; p->bErr = 0; jsonZero(p); } /* Free all allocated memory and reset the JsonString object back to its ** initial state. */ static void jsonReset(JsonString *p){ if( !p->bStatic ) sqlite3_free(p->zBuf); jsonZero(p); } /* Report an out-of-memory (OOM) condition */ static void jsonOom(JsonString *p){ p->bErr = 1; sqlite3_result_error_nomem(p->pCtx); jsonReset(p); } /* Enlarge pJson->zBuf so that it can hold at least N more bytes. ** Return zero on success. Return non-zero on an OOM error */ static int jsonGrow(JsonString *p, u32 N){ u64 nTotal = N<p->nAlloc ? p->nAlloc*2 : p->nAlloc+N+10; char *zNew; if( p->bStatic ){ if( p->bErr ) return 1; zNew = sqlite3_malloc64(nTotal); if( zNew==0 ){ jsonOom(p); return SQLITE_NOMEM; } memcpy(zNew, p->zBuf, (size_t)p->nUsed); p->zBuf = zNew; p->bStatic = 0; }else{ zNew = sqlite3_realloc64(p->zBuf, nTotal); if( zNew==0 ){ jsonOom(p); return SQLITE_NOMEM; } p->zBuf = zNew; } p->nAlloc = nTotal; return SQLITE_OK; } /* Append N bytes from zIn onto the end of the JsonString string. */ static void jsonAppendRaw(JsonString *p, const char *zIn, u32 N){ if( (N+p->nUsed >= p->nAlloc) && jsonGrow(p,N)!=0 ) return; memcpy(p->zBuf+p->nUsed, zIn, N); p->nUsed += N; } /* Append formatted text (not to exceed N bytes) to the JsonString. */ static void jsonPrintf(int N, JsonString *p, const char *zFormat, ...){ va_list ap; if( (p->nUsed + N >= p->nAlloc) && jsonGrow(p, N) ) return; va_start(ap, zFormat); sqlite3_vsnprintf(N, p->zBuf+p->nUsed, zFormat, ap); va_end(ap); p->nUsed += (int)strlen(p->zBuf+p->nUsed); } /* Append a single character */ static void jsonAppendChar(JsonString *p, char c){ if( p->nUsed>=p->nAlloc && jsonGrow(p,1)!=0 ) return; p->zBuf[p->nUsed++] = c; } /* Append a comma separator to the output buffer, if the previous ** character is not '[' or '{'. */ static void jsonAppendSeparator(JsonString *p){ char c; if( p->nUsed==0 ) return; c = p->zBuf[p->nUsed-1]; if( c!='[' && c!='{' ) jsonAppendChar(p, ','); } /* Append the N-byte string in zIn to the end of the JsonString string ** under construction. Enclose the string in "..." and escape ** any double-quotes or backslash characters contained within the ** string. */ static void jsonAppendString(JsonString *p, const char *zIn, u32 N){ u32 i; if( (N+p->nUsed+2 >= p->nAlloc) && jsonGrow(p,N+2)!=0 ) return; p->zBuf[p->nUsed++] = '"'; for(i=0; i<N; i++){ unsigned char c = ((unsigned const char*)zIn)[i]; if( c=='"' || c=='\\' ){ json_simple_escape: if( (p->nUsed+N+3-i > p->nAlloc) && jsonGrow(p,N+3-i)!=0 ) return; p->zBuf[p->nUsed++] = '\\'; }else if( c<=0x1f ){ static const char aSpecial[] = { 0, 0, 0, 0, 0, 0, 0, 0, 'b', 't', 'n', 0, 'f', 'r', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; assert( sizeof(aSpecial)==32 ); assert( aSpecial['\b']=='b' ); assert( aSpecial['\f']=='f' ); assert( aSpecial['\n']=='n' ); assert( aSpecial['\r']=='r' ); assert( aSpecial['\t']=='t' ); if( aSpecial[c] ){ c = aSpecial[c]; goto json_simple_escape; } if( (p->nUsed+N+7+i > p->nAlloc) && jsonGrow(p,N+7-i)!=0 ) return; p->zBuf[p->nUsed++] = '\\'; p->zBuf[p->nUsed++] = 'u'; p->zBuf[p->nUsed++] = '0'; p->zBuf[p->nUsed++] = '0'; p->zBuf[p->nUsed++] = '0' + (c>>4); c = "0123456789abcdef"[c&0xf]; } p->zBuf[p->nUsed++] = c; } p->zBuf[p->nUsed++] = '"'; assert( p->nUsed<p->nAlloc ); } /* ** Append a function parameter value to the JSON string under ** construction. */ static void jsonAppendValue( JsonString *p, /* Append to this JSON string */ sqlite3_value *pValue /* Value to append */ ){ switch( sqlite3_value_type(pValue) ){ case SQLITE_NULL: { jsonAppendRaw(p, "null", 4); break; } case SQLITE_INTEGER: case SQLITE_FLOAT: { const char *z = (const char*)sqlite3_value_text(pValue); u32 n = (u32)sqlite3_value_bytes(pValue); jsonAppendRaw(p, z, n); break; } #if defined(SQLITE_BUILDING_FOR_COMDB2) case SQLITE_DATETIME: case SQLITE_DATETIMEUS: case SQLITE_INTERVAL_YM: case SQLITE_INTERVAL_DS: case SQLITE_INTERVAL_DSUS: case SQLITE_DECIMAL: #endif /* defined(SQLITE_BUILDING_FOR_COMDB2) */ case SQLITE_TEXT: { const char *z = (const char*)sqlite3_value_text(pValue); u32 n = (u32)sqlite3_value_bytes(pValue); if( sqlite3_value_subtype(pValue)==JSON_SUBTYPE ){ jsonAppendRaw(p, z, n); }else{ jsonAppendString(p, z, n); } break; } default: { if( p->bErr==0 ){ sqlite3_result_error(p->pCtx, "JSON cannot hold BLOB values", -1); p->bErr = 2; jsonReset(p); } break; } } } /* Make the JSON in p the result of the SQL function. */ static void jsonResult(JsonString *p){ if( p->bErr==0 ){ sqlite3_result_text64(p->pCtx, p->zBuf, p->nUsed, p->bStatic ? SQLITE_TRANSIENT : sqlite3_free, SQLITE_UTF8); jsonZero(p); } assert( p->bStatic ); } /************************************************************************** ** Utility routines for dealing with JsonNode and JsonParse objects **************************************************************************/ /* ** Return the number of consecutive JsonNode slots need to represent ** the parsed JSON at pNode. The minimum answer is 1. For ARRAY and ** OBJECT types, the number might be larger. ** ** Appended elements are not counted. The value returned is the number ** by which the JsonNode counter should increment in order to go to the ** next peer value. */ static u32 jsonNodeSize(JsonNode *pNode){ return pNode->eType>=JSON_ARRAY ? pNode->n+1 : 1; } /* ** Reclaim all memory allocated by a JsonParse object. But do not ** delete the JsonParse object itself. */ static void jsonParseReset(JsonParse *pParse){ sqlite3_free(pParse->aNode); pParse->aNode = 0; pParse->nNode = 0; pParse->nAlloc = 0; sqlite3_free(pParse->aUp); pParse->aUp = 0; } /* ** Free a JsonParse object that was obtained from sqlite3_malloc(). */ static void jsonParseFree(JsonParse *pParse){ jsonParseReset(pParse); sqlite3_free(pParse); } /* ** Convert the JsonNode pNode into a pure JSON string and ** append to pOut. Subsubstructure is also included. Return ** the number of JsonNode objects that are encoded. */ static void jsonRenderNode( JsonNode *pNode, /* The node to render */ JsonString *pOut, /* Write JSON here */ sqlite3_value **aReplace /* Replacement values */ ){ if( pNode->jnFlags & (JNODE_REPLACE|JNODE_PATCH) ){ if( pNode->jnFlags & JNODE_REPLACE ){ jsonAppendValue(pOut, aReplace[pNode->u.iReplace]); return; } pNode = pNode->u.pPatch; } switch( pNode->eType ){ default: { assert( pNode->eType==JSON_NULL ); jsonAppendRaw(pOut, "null", 4); break; } case JSON_TRUE: { jsonAppendRaw(pOut, "true", 4); break; } case JSON_FALSE: { jsonAppendRaw(pOut, "false", 5); break; } case JSON_STRING: { if( pNode->jnFlags & JNODE_RAW ){ jsonAppendString(pOut, pNode->u.zJContent, pNode->n); break; } /* Fall through into the next case */ } case JSON_REAL: case JSON_INT: { jsonAppendRaw(pOut, pNode->u.zJContent, pNode->n); break; } case JSON_ARRAY: { u32 j = 1; jsonAppendChar(pOut, '['); for(;;){ while( j<=pNode->n ){ if( (pNode[j].jnFlags & JNODE_REMOVE)==0 ){ jsonAppendSeparator(pOut); jsonRenderNode(&pNode[j], pOut, aReplace); } j += jsonNodeSize(&pNode[j]); } if( (pNode->jnFlags & JNODE_APPEND)==0 ) break; pNode = &pNode[pNode->u.iAppend]; j = 1; } jsonAppendChar(pOut, ']'); break; } case JSON_OBJECT: { u32 j = 1; jsonAppendChar(pOut, '{'); for(;;){ while( j<=pNode->n ){ if( (pNode[j+1].jnFlags & JNODE_REMOVE)==0 ){ jsonAppendSeparator(pOut); jsonRenderNode(&pNode[j], pOut, aReplace); jsonAppendChar(pOut, ':'); jsonRenderNode(&pNode[j+1], pOut, aReplace); } j += 1 + jsonNodeSize(&pNode[j+1]); } if( (pNode->jnFlags & JNODE_APPEND)==0 ) break; pNode = &pNode[pNode->u.iAppend]; j = 1; } jsonAppendChar(pOut, '}'); break; } } } /* ** Return a JsonNode and all its descendents as a JSON string. */ static void jsonReturnJson( JsonNode *pNode, /* Node to return */ sqlite3_context *pCtx, /* Return value for this function */ sqlite3_value **aReplace /* Array of replacement values */ ){ JsonString s; jsonInit(&s, pCtx); jsonRenderNode(pNode, &s, aReplace); jsonResult(&s); sqlite3_result_subtype(pCtx, JSON_SUBTYPE); } /* ** Make the JsonNode the return value of the function. */ static void jsonReturn( JsonNode *pNode, /* Node to return */ sqlite3_context *pCtx, /* Return value for this function */ sqlite3_value **aReplace /* Array of replacement values */ ){ switch( pNode->eType ){ default: { assert( pNode->eType==JSON_NULL ); sqlite3_result_null(pCtx); break; } case JSON_TRUE: { sqlite3_result_int(pCtx, 1); break; } case JSON_FALSE: { sqlite3_result_int(pCtx, 0); break; } case JSON_INT: { sqlite3_int64 i = 0; const char *z = pNode->u.zJContent; if( z[0]=='-' ){ z++; } while( z[0]>='0' && z[0]<='9' ){ unsigned v = *(z++) - '0'; if( i>=LARGEST_INT64/10 ){ if( i>LARGEST_INT64/10 ) goto int_as_real; if( z[0]>='0' && z[0]<='9' ) goto int_as_real; if( v==9 ) goto int_as_real; if( v==8 ){ if( pNode->u.zJContent[0]=='-' ){ sqlite3_result_int64(pCtx, SMALLEST_INT64); goto int_done; }else{ goto int_as_real; } } } i = i*10 + v; } if( pNode->u.zJContent[0]=='-' ){ i = -i; } sqlite3_result_int64(pCtx, i); int_done: break; int_as_real: /* fall through to real */; } case JSON_REAL: { double r; #ifdef SQLITE_AMALGAMATION const char *z = pNode->u.zJContent; sqlite3AtoF(z, &r, sqlite3Strlen30(z), SQLITE_UTF8); #else r = strtod(pNode->u.zJContent, 0); #endif sqlite3_result_double(pCtx, r); break; } case JSON_STRING: { #if 0 /* Never happens because JNODE_RAW is only set by json_set(), ** json_insert() and json_replace() and those routines do not ** call jsonReturn() */ if( pNode->jnFlags & JNODE_RAW ){ sqlite3_result_text(pCtx, pNode->u.zJContent, pNode->n, SQLITE_TRANSIENT); }else #endif assert( (pNode->jnFlags & JNODE_RAW)==0 ); if( (pNode->jnFlags & JNODE_ESCAPE)==0 ){ /* JSON formatted without any backslash-escapes */ sqlite3_result_text(pCtx, pNode->u.zJContent+1, pNode->n-2, SQLITE_TRANSIENT); }else{ /* Translate JSON formatted string into raw text */ u32 i; u32 n = pNode->n; const char *z = pNode->u.zJContent; char *zOut; u32 j; zOut = sqlite3_malloc( n+1 ); if( zOut==0 ){ sqlite3_result_error_nomem(pCtx); break; } for(i=1, j=0; i<n-1; i++){ char c = z[i]; if( c!='\\' ){ zOut[j++] = c; }else{ c = z[++i]; if( c=='u' ){ u32 v = 0, k; for(k=0; k<4; i++, k++){ assert( i<n-2 ); c = z[i+1]; assert( safe_isxdigit(c) ); if( c<='9' ) v = v*16 + c - '0'; else if( c<='F' ) v = v*16 + c - 'A' + 10; else v = v*16 + c - 'a' + 10; } if( v==0 ) break; if( v<=0x7f ){ zOut[j++] = (char)v; }else if( v<=0x7ff ){ zOut[j++] = (char)(0xc0 | (v>>6)); zOut[j++] = 0x80 | (v&0x3f); }else{ zOut[j++] = (char)(0xe0 | (v>>12)); zOut[j++] = 0x80 | ((v>>6)&0x3f); zOut[j++] = 0x80 | (v&0x3f); } }else{ if( c=='b' ){ c = '\b'; }else if( c=='f' ){ c = '\f'; }else if( c=='n' ){ c = '\n'; }else if( c=='r' ){ c = '\r'; }else if( c=='t' ){ c = '\t'; } zOut[j++] = c; } } } zOut[j] = 0; sqlite3_result_text(pCtx, zOut, j, sqlite3_free); } break; } case JSON_ARRAY: case JSON_OBJECT: { jsonReturnJson(pNode, pCtx, aReplace); break; } } } /* Forward reference */ static int jsonParseAddNode(JsonParse*,u32,u32,const char*); /* ** A macro to hint to the compiler that a function should not be ** inlined. */ #if defined(__GNUC__) # define JSON_NOINLINE __attribute__((noinline)) #elif defined(_MSC_VER) && _MSC_VER>=1310 # define JSON_NOINLINE __declspec(noinline) #else # define JSON_NOINLINE #endif static JSON_NOINLINE int jsonParseAddNodeExpand( JsonParse *pParse, /* Append the node to this object */ u32 eType, /* Node type */ u32 n, /* Content size or sub-node count */ const char *zContent /* Content */ ){ u32 nNew; JsonNode *pNew; assert( pParse->nNode>=pParse->nAlloc ); if( pParse->oom ) return -1; nNew = pParse->nAlloc*2 + 10; pNew = sqlite3_realloc64(pParse->aNode, sizeof(JsonNode)*nNew); if( pNew==0 ){ pParse->oom = 1; return -1; } pParse->nAlloc = nNew; pParse->aNode = pNew; assert( pParse->nNode<pParse->nAlloc ); return jsonParseAddNode(pParse, eType, n, zContent); } /* ** Create a new JsonNode instance based on the arguments and append that ** instance to the JsonParse. Return the index in pParse->aNode[] of the ** new node, or -1 if a memory allocation fails. */ static int jsonParseAddNode( JsonParse *pParse, /* Append the node to this object */ u32 eType, /* Node type */ u32 n, /* Content size or sub-node count */ const char *zContent /* Content */ ){ JsonNode *p; if( pParse->nNode>=pParse->nAlloc ){ return jsonParseAddNodeExpand(pParse, eType, n, zContent); } p = &pParse->aNode[pParse->nNode]; p->eType = (u8)eType; p->jnFlags = 0; p->n = n; p->u.zJContent = zContent; return pParse->nNode++; } /* ** Return true if z[] begins with 4 (or more) hexadecimal digits */ static int jsonIs4Hex(const char *z){ int i; for(i=0; i<4; i++) if( !safe_isxdigit(z[i]) ) return 0; return 1; } /* ** Parse a single JSON value which begins at pParse->zJson[i]. Return the ** index of the first character past the end of the value parsed. ** ** Return negative for a syntax error. Special cases: return -2 if the ** first non-whitespace character is '}' and return -3 if the first ** non-whitespace character is ']'. */ static int jsonParseValue(JsonParse *pParse, u32 i){ char c; u32 j; int iThis; int x; JsonNode *pNode; const char *z = pParse->zJson; while( safe_isspace(z[i]) ){ i++; } if( (c = z[i])=='{' ){ /* Parse object */ iThis = jsonParseAddNode(pParse, JSON_OBJECT, 0, 0); if( iThis<0 ) return -1; for(j=i+1;;j++){ while( safe_isspace(z[j]) ){ j++; } if( ++pParse->iDepth > JSON_MAX_DEPTH ) return -1; x = jsonParseValue(pParse, j); if( x<0 ){ pParse->iDepth--; if( x==(-2) && pParse->nNode==(u32)iThis+1 ) return j+1; return -1; } if( pParse->oom ) return -1; pNode = &pParse->aNode[pParse->nNode-1]; if( pNode->eType!=JSON_STRING ) return -1; pNode->jnFlags |= JNODE_LABEL; j = x; while( safe_isspace(z[j]) ){ j++; } if( z[j]!=':' ) return -1; j++; x = jsonParseValue(pParse, j); pParse->iDepth--; if( x<0 ) return -1; j = x; while( safe_isspace(z[j]) ){ j++; } c = z[j]; if( c==',' ) continue; if( c!='}' ) return -1; break; } pParse->aNode[iThis].n = pParse->nNode - (u32)iThis - 1; return j+1; }else if( c=='[' ){ /* Parse array */ iThis = jsonParseAddNode(pParse, JSON_ARRAY, 0, 0); if( iThis<0 ) return -1; for(j=i+1;;j++){ while( safe_isspace(z[j]) ){ j++; } if( ++pParse->iDepth > JSON_MAX_DEPTH ) return -1; x = jsonParseValue(pParse, j); pParse->iDepth--; if( x<0 ){ if( x==(-3) && pParse->nNode==(u32)iThis+1 ) return j+1; return -1; } j = x; while( safe_isspace(z[j]) ){ j++; } c = z[j]; if( c==',' ) continue; if( c!=']' ) return -1; break; } pParse->aNode[iThis].n = pParse->nNode - (u32)iThis - 1; return j+1; }else if( c=='"' ){ /* Parse string */ u8 jnFlags = 0; j = i+1; for(;;){ c = z[j]; if( (c & ~0x1f)==0 ){ /* Control characters are not allowed in strings */ return -1; } if( c=='\\' ){ c = z[++j]; if( c=='"' || c=='\\' || c=='/' || c=='b' || c=='f' || c=='n' || c=='r' || c=='t' || (c=='u' && jsonIs4Hex(z+j+1)) ){ jnFlags = JNODE_ESCAPE; }else{ return -1; } }else if( c=='"' ){ break; } j++; } jsonParseAddNode(pParse, JSON_STRING, j+1-i, &z[i]); if( !pParse->oom ) pParse->aNode[pParse->nNode-1].jnFlags = jnFlags; return j+1; }else if( c=='n' && strncmp(z+i,"null",4)==0 && !safe_isalnum(z[i+4]) ){ jsonParseAddNode(pParse, JSON_NULL, 0, 0); return i+4; }else if( c=='t' && strncmp(z+i,"true",4)==0 && !safe_isalnum(z[i+4]) ){ jsonParseAddNode(pParse, JSON_TRUE, 0, 0); return i+4; }else if( c=='f' && strncmp(z+i,"false",5)==0 && !safe_isalnum(z[i+5]) ){ jsonParseAddNode(pParse, JSON_FALSE, 0, 0); return i+5; }else if( c=='-' || (c>='0' && c<='9') ){ /* Parse number */ u8 seenDP = 0; u8 seenE = 0; assert( '-' < '0' ); if( c<='0' ){ j = c=='-' ? i+1 : i; if( z[j]=='0' && z[j+1]>='0' && z[j+1]<='9' ) return -1; } j = i+1; for(;; j++){ c = z[j]; if( c>='0' && c<='9' ) continue; if( c=='.' ){ if( z[j-1]=='-' ) return -1; if( seenDP ) return -1; seenDP = 1; continue; } if( c=='e' || c=='E' ){ if( z[j-1]<'0' ) return -1; if( seenE ) return -1; seenDP = seenE = 1; c = z[j+1]; if( c=='+' || c=='-' ){ j++; c = z[j+1]; } if( c<'0' || c>'9' ) return -1; continue; } break; } if( z[j-1]<'0' ) return -1; jsonParseAddNode(pParse, seenDP ? JSON_REAL : JSON_INT, j - i, &z[i]); return j; }else if( c=='}' ){ return -2; /* End of {...} */ }else if( c==']' ){ return -3; /* End of [...] */ }else if( c==0 ){ return 0; /* End of file */ }else{ return -1; /* Syntax error */ } } /* ** Parse a complete JSON string. Return 0 on success or non-zero if there ** are any errors. If an error occurs, free all memory associated with ** pParse. ** ** pParse is uninitialized when this routine is called. */ static int jsonParse( JsonParse *pParse, /* Initialize and fill this JsonParse object */ sqlite3_context *pCtx, /* Report errors here */ const char *zJson /* Input JSON text to be parsed */ ){ int i; memset(pParse, 0, sizeof(*pParse)); if( zJson==0 ) return 1; pParse->zJson = zJson; i = jsonParseValue(pParse, 0); if( pParse->oom ) i = -1; if( i>0 ){ assert( pParse->iDepth==0 ); while( safe_isspace(zJson[i]) ) i++; if( zJson[i] ) i = -1; } if( i<=0 ){ if( pCtx!=0 ){ if( pParse->oom ){ sqlite3_result_error_nomem(pCtx); }else{ sqlite3_result_error(pCtx, "malformed JSON", -1); } } jsonParseReset(pParse); return 1; } return 0; } /* Mark node i of pParse as being a child of iParent. Call recursively ** to fill in all the descendants of node i. */ static void jsonParseFillInParentage(JsonParse *pParse, u32 i, u32 iParent){ JsonNode *pNode = &pParse->aNode[i]; u32 j; pParse->aUp[i] = iParent; switch( pNode->eType ){ case JSON_ARRAY: { for(j=1; j<=pNode->n; j += jsonNodeSize(pNode+j)){ jsonParseFillInParentage(pParse, i+j, i); } break; } case JSON_OBJECT: { for(j=1; j<=pNode->n; j += jsonNodeSize(pNode+j+1)+1){ pParse->aUp[i+j] = i; jsonParseFillInParentage(pParse, i+j+1, i); } break; } default: { break; } } } /* ** Compute the parentage of all nodes in a completed parse. */ static int jsonParseFindParents(JsonParse *pParse){ u32 *aUp; assert( pParse->aUp==0 ); aUp = pParse->aUp = sqlite3_malloc64( sizeof(u32)*pParse->nNode ); if( aUp==0 ){ pParse->oom = 1; return SQLITE_NOMEM; } jsonParseFillInParentage(pParse, 0, 0); return SQLITE_OK; } /* ** Magic number used for the JSON parse cache in sqlite3_get_auxdata() */ #define JSON_CACHE_ID (-429938) /* First cache entry */ #define JSON_CACHE_SZ 4 /* Max number of cache entries */ /* ** Obtain a complete parse of the JSON found in the first argument ** of the argv array. Use the sqlite3_get_auxdata() cache for this ** parse if it is available. If the cache is not available or if it ** is no longer valid, parse the JSON again and return the new parse, ** and also register the new parse so that it will be available for ** future sqlite3_get_auxdata() calls. */ static JsonParse *jsonParseCached( sqlite3_context *pCtx, sqlite3_value **argv, sqlite3_context *pErrCtx ){ const char *zJson = (const char*)sqlite3_value_text(argv[0]); int nJson = sqlite3_value_bytes(argv[0]); JsonParse *p; JsonParse *pMatch = 0; int iKey; int iMinKey = 0; u32 iMinHold = 0xffffffff; u32 iMaxHold = 0; if( zJson==0 ) return 0; for(iKey=0; iKey<JSON_CACHE_SZ; iKey++){ p = (JsonParse*)sqlite3_get_auxdata(pCtx, JSON_CACHE_ID+iKey); if( p==0 ){ iMinKey = iKey; break; } if( pMatch==0 && p->nJson==nJson && memcmp(p->zJson,zJson,nJson)==0 ){ p->nErr = 0; pMatch = p; }else if( p->iHold<iMinHold ){ iMinHold = p->iHold; iMinKey = iKey; } if( p->iHold>iMaxHold ){ iMaxHold = p->iHold; } } if( pMatch ){ pMatch->nErr = 0; pMatch->iHold = iMaxHold+1; return pMatch; } p = sqlite3_malloc64( sizeof(*p) + nJson + 1 ); if( p==0 ){ sqlite3_result_error_nomem(pCtx); return 0; } memset(p, 0, sizeof(*p)); p->zJson = (char*)&p[1]; memcpy((char*)p->zJson, zJson, nJson+1); if( jsonParse(p, pErrCtx, p->zJson) ){ sqlite3_free(p); return 0; } p->nJson = nJson; p->iHold = iMaxHold+1; sqlite3_set_auxdata(pCtx, JSON_CACHE_ID+iMinKey, p, (void(*)(void*))jsonParseFree); return (JsonParse*)sqlite3_get_auxdata(pCtx, JSON_CACHE_ID+iMinKey); } /* ** Compare the OBJECT label at pNode against zKey,nKey. Return true on ** a match. */ static int jsonLabelCompare(JsonNode *pNode, const char *zKey, u32 nKey){ if( pNode->jnFlags & JNODE_RAW ){ if( pNode->n!=nKey ) return 0; return strncmp(pNode->u.zJContent, zKey, nKey)==0; }else{ if( pNode->n!=nKey+2 ) return 0; return strncmp(pNode->u.zJContent+1, zKey, nKey)==0; } } /* forward declaration */ static JsonNode *jsonLookupAppend(JsonParse*,const char*,int*,const char**); /* ** Search along zPath to find the node specified. Return a pointer ** to that node, or NULL if zPath is malformed or if there is no such ** node. ** ** If pApnd!=0, then try to append new nodes to complete zPath if it is ** possible to do so and if no existing node corresponds to zPath. If ** new nodes are appended *pApnd is set to 1. */ static JsonNode *jsonLookupStep( JsonParse *pParse, /* The JSON to search */ u32 iRoot, /* Begin the search at this node */ const char *zPath, /* The path to search */ int *pApnd, /* Append nodes to complete path if not NULL */ const char **pzErr /* Make *pzErr point to any syntax error in zPath */ ){ u32 i, j, nKey; const char *zKey; JsonNode *pRoot = &pParse->aNode[iRoot]; if( zPath[0]==0 ) return pRoot; if( zPath[0]=='.' ){ if( pRoot->eType!=JSON_OBJECT ) return 0; zPath++; if( zPath[0]=='"' ){ zKey = zPath + 1; for(i=1; zPath[i] && zPath[i]!='"'; i++){} nKey = i-1; if( zPath[i] ){ i++; }else{ *pzErr = zPath; return 0; } }else{ zKey = zPath; for(i=0; zPath[i] && zPath[i]!='.' && zPath[i]!='['; i++){} nKey = i; } if( nKey==0 ){ *pzErr = zPath; return 0; } j = 1; for(;;){ while( j<=pRoot->n ){ if( jsonLabelCompare(pRoot+j, zKey, nKey) ){ return jsonLookupStep(pParse, iRoot+j+1, &zPath[i], pApnd, pzErr); } j++; j += jsonNodeSize(&pRoot[j]); } if( (pRoot->jnFlags & JNODE_APPEND)==0 ) break; iRoot += pRoot->u.iAppend; pRoot = &pParse->aNode[iRoot]; j = 1; } if( pApnd ){ u32 iStart, iLabel; JsonNode *pNode; iStart = jsonParseAddNode(pParse, JSON_OBJECT, 2, 0); iLabel = jsonParseAddNode(pParse, JSON_STRING, i, zPath); zPath += i; pNode = jsonLookupAppend(pParse, zPath, pApnd, pzErr); if( pParse->oom ) return 0; if( pNode ){ pRoot = &pParse->aNode[iRoot]; pRoot->u.iAppend = iStart - iRoot; pRoot->jnFlags |= JNODE_APPEND; pParse->aNode[iLabel].jnFlags |= JNODE_RAW; } return pNode; } }else if( zPath[0]=='[' && safe_isdigit(zPath[1]) ){ if( pRoot->eType!=JSON_ARRAY ) return 0; i = 0; j = 1; while( safe_isdigit(zPath[j]) ){ i = i*10 + zPath[j] - '0'; j++; } if( zPath[j]!=']' ){ *pzErr = zPath; return 0; } zPath += j + 1; j = 1; for(;;){ while( j<=pRoot->n && (i>0 || (pRoot[j].jnFlags & JNODE_REMOVE)!=0) ){ if( (pRoot[j].jnFlags & JNODE_REMOVE)==0 ) i--; j += jsonNodeSize(&pRoot[j]); } if( (pRoot->jnFlags & JNODE_APPEND)==0 ) break; iRoot += pRoot->u.iAppend; pRoot = &pParse->aNode[iRoot]; j = 1; } if( j<=pRoot->n ){ return jsonLookupStep(pParse, iRoot+j, zPath, pApnd, pzErr); } if( i==0 && pApnd ){ u32 iStart; JsonNode *pNode; iStart = jsonParseAddNode(pParse, JSON_ARRAY, 1, 0); pNode = jsonLookupAppend(pParse, zPath, pApnd, pzErr); if( pParse->oom ) return 0; if( pNode ){ pRoot = &pParse->aNode[iRoot]; pRoot->u.iAppend = iStart - iRoot; pRoot->jnFlags |= JNODE_APPEND; } return pNode; } }else{ *pzErr = zPath; } return 0; } /* ** Append content to pParse that will complete zPath. Return a pointer ** to the inserted node, or return NULL if the append fails. */ static JsonNode *jsonLookupAppend( JsonParse *pParse, /* Append content to the JSON parse */ const char *zPath, /* Description of content to append */ int *pApnd, /* Set this flag to 1 */ const char **pzErr /* Make this point to any syntax error */ ){ *pApnd = 1; if( zPath[0]==0 ){ jsonParseAddNode(pParse, JSON_NULL, 0, 0); return pParse->oom ? 0 : &pParse->aNode[pParse->nNode-1]; } if( zPath[0]=='.' ){ jsonParseAddNode(pParse, JSON_OBJECT, 0, 0); }else if( strncmp(zPath,"[0]",3)==0 ){ jsonParseAddNode(pParse, JSON_ARRAY, 0, 0); }else{ return 0; } if( pParse->oom ) return 0; return jsonLookupStep(pParse, pParse->nNode-1, zPath, pApnd, pzErr); } /* ** Return the text of a syntax error message on a JSON path. Space is ** obtained from sqlite3_malloc(). */ static char *jsonPathSyntaxError(const char *zErr){ return sqlite3_mprintf("JSON path error near '%q'", zErr); } /* ** Do a node lookup using zPath. Return a pointer to the node on success. ** Return NULL if not found or if there is an error. ** ** On an error, write an error message into pCtx and increment the ** pParse->nErr counter. ** ** If pApnd!=NULL then try to append missing nodes and set *pApnd = 1 if ** nodes are appended. */ static JsonNode *jsonLookup( JsonParse *pParse, /* The JSON to search */ const char *zPath, /* The path to search */ int *pApnd, /* Append nodes to complete path if not NULL */ sqlite3_context *pCtx /* Report errors here, if not NULL */ ){ const char *zErr = 0; JsonNode *pNode = 0; char *zMsg; if( zPath==0 ) return 0; if( zPath[0]!='$' ){ zErr = zPath; goto lookup_err; } zPath++; pNode = jsonLookupStep(pParse, 0, zPath, pApnd, &zErr); if( zErr==0 ) return pNode; lookup_err: pParse->nErr++; assert( zErr!=0 && pCtx!=0 ); zMsg = jsonPathSyntaxError(zErr); if( zMsg ){ sqlite3_result_error(pCtx, zMsg, -1); sqlite3_free(zMsg); }else{ sqlite3_result_error_nomem(pCtx); } return 0; } /* ** Report the wrong number of arguments for json_insert(), json_replace() ** or json_set(). */ static void jsonWrongNumArgs( sqlite3_context *pCtx, const char *zFuncName ){ char *zMsg = sqlite3_mprintf("json_%s() needs an odd number of arguments", zFuncName); sqlite3_result_error(pCtx, zMsg, -1); sqlite3_free(zMsg); } /* ** Mark all NULL entries in the Object passed in as JNODE_REMOVE. */ static void jsonRemoveAllNulls(JsonNode *pNode){ int i, n; assert( pNode->eType==JSON_OBJECT ); n = pNode->n; for(i=2; i<=n; i += jsonNodeSize(&pNode[i])+1){ switch( pNode[i].eType ){ case JSON_NULL: pNode[i].jnFlags |= JNODE_REMOVE; break; case JSON_OBJECT: jsonRemoveAllNulls(&pNode[i]); break; } } } /**************************************************************************** ** SQL functions used for testing and debugging ****************************************************************************/ #ifdef SQLITE_DEBUG /* ** The json_parse(JSON) function returns a string which describes ** a parse of the JSON provided. Or it returns NULL if JSON is not ** well-formed. */ static void jsonParseFunc( sqlite3_context *ctx, int argc, sqlite3_value **argv ){ JsonString s; /* Output string - not real JSON */ JsonParse x; /* The parse */ u32 i; assert( argc==1 ); if( jsonParse(&x, ctx, (const char*)sqlite3_value_text(argv[0])) ) return; jsonParseFindParents(&x); jsonInit(&s, ctx); for(i=0; i<x.nNode; i++){ const char *zType; if( x.aNode[i].jnFlags & JNODE_LABEL ){ assert( x.aNode[i].eType==JSON_STRING ); zType = "label"; }else{ zType = jsonType[x.aNode[i].eType]; } jsonPrintf(100, &s,"node %3u: %7s n=%-4d up=%-4d", i, zType, x.aNode[i].n, x.aUp[i]); if( x.aNode[i].u.zJContent!=0 ){ jsonAppendRaw(&s, " ", 1); jsonAppendRaw(&s, x.aNode[i].u.zJContent, x.aNode[i].n); } jsonAppendRaw(&s, "\n", 1); } jsonParseReset(&x); jsonResult(&s); } /* ** The json_test1(JSON) function return true (1) if the input is JSON ** text generated by another json function. It returns (0) if the input ** is not known to be JSON. */ static void jsonTest1Func( sqlite3_context *ctx, int argc, sqlite3_value **argv ){ UNUSED_PARAM(argc); sqlite3_result_int(ctx, sqlite3_value_subtype(argv[0])==JSON_SUBTYPE); } #endif /* SQLITE_DEBUG */ /**************************************************************************** ** Scalar SQL function implementations ****************************************************************************/ /* ** Implementation of the json_QUOTE(VALUE) function. Return a JSON value ** corresponding to the SQL value input. Mostly this means putting ** double-quotes around strings and returning the unquoted string "null" ** when given a NULL input. */ static void jsonQuoteFunc( sqlite3_context *ctx, int argc, sqlite3_value **argv ){ JsonString jx; UNUSED_PARAM(argc); jsonInit(&jx, ctx); jsonAppendValue(&jx, argv[0]); jsonResult(&jx); sqlite3_result_subtype(ctx, JSON_SUBTYPE); } /* ** Implementation of the json_array(VALUE,...) function. Return a JSON ** array that contains all values given in arguments. Or if any argument ** is a BLOB, throw an error. */ static void jsonArrayFunc( sqlite3_context *ctx, int argc, sqlite3_value **argv ){ int i; JsonString jx; jsonInit(&jx, ctx); jsonAppendChar(&jx, '['); for(i=0; i<argc; i++){ jsonAppendSeparator(&jx); jsonAppendValue(&jx, argv[i]); } jsonAppendChar(&jx, ']'); jsonResult(&jx); sqlite3_result_subtype(ctx, JSON_SUBTYPE); } /* ** json_array_length(JSON) ** json_array_length(JSON, PATH) ** ** Return the number of elements in the top-level JSON array. ** Return 0 if the input is not a well-formed JSON array. */ static void jsonArrayLengthFunc( sqlite3_context *ctx, int argc, sqlite3_value **argv ){ JsonParse *p; /* The parse */ sqlite3_int64 n = 0; u32 i; JsonNode *pNode; p = jsonParseCached(ctx, argv, ctx); if( p==0 ) return; assert( p->nNode ); if( argc==2 ){ const char *zPath = (const char*)sqlite3_value_text(argv[1]); pNode = jsonLookup(p, zPath, 0, ctx); }else{ pNode = p->aNode; } if( pNode==0 ){ return; } if( pNode->eType==JSON_ARRAY ){ assert( (pNode->jnFlags & JNODE_APPEND)==0 ); for(i=1; i<=pNode->n; n++){ i += jsonNodeSize(&pNode[i]); } } sqlite3_result_int64(ctx, n); } /* ** json_extract(JSON, PATH, ...) ** ** Return the element described by PATH. Return NULL if there is no ** PATH element. If there are multiple PATHs, then return a JSON array ** with the result from each path. Throw an error if the JSON or any PATH ** is malformed. */ static void jsonExtractFunc( sqlite3_context *ctx, int argc, sqlite3_value **argv ){ JsonParse *p; /* The parse */ JsonNode *pNode; const char *zPath; JsonString jx; int i; if( argc<2 ) return; p = jsonParseCached(ctx, argv, ctx); if( p==0 ) return; jsonInit(&jx, ctx); jsonAppendChar(&jx, '['); for(i=1; i<argc; i++){ zPath = (const char*)sqlite3_value_text(argv[i]); pNode = jsonLookup(p, zPath, 0, ctx); if( p->nErr ) break; if( argc>2 ){ jsonAppendSeparator(&jx); if( pNode ){ jsonRenderNode(pNode, &jx, 0); }else{ jsonAppendRaw(&jx, "null", 4); } }else if( pNode ){ jsonReturn(pNode, ctx, 0); } } if( argc>2 && i==argc ){ jsonAppendChar(&jx, ']'); jsonResult(&jx); sqlite3_result_subtype(ctx, JSON_SUBTYPE); } jsonReset(&jx); } /* This is the RFC 7396 MergePatch algorithm. */ static JsonNode *jsonMergePatch( JsonParse *pParse, /* The JSON parser that contains the TARGET */ u32 iTarget, /* Node of the TARGET in pParse */ JsonNode *pPatch /* The PATCH */ ){ u32 i, j; u32 iRoot; JsonNode *pTarget; if( pPatch->eType!=JSON_OBJECT ){ return pPatch; } assert( iTarget>=0 && iTarget<pParse->nNode ); pTarget = &pParse->aNode[iTarget]; assert( (pPatch->jnFlags & JNODE_APPEND)==0 ); if( pTarget->eType!=JSON_OBJECT ){ jsonRemoveAllNulls(pPatch); return pPatch; } iRoot = iTarget; for(i=1; i<pPatch->n; i += jsonNodeSize(&pPatch[i+1])+1){ u32 nKey; const char *zKey; assert( pPatch[i].eType==JSON_STRING ); assert( pPatch[i].jnFlags & JNODE_LABEL ); nKey = pPatch[i].n; zKey = pPatch[i].u.zJContent; assert( (pPatch[i].jnFlags & JNODE_RAW)==0 ); for(j=1; j<pTarget->n; j += jsonNodeSize(&pTarget[j+1])+1 ){ assert( pTarget[j].eType==JSON_STRING ); assert( pTarget[j].jnFlags & JNODE_LABEL ); assert( (pPatch[i].jnFlags & JNODE_RAW)==0 ); if( pTarget[j].n==nKey && strncmp(pTarget[j].u.zJContent,zKey,nKey)==0 ){ if( pTarget[j+1].jnFlags & (JNODE_REMOVE|JNODE_PATCH) ) break; if( pPatch[i+1].eType==JSON_NULL ){ pTarget[j+1].jnFlags |= JNODE_REMOVE; }else{ JsonNode *pNew = jsonMergePatch(pParse, iTarget+j+1, &pPatch[i+1]); if( pNew==0 ) return 0; pTarget = &pParse->aNode[iTarget]; if( pNew!=&pTarget[j+1] ){ pTarget[j+1].u.pPatch = pNew; pTarget[j+1].jnFlags |= JNODE_PATCH; } } break; } } if( j>=pTarget->n && pPatch[i+1].eType!=JSON_NULL ){ int iStart, iPatch; iStart = jsonParseAddNode(pParse, JSON_OBJECT, 2, 0); jsonParseAddNode(pParse, JSON_STRING, nKey, zKey); iPatch = jsonParseAddNode(pParse, JSON_TRUE, 0, 0); if( pParse->oom ) return 0; jsonRemoveAllNulls(pPatch); pTarget = &pParse->aNode[iTarget]; pParse->aNode[iRoot].jnFlags |= JNODE_APPEND; pParse->aNode[iRoot].u.iAppend = iStart - iRoot; iRoot = iStart; pParse->aNode[iPatch].jnFlags |= JNODE_PATCH; pParse->aNode[iPatch].u.pPatch = &pPatch[i+1]; } } return pTarget; } /* ** Implementation of the json_mergepatch(JSON1,JSON2) function. Return a JSON ** object that is the result of running the RFC 7396 MergePatch() algorithm ** on the two arguments. */ static void jsonPatchFunc( sqlite3_context *ctx, int argc, sqlite3_value **argv ){ JsonParse x; /* The JSON that is being patched */ JsonParse y; /* The patch */ JsonNode *pResult; /* The result of the merge */ UNUSED_PARAM(argc); if( jsonParse(&x, ctx, (const char*)sqlite3_value_text(argv[0])) ) return; if( jsonParse(&y, ctx, (const char*)sqlite3_value_text(argv[1])) ){ jsonParseReset(&x); return; } pResult = jsonMergePatch(&x, 0, y.aNode); assert( pResult!=0 || x.oom ); if( pResult ){ jsonReturnJson(pResult, ctx, 0); }else{ sqlite3_result_error_nomem(ctx); } jsonParseReset(&x); jsonParseReset(&y); } /* ** Implementation of the json_object(NAME,VALUE,...) function. Return a JSON ** object that contains all name/value given in arguments. Or if any name ** is not a string or if any value is a BLOB, throw an error. */ static void jsonObjectFunc( sqlite3_context *ctx, int argc, sqlite3_value **argv ){ int i; JsonString jx; const char *z; u32 n; if( argc&1 ){ sqlite3_result_error(ctx, "json_object() requires an even number " "of arguments", -1); return; } jsonInit(&jx, ctx); jsonAppendChar(&jx, '{'); for(i=0; i<argc; i+=2){ if( sqlite3_value_type(argv[i])!=SQLITE_TEXT ){ sqlite3_result_error(ctx, "json_object() labels must be TEXT", -1); jsonReset(&jx); return; } jsonAppendSeparator(&jx); z = (const char*)sqlite3_value_text(argv[i]); n = (u32)sqlite3_value_bytes(argv[i]); jsonAppendString(&jx, z, n); jsonAppendChar(&jx, ':'); jsonAppendValue(&jx, argv[i+1]); } jsonAppendChar(&jx, '}'); jsonResult(&jx); sqlite3_result_subtype(ctx, JSON_SUBTYPE); } /* ** json_remove(JSON, PATH, ...) ** ** Remove the named elements from JSON and return the result. malformed ** JSON or PATH arguments result in an error. */ static void jsonRemoveFunc( sqlite3_context *ctx, int argc, sqlite3_value **argv ){ JsonParse x; /* The parse */ JsonNode *pNode; const char *zPath; u32 i; if( argc<1 ) return; if( jsonParse(&x, ctx, (const char*)sqlite3_value_text(argv[0])) ) return; assert( x.nNode ); for(i=1; i<(u32)argc; i++){ zPath = (const char*)sqlite3_value_text(argv[i]); if( zPath==0 ) goto remove_done; pNode = jsonLookup(&x, zPath, 0, ctx); if( x.nErr ) goto remove_done; if( pNode ) pNode->jnFlags |= JNODE_REMOVE; } if( (x.aNode[0].jnFlags & JNODE_REMOVE)==0 ){ jsonReturnJson(x.aNode, ctx, 0); } remove_done: jsonParseReset(&x); } /* ** json_replace(JSON, PATH, VALUE, ...) ** ** Replace the value at PATH with VALUE. If PATH does not already exist, ** this routine is a no-op. If JSON or PATH is malformed, throw an error. */ static void jsonReplaceFunc( sqlite3_context *ctx, int argc, sqlite3_value **argv ){ JsonParse x; /* The parse */ JsonNode *pNode; const char *zPath; u32 i; if( argc<1 ) return; if( (argc&1)==0 ) { jsonWrongNumArgs(ctx, "replace"); return; } if( jsonParse(&x, ctx, (const char*)sqlite3_value_text(argv[0])) ) return; assert( x.nNode ); for(i=1; i<(u32)argc; i+=2){ zPath = (const char*)sqlite3_value_text(argv[i]); pNode = jsonLookup(&x, zPath, 0, ctx); if( x.nErr ) goto replace_err; if( pNode ){ pNode->jnFlags |= (u8)JNODE_REPLACE; pNode->u.iReplace = i + 1; } } if( x.aNode[0].jnFlags & JNODE_REPLACE ){ sqlite3_result_value(ctx, argv[x.aNode[0].u.iReplace]); }else{ jsonReturnJson(x.aNode, ctx, argv); } replace_err: jsonParseReset(&x); } /* ** json_set(JSON, PATH, VALUE, ...) ** ** Set the value at PATH to VALUE. Create the PATH if it does not already ** exist. Overwrite existing values that do exist. ** If JSON or PATH is malformed, throw an error. ** ** json_insert(JSON, PATH, VALUE, ...) ** ** Create PATH and initialize it to VALUE. If PATH already exists, this ** routine is a no-op. If JSON or PATH is malformed, throw an error. */ static void jsonSetFunc( sqlite3_context *ctx, int argc, sqlite3_value **argv ){ JsonParse x; /* The parse */ JsonNode *pNode; const char *zPath; u32 i; int bApnd; int bIsSet = *(int*)sqlite3_user_data(ctx); if( argc<1 ) return; if( (argc&1)==0 ) { jsonWrongNumArgs(ctx, bIsSet ? "set" : "insert"); return; } if( jsonParse(&x, ctx, (const char*)sqlite3_value_text(argv[0])) ) return; assert( x.nNode ); for(i=1; i<(u32)argc; i+=2){ zPath = (const char*)sqlite3_value_text(argv[i]); bApnd = 0; pNode = jsonLookup(&x, zPath, &bApnd, ctx); if( x.oom ){ sqlite3_result_error_nomem(ctx); goto jsonSetDone; }else if( x.nErr ){ goto jsonSetDone; }else if( pNode && (bApnd || bIsSet) ){ pNode->jnFlags |= (u8)JNODE_REPLACE; pNode->u.iReplace = i + 1; } } if( x.aNode[0].jnFlags & JNODE_REPLACE ){ sqlite3_result_value(ctx, argv[x.aNode[0].u.iReplace]); }else{ jsonReturnJson(x.aNode, ctx, argv); } jsonSetDone: jsonParseReset(&x); } /* ** json_type(JSON) ** json_type(JSON, PATH) ** ** Return the top-level "type" of a JSON string. Throw an error if ** either the JSON or PATH inputs are not well-formed. */ static void jsonTypeFunc( sqlite3_context *ctx, int argc, sqlite3_value **argv ){ JsonParse *p; /* The parse */ const char *zPath; JsonNode *pNode; p = jsonParseCached(ctx, argv, ctx); if( p==0 ) return; if( argc==2 ){ zPath = (const char*)sqlite3_value_text(argv[1]); pNode = jsonLookup(p, zPath, 0, ctx); }else{ pNode = p->aNode; } if( pNode ){ sqlite3_result_text(ctx, jsonType[pNode->eType], -1, SQLITE_STATIC); } } /* ** json_valid(JSON) ** ** Return 1 if JSON is a well-formed JSON string according to RFC-7159. ** Return 0 otherwise. */ static void jsonValidFunc( sqlite3_context *ctx, int argc, sqlite3_value **argv ){ JsonParse *p; /* The parse */ UNUSED_PARAM(argc); p = jsonParseCached(ctx, argv, 0); sqlite3_result_int(ctx, p!=0); } /**************************************************************************** ** Aggregate SQL function implementations ****************************************************************************/ /* ** json_group_array(VALUE) ** ** Return a JSON array composed of all values in the aggregate. */ static void jsonArrayStep( sqlite3_context *ctx, int argc, sqlite3_value **argv ){ JsonString *pStr; UNUSED_PARAM(argc); pStr = (JsonString*)sqlite3_aggregate_context(ctx, sizeof(*pStr)); if( pStr ){ if( pStr->zBuf==0 ){ jsonInit(pStr, ctx); jsonAppendChar(pStr, '['); }else{ jsonAppendChar(pStr, ','); pStr->pCtx = ctx; } jsonAppendValue(pStr, argv[0]); } } static void jsonArrayCompute(sqlite3_context *ctx, int isFinal){ JsonString *pStr; pStr = (JsonString*)sqlite3_aggregate_context(ctx, 0); if( pStr ){ pStr->pCtx = ctx; jsonAppendChar(pStr, ']'); if( pStr->bErr ){ if( pStr->bErr==1 ) sqlite3_result_error_nomem(ctx); assert( pStr->bStatic ); }else if( isFinal ){ sqlite3_result_text(ctx, pStr->zBuf, (int)pStr->nUsed, pStr->bStatic ? SQLITE_TRANSIENT : sqlite3_free); pStr->bStatic = 1; }else{ sqlite3_result_text(ctx, pStr->zBuf, (int)pStr->nUsed, SQLITE_TRANSIENT); pStr->nUsed--; } }else{ sqlite3_result_text(ctx, "[]", 2, SQLITE_STATIC); } sqlite3_result_subtype(ctx, JSON_SUBTYPE); } static void jsonArrayValue(sqlite3_context *ctx){ jsonArrayCompute(ctx, 0); } static void jsonArrayFinal(sqlite3_context *ctx){ jsonArrayCompute(ctx, 1); } #ifndef SQLITE_OMIT_WINDOWFUNC /* ** This method works for both json_group_array() and json_group_object(). ** It works by removing the first element of the group by searching forward ** to the first comma (",") that is not within a string and deleting all ** text through that comma. */ static void jsonGroupInverse( sqlite3_context *ctx, int argc, sqlite3_value **argv ){ int i; int inStr = 0; char *z; JsonString *pStr; UNUSED_PARAM(argc); UNUSED_PARAM(argv); pStr = (JsonString*)sqlite3_aggregate_context(ctx, 0); #ifdef NEVER /* pStr is always non-NULL since jsonArrayStep() or jsonObjectStep() will ** always have been called to initalize it */ if( NEVER(!pStr) ) return; #endif z = pStr->zBuf; for(i=1; z[i]!=',' || inStr; i++){ assert( i<pStr->nUsed ); if( z[i]=='"' ){ inStr = !inStr; }else if( z[i]=='\\' ){ i++; } } pStr->nUsed -= i; memmove(&z[1], &z[i+1], (size_t)pStr->nUsed-1); } #else # define jsonGroupInverse 0 #endif /* ** json_group_obj(NAME,VALUE) ** ** Return a JSON object composed of all names and values in the aggregate. */ static void jsonObjectStep( sqlite3_context *ctx, int argc, sqlite3_value **argv ){ JsonString *pStr; const char *z; u32 n; UNUSED_PARAM(argc); pStr = (JsonString*)sqlite3_aggregate_context(ctx, sizeof(*pStr)); if( pStr ){ if( pStr->zBuf==0 ){ jsonInit(pStr, ctx); jsonAppendChar(pStr, '{'); }else{ jsonAppendChar(pStr, ','); pStr->pCtx = ctx; } z = (const char*)sqlite3_value_text(argv[0]); n = (u32)sqlite3_value_bytes(argv[0]); jsonAppendString(pStr, z, n); jsonAppendChar(pStr, ':'); jsonAppendValue(pStr, argv[1]); } } static void jsonObjectCompute(sqlite3_context *ctx, int isFinal){ JsonString *pStr; pStr = (JsonString*)sqlite3_aggregate_context(ctx, 0); if( pStr ){ jsonAppendChar(pStr, '}'); if( pStr->bErr ){ if( pStr->bErr==1 ) sqlite3_result_error_nomem(ctx); assert( pStr->bStatic ); }else if( isFinal ){ sqlite3_result_text(ctx, pStr->zBuf, (int)pStr->nUsed, pStr->bStatic ? SQLITE_TRANSIENT : sqlite3_free); pStr->bStatic = 1; }else{ sqlite3_result_text(ctx, pStr->zBuf, (int)pStr->nUsed, SQLITE_TRANSIENT); pStr->nUsed--; } }else{ sqlite3_result_text(ctx, "{}", 2, SQLITE_STATIC); } sqlite3_result_subtype(ctx, JSON_SUBTYPE); } static void jsonObjectValue(sqlite3_context *ctx){ jsonObjectCompute(ctx, 0); } static void jsonObjectFinal(sqlite3_context *ctx){ jsonObjectCompute(ctx, 1); } #ifndef SQLITE_OMIT_VIRTUALTABLE /**************************************************************************** ** The json_each virtual table ****************************************************************************/ typedef struct JsonEachCursor JsonEachCursor; struct JsonEachCursor { sqlite3_vtab_cursor base; /* Base class - must be first */ u32 iRowid; /* The rowid */ u32 iBegin; /* The first node of the scan */ u32 i; /* Index in sParse.aNode[] of current row */ u32 iEnd; /* EOF when i equals or exceeds this value */ u8 eType; /* Type of top-level element */ u8 bRecursive; /* True for json_tree(). False for json_each() */ char *zJson; /* Input JSON */ char *zRoot; /* Path by which to filter zJson */ JsonParse sParse; /* Parse of the input JSON */ }; /* Constructor for the json_each virtual table */ static int jsonEachConnect( sqlite3 *db, void *pAux, int argc, const char *const*argv, sqlite3_vtab **ppVtab, char **pzErr ){ sqlite3_vtab *pNew; int rc; /* Column numbers */ #define JEACH_KEY 0 #define JEACH_VALUE 1 #define JEACH_TYPE 2 #define JEACH_ATOM 3 #define JEACH_ID 4 #define JEACH_PARENT 5 #define JEACH_FULLKEY 6 #define JEACH_PATH 7 /* The xBestIndex method assumes that the JSON and ROOT columns are ** the last two columns in the table. Should this ever changes, be ** sure to update the xBestIndex method. */ #define JEACH_JSON 8 #define JEACH_ROOT 9 UNUSED_PARAM(pzErr); UNUSED_PARAM(argv); UNUSED_PARAM(argc); UNUSED_PARAM(pAux); rc = sqlite3_declare_vtab(db, "CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path," "json HIDDEN,root HIDDEN)"); if( rc==SQLITE_OK ){ pNew = *ppVtab = sqlite3_malloc( sizeof(*pNew) ); if( pNew==0 ) return SQLITE_NOMEM; memset(pNew, 0, sizeof(*pNew)); } return rc; } /* destructor for json_each virtual table */ static int jsonEachDisconnect(sqlite3_vtab *pVtab){ sqlite3_free(pVtab); return SQLITE_OK; } /* constructor for a JsonEachCursor object for json_each(). */ static int jsonEachOpenEach(sqlite3_vtab *p, sqlite3_vtab_cursor **ppCursor){ JsonEachCursor *pCur; UNUSED_PARAM(p); pCur = sqlite3_malloc( sizeof(*pCur) ); if( pCur==0 ) return SQLITE_NOMEM; memset(pCur, 0, sizeof(*pCur)); *ppCursor = &pCur->base; return SQLITE_OK; } /* constructor for a JsonEachCursor object for json_tree(). */ static int jsonEachOpenTree(sqlite3_vtab *p, sqlite3_vtab_cursor **ppCursor){ int rc = jsonEachOpenEach(p, ppCursor); if( rc==SQLITE_OK ){ JsonEachCursor *pCur = (JsonEachCursor*)*ppCursor; pCur->bRecursive = 1; } return rc; } /* Reset a JsonEachCursor back to its original state. Free any memory ** held. */ static void jsonEachCursorReset(JsonEachCursor *p){ sqlite3_free(p->zJson); sqlite3_free(p->zRoot); jsonParseReset(&p->sParse); p->iRowid = 0; p->i = 0; p->iEnd = 0; p->eType = 0; p->zJson = 0; p->zRoot = 0; } /* Destructor for a jsonEachCursor object */ static int jsonEachClose(sqlite3_vtab_cursor *cur){ JsonEachCursor *p = (JsonEachCursor*)cur; jsonEachCursorReset(p); sqlite3_free(cur); return SQLITE_OK; } /* Return TRUE if the jsonEachCursor object has been advanced off the end ** of the JSON object */ static int jsonEachEof(sqlite3_vtab_cursor *cur){ JsonEachCursor *p = (JsonEachCursor*)cur; return p->i >= p->iEnd; } /* Advance the cursor to the next element for json_tree() */ static int jsonEachNext(sqlite3_vtab_cursor *cur){ JsonEachCursor *p = (JsonEachCursor*)cur; if( p->bRecursive ){ if( p->sParse.aNode[p->i].jnFlags & JNODE_LABEL ) p->i++; p->i++; p->iRowid++; if( p->i<p->iEnd ){ u32 iUp = p->sParse.aUp[p->i]; JsonNode *pUp = &p->sParse.aNode[iUp]; p->eType = pUp->eType; if( pUp->eType==JSON_ARRAY ){ if( iUp==p->i-1 ){ pUp->u.iKey = 0; }else{ pUp->u.iKey++; } } } }else{ switch( p->eType ){ case JSON_ARRAY: { p->i += jsonNodeSize(&p->sParse.aNode[p->i]); p->iRowid++; break; } case JSON_OBJECT: { p->i += 1 + jsonNodeSize(&p->sParse.aNode[p->i+1]); p->iRowid++; break; } default: { p->i = p->iEnd; break; } } } return SQLITE_OK; } /* Append the name of the path for element i to pStr */ static void jsonEachComputePath( JsonEachCursor *p, /* The cursor */ JsonString *pStr, /* Write the path here */ u32 i /* Path to this element */ ){ JsonNode *pNode, *pUp; u32 iUp; if( i==0 ){ jsonAppendChar(pStr, '$'); return; } iUp = p->sParse.aUp[i]; jsonEachComputePath(p, pStr, iUp); pNode = &p->sParse.aNode[i]; pUp = &p->sParse.aNode[iUp]; if( pUp->eType==JSON_ARRAY ){ jsonPrintf(30, pStr, "[%d]", pUp->u.iKey); }else{ assert( pUp->eType==JSON_OBJECT ); if( (pNode->jnFlags & JNODE_LABEL)==0 ) pNode--; assert( pNode->eType==JSON_STRING ); assert( pNode->jnFlags & JNODE_LABEL ); jsonPrintf(pNode->n+1, pStr, ".%.*s", pNode->n-2, pNode->u.zJContent+1); } } /* Return the value of a column */ static int jsonEachColumn( sqlite3_vtab_cursor *cur, /* The cursor */ sqlite3_context *ctx, /* First argument to sqlite3_result_...() */ int i /* Which column to return */ ){ JsonEachCursor *p = (JsonEachCursor*)cur; JsonNode *pThis = &p->sParse.aNode[p->i]; switch( i ){ case JEACH_KEY: { if( p->i==0 ) break; if( p->eType==JSON_OBJECT ){ jsonReturn(pThis, ctx, 0); }else if( p->eType==JSON_ARRAY ){ u32 iKey; if( p->bRecursive ){ if( p->iRowid==0 ) break; iKey = p->sParse.aNode[p->sParse.aUp[p->i]].u.iKey; }else{ iKey = p->iRowid; } sqlite3_result_int64(ctx, (sqlite3_int64)iKey); } break; } case JEACH_VALUE: { if( pThis->jnFlags & JNODE_LABEL ) pThis++; jsonReturn(pThis, ctx, 0); break; } case JEACH_TYPE: { if( pThis->jnFlags & JNODE_LABEL ) pThis++; sqlite3_result_text(ctx, jsonType[pThis->eType], -1, SQLITE_STATIC); break; } case JEACH_ATOM: { if( pThis->jnFlags & JNODE_LABEL ) pThis++; if( pThis->eType>=JSON_ARRAY ) break; jsonReturn(pThis, ctx, 0); break; } case JEACH_ID: { sqlite3_result_int64(ctx, (sqlite3_int64)p->i + ((pThis->jnFlags & JNODE_LABEL)!=0)); break; } case JEACH_PARENT: { if( p->i>p->iBegin && p->bRecursive ){ sqlite3_result_int64(ctx, (sqlite3_int64)p->sParse.aUp[p->i]); } break; } case JEACH_FULLKEY: { JsonString x; jsonInit(&x, ctx); if( p->bRecursive ){ jsonEachComputePath(p, &x, p->i); }else{ if( p->zRoot ){ jsonAppendRaw(&x, p->zRoot, (int)strlen(p->zRoot)); }else{ jsonAppendChar(&x, '$'); } if( p->eType==JSON_ARRAY ){ jsonPrintf(30, &x, "[%d]", p->iRowid); }else if( p->eType==JSON_OBJECT ){ jsonPrintf(pThis->n, &x, ".%.*s", pThis->n-2, pThis->u.zJContent+1); } } jsonResult(&x); break; } case JEACH_PATH: { if( p->bRecursive ){ JsonString x; jsonInit(&x, ctx); jsonEachComputePath(p, &x, p->sParse.aUp[p->i]); jsonResult(&x); break; } /* For json_each() path and root are the same so fall through ** into the root case */ } default: { const char *zRoot = p->zRoot; if( zRoot==0 ) zRoot = "$"; sqlite3_result_text(ctx, zRoot, -1, SQLITE_STATIC); break; } case JEACH_JSON: { assert( i==JEACH_JSON ); sqlite3_result_text(ctx, p->sParse.zJson, -1, SQLITE_STATIC); break; } } return SQLITE_OK; } /* Return the current rowid value */ static int jsonEachRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){ JsonEachCursor *p = (JsonEachCursor*)cur; *pRowid = p->iRowid; return SQLITE_OK; } /* The query strategy is to look for an equality constraint on the json ** column. Without such a constraint, the table cannot operate. idxNum is ** 1 if the constraint is found, 3 if the constraint and zRoot are found, ** and 0 otherwise. */ static int jsonEachBestIndex( sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo ){ int i; /* Loop counter or computed array index */ int aIdx[2]; /* Index of constraints for JSON and ROOT */ int unusableMask = 0; /* Mask of unusable JSON and ROOT constraints */ int idxMask = 0; /* Mask of usable == constraints JSON and ROOT */ const struct sqlite3_index_constraint *pConstraint; /* This implementation assumes that JSON and ROOT are the last two ** columns in the table */ assert( JEACH_ROOT == JEACH_JSON+1 ); UNUSED_PARAM(tab); aIdx[0] = aIdx[1] = -1; pConstraint = pIdxInfo->aConstraint; for(i=0; i<pIdxInfo->nConstraint; i++, pConstraint++){ int iCol; int iMask; if( pConstraint->iColumn < JEACH_JSON ) continue; iCol = pConstraint->iColumn - JEACH_JSON; assert( iCol==0 || iCol==1 ); iMask = 1 << iCol; if( pConstraint->usable==0 ){ unusableMask |= iMask; }else if( pConstraint->op==SQLITE_INDEX_CONSTRAINT_EQ ){ aIdx[iCol] = i; idxMask |= iMask; } } if( (unusableMask & ~idxMask)!=0 ){ /* If there are any unusable constraints on JSON or ROOT, then reject ** this entire plan */ return SQLITE_CONSTRAINT; } if( aIdx[0]<0 ){ /* No JSON input. Leave estimatedCost at the huge value that it was ** initialized to to discourage the query planner from selecting this ** plan. */ pIdxInfo->idxNum = 0; }else{ pIdxInfo->estimatedCost = 1.0; i = aIdx[0]; pIdxInfo->aConstraintUsage[i].argvIndex = 1; pIdxInfo->aConstraintUsage[i].omit = 1; if( aIdx[1]<0 ){ pIdxInfo->idxNum = 1; /* Only JSON supplied. Plan 1 */ }else{ i = aIdx[1]; pIdxInfo->aConstraintUsage[i].argvIndex = 2; pIdxInfo->aConstraintUsage[i].omit = 1; pIdxInfo->idxNum = 3; /* Both JSON and ROOT are supplied. Plan 3 */ } } return SQLITE_OK; } /* Start a search on a new JSON string */ static int jsonEachFilter( sqlite3_vtab_cursor *cur, int idxNum, const char *idxStr, int argc, sqlite3_value **argv ){ JsonEachCursor *p = (JsonEachCursor*)cur; const char *z; const char *zRoot = 0; sqlite3_int64 n; UNUSED_PARAM(idxStr); UNUSED_PARAM(argc); jsonEachCursorReset(p); if( idxNum==0 ) return SQLITE_OK; z = (const char*)sqlite3_value_text(argv[0]); if( z==0 ) return SQLITE_OK; n = sqlite3_value_bytes(argv[0]); p->zJson = sqlite3_malloc64( n+1 ); if( p->zJson==0 ) return SQLITE_NOMEM; memcpy(p->zJson, z, (size_t)n+1); if( jsonParse(&p->sParse, 0, p->zJson) ){ int rc = SQLITE_NOMEM; if( p->sParse.oom==0 ){ sqlite3_free(cur->pVtab->zErrMsg); cur->pVtab->zErrMsg = sqlite3_mprintf("malformed JSON"); if( cur->pVtab->zErrMsg ) rc = SQLITE_ERROR; } jsonEachCursorReset(p); return rc; }else if( p->bRecursive && jsonParseFindParents(&p->sParse) ){ jsonEachCursorReset(p); return SQLITE_NOMEM; }else{ JsonNode *pNode = 0; if( idxNum==3 ){ const char *zErr = 0; zRoot = (const char*)sqlite3_value_text(argv[1]); if( zRoot==0 ) return SQLITE_OK; n = sqlite3_value_bytes(argv[1]); p->zRoot = sqlite3_malloc64( n+1 ); if( p->zRoot==0 ) return SQLITE_NOMEM; memcpy(p->zRoot, zRoot, (size_t)n+1); if( zRoot[0]!='$' ){ zErr = zRoot; }else{ pNode = jsonLookupStep(&p->sParse, 0, p->zRoot+1, 0, &zErr); } if( zErr ){ sqlite3_free(cur->pVtab->zErrMsg); cur->pVtab->zErrMsg = jsonPathSyntaxError(zErr); jsonEachCursorReset(p); return cur->pVtab->zErrMsg ? SQLITE_ERROR : SQLITE_NOMEM; }else if( pNode==0 ){ return SQLITE_OK; } }else{ pNode = p->sParse.aNode; } p->iBegin = p->i = (int)(pNode - p->sParse.aNode); p->eType = pNode->eType; if( p->eType>=JSON_ARRAY ){ pNode->u.iKey = 0; p->iEnd = p->i + pNode->n + 1; if( p->bRecursive ){ p->eType = p->sParse.aNode[p->sParse.aUp[p->i]].eType; if( p->i>0 && (p->sParse.aNode[p->i-1].jnFlags & JNODE_LABEL)!=0 ){ p->i--; } }else{ p->i++; } }else{ p->iEnd = p->i+1; } } return SQLITE_OK; } /* The methods of the json_each virtual table */ static sqlite3_module jsonEachModule = { 0, /* iVersion */ 0, /* xCreate */ jsonEachConnect, /* xConnect */ jsonEachBestIndex, /* xBestIndex */ jsonEachDisconnect, /* xDisconnect */ 0, /* xDestroy */ jsonEachOpenEach, /* xOpen - open a cursor */ jsonEachClose, /* xClose - close a cursor */ jsonEachFilter, /* xFilter - configure scan constraints */ jsonEachNext, /* xNext - advance a cursor */ jsonEachEof, /* xEof - check for end of scan */ jsonEachColumn, /* xColumn - read data */ jsonEachRowid, /* xRowid - read data */ 0, /* xUpdate */ 0, /* xBegin */ 0, /* xSync */ 0, /* xCommit */ 0, /* xRollback */ 0, /* xFindMethod */ 0, /* xRename */ 0, /* xSavepoint */ 0, /* xRelease */ 0, /* xRollbackTo */ 0 /* xShadowName */ }; /* The methods of the json_tree virtual table. */ static sqlite3_module jsonTreeModule = { 0, /* iVersion */ 0, /* xCreate */ jsonEachConnect, /* xConnect */ jsonEachBestIndex, /* xBestIndex */ jsonEachDisconnect, /* xDisconnect */ 0, /* xDestroy */ jsonEachOpenTree, /* xOpen - open a cursor */ jsonEachClose, /* xClose - close a cursor */ jsonEachFilter, /* xFilter - configure scan constraints */ jsonEachNext, /* xNext - advance a cursor */ jsonEachEof, /* xEof - check for end of scan */ jsonEachColumn, /* xColumn - read data */ jsonEachRowid, /* xRowid - read data */ 0, /* xUpdate */ 0, /* xBegin */ 0, /* xSync */ 0, /* xCommit */ 0, /* xRollback */ 0, /* xFindMethod */ 0, /* xRename */ 0, /* xSavepoint */ 0, /* xRelease */ 0, /* xRollbackTo */ 0 /* xShadowName */ }; #endif /* SQLITE_OMIT_VIRTUALTABLE */ /**************************************************************************** ** The following routines are the only publically visible identifiers in this ** file. Call the following routines in order to register the various SQL ** functions and the virtual table implemented by this file. ****************************************************************************/ int sqlite3Json1Init(sqlite3 *db){ int rc = SQLITE_OK; unsigned int i; static const struct { const char *zName; int nArg; int flag; void (*xFunc)(sqlite3_context*,int,sqlite3_value**); } aFunc[] = { { "json", 1, 0, jsonRemoveFunc }, { "json_array", -1, 0, jsonArrayFunc }, { "json_array_length", 1, 0, jsonArrayLengthFunc }, { "json_array_length", 2, 0, jsonArrayLengthFunc }, { "json_extract", -1, 0, jsonExtractFunc }, { "json_insert", -1, 0, jsonSetFunc }, { "json_object", -1, 0, jsonObjectFunc }, { "json_patch", 2, 0, jsonPatchFunc }, { "json_quote", 1, 0, jsonQuoteFunc }, { "json_remove", -1, 0, jsonRemoveFunc }, { "json_replace", -1, 0, jsonReplaceFunc }, { "json_set", -1, 1, jsonSetFunc }, { "json_type", 1, 0, jsonTypeFunc }, { "json_type", 2, 0, jsonTypeFunc }, { "json_valid", 1, 0, jsonValidFunc }, #if SQLITE_DEBUG /* DEBUG and TESTING functions */ { "json_parse", 1, 0, jsonParseFunc }, { "json_test1", 1, 0, jsonTest1Func }, #endif }; static const struct { const char *zName; int nArg; void (*xStep)(sqlite3_context*,int,sqlite3_value**); void (*xFinal)(sqlite3_context*); void (*xValue)(sqlite3_context*); } aAgg[] = { { "json_group_array", 1, jsonArrayStep, jsonArrayFinal, jsonArrayValue }, { "json_group_object", 2, jsonObjectStep, jsonObjectFinal, jsonObjectValue }, }; #ifndef SQLITE_OMIT_VIRTUALTABLE static const struct { const char *zName; sqlite3_module *pModule; } aMod[] = { { "json_each", &jsonEachModule }, { "json_tree", &jsonTreeModule }, }; #endif for(i=0; i<sizeof(aFunc)/sizeof(aFunc[0]) && rc==SQLITE_OK; i++){ rc = sqlite3_create_function(db, aFunc[i].zName, aFunc[i].nArg, SQLITE_UTF8 | SQLITE_DETERMINISTIC, (void*)&aFunc[i].flag, aFunc[i].xFunc, 0, 0); } #ifndef SQLITE_OMIT_WINDOWFUNC for(i=0; i<sizeof(aAgg)/sizeof(aAgg[0]) && rc==SQLITE_OK; i++){ rc = sqlite3_create_window_function(db, aAgg[i].zName, aAgg[i].nArg, SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0, aAgg[i].xStep, aAgg[i].xFinal, aAgg[i].xValue, jsonGroupInverse, 0); } #endif #ifndef SQLITE_OMIT_VIRTUALTABLE for(i=0; i<sizeof(aMod)/sizeof(aMod[0]) && rc==SQLITE_OK; i++){ rc = sqlite3_create_module(db, aMod[i].zName, aMod[i].pModule, 0); } #endif return rc; } #ifndef SQLITE_CORE #ifdef _WIN32 __declspec(dllexport) #endif int sqlite3_json_init( sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi ){ SQLITE_EXTENSION_INIT2(pApi); (void)pzErrMsg; /* Unused parameter */ return sqlite3Json1Init(db); } #endif #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_JSON1) */
the_stack_data/336154.c
/* Seriál "Programovací jazyk Go" Třicátá čtvrtá část Programovací jazyk Go pro skalní céčkaře https://www.root.cz/clanky/programovaci-jazyk-go-pro-skalni-ceckare/ */ #include <stdio.h> int main(void) { int x; for (x=1; x <= 10; x++) { printf("%d\n", x); } return 0; }
the_stack_data/629845.c
#include <stdio.h> void NoDepBFunction(); void NoDepCFunction(); void SixAFunction(); void SixBFunction(); int main() { SixAFunction(); SixBFunction(); NoDepBFunction(); NoDepCFunction(); printf("Dependency test executable ran successfully.\n"); return 0; }
the_stack_data/101808.c
/* @@@@ PROGRAM NAME: knkcch06proj07.c @@@@ FLAGS: -std=c99 @@@@ PROGRAM STATEMENT: Rearrange the square3.c program so that the for loop initializes i, and increments i. Don't rewrite the program: in particular, don't use any multiplications. */ #include<stdio.h> //------------------------START OF MAIN()-------------------------------------- int main(void) { printf("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"); int i, n, odd, square; printf("This program prints a table of squares.\n"); printf("Enter number of entries in table: "); scanf("%d", &n); odd = 3; for (int i=1,square = 1; i <= n; odd += 2) { printf("%10d%10d\n", i++, square); square+=odd; } printf("\n++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"); return 0; } //-------------------------END OF MAIN()--------------------------------------- //--------------------------------------------------------------------------- /* OUTPUT: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ This program prints a table of squares. Enter number of entries in table: 15 1 1 2 4 3 9 4 16 5 25 6 36 7 49 8 64 9 81 10 100 11 121 12 144 13 169 14 196 15 225 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ //---------------------------------------------------------------------------
the_stack_data/60473.c
// RUN: %clang -E -dM %s -o - 2>&1 \ // RUN: -target wasm32-unknown-unknown -msimd128 \ // RUN: | FileCheck %s -check-prefix=SIMD128 // RUN: %clang -E -dM %s -o - 2>&1 \ // RUN: -target wasm64-unknown-unknown -msimd128 \ // RUN: | FileCheck %s -check-prefix=SIMD128 // // SIMD128:#define __wasm_simd128__ 1{{$}} // // RUN: %clang -E -dM %s -o - 2>&1 \ // RUN: -target wasm32-unknown-unknown -mcpu=mvp \ // RUN: | FileCheck %s -check-prefix=MVP // RUN: %clang -E -dM %s -o - 2>&1 \ // RUN: -target wasm64-unknown-unknown -mcpu=mvp \ // RUN: | FileCheck %s -check-prefix=MVP // // MVP-NOT:#define __wasm_simd128__ // // RUN: %clang -E -dM %s -o - 2>&1 \ // RUN: -target wasm32-unknown-unknown -mcpu=bleeding-edge \ // RUN: | FileCheck %s -check-prefix=BLEEDING_EDGE // RUN: %clang -E -dM %s -o - 2>&1 \ // RUN: -target wasm64-unknown-unknown -mcpu=bleeding-edge \ // RUN: | FileCheck %s -check-prefix=BLEEDING_EDGE // // BLEEDING_EDGE:#define __wasm_simd128__ 1{{$}} // // RUN: %clang -E -dM %s -o - 2>&1 \ // RUN: -target wasm32-unknown-unknown -mcpu=bleeding-edge -mno-simd128 \ // RUN: | FileCheck %s -check-prefix=BLEEDING_EDGE_NO_SIMD128 // RUN: %clang -E -dM %s -o - 2>&1 \ // RUN: -target wasm64-unknown-unknown -mcpu=bleeding-edge -mno-simd128 \ // RUN: | FileCheck %s -check-prefix=BLEEDING_EDGE_NO_SIMD128 // // BLEEDING_EDGE_NO_SIMD128-NOT:#define __wasm_simd128__
the_stack_data/47335.c
/******************************************************************************* * Este programa esta baseado no segundo experimento do curso sobre tempo real * do Laboratorio Embry-Riddle * * Seguem os comentarios originais: * * Experiment #2: Multi-Tasking, Measuring Drift * * Programmer: Eric Sorton * Date: 1/27/97 * For: MSE599, Special Topics Class * * Purpose: When a basic sleep call is used to determine the precise time * when an action will occur the problem of drift occurs. * The measurement of time is imprecise. Similarly, the time in * which the sleep call returns is imprecise. Over time, this * will cause the ocurrence of time to drift. Just as if a clock * loses 1 second every day, over one day, it is significant, but * over a year, it loses 365 seconds, which is over 6 minutes. * This is an example of drift. * * Proposito: Quando uma chamada básica sleep e usada para determinar o * instante exato em que alguma acao vai ocorrer, ocorre o problema * do desvio. A medicao de tempo e imprecisa. Similarmente, o tempo * que demora o retorno da chamada sleep tambem e impreciso. Ao * longo do tempo, isto ocasionara um desvio de tempo. Algo como se * um relogio perdesse um segundo a cada dia. Ao longo de um dia, * essa diferenca e insignificante, mas, ao longo de um ano, sao * perdidos 365 segundos, o que e superior a 6 minutos. Este e um * exemplo de desvio. * *******************************************************************************/ /* * Includes Necessarios, verifique se as bibliotecas no diretorio sys/ estao * lah. Caso nao estejam, verifique onde estao e altere o include */ #include <sys/time.h> /* for gettimeofday() */ #include <unistd.h> /* for gettimeofday() and fork() */ #include <stdio.h> /* for printf() */ #include <sys/types.h> /* for wait() */ #include <sys/wait.h> /* for wait() */ #include <stdlib.h> /* * NO_OF_ITERATIONS e o numero de vezes que vai se repetir o loop existente * em cada futuro processo filho. */ #define NO_OF_ITERATIONS 1000 /* * NO_OF_CHILDREN eh o numero de filhos a serem criados, cada qual responsavel * pela medida do desvio. */ #define NO_OF_CHILDREN 3 /* * SLEEP_TIME corresponde a quantidade de tempo para ficar bloqueado. */ #define SLEEP_TIME 1000 /* * MICRO_PER_SECOND define o numero de microsegundos em um segundo */ #define MICRO_PER_SECOND 1000000 /* * Programa Principal. Contem tanto o codigo para o processo pai como * o codigo dos futuros filhos */ int main( int argc, char *argv[] ) { /* * start_time e stop_time conterao o valor de tempo antes e depois * que as trocas de contexto comecem */ struct timeval start_time; struct timeval stop_time; /* * Outras variaveis importantes */ float drift; int count; int child_no; /* * Criacao dos processos filhos */ pid_t rtn = 1; for( count = 0; count < NO_OF_CHILDREN; count++ ) { if( rtn != 0 ) { rtn = fork(); } else { break; } } /* * Verifica-se rtn para determinar se o processo eh pai ou filho */ if( rtn == 0 ) { /* * Portanto, sou filho. Faco coisas de filho. */ child_no = count; /* * Primeiro, obtenho o tempo inicial. */ gettimeofday( &start_time, NULL ); /* * Este loop ocasiona a minha dormencia, de acordo com * SLEEP_TIME, tantas vezes quanto NO_OF_ITERATIONS */ for( count = 0; count < NO_OF_ITERATIONS; count++ ) { usleep(SLEEP_TIME); } /* * Paraobter o tempo final */ gettimeofday( &stop_time, NULL ); /* * Calcula-se o desvio */ drift = (float)(stop_time.tv_sec - start_time.tv_sec); drift += (stop_time.tv_usec - start_time.tv_usec)/(float)MICRO_PER_SECOND; /* * Exibe os resultados */ printf("Filho #%d -- desvio total: %.8f -- desvio medio: %.8f\n", child_no, drift - NO_OF_ITERATIONS*SLEEP_TIME/MICRO_PER_SECOND, (drift - NO_OF_ITERATIONS*SLEEP_TIME/MICRO_PER_SECOND)/NO_OF_ITERATIONS); } else { /* * Sou pai, aguardo o termino dos filhos */ for( count = 0; count < NO_OF_CHILDREN; count++ ) { wait(NULL); } } exit(0); }
the_stack_data/187642612.c
#include <stdio.h> int main(){ char O[2]; double M[12][12], soma = 0.0; scanf("%s", &O); for(int i = 0; i<12; i++){ for(int j = 0; j<12; j++){ scanf("%lf", &M[i][j]); if(j+i > 11 && i-j<0) soma += M[i][j]; } } if(O[0] == 'S') printf("%.1lf\n", soma); else if(O[0] == 'M') printf("%.1lf\n", soma/66.0); return 0; }
the_stack_data/211081663.c
#include <stdlib.h> #include <stdio.h> #include <assert.h> #define LENGTH 10 typedef struct arr { int *ptrs[LENGTH]; } arr_t; // int mutate_array(arr_t a){ // int t = rand(); // for(int i=0; i<LENGTH; i++) { // *(a.ptrs[i]) = t; // } // } int main(){ arr_t a; int xs[LENGTH]; for(int i=0; i<LENGTH; i++){ xs[i] = 0; a.ptrs[i] = &xs[0]; } // When passing an arrays to an unknown function, reachable memory should be invalidated mutate_array(a); assert(xs[0] == 0); //UNKNOWN! return 0; }
the_stack_data/748272.c
#include <stdio.h> #include <stdlib.h> #ifdef _OPENMP #include <omp.h> #else #define omp_get_thread_num() 0 #endif int main(int argc, char **argv) { int i, n=20, a[n],suma=10; if(argc < 2) { fprintf(stderr,"Falta iteraciones\n"); exit(-1); } n = atoi(argv[1]); if (n>20) {n=20; printf("n=%d",n);} for (i=0; i<n; i++) a[i] = i; #pragma omp parallel for reduction(+:suma) for (i=0; i<n; i++) suma += a[i]; printf("Tras 'parallel' suma=%d\n",suma); }
the_stack_data/126703458.c
#include<stdio.h> #include<stdlib.h> #include<unistd.h> #include<pthread.h> pthread_mutex_t forks[5]; void *philosopher(void *ip) { pthread_mutex_t *left,*right; int i=*(int *)ip; int z; printf("philosopher %d thread id %u started\n", i, pthread_self()); left=i==0?forks+4:forks+(i-1); right=forks+i; srand(i+time(NULL)); for (z=0;z<100;z++) { // usleep(rand()%10); pthread_mutex_lock(left); pthread_mutex_lock(right); printf("Philosopher %d is eating %d\n",i,z); usleep(10000); //rand()%30000+10000); printf("Philosopher %d finished eating %d\n",i,z); pthread_mutex_unlock(left); pthread_mutex_unlock(right); } return NULL; } int main() { pthread_t phils[5]; int phids[5]={0,1,2,3,4}; int i,n; for (i=0;i<5;i++) { if (pthread_mutex_init(&(forks[i]),NULL)) { perror("Creating mutex"); return(-1); } } for (i=0;i<5;i++) { if (pthread_create(&(phils[i]), NULL, philosopher, (void *) &(phids[i])) ) perror("Create failed"); } for (i=0;i<5;i++) { pthread_join(phils[i],NULL); } sleep(1); }
the_stack_data/666541.c
#include <pthread.h> #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <time.h> #include <semaphore.h> #define BUFFERSIZE 20 #define SAFE //Comment out this define to make it thread unsafe. int buffer[BUFFERSIZE]; sem_t full, empty, mutex; int counter; void* produce(void* args); void* consume(void* args); int main(int argc, char const *argv[]) { srand(time(0)); pthread_t ent1, ent2; void* result; counter = 0; sem_init(&full, 0, 0); sem_init(&empty, 0, BUFFERSIZE); sem_init(&mutex, 0, 1); pthread_create(&ent1, NULL, produce, NULL); pthread_create(&ent2, NULL, consume, NULL); pthread_join(ent1, &result); pthread_join(ent2, &result); return 0; } void* produce(void* args) { int random; int i = 0; do { random = rand() % 100; #ifdef SAFE //Wait for empty spot sem_wait(&empty); //Wait for mutex -> no dirty read on counter sem_wait(&mutex); #endif //Add produced item buffer[counter] = random; #ifdef SAFE //Singal mutex we're done sem_post(&mutex); //Signal we added an item sem_post(&full); #endif i++; } while(i < 10000); } void* consume(void* args) { int number; int i = 0; do { //Wait till an item has been added #ifdef SAFE sem_wait(&full); //Wait for mutex -> no dirty read / write on counter sem_wait(&mutex); #endif //Consume item number = buffer[counter]; //Increase counter here while in mutex counter++; counter %= BUFFERSIZE; #ifdef SAFE //Singal we're done sem_post(&mutex); //Signal an empty spot have come avaible sem_post(&empty); #endif //Do something with consumed item printf("Consumed %d\n", number); i++; } while(i < 10000); }
the_stack_data/80135.c
#include <stdio.h> #include <stdlib.h> #include <math.h> struct movimentos{ int posicaoX, posicaoY, linha, coluna, base_coordenadaX, base_coordenadaY; double movimento, distancia; }; void alocacao_de_memoria(struct movimentos *mov){ //alocar mememoria mov = (struct movimentos*) malloc(sizeof(struct movimentos)); } void instrucoes(struct movimentos *mov){ //função para receber as intruções scanf("%d %d", &mov->linha, &mov->coluna); //receber a quantia de linhas e colunas scanf("%d %d %lf", &mov->posicaoX, &mov->posicaoY, &mov->movimento); //receber as coordenadas da posição do jogador e } //a quantia de movimentos possiveis void ler_matriz(struct movimentos *mov){ //função para ler e preencher a matriz, buscar e salvar as coordenadas da base int tabuleiro[mov->linha][mov->coluna]; //variavel para ser o tabuleiro do jogo int i=0, j=0; //variavies auxiliares for (i = 0; i < mov->linha; i++) { //loop para preencher o tabuleiro for (j = 0; j < mov->coluna; j++) { scanf("%d", &tabuleiro[i][j]); } } for (i = 0; i < mov->linha; i++) { //loop para salvar as coordenadas da base for (j = 0; j < mov->coluna; j++) { if(tabuleiro[i][j] == 1) { mov->base_coordenadaX = i; mov->base_coordenadaY = j; } } } } void distancia_euclidiana(struct movimentos *mov){ //funcao para calcular a distancia euclidiana(distancia entre dois pontos) mov->distancia = (mov->posicaoX - mov->base_coordenadaX) * (mov->posicaoX - mov->base_coordenadaX); mov->distancia += (mov->posicaoY - mov->base_coordenadaY) * (mov->posicaoY - mov->base_coordenadaY); mov->distancia = sqrt(mov->distancia); //para calcular a raiz quadrada } void resultado(struct movimentos *mov){ //função para calcular e imprimir o resultado if (mov->distancia > mov->movimento) { //se a distancia entre o jogador e a base for maior que a quantia de movimentos printf("Game Over!"); //o jogador terá perdido } else { //se a distancia entre o jogador e a base for menor ou igual a quantia de movimentos printf("Voce escapou!"); //o jogador irá ganhar } } int main(){ struct movimentos *mov; mov = (struct movimentos*) malloc(sizeof(struct movimentos)); instrucoes(mov); ler_matriz(mov); distancia_euclidiana(mov); resultado(mov); free(mov); return 0; }
the_stack_data/1010270.c
// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s // RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s // expected-error@+1 {{unexpected OpenMP directive '#pragma omp target parallel for simd'}} #pragma omp target parallel for simd // expected-error@+1 {{unexpected OpenMP directive '#pragma omp target parallel for simd'}} #pragma omp target parallel for simd foo void test_no_clause() { int i; #pragma omp target parallel for simd for (i = 0; i < 16; ++i) ; // expected-error@+2 {{statement after '#pragma omp target parallel for simd' must be a for loop}} #pragma omp target parallel for simd ++i; } void test_branch_protected_scope() { int i = 0; L1: ++i; int x[24]; #pragma omp target parallel for simd for (i = 0; i < 16; ++i) { if (i == 5) goto L1; // expected-error {{use of undeclared label 'L1'}} else if (i == 6) return; // expected-error {{cannot return from OpenMP region}} else if (i == 7) goto L2; else if (i == 8) { L2: x[i]++; } } if (x[0] == 0) goto L2; // expected-error {{use of undeclared label 'L2'}} else if (x[1] == 1) goto L1; } void test_invalid_clause() { int i; // expected-warning@+1 {{extra tokens at the end of '#pragma omp target parallel for simd' are ignored}} #pragma omp target parallel for simd foo bar for (i = 0; i < 16; ++i) ; } void test_non_identifiers() { int i, x; // expected-warning@+1 {{extra tokens at the end of '#pragma omp target parallel for simd' are ignored}} #pragma omp target parallel for simd; for (i = 0; i < 16; ++i) ; // expected-warning@+1 {{extra tokens at the end of '#pragma omp target parallel for simd' are ignored}} #pragma omp target parallel for simd private(x); for (i = 0; i < 16; ++i) ; // expected-warning@+1 {{extra tokens at the end of '#pragma omp target parallel for simd' are ignored}} #pragma omp target parallel for simd, private(x); for (i = 0; i < 16; ++i) ; } extern int foo(); void test_collapse() { int i; // expected-error@+1 {{expected '('}} #pragma omp target parallel for simd collapse for (i = 0; i < 16; ++i) ; // expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}} #pragma omp target parallel for simd collapse( for (i = 0; i < 16; ++i) ; // expected-error@+1 {{expected expression}} #pragma omp target parallel for simd collapse() for (i = 0; i < 16; ++i) ; // expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}} #pragma omp target parallel for simd collapse(, for (i = 0; i < 16; ++i) ; // expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}} #pragma omp target parallel for simd collapse(, ) for (i = 0; i < 16; ++i) ; // expected-warning@+2 {{extra tokens at the end of '#pragma omp target parallel for simd' are ignored}} // expected-error@+1 {{expected '('}} #pragma omp target parallel for simd collapse 4) for (i = 0; i < 16; ++i) ; // expected-error@+2 {{expected ')'}} // expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}} #pragma omp target parallel for simd collapse(4 for (i = 0; i < 16; ++i) ; // expected-error {{expected 4 for loops after '#pragma omp target parallel for simd', but found only 1}} // expected-error@+2 {{expected ')'}} // expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}} #pragma omp target parallel for simd collapse(4, for (i = 0; i < 16; ++i) ; // expected-error {{expected 4 for loops after '#pragma omp target parallel for simd', but found only 1}} // expected-error@+2 {{expected ')'}} // expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}} #pragma omp target parallel for simd collapse(4, ) for (i = 0; i < 16; ++i) ; // expected-error {{expected 4 for loops after '#pragma omp target parallel for simd', but found only 1}} // expected-note@+1 {{as specified in 'collapse' clause}} #pragma omp target parallel for simd collapse(4) for (i = 0; i < 16; ++i) ; // expected-error {{expected 4 for loops after '#pragma omp target parallel for simd', but found only 1}} // expected-error@+2 {{expected ')'}} // expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}} #pragma omp target parallel for simd collapse(4 4) for (i = 0; i < 16; ++i) ; // expected-error {{expected 4 for loops after '#pragma omp target parallel for simd', but found only 1}} // expected-error@+2 {{expected ')'}} // expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}} #pragma omp target parallel for simd collapse(4, , 4) for (i = 0; i < 16; ++i) ; // expected-error {{expected 4 for loops after '#pragma omp target parallel for simd', but found only 1}} #pragma omp target parallel for simd collapse(4) for (int i1 = 0; i1 < 16; ++i1) for (int i2 = 0; i2 < 16; ++i2) for (int i3 = 0; i3 < 16; ++i3) for (int i4 = 0; i4 < 16; ++i4) foo(); // expected-error@+2 {{expected ')'}} // expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}} #pragma omp target parallel for simd collapse(4, 8) for (i = 0; i < 16; ++i) ; // expected-error {{expected 4 for loops after '#pragma omp target parallel for simd', but found only 1}} // expected-error@+1 {{expression is not an integer constant expression}} #pragma omp target parallel for simd collapse(2.5) for (i = 0; i < 16; ++i) ; // expected-error@+1 {{expression is not an integer constant expression}} #pragma omp target parallel for simd collapse(foo()) for (i = 0; i < 16; ++i) ; // expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp target parallel for simd collapse(-5) for (i = 0; i < 16; ++i) ; // expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp target parallel for simd collapse(0) for (i = 0; i < 16; ++i) ; // expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp target parallel for simd collapse(5 - 5) for (i = 0; i < 16; ++i) ; // expected-note@+1 {{defined as firstprivate}} #pragma omp target parallel for simd collapse(2) firstprivate(i) for (i = 0; i < 16; ++i) // expected-note@+1 {{variable with automatic storage duration is predetermined as private; perhaps you forget to enclose 'omp for' directive into a parallel or another task region?}} for (int j = 0; j < 16; ++j) // expected-error@+2 2 {{reduction variable must be shared}} // expected-error@+1 {{OpenMP constructs may not be nested inside a simd region}} #pragma omp for reduction(+ : i, j) for (int k = 0; k < 16; ++k) i += j; } void test_private() { int i; // expected-error@+2 {{expected expression}} // expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}} #pragma omp target parallel for simd private( for (i = 0; i < 16; ++i) ; // expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}} // expected-error@+1 2 {{expected expression}} #pragma omp target parallel for simd private(, for (i = 0; i < 16; ++i) ; // expected-error@+1 2 {{expected expression}} #pragma omp target parallel for simd private(, ) for (i = 0; i < 16; ++i) ; // expected-error@+1 {{expected expression}} #pragma omp target parallel for simd private() for (i = 0; i < 16; ++i) ; // expected-error@+1 {{expected expression}} #pragma omp target parallel for simd private(int) for (i = 0; i < 16; ++i) ; // expected-error@+1 {{expected variable name}} #pragma omp target parallel for simd private(0) for (i = 0; i < 16; ++i) ; int x, y, z; #pragma omp target parallel for simd private(x) for (i = 0; i < 16; ++i) ; #pragma omp target parallel for simd private(x, y) for (i = 0; i < 16; ++i) ; #pragma omp target parallel for simd private(x, y, z) for (i = 0; i < 16; ++i) { x = y * i + z; } } void test_lastprivate() { int i; // expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}} // expected-error@+1 {{expected expression}} #pragma omp target parallel for simd lastprivate( for (i = 0; i < 16; ++i) ; // expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}} // expected-error@+1 2 {{expected expression}} #pragma omp target parallel for simd lastprivate(, for (i = 0; i < 16; ++i) ; // expected-error@+1 2 {{expected expression}} #pragma omp target parallel for simd lastprivate(, ) for (i = 0; i < 16; ++i) ; // expected-error@+1 {{expected expression}} #pragma omp target parallel for simd lastprivate() for (i = 0; i < 16; ++i) ; // expected-error@+1 {{expected expression}} #pragma omp target parallel for simd lastprivate(int) for (i = 0; i < 16; ++i) ; // expected-error@+1 {{expected variable name}} #pragma omp target parallel for simd lastprivate(0) for (i = 0; i < 16; ++i) ; int x, y, z; #pragma omp target parallel for simd lastprivate(x) for (i = 0; i < 16; ++i) ; #pragma omp target parallel for simd lastprivate(x, y) for (i = 0; i < 16; ++i) ; #pragma omp target parallel for simd lastprivate(x, y, z) for (i = 0; i < 16; ++i) ; } void test_firstprivate() { int i; // expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}} // expected-error@+1 {{expected expression}} #pragma omp target parallel for simd firstprivate( for (i = 0; i < 16; ++i) ; // expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}} // expected-error@+1 2 {{expected expression}} #pragma omp target parallel for simd firstprivate(, for (i = 0; i < 16; ++i) ; // expected-error@+1 2 {{expected expression}} #pragma omp target parallel for simd firstprivate(, ) for (i = 0; i < 16; ++i) ; // expected-error@+1 {{expected expression}} #pragma omp target parallel for simd firstprivate() for (i = 0; i < 16; ++i) ; // expected-error@+1 {{expected expression}} #pragma omp target parallel for simd firstprivate(int) for (i = 0; i < 16; ++i) ; // expected-error@+1 {{expected variable name}} #pragma omp target parallel for simd firstprivate(0) for (i = 0; i < 16; ++i) ; int x, y, z; #pragma omp target parallel for simd lastprivate(x) firstprivate(x) for (i = 0; i < 16; ++i) ; #pragma omp target parallel for simd lastprivate(x, y) firstprivate(x, y) for (i = 0; i < 16; ++i) ; #pragma omp target parallel for simd lastprivate(x, y, z) firstprivate(x, y, z) for (i = 0; i < 16; ++i) ; } void test_loop_messages() { float a[100], b[100], c[100]; // expected-error@+2 {{variable must be of integer or pointer type}} #pragma omp target parallel for simd for (float fi = 0; fi < 10.0; fi++) { c[(int)fi] = a[(int)fi] + b[(int)fi]; } // expected-error@+2 {{variable must be of integer or pointer type}} #pragma omp target parallel for simd for (double fi = 0; fi < 10.0; fi++) { c[(int)fi] = a[(int)fi] + b[(int)fi]; } } void test_safelen() { int i; // expected-error@+1 {{expected '('}} #pragma omp target parallel for simd safelen for (i = 0; i < 16; ++i) ; // expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}} #pragma omp target parallel for simd safelen( for (i = 0; i < 16; ++i) ; // expected-error@+1 {{expected expression}} #pragma omp target parallel for simd safelen() for (i = 0; i < 16; ++i) ; // expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}} #pragma omp target parallel for simd safelen(, for (i = 0; i < 16; ++i) ; // expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}} #pragma omp target parallel for simd safelen(, ) for (i = 0; i < 16; ++i) ; // expected-warning@+2 {{extra tokens at the end of '#pragma omp target parallel for simd' are ignored}} // expected-error@+1 {{expected '('}} #pragma omp target parallel for simd safelen 4) for (i = 0; i < 16; ++i) ; // expected-error@+2 {{expected ')'}} // expected-note@+1 {{to match this '('}} #pragma omp target parallel for simd safelen(4 for (i = 0; i < 16; ++i) ; // expected-error@+2 {{expected ')'}} // expected-note@+1 {{to match this '('}} #pragma omp target parallel for simd safelen(4, for (i = 0; i < 16; ++i) ; // expected-error@+2 {{expected ')'}} // expected-note@+1 {{to match this '('}} #pragma omp target parallel for simd safelen(4, ) for (i = 0; i < 16; ++i) ; #pragma omp target parallel for simd safelen(4) for (i = 0; i < 16; ++i) ; // expected-error@+2 {{expected ')'}} // expected-note@+1 {{to match this '('}} #pragma omp target parallel for simd safelen(4 4) for (i = 0; i < 16; ++i) ; // expected-error@+2 {{expected ')'}} // expected-note@+1 {{to match this '('}} #pragma omp target parallel for simd safelen(4, , 4) for (i = 0; i < 16; ++i) ; #pragma omp target parallel for simd safelen(4) for (i = 0; i < 16; ++i) ; // expected-error@+2 {{expected ')'}} // expected-note@+1 {{to match this '('}} #pragma omp target parallel for simd safelen(4, 8) for (i = 0; i < 16; ++i) ; // expected-error@+1 {{expression is not an integer constant expression}} #pragma omp target parallel for simd safelen(2.5) for (i = 0; i < 16; ++i) ; // expected-error@+1 {{expression is not an integer constant expression}} #pragma omp target parallel for simd safelen(foo()) for (i = 0; i < 16; ++i) ; // expected-error@+1 {{argument to 'safelen' clause must be a strictly positive integer value}} #pragma omp target parallel for simd safelen(-5) for (i = 0; i < 16; ++i) ; // expected-error@+1 {{argument to 'safelen' clause must be a strictly positive integer value}} #pragma omp target parallel for simd safelen(0) for (i = 0; i < 16; ++i) ; // expected-error@+1 {{argument to 'safelen' clause must be a strictly positive integer value}} #pragma omp target parallel for simd safelen(5 - 5) for (i = 0; i < 16; ++i) ; } void test_simdlen() { int i; // expected-error@+1 {{expected '('}} #pragma omp target parallel for simd simdlen for (i = 0; i < 16; ++i) ; // expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}} #pragma omp target parallel for simd simdlen( for (i = 0; i < 16; ++i) ; // expected-error@+1 {{expected expression}} #pragma omp target parallel for simd simdlen() for (i = 0; i < 16; ++i) ; // expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}} #pragma omp target parallel for simd simdlen(, for (i = 0; i < 16; ++i) ; // expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}} #pragma omp target parallel for simd simdlen(, ) for (i = 0; i < 16; ++i) ; // expected-warning@+2 {{extra tokens at the end of '#pragma omp target parallel for simd' are ignored}} // expected-error@+1 {{expected '('}} #pragma omp target parallel for simd simdlen 4) for (i = 0; i < 16; ++i) ; // expected-error@+2 {{expected ')'}} // expected-note@+1 {{to match this '('}} #pragma omp target parallel for simd simdlen(4 for (i = 0; i < 16; ++i) ; // expected-error@+2 {{expected ')'}} // expected-note@+1 {{to match this '('}} #pragma omp target parallel for simd simdlen(4, for (i = 0; i < 16; ++i) ; // expected-error@+2 {{expected ')'}} // expected-note@+1 {{to match this '('}} #pragma omp target parallel for simd simdlen(4, ) for (i = 0; i < 16; ++i) ; #pragma omp target parallel for simd simdlen(4) for (i = 0; i < 16; ++i) ; // expected-error@+2 {{expected ')'}} // expected-note@+1 {{to match this '('}} #pragma omp target parallel for simd simdlen(4 4) for (i = 0; i < 16; ++i) ; // expected-error@+2 {{expected ')'}} // expected-note@+1 {{to match this '('}} #pragma omp target parallel for simd simdlen(4, , 4) for (i = 0; i < 16; ++i) ; #pragma omp target parallel for simd simdlen(4) for (i = 0; i < 16; ++i) ; // expected-error@+2 {{expected ')'}} // expected-note@+1 {{to match this '('}} #pragma omp target parallel for simd simdlen(4, 8) for (i = 0; i < 16; ++i) ; // expected-error@+1 {{expression is not an integer constant expression}} #pragma omp target parallel for simd simdlen(2.5) for (i = 0; i < 16; ++i) ; // expected-error@+1 {{expression is not an integer constant expression}} #pragma omp target parallel for simd simdlen(foo()) for (i = 0; i < 16; ++i) ; // expected-error@+1 {{argument to 'simdlen' clause must be a strictly positive integer value}} #pragma omp target parallel for simd simdlen(-5) for (i = 0; i < 16; ++i) ; // expected-error@+1 {{argument to 'simdlen' clause must be a strictly positive integer value}} #pragma omp target parallel for simd simdlen(0) for (i = 0; i < 16; ++i) ; // expected-error@+1 {{argument to 'simdlen' clause must be a strictly positive integer value}} #pragma omp target parallel for simd simdlen(5 - 5) for (i = 0; i < 16; ++i) ; } void test_safelen_simdlen() { int i; // expected-error@+1 {{the value of 'simdlen' parameter must be less than or equal to the value of the 'safelen' parameter}} #pragma omp target parallel for simd simdlen(6) safelen(5) for (i = 0; i < 16; ++i) ; // expected-error@+1 {{the value of 'simdlen' parameter must be less than or equal to the value of the 'safelen' parameter}} #pragma omp target parallel for simd safelen(5) simdlen(6) for (i = 0; i < 16; ++i) ; }
the_stack_data/20961.c
// Luke Harrison // 06/06/10 #include <stdio.h> #include <stdlib.h> #define TRUE 1 #define FALSE 0 #define MAX 1000000000 int numRounds; void handleCase (FILE *input, FILE *output); int howManyCanMiss[5000]; int costs[5000]; int updateTree (int toUpdate, int value, int nodeStart, int nodeEnd, int place); int findCost (int currentMinus, int nodeStart, int nodeEnd, int place); int min (int n1, int n2); int max (int n1, int n2); int main () { FILE *input = fopen ("input.txt", "r"); FILE *output = fopen ("output.txt", "w"); int i; int numCases; fscanf (input, "%d ", &numCases); for (i = 1; i <= numCases; i++) { fprintf (output, "Case #%d: ", i); handleCase (input, output); //printf ("\n"); } return 0; } void handleCase (FILE *input, FILE *output) { int i, j; fscanf (input, "%d ", &numRounds); for (i = 0; i < 5000; i++) { howManyCanMiss[i] = MAX; } int upTo = 1 << (numRounds); int value; for (i = 0; i < upTo; i++) { fscanf (input, "%d ", &value); updateTree (i, value, 0, upTo - 1, 1); } int cost; for (i = 0; i < numRounds; i++) { upTo = 1 << (numRounds - i - 1); for (j = 0; j < upTo; j++) { fscanf (input, "%d ", &cost); costs[upTo + j] = cost; } } upTo = 1 << (numRounds); fprintf (output, "%d\n", findCost (0, 0, upTo - 1, 1)); } int updateTree (int toUpdate, int value, int nodeStart, int nodeEnd, int place) { if (nodeStart == nodeEnd) { howManyCanMiss[place] = value; return value; } int midPoint = (nodeStart + nodeEnd) / 2; int minLeft; int minRight; if (toUpdate <= midPoint) { minLeft = updateTree (toUpdate, value, nodeStart, midPoint, place * 2); } else { minLeft = howManyCanMiss[place * 2]; } if (toUpdate > midPoint) { minRight = updateTree (toUpdate, value, midPoint + 1, nodeEnd, (place * 2) + 1); } else { minRight = howManyCanMiss[(place * 2) + 1]; } howManyCanMiss[place] = min (minLeft, minRight); return howManyCanMiss[place]; } int min (int n1, int n2) { if (n1 < n2) { return n1; } else { return n2; } } int max (int n1, int n2) { if (n1 > n2) { return n1; } else { return n2; } } int findCost (int currentMinus, int nodeStart, int nodeEnd, int place) { //printf ("Checking %d %d %d %d %d\n", currentMinus, nodeStart, nodeEnd, place, howManyCanMiss[place]); int totalCost = 0; int bestCost = 0; int midPoint = (nodeStart + nodeEnd) / 2; if (nodeStart == nodeEnd) { return 0; } if (howManyCanMiss[place] + currentMinus > 0) { //printf ("Need %d %d\n", place, costs[place]); totalCost += findCost (currentMinus - 1, nodeStart, midPoint, place * 2); totalCost += findCost (currentMinus - 1, midPoint + 1, nodeEnd, (place * 2) + 1); bestCost = totalCost; } else { bestCost = -1; } totalCost = 0; totalCost += findCost (currentMinus, nodeStart, midPoint, place * 2); totalCost += findCost (currentMinus, midPoint + 1, nodeEnd, (place * 2) + 1); totalCost += costs[place]; if (bestCost == -1) { bestCost = totalCost; } else { bestCost = min (bestCost, totalCost); } return bestCost; }
the_stack_data/148576807.c
/*Exercise 3 - Repetition Write a C program to calculate the sum of the numbers from 1 to n. Where n is a keyboard input. e.g. n -> 100 sum = 1+2+3+....+ 99+100 = 5050 n -> 1- sum = 1+2+3+...+10 = 55 */ #include <stdio.h> int main() { //declare variable int num , i , total = 0; //get input from user printf("Enter the number = "); scanf("%d",&num); //calculation for(i=1 ; i <= num ; i++) { total += i ; } //output printf("The total is %d",total); return 0; }
the_stack_data/22013063.c
// // Created by brok1n on 16-5-27. // #include <stdio.h> int toLower( int c ); int toUpper( int c ); /** * 在不使用运算符&&或||的条件下编写一个与上面的 for 循环语句等价的循环语句。 * for (i=0; i<lim-1 && (c=getchar()) != '\n' && c != EOF; ++i) s[i] = c; * */ void main() { int i, lim; i = 0; lim = 1024; char c; char s[lim]; for (i=0; i<lim-1; ++i) { if( ( c = getchar() ) != '\n' ) if( c != EOF ) s[i] = c; } printf("%s\n", s); char CC = 'C'; char cc = toLower( CC ); printf("%c\n", cc); char dd = 'd'; char DD = toUpper(dd); printf("%c\n", DD); } int toLower( int c ) { if( c >= 'A' && c <= 'Z' ) return c + 32; return c; } int toUpper( int c ) { if( c >= 'a' && c <= 'z' ) return c - 32; return c; }
the_stack_data/1078832.c
#include <stdio.h> int main(void){ printf("c:\\backup\\texto\\novo\\arq.txt\n"); return 0; }
the_stack_data/48323.c
#include <stdio.h> #include <string.h> #include <stdlib.h> /* * Strips spaces from both the front and back of a string, * leaving any internal spaces alone. */ char* strip(char* str) { int size; int num_spaces; int first_non_space, last_non_space, i; char* result; size = strlen(str); // This counts the number of leading and trailing spaces // so we can figure out how big the result array should be. num_spaces = 0; first_non_space = 0; while (first_non_space<size && str[first_non_space] == ' ') { ++num_spaces; ++first_non_space; } last_non_space = size-1; while (last_non_space>=0 && str[last_non_space] == ' ') { ++num_spaces; --last_non_space; } // If num_spaces >= size then that means that the string // consisted of nothing but spaces, so we'll return the // empty string. if (num_spaces >= size) { return ""; } // Allocate a slot for all the "saved" characters // plus one extra for the null terminator. result = calloc(size-num_spaces+1, sizeof(char)); // Copy in the "saved" characters. for (i=first_non_space; i<=last_non_space; ++i) { result[i-first_non_space] = str[i]; } // Place the null terminator at the end of the result string. result[i-first_non_space] = '\0'; return result; } /* * Return true (1) if the given string is "clean", i.e., has * no spaces at the front or the back of the string. */ int is_clean(char* str) { char* cleaned; int result; // We check if it's clean by calling strip and seeing if the // result is the same as the original string. cleaned = strip(str); // strcmp compares two strings, returning a negative value if // the first is less than the second (in alphabetical order), // 0 if they're equal, and a positive value if the first is // greater than the second. result = strcmp(str, cleaned); if (strcmp(cleaned, "") != 0) { free(cleaned); } return result == 0; } int main() { int i; int NUM_STRINGS = 7; // Makes an array of 7 string constants for testing. char* strings[] = { "Morris", " stuff", "Minnesota", "nonsense ", "USA", " ", " silliness " }; for (i=0; i<NUM_STRINGS; ++i) { if (is_clean(strings[i])) { printf("The string '%s' is clean.\n", strings[i]); } else { printf("The string '%s' is NOT clean.\n", strings[i]); } } return 0; }
the_stack_data/140692.c
/* Capstone Disassembly Engine */ /* By Nguyen Anh Quynh <[email protected]>, 2013-2014 */ #ifdef CAPSTONE_HAS_POWERPC #include <stdio.h> // debug #include <string.h> #include "../../utils.h" #include "PPCMapping.h" #define GET_INSTRINFO_ENUM #include "PPCGenInstrInfo.inc" #ifndef CAPSTONE_DIET static name_map reg_name_maps[] = { { PPC_REG_INVALID, NULL }, { PPC_REG_CARRY, "ca" }, { PPC_REG_CC, "cc"}, { PPC_REG_CR0, "cr0" }, { PPC_REG_CR1, "cr1" }, { PPC_REG_CR2, "cr2" }, { PPC_REG_CR3, "cr3" }, { PPC_REG_CR4, "cr4" }, { PPC_REG_CR5, "cr5" }, { PPC_REG_CR6, "cr6" }, { PPC_REG_CR7, "cr7" }, { PPC_REG_CTR, "ctr" }, { PPC_REG_F0, "f0" }, { PPC_REG_F1, "f1" }, { PPC_REG_F2, "f2" }, { PPC_REG_F3, "f3" }, { PPC_REG_F4, "f4" }, { PPC_REG_F5, "f5" }, { PPC_REG_F6, "f6" }, { PPC_REG_F7, "f7" }, { PPC_REG_F8, "f8" }, { PPC_REG_F9, "f9" }, { PPC_REG_F10, "f10" }, { PPC_REG_F11, "f11" }, { PPC_REG_F12, "f12" }, { PPC_REG_F13, "f13" }, { PPC_REG_F14, "f14" }, { PPC_REG_F15, "f15" }, { PPC_REG_F16, "f16" }, { PPC_REG_F17, "f17" }, { PPC_REG_F18, "f18" }, { PPC_REG_F19, "f19" }, { PPC_REG_F20, "f20" }, { PPC_REG_F21, "f21" }, { PPC_REG_F22, "f22" }, { PPC_REG_F23, "f23" }, { PPC_REG_F24, "f24" }, { PPC_REG_F25, "f25" }, { PPC_REG_F26, "f26" }, { PPC_REG_F27, "f27" }, { PPC_REG_F28, "f28" }, { PPC_REG_F29, "f29" }, { PPC_REG_F30, "f30" }, { PPC_REG_F31, "f31" }, { PPC_REG_LR, "lr" }, { PPC_REG_R0, "r0" }, { PPC_REG_R1, "r1" }, { PPC_REG_R2, "r2" }, { PPC_REG_R3, "r3" }, { PPC_REG_R4, "r4" }, { PPC_REG_R5, "r5" }, { PPC_REG_R6, "r6" }, { PPC_REG_R7, "r7" }, { PPC_REG_R8, "r8" }, { PPC_REG_R9, "r9" }, { PPC_REG_R10, "r10" }, { PPC_REG_R11, "r11" }, { PPC_REG_R12, "r12" }, { PPC_REG_R13, "r13" }, { PPC_REG_R14, "r14" }, { PPC_REG_R15, "r15" }, { PPC_REG_R16, "r16" }, { PPC_REG_R17, "r17" }, { PPC_REG_R18, "r18" }, { PPC_REG_R19, "r19" }, { PPC_REG_R20, "r20" }, { PPC_REG_R21, "r21" }, { PPC_REG_R22, "r22" }, { PPC_REG_R23, "r23" }, { PPC_REG_R24, "r24" }, { PPC_REG_R25, "r25" }, { PPC_REG_R26, "r26" }, { PPC_REG_R27, "r27" }, { PPC_REG_R28, "r28" }, { PPC_REG_R29, "r29" }, { PPC_REG_R30, "r30" }, { PPC_REG_R31, "r31" }, { PPC_REG_V0, "v0" }, { PPC_REG_V1, "v1" }, { PPC_REG_V2, "v2" }, { PPC_REG_V3, "v3" }, { PPC_REG_V4, "v4" }, { PPC_REG_V5, "v5" }, { PPC_REG_V6, "v6" }, { PPC_REG_V7, "v7" }, { PPC_REG_V8, "v8" }, { PPC_REG_V9, "v9" }, { PPC_REG_V10, "v10" }, { PPC_REG_V11, "v11" }, { PPC_REG_V12, "v12" }, { PPC_REG_V13, "v13" }, { PPC_REG_V14, "v14" }, { PPC_REG_V15, "v15" }, { PPC_REG_V16, "v16" }, { PPC_REG_V17, "v17" }, { PPC_REG_V18, "v18" }, { PPC_REG_V19, "v19" }, { PPC_REG_V20, "v20" }, { PPC_REG_V21, "v21" }, { PPC_REG_V22, "v22" }, { PPC_REG_V23, "v23" }, { PPC_REG_V24, "v24" }, { PPC_REG_V25, "v25" }, { PPC_REG_V26, "v26" }, { PPC_REG_V27, "v27" }, { PPC_REG_V28, "v28" }, { PPC_REG_V29, "v29" }, { PPC_REG_V30, "v30" }, { PPC_REG_V31, "v31" }, { PPC_REG_VRSAVE, "vrsave" }, { PPC_REG_VS0, "vs0"}, { PPC_REG_VS1, "vs1"}, { PPC_REG_VS2, "vs2"}, { PPC_REG_VS3, "vs3"}, { PPC_REG_VS4, "vs4"}, { PPC_REG_VS5, "vs5"}, { PPC_REG_VS6, "vs6"}, { PPC_REG_VS7, "vs7"}, { PPC_REG_VS8, "vs8"}, { PPC_REG_VS9, "vs9"}, { PPC_REG_VS10, "vs10"}, { PPC_REG_VS11, "vs11"}, { PPC_REG_VS12, "vs12"}, { PPC_REG_VS13, "vs13"}, { PPC_REG_VS14, "vs14"}, { PPC_REG_VS15, "vs15"}, { PPC_REG_VS16, "vs16"}, { PPC_REG_VS17, "vs17"}, { PPC_REG_VS18, "vs18"}, { PPC_REG_VS19, "vs19"}, { PPC_REG_VS20, "vs20"}, { PPC_REG_VS21, "vs21"}, { PPC_REG_VS22, "vs22"}, { PPC_REG_VS23, "vs23"}, { PPC_REG_VS24, "vs24"}, { PPC_REG_VS25, "vs25"}, { PPC_REG_VS26, "vs26"}, { PPC_REG_VS27, "vs27"}, { PPC_REG_VS28, "vs28"}, { PPC_REG_VS29, "vs29"}, { PPC_REG_VS30, "vs30"}, { PPC_REG_VS31, "vs31"}, { PPC_REG_VS32, "vs32"}, { PPC_REG_VS33, "vs33"}, { PPC_REG_VS34, "vs34"}, { PPC_REG_VS35, "vs35"}, { PPC_REG_VS36, "vs36"}, { PPC_REG_VS37, "vs37"}, { PPC_REG_VS38, "vs38"}, { PPC_REG_VS39, "vs39"}, { PPC_REG_VS40, "vs40"}, { PPC_REG_VS41, "vs41"}, { PPC_REG_VS42, "vs42"}, { PPC_REG_VS43, "vs43"}, { PPC_REG_VS44, "vs44"}, { PPC_REG_VS45, "vs45"}, { PPC_REG_VS46, "vs46"}, { PPC_REG_VS47, "vs47"}, { PPC_REG_VS48, "vs48"}, { PPC_REG_VS49, "vs49"}, { PPC_REG_VS50, "vs50"}, { PPC_REG_VS51, "vs51"}, { PPC_REG_VS52, "vs52"}, { PPC_REG_VS53, "vs53"}, { PPC_REG_VS54, "vs54"}, { PPC_REG_VS55, "vs55"}, { PPC_REG_VS56, "vs56"}, { PPC_REG_VS57, "vs57"}, { PPC_REG_VS58, "vs58"}, { PPC_REG_VS59, "vs59"}, { PPC_REG_VS60, "vs60"}, { PPC_REG_VS61, "vs61"}, { PPC_REG_VS62, "vs62"}, { PPC_REG_VS63, "vs63"}, // extras { PPC_REG_RM, "rm" }, { PPC_REG_CTR8, "ctr8" }, { PPC_REG_LR8, "lr8" }, { PPC_REG_CR1EQ, "cr1eq" }, }; #endif const char *PPC_reg_name(csh handle, unsigned int reg) { #ifndef CAPSTONE_DIET if (reg >= PPC_REG_ENDING) return NULL; return reg_name_maps[reg].name; #else return NULL; #endif } static insn_map insns[] = { // dummy item { 0, 0, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_ADD4, PPC_INS_ADD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_ADD4TLS, PPC_INS_ADD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_ADD4o, PPC_INS_ADD, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_ADD8, PPC_INS_ADD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_ADD8TLS, PPC_INS_ADD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_ADD8TLS_, PPC_INS_ADD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_ADD8o, PPC_INS_ADD, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_ADDC, PPC_INS_ADDC, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CARRY, 0 }, { 0 }, 0, 0 #endif }, { PPC_ADDC8, PPC_INS_ADDC, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CARRY, 0 }, { 0 }, 0, 0 #endif }, { PPC_ADDC8o, PPC_INS_ADDC, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CARRY, PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_ADDCo, PPC_INS_ADDC, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CARRY, PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_ADDE, PPC_INS_ADDE, #ifndef CAPSTONE_DIET { PPC_REG_CARRY, 0 }, { PPC_REG_CARRY, 0 }, { 0 }, 0, 0 #endif }, { PPC_ADDE8, PPC_INS_ADDE, #ifndef CAPSTONE_DIET { PPC_REG_CARRY, 0 }, { PPC_REG_CARRY, 0 }, { 0 }, 0, 0 #endif }, { PPC_ADDE8o, PPC_INS_ADDE, #ifndef CAPSTONE_DIET { PPC_REG_CARRY, 0 }, { PPC_REG_CARRY, PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_ADDEo, PPC_INS_ADDE, #ifndef CAPSTONE_DIET { PPC_REG_CARRY, 0 }, { PPC_REG_CARRY, PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_ADDI, PPC_INS_ADDI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_ADDI8, PPC_INS_ADDI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_ADDIC, PPC_INS_ADDIC, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CARRY, 0 }, { 0 }, 0, 0 #endif }, { PPC_ADDIC8, PPC_INS_ADDIC, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CARRY, 0 }, { 0 }, 0, 0 #endif }, { PPC_ADDICo, PPC_INS_ADDIC, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CARRY, PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_ADDIS, PPC_INS_ADDIS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_ADDIS8, PPC_INS_ADDIS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_ADDME, PPC_INS_ADDME, #ifndef CAPSTONE_DIET { PPC_REG_CARRY, 0 }, { PPC_REG_CARRY, 0 }, { 0 }, 0, 0 #endif }, { PPC_ADDME8, PPC_INS_ADDME, #ifndef CAPSTONE_DIET { PPC_REG_CARRY, 0 }, { PPC_REG_CARRY, 0 }, { 0 }, 0, 0 #endif }, { PPC_ADDME8o, PPC_INS_ADDME, #ifndef CAPSTONE_DIET { PPC_REG_CARRY, 0 }, { PPC_REG_CARRY, PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_ADDMEo, PPC_INS_ADDME, #ifndef CAPSTONE_DIET { PPC_REG_CARRY, 0 }, { PPC_REG_CARRY, PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_ADDZE, PPC_INS_ADDZE, #ifndef CAPSTONE_DIET { PPC_REG_CARRY, 0 }, { PPC_REG_CARRY, 0 }, { 0 }, 0, 0 #endif }, { PPC_ADDZE8, PPC_INS_ADDZE, #ifndef CAPSTONE_DIET { PPC_REG_CARRY, 0 }, { PPC_REG_CARRY, 0 }, { 0 }, 0, 0 #endif }, { PPC_ADDZE8o, PPC_INS_ADDZE, #ifndef CAPSTONE_DIET { PPC_REG_CARRY, 0 }, { PPC_REG_CARRY, PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_ADDZEo, PPC_INS_ADDZE, #ifndef CAPSTONE_DIET { PPC_REG_CARRY, 0 }, { PPC_REG_CARRY, PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_AND, PPC_INS_AND, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_AND8, PPC_INS_AND, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_AND8o, PPC_INS_AND, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_ANDC, PPC_INS_ANDC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_ANDC8, PPC_INS_ANDC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_ANDC8o, PPC_INS_ANDC, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_ANDCo, PPC_INS_ANDC, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_ANDISo, PPC_INS_ANDIS, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_ANDISo8, PPC_INS_ANDIS, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_ANDIo, PPC_INS_ANDI, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_ANDIo8, PPC_INS_ANDI, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_ANDo, PPC_INS_AND, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_B, PPC_INS_B, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 1, 0 #endif }, { PPC_BA, PPC_INS_BA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 1, 0 #endif }, { PPC_BC, PPC_INS_BC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 1, 0 #endif }, { PPC_BCC, PPC_INS_B, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 1, 0 #endif }, { PPC_BCCA, PPC_INS_BA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 1, 0 #endif }, { PPC_BCCCTR, PPC_INS_BCTR, #ifndef CAPSTONE_DIET { PPC_REG_CTR, 0 }, { 0 }, { 0 }, 1, 1 #endif }, { PPC_BCCCTR8, PPC_INS_BCTR, #ifndef CAPSTONE_DIET { PPC_REG_CTR8, 0 }, { 0 }, { PPC_GRP_MODE64, 0 }, 1, 1 #endif }, { PPC_BCCCTRL, PPC_INS_BCTRL, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_RM, 0 }, { PPC_REG_LR, 0 }, { 0 }, 0, 0 #endif }, { PPC_BCCCTRL8, PPC_INS_BCTRL, #ifndef CAPSTONE_DIET { PPC_REG_CTR8, PPC_REG_RM, 0 }, { PPC_REG_LR8, 0 }, { PPC_GRP_MODE64, 0 }, 0, 0 #endif }, { PPC_BCCL, PPC_INS_BL, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_LR, 0 }, { 0 }, 0, 0 #endif }, { PPC_BCCLA, PPC_INS_BLA, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_LR, 0 }, { 0 }, 0, 0 #endif }, { PPC_BCCLR, PPC_INS_BLR, #ifndef CAPSTONE_DIET { PPC_REG_LR, PPC_REG_RM, 0 }, { 0 }, { 0 }, 1, 0 #endif }, { PPC_BCCLRL, PPC_INS_BLRL, #ifndef CAPSTONE_DIET { PPC_REG_LR, PPC_REG_RM, 0 }, { PPC_REG_LR, 0 }, { 0 }, 0, 0 #endif }, { PPC_BCCTR, PPC_INS_BCCTR, #ifndef CAPSTONE_DIET { PPC_REG_CTR, 0 }, { 0 }, { 0 }, 1, 1 #endif }, { PPC_BCCTR8, PPC_INS_BCCTR, #ifndef CAPSTONE_DIET { PPC_REG_CTR8, 0 }, { 0 }, { PPC_GRP_MODE64, 0 }, 1, 1 #endif }, { PPC_BCCTR8n, PPC_INS_BCCTR, #ifndef CAPSTONE_DIET { PPC_REG_CTR8, 0 }, { 0 }, { PPC_GRP_MODE64, 0 }, 1, 1 #endif }, { PPC_BCCTRL, PPC_INS_BCCTRL, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_RM, 0 }, { PPC_REG_LR, 0 }, { 0 }, 0, 0 #endif }, { PPC_BCCTRL8, PPC_INS_BCCTRL, #ifndef CAPSTONE_DIET { PPC_REG_CTR8, PPC_REG_RM, 0 }, { PPC_REG_LR8, 0 }, { PPC_GRP_MODE64, 0 }, 0, 0 #endif }, { PPC_BCCTRL8n, PPC_INS_BCCTRL, #ifndef CAPSTONE_DIET { PPC_REG_CTR8, PPC_REG_RM, 0 }, { PPC_REG_LR8, 0 }, { PPC_GRP_MODE64, 0 }, 0, 0 #endif }, { PPC_BCCTRLn, PPC_INS_BCCTRL, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_RM, 0 }, { PPC_REG_LR, 0 }, { 0 }, 0, 0 #endif }, { PPC_BCCTRn, PPC_INS_BCCTR, #ifndef CAPSTONE_DIET { PPC_REG_CTR, 0 }, { 0 }, { 0 }, 1, 1 #endif }, { PPC_BCL, PPC_INS_BCL, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_LR, 0 }, { 0 }, 0, 0 #endif }, { PPC_BCLR, PPC_INS_BCLR, #ifndef CAPSTONE_DIET { PPC_REG_LR, PPC_REG_RM, 0 }, { 0 }, { 0 }, 1, 0 #endif }, { PPC_BCLRL, PPC_INS_BCLRL, #ifndef CAPSTONE_DIET { PPC_REG_LR, PPC_REG_RM, 0 }, { PPC_REG_LR, 0 }, { 0 }, 0, 0 #endif }, { PPC_BCLRLn, PPC_INS_BCLRL, #ifndef CAPSTONE_DIET { PPC_REG_LR, PPC_REG_RM, 0 }, { PPC_REG_LR, 0 }, { 0 }, 0, 0 #endif }, { PPC_BCLRn, PPC_INS_BCLR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 1, 0 #endif }, { PPC_BCLalways, PPC_INS_BCL, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_LR, 0 }, { 0 }, 0, 0 #endif }, { PPC_BCLn, PPC_INS_BCL, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_LR, 0 }, { 0 }, 0, 0 #endif }, { PPC_BCTR, PPC_INS_BCTR, #ifndef CAPSTONE_DIET { PPC_REG_CTR, 0 }, { 0 }, { 0 }, 1, 1 #endif }, { PPC_BCTR8, PPC_INS_BCTR, #ifndef CAPSTONE_DIET { PPC_REG_CTR8, 0 }, { 0 }, { PPC_GRP_MODE64, 0 }, 1, 1 #endif }, { PPC_BCTRL, PPC_INS_BCTRL, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_RM, 0 }, { PPC_REG_LR, 0 }, { PPC_GRP_MODE32, 0 }, 0, 0 #endif }, { PPC_BCTRL8, PPC_INS_BCTRL, #ifndef CAPSTONE_DIET { PPC_REG_CTR8, PPC_REG_RM, 0 }, { PPC_REG_LR8, 0 }, { PPC_GRP_MODE64, 0 }, 0, 0 #endif }, { PPC_BCn, PPC_INS_BC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 1, 0 #endif }, { PPC_BDNZ, PPC_INS_BDNZ, #ifndef CAPSTONE_DIET { PPC_REG_CTR, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 1, 0 #endif }, { PPC_BDNZ8, PPC_INS_BDNZ, #ifndef CAPSTONE_DIET { PPC_REG_CTR8, 0 }, { PPC_REG_CTR8, 0 }, { 0 }, 1, 0 #endif }, { PPC_BDNZA, PPC_INS_BDNZA, #ifndef CAPSTONE_DIET { PPC_REG_CTR, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 1, 0 #endif }, { PPC_BDNZAm, PPC_INS_BDNZA, #ifndef CAPSTONE_DIET { PPC_REG_CTR, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 1, 0 #endif }, { PPC_BDNZAp, PPC_INS_BDNZA, #ifndef CAPSTONE_DIET { PPC_REG_CTR, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 1, 0 #endif }, { PPC_BDNZL, PPC_INS_BDNZL, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_RM, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 0, 0 #endif }, { PPC_BDNZLA, PPC_INS_BDNZLA, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_RM, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 0, 0 #endif }, { PPC_BDNZLAm, PPC_INS_BDNZLA, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_RM, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 0, 0 #endif }, { PPC_BDNZLAp, PPC_INS_BDNZLA, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_RM, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 0, 0 #endif }, { PPC_BDNZLR, PPC_INS_BDNZLR, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_LR, PPC_REG_RM, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 1, 0 #endif }, { PPC_BDNZLR8, PPC_INS_BDNZLR, #ifndef CAPSTONE_DIET { PPC_REG_CTR8, PPC_REG_LR8, PPC_REG_RM, 0 }, { PPC_REG_CTR8, 0 }, { 0 }, 1, 0 #endif }, { PPC_BDNZLRL, PPC_INS_BDNZLRL, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_LR, PPC_REG_RM, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 0, 0 #endif }, { PPC_BDNZLRLm, PPC_INS_BDNZLRL, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_LR, PPC_REG_RM, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 0, 0 #endif }, { PPC_BDNZLRLp, PPC_INS_BDNZLRL, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_LR, PPC_REG_RM, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 0, 0 #endif }, { PPC_BDNZLRm, PPC_INS_BDNZLR, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_LR, PPC_REG_RM, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 1, 0 #endif }, { PPC_BDNZLRp, PPC_INS_BDNZLR, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_LR, PPC_REG_RM, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 1, 0 #endif }, { PPC_BDNZLm, PPC_INS_BDNZL, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_RM, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 0, 0 #endif }, { PPC_BDNZLp, PPC_INS_BDNZL, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_RM, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 0, 0 #endif }, { PPC_BDNZm, PPC_INS_BDNZ, #ifndef CAPSTONE_DIET { PPC_REG_CTR, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 1, 0 #endif }, { PPC_BDNZp, PPC_INS_BDNZ, #ifndef CAPSTONE_DIET { PPC_REG_CTR, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 1, 0 #endif }, { PPC_BDZ, PPC_INS_BDZ, #ifndef CAPSTONE_DIET { PPC_REG_CTR, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 1, 0 #endif }, { PPC_BDZ8, PPC_INS_BDZ, #ifndef CAPSTONE_DIET { PPC_REG_CTR8, 0 }, { PPC_REG_CTR8, 0 }, { 0 }, 1, 0 #endif }, { PPC_BDZA, PPC_INS_BDZA, #ifndef CAPSTONE_DIET { PPC_REG_CTR, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 1, 0 #endif }, { PPC_BDZAm, PPC_INS_BDZA, #ifndef CAPSTONE_DIET { PPC_REG_CTR, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 1, 0 #endif }, { PPC_BDZAp, PPC_INS_BDZA, #ifndef CAPSTONE_DIET { PPC_REG_CTR, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 1, 0 #endif }, { PPC_BDZL, PPC_INS_BDZL, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_RM, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 0, 0 #endif }, { PPC_BDZLA, PPC_INS_BDZLA, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_RM, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 0, 0 #endif }, { PPC_BDZLAm, PPC_INS_BDZLA, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_RM, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 0, 0 #endif }, { PPC_BDZLAp, PPC_INS_BDZLA, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_RM, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 0, 0 #endif }, { PPC_BDZLR, PPC_INS_BDZLR, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_LR, PPC_REG_RM, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 1, 0 #endif }, { PPC_BDZLR8, PPC_INS_BDZLR, #ifndef CAPSTONE_DIET { PPC_REG_CTR8, PPC_REG_LR8, PPC_REG_RM, 0 }, { PPC_REG_CTR8, 0 }, { 0 }, 1, 0 #endif }, { PPC_BDZLRL, PPC_INS_BDZLRL, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_LR, PPC_REG_RM, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 0, 0 #endif }, { PPC_BDZLRLm, PPC_INS_BDZLRL, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_LR, PPC_REG_RM, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 0, 0 #endif }, { PPC_BDZLRLp, PPC_INS_BDZLRL, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_LR, PPC_REG_RM, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 0, 0 #endif }, { PPC_BDZLRm, PPC_INS_BDZLR, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_LR, PPC_REG_RM, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 1, 0 #endif }, { PPC_BDZLRp, PPC_INS_BDZLR, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_LR, PPC_REG_RM, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 1, 0 #endif }, { PPC_BDZLm, PPC_INS_BDZL, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_RM, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 0, 0 #endif }, { PPC_BDZLp, PPC_INS_BDZL, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_RM, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 0, 0 #endif }, { PPC_BDZm, PPC_INS_BDZ, #ifndef CAPSTONE_DIET { PPC_REG_CTR, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 1, 0 #endif }, { PPC_BDZp, PPC_INS_BDZ, #ifndef CAPSTONE_DIET { PPC_REG_CTR, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 1, 0 #endif }, { PPC_BL, PPC_INS_BL, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_LR, 0 }, { 0 }, 0, 0 #endif }, { PPC_BL8, PPC_INS_BL, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_LR8, 0 }, { 0 }, 0, 0 #endif }, { PPC_BL8_NOP, PPC_INS_BL, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_LR8, 0 }, { 0 }, 0, 0 #endif }, { PPC_BL8_NOP_TLS, PPC_INS_BL, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_LR8, 0 }, { 0 }, 0, 0 #endif }, { PPC_BL8_TLS, PPC_INS_BL, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_LR8, 0 }, { 0 }, 0, 0 #endif }, { PPC_BL8_TLS_, PPC_INS_BL, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_LR8, 0 }, { 0 }, 0, 0 #endif }, { PPC_BLA, PPC_INS_BLA, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_LR, 0 }, { 0 }, 0, 0 #endif }, { PPC_BLA8, PPC_INS_BLA, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_LR8, 0 }, { 0 }, 0, 0 #endif }, { PPC_BLA8_NOP, PPC_INS_BLA, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_LR8, 0 }, { 0 }, 0, 0 #endif }, { PPC_BLR, PPC_INS_BLR, #ifndef CAPSTONE_DIET { PPC_REG_LR, PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_BLRL, PPC_INS_BLRL, #ifndef CAPSTONE_DIET { PPC_REG_LR, PPC_REG_RM, 0 }, { PPC_REG_LR, 0 }, { 0 }, 0, 0 #endif }, { PPC_BL_TLS, PPC_INS_BL, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_LR, 0 }, { 0 }, 0, 0 #endif }, { PPC_BRINC, PPC_INS_BRINC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_CMPD, PPC_INS_CMPD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_CMPDI, PPC_INS_CMPDI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_CMPLD, PPC_INS_CMPLD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_CMPLDI, PPC_INS_CMPLDI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_CMPLW, PPC_INS_CMPLW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_CMPLWI, PPC_INS_CMPLWI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_CMPW, PPC_INS_CMPW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_CMPWI, PPC_INS_CMPWI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_CNTLZD, PPC_INS_CNTLZD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_CNTLZDo, PPC_INS_CNTLZD, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_CNTLZW, PPC_INS_CNTLZW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_CNTLZWo, PPC_INS_CNTLZW, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_CR6SET, PPC_INS_CREQV, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR1EQ, 0 }, { 0 }, 0, 0 #endif }, { PPC_CR6UNSET, PPC_INS_CRXOR, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR1EQ, 0 }, { 0 }, 0, 0 #endif }, { PPC_CRAND, PPC_INS_CRAND, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_CRANDC, PPC_INS_CRANDC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_CREQV, PPC_INS_CREQV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_CRNAND, PPC_INS_CRNAND, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_CRNOR, PPC_INS_CRNOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_CROR, PPC_INS_CROR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_CRORC, PPC_INS_CRORC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_CRSET, PPC_INS_CREQV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_CRUNSET, PPC_INS_CRXOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_CRXOR, PPC_INS_CRXOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_DCBA, PPC_INS_DCBA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_DCBF, PPC_INS_DCBF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_DCBI, PPC_INS_DCBI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_DCBST, PPC_INS_DCBST, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_DCBT, PPC_INS_DCBT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_DCBTST, PPC_INS_DCBTST, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_DCBZ, PPC_INS_DCBZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_DCBZL, PPC_INS_DCBZL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_DCCCI, PPC_INS_DCCCI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_PPC4XX, 0 }, 0, 0 #endif }, { PPC_DIVD, PPC_INS_DIVD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_DIVDU, PPC_INS_DIVDU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_DIVDUo, PPC_INS_DIVDU, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_DIVDo, PPC_INS_DIVD, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_DIVW, PPC_INS_DIVW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_DIVWU, PPC_INS_DIVWU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_DIVWUo, PPC_INS_DIVWU, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_DIVWo, PPC_INS_DIVW, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_DSS, PPC_INS_DSS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_DSSALL, PPC_INS_DSSALL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_DST, PPC_INS_DST, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_DST64, PPC_INS_DST, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_DSTST, PPC_INS_DSTST, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_DSTST64, PPC_INS_DSTST, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_DSTSTT, PPC_INS_DSTSTT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_DSTSTT64, PPC_INS_DSTSTT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_DSTT, PPC_INS_DSTT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_DSTT64, PPC_INS_DSTT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_EIEIO, PPC_INS_EIEIO, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_EQV, PPC_INS_EQV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_EQV8, PPC_INS_EQV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_EQV8o, PPC_INS_EQV, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_EQVo, PPC_INS_EQV, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_EVABS, PPC_INS_EVABS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVADDIW, PPC_INS_EVADDIW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVADDSMIAAW, PPC_INS_EVADDSMIAAW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVADDSSIAAW, PPC_INS_EVADDSSIAAW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVADDUMIAAW, PPC_INS_EVADDUMIAAW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVADDUSIAAW, PPC_INS_EVADDUSIAAW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVADDW, PPC_INS_EVADDW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVAND, PPC_INS_EVAND, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVANDC, PPC_INS_EVANDC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVCMPEQ, PPC_INS_EVCMPEQ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVCMPGTS, PPC_INS_EVCMPGTS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVCMPGTU, PPC_INS_EVCMPGTU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVCMPLTS, PPC_INS_EVCMPLTS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVCMPLTU, PPC_INS_EVCMPLTU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVCNTLSW, PPC_INS_EVCNTLSW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVCNTLZW, PPC_INS_EVCNTLZW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVDIVWS, PPC_INS_EVDIVWS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVDIVWU, PPC_INS_EVDIVWU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVEQV, PPC_INS_EVEQV, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVEXTSB, PPC_INS_EVEXTSB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVEXTSH, PPC_INS_EVEXTSH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVLDD, PPC_INS_EVLDD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVLDDX, PPC_INS_EVLDDX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVLDH, PPC_INS_EVLDH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVLDHX, PPC_INS_EVLDHX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVLDW, PPC_INS_EVLDW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVLDWX, PPC_INS_EVLDWX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVLHHESPLAT, PPC_INS_EVLHHESPLAT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVLHHESPLATX, PPC_INS_EVLHHESPLATX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVLHHOSSPLAT, PPC_INS_EVLHHOSSPLAT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVLHHOSSPLATX, PPC_INS_EVLHHOSSPLATX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVLHHOUSPLAT, PPC_INS_EVLHHOUSPLAT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVLHHOUSPLATX, PPC_INS_EVLHHOUSPLATX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVLWHE, PPC_INS_EVLWHE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVLWHEX, PPC_INS_EVLWHEX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVLWHOS, PPC_INS_EVLWHOS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVLWHOSX, PPC_INS_EVLWHOSX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVLWHOU, PPC_INS_EVLWHOU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVLWHOUX, PPC_INS_EVLWHOUX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVLWHSPLAT, PPC_INS_EVLWHSPLAT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVLWHSPLATX, PPC_INS_EVLWHSPLATX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVLWWSPLAT, PPC_INS_EVLWWSPLAT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVLWWSPLATX, PPC_INS_EVLWWSPLATX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMERGEHI, PPC_INS_EVMERGEHI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMERGEHILO, PPC_INS_EVMERGEHILO, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMERGELO, PPC_INS_EVMERGELO, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMERGELOHI, PPC_INS_EVMERGELOHI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHEGSMFAA, PPC_INS_EVMHEGSMFAA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHEGSMFAN, PPC_INS_EVMHEGSMFAN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHEGSMIAA, PPC_INS_EVMHEGSMIAA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHEGSMIAN, PPC_INS_EVMHEGSMIAN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHEGUMIAA, PPC_INS_EVMHEGUMIAA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHEGUMIAN, PPC_INS_EVMHEGUMIAN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHESMF, PPC_INS_EVMHESMF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHESMFA, PPC_INS_EVMHESMFA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHESMFAAW, PPC_INS_EVMHESMFAAW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHESMFANW, PPC_INS_EVMHESMFANW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHESMI, PPC_INS_EVMHESMI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHESMIA, PPC_INS_EVMHESMIA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHESMIAAW, PPC_INS_EVMHESMIAAW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHESMIANW, PPC_INS_EVMHESMIANW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHESSF, PPC_INS_EVMHESSF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHESSFA, PPC_INS_EVMHESSFA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHESSFAAW, PPC_INS_EVMHESSFAAW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHESSFANW, PPC_INS_EVMHESSFANW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHESSIAAW, PPC_INS_EVMHESSIAAW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHESSIANW, PPC_INS_EVMHESSIANW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHEUMI, PPC_INS_EVMHEUMI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHEUMIA, PPC_INS_EVMHEUMIA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHEUMIAAW, PPC_INS_EVMHEUMIAAW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHEUMIANW, PPC_INS_EVMHEUMIANW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHEUSIAAW, PPC_INS_EVMHEUSIAAW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHEUSIANW, PPC_INS_EVMHEUSIANW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHOGSMFAA, PPC_INS_EVMHOGSMFAA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHOGSMFAN, PPC_INS_EVMHOGSMFAN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHOGSMIAA, PPC_INS_EVMHOGSMIAA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHOGSMIAN, PPC_INS_EVMHOGSMIAN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHOGUMIAA, PPC_INS_EVMHOGUMIAA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHOGUMIAN, PPC_INS_EVMHOGUMIAN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHOSMF, PPC_INS_EVMHOSMF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHOSMFA, PPC_INS_EVMHOSMFA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHOSMFAAW, PPC_INS_EVMHOSMFAAW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHOSMFANW, PPC_INS_EVMHOSMFANW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHOSMI, PPC_INS_EVMHOSMI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHOSMIA, PPC_INS_EVMHOSMIA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHOSMIAAW, PPC_INS_EVMHOSMIAAW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHOSMIANW, PPC_INS_EVMHOSMIANW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHOSSF, PPC_INS_EVMHOSSF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHOSSFA, PPC_INS_EVMHOSSFA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHOSSFAAW, PPC_INS_EVMHOSSFAAW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHOSSFANW, PPC_INS_EVMHOSSFANW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHOSSIAAW, PPC_INS_EVMHOSSIAAW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHOSSIANW, PPC_INS_EVMHOSSIANW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHOUMI, PPC_INS_EVMHOUMI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHOUMIA, PPC_INS_EVMHOUMIA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHOUMIAAW, PPC_INS_EVMHOUMIAAW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHOUMIANW, PPC_INS_EVMHOUMIANW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHOUSIAAW, PPC_INS_EVMHOUSIAAW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMHOUSIANW, PPC_INS_EVMHOUSIANW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMRA, PPC_INS_EVMRA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWHSMF, PPC_INS_EVMWHSMF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWHSMFA, PPC_INS_EVMWHSMFA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWHSMI, PPC_INS_EVMWHSMI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWHSMIA, PPC_INS_EVMWHSMIA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWHSSF, PPC_INS_EVMWHSSF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWHSSFA, PPC_INS_EVMWHSSFA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWHUMI, PPC_INS_EVMWHUMI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWHUMIA, PPC_INS_EVMWHUMIA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWLSMIAAW, PPC_INS_EVMWLSMIAAW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWLSMIANW, PPC_INS_EVMWLSMIANW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWLSSIAAW, PPC_INS_EVMWLSSIAAW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWLSSIANW, PPC_INS_EVMWLSSIANW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWLUMI, PPC_INS_EVMWLUMI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWLUMIA, PPC_INS_EVMWLUMIA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWLUMIAAW, PPC_INS_EVMWLUMIAAW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWLUMIANW, PPC_INS_EVMWLUMIANW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWLUSIAAW, PPC_INS_EVMWLUSIAAW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWLUSIANW, PPC_INS_EVMWLUSIANW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWSMF, PPC_INS_EVMWSMF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWSMFA, PPC_INS_EVMWSMFA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWSMFAA, PPC_INS_EVMWSMFAA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWSMFAN, PPC_INS_EVMWSMFAN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWSMI, PPC_INS_EVMWSMI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWSMIA, PPC_INS_EVMWSMIA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWSMIAA, PPC_INS_EVMWSMIAA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWSMIAN, PPC_INS_EVMWSMIAN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWSSF, PPC_INS_EVMWSSF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWSSFA, PPC_INS_EVMWSSFA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWSSFAA, PPC_INS_EVMWSSFAA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWSSFAN, PPC_INS_EVMWSSFAN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWUMI, PPC_INS_EVMWUMI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWUMIA, PPC_INS_EVMWUMIA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWUMIAA, PPC_INS_EVMWUMIAA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVMWUMIAN, PPC_INS_EVMWUMIAN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVNAND, PPC_INS_EVNAND, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVNEG, PPC_INS_EVNEG, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVNOR, PPC_INS_EVNOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVOR, PPC_INS_EVOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVORC, PPC_INS_EVORC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVRLW, PPC_INS_EVRLW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVRLWI, PPC_INS_EVRLWI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVRNDW, PPC_INS_EVRNDW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVSLW, PPC_INS_EVSLW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVSLWI, PPC_INS_EVSLWI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVSPLATFI, PPC_INS_EVSPLATFI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVSPLATI, PPC_INS_EVSPLATI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVSRWIS, PPC_INS_EVSRWIS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVSRWIU, PPC_INS_EVSRWIU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVSRWS, PPC_INS_EVSRWS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVSRWU, PPC_INS_EVSRWU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVSTDD, PPC_INS_EVSTDD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVSTDDX, PPC_INS_EVSTDDX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVSTDH, PPC_INS_EVSTDH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVSTDHX, PPC_INS_EVSTDHX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVSTDW, PPC_INS_EVSTDW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVSTDWX, PPC_INS_EVSTDWX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVSTWHE, PPC_INS_EVSTWHE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVSTWHEX, PPC_INS_EVSTWHEX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVSTWHO, PPC_INS_EVSTWHO, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVSTWHOX, PPC_INS_EVSTWHOX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVSTWWE, PPC_INS_EVSTWWE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVSTWWEX, PPC_INS_EVSTWWEX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVSTWWO, PPC_INS_EVSTWWO, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVSTWWOX, PPC_INS_EVSTWWOX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVSUBFSMIAAW, PPC_INS_EVSUBFSMIAAW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVSUBFSSIAAW, PPC_INS_EVSUBFSSIAAW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVSUBFUMIAAW, PPC_INS_EVSUBFUMIAAW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVSUBFUSIAAW, PPC_INS_EVSUBFUSIAAW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVSUBFW, PPC_INS_EVSUBFW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVSUBIFW, PPC_INS_EVSUBIFW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EVXOR, PPC_INS_EVXOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_SPE, 0 }, 0, 0 #endif }, { PPC_EXTSB, PPC_INS_EXTSB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_EXTSB8, PPC_INS_EXTSB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_EXTSB8_32_64, PPC_INS_EXTSB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_EXTSB8o, PPC_INS_EXTSB, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_EXTSBo, PPC_INS_EXTSB, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_EXTSH, PPC_INS_EXTSH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_EXTSH8, PPC_INS_EXTSH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_EXTSH8_32_64, PPC_INS_EXTSH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_EXTSH8o, PPC_INS_EXTSH, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_EXTSHo, PPC_INS_EXTSH, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_EXTSW, PPC_INS_EXTSW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_EXTSW_32_64, PPC_INS_EXTSW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_EXTSW_32_64o, PPC_INS_EXTSW, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_EXTSWo, PPC_INS_EXTSW, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_FABSD, PPC_INS_FABS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FABSDo, PPC_INS_FABS, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FABSS, PPC_INS_FABS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FABSSo, PPC_INS_FABS, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FADD, PPC_INS_FADD, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FADDS, PPC_INS_FADDS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FADDSo, PPC_INS_FADDS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FADDo, PPC_INS_FADD, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FCFID, PPC_INS_FCFID, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FCFIDS, PPC_INS_FCFIDS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FCFIDSo, PPC_INS_FCFIDS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FCFIDU, PPC_INS_FCFIDU, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FCFIDUS, PPC_INS_FCFIDUS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FCFIDUSo, PPC_INS_FCFIDUS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FCFIDUo, PPC_INS_FCFIDU, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FCFIDo, PPC_INS_FCFID, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FCMPUD, PPC_INS_FCMPU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FCMPUS, PPC_INS_FCMPU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FCPSGND, PPC_INS_FCPSGN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FCPSGNDo, PPC_INS_FCPSGN, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FCPSGNS, PPC_INS_FCPSGN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FCPSGNSo, PPC_INS_FCPSGN, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FCTID, PPC_INS_FCTID, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FCTIDUZ, PPC_INS_FCTIDUZ, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FCTIDUZo, PPC_INS_FCTIDUZ, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FCTIDZ, PPC_INS_FCTIDZ, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FCTIDZo, PPC_INS_FCTIDZ, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FCTIDo, PPC_INS_FCTID, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FCTIW, PPC_INS_FCTIW, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FCTIWUZ, PPC_INS_FCTIWUZ, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FCTIWUZo, PPC_INS_FCTIWUZ, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FCTIWZ, PPC_INS_FCTIWZ, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FCTIWZo, PPC_INS_FCTIWZ, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FCTIWo, PPC_INS_FCTIW, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FDIV, PPC_INS_FDIV, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FDIVS, PPC_INS_FDIVS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FDIVSo, PPC_INS_FDIVS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FDIVo, PPC_INS_FDIV, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FMADD, PPC_INS_FMADD, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FMADDS, PPC_INS_FMADDS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FMADDSo, PPC_INS_FMADDS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FMADDo, PPC_INS_FMADD, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FMR, PPC_INS_FMR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FMRo, PPC_INS_FMR, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FMSUB, PPC_INS_FMSUB, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FMSUBS, PPC_INS_FMSUBS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FMSUBSo, PPC_INS_FMSUBS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FMSUBo, PPC_INS_FMSUB, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FMUL, PPC_INS_FMUL, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FMULS, PPC_INS_FMULS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FMULSo, PPC_INS_FMULS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FMULo, PPC_INS_FMUL, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FNABSD, PPC_INS_FNABS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FNABSDo, PPC_INS_FNABS, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FNABSS, PPC_INS_FNABS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FNABSSo, PPC_INS_FNABS, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FNEGD, PPC_INS_FNEG, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FNEGDo, PPC_INS_FNEG, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FNEGS, PPC_INS_FNEG, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FNEGSo, PPC_INS_FNEG, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FNMADD, PPC_INS_FNMADD, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FNMADDS, PPC_INS_FNMADDS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FNMADDSo, PPC_INS_FNMADDS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FNMADDo, PPC_INS_FNMADD, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FNMSUB, PPC_INS_FNMSUB, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FNMSUBS, PPC_INS_FNMSUBS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FNMSUBSo, PPC_INS_FNMSUBS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FNMSUBo, PPC_INS_FNMSUB, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FRE, PPC_INS_FRE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FRES, PPC_INS_FRES, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FRESo, PPC_INS_FRES, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FREo, PPC_INS_FRE, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FRIMD, PPC_INS_FRIM, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FRIMDo, PPC_INS_FRIM, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FRIMS, PPC_INS_FRIM, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FRIMSo, PPC_INS_FRIM, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FRIND, PPC_INS_FRIN, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FRINDo, PPC_INS_FRIN, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FRINS, PPC_INS_FRIN, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FRINSo, PPC_INS_FRIN, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FRIPD, PPC_INS_FRIP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FRIPDo, PPC_INS_FRIP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FRIPS, PPC_INS_FRIP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FRIPSo, PPC_INS_FRIP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FRIZD, PPC_INS_FRIZ, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FRIZDo, PPC_INS_FRIZ, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FRIZS, PPC_INS_FRIZ, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FRIZSo, PPC_INS_FRIZ, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FRSP, PPC_INS_FRSP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FRSPo, PPC_INS_FRSP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FRSQRTE, PPC_INS_FRSQRTE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FRSQRTES, PPC_INS_FRSQRTES, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FRSQRTESo, PPC_INS_FRSQRTES, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FRSQRTEo, PPC_INS_FRSQRTE, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FSELD, PPC_INS_FSEL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FSELDo, PPC_INS_FSEL, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FSELS, PPC_INS_FSEL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FSELSo, PPC_INS_FSEL, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FSQRT, PPC_INS_FSQRT, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FSQRTS, PPC_INS_FSQRTS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FSQRTSo, PPC_INS_FSQRTS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FSQRTo, PPC_INS_FSQRT, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FSUB, PPC_INS_FSUB, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FSUBS, PPC_INS_FSUBS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_FSUBSo, PPC_INS_FSUBS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_FSUBo, PPC_INS_FSUB, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR1, 0 }, { 0 }, 0, 0 #endif }, { PPC_ICBI, PPC_INS_ICBI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_ICCCI, PPC_INS_ICCCI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_PPC4XX, 0 }, 0, 0 #endif }, { PPC_ISEL, PPC_INS_ISEL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_ISEL8, PPC_INS_ISEL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_ISYNC, PPC_INS_ISYNC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LA, PPC_INS_LA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LBZ, PPC_INS_LBZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LBZ8, PPC_INS_LBZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LBZU, PPC_INS_LBZU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LBZU8, PPC_INS_LBZU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LBZUX, PPC_INS_LBZUX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LBZUX8, PPC_INS_LBZUX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LBZX, PPC_INS_LBZX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LBZX8, PPC_INS_LBZX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LD, PPC_INS_LD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LDARX, PPC_INS_LDARX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LDBRX, PPC_INS_LDBRX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LDU, PPC_INS_LDU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LDUX, PPC_INS_LDUX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LDX, PPC_INS_LDX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LDinto_toc, PPC_INS_LD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LFD, PPC_INS_LFD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LFDU, PPC_INS_LFDU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LFDUX, PPC_INS_LFDUX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LFDX, PPC_INS_LFDX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LFIWAX, PPC_INS_LFIWAX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LFIWZX, PPC_INS_LFIWZX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LFS, PPC_INS_LFS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LFSU, PPC_INS_LFSU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LFSUX, PPC_INS_LFSUX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LFSX, PPC_INS_LFSX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LHA, PPC_INS_LHA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LHA8, PPC_INS_LHA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LHAU, PPC_INS_LHAU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LHAU8, PPC_INS_LHAU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LHAUX, PPC_INS_LHAUX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LHAUX8, PPC_INS_LHAUX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LHAX, PPC_INS_LHAX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LHAX8, PPC_INS_LHAX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LHBRX, PPC_INS_LHBRX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LHZ, PPC_INS_LHZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LHZ8, PPC_INS_LHZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LHZU, PPC_INS_LHZU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LHZU8, PPC_INS_LHZU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LHZUX, PPC_INS_LHZUX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LHZUX8, PPC_INS_LHZUX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LHZX, PPC_INS_LHZX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LHZX8, PPC_INS_LHZX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LI, PPC_INS_LI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LI8, PPC_INS_LI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LIS, PPC_INS_LIS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LIS8, PPC_INS_LIS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LMW, PPC_INS_LMW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LSWI, PPC_INS_LSWI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LVEBX, PPC_INS_LVEBX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_LVEHX, PPC_INS_LVEHX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_LVEWX, PPC_INS_LVEWX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_LVSL, PPC_INS_LVSL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_LVSR, PPC_INS_LVSR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_LVX, PPC_INS_LVX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_LVXL, PPC_INS_LVXL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_LWA, PPC_INS_LWA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LWARX, PPC_INS_LWARX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LWAUX, PPC_INS_LWAUX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LWAX, PPC_INS_LWAX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LWAX_32, PPC_INS_LWAX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LWA_32, PPC_INS_LWA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LWBRX, PPC_INS_LWBRX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LWZ, PPC_INS_LWZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LWZ8, PPC_INS_LWZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LWZU, PPC_INS_LWZU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LWZU8, PPC_INS_LWZU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LWZUX, PPC_INS_LWZUX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LWZUX8, PPC_INS_LWZUX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LWZX, PPC_INS_LWZX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LWZX8, PPC_INS_LWZX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_LXSDX, PPC_INS_LXSDX, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_LXVD2X, PPC_INS_LXVD2X, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_LXVDSX, PPC_INS_LXVDSX, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_LXVW4X, PPC_INS_LXVW4X, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_MBAR, PPC_INS_MBAR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_BOOKE, 0 }, 0, 0 #endif }, { PPC_MCRF, PPC_INS_MCRF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MFCR, PPC_INS_MFCR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MFCR8, PPC_INS_MFCR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MFCTR, PPC_INS_MFCTR, #ifndef CAPSTONE_DIET { PPC_REG_CTR, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MFCTR8, PPC_INS_MFCTR, #ifndef CAPSTONE_DIET { PPC_REG_CTR8, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MFDCR, PPC_INS_MFDCR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_PPC4XX, 0 }, 0, 0 #endif }, { PPC_MFFS, PPC_INS_MFFS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MFLR, PPC_INS_MFLR, #ifndef CAPSTONE_DIET { PPC_REG_LR, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MFLR8, PPC_INS_MFLR, #ifndef CAPSTONE_DIET { PPC_REG_LR8, 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MFMSR, PPC_INS_MFMSR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MFOCRF, PPC_INS_MFOCRF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MFOCRF8, PPC_INS_MFOCRF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MFSPR, PPC_INS_MFSPR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MFSR, PPC_INS_MFSR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MFSRIN, PPC_INS_MFSRIN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MFTB, PPC_INS_MFTB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MFTB8, PPC_INS_MFSPR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MFVRSAVE, PPC_INS_MFSPR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MFVRSAVEv, PPC_INS_MFSPR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MFVSCR, PPC_INS_MFVSCR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_MSYNC, PPC_INS_MSYNC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_BOOKE, 0 }, 0, 0 #endif }, { PPC_MTCRF, PPC_INS_MTCRF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MTCRF8, PPC_INS_MTCRF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MTCTR, PPC_INS_MTCTR, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CTR, 0 }, { 0 }, 0, 0 #endif }, { PPC_MTCTR8, PPC_INS_MTCTR, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CTR8, 0 }, { 0 }, 0, 0 #endif }, { PPC_MTCTR8loop, PPC_INS_MTCTR, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CTR8, 0 }, { 0 }, 0, 0 #endif }, { PPC_MTCTRloop, PPC_INS_MTCTR, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CTR, 0 }, { 0 }, 0, 0 #endif }, { PPC_MTDCR, PPC_INS_MTDCR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_PPC4XX, 0 }, 0, 0 #endif }, { PPC_MTFSB0, PPC_INS_MTFSB0, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_RM, 0 }, { 0 }, 0, 0 #endif }, { PPC_MTFSB1, PPC_INS_MTFSB1, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_RM, 0 }, { 0 }, 0, 0 #endif }, { PPC_MTFSF, PPC_INS_MTFSF, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_RM, 0 }, { 0 }, 0, 0 #endif }, { PPC_MTLR, PPC_INS_MTLR, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_LR, 0 }, { 0 }, 0, 0 #endif }, { PPC_MTLR8, PPC_INS_MTLR, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_LR8, 0 }, { 0 }, 0, 0 #endif }, { PPC_MTMSR, PPC_INS_MTMSR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MTMSRD, PPC_INS_MTMSRD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MTOCRF, PPC_INS_MTOCRF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MTOCRF8, PPC_INS_MTOCRF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MTSPR, PPC_INS_MTSPR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MTSR, PPC_INS_MTSR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MTSRIN, PPC_INS_MTSRIN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MTVRSAVE, PPC_INS_MTSPR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MTVRSAVEv, PPC_INS_MTSPR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MTVSCR, PPC_INS_MTVSCR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_MULHD, PPC_INS_MULHD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MULHDU, PPC_INS_MULHDU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MULHDUo, PPC_INS_MULHDU, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_MULHDo, PPC_INS_MULHD, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_MULHW, PPC_INS_MULHW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MULHWU, PPC_INS_MULHWU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MULHWUo, PPC_INS_MULHWU, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_MULHWo, PPC_INS_MULHW, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_MULLD, PPC_INS_MULLD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MULLDo, PPC_INS_MULLD, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_MULLI, PPC_INS_MULLI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MULLI8, PPC_INS_MULLI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MULLW, PPC_INS_MULLW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_MULLWo, PPC_INS_MULLW, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_NAND, PPC_INS_NAND, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_NAND8, PPC_INS_NAND, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_NAND8o, PPC_INS_NAND, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_NANDo, PPC_INS_NAND, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_NEG, PPC_INS_NEG, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_NEG8, PPC_INS_NEG, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_NEG8o, PPC_INS_NEG, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_NEGo, PPC_INS_NEG, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_NOP, PPC_INS_NOP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_NOP_GT_PWR6, PPC_INS_ORI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_NOP_GT_PWR7, PPC_INS_ORI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_NOR, PPC_INS_NOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_NOR8, PPC_INS_NOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_NOR8o, PPC_INS_NOR, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_NORo, PPC_INS_NOR, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_OR, PPC_INS_OR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_OR8, PPC_INS_OR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_OR8o, PPC_INS_OR, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_ORC, PPC_INS_ORC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_ORC8, PPC_INS_ORC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_ORC8o, PPC_INS_ORC, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_ORCo, PPC_INS_ORC, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_ORI, PPC_INS_ORI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_ORI8, PPC_INS_ORI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_ORIS, PPC_INS_ORIS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_ORIS8, PPC_INS_ORIS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_ORo, PPC_INS_OR, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_POPCNTD, PPC_INS_POPCNTD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_POPCNTW, PPC_INS_POPCNTW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_RFCI, PPC_INS_RFCI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_BOOKE, 0 }, 0, 0 #endif }, { PPC_RFDI, PPC_INS_RFDI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_E500, 0 }, 0, 0 #endif }, { PPC_RFI, PPC_INS_RFI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_BOOKE, 0 }, 0, 0 #endif }, { PPC_RFID, PPC_INS_RFID, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_RFMCI, PPC_INS_RFMCI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_E500, 0 }, 0, 0 #endif }, { PPC_RLDCL, PPC_INS_RLDCL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_RLDCLo, PPC_INS_RLDCL, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_RLDCR, PPC_INS_RLDCR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_RLDCRo, PPC_INS_RLDCR, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_RLDIC, PPC_INS_RLDIC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_RLDICL, PPC_INS_RLDICL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_RLDICL_32_64, PPC_INS_RLDICL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_RLDICLo, PPC_INS_RLDICL, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_RLDICR, PPC_INS_RLDICR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_RLDICRo, PPC_INS_RLDICR, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_RLDICo, PPC_INS_RLDIC, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_RLDIMI, PPC_INS_RLDIMI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_RLDIMIo, PPC_INS_RLDIMI, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_RLWIMI, PPC_INS_RLWIMI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_RLWIMI8, PPC_INS_RLWIMI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_RLWIMI8o, PPC_INS_RLWIMI, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_RLWIMIo, PPC_INS_RLWIMI, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_RLWINM, PPC_INS_RLWINM, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_RLWINM8, PPC_INS_RLWINM, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_RLWINM8o, PPC_INS_RLWINM, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_RLWINMo, PPC_INS_RLWINM, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_RLWNM, PPC_INS_RLWNM, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_RLWNMo, PPC_INS_RLWNM, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_SC, PPC_INS_SC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_SLBIA, PPC_INS_SLBIA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_SLBIE, PPC_INS_SLBIE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_SLBMFEE, PPC_INS_SLBMFEE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_SLBMTE, PPC_INS_SLBMTE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_SLD, PPC_INS_SLD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_SLDo, PPC_INS_SLD, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_SLW, PPC_INS_SLW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_SLWo, PPC_INS_SLW, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_SRAD, PPC_INS_SRAD, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CARRY, 0 }, { 0 }, 0, 0 #endif }, { PPC_SRADI, PPC_INS_SRADI, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CARRY, 0 }, { 0 }, 0, 0 #endif }, { PPC_SRADIo, PPC_INS_SRADI, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CARRY, PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_SRADo, PPC_INS_SRAD, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CARRY, PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_SRAW, PPC_INS_SRAW, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CARRY, 0 }, { 0 }, 0, 0 #endif }, { PPC_SRAWI, PPC_INS_SRAWI, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CARRY, 0 }, { 0 }, 0, 0 #endif }, { PPC_SRAWIo, PPC_INS_SRAWI, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CARRY, PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_SRAWo, PPC_INS_SRAW, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CARRY, PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_SRD, PPC_INS_SRD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_SRDo, PPC_INS_SRD, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_SRW, PPC_INS_SRW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_SRWo, PPC_INS_SRW, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_STB, PPC_INS_STB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STB8, PPC_INS_STB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STBU, PPC_INS_STBU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STBU8, PPC_INS_STBU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STBUX, PPC_INS_STBUX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STBUX8, PPC_INS_STBUX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STBX, PPC_INS_STBX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STBX8, PPC_INS_STBX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STD, PPC_INS_STD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STDBRX, PPC_INS_STDBRX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STDCX, PPC_INS_STDCX, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_STDU, PPC_INS_STDU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STDUX, PPC_INS_STDUX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STDX, PPC_INS_STDX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STFD, PPC_INS_STFD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STFDU, PPC_INS_STFDU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STFDUX, PPC_INS_STFDUX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STFDX, PPC_INS_STFDX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STFIWX, PPC_INS_STFIWX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STFS, PPC_INS_STFS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STFSU, PPC_INS_STFSU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STFSUX, PPC_INS_STFSUX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STFSX, PPC_INS_STFSX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STH, PPC_INS_STH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STH8, PPC_INS_STH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STHBRX, PPC_INS_STHBRX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STHU, PPC_INS_STHU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STHU8, PPC_INS_STHU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STHUX, PPC_INS_STHUX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STHUX8, PPC_INS_STHUX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STHX, PPC_INS_STHX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STHX8, PPC_INS_STHX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STMW, PPC_INS_STMW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STSWI, PPC_INS_STSWI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STVEBX, PPC_INS_STVEBX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_STVEHX, PPC_INS_STVEHX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_STVEWX, PPC_INS_STVEWX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_STVX, PPC_INS_STVX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_STVXL, PPC_INS_STVXL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_STW, PPC_INS_STW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STW8, PPC_INS_STW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STWBRX, PPC_INS_STWBRX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STWCX, PPC_INS_STWCX, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_STWU, PPC_INS_STWU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STWU8, PPC_INS_STWU, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STWUX, PPC_INS_STWUX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STWUX8, PPC_INS_STWUX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STWX, PPC_INS_STWX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STWX8, PPC_INS_STWX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_STXSDX, PPC_INS_STXSDX, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_STXVD2X, PPC_INS_STXVD2X, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_STXVW4X, PPC_INS_STXVW4X, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_SUBF, PPC_INS_SUBF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_SUBF8, PPC_INS_SUBF, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_SUBF8o, PPC_INS_SUBF, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_SUBFC, PPC_INS_SUBFC, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CARRY, 0 }, { 0 }, 0, 0 #endif }, { PPC_SUBFC8, PPC_INS_SUBFC, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CARRY, 0 }, { 0 }, 0, 0 #endif }, { PPC_SUBFC8o, PPC_INS_SUBFC, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CARRY, 0 }, { 0 }, 0, 0 #endif }, { PPC_SUBFCo, PPC_INS_SUBFC, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CARRY, PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_SUBFE, PPC_INS_SUBFE, #ifndef CAPSTONE_DIET { PPC_REG_CARRY, 0 }, { PPC_REG_CARRY, 0 }, { 0 }, 0, 0 #endif }, { PPC_SUBFE8, PPC_INS_SUBFE, #ifndef CAPSTONE_DIET { PPC_REG_CARRY, 0 }, { PPC_REG_CARRY, 0 }, { 0 }, 0, 0 #endif }, { PPC_SUBFE8o, PPC_INS_SUBFE, #ifndef CAPSTONE_DIET { PPC_REG_CARRY, 0 }, { PPC_REG_CARRY, PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_SUBFEo, PPC_INS_SUBFE, #ifndef CAPSTONE_DIET { PPC_REG_CARRY, 0 }, { PPC_REG_CARRY, PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_SUBFIC, PPC_INS_SUBFIC, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CARRY, 0 }, { 0 }, 0, 0 #endif }, { PPC_SUBFIC8, PPC_INS_SUBFIC, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CARRY, 0 }, { 0 }, 0, 0 #endif }, { PPC_SUBFME, PPC_INS_SUBFME, #ifndef CAPSTONE_DIET { PPC_REG_CARRY, 0 }, { PPC_REG_CARRY, 0 }, { 0 }, 0, 0 #endif }, { PPC_SUBFME8, PPC_INS_SUBFME, #ifndef CAPSTONE_DIET { PPC_REG_CARRY, 0 }, { PPC_REG_CARRY, 0 }, { 0 }, 0, 0 #endif }, { PPC_SUBFME8o, PPC_INS_SUBFME, #ifndef CAPSTONE_DIET { PPC_REG_CARRY, 0 }, { PPC_REG_CARRY, PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_SUBFMEo, PPC_INS_SUBFME, #ifndef CAPSTONE_DIET { PPC_REG_CARRY, 0 }, { PPC_REG_CARRY, PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_SUBFZE, PPC_INS_SUBFZE, #ifndef CAPSTONE_DIET { PPC_REG_CARRY, 0 }, { PPC_REG_CARRY, 0 }, { 0 }, 0, 0 #endif }, { PPC_SUBFZE8, PPC_INS_SUBFZE, #ifndef CAPSTONE_DIET { PPC_REG_CARRY, 0 }, { PPC_REG_CARRY, 0 }, { 0 }, 0, 0 #endif }, { PPC_SUBFZE8o, PPC_INS_SUBFZE, #ifndef CAPSTONE_DIET { PPC_REG_CARRY, 0 }, { PPC_REG_CARRY, PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_SUBFZEo, PPC_INS_SUBFZE, #ifndef CAPSTONE_DIET { PPC_REG_CARRY, 0 }, { PPC_REG_CARRY, PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_SUBFo, PPC_INS_SUBF, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_SYNC, PPC_INS_SYNC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_NOTBOOKE, 0 }, 0, 0 #endif }, { PPC_TAILB, PPC_INS_B, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 1, 0 #endif }, { PPC_TAILB8, PPC_INS_B, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 1, 0 #endif }, { PPC_TAILBA, PPC_INS_BA, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 1, 0 #endif }, { PPC_TAILBA8, PPC_INS_BA, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { 0 }, 1, 0 #endif }, { PPC_TAILBCTR, PPC_INS_BCTR, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_MODE32, 0 }, 1, 1 #endif }, { PPC_TAILBCTR8, PPC_INS_BCTR, #ifndef CAPSTONE_DIET { PPC_REG_CTR8, PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_MODE64, 0 }, 1, 1 #endif }, { PPC_TD, PPC_INS_TD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_TDI, PPC_INS_TDI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_TLBIA, PPC_INS_TLBIA, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_TLBIE, PPC_INS_TLBIE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_TLBIEL, PPC_INS_TLBIEL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_TLBIVAX, PPC_INS_TLBIVAX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_BOOKE, 0 }, 0, 0 #endif }, { PPC_TLBLD, PPC_INS_TLBLD, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_PPC6XX, 0 }, 0, 0 #endif }, { PPC_TLBLI, PPC_INS_TLBLI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_PPC6XX, 0 }, 0, 0 #endif }, { PPC_TLBRE, PPC_INS_TLBRE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_BOOKE, 0 }, 0, 0 #endif }, { PPC_TLBRE2, PPC_INS_TLBRE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_PPC4XX, 0 }, 0, 0 #endif }, { PPC_TLBSX, PPC_INS_TLBSX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_BOOKE, 0 }, 0, 0 #endif }, { PPC_TLBSX2, PPC_INS_TLBSX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_PPC4XX, 0 }, 0, 0 #endif }, { PPC_TLBSX2D, PPC_INS_TLBSX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_PPC4XX, 0 }, 0, 0 #endif }, { PPC_TLBSYNC, PPC_INS_TLBSYNC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_TLBWE, PPC_INS_TLBWE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_BOOKE, 0 }, 0, 0 #endif }, { PPC_TLBWE2, PPC_INS_TLBWE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_PPC4XX, 0 }, 0, 0 #endif }, { PPC_TRAP, PPC_INS_TRAP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_TW, PPC_INS_TW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_TWI, PPC_INS_TWI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_VADDCUW, PPC_INS_VADDCUW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VADDFP, PPC_INS_VADDFP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VADDSBS, PPC_INS_VADDSBS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VADDSHS, PPC_INS_VADDSHS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VADDSWS, PPC_INS_VADDSWS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VADDUBM, PPC_INS_VADDUBM, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VADDUBS, PPC_INS_VADDUBS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VADDUHM, PPC_INS_VADDUHM, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VADDUHS, PPC_INS_VADDUHS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VADDUWM, PPC_INS_VADDUWM, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VADDUWS, PPC_INS_VADDUWS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VAND, PPC_INS_VAND, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VANDC, PPC_INS_VANDC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VAVGSB, PPC_INS_VAVGSB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VAVGSH, PPC_INS_VAVGSH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VAVGSW, PPC_INS_VAVGSW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VAVGUB, PPC_INS_VAVGUB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VAVGUH, PPC_INS_VAVGUH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VAVGUW, PPC_INS_VAVGUW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCFSX, PPC_INS_VCFSX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCFSX_0, PPC_INS_VCFSX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCFUX, PPC_INS_VCFUX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCFUX_0, PPC_INS_VCFUX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCMPBFP, PPC_INS_VCMPBFP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCMPBFPo, PPC_INS_VCMPBFP, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR6, 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCMPEQFP, PPC_INS_VCMPEQFP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCMPEQFPo, PPC_INS_VCMPEQFP, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR6, 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCMPEQUB, PPC_INS_VCMPEQUB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCMPEQUBo, PPC_INS_VCMPEQUB, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR6, 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCMPEQUH, PPC_INS_VCMPEQUH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCMPEQUHo, PPC_INS_VCMPEQUH, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR6, 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCMPEQUW, PPC_INS_VCMPEQUW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCMPEQUWo, PPC_INS_VCMPEQUW, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR6, 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCMPGEFP, PPC_INS_VCMPGEFP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCMPGEFPo, PPC_INS_VCMPGEFP, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR6, 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCMPGTFP, PPC_INS_VCMPGTFP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCMPGTFPo, PPC_INS_VCMPGTFP, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR6, 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCMPGTSB, PPC_INS_VCMPGTSB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCMPGTSBo, PPC_INS_VCMPGTSB, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR6, 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCMPGTSH, PPC_INS_VCMPGTSH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCMPGTSHo, PPC_INS_VCMPGTSH, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR6, 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCMPGTSW, PPC_INS_VCMPGTSW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCMPGTSWo, PPC_INS_VCMPGTSW, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR6, 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCMPGTUB, PPC_INS_VCMPGTUB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCMPGTUBo, PPC_INS_VCMPGTUB, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR6, 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCMPGTUH, PPC_INS_VCMPGTUH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCMPGTUHo, PPC_INS_VCMPGTUH, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR6, 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCMPGTUW, PPC_INS_VCMPGTUW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCMPGTUWo, PPC_INS_VCMPGTUW, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR6, 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCTSXS, PPC_INS_VCTSXS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCTSXS_0, PPC_INS_VCTSXS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCTUXS, PPC_INS_VCTUXS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VCTUXS_0, PPC_INS_VCTUXS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VEXPTEFP, PPC_INS_VEXPTEFP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VLOGEFP, PPC_INS_VLOGEFP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMADDFP, PPC_INS_VMADDFP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMAXFP, PPC_INS_VMAXFP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMAXSB, PPC_INS_VMAXSB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMAXSH, PPC_INS_VMAXSH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMAXSW, PPC_INS_VMAXSW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMAXUB, PPC_INS_VMAXUB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMAXUH, PPC_INS_VMAXUH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMAXUW, PPC_INS_VMAXUW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMHADDSHS, PPC_INS_VMHADDSHS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMHRADDSHS, PPC_INS_VMHRADDSHS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMINFP, PPC_INS_VMINFP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMINSB, PPC_INS_VMINSB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMINSH, PPC_INS_VMINSH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMINSW, PPC_INS_VMINSW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMINUB, PPC_INS_VMINUB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMINUH, PPC_INS_VMINUH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMINUW, PPC_INS_VMINUW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMLADDUHM, PPC_INS_VMLADDUHM, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMRGHB, PPC_INS_VMRGHB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMRGHH, PPC_INS_VMRGHH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMRGHW, PPC_INS_VMRGHW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMRGLB, PPC_INS_VMRGLB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMRGLH, PPC_INS_VMRGLH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMRGLW, PPC_INS_VMRGLW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMSUMMBM, PPC_INS_VMSUMMBM, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMSUMSHM, PPC_INS_VMSUMSHM, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMSUMSHS, PPC_INS_VMSUMSHS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMSUMUBM, PPC_INS_VMSUMUBM, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMSUMUHM, PPC_INS_VMSUMUHM, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMSUMUHS, PPC_INS_VMSUMUHS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMULESB, PPC_INS_VMULESB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMULESH, PPC_INS_VMULESH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMULEUB, PPC_INS_VMULEUB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMULEUH, PPC_INS_VMULEUH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMULOSB, PPC_INS_VMULOSB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMULOSH, PPC_INS_VMULOSH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMULOUB, PPC_INS_VMULOUB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VMULOUH, PPC_INS_VMULOUH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VNMSUBFP, PPC_INS_VNMSUBFP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VNOR, PPC_INS_VNOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VOR, PPC_INS_VOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VPERM, PPC_INS_VPERM, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VPKPX, PPC_INS_VPKPX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VPKSHSS, PPC_INS_VPKSHSS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VPKSHUS, PPC_INS_VPKSHUS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VPKSWSS, PPC_INS_VPKSWSS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VPKSWUS, PPC_INS_VPKSWUS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VPKUHUM, PPC_INS_VPKUHUM, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VPKUHUS, PPC_INS_VPKUHUS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VPKUWUM, PPC_INS_VPKUWUM, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VPKUWUS, PPC_INS_VPKUWUS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VREFP, PPC_INS_VREFP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VRFIM, PPC_INS_VRFIM, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VRFIN, PPC_INS_VRFIN, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VRFIP, PPC_INS_VRFIP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VRFIZ, PPC_INS_VRFIZ, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VRLB, PPC_INS_VRLB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VRLH, PPC_INS_VRLH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VRLW, PPC_INS_VRLW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VRSQRTEFP, PPC_INS_VRSQRTEFP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSEL, PPC_INS_VSEL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSL, PPC_INS_VSL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSLB, PPC_INS_VSLB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSLDOI, PPC_INS_VSLDOI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSLH, PPC_INS_VSLH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSLO, PPC_INS_VSLO, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSLW, PPC_INS_VSLW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSPLTB, PPC_INS_VSPLTB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSPLTH, PPC_INS_VSPLTH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSPLTISB, PPC_INS_VSPLTISB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSPLTISH, PPC_INS_VSPLTISH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSPLTISW, PPC_INS_VSPLTISW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSPLTW, PPC_INS_VSPLTW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSR, PPC_INS_VSR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSRAB, PPC_INS_VSRAB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSRAH, PPC_INS_VSRAH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSRAW, PPC_INS_VSRAW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSRB, PPC_INS_VSRB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSRH, PPC_INS_VSRH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSRO, PPC_INS_VSRO, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSRW, PPC_INS_VSRW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSUBCUW, PPC_INS_VSUBCUW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSUBFP, PPC_INS_VSUBFP, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSUBSBS, PPC_INS_VSUBSBS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSUBSHS, PPC_INS_VSUBSHS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSUBSWS, PPC_INS_VSUBSWS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSUBUBM, PPC_INS_VSUBUBM, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSUBUBS, PPC_INS_VSUBUBS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSUBUHM, PPC_INS_VSUBUHM, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSUBUHS, PPC_INS_VSUBUHS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSUBUWM, PPC_INS_VSUBUWM, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSUBUWS, PPC_INS_VSUBUWS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSUM2SWS, PPC_INS_VSUM2SWS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSUM4SBS, PPC_INS_VSUM4SBS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSUM4SHS, PPC_INS_VSUM4SHS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSUM4UBS, PPC_INS_VSUM4UBS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VSUMSWS, PPC_INS_VSUMSWS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VUPKHPX, PPC_INS_VUPKHPX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VUPKHSB, PPC_INS_VUPKHSB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VUPKHSH, PPC_INS_VUPKHSH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VUPKLPX, PPC_INS_VUPKLPX, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VUPKLSB, PPC_INS_VUPKLSB, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VUPKLSH, PPC_INS_VUPKLSH, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_VXOR, PPC_INS_VXOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_V_SET0, PPC_INS_VXOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_V_SET0B, PPC_INS_VXOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_V_SET0H, PPC_INS_VXOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_V_SETALLONES, PPC_INS_VSPLTISW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_V_SETALLONESB, PPC_INS_VSPLTISW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_V_SETALLONESH, PPC_INS_VSPLTISW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_ALTIVEC, 0 }, 0, 0 #endif }, { PPC_WAIT, PPC_INS_WAIT, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_WRTEE, PPC_INS_WRTEE, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_BOOKE, 0 }, 0, 0 #endif }, { PPC_WRTEEI, PPC_INS_WRTEEI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_BOOKE, 0 }, 0, 0 #endif }, { PPC_XOR, PPC_INS_XOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_XOR8, PPC_INS_XOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_XOR8o, PPC_INS_XOR, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_XORI, PPC_INS_XORI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_XORI8, PPC_INS_XORI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_XORIS, PPC_INS_XORIS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_XORIS8, PPC_INS_XORIS, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { 0 }, 0, 0 #endif }, { PPC_XORo, PPC_INS_XOR, #ifndef CAPSTONE_DIET { 0 }, { PPC_REG_CR0, 0 }, { 0 }, 0, 0 #endif }, { PPC_XSABSDP, PPC_INS_XSABSDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSADDDP, PPC_INS_XSADDDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSCMPODP, PPC_INS_XSCMPODP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSCMPUDP, PPC_INS_XSCMPUDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSCPSGNDP, PPC_INS_XSCPSGNDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSCVDPSP, PPC_INS_XSCVDPSP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSCVDPSXDS, PPC_INS_XSCVDPSXDS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSCVDPSXWS, PPC_INS_XSCVDPSXWS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSCVDPUXDS, PPC_INS_XSCVDPUXDS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSCVDPUXWS, PPC_INS_XSCVDPUXWS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSCVSPDP, PPC_INS_XSCVSPDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSCVSXDDP, PPC_INS_XSCVSXDDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSCVUXDDP, PPC_INS_XSCVUXDDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSDIVDP, PPC_INS_XSDIVDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSMADDADP, PPC_INS_XSMADDADP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSMADDMDP, PPC_INS_XSMADDMDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSMAXDP, PPC_INS_XSMAXDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSMINDP, PPC_INS_XSMINDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSMSUBADP, PPC_INS_XSMSUBADP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSMSUBMDP, PPC_INS_XSMSUBMDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSMULDP, PPC_INS_XSMULDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSNABSDP, PPC_INS_XSNABSDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSNEGDP, PPC_INS_XSNEGDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSNMADDADP, PPC_INS_XSNMADDADP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSNMADDMDP, PPC_INS_XSNMADDMDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSNMSUBADP, PPC_INS_XSNMSUBADP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSNMSUBMDP, PPC_INS_XSNMSUBMDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSRDPI, PPC_INS_XSRDPI, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSRDPIC, PPC_INS_XSRDPIC, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSRDPIM, PPC_INS_XSRDPIM, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSRDPIP, PPC_INS_XSRDPIP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSRDPIZ, PPC_INS_XSRDPIZ, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSREDP, PPC_INS_XSREDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSRSQRTEDP, PPC_INS_XSRSQRTEDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSSQRTDP, PPC_INS_XSSQRTDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSSUBDP, PPC_INS_XSSUBDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSTDIVDP, PPC_INS_XSTDIVDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XSTSQRTDP, PPC_INS_XSTSQRTDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVABSDP, PPC_INS_XVABSDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVABSSP, PPC_INS_XVABSSP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVADDDP, PPC_INS_XVADDDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVADDSP, PPC_INS_XVADDSP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVCMPEQDP, PPC_INS_XVCMPEQDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVCMPEQDPo, PPC_INS_XVCMPEQDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR6, 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVCMPEQSP, PPC_INS_XVCMPEQSP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVCMPEQSPo, PPC_INS_XVCMPEQSP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR6, 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVCMPGEDP, PPC_INS_XVCMPGEDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVCMPGEDPo, PPC_INS_XVCMPGEDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR6, 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVCMPGESP, PPC_INS_XVCMPGESP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVCMPGESPo, PPC_INS_XVCMPGESP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR6, 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVCMPGTDP, PPC_INS_XVCMPGTDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVCMPGTDPo, PPC_INS_XVCMPGTDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR6, 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVCMPGTSP, PPC_INS_XVCMPGTSP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVCMPGTSPo, PPC_INS_XVCMPGTSP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { PPC_REG_CR6, 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVCPSGNDP, PPC_INS_XVCPSGNDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVCPSGNSP, PPC_INS_XVCPSGNSP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVCVDPSP, PPC_INS_XVCVDPSP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVCVDPSXDS, PPC_INS_XVCVDPSXDS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVCVDPSXWS, PPC_INS_XVCVDPSXWS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVCVDPUXDS, PPC_INS_XVCVDPUXDS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVCVDPUXWS, PPC_INS_XVCVDPUXWS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVCVSPDP, PPC_INS_XVCVSPDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVCVSPSXDS, PPC_INS_XVCVSPSXDS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVCVSPSXWS, PPC_INS_XVCVSPSXWS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVCVSPUXDS, PPC_INS_XVCVSPUXDS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVCVSPUXWS, PPC_INS_XVCVSPUXWS, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVCVSXDDP, PPC_INS_XVCVSXDDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVCVSXDSP, PPC_INS_XVCVSXDSP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVCVSXWDP, PPC_INS_XVCVSXWDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVCVSXWSP, PPC_INS_XVCVSXWSP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVCVUXDDP, PPC_INS_XVCVUXDDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVCVUXDSP, PPC_INS_XVCVUXDSP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVCVUXWDP, PPC_INS_XVCVUXWDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVCVUXWSP, PPC_INS_XVCVUXWSP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVDIVDP, PPC_INS_XVDIVDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVDIVSP, PPC_INS_XVDIVSP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVMADDADP, PPC_INS_XVMADDADP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVMADDASP, PPC_INS_XVMADDASP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVMADDMDP, PPC_INS_XVMADDMDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVMADDMSP, PPC_INS_XVMADDMSP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVMAXDP, PPC_INS_XVMAXDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVMAXSP, PPC_INS_XVMAXSP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVMINDP, PPC_INS_XVMINDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVMINSP, PPC_INS_XVMINSP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVMSUBADP, PPC_INS_XVMSUBADP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVMSUBASP, PPC_INS_XVMSUBASP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVMSUBMDP, PPC_INS_XVMSUBMDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVMSUBMSP, PPC_INS_XVMSUBMSP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVMULDP, PPC_INS_XVMULDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVMULSP, PPC_INS_XVMULSP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVNABSDP, PPC_INS_XVNABSDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVNABSSP, PPC_INS_XVNABSSP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVNEGDP, PPC_INS_XVNEGDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVNEGSP, PPC_INS_XVNEGSP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVNMADDADP, PPC_INS_XVNMADDADP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVNMADDASP, PPC_INS_XVNMADDASP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVNMADDMDP, PPC_INS_XVNMADDMDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVNMADDMSP, PPC_INS_XVNMADDMSP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVNMSUBADP, PPC_INS_XVNMSUBADP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVNMSUBASP, PPC_INS_XVNMSUBASP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVNMSUBMDP, PPC_INS_XVNMSUBMDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVNMSUBMSP, PPC_INS_XVNMSUBMSP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVRDPI, PPC_INS_XVRDPI, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVRDPIC, PPC_INS_XVRDPIC, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVRDPIM, PPC_INS_XVRDPIM, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVRDPIP, PPC_INS_XVRDPIP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVRDPIZ, PPC_INS_XVRDPIZ, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVREDP, PPC_INS_XVREDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVRESP, PPC_INS_XVRESP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVRSPI, PPC_INS_XVRSPI, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVRSPIC, PPC_INS_XVRSPIC, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVRSPIM, PPC_INS_XVRSPIM, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVRSPIP, PPC_INS_XVRSPIP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVRSPIZ, PPC_INS_XVRSPIZ, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVRSQRTEDP, PPC_INS_XVRSQRTEDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVRSQRTESP, PPC_INS_XVRSQRTESP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVSQRTDP, PPC_INS_XVSQRTDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVSQRTSP, PPC_INS_XVSQRTSP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVSUBDP, PPC_INS_XVSUBDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVSUBSP, PPC_INS_XVSUBSP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVTDIVDP, PPC_INS_XVTDIVDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVTDIVSP, PPC_INS_XVTDIVSP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVTSQRTDP, PPC_INS_XVTSQRTDP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XVTSQRTSP, PPC_INS_XVTSQRTSP, #ifndef CAPSTONE_DIET { PPC_REG_RM, 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XXLAND, PPC_INS_XXLAND, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XXLANDC, PPC_INS_XXLANDC, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XXLNOR, PPC_INS_XXLNOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XXLOR, PPC_INS_XXLOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XXLORf, PPC_INS_XXLOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XXLXOR, PPC_INS_XXLXOR, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XXMRGHW, PPC_INS_XXMRGHW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XXMRGLW, PPC_INS_XXMRGLW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XXPERMDI, PPC_INS_XXPERMDI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XXSEL, PPC_INS_XXSEL, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XXSLDWI, PPC_INS_XXSLDWI, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_XXSPLTW, PPC_INS_XXSPLTW, #ifndef CAPSTONE_DIET { 0 }, { 0 }, { PPC_GRP_VSX, 0 }, 0, 0 #endif }, { PPC_gBC, PPC_INS_BC, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_RM, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 0, 0 #endif }, { PPC_gBCA, PPC_INS_BCA, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_RM, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 0, 0 #endif }, { PPC_gBCCTR, PPC_INS_BCCTR, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_LR, PPC_REG_RM, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 0, 0 #endif }, { PPC_gBCCTRL, PPC_INS_BCCTRL, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_LR, PPC_REG_RM, 0 }, { PPC_REG_LR, PPC_REG_CTR, 0 }, { 0 }, 0, 0 #endif }, { PPC_gBCL, PPC_INS_BCL, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_RM, 0 }, { PPC_REG_LR, PPC_REG_CTR, 0 }, { 0 }, 0, 0 #endif }, { PPC_gBCLA, PPC_INS_BCLA, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_RM, 0 }, { PPC_REG_LR, PPC_REG_CTR, 0 }, { 0 }, 0, 0 #endif }, { PPC_gBCLR, PPC_INS_BCLR, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_LR, PPC_REG_RM, 0 }, { PPC_REG_CTR, 0 }, { 0 }, 0, 0 #endif }, { PPC_gBCLRL, PPC_INS_BCLRL, #ifndef CAPSTONE_DIET { PPC_REG_CTR, PPC_REG_LR, PPC_REG_RM, 0 }, { PPC_REG_LR, PPC_REG_CTR, 0 }, { 0 }, 0, 0 #endif }, }; // given internal insn id, return public instruction info void PPC_get_insn_id(cs_struct *h, cs_insn *insn, unsigned int id) { int i; i = insn_find(insns, ARR_SIZE(insns), id, &h->insn_cache); if (i != 0) { insn->id = insns[i].mapid; if (h->detail) { #ifndef CAPSTONE_DIET cs_struct handle; handle.detail = h->detail; memcpy(insn->detail->regs_read, insns[i].regs_use, sizeof(insns[i].regs_use)); insn->detail->regs_read_count = (uint8_t)count_positive(insns[i].regs_use); memcpy(insn->detail->regs_write, insns[i].regs_mod, sizeof(insns[i].regs_mod)); insn->detail->regs_write_count = (uint8_t)count_positive(insns[i].regs_mod); memcpy(insn->detail->groups, insns[i].groups, sizeof(insns[i].groups)); insn->detail->groups_count = (uint8_t)count_positive(insns[i].groups); if (insns[i].branch || insns[i].indirect_branch) { // this insn also belongs to JUMP group. add JUMP group insn->detail->groups[insn->detail->groups_count] = PPC_GRP_JUMP; insn->detail->groups_count++; } insn->detail->ppc.update_cr0 = cs_reg_write((csh)&handle, insn, PPC_REG_CR0); #endif } } } #ifndef CAPSTONE_DIET static name_map insn_name_maps[] = { { PPC_INS_INVALID, NULL }, { PPC_INS_ADD, "add" }, { PPC_INS_ADDC, "addc" }, { PPC_INS_ADDE, "adde" }, { PPC_INS_ADDI, "addi" }, { PPC_INS_ADDIC, "addic" }, { PPC_INS_ADDIS, "addis" }, { PPC_INS_ADDME, "addme" }, { PPC_INS_ADDZE, "addze" }, { PPC_INS_AND, "and" }, { PPC_INS_ANDC, "andc" }, { PPC_INS_ANDIS, "andis" }, { PPC_INS_ANDI, "andi" }, { PPC_INS_B, "b" }, { PPC_INS_BA, "ba" }, { PPC_INS_BC, "bc" }, { PPC_INS_BCCTR, "bcctr" }, { PPC_INS_BCCTRL, "bcctrl" }, { PPC_INS_BCL, "bcl" }, { PPC_INS_BCLR, "bclr" }, { PPC_INS_BCLRL, "bclrl" }, { PPC_INS_BCTR, "bctr" }, { PPC_INS_BCTRL, "bctrl" }, { PPC_INS_BDNZ, "bdnz" }, { PPC_INS_BDNZA, "bdnza" }, { PPC_INS_BDNZL, "bdnzl" }, { PPC_INS_BDNZLA, "bdnzla" }, { PPC_INS_BDNZLR, "bdnzlr" }, { PPC_INS_BDNZLRL, "bdnzlrl" }, { PPC_INS_BDZ, "bdz" }, { PPC_INS_BDZA, "bdza" }, { PPC_INS_BDZL, "bdzl" }, { PPC_INS_BDZLA, "bdzla" }, { PPC_INS_BDZLR, "bdzlr" }, { PPC_INS_BDZLRL, "bdzlrl" }, { PPC_INS_BL, "bl" }, { PPC_INS_BLA, "bla" }, { PPC_INS_BLR, "blr" }, { PPC_INS_BLRL, "blrl" }, { PPC_INS_BRINC, "brinc" }, { PPC_INS_CMPD, "cmpd" }, { PPC_INS_CMPDI, "cmpdi" }, { PPC_INS_CMPLD, "cmpld" }, { PPC_INS_CMPLDI, "cmpldi" }, { PPC_INS_CMPLW, "cmplw" }, { PPC_INS_CMPLWI, "cmplwi" }, { PPC_INS_CMPW, "cmpw" }, { PPC_INS_CMPWI, "cmpwi" }, { PPC_INS_CNTLZD, "cntlzd" }, { PPC_INS_CNTLZW, "cntlzw" }, { PPC_INS_CREQV, "creqv" }, { PPC_INS_CRXOR, "crxor" }, { PPC_INS_CRAND, "crand" }, { PPC_INS_CRANDC, "crandc" }, { PPC_INS_CRNAND, "crnand" }, { PPC_INS_CRNOR, "crnor" }, { PPC_INS_CROR, "cror" }, { PPC_INS_CRORC, "crorc" }, { PPC_INS_DCBA, "dcba" }, { PPC_INS_DCBF, "dcbf" }, { PPC_INS_DCBI, "dcbi" }, { PPC_INS_DCBST, "dcbst" }, { PPC_INS_DCBT, "dcbt" }, { PPC_INS_DCBTST, "dcbtst" }, { PPC_INS_DCBZ, "dcbz" }, { PPC_INS_DCBZL, "dcbzl" }, { PPC_INS_DCCCI, "dccci" }, { PPC_INS_DIVD, "divd" }, { PPC_INS_DIVDU, "divdu" }, { PPC_INS_DIVW, "divw" }, { PPC_INS_DIVWU, "divwu" }, { PPC_INS_DSS, "dss" }, { PPC_INS_DSSALL, "dssall" }, { PPC_INS_DST, "dst" }, { PPC_INS_DSTST, "dstst" }, { PPC_INS_DSTSTT, "dststt" }, { PPC_INS_DSTT, "dstt" }, { PPC_INS_EIEIO, "eieio" }, { PPC_INS_EQV, "eqv" }, { PPC_INS_EVABS, "evabs" }, { PPC_INS_EVADDIW, "evaddiw" }, { PPC_INS_EVADDSMIAAW, "evaddsmiaaw" }, { PPC_INS_EVADDSSIAAW, "evaddssiaaw" }, { PPC_INS_EVADDUMIAAW, "evaddumiaaw" }, { PPC_INS_EVADDUSIAAW, "evaddusiaaw" }, { PPC_INS_EVADDW, "evaddw" }, { PPC_INS_EVAND, "evand" }, { PPC_INS_EVANDC, "evandc" }, { PPC_INS_EVCMPEQ, "evcmpeq" }, { PPC_INS_EVCMPGTS, "evcmpgts" }, { PPC_INS_EVCMPGTU, "evcmpgtu" }, { PPC_INS_EVCMPLTS, "evcmplts" }, { PPC_INS_EVCMPLTU, "evcmpltu" }, { PPC_INS_EVCNTLSW, "evcntlsw" }, { PPC_INS_EVCNTLZW, "evcntlzw" }, { PPC_INS_EVDIVWS, "evdivws" }, { PPC_INS_EVDIVWU, "evdivwu" }, { PPC_INS_EVEQV, "eveqv" }, { PPC_INS_EVEXTSB, "evextsb" }, { PPC_INS_EVEXTSH, "evextsh" }, { PPC_INS_EVLDD, "evldd" }, { PPC_INS_EVLDDX, "evlddx" }, { PPC_INS_EVLDH, "evldh" }, { PPC_INS_EVLDHX, "evldhx" }, { PPC_INS_EVLDW, "evldw" }, { PPC_INS_EVLDWX, "evldwx" }, { PPC_INS_EVLHHESPLAT, "evlhhesplat" }, { PPC_INS_EVLHHESPLATX, "evlhhesplatx" }, { PPC_INS_EVLHHOSSPLAT, "evlhhossplat" }, { PPC_INS_EVLHHOSSPLATX, "evlhhossplatx" }, { PPC_INS_EVLHHOUSPLAT, "evlhhousplat" }, { PPC_INS_EVLHHOUSPLATX, "evlhhousplatx" }, { PPC_INS_EVLWHE, "evlwhe" }, { PPC_INS_EVLWHEX, "evlwhex" }, { PPC_INS_EVLWHOS, "evlwhos" }, { PPC_INS_EVLWHOSX, "evlwhosx" }, { PPC_INS_EVLWHOU, "evlwhou" }, { PPC_INS_EVLWHOUX, "evlwhoux" }, { PPC_INS_EVLWHSPLAT, "evlwhsplat" }, { PPC_INS_EVLWHSPLATX, "evlwhsplatx" }, { PPC_INS_EVLWWSPLAT, "evlwwsplat" }, { PPC_INS_EVLWWSPLATX, "evlwwsplatx" }, { PPC_INS_EVMERGEHI, "evmergehi" }, { PPC_INS_EVMERGEHILO, "evmergehilo" }, { PPC_INS_EVMERGELO, "evmergelo" }, { PPC_INS_EVMERGELOHI, "evmergelohi" }, { PPC_INS_EVMHEGSMFAA, "evmhegsmfaa" }, { PPC_INS_EVMHEGSMFAN, "evmhegsmfan" }, { PPC_INS_EVMHEGSMIAA, "evmhegsmiaa" }, { PPC_INS_EVMHEGSMIAN, "evmhegsmian" }, { PPC_INS_EVMHEGUMIAA, "evmhegumiaa" }, { PPC_INS_EVMHEGUMIAN, "evmhegumian" }, { PPC_INS_EVMHESMF, "evmhesmf" }, { PPC_INS_EVMHESMFA, "evmhesmfa" }, { PPC_INS_EVMHESMFAAW, "evmhesmfaaw" }, { PPC_INS_EVMHESMFANW, "evmhesmfanw" }, { PPC_INS_EVMHESMI, "evmhesmi" }, { PPC_INS_EVMHESMIA, "evmhesmia" }, { PPC_INS_EVMHESMIAAW, "evmhesmiaaw" }, { PPC_INS_EVMHESMIANW, "evmhesmianw" }, { PPC_INS_EVMHESSF, "evmhessf" }, { PPC_INS_EVMHESSFA, "evmhessfa" }, { PPC_INS_EVMHESSFAAW, "evmhessfaaw" }, { PPC_INS_EVMHESSFANW, "evmhessfanw" }, { PPC_INS_EVMHESSIAAW, "evmhessiaaw" }, { PPC_INS_EVMHESSIANW, "evmhessianw" }, { PPC_INS_EVMHEUMI, "evmheumi" }, { PPC_INS_EVMHEUMIA, "evmheumia" }, { PPC_INS_EVMHEUMIAAW, "evmheumiaaw" }, { PPC_INS_EVMHEUMIANW, "evmheumianw" }, { PPC_INS_EVMHEUSIAAW, "evmheusiaaw" }, { PPC_INS_EVMHEUSIANW, "evmheusianw" }, { PPC_INS_EVMHOGSMFAA, "evmhogsmfaa" }, { PPC_INS_EVMHOGSMFAN, "evmhogsmfan" }, { PPC_INS_EVMHOGSMIAA, "evmhogsmiaa" }, { PPC_INS_EVMHOGSMIAN, "evmhogsmian" }, { PPC_INS_EVMHOGUMIAA, "evmhogumiaa" }, { PPC_INS_EVMHOGUMIAN, "evmhogumian" }, { PPC_INS_EVMHOSMF, "evmhosmf" }, { PPC_INS_EVMHOSMFA, "evmhosmfa" }, { PPC_INS_EVMHOSMFAAW, "evmhosmfaaw" }, { PPC_INS_EVMHOSMFANW, "evmhosmfanw" }, { PPC_INS_EVMHOSMI, "evmhosmi" }, { PPC_INS_EVMHOSMIA, "evmhosmia" }, { PPC_INS_EVMHOSMIAAW, "evmhosmiaaw" }, { PPC_INS_EVMHOSMIANW, "evmhosmianw" }, { PPC_INS_EVMHOSSF, "evmhossf" }, { PPC_INS_EVMHOSSFA, "evmhossfa" }, { PPC_INS_EVMHOSSFAAW, "evmhossfaaw" }, { PPC_INS_EVMHOSSFANW, "evmhossfanw" }, { PPC_INS_EVMHOSSIAAW, "evmhossiaaw" }, { PPC_INS_EVMHOSSIANW, "evmhossianw" }, { PPC_INS_EVMHOUMI, "evmhoumi" }, { PPC_INS_EVMHOUMIA, "evmhoumia" }, { PPC_INS_EVMHOUMIAAW, "evmhoumiaaw" }, { PPC_INS_EVMHOUMIANW, "evmhoumianw" }, { PPC_INS_EVMHOUSIAAW, "evmhousiaaw" }, { PPC_INS_EVMHOUSIANW, "evmhousianw" }, { PPC_INS_EVMRA, "evmra" }, { PPC_INS_EVMWHSMF, "evmwhsmf" }, { PPC_INS_EVMWHSMFA, "evmwhsmfa" }, { PPC_INS_EVMWHSMI, "evmwhsmi" }, { PPC_INS_EVMWHSMIA, "evmwhsmia" }, { PPC_INS_EVMWHSSF, "evmwhssf" }, { PPC_INS_EVMWHSSFA, "evmwhssfa" }, { PPC_INS_EVMWHUMI, "evmwhumi" }, { PPC_INS_EVMWHUMIA, "evmwhumia" }, { PPC_INS_EVMWLSMIAAW, "evmwlsmiaaw" }, { PPC_INS_EVMWLSMIANW, "evmwlsmianw" }, { PPC_INS_EVMWLSSIAAW, "evmwlssiaaw" }, { PPC_INS_EVMWLSSIANW, "evmwlssianw" }, { PPC_INS_EVMWLUMI, "evmwlumi" }, { PPC_INS_EVMWLUMIA, "evmwlumia" }, { PPC_INS_EVMWLUMIAAW, "evmwlumiaaw" }, { PPC_INS_EVMWLUMIANW, "evmwlumianw" }, { PPC_INS_EVMWLUSIAAW, "evmwlusiaaw" }, { PPC_INS_EVMWLUSIANW, "evmwlusianw" }, { PPC_INS_EVMWSMF, "evmwsmf" }, { PPC_INS_EVMWSMFA, "evmwsmfa" }, { PPC_INS_EVMWSMFAA, "evmwsmfaa" }, { PPC_INS_EVMWSMFAN, "evmwsmfan" }, { PPC_INS_EVMWSMI, "evmwsmi" }, { PPC_INS_EVMWSMIA, "evmwsmia" }, { PPC_INS_EVMWSMIAA, "evmwsmiaa" }, { PPC_INS_EVMWSMIAN, "evmwsmian" }, { PPC_INS_EVMWSSF, "evmwssf" }, { PPC_INS_EVMWSSFA, "evmwssfa" }, { PPC_INS_EVMWSSFAA, "evmwssfaa" }, { PPC_INS_EVMWSSFAN, "evmwssfan" }, { PPC_INS_EVMWUMI, "evmwumi" }, { PPC_INS_EVMWUMIA, "evmwumia" }, { PPC_INS_EVMWUMIAA, "evmwumiaa" }, { PPC_INS_EVMWUMIAN, "evmwumian" }, { PPC_INS_EVNAND, "evnand" }, { PPC_INS_EVNEG, "evneg" }, { PPC_INS_EVNOR, "evnor" }, { PPC_INS_EVOR, "evor" }, { PPC_INS_EVORC, "evorc" }, { PPC_INS_EVRLW, "evrlw" }, { PPC_INS_EVRLWI, "evrlwi" }, { PPC_INS_EVRNDW, "evrndw" }, { PPC_INS_EVSLW, "evslw" }, { PPC_INS_EVSLWI, "evslwi" }, { PPC_INS_EVSPLATFI, "evsplatfi" }, { PPC_INS_EVSPLATI, "evsplati" }, { PPC_INS_EVSRWIS, "evsrwis" }, { PPC_INS_EVSRWIU, "evsrwiu" }, { PPC_INS_EVSRWS, "evsrws" }, { PPC_INS_EVSRWU, "evsrwu" }, { PPC_INS_EVSTDD, "evstdd" }, { PPC_INS_EVSTDDX, "evstddx" }, { PPC_INS_EVSTDH, "evstdh" }, { PPC_INS_EVSTDHX, "evstdhx" }, { PPC_INS_EVSTDW, "evstdw" }, { PPC_INS_EVSTDWX, "evstdwx" }, { PPC_INS_EVSTWHE, "evstwhe" }, { PPC_INS_EVSTWHEX, "evstwhex" }, { PPC_INS_EVSTWHO, "evstwho" }, { PPC_INS_EVSTWHOX, "evstwhox" }, { PPC_INS_EVSTWWE, "evstwwe" }, { PPC_INS_EVSTWWEX, "evstwwex" }, { PPC_INS_EVSTWWO, "evstwwo" }, { PPC_INS_EVSTWWOX, "evstwwox" }, { PPC_INS_EVSUBFSMIAAW, "evsubfsmiaaw" }, { PPC_INS_EVSUBFSSIAAW, "evsubfssiaaw" }, { PPC_INS_EVSUBFUMIAAW, "evsubfumiaaw" }, { PPC_INS_EVSUBFUSIAAW, "evsubfusiaaw" }, { PPC_INS_EVSUBFW, "evsubfw" }, { PPC_INS_EVSUBIFW, "evsubifw" }, { PPC_INS_EVXOR, "evxor" }, { PPC_INS_EXTSB, "extsb" }, { PPC_INS_EXTSH, "extsh" }, { PPC_INS_EXTSW, "extsw" }, { PPC_INS_FABS, "fabs" }, { PPC_INS_FADD, "fadd" }, { PPC_INS_FADDS, "fadds" }, { PPC_INS_FCFID, "fcfid" }, { PPC_INS_FCFIDS, "fcfids" }, { PPC_INS_FCFIDU, "fcfidu" }, { PPC_INS_FCFIDUS, "fcfidus" }, { PPC_INS_FCMPU, "fcmpu" }, { PPC_INS_FCPSGN, "fcpsgn" }, { PPC_INS_FCTID, "fctid" }, { PPC_INS_FCTIDUZ, "fctiduz" }, { PPC_INS_FCTIDZ, "fctidz" }, { PPC_INS_FCTIW, "fctiw" }, { PPC_INS_FCTIWUZ, "fctiwuz" }, { PPC_INS_FCTIWZ, "fctiwz" }, { PPC_INS_FDIV, "fdiv" }, { PPC_INS_FDIVS, "fdivs" }, { PPC_INS_FMADD, "fmadd" }, { PPC_INS_FMADDS, "fmadds" }, { PPC_INS_FMR, "fmr" }, { PPC_INS_FMSUB, "fmsub" }, { PPC_INS_FMSUBS, "fmsubs" }, { PPC_INS_FMUL, "fmul" }, { PPC_INS_FMULS, "fmuls" }, { PPC_INS_FNABS, "fnabs" }, { PPC_INS_FNEG, "fneg" }, { PPC_INS_FNMADD, "fnmadd" }, { PPC_INS_FNMADDS, "fnmadds" }, { PPC_INS_FNMSUB, "fnmsub" }, { PPC_INS_FNMSUBS, "fnmsubs" }, { PPC_INS_FRE, "fre" }, { PPC_INS_FRES, "fres" }, { PPC_INS_FRIM, "frim" }, { PPC_INS_FRIN, "frin" }, { PPC_INS_FRIP, "frip" }, { PPC_INS_FRIZ, "friz" }, { PPC_INS_FRSP, "frsp" }, { PPC_INS_FRSQRTE, "frsqrte" }, { PPC_INS_FRSQRTES, "frsqrtes" }, { PPC_INS_FSEL, "fsel" }, { PPC_INS_FSQRT, "fsqrt" }, { PPC_INS_FSQRTS, "fsqrts" }, { PPC_INS_FSUB, "fsub" }, { PPC_INS_FSUBS, "fsubs" }, { PPC_INS_ICBI, "icbi" }, { PPC_INS_ICCCI, "iccci" }, { PPC_INS_ISEL, "isel" }, { PPC_INS_ISYNC, "isync" }, { PPC_INS_LA, "la" }, { PPC_INS_LBZ, "lbz" }, { PPC_INS_LBZU, "lbzu" }, { PPC_INS_LBZUX, "lbzux" }, { PPC_INS_LBZX, "lbzx" }, { PPC_INS_LD, "ld" }, { PPC_INS_LDARX, "ldarx" }, { PPC_INS_LDBRX, "ldbrx" }, { PPC_INS_LDU, "ldu" }, { PPC_INS_LDUX, "ldux" }, { PPC_INS_LDX, "ldx" }, { PPC_INS_LFD, "lfd" }, { PPC_INS_LFDU, "lfdu" }, { PPC_INS_LFDUX, "lfdux" }, { PPC_INS_LFDX, "lfdx" }, { PPC_INS_LFIWAX, "lfiwax" }, { PPC_INS_LFIWZX, "lfiwzx" }, { PPC_INS_LFS, "lfs" }, { PPC_INS_LFSU, "lfsu" }, { PPC_INS_LFSUX, "lfsux" }, { PPC_INS_LFSX, "lfsx" }, { PPC_INS_LHA, "lha" }, { PPC_INS_LHAU, "lhau" }, { PPC_INS_LHAUX, "lhaux" }, { PPC_INS_LHAX, "lhax" }, { PPC_INS_LHBRX, "lhbrx" }, { PPC_INS_LHZ, "lhz" }, { PPC_INS_LHZU, "lhzu" }, { PPC_INS_LHZUX, "lhzux" }, { PPC_INS_LHZX, "lhzx" }, { PPC_INS_LI, "li" }, { PPC_INS_LIS, "lis" }, { PPC_INS_LMW, "lmw" }, { PPC_INS_LSWI, "lswi" }, { PPC_INS_LVEBX, "lvebx" }, { PPC_INS_LVEHX, "lvehx" }, { PPC_INS_LVEWX, "lvewx" }, { PPC_INS_LVSL, "lvsl" }, { PPC_INS_LVSR, "lvsr" }, { PPC_INS_LVX, "lvx" }, { PPC_INS_LVXL, "lvxl" }, { PPC_INS_LWA, "lwa" }, { PPC_INS_LWARX, "lwarx" }, { PPC_INS_LWAUX, "lwaux" }, { PPC_INS_LWAX, "lwax" }, { PPC_INS_LWBRX, "lwbrx" }, { PPC_INS_LWZ, "lwz" }, { PPC_INS_LWZU, "lwzu" }, { PPC_INS_LWZUX, "lwzux" }, { PPC_INS_LWZX, "lwzx" }, { PPC_INS_LXSDX, "lxsdx" }, { PPC_INS_LXVD2X, "lxvd2x" }, { PPC_INS_LXVDSX, "lxvdsx" }, { PPC_INS_LXVW4X, "lxvw4x" }, { PPC_INS_MBAR, "mbar" }, { PPC_INS_MCRF, "mcrf" }, { PPC_INS_MFCR, "mfcr" }, { PPC_INS_MFCTR, "mfctr" }, { PPC_INS_MFDCR, "mfdcr" }, { PPC_INS_MFFS, "mffs" }, { PPC_INS_MFLR, "mflr" }, { PPC_INS_MFMSR, "mfmsr" }, { PPC_INS_MFOCRF, "mfocrf" }, { PPC_INS_MFSPR, "mfspr" }, { PPC_INS_MFSR, "mfsr" }, { PPC_INS_MFSRIN, "mfsrin" }, { PPC_INS_MFTB, "mftb" }, { PPC_INS_MFVSCR, "mfvscr" }, { PPC_INS_MSYNC, "msync" }, { PPC_INS_MTCRF, "mtcrf" }, { PPC_INS_MTCTR, "mtctr" }, { PPC_INS_MTDCR, "mtdcr" }, { PPC_INS_MTFSB0, "mtfsb0" }, { PPC_INS_MTFSB1, "mtfsb1" }, { PPC_INS_MTFSF, "mtfsf" }, { PPC_INS_MTLR, "mtlr" }, { PPC_INS_MTMSR, "mtmsr" }, { PPC_INS_MTMSRD, "mtmsrd" }, { PPC_INS_MTOCRF, "mtocrf" }, { PPC_INS_MTSPR, "mtspr" }, { PPC_INS_MTSR, "mtsr" }, { PPC_INS_MTSRIN, "mtsrin" }, { PPC_INS_MTVSCR, "mtvscr" }, { PPC_INS_MULHD, "mulhd" }, { PPC_INS_MULHDU, "mulhdu" }, { PPC_INS_MULHW, "mulhw" }, { PPC_INS_MULHWU, "mulhwu" }, { PPC_INS_MULLD, "mulld" }, { PPC_INS_MULLI, "mulli" }, { PPC_INS_MULLW, "mullw" }, { PPC_INS_NAND, "nand" }, { PPC_INS_NEG, "neg" }, { PPC_INS_NOP, "nop" }, { PPC_INS_ORI, "ori" }, { PPC_INS_NOR, "nor" }, { PPC_INS_OR, "or" }, { PPC_INS_ORC, "orc" }, { PPC_INS_ORIS, "oris" }, { PPC_INS_POPCNTD, "popcntd" }, { PPC_INS_POPCNTW, "popcntw" }, { PPC_INS_RFCI, "rfci" }, { PPC_INS_RFDI, "rfdi" }, { PPC_INS_RFI, "rfi" }, { PPC_INS_RFID, "rfid" }, { PPC_INS_RFMCI, "rfmci" }, { PPC_INS_RLDCL, "rldcl" }, { PPC_INS_RLDCR, "rldcr" }, { PPC_INS_RLDIC, "rldic" }, { PPC_INS_RLDICL, "rldicl" }, { PPC_INS_RLDICR, "rldicr" }, { PPC_INS_RLDIMI, "rldimi" }, { PPC_INS_RLWIMI, "rlwimi" }, { PPC_INS_RLWINM, "rlwinm" }, { PPC_INS_RLWNM, "rlwnm" }, { PPC_INS_SC, "sc" }, { PPC_INS_SLBIA, "slbia" }, { PPC_INS_SLBIE, "slbie" }, { PPC_INS_SLBMFEE, "slbmfee" }, { PPC_INS_SLBMTE, "slbmte" }, { PPC_INS_SLD, "sld" }, { PPC_INS_SLW, "slw" }, { PPC_INS_SRAD, "srad" }, { PPC_INS_SRADI, "sradi" }, { PPC_INS_SRAW, "sraw" }, { PPC_INS_SRAWI, "srawi" }, { PPC_INS_SRD, "srd" }, { PPC_INS_SRW, "srw" }, { PPC_INS_STB, "stb" }, { PPC_INS_STBU, "stbu" }, { PPC_INS_STBUX, "stbux" }, { PPC_INS_STBX, "stbx" }, { PPC_INS_STD, "std" }, { PPC_INS_STDBRX, "stdbrx" }, { PPC_INS_STDCX, "stdcx" }, { PPC_INS_STDU, "stdu" }, { PPC_INS_STDUX, "stdux" }, { PPC_INS_STDX, "stdx" }, { PPC_INS_STFD, "stfd" }, { PPC_INS_STFDU, "stfdu" }, { PPC_INS_STFDUX, "stfdux" }, { PPC_INS_STFDX, "stfdx" }, { PPC_INS_STFIWX, "stfiwx" }, { PPC_INS_STFS, "stfs" }, { PPC_INS_STFSU, "stfsu" }, { PPC_INS_STFSUX, "stfsux" }, { PPC_INS_STFSX, "stfsx" }, { PPC_INS_STH, "sth" }, { PPC_INS_STHBRX, "sthbrx" }, { PPC_INS_STHU, "sthu" }, { PPC_INS_STHUX, "sthux" }, { PPC_INS_STHX, "sthx" }, { PPC_INS_STMW, "stmw" }, { PPC_INS_STSWI, "stswi" }, { PPC_INS_STVEBX, "stvebx" }, { PPC_INS_STVEHX, "stvehx" }, { PPC_INS_STVEWX, "stvewx" }, { PPC_INS_STVX, "stvx" }, { PPC_INS_STVXL, "stvxl" }, { PPC_INS_STW, "stw" }, { PPC_INS_STWBRX, "stwbrx" }, { PPC_INS_STWCX, "stwcx" }, { PPC_INS_STWU, "stwu" }, { PPC_INS_STWUX, "stwux" }, { PPC_INS_STWX, "stwx" }, { PPC_INS_STXSDX, "stxsdx" }, { PPC_INS_STXVD2X, "stxvd2x" }, { PPC_INS_STXVW4X, "stxvw4x" }, { PPC_INS_SUBF, "subf" }, { PPC_INS_SUBFC, "subfc" }, { PPC_INS_SUBFE, "subfe" }, { PPC_INS_SUBFIC, "subfic" }, { PPC_INS_SUBFME, "subfme" }, { PPC_INS_SUBFZE, "subfze" }, { PPC_INS_SYNC, "sync" }, { PPC_INS_TD, "td" }, { PPC_INS_TDI, "tdi" }, { PPC_INS_TLBIA, "tlbia" }, { PPC_INS_TLBIE, "tlbie" }, { PPC_INS_TLBIEL, "tlbiel" }, { PPC_INS_TLBIVAX, "tlbivax" }, { PPC_INS_TLBLD, "tlbld" }, { PPC_INS_TLBLI, "tlbli" }, { PPC_INS_TLBRE, "tlbre" }, { PPC_INS_TLBSX, "tlbsx" }, { PPC_INS_TLBSYNC, "tlbsync" }, { PPC_INS_TLBWE, "tlbwe" }, { PPC_INS_TRAP, "trap" }, { PPC_INS_TW, "tw" }, { PPC_INS_TWI, "twi" }, { PPC_INS_VADDCUW, "vaddcuw" }, { PPC_INS_VADDFP, "vaddfp" }, { PPC_INS_VADDSBS, "vaddsbs" }, { PPC_INS_VADDSHS, "vaddshs" }, { PPC_INS_VADDSWS, "vaddsws" }, { PPC_INS_VADDUBM, "vaddubm" }, { PPC_INS_VADDUBS, "vaddubs" }, { PPC_INS_VADDUHM, "vadduhm" }, { PPC_INS_VADDUHS, "vadduhs" }, { PPC_INS_VADDUWM, "vadduwm" }, { PPC_INS_VADDUWS, "vadduws" }, { PPC_INS_VAND, "vand" }, { PPC_INS_VANDC, "vandc" }, { PPC_INS_VAVGSB, "vavgsb" }, { PPC_INS_VAVGSH, "vavgsh" }, { PPC_INS_VAVGSW, "vavgsw" }, { PPC_INS_VAVGUB, "vavgub" }, { PPC_INS_VAVGUH, "vavguh" }, { PPC_INS_VAVGUW, "vavguw" }, { PPC_INS_VCFSX, "vcfsx" }, { PPC_INS_VCFUX, "vcfux" }, { PPC_INS_VCMPBFP, "vcmpbfp" }, { PPC_INS_VCMPEQFP, "vcmpeqfp" }, { PPC_INS_VCMPEQUB, "vcmpequb" }, { PPC_INS_VCMPEQUH, "vcmpequh" }, { PPC_INS_VCMPEQUW, "vcmpequw" }, { PPC_INS_VCMPGEFP, "vcmpgefp" }, { PPC_INS_VCMPGTFP, "vcmpgtfp" }, { PPC_INS_VCMPGTSB, "vcmpgtsb" }, { PPC_INS_VCMPGTSH, "vcmpgtsh" }, { PPC_INS_VCMPGTSW, "vcmpgtsw" }, { PPC_INS_VCMPGTUB, "vcmpgtub" }, { PPC_INS_VCMPGTUH, "vcmpgtuh" }, { PPC_INS_VCMPGTUW, "vcmpgtuw" }, { PPC_INS_VCTSXS, "vctsxs" }, { PPC_INS_VCTUXS, "vctuxs" }, { PPC_INS_VEXPTEFP, "vexptefp" }, { PPC_INS_VLOGEFP, "vlogefp" }, { PPC_INS_VMADDFP, "vmaddfp" }, { PPC_INS_VMAXFP, "vmaxfp" }, { PPC_INS_VMAXSB, "vmaxsb" }, { PPC_INS_VMAXSH, "vmaxsh" }, { PPC_INS_VMAXSW, "vmaxsw" }, { PPC_INS_VMAXUB, "vmaxub" }, { PPC_INS_VMAXUH, "vmaxuh" }, { PPC_INS_VMAXUW, "vmaxuw" }, { PPC_INS_VMHADDSHS, "vmhaddshs" }, { PPC_INS_VMHRADDSHS, "vmhraddshs" }, { PPC_INS_VMINFP, "vminfp" }, { PPC_INS_VMINSB, "vminsb" }, { PPC_INS_VMINSH, "vminsh" }, { PPC_INS_VMINSW, "vminsw" }, { PPC_INS_VMINUB, "vminub" }, { PPC_INS_VMINUH, "vminuh" }, { PPC_INS_VMINUW, "vminuw" }, { PPC_INS_VMLADDUHM, "vmladduhm" }, { PPC_INS_VMRGHB, "vmrghb" }, { PPC_INS_VMRGHH, "vmrghh" }, { PPC_INS_VMRGHW, "vmrghw" }, { PPC_INS_VMRGLB, "vmrglb" }, { PPC_INS_VMRGLH, "vmrglh" }, { PPC_INS_VMRGLW, "vmrglw" }, { PPC_INS_VMSUMMBM, "vmsummbm" }, { PPC_INS_VMSUMSHM, "vmsumshm" }, { PPC_INS_VMSUMSHS, "vmsumshs" }, { PPC_INS_VMSUMUBM, "vmsumubm" }, { PPC_INS_VMSUMUHM, "vmsumuhm" }, { PPC_INS_VMSUMUHS, "vmsumuhs" }, { PPC_INS_VMULESB, "vmulesb" }, { PPC_INS_VMULESH, "vmulesh" }, { PPC_INS_VMULEUB, "vmuleub" }, { PPC_INS_VMULEUH, "vmuleuh" }, { PPC_INS_VMULOSB, "vmulosb" }, { PPC_INS_VMULOSH, "vmulosh" }, { PPC_INS_VMULOUB, "vmuloub" }, { PPC_INS_VMULOUH, "vmulouh" }, { PPC_INS_VNMSUBFP, "vnmsubfp" }, { PPC_INS_VNOR, "vnor" }, { PPC_INS_VOR, "vor" }, { PPC_INS_VPERM, "vperm" }, { PPC_INS_VPKPX, "vpkpx" }, { PPC_INS_VPKSHSS, "vpkshss" }, { PPC_INS_VPKSHUS, "vpkshus" }, { PPC_INS_VPKSWSS, "vpkswss" }, { PPC_INS_VPKSWUS, "vpkswus" }, { PPC_INS_VPKUHUM, "vpkuhum" }, { PPC_INS_VPKUHUS, "vpkuhus" }, { PPC_INS_VPKUWUM, "vpkuwum" }, { PPC_INS_VPKUWUS, "vpkuwus" }, { PPC_INS_VREFP, "vrefp" }, { PPC_INS_VRFIM, "vrfim" }, { PPC_INS_VRFIN, "vrfin" }, { PPC_INS_VRFIP, "vrfip" }, { PPC_INS_VRFIZ, "vrfiz" }, { PPC_INS_VRLB, "vrlb" }, { PPC_INS_VRLH, "vrlh" }, { PPC_INS_VRLW, "vrlw" }, { PPC_INS_VRSQRTEFP, "vrsqrtefp" }, { PPC_INS_VSEL, "vsel" }, { PPC_INS_VSL, "vsl" }, { PPC_INS_VSLB, "vslb" }, { PPC_INS_VSLDOI, "vsldoi" }, { PPC_INS_VSLH, "vslh" }, { PPC_INS_VSLO, "vslo" }, { PPC_INS_VSLW, "vslw" }, { PPC_INS_VSPLTB, "vspltb" }, { PPC_INS_VSPLTH, "vsplth" }, { PPC_INS_VSPLTISB, "vspltisb" }, { PPC_INS_VSPLTISH, "vspltish" }, { PPC_INS_VSPLTISW, "vspltisw" }, { PPC_INS_VSPLTW, "vspltw" }, { PPC_INS_VSR, "vsr" }, { PPC_INS_VSRAB, "vsrab" }, { PPC_INS_VSRAH, "vsrah" }, { PPC_INS_VSRAW, "vsraw" }, { PPC_INS_VSRB, "vsrb" }, { PPC_INS_VSRH, "vsrh" }, { PPC_INS_VSRO, "vsro" }, { PPC_INS_VSRW, "vsrw" }, { PPC_INS_VSUBCUW, "vsubcuw" }, { PPC_INS_VSUBFP, "vsubfp" }, { PPC_INS_VSUBSBS, "vsubsbs" }, { PPC_INS_VSUBSHS, "vsubshs" }, { PPC_INS_VSUBSWS, "vsubsws" }, { PPC_INS_VSUBUBM, "vsububm" }, { PPC_INS_VSUBUBS, "vsububs" }, { PPC_INS_VSUBUHM, "vsubuhm" }, { PPC_INS_VSUBUHS, "vsubuhs" }, { PPC_INS_VSUBUWM, "vsubuwm" }, { PPC_INS_VSUBUWS, "vsubuws" }, { PPC_INS_VSUM2SWS, "vsum2sws" }, { PPC_INS_VSUM4SBS, "vsum4sbs" }, { PPC_INS_VSUM4SHS, "vsum4shs" }, { PPC_INS_VSUM4UBS, "vsum4ubs" }, { PPC_INS_VSUMSWS, "vsumsws" }, { PPC_INS_VUPKHPX, "vupkhpx" }, { PPC_INS_VUPKHSB, "vupkhsb" }, { PPC_INS_VUPKHSH, "vupkhsh" }, { PPC_INS_VUPKLPX, "vupklpx" }, { PPC_INS_VUPKLSB, "vupklsb" }, { PPC_INS_VUPKLSH, "vupklsh" }, { PPC_INS_VXOR, "vxor" }, { PPC_INS_WAIT, "wait" }, { PPC_INS_WRTEE, "wrtee" }, { PPC_INS_WRTEEI, "wrteei" }, { PPC_INS_XOR, "xor" }, { PPC_INS_XORI, "xori" }, { PPC_INS_XORIS, "xoris" }, { PPC_INS_XSABSDP, "xsabsdp" }, { PPC_INS_XSADDDP, "xsadddp" }, { PPC_INS_XSCMPODP, "xscmpodp" }, { PPC_INS_XSCMPUDP, "xscmpudp" }, { PPC_INS_XSCPSGNDP, "xscpsgndp" }, { PPC_INS_XSCVDPSP, "xscvdpsp" }, { PPC_INS_XSCVDPSXDS, "xscvdpsxds" }, { PPC_INS_XSCVDPSXWS, "xscvdpsxws" }, { PPC_INS_XSCVDPUXDS, "xscvdpuxds" }, { PPC_INS_XSCVDPUXWS, "xscvdpuxws" }, { PPC_INS_XSCVSPDP, "xscvspdp" }, { PPC_INS_XSCVSXDDP, "xscvsxddp" }, { PPC_INS_XSCVUXDDP, "xscvuxddp" }, { PPC_INS_XSDIVDP, "xsdivdp" }, { PPC_INS_XSMADDADP, "xsmaddadp" }, { PPC_INS_XSMADDMDP, "xsmaddmdp" }, { PPC_INS_XSMAXDP, "xsmaxdp" }, { PPC_INS_XSMINDP, "xsmindp" }, { PPC_INS_XSMSUBADP, "xsmsubadp" }, { PPC_INS_XSMSUBMDP, "xsmsubmdp" }, { PPC_INS_XSMULDP, "xsmuldp" }, { PPC_INS_XSNABSDP, "xsnabsdp" }, { PPC_INS_XSNEGDP, "xsnegdp" }, { PPC_INS_XSNMADDADP, "xsnmaddadp" }, { PPC_INS_XSNMADDMDP, "xsnmaddmdp" }, { PPC_INS_XSNMSUBADP, "xsnmsubadp" }, { PPC_INS_XSNMSUBMDP, "xsnmsubmdp" }, { PPC_INS_XSRDPI, "xsrdpi" }, { PPC_INS_XSRDPIC, "xsrdpic" }, { PPC_INS_XSRDPIM, "xsrdpim" }, { PPC_INS_XSRDPIP, "xsrdpip" }, { PPC_INS_XSRDPIZ, "xsrdpiz" }, { PPC_INS_XSREDP, "xsredp" }, { PPC_INS_XSRSQRTEDP, "xsrsqrtedp" }, { PPC_INS_XSSQRTDP, "xssqrtdp" }, { PPC_INS_XSSUBDP, "xssubdp" }, { PPC_INS_XSTDIVDP, "xstdivdp" }, { PPC_INS_XSTSQRTDP, "xstsqrtdp" }, { PPC_INS_XVABSDP, "xvabsdp" }, { PPC_INS_XVABSSP, "xvabssp" }, { PPC_INS_XVADDDP, "xvadddp" }, { PPC_INS_XVADDSP, "xvaddsp" }, { PPC_INS_XVCMPEQDP, "xvcmpeqdp" }, { PPC_INS_XVCMPEQSP, "xvcmpeqsp" }, { PPC_INS_XVCMPGEDP, "xvcmpgedp" }, { PPC_INS_XVCMPGESP, "xvcmpgesp" }, { PPC_INS_XVCMPGTDP, "xvcmpgtdp" }, { PPC_INS_XVCMPGTSP, "xvcmpgtsp" }, { PPC_INS_XVCPSGNDP, "xvcpsgndp" }, { PPC_INS_XVCPSGNSP, "xvcpsgnsp" }, { PPC_INS_XVCVDPSP, "xvcvdpsp" }, { PPC_INS_XVCVDPSXDS, "xvcvdpsxds" }, { PPC_INS_XVCVDPSXWS, "xvcvdpsxws" }, { PPC_INS_XVCVDPUXDS, "xvcvdpuxds" }, { PPC_INS_XVCVDPUXWS, "xvcvdpuxws" }, { PPC_INS_XVCVSPDP, "xvcvspdp" }, { PPC_INS_XVCVSPSXDS, "xvcvspsxds" }, { PPC_INS_XVCVSPSXWS, "xvcvspsxws" }, { PPC_INS_XVCVSPUXDS, "xvcvspuxds" }, { PPC_INS_XVCVSPUXWS, "xvcvspuxws" }, { PPC_INS_XVCVSXDDP, "xvcvsxddp" }, { PPC_INS_XVCVSXDSP, "xvcvsxdsp" }, { PPC_INS_XVCVSXWDP, "xvcvsxwdp" }, { PPC_INS_XVCVSXWSP, "xvcvsxwsp" }, { PPC_INS_XVCVUXDDP, "xvcvuxddp" }, { PPC_INS_XVCVUXDSP, "xvcvuxdsp" }, { PPC_INS_XVCVUXWDP, "xvcvuxwdp" }, { PPC_INS_XVCVUXWSP, "xvcvuxwsp" }, { PPC_INS_XVDIVDP, "xvdivdp" }, { PPC_INS_XVDIVSP, "xvdivsp" }, { PPC_INS_XVMADDADP, "xvmaddadp" }, { PPC_INS_XVMADDASP, "xvmaddasp" }, { PPC_INS_XVMADDMDP, "xvmaddmdp" }, { PPC_INS_XVMADDMSP, "xvmaddmsp" }, { PPC_INS_XVMAXDP, "xvmaxdp" }, { PPC_INS_XVMAXSP, "xvmaxsp" }, { PPC_INS_XVMINDP, "xvmindp" }, { PPC_INS_XVMINSP, "xvminsp" }, { PPC_INS_XVMSUBADP, "xvmsubadp" }, { PPC_INS_XVMSUBASP, "xvmsubasp" }, { PPC_INS_XVMSUBMDP, "xvmsubmdp" }, { PPC_INS_XVMSUBMSP, "xvmsubmsp" }, { PPC_INS_XVMULDP, "xvmuldp" }, { PPC_INS_XVMULSP, "xvmulsp" }, { PPC_INS_XVNABSDP, "xvnabsdp" }, { PPC_INS_XVNABSSP, "xvnabssp" }, { PPC_INS_XVNEGDP, "xvnegdp" }, { PPC_INS_XVNEGSP, "xvnegsp" }, { PPC_INS_XVNMADDADP, "xvnmaddadp" }, { PPC_INS_XVNMADDASP, "xvnmaddasp" }, { PPC_INS_XVNMADDMDP, "xvnmaddmdp" }, { PPC_INS_XVNMADDMSP, "xvnmaddmsp" }, { PPC_INS_XVNMSUBADP, "xvnmsubadp" }, { PPC_INS_XVNMSUBASP, "xvnmsubasp" }, { PPC_INS_XVNMSUBMDP, "xvnmsubmdp" }, { PPC_INS_XVNMSUBMSP, "xvnmsubmsp" }, { PPC_INS_XVRDPI, "xvrdpi" }, { PPC_INS_XVRDPIC, "xvrdpic" }, { PPC_INS_XVRDPIM, "xvrdpim" }, { PPC_INS_XVRDPIP, "xvrdpip" }, { PPC_INS_XVRDPIZ, "xvrdpiz" }, { PPC_INS_XVREDP, "xvredp" }, { PPC_INS_XVRESP, "xvresp" }, { PPC_INS_XVRSPI, "xvrspi" }, { PPC_INS_XVRSPIC, "xvrspic" }, { PPC_INS_XVRSPIM, "xvrspim" }, { PPC_INS_XVRSPIP, "xvrspip" }, { PPC_INS_XVRSPIZ, "xvrspiz" }, { PPC_INS_XVRSQRTEDP, "xvrsqrtedp" }, { PPC_INS_XVRSQRTESP, "xvrsqrtesp" }, { PPC_INS_XVSQRTDP, "xvsqrtdp" }, { PPC_INS_XVSQRTSP, "xvsqrtsp" }, { PPC_INS_XVSUBDP, "xvsubdp" }, { PPC_INS_XVSUBSP, "xvsubsp" }, { PPC_INS_XVTDIVDP, "xvtdivdp" }, { PPC_INS_XVTDIVSP, "xvtdivsp" }, { PPC_INS_XVTSQRTDP, "xvtsqrtdp" }, { PPC_INS_XVTSQRTSP, "xvtsqrtsp" }, { PPC_INS_XXLAND, "xxland" }, { PPC_INS_XXLANDC, "xxlandc" }, { PPC_INS_XXLNOR, "xxlnor" }, { PPC_INS_XXLOR, "xxlor" }, { PPC_INS_XXLXOR, "xxlxor" }, { PPC_INS_XXMRGHW, "xxmrghw" }, { PPC_INS_XXMRGLW, "xxmrglw" }, { PPC_INS_XXPERMDI, "xxpermdi" }, { PPC_INS_XXSEL, "xxsel" }, { PPC_INS_XXSLDWI, "xxsldwi" }, { PPC_INS_XXSPLTW, "xxspltw" }, { PPC_INS_BCA, "bca" }, { PPC_INS_BCLA, "bcla" }, // extra & alias instructions { PPC_INS_SLWI, "slwi" }, { PPC_INS_SRWI, "srwi" }, { PPC_INS_SLDI, "sldi" }, { PPC_INS_BTA, "bta" }, { PPC_INS_CRSET, "crset" }, { PPC_INS_CRNOT, "crnot" }, { PPC_INS_CRMOVE, "crmove" }, { PPC_INS_CRCLR, "crclr" }, { PPC_INS_MFBR0, "mfbr0" }, { PPC_INS_MFBR1, "mfbr1" }, { PPC_INS_MFBR2, "mfbr2" }, { PPC_INS_MFBR3, "mfbr3" }, { PPC_INS_MFBR4, "mfbr4" }, { PPC_INS_MFBR5, "mfbr5" }, { PPC_INS_MFBR6, "mfbr6" }, { PPC_INS_MFBR7, "mfbr7" }, { PPC_INS_MFXER, "mfxer" }, { PPC_INS_MFRTCU, "mfrtcu" }, { PPC_INS_MFRTCL, "mfrtcl" }, { PPC_INS_MFDSCR, "mfdscr" }, { PPC_INS_MFDSISR, "mfdsisr" }, { PPC_INS_MFDAR, "mfdar" }, { PPC_INS_MFSRR2, "mfsrr2" }, { PPC_INS_MFSRR3, "mfsrr3" }, { PPC_INS_MFCFAR, "mfcfar" }, { PPC_INS_MFAMR, "mfamr" }, { PPC_INS_MFPID, "mfpid" }, { PPC_INS_MFTBLO, "mftblo" }, { PPC_INS_MFTBHI, "mftbhi" }, { PPC_INS_MFDBATU, "mfdbatu" }, { PPC_INS_MFDBATL, "mfdbatl" }, { PPC_INS_MFIBATU, "mfibatu" }, { PPC_INS_MFIBATL, "mfibatl" }, { PPC_INS_MFDCCR, "mfdccr" }, { PPC_INS_MFICCR, "mficcr" }, { PPC_INS_MFDEAR, "mfdear" }, { PPC_INS_MFESR, "mfesr" }, { PPC_INS_MFSPEFSCR, "mfspefscr" }, { PPC_INS_MFTCR, "mftcr" }, { PPC_INS_MFASR, "mfasr" }, { PPC_INS_MFPVR, "mfpvr" }, { PPC_INS_MFTBU, "mftbu" }, { PPC_INS_MTCR, "mtcr" }, { PPC_INS_MTBR0, "mtbr0" }, { PPC_INS_MTBR1, "mtbr1" }, { PPC_INS_MTBR2, "mtbr2" }, { PPC_INS_MTBR3, "mtbr3" }, { PPC_INS_MTBR4, "mtbr4" }, { PPC_INS_MTBR5, "mtbr5" }, { PPC_INS_MTBR6, "mtbr6" }, { PPC_INS_MTBR7, "mtbr7" }, { PPC_INS_MTXER, "mtxer" }, { PPC_INS_MTDSCR, "mtdscr" }, { PPC_INS_MTDSISR, "mtdsisr" }, { PPC_INS_MTDAR, "mtdar" }, { PPC_INS_MTSRR2, "mtsrr2" }, { PPC_INS_MTSRR3, "mtsrr3" }, { PPC_INS_MTCFAR, "mtcfar" }, { PPC_INS_MTAMR, "mtamr" }, { PPC_INS_MTPID, "mtpid" }, { PPC_INS_MTTBL, "mttbl" }, { PPC_INS_MTTBU, "mttbu" }, { PPC_INS_MTTBLO, "mttblo" }, { PPC_INS_MTTBHI, "mttbhi" }, { PPC_INS_MTDBATU, "mtdbatu" }, { PPC_INS_MTDBATL, "mtdbatl" }, { PPC_INS_MTIBATU, "mtibatu" }, { PPC_INS_MTIBATL, "mtibatl" }, { PPC_INS_MTDCCR, "mtdccr" }, { PPC_INS_MTICCR, "mticcr" }, { PPC_INS_MTDEAR, "mtdear" }, { PPC_INS_MTESR, "mtesr" }, { PPC_INS_MTSPEFSCR, "mtspefscr" }, { PPC_INS_MTTCR, "mttcr" }, { PPC_INS_NOT, "not" }, { PPC_INS_MR, "mr" }, { PPC_INS_ROTLD, "rotld" }, { PPC_INS_ROTLDI, "rotldi" }, { PPC_INS_CLRLDI, "clrldi" }, { PPC_INS_ROTLWI, "rotlwi" }, { PPC_INS_CLRLWI, "clrlwi" }, { PPC_INS_ROTLW, "rotlw" }, { PPC_INS_SUB, "sub" }, { PPC_INS_SUBC, "subc" }, { PPC_INS_LWSYNC, "lwsync" }, { PPC_INS_PTESYNC, "ptesync" }, { PPC_INS_TDLT, "tdlt" }, { PPC_INS_TDEQ, "tdeq" }, { PPC_INS_TDGT, "tdgt" }, { PPC_INS_TDNE, "tdne" }, { PPC_INS_TDLLT, "tdllt" }, { PPC_INS_TDLGT, "tdlgt" }, { PPC_INS_TDU, "tdu" }, { PPC_INS_TDLTI, "tdlti" }, { PPC_INS_TDEQI, "tdeqi" }, { PPC_INS_TDGTI, "tdgti" }, { PPC_INS_TDNEI, "tdnei" }, { PPC_INS_TDLLTI, "tdllti" }, { PPC_INS_TDLGTI, "tdlgti" }, { PPC_INS_TDUI, "tdui" }, { PPC_INS_TLBREHI, "tlbrehi" }, { PPC_INS_TLBRELO, "tlbrelo" }, { PPC_INS_TLBWEHI, "tlbwehi" }, { PPC_INS_TLBWELO, "tlbwelo" }, { PPC_INS_TWLT, "twlt" }, { PPC_INS_TWEQ, "tweq" }, { PPC_INS_TWGT, "twgt" }, { PPC_INS_TWNE, "twne" }, { PPC_INS_TWLLT, "twllt" }, { PPC_INS_TWLGT, "twlgt" }, { PPC_INS_TWU, "twu" }, { PPC_INS_TWLTI, "twlti" }, { PPC_INS_TWEQI, "tweqi" }, { PPC_INS_TWGTI, "twgti" }, { PPC_INS_TWNEI, "twnei" }, { PPC_INS_TWLLTI, "twllti" }, { PPC_INS_TWLGTI, "twlgti" }, { PPC_INS_TWUI, "twui" }, { PPC_INS_WAITRSV, "waitrsv" }, { PPC_INS_WAITIMPL, "waitimpl" }, { PPC_INS_XNOP, "xnop" }, { PPC_INS_XVMOVDP, "xvmovdp" }, { PPC_INS_XVMOVSP, "xvmovsp" }, { PPC_INS_XXSPLTD, "xxspltd" }, { PPC_INS_XXMRGHD, "xxmrghd" }, { PPC_INS_XXMRGLD, "xxmrgld" }, { PPC_INS_XXSWAPD, "xxswapd" }, { PPC_INS_BT, "bt" }, { PPC_INS_BF, "bf" }, { PPC_INS_BDNZT, "bdnzt" }, { PPC_INS_BDNZF, "bdnzf" }, { PPC_INS_BDZF, "bdzf" }, { PPC_INS_BDZT, "bdzt" }, { PPC_INS_BFA, "bfa" }, { PPC_INS_BDNZTA, "bdnzta" }, { PPC_INS_BDNZFA, "bdnzfa" }, { PPC_INS_BDZTA, "bdzta" }, { PPC_INS_BDZFA, "bdzfa" }, { PPC_INS_BTCTR, "btctr" }, { PPC_INS_BFCTR, "bfctr" }, { PPC_INS_BTCTRL, "btctrl" }, { PPC_INS_BFCTRL, "bfctrl" }, { PPC_INS_BTL, "btl" }, { PPC_INS_BFL, "bfl" }, { PPC_INS_BDNZTL, "bdnztl" }, { PPC_INS_BDNZFL, "bdnzfl" }, { PPC_INS_BDZTL, "bdztl" }, { PPC_INS_BDZFL, "bdzfl" }, { PPC_INS_BTLA, "btla" }, { PPC_INS_BFLA, "bfla" }, { PPC_INS_BDNZTLA, "bdnztla" }, { PPC_INS_BDNZFLA, "bdnzfla" }, { PPC_INS_BDZTLA, "bdztla" }, { PPC_INS_BDZFLA, "bdzfla" }, { PPC_INS_BTLR, "btlr" }, { PPC_INS_BFLR, "bflr" }, { PPC_INS_BDNZTLR, "bdnztlr" }, { PPC_INS_BDZTLR, "bdztlr" }, { PPC_INS_BDZFLR, "bdzflr" }, { PPC_INS_BTLRL, "btlrl" }, { PPC_INS_BFLRL, "bflrl" }, { PPC_INS_BDNZTLRL, "bdnztlrl" }, { PPC_INS_BDNZFLRL, "bdnzflrl" }, { PPC_INS_BDZTLRL, "bdztlrl" }, { PPC_INS_BDZFLRL, "bdzflrl" }, }; // special alias insn static name_map alias_insn_names[] = { { 0, NULL } }; #endif const char *PPC_insn_name(csh handle, unsigned int id) { #ifndef CAPSTONE_DIET unsigned int i; if (id >= PPC_INS_ENDING) return NULL; // handle special alias first for (i = 0; i < ARR_SIZE(alias_insn_names); i++) { if (alias_insn_names[i].id == id) return alias_insn_names[i].name; } return insn_name_maps[id].name; #else return NULL; #endif } #ifndef CAPSTONE_DIET static name_map group_name_maps[] = { { PPC_GRP_INVALID, NULL }, { PPC_GRP_ALTIVEC, "altivec" }, { PPC_GRP_MODE32, "mode32" }, { PPC_GRP_MODE64, "mode64" }, { PPC_GRP_BOOKE, "booke" }, { PPC_GRP_NOTBOOKE, "notbooke" }, { PPC_GRP_SPE, "spe" }, { PPC_GRP_VSX, "vsx" }, { PPC_GRP_E500, "e500" }, { PPC_GRP_PPC4XX, "ppc4xx" }, { PPC_GRP_PPC6XX, "ppc6xx" }, { PPC_GRP_JUMP, "jump" }, }; #endif const char *PPC_group_name(csh handle, unsigned int id) { #ifndef CAPSTONE_DIET if (id >= PPC_GRP_ENDING) return NULL; return group_name_maps[id].name; #else return NULL; #endif } // map internal raw register to 'public' register ppc_reg PPC_map_register(unsigned int r) { static unsigned int map[] = { 0, 0, PPC_REG_CARRY, PPC_REG_CC, PPC_REG_CTR, 0, PPC_REG_LR, 0, PPC_REG_VRSAVE, PPC_REG_R0, 0, PPC_REG_CR0, PPC_REG_CR1, PPC_REG_CR2, PPC_REG_CR3, PPC_REG_CR4, PPC_REG_CR5, PPC_REG_CR6, PPC_REG_CR7, PPC_REG_CTR, PPC_REG_F0, PPC_REG_F1, PPC_REG_F2, PPC_REG_F3, PPC_REG_F4, PPC_REG_F5, PPC_REG_F6, PPC_REG_F7, PPC_REG_F8, PPC_REG_F9, PPC_REG_F10, PPC_REG_F11, PPC_REG_F12, PPC_REG_F13, PPC_REG_F14, PPC_REG_F15, PPC_REG_F16, PPC_REG_F17, PPC_REG_F18, PPC_REG_F19, PPC_REG_F20, PPC_REG_F21, PPC_REG_F22, PPC_REG_F23, PPC_REG_F24, PPC_REG_F25, PPC_REG_F26, PPC_REG_F27, PPC_REG_F28, PPC_REG_F29, PPC_REG_F30, PPC_REG_F31, 0, PPC_REG_LR, PPC_REG_R0, PPC_REG_R1, PPC_REG_R2, PPC_REG_R3, PPC_REG_R4, PPC_REG_R5, PPC_REG_R6, PPC_REG_R7, PPC_REG_R8, PPC_REG_R9, PPC_REG_R10, PPC_REG_R11, PPC_REG_R12, PPC_REG_R13, PPC_REG_R14, PPC_REG_R15, PPC_REG_R16, PPC_REG_R17, PPC_REG_R18, PPC_REG_R19, PPC_REG_R20, PPC_REG_R21, PPC_REG_R22, PPC_REG_R23, PPC_REG_R24, PPC_REG_R25, PPC_REG_R26, PPC_REG_R27, PPC_REG_R28, PPC_REG_R29, PPC_REG_R30, PPC_REG_R31, PPC_REG_V0, PPC_REG_V1, PPC_REG_V2, PPC_REG_V3, PPC_REG_V4, PPC_REG_V5, PPC_REG_V6, PPC_REG_V7, PPC_REG_V8, PPC_REG_V9, PPC_REG_V10, PPC_REG_V11, PPC_REG_V12, PPC_REG_V13, PPC_REG_V14, PPC_REG_V15, PPC_REG_V16, PPC_REG_V17, PPC_REG_V18, PPC_REG_V19, PPC_REG_V20, PPC_REG_V21, PPC_REG_V22, PPC_REG_V23, PPC_REG_V24, PPC_REG_V25, PPC_REG_V26, PPC_REG_V27, PPC_REG_V28, PPC_REG_V29, PPC_REG_V30, PPC_REG_V31, PPC_REG_VS32, PPC_REG_VS33, PPC_REG_VS34, PPC_REG_VS35, PPC_REG_VS36, PPC_REG_VS37, PPC_REG_VS38, PPC_REG_VS39, PPC_REG_VS40, PPC_REG_VS41, PPC_REG_VS42, PPC_REG_VS43, PPC_REG_VS44, PPC_REG_VS45, PPC_REG_VS46, PPC_REG_VS47, PPC_REG_VS48, PPC_REG_VS49, PPC_REG_VS50, PPC_REG_VS51, PPC_REG_VS52, PPC_REG_VS53, PPC_REG_VS54, PPC_REG_VS55, PPC_REG_VS56, PPC_REG_VS57, PPC_REG_VS58, PPC_REG_VS59, PPC_REG_VS60, PPC_REG_VS61, PPC_REG_VS62, PPC_REG_VS63, PPC_REG_VS32, PPC_REG_VS33, PPC_REG_VS34, PPC_REG_VS35, PPC_REG_VS36, PPC_REG_VS37, PPC_REG_VS38, PPC_REG_VS39, PPC_REG_VS40, PPC_REG_VS41, PPC_REG_VS42, PPC_REG_VS43, PPC_REG_VS44, PPC_REG_VS45, PPC_REG_VS46, PPC_REG_VS47, PPC_REG_VS48, PPC_REG_VS49, PPC_REG_VS50, PPC_REG_VS51, PPC_REG_VS52, PPC_REG_VS53, PPC_REG_VS54, PPC_REG_VS55, PPC_REG_VS56, PPC_REG_VS57, PPC_REG_VS58, PPC_REG_VS59, PPC_REG_VS60, PPC_REG_VS61, PPC_REG_VS62, PPC_REG_VS63, PPC_REG_VS0, PPC_REG_VS1, PPC_REG_VS2, PPC_REG_VS3, PPC_REG_VS4, PPC_REG_VS5, PPC_REG_VS6, PPC_REG_VS7, PPC_REG_VS8, PPC_REG_VS9, PPC_REG_VS10, PPC_REG_VS11, PPC_REG_VS12, PPC_REG_VS13, PPC_REG_VS14, PPC_REG_VS15, PPC_REG_VS16, PPC_REG_VS17, PPC_REG_VS18, PPC_REG_VS19, PPC_REG_VS20, PPC_REG_VS21, PPC_REG_VS22, PPC_REG_VS23, PPC_REG_VS24, PPC_REG_VS25, PPC_REG_VS26, PPC_REG_VS27, PPC_REG_VS28, PPC_REG_VS29, PPC_REG_VS30, PPC_REG_VS31, PPC_REG_R0, PPC_REG_R1, PPC_REG_R2, PPC_REG_R3, PPC_REG_R4, PPC_REG_R5, PPC_REG_R6, PPC_REG_R7, PPC_REG_R8, PPC_REG_R9, PPC_REG_R10, PPC_REG_R11, PPC_REG_R12, PPC_REG_R13, PPC_REG_R14, PPC_REG_R15, PPC_REG_R16, PPC_REG_R17, PPC_REG_R18, PPC_REG_R19, PPC_REG_R20, PPC_REG_R21, PPC_REG_R22, PPC_REG_R23, PPC_REG_R24, PPC_REG_R25, PPC_REG_R26, PPC_REG_R27, PPC_REG_R28, PPC_REG_R29, PPC_REG_R30, PPC_REG_R31, PPC_REG_R0, PPC_REG_R2, PPC_REG_R6, PPC_REG_R10, PPC_REG_R14, PPC_REG_R18, PPC_REG_R22, PPC_REG_R26, PPC_REG_R30, PPC_REG_R1, PPC_REG_R5, PPC_REG_R9, PPC_REG_R13, PPC_REG_R17, PPC_REG_R21, PPC_REG_R25, PPC_REG_R29, PPC_REG_R0, PPC_REG_R4, PPC_REG_R8, PPC_REG_R12, PPC_REG_R16, PPC_REG_R20, PPC_REG_R24, PPC_REG_R28, PPC_REG_R3, PPC_REG_R7, PPC_REG_R11, PPC_REG_R15, PPC_REG_R19, PPC_REG_R23, PPC_REG_R27, PPC_REG_R31, }; if (r < ARR_SIZE(map)) return map[r]; // cannot find this register return 0; } static struct ppc_alias alias_insn_name_maps[] = { //{ PPC_INS_BTA, "bta" }, { PPC_INS_B, PPC_BC_LT, "blt" }, { PPC_INS_B, PPC_BC_LE, "ble" }, { PPC_INS_B, PPC_BC_EQ, "beq" }, { PPC_INS_B, PPC_BC_GE, "bge" }, { PPC_INS_B, PPC_BC_GT, "bgt" }, { PPC_INS_B, PPC_BC_NE, "bne" }, { PPC_INS_B, PPC_BC_UN, "bun" }, { PPC_INS_B, PPC_BC_NU, "bnu" }, { PPC_INS_B, PPC_BC_SO, "bso" }, { PPC_INS_B, PPC_BC_NS, "bns" }, { PPC_INS_BA, PPC_BC_LT, "blta" }, { PPC_INS_BA, PPC_BC_LE, "blea" }, { PPC_INS_BA, PPC_BC_EQ, "beqa" }, { PPC_INS_BA, PPC_BC_GE, "bgea" }, { PPC_INS_BA, PPC_BC_GT, "bgta" }, { PPC_INS_BA, PPC_BC_NE, "bnea" }, { PPC_INS_BA, PPC_BC_UN, "buna" }, { PPC_INS_BA, PPC_BC_NU, "bnua" }, { PPC_INS_BA, PPC_BC_SO, "bsoa" }, { PPC_INS_BA, PPC_BC_NS, "bnsa" }, { PPC_INS_BCTR, PPC_BC_LT, "bltctr" }, { PPC_INS_BCTR, PPC_BC_LE, "blectr" }, { PPC_INS_BCTR, PPC_BC_EQ, "beqctr" }, { PPC_INS_BCTR, PPC_BC_GE, "bgectr" }, { PPC_INS_BCTR, PPC_BC_GT, "bgtctr" }, { PPC_INS_BCTR, PPC_BC_NE, "bnectr" }, { PPC_INS_BCTR, PPC_BC_UN, "bunctr" }, { PPC_INS_BCTR, PPC_BC_NU, "bnuctr" }, { PPC_INS_BCTR, PPC_BC_SO, "bsoctr" }, { PPC_INS_BCTR, PPC_BC_NS, "bnsctr" }, { PPC_INS_BCTRL, PPC_BC_LT, "bltctrl" }, { PPC_INS_BCTRL, PPC_BC_LE, "blectrl" }, { PPC_INS_BCTRL, PPC_BC_EQ, "beqctrl" }, { PPC_INS_BCTRL, PPC_BC_GE, "bgectrl" }, { PPC_INS_BCTRL, PPC_BC_GT, "bgtctrl" }, { PPC_INS_BCTRL, PPC_BC_NE, "bnectrl" }, { PPC_INS_BCTRL, PPC_BC_UN, "bunctrl" }, { PPC_INS_BCTRL, PPC_BC_NU, "bnuctrl" }, { PPC_INS_BCTRL, PPC_BC_SO, "bsoctrl" }, { PPC_INS_BCTRL, PPC_BC_NS, "bnsctrl" }, { PPC_INS_BL, PPC_BC_LT, "bltl" }, { PPC_INS_BL, PPC_BC_LE, "blel" }, { PPC_INS_BL, PPC_BC_EQ, "beql" }, { PPC_INS_BL, PPC_BC_GE, "bgel" }, { PPC_INS_BL, PPC_BC_GT, "bgtl" }, { PPC_INS_BL, PPC_BC_NE, "bnel" }, { PPC_INS_BL, PPC_BC_UN, "bunl" }, { PPC_INS_BL, PPC_BC_NU, "bnul" }, { PPC_INS_BL, PPC_BC_SO, "bsol" }, { PPC_INS_BL, PPC_BC_NS, "bnsl" }, { PPC_INS_BLA, PPC_BC_LT, "bltla" }, { PPC_INS_BLA, PPC_BC_LE, "blela" }, { PPC_INS_BLA, PPC_BC_EQ, "beqla" }, { PPC_INS_BLA, PPC_BC_GE, "bgela" }, { PPC_INS_BLA, PPC_BC_GT, "bgtla" }, { PPC_INS_BLA, PPC_BC_NE, "bnela" }, { PPC_INS_BLA, PPC_BC_UN, "bunla" }, { PPC_INS_BLA, PPC_BC_NU, "bnula" }, { PPC_INS_BLA, PPC_BC_SO, "bsola" }, { PPC_INS_BLA, PPC_BC_NS, "bnsla" }, { PPC_INS_BLR, PPC_BC_LT, "bltlr" }, { PPC_INS_BLR, PPC_BC_LE, "blelr" }, { PPC_INS_BLR, PPC_BC_EQ, "beqlr" }, { PPC_INS_BLR, PPC_BC_GE, "bgelr" }, { PPC_INS_BLR, PPC_BC_GT, "bgtlr" }, { PPC_INS_BLR, PPC_BC_NE, "bnelr" }, { PPC_INS_BLR, PPC_BC_UN, "bunlr" }, { PPC_INS_BLR, PPC_BC_NU, "bnulr" }, { PPC_INS_BLR, PPC_BC_SO, "bsolr" }, { PPC_INS_BLR, PPC_BC_NS, "bnslr" }, { PPC_INS_BLRL, PPC_BC_LT, "bltlrl" }, { PPC_INS_BLRL, PPC_BC_LE, "blelrl" }, { PPC_INS_BLRL, PPC_BC_EQ, "beqlrl" }, { PPC_INS_BLRL, PPC_BC_GE, "bgelrl" }, { PPC_INS_BLRL, PPC_BC_GT, "bgtlrl" }, { PPC_INS_BLRL, PPC_BC_NE, "bnelrl" }, { PPC_INS_BLRL, PPC_BC_UN, "bunlrl" }, { PPC_INS_BLRL, PPC_BC_NU, "bnulrl" }, { PPC_INS_BLRL, PPC_BC_SO, "bsolrl" }, { PPC_INS_BLRL, PPC_BC_NS, "bnslrl" }, }; // given alias mnemonic, return instruction ID & CC bool PPC_alias_insn(const char *name, struct ppc_alias *alias) { int i; for(i = 0; i < ARR_SIZE(alias_insn_name_maps); i++) { if (!strcmp(name, alias_insn_name_maps[i].mnem)) { alias->id = alias_insn_name_maps[i].id; alias->cc = alias_insn_name_maps[i].cc; return true; } } // not really an alias insn i = name2id(&insn_name_maps[1], ARR_SIZE(insn_name_maps) - 1, name); if (i != -1) { alias->id = insn_name_maps[i].id; alias->cc = PPC_BC_INVALID; return true; } // not found return false; } // list all relative branch instructions static unsigned int insn_abs[] = { PPC_BA, PPC_BCCA, PPC_BCCLA, PPC_BDNZA, PPC_BDNZAm, PPC_BDNZAp, PPC_BDNZLA, PPC_BDNZLAm, PPC_BDNZLAp, PPC_BDZA, PPC_BDZAm, PPC_BDZAp, PPC_BDZLAm, PPC_BDZLAp, PPC_BLA, PPC_gBCA, PPC_gBCLA, 0 }; // check if this insn is relative branch bool PPC_abs_branch(cs_struct *h, unsigned int id) { int i; for (i = 0; insn_abs[i]; i++) { if (id == insn_abs[i]) { return true; } } // not found return false; } #endif
the_stack_data/151705926.c
/* FILENAME: find_max_int.c * int型整数の最⼤値を表⽰する */ #include <stdio.h> main() { int a=0; while ( 1 ) { printf("%d\n",a); a = a + 1; } }
the_stack_data/626853.c
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <assert.h> #define MAX_SEQ 31 #define MAX(a,b) ((a)>(b)?(a):(b)) #define MIN(a,b) ((a)<(b)?(a):(b)) #define CNTS_LEN 6 #define CNTS_A 0 #define CNTS_T 1 #define CNTS_C 2 #define CNTS_G 3 #define CNTS_N 4 #define CNTS_GAP 5 double logs[MAX_SEQ+1]; double maxentr; char* alpha = "ATCGN-"; int s1shift = 0, s2shift = 0; typedef struct pair_ints { int s; int e; } pair; typedef struct align_res { char* names[MAX_SEQ]; int algnlen; int numseq; int* algn; char* cnts[CNTS_LEN]; } align; int cntlets(FILE* input) { int numread=0; char temp[256]; char currchar = '~'; if (feof(input)) return 0; fgets(temp, 255, input); if (temp[0] != '>') { fprintf(stderr, "File is not in FASTA format!!\n"); exit(1); } while ((currchar != '>') && (currchar != EOF)) { currchar = fgetc(input); if (!isspace(currchar)) { currchar = toupper(currchar); numread++; } } rewind(input); return numread-1; } int readseq(FILE* input, align* myal, int seqnum, int checksum) { int numread=0, help; char temp[256]; char currchar; if (feof(input)) return 0; fgets(temp, 255, input); if (temp[0] != '>') { fprintf(stderr, "File is not in FASTA format!!\n"); exit(1); } myal->names[seqnum] = (char*) malloc((strlen(temp))*sizeof(char)); strcpy(myal->names[seqnum], temp+1); *(strchr(myal->names[seqnum], '\n')) = 0; currchar = fgetc(input); while (numread <= checksum &&(currchar != '>') && (currchar != EOF)) { if (!isspace(currchar)) { currchar = toupper(currchar); if (!strchr(alpha, currchar)) { // fprintf(stderr, "WARNING %c converted to N\n", currchar, alpha); currchar = 'N'; } help = strchr(alpha, currchar)-alpha; myal->cnts[help][numread]++; if (help != CNTS_GAP) { myal->algn[numread] |= (1 << seqnum); } numread++; } currchar = fgetc(input); } if (currchar == '>') ungetc(currchar, input); if (numread != checksum) { fprintf(stderr, "Sequence (%s) of different lengths (%d v. %d)!!\n", myal->names[seqnum], numread, checksum); exit(1); } return 1; } align* readMultial(FILE* alfile) { int letcnt = cntlets(alfile), i, j; align* res = (align*)malloc (sizeof(align)); res->algn = (int*) malloc (sizeof(int)* letcnt); for (j=0; j<CNTS_LEN; j++) res->cnts[j] = (char*) malloc (sizeof(char)* letcnt); for (i=0; i<letcnt; i++) { res->algn[i] = 0; for (j=0; j<CNTS_LEN; j++) res->cnts[j][i] = 0; } i = 0; while (readseq(alfile, res, i++, letcnt)) ; res->numseq = i-1; res->algnlen = letcnt; return res; } inline int getScore (align* a, int i){ return ((a->cnts[0][i] * (a->cnts[0][i] - 1)) + (a->cnts[1][i] * (a->cnts[1][i] - 1)) + (a->cnts[2][i] * (a->cnts[2][i] - 1)) + (a->cnts[3][i] * (a->cnts[3][i] - 1))) / 2; } void skipto (align *myal, int trgt, int *i, int* pos){ int j; while (*i < trgt){ for (j = 0; j < myal->numseq; j++) pos[j] += (myal->algn[*i] & (1 << j)) > 0; (*i)++; } } void print (align *myal, int *first, int *last, int len){ int *start, *end, i, j, s = 0, e = 0; start = (int *) malloc (sizeof (int) * myal->numseq); assert (start); end = (int *) malloc (sizeof (int) * myal->numseq); assert (end); for (i = 0; i < myal->numseq; i++) start[i] = end[i] = 0; for (i = 0; i < len; i++){ skipto (myal, first[i], &s, start); skipto (myal, last[i], &e, end); printf ("(%d %d) --> ", first[i] + s1shift, last[i] + s1shift); if (myal->numseq == 2){ printf ("(%d %d)%s", start[0] + s1shift, end[0] + s1shift, (0 == myal->numseq - 1) ? "\n" : ", "); printf ("(%d %d)%s", start[1] + s2shift, end[1] + s2shift, (1 == myal->numseq - 1) ? "\n" : ", "); } else { for (j = 0; j < myal->numseq; j++){ printf ("(%d %d)%s", start[0], end[0], (j == myal->numseq - 1) ? "\n" : ", "); } } // this is a hack -- can't handle multiple seq's /* for (j = 0; j < myal->numseq; j++){ printf ("(%d %d)%s", start[j], end[j], (j == myal->numseq - 1) ? "\n" : ", "); } */ } free (start); free (end); } void analyze (align *myal, int cutoff, int window){ int *first, *last, size = 1, len = 0, i, score, count = 0; int runstart = -1, numpairs = myal->numseq * (myal->numseq - 1) / 2; window = MIN (window, myal->algnlen); first = (int *) malloc (size * sizeof (int)); assert (first); last = (int *) malloc (size * sizeof (int)); assert (last); score = 0; for (i = 0; i < window; i++) score += getScore (myal, i); if (score * 100 >= window * numpairs * cutoff) runstart = 0; for (i = 1; i <= myal->algnlen - window; i++){ score += getScore (myal, i + window - 1) - getScore (myal, i - 1); if (score * 100 >= window * numpairs * cutoff){ if (runstart == -1){ if (len > 0 && last[len - 1] >= i) runstart = first[--len]; else runstart = i; } } else if (runstart >= 0){ first[len] = runstart; last[len++] = i + window - 1; runstart = -1; if (len == size){ size *= 2; first = (int *) realloc (first, sizeof (int) * size); assert (first); last = (int *) realloc (last, sizeof (int) * size); assert (last); } } } if (runstart >= 0){ first[len] = runstart; last[len++] = myal->algnlen - 1; } for (i = 0; i < len; i++){ count += last[i] - first[i]; } printf ("%d\n", count); print (myal, first, last, len); free (first); free (last); } int main(int argc, char** argv) { FILE *alignfile; align* myal; int i; if (argc != 4 && argc != 7) { fprintf(stderr, "usage:\ncstat multi_fasta_file cutoff window_size [-shift s1shift s2shift]\n"); exit(1); } if (!(alignfile = fopen(argv[1],"r"))) { fprintf(stderr, "couldnt open alignment file %s\n",argv[1]); return 2; } if (argc == 7){ s1shift = atoi (argv[5]); s2shift = atoi (argv[6]); } myal = readMultial(alignfile); analyze (myal, atoi (argv[2]), atoi (argv[3])); }
the_stack_data/758328.c
int main(int argc, char **argv) { // This is to be viewed in a 80-column terminal, so make the line below more // than 120 characters wide, to span at least two lines. int a_variable_with_a_very_loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_name = 22; int shortvar = 1; return a_variable_with_a_very_loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_name; // Break here }
the_stack_data/206392229.c
#include <cuda.h> #ifdef __KERNEL__ /* just for measurement */ #include <linux/vmalloc.h> #include <linux/time.h> #define printf printk #define malloc vmalloc #define free vfree #define gettimeofday(x, y) do_gettimeofday(x) #else /* just for measurement */ #include <sys/time.h> #include <stdio.h> #include <stdlib.h> #endif /* tvsub: ret = x - y. */ static inline void tvsub(struct timeval *x, struct timeval *y, struct timeval *ret) { ret->tv_sec = x->tv_sec - y->tv_sec; ret->tv_usec = x->tv_usec - y->tv_usec; if (ret->tv_usec < 0) { ret->tv_sec--; ret->tv_usec += 1000000; } } int cuda_test_madd_pinned(unsigned int n, char *path) { int i, j, idx; CUresult res; CUdevice dev; CUcontext ctx; CUfunction function; CUmodule module; CUdeviceptr a_dev, b_dev, c_dev; unsigned int *a_buf, *b_buf, *c_buf; int block_x, block_y, grid_x, grid_y; char fname[256]; struct timeval tv; struct timeval tv_total_start, tv_total_end; float total; struct timeval tv_h2d_start, tv_h2d_end; float h2d; struct timeval tv_d2h_start, tv_d2h_end; float d2h; struct timeval tv_exec_start, tv_exec_end; struct timeval tv_mem_alloc_start; struct timeval tv_data_init_start; float data_init; struct timeval tv_conf_kern_start; struct timeval tv_close_start; float mem_alloc; float exec; float init_gpu; float configure_kernel; float close_gpu; float data_read; unsigned int dummy_b, dummy_c; /* block_x * block_y should not exceed 512. */ block_x = n < 16 ? n : 16; block_y = n < 16 ? n : 16; grid_x = n / block_x; if (n % block_x != 0) grid_x++; grid_y = n / block_y; if (n % block_y != 0) grid_y++; gettimeofday(&tv_total_start, NULL); res = cuInit(0); if (res != CUDA_SUCCESS) { printf("cuInit failed: res = %lu\n", (unsigned long)res); return -1; } res = cuDeviceGet(&dev, 0); if (res != CUDA_SUCCESS) { printf("cuDeviceGet failed: res = %lu\n", (unsigned long)res); return -1; } res = cuCtxCreate(&ctx, 0, dev); if (res != CUDA_SUCCESS) { printf("cuCtxCreate failed: res = %lu\n", (unsigned long)res); return -1; } sprintf(fname, "%s/madd_gpu.cubin", path); res = cuModuleLoad(&module, fname); if (res != CUDA_SUCCESS) { printf("cuModuleLoad() failed\n"); return -1; } res = cuModuleGetFunction(&function, module, "_Z3addPjS_S_j"); if (res != CUDA_SUCCESS) { printf("cuModuleGetFunction() failed\n"); return -1; } /* res = cuFuncSetSharedSize(function, 0x40); /* just random if (res != CUDA_SUCCESS) { printf("cuFuncSetSharedSize() failed\n"); return -1; } */ res = cuFuncSetBlockShape(function, block_x, block_y, 1); if (res != CUDA_SUCCESS) { printf("cuFuncSetBlockShape() failed\n"); return -1; } gettimeofday(&tv_mem_alloc_start, NULL); /* a[] */ res = cuMemAlloc(&a_dev, n*n * sizeof(unsigned int)); if (res != CUDA_SUCCESS) { printf("cuMemAlloc (a) failed\n"); return -1; } /* b[] */ res = cuMemAlloc(&b_dev, n*n * sizeof(unsigned int)); if (res != CUDA_SUCCESS) { printf("cuMemAlloc (b) failed\n"); return -1; } /* c[] */ res = cuMemAlloc(&c_dev, n*n * sizeof(unsigned int)); if (res != CUDA_SUCCESS) { printf("cuMemAlloc (c) failed\n"); return -1; } /* a[] */ res = cuMemAllocHost((void **)&a_buf, n*n * sizeof(unsigned int)); if (res != CUDA_SUCCESS) { printf("cuMemAllocHost (a) failed\n"); return -1; } /* b[] */ res = cuMemAllocHost((void **)&b_buf, n*n * sizeof(unsigned int)); if (res != CUDA_SUCCESS) { printf("cuMemAllocHost (b) failed\n"); return -1; } /* c[] */ res = cuMemAllocHost((void **)&c_buf, n*n * sizeof(unsigned int)); if (res != CUDA_SUCCESS) { printf("cuMemAllocHost (c) failed\n"); return -1; } gettimeofday(&tv_data_init_start, NULL); /* initialize A[] & B[] */ for (i = 0; i < n; i++) { idx = i*n; for(j = 0; j < n; j++) { a_buf[idx++] = i; } } for (i = 0; i < n; i++) { idx = i*n; for(j = 0; j < n; j++) { b_buf[idx++] = i; } } gettimeofday(&tv_h2d_start, NULL); /* upload a[] and b[] */ res = cuMemcpyHtoD(a_dev, a_buf, n*n * sizeof(unsigned int)); if (res != CUDA_SUCCESS) { printf("cuMemcpyHtoD (a) failed: res = %lu\n", (unsigned long)res); return -1; } res = cuMemcpyHtoD(b_dev, b_buf, n*n * sizeof(unsigned int)); if (res != CUDA_SUCCESS) { printf("cuMemcpyHtoD (b) failed: res = %lu\n", (unsigned long)res); return -1; } gettimeofday(&tv_h2d_end, NULL); gettimeofday(&tv_conf_kern_start, NULL); /* set kernel parameters */ res = cuParamSeti(function, 0, a_dev); if (res != CUDA_SUCCESS) { printf("cuParamSeti (a) failed: res = %lu\n", (unsigned long)res); return -1; } res = cuParamSeti(function, 4, a_dev >> 32); if (res != CUDA_SUCCESS) { printf("cuParamSeti (a) failed: res = %lu\n", (unsigned long)res); return -1; } res = cuParamSeti(function, 8, b_dev); if (res != CUDA_SUCCESS) { printf("cuParamSeti (b) failed: res = %lu\n", (unsigned long)res); return -1; } res = cuParamSeti(function, 12, b_dev >> 32); if (res != CUDA_SUCCESS) { printf("cuParamSeti (b) failed: res = %lu\n", (unsigned long)res); return -1; } res = cuParamSeti(function, 16, c_dev); if (res != CUDA_SUCCESS) { printf("cuParamSeti (c) failed: res = %lu\n", (unsigned long)res); return -1; } res = cuParamSeti(function, 20, c_dev >> 32); if (res != CUDA_SUCCESS) { printf("cuParamSeti (c) failed: res = %lu\n", (unsigned long)res); return -1; } res = cuParamSeti(function, 24, n); if (res != CUDA_SUCCESS) { printf("cuParamSeti (c) failed: res = %lu\n", (unsigned long)res); return -1; } res = cuParamSetSize(function, 28); if (res != CUDA_SUCCESS) { printf("cuParamSetSize failed: res = %lu\n", (unsigned long)res); return -1; } gettimeofday(&tv_exec_start, NULL); /* launch the kernel */ res = cuLaunchGrid(function, grid_x, grid_y); if (res != CUDA_SUCCESS) { printf("cuLaunchGrid failed: res = %lu\n", (unsigned long)res); return -1; } cuCtxSynchronize(); gettimeofday(&tv_exec_end, NULL); gettimeofday(&tv_d2h_start, NULL); /* download c[] */ res = cuMemcpyDtoH(c_buf, c_dev, n*n * sizeof(unsigned int)); if (res != CUDA_SUCCESS) { printf("cuMemcpyDtoH (c) failed: res = %lu\n", (unsigned long)res); return -1; } gettimeofday(&tv_d2h_end, NULL); /* Read back */ for (i = 0; i < n; i++) { idx = i*n; for(j = 0; j < n; j++) { dummy_c = c_buf[idx++]; } } gettimeofday(&tv_close_start, NULL); res = cuMemFreeHost((void *)a_buf); if (res != CUDA_SUCCESS) { printf("cuMemFreeHost (a) failed: res = %lu\n", (unsigned long)res); return -1; } res = cuMemFreeHost((void *)b_buf); if (res != CUDA_SUCCESS) { printf("cuMemFreeHost (b) failed: res = %lu\n", (unsigned long)res); return -1; } res = cuMemFreeHost((void *)c_buf); if (res != CUDA_SUCCESS) { printf("cuMemFreeHost (c) failed: res = %lu\n", (unsigned long)res); return -1; } res = cuModuleUnload(module); if (res != CUDA_SUCCESS) { printf("cuModuleUnload failed: res = %lu\n", (unsigned long)res); return -1; } res = cuCtxDestroy(ctx); if (res != CUDA_SUCCESS) { printf("cuCtxDestroy failed: res = %lu\n", (unsigned long)res); return -1; } gettimeofday(&tv_total_end, NULL); tvsub(&tv_mem_alloc_start, &tv_total_start, &tv); init_gpu = tv.tv_sec * 1000.0 + (float) tv.tv_usec / 1000.0; tvsub(&tv_data_init_start, &tv_mem_alloc_start, &tv); mem_alloc = tv.tv_sec * 1000.0 + (float) tv.tv_usec / 1000.0; tvsub(&tv_h2d_start, &tv_data_init_start, &tv); data_init = tv.tv_sec * 1000.0 + (float) tv.tv_usec / 1000.0; tvsub(&tv_h2d_end, &tv_h2d_start, &tv); h2d = tv.tv_sec * 1000.0 + (float) tv.tv_usec / 1000.0; tvsub(&tv_exec_start, &tv_conf_kern_start, &tv); configure_kernel = tv.tv_sec * 1000.0 + (float) tv.tv_usec / 1000.0; tvsub(&tv_exec_end, &tv_exec_start, &tv); exec = tv.tv_sec * 1000.0 + (float) tv.tv_usec / 1000.0; tvsub(&tv_d2h_end, &tv_d2h_start, &tv); d2h = tv.tv_sec * 1000.0 + (float) tv.tv_usec / 1000.0; tvsub(&tv_close_start, &tv_d2h_end, &tv); data_read = tv.tv_sec * 1000.0 + (float) tv.tv_usec / 1000.0; tvsub(&tv_total_end, &tv_close_start, &tv); close_gpu = tv.tv_sec * 1000.0 + (float) tv.tv_usec / 1000.0; tvsub(&tv_total_end, &tv_total_start, &tv); total = tv.tv_sec * 1000.0 + (float) tv.tv_usec / 1000.0; printf("Init: %f\n", init_gpu); printf("MemAlloc: %f\n", mem_alloc); printf("DataInit: %f\n", data_init); printf("HtoD: %f\n", h2d); printf("KernConf: %f\n", configure_kernel); printf("Exec: %f\n", exec); printf("DtoH: %f\n", d2h); printf("DataRead: %f\n", data_read); printf("Close: %f\n", close_gpu); printf("Total: %f\n", total); return 0; }
the_stack_data/14200805.c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_putnbr_base.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: anicusan <[email protected]> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/07/12 00:29:11 by anicusan #+# #+# */ /* Updated: 2016/07/12 00:29:27 by anicusan ### ########.fr */ /* */ /* ************************************************************************** */ void ft_putchar(char c); int ft_strlen(const char *str) { unsigned long i; i = 0; if (!str) return (0); while (str[i]) i++; return (i); } int ft_checkbase(char *base) { long int i; long int j; i = 0; j = 0; if (base[0] == '\0' || base[1] == '\0') return (0); while (base[i] != '\0') { if (base[i] == '-' || base[i] == '+') return (0); while (base[j] != '\0') { if (base[i] == base[j] && i != j) return (0); j++; } i++; } return (1); } void ft_putnbr_base(int nb, char *base) { unsigned int nb2; long int div; long int result; long int baselen; baselen = ft_strlen(base); if (ft_checkbase(base)) { if (nb < 0) { ft_putchar('-'); nb = -nb; } nb2 = nb; div = 1; while ((nb2 / div) >= baselen) div = div * baselen; while (div > 0) { result = ((nb2 / div) % baselen); ft_putchar(base[result]); div = div / baselen; } } }
the_stack_data/176706599.c
/* Program : Implementation of Heap Sort Algorithm in C Author : Sarthak Yadav Principles: - Heap sort is a comparison based sorting technique based on Binary Heap data structure. - We use max-heap for heapsort , whereas min heap is used as priority queues. - For more details about heap Sort visit https://www.topcoder.com/community/data-science/data-science-tutorials/sorting/ - For more details on heaps, view the Data Structures directory Instructions: - This is just the sole heapSort.c file. Compile it using command line with the provided program.c file see program.c file for more details */ #include <stdio.h> #include <stdlib.h> // A heap has current size and array of elements struct MaxHeap { int size; int* array; }; // A utility function to swap to integers void swap(int* a, int* b) { int t = *a; *a = *b; *b = t; } // The main function to heapify a Max Heap. The function // assumes that everything under given root (element at // index idx) is already heapified void maxHeapify(struct MaxHeap* maxHeap, int idx) { int largest = idx; // Initialize largest as root int left = (idx << 1) + 1; // left = 2*idx + 1 int right = (idx + 1) << 1; // right = 2*idx + 2 // See if left child of root exists and is greater than // root if (left < maxHeap->size && maxHeap->array[left] > maxHeap->array[largest]) largest = left; // See if right child of root exists and is greater than // the largest so far if (right < maxHeap->size && maxHeap->array[right] > maxHeap->array[largest]) largest = right; // Change root, if needed if (largest != idx) { swap(&maxHeap->array[largest], &maxHeap->array[idx]); maxHeapify(maxHeap, largest); } } // A utility function to create a max heap of given capacity struct MaxHeap* createAndBuildHeap(int *array, int size) { int i; struct MaxHeap* maxHeap = (struct MaxHeap*) malloc(sizeof(struct MaxHeap)); maxHeap->size = size; // initialize size of heap maxHeap->array = array; // Assign address of first element of array // Start from bottommost and rightmost internal mode and heapify all // internal modes in bottom up way for (i = (maxHeap->size - 2) / 2; i >= 0; --i) maxHeapify(maxHeap, i); return maxHeap; } // The main function to sort an array of given size void heapSort(int* array, int size) { // Build a heap from the input data. struct MaxHeap* maxHeap = createAndBuildHeap(array, size); // Repeat following steps while heap size is greater than 1. // The last element in max heap will be the minimum element while (maxHeap->size > 1) { // The largest item in Heap is stored at the root. Replace // it with the last item of the heap followed by reducing the // size of heap by 1. swap(&maxHeap->array[0], &maxHeap->array[maxHeap->size - 1]); --maxHeap->size; // Reduce heap size // Finally, heapify the root of tree. maxHeapify(maxHeap, 0); } }
the_stack_data/20449453.c
/* * mac2mac.c * * Descripcion: Convert Mac Address into different mac formats * * Author: Fernando Diaz Sanchez <[email protected]> * * Fecha: 18 Feb 2014 * * Licence: MIT * * */ #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <string.h> #include <ctype.h> #include <getopt.h> #include <sys/mman.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> struct _oui{ char* hypen; char* colon; char* dotted; char* cdot; char* none; char* oui; }; #define handle_error(msg) \ do { perror(msg); exit(EXIT_FAILURE); } while (0) void* xcalloc(size_t nr, size_t size); bool check_format(const char* format, const char* mac); char* apply_format(const char* format, const char* mac); void transform_mac(const char* mac, struct _oui* oui); void str_tolower(char* str); void str_toupper(char* str); void print_usage(); unsigned char* shm_alloc(size_t len, int fd); int shm_dealloc(void* addr, size_t len); void process_file(const char* strfile, struct _oui* oui); void get_line(const unsigned char* str,char* dest, size_t ini, size_t fin); unsigned char* load_oui(); void unload_oui(unsigned char* data, struct stat st_oui); char* search_oui(const char* format, const char* mac); int file_exist (char *filename); bool fmayus = false; bool ffile = false; bool ffmoui = true; unsigned char* data_oui; struct stat st_oui; int main(int argc, char **argv) { struct _oui* oui; char* mac = xcalloc(17+1, sizeof(char)); char* strfile = xcalloc(99+1, sizeof(char)); oui = xcalloc(1, sizeof(struct _oui) ); /* Parse cmd line */ int option = 0; while ((option = getopt(argc, argv,"mMhs:f:")) != -1) { switch (option) { case 'm' : fmayus = false; break; case 'M' : fmayus = true; break; case 'h' : print_usage(); exit(0); case 's' : strncpy(mac,optarg,17); break; case 'f' : strncpy(strfile,optarg,100); ffile = true; break; default: print_usage(); exit(EXIT_FAILURE); } } //strncpy(mac,argv[1],17); if ( argc > 1 ) { // Load data oui data_oui = load_oui(); if ( fmayus == true ) str_toupper(mac); else str_tolower(mac); if ( ffile == false ) transform_mac(mac, oui); else process_file(strfile,oui); free(oui); free(mac); free(strfile); oui = NULL; mac = NULL; strfile = NULL; unload_oui(data_oui,st_oui); }else{ print_usage(); } return 0; } void print_usage() { printf("How to use: mac2mac [-m|-M] (-s mac-address | -f file) \n\n"); printf("Options:\n"); printf(" -m = Convert to lowercase\n"); printf(" -M = Convert to uppercase\n"); printf(" -f = Get mac address from a file\n\n"); } void transform_mac(const char* mac, struct _oui* oui) { bool format_ok = false; if ( check_format("XX:XX:XX:XX:XX:XX",mac) == true ) format_ok = true; if ( check_format("XX-XX-XX-XX-XX-XX",mac) == true ) format_ok = true; if ( check_format("XXXX.XXXX.XXXX",mac) == true ) format_ok = true; if ( check_format("XXXX-XXXX-XXXX",mac) == true ) format_ok = true; if ( check_format("XXXXXXXXXXXX",mac) == true ) format_ok = true; if ( format_ok == true ){ oui->hypen = apply_format("XX-XX-XX-XX-XX-XX",mac); oui->colon = apply_format("XX:XX:XX:XX:XX:XX",mac); oui->dotted = apply_format("XXXX.XXXX.XXXX",mac); oui->cdot = apply_format("XXXX-XXXX-XXXX",mac); oui->none = apply_format("XXXXXXXXXXXX",mac); if (ffmoui == true){ oui->oui = search_oui("XX-XX-XX",oui->hypen); /* Print MAC */ printf("%s %s %s %s %s %s\n",oui->hypen, oui->colon, oui->dotted, oui->cdot, oui->none, oui->oui); free(oui->oui); oui->oui = NULL; }else{ printf("%s %s %s %s %s <mini.oui.txt file miss>\n", oui->hypen, oui->colon, oui->dotted, oui->cdot, oui->none); } /* Free Memory */ free(oui->hypen); free(oui->colon); free(oui->dotted); free(oui->cdot); free(oui->none); oui->hypen = NULL; oui->colon = NULL; oui->dotted = NULL; oui->cdot = NULL; oui->none = NULL; }else{ printf("Mac Address Format (%s) invalid\n",mac); } } void* xcalloc(size_t nr, size_t size) { register void* ptr = calloc(nr, size); if(!ptr){ perror("calloc error"); exit(EXIT_FAILURE); } return ptr; } bool check_format(const char* format, const char* mac) { // Verificar longitud if( strlen(format) == strlen(mac) ){ while(*format != '\0'){ if ( *format == 'X' ){ if ( ! isxdigit(*mac) ) return false; }else{ if ( *format != *mac ) return false; } format++; mac++; } }else{ return false; } return true; } char* apply_format(const char* format, const char* mac) { char* ptr = xcalloc(17+1,sizeof(char)); char* ptr_ini = ptr; while(*format != '\0'){ if ( *format == 'X' ){ if ( ! isxdigit(*mac) ) mac++; *ptr = *mac; mac++; } else{ *ptr = *format; } format++; ptr++; } ptr = ptr_ini; return ptr; } char* search_oui(const char* format, const char* mac) { // Get the MAC OUI char* str_oui = xcalloc(8+1,sizeof(char)); char* str_ini = str_oui; char* res = xcalloc(100+1,sizeof(char)); char* res_ini = res; int count = 0; while(*format != '\0'){ *str_oui = toupper(*mac); mac++; str_oui++; format++; } str_oui = str_ini; // Seek the OUI char* p; p = strstr(data_oui,str_oui); // get line if found if ( p == NULL ){ strncpy(res,"UNKOWN OUI",15); }else{ while(*p != '\n'){ count++; *res = *p; p++; res++; if ( count > 100 ) break; } } res = res_ini; // Free Heap free(str_oui); str_oui = NULL; return res; } void str_tolower(char* str) { while(*str != '\0'){ *str = tolower(*str); str++; } } void str_toupper(char* str) { while(*str != '\0'){ *str = toupper(*str); str++; } } unsigned char* shm_alloc(size_t len, int fd) { void* addr; addr = mmap(NULL, /* Where to start */ len, /* Size */ PROT_READ, /* Prot */ MAP_SHARED, /* Map */ fd, /* File descriptor */ 0); /* Offset */ if ( addr == MAP_FAILED ){ perror("mmap error"); exit(EXIT_FAILURE); } return addr; } int shm_dealloc(void* addr, size_t len) { int res; res = munmap(addr, len); if ( res == -1 ) handle_error("nunmap error"); return res; } void process_file(const char* strfile, struct _oui* oui) { int fd; struct stat st; unsigned char* data; size_t ini = 0; size_t fin = 0; char* str_aux = NULL; char* str_aux_ini; fd = open(strfile,O_RDONLY); if ( fd == -1 ) handle_error("open error"); if ( fstat(fd, &st) == -1) handle_error("fstat error"); data = shm_alloc(st.st_size,fd); /* Print MAC */ printf("HYPHEN COLON DOTTED CDOTTED NONE OUI\n"); for (int len=0;len<st.st_size;len++ ){ if ( data[len] == '\n' ){ fin = len; str_aux = xcalloc((fin-ini)+1,sizeof(char)); str_aux_ini = str_aux; get_line(data,str_aux,ini,fin); str_aux = str_aux_ini; if ( fmayus == true ) str_toupper(str_aux); else str_tolower(str_aux); transform_mac(str_aux,oui); ini = len+1; free(str_aux); str_aux = NULL; } } if ( close(fd) == -1 ) handle_error("close error"); shm_dealloc(data,st.st_size); } unsigned char* load_oui() { int fd; unsigned char* data; char* ptr; if ( file_exist("mini.oui.txt") ){ fd = open("mini.oui.txt",O_RDONLY); if ( fd == -1 ){ handle_error("open error"); }else{ if ( fstat(fd, &st_oui) == -1) handle_error("fstat error"); data = shm_alloc(st_oui.st_size,fd); if ( close(fd) == -1 ) handle_error("close error"); } }else{ ffmoui = false; } return data; } void unload_oui(unsigned char* data, struct stat st_oui) { if (data != NULL) shm_dealloc(data,st_oui.st_size); } void get_line(const unsigned char* str,char* dest, size_t ini, size_t fin) { for (int len=ini;len<fin;len++ ){ *dest = str[len]; dest++; } } int file_exist (char *filename) { struct stat buffer; return (stat (filename, &buffer) == 0); }
the_stack_data/215767498.c
/* Practica 9: Numero pseudo-aleatorio Autor: Espinosa Curiel Oscar */ #include <stdio.h> #include <stdlib.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> int main(int argc, char *argv[]) { int fd; unsigned int *c = malloc(sizeof(unsigned int)); char *archivo = "/dev/random"; fd = open(archivo, O_RDONLY,S_IRUSR|S_IWUSR); read(fd, c, sizeof(unsigned int)); close(fd); printf("%lu\n", *c%10); return 0; }
the_stack_data/339142.c
#include <stdio.h> int main(void) { int i, j, k; for (i=0; i<3; i++) for (j=0; j<26; j++) for (k=0; k<2; k++) printf("%c", 'A'+j); return 0; }
the_stack_data/18888520.c
#include <stdio.h> #include <stdlib.h> void pausar(){ printf("\nPressione alguma tecla para continuar..."); getch(); } int main(){ float n1, n2, media; printf("Digite a sua primeira nota: \n"); scanf("%f", &n1); printf("Digite a sua segunda nota: \n"); scanf("%f", &n2); media = (n1 + n2) / 2; if ((media >= 7) && (media <= 9.9)){ printf("Aprovado \n"); }else{ if (media < 7){ printf("Reprovado \n"); }else{ if (media == 10){ printf("Aprovado com Distincao \n"); } } } pausar(); return (0); }
the_stack_data/28262859.c
// Check target CPUs are correctly passed. // RUN: %clang -target aarch64 -### -c %s 2>&1 | FileCheck -check-prefix=GENERIC %s // RUN: %clang -target aarch64 -mcpu=generic -### -c %s 2>&1 | FileCheck -check-prefix=GENERIC %s // RUN: %clang -target aarch64 -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=GENERIC %s // RUN: %clang -target aarch64 -mlittle-endian -mcpu=generic -### -c %s 2>&1 | FileCheck -check-prefix=GENERIC %s // RUN: %clang -target aarch64_be -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=GENERIC %s // RUN: %clang -target aarch64_be -mlittle-endian -mcpu=generic -### -c %s 2>&1 | FileCheck -check-prefix=GENERIC %s // GENERIC: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "generic" // RUN: %clang -target arm64 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-GENERIC %s // RUN: %clang -target arm64 -mcpu=generic -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-GENERIC %s // RUN: %clang -target arm64 -mlittle-endian -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-GENERIC %s // RUN: %clang -target arm64 -mlittle-endian -mcpu=generic -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-GENERIC %s // ARM64-GENERIC: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "generic" // We cannot check much for -mcpu=native, but it should be replaced by either generic or a valid // Arm cpu string, depending on the host. // RUN: %clang -target arm64 -mcpu=native -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-NATIVE %s // ARM64-NATIVE-NOT: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "native" // RUN: %clang -target arm64-apple-darwin -arch arm64 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-DARWIN %s // RUN: %clang -target arm64-apple-darwin -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-DARWIN %s // RUN: %clang -target arm64-apple-ios12.0 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-DARWIN %s // ARM64-DARWIN: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "apple-a7" // ARM64-DARWIN-SAME: "-target-feature" "+aes" // RUN: %clang -target x86_64-apple-darwin -arch arm64e -### -c %s 2>&1 | FileCheck -check-prefix=ARM64E-DARWIN %s // ARM64E-DARWIN: "-cc1"{{.*}} "-triple" "arm64e{{.*}}" "-target-cpu" "vortex" // RUN: %clang -target arm64-apple-darwin -arch arm64_32 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64_32-DARWIN %s // ARM64_32-DARWIN: "-cc1"{{.*}} "-triple" "aarch64_32{{.*}}" "-target-cpu" "apple-s4" // RUN: %clang -target aarch64 -mcpu=cortex-a35 -### -c %s 2>&1 | FileCheck -check-prefix=CA35 %s // RUN: %clang -target aarch64 -mlittle-endian -mcpu=cortex-a35 -### -c %s 2>&1 | FileCheck -check-prefix=CA35 %s // RUN: %clang -target aarch64_be -mlittle-endian -mcpu=cortex-a35 -### -c %s 2>&1 | FileCheck -check-prefix=CA35 %s // RUN: %clang -target aarch64 -mtune=cortex-a35 -### -c %s 2>&1 | FileCheck -check-prefix=CA35-TUNE %s // RUN: %clang -target aarch64 -mlittle-endian -mtune=cortex-a35 -### -c %s 2>&1 | FileCheck -check-prefix=CA35-TUNE %s // RUN: %clang -target aarch64_be -mlittle-endian -mtune=cortex-a35 -### -c %s 2>&1 | FileCheck -check-prefix=CA35-TUNE %s // CA35: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "cortex-a35" // CA35-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "generic" // RUN: %clang -target arm64 -mcpu=cortex-a35 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA35 %s // RUN: %clang -target arm64 -mlittle-endian -mcpu=cortex-a35 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA35 %s // RUN: %clang -target arm64 -mtune=cortex-a35 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA35-TUNE %s // RUN: %clang -target arm64 -mlittle-endian -mtune=cortex-a35 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA35-TUNE %s // ARM64-CA35: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "cortex-a35" // ARM64-CA35-TUNE: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "generic" // RUN: %clang -target aarch64 -mcpu=cortex-a34 -### -c %s 2>&1 | FileCheck -check-prefix=CA34 %s // RUN: %clang -target aarch64 -mlittle-endian -mcpu=cortex-a34 -### -c %s 2>&1 | FileCheck -check-prefix=CA34 %s // RUN: %clang -target aarch64_be -mlittle-endian -mcpu=cortex-a34 -### -c %s 2>&1 | FileCheck -check-prefix=CA34 %s // RUN: %clang -target aarch64 -mtune=cortex-a34 -### -c %s 2>&1 | FileCheck -check-prefix=CA34-TUNE %s // RUN: %clang -target aarch64 -mlittle-endian -mtune=cortex-a34 -### -c %s 2>&1 | FileCheck -check-prefix=CA34-TUNE %s // RUN: %clang -target aarch64_be -mlittle-endian -mtune=cortex-a34 -### -c %s 2>&1 | FileCheck -check-prefix=CA34-TUNE %s // CA34: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "cortex-a34" // CA34-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" // RUN: %clang -target arm64 -mcpu=cortex-a34 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA34 %s // RUN: %clang -target arm64 -mlittle-endian -mcpu=cortex-a34 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA34 %s // RUN: %clang -target arm64 -mtune=cortex-a34 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA34-TUNE %s // RUN: %clang -target arm64 -mlittle-endian -mtune=cortex-a34 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA34-TUNE %s // ARM64-CA34: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "cortex-a34" // ARM64-CA34-TUNE: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "generic" // RUN: %clang -target aarch64 -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CA53 %s // RUN: %clang -target aarch64 -mlittle-endian -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CA53 %s // RUN: %clang -target aarch64_be -mlittle-endian -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CA53 %s // RUN: %clang -target aarch64 -mtune=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CA53-TUNE %s // RUN: %clang -target aarch64_be -mlittle-endian -mtune=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CA53-TUNE %s // CA53: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "cortex-a53" // CA53-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "generic" // RUN: %clang -target arm64 -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA53 %s // RUN: %clang -target arm64 -mlittle-endian -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA53 %s // RUN: %clang -target arm64 -mtune=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA53-TUNE %s // RUN: %clang -target arm64 -mlittle-endian -mtune=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA53-TUNE %s // ARM64-CA53: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "cortex-a53" // ARM64-CA53-TUNE: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "generic" // RUN: %clang -target aarch64 -mcpu=cortex-a55 -### -c %s 2>&1 | FileCheck -check-prefix=CA55 %s // RUN: %clang -target aarch64 -mlittle-endian -mcpu=cortex-a55 -### -c %s 2>&1 | FileCheck -check-prefix=CA55 %s // RUN: %clang -target aarch64_be -mlittle-endian -mcpu=cortex-a55 -### -c %s 2>&1 | FileCheck -check-prefix=CA55 %s // RUN: %clang -target aarch64 -mtune=cortex-a55 -### -c %s 2>&1 | FileCheck -check-prefix=CA55-TUNE %s // RUN: %clang -target aarch64_be -mlittle-endian -mtune=cortex-a55 -### -c %s 2>&1 | FileCheck -check-prefix=CA55-TUNE %s // CA55: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "cortex-a55" // CA55-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "generic" // RUN: %clang -target arm64 -mcpu=cortex-a55 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA55 %s // RUN: %clang -target arm64 -mlittle-endian -mcpu=cortex-a55 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA55 %s // RUN: %clang -target arm64 -mtune=cortex-a55 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA55-TUNE %s // RUN: %clang -target arm64 -mlittle-endian -mtune=cortex-a55 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA55-TUNE %s // ARM64-CA55: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "cortex-a55" // ARM64-CA55-TUNE: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "generic" // RUN: %clang -target aarch64 -mcpu=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=CA57 %s // RUN: %clang -target aarch64 -mlittle-endian -mcpu=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=CA57 %s // RUN: %clang -target aarch64_be -mlittle-endian -mcpu=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=CA57 %s // RUN: %clang -target aarch64 -mtune=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=CA57-TUNE %s // RUN: %clang -target aarch64 -mlittle-endian -mtune=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=CA57-TUNE %s // RUN: %clang -target aarch64_be -mlittle-endian -mtune=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=CA57-TUNE %s // CA57: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "cortex-a57" // CA57-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "generic" // RUN: %clang -target arm64 -mcpu=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA57 %s // RUN: %clang -target arm64 -mlittle-endian -mcpu=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA57 %s // RUN: %clang -target arm64 -mtune=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA57-TUNE %s // RUN: %clang -target arm64 -mlittle-endian -mtune=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA57-TUNE %s // ARM64-CA57: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "cortex-a57" // ARM64-CA57-TUNE: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "generic" // RUN: %clang -target aarch64 -mcpu=cortex-a72 -### -c %s 2>&1 | FileCheck -check-prefix=CA72 %s // RUN: %clang -target aarch64 -mlittle-endian -mcpu=cortex-a72 -### -c %s 2>&1 | FileCheck -check-prefix=CA72 %s // RUN: %clang -target aarch64_be -mlittle-endian -mcpu=cortex-a72 -### -c %s 2>&1 | FileCheck -check-prefix=CA72 %s // RUN: %clang -target aarch64 -mtune=cortex-a72 -### -c %s 2>&1 | FileCheck -check-prefix=CA72-TUNE %s // RUN: %clang -target aarch64 -mlittle-endian -mtune=cortex-a72 -### -c %s 2>&1 | FileCheck -check-prefix=CA72-TUNE %s // RUN: %clang -target aarch64_be -mlittle-endian -mtune=cortex-a72 -### -c %s 2>&1 | FileCheck -check-prefix=CA72-TUNE %s // CA72: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "cortex-a72" // CA72-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "generic" // RUN: %clang -target arm64 -mcpu=cortex-a72 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA72 %s // RUN: %clang -target arm64 -mlittle-endian -mcpu=cortex-a72 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA72 %s // RUN: %clang -target arm64 -mtune=cortex-a72 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA72-TUNE %s // RUN: %clang -target arm64 -mlittle-endian -mtune=cortex-a72 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CA72-TUNE %s // ARM64-CA72: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "cortex-a72" // ARM64-CA72-TUNE: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "generic" // RUN: %clang -target aarch64 -mcpu=cortex-a73 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-A73 %s // RUN: %clang -target aarch64 -mlittle-endian -mcpu=cortex-a73 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-A73 %s // RUN: %clang -target aarch64_be -mlittle-endian -mcpu=cortex-a73 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-A73 %s // RUN: %clang -target aarch64 -mtune=cortex-a73 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-A73-TUNE %s // RUN: %clang -target aarch64 -mlittle-endian -mtune=cortex-a73 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-A73-TUNE %s // RUN: %clang -target aarch64_be -mlittle-endian -mtune=cortex-a73 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-A73-TUNE %s // CORTEX-A73: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "cortex-a73" // CORTEX-A73-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "generic" // RUN: %clang -target arm64 -mcpu=cortex-a73 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CORTEX-A73 %s // RUN: %clang -target arm64 -mlittle-endian -mcpu=cortex-a73 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CORTEX-A73 %s // RUN: %clang -target arm64 -mtune=cortex-a73 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CORTEX-A73-TUNE %s // RUN: %clang -target arm64 -mlittle-endian -mtune=cortex-a73 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CORTEX-A73-TUNE %s // ARM64-CORTEX-A73: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "cortex-a73" // ARM64-CORTEX-A73-TUNE: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "generic" // RUN: %clang -target aarch64 -mcpu=cortex-a75 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-A75 %s // RUN: %clang -target aarch64 -mlittle-endian -mcpu=cortex-a75 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-A75 %s // RUN: %clang -target aarch64_be -mlittle-endian -mcpu=cortex-a75 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-A75 %s // RUN: %clang -target aarch64 -mtune=cortex-a75 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-A75-TUNE %s // RUN: %clang -target aarch64 -mlittle-endian -mtune=cortex-a75 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-A75-TUNE %s // RUN: %clang -target aarch64_be -mlittle-endian -mtune=cortex-a75 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-A75-TUNE %s // CORTEX-A75: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "cortex-a75" // CORTEX-A75-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "generic" // RUN: %clang -target arm64 -mcpu=cortex-a75 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CORTEX-A75 %s // RUN: %clang -target arm64 -mlittle-endian -mcpu=cortex-a75 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CORTEX-A75 %s // RUN: %clang -target arm64 -mtune=cortex-a75 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CORTEX-A75-TUNE %s // RUN: %clang -target arm64 -mlittle-endian -mtune=cortex-a75 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CORTEX-A75-TUNE %s // ARM64-CORTEX-A75: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "cortex-a75" // ARM64-CORTEX-A75-TUNE: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "generic" // RUN: %clang -target aarch64 -mcpu=cortex-a76 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-A76 %s // RUN: %clang -target aarch64 -mlittle-endian -mcpu=cortex-a76 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-A76 %s // RUN: %clang -target aarch64_be -mlittle-endian -mcpu=cortex-a76 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-A76 %s // RUN: %clang -target aarch64 -mtune=cortex-a76 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-A76-TUNE %s // RUN: %clang -target aarch64 -mlittle-endian -mtune=cortex-a76 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-A76-TUNE %s // RUN: %clang -target aarch64_be -mlittle-endian -mtune=cortex-a76 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-A76-TUNE %s // CORTEX-A76: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "cortex-a76" // CORTEX-A76-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "generic" // RUN: %clang -target arm64 -mcpu=cortex-a76 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CORTEX-A76 %s // RUN: %clang -target arm64 -mlittle-endian -mcpu=cortex-a76 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CORTEX-A76 %s // RUN: %clang -target arm64 -mtune=cortex-a76 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CORTEX-A76-TUNE %s // RUN: %clang -target arm64 -mlittle-endian -mtune=cortex-a76 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-CORTEX-A76-TUNE %s // ARM64-CORTEX-A76: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "cortex-a76" // ARM64-CORTEX-A76-TUNE: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "generic" // RUN: %clang -target aarch64_be -mcpu=exynos-m3 -### -c %s 2>&1 | FileCheck -check-prefix=M3 %s // RUN: %clang -target aarch64 -mbig-endian -mcpu=exynos-m3 -### -c %s 2>&1 | FileCheck -check-prefix=M3 %s // RUN: %clang -target aarch64_be -mbig-endian -mcpu=exynos-m3 -### -c %s 2>&1 | FileCheck -check-prefix=M3 %s // RUN: %clang -target aarch64_be -mtune=exynos-m3 -### -c %s 2>&1 | FileCheck -check-prefix=M3-TUNE %s // RUN: %clang -target aarch64 -mbig-endian -mtune=exynos-m3 -### -c %s 2>&1 | FileCheck -check-prefix=M3-TUNE %s // RUN: %clang -target aarch64_be -mbig-endian -mtune=exynos-m3 -### -c %s 2>&1 | FileCheck -check-prefix=M3-TUNE %s // M3: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "exynos-m3" // M3-TUNE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" // RUN: %clang -target aarch64_be -mcpu=exynos-m4 -### -c %s 2>&1 | FileCheck -check-prefix=M4 %s // RUN: %clang -target aarch64 -mbig-endian -mcpu=exynos-m4 -### -c %s 2>&1 | FileCheck -check-prefix=M4 %s // RUN: %clang -target aarch64_be -mbig-endian -mcpu=exynos-m4 -### -c %s 2>&1 | FileCheck -check-prefix=M4 %s // RUN: %clang -target aarch64_be -mtune=exynos-m4 -### -c %s 2>&1 | FileCheck -check-prefix=M4-TUNE %s // RUN: %clang -target aarch64 -mbig-endian -mtune=exynos-m4 -### -c %s 2>&1 | FileCheck -check-prefix=M4-TUNE %s // RUN: %clang -target aarch64_be -mbig-endian -mtune=exynos-m4 -### -c %s 2>&1 | FileCheck -check-prefix=M4-TUNE %s // M4: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "exynos-m4" "-target-feature" "+v8.2a" // M4-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" // M4-TUNE-NOT: "+v8.2a" // RUN: %clang -target aarch64_be -mcpu=exynos-m5 -### -c %s 2>&1 | FileCheck -check-prefix=M5 %s // RUN: %clang -target aarch64 -mbig-endian -mcpu=exynos-m5 -### -c %s 2>&1 | FileCheck -check-prefix=M5 %s // RUN: %clang -target aarch64_be -mbig-endian -mcpu=exynos-m5 -### -c %s 2>&1 | FileCheck -check-prefix=M5 %s // RUN: %clang -target aarch64_be -mtune=exynos-m5 -### -c %s 2>&1 | FileCheck -check-prefix=M5-TUNE %s // RUN: %clang -target aarch64 -mbig-endian -mtune=exynos-m5 -### -c %s 2>&1 | FileCheck -check-prefix=M5-TUNE %s // RUN: %clang -target aarch64_be -mbig-endian -mtune=exynos-m5 -### -c %s 2>&1 | FileCheck -check-prefix=M5-TUNE %s // M5: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "exynos-m5" "-target-feature" "+v8.2a" // M5-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" // M5-TUNE-NOT: "+v8.2a" // RUN: %clang -target arm64 -mcpu=exynos-m3 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-M3 %s // RUN: %clang -target arm64 -mlittle-endian -mcpu=exynos-m3 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-M3 %s // RUN: %clang -target arm64 -mtune=exynos-m3 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-M3-TUNE %s // RUN: %clang -target arm64 -mlittle-endian -mtune=exynos-m3 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-M3-TUNE %s // ARM64-M3: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "exynos-m3" // ARM64-M3-TUNE: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "generic" // RUN: %clang -target arm64 -mcpu=exynos-m4 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-M4 %s // RUN: %clang -target arm64 -mlittle-endian -mcpu=exynos-m4 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-M4 %s // RUN: %clang -target arm64 -mtune=exynos-m4 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-M4-TUNE %s // RUN: %clang -target arm64 -mlittle-endian -mtune=exynos-m4 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-M4-TUNE %s // ARM64-M4: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "exynos-m4" "-target-feature" "+v8.2a" // ARM64-M4-TUNE: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "generic" // ARM64-M4-TUNE-NOT: "+v8.2a" // RUN: %clang -target arm64 -mcpu=exynos-m5 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-M5 %s // RUN: %clang -target arm64 -mlittle-endian -mcpu=exynos-m5 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-M5 %s // RUN: %clang -target arm64 -mtune=exynos-m5 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-M5-TUNE %s // RUN: %clang -target arm64 -mlittle-endian -mtune=exynos-m5 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-M5-TUNE %s // ARM64-M5: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "exynos-m5" "-target-feature" "+v8.2a" // ARM64-M5-TUNE: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "generic" // ARM64-M5-TUNE-NOT: "+v8.2a" // RUN: %clang -target aarch64 -mcpu=falkor -### -c %s 2>&1 | FileCheck -check-prefix=FALKOR %s // RUN: %clang -target aarch64 -mlittle-endian -mcpu=falkor -### -c %s 2>&1 | FileCheck -check-prefix=FALKOR %s // RUN: %clang -target aarch64 -mtune=falkor -### -c %s 2>&1 | FileCheck -check-prefix=FALKOR-TUNE %s // RUN: %clang -target aarch64 -mlittle-endian -mtune=falkor -### -c %s 2>&1 | FileCheck -check-prefix=FALKOR-TUNE %s // FALKOR: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "falkor" // FALKOR-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" // RUN: %clang -target arm64 -mcpu=falkor -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-FALKOR %s // RUN: %clang -target arm64 -mlittle-endian -mcpu=falkor -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-FALKOR %s // RUN: %clang -target arm64 -mtune=falkor -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-FALKOR-TUNE %s // RUN: %clang -target arm64 -mlittle-endian -mtune=falkor -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-FALKOR-TUNE %s // ARM64-FALKOR: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "falkor" // ARM64-FALKOR-TUNE: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "generic" // RUN: %clang -target aarch64 -mcpu=kryo -### -c %s 2>&1 | FileCheck -check-prefix=KRYO %s // RUN: %clang -target aarch64 -mlittle-endian -mcpu=kryo -### -c %s 2>&1 | FileCheck -check-prefix=KRYO %s // RUN: %clang -target aarch64 -mtune=kryo -### -c %s 2>&1 | FileCheck -check-prefix=KRYO-TUNE %s // RUN: %clang -target aarch64 -mlittle-endian -mtune=kryo -### -c %s 2>&1 | FileCheck -check-prefix=KRYO-TUNE %s // KRYO: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "kryo" // KRYO-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" // RUN: %clang -target arm64 -mcpu=kryo -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-KRYO %s // RUN: %clang -target arm64 -mlittle-endian -mcpu=kryo -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-KRYO %s // RUN: %clang -target arm64 -mtune=kryo -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-KRYO-TUNE %s // RUN: %clang -target arm64 -mlittle-endian -mtune=kryo -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-KRYO-TUNE %s // ARM64-KRYO: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "kryo" // ARM64-KRYO-TUNE: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "generic" // RUN: %clang -target aarch64 -mcpu=thunderx2t99 -### -c %s 2>&1 | FileCheck -check-prefix=THUNDERX2T99 %s // RUN: %clang -target aarch64 -mlittle-endian -mcpu=thunderx2t99 -### -c %s 2>&1 | FileCheck -check-prefix=THUNDERX2T99 %s // RUN: %clang -target aarch64_be -mlittle-endian -mcpu=thunderx2t99 -### -c %s 2>&1 | FileCheck -check-prefix=THUNDERX2T99 %s // RUN: %clang -target aarch64 -mtune=thunderx2t99 -### -c %s 2>&1 | FileCheck -check-prefix=THUNDERX2T99-TUNE %s // RUN: %clang -target aarch64 -mlittle-endian -mtune=thunderx2t99 -### -c %s 2>&1 | FileCheck -check-prefix=THUNDERX2T99-TUNE %s // RUN: %clang -target aarch64_be -mlittle-endian -mtune=thunderx2t99 -### -c %s 2>&1 | FileCheck -check-prefix=THUNDERX2T99-TUNE %s // THUNDERX2T99: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "thunderx2t99" "-target-feature" "+v8.1a" // THUNDERX2T99-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "generic" // THUNDERX2T99-TUNE-NOT: +v8.1a // RUN: %clang -target arm64 -mcpu=thunderx2t99 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-THUNDERX2T99 %s // RUN: %clang -target arm64 -mlittle-endian -mcpu=thunderx2t99 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-THUNDERX2T99 %s // RUN: %clang -target arm64 -mtune=thunderx2t99 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-THUNDERX2T99-TUNE %s // RUN: %clang -target arm64 -mlittle-endian -mtune=thunderx2t99 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-THUNDERX2T99-TUNE %s // ARM64-THUNDERX2T99: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "thunderx2t99" "-target-feature" "+v8.1a" // ARM64-THUNDERX2T99-TUNE: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "generic" // ARM64-THUNDERX2T99-TUNE-NOT: +v8.1a // RUN: %clang -target arm64-apple-darwin -arch arm64 -mcpu=vortex -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-VORTEX %s // ARM64-VORTEX: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "vortex" "-target-feature" "+v8.3a" "-target-feature" "+fp-armv8" "-target-feature" "+neon" "-target-feature" "+crc" "-target-feature" "+crypto" "-target-feature" "+fullfp16" "-target-feature" "+ras" "-target-feature" "+lse" "-target-feature" "+rdm" "-target-feature" "+rcpc" "-target-feature" "+zcm" "-target-feature" "+zcz" "-target-feature" "+sha2" "-target-feature" "+aes" // Check that we also support -march, which overrides -mcpu (same for e.g. -march=v8.1a -mcpu=cyclone not enabling crc). // RUN: %clang -target arm64-apple-darwin -arch arm64 -march=armv8.3a -mcpu=vortex -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-VORTEX-V83 %s // ARM64-VORTEX-V83: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "vortex" "-target-feature" "+neon" "-target-feature" "+v8.3a" "-target-feature" "+zcm" "-target-feature" "+zcz" // RUN: %clang -target arm64-apple-darwin -arch arm64 -mcpu=lightning -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-LIGHTNING %s // ARM64-LIGHTNING: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "lightning" "-target-feature" "+v8.4a" "-target-feature" "+fp-armv8" "-target-feature" "+neon" "-target-feature" "+crc" "-target-feature" "+crypto" "-target-feature" "+dotprod" "-target-feature" "+fullfp16" "-target-feature" "+ras" "-target-feature" "+lse" "-target-feature" "+rdm" "-target-feature" "+rcpc" "-target-feature" "+zcm" "-target-feature" "+zcz" "-target-feature" "+fp16fml" "-target-feature" "+sm4" "-target-feature" "+sha3" "-target-feature" "+sha2" "-target-feature" "+aes" // RUN: %clang -target aarch64_be -### -c %s 2>&1 | FileCheck -check-prefix=GENERIC-BE %s // RUN: %clang -target aarch64 -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=GENERIC-BE %s // RUN: %clang -target aarch64_be -mbig-endian -### -c %s 2>&1 | FileCheck -check-prefix=GENERIC-BE %s // GENERIC-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" // RUN: %clang -target aarch64_be -mcpu=cortex-a35 -### -c %s 2>&1 | FileCheck -check-prefix=CA35-BE %s // RUN: %clang -target aarch64 -mbig-endian -mcpu=cortex-a35 -### -c %s 2>&1 | FileCheck -check-prefix=CA35-BE %s // RUN: %clang -target aarch64_be -mbig-endian -mcpu=cortex-a35 -### -c %s 2>&1 | FileCheck -check-prefix=CA35-BE %s // RUN: %clang -target aarch64_be -mtune=cortex-a35 -### -c %s 2>&1 | FileCheck -check-prefix=CA35-BE-TUNE %s // RUN: %clang -target aarch64 -mbig-endian -mtune=cortex-a35 -### -c %s 2>&1 | FileCheck -check-prefix=CA35-BE-TUNE %s // RUN: %clang -target aarch64_be -mbig-endian -mtune=cortex-a35 -### -c %s 2>&1 | FileCheck -check-prefix=CA35-BE-TUNE %s // CA35-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "cortex-a35" // CA35-BE-TUNE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" // RUN: %clang -target aarch64_be -mcpu=cortex-a34 -### -c %s 2>&1 | FileCheck -check-prefix=CA34-BE %s // RUN: %clang -target aarch64 -mbig-endian -mcpu=cortex-a34 -### -c %s 2>&1 | FileCheck -check-prefix=CA34-BE %s // RUN: %clang -target aarch64_be -mbig-endian -mcpu=cortex-a34 -### -c %s 2>&1 | FileCheck -check-prefix=CA34-BE %s // RUN: %clang -target aarch64_be -mtune=cortex-a34 -### -c %s 2>&1 | FileCheck -check-prefix=CA34-BE-TUNE %s // RUN: %clang -target aarch64 -mbig-endian -mtune=cortex-a34 -### -c %s 2>&1 | FileCheck -check-prefix=CA34-BE-TUNE %s // RUN: %clang -target aarch64_be -mbig-endian -mtune=cortex-a34 -### -c %s 2>&1 | FileCheck -check-prefix=CA34-BE-TUNE %s // CA34-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "cortex-a34" // CA34-BE-TUNE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" // RUN: %clang -target aarch64_be -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CA53-BE %s // RUN: %clang -target aarch64 -mbig-endian -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CA53-BE %s // RUN: %clang -target aarch64_be -mbig-endian -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CA53-BE %s // RUN: %clang -target aarch64_be -mtune=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CA53-BE-TUNE %s // RUN: %clang -target aarch64 -mbig-endian -mtune=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CA53-BE-TUNE %s // RUN: %clang -target aarch64_be -mbig-endian -mtune=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CA53-BE-TUNE %s // CA53-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "cortex-a53" // CA53-BE-TUNE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" // RUN: %clang -target aarch64_be -mcpu=cortex-a55 -### -c %s 2>&1 | FileCheck -check-prefix=CA55-BE %s // RUN: %clang -target aarch64 -mbig-endian -mcpu=cortex-a55 -### -c %s 2>&1 | FileCheck -check-prefix=CA55-BE %s // RUN: %clang -target aarch64_be -mbig-endian -mcpu=cortex-a55 -### -c %s 2>&1 | FileCheck -check-prefix=CA55-BE %s // RUN: %clang -target aarch64_be -mtune=cortex-a55 -### -c %s 2>&1 | FileCheck -check-prefix=CA55-BE-TUNE %s // RUN: %clang -target aarch64 -mbig-endian -mtune=cortex-a55 -### -c %s 2>&1 | FileCheck -check-prefix=CA55-BE-TUNE %s // RUN: %clang -target aarch64_be -mbig-endian -mtune=cortex-a55 -### -c %s 2>&1 | FileCheck -check-prefix=CA55-BE-TUNE %s // CA55-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "cortex-a55" // CA55-BE-TUNE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" // RUN: %clang -target aarch64_be -mcpu=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=CA57-BE %s // RUN: %clang -target aarch64 -mbig-endian -mcpu=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=CA57-BE %s // RUN: %clang -target aarch64_be -mbig-endian -mcpu=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=CA57-BE %s // RUN: %clang -target aarch64_be -mtune=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=CA57-BE-TUNE %s // RUN: %clang -target aarch64 -mbig-endian -mtune=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=CA57-BE-TUNE %s // RUN: %clang -target aarch64_be -mbig-endian -mtune=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=CA57-BE-TUNE %s // CA57-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "cortex-a57" // CA57-BE-TUNE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" // RUN: %clang -target aarch64_be -mcpu=cortex-a72 -### -c %s 2>&1 | FileCheck -check-prefix=CA72-BE %s // RUN: %clang -target aarch64 -mbig-endian -mcpu=cortex-a72 -### -c %s 2>&1 | FileCheck -check-prefix=CA72-BE %s // RUN: %clang -target aarch64_be -mbig-endian -mcpu=cortex-a72 -### -c %s 2>&1 | FileCheck -check-prefix=CA72-BE %s // RUN: %clang -target aarch64_be -mtune=cortex-a72 -### -c %s 2>&1 | FileCheck -check-prefix=CA72-BE-TUNE %s // RUN: %clang -target aarch64 -mbig-endian -mtune=cortex-a72 -### -c %s 2>&1 | FileCheck -check-prefix=CA72-BE-TUNE %s // RUN: %clang -target aarch64_be -mbig-endian -mtune=cortex-a72 -### -c %s 2>&1 | FileCheck -check-prefix=CA72-BE-TUNE %s // CA72-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "cortex-a72" // CA72-BE-TUNE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" // RUN: %clang -target aarch64_be -mcpu=cortex-a73 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-A73-BE %s // RUN: %clang -target aarch64 -mbig-endian -mcpu=cortex-a73 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-A73-BE %s // RUN: %clang -target aarch64_be -mbig-endian -mcpu=cortex-a73 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-A73-BE %s // RUN: %clang -target aarch64_be -mtune=cortex-a73 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-A73-BE-TUNE %s // RUN: %clang -target aarch64 -mbig-endian -mtune=cortex-a73 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-A73-BE-TUNE %s // RUN: %clang -target aarch64_be -mbig-endian -mtune=cortex-a73 -### -c %s 2>&1 | FileCheck -check-prefix=CORTEX-A73-BE-TUNE %s // CORTEX-A73-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "cortex-a73" // CORTEX-A73-BE-TUNE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" // RUN: %clang -target aarch64_be -mcpu=exynos-m3 -### -c %s 2>&1 | FileCheck -check-prefix=M3-BE %s // RUN: %clang -target aarch64 -mbig-endian -mcpu=exynos-m3 -### -c %s 2>&1 | FileCheck -check-prefix=M3-BE %s // RUN: %clang -target aarch64_be -mbig-endian -mcpu=exynos-m3 -### -c %s 2>&1 | FileCheck -check-prefix=M3-BE %s // RUN: %clang -target aarch64_be -mtune=exynos-m3 -### -c %s 2>&1 | FileCheck -check-prefix=M3-BE-TUNE %s // RUN: %clang -target aarch64 -mbig-endian -mtune=exynos-m3 -### -c %s 2>&1 | FileCheck -check-prefix=M3-BE-TUNE %s // RUN: %clang -target aarch64_be -mbig-endian -mtune=exynos-m3 -### -c %s 2>&1 | FileCheck -check-prefix=M3-BE-TUNE %s // M3-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "exynos-m3" // M3-BE-TUNE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" // RUN: %clang -target aarch64_be -mcpu=exynos-m4 -### -c %s 2>&1 | FileCheck -check-prefix=M4-BE %s // RUN: %clang -target aarch64 -mbig-endian -mcpu=exynos-m4 -### -c %s 2>&1 | FileCheck -check-prefix=M4-BE %s // RUN: %clang -target aarch64_be -mbig-endian -mcpu=exynos-m4 -### -c %s 2>&1 | FileCheck -check-prefix=M4-BE %s // RUN: %clang -target aarch64_be -mtune=exynos-m4 -### -c %s 2>&1 | FileCheck -check-prefix=M4-BE-TUNE %s // RUN: %clang -target aarch64 -mbig-endian -mtune=exynos-m4 -### -c %s 2>&1 | FileCheck -check-prefix=M4-BE-TUNE %s // RUN: %clang -target aarch64_be -mbig-endian -mtune=exynos-m4 -### -c %s 2>&1 | FileCheck -check-prefix=M4-BE-TUNE %s // M4-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "exynos-m4" "-target-feature" "+v8.2a" // M4-BE-TUNE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" // M4-BE-TUNE-NOT: "+v8.2a" // RUN: %clang -target aarch64_be -mcpu=exynos-m5 -### -c %s 2>&1 | FileCheck -check-prefix=M5-BE %s // RUN: %clang -target aarch64 -mbig-endian -mcpu=exynos-m5 -### -c %s 2>&1 | FileCheck -check-prefix=M5-BE %s // RUN: %clang -target aarch64_be -mbig-endian -mcpu=exynos-m5 -### -c %s 2>&1 | FileCheck -check-prefix=M5-BE %s // RUN: %clang -target aarch64_be -mtune=exynos-m5 -### -c %s 2>&1 | FileCheck -check-prefix=M5-BE-TUNE %s // RUN: %clang -target aarch64 -mbig-endian -mtune=exynos-m5 -### -c %s 2>&1 | FileCheck -check-prefix=M5-BE-TUNE %s // RUN: %clang -target aarch64_be -mbig-endian -mtune=exynos-m5 -### -c %s 2>&1 | FileCheck -check-prefix=M5-BE-TUNE %s // M5-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "exynos-m5" "-target-feature" "+v8.2a" // M5-BE-TUNE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" // M5-BE-TUNE-NOT: "+v8.2a" // RUN: %clang -target aarch64_be -mcpu=thunderx2t99 -### -c %s 2>&1 | FileCheck -check-prefix=THUNDERX2T99-BE %s // RUN: %clang -target aarch64 -mbig-endian -mcpu=thunderx2t99 -### -c %s 2>&1 | FileCheck -check-prefix=THUNDERX2T99-BE %s // RUN: %clang -target aarch64_be -mbig-endian -mcpu=thunderx2t99 -### -c %s 2>&1 | FileCheck -check-prefix=THUNDERX2T99-BE %s // RUN: %clang -target aarch64_be -mtune=thunderx2t99 -### -c %s 2>&1 | FileCheck -check-prefix=THUNDERX2T99-BE-TUNE %s // RUN: %clang -target aarch64 -mbig-endian -mtune=thunderx2t99 -### -c %s 2>&1 | FileCheck -check-prefix=THUNDERX2T99-BE-TUNE %s // RUN: %clang -target aarch64_be -mbig-endian -mtune=thunderx2t99 -### -c %s 2>&1 | FileCheck -check-prefix=THUNDERX2T99-BE-TUNE %s // THUNDERX2T99-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "thunderx2t99" // THUNDERX2T99-BE-TUNE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" // RUN: %clang -target aarch64 -mcpu=cortex-a57 -mtune=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=MCPU-MTUNE-A57 %s // RUN: %clang -target aarch64 -mtune=cortex-a53 -mcpu=cortex-a57 -### -c %s 2>&1 | FileCheck -check-prefix=MCPU-MTUNE-A57 %s // RUN: %clang -target aarch64 -mcpu=cortex-a72 -mtune=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=MCPU-MTUNE-A72 %s // RUN: %clang -target aarch64 -mtune=cortex-a53 -mcpu=cortex-a72 -### -c %s 2>&1 | FileCheck -check-prefix=MCPU-MTUNE-A72 %s // RUN: %clang -target aarch64 -mtune=cortex-a53 -mcpu=cortex-a73 -### -c %s 2>&1 | FileCheck -check-prefix=MCPU-MTUNE-A73 %s // RUN: %clang -target aarch64 -mcpu=thunderx2t99 -mtune=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=MCPU-MTUNE-THUNDERX2T99 %s // RUN: %clang -target aarch64 -mtune=cortex-a53 -mcpu=thunderx2t99 -### -c %s 2>&1 | FileCheck -check-prefix=MCPU-MTUNE-THUNDERX2T99 %s // MCPU-MTUNE-A57: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "cortex-a57" // MCPU-MTUNE-A72: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "cortex-a72" // MCPU-MTUNE-A73: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "cortex-a73" // MCPU-MTUNE-THUNDERX2T99: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "thunderx2t99" // RUN: %clang -target aarch64 -march=armv8.1a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV81A %s // RUN: %clang -target aarch64 -march=armv8.1-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV81A %s // RUN: %clang -target aarch64 -mlittle-endian -march=armv8.1a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV81A %s // RUN: %clang -target aarch64 -mlittle-endian -march=armv8.1-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV81A %s // RUN: %clang -target aarch64_be -mlittle-endian -march=armv8.1a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV81A %s // RUN: %clang -target aarch64_be -mlittle-endian -march=armv8.1-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV81A %s // GENERICV81A: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.1a" // RUN: %clang -target arm64 -march=armv8.1a -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-GENERICV81A %s // RUN: %clang -target arm64 -march=armv8.1-a -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-GENERICV81A %s // RUN: %clang -target arm64 -mlittle-endian -march=armv8.1a -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-GENERICV81A %s // RUN: %clang -target arm64 -mlittle-endian -march=armv8.1-a -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-GENERICV81A %s // ARM64-GENERICV81A: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.1a" // RUN: %clang -target aarch64_be -march=armv8.1a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV81A-BE %s // RUN: %clang -target aarch64_be -march=armv8.1-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV81A-BE %s // RUN: %clang -target aarch64 -mbig-endian -march=armv8.1a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV81A-BE %s // RUN: %clang -target aarch64 -mbig-endian -march=armv8.1-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV81A-BE %s // RUN: %clang -target aarch64_be -mbig-endian -march=armv8.1a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV81A-BE %s // RUN: %clang -target aarch64_be -mbig-endian -march=armv8.1-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV81A-BE %s // RUN: %clang -target aarch64 -march=armv8.2a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A %s // RUN: %clang -target aarch64 -march=armv8.2-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A %s // RUN: %clang -target aarch64 -mlittle-endian -march=armv8.2a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A %s // RUN: %clang -target aarch64 -mlittle-endian -march=armv8.2-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A %s // RUN: %clang -target aarch64_be -mlittle-endian -march=armv8.2a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A %s // RUN: %clang -target aarch64_be -mlittle-endian -march=armv8.2-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A %s // GENERICV82A: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.2a" // RUN: %clang -target aarch64_be -march=armv8.2a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-BE %s // RUN: %clang -target aarch64_be -march=armv8.2-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-BE %s // RUN: %clang -target aarch64 -mbig-endian -march=armv8.2a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-BE %s // RUN: %clang -target aarch64 -mbig-endian -march=armv8.2-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-BE %s // RUN: %clang -target aarch64_be -mbig-endian -march=armv8.2a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-BE %s // RUN: %clang -target aarch64_be -mbig-endian -march=armv8.2-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-BE %s // GENERICV82A-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.2a" // RUN: %clang -target aarch64 -march=armv8.2a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-NO-FP16FML %s // RUN: %clang -target aarch64 -march=armv8.2-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-NO-FP16FML %s // GENERICV82A-NO-FP16FML-NOT: "-target-feature" "{{[+-]}}fp16fml" // GENERICV82A-NO-FP16FML-NOT: "-target-feature" "{{[+-]}}fullfp16" // RUN: %clang -target aarch64 -march=armv8.2a+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-FP16 %s // RUN: %clang -target aarch64 -march=armv8.2-a+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-FP16 %s // GENERICV82A-FP16: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.2a" "-target-feature" "+fullfp16" // GENERICV82A-FP16-NOT: "-target-feature" "{{[+-]}}fp16fml" // GENERICV82A-FP16-SAME: {{$}} // RUN: %clang -target aarch64 -march=armv8.2-a+profile -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-SPE %s // GENERICV82A-SPE: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.2a" "-target-feature" "+spe" // RUN: %clang -target aarch64 -march=armv8a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV8A-NO-FP16FML %s // RUN: %clang -target aarch64 -march=armv8-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV8A-NO-FP16FML %s // GENERICV8A-NO-FP16FML-NOT: "-target-feature" "{{[+-]}}fp16fml" // GENERICV8A-NO-FP16FML-NOT: "-target-feature" "{{[+-]}}fullfp16" // RUN: %clang -target aarch64 -march=armv8a+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV8A-FP16 %s // RUN: %clang -target aarch64 -march=armv8-a+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV8A-FP16 %s // GENERICV8A-FP16-NOT: "-target-feature" "{{[+-]}}fp16fml" // GENERICV8A-FP16: "-target-feature" "+fullfp16" // GENERICV8A-FP16-NOT: "-target-feature" "{{[+-]}}fp16fml" // GENERICV8A-FP16-SAME: {{$}} // RUN: %clang -target aarch64 -march=armv8a+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV8A-FP16FML %s // RUN: %clang -target aarch64 -march=armv8-a+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV8A-FP16FML %s // GENERICV8A-FP16FML: "-target-feature" "+fp16fml" "-target-feature" "+fullfp16" // RUN: %clang -target aarch64 -march=armv8.2a+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-FP16FML %s // RUN: %clang -target aarch64 -march=armv8.2-a+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-FP16FML %s // GENERICV82A-FP16FML: "-target-feature" "+fp16fml" "-target-feature" "+fullfp16" // RUN: %clang -target aarch64 -march=armv8.2a+fp16+nofp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-FP16-NO-FP16FML %s // RUN: %clang -target aarch64 -march=armv8.2-a+fp16+nofp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-FP16-NO-FP16FML %s // GENERICV82A-FP16-NO-FP16FML: "-target-feature" "+fullfp16" "-target-feature" "-fp16fml" // RUN: %clang -target aarch64 -march=armv8.2a+nofp16fml+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-NO-FP16FML-FP16 %s // RUN: %clang -target aarch64 -march=armv8.2-a+nofp16fml+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-NO-FP16FML-FP16 %s // GENERICV82A-NO-FP16FML-FP16: "-target-feature" "-fp16fml" "-target-feature" "+fullfp16" // RUN: %clang -target aarch64 -march=armv8.2a+fp16fml+nofp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-FP16FML-NO-FP16 %s // RUN: %clang -target aarch64 -march=armv8.2-a+fp16fml+nofp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-FP16FML-NO-FP16 %s // GENERICV82A-FP16FML-NO-FP16: "-target-feature" "-fullfp16" "-target-feature" "-fp16fml" // RUN: %clang -target aarch64 -march=armv8.2a+nofp16+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-NO-FP16-FP16FML %s // RUN: %clang -target aarch64 -march=armv8.2-a+nofp16+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-NO-FP16-FP16FML %s // GENERICV82A-NO-FP16-FP16FML: "-target-feature" "+fp16fml" "-target-feature" "+fullfp16" // RUN: %clang -target aarch64 -march=armv8.2a+fp16+profile -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-FP16-SPE %s // RUN: %clang -target aarch64 -march=armv8.2-a+fp16+profile -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-FP16-SPE %s // GENERICV82A-FP16-SPE: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.2a" "-target-feature" "+fullfp16" "-target-feature" "+spe" // GENERICV82A-FP16-SPE-NOT: "-target-feature" "{{[+-]}}fp16fml" // GENERICV82A-FP16-SPE-SAME: {{$}} // RUN: %clang -target aarch64 -march=armv8.3a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A %s // RUN: %clang -target aarch64 -march=armv8.3-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A %s // RUN: %clang -target aarch64 -mlittle-endian -march=armv8.3a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A %s // RUN: %clang -target aarch64 -mlittle-endian -march=armv8.3-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A %s // RUN: %clang -target aarch64_be -mlittle-endian -march=armv8.3a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A %s // RUN: %clang -target aarch64_be -mlittle-endian -march=armv8.3-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A %s // GENERICV83A: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.3a" // RUN: %clang -target aarch64_be -march=armv8.3a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-BE %s // RUN: %clang -target aarch64_be -march=armv8.3-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-BE %s // RUN: %clang -target aarch64 -mbig-endian -march=armv8.3a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-BE %s // RUN: %clang -target aarch64 -mbig-endian -march=armv8.3-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-BE %s // RUN: %clang -target aarch64_be -mbig-endian -march=armv8.3a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-BE %s // RUN: %clang -target aarch64_be -mbig-endian -march=armv8.3-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-BE %s // GENERICV83A-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.3a" // RUN: %clang -target aarch64 -march=armv8.3a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-NO-FP16FML %s // RUN: %clang -target aarch64 -march=armv8.3-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-NO-FP16FML %s // GENERICV83A-NO-FP16FML-NOT: "-target-feature" "{{[+-]}}fp16fml" // GENERICV83A-NO-FP16FML-NOT: "-target-feature" "{{[+-]}}fullfp16" // RUN: %clang -target aarch64 -march=armv8.3a+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-FP16 %s // RUN: %clang -target aarch64 -march=armv8.3-a+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-FP16 %s // GENERICV83A-FP16: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.3a" "-target-feature" "+fullfp16" // RUN: %clang -target aarch64 -march=armv8.3a+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-FP16FML %s // RUN: %clang -target aarch64 -march=armv8.3-a+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-FP16FML %s // GENERICV83A-FP16FML: "-target-feature" "+fp16fml" "-target-feature" "+fullfp16" // RUN: %clang -target aarch64 -march=armv8.3a+fp16+nofp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-FP16-NO-FP16FML %s // RUN: %clang -target aarch64 -march=armv8.3-a+fp16+nofp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-FP16-NO-FP16FML %s // GENERICV83A-FP16-NO-FP16FML: "-target-feature" "+fullfp16" "-target-feature" "-fp16fml" // RUN: %clang -target aarch64 -march=armv8.3a+nofp16fml+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-NO-FP16FML-FP16 %s // RUN: %clang -target aarch64 -march=armv8.3-a+nofp16fml+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-NO-FP16FML-FP16 %s // GENERICV83A-NO-FP16FML-FP16: "-target-feature" "-fp16fml" "-target-feature" "+fullfp16" // RUN: %clang -target aarch64 -march=armv8.3a+fp16fml+nofp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-FP16FML-NO-FP16 %s // RUN: %clang -target aarch64 -march=armv8.3-a+fp16fml+nofp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-FP16FML-NO-FP16 %s // GENERICV83A-FP16FML-NO-FP16: "-target-feature" "-fullfp16" "-target-feature" "-fp16fml" // RUN: %clang -target aarch64 -march=armv8.3a+nofp16+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-NO-FP16-FP16FML %s // RUN: %clang -target aarch64 -march=armv8.3-a+nofp16+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV83A-NO-FP16-FP16FML %s // GENERICV83A-NO-FP16-FP16FML: "-target-feature" "+fp16fml" "-target-feature" "+fullfp16" // RUN: %clang -target aarch64 -march=armv8.4a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A %s // RUN: %clang -target aarch64 -march=armv8.4-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A %s // RUN: %clang -target aarch64 -mlittle-endian -march=armv8.4a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A %s // RUN: %clang -target aarch64 -mlittle-endian -march=armv8.4-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A %s // RUN: %clang -target aarch64_be -mlittle-endian -march=armv8.4a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A %s // RUN: %clang -target aarch64_be -mlittle-endian -march=armv8.4-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A %s // GENERICV84A: "-cc1"{{.*}} "-triple" "aarch64{{(--)?}}"{{.*}} "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.4a" // RUN: %clang -target aarch64_be -march=armv8.4a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-BE %s // RUN: %clang -target aarch64_be -march=armv8.4-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-BE %s // RUN: %clang -target aarch64 -mbig-endian -march=armv8.4a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-BE %s // RUN: %clang -target aarch64 -mbig-endian -march=armv8.4-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-BE %s // RUN: %clang -target aarch64_be -mbig-endian -march=armv8.4a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-BE %s // RUN: %clang -target aarch64_be -mbig-endian -march=armv8.4-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-BE %s // GENERICV84A-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.4a" // RUN: %clang -target aarch64 -march=armv8.4a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-NO-FP16FML %s // RUN: %clang -target aarch64 -march=armv8.4-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-NO-FP16FML %s // GENERICV84A-NO-FP16FML-NOT: "-target-feature" "{{[+-]}}fp16fml" // GENERICV84A-NO-FP16FML-NOT: "-target-feature" "{{[+-]}}fullfp16" // RUN: %clang -target aarch64 -march=armv8.4a+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-FP16 %s // RUN: %clang -target aarch64 -march=armv8.4-a+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-FP16 %s // GENERICV84A-FP16: "-target-feature" "+fullfp16" "-target-feature" "+fp16fml" // RUN: %clang -target aarch64 -march=armv8.4a+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-FP16FML %s // RUN: %clang -target aarch64 -march=armv8.4-a+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-FP16FML %s // GENERICV84A-FP16FML: "-target-feature" "+fp16fml" "-target-feature" "+fullfp16" // RUN: %clang -target aarch64 -march=armv8.4a+fp16+nofp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-FP16-NO-FP16FML %s // RUN: %clang -target aarch64 -march=armv8.4-a+fp16+nofp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-FP16-NO-FP16FML %s // GENERICV84A-FP16-NO-FP16FML: "-target-feature" "+fullfp16" "-target-feature" "-fp16fml" // RUN: %clang -target aarch64 -march=armv8.4a+nofp16fml+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-NO-FP16FML-FP16 %s // RUN: %clang -target aarch64 -march=armv8.4-a+nofp16fml+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-NO-FP16FML-FP16 %s // GENERICV84A-NO-FP16FML-FP16: "-target-feature" "+fullfp16" "-target-feature" "+fp16fml" // RUN: %clang -target aarch64 -march=armv8.4a+fp16fml+nofp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-FP16FML-NO-FP16 %s // RUN: %clang -target aarch64 -march=armv8.4-a+fp16fml+nofp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-FP16FML-NO-FP16 %s // GENERICV84A-FP16FML-NO-FP16: "-target-feature" "-fullfp16" "-target-feature" "-fp16fml" // RUN: %clang -target aarch64 -march=armv8.4a+nofp16+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-NO-FP16-FP16FML %s // RUN: %clang -target aarch64 -march=armv8.4-a+nofp16+fp16fml -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV84A-NO-FP16-FP16FML %s // GENERICV84A-NO-FP16-FP16FML: "-target-feature" "+fp16fml" "-target-feature" "+fullfp16" // RUN: %clang -target aarch64 -march=armv8.5a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV85A %s // RUN: %clang -target aarch64 -march=armv8.5-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV85A %s // RUN: %clang -target aarch64 -mlittle-endian -march=armv8.5a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV85A %s // RUN: %clang -target aarch64 -mlittle-endian -march=armv8.5-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV85A %s // RUN: %clang -target aarch64_be -mlittle-endian -march=armv8.5a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV85A %s // RUN: %clang -target aarch64_be -mlittle-endian -march=armv8.5-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV85A %s // GENERICV85A: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.5a" // RUN: %clang -target aarch64_be -march=armv8.5a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV85A-BE %s // RUN: %clang -target aarch64_be -march=armv8.5-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV85A-BE %s // RUN: %clang -target aarch64 -mbig-endian -march=armv8.5a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV85A-BE %s // RUN: %clang -target aarch64 -mbig-endian -march=armv8.5-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV85A-BE %s // RUN: %clang -target aarch64_be -mbig-endian -march=armv8.5a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV85A-BE %s // RUN: %clang -target aarch64_be -mbig-endian -march=armv8.5-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV85A-BE %s // GENERICV85A-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.5a" // RUN: %clang -target aarch64 -march=armv8.5-a+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV85A-FP16 %s // GENERICV85A-FP16: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.5a" "-target-feature" "+fullfp16" // fullfp16 is off by default for v8a, feature must not be mentioned // RUN: %clang -target aarch64 -march=armv8a -### -c %s 2>&1 | FileCheck -check-prefix=V82ANOFP16 -check-prefix=GENERIC %s // RUN: %clang -target aarch64 -march=armv8-a -### -c %s 2>&1 | FileCheck -check-prefix=V82ANOFP16 -check-prefix=GENERIC %s // V82ANOFP16-NOT: "-target-feature" "{{[+-]}}fp16fml" // V82ANOFP16-NOT: "-target-feature" "{{[+-]}}fullfp16" // RAS is on by default for v8.2a, but can be disabled by +noras // RUN: %clang -target aarch64 -march=armv8.2a -### -c %s 2>&1 | FileCheck -check-prefix=V82ARAS -check-prefix=GENERICV82A %s // RUN: %clang -target aarch64 -march=armv8.2-a -### -c %s 2>&1 | FileCheck -check-prefix=V82ARAS -check-prefix=GENERICV82A %s // V82ARAS-NOT: "-target-feature" "+ras" // V82ARAS-NOT: "-target-feature" "-ras" // RUN: %clang -target aarch64 -march=armv8.2a+noras -### -c %s 2>&1 | FileCheck -check-prefix=V82ANORAS -check-prefix=GENERICV82A %s // RUN: %clang -target aarch64 -march=armv8.2-a+noras -### -c %s 2>&1 | FileCheck -check-prefix=V82ANORAS -check-prefix=GENERICV82A %s // V82ANORAS: "-target-feature" "-ras" // RAS is off by default for v8a, but can be enabled by +ras (this is not architecturally valid) // RUN: %clang -target aarch64 -march=armv8a+ras -### -c %s 2>&1 | FileCheck -check-prefix=V8ARAS -check-prefix=GENERIC %s // RUN: %clang -target aarch64 -march=armv8-a+ras -### -c %s 2>&1 | FileCheck -check-prefix=V8ARAS -check-prefix=GENERIC %s // V8ARAS: "-target-feature" "+ras" // ================== Check whether -march accepts mixed-case values. // RUN: %clang -target aarch64_be -march=ARMV8.1A -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV81A-BE %s // RUN: %clang -target aarch64_be -march=ARMV8.1-A -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV81A-BE %s // RUN: %clang -target aarch64 -mbig-endian -march=Armv8.1A -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV81A-BE %s // RUN: %clang -target aarch64 -mbig-endian -march=Armv8.1-A -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV81A-BE %s // RUN: %clang -target aarch64_be -mbig-endian -march=ARMv8.1a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV81A-BE %s // RUN: %clang -target aarch64_be -mbig-endian -march=ARMV8.1-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV81A-BE %s // GENERICV81A-BE: "-cc1"{{.*}} "-triple" "aarch64_be{{.*}}" "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.1a" // ================== Check whether -mcpu and -mtune accept mixed-case values. // RUN: %clang -target aarch64 -mcpu=Cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CASE-INSENSITIVE-CA53 %s // RUN: %clang -target aarch64 -mtune=Cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CASE-INSENSITIVE-CA53-TUNE %s // CASE-INSENSITIVE-CA53: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "cortex-a53" // CASE-INSENSITIVE-CA53-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" // RUN: %clang -target arm64 -mcpu=cortex-A53 -### -c %s 2>&1 | FileCheck -check-prefix=CASE-INSENSITIVE-ARM64-CA53 %s // RUN: %clang -target arm64 -mtune=cortex-A53 -### -c %s 2>&1 | FileCheck -check-prefix=CASE-INSENSITIVE-ARM64-CA53-TUNE %s // CASE-INSENSITIVE-ARM64-CA53: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "cortex-a53" // CASE-INSENSITIVE-ARM64-CA53-TUNE: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "generic" // RUN: %clang -target aarch64 -mcpu=CORTEX-A57 -### -c %s 2>&1 | FileCheck -check-prefix=CASE-INSENSITIVE-CA57 %s // RUN: %clang -target aarch64 -mtune=CORTEX-A57 -### -c %s 2>&1 | FileCheck -check-prefix=CASE-INSENSITIVE-CA57-TUNE %s // CASE-INSENSITIVE-CA57: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "cortex-a57" // CASE-INSENSITIVE-CA57-TUNE: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" // RUN: %clang -target arm64 -mcpu=Cortex-A57 -### -c %s 2>&1 | FileCheck -check-prefix=CASE-INSENSITIVE-ARM64-CA57 %s // RUN: %clang -target arm64 -mtune=Cortex-A57 -### -c %s 2>&1 | FileCheck -check-prefix=CASE-INSENSITIVE-ARM64-CA57-TUNE %s // CASE-INSENSITIVE-ARM64-CA57: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "cortex-a57" // CASE-INSENSITIVE-ARM64-CA57-TUNE: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "generic"
the_stack_data/70529.c
/*numPass=9, numTotal=9 Verdict:ACCEPTED, Visibility:1, Input:"abcdef 2", ExpOutput:"efabcd", Output:"efabcd" Verdict:ACCEPTED, Visibility:1, Input:"programming 11", ExpOutput:"programming", Output:"programming" Verdict:ACCEPTED, Visibility:1, Input:"hello-@programmer 5", ExpOutput:"ammerhello-@progr", Output:"ammerhello-@progr" Verdict:ACCEPTED, Visibility:0, Input:"hellodear 3", ExpOutput:"earhellod", Output:"earhellod" Verdict:ACCEPTED, Visibility:0, Input:"progamming 0", ExpOutput:"progamming", Output:"progamming" Verdict:ACCEPTED, Visibility:0, Input:"programming 10", ExpOutput:"rogrammingp", Output:"rogrammingp" Verdict:ACCEPTED, Visibility:0, Input:"programming 13", ExpOutput:"ngprogrammi", Output:"ngprogrammi" Verdict:ACCEPTED, Visibility:0, Input:"abcde 4", ExpOutput:"bcdea", Output:"bcdea" Verdict:ACCEPTED, Visibility:0, Input:"abcdz 5", ExpOutput:"abcdz", Output:"abcdz" */ #include <stdio.h> int read(char a[]){ int ch; int count=0; ch=a[count]; while(ch!='\0'&&count<100){ count=count+1; ch=a[count]; } return count; } int main() { char a[100]; int m,n; int i,j; scanf("%s",a); scanf("%d",&n); m=read(a); n=n%m; for(i=m-n;i<m;i++){ printf("%c",a[i]); } for(j=0;j<m-n;j++){ printf("%c",a[j]); } return 0; }
the_stack_data/103265936.c
#include <stdio.h> void ft_ft(int *nbr) { *nbr = 42; } int main(void) { int a; int *ptr; ptr = &a; ft_ft(ptr); printf("%d\n", a); printf("%d\n", *ptr); *ptr = 30; printf("%d\n", a); printf("%d\n", *ptr); return (0); }
the_stack_data/111952.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 'subtract_float2float2.cl' */ source_code = read_buffer("subtract_float2float2.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, "subtract_float2float2", &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_float2 *src_0_host_buffer; src_0_host_buffer = malloc(num_elem * sizeof(cl_float2)); for (int i = 0; i < num_elem; i++) src_0_host_buffer[i] = (cl_float2){{2.0, 2.0}}; /* 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_float2), 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_float2), 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_float2 *src_1_host_buffer; src_1_host_buffer = malloc(num_elem * sizeof(cl_float2)); for (int i = 0; i < num_elem; i++) src_1_host_buffer[i] = (cl_float2){{2.0, 2.0}}; /* 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_float2), 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_float2), 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_float2 *dst_host_buffer; dst_host_buffer = malloc(num_elem * sizeof(cl_float2)); memset((void *)dst_host_buffer, 1, num_elem * sizeof(cl_float2)); /* Create device dst buffer */ cl_mem dst_device_buffer; dst_device_buffer = clCreateBuffer(context, CL_MEM_WRITE_ONLY, num_elem *sizeof(cl_float2), 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_float2), 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_float2)); 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/674948.c
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <stdbool.h> // Longitud maxima de datos de entrada const char NUMLEN = 10; // Precio del fertilizante por metro cuadrado const float PRECIO_FERTILIZANTE = 5.0f; // Precio de la mano de obra por 200 metros cuadrados const float PRECIO_TRAJADOR = 100.0f; int main(int argc, char **argv) { // Almacena los metros cuadrados char datoEntrada[NUMLEN]; int metrosCuadrados; bool datoValido = true; //leer datos printf("Ingrese los metros cuadrados:\n"); do{ //Guardar como cadena scanf("%s", datoEntrada); //Iterarar en cadena y verificar que todos los caracteres sean un numero for(int i = 0 ; i < strlen(datoEntrada); ++i){ if(!isdigit(datoEntrada[i])) datoValido = false; else datoValido = true; } if(!datoValido) printf("No ingreso un numero\nIntente nuevamente: "); }while(!datoValido); // Convertir de cadena a entero metrosCuadrados = atoi(datoEntrada); //calcular inversion float inversionFertilizante; float inversionManodeObra; float inversionTotal = 0.0f; // calcular inversion por metro cuadrado en fertilizante inversionFertilizante = metrosCuadrados * PRECIO_FERTILIZANTE; // calcular metros trabajados y multiplicar por precio por metro de mano de obra inversionManodeObra = (metrosCuadrados / 200.0) * PRECIO_TRAJADOR; // summar inversiones para obtener la inversionTotal inversionTotal = inversionFertilizante + inversionManodeObra; // Mostrar resultado en pantalla printf("-------------------------------------------------------\n"); printf("Para %d metros cuadrados se invirtio:\n", metrosCuadrados); printf("%10.4f $ en fertilizante \n%10.4f $ en mano de obra\n", inversionFertilizante, inversionManodeObra); printf("Invirtiendo un total de %.4f $\n", inversionTotal); printf("-------------------------------------------------------\n"); return 0; }
the_stack_data/394453.c
// // Program.c // Listing 11 // // Created by Mustafa Youldash on 9/3/17. // Copyright © 2017 Umm Al-Qura University. All rights reserved. // #include <stdio.h> int main(void) { int a[2][3] = { {1,2}, {4,5,6} }; int i, j; printf("Values in a are: \n"); for (i = 0; i <= 1; ++i) { for (j = 0; j <= 2; ++j) { printf("a[%d][%d] = %d\n", i, j, a[i][j]); } } return 0; }
the_stack_data/112789.c
/* to print string of chars */ #include <stdio.h> void printstr(char *p, int size) { char *s = p; while (p - s < size && *p != '\0') { printf("%c", *p++); } printf("\n"); }
the_stack_data/986824.c
/* Autogenerated */ /* curve description: p256 */ /* requested operations: (all) */ /* s = 0x10000000000000000000000000000000000000000000000000000000000000000 (from "2^256") */ /* c = [(26959946667150639794667015087019630673637144422540572481103610249216, 1), (6277101735386680763835789423207666416102355444464034512896, -1), (79228162514264337593543950336, -1), (1, 1)] (from "2^224,1;2^192,-1;2^96,-1;1,1") */ /* machine_wordsize = 32 (from "32") */ /* */ /* NOTE: In addition to the bounds specified above each function, all */ /* functions synthesized for this Montgomery arithmetic require the */ /* input to be strictly less than the prime modulus (s-c), and also */ /* require the input to be in the unique saturated representation. */ /* All functions also ensure that these two properties are true of */ /* return values. */ #include <stdint.h> typedef unsigned char fiat_p256_uint1; typedef signed char fiat_p256_int1; /* * Input Bounds: * arg1: [0x0 ~> 0x1] * arg2: [0x0 ~> 0xffffffff] * arg3: [0x0 ~> 0xffffffff] * Output Bounds: * out1: [0x0 ~> 0xffffffff] * out2: [0x0 ~> 0x1] */ static void fiat_p256_addcarryx_u32(uint32_t* out1, fiat_p256_uint1* out2, fiat_p256_uint1 arg1, uint32_t arg2, uint32_t arg3) { uint64_t x1 = ((arg1 + (uint64_t)arg2) + arg3); uint32_t x2 = (uint32_t)(x1 & UINT32_C(0xffffffff)); fiat_p256_uint1 x3 = (fiat_p256_uint1)(x1 >> 32); *out1 = x2; *out2 = x3; } /* * Input Bounds: * arg1: [0x0 ~> 0x1] * arg2: [0x0 ~> 0xffffffff] * arg3: [0x0 ~> 0xffffffff] * Output Bounds: * out1: [0x0 ~> 0xffffffff] * out2: [0x0 ~> 0x1] */ static void fiat_p256_subborrowx_u32(uint32_t* out1, fiat_p256_uint1* out2, fiat_p256_uint1 arg1, uint32_t arg2, uint32_t arg3) { int64_t x1 = ((arg2 - (int64_t)arg1) - arg3); fiat_p256_int1 x2 = (fiat_p256_int1)((uint64_t)x1 >> 32); uint32_t x3 = (uint32_t)(x1 & UINT32_C(0xffffffff)); *out1 = x3; *out2 = (fiat_p256_uint1)(0x0 - x2); } /* * Input Bounds: * arg1: [0x0 ~> 0xffffffff] * arg2: [0x0 ~> 0xffffffff] * Output Bounds: * out1: [0x0 ~> 0xffffffff] * out2: [0x0 ~> 0xffffffff] */ static void fiat_p256_mulx_u32(uint32_t* out1, uint32_t* out2, uint32_t arg1, uint32_t arg2) { uint64_t x1 = ((uint64_t)arg1 * arg2); uint32_t x2 = (uint32_t)(x1 & UINT32_C(0xffffffff)); uint32_t x3 = (uint32_t)(x1 >> 32); *out1 = x2; *out2 = x3; } /* * Input Bounds: * arg1: [0x0 ~> 0x1] * arg2: [0x0 ~> 0xffffffff] * arg3: [0x0 ~> 0xffffffff] * Output Bounds: * out1: [0x0 ~> 0xffffffff] */ static void fiat_p256_cmovznz_u32(uint32_t* out1, fiat_p256_uint1 arg1, uint32_t arg2, uint32_t arg3) { fiat_p256_uint1 x1 = (!(!arg1)); uint32_t x2 = ((fiat_p256_int1)(0x0 - x1) & UINT32_C(0xffffffff)); uint32_t x3 = ((x2 & arg3) | ((~x2) & arg2)); *out1 = x3; } /* * Input Bounds: * arg1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * arg2: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * Output Bounds: * out1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] */ static void fiat_p256_mul(uint32_t out1[8], const uint32_t arg1[8], const uint32_t arg2[8]) { uint32_t x1 = (arg1[1]); uint32_t x2 = (arg1[2]); uint32_t x3 = (arg1[3]); uint32_t x4 = (arg1[4]); uint32_t x5 = (arg1[5]); uint32_t x6 = (arg1[6]); uint32_t x7 = (arg1[7]); uint32_t x8 = (arg1[0]); uint32_t x9; uint32_t x10; fiat_p256_mulx_u32(&x9, &x10, x8, (arg2[7])); uint32_t x11; uint32_t x12; fiat_p256_mulx_u32(&x11, &x12, x8, (arg2[6])); uint32_t x13; uint32_t x14; fiat_p256_mulx_u32(&x13, &x14, x8, (arg2[5])); uint32_t x15; uint32_t x16; fiat_p256_mulx_u32(&x15, &x16, x8, (arg2[4])); uint32_t x17; uint32_t x18; fiat_p256_mulx_u32(&x17, &x18, x8, (arg2[3])); uint32_t x19; uint32_t x20; fiat_p256_mulx_u32(&x19, &x20, x8, (arg2[2])); uint32_t x21; uint32_t x22; fiat_p256_mulx_u32(&x21, &x22, x8, (arg2[1])); uint32_t x23; uint32_t x24; fiat_p256_mulx_u32(&x23, &x24, x8, (arg2[0])); uint32_t x25; fiat_p256_uint1 x26; fiat_p256_addcarryx_u32(&x25, &x26, 0x0, x21, x24); uint32_t x27; fiat_p256_uint1 x28; fiat_p256_addcarryx_u32(&x27, &x28, x26, x19, x22); uint32_t x29; fiat_p256_uint1 x30; fiat_p256_addcarryx_u32(&x29, &x30, x28, x17, x20); uint32_t x31; fiat_p256_uint1 x32; fiat_p256_addcarryx_u32(&x31, &x32, x30, x15, x18); uint32_t x33; fiat_p256_uint1 x34; fiat_p256_addcarryx_u32(&x33, &x34, x32, x13, x16); uint32_t x35; fiat_p256_uint1 x36; fiat_p256_addcarryx_u32(&x35, &x36, x34, x11, x14); uint32_t x37; fiat_p256_uint1 x38; fiat_p256_addcarryx_u32(&x37, &x38, x36, x9, x12); uint32_t x39; fiat_p256_uint1 x40; fiat_p256_addcarryx_u32(&x39, &x40, x38, 0x0, x10); uint32_t x41; uint32_t x42; fiat_p256_mulx_u32(&x41, &x42, x23, UINT32_C(0xffffffff)); uint32_t x43; uint32_t x44; fiat_p256_mulx_u32(&x43, &x44, x23, UINT32_C(0xffffffff)); uint32_t x45; uint32_t x46; fiat_p256_mulx_u32(&x45, &x46, x23, UINT32_C(0xffffffff)); uint32_t x47; uint32_t x48; fiat_p256_mulx_u32(&x47, &x48, x23, UINT32_C(0xffffffff)); uint32_t x49; fiat_p256_uint1 x50; fiat_p256_addcarryx_u32(&x49, &x50, 0x0, x45, x48); uint32_t x51; fiat_p256_uint1 x52; fiat_p256_addcarryx_u32(&x51, &x52, x50, x43, x46); uint32_t x53; fiat_p256_uint1 x54; fiat_p256_addcarryx_u32(&x53, &x54, x52, 0x0, x44); uint32_t x55; fiat_p256_uint1 x56; fiat_p256_addcarryx_u32(&x55, &x56, x54, 0x0, 0x0); uint32_t x57; fiat_p256_uint1 x58; fiat_p256_addcarryx_u32(&x57, &x58, 0x0, x47, x23); uint32_t x59; fiat_p256_uint1 x60; fiat_p256_addcarryx_u32(&x59, &x60, x58, x49, x25); uint32_t x61; fiat_p256_uint1 x62; fiat_p256_addcarryx_u32(&x61, &x62, x60, x51, x27); uint32_t x63; fiat_p256_uint1 x64; fiat_p256_addcarryx_u32(&x63, &x64, x62, x53, x29); uint32_t x65; fiat_p256_uint1 x66; fiat_p256_addcarryx_u32(&x65, &x66, x64, (fiat_p256_uint1)x55, x31); uint32_t x67; fiat_p256_uint1 x68; fiat_p256_addcarryx_u32(&x67, &x68, x66, 0x0, x33); uint32_t x69; fiat_p256_uint1 x70; fiat_p256_addcarryx_u32(&x69, &x70, x68, x23, x35); uint32_t x71; fiat_p256_uint1 x72; fiat_p256_addcarryx_u32(&x71, &x72, x70, x41, x37); uint32_t x73; fiat_p256_uint1 x74; fiat_p256_addcarryx_u32(&x73, &x74, x72, x42, x39); uint32_t x75; fiat_p256_uint1 x76; fiat_p256_addcarryx_u32(&x75, &x76, x74, 0x0, 0x0); uint32_t x77; uint32_t x78; fiat_p256_mulx_u32(&x77, &x78, x1, (arg2[7])); uint32_t x79; uint32_t x80; fiat_p256_mulx_u32(&x79, &x80, x1, (arg2[6])); uint32_t x81; uint32_t x82; fiat_p256_mulx_u32(&x81, &x82, x1, (arg2[5])); uint32_t x83; uint32_t x84; fiat_p256_mulx_u32(&x83, &x84, x1, (arg2[4])); uint32_t x85; uint32_t x86; fiat_p256_mulx_u32(&x85, &x86, x1, (arg2[3])); uint32_t x87; uint32_t x88; fiat_p256_mulx_u32(&x87, &x88, x1, (arg2[2])); uint32_t x89; uint32_t x90; fiat_p256_mulx_u32(&x89, &x90, x1, (arg2[1])); uint32_t x91; uint32_t x92; fiat_p256_mulx_u32(&x91, &x92, x1, (arg2[0])); uint32_t x93; fiat_p256_uint1 x94; fiat_p256_addcarryx_u32(&x93, &x94, 0x0, x89, x92); uint32_t x95; fiat_p256_uint1 x96; fiat_p256_addcarryx_u32(&x95, &x96, x94, x87, x90); uint32_t x97; fiat_p256_uint1 x98; fiat_p256_addcarryx_u32(&x97, &x98, x96, x85, x88); uint32_t x99; fiat_p256_uint1 x100; fiat_p256_addcarryx_u32(&x99, &x100, x98, x83, x86); uint32_t x101; fiat_p256_uint1 x102; fiat_p256_addcarryx_u32(&x101, &x102, x100, x81, x84); uint32_t x103; fiat_p256_uint1 x104; fiat_p256_addcarryx_u32(&x103, &x104, x102, x79, x82); uint32_t x105; fiat_p256_uint1 x106; fiat_p256_addcarryx_u32(&x105, &x106, x104, x77, x80); uint32_t x107; fiat_p256_uint1 x108; fiat_p256_addcarryx_u32(&x107, &x108, x106, 0x0, x78); uint32_t x109; fiat_p256_uint1 x110; fiat_p256_addcarryx_u32(&x109, &x110, 0x0, x91, x59); uint32_t x111; fiat_p256_uint1 x112; fiat_p256_addcarryx_u32(&x111, &x112, x110, x93, x61); uint32_t x113; fiat_p256_uint1 x114; fiat_p256_addcarryx_u32(&x113, &x114, x112, x95, x63); uint32_t x115; fiat_p256_uint1 x116; fiat_p256_addcarryx_u32(&x115, &x116, x114, x97, x65); uint32_t x117; fiat_p256_uint1 x118; fiat_p256_addcarryx_u32(&x117, &x118, x116, x99, x67); uint32_t x119; fiat_p256_uint1 x120; fiat_p256_addcarryx_u32(&x119, &x120, x118, x101, x69); uint32_t x121; fiat_p256_uint1 x122; fiat_p256_addcarryx_u32(&x121, &x122, x120, x103, x71); uint32_t x123; fiat_p256_uint1 x124; fiat_p256_addcarryx_u32(&x123, &x124, x122, x105, x73); uint32_t x125; fiat_p256_uint1 x126; fiat_p256_addcarryx_u32(&x125, &x126, x124, x107, (fiat_p256_uint1)x75); uint32_t x127; uint32_t x128; fiat_p256_mulx_u32(&x127, &x128, x109, UINT32_C(0xffffffff)); uint32_t x129; uint32_t x130; fiat_p256_mulx_u32(&x129, &x130, x109, UINT32_C(0xffffffff)); uint32_t x131; uint32_t x132; fiat_p256_mulx_u32(&x131, &x132, x109, UINT32_C(0xffffffff)); uint32_t x133; uint32_t x134; fiat_p256_mulx_u32(&x133, &x134, x109, UINT32_C(0xffffffff)); uint32_t x135; fiat_p256_uint1 x136; fiat_p256_addcarryx_u32(&x135, &x136, 0x0, x131, x134); uint32_t x137; fiat_p256_uint1 x138; fiat_p256_addcarryx_u32(&x137, &x138, x136, x129, x132); uint32_t x139; fiat_p256_uint1 x140; fiat_p256_addcarryx_u32(&x139, &x140, x138, 0x0, x130); uint32_t x141; fiat_p256_uint1 x142; fiat_p256_addcarryx_u32(&x141, &x142, x140, 0x0, 0x0); uint32_t x143; fiat_p256_uint1 x144; fiat_p256_addcarryx_u32(&x143, &x144, 0x0, x133, x109); uint32_t x145; fiat_p256_uint1 x146; fiat_p256_addcarryx_u32(&x145, &x146, x144, x135, x111); uint32_t x147; fiat_p256_uint1 x148; fiat_p256_addcarryx_u32(&x147, &x148, x146, x137, x113); uint32_t x149; fiat_p256_uint1 x150; fiat_p256_addcarryx_u32(&x149, &x150, x148, x139, x115); uint32_t x151; fiat_p256_uint1 x152; fiat_p256_addcarryx_u32(&x151, &x152, x150, (fiat_p256_uint1)x141, x117); uint32_t x153; fiat_p256_uint1 x154; fiat_p256_addcarryx_u32(&x153, &x154, x152, 0x0, x119); uint32_t x155; fiat_p256_uint1 x156; fiat_p256_addcarryx_u32(&x155, &x156, x154, x109, x121); uint32_t x157; fiat_p256_uint1 x158; fiat_p256_addcarryx_u32(&x157, &x158, x156, x127, x123); uint32_t x159; fiat_p256_uint1 x160; fiat_p256_addcarryx_u32(&x159, &x160, x158, x128, x125); uint32_t x161; fiat_p256_uint1 x162; fiat_p256_addcarryx_u32(&x161, &x162, x160, 0x0, x126); uint32_t x163; uint32_t x164; fiat_p256_mulx_u32(&x163, &x164, x2, (arg2[7])); uint32_t x165; uint32_t x166; fiat_p256_mulx_u32(&x165, &x166, x2, (arg2[6])); uint32_t x167; uint32_t x168; fiat_p256_mulx_u32(&x167, &x168, x2, (arg2[5])); uint32_t x169; uint32_t x170; fiat_p256_mulx_u32(&x169, &x170, x2, (arg2[4])); uint32_t x171; uint32_t x172; fiat_p256_mulx_u32(&x171, &x172, x2, (arg2[3])); uint32_t x173; uint32_t x174; fiat_p256_mulx_u32(&x173, &x174, x2, (arg2[2])); uint32_t x175; uint32_t x176; fiat_p256_mulx_u32(&x175, &x176, x2, (arg2[1])); uint32_t x177; uint32_t x178; fiat_p256_mulx_u32(&x177, &x178, x2, (arg2[0])); uint32_t x179; fiat_p256_uint1 x180; fiat_p256_addcarryx_u32(&x179, &x180, 0x0, x175, x178); uint32_t x181; fiat_p256_uint1 x182; fiat_p256_addcarryx_u32(&x181, &x182, x180, x173, x176); uint32_t x183; fiat_p256_uint1 x184; fiat_p256_addcarryx_u32(&x183, &x184, x182, x171, x174); uint32_t x185; fiat_p256_uint1 x186; fiat_p256_addcarryx_u32(&x185, &x186, x184, x169, x172); uint32_t x187; fiat_p256_uint1 x188; fiat_p256_addcarryx_u32(&x187, &x188, x186, x167, x170); uint32_t x189; fiat_p256_uint1 x190; fiat_p256_addcarryx_u32(&x189, &x190, x188, x165, x168); uint32_t x191; fiat_p256_uint1 x192; fiat_p256_addcarryx_u32(&x191, &x192, x190, x163, x166); uint32_t x193; fiat_p256_uint1 x194; fiat_p256_addcarryx_u32(&x193, &x194, x192, 0x0, x164); uint32_t x195; fiat_p256_uint1 x196; fiat_p256_addcarryx_u32(&x195, &x196, 0x0, x177, x145); uint32_t x197; fiat_p256_uint1 x198; fiat_p256_addcarryx_u32(&x197, &x198, x196, x179, x147); uint32_t x199; fiat_p256_uint1 x200; fiat_p256_addcarryx_u32(&x199, &x200, x198, x181, x149); uint32_t x201; fiat_p256_uint1 x202; fiat_p256_addcarryx_u32(&x201, &x202, x200, x183, x151); uint32_t x203; fiat_p256_uint1 x204; fiat_p256_addcarryx_u32(&x203, &x204, x202, x185, x153); uint32_t x205; fiat_p256_uint1 x206; fiat_p256_addcarryx_u32(&x205, &x206, x204, x187, x155); uint32_t x207; fiat_p256_uint1 x208; fiat_p256_addcarryx_u32(&x207, &x208, x206, x189, x157); uint32_t x209; fiat_p256_uint1 x210; fiat_p256_addcarryx_u32(&x209, &x210, x208, x191, x159); uint32_t x211; fiat_p256_uint1 x212; fiat_p256_addcarryx_u32(&x211, &x212, x210, x193, x161); uint32_t x213; uint32_t x214; fiat_p256_mulx_u32(&x213, &x214, x195, UINT32_C(0xffffffff)); uint32_t x215; uint32_t x216; fiat_p256_mulx_u32(&x215, &x216, x195, UINT32_C(0xffffffff)); uint32_t x217; uint32_t x218; fiat_p256_mulx_u32(&x217, &x218, x195, UINT32_C(0xffffffff)); uint32_t x219; uint32_t x220; fiat_p256_mulx_u32(&x219, &x220, x195, UINT32_C(0xffffffff)); uint32_t x221; fiat_p256_uint1 x222; fiat_p256_addcarryx_u32(&x221, &x222, 0x0, x217, x220); uint32_t x223; fiat_p256_uint1 x224; fiat_p256_addcarryx_u32(&x223, &x224, x222, x215, x218); uint32_t x225; fiat_p256_uint1 x226; fiat_p256_addcarryx_u32(&x225, &x226, x224, 0x0, x216); uint32_t x227; fiat_p256_uint1 x228; fiat_p256_addcarryx_u32(&x227, &x228, x226, 0x0, 0x0); uint32_t x229; fiat_p256_uint1 x230; fiat_p256_addcarryx_u32(&x229, &x230, 0x0, x219, x195); uint32_t x231; fiat_p256_uint1 x232; fiat_p256_addcarryx_u32(&x231, &x232, x230, x221, x197); uint32_t x233; fiat_p256_uint1 x234; fiat_p256_addcarryx_u32(&x233, &x234, x232, x223, x199); uint32_t x235; fiat_p256_uint1 x236; fiat_p256_addcarryx_u32(&x235, &x236, x234, x225, x201); uint32_t x237; fiat_p256_uint1 x238; fiat_p256_addcarryx_u32(&x237, &x238, x236, (fiat_p256_uint1)x227, x203); uint32_t x239; fiat_p256_uint1 x240; fiat_p256_addcarryx_u32(&x239, &x240, x238, 0x0, x205); uint32_t x241; fiat_p256_uint1 x242; fiat_p256_addcarryx_u32(&x241, &x242, x240, x195, x207); uint32_t x243; fiat_p256_uint1 x244; fiat_p256_addcarryx_u32(&x243, &x244, x242, x213, x209); uint32_t x245; fiat_p256_uint1 x246; fiat_p256_addcarryx_u32(&x245, &x246, x244, x214, x211); uint32_t x247; fiat_p256_uint1 x248; fiat_p256_addcarryx_u32(&x247, &x248, x246, 0x0, x212); uint32_t x249; uint32_t x250; fiat_p256_mulx_u32(&x249, &x250, x3, (arg2[7])); uint32_t x251; uint32_t x252; fiat_p256_mulx_u32(&x251, &x252, x3, (arg2[6])); uint32_t x253; uint32_t x254; fiat_p256_mulx_u32(&x253, &x254, x3, (arg2[5])); uint32_t x255; uint32_t x256; fiat_p256_mulx_u32(&x255, &x256, x3, (arg2[4])); uint32_t x257; uint32_t x258; fiat_p256_mulx_u32(&x257, &x258, x3, (arg2[3])); uint32_t x259; uint32_t x260; fiat_p256_mulx_u32(&x259, &x260, x3, (arg2[2])); uint32_t x261; uint32_t x262; fiat_p256_mulx_u32(&x261, &x262, x3, (arg2[1])); uint32_t x263; uint32_t x264; fiat_p256_mulx_u32(&x263, &x264, x3, (arg2[0])); uint32_t x265; fiat_p256_uint1 x266; fiat_p256_addcarryx_u32(&x265, &x266, 0x0, x261, x264); uint32_t x267; fiat_p256_uint1 x268; fiat_p256_addcarryx_u32(&x267, &x268, x266, x259, x262); uint32_t x269; fiat_p256_uint1 x270; fiat_p256_addcarryx_u32(&x269, &x270, x268, x257, x260); uint32_t x271; fiat_p256_uint1 x272; fiat_p256_addcarryx_u32(&x271, &x272, x270, x255, x258); uint32_t x273; fiat_p256_uint1 x274; fiat_p256_addcarryx_u32(&x273, &x274, x272, x253, x256); uint32_t x275; fiat_p256_uint1 x276; fiat_p256_addcarryx_u32(&x275, &x276, x274, x251, x254); uint32_t x277; fiat_p256_uint1 x278; fiat_p256_addcarryx_u32(&x277, &x278, x276, x249, x252); uint32_t x279; fiat_p256_uint1 x280; fiat_p256_addcarryx_u32(&x279, &x280, x278, 0x0, x250); uint32_t x281; fiat_p256_uint1 x282; fiat_p256_addcarryx_u32(&x281, &x282, 0x0, x263, x231); uint32_t x283; fiat_p256_uint1 x284; fiat_p256_addcarryx_u32(&x283, &x284, x282, x265, x233); uint32_t x285; fiat_p256_uint1 x286; fiat_p256_addcarryx_u32(&x285, &x286, x284, x267, x235); uint32_t x287; fiat_p256_uint1 x288; fiat_p256_addcarryx_u32(&x287, &x288, x286, x269, x237); uint32_t x289; fiat_p256_uint1 x290; fiat_p256_addcarryx_u32(&x289, &x290, x288, x271, x239); uint32_t x291; fiat_p256_uint1 x292; fiat_p256_addcarryx_u32(&x291, &x292, x290, x273, x241); uint32_t x293; fiat_p256_uint1 x294; fiat_p256_addcarryx_u32(&x293, &x294, x292, x275, x243); uint32_t x295; fiat_p256_uint1 x296; fiat_p256_addcarryx_u32(&x295, &x296, x294, x277, x245); uint32_t x297; fiat_p256_uint1 x298; fiat_p256_addcarryx_u32(&x297, &x298, x296, x279, x247); uint32_t x299; uint32_t x300; fiat_p256_mulx_u32(&x299, &x300, x281, UINT32_C(0xffffffff)); uint32_t x301; uint32_t x302; fiat_p256_mulx_u32(&x301, &x302, x281, UINT32_C(0xffffffff)); uint32_t x303; uint32_t x304; fiat_p256_mulx_u32(&x303, &x304, x281, UINT32_C(0xffffffff)); uint32_t x305; uint32_t x306; fiat_p256_mulx_u32(&x305, &x306, x281, UINT32_C(0xffffffff)); uint32_t x307; fiat_p256_uint1 x308; fiat_p256_addcarryx_u32(&x307, &x308, 0x0, x303, x306); uint32_t x309; fiat_p256_uint1 x310; fiat_p256_addcarryx_u32(&x309, &x310, x308, x301, x304); uint32_t x311; fiat_p256_uint1 x312; fiat_p256_addcarryx_u32(&x311, &x312, x310, 0x0, x302); uint32_t x313; fiat_p256_uint1 x314; fiat_p256_addcarryx_u32(&x313, &x314, x312, 0x0, 0x0); uint32_t x315; fiat_p256_uint1 x316; fiat_p256_addcarryx_u32(&x315, &x316, 0x0, x305, x281); uint32_t x317; fiat_p256_uint1 x318; fiat_p256_addcarryx_u32(&x317, &x318, x316, x307, x283); uint32_t x319; fiat_p256_uint1 x320; fiat_p256_addcarryx_u32(&x319, &x320, x318, x309, x285); uint32_t x321; fiat_p256_uint1 x322; fiat_p256_addcarryx_u32(&x321, &x322, x320, x311, x287); uint32_t x323; fiat_p256_uint1 x324; fiat_p256_addcarryx_u32(&x323, &x324, x322, (fiat_p256_uint1)x313, x289); uint32_t x325; fiat_p256_uint1 x326; fiat_p256_addcarryx_u32(&x325, &x326, x324, 0x0, x291); uint32_t x327; fiat_p256_uint1 x328; fiat_p256_addcarryx_u32(&x327, &x328, x326, x281, x293); uint32_t x329; fiat_p256_uint1 x330; fiat_p256_addcarryx_u32(&x329, &x330, x328, x299, x295); uint32_t x331; fiat_p256_uint1 x332; fiat_p256_addcarryx_u32(&x331, &x332, x330, x300, x297); uint32_t x333; fiat_p256_uint1 x334; fiat_p256_addcarryx_u32(&x333, &x334, x332, 0x0, x298); uint32_t x335; uint32_t x336; fiat_p256_mulx_u32(&x335, &x336, x4, (arg2[7])); uint32_t x337; uint32_t x338; fiat_p256_mulx_u32(&x337, &x338, x4, (arg2[6])); uint32_t x339; uint32_t x340; fiat_p256_mulx_u32(&x339, &x340, x4, (arg2[5])); uint32_t x341; uint32_t x342; fiat_p256_mulx_u32(&x341, &x342, x4, (arg2[4])); uint32_t x343; uint32_t x344; fiat_p256_mulx_u32(&x343, &x344, x4, (arg2[3])); uint32_t x345; uint32_t x346; fiat_p256_mulx_u32(&x345, &x346, x4, (arg2[2])); uint32_t x347; uint32_t x348; fiat_p256_mulx_u32(&x347, &x348, x4, (arg2[1])); uint32_t x349; uint32_t x350; fiat_p256_mulx_u32(&x349, &x350, x4, (arg2[0])); uint32_t x351; fiat_p256_uint1 x352; fiat_p256_addcarryx_u32(&x351, &x352, 0x0, x347, x350); uint32_t x353; fiat_p256_uint1 x354; fiat_p256_addcarryx_u32(&x353, &x354, x352, x345, x348); uint32_t x355; fiat_p256_uint1 x356; fiat_p256_addcarryx_u32(&x355, &x356, x354, x343, x346); uint32_t x357; fiat_p256_uint1 x358; fiat_p256_addcarryx_u32(&x357, &x358, x356, x341, x344); uint32_t x359; fiat_p256_uint1 x360; fiat_p256_addcarryx_u32(&x359, &x360, x358, x339, x342); uint32_t x361; fiat_p256_uint1 x362; fiat_p256_addcarryx_u32(&x361, &x362, x360, x337, x340); uint32_t x363; fiat_p256_uint1 x364; fiat_p256_addcarryx_u32(&x363, &x364, x362, x335, x338); uint32_t x365; fiat_p256_uint1 x366; fiat_p256_addcarryx_u32(&x365, &x366, x364, 0x0, x336); uint32_t x367; fiat_p256_uint1 x368; fiat_p256_addcarryx_u32(&x367, &x368, 0x0, x349, x317); uint32_t x369; fiat_p256_uint1 x370; fiat_p256_addcarryx_u32(&x369, &x370, x368, x351, x319); uint32_t x371; fiat_p256_uint1 x372; fiat_p256_addcarryx_u32(&x371, &x372, x370, x353, x321); uint32_t x373; fiat_p256_uint1 x374; fiat_p256_addcarryx_u32(&x373, &x374, x372, x355, x323); uint32_t x375; fiat_p256_uint1 x376; fiat_p256_addcarryx_u32(&x375, &x376, x374, x357, x325); uint32_t x377; fiat_p256_uint1 x378; fiat_p256_addcarryx_u32(&x377, &x378, x376, x359, x327); uint32_t x379; fiat_p256_uint1 x380; fiat_p256_addcarryx_u32(&x379, &x380, x378, x361, x329); uint32_t x381; fiat_p256_uint1 x382; fiat_p256_addcarryx_u32(&x381, &x382, x380, x363, x331); uint32_t x383; fiat_p256_uint1 x384; fiat_p256_addcarryx_u32(&x383, &x384, x382, x365, x333); uint32_t x385; uint32_t x386; fiat_p256_mulx_u32(&x385, &x386, x367, UINT32_C(0xffffffff)); uint32_t x387; uint32_t x388; fiat_p256_mulx_u32(&x387, &x388, x367, UINT32_C(0xffffffff)); uint32_t x389; uint32_t x390; fiat_p256_mulx_u32(&x389, &x390, x367, UINT32_C(0xffffffff)); uint32_t x391; uint32_t x392; fiat_p256_mulx_u32(&x391, &x392, x367, UINT32_C(0xffffffff)); uint32_t x393; fiat_p256_uint1 x394; fiat_p256_addcarryx_u32(&x393, &x394, 0x0, x389, x392); uint32_t x395; fiat_p256_uint1 x396; fiat_p256_addcarryx_u32(&x395, &x396, x394, x387, x390); uint32_t x397; fiat_p256_uint1 x398; fiat_p256_addcarryx_u32(&x397, &x398, x396, 0x0, x388); uint32_t x399; fiat_p256_uint1 x400; fiat_p256_addcarryx_u32(&x399, &x400, x398, 0x0, 0x0); uint32_t x401; fiat_p256_uint1 x402; fiat_p256_addcarryx_u32(&x401, &x402, 0x0, x391, x367); uint32_t x403; fiat_p256_uint1 x404; fiat_p256_addcarryx_u32(&x403, &x404, x402, x393, x369); uint32_t x405; fiat_p256_uint1 x406; fiat_p256_addcarryx_u32(&x405, &x406, x404, x395, x371); uint32_t x407; fiat_p256_uint1 x408; fiat_p256_addcarryx_u32(&x407, &x408, x406, x397, x373); uint32_t x409; fiat_p256_uint1 x410; fiat_p256_addcarryx_u32(&x409, &x410, x408, (fiat_p256_uint1)x399, x375); uint32_t x411; fiat_p256_uint1 x412; fiat_p256_addcarryx_u32(&x411, &x412, x410, 0x0, x377); uint32_t x413; fiat_p256_uint1 x414; fiat_p256_addcarryx_u32(&x413, &x414, x412, x367, x379); uint32_t x415; fiat_p256_uint1 x416; fiat_p256_addcarryx_u32(&x415, &x416, x414, x385, x381); uint32_t x417; fiat_p256_uint1 x418; fiat_p256_addcarryx_u32(&x417, &x418, x416, x386, x383); uint32_t x419; fiat_p256_uint1 x420; fiat_p256_addcarryx_u32(&x419, &x420, x418, 0x0, x384); uint32_t x421; uint32_t x422; fiat_p256_mulx_u32(&x421, &x422, x5, (arg2[7])); uint32_t x423; uint32_t x424; fiat_p256_mulx_u32(&x423, &x424, x5, (arg2[6])); uint32_t x425; uint32_t x426; fiat_p256_mulx_u32(&x425, &x426, x5, (arg2[5])); uint32_t x427; uint32_t x428; fiat_p256_mulx_u32(&x427, &x428, x5, (arg2[4])); uint32_t x429; uint32_t x430; fiat_p256_mulx_u32(&x429, &x430, x5, (arg2[3])); uint32_t x431; uint32_t x432; fiat_p256_mulx_u32(&x431, &x432, x5, (arg2[2])); uint32_t x433; uint32_t x434; fiat_p256_mulx_u32(&x433, &x434, x5, (arg2[1])); uint32_t x435; uint32_t x436; fiat_p256_mulx_u32(&x435, &x436, x5, (arg2[0])); uint32_t x437; fiat_p256_uint1 x438; fiat_p256_addcarryx_u32(&x437, &x438, 0x0, x433, x436); uint32_t x439; fiat_p256_uint1 x440; fiat_p256_addcarryx_u32(&x439, &x440, x438, x431, x434); uint32_t x441; fiat_p256_uint1 x442; fiat_p256_addcarryx_u32(&x441, &x442, x440, x429, x432); uint32_t x443; fiat_p256_uint1 x444; fiat_p256_addcarryx_u32(&x443, &x444, x442, x427, x430); uint32_t x445; fiat_p256_uint1 x446; fiat_p256_addcarryx_u32(&x445, &x446, x444, x425, x428); uint32_t x447; fiat_p256_uint1 x448; fiat_p256_addcarryx_u32(&x447, &x448, x446, x423, x426); uint32_t x449; fiat_p256_uint1 x450; fiat_p256_addcarryx_u32(&x449, &x450, x448, x421, x424); uint32_t x451; fiat_p256_uint1 x452; fiat_p256_addcarryx_u32(&x451, &x452, x450, 0x0, x422); uint32_t x453; fiat_p256_uint1 x454; fiat_p256_addcarryx_u32(&x453, &x454, 0x0, x435, x403); uint32_t x455; fiat_p256_uint1 x456; fiat_p256_addcarryx_u32(&x455, &x456, x454, x437, x405); uint32_t x457; fiat_p256_uint1 x458; fiat_p256_addcarryx_u32(&x457, &x458, x456, x439, x407); uint32_t x459; fiat_p256_uint1 x460; fiat_p256_addcarryx_u32(&x459, &x460, x458, x441, x409); uint32_t x461; fiat_p256_uint1 x462; fiat_p256_addcarryx_u32(&x461, &x462, x460, x443, x411); uint32_t x463; fiat_p256_uint1 x464; fiat_p256_addcarryx_u32(&x463, &x464, x462, x445, x413); uint32_t x465; fiat_p256_uint1 x466; fiat_p256_addcarryx_u32(&x465, &x466, x464, x447, x415); uint32_t x467; fiat_p256_uint1 x468; fiat_p256_addcarryx_u32(&x467, &x468, x466, x449, x417); uint32_t x469; fiat_p256_uint1 x470; fiat_p256_addcarryx_u32(&x469, &x470, x468, x451, x419); uint32_t x471; uint32_t x472; fiat_p256_mulx_u32(&x471, &x472, x453, UINT32_C(0xffffffff)); uint32_t x473; uint32_t x474; fiat_p256_mulx_u32(&x473, &x474, x453, UINT32_C(0xffffffff)); uint32_t x475; uint32_t x476; fiat_p256_mulx_u32(&x475, &x476, x453, UINT32_C(0xffffffff)); uint32_t x477; uint32_t x478; fiat_p256_mulx_u32(&x477, &x478, x453, UINT32_C(0xffffffff)); uint32_t x479; fiat_p256_uint1 x480; fiat_p256_addcarryx_u32(&x479, &x480, 0x0, x475, x478); uint32_t x481; fiat_p256_uint1 x482; fiat_p256_addcarryx_u32(&x481, &x482, x480, x473, x476); uint32_t x483; fiat_p256_uint1 x484; fiat_p256_addcarryx_u32(&x483, &x484, x482, 0x0, x474); uint32_t x485; fiat_p256_uint1 x486; fiat_p256_addcarryx_u32(&x485, &x486, x484, 0x0, 0x0); uint32_t x487; fiat_p256_uint1 x488; fiat_p256_addcarryx_u32(&x487, &x488, 0x0, x477, x453); uint32_t x489; fiat_p256_uint1 x490; fiat_p256_addcarryx_u32(&x489, &x490, x488, x479, x455); uint32_t x491; fiat_p256_uint1 x492; fiat_p256_addcarryx_u32(&x491, &x492, x490, x481, x457); uint32_t x493; fiat_p256_uint1 x494; fiat_p256_addcarryx_u32(&x493, &x494, x492, x483, x459); uint32_t x495; fiat_p256_uint1 x496; fiat_p256_addcarryx_u32(&x495, &x496, x494, (fiat_p256_uint1)x485, x461); uint32_t x497; fiat_p256_uint1 x498; fiat_p256_addcarryx_u32(&x497, &x498, x496, 0x0, x463); uint32_t x499; fiat_p256_uint1 x500; fiat_p256_addcarryx_u32(&x499, &x500, x498, x453, x465); uint32_t x501; fiat_p256_uint1 x502; fiat_p256_addcarryx_u32(&x501, &x502, x500, x471, x467); uint32_t x503; fiat_p256_uint1 x504; fiat_p256_addcarryx_u32(&x503, &x504, x502, x472, x469); uint32_t x505; fiat_p256_uint1 x506; fiat_p256_addcarryx_u32(&x505, &x506, x504, 0x0, x470); uint32_t x507; uint32_t x508; fiat_p256_mulx_u32(&x507, &x508, x6, (arg2[7])); uint32_t x509; uint32_t x510; fiat_p256_mulx_u32(&x509, &x510, x6, (arg2[6])); uint32_t x511; uint32_t x512; fiat_p256_mulx_u32(&x511, &x512, x6, (arg2[5])); uint32_t x513; uint32_t x514; fiat_p256_mulx_u32(&x513, &x514, x6, (arg2[4])); uint32_t x515; uint32_t x516; fiat_p256_mulx_u32(&x515, &x516, x6, (arg2[3])); uint32_t x517; uint32_t x518; fiat_p256_mulx_u32(&x517, &x518, x6, (arg2[2])); uint32_t x519; uint32_t x520; fiat_p256_mulx_u32(&x519, &x520, x6, (arg2[1])); uint32_t x521; uint32_t x522; fiat_p256_mulx_u32(&x521, &x522, x6, (arg2[0])); uint32_t x523; fiat_p256_uint1 x524; fiat_p256_addcarryx_u32(&x523, &x524, 0x0, x519, x522); uint32_t x525; fiat_p256_uint1 x526; fiat_p256_addcarryx_u32(&x525, &x526, x524, x517, x520); uint32_t x527; fiat_p256_uint1 x528; fiat_p256_addcarryx_u32(&x527, &x528, x526, x515, x518); uint32_t x529; fiat_p256_uint1 x530; fiat_p256_addcarryx_u32(&x529, &x530, x528, x513, x516); uint32_t x531; fiat_p256_uint1 x532; fiat_p256_addcarryx_u32(&x531, &x532, x530, x511, x514); uint32_t x533; fiat_p256_uint1 x534; fiat_p256_addcarryx_u32(&x533, &x534, x532, x509, x512); uint32_t x535; fiat_p256_uint1 x536; fiat_p256_addcarryx_u32(&x535, &x536, x534, x507, x510); uint32_t x537; fiat_p256_uint1 x538; fiat_p256_addcarryx_u32(&x537, &x538, x536, 0x0, x508); uint32_t x539; fiat_p256_uint1 x540; fiat_p256_addcarryx_u32(&x539, &x540, 0x0, x521, x489); uint32_t x541; fiat_p256_uint1 x542; fiat_p256_addcarryx_u32(&x541, &x542, x540, x523, x491); uint32_t x543; fiat_p256_uint1 x544; fiat_p256_addcarryx_u32(&x543, &x544, x542, x525, x493); uint32_t x545; fiat_p256_uint1 x546; fiat_p256_addcarryx_u32(&x545, &x546, x544, x527, x495); uint32_t x547; fiat_p256_uint1 x548; fiat_p256_addcarryx_u32(&x547, &x548, x546, x529, x497); uint32_t x549; fiat_p256_uint1 x550; fiat_p256_addcarryx_u32(&x549, &x550, x548, x531, x499); uint32_t x551; fiat_p256_uint1 x552; fiat_p256_addcarryx_u32(&x551, &x552, x550, x533, x501); uint32_t x553; fiat_p256_uint1 x554; fiat_p256_addcarryx_u32(&x553, &x554, x552, x535, x503); uint32_t x555; fiat_p256_uint1 x556; fiat_p256_addcarryx_u32(&x555, &x556, x554, x537, x505); uint32_t x557; uint32_t x558; fiat_p256_mulx_u32(&x557, &x558, x539, UINT32_C(0xffffffff)); uint32_t x559; uint32_t x560; fiat_p256_mulx_u32(&x559, &x560, x539, UINT32_C(0xffffffff)); uint32_t x561; uint32_t x562; fiat_p256_mulx_u32(&x561, &x562, x539, UINT32_C(0xffffffff)); uint32_t x563; uint32_t x564; fiat_p256_mulx_u32(&x563, &x564, x539, UINT32_C(0xffffffff)); uint32_t x565; fiat_p256_uint1 x566; fiat_p256_addcarryx_u32(&x565, &x566, 0x0, x561, x564); uint32_t x567; fiat_p256_uint1 x568; fiat_p256_addcarryx_u32(&x567, &x568, x566, x559, x562); uint32_t x569; fiat_p256_uint1 x570; fiat_p256_addcarryx_u32(&x569, &x570, x568, 0x0, x560); uint32_t x571; fiat_p256_uint1 x572; fiat_p256_addcarryx_u32(&x571, &x572, x570, 0x0, 0x0); uint32_t x573; fiat_p256_uint1 x574; fiat_p256_addcarryx_u32(&x573, &x574, 0x0, x563, x539); uint32_t x575; fiat_p256_uint1 x576; fiat_p256_addcarryx_u32(&x575, &x576, x574, x565, x541); uint32_t x577; fiat_p256_uint1 x578; fiat_p256_addcarryx_u32(&x577, &x578, x576, x567, x543); uint32_t x579; fiat_p256_uint1 x580; fiat_p256_addcarryx_u32(&x579, &x580, x578, x569, x545); uint32_t x581; fiat_p256_uint1 x582; fiat_p256_addcarryx_u32(&x581, &x582, x580, (fiat_p256_uint1)x571, x547); uint32_t x583; fiat_p256_uint1 x584; fiat_p256_addcarryx_u32(&x583, &x584, x582, 0x0, x549); uint32_t x585; fiat_p256_uint1 x586; fiat_p256_addcarryx_u32(&x585, &x586, x584, x539, x551); uint32_t x587; fiat_p256_uint1 x588; fiat_p256_addcarryx_u32(&x587, &x588, x586, x557, x553); uint32_t x589; fiat_p256_uint1 x590; fiat_p256_addcarryx_u32(&x589, &x590, x588, x558, x555); uint32_t x591; fiat_p256_uint1 x592; fiat_p256_addcarryx_u32(&x591, &x592, x590, 0x0, x556); uint32_t x593; uint32_t x594; fiat_p256_mulx_u32(&x593, &x594, x7, (arg2[7])); uint32_t x595; uint32_t x596; fiat_p256_mulx_u32(&x595, &x596, x7, (arg2[6])); uint32_t x597; uint32_t x598; fiat_p256_mulx_u32(&x597, &x598, x7, (arg2[5])); uint32_t x599; uint32_t x600; fiat_p256_mulx_u32(&x599, &x600, x7, (arg2[4])); uint32_t x601; uint32_t x602; fiat_p256_mulx_u32(&x601, &x602, x7, (arg2[3])); uint32_t x603; uint32_t x604; fiat_p256_mulx_u32(&x603, &x604, x7, (arg2[2])); uint32_t x605; uint32_t x606; fiat_p256_mulx_u32(&x605, &x606, x7, (arg2[1])); uint32_t x607; uint32_t x608; fiat_p256_mulx_u32(&x607, &x608, x7, (arg2[0])); uint32_t x609; fiat_p256_uint1 x610; fiat_p256_addcarryx_u32(&x609, &x610, 0x0, x605, x608); uint32_t x611; fiat_p256_uint1 x612; fiat_p256_addcarryx_u32(&x611, &x612, x610, x603, x606); uint32_t x613; fiat_p256_uint1 x614; fiat_p256_addcarryx_u32(&x613, &x614, x612, x601, x604); uint32_t x615; fiat_p256_uint1 x616; fiat_p256_addcarryx_u32(&x615, &x616, x614, x599, x602); uint32_t x617; fiat_p256_uint1 x618; fiat_p256_addcarryx_u32(&x617, &x618, x616, x597, x600); uint32_t x619; fiat_p256_uint1 x620; fiat_p256_addcarryx_u32(&x619, &x620, x618, x595, x598); uint32_t x621; fiat_p256_uint1 x622; fiat_p256_addcarryx_u32(&x621, &x622, x620, x593, x596); uint32_t x623; fiat_p256_uint1 x624; fiat_p256_addcarryx_u32(&x623, &x624, x622, 0x0, x594); uint32_t x625; fiat_p256_uint1 x626; fiat_p256_addcarryx_u32(&x625, &x626, 0x0, x607, x575); uint32_t x627; fiat_p256_uint1 x628; fiat_p256_addcarryx_u32(&x627, &x628, x626, x609, x577); uint32_t x629; fiat_p256_uint1 x630; fiat_p256_addcarryx_u32(&x629, &x630, x628, x611, x579); uint32_t x631; fiat_p256_uint1 x632; fiat_p256_addcarryx_u32(&x631, &x632, x630, x613, x581); uint32_t x633; fiat_p256_uint1 x634; fiat_p256_addcarryx_u32(&x633, &x634, x632, x615, x583); uint32_t x635; fiat_p256_uint1 x636; fiat_p256_addcarryx_u32(&x635, &x636, x634, x617, x585); uint32_t x637; fiat_p256_uint1 x638; fiat_p256_addcarryx_u32(&x637, &x638, x636, x619, x587); uint32_t x639; fiat_p256_uint1 x640; fiat_p256_addcarryx_u32(&x639, &x640, x638, x621, x589); uint32_t x641; fiat_p256_uint1 x642; fiat_p256_addcarryx_u32(&x641, &x642, x640, x623, x591); uint32_t x643; uint32_t x644; fiat_p256_mulx_u32(&x643, &x644, x625, UINT32_C(0xffffffff)); uint32_t x645; uint32_t x646; fiat_p256_mulx_u32(&x645, &x646, x625, UINT32_C(0xffffffff)); uint32_t x647; uint32_t x648; fiat_p256_mulx_u32(&x647, &x648, x625, UINT32_C(0xffffffff)); uint32_t x649; uint32_t x650; fiat_p256_mulx_u32(&x649, &x650, x625, UINT32_C(0xffffffff)); uint32_t x651; fiat_p256_uint1 x652; fiat_p256_addcarryx_u32(&x651, &x652, 0x0, x647, x650); uint32_t x653; fiat_p256_uint1 x654; fiat_p256_addcarryx_u32(&x653, &x654, x652, x645, x648); uint32_t x655; fiat_p256_uint1 x656; fiat_p256_addcarryx_u32(&x655, &x656, x654, 0x0, x646); uint32_t x657; fiat_p256_uint1 x658; fiat_p256_addcarryx_u32(&x657, &x658, x656, 0x0, 0x0); uint32_t x659; fiat_p256_uint1 x660; fiat_p256_addcarryx_u32(&x659, &x660, 0x0, x649, x625); uint32_t x661; fiat_p256_uint1 x662; fiat_p256_addcarryx_u32(&x661, &x662, x660, x651, x627); uint32_t x663; fiat_p256_uint1 x664; fiat_p256_addcarryx_u32(&x663, &x664, x662, x653, x629); uint32_t x665; fiat_p256_uint1 x666; fiat_p256_addcarryx_u32(&x665, &x666, x664, x655, x631); uint32_t x667; fiat_p256_uint1 x668; fiat_p256_addcarryx_u32(&x667, &x668, x666, (fiat_p256_uint1)x657, x633); uint32_t x669; fiat_p256_uint1 x670; fiat_p256_addcarryx_u32(&x669, &x670, x668, 0x0, x635); uint32_t x671; fiat_p256_uint1 x672; fiat_p256_addcarryx_u32(&x671, &x672, x670, x625, x637); uint32_t x673; fiat_p256_uint1 x674; fiat_p256_addcarryx_u32(&x673, &x674, x672, x643, x639); uint32_t x675; fiat_p256_uint1 x676; fiat_p256_addcarryx_u32(&x675, &x676, x674, x644, x641); uint32_t x677; fiat_p256_uint1 x678; fiat_p256_addcarryx_u32(&x677, &x678, x676, 0x0, x642); uint32_t x679; fiat_p256_uint1 x680; fiat_p256_subborrowx_u32(&x679, &x680, 0x0, x661, UINT32_C(0xffffffff)); uint32_t x681; fiat_p256_uint1 x682; fiat_p256_subborrowx_u32(&x681, &x682, x680, x663, UINT32_C(0xffffffff)); uint32_t x683; fiat_p256_uint1 x684; fiat_p256_subborrowx_u32(&x683, &x684, x682, x665, UINT32_C(0xffffffff)); uint32_t x685; fiat_p256_uint1 x686; fiat_p256_subborrowx_u32(&x685, &x686, x684, x667, 0x0); uint32_t x687; fiat_p256_uint1 x688; fiat_p256_subborrowx_u32(&x687, &x688, x686, x669, 0x0); uint32_t x689; fiat_p256_uint1 x690; fiat_p256_subborrowx_u32(&x689, &x690, x688, x671, 0x0); uint32_t x691; fiat_p256_uint1 x692; fiat_p256_subborrowx_u32(&x691, &x692, x690, x673, 0x1); uint32_t x693; fiat_p256_uint1 x694; fiat_p256_subborrowx_u32(&x693, &x694, x692, x675, UINT32_C(0xffffffff)); uint32_t x695; fiat_p256_uint1 x696; fiat_p256_subborrowx_u32(&x695, &x696, x694, x677, 0x0); uint32_t x697; fiat_p256_cmovznz_u32(&x697, x696, x679, x661); uint32_t x698; fiat_p256_cmovznz_u32(&x698, x696, x681, x663); uint32_t x699; fiat_p256_cmovznz_u32(&x699, x696, x683, x665); uint32_t x700; fiat_p256_cmovznz_u32(&x700, x696, x685, x667); uint32_t x701; fiat_p256_cmovznz_u32(&x701, x696, x687, x669); uint32_t x702; fiat_p256_cmovznz_u32(&x702, x696, x689, x671); uint32_t x703; fiat_p256_cmovznz_u32(&x703, x696, x691, x673); uint32_t x704; fiat_p256_cmovznz_u32(&x704, x696, x693, x675); out1[0] = x697; out1[1] = x698; out1[2] = x699; out1[3] = x700; out1[4] = x701; out1[5] = x702; out1[6] = x703; out1[7] = x704; } /* * Input Bounds: * arg1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * Output Bounds: * out1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] */ static void fiat_p256_square(uint32_t out1[8], const uint32_t arg1[8]) { uint32_t x1 = (arg1[1]); uint32_t x2 = (arg1[2]); uint32_t x3 = (arg1[3]); uint32_t x4 = (arg1[4]); uint32_t x5 = (arg1[5]); uint32_t x6 = (arg1[6]); uint32_t x7 = (arg1[7]); uint32_t x8 = (arg1[0]); uint32_t x9; uint32_t x10; fiat_p256_mulx_u32(&x9, &x10, x8, (arg1[7])); uint32_t x11; uint32_t x12; fiat_p256_mulx_u32(&x11, &x12, x8, (arg1[6])); uint32_t x13; uint32_t x14; fiat_p256_mulx_u32(&x13, &x14, x8, (arg1[5])); uint32_t x15; uint32_t x16; fiat_p256_mulx_u32(&x15, &x16, x8, (arg1[4])); uint32_t x17; uint32_t x18; fiat_p256_mulx_u32(&x17, &x18, x8, (arg1[3])); uint32_t x19; uint32_t x20; fiat_p256_mulx_u32(&x19, &x20, x8, (arg1[2])); uint32_t x21; uint32_t x22; fiat_p256_mulx_u32(&x21, &x22, x8, (arg1[1])); uint32_t x23; uint32_t x24; fiat_p256_mulx_u32(&x23, &x24, x8, (arg1[0])); uint32_t x25; fiat_p256_uint1 x26; fiat_p256_addcarryx_u32(&x25, &x26, 0x0, x21, x24); uint32_t x27; fiat_p256_uint1 x28; fiat_p256_addcarryx_u32(&x27, &x28, x26, x19, x22); uint32_t x29; fiat_p256_uint1 x30; fiat_p256_addcarryx_u32(&x29, &x30, x28, x17, x20); uint32_t x31; fiat_p256_uint1 x32; fiat_p256_addcarryx_u32(&x31, &x32, x30, x15, x18); uint32_t x33; fiat_p256_uint1 x34; fiat_p256_addcarryx_u32(&x33, &x34, x32, x13, x16); uint32_t x35; fiat_p256_uint1 x36; fiat_p256_addcarryx_u32(&x35, &x36, x34, x11, x14); uint32_t x37; fiat_p256_uint1 x38; fiat_p256_addcarryx_u32(&x37, &x38, x36, x9, x12); uint32_t x39; fiat_p256_uint1 x40; fiat_p256_addcarryx_u32(&x39, &x40, x38, 0x0, x10); uint32_t x41; uint32_t x42; fiat_p256_mulx_u32(&x41, &x42, x23, UINT32_C(0xffffffff)); uint32_t x43; uint32_t x44; fiat_p256_mulx_u32(&x43, &x44, x23, UINT32_C(0xffffffff)); uint32_t x45; uint32_t x46; fiat_p256_mulx_u32(&x45, &x46, x23, UINT32_C(0xffffffff)); uint32_t x47; uint32_t x48; fiat_p256_mulx_u32(&x47, &x48, x23, UINT32_C(0xffffffff)); uint32_t x49; fiat_p256_uint1 x50; fiat_p256_addcarryx_u32(&x49, &x50, 0x0, x45, x48); uint32_t x51; fiat_p256_uint1 x52; fiat_p256_addcarryx_u32(&x51, &x52, x50, x43, x46); uint32_t x53; fiat_p256_uint1 x54; fiat_p256_addcarryx_u32(&x53, &x54, x52, 0x0, x44); uint32_t x55; fiat_p256_uint1 x56; fiat_p256_addcarryx_u32(&x55, &x56, x54, 0x0, 0x0); uint32_t x57; fiat_p256_uint1 x58; fiat_p256_addcarryx_u32(&x57, &x58, 0x0, x47, x23); uint32_t x59; fiat_p256_uint1 x60; fiat_p256_addcarryx_u32(&x59, &x60, x58, x49, x25); uint32_t x61; fiat_p256_uint1 x62; fiat_p256_addcarryx_u32(&x61, &x62, x60, x51, x27); uint32_t x63; fiat_p256_uint1 x64; fiat_p256_addcarryx_u32(&x63, &x64, x62, x53, x29); uint32_t x65; fiat_p256_uint1 x66; fiat_p256_addcarryx_u32(&x65, &x66, x64, (fiat_p256_uint1)x55, x31); uint32_t x67; fiat_p256_uint1 x68; fiat_p256_addcarryx_u32(&x67, &x68, x66, 0x0, x33); uint32_t x69; fiat_p256_uint1 x70; fiat_p256_addcarryx_u32(&x69, &x70, x68, x23, x35); uint32_t x71; fiat_p256_uint1 x72; fiat_p256_addcarryx_u32(&x71, &x72, x70, x41, x37); uint32_t x73; fiat_p256_uint1 x74; fiat_p256_addcarryx_u32(&x73, &x74, x72, x42, x39); uint32_t x75; fiat_p256_uint1 x76; fiat_p256_addcarryx_u32(&x75, &x76, x74, 0x0, 0x0); uint32_t x77; uint32_t x78; fiat_p256_mulx_u32(&x77, &x78, x1, (arg1[7])); uint32_t x79; uint32_t x80; fiat_p256_mulx_u32(&x79, &x80, x1, (arg1[6])); uint32_t x81; uint32_t x82; fiat_p256_mulx_u32(&x81, &x82, x1, (arg1[5])); uint32_t x83; uint32_t x84; fiat_p256_mulx_u32(&x83, &x84, x1, (arg1[4])); uint32_t x85; uint32_t x86; fiat_p256_mulx_u32(&x85, &x86, x1, (arg1[3])); uint32_t x87; uint32_t x88; fiat_p256_mulx_u32(&x87, &x88, x1, (arg1[2])); uint32_t x89; uint32_t x90; fiat_p256_mulx_u32(&x89, &x90, x1, (arg1[1])); uint32_t x91; uint32_t x92; fiat_p256_mulx_u32(&x91, &x92, x1, (arg1[0])); uint32_t x93; fiat_p256_uint1 x94; fiat_p256_addcarryx_u32(&x93, &x94, 0x0, x89, x92); uint32_t x95; fiat_p256_uint1 x96; fiat_p256_addcarryx_u32(&x95, &x96, x94, x87, x90); uint32_t x97; fiat_p256_uint1 x98; fiat_p256_addcarryx_u32(&x97, &x98, x96, x85, x88); uint32_t x99; fiat_p256_uint1 x100; fiat_p256_addcarryx_u32(&x99, &x100, x98, x83, x86); uint32_t x101; fiat_p256_uint1 x102; fiat_p256_addcarryx_u32(&x101, &x102, x100, x81, x84); uint32_t x103; fiat_p256_uint1 x104; fiat_p256_addcarryx_u32(&x103, &x104, x102, x79, x82); uint32_t x105; fiat_p256_uint1 x106; fiat_p256_addcarryx_u32(&x105, &x106, x104, x77, x80); uint32_t x107; fiat_p256_uint1 x108; fiat_p256_addcarryx_u32(&x107, &x108, x106, 0x0, x78); uint32_t x109; fiat_p256_uint1 x110; fiat_p256_addcarryx_u32(&x109, &x110, 0x0, x91, x59); uint32_t x111; fiat_p256_uint1 x112; fiat_p256_addcarryx_u32(&x111, &x112, x110, x93, x61); uint32_t x113; fiat_p256_uint1 x114; fiat_p256_addcarryx_u32(&x113, &x114, x112, x95, x63); uint32_t x115; fiat_p256_uint1 x116; fiat_p256_addcarryx_u32(&x115, &x116, x114, x97, x65); uint32_t x117; fiat_p256_uint1 x118; fiat_p256_addcarryx_u32(&x117, &x118, x116, x99, x67); uint32_t x119; fiat_p256_uint1 x120; fiat_p256_addcarryx_u32(&x119, &x120, x118, x101, x69); uint32_t x121; fiat_p256_uint1 x122; fiat_p256_addcarryx_u32(&x121, &x122, x120, x103, x71); uint32_t x123; fiat_p256_uint1 x124; fiat_p256_addcarryx_u32(&x123, &x124, x122, x105, x73); uint32_t x125; fiat_p256_uint1 x126; fiat_p256_addcarryx_u32(&x125, &x126, x124, x107, (fiat_p256_uint1)x75); uint32_t x127; uint32_t x128; fiat_p256_mulx_u32(&x127, &x128, x109, UINT32_C(0xffffffff)); uint32_t x129; uint32_t x130; fiat_p256_mulx_u32(&x129, &x130, x109, UINT32_C(0xffffffff)); uint32_t x131; uint32_t x132; fiat_p256_mulx_u32(&x131, &x132, x109, UINT32_C(0xffffffff)); uint32_t x133; uint32_t x134; fiat_p256_mulx_u32(&x133, &x134, x109, UINT32_C(0xffffffff)); uint32_t x135; fiat_p256_uint1 x136; fiat_p256_addcarryx_u32(&x135, &x136, 0x0, x131, x134); uint32_t x137; fiat_p256_uint1 x138; fiat_p256_addcarryx_u32(&x137, &x138, x136, x129, x132); uint32_t x139; fiat_p256_uint1 x140; fiat_p256_addcarryx_u32(&x139, &x140, x138, 0x0, x130); uint32_t x141; fiat_p256_uint1 x142; fiat_p256_addcarryx_u32(&x141, &x142, x140, 0x0, 0x0); uint32_t x143; fiat_p256_uint1 x144; fiat_p256_addcarryx_u32(&x143, &x144, 0x0, x133, x109); uint32_t x145; fiat_p256_uint1 x146; fiat_p256_addcarryx_u32(&x145, &x146, x144, x135, x111); uint32_t x147; fiat_p256_uint1 x148; fiat_p256_addcarryx_u32(&x147, &x148, x146, x137, x113); uint32_t x149; fiat_p256_uint1 x150; fiat_p256_addcarryx_u32(&x149, &x150, x148, x139, x115); uint32_t x151; fiat_p256_uint1 x152; fiat_p256_addcarryx_u32(&x151, &x152, x150, (fiat_p256_uint1)x141, x117); uint32_t x153; fiat_p256_uint1 x154; fiat_p256_addcarryx_u32(&x153, &x154, x152, 0x0, x119); uint32_t x155; fiat_p256_uint1 x156; fiat_p256_addcarryx_u32(&x155, &x156, x154, x109, x121); uint32_t x157; fiat_p256_uint1 x158; fiat_p256_addcarryx_u32(&x157, &x158, x156, x127, x123); uint32_t x159; fiat_p256_uint1 x160; fiat_p256_addcarryx_u32(&x159, &x160, x158, x128, x125); uint32_t x161; fiat_p256_uint1 x162; fiat_p256_addcarryx_u32(&x161, &x162, x160, 0x0, x126); uint32_t x163; uint32_t x164; fiat_p256_mulx_u32(&x163, &x164, x2, (arg1[7])); uint32_t x165; uint32_t x166; fiat_p256_mulx_u32(&x165, &x166, x2, (arg1[6])); uint32_t x167; uint32_t x168; fiat_p256_mulx_u32(&x167, &x168, x2, (arg1[5])); uint32_t x169; uint32_t x170; fiat_p256_mulx_u32(&x169, &x170, x2, (arg1[4])); uint32_t x171; uint32_t x172; fiat_p256_mulx_u32(&x171, &x172, x2, (arg1[3])); uint32_t x173; uint32_t x174; fiat_p256_mulx_u32(&x173, &x174, x2, (arg1[2])); uint32_t x175; uint32_t x176; fiat_p256_mulx_u32(&x175, &x176, x2, (arg1[1])); uint32_t x177; uint32_t x178; fiat_p256_mulx_u32(&x177, &x178, x2, (arg1[0])); uint32_t x179; fiat_p256_uint1 x180; fiat_p256_addcarryx_u32(&x179, &x180, 0x0, x175, x178); uint32_t x181; fiat_p256_uint1 x182; fiat_p256_addcarryx_u32(&x181, &x182, x180, x173, x176); uint32_t x183; fiat_p256_uint1 x184; fiat_p256_addcarryx_u32(&x183, &x184, x182, x171, x174); uint32_t x185; fiat_p256_uint1 x186; fiat_p256_addcarryx_u32(&x185, &x186, x184, x169, x172); uint32_t x187; fiat_p256_uint1 x188; fiat_p256_addcarryx_u32(&x187, &x188, x186, x167, x170); uint32_t x189; fiat_p256_uint1 x190; fiat_p256_addcarryx_u32(&x189, &x190, x188, x165, x168); uint32_t x191; fiat_p256_uint1 x192; fiat_p256_addcarryx_u32(&x191, &x192, x190, x163, x166); uint32_t x193; fiat_p256_uint1 x194; fiat_p256_addcarryx_u32(&x193, &x194, x192, 0x0, x164); uint32_t x195; fiat_p256_uint1 x196; fiat_p256_addcarryx_u32(&x195, &x196, 0x0, x177, x145); uint32_t x197; fiat_p256_uint1 x198; fiat_p256_addcarryx_u32(&x197, &x198, x196, x179, x147); uint32_t x199; fiat_p256_uint1 x200; fiat_p256_addcarryx_u32(&x199, &x200, x198, x181, x149); uint32_t x201; fiat_p256_uint1 x202; fiat_p256_addcarryx_u32(&x201, &x202, x200, x183, x151); uint32_t x203; fiat_p256_uint1 x204; fiat_p256_addcarryx_u32(&x203, &x204, x202, x185, x153); uint32_t x205; fiat_p256_uint1 x206; fiat_p256_addcarryx_u32(&x205, &x206, x204, x187, x155); uint32_t x207; fiat_p256_uint1 x208; fiat_p256_addcarryx_u32(&x207, &x208, x206, x189, x157); uint32_t x209; fiat_p256_uint1 x210; fiat_p256_addcarryx_u32(&x209, &x210, x208, x191, x159); uint32_t x211; fiat_p256_uint1 x212; fiat_p256_addcarryx_u32(&x211, &x212, x210, x193, x161); uint32_t x213; uint32_t x214; fiat_p256_mulx_u32(&x213, &x214, x195, UINT32_C(0xffffffff)); uint32_t x215; uint32_t x216; fiat_p256_mulx_u32(&x215, &x216, x195, UINT32_C(0xffffffff)); uint32_t x217; uint32_t x218; fiat_p256_mulx_u32(&x217, &x218, x195, UINT32_C(0xffffffff)); uint32_t x219; uint32_t x220; fiat_p256_mulx_u32(&x219, &x220, x195, UINT32_C(0xffffffff)); uint32_t x221; fiat_p256_uint1 x222; fiat_p256_addcarryx_u32(&x221, &x222, 0x0, x217, x220); uint32_t x223; fiat_p256_uint1 x224; fiat_p256_addcarryx_u32(&x223, &x224, x222, x215, x218); uint32_t x225; fiat_p256_uint1 x226; fiat_p256_addcarryx_u32(&x225, &x226, x224, 0x0, x216); uint32_t x227; fiat_p256_uint1 x228; fiat_p256_addcarryx_u32(&x227, &x228, x226, 0x0, 0x0); uint32_t x229; fiat_p256_uint1 x230; fiat_p256_addcarryx_u32(&x229, &x230, 0x0, x219, x195); uint32_t x231; fiat_p256_uint1 x232; fiat_p256_addcarryx_u32(&x231, &x232, x230, x221, x197); uint32_t x233; fiat_p256_uint1 x234; fiat_p256_addcarryx_u32(&x233, &x234, x232, x223, x199); uint32_t x235; fiat_p256_uint1 x236; fiat_p256_addcarryx_u32(&x235, &x236, x234, x225, x201); uint32_t x237; fiat_p256_uint1 x238; fiat_p256_addcarryx_u32(&x237, &x238, x236, (fiat_p256_uint1)x227, x203); uint32_t x239; fiat_p256_uint1 x240; fiat_p256_addcarryx_u32(&x239, &x240, x238, 0x0, x205); uint32_t x241; fiat_p256_uint1 x242; fiat_p256_addcarryx_u32(&x241, &x242, x240, x195, x207); uint32_t x243; fiat_p256_uint1 x244; fiat_p256_addcarryx_u32(&x243, &x244, x242, x213, x209); uint32_t x245; fiat_p256_uint1 x246; fiat_p256_addcarryx_u32(&x245, &x246, x244, x214, x211); uint32_t x247; fiat_p256_uint1 x248; fiat_p256_addcarryx_u32(&x247, &x248, x246, 0x0, x212); uint32_t x249; uint32_t x250; fiat_p256_mulx_u32(&x249, &x250, x3, (arg1[7])); uint32_t x251; uint32_t x252; fiat_p256_mulx_u32(&x251, &x252, x3, (arg1[6])); uint32_t x253; uint32_t x254; fiat_p256_mulx_u32(&x253, &x254, x3, (arg1[5])); uint32_t x255; uint32_t x256; fiat_p256_mulx_u32(&x255, &x256, x3, (arg1[4])); uint32_t x257; uint32_t x258; fiat_p256_mulx_u32(&x257, &x258, x3, (arg1[3])); uint32_t x259; uint32_t x260; fiat_p256_mulx_u32(&x259, &x260, x3, (arg1[2])); uint32_t x261; uint32_t x262; fiat_p256_mulx_u32(&x261, &x262, x3, (arg1[1])); uint32_t x263; uint32_t x264; fiat_p256_mulx_u32(&x263, &x264, x3, (arg1[0])); uint32_t x265; fiat_p256_uint1 x266; fiat_p256_addcarryx_u32(&x265, &x266, 0x0, x261, x264); uint32_t x267; fiat_p256_uint1 x268; fiat_p256_addcarryx_u32(&x267, &x268, x266, x259, x262); uint32_t x269; fiat_p256_uint1 x270; fiat_p256_addcarryx_u32(&x269, &x270, x268, x257, x260); uint32_t x271; fiat_p256_uint1 x272; fiat_p256_addcarryx_u32(&x271, &x272, x270, x255, x258); uint32_t x273; fiat_p256_uint1 x274; fiat_p256_addcarryx_u32(&x273, &x274, x272, x253, x256); uint32_t x275; fiat_p256_uint1 x276; fiat_p256_addcarryx_u32(&x275, &x276, x274, x251, x254); uint32_t x277; fiat_p256_uint1 x278; fiat_p256_addcarryx_u32(&x277, &x278, x276, x249, x252); uint32_t x279; fiat_p256_uint1 x280; fiat_p256_addcarryx_u32(&x279, &x280, x278, 0x0, x250); uint32_t x281; fiat_p256_uint1 x282; fiat_p256_addcarryx_u32(&x281, &x282, 0x0, x263, x231); uint32_t x283; fiat_p256_uint1 x284; fiat_p256_addcarryx_u32(&x283, &x284, x282, x265, x233); uint32_t x285; fiat_p256_uint1 x286; fiat_p256_addcarryx_u32(&x285, &x286, x284, x267, x235); uint32_t x287; fiat_p256_uint1 x288; fiat_p256_addcarryx_u32(&x287, &x288, x286, x269, x237); uint32_t x289; fiat_p256_uint1 x290; fiat_p256_addcarryx_u32(&x289, &x290, x288, x271, x239); uint32_t x291; fiat_p256_uint1 x292; fiat_p256_addcarryx_u32(&x291, &x292, x290, x273, x241); uint32_t x293; fiat_p256_uint1 x294; fiat_p256_addcarryx_u32(&x293, &x294, x292, x275, x243); uint32_t x295; fiat_p256_uint1 x296; fiat_p256_addcarryx_u32(&x295, &x296, x294, x277, x245); uint32_t x297; fiat_p256_uint1 x298; fiat_p256_addcarryx_u32(&x297, &x298, x296, x279, x247); uint32_t x299; uint32_t x300; fiat_p256_mulx_u32(&x299, &x300, x281, UINT32_C(0xffffffff)); uint32_t x301; uint32_t x302; fiat_p256_mulx_u32(&x301, &x302, x281, UINT32_C(0xffffffff)); uint32_t x303; uint32_t x304; fiat_p256_mulx_u32(&x303, &x304, x281, UINT32_C(0xffffffff)); uint32_t x305; uint32_t x306; fiat_p256_mulx_u32(&x305, &x306, x281, UINT32_C(0xffffffff)); uint32_t x307; fiat_p256_uint1 x308; fiat_p256_addcarryx_u32(&x307, &x308, 0x0, x303, x306); uint32_t x309; fiat_p256_uint1 x310; fiat_p256_addcarryx_u32(&x309, &x310, x308, x301, x304); uint32_t x311; fiat_p256_uint1 x312; fiat_p256_addcarryx_u32(&x311, &x312, x310, 0x0, x302); uint32_t x313; fiat_p256_uint1 x314; fiat_p256_addcarryx_u32(&x313, &x314, x312, 0x0, 0x0); uint32_t x315; fiat_p256_uint1 x316; fiat_p256_addcarryx_u32(&x315, &x316, 0x0, x305, x281); uint32_t x317; fiat_p256_uint1 x318; fiat_p256_addcarryx_u32(&x317, &x318, x316, x307, x283); uint32_t x319; fiat_p256_uint1 x320; fiat_p256_addcarryx_u32(&x319, &x320, x318, x309, x285); uint32_t x321; fiat_p256_uint1 x322; fiat_p256_addcarryx_u32(&x321, &x322, x320, x311, x287); uint32_t x323; fiat_p256_uint1 x324; fiat_p256_addcarryx_u32(&x323, &x324, x322, (fiat_p256_uint1)x313, x289); uint32_t x325; fiat_p256_uint1 x326; fiat_p256_addcarryx_u32(&x325, &x326, x324, 0x0, x291); uint32_t x327; fiat_p256_uint1 x328; fiat_p256_addcarryx_u32(&x327, &x328, x326, x281, x293); uint32_t x329; fiat_p256_uint1 x330; fiat_p256_addcarryx_u32(&x329, &x330, x328, x299, x295); uint32_t x331; fiat_p256_uint1 x332; fiat_p256_addcarryx_u32(&x331, &x332, x330, x300, x297); uint32_t x333; fiat_p256_uint1 x334; fiat_p256_addcarryx_u32(&x333, &x334, x332, 0x0, x298); uint32_t x335; uint32_t x336; fiat_p256_mulx_u32(&x335, &x336, x4, (arg1[7])); uint32_t x337; uint32_t x338; fiat_p256_mulx_u32(&x337, &x338, x4, (arg1[6])); uint32_t x339; uint32_t x340; fiat_p256_mulx_u32(&x339, &x340, x4, (arg1[5])); uint32_t x341; uint32_t x342; fiat_p256_mulx_u32(&x341, &x342, x4, (arg1[4])); uint32_t x343; uint32_t x344; fiat_p256_mulx_u32(&x343, &x344, x4, (arg1[3])); uint32_t x345; uint32_t x346; fiat_p256_mulx_u32(&x345, &x346, x4, (arg1[2])); uint32_t x347; uint32_t x348; fiat_p256_mulx_u32(&x347, &x348, x4, (arg1[1])); uint32_t x349; uint32_t x350; fiat_p256_mulx_u32(&x349, &x350, x4, (arg1[0])); uint32_t x351; fiat_p256_uint1 x352; fiat_p256_addcarryx_u32(&x351, &x352, 0x0, x347, x350); uint32_t x353; fiat_p256_uint1 x354; fiat_p256_addcarryx_u32(&x353, &x354, x352, x345, x348); uint32_t x355; fiat_p256_uint1 x356; fiat_p256_addcarryx_u32(&x355, &x356, x354, x343, x346); uint32_t x357; fiat_p256_uint1 x358; fiat_p256_addcarryx_u32(&x357, &x358, x356, x341, x344); uint32_t x359; fiat_p256_uint1 x360; fiat_p256_addcarryx_u32(&x359, &x360, x358, x339, x342); uint32_t x361; fiat_p256_uint1 x362; fiat_p256_addcarryx_u32(&x361, &x362, x360, x337, x340); uint32_t x363; fiat_p256_uint1 x364; fiat_p256_addcarryx_u32(&x363, &x364, x362, x335, x338); uint32_t x365; fiat_p256_uint1 x366; fiat_p256_addcarryx_u32(&x365, &x366, x364, 0x0, x336); uint32_t x367; fiat_p256_uint1 x368; fiat_p256_addcarryx_u32(&x367, &x368, 0x0, x349, x317); uint32_t x369; fiat_p256_uint1 x370; fiat_p256_addcarryx_u32(&x369, &x370, x368, x351, x319); uint32_t x371; fiat_p256_uint1 x372; fiat_p256_addcarryx_u32(&x371, &x372, x370, x353, x321); uint32_t x373; fiat_p256_uint1 x374; fiat_p256_addcarryx_u32(&x373, &x374, x372, x355, x323); uint32_t x375; fiat_p256_uint1 x376; fiat_p256_addcarryx_u32(&x375, &x376, x374, x357, x325); uint32_t x377; fiat_p256_uint1 x378; fiat_p256_addcarryx_u32(&x377, &x378, x376, x359, x327); uint32_t x379; fiat_p256_uint1 x380; fiat_p256_addcarryx_u32(&x379, &x380, x378, x361, x329); uint32_t x381; fiat_p256_uint1 x382; fiat_p256_addcarryx_u32(&x381, &x382, x380, x363, x331); uint32_t x383; fiat_p256_uint1 x384; fiat_p256_addcarryx_u32(&x383, &x384, x382, x365, x333); uint32_t x385; uint32_t x386; fiat_p256_mulx_u32(&x385, &x386, x367, UINT32_C(0xffffffff)); uint32_t x387; uint32_t x388; fiat_p256_mulx_u32(&x387, &x388, x367, UINT32_C(0xffffffff)); uint32_t x389; uint32_t x390; fiat_p256_mulx_u32(&x389, &x390, x367, UINT32_C(0xffffffff)); uint32_t x391; uint32_t x392; fiat_p256_mulx_u32(&x391, &x392, x367, UINT32_C(0xffffffff)); uint32_t x393; fiat_p256_uint1 x394; fiat_p256_addcarryx_u32(&x393, &x394, 0x0, x389, x392); uint32_t x395; fiat_p256_uint1 x396; fiat_p256_addcarryx_u32(&x395, &x396, x394, x387, x390); uint32_t x397; fiat_p256_uint1 x398; fiat_p256_addcarryx_u32(&x397, &x398, x396, 0x0, x388); uint32_t x399; fiat_p256_uint1 x400; fiat_p256_addcarryx_u32(&x399, &x400, x398, 0x0, 0x0); uint32_t x401; fiat_p256_uint1 x402; fiat_p256_addcarryx_u32(&x401, &x402, 0x0, x391, x367); uint32_t x403; fiat_p256_uint1 x404; fiat_p256_addcarryx_u32(&x403, &x404, x402, x393, x369); uint32_t x405; fiat_p256_uint1 x406; fiat_p256_addcarryx_u32(&x405, &x406, x404, x395, x371); uint32_t x407; fiat_p256_uint1 x408; fiat_p256_addcarryx_u32(&x407, &x408, x406, x397, x373); uint32_t x409; fiat_p256_uint1 x410; fiat_p256_addcarryx_u32(&x409, &x410, x408, (fiat_p256_uint1)x399, x375); uint32_t x411; fiat_p256_uint1 x412; fiat_p256_addcarryx_u32(&x411, &x412, x410, 0x0, x377); uint32_t x413; fiat_p256_uint1 x414; fiat_p256_addcarryx_u32(&x413, &x414, x412, x367, x379); uint32_t x415; fiat_p256_uint1 x416; fiat_p256_addcarryx_u32(&x415, &x416, x414, x385, x381); uint32_t x417; fiat_p256_uint1 x418; fiat_p256_addcarryx_u32(&x417, &x418, x416, x386, x383); uint32_t x419; fiat_p256_uint1 x420; fiat_p256_addcarryx_u32(&x419, &x420, x418, 0x0, x384); uint32_t x421; uint32_t x422; fiat_p256_mulx_u32(&x421, &x422, x5, (arg1[7])); uint32_t x423; uint32_t x424; fiat_p256_mulx_u32(&x423, &x424, x5, (arg1[6])); uint32_t x425; uint32_t x426; fiat_p256_mulx_u32(&x425, &x426, x5, (arg1[5])); uint32_t x427; uint32_t x428; fiat_p256_mulx_u32(&x427, &x428, x5, (arg1[4])); uint32_t x429; uint32_t x430; fiat_p256_mulx_u32(&x429, &x430, x5, (arg1[3])); uint32_t x431; uint32_t x432; fiat_p256_mulx_u32(&x431, &x432, x5, (arg1[2])); uint32_t x433; uint32_t x434; fiat_p256_mulx_u32(&x433, &x434, x5, (arg1[1])); uint32_t x435; uint32_t x436; fiat_p256_mulx_u32(&x435, &x436, x5, (arg1[0])); uint32_t x437; fiat_p256_uint1 x438; fiat_p256_addcarryx_u32(&x437, &x438, 0x0, x433, x436); uint32_t x439; fiat_p256_uint1 x440; fiat_p256_addcarryx_u32(&x439, &x440, x438, x431, x434); uint32_t x441; fiat_p256_uint1 x442; fiat_p256_addcarryx_u32(&x441, &x442, x440, x429, x432); uint32_t x443; fiat_p256_uint1 x444; fiat_p256_addcarryx_u32(&x443, &x444, x442, x427, x430); uint32_t x445; fiat_p256_uint1 x446; fiat_p256_addcarryx_u32(&x445, &x446, x444, x425, x428); uint32_t x447; fiat_p256_uint1 x448; fiat_p256_addcarryx_u32(&x447, &x448, x446, x423, x426); uint32_t x449; fiat_p256_uint1 x450; fiat_p256_addcarryx_u32(&x449, &x450, x448, x421, x424); uint32_t x451; fiat_p256_uint1 x452; fiat_p256_addcarryx_u32(&x451, &x452, x450, 0x0, x422); uint32_t x453; fiat_p256_uint1 x454; fiat_p256_addcarryx_u32(&x453, &x454, 0x0, x435, x403); uint32_t x455; fiat_p256_uint1 x456; fiat_p256_addcarryx_u32(&x455, &x456, x454, x437, x405); uint32_t x457; fiat_p256_uint1 x458; fiat_p256_addcarryx_u32(&x457, &x458, x456, x439, x407); uint32_t x459; fiat_p256_uint1 x460; fiat_p256_addcarryx_u32(&x459, &x460, x458, x441, x409); uint32_t x461; fiat_p256_uint1 x462; fiat_p256_addcarryx_u32(&x461, &x462, x460, x443, x411); uint32_t x463; fiat_p256_uint1 x464; fiat_p256_addcarryx_u32(&x463, &x464, x462, x445, x413); uint32_t x465; fiat_p256_uint1 x466; fiat_p256_addcarryx_u32(&x465, &x466, x464, x447, x415); uint32_t x467; fiat_p256_uint1 x468; fiat_p256_addcarryx_u32(&x467, &x468, x466, x449, x417); uint32_t x469; fiat_p256_uint1 x470; fiat_p256_addcarryx_u32(&x469, &x470, x468, x451, x419); uint32_t x471; uint32_t x472; fiat_p256_mulx_u32(&x471, &x472, x453, UINT32_C(0xffffffff)); uint32_t x473; uint32_t x474; fiat_p256_mulx_u32(&x473, &x474, x453, UINT32_C(0xffffffff)); uint32_t x475; uint32_t x476; fiat_p256_mulx_u32(&x475, &x476, x453, UINT32_C(0xffffffff)); uint32_t x477; uint32_t x478; fiat_p256_mulx_u32(&x477, &x478, x453, UINT32_C(0xffffffff)); uint32_t x479; fiat_p256_uint1 x480; fiat_p256_addcarryx_u32(&x479, &x480, 0x0, x475, x478); uint32_t x481; fiat_p256_uint1 x482; fiat_p256_addcarryx_u32(&x481, &x482, x480, x473, x476); uint32_t x483; fiat_p256_uint1 x484; fiat_p256_addcarryx_u32(&x483, &x484, x482, 0x0, x474); uint32_t x485; fiat_p256_uint1 x486; fiat_p256_addcarryx_u32(&x485, &x486, x484, 0x0, 0x0); uint32_t x487; fiat_p256_uint1 x488; fiat_p256_addcarryx_u32(&x487, &x488, 0x0, x477, x453); uint32_t x489; fiat_p256_uint1 x490; fiat_p256_addcarryx_u32(&x489, &x490, x488, x479, x455); uint32_t x491; fiat_p256_uint1 x492; fiat_p256_addcarryx_u32(&x491, &x492, x490, x481, x457); uint32_t x493; fiat_p256_uint1 x494; fiat_p256_addcarryx_u32(&x493, &x494, x492, x483, x459); uint32_t x495; fiat_p256_uint1 x496; fiat_p256_addcarryx_u32(&x495, &x496, x494, (fiat_p256_uint1)x485, x461); uint32_t x497; fiat_p256_uint1 x498; fiat_p256_addcarryx_u32(&x497, &x498, x496, 0x0, x463); uint32_t x499; fiat_p256_uint1 x500; fiat_p256_addcarryx_u32(&x499, &x500, x498, x453, x465); uint32_t x501; fiat_p256_uint1 x502; fiat_p256_addcarryx_u32(&x501, &x502, x500, x471, x467); uint32_t x503; fiat_p256_uint1 x504; fiat_p256_addcarryx_u32(&x503, &x504, x502, x472, x469); uint32_t x505; fiat_p256_uint1 x506; fiat_p256_addcarryx_u32(&x505, &x506, x504, 0x0, x470); uint32_t x507; uint32_t x508; fiat_p256_mulx_u32(&x507, &x508, x6, (arg1[7])); uint32_t x509; uint32_t x510; fiat_p256_mulx_u32(&x509, &x510, x6, (arg1[6])); uint32_t x511; uint32_t x512; fiat_p256_mulx_u32(&x511, &x512, x6, (arg1[5])); uint32_t x513; uint32_t x514; fiat_p256_mulx_u32(&x513, &x514, x6, (arg1[4])); uint32_t x515; uint32_t x516; fiat_p256_mulx_u32(&x515, &x516, x6, (arg1[3])); uint32_t x517; uint32_t x518; fiat_p256_mulx_u32(&x517, &x518, x6, (arg1[2])); uint32_t x519; uint32_t x520; fiat_p256_mulx_u32(&x519, &x520, x6, (arg1[1])); uint32_t x521; uint32_t x522; fiat_p256_mulx_u32(&x521, &x522, x6, (arg1[0])); uint32_t x523; fiat_p256_uint1 x524; fiat_p256_addcarryx_u32(&x523, &x524, 0x0, x519, x522); uint32_t x525; fiat_p256_uint1 x526; fiat_p256_addcarryx_u32(&x525, &x526, x524, x517, x520); uint32_t x527; fiat_p256_uint1 x528; fiat_p256_addcarryx_u32(&x527, &x528, x526, x515, x518); uint32_t x529; fiat_p256_uint1 x530; fiat_p256_addcarryx_u32(&x529, &x530, x528, x513, x516); uint32_t x531; fiat_p256_uint1 x532; fiat_p256_addcarryx_u32(&x531, &x532, x530, x511, x514); uint32_t x533; fiat_p256_uint1 x534; fiat_p256_addcarryx_u32(&x533, &x534, x532, x509, x512); uint32_t x535; fiat_p256_uint1 x536; fiat_p256_addcarryx_u32(&x535, &x536, x534, x507, x510); uint32_t x537; fiat_p256_uint1 x538; fiat_p256_addcarryx_u32(&x537, &x538, x536, 0x0, x508); uint32_t x539; fiat_p256_uint1 x540; fiat_p256_addcarryx_u32(&x539, &x540, 0x0, x521, x489); uint32_t x541; fiat_p256_uint1 x542; fiat_p256_addcarryx_u32(&x541, &x542, x540, x523, x491); uint32_t x543; fiat_p256_uint1 x544; fiat_p256_addcarryx_u32(&x543, &x544, x542, x525, x493); uint32_t x545; fiat_p256_uint1 x546; fiat_p256_addcarryx_u32(&x545, &x546, x544, x527, x495); uint32_t x547; fiat_p256_uint1 x548; fiat_p256_addcarryx_u32(&x547, &x548, x546, x529, x497); uint32_t x549; fiat_p256_uint1 x550; fiat_p256_addcarryx_u32(&x549, &x550, x548, x531, x499); uint32_t x551; fiat_p256_uint1 x552; fiat_p256_addcarryx_u32(&x551, &x552, x550, x533, x501); uint32_t x553; fiat_p256_uint1 x554; fiat_p256_addcarryx_u32(&x553, &x554, x552, x535, x503); uint32_t x555; fiat_p256_uint1 x556; fiat_p256_addcarryx_u32(&x555, &x556, x554, x537, x505); uint32_t x557; uint32_t x558; fiat_p256_mulx_u32(&x557, &x558, x539, UINT32_C(0xffffffff)); uint32_t x559; uint32_t x560; fiat_p256_mulx_u32(&x559, &x560, x539, UINT32_C(0xffffffff)); uint32_t x561; uint32_t x562; fiat_p256_mulx_u32(&x561, &x562, x539, UINT32_C(0xffffffff)); uint32_t x563; uint32_t x564; fiat_p256_mulx_u32(&x563, &x564, x539, UINT32_C(0xffffffff)); uint32_t x565; fiat_p256_uint1 x566; fiat_p256_addcarryx_u32(&x565, &x566, 0x0, x561, x564); uint32_t x567; fiat_p256_uint1 x568; fiat_p256_addcarryx_u32(&x567, &x568, x566, x559, x562); uint32_t x569; fiat_p256_uint1 x570; fiat_p256_addcarryx_u32(&x569, &x570, x568, 0x0, x560); uint32_t x571; fiat_p256_uint1 x572; fiat_p256_addcarryx_u32(&x571, &x572, x570, 0x0, 0x0); uint32_t x573; fiat_p256_uint1 x574; fiat_p256_addcarryx_u32(&x573, &x574, 0x0, x563, x539); uint32_t x575; fiat_p256_uint1 x576; fiat_p256_addcarryx_u32(&x575, &x576, x574, x565, x541); uint32_t x577; fiat_p256_uint1 x578; fiat_p256_addcarryx_u32(&x577, &x578, x576, x567, x543); uint32_t x579; fiat_p256_uint1 x580; fiat_p256_addcarryx_u32(&x579, &x580, x578, x569, x545); uint32_t x581; fiat_p256_uint1 x582; fiat_p256_addcarryx_u32(&x581, &x582, x580, (fiat_p256_uint1)x571, x547); uint32_t x583; fiat_p256_uint1 x584; fiat_p256_addcarryx_u32(&x583, &x584, x582, 0x0, x549); uint32_t x585; fiat_p256_uint1 x586; fiat_p256_addcarryx_u32(&x585, &x586, x584, x539, x551); uint32_t x587; fiat_p256_uint1 x588; fiat_p256_addcarryx_u32(&x587, &x588, x586, x557, x553); uint32_t x589; fiat_p256_uint1 x590; fiat_p256_addcarryx_u32(&x589, &x590, x588, x558, x555); uint32_t x591; fiat_p256_uint1 x592; fiat_p256_addcarryx_u32(&x591, &x592, x590, 0x0, x556); uint32_t x593; uint32_t x594; fiat_p256_mulx_u32(&x593, &x594, x7, (arg1[7])); uint32_t x595; uint32_t x596; fiat_p256_mulx_u32(&x595, &x596, x7, (arg1[6])); uint32_t x597; uint32_t x598; fiat_p256_mulx_u32(&x597, &x598, x7, (arg1[5])); uint32_t x599; uint32_t x600; fiat_p256_mulx_u32(&x599, &x600, x7, (arg1[4])); uint32_t x601; uint32_t x602; fiat_p256_mulx_u32(&x601, &x602, x7, (arg1[3])); uint32_t x603; uint32_t x604; fiat_p256_mulx_u32(&x603, &x604, x7, (arg1[2])); uint32_t x605; uint32_t x606; fiat_p256_mulx_u32(&x605, &x606, x7, (arg1[1])); uint32_t x607; uint32_t x608; fiat_p256_mulx_u32(&x607, &x608, x7, (arg1[0])); uint32_t x609; fiat_p256_uint1 x610; fiat_p256_addcarryx_u32(&x609, &x610, 0x0, x605, x608); uint32_t x611; fiat_p256_uint1 x612; fiat_p256_addcarryx_u32(&x611, &x612, x610, x603, x606); uint32_t x613; fiat_p256_uint1 x614; fiat_p256_addcarryx_u32(&x613, &x614, x612, x601, x604); uint32_t x615; fiat_p256_uint1 x616; fiat_p256_addcarryx_u32(&x615, &x616, x614, x599, x602); uint32_t x617; fiat_p256_uint1 x618; fiat_p256_addcarryx_u32(&x617, &x618, x616, x597, x600); uint32_t x619; fiat_p256_uint1 x620; fiat_p256_addcarryx_u32(&x619, &x620, x618, x595, x598); uint32_t x621; fiat_p256_uint1 x622; fiat_p256_addcarryx_u32(&x621, &x622, x620, x593, x596); uint32_t x623; fiat_p256_uint1 x624; fiat_p256_addcarryx_u32(&x623, &x624, x622, 0x0, x594); uint32_t x625; fiat_p256_uint1 x626; fiat_p256_addcarryx_u32(&x625, &x626, 0x0, x607, x575); uint32_t x627; fiat_p256_uint1 x628; fiat_p256_addcarryx_u32(&x627, &x628, x626, x609, x577); uint32_t x629; fiat_p256_uint1 x630; fiat_p256_addcarryx_u32(&x629, &x630, x628, x611, x579); uint32_t x631; fiat_p256_uint1 x632; fiat_p256_addcarryx_u32(&x631, &x632, x630, x613, x581); uint32_t x633; fiat_p256_uint1 x634; fiat_p256_addcarryx_u32(&x633, &x634, x632, x615, x583); uint32_t x635; fiat_p256_uint1 x636; fiat_p256_addcarryx_u32(&x635, &x636, x634, x617, x585); uint32_t x637; fiat_p256_uint1 x638; fiat_p256_addcarryx_u32(&x637, &x638, x636, x619, x587); uint32_t x639; fiat_p256_uint1 x640; fiat_p256_addcarryx_u32(&x639, &x640, x638, x621, x589); uint32_t x641; fiat_p256_uint1 x642; fiat_p256_addcarryx_u32(&x641, &x642, x640, x623, x591); uint32_t x643; uint32_t x644; fiat_p256_mulx_u32(&x643, &x644, x625, UINT32_C(0xffffffff)); uint32_t x645; uint32_t x646; fiat_p256_mulx_u32(&x645, &x646, x625, UINT32_C(0xffffffff)); uint32_t x647; uint32_t x648; fiat_p256_mulx_u32(&x647, &x648, x625, UINT32_C(0xffffffff)); uint32_t x649; uint32_t x650; fiat_p256_mulx_u32(&x649, &x650, x625, UINT32_C(0xffffffff)); uint32_t x651; fiat_p256_uint1 x652; fiat_p256_addcarryx_u32(&x651, &x652, 0x0, x647, x650); uint32_t x653; fiat_p256_uint1 x654; fiat_p256_addcarryx_u32(&x653, &x654, x652, x645, x648); uint32_t x655; fiat_p256_uint1 x656; fiat_p256_addcarryx_u32(&x655, &x656, x654, 0x0, x646); uint32_t x657; fiat_p256_uint1 x658; fiat_p256_addcarryx_u32(&x657, &x658, x656, 0x0, 0x0); uint32_t x659; fiat_p256_uint1 x660; fiat_p256_addcarryx_u32(&x659, &x660, 0x0, x649, x625); uint32_t x661; fiat_p256_uint1 x662; fiat_p256_addcarryx_u32(&x661, &x662, x660, x651, x627); uint32_t x663; fiat_p256_uint1 x664; fiat_p256_addcarryx_u32(&x663, &x664, x662, x653, x629); uint32_t x665; fiat_p256_uint1 x666; fiat_p256_addcarryx_u32(&x665, &x666, x664, x655, x631); uint32_t x667; fiat_p256_uint1 x668; fiat_p256_addcarryx_u32(&x667, &x668, x666, (fiat_p256_uint1)x657, x633); uint32_t x669; fiat_p256_uint1 x670; fiat_p256_addcarryx_u32(&x669, &x670, x668, 0x0, x635); uint32_t x671; fiat_p256_uint1 x672; fiat_p256_addcarryx_u32(&x671, &x672, x670, x625, x637); uint32_t x673; fiat_p256_uint1 x674; fiat_p256_addcarryx_u32(&x673, &x674, x672, x643, x639); uint32_t x675; fiat_p256_uint1 x676; fiat_p256_addcarryx_u32(&x675, &x676, x674, x644, x641); uint32_t x677; fiat_p256_uint1 x678; fiat_p256_addcarryx_u32(&x677, &x678, x676, 0x0, x642); uint32_t x679; fiat_p256_uint1 x680; fiat_p256_subborrowx_u32(&x679, &x680, 0x0, x661, UINT32_C(0xffffffff)); uint32_t x681; fiat_p256_uint1 x682; fiat_p256_subborrowx_u32(&x681, &x682, x680, x663, UINT32_C(0xffffffff)); uint32_t x683; fiat_p256_uint1 x684; fiat_p256_subborrowx_u32(&x683, &x684, x682, x665, UINT32_C(0xffffffff)); uint32_t x685; fiat_p256_uint1 x686; fiat_p256_subborrowx_u32(&x685, &x686, x684, x667, 0x0); uint32_t x687; fiat_p256_uint1 x688; fiat_p256_subborrowx_u32(&x687, &x688, x686, x669, 0x0); uint32_t x689; fiat_p256_uint1 x690; fiat_p256_subborrowx_u32(&x689, &x690, x688, x671, 0x0); uint32_t x691; fiat_p256_uint1 x692; fiat_p256_subborrowx_u32(&x691, &x692, x690, x673, 0x1); uint32_t x693; fiat_p256_uint1 x694; fiat_p256_subborrowx_u32(&x693, &x694, x692, x675, UINT32_C(0xffffffff)); uint32_t x695; fiat_p256_uint1 x696; fiat_p256_subborrowx_u32(&x695, &x696, x694, x677, 0x0); uint32_t x697; fiat_p256_cmovznz_u32(&x697, x696, x679, x661); uint32_t x698; fiat_p256_cmovznz_u32(&x698, x696, x681, x663); uint32_t x699; fiat_p256_cmovznz_u32(&x699, x696, x683, x665); uint32_t x700; fiat_p256_cmovznz_u32(&x700, x696, x685, x667); uint32_t x701; fiat_p256_cmovznz_u32(&x701, x696, x687, x669); uint32_t x702; fiat_p256_cmovznz_u32(&x702, x696, x689, x671); uint32_t x703; fiat_p256_cmovznz_u32(&x703, x696, x691, x673); uint32_t x704; fiat_p256_cmovznz_u32(&x704, x696, x693, x675); out1[0] = x697; out1[1] = x698; out1[2] = x699; out1[3] = x700; out1[4] = x701; out1[5] = x702; out1[6] = x703; out1[7] = x704; } /* * Input Bounds: * arg1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * arg2: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * Output Bounds: * out1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] */ static void fiat_p256_add(uint32_t out1[8], const uint32_t arg1[8], const uint32_t arg2[8]) { uint32_t x1; fiat_p256_uint1 x2; fiat_p256_addcarryx_u32(&x1, &x2, 0x0, (arg2[0]), (arg1[0])); uint32_t x3; fiat_p256_uint1 x4; fiat_p256_addcarryx_u32(&x3, &x4, x2, (arg2[1]), (arg1[1])); uint32_t x5; fiat_p256_uint1 x6; fiat_p256_addcarryx_u32(&x5, &x6, x4, (arg2[2]), (arg1[2])); uint32_t x7; fiat_p256_uint1 x8; fiat_p256_addcarryx_u32(&x7, &x8, x6, (arg2[3]), (arg1[3])); uint32_t x9; fiat_p256_uint1 x10; fiat_p256_addcarryx_u32(&x9, &x10, x8, (arg2[4]), (arg1[4])); uint32_t x11; fiat_p256_uint1 x12; fiat_p256_addcarryx_u32(&x11, &x12, x10, (arg2[5]), (arg1[5])); uint32_t x13; fiat_p256_uint1 x14; fiat_p256_addcarryx_u32(&x13, &x14, x12, (arg2[6]), (arg1[6])); uint32_t x15; fiat_p256_uint1 x16; fiat_p256_addcarryx_u32(&x15, &x16, x14, (arg2[7]), (arg1[7])); uint32_t x17; fiat_p256_uint1 x18; fiat_p256_subborrowx_u32(&x17, &x18, 0x0, x1, UINT32_C(0xffffffff)); uint32_t x19; fiat_p256_uint1 x20; fiat_p256_subborrowx_u32(&x19, &x20, x18, x3, UINT32_C(0xffffffff)); uint32_t x21; fiat_p256_uint1 x22; fiat_p256_subborrowx_u32(&x21, &x22, x20, x5, UINT32_C(0xffffffff)); uint32_t x23; fiat_p256_uint1 x24; fiat_p256_subborrowx_u32(&x23, &x24, x22, x7, 0x0); uint32_t x25; fiat_p256_uint1 x26; fiat_p256_subborrowx_u32(&x25, &x26, x24, x9, 0x0); uint32_t x27; fiat_p256_uint1 x28; fiat_p256_subborrowx_u32(&x27, &x28, x26, x11, 0x0); uint32_t x29; fiat_p256_uint1 x30; fiat_p256_subborrowx_u32(&x29, &x30, x28, x13, 0x1); uint32_t x31; fiat_p256_uint1 x32; fiat_p256_subborrowx_u32(&x31, &x32, x30, x15, UINT32_C(0xffffffff)); uint32_t x33; fiat_p256_uint1 x34; fiat_p256_subborrowx_u32(&x33, &x34, x32, x16, 0x0); uint32_t x35; fiat_p256_cmovznz_u32(&x35, x34, x17, x1); uint32_t x36; fiat_p256_cmovznz_u32(&x36, x34, x19, x3); uint32_t x37; fiat_p256_cmovznz_u32(&x37, x34, x21, x5); uint32_t x38; fiat_p256_cmovznz_u32(&x38, x34, x23, x7); uint32_t x39; fiat_p256_cmovznz_u32(&x39, x34, x25, x9); uint32_t x40; fiat_p256_cmovznz_u32(&x40, x34, x27, x11); uint32_t x41; fiat_p256_cmovznz_u32(&x41, x34, x29, x13); uint32_t x42; fiat_p256_cmovznz_u32(&x42, x34, x31, x15); out1[0] = x35; out1[1] = x36; out1[2] = x37; out1[3] = x38; out1[4] = x39; out1[5] = x40; out1[6] = x41; out1[7] = x42; } /* * Input Bounds: * arg1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * arg2: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * Output Bounds: * out1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] */ static void fiat_p256_sub(uint32_t out1[8], const uint32_t arg1[8], const uint32_t arg2[8]) { uint32_t x1; fiat_p256_uint1 x2; fiat_p256_subborrowx_u32(&x1, &x2, 0x0, (arg1[0]), (arg2[0])); uint32_t x3; fiat_p256_uint1 x4; fiat_p256_subborrowx_u32(&x3, &x4, x2, (arg1[1]), (arg2[1])); uint32_t x5; fiat_p256_uint1 x6; fiat_p256_subborrowx_u32(&x5, &x6, x4, (arg1[2]), (arg2[2])); uint32_t x7; fiat_p256_uint1 x8; fiat_p256_subborrowx_u32(&x7, &x8, x6, (arg1[3]), (arg2[3])); uint32_t x9; fiat_p256_uint1 x10; fiat_p256_subborrowx_u32(&x9, &x10, x8, (arg1[4]), (arg2[4])); uint32_t x11; fiat_p256_uint1 x12; fiat_p256_subborrowx_u32(&x11, &x12, x10, (arg1[5]), (arg2[5])); uint32_t x13; fiat_p256_uint1 x14; fiat_p256_subborrowx_u32(&x13, &x14, x12, (arg1[6]), (arg2[6])); uint32_t x15; fiat_p256_uint1 x16; fiat_p256_subborrowx_u32(&x15, &x16, x14, (arg1[7]), (arg2[7])); uint32_t x17; fiat_p256_cmovznz_u32(&x17, x16, 0x0, UINT32_C(0xffffffff)); uint32_t x18; fiat_p256_uint1 x19; fiat_p256_addcarryx_u32(&x18, &x19, 0x0, (x17 & UINT32_C(0xffffffff)), x1); uint32_t x20; fiat_p256_uint1 x21; fiat_p256_addcarryx_u32(&x20, &x21, x19, (x17 & UINT32_C(0xffffffff)), x3); uint32_t x22; fiat_p256_uint1 x23; fiat_p256_addcarryx_u32(&x22, &x23, x21, (x17 & UINT32_C(0xffffffff)), x5); uint32_t x24; fiat_p256_uint1 x25; fiat_p256_addcarryx_u32(&x24, &x25, x23, 0x0, x7); uint32_t x26; fiat_p256_uint1 x27; fiat_p256_addcarryx_u32(&x26, &x27, x25, 0x0, x9); uint32_t x28; fiat_p256_uint1 x29; fiat_p256_addcarryx_u32(&x28, &x29, x27, 0x0, x11); uint32_t x30; fiat_p256_uint1 x31; fiat_p256_addcarryx_u32(&x30, &x31, x29, (fiat_p256_uint1)(x17 & 0x1), x13); uint32_t x32; fiat_p256_uint1 x33; fiat_p256_addcarryx_u32(&x32, &x33, x31, (x17 & UINT32_C(0xffffffff)), x15); out1[0] = x18; out1[1] = x20; out1[2] = x22; out1[3] = x24; out1[4] = x26; out1[5] = x28; out1[6] = x30; out1[7] = x32; } /* * Input Bounds: * arg1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * Output Bounds: * out1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] */ static void fiat_p256_opp(uint32_t out1[8], const uint32_t arg1[8]) { uint32_t x1; fiat_p256_uint1 x2; fiat_p256_subborrowx_u32(&x1, &x2, 0x0, 0x0, (arg1[0])); uint32_t x3; fiat_p256_uint1 x4; fiat_p256_subborrowx_u32(&x3, &x4, x2, 0x0, (arg1[1])); uint32_t x5; fiat_p256_uint1 x6; fiat_p256_subborrowx_u32(&x5, &x6, x4, 0x0, (arg1[2])); uint32_t x7; fiat_p256_uint1 x8; fiat_p256_subborrowx_u32(&x7, &x8, x6, 0x0, (arg1[3])); uint32_t x9; fiat_p256_uint1 x10; fiat_p256_subborrowx_u32(&x9, &x10, x8, 0x0, (arg1[4])); uint32_t x11; fiat_p256_uint1 x12; fiat_p256_subborrowx_u32(&x11, &x12, x10, 0x0, (arg1[5])); uint32_t x13; fiat_p256_uint1 x14; fiat_p256_subborrowx_u32(&x13, &x14, x12, 0x0, (arg1[6])); uint32_t x15; fiat_p256_uint1 x16; fiat_p256_subborrowx_u32(&x15, &x16, x14, 0x0, (arg1[7])); uint32_t x17; fiat_p256_cmovznz_u32(&x17, x16, 0x0, UINT32_C(0xffffffff)); uint32_t x18; fiat_p256_uint1 x19; fiat_p256_addcarryx_u32(&x18, &x19, 0x0, (x17 & UINT32_C(0xffffffff)), x1); uint32_t x20; fiat_p256_uint1 x21; fiat_p256_addcarryx_u32(&x20, &x21, x19, (x17 & UINT32_C(0xffffffff)), x3); uint32_t x22; fiat_p256_uint1 x23; fiat_p256_addcarryx_u32(&x22, &x23, x21, (x17 & UINT32_C(0xffffffff)), x5); uint32_t x24; fiat_p256_uint1 x25; fiat_p256_addcarryx_u32(&x24, &x25, x23, 0x0, x7); uint32_t x26; fiat_p256_uint1 x27; fiat_p256_addcarryx_u32(&x26, &x27, x25, 0x0, x9); uint32_t x28; fiat_p256_uint1 x29; fiat_p256_addcarryx_u32(&x28, &x29, x27, 0x0, x11); uint32_t x30; fiat_p256_uint1 x31; fiat_p256_addcarryx_u32(&x30, &x31, x29, (fiat_p256_uint1)(x17 & 0x1), x13); uint32_t x32; fiat_p256_uint1 x33; fiat_p256_addcarryx_u32(&x32, &x33, x31, (x17 & UINT32_C(0xffffffff)), x15); out1[0] = x18; out1[1] = x20; out1[2] = x22; out1[3] = x24; out1[4] = x26; out1[5] = x28; out1[6] = x30; out1[7] = x32; } /* * Input Bounds: * arg1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * Output Bounds: * out1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] */ static void fiat_p256_from_montgomery(uint32_t out1[8], const uint32_t arg1[8]) { uint32_t x1 = (arg1[0]); uint32_t x2; uint32_t x3; fiat_p256_mulx_u32(&x2, &x3, x1, UINT32_C(0xffffffff)); uint32_t x4; uint32_t x5; fiat_p256_mulx_u32(&x4, &x5, x1, UINT32_C(0xffffffff)); uint32_t x6; uint32_t x7; fiat_p256_mulx_u32(&x6, &x7, x1, UINT32_C(0xffffffff)); uint32_t x8; uint32_t x9; fiat_p256_mulx_u32(&x8, &x9, x1, UINT32_C(0xffffffff)); uint32_t x10; fiat_p256_uint1 x11; fiat_p256_addcarryx_u32(&x10, &x11, 0x0, x6, x9); uint32_t x12; fiat_p256_uint1 x13; fiat_p256_addcarryx_u32(&x12, &x13, x11, x4, x7); uint32_t x14; fiat_p256_uint1 x15; fiat_p256_addcarryx_u32(&x14, &x15, x13, 0x0, x5); uint32_t x16; fiat_p256_uint1 x17; fiat_p256_addcarryx_u32(&x16, &x17, 0x0, x8, x1); uint32_t x18; fiat_p256_uint1 x19; fiat_p256_addcarryx_u32(&x18, &x19, x17, x10, 0x0); uint32_t x20; fiat_p256_uint1 x21; fiat_p256_addcarryx_u32(&x20, &x21, x19, x12, 0x0); uint32_t x22; fiat_p256_uint1 x23; fiat_p256_addcarryx_u32(&x22, &x23, x21, x14, 0x0); uint32_t x24; fiat_p256_uint1 x25; fiat_p256_addcarryx_u32(&x24, &x25, x15, 0x0, 0x0); uint32_t x26; fiat_p256_uint1 x27; fiat_p256_addcarryx_u32(&x26, &x27, x23, (fiat_p256_uint1)x24, 0x0); uint32_t x28; fiat_p256_uint1 x29; fiat_p256_addcarryx_u32(&x28, &x29, 0x0, (arg1[1]), x18); uint32_t x30; fiat_p256_uint1 x31; fiat_p256_addcarryx_u32(&x30, &x31, x29, 0x0, x20); uint32_t x32; fiat_p256_uint1 x33; fiat_p256_addcarryx_u32(&x32, &x33, x31, 0x0, x22); uint32_t x34; fiat_p256_uint1 x35; fiat_p256_addcarryx_u32(&x34, &x35, x33, 0x0, (fiat_p256_uint1)x26); uint32_t x36; fiat_p256_uint1 x37; fiat_p256_addcarryx_u32(&x36, &x37, x27, 0x0, 0x0); uint32_t x38; fiat_p256_uint1 x39; fiat_p256_addcarryx_u32(&x38, &x39, x35, 0x0, (fiat_p256_uint1)x36); uint32_t x40; fiat_p256_uint1 x41; fiat_p256_addcarryx_u32(&x40, &x41, x39, 0x0, x1); uint32_t x42; fiat_p256_uint1 x43; fiat_p256_addcarryx_u32(&x42, &x43, x41, 0x0, x2); uint32_t x44; fiat_p256_uint1 x45; fiat_p256_addcarryx_u32(&x44, &x45, x43, 0x0, x3); uint32_t x46; uint32_t x47; fiat_p256_mulx_u32(&x46, &x47, x28, UINT32_C(0xffffffff)); uint32_t x48; uint32_t x49; fiat_p256_mulx_u32(&x48, &x49, x28, UINT32_C(0xffffffff)); uint32_t x50; uint32_t x51; fiat_p256_mulx_u32(&x50, &x51, x28, UINT32_C(0xffffffff)); uint32_t x52; uint32_t x53; fiat_p256_mulx_u32(&x52, &x53, x28, UINT32_C(0xffffffff)); uint32_t x54; fiat_p256_uint1 x55; fiat_p256_addcarryx_u32(&x54, &x55, 0x0, x50, x53); uint32_t x56; fiat_p256_uint1 x57; fiat_p256_addcarryx_u32(&x56, &x57, x55, x48, x51); uint32_t x58; fiat_p256_uint1 x59; fiat_p256_addcarryx_u32(&x58, &x59, x57, 0x0, x49); uint32_t x60; fiat_p256_uint1 x61; fiat_p256_addcarryx_u32(&x60, &x61, 0x0, x52, x28); uint32_t x62; fiat_p256_uint1 x63; fiat_p256_addcarryx_u32(&x62, &x63, x61, x54, x30); uint32_t x64; fiat_p256_uint1 x65; fiat_p256_addcarryx_u32(&x64, &x65, x63, x56, x32); uint32_t x66; fiat_p256_uint1 x67; fiat_p256_addcarryx_u32(&x66, &x67, x65, x58, x34); uint32_t x68; fiat_p256_uint1 x69; fiat_p256_addcarryx_u32(&x68, &x69, x59, 0x0, 0x0); uint32_t x70; fiat_p256_uint1 x71; fiat_p256_addcarryx_u32(&x70, &x71, x67, (fiat_p256_uint1)x68, (fiat_p256_uint1)x38); uint32_t x72; fiat_p256_uint1 x73; fiat_p256_addcarryx_u32(&x72, &x73, x71, 0x0, x40); uint32_t x74; fiat_p256_uint1 x75; fiat_p256_addcarryx_u32(&x74, &x75, x73, x28, x42); uint32_t x76; fiat_p256_uint1 x77; fiat_p256_addcarryx_u32(&x76, &x77, x75, x46, x44); uint32_t x78; fiat_p256_uint1 x79; fiat_p256_addcarryx_u32(&x78, &x79, x45, 0x0, 0x0); uint32_t x80; fiat_p256_uint1 x81; fiat_p256_addcarryx_u32(&x80, &x81, x77, x47, (fiat_p256_uint1)x78); uint32_t x82; fiat_p256_uint1 x83; fiat_p256_addcarryx_u32(&x82, &x83, 0x0, (arg1[2]), x62); uint32_t x84; fiat_p256_uint1 x85; fiat_p256_addcarryx_u32(&x84, &x85, x83, 0x0, x64); uint32_t x86; fiat_p256_uint1 x87; fiat_p256_addcarryx_u32(&x86, &x87, x85, 0x0, x66); uint32_t x88; fiat_p256_uint1 x89; fiat_p256_addcarryx_u32(&x88, &x89, x87, 0x0, (fiat_p256_uint1)x70); uint32_t x90; fiat_p256_uint1 x91; fiat_p256_addcarryx_u32(&x90, &x91, x89, 0x0, x72); uint32_t x92; fiat_p256_uint1 x93; fiat_p256_addcarryx_u32(&x92, &x93, x91, 0x0, x74); uint32_t x94; fiat_p256_uint1 x95; fiat_p256_addcarryx_u32(&x94, &x95, x93, 0x0, x76); uint32_t x96; fiat_p256_uint1 x97; fiat_p256_addcarryx_u32(&x96, &x97, x95, 0x0, x80); uint32_t x98; fiat_p256_uint1 x99; fiat_p256_addcarryx_u32(&x98, &x99, x81, 0x0, 0x0); uint32_t x100; fiat_p256_uint1 x101; fiat_p256_addcarryx_u32(&x100, &x101, x97, 0x0, (fiat_p256_uint1)x98); uint32_t x102; uint32_t x103; fiat_p256_mulx_u32(&x102, &x103, x82, UINT32_C(0xffffffff)); uint32_t x104; uint32_t x105; fiat_p256_mulx_u32(&x104, &x105, x82, UINT32_C(0xffffffff)); uint32_t x106; uint32_t x107; fiat_p256_mulx_u32(&x106, &x107, x82, UINT32_C(0xffffffff)); uint32_t x108; uint32_t x109; fiat_p256_mulx_u32(&x108, &x109, x82, UINT32_C(0xffffffff)); uint32_t x110; fiat_p256_uint1 x111; fiat_p256_addcarryx_u32(&x110, &x111, 0x0, x106, x109); uint32_t x112; fiat_p256_uint1 x113; fiat_p256_addcarryx_u32(&x112, &x113, x111, x104, x107); uint32_t x114; fiat_p256_uint1 x115; fiat_p256_addcarryx_u32(&x114, &x115, x113, 0x0, x105); uint32_t x116; fiat_p256_uint1 x117; fiat_p256_addcarryx_u32(&x116, &x117, 0x0, x108, x82); uint32_t x118; fiat_p256_uint1 x119; fiat_p256_addcarryx_u32(&x118, &x119, x117, x110, x84); uint32_t x120; fiat_p256_uint1 x121; fiat_p256_addcarryx_u32(&x120, &x121, x119, x112, x86); uint32_t x122; fiat_p256_uint1 x123; fiat_p256_addcarryx_u32(&x122, &x123, x121, x114, x88); uint32_t x124; fiat_p256_uint1 x125; fiat_p256_addcarryx_u32(&x124, &x125, x115, 0x0, 0x0); uint32_t x126; fiat_p256_uint1 x127; fiat_p256_addcarryx_u32(&x126, &x127, x123, (fiat_p256_uint1)x124, x90); uint32_t x128; fiat_p256_uint1 x129; fiat_p256_addcarryx_u32(&x128, &x129, x127, 0x0, x92); uint32_t x130; fiat_p256_uint1 x131; fiat_p256_addcarryx_u32(&x130, &x131, x129, x82, x94); uint32_t x132; fiat_p256_uint1 x133; fiat_p256_addcarryx_u32(&x132, &x133, x131, x102, x96); uint32_t x134; fiat_p256_uint1 x135; fiat_p256_addcarryx_u32(&x134, &x135, x133, x103, (fiat_p256_uint1)x100); uint32_t x136; fiat_p256_uint1 x137; fiat_p256_addcarryx_u32(&x136, &x137, 0x0, (arg1[3]), x118); uint32_t x138; fiat_p256_uint1 x139; fiat_p256_addcarryx_u32(&x138, &x139, x137, 0x0, x120); uint32_t x140; fiat_p256_uint1 x141; fiat_p256_addcarryx_u32(&x140, &x141, x139, 0x0, x122); uint32_t x142; fiat_p256_uint1 x143; fiat_p256_addcarryx_u32(&x142, &x143, x141, 0x0, x126); uint32_t x144; fiat_p256_uint1 x145; fiat_p256_addcarryx_u32(&x144, &x145, x143, 0x0, x128); uint32_t x146; fiat_p256_uint1 x147; fiat_p256_addcarryx_u32(&x146, &x147, x145, 0x0, x130); uint32_t x148; fiat_p256_uint1 x149; fiat_p256_addcarryx_u32(&x148, &x149, x147, 0x0, x132); uint32_t x150; fiat_p256_uint1 x151; fiat_p256_addcarryx_u32(&x150, &x151, x149, 0x0, x134); uint32_t x152; fiat_p256_uint1 x153; fiat_p256_addcarryx_u32(&x152, &x153, x135, 0x0, x101); uint32_t x154; fiat_p256_uint1 x155; fiat_p256_addcarryx_u32(&x154, &x155, x151, 0x0, (fiat_p256_uint1)x152); uint32_t x156; uint32_t x157; fiat_p256_mulx_u32(&x156, &x157, x136, UINT32_C(0xffffffff)); uint32_t x158; uint32_t x159; fiat_p256_mulx_u32(&x158, &x159, x136, UINT32_C(0xffffffff)); uint32_t x160; uint32_t x161; fiat_p256_mulx_u32(&x160, &x161, x136, UINT32_C(0xffffffff)); uint32_t x162; uint32_t x163; fiat_p256_mulx_u32(&x162, &x163, x136, UINT32_C(0xffffffff)); uint32_t x164; fiat_p256_uint1 x165; fiat_p256_addcarryx_u32(&x164, &x165, 0x0, x160, x163); uint32_t x166; fiat_p256_uint1 x167; fiat_p256_addcarryx_u32(&x166, &x167, x165, x158, x161); uint32_t x168; fiat_p256_uint1 x169; fiat_p256_addcarryx_u32(&x168, &x169, x167, 0x0, x159); uint32_t x170; fiat_p256_uint1 x171; fiat_p256_addcarryx_u32(&x170, &x171, 0x0, x162, x136); uint32_t x172; fiat_p256_uint1 x173; fiat_p256_addcarryx_u32(&x172, &x173, x171, x164, x138); uint32_t x174; fiat_p256_uint1 x175; fiat_p256_addcarryx_u32(&x174, &x175, x173, x166, x140); uint32_t x176; fiat_p256_uint1 x177; fiat_p256_addcarryx_u32(&x176, &x177, x175, x168, x142); uint32_t x178; fiat_p256_uint1 x179; fiat_p256_addcarryx_u32(&x178, &x179, x169, 0x0, 0x0); uint32_t x180; fiat_p256_uint1 x181; fiat_p256_addcarryx_u32(&x180, &x181, x177, (fiat_p256_uint1)x178, x144); uint32_t x182; fiat_p256_uint1 x183; fiat_p256_addcarryx_u32(&x182, &x183, x181, 0x0, x146); uint32_t x184; fiat_p256_uint1 x185; fiat_p256_addcarryx_u32(&x184, &x185, x183, x136, x148); uint32_t x186; fiat_p256_uint1 x187; fiat_p256_addcarryx_u32(&x186, &x187, x185, x156, x150); uint32_t x188; fiat_p256_uint1 x189; fiat_p256_addcarryx_u32(&x188, &x189, x187, x157, (fiat_p256_uint1)x154); uint32_t x190; fiat_p256_uint1 x191; fiat_p256_addcarryx_u32(&x190, &x191, 0x0, (arg1[4]), x172); uint32_t x192; fiat_p256_uint1 x193; fiat_p256_addcarryx_u32(&x192, &x193, x191, 0x0, x174); uint32_t x194; fiat_p256_uint1 x195; fiat_p256_addcarryx_u32(&x194, &x195, x193, 0x0, x176); uint32_t x196; fiat_p256_uint1 x197; fiat_p256_addcarryx_u32(&x196, &x197, x195, 0x0, x180); uint32_t x198; fiat_p256_uint1 x199; fiat_p256_addcarryx_u32(&x198, &x199, x197, 0x0, x182); uint32_t x200; fiat_p256_uint1 x201; fiat_p256_addcarryx_u32(&x200, &x201, x199, 0x0, x184); uint32_t x202; fiat_p256_uint1 x203; fiat_p256_addcarryx_u32(&x202, &x203, x201, 0x0, x186); uint32_t x204; fiat_p256_uint1 x205; fiat_p256_addcarryx_u32(&x204, &x205, x203, 0x0, x188); uint32_t x206; fiat_p256_uint1 x207; fiat_p256_addcarryx_u32(&x206, &x207, x189, 0x0, x155); uint32_t x208; fiat_p256_uint1 x209; fiat_p256_addcarryx_u32(&x208, &x209, x205, 0x0, (fiat_p256_uint1)x206); uint32_t x210; uint32_t x211; fiat_p256_mulx_u32(&x210, &x211, x190, UINT32_C(0xffffffff)); uint32_t x212; uint32_t x213; fiat_p256_mulx_u32(&x212, &x213, x190, UINT32_C(0xffffffff)); uint32_t x214; uint32_t x215; fiat_p256_mulx_u32(&x214, &x215, x190, UINT32_C(0xffffffff)); uint32_t x216; uint32_t x217; fiat_p256_mulx_u32(&x216, &x217, x190, UINT32_C(0xffffffff)); uint32_t x218; fiat_p256_uint1 x219; fiat_p256_addcarryx_u32(&x218, &x219, 0x0, x214, x217); uint32_t x220; fiat_p256_uint1 x221; fiat_p256_addcarryx_u32(&x220, &x221, x219, x212, x215); uint32_t x222; fiat_p256_uint1 x223; fiat_p256_addcarryx_u32(&x222, &x223, x221, 0x0, x213); uint32_t x224; fiat_p256_uint1 x225; fiat_p256_addcarryx_u32(&x224, &x225, 0x0, x216, x190); uint32_t x226; fiat_p256_uint1 x227; fiat_p256_addcarryx_u32(&x226, &x227, x225, x218, x192); uint32_t x228; fiat_p256_uint1 x229; fiat_p256_addcarryx_u32(&x228, &x229, x227, x220, x194); uint32_t x230; fiat_p256_uint1 x231; fiat_p256_addcarryx_u32(&x230, &x231, x229, x222, x196); uint32_t x232; fiat_p256_uint1 x233; fiat_p256_addcarryx_u32(&x232, &x233, x223, 0x0, 0x0); uint32_t x234; fiat_p256_uint1 x235; fiat_p256_addcarryx_u32(&x234, &x235, x231, (fiat_p256_uint1)x232, x198); uint32_t x236; fiat_p256_uint1 x237; fiat_p256_addcarryx_u32(&x236, &x237, x235, 0x0, x200); uint32_t x238; fiat_p256_uint1 x239; fiat_p256_addcarryx_u32(&x238, &x239, x237, x190, x202); uint32_t x240; fiat_p256_uint1 x241; fiat_p256_addcarryx_u32(&x240, &x241, x239, x210, x204); uint32_t x242; fiat_p256_uint1 x243; fiat_p256_addcarryx_u32(&x242, &x243, x241, x211, x208); uint32_t x244; fiat_p256_uint1 x245; fiat_p256_addcarryx_u32(&x244, &x245, 0x0, (arg1[5]), x226); uint32_t x246; fiat_p256_uint1 x247; fiat_p256_addcarryx_u32(&x246, &x247, x245, 0x0, x228); uint32_t x248; fiat_p256_uint1 x249; fiat_p256_addcarryx_u32(&x248, &x249, x247, 0x0, x230); uint32_t x250; fiat_p256_uint1 x251; fiat_p256_addcarryx_u32(&x250, &x251, x249, 0x0, x234); uint32_t x252; fiat_p256_uint1 x253; fiat_p256_addcarryx_u32(&x252, &x253, x251, 0x0, x236); uint32_t x254; fiat_p256_uint1 x255; fiat_p256_addcarryx_u32(&x254, &x255, x253, 0x0, x238); uint32_t x256; fiat_p256_uint1 x257; fiat_p256_addcarryx_u32(&x256, &x257, x255, 0x0, x240); uint32_t x258; fiat_p256_uint1 x259; fiat_p256_addcarryx_u32(&x258, &x259, x257, 0x0, x242); uint32_t x260; fiat_p256_uint1 x261; fiat_p256_addcarryx_u32(&x260, &x261, x243, 0x0, x209); uint32_t x262; fiat_p256_uint1 x263; fiat_p256_addcarryx_u32(&x262, &x263, x259, 0x0, (fiat_p256_uint1)x260); uint32_t x264; uint32_t x265; fiat_p256_mulx_u32(&x264, &x265, x244, UINT32_C(0xffffffff)); uint32_t x266; uint32_t x267; fiat_p256_mulx_u32(&x266, &x267, x244, UINT32_C(0xffffffff)); uint32_t x268; uint32_t x269; fiat_p256_mulx_u32(&x268, &x269, x244, UINT32_C(0xffffffff)); uint32_t x270; uint32_t x271; fiat_p256_mulx_u32(&x270, &x271, x244, UINT32_C(0xffffffff)); uint32_t x272; fiat_p256_uint1 x273; fiat_p256_addcarryx_u32(&x272, &x273, 0x0, x268, x271); uint32_t x274; fiat_p256_uint1 x275; fiat_p256_addcarryx_u32(&x274, &x275, x273, x266, x269); uint32_t x276; fiat_p256_uint1 x277; fiat_p256_addcarryx_u32(&x276, &x277, x275, 0x0, x267); uint32_t x278; fiat_p256_uint1 x279; fiat_p256_addcarryx_u32(&x278, &x279, 0x0, x270, x244); uint32_t x280; fiat_p256_uint1 x281; fiat_p256_addcarryx_u32(&x280, &x281, x279, x272, x246); uint32_t x282; fiat_p256_uint1 x283; fiat_p256_addcarryx_u32(&x282, &x283, x281, x274, x248); uint32_t x284; fiat_p256_uint1 x285; fiat_p256_addcarryx_u32(&x284, &x285, x283, x276, x250); uint32_t x286; fiat_p256_uint1 x287; fiat_p256_addcarryx_u32(&x286, &x287, x277, 0x0, 0x0); uint32_t x288; fiat_p256_uint1 x289; fiat_p256_addcarryx_u32(&x288, &x289, x285, (fiat_p256_uint1)x286, x252); uint32_t x290; fiat_p256_uint1 x291; fiat_p256_addcarryx_u32(&x290, &x291, x289, 0x0, x254); uint32_t x292; fiat_p256_uint1 x293; fiat_p256_addcarryx_u32(&x292, &x293, x291, x244, x256); uint32_t x294; fiat_p256_uint1 x295; fiat_p256_addcarryx_u32(&x294, &x295, x293, x264, x258); uint32_t x296; fiat_p256_uint1 x297; fiat_p256_addcarryx_u32(&x296, &x297, x295, x265, x262); uint32_t x298; fiat_p256_uint1 x299; fiat_p256_addcarryx_u32(&x298, &x299, 0x0, (arg1[6]), x280); uint32_t x300; fiat_p256_uint1 x301; fiat_p256_addcarryx_u32(&x300, &x301, x299, 0x0, x282); uint32_t x302; fiat_p256_uint1 x303; fiat_p256_addcarryx_u32(&x302, &x303, x301, 0x0, x284); uint32_t x304; fiat_p256_uint1 x305; fiat_p256_addcarryx_u32(&x304, &x305, x303, 0x0, x288); uint32_t x306; fiat_p256_uint1 x307; fiat_p256_addcarryx_u32(&x306, &x307, x305, 0x0, x290); uint32_t x308; fiat_p256_uint1 x309; fiat_p256_addcarryx_u32(&x308, &x309, x307, 0x0, x292); uint32_t x310; fiat_p256_uint1 x311; fiat_p256_addcarryx_u32(&x310, &x311, x309, 0x0, x294); uint32_t x312; fiat_p256_uint1 x313; fiat_p256_addcarryx_u32(&x312, &x313, x311, 0x0, x296); uint32_t x314; fiat_p256_uint1 x315; fiat_p256_addcarryx_u32(&x314, &x315, x297, 0x0, x263); uint32_t x316; fiat_p256_uint1 x317; fiat_p256_addcarryx_u32(&x316, &x317, x313, 0x0, (fiat_p256_uint1)x314); uint32_t x318; uint32_t x319; fiat_p256_mulx_u32(&x318, &x319, x298, UINT32_C(0xffffffff)); uint32_t x320; uint32_t x321; fiat_p256_mulx_u32(&x320, &x321, x298, UINT32_C(0xffffffff)); uint32_t x322; uint32_t x323; fiat_p256_mulx_u32(&x322, &x323, x298, UINT32_C(0xffffffff)); uint32_t x324; uint32_t x325; fiat_p256_mulx_u32(&x324, &x325, x298, UINT32_C(0xffffffff)); uint32_t x326; fiat_p256_uint1 x327; fiat_p256_addcarryx_u32(&x326, &x327, 0x0, x322, x325); uint32_t x328; fiat_p256_uint1 x329; fiat_p256_addcarryx_u32(&x328, &x329, x327, x320, x323); uint32_t x330; fiat_p256_uint1 x331; fiat_p256_addcarryx_u32(&x330, &x331, x329, 0x0, x321); uint32_t x332; fiat_p256_uint1 x333; fiat_p256_addcarryx_u32(&x332, &x333, 0x0, x324, x298); uint32_t x334; fiat_p256_uint1 x335; fiat_p256_addcarryx_u32(&x334, &x335, x333, x326, x300); uint32_t x336; fiat_p256_uint1 x337; fiat_p256_addcarryx_u32(&x336, &x337, x335, x328, x302); uint32_t x338; fiat_p256_uint1 x339; fiat_p256_addcarryx_u32(&x338, &x339, x337, x330, x304); uint32_t x340; fiat_p256_uint1 x341; fiat_p256_addcarryx_u32(&x340, &x341, x331, 0x0, 0x0); uint32_t x342; fiat_p256_uint1 x343; fiat_p256_addcarryx_u32(&x342, &x343, x339, (fiat_p256_uint1)x340, x306); uint32_t x344; fiat_p256_uint1 x345; fiat_p256_addcarryx_u32(&x344, &x345, x343, 0x0, x308); uint32_t x346; fiat_p256_uint1 x347; fiat_p256_addcarryx_u32(&x346, &x347, x345, x298, x310); uint32_t x348; fiat_p256_uint1 x349; fiat_p256_addcarryx_u32(&x348, &x349, x347, x318, x312); uint32_t x350; fiat_p256_uint1 x351; fiat_p256_addcarryx_u32(&x350, &x351, x349, x319, x316); uint32_t x352; fiat_p256_uint1 x353; fiat_p256_addcarryx_u32(&x352, &x353, 0x0, (arg1[7]), x334); uint32_t x354; fiat_p256_uint1 x355; fiat_p256_addcarryx_u32(&x354, &x355, x353, 0x0, x336); uint32_t x356; fiat_p256_uint1 x357; fiat_p256_addcarryx_u32(&x356, &x357, x355, 0x0, x338); uint32_t x358; fiat_p256_uint1 x359; fiat_p256_addcarryx_u32(&x358, &x359, x357, 0x0, x342); uint32_t x360; fiat_p256_uint1 x361; fiat_p256_addcarryx_u32(&x360, &x361, x359, 0x0, x344); uint32_t x362; fiat_p256_uint1 x363; fiat_p256_addcarryx_u32(&x362, &x363, x361, 0x0, x346); uint32_t x364; fiat_p256_uint1 x365; fiat_p256_addcarryx_u32(&x364, &x365, x363, 0x0, x348); uint32_t x366; fiat_p256_uint1 x367; fiat_p256_addcarryx_u32(&x366, &x367, x365, 0x0, x350); uint32_t x368; fiat_p256_uint1 x369; fiat_p256_addcarryx_u32(&x368, &x369, x351, 0x0, x317); uint32_t x370; fiat_p256_uint1 x371; fiat_p256_addcarryx_u32(&x370, &x371, x367, 0x0, (fiat_p256_uint1)x368); uint32_t x372; uint32_t x373; fiat_p256_mulx_u32(&x372, &x373, x352, UINT32_C(0xffffffff)); uint32_t x374; uint32_t x375; fiat_p256_mulx_u32(&x374, &x375, x352, UINT32_C(0xffffffff)); uint32_t x376; uint32_t x377; fiat_p256_mulx_u32(&x376, &x377, x352, UINT32_C(0xffffffff)); uint32_t x378; uint32_t x379; fiat_p256_mulx_u32(&x378, &x379, x352, UINT32_C(0xffffffff)); uint32_t x380; fiat_p256_uint1 x381; fiat_p256_addcarryx_u32(&x380, &x381, 0x0, x376, x379); uint32_t x382; fiat_p256_uint1 x383; fiat_p256_addcarryx_u32(&x382, &x383, x381, x374, x377); uint32_t x384; fiat_p256_uint1 x385; fiat_p256_addcarryx_u32(&x384, &x385, x383, 0x0, x375); uint32_t x386; fiat_p256_uint1 x387; fiat_p256_addcarryx_u32(&x386, &x387, 0x0, x378, x352); uint32_t x388; fiat_p256_uint1 x389; fiat_p256_addcarryx_u32(&x388, &x389, x387, x380, x354); uint32_t x390; fiat_p256_uint1 x391; fiat_p256_addcarryx_u32(&x390, &x391, x389, x382, x356); uint32_t x392; fiat_p256_uint1 x393; fiat_p256_addcarryx_u32(&x392, &x393, x391, x384, x358); uint32_t x394; fiat_p256_uint1 x395; fiat_p256_addcarryx_u32(&x394, &x395, x385, 0x0, 0x0); uint32_t x396; fiat_p256_uint1 x397; fiat_p256_addcarryx_u32(&x396, &x397, x393, (fiat_p256_uint1)x394, x360); uint32_t x398; fiat_p256_uint1 x399; fiat_p256_addcarryx_u32(&x398, &x399, x397, 0x0, x362); uint32_t x400; fiat_p256_uint1 x401; fiat_p256_addcarryx_u32(&x400, &x401, x399, x352, x364); uint32_t x402; fiat_p256_uint1 x403; fiat_p256_addcarryx_u32(&x402, &x403, x401, x372, x366); uint32_t x404; fiat_p256_uint1 x405; fiat_p256_addcarryx_u32(&x404, &x405, x403, x373, x370); uint32_t x406; fiat_p256_uint1 x407; fiat_p256_subborrowx_u32(&x406, &x407, 0x0, x388, UINT32_C(0xffffffff)); uint32_t x408; fiat_p256_uint1 x409; fiat_p256_subborrowx_u32(&x408, &x409, x407, x390, UINT32_C(0xffffffff)); uint32_t x410; fiat_p256_uint1 x411; fiat_p256_subborrowx_u32(&x410, &x411, x409, x392, UINT32_C(0xffffffff)); uint32_t x412; fiat_p256_uint1 x413; fiat_p256_subborrowx_u32(&x412, &x413, x411, x396, 0x0); uint32_t x414; fiat_p256_uint1 x415; fiat_p256_subborrowx_u32(&x414, &x415, x413, x398, 0x0); uint32_t x416; fiat_p256_uint1 x417; fiat_p256_subborrowx_u32(&x416, &x417, x415, x400, 0x0); uint32_t x418; fiat_p256_uint1 x419; fiat_p256_subborrowx_u32(&x418, &x419, x417, x402, 0x1); uint32_t x420; fiat_p256_uint1 x421; fiat_p256_subborrowx_u32(&x420, &x421, x419, x404, UINT32_C(0xffffffff)); uint32_t x422; fiat_p256_uint1 x423; fiat_p256_addcarryx_u32(&x422, &x423, x405, 0x0, x371); uint32_t x424; fiat_p256_uint1 x425; fiat_p256_subborrowx_u32(&x424, &x425, x421, (fiat_p256_uint1)x422, 0x0); uint32_t x426; fiat_p256_cmovznz_u32(&x426, x425, x406, x388); uint32_t x427; fiat_p256_cmovznz_u32(&x427, x425, x408, x390); uint32_t x428; fiat_p256_cmovznz_u32(&x428, x425, x410, x392); uint32_t x429; fiat_p256_cmovznz_u32(&x429, x425, x412, x396); uint32_t x430; fiat_p256_cmovznz_u32(&x430, x425, x414, x398); uint32_t x431; fiat_p256_cmovznz_u32(&x431, x425, x416, x400); uint32_t x432; fiat_p256_cmovznz_u32(&x432, x425, x418, x402); uint32_t x433; fiat_p256_cmovznz_u32(&x433, x425, x420, x404); out1[0] = x426; out1[1] = x427; out1[2] = x428; out1[3] = x429; out1[4] = x430; out1[5] = x431; out1[6] = x432; out1[7] = x433; } /* * Input Bounds: * arg1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * Output Bounds: * out1: [0x0 ~> 0xffffffff] */ static void fiat_p256_nonzero(uint32_t* out1, const uint32_t arg1[8]) { uint32_t x1 = ((arg1[0]) | ((arg1[1]) | ((arg1[2]) | ((arg1[3]) | ((arg1[4]) | ((arg1[5]) | ((arg1[6]) | ((arg1[7]) | (uint32_t)0x0)))))))); *out1 = x1; } /* * Input Bounds: * arg1: [0x0 ~> 0x1] * arg2: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * arg3: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * Output Bounds: * out1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] */ static void fiat_p256_selectznz(uint32_t out1[8], fiat_p256_uint1 arg1, const uint32_t arg2[8], const uint32_t arg3[8]) { uint32_t x1; fiat_p256_cmovznz_u32(&x1, arg1, (arg2[0]), (arg3[0])); uint32_t x2; fiat_p256_cmovznz_u32(&x2, arg1, (arg2[1]), (arg3[1])); uint32_t x3; fiat_p256_cmovznz_u32(&x3, arg1, (arg2[2]), (arg3[2])); uint32_t x4; fiat_p256_cmovznz_u32(&x4, arg1, (arg2[3]), (arg3[3])); uint32_t x5; fiat_p256_cmovznz_u32(&x5, arg1, (arg2[4]), (arg3[4])); uint32_t x6; fiat_p256_cmovznz_u32(&x6, arg1, (arg2[5]), (arg3[5])); uint32_t x7; fiat_p256_cmovznz_u32(&x7, arg1, (arg2[6]), (arg3[6])); uint32_t x8; fiat_p256_cmovznz_u32(&x8, arg1, (arg2[7]), (arg3[7])); out1[0] = x1; out1[1] = x2; out1[2] = x3; out1[3] = x4; out1[4] = x5; out1[5] = x6; out1[6] = x7; out1[7] = x8; } /* * Input Bounds: * arg1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] * Output Bounds: * out1: [[0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff]] */ static void fiat_p256_to_bytes(uint8_t out1[32], const uint32_t arg1[8]) { uint32_t x1 = (arg1[7]); uint32_t x2 = (arg1[6]); uint32_t x3 = (arg1[5]); uint32_t x4 = (arg1[4]); uint32_t x5 = (arg1[3]); uint32_t x6 = (arg1[2]); uint32_t x7 = (arg1[1]); uint32_t x8 = (arg1[0]); uint32_t x9 = (x8 >> 8); uint8_t x10 = (uint8_t)(x8 & UINT8_C(0xff)); uint32_t x11 = (x9 >> 8); uint8_t x12 = (uint8_t)(x9 & UINT8_C(0xff)); uint8_t x13 = (uint8_t)(x11 >> 8); uint8_t x14 = (uint8_t)(x11 & UINT8_C(0xff)); fiat_p256_uint1 x15 = (fiat_p256_uint1)(x13 >> 8); uint8_t x16 = (uint8_t)(x13 & UINT8_C(0xff)); uint32_t x17 = (x15 + x7); uint32_t x18 = (x17 >> 8); uint8_t x19 = (uint8_t)(x17 & UINT8_C(0xff)); uint32_t x20 = (x18 >> 8); uint8_t x21 = (uint8_t)(x18 & UINT8_C(0xff)); uint8_t x22 = (uint8_t)(x20 >> 8); uint8_t x23 = (uint8_t)(x20 & UINT8_C(0xff)); fiat_p256_uint1 x24 = (fiat_p256_uint1)(x22 >> 8); uint8_t x25 = (uint8_t)(x22 & UINT8_C(0xff)); uint32_t x26 = (x24 + x6); uint32_t x27 = (x26 >> 8); uint8_t x28 = (uint8_t)(x26 & UINT8_C(0xff)); uint32_t x29 = (x27 >> 8); uint8_t x30 = (uint8_t)(x27 & UINT8_C(0xff)); uint8_t x31 = (uint8_t)(x29 >> 8); uint8_t x32 = (uint8_t)(x29 & UINT8_C(0xff)); fiat_p256_uint1 x33 = (fiat_p256_uint1)(x31 >> 8); uint8_t x34 = (uint8_t)(x31 & UINT8_C(0xff)); uint32_t x35 = (x33 + x5); uint32_t x36 = (x35 >> 8); uint8_t x37 = (uint8_t)(x35 & UINT8_C(0xff)); uint32_t x38 = (x36 >> 8); uint8_t x39 = (uint8_t)(x36 & UINT8_C(0xff)); uint8_t x40 = (uint8_t)(x38 >> 8); uint8_t x41 = (uint8_t)(x38 & UINT8_C(0xff)); fiat_p256_uint1 x42 = (fiat_p256_uint1)(x40 >> 8); uint8_t x43 = (uint8_t)(x40 & UINT8_C(0xff)); uint32_t x44 = (x42 + x4); uint32_t x45 = (x44 >> 8); uint8_t x46 = (uint8_t)(x44 & UINT8_C(0xff)); uint32_t x47 = (x45 >> 8); uint8_t x48 = (uint8_t)(x45 & UINT8_C(0xff)); uint8_t x49 = (uint8_t)(x47 >> 8); uint8_t x50 = (uint8_t)(x47 & UINT8_C(0xff)); fiat_p256_uint1 x51 = (fiat_p256_uint1)(x49 >> 8); uint8_t x52 = (uint8_t)(x49 & UINT8_C(0xff)); uint32_t x53 = (x51 + x3); uint32_t x54 = (x53 >> 8); uint8_t x55 = (uint8_t)(x53 & UINT8_C(0xff)); uint32_t x56 = (x54 >> 8); uint8_t x57 = (uint8_t)(x54 & UINT8_C(0xff)); uint8_t x58 = (uint8_t)(x56 >> 8); uint8_t x59 = (uint8_t)(x56 & UINT8_C(0xff)); fiat_p256_uint1 x60 = (fiat_p256_uint1)(x58 >> 8); uint8_t x61 = (uint8_t)(x58 & UINT8_C(0xff)); uint32_t x62 = (x60 + x2); uint32_t x63 = (x62 >> 8); uint8_t x64 = (uint8_t)(x62 & UINT8_C(0xff)); uint32_t x65 = (x63 >> 8); uint8_t x66 = (uint8_t)(x63 & UINT8_C(0xff)); uint8_t x67 = (uint8_t)(x65 >> 8); uint8_t x68 = (uint8_t)(x65 & UINT8_C(0xff)); fiat_p256_uint1 x69 = (fiat_p256_uint1)(x67 >> 8); uint8_t x70 = (uint8_t)(x67 & UINT8_C(0xff)); uint32_t x71 = (x69 + x1); uint32_t x72 = (x71 >> 8); uint8_t x73 = (uint8_t)(x71 & UINT8_C(0xff)); uint32_t x74 = (x72 >> 8); uint8_t x75 = (uint8_t)(x72 & UINT8_C(0xff)); uint8_t x76 = (uint8_t)(x74 >> 8); uint8_t x77 = (uint8_t)(x74 & UINT8_C(0xff)); out1[0] = x10; out1[1] = x12; out1[2] = x14; out1[3] = x16; out1[4] = x19; out1[5] = x21; out1[6] = x23; out1[7] = x25; out1[8] = x28; out1[9] = x30; out1[10] = x32; out1[11] = x34; out1[12] = x37; out1[13] = x39; out1[14] = x41; out1[15] = x43; out1[16] = x46; out1[17] = x48; out1[18] = x50; out1[19] = x52; out1[20] = x55; out1[21] = x57; out1[22] = x59; out1[23] = x61; out1[24] = x64; out1[25] = x66; out1[26] = x68; out1[27] = x70; out1[28] = x73; out1[29] = x75; out1[30] = x77; out1[31] = x76; } /* * Input Bounds: * arg1: [[0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff]] * Output Bounds: * out1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] */ static void fiat_p256_from_bytes(uint32_t out1[8], const uint8_t arg1[32]) { uint32_t x1 = ((uint32_t)(arg1[31]) << 24); uint32_t x2 = ((uint32_t)(arg1[30]) << 16); uint32_t x3 = ((uint32_t)(arg1[29]) << 8); uint8_t x4 = (arg1[28]); uint32_t x5 = ((uint32_t)(arg1[27]) << 24); uint32_t x6 = ((uint32_t)(arg1[26]) << 16); uint32_t x7 = ((uint32_t)(arg1[25]) << 8); uint8_t x8 = (arg1[24]); uint32_t x9 = ((uint32_t)(arg1[23]) << 24); uint32_t x10 = ((uint32_t)(arg1[22]) << 16); uint32_t x11 = ((uint32_t)(arg1[21]) << 8); uint8_t x12 = (arg1[20]); uint32_t x13 = ((uint32_t)(arg1[19]) << 24); uint32_t x14 = ((uint32_t)(arg1[18]) << 16); uint32_t x15 = ((uint32_t)(arg1[17]) << 8); uint8_t x16 = (arg1[16]); uint32_t x17 = ((uint32_t)(arg1[15]) << 24); uint32_t x18 = ((uint32_t)(arg1[14]) << 16); uint32_t x19 = ((uint32_t)(arg1[13]) << 8); uint8_t x20 = (arg1[12]); uint32_t x21 = ((uint32_t)(arg1[11]) << 24); uint32_t x22 = ((uint32_t)(arg1[10]) << 16); uint32_t x23 = ((uint32_t)(arg1[9]) << 8); uint8_t x24 = (arg1[8]); uint32_t x25 = ((uint32_t)(arg1[7]) << 24); uint32_t x26 = ((uint32_t)(arg1[6]) << 16); uint32_t x27 = ((uint32_t)(arg1[5]) << 8); uint8_t x28 = (arg1[4]); uint32_t x29 = ((uint32_t)(arg1[3]) << 24); uint32_t x30 = ((uint32_t)(arg1[2]) << 16); uint32_t x31 = ((uint32_t)(arg1[1]) << 8); uint8_t x32 = (arg1[0]); uint32_t x33 = (x32 + (x31 + (x30 + x29))); fiat_p256_uint1 x34 = (fiat_p256_uint1)((uint64_t)x33 >> 32); uint32_t x35 = (x33 & UINT32_C(0xffffffff)); uint32_t x36 = (x4 + (x3 + (x2 + x1))); uint32_t x37 = (x8 + (x7 + (x6 + x5))); uint32_t x38 = (x12 + (x11 + (x10 + x9))); uint32_t x39 = (x16 + (x15 + (x14 + x13))); uint32_t x40 = (x20 + (x19 + (x18 + x17))); uint32_t x41 = (x24 + (x23 + (x22 + x21))); uint32_t x42 = (x28 + (x27 + (x26 + x25))); uint32_t x43 = (x34 + x42); fiat_p256_uint1 x44 = (fiat_p256_uint1)((uint64_t)x43 >> 32); uint32_t x45 = (x43 & UINT32_C(0xffffffff)); uint32_t x46 = (x44 + x41); fiat_p256_uint1 x47 = (fiat_p256_uint1)((uint64_t)x46 >> 32); uint32_t x48 = (x46 & UINT32_C(0xffffffff)); uint32_t x49 = (x47 + x40); fiat_p256_uint1 x50 = (fiat_p256_uint1)((uint64_t)x49 >> 32); uint32_t x51 = (x49 & UINT32_C(0xffffffff)); uint32_t x52 = (x50 + x39); fiat_p256_uint1 x53 = (fiat_p256_uint1)((uint64_t)x52 >> 32); uint32_t x54 = (x52 & UINT32_C(0xffffffff)); uint32_t x55 = (x53 + x38); fiat_p256_uint1 x56 = (fiat_p256_uint1)((uint64_t)x55 >> 32); uint32_t x57 = (x55 & UINT32_C(0xffffffff)); uint32_t x58 = (x56 + x37); fiat_p256_uint1 x59 = (fiat_p256_uint1)((uint64_t)x58 >> 32); uint32_t x60 = (x58 & UINT32_C(0xffffffff)); uint32_t x61 = (x59 + x36); out1[0] = x35; out1[1] = x45; out1[2] = x48; out1[3] = x51; out1[4] = x54; out1[5] = x57; out1[6] = x60; out1[7] = x61; }
the_stack_data/929066.c
#include <stdio.h> #define maxNumber 25 //Sieve of Eratosthenes: 质数筛子,埃拉托色尼筛法 int main() { int isPrime[maxNumber]; int i; int x; for (i = 0; i < maxNumber; i++) { isPrime[i] = 1; } //for test <<< start printf("\t"); for (i = 2; i < maxNumber; i++) { printf("%d\t", i); } printf("\n"); //for test >>> over for ( x = 2; x < maxNumber; x++) { if (isPrime[x]) { for (i = 2; i * x < maxNumber; i++) { isPrime[i * x] = 0; } } //for test <<< start printf("%d\t", x); for (i = 2; i < maxNumber; i++) { printf("%d\t", isPrime[i]); } printf("\n"); //for test >>> over } for (i = 2; i < maxNumber; i++) { if (isPrime[i]) { printf("%d\t", i); } } printf("\n"); return 0; }
the_stack_data/28261682.c
#include <stdio.h> #include <sys/uio.h> #include <sys/stat.h> #include <linux/fs.h> #include <sys/ioctl.h> #include <fcntl.h> #include <stdlib.h> #define BLOCK_SZ 4096 /* * Returns the size of the file whose open file descriptor is passed in. * Properly handles regular file and block devices as well. Pretty. * */ off_t get_file_size(int fd) { struct stat st; if(fstat(fd, &st) < 0) { perror("fstat"); return -1; } if (S_ISBLK(st.st_mode)) { unsigned long long bytes; if (ioctl(fd, BLKGETSIZE64, &bytes) != 0) { perror("ioctl"); return -1; } return bytes; } else if (S_ISREG(st.st_mode)) return st.st_size; return -1; } /* * Output a string of characters of len length to stdout. * We use buffered output here to be efficient, * since we need to output character-by-character. * */ void output_to_console(char *buf, int len) { while (len--) { fputc(*buf++, stdout); } } int read_and_print_file(char *file_name) { struct iovec *iovecs; int file_fd = open(file_name, O_RDONLY); if (file_fd < 0) { perror("open"); return 1; } off_t file_sz = get_file_size(file_fd); off_t bytes_remaining = file_sz; int blocks = (int) file_sz / BLOCK_SZ; if (file_sz % BLOCK_SZ) blocks++; iovecs = malloc(sizeof(struct iovec) * blocks); int current_block = 0; /* * For the file we're reading, allocate enough blocks to be able to hold * the file data. Each block is described in an iovec structure, which is * passed to readv as part of the array of iovecs. * */ while (bytes_remaining) { off_t bytes_to_read = bytes_remaining; if (bytes_to_read > BLOCK_SZ) bytes_to_read = BLOCK_SZ; void *buf; if( posix_memalign(&buf, BLOCK_SZ, BLOCK_SZ)) { perror("posix_memalign"); return 1; } iovecs[current_block].iov_base = buf; iovecs[current_block].iov_len = bytes_to_read; current_block++; bytes_remaining -= bytes_to_read; } /* * The readv() call will block until all iovec buffers are filled with * file data. Once it returns, we should be able to access the file data * from the iovecs and print them on the console. * */ int ret = readv(file_fd, iovecs, blocks); if (ret < 0) { perror("readv"); return 1; } for (int i = 0; i < blocks; i++) output_to_console(iovecs[i].iov_base, iovecs[i].iov_len); return 0; } int main(int argc, char *argv[]) { if (argc < 2) { fprintf(stderr, "Usage: %s <filename1> [<filename2> ...]\n", argv[0]); return 1; } /* * For each file that is passed in as the argument, call the * read_and_print_file() function. * */ for (int i = 1; i < argc; i++) { if(read_and_print_file(argv[i])) { fprintf(stderr, "Error reading file\n"); return 1; } } return 0; }
the_stack_data/200142390.c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_str_is_lowercase.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: lgavalda <[email protected]> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/07/05 15:36:36 by lgavalda #+# #+# */ /* Updated: 2019/07/08 20:58:40 by lgavalda ### ########.fr */ /* */ /* ************************************************************************** */ int ft_str_is_lowercase(char *str) { while (*str) { if (!(*str >= 'a' && *str <= 'z')) { return (0); } str++; } return (1); }
the_stack_data/113401.c
#include <stdio.h> #define MAXLEN 100 int i=1; int j=0; char s[MAXLEN]; int main(){ void itoa1(int ,char []); void itoa2(int ,char []); int n; scanf("%d",&n); if(n<0) { s[0]='-'; n=(-1*n); itoa1(n,s); } else { itoa2(n,s); } printf("%s\n",s); return 0; } void itoa1(int n,char s[]) { if(n/10) itoa1(n/10,s); s[i++]=(n%10+'0'); } void itoa2(int n,char s[]) { if(n/10) itoa2(n/10,s); s[j++]=(n%10+'0'); }
the_stack_data/134347.c
#include <math.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <assert.h> #include <limits.h> #include <stdbool.h> void solve(int n, int k) { if(k == 0) { for(int i = 1; i <= n; i++) { printf("%d ", i); } } else if(k == 1 && n != 3) { for(int i = n; i > 0 && i <= n; i--) { printf("%d ", i); } } else if(k * 2 == n){ for(int i = k+1; i <= n; i++) { printf("%d ", i); } for(int i = 1; i <= k; i++) { printf("%d ", i); } } else { puts("-1"); return; } puts(""); } int main(){ int t; scanf("%d",&t); for(int i = 0; i < t; i++){ int n; int k; scanf("%d %d",&n,&k); solve(n, k); } return 0; }
the_stack_data/200143018.c
#include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "sha256.h" #include <stdlib.h> void sha256csm_hash(const char* input, char* output, uint32_t len) { unsigned char hash[64]; char emptybuffer[112]; memset(emptybuffer, 0, sizeof(emptybuffer)); memcpy(emptybuffer, input, 80); SHA256_CTX ctx_sha256; SHA256_Init(&ctx_sha256); SHA256_Update(&ctx_sha256, emptybuffer, 112); SHA256_Final((unsigned char*)output, &ctx_sha256); SHA256_Init(&ctx_sha256); SHA256_Update(&ctx_sha256, output, 32); SHA256_Final((unsigned char*)output, &ctx_sha256); }
the_stack_data/143849.c
/*Exercise 2 - Selection Write a program to calculate the amount to be paid for a rented vehicle. • Input the distance the van has travelled • The first 30 km is at a rate of 50/= per km. • The remaining distance is calculated at the rate of 40/= per km. e.g. Distance -> 20 Amount = 20 x 50 = 1000 Distance -> 50 Amount = 30 x 50 + (50-30) x 40 = 2300*/ #include <stdio.h> int main() { float amount,distance; printf("Enter the distance that van has travelled in Km"); scanf("%f", & distance); if(distance <= 30){ amount = distance*50; } else{ amount = (30*50)+((distance-30)*40.00); } printf("amount = %.2f",amount); return 0; }
the_stack_data/92329269.c
#include "syscall.h" #include "stdio.h" #include "stdlib.h" char buf[1024]; int fd, fd2, fdread, n, i, j, r; int main() { fdread = open("fileTest.in"); printf( "fileTest.in fd = %d\n", fdread ); i = read(fdread, buf, 1); printf( "number of bytes read = %d\n", i ); n = buf[0]-'0'; printf( "n = %d\n", n ); fd = creat("fileTest.out"); fd2 = creat( "unlink.out" ); printf("fileTest.out fd = %d\n", fd); printf("unlink.out fd = %d\n", fd2); for (i=0; i<n; i++) { for (j=0; j<n; j++) { buf[i * (n + 1) + j] = (char) (j + '0'); } buf[i * (n + 1) + n] = '\n'; } buf[n * (n + 1)] = 'I'; buf[n * (n + 1) + 1] = ' '; buf[n * (n + 1) + 2] = 'L'; buf[n * (n + 1) + 3] = 'O'; buf[n * (n + 1) + 4] = 'V'; buf[n * (n + 1) + 5] = 'E'; buf[n * (n + 1) + 6] = ' '; buf[n * (n + 1) + 7] = 'U'; buf[n * (n + 1) + 8] = '\n'; i = write(fd, buf, n * (n + 1) + 9); printf("number of bytes written = %d\n", i); r = close(fd); printf("close fileTest.out flag: %d\n", r); r = close(fd2); printf("close unlink.out flag: %d\n", r); r = unlink("unlink.out"); printf( "unlink unlink.out flag: %d\n", r ); r = unlink("nonexist.out"); printf( "unlink nonexist.out flag: %d\n", r ); return 0; }
the_stack_data/22432.c
/* * Deoxys-I-256 Reference C Implementation * * Copyright 2016: * Jeremy Jean <[email protected]> * Ivica Nikolic <[email protected]> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * 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., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. * */ #include <stdint.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #define GETRCON(r) ( ((uint32_t)rcon[r]<<24) ^ ((uint32_t)rcon[r]<<16) ^ ((uint32_t)rcon[r]<<8) ^ ((uint32_t)rcon[r]<<0) ) #define GETU32(pt) (((uint32_t)(pt)[0] << 24) ^ ((uint32_t)(pt)[1] << 16) ^ ((uint32_t)(pt)[2] << 8) ^ ((uint32_t)(pt)[3])) #define PUTU32(ct, st) { (ct)[0] = (uint8_t)((st) >> 24); (ct)[1] = (uint8_t)((st) >> 16); (ct)[2] = (uint8_t)((st) >> 8); (ct)[3] = (uint8_t)(st); } static const uint32_t Te0[256] = { 0xc66363a5U, 0xf87c7c84U, 0xee777799U, 0xf67b7b8dU, 0xfff2f20dU, 0xd66b6bbdU, 0xde6f6fb1U, 0x91c5c554U, 0x60303050U, 0x02010103U, 0xce6767a9U, 0x562b2b7dU, 0xe7fefe19U, 0xb5d7d762U, 0x4dababe6U, 0xec76769aU, 0x8fcaca45U, 0x1f82829dU, 0x89c9c940U, 0xfa7d7d87U, 0xeffafa15U, 0xb25959ebU, 0x8e4747c9U, 0xfbf0f00bU, 0x41adadecU, 0xb3d4d467U, 0x5fa2a2fdU, 0x45afafeaU, 0x239c9cbfU, 0x53a4a4f7U, 0xe4727296U, 0x9bc0c05bU, 0x75b7b7c2U, 0xe1fdfd1cU, 0x3d9393aeU, 0x4c26266aU, 0x6c36365aU, 0x7e3f3f41U, 0xf5f7f702U, 0x83cccc4fU, 0x6834345cU, 0x51a5a5f4U, 0xd1e5e534U, 0xf9f1f108U, 0xe2717193U, 0xabd8d873U, 0x62313153U, 0x2a15153fU, 0x0804040cU, 0x95c7c752U, 0x46232365U, 0x9dc3c35eU, 0x30181828U, 0x379696a1U, 0x0a05050fU, 0x2f9a9ab5U, 0x0e070709U, 0x24121236U, 0x1b80809bU, 0xdfe2e23dU, 0xcdebeb26U, 0x4e272769U, 0x7fb2b2cdU, 0xea75759fU, 0x1209091bU, 0x1d83839eU, 0x582c2c74U, 0x341a1a2eU, 0x361b1b2dU, 0xdc6e6eb2U, 0xb45a5aeeU, 0x5ba0a0fbU, 0xa45252f6U, 0x763b3b4dU, 0xb7d6d661U, 0x7db3b3ceU, 0x5229297bU, 0xdde3e33eU, 0x5e2f2f71U, 0x13848497U, 0xa65353f5U, 0xb9d1d168U, 0x00000000U, 0xc1eded2cU, 0x40202060U, 0xe3fcfc1fU, 0x79b1b1c8U, 0xb65b5bedU, 0xd46a6abeU, 0x8dcbcb46U, 0x67bebed9U, 0x7239394bU, 0x944a4adeU, 0x984c4cd4U, 0xb05858e8U, 0x85cfcf4aU, 0xbbd0d06bU, 0xc5efef2aU, 0x4faaaae5U, 0xedfbfb16U, 0x864343c5U, 0x9a4d4dd7U, 0x66333355U, 0x11858594U, 0x8a4545cfU, 0xe9f9f910U, 0x04020206U, 0xfe7f7f81U, 0xa05050f0U, 0x783c3c44U, 0x259f9fbaU, 0x4ba8a8e3U, 0xa25151f3U, 0x5da3a3feU, 0x804040c0U, 0x058f8f8aU, 0x3f9292adU, 0x219d9dbcU, 0x70383848U, 0xf1f5f504U, 0x63bcbcdfU, 0x77b6b6c1U, 0xafdada75U, 0x42212163U, 0x20101030U, 0xe5ffff1aU, 0xfdf3f30eU, 0xbfd2d26dU, 0x81cdcd4cU, 0x180c0c14U, 0x26131335U, 0xc3ecec2fU, 0xbe5f5fe1U, 0x359797a2U, 0x884444ccU, 0x2e171739U, 0x93c4c457U, 0x55a7a7f2U, 0xfc7e7e82U, 0x7a3d3d47U, 0xc86464acU, 0xba5d5de7U, 0x3219192bU, 0xe6737395U, 0xc06060a0U, 0x19818198U, 0x9e4f4fd1U, 0xa3dcdc7fU, 0x44222266U, 0x542a2a7eU, 0x3b9090abU, 0x0b888883U, 0x8c4646caU, 0xc7eeee29U, 0x6bb8b8d3U, 0x2814143cU, 0xa7dede79U, 0xbc5e5ee2U, 0x160b0b1dU, 0xaddbdb76U, 0xdbe0e03bU, 0x64323256U, 0x743a3a4eU, 0x140a0a1eU, 0x924949dbU, 0x0c06060aU, 0x4824246cU, 0xb85c5ce4U, 0x9fc2c25dU, 0xbdd3d36eU, 0x43acacefU, 0xc46262a6U, 0x399191a8U, 0x319595a4U, 0xd3e4e437U, 0xf279798bU, 0xd5e7e732U, 0x8bc8c843U, 0x6e373759U, 0xda6d6db7U, 0x018d8d8cU, 0xb1d5d564U, 0x9c4e4ed2U, 0x49a9a9e0U, 0xd86c6cb4U, 0xac5656faU, 0xf3f4f407U, 0xcfeaea25U, 0xca6565afU, 0xf47a7a8eU, 0x47aeaee9U, 0x10080818U, 0x6fbabad5U, 0xf0787888U, 0x4a25256fU, 0x5c2e2e72U, 0x381c1c24U, 0x57a6a6f1U, 0x73b4b4c7U, 0x97c6c651U, 0xcbe8e823U, 0xa1dddd7cU, 0xe874749cU, 0x3e1f1f21U, 0x964b4bddU, 0x61bdbddcU, 0x0d8b8b86U, 0x0f8a8a85U, 0xe0707090U, 0x7c3e3e42U, 0x71b5b5c4U, 0xcc6666aaU, 0x904848d8U, 0x06030305U, 0xf7f6f601U, 0x1c0e0e12U, 0xc26161a3U, 0x6a35355fU, 0xae5757f9U, 0x69b9b9d0U, 0x17868691U, 0x99c1c158U, 0x3a1d1d27U, 0x279e9eb9U, 0xd9e1e138U, 0xebf8f813U, 0x2b9898b3U, 0x22111133U, 0xd26969bbU, 0xa9d9d970U, 0x078e8e89U, 0x339494a7U, 0x2d9b9bb6U, 0x3c1e1e22U, 0x15878792U, 0xc9e9e920U, 0x87cece49U, 0xaa5555ffU, 0x50282878U, 0xa5dfdf7aU, 0x038c8c8fU, 0x59a1a1f8U, 0x09898980U, 0x1a0d0d17U, 0x65bfbfdaU, 0xd7e6e631U, 0x844242c6U, 0xd06868b8U, 0x824141c3U, 0x299999b0U, 0x5a2d2d77U, 0x1e0f0f11U, 0x7bb0b0cbU, 0xa85454fcU, 0x6dbbbbd6U, 0x2c16163aU, }; static const uint32_t Te1[256] = { 0xa5c66363U, 0x84f87c7cU, 0x99ee7777U, 0x8df67b7bU, 0x0dfff2f2U, 0xbdd66b6bU, 0xb1de6f6fU, 0x5491c5c5U, 0x50603030U, 0x03020101U, 0xa9ce6767U, 0x7d562b2bU, 0x19e7fefeU, 0x62b5d7d7U, 0xe64dababU, 0x9aec7676U, 0x458fcacaU, 0x9d1f8282U, 0x4089c9c9U, 0x87fa7d7dU, 0x15effafaU, 0xebb25959U, 0xc98e4747U, 0x0bfbf0f0U, 0xec41adadU, 0x67b3d4d4U, 0xfd5fa2a2U, 0xea45afafU, 0xbf239c9cU, 0xf753a4a4U, 0x96e47272U, 0x5b9bc0c0U, 0xc275b7b7U, 0x1ce1fdfdU, 0xae3d9393U, 0x6a4c2626U, 0x5a6c3636U, 0x417e3f3fU, 0x02f5f7f7U, 0x4f83ccccU, 0x5c683434U, 0xf451a5a5U, 0x34d1e5e5U, 0x08f9f1f1U, 0x93e27171U, 0x73abd8d8U, 0x53623131U, 0x3f2a1515U, 0x0c080404U, 0x5295c7c7U, 0x65462323U, 0x5e9dc3c3U, 0x28301818U, 0xa1379696U, 0x0f0a0505U, 0xb52f9a9aU, 0x090e0707U, 0x36241212U, 0x9b1b8080U, 0x3ddfe2e2U, 0x26cdebebU, 0x694e2727U, 0xcd7fb2b2U, 0x9fea7575U, 0x1b120909U, 0x9e1d8383U, 0x74582c2cU, 0x2e341a1aU, 0x2d361b1bU, 0xb2dc6e6eU, 0xeeb45a5aU, 0xfb5ba0a0U, 0xf6a45252U, 0x4d763b3bU, 0x61b7d6d6U, 0xce7db3b3U, 0x7b522929U, 0x3edde3e3U, 0x715e2f2fU, 0x97138484U, 0xf5a65353U, 0x68b9d1d1U, 0x00000000U, 0x2cc1ededU, 0x60402020U, 0x1fe3fcfcU, 0xc879b1b1U, 0xedb65b5bU, 0xbed46a6aU, 0x468dcbcbU, 0xd967bebeU, 0x4b723939U, 0xde944a4aU, 0xd4984c4cU, 0xe8b05858U, 0x4a85cfcfU, 0x6bbbd0d0U, 0x2ac5efefU, 0xe54faaaaU, 0x16edfbfbU, 0xc5864343U, 0xd79a4d4dU, 0x55663333U, 0x94118585U, 0xcf8a4545U, 0x10e9f9f9U, 0x06040202U, 0x81fe7f7fU, 0xf0a05050U, 0x44783c3cU, 0xba259f9fU, 0xe34ba8a8U, 0xf3a25151U, 0xfe5da3a3U, 0xc0804040U, 0x8a058f8fU, 0xad3f9292U, 0xbc219d9dU, 0x48703838U, 0x04f1f5f5U, 0xdf63bcbcU, 0xc177b6b6U, 0x75afdadaU, 0x63422121U, 0x30201010U, 0x1ae5ffffU, 0x0efdf3f3U, 0x6dbfd2d2U, 0x4c81cdcdU, 0x14180c0cU, 0x35261313U, 0x2fc3ececU, 0xe1be5f5fU, 0xa2359797U, 0xcc884444U, 0x392e1717U, 0x5793c4c4U, 0xf255a7a7U, 0x82fc7e7eU, 0x477a3d3dU, 0xacc86464U, 0xe7ba5d5dU, 0x2b321919U, 0x95e67373U, 0xa0c06060U, 0x98198181U, 0xd19e4f4fU, 0x7fa3dcdcU, 0x66442222U, 0x7e542a2aU, 0xab3b9090U, 0x830b8888U, 0xca8c4646U, 0x29c7eeeeU, 0xd36bb8b8U, 0x3c281414U, 0x79a7dedeU, 0xe2bc5e5eU, 0x1d160b0bU, 0x76addbdbU, 0x3bdbe0e0U, 0x56643232U, 0x4e743a3aU, 0x1e140a0aU, 0xdb924949U, 0x0a0c0606U, 0x6c482424U, 0xe4b85c5cU, 0x5d9fc2c2U, 0x6ebdd3d3U, 0xef43acacU, 0xa6c46262U, 0xa8399191U, 0xa4319595U, 0x37d3e4e4U, 0x8bf27979U, 0x32d5e7e7U, 0x438bc8c8U, 0x596e3737U, 0xb7da6d6dU, 0x8c018d8dU, 0x64b1d5d5U, 0xd29c4e4eU, 0xe049a9a9U, 0xb4d86c6cU, 0xfaac5656U, 0x07f3f4f4U, 0x25cfeaeaU, 0xafca6565U, 0x8ef47a7aU, 0xe947aeaeU, 0x18100808U, 0xd56fbabaU, 0x88f07878U, 0x6f4a2525U, 0x725c2e2eU, 0x24381c1cU, 0xf157a6a6U, 0xc773b4b4U, 0x5197c6c6U, 0x23cbe8e8U, 0x7ca1ddddU, 0x9ce87474U, 0x213e1f1fU, 0xdd964b4bU, 0xdc61bdbdU, 0x860d8b8bU, 0x850f8a8aU, 0x90e07070U, 0x427c3e3eU, 0xc471b5b5U, 0xaacc6666U, 0xd8904848U, 0x05060303U, 0x01f7f6f6U, 0x121c0e0eU, 0xa3c26161U, 0x5f6a3535U, 0xf9ae5757U, 0xd069b9b9U, 0x91178686U, 0x5899c1c1U, 0x273a1d1dU, 0xb9279e9eU, 0x38d9e1e1U, 0x13ebf8f8U, 0xb32b9898U, 0x33221111U, 0xbbd26969U, 0x70a9d9d9U, 0x89078e8eU, 0xa7339494U, 0xb62d9b9bU, 0x223c1e1eU, 0x92158787U, 0x20c9e9e9U, 0x4987ceceU, 0xffaa5555U, 0x78502828U, 0x7aa5dfdfU, 0x8f038c8cU, 0xf859a1a1U, 0x80098989U, 0x171a0d0dU, 0xda65bfbfU, 0x31d7e6e6U, 0xc6844242U, 0xb8d06868U, 0xc3824141U, 0xb0299999U, 0x775a2d2dU, 0x111e0f0fU, 0xcb7bb0b0U, 0xfca85454U, 0xd66dbbbbU, 0x3a2c1616U, }; static const uint32_t Te2[256] = { 0x63a5c663U, 0x7c84f87cU, 0x7799ee77U, 0x7b8df67bU, 0xf20dfff2U, 0x6bbdd66bU, 0x6fb1de6fU, 0xc55491c5U, 0x30506030U, 0x01030201U, 0x67a9ce67U, 0x2b7d562bU, 0xfe19e7feU, 0xd762b5d7U, 0xabe64dabU, 0x769aec76U, 0xca458fcaU, 0x829d1f82U, 0xc94089c9U, 0x7d87fa7dU, 0xfa15effaU, 0x59ebb259U, 0x47c98e47U, 0xf00bfbf0U, 0xadec41adU, 0xd467b3d4U, 0xa2fd5fa2U, 0xafea45afU, 0x9cbf239cU, 0xa4f753a4U, 0x7296e472U, 0xc05b9bc0U, 0xb7c275b7U, 0xfd1ce1fdU, 0x93ae3d93U, 0x266a4c26U, 0x365a6c36U, 0x3f417e3fU, 0xf702f5f7U, 0xcc4f83ccU, 0x345c6834U, 0xa5f451a5U, 0xe534d1e5U, 0xf108f9f1U, 0x7193e271U, 0xd873abd8U, 0x31536231U, 0x153f2a15U, 0x040c0804U, 0xc75295c7U, 0x23654623U, 0xc35e9dc3U, 0x18283018U, 0x96a13796U, 0x050f0a05U, 0x9ab52f9aU, 0x07090e07U, 0x12362412U, 0x809b1b80U, 0xe23ddfe2U, 0xeb26cdebU, 0x27694e27U, 0xb2cd7fb2U, 0x759fea75U, 0x091b1209U, 0x839e1d83U, 0x2c74582cU, 0x1a2e341aU, 0x1b2d361bU, 0x6eb2dc6eU, 0x5aeeb45aU, 0xa0fb5ba0U, 0x52f6a452U, 0x3b4d763bU, 0xd661b7d6U, 0xb3ce7db3U, 0x297b5229U, 0xe33edde3U, 0x2f715e2fU, 0x84971384U, 0x53f5a653U, 0xd168b9d1U, 0x00000000U, 0xed2cc1edU, 0x20604020U, 0xfc1fe3fcU, 0xb1c879b1U, 0x5bedb65bU, 0x6abed46aU, 0xcb468dcbU, 0xbed967beU, 0x394b7239U, 0x4ade944aU, 0x4cd4984cU, 0x58e8b058U, 0xcf4a85cfU, 0xd06bbbd0U, 0xef2ac5efU, 0xaae54faaU, 0xfb16edfbU, 0x43c58643U, 0x4dd79a4dU, 0x33556633U, 0x85941185U, 0x45cf8a45U, 0xf910e9f9U, 0x02060402U, 0x7f81fe7fU, 0x50f0a050U, 0x3c44783cU, 0x9fba259fU, 0xa8e34ba8U, 0x51f3a251U, 0xa3fe5da3U, 0x40c08040U, 0x8f8a058fU, 0x92ad3f92U, 0x9dbc219dU, 0x38487038U, 0xf504f1f5U, 0xbcdf63bcU, 0xb6c177b6U, 0xda75afdaU, 0x21634221U, 0x10302010U, 0xff1ae5ffU, 0xf30efdf3U, 0xd26dbfd2U, 0xcd4c81cdU, 0x0c14180cU, 0x13352613U, 0xec2fc3ecU, 0x5fe1be5fU, 0x97a23597U, 0x44cc8844U, 0x17392e17U, 0xc45793c4U, 0xa7f255a7U, 0x7e82fc7eU, 0x3d477a3dU, 0x64acc864U, 0x5de7ba5dU, 0x192b3219U, 0x7395e673U, 0x60a0c060U, 0x81981981U, 0x4fd19e4fU, 0xdc7fa3dcU, 0x22664422U, 0x2a7e542aU, 0x90ab3b90U, 0x88830b88U, 0x46ca8c46U, 0xee29c7eeU, 0xb8d36bb8U, 0x143c2814U, 0xde79a7deU, 0x5ee2bc5eU, 0x0b1d160bU, 0xdb76addbU, 0xe03bdbe0U, 0x32566432U, 0x3a4e743aU, 0x0a1e140aU, 0x49db9249U, 0x060a0c06U, 0x246c4824U, 0x5ce4b85cU, 0xc25d9fc2U, 0xd36ebdd3U, 0xacef43acU, 0x62a6c462U, 0x91a83991U, 0x95a43195U, 0xe437d3e4U, 0x798bf279U, 0xe732d5e7U, 0xc8438bc8U, 0x37596e37U, 0x6db7da6dU, 0x8d8c018dU, 0xd564b1d5U, 0x4ed29c4eU, 0xa9e049a9U, 0x6cb4d86cU, 0x56faac56U, 0xf407f3f4U, 0xea25cfeaU, 0x65afca65U, 0x7a8ef47aU, 0xaee947aeU, 0x08181008U, 0xbad56fbaU, 0x7888f078U, 0x256f4a25U, 0x2e725c2eU, 0x1c24381cU, 0xa6f157a6U, 0xb4c773b4U, 0xc65197c6U, 0xe823cbe8U, 0xdd7ca1ddU, 0x749ce874U, 0x1f213e1fU, 0x4bdd964bU, 0xbddc61bdU, 0x8b860d8bU, 0x8a850f8aU, 0x7090e070U, 0x3e427c3eU, 0xb5c471b5U, 0x66aacc66U, 0x48d89048U, 0x03050603U, 0xf601f7f6U, 0x0e121c0eU, 0x61a3c261U, 0x355f6a35U, 0x57f9ae57U, 0xb9d069b9U, 0x86911786U, 0xc15899c1U, 0x1d273a1dU, 0x9eb9279eU, 0xe138d9e1U, 0xf813ebf8U, 0x98b32b98U, 0x11332211U, 0x69bbd269U, 0xd970a9d9U, 0x8e89078eU, 0x94a73394U, 0x9bb62d9bU, 0x1e223c1eU, 0x87921587U, 0xe920c9e9U, 0xce4987ceU, 0x55ffaa55U, 0x28785028U, 0xdf7aa5dfU, 0x8c8f038cU, 0xa1f859a1U, 0x89800989U, 0x0d171a0dU, 0xbfda65bfU, 0xe631d7e6U, 0x42c68442U, 0x68b8d068U, 0x41c38241U, 0x99b02999U, 0x2d775a2dU, 0x0f111e0fU, 0xb0cb7bb0U, 0x54fca854U, 0xbbd66dbbU, 0x163a2c16U, }; static const uint32_t Te3[256] = { 0x6363a5c6U, 0x7c7c84f8U, 0x777799eeU, 0x7b7b8df6U, 0xf2f20dffU, 0x6b6bbdd6U, 0x6f6fb1deU, 0xc5c55491U, 0x30305060U, 0x01010302U, 0x6767a9ceU, 0x2b2b7d56U, 0xfefe19e7U, 0xd7d762b5U, 0xababe64dU, 0x76769aecU, 0xcaca458fU, 0x82829d1fU, 0xc9c94089U, 0x7d7d87faU, 0xfafa15efU, 0x5959ebb2U, 0x4747c98eU, 0xf0f00bfbU, 0xadadec41U, 0xd4d467b3U, 0xa2a2fd5fU, 0xafafea45U, 0x9c9cbf23U, 0xa4a4f753U, 0x727296e4U, 0xc0c05b9bU, 0xb7b7c275U, 0xfdfd1ce1U, 0x9393ae3dU, 0x26266a4cU, 0x36365a6cU, 0x3f3f417eU, 0xf7f702f5U, 0xcccc4f83U, 0x34345c68U, 0xa5a5f451U, 0xe5e534d1U, 0xf1f108f9U, 0x717193e2U, 0xd8d873abU, 0x31315362U, 0x15153f2aU, 0x04040c08U, 0xc7c75295U, 0x23236546U, 0xc3c35e9dU, 0x18182830U, 0x9696a137U, 0x05050f0aU, 0x9a9ab52fU, 0x0707090eU, 0x12123624U, 0x80809b1bU, 0xe2e23ddfU, 0xebeb26cdU, 0x2727694eU, 0xb2b2cd7fU, 0x75759feaU, 0x09091b12U, 0x83839e1dU, 0x2c2c7458U, 0x1a1a2e34U, 0x1b1b2d36U, 0x6e6eb2dcU, 0x5a5aeeb4U, 0xa0a0fb5bU, 0x5252f6a4U, 0x3b3b4d76U, 0xd6d661b7U, 0xb3b3ce7dU, 0x29297b52U, 0xe3e33eddU, 0x2f2f715eU, 0x84849713U, 0x5353f5a6U, 0xd1d168b9U, 0x00000000U, 0xeded2cc1U, 0x20206040U, 0xfcfc1fe3U, 0xb1b1c879U, 0x5b5bedb6U, 0x6a6abed4U, 0xcbcb468dU, 0xbebed967U, 0x39394b72U, 0x4a4ade94U, 0x4c4cd498U, 0x5858e8b0U, 0xcfcf4a85U, 0xd0d06bbbU, 0xefef2ac5U, 0xaaaae54fU, 0xfbfb16edU, 0x4343c586U, 0x4d4dd79aU, 0x33335566U, 0x85859411U, 0x4545cf8aU, 0xf9f910e9U, 0x02020604U, 0x7f7f81feU, 0x5050f0a0U, 0x3c3c4478U, 0x9f9fba25U, 0xa8a8e34bU, 0x5151f3a2U, 0xa3a3fe5dU, 0x4040c080U, 0x8f8f8a05U, 0x9292ad3fU, 0x9d9dbc21U, 0x38384870U, 0xf5f504f1U, 0xbcbcdf63U, 0xb6b6c177U, 0xdada75afU, 0x21216342U, 0x10103020U, 0xffff1ae5U, 0xf3f30efdU, 0xd2d26dbfU, 0xcdcd4c81U, 0x0c0c1418U, 0x13133526U, 0xecec2fc3U, 0x5f5fe1beU, 0x9797a235U, 0x4444cc88U, 0x1717392eU, 0xc4c45793U, 0xa7a7f255U, 0x7e7e82fcU, 0x3d3d477aU, 0x6464acc8U, 0x5d5de7baU, 0x19192b32U, 0x737395e6U, 0x6060a0c0U, 0x81819819U, 0x4f4fd19eU, 0xdcdc7fa3U, 0x22226644U, 0x2a2a7e54U, 0x9090ab3bU, 0x8888830bU, 0x4646ca8cU, 0xeeee29c7U, 0xb8b8d36bU, 0x14143c28U, 0xdede79a7U, 0x5e5ee2bcU, 0x0b0b1d16U, 0xdbdb76adU, 0xe0e03bdbU, 0x32325664U, 0x3a3a4e74U, 0x0a0a1e14U, 0x4949db92U, 0x06060a0cU, 0x24246c48U, 0x5c5ce4b8U, 0xc2c25d9fU, 0xd3d36ebdU, 0xacacef43U, 0x6262a6c4U, 0x9191a839U, 0x9595a431U, 0xe4e437d3U, 0x79798bf2U, 0xe7e732d5U, 0xc8c8438bU, 0x3737596eU, 0x6d6db7daU, 0x8d8d8c01U, 0xd5d564b1U, 0x4e4ed29cU, 0xa9a9e049U, 0x6c6cb4d8U, 0x5656faacU, 0xf4f407f3U, 0xeaea25cfU, 0x6565afcaU, 0x7a7a8ef4U, 0xaeaee947U, 0x08081810U, 0xbabad56fU, 0x787888f0U, 0x25256f4aU, 0x2e2e725cU, 0x1c1c2438U, 0xa6a6f157U, 0xb4b4c773U, 0xc6c65197U, 0xe8e823cbU, 0xdddd7ca1U, 0x74749ce8U, 0x1f1f213eU, 0x4b4bdd96U, 0xbdbddc61U, 0x8b8b860dU, 0x8a8a850fU, 0x707090e0U, 0x3e3e427cU, 0xb5b5c471U, 0x6666aaccU, 0x4848d890U, 0x03030506U, 0xf6f601f7U, 0x0e0e121cU, 0x6161a3c2U, 0x35355f6aU, 0x5757f9aeU, 0xb9b9d069U, 0x86869117U, 0xc1c15899U, 0x1d1d273aU, 0x9e9eb927U, 0xe1e138d9U, 0xf8f813ebU, 0x9898b32bU, 0x11113322U, 0x6969bbd2U, 0xd9d970a9U, 0x8e8e8907U, 0x9494a733U, 0x9b9bb62dU, 0x1e1e223cU, 0x87879215U, 0xe9e920c9U, 0xcece4987U, 0x5555ffaaU, 0x28287850U, 0xdfdf7aa5U, 0x8c8c8f03U, 0xa1a1f859U, 0x89898009U, 0x0d0d171aU, 0xbfbfda65U, 0xe6e631d7U, 0x4242c684U, 0x6868b8d0U, 0x4141c382U, 0x9999b029U, 0x2d2d775aU, 0x0f0f111eU, 0xb0b0cb7bU, 0x5454fca8U, 0xbbbbd66dU, 0x16163a2cU, }; static const uint32_t Te4[256] = { 0x63636363U, 0x7c7c7c7cU, 0x77777777U, 0x7b7b7b7bU, 0xf2f2f2f2U, 0x6b6b6b6bU, 0x6f6f6f6fU, 0xc5c5c5c5U, 0x30303030U, 0x01010101U, 0x67676767U, 0x2b2b2b2bU, 0xfefefefeU, 0xd7d7d7d7U, 0xababababU, 0x76767676U, 0xcacacacaU, 0x82828282U, 0xc9c9c9c9U, 0x7d7d7d7dU, 0xfafafafaU, 0x59595959U, 0x47474747U, 0xf0f0f0f0U, 0xadadadadU, 0xd4d4d4d4U, 0xa2a2a2a2U, 0xafafafafU, 0x9c9c9c9cU, 0xa4a4a4a4U, 0x72727272U, 0xc0c0c0c0U, 0xb7b7b7b7U, 0xfdfdfdfdU, 0x93939393U, 0x26262626U, 0x36363636U, 0x3f3f3f3fU, 0xf7f7f7f7U, 0xccccccccU, 0x34343434U, 0xa5a5a5a5U, 0xe5e5e5e5U, 0xf1f1f1f1U, 0x71717171U, 0xd8d8d8d8U, 0x31313131U, 0x15151515U, 0x04040404U, 0xc7c7c7c7U, 0x23232323U, 0xc3c3c3c3U, 0x18181818U, 0x96969696U, 0x05050505U, 0x9a9a9a9aU, 0x07070707U, 0x12121212U, 0x80808080U, 0xe2e2e2e2U, 0xebebebebU, 0x27272727U, 0xb2b2b2b2U, 0x75757575U, 0x09090909U, 0x83838383U, 0x2c2c2c2cU, 0x1a1a1a1aU, 0x1b1b1b1bU, 0x6e6e6e6eU, 0x5a5a5a5aU, 0xa0a0a0a0U, 0x52525252U, 0x3b3b3b3bU, 0xd6d6d6d6U, 0xb3b3b3b3U, 0x29292929U, 0xe3e3e3e3U, 0x2f2f2f2fU, 0x84848484U, 0x53535353U, 0xd1d1d1d1U, 0x00000000U, 0xededededU, 0x20202020U, 0xfcfcfcfcU, 0xb1b1b1b1U, 0x5b5b5b5bU, 0x6a6a6a6aU, 0xcbcbcbcbU, 0xbebebebeU, 0x39393939U, 0x4a4a4a4aU, 0x4c4c4c4cU, 0x58585858U, 0xcfcfcfcfU, 0xd0d0d0d0U, 0xefefefefU, 0xaaaaaaaaU, 0xfbfbfbfbU, 0x43434343U, 0x4d4d4d4dU, 0x33333333U, 0x85858585U, 0x45454545U, 0xf9f9f9f9U, 0x02020202U, 0x7f7f7f7fU, 0x50505050U, 0x3c3c3c3cU, 0x9f9f9f9fU, 0xa8a8a8a8U, 0x51515151U, 0xa3a3a3a3U, 0x40404040U, 0x8f8f8f8fU, 0x92929292U, 0x9d9d9d9dU, 0x38383838U, 0xf5f5f5f5U, 0xbcbcbcbcU, 0xb6b6b6b6U, 0xdadadadaU, 0x21212121U, 0x10101010U, 0xffffffffU, 0xf3f3f3f3U, 0xd2d2d2d2U, 0xcdcdcdcdU, 0x0c0c0c0cU, 0x13131313U, 0xececececU, 0x5f5f5f5fU, 0x97979797U, 0x44444444U, 0x17171717U, 0xc4c4c4c4U, 0xa7a7a7a7U, 0x7e7e7e7eU, 0x3d3d3d3dU, 0x64646464U, 0x5d5d5d5dU, 0x19191919U, 0x73737373U, 0x60606060U, 0x81818181U, 0x4f4f4f4fU, 0xdcdcdcdcU, 0x22222222U, 0x2a2a2a2aU, 0x90909090U, 0x88888888U, 0x46464646U, 0xeeeeeeeeU, 0xb8b8b8b8U, 0x14141414U, 0xdedededeU, 0x5e5e5e5eU, 0x0b0b0b0bU, 0xdbdbdbdbU, 0xe0e0e0e0U, 0x32323232U, 0x3a3a3a3aU, 0x0a0a0a0aU, 0x49494949U, 0x06060606U, 0x24242424U, 0x5c5c5c5cU, 0xc2c2c2c2U, 0xd3d3d3d3U, 0xacacacacU, 0x62626262U, 0x91919191U, 0x95959595U, 0xe4e4e4e4U, 0x79797979U, 0xe7e7e7e7U, 0xc8c8c8c8U, 0x37373737U, 0x6d6d6d6dU, 0x8d8d8d8dU, 0xd5d5d5d5U, 0x4e4e4e4eU, 0xa9a9a9a9U, 0x6c6c6c6cU, 0x56565656U, 0xf4f4f4f4U, 0xeaeaeaeaU, 0x65656565U, 0x7a7a7a7aU, 0xaeaeaeaeU, 0x08080808U, 0xbabababaU, 0x78787878U, 0x25252525U, 0x2e2e2e2eU, 0x1c1c1c1cU, 0xa6a6a6a6U, 0xb4b4b4b4U, 0xc6c6c6c6U, 0xe8e8e8e8U, 0xddddddddU, 0x74747474U, 0x1f1f1f1fU, 0x4b4b4b4bU, 0xbdbdbdbdU, 0x8b8b8b8bU, 0x8a8a8a8aU, 0x70707070U, 0x3e3e3e3eU, 0xb5b5b5b5U, 0x66666666U, 0x48484848U, 0x03030303U, 0xf6f6f6f6U, 0x0e0e0e0eU, 0x61616161U, 0x35353535U, 0x57575757U, 0xb9b9b9b9U, 0x86868686U, 0xc1c1c1c1U, 0x1d1d1d1dU, 0x9e9e9e9eU, 0xe1e1e1e1U, 0xf8f8f8f8U, 0x98989898U, 0x11111111U, 0x69696969U, 0xd9d9d9d9U, 0x8e8e8e8eU, 0x94949494U, 0x9b9b9b9bU, 0x1e1e1e1eU, 0x87878787U, 0xe9e9e9e9U, 0xcecececeU, 0x55555555U, 0x28282828U, 0xdfdfdfdfU, 0x8c8c8c8cU, 0xa1a1a1a1U, 0x89898989U, 0x0d0d0d0dU, 0xbfbfbfbfU, 0xe6e6e6e6U, 0x42424242U, 0x68686868U, 0x41414141U, 0x99999999U, 0x2d2d2d2dU, 0x0f0f0f0fU, 0xb0b0b0b0U, 0x54545454U, 0xbbbbbbbbU, 0x16161616U, }; static const uint32_t Td0[256] = { 0x51f4a750U, 0x7e416553U, 0x1a17a4c3U, 0x3a275e96U, 0x3bab6bcbU, 0x1f9d45f1U, 0xacfa58abU, 0x4be30393U, 0x2030fa55U, 0xad766df6U, 0x88cc7691U, 0xf5024c25U, 0x4fe5d7fcU, 0xc52acbd7U, 0x26354480U, 0xb562a38fU, 0xdeb15a49U, 0x25ba1b67U, 0x45ea0e98U, 0x5dfec0e1U, 0xc32f7502U, 0x814cf012U, 0x8d4697a3U, 0x6bd3f9c6U, 0x038f5fe7U, 0x15929c95U, 0xbf6d7aebU, 0x955259daU, 0xd4be832dU, 0x587421d3U, 0x49e06929U, 0x8ec9c844U, 0x75c2896aU, 0xf48e7978U, 0x99583e6bU, 0x27b971ddU, 0xbee14fb6U, 0xf088ad17U, 0xc920ac66U, 0x7dce3ab4U, 0x63df4a18U, 0xe51a3182U, 0x97513360U, 0x62537f45U, 0xb16477e0U, 0xbb6bae84U, 0xfe81a01cU, 0xf9082b94U, 0x70486858U, 0x8f45fd19U, 0x94de6c87U, 0x527bf8b7U, 0xab73d323U, 0x724b02e2U, 0xe31f8f57U, 0x6655ab2aU, 0xb2eb2807U, 0x2fb5c203U, 0x86c57b9aU, 0xd33708a5U, 0x302887f2U, 0x23bfa5b2U, 0x02036abaU, 0xed16825cU, 0x8acf1c2bU, 0xa779b492U, 0xf307f2f0U, 0x4e69e2a1U, 0x65daf4cdU, 0x0605bed5U, 0xd134621fU, 0xc4a6fe8aU, 0x342e539dU, 0xa2f355a0U, 0x058ae132U, 0xa4f6eb75U, 0x0b83ec39U, 0x4060efaaU, 0x5e719f06U, 0xbd6e1051U, 0x3e218af9U, 0x96dd063dU, 0xdd3e05aeU, 0x4de6bd46U, 0x91548db5U, 0x71c45d05U, 0x0406d46fU, 0x605015ffU, 0x1998fb24U, 0xd6bde997U, 0x894043ccU, 0x67d99e77U, 0xb0e842bdU, 0x07898b88U, 0xe7195b38U, 0x79c8eedbU, 0xa17c0a47U, 0x7c420fe9U, 0xf8841ec9U, 0x00000000U, 0x09808683U, 0x322bed48U, 0x1e1170acU, 0x6c5a724eU, 0xfd0efffbU, 0x0f853856U, 0x3daed51eU, 0x362d3927U, 0x0a0fd964U, 0x685ca621U, 0x9b5b54d1U, 0x24362e3aU, 0x0c0a67b1U, 0x9357e70fU, 0xb4ee96d2U, 0x1b9b919eU, 0x80c0c54fU, 0x61dc20a2U, 0x5a774b69U, 0x1c121a16U, 0xe293ba0aU, 0xc0a02ae5U, 0x3c22e043U, 0x121b171dU, 0x0e090d0bU, 0xf28bc7adU, 0x2db6a8b9U, 0x141ea9c8U, 0x57f11985U, 0xaf75074cU, 0xee99ddbbU, 0xa37f60fdU, 0xf701269fU, 0x5c72f5bcU, 0x44663bc5U, 0x5bfb7e34U, 0x8b432976U, 0xcb23c6dcU, 0xb6edfc68U, 0xb8e4f163U, 0xd731dccaU, 0x42638510U, 0x13972240U, 0x84c61120U, 0x854a247dU, 0xd2bb3df8U, 0xaef93211U, 0xc729a16dU, 0x1d9e2f4bU, 0xdcb230f3U, 0x0d8652ecU, 0x77c1e3d0U, 0x2bb3166cU, 0xa970b999U, 0x119448faU, 0x47e96422U, 0xa8fc8cc4U, 0xa0f03f1aU, 0x567d2cd8U, 0x223390efU, 0x87494ec7U, 0xd938d1c1U, 0x8ccaa2feU, 0x98d40b36U, 0xa6f581cfU, 0xa57ade28U, 0xdab78e26U, 0x3fadbfa4U, 0x2c3a9de4U, 0x5078920dU, 0x6a5fcc9bU, 0x547e4662U, 0xf68d13c2U, 0x90d8b8e8U, 0x2e39f75eU, 0x82c3aff5U, 0x9f5d80beU, 0x69d0937cU, 0x6fd52da9U, 0xcf2512b3U, 0xc8ac993bU, 0x10187da7U, 0xe89c636eU, 0xdb3bbb7bU, 0xcd267809U, 0x6e5918f4U, 0xec9ab701U, 0x834f9aa8U, 0xe6956e65U, 0xaaffe67eU, 0x21bccf08U, 0xef15e8e6U, 0xbae79bd9U, 0x4a6f36ceU, 0xea9f09d4U, 0x29b07cd6U, 0x31a4b2afU, 0x2a3f2331U, 0xc6a59430U, 0x35a266c0U, 0x744ebc37U, 0xfc82caa6U, 0xe090d0b0U, 0x33a7d815U, 0xf104984aU, 0x41ecdaf7U, 0x7fcd500eU, 0x1791f62fU, 0x764dd68dU, 0x43efb04dU, 0xccaa4d54U, 0xe49604dfU, 0x9ed1b5e3U, 0x4c6a881bU, 0xc12c1fb8U, 0x4665517fU, 0x9d5eea04U, 0x018c355dU, 0xfa877473U, 0xfb0b412eU, 0xb3671d5aU, 0x92dbd252U, 0xe9105633U, 0x6dd64713U, 0x9ad7618cU, 0x37a10c7aU, 0x59f8148eU, 0xeb133c89U, 0xcea927eeU, 0xb761c935U, 0xe11ce5edU, 0x7a47b13cU, 0x9cd2df59U, 0x55f2733fU, 0x1814ce79U, 0x73c737bfU, 0x53f7cdeaU, 0x5ffdaa5bU, 0xdf3d6f14U, 0x7844db86U, 0xcaaff381U, 0xb968c43eU, 0x3824342cU, 0xc2a3405fU, 0x161dc372U, 0xbce2250cU, 0x283c498bU, 0xff0d9541U, 0x39a80171U, 0x080cb3deU, 0xd8b4e49cU, 0x6456c190U, 0x7bcb8461U, 0xd532b670U, 0x486c5c74U, 0xd0b85742U, }; static const uint32_t Td1[256] = { 0x5051f4a7U, 0x537e4165U, 0xc31a17a4U, 0x963a275eU, 0xcb3bab6bU, 0xf11f9d45U, 0xabacfa58U, 0x934be303U, 0x552030faU, 0xf6ad766dU, 0x9188cc76U, 0x25f5024cU, 0xfc4fe5d7U, 0xd7c52acbU, 0x80263544U, 0x8fb562a3U, 0x49deb15aU, 0x6725ba1bU, 0x9845ea0eU, 0xe15dfec0U, 0x02c32f75U, 0x12814cf0U, 0xa38d4697U, 0xc66bd3f9U, 0xe7038f5fU, 0x9515929cU, 0xebbf6d7aU, 0xda955259U, 0x2dd4be83U, 0xd3587421U, 0x2949e069U, 0x448ec9c8U, 0x6a75c289U, 0x78f48e79U, 0x6b99583eU, 0xdd27b971U, 0xb6bee14fU, 0x17f088adU, 0x66c920acU, 0xb47dce3aU, 0x1863df4aU, 0x82e51a31U, 0x60975133U, 0x4562537fU, 0xe0b16477U, 0x84bb6baeU, 0x1cfe81a0U, 0x94f9082bU, 0x58704868U, 0x198f45fdU, 0x8794de6cU, 0xb7527bf8U, 0x23ab73d3U, 0xe2724b02U, 0x57e31f8fU, 0x2a6655abU, 0x07b2eb28U, 0x032fb5c2U, 0x9a86c57bU, 0xa5d33708U, 0xf2302887U, 0xb223bfa5U, 0xba02036aU, 0x5ced1682U, 0x2b8acf1cU, 0x92a779b4U, 0xf0f307f2U, 0xa14e69e2U, 0xcd65daf4U, 0xd50605beU, 0x1fd13462U, 0x8ac4a6feU, 0x9d342e53U, 0xa0a2f355U, 0x32058ae1U, 0x75a4f6ebU, 0x390b83ecU, 0xaa4060efU, 0x065e719fU, 0x51bd6e10U, 0xf93e218aU, 0x3d96dd06U, 0xaedd3e05U, 0x464de6bdU, 0xb591548dU, 0x0571c45dU, 0x6f0406d4U, 0xff605015U, 0x241998fbU, 0x97d6bde9U, 0xcc894043U, 0x7767d99eU, 0xbdb0e842U, 0x8807898bU, 0x38e7195bU, 0xdb79c8eeU, 0x47a17c0aU, 0xe97c420fU, 0xc9f8841eU, 0x00000000U, 0x83098086U, 0x48322bedU, 0xac1e1170U, 0x4e6c5a72U, 0xfbfd0effU, 0x560f8538U, 0x1e3daed5U, 0x27362d39U, 0x640a0fd9U, 0x21685ca6U, 0xd19b5b54U, 0x3a24362eU, 0xb10c0a67U, 0x0f9357e7U, 0xd2b4ee96U, 0x9e1b9b91U, 0x4f80c0c5U, 0xa261dc20U, 0x695a774bU, 0x161c121aU, 0x0ae293baU, 0xe5c0a02aU, 0x433c22e0U, 0x1d121b17U, 0x0b0e090dU, 0xadf28bc7U, 0xb92db6a8U, 0xc8141ea9U, 0x8557f119U, 0x4caf7507U, 0xbbee99ddU, 0xfda37f60U, 0x9ff70126U, 0xbc5c72f5U, 0xc544663bU, 0x345bfb7eU, 0x768b4329U, 0xdccb23c6U, 0x68b6edfcU, 0x63b8e4f1U, 0xcad731dcU, 0x10426385U, 0x40139722U, 0x2084c611U, 0x7d854a24U, 0xf8d2bb3dU, 0x11aef932U, 0x6dc729a1U, 0x4b1d9e2fU, 0xf3dcb230U, 0xec0d8652U, 0xd077c1e3U, 0x6c2bb316U, 0x99a970b9U, 0xfa119448U, 0x2247e964U, 0xc4a8fc8cU, 0x1aa0f03fU, 0xd8567d2cU, 0xef223390U, 0xc787494eU, 0xc1d938d1U, 0xfe8ccaa2U, 0x3698d40bU, 0xcfa6f581U, 0x28a57adeU, 0x26dab78eU, 0xa43fadbfU, 0xe42c3a9dU, 0x0d507892U, 0x9b6a5fccU, 0x62547e46U, 0xc2f68d13U, 0xe890d8b8U, 0x5e2e39f7U, 0xf582c3afU, 0xbe9f5d80U, 0x7c69d093U, 0xa96fd52dU, 0xb3cf2512U, 0x3bc8ac99U, 0xa710187dU, 0x6ee89c63U, 0x7bdb3bbbU, 0x09cd2678U, 0xf46e5918U, 0x01ec9ab7U, 0xa8834f9aU, 0x65e6956eU, 0x7eaaffe6U, 0x0821bccfU, 0xe6ef15e8U, 0xd9bae79bU, 0xce4a6f36U, 0xd4ea9f09U, 0xd629b07cU, 0xaf31a4b2U, 0x312a3f23U, 0x30c6a594U, 0xc035a266U, 0x37744ebcU, 0xa6fc82caU, 0xb0e090d0U, 0x1533a7d8U, 0x4af10498U, 0xf741ecdaU, 0x0e7fcd50U, 0x2f1791f6U, 0x8d764dd6U, 0x4d43efb0U, 0x54ccaa4dU, 0xdfe49604U, 0xe39ed1b5U, 0x1b4c6a88U, 0xb8c12c1fU, 0x7f466551U, 0x049d5eeaU, 0x5d018c35U, 0x73fa8774U, 0x2efb0b41U, 0x5ab3671dU, 0x5292dbd2U, 0x33e91056U, 0x136dd647U, 0x8c9ad761U, 0x7a37a10cU, 0x8e59f814U, 0x89eb133cU, 0xeecea927U, 0x35b761c9U, 0xede11ce5U, 0x3c7a47b1U, 0x599cd2dfU, 0x3f55f273U, 0x791814ceU, 0xbf73c737U, 0xea53f7cdU, 0x5b5ffdaaU, 0x14df3d6fU, 0x867844dbU, 0x81caaff3U, 0x3eb968c4U, 0x2c382434U, 0x5fc2a340U, 0x72161dc3U, 0x0cbce225U, 0x8b283c49U, 0x41ff0d95U, 0x7139a801U, 0xde080cb3U, 0x9cd8b4e4U, 0x906456c1U, 0x617bcb84U, 0x70d532b6U, 0x74486c5cU, 0x42d0b857U, }; static const uint32_t Td2[256] = { 0xa75051f4U, 0x65537e41U, 0xa4c31a17U, 0x5e963a27U, 0x6bcb3babU, 0x45f11f9dU, 0x58abacfaU, 0x03934be3U, 0xfa552030U, 0x6df6ad76U, 0x769188ccU, 0x4c25f502U, 0xd7fc4fe5U, 0xcbd7c52aU, 0x44802635U, 0xa38fb562U, 0x5a49deb1U, 0x1b6725baU, 0x0e9845eaU, 0xc0e15dfeU, 0x7502c32fU, 0xf012814cU, 0x97a38d46U, 0xf9c66bd3U, 0x5fe7038fU, 0x9c951592U, 0x7aebbf6dU, 0x59da9552U, 0x832dd4beU, 0x21d35874U, 0x692949e0U, 0xc8448ec9U, 0x896a75c2U, 0x7978f48eU, 0x3e6b9958U, 0x71dd27b9U, 0x4fb6bee1U, 0xad17f088U, 0xac66c920U, 0x3ab47dceU, 0x4a1863dfU, 0x3182e51aU, 0x33609751U, 0x7f456253U, 0x77e0b164U, 0xae84bb6bU, 0xa01cfe81U, 0x2b94f908U, 0x68587048U, 0xfd198f45U, 0x6c8794deU, 0xf8b7527bU, 0xd323ab73U, 0x02e2724bU, 0x8f57e31fU, 0xab2a6655U, 0x2807b2ebU, 0xc2032fb5U, 0x7b9a86c5U, 0x08a5d337U, 0x87f23028U, 0xa5b223bfU, 0x6aba0203U, 0x825ced16U, 0x1c2b8acfU, 0xb492a779U, 0xf2f0f307U, 0xe2a14e69U, 0xf4cd65daU, 0xbed50605U, 0x621fd134U, 0xfe8ac4a6U, 0x539d342eU, 0x55a0a2f3U, 0xe132058aU, 0xeb75a4f6U, 0xec390b83U, 0xefaa4060U, 0x9f065e71U, 0x1051bd6eU, 0x8af93e21U, 0x063d96ddU, 0x05aedd3eU, 0xbd464de6U, 0x8db59154U, 0x5d0571c4U, 0xd46f0406U, 0x15ff6050U, 0xfb241998U, 0xe997d6bdU, 0x43cc8940U, 0x9e7767d9U, 0x42bdb0e8U, 0x8b880789U, 0x5b38e719U, 0xeedb79c8U, 0x0a47a17cU, 0x0fe97c42U, 0x1ec9f884U, 0x00000000U, 0x86830980U, 0xed48322bU, 0x70ac1e11U, 0x724e6c5aU, 0xfffbfd0eU, 0x38560f85U, 0xd51e3daeU, 0x3927362dU, 0xd9640a0fU, 0xa621685cU, 0x54d19b5bU, 0x2e3a2436U, 0x67b10c0aU, 0xe70f9357U, 0x96d2b4eeU, 0x919e1b9bU, 0xc54f80c0U, 0x20a261dcU, 0x4b695a77U, 0x1a161c12U, 0xba0ae293U, 0x2ae5c0a0U, 0xe0433c22U, 0x171d121bU, 0x0d0b0e09U, 0xc7adf28bU, 0xa8b92db6U, 0xa9c8141eU, 0x198557f1U, 0x074caf75U, 0xddbbee99U, 0x60fda37fU, 0x269ff701U, 0xf5bc5c72U, 0x3bc54466U, 0x7e345bfbU, 0x29768b43U, 0xc6dccb23U, 0xfc68b6edU, 0xf163b8e4U, 0xdccad731U, 0x85104263U, 0x22401397U, 0x112084c6U, 0x247d854aU, 0x3df8d2bbU, 0x3211aef9U, 0xa16dc729U, 0x2f4b1d9eU, 0x30f3dcb2U, 0x52ec0d86U, 0xe3d077c1U, 0x166c2bb3U, 0xb999a970U, 0x48fa1194U, 0x642247e9U, 0x8cc4a8fcU, 0x3f1aa0f0U, 0x2cd8567dU, 0x90ef2233U, 0x4ec78749U, 0xd1c1d938U, 0xa2fe8ccaU, 0x0b3698d4U, 0x81cfa6f5U, 0xde28a57aU, 0x8e26dab7U, 0xbfa43fadU, 0x9de42c3aU, 0x920d5078U, 0xcc9b6a5fU, 0x4662547eU, 0x13c2f68dU, 0xb8e890d8U, 0xf75e2e39U, 0xaff582c3U, 0x80be9f5dU, 0x937c69d0U, 0x2da96fd5U, 0x12b3cf25U, 0x993bc8acU, 0x7da71018U, 0x636ee89cU, 0xbb7bdb3bU, 0x7809cd26U, 0x18f46e59U, 0xb701ec9aU, 0x9aa8834fU, 0x6e65e695U, 0xe67eaaffU, 0xcf0821bcU, 0xe8e6ef15U, 0x9bd9bae7U, 0x36ce4a6fU, 0x09d4ea9fU, 0x7cd629b0U, 0xb2af31a4U, 0x23312a3fU, 0x9430c6a5U, 0x66c035a2U, 0xbc37744eU, 0xcaa6fc82U, 0xd0b0e090U, 0xd81533a7U, 0x984af104U, 0xdaf741ecU, 0x500e7fcdU, 0xf62f1791U, 0xd68d764dU, 0xb04d43efU, 0x4d54ccaaU, 0x04dfe496U, 0xb5e39ed1U, 0x881b4c6aU, 0x1fb8c12cU, 0x517f4665U, 0xea049d5eU, 0x355d018cU, 0x7473fa87U, 0x412efb0bU, 0x1d5ab367U, 0xd25292dbU, 0x5633e910U, 0x47136dd6U, 0x618c9ad7U, 0x0c7a37a1U, 0x148e59f8U, 0x3c89eb13U, 0x27eecea9U, 0xc935b761U, 0xe5ede11cU, 0xb13c7a47U, 0xdf599cd2U, 0x733f55f2U, 0xce791814U, 0x37bf73c7U, 0xcdea53f7U, 0xaa5b5ffdU, 0x6f14df3dU, 0xdb867844U, 0xf381caafU, 0xc43eb968U, 0x342c3824U, 0x405fc2a3U, 0xc372161dU, 0x250cbce2U, 0x498b283cU, 0x9541ff0dU, 0x017139a8U, 0xb3de080cU, 0xe49cd8b4U, 0xc1906456U, 0x84617bcbU, 0xb670d532U, 0x5c74486cU, 0x5742d0b8U, }; static const uint32_t Td3[256] = { 0xf4a75051U, 0x4165537eU, 0x17a4c31aU, 0x275e963aU, 0xab6bcb3bU, 0x9d45f11fU, 0xfa58abacU, 0xe303934bU, 0x30fa5520U, 0x766df6adU, 0xcc769188U, 0x024c25f5U, 0xe5d7fc4fU, 0x2acbd7c5U, 0x35448026U, 0x62a38fb5U, 0xb15a49deU, 0xba1b6725U, 0xea0e9845U, 0xfec0e15dU, 0x2f7502c3U, 0x4cf01281U, 0x4697a38dU, 0xd3f9c66bU, 0x8f5fe703U, 0x929c9515U, 0x6d7aebbfU, 0x5259da95U, 0xbe832dd4U, 0x7421d358U, 0xe0692949U, 0xc9c8448eU, 0xc2896a75U, 0x8e7978f4U, 0x583e6b99U, 0xb971dd27U, 0xe14fb6beU, 0x88ad17f0U, 0x20ac66c9U, 0xce3ab47dU, 0xdf4a1863U, 0x1a3182e5U, 0x51336097U, 0x537f4562U, 0x6477e0b1U, 0x6bae84bbU, 0x81a01cfeU, 0x082b94f9U, 0x48685870U, 0x45fd198fU, 0xde6c8794U, 0x7bf8b752U, 0x73d323abU, 0x4b02e272U, 0x1f8f57e3U, 0x55ab2a66U, 0xeb2807b2U, 0xb5c2032fU, 0xc57b9a86U, 0x3708a5d3U, 0x2887f230U, 0xbfa5b223U, 0x036aba02U, 0x16825cedU, 0xcf1c2b8aU, 0x79b492a7U, 0x07f2f0f3U, 0x69e2a14eU, 0xdaf4cd65U, 0x05bed506U, 0x34621fd1U, 0xa6fe8ac4U, 0x2e539d34U, 0xf355a0a2U, 0x8ae13205U, 0xf6eb75a4U, 0x83ec390bU, 0x60efaa40U, 0x719f065eU, 0x6e1051bdU, 0x218af93eU, 0xdd063d96U, 0x3e05aeddU, 0xe6bd464dU, 0x548db591U, 0xc45d0571U, 0x06d46f04U, 0x5015ff60U, 0x98fb2419U, 0xbde997d6U, 0x4043cc89U, 0xd99e7767U, 0xe842bdb0U, 0x898b8807U, 0x195b38e7U, 0xc8eedb79U, 0x7c0a47a1U, 0x420fe97cU, 0x841ec9f8U, 0x00000000U, 0x80868309U, 0x2bed4832U, 0x1170ac1eU, 0x5a724e6cU, 0x0efffbfdU, 0x8538560fU, 0xaed51e3dU, 0x2d392736U, 0x0fd9640aU, 0x5ca62168U, 0x5b54d19bU, 0x362e3a24U, 0x0a67b10cU, 0x57e70f93U, 0xee96d2b4U, 0x9b919e1bU, 0xc0c54f80U, 0xdc20a261U, 0x774b695aU, 0x121a161cU, 0x93ba0ae2U, 0xa02ae5c0U, 0x22e0433cU, 0x1b171d12U, 0x090d0b0eU, 0x8bc7adf2U, 0xb6a8b92dU, 0x1ea9c814U, 0xf1198557U, 0x75074cafU, 0x99ddbbeeU, 0x7f60fda3U, 0x01269ff7U, 0x72f5bc5cU, 0x663bc544U, 0xfb7e345bU, 0x4329768bU, 0x23c6dccbU, 0xedfc68b6U, 0xe4f163b8U, 0x31dccad7U, 0x63851042U, 0x97224013U, 0xc6112084U, 0x4a247d85U, 0xbb3df8d2U, 0xf93211aeU, 0x29a16dc7U, 0x9e2f4b1dU, 0xb230f3dcU, 0x8652ec0dU, 0xc1e3d077U, 0xb3166c2bU, 0x70b999a9U, 0x9448fa11U, 0xe9642247U, 0xfc8cc4a8U, 0xf03f1aa0U, 0x7d2cd856U, 0x3390ef22U, 0x494ec787U, 0x38d1c1d9U, 0xcaa2fe8cU, 0xd40b3698U, 0xf581cfa6U, 0x7ade28a5U, 0xb78e26daU, 0xadbfa43fU, 0x3a9de42cU, 0x78920d50U, 0x5fcc9b6aU, 0x7e466254U, 0x8d13c2f6U, 0xd8b8e890U, 0x39f75e2eU, 0xc3aff582U, 0x5d80be9fU, 0xd0937c69U, 0xd52da96fU, 0x2512b3cfU, 0xac993bc8U, 0x187da710U, 0x9c636ee8U, 0x3bbb7bdbU, 0x267809cdU, 0x5918f46eU, 0x9ab701ecU, 0x4f9aa883U, 0x956e65e6U, 0xffe67eaaU, 0xbccf0821U, 0x15e8e6efU, 0xe79bd9baU, 0x6f36ce4aU, 0x9f09d4eaU, 0xb07cd629U, 0xa4b2af31U, 0x3f23312aU, 0xa59430c6U, 0xa266c035U, 0x4ebc3774U, 0x82caa6fcU, 0x90d0b0e0U, 0xa7d81533U, 0x04984af1U, 0xecdaf741U, 0xcd500e7fU, 0x91f62f17U, 0x4dd68d76U, 0xefb04d43U, 0xaa4d54ccU, 0x9604dfe4U, 0xd1b5e39eU, 0x6a881b4cU, 0x2c1fb8c1U, 0x65517f46U, 0x5eea049dU, 0x8c355d01U, 0x877473faU, 0x0b412efbU, 0x671d5ab3U, 0xdbd25292U, 0x105633e9U, 0xd647136dU, 0xd7618c9aU, 0xa10c7a37U, 0xf8148e59U, 0x133c89ebU, 0xa927eeceU, 0x61c935b7U, 0x1ce5ede1U, 0x47b13c7aU, 0xd2df599cU, 0xf2733f55U, 0x14ce7918U, 0xc737bf73U, 0xf7cdea53U, 0xfdaa5b5fU, 0x3d6f14dfU, 0x44db8678U, 0xaff381caU, 0x68c43eb9U, 0x24342c38U, 0xa3405fc2U, 0x1dc37216U, 0xe2250cbcU, 0x3c498b28U, 0x0d9541ffU, 0xa8017139U, 0x0cb3de08U, 0xb4e49cd8U, 0x56c19064U, 0xcb84617bU, 0x32b670d5U, 0x6c5c7448U, 0xb85742d0U, }; static const uint32_t Td4[256] = { 0x52525252U, 0x09090909U, 0x6a6a6a6aU, 0xd5d5d5d5U, 0x30303030U, 0x36363636U, 0xa5a5a5a5U, 0x38383838U, 0xbfbfbfbfU, 0x40404040U, 0xa3a3a3a3U, 0x9e9e9e9eU, 0x81818181U, 0xf3f3f3f3U, 0xd7d7d7d7U, 0xfbfbfbfbU, 0x7c7c7c7cU, 0xe3e3e3e3U, 0x39393939U, 0x82828282U, 0x9b9b9b9bU, 0x2f2f2f2fU, 0xffffffffU, 0x87878787U, 0x34343434U, 0x8e8e8e8eU, 0x43434343U, 0x44444444U, 0xc4c4c4c4U, 0xdedededeU, 0xe9e9e9e9U, 0xcbcbcbcbU, 0x54545454U, 0x7b7b7b7bU, 0x94949494U, 0x32323232U, 0xa6a6a6a6U, 0xc2c2c2c2U, 0x23232323U, 0x3d3d3d3dU, 0xeeeeeeeeU, 0x4c4c4c4cU, 0x95959595U, 0x0b0b0b0bU, 0x42424242U, 0xfafafafaU, 0xc3c3c3c3U, 0x4e4e4e4eU, 0x08080808U, 0x2e2e2e2eU, 0xa1a1a1a1U, 0x66666666U, 0x28282828U, 0xd9d9d9d9U, 0x24242424U, 0xb2b2b2b2U, 0x76767676U, 0x5b5b5b5bU, 0xa2a2a2a2U, 0x49494949U, 0x6d6d6d6dU, 0x8b8b8b8bU, 0xd1d1d1d1U, 0x25252525U, 0x72727272U, 0xf8f8f8f8U, 0xf6f6f6f6U, 0x64646464U, 0x86868686U, 0x68686868U, 0x98989898U, 0x16161616U, 0xd4d4d4d4U, 0xa4a4a4a4U, 0x5c5c5c5cU, 0xccccccccU, 0x5d5d5d5dU, 0x65656565U, 0xb6b6b6b6U, 0x92929292U, 0x6c6c6c6cU, 0x70707070U, 0x48484848U, 0x50505050U, 0xfdfdfdfdU, 0xededededU, 0xb9b9b9b9U, 0xdadadadaU, 0x5e5e5e5eU, 0x15151515U, 0x46464646U, 0x57575757U, 0xa7a7a7a7U, 0x8d8d8d8dU, 0x9d9d9d9dU, 0x84848484U, 0x90909090U, 0xd8d8d8d8U, 0xababababU, 0x00000000U, 0x8c8c8c8cU, 0xbcbcbcbcU, 0xd3d3d3d3U, 0x0a0a0a0aU, 0xf7f7f7f7U, 0xe4e4e4e4U, 0x58585858U, 0x05050505U, 0xb8b8b8b8U, 0xb3b3b3b3U, 0x45454545U, 0x06060606U, 0xd0d0d0d0U, 0x2c2c2c2cU, 0x1e1e1e1eU, 0x8f8f8f8fU, 0xcacacacaU, 0x3f3f3f3fU, 0x0f0f0f0fU, 0x02020202U, 0xc1c1c1c1U, 0xafafafafU, 0xbdbdbdbdU, 0x03030303U, 0x01010101U, 0x13131313U, 0x8a8a8a8aU, 0x6b6b6b6bU, 0x3a3a3a3aU, 0x91919191U, 0x11111111U, 0x41414141U, 0x4f4f4f4fU, 0x67676767U, 0xdcdcdcdcU, 0xeaeaeaeaU, 0x97979797U, 0xf2f2f2f2U, 0xcfcfcfcfU, 0xcecececeU, 0xf0f0f0f0U, 0xb4b4b4b4U, 0xe6e6e6e6U, 0x73737373U, 0x96969696U, 0xacacacacU, 0x74747474U, 0x22222222U, 0xe7e7e7e7U, 0xadadadadU, 0x35353535U, 0x85858585U, 0xe2e2e2e2U, 0xf9f9f9f9U, 0x37373737U, 0xe8e8e8e8U, 0x1c1c1c1cU, 0x75757575U, 0xdfdfdfdfU, 0x6e6e6e6eU, 0x47474747U, 0xf1f1f1f1U, 0x1a1a1a1aU, 0x71717171U, 0x1d1d1d1dU, 0x29292929U, 0xc5c5c5c5U, 0x89898989U, 0x6f6f6f6fU, 0xb7b7b7b7U, 0x62626262U, 0x0e0e0e0eU, 0xaaaaaaaaU, 0x18181818U, 0xbebebebeU, 0x1b1b1b1bU, 0xfcfcfcfcU, 0x56565656U, 0x3e3e3e3eU, 0x4b4b4b4bU, 0xc6c6c6c6U, 0xd2d2d2d2U, 0x79797979U, 0x20202020U, 0x9a9a9a9aU, 0xdbdbdbdbU, 0xc0c0c0c0U, 0xfefefefeU, 0x78787878U, 0xcdcdcdcdU, 0x5a5a5a5aU, 0xf4f4f4f4U, 0x1f1f1f1fU, 0xddddddddU, 0xa8a8a8a8U, 0x33333333U, 0x88888888U, 0x07070707U, 0xc7c7c7c7U, 0x31313131U, 0xb1b1b1b1U, 0x12121212U, 0x10101010U, 0x59595959U, 0x27272727U, 0x80808080U, 0xececececU, 0x5f5f5f5fU, 0x60606060U, 0x51515151U, 0x7f7f7f7fU, 0xa9a9a9a9U, 0x19191919U, 0xb5b5b5b5U, 0x4a4a4a4aU, 0x0d0d0d0dU, 0x2d2d2d2dU, 0xe5e5e5e5U, 0x7a7a7a7aU, 0x9f9f9f9fU, 0x93939393U, 0xc9c9c9c9U, 0x9c9c9c9cU, 0xefefefefU, 0xa0a0a0a0U, 0xe0e0e0e0U, 0x3b3b3b3bU, 0x4d4d4d4dU, 0xaeaeaeaeU, 0x2a2a2a2aU, 0xf5f5f5f5U, 0xb0b0b0b0U, 0xc8c8c8c8U, 0xebebebebU, 0xbbbbbbbbU, 0x3c3c3c3cU, 0x83838383U, 0x53535353U, 0x99999999U, 0x61616161U, 0x17171717U, 0x2b2b2b2bU, 0x04040404U, 0x7e7e7e7eU, 0xbabababaU, 0x77777777U, 0xd6d6d6d6U, 0x26262626U, 0xe1e1e1e1U, 0x69696969U, 0x14141414U, 0x63636363U, 0x55555555U, 0x21212121U, 0x0c0c0c0cU, 0x7d7d7d7dU, }; static const uint8_t perm[16] = {1,6,11,12,5,10,15,0,9,14,3,4,13,2,7,8}; static const uint8_t rcon[17] = { 0x2f,0x5e,0xbc,0x63,0xc6,0x97,0x35,0x6a, 0xd4,0xb3,0x7d,0xfa,0xef,0xc5,0x91,0x39, 0x72 }; static const uint8_t lfsr2[256] = { 0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e, 0x10, 0x12, 0x14, 0x16, 0x18, 0x1a, 0x1c, 0x1e, 0x20, 0x22, 0x24, 0x26, 0x28, 0x2a, 0x2c, 0x2e, 0x30, 0x32, 0x34, 0x36, 0x38, 0x3a, 0x3c, 0x3e, 0x41, 0x43, 0x45, 0x47, 0x49, 0x4b, 0x4d, 0x4f, 0x51, 0x53, 0x55, 0x57, 0x59, 0x5b, 0x5d, 0x5f, 0x61, 0x63, 0x65, 0x67, 0x69, 0x6b, 0x6d, 0x6f, 0x71, 0x73, 0x75, 0x77, 0x79, 0x7b, 0x7d, 0x7f, 0x80, 0x82, 0x84, 0x86, 0x88, 0x8a, 0x8c, 0x8e, 0x90, 0x92, 0x94, 0x96, 0x98, 0x9a, 0x9c, 0x9e, 0xa0, 0xa2, 0xa4, 0xa6, 0xa8, 0xaa, 0xac, 0xae, 0xb0, 0xb2, 0xb4, 0xb6, 0xb8, 0xba, 0xbc, 0xbe, 0xc1, 0xc3, 0xc5, 0xc7, 0xc9, 0xcb, 0xcd, 0xcf, 0xd1, 0xd3, 0xd5, 0xd7, 0xd9, 0xdb, 0xdd, 0xdf, 0xe1, 0xe3, 0xe5, 0xe7, 0xe9, 0xeb, 0xed, 0xef, 0xf1, 0xf3, 0xf5, 0xf7, 0xf9, 0xfb, 0xfd, 0xff, 0x01, 0x03, 0x05, 0x07, 0x09, 0x0b, 0x0d, 0x0f, 0x11, 0x13, 0x15, 0x17, 0x19, 0x1b, 0x1d, 0x1f, 0x21, 0x23, 0x25, 0x27, 0x29, 0x2b, 0x2d, 0x2f, 0x31, 0x33, 0x35, 0x37, 0x39, 0x3b, 0x3d, 0x3f, 0x40, 0x42, 0x44, 0x46, 0x48, 0x4a, 0x4c, 0x4e, 0x50, 0x52, 0x54, 0x56, 0x58, 0x5a, 0x5c, 0x5e, 0x60, 0x62, 0x64, 0x66, 0x68, 0x6a, 0x6c, 0x6e, 0x70, 0x72, 0x74, 0x76, 0x78, 0x7a, 0x7c, 0x7e, 0x81, 0x83, 0x85, 0x87, 0x89, 0x8b, 0x8d, 0x8f, 0x91, 0x93, 0x95, 0x97, 0x99, 0x9b, 0x9d, 0x9f, 0xa1, 0xa3, 0xa5, 0xa7, 0xa9, 0xab, 0xad, 0xaf, 0xb1, 0xb3, 0xb5, 0xb7, 0xb9, 0xbb, 0xbd, 0xbf, 0xc0, 0xc2, 0xc4, 0xc6, 0xc8, 0xca, 0xcc, 0xce, 0xd0, 0xd2, 0xd4, 0xd6, 0xd8, 0xda, 0xdc, 0xde, 0xe0, 0xe2, 0xe4, 0xe6, 0xe8, 0xea, 0xec, 0xee, 0xf0, 0xf2, 0xf4, 0xf6, 0xf8, 0xfa, 0xfc, 0xfe }; static const uint8_t lfsr4[256] = { 0x00, 0x80, 0x01, 0x81, 0x02, 0x82, 0x03, 0x83, 0x04, 0x84, 0x05, 0x85, 0x06, 0x86, 0x07, 0x87, 0x08, 0x88, 0x09, 0x89, 0x0a, 0x8a, 0x0b, 0x8b, 0x0c, 0x8c, 0x0d, 0x8d, 0x0e, 0x8e, 0x0f, 0x8f, 0x10, 0x90, 0x11, 0x91, 0x12, 0x92, 0x13, 0x93, 0x14, 0x94, 0x15, 0x95, 0x16, 0x96, 0x17, 0x97, 0x18, 0x98, 0x19, 0x99, 0x1a, 0x9a, 0x1b, 0x9b, 0x1c, 0x9c, 0x1d, 0x9d, 0x1e, 0x9e, 0x1f, 0x9f, 0xa0, 0x20, 0xa1, 0x21, 0xa2, 0x22, 0xa3, 0x23, 0xa4, 0x24, 0xa5, 0x25, 0xa6, 0x26, 0xa7, 0x27, 0xa8, 0x28, 0xa9, 0x29, 0xaa, 0x2a, 0xab, 0x2b, 0xac, 0x2c, 0xad, 0x2d, 0xae, 0x2e, 0xaf, 0x2f, 0xb0, 0x30, 0xb1, 0x31, 0xb2, 0x32, 0xb3, 0x33, 0xb4, 0x34, 0xb5, 0x35, 0xb6, 0x36, 0xb7, 0x37, 0xb8, 0x38, 0xb9, 0x39, 0xba, 0x3a, 0xbb, 0x3b, 0xbc, 0x3c, 0xbd, 0x3d, 0xbe, 0x3e, 0xbf, 0x3f, 0x40, 0xc0, 0x41, 0xc1, 0x42, 0xc2, 0x43, 0xc3, 0x44, 0xc4, 0x45, 0xc5, 0x46, 0xc6, 0x47, 0xc7, 0x48, 0xc8, 0x49, 0xc9, 0x4a, 0xca, 0x4b, 0xcb, 0x4c, 0xcc, 0x4d, 0xcd, 0x4e, 0xce, 0x4f, 0xcf, 0x50, 0xd0, 0x51, 0xd1, 0x52, 0xd2, 0x53, 0xd3, 0x54, 0xd4, 0x55, 0xd5, 0x56, 0xd6, 0x57, 0xd7, 0x58, 0xd8, 0x59, 0xd9, 0x5a, 0xda, 0x5b, 0xdb, 0x5c, 0xdc, 0x5d, 0xdd, 0x5e, 0xde, 0x5f, 0xdf, 0xe0, 0x60, 0xe1, 0x61, 0xe2, 0x62, 0xe3, 0x63, 0xe4, 0x64, 0xe5, 0x65, 0xe6, 0x66, 0xe7, 0x67, 0xe8, 0x68, 0xe9, 0x69, 0xea, 0x6a, 0xeb, 0x6b, 0xec, 0x6c, 0xed, 0x6d, 0xee, 0x6e, 0xef, 0x6f, 0xf0, 0x70, 0xf1, 0x71, 0xf2, 0x72, 0xf3, 0x73, 0xf4, 0x74, 0xf5, 0x75, 0xf6, 0x76, 0xf7, 0x77, 0xf8, 0x78, 0xf9, 0x79, 0xfa, 0x7a, 0xfb, 0x7b, 0xfc, 0x7c, 0xfd, 0x7d, 0xfe, 0x7e, 0xff, 0x7f }; /* ** LFSR according to the position alpha (for alpha \in {1,2,3} ) */ uint8_t choose_lfsr (uint8_t x, uint8_t alpha) { if( 1 == alpha ) return x; if( 2 == alpha ) return lfsr2[x];//mul2[x]; if( 3 == alpha ) return lfsr4[x];//mul2[mul2[x]]; printf("Incorrect alpha (%d) passed to the function g in the tweakey schedule. Exiting...\n", alpha); exit(2); } /* ** Function G form the specifications */ void G (uint8_t tweakey[], uint8_t alpha) { int i; for(i=0; i<16; i++) tweakey[i] = choose_lfsr (tweakey[i], alpha); } /* ** Function H form the specifications */ void H (uint8_t tweakey[]) { int i; uint8_t tmp[16]; for( i = 0; i<16; i++) tmp[perm[i]] = tweakey[i]; memcpy (tweakey, tmp, 16); } /* ** Prepare the round subtweakeys for the encryption process */ int deoxysKeySetupEnc256(uint32_t* rtweakey, const uint8_t* TweakKey, const int no_tweakeys) { int r; uint8_t tweakey[3][16]; uint8_t alpha[3]; const uint32_t rcon_row1 = 0x01020408; int Nr; memcpy (tweakey[0], TweakKey + 0, 16); memcpy (tweakey[1], TweakKey + 16, 16); if( 2 == no_tweakeys ){ alpha[0] = 2; alpha[1] = 1; /* Number of rounds is 14 */ Nr=14; } else if( 3 == no_tweakeys ){ memcpy (tweakey[2], TweakKey + 32, 16); alpha[0] = 3; alpha[1] = 2; alpha[2] = 1; /* Number of rounds is 16 */ Nr=16; } else { printf("The #tweakeys is %d, and it should be either 2 or 3. Exiting...\n", no_tweakeys); exit(1); } /* For each rounds */ for(r=0; r<=Nr; r++) { /* Produce the round tweakey */ rtweakey[ 4*r + 0] = GETU32( tweakey[0] + 0 ) ^ GETU32( tweakey[1] + 0 ) ^ ((3==no_tweakeys)* GETU32( tweakey[2] + 0 )) ^ rcon_row1 ; rtweakey[ 4*r + 1] = GETU32( tweakey[0] + 4 ) ^ GETU32( tweakey[1] + 4 ) ^ ((3==no_tweakeys)* GETU32( tweakey[2] + 4 )) ^ GETRCON( r); rtweakey[ 4*r + 2] = GETU32( tweakey[0] + 8 ) ^ GETU32( tweakey[1] + 8 ) ^ ((3==no_tweakeys)* GETU32( tweakey[2] + 8 )); rtweakey[ 4*r + 3] = GETU32( tweakey[0] + 12 ) ^ GETU32( tweakey[1] + 12 ) ^ ((3==no_tweakeys)* GETU32( tweakey[2] + 12 )); /* Apply H and G functions */ H (tweakey[0]); G (tweakey[0], alpha[0]); H (tweakey[1]); G (tweakey[1], alpha[1]); if (3 == no_tweakeys) { H (tweakey[2]); G (tweakey[2], alpha[2]); } }/*r*/ return Nr; } /* ** Prepare the round subtweakeys for the decryption process */ int deoxysKeySetupDec256(uint32_t* rtweakey, const uint8_t* TweakKey, int no_tweakeys) { int i; int j; int Nr; uint32_t temp; /* Produce the round tweakeys used for the encryption */ Nr=deoxysKeySetupEnc256 (rtweakey, TweakKey, no_tweakeys); /* invert their order */ for (i = 0, j = 4*Nr; i < j; i += 4, j -= 4) { temp = rtweakey[i ]; rtweakey[i ] = rtweakey[j ]; rtweakey[j ] = temp; temp = rtweakey[i + 1]; rtweakey[i + 1] = rtweakey[j + 1]; rtweakey[j + 1] = temp; temp = rtweakey[i + 2]; rtweakey[i + 2] = rtweakey[j + 2]; rtweakey[j + 2] = temp; temp = rtweakey[i + 3]; rtweakey[i + 3] = rtweakey[j + 3]; rtweakey[j + 3] = temp; } /* apply the inverse MixColumn transform to all round keys but the first and the last */ for (i = 1; i <= Nr; i++) { rtweakey += 4; rtweakey[0] = Td0[Te4[(rtweakey[0] >> 24) ] & 0xff] ^ Td1[Te4[(rtweakey[0] >> 16) & 0xff] & 0xff] ^ Td2[Te4[(rtweakey[0] >> 8) & 0xff] & 0xff] ^ Td3[Te4[(rtweakey[0] ) & 0xff] & 0xff]; rtweakey[1] = Td0[Te4[(rtweakey[1] >> 24) ] & 0xff] ^ Td1[Te4[(rtweakey[1] >> 16) & 0xff] & 0xff] ^ Td2[Te4[(rtweakey[1] >> 8) & 0xff] & 0xff] ^ Td3[Te4[(rtweakey[1] ) & 0xff] & 0xff]; rtweakey[2] = Td0[Te4[(rtweakey[2] >> 24) ] & 0xff] ^ Td1[Te4[(rtweakey[2] >> 16) & 0xff] & 0xff] ^ Td2[Te4[(rtweakey[2] >> 8) & 0xff] & 0xff] ^ Td3[Te4[(rtweakey[2] ) & 0xff] & 0xff]; rtweakey[3] = Td0[Te4[(rtweakey[3] >> 24) ] & 0xff] ^ Td1[Te4[(rtweakey[3] >> 16) & 0xff] & 0xff] ^ Td2[Te4[(rtweakey[3] >> 8) & 0xff] & 0xff] ^ Td3[Te4[(rtweakey[3] ) & 0xff] & 0xff]; } return Nr; } /* ** Tweakable block cipher encryption function */ void aesTweakEncrypt(uint32_t tweakey_size, uint8_t pt[16], uint8_t key[], uint8_t ct[16]) { uint32_t s0; uint32_t s1; uint32_t s2; uint32_t s3; uint32_t t0; uint32_t t1; uint32_t t2; uint32_t t3; uint32_t rk[4*17]; /* Produce the round tweakeys */ deoxysKeySetupEnc256 (rk, key, tweakey_size/128); /* Get the plaintext + key/tweak prewhitening */ s0 = GETU32(pt ) ^ rk[0]; s1 = GETU32(pt + 4) ^ rk[1]; s2 = GETU32(pt + 8) ^ rk[2]; s3 = GETU32(pt + 12) ^ rk[3]; /* round 1: */ t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[ 4]; t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[ 5]; t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[ 6]; t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[ 7]; /* round 2: */ s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[ 8]; s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[ 9]; s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[10]; s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[11]; /* round 3: */ t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[12]; t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[13]; t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[14]; t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[15]; /* round 4: */ s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[16]; s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[17]; s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[18]; s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[19]; /* round 5: */ t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[20]; t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[21]; t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[22]; t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[23]; /* round 6: */ s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[24]; s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[25]; s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[26]; s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[27]; /* round 7: */ t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[28]; t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[29]; t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[30]; t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[31]; /* round 8: */ s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[32]; s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[33]; s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[34]; s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[35]; /* round 9: */ t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[36]; t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[37]; t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[38]; t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[39]; /* round 10: */ s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[40]; s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[41]; s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[42]; s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[43]; /* round 11: */ t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[44]; t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[45]; t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[46]; t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[47]; /* round 12: */ s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[48]; s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[49]; s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[50]; s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[51]; /* round 13: */ t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[52]; t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[53]; t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[54]; t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[55]; /* round 14: */ s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[56]; s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[57]; s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[58]; s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[59]; if (384 == tweakey_size) { /* round 15: */ t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[60]; t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[61]; t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[62]; t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[63]; /* round 16: */ s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[64]; s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[65]; s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[66]; s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[67]; } /* Put the state into the ciphertext */ PUTU32(ct , s0); PUTU32(ct + 4, s1); PUTU32(ct + 8, s2); PUTU32(ct + 12, s3); } /* ** Tweakable block cipher decryption function */ void aesTweakDecrypt(uint32_t tweakey_size, const uint8_t ct[16], const uint8_t key[], uint8_t pt[16]) { uint32_t s0; uint32_t s1; uint32_t s2; uint32_t s3; uint32_t t0; uint32_t t1; uint32_t t2; uint32_t t3; uint32_t rk[4*17]; /* Produce the round tweakeys */ deoxysKeySetupDec256 (rk, key, tweakey_size/128); /* Get the plaintext + key/tweak prewhitening */ s0 = GETU32(ct ) ^ rk[0]; s1 = GETU32(ct + 4) ^ rk[1]; s2 = GETU32(ct + 8) ^ rk[2]; s3 = GETU32(ct + 12) ^ rk[3]; /* Apply the inverse of the MixColumn transformation to use the Td AES tables */ s0 = Td0[Te4[(s0 >> 24) ] & 0xff] ^ Td1[Te4[(s0 >> 16) & 0xff] & 0xff] ^ Td2[Te4[(s0 >> 8) & 0xff] & 0xff] ^ Td3[Te4[(s0 ) & 0xff] & 0xff]; s1 = Td0[Te4[(s1 >> 24) ] & 0xff] ^ Td1[Te4[(s1 >> 16) & 0xff] & 0xff] ^ Td2[Te4[(s1 >> 8) & 0xff] & 0xff] ^ Td3[Te4[(s1 ) & 0xff] & 0xff]; s2 = Td0[Te4[(s2 >> 24) ] & 0xff] ^ Td1[Te4[(s2 >> 16) & 0xff] & 0xff] ^ Td2[Te4[(s2 >> 8) & 0xff] & 0xff] ^ Td3[Te4[(s2 ) & 0xff] & 0xff]; s3 = Td0[Te4[(s3 >> 24) ] & 0xff] ^ Td1[Te4[(s3 >> 16) & 0xff] & 0xff] ^ Td2[Te4[(s3 >> 8) & 0xff] & 0xff] ^ Td3[Te4[(s3 ) & 0xff] & 0xff]; /* round 1: */ t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[ 4]; t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[ 5]; t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[ 6]; t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[ 7]; /* round 2: */ s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[ 8]; s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[ 9]; s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[10]; s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[11]; /* round 3: */ t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[12]; t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[13]; t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[14]; t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[15]; /* round 4: */ s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[16]; s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[17]; s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[18]; s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[19]; /* round 5: */ t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[20]; t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[21]; t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[22]; t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[23]; /* round 6: */ s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[24]; s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[25]; s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[26]; s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[27]; /* round 7: */ t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[28]; t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[29]; t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[30]; t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[31]; /* round 8: */ s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[32]; s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[33]; s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[34]; s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[35]; /* round 9: */ t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[36]; t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[37]; t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[38]; t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[39]; /* round 10: */ s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[40]; s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[41]; s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[42]; s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[43]; /* round 11: */ t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[44]; t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[45]; t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[46]; t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[47]; /* round 12: */ s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[48]; s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[49]; s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[50]; s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[51]; /* round 13: */ t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[52]; t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[53]; t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[54]; t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[55]; /* round 14: */ s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[56]; s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[57]; s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[58]; s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[59]; if (384 == tweakey_size) { /* round 15: */ t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[60]; t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[61]; t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[62]; t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[63]; /* round 16: */ s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[64]; s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[65]; s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[66]; s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[67]; } /* Apply the MixColum to invert the last one performe in the Td table */ s0 = Te0[Td4[(s0 >> 24) ] & 0xff] ^ Te1[Td4[(s0 >> 16) & 0xff] & 0xff] ^ Te2[Td4[(s0 >> 8) & 0xff] & 0xff] ^ Te3[Td4[(s0 ) & 0xff] & 0xff]; s1 = Te0[Td4[(s1 >> 24) ] & 0xff] ^ Te1[Td4[(s1 >> 16) & 0xff] & 0xff] ^ Te2[Td4[(s1 >> 8) & 0xff] & 0xff] ^ Te3[Td4[(s1 ) & 0xff] & 0xff]; s2 = Te0[Td4[(s2 >> 24) ] & 0xff] ^ Te1[Td4[(s2 >> 16) & 0xff] & 0xff] ^ Te2[Td4[(s2 >> 8) & 0xff] & 0xff] ^ Te3[Td4[(s2 ) & 0xff] & 0xff]; s3 = Te0[Td4[(s3 >> 24) ] & 0xff] ^ Te1[Td4[(s3 >> 16) & 0xff] & 0xff] ^ Te2[Td4[(s3 >> 8) & 0xff] & 0xff] ^ Te3[Td4[(s3 ) & 0xff] & 0xff]; /* Put the state into the ciphertext */ PUTU32(pt , s0); PUTU32(pt + 4, s1); PUTU32(pt + 8, s2); PUTU32(pt + 12, s3); }
the_stack_data/182953186.c
/* Generated by CIL v. 1.7.0 */ /* print_CIL_Input is false */ struct _IO_FILE; struct timeval; extern void signal(int sig , void *func ) ; extern float strtof(char const *str , char const *endptr ) ; typedef struct _IO_FILE FILE; extern int atoi(char const *s ) ; extern double strtod(char const *str , char const *endptr ) ; extern int fclose(void *stream ) ; extern void *fopen(char const *filename , char const *mode ) ; extern void abort() ; extern void exit(int status ) ; extern int raise(int sig ) ; extern int fprintf(struct _IO_FILE *stream , char const *format , ...) ; extern int strcmp(char const *a , char const *b ) ; extern int rand() ; extern unsigned long strtoul(char const *str , char const *endptr , int base ) ; void RandomFunc(unsigned long input[1] , unsigned long output[1] ) ; extern int strncmp(char const *s1 , char const *s2 , unsigned long maxlen ) ; extern int gettimeofday(struct timeval *tv , void *tz , ...) ; extern int printf(char const *format , ...) ; int main(int argc , char *argv[] ) ; void megaInit(void) ; extern unsigned long strlen(char const *s ) ; extern long strtol(char const *str , char const *endptr , int base ) ; extern unsigned long strnlen(char const *s , unsigned long maxlen ) ; extern void *memcpy(void *s1 , void const *s2 , unsigned long size ) ; struct timeval { long tv_sec ; long tv_usec ; }; extern void *malloc(unsigned long size ) ; extern int scanf(char const *format , ...) ; int main(int argc , char *argv[] ) { unsigned long input[1] ; unsigned long output[1] ; int randomFuns_i5 ; unsigned long randomFuns_value6 ; int randomFuns_main_i7 ; { megaInit(); if (argc != 2) { printf("Call this program with %i arguments\n", 1); exit(-1); } else { } randomFuns_i5 = 0; while (randomFuns_i5 < 1) { randomFuns_value6 = strtoul(argv[randomFuns_i5 + 1], 0, 10); input[randomFuns_i5] = randomFuns_value6; randomFuns_i5 ++; } RandomFunc(input, output); if (output[0] == 4242424242UL) { printf("You win!\n"); } else { } randomFuns_main_i7 = 0; while (randomFuns_main_i7 < 1) { printf("%lu\n", output[randomFuns_main_i7]); randomFuns_main_i7 ++; } } } void megaInit(void) { { } } void RandomFunc(unsigned long input[1] , unsigned long output[1] ) { unsigned long state[1] ; unsigned long local1 ; char copy11 ; unsigned short copy12 ; { state[0UL] = (input[0UL] + 914778474UL) * 67330564296145686UL; local1 = 0UL; while (local1 < input[1UL]) { if (state[0UL] < local1) { if (state[0UL] != local1) { state[0UL] += state[0UL]; } else { copy11 = *((char *)(& state[0UL]) + 1); *((char *)(& state[0UL]) + 1) = *((char *)(& state[0UL]) + 7); *((char *)(& state[0UL]) + 7) = copy11; } } else if (state[0UL] == local1) { state[0UL] -= state[local1]; } else { copy12 = *((unsigned short *)(& state[local1]) + 3); *((unsigned short *)(& state[local1]) + 3) = *((unsigned short *)(& state[local1]) + 0); *((unsigned short *)(& state[local1]) + 0) = copy12; } local1 ++; } output[0UL] = (state[0UL] - 1059477100UL) + 204337520UL; } }
the_stack_data/50138990.c
/* * Copyright (C) 2006 KPIT Cummins * Copyright (C) 2009 Conny Marco Menebröcker * All rights reserved. * * Redistribution and use in source and binary forms is permitted * provided that the above copyright notice and following paragraph are * duplicated in all such forms. * * This file is distributed WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ signed char getchar (void) { asm(" trap #2"); }
the_stack_data/603246.c
// C program for Knight Tour problem #include<stdio.h> #include <stdbool.h> #define N 8 int solveKTUtil(int x, int y, int movei, int sol[N][N], int xMove[N], int yMove[N]); /* A utility function to check if i,j are valid indexes for N*N chessboard */ bool isSafe(int x, int y, int sol[N][N]) { return ( x >= 0 && x < N && y >= 0 && y < N && sol[x][y] == -1); } /* A utility function to print solution matrix sol[N][N] */ void printSolution(int sol[N][N]) { for (int x = 0; x < N; x++) { for (int y = 0; y < N; y++) printf(" %2d ", sol[x][y]); printf("\n"); } } /* This function solves the Knight Tour problem using Backtracking. This function mainly uses solveKTUtil() to solve the problem. It returns false if no complete tour is possible, otherwise return true and prints the tour. Please note that there may be more than one solutions, this function prints one of the feasible solutions. */ bool solveKT() { int sol[N][N]; /* Initialization of solution matrix */ for (int x = 0; x < N; x++) for (int y = 0; y < N; y++) sol[x][y] = -1; /* xMove[] and yMove[] define next move of Knight. xMove[] is for next value of x coordinate yMove[] is for next value of y coordinate */ int xMove[8] = { 2, 1, -1, -2, -2, -1, 1, 2 }; int yMove[8] = { 1, 2, 2, 1, -1, -2, -2, -1 }; // Since the Knight is initially at the first block sol[0][0] = 1; /* Start from 0,0 and explore all tours using solveKTUtil() */ if (solveKTUtil(0, 0, 2, sol, xMove, yMove) == false) { printf("Solution does not exist"); return false; } else printSolution(sol); return true; } /* A recursive utility function to solve Knight Tour problem */ int solveKTUtil(int x, int y, int movei, int sol[N][N], int xMove[N], int yMove[N]) { int k, next_x, next_y; if (movei == (N*N)+1) return true; /* Try all next moves from the current coordinate x, y */ for (k = 0; k < 8; k++) { next_x = x + xMove[k]; next_y = y + yMove[k]; if (isSafe(next_x, next_y, sol)) { sol[next_x][next_y] = movei; if (solveKTUtil(next_x, next_y, movei+1, sol, xMove, yMove) == true) return true; else sol[next_x][next_y] = -1;// backtracking } } return false; } /* Driver program to test above functions */ int main() { solveKT(); getchar(); return 0; }
the_stack_data/443014.c
#include <stdio.h> int main() { double *p; char *c; printf("size of p is %d\n", sizeof(p)); printf("size of p is %d\n", sizeof(c)); printf("%d=%d,%d\n", *&p, &*p, p); }
the_stack_data/179829873.c
/* OMP Implementation Parralelising recBitonicSort, impBitonicSort */ #include <stdio.h> #include <time.h> #include <stdlib.h> #include <omp.h> #include <sys/time.h> //for real time #define MAX_THREADS 256 #define MIN_Q 12 #define MAX_Q 24 #define MIN_P 0 #define MAX_P 8 struct timeval startwtime, endwtime; double seq_time; int activeThreads = 0,maxThreads; omp_lock_t writelock; int N; // data array size int *a; // data array to be sorted const int ASCENDING = 1; const int DESCENDING = 0; void init(void); void print(void); void sort(void); void test(void); inline void exchange(int i, int j); inline void compare(int i, int j, int dir); void bitonicMerge(int lo, int cnt, int dir); void recBitonicSort(int lo, int cnt, int dir); void impBitonicSort(void); int cmpfunc_ascending (const void * a, const void * b); int cmpfunc_descending (const void * a, const void * b); int main(int argc, char **argv) { int p,q; srand(time(NULL)); if(argc !=3) { printf("How to use: %s p q\n where p is the 2^p no. of threads\n where 2^q is problem size (power of two)\n", argv[0]); exit(1); } p = atoi(argv[1]); maxThreads = 1 << p; if ( ( maxThreads < 1 ) || ( maxThreads > MAX_THREADS ) ) { printf("p should be between %d and %d.\n", MIN_P, MAX_P); exit(2); } q = atoi(argv[2]); if( ( q < 12 ) || ( q > 24 ) ){ printf("q should be between %d and %d.\n", MIN_Q, MAX_Q); exit(3); } N = 1 << q; //creating array in main thread a = (int *) malloc(N * sizeof(int)); //Imperative OMP sort init(); printf("\nImperative OMP Implementation:\n"); gettimeofday (&startwtime, NULL); impBitonicSort(); gettimeofday (&endwtime, NULL); seq_time = (double)((endwtime.tv_usec - startwtime.tv_usec)/1.0e6 + endwtime.tv_sec - startwtime.tv_sec); printf("Imperative OMP Wall clock time = %f\n", seq_time); test(); //Recursive OMP Parallel sort omp_init_lock(&writelock); init(); printf("\nRecursive OMP Parralel Implementation:\n"); gettimeofday (&startwtime, NULL); sort(); gettimeofday (&endwtime, NULL); omp_destroy_lock(&writelock); seq_time = (double)((endwtime.tv_usec - startwtime.tv_usec)/1.0e6 + endwtime.tv_sec - startwtime.tv_sec); printf("Parallel OMP Recursive Wall clock time: %f\n", seq_time); test(); //Qsort sort init(); printf("\nqsort Implementation:\n"); gettimeofday (&startwtime, NULL); qsort(a, N, sizeof(int), cmpfunc_ascending ); gettimeofday (&endwtime, NULL); seq_time = (double)((endwtime.tv_usec - startwtime.tv_usec)/1.0e6 + endwtime.tv_sec - startwtime.tv_sec); printf("qsort Wall clock time: %f\n", seq_time); test(); return 0; } /** -------------- SUB-PROCEDURES ----------------- **/ /** procedure test() : verify sort results **/ void test() { int pass = 1; int i; for (i = 1; i < N; i++) { pass &= (a[i-1] <= a[i]); } printf("TEST %s\n",(pass) ? "PASSed" : "FAILed"); } /** procedure init() : initialize array "a" with data **/ void init() { int i; //resetting thread usage to zero for next implementation activeThreads = 0; for (i = 0; i < N; i++) { a[i] = rand() % N; // (N - i); } } /** procedure print() : print array elements **/ void print() { int i; for (i = 0; i < N; i++) { printf("%d\n", a[i]); } printf("\n"); } /** INLINE procedure exchange() : pair swap **/ inline void exchange(int i, int j) { int t; t = a[i]; a[i] = a[j]; a[j] = t; } /** procedure compare() The parameter dir indicates the sorting direction, ASCENDING or DESCENDING; if (a[i] > a[j]) agrees with the direction, then a[i] and a[j] are interchanged. **/ inline void compare(int i, int j, int dir) { if (dir==(a[i]>a[j])) exchange(i,j); } /** Procedure bitonicMerge() It recursively sorts a bitonic sequence in ascending order, if dir = ASCENDING, and in descending order otherwise. The sequence to be sorted starts at index position lo, the parameter cnt is the number of elements to be sorted. **/ void bitonicMerge(int lo, int cnt, int dir) { if ( cnt > 1 ) { int k = cnt / 2 ; int i; for (i=lo; i<(lo+k); i++) compare(i, i+k, dir); bitonicMerge(lo,k,dir); bitonicMerge(lo+k,k,dir); } } /** function recBitonicSort() first produces a bitonic sequence by recursively sorting its two halves in opposite sorting orders, and then calls bitonicMerge to make them in the same order **/ void recBitonicSort(int lo, int cnt, int dir) { if ( cnt > 1 ) { int k = cnt / 2; int parallel = 0; //if the subarrays are less than 100 elements long //we use q sort for faster sorting if( (k-lo)>100 ){ qsort(a+lo, k, sizeof(int), cmpfunc_ascending ); qsort(a+lo+k, k, sizeof(int), cmpfunc_descending ); } else if (activeThreads < maxThreads - 2) { omp_set_lock(&writelock); activeThreads += 2 ; omp_unset_lock(&writelock); //the remaining parallelism needs to run in the available threads omp_set_num_threads(maxThreads - activeThreads); #pragma omp parallel { #pragma omp sections { #pragma omp section recBitonicSort(lo, k, ASCENDING); #pragma omp section recBitonicSort(lo+k, k, DESCENDING); } } parallel = 1; } //Child threads will cease to exist once its completed //so we measure this descreasion if(parallel){ omp_set_lock(&writelock); activeThreads-=2; omp_unset_lock(&writelock); } else{ qsort(a + lo, k, sizeof(int), cmpfunc_ascending ); qsort(a + lo + k, k, sizeof(int), cmpfunc_descending ); } bitonicMerge(lo, cnt, dir); } } /** function sort() Caller of recBitonicSort for sorting the entire array of length N in ASCENDING order **/ void sort() { recBitonicSort(0, N, ASCENDING); } /* imperative version of bitonic sort */ void impBitonicSort() { int i,j,k; omp_set_num_threads(maxThreads - activeThreads); int chunk = (N/(maxThreads - activeThreads) ); for (k=2; k<=N; k=2*k) { for (j=k>>1; j>0; j=j>>1) { #pragma omp parallel for schedule(static,chunk) for (i=0; i<N; i++) { int ij=i^j; if ((ij)>i) { if ((i&k)==0 && a[i] > a[ij]) exchange(i,ij); if ((i&k)!=0 && a[i] < a[ij]) exchange(i,ij); } } } } } /*for qsort*/ int cmpfunc_ascending (const void * a, const void * b) { return ( *(int*)a - *(int*)b ); } int cmpfunc_descending (const void * a, const void * b) { return ( *(int*)b - *(int*)a ); } //from: https://www.tutorialspoint.com/c_standard_library/c_function_qsort.htm
the_stack_data/15762912.c
/* MDH WCET BENCHMARK COLLECTION File version $Id: adpcm.c,v 1.11 2006/02/24 10:18:28 csg Exp $ */ /*************************************************************************/ /* */ /* SNU-RT Benchmark Suite for Worst Case Timing Analysis */ /* ===================================================== */ /* Collected and Modified by S.-S. Lim */ /* [email protected] */ /* Real-Time Research Group */ /* Seoul National University */ /* */ /* */ /* < Features > - restrictions for our experimental environment */ /* */ /* 1. Completely structured. */ /* - There are no unconditional jumps. */ /* - There are no exit from loop bodies. */ /* (There are no 'break' or 'return' in loop bodies) */ /* 2. No 'switch' statements. */ /* 3. No 'do..while' statements. */ /* 4. Expressions are restricted. */ /* - There are no multiple expressions joined by 'or', */ /* 'and' operations. */ /* 5. No library calls. */ /* - All the functions needed are implemented in the */ /* source file. */ /* 6. Printouts removed (Jan G) */ /* */ /* */ /* */ /*************************************************************************/ /* */ /* FILE: adpcm.c */ /* SOURCE : C Algorithms for Real-Time DSP by P. M. Embree */ /* */ /* DESCRIPTION : */ /* */ /* CCITT G.722 ADPCM (Adaptive Differential Pulse Code Modulation) */ /* algorithm. */ /* 16khz sample rate data is stored in the array test_data[SIZE]. */ /* Results are stored in the array compressed[SIZE] and result[SIZE].*/ /* Execution time is determined by the constant SIZE (default value */ /* is 2000). */ /* */ /* REMARK : */ /* */ /* EXECUTION TIME : */ /* */ /* */ /*************************************************************************/ /* Changes: * JG 2005/12/12: Indented program. */ /* To be able to run with printouts #include <stdio.h> */ /* common sampling rate for sound cards on IBM/PC */ #define SAMPLE_RATE 11025 #define PI 3141 #define SIZE 3 #define IN_END 4 /* COMPLEX STRUCTURE */ typedef struct { int real, imag; } COMPLEX; /* function prototypes for fft and filter functions */ void fft(COMPLEX *, int); int fir_filter(int input, int *coef, int n, int *history); int iir_filter(int input, int *coef, int n, int *history); int gaussian(void); int my_abs(int n); void setup_codec(int), key_down(), int_enable(), int_disable(); int flags(int); int getinput(void); void sendout(int), flush(); int encode(int, int); void decode(int); int filtez(int *bpl, int *dlt); void upzero(int dlt, int *dlti, int *bli); int filtep(int rlt1, int al1, int rlt2, int al2); int quantl(int el, int detl); /* int invqxl(int il,int detl,int *code_table,int mode); */ int logscl(int il, int nbl); int scalel(int nbl, int shift_constant); int uppol2(int al1, int al2, int plt, int plt1, int plt2); int uppol1(int al1, int apl2, int plt, int plt1); /* int invqah(int ih,int deth); */ int logsch(int ih, int nbh); void reset(); int my_fabs(int n); int my_cos(int n); int my_sin(int n); /* G722 C code */ /* variables for transimit quadrature mirror filter here */ int tqmf[24]; /* QMF filter coefficients: scaled by a factor of 4 compared to G722 CCITT recommendation */ int h[24] = { 12, -44, -44, 212, 48, -624, 128, 1448, -840, -3220, 3804, 15504, 15504, 3804, -3220, -840, 1448, 128, -624, 48, 212, -44, -44, 12 }; int xl, xh; /* variables for receive quadrature mirror filter here */ int accumc[11], accumd[11]; /* outputs of decode() */ int xout1, xout2; int xs, xd; /* variables for encoder (hi and lo) here */ int il, szl, spl, sl, el; int qq4_code4_table[16] = { 0, -20456, -12896, -8968, -6288, -4240, -2584, -1200, 20456, 12896, 8968, 6288, 4240, 2584, 1200, 0 }; int qq5_code5_table[32] = { -280, -280, -23352, -17560, -14120, -11664, -9752, -8184, -6864, -5712, -4696, -3784, -2960, -2208, -1520, -880, 23352, 17560, 14120, 11664, 9752, 8184, 6864, 5712, 4696, 3784, 2960, 2208, 1520, 880, 280, -280 }; int qq6_code6_table[64] = { -136, -136, -136, -136, -24808, -21904, -19008, -16704, -14984, -13512, -12280, -11192, -10232, -9360, -8576, -7856, -7192, -6576, -6000, -5456, -4944, -4464, -4008, -3576, -3168, -2776, -2400, -2032, -1688, -1360, -1040, -728, 24808, 21904, 19008, 16704, 14984, 13512, 12280, 11192, 10232, 9360, 8576, 7856, 7192, 6576, 6000, 5456, 4944, 4464, 4008, 3576, 3168, 2776, 2400, 2032, 1688, 1360, 1040, 728, 432, 136, -432, -136 }; int delay_bpl[6]; int delay_dltx[6]; int wl_code_table[16] = { -60, 3042, 1198, 538, 334, 172, 58, -30, 3042, 1198, 538, 334, 172, 58, -30, -60 }; int wl_table[8] = { -60, -30, 58, 172, 334, 538, 1198, 3042 }; int ilb_table[32] = { 2048, 2093, 2139, 2186, 2233, 2282, 2332, 2383, 2435, 2489, 2543, 2599, 2656, 2714, 2774, 2834, 2896, 2960, 3025, 3091, 3158, 3228, 3298, 3371, 3444, 3520, 3597, 3676, 3756, 3838, 3922, 4008 }; int nbl; /* delay line */ int al1, al2; int plt, plt1, plt2; int rs; int dlt; int rlt, rlt1, rlt2; /* decision levels - pre-multiplied by 8, 0 to indicate end */ int decis_levl[30] = { 280, 576, 880, 1200, 1520, 1864, 2208, 2584, 2960, 3376, 3784, 4240, 4696, 5200, 5712, 6288, 6864, 7520, 8184, 8968, 9752, 10712, 11664, 12896, 14120, 15840, 17560, 20456, 23352, 32767 }; int detl; /* quantization table 31 long to make quantl look-up easier, last entry is for mil=30 case when wd is max */ int quant26bt_pos[31] = { 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 32 }; /* quantization table 31 long to make quantl look-up easier, last entry is for mil=30 case when wd is max */ int quant26bt_neg[31] = { 63, 62, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 4 }; int deth; int sh; /* this comes from adaptive predictor */ int eh; int qq2_code2_table[4] = { -7408, -1616, 7408, 1616 }; int wh_code_table[4] = { 798, -214, 798, -214 }; int dh, ih; int nbh, szh; int sph, ph, yh, rh; int delay_dhx[6]; int delay_bph[6]; int ah1, ah2; int ph1, ph2; int rh1, rh2; /* variables for decoder here */ int ilr, yl, rl; int dec_deth, dec_detl, dec_dlt; int dec_del_bpl[6]; int dec_del_dltx[6]; int dec_plt, dec_plt1, dec_plt2; int dec_szl, dec_spl, dec_sl; int dec_rlt1, dec_rlt2, dec_rlt; int dec_al1, dec_al2; int dl; int dec_nbl, dec_yh, dec_dh, dec_nbh; /* variables used in filtez */ int dec_del_bph[6]; int dec_del_dhx[6]; int dec_szh; /* variables used in filtep */ int dec_rh1, dec_rh2; int dec_ah1, dec_ah2; int dec_ph, dec_sph; int dec_sh, dec_rh; int dec_ph1, dec_ph2; /* G722 encode function two ints in, one 8 bit output */ /* put input samples in xin1 = first value, xin2 = second value */ /* returns il and ih stored together */ /* MAX: 1 */ int my_abs(int n) { int m; if (n >= 0) m = n; else m = -n; return m; } /* MAX: 1 */ int my_fabs(int n) { int f; if (n >= 0) f = n; else f = -n; return f; } int my_sin(int rad) { int diff; int app = 0; int inc = 1; /* MAX dependent on rad's value, say 50 */ while (rad > 2 * PI) rad -= 2 * PI; /* MAX dependent on rad's value, say 50 */ while (rad < -2 * PI) rad += 2 * PI; diff = rad; app = diff; diff = (diff * (-(rad * rad))) / ((2 * inc) * (2 * inc + 1)); app = app + diff; inc++; /* REALLY: while(my_fabs(diff) >= 0.00001) { */ /* MAX: 1000 */ while (my_fabs(diff) >= 1) { diff = (diff * (-(rad * rad))) / ((2 * inc) * (2 * inc + 1)); app = app + diff; inc++; } return app; } int my_cos(int rad) { return (my_sin(PI / 2 - rad)); } /* MAX: 1 */ int encode(int xin1, int xin2) { int i; int *h_ptr, *tqmf_ptr, *tqmf_ptr1; long int xa, xb; int decis; /* transmit quadrature mirror filters implemented here */ h_ptr = h; tqmf_ptr = tqmf; xa = (long) (*tqmf_ptr++) * (*h_ptr++); xb = (long) (*tqmf_ptr++) * (*h_ptr++); /* main multiply accumulate loop for samples and coefficients */ /* MAX: 10 */ for (i = 0; i < 10; i++) { xa += (long) (*tqmf_ptr++) * (*h_ptr++); xb += (long) (*tqmf_ptr++) * (*h_ptr++); } /* final mult/accumulate */ xa += (long) (*tqmf_ptr++) * (*h_ptr++); xb += (long) (*tqmf_ptr) * (*h_ptr++); /* update delay line tqmf */ tqmf_ptr1 = tqmf_ptr - 2; /* MAX: 22 */ for (i = 0; i < 22; i++) *tqmf_ptr-- = *tqmf_ptr1--; *tqmf_ptr-- = xin1; *tqmf_ptr = xin2; /* scale outputs */ xl = (xa + xb) >> 15; xh = (xa - xb) >> 15; /* end of quadrature mirror filter code */ /* starting with lower sub band encoder */ /* filtez - compute predictor output section - zero section */ szl = filtez(delay_bpl, delay_dltx); /* filtep - compute predictor output signal (pole section) */ spl = filtep(rlt1, al1, rlt2, al2); /* compute the predictor output value in the lower sub_band encoder */ sl = szl + spl; el = xl - sl; /* quantl: quantize the difference signal */ il = quantl(el, detl); /* invqxl: computes quantized difference signal */ /* for invqbl, truncate by 2 lsbs, so mode = 3 */ dlt = ((long) detl * qq4_code4_table[il >> 2]) >> 15; /* logscl: updates logarithmic quant. scale factor in low sub band */ nbl = logscl(il, nbl); /* scalel: compute the quantizer scale factor in the lower sub band */ /* calling parameters nbl and 8 (constant such that scalel can be scaleh) */ detl = scalel(nbl, 8); /* parrec - simple addition to compute recontructed signal for adaptive pred */ plt = dlt + szl; /* upzero: update zero section predictor coefficients (sixth order)*/ /* calling parameters: dlt, dlt1, dlt2, ..., dlt6 from dlt */ /* bpli (linear_buffer in which all six values are delayed */ /* return params: updated bpli, delayed dltx */ upzero(dlt, delay_dltx, delay_bpl); /* uppol2- update second predictor coefficient apl2 and delay it as al2 */ /* calling parameters: al1, al2, plt, plt1, plt2 */ al2 = uppol2(al1, al2, plt, plt1, plt2); /* uppol1 :update first predictor coefficient apl1 and delay it as al1 */ /* calling parameters: al1, apl2, plt, plt1 */ al1 = uppol1(al1, al2, plt, plt1); /* recons : compute recontructed signal for adaptive predictor */ rlt = sl + dlt; /* done with lower sub_band encoder; now implement delays for next time*/ rlt2 = rlt1; rlt1 = rlt; plt2 = plt1; plt1 = plt; /* high band encode */ szh = filtez(delay_bph, delay_dhx); sph = filtep(rh1, ah1, rh2, ah2); /* predic: sh = sph + szh */ sh = sph + szh; /* subtra: eh = xh - sh */ eh = xh - sh; /* quanth - quantization of difference signal for higher sub-band */ /* quanth: in-place for speed params: eh, deth (has init. value) */ if (eh >= 0) { ih = 3; /* 2,3 are pos codes */ } else { ih = 1; /* 0,1 are neg codes */ } decis = (564L * (long) deth) >> 12L; if (my_abs(eh) > decis) ih--; /* mih = 2 case */ /* invqah: compute the quantized difference signal, higher sub-band*/ dh = ((long) deth * qq2_code2_table[ih]) >> 15L; /* logsch: update logarithmic quantizer scale factor in hi sub-band*/ nbh = logsch(ih, nbh); /* note : scalel and scaleh use same code, different parameters */ deth = scalel(nbh, 10); /* parrec - add pole predictor output to quantized diff. signal */ ph = dh + szh; /* upzero: update zero section predictor coefficients (sixth order) */ /* calling parameters: dh, dhi, bphi */ /* return params: updated bphi, delayed dhx */ upzero(dh, delay_dhx, delay_bph); /* uppol2: update second predictor coef aph2 and delay as ah2 */ /* calling params: ah1, ah2, ph, ph1, ph2 */ ah2 = uppol2(ah1, ah2, ph, ph1, ph2); /* uppol1: update first predictor coef. aph2 and delay it as ah1 */ ah1 = uppol1(ah1, ah2, ph, ph1); /* recons for higher sub-band */ yh = sh + dh; /* done with higher sub-band encoder, now Delay for next time */ rh2 = rh1; rh1 = yh; ph2 = ph1; ph1 = ph; /* multiplex ih and il to get signals together */ return (il | (ih << 6)); } /* decode function, result in xout1 and xout2 */ void decode(int input) { int i; long int xa1, xa2; /* qmf accumulators */ int *h_ptr, *ac_ptr, *ac_ptr1, *ad_ptr, *ad_ptr1; /* split transmitted word from input into ilr and ih */ ilr = input & 0x3f; ih = input >> 6; /* LOWER SUB_BAND DECODER */ /* filtez: compute predictor output for zero section */ dec_szl = filtez(dec_del_bpl, dec_del_dltx); /* filtep: compute predictor output signal for pole section */ dec_spl = filtep(dec_rlt1, dec_al1, dec_rlt2, dec_al2); dec_sl = dec_spl + dec_szl; /* invqxl: compute quantized difference signal for adaptive predic */ dec_dlt = ((long) dec_detl * qq4_code4_table[ilr >> 2]) >> 15; /* invqxl: compute quantized difference signal for decoder output */ dl = ((long) dec_detl * qq6_code6_table[il]) >> 15; rl = dl + dec_sl; /* logscl: quantizer scale factor adaptation in the lower sub-band */ dec_nbl = logscl(ilr, dec_nbl); /* scalel: computes quantizer scale factor in the lower sub band */ dec_detl = scalel(dec_nbl, 8); /* parrec - add pole predictor output to quantized diff. signal */ /* for partially reconstructed signal */ dec_plt = dec_dlt + dec_szl; /* upzero: update zero section predictor coefficients */ upzero(dec_dlt, dec_del_dltx, dec_del_bpl); /* uppol2: update second predictor coefficient apl2 and delay it as al2 */ dec_al2 = uppol2(dec_al1, dec_al2, dec_plt, dec_plt1, dec_plt2); /* uppol1: update first predictor coef. (pole setion) */ dec_al1 = uppol1(dec_al1, dec_al2, dec_plt, dec_plt1); /* recons : compute recontructed signal for adaptive predictor */ dec_rlt = dec_sl + dec_dlt; /* done with lower sub band decoder, implement delays for next time */ dec_rlt2 = dec_rlt1; dec_rlt1 = dec_rlt; dec_plt2 = dec_plt1; dec_plt1 = dec_plt; /* HIGH SUB-BAND DECODER */ /* filtez: compute predictor output for zero section */ dec_szh = filtez(dec_del_bph, dec_del_dhx); /* filtep: compute predictor output signal for pole section */ dec_sph = filtep(dec_rh1, dec_ah1, dec_rh2, dec_ah2); /* predic:compute the predictor output value in the higher sub_band decoder */ dec_sh = dec_sph + dec_szh; /* invqah: in-place compute the quantized difference signal */ dec_dh = ((long) dec_deth * qq2_code2_table[ih]) >> 15L; /* logsch: update logarithmic quantizer scale factor in hi sub band */ dec_nbh = logsch(ih, dec_nbh); /* scalel: compute the quantizer scale factor in the higher sub band */ dec_deth = scalel(dec_nbh, 10); /* parrec: compute partially recontructed signal */ dec_ph = dec_dh + dec_szh; /* upzero: update zero section predictor coefficients */ upzero(dec_dh, dec_del_dhx, dec_del_bph); /* uppol2: update second predictor coefficient aph2 and delay it as ah2 */ dec_ah2 = uppol2(dec_ah1, dec_ah2, dec_ph, dec_ph1, dec_ph2); /* uppol1: update first predictor coef. (pole setion) */ dec_ah1 = uppol1(dec_ah1, dec_ah2, dec_ph, dec_ph1); /* recons : compute recontructed signal for adaptive predictor */ rh = dec_sh + dec_dh; /* done with high band decode, implementing delays for next time here */ dec_rh2 = dec_rh1; dec_rh1 = rh; dec_ph2 = dec_ph1; dec_ph1 = dec_ph; /* end of higher sub_band decoder */ /* end with receive quadrature mirror filters */ xd = rl - rh; xs = rl + rh; /* receive quadrature mirror filters implemented here */ h_ptr = h; ac_ptr = accumc; ad_ptr = accumd; xa1 = (long) xd *(*h_ptr++); xa2 = (long) xs *(*h_ptr++); /* main multiply accumulate loop for samples and coefficients */ for (i = 0; i < 10; i++) { xa1 += (long) (*ac_ptr++) * (*h_ptr++); xa2 += (long) (*ad_ptr++) * (*h_ptr++); } /* final mult/accumulate */ xa1 += (long) (*ac_ptr) * (*h_ptr++); xa2 += (long) (*ad_ptr) * (*h_ptr++); /* scale by 2^14 */ xout1 = xa1 >> 14; xout2 = xa2 >> 14; /* update delay lines */ ac_ptr1 = ac_ptr - 1; ad_ptr1 = ad_ptr - 1; for (i = 0; i < 10; i++) { *ac_ptr-- = *ac_ptr1--; *ad_ptr-- = *ad_ptr1--; } *ac_ptr = xd; *ad_ptr = xs; return; } /* clear all storage locations */ void reset() { int i; detl = dec_detl = 32; /* reset to min scale factor */ deth = dec_deth = 8; nbl = al1 = al2 = plt1 = plt2 = rlt1 = rlt2 = 0; nbh = ah1 = ah2 = ph1 = ph2 = rh1 = rh2 = 0; dec_nbl = dec_al1 = dec_al2 = dec_plt1 = dec_plt2 = dec_rlt1 = dec_rlt2 = 0; dec_nbh = dec_ah1 = dec_ah2 = dec_ph1 = dec_ph2 = dec_rh1 = dec_rh2 = 0; for (i = 0; i < 6; i++) { delay_dltx[i] = 0; delay_dhx[i] = 0; dec_del_dltx[i] = 0; dec_del_dhx[i] = 0; } for (i = 0; i < 6; i++) { delay_bpl[i] = 0; delay_bph[i] = 0; dec_del_bpl[i] = 0; dec_del_bph[i] = 0; } for (i = 0; i < 23; i++) tqmf[i] = 0; for (i = 0; i < 11; i++) { accumc[i] = 0; accumd[i] = 0; } return; } /* filtez - compute predictor output signal (zero section) */ /* input: bpl1-6 and dlt1-6, output: szl */ int filtez(int *bpl, int *dlt) { int i; long int zl; zl = (long) (*bpl++) * (*dlt++); /* MAX: 6 */ for (i = 1; i < 6; i++) zl += (long) (*bpl++) * (*dlt++); return ((int) (zl >> 14)); /* x2 here */ } /* filtep - compute predictor output signal (pole section) */ /* input rlt1-2 and al1-2, output spl */ int filtep(int rlt1, int al1, int rlt2, int al2) { long int pl, pl2; pl = 2 * rlt1; pl = (long) al1 *pl; pl2 = 2 * rlt2; pl += (long) al2 *pl2; return ((int) (pl >> 15)); } /* quantl - quantize the difference signal in the lower sub-band */ int quantl(int el, int detl) { int ril, mil; long int wd, decis; /* abs of difference signal */ wd = my_abs(el); /* determine mil based on decision levels and detl gain */ /* MAX: 30 */ for (mil = 0; mil < 30; mil++) { decis = (decis_levl[mil] * (long) detl) >> 15L; if (wd <= decis) break; } /* if mil=30 then wd is less than all decision levels */ if (el >= 0) ril = quant26bt_pos[mil]; else ril = quant26bt_neg[mil]; return (ril); } /* invqxl is either invqbl or invqal depending on parameters passed */ /* returns dlt, code table is pre-multiplied by 8 */ /* int invqxl(int il,int detl,int *code_table,int mode) */ /* { */ /* long int dlt; */ /* dlt = (long)detl*code_table[il >> (mode-1)]; */ /* return((int)(dlt >> 15)); */ /* } */ /* logscl - update log quantizer scale factor in lower sub-band */ /* note that nbl is passed and returned */ int logscl(int il, int nbl) { long int wd; wd = ((long) nbl * 127L) >> 7L; /* leak factor 127/128 */ nbl = (int) wd + wl_code_table[il >> 2]; if (nbl < 0) nbl = 0; if (nbl > 18432) nbl = 18432; return (nbl); } /* scalel: compute quantizer scale factor in lower or upper sub-band*/ int scalel(int nbl, int shift_constant) { int wd1, wd2, wd3; wd1 = (nbl >> 6) & 31; wd2 = nbl >> 11; wd3 = ilb_table[wd1] >> (shift_constant + 1 - wd2); return (wd3 << 3); } /* upzero - inputs: dlt, dlti[0-5], bli[0-5], outputs: updated bli[0-5] */ /* also implements delay of bli and update of dlti from dlt */ void upzero(int dlt, int *dlti, int *bli) { int i, wd2, wd3; /*if dlt is zero, then no sum into bli */ if (dlt == 0) { for (i = 0; i < 6; i++) { bli[i] = (int) ((255L * bli[i]) >> 8L); /* leak factor of * 255/256 */ } } else { for (i = 0; i < 6; i++) { if ((long) dlt * dlti[i] >= 0) wd2 = 128; else wd2 = -128; wd3 = (int) ((255L * bli[i]) >> 8L); /* leak factor of * 255/256 */ bli[i] = wd2 + wd3; } } /* implement delay line for dlt */ dlti[5] = dlti[4]; dlti[4] = dlti[3]; dlti[3] = dlti[2]; dlti[1] = dlti[0]; dlti[0] = dlt; return; } /* uppol2 - update second predictor coefficient (pole section) */ /* inputs: al1, al2, plt, plt1, plt2. outputs: apl2 */ int uppol2(int al1, int al2, int plt, int plt1, int plt2) { long int wd2, wd4; int apl2; wd2 = 4L * (long) al1; if ((long) plt * plt1 >= 0L) wd2 = -wd2; /* check same sign */ wd2 = wd2 >> 7; /* gain of 1/128 */ if ((long) plt * plt2 >= 0L) { wd4 = wd2 + 128;/* same sign case */ } else { wd4 = wd2 - 128; } apl2 = wd4 + (127L * (long) al2 >> 7L); /* leak factor of 127/128 */ /* apl2 is limited to +-.75 */ if (apl2 > 12288) apl2 = 12288; if (apl2 < -12288) apl2 = -12288; return (apl2); } /* uppol1 - update first predictor coefficient (pole section) */ /* inputs: al1, apl2, plt, plt1. outputs: apl1 */ int uppol1(int al1, int apl2, int plt, int plt1) { long int wd2; int wd3, apl1; wd2 = ((long) al1 * 255L) >> 8L; /* leak factor of 255/256 */ if ((long) plt * plt1 >= 0L) { apl1 = (int) wd2 + 192; /* same sign case */ } else { apl1 = (int) wd2 - 192; } /* note: wd3= .9375-.75 is always positive */ wd3 = 15360 - apl2; /* limit value */ if (apl1 > wd3) apl1 = wd3; if (apl1 < -wd3) apl1 = -wd3; return (apl1); } /* INVQAH: inverse adaptive quantizer for the higher sub-band */ /* returns dh, code table is pre-multiplied by 8 */ /* int invqah(int ih,int deth) */ /* { */ /* long int rdh; */ /* rdh = ((long)deth*qq2_code2_table[ih]) >> 15L ; */ /* return((int)(rdh )); */ /* } */ /* logsch - update log quantizer scale factor in higher sub-band */ /* note that nbh is passed and returned */ int logsch(int ih, int nbh) { int wd; wd = ((long) nbh * 127L) >> 7L; /* leak factor 127/128 */ nbh = wd + wh_code_table[ih]; if (nbh < 0) nbh = 0; if (nbh > 22528) nbh = 22528; return (nbh); } #ifndef Seoul_Mate int main() { int i, j, f /* ,answer */ ; static int test_data[SIZE * 2], compressed[SIZE], result[SIZE * 2]; /* reset, initialize required memory */ reset(); /* read in amplitude and frequency for test data */ /* * scanf("%d",&j); scanf("%d",&f); */ j = 10; f = 2000; /* koers men, anvaends inte */ /* 16 KHz sample rate */ /* XXmain_0, MAX: 2 */ /* * Since the number of times we loop in my_sin depends on the * argument we add the fact: xxmain_0:[]: */ for (i = 0; i < SIZE; i++) { test_data[i] = (int) j *my_cos(f * PI * i); } /* MAX: 2 */ /*******Antar att test_data[0] = 10 och test_data[1]=-6 fran ovan, ******* och att anropet i forloopen blir encode(test_data[0],test_data[0]); och encode(test_data[1],test_data[1]), eftersom att den annars gar *******oever array graensen *******/ for (i = 0; i < IN_END; i += 2) compressed[i / 2] = encode(test_data[i], test_data[i + 1]); /* MAX: 2 */ for (i = 0; i < IN_END; i += 2) { decode(compressed[i / 2]); result[i] = xout1; result[i + 1] = xout2; } /* for( ; j < 32767 ; j++) { i=IN_END-1; printf("\n%4d %4d %4d %4d %4d",j,compressed[i/2] >> 6,compressed[i/2] & 63,result[i],result[i-1]); } */ /* print ih, il */ /* for(i = 0 ; i < IN_END/2 ; i++) printf("\n%4d %2d %2d", i,compressed[i] >> 6,compressed[i] & 63); */ return result[i] + result[i + 1]; } #endif
the_stack_data/198581075.c
#include<stdio.h> #include<stdlib.h> #include<locale.h> /*Crie um algoritmo que leia 3 valores para um vetor de 3 posições e depois calcule a média dos valores acessando o vetor.*/ void main(){ //Para utilizar acentos. setlocale(LC_ALL,""); //Definindo variáveis. float vetor[3]; //Lendo os três valores. for(int i = 0; i < 3; i++){ printf("Digite o %dº valor:", i + 1); scanf("%f", &vetor[i]); } //Calculando média e mostrando na tela. printf("\nMÉDIA = %.2f\n\n", (vetor[0] + vetor[1] + vetor[2]) / 3); }
the_stack_data/48268.c
// BUG: soft lockup in ieee80211_tasklet_handler // https://syzkaller.appspot.com/bug?id=27df43cf7ae73de7d8ee // status:0 // autogenerated by syzkaller (https://github.com/google/syzkaller) #define _GNU_SOURCE #include <arpa/inet.h> #include <dirent.h> #include <endian.h> #include <errno.h> #include <fcntl.h> #include <net/if.h> #include <net/if_arp.h> #include <netinet/in.h> #include <pthread.h> #include <sched.h> #include <setjmp.h> #include <signal.h> #include <stdarg.h> #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/epoll.h> #include <sys/ioctl.h> #include <sys/mount.h> #include <sys/prctl.h> #include <sys/resource.h> #include <sys/socket.h> #include <sys/stat.h> #include <sys/syscall.h> #include <sys/time.h> #include <sys/types.h> #include <sys/uio.h> #include <sys/wait.h> #include <time.h> #include <unistd.h> #include <linux/capability.h> #include <linux/futex.h> #include <linux/genetlink.h> #include <linux/if_addr.h> #include <linux/if_ether.h> #include <linux/if_link.h> #include <linux/if_tun.h> #include <linux/in6.h> #include <linux/ip.h> #include <linux/neighbour.h> #include <linux/net.h> #include <linux/netlink.h> #include <linux/nl80211.h> #include <linux/rfkill.h> #include <linux/rtnetlink.h> #include <linux/tcp.h> #include <linux/veth.h> static unsigned long long procid; static __thread int skip_segv; static __thread jmp_buf segv_env; static void segv_handler(int sig, siginfo_t* info, void* ctx) { uintptr_t addr = (uintptr_t)info->si_addr; const uintptr_t prog_start = 1 << 20; const uintptr_t prog_end = 100 << 20; int skip = __atomic_load_n(&skip_segv, __ATOMIC_RELAXED) != 0; int valid = addr < prog_start || addr > prog_end; if (skip && valid) { _longjmp(segv_env, 1); } exit(sig); } static void install_segv_handler(void) { struct sigaction sa; memset(&sa, 0, sizeof(sa)); sa.sa_handler = SIG_IGN; syscall(SYS_rt_sigaction, 0x20, &sa, NULL, 8); syscall(SYS_rt_sigaction, 0x21, &sa, NULL, 8); memset(&sa, 0, sizeof(sa)); sa.sa_sigaction = segv_handler; sa.sa_flags = SA_NODEFER | SA_SIGINFO; sigaction(SIGSEGV, &sa, NULL); sigaction(SIGBUS, &sa, NULL); } #define NONFAILING(...) \ ({ \ int ok = 1; \ __atomic_fetch_add(&skip_segv, 1, __ATOMIC_SEQ_CST); \ if (_setjmp(segv_env) == 0) { \ __VA_ARGS__; \ } else \ ok = 0; \ __atomic_fetch_sub(&skip_segv, 1, __ATOMIC_SEQ_CST); \ ok; \ }) static void sleep_ms(uint64_t ms) { usleep(ms * 1000); } static uint64_t current_time_ms(void) { struct timespec ts; if (clock_gettime(CLOCK_MONOTONIC, &ts)) exit(1); return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000; } static void use_temporary_dir(void) { char tmpdir_template[] = "./syzkaller.XXXXXX"; char* tmpdir = mkdtemp(tmpdir_template); if (!tmpdir) exit(1); if (chmod(tmpdir, 0777)) exit(1); if (chdir(tmpdir)) exit(1); } static void thread_start(void* (*fn)(void*), void* arg) { pthread_t th; pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setstacksize(&attr, 128 << 10); int i = 0; for (; i < 100; i++) { if (pthread_create(&th, &attr, fn, arg) == 0) { pthread_attr_destroy(&attr); return; } if (errno == EAGAIN) { usleep(50); continue; } break; } exit(1); } #define BITMASK(bf_off, bf_len) (((1ull << (bf_len)) - 1) << (bf_off)) #define STORE_BY_BITMASK(type, htobe, addr, val, bf_off, bf_len) \ *(type*)(addr) = \ htobe((htobe(*(type*)(addr)) & ~BITMASK((bf_off), (bf_len))) | \ (((type)(val) << (bf_off)) & BITMASK((bf_off), (bf_len)))) typedef struct { int state; } event_t; static void event_init(event_t* ev) { ev->state = 0; } static void event_reset(event_t* ev) { ev->state = 0; } static void event_set(event_t* ev) { if (ev->state) exit(1); __atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE); syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000); } static void event_wait(event_t* ev) { while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0); } static int event_isset(event_t* ev) { return __atomic_load_n(&ev->state, __ATOMIC_ACQUIRE); } static int event_timedwait(event_t* ev, uint64_t timeout) { uint64_t start = current_time_ms(); uint64_t now = start; for (;;) { uint64_t remain = timeout - (now - start); struct timespec ts; ts.tv_sec = remain / 1000; ts.tv_nsec = (remain % 1000) * 1000 * 1000; syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, &ts); if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE)) return 1; now = current_time_ms(); if (now - start > timeout) return 0; } } static bool write_file(const char* file, const char* what, ...) { char buf[1024]; va_list args; va_start(args, what); vsnprintf(buf, sizeof(buf), what, args); va_end(args); buf[sizeof(buf) - 1] = 0; int len = strlen(buf); int fd = open(file, O_WRONLY | O_CLOEXEC); if (fd == -1) return false; if (write(fd, buf, len) != len) { int err = errno; close(fd); errno = err; return false; } close(fd); return true; } struct nlmsg { char* pos; int nesting; struct nlattr* nested[8]; char buf[4096]; }; static void netlink_init(struct nlmsg* nlmsg, int typ, int flags, const void* data, int size) { memset(nlmsg, 0, sizeof(*nlmsg)); struct nlmsghdr* hdr = (struct nlmsghdr*)nlmsg->buf; hdr->nlmsg_type = typ; hdr->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK | flags; memcpy(hdr + 1, data, size); nlmsg->pos = (char*)(hdr + 1) + NLMSG_ALIGN(size); } static void netlink_attr(struct nlmsg* nlmsg, int typ, const void* data, int size) { struct nlattr* attr = (struct nlattr*)nlmsg->pos; attr->nla_len = sizeof(*attr) + size; attr->nla_type = typ; if (size > 0) memcpy(attr + 1, data, size); nlmsg->pos += NLMSG_ALIGN(attr->nla_len); } static void netlink_nest(struct nlmsg* nlmsg, int typ) { struct nlattr* attr = (struct nlattr*)nlmsg->pos; attr->nla_type = typ; nlmsg->pos += sizeof(*attr); nlmsg->nested[nlmsg->nesting++] = attr; } static void netlink_done(struct nlmsg* nlmsg) { struct nlattr* attr = nlmsg->nested[--nlmsg->nesting]; attr->nla_len = nlmsg->pos - (char*)attr; } static int netlink_send_ext(struct nlmsg* nlmsg, int sock, uint16_t reply_type, int* reply_len, bool dofail) { if (nlmsg->pos > nlmsg->buf + sizeof(nlmsg->buf) || nlmsg->nesting) exit(1); struct nlmsghdr* hdr = (struct nlmsghdr*)nlmsg->buf; hdr->nlmsg_len = nlmsg->pos - nlmsg->buf; struct sockaddr_nl addr; memset(&addr, 0, sizeof(addr)); addr.nl_family = AF_NETLINK; ssize_t n = sendto(sock, nlmsg->buf, hdr->nlmsg_len, 0, (struct sockaddr*)&addr, sizeof(addr)); if (n != (ssize_t)hdr->nlmsg_len) { if (dofail) exit(1); return -1; } n = recv(sock, nlmsg->buf, sizeof(nlmsg->buf), 0); if (reply_len) *reply_len = 0; if (n < 0) { if (dofail) exit(1); return -1; } if (n < (ssize_t)sizeof(struct nlmsghdr)) { errno = EINVAL; if (dofail) exit(1); return -1; } if (hdr->nlmsg_type == NLMSG_DONE) return 0; if (reply_len && hdr->nlmsg_type == reply_type) { *reply_len = n; return 0; } if (n < (ssize_t)(sizeof(struct nlmsghdr) + sizeof(struct nlmsgerr))) { errno = EINVAL; if (dofail) exit(1); return -1; } if (hdr->nlmsg_type != NLMSG_ERROR) { errno = EINVAL; if (dofail) exit(1); return -1; } errno = -((struct nlmsgerr*)(hdr + 1))->error; return -errno; } static int netlink_send(struct nlmsg* nlmsg, int sock) { return netlink_send_ext(nlmsg, sock, 0, NULL, true); } static int netlink_query_family_id(struct nlmsg* nlmsg, int sock, const char* family_name, bool dofail) { struct genlmsghdr genlhdr; memset(&genlhdr, 0, sizeof(genlhdr)); genlhdr.cmd = CTRL_CMD_GETFAMILY; netlink_init(nlmsg, GENL_ID_CTRL, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(nlmsg, CTRL_ATTR_FAMILY_NAME, family_name, strnlen(family_name, GENL_NAMSIZ - 1) + 1); int n = 0; int err = netlink_send_ext(nlmsg, sock, GENL_ID_CTRL, &n, dofail); if (err < 0) { return -1; } uint16_t id = 0; struct nlattr* attr = (struct nlattr*)(nlmsg->buf + NLMSG_HDRLEN + NLMSG_ALIGN(sizeof(genlhdr))); for (; (char*)attr < nlmsg->buf + n; attr = (struct nlattr*)((char*)attr + NLMSG_ALIGN(attr->nla_len))) { if (attr->nla_type == CTRL_ATTR_FAMILY_ID) { id = *(uint16_t*)(attr + 1); break; } } if (!id) { errno = EINVAL; return -1; } recv(sock, nlmsg->buf, sizeof(nlmsg->buf), 0); return id; } static int netlink_next_msg(struct nlmsg* nlmsg, unsigned int offset, unsigned int total_len) { struct nlmsghdr* hdr = (struct nlmsghdr*)(nlmsg->buf + offset); if (offset == total_len || offset + hdr->nlmsg_len > total_len) return -1; return hdr->nlmsg_len; } static void netlink_add_device_impl(struct nlmsg* nlmsg, const char* type, const char* name) { struct ifinfomsg hdr; memset(&hdr, 0, sizeof(hdr)); netlink_init(nlmsg, RTM_NEWLINK, NLM_F_EXCL | NLM_F_CREATE, &hdr, sizeof(hdr)); if (name) netlink_attr(nlmsg, IFLA_IFNAME, name, strlen(name)); netlink_nest(nlmsg, IFLA_LINKINFO); netlink_attr(nlmsg, IFLA_INFO_KIND, type, strlen(type)); } static void netlink_add_device(struct nlmsg* nlmsg, int sock, const char* type, const char* name) { netlink_add_device_impl(nlmsg, type, name); netlink_done(nlmsg); int err = netlink_send(nlmsg, sock); if (err < 0) { } } static void netlink_add_veth(struct nlmsg* nlmsg, int sock, const char* name, const char* peer) { netlink_add_device_impl(nlmsg, "veth", name); netlink_nest(nlmsg, IFLA_INFO_DATA); netlink_nest(nlmsg, VETH_INFO_PEER); nlmsg->pos += sizeof(struct ifinfomsg); netlink_attr(nlmsg, IFLA_IFNAME, peer, strlen(peer)); netlink_done(nlmsg); netlink_done(nlmsg); netlink_done(nlmsg); int err = netlink_send(nlmsg, sock); if (err < 0) { } } static void netlink_add_hsr(struct nlmsg* nlmsg, int sock, const char* name, const char* slave1, const char* slave2) { netlink_add_device_impl(nlmsg, "hsr", name); netlink_nest(nlmsg, IFLA_INFO_DATA); int ifindex1 = if_nametoindex(slave1); netlink_attr(nlmsg, IFLA_HSR_SLAVE1, &ifindex1, sizeof(ifindex1)); int ifindex2 = if_nametoindex(slave2); netlink_attr(nlmsg, IFLA_HSR_SLAVE2, &ifindex2, sizeof(ifindex2)); netlink_done(nlmsg); netlink_done(nlmsg); int err = netlink_send(nlmsg, sock); if (err < 0) { } } static void netlink_add_linked(struct nlmsg* nlmsg, int sock, const char* type, const char* name, const char* link) { netlink_add_device_impl(nlmsg, type, name); netlink_done(nlmsg); int ifindex = if_nametoindex(link); netlink_attr(nlmsg, IFLA_LINK, &ifindex, sizeof(ifindex)); int err = netlink_send(nlmsg, sock); if (err < 0) { } } static void netlink_add_vlan(struct nlmsg* nlmsg, int sock, const char* name, const char* link, uint16_t id, uint16_t proto) { netlink_add_device_impl(nlmsg, "vlan", name); netlink_nest(nlmsg, IFLA_INFO_DATA); netlink_attr(nlmsg, IFLA_VLAN_ID, &id, sizeof(id)); netlink_attr(nlmsg, IFLA_VLAN_PROTOCOL, &proto, sizeof(proto)); netlink_done(nlmsg); netlink_done(nlmsg); int ifindex = if_nametoindex(link); netlink_attr(nlmsg, IFLA_LINK, &ifindex, sizeof(ifindex)); int err = netlink_send(nlmsg, sock); if (err < 0) { } } static void netlink_add_macvlan(struct nlmsg* nlmsg, int sock, const char* name, const char* link) { netlink_add_device_impl(nlmsg, "macvlan", name); netlink_nest(nlmsg, IFLA_INFO_DATA); uint32_t mode = MACVLAN_MODE_BRIDGE; netlink_attr(nlmsg, IFLA_MACVLAN_MODE, &mode, sizeof(mode)); netlink_done(nlmsg); netlink_done(nlmsg); int ifindex = if_nametoindex(link); netlink_attr(nlmsg, IFLA_LINK, &ifindex, sizeof(ifindex)); int err = netlink_send(nlmsg, sock); if (err < 0) { } } static void netlink_add_geneve(struct nlmsg* nlmsg, int sock, const char* name, uint32_t vni, struct in_addr* addr4, struct in6_addr* addr6) { netlink_add_device_impl(nlmsg, "geneve", name); netlink_nest(nlmsg, IFLA_INFO_DATA); netlink_attr(nlmsg, IFLA_GENEVE_ID, &vni, sizeof(vni)); if (addr4) netlink_attr(nlmsg, IFLA_GENEVE_REMOTE, addr4, sizeof(*addr4)); if (addr6) netlink_attr(nlmsg, IFLA_GENEVE_REMOTE6, addr6, sizeof(*addr6)); netlink_done(nlmsg); netlink_done(nlmsg); int err = netlink_send(nlmsg, sock); if (err < 0) { } } #define IFLA_IPVLAN_FLAGS 2 #define IPVLAN_MODE_L3S 2 #undef IPVLAN_F_VEPA #define IPVLAN_F_VEPA 2 static void netlink_add_ipvlan(struct nlmsg* nlmsg, int sock, const char* name, const char* link, uint16_t mode, uint16_t flags) { netlink_add_device_impl(nlmsg, "ipvlan", name); netlink_nest(nlmsg, IFLA_INFO_DATA); netlink_attr(nlmsg, IFLA_IPVLAN_MODE, &mode, sizeof(mode)); netlink_attr(nlmsg, IFLA_IPVLAN_FLAGS, &flags, sizeof(flags)); netlink_done(nlmsg); netlink_done(nlmsg); int ifindex = if_nametoindex(link); netlink_attr(nlmsg, IFLA_LINK, &ifindex, sizeof(ifindex)); int err = netlink_send(nlmsg, sock); if (err < 0) { } } static void netlink_device_change(struct nlmsg* nlmsg, int sock, const char* name, bool up, const char* master, const void* mac, int macsize, const char* new_name) { struct ifinfomsg hdr; memset(&hdr, 0, sizeof(hdr)); if (up) hdr.ifi_flags = hdr.ifi_change = IFF_UP; hdr.ifi_index = if_nametoindex(name); netlink_init(nlmsg, RTM_NEWLINK, 0, &hdr, sizeof(hdr)); if (new_name) netlink_attr(nlmsg, IFLA_IFNAME, new_name, strlen(new_name)); if (master) { int ifindex = if_nametoindex(master); netlink_attr(nlmsg, IFLA_MASTER, &ifindex, sizeof(ifindex)); } if (macsize) netlink_attr(nlmsg, IFLA_ADDRESS, mac, macsize); int err = netlink_send(nlmsg, sock); if (err < 0) { } } static int netlink_add_addr(struct nlmsg* nlmsg, int sock, const char* dev, const void* addr, int addrsize) { struct ifaddrmsg hdr; memset(&hdr, 0, sizeof(hdr)); hdr.ifa_family = addrsize == 4 ? AF_INET : AF_INET6; hdr.ifa_prefixlen = addrsize == 4 ? 24 : 120; hdr.ifa_scope = RT_SCOPE_UNIVERSE; hdr.ifa_index = if_nametoindex(dev); netlink_init(nlmsg, RTM_NEWADDR, NLM_F_CREATE | NLM_F_REPLACE, &hdr, sizeof(hdr)); netlink_attr(nlmsg, IFA_LOCAL, addr, addrsize); netlink_attr(nlmsg, IFA_ADDRESS, addr, addrsize); return netlink_send(nlmsg, sock); } static void netlink_add_addr4(struct nlmsg* nlmsg, int sock, const char* dev, const char* addr) { struct in_addr in_addr; inet_pton(AF_INET, addr, &in_addr); int err = netlink_add_addr(nlmsg, sock, dev, &in_addr, sizeof(in_addr)); if (err < 0) { } } static void netlink_add_addr6(struct nlmsg* nlmsg, int sock, const char* dev, const char* addr) { struct in6_addr in6_addr; inet_pton(AF_INET6, addr, &in6_addr); int err = netlink_add_addr(nlmsg, sock, dev, &in6_addr, sizeof(in6_addr)); if (err < 0) { } } static void netlink_add_neigh(struct nlmsg* nlmsg, int sock, const char* name, const void* addr, int addrsize, const void* mac, int macsize) { struct ndmsg hdr; memset(&hdr, 0, sizeof(hdr)); hdr.ndm_family = addrsize == 4 ? AF_INET : AF_INET6; hdr.ndm_ifindex = if_nametoindex(name); hdr.ndm_state = NUD_PERMANENT; netlink_init(nlmsg, RTM_NEWNEIGH, NLM_F_EXCL | NLM_F_CREATE, &hdr, sizeof(hdr)); netlink_attr(nlmsg, NDA_DST, addr, addrsize); netlink_attr(nlmsg, NDA_LLADDR, mac, macsize); int err = netlink_send(nlmsg, sock); if (err < 0) { } } static struct nlmsg nlmsg; static int tunfd = -1; #define TUN_IFACE "syz_tun" #define LOCAL_MAC 0xaaaaaaaaaaaa #define REMOTE_MAC 0xaaaaaaaaaabb #define LOCAL_IPV4 "172.20.20.170" #define REMOTE_IPV4 "172.20.20.187" #define LOCAL_IPV6 "fe80::aa" #define REMOTE_IPV6 "fe80::bb" #define IFF_NAPI 0x0010 static void initialize_tun(void) { tunfd = open("/dev/net/tun", O_RDWR | O_NONBLOCK); if (tunfd == -1) { printf("tun: can't open /dev/net/tun: please enable CONFIG_TUN=y\n"); printf("otherwise fuzzing or reproducing might not work as intended\n"); return; } const int kTunFd = 240; if (dup2(tunfd, kTunFd) < 0) exit(1); close(tunfd); tunfd = kTunFd; struct ifreq ifr; memset(&ifr, 0, sizeof(ifr)); strncpy(ifr.ifr_name, TUN_IFACE, IFNAMSIZ); ifr.ifr_flags = IFF_TAP | IFF_NO_PI; if (ioctl(tunfd, TUNSETIFF, (void*)&ifr) < 0) { exit(1); } char sysctl[64]; sprintf(sysctl, "/proc/sys/net/ipv6/conf/%s/accept_dad", TUN_IFACE); write_file(sysctl, "0"); sprintf(sysctl, "/proc/sys/net/ipv6/conf/%s/router_solicitations", TUN_IFACE); write_file(sysctl, "0"); int sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (sock == -1) exit(1); netlink_add_addr4(&nlmsg, sock, TUN_IFACE, LOCAL_IPV4); netlink_add_addr6(&nlmsg, sock, TUN_IFACE, LOCAL_IPV6); uint64_t macaddr = REMOTE_MAC; struct in_addr in_addr; inet_pton(AF_INET, REMOTE_IPV4, &in_addr); netlink_add_neigh(&nlmsg, sock, TUN_IFACE, &in_addr, sizeof(in_addr), &macaddr, ETH_ALEN); struct in6_addr in6_addr; inet_pton(AF_INET6, REMOTE_IPV6, &in6_addr); netlink_add_neigh(&nlmsg, sock, TUN_IFACE, &in6_addr, sizeof(in6_addr), &macaddr, ETH_ALEN); macaddr = LOCAL_MAC; netlink_device_change(&nlmsg, sock, TUN_IFACE, true, 0, &macaddr, ETH_ALEN, NULL); close(sock); } #define DEVLINK_FAMILY_NAME "devlink" #define DEVLINK_CMD_PORT_GET 5 #define DEVLINK_ATTR_BUS_NAME 1 #define DEVLINK_ATTR_DEV_NAME 2 #define DEVLINK_ATTR_NETDEV_NAME 7 static struct nlmsg nlmsg2; static void initialize_devlink_ports(const char* bus_name, const char* dev_name, const char* netdev_prefix) { struct genlmsghdr genlhdr; int len, total_len, id, err, offset; uint16_t netdev_index; int sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC); if (sock == -1) exit(1); int rtsock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (rtsock == -1) exit(1); id = netlink_query_family_id(&nlmsg, sock, DEVLINK_FAMILY_NAME, true); if (id == -1) goto error; memset(&genlhdr, 0, sizeof(genlhdr)); genlhdr.cmd = DEVLINK_CMD_PORT_GET; netlink_init(&nlmsg, id, NLM_F_DUMP, &genlhdr, sizeof(genlhdr)); netlink_attr(&nlmsg, DEVLINK_ATTR_BUS_NAME, bus_name, strlen(bus_name) + 1); netlink_attr(&nlmsg, DEVLINK_ATTR_DEV_NAME, dev_name, strlen(dev_name) + 1); err = netlink_send_ext(&nlmsg, sock, id, &total_len, true); if (err < 0) { goto error; } offset = 0; netdev_index = 0; while ((len = netlink_next_msg(&nlmsg, offset, total_len)) != -1) { struct nlattr* attr = (struct nlattr*)(nlmsg.buf + offset + NLMSG_HDRLEN + NLMSG_ALIGN(sizeof(genlhdr))); for (; (char*)attr < nlmsg.buf + offset + len; attr = (struct nlattr*)((char*)attr + NLMSG_ALIGN(attr->nla_len))) { if (attr->nla_type == DEVLINK_ATTR_NETDEV_NAME) { char* port_name; char netdev_name[IFNAMSIZ]; port_name = (char*)(attr + 1); snprintf(netdev_name, sizeof(netdev_name), "%s%d", netdev_prefix, netdev_index); netlink_device_change(&nlmsg2, rtsock, port_name, true, 0, 0, 0, netdev_name); break; } } offset += len; netdev_index++; } error: close(rtsock); close(sock); } #define WIFI_INITIAL_DEVICE_COUNT 2 #define WIFI_MAC_BASE \ { \ 0x08, 0x02, 0x11, 0x00, 0x00, 0x00 \ } #define WIFI_IBSS_BSSID \ { \ 0x50, 0x50, 0x50, 0x50, 0x50, 0x50 \ } #define WIFI_IBSS_SSID \ { \ 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 \ } #define WIFI_DEFAULT_FREQUENCY 2412 #define WIFI_DEFAULT_SIGNAL 0 #define WIFI_DEFAULT_RX_RATE 1 #define HWSIM_CMD_REGISTER 1 #define HWSIM_CMD_FRAME 2 #define HWSIM_CMD_NEW_RADIO 4 #define HWSIM_ATTR_SUPPORT_P2P_DEVICE 14 #define HWSIM_ATTR_PERM_ADDR 22 #define IF_OPER_UP 6 struct join_ibss_props { int wiphy_freq; bool wiphy_freq_fixed; uint8_t* mac; uint8_t* ssid; int ssid_len; }; static int set_interface_state(const char* interface_name, int on) { struct ifreq ifr; int sock = socket(AF_INET, SOCK_DGRAM, 0); if (sock < 0) { return -1; } memset(&ifr, 0, sizeof(ifr)); strcpy(ifr.ifr_name, interface_name); int ret = ioctl(sock, SIOCGIFFLAGS, &ifr); if (ret < 0) { close(sock); return -1; } if (on) ifr.ifr_flags |= IFF_UP; else ifr.ifr_flags &= ~IFF_UP; ret = ioctl(sock, SIOCSIFFLAGS, &ifr); close(sock); if (ret < 0) { return -1; } return 0; } static int nl80211_set_interface(struct nlmsg* nlmsg, int sock, int nl80211_family, uint32_t ifindex, uint32_t iftype) { struct genlmsghdr genlhdr; memset(&genlhdr, 0, sizeof(genlhdr)); genlhdr.cmd = NL80211_CMD_SET_INTERFACE; netlink_init(nlmsg, nl80211_family, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(nlmsg, NL80211_ATTR_IFINDEX, &ifindex, sizeof(ifindex)); netlink_attr(nlmsg, NL80211_ATTR_IFTYPE, &iftype, sizeof(iftype)); int err = netlink_send(nlmsg, sock); if (err < 0) { } return err; } static int nl80211_join_ibss(struct nlmsg* nlmsg, int sock, int nl80211_family, uint32_t ifindex, struct join_ibss_props* props) { struct genlmsghdr genlhdr; memset(&genlhdr, 0, sizeof(genlhdr)); genlhdr.cmd = NL80211_CMD_JOIN_IBSS; netlink_init(nlmsg, nl80211_family, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(nlmsg, NL80211_ATTR_IFINDEX, &ifindex, sizeof(ifindex)); netlink_attr(nlmsg, NL80211_ATTR_SSID, props->ssid, props->ssid_len); netlink_attr(nlmsg, NL80211_ATTR_WIPHY_FREQ, &(props->wiphy_freq), sizeof(props->wiphy_freq)); if (props->mac) netlink_attr(nlmsg, NL80211_ATTR_MAC, props->mac, ETH_ALEN); if (props->wiphy_freq_fixed) netlink_attr(nlmsg, NL80211_ATTR_FREQ_FIXED, NULL, 0); int err = netlink_send(nlmsg, sock); if (err < 0) { } return err; } static int get_ifla_operstate(struct nlmsg* nlmsg, int ifindex) { struct ifinfomsg info; memset(&info, 0, sizeof(info)); info.ifi_family = AF_UNSPEC; info.ifi_index = ifindex; int sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (sock == -1) { return -1; } netlink_init(nlmsg, RTM_GETLINK, 0, &info, sizeof(info)); int n; int err = netlink_send_ext(nlmsg, sock, RTM_NEWLINK, &n, true); close(sock); if (err) { return -1; } struct rtattr* attr = IFLA_RTA(NLMSG_DATA(nlmsg->buf)); for (; RTA_OK(attr, n); attr = RTA_NEXT(attr, n)) { if (attr->rta_type == IFLA_OPERSTATE) return *((int32_t*)RTA_DATA(attr)); } return -1; } static int await_ifla_operstate(struct nlmsg* nlmsg, char* interface, int operstate) { int ifindex = if_nametoindex(interface); while (true) { usleep(1000); int ret = get_ifla_operstate(nlmsg, ifindex); if (ret < 0) return ret; if (ret == operstate) return 0; } return 0; } static int nl80211_setup_ibss_interface(struct nlmsg* nlmsg, int sock, int nl80211_family_id, char* interface, struct join_ibss_props* ibss_props) { int ifindex = if_nametoindex(interface); if (ifindex == 0) { return -1; } int ret = nl80211_set_interface(nlmsg, sock, nl80211_family_id, ifindex, NL80211_IFTYPE_ADHOC); if (ret < 0) { return -1; } ret = set_interface_state(interface, 1); if (ret < 0) { return -1; } ret = nl80211_join_ibss(nlmsg, sock, nl80211_family_id, ifindex, ibss_props); if (ret < 0) { return -1; } return 0; } static int hwsim80211_create_device(struct nlmsg* nlmsg, int sock, int hwsim_family, uint8_t mac_addr[ETH_ALEN]) { struct genlmsghdr genlhdr; memset(&genlhdr, 0, sizeof(genlhdr)); genlhdr.cmd = HWSIM_CMD_NEW_RADIO; netlink_init(nlmsg, hwsim_family, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(nlmsg, HWSIM_ATTR_SUPPORT_P2P_DEVICE, NULL, 0); netlink_attr(nlmsg, HWSIM_ATTR_PERM_ADDR, mac_addr, ETH_ALEN); int err = netlink_send(nlmsg, sock); if (err < 0) { } return err; } static void initialize_wifi_devices(void) { uint8_t mac_addr[6] = WIFI_MAC_BASE; int sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC); if (sock < 0) { return; } int hwsim_family_id = netlink_query_family_id(&nlmsg, sock, "MAC80211_HWSIM", true); int nl80211_family_id = netlink_query_family_id(&nlmsg, sock, "nl80211", true); uint8_t ssid[] = WIFI_IBSS_SSID; uint8_t bssid[] = WIFI_IBSS_BSSID; struct join_ibss_props ibss_props = {.wiphy_freq = WIFI_DEFAULT_FREQUENCY, .wiphy_freq_fixed = true, .mac = bssid, .ssid = ssid, .ssid_len = sizeof(ssid)}; for (int device_id = 0; device_id < WIFI_INITIAL_DEVICE_COUNT; device_id++) { mac_addr[5] = device_id; int ret = hwsim80211_create_device(&nlmsg, sock, hwsim_family_id, mac_addr); if (ret < 0) exit(1); char interface[6] = "wlan0"; interface[4] += device_id; if (nl80211_setup_ibss_interface(&nlmsg, sock, nl80211_family_id, interface, &ibss_props) < 0) exit(1); } for (int device_id = 0; device_id < WIFI_INITIAL_DEVICE_COUNT; device_id++) { char interface[6] = "wlan0"; interface[4] += device_id; int ret = await_ifla_operstate(&nlmsg, interface, IF_OPER_UP); if (ret < 0) exit(1); } close(sock); } #define DEV_IPV4 "172.20.20.%d" #define DEV_IPV6 "fe80::%02x" #define DEV_MAC 0x00aaaaaaaaaa static void netdevsim_add(unsigned int addr, unsigned int port_count) { char buf[16]; sprintf(buf, "%u %u", addr, port_count); if (write_file("/sys/bus/netdevsim/new_device", buf)) { snprintf(buf, sizeof(buf), "netdevsim%d", addr); initialize_devlink_ports("netdevsim", buf, "netdevsim"); } } #define WG_GENL_NAME "wireguard" enum wg_cmd { WG_CMD_GET_DEVICE, WG_CMD_SET_DEVICE, }; enum wgdevice_attribute { WGDEVICE_A_UNSPEC, WGDEVICE_A_IFINDEX, WGDEVICE_A_IFNAME, WGDEVICE_A_PRIVATE_KEY, WGDEVICE_A_PUBLIC_KEY, WGDEVICE_A_FLAGS, WGDEVICE_A_LISTEN_PORT, WGDEVICE_A_FWMARK, WGDEVICE_A_PEERS, }; enum wgpeer_attribute { WGPEER_A_UNSPEC, WGPEER_A_PUBLIC_KEY, WGPEER_A_PRESHARED_KEY, WGPEER_A_FLAGS, WGPEER_A_ENDPOINT, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, WGPEER_A_LAST_HANDSHAKE_TIME, WGPEER_A_RX_BYTES, WGPEER_A_TX_BYTES, WGPEER_A_ALLOWEDIPS, WGPEER_A_PROTOCOL_VERSION, }; enum wgallowedip_attribute { WGALLOWEDIP_A_UNSPEC, WGALLOWEDIP_A_FAMILY, WGALLOWEDIP_A_IPADDR, WGALLOWEDIP_A_CIDR_MASK, }; static void netlink_wireguard_setup(void) { const char ifname_a[] = "wg0"; const char ifname_b[] = "wg1"; const char ifname_c[] = "wg2"; const char private_a[] = "\xa0\x5c\xa8\x4f\x6c\x9c\x8e\x38\x53\xe2\xfd\x7a\x70\xae\x0f\xb2\x0f\xa1" "\x52\x60\x0c\xb0\x08\x45\x17\x4f\x08\x07\x6f\x8d\x78\x43"; const char private_b[] = "\xb0\x80\x73\xe8\xd4\x4e\x91\xe3\xda\x92\x2c\x22\x43\x82\x44\xbb\x88\x5c" "\x69\xe2\x69\xc8\xe9\xd8\x35\xb1\x14\x29\x3a\x4d\xdc\x6e"; const char private_c[] = "\xa0\xcb\x87\x9a\x47\xf5\xbc\x64\x4c\x0e\x69\x3f\xa6\xd0\x31\xc7\x4a\x15" "\x53\xb6\xe9\x01\xb9\xff\x2f\x51\x8c\x78\x04\x2f\xb5\x42"; const char public_a[] = "\x97\x5c\x9d\x81\xc9\x83\xc8\x20\x9e\xe7\x81\x25\x4b\x89\x9f\x8e\xd9\x25" "\xae\x9f\x09\x23\xc2\x3c\x62\xf5\x3c\x57\xcd\xbf\x69\x1c"; const char public_b[] = "\xd1\x73\x28\x99\xf6\x11\xcd\x89\x94\x03\x4d\x7f\x41\x3d\xc9\x57\x63\x0e" "\x54\x93\xc2\x85\xac\xa4\x00\x65\xcb\x63\x11\xbe\x69\x6b"; const char public_c[] = "\xf4\x4d\xa3\x67\xa8\x8e\xe6\x56\x4f\x02\x02\x11\x45\x67\x27\x08\x2f\x5c" "\xeb\xee\x8b\x1b\xf5\xeb\x73\x37\x34\x1b\x45\x9b\x39\x22"; const uint16_t listen_a = 20001; const uint16_t listen_b = 20002; const uint16_t listen_c = 20003; const uint16_t af_inet = AF_INET; const uint16_t af_inet6 = AF_INET6; const struct sockaddr_in endpoint_b_v4 = { .sin_family = AF_INET, .sin_port = htons(listen_b), .sin_addr = {htonl(INADDR_LOOPBACK)}}; const struct sockaddr_in endpoint_c_v4 = { .sin_family = AF_INET, .sin_port = htons(listen_c), .sin_addr = {htonl(INADDR_LOOPBACK)}}; struct sockaddr_in6 endpoint_a_v6 = {.sin6_family = AF_INET6, .sin6_port = htons(listen_a)}; endpoint_a_v6.sin6_addr = in6addr_loopback; struct sockaddr_in6 endpoint_c_v6 = {.sin6_family = AF_INET6, .sin6_port = htons(listen_c)}; endpoint_c_v6.sin6_addr = in6addr_loopback; const struct in_addr first_half_v4 = {0}; const struct in_addr second_half_v4 = {(uint32_t)htonl(128 << 24)}; const struct in6_addr first_half_v6 = {{{0}}}; const struct in6_addr second_half_v6 = {{{0x80}}}; const uint8_t half_cidr = 1; const uint16_t persistent_keepalives[] = {1, 3, 7, 9, 14, 19}; struct genlmsghdr genlhdr = {.cmd = WG_CMD_SET_DEVICE, .version = 1}; int sock; int id, err; sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC); if (sock == -1) { return; } id = netlink_query_family_id(&nlmsg, sock, WG_GENL_NAME, true); if (id == -1) goto error; netlink_init(&nlmsg, id, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(&nlmsg, WGDEVICE_A_IFNAME, ifname_a, strlen(ifname_a) + 1); netlink_attr(&nlmsg, WGDEVICE_A_PRIVATE_KEY, private_a, 32); netlink_attr(&nlmsg, WGDEVICE_A_LISTEN_PORT, &listen_a, 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGDEVICE_A_PEERS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGPEER_A_PUBLIC_KEY, public_b, 32); netlink_attr(&nlmsg, WGPEER_A_ENDPOINT, &endpoint_b_v4, sizeof(endpoint_b_v4)); netlink_attr(&nlmsg, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, &persistent_keepalives[0], 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGPEER_A_ALLOWEDIPS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &first_half_v4, sizeof(first_half_v4)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet6, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &first_half_v6, sizeof(first_half_v6)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGPEER_A_PUBLIC_KEY, public_c, 32); netlink_attr(&nlmsg, WGPEER_A_ENDPOINT, &endpoint_c_v6, sizeof(endpoint_c_v6)); netlink_attr(&nlmsg, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, &persistent_keepalives[1], 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGPEER_A_ALLOWEDIPS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &second_half_v4, sizeof(second_half_v4)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet6, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &second_half_v6, sizeof(second_half_v6)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); err = netlink_send(&nlmsg, sock); if (err < 0) { } netlink_init(&nlmsg, id, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(&nlmsg, WGDEVICE_A_IFNAME, ifname_b, strlen(ifname_b) + 1); netlink_attr(&nlmsg, WGDEVICE_A_PRIVATE_KEY, private_b, 32); netlink_attr(&nlmsg, WGDEVICE_A_LISTEN_PORT, &listen_b, 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGDEVICE_A_PEERS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGPEER_A_PUBLIC_KEY, public_a, 32); netlink_attr(&nlmsg, WGPEER_A_ENDPOINT, &endpoint_a_v6, sizeof(endpoint_a_v6)); netlink_attr(&nlmsg, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, &persistent_keepalives[2], 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGPEER_A_ALLOWEDIPS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &first_half_v4, sizeof(first_half_v4)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet6, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &first_half_v6, sizeof(first_half_v6)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGPEER_A_PUBLIC_KEY, public_c, 32); netlink_attr(&nlmsg, WGPEER_A_ENDPOINT, &endpoint_c_v4, sizeof(endpoint_c_v4)); netlink_attr(&nlmsg, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, &persistent_keepalives[3], 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGPEER_A_ALLOWEDIPS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &second_half_v4, sizeof(second_half_v4)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet6, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &second_half_v6, sizeof(second_half_v6)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); err = netlink_send(&nlmsg, sock); if (err < 0) { } netlink_init(&nlmsg, id, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(&nlmsg, WGDEVICE_A_IFNAME, ifname_c, strlen(ifname_c) + 1); netlink_attr(&nlmsg, WGDEVICE_A_PRIVATE_KEY, private_c, 32); netlink_attr(&nlmsg, WGDEVICE_A_LISTEN_PORT, &listen_c, 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGDEVICE_A_PEERS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGPEER_A_PUBLIC_KEY, public_a, 32); netlink_attr(&nlmsg, WGPEER_A_ENDPOINT, &endpoint_a_v6, sizeof(endpoint_a_v6)); netlink_attr(&nlmsg, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, &persistent_keepalives[4], 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGPEER_A_ALLOWEDIPS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &first_half_v4, sizeof(first_half_v4)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet6, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &first_half_v6, sizeof(first_half_v6)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGPEER_A_PUBLIC_KEY, public_b, 32); netlink_attr(&nlmsg, WGPEER_A_ENDPOINT, &endpoint_b_v4, sizeof(endpoint_b_v4)); netlink_attr(&nlmsg, WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL, &persistent_keepalives[5], 2); netlink_nest(&nlmsg, NLA_F_NESTED | WGPEER_A_ALLOWEDIPS); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &second_half_v4, sizeof(second_half_v4)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_nest(&nlmsg, NLA_F_NESTED | 0); netlink_attr(&nlmsg, WGALLOWEDIP_A_FAMILY, &af_inet6, 2); netlink_attr(&nlmsg, WGALLOWEDIP_A_IPADDR, &second_half_v6, sizeof(second_half_v6)); netlink_attr(&nlmsg, WGALLOWEDIP_A_CIDR_MASK, &half_cidr, 1); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); netlink_done(&nlmsg); err = netlink_send(&nlmsg, sock); if (err < 0) { } error: close(sock); } static void initialize_netdevices(void) { char netdevsim[16]; sprintf(netdevsim, "netdevsim%d", (int)procid); struct { const char* type; const char* dev; } devtypes[] = { {"ip6gretap", "ip6gretap0"}, {"bridge", "bridge0"}, {"vcan", "vcan0"}, {"bond", "bond0"}, {"team", "team0"}, {"dummy", "dummy0"}, {"nlmon", "nlmon0"}, {"caif", "caif0"}, {"batadv", "batadv0"}, {"vxcan", "vxcan1"}, {"netdevsim", netdevsim}, {"veth", 0}, {"xfrm", "xfrm0"}, {"wireguard", "wg0"}, {"wireguard", "wg1"}, {"wireguard", "wg2"}, }; const char* devmasters[] = {"bridge", "bond", "team", "batadv"}; struct { const char* name; int macsize; bool noipv6; } devices[] = { {"lo", ETH_ALEN}, {"sit0", 0}, {"bridge0", ETH_ALEN}, {"vcan0", 0, true}, {"tunl0", 0}, {"gre0", 0}, {"gretap0", ETH_ALEN}, {"ip_vti0", 0}, {"ip6_vti0", 0}, {"ip6tnl0", 0}, {"ip6gre0", 0}, {"ip6gretap0", ETH_ALEN}, {"erspan0", ETH_ALEN}, {"bond0", ETH_ALEN}, {"veth0", ETH_ALEN}, {"veth1", ETH_ALEN}, {"team0", ETH_ALEN}, {"veth0_to_bridge", ETH_ALEN}, {"veth1_to_bridge", ETH_ALEN}, {"veth0_to_bond", ETH_ALEN}, {"veth1_to_bond", ETH_ALEN}, {"veth0_to_team", ETH_ALEN}, {"veth1_to_team", ETH_ALEN}, {"veth0_to_hsr", ETH_ALEN}, {"veth1_to_hsr", ETH_ALEN}, {"hsr0", 0}, {"dummy0", ETH_ALEN}, {"nlmon0", 0}, {"vxcan0", 0, true}, {"vxcan1", 0, true}, {"caif0", ETH_ALEN}, {"batadv0", ETH_ALEN}, {netdevsim, ETH_ALEN}, {"xfrm0", ETH_ALEN}, {"veth0_virt_wifi", ETH_ALEN}, {"veth1_virt_wifi", ETH_ALEN}, {"virt_wifi0", ETH_ALEN}, {"veth0_vlan", ETH_ALEN}, {"veth1_vlan", ETH_ALEN}, {"vlan0", ETH_ALEN}, {"vlan1", ETH_ALEN}, {"macvlan0", ETH_ALEN}, {"macvlan1", ETH_ALEN}, {"ipvlan0", ETH_ALEN}, {"ipvlan1", ETH_ALEN}, {"veth0_macvtap", ETH_ALEN}, {"veth1_macvtap", ETH_ALEN}, {"macvtap0", ETH_ALEN}, {"macsec0", ETH_ALEN}, {"veth0_to_batadv", ETH_ALEN}, {"veth1_to_batadv", ETH_ALEN}, {"batadv_slave_0", ETH_ALEN}, {"batadv_slave_1", ETH_ALEN}, {"geneve0", ETH_ALEN}, {"geneve1", ETH_ALEN}, {"wg0", 0}, {"wg1", 0}, {"wg2", 0}, }; int sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (sock == -1) exit(1); unsigned i; for (i = 0; i < sizeof(devtypes) / sizeof(devtypes[0]); i++) netlink_add_device(&nlmsg, sock, devtypes[i].type, devtypes[i].dev); for (i = 0; i < sizeof(devmasters) / (sizeof(devmasters[0])); i++) { char master[32], slave0[32], veth0[32], slave1[32], veth1[32]; sprintf(slave0, "%s_slave_0", devmasters[i]); sprintf(veth0, "veth0_to_%s", devmasters[i]); netlink_add_veth(&nlmsg, sock, slave0, veth0); sprintf(slave1, "%s_slave_1", devmasters[i]); sprintf(veth1, "veth1_to_%s", devmasters[i]); netlink_add_veth(&nlmsg, sock, slave1, veth1); sprintf(master, "%s0", devmasters[i]); netlink_device_change(&nlmsg, sock, slave0, false, master, 0, 0, NULL); netlink_device_change(&nlmsg, sock, slave1, false, master, 0, 0, NULL); } netlink_device_change(&nlmsg, sock, "bridge_slave_0", true, 0, 0, 0, NULL); netlink_device_change(&nlmsg, sock, "bridge_slave_1", true, 0, 0, 0, NULL); netlink_add_veth(&nlmsg, sock, "hsr_slave_0", "veth0_to_hsr"); netlink_add_veth(&nlmsg, sock, "hsr_slave_1", "veth1_to_hsr"); netlink_add_hsr(&nlmsg, sock, "hsr0", "hsr_slave_0", "hsr_slave_1"); netlink_device_change(&nlmsg, sock, "hsr_slave_0", true, 0, 0, 0, NULL); netlink_device_change(&nlmsg, sock, "hsr_slave_1", true, 0, 0, 0, NULL); netlink_add_veth(&nlmsg, sock, "veth0_virt_wifi", "veth1_virt_wifi"); netlink_add_linked(&nlmsg, sock, "virt_wifi", "virt_wifi0", "veth1_virt_wifi"); netlink_add_veth(&nlmsg, sock, "veth0_vlan", "veth1_vlan"); netlink_add_vlan(&nlmsg, sock, "vlan0", "veth0_vlan", 0, htons(ETH_P_8021Q)); netlink_add_vlan(&nlmsg, sock, "vlan1", "veth0_vlan", 1, htons(ETH_P_8021AD)); netlink_add_macvlan(&nlmsg, sock, "macvlan0", "veth1_vlan"); netlink_add_macvlan(&nlmsg, sock, "macvlan1", "veth1_vlan"); netlink_add_ipvlan(&nlmsg, sock, "ipvlan0", "veth0_vlan", IPVLAN_MODE_L2, 0); netlink_add_ipvlan(&nlmsg, sock, "ipvlan1", "veth0_vlan", IPVLAN_MODE_L3S, IPVLAN_F_VEPA); netlink_add_veth(&nlmsg, sock, "veth0_macvtap", "veth1_macvtap"); netlink_add_linked(&nlmsg, sock, "macvtap", "macvtap0", "veth0_macvtap"); netlink_add_linked(&nlmsg, sock, "macsec", "macsec0", "veth1_macvtap"); char addr[32]; sprintf(addr, DEV_IPV4, 14 + 10); struct in_addr geneve_addr4; if (inet_pton(AF_INET, addr, &geneve_addr4) <= 0) exit(1); struct in6_addr geneve_addr6; if (inet_pton(AF_INET6, "fc00::01", &geneve_addr6) <= 0) exit(1); netlink_add_geneve(&nlmsg, sock, "geneve0", 0, &geneve_addr4, 0); netlink_add_geneve(&nlmsg, sock, "geneve1", 1, 0, &geneve_addr6); netdevsim_add((int)procid, 4); netlink_wireguard_setup(); for (i = 0; i < sizeof(devices) / (sizeof(devices[0])); i++) { char addr[32]; sprintf(addr, DEV_IPV4, i + 10); netlink_add_addr4(&nlmsg, sock, devices[i].name, addr); if (!devices[i].noipv6) { sprintf(addr, DEV_IPV6, i + 10); netlink_add_addr6(&nlmsg, sock, devices[i].name, addr); } uint64_t macaddr = DEV_MAC + ((i + 10ull) << 40); netlink_device_change(&nlmsg, sock, devices[i].name, true, 0, &macaddr, devices[i].macsize, NULL); } close(sock); } static void initialize_netdevices_init(void) { int sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (sock == -1) exit(1); struct { const char* type; int macsize; bool noipv6; bool noup; } devtypes[] = { {"nr", 7, true}, {"rose", 5, true, true}, }; unsigned i; for (i = 0; i < sizeof(devtypes) / sizeof(devtypes[0]); i++) { char dev[32], addr[32]; sprintf(dev, "%s%d", devtypes[i].type, (int)procid); sprintf(addr, "172.30.%d.%d", i, (int)procid + 1); netlink_add_addr4(&nlmsg, sock, dev, addr); if (!devtypes[i].noipv6) { sprintf(addr, "fe88::%02x:%02x", i, (int)procid + 1); netlink_add_addr6(&nlmsg, sock, dev, addr); } int macsize = devtypes[i].macsize; uint64_t macaddr = 0xbbbbbb + ((unsigned long long)i << (8 * (macsize - 2))) + (procid << (8 * (macsize - 1))); netlink_device_change(&nlmsg, sock, dev, !devtypes[i].noup, 0, &macaddr, macsize, NULL); } close(sock); } static int read_tun(char* data, int size) { if (tunfd < 0) return -1; int rv = read(tunfd, data, size); if (rv < 0) { if (errno == EAGAIN || errno == EBADFD) return -1; exit(1); } return rv; } static void flush_tun() { char data[1000]; while (read_tun(&data[0], sizeof(data)) != -1) { } } #define MAX_FDS 30 #define BTPROTO_HCI 1 #define ACL_LINK 1 #define SCAN_PAGE 2 typedef struct { uint8_t b[6]; } __attribute__((packed)) bdaddr_t; #define HCI_COMMAND_PKT 1 #define HCI_EVENT_PKT 4 #define HCI_VENDOR_PKT 0xff struct hci_command_hdr { uint16_t opcode; uint8_t plen; } __attribute__((packed)); struct hci_event_hdr { uint8_t evt; uint8_t plen; } __attribute__((packed)); #define HCI_EV_CONN_COMPLETE 0x03 struct hci_ev_conn_complete { uint8_t status; uint16_t handle; bdaddr_t bdaddr; uint8_t link_type; uint8_t encr_mode; } __attribute__((packed)); #define HCI_EV_CONN_REQUEST 0x04 struct hci_ev_conn_request { bdaddr_t bdaddr; uint8_t dev_class[3]; uint8_t link_type; } __attribute__((packed)); #define HCI_EV_REMOTE_FEATURES 0x0b struct hci_ev_remote_features { uint8_t status; uint16_t handle; uint8_t features[8]; } __attribute__((packed)); #define HCI_EV_CMD_COMPLETE 0x0e struct hci_ev_cmd_complete { uint8_t ncmd; uint16_t opcode; } __attribute__((packed)); #define HCI_OP_WRITE_SCAN_ENABLE 0x0c1a #define HCI_OP_READ_BUFFER_SIZE 0x1005 struct hci_rp_read_buffer_size { uint8_t status; uint16_t acl_mtu; uint8_t sco_mtu; uint16_t acl_max_pkt; uint16_t sco_max_pkt; } __attribute__((packed)); #define HCI_OP_READ_BD_ADDR 0x1009 struct hci_rp_read_bd_addr { uint8_t status; bdaddr_t bdaddr; } __attribute__((packed)); #define HCI_EV_LE_META 0x3e struct hci_ev_le_meta { uint8_t subevent; } __attribute__((packed)); #define HCI_EV_LE_CONN_COMPLETE 0x01 struct hci_ev_le_conn_complete { uint8_t status; uint16_t handle; uint8_t role; uint8_t bdaddr_type; bdaddr_t bdaddr; uint16_t interval; uint16_t latency; uint16_t supervision_timeout; uint8_t clk_accurancy; } __attribute__((packed)); struct hci_dev_req { uint16_t dev_id; uint32_t dev_opt; }; struct vhci_vendor_pkt { uint8_t type; uint8_t opcode; uint16_t id; }; #define HCIDEVUP _IOW('H', 201, int) #define HCISETSCAN _IOW('H', 221, int) static int vhci_fd = -1; static void rfkill_unblock_all() { int fd = open("/dev/rfkill", O_WRONLY); if (fd < 0) exit(1); struct rfkill_event event = {0}; event.idx = 0; event.type = RFKILL_TYPE_ALL; event.op = RFKILL_OP_CHANGE_ALL; event.soft = 0; event.hard = 0; if (write(fd, &event, sizeof(event)) < 0) exit(1); close(fd); } static void hci_send_event_packet(int fd, uint8_t evt, void* data, size_t data_len) { struct iovec iv[3]; struct hci_event_hdr hdr; hdr.evt = evt; hdr.plen = data_len; uint8_t type = HCI_EVENT_PKT; iv[0].iov_base = &type; iv[0].iov_len = sizeof(type); iv[1].iov_base = &hdr; iv[1].iov_len = sizeof(hdr); iv[2].iov_base = data; iv[2].iov_len = data_len; if (writev(fd, iv, sizeof(iv) / sizeof(struct iovec)) < 0) exit(1); } static void hci_send_event_cmd_complete(int fd, uint16_t opcode, void* data, size_t data_len) { struct iovec iv[4]; struct hci_event_hdr hdr; hdr.evt = HCI_EV_CMD_COMPLETE; hdr.plen = sizeof(struct hci_ev_cmd_complete) + data_len; struct hci_ev_cmd_complete evt_hdr; evt_hdr.ncmd = 1; evt_hdr.opcode = opcode; uint8_t type = HCI_EVENT_PKT; iv[0].iov_base = &type; iv[0].iov_len = sizeof(type); iv[1].iov_base = &hdr; iv[1].iov_len = sizeof(hdr); iv[2].iov_base = &evt_hdr; iv[2].iov_len = sizeof(evt_hdr); iv[3].iov_base = data; iv[3].iov_len = data_len; if (writev(fd, iv, sizeof(iv) / sizeof(struct iovec)) < 0) exit(1); } static bool process_command_pkt(int fd, char* buf, ssize_t buf_size) { struct hci_command_hdr* hdr = (struct hci_command_hdr*)buf; if (buf_size < (ssize_t)sizeof(struct hci_command_hdr) || hdr->plen != buf_size - sizeof(struct hci_command_hdr)) { exit(1); } switch (hdr->opcode) { case HCI_OP_WRITE_SCAN_ENABLE: { uint8_t status = 0; hci_send_event_cmd_complete(fd, hdr->opcode, &status, sizeof(status)); return true; } case HCI_OP_READ_BD_ADDR: { struct hci_rp_read_bd_addr rp = {0}; rp.status = 0; memset(&rp.bdaddr, 0xaa, 6); hci_send_event_cmd_complete(fd, hdr->opcode, &rp, sizeof(rp)); return false; } case HCI_OP_READ_BUFFER_SIZE: { struct hci_rp_read_buffer_size rp = {0}; rp.status = 0; rp.acl_mtu = 1021; rp.sco_mtu = 96; rp.acl_max_pkt = 4; rp.sco_max_pkt = 6; hci_send_event_cmd_complete(fd, hdr->opcode, &rp, sizeof(rp)); return false; } } char dummy[0xf9] = {0}; hci_send_event_cmd_complete(fd, hdr->opcode, dummy, sizeof(dummy)); return false; } static void* event_thread(void* arg) { while (1) { char buf[1024] = {0}; ssize_t buf_size = read(vhci_fd, buf, sizeof(buf)); if (buf_size < 0) exit(1); if (buf_size > 0 && buf[0] == HCI_COMMAND_PKT) { if (process_command_pkt(vhci_fd, buf + 1, buf_size - 1)) break; } } return NULL; } #define HCI_HANDLE_1 200 #define HCI_HANDLE_2 201 static void initialize_vhci() { int hci_sock = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI); if (hci_sock < 0) exit(1); vhci_fd = open("/dev/vhci", O_RDWR); if (vhci_fd == -1) exit(1); const int kVhciFd = 241; if (dup2(vhci_fd, kVhciFd) < 0) exit(1); close(vhci_fd); vhci_fd = kVhciFd; struct vhci_vendor_pkt vendor_pkt; if (read(vhci_fd, &vendor_pkt, sizeof(vendor_pkt)) != sizeof(vendor_pkt)) exit(1); if (vendor_pkt.type != HCI_VENDOR_PKT) exit(1); pthread_t th; if (pthread_create(&th, NULL, event_thread, NULL)) exit(1); int ret = ioctl(hci_sock, HCIDEVUP, vendor_pkt.id); if (ret) { if (errno == ERFKILL) { rfkill_unblock_all(); ret = ioctl(hci_sock, HCIDEVUP, vendor_pkt.id); } if (ret && errno != EALREADY) exit(1); } struct hci_dev_req dr = {0}; dr.dev_id = vendor_pkt.id; dr.dev_opt = SCAN_PAGE; if (ioctl(hci_sock, HCISETSCAN, &dr)) exit(1); struct hci_ev_conn_request request; memset(&request, 0, sizeof(request)); memset(&request.bdaddr, 0xaa, 6); *(uint8_t*)&request.bdaddr.b[5] = 0x10; request.link_type = ACL_LINK; hci_send_event_packet(vhci_fd, HCI_EV_CONN_REQUEST, &request, sizeof(request)); struct hci_ev_conn_complete complete; memset(&complete, 0, sizeof(complete)); complete.status = 0; complete.handle = HCI_HANDLE_1; memset(&complete.bdaddr, 0xaa, 6); *(uint8_t*)&complete.bdaddr.b[5] = 0x10; complete.link_type = ACL_LINK; complete.encr_mode = 0; hci_send_event_packet(vhci_fd, HCI_EV_CONN_COMPLETE, &complete, sizeof(complete)); struct hci_ev_remote_features features; memset(&features, 0, sizeof(features)); features.status = 0; features.handle = HCI_HANDLE_1; hci_send_event_packet(vhci_fd, HCI_EV_REMOTE_FEATURES, &features, sizeof(features)); struct { struct hci_ev_le_meta le_meta; struct hci_ev_le_conn_complete le_conn; } le_conn; memset(&le_conn, 0, sizeof(le_conn)); le_conn.le_meta.subevent = HCI_EV_LE_CONN_COMPLETE; memset(&le_conn.le_conn.bdaddr, 0xaa, 6); *(uint8_t*)&le_conn.le_conn.bdaddr.b[5] = 0x11; le_conn.le_conn.role = 1; le_conn.le_conn.handle = HCI_HANDLE_2; hci_send_event_packet(vhci_fd, HCI_EV_LE_META, &le_conn, sizeof(le_conn)); pthread_join(th, NULL); close(hci_sock); } #define XT_TABLE_SIZE 1536 #define XT_MAX_ENTRIES 10 struct xt_counters { uint64_t pcnt, bcnt; }; struct ipt_getinfo { char name[32]; unsigned int valid_hooks; unsigned int hook_entry[5]; unsigned int underflow[5]; unsigned int num_entries; unsigned int size; }; struct ipt_get_entries { char name[32]; unsigned int size; uint64_t entrytable[XT_TABLE_SIZE / sizeof(uint64_t)]; }; struct ipt_replace { char name[32]; unsigned int valid_hooks; unsigned int num_entries; unsigned int size; unsigned int hook_entry[5]; unsigned int underflow[5]; unsigned int num_counters; struct xt_counters* counters; uint64_t entrytable[XT_TABLE_SIZE / sizeof(uint64_t)]; }; struct ipt_table_desc { const char* name; struct ipt_getinfo info; struct ipt_replace replace; }; static struct ipt_table_desc ipv4_tables[] = { {.name = "filter"}, {.name = "nat"}, {.name = "mangle"}, {.name = "raw"}, {.name = "security"}, }; static struct ipt_table_desc ipv6_tables[] = { {.name = "filter"}, {.name = "nat"}, {.name = "mangle"}, {.name = "raw"}, {.name = "security"}, }; #define IPT_BASE_CTL 64 #define IPT_SO_SET_REPLACE (IPT_BASE_CTL) #define IPT_SO_GET_INFO (IPT_BASE_CTL) #define IPT_SO_GET_ENTRIES (IPT_BASE_CTL + 1) struct arpt_getinfo { char name[32]; unsigned int valid_hooks; unsigned int hook_entry[3]; unsigned int underflow[3]; unsigned int num_entries; unsigned int size; }; struct arpt_get_entries { char name[32]; unsigned int size; uint64_t entrytable[XT_TABLE_SIZE / sizeof(uint64_t)]; }; struct arpt_replace { char name[32]; unsigned int valid_hooks; unsigned int num_entries; unsigned int size; unsigned int hook_entry[3]; unsigned int underflow[3]; unsigned int num_counters; struct xt_counters* counters; uint64_t entrytable[XT_TABLE_SIZE / sizeof(uint64_t)]; }; struct arpt_table_desc { const char* name; struct arpt_getinfo info; struct arpt_replace replace; }; static struct arpt_table_desc arpt_tables[] = { {.name = "filter"}, }; #define ARPT_BASE_CTL 96 #define ARPT_SO_SET_REPLACE (ARPT_BASE_CTL) #define ARPT_SO_GET_INFO (ARPT_BASE_CTL) #define ARPT_SO_GET_ENTRIES (ARPT_BASE_CTL + 1) static void checkpoint_iptables(struct ipt_table_desc* tables, int num_tables, int family, int level) { int fd = socket(family, SOCK_STREAM, IPPROTO_TCP); if (fd == -1) { switch (errno) { case EAFNOSUPPORT: case ENOPROTOOPT: return; } exit(1); } for (int i = 0; i < num_tables; i++) { struct ipt_table_desc* table = &tables[i]; strcpy(table->info.name, table->name); strcpy(table->replace.name, table->name); socklen_t optlen = sizeof(table->info); if (getsockopt(fd, level, IPT_SO_GET_INFO, &table->info, &optlen)) { switch (errno) { case EPERM: case ENOENT: case ENOPROTOOPT: continue; } exit(1); } if (table->info.size > sizeof(table->replace.entrytable)) exit(1); if (table->info.num_entries > XT_MAX_ENTRIES) exit(1); struct ipt_get_entries entries; memset(&entries, 0, sizeof(entries)); strcpy(entries.name, table->name); entries.size = table->info.size; optlen = sizeof(entries) - sizeof(entries.entrytable) + table->info.size; if (getsockopt(fd, level, IPT_SO_GET_ENTRIES, &entries, &optlen)) exit(1); table->replace.valid_hooks = table->info.valid_hooks; table->replace.num_entries = table->info.num_entries; table->replace.size = table->info.size; memcpy(table->replace.hook_entry, table->info.hook_entry, sizeof(table->replace.hook_entry)); memcpy(table->replace.underflow, table->info.underflow, sizeof(table->replace.underflow)); memcpy(table->replace.entrytable, entries.entrytable, table->info.size); } close(fd); } static void reset_iptables(struct ipt_table_desc* tables, int num_tables, int family, int level) { int fd = socket(family, SOCK_STREAM, IPPROTO_TCP); if (fd == -1) { switch (errno) { case EAFNOSUPPORT: case ENOPROTOOPT: return; } exit(1); } for (int i = 0; i < num_tables; i++) { struct ipt_table_desc* table = &tables[i]; if (table->info.valid_hooks == 0) continue; struct ipt_getinfo info; memset(&info, 0, sizeof(info)); strcpy(info.name, table->name); socklen_t optlen = sizeof(info); if (getsockopt(fd, level, IPT_SO_GET_INFO, &info, &optlen)) exit(1); if (memcmp(&table->info, &info, sizeof(table->info)) == 0) { struct ipt_get_entries entries; memset(&entries, 0, sizeof(entries)); strcpy(entries.name, table->name); entries.size = table->info.size; optlen = sizeof(entries) - sizeof(entries.entrytable) + entries.size; if (getsockopt(fd, level, IPT_SO_GET_ENTRIES, &entries, &optlen)) exit(1); if (memcmp(table->replace.entrytable, entries.entrytable, table->info.size) == 0) continue; } struct xt_counters counters[XT_MAX_ENTRIES]; table->replace.num_counters = info.num_entries; table->replace.counters = counters; optlen = sizeof(table->replace) - sizeof(table->replace.entrytable) + table->replace.size; if (setsockopt(fd, level, IPT_SO_SET_REPLACE, &table->replace, optlen)) exit(1); } close(fd); } static void checkpoint_arptables(void) { int fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (fd == -1) { switch (errno) { case EAFNOSUPPORT: case ENOPROTOOPT: return; } exit(1); } for (unsigned i = 0; i < sizeof(arpt_tables) / sizeof(arpt_tables[0]); i++) { struct arpt_table_desc* table = &arpt_tables[i]; strcpy(table->info.name, table->name); strcpy(table->replace.name, table->name); socklen_t optlen = sizeof(table->info); if (getsockopt(fd, SOL_IP, ARPT_SO_GET_INFO, &table->info, &optlen)) { switch (errno) { case EPERM: case ENOENT: case ENOPROTOOPT: continue; } exit(1); } if (table->info.size > sizeof(table->replace.entrytable)) exit(1); if (table->info.num_entries > XT_MAX_ENTRIES) exit(1); struct arpt_get_entries entries; memset(&entries, 0, sizeof(entries)); strcpy(entries.name, table->name); entries.size = table->info.size; optlen = sizeof(entries) - sizeof(entries.entrytable) + table->info.size; if (getsockopt(fd, SOL_IP, ARPT_SO_GET_ENTRIES, &entries, &optlen)) exit(1); table->replace.valid_hooks = table->info.valid_hooks; table->replace.num_entries = table->info.num_entries; table->replace.size = table->info.size; memcpy(table->replace.hook_entry, table->info.hook_entry, sizeof(table->replace.hook_entry)); memcpy(table->replace.underflow, table->info.underflow, sizeof(table->replace.underflow)); memcpy(table->replace.entrytable, entries.entrytable, table->info.size); } close(fd); } static void reset_arptables() { int fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (fd == -1) { switch (errno) { case EAFNOSUPPORT: case ENOPROTOOPT: return; } exit(1); } for (unsigned i = 0; i < sizeof(arpt_tables) / sizeof(arpt_tables[0]); i++) { struct arpt_table_desc* table = &arpt_tables[i]; if (table->info.valid_hooks == 0) continue; struct arpt_getinfo info; memset(&info, 0, sizeof(info)); strcpy(info.name, table->name); socklen_t optlen = sizeof(info); if (getsockopt(fd, SOL_IP, ARPT_SO_GET_INFO, &info, &optlen)) exit(1); if (memcmp(&table->info, &info, sizeof(table->info)) == 0) { struct arpt_get_entries entries; memset(&entries, 0, sizeof(entries)); strcpy(entries.name, table->name); entries.size = table->info.size; optlen = sizeof(entries) - sizeof(entries.entrytable) + entries.size; if (getsockopt(fd, SOL_IP, ARPT_SO_GET_ENTRIES, &entries, &optlen)) exit(1); if (memcmp(table->replace.entrytable, entries.entrytable, table->info.size) == 0) continue; } else { } struct xt_counters counters[XT_MAX_ENTRIES]; table->replace.num_counters = info.num_entries; table->replace.counters = counters; optlen = sizeof(table->replace) - sizeof(table->replace.entrytable) + table->replace.size; if (setsockopt(fd, SOL_IP, ARPT_SO_SET_REPLACE, &table->replace, optlen)) exit(1); } close(fd); } #define NF_BR_NUMHOOKS 6 #define EBT_TABLE_MAXNAMELEN 32 #define EBT_CHAIN_MAXNAMELEN 32 #define EBT_BASE_CTL 128 #define EBT_SO_SET_ENTRIES (EBT_BASE_CTL) #define EBT_SO_GET_INFO (EBT_BASE_CTL) #define EBT_SO_GET_ENTRIES (EBT_SO_GET_INFO + 1) #define EBT_SO_GET_INIT_INFO (EBT_SO_GET_ENTRIES + 1) #define EBT_SO_GET_INIT_ENTRIES (EBT_SO_GET_INIT_INFO + 1) struct ebt_replace { char name[EBT_TABLE_MAXNAMELEN]; unsigned int valid_hooks; unsigned int nentries; unsigned int entries_size; struct ebt_entries* hook_entry[NF_BR_NUMHOOKS]; unsigned int num_counters; struct ebt_counter* counters; char* entries; }; struct ebt_entries { unsigned int distinguisher; char name[EBT_CHAIN_MAXNAMELEN]; unsigned int counter_offset; int policy; unsigned int nentries; char data[0] __attribute__((aligned(__alignof__(struct ebt_replace)))); }; struct ebt_table_desc { const char* name; struct ebt_replace replace; char entrytable[XT_TABLE_SIZE]; }; static struct ebt_table_desc ebt_tables[] = { {.name = "filter"}, {.name = "nat"}, {.name = "broute"}, }; static void checkpoint_ebtables(void) { int fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (fd == -1) { switch (errno) { case EAFNOSUPPORT: case ENOPROTOOPT: return; } exit(1); } for (size_t i = 0; i < sizeof(ebt_tables) / sizeof(ebt_tables[0]); i++) { struct ebt_table_desc* table = &ebt_tables[i]; strcpy(table->replace.name, table->name); socklen_t optlen = sizeof(table->replace); if (getsockopt(fd, SOL_IP, EBT_SO_GET_INIT_INFO, &table->replace, &optlen)) { switch (errno) { case EPERM: case ENOENT: case ENOPROTOOPT: continue; } exit(1); } if (table->replace.entries_size > sizeof(table->entrytable)) exit(1); table->replace.num_counters = 0; table->replace.entries = table->entrytable; optlen = sizeof(table->replace) + table->replace.entries_size; if (getsockopt(fd, SOL_IP, EBT_SO_GET_INIT_ENTRIES, &table->replace, &optlen)) exit(1); } close(fd); } static void reset_ebtables() { int fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (fd == -1) { switch (errno) { case EAFNOSUPPORT: case ENOPROTOOPT: return; } exit(1); } for (unsigned i = 0; i < sizeof(ebt_tables) / sizeof(ebt_tables[0]); i++) { struct ebt_table_desc* table = &ebt_tables[i]; if (table->replace.valid_hooks == 0) continue; struct ebt_replace replace; memset(&replace, 0, sizeof(replace)); strcpy(replace.name, table->name); socklen_t optlen = sizeof(replace); if (getsockopt(fd, SOL_IP, EBT_SO_GET_INFO, &replace, &optlen)) exit(1); replace.num_counters = 0; table->replace.entries = 0; for (unsigned h = 0; h < NF_BR_NUMHOOKS; h++) table->replace.hook_entry[h] = 0; if (memcmp(&table->replace, &replace, sizeof(table->replace)) == 0) { char entrytable[XT_TABLE_SIZE]; memset(&entrytable, 0, sizeof(entrytable)); replace.entries = entrytable; optlen = sizeof(replace) + replace.entries_size; if (getsockopt(fd, SOL_IP, EBT_SO_GET_ENTRIES, &replace, &optlen)) exit(1); if (memcmp(table->entrytable, entrytable, replace.entries_size) == 0) continue; } for (unsigned j = 0, h = 0; h < NF_BR_NUMHOOKS; h++) { if (table->replace.valid_hooks & (1 << h)) { table->replace.hook_entry[h] = (struct ebt_entries*)table->entrytable + j; j++; } } table->replace.entries = table->entrytable; optlen = sizeof(table->replace) + table->replace.entries_size; if (setsockopt(fd, SOL_IP, EBT_SO_SET_ENTRIES, &table->replace, optlen)) exit(1); } close(fd); } static void checkpoint_net_namespace(void) { checkpoint_ebtables(); checkpoint_arptables(); checkpoint_iptables(ipv4_tables, sizeof(ipv4_tables) / sizeof(ipv4_tables[0]), AF_INET, SOL_IP); checkpoint_iptables(ipv6_tables, sizeof(ipv6_tables) / sizeof(ipv6_tables[0]), AF_INET6, SOL_IPV6); } static void reset_net_namespace(void) { reset_ebtables(); reset_arptables(); reset_iptables(ipv4_tables, sizeof(ipv4_tables) / sizeof(ipv4_tables[0]), AF_INET, SOL_IP); reset_iptables(ipv6_tables, sizeof(ipv6_tables) / sizeof(ipv6_tables[0]), AF_INET6, SOL_IPV6); } static void setup_cgroups() { if (mkdir("/syzcgroup", 0777)) { } if (mkdir("/syzcgroup/unified", 0777)) { } if (mount("none", "/syzcgroup/unified", "cgroup2", 0, NULL)) { } if (chmod("/syzcgroup/unified", 0777)) { } write_file("/syzcgroup/unified/cgroup.subtree_control", "+cpu +memory +io +pids +rdma"); if (mkdir("/syzcgroup/cpu", 0777)) { } if (mount("none", "/syzcgroup/cpu", "cgroup", 0, "cpuset,cpuacct,perf_event,hugetlb")) { } write_file("/syzcgroup/cpu/cgroup.clone_children", "1"); write_file("/syzcgroup/cpu/cpuset.memory_pressure_enabled", "1"); if (chmod("/syzcgroup/cpu", 0777)) { } if (mkdir("/syzcgroup/net", 0777)) { } if (mount("none", "/syzcgroup/net", "cgroup", 0, "net_cls,net_prio,devices,freezer")) { } if (chmod("/syzcgroup/net", 0777)) { } } static void setup_cgroups_loop() { int pid = getpid(); char file[128]; char cgroupdir[64]; snprintf(cgroupdir, sizeof(cgroupdir), "/syzcgroup/unified/syz%llu", procid); if (mkdir(cgroupdir, 0777)) { } snprintf(file, sizeof(file), "%s/pids.max", cgroupdir); write_file(file, "32"); snprintf(file, sizeof(file), "%s/memory.low", cgroupdir); write_file(file, "%d", 298 << 20); snprintf(file, sizeof(file), "%s/memory.high", cgroupdir); write_file(file, "%d", 299 << 20); snprintf(file, sizeof(file), "%s/memory.max", cgroupdir); write_file(file, "%d", 300 << 20); snprintf(file, sizeof(file), "%s/cgroup.procs", cgroupdir); write_file(file, "%d", pid); snprintf(cgroupdir, sizeof(cgroupdir), "/syzcgroup/cpu/syz%llu", procid); if (mkdir(cgroupdir, 0777)) { } snprintf(file, sizeof(file), "%s/cgroup.procs", cgroupdir); write_file(file, "%d", pid); snprintf(cgroupdir, sizeof(cgroupdir), "/syzcgroup/net/syz%llu", procid); if (mkdir(cgroupdir, 0777)) { } snprintf(file, sizeof(file), "%s/cgroup.procs", cgroupdir); write_file(file, "%d", pid); } static void setup_cgroups_test() { char cgroupdir[64]; snprintf(cgroupdir, sizeof(cgroupdir), "/syzcgroup/unified/syz%llu", procid); if (symlink(cgroupdir, "./cgroup")) { } snprintf(cgroupdir, sizeof(cgroupdir), "/syzcgroup/cpu/syz%llu", procid); if (symlink(cgroupdir, "./cgroup.cpu")) { } snprintf(cgroupdir, sizeof(cgroupdir), "/syzcgroup/net/syz%llu", procid); if (symlink(cgroupdir, "./cgroup.net")) { } } static void setup_common() { if (mount(0, "/sys/fs/fuse/connections", "fusectl", 0, 0)) { } setup_cgroups(); } static void loop(); static void sandbox_common() { prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); setsid(); struct rlimit rlim; rlim.rlim_cur = rlim.rlim_max = (200 << 20); setrlimit(RLIMIT_AS, &rlim); rlim.rlim_cur = rlim.rlim_max = 32 << 20; setrlimit(RLIMIT_MEMLOCK, &rlim); rlim.rlim_cur = rlim.rlim_max = 136 << 20; setrlimit(RLIMIT_FSIZE, &rlim); rlim.rlim_cur = rlim.rlim_max = 1 << 20; setrlimit(RLIMIT_STACK, &rlim); rlim.rlim_cur = rlim.rlim_max = 0; setrlimit(RLIMIT_CORE, &rlim); rlim.rlim_cur = rlim.rlim_max = 256; setrlimit(RLIMIT_NOFILE, &rlim); if (unshare(CLONE_NEWNS)) { } if (mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, NULL)) { } if (unshare(CLONE_NEWIPC)) { } if (unshare(0x02000000)) { } if (unshare(CLONE_NEWUTS)) { } if (unshare(CLONE_SYSVSEM)) { } typedef struct { const char* name; const char* value; } sysctl_t; static const sysctl_t sysctls[] = { {"/proc/sys/kernel/shmmax", "16777216"}, {"/proc/sys/kernel/shmall", "536870912"}, {"/proc/sys/kernel/shmmni", "1024"}, {"/proc/sys/kernel/msgmax", "8192"}, {"/proc/sys/kernel/msgmni", "1024"}, {"/proc/sys/kernel/msgmnb", "1024"}, {"/proc/sys/kernel/sem", "1024 1048576 500 1024"}, }; unsigned i; for (i = 0; i < sizeof(sysctls) / sizeof(sysctls[0]); i++) write_file(sysctls[i].name, sysctls[i].value); } static int wait_for_loop(int pid) { if (pid < 0) exit(1); int status = 0; while (waitpid(-1, &status, __WALL) != pid) { } return WEXITSTATUS(status); } static void drop_caps(void) { struct __user_cap_header_struct cap_hdr = {}; struct __user_cap_data_struct cap_data[2] = {}; cap_hdr.version = _LINUX_CAPABILITY_VERSION_3; cap_hdr.pid = getpid(); if (syscall(SYS_capget, &cap_hdr, &cap_data)) exit(1); const int drop = (1 << CAP_SYS_PTRACE) | (1 << CAP_SYS_NICE); cap_data[0].effective &= ~drop; cap_data[0].permitted &= ~drop; cap_data[0].inheritable &= ~drop; if (syscall(SYS_capset, &cap_hdr, &cap_data)) exit(1); } static int do_sandbox_none(void) { if (unshare(CLONE_NEWPID)) { } int pid = fork(); if (pid != 0) return wait_for_loop(pid); setup_common(); initialize_vhci(); sandbox_common(); drop_caps(); initialize_netdevices_init(); if (unshare(CLONE_NEWNET)) { } initialize_tun(); initialize_netdevices(); initialize_wifi_devices(); loop(); exit(1); } #define FS_IOC_SETFLAGS _IOW('f', 2, long) static void remove_dir(const char* dir) { int iter = 0; DIR* dp = 0; retry: while (umount2(dir, MNT_DETACH) == 0) { } dp = opendir(dir); if (dp == NULL) { if (errno == EMFILE) { exit(1); } exit(1); } struct dirent* ep = 0; while ((ep = readdir(dp))) { if (strcmp(ep->d_name, ".") == 0 || strcmp(ep->d_name, "..") == 0) continue; char filename[FILENAME_MAX]; snprintf(filename, sizeof(filename), "%s/%s", dir, ep->d_name); while (umount2(filename, MNT_DETACH) == 0) { } struct stat st; if (lstat(filename, &st)) exit(1); if (S_ISDIR(st.st_mode)) { remove_dir(filename); continue; } int i; for (i = 0;; i++) { if (unlink(filename) == 0) break; if (errno == EPERM) { int fd = open(filename, O_RDONLY); if (fd != -1) { long flags = 0; if (ioctl(fd, FS_IOC_SETFLAGS, &flags) == 0) { } close(fd); continue; } } if (errno == EROFS) { break; } if (errno != EBUSY || i > 100) exit(1); if (umount2(filename, MNT_DETACH)) exit(1); } } closedir(dp); for (int i = 0;; i++) { if (rmdir(dir) == 0) break; if (i < 100) { if (errno == EPERM) { int fd = open(dir, O_RDONLY); if (fd != -1) { long flags = 0; if (ioctl(fd, FS_IOC_SETFLAGS, &flags) == 0) { } close(fd); continue; } } if (errno == EROFS) { break; } if (errno == EBUSY) { if (umount2(dir, MNT_DETACH)) exit(1); continue; } if (errno == ENOTEMPTY) { if (iter < 100) { iter++; goto retry; } } } exit(1); } } static void kill_and_wait(int pid, int* status) { kill(-pid, SIGKILL); kill(pid, SIGKILL); for (int i = 0; i < 100; i++) { if (waitpid(-1, status, WNOHANG | __WALL) == pid) return; usleep(1000); } DIR* dir = opendir("/sys/fs/fuse/connections"); if (dir) { for (;;) { struct dirent* ent = readdir(dir); if (!ent) break; if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0) continue; char abort[300]; snprintf(abort, sizeof(abort), "/sys/fs/fuse/connections/%s/abort", ent->d_name); int fd = open(abort, O_WRONLY); if (fd == -1) { continue; } if (write(fd, abort, 1) < 0) { } close(fd); } closedir(dir); } else { } while (waitpid(-1, status, __WALL) != pid) { } } static void setup_loop() { setup_cgroups_loop(); checkpoint_net_namespace(); } static void reset_loop() { reset_net_namespace(); } static void setup_test() { prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); setpgrp(); setup_cgroups_test(); write_file("/proc/self/oom_score_adj", "1000"); flush_tun(); } static void close_fds() { for (int fd = 3; fd < MAX_FDS; fd++) close(fd); } static void setup_binfmt_misc() { if (mount(0, "/proc/sys/fs/binfmt_misc", "binfmt_misc", 0, 0)) { } write_file("/proc/sys/fs/binfmt_misc/register", ":syz0:M:0:\x01::./file0:"); write_file("/proc/sys/fs/binfmt_misc/register", ":syz1:M:1:\x02::./file0:POC"); } static void setup_usb() { if (chmod("/dev/raw-gadget", 0666)) exit(1); } static void setup_sysctl() { static struct { const char* name; const char* data; } files[] = { {"/sys/kernel/debug/x86/nmi_longest_ns", "10000000000"}, {"/proc/sys/kernel/hung_task_check_interval_secs", "20"}, {"/proc/sys/net/core/bpf_jit_enable", "1"}, {"/proc/sys/net/core/bpf_jit_kallsyms", "1"}, {"/proc/sys/net/core/bpf_jit_harden", "0"}, {"/proc/sys/kernel/kptr_restrict", "0"}, {"/proc/sys/kernel/softlockup_all_cpu_backtrace", "1"}, {"/proc/sys/fs/mount-max", "100"}, {"/proc/sys/vm/oom_dump_tasks", "0"}, {"/proc/sys/debug/exception-trace", "0"}, {"/proc/sys/kernel/printk", "7 4 1 3"}, {"/proc/sys/net/ipv4/ping_group_range", "0 65535"}, {"/proc/sys/kernel/keys/gc_delay", "1"}, {"/proc/sys/vm/nr_overcommit_hugepages", "4"}, {"/proc/sys/vm/oom_kill_allocating_task", "1"}, }; for (size_t i = 0; i < sizeof(files) / sizeof(files[0]); i++) { if (!write_file(files[i].name, files[i].data)) printf("write to %s failed: %s\n", files[i].name, strerror(errno)); } } #define NL802154_CMD_SET_SHORT_ADDR 11 #define NL802154_ATTR_IFINDEX 3 #define NL802154_ATTR_SHORT_ADDR 10 static void setup_802154() { int sock_route = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (sock_route == -1) exit(1); int sock_generic = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC); if (sock_generic < 0) exit(1); int nl802154_family_id = netlink_query_family_id(&nlmsg, sock_generic, "nl802154", true); for (int i = 0; i < 2; i++) { char devname[] = "wpan0"; devname[strlen(devname) - 1] += i; uint64_t hwaddr = 0xaaaaaaaaaaaa0002 + (i << 8); uint16_t shortaddr = 0xaaa0 + i; int ifindex = if_nametoindex(devname); struct genlmsghdr genlhdr; memset(&genlhdr, 0, sizeof(genlhdr)); genlhdr.cmd = NL802154_CMD_SET_SHORT_ADDR; netlink_init(&nlmsg, nl802154_family_id, 0, &genlhdr, sizeof(genlhdr)); netlink_attr(&nlmsg, NL802154_ATTR_IFINDEX, &ifindex, sizeof(ifindex)); netlink_attr(&nlmsg, NL802154_ATTR_SHORT_ADDR, &shortaddr, sizeof(shortaddr)); int err = netlink_send(&nlmsg, sock_generic); if (err < 0) { } netlink_device_change(&nlmsg, sock_route, devname, true, 0, &hwaddr, sizeof(hwaddr), 0); if (i == 0) { netlink_add_device_impl(&nlmsg, "lowpan", "lowpan0"); netlink_done(&nlmsg); netlink_attr(&nlmsg, IFLA_LINK, &ifindex, sizeof(ifindex)); int err = netlink_send(&nlmsg, sock_route); if (err < 0) { } } } close(sock_route); close(sock_generic); } struct thread_t { int created, call; event_t ready, done; }; static struct thread_t threads[16]; static void execute_call(int call); static int running; static void* thr(void* arg) { struct thread_t* th = (struct thread_t*)arg; for (;;) { event_wait(&th->ready); event_reset(&th->ready); execute_call(th->call); __atomic_fetch_sub(&running, 1, __ATOMIC_RELAXED); event_set(&th->done); } return 0; } static void execute_one(void) { int i, call, thread; int collide = 0; again: for (call = 0; call < 2; call++) { for (thread = 0; thread < (int)(sizeof(threads) / sizeof(threads[0])); thread++) { struct thread_t* th = &threads[thread]; if (!th->created) { th->created = 1; event_init(&th->ready); event_init(&th->done); event_set(&th->done); thread_start(thr, th); } if (!event_isset(&th->done)) continue; event_reset(&th->done); th->call = call; __atomic_fetch_add(&running, 1, __ATOMIC_RELAXED); event_set(&th->ready); if (collide && (call % 2) == 0) break; event_timedwait(&th->done, 50); break; } } for (i = 0; i < 100 && __atomic_load_n(&running, __ATOMIC_RELAXED); i++) sleep_ms(1); close_fds(); if (!collide) { collide = 1; goto again; } } static void execute_one(void); #define WAIT_FLAGS __WALL static void loop(void) { setup_loop(); int iter = 0; for (;; iter++) { char cwdbuf[32]; sprintf(cwdbuf, "./%d", iter); if (mkdir(cwdbuf, 0777)) exit(1); reset_loop(); int pid = fork(); if (pid < 0) exit(1); if (pid == 0) { if (chdir(cwdbuf)) exit(1); setup_test(); execute_one(); exit(0); } int status = 0; uint64_t start = current_time_ms(); for (;;) { if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid) break; sleep_ms(1); if (current_time_ms() - start < 5000) { continue; } kill_and_wait(pid, &status); break; } remove_dir(cwdbuf); } } uint64_t r[1] = {0xffffffffffffffff}; void execute_call(int call) { intptr_t res = 0; switch (call) { case 0: NONFAILING(*(uint32_t*)0x2001d000 = 1); NONFAILING(*(uint32_t*)0x2001d004 = 0x70); NONFAILING(*(uint8_t*)0x2001d008 = 0); NONFAILING(*(uint8_t*)0x2001d009 = 0); NONFAILING(*(uint8_t*)0x2001d00a = 0); NONFAILING(*(uint8_t*)0x2001d00b = 0); NONFAILING(*(uint32_t*)0x2001d00c = 0); NONFAILING(*(uint64_t*)0x2001d010 = 0x3ff); NONFAILING(*(uint64_t*)0x2001d018 = 0); NONFAILING(*(uint64_t*)0x2001d020 = 0); NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x2001d028, 0, 0, 1)); NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x2001d028, 0, 1, 1)); NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x2001d028, 0, 2, 1)); NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x2001d028, 0, 3, 1)); NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x2001d028, 0, 4, 1)); NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x2001d028, 0, 5, 1)); NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x2001d028, 0, 6, 1)); NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x2001d028, 0, 7, 1)); NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x2001d028, 0, 8, 1)); NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x2001d028, 0, 9, 1)); NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x2001d028, 0, 10, 1)); NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x2001d028, 0, 11, 1)); NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x2001d028, 0, 12, 1)); NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x2001d028, 0, 13, 1)); NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x2001d028, 0, 14, 1)); NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x2001d028, 0, 15, 2)); NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x2001d028, 0, 17, 1)); NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x2001d028, 0, 18, 1)); NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x2001d028, 0, 19, 1)); NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x2001d028, 0, 20, 1)); NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x2001d028, 0, 21, 1)); NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x2001d028, 0, 22, 1)); NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x2001d028, 0, 23, 1)); NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x2001d028, 0, 24, 1)); NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x2001d028, 0, 25, 1)); NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x2001d028, 0, 26, 1)); NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x2001d028, 0, 27, 1)); NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x2001d028, 0, 28, 1)); NONFAILING(STORE_BY_BITMASK(uint64_t, , 0x2001d028, 0, 29, 35)); NONFAILING(*(uint32_t*)0x2001d030 = 0xfffffffe); NONFAILING(*(uint32_t*)0x2001d034 = 0); NONFAILING(*(uint64_t*)0x2001d038 = 0); NONFAILING(*(uint64_t*)0x2001d040 = 0); NONFAILING(*(uint64_t*)0x2001d048 = 0); NONFAILING(*(uint64_t*)0x2001d050 = 0); NONFAILING(*(uint32_t*)0x2001d058 = 0); NONFAILING(*(uint32_t*)0x2001d05c = 0); NONFAILING(*(uint64_t*)0x2001d060 = 0); NONFAILING(*(uint32_t*)0x2001d068 = 0); NONFAILING(*(uint16_t*)0x2001d06c = 0); NONFAILING(*(uint16_t*)0x2001d06e = 0); res = syscall(__NR_perf_event_open, 0x2001d000ul, 0, 0ul, -1, 0ul); if (res != -1) r[0] = res; break; case 1: syscall(__NR_mmap, 0x20ffc000ul, 0x3000ul, 0ul, 0x11ul, r[0], 0ul); break; } } int main(void) { syscall(__NR_mmap, 0x1ffff000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul); syscall(__NR_mmap, 0x21000000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul); setup_sysctl(); setup_binfmt_misc(); setup_usb(); setup_802154(); install_segv_handler(); use_temporary_dir(); do_sandbox_none(); return 0; }
the_stack_data/186651.c
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #include <stdint.h> #include <stdio.h> uint64_t foo() { extern uint64_t goo(); return goo(); }
the_stack_data/22013128.c
#include <stdio.h> #include <math.h> #include <stdlib.h> // библиотека для завершения программы в функции #define K 100 // введение константы double max(double* array, int size, int Y) // функция для рассчитывания max { int i; // объявление переменной типа int double dmax = 0; // объявление переменной типа double for(i = 0; i < size; i++) // цикл для переменной i от 1 до size с шагом { if(fabs(array[i]) < Y && fabs(array[i]) > dmax) // условие для нахождения max dmax = fabs(array[i]); // обновление max } return dmax; // возвращение max } double mean_(double* array, int size) // функция для рассчитывания среднего { int first_i = 0, second_i = 0, i, q; // объявление переменной типа int double sum = 0, mean; // объявление переменных типа double for(i = 0; i <= size; i++) // цикл для определения first_i // (индекса первого положительного элемента) // для переменной i от 1 до size с шагом 1 { if((array[i] > 0) && (first_i == 0)) // условие для нахождения first_i { first_i = i; break; // выход из цикла, когда значение нашлось } } for(i = size - 1; i >= 0; i--) // цикл для определения second_i // (индекса последнего положительного элемента) // для переменной i от size до 1 с шагом 1 { if((array[i] > 0) && (second_i == 0)) // условие для нахождения second_i { second_i = i; break; // выход из цикла, когда значение нашлось } } for(i = first_i + 1; i < second_i; i++) // цикл для нахождения суммы элементов массива { sum += array[i]; // суммирование элементов массива } q = second_i - first_i - 1; // нахождение количества искомых элементов if (sum == 0) return mean; else if(q != 0) { mean = sum / q; // рассчитывание среднего return mean; // возвращение среднего } else { printf("Не обнаружено элементов между первым и последним положительными элементами."); exit(0); // завершение программы при отсутствии искомых элементов } } void print_array(double* array, int size) // функция для считывания массива { int i; // объявление переменных типа int for(i = 0; i < size; i++) // цикл для считывания массива { printf("Введите %d-й элемент: ", i + 1); // вывод номера элемента который нужно считать if(scanf("%lf", &array[i]) == 0 || getchar( ) != '\n') // считывание элементов массива { printf("Ошибка! Элементы массива - вещественные числа."); // вывод ошибки exit(0); // завершение программы } } } int main( ) // основная функция { int k; // объявление переменной типа int double arr[K], res1, res2, Y; // объявление переменных типа double do { printf("Введите размер массива (>1, < %d):", K); // вывод указания ввода количества элементов массива if(scanf("%d", &k) == 0 || getchar( ) != '\n') // ввод количества элементов массива { printf("Ошибка! Переменная k - натуральное число на (1, %d).", K); return 0; } } while(k <= 1 || k >= K); // условие существования массива printf("Введите Y: "); // вывод указания ввода значения Y if(scanf("%lf", &Y) == 0 || getchar( ) != '\n' || Y <= 0) // ввод вещественного положительного Y { printf("Ошибка! Переменная Y - вещественное положительное число."); return 0; } print_array(arr, k); // считывание массива res1 = max(arr, k, Y); // рассчитывание max if (res1 >= 0) { printf("max = %lf \n", res1); // вывод max } else { printf("Максимума не существует.\n"); // вывод ошибки, если не нашлось модуля элемента < Y } res2 = mean_(arr, k); // рассчитывание среднего printf("mean = %lf", res2); // вывод среднего free(arr); // освобождение массива // функция free( ) возвращает память назад в кучу // в результате эта память может выделяться снова return 0; // завершение программы }
the_stack_data/93888526.c
#include<stdio.h> int main () { int n,i; int m,p=1; scanf("%d",&n); if (n==2) printf("3"); else { while(n>2) { n=n+2;m=1;p=1; for(i=3;i<n;++i) { m=n%i!=0; p=p*m; } if(p==1) { break; } } printf("%d",n); } return 0; }
the_stack_data/1078979.c
/*Implemente um programa que irá receber do usuário n números inteiros e determine o menor e o maior destes números e quantas vezes eles ocorrem. Vejamos um exemplo. Vamos receber como valor de n = 6. Em seguida os 6 números inteiros: 9 4 15 28 4 7. O menor e maior valor são 4 e 28, respectivamente. Eles aparecem 2 e 1 vez no vetor. Imprima essas duas duplas no formato (ocorrência, valor). No exemplo acima deve imprimir: (2,4) (1,28).*/ #include <stdio.h> int main(){ int rod, maior, menor, qntMa =0, qntMe =0; scanf("%d", &rod); int num[rod]; for(int cont = 0; cont < rod; cont++){ scanf("%d", &num[cont]); }//fim for1 for(int cont = 0; cont < rod; cont++){ if(cont == 0){ maior = num[0]; menor = num[0]; qntMa++; qntMe++; }else{ if(maior < num[cont]){ maior = num[cont]; qntMa = 1; }else if(maior == num[cont]){ qntMa++; } if(menor > num[cont]){ menor = num[cont]; qntMe = 1; }else if(menor == num[cont]){ qntMe++; } } }//fim for2 printf("(%d, %d) (%d, %d)", qntMe, menor, qntMa, maior); return 0; }
the_stack_data/166317.c
struct A { int i; }; struct B { int i; int j; }; int func(struct A a) { return a.i; } int main() { struct B b; int x; b.i = 1; assert((* ((struct A*)&b)).i == 1); // This works fine. x=func( * ((struct A*)&b)); assert(x == 1); }
the_stack_data/141451.c
#include <stdio.h> #include <math.h> #include <stdlib.h> int main(void) { int a1, a2, b1, b2; int n, d; double d1, d2; int anum = 1, aden = 1; for (int a = 11; a < 99; a++) { for (int b = a+1; b < 100; b++) { if (!(a % 10) || !(b % 10)) { continue; } d1 = (double)a / (double)b; a1 = a / 10; a2 = a % 10; b1 = b / 10; b2 = b % 10; if (a1 == b1) { n = a2; d = b2; } else if (a2 == b2) { n = a1; d = b1; } else if (a1 == b2) { n = a2; d = b1; } else if (a2 == b1) { n = a1; d = b2; } else { continue; } d2 = (double)n / (double)d; if (d1 == d2) { anum *= n; aden *= d; } } } for (int i = 2; i < sqrt(anum); i++) { while (!(anum % i) && !(aden % i)) { anum /= i; aden /= i; } } printf("%d\n", aden); }
the_stack_data/15761682.c
/** This code is adapted from: * https://kerneltrap.org/mailarchive/git/2008/11/21/4186494 * Original code by Vasyl Vavrychuk. * * This file is part of Rockstars. * Coded in Hungarian Notation so it looks stupid. :D * * If you haven't seen the header file, call mmap() and munmap() not the * function names below! */ #ifdef __MINGW32__ #include <stdio.h> #include "mingw_mmap.h" extern int getpagesize(void); /** * Use CreateFileMapping and MapViewOfFile to simulate POSIX mmap(). * Why Microsoft won't just implement these is beyond everyone's comprehension. * @return pointer or NULL */ void *mingw_mmap(void *pStart, size_t sLength, int nProt, int nFlags, int nFd, off_t oOffset) { (void)nProt; HANDLE hHandle; if (pStart != NULL || !(nFlags & MAP_PRIVATE)) { printf("Invalid usage of mingw_mmap"); return NULL; } if (oOffset % getpagesize() != 0) { printf("Offset does not match the memory allocation granularity"); return NULL; } hHandle = CreateFileMapping((HANDLE)_get_osfhandle(nFd), NULL, PAGE_WRITECOPY, 0, 0, NULL); if (hHandle != NULL) { pStart = MapViewOfFile(hHandle, FILE_MAP_COPY, 0, oOffset, sLength); } return pStart; } /** * Use UnmapViewOfFile to undo mmap() above. * @param pStart * @param length - Not used, kept for compatibility. * @return boolean; no checks are performed. */ int mingw_munmap(void *pStart, size_t sLength) { (void)sLength; if (UnmapViewOfFile(pStart) != 0) return FALSE; return TRUE; } #endif
the_stack_data/70462.c
#include <stdio.h> float main(){ float renda, conta, imposto, imposto1, imposto2, imposto3, imposto4; scanf("%f", &renda); if(renda>=0 && renda<=2000){ printf("Isento\n"); } else{ if(renda>2000 && renda<=3000){ conta = renda - 2000.0; imposto = conta * 0.08; printf("R$ %.2f\n", imposto); } if(renda>3000 && renda<=4500){ conta = renda - 2000.0; if(conta>=1000){ conta = conta - 1000; imposto1 = conta * 0.18; imposto2 = 1000*0.08; imposto = imposto1+imposto2; printf("R$ %.2f\n", imposto); } else{ imposto = conta * 0.08; printf("R$ %.2f\n", imposto); } } if(renda>4500){ // conta = renda - 2000.0; imposto4 = 1000*0.08 + 1500 *0.18 +(renda - 4500)*0.28; imposto = imposto4; printf("R$ %.2f\n", imposto); // if(conta>=1000 && conta<=2500){ // conta = conta - 1000; // imposto1 = conta * 0.18; // imposto2 = 1000*0.08; // imposto = imposto1+imposto2; // printf("R$ %.2f\n", imposto); // } // else{ // conta = conta - 1000; // imposto2 = 1000*0.08; // if(conta>=4500){ // conta = conta - 1500; // imposto1 = conta * 0.28; // imposto3 = 1500*0.18; // imposto = imposto1+imposto2+imposto3; // printf("R$ %.2f\n", imposto); // } // else{ // imposto3 = conta * 0.28; // imposto1 = conta*0.18; // imposto = imposto1+imposto2; // printf("R$ %.2f\n", imposto); // } // } } } return 0; }
the_stack_data/57324.c
/* * POK header * * The following file is a part of the POK project. Any modification should * be made according to the POK licence. You CANNOT use this file or a part * of a file for your own project. * * For more information on the POK licence, please see our LICENCE FILE * * Please follow the coding guidelines described in doc/CODING_GUIDELINES * * Copyright (c) 2007-2020 POK team */ #if defined(POK_NEEDS_EVENTS) || defined(POK_NEEDS_BUFFERS) || \ defined(POK_NEEDS_BLACKBOARDS) #include <core/event.h> #include <core/lockobj.h> #include <core/syscall.h> #include <errno.h> #include <types.h> pok_ret_t pok_event_signal(pok_event_id_t id) { pok_lockobj_lockattr_t lockattr; lockattr.operation = LOCKOBJ_OPERATION_SIGNAL; lockattr.obj_kind = POK_LOCKOBJ_KIND_EVENT; return pok_syscall2(POK_SYSCALL_LOCKOBJ_OPERATION, (uint32_t)id, (uint32_t)&lockattr); } #endif
the_stack_data/111819.c
#include <stdio.h> int main(){ int n,num,max=-2147483648,min=2147483647; scanf("%d",&n); for(int i=0;i<n;i++){ scanf("%d",&num); if(num>max) max = num; if(num<min) min = num; } printf("%d %d",min,max); return 0; }
the_stack_data/514.c
/* Generated by CIL v. 1.7.0 */ /* print_CIL_Input is false */ struct _IO_FILE; struct timeval; extern float strtof(char const *str , char const *endptr ) ; extern void signal(int sig , void *func ) ; typedef struct _IO_FILE FILE; extern int atoi(char const *s ) ; extern double strtod(char const *str , char const *endptr ) ; extern int fclose(void *stream ) ; extern void *fopen(char const *filename , char const *mode ) ; extern void abort() ; extern void exit(int status ) ; extern int raise(int sig ) ; extern int fprintf(struct _IO_FILE *stream , char const *format , ...) ; extern int strcmp(char const *a , char const *b ) ; extern int rand() ; extern unsigned long strtoul(char const *str , char const *endptr , int base ) ; void RandomFunc(unsigned long input[1] , unsigned long output[1] ) ; extern int strncmp(char const *s1 , char const *s2 , unsigned long maxlen ) ; extern int gettimeofday(struct timeval *tv , void *tz , ...) ; extern int printf(char const *format , ...) ; int main(int argc , char *argv[] ) ; void megaInit(void) ; extern unsigned long strlen(char const *s ) ; extern long strtol(char const *str , char const *endptr , int base ) ; extern unsigned long strnlen(char const *s , unsigned long maxlen ) ; extern void *memcpy(void *s1 , void const *s2 , unsigned long size ) ; struct timeval { long tv_sec ; long tv_usec ; }; extern void *malloc(unsigned long size ) ; extern int scanf(char const *format , ...) ; void megaInit(void) { { } } int main(int argc , char *argv[] ) { unsigned long input[1] ; unsigned long output[1] ; int randomFuns_i5 ; unsigned long randomFuns_value6 ; int randomFuns_main_i7 ; { megaInit(); if (argc != 2) { printf("Call this program with %i arguments\n", 1); exit(-1); } else { } randomFuns_i5 = 0; while (randomFuns_i5 < 1) { randomFuns_value6 = strtoul(argv[randomFuns_i5 + 1], 0, 10); input[randomFuns_i5] = randomFuns_value6; randomFuns_i5 ++; } RandomFunc(input, output); if (output[0] == 4242424242UL) { printf("You win!\n"); } else { } randomFuns_main_i7 = 0; while (randomFuns_main_i7 < 1) { printf("%lu\n", output[randomFuns_main_i7]); randomFuns_main_i7 ++; } } } void RandomFunc(unsigned long input[1] , unsigned long output[1] ) { unsigned long state[1] ; unsigned long local1 ; char copy11 ; char copy12 ; unsigned short copy13 ; unsigned short copy16 ; char copy17 ; { state[0UL] = (input[0UL] | 51238316UL) >> 3UL; local1 = 0UL; while (local1 < 0UL) { if (state[0UL] > local1) { copy11 = *((char *)(& state[local1]) + 4); *((char *)(& state[local1]) + 4) = *((char *)(& state[local1]) + 7); *((char *)(& state[local1]) + 7) = copy11; copy11 = *((char *)(& state[local1]) + 7); *((char *)(& state[local1]) + 7) = *((char *)(& state[local1]) + 0); *((char *)(& state[local1]) + 0) = copy11; copy12 = *((char *)(& state[local1]) + 2); *((char *)(& state[local1]) + 2) = *((char *)(& state[local1]) + 5); *((char *)(& state[local1]) + 5) = copy12; copy12 = *((char *)(& state[local1]) + 3); *((char *)(& state[local1]) + 3) = *((char *)(& state[local1]) + 7); *((char *)(& state[local1]) + 7) = copy12; } else { state[local1] <<= (state[local1] & 7UL) | 1UL; copy13 = *((unsigned short *)(& state[0UL]) + 2); *((unsigned short *)(& state[0UL]) + 2) = *((unsigned short *)(& state[0UL]) + 3); *((unsigned short *)(& state[0UL]) + 3) = copy13; } if (! (state[0UL] == local1)) { copy16 = *((unsigned short *)(& state[local1]) + 0); *((unsigned short *)(& state[local1]) + 0) = *((unsigned short *)(& state[local1]) + 1); *((unsigned short *)(& state[local1]) + 1) = copy16; copy17 = *((char *)(& state[local1]) + 7); *((char *)(& state[local1]) + 7) = *((char *)(& state[local1]) + 3); *((char *)(& state[local1]) + 3) = copy17; } local1 += 2UL; } output[0UL] = (state[0UL] << 1UL) << 5UL; } }
the_stack_data/28262912.c
#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <sys/wait.h> #include <sys/stat.h> #include <fcntl.h> #include <errno.h> #include <string.h> #include <time.h> #include <signal.h> #include <unistd.h> #define ERR(source) (fprintf(stderr,"%s:%d\n",__FILE__,__LINE__),\ perror(source),kill(0,SIGKILL),\ exit(EXIT_FAILURE)) volatile sig_atomic_t signal_SIG1 = 0; volatile sig_atomic_t signal_SIG2 = 0; void sethandler( void (*f)(int), int sigNo) { struct sigaction act; memset(&act, 0, sizeof(struct sigaction)); act.sa_handler = f; if (-1==sigaction(sigNo, &act, NULL)) ERR("sigaction"); } void sig_SIG1_handler(int sig) { signal_SIG1 = sig; } void sig_SIG2_handler(int sig) { signal_SIG2 = sig; printf("[%d] I got SIGUSR2\n", getpid()); } void sigchld_handler(int sig) { pid_t pid; for(;;){ pid=waitpid(0, NULL, WNOHANG); if(pid==0) return; if(pid<=0) { if(errno==ECHILD) return; ERR("waitpid"); } } } void child_work() { if(kill(getppid(),SIGUSR1))ERR("kill"); printf("[%d]=> last child\n", getppid()); } ssize_t bulk_write(int fd, char *buf, size_t count) { ssize_t c; ssize_t len = 0; do { c = TEMP_FAILURE_RETRY(write(fd, buf, count)); if (c < 0) return c; buf += c; len += c; count -= c; } while (count > 0); return len; } int make_file(int depth, int size) { int out; int LEN = 3 * sizeof(pid_t) + 2; char * mypid = malloc(LEN + 1); if(!mypid) ERR("malloc mypid"); snprintf(mypid, LEN, "PID_%d.txt", getpid()); ssize_t count; char *buf=malloc(size); if(!buf) ERR("malloc"); if (!memset(buf, depth + '0', size)) ERR("memset"); // int written = 0; if((out=open(mypid,O_WRONLY|O_CREAT|O_TRUNC|O_APPEND,0777))<0) ERR("open"); if((count=bulk_write(out, buf, 1))<0) ERR("write"); if(close(out))ERR("close"); free(mypid); free(buf); return 0; } void parent_work(sigset_t oldmask) { int count = 0; int checks = 0; sethandler(SIG_IGN,SIGUSR2); while( 1 ) { while( signal_SIG1 != SIGUSR1 ) { ++checks; sigsuspend(&oldmask); } signal_SIG1 = 0; printf("[PARENT] received %d SIGUSR1, checks: %d\n", ++count, checks); struct timespec t = {0, 200000}; while( 1 ) { nanosleep(&t,NULL); if(kill(getppid(),SIGUSR2)) ERR("kill"); } } } void spawn_children(int how_much_more, int depth, int size, sigset_t oldmask) { pid_t pid; if((pid=fork())<0) ERR("fork"); if(0==pid) { sethandler(sig_SIG2_handler,SIGUSR2); sethandler(SIG_IGN,SIGUSR1); printf("[%d.txt] child, depth %d\n", getppid(), depth + 1); if (make_file(depth, size) < 0) ERR("make_file"); if (how_much_more == 0) { child_work(); } else { spawn_children(how_much_more - 1, depth + 1, size, oldmask); } } else { sethandler(sig_SIG1_handler,SIGUSR1); parent_work(oldmask); while(wait(NULL)>0); } } void usage(char *name){ fprintf(stderr,"USAGE: %s m p\n",name); fprintf(stderr,"d - tree depth (0,100>\n"); fprintf(stderr,"s - size of of blocks <100,1000> in B\n"); exit(EXIT_FAILURE); } int main(int argc, char** argv) { printf("[%d.txt] parent\n", getppid()); int d,s; if(argc!=3) usage(argv[0]); d = atoi(argv[1]); s = atoi(argv[2]); if (d<=0 || d>100 || s<100 || s>1000) usage(argv[0]); sethandler(sigchld_handler,SIGCHLD); sigset_t mask, oldmask; sigemptyset(&mask); sigaddset(&mask, SIGUSR1); sigaddset(&mask, SIGUSR2); sigprocmask(SIG_BLOCK, &mask, &oldmask); int depth = 0; spawn_children(d-1, depth, s, oldmask); sigprocmask(SIG_UNBLOCK, &mask, NULL); return EXIT_SUCCESS; } // soprun prog 1 1000 // strace ./prog 50000 3 (tylko usunac komentarze)
the_stack_data/98574925.c
#include <stdio.h> #define TAPESIZE 65536 int main() { char tape[TAPESIZE] = {0}; char *head = tape; ++head; ++head; ++head; ++*head; ++*head; while (*head) { --head; ++*head; ++*head; ++*head; ++*head; ++*head; ++*head; ++*head; ++*head; while (*head) { --head; while (*head) { --head; ++*head; ++*head; ++head; --*head; } ++head; ++head; while (*head) { ++head; ++head; } ++*head; ++head; ++head; ++*head; while (*head) { --*head; while (*head) { --*head; ++head; ++head; ++*head; --head; --head; --head; while (*head) { --head; while (*head) { --head; --head; } --head; ++*head; ++head; } ++head; while (*head) { ++head; while (*head) { ++head; ++head; } } } --head; while (*head) { ++head; ++head; while (*head) { --*head; } } ++head; while (*head) { ++head; while (*head) { --*head; --head; --head; } ++head; while (*head) { --head; ++*head; --head; } } ++*head; --head; --head; } --head; while (*head) { ++head; ++*head; --head; --*head; } ++head; ++head; --*head; } --head; putchar(*head); while (*head) { --*head; } ++head; ++head; } putchar(*head); putchar(*head); ++*head; putchar(*head); putchar(*head); putchar(*head); }
the_stack_data/100139695.c
#include <stdio.h> int max(int a, int b) { return a > b ? a : b; } int min(int a, int b) { return a > b ? b : a; } int main(void) { int N, i, a, b, c, high, mid, low; scanf("%d", &N); for(i = 0; i < N; i++) { scanf("%d%d%d", &a, &b, &c); high = max(a, max(b, c)); low = min(a, min(b, c)); mid = high == a ? max(b, c) : high == b ? max(a, c) : max(a, b); if((low * low) + mid * mid == high * high) { printf("YES\n"); } else { printf("NO\n"); } } return 0; }
the_stack_data/90124.c
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <errno.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <getopt.h> int open_or_die(char *path) { int file, flags = O_CREAT | O_WRONLY | O_APPEND; if ((NULL == path) || (-1 == (file = open (path, flags, 0666)))) { (void) fprintf (stderr, "Failed to open file \"%s\": %s\n", path, strerror(errno)); exit (EXIT_FAILURE); } return file; } int main (int argc, char *argv[]) { // Check for some args. if (8 > argc) { (void) puts( "Usage: daemonize options path [args]\n" "\t-e <filename> Redirect stderr to file <filename>\n" "\t-o <filename> Redirect stdout to file <filename>\n" "\t-p <filename> Write pid to <filename>\n"); exit (EXIT_FAILURE); } // Parse args. int option; char **command = NULL, *pid_filename, *stdout_filename, *stderr_filename = NULL; while (-1 != (option = getopt (argc, argv, "+e:o:p:"))) { switch (option) { case 'e': stderr_filename = optarg; break; case 'o': stdout_filename = optarg; break; case 'p': pid_filename = optarg; break; default: (void) fprintf (stderr, "Unknown option: -%c\n", optopt); } } // Assume the command to daemonize is the rest of the arguments command = &argv[optind]; // Make a token attempt to see if we'll be able to exec the command. if (-1 == access (command[0], F_OK)) { (void) fprintf (stderr, "Can't access %s, exiting.", command[0]); exit (EXIT_FAILURE); } // Try to open some files for pid, stdin, stdout, stderr. FILE *pid_file = fopen (pid_filename, "w+"); int stdin_file = open_or_die("/dev/null"); int stderr_file = open_or_die(stderr_filename); int stdout_file = open_or_die(stdout_filename); // Nuke stdin and redirect stderr, stdout. close (STDIN_FILENO); dup2 (stdin_file, STDIN_FILENO); close (STDOUT_FILENO); dup2 (stdout_file, STDOUT_FILENO); close (STDERR_FILENO); dup2 (stderr_file, STDERR_FILENO); // Now daemonize.. if (0 != daemon (0, 1)) { (void) fprintf (stderr, "Can't daemonize: %s\nExiting.", strerror(errno)); exit (EXIT_FAILURE); } // Write the pid fprintf (pid_file, "%d\n", getpid ()); fclose (pid_file); // And away we go.. execvp (command[0], command); }
the_stack_data/339009.c
/* Copyright (C) 2003-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <[email protected]>, 2003. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <https://www.gnu.org/licenses/>. */ #include <stddef.h> #include <stdlib.h> static int i; int bar; static __thread void *foo [32 / sizeof (void *)] __attribute__ ((tls_model ("initial-exec"), aligned (sizeof (void *)))) = { &i, &bar }; void test1 (void) { size_t s; if (foo [0] != &i || foo [1] != &bar) abort (); foo [0] = NULL; foo [1] = NULL; for (s = 0; s < sizeof (foo) / sizeof (void *); ++s) { if (foo [s]) abort (); foo [s] = &foo[s]; } } void test2 (void) { size_t s; for (s = 0; s < sizeof (foo) / sizeof (void *); ++s) { if (foo [s] != &foo [s]) abort (); foo [s] = &foo [s ^ 1]; } }
the_stack_data/247016851.c
/* * A classic O(n) approach to the problem is the slow/fast pointer/index technique. * Walk the array with a fast index, if the fast and slow indices do not point to * a duplicate, copy the value to nums[slow + 1] from nums[fast]. * * At the end of the pass, the size of the array will be slow + 1, which we return * as required. * */ int removeDuplicates(int* nums, int numsSize) { if (numsSize == 0) { return 0; } int slow = 0; int fast = 0; while (fast < numsSize) { if (nums[slow] != nums[fast]) { nums[++slow] = nums[fast]; } ++fast; } return ++slow; }
the_stack_data/651216.c
/*C program to find factorial using recursion*/ #include<stdio.h> //Preprocessor directive long fact(int n) //Defining fact { if(n==0) return 1; //Base case else return(n*fact(n-1)); //calculate factorial } //End of fact int main() { int n; //Initialization printf("Enter an integer: "); scanf("%d",&n); //input printf("%d!=%ld\n",n,fact(n)); //Output ,calling factorial return 0; } //End of main
the_stack_data/206392362.c
/* balance.c * 06jul05abu */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <errno.h> #include <signal.h> #include <sys/wait.h> int Len, Siz; char *Line, **Data; static void giveup(char *msg) { fprintf(stderr, "balance: %s\n", msg); exit(1); } static char *getLine(FILE *fp) { int i, c; char *s; i = 0; while ((c = getc_unlocked(fp)) != '\n') { if (c == EOF) return NULL; Line[i] = c; if (++i == Len && !(Line = realloc(Line, Len *= 2))) giveup("No memory"); } Line[i] = '\0'; if (!(s = strdup(Line))) giveup("No memory"); return s; } static void balance(char **data, int len) { if (len) { int n = (len + 1) / 2; char **p = data + n - 1; printf("%s\n", *p); balance(data, n - 1); balance(p + 1, len - n); } } // balance [-<cmd> [<arg> ..]] // balance [<file>] int main(int ac, char *av[]) { int cnt; char *s; pid_t pid = 0; FILE *fp = stdin; if (ac > 1) { if (*av[1] == '-') { int pfd[2]; if (pipe(pfd) < 0) giveup("Pipe error\n"); if ((pid = fork()) == 0) { close(pfd[0]); if (pfd[1] != STDOUT_FILENO) dup2(pfd[1], STDOUT_FILENO), close(pfd[1]); execvp(av[1]+1, av+1); } if (pid < 0) giveup("Fork error\n"); close(pfd[1]); if (!(fp = fdopen(pfd[0], "r"))) giveup("Pipe open error\n"); } else if (!(fp = fopen(av[1], "r"))) giveup("File open error\n"); } Line = malloc(Len = 4096); Data = malloc((Siz = 4096) * sizeof(char*)); for (cnt = 0; s = getLine(fp); ++cnt) { if (cnt == Siz && !(Data = realloc(Data, (Siz *= 2) * sizeof(char*)))) giveup("No memory"); Data[cnt] = s; } if (pid) { fclose(fp); while (waitpid(pid, NULL, 0) < 0) if (errno != EINTR) giveup("Pipe close error\n"); } balance(Data, cnt); return 0; }
the_stack_data/20449518.c
#include <stdio.h> int replace_assignment(int a) { int b = a + 100; // printf("a: %d, b: %d\n", a, b); return b; } int test_replace_assignment() { int result = (replace_assignment(1) == 101); return result; }
the_stack_data/98576476.c
//Shubham Arya //1001650536 // The MIT License (MIT) // // Copyright (c) 2016, 2017 Trevor Bakker // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. #define _GNU_SOURCE #include <stdio.h> #include <unistd.h> #include <sys/wait.h> #include <stdlib.h> #include <errno.h> #include <string.h> #include <signal.h> #include <stdint.h> #include <ctype.h> #define WHITESPACE " \t\n" // We want to split our command line up into tokens // so we need to define what delimits our tokens. // In this case white space // will separate the tokens on our command line #define MAX_COMMAND_SIZE 255 // The maximum command-line size #define MAX_NUM_ARGUMENTS 5 //Mavs shell supports 5 args int16_t BPB_BytsPerSec; int8_t BPB_SecPerClus; int16_t BPB_RsvdSecCnt; int8_t BPB_NumFATs; int16_t BPB_RootEntCnt; int32_t BPB_FATSz32; int32_t RootDirSector =0; int32_t FirstDataSector =0; int32_t FirstSectorOfCluster=0; FILE *fp; struct __attribute__((__packed__)) DirectoryEntry { char DIR_Name[11]; uint8_t DIR_Attr; uint8_t Unused1[8]; uint16_t DIR_FirstClusterHigh; uint8_t Unused2[4]; uint16_t DIR_FirstClusterLow; uint32_t DIR_FileSize; }; struct DirectoryEntry dir[16]; int compare(char IMG_Name[],char input[]) { char expanded_name[12]; memset( expanded_name, ' ', 12 ); char *token = (char*)malloc(sizeof(char) * 12); strncpy( token, input, 12 ); strtok( token, "." ); strncpy( expanded_name, token, strlen( token ) ); token = strtok( NULL, "." ); if( token ) { strncpy( (char*)(expanded_name+8), token, strlen(token ) ); } expanded_name[11] = '\0'; int i; for( i = 0; i < 11; i++ ) { expanded_name[i] = toupper( expanded_name[i] ); } if( strncmp( expanded_name, IMG_Name, 11 ) == 0 ) { return 1; } return 0; } //Function: LBAToOffset //Parameters: The current sector number that points to a block of data //Returns: The value of the address for that block of data //Description: Finds the starting address of a block given the sector number //corresponding to that block int LBAToOffset(int32_t sector) { return (( sector - 2 ) * BPB_BytsPerSec) + (BPB_BytsPerSec * BPB_RsvdSecCnt) + (BPB_NumFATs * BPB_FATSz32 * BPB_BytsPerSec); } //Name: NextLB // Purpose: Given a logical block address, look up into the first FAT and return //the logical block address of the block in the file. If there is no further //blocks then return -1. int16_t NextLB(uint32_t sector) { uint32_t FATAddress = (BPB_BytsPerSec * BPB_RsvdSecCnt) + (sector * 4); int16_t val; fseek(fp, FATAddress, SEEK_SET); fread(&val, 2, 1, fp); return val; } int main() { char * cmd_str = (char*) malloc( MAX_COMMAND_SIZE ); int i; int fileOpen=0; char filename[12]; char temp[100]; while( 1 ) { // Print out the mfs prompt printf ("mfs> "); // Read the command from the commandline. The // maximum command that will be read is MAX_COMMAND_SIZE // This while command will wait here until the user // inputs something since fgets returns NULL when there // is no input while( !fgets (cmd_str, MAX_COMMAND_SIZE, stdin) ); /* Parse input */ char *token[MAX_NUM_ARGUMENTS]; int token_count = 0; // Pointer to point to the token // parsed by strsep char *arg_ptr; char *working_str = strdup( cmd_str ); // we are going to move the working_str pointer so // keep track of its original value so we can deallocate // the correct amount at the end char *working_root = working_str; // Tokenize the input stringswith whitespace used as the delimiter while ( ( (arg_ptr = strsep(&working_str, WHITESPACE ) ) != NULL) && (token_count<MAX_NUM_ARGUMENTS)) { token[token_count] = strndup( arg_ptr, MAX_COMMAND_SIZE ); if( strlen( token[token_count] ) == 0 ) { token[token_count] = NULL; } token_count++; } if(token[0]!=NULL) { //************* OPEN **************************************************** /* Opens a file with the command open <filename>. Once it is opened, it is seeks and reads the data and sets it to variables depending on where it is present in the file system. Once that is done, it is used to calculate the root cluster which is used to read all the directories. */ if(strcmp(token[0],"open")==0) { if(fileOpen == 1) { printf("Error: your file system image already open.\n"); } else { int flag=0; fp = fopen(token[1],"r"); if(fp==NULL) { printf("Error: File system image not found.\n"); //exit(1); flag =1; } if(flag == 0) { fileOpen=1; fseek(fp,11,SEEK_SET); fread(&BPB_BytsPerSec,2,1,fp); fseek(fp,13,SEEK_SET); fread(&BPB_SecPerClus,1,1,fp); fseek(fp,14,SEEK_SET); fread(&BPB_RsvdSecCnt,2,1,fp); fseek(fp,16,SEEK_SET); fread(&BPB_NumFATs,1,1,fp); fseek(fp,17,SEEK_SET); fread(&BPB_RootEntCnt,2,1,fp); fseek(fp,36,SEEK_SET); fread(&BPB_FATSz32,4,1,fp); int root_cluster = (BPB_NumFATs * BPB_FATSz32*BPB_BytsPerSec)+(BPB_RsvdSecCnt* BPB_BytsPerSec); //printf("\nRoot cluster is %d\n",root_cluster); fseek(fp,root_cluster,SEEK_SET); fread(&dir[0],sizeof(struct DirectoryEntry),16,fp); } } } //************ CLOSE ********************************************************* /* This basically closes the opened file. It displays an error message if there is no file open. */ if(strcmp(token[0],"close")==0) { if(fileOpen==1) { fclose(fp); memset(dir, 0, sizeof(dir)); fileOpen=0; } else { printf("Error: File system not open.\n"); } } //******************* INFO ************************************************** /* This simply displays the decimal and hexadecimal values of the variable set during the opening of the file */ if (strcmp(token[0], "info")==0) { if(fileOpen==0) { printf("Error: A file system image must be opened first.\n"); } else { printf(" DEC HEX\n"); printf("BPB_BytsPerSec- %d %x\n", BPB_BytsPerSec, BPB_BytsPerSec); printf("BPB_SecPerClus- %d %x\n", BPB_SecPerClus, BPB_SecPerClus); printf("BPB_RsvdSecCnt- %d %x\n", BPB_RsvdSecCnt, BPB_RsvdSecCnt); printf("BPB_NumFATs- %d %x\n", BPB_NumFATs, BPB_NumFATs); printf("BPB_FATSz32- %d %x\n\n", BPB_FATSz32, BPB_FATSz32); } } //******************* STAT ************************************************** /* Displays the stat of the file entered with the command stat <filename>. It iterates through all the 16 directories and checks if the name matches with any of the directories name. If it matches, it displays the stats of the directory with that index. */ if(strcmp(token[0],"stat")==0) { int found =0; if(fileOpen==0) { printf("Error: A file system image must be opened first.\n"); } else { if(token[1]!=NULL) { for(i=0; i<16;i++) { if ((dir[i].DIR_Attr == 0x01)||dir[i].DIR_Attr == 0x10|| dir[i].DIR_Attr == 0x20) { memset(&filename, 0, 12); strncpy(filename, dir[i].DIR_Name, 11); if (compare(dir[i].DIR_Name,token[1])==1) { printf("Directory Name- %s\n",filename); printf("Directory Attribute- %d\n",dir[i].DIR_Attr); printf("Start Cluster No.- %d\n",dir[i].DIR_FirstClusterLow); printf("File size- %d\n",dir[i].DIR_FileSize); found = 1; } else if (strcmp(dir[i].DIR_Name,token[1]) ==0) { if (dir[i].DIR_FirstClusterLow == 0) { dir[i].DIR_FirstClusterLow = 2; } printf("Directory Name- %s\n",filename); printf("Directory Attribute- %d\n",dir[i].DIR_Attr); printf("Start Cluster No.- %d\n",dir[i].DIR_FirstClusterLow); printf("File size- %d\n",dir[i].DIR_FileSize); found = 1; } } } } if(found!= 1) { printf("Error: File not found\n"); } } } //******************* GET ************************************************** /* This is used by calling the command get <filename>. It gets the file you called into the directory in which you called. So it places that file in the current directory. It iterates through the directory names to see if the names match and if they do, then it open a new file to write. It calculates the file pposition by cluster number and filesize and if the size is greater than 512, then it is dealt accordingly. */ if(strcmp(token[0],"get")==0) { if(fileOpen==0) { printf("Error: A file system image must be opened first.\n"); } else { int index = -1; for (i = 0; i < 16; i++) { if ((dir[i].DIR_Attr == 0x01)||dir[i].DIR_Attr == 0x10|| dir[i].DIR_Attr == 0x20) { if(compare(dir[i].DIR_Name,token[1])==1) { fseek(fp, LBAToOffset(dir[i].DIR_FirstClusterLow), SEEK_SET); FILE *getFile = fopen(token[1], "w"); char write[512]; if(dir[i].DIR_FileSize<512) { fread(&write[0], dir[i].DIR_FileSize, 1, fp); fwrite(&write[0],dir[i].DIR_FileSize, 1, getFile); } else { fread(&write[0], 512, 1, fp); fwrite(&write[0], 512, 1, getFile); int size = dir[i].DIR_FileSize; size = size - 512; while (size > 0) { int cluster = NextLB(dir[i].DIR_FirstClusterLow); fseek(fp, LBAToOffset(cluster), SEEK_SET); fread(&write[0], 512, 1, fp); fread(&write[0], 512, 1, getFile); size -=512; } } fclose( getFile ); index = 1; break; } else { index =-1; } } } if(index == -1) { printf("Error: file not found\n"); } } } //************* cd *********************************************************** /* This commands places you into the directory you mention or takes you back to the previous directory. This iterates over the 16 directories and checks if the commands match. If they do, it uses seek and read to place the user into that directory. */ if(strcmp(token[0],"cd")==0) { if(fileOpen==0) { printf("Error: A file system image must be opened first.\n"); } else { for(i = 0; i < 16; i++) { if (strcmp(token[1],".")==0 ||strcmp(token[1],"..")==0) { if(strstr(dir[i].DIR_Name,token[1]) != NULL) { if (dir[i].DIR_FirstClusterLow == 0) { dir[i].DIR_FirstClusterLow = 2; } fseek(fp, LBAToOffset(dir[i].DIR_FirstClusterLow), SEEK_SET); fread(&dir[0], sizeof(struct DirectoryEntry), 16, fp); } } else { strcpy(temp, token[1]); if (compare(dir[i].DIR_Name,temp)) { fseek(fp, LBAToOffset(dir[i].DIR_FirstClusterLow), SEEK_SET); fread(&dir[0], sizeof(struct DirectoryEntry), 16, fp); } } } } } //************* ls *********************************************************** /* It simply lists the filenames present in a directory */ if (strcmp(token[0], "ls")==0) { if(fileOpen==0) { printf("Error: A file system image must be opened first.\n"); } else { for(i=0; i<16;i++) { if ((dir[i].DIR_Attr == 0x01 ||dir[i].DIR_Attr == 0x10 || dir[i].DIR_Attr == 0x20 )&& dir[i].DIR_Name[0]!= 0xffffffe5) { memset(&filename, 0, 12); strncpy(filename, dir[i].DIR_Name,11); printf("%s\n",filename); } } } } //******************* READ ************************************************** /* It reads the contents of a file. It is called by the command read <filename> position byte. fseek is used to reach that position and the data of the file is read until that posiiton. */ if(strcmp(token[0],"read")==0) { if(fileOpen==0) { printf("Error: A file system image must be opened first.\n"); } else { for (i = 0; i < 16; i++) { strcpy(filename,token[1]); int position = atoi(token[2]); int noOfBytes = atoi(token[3]); if (compare(dir[i].DIR_Name,filename)==1) { if ((dir[i].DIR_Attr == 0x01 || dir[i].DIR_Attr == 0x10 || dir[i].DIR_Attr == 0x20)) { char buff[noOfBytes]; fseek(fp, LBAToOffset(dir[i].DIR_FirstClusterLow), SEEK_SET); fseek(fp, position, SEEK_CUR); fread(&buff[0], noOfBytes, 1, fp); printf("%s\n", buff); } } } } } } free( working_root ); } return 0; }
the_stack_data/200143153.c
#include <limits.h> #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <string.h> static int compare(const void *a, const void *b) { return *(int *) a - *(int *) b; } static void dfs(int *nums, int size, int start, int target, int *solution, int len, int **results, int *count, int *col_sizes) { int i; if (target < 0) { return; } else if (target == 0) { results[*count] = malloc(len * sizeof(int)); memcpy(results[*count], solution, len * sizeof(int)); col_sizes[*count] = len; (*count)++; } else { int last = INT_MIN; for (i = start; i < size; i++) { if (last != nums[i]) { /* No duplicate combinations in the same level position */ solution[len] = nums[i]; /* i + 1 limits the candidate range in next levels */ dfs(nums, size, i + 1, target - nums[i], solution, len + 1, results, count, col_sizes); } last = nums[i]; } } } /** ** Return an array of arrays of size *returnSize. ** The sizes of the arrays are returned as *returnColumnSizes array. ** Note: Both returned array and *returnColumnSizes array must be malloced, assume caller calls free(). **/ int** combinationSum(int* candidates, int candidatesSize, int target, int* returnSize, int** returnColumnSizes) { qsort(candidates, candidatesSize, sizeof(int), compare); int *solution = malloc(target * sizeof(int)); int **results = malloc(100 * sizeof(int *)); *returnColumnSizes = malloc(100 * sizeof(int)); *returnSize = 0; dfs(candidates, candidatesSize, 0, target, solution, 0, results, returnSize, *returnColumnSizes); return results; } int main(int argc, char **argv) { if (argc < 3) { fprintf(stderr, "Usage: ./test target n1 n2...\n"); exit(-1); } int i, j, count = 0; int target = atoi(argv[1]); int *nums = malloc((argc - 2) * sizeof(int)); for (i = 0; i < argc - 2; i++) { nums[i] = atoi(argv[i + 2]); } int *sizes; int **lists = combinationSum(nums, argc - 2, target, &count, &sizes); for (i = 0; i < count; i++) { for (j = 0; j < sizes[i]; j++) { printf("%d ", lists[i][j]); } printf("\n"); } return 0; }
the_stack_data/353718.c
#include <stdio.h> int ss(int x){ int q = (int) sqrt(x); for(int i=2;i<=q;i++){ if(x%i == 0){ return 0; } } return 1; } int main(){ int n; scanf("%d",&n); if(ss(n)){ printf("prime"); } else{ printf("not prime"); } return 0; }
the_stack_data/72931.c
// RUN: clang-cc -triple i386-unknown-unknown %s -emit-llvm -o - | grep "i32 @a(i32)" int a(); int a(x) short x; {return x;}
the_stack_data/36076189.c
/* A simple program to illustrate the use of Message Queues. * * Note that message queues continue to exist after all processes have * terminated; messages continue to remain in the queues as well. This is * desired, but requires that processes clean up after themselves when * they are done using the queues. * * Use msgsend.c to create/send messages, then run this tool to retrieve * them (in order). Note that msgrecv will block if no messages are in * the queue. * * Use ipcs(1) to inspect the usage. * * Derived from: * https://users.cs.cf.ac.uk/Dave.Marshall/C/node25.html */ #include <sys/ipc.h> #include <sys/msg.h> #include <sys/types.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #define MSGSZ 128 typedef struct msgbuf { long mtype; char mtext[MSGSZ]; } message_buf; int main(int argc, char **argv) { int msqid; key_t key; message_buf rbuf; if (argc > 1) { fprintf(stderr, "Usage: msgrecv\n"); exit(EXIT_FAILURE); } /* Yes, it's "msgsend.c"; we have to agree with * the sender. */ if ((key = ftok("msgsend.c", 'M')) == -1) { perror("ftok"); exit(1); } if ((msqid = msgget(key, 0666)) < 0) { perror("msgget"); exit(1); } if (msgrcv(msqid, &rbuf, MSGSZ, 1, 0) < 0) { perror("msgrcv"); exit(EXIT_FAILURE); } printf("%s\n", rbuf.mtext); exit(EXIT_SUCCESS); }
the_stack_data/176704981.c
/** @Generated PIC24 / dsPIC33 / PIC32MM MCUs Source File @Company: Microchip Technology Inc. @File Name: mcc.c @Summary: This is the mcc.c file generated using PIC24 / dsPIC33 / PIC32MM MCUs @Description: The configuration contents of this file are moved to system.c and this file will be removed in future MCC releases. Generation Information : Product Revision : PIC24 / dsPIC33 / PIC32MM MCUs - 1.170.0 Device : PIC24FJ128GA010 The generated drivers are tested against the following: Compiler : XC16 v1.61 MPLAB : MPLAB X v5.45 */ /* (c) 2020 Microchip Technology Inc. and its subsidiaries. You may use this software and any derivatives exclusively with Microchip products. THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE, OR ITS INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION. IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE TERMS. */ /** End of File */
the_stack_data/75138434.c
/* Generated by CIL v. 1.7.0 */ /* print_CIL_Input is false */ struct _IO_FILE; struct timeval; extern float strtof(char const *str , char const *endptr ) ; extern void signal(int sig , void *func ) ; typedef struct _IO_FILE FILE; extern int atoi(char const *s ) ; extern double strtod(char const *str , char const *endptr ) ; extern int fclose(void *stream ) ; extern void *fopen(char const *filename , char const *mode ) ; extern void abort() ; extern void exit(int status ) ; extern int raise(int sig ) ; extern int fprintf(struct _IO_FILE *stream , char const *format , ...) ; extern int strcmp(char const *a , char const *b ) ; extern int rand() ; extern unsigned long strtoul(char const *str , char const *endptr , int base ) ; void RandomFunc(unsigned long input[1] , unsigned long output[1] ) ; extern int strncmp(char const *s1 , char const *s2 , unsigned long maxlen ) ; extern int gettimeofday(struct timeval *tv , void *tz , ...) ; extern int printf(char const *format , ...) ; int main(int argc , char *argv[] ) ; void megaInit(void) ; extern unsigned long strlen(char const *s ) ; extern long strtol(char const *str , char const *endptr , int base ) ; extern unsigned long strnlen(char const *s , unsigned long maxlen ) ; extern void *memcpy(void *s1 , void const *s2 , unsigned long size ) ; struct timeval { long tv_sec ; long tv_usec ; }; extern void *malloc(unsigned long size ) ; extern int scanf(char const *format , ...) ; void megaInit(void) { { } } int main(int argc , char *argv[] ) { unsigned long input[1] ; unsigned long output[1] ; int randomFuns_i5 ; unsigned long randomFuns_value6 ; int randomFuns_main_i7 ; { megaInit(); if (argc != 2) { printf("Call this program with %i arguments\n", 1); exit(-1); } else { } randomFuns_i5 = 0; while (randomFuns_i5 < 1) { randomFuns_value6 = strtoul(argv[randomFuns_i5 + 1], 0, 10); input[randomFuns_i5] = randomFuns_value6; randomFuns_i5 ++; } RandomFunc(input, output); if (output[0] == 4242424242UL) { printf("You win!\n"); } else { } randomFuns_main_i7 = 0; while (randomFuns_main_i7 < 1) { printf("%lu\n", output[randomFuns_main_i7]); randomFuns_main_i7 ++; } } } void RandomFunc(unsigned long input[1] , unsigned long output[1] ) { unsigned long state[1] ; unsigned long local2 ; unsigned long local1 ; char copy13 ; { state[0UL] = (input[0UL] + 51238316UL) + 274866410UL; local1 = 0UL; while (local1 < 0UL) { local2 = 0UL; while (local2 < 0UL) { if (! (state[0UL] != local2 - local1)) { state[local1] = state[0UL] + state[local1]; copy13 = *((char *)(& state[0UL]) + 0); *((char *)(& state[0UL]) + 0) = *((char *)(& state[0UL]) + 4); *((char *)(& state[0UL]) + 4) = copy13; copy13 = *((char *)(& state[0UL]) + 5); *((char *)(& state[0UL]) + 5) = *((char *)(& state[0UL]) + 7); *((char *)(& state[0UL]) + 7) = copy13; } local2 ++; } local1 += 2UL; } output[0UL] = state[0UL] + 839257860UL; } }
the_stack_data/12637947.c
#include <stdio.h> #include <stdlib.h> #include <string.h> int a_is_b_length (char a[256],char b[256]) { return 0; } void main() { int n,i,j; scanf("%d ",&n); char s[10][256]; int **m = (int**)malloc(n*sizeof(int*)); for(i=0;i<n;i++) { gets(s[i]); m[i] = (int*)malloc(n*sizeof(int)); for(j=0;j<n;j++) m[i][j]=0; m[i][i]=-1; } for(i=0;i<n;i++) free(m[i]); free(m); printf("10"); }
the_stack_data/135184.c
#include <stdio.h> #include <stdlib.h> #define NUMDIGITS 999999999999 typedef struct arr_string { char** arr; int size; } arr_string; int main() { arr_string a; a.size = 2; char *s[2] = {"123", "456"}; a.arr = &s[0]; printf("*a.arr = %s\n", *a.arr); printf("*(a.arr + 1) = %s\n", *(a.arr + 1)); return 0; }
the_stack_data/182952345.c
/* { dg-lto-options {{-flto -funsigned-char}} } */ extern void abort (); char c = 0xff; int main () { int i = (unsigned) c; if (i < 0) abort (); return 0; }
the_stack_data/15762859.c
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h> #include <arpa/inet.h> #include <netdb.h> void error(char *msg) { fprintf(stderr, "%s: %s\n", msg, strerror(errno)); exit(1); } int open_socket(char *host, char *port) { struct addrinfo *res; struct addrinfo hints; int d_sock, c; memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_STREAM; if (getaddrinfo(host, port, &hints, &res) == -1) error("Can't resolve the address"); if (( d_sock = socket(res->ai_family, res->ai_socktype, res->ai_protocol)) == -1) error("Can't open socket"); c = connect(d_sock, res->ai_addr, res->ai_addrlen); freeaddrinfo(res); if (c == -1) error("Can't connect to the socket"); return d_sock; } int main(int argc, char *argv[]) { int d_sock, bytes_received; char buf[255], rec[256]; /* connect to server */ d_sock = open_socket("127.0.0.1", "30000"); bytes_received = recv(d_sock, rec, 255, 0); while (bytes_received) { if (bytes_received == EOF) error("can't read from server"); rec[bytes_received] = '\0'; printf("%s", rec); bytes_received = recv(d_sock, rec, 255, 0); } fprintf(stdout, "I don't like your advice\n"); close(d_sock); return 0; }