file
stringlengths 18
26
| data
stringlengths 3
1.04M
|
---|---|
the_stack_data/31388011.c | //
// Created by JiekunZhu on 2020/12/27.
//
void inplace_swap(int *x, int *y){
*y = *x ^ *y;
*x = *x ^ *y;
*y = *x ^ *y;
}
void reverse_array(int a[], int cnt){
int l, r;
for (l = 0, r = cnt-1; r > l; r--, l++){
inplace_swap(&a[l], &a[r]);
}
} |
the_stack_data/82951595.c | #include <stdio.h>
int main() {
int size = snprintf(NULL, 0, "%s %d %.2f\n", "me and myself", 25, 1.345);
char buf[size];
snprintf(buf, size, "%s %d %.2f\n", "me and myself", 25, 1.345);
printf("%d : %s\n", size, buf);
char *buff = NULL;
asprintf(&buff, "%d waka %d\n", 21, 95);
puts(buff);
return 0;
}
|
the_stack_data/1070030.c | // testing loops
int main()
{
int i = 0, n = 10;
int sum = 0;
for (i = 0; i< n; i++)
{
sum += i;
}
while (i>0)
{
i--;
sum -= i;
}
return 0;
} |
the_stack_data/1217524.c |
struct s {
int x;
struct {
int y;
int z;
} nest;
};
int main() {
struct s v;
v.x = 1;
v.nest.y = 2;
v.nest.z = 3;
if (v.x + v.nest.y + v.nest.z != 6)
return 1;
return 0;
}
|
the_stack_data/10769.c | /******************************************************************************/
/* Programador : Fabio Andreozzi Godoy Data : 01/10/2001 */
/* Arquivo : trapesio.c Ultima atualizacao : 01/10/2002 */
/* Funcao : Calcular integrais com regra do trapesio e simpson */
/******************************************************************************/
#include <stdio.h>
int main() {
int k;
int i;
float m, a, b, xk, soma = 0;
printf("\nEntre com k :"); scanf("%i",&k);
printf("\nEntre com a :"); scanf("%f",&a);
printf("\nEntre com b :"); scanf("%f",&b);
/* Regra do Trapesio **********************************************************/
xk = a;
for (i = 0; i <= k; i++) {
if (i == k) xk = b;
if ((xk == a) || (xk == b)) m = 1.0;
else m = 2.0;
soma += (m * (1/xk));
xk += ((b-a)/k);
}
printf("\nValor trapesio: %f", ((b-a)/(2*k))*soma);
/* Regra de Simpson ***********************************************************/
soma = 0;
xk = a;
for (i = 0; i <= k; i++) {
if ((i == 0) || (i == k)) m = 1;
else if ((m == 1) || (m == 2)) m = 4;
else if (m == 4) m = 2;
soma += (m * (1/xk));
xk += ((b-a)/k);
}
printf("\nValor simpson : %f", ((b-a)/(3*k))*soma);
return 0;
}
|
the_stack_data/97012362.c | // C program to illustrate
// pipe system call in C
#include <stdio.h>
#include <unistd.h>
#define MSGSIZE 11
char* msg1 = "hello, world #1";
char* msg2 = "hello, world #2";
char* msg3 = "hello, world #3";
int main()
{
char inbuf[MSGSIZE];
int p[2], i;
if (pipe(p) < 0)
exit(1);
/* continued */
/* write pipe */
write(p[1], msg1, MSGSIZE);
write(p[1], msg2, MSGSIZE);
write(p[1], msg3, MSGSIZE);
for (i = 0; i < 3; i++) {
/* read pipe */
read(p[0], inbuf, MSGSIZE);
printf("% s\n", inbuf);
}
return 0;
}
|
the_stack_data/238935.c | /* This testcase is part of GDB, the GNU debugger.
Copyright 2005-2020 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
int
main (int argc, char **argv)
{
return 0;
}
|
the_stack_data/159516084.c | #include<stdio.h>
#include<stdlib.h>
int main()
{
int temp,arr[100],i,j,k=0;
printf("Enter the number of elements\n");
scanf("%d",&j);
printf("Enter the elements:-\n");
for(i=0;i<j;++i)
scanf("%d",&arr[i]);
for(i=1;i<=j;++i)
{
while(i>k)
{
if(arr[i] < arr[k])
{
temp = arr[i];
arr[i]=arr[k];
arr[k]=temp;
}
++k;
}
k=0;
}
printf("Sorted array:-\n");
for(i=0;i<j;++i)
printf("%d ",arr[i]);
return 0;
}
|
the_stack_data/119150.c | #include<stdio.h>
main(){
printf("%d",6<=6);
} |
the_stack_data/242331786.c | /* Copyright (c) 2017, Piotr Durlej
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/types.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
char *mktemp(char *tpl)
{
pid_t pid;
char *p;
int len;
int i;
len = strlen(tpl);
if (len < 6)
{
_set_errno(EINVAL);
return NULL;
}
p = tpl - 6;
if (strcmp(p, "XXXXXX"))
{
_set_errno(EINVAL);
return NULL;
}
pid = getpid() & 0xffff;
for (i = 0; i < 256; i++)
{
sprintf(p, "%04x%02x", pid, i);
if (access(tpl, 0))
return tpl;
}
return NULL;
}
|
the_stack_data/5772.c | /*
* Copyright (c) 2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#include <stdio.h>
#include <stdbool.h>
extern char*** _NSGetArgv(void);
static bool libSystemAlreadyInited = false;
//
static __attribute__((constructor)) void myInit()
{
libSystemAlreadyInited = ( _NSGetArgv() != NULL );
}
bool foo()
{
return libSystemAlreadyInited;
}
|
the_stack_data/87638852.c | /******************************************************************************
*
* Copyright (C) 2001, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
* file name: stubdata.c
*
* Define initialized data that will build into a valid, but empty
* ICU data library. Used to bootstrap the ICU build, which has these
* dependencies:
* ICU Common library depends on ICU data
* ICU data requires data building tools.
* ICU data building tools require the ICU common library.
*
* The stub data library (for which this file is the source) is sufficient
* for running the data building tools.
*
*/
#include "unicode/utypes.h"
#include "unicode/udata.h"
#include "unicode/uversion.h"
typedef struct {
uint16_t headerSize;
uint8_t magic1, magic2;
UDataInfo info;
char padding[8];
uint32_t count, reserved;
/*
const struct {
const char *const name;
const void *const data;
} toc[1];
*/
int fakeNameAndData[4]; /* TODO: Change this header type from */
/* pointerTOC to OffsetTOC. */
} ICU_Data_Header;
U_EXPORT const ICU_Data_Header U_ICUDATA_ENTRY_POINT = {
32, /* headerSize */
0xda, /* magic1, (see struct MappedData in udata.c) */
0x27, /* magic2 */
{ /*UDataInfo */
sizeof(UDataInfo), /* size */
0, /* reserved */
#if U_IS_BIG_ENDIAN
1,
#else
0,
#endif
U_CHARSET_FAMILY,
sizeof(UChar),
0, /* reserved */
{ /* data format identifier */
0x54, 0x6f, 0x43, 0x50}, /* "ToCP" */
{1, 0, 0, 0}, /* format version major, minor, milli, micro */
{0, 0, 0, 0} /* dataVersion */
},
{0,0,0,0,0,0,0,0}, /* Padding[8] */
0, /* count */
0, /* Reserved */
{ /* TOC structure */
/* { */
0 , 0 , 0, 0 /* name and data entries. Count says there are none, */
/* but put one in just in case. */
/* } */
}
};
|
the_stack_data/1184857.c | /*
I created my own longrun without the 'iteration and value' printf -- so as to avoid preemption during priority scheduler which gets
preempted during the above mentioned printf; it being an IO operation.
*/
//This has more printfs than longrun00.c -- this is for IO bound processes
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <time.h>
#define LOOP_COUNT_MIN 100
#define LOOP_COUNT_MAX 100000000
long long subtime(struct timeval start,struct timeval end)
{
return 1000000*(end.tv_sec-start.tv_sec)+(end.tv_usec-start.tv_usec);
}
int main (int argc, char *argv[])
{
char *idStr;
unsigned int v;
int i = 0;
int iteration = 1;
int loopCount;
int maxloops;
if (argc < 3 || argc > 4)
{
printf ("Usage: %s <id> <loop count> [max loops]\n", argv[0]);
exit (-1);
}
v = getpid ();
idStr = argv[1];
loopCount = atoi (argv[2]);
if ((loopCount < LOOP_COUNT_MIN) || (loopCount > LOOP_COUNT_MAX))
{
printf ("%s: loop count must be between %d and %d (passed %s)\n", argv[0], LOOP_COUNT_MIN, LOOP_COUNT_MAX, argv[2]);
exit (-1);
}
if (argc == 4)
{
maxloops = atoi (argv[3]);
}
else
{
maxloops = 0;
}
struct timeval start,end,wait,curr; //store start, end (turnaround time) and temporary times for calculations
double waiting_time=0;
gettimeofday(&start,NULL);
while (1)
{
v = (v << 4) - v;
if (iteration == loopCount)
{
break;
}
gettimeofday(&wait,NULL);
fflush(stdout);
gettimeofday(&curr,NULL);
waiting_time=waiting_time+subtime(wait,curr);// add to waiting time
iteration += 1;
}
gettimeofday(&end,NULL);
printf ("The IO bound final value of v is 0x%08x\n", v);
printf("Turnaround time = %0.6lf s\n",(double)subtime(start,end)/1000000);
printf("Waiting time = %0.6lf s\n",waiting_time/1000000);
}
|
the_stack_data/72012626.c | // Traverse linked list using two pointers. Move one pointer by one and the other pointers by two. When the fast pointer reaches the end slow pointer will reach the middle of the linked list.
// C program to find middle of linked list
#include<stdio.h>
#include<stdlib.h>
/* Link list node */
struct Node
{
int data;
struct Node* next;
};
/* Function to get the middle of the linked list*/
void printMiddle(struct Node *head)
{
struct Node *slow_ptr = head;
struct Node *fast_ptr = head;
if (head!=NULL)
{
while (fast_ptr != NULL && fast_ptr->next != NULL)
{
fast_ptr = fast_ptr->next->next;
slow_ptr = slow_ptr->next;
}
printf("The middle element is [%d]\n\n", slow_ptr->data);
}
}
void push(struct Node** head_ref, int new_data)
{
/* allocate node */
struct Node* new_node =
(struct Node*) malloc(sizeof(struct Node));
/* put in the data */
new_node->data = new_data;
/* link the old list off the new node */
new_node->next = (*head_ref);
/* move the head to point to the new node */
(*head_ref) = new_node;
}
// A utility function to print a given linked list
void printList(struct Node *ptr)
{
while (ptr != NULL)
{
printf("%d->", ptr->data);
ptr = ptr->next;
}
printf("NULL\n");
}
/* Driver program to test above function*/
int main()
{
/* Start with the empty list */
struct Node* head = NULL;
int i;
for (i=5; i>0; i--)
{
push(&head, i);
printList(head);
printMiddle(head);
}
return 0;
} |
the_stack_data/68887171.c | /**
******************************************************************************
* @file stm32f1xx_ll_adc.c
* @author MCD Application Team
* @brief ADC LL module driver
******************************************************************************
* @attention
*
* <h2><center>© Copyright (c) 2017 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
#if defined(USE_FULL_LL_DRIVER)
/* Includes ------------------------------------------------------------------*/
#include "stm32f1xx_ll_adc.h"
#include "stm32f1xx_ll_bus.h"
#ifdef USE_FULL_ASSERT
#include "stm32_assert.h"
#else
#define assert_param(expr) ((void)0U)
#endif
/** @addtogroup STM32F1xx_LL_Driver
* @{
*/
#if defined(ADC1) || defined(ADC2) || defined(ADC3)
/** @addtogroup ADC_LL ADC
* @{
*/
/* Private types -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private constants ---------------------------------------------------------*/
/* Private macros ------------------------------------------------------------*/
/** @addtogroup ADC_LL_Private_Macros
* @{
*/
/* Check of parameters for configuration of ADC hierarchical scope: */
/* common to several ADC instances. */
/* Check of parameters for configuration of ADC hierarchical scope: */
/* ADC instance. */
#define IS_LL_ADC_DATA_ALIGN(__DATA_ALIGN__) (((__DATA_ALIGN__) == LL_ADC_DATA_ALIGN_RIGHT) || ((__DATA_ALIGN__) == LL_ADC_DATA_ALIGN_LEFT))
#define IS_LL_ADC_SCAN_SELECTION(__SCAN_SELECTION__) \
(((__SCAN_SELECTION__) == LL_ADC_SEQ_SCAN_DISABLE) || ((__SCAN_SELECTION__) == LL_ADC_SEQ_SCAN_ENABLE))
#define IS_LL_ADC_SEQ_SCAN_MODE(__SEQ_SCAN_MODE__) (((__SCAN_MODE__) == LL_ADC_SEQ_SCAN_DISABLE) || ((__SCAN_MODE__) == LL_ADC_SEQ_SCAN_ENABLE))
/* Check of parameters for configuration of ADC hierarchical scope: */
/* ADC group regular */
#if defined(ADC3)
#define IS_LL_ADC_REG_TRIG_SOURCE(__ADC_INSTANCE__, __REG_TRIG_SOURCE__) \
((((__ADC_INSTANCE__) == ADC1) || ((__ADC_INSTANCE__) == ADC2)) \
? (((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_SOFTWARE) || ((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_EXT_TIM1_CH3) || \
((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_EXT_TIM1_CH1) || ((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_EXT_TIM1_CH2) || \
((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_EXT_TIM2_CH2) || ((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_EXT_TIM3_TRGO) || \
((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_EXT_TIM4_CH4) || ((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_EXT_EXTI_LINE11) || \
((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_EXT_TIM8_TRGO)) \
: (((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_SOFTWARE) || ((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_EXT_TIM1_CH3) || \
((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_EXT_TIM3_CH1) || ((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_EXT_TIM2_CH3) || \
((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_EXT_TIM8_CH1) || ((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_EXT_TIM8_TRGO_ADC3) || \
((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_EXT_TIM5_CH1) || ((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_EXT_TIM5_CH3)))
#else
#if defined(STM32F101xE) || defined(STM32F105xC) || defined(STM32F107xC)
#define IS_LL_ADC_REG_TRIG_SOURCE(__REG_TRIG_SOURCE__) \
(((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_SOFTWARE) || ((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_EXT_TIM1_CH3) || \
((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_EXT_TIM1_CH1) || ((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_EXT_TIM1_CH2) || \
((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_EXT_TIM2_CH2) || ((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_EXT_TIM3_TRGO) || \
((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_EXT_TIM4_CH4) || ((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_EXT_EXTI_LINE11) || \
((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_EXT_TIM8_TRGO))
#else
#define IS_LL_ADC_REG_TRIG_SOURCE(__REG_TRIG_SOURCE__) \
(((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_SOFTWARE) || ((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_EXT_TIM1_CH3) || \
((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_EXT_TIM1_CH1) || ((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_EXT_TIM1_CH2) || \
((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_EXT_TIM2_CH2) || ((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_EXT_TIM3_TRGO) || \
((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_EXT_TIM4_CH4) || ((__REG_TRIG_SOURCE__) == LL_ADC_REG_TRIG_EXT_EXTI_LINE11))
#endif
#endif
#define IS_LL_ADC_REG_CONTINUOUS_MODE(__REG_CONTINUOUS_MODE__) \
(((__REG_CONTINUOUS_MODE__) == LL_ADC_REG_CONV_SINGLE) || ((__REG_CONTINUOUS_MODE__) == LL_ADC_REG_CONV_CONTINUOUS))
#define IS_LL_ADC_REG_DMA_TRANSFER(__REG_DMA_TRANSFER__) \
(((__REG_DMA_TRANSFER__) == LL_ADC_REG_DMA_TRANSFER_NONE) || ((__REG_DMA_TRANSFER__) == LL_ADC_REG_DMA_TRANSFER_UNLIMITED))
#define IS_LL_ADC_REG_SEQ_SCAN_LENGTH(__REG_SEQ_SCAN_LENGTH__) \
(((__REG_SEQ_SCAN_LENGTH__) == LL_ADC_REG_SEQ_SCAN_DISABLE) || ((__REG_SEQ_SCAN_LENGTH__) == LL_ADC_REG_SEQ_SCAN_ENABLE_2RANKS) || \
((__REG_SEQ_SCAN_LENGTH__) == LL_ADC_REG_SEQ_SCAN_ENABLE_3RANKS) || ((__REG_SEQ_SCAN_LENGTH__) == LL_ADC_REG_SEQ_SCAN_ENABLE_4RANKS) || \
((__REG_SEQ_SCAN_LENGTH__) == LL_ADC_REG_SEQ_SCAN_ENABLE_5RANKS) || ((__REG_SEQ_SCAN_LENGTH__) == LL_ADC_REG_SEQ_SCAN_ENABLE_6RANKS) || \
((__REG_SEQ_SCAN_LENGTH__) == LL_ADC_REG_SEQ_SCAN_ENABLE_7RANKS) || ((__REG_SEQ_SCAN_LENGTH__) == LL_ADC_REG_SEQ_SCAN_ENABLE_8RANKS) || \
((__REG_SEQ_SCAN_LENGTH__) == LL_ADC_REG_SEQ_SCAN_ENABLE_9RANKS) || ((__REG_SEQ_SCAN_LENGTH__) == LL_ADC_REG_SEQ_SCAN_ENABLE_10RANKS) || \
((__REG_SEQ_SCAN_LENGTH__) == LL_ADC_REG_SEQ_SCAN_ENABLE_11RANKS) || ((__REG_SEQ_SCAN_LENGTH__) == LL_ADC_REG_SEQ_SCAN_ENABLE_12RANKS) || \
((__REG_SEQ_SCAN_LENGTH__) == LL_ADC_REG_SEQ_SCAN_ENABLE_13RANKS) || ((__REG_SEQ_SCAN_LENGTH__) == LL_ADC_REG_SEQ_SCAN_ENABLE_14RANKS) || \
((__REG_SEQ_SCAN_LENGTH__) == LL_ADC_REG_SEQ_SCAN_ENABLE_15RANKS) || ((__REG_SEQ_SCAN_LENGTH__) == LL_ADC_REG_SEQ_SCAN_ENABLE_16RANKS))
#define IS_LL_ADC_REG_SEQ_SCAN_DISCONT_MODE(__REG_SEQ_DISCONT_MODE__) \
(((__REG_SEQ_DISCONT_MODE__) == LL_ADC_REG_SEQ_DISCONT_DISABLE) || ((__REG_SEQ_DISCONT_MODE__) == LL_ADC_REG_SEQ_DISCONT_1RANK) || \
((__REG_SEQ_DISCONT_MODE__) == LL_ADC_REG_SEQ_DISCONT_2RANKS) || ((__REG_SEQ_DISCONT_MODE__) == LL_ADC_REG_SEQ_DISCONT_3RANKS) || \
((__REG_SEQ_DISCONT_MODE__) == LL_ADC_REG_SEQ_DISCONT_4RANKS) || ((__REG_SEQ_DISCONT_MODE__) == LL_ADC_REG_SEQ_DISCONT_5RANKS) || \
((__REG_SEQ_DISCONT_MODE__) == LL_ADC_REG_SEQ_DISCONT_6RANKS) || ((__REG_SEQ_DISCONT_MODE__) == LL_ADC_REG_SEQ_DISCONT_7RANKS) || \
((__REG_SEQ_DISCONT_MODE__) == LL_ADC_REG_SEQ_DISCONT_8RANKS))
/* Check of parameters for configuration of ADC hierarchical scope: */
/* ADC group injected */
#if defined(ADC3)
#define IS_LL_ADC_INJ_TRIG_SOURCE(__ADC_INSTANCE__, __INJ_TRIG_SOURCE__) \
((((__ADC_INSTANCE__) == ADC1) || ((__ADC_INSTANCE__) == ADC2)) \
? (((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_SOFTWARE) || ((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_EXT_TIM1_TRGO) || \
((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_EXT_TIM1_CH4) || ((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_EXT_TIM2_TRGO) || \
((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_EXT_TIM2_CH1) || ((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_EXT_TIM3_CH4) || \
((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_EXT_TIM4_TRGO) || ((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_EXT_EXTI_LINE15) || \
((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_EXT_TIM8_CH4)) \
: (((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_SOFTWARE) || ((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_EXT_TIM1_TRGO) || \
((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_EXT_TIM1_CH4) || ((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_EXT_TIM4_CH3) || \
((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_EXT_TIM8_CH2) || ((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_EXT_TIM8_CH4_ADC3) || \
((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_EXT_TIM5_TRGO) || ((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_EXT_TIM5_CH4)))
#else
#if defined(STM32F101xE) || defined(STM32F105xC) || defined(STM32F107xC)
#define IS_LL_ADC_INJ_TRIG_SOURCE(__INJ_TRIG_SOURCE__) \
(((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_SOFTWARE) || ((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_EXT_TIM1_TRGO) || \
((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_EXT_TIM1_CH4) || ((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_EXT_TIM2_TRGO) || \
((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_EXT_TIM2_CH1) || ((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_EXT_TIM3_CH4) || \
((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_EXT_TIM4_TRGO) || ((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_EXT_EXTI_LINE15) || \
((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_EXT_TIM8_CH4))
#else
#define IS_LL_ADC_INJ_TRIG_SOURCE(__INJ_TRIG_SOURCE__) \
(((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_SOFTWARE) || ((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_EXT_TIM1_TRGO) || \
((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_EXT_TIM1_CH4) || ((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_EXT_TIM2_TRGO) || \
((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_EXT_TIM2_CH1) || ((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_EXT_TIM3_CH4) || \
((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_EXT_TIM4_TRGO) || ((__INJ_TRIG_SOURCE__) == LL_ADC_INJ_TRIG_EXT_EXTI_LINE15))
#endif
#endif
#define IS_LL_ADC_INJ_TRIG_AUTO(__INJ_TRIG_AUTO__) \
(((__INJ_TRIG_AUTO__) == LL_ADC_INJ_TRIG_INDEPENDENT) || ((__INJ_TRIG_AUTO__) == LL_ADC_INJ_TRIG_FROM_GRP_REGULAR))
#define IS_LL_ADC_INJ_SEQ_SCAN_LENGTH(__INJ_SEQ_SCAN_LENGTH__) \
(((__INJ_SEQ_SCAN_LENGTH__) == LL_ADC_INJ_SEQ_SCAN_DISABLE) || ((__INJ_SEQ_SCAN_LENGTH__) == LL_ADC_INJ_SEQ_SCAN_ENABLE_2RANKS) || \
((__INJ_SEQ_SCAN_LENGTH__) == LL_ADC_INJ_SEQ_SCAN_ENABLE_3RANKS) || ((__INJ_SEQ_SCAN_LENGTH__) == LL_ADC_INJ_SEQ_SCAN_ENABLE_4RANKS))
#define IS_LL_ADC_INJ_SEQ_SCAN_DISCONT_MODE(__INJ_SEQ_DISCONT_MODE__) \
(((__INJ_SEQ_DISCONT_MODE__) == LL_ADC_INJ_SEQ_DISCONT_DISABLE) || ((__INJ_SEQ_DISCONT_MODE__) == LL_ADC_INJ_SEQ_DISCONT_1RANK))
#if defined(ADC_MULTIMODE_SUPPORT)
/* Check of parameters for configuration of ADC hierarchical scope: */
/* multimode. */
#define IS_LL_ADC_MULTI_MODE(__MULTI_MODE__) \
(((__MULTI_MODE__) == LL_ADC_MULTI_INDEPENDENT) || ((__MULTI_MODE__) == LL_ADC_MULTI_DUAL_REG_SIMULT) || \
((__MULTI_MODE__) == LL_ADC_MULTI_DUAL_REG_INTERL_FAST) || ((__MULTI_MODE__) == LL_ADC_MULTI_DUAL_REG_INTERL_SLOW) || \
((__MULTI_MODE__) == LL_ADC_MULTI_DUAL_INJ_SIMULT) || ((__MULTI_MODE__) == LL_ADC_MULTI_DUAL_INJ_ALTERN) || \
((__MULTI_MODE__) == LL_ADC_MULTI_DUAL_REG_SIM_INJ_SIM) || ((__MULTI_MODE__) == LL_ADC_MULTI_DUAL_REG_SIM_INJ_ALT) || \
((__MULTI_MODE__) == LL_ADC_MULTI_DUAL_REG_INTFAST_INJ_SIM) || ((__MULTI_MODE__) == LL_ADC_MULTI_DUAL_REG_INTSLOW_INJ_SIM))
#define IS_LL_ADC_MULTI_MASTER_SLAVE(__MULTI_MASTER_SLAVE__) \
(((__MULTI_MASTER_SLAVE__) == LL_ADC_MULTI_MASTER) || ((__MULTI_MASTER_SLAVE__) == LL_ADC_MULTI_SLAVE) || \
((__MULTI_MASTER_SLAVE__) == LL_ADC_MULTI_MASTER_SLAVE))
#endif /* ADC_MULTIMODE_SUPPORT */
/**
* @}
*/
/* Private function prototypes -----------------------------------------------*/
/* Exported functions --------------------------------------------------------*/
/** @addtogroup ADC_LL_Exported_Functions
* @{
*/
/** @addtogroup ADC_LL_EF_Init
* @{
*/
/**
* @brief De-initialize registers of all ADC instances belonging to
* the same ADC common instance to their default reset values.
* @param ADCxy_COMMON ADC common instance
* (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() )
* @retval An ErrorStatus enumeration value:
* - SUCCESS: ADC common registers are de-initialized
* - ERROR: not applicable
*/
ErrorStatus LL_ADC_CommonDeInit(ADC_Common_TypeDef *ADCxy_COMMON)
{
/* Check the parameters */
assert_param(IS_ADC_COMMON_INSTANCE(ADCxy_COMMON));
/* Force reset of ADC clock (core clock) */
LL_APB2_GRP1_ForceReset(LL_APB2_GRP1_PERIPH_ADC1);
/* Release reset of ADC clock (core clock) */
LL_APB2_GRP1_ReleaseReset(LL_APB2_GRP1_PERIPH_ADC1);
return SUCCESS;
}
/**
* @brief Initialize some features of ADC common parameters
* (all ADC instances belonging to the same ADC common instance)
* and multimode (for devices with several ADC instances available).
* @note The setting of ADC common parameters is conditioned to
* ADC instances state:
* All ADC instances belonging to the same ADC common instance
* must be disabled.
* @param ADCxy_COMMON ADC common instance
* (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() )
* @param ADC_CommonInitStruct Pointer to a @ref LL_ADC_CommonInitTypeDef structure
* @retval An ErrorStatus enumeration value:
* - SUCCESS: ADC common registers are initialized
* - ERROR: ADC common registers are not initialized
*/
ErrorStatus LL_ADC_CommonInit(ADC_Common_TypeDef *ADCxy_COMMON, LL_ADC_CommonInitTypeDef *ADC_CommonInitStruct)
{
ErrorStatus status = SUCCESS;
/* Check the parameters */
assert_param(IS_ADC_COMMON_INSTANCE(ADCxy_COMMON));
#if defined(ADC_MULTIMODE_SUPPORT)
assert_param(IS_LL_ADC_MULTI_MODE(ADC_CommonInitStruct->Multimode));
#endif /* ADC_MULTIMODE_SUPPORT */
/* Note: Hardware constraint (refer to description of functions */
/* "LL_ADC_SetCommonXXX()" and "LL_ADC_SetMultiXXX()"): */
/* On this STM32 serie, setting of these features is conditioned to */
/* ADC state: */
/* All ADC instances of the ADC common group must be disabled. */
if (__LL_ADC_IS_ENABLED_ALL_COMMON_INSTANCE(ADCxy_COMMON) == 0U) {
/* Configuration of ADC hierarchical scope: */
/* - common to several ADC */
/* (all ADC instances belonging to the same ADC common instance) */
/* - multimode (if several ADC instances available on the */
/* selected device) */
/* - Set ADC multimode configuration */
/* - Set ADC multimode DMA transfer */
/* - Set ADC multimode: delay between 2 sampling phases */
#if defined(ADC_MULTIMODE_SUPPORT)
if (ADC_CommonInitStruct->Multimode != LL_ADC_MULTI_INDEPENDENT) {
MODIFY_REG(ADCxy_COMMON->CR1, ADC_CR1_DUALMOD, ADC_CommonInitStruct->Multimode);
} else {
MODIFY_REG(ADCxy_COMMON->CR1, ADC_CR1_DUALMOD, LL_ADC_MULTI_INDEPENDENT);
}
#endif
} else {
/* Initialization error: One or several ADC instances belonging to */
/* the same ADC common instance are not disabled. */
status = ERROR;
}
return status;
}
/**
* @brief Set each @ref LL_ADC_CommonInitTypeDef field to default value.
* @param ADC_CommonInitStruct Pointer to a @ref LL_ADC_CommonInitTypeDef structure
* whose fields will be set to default values.
* @retval None
*/
void LL_ADC_CommonStructInit(LL_ADC_CommonInitTypeDef *ADC_CommonInitStruct)
{
/* Set ADC_CommonInitStruct fields to default values */
/* Set fields of ADC common */
/* (all ADC instances belonging to the same ADC common instance) */
#if defined(ADC_MULTIMODE_SUPPORT)
/* Set fields of ADC multimode */
ADC_CommonInitStruct->Multimode = LL_ADC_MULTI_INDEPENDENT;
#endif /* ADC_MULTIMODE_SUPPORT */
}
/**
* @brief De-initialize registers of the selected ADC instance
* to their default reset values.
* @note To reset all ADC instances quickly (perform a hard reset),
* use function @ref LL_ADC_CommonDeInit().
* @param ADCx ADC instance
* @retval An ErrorStatus enumeration value:
* - SUCCESS: ADC registers are de-initialized
* - ERROR: ADC registers are not de-initialized
*/
ErrorStatus LL_ADC_DeInit(ADC_TypeDef *ADCx)
{
ErrorStatus status = SUCCESS;
/* Check the parameters */
assert_param(IS_ADC_ALL_INSTANCE(ADCx));
/* Disable ADC instance if not already disabled. */
if (LL_ADC_IsEnabled(ADCx) == 1U) {
/* Set ADC group regular trigger source to SW start to ensure to not */
/* have an external trigger event occurring during the conversion stop */
/* ADC disable process. */
LL_ADC_REG_SetTriggerSource(ADCx, LL_ADC_REG_TRIG_SOFTWARE);
/* Set ADC group injected trigger source to SW start to ensure to not */
/* have an external trigger event occurring during the conversion stop */
/* ADC disable process. */
LL_ADC_INJ_SetTriggerSource(ADCx, LL_ADC_INJ_TRIG_SOFTWARE);
/* Disable the ADC instance */
LL_ADC_Disable(ADCx);
}
/* Check whether ADC state is compliant with expected state */
/* (hardware requirements of bits state to reset registers below) */
if (READ_BIT(ADCx->CR2, ADC_CR2_ADON) == 0U) {
/* ========== Reset ADC registers ========== */
/* Reset register SR */
CLEAR_BIT(ADCx->SR, (LL_ADC_FLAG_STRT | LL_ADC_FLAG_JSTRT | LL_ADC_FLAG_EOS | LL_ADC_FLAG_JEOS | LL_ADC_FLAG_AWD1));
/* Reset register CR1 */
#if defined(STM32F103x6) || defined(STM32F103xB) || defined(STM32F105xC) || defined(STM32F107xC) || defined(STM32F103xE) || defined(STM32F103xG)
CLEAR_BIT(ADCx->CR1, (ADC_CR1_AWDEN | ADC_CR1_JAWDEN | ADC_CR1_DUALMOD | ADC_CR1_DISCNUM | ADC_CR1_JDISCEN | ADC_CR1_DISCEN | ADC_CR1_JAUTO |
ADC_CR1_AWDSGL | ADC_CR1_SCAN | ADC_CR1_JEOCIE | ADC_CR1_AWDIE | ADC_CR1_EOCIE | ADC_CR1_AWDCH));
#else
CLEAR_BIT(ADCx->CR1, (ADC_CR1_AWDEN | ADC_CR1_JAWDEN | ADC_CR1_DISCNUM | ADC_CR1_JDISCEN | ADC_CR1_DISCEN | ADC_CR1_JAUTO | ADC_CR1_AWDSGL |
ADC_CR1_SCAN | ADC_CR1_JEOCIE | ADC_CR1_AWDIE | ADC_CR1_EOCIE | ADC_CR1_AWDCH));
#endif
/* Reset register CR2 */
CLEAR_BIT(ADCx->CR2, (ADC_CR2_TSVREFE | ADC_CR2_SWSTART | ADC_CR2_EXTTRIG | ADC_CR2_EXTSEL | ADC_CR2_JSWSTART | ADC_CR2_JEXTTRIG |
ADC_CR2_JEXTSEL | ADC_CR2_ALIGN | ADC_CR2_DMA | ADC_CR2_RSTCAL | ADC_CR2_CAL | ADC_CR2_CONT | ADC_CR2_ADON));
/* Reset register SMPR1 */
CLEAR_BIT(ADCx->SMPR1, (ADC_SMPR1_SMP17 | ADC_SMPR1_SMP16 | ADC_SMPR1_SMP15 | ADC_SMPR1_SMP14 | ADC_SMPR1_SMP13 | ADC_SMPR1_SMP12 |
ADC_SMPR1_SMP11 | ADC_SMPR1_SMP10));
/* Reset register SMPR2 */
CLEAR_BIT(ADCx->SMPR2, (ADC_SMPR2_SMP9 | ADC_SMPR2_SMP8 | ADC_SMPR2_SMP7 | ADC_SMPR2_SMP6 | ADC_SMPR2_SMP5 | ADC_SMPR2_SMP4 | ADC_SMPR2_SMP3 |
ADC_SMPR2_SMP2 | ADC_SMPR2_SMP1 | ADC_SMPR2_SMP0));
/* Reset register JOFR1 */
CLEAR_BIT(ADCx->JOFR1, ADC_JOFR1_JOFFSET1);
/* Reset register JOFR2 */
CLEAR_BIT(ADCx->JOFR2, ADC_JOFR2_JOFFSET2);
/* Reset register JOFR3 */
CLEAR_BIT(ADCx->JOFR3, ADC_JOFR3_JOFFSET3);
/* Reset register JOFR4 */
CLEAR_BIT(ADCx->JOFR4, ADC_JOFR4_JOFFSET4);
/* Reset register HTR */
SET_BIT(ADCx->HTR, ADC_HTR_HT);
/* Reset register LTR */
CLEAR_BIT(ADCx->LTR, ADC_LTR_LT);
/* Reset register SQR1 */
CLEAR_BIT(ADCx->SQR1, (ADC_SQR1_L | ADC_SQR1_SQ16 | ADC_SQR1_SQ15 | ADC_SQR1_SQ14 | ADC_SQR1_SQ13));
/* Reset register SQR2 */
CLEAR_BIT(ADCx->SQR2, (ADC_SQR2_SQ12 | ADC_SQR2_SQ11 | ADC_SQR2_SQ10 | ADC_SQR2_SQ9 | ADC_SQR2_SQ8 | ADC_SQR2_SQ7));
/* Reset register JSQR */
CLEAR_BIT(ADCx->JSQR, (ADC_JSQR_JL | ADC_JSQR_JSQ4 | ADC_JSQR_JSQ3 | ADC_JSQR_JSQ2 | ADC_JSQR_JSQ1));
/* Reset register DR */
/* bits in access mode read only, no direct reset applicable */
/* Reset registers JDR1, JDR2, JDR3, JDR4 */
/* bits in access mode read only, no direct reset applicable */
}
return status;
}
/**
* @brief Initialize some features of ADC instance.
* @note These parameters have an impact on ADC scope: ADC instance.
* Affects both group regular and group injected (availability
* of ADC group injected depends on STM32 families).
* Refer to corresponding unitary functions into
* @ref ADC_LL_EF_Configuration_ADC_Instance .
* @note The setting of these parameters by function @ref LL_ADC_Init()
* is conditioned to ADC state:
* ADC instance must be disabled.
* This condition is applied to all ADC features, for efficiency
* and compatibility over all STM32 families. However, the different
* features can be set under different ADC state conditions
* (setting possible with ADC enabled without conversion on going,
* ADC enabled with conversion on going, ...)
* Each feature can be updated afterwards with a unitary function
* and potentially with ADC in a different state than disabled,
* refer to description of each function for setting
* conditioned to ADC state.
* @note After using this function, some other features must be configured
* using LL unitary functions.
* The minimum configuration remaining to be done is:
* - Set ADC group regular or group injected sequencer:
* map channel on the selected sequencer rank.
* Refer to function @ref LL_ADC_REG_SetSequencerRanks().
* - Set ADC channel sampling time
* Refer to function LL_ADC_SetChannelSamplingTime();
* @param ADCx ADC instance
* @param ADC_InitStruct Pointer to a @ref LL_ADC_REG_InitTypeDef structure
* @retval An ErrorStatus enumeration value:
* - SUCCESS: ADC registers are initialized
* - ERROR: ADC registers are not initialized
*/
ErrorStatus LL_ADC_Init(ADC_TypeDef *ADCx, LL_ADC_InitTypeDef *ADC_InitStruct)
{
ErrorStatus status = SUCCESS;
/* Check the parameters */
assert_param(IS_ADC_ALL_INSTANCE(ADCx));
assert_param(IS_LL_ADC_DATA_ALIGN(ADC_InitStruct->DataAlignment));
assert_param(IS_LL_ADC_SCAN_SELECTION(ADC_InitStruct->SequencersScanMode));
/* Note: Hardware constraint (refer to description of this function): */
/* ADC instance must be disabled. */
if (LL_ADC_IsEnabled(ADCx) == 0U) {
/* Configuration of ADC hierarchical scope: */
/* - ADC instance */
/* - Set ADC conversion data alignment */
MODIFY_REG(ADCx->CR1, ADC_CR1_SCAN, ADC_InitStruct->SequencersScanMode);
MODIFY_REG(ADCx->CR2, ADC_CR2_ALIGN, ADC_InitStruct->DataAlignment);
} else {
/* Initialization error: ADC instance is not disabled. */
status = ERROR;
}
return status;
}
/**
* @brief Set each @ref LL_ADC_InitTypeDef field to default value.
* @param ADC_InitStruct Pointer to a @ref LL_ADC_InitTypeDef structure
* whose fields will be set to default values.
* @retval None
*/
void LL_ADC_StructInit(LL_ADC_InitTypeDef *ADC_InitStruct)
{
/* Set ADC_InitStruct fields to default values */
/* Set fields of ADC instance */
ADC_InitStruct->DataAlignment = LL_ADC_DATA_ALIGN_RIGHT;
/* Enable scan mode to have a generic behavior with ADC of other */
/* STM32 families, without this setting available: */
/* ADC group regular sequencer and ADC group injected sequencer depend */
/* only of their own configuration. */
ADC_InitStruct->SequencersScanMode = LL_ADC_SEQ_SCAN_ENABLE;
}
/**
* @brief Initialize some features of ADC group regular.
* @note These parameters have an impact on ADC scope: ADC group regular.
* Refer to corresponding unitary functions into
* @ref ADC_LL_EF_Configuration_ADC_Group_Regular
* (functions with prefix "REG").
* @note The setting of these parameters by function @ref LL_ADC_Init()
* is conditioned to ADC state:
* ADC instance must be disabled.
* This condition is applied to all ADC features, for efficiency
* and compatibility over all STM32 families. However, the different
* features can be set under different ADC state conditions
* (setting possible with ADC enabled without conversion on going,
* ADC enabled with conversion on going, ...)
* Each feature can be updated afterwards with a unitary function
* and potentially with ADC in a different state than disabled,
* refer to description of each function for setting
* conditioned to ADC state.
* @note After using this function, other features must be configured
* using LL unitary functions.
* The minimum configuration remaining to be done is:
* - Set ADC group regular or group injected sequencer:
* map channel on the selected sequencer rank.
* Refer to function @ref LL_ADC_REG_SetSequencerRanks().
* - Set ADC channel sampling time
* Refer to function LL_ADC_SetChannelSamplingTime();
* @param ADCx ADC instance
* @param ADC_REG_InitStruct Pointer to a @ref LL_ADC_REG_InitTypeDef structure
* @retval An ErrorStatus enumeration value:
* - SUCCESS: ADC registers are initialized
* - ERROR: ADC registers are not initialized
*/
ErrorStatus LL_ADC_REG_Init(ADC_TypeDef *ADCx, LL_ADC_REG_InitTypeDef *ADC_REG_InitStruct)
{
ErrorStatus status = SUCCESS;
/* Check the parameters */
assert_param(IS_ADC_ALL_INSTANCE(ADCx));
#if defined(ADC3)
assert_param(IS_LL_ADC_REG_TRIG_SOURCE(ADCx, ADC_REG_InitStruct->TriggerSource));
#else
assert_param(IS_LL_ADC_REG_TRIG_SOURCE(ADC_REG_InitStruct->TriggerSource));
#endif
assert_param(IS_LL_ADC_REG_SEQ_SCAN_LENGTH(ADC_REG_InitStruct->SequencerLength));
if (ADC_REG_InitStruct->SequencerLength != LL_ADC_REG_SEQ_SCAN_DISABLE) {
assert_param(IS_LL_ADC_REG_SEQ_SCAN_DISCONT_MODE(ADC_REG_InitStruct->SequencerDiscont));
}
assert_param(IS_LL_ADC_REG_CONTINUOUS_MODE(ADC_REG_InitStruct->ContinuousMode));
assert_param(IS_LL_ADC_REG_DMA_TRANSFER(ADC_REG_InitStruct->DMATransfer));
/* Note: Hardware constraint (refer to description of this function): */
/* ADC instance must be disabled. */
if (LL_ADC_IsEnabled(ADCx) == 0U) {
/* Configuration of ADC hierarchical scope: */
/* - ADC group regular */
/* - Set ADC group regular trigger source */
/* - Set ADC group regular sequencer length */
/* - Set ADC group regular sequencer discontinuous mode */
/* - Set ADC group regular continuous mode */
/* - Set ADC group regular conversion data transfer: no transfer or */
/* transfer by DMA, and DMA requests mode */
/* Note: On this STM32 serie, ADC trigger edge is set when starting */
/* ADC conversion. */
/* Refer to function @ref LL_ADC_REG_StartConversionExtTrig(). */
if (ADC_REG_InitStruct->SequencerLength != LL_ADC_REG_SEQ_SCAN_DISABLE) {
MODIFY_REG(ADCx->CR1, ADC_CR1_DISCEN | ADC_CR1_DISCNUM, ADC_REG_InitStruct->SequencerLength | ADC_REG_InitStruct->SequencerDiscont);
} else {
MODIFY_REG(ADCx->CR1, ADC_CR1_DISCEN | ADC_CR1_DISCNUM, ADC_REG_InitStruct->SequencerLength | LL_ADC_REG_SEQ_DISCONT_DISABLE);
}
MODIFY_REG(ADCx->CR2, ADC_CR2_EXTSEL | ADC_CR2_CONT | ADC_CR2_DMA,
ADC_REG_InitStruct->TriggerSource | ADC_REG_InitStruct->ContinuousMode | ADC_REG_InitStruct->DMATransfer);
/* Set ADC group regular sequencer length and scan direction */
/* Note: Hardware constraint (refer to description of this function): */
/* Note: If ADC instance feature scan mode is disabled */
/* (refer to ADC instance initialization structure */
/* parameter @ref SequencersScanMode */
/* or function @ref LL_ADC_SetSequencersScanMode() ), */
/* this parameter is discarded. */
LL_ADC_REG_SetSequencerLength(ADCx, ADC_REG_InitStruct->SequencerLength);
} else {
/* Initialization error: ADC instance is not disabled. */
status = ERROR;
}
return status;
}
/**
* @brief Set each @ref LL_ADC_REG_InitTypeDef field to default value.
* @param ADC_REG_InitStruct Pointer to a @ref LL_ADC_REG_InitTypeDef structure
* whose fields will be set to default values.
* @retval None
*/
void LL_ADC_REG_StructInit(LL_ADC_REG_InitTypeDef *ADC_REG_InitStruct)
{
/* Set ADC_REG_InitStruct fields to default values */
/* Set fields of ADC group regular */
/* Note: On this STM32 serie, ADC trigger edge is set when starting */
/* ADC conversion. */
/* Refer to function @ref LL_ADC_REG_StartConversionExtTrig(). */
ADC_REG_InitStruct->TriggerSource = LL_ADC_REG_TRIG_SOFTWARE;
ADC_REG_InitStruct->SequencerLength = LL_ADC_REG_SEQ_SCAN_DISABLE;
ADC_REG_InitStruct->SequencerDiscont = LL_ADC_REG_SEQ_DISCONT_DISABLE;
ADC_REG_InitStruct->ContinuousMode = LL_ADC_REG_CONV_SINGLE;
ADC_REG_InitStruct->DMATransfer = LL_ADC_REG_DMA_TRANSFER_NONE;
}
/**
* @brief Initialize some features of ADC group injected.
* @note These parameters have an impact on ADC scope: ADC group injected.
* Refer to corresponding unitary functions into
* @ref ADC_LL_EF_Configuration_ADC_Group_Regular
* (functions with prefix "INJ").
* @note The setting of these parameters by function @ref LL_ADC_Init()
* is conditioned to ADC state:
* ADC instance must be disabled.
* This condition is applied to all ADC features, for efficiency
* and compatibility over all STM32 families. However, the different
* features can be set under different ADC state conditions
* (setting possible with ADC enabled without conversion on going,
* ADC enabled with conversion on going, ...)
* Each feature can be updated afterwards with a unitary function
* and potentially with ADC in a different state than disabled,
* refer to description of each function for setting
* conditioned to ADC state.
* @note After using this function, other features must be configured
* using LL unitary functions.
* The minimum configuration remaining to be done is:
* - Set ADC group injected sequencer:
* map channel on the selected sequencer rank.
* Refer to function @ref LL_ADC_INJ_SetSequencerRanks().
* - Set ADC channel sampling time
* Refer to function LL_ADC_SetChannelSamplingTime();
* @param ADCx ADC instance
* @param ADC_INJ_InitStruct Pointer to a @ref LL_ADC_INJ_InitTypeDef structure
* @retval An ErrorStatus enumeration value:
* - SUCCESS: ADC registers are initialized
* - ERROR: ADC registers are not initialized
*/
ErrorStatus LL_ADC_INJ_Init(ADC_TypeDef *ADCx, LL_ADC_INJ_InitTypeDef *ADC_INJ_InitStruct)
{
ErrorStatus status = SUCCESS;
/* Check the parameters */
assert_param(IS_ADC_ALL_INSTANCE(ADCx));
#if defined(ADC3)
assert_param(IS_LL_ADC_INJ_TRIG_SOURCE(ADCx, ADC_INJ_InitStruct->TriggerSource));
#else
assert_param(IS_LL_ADC_INJ_TRIG_SOURCE(ADC_INJ_InitStruct->TriggerSource));
#endif
assert_param(IS_LL_ADC_INJ_SEQ_SCAN_LENGTH(ADC_INJ_InitStruct->SequencerLength));
if (ADC_INJ_InitStruct->SequencerLength != LL_ADC_INJ_SEQ_SCAN_DISABLE) {
assert_param(IS_LL_ADC_INJ_SEQ_SCAN_DISCONT_MODE(ADC_INJ_InitStruct->SequencerDiscont));
}
assert_param(IS_LL_ADC_INJ_TRIG_AUTO(ADC_INJ_InitStruct->TrigAuto));
/* Note: Hardware constraint (refer to description of this function): */
/* ADC instance must be disabled. */
if (LL_ADC_IsEnabled(ADCx) == 0U) {
/* Configuration of ADC hierarchical scope: */
/* - ADC group injected */
/* - Set ADC group injected trigger source */
/* - Set ADC group injected sequencer length */
/* - Set ADC group injected sequencer discontinuous mode */
/* - Set ADC group injected conversion trigger: independent or */
/* from ADC group regular */
/* Note: On this STM32 serie, ADC trigger edge is set when starting */
/* ADC conversion. */
/* Refer to function @ref LL_ADC_INJ_StartConversionExtTrig(). */
if (ADC_INJ_InitStruct->SequencerLength != LL_ADC_REG_SEQ_SCAN_DISABLE) {
MODIFY_REG(ADCx->CR1, ADC_CR1_JDISCEN | ADC_CR1_JAUTO, ADC_INJ_InitStruct->SequencerDiscont | ADC_INJ_InitStruct->TrigAuto);
} else {
MODIFY_REG(ADCx->CR1, ADC_CR1_JDISCEN | ADC_CR1_JAUTO, LL_ADC_REG_SEQ_DISCONT_DISABLE | ADC_INJ_InitStruct->TrigAuto);
}
MODIFY_REG(ADCx->CR2, ADC_CR2_JEXTSEL, ADC_INJ_InitStruct->TriggerSource);
/* Note: Hardware constraint (refer to description of this function): */
/* Note: If ADC instance feature scan mode is disabled */
/* (refer to ADC instance initialization structure */
/* parameter @ref SequencersScanMode */
/* or function @ref LL_ADC_SetSequencersScanMode() ), */
/* this parameter is discarded. */
LL_ADC_INJ_SetSequencerLength(ADCx, ADC_INJ_InitStruct->SequencerLength);
} else {
/* Initialization error: ADC instance is not disabled. */
status = ERROR;
}
return status;
}
/**
* @brief Set each @ref LL_ADC_INJ_InitTypeDef field to default value.
* @param ADC_INJ_InitStruct Pointer to a @ref LL_ADC_INJ_InitTypeDef structure
* whose fields will be set to default values.
* @retval None
*/
void LL_ADC_INJ_StructInit(LL_ADC_INJ_InitTypeDef *ADC_INJ_InitStruct)
{
/* Set ADC_INJ_InitStruct fields to default values */
/* Set fields of ADC group injected */
ADC_INJ_InitStruct->TriggerSource = LL_ADC_INJ_TRIG_SOFTWARE;
ADC_INJ_InitStruct->SequencerLength = LL_ADC_INJ_SEQ_SCAN_DISABLE;
ADC_INJ_InitStruct->SequencerDiscont = LL_ADC_INJ_SEQ_DISCONT_DISABLE;
ADC_INJ_InitStruct->TrigAuto = LL_ADC_INJ_TRIG_INDEPENDENT;
}
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
#endif /* ADC1 || ADC2 || ADC3 */
/**
* @}
*/
#endif /* USE_FULL_LL_DRIVER */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
the_stack_data/51699243.c | #include <limits.h>
#include <math.h>
float scalblnf(float x, long n)
{
if (n > INT_MAX)
n = INT_MAX;
else if (n < INT_MIN)
n = INT_MIN;
return scalbnf(x, n);
}
|
the_stack_data/42739.c | #include <stdio.h>
/*b) Crie um programa que receba a quantidade de sabonetes que um mercado
* comprou de uma fabrica e exiba o total de sabonetes recebidos, sabendo que a
* cada 100 sabonetes ganha-se 5 sabonetes de brinde. obs: sem if e sem lacos*/
int main(void) {
int qtd, brinde;
printf("Quantidade de sabonetes comprados: ");
scanf("%d", &qtd);
brinde = qtd / 100 * 5;
printf("Total de sabonetes recebidos = %d", qtd + brinde);
return 0;
}
|
the_stack_data/165767152.c | /*
* Copyright (c) 2000-2002,2004 Silicon Graphics, Inc.
* All Rights Reserved.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License 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, see <http://www.gnu.org/licenses/>.
*/
|
the_stack_data/117327465.c | #include <stdio.h>
int main(){
int matriz[3][3], maior = 0;
for(int i = 0; i < 3; i++){
for(int j = 0; j < 3; j++){
scanf("%d", &matriz[i][j]);
}
}
for(int i = 0; i < 3; i++){
for(int j = 1; j < 3; j++){
if(matriz[j][i] < matriz[j-1][i]){
maior++;
}
}
}
printf("%d", maior);
return 0;
} |
the_stack_data/878512.c | // RUN: cd %S && %clang -### -g %s -c 2>&1 | FileCheck -check-prefix=CHECK-PWD %s
// CHECK-PWD: {{"-fdebug-compilation-dir" ".*Driver.*"}}
|
the_stack_data/85539.c | #include <stdio.h>
void swap(int* i, int* j){
int k;
k = *i;
*i = *j;
*j = k;
}
int main(void){
int a =2;
int b= 3;
int *temp = &a;
swap(temp, &b);
printf("%d %d %d \n", a, b, *temp);
return 0;
}
|
the_stack_data/150139213.c | #include <stdio.h>
#define IN 1 // inside a word
#define OUT 0 // outside a word
int main(void)
{
int c, state;
state = OUT;
while ((c = getchar()) != EOF) {
if (c == ' ' || c == '\n' || c == '\t') {
if (state == IN) {
printf("\n");
state = OUT;
}
}
else {
putchar(c);
if (state == OUT)
state = IN;
}
}
return 0;
}
/*
int main(void)
{
int current, previous; // current = current character, previous = previous character
previous = ' ';
while ((current = getchar()) != EOF) {
if (current == ' ' || current == '\n' || current == '\t') {
if (previous != ' ' && previous != '\n' && previous != '\t') {
printf("\n");
}
}
else
putchar(current);
previous = current;
}
return 0;
}
*/ |
the_stack_data/57949499.c | /*
Autor: alexanderalvarado
Complilador: Apple clang version 12.0.0 (clang-1200.0.32.29)
Para comilar: gcc -o ifswitch ifswitch.c
Fecha: Fri Mar 12 11:52:19 CST 2021
librerias:
resumen: Ejemplo del uso de if y switch
entradas:
salidas:
*/
#include <stdio.h>
int main(void){
//Declaro variables locales
char letra;
int x;
printf("Ingrese una vocal: ");
letra = getchar();
printf("vocal es: %c \n", letra);
if (letra == 'a'){
printf("vocal es %c \n", letra);
}
printf("ingrese un valor de 0 a 5: ");
scanf("%d",&x);
if (x > 3){
printf("el valor es mayor \n");
}else{
printf("el valor es menor \n");
}
(x==2)? printf("el valor es 2 \n"): printf("es cualquier otro valor \n");
if (x!=0){
if (x>1){
printf("hola");
}else{
printf("%d \n ",x);
}
if (x >= 0 && x<=3){
printf("%d \n",x);
}else if(x==4) {
printf("es igual a 4 \n ");
}else if (x>4){
printf("es mayor \n");
}
}
}
|
the_stack_data/106157.c |
int x;
void func3()
{
x = 6;
}
void func2()
{
x = 3;
}
void func1()
{
x = 1;
func2();
x = 2;
}
int main()
{
x = 4;
__CPROVER_ASYNC_0:
func1();
x = 5;
return 0;
}
|
the_stack_data/121611.c | /* Test structures passed by value, including to a function with a
variable-length argument list.
This test is based on one contributed by Alan Modra. */
extern void struct_by_value_2_x (void);
extern void exit (int);
int fails;
int
main ()
{
struct_by_value_2_x ();
exit (0);
}
|
the_stack_data/14199027.c | #include <stdio.h>
int main(void){
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
if(a==b && b==c) puts("Equilateral");
else if(a*a+b*b==c*c || c*c+b*b==a*a || a*a+c*c==b*b) puts("Right");
else if(a+b<c || a+c<b || b+c<a) puts("NO");
else puts("General");
return 0;
}
|
the_stack_data/82950756.c | #include <stdio.h>
#include <math.h> // ONLY HAS MATH OPERATIONS FOR FLOATS! Use stdlib.h for some INTEGER math operations!!
#include <stdlib.h>
int main(int argc, char const *argv[]) {
int hey, test
, hello; // ok because whitespaces ignored (spaces, new lines, and anything that creates space without visual characters)
int heyThere; //lowerCamel case - think sitting on camel eith hump in front
int identifier = 1; //declare variable of type int, named/identified as identifier, and initialize/assign it the value of zero at it's memeory location.
int divideByZeroError = 10 / identifier; // causes a runtime error and program will terminate if identifier is 0 - identifier is 0; cannot divide by zero.
divideByZeroError = 10 % identifier; // causes a runtime error and program will terminate f identifier is 0 - identifier is 0; cannot divide by zero.
char myString[50] = "";
double sometimesZero = 0.0;
double divideByZeroFloatError = 1.0 / sometimesZero; // will result in postive infinity if sometimes zero is 0.0. Negative infinity if were -0.0 (negative).
const double GRAVITY_ACCELERATION = 9.8; // use const when I want an unchanging literal.
double sciNotation = 6.02e23; // can use scientific notation and will output as decimal
printf("sciNotation: %lf\n", sciNotation);
printf("%d\n", atoi("4"));
printf("%lf\n", divideByZeroFloatError); // return the string as an integer if the string is actually a valid integer. Otherwise, will return 0. Good: "42" | Bad: 42w
printf("%c\n", myString); //even though myString is a single character, this is an error because I specified printf to print a char
scanf("%s", &myString);
scanf("%s", &myString);
scanf("%c", &myString);
// common escape sequences: \n, \t, \\, \', \"
// scanf() only reads up until the first white space. Having two successive scanf() statements, omitting the space in the second scanf(), when the user type "Fuji Apple"<enter>, will result in the first scanf() reading "Fuji" and the second reading "Apple" - Notice how I don't get the second chance to type again. If I included a third scanf(), <enter>/\n would have been "typed" had there been no space in the beggining of the third scanf() and the format string was for a character. If it had a format string for strings, this would not cascade and I would still be prompted for input.
// When using scanf on after the other, don't forget the space in the beggining of the second scanf to indicate I want ignore whitespaces - pressing enter is a new line character, hence I also entered a char with a whitespace, causing weird shit.
// When dealing with string, you cannot assign values to a string using '=' unless you are initializing it. I must use strcpy(dest, src) and dest mu be as large as src (don't forget about the null terminator/character, so actually length of src + 1).
// Must include <string.h> for string functions.
// unsigned ints allocates all maximum bits of numbers to the postive portion. If we want to print/scan an unsigned value, use the format specifier %u, %lu, %llu accordingly.
// relational and equality operators should only be used on ints, characters. Floating points numbers are imprecise and strings have specific functions to do this.
// charatcer types return value. Does not quit is already converted or not a logical type - tolower('?');
// conditional expression: (condition) ? expr1 : expr2;
enum LightState {RED, YELLOW, GREEN};
enum LightState currLight = RED;
// enum is a set of constant values for a new type. In this case LightState. Anything with a type enum LightState may only take on these values. The values are indexed as numbers starting from 0.
/* psuedo code for swapping elements from two arrays
arr 1 2 3 4
arr2 5 6 7 8
int temp
for < numElem
temp = arr[i]
arr[i] = arr2[i]
arr2[i] = temp
*/
// initialize a 2D array. Make mental note of the nested braces. In this form, it is easy to see 3 rows and 4 columns.
// When doing anything withchar arrays/string, always remember the null character is at the end. Therefore, I must stop when I reach it. Otherwise, weird shit will happen -- trying to access memory I "don't have". If I forget about the null character, the compiler will continue unitl it reaches one.
// When using scanf() for strings, whitespaces are ignored.
// fgets(dest, num_to_read, stdin (FILE* fp))
// if less than num_to_read, new line will be copied to dest, then null character will be appended. If larger, num_to_read - 1 will be stored and null character will be appended. This functions still takes into account that null character must exist in dest to be proper. In general, fgets() will read the new line character so long as I do not have a string >= num_to_read. Commonly, I will iterate through the string until I find '\n', then replace it with '\0'.
// here is something really exciting. Since I know about 2D arrays and C Strings, I can do something very clever. That is, create an array of strings using theses two concepts together. Here is an example: char myStrings[50][75];. This is hold 50 strings that can be 75 cahacters long (including the null character). To access a string, do: myString[i], where i is the i'th string.
//assert is a greate testbench/ test harness for unit testing. I must first #include <assert.h> to use asser(). To use this functions, do this: assert(MyFunction == expression);. Basically, I am checking for the success or failure of that function. I know what it should return, so I am checking. If it succeeded, i.e. returns an expected value, the expression will evaulate to true/1, and the program will continue. If the test fails/returns an unexpected value, the expression will evaluaute to false, causing assert() to stop the program and print the entire line, the function it was in, and the line number of the assert. The entire expression will be shown too.
// Remember this! Since parameters are local variables to a function, we can technically assign values to them during function calls. However, this is considered bad practice and lazy. Why? because it is confusing to read. We may use the value of the parameters later in the code, but not it has been changed! Everything will go to shit. I don't want that. Instead, create a local variable within the function and assign the value of the parameters to that instead. This will increase program readability and reduce the probability of error.
// When passing an array to a function, doing int mayArr[] implies an array pointer will be passed. When passing an array, prepending & is not neccesary as arrays are passed by reference automatically. Further, if in the parameters of a functions we include 'const', e.g MyFunct(const int myArr[]) {...}, we are telling the compiler and others that we are not modifying the array, but looking at it's value or whatever.
// When dealing with ordinary arrays, it is a common error to not pass a variable to reference the size of the array. This contrasts with Strings because I have the strlen() function included in <string.h>. Make sure to pass a value to reference how big a non-string array is.
// Good practice is to reduce the amount of non-const global variables. If the name of a local variable is defined within a function, the global variable is now inaccesible.
// In regards to pointers, NULL is a macro that typically evaluates to zero, on most systems. By setting a pointer to NULL, e.g. int* ptr = NULL;, I am saying this pointer does not currently point to anything -- remmeber that pointer variables store a memory location. This is valid because 0 is an invalid memory location.
// when using malloc() to allocate memory for a pointer, the process can be generally thought of //as the following: I define a pointer variable int* ptr = NULL;. Then I say ptr = (int*) //malloc(sizeof(int)); - don't forget #include <stdlib.h> because this is where malloc() lives. //When I initially create the variable 'ptr', the variable is stored in memory, say at location //100. When I call malloc(), it returns, if succesful, a pointer to some memory location it found in the heap.
// This means the void* pointer/address malloc() returns is somewhere off in the space that is //memory, not neccesarily near where ptr is -- say malloc() allocated memory at location 300. //This means ptr now points to (haha) memory location 300 -- originally 0 -- because pointers //are variables that store memory addresses. Further, when derefrencing ptr, I am saying: go to //memory location 300, look inside, and tell me what is stored in there -- in this case no values were assigned so an error will be thrown by the compiler.
// When manipulating a pointer within a function, first check if the pointer is not null. This will prevent accessing invalid memory -- 0 -- which will result in an error -- varies by computer.
//FILE* myFile = NULL; -----> Included with stdio.h!
//myFile = fopen("myFile.txt", "r");
//if (myFile == NULL) {exit}
//else {while(!feof(myFile))}
//fclose(myFile);
// int main(int argc, char* argv[])
// if (argc == validAmount) {...}
// else {...}
/// ALWAYS CHECK IS CORRECT AMOUNT OF ARGUMENTS!!!!!!!
// Remember, argv[] is a C string. Must use atoi(argv[i]) to get an integer value. atoi() included with stdlib.h
int my2DArray[3][4] = {
{1, 1, 1, 1},
{2, 2, 2, 2},
{3, 3, 3, 3},
};
return 0;
}
|
the_stack_data/173578673.c | /* This file was automatically generated by CasADi.
The CasADi copyright holders make no ownership claim of its contents. */
#ifdef __cplusplus
extern "C" {
#endif
/* How to prefix internal symbols */
#ifdef CASADI_CODEGEN_PREFIX
#define CASADI_NAMESPACE_CONCAT(NS, ID) _CASADI_NAMESPACE_CONCAT(NS, ID)
#define _CASADI_NAMESPACE_CONCAT(NS, ID) NS ## ID
#define CASADI_PREFIX(ID) CASADI_NAMESPACE_CONCAT(CODEGEN_PREFIX, ID)
#else
#define CASADI_PREFIX(ID) long_cost_y_e_fun_jac_ut_xt_ ## ID
#endif
#include <math.h>
#ifndef casadi_real
#define casadi_real double
#endif
#ifndef casadi_int
#define casadi_int int
#endif
/* Add prefix to internal symbols */
#define casadi_f0 CASADI_PREFIX(f0)
#define casadi_s0 CASADI_PREFIX(s0)
#define casadi_s1 CASADI_PREFIX(s1)
#define casadi_s2 CASADI_PREFIX(s2)
#define casadi_s3 CASADI_PREFIX(s3)
#define casadi_s4 CASADI_PREFIX(s4)
#define casadi_sq CASADI_PREFIX(sq)
/* Symbol visibility in DLLs */
#ifndef CASADI_SYMBOL_EXPORT
#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
#if defined(STATIC_LINKED)
#define CASADI_SYMBOL_EXPORT
#else
#define CASADI_SYMBOL_EXPORT __declspec(dllexport)
#endif
#elif defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
#define CASADI_SYMBOL_EXPORT __attribute__ ((visibility ("default")))
#else
#define CASADI_SYMBOL_EXPORT
#endif
#endif
casadi_real casadi_sq(casadi_real x) { return x*x;}
static const casadi_int casadi_s0[7] = {3, 1, 0, 3, 0, 1, 2};
static const casadi_int casadi_s1[3] = {0, 0, 0};
static const casadi_int casadi_s2[8] = {4, 1, 0, 4, 0, 1, 2, 3};
static const casadi_int casadi_s3[9] = {5, 1, 0, 5, 0, 1, 2, 3, 4};
static const casadi_int casadi_s4[14] = {3, 5, 0, 2, 3, 4, 5, 6, 0, 1, 0, 1, 2, 2};
/* long_cost_y_e_fun_jac_ut_xt:(i0[3],i1[],i2[4])->(o0[5],o1[3x5,6nz]) */
static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) {
casadi_real a0, a1, a2, a3, a4, a5;
a0=arg[2]? arg[2][2] : 0;
a1=arg[0]? arg[0][0] : 0;
a0=(a0-a1);
a2=arg[0]? arg[0][1] : 0;
a3=casadi_sq(a2);
a4=5.;
a3=(a3/a4);
a4=1.4500000000000000e+00;
a5=(a4*a2);
a3=(a3+a5);
a5=6.;
a3=(a3+a5);
a0=(a0-a3);
a3=10.;
a3=(a2+a3);
a0=(a0/a3);
if (res[0]!=0) res[0][0]=a0;
if (res[0]!=0) res[0][1]=a1;
if (res[0]!=0) res[0][2]=a2;
a1=arg[0]? arg[0][2] : 0;
if (res[0]!=0) res[0][3]=a1;
a5=arg[2]? arg[2][3] : 0;
a1=(a1-a5);
if (res[0]!=0) res[0][4]=a1;
a1=(1./a3);
a1=(-a1);
if (res[1]!=0) res[1][0]=a1;
a1=2.0000000000000001e-01;
a2=(a2+a2);
a1=(a1*a2);
a1=(a1+a4);
a1=(a1/a3);
a0=(a0/a3);
a1=(a1+a0);
a1=(-a1);
if (res[1]!=0) res[1][1]=a1;
a1=1.;
if (res[1]!=0) res[1][2]=a1;
if (res[1]!=0) res[1][3]=a1;
if (res[1]!=0) res[1][4]=a1;
if (res[1]!=0) res[1][5]=a1;
return 0;
}
CASADI_SYMBOL_EXPORT int long_cost_y_e_fun_jac_ut_xt(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem){
return casadi_f0(arg, res, iw, w, mem);
}
CASADI_SYMBOL_EXPORT int long_cost_y_e_fun_jac_ut_xt_alloc_mem(void) {
return 0;
}
CASADI_SYMBOL_EXPORT int long_cost_y_e_fun_jac_ut_xt_init_mem(int mem) {
return 0;
}
CASADI_SYMBOL_EXPORT void long_cost_y_e_fun_jac_ut_xt_free_mem(int mem) {
}
CASADI_SYMBOL_EXPORT int long_cost_y_e_fun_jac_ut_xt_checkout(void) {
return 0;
}
CASADI_SYMBOL_EXPORT void long_cost_y_e_fun_jac_ut_xt_release(int mem) {
}
CASADI_SYMBOL_EXPORT void long_cost_y_e_fun_jac_ut_xt_incref(void) {
}
CASADI_SYMBOL_EXPORT void long_cost_y_e_fun_jac_ut_xt_decref(void) {
}
CASADI_SYMBOL_EXPORT casadi_int long_cost_y_e_fun_jac_ut_xt_n_in(void) { return 3;}
CASADI_SYMBOL_EXPORT casadi_int long_cost_y_e_fun_jac_ut_xt_n_out(void) { return 2;}
CASADI_SYMBOL_EXPORT casadi_real long_cost_y_e_fun_jac_ut_xt_default_in(casadi_int i){
switch (i) {
default: return 0;
}
}
CASADI_SYMBOL_EXPORT const char* long_cost_y_e_fun_jac_ut_xt_name_in(casadi_int i){
switch (i) {
case 0: return "i0";
case 1: return "i1";
case 2: return "i2";
default: return 0;
}
}
CASADI_SYMBOL_EXPORT const char* long_cost_y_e_fun_jac_ut_xt_name_out(casadi_int i){
switch (i) {
case 0: return "o0";
case 1: return "o1";
default: return 0;
}
}
CASADI_SYMBOL_EXPORT const casadi_int* long_cost_y_e_fun_jac_ut_xt_sparsity_in(casadi_int i) {
switch (i) {
case 0: return casadi_s0;
case 1: return casadi_s1;
case 2: return casadi_s2;
default: return 0;
}
}
CASADI_SYMBOL_EXPORT const casadi_int* long_cost_y_e_fun_jac_ut_xt_sparsity_out(casadi_int i) {
switch (i) {
case 0: return casadi_s3;
case 1: return casadi_s4;
default: return 0;
}
}
CASADI_SYMBOL_EXPORT int long_cost_y_e_fun_jac_ut_xt_work(casadi_int *sz_arg, casadi_int* sz_res, casadi_int *sz_iw, casadi_int *sz_w) {
if (sz_arg) *sz_arg = 3;
if (sz_res) *sz_res = 2;
if (sz_iw) *sz_iw = 0;
if (sz_w) *sz_w = 0;
return 0;
}
#ifdef __cplusplus
} /* extern "C" */
#endif
|
the_stack_data/120599.c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_isinstring.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mmartin <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/03/30 17:43:53 by mmartin #+# #+# */
/* Updated: 2015/03/30 18:06:41 by mmartin ### ########.fr */
/* */
/* ************************************************************************** */
int ft_isinstring(char c, char *str)
{
int i;
i = 0;
while (str[i])
{
if (str[i] == c)
return (1);
i++;
}
return (0);
}
|
the_stack_data/76699027.c | /*-
* Copyright (c) 1980 The Regents of the University of California.
* All rights reserved.
*
* %sccs.include.proprietary.c%
*/
#ifndef lint
static char sccsid[] = "@(#)derfc_.c 5.2 (Berkeley) 04/12/91";
#endif /* not lint */
double derfc_(x)
double *x;
{
double erfc();
return( erfc(*x) );
}
|
the_stack_data/95449591.c | #define _GNU_SOURCE
#include <signal.h>
#define SST_SIZE (_NSIG / 8 / sizeof(long))
int sigandset(sigset_t* dest, const sigset_t* left, const sigset_t* right) {
unsigned long i = 0, *d = (void*)dest, *l = (void*)left, *r = (void*)right;
for (; i < SST_SIZE; i++)
d[i] = l[i] & r[i];
return 0;
}
|
the_stack_data/28028.c |
/* text version of maze 'mazefiles/binary/kor891.maz'
generated by mazetool (c) Peter Harrison 2018
o---o---o---o---o---o---o---o---o---o---o---o---o---o---o---o---o
| | | | |
o o o o---o---o---o---o---o---o o---o o o---o---o---o
| | | | | | |
o---o o---o---o---o---o---o o o---o---o o---o---o---o o
| | | | | | | |
o o o o---o---o---o o---o o o---o---o o---o---o o
| | | | | | |
o o---o---o o---o---o---o---o---o---o---o o---o---o o o
| | | | |
o o---o o---o---o o---o o---o---o---o o---o---o---o o
| | | | | | |
o---o o---o o---o---o o---o o o---o---o o---o o o
| | | | | | | | |
o o o o o o o---o---o---o---o---o---o o o o---o
| | | | | | | | | | |
o o---o---o---o o o o o o---o o---o o---o o o
| | | | | | | | |
o o o---o o o o---o---o---o---o o o---o---o o o
| | | | | | | | |
o o o o o---o---o---o o---o---o---o---o o---o o o
| | | | | | | | | | |
o o---o o---o o o o o---o---o o---o---o o o o
| | | | | | | | |
o o---o o---o o o---o o o---o---o o---o---o---o o
| | | | | | | |
o---o---o o---o o---o o o o---o---o---o o---o o o
| | | | | | | |
o o---o o---o---o---o o---o---o o o---o---o---o o o
| | | | | | | |
o o o---o o---o o o o o---o---o---o o---o o o
| | | | | | |
o---o---o---o---o---o---o---o---o---o---o---o---o---o---o---o---o
*/
int kor891_maz[] ={
0x0E, 0x0A, 0x09, 0x0C, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x09, 0x0C, 0x08, 0x08, 0x0B, 0x0E, 0x0B,
0x0E, 0x0B, 0x05, 0x05, 0x0D, 0x0E, 0x08, 0x09, 0x0C, 0x02, 0x03, 0x05, 0x04, 0x0A, 0x08, 0x0B,
0x0D, 0x0C, 0x02, 0x00, 0x00, 0x0A, 0x03, 0x05, 0x06, 0x09, 0x0C, 0x03, 0x06, 0x09, 0x04, 0x09,
0x04, 0x03, 0x0D, 0x05, 0x07, 0x0C, 0x0A, 0x03, 0x0C, 0x02, 0x01, 0x0C, 0x09, 0x05, 0x05, 0x05,
0x05, 0x0D, 0x04, 0x02, 0x08, 0x03, 0x0C, 0x0A, 0x02, 0x09, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
0x06, 0x01, 0x07, 0x0C, 0x02, 0x09, 0x04, 0x0A, 0x08, 0x03, 0x06, 0x01, 0x05, 0x05, 0x07, 0x05,
0x0C, 0x02, 0x08, 0x03, 0x0E, 0x03, 0x05, 0x0E, 0x03, 0x0C, 0x09, 0x05, 0x04, 0x01, 0x0D, 0x05,
0x06, 0x09, 0x06, 0x0A, 0x0A, 0x0A, 0x03, 0x0C, 0x09, 0x07, 0x06, 0x01, 0x07, 0x06, 0x01, 0x05,
0x0C, 0x01, 0x0C, 0x0A, 0x0B, 0x0D, 0x0D, 0x04, 0x03, 0x0E, 0x09, 0x05, 0x0C, 0x0A, 0x03, 0x05,
0x05, 0x06, 0x03, 0x0D, 0x0D, 0x05, 0x07, 0x05, 0x0F, 0x0C, 0x01, 0x05, 0x04, 0x09, 0x0C, 0x01,
0x05, 0x0C, 0x09, 0x05, 0x04, 0x01, 0x0E, 0x00, 0x09, 0x05, 0x05, 0x07, 0x05, 0x07, 0x07, 0x05,
0x05, 0x05, 0x05, 0x04, 0x03, 0x05, 0x0C, 0x01, 0x07, 0x05, 0x06, 0x08, 0x03, 0x0E, 0x0A, 0x01,
0x04, 0x01, 0x04, 0x03, 0x0D, 0x06, 0x03, 0x06, 0x08, 0x02, 0x09, 0x05, 0x0E, 0x09, 0x0C, 0x03,
0x07, 0x05, 0x07, 0x0D, 0x04, 0x0B, 0x0D, 0x0D, 0x06, 0x0B, 0x05, 0x05, 0x0D, 0x05, 0x05, 0x0D,
0x0C, 0x02, 0x0A, 0x03, 0x04, 0x0A, 0x00, 0x02, 0x0A, 0x08, 0x03, 0x06, 0x03, 0x05, 0x05, 0x05,
0x06, 0x0A, 0x0A, 0x0A, 0x02, 0x0A, 0x02, 0x0A, 0x0B, 0x06, 0x0A, 0x0A, 0x0A, 0x02, 0x03, 0x07,
};
/* end of mazefile */
|
the_stack_data/111077925.c | /*
***************************************************************************
* Ralink Tech Inc.
* 4F, No. 2 Technology 5th Rd.
* Science-based Industrial Park
* Hsin-chu, Taiwan, R.O.C.
*
* (c) Copyright 2002-2006, Ralink Technology, Inc.
*
* All rights reserved. Ralink's source code is an unpublished work and the
* use of a copyright notice does not imply otherwise. This source code
* contains confidential trade secret material of Ralink Tech. Any attemp
* or participation in deciphering, decoding, reverse engineering or in any
* way altering the source code is stricitly prohibited, unless the prior
* written consent of Ralink Technology, Inc. is obtained.
***************************************************************************
Module Name:
apcli_ctrl.c
Abstract:
Revision History:
Who When What
-------- ---------- ----------------------------------------------
Fonchi 2006-06-23 modified for rt61-APClinent
*/
#ifdef APCLI_SUPPORT
#ifdef APCLI_LINK_COVER_SUPPORT
#include "rt_config.h"
extern VOID *p5G_pAd;
extern VOID *p2G_pAd;
INT ApcliLinkMonitorThread(
IN ULONG Context)
{
RTMP_ADAPTER *pAd;
RTMP_ADAPTER *pAd_other_band;
RTMP_OS_TASK *pTask;
int status = 0;
pTask = (RTMP_OS_TASK *)Context;
pAd = (PRTMP_ADAPTER)RTMP_OS_TASK_DATA_GET(pTask);
RtmpOSTaskCustomize(pTask);
if (p2G_pAd == NULL) {
MTWF_LOG(DBG_CAT_CLIENT, CATCLIENT_APCLI, DBG_LVL_TRACE,
("##### no 2G pAd!!!\n"));
/* RtmpOSTaskNotifyToExit(pTask); */
/* return 0; */
} else if (p5G_pAd == NULL) {
MTWF_LOG(DBG_CAT_CLIENT, CATCLIENT_APCLI, DBG_LVL_TRACE,
("##### no 5G pAd!!!\n"));
/* RtmpOSTaskNotifyToExit(pTask); */
/* return 0; */
}
if (p5G_pAd == pAd) {
MTWF_LOG(DBG_CAT_CLIENT, CATCLIENT_APCLI, DBG_LVL_TRACE,
("we are 5G interface, wait 2G link update\n"));
pAd_other_band = p2G_pAd;
} else {
MTWF_LOG(DBG_CAT_CLIENT, CATCLIENT_APCLI, DBG_LVL_TRACE,
("we are 2G interface, wait 5G link update\n"));
pAd_other_band = p5G_pAd;
}
while (pTask && !RTMP_OS_TASK_IS_KILLED(pTask) && (pAd_other_band != NULL)) {
if (RtmpOSTaskWait(pAd, pTask, &status) == FALSE) {
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS);
break;
}
if (status != 0)
break;
/* TODO: wait_for_completion */
}
/* notify the exit routine that we're actually exiting now
*
* complete()/wait_for_completion() is similar to up()/down(),
* except that complete() is safe in the case where the structure
* is getting deleted in a parallel mode of execution (i.e. just
* after the down() -- that's necessary for the thread-shutdown
* case.
*
* complete_and_exit() goes even further than this -- it is safe in
* the case that the thread of the caller is going away (not just
* the structure) -- this is necessary for the module-remove case.
* This is important in preemption kernels, which transfer the flow
* of execution immediately upon a complete().
*/
MTWF_LOG(DBG_CAT_CLIENT, CATCLIENT_APCLI, DBG_LVL_TRACE,
("<---ApcliLinkMonitorThread\n"));
/* if (pTask) */
/* RtmpOSTaskNotifyToExit(pTask); */
return 0;
}
NDIS_STATUS RtmpApcliLinkTaskInit(IN PRTMP_ADAPTER pAd)
{
RTMP_OS_TASK *pTask;
NDIS_STATUS status;
/* Creat ApCli Link Monitor Thread */
pTask = &pAd->apcliLinkTask;
RTMP_OS_TASK_INIT(pTask, "LinkMonitorTask", pAd);
/* status = RtmpOSTaskAttach(pTask, RTPCICmdThread, (ULONG)pTask); */
status = RtmpOSTaskAttach(pTask, ApcliLinkMonitorThread, (ULONG)pTask);
if (status == NDIS_STATUS_FAILURE) {
MTWF_LOG(DBG_CAT_CLIENT, CATCLIENT_APCLI, DBG_LVL_TRACE,
("%s: Unable to start ApcliLinkMonitorThread!\n", get_dev_name_prefix(pAd, INT_APCLI)));
return NDIS_STATUS_FAILURE;
}
return NDIS_STATUS_SUCCESS;
}
VOID RtmpApcliLinkTaskExit(
IN RTMP_ADAPTER *pAd)
{
INT ret;
/* Terminate cmdQ thread */
if (RTMP_OS_TASK_LEGALITY(&pAd->apcliLinkTask)) {
/*RTUSBCMDUp(&pAd->cmdQTask); */
ret = RtmpOSTaskKill(&pAd->apcliLinkTask);
if (ret == NDIS_STATUS_FAILURE)
MTWF_LOG(DBG_CAT_CLIENT, CATCLIENT_APCLI, DBG_LVL_ERROR, ("Kill command task fail!\n"));
}
}
#endif /* APCLI_LINK_COVER_SUPPORT */
#endif /* APCLI_SUPPORT */
|
the_stack_data/738023.c | /* Check that the rotr and rotl instructions are generated. */
/* { dg-do compile } */
/* { dg-options "-O1" } */
/* { dg-final { scan-assembler-times "rotr" 2 } } */
/* { dg-final { scan-assembler-times "rotl" 3 } } */
int
test_00 (int a)
{
return (a << 1) | ((a >> 31) & 1);
}
int
test_01 (int a)
{
return (a << 1) | ((unsigned int)a >> 31);
}
int
test_02 (int a)
{
return ((unsigned int)a >> 1) | (a << 31);
}
int
test_03 (int a)
{
return ((a >> 1) & 0x7FFFFFFF) | (a << 31);
}
int
test_04 (int a)
{
return a + a + ((a >> 31) & 1);
}
|
the_stack_data/140764366.c | #include <errno.h>
#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <syslog.h>
#include <sys/resource.h>
#include <sys/stat.h>
#include <unistd.h>
// get from the book "advance unix programming environment, you can also see the
// exmaple code from many other open source code (such as memcache)
// how to write a singleton daemon process program
#define LOCKMODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
void daemonize(const char *cmd)
{
int i, fd0, fd1, fd2;
pid_t pid;
struct rlimit rl;
struct sigaction sa;
umask(0);
if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
printf("error : can't get file limit\n");
exit(1);
}
if ((pid = fork()) < 0) {
printf("error : can't fork\n");
exit(1);
} else if (pid != 0) { // parent
exit(0);
}
setsid();
sa.sa_handler = SIG_IGN;
sigemptyset(&sa.sa_mask);
sa.sa_flags = 0;
if (sigaction(SIGHUP, &sa, NULL) < 0) {
printf("error : can't ignor SIGHUP\n");
exit(1);
}
if ((pid = fork()) < 0) {
printf("error : can't fork\n");
exit(1);
} else if (pid != 0) { // parent
exit(0);
}
/* change the current working directory to "/" */
if (chdir("/") < 0) {
printf("error : can't chdir\n");
exit(1);
}
if (rl.rlim_max == RLIM_INFINITY) {
rl.rlim_max = 1024;
}
for (i = 0; i < rl.rlim_max; i++) {
close(i);
}
fd0 = open("/dev/null", O_RDWR);
fd1 = dup(0);
fd2 = dup(0);
// initialize the log file
openlog(cmd, LOG_CONS, LOG_DAEMON);
if (fd0 != 0 || fd1 != 1 || fd2 != 2) {
syslog(LOG_ERR, "unexpected file descriptors %d %d %d", fd0, fd1, fd2);
exit(1);
}
}
int lockfile(int fd)
{
struct flock fl;
fl.l_type = F_WRLCK;
fl.l_start = 0;
fl.l_whence = SEEK_SET;
fl.l_len = 0;
return fcntl(fd, F_SETLK, &fl);
}
int already_running(const char *file)
{
int fd;
char buf[16];
fd = open(file, O_RDWR | O_CREAT, LOCKMODE);
if (fd < 0) {
syslog(LOG_ERR, "can't open %s : %s", file, strerror(errno));
exit(1);
}
if (lockfile(fd) < 0) {
if (errno == EAGAIN || errno == EACCES) {
close(fd);
return 1;
}
syslog(LOG_ERR, "can't lock %s : %s", file, strerror(errno));
exit(1);
}
ftruncate(fd, 0);
sprintf(buf, "%ld", (long)getpid());
write(fd, buf, strlen(buf));
return 0;
}
int main(int arc, char * argv[])
{
char *cmd;
char buf[1024] = "/var/run/";
if ((cmd = strrchr(argv[0], '/')) == NULL) {
cmd = argv[0];
} else {
++cmd;
}
strcat(buf, cmd);
strcat(buf, ".pid");
// daemonize function must be set before already_running
// function. because if daemonize is set after the already_running
// function. when the daemonize is run. the parent process is exit.
// and the child process will inherit the lock. but why we can't do this.
// unforunately we close the fd in the child process. so the lock is released.
daemonize(cmd);
if (already_running(buf)) {
printf("process %s is running\n", cmd);
exit(1);
}
for (;;) {
// to do work
}
return 0;
}
|
the_stack_data/598737.c | // This file is part of CPAchecker,
// a tool for configurable software verification:
// https://cpachecker.sosy-lab.org
//
// SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>
//
// SPDX-License-Identifier: Apache-2.0
int main(void) {
int k = 5;
for (k = 10; k < 100; k++) {
if (k == 0) {
break;
}
if (k == 1) {
break;
} else if (k == 2) {
break;
} else if (k == 3) {
break;
}
}
return (0);
}
|
the_stack_data/242330545.c | #include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <netdb.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
int main(int argc,char *argv[])
{
int sock, bytes_recieved;
int RelayserverPORT;
char send_data[1024],recv_data[1024],username[1024],password[1024];
char Recievername[1024],RecieverPORT[1024];
struct sockaddr_in Relayserver_addr;
//host = gethostbyname("127.0.0.1");
if(argc != 3)
{
printf("usage: RelayserverIP RelayserverPORT(5000+(4 BY 4)) \n ");
exit(1);
}
if ((sock = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
perror("Socket");
exit(1);
}
Relayserver_addr.sin_family = AF_INET;
RelayserverPORT=atoi(argv[2]);
Relayserver_addr.sin_port = htons(RelayserverPORT);
inet_addr(argv[1],&Relayserver_addr.sin_addr.s_addr);
bzero(&(Relayserver_addr.sin_zero),8);
if (connect(sock, (struct sockaddr *)&Relayserver_addr,
sizeof(struct sockaddr)) == -1)
{
perror("Connect");
exit(1);
}
printf("Welcome to Message Relay System \n");
while(1)
{
printf("\n Enter your username: \n");
gets(username);
send(sock,username,strlen(username),0);
bytes_recieved=recv(sock,recv_data,1024,0);
recv_data[bytes_recieved] = '\0';
printf("\n %s " , recv_data);
gets(password);
send(sock,password,strlen(password),0);
bytes_recieved=recv(sock,recv_data,1024,0);
recv_data[bytes_recieved] = '\0';
// printf("\n %s " , recv_data);
if(strcmp(recv_data,"valid")==0)
{
printf("congratualtions \n");
break;
}
else
{
printf("you enterd wrong username or password");
continue;
}
}
while(1)
{
printf("\n Enter Reciever name that you want to connect : \n");
gets(Recievername);
send(sock,Recievername,strlen(Recievername),0);
bytes_recieved=recv(sock,recv_data,1024,0);
recv_data[bytes_recieved] = '\0';
printf("\n %s " , recv_data);
gets(RecieverPORT);
send(sock,RecieverPORT,strlen(RecieverPORT),0);
bytes_recieved=recv(sock,recv_data,1024,0);
recv_data[bytes_recieved] = '\0';
// printf("\n %s " , recv_data);
if(strcmp(recv_data,"valid")==0)
{
printf("congratualtions \n");
break;
}
else
{
printf("you enterd wrong Recievername or port");
continue;
}
}
while(1)
{
bytes_recieved=recv(sock,recv_data,1024,0);
recv_data[bytes_recieved] = '\0';
printf("\n %s \n" , recv_data);
gets(send_data);
if((strcmp(send_data , "q") == 0)|| ( strcmp(send_data , "Q") == 0))
{
send(sock,send_data,strlen(send_data), 0);
close(sock);
exit(1);
}
while(1)
{
printf("\n Enter data(press EOM or eom to indicate end of message): \n");
gets(send_data);
if(strcmp(send_data ,"eom") == 0)
{
send(sock,send_data,strlen(send_data), 0);
break;
}
else
{
send(sock,send_data,strlen(send_data), 0);
}
}
bytes_recieved=recv(sock,recv_data,1024,0);
recv_data[bytes_recieved] = '\0';
printf("\nLength of Longest common substring from Receiver = %s " , recv_data);
}
return 0;
}
|
the_stack_data/10622.c | #include <stdio.h>
int main(void)
{
int n,m,p;
long long t;
double list[21]={0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
for(int i=3;i<=21;i++)
list[i]=(i-1)*(list[i-1]+list[i-2]);
scanf("%d",&n);
while(n--)
{
t=1;
scanf("%d",&m);
p=m;
t*=m;
while(--m)
t*=m;
printf("%.2lf%%\n",(list[p]/t)*100);
}
return 0;
}
|
the_stack_data/97012229.c | /* { dg-do run } */
/* { dg-options "-O2" } */
/* Ensure that BIT_FIELD_REFs gets the appropriate VUSE.
Contributed by Paolo Bonzini <[email protected]>.
This testcase actually never triggered in the CVS repo, but it did
in my local tree and it seems worth testing. In this test, the if's
are folded to BIT_FIELD_REFs but the VUSEs were erroneously left out.
Therefore, DOM did not see that i was modified between the two ifs
and optimized away the second if. */
extern void abort (void);
extern void exit (int);
struct x
{
unsigned b:1;
unsigned c:1;
};
struct x i = { 1, 1 };
int
main ()
{
i.b = 1;
if (i.b == 1 && i.c == 0)
exit (0);
i.c = 0;
if (i.b == 1 && i.c == 0)
exit (0);
abort ();
}
|
the_stack_data/118393.c | #include <stdio.h>
#include <math.h>
int main()
{
float b = 5, h = 6;
float area;
area = 0.5 * b * h;
printf("Area: %f sq cms", area);
} |
the_stack_data/98926.c | #include <stdio.h>
#include <stdlib.h>
int main(){
int n,i,j,temp,min,loc;
printf("Enter no. of elements in array\n");
scanf("%d",&n);
int arr[n];
printf("enter %d elements\n",n);
for(i=0;i<n;i++){
scanf("%d",&arr[i]);
}
for(i=0;i<n;i++){
min=arr[i];
loc=i;
for(j=i+1;j<n;j++){
if(arr[j]<min){
min=arr[j];
loc=j;
}
}
temp=arr[i];
arr[i]=arr[loc];
arr[loc]=temp;
}
for(i=0;i<n;i++){
printf("%d ",arr[i]);
}
}
|
the_stack_data/37164.c | /* Exercise 1.2
* Generate Primes that are two numbers apart:
*
* Example 11,13 and 29,31
* The C Book Page 18
*/
#include <stdio.h>
#include <stdlib.h>
#define DIFF 2
#define MAX 500
int main(void);
int
main(void)
{
int this_number, divisor, not_prime;
int this_prime, next_prime;
this_number = this_prime = 2;
while (this_number < MAX) {
divisor = this_number / 2;
not_prime = 0;
while(divisor > 1) {
if(this_number % divisor == 0) {
not_prime = 1;
divisor = 0;
} else {
divisor = divisor - 1;
}
}
if(not_prime == 0) {
next_prime = this_number;
if(next_prime == this_prime + DIFF) {
printf("%3d & %3d are %d apart.\n",
this_prime, next_prime, DIFF);
}
/* debugging variables:
printf("%d is a prime number. %d %d\n",
this_number, this_prime, next_prime);
*/
this_prime = this_number;
}
this_number = this_number + 1;
}
exit(EXIT_SUCCESS);
}
|
the_stack_data/419846.c | // File name: ExtremeC_examples_chapter5_1.c
// Description: Nesting structure variables
#include <stdio.h>
typedef struct {
char first_name[32];
char last_name[32];
unsigned int birth_year;
} person_t;
typedef struct {
person_t person;
char student_number[16]; // Extra attribute
unsigned int passed_credits; // Extra attribute
} student_t;
int main(int argc, char** argv) {
student_t s;
student_t* s_ptr = &s;
person_t* p_ptr = (person_t*)&s;
printf("Student pointer points to %p\n", (void*)s_ptr);
printf("Person pointer points to %p\n", (void*)p_ptr);
return 0;
}
|
the_stack_data/167330827.c | #define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_8__ TYPE_4__ ;
typedef struct TYPE_7__ TYPE_2__ ;
typedef struct TYPE_6__ TYPE_1__ ;
/* Type definitions */
struct TYPE_6__ {int /*<<< orphan*/ function; } ;
struct v4l2_subdev {int flags; TYPE_1__ entity; } ;
struct i2c_device_id {scalar_t__ driver_data; } ;
struct i2c_client {scalar_t__ irq; TYPE_4__* adapter; int /*<<< orphan*/ dev; int /*<<< orphan*/ addr; } ;
struct TYPE_7__ {int /*<<< orphan*/ flags; } ;
struct adv7180_state {scalar_t__ irq; int powered; int /*<<< orphan*/ mutex; void* csi_client; void* vpp_client; TYPE_2__ pad; struct v4l2_subdev sd; scalar_t__ input; struct adv7180_chip_info* chip_info; int /*<<< orphan*/ curr_norm; void* pwdn_gpio; int /*<<< orphan*/ field; struct i2c_client* client; } ;
struct adv7180_chip_info {int flags; } ;
struct TYPE_8__ {int /*<<< orphan*/ name; } ;
/* Variables and functions */
int /*<<< orphan*/ ADV7180_DEFAULT_CSI_I2C_ADDR ;
int /*<<< orphan*/ ADV7180_DEFAULT_VPP_I2C_ADDR ;
int ADV7180_FLAG_I2P ;
int ADV7180_FLAG_MIPI_CSI2 ;
int ADV7180_FLAG_RESET_POWERED ;
int EIO ;
int ENOMEM ;
int /*<<< orphan*/ GFP_KERNEL ;
int /*<<< orphan*/ GPIOD_OUT_HIGH ;
int /*<<< orphan*/ I2C_FUNC_SMBUS_BYTE_DATA ;
int IRQF_ONESHOT ;
int IRQF_TRIGGER_FALLING ;
scalar_t__ IS_ERR (void*) ;
int /*<<< orphan*/ KBUILD_MODNAME ;
int /*<<< orphan*/ MEDIA_ENT_F_ATV_DECODER ;
int /*<<< orphan*/ MEDIA_PAD_FL_SOURCE ;
int PTR_ERR (void*) ;
int /*<<< orphan*/ V4L2_FIELD_ALTERNATE ;
int /*<<< orphan*/ V4L2_STD_NTSC ;
int V4L2_SUBDEV_FL_HAS_DEVNODE ;
int V4L2_SUBDEV_FL_HAS_EVENTS ;
int /*<<< orphan*/ adv7180_exit_controls (struct adv7180_state*) ;
int adv7180_init_controls (struct adv7180_state*) ;
int /*<<< orphan*/ adv7180_irq ;
int /*<<< orphan*/ adv7180_ops ;
void* devm_gpiod_get_optional (int /*<<< orphan*/ *,char*,int /*<<< orphan*/ ) ;
struct adv7180_state* devm_kzalloc (int /*<<< orphan*/ *,int,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ free_irq (scalar_t__,struct adv7180_state*) ;
int /*<<< orphan*/ i2c_check_functionality (TYPE_4__*,int /*<<< orphan*/ ) ;
void* i2c_new_dummy_device (TYPE_4__*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ i2c_unregister_device (void*) ;
int init_device (struct adv7180_state*) ;
int /*<<< orphan*/ media_entity_cleanup (TYPE_1__*) ;
int media_entity_pads_init (TYPE_1__*,int,TYPE_2__*) ;
int /*<<< orphan*/ mutex_destroy (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ mutex_init (int /*<<< orphan*/ *) ;
int request_threaded_irq (scalar_t__,int /*<<< orphan*/ *,int /*<<< orphan*/ ,int,int /*<<< orphan*/ ,struct adv7180_state*) ;
int v4l2_async_register_subdev (struct v4l2_subdev*) ;
int /*<<< orphan*/ v4l2_i2c_subdev_init (struct v4l2_subdev*,struct i2c_client*,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ v4l_err (struct i2c_client*,char*,int) ;
int /*<<< orphan*/ v4l_info (struct i2c_client*,char*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
__attribute__((used)) static int adv7180_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct adv7180_state *state;
struct v4l2_subdev *sd;
int ret;
/* Check if the adapter supports the needed features */
if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
return -EIO;
v4l_info(client, "chip found @ 0x%02x (%s)\n",
client->addr, client->adapter->name);
state = devm_kzalloc(&client->dev, sizeof(*state), GFP_KERNEL);
if (state == NULL)
return -ENOMEM;
state->client = client;
state->field = V4L2_FIELD_ALTERNATE;
state->chip_info = (struct adv7180_chip_info *)id->driver_data;
state->pwdn_gpio = devm_gpiod_get_optional(&client->dev, "powerdown",
GPIOD_OUT_HIGH);
if (IS_ERR(state->pwdn_gpio)) {
ret = PTR_ERR(state->pwdn_gpio);
v4l_err(client, "request for power pin failed: %d\n", ret);
return ret;
}
if (state->chip_info->flags & ADV7180_FLAG_MIPI_CSI2) {
state->csi_client = i2c_new_dummy_device(client->adapter,
ADV7180_DEFAULT_CSI_I2C_ADDR);
if (IS_ERR(state->csi_client))
return PTR_ERR(state->csi_client);
}
if (state->chip_info->flags & ADV7180_FLAG_I2P) {
state->vpp_client = i2c_new_dummy_device(client->adapter,
ADV7180_DEFAULT_VPP_I2C_ADDR);
if (IS_ERR(state->vpp_client)) {
ret = PTR_ERR(state->vpp_client);
goto err_unregister_csi_client;
}
}
state->irq = client->irq;
mutex_init(&state->mutex);
state->curr_norm = V4L2_STD_NTSC;
if (state->chip_info->flags & ADV7180_FLAG_RESET_POWERED)
state->powered = true;
else
state->powered = false;
state->input = 0;
sd = &state->sd;
v4l2_i2c_subdev_init(sd, client, &adv7180_ops);
sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS;
ret = adv7180_init_controls(state);
if (ret)
goto err_unregister_vpp_client;
state->pad.flags = MEDIA_PAD_FL_SOURCE;
sd->entity.function = MEDIA_ENT_F_ATV_DECODER;
ret = media_entity_pads_init(&sd->entity, 1, &state->pad);
if (ret)
goto err_free_ctrl;
ret = init_device(state);
if (ret)
goto err_media_entity_cleanup;
if (state->irq) {
ret = request_threaded_irq(client->irq, NULL, adv7180_irq,
IRQF_ONESHOT | IRQF_TRIGGER_FALLING,
KBUILD_MODNAME, state);
if (ret)
goto err_media_entity_cleanup;
}
ret = v4l2_async_register_subdev(sd);
if (ret)
goto err_free_irq;
return 0;
err_free_irq:
if (state->irq > 0)
free_irq(client->irq, state);
err_media_entity_cleanup:
media_entity_cleanup(&sd->entity);
err_free_ctrl:
adv7180_exit_controls(state);
err_unregister_vpp_client:
i2c_unregister_device(state->vpp_client);
err_unregister_csi_client:
i2c_unregister_device(state->csi_client);
mutex_destroy(&state->mutex);
return ret;
} |
the_stack_data/23574578.c | extern void __VERIFIER_error();
int sum(int n, int m) {
if (n <= 0) {
return m + n;
} else {
return sum(n - 1, m + 1);
}
}
int main(void) {
int a = 20;
int b = 0;
int result = sum(a, b);
if (result != a + b) {
ERROR: __VERIFIER_error();
}
}
|
the_stack_data/802359.c | /* This testcase is part of GDB, the GNU debugger.
Copyright 2009-2019 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <stdio.h>
int
shrfunc2 (int x)
{
return x * 100; /* unloadshr2 break */
}
|
the_stack_data/416850.c | #include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
void showCharacters();
void promptMode();
int isWhatever();
int selection = '0';
char *stick1[] = {
" NUL","SOH","STX","ETX","EOT","ENQ","ACK","BEL",
"BS ","TAB","LF ","VT ","FF ","CR ","SO ","SI "
};
char *stick2[] = {
" DLE","DC1","DC2","DC3","DC4","NAK","SND","ETB",
"CAN","EN ","SUB","ESC","FS ","GS ","RS ","US "
};
int main(int argc, char *argv[])
{
while(1) {
showCharacters();
promptMode();
}
return(0);
}
void showCharacters()
{
int i;
int ch;
int stick = 0;
for(i=0; i<16; i++)
printf("\n");
printf(" ");
for(i=0; i<16; i++)
printf(" %X",i);
for(ch=0; ch<128; ch++) {
if((ch % 16) == 0)
printf("\n %X",stick++);
if(isWhatever(ch)) {
if(ch < 16)
printf(" %s",stick1[ch]);
else if(ch < 32)
printf(" %s",stick2[ch - 16]);
else if(ch == 127)
printf(" DEL");
else if(isgraph(ch))
printf(" %c",ch);
else
printf(" ");
} else {
printf(" ");
}
}
printf("\n");
}
void promptMode()
{
printf(" 0 all 3 iscntrl 6 islower 9 isspace\n");
printf(" 1 isalnum 4 isdigit 7 isprint a isupper\n");
printf(" 2 isalpha 5 isgraph 8 ispunct b isxdigit\n");
printf(" (q=quit)>");
selection = getchar();
getchar();
selection = tolower(selection);
if(selection == 'q')
exit('\0');
}
int isWhatever(int ch) {
switch(selection) {
case '1':
return(isalnum(ch));
case '2':
return(isalpha(ch));
case '3':
return(iscntrl(ch));
case '4':
return(isdigit(ch));
case '5':
return(isgraph(ch));
case '6':
return(islower(ch));
case '7':
return(isprint(ch));
case '8':
return(ispunct(ch));
case '9':
return(isspace(ch));
case 'a':
return(isupper(ch));
case 'b':
return(isxdigit(ch));
}
return(1);
}
|
the_stack_data/38172.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 , ...) ;
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 ;
char copy14 ;
{
state[0UL] = (input[0UL] | 51238316UL) >> 3UL;
local1 = 0UL;
while (local1 < input[1UL]) {
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;
} else {
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;
}
if (state[0UL] > local1) {
copy13 = *((unsigned short *)(& state[local1]) + 0);
*((unsigned short *)(& state[local1]) + 0) = *((unsigned short *)(& state[local1]) + 3);
*((unsigned short *)(& state[local1]) + 3) = copy13;
} else {
copy14 = *((char *)(& state[0UL]) + 4);
*((char *)(& state[0UL]) + 4) = *((char *)(& state[0UL]) + 3);
*((char *)(& state[0UL]) + 3) = copy14;
}
local1 += 2UL;
}
output[0UL] = (state[0UL] ^ 246575798UL) >> 3UL;
}
}
|
the_stack_data/97930.c | #include<stdio.h>
int main()
{
int n,m;
double n1,m1,o1;
double fact(int n);
int ji;
scanf("%d%d",&n,&m);
if(n*m<=0||m>n)
{ ji=0;
}
else{n1=fact(n);
m1=fact(m);
o1=fact(n-m);
ji=n1/(m1*o1);
}
printf("%d\n",ji);
}
double fact(int n)
{
int i;
double sum;
sum=1;
for(i=1;i<=n;i++)
{
sum=sum*i;
}
return sum;
} |
the_stack_data/117385.c | #include <stdint.h>
#include <stdlib.h>
int func1(const uint8_t *data, size_t len) {
int cnt = 0;
if (len < 4) {
return 1;
}
if (data[0] == 'x') { cnt++; }
if (data[1] == 'y') { cnt++; }
if (data[2] == 'z') { cnt++; }
if (cnt >= 3) {
switch (data[3]) {
case '4': {
// double-free
int* p = malloc(sizeof(int)); free(p); free(p);
break;
}
case '5': {
// heap-use-after-free
int* p = malloc(sizeof(int)); free(p); *p = 123;
break;
}
case '6': {
// heap-buffer-overflow
int* p = malloc(8 * sizeof(int)); for (int i = 0; i < 32; i++) { *(p + i) = 0; }
break;
}
case '7': {
// fpe
int x = 0; int y = 123 / x;
break;
}
}
}
return 0;
}
|
the_stack_data/370691.c | #include <math.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <complex.h>
#ifdef complex
#undef complex
#endif
#ifdef I
#undef I
#endif
#if defined(_WIN64)
typedef long long BLASLONG;
typedef unsigned long long BLASULONG;
#else
typedef long BLASLONG;
typedef unsigned long BLASULONG;
#endif
#ifdef LAPACK_ILP64
typedef BLASLONG blasint;
#if defined(_WIN64)
#define blasabs(x) llabs(x)
#else
#define blasabs(x) labs(x)
#endif
#else
typedef int blasint;
#define blasabs(x) abs(x)
#endif
typedef blasint integer;
typedef unsigned int uinteger;
typedef char *address;
typedef short int shortint;
typedef float real;
typedef double doublereal;
typedef struct { real r, i; } complex;
typedef struct { doublereal r, i; } doublecomplex;
#ifdef _MSC_VER
static inline _Fcomplex Cf(complex *z) {_Fcomplex zz={z->r , z->i}; return zz;}
static inline _Dcomplex Cd(doublecomplex *z) {_Dcomplex zz={z->r , z->i};return zz;}
static inline _Fcomplex * _pCf(complex *z) {return (_Fcomplex*)z;}
static inline _Dcomplex * _pCd(doublecomplex *z) {return (_Dcomplex*)z;}
#else
static inline _Complex float Cf(complex *z) {return z->r + z->i*_Complex_I;}
static inline _Complex double Cd(doublecomplex *z) {return z->r + z->i*_Complex_I;}
static inline _Complex float * _pCf(complex *z) {return (_Complex float*)z;}
static inline _Complex double * _pCd(doublecomplex *z) {return (_Complex double*)z;}
#endif
#define pCf(z) (*_pCf(z))
#define pCd(z) (*_pCd(z))
typedef int logical;
typedef short int shortlogical;
typedef char logical1;
typedef char integer1;
#define TRUE_ (1)
#define FALSE_ (0)
/* Extern is for use with -E */
#ifndef Extern
#define Extern extern
#endif
/* I/O stuff */
typedef int flag;
typedef int ftnlen;
typedef int ftnint;
/*external read, write*/
typedef struct
{ flag cierr;
ftnint ciunit;
flag ciend;
char *cifmt;
ftnint cirec;
} cilist;
/*internal read, write*/
typedef struct
{ flag icierr;
char *iciunit;
flag iciend;
char *icifmt;
ftnint icirlen;
ftnint icirnum;
} icilist;
/*open*/
typedef struct
{ flag oerr;
ftnint ounit;
char *ofnm;
ftnlen ofnmlen;
char *osta;
char *oacc;
char *ofm;
ftnint orl;
char *oblnk;
} olist;
/*close*/
typedef struct
{ flag cerr;
ftnint cunit;
char *csta;
} cllist;
/*rewind, backspace, endfile*/
typedef struct
{ flag aerr;
ftnint aunit;
} alist;
/* inquire */
typedef struct
{ flag inerr;
ftnint inunit;
char *infile;
ftnlen infilen;
ftnint *inex; /*parameters in standard's order*/
ftnint *inopen;
ftnint *innum;
ftnint *innamed;
char *inname;
ftnlen innamlen;
char *inacc;
ftnlen inacclen;
char *inseq;
ftnlen inseqlen;
char *indir;
ftnlen indirlen;
char *infmt;
ftnlen infmtlen;
char *inform;
ftnint informlen;
char *inunf;
ftnlen inunflen;
ftnint *inrecl;
ftnint *innrec;
char *inblank;
ftnlen inblanklen;
} inlist;
#define VOID void
union Multitype { /* for multiple entry points */
integer1 g;
shortint h;
integer i;
/* longint j; */
real r;
doublereal d;
complex c;
doublecomplex z;
};
typedef union Multitype Multitype;
struct Vardesc { /* for Namelist */
char *name;
char *addr;
ftnlen *dims;
int type;
};
typedef struct Vardesc Vardesc;
struct Namelist {
char *name;
Vardesc **vars;
int nvars;
};
typedef struct Namelist Namelist;
#define abs(x) ((x) >= 0 ? (x) : -(x))
#define dabs(x) (fabs(x))
#define f2cmin(a,b) ((a) <= (b) ? (a) : (b))
#define f2cmax(a,b) ((a) >= (b) ? (a) : (b))
#define dmin(a,b) (f2cmin(a,b))
#define dmax(a,b) (f2cmax(a,b))
#define bit_test(a,b) ((a) >> (b) & 1)
#define bit_clear(a,b) ((a) & ~((uinteger)1 << (b)))
#define bit_set(a,b) ((a) | ((uinteger)1 << (b)))
#define abort_() { sig_die("Fortran abort routine called", 1); }
#define c_abs(z) (cabsf(Cf(z)))
#define c_cos(R,Z) { pCf(R)=ccos(Cf(Z)); }
#ifdef _MSC_VER
#define c_div(c, a, b) {Cf(c)._Val[0] = (Cf(a)._Val[0]/Cf(b)._Val[0]); Cf(c)._Val[1]=(Cf(a)._Val[1]/Cf(b)._Val[1]);}
#define z_div(c, a, b) {Cd(c)._Val[0] = (Cd(a)._Val[0]/Cd(b)._Val[0]); Cd(c)._Val[1]=(Cd(a)._Val[1]/df(b)._Val[1]);}
#else
#define c_div(c, a, b) {pCf(c) = Cf(a)/Cf(b);}
#define z_div(c, a, b) {pCd(c) = Cd(a)/Cd(b);}
#endif
#define c_exp(R, Z) {pCf(R) = cexpf(Cf(Z));}
#define c_log(R, Z) {pCf(R) = clogf(Cf(Z));}
#define c_sin(R, Z) {pCf(R) = csinf(Cf(Z));}
//#define c_sqrt(R, Z) {*(R) = csqrtf(Cf(Z));}
#define c_sqrt(R, Z) {pCf(R) = csqrtf(Cf(Z));}
#define d_abs(x) (fabs(*(x)))
#define d_acos(x) (acos(*(x)))
#define d_asin(x) (asin(*(x)))
#define d_atan(x) (atan(*(x)))
#define d_atn2(x, y) (atan2(*(x),*(y)))
#define d_cnjg(R, Z) { pCd(R) = conj(Cd(Z)); }
#define r_cnjg(R, Z) { pCf(R) = conjf(Cf(Z)); }
#define d_cos(x) (cos(*(x)))
#define d_cosh(x) (cosh(*(x)))
#define d_dim(__a, __b) ( *(__a) > *(__b) ? *(__a) - *(__b) : 0.0 )
#define d_exp(x) (exp(*(x)))
#define d_imag(z) (cimag(Cd(z)))
#define r_imag(z) (cimagf(Cf(z)))
#define d_int(__x) (*(__x)>0 ? floor(*(__x)) : -floor(- *(__x)))
#define r_int(__x) (*(__x)>0 ? floor(*(__x)) : -floor(- *(__x)))
#define d_lg10(x) ( 0.43429448190325182765 * log(*(x)) )
#define r_lg10(x) ( 0.43429448190325182765 * log(*(x)) )
#define d_log(x) (log(*(x)))
#define d_mod(x, y) (fmod(*(x), *(y)))
#define u_nint(__x) ((__x)>=0 ? floor((__x) + .5) : -floor(.5 - (__x)))
#define d_nint(x) u_nint(*(x))
#define u_sign(__a,__b) ((__b) >= 0 ? ((__a) >= 0 ? (__a) : -(__a)) : -((__a) >= 0 ? (__a) : -(__a)))
#define d_sign(a,b) u_sign(*(a),*(b))
#define r_sign(a,b) u_sign(*(a),*(b))
#define d_sin(x) (sin(*(x)))
#define d_sinh(x) (sinh(*(x)))
#define d_sqrt(x) (sqrt(*(x)))
#define d_tan(x) (tan(*(x)))
#define d_tanh(x) (tanh(*(x)))
#define i_abs(x) abs(*(x))
#define i_dnnt(x) ((integer)u_nint(*(x)))
#define i_len(s, n) (n)
#define i_nint(x) ((integer)u_nint(*(x)))
#define i_sign(a,b) ((integer)u_sign((integer)*(a),(integer)*(b)))
#define pow_dd(ap, bp) ( pow(*(ap), *(bp)))
#define pow_si(B,E) spow_ui(*(B),*(E))
#define pow_ri(B,E) spow_ui(*(B),*(E))
#define pow_di(B,E) dpow_ui(*(B),*(E))
#define pow_zi(p, a, b) {pCd(p) = zpow_ui(Cd(a), *(b));}
#define pow_ci(p, a, b) {pCf(p) = cpow_ui(Cf(a), *(b));}
#define pow_zz(R,A,B) {pCd(R) = cpow(Cd(A),*(B));}
#define s_cat(lpp, rpp, rnp, np, llp) { ftnlen i, nc, ll; char *f__rp, *lp; ll = (llp); lp = (lpp); for(i=0; i < (int)*(np); ++i) { nc = ll; if((rnp)[i] < nc) nc = (rnp)[i]; ll -= nc; f__rp = (rpp)[i]; while(--nc >= 0) *lp++ = *(f__rp)++; } while(--ll >= 0) *lp++ = ' '; }
#define s_cmp(a,b,c,d) ((integer)strncmp((a),(b),f2cmin((c),(d))))
#define s_copy(A,B,C,D) { int __i,__m; for (__i=0, __m=f2cmin((C),(D)); __i<__m && (B)[__i] != 0; ++__i) (A)[__i] = (B)[__i]; }
#define sig_die(s, kill) { exit(1); }
#define s_stop(s, n) {exit(0);}
static char junk[] = "\n@(#)LIBF77 VERSION 19990503\n";
#define z_abs(z) (cabs(Cd(z)))
#define z_exp(R, Z) {pCd(R) = cexp(Cd(Z));}
#define z_sqrt(R, Z) {pCd(R) = csqrt(Cd(Z));}
#define myexit_() break;
#define mycycle() continue;
#define myceiling(w) {ceil(w)}
#define myhuge(w) {HUGE_VAL}
//#define mymaxloc_(w,s,e,n) {if (sizeof(*(w)) == sizeof(double)) dmaxloc_((w),*(s),*(e),n); else dmaxloc_((w),*(s),*(e),n);}
#define mymaxloc(w,s,e,n) {dmaxloc_(w,*(s),*(e),n)}
/* procedure parameter types for -A and -C++ */
#define F2C_proc_par_types 1
#ifdef __cplusplus
typedef logical (*L_fp)(...);
#else
typedef logical (*L_fp)();
#endif
static float spow_ui(float x, integer n) {
float pow=1.0; unsigned long int u;
if(n != 0) {
if(n < 0) n = -n, x = 1/x;
for(u = n; ; ) {
if(u & 01) pow *= x;
if(u >>= 1) x *= x;
else break;
}
}
return pow;
}
static double dpow_ui(double x, integer n) {
double pow=1.0; unsigned long int u;
if(n != 0) {
if(n < 0) n = -n, x = 1/x;
for(u = n; ; ) {
if(u & 01) pow *= x;
if(u >>= 1) x *= x;
else break;
}
}
return pow;
}
#ifdef _MSC_VER
static _Fcomplex cpow_ui(complex x, integer n) {
complex pow={1.0,0.0}; unsigned long int u;
if(n != 0) {
if(n < 0) n = -n, x.r = 1/x.r, x.i=1/x.i;
for(u = n; ; ) {
if(u & 01) pow.r *= x.r, pow.i *= x.i;
if(u >>= 1) x.r *= x.r, x.i *= x.i;
else break;
}
}
_Fcomplex p={pow.r, pow.i};
return p;
}
#else
static _Complex float cpow_ui(_Complex float x, integer n) {
_Complex float pow=1.0; unsigned long int u;
if(n != 0) {
if(n < 0) n = -n, x = 1/x;
for(u = n; ; ) {
if(u & 01) pow *= x;
if(u >>= 1) x *= x;
else break;
}
}
return pow;
}
#endif
#ifdef _MSC_VER
static _Dcomplex zpow_ui(_Dcomplex x, integer n) {
_Dcomplex pow={1.0,0.0}; unsigned long int u;
if(n != 0) {
if(n < 0) n = -n, x._Val[0] = 1/x._Val[0], x._Val[1] =1/x._Val[1];
for(u = n; ; ) {
if(u & 01) pow._Val[0] *= x._Val[0], pow._Val[1] *= x._Val[1];
if(u >>= 1) x._Val[0] *= x._Val[0], x._Val[1] *= x._Val[1];
else break;
}
}
_Dcomplex p = {pow._Val[0], pow._Val[1]};
return p;
}
#else
static _Complex double zpow_ui(_Complex double x, integer n) {
_Complex double pow=1.0; unsigned long int u;
if(n != 0) {
if(n < 0) n = -n, x = 1/x;
for(u = n; ; ) {
if(u & 01) pow *= x;
if(u >>= 1) x *= x;
else break;
}
}
return pow;
}
#endif
static integer pow_ii(integer x, integer n) {
integer pow; unsigned long int u;
if (n <= 0) {
if (n == 0 || x == 1) pow = 1;
else if (x != -1) pow = x == 0 ? 1/x : 0;
else n = -n;
}
if ((n > 0) || !(n == 0 || x == 1 || x != -1)) {
u = n;
for(pow = 1; ; ) {
if(u & 01) pow *= x;
if(u >>= 1) x *= x;
else break;
}
}
return pow;
}
static integer dmaxloc_(double *w, integer s, integer e, integer *n)
{
double m; integer i, mi;
for(m=w[s-1], mi=s, i=s+1; i<=e; i++)
if (w[i-1]>m) mi=i ,m=w[i-1];
return mi-s+1;
}
static integer smaxloc_(float *w, integer s, integer e, integer *n)
{
float m; integer i, mi;
for(m=w[s-1], mi=s, i=s+1; i<=e; i++)
if (w[i-1]>m) mi=i ,m=w[i-1];
return mi-s+1;
}
static inline void cdotc_(complex *z, integer *n_, complex *x, integer *incx_, complex *y, integer *incy_) {
integer n = *n_, incx = *incx_, incy = *incy_, i;
#ifdef _MSC_VER
_Fcomplex zdotc = {0.0, 0.0};
if (incx == 1 && incy == 1) {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc._Val[0] += conjf(Cf(&x[i]))._Val[0] * Cf(&y[i])._Val[0];
zdotc._Val[1] += conjf(Cf(&x[i]))._Val[1] * Cf(&y[i])._Val[1];
}
} else {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc._Val[0] += conjf(Cf(&x[i*incx]))._Val[0] * Cf(&y[i*incy])._Val[0];
zdotc._Val[1] += conjf(Cf(&x[i*incx]))._Val[1] * Cf(&y[i*incy])._Val[1];
}
}
pCf(z) = zdotc;
}
#else
_Complex float zdotc = 0.0;
if (incx == 1 && incy == 1) {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc += conjf(Cf(&x[i])) * Cf(&y[i]);
}
} else {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc += conjf(Cf(&x[i*incx])) * Cf(&y[i*incy]);
}
}
pCf(z) = zdotc;
}
#endif
static inline void zdotc_(doublecomplex *z, integer *n_, doublecomplex *x, integer *incx_, doublecomplex *y, integer *incy_) {
integer n = *n_, incx = *incx_, incy = *incy_, i;
#ifdef _MSC_VER
_Dcomplex zdotc = {0.0, 0.0};
if (incx == 1 && incy == 1) {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc._Val[0] += conj(Cd(&x[i]))._Val[0] * Cd(&y[i])._Val[0];
zdotc._Val[1] += conj(Cd(&x[i]))._Val[1] * Cd(&y[i])._Val[1];
}
} else {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc._Val[0] += conj(Cd(&x[i*incx]))._Val[0] * Cd(&y[i*incy])._Val[0];
zdotc._Val[1] += conj(Cd(&x[i*incx]))._Val[1] * Cd(&y[i*incy])._Val[1];
}
}
pCd(z) = zdotc;
}
#else
_Complex double zdotc = 0.0;
if (incx == 1 && incy == 1) {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc += conj(Cd(&x[i])) * Cd(&y[i]);
}
} else {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc += conj(Cd(&x[i*incx])) * Cd(&y[i*incy]);
}
}
pCd(z) = zdotc;
}
#endif
static inline void cdotu_(complex *z, integer *n_, complex *x, integer *incx_, complex *y, integer *incy_) {
integer n = *n_, incx = *incx_, incy = *incy_, i;
#ifdef _MSC_VER
_Fcomplex zdotc = {0.0, 0.0};
if (incx == 1 && incy == 1) {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc._Val[0] += Cf(&x[i])._Val[0] * Cf(&y[i])._Val[0];
zdotc._Val[1] += Cf(&x[i])._Val[1] * Cf(&y[i])._Val[1];
}
} else {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc._Val[0] += Cf(&x[i*incx])._Val[0] * Cf(&y[i*incy])._Val[0];
zdotc._Val[1] += Cf(&x[i*incx])._Val[1] * Cf(&y[i*incy])._Val[1];
}
}
pCf(z) = zdotc;
}
#else
_Complex float zdotc = 0.0;
if (incx == 1 && incy == 1) {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc += Cf(&x[i]) * Cf(&y[i]);
}
} else {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc += Cf(&x[i*incx]) * Cf(&y[i*incy]);
}
}
pCf(z) = zdotc;
}
#endif
static inline void zdotu_(doublecomplex *z, integer *n_, doublecomplex *x, integer *incx_, doublecomplex *y, integer *incy_) {
integer n = *n_, incx = *incx_, incy = *incy_, i;
#ifdef _MSC_VER
_Dcomplex zdotc = {0.0, 0.0};
if (incx == 1 && incy == 1) {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc._Val[0] += Cd(&x[i])._Val[0] * Cd(&y[i])._Val[0];
zdotc._Val[1] += Cd(&x[i])._Val[1] * Cd(&y[i])._Val[1];
}
} else {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc._Val[0] += Cd(&x[i*incx])._Val[0] * Cd(&y[i*incy])._Val[0];
zdotc._Val[1] += Cd(&x[i*incx])._Val[1] * Cd(&y[i*incy])._Val[1];
}
}
pCd(z) = zdotc;
}
#else
_Complex double zdotc = 0.0;
if (incx == 1 && incy == 1) {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc += Cd(&x[i]) * Cd(&y[i]);
}
} else {
for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
zdotc += Cd(&x[i*incx]) * Cd(&y[i*incy]);
}
}
pCd(z) = zdotc;
}
#endif
/* -- translated by f2c (version 20000121).
You must link the resulting object file with the libraries:
-lf2c -lm (in that order)
*/
/* Table of constant values */
static complex c_b1 = {1.f,0.f};
static integer c__1 = 1;
/* > \brief \b CLASYF_RK computes a partial factorization of a complex symmetric indefinite matrix using bound
ed Bunch-Kaufman (rook) diagonal pivoting method. */
/* =========== DOCUMENTATION =========== */
/* Online html documentation available at */
/* http://www.netlib.org/lapack/explore-html/ */
/* > \htmlonly */
/* > Download CLASYF_RK + dependencies */
/* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/clasyf_
rk.f"> */
/* > [TGZ]</a> */
/* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/clasyf_
rk.f"> */
/* > [ZIP]</a> */
/* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/clasyf_
rk.f"> */
/* > [TXT]</a> */
/* > \endhtmlonly */
/* Definition: */
/* =========== */
/* SUBROUTINE CLASYF_RK( UPLO, N, NB, KB, A, LDA, E, IPIV, W, LDW, */
/* INFO ) */
/* CHARACTER UPLO */
/* INTEGER INFO, KB, LDA, LDW, N, NB */
/* INTEGER IPIV( * ) */
/* COMPLEX A( LDA, * ), E( * ), W( LDW, * ) */
/* > \par Purpose: */
/* ============= */
/* > */
/* > \verbatim */
/* > CLASYF_RK computes a partial factorization of a complex symmetric */
/* > matrix A using the bounded Bunch-Kaufman (rook) diagonal */
/* > pivoting method. The partial factorization has the form: */
/* > */
/* > A = ( I U12 ) ( A11 0 ) ( I 0 ) if UPLO = 'U', or: */
/* > ( 0 U22 ) ( 0 D ) ( U12**T U22**T ) */
/* > */
/* > A = ( L11 0 ) ( D 0 ) ( L11**T L21**T ) if UPLO = 'L', */
/* > ( L21 I ) ( 0 A22 ) ( 0 I ) */
/* > */
/* > where the order of D is at most NB. The actual order is returned in */
/* > the argument KB, and is either NB or NB-1, or N if N <= NB. */
/* > */
/* > CLASYF_RK is an auxiliary routine called by CSYTRF_RK. It uses */
/* > blocked code (calling Level 3 BLAS) to update the submatrix */
/* > A11 (if UPLO = 'U') or A22 (if UPLO = 'L'). */
/* > \endverbatim */
/* Arguments: */
/* ========== */
/* > \param[in] UPLO */
/* > \verbatim */
/* > UPLO is CHARACTER*1 */
/* > Specifies whether the upper or lower triangular part of the */
/* > symmetric matrix A is stored: */
/* > = 'U': Upper triangular */
/* > = 'L': Lower triangular */
/* > \endverbatim */
/* > */
/* > \param[in] N */
/* > \verbatim */
/* > N is INTEGER */
/* > The order of the matrix A. N >= 0. */
/* > \endverbatim */
/* > */
/* > \param[in] NB */
/* > \verbatim */
/* > NB is INTEGER */
/* > The maximum number of columns of the matrix A that should be */
/* > factored. NB should be at least 2 to allow for 2-by-2 pivot */
/* > blocks. */
/* > \endverbatim */
/* > */
/* > \param[out] KB */
/* > \verbatim */
/* > KB is INTEGER */
/* > The number of columns of A that were actually factored. */
/* > KB is either NB-1 or NB, or N if N <= NB. */
/* > \endverbatim */
/* > */
/* > \param[in,out] A */
/* > \verbatim */
/* > A is COMPLEX array, dimension (LDA,N) */
/* > On entry, the symmetric matrix A. */
/* > If UPLO = 'U': the leading N-by-N upper triangular part */
/* > of A contains the upper triangular part of the matrix A, */
/* > and the strictly lower triangular part of A is not */
/* > referenced. */
/* > */
/* > If UPLO = 'L': the leading N-by-N lower triangular part */
/* > of A contains the lower triangular part of the matrix A, */
/* > and the strictly upper triangular part of A is not */
/* > referenced. */
/* > */
/* > On exit, contains: */
/* > a) ONLY diagonal elements of the symmetric block diagonal */
/* > matrix D on the diagonal of A, i.e. D(k,k) = A(k,k); */
/* > (superdiagonal (or subdiagonal) elements of D */
/* > are stored on exit in array E), and */
/* > b) If UPLO = 'U': factor U in the superdiagonal part of A. */
/* > If UPLO = 'L': factor L in the subdiagonal part of A. */
/* > \endverbatim */
/* > */
/* > \param[in] LDA */
/* > \verbatim */
/* > LDA is INTEGER */
/* > The leading dimension of the array A. LDA >= f2cmax(1,N). */
/* > \endverbatim */
/* > */
/* > \param[out] E */
/* > \verbatim */
/* > E is COMPLEX array, dimension (N) */
/* > On exit, contains the superdiagonal (or subdiagonal) */
/* > elements of the symmetric block diagonal matrix D */
/* > with 1-by-1 or 2-by-2 diagonal blocks, where */
/* > If UPLO = 'U': E(i) = D(i-1,i), i=2:N, E(1) is set to 0; */
/* > If UPLO = 'L': E(i) = D(i+1,i), i=1:N-1, E(N) is set to 0. */
/* > */
/* > NOTE: For 1-by-1 diagonal block D(k), where */
/* > 1 <= k <= N, the element E(k) is set to 0 in both */
/* > UPLO = 'U' or UPLO = 'L' cases. */
/* > \endverbatim */
/* > */
/* > \param[out] IPIV */
/* > \verbatim */
/* > IPIV is INTEGER array, dimension (N) */
/* > IPIV describes the permutation matrix P in the factorization */
/* > of matrix A as follows. The absolute value of IPIV(k) */
/* > represents the index of row and column that were */
/* > interchanged with the k-th row and column. The value of UPLO */
/* > describes the order in which the interchanges were applied. */
/* > Also, the sign of IPIV represents the block structure of */
/* > the symmetric block diagonal matrix D with 1-by-1 or 2-by-2 */
/* > diagonal blocks which correspond to 1 or 2 interchanges */
/* > at each factorization step. */
/* > */
/* > If UPLO = 'U', */
/* > ( in factorization order, k decreases from N to 1 ): */
/* > a) A single positive entry IPIV(k) > 0 means: */
/* > D(k,k) is a 1-by-1 diagonal block. */
/* > If IPIV(k) != k, rows and columns k and IPIV(k) were */
/* > interchanged in the submatrix A(1:N,N-KB+1:N); */
/* > If IPIV(k) = k, no interchange occurred. */
/* > */
/* > */
/* > b) A pair of consecutive negative entries */
/* > IPIV(k) < 0 and IPIV(k-1) < 0 means: */
/* > D(k-1:k,k-1:k) is a 2-by-2 diagonal block. */
/* > (NOTE: negative entries in IPIV appear ONLY in pairs). */
/* > 1) If -IPIV(k) != k, rows and columns */
/* > k and -IPIV(k) were interchanged */
/* > in the matrix A(1:N,N-KB+1:N). */
/* > If -IPIV(k) = k, no interchange occurred. */
/* > 2) If -IPIV(k-1) != k-1, rows and columns */
/* > k-1 and -IPIV(k-1) were interchanged */
/* > in the submatrix A(1:N,N-KB+1:N). */
/* > If -IPIV(k-1) = k-1, no interchange occurred. */
/* > */
/* > c) In both cases a) and b) is always ABS( IPIV(k) ) <= k. */
/* > */
/* > d) NOTE: Any entry IPIV(k) is always NONZERO on output. */
/* > */
/* > If UPLO = 'L', */
/* > ( in factorization order, k increases from 1 to N ): */
/* > a) A single positive entry IPIV(k) > 0 means: */
/* > D(k,k) is a 1-by-1 diagonal block. */
/* > If IPIV(k) != k, rows and columns k and IPIV(k) were */
/* > interchanged in the submatrix A(1:N,1:KB). */
/* > If IPIV(k) = k, no interchange occurred. */
/* > */
/* > b) A pair of consecutive negative entries */
/* > IPIV(k) < 0 and IPIV(k+1) < 0 means: */
/* > D(k:k+1,k:k+1) is a 2-by-2 diagonal block. */
/* > (NOTE: negative entries in IPIV appear ONLY in pairs). */
/* > 1) If -IPIV(k) != k, rows and columns */
/* > k and -IPIV(k) were interchanged */
/* > in the submatrix A(1:N,1:KB). */
/* > If -IPIV(k) = k, no interchange occurred. */
/* > 2) If -IPIV(k+1) != k+1, rows and columns */
/* > k-1 and -IPIV(k-1) were interchanged */
/* > in the submatrix A(1:N,1:KB). */
/* > If -IPIV(k+1) = k+1, no interchange occurred. */
/* > */
/* > c) In both cases a) and b) is always ABS( IPIV(k) ) >= k. */
/* > */
/* > d) NOTE: Any entry IPIV(k) is always NONZERO on output. */
/* > \endverbatim */
/* > */
/* > \param[out] W */
/* > \verbatim */
/* > W is COMPLEX array, dimension (LDW,NB) */
/* > \endverbatim */
/* > */
/* > \param[in] LDW */
/* > \verbatim */
/* > LDW is INTEGER */
/* > The leading dimension of the array W. LDW >= f2cmax(1,N). */
/* > \endverbatim */
/* > */
/* > \param[out] INFO */
/* > \verbatim */
/* > INFO is INTEGER */
/* > = 0: successful exit */
/* > */
/* > < 0: If INFO = -k, the k-th argument had an illegal value */
/* > */
/* > > 0: If INFO = k, the matrix A is singular, because: */
/* > If UPLO = 'U': column k in the upper */
/* > triangular part of A contains all zeros. */
/* > If UPLO = 'L': column k in the lower */
/* > triangular part of A contains all zeros. */
/* > */
/* > Therefore D(k,k) is exactly zero, and superdiagonal */
/* > elements of column k of U (or subdiagonal elements of */
/* > column k of L ) are all zeros. The factorization has */
/* > been completed, but the block diagonal matrix D is */
/* > exactly singular, and division by zero will occur if */
/* > it is used to solve a system of equations. */
/* > */
/* > NOTE: INFO only stores the first occurrence of */
/* > a singularity, any subsequent occurrence of singularity */
/* > is not stored in INFO even though the factorization */
/* > always completes. */
/* > \endverbatim */
/* Authors: */
/* ======== */
/* > \author Univ. of Tennessee */
/* > \author Univ. of California Berkeley */
/* > \author Univ. of Colorado Denver */
/* > \author NAG Ltd. */
/* > \date December 2016 */
/* > \ingroup complexSYcomputational */
/* > \par Contributors: */
/* ================== */
/* > */
/* > \verbatim */
/* > */
/* > December 2016, Igor Kozachenko, */
/* > Computer Science Division, */
/* > University of California, Berkeley */
/* > */
/* > September 2007, Sven Hammarling, Nicholas J. Higham, Craig Lucas, */
/* > School of Mathematics, */
/* > University of Manchester */
/* > */
/* > \endverbatim */
/* ===================================================================== */
/* Subroutine */ int clasyf_rk_(char *uplo, integer *n, integer *nb, integer
*kb, complex *a, integer *lda, complex *e, integer *ipiv, complex *w,
integer *ldw, integer *info)
{
/* System generated locals */
integer a_dim1, a_offset, w_dim1, w_offset, i__1, i__2, i__3, i__4, i__5;
real r__1, r__2;
complex q__1, q__2, q__3, q__4;
/* Local variables */
logical done;
integer imax, jmax, j, k, p;
complex t;
real alpha;
extern /* Subroutine */ int cscal_(integer *, complex *, complex *,
integer *), cgemm_(char *, char *, integer *, integer *, integer *
, complex *, complex *, integer *, complex *, integer *, complex *
, complex *, integer *);
extern logical lsame_(char *, char *);
extern /* Subroutine */ int cgemv_(char *, integer *, integer *, complex *
, complex *, integer *, complex *, integer *, complex *, complex *
, integer *);
real sfmin;
extern /* Subroutine */ int ccopy_(integer *, complex *, integer *,
complex *, integer *);
integer itemp;
extern /* Subroutine */ int cswap_(integer *, complex *, integer *,
complex *, integer *);
integer kstep;
real stemp;
complex r1, d11, d12, d21, d22;
integer jb, ii, jj, kk, kp;
real absakk;
integer kw;
extern integer icamax_(integer *, complex *, integer *);
extern real slamch_(char *);
real colmax, rowmax;
integer kkw;
/* -- LAPACK computational routine (version 3.7.0) -- */
/* -- LAPACK is a software package provided by Univ. of Tennessee, -- */
/* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */
/* December 2016 */
/* ===================================================================== */
/* Parameter adjustments */
a_dim1 = *lda;
a_offset = 1 + a_dim1 * 1;
a -= a_offset;
--e;
--ipiv;
w_dim1 = *ldw;
w_offset = 1 + w_dim1 * 1;
w -= w_offset;
/* Function Body */
*info = 0;
/* Initialize ALPHA for use in choosing pivot block size. */
alpha = (sqrt(17.f) + 1.f) / 8.f;
/* Compute machine safe minimum */
sfmin = slamch_("S");
if (lsame_(uplo, "U")) {
/* Factorize the trailing columns of A using the upper triangle */
/* of A and working backwards, and compute the matrix W = U12*D */
/* for use in updating A11 */
/* Initialize the first entry of array E, where superdiagonal */
/* elements of D are stored */
e[1].r = 0.f, e[1].i = 0.f;
/* K is the main loop index, decreasing from N in steps of 1 or 2 */
k = *n;
L10:
/* KW is the column of W which corresponds to column K of A */
kw = *nb + k - *n;
/* Exit from loop */
if (k <= *n - *nb + 1 && *nb < *n || k < 1) {
goto L30;
}
kstep = 1;
p = k;
/* Copy column K of A to column KW of W and update it */
ccopy_(&k, &a[k * a_dim1 + 1], &c__1, &w[kw * w_dim1 + 1], &c__1);
if (k < *n) {
i__1 = *n - k;
q__1.r = -1.f, q__1.i = 0.f;
cgemv_("No transpose", &k, &i__1, &q__1, &a[(k + 1) * a_dim1 + 1],
lda, &w[k + (kw + 1) * w_dim1], ldw, &c_b1, &w[kw *
w_dim1 + 1], &c__1);
}
/* Determine rows and columns to be interchanged and whether */
/* a 1-by-1 or 2-by-2 pivot block will be used */
i__1 = k + kw * w_dim1;
absakk = (r__1 = w[i__1].r, abs(r__1)) + (r__2 = r_imag(&w[k + kw *
w_dim1]), abs(r__2));
/* IMAX is the row-index of the largest off-diagonal element in */
/* column K, and COLMAX is its absolute value. */
/* Determine both COLMAX and IMAX. */
if (k > 1) {
i__1 = k - 1;
imax = icamax_(&i__1, &w[kw * w_dim1 + 1], &c__1);
i__1 = imax + kw * w_dim1;
colmax = (r__1 = w[i__1].r, abs(r__1)) + (r__2 = r_imag(&w[imax +
kw * w_dim1]), abs(r__2));
} else {
colmax = 0.f;
}
if (f2cmax(absakk,colmax) == 0.f) {
/* Column K is zero or underflow: set INFO and continue */
if (*info == 0) {
*info = k;
}
kp = k;
ccopy_(&k, &w[kw * w_dim1 + 1], &c__1, &a[k * a_dim1 + 1], &c__1);
/* Set E( K ) to zero */
if (k > 1) {
i__1 = k;
e[i__1].r = 0.f, e[i__1].i = 0.f;
}
} else {
/* ============================================================ */
/* Test for interchange */
/* Equivalent to testing for ABSAKK.GE.ALPHA*COLMAX */
/* (used to handle NaN and Inf) */
if (! (absakk < alpha * colmax)) {
/* no interchange, use 1-by-1 pivot block */
kp = k;
} else {
done = FALSE_;
/* Loop until pivot found */
L12:
/* Begin pivot search loop body */
/* Copy column IMAX to column KW-1 of W and update it */
ccopy_(&imax, &a[imax * a_dim1 + 1], &c__1, &w[(kw - 1) *
w_dim1 + 1], &c__1);
i__1 = k - imax;
ccopy_(&i__1, &a[imax + (imax + 1) * a_dim1], lda, &w[imax +
1 + (kw - 1) * w_dim1], &c__1);
if (k < *n) {
i__1 = *n - k;
q__1.r = -1.f, q__1.i = 0.f;
cgemv_("No transpose", &k, &i__1, &q__1, &a[(k + 1) *
a_dim1 + 1], lda, &w[imax + (kw + 1) * w_dim1],
ldw, &c_b1, &w[(kw - 1) * w_dim1 + 1], &c__1);
}
/* JMAX is the column-index of the largest off-diagonal */
/* element in row IMAX, and ROWMAX is its absolute value. */
/* Determine both ROWMAX and JMAX. */
if (imax != k) {
i__1 = k - imax;
jmax = imax + icamax_(&i__1, &w[imax + 1 + (kw - 1) *
w_dim1], &c__1);
i__1 = jmax + (kw - 1) * w_dim1;
rowmax = (r__1 = w[i__1].r, abs(r__1)) + (r__2 = r_imag(&
w[jmax + (kw - 1) * w_dim1]), abs(r__2));
} else {
rowmax = 0.f;
}
if (imax > 1) {
i__1 = imax - 1;
itemp = icamax_(&i__1, &w[(kw - 1) * w_dim1 + 1], &c__1);
i__1 = itemp + (kw - 1) * w_dim1;
stemp = (r__1 = w[i__1].r, abs(r__1)) + (r__2 = r_imag(&w[
itemp + (kw - 1) * w_dim1]), abs(r__2));
if (stemp > rowmax) {
rowmax = stemp;
jmax = itemp;
}
}
/* Equivalent to testing for */
/* CABS1( W( IMAX, KW-1 ) ).GE.ALPHA*ROWMAX */
/* (used to handle NaN and Inf) */
i__1 = imax + (kw - 1) * w_dim1;
if (! ((r__1 = w[i__1].r, abs(r__1)) + (r__2 = r_imag(&w[imax
+ (kw - 1) * w_dim1]), abs(r__2)) < alpha * rowmax)) {
/* interchange rows and columns K and IMAX, */
/* use 1-by-1 pivot block */
kp = imax;
/* copy column KW-1 of W to column KW of W */
ccopy_(&k, &w[(kw - 1) * w_dim1 + 1], &c__1, &w[kw *
w_dim1 + 1], &c__1);
done = TRUE_;
/* Equivalent to testing for ROWMAX.EQ.COLMAX, */
/* (used to handle NaN and Inf) */
} else if (p == jmax || rowmax <= colmax) {
/* interchange rows and columns K-1 and IMAX, */
/* use 2-by-2 pivot block */
kp = imax;
kstep = 2;
done = TRUE_;
} else {
/* Pivot not found: set params and repeat */
p = imax;
colmax = rowmax;
imax = jmax;
/* Copy updated JMAXth (next IMAXth) column to Kth of W */
ccopy_(&k, &w[(kw - 1) * w_dim1 + 1], &c__1, &w[kw *
w_dim1 + 1], &c__1);
}
/* End pivot search loop body */
if (! done) {
goto L12;
}
}
/* ============================================================ */
kk = k - kstep + 1;
/* KKW is the column of W which corresponds to column KK of A */
kkw = *nb + kk - *n;
if (kstep == 2 && p != k) {
/* Copy non-updated column K to column P */
i__1 = k - p;
ccopy_(&i__1, &a[p + 1 + k * a_dim1], &c__1, &a[p + (p + 1) *
a_dim1], lda);
ccopy_(&p, &a[k * a_dim1 + 1], &c__1, &a[p * a_dim1 + 1], &
c__1);
/* Interchange rows K and P in last N-K+1 columns of A */
/* and last N-K+2 columns of W */
i__1 = *n - k + 1;
cswap_(&i__1, &a[k + k * a_dim1], lda, &a[p + k * a_dim1],
lda);
i__1 = *n - kk + 1;
cswap_(&i__1, &w[k + kkw * w_dim1], ldw, &w[p + kkw * w_dim1],
ldw);
}
/* Updated column KP is already stored in column KKW of W */
if (kp != kk) {
/* Copy non-updated column KK to column KP */
i__1 = kp + k * a_dim1;
i__2 = kk + k * a_dim1;
a[i__1].r = a[i__2].r, a[i__1].i = a[i__2].i;
i__1 = k - 1 - kp;
ccopy_(&i__1, &a[kp + 1 + kk * a_dim1], &c__1, &a[kp + (kp +
1) * a_dim1], lda);
ccopy_(&kp, &a[kk * a_dim1 + 1], &c__1, &a[kp * a_dim1 + 1], &
c__1);
/* Interchange rows KK and KP in last N-KK+1 columns */
/* of A and W */
i__1 = *n - kk + 1;
cswap_(&i__1, &a[kk + kk * a_dim1], lda, &a[kp + kk * a_dim1],
lda);
i__1 = *n - kk + 1;
cswap_(&i__1, &w[kk + kkw * w_dim1], ldw, &w[kp + kkw *
w_dim1], ldw);
}
if (kstep == 1) {
/* 1-by-1 pivot block D(k): column KW of W now holds */
/* W(k) = U(k)*D(k) */
/* where U(k) is the k-th column of U */
/* Store U(k) in column k of A */
ccopy_(&k, &w[kw * w_dim1 + 1], &c__1, &a[k * a_dim1 + 1], &
c__1);
if (k > 1) {
i__1 = k + k * a_dim1;
if ((r__1 = a[i__1].r, abs(r__1)) + (r__2 = r_imag(&a[k +
k * a_dim1]), abs(r__2)) >= sfmin) {
c_div(&q__1, &c_b1, &a[k + k * a_dim1]);
r1.r = q__1.r, r1.i = q__1.i;
i__1 = k - 1;
cscal_(&i__1, &r1, &a[k * a_dim1 + 1], &c__1);
} else /* if(complicated condition) */ {
i__1 = k + k * a_dim1;
if (a[i__1].r != 0.f || a[i__1].i != 0.f) {
i__1 = k - 1;
for (ii = 1; ii <= i__1; ++ii) {
i__2 = ii + k * a_dim1;
c_div(&q__1, &a[ii + k * a_dim1], &a[k + k *
a_dim1]);
a[i__2].r = q__1.r, a[i__2].i = q__1.i;
/* L14: */
}
}
}
/* Store the superdiagonal element of D in array E */
i__1 = k;
e[i__1].r = 0.f, e[i__1].i = 0.f;
}
} else {
/* 2-by-2 pivot block D(k): columns KW and KW-1 of W now */
/* hold */
/* ( W(k-1) W(k) ) = ( U(k-1) U(k) )*D(k) */
/* where U(k) and U(k-1) are the k-th and (k-1)-th columns */
/* of U */
if (k > 2) {
/* Store U(k) and U(k-1) in columns k and k-1 of A */
i__1 = k - 1 + kw * w_dim1;
d12.r = w[i__1].r, d12.i = w[i__1].i;
c_div(&q__1, &w[k + kw * w_dim1], &d12);
d11.r = q__1.r, d11.i = q__1.i;
c_div(&q__1, &w[k - 1 + (kw - 1) * w_dim1], &d12);
d22.r = q__1.r, d22.i = q__1.i;
q__3.r = d11.r * d22.r - d11.i * d22.i, q__3.i = d11.r *
d22.i + d11.i * d22.r;
q__2.r = q__3.r - 1.f, q__2.i = q__3.i + 0.f;
c_div(&q__1, &c_b1, &q__2);
t.r = q__1.r, t.i = q__1.i;
i__1 = k - 2;
for (j = 1; j <= i__1; ++j) {
i__2 = j + (k - 1) * a_dim1;
i__3 = j + (kw - 1) * w_dim1;
q__4.r = d11.r * w[i__3].r - d11.i * w[i__3].i,
q__4.i = d11.r * w[i__3].i + d11.i * w[i__3]
.r;
i__4 = j + kw * w_dim1;
q__3.r = q__4.r - w[i__4].r, q__3.i = q__4.i - w[i__4]
.i;
c_div(&q__2, &q__3, &d12);
q__1.r = t.r * q__2.r - t.i * q__2.i, q__1.i = t.r *
q__2.i + t.i * q__2.r;
a[i__2].r = q__1.r, a[i__2].i = q__1.i;
i__2 = j + k * a_dim1;
i__3 = j + kw * w_dim1;
q__4.r = d22.r * w[i__3].r - d22.i * w[i__3].i,
q__4.i = d22.r * w[i__3].i + d22.i * w[i__3]
.r;
i__4 = j + (kw - 1) * w_dim1;
q__3.r = q__4.r - w[i__4].r, q__3.i = q__4.i - w[i__4]
.i;
c_div(&q__2, &q__3, &d12);
q__1.r = t.r * q__2.r - t.i * q__2.i, q__1.i = t.r *
q__2.i + t.i * q__2.r;
a[i__2].r = q__1.r, a[i__2].i = q__1.i;
/* L20: */
}
}
/* Copy diagonal elements of D(K) to A, */
/* copy superdiagonal element of D(K) to E(K) and */
/* ZERO out superdiagonal entry of A */
i__1 = k - 1 + (k - 1) * a_dim1;
i__2 = k - 1 + (kw - 1) * w_dim1;
a[i__1].r = w[i__2].r, a[i__1].i = w[i__2].i;
i__1 = k - 1 + k * a_dim1;
a[i__1].r = 0.f, a[i__1].i = 0.f;
i__1 = k + k * a_dim1;
i__2 = k + kw * w_dim1;
a[i__1].r = w[i__2].r, a[i__1].i = w[i__2].i;
i__1 = k;
i__2 = k - 1 + kw * w_dim1;
e[i__1].r = w[i__2].r, e[i__1].i = w[i__2].i;
i__1 = k - 1;
e[i__1].r = 0.f, e[i__1].i = 0.f;
}
/* End column K is nonsingular */
}
/* Store details of the interchanges in IPIV */
if (kstep == 1) {
ipiv[k] = kp;
} else {
ipiv[k] = -p;
ipiv[k - 1] = -kp;
}
/* Decrease K and return to the start of the main loop */
k -= kstep;
goto L10;
L30:
/* Update the upper triangle of A11 (= A(1:k,1:k)) as */
/* A11 := A11 - U12*D*U12**T = A11 - U12*W**T */
/* computing blocks of NB columns at a time */
i__1 = -(*nb);
for (j = (k - 1) / *nb * *nb + 1; i__1 < 0 ? j >= 1 : j <= 1; j +=
i__1) {
/* Computing MIN */
i__2 = *nb, i__3 = k - j + 1;
jb = f2cmin(i__2,i__3);
/* Update the upper triangle of the diagonal block */
i__2 = j + jb - 1;
for (jj = j; jj <= i__2; ++jj) {
i__3 = jj - j + 1;
i__4 = *n - k;
q__1.r = -1.f, q__1.i = 0.f;
cgemv_("No transpose", &i__3, &i__4, &q__1, &a[j + (k + 1) *
a_dim1], lda, &w[jj + (kw + 1) * w_dim1], ldw, &c_b1,
&a[j + jj * a_dim1], &c__1);
/* L40: */
}
/* Update the rectangular superdiagonal block */
if (j >= 2) {
i__2 = j - 1;
i__3 = *n - k;
q__1.r = -1.f, q__1.i = 0.f;
cgemm_("No transpose", "Transpose", &i__2, &jb, &i__3, &q__1,
&a[(k + 1) * a_dim1 + 1], lda, &w[j + (kw + 1) *
w_dim1], ldw, &c_b1, &a[j * a_dim1 + 1], lda);
}
/* L50: */
}
/* Set KB to the number of columns factorized */
*kb = *n - k;
} else {
/* Factorize the leading columns of A using the lower triangle */
/* of A and working forwards, and compute the matrix W = L21*D */
/* for use in updating A22 */
/* Initialize the unused last entry of the subdiagonal array E. */
i__1 = *n;
e[i__1].r = 0.f, e[i__1].i = 0.f;
/* K is the main loop index, increasing from 1 in steps of 1 or 2 */
k = 1;
L70:
/* Exit from loop */
if (k >= *nb && *nb < *n || k > *n) {
goto L90;
}
kstep = 1;
p = k;
/* Copy column K of A to column K of W and update it */
i__1 = *n - k + 1;
ccopy_(&i__1, &a[k + k * a_dim1], &c__1, &w[k + k * w_dim1], &c__1);
if (k > 1) {
i__1 = *n - k + 1;
i__2 = k - 1;
q__1.r = -1.f, q__1.i = 0.f;
cgemv_("No transpose", &i__1, &i__2, &q__1, &a[k + a_dim1], lda, &
w[k + w_dim1], ldw, &c_b1, &w[k + k * w_dim1], &c__1);
}
/* Determine rows and columns to be interchanged and whether */
/* a 1-by-1 or 2-by-2 pivot block will be used */
i__1 = k + k * w_dim1;
absakk = (r__1 = w[i__1].r, abs(r__1)) + (r__2 = r_imag(&w[k + k *
w_dim1]), abs(r__2));
/* IMAX is the row-index of the largest off-diagonal element in */
/* column K, and COLMAX is its absolute value. */
/* Determine both COLMAX and IMAX. */
if (k < *n) {
i__1 = *n - k;
imax = k + icamax_(&i__1, &w[k + 1 + k * w_dim1], &c__1);
i__1 = imax + k * w_dim1;
colmax = (r__1 = w[i__1].r, abs(r__1)) + (r__2 = r_imag(&w[imax +
k * w_dim1]), abs(r__2));
} else {
colmax = 0.f;
}
if (f2cmax(absakk,colmax) == 0.f) {
/* Column K is zero or underflow: set INFO and continue */
if (*info == 0) {
*info = k;
}
kp = k;
i__1 = *n - k + 1;
ccopy_(&i__1, &w[k + k * w_dim1], &c__1, &a[k + k * a_dim1], &
c__1);
/* Set E( K ) to zero */
if (k < *n) {
i__1 = k;
e[i__1].r = 0.f, e[i__1].i = 0.f;
}
} else {
/* ============================================================ */
/* Test for interchange */
/* Equivalent to testing for ABSAKK.GE.ALPHA*COLMAX */
/* (used to handle NaN and Inf) */
if (! (absakk < alpha * colmax)) {
/* no interchange, use 1-by-1 pivot block */
kp = k;
} else {
done = FALSE_;
/* Loop until pivot found */
L72:
/* Begin pivot search loop body */
/* Copy column IMAX to column K+1 of W and update it */
i__1 = imax - k;
ccopy_(&i__1, &a[imax + k * a_dim1], lda, &w[k + (k + 1) *
w_dim1], &c__1);
i__1 = *n - imax + 1;
ccopy_(&i__1, &a[imax + imax * a_dim1], &c__1, &w[imax + (k +
1) * w_dim1], &c__1);
if (k > 1) {
i__1 = *n - k + 1;
i__2 = k - 1;
q__1.r = -1.f, q__1.i = 0.f;
cgemv_("No transpose", &i__1, &i__2, &q__1, &a[k + a_dim1]
, lda, &w[imax + w_dim1], ldw, &c_b1, &w[k + (k +
1) * w_dim1], &c__1);
}
/* JMAX is the column-index of the largest off-diagonal */
/* element in row IMAX, and ROWMAX is its absolute value. */
/* Determine both ROWMAX and JMAX. */
if (imax != k) {
i__1 = imax - k;
jmax = k - 1 + icamax_(&i__1, &w[k + (k + 1) * w_dim1], &
c__1);
i__1 = jmax + (k + 1) * w_dim1;
rowmax = (r__1 = w[i__1].r, abs(r__1)) + (r__2 = r_imag(&
w[jmax + (k + 1) * w_dim1]), abs(r__2));
} else {
rowmax = 0.f;
}
if (imax < *n) {
i__1 = *n - imax;
itemp = imax + icamax_(&i__1, &w[imax + 1 + (k + 1) *
w_dim1], &c__1);
i__1 = itemp + (k + 1) * w_dim1;
stemp = (r__1 = w[i__1].r, abs(r__1)) + (r__2 = r_imag(&w[
itemp + (k + 1) * w_dim1]), abs(r__2));
if (stemp > rowmax) {
rowmax = stemp;
jmax = itemp;
}
}
/* Equivalent to testing for */
/* CABS1( W( IMAX, K+1 ) ).GE.ALPHA*ROWMAX */
/* (used to handle NaN and Inf) */
i__1 = imax + (k + 1) * w_dim1;
if (! ((r__1 = w[i__1].r, abs(r__1)) + (r__2 = r_imag(&w[imax
+ (k + 1) * w_dim1]), abs(r__2)) < alpha * rowmax)) {
/* interchange rows and columns K and IMAX, */
/* use 1-by-1 pivot block */
kp = imax;
/* copy column K+1 of W to column K of W */
i__1 = *n - k + 1;
ccopy_(&i__1, &w[k + (k + 1) * w_dim1], &c__1, &w[k + k *
w_dim1], &c__1);
done = TRUE_;
/* Equivalent to testing for ROWMAX.EQ.COLMAX, */
/* (used to handle NaN and Inf) */
} else if (p == jmax || rowmax <= colmax) {
/* interchange rows and columns K+1 and IMAX, */
/* use 2-by-2 pivot block */
kp = imax;
kstep = 2;
done = TRUE_;
} else {
/* Pivot not found: set params and repeat */
p = imax;
colmax = rowmax;
imax = jmax;
/* Copy updated JMAXth (next IMAXth) column to Kth of W */
i__1 = *n - k + 1;
ccopy_(&i__1, &w[k + (k + 1) * w_dim1], &c__1, &w[k + k *
w_dim1], &c__1);
}
/* End pivot search loop body */
if (! done) {
goto L72;
}
}
/* ============================================================ */
kk = k + kstep - 1;
if (kstep == 2 && p != k) {
/* Copy non-updated column K to column P */
i__1 = p - k;
ccopy_(&i__1, &a[k + k * a_dim1], &c__1, &a[p + k * a_dim1],
lda);
i__1 = *n - p + 1;
ccopy_(&i__1, &a[p + k * a_dim1], &c__1, &a[p + p * a_dim1], &
c__1);
/* Interchange rows K and P in first K columns of A */
/* and first K+1 columns of W */
cswap_(&k, &a[k + a_dim1], lda, &a[p + a_dim1], lda);
cswap_(&kk, &w[k + w_dim1], ldw, &w[p + w_dim1], ldw);
}
/* Updated column KP is already stored in column KK of W */
if (kp != kk) {
/* Copy non-updated column KK to column KP */
i__1 = kp + k * a_dim1;
i__2 = kk + k * a_dim1;
a[i__1].r = a[i__2].r, a[i__1].i = a[i__2].i;
i__1 = kp - k - 1;
ccopy_(&i__1, &a[k + 1 + kk * a_dim1], &c__1, &a[kp + (k + 1)
* a_dim1], lda);
i__1 = *n - kp + 1;
ccopy_(&i__1, &a[kp + kk * a_dim1], &c__1, &a[kp + kp *
a_dim1], &c__1);
/* Interchange rows KK and KP in first KK columns of A and W */
cswap_(&kk, &a[kk + a_dim1], lda, &a[kp + a_dim1], lda);
cswap_(&kk, &w[kk + w_dim1], ldw, &w[kp + w_dim1], ldw);
}
if (kstep == 1) {
/* 1-by-1 pivot block D(k): column k of W now holds */
/* W(k) = L(k)*D(k) */
/* where L(k) is the k-th column of L */
/* Store L(k) in column k of A */
i__1 = *n - k + 1;
ccopy_(&i__1, &w[k + k * w_dim1], &c__1, &a[k + k * a_dim1], &
c__1);
if (k < *n) {
i__1 = k + k * a_dim1;
if ((r__1 = a[i__1].r, abs(r__1)) + (r__2 = r_imag(&a[k +
k * a_dim1]), abs(r__2)) >= sfmin) {
c_div(&q__1, &c_b1, &a[k + k * a_dim1]);
r1.r = q__1.r, r1.i = q__1.i;
i__1 = *n - k;
cscal_(&i__1, &r1, &a[k + 1 + k * a_dim1], &c__1);
} else /* if(complicated condition) */ {
i__1 = k + k * a_dim1;
if (a[i__1].r != 0.f || a[i__1].i != 0.f) {
i__1 = *n;
for (ii = k + 1; ii <= i__1; ++ii) {
i__2 = ii + k * a_dim1;
c_div(&q__1, &a[ii + k * a_dim1], &a[k + k *
a_dim1]);
a[i__2].r = q__1.r, a[i__2].i = q__1.i;
/* L74: */
}
}
}
/* Store the subdiagonal element of D in array E */
i__1 = k;
e[i__1].r = 0.f, e[i__1].i = 0.f;
}
} else {
/* 2-by-2 pivot block D(k): columns k and k+1 of W now hold */
/* ( W(k) W(k+1) ) = ( L(k) L(k+1) )*D(k) */
/* where L(k) and L(k+1) are the k-th and (k+1)-th columns */
/* of L */
if (k < *n - 1) {
/* Store L(k) and L(k+1) in columns k and k+1 of A */
i__1 = k + 1 + k * w_dim1;
d21.r = w[i__1].r, d21.i = w[i__1].i;
c_div(&q__1, &w[k + 1 + (k + 1) * w_dim1], &d21);
d11.r = q__1.r, d11.i = q__1.i;
c_div(&q__1, &w[k + k * w_dim1], &d21);
d22.r = q__1.r, d22.i = q__1.i;
q__3.r = d11.r * d22.r - d11.i * d22.i, q__3.i = d11.r *
d22.i + d11.i * d22.r;
q__2.r = q__3.r - 1.f, q__2.i = q__3.i + 0.f;
c_div(&q__1, &c_b1, &q__2);
t.r = q__1.r, t.i = q__1.i;
i__1 = *n;
for (j = k + 2; j <= i__1; ++j) {
i__2 = j + k * a_dim1;
i__3 = j + k * w_dim1;
q__4.r = d11.r * w[i__3].r - d11.i * w[i__3].i,
q__4.i = d11.r * w[i__3].i + d11.i * w[i__3]
.r;
i__4 = j + (k + 1) * w_dim1;
q__3.r = q__4.r - w[i__4].r, q__3.i = q__4.i - w[i__4]
.i;
c_div(&q__2, &q__3, &d21);
q__1.r = t.r * q__2.r - t.i * q__2.i, q__1.i = t.r *
q__2.i + t.i * q__2.r;
a[i__2].r = q__1.r, a[i__2].i = q__1.i;
i__2 = j + (k + 1) * a_dim1;
i__3 = j + (k + 1) * w_dim1;
q__4.r = d22.r * w[i__3].r - d22.i * w[i__3].i,
q__4.i = d22.r * w[i__3].i + d22.i * w[i__3]
.r;
i__4 = j + k * w_dim1;
q__3.r = q__4.r - w[i__4].r, q__3.i = q__4.i - w[i__4]
.i;
c_div(&q__2, &q__3, &d21);
q__1.r = t.r * q__2.r - t.i * q__2.i, q__1.i = t.r *
q__2.i + t.i * q__2.r;
a[i__2].r = q__1.r, a[i__2].i = q__1.i;
/* L80: */
}
}
/* Copy diagonal elements of D(K) to A, */
/* copy subdiagonal element of D(K) to E(K) and */
/* ZERO out subdiagonal entry of A */
i__1 = k + k * a_dim1;
i__2 = k + k * w_dim1;
a[i__1].r = w[i__2].r, a[i__1].i = w[i__2].i;
i__1 = k + 1 + k * a_dim1;
a[i__1].r = 0.f, a[i__1].i = 0.f;
i__1 = k + 1 + (k + 1) * a_dim1;
i__2 = k + 1 + (k + 1) * w_dim1;
a[i__1].r = w[i__2].r, a[i__1].i = w[i__2].i;
i__1 = k;
i__2 = k + 1 + k * w_dim1;
e[i__1].r = w[i__2].r, e[i__1].i = w[i__2].i;
i__1 = k + 1;
e[i__1].r = 0.f, e[i__1].i = 0.f;
}
/* End column K is nonsingular */
}
/* Store details of the interchanges in IPIV */
if (kstep == 1) {
ipiv[k] = kp;
} else {
ipiv[k] = -p;
ipiv[k + 1] = -kp;
}
/* Increase K and return to the start of the main loop */
k += kstep;
goto L70;
L90:
/* Update the lower triangle of A22 (= A(k:n,k:n)) as */
/* A22 := A22 - L21*D*L21**T = A22 - L21*W**T */
/* computing blocks of NB columns at a time */
i__1 = *n;
i__2 = *nb;
for (j = k; i__2 < 0 ? j >= i__1 : j <= i__1; j += i__2) {
/* Computing MIN */
i__3 = *nb, i__4 = *n - j + 1;
jb = f2cmin(i__3,i__4);
/* Update the lower triangle of the diagonal block */
i__3 = j + jb - 1;
for (jj = j; jj <= i__3; ++jj) {
i__4 = j + jb - jj;
i__5 = k - 1;
q__1.r = -1.f, q__1.i = 0.f;
cgemv_("No transpose", &i__4, &i__5, &q__1, &a[jj + a_dim1],
lda, &w[jj + w_dim1], ldw, &c_b1, &a[jj + jj * a_dim1]
, &c__1);
/* L100: */
}
/* Update the rectangular subdiagonal block */
if (j + jb <= *n) {
i__3 = *n - j - jb + 1;
i__4 = k - 1;
q__1.r = -1.f, q__1.i = 0.f;
cgemm_("No transpose", "Transpose", &i__3, &jb, &i__4, &q__1,
&a[j + jb + a_dim1], lda, &w[j + w_dim1], ldw, &c_b1,
&a[j + jb + j * a_dim1], lda);
}
/* L110: */
}
/* Set KB to the number of columns factorized */
*kb = k - 1;
}
return 0;
/* End of CLASYF_RK */
} /* clasyf_rk__ */
|
the_stack_data/150143458.c | #include<stdio.h>
#include<fcntl.h>
#include<unistd.h>
#include<termios.h>
#include<string.h>
int main(int argc, char *argv[]){
int file, count;
if(argc!=2){
printf("Please pass a string to the program, exiting!\n");
return -2;
}
if ((file = open("/dev/ttyS0", O_RDWR | O_NOCTTY | O_NDELAY))<0){
perror("UART: Failed to open the device.\n");
return -1;
}
struct termios options;
tcgetattr(file, &options);
options.c_cflag = B9600 | CS8 | CREAD | CLOCAL;
options.c_iflag = IGNPAR | ICRNL;
tcflush(file, TCIFLUSH);
tcsetattr(file, TCSANOW, &options);
if ((count = write(file, argv[1], strlen(argv[1])))<0){
perror("UART: Failed to write to the output\n");
return -1;
}
write(file, "\n\r", 2); // new line and carriage return
close(file);
return 0;
} |
the_stack_data/40763232.c | #include <stdio.h>
int main()
{
int height = 5;
for (int i = 1; i <= height; i++)
{
for (int j = 0; j < height - i; j++)
{
printf(" ");
}
for (int j = 0; j < i; j++)
{
printf("* ");
}
printf("\n");
}
return 0;
} |
the_stack_data/153269236.c | // REQUIRES: x86-registered-target
// expected-no-diagnostics
// We support -m32 and -m64. We support all x86 CPU feature flags in gcc's -m
// flag space.
// RUN: %clang_cl /Zs /WX -m32 -m64 -msse3 -msse4.1 -mavx -mno-avx \
// RUN: --target=i386-pc-win32 -### -- 2>&1 %s | FileCheck -check-prefix=MFLAGS %s
// MFLAGS-NOT: invalid /arch: argument
//
// RUN: %clang_cl -m32 -arch:IA32 --target=i386-pc-windows /c /Fo%t.obj -Xclang -verify -DTEST_32_ARCH_IA32 -- %s
#if defined(TEST_32_ARCH_IA32)
#if _M_IX86_FP || __AVX__ || __AVX2__ || __AVX512F__ || __AVX512BW__
#error fail
#endif
#endif
// arch: args are case-sensitive.
// RUN: %clang_cl -m32 -arch:ia32 --target=i386-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=ia32 %s
// ia32: invalid /arch: argument 'ia32'; for 32-bit expected one of AVX, AVX2, AVX512, AVX512F, IA32, SSE, SSE2
// RUN: %clang_cl -m64 -arch:IA32 --target=x86_64-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=IA3264 %s
// IA3264: invalid /arch: argument 'IA32'; for 64-bit expected one of AVX, AVX2, AVX512, AVX512F
// RUN: %clang_cl -m32 -arch:SSE --target=i386-pc-windows /c /Fo%t.obj -Xclang -verify -DTEST_32_ARCH_SSE -- %s
#if defined(TEST_32_ARCH_SSE)
#if _M_IX86_FP != 1 || __AVX__ || __AVX2__ || __AVX512F__ || __AVX512BW__
#error fail
#endif
#endif
// RUN: %clang_cl -m32 -arch:sse --target=i386-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=sse %s
// sse: invalid /arch: argument
// RUN: %clang_cl -m32 -arch:SSE2 --target=i386-pc-windows /c /Fo%t.obj -Xclang -verify -DTEST_32_ARCH_SSE2 -- %s
#if defined(TEST_32_ARCH_SSE2)
#if _M_IX86_FP != 2 || __AVX__ || __AVX2__ || __AVX512F__ || __AVX512BW__
#error fail
#endif
#endif
// RUN: %clang_cl -m32 -arch:sse2 --target=i386-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=sse %s
// sse2: invalid /arch: argument
// RUN: %clang_cl -m64 -arch:SSE --target=x86_64-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=SSE64 %s
// SSE64: invalid /arch: argument 'SSE'; for 64-bit expected one of AVX, AVX2, AVX512, AVX512F
// RUN: %clang_cl -m64 -arch:SSE2 --target=x86_64-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=SSE264 %s
// SSE264: invalid /arch: argument
// RUN: %clang_cl -m32 -arch:AVX --target=i386-pc-windows /c /Fo%t.obj -Xclang -verify -DTEST_32_ARCH_AVX -- %s
#if defined(TEST_32_ARCH_AVX)
#if _M_IX86_FP != 2 || !__AVX__ || __AVX2__ || __AVX512F__ || __AVX512BW__
#error fail
#endif
#endif
// RUN: %clang_cl -m32 -arch:avx --target=i386-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=avx %s
// avx: invalid /arch: argument
// RUN: %clang_cl -m32 -arch:AVX2 --target=i386-pc-windows /c /Fo%t.obj -Xclang -verify -DTEST_32_ARCH_AVX2 -- %s
#if defined(TEST_32_ARCH_AVX2)
#if _M_IX86_FP != 2 || !__AVX__ || !__AVX2__ || __AVX512F__ || __AVX512BW__
#error fail
#endif
#endif
// RUN: %clang_cl -m32 -arch:avx2 --target=i386-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=avx2 %s
// avx2: invalid /arch: argument
// RUN: %clang_cl -m32 -arch:AVX512F --target=i386-pc-windows /c /Fo%t.obj -Xclang -verify -DTEST_32_ARCH_AVX512F -- %s
#if defined(TEST_32_ARCH_AVX512F)
#if _M_IX86_FP != 2 || !__AVX__ || !__AVX2__ || !__AVX512F__ || __AVX512BW__
#error fail
#endif
#endif
// RUN: %clang_cl -m32 -arch:avx512f --target=i386-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=avx512f %s
// avx512f: invalid /arch: argument
// RUN: %clang_cl -m32 -arch:AVX512 --target=i386-pc-windows /c /Fo%t.obj -Xclang -verify -DTEST_32_ARCH_AVX512 -- %s
#if defined(TEST_32_ARCH_AVX512)
#if _M_IX86_FP != 2 || !__AVX__ || !__AVX2__ || !__AVX512F__ || !__AVX512BW__
#error fail
#endif
#endif
// RUN: %clang_cl -m32 -arch:avx512 --target=i386-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=avx512 %s
// avx512: invalid /arch: argument
// RUN: %clang_cl -m64 -arch:AVX --target=x86_64-pc-windows /c /Fo%t.obj -Xclang -verify -DTEST_64_ARCH_AVX -- %s
#if defined(TEST_64_ARCH_AVX)
#if _M_IX86_FP || !__AVX__ || __AVX2__ || __AVX512F__ || __AVX512BW__
#error fail
#endif
#endif
// RUN: %clang_cl -m64 -arch:avx --target=x86_64-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=avx64 %s
// avx64: invalid /arch: argument
// RUN: %clang_cl -m64 -arch:AVX2 --target=x86_64-pc-windows /c /Fo%t.obj -Xclang -verify -DTEST_64_ARCH_AVX2 -- %s
#if defined(TEST_64_ARCH_AVX2)
#if _M_IX86_FP || !__AVX__ || !__AVX2__ || __AVX512F__ || __AVX512BW__
#error fail
#endif
#endif
// RUN: %clang_cl -m64 -arch:avx2 --target=x86_64-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=avx264 %s
// avx264: invalid /arch: argument
// RUN: %clang_cl -m64 -arch:AVX512F --target=i386-pc-windows /c /Fo%t.obj -Xclang -verify -DTEST_64_ARCH_AVX512F -- %s
#if defined(TEST_64_ARCH_AVX512F)
#if _M_IX86_FP || !__AVX__ || !__AVX2__ || !__AVX512F__ || __AVX512BW__
#error fail
#endif
#endif
// RUN: %clang_cl -m64 -arch:avx512f --target=i386-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=avx512f64 %s
// avx512f64: invalid /arch: argument
// RUN: %clang_cl -m64 -arch:AVX512 --target=i386-pc-windows /c /Fo%t.obj -Xclang -verify -DTEST_64_ARCH_AVX512 -- %s
#if defined(TEST_64_ARCH_AVX512)
#if _M_IX86_FP || !__AVX__ || !__AVX2__ || !__AVX512F__ || !__AVX512BW__
#error fail
#endif
#endif
// RUN: %clang_cl -m64 -arch:avx512 --target=i386-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=avx51264 %s
// avx51264: invalid /arch: argument
// RUN: %clang_cl -m64 -arch:AVX -tune:haswell --target=x86_64-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=tune %s
// tune: "-target-cpu" "sandybridge"
// tune-SAME: "-tune-cpu" "haswell"
void f() {
}
|
the_stack_data/248580741.c | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#pragma warning (disable: 4996)
void output(const char alph, int num);
void main()
{
char title[32] = "programming concept and design";
int count[5] = { 0,0,0,0,0 };
char vowel[5] = { 'a','e','i','o','u' };
for (int check = 0;check < 32;check++)
{
for (int innercheck = 0;innercheck < 5;innercheck++)
if (title[check] == vowel[innercheck])
count[innercheck]++;
}
for(int num=0;num<5;num++)
{
printf("%c has %d times\n", vowel[num], count[num]);
}
system("pause");
}
//all error need correction |
the_stack_data/111078933.c | /* This testcase is part of GDB, the GNU debugger.
Copyright 2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* This program is intended to be started outside of gdb, and then
attached to by gdb. It loops for a while, but not forever. */
#include <unistd.h>
int main ()
{
int i;
for (i = 0; i < 120; i++)
sleep (1);
return 0;
}
|
the_stack_data/173577665.c | /*
// Copyright (c) 2017 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
*/
#ifdef OC_SECURITY
#include "oc_doxm.h"
#include "oc_acl.h"
#include "oc_api.h"
#include "oc_core_res.h"
#include "oc_pstat.h"
#include "oc_store.h"
#include <stddef.h>
#include <string.h>
#ifndef _WIN32
#include <strings.h>
#endif
#ifdef OC_DYNAMIC_ALLOCATION
#include "port/oc_assert.h"
#include <stdlib.h>
static oc_sec_doxm_t *doxm;
#else /* OC_DYNAMIC_ALLOCATION */
static oc_sec_doxm_t doxm[OC_MAX_NUM_DEVICES];
#endif /* !OC_DYNAMIC_ALLOCATION */
void
oc_sec_doxm_free(void)
{
#ifdef OC_DYNAMIC_ALLOCATION
if (doxm) {
free(doxm);
}
#endif /* OC_DYNAMIC_ALLOCATION */
}
void
oc_sec_doxm_init(void)
{
#ifdef OC_DYNAMIC_ALLOCATION
doxm =
(oc_sec_doxm_t *)calloc(oc_core_get_num_devices(), sizeof(oc_sec_doxm_t));
if (!doxm) {
oc_abort("Insufficient memory");
}
#endif /* OC_DYNAMIC_ALLOCATION */
}
void
oc_sec_doxm_default(size_t device)
{
doxm[device].oxmsel = 0;
#ifdef OC_PKI
doxm[device].sct = 9;
#else /* OC_PKI */
doxm[device].sct = 1;
#endif /* !OC_PKI */
doxm[device].owned = false;
memset(doxm[device].devowneruuid.id, 0, 16);
memset(doxm[device].rowneruuid.id, 0, 16);
oc_sec_dump_doxm(device);
}
void
oc_sec_encode_doxm(size_t device)
{
#ifdef OC_PKI
int oxms[2] = { OC_OXMTYPE_JW, OC_OXMTYPE_MFG_CERT };
#else /* OC_PKI */
int oxms[1] = { OC_OXMTYPE_JW };
#endif /* !OC_PKI */
char uuid[37];
oc_rep_start_root_object();
oc_process_baseline_interface(
oc_core_get_resource_by_index(OCF_SEC_DOXM, device));
/* oxms */
#ifdef OC_PKI
oc_rep_set_int_array(root, oxms, oxms, 2);
#else /* OC_PKI */
oc_rep_set_int_array(root, oxms, oxms, 1);
#endif /* !OC_PKI */
/* oxmsel */
oc_rep_set_int(root, oxmsel, doxm[device].oxmsel);
/* sct */
oc_rep_set_int(root, sct, doxm[device].sct);
/* owned */
oc_rep_set_boolean(root, owned, doxm[device].owned);
/* devowneruuid */
oc_uuid_to_str(&doxm[device].devowneruuid, uuid, OC_UUID_LEN);
oc_rep_set_text_string(root, devowneruuid, uuid);
/* deviceuuid */
oc_uuid_to_str(&doxm[device].deviceuuid, uuid, OC_UUID_LEN);
oc_rep_set_text_string(root, deviceuuid, uuid);
/* rowneruuid */
oc_uuid_to_str(&doxm[device].rowneruuid, uuid, OC_UUID_LEN);
oc_rep_set_text_string(root, rowneruuid, uuid);
oc_rep_end_root_object();
}
oc_sec_doxm_t *
oc_sec_get_doxm(size_t device)
{
return &doxm[device];
}
void
get_doxm(oc_request_t *request, oc_interface_mask_t interface, void *data)
{
(void)data;
switch (interface) {
case OC_IF_BASELINE: {
char *q;
int ql = oc_get_query_value(request, "owned", &q);
size_t device = request->resource->device;
if (ql > 0 &&
((doxm[device].owned == 1 && strncasecmp(q, "false", 5) == 0) ||
(doxm[device].owned == 0 && strncasecmp(q, "true", 4) == 0))) {
if (request->origin && (request->origin->flags & MULTICAST) == 0) {
request->response->response_buffer->code =
oc_status_code(OC_STATUS_BAD_REQUEST);
} else {
oc_ignore_request(request);
}
} else {
oc_sec_encode_doxm(device);
oc_send_response(request, OC_STATUS_OK);
}
} break;
default:
break;
}
}
bool
oc_sec_decode_doxm(oc_rep_t *rep, bool from_storage, size_t device)
{
oc_sec_pstat_t *ps = oc_sec_get_pstat(device);
oc_rep_t *t = rep;
size_t len = 0;
while (t != NULL) {
len = oc_string_len(t->name);
switch (t->type) {
/* owned */
case OC_REP_BOOL:
if (len == 5 && memcmp(oc_string(t->name), "owned", 5) == 0) {
if (!from_storage && ps->s != OC_DOS_RFOTM) {
OC_ERR("oc_doxm: Can set owned property only in RFOTM");
return false;
}
} else {
OC_ERR("oc_doxm: Unknown property %s", oc_string(t->name));
return false;
}
break;
/* oxmsel and sct */
case OC_REP_INT:
if (len == 6 && memcmp(oc_string(t->name), "oxmsel", 6) == 0) {
if (!from_storage && ps->s != OC_DOS_RFOTM) {
OC_ERR("oc_doxm: Can set oxmsel property only in RFOTM");
return false;
}
} else if (from_storage && len == 3 &&
memcmp(oc_string(t->name), "sct", 3) == 0) {
} else {
OC_ERR("oc_doxm: Unknown property %s", oc_string(t->name));
return false;
}
break;
/* deviceuuid, devowneruuid and rowneruuid */
case OC_REP_STRING:
if (len == 10 && memcmp(oc_string(t->name), "deviceuuid", 10) == 0) {
if (!from_storage && ps->s != OC_DOS_RFOTM) {
OC_ERR("oc_doxm: Can set deviceuuid property only in RFOTM");
return false;
}
} else if (len == 12 &&
memcmp(oc_string(t->name), "devowneruuid", 12) == 0) {
if (!from_storage && ps->s != OC_DOS_RFOTM) {
OC_ERR("oc_doxm: Can set devowneruuid property only in RFOTM");
return false;
}
} else if (len == 10 &&
memcmp(oc_string(t->name), "rowneruuid", 10) == 0) {
if (!from_storage && ps->s != OC_DOS_RFOTM && ps->s != OC_DOS_SRESET) {
OC_ERR("oc_doxm: Can set rowneruuid property only in RFOTM");
return false;
}
} else {
OC_ERR("oc_doxm: Unknown property %s", oc_string(t->name));
return false;
}
break;
/* oxms */
case OC_REP_INT_ARRAY:
if (!from_storage && len == 4 &&
memcmp(oc_string(t->name), "oxms", 4) == 0) {
OC_ERR("oc_doxm: Can set oxms property");
return false;
}
break;
default: {
if (!((len == 2 && (memcmp(oc_string(t->name), "rt", 2) == 0 ||
memcmp(oc_string(t->name), "if", 2) == 0))) &&
!(len == 4 && memcmp(oc_string(t->name), "oxms", 4) == 0)) {
OC_ERR("oc_doxm: Unknown property %s", oc_string(t->name));
return false;
}
} break;
}
t = t->next;
}
while (rep != NULL) {
len = oc_string_len(rep->name);
switch (rep->type) {
/* owned */
case OC_REP_BOOL:
if (len == 5 && memcmp(oc_string(rep->name), "owned", 5) == 0) {
doxm[device].owned = rep->value.boolean;
}
break;
/* oxmsel and sct */
case OC_REP_INT:
if (len == 6 && memcmp(oc_string(rep->name), "oxmsel", 6) == 0) {
doxm[device].oxmsel = rep->value.integer;
} else if (from_storage && len == 3 &&
memcmp(oc_string(rep->name), "sct", 3) == 0) {
doxm[device].sct = rep->value.integer;
}
break;
/* deviceuuid, devowneruuid and rowneruuid */
case OC_REP_STRING:
if (len == 10 && memcmp(oc_string(rep->name), "deviceuuid", 10) == 0) {
oc_str_to_uuid(oc_string(rep->value.string), &doxm[device].deviceuuid);
oc_uuid_t *deviceuuid = oc_core_get_device_id(device);
memcpy(deviceuuid->id, doxm[device].deviceuuid.id, 16);
} else if (len == 12 &&
memcmp(oc_string(rep->name), "devowneruuid", 12) == 0) {
oc_str_to_uuid(oc_string(rep->value.string),
&doxm[device].devowneruuid);
if (!from_storage) {
int i;
for (i = 0; i < 16; i++) {
if (doxm[device].devowneruuid.id[i] != 0) {
break;
}
}
if (i != 16) {
oc_core_regen_unique_ids(device);
}
}
} else if (len == 10 &&
memcmp(oc_string(rep->name), "rowneruuid", 10) == 0) {
oc_str_to_uuid(oc_string(rep->value.string), &doxm[device].rowneruuid);
}
break;
default:
break;
}
rep = rep->next;
}
return true;
}
void
post_doxm(oc_request_t *request, oc_interface_mask_t interface, void *data)
{
(void)interface;
(void)data;
if (oc_sec_decode_doxm(request->request_payload, false,
request->resource->device)) {
oc_send_response(request, OC_STATUS_CHANGED);
oc_sec_dump_doxm(request->resource->device);
} else {
oc_send_response(request, OC_STATUS_BAD_REQUEST);
}
}
#endif /* OC_SECURITY */
|
the_stack_data/86074136.c | /* File : example.c */
void add(int *x, int *y, int *result) {
*result = *x + *y;
}
void sub(int *x, int *y, int *result) {
*result = *x - *y;
}
int divide(int n, int d, int *r) {
int q;
q = n/d;
*r = n - q*d;
return q;
}
|
the_stack_data/349313.c | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
/*
Crie um array de 10 elementos com elementos aleatorios em cada uma das
posicoes. Exiba quantas vezes cada um dos valores existe no array;
*/
#define QTD_ARRAYS 10
int main(void)
{
int i, j, elementos[QTD_ARRAYS], contador[QTD_ARRAYS];
srand(time(NULL));
for (i = 0; i < QTD_ARRAYS; i++)
{
elementos[i] = rand() % 100;
printf("elemento[%d]: %d\n", i, elementos[i]);
}
/*
for (i = 0; i < TAMANHO_ARRAY; i++) {
for (j = 0; j < TAMANHO_ARRAY; j++) {
if ((i != j) && (numeros[i] == numeros[j])) {
contador[i]++;
}
}
}
for (i = 0; i < TAMANHO_ARRAY; i++) {
printf("Ocorrencias de numero no indice %d: %d\n", i, contador[i]);
}
*/
return 0;
}
|
the_stack_data/109141.c | #include <stdio.h>
#include <stdlib.h>
// Tree Node
typedef struct Node {
int data;
struct Node* left;
struct Node* right;
} NODE;
// Stack node
typedef struct Stack {
NODE* dataPtr;
struct Stack* nextStack;
} STACK;
// Create tree node
NODE* createNode(int data) {
NODE* head = (NODE*) malloc(sizeof(NODE));
head->data = data;
head->left = NULL;
head->right = NULL;
return head;
}
// Create Stack node
STACK* createStack(NODE* dataPtr) {
STACK* list = (STACK*) malloc(sizeof(STACK));
list->dataPtr = dataPtr;
list->nextStack = NULL;
return list;
}
// Insert Stack node
STACK* push(NODE* dataPtr, STACK* list) {
if (list == NULL) {
list = createStack(dataPtr);
// printf("Inside push %d ", (list->dataPtr)->data);
return list;
}
STACK* newNode = createStack(dataPtr);
newNode->nextStack = list;
list = newNode;
// printf("Inside push %d ", (list->dataPtr)->data);
return list;
}
// Remove Stack node
STACK* pop(STACK* list) {
if (list == NULL || list ->nextStack == NULL) {
free(list);
return NULL;
}
STACK* temp;
temp = list;
list = list->nextStack;
free(temp);
return list;
}
// Get top Stack node
NODE* peek(STACK* list) {
return list->dataPtr;
}
// Verify if stack is empty or not
int isEmpty(STACK* list) {
if (list == NULL) {
return 1;
} else {
return 0;
}
}
// Prints stack (just for testing)
void printStack(STACK* s) {
while(s != NULL) {
printf("%d -> ", (s->dataPtr)->data);
s = s->nextStack;
}
printf("\n");
}
// Prints spiral level order traversal of the Binary tree
void printSpiral(NODE* head) {
if (head == NULL) {
return;
}
STACK* s1 = NULL;
STACK* s2 = NULL;
// printf("Here");
s1 = push(head, s1);
// printStack(s1);
while (!isEmpty(s1) || !isEmpty(s2)) {
// Print nodes of current level from s1 and push nodes of
// next level to s2
while (!isEmpty(s1)) {
NODE* temp = peek(s1);
s1 = pop(s1);
printf("%d ", temp->data);
// Note that is right is pushed before left
if (temp->right)
s2 = push(temp->right, s2);
if (temp->left)
s2 = push(temp->left, s2);
}
// Print nodes of current level from s2 and push nodes of
// next level to s1
while (!isEmpty(s2)) {
NODE* temp = peek(s2);
s2 = pop(s2);
printf("%d ", temp->data);
// Note that is left is pushed before right
if (temp->left)
s1 = push(temp->left, s1);
if (temp->right)
s1 = push(temp->right, s1);
}
}
}
// main
int main()
{
// demo binary tree
NODE* root = createNode(1);
root->left = createNode(2);
root->right = createNode(3);
root->left->left = createNode(7);
root->left->right = createNode(6);
root->right->left = createNode(5);
root->right->right = createNode(4);
printf("Spiral Order traversal of binary tree is \n");
printSpiral(root);
return 0;
}
|
the_stack_data/26700288.c | struct Input {
int a;
int b;
int c;
int d;
};
struct Output {
int x;
};
void
outsource(struct Input *input, struct Output *output)
{
output->x = input->a ^ (input->b | (input->c & input->d));
output->x = output->x << 2;
}
|
the_stack_data/144116.c | #include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
uint32_t get_hash(char * str, int len, int range) {
if (str == NULL || len < 1 || range < 1) {
return 0;
}
// Based on
// http://en.wikipedia.org/wiki/MurmurHash
// But I am not sure if your key space will be evenly mapped to int32 space
// Things like md5 will be too slow..
uint32_t c1 = 0xcc9e2d51;
uint32_t c2 = 0x1b873593;
uint32_t r1 = 15;
uint32_t r2 = 13;
uint32_t m = 5;
uint32_t n = 0xe6546b64;
uint32_t h = 1;
uint32_t k = 0;
int i = 0;
int j = 0;
for (i = 0; i < len; i = i + 4) {
k = *((uint32_t*) (str + i));
k = k * c1;
k = (k << r1) | (k >> (32 - r1));
k = k * c2;
h = h ^ k;
h = (h << 2) | (h >> (32 - r2));
h = h * m + n;
len = len - 4;
}
uint32_t res = 0;
char *res_p = (char *) (&res);
for (i = i - 4, j = 1; i < len; i++, j++) {
*(res_p + (4 - j)) = str[i];
}
res = res * c1;
res = (res << r1) | (res >> (32 - r1));
res = res * c2;
h = h ^ res;
h = h ^ len;
h = h ^ (h >> 16);
h = h * 0x85ebca6b;
h = h ^ (h >> 13);
h = h * 0xc2b2ae35;
h = h ^ (h >> 16);
return h % range;
}
void generate_hash_ring(int **ring, int num_category, int num_replica) {
int ring_length = num_category * num_replica;
int i = 0, j = 0;
int tmp = 0;
srand(0); // so that restart will keep the consistency
*ring = malloc(sizeof(int) * (ring_length));
for (i = 0; i < ring_length; i++) {
(*ring)[i] = i + 1;
}
for (i = ring_length - 1; i > 0; i--) {
j = rand() % i;
tmp = (*ring)[j];
(*ring)[j] = (*ring)[i];
(*ring)[i] = tmp % num_category;
}
}
int get_category(int key, const int *ring, const int *downstream_error_count,
int threshold, int num_category, int num_replica) {
int i = 0, j = 0;
int ring_length = num_category * num_replica;
if (key >= ring_length) {
return -1;
}
for (i = key, j = ring_length;
downstream_error_count[ring[i]] > threshold && j > 0; j--) {
i++;
if (i == ring_length) {
i = 0;
}
}
if (j == 0) {
return -1;
}
return ring[i];
}
|
the_stack_data/183316.c | #include <stdio.h>
#include <string.h>
int main() {
int x=1, y=2;
int *p = &x + 1;
int *q = &y;
printf("Addresses: p=%p q=%p\n",(void*)p,(void*)q);
_Bool b = (p==q);
printf("(p==q) = %s\n", b?"true":"false");
return 0;
}
|
the_stack_data/26701100.c | // PARAM: --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'"
#include <stdlib.h>
#include <pthread.h>
typedef struct { int myint; pthread_mutex_t mymutex; } mystruct;
void lock(mystruct *s) { pthread_mutex_lock(&s->mymutex); }
void unlock(mystruct *s) { pthread_mutex_unlock(&s->mymutex); }
void *foo(void *arg) {
mystruct *s = (mystruct *) arg;
lock(s);
s->myint=s->myint+1;
unlock(s);
return NULL;
}
int main() {
mystruct *s = (mystruct *) malloc(sizeof(*s));
pthread_mutex_init(&s->mymutex, NULL);
pthread_t id1, id2;
pthread_create(&id1, NULL, foo, s);
pthread_create(&id2, NULL, foo, s);
pthread_join(id1, NULL);
pthread_join(id2, NULL);
}
|
the_stack_data/165768144.c | /*
* Copyright (c) 2001-2003 Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*
* This file is part of the lwIP TCP/IP stack.
*
* Author: Adam Dunkels <[email protected]>
*
*/
#ifndef linux /* Apparently, this doesn't work under Linux. */
#include "lwip/debug.h"
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/stat.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <pcap.h>
#include "netif/etharp.h"
#include "lwip/stats.h"
#include "lwip/def.h"
#include "lwip/mem.h"
#include "lwip/pbuf.h"
#include "lwip/sys.h"
#include "lwip/ip.h"
struct pcapif {
pcap_t *pd;
sys_sem_t sem;
u8_t pkt[2048];
u32_t len;
u32_t lasttime;
struct pbuf *p;
struct eth_addr *ethaddr;
};
static char errbuf[PCAP_ERRBUF_SIZE];
/*-----------------------------------------------------------------------------------*/
static err_t
pcapif_output(struct netif *netif, struct pbuf *p,
ip_addr_t *ipaddr)
{
return ERR_OK;
}
/*-----------------------------------------------------------------------------------*/
static void
timeout(void *arg)
{
struct netif *netif;
struct pcapif *pcapif;
struct pbuf *p;
struct eth_hdr *ethhdr;
netif = (struct netif *)arg;
pcapif = netif->state;
ethhdr = (struct eth_hdr *)pcapif->pkt;
if (lwip_htons(ethhdr->type) != ETHTYPE_IP ||
ip_lookup(pcapif->pkt + 14, netif)) {
/* We allocate a pbuf chain of pbufs from the pool. */
p = pbuf_alloc(PBUF_LINK, pcapif->len, PBUF_POOL);
if (p != NULL) {
pbuf_take(p, pcapif->pkt, pcapif->len);
ethhdr = p->payload;
switch (lwip_htons(ethhdr->type)) {
/* IP or ARP packet? */
case ETHTYPE_IP:
case ETHTYPE_ARP:
#if PPPOE_SUPPORT
/* PPPoE packet? */
case ETHTYPE_PPPOEDISC:
case ETHTYPE_PPPOE:
#endif /* PPPOE_SUPPORT */
/* full packet send to tcpip_thread to process */
if (netif->input(p, netif) != ERR_OK) {
LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n"));
pbuf_free(p);
p = NULL;
}
break;
default:
pbuf_free(p);
break;
}
}
} else {
printf("ip_lookup dropped\n");
}
sys_sem_signal(&pcapif->sem);
}
/*-----------------------------------------------------------------------------------*/
static void
callback(u_char *arg, const struct pcap_pkthdr *hdr, const u_char *pkt)
{
struct netif *netif;
struct pcapif *pcapif;
u32_t time, lasttime;
netif = (struct netif *)arg;
pcapif = netif->state;
pcapif->len = hdr->len;
bcopy(pkt, pcapif->pkt, hdr->len);
time = hdr->ts.tv_sec * 1000 + hdr->ts.tv_usec / 1000;
lasttime = pcapif->lasttime;
pcapif->lasttime = time;
if (lasttime == 0) {
sys_timeout(1000, timeout, netif);
} else {
sys_timeout(time - lasttime, timeout, netif);
}
}
/*-----------------------------------------------------------------------------------*/
static void
pcapif_thread(void *arg)
{
struct netif *netif;
struct pcapif *pcapif;
netif = arg;
pcapif = netif->state;
while (1) {
pcap_loop(pcapif->pd, 1, callback, (u_char *)netif);
sys_sem_wait(&pcapif->sem);
if (pcapif->p != NULL) {
netif->input(pcapif->p, netif);
}
}
}
/*-----------------------------------------------------------------------------------*/
err_t
pcapif_init(struct netif *netif)
{
struct pcapif *p;
p = malloc(sizeof(struct pcapif));
if (p == NULL)
return ERR_MEM;
netif->state = p;
netif->name[0] = 'p';
netif->name[1] = 'c';
netif->output = pcapif_output;
p->pd = pcap_open_offline("pcapdump", errbuf);
if (p->pd == NULL) {
printf("pcapif_init: failed %s\n", errbuf);
return ERR_IF;
}
if(sys_sem_new(&p->sem, 0) != ERR_OK) {
LWIP_ASSERT("Failed to create semaphore", 0);
}
p->p = NULL;
p->lasttime = 0;
sys_thread_new("pcapif_thread", pcapif_thread, netif, DEFAULT_THREAD_STACKSIZE, DEFAULT_THREAD_PRIO);
return ERR_OK;
}
/*-----------------------------------------------------------------------------------*/
#endif /* linux */
|
the_stack_data/117328473.c | #include <stdio.h>
int hello()
{
printf("Hello\n");
return 0;
}
|
the_stack_data/89199847.c | #include <term.h>
#define clr_bol tigetstr("el1")
/** clear to beginning of line, inclusive **/
/*
TERMINFO_NAME(el1)
TERMCAP_NAME(cb)
XOPEN(400)
*/
|
the_stack_data/220455242.c | int *twoSum(int *numbers, int numbersSize, int target, int *returnSize)
{
*returnSize = 2;
int i = 0;
int j = numbersSize - 1;
while (i < j)
{
int sum = numbers[i] + numbers[j];
if (sum == target)
{
int *a = (int *)malloc(sizeof(int) * 2);
a[0] = i + 1;
a[1] = j + 1;
return a;
}
sum < target ? i++ : j--;
}
return -1;
} |
the_stack_data/161080021.c | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#if defined(_WIN32) || defined(WIN32) || defined(WINDOWS)
#include <fcntl.h>
#include <io.h>
#endif
int
main(int argc, char *argv[])
{
char buf[1024];
size_t rec_len = 0;
const char *response_header = "Content-Type: text/plain\r\n"
"Connection: close\r\n"
"\r\n";
const char *req_method = getenv("REQUEST_METHOD");
const char *con_length = getenv("CONTENT_LENGTH");
#if defined(_WIN32) || defined(WIN32) || defined(WINDOWS)
_setmode(_fileno(stdin), _O_BINARY);
_setmode(_fileno(stdout), _O_BINARY);
#endif
/* Write the response header with \r\n */
fwrite(response_header, 1, strlen(response_header), stdout);
/* Headline for generated reply: */
printf("Got message:\n Method: %s\n Content-Length: %s\n Content: ",
req_method,
con_length ? con_length : "not set");
/* Read all data from stdin and send it to stdout */
while ((rec_len = fread(buf, 1, sizeof(buf) - 1, stdin)) > 0) {
fwrite(buf, 1, rec_len, stdout);
}
return 0;
}
|
the_stack_data/95463.c | // File: 2.63.c
// Author: iBug
unsigned srl(unsigned x, int k) {
/* Perform shift arithmetically */
unsigned xsra = (int) x >> k;
unsigned mask = (1 << (8 * sizeof(int) - k)) - 1;
return xsra & mask;
}
int sra(int x, int k) {
/* Perform shift logically */
int xsrl = (unsigned) x >> k;
/* Get MSB */
int msb = (unsigned) x >> (8 * sizeof(int) - 1);
int mask = ~(msb - 1) & ~((1U << (8 * sizeof(int) - k)) - 1);
return xsrl | mask;
}
|
the_stack_data/132990.c | /*
* startup.c
*
*/
__attribute__((naked)) __attribute__((section (".start_section")) )
void startup ( void )
{
__asm__ volatile(" LDR R0,=0x2001C000\n"); /* set stack */
__asm__ volatile(" MOV SP,R0\n");
__asm__ volatile(" BL main\n"); /* call main */
__asm__ volatile(".L1: B .L1\n"); /* never return */
}
__attribute__((naked)) setControlReg(unsigned int x)
{
__asm(
" MSR CONTROL,R0\n"
" BX LR\n"
);
}
/* ---- Registers - SYSCFG ---- */
#define SYSCFG 0x40013800
#define SYSCFG_EXTICR1 ((volatile unsigned short*) (SYSCFG + 8))
/* ---- Registers - GPIO ---- */
#define GPIO_D 0x40020C00
#define GPIO_D_MODER ((volatile unsigned int*) GPIO_D) // I/O config
#define GPIO_D_ODR_LOW ((volatile unsigned char*) (GPIO_D+0x14)) // The LOW values in the ODR, D0-7
#define GPIO_E 0x40021000
#define GPIO_E_MODER ((volatile unsigned int*) GPIO_E) // I/O config
#define GPIO_E_ODR_LOW ((volatile unsigned char*) (GPIO_E+0x14)) // Low E ODR
#define GPIO_E_IDR_LOW ((volatile unsigned char*) (GPIO_E+0x10)) // Low E IDR
/* ---- Registers - EXTI---- */
#define EXTI 0x40013C00
#define EXTI_IMR ((volatile unsigned short*) (EXTI))
#define EXTI_RTSR ((volatile unsigned short*) (EXTI + 8))
#define EXTI_FTSR ((volatile unsigned short*) (EXTI + 0xC))
#define EXTI_PR ((volatile unsigned short*) (EXTI + 0x14))
/* ---- Registers and definitions - Other ---- */
#define NVIC ((unsigned int *) 0xE000E100)
#define SCB_VTOR 0x2001C000
/* ---- Global variables---- */
static volatile int IRQ_count; // For the display count
static volatile int GPIO_E_IN;
void irq_handler(void){
GPIO_E_IN = *GPIO_E_IDR_LOW;
if(*EXTI_PR & (1<<3)){ // IF IRQ on EXTI3, (1<<3)
*EXTI_PR |= (1<<3); // Reset IRQ on EXTI3
switch(GPIO_E_IN){ // 9 = IRQ0, 10 = IRQ1, 12 = IRQ2
case 9: *GPIO_E_ODR_LOW |= (1<<4); // Reset IRQ0. First write 1...
*GPIO_E_ODR_LOW &= ~(1<<4); // ... then write 0
IRQ_count++;
break;
case 10: *GPIO_E_ODR_LOW |= (1<<5); // Reset IRQ1
*GPIO_E_ODR_LOW &= ~(1<<5);
IRQ_count = 0;
break;
case 12: *GPIO_E_ODR_LOW |= (1<<6); // Reset IRQ2
*GPIO_E_ODR_LOW &= ~(1<<6);
if(IRQ_count){
IRQ_count = 0; // Turn off disp
}else{
IRQ_count = 0xFF; // Turn on disp
}
break;
default:
break;
}
}
}
void app_init(void){
*GPIO_D_MODER = 0x00005555; // Set low D to output for the display
*GPIO_E_MODER = 0x00005500; // Set 2nd lowest byte on port E to output for reseting the IRQs
*SYSCFG_EXTICR1 &= ~0xF000; // Zero EXTI3 (highest byte in SYSCFG)
*SYSCFG_EXTICR1 |= 0x4000; // Connect PE3 to EXTI3 (low GPIO E)
*EXTI_IMR |= (1<<3); // Allow EXTI3 to generate interuptions ...
*EXTI_RTSR |= (1<<3); // ... on positive flank ...
*EXTI_FTSR &= ~(1<<3); // ... not on negative flank
*((void (**) (void) ) (SCB_VTOR + 0x64)) = irq_handler; // Assign irq handler with offset (0x64 for EXTI3)
*NVIC |= (1<<9); // Pass irqs from EXTI3 to the cpu. 9 = EXTI3 in the vector table
}
void main(void)
{
app_init();
// Update the display forever
while(1){
*GPIO_D_ODR_LOW = IRQ_count;
}
}
|
the_stack_data/68888167.c | #include <stdio.h>
/* count digits, white space, others */ main()
{
int c, i, nwhite, nother; int ndigit[10];
nwhite = nother = 0; for (i = 0; i < 10; ++i) ndigit[i] = 0;
while ((c = getchar()) != EOF)
if (c >= '0' && c <= '9')
++ndigit[c-'0'];
else if (c == ' '|| c == '\n'|| c == '\t')
++nwhite;
else
++nother;
printf("digits=");
for (i = 0; i < 10; ++i)
printf("%d", ndigit[i]);
printf(", white space = %d, other = %d\n", nwhite, nother);
}
|
the_stack_data/156392669.c | /* Generated by CIL v. 1.7.0 */
/* print_CIL_Input is false */
struct _IO_FILE;
struct timeval;
extern float strtof(char const *str , char const *endptr ) ;
extern void signal(int sig , void *func ) ;
typedef struct _IO_FILE FILE;
extern int atoi(char const *s ) ;
extern double strtod(char const *str , char const *endptr ) ;
extern int fclose(void *stream ) ;
extern void *fopen(char const *filename , char const *mode ) ;
extern void abort() ;
extern void exit(int status ) ;
extern int raise(int sig ) ;
extern int fprintf(struct _IO_FILE *stream , char const *format , ...) ;
extern int strcmp(char const *a , char const *b ) ;
extern int rand() ;
extern unsigned long strtoul(char const *str , char const *endptr , int base ) ;
void RandomFunc(unsigned short input[1] , unsigned short output[1] ) ;
extern int strncmp(char const *s1 , char const *s2 , unsigned long maxlen ) ;
extern int gettimeofday(struct timeval *tv , void *tz , ...) ;
extern int printf(char const *format , ...) ;
int main(int argc , char *argv[] ) ;
void megaInit(void) ;
extern unsigned long strlen(char const *s ) ;
extern long strtol(char const *str , char const *endptr , int base ) ;
extern unsigned long strnlen(char const *s , unsigned long maxlen ) ;
extern void *memcpy(void *s1 , void const *s2 , unsigned long size ) ;
struct timeval {
long tv_sec ;
long tv_usec ;
};
extern void *malloc(unsigned long size ) ;
extern int scanf(char const *format , ...) ;
int main(int argc , char *argv[] )
{
unsigned short input[1] ;
unsigned short output[1] ;
int randomFuns_i5 ;
unsigned short randomFuns_value6 ;
int randomFuns_main_i7 ;
{
megaInit();
if (argc != 2) {
printf("Call this program with %i arguments\n", 1);
exit(-1);
} else {
}
randomFuns_i5 = 0;
while (randomFuns_i5 < 1) {
randomFuns_value6 = (unsigned short )strtoul(argv[randomFuns_i5 + 1], 0, 10);
input[randomFuns_i5] = randomFuns_value6;
randomFuns_i5 ++;
}
RandomFunc(input, output);
if (output[0] == 51996) {
printf("You win!\n");
} else {
}
randomFuns_main_i7 = 0;
while (randomFuns_main_i7 < 1) {
printf("%u\n", output[randomFuns_main_i7]);
randomFuns_main_i7 ++;
}
}
}
void megaInit(void)
{
{
}
}
void RandomFunc(unsigned short input[1] , unsigned short output[1] )
{
unsigned short state[1] ;
char copy14 ;
{
state[0UL] = (input[0UL] + 914778474UL) - (unsigned short)29623;
if (state[0UL] & (unsigned short)1) {
if (state[0UL] & (unsigned short)1) {
if (state[0UL] & (unsigned short)1) {
state[0UL] += state[0UL];
state[0UL] += state[0UL];
}
} else {
state[0UL] += state[0UL];
}
} else {
state[0UL] += state[0UL];
copy14 = *((char *)(& state[0UL]) + 0);
*((char *)(& state[0UL]) + 0) = *((char *)(& state[0UL]) + 1);
*((char *)(& state[0UL]) + 1) = copy14;
}
output[0UL] = (state[0UL] + 745047566UL) + (unsigned short)27843;
}
}
|
the_stack_data/87637844.c | typedef float floatvect2 __attribute__((mode(V2SF)));
typedef union
{
floatvect2 vector;
float f[2];
}resfloatvect2;
void tempf(float *x, float *y)
{
floatvect2 temp={x[0],x[1]};
floatvect2 temp1={y[0],y[1]};
resfloatvect2 temp2;
temp2.vector=temp+temp1;
x[0]=temp2.f[0];
x[1]=temp2.f[1];
}
|
the_stack_data/218894331.c | /*
* CSMAWithPCASlotted.c
*
* Created on: Jan 10, 2017
* Author: Kiran
*/
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#include<math.h>
#define t 40000000 // Simulation duration in backoff slots
#define node_num 40 //No. of nodes
#define pkt 6 //Packet lenght in backoff slots
#define ack 1 // ACK length in backoff slots
#define Wmax 3 // Maximum backoff window size for PCA - 2^(macMinBE-1)-1
#define debugEn 0 // For debugging of the state model over time. Will generate log file of huge size, hence do not enable until necessary
int h = 1, macMinBE = 3, macMaxBE = 8, maxBackoffStages = 5, n_b = 1, critDelay = 16; //// macMinBE - Min. Backoff Exponent, macMaxBE - Max. Backoff Exponent, maxBackoffStages - Max. Backoff Stages, n_b - Maximum no. of retransmissions allowed, critDelay - Critical delay for PCA packet
int qStateInd[node_num], csmaStateInd[node_num];
int wakeCount[node_num];
int qSlot[node_num];
int pcaInd[node_num];
int w[node_num], m[node_num], n[node_num];
int inB000[node_num], channel[node_num][pkt + ack + 2];
int in_alpha[node_num], in_beta[node_num], fail_alpha[node_num],
fail_beta[node_num], succ_beta[node_num];
int out_fail_csma_backoff[node_num], out_fail_csma_retry[node_num],
out_succ[node_num], in[node_num], inPr[node_num];
int delayCsma[node_num], delay[node_num], delayPr[node_num], delayPCA[node_num];
int delayMeasure[node_num], inSleep[node_num];
int bPCA[node_num][Wmax], inAlphaPCA[node_num][Wmax],
succAlphaPCA[node_num][Wmax], failAlphaPCA[node_num][Wmax],
succTxdPCA[node_num], collTxdPCA[node_num], inBetaPCA[node_num],
failBetaPCA[node_num], succBetaPCA[node_num], failDelExp[node_num];
float eta = 0.007; // Packet availability probability
float hPrior = 0.1; // Probability of available packet being priority packet (PCA)
int varMax = 1, iterMax = 1;
FILE *fp_r, *fp_al, *fp_be, *fp_booo, *fp_T, *fp_debug, *fp_delay,
*fp_pca, *fp_power;
int Dsleep[node_num], Didle[node_num], Dtx[node_num], Drx[node_num];
float Psleep = 0.00026, Pidle=0.16, Prx=0.17, Ptx=0.16; // Power consumption in different states of the node
void initPCA() {
int i = 0, j = 0;
for (i = 0; i < node_num; i++) {
for (j = 0; j < Wmax; j++) {
bPCA[i][j] = 0;
inAlphaPCA[i][j] = 0;
failAlphaPCA[i][j] = 0;
succAlphaPCA[i][j] = 0;
}
succTxdPCA[i] = 0;
collTxdPCA[i] = 0;
failDelExp[i]=0;
inBetaPCA[i] = 0;
failBetaPCA[i] = 0;
succBetaPCA[i] = 0;
delayMeasure[i] = 0;
delayPCA[i] = 0;
}
}
void initIter() {
int i = 0, j = 0;
srand(0);
for (i = 0; i < node_num; i++) {
qStateInd[i] = 1;
qSlot[i] = 0;
csmaStateInd[i] = 0;
wakeCount[i] = 0;
inSleep[i] = 0;
m[i] = 0;
n[i] = 0;
w[i] = 0;
in[i] = 0;
inPr[i] = 0;
inB000[i] = 0;
in_alpha[i] = 0;
in_beta[i] = 0;
fail_alpha[i] = 0;
fail_beta[i] = 0;
succ_beta[i] = 0;
out_fail_csma_backoff[i] = 0;
out_fail_csma_retry[i] = 0;
out_succ[i] = 0;
delayCsma[i] = 0;
delay[i] = 0;
delayPr[i] = 0;
for (j = 0; j <= pkt + ack + 1; j++) {
channel[i][j] = 0;
}
}
}
int csma_sense() {
int i, j = 0;
for (i = 0; i < node_num; i++) {
j = channel[i][0] + j;
if (j > 0) {
return (0);
}
}
return (1);
}
float randNum_0_1() {
float randNum = (double) rand() / (double) ((unsigned)RAND_MAX);
return randNum;
}
int power(int a, int b) {
int j;
int c = 1;
for (j = 0; j < b; j++)
c = c * a;
return (c);
}
int MIN(int a, int b) {
int c;
c = (((a) < (b)) ? (a) : (b));
return (c);
}
int MAX(int a, int b) {
int c;
c = (((a) > (b)) ? (a) : (b));
return (c);
}
int randPCABackOffSlot(int m) {
return rand() / (RAND_MAX/(Wmax-1));
}
int randBackOffSlot(int m) {
return rand() /(RAND_MAX/(power(2, MIN(macMaxBE, macMinBE + m))-1));
}
void classifyPkt(int node) {
if (randNum_0_1() <= hPrior) {
csmaStateInd[node] = 1;
pcaInd[node] = 1;
m[node] = 0;
w[node] = randPCABackOffSlot(MAX(1, macMaxBE - 1));
n[node] = 0;
qStateInd[node] = 0;
inPr[node] = inPr[node] + 1;
delayPr[node] = 0;
delayMeasure[node] = 0;
} else {
csmaStateInd[node] = 1;
pcaInd[node] = 0;
m[node] = 0;
w[node] = randBackOffSlot(m[node]);
n[node] = 0;
qStateInd[node] = 0;
in[node] = in[node] + 1;
delay[node] = -1;
}
}
void leafNode(int node) {
if (qStateInd[node] == 1) {
Didle[node]++;
inSleep[node]++;
if (qSlot[node] < h) {
qSlot[node] = qSlot[node] + 1;
if (qSlot[node] == h) {
wakeCount[node] = wakeCount[node] + 1;
if (randNum_0_1() <= eta) {
classifyPkt(node);
} else {
qSlot[node] = 0;
}
}
}
} else if (csmaStateInd[node] == 1) {
if (pcaInd[node] == 0) {
delay[node] = delay[node] + 1;
// CCA Contention slots
if ((w[node] == 0) && (m[node] == 0) && (n[node] == 0)) {
inB000[node] = inB000[node] + 1;
}
if ((w[node] == 0) && (m[node] != -1) && (m[node] != -2)) {
Drx[node]++;
in_alpha[node] = in_alpha[node] + 1;
if (csma_sense() > 0) {
w[node] = -1;
} else {
fail_alpha[node] = fail_alpha[node] + 1;
if (m[node] < maxBackoffStages) {
m[node] = m[node] + 1;
w[node] = randBackOffSlot(m[node]);
} else {
wakeCount[node] = wakeCount[node] + 1;
if (randNum_0_1() <= eta) {
classifyPkt(node);
} else {
qSlot[node] = 0;
qStateInd[node] = 1;
csmaStateInd[node] = 0;
}
out_fail_csma_backoff[node] =
out_fail_csma_backoff[node] + 1;
}
}
}
else if ((w[node] == -1) && (m[node] != -1) && (m[node] != -2)) {
Drx[node]++;
in_beta[node] = in_beta[node] + 1;
if (csma_sense()) {
succ_beta[node] = succ_beta[node] + 1;
channel[node][1] = 1;
} else {
fail_beta[node] = fail_beta[node] + 1;
if (m[node] < maxBackoffStages) {
m[node] = m[node] + 1;
w[node] = randBackOffSlot(m[node]);
} else {
wakeCount[node] = wakeCount[node] + 1;
if (randNum_0_1() <= eta) {
classifyPkt(node);
} else {
qSlot[node] = 0;
qStateInd[node] = 1;
csmaStateInd[node] = 0;
}
out_fail_csma_backoff[node] =
out_fail_csma_backoff[node] + 1;
}
}
} else if ((w[node] > 0) && (m[node] != -1) && (m[node] != -2)) {
Didle[node]++;
w[node] = w[node] - 1;
} else if (m[node] == -2) {
Dtx[node]++;
if (w[node] > 1)
w[node] = w[node] - 1;
else {
Dtx[node] = Dtx[node] - 2;
Didle[node]++;
Drx[node]++;
if (n[node] < n_b) {
m[node] = 0;
w[node] = randBackOffSlot(m[node]);
n[node] = n[node] + 1;
} else {
wakeCount[node] = wakeCount[node] + 1;
if (randNum_0_1() <= eta) {
classifyPkt(node);
} else {
qSlot[node] = 0;
qStateInd[node] = 1;
csmaStateInd[node] = 0;
}
out_fail_csma_retry[node] = out_fail_csma_retry[node]
+ 1;
}
}
} else if (m[node] == -1) {
Dtx[node]++;
if (w[node] > 1)
w[node] = w[node] - 1;
else {
Dtx[node] = Dtx[node] - 2;
Didle[node]++;
Drx[node]++;
wakeCount[node] = wakeCount[node] + 1;
delayCsma[node] = delayCsma[node] + delay[node];
if (randNum_0_1() <= eta) {
classifyPkt(node);
} else {
qSlot[node] = 0;
qStateInd[node] = 1;
csmaStateInd[node] = 0;
}
out_succ[node] = out_succ[node] + 1;
}
}
} // End of CSMA/CA flow
else { // Start of PCA flow
delayMeasure[node] = delayMeasure[node]+1;
delayPr[node] = delayPr[node] + 1;
if (delayMeasure[node] >= critDelay && (m[node]!=-1 && m[node]!=-2)) {
failDelExp[node]++;
if (randNum_0_1() <= eta) {
classifyPkt(node);
} else {
qSlot[node] = 0;
qStateInd[node] = 1;
csmaStateInd[node] = 0;
pcaInd[node]=0;
}
} else {
if (w[node] >= 0 && m[node] == 0) {
Drx[node]++;
bPCA[node][w[node]] = bPCA[node][w[node]] + 1;
in_alpha[node]++;
inAlphaPCA[node][w[node]] = inAlphaPCA[node][w[node]] + 1;
if (csma_sense()) {
succAlphaPCA[node][w[node]] =
succAlphaPCA[node][w[node]] + 1;
w[node] = w[node] - 1;
} else {
fail_alpha[node]++;
failAlphaPCA[node][w[node]] =
failAlphaPCA[node][w[node]] + 1;
}
} else if (w[node] == -1 && m[node] == 0) {
Drx[node]++;
inBetaPCA[node] = inBetaPCA[node] + 1;
in_beta[node]++;
if (csma_sense()) {
succ_beta[node]++;
succBetaPCA[node] = succBetaPCA[node] + 1;
channel[node][1] = 1;
} else {
fail_beta[node]++;
failBetaPCA[node] = failBetaPCA[node] + 1;
w[node] = 0;
}
} else if (m[node] == -1) {
Dtx[node]++;
if (w[node] > 1) {
w[node] = w[node] - 1;
} else {
Dtx[node] = Dtx[node] - 2;
Didle[node]++;
Drx[node]++;
delayPCA[node] = delayPCA[node] + delayPr[node];
succTxdPCA[node] = succTxdPCA[node] + 1;
qStateInd[node] = 1;
csmaStateInd[node] = 0;
if (randNum_0_1() <= eta) {
classifyPkt(node);
} else {
qSlot[node] = 0;
qStateInd[node] = 1;
csmaStateInd[node] = 0;
pcaInd[node]=0;
}
}
} else if (m[node] == -2) {
Dtx[node]++;
if (w[node] > 1) {
w[node] = w[node] - 1;
} else {
Dtx[node] = Dtx[node] - 2;
Didle[node]++;
Drx[node]++;
collTxdPCA[node] = collTxdPCA[node] + 1;
qStateInd[node] = 1;
csmaStateInd[node] = 0;
if (randNum_0_1() <= eta) {
classifyPkt(node);
} else {
qSlot[node] = 0;
qStateInd[node] = 1;
csmaStateInd[node] = 0;
pcaInd[node]=0;
}
}
}
}
}
}
}
void sense_collission() {
int i, j = 0, k, l, n_u;
for (i = 0; i < node_num; i++) {
j = channel[i][1] + j;
if (channel[i][1])
n_u = i;
}
if (j > 1) {
for (k = 0; k < node_num; k++) {
if (channel[k][1] && m[k] != -2 && csmaStateInd[k] == 1
&& m[k] != -1) {
m[k] = -2;
w[k] = pkt + ack + 1;
for (l = 1; l <= pkt; l++)
channel[k][l] = 1;
for (l = pkt + 1; l <= pkt + ack + 1; l++)
channel[k][l] = 0;
}
}
} else if ((j == 1)) {
if ((w[n_u] == -1) && (csmaStateInd[n_u] == 1) && m[n_u] != -1
&& m[n_u] != -2) {
m[n_u] = -1;
w[n_u] = pkt + ack + 1;
for (l = 1; l <= pkt; l++)
channel[n_u][l] = 1;
channel[n_u][pkt + 1] = 0;
for (l = pkt + 2; l <= pkt + ack + 1; l++)
channel[n_u][l] = 1;
}
}
}
void shifter() {
int j, k;
for (j = 0; j < node_num; j++) {
for (k = 0; k <= pkt + ack; k++) {
channel[j][k] = channel[j][k + 1];
}
channel[j][pkt + ack + 1] = 0;
}
}
void logResult() {
int j;
for (j = 0; j < node_num; j++) {
fprintf(fp_pca, "Node: %d Stats - PCA Reliability: %f\n", j+1, (float) (succTxdPCA[j]) / (inPr[j]));
fprintf(fp_al, "Node: %d Stats - CCA1 Failure/Busy Probability: %f\n", j+1, (float)fail_alpha[j]/in_alpha[j]);
fprintf(fp_be, "Node: %d Stats - CCA2 Failure/Busy Probability: %f\n", j+1, (float) fail_beta[j] / in_beta[j]);
fprintf(fp_booo, "Node: %d Stats - Probability of node residing in state (0,0,0): %f\n", j+1, (float) inB000[j] / t);
fprintf(fp_T, "Node: %d Stats - Probability of node attempting CCA1 (i,0,j): %f\n", j+1, (float) in_alpha[j] / t);
fprintf(fp_delay, "Node: %d Stats - Delay for successful packet transmission (CSMA): %f\t Delay for successful packet transmission (PCA): %f;\n", j+1, (float) delayCsma[j] / out_succ[j], (float) delayPCA[j] / succTxdPCA[j]);
fprintf(fp_r,"Node: %d Stats - CSMA Reliability: %f\n", j+1, (float)(out_succ[j])/(in[j]));
fprintf(fp_power,"Node: %d Stats - Average Power Consumption (W): %f\n", j+1, (float)(Didle[j]*Psleep + Dtx[j]*Ptx + Drx[j]*Prx)/t);
}
}
void debugGen(int time) {
int i = 0;
for (i = 0; i < node_num; i++) {
fprintf(fp_debug,
"{t:%d|I:%d|I_N:%d|C:%d|P:%d|m:%d|w:%d|n:%d|ch:%d|be:%d|fai:%d}\t",
time, qStateInd[i], qSlot[i], csmaStateInd[i], pcaInd[i], m[i],
w[i], n[i], channel[i][0], delay[i], fail_beta[i]);
}
fprintf(fp_debug, "\n");
}
int main() {
int i, j, iter, var;
// File pointer initializations
fp_r = fopen("/results/CSMA Reliability.txt", "w");
fp_al = fopen("/results/CCA1 Fail Probabilities.txt", "w");
fp_be = fopen("/results/CCA2 Fail Probabilities.txt", "w");
fp_booo = fopen("/results/b000 Probabilities.txt", "w");
fp_T = fopen("/results/Tau Probabilities.txt", "w");
fp_debug = fopen("/results/Debug.txt", "w");
fp_delay = fopen("/results/Packet Delay.txt", "w");
fp_pca = fopen("/results/PCA Stats.txt", "w");
fp_power = fopen("/results/Power.txt", "w");
setvbuf(stdout, NULL, _IONBF, 0);
printf("Process Started for IEEE 802.15.4-2015 Standard\n");
for (var = 0; var < varMax; var++) {
for (iter = 0; iter < iterMax; iter++) {
initIter();
initPCA();
printf("\nProgress %d-%d\n", var, iter);
for (i = 0; i < t; i++) {
if (debugEn)
debugGen(i);
for (j = 0; j < node_num; j++) {
leafNode(j);
}
sense_collission();
shifter();
}
}
logResult();
printf("Time: %d", i);
}
printf("\n*************--Process Completed--***************\n");
return (1);
}
|
the_stack_data/179831060.c | // This file is part of CPAchecker,
// a tool for configurable software verification:
// https://cpachecker.sosy-lab.org
//
// SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>
//
// SPDX-License-Identifier: Apache-2.0
#include <stdlib.h>
int square(x){
return (x*x);
}
int cube(x){
return (x*x*x);
}
int main(void) {
int counter;
int x = 3;
for (counter = square(x); counter < 5; counter = cube(counter)) {
int a = 0;
}
for (x = 2; x < 5; x = cube(x)) {
int a = 0;
}
return (0);
}
|
the_stack_data/75125.c | /* Test for flexible array members. Test for where structures with
such members may not occur. */
/* Origin: Joseph Myers <[email protected]> */
/* { dg-do compile } */
/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
struct flex { int a; int b[]; };
union rf1 { struct flex a; int b; };
union rf2 { int a; struct flex b; };
union rf3 { int a; union rf1 b; };
union rf4 { union rf2 a; int b; };
/* The above structure and unions may not be members of structures or
elements of arrays (6.7.2.1#2). */
struct t0 { struct flex a; }; /* { dg-bogus "warning" "warning in place of error" } */
/* { dg-error "invalid use of structure" "struct in struct" { target *-*-* } 16 } */
struct t1 { union rf1 a; }; /* { dg-bogus "warning" "warning in place of error" } */
/* { dg-error "invalid use of structure" "union in struct" { target *-*-* } 18 } */
struct t2 { union rf2 a; }; /* { dg-bogus "warning" "warning in place of error" } */
/* { dg-error "invalid use of structure" "union in struct" { target *-*-* } 20 } */
struct t3 { union rf3 a; }; /* { dg-bogus "warning" "warning in place of error" } */
/* { dg-error "invalid use of structure" "recursive union in struct" { target *-*-* } 22 } */
struct t4 { union rf4 a; }; /* { dg-bogus "warning" "warning in place of error" } */
/* { dg-error "invalid use of structure" "recursive union in struct" { target *-*-* } 24 } */
void f0 (struct flex[]); /* { dg-bogus "warning" "warning in place of error" } */
/* { dg-error "invalid use of structure" "struct in array" { target *-*-* } 27 } */
void f1 (union rf1[]); /* { dg-bogus "warning" "warning in place of error" } */
/* { dg-error "invalid use of structure" "union in array" { target *-*-* } 29 } */
void f2 (union rf2[]); /* { dg-bogus "warning" "warning in place of error" } */
/* { dg-error "invalid use of structure" "union in array" { target *-*-* } 31 } */
void f3 (union rf3[]); /* { dg-bogus "warning" "warning in place of error" } */
/* { dg-error "invalid use of structure" "recursive union in array" { target *-*-* } 33 } */
void f4 (union rf4[]); /* { dg-bogus "warning" "warning in place of error" } */
/* { dg-error "invalid use of structure" "recursive union in array" { target *-*-* } 35 } */
struct flex a0[1]; /* { dg-bogus "warning" "warning in place of error" } */
/* { dg-error "invalid use of structure" "struct in array" { target *-*-* } 38 } */
union rf1 a1[1]; /* { dg-bogus "warning" "warning in place of error" } */
/* { dg-error "invalid use of structure" "union in array" { target *-*-* } 40 } */
union rf2 a2[1]; /* { dg-bogus "warning" "warning in place of error" } */
/* { dg-error "invalid use of structure" "union in array" { target *-*-* } 42 } */
union rf3 a3[1]; /* { dg-bogus "warning" "warning in place of error" } */
/* { dg-error "invalid use of structure" "recursive union in array" { target *-*-* } 44 } */
union rf4 a4[1]; /* { dg-bogus "warning" "warning in place of error" } */
/* { dg-error "invalid use of structure" "recursive union in array" { target *-*-* } 46 } */
|
the_stack_data/52663.c | /**
******************************************************************************
* @file main.c
* @author Auto-generated by STM32CubeIDE
* @version V1.0
* @brief Default main function.
******************************************************************************
*/
#include<stdint.h>
int main(void)
{
uint32_t *pClkCtrlReg = (uint32_t*)0x40023830;
uint32_t *pPortDModeReg = (uint32_t*)0x40020C00;
uint32_t *pPortDOutReg = (uint32_t*)0x40020C14;
//1. enable the clock for GPOID peripheral in the AHB1ENR (SET the 3rd bit position)
*pClkCtrlReg |= ( 1 << 3);
//2. configure the mode of the IO pin as output
//a. clear the 24th and 25th bit positions (CLEAR)
*pPortDModeReg &= ~( 3 << 24);
//b. make 24th bit position as 1 (SET)
*pPortDModeReg |= ( 1 << 24);
while(1)
{
//3.SET 12th bit of the output data register to make I/O pin-12 as HIGH
*pPortDOutReg |= ( 1 << 12);
//introduce small human observable delay
//This loop executes for 10K times
for(uint32_t i=0 ; i < 300000 ; i++ );
//Tun OFF the LED
*pPortDOutReg &= ~( 1 << 12);
for(uint32_t i=0 ; i < 300000 ; i++ );
}
}
|
the_stack_data/70450575.c | /*
* network.c
*/
#ifdef CHANGED_3
#include "net/socket.h"
#include "net/pop.h"
#include "kernel/assert.h"
#include "test_network.h"
/*same as in yams.conf but converted to dec*/
#define NADDR 251728436
/*same as in yams2.conf but converted to dec*/
#define NADDR2 251728437
#define LOOPSIZE 10
uint16_t port1 = 9191;
uint16_t port2 = 9192;
/*acts as a counter, if >0 tests are still running and we don't terminate*/
int finished = 0;
/*reads hwaddr and mtu of the nic device
*specified in yams.conf
*meant to run as a unit test on a single buenos/yams
*/
static void test_nicIOArea() {
device_t *dev = device_get(YAMS_TYPECODE_NIC, 0);
gnd_t *gnd = dev->generic_device;
int mac = gnd->hwaddr(gnd);
int mtu = gnd->frame_size(gnd);
KERNEL_ASSERT(mac == 251728436);
KERNEL_ASSERT(mtu == 1324);
}
static void write_bytes_thread(uint32_t dummy) {
dummy = dummy;
write_to_network_test(port1, port2);
}
static void receive_bytes_thread(uint32_t dummy) {
finished++;
dummy = dummy;
receive_from_network_test(port1, port2);
finished--;
}
/*write bytes to socket
* meant to interract with other buenos instances
*/
void write_to_network_test(uint16_t port1, uint16_t port2) {
int i;
sock_t s = socket_open(PROTOCOL_POP, port1);
kprintf("Socket created to port: %d\n", port1);
char msg[] = "aaa";
for (i = 0; i < LOOPSIZE; i++) {
int n = socket_sendto(s, NETWORK_BROADCAST_ADDRESS, port2, msg, 10);
msg[0]++;
kprintf("wrote max %d chars to socket\n", n);
thread_sleep(1000);
}
}
/*read bytes from socket
*meant to interract with other buenos instances
*/
void receive_from_network_test(uint16_t port1, uint16_t port2) {
char buf[100];
char expectedmsg[] = "aaa";
int readed;
network_address_t naddr = NADDR;
sock_t s = socket_open(PROTOCOL_POP, port2);
kprintf("Socket created to port: %d\n", port2);
kprintf("Waiting to receive packets\n");
int i;
for (i = 0; i < LOOPSIZE; i++) {
socket_recvfrom(s, &naddr, &port1, buf, 10, &readed);
kprintf("Packet received: %s\n", buf);
KERNEL_ASSERT(buf[0] == expectedmsg[0]);
KERNEL_ASSERT(buf[1] == expectedmsg[1]);
KERNEL_ASSERT(buf[2] == expectedmsg[2]);
expectedmsg[0]++;
}
/*the test is now finished*/
}
void test_send_receive() {
/*two threads inside the same buenos send and receive packets*/
TID_t tid = thread_create(&receive_bytes_thread, 0);
thread_run(tid);
TID_t tid2 = thread_create(&write_bytes_thread, 0);
thread_run(tid2);
}
static void test_multiple_send_receive() {
port1 = 7071;
port2 = 7072;
test_send_receive();
thread_sleep(2000);
port1 = 7171;
port2 = 7172;
test_send_receive();
}
void run_nic_tests() {
test_nicIOArea();
kprintf("nicIOArea test finished without errors\n");
/*two threads inside the same buenos
* one sends and one receives packets*/
kprintf("starting test_send_receive\n");
test_send_receive();
thread_sleep(1000);
/*sleep until test is finished*/
while (finished > 0) {
thread_sleep(1000);
}
kprintf("test_send_receive finished without errors\n");
/*more complex test where multiple thread sends
and received to multiple ports
total 2 senders and 2 receivers */
kprintf("starting test_multiple_send_receive\n");
test_multiple_send_receive();
/*sleep until test is finished*/
while (finished > 0) {
thread_sleep(1000);
}
kprintf("test_multiple_send_receive finished without errors\n");
}
#endif
|
the_stack_data/33990.c | /* ACM 305 Joseph
* mythnc
* 2011/12/01 17:04:37
* version 2.b
* start from 1 not zero
* run time:
*/
#include <stdio.h>
int findm(int);
int main(void)
{
int k;
while (scanf("%d", &k) && k != 0)
printf("%d\n", findm(k));
return 0;
}
/* findm: return minimum m */
int findm(int k)
{
int m, re, position;
for (m = k + 1; ; m++) {
for (re = 2 * k, position = 0; re > k; re--) {
if (position == 0)
position = m % re;
else
position = (position + m - 1) % re;
if (position <= k && position != 0)
break;
}
if (re == k)
return m;
}
}
|
the_stack_data/194463.c | #include <math.h>
#include <stdlib.h>
#include <stdio.h>
void rand_point(int* x, int* y, int* z){
*x = rand()%10;
*y = rand()%10;
*z = rand()%10;
}
void main() {
srand(time(0)); //set the seed of the program to currest system time, so random give dif values each time
int x,y,z;
rand_point(&x, &y, &z);
printf("point: %d, %d, %d\n", x, y, z);
}
|
the_stack_data/29825408.c | #pragma merger("0","/tmp/cil-CeWz0YjG.i","")
# 1 "./linear-algebra/kernels/trisolv/trisolv.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<command-line>" 2
# 1 "./linear-algebra/kernels/trisolv/trisolv.c"
# 1 "/usr/include/stdio.h" 1 3 4
# 27 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 461 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 452 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 453 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 454 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 462 "/usr/include/features.h" 2 3 4
# 485 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 486 "/usr/include/features.h" 2 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 2 3 4
# 28 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/9/include/stddef.h" 1 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/9/include/stddef.h" 3 4
# 209 "/usr/lib/gcc/x86_64-linux-gnu/9/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 34 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/9/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/9/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 37 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4
# 29 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
typedef unsigned char __u_char;
typedef unsigned short int __u_short;
typedef unsigned int __u_int;
typedef unsigned long int __u_long;
typedef signed char __int8_t;
typedef unsigned char __uint8_t;
typedef signed short int __int16_t;
typedef unsigned short int __uint16_t;
typedef signed int __int32_t;
typedef unsigned int __uint32_t;
typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;
typedef __int8_t __int_least8_t;
typedef __uint8_t __uint_least8_t;
typedef __int16_t __int_least16_t;
typedef __uint16_t __uint_least16_t;
typedef __int32_t __int_least32_t;
typedef __uint32_t __uint_least32_t;
typedef __int64_t __int_least64_t;
typedef __uint64_t __uint_least64_t;
typedef long int __quad_t;
typedef unsigned long int __u_quad_t;
typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4
# 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef int __daddr_t;
typedef int __key_t;
typedef int __clockid_t;
typedef void * __timer_t;
typedef long int __blksize_t;
typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;
typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;
typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;
typedef long int __fsword_t;
typedef long int __ssize_t;
typedef long int __syscall_slong_t;
typedef unsigned long int __syscall_ulong_t;
typedef __off64_t __loff_t;
typedef char *__caddr_t;
typedef long int __intptr_t;
typedef unsigned int __socklen_t;
typedef int __sig_atomic_t;
# 39 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 1 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 1 3 4
# 13 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 3 4
typedef struct
{
int __count;
union
{
unsigned int __wch;
char __wchb[4];
} __value;
} __mbstate_t;
# 6 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 2 3 4
typedef struct _G_fpos_t
{
__off_t __pos;
__mbstate_t __state;
} __fpos_t;
# 40 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 3 4
typedef struct _G_fpos64_t
{
__off64_t __pos;
__mbstate_t __state;
} __fpos64_t;
# 41 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__FILE.h" 1 3 4
struct _IO_FILE;
typedef struct _IO_FILE __FILE;
# 42 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/FILE.h" 1 3 4
struct _IO_FILE;
typedef struct _IO_FILE FILE;
# 43 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 3 4
struct _IO_FILE;
struct _IO_marker;
struct _IO_codecvt;
struct _IO_wide_data;
typedef void _IO_lock_t;
struct _IO_FILE
{
int _flags;
char *_IO_read_ptr;
char *_IO_read_end;
char *_IO_read_base;
char *_IO_write_base;
char *_IO_write_ptr;
char *_IO_write_end;
char *_IO_buf_base;
char *_IO_buf_end;
char *_IO_save_base;
char *_IO_backup_base;
char *_IO_save_end;
struct _IO_marker *_markers;
struct _IO_FILE *_chain;
int _fileno;
int _flags2;
__off_t _old_offset;
unsigned short _cur_column;
signed char _vtable_offset;
char _shortbuf[1];
_IO_lock_t *_lock;
__off64_t _offset;
struct _IO_codecvt *_codecvt;
struct _IO_wide_data *_wide_data;
struct _IO_FILE *_freeres_list;
void *_freeres_buf;
size_t __pad5;
int _mode;
char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
};
# 44 "/usr/include/stdio.h" 2 3 4
# 52 "/usr/include/stdio.h" 3 4
typedef __gnuc_va_list va_list;
# 63 "/usr/include/stdio.h" 3 4
typedef __off_t off_t;
# 77 "/usr/include/stdio.h" 3 4
typedef __ssize_t ssize_t;
typedef __fpos_t fpos_t;
# 133 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 1 3 4
# 134 "/usr/include/stdio.h" 2 3 4
extern FILE *stdin;
extern FILE *stdout;
extern FILE *stderr;
extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__));
extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__));
extern int renameat (int __oldfd, const char *__old, int __newfd,
const char *__new) __attribute__ ((__nothrow__ , __leaf__));
# 173 "/usr/include/stdio.h" 3 4
extern FILE *tmpfile (void) ;
# 187 "/usr/include/stdio.h" 3 4
extern char *tmpnam (char *__s) __attribute__ ((__nothrow__ , __leaf__)) ;
extern char *tmpnam_r (char *__s) __attribute__ ((__nothrow__ , __leaf__)) ;
# 204 "/usr/include/stdio.h" 3 4
extern char *tempnam (const char *__dir, const char *__pfx)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) ;
extern int fclose (FILE *__stream);
extern int fflush (FILE *__stream);
# 227 "/usr/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 246 "/usr/include/stdio.h" 3 4
extern FILE *fopen (const char *__restrict __filename,
const char *__restrict __modes) ;
extern FILE *freopen (const char *__restrict __filename,
const char *__restrict __modes,
FILE *__restrict __stream) ;
# 279 "/usr/include/stdio.h" 3 4
extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__)) ;
# 292 "/usr/include/stdio.h" 3 4
extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
__attribute__ ((__nothrow__ , __leaf__)) ;
extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__)) ;
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));
extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__));
extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
size_t __size) __attribute__ ((__nothrow__ , __leaf__));
extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int fprintf (FILE *__restrict __stream,
const char *__restrict __format, ...);
extern int printf (const char *__restrict __format, ...);
extern int sprintf (char *__restrict __s,
const char *__restrict __format, ...) __attribute__ ((__nothrow__));
extern int vfprintf (FILE *__restrict __s, const char *__restrict __format,
__gnuc_va_list __arg);
extern int vprintf (const char *__restrict __format, __gnuc_va_list __arg);
extern int vsprintf (char *__restrict __s, const char *__restrict __format,
__gnuc_va_list __arg) __attribute__ ((__nothrow__));
extern int snprintf (char *__restrict __s, size_t __maxlen,
const char *__restrict __format, ...)
__attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4)));
extern int vsnprintf (char *__restrict __s, size_t __maxlen,
const char *__restrict __format, __gnuc_va_list __arg)
__attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0)));
# 379 "/usr/include/stdio.h" 3 4
extern int vdprintf (int __fd, const char *__restrict __fmt,
__gnuc_va_list __arg)
__attribute__ ((__format__ (__printf__, 2, 0)));
extern int dprintf (int __fd, const char *__restrict __fmt, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
extern int fscanf (FILE *__restrict __stream,
const char *__restrict __format, ...) ;
extern int scanf (const char *__restrict __format, ...) ;
extern int sscanf (const char *__restrict __s,
const char *__restrict __format, ...) __attribute__ ((__nothrow__ , __leaf__));
extern int fscanf (FILE *__restrict __stream, const char *__restrict __format, ...) __asm__ ("" "__isoc99_fscanf")
;
extern int scanf (const char *__restrict __format, ...) __asm__ ("" "__isoc99_scanf")
;
extern int sscanf (const char *__restrict __s, const char *__restrict __format, ...) __asm__ ("" "__isoc99_sscanf") __attribute__ ((__nothrow__ , __leaf__))
;
# 432 "/usr/include/stdio.h" 3 4
extern int vfscanf (FILE *__restrict __s, const char *__restrict __format,
__gnuc_va_list __arg)
__attribute__ ((__format__ (__scanf__, 2, 0))) ;
extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg)
__attribute__ ((__format__ (__scanf__, 1, 0))) ;
extern int vsscanf (const char *__restrict __s,
const char *__restrict __format, __gnuc_va_list __arg)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0)));
extern int vfscanf (FILE *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vfscanf")
__attribute__ ((__format__ (__scanf__, 2, 0))) ;
extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vscanf")
__attribute__ ((__format__ (__scanf__, 1, 0))) ;
extern int vsscanf (const char *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vsscanf") __attribute__ ((__nothrow__ , __leaf__))
__attribute__ ((__format__ (__scanf__, 2, 0)));
# 485 "/usr/include/stdio.h" 3 4
extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);
extern int getchar (void);
extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 510 "/usr/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);
# 521 "/usr/include/stdio.h" 3 4
extern int fputc (int __c, FILE *__stream);
extern int putc (int __c, FILE *__stream);
extern int putchar (int __c);
# 537 "/usr/include/stdio.h" 3 4
extern int fputc_unlocked (int __c, FILE *__stream);
extern int putc_unlocked (int __c, FILE *__stream);
extern int putchar_unlocked (int __c);
extern int getw (FILE *__stream);
extern int putw (int __w, FILE *__stream);
extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
;
# 603 "/usr/include/stdio.h" 3 4
extern __ssize_t __getdelim (char **__restrict __lineptr,
size_t *__restrict __n, int __delimiter,
FILE *__restrict __stream) ;
extern __ssize_t getdelim (char **__restrict __lineptr,
size_t *__restrict __n, int __delimiter,
FILE *__restrict __stream) ;
extern __ssize_t getline (char **__restrict __lineptr,
size_t *__restrict __n,
FILE *__restrict __stream) ;
extern int fputs (const char *__restrict __s, FILE *__restrict __stream);
extern int puts (const char *__s);
extern int ungetc (int __c, FILE *__stream);
extern size_t fread (void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __stream) ;
extern size_t fwrite (const void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __s);
# 673 "/usr/include/stdio.h" 3 4
extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __stream) ;
extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __stream);
extern int fseek (FILE *__stream, long int __off, int __whence);
extern long int ftell (FILE *__stream) ;
extern void rewind (FILE *__stream);
# 707 "/usr/include/stdio.h" 3 4
extern int fseeko (FILE *__stream, __off_t __off, int __whence);
extern __off_t ftello (FILE *__stream) ;
# 731 "/usr/include/stdio.h" 3 4
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos);
extern int fsetpos (FILE *__stream, const fpos_t *__pos);
# 757 "/usr/include/stdio.h" 3 4
extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern void perror (const char *__s);
# 1 "/usr/include/x86_64-linux-gnu/bits/sys_errlist.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/sys_errlist.h" 3 4
extern int sys_nerr;
extern const char *const sys_errlist[];
# 782 "/usr/include/stdio.h" 2 3 4
extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
# 800 "/usr/include/stdio.h" 3 4
extern FILE *popen (const char *__command, const char *__modes) ;
extern int pclose (FILE *__stream);
extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__));
# 840 "/usr/include/stdio.h" 3 4
extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
# 858 "/usr/include/stdio.h" 3 4
extern int __uflow (FILE *);
extern int __overflow (FILE *, int);
# 873 "/usr/include/stdio.h" 3 4
# 9 "./linear-algebra/kernels/trisolv/trisolv.c" 2
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4
# 202 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4
# 203 "/usr/include/unistd.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4
# 207 "/usr/include/unistd.h" 2 3 4
# 226 "/usr/include/unistd.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/9/include/stddef.h" 1 3 4
# 227 "/usr/include/unistd.h" 2 3 4
typedef __gid_t gid_t;
typedef __uid_t uid_t;
# 255 "/usr/include/unistd.h" 3 4
typedef __useconds_t useconds_t;
typedef __pid_t pid_t;
typedef __intptr_t intptr_t;
typedef __socklen_t socklen_t;
# 287 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 304 "/usr/include/unistd.h" 3 4
extern int faccessat (int __fd, const char *__file, int __type, int __flag)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
# 334 "/usr/include/unistd.h" 3 4
extern __off_t lseek (int __fd, __off_t __offset, int __whence) __attribute__ ((__nothrow__ , __leaf__));
# 353 "/usr/include/unistd.h" 3 4
extern int close (int __fd);
extern ssize_t read (int __fd, void *__buf, size_t __nbytes) ;
extern ssize_t write (int __fd, const void *__buf, size_t __n) ;
# 376 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes,
__off_t __offset) ;
extern ssize_t pwrite (int __fd, const void *__buf, size_t __n,
__off_t __offset) ;
# 417 "/usr/include/unistd.h" 3 4
extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;
# 432 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
# 444 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);
extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
__attribute__ ((__nothrow__ , __leaf__));
extern int usleep (__useconds_t __useconds);
# 469 "/usr/include/unistd.h" 3 4
extern int pause (void);
extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern int fchownat (int __fd, const char *__file, __uid_t __owner,
__gid_t __group, int __flag)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
# 511 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;
# 525 "/usr/include/unistd.h" 3 4
extern char *getwd (char *__buf)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__)) ;
extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));
# 543 "/usr/include/unistd.h" 3 4
extern char **__environ;
extern int execve (const char *__path, char *const __argv[],
char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
extern int execv (const char *__path, char *const __argv[])
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int execle (const char *__path, const char *__arg, ...)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int execl (const char *__path, const char *__arg, ...)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int execvp (const char *__file, char *const __argv[])
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int execlp (const char *__file, const char *__arg, ...)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
# 598 "/usr/include/unistd.h" 3 4
extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;
extern void _exit (int __status) __attribute__ ((__noreturn__));
# 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4
enum
{
_PC_LINK_MAX,
_PC_MAX_CANON,
_PC_MAX_INPUT,
_PC_NAME_MAX,
_PC_PATH_MAX,
_PC_PIPE_BUF,
_PC_CHOWN_RESTRICTED,
_PC_NO_TRUNC,
_PC_VDISABLE,
_PC_SYNC_IO,
_PC_ASYNC_IO,
_PC_PRIO_IO,
_PC_SOCK_MAXBUF,
_PC_FILESIZEBITS,
_PC_REC_INCR_XFER_SIZE,
_PC_REC_MAX_XFER_SIZE,
_PC_REC_MIN_XFER_SIZE,
_PC_REC_XFER_ALIGN,
_PC_ALLOC_SIZE_MIN,
_PC_SYMLINK_MAX,
_PC_2_SYMLINKS
};
enum
{
_SC_ARG_MAX,
_SC_CHILD_MAX,
_SC_CLK_TCK,
_SC_NGROUPS_MAX,
_SC_OPEN_MAX,
_SC_STREAM_MAX,
_SC_TZNAME_MAX,
_SC_JOB_CONTROL,
_SC_SAVED_IDS,
_SC_REALTIME_SIGNALS,
_SC_PRIORITY_SCHEDULING,
_SC_TIMERS,
_SC_ASYNCHRONOUS_IO,
_SC_PRIORITIZED_IO,
_SC_SYNCHRONIZED_IO,
_SC_FSYNC,
_SC_MAPPED_FILES,
_SC_MEMLOCK,
_SC_MEMLOCK_RANGE,
_SC_MEMORY_PROTECTION,
_SC_MESSAGE_PASSING,
_SC_SEMAPHORES,
_SC_SHARED_MEMORY_OBJECTS,
_SC_AIO_LISTIO_MAX,
_SC_AIO_MAX,
_SC_AIO_PRIO_DELTA_MAX,
_SC_DELAYTIMER_MAX,
_SC_MQ_OPEN_MAX,
_SC_MQ_PRIO_MAX,
_SC_VERSION,
_SC_PAGESIZE,
_SC_RTSIG_MAX,
_SC_SEM_NSEMS_MAX,
_SC_SEM_VALUE_MAX,
_SC_SIGQUEUE_MAX,
_SC_TIMER_MAX,
_SC_BC_BASE_MAX,
_SC_BC_DIM_MAX,
_SC_BC_SCALE_MAX,
_SC_BC_STRING_MAX,
_SC_COLL_WEIGHTS_MAX,
_SC_EQUIV_CLASS_MAX,
_SC_EXPR_NEST_MAX,
_SC_LINE_MAX,
_SC_RE_DUP_MAX,
_SC_CHARCLASS_NAME_MAX,
_SC_2_VERSION,
_SC_2_C_BIND,
_SC_2_C_DEV,
_SC_2_FORT_DEV,
_SC_2_FORT_RUN,
_SC_2_SW_DEV,
_SC_2_LOCALEDEF,
_SC_PII,
_SC_PII_XTI,
_SC_PII_SOCKET,
_SC_PII_INTERNET,
_SC_PII_OSI,
_SC_POLL,
_SC_SELECT,
_SC_UIO_MAXIOV,
_SC_IOV_MAX = _SC_UIO_MAXIOV,
_SC_PII_INTERNET_STREAM,
_SC_PII_INTERNET_DGRAM,
_SC_PII_OSI_COTS,
_SC_PII_OSI_CLTS,
_SC_PII_OSI_M,
_SC_T_IOV_MAX,
_SC_THREADS,
_SC_THREAD_SAFE_FUNCTIONS,
_SC_GETGR_R_SIZE_MAX,
_SC_GETPW_R_SIZE_MAX,
_SC_LOGIN_NAME_MAX,
_SC_TTY_NAME_MAX,
_SC_THREAD_DESTRUCTOR_ITERATIONS,
_SC_THREAD_KEYS_MAX,
_SC_THREAD_STACK_MIN,
_SC_THREAD_THREADS_MAX,
_SC_THREAD_ATTR_STACKADDR,
_SC_THREAD_ATTR_STACKSIZE,
_SC_THREAD_PRIORITY_SCHEDULING,
_SC_THREAD_PRIO_INHERIT,
_SC_THREAD_PRIO_PROTECT,
_SC_THREAD_PROCESS_SHARED,
_SC_NPROCESSORS_CONF,
_SC_NPROCESSORS_ONLN,
_SC_PHYS_PAGES,
_SC_AVPHYS_PAGES,
_SC_ATEXIT_MAX,
_SC_PASS_MAX,
_SC_XOPEN_VERSION,
_SC_XOPEN_XCU_VERSION,
_SC_XOPEN_UNIX,
_SC_XOPEN_CRYPT,
_SC_XOPEN_ENH_I18N,
_SC_XOPEN_SHM,
_SC_2_CHAR_TERM,
_SC_2_C_VERSION,
_SC_2_UPE,
_SC_XOPEN_XPG2,
_SC_XOPEN_XPG3,
_SC_XOPEN_XPG4,
_SC_CHAR_BIT,
_SC_CHAR_MAX,
_SC_CHAR_MIN,
_SC_INT_MAX,
_SC_INT_MIN,
_SC_LONG_BIT,
_SC_WORD_BIT,
_SC_MB_LEN_MAX,
_SC_NZERO,
_SC_SSIZE_MAX,
_SC_SCHAR_MAX,
_SC_SCHAR_MIN,
_SC_SHRT_MAX,
_SC_SHRT_MIN,
_SC_UCHAR_MAX,
_SC_UINT_MAX,
_SC_ULONG_MAX,
_SC_USHRT_MAX,
_SC_NL_ARGMAX,
_SC_NL_LANGMAX,
_SC_NL_MSGMAX,
_SC_NL_NMAX,
_SC_NL_SETMAX,
_SC_NL_TEXTMAX,
_SC_XBS5_ILP32_OFF32,
_SC_XBS5_ILP32_OFFBIG,
_SC_XBS5_LP64_OFF64,
_SC_XBS5_LPBIG_OFFBIG,
_SC_XOPEN_LEGACY,
_SC_XOPEN_REALTIME,
_SC_XOPEN_REALTIME_THREADS,
_SC_ADVISORY_INFO,
_SC_BARRIERS,
_SC_BASE,
_SC_C_LANG_SUPPORT,
_SC_C_LANG_SUPPORT_R,
_SC_CLOCK_SELECTION,
_SC_CPUTIME,
_SC_THREAD_CPUTIME,
_SC_DEVICE_IO,
_SC_DEVICE_SPECIFIC,
_SC_DEVICE_SPECIFIC_R,
_SC_FD_MGMT,
_SC_FIFO,
_SC_PIPE,
_SC_FILE_ATTRIBUTES,
_SC_FILE_LOCKING,
_SC_FILE_SYSTEM,
_SC_MONOTONIC_CLOCK,
_SC_MULTI_PROCESS,
_SC_SINGLE_PROCESS,
_SC_NETWORKING,
_SC_READER_WRITER_LOCKS,
_SC_SPIN_LOCKS,
_SC_REGEXP,
_SC_REGEX_VERSION,
_SC_SHELL,
_SC_SIGNALS,
_SC_SPAWN,
_SC_SPORADIC_SERVER,
_SC_THREAD_SPORADIC_SERVER,
_SC_SYSTEM_DATABASE,
_SC_SYSTEM_DATABASE_R,
_SC_TIMEOUTS,
_SC_TYPED_MEMORY_OBJECTS,
_SC_USER_GROUPS,
_SC_USER_GROUPS_R,
_SC_2_PBS,
_SC_2_PBS_ACCOUNTING,
_SC_2_PBS_LOCATE,
_SC_2_PBS_MESSAGE,
_SC_2_PBS_TRACK,
_SC_SYMLOOP_MAX,
_SC_STREAMS,
_SC_2_PBS_CHECKPOINT,
_SC_V6_ILP32_OFF32,
_SC_V6_ILP32_OFFBIG,
_SC_V6_LP64_OFF64,
_SC_V6_LPBIG_OFFBIG,
_SC_HOST_NAME_MAX,
_SC_TRACE,
_SC_TRACE_EVENT_FILTER,
_SC_TRACE_INHERIT,
_SC_TRACE_LOG,
_SC_LEVEL1_ICACHE_SIZE,
_SC_LEVEL1_ICACHE_ASSOC,
_SC_LEVEL1_ICACHE_LINESIZE,
_SC_LEVEL1_DCACHE_SIZE,
_SC_LEVEL1_DCACHE_ASSOC,
_SC_LEVEL1_DCACHE_LINESIZE,
_SC_LEVEL2_CACHE_SIZE,
_SC_LEVEL2_CACHE_ASSOC,
_SC_LEVEL2_CACHE_LINESIZE,
_SC_LEVEL3_CACHE_SIZE,
_SC_LEVEL3_CACHE_ASSOC,
_SC_LEVEL3_CACHE_LINESIZE,
_SC_LEVEL4_CACHE_SIZE,
_SC_LEVEL4_CACHE_ASSOC,
_SC_LEVEL4_CACHE_LINESIZE,
_SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,
_SC_RAW_SOCKETS,
_SC_V7_ILP32_OFF32,
_SC_V7_ILP32_OFFBIG,
_SC_V7_LP64_OFF64,
_SC_V7_LPBIG_OFFBIG,
_SC_SS_REPL_MAX,
_SC_TRACE_EVENT_NAME_MAX,
_SC_TRACE_NAME_MAX,
_SC_TRACE_SYS_MAX,
_SC_TRACE_USER_EVENT_MAX,
_SC_XOPEN_STREAMS,
_SC_THREAD_ROBUST_PRIO_INHERIT,
_SC_THREAD_ROBUST_PRIO_PROTECT
};
enum
{
_CS_PATH,
_CS_V6_WIDTH_RESTRICTED_ENVS,
_CS_GNU_LIBC_VERSION,
_CS_GNU_LIBPTHREAD_VERSION,
_CS_V5_WIDTH_RESTRICTED_ENVS,
_CS_V7_WIDTH_RESTRICTED_ENVS,
_CS_LFS_CFLAGS = 1000,
_CS_LFS_LDFLAGS,
_CS_LFS_LIBS,
_CS_LFS_LINTFLAGS,
_CS_LFS64_CFLAGS,
_CS_LFS64_LDFLAGS,
_CS_LFS64_LIBS,
_CS_LFS64_LINTFLAGS,
_CS_XBS5_ILP32_OFF32_CFLAGS = 1100,
_CS_XBS5_ILP32_OFF32_LDFLAGS,
_CS_XBS5_ILP32_OFF32_LIBS,
_CS_XBS5_ILP32_OFF32_LINTFLAGS,
_CS_XBS5_ILP32_OFFBIG_CFLAGS,
_CS_XBS5_ILP32_OFFBIG_LDFLAGS,
_CS_XBS5_ILP32_OFFBIG_LIBS,
_CS_XBS5_ILP32_OFFBIG_LINTFLAGS,
_CS_XBS5_LP64_OFF64_CFLAGS,
_CS_XBS5_LP64_OFF64_LDFLAGS,
_CS_XBS5_LP64_OFF64_LIBS,
_CS_XBS5_LP64_OFF64_LINTFLAGS,
_CS_XBS5_LPBIG_OFFBIG_CFLAGS,
_CS_XBS5_LPBIG_OFFBIG_LDFLAGS,
_CS_XBS5_LPBIG_OFFBIG_LIBS,
_CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,
_CS_POSIX_V6_ILP32_OFF32_CFLAGS,
_CS_POSIX_V6_ILP32_OFF32_LDFLAGS,
_CS_POSIX_V6_ILP32_OFF32_LIBS,
_CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,
_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,
_CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,
_CS_POSIX_V6_ILP32_OFFBIG_LIBS,
_CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,
_CS_POSIX_V6_LP64_OFF64_CFLAGS,
_CS_POSIX_V6_LP64_OFF64_LDFLAGS,
_CS_POSIX_V6_LP64_OFF64_LIBS,
_CS_POSIX_V6_LP64_OFF64_LINTFLAGS,
_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,
_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,
_CS_POSIX_V6_LPBIG_OFFBIG_LIBS,
_CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,
_CS_POSIX_V7_ILP32_OFF32_CFLAGS,
_CS_POSIX_V7_ILP32_OFF32_LDFLAGS,
_CS_POSIX_V7_ILP32_OFF32_LIBS,
_CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,
_CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,
_CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,
_CS_POSIX_V7_ILP32_OFFBIG_LIBS,
_CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,
_CS_POSIX_V7_LP64_OFF64_CFLAGS,
_CS_POSIX_V7_LP64_OFF64_LDFLAGS,
_CS_POSIX_V7_LP64_OFF64_LIBS,
_CS_POSIX_V7_LP64_OFF64_LINTFLAGS,
_CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,
_CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,
_CS_POSIX_V7_LPBIG_OFFBIG_LIBS,
_CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,
_CS_V6_ENV,
_CS_V7_ENV
};
# 610 "/usr/include/unistd.h" 2 3 4
extern long int pathconf (const char *__path, int __name)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));
extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));
extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__));
extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));
extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));
extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));
extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));
extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));
extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
# 660 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));
extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));
extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));
extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));
extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));
extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));
extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));
extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__)) ;
# 700 "/usr/include/unistd.h" 3 4
extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;
# 756 "/usr/include/unistd.h" 3 4
extern __pid_t fork (void) __attribute__ ((__nothrow__));
extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));
extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));
extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));
extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));
extern int link (const char *__from, const char *__to)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;
extern int linkat (int __fromfd, const char *__from, int __tofd,
const char *__to, int __flags)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;
extern int symlink (const char *__from, const char *__to)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;
extern ssize_t readlink (const char *__restrict __path,
char *__restrict __buf, size_t __len)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;
extern int symlinkat (const char *__from, int __tofd,
const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;
extern ssize_t readlinkat (int __fd, const char *__restrict __path,
char *__restrict __buf, size_t __len)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3))) ;
extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int unlinkat (int __fd, const char *__name, int __flag)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));
extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));
extern char *getlogin (void);
extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)));
extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern char *optarg;
# 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int optind;
extern int opterr;
extern int optopt;
# 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4
# 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 870 "/usr/include/unistd.h" 2 3 4
extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int sethostname (const char *__name, size_t __len)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int getdomainname (char *__name, size_t __len)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern int setdomainname (const char *__name, size_t __len)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));
extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern int profil (unsigned short int *__sample_buffer, size_t __size,
size_t __offset, unsigned int __scale)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));
extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));
extern int fsync (int __fd);
# 967 "/usr/include/unistd.h" 3 4
extern long int gethostid (void);
extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));
extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
# 991 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off_t __length)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1014 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1035 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;
extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
# 1056 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
# 1079 "/usr/include/unistd.h" 3 4
extern int lockf (int __fd, int __cmd, __off_t __len) ;
# 1115 "/usr/include/unistd.h" 3 4
extern int fdatasync (int __fildes);
# 1124 "/usr/include/unistd.h" 3 4
extern char *crypt (const char *__key, const char *__salt)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
# 1161 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length) ;
# 1170 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4
# 1171 "/usr/include/unistd.h" 2 3 4
# 10 "./linear-algebra/kernels/trisolv/trisolv.c" 2
# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/string.h" 2 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/9/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4
# 43 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *memmove (void *__dest, const void *__src, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
int __c, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int memcmp (const void *__s1, const void *__s2, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 91 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 122 "/usr/include/string.h" 3 4
extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *strncpy (char *__restrict __dest,
const char *__restrict __src, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *strcat (char *__restrict __dest, const char *__restrict __src)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *strncat (char *__restrict __dest, const char *__restrict __src,
size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int strcmp (const char *__s1, const char *__s2)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern int strncmp (const char *__s1, const char *__s2, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern int strcoll (const char *__s1, const char *__s2)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern size_t strxfrm (char *__restrict __dest,
const char *__restrict __src, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{
struct __locale_data *__locales[13];
const unsigned short int *__ctype_b;
const int *__ctype_tolower;
const int *__ctype_toupper;
const char *__names[13];
};
typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4
typedef __locale_t locale_t;
# 154 "/usr/include/string.h" 2 3 4
extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));
extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));
extern char *strdup (const char *__s)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
extern char *strndup (const char *__string, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 226 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 253 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 273 "/usr/include/string.h" 3 4
extern size_t strcspn (const char *__s, const char *__reject)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern size_t strspn (const char *__s, const char *__accept)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 303 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 330 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *strtok (char *__restrict __s, const char *__restrict __delim)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
extern char *__strtok_r (char *__restrict __s,
const char *__restrict __delim,
char **__restrict __save_ptr)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
char **__restrict __save_ptr)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 385 "/usr/include/string.h" 3 4
extern size_t strlen (const char *__s)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
extern size_t strnlen (const char *__string, size_t __maxlen)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 410 "/usr/include/string.h" 3 4
extern int strerror_r (int __errnum, char *__buf, size_t __buflen) __asm__ ("" "__xpg_strerror_r") __attribute__ ((__nothrow__ , __leaf__))
__attribute__ ((__nonnull__ (2)));
# 428 "/usr/include/string.h" 3 4
extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));
# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/9/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4
extern int bcmp (const void *__s1, const void *__s2, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern void bcopy (const void *__src, void *__dest, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern int strcasecmp (const char *__s1, const char *__s2)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));
extern int strncasecmp_l (const char *__s1, const char *__s2,
size_t __n, locale_t __loc)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));
# 433 "/usr/include/string.h" 2 3 4
extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern char *strsep (char **__restrict __stringp,
const char *__restrict __delim)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));
extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *__stpncpy (char *__restrict __dest,
const char *__restrict __src, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
const char *__restrict __src, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
# 499 "/usr/include/string.h" 3 4
# 11 "./linear-algebra/kernels/trisolv/trisolv.c" 2
# 1 "/usr/include/math.h" 1 3 4
# 27 "/usr/include/math.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 28 "/usr/include/math.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/math-vector.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/math-vector.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/math-vector.h" 2 3 4
# 41 "/usr/include/math.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 121 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 44 "/usr/include/math.h" 2 3 4
# 138 "/usr/include/math.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/flt-eval-method.h" 1 3 4
# 139 "/usr/include/math.h" 2 3 4
# 149 "/usr/include/math.h" 3 4
typedef float float_t;
typedef double double_t;
# 190 "/usr/include/math.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/fp-logb.h" 1 3 4
# 191 "/usr/include/math.h" 2 3 4
# 233 "/usr/include/math.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/fp-fast.h" 1 3 4
# 234 "/usr/include/math.h" 2 3 4
# 289 "/usr/include/math.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" 3 4
extern int __fpclassify (double __value) __attribute__ ((__nothrow__ , __leaf__))
__attribute__ ((__const__));
extern int __signbit (double __value) __attribute__ ((__nothrow__ , __leaf__))
__attribute__ ((__const__));
extern int __isinf (double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern int __finite (double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern int __isnan (double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern int __iseqsig (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__));
extern int __issignaling (double __value) __attribute__ ((__nothrow__ , __leaf__))
__attribute__ ((__const__));
# 290 "/usr/include/math.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 1 3 4
# 53 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4
extern double acos (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __acos (double __x) __attribute__ ((__nothrow__ , __leaf__));
extern double asin (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __asin (double __x) __attribute__ ((__nothrow__ , __leaf__));
extern double atan (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __atan (double __x) __attribute__ ((__nothrow__ , __leaf__));
extern double atan2 (double __y, double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __atan2 (double __y, double __x) __attribute__ ((__nothrow__ , __leaf__));
extern double cos (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __cos (double __x) __attribute__ ((__nothrow__ , __leaf__));
extern double sin (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __sin (double __x) __attribute__ ((__nothrow__ , __leaf__));
extern double tan (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __tan (double __x) __attribute__ ((__nothrow__ , __leaf__));
extern double cosh (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __cosh (double __x) __attribute__ ((__nothrow__ , __leaf__));
extern double sinh (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __sinh (double __x) __attribute__ ((__nothrow__ , __leaf__));
extern double tanh (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __tanh (double __x) __attribute__ ((__nothrow__ , __leaf__));
# 85 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4
extern double acosh (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __acosh (double __x) __attribute__ ((__nothrow__ , __leaf__));
extern double asinh (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __asinh (double __x) __attribute__ ((__nothrow__ , __leaf__));
extern double atanh (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __atanh (double __x) __attribute__ ((__nothrow__ , __leaf__));
extern double exp (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __exp (double __x) __attribute__ ((__nothrow__ , __leaf__));
extern double frexp (double __x, int *__exponent) __attribute__ ((__nothrow__ , __leaf__)); extern double __frexp (double __x, int *__exponent) __attribute__ ((__nothrow__ , __leaf__));
extern double ldexp (double __x, int __exponent) __attribute__ ((__nothrow__ , __leaf__)); extern double __ldexp (double __x, int __exponent) __attribute__ ((__nothrow__ , __leaf__));
extern double log (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __log (double __x) __attribute__ ((__nothrow__ , __leaf__));
extern double log10 (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __log10 (double __x) __attribute__ ((__nothrow__ , __leaf__));
extern double modf (double __x, double *__iptr) __attribute__ ((__nothrow__ , __leaf__)); extern double __modf (double __x, double *__iptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 119 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4
extern double expm1 (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __expm1 (double __x) __attribute__ ((__nothrow__ , __leaf__));
extern double log1p (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __log1p (double __x) __attribute__ ((__nothrow__ , __leaf__));
extern double logb (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __logb (double __x) __attribute__ ((__nothrow__ , __leaf__));
extern double exp2 (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __exp2 (double __x) __attribute__ ((__nothrow__ , __leaf__));
extern double log2 (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __log2 (double __x) __attribute__ ((__nothrow__ , __leaf__));
extern double pow (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); extern double __pow (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__));
extern double sqrt (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __sqrt (double __x) __attribute__ ((__nothrow__ , __leaf__));
extern double hypot (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); extern double __hypot (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__));
extern double cbrt (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __cbrt (double __x) __attribute__ ((__nothrow__ , __leaf__));
extern double ceil (double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double __ceil (double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern double fabs (double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double __fabs (double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern double floor (double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double __floor (double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern double fmod (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); extern double __fmod (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__));
# 177 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4
extern int isinf (double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern int finite (double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern double drem (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); extern double __drem (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__));
extern double significand (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __significand (double __x) __attribute__ ((__nothrow__ , __leaf__));
extern double copysign (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double __copysign (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern double nan (const char *__tagb) __attribute__ ((__nothrow__ , __leaf__)); extern double __nan (const char *__tagb) __attribute__ ((__nothrow__ , __leaf__));
# 211 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4
extern int isnan (double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern double j0 (double) __attribute__ ((__nothrow__ , __leaf__)); extern double __j0 (double) __attribute__ ((__nothrow__ , __leaf__));
extern double j1 (double) __attribute__ ((__nothrow__ , __leaf__)); extern double __j1 (double) __attribute__ ((__nothrow__ , __leaf__));
extern double jn (int, double) __attribute__ ((__nothrow__ , __leaf__)); extern double __jn (int, double) __attribute__ ((__nothrow__ , __leaf__));
extern double y0 (double) __attribute__ ((__nothrow__ , __leaf__)); extern double __y0 (double) __attribute__ ((__nothrow__ , __leaf__));
extern double y1 (double) __attribute__ ((__nothrow__ , __leaf__)); extern double __y1 (double) __attribute__ ((__nothrow__ , __leaf__));
extern double yn (int, double) __attribute__ ((__nothrow__ , __leaf__)); extern double __yn (int, double) __attribute__ ((__nothrow__ , __leaf__));
extern double erf (double) __attribute__ ((__nothrow__ , __leaf__)); extern double __erf (double) __attribute__ ((__nothrow__ , __leaf__));
extern double erfc (double) __attribute__ ((__nothrow__ , __leaf__)); extern double __erfc (double) __attribute__ ((__nothrow__ , __leaf__));
extern double lgamma (double) __attribute__ ((__nothrow__ , __leaf__)); extern double __lgamma (double) __attribute__ ((__nothrow__ , __leaf__));
extern double tgamma (double) __attribute__ ((__nothrow__ , __leaf__)); extern double __tgamma (double) __attribute__ ((__nothrow__ , __leaf__));
extern double gamma (double) __attribute__ ((__nothrow__ , __leaf__)); extern double __gamma (double) __attribute__ ((__nothrow__ , __leaf__));
extern double lgamma_r (double, int *__signgamp) __attribute__ ((__nothrow__ , __leaf__)); extern double __lgamma_r (double, int *__signgamp) __attribute__ ((__nothrow__ , __leaf__));
extern double rint (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __rint (double __x) __attribute__ ((__nothrow__ , __leaf__));
extern double nextafter (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); extern double __nextafter (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__));
extern double nexttoward (double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern double __nexttoward (double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__));
# 272 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4
extern double remainder (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); extern double __remainder (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__));
extern double scalbn (double __x, int __n) __attribute__ ((__nothrow__ , __leaf__)); extern double __scalbn (double __x, int __n) __attribute__ ((__nothrow__ , __leaf__));
extern int ilogb (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern int __ilogb (double __x) __attribute__ ((__nothrow__ , __leaf__));
# 290 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4
extern double scalbln (double __x, long int __n) __attribute__ ((__nothrow__ , __leaf__)); extern double __scalbln (double __x, long int __n) __attribute__ ((__nothrow__ , __leaf__));
extern double nearbyint (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern double __nearbyint (double __x) __attribute__ ((__nothrow__ , __leaf__));
extern double round (double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double __round (double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern double trunc (double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double __trunc (double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern double remquo (double __x, double __y, int *__quo) __attribute__ ((__nothrow__ , __leaf__)); extern double __remquo (double __x, double __y, int *__quo) __attribute__ ((__nothrow__ , __leaf__));
extern long int lrint (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long int __lrint (double __x) __attribute__ ((__nothrow__ , __leaf__));
__extension__
extern long long int llrint (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long long int __llrint (double __x) __attribute__ ((__nothrow__ , __leaf__));
extern long int lround (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long int __lround (double __x) __attribute__ ((__nothrow__ , __leaf__));
__extension__
extern long long int llround (double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long long int __llround (double __x) __attribute__ ((__nothrow__ , __leaf__));
extern double fdim (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)); extern double __fdim (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__));
extern double fmax (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double __fmax (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern double fmin (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern double __fmin (double __x, double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern double fma (double __x, double __y, double __z) __attribute__ ((__nothrow__ , __leaf__)); extern double __fma (double __x, double __y, double __z) __attribute__ ((__nothrow__ , __leaf__));
# 400 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4
extern double scalb (double __x, double __n) __attribute__ ((__nothrow__ , __leaf__)); extern double __scalb (double __x, double __n) __attribute__ ((__nothrow__ , __leaf__));
# 291 "/usr/include/math.h" 2 3 4
# 306 "/usr/include/math.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" 3 4
extern int __fpclassifyf (float __value) __attribute__ ((__nothrow__ , __leaf__))
__attribute__ ((__const__));
extern int __signbitf (float __value) __attribute__ ((__nothrow__ , __leaf__))
__attribute__ ((__const__));
extern int __isinff (float __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern int __finitef (float __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern int __isnanf (float __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern int __iseqsigf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__));
extern int __issignalingf (float __value) __attribute__ ((__nothrow__ , __leaf__))
__attribute__ ((__const__));
# 307 "/usr/include/math.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 1 3 4
# 53 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4
extern float acosf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __acosf (float __x) __attribute__ ((__nothrow__ , __leaf__));
extern float asinf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __asinf (float __x) __attribute__ ((__nothrow__ , __leaf__));
extern float atanf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __atanf (float __x) __attribute__ ((__nothrow__ , __leaf__));
extern float atan2f (float __y, float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __atan2f (float __y, float __x) __attribute__ ((__nothrow__ , __leaf__));
extern float cosf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __cosf (float __x) __attribute__ ((__nothrow__ , __leaf__));
extern float sinf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __sinf (float __x) __attribute__ ((__nothrow__ , __leaf__));
extern float tanf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __tanf (float __x) __attribute__ ((__nothrow__ , __leaf__));
extern float coshf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __coshf (float __x) __attribute__ ((__nothrow__ , __leaf__));
extern float sinhf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __sinhf (float __x) __attribute__ ((__nothrow__ , __leaf__));
extern float tanhf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __tanhf (float __x) __attribute__ ((__nothrow__ , __leaf__));
# 85 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4
extern float acoshf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __acoshf (float __x) __attribute__ ((__nothrow__ , __leaf__));
extern float asinhf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __asinhf (float __x) __attribute__ ((__nothrow__ , __leaf__));
extern float atanhf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __atanhf (float __x) __attribute__ ((__nothrow__ , __leaf__));
extern float expf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __expf (float __x) __attribute__ ((__nothrow__ , __leaf__));
extern float frexpf (float __x, int *__exponent) __attribute__ ((__nothrow__ , __leaf__)); extern float __frexpf (float __x, int *__exponent) __attribute__ ((__nothrow__ , __leaf__));
extern float ldexpf (float __x, int __exponent) __attribute__ ((__nothrow__ , __leaf__)); extern float __ldexpf (float __x, int __exponent) __attribute__ ((__nothrow__ , __leaf__));
extern float logf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __logf (float __x) __attribute__ ((__nothrow__ , __leaf__));
extern float log10f (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __log10f (float __x) __attribute__ ((__nothrow__ , __leaf__));
extern float modff (float __x, float *__iptr) __attribute__ ((__nothrow__ , __leaf__)); extern float __modff (float __x, float *__iptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 119 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4
extern float expm1f (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __expm1f (float __x) __attribute__ ((__nothrow__ , __leaf__));
extern float log1pf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __log1pf (float __x) __attribute__ ((__nothrow__ , __leaf__));
extern float logbf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __logbf (float __x) __attribute__ ((__nothrow__ , __leaf__));
extern float exp2f (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __exp2f (float __x) __attribute__ ((__nothrow__ , __leaf__));
extern float log2f (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __log2f (float __x) __attribute__ ((__nothrow__ , __leaf__));
extern float powf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); extern float __powf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__));
extern float sqrtf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __sqrtf (float __x) __attribute__ ((__nothrow__ , __leaf__));
extern float hypotf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); extern float __hypotf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__));
extern float cbrtf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __cbrtf (float __x) __attribute__ ((__nothrow__ , __leaf__));
extern float ceilf (float __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float __ceilf (float __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern float fabsf (float __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float __fabsf (float __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern float floorf (float __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float __floorf (float __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern float fmodf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); extern float __fmodf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__));
# 177 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4
extern int isinff (float __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern int finitef (float __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern float dremf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); extern float __dremf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__));
extern float significandf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __significandf (float __x) __attribute__ ((__nothrow__ , __leaf__));
extern float copysignf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float __copysignf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern float nanf (const char *__tagb) __attribute__ ((__nothrow__ , __leaf__)); extern float __nanf (const char *__tagb) __attribute__ ((__nothrow__ , __leaf__));
# 211 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4
extern int isnanf (float __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern float j0f (float) __attribute__ ((__nothrow__ , __leaf__)); extern float __j0f (float) __attribute__ ((__nothrow__ , __leaf__));
extern float j1f (float) __attribute__ ((__nothrow__ , __leaf__)); extern float __j1f (float) __attribute__ ((__nothrow__ , __leaf__));
extern float jnf (int, float) __attribute__ ((__nothrow__ , __leaf__)); extern float __jnf (int, float) __attribute__ ((__nothrow__ , __leaf__));
extern float y0f (float) __attribute__ ((__nothrow__ , __leaf__)); extern float __y0f (float) __attribute__ ((__nothrow__ , __leaf__));
extern float y1f (float) __attribute__ ((__nothrow__ , __leaf__)); extern float __y1f (float) __attribute__ ((__nothrow__ , __leaf__));
extern float ynf (int, float) __attribute__ ((__nothrow__ , __leaf__)); extern float __ynf (int, float) __attribute__ ((__nothrow__ , __leaf__));
extern float erff (float) __attribute__ ((__nothrow__ , __leaf__)); extern float __erff (float) __attribute__ ((__nothrow__ , __leaf__));
extern float erfcf (float) __attribute__ ((__nothrow__ , __leaf__)); extern float __erfcf (float) __attribute__ ((__nothrow__ , __leaf__));
extern float lgammaf (float) __attribute__ ((__nothrow__ , __leaf__)); extern float __lgammaf (float) __attribute__ ((__nothrow__ , __leaf__));
extern float tgammaf (float) __attribute__ ((__nothrow__ , __leaf__)); extern float __tgammaf (float) __attribute__ ((__nothrow__ , __leaf__));
extern float gammaf (float) __attribute__ ((__nothrow__ , __leaf__)); extern float __gammaf (float) __attribute__ ((__nothrow__ , __leaf__));
extern float lgammaf_r (float, int *__signgamp) __attribute__ ((__nothrow__ , __leaf__)); extern float __lgammaf_r (float, int *__signgamp) __attribute__ ((__nothrow__ , __leaf__));
extern float rintf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __rintf (float __x) __attribute__ ((__nothrow__ , __leaf__));
extern float nextafterf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); extern float __nextafterf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__));
extern float nexttowardf (float __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern float __nexttowardf (float __x, long double __y) __attribute__ ((__nothrow__ , __leaf__));
# 272 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4
extern float remainderf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); extern float __remainderf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__));
extern float scalbnf (float __x, int __n) __attribute__ ((__nothrow__ , __leaf__)); extern float __scalbnf (float __x, int __n) __attribute__ ((__nothrow__ , __leaf__));
extern int ilogbf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern int __ilogbf (float __x) __attribute__ ((__nothrow__ , __leaf__));
# 290 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4
extern float scalblnf (float __x, long int __n) __attribute__ ((__nothrow__ , __leaf__)); extern float __scalblnf (float __x, long int __n) __attribute__ ((__nothrow__ , __leaf__));
extern float nearbyintf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern float __nearbyintf (float __x) __attribute__ ((__nothrow__ , __leaf__));
extern float roundf (float __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float __roundf (float __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern float truncf (float __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float __truncf (float __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern float remquof (float __x, float __y, int *__quo) __attribute__ ((__nothrow__ , __leaf__)); extern float __remquof (float __x, float __y, int *__quo) __attribute__ ((__nothrow__ , __leaf__));
extern long int lrintf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern long int __lrintf (float __x) __attribute__ ((__nothrow__ , __leaf__));
__extension__
extern long long int llrintf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern long long int __llrintf (float __x) __attribute__ ((__nothrow__ , __leaf__));
extern long int lroundf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern long int __lroundf (float __x) __attribute__ ((__nothrow__ , __leaf__));
__extension__
extern long long int llroundf (float __x) __attribute__ ((__nothrow__ , __leaf__)); extern long long int __llroundf (float __x) __attribute__ ((__nothrow__ , __leaf__));
extern float fdimf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)); extern float __fdimf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__));
extern float fmaxf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float __fmaxf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern float fminf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern float __fminf (float __x, float __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern float fmaf (float __x, float __y, float __z) __attribute__ ((__nothrow__ , __leaf__)); extern float __fmaf (float __x, float __y, float __z) __attribute__ ((__nothrow__ , __leaf__));
# 400 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4
extern float scalbf (float __x, float __n) __attribute__ ((__nothrow__ , __leaf__)); extern float __scalbf (float __x, float __n) __attribute__ ((__nothrow__ , __leaf__));
# 308 "/usr/include/math.h" 2 3 4
# 349 "/usr/include/math.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" 3 4
extern int __fpclassifyl (long double __value) __attribute__ ((__nothrow__ , __leaf__))
__attribute__ ((__const__));
extern int __signbitl (long double __value) __attribute__ ((__nothrow__ , __leaf__))
__attribute__ ((__const__));
extern int __isinfl (long double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern int __finitel (long double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern int __isnanl (long double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern int __iseqsigl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__));
extern int __issignalingl (long double __value) __attribute__ ((__nothrow__ , __leaf__))
__attribute__ ((__const__));
# 350 "/usr/include/math.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 1 3 4
# 53 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4
extern long double acosl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __acosl (long double __x) __attribute__ ((__nothrow__ , __leaf__));
extern long double asinl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __asinl (long double __x) __attribute__ ((__nothrow__ , __leaf__));
extern long double atanl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __atanl (long double __x) __attribute__ ((__nothrow__ , __leaf__));
extern long double atan2l (long double __y, long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __atan2l (long double __y, long double __x) __attribute__ ((__nothrow__ , __leaf__));
extern long double cosl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __cosl (long double __x) __attribute__ ((__nothrow__ , __leaf__));
extern long double sinl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __sinl (long double __x) __attribute__ ((__nothrow__ , __leaf__));
extern long double tanl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __tanl (long double __x) __attribute__ ((__nothrow__ , __leaf__));
extern long double coshl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __coshl (long double __x) __attribute__ ((__nothrow__ , __leaf__));
extern long double sinhl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __sinhl (long double __x) __attribute__ ((__nothrow__ , __leaf__));
extern long double tanhl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __tanhl (long double __x) __attribute__ ((__nothrow__ , __leaf__));
# 85 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4
extern long double acoshl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __acoshl (long double __x) __attribute__ ((__nothrow__ , __leaf__));
extern long double asinhl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __asinhl (long double __x) __attribute__ ((__nothrow__ , __leaf__));
extern long double atanhl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __atanhl (long double __x) __attribute__ ((__nothrow__ , __leaf__));
extern long double expl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __expl (long double __x) __attribute__ ((__nothrow__ , __leaf__));
extern long double frexpl (long double __x, int *__exponent) __attribute__ ((__nothrow__ , __leaf__)); extern long double __frexpl (long double __x, int *__exponent) __attribute__ ((__nothrow__ , __leaf__));
extern long double ldexpl (long double __x, int __exponent) __attribute__ ((__nothrow__ , __leaf__)); extern long double __ldexpl (long double __x, int __exponent) __attribute__ ((__nothrow__ , __leaf__));
extern long double logl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __logl (long double __x) __attribute__ ((__nothrow__ , __leaf__));
extern long double log10l (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __log10l (long double __x) __attribute__ ((__nothrow__ , __leaf__));
extern long double modfl (long double __x, long double *__iptr) __attribute__ ((__nothrow__ , __leaf__)); extern long double __modfl (long double __x, long double *__iptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 119 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4
extern long double expm1l (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __expm1l (long double __x) __attribute__ ((__nothrow__ , __leaf__));
extern long double log1pl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __log1pl (long double __x) __attribute__ ((__nothrow__ , __leaf__));
extern long double logbl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __logbl (long double __x) __attribute__ ((__nothrow__ , __leaf__));
extern long double exp2l (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __exp2l (long double __x) __attribute__ ((__nothrow__ , __leaf__));
extern long double log2l (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __log2l (long double __x) __attribute__ ((__nothrow__ , __leaf__));
extern long double powl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern long double __powl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__));
extern long double sqrtl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __sqrtl (long double __x) __attribute__ ((__nothrow__ , __leaf__));
extern long double hypotl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern long double __hypotl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__));
extern long double cbrtl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __cbrtl (long double __x) __attribute__ ((__nothrow__ , __leaf__));
extern long double ceill (long double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double __ceill (long double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern long double fabsl (long double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double __fabsl (long double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern long double floorl (long double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double __floorl (long double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern long double fmodl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern long double __fmodl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__));
# 177 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4
extern int isinfl (long double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern int finitel (long double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern long double dreml (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern long double __dreml (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__));
extern long double significandl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __significandl (long double __x) __attribute__ ((__nothrow__ , __leaf__));
extern long double copysignl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double __copysignl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern long double nanl (const char *__tagb) __attribute__ ((__nothrow__ , __leaf__)); extern long double __nanl (const char *__tagb) __attribute__ ((__nothrow__ , __leaf__));
# 211 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4
extern int isnanl (long double __value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern long double j0l (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double __j0l (long double) __attribute__ ((__nothrow__ , __leaf__));
extern long double j1l (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double __j1l (long double) __attribute__ ((__nothrow__ , __leaf__));
extern long double jnl (int, long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double __jnl (int, long double) __attribute__ ((__nothrow__ , __leaf__));
extern long double y0l (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double __y0l (long double) __attribute__ ((__nothrow__ , __leaf__));
extern long double y1l (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double __y1l (long double) __attribute__ ((__nothrow__ , __leaf__));
extern long double ynl (int, long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double __ynl (int, long double) __attribute__ ((__nothrow__ , __leaf__));
extern long double erfl (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double __erfl (long double) __attribute__ ((__nothrow__ , __leaf__));
extern long double erfcl (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double __erfcl (long double) __attribute__ ((__nothrow__ , __leaf__));
extern long double lgammal (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double __lgammal (long double) __attribute__ ((__nothrow__ , __leaf__));
extern long double tgammal (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double __tgammal (long double) __attribute__ ((__nothrow__ , __leaf__));
extern long double gammal (long double) __attribute__ ((__nothrow__ , __leaf__)); extern long double __gammal (long double) __attribute__ ((__nothrow__ , __leaf__));
extern long double lgammal_r (long double, int *__signgamp) __attribute__ ((__nothrow__ , __leaf__)); extern long double __lgammal_r (long double, int *__signgamp) __attribute__ ((__nothrow__ , __leaf__));
extern long double rintl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __rintl (long double __x) __attribute__ ((__nothrow__ , __leaf__));
extern long double nextafterl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern long double __nextafterl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__));
extern long double nexttowardl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern long double __nexttowardl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__));
# 272 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4
extern long double remainderl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern long double __remainderl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__));
extern long double scalbnl (long double __x, int __n) __attribute__ ((__nothrow__ , __leaf__)); extern long double __scalbnl (long double __x, int __n) __attribute__ ((__nothrow__ , __leaf__));
extern int ilogbl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern int __ilogbl (long double __x) __attribute__ ((__nothrow__ , __leaf__));
# 290 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4
extern long double scalblnl (long double __x, long int __n) __attribute__ ((__nothrow__ , __leaf__)); extern long double __scalblnl (long double __x, long int __n) __attribute__ ((__nothrow__ , __leaf__));
extern long double nearbyintl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __nearbyintl (long double __x) __attribute__ ((__nothrow__ , __leaf__));
extern long double roundl (long double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double __roundl (long double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern long double truncl (long double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double __truncl (long double __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern long double remquol (long double __x, long double __y, int *__quo) __attribute__ ((__nothrow__ , __leaf__)); extern long double __remquol (long double __x, long double __y, int *__quo) __attribute__ ((__nothrow__ , __leaf__));
extern long int lrintl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long int __lrintl (long double __x) __attribute__ ((__nothrow__ , __leaf__));
__extension__
extern long long int llrintl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long long int __llrintl (long double __x) __attribute__ ((__nothrow__ , __leaf__));
extern long int lroundl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long int __lroundl (long double __x) __attribute__ ((__nothrow__ , __leaf__));
__extension__
extern long long int llroundl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long long int __llroundl (long double __x) __attribute__ ((__nothrow__ , __leaf__));
extern long double fdiml (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)); extern long double __fdiml (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__));
extern long double fmaxl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double __fmaxl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern long double fminl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern long double __fminl (long double __x, long double __y) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern long double fmal (long double __x, long double __y, long double __z) __attribute__ ((__nothrow__ , __leaf__)); extern long double __fmal (long double __x, long double __y, long double __z) __attribute__ ((__nothrow__ , __leaf__));
# 400 "/usr/include/x86_64-linux-gnu/bits/mathcalls.h" 3 4
extern long double scalbl (long double __x, long double __n) __attribute__ ((__nothrow__ , __leaf__)); extern long double __scalbl (long double __x, long double __n) __attribute__ ((__nothrow__ , __leaf__));
# 351 "/usr/include/math.h" 2 3 4
# 420 "/usr/include/math.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" 3 4
extern int __fpclassifyf128 (
# 21 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h"
float
# 21 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" 3 4
__value) __attribute__ ((__nothrow__ , __leaf__))
__attribute__ ((__const__));
extern int __signbitf128 (
# 25 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h"
float
# 25 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" 3 4
__value) __attribute__ ((__nothrow__ , __leaf__))
__attribute__ ((__const__));
extern int __isinff128 (
# 30 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h"
float
# 30 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" 3 4
__value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern int __finitef128 (
# 33 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h"
float
# 33 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" 3 4
__value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern int __isnanf128 (
# 36 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h"
float
# 36 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" 3 4
__value) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern int __iseqsigf128 (
# 39 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h"
float
# 39 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" 3 4
__x,
# 39 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h"
float
# 39 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" 3 4
__y) __attribute__ ((__nothrow__ , __leaf__));
extern int __issignalingf128 (
# 42 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h"
float
# 42 "/usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h" 3 4
__value) __attribute__ ((__nothrow__ , __leaf__))
__attribute__ ((__const__));
# 421 "/usr/include/math.h" 2 3 4
# 773 "/usr/include/math.h" 3 4
extern int signgam;
# 853 "/usr/include/math.h" 3 4
enum
{
FP_NAN =
0,
FP_INFINITE =
1,
FP_ZERO =
2,
FP_SUBNORMAL =
3,
FP_NORMAL =
4
};
# 1338 "/usr/include/math.h" 3 4
# 12 "./linear-algebra/kernels/trisolv/trisolv.c" 2
# 1 "utilities/polybench.h" 1
# 188 "utilities/polybench.h"
# 188 "utilities/polybench.h"
extern void* polybench_alloc_data(int n, int elt_size);
# 15 "./linear-algebra/kernels/trisolv/trisolv.c" 2
# 1 "./linear-algebra/kernels/trisolv/trisolv.h" 1
# 19 "./linear-algebra/kernels/trisolv/trisolv.c" 2
static
void init_array(int n,
double A[4000 + 0][4000 + 0],
double x[4000 + 0],
double c[4000 + 0])
{
int i, j;
for (i = 0; i < n; i++)
{
c[i] = x[i] = ((double) i) / n;
for (j = 0; j < n; j++)
A[i][j] = ((double) i*j) / n;
}
}
static
void print_array(int n,
double x[4000 + 0])
{
int i;
for (i = 0; i < n; i++) {
fprintf (
# 49 "./linear-algebra/kernels/trisolv/trisolv.c" 3 4
stderr
# 49 "./linear-algebra/kernels/trisolv/trisolv.c"
, "%0.2lf ", x[i]);
if (i % 20 == 0) fprintf (
# 50 "./linear-algebra/kernels/trisolv/trisolv.c" 3 4
stderr
# 50 "./linear-algebra/kernels/trisolv/trisolv.c"
, "\n");
}
}
static
void kernel_trisolv(int n,
double A[4000 + 0][4000 + 0],
double x[4000 + 0],
double c[4000 + 0])
{
int i, j;
#pragma scop
for (i = 0; i < n; i++)
{
x[i] = c[i];
for (j = 0; j <= i - 1; j++)
x[i] = x[i] - A[i][j] * x[j];
x[i] = x[i] / A[i][i];
}
#pragma endscop
}
int main(int argc, char** argv)
{
int n = 4000;
double (*A)[4000 + 0][4000 + 0]; A = (double(*)[4000 + 0][4000 + 0])polybench_alloc_data ((4000 + 0) * (4000 + 0), sizeof(double));;
double (*x)[4000 + 0]; x = (double(*)[4000 + 0])polybench_alloc_data (4000 + 0, sizeof(double));;
double (*c)[4000 + 0]; c = (double(*)[4000 + 0])polybench_alloc_data (4000 + 0, sizeof(double));;
init_array (n, *A, *x, *c);
;
kernel_trisolv (n, *A, *x, *c);
;
;
if (argc > 42 && ! strcmp(argv[0], "")) print_array(n, *x);
free((void*)A);;
free((void*)x);;
free((void*)c);;
return 0;
}
|
the_stack_data/75136991.c | // PR tree-optimization/79196
// { dg-do run }
int
__attribute__((noinline))
test(char *a)
{
if (__builtin_strstr (a, "DROP CONVERSION") == a)
return 1;
return 0;
}
int main(int argc, char **argv)
{
return test ("x");
}
|
the_stack_data/57950072.c | #include <stdio.h>
#define MAXS 30
/*
Scrivere un programma che acquisisce una stringa s1 di al massimo 30
caratteri dell'alfabeto minuscolo e segni di interpunzione o spazi
(si assuma che l'utente non commetta alcun errore di inserimento) e
costruisce una nuova stringa s2 che contiene la stesso testo
convertendo i caratteri dell'alfabeto minuscolo in maiuscolo.
Esempio: s1="ciao amico." -> s2="CIAO AMICO.".
*/
int main() {
char s1[MAXS + 1], s2[MAXS + 1];
int i;
scanf("%[^\n]", s1);
for (i = 0; s1[i] != '\0'; i++) {
if (s1[i] >= 'a' && s1[i] <= 'z')
s2[i] = s1[i] - 'a' + 'A';
else
s2[i] = s1[i];
}
s2[i] = '\0';
printf("%s\n", s2);
return 0;
}
|
the_stack_data/1264795.c | extern void __VERIFIER_error() __attribute__ ((__noreturn__));
void __VERIFIER_assert(int cond) { if(!(cond)) { ERROR: __VERIFIER_error(); } }
#define N 125
int main( ) {
int a1[N];
int a2[N];
int a3[N];
int a4[N];
int a5[N];
int a6[N];
int a7[N];
int i;
for ( i = 0 ; i < N ; i++ ) {
a2[i] = a1[i];
}
for ( i = 0 ; i < N ; i++ ) {
a3[i] = a2[i];
}
for ( i = 0 ; i < N ; i++ ) {
a4[i] = a3[i];
}
for ( i = 0 ; i < N ; i++ ) {
a5[i] = a4[i];
}
for ( i = 0 ; i < N ; i++ ) {
a7[i] = a5[i];
}
for ( i = 0 ; i < N ; i++ ) {
a7[i] = a6[i];
}
int x;
for ( x = 0 ; x < N ; x++ ) {
__VERIFIER_assert( a1[x] == a7[x] );
}
return 0;
}
|
the_stack_data/255940.c | #include <stdio.h>
#include <math.h>
void add(float *a, float *b){
*a = *a + *b;
}
int main()
{
float p,q,*a,*b;
printf("Enter the two numbers :\n");
scanf("%f%f",&p,&q);
a = &p;
b = &q;
add(a,b);
printf("The sum of the 2 numbers is %.3f",p);
return 0;
}
|
the_stack_data/153663.c | /*
################################################################################
#
# Copyright 2020-2021 Inango Systems Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################
*/
#include <stdlib.h>
#include <stdio.h>
#include <getopt.h>
#include <stdbool.h>
#include <unistd.h>
#include <string.h>
#include <signal.h>
#include <fcntl.h>
#include <ctype.h>
#include <errno.h>
#include <time.h>
#include <stdarg.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/select.h>
#include <sys/queue.h>
#include <sys/wait.h>
#include <sys/un.h>
#include <net/if.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
// logging
#define DEBUG(...) writeLog(DEBUG, __VA_ARGS__)
#define INFO(...) writeLog(INFO, __VA_ARGS__)
#define ERROR(...) writeLog(ERROR, __VA_ARGS__)
#define ERROR_ERRNO(message) ERROR(message " (errno %d: %s)", errno, strerror(errno))
// common
#define ARRSZ(p) (sizeof(p) / sizeof(p[0]))
#define MAX(x, y) ((x) > (y) ? (x) : (y))
// default configuration
#define MAX_CONNECTIONS (FD_SETSIZE-1)
#define SOCKET_OPTION_ENABLE 1
// for getopt
#define SIP_PARAM 300
#define DIP_PARAM 301
#define SPORT_PARAM 302
#define DPORT_PARAM 303
enum verbosity
{
LOWEST_VERBOSITY = 0,
SILENT = LOWEST_VERBOSITY,
ERROR,
WARNING,
INFO,
DEBUG,
HIGHEST_VERBOSITY = DEBUG,
};
struct Options
{
int srcPort;
int dstPort;
struct in_addr srcIP;
struct in_addr dstIP;
int bindToInterface;
char networkInterface[IFNAMSIZ];
size_t exchangeBufferSize;
enum verbosity currentVerbosityLevel;
};
static struct Options globalOptions = {0};
static int globalProxyServerSocket = 0;
static int parseOptions(int argc, char *argv[]);
static void sighandler(int signum);
static int configSignals(void);
static void usage(const char* programName);
static void setDefaults();
static void cleanup();
static void writeLog(enum verbosity level, const char* message, ...);
static int socketWrite(int fd, char* buffer, int bufferSize);
static int exchange(int from, int to, char* exchangeBuffer);
static void fillFDSet2(fd_set* set, int fd1, int fd2);
static void exchangeLoop(int clientfd, int serverfd);
static void handleConnection(int clientSocket, struct sockaddr_in remoteServerAddr);
static void writeLog(enum verbosity level, const char* message, ...)
{
if ((level < LOWEST_VERBOSITY) || (level > HIGHEST_VERBOSITY)
|| (level == SILENT) || (level > globalOptions.currentVerbosityLevel))
{
return;
}
char str[300];
va_list args;
va_start(args, message);
vsnprintf(str, sizeof(str), message, args);
time_t lt = time(NULL);
struct tm* ptr = localtime(<);
printf("%02d/%02d/%04d %02d:%02d:%02d [PID %d] %s\n", ptr->tm_mday, ptr->tm_mon+1, ptr->tm_year+1900,
ptr->tm_hour, ptr->tm_min, ptr->tm_sec,
getpid(), str);
va_end(args);
}
static int socketWrite(int fd, char* buffer, int bufferSize)
{
int nleft, nwritten;
nleft = bufferSize;
while (nleft > 0)
{
nwritten = send(fd, buffer, nleft, MSG_NOSIGNAL);
if (nwritten <= 0) {
ERROR("socketWrite error, fd = %d, size = %d, errno = %s, nleft = %d, write returned %d", fd, bufferSize, strerror(errno), nleft, nwritten);
return nwritten;
}
nleft -= nwritten;
buffer += nwritten;
}
return (bufferSize - nleft);
}
static void usage(const char* programName)
{
printf("Usage: %s --dst-ip <IP address> --src-port <INTEGER> [OTHER OPTIONS]\n\n", programName);
printf("\t--src-ip <IP address>, proxy server ip address (default: 0.0.0.0)\n"
"\t--dst-ip <IP address>, remote server ip address (mandatory argument)\n"
"\t--src-port <INTEGER>, proxy server port (mandatory argument)\n"
"\t--dst-port <INTEGER>, destination port (default: value of --src-port)\n"
"\t-i, --interface <STRING>, network interface to bind to\n"
"\t-b, --buffer-size <INTEGER>, size of buffer used to move data between client and server, in bytes (default: 16KiB)\n"
"\t-v, --verbose, increase verbosity (default level: INFO, one -v to get to highest verbosity (DEBUG))\n"
"\t-h, --help, show this help message\n");
}
#define CHECK_MANDATORY_OPTION(option, optionName) \
if (haveOption.option == 0) { \
ERROR("missing mandatory option: %s", optionName); \
return -1; \
}
static int parseOptions(int argc, char *argv[])
{
int c;
// 1 if option was found on command line, 0 otherwise
struct mandatoryOptions {
int dstIP;
int srcPort;
} haveOption = {0};
while (1) {
int option_index = 0;
static struct option proxy_long_options[] = {
{"src-ip", 1, NULL, SIP_PARAM},
{"dst-ip", 1, NULL, DIP_PARAM},
{"src-port", 1, NULL, SPORT_PARAM},
{"dst-port", 1, NULL, DPORT_PARAM},
{"interface", 1, NULL, 'i'},
{"buffer-size", 1, NULL, 'b'},
{"verbose", 0, NULL, 'v'},
{"help", 0, NULL, 'h'},
{0, 0, NULL, 0}
};
c = getopt_long(argc, argv, "i:b:vh",
proxy_long_options, &option_index);
if (c == -1)
break;
switch (c) {
case 'h':
usage(argv[0]);
return -1;
case SIP_PARAM:
if (optarg)
{
inet_aton(optarg, &globalOptions.srcIP);
}
break;
case DIP_PARAM:
if (optarg)
{
inet_aton(optarg, &globalOptions.dstIP);
haveOption.dstIP = 1;
}
break;
case SPORT_PARAM:
if (optarg)
{
globalOptions.srcPort = atoi(optarg);
haveOption.srcPort = 1;
}
break;
case DPORT_PARAM:
if (optarg)
{
globalOptions.dstPort = atoi(optarg);
}
break;
case 'i':
if (optarg)
{
strncpy(globalOptions.networkInterface, optarg, IFNAMSIZ);
globalOptions.bindToInterface = 1;
}
break;
case 'b':
{
char** endptr = NULL;
errno = 0;
size_t newSize = strtoul(optarg, endptr, 10);
if ((newSize == 0) || (endptr != NULL) || (isdigit(optarg[0]) == 0) || (errno != 0))
{
ERROR("invalid size of exchange buffer");
return -1;
}
globalOptions.exchangeBufferSize = newSize;
break;
}
case 'v':
if (globalOptions.currentVerbosityLevel < HIGHEST_VERBOSITY)
{
globalOptions.currentVerbosityLevel += 1;
}
break;
default:
break;
}
}
// check if all mandatory options are set OR EXIT WITH -1
CHECK_MANDATORY_OPTION(dstIP, "--dst-ip");
CHECK_MANDATORY_OPTION(srcPort, "--src-port");
if (globalOptions.dstPort == 0)
{
INFO("--dst-port not supplied, using --src-port for its value");
globalOptions.dstPort = globalOptions.srcPort;
}
return 0;
}
// executes when we receive signals (see `configSignals`)
static void sighandler(int signum)
{
INFO("exiting due to signal %d", signum);
cleanup();
exit(0);
}
static int configSignals()
{
struct sigaction act;
int sigs[] = { SIGINT, SIGTERM };
memset(&act, 0, sizeof(act));
act.sa_handler = sighandler;
act.sa_flags = SA_RESTART;
size_t n;
for (n = 0; n < ARRSZ(sigs); n++)
{
if (sigaction(sigs[n], &act, NULL) < 0)
{
ERROR_ERRNO("sigaction");
exit(-1);
}
}
return 0;
}
static int exchange(int from, int to, char* exchangeBuffer)
{
ssize_t readCount, writeCount;
readCount = read(from, exchangeBuffer, globalOptions.exchangeBufferSize);
if (readCount < 0)
{
ERROR("error reading from fd %d: %s (%d)", from, strerror(errno), errno);
return -1;
}
else if (readCount == 0)
{
INFO("client closed the connection (fd %d)", from);
return -1;
}
writeCount = socketWrite(to, exchangeBuffer, readCount);
if (writeCount != readCount)
{
DEBUG("tried to write %ld bytes to fd %d, but wrote %ld", readCount, to, writeCount);
return -1;
}
return 0;
}
static void fillFDSet2(fd_set* set, int fd1, int fd2)
{
FD_ZERO(set);
FD_SET(fd1, set);
FD_SET(fd2, set);
}
static void exchangeLoop(int clientfd, int serverfd)
{
fd_set readfds;
fd_set exceptfds;
char* exchangeBuffer = malloc(globalOptions.exchangeBufferSize);
DEBUG("fds: client=%d; server=%d", clientfd, serverfd);
const int maxSocket = MAX(clientfd, serverfd);
while (1)
{
fillFDSet2(&readfds, clientfd, serverfd);
fillFDSet2(&exceptfds, clientfd, serverfd);
int retval = select(maxSocket+1, &readfds, NULL, &exceptfds, NULL);
if (retval <= 0)
{
ERROR_ERRNO("select");
break;
}
if (FD_ISSET(clientfd, &readfds))
{
if (exchange(clientfd, serverfd, exchangeBuffer) == -1)
{
break;
}
}
if (FD_ISSET(serverfd, &readfds))
{
if (exchange(serverfd, clientfd, exchangeBuffer) == -1)
{
break;
}
}
if (FD_ISSET(clientfd, &exceptfds))
{
DEBUG("exceptional condition on client fd (see the discussion of POLLPRI in poll(2))");
if (exchange(clientfd, serverfd, exchangeBuffer) == -1)
{
break;
}
}
if (FD_ISSET(serverfd, &exceptfds))
{
DEBUG("exceptional condition on server fd (see the discussion of POLLPRI in poll(2))");
if (exchange(serverfd, clientfd, exchangeBuffer) == -1)
{
break;
}
}
}
free(exchangeBuffer);
DEBUG("closing connection (client=%d; server=%d)", clientfd, serverfd);
}
// this function is used as entry point for forked processes
static void handleConnection(int clientSocket, struct sockaddr_in remoteServerAddr)
{
int optval = SOCKET_OPTION_ENABLE;
int serverSocket;
if (setsockopt(clientSocket, SOL_SOCKET, SO_KEEPALIVE, &optval, sizeof(optval)) < 0)
{
ERROR_ERRNO("setsockopt failed to set keep-alive for client (proxy connection will not be created)");
goto close_client;
}
// socket for remote server connection
if ((serverSocket = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
ERROR_ERRNO("failed to create socket (proxy connection will not be created)");
goto close_client;
}
DEBUG("Connect to remote server");
// create connection to remote server
if (connect(serverSocket, (struct sockaddr *) &remoteServerAddr, sizeof(struct sockaddr)) < 0)
{
ERROR_ERRNO("failed to connect to remote server (proxy connection will not be created)");
goto close_both;
}
if (setsockopt(serverSocket, SOL_SOCKET, SO_KEEPALIVE, &optval, sizeof(optval)) < 0)
{
ERROR_ERRNO("setsockopt failed to set keep-alive for server (proxy connection will not be created)");
goto close_both;
}
exchangeLoop(clientSocket, serverSocket);
close_both:
close(serverSocket);
close_client:
close(clientSocket);
exit(0);
}
static void setDefaults()
{
globalOptions.srcIP.s_addr = INADDR_ANY;
globalOptions.exchangeBufferSize = 16384; // 16KiB
globalOptions.currentVerbosityLevel = INFO;
globalOptions.bindToInterface = 0;
globalOptions.networkInterface[0] = '\0';
}
static void cleanup()
{
close(globalProxyServerSocket);
}
int main(int argc, char *argv[])
{
setDefaults();
if (parseOptions(argc, argv) < 0)
{
printf("\n");
usage(argv[0]);
return -1;
}
const struct sockaddr_in proxyServerAddr = {
.sin_family = AF_INET,
.sin_port = htons(globalOptions.srcPort),
.sin_addr = globalOptions.srcIP,
};
struct sockaddr_in remoteServerAddr = {
.sin_family = AF_INET,
.sin_port = htons(globalOptions.dstPort),
.sin_addr = globalOptions.dstIP,
};
configSignals();
signal(SIGCHLD, SIG_IGN);
if ((globalProxyServerSocket = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
ERROR_ERRNO("could not create socket (terminating program)");
return -1;
}
if (globalOptions.bindToInterface)
{
if (setsockopt(globalProxyServerSocket, SOL_SOCKET, SO_BINDTODEVICE, globalOptions.networkInterface, strlen(globalOptions.networkInterface)) < 0)
{
ERROR_ERRNO("setsockopt(SO_BINDTODEVICE) failed");
return -1;
}
}
if (bind(globalProxyServerSocket, (const struct sockaddr *)&proxyServerAddr, sizeof(struct sockaddr)) < 0) {
ERROR_ERRNO("could not bind to specified IP and port (terminating program)");
return -1;
}
if (listen(globalProxyServerSocket, MAX_CONNECTIONS) < 0) {
ERROR_ERRNO("could not listen on socket (terminating program)");
return -1;
}
while (1)
{
// new client
int clientSocket;
socklen_t sin_size = sizeof(struct sockaddr_in);
struct sockaddr_in c_addr = {0};
if ((clientSocket = accept(globalProxyServerSocket, (struct sockaddr *)&c_addr, &sin_size)) < 0)
{
ERROR_ERRNO("could not accept client connection, waiting for next client");
continue;
}
INFO("server: got connection from %s", inet_ntoa(c_addr.sin_addr));
int pid = fork();
if (pid == 0)
{
// child process
handleConnection(clientSocket, remoteServerAddr);
close(globalProxyServerSocket);
}
else if (pid < 0)
{
ERROR_ERRNO("fork failed");
}
close(clientSocket);
} // main loop
cleanup();
return 0;
}
|
the_stack_data/193892656.c | /**************************************************************************//**
* @file startup_em359x.c
* @brief Startup file for GCC compilers
* Should be used with GCC 'GNU Tools ARM Embedded'
* @version 5.8.3
******************************************************************************
* @section License
* <b>(C) Copyright 2018 Silicon Labs, www.silabs.com</b>
*******************************************************************************
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
* DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Silicon Labs has no
* obligation to support this Software. Silicon Labs is providing the
* Software "AS IS", with no express or implied warranties of any kind,
* including, but not limited to, any implied warranties of merchantability
* or fitness for any particular purpose or warranties against infringement
* of any proprietary rights of a third party.
*
* Silicon Labs will not be liable for any consequential, incidental, or
* special damages, or any other relief, or for any claim by any third party,
* arising from your use of this Software.
*
******************************************************************************/
#include <stdint.h>
#include <stdbool.h>
/*----------------------------------------------------------------------------
* Linker generated Symbols
*----------------------------------------------------------------------------*/
extern uint32_t __etext;
extern uint32_t __data_start__;
extern uint32_t __data_end__;
extern uint32_t __copy_table_start__;
extern uint32_t __copy_table_end__;
extern uint32_t __zero_table_start__;
extern uint32_t __zero_table_end__;
extern uint32_t __bss_start__;
extern uint32_t __bss_end__;
extern uint32_t __StackTop;
/*----------------------------------------------------------------------------
* Exception / Interrupt Handler Function Prototype
*----------------------------------------------------------------------------*/
typedef union {
void (*pFunc)(void);
void *topOfStack;
} tVectorEntry;
/*----------------------------------------------------------------------------
* External References
*----------------------------------------------------------------------------*/
#ifndef __START
extern void _start(void) __attribute__((noreturn)); /* Pre Main (C library entry point) */
#else
extern int __START(void) __attribute__((noreturn)); /* main entry point */
#endif
#ifndef __NO_SYSTEM_INIT
extern void SystemInit(void); /* CMSIS System Initialization */
#endif
/*----------------------------------------------------------------------------
* Internal References
*----------------------------------------------------------------------------*/
void Default_Handler(void); /* Default empty handler */
void Reset_Handler(void); /* Reset Handler */
/*----------------------------------------------------------------------------
* User Initial Stack & Heap
*----------------------------------------------------------------------------*/
#ifndef __STACK_SIZE
#define __STACK_SIZE 0x00000400
#endif
static uint8_t stack[__STACK_SIZE] __attribute__ ((aligned(8), used, section(".stack")));
#ifndef __HEAP_SIZE
#define __HEAP_SIZE 0x00000C00
#endif
#if __HEAP_SIZE > 0
static uint8_t heap[__HEAP_SIZE] __attribute__ ((aligned(8), used, section(".heap")));
#endif
/*----------------------------------------------------------------------------
* Exception / Interrupt Handler
*----------------------------------------------------------------------------*/
/* Cortex-M Processor Exceptions */
void NMI_Handler(void) __attribute__ ((weak, alias("Default_Handler")));
void HardFault_Handler(void) __attribute__ ((weak, alias("Default_Handler")));
void MemManage_Handler(void) __attribute__ ((weak, alias("Default_Handler")));
void BusFault_Handler(void) __attribute__ ((weak, alias("Default_Handler")));
void UsageFault_Handler(void) __attribute__ ((weak, alias("Default_Handler")));
void DebugMon_Handler(void) __attribute__ ((weak, alias("Default_Handler")));
void SVC_Handler(void) __attribute__ ((weak, alias("Default_Handler")));
void PendSV_Handler(void) __attribute__ ((weak, alias("Default_Handler")));
void SysTick_Handler(void) __attribute__ ((weak, alias("Default_Handler")));
/* Part Specific Interrupts */
void TIM1_IRQHandler(void) __attribute__ ((weak, alias("Default_Handler")));
void TIM2_IRQHandler(void) __attribute__ ((weak, alias("Default_Handler")));
void MGMT_IRQHandler(void) __attribute__ ((weak, alias("Default_Handler")));
void BB_IRQHandler(void) __attribute__ ((weak, alias("Default_Handler")));
void SLEEPTMR_IRQHandler(void) __attribute__ ((weak, alias("Default_Handler")));
void SC1_IRQHandler(void) __attribute__ ((weak, alias("Default_Handler")));
void SC2_IRQHandler(void) __attribute__ ((weak, alias("Default_Handler")));
void AESCCM_IRQHandler(void) __attribute__ ((weak, alias("Default_Handler")));
void MACTMR_IRQHandler(void) __attribute__ ((weak, alias("Default_Handler")));
void MACTX_IRQHandler(void) __attribute__ ((weak, alias("Default_Handler")));
void MACRX_IRQHandler(void) __attribute__ ((weak, alias("Default_Handler")));
void ADC_IRQHandler(void) __attribute__ ((weak, alias("Default_Handler")));
void IRQA_IRQHandler(void) __attribute__ ((weak, alias("Default_Handler")));
void IRQB_IRQHandler(void) __attribute__ ((weak, alias("Default_Handler")));
void IRQC_IRQHandler(void) __attribute__ ((weak, alias("Default_Handler")));
void IRQD_IRQHandler(void) __attribute__ ((weak, alias("Default_Handler")));
void DEBUG_IRQHandler(void) __attribute__ ((weak, alias("Default_Handler")));
void SC3_IRQHandler(void) __attribute__ ((weak, alias("Default_Handler")));
void SC4_IRQHandler(void) __attribute__ ((weak, alias("Default_Handler")));
void USB_IRQHandler(void) __attribute__ ((weak, alias("Default_Handler")));
/*----------------------------------------------------------------------------
* Exception / Interrupt Vector table
*----------------------------------------------------------------------------*/
extern const tVectorEntry __Vectors[];
const tVectorEntry __Vectors[] __attribute__ ((section(".vectors"))) = {
/* Cortex-M Exception Handlers */
{ .topOfStack = &__StackTop }, /* Initial Stack Pointer */
{ Reset_Handler }, /* Reset Handler */
{ NMI_Handler }, /* NMI Handler */
{ HardFault_Handler }, /* Hard Fault Handler */
{ MemManage_Handler }, /* MPU Fault Handler */
{ BusFault_Handler }, /* Bus Fault Handler */
{ UsageFault_Handler }, /* Usage Fault Handler */
{ Default_Handler }, /* Reserved */
{ Default_Handler }, /* Reserved */
{ Default_Handler }, /* Reserved */
{ Default_Handler }, /* Reserved */
{ SVC_Handler }, /* SVCall Handler */
{ DebugMon_Handler }, /* Debug Monitor Handler */
{ Default_Handler }, /* Reserved */
{ PendSV_Handler }, /* PendSV Handler */
{ SysTick_Handler }, /* SysTick Handler */
/* External interrupts */
{ TIM1_IRQHandler }, /*0 - TIM1 */
{ TIM2_IRQHandler }, /*1 - TIM2 */
{ MGMT_IRQHandler }, /*2 - MGMT */
{ BB_IRQHandler }, /*3 - BB */
{ SLEEPTMR_IRQHandler }, /*4 - SLEEPTMR */
{ SC1_IRQHandler }, /*5 - SC1 */
{ SC2_IRQHandler }, /*6 - SC2 */
{ AESCCM_IRQHandler }, /*7 - AESCCM */
{ MACTMR_IRQHandler }, /*8 - MACTMR */
{ MACTX_IRQHandler }, /*9 - MACTX */
{ MACRX_IRQHandler }, /*10 - MACRX */
{ ADC_IRQHandler }, /*11 - ADC */
{ IRQA_IRQHandler }, /*12 - IRQA */
{ IRQB_IRQHandler }, /*13 - IRQB */
{ IRQC_IRQHandler }, /*14 - IRQC */
{ IRQD_IRQHandler }, /*15 - IRQD */
{ DEBUG_IRQHandler }, /*16 - DEBUG */
{ SC3_IRQHandler }, /*17 - SC3 */
{ SC4_IRQHandler }, /*18 - SC4 */
{ USB_IRQHandler }, /*19 - USB */
};
//
// Start Handler called by SystemInit to start the main program running.
// Since IAR and GCC have very different semantics for this, they are
// wrapped in this function that can be called by common code without
// worrying about which compiler is being used.
//
void Start_Handler(void)
{
uint32_t *pSrc, *pDest;
uint32_t *pTable __attribute__((unused));
/* Firstly it copies data from read only memory to RAM. There are two schemes
* to copy. One can copy more than one sections. Another can only copy
* one section. The former scheme needs more instructions and read-only
* data to implement than the latter.
* Macro __STARTUP_COPY_MULTIPLE is used to choose between two schemes. */
#ifdef __STARTUP_COPY_MULTIPLE
/* Multiple sections scheme.
*
* Between symbol address __copy_table_start__ and __copy_table_end__,
* there are array of triplets, each of which specify:
* offset 0: LMA of start of a section to copy from
* offset 4: VMA of start of a section to copy to
* offset 8: size of the section to copy. Must be multiply of 4
*
* All addresses must be aligned to 4 bytes boundary.
*/
pTable = &__copy_table_start__;
for (; pTable < &__copy_table_end__; pTable = pTable + 3) {
pSrc = (uint32_t *) *(pTable + 0);
pDest = (uint32_t *) *(pTable + 1);
for (; pDest < (uint32_t *) (*(pTable + 1) + *(pTable + 2)); ) {
*pDest++ = *pSrc++;
}
}
#else
/* Single section scheme.
*
* The ranges of copy from/to are specified by following symbols
* __etext: LMA of start of the section to copy from. Usually end of text
* __data_start__: VMA of start of the section to copy to
* __data_end__: VMA of end of the section to copy to
*
* All addresses must be aligned to 4 bytes boundary.
*/
pSrc = &__etext;
pDest = &__data_start__;
for (; pDest < &__data_end__; ) {
*pDest++ = *pSrc++;
}
#endif /*__STARTUP_COPY_MULTIPLE */
/* This part of work usually is done in C library startup code. Otherwise,
* define this macro to enable it in this startup.
*
* There are two schemes too. One can clear multiple BSS sections. Another
* can only clear one section. The former is more size expensive than the
* latter.
*
* Define macro __STARTUP_CLEAR_BSS_MULTIPLE to choose the former.
* Otherwise efine macro __STARTUP_CLEAR_BSS to choose the later.
*/
#ifdef __STARTUP_CLEAR_BSS_MULTIPLE
/* Multiple sections scheme.
*
* Between symbol address __copy_table_start__ and __copy_table_end__,
* there are array of tuples specifying:
* offset 0: Start of a BSS section
* offset 4: Size of this BSS section. Must be multiply of 4
*/
pTable = &__zero_table_start__;
for (; pTable < &__zero_table_end__; pTable = pTable + 2) {
pDest = (uint32_t *) *(pTable + 0);
for (; pDest < (uint32_t *) (*(pTable + 0) + *(pTable + 1)); ) {
*pDest++ = 0UL;
}
}
#elif defined (__STARTUP_CLEAR_BSS)
/* Single BSS section scheme.
*
* The BSS section is specified by following symbols
* __bss_start__: start of the BSS section.
* __bss_end__: end of the BSS section.
*
* Both addresses must be aligned to 4 bytes boundary.
*/
pDest = &__bss_start__;
for (; pDest < &__bss_end__; ) {
*pDest++ = 0UL;
}
#endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
#ifndef __START
#define __START _start
#endif
__START();
}
/*----------------------------------------------------------------------------
* Reset Handler called on controller reset
*----------------------------------------------------------------------------*/
void Reset_Handler(void)
{
#ifndef __NO_SYSTEM_INIT
SystemInit();
#else
Start_Handler();
#endif
}
/*----------------------------------------------------------------------------
* Default Handler for Exceptions / Interrupts
*----------------------------------------------------------------------------*/
void Default_Handler(void)
{
// The Default_Handler is for unimplemented handlers. Trap execution.
while (true) {
}
}
/*----------------------------------------------------------------------------
* Exit function, in case main ever accidentally returns.
*
* A GCC compilation that uses more than "nosys.specs" needs an exit() function.
* Ideally once START passes control to main, the code should never return.
*----------------------------------------------------------------------------*/
void exit(int status)
{
// Trap execution in case main accidentally returns.
while (true) {
}
}
|
the_stack_data/29824780.c | #include <stdio.h>
int main()
{
if (sizeof(void*) == 8) // Assume 64-bit Linux if pointers are 8 bytes.
printf("-DLIN64 ");
else
printf("-DLIN ");
printf("-DSIZEOF_VOID_P=%d -DSIZEOF_LONG=%d -DSIZEOF_INT=%d\n",
(int)sizeof(void*),
(int)sizeof(long),
(int)sizeof(int) );
return 0;
}
|
the_stack_data/808833.c | // RUN: %clang_cc1 < %s -triple armv5e-none-linux-gnueabi -emit-llvm -O1 | FileCheck %s
// FIXME: This file should not be checking -O1 output.
// Ie, it is testing many IR optimizer passes as part of front-end verification.
enum memory_order {
memory_order_relaxed, memory_order_consume, memory_order_acquire,
memory_order_release, memory_order_acq_rel, memory_order_seq_cst
};
int *test_c11_atomic_fetch_add_int_ptr(_Atomic(int *) *p) {
// CHECK: test_c11_atomic_fetch_add_int_ptr
// CHECK: {{%[^ ]*}} = call i32 @__atomic_fetch_add_4(i8* noundef {{%[0-9]+}}, i32 noundef 12, i32 noundef 5)
return __c11_atomic_fetch_add(p, 3, memory_order_seq_cst);
}
int *test_c11_atomic_fetch_sub_int_ptr(_Atomic(int *) *p) {
// CHECK: test_c11_atomic_fetch_sub_int_ptr
// CHECK: {{%[^ ]*}} = call i32 @__atomic_fetch_sub_4(i8* noundef {{%[0-9]+}}, i32 noundef 20, i32 noundef 5)
return __c11_atomic_fetch_sub(p, 5, memory_order_seq_cst);
}
int test_c11_atomic_fetch_add_int(_Atomic(int) *p) {
// CHECK: test_c11_atomic_fetch_add_int
// CHECK: {{%[^ ]*}} = call i32 @__atomic_fetch_add_4(i8* noundef {{%[0-9]+}}, i32 noundef 3, i32 noundef 5)
return __c11_atomic_fetch_add(p, 3, memory_order_seq_cst);
}
int test_c11_atomic_fetch_sub_int(_Atomic(int) *p) {
// CHECK: test_c11_atomic_fetch_sub_int
// CHECK: {{%[^ ]*}} = call i32 @__atomic_fetch_sub_4(i8* noundef {{%[0-9]+}}, i32 noundef 5, i32 noundef 5)
return __c11_atomic_fetch_sub(p, 5, memory_order_seq_cst);
}
int *fp2a(int **p) {
// CHECK: @fp2a
// CHECK: {{%[^ ]*}} = call i32 @__atomic_fetch_sub_4(i8* noundef {{%[0-9]+}}, i32 noundef 4, i32 noundef 0)
// Note, the GNU builtins do not multiply by sizeof(T)!
return __atomic_fetch_sub(p, 4, memory_order_relaxed);
}
int test_atomic_fetch_add(int *p) {
// CHECK: test_atomic_fetch_add
// CHECK: {{%[^ ]*}} = call i32 @__atomic_fetch_add_4(i8* noundef {{%[0-9]+}}, i32 noundef 55, i32 noundef 5)
return __atomic_fetch_add(p, 55, memory_order_seq_cst);
}
int test_atomic_fetch_sub(int *p) {
// CHECK: test_atomic_fetch_sub
// CHECK: {{%[^ ]*}} = call i32 @__atomic_fetch_sub_4(i8* noundef {{%[0-9]+}}, i32 noundef 55, i32 noundef 5)
return __atomic_fetch_sub(p, 55, memory_order_seq_cst);
}
int test_atomic_fetch_and(int *p) {
// CHECK: test_atomic_fetch_and
// CHECK: {{%[^ ]*}} = call i32 @__atomic_fetch_and_4(i8* noundef {{%[0-9]+}}, i32 noundef 55, i32 noundef 5)
return __atomic_fetch_and(p, 55, memory_order_seq_cst);
}
int test_atomic_fetch_or(int *p) {
// CHECK: test_atomic_fetch_or
// CHECK: {{%[^ ]*}} = call i32 @__atomic_fetch_or_4(i8* noundef {{%[0-9]+}}, i32 noundef 55, i32 noundef 5)
return __atomic_fetch_or(p, 55, memory_order_seq_cst);
}
int test_atomic_fetch_xor(int *p) {
// CHECK: test_atomic_fetch_xor
// CHECK: {{%[^ ]*}} = call i32 @__atomic_fetch_xor_4(i8* noundef {{%[0-9]+}}, i32 noundef 55, i32 noundef 5)
return __atomic_fetch_xor(p, 55, memory_order_seq_cst);
}
int test_atomic_fetch_nand(int *p) {
// CHECK: test_atomic_fetch_nand
// CHECK: {{%[^ ]*}} = call i32 @__atomic_fetch_nand_4(i8* noundef {{%[0-9]+}}, i32 noundef 55, i32 noundef 5)
return __atomic_fetch_nand(p, 55, memory_order_seq_cst);
}
int test_atomic_add_fetch(int *p) {
// CHECK: test_atomic_add_fetch
// CHECK: [[CALL:%[^ ]*]] = call i32 @__atomic_fetch_add_4(i8* noundef {{%[0-9]+}}, i32 noundef 55, i32 noundef 5)
// CHECK: {{%[^ ]*}} = add i32 [[CALL]], 55
return __atomic_add_fetch(p, 55, memory_order_seq_cst);
}
int test_atomic_sub_fetch(int *p) {
// CHECK: test_atomic_sub_fetch
// CHECK: [[CALL:%[^ ]*]] = call i32 @__atomic_fetch_sub_4(i8* noundef {{%[0-9]+}}, i32 noundef 55, i32 noundef 5)
// CHECK: {{%[^ ]*}} = add i32 [[CALL]], -55
return __atomic_sub_fetch(p, 55, memory_order_seq_cst);
}
int test_atomic_and_fetch(int *p) {
// CHECK: test_atomic_and_fetch
// CHECK: [[CALL:%[^ ]*]] = call i32 @__atomic_fetch_and_4(i8* noundef {{%[0-9]+}}, i32 noundef 55, i32 noundef 5)
// CHECK: {{%[^ ]*}} = and i32 [[CALL]], 55
return __atomic_and_fetch(p, 55, memory_order_seq_cst);
}
int test_atomic_or_fetch(int *p) {
// CHECK: test_atomic_or_fetch
// CHECK: [[CALL:%[^ ]*]] = call i32 @__atomic_fetch_or_4(i8* noundef {{%[0-9]+}}, i32 noundef 55, i32 noundef 5)
// CHECK: {{%[^ ]*}} = or i32 [[CALL]], 55
return __atomic_or_fetch(p, 55, memory_order_seq_cst);
}
int test_atomic_xor_fetch(int *p) {
// CHECK: test_atomic_xor_fetch
// CHECK: [[CALL:%[^ ]*]] = call i32 @__atomic_fetch_xor_4(i8* noundef {{%[0-9]+}}, i32 noundef 55, i32 noundef 5)
// CHECK: {{%[^ ]*}} = xor i32 [[CALL]], 55
return __atomic_xor_fetch(p, 55, memory_order_seq_cst);
}
int test_atomic_nand_fetch(int *p) {
// CHECK: test_atomic_nand_fetch
// CHECK: [[CALL:%[^ ]*]] = call i32 @__atomic_fetch_nand_4(i8* noundef {{%[0-9]+}}, i32 noundef 55, i32 noundef 5)
// FIXME: We should not be checking optimized IR. It changes independently of clang.
// FIXME-CHECK: [[AND:%[^ ]*]] = and i32 [[CALL]], 55
// FIXME-CHECK: {{%[^ ]*}} = xor i32 [[AND]], -1
return __atomic_nand_fetch(p, 55, memory_order_seq_cst);
}
|
the_stack_data/54825502.c | /* ushyph.c */
/*****************************************************************************/
/* AS-Portierung */
/* */
/* Trennungsmuster (US-)englisch */
/* abgeleitet von 'ushyphen.tex' aus TeX */
/* */
/*****************************************************************************/
#include <stdio.h>
#ifndef __MSDOS__
char *USHyphens[]=
/* The Plain TeX hyphenation tables [NOT TO BE CHANGED IN ANY WAY!] */
{".ach4 .ad4der .af1t .al3t .am5at .an5c .ang4 .ani5m",
".ant4 .an3te .anti5s .ar5s .ar4tie .ar4ty .as3c",
".as1p .as1s .aster5 .atom5 .au1d .av4i .awn4",
".ba4g .ba5na .bas4e .ber4 .be5ra .be3sm .be5sto",
".bri2 .but4ti .cam4pe .can5c .capa5b .car5ol .ca4t",
".ce4la .ch4 .chill5i .ci2 .cit5r .co3e .co4r",
".cor5ner .de4moi .de3o .de3ra .de3ri .des4c .dictio5",
".do4t .du4c .dumb5 .earth5 .eas3i .eb4 .eer4",
".eg2 .el5d .el3em .enam3 .en3g .en3s .eq5ui5t",
".er4ri .es3 .eu3 .eye5 .fes3 .for5mer .ga2 .ge2",
".gen3t4 .ge5og .gi5a .gi4b .go4r .hand5i .han5k",
".he2 .hero5i .hes3 .het3 .hi3b .hi3er .hon5ey",
".hon3o .hov5 .id4l .idol3 .im3m .im5pin .in1",
".in3ci .ine2 .in2k .in3s .ir5r .is4i .ju3r .la4cy",
".la4m .lat5er .lath5 .le2 .leg5e .len4 .lep5",
".lev1 .li4g .lig5a .li2n .li3o .li4t .mag5a5",
".mal5o .man5a .mar5ti .me2 .mer3c .me5ter .mis1",
".mist5i .mon3e .mo3ro .mu5ta .muta5b .ni4c .od2",
".odd5 .of5te .or5ato .or3c .or1d .or3t .os3 .os4tl",
".oth3 .out3 .ped5al .pe5te .pe5tit .pi4e .pio5n",
".pi2t .pre3m .ra4c .ran4t .ratio5na .ree2 .re5mit",
".res2 .re5stat .ri4g .rit5u .ro4q .ros5t .row5d",
".ru4d .sci3e .self5 .sell5 .se2n .se5rie .sh2",
".si2 .sing4 .st4 .sta5bl .sy2 .ta4 .te4 .ten5an",
".th2 .ti2 .til4 .tim5o5 .ting4 .tin5k .ton4a",
".to4p .top5i .tou5s .trib5ut .un1a .un3ce .under5",
".un1e .un5k .un5o .un3u .up3 .ure3 .us5a .ven4de",
".ve5ra .wil5i .ye4 4ab. a5bal a5ban abe2 ab5erd",
"abi5a ab5it5ab ab5lat ab5o5liz 4abr ab5rog ab3ul",
"a4car ac5ard ac5aro a5ceou ac1er a5chet 4a2ci",
"a3cie ac1in a3cio ac5rob act5if ac3ul ac4um a2d",
"ad4din ad5er. 2adi a3dia ad3ica adi4er a3dio",
"a3dit a5diu ad4le ad3ow ad5ran ad4su 4adu a3duc",
"ad5um ae4r aeri4e a2f aff4 a4gab aga4n ag5ell",
"age4o 4ageu ag1i 4ag4l ag1n a2go 3agog ag3oni",
"a5guer ag5ul a4gy a3ha a3he ah4l a3ho ai2 a5ia",
"a3ic. ai5ly a4i4n ain5in ain5o ait5en a1j ak1en",
"al5ab al3ad a4lar 4aldi 2ale al3end a4lenti a5le5o",
"al1i al4ia. ali4e al5lev 4allic 4alm a5log. a4ly.",
"4alys 5a5lyst 5alyt 3alyz 4ama am5ab am3ag ama5ra",
"am5asc a4matis a4m5ato am5era am3ic am5if am5ily",
"am1in ami4no a2mo a5mon amor5i amp5en a2n an3age",
"3analy a3nar an3arc anar4i a3nati 4and ande4s",
"an3dis an1dl an4dow a5nee a3nen an5est. a3neu",
"2ang ang5ie an1gl a4n1ic a3nies an3i3f an4ime",
"a5nimi a5nine an3io a3nip an3ish an3it a3niu",
"an4kli 5anniz ano4 an5ot anoth5 an2sa an4sco",
"an4sn an2sp ans3po an4st an4sur antal4 an4tie",
"4anto an2tr an4tw an3ua an3ul a5nur 4ao apar4",
"ap5at ap5ero a3pher 4aphi a4pilla ap5illar ap3in",
"ap3ita a3pitu a2pl apoc5 ap5ola apor5i apos3t",
"aps5es a3pu aque5 2a2r ar3act a5rade ar5adis",
"ar3al a5ramete aran4g ara3p ar4at a5ratio ar5ativ",
"a5rau ar5av4 araw4 arbal4 ar4chan ar5dine ar4dr",
"ar5eas a3ree ar3ent a5ress ar4fi ar4fl ar1i ar5ial",
"ar3ian a3riet ar4im ar5inat ar3io ar2iz ar2mi",
"ar5o5d a5roni a3roo ar2p ar3q arre4 ar4sa ar2sh",
"4as. as4ab as3ant ashi4 a5sia. a3sib a3sic 5a5si4t",
"ask3i as4l a4soc as5ph as4sh as3ten as1tr asur5a",
"a2ta at3abl at5ac at3alo at5ap ate5c at5ech at3ego",
"at3en. at3era ater5n a5terna at3est at5ev 4ath",
"ath5em a5then at4ho ath5om 4ati. a5tia at5i5b",
"at1ic at3if ation5ar at3itu a4tog a2tom at5omiz",
"a4top a4tos a1tr at5rop at4sk at4tag at5te at4th",
"a2tu at5ua at5ue at3ul at3ura a2ty au4b augh3",
"au3gu au4l2 aun5d au3r au5sib aut5en au1th a2va",
"av3ag a5van ave4no av3era av5ern av5ery av1i",
"avi4er av3ig av5oc a1vor 3away aw3i aw4ly aws4",
"ax4ic ax4id ay5al aye4 ays4 azi4er azz5i 5ba.",
"bad5ger ba4ge bal1a ban5dag ban4e ban3i barbi5",
"bari4a bas4si 1bat ba4z 2b1b b2be b3ber bbi4na",
"4b1d 4be. beak4 beat3 4be2d be3da be3de be3di",
"be3gi be5gu 1bel be1li be3lo 4be5m be5nig be5nu",
"4bes4 be3sp be5str 3bet bet5iz be5tr be3tw be3w",
"be5yo 2bf 4b3h bi2b bi4d 3bie bi5en bi4er 2b3if",
"1bil bi3liz bina5r4 bin4d bi5net bi3ogr bi5ou",
"bi2t 3bi3tio bi3tr 3bit5ua b5itz b1j bk4 b2l2",
"blath5 b4le. blen4 5blesp b3lis b4lo blun4t 4b1m",
"4b3n bne5g 3bod bod3i bo4e bol3ic bom4bi bon4a",
"bon5at 3boo 5bor. 4b1ora bor5d 5bore 5bori 5bos4",
"b5ota both5 bo4to bound3 4bp 4brit broth3 2b5s2",
"bsor4 2bt bt4l b4to b3tr buf4fer bu4ga bu3li",
"bumi4 bu4n bunt4i bu3re bus5ie buss4e 5bust 4buta",
"3butio b5uto b1v 4b5w 5by. bys4 1ca cab3in",
"ca1bl cach4 ca5den 4cag4 2c5ah ca3lat cal4la",
"call5in 4calo can5d can4e can4ic can5is can3iz",
"can4ty cany4 ca5per car5om cast5er cas5tig 4casy",
"ca4th 4cativ cav5al c3c ccha5 cci4a ccompa5 ccon4",
"ccou3t 2ce. 4ced. 4ceden 3cei 5cel. 3cell 1cen",
"3cenc 2cen4e 4ceni 3cent 3cep ce5ram 4cesa 3cessi",
"ces5si5b ces5t cet4 c5e4ta cew4 2ch 4ch. 4ch3ab",
"5chanic ch5a5nis che2 cheap3 4ched che5lo 3chemi",
"ch5ene ch3er. ch3ers 4ch1in 5chine. ch5iness 5chini",
"5chio 3chit chi2z 3cho2 ch4ti 1ci 3cia ci2a5b",
"cia5r ci5c 4cier 5cific. 4cii ci4la 3cili 2cim",
"2cin c4ina 3cinat cin3em c1ing c5ing. 5cino cion4",
"4cipe ci3ph 4cipic 4cista 4cisti 2c1it cit3iz",
"5ciz ck1 ck3i 1c4l4 4clar c5laratio 5clare cle4m",
"4clic clim4 cly4 c5n 1co co5ag coe2 2cog co4gr",
"coi4 co3inc col5i 5colo col3or com5er con4a c4one",
"con3g con5t co3pa cop3ic co4pl 4corb coro3n cos4e",
"cov1 cove4 cow5a coz5e co5zi c1q cras5t 5crat.",
"5cratic cre3at 5cred 4c3reta cre4v cri2 cri5f",
"c4rin cris4 5criti cro4pl crop5o cros4e cru4d",
"4c3s2 2c1t cta4b ct5ang c5tant c2te c3ter c4ticu",
"ctim3i ctu4r c4tw cud5 c4uf c4ui cu5ity 5culi",
"cul4tis 3cultu cu2ma c3ume cu4mi 3cun cu3pi cu5py",
"cur5a4b cu5ria 1cus cuss4i 3c4ut cu4tie 4c5utiv",
"4cutr 1cy cze4 1d2a 5da. 2d3a4b dach4 4daf",
"2dag da2m2 dan3g dard5 dark5 4dary 3dat 4dativ",
"4dato 5dav4 dav5e 5day d1b d5c d1d4 2de. deaf5",
"deb5it de4bon decan4 de4cil de5com 2d1ed 4dee.",
"de5if deli4e del5i5q de5lo d4em 5dem. 3demic",
"dem5ic. de5mil de4mons demor5 1den de4nar de3no",
"denti5f de3nu de1p de3pa depi4 de2pu d3eq d4erh",
"5derm dern5iz der5s des2 d2es. de1sc de2s5o des3ti",
"de3str de4su de1t de2to de1v dev3il 4dey 4d1f",
"d4ga d3ge4t dg1i d2gy d1h2 5di. 1d4i3a dia5b",
"di4cam d4ice 3dict 3did 5di3en d1if di3ge di4lato",
"d1in 1dina 3dine. 5dini di5niz 1dio dio5g di4pl",
"dir2 di1re dirt5i dis1 5disi d4is3t d2iti 1di1v",
"d1j d5k2 4d5la 3dle. 3dled 3dles. 4dless 2d3lo",
"4d5lu 2dly d1m 4d1n4 1do 3do. do5de 5doe 2d5of",
"d4og do4la doli4 do5lor dom5iz do3nat doni4 doo3d",
"dop4p d4or 3dos 4d5out do4v 3dox d1p 1dr drag5on",
"4drai dre4 drea5r 5dren dri4b dril4 dro4p 4drow",
"5drupli 4dry 2d1s2 ds4p d4sw d4sy d2th 1du",
"d1u1a du2c d1uca duc5er 4duct. 4ducts du5el du4g",
"d3ule dum4be du4n 4dup du4pe d1v d1w d2y 5dyn",
"dy4se dys5p e1a4b e3act ead1 ead5ie ea4ge ea5ger",
"ea4l eal5er eal3ou eam3er e5and ear3a ear4c ear5es",
"ear4ic ear4il ear5k ear2t eart3e ea5sp e3ass",
"east3 ea2t eat5en eath3i e5atif e4a3tu ea2v eav3en",
"eav5i eav5o 2e1b e4bel. e4bels e4ben e4bit e3br",
"e4cad ecan5c ecca5 e1ce ec5essa ec2i e4cib ec5ificat",
"ec5ifie ec5ify ec3im eci4t e5cite e4clam e4clus",
"e2col e4comm e4compe e4conc e2cor ec3ora eco5ro",
"e1cr e4crem ec4tan ec4te e1cu e4cul ec3ula 2e2da",
"4ed3d e4d1er ede4s 4edi e3dia ed3ib ed3ica ed3im",
"ed1it edi5z 4edo e4dol edon2 e4dri e4dul ed5ulo",
"ee2c eed3i ee2f eel3i ee4ly ee2m ee4na ee4p1",
"ee2s4 eest4 ee4ty e5ex e1f e4f3ere 1eff e4fic",
"5efici efil4 e3fine ef5i5nite 3efit efor5es e4fuse.",
"4egal eger4 eg5ib eg4ic eg5ing e5git5 eg5n e4go.",
"e4gos eg1ul e5gur 5egy e1h4 eher4 ei2 e5ic",
"ei5d eig2 ei5gl e3imb e3inf e1ing e5inst eir4d",
"eit3e ei3th e5ity e1j e4jud ej5udi eki4n ek4la",
"e1la e4la. e4lac elan4d el5ativ e4law elaxa4",
"e3lea el5ebra 5elec e4led el3ega e5len e4l1er",
"e1les el2f el2i e3libe e4l5ic. el3ica e3lier",
"el5igib e5lim e4l3ing e3lio e2lis el5ish e3liv3",
"4ella el4lab ello4 e5loc el5og el3op. el2sh el4ta",
"e5lud el5ug e4mac e4mag e5man em5ana em5b e1me",
"e2mel e4met em3ica emi4e em5igra em1in2 em5ine",
"em3i3ni e4mis em5ish e5miss em3iz 5emniz emo4g",
"emoni5o em3pi e4mul em5ula emu3n e3my en5amo",
"e4nant ench4er en3dic e5nea e5nee en3em en5ero",
"en5esi en5est en3etr e3new en5ics e5nie e5nil",
"e3nio en3ish en3it e5niu 5eniz 4enn 4eno eno4g",
"e4nos en3ov en4sw ent5age 4enthes en3ua en5uf",
"e3ny. 4en3z e5of eo2g e4oi4 e3ol eop3ar e1or",
"eo3re eo5rol eos4 e4ot eo4to e5out e5ow e2pa",
"e3pai ep5anc e5pel e3pent ep5etitio ephe4 e4pli",
"e1po e4prec ep5reca e4pred ep3reh e3pro e4prob",
"ep4sh ep5ti5b e4put ep5uta e1q equi3l e4q3ui3s",
"er1a era4b 4erand er3ar 4erati. 2erb er4bl er3ch",
"er4che 2ere. e3real ere5co ere3in er5el. er3emo",
"er5ena er5ence 4erene er3ent ere4q er5ess er3est",
"eret4 er1h er1i e1ria4 5erick e3rien eri4er er3ine",
"e1rio 4erit er4iu eri4v e4riva er3m4 er4nis 4ernit",
"5erniz er3no 2ero er5ob e5roc ero4r er1ou er1s",
"er3set ert3er 4ertl er3tw 4eru eru4t 5erwau e1s4a",
"e4sage. e4sages es2c e2sca es5can e3scr es5cu",
"e1s2e e2sec es5ecr es5enc e4sert. e4serts e4serva",
"4esh e3sha esh5en e1si e2sic e2sid es5iden es5igna",
"e2s5im es4i4n esis4te esi4u e5skin es4mi e2sol",
"es3olu e2son es5ona e1sp es3per es5pira es4pre",
"2ess es4si4b estan4 es3tig es5tim 4es2to e3ston",
"2estr e5stro estruc5 e2sur es5urr es4w eta4b",
"eten4d e3teo ethod3 et1ic e5tide etin4 eti4no",
"e5tir e5titio et5itiv 4etn et5ona e3tra e3tre",
"et3ric et5rif et3rog et5ros et3ua et5ym et5z",
"4eu e5un e3up eu3ro eus4 eute4 euti5l eu5tr",
"eva2p5 e2vas ev5ast e5vea ev3ell evel3o e5veng",
"even4i ev1er e5verb e1vi ev3id evi4l e4vin evi4v",
"e5voc e5vu e1wa e4wag e5wee e3wh ewil5 ew3ing",
"e3wit 1exp 5eyc 5eye. eys4 1fa fa3bl fab3r",
"fa4ce 4fag fain4 fall5e 4fa4ma fam5is 5far far5th",
"fa3ta fa3the 4fato fault5 4f5b 4fd 4fe. feas4",
"feath3 fe4b 4feca 5fect 2fed fe3li fe4mo fen2d",
"fend5e fer1 5ferr fev4 4f1f f4fes f4fie f5fin.",
"f2f5is f4fly f2fy 4fh 1fi fi3a 2f3ic. 4f3ical",
"f3ican 4ficate f3icen fi3cer fic4i 5ficia 5ficie",
"4fics fi3cu fi5del fight5 fil5i fill5in 4fily",
"2fin 5fina fin2d5 fi2ne f1in3g fin4n fis4ti f4l2",
"f5less flin4 flo3re f2ly5 4fm 4fn 1fo 5fon",
"fon4de fon4t fo2r fo5rat for5ay fore5t for4i",
"fort5a fos5 4f5p fra4t f5rea fres5c fri2 fril4",
"frol5 2f3s 2ft f4to f2ty 3fu fu5el 4fug fu4min",
"fu5ne fu3ri fusi4 fus4s 4futa 1fy 1ga gaf4",
"5gal. 3gali ga3lo 2gam ga5met g5amo gan5is ga3niz",
"gani5za 4gano gar5n4 gass4 gath3 4gativ 4gaz",
"g3b gd4 2ge. 2ged geez4 gel4in ge5lis ge5liz",
"4gely 1gen ge4nat ge5niz 4geno 4geny 1geo ge3om",
"g4ery 5gesi geth5 4geto ge4ty ge4v 4g1g2 g2ge",
"g3ger gglu5 ggo4 gh3in gh5out gh4to 5gi. 1gi4a",
"gia5r g1ic 5gicia g4ico gien5 5gies. gil4 g3imen",
"3g4in. gin5ge 5g4ins 5gio 3gir gir4l g3isl gi4u",
"5giv 3giz gl2 gla4 glad5i 5glas 1gle gli4b",
"g3lig 3glo glo3r g1m g4my gn4a g4na. gnet4t",
"g1ni g2nin g4nio g1no g4non 1go 3go. gob5 5goe",
"3g4o4g go3is gon2 4g3o3na gondo5 go3ni 5goo go5riz",
"gor5ou 5gos. gov1 g3p 1gr 4grada g4rai gran2",
"5graph. g5rapher 5graphic 4graphy 4gray gre4n 4gress.",
"4grit g4ro gruf4 gs2 g5ste gth3 gu4a 3guard",
"2gue 5gui5t 3gun 3gus 4gu4t g3w 1gy 2g5y3n",
"gy5ra h3ab4l hach4 hae4m hae4t h5agu ha3la hala3m",
"ha4m han4ci han4cy 5hand. han4g hang5er hang5o",
"h5a5niz han4k han4te hap3l hap5t ha3ran ha5ras",
"har2d hard3e har4le harp5en har5ter has5s haun4",
"5haz haz3a h1b 1head 3hear he4can h5ecat h4ed",
"he5do5 he3l4i hel4lis hel4ly h5elo hem4p he2n",
"hena4 hen5at heo5r hep5 h4era hera3p her4ba here5a",
"h3ern h5erou h3ery h1es he2s5p he4t het4ed heu4",
"h1f h1h hi5an hi4co high5 h4il2 himer4 h4ina",
"hion4e hi4p hir4l hi3ro hir4p hir4r his3el his4s",
"hith5er hi2v 4hk 4h1l4 hlan4 h2lo hlo3ri 4h1m",
"hmet4 2h1n h5odiz h5ods ho4g hoge4 hol5ar 3hol4e",
"ho4ma home3 hon4a ho5ny 3hood hoon4 hor5at ho5ris",
"hort3e ho5ru hos4e ho5sen hos1p 1hous house3",
"hov5el 4h5p 4hr4 hree5 hro5niz hro3po 4h1s2 h4sh",
"h4tar ht1en ht5es h4ty hu4g hu4min hun5ke hun4t",
"hus3t4 hu4t h1w h4wart hy3pe hy3ph hy2s 2i1a",
"i2al iam4 iam5ete i2an 4ianc ian3i 4ian4t ia5pe",
"iass4 i4ativ ia4tric i4atu ibe4 ib3era ib5ert",
"ib5ia ib3in ib5it. ib5ite i1bl ib3li i5bo i1br",
"i2b5ri i5bun 4icam 5icap 4icar i4car. i4cara",
"icas5 i4cay iccu4 4iceo 4ich 2ici i5cid ic5ina",
"i2cip ic3ipa i4cly i2c5oc 4i1cr 5icra i4cry ic4te",
"ictu2 ic4t3ua ic3ula ic4um ic5uo i3cur 2id i4dai",
"id5anc id5d ide3al ide4s i2di id5ian idi4ar i5die",
"id3io idi5ou id1it id5iu i3dle i4dom id3ow i4dr",
"i2du id5uo 2ie4 ied4e 5ie5ga ield3 ien5a4 ien4e",
"i5enn i3enti i1er. i3esc i1est i3et 4if. if5ero",
"iff5en if4fr 4ific. i3fie i3fl 4ift 2ig iga5b",
"ig3era ight3i 4igi i3gib ig3il ig3in ig3it i4g4l",
"i2go ig3or ig5ot i5gre igu5i ig1ur i3h 4i5i4",
"i3j 4ik i1la il3a4b i4lade i2l5am ila5ra i3leg",
"il1er ilev4 il5f il1i il3ia il2ib il3io il4ist",
"2ilit il2iz ill5ab 4iln il3oq il4ty il5ur il3v",
"i4mag im3age ima5ry imenta5r 4imet im1i im5ida",
"imi5le i5mini 4imit im4ni i3mon i2mu im3ula 2in.",
"i4n3au 4inav incel4 in3cer 4ind in5dling 2ine",
"i3nee iner4ar i5ness 4inga 4inge in5gen 4ingi",
"in5gling 4ingo 4ingu 2ini i5ni. i4nia in3io in1is",
"i5nite. 5initio in3ity 4ink 4inl 2inn 2i1no i4no4c",
"ino4s i4not 2ins in3se insur5a 2int. 2in4th in1u",
"i5nus 4iny 2io 4io. ioge4 io2gr i1ol io4m ion3at",
"ion4ery ion3i io5ph ior3i i4os io5th i5oti io4to",
"i4our 2ip ipe4 iphras4 ip3i ip4ic ip4re4 ip3ul",
"i3qua iq5uef iq3uid iq3ui3t 4ir i1ra ira4b i4rac",
"ird5e ire4de i4ref i4rel4 i4res ir5gi ir1i iri5de",
"ir4is iri3tu 5i5r2iz ir4min iro4g 5iron. ir5ul",
"2is. is5ag is3ar isas5 2is1c is3ch 4ise is3er",
"3isf is5han is3hon ish5op is3ib isi4d i5sis is5itiv",
"4is4k islan4 4isms i2so iso5mer is1p is2pi is4py",
"4is1s is4sal issen4 is4ses is4ta. is1te is1ti",
"ist4ly 4istral i2su is5us 4ita. ita4bi i4tag",
"4ita5m i3tan i3tat 2ite it3era i5teri it4es 2ith",
"i1ti 4itia 4i2tic it3ica 5i5tick it3ig it5ill",
"i2tim 2itio 4itis i4tism i2t5o5m 4iton i4tram",
"it5ry 4itt it3uat i5tud it3ul 4itz. i1u 2iv",
"iv3ell iv3en. i4v3er. i4vers. iv5il. iv5io iv1it",
"i5vore iv3o3ro i4v3ot 4i5w ix4o 4iy 4izar izi4",
"5izont 5ja jac4q ja4p 1je jer5s 4jestie 4jesty",
"jew3 jo4p 5judg 3ka. k3ab k5ag kais4 kal4 k1b",
"k2ed 1kee ke4g ke5li k3en4d k1er kes4 k3est.",
"ke4ty k3f kh4 k1i 5ki. 5k2ic k4ill kilo5 k4im",
"k4in. kin4de k5iness kin4g ki4p kis4 k5ish kk4",
"k1l 4kley 4kly k1m k5nes 1k2no ko5r kosh4 k3ou",
"kro5n 4k1s2 k4sc ks4l k4sy k5t k1w lab3ic l4abo",
"laci4 l4ade la3dy lag4n lam3o 3land lan4dl lan5et",
"lan4te lar4g lar3i las4e la5tan 4lateli 4lativ",
"4lav la4v4a 2l1b lbin4 4l1c2 lce4 l3ci 2ld",
"l2de ld4ere ld4eri ldi4 ld5is l3dr l4dri le2a",
"le4bi left5 5leg. 5legg le4mat lem5atic 4len.",
"3lenc 5lene. 1lent le3ph le4pr lera5b ler4e 3lerg",
"3l4eri l4ero les2 le5sco 5lesq 3less 5less. l3eva",
"lev4er. lev4era lev4ers 3ley 4leye 2lf l5fr 4l1g4",
"l5ga lgar3 l4ges lgo3 2l3h li4ag li2am liar5iz",
"li4as li4ato li5bi 5licio li4cor 4lics 4lict.",
"l4icu l3icy l3ida lid5er 3lidi lif3er l4iff li4fl",
"5ligate 3ligh li4gra 3lik 4l4i4l lim4bl lim3i",
"li4mo l4im4p l4ina 1l4ine lin3ea lin3i link5er",
"li5og 4l4iq lis4p l1it l2it. 5litica l5i5tics",
"liv3er l1iz 4lj lka3 l3kal lka4t l1l l4law",
"l2le l5lea l3lec l3leg l3lel l3le4n l3le4t ll2i",
"l2lin4 l5lina ll4o lloqui5 ll5out l5low 2lm l5met",
"lm3ing l4mod lmon4 2l1n2 3lo. lob5al lo4ci 4lof",
"3logic l5ogo 3logu lom3er 5long lon4i l3o3niz",
"lood5 5lope. lop3i l3opm lora4 lo4rato lo5rie",
"lor5ou 5los. los5et 5losophiz 5losophy los4t lo4ta",
"loun5d 2lout 4lov 2lp lpa5b l3pha l5phi lp5ing",
"l3pit l4pl l5pr 4l1r 2l1s2 l4sc l2se l4sie",
"4lt lt5ag ltane5 l1te lten4 ltera4 lth3i l5ties.",
"ltis4 l1tr ltu2 ltur3a lu5a lu3br luch4 lu3ci",
"lu3en luf4 lu5id lu4ma 5lumi l5umn. 5lumnia lu3o",
"luo3r 4lup luss4 lus3te 1lut l5ven l5vet4 2l1w",
"1ly 4lya 4lyb ly5me ly3no 2lys4 l5yse 1ma 2mab",
"ma2ca ma5chine ma4cl mag5in 5magn 2mah maid5",
"4mald ma3lig ma5lin mal4li mal4ty 5mania man5is",
"man3iz 4map ma5rine. ma5riz mar4ly mar3v ma5sce",
"mas4e mas1t 5mate math3 ma3tis 4matiza 4m1b mba4t5",
"m5bil m4b3ing mbi4v 4m5c 4me. 2med 4med. 5media",
"me3die m5e5dy me2g mel5on mel4t me2m mem1o3 1men",
"men4a men5ac men4de 4mene men4i mens4 mensu5",
"3ment men4te me5on m5ersa 2mes 3mesti me4ta met3al",
"me1te me5thi m4etr 5metric me5trie me3try me4v",
"4m1f 2mh 5mi. mi3a mid4a mid4g mig4 3milia",
"m5i5lie m4ill min4a 3mind m5inee m4ingl min5gli",
"m5ingly min4t m4inu miot4 m2is mis4er. mis5l",
"mis4ti m5istry 4mith m2iz 4mk 4m1l m1m mma5ry",
"4m1n mn4a m4nin mn4o 1mo 4mocr 5mocratiz mo2d1",
"mo4go mois2 moi5se 4mok mo5lest mo3me mon5et",
"mon5ge moni3a mon4ism mon4ist mo3niz monol4 mo3ny.",
"mo2r 4mora. mos2 mo5sey mo3sp moth3 m5ouf 3mous",
"mo2v 4m1p mpara5 mpa5rab mpar5i m3pet mphas4",
"m2pi mpi4a mp5ies m4p1in m5pir mp5is mpo3ri mpos5ite",
"m4pous mpov5 mp4tr m2py 4m3r 4m1s2 m4sh m5si",
"4mt 1mu mula5r4 5mult multi3 3mum mun2 4mup",
"mu4u 4mw 1na 2n1a2b n4abu 4nac. na4ca n5act",
"nag5er. nak4 na4li na5lia 4nalt na5mit n2an nanci4",
"nan4it nank4 nar3c 4nare nar3i nar4l n5arm n4as",
"nas4c nas5ti n2at na3tal nato5miz n2au nau3se",
"3naut nav4e 4n1b4 ncar5 n4ces. n3cha n5cheo n5chil",
"n3chis nc1in nc4it ncour5a n1cr n1cu n4dai n5dan",
"n1de nd5est. ndi4b n5d2if n1dit n3diz n5duc ndu4r",
"nd2we 2ne. n3ear ne2b neb3u ne2c 5neck 2ned",
"ne4gat neg5ativ 5nege ne4la nel5iz ne5mi ne4mo",
"1nen 4nene 3neo ne4po ne2q n1er nera5b n4erar",
"n2ere n4er5i ner4r 1nes 2nes. 4nesp 2nest 4nesw",
"3netic ne4v n5eve ne4w n3f n4gab n3gel nge4n4e",
"n5gere n3geri ng5ha n3gib ng1in n5git n4gla ngov4",
"ng5sh n1gu n4gum n2gy 4n1h4 nha4 nhab3 nhe4",
"3n4ia ni3an ni4ap ni3ba ni4bl ni4d ni5di ni4er",
"ni2fi ni5ficat n5igr nik4 n1im ni3miz n1in 5nine.",
"nin4g ni4o 5nis. nis4ta n2it n4ith 3nitio n3itor",
"ni3tr n1j 4nk2 n5kero n3ket nk3in n1kl 4n1l",
"n5m nme4 nmet4 4n1n2 nne4 nni3al nni4v nob4l",
"no3ble n5ocl 4n3o2d 3noe 4nog noge4 nois5i no5l4i",
"5nologis 3nomic n5o5miz no4mo no3my no4n non4ag",
"non5i n5oniz 4nop 5nop5o5li nor5ab no4rary 4nosc",
"nos4e nos5t no5ta 1nou 3noun nov3el3 nowl3 n1p4",
"npi4 npre4c n1q n1r nru4 2n1s2 ns5ab nsati4",
"ns4c n2se n4s3es nsid1 nsig4 n2sl ns3m n4soc",
"ns4pe n5spi nsta5bl n1t nta4b nter3s nt2i n5tib",
"nti4er nti2f n3tine n4t3ing nti4p ntrol5li nt4s",
"ntu3me nu1a nu4d nu5en nuf4fe n3uin 3nu3it n4um",
"nu1me n5umi 3nu4n n3uo nu3tr n1v2 n1w4 nym4",
"nyp4 4nz n3za 4oa oad3 o5a5les oard3 oas4e",
"oast5e oat5i ob3a3b o5bar obe4l o1bi o2bin ob5ing",
"o3br ob3ul o1ce och4 o3chet ocif3 o4cil o4clam",
"o4cod oc3rac oc5ratiz ocre3 5ocrit octor5a oc3ula",
"o5cure od5ded od3ic odi3o o2do4 odor3 od5uct.",
"od5ucts o4el o5eng o3er oe4ta o3ev o2fi of5ite",
"ofit4t o2g5a5r og5ativ o4gato o1ge o5gene o5geo",
"o4ger o3gie 1o1gis og3it o4gl o5g2ly 3ogniz o4gro",
"ogu5i 1ogy 2ogyn o1h2 ohab5 oi2 oic3es oi3der",
"oiff4 oig4 oi5let o3ing oint5er o5ism oi5son",
"oist5en oi3ter o5j 2ok o3ken ok5ie o1la o4lan",
"olass4 ol2d old1e ol3er o3lesc o3let ol4fi ol2i",
"o3lia o3lice ol5id. o3li4f o5lil ol3ing o5lio",
"o5lis. ol3ish o5lite o5litio o5liv olli4e ol5ogiz",
"olo4r ol5pl ol2t ol3ub ol3ume ol3un o5lus ol2v",
"o2ly om5ah oma5l om5atiz om2be om4bl o2me om3ena",
"om5erse o4met om5etry o3mia om3ic. om3ica o5mid",
"om1in o5mini 5ommend omo4ge o4mon om3pi ompro5",
"o2n on1a on4ac o3nan on1c 3oncil 2ond on5do",
"o3nen on5est on4gu on1ic o3nio on1is o5niu on3key",
"on4odi on3omy on3s onspi4 onspir5a onsu4 onten4",
"on3t4i ontif5 on5um onva5 oo2 ood5e ood5i oo4k",
"oop3i o3ord oost5 o2pa ope5d op1er 3opera 4operag",
"2oph o5phan o5pher op3ing o3pit o5pon o4posi",
"o1pr op1u opy5 o1q o1ra o5ra. o4r3ag or5aliz",
"or5ange ore5a o5real or3ei ore5sh or5est. orew4",
"or4gu 4o5ria or3ica o5ril or1in o1rio or3ity",
"o3riu or2mi orn2e o5rof or3oug or5pe 3orrh or4se",
"ors5en orst4 or3thi or3thy or4ty o5rum o1ry os3al",
"os2c os4ce o3scop 4oscopi o5scr os4i4e os5itiv",
"os3ito os3ity osi4u os4l o2so os4pa os4po os2ta",
"o5stati os5til os5tit o4tan otele4g ot3er. ot5ers",
"o4tes 4oth oth5esi oth3i4 ot3ic. ot5ica o3tice",
"o3tif o3tis oto5s ou2 ou3bl ouch5i ou5et ou4l",
"ounc5er oun2d ou5v ov4en over4ne over3s ov4ert",
"o3vis oviti4 o5v4ol ow3der ow3el ow5est ow1i",
"own5i o4wo oy1a 1pa pa4ca pa4ce pac4t p4ad",
"5pagan p3agat p4ai pain4 p4al pan4a pan3el pan4ty",
"pa3ny pa1p pa4pu para5bl par5age par5di 3pare",
"par5el p4a4ri par4is pa2te pa5ter 5pathic pa5thy",
"pa4tric pav4 3pay 4p1b pd4 4pe. 3pe4a pear4l",
"pe2c 2p2ed 3pede 3pedi pedia4 ped4ic p4ee pee4d",
"pek4 pe4la peli4e pe4nan p4enc pen4th pe5on p4era.",
"pera5bl p4erag p4eri peri5st per4mal perme5 p4ern",
"per3o per3ti pe5ru per1v pe2t pe5ten pe5tiz 4pf",
"4pg 4ph. phar5i phe3no ph4er ph4es. ph1ic 5phie",
"ph5ing 5phisti 3phiz ph2l 3phob 3phone 5phoni",
"pho4r 4phs ph3t 5phu 1phy pi3a pian4 pi4cie",
"pi4cy p4id p5ida pi3de 5pidi 3piec pi3en pi4grap",
"pi3lo pi2n p4in. pind4 p4ino 3pi1o pion4 p3ith",
"pi5tha pi2tu 2p3k2 1p2l2 3plan plas5t pli3a pli5er",
"4plig pli4n ploi4 plu4m plum4b 4p1m 2p3n po4c",
"5pod. po5em po3et5 5po4g poin2 5point poly5t",
"po4ni po4p 1p4or po4ry 1pos pos1s p4ot po4ta",
"5poun 4p1p ppa5ra p2pe p4ped p5pel p3pen p3per",
"p3pet ppo5site pr2 pray4e 5preci pre5co pre3em",
"pref5ac pre4la pre3r p3rese 3press pre5ten pre3v",
"5pri4e prin4t3 pri4s pris3o p3roca prof5it pro3l",
"pros3e pro1t 2p1s2 p2se ps4h p4sib 2p1t pt5a4b",
"p2te p2th pti3m ptu4r p4tw pub3 pue4 puf4 pul3c",
"pu4m pu2n pur4r 5pus pu2t 5pute put3er pu3tr",
"put4ted put4tin p3w qu2 qua5v 2que. 3quer 3quet",
"2rab ra3bi rach4e r5acl raf5fi raf4t r2ai ra4lo",
"ram3et r2ami rane5o ran4ge r4ani ra5no rap3er",
"3raphy rar5c rare4 rar5ef 4raril r2as ration4",
"rau4t ra5vai rav3el ra5zie r1b r4bab r4bag rbi2",
"rbi4f r2bin r5bine rb5ing. rb4o r1c r2ce rcen4",
"r3cha rch4er r4ci4b rc4it rcum3 r4dal rd2i rdi4a",
"rdi4er rdin4 rd3ing 2re. re1al re3an re5arr 5reav",
"re4aw r5ebrat rec5oll rec5ompe re4cre 2r2ed re1de",
"re3dis red5it re4fac re2fe re5fer. re3fi re4fy",
"reg3is re5it re1li re5lu r4en4ta ren4te re1o",
"re5pin re4posi re1pu r1er4 r4eri rero4 re5ru",
"r4es. re4spi ress5ib res2t re5stal re3str re4ter",
"re4ti4z re3tri reu2 re5uti rev2 re4val rev3el",
"r5ev5er. re5vers re5vert re5vil rev5olu re4wh r1f",
"rfu4 r4fy rg2 rg3er r3get r3gic rgi4n rg3ing",
"r5gis r5git r1gl rgo4n r3gu rh4 4rh. 4rhal",
"ri3a ria4b ri4ag r4ib rib3a ric5as r4ice 4rici",
"5ricid ri4cie r4ico rid5er ri3enc ri3ent ri1er",
"ri5et rig5an 5rigi ril3iz 5riman rim5i 3rimo",
"rim4pe r2ina 5rina. rin4d rin4e rin4g ri1o 5riph",
"riph5e ri2pl rip5lic r4iq r2is r4is. ris4c r3ish",
"ris4p ri3ta3b r5ited. rit5er. rit5ers rit3ic ri2tu",
"rit5ur riv5el riv3et riv3i r3j r3ket rk4le rk4lin",
"r1l rle4 r2led r4lig r4lis rl5ish r3lo4 r1m",
"rma5c r2me r3men rm5ers rm3ing r4ming. r4mio",
"r3mit r4my r4nar r3nel r4ner r5net r3ney r5nic",
"r1nis4 r3nit r3niv rno4 r4nou r3nu rob3l r2oc",
"ro3cr ro4e ro1fe ro5fil rok2 ro5ker 5role. rom5ete",
"rom4i rom4p ron4al ron4e ro5n4is ron4ta 1room",
"5root ro3pel rop3ic ror3i ro5ro ros5per ros4s",
"ro4the ro4ty ro4va rov5el rox5 r1p r4pea r5pent",
"rp5er. r3pet rp4h4 rp3ing r3po r1r4 rre4c rre4f",
"r4reo rre4st rri4o rri4v rron4 rros4 rrys4 4rs2",
"r1sa rsa5ti rs4c r2se r3sec rse4cr rs5er. rs3es",
"rse5v2 r1sh r5sha r1si r4si4b rson3 r1sp r5sw",
"rtach4 r4tag r3teb rten4d rte5o r1ti rt5ib rti4d",
"r4tier r3tig rtil3i rtil4l r4tily r4tist r4tiv",
"r3tri rtroph4 rt4sh ru3a ru3e4l ru3en ru4gl ru3in",
"rum3pl ru2n runk5 run4ty r5usc ruti5n rv4e rvel4i",
"r3ven rv5er. r5vest r3vey r3vic rvi4v r3vo r1w",
"ry4c 5rynge ry3t sa2 2s1ab 5sack sac3ri s3act",
"5sai salar4 sal4m sa5lo sal4t 3sanc san4de s1ap",
"sa5ta 5sa3tio sat3u sau4 sa5vor 5saw 4s5b scan4t5",
"sca4p scav5 s4ced 4scei s4ces sch2 s4cho 3s4cie",
"5scin4d scle5 s4cli scof4 4scopy scour5a s1cu",
"4s5d 4se. se4a seas4 sea5w se2c3o 3sect 4s4ed",
"se4d4e s5edl se2g seg3r 5sei se1le 5self 5selv",
"4seme se4mol sen5at 4senc sen4d s5ened sen5g",
"s5enin 4sentd 4sentl sep3a3 4s1er. s4erl ser4o",
"4servo s1e4s se5sh ses5t 5se5um 5sev sev3en sew4i",
"5sex 4s3f 2s3g s2h 2sh. sh1er 5shev sh1in sh3io",
"3ship shiv5 sho4 sh5old shon3 shor4 short5 4shw",
"si1b s5icc 3side. 5sides 5sidi si5diz 4signa",
"sil4e 4sily 2s1in s2ina 5sine. s3ing 1sio 5sion",
"sion5a si2r sir5a 1sis 3sitio 5siu 1siv 5siz",
"sk2 4ske s3ket sk5ine sk5ing s1l2 s3lat s2le",
"slith5 2s1m s3ma small3 sman3 smel4 s5men 5smith",
"smol5d4 s1n4 1so so4ce soft3 so4lab sol3d2 so3lic",
"5solv 3som 3s4on. sona4 son4g s4op 5sophic s5ophiz",
"s5ophy sor5c sor5d 4sov so5vi 2spa 5spai spa4n",
"spen4d 2s5peo 2sper s2phe 3spher spho5 spil4",
"sp5ing 4spio s4ply s4pon spor4 4spot squal4l",
"s1r 2ss s1sa ssas3 s2s5c s3sel s5seng s4ses.",
"s5set s1si s4sie ssi4er ss5ily s4sl ss4li s4sn",
"sspend4 ss2t ssur5a ss5w 2st. s2tag s2tal stam4i",
"5stand s4ta4p 5stat. s4ted stern5i s5tero ste2w",
"stew5a s3the st2i s4ti. s5tia s1tic 5stick s4tie",
"s3tif st3ing 5stir s1tle 5stock stom3a 5stone",
"s4top 3store st4r s4trad 5stratu s4tray s4trid",
"4stry 4st3w s2ty 1su su1al su4b3 su2g3 su5is",
"suit3 s4ul su2m sum3i su2n su2r 4sv sw2 4swo",
"s4y 4syc 3syl syn5o sy5rin 1ta 3ta. 2tab ta5bles",
"5taboliz 4taci ta5do 4taf4 tai5lo ta2l ta5la",
"tal5en tal3i 4talk tal4lis ta5log ta5mo tan4de",
"tanta3 ta5per ta5pl tar4a 4tarc 4tare ta3riz",
"tas4e ta5sy 4tatic ta4tur taun4 tav4 2taw tax4is",
"2t1b 4tc t4ch tch5et 4t1d 4te. tead4i 4teat",
"tece4 5tect 2t1ed te5di 1tee teg4 te5ger te5gi",
"3tel. teli4 5tels te2ma2 tem3at 3tenan 3tenc",
"3tend 4tenes 1tent ten4tag 1teo te4p te5pe ter3c",
"5ter3d 1teri ter5ies ter3is teri5za 5ternit ter5v",
"4tes. 4tess t3ess. teth5e 3teu 3tex 4tey 2t1f",
"4t1g 2th. than4 th2e 4thea th3eas the5at the3is",
"3thet th5ic. th5ica 4thil 5think 4thl th5ode",
"5thodic 4thoo thor5it tho5riz 2ths 1tia ti4ab",
"ti4ato 2ti2b 4tick t4ico t4ic1u 5tidi 3tien tif2",
"ti5fy 2tig 5tigu till5in 1tim 4timp tim5ul 2t1in",
"t2ina 3tine. 3tini 1tio ti5oc tion5ee 5tiq ti3sa",
"3tise tis4m ti5so tis4p 5tistica ti3tl ti4u 1tiv",
"tiv4a 1tiz ti3za ti3zen 2tl t5la tlan4 3tle.",
"3tled 3tles. t5let. t5lo 4t1m tme4 2t1n2 1to",
"to3b to5crat 4todo 2tof to2gr to5ic to2ma tom4b",
"to3my ton4ali to3nat 4tono 4tony to2ra to3rie",
"tor5iz tos2 5tour 4tout to3war 4t1p 1tra tra3b",
"tra5ch traci4 trac4it trac4te tras4 tra5ven trav5es5",
"tre5f tre4m trem5i 5tria tri5ces 5tricia 4trics",
"2trim tri4v tro5mi tron5i 4trony tro5phe tro3sp",
"tro3v tru5i trus4 4t1s2 t4sc tsh4 t4sw 4t3t2",
"t4tes t5to ttu4 1tu tu1a tu3ar tu4bi tud2 4tue",
"4tuf4 5tu3i 3tum tu4nis 2t3up. 3ture 5turi tur3is",
"tur5o tu5ry 3tus 4tv tw4 4t1wa twis4 4two 1ty",
"4tya 2tyl type3 ty5ph 4tz tz4e 4uab uac4 ua5na",
"uan4i uar5ant uar2d uar3i uar3t u1at uav4 ub4e",
"u4bel u3ber u4bero u1b4i u4b5ing u3ble. u3ca",
"uci4b uc4it ucle3 u3cr u3cu u4cy ud5d ud3er",
"ud5est udev4 u1dic ud3ied ud3ies ud5is u5dit",
"u4don ud4si u4du u4ene uens4 uen4te uer4il 3ufa",
"u3fl ugh3en ug5in 2ui2 uil5iz ui4n u1ing uir4m",
"uita4 uiv3 uiv4er. u5j 4uk u1la ula5b u5lati",
"ulch4 5ulche ul3der ul4e u1len ul4gi ul2i u5lia",
"ul3ing ul5ish ul4lar ul4li4b ul4lis 4ul3m u1l4o",
"4uls uls5es ul1ti ultra3 4ultu u3lu ul5ul ul5v",
"um5ab um4bi um4bly u1mi u4m3ing umor5o um2p unat4",
"u2ne un4er u1ni un4im u2nin un5ish uni3v un3s4",
"un4sw unt3ab un4ter. un4tes unu4 un5y un5z u4ors",
"u5os u1ou u1pe uper5s u5pia up3ing u3pl up3p",
"upport5 upt5ib uptu4 u1ra 4ura. u4rag u4ras ur4be",
"urc4 ur1d ure5at ur4fer ur4fr u3rif uri4fic ur1in",
"u3rio u1rit ur3iz ur2l url5ing. ur4no uros4 ur4pe",
"ur4pi urs5er ur5tes ur3the urti4 ur4tie u3ru",
"2us u5sad u5san us4ap usc2 us3ci use5a u5sia",
"u3sic us4lin us1p us5sl us5tere us1tr u2su usur4",
"uta4b u3tat 4ute. 4utel 4uten uten4i 4u1t2i uti5liz",
"u3tine ut3ing ution5a u4tis 5u5tiz u4t1l ut5of",
"uto5g uto5matic u5ton u4tou uts4 u3u uu4m u1v2",
"uxu3 uz4e 1va 5va. 2v1a4b vac5il vac3u vag4",
"va4ge va5lie val5o val1u va5mo va5niz va5pi var5ied",
"3vat 4ve. 4ved veg3 v3el. vel3li ve4lo v4ely",
"ven3om v5enue v4erd 5vere. v4erel v3eren ver5enc",
"v4eres ver3ie vermi4n 3verse ver3th v4e2s 4ves.",
"ves4te ve4te vet3er ve4ty vi5ali 5vian 5vide.",
"5vided 4v3iden 5vides 5vidi v3if vi5gn vik4 2vil",
"5vilit v3i3liz v1in 4vi4na v2inc vin5d 4ving",
"vio3l v3io4r vi1ou vi4p vi5ro vis3it vi3so vi3su",
"4viti vit3r 4vity 3viv 5vo. voi4 3vok vo4la",
"v5ole 5volt 3volv vom5i vor5ab vori4 vo4ry vo4ta",
"4votee 4vv4 v4y w5abl 2wac wa5ger wag5o wait5",
"w5al. wam4 war4t was4t wa1te wa5ver w1b wea5rie",
"weath3 wed4n weet3 wee5v wel4l w1er west3 w3ev",
"whi4 wi2 wil2 will5in win4de win4g wir4 3wise",
"with3 wiz5 w4k wl4es wl3in w4no 1wo2 wom1 wo5ven",
"w5p wra4 wri4 writa4 w3sh ws4l ws4pe w5s4t",
"4wt wy4 x1a xac5e x4ago xam3 x4ap xas5 x3c2",
"x1e xe4cuto x2ed xer4i xe5ro x1h xhi2 xhil5",
"xhu4 x3i xi5a xi5c xi5di x4ime xi5miz x3o x4ob",
"x3p xpan4d xpecto5 xpe3d x1t2 x3ti x1u xu3a",
"xx4 y5ac 3yar4 y5at y1b y1c y2ce yc5er y3ch",
"ych4e ycom4 ycot4 y1d y5ee y1er y4erf yes4",
"ye4t y5gi 4y3h y1i y3la ylla5bl y3lo y5lu ymbol5",
"yme4 ympa3 yn3chr yn5d yn5g yn5ic 5ynx y1o4",
"yo5d y4o5g yom4 yo5net y4ons y4os y4ped yper5",
"yp3i y3po y4poc yp2ta y5pu yra5m yr5ia y3ro",
"yr4r ys4c y3s2e ys3ica ys3io 3ysis y4so yss4",
"ys1t ys3ta ysur4 y3thin yt3ic y1w za1 z5a2b",
"zar2 4zb 2ze ze4n ze4p z1er ze3ro zet4 2z1i",
"z4il z4is 5zl 4zm 1zo zo4m zo5ol zte4 4z1z2",
"z4zy",
#if 1
/* Patterns for standard Hyphenation Pattern Memory of 8000.
Can be used with all standard TeX versions.
Hyphenation trie becomes 6661 with 229 ops.
These patterns are based on the Hyphenation Exception Log
published in TUGboat, Volume 10 (1989), No. 3, pp. 337-341,
and a large number of bad hyphened words not yet published.
If added to Liang's before the closing bracket } of \patterns,
the patterns run errorfree as far as known at this moment.
Patterns do not find all admissible hyphens of the words in
the Exception Log. The file ushyphen.max do.
Can be used freely for non-commercial purposes.
Copyright 1990 G.D.C. Kuiken. e-mail: [email protected]
Postal address: P.O. Box 65791, NL 2506 EB Den Haag, Holland.
Patterns of March 1, 1990. */
".driv4 .eth1y6l1 .eu4ler .ev2 .ga4som .ge4ome",
".he3p6a .in5u2t .kil2ni .ko6rte .le6ice .me4gal",
".met4ala .mimi4cr .mis4ers .ne6o3f .non1e2m .semi5",
".sem4ic .semid6 .semip4 .semir4 .sem6is4 .semiv4",
".sph6in1 .to6pog .to2q .vi4car .we2b1l .ree4c a4cabl",
"af6fish anal6ys anoa4c anti3de anti3n2 anti3re",
"a4peable ar4range as5ymptot at6tes. augh4tl av3iou",
"ba6r1onie bbi4t be4vie bid4if bil4lab bio5m bi3orb",
"bio3rh blan4d blin4d blon4d bo4tul brus4q bus6i2er",
"bus6i2es buss4in but4ed. but4ted cad5em catas4",
"4chs. chs3hu ciga3r cin4q cle4ar co6ph1o3n cous4ti",
"cri5tie cro5e4co c2tro3me6c cu4ranc 4d3alone data3b",
"d2dib de4als. de2clin de5fin5iti de4mos des3ic",
"de4tic dic5aid dif5fra di4ren di4rer 4dlead 4dli4e",
"do5word drif4ta d3tab ea4nies e3chas edg3l eli4tis",
"e3loa en3dix e6pineph e4rian. espac6i ethy6lene",
"eu4clid1 feb3ru fermi3o 3fich flag6el g6endre.",
"geo3d ght3we g3lead 4g1lish g4nac g4nor. g4nores",
"4go4niza griev3 ha4parr hatch3 hex2a hipela4 ho6r1ic.",
"h4teou id4ios ign4it i4jk im5peda infras4 i5nitely.",
"irre6v3oc i5tesima ithi4l janu3a ke6ling ki5netic",
"k3sha la4cie lai6ness l3chai l3chil6d lea4sa lecta6b",
"litho5g ll1fl l4lish lo4ges. l3tea lthi4ly lue1p",
"man3u1sc mar3gin medi4c medi5cin medio6c me5gran",
"mi3dab mil4lag milli5li mi6n3is. min4ute m3mab",
"5maphro 5mocrat moe4las mole5c mon4ey1l mono5ch",
"mo4no1en moro6n5is monos6 moth4et2 mou5sin mshack4",
"mu4dro mul4ti5u nar4chs. nch4est ne5back 4neski",
"nd3thr nfin5ites 4nian. nge5nes ng3ho ng3spr nk3rup",
"n5less nom1a6l nom5eno no5mist non5eq noni4so no5vemb",
"ns5ceiv ns4moo ntre3p obli2g1 o3chas oerst4 oke3st",
"olon4om o3mecha6 o5norma ono4ton o3nou op3ism.",
"or4tho3ni4t orth5ri o4spher o6v3ian. oxi6d2ic pal6mat",
"parag6ra4 par4ale param4 para5me pee4v1 phi2l3an",
"phi5latel pi4cad pli4cab pli5nar 1pole. poly1e",
"prema5c pre5neu pres4pli pro4cess proc5ity. pro4ge",
"3pseu4d pseud6od2 pseud6of2 ptomat4 p5trol pubes5c",
"quain4te qu6a3si3 quasir6 quasis6 quiv4ar r5abolic",
"ra3chu r3a3dig radi1o6g r4amen ra4me3triz ra3mou",
"ran4has ra3or r3binge re4cipr rec4ogn rec5t6ang",
"re2f1orma re4tribu r3ial. riv3ol rk3ho 6rks. ro3bot3",
"roe4las r3thou r3treu r3veil rz3sc sales5c sales5w",
"sca6p1er sca4tol s4chitz sci4utt scy4th se1mi6t1ic",
"sep5temb shoe5st side5st side5sw sky3sc s4ogamy",
"so4lute s4pace s4pacin spe5cio spher5o spi4cil",
"spokes5w sports5c sports5w s5quito s4sa3chu ss3hat",
"s4sian. s4tamp s4tants star5tli sta3ti st5b stor5ab",
"strat5ag strib5ut st5scr stupi4d styl5is su2per1e6",
"3sync sythi4 swimm6 ta3gon. talka5 ta3min t6ap6ath",
"tar4rh tch3c tch5ed tch5ier t1cr tele4g tele1r6o",
"tess4es tha4lam tho5don tho5geni thok4er thy4lan",
"thy3sc 4tian. ti4nom tli4er tot3ic trai5tor tra5vers",
"treach5e tr4ial. 5tro1leum tro5fit trop4is tropo5les",
"tropo5lis tropol5it tsch5ie ttribut5 turn5ar t1wh",
"ty4pal u2ral. v3ativ va6guer v5ereig voice5p waste3w6",
"waveg4 w3c week3n wide5sp wo4ken wrap5aro x1q",
"xquis3 y5ched ym5etry y3stro z2z3w z2z3w",
#endif
NULL
};
#endif
/* Do NOT make any alterations to this list! --- DEK */
char *USExceptions[]=
{"as-so-ciate",
"as-so-ciates",
"dec-li-na-tion",
"oblig-a-tory",
"phil-an-thropic",
"present",
"presents",
"project",
"projects",
"reci-procity",
"re-cog-ni-zance",
"ref-or-ma-tion",
"ret-ri-bu-tion",
"ta-ble",
NULL
};
|
the_stack_data/45116.c | #include <stdio.h>
#include <stdlib.h>
struct item {
int value; /* Value of the item */
struct item *next_ptr; /* Pointer to the next item */
};
void enter(struct item *first_ptr, const int value)
{
struct item *before_ptr; /* Item before this one */
struct item *after_ptr; /* Item after this one */
struct item *new_item_ptr; /* Item to add */
/* Create new item to add to the list */
before_ptr = first_ptr; /* Start at the beginning */
after_ptr = before_ptr->next_ptr;
while (1) {
if (after_ptr == NULL)
break;
if (after_ptr->value >= value)
break;
/* Advance the pointers */
after_ptr = after_ptr->next_ptr;
before_ptr = before_ptr->next_ptr;
}
new_item_ptr = malloc(sizeof(struct item));
if (!new_item_ptr) {
perror("malloc");
exit(1);
}
new_item_ptr->value = value; /* Set value of item */
before_ptr->next_ptr = new_item_ptr;
new_item_ptr->next_ptr = after_ptr;
}
void print(struct item *first_ptr)
{
struct item *cur_ptr; /* Pointer to the current item */
for (cur_ptr = first_ptr; cur_ptr != NULL; cur_ptr = cur_ptr->next_ptr)
printf("%d ", cur_ptr->value);
printf("\n");
}
void dispose(struct item *first_ptr)
{
struct item *before_ptr; /* Item before this one */
while (first_ptr) {
before_ptr=first_ptr;
first_ptr=first_ptr->next_ptr;
free(before_ptr);
}
}
int main()
{
/* The linked list */
struct item *head_ptr = NULL;
head_ptr = malloc(sizeof(struct item));
if (!head_ptr) {
perror("malloc");
exit(1);
}
head_ptr->value = 0;
head_ptr->next_ptr = NULL;
enter(head_ptr, 5);
enter(head_ptr, 4);
enter(head_ptr, 8);
enter(head_ptr, 9);
enter(head_ptr, 1);
enter(head_ptr, 2);
print(head_ptr);
dispose(head_ptr);
return (0);
}
|
the_stack_data/104827597.c | #include <stdio.h>
#define N 21
#define font 178
int even_odd(int x) {
if(x % 2 == 0) {
return -1;
}
else {
return 0;
}
}
void fill_plus(int coord[N][N], int w, int h) {
int i,j;
int center = (N-1)/2;
int leftEnd = center - (w/2);
int rightEnd= center + (w/2) + even_odd(w);
int top = center - (h/2);
int bottom = center + (h/2) + even_odd(h);
for(j = 0; j < N; j++){
for(i = 0; i < N; i++){
if(i == center && (j<=bottom && j>=top)){
coord[j][i]=1;
}
else if(j == center && (i<=rightEnd && i>=leftEnd) ){
coord[j][i]=1;
}
}
}
}
void draw_plus(int coord[N][N]) {
int i, j;
for(j = 0; j < N; j++) {
for(i = 0; i < N; i++) {
if(coord[j][i] == 1) {
printf("%c", font);
}
else {
printf(" ");
}
}
printf("\n");
}
}
int main(void) {
int coord[N][N]= {0};
int w, h;
printf("Please enter width of your plus: ");
scanf("%i", &w);
printf("Please enter height of your plus: ");
scanf("%i", &h);
fill_plus(coord, w, h);
draw_plus(coord);
return 0;
}
|
the_stack_data/179826715.c | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct pessoa{
int id;
char descricao[50];
};
void merge(struct pessoa *array, int low, int meio, int high){
int i, j, k;
struct pessoa *auxiliar;
i = low;
j = meio + 1;
k = 0;
//ORDENAR POR STRING
auxiliar = (struct pessoa *) malloc (sizeof(struct pessoa) * ((high - low) + 1));
while((i <= meio) && (j <= high)){
if(strcmp(array[i].descricao, array[j].descricao) < 0){
//strcpy(auxiliar[k].palavra, array[i].palavra);
auxiliar[k]=array[i];
i++;
}
else{
//strcpy(auxiliar[k].palavra, array[j].palavra);
auxiliar[k]=array[j];
j++;
}
k++;
}
while(i <= meio){
//strcpy(auxiliar[k].palavra, array[i].palavra);
auxiliar[k]=array[i];
i++;
k++;
}
while(j <= high){
//strcpy(auxiliar[k].palavra, array[j].palavra);
auxiliar[k]=array[j];
j++;
k++;
}
k=0;
for(i = low; i <= high; i++){
//strcpy(array[i].palavra, auxiliar[k].palavra);
array[i]=auxiliar[k];
k++;
}
}
int pesquisar(struct pessoa *item, char *chave, int tam){
int high, low, mid;
low= 0;
high= tam-1;
//pesquisar string
while(low <= high){
mid= (low + high)/2;
if(strcmp(chave, item[mid].descricao) < 0){
high= mid-1;
}
else if(strcmp(chave, item[mid].descricao) > 0){
low= mid+1;
}
else{
return mid;
}
}
return -1;
}
int main(){
int vezes,i,posic;
char chave[50];
scanf("%d", &vezes);
scanf("%s", chave);
struct pessoa *vetor= (struct pessoa *)malloc(vezes * sizeof(struct pessoa));
for(i=0; i<vezes; i++){
scanf("%d", &vetor[i].id);
scanf("%s", vetor[i].descricao);
}
ordenar(vetor, 0, vezes-1);
pesquisar(vetor, chave, vezes);
posic=pesquisar(vetor, chave, vezes);
printf("%d\n", vetor[posic].id);
} |
the_stack_data/62650.c | /* hw8_25 */
#include <stdio.h>
#include <stdlib.h>
int fib(int);
void counter(void);
int main(void)
{
fib(5);
system("pause");
return 0;
}
int fib(int n)
{
counter();
if(n==1||n==2)
return 1;
else
return (fib(n-1)+fib(n-2));
}
void counter(void)
{
static int cont=0;
printf("counter()已經被呼叫%d次了...\n",++cont);
}
/*
counter()已經被呼叫1次了...
counter()已經被呼叫2次了...
counter()已經被呼叫3次了...
counter()已經被呼叫4次了...
counter()已經被呼叫5次了...
counter()已經被呼叫6次了...
counter()已經被呼叫7次了...
counter()已經被呼叫8次了...
counter()已經被呼叫9次了...
Press any key to continue . . .
*/
|
the_stack_data/90763873.c | /*
Info:
Feel free to use these lines as you wish.
This program iterates over all k-cliques.
This is an improvement of the 1985 algorithm of Chiba And Nishizeki detailed in "Arboricity and subgraph listing".
To compile:
"gcc kClistNodeParallel.c -O9 -o kClistNodeParallel -fopenmp".
To execute:
"./kClistNodeParallel p k edgelist.txt".
"edgelist.txt" should contain the graph: one edge on each line separated by a space.
k is the size of the k-cliques
p is the number of threads
Will print the number of k-cliques.
*/
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <time.h>
#include <omp.h>
#define NLINKS 100000000 //maximum number of edges for memory allocation, will increase if needed
typedef struct {
unsigned s;
unsigned t;
} edge;
typedef struct {
unsigned node;
unsigned deg;
} nodedeg ;
typedef struct {
unsigned n;//number of nodes
unsigned e;//number of edges
edge *edges;//list of edges
unsigned *rank;//ranking of the nodes according to degeneracy ordering
//unsigned *map;//oldID newID correspondance NOT USED IN THIS VERSION
} edgelist;
typedef struct {
unsigned n;
unsigned *cd;//cumulative degree: (starts with 0) length=n+1
unsigned *adj;//truncated list of neighbors
unsigned core;//core value of the graph
} graph;
typedef struct {
unsigned *n;//n[l]: number of nodes in G_l
unsigned **d;//d[l]: degrees of G_l
unsigned *adj;//truncated list of neighbors
unsigned char *lab;//lab[i] label of node i
unsigned **nodes;//sub[l]: nodes in G_l
unsigned core;
} subgraph;
void free_edgelist(edgelist *el){
free(el->edges);
free(el->rank);
free(el);
}
void free_graph(graph *g){
free(g->cd);
free(g->adj);
free(g);
}
void free_subgraph(subgraph *sg, unsigned char k){
unsigned char i;
free(sg->n);
for (i=2;i<k;i++){
free(sg->d[i]);
free(sg->nodes[i]);
}
free(sg->d);
free(sg->nodes);
free(sg->lab);
free(sg->adj);
free(sg);
}
//Compute the maximum of three unsigned integers.
inline unsigned int max3(unsigned int a,unsigned int b,unsigned int c){
a=(a>b) ? a : b;
return (a>c) ? a : c;
}
edgelist* readedgelist(char* input){
unsigned e1=NLINKS;
edgelist *el=malloc(sizeof(edgelist));
FILE *file;
el->n=0;
el->e=0;
file=fopen(input,"r");
el->edges=malloc(e1*sizeof(edge));
while (fscanf(file,"%u %u", &(el->edges[el->e].s), &(el->edges[el->e].t))==2) {//Add one edge
el->n=max3(el->n,el->edges[el->e].s,el->edges[el->e].t);
el->e++;
if (el->e==e1) {
e1+=NLINKS;
el->edges=realloc(el->edges,e1*sizeof(edge));
}
}
fclose(file);
el->n++;
el->edges=realloc(el->edges,el->e*sizeof(edge));
return el;
}
void relabel(edgelist *el){
unsigned i, source, target, tmp;
for (i=0;i<el->e;i++) {
source=el->rank[el->edges[i].s];
target=el->rank[el->edges[i].t];
if (source<target){
tmp=source;
source=target;
target=tmp;
}
el->edges[i].s=source;
el->edges[i].t=target;
}
}
///// CORE ordering /////////////////////
typedef struct {
unsigned key;
unsigned value;
} keyvalue;
typedef struct {
unsigned n_max; // max number of nodes.
unsigned n; // number of nodes.
unsigned *pt; // pointers to nodes.
keyvalue *kv; // nodes.
} bheap;
bheap *construct(unsigned n_max){
unsigned i;
bheap *heap=malloc(sizeof(bheap));
heap->n_max=n_max;
heap->n=0;
heap->pt=malloc(n_max*sizeof(unsigned));
for (i=0;i<n_max;i++) heap->pt[i]=-1;
heap->kv=malloc(n_max*sizeof(keyvalue));
return heap;
}
void swap(bheap *heap,unsigned i, unsigned j) {
keyvalue kv_tmp=heap->kv[i];
unsigned pt_tmp=heap->pt[kv_tmp.key];
heap->pt[heap->kv[i].key]=heap->pt[heap->kv[j].key];
heap->kv[i]=heap->kv[j];
heap->pt[heap->kv[j].key]=pt_tmp;
heap->kv[j]=kv_tmp;
}
void bubble_up(bheap *heap,unsigned i) {
unsigned j=(i-1)/2;
while (i>0) {
if (heap->kv[j].value>heap->kv[i].value) {
swap(heap,i,j);
i=j;
j=(i-1)/2;
}
else break;
}
}
void bubble_down(bheap *heap) {
unsigned i=0,j1=1,j2=2,j;
while (j1<heap->n) {
j=( (j2<heap->n) && (heap->kv[j2].value<heap->kv[j1].value) ) ? j2 : j1 ;
if (heap->kv[j].value < heap->kv[i].value) {
swap(heap,i,j);
i=j;
j1=2*i+1;
j2=j1+1;
continue;
}
break;
}
}
void insert(bheap *heap,keyvalue kv){
heap->pt[kv.key]=(heap->n)++;
heap->kv[heap->n-1]=kv;
bubble_up(heap,heap->n-1);
}
void update(bheap *heap,unsigned key){
unsigned i=heap->pt[key];
if (i!=-1){
((heap->kv[i]).value)--;
bubble_up(heap,i);
}
}
keyvalue popmin(bheap *heap){
keyvalue min=heap->kv[0];
heap->pt[min.key]=-1;
heap->kv[0]=heap->kv[--(heap->n)];
heap->pt[heap->kv[0].key]=0;
bubble_down(heap);
return min;
}
//Building the heap structure with (key,value)=(node,degree) for each node
bheap* mkheap(unsigned n,unsigned *v){
unsigned i;
keyvalue kv;
bheap* heap=construct(n);
for (i=0;i<n;i++){
kv.key=i;
kv.value=v[i];
insert(heap,kv);
}
return heap;
}
void freeheap(bheap *heap){
free(heap->pt);
free(heap->kv);
free(heap);
}
//computing degeneracy ordering and core value
void ord_core(edgelist* el){
unsigned i,j,r=0,n=el->n,e=el->e;
keyvalue kv;
bheap *heap;
unsigned *d0=calloc(el->n,sizeof(unsigned));
unsigned *cd0=malloc((el->n+1)*sizeof(unsigned));
unsigned *adj0=malloc(2*el->e*sizeof(unsigned));
for (i=0;i<e;i++) {
d0[el->edges[i].s]++;
d0[el->edges[i].t]++;
}
cd0[0]=0;
for (i=1;i<n+1;i++) {
cd0[i]=cd0[i-1]+d0[i-1];
d0[i-1]=0;
}
for (i=0;i<e;i++) {
adj0[ cd0[el->edges[i].s] + d0[ el->edges[i].s ]++ ]=el->edges[i].t;
adj0[ cd0[el->edges[i].t] + d0[ el->edges[i].t ]++ ]=el->edges[i].s;
}
heap=mkheap(n,d0);
el->rank=malloc(n*sizeof(unsigned));
for (i=0;i<n;i++){
kv=popmin(heap);
el->rank[kv.key]=n-(++r);
for (j=cd0[kv.key];j<cd0[kv.key+1];j++){
update(heap,adj0[j]);
}
}
freeheap(heap);
free(d0);
free(cd0);
free(adj0);
}
//////////////////////////
//Building the special graph
graph* mkgraph(edgelist *el){
unsigned i,max;
unsigned *d;
graph* g=malloc(sizeof(graph));
d=calloc(el->n,sizeof(unsigned));
for (i=0;i<el->e;i++) {
d[el->edges[i].s]++;
}
g->cd=malloc((el->n+1)*sizeof(unsigned));
g->cd[0]=0;
max=0;
for (i=1;i<el->n+1;i++) {
g->cd[i]=g->cd[i-1]+d[i-1];
max=(max>d[i-1])?max:d[i-1];
d[i-1]=0;
}
printf("core value (max truncated degree) = %u\n",max);
g->adj=malloc(el->e*sizeof(unsigned));
for (i=0;i<el->e;i++) {
g->adj[ g->cd[el->edges[i].s] + d[ el->edges[i].s ]++ ]=el->edges[i].t;
}
free(d);
g->core=max;
g->n=el->n;
return g;
}
subgraph* allocsub(graph *g,unsigned char k){
unsigned i;
subgraph* sg=malloc(sizeof(subgraph));
sg->n=calloc(k,sizeof(unsigned));
sg->d=malloc(k*sizeof(unsigned*));
sg->nodes=malloc(k*sizeof(unsigned*));
for (i=2;i<k;i++){
sg->d[i]=malloc(g->core*sizeof(unsigned));
sg->nodes[i]=malloc(g->core*sizeof(unsigned));
}
sg->lab=calloc(g->core,sizeof(unsigned char));
sg->adj=malloc(g->core*g->core*sizeof(unsigned));
sg->core=g->core;
return sg;
}
void mksub(graph* g,unsigned u,subgraph* sg,unsigned char k){
unsigned i,j,l,v,w;
static unsigned *old=NULL,*new=NULL;//to improve
#pragma omp threadprivate(new,old)
if (old==NULL){
new=malloc(g->n*sizeof(unsigned));
old=malloc(g->core*sizeof(unsigned));
for (i=0;i<g->n;i++){
new[i]=-1;
}
}
for (i=0;i<sg->n[k-1];i++){
sg->lab[i]=0;
}
j=0;
for (i=g->cd[u];i<g->cd[u+1];i++){
v=g->adj[i];
new[v]=j;
old[j]=v;
sg->lab[j]=k-1;
sg->nodes[k-1][j]=j;
sg->d[k-1][j]=0;//new degrees
j++;
}
sg->n[k-1]=j;
for (i=0;i<sg->n[k-1];i++){//reodering adjacency list and computing new degrees
v=old[i];
for (l=g->cd[v];l<g->cd[v+1];l++){
w=g->adj[l];
j=new[w];
if (j!=-1){
sg->adj[sg->core*i+sg->d[k-1][i]++]=j;
}
}
}
for (i=g->cd[u];i<g->cd[u+1];i++){
new[g->adj[i]]=-1;
}
}
void kclique_thread(unsigned char l, subgraph *sg, unsigned long long *n) {
unsigned i,j,k,end,u,v,w;
if(l==2){
for(i=0; i<sg->n[2]; i++){//list all edges
u=sg->nodes[2][i];
end=u*sg->core+sg->d[2][u];
for (j=u*sg->core;j<end;j++) {
(*n)++;//listing here!!! // NOTE THAT WE COULD DO (*n)+=g->d[2][u] to be much faster (for counting only); !!!!!!!!!!!!!!!!!!
}
}
return;
}
for(i=0; i<sg->n[l]; i++){
u=sg->nodes[l][i];
//printf("%u %u\n",i,u);
sg->n[l-1]=0;
end=u*sg->core+sg->d[l][u];
for (j=u*sg->core;j<end;j++){//relabeling nodes and forming U'.
v=sg->adj[j];
if (sg->lab[v]==l){
sg->lab[v]=l-1;
sg->nodes[l-1][sg->n[l-1]++]=v;
sg->d[l-1][v]=0;//new degrees
}
}
for (j=0;j<sg->n[l-1];j++){//reodering adjacency list and computing new degrees
v=sg->nodes[l-1][j];
end=sg->core*v+sg->d[l][v];
for (k=sg->core*v;k<end;k++){
w=sg->adj[k];
if (sg->lab[w]==l-1){
sg->d[l-1][v]++;
}
else{
sg->adj[k--]=sg->adj[--end];
sg->adj[end]=w;
}
}
}
kclique_thread(l-1, sg, n);
for (j=0;j<sg->n[l-1];j++){//restoring labels
v=sg->nodes[l-1][j];
sg->lab[v]=l;
}
}
}
unsigned long long kclique_main(unsigned char k, graph *g) {
unsigned u;
unsigned long long n=0;
subgraph *sg;
#pragma omp parallel private(sg,u) reduction(+:n)
{
sg=allocsub(g,k);
#pragma omp for schedule(dynamic, 1) nowait
for(u=0; u<g->n; u++){
mksub(g,u,sg,k);
kclique_thread(k-1, sg, &n);
}
}
return n;
}
int main(int argc,char** argv){
edgelist* el;
graph* g;
unsigned char k=atoi(argv[2]);
unsigned long long n;
omp_set_num_threads(atoi(argv[1]));
time_t t0,t1,t2;
t1=time(NULL);
t0=t1;
printf("Reading edgelist from file %s\n",argv[3]);
el=readedgelist(argv[3]);
printf("Number of nodes = %u\n",el->n);
printf("Number of edges = %u\n",el->e);
t2=time(NULL);
printf("- Time = %ldh%ldm%lds\n",(t2-t1)/3600,((t2-t1)%3600)/60,((t2-t1)%60));
t1=t2;
printf("Building the graph structure\n");
ord_core(el);
relabel(el);
g=mkgraph(el);
printf("Number of nodes (degree > 0) = %u\n",g->n);
free_edgelist(el);
t2=time(NULL);
printf("- Time = %ldh%ldm%lds\n",(t2-t1)/3600,((t2-t1)%3600)/60,((t2-t1)%60));
t1=t2;
printf("Iterate over all cliques\n");
n=kclique_main(k, g);
printf("Number of %u-cliques: %llu\n",k,n);
t2=time(NULL);
printf("- Time = %ldh%ldm%lds\n",(t2-t1)/3600,((t2-t1)%3600)/60,((t2-t1)%60));
t1=t2;
free_graph(g);
printf("- Overall time = %ldh%ldm%lds\n",(t2-t0)/3600,((t2-t0)%3600)/60,((t2-t0)%60));
return 0;
}
|
the_stack_data/562841.c | #if 0
int x;
int y;
int z;
#endif
typedef union sigval
{
int sival_int;
void *sival_ptr;
} sigval_t;
typedef struct siginfo
{
// int si_signo;
int si_errno;
int si_code;
#if 1
union
{
int _pad[((128 / sizeof (int)) - 4)];
struct
{
void *si_addr;
} _sigfault;
#if 1
struct
{
long int si_band;
int si_fd;
} _sigpoll;
#endif
} _sifields;
#endif
} siginfo_t;
struct X
{
#if 0
int x;
int y;
int z;
#endif
};
|
the_stack_data/82316.c | // Test the that the driver produces reasonable linker invocations with
// -fopenmp or -fopenmp|libgomp.
//
// FIXME: Replace DEFAULT_OPENMP_LIB below with the value chosen at configure time.
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -fopenmp -target i386-unknown-linux -rtlib=platform \
// RUN: | FileCheck --check-prefix=CHECK-LD-32 %s
// CHECK-LD-32: "{{.*}}ld{{(.exe)?}}"
// CHECK-LD-32: "-l[[DEFAULT_OPENMP_LIB:[^"]*]]"
// CHECK-LD-32: "-lpthread" "-lc"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -fopenmp -target x86_64-unknown-linux -rtlib=platform \
// RUN: | FileCheck --check-prefix=CHECK-LD-64 %s
// CHECK-LD-64: "{{.*}}ld{{(.exe)?}}"
// CHECK-LD-64: "-l[[DEFAULT_OPENMP_LIB:[^"]*]]"
// CHECK-LD-64: "-lpthread" "-lc"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -fopenmp=libgomp -target i386-unknown-linux -rtlib=platform \
// RUN: | FileCheck --check-prefix=CHECK-GOMP-LD-32 %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 -fopenmp-simd -target i386-unknown-linux -rtlib=platform | FileCheck --check-prefix SIMD-ONLY2 %s
// SIMD-ONLY2-NOT: lgomp
// SIMD-ONLY2-NOT: lomp
// SIMD-ONLY2-NOT: liomp
// CHECK-GOMP-LD-32: "{{.*}}ld{{(.exe)?}}"
// CHECK-GOMP-LD-32: "-lgomp" "-lrt"
// CHECK-GOMP-LD-32: "-lpthread" "-lc"
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 -fopenmp-simd -target i386-unknown-linux -rtlib=platform | FileCheck --check-prefix SIMD-ONLY2 %s
// SIMD-ONLY2-NOT: lgomp
// SIMD-ONLY2-NOT: lomp
// SIMD-ONLY2-NOT: liomp
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -fopenmp=libgomp -target x86_64-unknown-linux -rtlib=platform \
// RUN: | FileCheck --check-prefix=CHECK-GOMP-LD-64 %s
// CHECK-GOMP-LD-64: "{{.*}}ld{{(.exe)?}}"
// CHECK-GOMP-LD-64: "-lgomp" "-lrt"
// CHECK-GOMP-LD-64: "-lpthread" "-lc"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -fopenmp -target i386-unknown-linux -rtlib=platform \
// RUN: | FileCheck --check-prefix=CHECK-IOMP5-LD-32 %s
// CHECK-IOMP5-LD-32: "{{.*}}ld{{(.exe)?}}"
// CHECK-IOMP5-LD-32: "-l[[DEFAULT_OPENMP_LIB:[^"]*]]"
// CHECK-IOMP5-LD-32: "-lpthread" "-lc"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -fopenmp -target x86_64-unknown-linux -rtlib=platform \
// RUN: | FileCheck --check-prefix=CHECK-IOMP5-LD-64 %s
// CHECK-IOMP5-LD-64: "{{.*}}ld{{(.exe)?}}"
// CHECK-IOMP5-LD-64: "-l[[DEFAULT_OPENMP_LIB:[^"]*]]"
// CHECK-IOMP5-LD-64: "-lpthread" "-lc"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -fopenmp=lib -target i386-unknown-linux \
// RUN: | FileCheck --check-prefix=CHECK-LIB-LD-32 %s
// CHECK-LIB-LD-32: error: unsupported argument 'lib' to option '-fopenmp='
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -fopenmp=lib -target x86_64-unknown-linux \
// RUN: | FileCheck --check-prefix=CHECK-LIB-LD-64 %s
// CHECK-LIB-LD-64: error: unsupported argument 'lib' to option '-fopenmp='
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -fopenmp -fopenmp=libgomp -target i386-unknown-linux \
// RUN: -rtlib=platform \
// RUN: | FileCheck --check-prefix=CHECK-LD-OVERRIDE-32 %s
// CHECK-LD-OVERRIDE-32: "{{.*}}ld{{(.exe)?}}"
// CHECK-LD-OVERRIDE-32: "-lgomp" "-lrt"
// CHECK-LD-OVERRIDE-32: "-lpthread" "-lc"
//
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
// RUN: -fopenmp -fopenmp=libgomp -target x86_64-unknown-linux \
// RUN: -rtlib=platform \
// RUN: | FileCheck --check-prefix=CHECK-LD-OVERRIDE-64 %s
// CHECK-LD-OVERRIDE-64: "{{.*}}ld{{(.exe)?}}"
// CHECK-LD-OVERRIDE-64: "-lgomp" "-lrt"
// CHECK-LD-OVERRIDE-64: "-lpthread" "-lc"
//
// RUN: %clang -no-canonical-prefixes -fuse-ld=link %s -### -o %t.o 2>&1 \
// RUN: -fopenmp=libomp -target x86_64-msvc-win32 -rtlib=platform \
// RUN: | FileCheck --check-prefix=CHECK-MSVC-LINK-64 %s
// CHECK-MSVC-LINK-64: link.exe
// CHECK-MSVC-LINK-64-SAME: -nodefaultlib:vcomp.lib
// CHECK-MSVC-LINK-64-SAME: -nodefaultlib:vcompd.lib
// CHECK-MSVC-LINK-64-SAME: -libpath:{{.+}}/../lib
// CHECK-MSVC-LINK-64-SAME: -defaultlib:libomp.lib
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 -fopenmp-simd -target x86_64-msvc-win32 -rtlib=platform | FileCheck --check-prefix SIMD-ONLY11 %s
// SIMD-ONLY11-NOT: libiomp
// SIMD-ONLY11-NOT: libomp
// SIMD-ONLY11-NOT: libgomp
//
// RUN: %clang -no-canonical-prefixes %s -fuse-ld=link -### -o %t.o 2>&1 \
// RUN: -fopenmp=libiomp5 -target x86_64-msvc-win32 -rtlib=platform \
// RUN: | FileCheck --check-prefix=CHECK-MSVC-ILINK-64 %s
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 -fopenmp-simd -target x86_64-msvc-win32 -rtlib=platform | FileCheck --check-prefix SIMD-ONLY11 %s
// SIMD-ONLY11-NOT: libiomp
// SIMD-ONLY11-NOT: libomp
// SIMD-ONLY11-NOT: libgomp
// CHECK-MSVC-ILINK-64: link.exe
// CHECK-MSVC-ILINK-64-SAME: -nodefaultlib:vcomp.lib
// CHECK-MSVC-ILINK-64-SAME: -nodefaultlib:vcompd.lib
// CHECK-MSVC-ILINK-64-SAME: -libpath:{{.+}}/../lib
// CHECK-MSVC-ILINK-64-SAME: -defaultlib:libiomp5md.lib
//
|
the_stack_data/115765736.c | // Program 92: Program to calculate power using recursion
#include <stdio.h>
int power(int n1, int n2);
int main()
{
int base, a, result;
printf("Enter base number: ");
scanf("%d", &base);
printf("Enter power number(positive integer): ");
scanf("%d", &a);
result = power(base, a);
printf("%d^%d = %d", base, a, result);
return 0;
}
int power(int base, int a) {
if (a != 0)
return (base * power(base, a - 1));
else
return 1;
} |
the_stack_data/122016314.c | // this is a GCC extension
int main()
{
int x, y;
#ifdef __GNUC__
asm goto ("jc %l[error];"
: : "r"(x), "r"(&y) : "memory" : error);
#endif
error:
return 0;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.