file
stringlengths 18
26
| data
stringlengths 2
1.05M
|
---|---|
the_stack_data/138813.c | /* ************************************************************************** */
/* */
/* :::::::: */
/* ft_isprint.c :+: :+: */
/* +:+ */
/* By: mvan-eng <[email protected]> +#+ */
/* +#+ */
/* Created: 2019/01/14 19:29:21 by mvan-eng #+# #+# */
/* Updated: 2022/01/11 13:38:21 by merlijn ######## odam.nl */
/* */
/* ************************************************************************** */
int ft_isprint(int c)
{
if (c > 31 && c < 127)
return (1);
else
return (0);
}
|
the_stack_data/1241769.c | #include<stdio.h>
int i, j, data, k, bantu, h[100], A[100];
main()
{
printf ("MASUKAN JUMLAH DATA = "); scanf ("%d", &data);
printf ("\n\n");
for (i=1; i <= data; i++)
{
printf ("A[%d] = ", i); scanf ("%d", &h[i]);}
printf ("\n\n");
printf(":::::::::::::::::::: DATA TIDAK TERURUT ::::::::::::::::::::");
printf("\n\n");
printf("A= { ");
for (i=1; i <= data; i++)
{
printf ("%d,", h[i]);
}
printf (" } ");
for(i=1; i<= data; i++)
{
for (j = data; j >= (i+1); j--)
{
if (h[j]>h[j-1])
{
bantu=h[j-1];
h[j-1]=h[j];
h[j]=bantu;
printf("\n\n");
printf("A={ ");
for(k=1; k <= data; k++)
{
printf("%d,",h[k]);
}
printf(" }\a ");
}
}
}
printf("\n\n");
printf("DATA SUDAH TERURUT : ");
printf("A={ ");
for (i=1; i <= data ;i++)
{
printf("%d,",h[i]);
}
printf ("}");
return 0;
}
|
the_stack_data/82949954.c | #include <stdio.h>
int reverse(int x){
int reverse = 0;
while (x) {
reverse = reverse * 10 + (x % 10);
x /= 10;
}
return reverse;
}
int main(){
int x;
scanf("%d", &x);
printf("%d\n", reverse(x));
return 0;
}
|
the_stack_data/54826130.c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_swap.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: kaye <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/08/05 11:19:03 by kaye #+# #+# */
/* Updated: 2020/08/05 11:24:17 by kaye ### ########.fr */
/* */
/* ************************************************************************** */
void ft_swap(int *a, int *b)
{
int tmp;
tmp = 0;
tmp = *a;
*a = *b;
*b = tmp;
}
|
the_stack_data/76701154.c | /* Taxonomy Classification: 0000020000000000000000 */
/*
* WRITE/READ 0 write
* WHICH BOUND 0 upper
* DATA TYPE 0 char
* MEMORY LOCATION 0 stack
* SCOPE 0 same
* CONTAINER 2 struct
* POINTER 0 no
* INDEX COMPLEXITY 0 constant
* ADDRESS COMPLEXITY 0 constant
* LENGTH COMPLEXITY 0 N/A
* ADDRESS ALIAS 0 none
* INDEX ALIAS 0 none
* LOCAL CONTROL FLOW 0 none
* SECONDARY CONTROL FLOW 0 none
* LOOP STRUCTURE 0 no
* LOOP COMPLEXITY 0 N/A
* ASYNCHRONY 0 no
* TAINT 0 no
* RUNTIME ENV. DEPENDENCE 0 no
* MAGNITUDE 0 no overflow
* CONTINUOUS/DISCRETE 0 discrete
* SIGNEDNESS 0 no
*/
/*
Copyright 2004 M.I.T.
Permission is hereby granted, without written agreement or royalty fee, to use,
copy, modify, and distribute this software and its documentation for any
purpose, provided that the above copyright notice and the following three
paragraphs appear in all copies of this software.
IN NO EVENT SHALL M.I.T. BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL,
INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE
AND ITS DOCUMENTATION, EVEN IF M.I.T. HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMANGE.
M.I.T. SPECIFICALLY DISCLAIMS ANY WARRANTIES INCLUDING, BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
AND NON-INFRINGEMENT.
THE SOFTWARE IS PROVIDED ON AN "AS-IS" BASIS AND M.I.T. HAS NO OBLIGATION TO
PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*/
typedef struct
{
int int_field;
char buf[10];
} my_struct;
int main(int argc, char *argv[])
{
my_struct s;
/* OK */
s.buf[9] = 'A';
return 0;
}
|
the_stack_data/337745.c | /**
******************************************************************************
* @file : usbd_conf.c
* @version : v1.0_Cube
* @brief : This file implements the board support package for the USB device library
******************************************************************************
*
* Copyright (c) 2017 STMicroelectronics International N.V.
* 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. Redistribution of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of other
* contributors to this software may be used to endorse or promote products
* derived from this software without specific written permission.
* 4. This software, including modifications and/or derivative works of this
* software, must execute solely and exclusively on microcontroller or
* microprocessor devices manufactured by or for STMicroelectronics.
* 5. Redistribution and use of this software other than as permitted under
* this license is void and will automatically terminate your rights under
* this license.
*
* THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
* RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
* SHALL STMICROELECTRONICS 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.
*
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#ifdef STM32F7
#include "stm32_def.h"
#include "usbd_def.h"
#include "usbd_core.h"
#pragma GCC diagnostic ignored "-Wunused-parameter"
//#pragma GCC diagnostic ignored "-Wwrite-strings"
//#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
//#pragma GCC diagnostic ignored "-Wunused-variable"
//#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
PCD_HandleTypeDef hpcd_USB_OTG_FS;
void Error_Handler(void);
/* External functions --------------------------------------------------------*/
void SystemClock_Config(void);
/* USER CODE BEGIN 0 */
/* USER CODE END 0 */
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/*******************************************************************************
LL Driver Callbacks (PCD -> USB Device Library)
*******************************************************************************/
/* MSP Init */
void HAL_PCD_MspInit(PCD_HandleTypeDef* pcdHandle)
{
GPIO_InitTypeDef GPIO_InitStruct;
if(pcdHandle->Instance==USB_OTG_FS)
{
/* USER CODE BEGIN USB_OTG_FS_MspInit 0 */
/* USER CODE END USB_OTG_FS_MspInit 0 */
/**USB_OTG_FS GPIO Configuration
PA12 ------> USB_OTG_FS_DP
PA11 ------> USB_OTG_FS_DM
*/
GPIO_InitStruct.Pin = GPIO_PIN_12|GPIO_PIN_11;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF10_OTG_FS;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
/* Peripheral clock enable */
__HAL_RCC_USB_OTG_FS_CLK_ENABLE();
/* Peripheral interrupt init */
HAL_NVIC_SetPriority(OTG_FS_IRQn, 5, 0);
HAL_NVIC_EnableIRQ(OTG_FS_IRQn);
/* USER CODE BEGIN USB_OTG_FS_MspInit 1 */
/* USER CODE END USB_OTG_FS_MspInit 1 */
}
}
void HAL_PCD_MspDeInit(PCD_HandleTypeDef* pcdHandle)
{
if(pcdHandle->Instance==USB_OTG_FS)
{
/* USER CODE BEGIN USB_OTG_FS_MspDeInit 0 */
/* USER CODE END USB_OTG_FS_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_USB_OTG_FS_CLK_DISABLE();
/**USB_OTG_FS GPIO Configuration
PA12 ------> USB_OTG_FS_DP
PA11 ------> USB_OTG_FS_DM
*/
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_12|GPIO_PIN_11);
/* Peripheral interrupt Deinit*/
HAL_NVIC_DisableIRQ(OTG_FS_IRQn);
/* USER CODE BEGIN USB_OTG_FS_MspDeInit 1 */
/* USER CODE END USB_OTG_FS_MspDeInit 1 */
}
}
/**
* @brief Setup stage callback
* @param hpcd: PCD handle
* @retval None
*/
void HAL_PCD_SetupStageCallback(PCD_HandleTypeDef *hpcd)
{
USBD_LL_SetupStage((USBD_HandleTypeDef*)hpcd->pData, (uint8_t *)hpcd->Setup);
}
/**
* @brief Data Out stage callback.
* @param hpcd: PCD handle
* @param epnum: Endpoint Number
* @retval None
*/
void HAL_PCD_DataOutStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum)
{
USBD_LL_DataOutStage((USBD_HandleTypeDef*)hpcd->pData, epnum, hpcd->OUT_ep[epnum].xfer_buff);
}
/**
* @brief Data In stage callback..
* @param hpcd: PCD handle
* @param epnum: Endpoint Number
* @retval None
*/
void HAL_PCD_DataInStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum)
{
USBD_LL_DataInStage((USBD_HandleTypeDef*)hpcd->pData, epnum, hpcd->IN_ep[epnum].xfer_buff);
}
/**
* @brief SOF callback.
* @param hpcd: PCD handle
* @retval None
*/
void HAL_PCD_SOFCallback(PCD_HandleTypeDef *hpcd)
{
USBD_LL_SOF((USBD_HandleTypeDef*)hpcd->pData);
}
/**
* @brief Reset callback.
* @param hpcd: PCD handle
* @retval None
*/
void HAL_PCD_ResetCallback(PCD_HandleTypeDef *hpcd)
{
USBD_SpeedTypeDef speed = USBD_SPEED_FULL;
/*Set USB Current Speed*/
switch (hpcd->Init.speed)
{
case PCD_SPEED_HIGH:
speed = USBD_SPEED_HIGH;
break;
case PCD_SPEED_FULL:
speed = USBD_SPEED_FULL;
break;
default:
speed = USBD_SPEED_FULL;
break;
}
USBD_LL_SetSpeed((USBD_HandleTypeDef*)hpcd->pData, speed);
/*Reset Device*/
USBD_LL_Reset((USBD_HandleTypeDef*)hpcd->pData);
}
/**
* @brief Suspend callback.
* When Low power mode is enabled the debug cannot be used (IAR, Keil doesn't support it)
* @param hpcd: PCD handle
* @retval None
*/
void HAL_PCD_SuspendCallback(PCD_HandleTypeDef *hpcd)
{
/* Inform USB library that core enters in suspend Mode */
USBD_LL_Suspend((USBD_HandleTypeDef*)hpcd->pData);
__HAL_PCD_GATE_PHYCLOCK(hpcd);
/*Enter in STOP mode */
/* USER CODE BEGIN 2 */
if (hpcd->Init.low_power_enable)
{
/* Set SLEEPDEEP bit and SleepOnExit of Cortex System Control Register */
SCB->SCR |= (uint32_t)((uint32_t)(SCB_SCR_SLEEPDEEP_Msk | SCB_SCR_SLEEPONEXIT_Msk));
}
/* USER CODE END 2 */
}
/**
* @brief Resume callback.
When Low power mode is enabled the debug cannot be used (IAR, Keil doesn't support it)
* @param hpcd: PCD handle
* @retval None
*/
void HAL_PCD_ResumeCallback(PCD_HandleTypeDef *hpcd)
{
/* USER CODE BEGIN 3 */
/* USER CODE END 3 */
USBD_LL_Resume((USBD_HandleTypeDef*)hpcd->pData);
}
/**
* @brief ISOOUTIncomplete callback.
* @param hpcd: PCD handle
* @param epnum: Endpoint Number
* @retval None
*/
void HAL_PCD_ISOOUTIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum)
{
USBD_LL_IsoOUTIncomplete((USBD_HandleTypeDef*)hpcd->pData, epnum);
}
/**
* @brief ISOINIncomplete callback.
* @param hpcd: PCD handle
* @param epnum: Endpoint Number
* @retval None
*/
void HAL_PCD_ISOINIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum)
{
USBD_LL_IsoINIncomplete((USBD_HandleTypeDef*)hpcd->pData, epnum);
}
/**
* @brief ConnectCallback callback.
* @param hpcd: PCD handle
* @retval None
*/
void HAL_PCD_ConnectCallback(PCD_HandleTypeDef *hpcd)
{
USBD_LL_DevConnected((USBD_HandleTypeDef*)hpcd->pData);
}
/**
* @brief Disconnect callback.
* @param hpcd: PCD handle
* @retval None
*/
void HAL_PCD_DisconnectCallback(PCD_HandleTypeDef *hpcd)
{
USBD_LL_DevDisconnected((USBD_HandleTypeDef*)hpcd->pData);
}
/*******************************************************************************
LL Driver Interface (USB Device Library --> PCD)
*******************************************************************************/
/**
* @brief Initializes the Low Level portion of the Device driver.
* @param pdev: Device handle
* @retval USBD Status
*/
USBD_StatusTypeDef USBD_LL_Init (USBD_HandleTypeDef *pdev)
{
/* Init USB_IP */
if (pdev->id == DEVICE_FS) {
/* Link The driver to the stack */
hpcd_USB_OTG_FS.pData = pdev;
pdev->pData = &hpcd_USB_OTG_FS;
hpcd_USB_OTG_FS.Instance = USB_OTG_FS;
hpcd_USB_OTG_FS.Init.dev_endpoints = 6;
hpcd_USB_OTG_FS.Init.speed = PCD_SPEED_FULL;
hpcd_USB_OTG_FS.Init.dma_enable = DISABLE;
hpcd_USB_OTG_FS.Init.ep0_mps = DEP0CTL_MPS_64;
hpcd_USB_OTG_FS.Init.phy_itface = PCD_PHY_EMBEDDED;
hpcd_USB_OTG_FS.Init.Sof_enable = DISABLE;
hpcd_USB_OTG_FS.Init.low_power_enable = DISABLE;
hpcd_USB_OTG_FS.Init.lpm_enable = DISABLE;
hpcd_USB_OTG_FS.Init.vbus_sensing_enable = ENABLE;
hpcd_USB_OTG_FS.Init.use_dedicated_ep1 = DISABLE;
if (HAL_PCD_Init(&hpcd_USB_OTG_FS) != HAL_OK)
{
Error_Handler();
}
HAL_PCDEx_SetRxFiFo(&hpcd_USB_OTG_FS, 0x80);
HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_FS, 0, 0x40);
HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_FS, 1, 0x80);
}
return USBD_OK;
}
/**
* @brief De-Initializes the Low Level portion of the Device driver.
* @param pdev: Device handle
* @retval USBD Status
*/
USBD_StatusTypeDef USBD_LL_DeInit (USBD_HandleTypeDef *pdev)
{
HAL_StatusTypeDef hal_status = HAL_OK;
USBD_StatusTypeDef usb_status = USBD_OK;
hal_status = HAL_PCD_DeInit(pdev->pData);
switch (hal_status) {
case HAL_OK :
usb_status = USBD_OK;
break;
case HAL_ERROR :
usb_status = USBD_FAIL;
break;
case HAL_BUSY :
usb_status = USBD_BUSY;
break;
case HAL_TIMEOUT :
usb_status = USBD_FAIL;
break;
default :
usb_status = USBD_FAIL;
break;
}
return usb_status;
}
/**
* @brief Starts the Low Level portion of the Device driver.
* @param pdev: Device handle
* @retval USBD Status
*/
USBD_StatusTypeDef USBD_LL_Start(USBD_HandleTypeDef *pdev)
{
HAL_StatusTypeDef hal_status = HAL_OK;
USBD_StatusTypeDef usb_status = USBD_OK;
hal_status = HAL_PCD_Start(pdev->pData);
switch (hal_status) {
case HAL_OK :
usb_status = USBD_OK;
break;
case HAL_ERROR :
usb_status = USBD_FAIL;
break;
case HAL_BUSY :
usb_status = USBD_BUSY;
break;
case HAL_TIMEOUT :
usb_status = USBD_FAIL;
break;
default :
usb_status = USBD_FAIL;
break;
}
return usb_status;
}
/**
* @brief Stops the Low Level portion of the Device driver.
* @param pdev: Device handle
* @retval USBD Status
*/
USBD_StatusTypeDef USBD_LL_Stop (USBD_HandleTypeDef *pdev)
{
HAL_StatusTypeDef hal_status = HAL_OK;
USBD_StatusTypeDef usb_status = USBD_OK;
hal_status = HAL_PCD_Stop(pdev->pData);
switch (hal_status) {
case HAL_OK :
usb_status = USBD_OK;
break;
case HAL_ERROR :
usb_status = USBD_FAIL;
break;
case HAL_BUSY :
usb_status = USBD_BUSY;
break;
case HAL_TIMEOUT :
usb_status = USBD_FAIL;
break;
default :
usb_status = USBD_FAIL;
break;
}
return usb_status;
}
/**
* @brief Opens an endpoint of the Low Level Driver.
* @param pdev: Device handle
* @param ep_addr: Endpoint Number
* @param ep_type: Endpoint Type
* @param ep_mps: Endpoint Max Packet Size
* @retval USBD Status
*/
USBD_StatusTypeDef USBD_LL_OpenEP (USBD_HandleTypeDef *pdev,
uint8_t ep_addr,
uint8_t ep_type,
uint16_t ep_mps)
{
HAL_StatusTypeDef hal_status = HAL_OK;
USBD_StatusTypeDef usb_status = USBD_OK;
hal_status = HAL_PCD_EP_Open(pdev->pData,
ep_addr,
ep_mps,
ep_type);
switch (hal_status) {
case HAL_OK :
usb_status = USBD_OK;
break;
case HAL_ERROR :
usb_status = USBD_FAIL;
break;
case HAL_BUSY :
usb_status = USBD_BUSY;
break;
case HAL_TIMEOUT :
usb_status = USBD_FAIL;
break;
default :
usb_status = USBD_FAIL;
break;
}
return usb_status;
}
/**
* @brief Closes an endpoint of the Low Level Driver.
* @param pdev: Device handle
* @param ep_addr: Endpoint Number
* @retval USBD Status
*/
USBD_StatusTypeDef USBD_LL_CloseEP (USBD_HandleTypeDef *pdev, uint8_t ep_addr)
{
HAL_StatusTypeDef hal_status = HAL_OK;
USBD_StatusTypeDef usb_status = USBD_OK;
hal_status = HAL_PCD_EP_Close(pdev->pData, ep_addr);
switch (hal_status) {
case HAL_OK :
usb_status = USBD_OK;
break;
case HAL_ERROR :
usb_status = USBD_FAIL;
break;
case HAL_BUSY :
usb_status = USBD_BUSY;
break;
case HAL_TIMEOUT :
usb_status = USBD_FAIL;
break;
default :
usb_status = USBD_FAIL;
break;
}
return usb_status;
}
/**
* @brief Flushes an endpoint of the Low Level Driver.
* @param pdev: Device handle
* @param ep_addr: Endpoint Number
* @retval USBD Status
*/
USBD_StatusTypeDef USBD_LL_FlushEP (USBD_HandleTypeDef *pdev, uint8_t ep_addr)
{
HAL_StatusTypeDef hal_status = HAL_OK;
USBD_StatusTypeDef usb_status = USBD_OK;
hal_status = HAL_PCD_EP_Flush(pdev->pData, ep_addr);
switch (hal_status) {
case HAL_OK :
usb_status = USBD_OK;
break;
case HAL_ERROR :
usb_status = USBD_FAIL;
break;
case HAL_BUSY :
usb_status = USBD_BUSY;
break;
case HAL_TIMEOUT :
usb_status = USBD_FAIL;
break;
default :
usb_status = USBD_FAIL;
break;
}
return usb_status;
}
/**
* @brief Sets a Stall condition on an endpoint of the Low Level Driver.
* @param pdev: Device handle
* @param ep_addr: Endpoint Number
* @retval USBD Status
*/
USBD_StatusTypeDef USBD_LL_StallEP (USBD_HandleTypeDef *pdev, uint8_t ep_addr)
{
HAL_StatusTypeDef hal_status = HAL_OK;
USBD_StatusTypeDef usb_status = USBD_OK;
hal_status = HAL_PCD_EP_SetStall(pdev->pData, ep_addr);
switch (hal_status) {
case HAL_OK :
usb_status = USBD_OK;
break;
case HAL_ERROR :
usb_status = USBD_FAIL;
break;
case HAL_BUSY :
usb_status = USBD_BUSY;
break;
case HAL_TIMEOUT :
usb_status = USBD_FAIL;
break;
default :
usb_status = USBD_FAIL;
break;
}
return usb_status;
}
/**
* @brief Clears a Stall condition on an endpoint of the Low Level Driver.
* @param pdev: Device handle
* @param ep_addr: Endpoint Number
* @retval USBD Status
*/
USBD_StatusTypeDef USBD_LL_ClearStallEP (USBD_HandleTypeDef *pdev, uint8_t ep_addr)
{
HAL_StatusTypeDef hal_status = HAL_OK;
USBD_StatusTypeDef usb_status = USBD_OK;
hal_status = HAL_PCD_EP_ClrStall(pdev->pData, ep_addr);
switch (hal_status) {
case HAL_OK :
usb_status = USBD_OK;
break;
case HAL_ERROR :
usb_status = USBD_FAIL;
break;
case HAL_BUSY :
usb_status = USBD_BUSY;
break;
case HAL_TIMEOUT :
usb_status = USBD_FAIL;
break;
default :
usb_status = USBD_FAIL;
break;
}
return usb_status;
}
/**
* @brief Returns Stall condition.
* @param pdev: Device handle
* @param ep_addr: Endpoint Number
* @retval Stall (1: Yes, 0: No)
*/
uint8_t USBD_LL_IsStallEP (USBD_HandleTypeDef *pdev, uint8_t ep_addr)
{
PCD_HandleTypeDef *hpcd = (PCD_HandleTypeDef*) pdev->pData;
if((ep_addr & 0x80) == 0x80)
{
return hpcd->IN_ep[ep_addr & 0x7F].is_stall;
}
else
{
return hpcd->OUT_ep[ep_addr & 0x7F].is_stall;
}
}
/**
* @brief Assigns a USB address to the device.
* @param pdev: Device handle
* @param ep_addr: Endpoint Number
* @retval USBD Status
*/
USBD_StatusTypeDef USBD_LL_SetUSBAddress (USBD_HandleTypeDef *pdev, uint8_t dev_addr)
{
HAL_StatusTypeDef hal_status = HAL_OK;
USBD_StatusTypeDef usb_status = USBD_OK;
hal_status = HAL_PCD_SetAddress(pdev->pData, dev_addr);
switch (hal_status) {
case HAL_OK :
usb_status = USBD_OK;
break;
case HAL_ERROR :
usb_status = USBD_FAIL;
break;
case HAL_BUSY :
usb_status = USBD_BUSY;
break;
case HAL_TIMEOUT :
usb_status = USBD_FAIL;
break;
default :
usb_status = USBD_FAIL;
break;
}
return usb_status;
}
/**
* @brief Transmits data over an endpoint.
* @param pdev: Device handle
* @param ep_addr: Endpoint Number
* @param pbuf: Pointer to data to be sent
* @param size: Data size
* @retval USBD Status
*/
USBD_StatusTypeDef USBD_LL_Transmit (USBD_HandleTypeDef *pdev,
uint8_t ep_addr,
uint8_t *pbuf,
uint16_t size)
{
HAL_StatusTypeDef hal_status = HAL_OK;
USBD_StatusTypeDef usb_status = USBD_OK;
hal_status = HAL_PCD_EP_Transmit(pdev->pData, ep_addr, pbuf, size);
switch (hal_status) {
case HAL_OK :
usb_status = USBD_OK;
break;
case HAL_ERROR :
usb_status = USBD_FAIL;
break;
case HAL_BUSY :
usb_status = USBD_BUSY;
break;
case HAL_TIMEOUT :
usb_status = USBD_FAIL;
break;
default :
usb_status = USBD_FAIL;
break;
}
return usb_status;
}
/**
* @brief Prepares an endpoint for reception.
* @param pdev: Device handle
* @param ep_addr: Endpoint Number
* @param pbuf: Pointer to data to be received
* @param size: Data size
* @retval USBD Status
*/
USBD_StatusTypeDef USBD_LL_PrepareReceive(USBD_HandleTypeDef *pdev,
uint8_t ep_addr,
uint8_t *pbuf,
uint16_t size)
{
HAL_StatusTypeDef hal_status = HAL_OK;
USBD_StatusTypeDef usb_status = USBD_OK;
hal_status = HAL_PCD_EP_Receive(pdev->pData, ep_addr, pbuf, size);
switch (hal_status) {
case HAL_OK :
usb_status = USBD_OK;
break;
case HAL_ERROR :
usb_status = USBD_FAIL;
break;
case HAL_BUSY :
usb_status = USBD_BUSY;
break;
case HAL_TIMEOUT :
usb_status = USBD_FAIL;
break;
default :
usb_status = USBD_FAIL;
break;
}
return usb_status;
}
/**
* @brief Returns the last transfered packet size.
* @param pdev: Device handle
* @param ep_addr: Endpoint Number
* @retval Recived Data Size
*/
uint32_t USBD_LL_GetRxDataSize (USBD_HandleTypeDef *pdev, uint8_t ep_addr)
{
return HAL_PCD_EP_GetRxCount((PCD_HandleTypeDef*) pdev->pData, ep_addr);
}
#if (USBD_LPM_ENABLED == 1)
/**
* @brief HAL_PCDEx_LPM_Callback : Send LPM message to user layer
* @param hpcd: PCD handle
* @param msg: LPM message
* @retval HAL status
*/
void HAL_PCDEx_LPM_Callback(PCD_HandleTypeDef *hpcd, PCD_LPM_MsgTypeDef msg)
{
switch ( msg)
{
case PCD_LPM_L0_ACTIVE:
if (hpcd->Init.low_power_enable)
{
SystemClock_Config();
/* Reset SLEEPDEEP bit of Cortex System Control Register */
SCB->SCR &= (uint32_t)~((uint32_t)(SCB_SCR_SLEEPDEEP_Msk | SCB_SCR_SLEEPONEXIT_Msk));
}
__HAL_PCD_UNGATE_PHYCLOCK(hpcd);
USBD_LL_Resume(hpcd->pData);
break;
case PCD_LPM_L1_ACTIVE:
__HAL_PCD_GATE_PHYCLOCK(hpcd);
USBD_LL_Suspend(hpcd->pData);
/*Enter in STOP mode */
if (hpcd->Init.low_power_enable)
{
/* Set SLEEPDEEP bit and SleepOnExit of Cortex System Control Register */
SCB->SCR |= (uint32_t)((uint32_t)(SCB_SCR_SLEEPDEEP_Msk | SCB_SCR_SLEEPONEXIT_Msk));
}
break;
}
}
#endif
/**
* @brief Delays routine for the USB Device Library.
* @param Delay: Delay in ms
* @retval None
*/
void USBD_LL_Delay (uint32_t Delay)
{
HAL_Delay(Delay);
}
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
#endif
|
the_stack_data/177517.c | const unsigned short header_col[] = {
0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,
0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,
0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,
0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,
0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,
0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,
0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,
0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,
0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0x6000,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0x6000,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0x6000,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6020,0x7124,0x81A6,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x7986,0x68A2,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,
0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0x6000,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x7986,0x81C7,0x81A6,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x7986,0x81C7,0x81C7,0x68C3,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,
0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0x6000,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0x6000,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0x6000,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x68A2,0x81C7,0x7124,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6041,0x81C7,0x81A6,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,
0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x70E3,0x81C7,0x6882,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x7945,0x81C7,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,
0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x70E3,0x81C7,0x6861,0x6000,0x6000,0x6861,0x7945,0x7965,0x7965,0x7965,0x7965,0x7965,0x7965,0x7104,0x6000,0x6000,0x6861,0x7945,0x7965,0x7965,0x7965,0x7965,0x7965,0x7965,0x7945,0x6882,0x6000,0x7124,0x7965,0x70E3,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x7965,0x7965,0x7965,0x7965,0x7965,0x7965,0x7965,0x7965,0x70E3,0x6000,0x70E3,0x7945,0x7965,0x7965,0x7965,0x7965,0x7965,0x7945,0x68A2,0x6000,0x6000,0x70C3,0x7945,0x7965,0x7965,0x7965,0x7965,0x7965,0x7965,0x7104,0x6020,0x6000,0x6000,0x7945,0x81C7,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,
0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x70E3,0x81C7,0x6861,0x6000,0x6041,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x7945,0x6041,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x6861,0x7986,0x81C7,0x7945,0x6000,0x6000,0x6000,0x6000,0x6000,0x6020,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x7945,0x70E3,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x6882,0x70E3,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x7965,0x6000,0x6000,0x7945,0x81C7,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,
0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x70E3,0x81C7,0x6861,0x6000,0x68C3,0x81C7,0x81C7,0x6882,0x6020,0x6020,0x6020,0x6020,0x7124,0x81C7,0x81C7,0x70C3,0x81C7,0x81C7,0x68A2,0x6020,0x6020,0x6020,0x6020,0x6882,0x81C7,0x81C7,0x70E3,0x7986,0x81C7,0x7945,0x6000,0x6000,0x6000,0x6000,0x6000,0x6020,0x81C7,0x81C7,0x7104,0x6020,0x6020,0x6020,0x6020,0x6020,0x6020,0x7986,0x81C7,0x7965,0x6020,0x6020,0x6020,0x6020,0x6041,0x81A6,0x81C7,0x7104,0x7986,0x81C7,0x7986,0x6041,0x6020,0x6020,0x6020,0x6020,0x7124,0x81C7,0x81C7,0x6020,0x6000,0x7945,0x81C7,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,
0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x70E3,0x81C7,0x6861,0x6000,0x70C3,0x81C7,0x7965,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6020,0x6020,0x70C3,0x81C7,0x81A6,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x7965,0x81C7,0x70E3,0x7986,0x81C7,0x7945,0x6000,0x6000,0x6000,0x6000,0x6000,0x6020,0x81C7,0x81C7,0x7986,0x7124,0x7124,0x7124,0x7124,0x7124,0x6041,0x7986,0x81C7,0x68A2,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6020,0x6000,0x81A6,0x81C7,0x70C3,0x6000,0x6000,0x6000,0x6000,0x6000,0x6061,0x81C7,0x81C7,0x6020,0x6000,0x7945,0x81C7,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,
0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x70E3,0x81C7,0x6861,0x6000,0x70C3,0x81C7,0x7965,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x70C3,0x81C7,0x81A6,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x7965,0x81C7,0x70E3,0x7986,0x81C7,0x7945,0x6000,0x6000,0x6000,0x6000,0x6000,0x6020,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x6861,0x7986,0x81C7,0x68A2,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x81A6,0x81C7,0x70C3,0x6000,0x6000,0x6000,0x6000,0x6000,0x6041,0x81C7,0x81C7,0x6020,0x6000,0x7945,0x81C7,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,
0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x70E3,0x81C7,0x6861,0x6000,0x70C3,0x81C7,0x81A6,0x6020,0x6000,0x6000,0x6000,0x6000,0x70C3,0x81A6,0x8186,0x70C3,0x81C7,0x81C7,0x6041,0x6000,0x6000,0x6000,0x6000,0x6020,0x81C7,0x81C7,0x70E3,0x7986,0x81C7,0x7945,0x6000,0x6000,0x6000,0x6000,0x6000,0x6020,0x81C7,0x81C7,0x70E3,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x7986,0x81C7,0x7124,0x6000,0x6000,0x6000,0x6000,0x6000,0x7965,0x81A6,0x70E3,0x7986,0x81C7,0x7945,0x6000,0x6000,0x6000,0x6000,0x6000,0x70C3,0x81C7,0x81C7,0x6020,0x6000,0x7945,0x81C7,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,
0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x70E3,0x81C7,0x6861,0x6000,0x6861,0x81C7,0x81C7,0x81C7,0x7986,0x7986,0x7986,0x7986,0x81C7,0x81C7,0x7965,0x6861,0x81C7,0x81C7,0x81C7,0x7986,0x7986,0x7986,0x7986,0x81C7,0x81C7,0x81C7,0x6882,0x7986,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x6882,0x81C7,0x81C7,0x81A6,0x7965,0x7965,0x7965,0x7965,0x7965,0x70E3,0x7924,0x81C7,0x81C7,0x81A6,0x7986,0x7986,0x7986,0x81A6,0x81C7,0x81C7,0x68A2,0x7124,0x81C7,0x81C7,0x81A6,0x7986,0x7986,0x7986,0x8186,0x81C7,0x81C7,0x81A6,0x6000,0x6000,0x7945,0x81C7,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,
0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x70E3,0x81C7,0x6861,0x6000,0x6000,0x70C3,0x81A6,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x7965,0x6041,0x6000,0x70C3,0x81A6,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81A6,0x70E3,0x6000,0x7986,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x6882,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x7945,0x6020,0x7945,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81A6,0x7104,0x6000,0x6020,0x7945,0x81A6,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x7986,0x6861,0x6000,0x6000,0x7945,0x81C7,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,
0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x70E3,0x81C7,0x6861,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6020,0x6020,0x6020,0x6020,0x6020,0x6020,0x6020,0x6020,0x6000,0x6020,0x6020,0x6020,0x6020,0x6020,0x6020,0x6020,0x6020,0x6020,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x7945,0x81C7,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,
0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x68A2,0x81C7,0x7104,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6020,0x81A6,0x81A6,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,
0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x81A6,0x81C7,0x7986,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x7945,0x81A6,0x81C7,0x70C3,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,
0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6041,0x7945,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81C7,0x81A6,0x70C3,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,
0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0xD445,0xD445,0xD445,0xD445,0xD445,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,
0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,
0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,
0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,
0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,
0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,
0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,
0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,0x6000,
};
|
the_stack_data/150251.c | // Sorting of array list using pancake sort
#include <stdlib.h>
#include <stdio.h>
/* Reverses the array */
void flip(int arr[], int i)
{
int temp, start = 0;
while (start < i)
{
temp = arr[start];
arr[start] = arr[i];
arr[i] = temp;
start++;
i--;
}
}
// Returns index of the maximum element in arr[0..n-1]
int findMax(int arr[], int n)
{
int maxElementIdx, i;
for (maxElementIdx = 0, i = 0; i < n; ++i)
if (arr[i] > arr[maxElementIdx])
maxElementIdx = i;
return maxElementIdx;
}
// Sorts the array using flip operations
int pancakeSort(int *arr, int n)
{
// Start from the complete array and one by one reduce current size by one
for (int curr_size = n; curr_size > 1; --curr_size)
{
// Find index of the maximum element in arr[0..curr_size-1]
int maxElementIdx = findMax(arr, curr_size);
// Move the maximum element to end of current array if it's not already at the end
if (maxElementIdx != curr_size-1)
{
// To move at the end, first move maximum number to beginning
flip(arr, maxElementIdx);
// Now move the maximum number to end by reversing current array
flip(arr, curr_size-1);
}
}
}
// Displays the array, passed to this method
void display(int arr[], int n)
{
for(int i = 0; i < n; i++){
printf("%d ", arr[i]);
}
printf("\n");
}
// Driver program to test above function
int main()
{
int n; // Size of array elements
int arr[n];
printf("Enter size of array:\n");
scanf("%d", &n); // E.g. 8
printf("Enter the elements of the array\n");
for(int i = 0; i < n; i++){
scanf("%d", &arr[i] );
}
printf("Original array: ");
display(arr, n);
pancakeSort(arr, n);
printf("Sorted array: ");
display(arr, n);
return 0;
} |
the_stack_data/168894362.c | extern void __VERIFIER_error() __attribute__ ((__noreturn__));
extern char __VERIFIER_nondet_char(void);
extern int __VERIFIER_nondet_int(void);
extern long __VERIFIER_nondet_long(void);
extern void *__VERIFIER_nondet_pointer(void);
void IofCompleteRequest(int Irp , int PriorityBoost );
extern int __VERIFIER_nondet_int();
int FloppyThread ;
int KernelMode ;
int Suspended ;
int Executive ;
int DiskController ;
int FloppyDiskPeripheral ;
int FlConfigCallBack ;
int MaximumInterfaceType ;
int MOUNTDEV_MOUNTED_DEVICE_GUID ;
int myStatus ;
int s ;
int UNLOADED ;
int NP ;
int DC ;
int SKIP1 ;
int SKIP2 ;
int MPR1 ;
int MPR3 ;
int IPC ;
int pended ;
int compRegistered ;
int lowerDriverReturn ;
int setEventCalled ;
int customIrp ;
void errorFn(void)
{
{
ERROR: __VERIFIER_error();
return;
}
}
void _BLAST_init(void)
{
{
#line 73
UNLOADED = 0;
#line 74
NP = 1;
#line 75
DC = 2;
#line 76
SKIP1 = 3;
#line 77
SKIP2 = 4;
#line 78
MPR1 = 5;
#line 79
MPR3 = 6;
#line 80
IPC = 7;
#line 81
s = UNLOADED;
#line 82
pended = 0;
#line 83
compRegistered = 0;
#line 84
lowerDriverReturn = 0;
#line 85
setEventCalled = 0;
#line 86
customIrp = 0;
#line 87
return;
}
}
#line 90 "floppy_simpl3.cil.c"
int PagingReferenceCount = 0;
#line 91 "floppy_simpl3.cil.c"
int PagingMutex = 0;
#line 92 "floppy_simpl3.cil.c"
int FlAcpiConfigureFloppy(int DisketteExtension , int FdcInfo )
{
{
#line 96
return (0);
}
}
#line 99 "floppy_simpl3.cil.c"
int FlQueueIrpToThread(int Irp , int DisketteExtension )
{ int status ;
int threadHandle = __VERIFIER_nondet_int() ;
int DisketteExtension__PoweringDown = __VERIFIER_nondet_int() ;
int DisketteExtension__ThreadReferenceCount = __VERIFIER_nondet_int() ;
int DisketteExtension__FloppyThread = __VERIFIER_nondet_int() ;
int Irp__IoStatus__Status ;
int Irp__IoStatus__Information ;
int Irp__Tail__Overlay__CurrentStackLocation__Control ;
int ObjAttributes = __VERIFIER_nondet_int() ;
int __cil_tmp12 ;
int __cil_tmp13 ;
{
#line 111
if (DisketteExtension__PoweringDown == 1) {
#line 112
myStatus = -1073741101;
#line 113
Irp__IoStatus__Status = -1073741101;
#line 114
Irp__IoStatus__Information = 0;
#line 115
return (-1073741101);
}
#line 119
DisketteExtension__ThreadReferenceCount ++;
#line 120
if (DisketteExtension__ThreadReferenceCount == 0) {
#line 121
DisketteExtension__ThreadReferenceCount ++;
#line 122
PagingReferenceCount ++;
#line 123
if (PagingReferenceCount == 1) {
}
{
#line 129
status = PsCreateSystemThread(threadHandle, 0, ObjAttributes, 0, 0, FloppyThread,
DisketteExtension);
}
{
#line 132
#line 132
if (status < 0) {
#line 133
DisketteExtension__ThreadReferenceCount = -1;
#line 134
PagingReferenceCount --;
#line 135
if (PagingReferenceCount == 0) {
}
#line 140
return (status);
}
}
{
#line 145
status = ObReferenceObjectByHandle(threadHandle, 1048576, 0, KernelMode, DisketteExtension__FloppyThread,
0);
#line 147
ZwClose(threadHandle);
}
{
#line 149
#line 149
if (status < 0) {
#line 150
return (status);
}
}
}
#line 157
// Irp__Tail__Overlay__CurrentStackLocation__Control |= 1;
#line 158
if (pended == 0) {
#line 159
pended = 1;
} else {
{
#line 162
errorFn();
}
}
#line 165
return (259);
}
}
#line 168 "floppy_simpl3.cil.c"
int FloppyPnp(int DeviceObject , int Irp )
{ int DeviceObject__DeviceExtension = __VERIFIER_nondet_int() ;
int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ;
int Irp__IoStatus__Information ;
int Irp__IoStatus__Status ;
int Irp__CurrentLocation = __VERIFIER_nondet_int() ;
int disketteExtension__IsRemoved = __VERIFIER_nondet_int() ;
int disketteExtension__IsStarted = __VERIFIER_nondet_int() ;
int disketteExtension__TargetObject = __VERIFIER_nondet_int() ;
int disketteExtension__HoldNewRequests ;
int disketteExtension__FloppyThread = __VERIFIER_nondet_int() ;
int disketteExtension__InterfaceString__Buffer = __VERIFIER_nondet_int() ;
int disketteExtension__InterfaceString = __VERIFIER_nondet_int() ;
int disketteExtension__ArcName__Length = __VERIFIER_nondet_int() ;
int disketteExtension__ArcName = __VERIFIER_nondet_int() ;
int irpSp__MinorFunction = __VERIFIER_nondet_int() ;
int IoGetConfigurationInformation__FloppyCount = __VERIFIER_nondet_int() ;
int irpSp ;
int disketteExtension ;
int ntStatus ;
int doneEvent = __VERIFIER_nondet_int() ;
int irpSp___0 ;
int nextIrpSp ;
int nextIrpSp__Control ;
int irpSp___1 ;
int irpSp__Context ;
int irpSp__Control ;
long __cil_tmp29 ;
long __cil_tmp30 ;
{
#line 197
ntStatus = 0;
#line 198
PagingReferenceCount ++;
#line 199
if (PagingReferenceCount == 1) {
}
#line 204
disketteExtension = DeviceObject__DeviceExtension;
#line 205
irpSp = Irp__Tail__Overlay__CurrentStackLocation;
#line 206
if (disketteExtension__IsRemoved) {
{
#line 208
Irp__IoStatus__Information = 0;
#line 209
Irp__IoStatus__Status = -1073741738;
#line 210
myStatus = -1073741738;
#line 211
IofCompleteRequest(Irp, 0);
}
#line 213
return (-1073741738);
}
#line 217
if (irpSp__MinorFunction == 0) {
goto switch_0_0;
} else {
#line 220
if (irpSp__MinorFunction == 5) {
goto switch_0_5;
} else {
#line 223
if (irpSp__MinorFunction == 1) {
goto switch_0_5;
} else {
#line 226
if (irpSp__MinorFunction == 6) {
goto switch_0_6;
} else {
#line 229
if (irpSp__MinorFunction == 3) {
goto switch_0_6;
} else {
#line 232
if (irpSp__MinorFunction == 4) {
goto switch_0_4;
} else {
#line 235
if (irpSp__MinorFunction == 2) {
goto switch_0_2;
} else {
goto switch_0_default;
#line 240
if (0) {
switch_0_0:
{
#line 243
ntStatus = FloppyStartDevice(DeviceObject, Irp);
}
goto switch_0_break;
switch_0_5:
#line 248
if (irpSp__MinorFunction == 5) {
}
#line 253
if (! disketteExtension__IsStarted) {
#line 254
if (s == NP) {
#line 255
s = SKIP1;
} else {
{
#line 258
errorFn();
}
}
{
#line 262
Irp__CurrentLocation ++;
#line 263
Irp__Tail__Overlay__CurrentStackLocation ++;
#line 264
ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp);
}
#line 266
return (ntStatus);
}
{
#line 271
disketteExtension__HoldNewRequests = 1;
#line 272
ntStatus = FlQueueIrpToThread(Irp, disketteExtension);
}
{
#line 274
__cil_tmp29 = (long )ntStatus;
#line 274
if (__cil_tmp29 == 259L) {
{
#line 276
KeWaitForSingleObject(disketteExtension__FloppyThread, Executive,
KernelMode, 0, 0);
}
#line 279
if (disketteExtension__FloppyThread != 0) {
}
#line 284
disketteExtension__FloppyThread = 0;
#line 285
Irp__IoStatus__Status = 0;
#line 286
myStatus = 0;
#line 287
if (s == NP) {
#line 288
s = SKIP1;
} else {
{
#line 291
errorFn();
}
}
{
#line 295
Irp__CurrentLocation ++;
#line 296
Irp__Tail__Overlay__CurrentStackLocation ++;
#line 297
ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp);
}
} else {
{
#line 301
ntStatus = -1073741823;
#line 302
Irp__IoStatus__Status = ntStatus;
#line 303
myStatus = ntStatus;
#line 304
Irp__IoStatus__Information = 0;
#line 305
IofCompleteRequest(Irp, 0);
}
}
}
goto switch_0_break;
switch_0_6:
#line 311
if (irpSp__MinorFunction == 6) {
}
#line 316
if (! disketteExtension__IsStarted) {
#line 317
Irp__IoStatus__Status = 0;
#line 318
myStatus = 0;
#line 319
if (s == NP) {
#line 320
s = SKIP1;
} else {
{
#line 323
errorFn();
}
}
{
#line 327
Irp__CurrentLocation ++;
#line 328
Irp__Tail__Overlay__CurrentStackLocation ++;
#line 329
ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp);
}
} else {
#line 332
Irp__IoStatus__Status = 0;
#line 333
myStatus = 0;
#line 334
irpSp___0 = Irp__Tail__Overlay__CurrentStackLocation;
#line 335
nextIrpSp = Irp__Tail__Overlay__CurrentStackLocation - 1;
#line 336
nextIrpSp__Control = 0;
#line 337
if (s != NP) {
{
#line 339
errorFn();
}
} else {
#line 342
if (compRegistered != 0) {
{
#line 344
errorFn();
}
} else {
#line 347
compRegistered = 1;
}
}
{
#line 351
irpSp___1 = Irp__Tail__Overlay__CurrentStackLocation - 1;
#line 352
irpSp__Context = doneEvent;
#line 353
irpSp__Control = 224;
#line 357
ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp);
}
{
#line 359
__cil_tmp30 = (long )ntStatus;
#line 359
if (__cil_tmp30 == 259L) {
{
#line 361
KeWaitForSingleObject(doneEvent, Executive, KernelMode, 0, 0);
#line 362
ntStatus = myStatus;
}
}
}
{
#line 368
disketteExtension__HoldNewRequests = 0;
#line 369
Irp__IoStatus__Status = ntStatus;
#line 370
myStatus = ntStatus;
#line 371
Irp__IoStatus__Information = 0;
#line 372
IofCompleteRequest(Irp, 0);
}
}
goto switch_0_break;
switch_0_4:
#line 377
disketteExtension__IsStarted = 0;
#line 378
Irp__IoStatus__Status = 0;
#line 379
myStatus = 0;
#line 380
if (s == NP) {
#line 381
s = SKIP1;
} else {
{
#line 384
errorFn();
}
}
{
#line 388
Irp__CurrentLocation ++;
#line 389
Irp__Tail__Overlay__CurrentStackLocation ++;
#line 390
ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp);
}
goto switch_0_break;
switch_0_2:
#line 394
disketteExtension__HoldNewRequests = 0;
#line 395
disketteExtension__IsStarted = 0;
#line 396
disketteExtension__IsRemoved = 1;
#line 397
if (s == NP) {
#line 398
s = SKIP1;
} else {
{
#line 401
errorFn();
}
}
{
#line 405
Irp__CurrentLocation ++;
#line 406
Irp__Tail__Overlay__CurrentStackLocation ++;
#line 407
Irp__IoStatus__Status = 0;
#line 408
myStatus = 0;
#line 409
ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp);
}
#line 411
if (disketteExtension__InterfaceString__Buffer != 0) {
{
#line 413
IoSetDeviceInterfaceState(disketteExtension__InterfaceString,
0);
}
}
#line 419
if (disketteExtension__ArcName__Length != 0) {
{
#line 421
IoDeleteSymbolicLink(disketteExtension__ArcName);
}
}
#line 426
IoGetConfigurationInformation__FloppyCount --;
goto switch_0_break;
switch_0_default: ;
#line 429
if (s == NP) {
#line 430
s = SKIP1;
} else {
{
#line 433
errorFn();
}
}
{
#line 437
Irp__CurrentLocation ++;
#line 438
Irp__Tail__Overlay__CurrentStackLocation ++;
#line 439
ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp);
}
} else {
switch_0_break: ;
}
}
}
}
}
}
}
}
#line 452
PagingReferenceCount --;
#line 453
if (PagingReferenceCount == 0) {
}
#line 458
return (ntStatus);
}
}
#line 461 "floppy_simpl3.cil.c"
int FloppyStartDevice(int DeviceObject , int Irp )
{ int DeviceObject__DeviceExtension = __VERIFIER_nondet_int() ;
int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ;
int Irp__IoStatus__Status ;
int disketteExtension__TargetObject = __VERIFIER_nondet_int() ;
int disketteExtension__MaxTransferSize ;
int disketteExtension__DriveType = __VERIFIER_nondet_int() ;
int disketteExtension__PerpendicularMode ;
int disketteExtension__DeviceUnit ;
int disketteExtension__DriveOnValue ;
int disketteExtension__UnderlyingPDO = __VERIFIER_nondet_int() ;
int disketteExtension__InterfaceString = __VERIFIER_nondet_int() ;
int disketteExtension__IsStarted ;
int disketteExtension__HoldNewRequests ;
int ntStatus ;
int pnpStatus ;
int doneEvent = __VERIFIER_nondet_int() ;
int fdcInfo = __VERIFIER_nondet_int() ;
int fdcInfo__BufferCount ;
int fdcInfo__BufferSize ;
int fdcInfo__MaxTransferSize = __VERIFIER_nondet_int() ;
int fdcInfo__AcpiBios = __VERIFIER_nondet_int() ;
int fdcInfo__AcpiFdiSupported = __VERIFIER_nondet_int() ;
int fdcInfo__PeripheralNumber = __VERIFIER_nondet_int() ;
int fdcInfo__BusType ;
int fdcInfo__ControllerNumber = __VERIFIER_nondet_int() ;
int fdcInfo__UnitNumber = __VERIFIER_nondet_int() ;
int fdcInfo__BusNumber = __VERIFIER_nondet_int() ;
int Dc ;
int Fp ;
int disketteExtension ;
int irpSp ;
int irpSp___0 ;
int nextIrpSp ;
int nextIrpSp__Control ;
int irpSp___1 ;
int irpSp__Control ;
int irpSp__Context ;
int InterfaceType ;
int KUSER_SHARED_DATA__AlternativeArchitecture_NEC98x86 = __VERIFIER_nondet_int() ;
long __cil_tmp42 ;
int __cil_tmp43 ;
int __cil_tmp44 ;
int __cil_tmp45 ;
int __cil_tmp46 ;
int __cil_tmp47 ;
int __cil_tmp48 ;
int __cil_tmp49 ;
{
#line 503
Dc = DiskController;
#line 504
Fp = FloppyDiskPeripheral;
#line 505
disketteExtension = DeviceObject__DeviceExtension;
#line 506
irpSp = Irp__Tail__Overlay__CurrentStackLocation;
#line 507
irpSp___0 = Irp__Tail__Overlay__CurrentStackLocation;
#line 508
nextIrpSp = Irp__Tail__Overlay__CurrentStackLocation - 1;
#line 509
nextIrpSp__Control = 0;
#line 510
if (s != NP) {
{
#line 512
errorFn();
}
} else {
#line 515
if (compRegistered != 0) {
{
#line 517
errorFn();
}
} else {
#line 520
compRegistered = 1;
}
}
{
#line 524
irpSp___1 = Irp__Tail__Overlay__CurrentStackLocation - 1;
#line 525
irpSp__Context = doneEvent;
#line 526
irpSp__Control = 224;
#line 530
ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp);
}
{
#line 532
__cil_tmp42 = (long )ntStatus;
#line 532
if (__cil_tmp42 == 259L) {
{
#line 534
ntStatus = KeWaitForSingleObject(doneEvent, Executive, KernelMode, 0, 0);
#line 535
ntStatus = myStatus;
}
}
}
{
#line 541
fdcInfo__BufferCount = 0;
#line 542
fdcInfo__BufferSize = 0;
#line 543
__cil_tmp43 = 3080;
#line 543
__cil_tmp44 = 458752;
#line 543
__cil_tmp45 = 461832;
#line 543
__cil_tmp46 = 461835;
#line 543
ntStatus = FlFdcDeviceIo(disketteExtension__TargetObject, __cil_tmp46, fdcInfo);
}
#line 546
if (ntStatus >= 0) {
#line 547
disketteExtension__MaxTransferSize = fdcInfo__MaxTransferSize;
#line 548
if (fdcInfo__AcpiBios) {
#line 549
if (fdcInfo__AcpiFdiSupported) {
{
#line 551
ntStatus = FlAcpiConfigureFloppy(disketteExtension, fdcInfo);
}
#line 553
if (disketteExtension__DriveType == 4) {
#line 554
//__cil_tmp47 = uninf1();
#line 554
//disketteExtension__PerpendicularMode |= __cil_tmp47;
}
} else {
goto _L;
}
} else {
_L:
#line 563
if (disketteExtension__DriveType == 4) {
#line 564
//__cil_tmp48 = uninf1();
#line 564
//disketteExtension__PerpendicularMode |= __cil_tmp48;
}
#line 568
InterfaceType = 0;
{
#line 570
while (1) {
while_0_continue: /* CIL Label */ ;
#line 572
if (InterfaceType >= MaximumInterfaceType) {
goto while_1_break;
}
{
#line 578
fdcInfo__BusType = InterfaceType;
#line 579
ntStatus = IoQueryDeviceDescription(fdcInfo__BusType, fdcInfo__BusNumber,
Dc, fdcInfo__ControllerNumber, Fp, fdcInfo__PeripheralNumber,
FlConfigCallBack, disketteExtension);
}
#line 583
if (ntStatus >= 0) {
goto while_1_break;
}
#line 588
InterfaceType ++;
}
while_0_break: /* CIL Label */ ;
}
while_1_break: ;
}
#line 593
if (ntStatus >= 0) {
#line 594
if (KUSER_SHARED_DATA__AlternativeArchitecture_NEC98x86 != 0) {
#line 595
disketteExtension__DeviceUnit = fdcInfo__UnitNumber;
#line 596
//disketteExtension__DriveOnValue = fdcInfo__UnitNumber;
} else {
#line 598
disketteExtension__DeviceUnit = fdcInfo__PeripheralNumber;
#line 599
//__cil_tmp49 = 16 << fdcInfo__PeripheralNumber;
#line 599
//disketteExtension__DriveOnValue = fdcInfo__PeripheralNumber | __cil_tmp49;
}
{
#line 602
pnpStatus = IoRegisterDeviceInterface(disketteExtension__UnderlyingPDO, MOUNTDEV_MOUNTED_DEVICE_GUID,
0, disketteExtension__InterfaceString);
}
#line 605
if (pnpStatus >= 0) {
{
#line 607
pnpStatus = IoSetDeviceInterfaceState(disketteExtension__InterfaceString,
1);
}
}
#line 613
disketteExtension__IsStarted = 1;
#line 614
disketteExtension__HoldNewRequests = 0;
}
}
{
#line 622
Irp__IoStatus__Status = ntStatus;
#line 623
myStatus = ntStatus;
#line 624
IofCompleteRequest(Irp, 0);
}
#line 626
return (ntStatus);
}
}
#line 629 "floppy_simpl3.cil.c"
int FloppyPnpComplete(int DeviceObject , int Irp , int Context )
{
{
{
#line 634
KeSetEvent(Context, 1, 0);
}
#line 636
return (-1073741802);
}
}
#line 639 "floppy_simpl3.cil.c"
int FlFdcDeviceIo(int DeviceObject , int Ioctl , int Data )
{ int ntStatus ;
int irp ;
int irpStack ;
int doneEvent = __VERIFIER_nondet_int() ;
int ioStatus = __VERIFIER_nondet_int() ;
int irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ;
int irpStack__Parameters__DeviceIoControl__Type3InputBuffer ;
long __cil_tmp11 ;
{
{
#line 650
irp = IoBuildDeviceIoControlRequest(Ioctl, DeviceObject, 0, 0, 0, 0, 1, doneEvent,
ioStatus);
}
#line 653
if (irp == 0) {
#line 654
return (-1073741670);
}
{
#line 659
irpStack = irp__Tail__Overlay__CurrentStackLocation - 1;
#line 660
irpStack__Parameters__DeviceIoControl__Type3InputBuffer = Data;
#line 661
ntStatus = IofCallDriver(DeviceObject, irp);
}
{
#line 663
__cil_tmp11 = (long )ntStatus;
#line 663
if (__cil_tmp11 == 259L) {
{
#line 665
KeWaitForSingleObject(doneEvent, Suspended, KernelMode, 0, 0);
#line 666
ntStatus = myStatus;
}
}
}
#line 671
return (ntStatus);
}
}
#line 674 "floppy_simpl3.cil.c"
void FloppyProcessQueuedRequests(int DisketteExtension )
{
{
#line 678
return;
}
}
#line 681 "floppy_simpl3.cil.c"
void stub_driver_init(void)
{
{
#line 685
s = NP;
#line 686
pended = 0;
#line 687
compRegistered = 0;
#line 688
lowerDriverReturn = 0;
#line 689
setEventCalled = 0;
#line 690
customIrp = 0;
#line 691
return;
}
}
#line 694 "floppy_simpl3.cil.c"
int main(void)
{ int status ;
int irp = __VERIFIER_nondet_int() ;
int pirp ;
int pirp__IoStatus__Status ;
int irp_choice = __VERIFIER_nondet_int() ;
int devobj = __VERIFIER_nondet_int() ;
int __cil_tmp8 ;
FloppyThread = 0;
KernelMode = 0;
Suspended = 0;
Executive = 0;
DiskController = 0;
FloppyDiskPeripheral = 0;
FlConfigCallBack = 0;
MaximumInterfaceType = 0;
MOUNTDEV_MOUNTED_DEVICE_GUID = 0;
myStatus = 0;
s = 0;
UNLOADED = 0;
NP = 0;
DC = 0;
SKIP1 = 0;
SKIP2 = 0;
MPR1 = 0;
MPR3 = 0;
IPC = 0;
pended = 0;
compRegistered = 0;
lowerDriverReturn = 0;
setEventCalled = 0;
customIrp = 0;
{
{
#line 705
status = 0;
#line 706
pirp = irp;
#line 707
_BLAST_init();
}
#line 709
if (status >= 0) {
#line 710
s = NP;
#line 711
customIrp = 0;
#line 712
setEventCalled = customIrp;
#line 713
lowerDriverReturn = setEventCalled;
#line 714
compRegistered = lowerDriverReturn;
#line 715
pended = compRegistered;
#line 716
pirp__IoStatus__Status = 0;
#line 717
myStatus = 0;
#line 718
if (irp_choice == 0) {
#line 719
pirp__IoStatus__Status = -1073741637;
#line 720
myStatus = -1073741637;
}
{
#line 725
stub_driver_init();
}
{
#line 727
#line 727
if (status < 0) {
#line 728
return (-1);
}
}
#line 732
int tmp_ndt_1;
tmp_ndt_1 = __VERIFIER_nondet_int();
if (tmp_ndt_1 == 3) {
goto switch_2_3;
} else {
goto switch_2_default;
#line 737
if (0) {
switch_2_3:
{
#line 740
status = FloppyPnp(devobj, pirp);
}
goto switch_2_break;
switch_2_default: ;
#line 744
return (-1);
} else {
switch_2_break: ;
}
}
}
#line 753
if (pended == 1) {
#line 754
if (s == NP) {
#line 755
s = NP;
} else {
goto _L___2;
}
} else {
_L___2:
#line 761
if (pended == 1) {
#line 762
if (s == MPR3) {
#line 763
s = MPR3;
} else {
goto _L___1;
}
} else {
_L___1:
#line 769
if (s != UNLOADED) {
#line 772
if (status != -1) {
#line 775
if (s != SKIP2) {
#line 776
if (s != IPC) {
#line 777
if (s != DC) {
{
#line 779
errorFn();
}
} else {
goto _L___0;
}
} else {
goto _L___0;
}
} else {
_L___0:
#line 789
if (pended == 1) {
#line 790
if (status != 259) {
#line 791
errorFn();
}
} else {
#line 796
if (s == DC) {
#line 797
if (status == 259) {
{
#line 799
errorFn();
}
}
} else {
#line 805
if (status != lowerDriverReturn) {
{
#line 807
errorFn();
}
}
}
}
}
}
}
}
}
#line 819
status = 0;
#line 820
return (status);
}
}
#line 823 "floppy_simpl3.cil.c"
int IoBuildDeviceIoControlRequest(int IoControlCode , int DeviceObject , int InputBuffer ,
int InputBufferLength , int OutputBuffer , int OutputBufferLength ,
int InternalDeviceIoControl , int Event , int IoStatusBlock )
{
int malloc = __VERIFIER_nondet_int() ;
{
#line 830
customIrp = 1;
#line 831
int tmp_ndt_2;
tmp_ndt_2 = __VERIFIER_nondet_int();
if (tmp_ndt_2 == 0) {
goto switch_3_0;
} else {
goto switch_3_default;
#line 836
if (0) {
switch_3_0:
#line 838
return (malloc);
switch_3_default: ;
#line 840
return (0);
} else {
}
}
}
}
#line 848 "floppy_simpl3.cil.c"
int IoDeleteSymbolicLink(int SymbolicLinkName )
{
{
#line 852
int tmp_ndt_3;
tmp_ndt_3 = __VERIFIER_nondet_int();
if (tmp_ndt_3 == 0) {
goto switch_4_0;
} else {
goto switch_4_default;
#line 857
if (0) {
switch_4_0:
#line 859
return (0);
switch_4_default: ;
#line 861
return (-1073741823);
} else {
}
}
}
}
#line 869 "floppy_simpl3.cil.c"
int IoQueryDeviceDescription(int BusType , int BusNumber , int ControllerType , int ControllerNumber ,
int PeripheralType , int PeripheralNumber , int CalloutRoutine ,
int Context )
{
{
#line 875
int tmp_ndt_4;
tmp_ndt_4 = __VERIFIER_nondet_int();
if (tmp_ndt_4 == 0) {
goto switch_5_0;
} else {
goto switch_5_default;
#line 880
if (0) {
switch_5_0:
#line 882
return (0);
switch_5_default: ;
#line 884
return (-1073741823);
} else {
}
}
}
}
#line 892 "floppy_simpl3.cil.c"
int IoRegisterDeviceInterface(int PhysicalDeviceObject , int InterfaceClassGuid ,
int ReferenceString , int SymbolicLinkName )
{
{
#line 897
int tmp_ndt_5;
tmp_ndt_5 = __VERIFIER_nondet_int();
if (tmp_ndt_5 == 0) {
goto switch_6_0;
} else {
goto switch_6_default;
#line 902
if (0) {
switch_6_0:
#line 904
return (0);
switch_6_default: ;
#line 906
return (-1073741808);
} else {
}
}
}
}
#line 914 "floppy_simpl3.cil.c"
int IoSetDeviceInterfaceState(int SymbolicLinkName , int Enable )
{
{
#line 918
int tmp_ndt_6;
tmp_ndt_6 = __VERIFIER_nondet_int();
if (tmp_ndt_6 == 0) {
goto switch_7_0;
} else {
goto switch_7_default;
#line 923
if (0) {
switch_7_0:
#line 925
return (0);
switch_7_default: ;
#line 927
return (-1073741823);
} else {
}
}
}
}
#line 935 "floppy_simpl3.cil.c"
void stubMoreProcessingRequired(void)
{
{
#line 939
if (s == NP) {
#line 940
s = MPR1;
} else {
{
#line 943
errorFn();
}
}
#line 946
return;
}
}
#line 949 "floppy_simpl3.cil.c"
int IofCallDriver(int DeviceObject , int Irp )
{
int returnVal2 ;
int compRetStatus1 ;
int lcontext = __VERIFIER_nondet_int() ;
unsigned long __cil_tmp7 ;
{
#line 956
if (compRegistered) {
{
#line 958
compRetStatus1 = FloppyPnpComplete(DeviceObject, Irp, lcontext);
}
{
#line 960
__cil_tmp7 = (unsigned long )compRetStatus1;
#line 960
if (__cil_tmp7 == -1073741802) {
{
#line 962
stubMoreProcessingRequired();
}
}
}
}
#line 970
int tmp_ndt_12;
tmp_ndt_12 = __VERIFIER_nondet_int();
if (tmp_ndt_12 == 0) {
goto switch_8_0;
} else {
#line 973
int tmp_ndt_7;
tmp_ndt_7 = __VERIFIER_nondet_int();
if (tmp_ndt_7 == 1) {
goto switch_8_1;
} else {
goto switch_8_default;
#line 978
if (0) {
switch_8_0:
#line 980
returnVal2 = 0;
goto switch_8_break;
switch_8_1:
#line 983
returnVal2 = -1073741823;
goto switch_8_break;
switch_8_default:
#line 986
returnVal2 = 259;
goto switch_8_break;
} else {
switch_8_break: ;
}
}
}
#line 994
if (s == NP) {
#line 995
s = IPC;
#line 996
lowerDriverReturn = returnVal2;
} else {
#line 998
if (s == MPR1) {
#line 999
if (returnVal2 == 259) {
#line 1000
s = MPR3;
#line 1001
lowerDriverReturn = returnVal2;
} else {
#line 1003
s = NP;
#line 1004
lowerDriverReturn = returnVal2;
}
} else {
#line 1007
if (s == SKIP1) {
#line 1008
s = SKIP2;
#line 1009
lowerDriverReturn = returnVal2;
} else {
{
#line 1012
errorFn();
}
}
}
}
#line 1017
return (returnVal2);
}
}
#line 1020 "floppy_simpl3.cil.c"
void IofCompleteRequest(int Irp , int PriorityBoost )
{
{
#line 1024
if (s == NP) {
#line 1025
s = DC;
} else {
{
#line 1028
errorFn();
}
}
#line 1031
return;
}
}
#line 1034 "floppy_simpl3.cil.c"
int KeSetEvent(int Event , int Increment , int Wait )
{ int l = __VERIFIER_nondet_int() ;
{
#line 1038
setEventCalled = 1;
#line 1039
return (l);
}
}
#line 1042 "floppy_simpl3.cil.c"
int KeWaitForSingleObject(int Object , int WaitReason , int WaitMode , int Alertable ,
int Timeout )
{
{
#line 1047
if (s == MPR3) {
#line 1048
if (setEventCalled == 1) {
#line 1049
s = NP;
#line 1050
setEventCalled = 0;
} else {
goto _L;
}
} else {
_L:
#line 1056
if (customIrp == 1) {
#line 1057
s = NP;
#line 1058
customIrp = 0;
} else {
#line 1060
if (s == MPR3) {
{
#line 1062
errorFn();
}
}
}
}
#line 1069
int tmp_ndt_8;
tmp_ndt_8 = __VERIFIER_nondet_int();
if (tmp_ndt_8 == 0) {
goto switch_9_0;
} else {
goto switch_9_default;
#line 1074
if (0) {
switch_9_0:
#line 1076
return (0);
switch_9_default: ;
#line 1078
return (-1073741823);
} else {
}
}
}
}
#line 1086 "floppy_simpl3.cil.c"
int ObReferenceObjectByHandle(int Handle , int DesiredAccess , int ObjectType , int AccessMode ,
int Object , int HandleInformation )
{
{
#line 1091
int tmp_ndt_9;
tmp_ndt_9 = __VERIFIER_nondet_int();
if (tmp_ndt_9 == 0) {
goto switch_10_0;
} else {
goto switch_10_default;
#line 1096
if (0) {
switch_10_0:
#line 1098
return (0);
switch_10_default: ;
#line 1100
return (-1073741823);
} else {
}
}
}
}
#line 1108 "floppy_simpl3.cil.c"
int PsCreateSystemThread(int ThreadHandle , int DesiredAccess , int ObjectAttributes ,
int ProcessHandle , int ClientId , int StartRoutine , int StartContext )
{
{
#line 1113
int tmp_ndt_10;
tmp_ndt_10 = __VERIFIER_nondet_int();
if (tmp_ndt_10 == 0) {
goto switch_11_0;
} else {
goto switch_11_default;
#line 1118
if (0) {
switch_11_0:
#line 1120
return (0);
switch_11_default: ;
#line 1122
return (-1073741823);
} else {
}
}
}
}
#line 1130 "floppy_simpl3.cil.c"
int ZwClose(int Handle )
{
{
#line 1134
int tmp_ndt_11;
tmp_ndt_11 = __VERIFIER_nondet_int();
if (tmp_ndt_11 == 0) {
goto switch_12_0;
} else {
goto switch_12_default;
#line 1139
if (0) {
switch_12_0:
#line 1141
return (0);
switch_12_default: ;
#line 1143
return (-1073741823);
} else {
}
}
}
}
|
the_stack_data/61262.c | /*
* Copyright (c) 2015 Qualcomm Atheros, Inc.
* All Rights Reserved.
*/
// Copyright (c) 2018 Qualcomm Technologies, Inc.
// All rights reserved.
// Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below)
// provided that the following conditions are met:
// Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
// Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
// Neither the name of Qualcomm Technologies, Inc. nor the names of its contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
// NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE.
// 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.
char *_sbrk(int x) {}
|
the_stack_data/46524.c | /* This file is under BSD 3-Clause License and it's part of Iterkocze PrzydatnyOS
Copyright (c) 2021, Iterkocze-Company
All rights reserved. */
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
static char* ConvertIntToString(int num, char* str, int base)
{
int i = 0;
bool isNegative = false;
/* Handle 0 explicitely, otherwise empty string is printed for 0 */
if (num == 0)
{
str[i++] = '0';
str[i] = '\0';
return str;
}
// In standard itoa(), negative numbers are handled only with
// base 10. Otherwise numbers are considered unsigned.
if (num < 0 && base == 10)
{
isNegative = true;
num = -num;
}
// Process individual digits
while (num != 0)
{
int rem = num % base;
str[i++] = (rem > 9)? (rem-10) + 'a' : rem + '0';
num = num/base;
}
// If number is negative, append '-'
if (isNegative)
str[i++] = '-';
str[i] = '\0'; // Append string terminator
// Reverse the string
return str;
}
static int atoi(char* str)
{
// Initialize result
int res = 0;
// Iterate through all characters
// of input string and update result
// take ASCII character of corosponding digit and
// subtract the code from '0' to get numerical
// value and multiply res by 10 to shuffle
// digits left to update running total
for (int i = 0; str[i] != '\0'; ++i)
res = res * 10 + str[i] - '0';
// return result.
return res;
}
static int inttostr( char *s, unsigned int n )
{
unsigned int i = 1000000000;
if( ((signed)n) < 0 )
{
*s++ = '-';
n = -n;
}
while( i > n ) i /= 10;
do
{
*s++ = '0' + (n-n%i)/i%10;
}
while( i /= 10 );
*s = 0;
return n;
} |
the_stack_data/187643003.c | #include <stdio.h>
void input(int m,int n,float a[][5]){
int i,j;
for(i=0;i<m;i++){
for(j=0;j<n;j++)
scanf("%f",&a[i][j]);
}
}
void compute(int m,int n,float a[][5]){
int i,j;float s=0;
//按行加
for(i=0;i<m-1;i++){
for(j=0;j<n-1;j++){
s+=a[i][j];
a[i][n-1]=s;
}
s=0;
}
//按列加
for(j=0;j<n-1;j++){
for(i=0;i<m-1;i++){
s+=a[i][j];
a[m-1][j]=s/(m-1);
}
s=0;
}
//总平均
for(i=0;i<m-1;i++)
s+=a[i][n];
a[m-1][n-1]=s/(m-1);
}
void output(int m,int n,float a[][5]){
int i,j;
for(i=0;i<m;i++){
for(j=0;j<n;j++)
printf("%.2f ",a[i][j]);
printf("\n");
}
}
int main(){
float a[4][5];
printf("输入3x4个数据\n");
input(3,4,a);
compute(4,5,a);
output(4,5,a);
return 0;
}
|
the_stack_data/234516900.c | /* r_drive0.c */
#include <stdio.h>
extern unsigned int rand0(void);
int main(void)
{
int count;
for (count = 0; count < 5; count++)
printf("%d\n", rand0());
return 0;
} |
the_stack_data/115766304.c | #include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
// A naive implementation that uses a linked list
// instead of a dictionary to look up the values
typedef struct Counter {
const char* word;
int frequency;
} Counter;
typedef struct Node {
void* this;
struct Node* next;
} Node;
// https://en.wikipedia.org/wiki/Merge_sort#Top-down_implementation_using_lists
Node* create_counter(const char * word) {
Counter* counter = malloc(sizeof(Counter));
counter->word = word;
counter->frequency = 1;
Node* node = malloc(sizeof(Node));
node->this = counter;
node->next = NULL;
return node;
}
void bump(Node* root, const char * word) {
assert(root != NULL);
Node* node = root;
Node* last = root->next;
while (node != NULL) {
Counter* counter = node->this;
if (strcmp(counter->word, word) == 0) {
counter->frequency++;
return;
}
last = node;
node = node->next;
}
last->next = create_counter(word);
}
int descending(const void* left_void, const void* right_void) {
const Counter* left = *(Counter **)left_void;
const Counter* right = *(Counter **)right_void;
int comparison = right->frequency - left->frequency;
// compare the word as a tie break for frequency
return comparison != 0 ? comparison : strcmp(left->word, right->word);
}
void report(Node* root) {
Node* node = root->next; // skip the first "dummy" value
int count = 0;
int max = 0;
while (node != NULL) {
node = node->next;
count++;
}
node = root;
Counter* counters[count];
for (int i = 0; i < count; i++) {
counters[i] = node->this;
node = node->next;
Counter* counter = counters[i];
int length = strlen(counter->word);
max = length > max ? length : max;
}
qsort(counters, count, sizeof(Counter *), descending);
for (int i = 0; i < count; i++) {
Counter* counter = counters[i];
printf("%s:", counter->word);
int pad_length = max - strlen(counter->word);
for (int j = 0; j < pad_length; j++) {
putchar(' ');
}
for (int j = 0; j < counter->frequency; j++) {
putchar('*');
}
putchar('\n');
}
printf("Total words found: %d\n", count);
}
int main(int argc, char** argv) {
FILE* file_handle = fopen("module46.txt", "r");
char buffer[255];
Node* root = create_counter("");
while (fscanf(file_handle, "%s", buffer) != EOF) {
int word_length = strlen(buffer);
char* word = malloc(sizeof(char) * word_length);
strncpy(word, buffer, word_length);
bump(root, word);
}
report(root);
fclose(file_handle);
return 0;
} |
the_stack_data/122015726.c | // RUN: not %clang_cc1 -triple armv5--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix ARM
// ARM: error: unknown target CPU 'not-a-cpu'
// ARM: note: valid target CPU values are:
// ARM-SAME: arm2
// RUN: not %clang_cc1 -triple arm64--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix AARCH64
// AARCH64: error: unknown target CPU 'not-a-cpu'
// AARCH64: note: valid target CPU values are:
// AARCH64-SAME: cortex-a35,
// RUN: not %clang_cc1 -triple arm64--- -tune-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix TUNE_AARCH64
// TUNE_AARCH64: error: unknown target CPU 'not-a-cpu'
// TUNE_AARCH64: note: valid target CPU values are:
// TUNE_AARCH64-SAME: cortex-a35,
// RUN: not %clang_cc1 -triple i386--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix X86
// X86: error: unknown target CPU 'not-a-cpu'
// X86: note: valid target CPU values are: i386, i486, winchip-c6, winchip2, c3,
// X86-SAME: i586, pentium, pentium-mmx, pentiumpro, i686, pentium2, pentium3,
// X86-SAME: pentium3m, pentium-m, c3-2, yonah, pentium4, pentium4m, prescott,
// X86-SAME: nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont,
// X86-SAME: nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge,
// X86-SAME: core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512,
// X86-SAME: skx, cascadelake, cooperlake, cannonlake, icelake-client, icelake-server, tigerlake, sapphirerapids, knl, knm, lakemont, k6, k6-2, k6-3,
// X86-SAME: athlon, athlon-tbird, athlon-xp, athlon-mp, athlon-4, k8, athlon64,
// X86-SAME: athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10,
// X86-SAME: barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2,
// X86-SAME: x86-64, geode
// RUN: not %clang_cc1 -triple x86_64--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix X86_64
// X86_64: error: unknown target CPU 'not-a-cpu'
// X86_64: note: valid target CPU values are: nocona, core2, penryn, bonnell,
// X86_64-SAME: atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere,
// X86_64-SAME: sandybridge, corei7-avx, ivybridge, core-avx-i, haswell,
// X86_64-SAME: core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake,
// X86_64-SAME: icelake-client, icelake-server, tigerlake, sapphirerapids, knl, knm, k8, athlon64, athlon-fx, opteron, k8-sse3,
// X86_64-SAME: athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1,
// X86_64-SAME: btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, x86-64
// RUN: not %clang_cc1 -triple i386--- -tune-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix TUNE_X86
// TUNE_X86: error: unknown target CPU 'not-a-cpu'
// TUNE_X86: note: valid target CPU values are: i386, i486, winchip-c6, winchip2, c3,
// TUNE_X86-SAME: i586, pentium, pentium-mmx, pentiumpro, i686, pentium2, pentium3,
// TUNE_X86-SAME: pentium3m, pentium-m, c3-2, yonah, pentium4, pentium4m, prescott,
// TUNE_X86-SAME: nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont,
// TUNE_X86-SAME: nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge,
// TUNE_X86-SAME: core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512,
// TUNE_X86-SAME: skx, cascadelake, cooperlake, cannonlake, icelake-client, icelake-server, tigerlake, sapphirerapids, knl, knm, lakemont, k6, k6-2, k6-3,
// TUNE_X86-SAME: athlon, athlon-tbird, athlon-xp, athlon-mp, athlon-4, k8, athlon64,
// TUNE_X86-SAME: athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10,
// TUNE_X86-SAME: barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2,
// TUNE_X86-SAME: x86-64, geode
// RUN: not %clang_cc1 -triple x86_64--- -tune-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix TUNE_X86_64
// TUNE_X86_64: error: unknown target CPU 'not-a-cpu'
// TUNE_X86_64: note: valid target CPU values are: i386, i486, winchip-c6, winchip2, c3,
// TUNE_X86_64-SAME: i586, pentium, pentium-mmx, pentiumpro, i686, pentium2, pentium3,
// TUNE_X86_64-SAME: pentium3m, pentium-m, c3-2, yonah, pentium4, pentium4m, prescott,
// TUNE_X86_64-SAME: nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont,
// TUNE_X86_64-SAME: nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge,
// TUNE_X86_64-SAME: core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512,
// TUNE_X86_64-SAME: skx, cascadelake, cooperlake, cannonlake, icelake-client, icelake-server, tigerlake, sapphirerapids, knl, knm, lakemont, k6, k6-2, k6-3,
// TUNE_X86_64-SAME: athlon, athlon-tbird, athlon-xp, athlon-mp, athlon-4, k8, athlon64,
// TUNE_X86_64-SAME: athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10,
// TUNE_X86_64-SAME: barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2,
// TUNE_X86_64-SAME: x86-64, geode
// RUN: not %clang_cc1 -triple nvptx--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix NVPTX
// NVPTX: error: unknown target CPU 'not-a-cpu'
// NVPTX: note: valid target CPU values are: sm_20, sm_21, sm_30, sm_32, sm_35,
// NVPTX-SAME: sm_37, sm_50, sm_52, sm_53, sm_60, sm_61, sm_62, sm_70, sm_72
// RUN: not %clang_cc1 -triple r600--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix R600
// R600: error: unknown target CPU 'not-a-cpu'
// R600: note: valid target CPU values are: r600, rv630, rv635, r630, rs780,
// R600-SAME: rs880, rv610, rv620, rv670, rv710, rv730, rv740, rv770, cedar,
// R600-SAME: palm, cypress, hemlock, juniper, redwood, sumo, sumo2, barts,
// R600-SAME: caicos, aruba, cayman, turks
// RUN: not %clang_cc1 -triple amdgcn--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix AMDGCN
// AMDGCN: error: unknown target CPU 'not-a-cpu'
// AMDGCN: note: valid target CPU values are: gfx600, tahiti, gfx601, hainan,
// AMDGCN-SAME: oland, pitcairn, verde, gfx700, kaveri, gfx701, hawaii, gfx702,
// AMDGCN-SAME: gfx703, kabini, mullins, gfx704, bonaire, gfx801, carrizo,
// AMDGCN-SAME: gfx802, iceland, tonga, gfx803, fiji, polaris10, polaris11,
// AMDGCN-SAME: gfx810, stoney, gfx900, gfx902
// RUN: not %clang_cc1 -triple wasm64--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix WEBASM
// WEBASM: error: unknown target CPU 'not-a-cpu'
// WEBASM: note: valid target CPU values are: mvp, bleeding-edge, generic
// RUN: not %clang_cc1 -triple systemz--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix SYSTEMZ
// SYSTEMZ: error: unknown target CPU 'not-a-cpu'
// SYSTEMZ: note: valid target CPU values are: arch8, z10, arch9, z196, arch10,
// SYSTEMZ-SAME: zEC12, arch11, z13, arch12, z14, arch13, z15
// RUN: not %clang_cc1 -triple sparc--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix SPARC
// SPARC: error: unknown target CPU 'not-a-cpu'
// SPARC: note: valid target CPU values are: v8, supersparc, sparclite, f934,
// SPARC-SAME: hypersparc, sparclite86x, sparclet, tsc701, v9, ultrasparc,
// SPARC-SAME: ultrasparc3, niagara, niagara2, niagara3, niagara4, ma2100,
// SPARC-SAME: ma2150, ma2155, ma2450, ma2455, ma2x5x, ma2080, ma2085, ma2480,
// SPARC-SAME: ma2485, ma2x8x, myriad2, myriad2.1, myriad2.2, myriad2.3, leon2,
// SPARC-SAME: at697e, at697f, leon3, ut699, gr712rc, leon4, gr740
// RUN: not %clang_cc1 -triple sparcv9--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix SPARCV9
// SPARCV9: error: unknown target CPU 'not-a-cpu'
// SPARCV9: note: valid target CPU values are: v9, ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4
// RUN: not %clang_cc1 -triple powerpc--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix PPC
// PPC: error: unknown target CPU 'not-a-cpu'
// PPC: note: valid target CPU values are: generic, 440, 450, 601, 602, 603,
// PPC-SAME: 603e, 603ev, 604, 604e, 620, 630, g3, 7400, g4, 7450, g4+, 750,
// PPC-SAME: 8548, 970, g5, a2, e500, e500mc, e5500, power3, pwr3, power4,
// PPC-SAME: pwr4, power5, pwr5, power5x, pwr5x, power6, pwr6, power6x, pwr6x,
// PPC-SAME: power7, pwr7, power8, pwr8, power9, pwr9, power10, pwr10, powerpc, ppc, powerpc64,
// PPC-SAME: ppc64, powerpc64le, ppc64le, future
// RUN: not %clang_cc1 -triple mips--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix MIPS
// MIPS: error: unknown target CPU 'not-a-cpu'
// MIPS: note: valid target CPU values are: mips1, mips2, mips3, mips4, mips5,
// MIPS-SAME: mips32, mips32r2, mips32r3, mips32r5, mips32r6, mips64, mips64r2,
// MIPS-SAME: mips64r3, mips64r5, mips64r6, octeon, octeon+, p5600
// RUN: not %clang_cc1 -triple lanai--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix LANAI
// LANAI: error: unknown target CPU 'not-a-cpu'
// LANAI: note: valid target CPU values are: v11
// RUN: not %clang_cc1 -triple hexagon--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix HEXAGON
// HEXAGON: error: unknown target CPU 'not-a-cpu'
// HEXAGON: note: valid target CPU values are: hexagonv5, hexagonv55,
// HEXAGON-SAME: hexagonv60, hexagonv62, hexagonv65
// RUN: not %clang_cc1 -triple bpf--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix BPF
// BPF: error: unknown target CPU 'not-a-cpu'
// BPF: note: valid target CPU values are: generic, v1, v2, v3, probe
// RUN: not %clang_cc1 -triple avr--- -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix AVR
// AVR: error: unknown target CPU 'not-a-cpu'
// AVR: note: valid target CPU values are: avr1, avr2, avr25, avr3, avr31,
// AVR-SAME: avr35, avr4, avr5, avr51, avr6, avrxmega1, avrxmega2, avrxmega3,
// AVR-SAME: avrxmega4, avrxmega5, avrxmega6, avrxmega7, avrtiny, at90s1200,
// AVR-SAME: attiny11, attiny12, attiny15, attiny28, at90s2313, at90s2323,
// AVR-SAME: at90s2333, at90s2343, attiny22, attiny26, at86rf401, at90s4414,
// AVR-SAME: t90s4433, at90s4434, at90s8515, at90c8534, at90s8535, ata5272,
// AVR-SAME: ttiny13, attiny13a, attiny2313, attiny2313a, attiny24, attiny24a,
// AVR-SAME: ttiny4313, attiny44, attiny44a, attiny84, attiny84a, attiny25,
// AVR-SAME: ttiny45, attiny85, attiny261, attiny261a, attiny461, attiny461a,
// AVR-SAME: ttiny861, attiny861a, attiny87, attiny43u, attiny48, attiny88,
// AVR-SAME: ttiny828, at43usb355, at76c711, atmega103, at43usb320, attiny167,
// AVR-SAME: t90usb82, at90usb162, ata5505, atmega8u2, atmega16u2,
// AVR-SAME: atmega32u2, attiny1634, atmega8, ata6289, atmega8a, ata6285,
// AVR-SAME: ata6286, atmega48, atmega48a, atmega48pa, atmega48p, atmega88,
// AVR-SAME: atmega88a, atmega88p, atmega88pa, atmega8515, atmega8535,
// AVR-SAME: atmega8hva, at90pwm1, at90pwm2, at90pwm2b, at90pwm3, at90pwm3b,
// AVR-SAME: at90pwm81, ata5790, ata5795, atmega16, atmega16a, atmega161,
// AVR-SAME: atmega162, atmega163, atmega164a, atmega164p, atmega164pa,
// AVR-SAME: atmega165, atmega165a, atmega165p, atmega165pa, atmega168,
// AVR-SAME: atmega168a, atmega168p, atmega168pa, atmega169, atmega169a,
// AVR-SAME: atmega169p, atmega169pa, atmega32, atmega32a, atmega323,
// AVR-SAME: atmega324a, atmega324p, atmega324pa, atmega325, atmega325a,
// AVR-SAME: atmega325p, atmega325pa, atmega3250, atmega3250a, atmega3250p,
// AVR-SAME: atmega3250pa, atmega328, atmega328p, atmega329, atmega329a,
// AVR-SAME: atmega329p, atmega329pa, atmega3290, atmega3290a, atmega3290p,
// AVR-SAME: atmega3290pa, atmega406, atmega64, atmega64a, atmega640, atmega644,
// AVR-SAME: atmega644a, atmega644p, atmega644pa, atmega645, atmega645a,
// AVR-SAME: tmega645p, atmega649, atmega649a, atmega649p, atmega6450,
// AVR-SAME: tmega6450a, atmega6450p, atmega6490, atmega6490a, atmega6490p,
// AVR-SAME: tmega64rfr2, atmega644rfr2, atmega16hva, atmega16hva2,
// AVR-SAME: tmega16hvb, atmega16hvbrevb, atmega32hvb, atmega32hvbrevb,
// AVR-SAME: tmega64hve, at90can32, at90can64, at90pwm161, at90pwm216,
// AVR-SAME: t90pwm316, atmega32c1, atmega64c1, atmega16m1, atmega32m1,
// AVR-SAME: tmega64m1, atmega16u4, atmega32u4, atmega32u6, at90usb646,
// AVR-SAME: t90usb647, at90scr100, at94k, m3000, atmega128, atmega128a,
// AVR-SAME: tmega1280, atmega1281, atmega1284, atmega1284p, atmega128rfa1,
// AVR-SAME: tmega128rfr2, atmega1284rfr2, at90can128, at90usb1286,
// AVR-SAME: t90usb1287, atmega2560, atmega2561, atmega256rfr2, atmega2564rfr2,
// AVR-SAME: txmega16a4, atxmega16a4u, atxmega16c4, atxmega16d4, atxmega32a4,
// AVR-SAME: txmega32a4u, atxmega32c4, atxmega32d4, atxmega32e5, atxmega16e5,
// AVR-SAME: txmega8e5, atxmega32x1, atxmega64a3, atxmega64a3u, atxmega64a4u,
// AVR-SAME: txmega64b1, atxmega64b3, atxmega64c3, atxmega64d3, atxmega64d4,
// AVR-SAME: txmega64a1, atxmega64a1u, atxmega128a3, atxmega128a3u,
// AVR-SAME: txmega128b1, atxmega128b3, atxmega128c3, atxmega128d3,
// AVR-SAME: txmega128d4, atxmega192a3, atxmega192a3u, atxmega192c3,
// AVR-SAME: txmega192d3, atxmega256a3, atxmega256a3u, atxmega256a3b,
// AVR-SAME: txmega256a3bu, atxmega256c3, atxmega256d3, atxmega384c3,
// AVR-SAME: txmega384d3, atxmega128a1, atxmega128a1u, atxmega128a4u,
// AVR-SAME: ttiny4, attiny5, attiny9, attiny10, attiny20, attiny40, attiny102,
// AVR-SAME: attiny104
// RUN: not %clang_cc1 -triple riscv32 -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix RISCV32
// RISCV32: error: unknown target CPU 'not-a-cpu'
// RISCV32: note: valid target CPU values are: generic-rv32, rocket-rv32, sifive-7-rv32, sifive-e31, sifive-e76
// RUN: not %clang_cc1 -triple riscv64 -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix RISCV64
// RISCV64: error: unknown target CPU 'not-a-cpu'
// RISCV64: note: valid target CPU values are: generic-rv64, rocket-rv64, sifive-7-rv64, sifive-u54, sifive-u74
|
the_stack_data/211080072.c | #include <stdio.h>
void merge(int A[], int left, int mid, int right) {
int i;
int size_left = mid - left + 1;
int size_right = right - mid;
int L[size_left], R[size_right];
for (i = 0; i < size_left; i++) L[i] = A[left+i];
for (i = 0; i < size_right; i++) R[i] = A[mid+1+i];
int index_l = 0, index_r = 0, index_a = left;
while (index_l < size_left && index_r < size_right) {
if (L[index_l] < R[index_r]) A[index_a++] = L[index_l++];
else A[index_a++] = R[index_r++];
}
while (index_l < size_left) A[index_a++] = L[index_l++];
while (index_r < size_right) A[index_a++] = R[index_r++];
}
void merge_sort(int A[], int left, int right) {
if (left >= right) {
return;
}
int mid = left + ((right - left) / 2);
merge_sort(A, left, mid);
merge_sort(A, mid+1, right);
merge(A, left, mid, right);
}
int main() {
int n = 8;
int arr[] = {1, 5, 6, 3, 8, 4, 7, 2};
merge_sort(arr, 0, n-1);
for (int i = 0; i < n; i++) {
printf("%d ", arr[i]);
}
printf("\n");
}
|
the_stack_data/145453872.c | /*
* tsh - A tiny shell program with job control
*
*/
#include <ctype.h>
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
/* Misc manifest constants */
#define MAXLINE 1024 /* max line size */
#define MAXARGS 128 /* max args on a command line */
#define MAXJOBS 16 /* max jobs at any point in time */
#define MAXJID 1 << 16 /* max job ID */
/* Job states */
#define UNDEF 0 /* undefined */
#define FG 1 /* running in foreground */
#define BG 2 /* running in background */
#define ST 3 /* stopped */
/*
* Jobs states: FG (foreground), BG (background), ST (stopped)
* Job state transitions and enabling actions:
* FG -> ST : ctrl-z
* ST -> FG : fg command
* ST -> BG : bg command
* BG -> FG : fg command
* At most 1 job can be in the FG state.
*/
/* Global variables */
extern char **environ; /* defined in libc */
char prompt[] = "tsh> "; /* command line prompt (DO NOT CHANGE) */
int verbose = 0; /* if true, print additional output */
int nextjid = 1; /* next job ID to allocate */
char sbuf[MAXLINE]; /* for composing sprintf messages */
struct job_t { /* The job struct */
pid_t pid; /* job PID */
int jid; /* job ID [1, 2, ...] */
int state; /* UNDEF, BG, FG, or ST */
char cmdline[MAXLINE]; /* command line */
};
struct job_t jobs[MAXJOBS]; /* The job list */
/* End global variables */
/* Function prototypes */
/* Here are the functions that you will implement */
void eval(char *cmdline);
int builtin_cmd(char **argv);
void do_bgfg(char **argv);
void waitfg(pid_t pid);
void sigchld_handler(int sig);
void sigtstp_handler(int sig);
void sigint_handler(int sig);
/* Here are helper routines that we've provided for you */
int parseline(const char *cmdline, char **argv);
void sigquit_handler(int sig);
void clearjob(struct job_t *job);
void initjobs(struct job_t *jobs);
int maxjid(struct job_t *jobs);
int addjob(struct job_t *jobs, pid_t pid, int state, char *cmdline);
int deletejob(struct job_t *jobs, pid_t pid);
pid_t fgpid(struct job_t *jobs);
struct job_t *getjobpid(struct job_t *jobs, pid_t pid);
struct job_t *getjobjid(struct job_t *jobs, int jid);
int pid2jid(pid_t pid);
void listjobs(struct job_t *jobs);
void usage(void);
void unix_error(char *msg);
void app_error(char *msg);
typedef void handler_t(int);
handler_t *Signal(int signum, handler_t *handler);
/* Self-defined functions */
void Sigprocmask(int how, const sigset_t *set, sigset_t *oldset);
void Sigemptyset(sigset_t *set);
void Sigfillset(sigset_t *set);
void Sigaddset(sigset_t *set, int signum);
static size_t sio_strlen(char s[]);
ssize_t sio_puts(char s[]);
/*
* main - The shell's main routine
*/
int main(int argc, char **argv) {
char c;
char cmdline[MAXLINE];
int emit_prompt = 1; /* emit prompt (default) */
/* Redirect stderr to stdout (so that driver will get all output
* on the pipe connected to stdout) */
dup2(1, 2);
/* Parse the command line */
while ((c = getopt(argc, argv, "hvp")) != EOF) {
switch (c) {
case 'h': /* print help message */
usage();
break;
case 'v': /* emit additional diagnostic info */
verbose = 1;
break;
case 'p': /* don't print a prompt */
emit_prompt = 0; /* handy for automatic testing */
break;
default:
usage();
}
}
/* Install the signal handlers */
/* These are the ones you will need to implement */
Signal(SIGINT, sigint_handler); /* ctrl-c */
Signal(SIGTSTP, sigtstp_handler); /* ctrl-z */
Signal(SIGCHLD, sigchld_handler); /* Terminated or stopped child */
/* This one provides a clean way to kill the shell */
Signal(SIGQUIT, sigquit_handler);
/* Initialize the job list */
initjobs(jobs);
/* Execute the shell's read/eval loop */
while (1) {
/* Read command line */
if (emit_prompt) {
printf("%s", prompt);
fflush(stdout);
}
if ((fgets(cmdline, MAXLINE, stdin) == NULL) && ferror(stdin))
app_error("fgets error");
if (feof(stdin)) { /* End of file (ctrl-d) */
fflush(stdout);
exit(0);
}
/* Evaluate the command line */
eval(cmdline);
fflush(stdout);
fflush(stdout);
}
exit(0); /* control never reaches here */
}
/*
* eval - Evaluate the command line that the user has just typed in
*
* If the user has requested a built-in command (quit, jobs, bg or fg)
* then execute it immediately. Otherwise, fork a child process and
* run the job in the context of the child. If the job is running in
* the foreground, wait for it to terminate and then return. Note:
* each child process must have a unique process group ID so that our
* background children don't receive SIGINT (SIGTSTP) from the kernel
* when we type ctrl-c (ctrl-z) at the keyboard.
*/
void eval(char *cmdline) {
char *argv[MAXARGS];
pid_t pid;
sigset_t mask_all, mask_child, prev;
Sigfillset(&mask_all);
Sigemptyset(&mask_child);
Sigaddset(&mask_child, SIGCHLD);
Sigaddset(&mask_child, SIGINT);
int bg = parseline(cmdline, argv);
if (argv[0] == NULL) return;
if (!builtin_cmd(argv)) {
Sigprocmask(SIG_BLOCK, &mask_child, &prev);
if ((pid = fork()) == 0) {
// Runs user job in child process
setpgid(0, 0); // Puts the child into a new process group
Sigprocmask(SIG_SETMASK, &prev, NULL);
if (execve(argv[0], argv, environ) < 0) {
printf("%s: Command not found\n", argv[0]);
exit(0);
}
}
if (!bg) {
Sigprocmask(SIG_BLOCK, &mask_all, NULL);
addjob(jobs, pid, FG, cmdline);
Sigprocmask(SIG_SETMASK, &prev, NULL);
waitfg(pid);
} else {
// Runs a backgroud job
Sigprocmask(SIG_BLOCK, &mask_all, NULL);
printf("[%d] (%d) %s", nextjid, pid, cmdline);
addjob(jobs, pid, BG, cmdline);
Sigprocmask(SIG_SETMASK, &prev, NULL);
}
}
return;
}
/*
* parseline - Parse the command line and build the argv array.
*
* Characters enclosed in single quotes are treated as a single
* argument. Return true if the user has requested a BG job, false if
* the user has requested a FG job.
*/
int parseline(const char *cmdline, char **argv) {
static char array[MAXLINE]; /* holds local copy of command line */
char *buf = array; /* ptr that traverses command line */
char *delim; /* points to first space delimiter */
int argc; /* number of args */
int bg; /* background job? */
strcpy(buf, cmdline);
buf[strlen(buf) - 1] = ' '; /* replace trailing '\n' with space */
while (*buf && (*buf == ' ')) /* ignore leading spaces */
buf++;
/* Build the argv list */
argc = 0;
if (*buf == '\'') {
buf++;
delim = strchr(buf, '\'');
} else {
delim = strchr(buf, ' ');
}
while (delim) {
argv[argc++] = buf;
*delim = '\0';
buf = delim + 1;
while (*buf && (*buf == ' ')) /* ignore spaces */
buf++;
if (*buf == '\'') {
buf++;
delim = strchr(buf, '\'');
} else {
delim = strchr(buf, ' ');
}
}
argv[argc] = NULL;
if (argc == 0) /* ignore blank line */
return 1;
/* should the job run in the background? */
if ((bg = (*argv[argc - 1] == '&')) != 0) {
argv[--argc] = NULL;
}
return bg;
}
/*
* builtin_cmd - If the user has typed a built-in command then execute
* it immediately.
*/
int builtin_cmd(char **argv) {
if (strcmp(argv[0], "quit") == 0) {
exit(0);
} else if (strcmp(argv[0], "jobs") == 0) {
listjobs(jobs);
return 1;
} else if (strcmp(argv[0], "bg") == 0 || strcmp(argv[0], "fg") == 0) {
do_bgfg(argv);
return 1;
}
return 0; /* not a builtin command */
}
/*
* do_bgfg - Execute the builtin bg and fg commands
*/
void do_bgfg(char **argv) {
int bg = 0;
if (strcmp(argv[0], "bg") == 0) bg = 1;
if (argv[1] == NULL) {
printf("%s command requires PID or %%jobid argument\n",
bg ? "bg" : "fg");
return;
}
int jid = 0;
int pid = 0;
struct job_t *job;
if (argv[1][0] == '%') {
jid = atoi(argv[1] + 1);
job = getjobjid(jobs, jid);
if (job == NULL) {
printf("%s: No such job\n", argv[1]);
return;
}
pid = job->pid;
} else {
pid = atoi(argv[1]);
if (pid == 0) {
printf("%s: argument must be a PID or %%jobid\n", bg ? "bg" : "fg");
return;
}
job = getjobpid(jobs, pid);
if (job == NULL) {
printf("(%d): No such process\n", pid);
return;
}
}
if (bg) {
// Changes a stopped background job to a running background job.
if (kill(-pid, SIGCONT)) unix_error("send SIGCONT error");
job->state = BG;
printf("[%d] (%d) %s", jid, pid, job->cmdline);
return;
} else {
if (kill(-pid, SIGCONT)) unix_error("send SIGCONT error");
job->state = FG;
waitfg(pid);
return;
}
}
/*
* waitfg - Block until process pid is no longer the foreground process
*/
void waitfg(pid_t pid) {
while (fgpid(jobs) == pid && getjobpid(jobs, pid)->state == FG) {
sleep(1);
}
}
/*****************
* Signal handlers
*****************/
/*
* sigchld_handler - The kernel sends a SIGCHLD to the shell whenever
* a child job terminates (becomes a zombie), or stops because it
* received a SIGSTOP or SIGTSTP signal. The handler reaps all
* available zombie children, but doesn't wait for any other
* currently running children to terminate.
*/
void sigchld_handler(int sig) {
int olderrno = errno;
sigset_t mask_all, prev;
pid_t pid;
int status;
Sigfillset(&mask_all);
if ((pid = waitpid(-1, &status, WNOHANG | WUNTRACED)) > 0) {
if (WIFEXITED(status)) {
Sigprocmask(SIG_BLOCK, &mask_all, &prev);
deletejob(jobs, pid);
Sigprocmask(SIG_SETMASK, &prev, NULL);
} else if (WIFSTOPPED(status)) {
Sigprocmask(SIG_BLOCK, &mask_all, &prev);
struct job_t *job = getjobpid(jobs, pid);
job->state = ST;
printf("Job [%d] (%d) stopped by signal %d\n", job->jid, pid,
WSTOPSIG(status));
Sigprocmask(SIG_SETMASK, &prev, NULL);
} else if (WIFSIGNALED(status)) {
Sigprocmask(SIG_BLOCK, &mask_all, &prev);
struct job_t *job = getjobpid(jobs, pid);
printf("Job [%d] (%d) terminated by signal %d\n", job->jid, pid,
WTERMSIG(status));
deletejob(jobs, pid);
Sigprocmask(SIG_SETMASK, &prev, NULL);
}
}
errno = olderrno;
}
/*
* sigint_handler - The kernel sends a SIGINT to the shell whenver the
* user types ctrl-c at the keyboard. Catch it and send it along
* to the foreground job.
*/
void sigint_handler(int sig) {
sigset_t mask_all, prev;
Sigfillset(&mask_all);
Sigprocmask(SIG_BLOCK, &mask_all, &prev);
pid_t pid = fgpid(jobs);
if (pid == 0) return;
if (kill(-pid, SIGINT)) unix_error("kill error");
if (waitpid(pid, NULL, 0) < 0) unix_error("waitpid error...");
printf("Job [%d] (%d) terminated by signal %d\n", pid2jid(pid), pid, sig);
deletejob(jobs, pid);
Sigprocmask(SIG_SETMASK, &prev, NULL);
}
/*
* sigtstp_handler - The kernel sends a SIGTSTP to the shell whenever
* the user types ctrl-z at the keyboard. Catch it and suspend the
* foreground job by sending it a SIGTSTP.
*/
void sigtstp_handler(int sig) {
pid_t pid = fgpid(jobs);
if (pid != 0) {
kill(-pid, SIGTSTP);
}
}
/*********************
* End signal handlers
*********************/
/***********************************************
* Helper routines that manipulate the job list
**********************************************/
/* clearjob - Clear the entries in a job struct */
void clearjob(struct job_t *job) {
job->pid = 0;
job->jid = 0;
job->state = UNDEF;
job->cmdline[0] = '\0';
}
/* initjobs - Initialize the job list */
void initjobs(struct job_t *jobs) {
int i;
for (i = 0; i < MAXJOBS; i++) clearjob(&jobs[i]);
}
/* maxjid - Returns largest allocated job ID */
int maxjid(struct job_t *jobs) {
int i, max = 0;
for (i = 0; i < MAXJOBS; i++)
if (jobs[i].jid > max) max = jobs[i].jid;
return max;
}
/* addjob - Add a job to the job list */
int addjob(struct job_t *jobs, pid_t pid, int state, char *cmdline) {
int i;
if (pid < 1) return 0;
for (i = 0; i < MAXJOBS; i++) {
if (jobs[i].pid == 0) {
jobs[i].pid = pid;
jobs[i].state = state;
jobs[i].jid = nextjid++;
if (nextjid > MAXJOBS) nextjid = 1;
strcpy(jobs[i].cmdline, cmdline);
if (verbose) {
printf("Added job [%d] %d %s\n", jobs[i].jid, jobs[i].pid,
jobs[i].cmdline);
}
return 1;
}
}
printf("Tried to create too many jobs\n");
return 0;
}
/* deletejob - Delete a job whose PID=pid from the job list */
int deletejob(struct job_t *jobs, pid_t pid) {
int i;
if (pid < 1) return 0;
for (i = 0; i < MAXJOBS; i++) {
if (jobs[i].pid == pid) {
clearjob(&jobs[i]);
nextjid = maxjid(jobs) + 1;
return 1;
}
}
return 0;
}
/* fgpid - Return PID of current foreground job, 0 if no such job */
pid_t fgpid(struct job_t *jobs) {
int i;
for (i = 0; i < MAXJOBS; i++)
if (jobs[i].state == FG) return jobs[i].pid;
return 0;
}
/* getjobpid - Find a job (by PID) on the job list */
struct job_t *getjobpid(struct job_t *jobs, pid_t pid) {
int i;
if (pid < 1) return NULL;
for (i = 0; i < MAXJOBS; i++)
if (jobs[i].pid == pid) return &jobs[i];
return NULL;
}
/* getjobjid - Find a job (by JID) on the job list */
struct job_t *getjobjid(struct job_t *jobs, int jid) {
int i;
if (jid < 1) return NULL;
for (i = 0; i < MAXJOBS; i++)
if (jobs[i].jid == jid) return &jobs[i];
return NULL;
}
/* pid2jid - Map process ID to job ID */
int pid2jid(pid_t pid) {
int i;
if (pid < 1) return 0;
for (i = 0; i < MAXJOBS; i++)
if (jobs[i].pid == pid) {
return jobs[i].jid;
}
return 0;
}
/* listjobs - Print the job list */
void listjobs(struct job_t *jobs) {
int i;
for (i = 0; i < MAXJOBS; i++) {
if (jobs[i].pid != 0) {
printf("[%d] (%d) ", jobs[i].jid, jobs[i].pid);
switch (jobs[i].state) {
case BG:
printf("Running ");
break;
case FG:
printf("Foreground ");
break;
case ST:
printf("Stopped ");
break;
default:
printf("listjobs: Internal error: job[%d].state=%d ", i,
jobs[i].state);
}
printf("%s", jobs[i].cmdline);
}
}
}
/******************************
* end job list helper routines
******************************/
/***********************
* Other helper routines
***********************/
/*
* usage - print a help message
*/
void usage(void) {
printf("Usage: shell [-hvp]\n");
printf(" -h print this message\n");
printf(" -v print additional diagnostic information\n");
printf(" -p do not emit a command prompt\n");
exit(1);
}
/*
* unix_error - unix-style error routine
*/
void unix_error(char *msg) {
fprintf(stdout, "%s: %s\n", msg, strerror(errno));
exit(1);
}
/*
* app_error - application-style error routine
*/
void app_error(char *msg) {
fprintf(stdout, "%s\n", msg);
exit(1);
}
/*
* Signal - wrapper for the sigaction function
*/
handler_t *Signal(int signum, handler_t *handler) {
struct sigaction action, old_action;
action.sa_handler = handler;
sigemptyset(&action.sa_mask); /* block sigs of type being handled */
action.sa_flags = SA_RESTART; /* restart syscalls if possible */
if (sigaction(signum, &action, &old_action) < 0) unix_error("Signal error");
return (old_action.sa_handler);
}
/*
* sigquit_handler - The driver program can gracefully terminate the
* child shell by sending it a SIGQUIT signal.
*/
void sigquit_handler(int sig) {
printf("Terminating after receipt of SIGQUIT signal\n");
exit(1);
}
void Sigprocmask(int how, const sigset_t *set, sigset_t *oldset) {
if (sigprocmask(how, set, oldset) < 0) unix_error("Sigprocmask error");
return;
}
void Sigemptyset(sigset_t *set) {
if (sigemptyset(set) < 0) unix_error("Sigemptyset error");
return;
}
void Sigfillset(sigset_t *set) {
if (sigfillset(set) < 0) unix_error("Sigfillset error");
return;
}
void Sigaddset(sigset_t *set, int signum) {
if (sigaddset(set, signum) < 0) unix_error("Sigaddset error");
return;
}
static size_t sio_strlen(char s[]) {
int i = 0;
while (s[i] != '\0') ++i;
return i;
}
ssize_t sio_puts(char s[]) { return write(STDOUT_FILENO, s, sio_strlen(s)); }
|
the_stack_data/81724.c | #include <stdio.h>
int
main()
{
unsigned int bit = 0x12345678; // 4bytes
char *ptr = &bit;
int i;
printf("%#x\n", bit);
for (i = 0; i < 4; i++) {
printf("%p -> %x\n", ptr, *ptr);
ptr += 1;
}
}
|
the_stack_data/9514018.c | #include <stdio.h>
#include <time.h>
#include <stdlib.h>
char* run(char* s) {
// Your code goes here
}
int main(int argc, char** argv)
{
if (argc < 2) {
printf("Missing one argument\n");
exit(1);
}
clock_t start = clock();
char* answer = run(argv[1]);
printf("_duration:%f\n%s\n", (float)( clock () - start ) * 1000.0 / CLOCKS_PER_SEC, answer);
return 0;
}
|
the_stack_data/1130344.c | // Basic Mathematical Calculator
// ----------------------------------------------------------------
// Performs Addition, Subtraction, Multiplication and Division operations
// Main Libraries
#include<stdio.h>
// Main Function
void main()
{
// Initialize the variables
int a,b;
char op[10];
printf(
"+----------------------------+\n"
"| BASIC CALCULATOR |\n"
"+----------------------------+\n"
);
printf("| First value : ");
scanf("%d",&a);
printf("| Second value : ");
scanf("%d",&b);
printf("+----------------------------+\n");
printf("| Operation : ");
scanf("%s",op);
// printf("This : \"%s\"",op);
int add = a + b;
int sub = a - b;
int mul = a * b;
int div = a / b;
int sq = a * a;
int cb = a * a * a;
if (strcmp(op,"a")==0)
{
printf(
"+----------------------------+\n"
"| ADDITION |\n"
"+----------------------------+\n"
"| %d + %d = %d \n"
"+----------------------------+\n"
,a,b,add);
}
if (strcmp(op,"s")==0)
{
printf(
"+----------------------------+\n"
"| SUBTRACTION |\n"
"+----------------------------+\n"
"| %d - %d = %d \n"
"+----------------------------+\n"
,a,b,sub);
}
if (strcmp(op,"m")==0)
{
printf(
"+----------------------------+\n"
"| MULTIPLICATION |\n"
"+----------------------------+\n"
"| %d x %d = %d \n"
"+----------------------------+\n"
,a,b,mul);
}
if (strcmp(op,"d")==0)
{
printf(
"+----------------------------+\n"
"| DIVISION |\n"
"+----------------------------+\n"
"| %d / %d = %d \n"
"+----------------------------+\n"
,a,b,div);
}
if (strcmp(op,"sq")==0)
{
printf(
"+----------------------------+\n"
"| SQUARE |\n"
"+----------------------------+\n"
"| %d ^ 2 = %d \n"
"+----------------------------+\n"
,a,sq);
}
if (strcmp(op,"cb")==0)
{
printf(
"+----------------------------+\n"
"| CUBE |\n"
"+----------------------------+\n"
"| %d ^ 3 = %d \n"
"+----------------------------+\n"
,a,cb);
}
if (strcmp(op,"all")==0)
{
printf(
"+----------------------------+\n"
"| ALL OPERATIONS |\n"
"+----------------------------+\n"
"| %d + %d = %d \n"
"| %d - %d = %d \n"
"| %d x %d = %d \n"
"| %d / %d = %d \n"
"| %d ^ 2 = %d \n"
"| %d ^ 3 = %d \n"
"+----------------------------+\n"
,a,b,add,a,b,sub,a,b,mul,a,b,div,a,sq,a,cb);
}
}
|
the_stack_data/126702249.c | #include <stdio.h>
int main()
{
long x= 10000;
printf("x = %ld\n", x);
x /= 100;
printf("x = %ld\n", x);
return 0;
}
|
the_stack_data/90762112.c | #include <stdio.h>
#define LEN sizeof(struct student)
struct student {
long num;
int score;
struct student *next;
};
struct student *create(int n) {
struct student *head=NULL,*p1=NULL,*p2=NULL;
int i;
for(i=1; i<=n; i++) {
p1=(struct student *)malloc(LEN);
scanf("%ld",&p1->num);
scanf("%d",&p1->score);
p1->next=NULL;
if(i==1) head=p1;
else p2->next=p1;
p2=p1;
}
return(head);
}
struct student *insert(struct student *head, struct student *stud) {
struct student *q, *p;
if (head == NULL) {
return stud;
}
q = head;
while (q->num < stud->num && q->next != NULL) {
p = q;
q = q->next;
}
if (q == NULL) {
q->next = stud;
} else {
stud->next = q;
p->next = stud;
}
return head;
}
void print(struct student *head) {
struct student *p;
p=head;
while(p!=NULL) {
printf("%8ld%8d",p->num,p->score);
p=p->next;
printf("\n");
}
}
int main() {
struct student *head,*stu;
int n;
scanf("%d",&n);
head=create(n);
print(head);
stu=(struct student *)malloc(LEN);
scanf("%ld",&stu->num);
scanf("%d",&stu->score);
stu->next = NULL;
head=insert(head,stu);
print(head);
return 0;
}
|
the_stack_data/44877.c | #include <pthread.h>
#include <assert.h>
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h> /* for sleep */
#include <stdlib.h> /* for malloc */
#include <inttypes.h> /* uintptr_t */
#define NUM_THREADS 5
int *s_thread_worker(void **);
int main(void) {
pthread_t thread_id[NUM_THREADS];
int *stime_arr[NUM_THREADS];
for ( int i = 0; i < NUM_THREADS; i++) {
stime_arr[i] = malloc(sizeof(int));
*stime_arr[i] = i+1;
printf("*stime 0x%.16lX (%i sec.)\n", (uintptr_t) stime_arr[i], *stime_arr[i]);
if ( pthread_create( &thread_id[i], NULL,
(void *) s_thread_worker,
(void **) &stime_arr[i] ) != 0 ) {
perror("ERROR: Cerating thread");
assert(0);
}
}
/* Wait for the workers to exit */
for ( int i = 0; i < NUM_THREADS; i++) {
int *t_exit_var = NULL;
if ( pthread_join(thread_id[i], (void **) &t_exit_var) == 0 ) {
printf("thread 0x%.16lX exitting\n", (uintptr_t) thread_id[i]);
printf("exit v 0x%.16X\n", *t_exit_var);
printf("*stime 0x%.16lX (i:%i)\n", (uintptr_t) stime_arr[i], i);
free(t_exit_var);
t_exit_var = NULL;
} else {
perror("ERROR: Joining thread");
assert(0);
}
}
printf("\nmain(): All %d threads have terminated\n", NUM_THREADS);
return 0;
}
int *s_thread_worker(void **int_arg) {
int **pp = (int **)int_arg;
int sleeptime = **pp;
int * exit_var = NULL;
exit_var = malloc(sizeof(int));
printf("thread 0x%.16lX sleeping %d seconds ...\n",
(uintptr_t) pthread_self(), sleeptime);
sleep(sleeptime);
/* Copy last 32 bits from the address of this thread
* so we have a "meaningful" value for pthread_exit */
*exit_var = (int) (pthread_self());
printf("\nthread 0x%.16lX awakening\n", (uintptr_t) pthread_self());
printf("*stime 0x%.16lX %i\n", (uintptr_t) *pp, sleeptime);
/* free & reset stime which was allocated @main() */
free(*pp);
*pp=NULL;
pthread_exit((void *) exit_var);
return NULL;
}
/* Links
* + http://www.cs.rpi.edu/academics/courses/fall04/os/c6/index.html
*
* Notes
* This is largely based on the link above. Added freeing up the worker argument
* allocated in the main function (r20).
*
* Also added some printf's along the way to see that the pointers are correctly
* dealed with.
*
* (C) Antti Antinoja, 2019
*/
|
the_stack_data/704434.c | #include <stdio.h>
void trick1()
{
int arr[] = {1, 2, 3};
int *ptr;
ptr = arr;
printf("arr[0] = %d, arr[1] = %d, arr[2] = %d, ptr = %p, *ptr = %d\n",
arr[0], arr[1], arr[2], ptr, *ptr);
*ptr++ = -1;
printf("arr[0] = %d, arr[1] = %d, arr[2] = %d, ptr = %p, *ptr = %d\n",
arr[0], arr[1], arr[2], ptr, *ptr);
*++ptr = -2;
printf("arr[0] = %d, arr[1] = %d, arr[2] = %d, ptr = %p, *ptr = %d\n",
arr[0], arr[1], arr[2], ptr, *ptr);
(*ptr)++;
printf("arr[0] = %d, arr[1] = %d, arr[2] = %d, ptr = %p, *ptr = %d\n",
arr[0], arr[1], arr[2], ptr, *ptr);
}
void trick2()
{
int arr[] = {1, 2, 3};
*arr = 5;
printf("arr[0] = %d, arr[1] = %d, arr[2] = %d\n",
arr[0], arr[1], arr[2]);
*(arr + 1) = 10;
printf("arr[0] = %d, arr[1] = %d, arr[2] = %d\n",
arr[0], arr[1], arr[2]);
2[arr] = 15;
printf("0[arr] = %d, 1[arr] = %d, 2[arr] = %d\n",
0[arr], 1[arr], 2[arr]);
}
void trick3()
{
char str1[] = { 'A', 'B', 'C', 'D', 'E' };
char str2[] = "ABCDE";
char *str3 = "ABCDE";
char *cPtr = str1;
short sArr[] = {1, 2, 3, 4, 5};
short sArr2D[][5] = { {1, 2, 3, 4, 5},
{6, 7, 8, 9, 10} };
short *sPtr1 = sArr;
short (*sPtr2)[5] = sArr2D;
short *sPtr3[5];
printf("sizeof(str1) = %u\n", sizeof(str1));
printf("sizeof(str2) = %u\n", sizeof(str2));
printf("sizeof(str3) = %u\n", sizeof(str3));
printf("sizeof(cPtr) = %u\n", sizeof(cPtr));
printf("\n");
printf("sizeof(sArr) = %u\n", sizeof(sArr));
printf("sizeof(sPtr1) = %u\n", sizeof(sPtr1));
printf("sizeof(sArr2D) = %u\n", sizeof(sArr2D));
printf("sizeof(sPtr2) = %u\n", sizeof(sPtr2));
printf("sizeof(*sPtr2) = %u\n", sizeof(*sPtr2));
printf("sizeof(sPtr3) = %u\n", sizeof(sPtr3));
printf("\n");
printf("sArr2D[1][2] = %d\n", sArr2D[1][2]);
printf("sPtr2[0][0] = %d, sPtr2[1][2] = %d\n", sPtr2[0][0], sPtr2[1][2]);
printf("*(* (sArr2D + 1) + 2) = %d\n", *(* (sArr2D + 1) + 2));
printf("*(*(sArr2D) + 1*5 + 2) = %d\n\n", *(*(sArr2D) + 1*5 + 2));
}
void main()
{
printf("Trick 1:\n\n");
trick1();
printf("\n");
printf("Trick 2:\n\n");
trick2();
printf("\n");
printf("Trick 3:\n\n");
trick3();
printf("\n");
}
|
the_stack_data/107953986.c | // Warning: This is a generated file, do not edit it!
#include <stdint.h>
#include <stddef.h>
const char anim_intro_08_png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0xf0,
0x08, 0x03, 0x00, 0x00, 0x00, 0x46, 0xf3, 0x4d, 0x59, 0x00, 0x00, 0x00,
0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0b, 0x12, 0x00, 0x00, 0x0b,
0x12, 0x01, 0xd2, 0xdd, 0x7e, 0xfc, 0x00, 0x00, 0x00, 0x1b, 0x74, 0x45,
0x58, 0x74, 0x53, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x00, 0x43,
0x65, 0x6c, 0x73, 0x79, 0x73, 0x20, 0x53, 0x74, 0x75, 0x64, 0x69, 0x6f,
0x20, 0x54, 0x6f, 0x6f, 0x6c, 0xc1, 0xa7, 0xe1, 0x7c, 0x00, 0x00, 0x00,
0x54, 0x50, 0x4c, 0x54, 0x45, 0x17, 0x56, 0x31, 0x18, 0xa7, 0x2e, 0x19,
0x70, 0xee, 0x1e, 0xa2, 0xc2, 0x23, 0x75, 0x44, 0x24, 0xc3, 0xea, 0x38,
0x2e, 0x11, 0x4c, 0x4b, 0x32, 0x57, 0x54, 0x67, 0x58, 0x53, 0x67, 0x72,
0xb2, 0x32, 0x7f, 0x7a, 0x98, 0x85, 0x30, 0xaf, 0x8a, 0x8a, 0x96, 0x8e,
0xdc, 0x3f, 0x9a, 0xee, 0xee, 0xa6, 0x3c, 0xda, 0xb0, 0xaf, 0xbf, 0xba,
0x8d, 0x6e, 0xbe, 0x19, 0x58, 0xbf, 0xf1, 0xf1, 0xd0, 0xa9, 0x2a, 0xd0,
0xaa, 0x2c, 0xf3, 0xf1, 0xe7, 0xf4, 0x1f, 0x71, 0xf7, 0xbf, 0x9c, 0xfd,
0xce, 0x35, 0xff, 0xff, 0xff, 0xe8, 0x20, 0x2e, 0x18, 0x00, 0x00, 0x10,
0x7a, 0x49, 0x44, 0x41, 0x54, 0x78, 0xda, 0xed, 0xdd, 0x8b, 0x76, 0xdb,
0x38, 0x0e, 0x00, 0x50, 0x65, 0x9b, 0x05, 0xec, 0x5a, 0xb2, 0x2d, 0x37,
0x1d, 0x4d, 0xb2, 0xff, 0xff, 0x9f, 0x2b, 0xbe, 0xc1, 0x37, 0x25, 0x3f,
0x42, 0x29, 0xe4, 0x99, 0x69, 0x53, 0xb7, 0x39, 0x89, 0x6f, 0x00, 0x12,
0xa4, 0x28, 0xaa, 0xfb, 0x68, 0xed, 0xae, 0xd6, 0x35, 0x82, 0x06, 0xd8,
0x00, 0x1b, 0x60, 0x03, 0x6c, 0xad, 0x01, 0x36, 0xc0, 0x06, 0xd8, 0x00,
0x5b, 0x6b, 0x80, 0x0d, 0xb0, 0x01, 0x36, 0xc0, 0xd6, 0x1a, 0x60, 0x03,
0x6c, 0x80, 0x0d, 0xb0, 0xb5, 0x06, 0xd8, 0x00, 0x1b, 0x60, 0x03, 0x6c,
0xad, 0x01, 0x36, 0xc0, 0x06, 0xd8, 0x00, 0x5b, 0x6b, 0x80, 0x0d, 0xb0,
0x01, 0x36, 0xc0, 0xd6, 0x1a, 0x60, 0x03, 0x6c, 0x80, 0x0d, 0xb0, 0xb5,
0x06, 0xd8, 0x00, 0x1b, 0x60, 0x03, 0x7c, 0x72, 0x43, 0x6c, 0x80, 0x77,
0xf1, 0x01, 0xe0, 0x56, 0x0c, 0x2b, 0x04, 0x9c, 0xf9, 0xa6, 0x69, 0xfa,
0x2f, 0x60, 0x03, 0x5c, 0x0b, 0xf8, 0x5f, 0xd6, 0x1a, 0x60, 0x03, 0x6c,
0x80, 0x5b, 0x05, 0xfc, 0x35, 0xfb, 0xfd, 0xfa, 0xc5, 0x06, 0x92, 0xfa,
0xc7, 0x92, 0x3a, 0x01, 0x67, 0xc1, 0x5f, 0x00, 0xb7, 0x4f, 0x80, 0xea,
0xc7, 0xe3, 0x3a, 0x47, 0xe1, 0x5f, 0x73, 0x63, 0x80, 0xa2, 0xc9, 0x50,
0xac, 0x13, 0xb2, 0xca, 0x3a, 0x10, 0x78, 0xbb, 0x29, 0x40, 0xd5, 0x1a,
0xe0, 0x32, 0x40, 0x97, 0x10, 0x1a, 0x60, 0x29, 0x60, 0xdf, 0xf7, 0x52,
0xb0, 0x01, 0xae, 0x0a, 0xc0, 0xfe, 0xaa, 0x05, 0x6f, 0xb7, 0x5b, 0xd5,
0x7e, 0xb5, 0x02, 0x32, 0x41, 0x81, 0xa8, 0x01, 0x2b, 0x1d, 0x8b, 0x6b,
0x05, 0xbc, 0xce, 0x7a, 0x4a, 0x90, 0xb5, 0x6a, 0xcb, 0xea, 0xae, 0x46,
0x3f, 0x0d, 0xd8, 0x8b, 0x42, 0x90, 0xfd, 0xdf, 0xea, 0xc0, 0x65, 0x01,
0x28, 0x72, 0x98, 0x31, 0x62, 0xdd, 0xcb, 0x83, 0xd5, 0x02, 0xca, 0x10,
0x14, 0x82, 0x6d, 0x26, 0xb2, 0x06, 0x90, 0x09, 0x5e, 0xaf, 0xb5, 0x0b,
0x76, 0x15, 0xfa, 0x09, 0x40, 0x9e, 0xc4, 0xc2, 0x11, 0x1b, 0xe0, 0xf2,
0x00, 0x94, 0x49, 0xcc, 0x7f, 0x6b, 0x80, 0x8b, 0xa6, 0x71, 0x1a, 0xf0,
0xda, 0x0b, 0xc0, 0xaa, 0x05, 0xbb, 0x6a, 0x33, 0x58, 0x00, 0x8a, 0x11,
0xb9, 0x95, 0x31, 0xeb, 0x00, 0x95, 0x60, 0xcd, 0xfd, 0x60, 0x57, 0xb3,
0x9f, 0xea, 0x05, 0x6b, 0x16, 0xac, 0x0f, 0xf0, 0x4a, 0x01, 0x55, 0x12,
0xd7, 0xdb, 0x11, 0xd6, 0x0d, 0xa8, 0x43, 0xb0, 0xde, 0x7a, 0xb0, 0xab,
0x39, 0x83, 0x2d, 0xc0, 0x4a, 0x63, 0xb0, 0xab, 0x3a, 0x00, 0x49, 0x0e,
0xd7, 0x9a, 0xc5, 0x95, 0x03, 0x92, 0x10, 0xac, 0x34, 0x8b, 0xbb, 0xba,
0xfc, 0xd2, 0x80, 0x35, 0xc6, 0x60, 0xf5, 0x80, 0xbd, 0x5d, 0x59, 0x57,
0x27, 0x58, 0x19, 0x60, 0xef, 0x02, 0x5a, 0x21, 0x68, 0xea, 0xc1, 0x7a,
0x2e, 0x12, 0xd7, 0x06, 0x78, 0x4d, 0x02, 0x2a, 0x41, 0xac, 0x27, 0x12,
0xbb, 0xba, 0x33, 0xd8, 0xcd, 0x61, 0x21, 0xc8, 0x76, 0x10, 0xd6, 0x32,
0x3d, 0xee, 0x2a, 0xcf, 0x60, 0xb9, 0x32, 0x6d, 0x0b, 0x02, 0x7c, 0x7d,
0x7d, 0x41, 0x03, 0x2c, 0xc9, 0x60, 0x2f, 0x89, 0xf9, 0x58, 0xfc, 0xf5,
0x55, 0x8d, 0xe0, 0xd6, 0x00, 0xc5, 0x65, 0x92, 0x7f, 0xfe, 0x69, 0x80,
0x21, 0xc0, 0x60, 0x06, 0xf7, 0xbc, 0x17, 0xec, 0xc5, 0x47, 0x6a, 0xc7,
0xc2, 0x3f, 0x73, 0x6b, 0x80, 0x3e, 0x60, 0xc8, 0x4f, 0x88, 0x19, 0x3b,
0x05, 0x08, 0x0d, 0xb0, 0x24, 0x83, 0x7b, 0xb6, 0x65, 0x9f, 0xc8, 0x81,
0x89, 0xc3, 0x36, 0x88, 0x14, 0x64, 0x30, 0xa3, 0x3a, 0xb3, 0x66, 0xec,
0x24, 0x2b, 0x54, 0xb2, 0x5d, 0xa1, 0xab, 0x3c, 0x83, 0xa5, 0xdf, 0x19,
0xc0, 0x99, 0xd2, 0x41, 0x25, 0x41, 0xb8, 0x15, 0xc0, 0xdf, 0xf6, 0x84,
0x04, 0xe0, 0x06, 0xb7, 0x1b, 0xdf, 0x40, 0x8d, 0x0d, 0x30, 0xba, 0x94,
0xc5, 0x3b, 0xbb, 0xdf, 0xbf, 0x85, 0x9f, 0x07, 0xc8, 0xf6, 0x6d, 0x7d,
0x7f, 0x26, 0x57, 0x0c, 0xa8, 0x86, 0xdd, 0x59, 0xf0, 0xf7, 0x6f, 0x67,
0x3a, 0xa2, 0x00, 0x6f, 0x9f, 0x9f, 0xdf, 0x9c, 0xc8, 0xd5, 0x02, 0xca,
0xa1, 0xb6, 0xe7, 0x82, 0x4e, 0x00, 0x72, 0x40, 0x21, 0xf8, 0xed, 0x5b,
0x57, 0xeb, 0x04, 0x54, 0x95, 0x8a, 0xa9, 0xfe, 0xfa, 0xde, 0x03, 0xbc,
0x81, 0x60, 0x2c, 0xf7, 0xc3, 0x1f, 0x02, 0x48, 0xf4, 0xcc, 0xfc, 0x23,
0x00, 0xb8, 0x70, 0x10, 0x41, 0x7c, 0x46, 0xac, 0x76, 0xf5, 0xf8, 0xe9,
0x6d, 0x6d, 0xbd, 0x1f, 0x72, 0xa1, 0x14, 0x0e, 0xef, 0xfb, 0x45, 0xbb,
0x59, 0x5f, 0xe0, 0x87, 0x00, 0xfa, 0x7c, 0x61, 0x40, 0x0f, 0x84, 0x8b,
0x81, 0xdd, 0x0c, 0xe5, 0x93, 0xca, 0xc6, 0xda, 0x00, 0x45, 0xfc, 0xf9,
0x73, 0x12, 0x0f, 0xd0, 0xad, 0x5f, 0x04, 0xd1, 0x68, 0x35, 0xdb, 0x72,
0x18, 0xf0, 0xe3, 0xf1, 0x75, 0x63, 0x75, 0x80, 0x10, 0xf4, 0xbb, 0x7a,
0x65, 0x0c, 0x95, 0xe0, 0x01, 0x36, 0x46, 0x9a, 0x15, 0x8f, 0x2a, 0x28,
0x77, 0x0b, 0x28, 0xe2, 0x2f, 0xb0, 0x28, 0xe8, 0x16, 0xd2, 0x68, 0x0d,
0x0e, 0x10, 0xe5, 0x73, 0x11, 0x87, 0xb9, 0x3d, 0xb4, 0xf8, 0xae, 0x0d,
0x30, 0xe2, 0xe7, 0x01, 0x1a, 0xc1, 0x3c, 0x9f, 0x31, 0x1c, 0x64, 0x7b,
0x60, 0x77, 0x58, 0x09, 0x20, 0x8b, 0xa2, 0x3e, 0xd6, 0xff, 0xf9, 0x9d,
0xa0, 0x01, 0xc4, 0x42, 0x3f, 0x1d, 0x86, 0x8a, 0x10, 0x77, 0x05, 0x88,
0xb2, 0x58, 0x8e, 0xfb, 0x5d, 0x21, 0x78, 0x81, 0xbd, 0x9c, 0xcf, 0xed,
0x0f, 0x77, 0x05, 0x88, 0x66, 0xd5, 0x34, 0xe6, 0x67, 0xe5, 0x70, 0x2f,
0x01, 0x58, 0xf8, 0x8d, 0xcb, 0xda, 0x2e, 0x01, 0x11, 0xfe, 0xe5, 0x2d,
0xe5, 0xe7, 0x00, 0xf6, 0xf2, 0xf2, 0xfa, 0x52, 0x3f, 0x23, 0xb8, 0x57,
0xc0, 0xeb, 0x35, 0x2e, 0x68, 0x36, 0xba, 0x71, 0x80, 0x88, 0x1f, 0xe7,
0xc9, 0x0b, 0x0e, 0xf8, 0x98, 0x7b, 0xc8, 0x6a, 0x02, 0xfc, 0x37, 0x03,
0x08, 0x14, 0x10, 0xfc, 0xf4, 0x55, 0x70, 0x05, 0x71, 0x29, 0x0b, 0x71,
0xd5, 0x93, 0x6e, 0x1e, 0xf0, 0xcf, 0x9f, 0x99, 0xef, 0xcf, 0x9f, 0x24,
0xe0, 0xd5, 0x01, 0x74, 0xe3, 0x8c, 0x1f, 0x18, 0x25, 0x5e, 0xcb, 0x03,
0x8a, 0x6a, 0x50, 0x4d, 0xf5, 0xee, 0xc9, 0xe7, 0x3a, 0x00, 0x67, 0xc1,
0x3f, 0xdc, 0x2f, 0x03, 0xd8, 0x5b, 0x80, 0xb6, 0xdf, 0x34, 0xc9, 0x81,
0xa8, 0xac, 0x2f, 0x1c, 0xb4, 0xe1, 0x7d, 0xfd, 0x61, 0x2d, 0xa3, 0x30,
0xe3, 0x4b, 0x07, 0x20, 0xc9, 0xe1, 0x00, 0xa0, 0x8c, 0x3f, 0x19, 0x83,
0x50, 0x6c, 0x38, 0xdc, 0x3b, 0x9e, 0xd4, 0x54, 0x07, 0x7a, 0x6b, 0x30,
0xb1, 0x1c, 0x66, 0x80, 0x24, 0x5d, 0x41, 0xc7, 0x9f, 0xfc, 0x85, 0xbf,
0x52, 0x92, 0xc7, 0x0f, 0x18, 0x90, 0x6b, 0x99, 0x89, 0xa8, 0xcb, 0xe6,
0xd7, 0x92, 0x1c, 0xe6, 0x11, 0x38, 0xf1, 0x18, 0x04, 0x0b, 0x90, 0xbf,
0xce, 0x3e, 0x1a, 0xf3, 0xa9, 0xac, 0x33, 0xf8, 0xbe, 0x91, 0xb8, 0x22,
0xc0, 0xcf, 0x64, 0x21, 0x4d, 0x73, 0x58, 0xa6, 0xf0, 0x24, 0x00, 0xd9,
0x7f, 0x93, 0x03, 0x68, 0x02, 0xd4, 0xac, 0x22, 0x3c, 0xa7, 0x20, 0xac,
0x28, 0x85, 0x3f, 0x3f, 0x73, 0x31, 0x48, 0x00, 0x27, 0x19, 0x80, 0x13,
0x77, 0x74, 0x01, 0xf9, 0xc7, 0x22, 0x0e, 0xa3, 0x82, 0x0f, 0xe9, 0x01,
0x2b, 0x04, 0x2c, 0xa9, 0xa5, 0x7b, 0x50, 0x62, 0xfc, 0x7f, 0x82, 0xa6,
0x3e, 0x9c, 0x78, 0x77, 0xe8, 0x2e, 0x23, 0x84, 0xd3, 0x78, 0x0f, 0x29,
0x8c, 0x37, 0x0e, 0x98, 0x13, 0x54, 0x7f, 0xd9, 0x6b, 0x27, 0x2e, 0xa5,
0xd1, 0x80, 0xbc, 0x4e, 0x01, 0xb9, 0xe1, 0x00, 0x43, 0x64, 0x18, 0xde,
0xfe, 0x20, 0x82, 0xa0, 0x01, 0x6f, 0xa9, 0xc1, 0x58, 0xf5, 0x91, 0xbd,
0x0d, 0x15, 0x69, 0x6e, 0x9d, 0x1d, 0x48, 0x62, 0xf6, 0xda, 0x0e, 0xea,
0x40, 0x14, 0x57, 0x88, 0x3e, 0xb5, 0x60, 0x64, 0x28, 0xd1, 0xcb, 0xd5,
0x3d, 0x14, 0x08, 0x06, 0x2e, 0x90, 0xb8, 0x82, 0x22, 0xb3, 0x37, 0x0f,
0x88, 0xf2, 0x22, 0xb9, 0x38, 0x21, 0x4b, 0xcc, 0x72, 0x83, 0x82, 0x74,
0x87, 0x25, 0x2c, 0xe4, 0x8b, 0x24, 0xf1, 0xfd, 0x82, 0x5d, 0x05, 0x7e,
0x9f, 0x36, 0x20, 0xbb, 0x76, 0x16, 0x4a, 0x63, 0x6b, 0x8b, 0x6a, 0x4e,
0x50, 0x01, 0x39, 0x21, 0x18, 0x5b, 0x56, 0xd8, 0x30, 0xe0, 0xec, 0x47,
0x01, 0xe5, 0x5e, 0xa1, 0x50, 0x10, 0xf6, 0xce, 0x25, 0xdf, 0x02, 0x40,
0x77, 0xba, 0x37, 0xcc, 0xaf, 0x4f, 0xa1, 0x72, 0x10, 0x37, 0x0b, 0xc8,
0xfc, 0x1c, 0xc0, 0x5b, 0x44, 0x70, 0x06, 0x3c, 0x9d, 0xf8, 0xdb, 0x3d,
0x65, 0x05, 0x75, 0x15, 0xed, 0x01, 0xca, 0x31, 0xdb, 0x21, 0xdc, 0x2c,
0x20, 0xf7, 0x13, 0x80, 0x68, 0x85, 0xa0, 0x9f, 0xc6, 0x3d, 0x07, 0x64,
0x84, 0x27, 0x05, 0x99, 0xee, 0x04, 0x03, 0x0b, 0x0e, 0x83, 0xac, 0x7b,
0x80, 0x0a, 0x6e, 0x3d, 0x02, 0x65, 0x0a, 0xcf, 0x3d, 0x1f, 0xf7, 0x33,
0x3b, 0x36, 0xd0, 0x2e, 0x68, 0x58, 0x06, 0x9f, 0x4e, 0x82, 0x50, 0x0a,
0xa6, 0xf5, 0x26, 0x39, 0x5b, 0xa1, 0x80, 0x7c, 0xea, 0x22, 0xe6, 0x7e,
0x76, 0x0c, 0xe2, 0x76, 0xfb, 0x40, 0x39, 0x88, 0xf0, 0x25, 0x7a, 0xb1,
0xe5, 0x4a, 0x5f, 0xb2, 0xb4, 0x0a, 0x1a, 0x02, 0x28, 0x15, 0x13, 0x84,
0x7a, 0xaa, 0xe2, 0x02, 0xf2, 0x99, 0xf3, 0x28, 0x27, 0x7f, 0xbb, 0x00,
0xfc, 0x10, 0x70, 0xf2, 0x1a, 0x87, 0xbd, 0xe5, 0x05, 0xd1, 0xb9, 0x14,
0x07, 0x06, 0xf0, 0x04, 0x39, 0x42, 0xb3, 0xa2, 0x40, 0x01, 0xd5, 0x52,
0xd7, 0x1c, 0x8a, 0x13, 0xf9, 0x9b, 0x2d, 0x03, 0x7e, 0xa8, 0x9d, 0x53,
0x81, 0xd3, 0xa2, 0x49, 0x4f, 0x28, 0x06, 0xe1, 0x13, 0x6d, 0xf9, 0xc1,
0xd8, 0x0a, 0x41, 0x55, 0xc6, 0x88, 0x20, 0xa4, 0x80, 0xe3, 0xb6, 0x01,
0x93, 0xf7, 0xff, 0x22, 0x9a, 0x15, 0x04, 0xd9, 0xfd, 0x2d, 0x21, 0x24,
0x82, 0x6a, 0x26, 0xa2, 0x56, 0xc0, 0xf6, 0x04, 0x98, 0xbc, 0xbe, 0x28,
0x07, 0x93, 0x5e, 0x8e, 0x1d, 0x27, 0x5f, 0x30, 0x65, 0xa8, 0x05, 0xe9,
0x4c, 0xce, 0x07, 0x5c, 0x2d, 0xb8, 0x85, 0x67, 0x2a, 0xa1, 0x18, 0x4d,
0xfa, 0x10, 0x60, 0x9e, 0xd0, 0x2a, 0xbe, 0x47, 0x33, 0x43, 0x01, 0x06,
0x68, 0xa6, 0x2c, 0x7b, 0x06, 0xd4, 0x7b, 0x67, 0x44, 0x09, 0xe8, 0x37,
0xb5, 0x40, 0xed, 0x32, 0x8a, 0xd7, 0xff, 0x17, 0x24, 0x94, 0x80, 0x2a,
0x0c, 0x77, 0x0e, 0x28, 0x83, 0x10, 0xe0, 0x70, 0x8a, 0xb5, 0xf0, 0x0c,
0x4f, 0x09, 0xca, 0x0b, 0x20, 0x23, 0x41, 0x94, 0x8b, 0xff, 0x2a, 0x04,
0x77, 0x0e, 0x28, 0x09, 0xe1, 0x70, 0x48, 0xd9, 0xc5, 0x08, 0x27, 0xb6,
0xe4, 0x42, 0xba, 0x3f, 0x05, 0xc8, 0x17, 0xb3, 0x17, 0xe4, 0x70, 0xa8,
0xa7, 0xde, 0xd0, 0x73, 0xe5, 0x38, 0xe1, 0xe1, 0x54, 0x20, 0x08, 0x3e,
0x60, 0x68, 0x79, 0x6b, 0xd2, 0x97, 0xa3, 0x0a, 0x43, 0x70, 0xe3, 0x80,
0xbc, 0x2b, 0x3c, 0xc4, 0x04, 0x9d, 0xd1, 0xc2, 0x20, 0x42, 0x64, 0xbb,
0x82, 0xbc, 0xec, 0x34, 0xa9, 0xe1, 0xb8, 0x20, 0x04, 0x43, 0x7b, 0x40,
0xb6, 0x06, 0x98, 0x12, 0x74, 0x07, 0x5d, 0xfa, 0x4a, 0x78, 0x21, 0x50,
0x32, 0x96, 0x03, 0xfa, 0xff, 0x68, 0x5b, 0x8f, 0x86, 0x44, 0x1e, 0x83,
0xf1, 0x7e, 0xd0, 0xab, 0x5b, 0xb2, 0x1b, 0x66, 0xc0, 0xf4, 0x83, 0x79,
0xc1, 0xd0, 0xbd, 0x26, 0x5b, 0x7b, 0xb6, 0x26, 0x66, 0x46, 0x92, 0x50,
0x18, 0x26, 0x00, 0x65, 0x0c, 0x2e, 0x00, 0x74, 0xff, 0xd5, 0x16, 0x01,
0xe3, 0x84, 0xaa, 0x38, 0xa1, 0x88, 0xee, 0x9a, 0x8c, 0x13, 0x80, 0x7c,
0x5a, 0xfc, 0x83, 0x00, 0xd5, 0x9a, 0x4d, 0x88, 0x50, 0x6c, 0xcc, 0xf2,
0xc6, 0x8f, 0x29, 0xbd, 0x61, 0x75, 0x84, 0xe2, 0x62, 0x7a, 0x17, 0x80,
0x46, 0xf0, 0xe0, 0xa4, 0xaf, 0x14, 0xd4, 0xd7, 0x39, 0x92, 0x63, 0xb0,
0xdd, 0x0d, 0x16, 0x4e, 0x88, 0x31, 0x70, 0xfd, 0x64, 0x83, 0xcf, 0x17,
0x9e, 0xdf, 0xc6, 0xe5, 0x42, 0x08, 0x83, 0x13, 0x35, 0xe7, 0x1e, 0xaf,
0xb4, 0x60, 0x69, 0x31, 0x8d, 0x81, 0x2b, 0x50, 0x5b, 0x7c, 0x40, 0x33,
0x7b, 0x1f, 0x17, 0x92, 0xc7, 0xfc, 0x7a, 0x65, 0x5c, 0xaa, 0x00, 0xb0,
0x50, 0x10, 0x61, 0xdc, 0x07, 0x20, 0x4a, 0x40, 0x15, 0x84, 0x66, 0xa5,
0x34, 0x4c, 0xf5, 0xa8, 0x10, 0x44, 0xf0, 0x97, 0xff, 0xb7, 0xf9, 0x88,
0x70, 0x9e, 0x4b, 0x22, 0x08, 0x75, 0x08, 0x26, 0x36, 0xe8, 0xe7, 0x62,
0xd0, 0xac, 0x0c, 0xa6, 0x05, 0x25, 0xa0, 0xf5, 0x8f, 0x36, 0x0c, 0x28,
0x07, 0x13, 0x1a, 0x82, 0x89, 0xbb, 0x1a, 0x1e, 0x00, 0x88, 0x30, 0xee,
0x05, 0xf0, 0x43, 0x24, 0xf1, 0xf1, 0x28, 0x05, 0xe1, 0x6e, 0x41, 0x28,
0x10, 0xdc, 0x19, 0x20, 0xf3, 0x23, 0x82, 0xc3, 0x70, 0x1f, 0x20, 0xe4,
0x4b, 0x19, 0x1c, 0xf7, 0x03, 0xc8, 0x04, 0x8f, 0x47, 0x23, 0x58, 0x10,
0x82, 0x85, 0x11, 0x1a, 0x07, 0x44, 0x08, 0x6d, 0x46, 0xda, 0x72, 0x04,
0xd2, 0x7e, 0xf0, 0x71, 0x80, 0x31, 0x41, 0x84, 0xe0, 0x4e, 0x90, 0x6e,
0x07, 0x7e, 0x42, 0xf0, 0xae, 0x1c, 0x1e, 0xe9, 0xd5, 0x4f, 0x4c, 0xf9,
0xed, 0x09, 0x50, 0xe7, 0x30, 0x13, 0xcc, 0x86, 0x60, 0xee, 0xf6, 0xc3,
0xcc, 0x35, 0x62, 0x0a, 0x78, 0xda, 0x3a, 0x20, 0xca, 0x01, 0xf8, 0x68,
0x08, 0x0f, 0x87, 0x6c, 0x08, 0x16, 0x03, 0x06, 0xcf, 0xf3, 0xa1, 0x5b,
0xfe, 0x77, 0x00, 0x78, 0xa4, 0x80, 0x32, 0x0a, 0xd3, 0x21, 0x98, 0xbd,
0xf3, 0x0b, 0x12, 0x5b, 0x8d, 0xe8, 0xa9, 0x2a, 0x7c, 0x7f, 0x22, 0xee,
0x00, 0xf0, 0x08, 0x84, 0x30, 0x0f, 0x38, 0x8e, 0xe3, 0xea, 0x10, 0x44,
0x7b, 0x87, 0xcd, 0x09, 0xf6, 0x01, 0xe8, 0xc5, 0xe0, 0x30, 0x3c, 0x0a,
0x10, 0xd0, 0x99, 0x7a, 0x8f, 0xfb, 0x02, 0xfc, 0xc0, 0xa3, 0x2b, 0x08,
0x77, 0xc7, 0x20, 0x84, 0x37, 0x5c, 0xba, 0xe7, 0xaa, 0xc0, 0x3e, 0x00,
0xc3, 0x21, 0x78, 0x57, 0x0c, 0xda, 0x4a, 0xf4, 0x58, 0x1a, 0x67, 0x95,
0x91, 0x4d, 0x7c, 0xb6, 0x0e, 0x48, 0x04, 0x1f, 0x18, 0x83, 0x76, 0x08,
0x9a, 0xb3, 0xe0, 0xc6, 0x1d, 0x02, 0xb2, 0xd0, 0xd0, 0x68, 0xf0, 0xa0,
0x18, 0x0c, 0xaf, 0x66, 0x7b, 0x7f, 0xb3, 0x0f, 0x40, 0x91, 0x5d, 0xfa,
0xb8, 0x40, 0x12, 0x82, 0xc3, 0x3d, 0x39, 0x0c, 0x2e, 0x60, 0x80, 0x76,
0x2f, 0x80, 0x62, 0xab, 0x8a, 0x5e, 0x9c, 0xbe, 0x5f, 0x50, 0x6e, 0xdf,
0xca, 0x1c, 0x3e, 0x23, 0x00, 0x8d, 0xe0, 0x96, 0x01, 0xd5, 0xc2, 0xe0,
0xe5, 0x62, 0x1f, 0xb4, 0xb8, 0xda, 0xcf, 0xae, 0xa6, 0xc7, 0x1f, 0x01,
0xa8, 0xaf, 0xd1, 0xc9, 0xd9, 0x5d, 0x3c, 0x04, 0x87, 0x01, 0x8a, 0x3a,
0xbe, 0x1c, 0xe0, 0x69, 0x8f, 0x80, 0x8c, 0xf0, 0x08, 0x47, 0x48, 0x08,
0xf2, 0x9b, 0x83, 0x4b, 0xa2, 0x10, 0x92, 0x80, 0xea, 0x4e, 0x8b, 0xfd,
0x00, 0x06, 0x93, 0x38, 0x20, 0x35, 0xe4, 0x93, 0x9b, 0xf4, 0x81, 0x4e,
0x42, 0xef, 0x1a, 0xd0, 0x11, 0x8c, 0x4c, 0xea, 0xe6, 0x00, 0x1c, 0xb2,
0x11, 0x08, 0x74, 0x5d, 0x15, 0x46, 0xf8, 0x51, 0x80, 0x17, 0x5d, 0xd0,
0xd8, 0x82, 0x83, 0x0a, 0x40, 0x46, 0x98, 0x1b, 0xa1, 0x21, 0xbb, 0x04,
0xbb, 0x47, 0xc0, 0x0f, 0xbc, 0x10, 0x41, 0xb5, 0xb0, 0x20, 0x4f, 0x18,
0x13, 0x6c, 0x20, 0x02, 0x30, 0xb7, 0xe2, 0x65, 0x95, 0x7e, 0x91, 0x4b,
0xcc, 0x6a, 0x37, 0x0e, 0xee, 0x09, 0x50, 0x84, 0xa0, 0x55, 0x0f, 0xb2,
0x58, 0xe3, 0xdd, 0x1e, 0xc7, 0x83, 0x41, 0xee, 0xd3, 0xcf, 0x47, 0x60,
0xc6, 0x6f, 0x97, 0x80, 0xb3, 0xe0, 0x45, 0x0b, 0xaa, 0x59, 0x9d, 0x3c,
0x56, 0x47, 0x1e, 0xcc, 0xc1, 0xc3, 0x2f, 0x02, 0x68, 0x97, 0x7f, 0xe9,
0x3a, 0x50, 0xdf, 0xe7, 0xb3, 0x37, 0x40, 0x08, 0x00, 0x82, 0xf2, 0x93,
0x90, 0x6c, 0x80, 0xc9, 0x01, 0x8e, 0xa0, 0xf6, 0x0c, 0xfe, 0x28, 0x40,
0x1a, 0x82, 0x74, 0x69, 0x86, 0x00, 0xca, 0x01, 0x7a, 0xc8, 0x6d, 0x9d,
0x91, 0xa7, 0xe7, 0x65, 0xca, 0xc0, 0xdd, 0x01, 0xce, 0xe3, 0x48, 0x08,
0x70, 0x30, 0xa9, 0x2c, 0xc6, 0xe7, 0xa1, 0x0c, 0x70, 0x84, 0x31, 0xba,
0x49, 0x69, 0xaf, 0x80, 0x60, 0x03, 0x1e, 0xcd, 0xac, 0x84, 0xae, 0xd7,
0x44, 0xca, 0x18, 0x57, 0x30, 0xb1, 0x4d, 0xee, 0xb4, 0x53, 0x40, 0x19,
0x82, 0xde, 0x65, 0x26, 0x15, 0x7e, 0xe2, 0xa5, 0x63, 0x34, 0x31, 0x9d,
0xfb, 0x38, 0xe3, 0xff, 0x6e, 0xbf, 0x80, 0x60, 0x8d, 0x22, 0xa4, 0x1b,
0xa4, 0x97, 0x8f, 0x8f, 0x90, 0xa8, 0x00, 0xcd, 0xa6, 0xf3, 0x9f, 0x09,
0x08, 0x4e, 0x08, 0x2a, 0x43, 0xf2, 0xa7, 0x63, 0x0a, 0xb0, 0x60, 0x37,
0xe6, 0x9e, 0x01, 0x4d, 0x08, 0x1e, 0xc3, 0x4d, 0x0c, 0xc3, 0xd3, 0x94,
0xdf, 0x5c, 0x04, 0x63, 0x1c, 0xf0, 0xb4, 0x5f, 0x40, 0x21, 0x18, 0x05,
0xd4, 0x77, 0xdd, 0xe4, 0xd6, 0x11, 0xd2, 0xf7, 0x85, 0xed, 0x1e, 0x30,
0x22, 0x08, 0x39, 0xbf, 0xb1, 0xc4, 0x6f, 0xe7, 0x80, 0x62, 0x20, 0x8e,
0x00, 0x0a, 0xc3, 0xb8, 0x9f, 0x82, 0x4b, 0x9c, 0x9f, 0x0c, 0x7a, 0x25,
0x61, 0xb7, 0x80, 0xa9, 0x1c, 0x16, 0x01, 0x58, 0xb0, 0x81, 0x30, 0xbe,
0x96, 0x4f, 0x03, 0x70, 0xbf, 0x80, 0x97, 0x30, 0xa0, 0xbc, 0xf5, 0x2b,
0x0f, 0x18, 0x1f, 0x42, 0x28, 0x20, 0xec, 0x12, 0x30, 0x15, 0x82, 0x05,
0x47, 0xec, 0xcb, 0x1c, 0x8e, 0x03, 0xd2, 0x1e, 0x70, 0xaf, 0x80, 0x10,
0x09, 0x41, 0x28, 0x7b, 0x42, 0x46, 0xfc, 0x52, 0x48, 0x03, 0x5c, 0x78,
0x61, 0x3d, 0x3d, 0x04, 0xef, 0xea, 0xb2, 0xa6, 0x0d, 0x18, 0x11, 0x2c,
0x7b, 0x46, 0x46, 0xe6, 0x6c, 0x80, 0xfd, 0x03, 0x9a, 0x8b, 0xec, 0xab,
0xfc, 0xc6, 0xe2, 0x00, 0x6c, 0x80, 0xab, 0x22, 0x70, 0x43, 0x80, 0x6b,
0x9f, 0x7e, 0x29, 0x72, 0x98, 0x6f, 0x52, 0x58, 0x03, 0x38, 0xc6, 0x22,
0x10, 0x1c, 0xbf, 0xca, 0x01, 0x11, 0x57, 0x3f, 0x7a, 0x3e, 0x1c, 0x82,
0xc5, 0x0f, 0x4f, 0x8b, 0xde, 0xb1, 0x3d, 0xc2, 0xa6, 0x00, 0xe1, 0x8b,
0xb5, 0x35, 0xe7, 0xa9, 0x29, 0xc0, 0xa3, 0xb3, 0xaa, 0x55, 0xbe, 0x45,
0x30, 0x0a, 0x18, 0xf1, 0xab, 0x10, 0x70, 0xf6, 0xe3, 0x82, 0x6b, 0xce,
0x44, 0xd4, 0xbb, 0x3c, 0x8e, 0x0f, 0x04, 0x84, 0x11, 0x60, 0x43, 0x80,
0xcc, 0x4f, 0x86, 0xe0, 0x8a, 0x34, 0x0e, 0xe6, 0xf0, 0x12, 0xc0, 0xd8,
0xd8, 0xe2, 0x1c, 0x50, 0x53, 0x39, 0xe0, 0x97, 0x6c, 0xf6, 0x63, 0x98,
0x17, 0x00, 0x1e, 0x1f, 0x08, 0xe8, 0xe6, 0xef, 0x09, 0xaa, 0x07, 0x34,
0x6d, 0xf1, 0x21, 0xe3, 0x74, 0xbb, 0xe5, 0x0a, 0xc0, 0x10, 0xa1, 0x07,
0x78, 0xa8, 0xfa, 0x6e, 0x4d, 0xed, 0x07, 0xb0, 0xa6, 0x27, 0x34, 0xa3,
0xc8, 0xa3, 0x00, 0xbd, 0xb3, 0x97, 0x0f, 0xb0, 0x09, 0x40, 0x7e, 0x72,
0x27, 0xfb, 0x60, 0x5a, 0x2e, 0x28, 0x36, 0x09, 0xae, 0x29, 0x63, 0x92,
0xd7, 0xd2, 0x83, 0x7e, 0xf5, 0x02, 0xfe, 0x47, 0x86, 0xe0, 0x6a, 0x40,
0x58, 0x13, 0x81, 0xe0, 0x9d, 0xec, 0xe6, 0xfa, 0x1d, 0x2a, 0x3f, 0x37,
0x86, 0x02, 0x7e, 0xad, 0xa8, 0x07, 0xc9, 0x71, 0x1e, 0xb0, 0x26, 0x85,
0x9d, 0xea, 0xd9, 0xf5, 0xf3, 0x02, 0xb0, 0xc6, 0x41, 0x04, 0xd4, 0xf0,
0xc1, 0xfd, 0xfe, 0x2e, 0x05, 0xbc, 0xc0, 0x03, 0x00, 0xc5, 0xb2, 0x20,
0xf0, 0x63, 0xab, 0x21, 0x15, 0x80, 0xdf, 0x05, 0x98, 0x3c, 0x9d, 0xe5,
0x2f, 0x19, 0x87, 0xc3, 0x80, 0x89, 0xea, 0x06, 0xc9, 0x2e, 0xcb, 0x05,
0xcb, 0xa9, 0xc1, 0xbd, 0xaa, 0x27, 0xfa, 0xf0, 0x83, 0x70, 0x00, 0x56,
0x08, 0xe8, 0x08, 0x86, 0x00, 0xf1, 0x0d, 0xb2, 0x80, 0x47, 0xeb, 0x26,
0xba, 0xe5, 0xd9, 0x4b, 0x0e, 0x4d, 0x87, 0x44, 0x00, 0x7e, 0x13, 0x60,
0xba, 0x3c, 0xc6, 0xbf, 0x7f, 0x93, 0x80, 0xf8, 0x96, 0xf8, 0x7c, 0xa4,
0xbb, 0x2c, 0x61, 0x05, 0xa0, 0x5c, 0x3a, 0x20, 0xa7, 0xa6, 0x43, 0xc2,
0xaf, 0x4e, 0x40, 0x20, 0x82, 0x7f, 0x89, 0x20, 0x2a, 0xbf, 0xcc, 0x92,
0x96, 0x8a, 0xbc, 0xa3, 0xb9, 0x09, 0x71, 0xd9, 0x2d, 0x87, 0x10, 0x7c,
0xf0, 0x41, 0x20, 0x81, 0x5f, 0x0b, 0x68, 0x7a, 0x2e, 0xcc, 0x1d, 0x33,
0xf7, 0x57, 0x12, 0xb2, 0xdf, 0xc1, 0xfa, 0x2c, 0x4c, 0xfb, 0xd9, 0x82,
0xe6, 0x1e, 0xc4, 0x71, 0xc9, 0x82, 0x82, 0x8e, 0xbf, 0x4c, 0x09, 0xf3,
0x62, 0x40, 0xa4, 0xf7, 0xd1, 0xe7, 0x0c, 0x48, 0x0c, 0x9a, 0x67, 0x2c,
0x61, 0xa6, 0xff, 0x4b, 0x00, 0xc2, 0x02, 0x3e, 0x86, 0x17, 0x7a, 0xec,
0x41, 0x28, 0x00, 0x5f, 0x08, 0x48, 0xfd, 0x8a, 0xce, 0xda, 0x34, 0x73,
0x3a, 0x92, 0xba, 0xf8, 0xf6, 0x96, 0xfd, 0xdc, 0x8b, 0xbd, 0x25, 0x70,
0x51, 0x0e, 0xab, 0xd1, 0x37, 0xf0, 0xe0, 0x88, 0x60, 0x00, 0xbe, 0x0e,
0x10, 0xcf, 0x26, 0x15, 0xcf, 0x45, 0xc7, 0xe5, 0x7a, 0x11, 0x28, 0x00,
0xcb, 0x0e, 0x3a, 0x35, 0x7b, 0x02, 0x01, 0x56, 0x00, 0x46, 0x02, 0x10,
0xbf, 0x0f, 0x10, 0xe1, 0x5c, 0x1e, 0x80, 0x42, 0xe1, 0xcb, 0x0e, 0x41,
0x84, 0x19, 0xd0, 0x0e, 0xc0, 0x60, 0x39, 0x28, 0x6f, 0xc1, 0x3e, 0xd2,
0x20, 0x5c, 0xe2, 0x77, 0x88, 0xe4, 0xef, 0x1c, 0x80, 0xa1, 0x6f, 0xbb,
0xab, 0x31, 0x00, 0xe5, 0x85, 0x91, 0x2f, 0x11, 0x3b, 0x72, 0x36, 0xc7,
0xed, 0x0c, 0x20, 0x3f, 0x12, 0x02, 0xe3, 0x93, 0x11, 0xb0, 0x36, 0x56,
0x16, 0x5f, 0x56, 0x12, 0x80, 0x81, 0xc7, 0xbe, 0x1c, 0x22, 0x2b, 0x6b,
0xdd, 0xab, 0xfc, 0x48, 0x00, 0x9e, 0xb1, 0x2c, 0x66, 0xd5, 0x64, 0x38,
0x04, 0x38, 0xc7, 0xe3, 0x5b, 0x64, 0xc5, 0x1a, 0x81, 0xee, 0x90, 0x51,
0x77, 0x88, 0x94, 0xf0, 0x0d, 0x8c, 0x2f, 0x08, 0x78, 0x08, 0x77, 0x80,
0x4f, 0x06, 0xc4, 0x50, 0x00, 0x22, 0x89, 0xc5, 0x52, 0x41, 0xfe, 0xcc,
0x34, 0x2e, 0xf6, 0x26, 0x01, 0xd9, 0x07, 0xf1, 0x83, 0xfe, 0xe0, 0x02,
0x17, 0x67, 0x24, 0x29, 0x12, 0x1c, 0xd8, 0x19, 0x66, 0x87, 0x68, 0xfc,
0xbd, 0x1a, 0xd0, 0xf2, 0x33, 0x80, 0xe7, 0x33, 0x7e, 0xac, 0x05, 0x04,
0xc9, 0xc6, 0xfc, 0xd2, 0x80, 0x60, 0xc6, 0x62, 0x28, 0x2e, 0x64, 0x18,
0x20, 0x8b, 0xb5, 0x53, 0x60, 0xfc, 0x8d, 0x7d, 0xb5, 0xe7, 0x01, 0x22,
0x06, 0x32, 0x18, 0x09, 0x65, 0x09, 0x20, 0xe8, 0xb3, 0xc3, 0x29, 0xa0,
0xf0, 0x8b, 0x3f, 0x8a, 0xce, 0xbd, 0xc3, 0x41, 0x01, 0xe6, 0x14, 0x05,
0xa0, 0xf7, 0xd4, 0x9c, 0x94, 0xdf, 0xf3, 0x00, 0xad, 0x1e, 0x5e, 0x01,
0xce, 0x63, 0xf1, 0x19, 0x96, 0x00, 0x8a, 0x2b, 0x74, 0x1a, 0x50, 0xc4,
0x1d, 0x42, 0xd2, 0xcf, 0x9a, 0x0e, 0x5b, 0x5b, 0x7c, 0xc7, 0x22, 0x40,
0xf7, 0x39, 0x07, 0x49, 0xbf, 0xd7, 0x00, 0xea, 0xb0, 0x9b, 0x3f, 0x38,
0x97, 0xaf, 0xef, 0x99, 0xeb, 0x23, 0x0e, 0xe0, 0x5b, 0x1e, 0xd0, 0x6c,
0x8e, 0x26, 0xe5, 0xe0, 0x2a, 0x40, 0xee, 0xa7, 0x8e, 0x82, 0xf2, 0x1f,
0x5e, 0xd9, 0x3d, 0xcd, 0x4f, 0x95, 0xbf, 0x04, 0x90, 0xf9, 0xdd, 0x09,
0xc8, 0xde, 0xca, 0x5b, 0xb2, 0x07, 0xb4, 0x4e, 0x33, 0xf2, 0x37, 0xea,
0x2f, 0x04, 0x3c, 0x08, 0xbf, 0xf7, 0xf7, 0x77, 0x72, 0xa8, 0x05, 0x45,
0x7c, 0x1a, 0xa0, 0x8a, 0x39, 0x17, 0xb0, 0xfc, 0x32, 0x1b, 0xea, 0x2e,
0x50, 0x0d, 0x1c, 0x02, 0x10, 0xdc, 0x00, 0xa4, 0xc1, 0x81, 0xee, 0x0d,
0x5e, 0xee, 0x8d, 0x5f, 0xf1, 0x55, 0x05, 0x50, 0x80, 0xa7, 0x83, 0x1b,
0x7e, 0xef, 0xaa, 0xc9, 0x0f, 0xe1, 0xf9, 0x77, 0xac, 0x4b, 0x40, 0x44,
0x9a, 0xb8, 0x7e, 0x06, 0xa7, 0x97, 0x96, 0xad, 0xb9, 0x1c, 0x72, 0x3a,
0xd7, 0xcf, 0x32, 0xb3, 0xce, 0x9d, 0x08, 0xf2, 0xa5, 0xd7, 0x65, 0xc0,
0x8d, 0x40, 0xd7, 0x8f, 0xd9, 0x69, 0x41, 0x7c, 0x39, 0xa0, 0x97, 0xc1,
0x88, 0x90, 0xf1, 0x13, 0x13, 0x11, 0x0f, 0x50, 0xf7, 0x0f, 0x06, 0x8f,
0xbd, 0xa9, 0x4e, 0x03, 0xba, 0xbb, 0x8b, 0x80, 0x22, 0xc6, 0x01, 0x0f,
0x07, 0x22, 0x78, 0x90, 0xe9, 0x0b, 0xdd, 0x7b, 0xa0, 0xa9, 0x20, 0x7c,
0x39, 0x60, 0xb0, 0xba, 0x8e, 0x4d, 0x86, 0x41, 0x4c, 0x44, 0x64, 0x6f,
0x40, 0x7b, 0x21, 0xc2, 0x67, 0xde, 0x54, 0x47, 0x4f, 0x72, 0xb3, 0xf9,
0x8e, 0xf4, 0x70, 0xa8, 0x9c, 0x9f, 0x6c, 0xe2, 0x1f, 0x77, 0x5d, 0x18,
0x70, 0x12, 0x7d, 0xe1, 0xab, 0x01, 0xe9, 0x9a, 0xe0, 0x39, 0x17, 0x7f,
0x6a, 0x9b, 0x96, 0x78, 0x7a, 0x33, 0x58, 0x80, 0xe8, 0xf1, 0x49, 0x40,
0x6f, 0x25, 0x50, 0x7d, 0x6c, 0xea, 0x99, 0xc8, 0xd1, 0x5a, 0x40, 0xe9,
0x74, 0xf8, 0x05, 0xf9, 0xcc, 0x98, 0xf2, 0x44, 0x40, 0xf1, 0xb6, 0x63,
0x80, 0xa9, 0x8a, 0x1a, 0xf5, 0xd5, 0x61, 0x79, 0x81, 0x93, 0x1d, 0x14,
0x68, 0x7f, 0xe7, 0x4a, 0xcf, 0x03, 0x14, 0xa5, 0x0b, 0xe9, 0x10, 0x55,
0xe8, 0xe9, 0xb2, 0xc6, 0x11, 0x1c, 0x44, 0x03, 0xb0, 0x62, 0x4f, 0xf3,
0x75, 0xb6, 0x97, 0xfd, 0x13, 0x63, 0x5f, 0xf3, 0x79, 0xab, 0x07, 0x49,
0x40, 0xb6, 0xbc, 0x85, 0x91, 0x32, 0x44, 0xed, 0xb0, 0xfc, 0xd2, 0xa3,
0x30, 0x44, 0xc2, 0xc0, 0x7d, 0x33, 0x9d, 0x3b, 0x9e, 0x74, 0x2a, 0x28,
0xe3, 0x7b, 0x65, 0xd4, 0x99, 0x00, 0x6e, 0xea, 0xc6, 0xb3, 0xf7, 0x65,
0x80, 0x2c, 0xd1, 0xce, 0xa4, 0xef, 0x23, 0x80, 0x2a, 0xc3, 0x3d, 0x3b,
0x24, 0xeb, 0x80, 0x66, 0x87, 0x56, 0x57, 0x06, 0x68, 0x0b, 0x76, 0xb2,
0x01, 0x99, 0x92, 0xe8, 0x31, 0xd9, 0x07, 0x04, 0x1f, 0xbf, 0xe4, 0xab,
0x3e, 0x6f, 0x26, 0xc2, 0xb1, 0x50, 0xfc, 0xe2, 0x02, 0xd2, 0x1e, 0x92,
0xae, 0x00, 0xd2, 0xad, 0x6d, 0x5f, 0x7a, 0x8b, 0x42, 0x29, 0x1f, 0x17,
0xd4, 0x6c, 0x2a, 0xd9, 0x3a, 0xb2, 0x59, 0x8b, 0x1c, 0x15, 0x0a, 0xa4,
0xef, 0x8b, 0xf8, 0x95, 0x7d, 0xc5, 0x27, 0x02, 0xce, 0x4a, 0x17, 0xb6,
0x10, 0xad, 0xca, 0x17, 0x52, 0x0f, 0x4a, 0xc7, 0xd0, 0xb4, 0xc3, 0x6c,
0xec, 0x00, 0x58, 0x16, 0x7f, 0x6e, 0x27, 0x2f, 0x3f, 0x10, 0x9a, 0x6e,
0x39, 0x08, 0xc3, 0xa0, 0x7b, 0xbf, 0x3b, 0xfc, 0x9e, 0x0c, 0x38, 0xb7,
0x39, 0xf6, 0xc0, 0x01, 0x94, 0x03, 0x8c, 0xbd, 0x5e, 0x63, 0x65, 0x2e,
0x90, 0x01, 0xa4, 0x5b, 0xe5, 0x27, 0xbb, 0x7d, 0x5a, 0xde, 0x58, 0xc7,
0x5c, 0xfa, 0xe9, 0xea, 0xb6, 0xf7, 0x6f, 0x06, 0x34, 0x82, 0x70, 0x91,
0x82, 0x60, 0x00, 0xd1, 0x59, 0xf0, 0x22, 0x7e, 0x36, 0xe0, 0x22, 0x3d,
0xf0, 0x04, 0x75, 0x62, 0x87, 0xc6, 0x96, 0xe5, 0xe1, 0xf6, 0x2d, 0x80,
0xb3, 0xa0, 0x00, 0x14, 0xbf, 0xa1, 0x5a, 0xdb, 0x42, 0xba, 0xb4, 0x4f,
0x12, 0xd8, 0xcc, 0x80, 0x97, 0xbd, 0x33, 0xaf, 0xcc, 0xa0, 0x7f, 0xe8,
0x3a, 0x7f, 0x7c, 0xb1, 0x42, 0xaf, 0x22, 0x40, 0x52, 0xe8, 0x49, 0x36,
0x0f, 0x50, 0xd6, 0x34, 0x7a, 0x3e, 0xa6, 0x0b, 0x17, 0x3f, 0xaf, 0x96,
0xf8, 0xc9, 0x67, 0x69, 0x06, 0x05, 0xcd, 0xf8, 0xa2, 0x3a, 0x85, 0x12,
0xb9, 0x70, 0xe9, 0xf7, 0x6c, 0x40, 0x4f, 0x50, 0xc8, 0x49, 0x41, 0x90,
0xc3, 0x33, 0x88, 0x81, 0x59, 0x4d, 0x28, 0x4c, 0xf6, 0x92, 0x0e, 0x69,
0x51, 0x8f, 0x67, 0x1e, 0xe9, 0x1a, 0x06, 0x24, 0x8e, 0x0b, 0x62, 0xda,
0xf9, 0x99, 0xbc, 0x04, 0x10, 0xe2, 0x82, 0xf2, 0x17, 0xe0, 0x8a, 0xe4,
0x20, 0x72, 0x1b, 0xd0, 0x6f, 0x99, 0xf7, 0x49, 0xfd, 0xe6, 0x37, 0xec,
0x8f, 0xc4, 0x6b, 0x47, 0x21, 0xf2, 0x98, 0xdd, 0x77, 0x77, 0x46, 0x22,
0x5f, 0xeb, 0x9e, 0xd1, 0xf9, 0x21, 0x06, 0x05, 0x41, 0xe0, 0xc9, 0xbc,
0xbe, 0x10, 0x9b, 0x1c, 0x20, 0xe4, 0xbb, 0xbe, 0xc9, 0x8f, 0x40, 0x6f,
0x58, 0x59, 0xc6, 0x37, 0xf9, 0x0f, 0x7b, 0x0e, 0x7c, 0x37, 0xcf, 0x00,
0x64, 0xd9, 0x89, 0x06, 0xf0, 0x6c, 0x85, 0x20, 0x41, 0xa4, 0xa1, 0x42,
0xca, 0x3f, 0x39, 0xfe, 0x3a, 0xb3, 0xb9, 0x6c, 0xd7, 0x67, 0x9e, 0xa7,
0x7e, 0x1f, 0xe0, 0xfc, 0xf9, 0xfe, 0x83, 0xee, 0xa7, 0xe8, 0xf7, 0xf0,
0x24, 0x40, 0x46, 0xc8, 0x13, 0xf4, 0x6c, 0x92, 0x57, 0x46, 0x9e, 0x8a,
0x49, 0xeb, 0x7d, 0x06, 0xab, 0xc0, 0x2f, 0x0b, 0x31, 0xdd, 0xf5, 0xc5,
0xa2, 0x75, 0x4d, 0x12, 0x83, 0x17, 0xde, 0x89, 0x9f, 0xe1, 0x33, 0xca,
0x18, 0x54, 0x6e, 0x67, 0x47, 0x50, 0x02, 0x06, 0xbe, 0x1b, 0x3a, 0x8b,
0x23, 0x23, 0xb2, 0x35, 0x37, 0x49, 0xf5, 0x52, 0xf1, 0xbe, 0xfe, 0xbe,
0x7e, 0x30, 0x54, 0x1e, 0xbd, 0x00, 0x50, 0x8e, 0x0d, 0x76, 0xf0, 0x9d,
0x49, 0x5d, 0x18, 0x02, 0xb4, 0xe6, 0xc1, 0x7e, 0x0b, 0xbd, 0x05, 0xc2,
0x97, 0x14, 0xbc, 0x93, 0xf0, 0x1b, 0x0a, 0x69, 0x73, 0x79, 0x87, 0xd8,
0xf1, 0x5f, 0xcf, 0xb1, 0x1f, 0x28, 0x24, 0x9a, 0x14, 0x4c, 0xfb, 0x4d,
0xf1, 0x34, 0x7f, 0xa6, 0xe1, 0x33, 0xb7, 0x76, 0xc8, 0xb7, 0x6f, 0x46,
0xdf, 0xb3, 0xe9, 0x99, 0xfd, 0x77, 0x14, 0x98, 0x8e, 0x76, 0x96, 0xa1,
0xf7, 0x29, 0x34, 0x81, 0xa7, 0x14, 0x52, 0x51, 0x35, 0x54, 0x2f, 0x20,
0xc9, 0x5b, 0x32, 0xb0, 0x95, 0xbc, 0x1b, 0x8a, 0x18, 0x04, 0x84, 0xd8,
0xe8, 0x1b, 0x0f, 0xef, 0xba, 0x01, 0xfd, 0x2b, 0xb4, 0xf4, 0xbb, 0x9f,
0xec, 0x7a, 0x6d, 0xc9, 0x0a, 0x1f, 0xf0, 0x7d, 0x32, 0xa9, 0xb4, 0x0f,
0xbe, 0x9e, 0xe9, 0x25, 0xaa, 0x02, 0xd4, 0x66, 0xb1, 0x6f, 0x99, 0x96,
0x6b, 0x0b, 0x00, 0xe9, 0x72, 0xca, 0x92, 0x61, 0x73, 0x0a, 0x1b, 0x26,
0x3a, 0xdb, 0xef, 0x04, 0x9c, 0xed, 0xde, 0x53, 0xdf, 0x96, 0x57, 0x98,
0x2e, 0xfe, 0x86, 0x17, 0xcc, 0x8d, 0xed, 0xaf, 0x02, 0x25, 0x9f, 0x90,
0x1e, 0xc3, 0xa2, 0x6f, 0xe6, 0x31, 0x57, 0xe5, 0x4c, 0xb6, 0xa6, 0x7e,
0xa6, 0xe6, 0xea, 0x37, 0x3c, 0xb3, 0x4b, 0x77, 0x8b, 0xc3, 0xc5, 0x3f,
0x29, 0x58, 0xd4, 0x1e, 0x10, 0x81, 0xf4, 0x72, 0x6d, 0xf1, 0x77, 0xf8,
0x68, 0xb0, 0xf8, 0xd8, 0x5c, 0x1c, 0x85, 0xcb, 0x79, 0xef, 0x4e, 0x61,
0x6b, 0x2f, 0xcf, 0xfb, 0x37, 0x35, 0xbd, 0xe0, 0x14, 0x9c, 0x7e, 0xe9,
0x29, 0xde, 0x13, 0xbf, 0x83, 0xff, 0x03, 0x0a, 0x13, 0x77, 0x7e, 0x8b,
0x16, 0x70, 0x67, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae,
0x42, 0x60, 0x82
};
const size_t anim_intro_08_png_len = sizeof(anim_intro_08_png) / sizeof(char);
|
the_stack_data/162642784.c | #ifdef OS2
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <dirent.h>
#include <errno.h>
/*#ifndef __EMX__
#include <libx.h>
#endif */
#define INCL_DOSFILEMGR
#define INCL_DOSERRORS
#include <os2.h>
#if OS2 >= 2
# define FFBUF FILEFINDBUF3
# define Word ULONG
/*
* LS20 recommends a request count of 100, but according to the
* APAR text it does not lead to missing files, just to funny
* numbers of returned entries.
*
* LS30 HPFS386 requires a count greater than 2, or some files
* are missing (those starting with a character less that '.').
*
* Novell loses entries which overflow the buffer. In previous
* versions of dirent2, this could have lead to missing files
* when the average length of 100 directory entries was 40 bytes
* or more (quite unlikely for files on a Novell server).
*
* Conclusion: Make sure that the entries all fit into the buffer
* and that the buffer is large enough for more than 2 entries
* (each entry is at most 300 bytes long). And ignore the LS20
* effect.
*/
# define Count 25
# define BufSz (25 * (sizeof(FILEFINDBUF3)+1))
#else
# define FFBUF FILEFINDBUF
# define Word USHORT
# define BufSz 1024
# define Count 3
#endif
#if defined(__IBMC__) || defined(__IBMCPP__)
#define error(rc) _doserrno = rc, errno = EOS2ERR
#elif defined(MICROSOFT)
#define error(rc) _doserrno = rc, errno = 255
#else
#define error(rc) errno = 255
#endif
struct _dirdescr {
HDIR handle; /* DosFindFirst handle */
char fstype; /* filesystem type */
Word count; /* valid entries in <ffbuf> */
long number; /* absolute number of next entry */
int index; /* relative number of next entry */
FFBUF * next; /* pointer to next entry */
char name[MAXPATHLEN+3]; /* directory name */
unsigned attrmask; /* attribute mask for seekdir */
struct dirent entry; /* buffer for directory entry */
BYTE ffbuf[BufSz];
};
/*
* Return first char of filesystem type, or 0 if unknown.
*/
static char
getFSType(const char *path)
{
static char cache[1+26];
char drive[3], info[512];
Word unit, infolen;
char r;
if (isalpha(path[0]) && path[1] == ':') {
unit = toupper(path[0]) - '@';
path += 2;
} else {
ULONG driveMap;
#if OS2 >= 2
if (DosQueryCurrentDisk(&unit, &driveMap))
#else
if (DosQCurDisk(&unit, &driveMap))
#endif
return 0;
}
if ((path[0] == '\\' || path[0] == '/')
&& (path[1] == '\\' || path[1] == '/'))
return 0;
if (cache [unit])
return cache [unit];
drive[0] = '@' + unit;
drive[1] = ':';
drive[2] = '\0';
infolen = sizeof info;
#if OS2 >= 2
if (DosQueryFSAttach(drive, 0, FSAIL_QUERYNAME, (PVOID)info, &infolen))
return 0;
if (infolen >= sizeof(FSQBUFFER2)) {
FSQBUFFER2 *p = (FSQBUFFER2 *)info;
r = p->szFSDName[p->cbName];
} else
#else
if (DosQFSAttach((PSZ)drive, 0, FSAIL_QUERYNAME, (PVOID)info, &infolen, 0))
return 0;
if (infolen >= 9) {
char *p = info + sizeof(USHORT);
p += sizeof(USHORT) + *(USHORT *)p + 1 + sizeof(USHORT);
r = *p;
} else
#endif
r = 0;
return cache [unit] = r;
}
char *
abs_path(const char *name, char *buffer, int len)
{
char buf[4];
if (isalpha(name[0]) && name[1] == ':' && name[2] == '\0') {
buf[0] = name[0];
buf[1] = name[1];
buf[2] = '.';
buf[3] = '\0';
name = buf;
}
#if OS2 >= 2
if (DosQueryPathInfo((PSZ)name, FIL_QUERYFULLNAME, buffer, len))
#else
if (DosQPathInfo((PSZ)name, FIL_QUERYFULLNAME, (PBYTE)buffer, len, 0L))
#endif
return NULL;
return buffer;
}
DIR *
openxdir(const char *path, unsigned att_mask)
{
DIR *dir;
char name[MAXPATHLEN+3];
Word rc;
dir = malloc(sizeof(DIR));
if (dir == NULL) {
errno = ENOMEM;
return NULL;
}
strncpy(name, path, MAXPATHLEN);
name[MAXPATHLEN] = '\0';
switch (name[strlen(name)-1]) {
default:
strcat(name, "\\");
case '\\':
case '/':
case ':':
;
}
strcat(name, ".");
if (!abs_path(name, dir->name, MAXPATHLEN+1))
strcpy(dir->name, name);
if (dir->name[strlen(dir->name)-1] == '\\')
strcat(dir->name, "*");
else
strcat(dir->name, "\\*");
dir->fstype = getFSType(dir->name);
dir->attrmask = att_mask | A_DIR;
dir->handle = HDIR_CREATE;
dir->count = 100;
#if OS2 >= 2
rc = DosFindFirst(dir->name, &dir->handle, dir->attrmask,
dir->ffbuf, sizeof dir->ffbuf, &dir->count, FIL_STANDARD);
#else
rc = DosFindFirst((PSZ)dir->name, &dir->handle, dir->attrmask,
(PFILEFINDBUF)dir->ffbuf, sizeof dir->ffbuf, &dir->count, 0);
#endif
switch (rc) {
default:
free(dir);
error(rc);
return NULL;
case NO_ERROR:
case ERROR_NO_MORE_FILES:
;
}
dir->number = 0;
dir->index = 0;
dir->next = (FFBUF *)dir->ffbuf;
return (DIR *)dir;
}
DIR *
opendir(const char *pathname)
{
return openxdir(pathname, 0);
}
struct dirent *
readdir(DIR *dir)
{
static int dummy_ino = 2;
if (dir->index == dir->count) {
Word rc;
dir->count = 100;
#if OS2 >= 2
rc = DosFindNext(dir->handle, dir->ffbuf,
sizeof dir->ffbuf, &dir->count);
#else
rc = DosFindNext(dir->handle, (PFILEFINDBUF)dir->ffbuf,
sizeof dir->ffbuf, &dir->count);
#endif
if (rc) {
error(rc);
return NULL;
}
dir->index = 0;
dir->next = (FFBUF *)dir->ffbuf;
}
if (dir->index == dir->count)
return NULL;
memcpy(dir->entry.d_name, dir->next->achName, dir->next->cchName);
dir->entry.d_name[dir->next->cchName] = '\0';
dir->entry.d_ino = dummy_ino++;
dir->entry.d_reclen = dir->next->cchName;
dir->entry.d_namlen = dir->next->cchName;
dir->entry.d_size = dir->next->cbFile;
dir->entry.d_attribute = dir->next->attrFile;
dir->entry.d_time = *(USHORT *)&dir->next->ftimeLastWrite;
dir->entry.d_date = *(USHORT *)&dir->next->fdateLastWrite;
switch (dir->fstype) {
case 'F': /* FAT */
case 'C': /* CDFS */
if (dir->next->attrFile & FILE_DIRECTORY)
strupr(dir->entry.d_name);
else
strlwr(dir->entry.d_name);
}
#if OS2 >= 2
dir->next = (FFBUF *)((BYTE *)dir->next + dir->next->oNextEntryOffset);
#else
dir->next = (FFBUF *)((BYTE *)dir->next->achName + dir->next->cchName + 1);
#endif
++dir->number;
++dir->index;
return &dir->entry;
}
long
telldir(DIR *dir)
{
return dir->number;
}
void
seekdir(DIR *dir, long off)
{
if (dir->number > off) {
char name[MAXPATHLEN+2];
Word rc;
DosFindClose(dir->handle);
strcpy(name, dir->name);
strcat(name, "*");
dir->handle = HDIR_CREATE;
dir->count = 32767;
#if OS2 >= 2
rc = DosFindFirst(name, &dir->handle, dir->attrmask,
dir->ffbuf, sizeof dir->ffbuf, &dir->count, FIL_STANDARD);
#else
rc = DosFindFirst((PSZ)name, &dir->handle, dir->attrmask,
(PFILEFINDBUF)dir->ffbuf, sizeof dir->ffbuf, &dir->count, 0);
#endif
switch (rc) {
default:
error(rc);
return;
case NO_ERROR:
case ERROR_NO_MORE_FILES:
;
}
dir->number = 0;
dir->index = 0;
dir->next = (FFBUF *)dir->ffbuf;
}
while (dir->number < off && readdir(dir))
;
}
void
closedir(DIR *dir)
{
DosFindClose(dir->handle);
free(dir);
}
/*****************************************************************************/
#ifdef TEST
main(int argc, char **argv)
{
int i;
DIR *dir;
struct dirent *ep;
for (i = 1; i < argc; ++i) {
dir = opendir(argv[i]);
if (!dir)
continue;
while (ep = readdir(dir))
if (strchr("\\/:", argv[i] [strlen(argv[i]) - 1]))
printf("%s%s\n", argv[i], ep->d_name);
else
printf("%s/%s\n", argv[i], ep->d_name);
closedir(dir);
}
return 0;
}
#endif
#endif /* OS2 */
|
the_stack_data/124784.c | #include<stdio.h>
int main(int argc, char* argv[]){
if (argc < 3) return 1;
int n1,n2,gcd;
// printf("\nEnter two numbers: ");
// scanf("%d %d",&n1,&n2);
n1 = argv[1][0];//75;
n2 = argv[2][0];//15;
gcd=findgcd(n1,n2);
printf("GCD of %d and %d is: %d\n",n1,n2,gcd);
return 0;
}
int findgcd(int x,int y){
while(x!=y){
if(x>y)
return findgcd(x-y,y);
else
return findgcd(x,y-x);
}
return x;
}
|
the_stack_data/51701330.c | /**********
* ZUCC Cprograming task
* Author: Takuron@github
**********/
#include <stdio.h>
int main () {
char istr[81],ch;
int ii;
ch=getchar();
for(ii=0;ch!='\n';ii++){
istr[ii] = ch;
ch = getchar();
}
istr[ii+1] = '\0';
char ostr[ii+2];
int oi = 0;
int i;
for(i=0;i<ii+1;i++){
ostr[i] = istr[ii-i-1];
}
ostr[ii+1]= '\0';
while(ostr[oi]!='\0'){
putchar(ostr[oi]);
oi++;
}
return 0;
}
|
the_stack_data/1183491.c | #include <stdio.h>
int main(void) {
int i = 0;
int* ptr;
int** ptrptr;
ptr = &i;
ptrptr = &ptr;
i = 1;
printf("i=%d\n", i);
printf("*ptr=%d\n", *ptr);
printf("**ptrptr=%d\n", **ptrptr);
printf("i=%d\n", i);
return 0;
} |
the_stack_data/192330460.c | #include <stdio.h>
#include <stdlib.h>
int main()
{
int n, k;
int *array;
scanf("%d%d", &n, &k);
array = (int*)malloc(n*sizeof(int));
scanf("%d", &array[0]);
long long int sum = 0;
for (int i = 1; i < n; i++)
{
scanf("%d", &array[i]);
sum += array[i - 1] * array[i];
}
sum += array[n - 1] * array[0];
for (int i = 0; i < k; i++)
{
int capital;
scanf("%d", &capital);
capital--;
for (int j = 0; j < n; j++)
{
if (capital == 0 )
{
if ( j != n - 1 && j != capital && j!=capital+1)
{
sum += array[capital] * array[j];
}
}
else if (capital == n - 1)
{
if (j != capital - 1 && j!=capital && j != 0 )
{
sum += array[capital] * array[j];
}
}
else
{
if (j != capital - 1 && j != capital && j != capital + 1)
{
sum += array[capital] * array[j];
}
}
}
array[capital] = 0;
}
printf("%lld\n", sum);
return 0;
}
|
the_stack_data/1144691.c | #include<math.h>
#include<stdio.h>
#include<stdlib.h>
double *function_values(int number_of_breaks, double lower_limit, double gap_lenght) {
double *values = (double *)(malloc(sizeof(double)*(number_of_breaks + 1)));
double Xi = lower_limit;
for (int i = 0; i <= number_of_breaks; i++) {
values[i] = sin(Xi);
Xi += gap_lenght;
}
return values;
}
double integral_calculations(double lower_limit, double upper_limit, int number_of_breaks) {
double gap_lenght = ((upper_limit)-(lower_limit)) / (double)number_of_breaks;
double *values = function_values(number_of_breaks, lower_limit, gap_lenght);
double summ = 0;
for (int i = 0; i < number_of_breaks; i++)
summ += ((values[i] + values[i + 1]) / 2)*gap_lenght;
free(values);
return summ;
}
int main(void) {
while (1) {
double lower_limit = 0, upper_limit = 0;
int number_of_breaks = 0;
char marker;
printf("Hi I am calculating the integral functions f(x) = 3*x - cos(x) - 1\n");
while (1) {
printf("Enter the limits of integration:\n");
printf("From: ");
scanf_s("%lf", &lower_limit);
printf("up: ");
scanf_s("%lf", &upper_limit);
printf("Enter the number of breaks:");
scanf_s("%d", &number_of_breaks);
if (((number_of_breaks == 0) || (upper_limit - lower_limit) == 0)) {
printf("Uncorect enter\n");
}
else break;
}
printf("%lf", integral_calculations(lower_limit, upper_limit, number_of_breaks));
printf("\nWould you like to repeat the calculation? \nEnter Y or N \n");
char MyChar;
do {
MyChar = getch();
if (123 > MyChar & MyChar > 96) MyChar = MyChar - 32;
if (MyChar == 'N')
{
printf("End work"); return 0;
}
if (MyChar != 'Y');
else break;
} while (1);
}
} |
the_stack_data/33379.c | #include <stdio.h>
#include <stdlib.h>
#define MAX_HEIGHT 41
struct box
{
int length,width,height;
/**
* Define three fields of type int: length, width and height
*/
};
typedef struct box box;
int get_volume(box b) {
int j=b.length*b.width*b.height;
return j;
/**
* Return the volume of the box
*/
}
int is_lower_than_max_height(box b) {
if(b.height>=41)
{
return 0;
}else{
return 1;
}
/**
* Return 1 if the box's height is lower than MAX_HEIGHT and 0 otherwise
*/
}
int main()
{
int n;
scanf("%d", &n);
box *boxes = malloc(n * sizeof(box));
for (int i = 0; i < n; i++) {
scanf("%d%d%d", &boxes[i].length, &boxes[i].width, &boxes[i].height);
}
for (int i = 0; i < n; i++) {
if (is_lower_than_max_height(boxes[i])) {
printf("%d\n", get_volume(boxes[i]));
}
}
return 0;
}
|
the_stack_data/34512702.c | #include <stdio.h>
#include<stdlib.h>
void printArr(int arr[], int n){
for(int i=0; i<n; i++){
printf("%d ", arr[i]);
}
}
void selectionSort(int arr[], int n){
int i, j, min_index, temp;
for(i=0; i<n; i++){
min_index = i;
for(j=i+1; j<n; j++){
if(arr[j] < arr[min_index])
min_index = j;
}
temp = arr[min_index];
arr[min_index] = arr[i];
arr[i] = temp;
}
printArr(arr, n);
}
void insertionSort(int arr[], int n){
int i, key, j;
for (i = 1; i < n; i++){
key = arr[i];
j = i - 1;
while (j >= 0 && arr[j] > key){
arr[j + 1] = arr[j];
j = j - 1;
}
arr[j + 1] = key;
}
printArr(arr, n);
}
int main(void) {
int choice, isWorking = 1;
while(isWorking){
int i,size,arr[20];
printf("\nMethods:\n1)Create Array\n2)Selection Sort\n3)Insertion Sort\n4)Exit\nEnter your choice: ");
scanf("%d", &choice);
switch(choice){
case 1:
printf("\nTo create a array, Enter size of array: ");
scanf("%d", &size);
printf("Enter all elements of array: ");
for(i = 0; i<size; i++){
scanf("%d", &arr[i]);
}
printf("\n\nGiven array is : ");
printArr(arr, size);
break;
case 2:
printf("Array After Sorting: ");
selectionSort(arr, size);
break;
case 3:
printf("Array After Sorting: ");
insertionSort(arr, size);
break;
case 4:
isWorking = 0;
break;
default:
printf("Enter valid option.\n");
}
}
}
|
the_stack_data/16827.c | /*
* return nth fibonacci sequence number
*/
#include <stdio.h>
long fibonacci(int n)
{
long prev;
long temp;
long result;
prev = result = 1;
while( n > 2 ) {
--n;
temp = result;
result += prev;
prev = temp;
}
return result;
}
// driver code
int main( int argc, char *argv[] )
{
fibonacci(18);
return 0;
}
|
the_stack_data/699599.c | int main() {
int a[1] = { 42 };
return ((&a)[0])[0];
}
|
the_stack_data/59523.c | #include<stdio.h>
void ActionCarrier(int(*action)(int, int), int a, int b);
int sum(int a, int b);
int difference(int a, int b);
int product(int a, int b);
int quotient(int a, int b);
int modulus(int a, int b);
int main(){
int a = 20, b = 7;
ActionCarrier(sum, a, b);
ActionCarrier(difference, a, b);
ActionCarrier(product, a, b);
ActionCarrier(quotient, a, b);
ActionCarrier(modulus, a, b);
}
void ActionCarrier(int(*action)(int, int), int a, int b){
printf("\n%d %p %d = %d", a, action, b, action(a, b));
}
int sum(int a, int b){
return a + b;
}
int difference(int a, int b){
return a - b;
}
int product(int a, int b){
return a*b;
}
int quotient(int a, int b){
return a / b;
}
int modulus(int a, int b){
return a%b;
}
|
the_stack_data/151092.c | #include <stdio.h>
#include <pthread.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
void *first_func(void *arg)
{
/*int ret = pthread_detach(pthread_self());
if(ret != 0)
{
printf("detach fail\n");
exit(0);
}*/
int i;
//pthread_exit((void *)1);
for(i= 0; i<5; i++)
{
printf("first thread...\n");
sleep(1);
}
printf("child thread done\n");
//pthread_detach(pthread_self());
pthread_exit((void *)3);
//return NULL;
//exit(0);
}
int main()
{
//return 0;
int err, i;
void *retval1,*retval2;
pthread_t tid1, tid2;
err = pthread_create(&tid1, NULL, (void *)first_func, NULL);
//pthread_exit((void *)1);
if(err != 0)
{
char *p = strerror(err);
printf("%s\n", p);
//perror("creat");
return -1;
}
sleep(1);
//pthread_detach(tid1);
void *retval;
int errn = pthread_join(tid1, (void **)&retval);
printf("retval = %d\n", (int *)retval); //有问题,存放指针变量的地址的变量就是二级指针
if(errn != 0)
{
char *p = strerror(errno);
printf("p = %s\n", p);
//printf("join errno = %d, errn %d\n", errno, errn);
return -1;
}
//printf("ret code = %p\n", (int *)retval1);
for(i=0; i<10; i++)
{
printf("main thread......\n");
sleep(1);
}
printf("exit....\n");
return 0;
}
|
the_stack_data/1424.c | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
typedef struct
{
char nome[30];
int numConta;
float saldo;
} stContaCliente;
#define LIMITE 15
int main()
{
stContaCliente contas[LIMITE];
int LIM = LIMITE, v = 1;
int op = 1; //default op
char fnome[30];
float msaldo;
srand(time(NULL));
while (v)
{
printf("Sistema Bancario UNIBank\n");
printf("Bem Vindo Admin. \
\nDeseja: \
\n1- Cadastrar novas contas. \
\n2- Visualizar contas de um cliente. \
\n3- Excluir conta com o menor saldo. \
\n4- Sair \n");
scanf("%d", &op);
switch (op)
{
case 1:
printf("\nVoce escolheu: Cadastrar novas contas.\n");
for (int i = 0; i < LIM; i++)
{
printf("Digite o primeiro nome do titular: ");
scanf("%s", contas[i].nome);
contas[i].numConta = rand() % 10000;
printf("Conta criada com o número: %d\n", contas[i].numConta);
printf("Digite o saldo inicial: ");
scanf("%f", &contas[i].saldo);
}
getchar();
break;
case 2:
printf("\nVoce escolheu: Visualisar contas de um cliente.\n");
printf("Digite o primeiro nome do titular: ");
scanf("%s", fnome);
for (int i = 0; i < LIM; i++)
{
if (strcmp(fnome, contas[i].nome) == 0)
{
printf("Numero da conta encontrada: %d\nSaldo da conta: %.2f\n", contas[i].numConta, contas[i].saldo);
}
}
getchar();
getchar();
break;
case 3:
printf("\nVoce escolheu: Excluir conta com o menor saldo.\n");
msaldo = contas[0].saldo;
for (int i = 0; i < LIM; i++)
{
if (msaldo > contas[i].saldo)
{
msaldo = contas[i].saldo;
}
}
for (int i = 0; i < LIM; i++)
{
if (msaldo == contas[i].saldo) //tirar do ranger
{
contas[i] = contas[LIM - 1]; //recebe dados do ultimo elemento
contas[LIM - 1] = contas[i];
LIM--;
}
}
getchar();
getchar();
break;
default:
v = 0;
break;
}
}
} |
the_stack_data/34511892.c | foo (a)
double a;
{
printf ("%d\n", (int) a);
}
main ()
{
foo (1.6);
foo (1.4);
foo (-1.4);
foo (-1.6);
}
|
the_stack_data/138958.c | typedef unsigned int size_t;
typedef unsigned int wchar_t;
typedef int ptrdiff_t;
typedef struct {
long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
} max_align_t;
typedef signed char __int8_t;
typedef unsigned char __uint8_t;
typedef short int __int16_t;
typedef short unsigned int __uint16_t;
typedef long int __int32_t;
typedef long unsigned int __uint32_t;
typedef long long int __int64_t;
typedef long long unsigned int __uint64_t;
typedef signed char __int_least8_t;
typedef unsigned char __uint_least8_t;
typedef short int __int_least16_t;
typedef short unsigned int __uint_least16_t;
typedef long int __int_least32_t;
typedef long unsigned int __uint_least32_t;
typedef long long int __int_least64_t;
typedef long long unsigned int __uint_least64_t;
typedef int __intptr_t;
typedef unsigned int __uintptr_t;
typedef int _LOCK_T;
typedef int _LOCK_RECURSIVE_T;
typedef long __blkcnt_t;
typedef long __blksize_t;
typedef __uint64_t __fsblkcnt_t;
typedef __uint32_t __fsfilcnt_t;
typedef long _off_t;
typedef int __pid_t;
typedef short __dev_t;
typedef unsigned short __uid_t;
typedef unsigned short __gid_t;
typedef __uint32_t __id_t;
typedef unsigned short __ino_t;
typedef __uint32_t __mode_t;
__extension__ typedef long long _off64_t;
typedef _off_t __off_t;
typedef _off64_t __loff_t;
typedef long __key_t;
typedef long _fpos_t;
typedef unsigned int __size_t;
typedef signed int _ssize_t;
typedef _ssize_t __ssize_t;
typedef unsigned int wint_t;
typedef struct
{
int __count;
union
{
wint_t __wch;
unsigned char __wchb[4];
} __value;
} _mbstate_t;
typedef _LOCK_RECURSIVE_T _flock_t;
typedef void *_iconv_t;
typedef unsigned long __clock_t;
typedef long __time_t;
typedef unsigned long __clockid_t;
typedef unsigned long __timer_t;
typedef __uint8_t __sa_family_t;
typedef __uint32_t __socklen_t;
typedef unsigned short __nlink_t;
typedef long __suseconds_t;
typedef unsigned long __useconds_t;
typedef char * __va_list;
typedef unsigned long __ULong;
struct _reent;
struct __locale_t;
struct _Bigint
{
struct _Bigint *_next;
int _k, _maxwds, _sign, _wds;
__ULong _x[1];
};
struct __tm
{
int __tm_sec;
int __tm_min;
int __tm_hour;
int __tm_mday;
int __tm_mon;
int __tm_year;
int __tm_wday;
int __tm_yday;
int __tm_isdst;
};
struct _on_exit_args {
void * _fnargs[32];
void * _dso_handle[32];
__ULong _fntypes;
__ULong _is_cxa;
};
struct _atexit {
struct _atexit *_next;
int _ind;
void (*_fns[32])(void);
struct _on_exit_args _on_exit_args;
};
struct __sbuf {
unsigned char *_base;
int _size;
};
struct __sFILE {
unsigned char *_p;
int _r;
int _w;
short _flags;
short _file;
struct __sbuf _bf;
int _lbfsize;
void * _cookie;
int (* _read) (struct _reent *, void *, char *, int)
;
int (* _write) (struct _reent *, void *, const char *, int)
;
_fpos_t (* _seek) (struct _reent *, void *, _fpos_t, int);
int (* _close) (struct _reent *, void *);
struct __sbuf _ub;
unsigned char *_up;
int _ur;
unsigned char _ubuf[3];
unsigned char _nbuf[1];
struct __sbuf _lb;
int _blksize;
_off_t _offset;
struct _reent *_data;
_flock_t _lock;
_mbstate_t _mbstate;
int _flags2;
};
typedef struct __sFILE __FILE;
struct _glue
{
struct _glue *_next;
int _niobs;
__FILE *_iobs;
};
struct _rand48 {
unsigned short _seed[3];
unsigned short _mult[3];
unsigned short _add;
};
struct _reent
{
int _errno;
__FILE *_stdin, *_stdout, *_stderr;
int _inc;
char _emergency[25];
int _unspecified_locale_info;
struct __locale_t *_locale;
int __sdidinit;
void (* __cleanup) (struct _reent *);
struct _Bigint *_result;
int _result_k;
struct _Bigint *_p5s;
struct _Bigint **_freelist;
int _cvtlen;
char *_cvtbuf;
union
{
struct
{
unsigned int _unused_rand;
char * _strtok_last;
char _asctime_buf[26];
struct __tm _localtime_buf;
int _gamma_signgam;
__extension__ unsigned long long _rand_next;
struct _rand48 _r48;
_mbstate_t _mblen_state;
_mbstate_t _mbtowc_state;
_mbstate_t _wctomb_state;
char _l64a_buf[8];
char _signal_buf[24];
int _getdate_err;
_mbstate_t _mbrlen_state;
_mbstate_t _mbrtowc_state;
_mbstate_t _mbsrtowcs_state;
_mbstate_t _wcrtomb_state;
_mbstate_t _wcsrtombs_state;
int _h_errno;
} _reent;
struct
{
unsigned char * _nextf[30];
unsigned int _nmalloc[30];
} _unused;
} _new;
struct _atexit *_atexit;
struct _atexit _atexit0;
void (**(_sig_func))(int);
struct _glue __sglue;
__FILE __sf[3];
};
extern struct _reent *_impure_ptr ;
extern struct _reent *const _global_impure_ptr ;
void _reclaim_reent (struct _reent *);
typedef struct
{
int quot;
int rem;
} div_t;
typedef struct
{
long quot;
long rem;
} ldiv_t;
typedef struct
{
long long int quot;
long long int rem;
} lldiv_t;
typedef int (*__compar_fn_t) (const void *, const void *);
int __locale_mb_cur_max (void);
void abort (void) __attribute__ ((__noreturn__));
int abs (int);
__uint32_t arc4random (void);
__uint32_t arc4random_uniform (__uint32_t);
void arc4random_buf (void *, size_t);
int atexit (void (*__func)(void));
double atof (const char *__nptr);
float atoff (const char *__nptr);
int atoi (const char *__nptr);
int _atoi_r (struct _reent *, const char *__nptr);
long atol (const char *__nptr);
long _atol_r (struct _reent *, const char *__nptr);
void * bsearch (const void * __key, const void * __base, size_t __nmemb, size_t __size, __compar_fn_t _compar)
;
void * calloc (size_t __nmemb, size_t __size) ;
div_t div (int __numer, int __denom);
void exit (int __status) __attribute__ ((__noreturn__));
void free (void *) ;
char * getenv (const char *__string);
char * _getenv_r (struct _reent *, const char *__string);
char * _findenv (const char *, int *);
char * _findenv_r (struct _reent *, const char *, int *);
extern char *suboptarg;
int getsubopt (char **, char * const *, char **);
long labs (long);
ldiv_t ldiv (long __numer, long __denom);
void * malloc (size_t __size) ;
int mblen (const char *, size_t);
int _mblen_r (struct _reent *, const char *, size_t, _mbstate_t *);
int mbtowc (wchar_t *restrict, const char *restrict, size_t);
int _mbtowc_r (struct _reent *, wchar_t *restrict, const char *restrict, size_t, _mbstate_t *);
int wctomb (char *, wchar_t);
int _wctomb_r (struct _reent *, char *, wchar_t, _mbstate_t *);
size_t mbstowcs (wchar_t *restrict, const char *restrict, size_t);
size_t _mbstowcs_r (struct _reent *, wchar_t *restrict, const char *restrict, size_t, _mbstate_t *);
size_t wcstombs (char *restrict, const wchar_t *restrict, size_t);
size_t _wcstombs_r (struct _reent *, char *restrict, const wchar_t *restrict, size_t, _mbstate_t *);
char * mkdtemp (char *);
int mkstemp (char *);
int mkstemps (char *, int);
char * mktemp (char *) __attribute__ ((__deprecated__("the use of `mktemp' is dangerous; use `mkstemp' instead")));
char * _mkdtemp_r (struct _reent *, char *);
int _mkostemp_r (struct _reent *, char *, int);
int _mkostemps_r (struct _reent *, char *, int, int);
int _mkstemp_r (struct _reent *, char *);
int _mkstemps_r (struct _reent *, char *, int);
char * _mktemp_r (struct _reent *, char *) __attribute__ ((__deprecated__("the use of `mktemp' is dangerous; use `mkstemp' instead")));
void qsort (void * __base, size_t __nmemb, size_t __size, __compar_fn_t _compar);
int rand (void);
void * realloc (void * __r, size_t __size) ;
void * reallocf (void * __r, size_t __size);
char * realpath (const char *restrict path, char *restrict resolved_path);
int rpmatch (const char *response);
void srand (unsigned __seed);
double strtod (const char *restrict __n, char **restrict __end_PTR);
double _strtod_r (struct _reent *,const char *restrict __n, char **restrict __end_PTR);
float strtof (const char *restrict __n, char **restrict __end_PTR);
long strtol (const char *restrict __n, char **restrict __end_PTR, int __base);
long _strtol_r (struct _reent *,const char *restrict __n, char **restrict __end_PTR, int __base);
unsigned long strtoul (const char *restrict __n, char **restrict __end_PTR, int __base);
unsigned long _strtoul_r (struct _reent *,const char *restrict __n, char **restrict __end_PTR, int __base);
int system (const char *__string);
long a64l (const char *__input);
char * l64a (long __input);
char * _l64a_r (struct _reent *,long __input);
int on_exit (void (*__func)(int, void *),void * __arg);
void _Exit (int __status) __attribute__ ((__noreturn__));
int putenv (char *__string);
int _putenv_r (struct _reent *, char *__string);
void * _reallocf_r (struct _reent *, void *, size_t);
int setenv (const char *__string, const char *__value, int __overwrite);
int _setenv_r (struct _reent *, const char *__string, const char *__value, int __overwrite);
char * __itoa (int, char *, int);
char * __utoa (unsigned, char *, int);
char * itoa (int, char *, int);
char * utoa (unsigned, char *, int);
int rand_r (unsigned *__seed);
double drand48 (void);
double _drand48_r (struct _reent *);
double erand48 (unsigned short [3]);
double _erand48_r (struct _reent *, unsigned short [3]);
long jrand48 (unsigned short [3]);
long _jrand48_r (struct _reent *, unsigned short [3]);
void lcong48 (unsigned short [7]);
void _lcong48_r (struct _reent *, unsigned short [7]);
long lrand48 (void);
long _lrand48_r (struct _reent *);
long mrand48 (void);
long _mrand48_r (struct _reent *);
long nrand48 (unsigned short [3]);
long _nrand48_r (struct _reent *, unsigned short [3]);
unsigned short *
seed48 (unsigned short [3]);
unsigned short *
_seed48_r (struct _reent *, unsigned short [3]);
void srand48 (long);
void _srand48_r (struct _reent *, long);
char * initstate (unsigned, char *, size_t);
long random (void);
char * setstate (char *);
void srandom (unsigned);
long long atoll (const char *__nptr);
long long _atoll_r (struct _reent *, const char *__nptr);
long long llabs (long long);
lldiv_t lldiv (long long __numer, long long __denom);
long long strtoll (const char *restrict __n, char **restrict __end_PTR, int __base);
long long _strtoll_r (struct _reent *, const char *restrict __n, char **restrict __end_PTR, int __base);
unsigned long long strtoull (const char *restrict __n, char **restrict __end_PTR, int __base);
unsigned long long _strtoull_r (struct _reent *, const char *restrict __n, char **restrict __end_PTR, int __base);
void cfree (void *);
int unsetenv (const char *__string);
int _unsetenv_r (struct _reent *, const char *__string);
int __attribute__((__nonnull__(1))) posix_memalign (void **, size_t, size_t);
char * _dtoa_r (struct _reent *, double, int, int, int *, int*, char**);
void * _malloc_r (struct _reent *, size_t) ;
void * _calloc_r (struct _reent *, size_t, size_t) ;
void _free_r (struct _reent *, void *) ;
void * _realloc_r (struct _reent *, void *, size_t) ;
void _mstats_r (struct _reent *, char *);
int _system_r (struct _reent *, const char *);
void __eprintf (const char *, const char *, unsigned int, const char *);
void qsort_r (void * __base, size_t __nmemb, size_t __size, void * __thunk, int (*_compar)(void *, const void *, const void *))
__asm__ ("" "__bsd_qsort_r");
extern long double _strtold_r (struct _reent *, const char *restrict, char **restrict);
extern long double strtold (const char *restrict, char **restrict);
void * aligned_alloc(size_t, size_t) __attribute__((__malloc__)) __attribute__((__alloc_align__(1)))
__attribute__((__alloc_size__(2)));
int at_quick_exit(void (*)(void));
_Noreturn void
quick_exit(int);
typedef __int8_t int8_t ;
typedef __uint8_t uint8_t ;
typedef __int16_t int16_t ;
typedef __uint16_t uint16_t ;
typedef __int32_t int32_t ;
typedef __uint32_t uint32_t ;
typedef __int64_t int64_t ;
typedef __uint64_t uint64_t ;
typedef __intptr_t intptr_t;
typedef __uintptr_t uintptr_t;
typedef __int_least8_t int_least8_t;
typedef __uint_least8_t uint_least8_t;
typedef __int_least16_t int_least16_t;
typedef __uint_least16_t uint_least16_t;
typedef __int_least32_t int_least32_t;
typedef __uint_least32_t uint_least32_t;
typedef __int_least64_t int_least64_t;
typedef __uint_least64_t uint_least64_t;
typedef int int_fast8_t;
typedef unsigned int uint_fast8_t;
typedef int int_fast16_t;
typedef unsigned int uint_fast16_t;
typedef int int_fast32_t;
typedef unsigned int uint_fast32_t;
typedef long long int int_fast64_t;
typedef long long unsigned int uint_fast64_t;
typedef long long int intmax_t;
typedef long long unsigned int uintmax_t;
typedef enum {
Reset_IRQn = -15,
NonMaskableInt_IRQn = -14,
HardFault_IRQn = -13,
MemoryManagement_IRQn = -12,
BusFault_IRQn = -11,
UsageFault_IRQn = -10,
SVCall_IRQn = -5,
DebugMonitor_IRQn = -4,
PendSV_IRQn = -2,
SysTick_IRQn = -1,
POWER_CLOCK_IRQn = 0,
RADIO_IRQn = 1,
UARTE0_UART0_IRQn = 2,
SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQn= 3,
SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQn= 4,
NFCT_IRQn = 5,
GPIOTE_IRQn = 6,
SAADC_IRQn = 7,
TIMER0_IRQn = 8,
TIMER1_IRQn = 9,
TIMER2_IRQn = 10,
RTC0_IRQn = 11,
TEMP_IRQn = 12,
RNG_IRQn = 13,
ECB_IRQn = 14,
CCM_AAR_IRQn = 15,
WDT_IRQn = 16,
RTC1_IRQn = 17,
QDEC_IRQn = 18,
COMP_LPCOMP_IRQn = 19,
SWI0_EGU0_IRQn = 20,
SWI1_EGU1_IRQn = 21,
SWI2_EGU2_IRQn = 22,
SWI3_EGU3_IRQn = 23,
SWI4_EGU4_IRQn = 24,
SWI5_EGU5_IRQn = 25,
TIMER3_IRQn = 26,
TIMER4_IRQn = 27,
PWM0_IRQn = 28,
PDM_IRQn = 29,
MWU_IRQn = 32,
PWM1_IRQn = 33,
PWM2_IRQn = 34,
SPIM2_SPIS2_SPI2_IRQn = 35,
RTC2_IRQn = 36,
I2S_IRQn = 37,
FPU_IRQn = 38,
USBD_IRQn = 39,
UARTE1_IRQn = 40,
QSPI_IRQn = 41,
CRYPTOCELL_IRQn = 42,
PWM3_IRQn = 45,
SPIM3_IRQn = 47
} IRQn_Type;
__attribute__( ( always_inline ) ) static inline void __enable_irq(void)
{
__asm volatile ("cpsie i" : : : "memory");
}
__attribute__( ( always_inline ) ) static inline void __disable_irq(void)
{
__asm volatile ("cpsid i" : : : "memory");
}
__attribute__( ( always_inline ) ) static inline uint32_t __get_CONTROL(void)
{
uint32_t result;
__asm volatile ("MRS %0, control" : "=r" (result) );
return(result);
}
__attribute__( ( always_inline ) ) static inline void __set_CONTROL(uint32_t control)
{
__asm volatile ("MSR control, %0" : : "r" (control) : "memory");
}
__attribute__( ( always_inline ) ) static inline uint32_t __get_IPSR(void)
{
uint32_t result;
__asm volatile ("MRS %0, ipsr" : "=r" (result) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __get_APSR(void)
{
uint32_t result;
__asm volatile ("MRS %0, apsr" : "=r" (result) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __get_xPSR(void)
{
uint32_t result;
__asm volatile ("MRS %0, xpsr" : "=r" (result) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __get_PSP(void)
{
register uint32_t result;
__asm volatile ("MRS %0, psp\n" : "=r" (result) );
return(result);
}
__attribute__( ( always_inline ) ) static inline void __set_PSP(uint32_t topOfProcStack)
{
__asm volatile ("MSR psp, %0\n" : : "r" (topOfProcStack) : "sp");
}
__attribute__( ( always_inline ) ) static inline uint32_t __get_MSP(void)
{
register uint32_t result;
__asm volatile ("MRS %0, msp\n" : "=r" (result) );
return(result);
}
__attribute__( ( always_inline ) ) static inline void __set_MSP(uint32_t topOfMainStack)
{
__asm volatile ("MSR msp, %0\n" : : "r" (topOfMainStack) : "sp");
}
__attribute__( ( always_inline ) ) static inline uint32_t __get_PRIMASK(void)
{
uint32_t result;
__asm volatile ("MRS %0, primask" : "=r" (result) );
return(result);
}
__attribute__( ( always_inline ) ) static inline void __set_PRIMASK(uint32_t priMask)
{
__asm volatile ("MSR primask, %0" : : "r" (priMask) : "memory");
}
__attribute__( ( always_inline ) ) static inline void __enable_fault_irq(void)
{
__asm volatile ("cpsie f" : : : "memory");
}
__attribute__( ( always_inline ) ) static inline void __disable_fault_irq(void)
{
__asm volatile ("cpsid f" : : : "memory");
}
__attribute__( ( always_inline ) ) static inline uint32_t __get_BASEPRI(void)
{
uint32_t result;
__asm volatile ("MRS %0, basepri" : "=r" (result) );
return(result);
}
__attribute__( ( always_inline ) ) static inline void __set_BASEPRI(uint32_t value)
{
__asm volatile ("MSR basepri, %0" : : "r" (value) : "memory");
}
__attribute__( ( always_inline ) ) static inline void __set_BASEPRI_MAX(uint32_t value)
{
__asm volatile ("MSR basepri_max, %0" : : "r" (value) : "memory");
}
__attribute__( ( always_inline ) ) static inline uint32_t __get_FAULTMASK(void)
{
uint32_t result;
__asm volatile ("MRS %0, faultmask" : "=r" (result) );
return(result);
}
__attribute__( ( always_inline ) ) static inline void __set_FAULTMASK(uint32_t faultMask)
{
__asm volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory");
}
__attribute__( ( always_inline ) ) static inline uint32_t __get_FPSCR(void)
{
return(0);
}
__attribute__( ( always_inline ) ) static inline void __set_FPSCR(uint32_t fpscr)
{
}
__attribute__((always_inline)) static inline void __NOP(void)
{
__asm volatile ("nop");
}
__attribute__((always_inline)) static inline void __WFI(void)
{
__asm volatile ("wfi");
}
__attribute__((always_inline)) static inline void __WFE(void)
{
__asm volatile ("wfe");
}
__attribute__((always_inline)) static inline void __SEV(void)
{
__asm volatile ("sev");
}
__attribute__((always_inline)) static inline void __ISB(void)
{
__asm volatile ("isb 0xF":::"memory");
}
__attribute__((always_inline)) static inline void __DSB(void)
{
__asm volatile ("dsb 0xF":::"memory");
}
__attribute__((always_inline)) static inline void __DMB(void)
{
__asm volatile ("dmb 0xF":::"memory");
}
__attribute__((always_inline)) static inline uint32_t __REV(uint32_t value)
{
return __builtin_bswap32(value);
}
__attribute__((always_inline)) static inline uint32_t __REV16(uint32_t value)
{
uint32_t result;
__asm volatile ("rev16 %0, %1" : "=r" (result) : "r" (value) );
return(result);
}
__attribute__((always_inline)) static inline int32_t __REVSH(int32_t value)
{
return (short)__builtin_bswap16(value);
}
__attribute__((always_inline)) static inline uint32_t __ROR(uint32_t op1, uint32_t op2)
{
return (op1 >> op2) | (op1 << (32U - op2));
}
__attribute__((always_inline)) static inline uint32_t __RBIT(uint32_t value)
{
uint32_t result;
__asm volatile ("rbit %0, %1" : "=r" (result) : "r" (value) );
return(result);
}
__attribute__((always_inline)) static inline uint8_t __LDREXB(volatile uint8_t *addr)
{
uint32_t result;
__asm volatile ("ldrexb %0, %1" : "=r" (result) : "Q" (*addr) );
return ((uint8_t) result);
}
__attribute__((always_inline)) static inline uint16_t __LDREXH(volatile uint16_t *addr)
{
uint32_t result;
__asm volatile ("ldrexh %0, %1" : "=r" (result) : "Q" (*addr) );
return ((uint16_t) result);
}
__attribute__((always_inline)) static inline uint32_t __LDREXW(volatile uint32_t *addr)
{
uint32_t result;
__asm volatile ("ldrex %0, %1" : "=r" (result) : "Q" (*addr) );
return(result);
}
__attribute__((always_inline)) static inline uint32_t __STREXB(uint8_t value, volatile uint8_t *addr)
{
uint32_t result;
__asm volatile ("strexb %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) );
return(result);
}
__attribute__((always_inline)) static inline uint32_t __STREXH(uint16_t value, volatile uint16_t *addr)
{
uint32_t result;
__asm volatile ("strexh %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) );
return(result);
}
__attribute__((always_inline)) static inline uint32_t __STREXW(uint32_t value, volatile uint32_t *addr)
{
uint32_t result;
__asm volatile ("strex %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" (value) );
return(result);
}
__attribute__((always_inline)) static inline void __CLREX(void)
{
__asm volatile ("clrex" ::: "memory");
}
__attribute__((always_inline)) static inline uint32_t __RRX(uint32_t value)
{
uint32_t result;
__asm volatile ("rrx %0, %1" : "=r" (result) : "r" (value) );
return(result);
}
__attribute__((always_inline)) static inline uint8_t __LDRBT(volatile uint8_t *addr)
{
uint32_t result;
__asm volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*addr) );
return ((uint8_t) result);
}
__attribute__((always_inline)) static inline uint16_t __LDRHT(volatile uint16_t *addr)
{
uint32_t result;
__asm volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*addr) );
return ((uint16_t) result);
}
__attribute__((always_inline)) static inline uint32_t __LDRT(volatile uint32_t *addr)
{
uint32_t result;
__asm volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*addr) );
return(result);
}
__attribute__((always_inline)) static inline void __STRBT(uint8_t value, volatile uint8_t *addr)
{
__asm volatile ("strbt %1, %0" : "=Q" (*addr) : "r" ((uint32_t)value) );
}
__attribute__((always_inline)) static inline void __STRHT(uint16_t value, volatile uint16_t *addr)
{
__asm volatile ("strht %1, %0" : "=Q" (*addr) : "r" ((uint32_t)value) );
}
__attribute__((always_inline)) static inline void __STRT(uint32_t value, volatile uint32_t *addr)
{
__asm volatile ("strt %1, %0" : "=Q" (*addr) : "r" (value) );
}
__attribute__( ( always_inline ) ) static inline uint32_t __SADD8(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("sadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __QADD8(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("qadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __SHADD8(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("shadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __UADD8(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("uadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __UQADD8(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("uqadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __UHADD8(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("uhadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __SSUB8(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("ssub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __QSUB8(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("qsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __SHSUB8(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("shsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __USUB8(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("usub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __UQSUB8(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("uqsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __UHSUB8(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("uhsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __SADD16(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("sadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __QADD16(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("qadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __SHADD16(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("shadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __UADD16(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("uadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __UQADD16(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("uqadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __UHADD16(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("uhadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __SSUB16(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("ssub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __QSUB16(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("qsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __SHSUB16(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("shsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __USUB16(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("usub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __UQSUB16(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("uqsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __UHSUB16(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("uhsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __SASX(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("sasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __QASX(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("qasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __SHASX(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("shasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __UASX(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("uasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __UQASX(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("uqasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __UHASX(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("uhasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __SSAX(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("ssax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __QSAX(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("qsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __SHSAX(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("shsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __USAX(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("usax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __UQSAX(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("uqsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __UHSAX(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("uhsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __USAD8(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("usad8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __USADA8(uint32_t op1, uint32_t op2, uint32_t op3)
{
uint32_t result;
__asm volatile ("usada8 %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __UXTB16(uint32_t op1)
{
uint32_t result;
__asm volatile ("uxtb16 %0, %1" : "=r" (result) : "r" (op1));
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __UXTAB16(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("uxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __SXTB16(uint32_t op1)
{
uint32_t result;
__asm volatile ("sxtb16 %0, %1" : "=r" (result) : "r" (op1));
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __SXTAB16(uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("sxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __SMUAD (uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("smuad %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __SMUADX (uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("smuadx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __SMLAD (uint32_t op1, uint32_t op2, uint32_t op3)
{
uint32_t result;
__asm volatile ("smlad %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __SMLADX (uint32_t op1, uint32_t op2, uint32_t op3)
{
uint32_t result;
__asm volatile ("smladx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint64_t __SMLALD (uint32_t op1, uint32_t op2, uint64_t acc)
{
union llreg_u{
uint32_t w32[2];
uint64_t w64;
} llr;
llr.w64 = acc;
__asm volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) );
return(llr.w64);
}
__attribute__( ( always_inline ) ) static inline uint64_t __SMLALDX (uint32_t op1, uint32_t op2, uint64_t acc)
{
union llreg_u{
uint32_t w32[2];
uint64_t w64;
} llr;
llr.w64 = acc;
__asm volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) );
return(llr.w64);
}
__attribute__( ( always_inline ) ) static inline uint32_t __SMUSD (uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("smusd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __SMUSDX (uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("smusdx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __SMLSD (uint32_t op1, uint32_t op2, uint32_t op3)
{
uint32_t result;
__asm volatile ("smlsd %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __SMLSDX (uint32_t op1, uint32_t op2, uint32_t op3)
{
uint32_t result;
__asm volatile ("smlsdx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint64_t __SMLSLD (uint32_t op1, uint32_t op2, uint64_t acc)
{
union llreg_u{
uint32_t w32[2];
uint64_t w64;
} llr;
llr.w64 = acc;
__asm volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) );
return(llr.w64);
}
__attribute__( ( always_inline ) ) static inline uint64_t __SMLSLDX (uint32_t op1, uint32_t op2, uint64_t acc)
{
union llreg_u{
uint32_t w32[2];
uint64_t w64;
} llr;
llr.w64 = acc;
__asm volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) );
return(llr.w64);
}
__attribute__( ( always_inline ) ) static inline uint32_t __SEL (uint32_t op1, uint32_t op2)
{
uint32_t result;
__asm volatile ("sel %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline int32_t __QADD( int32_t op1, int32_t op2)
{
int32_t result;
__asm volatile ("qadd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline int32_t __QSUB( int32_t op1, int32_t op2)
{
int32_t result;
__asm volatile ("qsub %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );
return(result);
}
__attribute__( ( always_inline ) ) static inline uint32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3)
{
int32_t result;
__asm volatile ("smmla %0, %1, %2, %3" : "=r" (result): "r" (op1), "r" (op2), "r" (op3) );
return(result);
}
typedef union
{
struct
{
uint32_t _reserved0:16;
uint32_t GE:4;
uint32_t _reserved1:7;
uint32_t Q:1;
uint32_t V:1;
uint32_t C:1;
uint32_t Z:1;
uint32_t N:1;
} b;
uint32_t w;
} APSR_Type;
typedef union
{
struct
{
uint32_t ISR:9;
uint32_t _reserved0:23;
} b;
uint32_t w;
} IPSR_Type;
typedef union
{
struct
{
uint32_t ISR:9;
uint32_t _reserved0:7;
uint32_t GE:4;
uint32_t _reserved1:4;
uint32_t T:1;
uint32_t IT:2;
uint32_t Q:1;
uint32_t V:1;
uint32_t C:1;
uint32_t Z:1;
uint32_t N:1;
} b;
uint32_t w;
} xPSR_Type;
typedef union
{
struct
{
uint32_t nPRIV:1;
uint32_t SPSEL:1;
uint32_t FPCA:1;
uint32_t _reserved0:29;
} b;
uint32_t w;
} CONTROL_Type;
typedef struct
{
volatile uint32_t ISER[8U];
uint32_t RESERVED0[24U];
volatile uint32_t ICER[8U];
uint32_t RSERVED1[24U];
volatile uint32_t ISPR[8U];
uint32_t RESERVED2[24U];
volatile uint32_t ICPR[8U];
uint32_t RESERVED3[24U];
volatile uint32_t IABR[8U];
uint32_t RESERVED4[56U];
volatile uint8_t IP[240U];
uint32_t RESERVED5[644U];
volatile uint32_t STIR;
} NVIC_Type;
typedef struct
{
volatile const uint32_t CPUID;
volatile uint32_t ICSR;
volatile uint32_t VTOR;
volatile uint32_t AIRCR;
volatile uint32_t SCR;
volatile uint32_t CCR;
volatile uint8_t SHP[12U];
volatile uint32_t SHCSR;
volatile uint32_t CFSR;
volatile uint32_t HFSR;
volatile uint32_t DFSR;
volatile uint32_t MMFAR;
volatile uint32_t BFAR;
volatile uint32_t AFSR;
volatile const uint32_t PFR[2U];
volatile const uint32_t DFR;
volatile const uint32_t ADR;
volatile const uint32_t MMFR[4U];
volatile const uint32_t ISAR[5U];
uint32_t RESERVED0[5U];
volatile uint32_t CPACR;
} SCB_Type;
typedef struct
{
uint32_t RESERVED0[1U];
volatile const uint32_t ICTR;
volatile uint32_t ACTLR;
} SCnSCB_Type;
typedef struct
{
volatile uint32_t CTRL;
volatile uint32_t LOAD;
volatile uint32_t VAL;
volatile const uint32_t CALIB;
} SysTick_Type;
typedef struct
{
volatile union
{
volatile uint8_t u8;
volatile uint16_t u16;
volatile uint32_t u32;
} PORT [32U];
uint32_t RESERVED0[864U];
volatile uint32_t TER;
uint32_t RESERVED1[15U];
volatile uint32_t TPR;
uint32_t RESERVED2[15U];
volatile uint32_t TCR;
uint32_t RESERVED3[29U];
volatile uint32_t IWR;
volatile const uint32_t IRR;
volatile uint32_t IMCR;
uint32_t RESERVED4[43U];
volatile uint32_t LAR;
volatile const uint32_t LSR;
uint32_t RESERVED5[6U];
volatile const uint32_t PID4;
volatile const uint32_t PID5;
volatile const uint32_t PID6;
volatile const uint32_t PID7;
volatile const uint32_t PID0;
volatile const uint32_t PID1;
volatile const uint32_t PID2;
volatile const uint32_t PID3;
volatile const uint32_t CID0;
volatile const uint32_t CID1;
volatile const uint32_t CID2;
volatile const uint32_t CID3;
} ITM_Type;
typedef struct
{
volatile uint32_t CTRL;
volatile uint32_t CYCCNT;
volatile uint32_t CPICNT;
volatile uint32_t EXCCNT;
volatile uint32_t SLEEPCNT;
volatile uint32_t LSUCNT;
volatile uint32_t FOLDCNT;
volatile const uint32_t PCSR;
volatile uint32_t COMP0;
volatile uint32_t MASK0;
volatile uint32_t FUNCTION0;
uint32_t RESERVED0[1U];
volatile uint32_t COMP1;
volatile uint32_t MASK1;
volatile uint32_t FUNCTION1;
uint32_t RESERVED1[1U];
volatile uint32_t COMP2;
volatile uint32_t MASK2;
volatile uint32_t FUNCTION2;
uint32_t RESERVED2[1U];
volatile uint32_t COMP3;
volatile uint32_t MASK3;
volatile uint32_t FUNCTION3;
} DWT_Type;
typedef struct
{
volatile uint32_t SSPSR;
volatile uint32_t CSPSR;
uint32_t RESERVED0[2U];
volatile uint32_t ACPR;
uint32_t RESERVED1[55U];
volatile uint32_t SPPR;
uint32_t RESERVED2[131U];
volatile const uint32_t FFSR;
volatile uint32_t FFCR;
volatile const uint32_t FSCR;
uint32_t RESERVED3[759U];
volatile const uint32_t TRIGGER;
volatile const uint32_t FIFO0;
volatile const uint32_t ITATBCTR2;
uint32_t RESERVED4[1U];
volatile const uint32_t ITATBCTR0;
volatile const uint32_t FIFO1;
volatile uint32_t ITCTRL;
uint32_t RESERVED5[39U];
volatile uint32_t CLAIMSET;
volatile uint32_t CLAIMCLR;
uint32_t RESERVED7[8U];
volatile const uint32_t DEVID;
volatile const uint32_t DEVTYPE;
} TPI_Type;
typedef struct
{
volatile const uint32_t TYPE;
volatile uint32_t CTRL;
volatile uint32_t RNR;
volatile uint32_t RBAR;
volatile uint32_t RASR;
volatile uint32_t RBAR_A1;
volatile uint32_t RASR_A1;
volatile uint32_t RBAR_A2;
volatile uint32_t RASR_A2;
volatile uint32_t RBAR_A3;
volatile uint32_t RASR_A3;
} MPU_Type;
typedef struct
{
uint32_t RESERVED0[1U];
volatile uint32_t FPCCR;
volatile uint32_t FPCAR;
volatile uint32_t FPDSCR;
volatile const uint32_t MVFR0;
volatile const uint32_t MVFR1;
} FPU_Type;
typedef struct
{
volatile uint32_t DHCSR;
volatile uint32_t DCRSR;
volatile uint32_t DCRDR;
volatile uint32_t DEMCR;
} CoreDebug_Type;
static inline void NVIC_SetPriorityGrouping(uint32_t PriorityGroup)
{
uint32_t reg_value;
uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);
reg_value = ((SCB_Type *) ((0xE000E000UL) + 0x0D00UL) )->AIRCR;
reg_value &= ~((uint32_t)((0xFFFFUL << 16U) | (7UL << 8U)));
reg_value = (reg_value |
((uint32_t)0x5FAUL << 16U) |
(PriorityGroupTmp << 8U) );
((SCB_Type *) ((0xE000E000UL) + 0x0D00UL) )->AIRCR = reg_value;
}
static inline uint32_t NVIC_GetPriorityGrouping(void)
{
return ((uint32_t)((((SCB_Type *) ((0xE000E000UL) + 0x0D00UL) )->AIRCR & (7UL << 8U)) >> 8U));
}
static inline void NVIC_EnableIRQ(IRQn_Type IRQn)
{
((NVIC_Type *) ((0xE000E000UL) + 0x0100UL) )->ISER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL));
}
static inline void NVIC_DisableIRQ(IRQn_Type IRQn)
{
((NVIC_Type *) ((0xE000E000UL) + 0x0100UL) )->ICER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL));
}
static inline uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn)
{
return((uint32_t)(((((NVIC_Type *) ((0xE000E000UL) + 0x0100UL) )->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
}
static inline void NVIC_SetPendingIRQ(IRQn_Type IRQn)
{
((NVIC_Type *) ((0xE000E000UL) + 0x0100UL) )->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL));
}
static inline void NVIC_ClearPendingIRQ(IRQn_Type IRQn)
{
((NVIC_Type *) ((0xE000E000UL) + 0x0100UL) )->ICPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL));
}
static inline uint32_t NVIC_GetActive(IRQn_Type IRQn)
{
return((uint32_t)(((((NVIC_Type *) ((0xE000E000UL) + 0x0100UL) )->IABR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
}
static inline void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
{
if ((int32_t)(IRQn) < 0)
{
((SCB_Type *) ((0xE000E000UL) + 0x0D00UL) )->SHP[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - 3)) & (uint32_t)0xFFUL);
}
else
{
((NVIC_Type *) ((0xE000E000UL) + 0x0100UL) )->IP[((uint32_t)(int32_t)IRQn)] = (uint8_t)((priority << (8U - 3)) & (uint32_t)0xFFUL);
}
}
static inline uint32_t NVIC_GetPriority(IRQn_Type IRQn)
{
if ((int32_t)(IRQn) < 0)
{
return(((uint32_t)((SCB_Type *) ((0xE000E000UL) + 0x0D00UL) )->SHP[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] >> (8U - 3)));
}
else
{
return(((uint32_t)((NVIC_Type *) ((0xE000E000UL) + 0x0100UL) )->IP[((uint32_t)(int32_t)IRQn)] >> (8U - 3)));
}
}
static inline uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)
{
uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);
uint32_t PreemptPriorityBits;
uint32_t SubPriorityBits;
PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(3)) ? (uint32_t)(3) : (uint32_t)(7UL - PriorityGroupTmp);
SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(3)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(3));
return (
((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) |
((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL)))
);
}
static inline void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority)
{
uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);
uint32_t PreemptPriorityBits;
uint32_t SubPriorityBits;
PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(3)) ? (uint32_t)(3) : (uint32_t)(7UL - PriorityGroupTmp);
SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(3)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(3));
*pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL);
*pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL);
}
static inline void NVIC_SystemReset(void)
{
__DSB();
((SCB_Type *) ((0xE000E000UL) + 0x0D00UL) )->AIRCR = (uint32_t)((0x5FAUL << 16U) |
(((SCB_Type *) ((0xE000E000UL) + 0x0D00UL) )->AIRCR & (7UL << 8U)) |
(1UL << 2U) );
__DSB();
for (;;)
{
__NOP();
}
}
static inline uint32_t SysTick_Config(uint32_t ticks)
{
if ((ticks - 1UL) > (0xFFFFFFUL ))
{
return (1UL);
}
((SysTick_Type *) ((0xE000E000UL) + 0x0010UL) )->LOAD = (uint32_t)(ticks - 1UL);
NVIC_SetPriority (SysTick_IRQn, (1UL << 3) - 1UL);
((SysTick_Type *) ((0xE000E000UL) + 0x0010UL) )->VAL = 0UL;
((SysTick_Type *) ((0xE000E000UL) + 0x0010UL) )->CTRL = (1UL << 2U) |
(1UL << 1U) |
(1UL );
return (0UL);
}
extern volatile int32_t ITM_RxBuffer;
static inline uint32_t ITM_SendChar (uint32_t ch)
{
if (((((ITM_Type *) (0xE0000000UL) )->TCR & (1UL )) != 0UL) &&
((((ITM_Type *) (0xE0000000UL) )->TER & 1UL ) != 0UL) )
{
while (((ITM_Type *) (0xE0000000UL) )->PORT[0U].u32 == 0UL)
{
__NOP();
}
((ITM_Type *) (0xE0000000UL) )->PORT[0U].u8 = (uint8_t)ch;
}
return (ch);
}
static inline int32_t ITM_ReceiveChar (void)
{
int32_t ch = -1;
if (ITM_RxBuffer != 0x5AA55AA5U)
{
ch = ITM_RxBuffer;
ITM_RxBuffer = 0x5AA55AA5U;
}
return (ch);
}
static inline int32_t ITM_CheckChar (void)
{
if (ITM_RxBuffer == 0x5AA55AA5U)
{
return (0);
}
else
{
return (1);
}
}
extern uint32_t SystemCoreClock;
extern void SystemInit (void);
extern void SystemCoreClockUpdate (void);
typedef struct {
volatile const uint32_t PART;
volatile const uint32_t VARIANT;
volatile const uint32_t PACKAGE;
volatile const uint32_t RAM;
volatile const uint32_t FLASH;
volatile uint32_t UNUSED0[3];
} FICR_INFO_Type;
typedef struct {
volatile const uint32_t A0;
volatile const uint32_t A1;
volatile const uint32_t A2;
volatile const uint32_t A3;
volatile const uint32_t A4;
volatile const uint32_t A5;
volatile const uint32_t B0;
volatile const uint32_t B1;
volatile const uint32_t B2;
volatile const uint32_t B3;
volatile const uint32_t B4;
volatile const uint32_t B5;
volatile const uint32_t T0;
volatile const uint32_t T1;
volatile const uint32_t T2;
volatile const uint32_t T3;
volatile const uint32_t T4;
} FICR_TEMP_Type;
typedef struct {
volatile const uint32_t TAGHEADER0;
volatile const uint32_t TAGHEADER1;
volatile const uint32_t TAGHEADER2;
volatile const uint32_t TAGHEADER3;
} FICR_NFC_Type;
typedef struct {
volatile uint32_t POWER;
volatile uint32_t POWERSET;
volatile uint32_t POWERCLR;
volatile const uint32_t RESERVED0;
} POWER_RAM_Type;
typedef struct {
volatile uint32_t RTS;
volatile uint32_t TXD;
volatile uint32_t CTS;
volatile uint32_t RXD;
} UARTE_PSEL_Type;
typedef struct {
volatile uint32_t PTR;
volatile uint32_t MAXCNT;
volatile const uint32_t AMOUNT;
} UARTE_RXD_Type;
typedef struct {
volatile uint32_t PTR;
volatile uint32_t MAXCNT;
volatile const uint32_t AMOUNT;
} UARTE_TXD_Type;
typedef struct {
volatile uint32_t RTS;
volatile uint32_t TXD;
volatile uint32_t CTS;
volatile uint32_t RXD;
} UART_PSEL_Type;
typedef struct {
volatile uint32_t SCK;
volatile uint32_t MOSI;
volatile uint32_t MISO;
volatile uint32_t CSN;
} SPIM_PSEL_Type;
typedef struct {
volatile uint32_t PTR;
volatile uint32_t MAXCNT;
volatile const uint32_t AMOUNT;
volatile uint32_t LIST;
} SPIM_RXD_Type;
typedef struct {
volatile uint32_t PTR;
volatile uint32_t MAXCNT;
volatile const uint32_t AMOUNT;
volatile uint32_t LIST;
} SPIM_TXD_Type;
typedef struct {
volatile uint32_t RXDELAY;
volatile uint32_t CSNDUR;
} SPIM_IFTIMING_Type;
typedef struct {
volatile uint32_t SCK;
volatile uint32_t MISO;
volatile uint32_t MOSI;
volatile uint32_t CSN;
} SPIS_PSEL_Type;
typedef struct {
volatile uint32_t PTR;
volatile uint32_t MAXCNT;
volatile const uint32_t AMOUNT;
} SPIS_RXD_Type;
typedef struct {
volatile uint32_t PTR;
volatile uint32_t MAXCNT;
volatile const uint32_t AMOUNT;
} SPIS_TXD_Type;
typedef struct {
volatile uint32_t SCL;
volatile uint32_t SDA;
} TWIM_PSEL_Type;
typedef struct {
volatile uint32_t PTR;
volatile uint32_t MAXCNT;
volatile const uint32_t AMOUNT;
volatile uint32_t LIST;
} TWIM_RXD_Type;
typedef struct {
volatile uint32_t PTR;
volatile uint32_t MAXCNT;
volatile const uint32_t AMOUNT;
volatile uint32_t LIST;
} TWIM_TXD_Type;
typedef struct {
volatile uint32_t SCL;
volatile uint32_t SDA;
} TWIS_PSEL_Type;
typedef struct {
volatile uint32_t PTR;
volatile uint32_t MAXCNT;
volatile const uint32_t AMOUNT;
} TWIS_RXD_Type;
typedef struct {
volatile uint32_t PTR;
volatile uint32_t MAXCNT;
volatile const uint32_t AMOUNT;
} TWIS_TXD_Type;
typedef struct {
volatile uint32_t SCK;
volatile uint32_t MOSI;
volatile uint32_t MISO;
} SPI_PSEL_Type;
typedef struct {
volatile uint32_t SCL;
volatile uint32_t SDA;
} TWI_PSEL_Type;
typedef struct {
volatile uint32_t RX;
} NFCT_FRAMESTATUS_Type;
typedef struct {
volatile uint32_t FRAMECONFIG;
volatile uint32_t AMOUNT;
} NFCT_TXD_Type;
typedef struct {
volatile uint32_t FRAMECONFIG;
volatile const uint32_t AMOUNT;
} NFCT_RXD_Type;
typedef struct {
volatile uint32_t LIMITH;
volatile uint32_t LIMITL;
} SAADC_EVENTS_CH_Type;
typedef struct {
volatile uint32_t PSELP;
volatile uint32_t PSELN;
volatile uint32_t CONFIG;
volatile uint32_t LIMIT;
} SAADC_CH_Type;
typedef struct {
volatile uint32_t PTR;
volatile uint32_t MAXCNT;
volatile const uint32_t AMOUNT;
} SAADC_RESULT_Type;
typedef struct {
volatile uint32_t LED;
volatile uint32_t A;
volatile uint32_t B;
} QDEC_PSEL_Type;
typedef struct {
volatile uint32_t PTR;
volatile uint32_t CNT;
volatile uint32_t REFRESH;
volatile uint32_t ENDDELAY;
volatile const uint32_t RESERVED1[4];
} PWM_SEQ_Type;
typedef struct {
volatile uint32_t OUT[4];
} PWM_PSEL_Type;
typedef struct {
volatile uint32_t CLK;
volatile uint32_t DIN;
} PDM_PSEL_Type;
typedef struct {
volatile uint32_t PTR;
volatile uint32_t MAXCNT;
} PDM_SAMPLE_Type;
typedef struct {
volatile uint32_t ADDR;
volatile uint32_t SIZE;
volatile uint32_t PERM;
volatile uint32_t UNUSED0;
} ACL_ACL_Type;
typedef struct {
volatile uint32_t EN;
volatile uint32_t DIS;
} PPI_TASKS_CHG_Type;
typedef struct {
volatile uint32_t EEP;
volatile uint32_t TEP;
} PPI_CH_Type;
typedef struct {
volatile uint32_t TEP;
} PPI_FORK_Type;
typedef struct {
volatile uint32_t WA;
volatile uint32_t RA;
} MWU_EVENTS_REGION_Type;
typedef struct {
volatile uint32_t WA;
volatile uint32_t RA;
} MWU_EVENTS_PREGION_Type;
typedef struct {
volatile uint32_t SUBSTATWA;
volatile uint32_t SUBSTATRA;
} MWU_PERREGION_Type;
typedef struct {
volatile uint32_t START;
volatile uint32_t END;
volatile const uint32_t RESERVED2[2];
} MWU_REGION_Type;
typedef struct {
volatile const uint32_t START;
volatile const uint32_t END;
volatile uint32_t SUBS;
volatile const uint32_t RESERVED3;
} MWU_PREGION_Type;
typedef struct {
volatile uint32_t MODE;
volatile uint32_t RXEN;
volatile uint32_t TXEN;
volatile uint32_t MCKEN;
volatile uint32_t MCKFREQ;
volatile uint32_t RATIO;
volatile uint32_t SWIDTH;
volatile uint32_t ALIGN;
volatile uint32_t FORMAT;
volatile uint32_t CHANNELS;
} I2S_CONFIG_Type;
typedef struct {
volatile uint32_t PTR;
} I2S_RXD_Type;
typedef struct {
volatile uint32_t PTR;
} I2S_TXD_Type;
typedef struct {
volatile uint32_t MAXCNT;
} I2S_RXTXD_Type;
typedef struct {
volatile uint32_t MCK;
volatile uint32_t SCK;
volatile uint32_t LRCK;
volatile uint32_t SDIN;
volatile uint32_t SDOUT;
} I2S_PSEL_Type;
typedef struct {
volatile const uint32_t EPIN[8];
volatile const uint32_t RESERVED4;
volatile const uint32_t EPOUT[8];
} USBD_HALTED_Type;
typedef struct {
volatile uint32_t EPOUT[8];
volatile const uint32_t ISOOUT;
} USBD_SIZE_Type;
typedef struct {
volatile uint32_t PTR;
volatile uint32_t MAXCNT;
volatile const uint32_t AMOUNT;
volatile const uint32_t RESERVED5[2];
} USBD_EPIN_Type;
typedef struct {
volatile uint32_t PTR;
volatile uint32_t MAXCNT;
volatile const uint32_t AMOUNT;
} USBD_ISOIN_Type;
typedef struct {
volatile uint32_t PTR;
volatile uint32_t MAXCNT;
volatile const uint32_t AMOUNT;
volatile const uint32_t RESERVED6[2];
} USBD_EPOUT_Type;
typedef struct {
volatile uint32_t PTR;
volatile uint32_t MAXCNT;
volatile const uint32_t AMOUNT;
} USBD_ISOOUT_Type;
typedef struct {
volatile uint32_t SRC;
volatile uint32_t DST;
volatile uint32_t CNT;
} QSPI_READ_Type;
typedef struct {
volatile uint32_t DST;
volatile uint32_t SRC;
volatile uint32_t CNT;
} QSPI_WRITE_Type;
typedef struct {
volatile uint32_t PTR;
volatile uint32_t LEN;
} QSPI_ERASE_Type;
typedef struct {
volatile uint32_t SCK;
volatile uint32_t CSN;
volatile const uint32_t RESERVED7;
volatile uint32_t IO0;
volatile uint32_t IO1;
volatile uint32_t IO2;
volatile uint32_t IO3;
} QSPI_PSEL_Type;
typedef struct {
volatile const uint32_t RESERVED0[4];
volatile const uint32_t CODEPAGESIZE;
volatile const uint32_t CODESIZE;
volatile const uint32_t RESERVED1[18];
volatile const uint32_t DEVICEID[2];
volatile const uint32_t RESERVED2[6];
volatile const uint32_t ER[4];
volatile const uint32_t IR[4];
volatile const uint32_t DEVICEADDRTYPE;
volatile const uint32_t DEVICEADDR[2];
volatile const uint32_t RESERVED3[21];
FICR_INFO_Type INFO;
volatile const uint32_t RESERVED4[185];
FICR_TEMP_Type TEMP;
volatile const uint32_t RESERVED5[2];
FICR_NFC_Type NFC;
} NRF_FICR_Type;
typedef struct {
volatile uint32_t UNUSED0;
volatile uint32_t UNUSED1;
volatile uint32_t UNUSED2;
volatile const uint32_t RESERVED0;
volatile uint32_t UNUSED3;
volatile uint32_t NRFFW[15];
volatile uint32_t NRFHW[12];
volatile uint32_t CUSTOMER[32];
volatile const uint32_t RESERVED1[64];
volatile uint32_t PSELRESET[2];
volatile uint32_t APPROTECT;
volatile uint32_t NFCPINS;
volatile uint32_t DEBUGCTRL;
volatile const uint32_t RESERVED2[59];
volatile uint32_t DCDCDRIVE0;
volatile uint32_t REGOUT0;
} NRF_UICR_Type;
typedef struct {
volatile const uint32_t RESERVED0[30];
volatile uint32_t TASKS_CONSTLAT;
volatile uint32_t TASKS_LOWPWR;
volatile const uint32_t RESERVED1[34];
volatile uint32_t EVENTS_POFWARN;
volatile const uint32_t RESERVED2[2];
volatile uint32_t EVENTS_SLEEPENTER;
volatile uint32_t EVENTS_SLEEPEXIT;
volatile uint32_t EVENTS_USBDETECTED;
volatile uint32_t EVENTS_USBREMOVED;
volatile uint32_t EVENTS_USBPWRRDY;
volatile const uint32_t RESERVED3[119];
volatile uint32_t INTENSET;
volatile uint32_t INTENCLR;
volatile const uint32_t RESERVED4[61];
volatile uint32_t RESETREAS;
volatile const uint32_t RESERVED5[9];
volatile const uint32_t RAMSTATUS;
volatile const uint32_t RESERVED6[3];
volatile const uint32_t USBREGSTATUS;
volatile const uint32_t RESERVED7[49];
volatile uint32_t SYSTEMOFF;
volatile const uint32_t RESERVED8[3];
volatile uint32_t POFCON;
volatile const uint32_t RESERVED9[2];
volatile uint32_t GPREGRET;
volatile uint32_t GPREGRET2;
volatile const uint32_t RESERVED10[21];
volatile uint32_t DCDCEN;
volatile const uint32_t RESERVED11;
volatile uint32_t DCDCEN0;
volatile const uint32_t RESERVED12[47];
volatile const uint32_t MAINREGSTATUS;
volatile const uint32_t RESERVED13[175];
POWER_RAM_Type RAM[9];
} NRF_POWER_Type;
typedef struct {
volatile uint32_t TASKS_HFCLKSTART;
volatile uint32_t TASKS_HFCLKSTOP;
volatile uint32_t TASKS_LFCLKSTART;
volatile uint32_t TASKS_LFCLKSTOP;
volatile uint32_t TASKS_CAL;
volatile uint32_t TASKS_CTSTART;
volatile uint32_t TASKS_CTSTOP;
volatile const uint32_t RESERVED0[57];
volatile uint32_t EVENTS_HFCLKSTARTED;
volatile uint32_t EVENTS_LFCLKSTARTED;
volatile const uint32_t RESERVED1;
volatile uint32_t EVENTS_DONE;
volatile uint32_t EVENTS_CTTO;
volatile const uint32_t RESERVED2[5];
volatile uint32_t EVENTS_CTSTARTED;
volatile uint32_t EVENTS_CTSTOPPED;
volatile const uint32_t RESERVED3[117];
volatile uint32_t INTENSET;
volatile uint32_t INTENCLR;
volatile const uint32_t RESERVED4[63];
volatile const uint32_t HFCLKRUN;
volatile const uint32_t HFCLKSTAT;
volatile const uint32_t RESERVED5;
volatile const uint32_t LFCLKRUN;
volatile const uint32_t LFCLKSTAT;
volatile const uint32_t LFCLKSRCCOPY;
volatile const uint32_t RESERVED6[62];
volatile uint32_t LFCLKSRC;
volatile const uint32_t RESERVED7[3];
volatile uint32_t HFXODEBOUNCE;
volatile const uint32_t RESERVED8[3];
volatile uint32_t CTIV;
volatile const uint32_t RESERVED9[8];
volatile uint32_t TRACECONFIG;
volatile const uint32_t RESERVED10[21];
volatile uint32_t LFRCMODE;
} NRF_CLOCK_Type;
typedef struct {
volatile uint32_t TASKS_TXEN;
volatile uint32_t TASKS_RXEN;
volatile uint32_t TASKS_START;
volatile uint32_t TASKS_STOP;
volatile uint32_t TASKS_DISABLE;
volatile uint32_t TASKS_RSSISTART;
volatile uint32_t TASKS_RSSISTOP;
volatile uint32_t TASKS_BCSTART;
volatile uint32_t TASKS_BCSTOP;
volatile uint32_t TASKS_EDSTART;
volatile uint32_t TASKS_EDSTOP;
volatile uint32_t TASKS_CCASTART;
volatile uint32_t TASKS_CCASTOP;
volatile const uint32_t RESERVED0[51];
volatile uint32_t EVENTS_READY;
volatile uint32_t EVENTS_ADDRESS;
volatile uint32_t EVENTS_PAYLOAD;
volatile uint32_t EVENTS_END;
volatile uint32_t EVENTS_DISABLED;
volatile uint32_t EVENTS_DEVMATCH;
volatile uint32_t EVENTS_DEVMISS;
volatile uint32_t EVENTS_RSSIEND;
volatile const uint32_t RESERVED1[2];
volatile uint32_t EVENTS_BCMATCH;
volatile const uint32_t RESERVED2;
volatile uint32_t EVENTS_CRCOK;
volatile uint32_t EVENTS_CRCERROR;
volatile uint32_t EVENTS_FRAMESTART;
volatile uint32_t EVENTS_EDEND;
volatile uint32_t EVENTS_EDSTOPPED;
volatile uint32_t EVENTS_CCAIDLE;
volatile uint32_t EVENTS_CCABUSY;
volatile uint32_t EVENTS_CCASTOPPED;
volatile uint32_t EVENTS_RATEBOOST;
volatile uint32_t EVENTS_TXREADY;
volatile uint32_t EVENTS_RXREADY;
volatile uint32_t EVENTS_MHRMATCH;
volatile const uint32_t RESERVED3[3];
volatile uint32_t EVENTS_PHYEND;
volatile const uint32_t RESERVED4[36];
volatile uint32_t SHORTS;
volatile const uint32_t RESERVED5[64];
volatile uint32_t INTENSET;
volatile uint32_t INTENCLR;
volatile const uint32_t RESERVED6[61];
volatile const uint32_t CRCSTATUS;
volatile const uint32_t RESERVED7;
volatile const uint32_t RXMATCH;
volatile const uint32_t RXCRC;
volatile const uint32_t DAI;
volatile const uint32_t PDUSTAT;
volatile const uint32_t RESERVED8[59];
volatile uint32_t PACKETPTR;
volatile uint32_t FREQUENCY;
volatile uint32_t TXPOWER;
volatile uint32_t MODE;
volatile uint32_t PCNF0;
volatile uint32_t PCNF1;
volatile uint32_t BASE0;
volatile uint32_t BASE1;
volatile uint32_t PREFIX0;
volatile uint32_t PREFIX1;
volatile uint32_t TXADDRESS;
volatile uint32_t RXADDRESSES;
volatile uint32_t CRCCNF;
volatile uint32_t CRCPOLY;
volatile uint32_t CRCINIT;
volatile const uint32_t RESERVED9;
volatile uint32_t TIFS;
volatile const uint32_t RSSISAMPLE;
volatile const uint32_t RESERVED10;
volatile const uint32_t STATE;
volatile uint32_t DATAWHITEIV;
volatile const uint32_t RESERVED11[2];
volatile uint32_t BCC;
volatile const uint32_t RESERVED12[39];
volatile uint32_t DAB[8];
volatile uint32_t DAP[8];
volatile uint32_t DACNF;
volatile uint32_t MHRMATCHCONF;
volatile uint32_t MHRMATCHMAS;
volatile const uint32_t RESERVED13;
volatile uint32_t MODECNF0;
volatile const uint32_t RESERVED14[3];
volatile uint32_t SFD;
volatile uint32_t EDCNT;
volatile uint32_t EDSAMPLE;
volatile uint32_t CCACTRL;
volatile const uint32_t RESERVED15[611];
volatile uint32_t POWER;
} NRF_RADIO_Type;
typedef struct {
volatile uint32_t TASKS_STARTRX;
volatile uint32_t TASKS_STOPRX;
volatile uint32_t TASKS_STARTTX;
volatile uint32_t TASKS_STOPTX;
volatile const uint32_t RESERVED0[7];
volatile uint32_t TASKS_FLUSHRX;
volatile const uint32_t RESERVED1[52];
volatile uint32_t EVENTS_CTS;
volatile uint32_t EVENTS_NCTS;
volatile uint32_t EVENTS_RXDRDY;
volatile const uint32_t RESERVED2;
volatile uint32_t EVENTS_ENDRX;
volatile const uint32_t RESERVED3[2];
volatile uint32_t EVENTS_TXDRDY;
volatile uint32_t EVENTS_ENDTX;
volatile uint32_t EVENTS_ERROR;
volatile const uint32_t RESERVED4[7];
volatile uint32_t EVENTS_RXTO;
volatile const uint32_t RESERVED5;
volatile uint32_t EVENTS_RXSTARTED;
volatile uint32_t EVENTS_TXSTARTED;
volatile const uint32_t RESERVED6;
volatile uint32_t EVENTS_TXSTOPPED;
volatile const uint32_t RESERVED7[41];
volatile uint32_t SHORTS;
volatile const uint32_t RESERVED8[63];
volatile uint32_t INTEN;
volatile uint32_t INTENSET;
volatile uint32_t INTENCLR;
volatile const uint32_t RESERVED9[93];
volatile uint32_t ERRORSRC;
volatile const uint32_t RESERVED10[31];
volatile uint32_t ENABLE;
volatile const uint32_t RESERVED11;
UARTE_PSEL_Type PSEL;
volatile const uint32_t RESERVED12[3];
volatile uint32_t BAUDRATE;
volatile const uint32_t RESERVED13[3];
UARTE_RXD_Type RXD;
volatile const uint32_t RESERVED14;
UARTE_TXD_Type TXD;
volatile const uint32_t RESERVED15[7];
volatile uint32_t CONFIG;
} NRF_UARTE_Type;
typedef struct {
volatile uint32_t TASKS_STARTRX;
volatile uint32_t TASKS_STOPRX;
volatile uint32_t TASKS_STARTTX;
volatile uint32_t TASKS_STOPTX;
volatile const uint32_t RESERVED0[3];
volatile uint32_t TASKS_SUSPEND;
volatile const uint32_t RESERVED1[56];
volatile uint32_t EVENTS_CTS;
volatile uint32_t EVENTS_NCTS;
volatile uint32_t EVENTS_RXDRDY;
volatile const uint32_t RESERVED2[4];
volatile uint32_t EVENTS_TXDRDY;
volatile const uint32_t RESERVED3;
volatile uint32_t EVENTS_ERROR;
volatile const uint32_t RESERVED4[7];
volatile uint32_t EVENTS_RXTO;
volatile const uint32_t RESERVED5[46];
volatile uint32_t SHORTS;
volatile const uint32_t RESERVED6[64];
volatile uint32_t INTENSET;
volatile uint32_t INTENCLR;
volatile const uint32_t RESERVED7[93];
volatile uint32_t ERRORSRC;
volatile const uint32_t RESERVED8[31];
volatile uint32_t ENABLE;
volatile const uint32_t RESERVED9;
UART_PSEL_Type PSEL;
volatile const uint32_t RXD;
volatile uint32_t TXD;
volatile const uint32_t RESERVED10;
volatile uint32_t BAUDRATE;
volatile const uint32_t RESERVED11[17];
volatile uint32_t CONFIG;
} NRF_UART_Type;
typedef struct {
volatile const uint32_t RESERVED0[4];
volatile uint32_t TASKS_START;
volatile uint32_t TASKS_STOP;
volatile const uint32_t RESERVED1;
volatile uint32_t TASKS_SUSPEND;
volatile uint32_t TASKS_RESUME;
volatile const uint32_t RESERVED2[56];
volatile uint32_t EVENTS_STOPPED;
volatile const uint32_t RESERVED3[2];
volatile uint32_t EVENTS_ENDRX;
volatile const uint32_t RESERVED4;
volatile uint32_t EVENTS_END;
volatile const uint32_t RESERVED5;
volatile uint32_t EVENTS_ENDTX;
volatile const uint32_t RESERVED6[10];
volatile uint32_t EVENTS_STARTED;
volatile const uint32_t RESERVED7[44];
volatile uint32_t SHORTS;
volatile const uint32_t RESERVED8[64];
volatile uint32_t INTENSET;
volatile uint32_t INTENCLR;
volatile const uint32_t RESERVED9[61];
volatile uint32_t STALLSTAT;
volatile const uint32_t RESERVED10[63];
volatile uint32_t ENABLE;
volatile const uint32_t RESERVED11;
SPIM_PSEL_Type PSEL;
volatile const uint32_t RESERVED12[3];
volatile uint32_t FREQUENCY;
volatile const uint32_t RESERVED13[3];
SPIM_RXD_Type RXD;
SPIM_TXD_Type TXD;
volatile uint32_t CONFIG;
volatile const uint32_t RESERVED14[2];
SPIM_IFTIMING_Type IFTIMING;
volatile uint32_t CSNPOL;
volatile uint32_t PSELDCX;
volatile uint32_t DCXCNT;
volatile const uint32_t RESERVED15[19];
volatile uint32_t ORC;
} NRF_SPIM_Type;
typedef struct {
volatile const uint32_t RESERVED0[9];
volatile uint32_t TASKS_ACQUIRE;
volatile uint32_t TASKS_RELEASE;
volatile const uint32_t RESERVED1[54];
volatile uint32_t EVENTS_END;
volatile const uint32_t RESERVED2[2];
volatile uint32_t EVENTS_ENDRX;
volatile const uint32_t RESERVED3[5];
volatile uint32_t EVENTS_ACQUIRED;
volatile const uint32_t RESERVED4[53];
volatile uint32_t SHORTS;
volatile const uint32_t RESERVED5[64];
volatile uint32_t INTENSET;
volatile uint32_t INTENCLR;
volatile const uint32_t RESERVED6[61];
volatile const uint32_t SEMSTAT;
volatile const uint32_t RESERVED7[15];
volatile uint32_t STATUS;
volatile const uint32_t RESERVED8[47];
volatile uint32_t ENABLE;
volatile const uint32_t RESERVED9;
SPIS_PSEL_Type PSEL;
volatile const uint32_t RESERVED10[7];
SPIS_RXD_Type RXD;
volatile const uint32_t RESERVED11;
SPIS_TXD_Type TXD;
volatile const uint32_t RESERVED12;
volatile uint32_t CONFIG;
volatile const uint32_t RESERVED13;
volatile uint32_t DEF;
volatile const uint32_t RESERVED14[24];
volatile uint32_t ORC;
} NRF_SPIS_Type;
typedef struct {
volatile uint32_t TASKS_STARTRX;
volatile const uint32_t RESERVED0;
volatile uint32_t TASKS_STARTTX;
volatile const uint32_t RESERVED1[2];
volatile uint32_t TASKS_STOP;
volatile const uint32_t RESERVED2;
volatile uint32_t TASKS_SUSPEND;
volatile uint32_t TASKS_RESUME;
volatile const uint32_t RESERVED3[56];
volatile uint32_t EVENTS_STOPPED;
volatile const uint32_t RESERVED4[7];
volatile uint32_t EVENTS_ERROR;
volatile const uint32_t RESERVED5[8];
volatile uint32_t EVENTS_SUSPENDED;
volatile uint32_t EVENTS_RXSTARTED;
volatile uint32_t EVENTS_TXSTARTED;
volatile const uint32_t RESERVED6[2];
volatile uint32_t EVENTS_LASTRX;
volatile uint32_t EVENTS_LASTTX;
volatile const uint32_t RESERVED7[39];
volatile uint32_t SHORTS;
volatile const uint32_t RESERVED8[63];
volatile uint32_t INTEN;
volatile uint32_t INTENSET;
volatile uint32_t INTENCLR;
volatile const uint32_t RESERVED9[110];
volatile uint32_t ERRORSRC;
volatile const uint32_t RESERVED10[14];
volatile uint32_t ENABLE;
volatile const uint32_t RESERVED11;
TWIM_PSEL_Type PSEL;
volatile const uint32_t RESERVED12[5];
volatile uint32_t FREQUENCY;
volatile const uint32_t RESERVED13[3];
TWIM_RXD_Type RXD;
TWIM_TXD_Type TXD;
volatile const uint32_t RESERVED14[13];
volatile uint32_t ADDRESS;
} NRF_TWIM_Type;
typedef struct {
volatile const uint32_t RESERVED0[5];
volatile uint32_t TASKS_STOP;
volatile const uint32_t RESERVED1;
volatile uint32_t TASKS_SUSPEND;
volatile uint32_t TASKS_RESUME;
volatile const uint32_t RESERVED2[3];
volatile uint32_t TASKS_PREPARERX;
volatile uint32_t TASKS_PREPARETX;
volatile const uint32_t RESERVED3[51];
volatile uint32_t EVENTS_STOPPED;
volatile const uint32_t RESERVED4[7];
volatile uint32_t EVENTS_ERROR;
volatile const uint32_t RESERVED5[9];
volatile uint32_t EVENTS_RXSTARTED;
volatile uint32_t EVENTS_TXSTARTED;
volatile const uint32_t RESERVED6[4];
volatile uint32_t EVENTS_WRITE;
volatile uint32_t EVENTS_READ;
volatile const uint32_t RESERVED7[37];
volatile uint32_t SHORTS;
volatile const uint32_t RESERVED8[63];
volatile uint32_t INTEN;
volatile uint32_t INTENSET;
volatile uint32_t INTENCLR;
volatile const uint32_t RESERVED9[113];
volatile uint32_t ERRORSRC;
volatile const uint32_t MATCH;
volatile const uint32_t RESERVED10[10];
volatile uint32_t ENABLE;
volatile const uint32_t RESERVED11;
TWIS_PSEL_Type PSEL;
volatile const uint32_t RESERVED12[9];
TWIS_RXD_Type RXD;
volatile const uint32_t RESERVED13;
TWIS_TXD_Type TXD;
volatile const uint32_t RESERVED14[14];
volatile uint32_t ADDRESS[2];
volatile const uint32_t RESERVED15;
volatile uint32_t CONFIG;
volatile const uint32_t RESERVED16[10];
volatile uint32_t ORC;
} NRF_TWIS_Type;
typedef struct {
volatile const uint32_t RESERVED0[66];
volatile uint32_t EVENTS_READY;
volatile const uint32_t RESERVED1[126];
volatile uint32_t INTENSET;
volatile uint32_t INTENCLR;
volatile const uint32_t RESERVED2[125];
volatile uint32_t ENABLE;
volatile const uint32_t RESERVED3;
SPI_PSEL_Type PSEL;
volatile const uint32_t RESERVED4;
volatile const uint32_t RXD;
volatile uint32_t TXD;
volatile const uint32_t RESERVED5;
volatile uint32_t FREQUENCY;
volatile const uint32_t RESERVED6[11];
volatile uint32_t CONFIG;
} NRF_SPI_Type;
typedef struct {
volatile uint32_t TASKS_STARTRX;
volatile const uint32_t RESERVED0;
volatile uint32_t TASKS_STARTTX;
volatile const uint32_t RESERVED1[2];
volatile uint32_t TASKS_STOP;
volatile const uint32_t RESERVED2;
volatile uint32_t TASKS_SUSPEND;
volatile uint32_t TASKS_RESUME;
volatile const uint32_t RESERVED3[56];
volatile uint32_t EVENTS_STOPPED;
volatile uint32_t EVENTS_RXDREADY;
volatile const uint32_t RESERVED4[4];
volatile uint32_t EVENTS_TXDSENT;
volatile const uint32_t RESERVED5;
volatile uint32_t EVENTS_ERROR;
volatile const uint32_t RESERVED6[4];
volatile uint32_t EVENTS_BB;
volatile const uint32_t RESERVED7[3];
volatile uint32_t EVENTS_SUSPENDED;
volatile const uint32_t RESERVED8[45];
volatile uint32_t SHORTS;
volatile const uint32_t RESERVED9[64];
volatile uint32_t INTENSET;
volatile uint32_t INTENCLR;
volatile const uint32_t RESERVED10[110];
volatile uint32_t ERRORSRC;
volatile const uint32_t RESERVED11[14];
volatile uint32_t ENABLE;
volatile const uint32_t RESERVED12;
TWI_PSEL_Type PSEL;
volatile const uint32_t RESERVED13[2];
volatile const uint32_t RXD;
volatile uint32_t TXD;
volatile const uint32_t RESERVED14;
volatile uint32_t FREQUENCY;
volatile const uint32_t RESERVED15[24];
volatile uint32_t ADDRESS;
} NRF_TWI_Type;
typedef struct {
volatile uint32_t TASKS_ACTIVATE;
volatile uint32_t TASKS_DISABLE;
volatile uint32_t TASKS_SENSE;
volatile uint32_t TASKS_STARTTX;
volatile const uint32_t RESERVED0[3];
volatile uint32_t TASKS_ENABLERXDATA;
volatile const uint32_t RESERVED1;
volatile uint32_t TASKS_GOIDLE;
volatile uint32_t TASKS_GOSLEEP;
volatile const uint32_t RESERVED2[53];
volatile uint32_t EVENTS_READY;
volatile uint32_t EVENTS_FIELDDETECTED;
volatile uint32_t EVENTS_FIELDLOST;
volatile uint32_t EVENTS_TXFRAMESTART;
volatile uint32_t EVENTS_TXFRAMEEND;
volatile uint32_t EVENTS_RXFRAMESTART;
volatile uint32_t EVENTS_RXFRAMEEND;
volatile uint32_t EVENTS_ERROR;
volatile const uint32_t RESERVED3[2];
volatile uint32_t EVENTS_RXERROR;
volatile uint32_t EVENTS_ENDRX;
volatile uint32_t EVENTS_ENDTX;
volatile const uint32_t RESERVED4;
volatile uint32_t EVENTS_AUTOCOLRESSTARTED;
volatile const uint32_t RESERVED5[3];
volatile uint32_t EVENTS_COLLISION;
volatile uint32_t EVENTS_SELECTED;
volatile uint32_t EVENTS_STARTED;
volatile const uint32_t RESERVED6[43];
volatile uint32_t SHORTS;
volatile const uint32_t RESERVED7[63];
volatile uint32_t INTEN;
volatile uint32_t INTENSET;
volatile uint32_t INTENCLR;
volatile const uint32_t RESERVED8[62];
volatile uint32_t ERRORSTATUS;
volatile const uint32_t RESERVED9;
NFCT_FRAMESTATUS_Type FRAMESTATUS;
volatile const uint32_t NFCTAGSTATE;
volatile const uint32_t RESERVED10[10];
volatile const uint32_t FIELDPRESENT;
volatile const uint32_t RESERVED11[49];
volatile uint32_t FRAMEDELAYMIN;
volatile uint32_t FRAMEDELAYMAX;
volatile uint32_t FRAMEDELAYMODE;
volatile uint32_t PACKETPTR;
volatile uint32_t MAXLEN;
NFCT_TXD_Type TXD;
NFCT_RXD_Type RXD;
volatile const uint32_t RESERVED12[26];
volatile uint32_t NFCID1_LAST;
volatile uint32_t NFCID1_2ND_LAST;
volatile uint32_t NFCID1_3RD_LAST;
volatile uint32_t AUTOCOLRESCONFIG;
volatile uint32_t SENSRES;
volatile uint32_t SELRES;
} NRF_NFCT_Type;
typedef struct {
volatile uint32_t TASKS_OUT[8];
volatile const uint32_t RESERVED0[4];
volatile uint32_t TASKS_SET[8];
volatile const uint32_t RESERVED1[4];
volatile uint32_t TASKS_CLR[8];
volatile const uint32_t RESERVED2[32];
volatile uint32_t EVENTS_IN[8];
volatile const uint32_t RESERVED3[23];
volatile uint32_t EVENTS_PORT;
volatile const uint32_t RESERVED4[97];
volatile uint32_t INTENSET;
volatile uint32_t INTENCLR;
volatile const uint32_t RESERVED5[129];
volatile uint32_t CONFIG[8];
} NRF_GPIOTE_Type;
typedef struct {
volatile uint32_t TASKS_START;
volatile uint32_t TASKS_SAMPLE;
volatile uint32_t TASKS_STOP;
volatile uint32_t TASKS_CALIBRATEOFFSET;
volatile const uint32_t RESERVED0[60];
volatile uint32_t EVENTS_STARTED;
volatile uint32_t EVENTS_END;
volatile uint32_t EVENTS_DONE;
volatile uint32_t EVENTS_RESULTDONE;
volatile uint32_t EVENTS_CALIBRATEDONE;
volatile uint32_t EVENTS_STOPPED;
SAADC_EVENTS_CH_Type EVENTS_CH[8];
volatile const uint32_t RESERVED1[106];
volatile uint32_t INTEN;
volatile uint32_t INTENSET;
volatile uint32_t INTENCLR;
volatile const uint32_t RESERVED2[61];
volatile const uint32_t STATUS;
volatile const uint32_t RESERVED3[63];
volatile uint32_t ENABLE;
volatile const uint32_t RESERVED4[3];
SAADC_CH_Type CH[8];
volatile const uint32_t RESERVED5[24];
volatile uint32_t RESOLUTION;
volatile uint32_t OVERSAMPLE;
volatile uint32_t SAMPLERATE;
volatile const uint32_t RESERVED6[12];
SAADC_RESULT_Type RESULT;
} NRF_SAADC_Type;
typedef struct {
volatile uint32_t TASKS_START;
volatile uint32_t TASKS_STOP;
volatile uint32_t TASKS_COUNT;
volatile uint32_t TASKS_CLEAR;
volatile uint32_t TASKS_SHUTDOWN;
volatile const uint32_t RESERVED0[11];
volatile uint32_t TASKS_CAPTURE[6];
volatile const uint32_t RESERVED1[58];
volatile uint32_t EVENTS_COMPARE[6];
volatile const uint32_t RESERVED2[42];
volatile uint32_t SHORTS;
volatile const uint32_t RESERVED3[64];
volatile uint32_t INTENSET;
volatile uint32_t INTENCLR;
volatile const uint32_t RESERVED4[126];
volatile uint32_t MODE;
volatile uint32_t BITMODE;
volatile const uint32_t RESERVED5;
volatile uint32_t PRESCALER;
volatile const uint32_t RESERVED6[11];
volatile uint32_t CC[6];
} NRF_TIMER_Type;
typedef struct {
volatile uint32_t TASKS_START;
volatile uint32_t TASKS_STOP;
volatile uint32_t TASKS_CLEAR;
volatile uint32_t TASKS_TRIGOVRFLW;
volatile const uint32_t RESERVED0[60];
volatile uint32_t EVENTS_TICK;
volatile uint32_t EVENTS_OVRFLW;
volatile const uint32_t RESERVED1[14];
volatile uint32_t EVENTS_COMPARE[4];
volatile const uint32_t RESERVED2[109];
volatile uint32_t INTENSET;
volatile uint32_t INTENCLR;
volatile const uint32_t RESERVED3[13];
volatile uint32_t EVTEN;
volatile uint32_t EVTENSET;
volatile uint32_t EVTENCLR;
volatile const uint32_t RESERVED4[110];
volatile const uint32_t COUNTER;
volatile uint32_t PRESCALER;
volatile const uint32_t RESERVED5[13];
volatile uint32_t CC[4];
} NRF_RTC_Type;
typedef struct {
volatile uint32_t TASKS_START;
volatile uint32_t TASKS_STOP;
volatile const uint32_t RESERVED0[62];
volatile uint32_t EVENTS_DATARDY;
volatile const uint32_t RESERVED1[128];
volatile uint32_t INTENSET;
volatile uint32_t INTENCLR;
volatile const uint32_t RESERVED2[127];
volatile const int32_t TEMP;
volatile const uint32_t RESERVED3[5];
volatile uint32_t A0;
volatile uint32_t A1;
volatile uint32_t A2;
volatile uint32_t A3;
volatile uint32_t A4;
volatile uint32_t A5;
volatile const uint32_t RESERVED4[2];
volatile uint32_t B0;
volatile uint32_t B1;
volatile uint32_t B2;
volatile uint32_t B3;
volatile uint32_t B4;
volatile uint32_t B5;
volatile const uint32_t RESERVED5[2];
volatile uint32_t T0;
volatile uint32_t T1;
volatile uint32_t T2;
volatile uint32_t T3;
volatile uint32_t T4;
} NRF_TEMP_Type;
typedef struct {
volatile uint32_t TASKS_START;
volatile uint32_t TASKS_STOP;
volatile const uint32_t RESERVED0[62];
volatile uint32_t EVENTS_VALRDY;
volatile const uint32_t RESERVED1[63];
volatile uint32_t SHORTS;
volatile const uint32_t RESERVED2[64];
volatile uint32_t INTENSET;
volatile uint32_t INTENCLR;
volatile const uint32_t RESERVED3[126];
volatile uint32_t CONFIG;
volatile const uint32_t VALUE;
} NRF_RNG_Type;
typedef struct {
volatile uint32_t TASKS_STARTECB;
volatile uint32_t TASKS_STOPECB;
volatile const uint32_t RESERVED0[62];
volatile uint32_t EVENTS_ENDECB;
volatile uint32_t EVENTS_ERRORECB;
volatile const uint32_t RESERVED1[127];
volatile uint32_t INTENSET;
volatile uint32_t INTENCLR;
volatile const uint32_t RESERVED2[126];
volatile uint32_t ECBDATAPTR;
} NRF_ECB_Type;
typedef struct {
volatile uint32_t TASKS_KSGEN;
volatile uint32_t TASKS_CRYPT;
volatile uint32_t TASKS_STOP;
volatile uint32_t TASKS_RATEOVERRIDE;
volatile const uint32_t RESERVED0[60];
volatile uint32_t EVENTS_ENDKSGEN;
volatile uint32_t EVENTS_ENDCRYPT;
volatile uint32_t EVENTS_ERROR;
volatile const uint32_t RESERVED1[61];
volatile uint32_t SHORTS;
volatile const uint32_t RESERVED2[64];
volatile uint32_t INTENSET;
volatile uint32_t INTENCLR;
volatile const uint32_t RESERVED3[61];
volatile const uint32_t MICSTATUS;
volatile const uint32_t RESERVED4[63];
volatile uint32_t ENABLE;
volatile uint32_t MODE;
volatile uint32_t CNFPTR;
volatile uint32_t INPTR;
volatile uint32_t OUTPTR;
volatile uint32_t SCRATCHPTR;
volatile uint32_t MAXPACKETSIZE;
volatile uint32_t RATEOVERRIDE;
} NRF_CCM_Type;
typedef struct {
volatile uint32_t TASKS_START;
volatile const uint32_t RESERVED0;
volatile uint32_t TASKS_STOP;
volatile const uint32_t RESERVED1[61];
volatile uint32_t EVENTS_END;
volatile uint32_t EVENTS_RESOLVED;
volatile uint32_t EVENTS_NOTRESOLVED;
volatile const uint32_t RESERVED2[126];
volatile uint32_t INTENSET;
volatile uint32_t INTENCLR;
volatile const uint32_t RESERVED3[61];
volatile const uint32_t STATUS;
volatile const uint32_t RESERVED4[63];
volatile uint32_t ENABLE;
volatile uint32_t NIRK;
volatile uint32_t IRKPTR;
volatile const uint32_t RESERVED5;
volatile uint32_t ADDRPTR;
volatile uint32_t SCRATCHPTR;
} NRF_AAR_Type;
typedef struct {
volatile uint32_t TASKS_START;
volatile const uint32_t RESERVED0[63];
volatile uint32_t EVENTS_TIMEOUT;
volatile const uint32_t RESERVED1[128];
volatile uint32_t INTENSET;
volatile uint32_t INTENCLR;
volatile const uint32_t RESERVED2[61];
volatile const uint32_t RUNSTATUS;
volatile const uint32_t REQSTATUS;
volatile const uint32_t RESERVED3[63];
volatile uint32_t CRV;
volatile uint32_t RREN;
volatile uint32_t CONFIG;
volatile const uint32_t RESERVED4[60];
volatile uint32_t RR[8];
} NRF_WDT_Type;
typedef struct {
volatile uint32_t TASKS_START;
volatile uint32_t TASKS_STOP;
volatile uint32_t TASKS_READCLRACC;
volatile uint32_t TASKS_RDCLRACC;
volatile uint32_t TASKS_RDCLRDBL;
volatile const uint32_t RESERVED0[59];
volatile uint32_t EVENTS_SAMPLERDY;
volatile uint32_t EVENTS_REPORTRDY;
volatile uint32_t EVENTS_ACCOF;
volatile uint32_t EVENTS_DBLRDY;
volatile uint32_t EVENTS_STOPPED;
volatile const uint32_t RESERVED1[59];
volatile uint32_t SHORTS;
volatile const uint32_t RESERVED2[64];
volatile uint32_t INTENSET;
volatile uint32_t INTENCLR;
volatile const uint32_t RESERVED3[125];
volatile uint32_t ENABLE;
volatile uint32_t LEDPOL;
volatile uint32_t SAMPLEPER;
volatile const int32_t SAMPLE;
volatile uint32_t REPORTPER;
volatile const int32_t ACC;
volatile const int32_t ACCREAD;
QDEC_PSEL_Type PSEL;
volatile uint32_t DBFEN;
volatile const uint32_t RESERVED4[5];
volatile uint32_t LEDPRE;
volatile const uint32_t ACCDBL;
volatile const uint32_t ACCDBLREAD;
} NRF_QDEC_Type;
typedef struct {
volatile uint32_t TASKS_START;
volatile uint32_t TASKS_STOP;
volatile uint32_t TASKS_SAMPLE;
volatile const uint32_t RESERVED0[61];
volatile uint32_t EVENTS_READY;
volatile uint32_t EVENTS_DOWN;
volatile uint32_t EVENTS_UP;
volatile uint32_t EVENTS_CROSS;
volatile const uint32_t RESERVED1[60];
volatile uint32_t SHORTS;
volatile const uint32_t RESERVED2[63];
volatile uint32_t INTEN;
volatile uint32_t INTENSET;
volatile uint32_t INTENCLR;
volatile const uint32_t RESERVED3[61];
volatile const uint32_t RESULT;
volatile const uint32_t RESERVED4[63];
volatile uint32_t ENABLE;
volatile uint32_t PSEL;
volatile uint32_t REFSEL;
volatile uint32_t EXTREFSEL;
volatile const uint32_t RESERVED5[8];
volatile uint32_t TH;
volatile uint32_t MODE;
volatile uint32_t HYST;
} NRF_COMP_Type;
typedef struct {
volatile uint32_t TASKS_START;
volatile uint32_t TASKS_STOP;
volatile uint32_t TASKS_SAMPLE;
volatile const uint32_t RESERVED0[61];
volatile uint32_t EVENTS_READY;
volatile uint32_t EVENTS_DOWN;
volatile uint32_t EVENTS_UP;
volatile uint32_t EVENTS_CROSS;
volatile const uint32_t RESERVED1[60];
volatile uint32_t SHORTS;
volatile const uint32_t RESERVED2[64];
volatile uint32_t INTENSET;
volatile uint32_t INTENCLR;
volatile const uint32_t RESERVED3[61];
volatile const uint32_t RESULT;
volatile const uint32_t RESERVED4[63];
volatile uint32_t ENABLE;
volatile uint32_t PSEL;
volatile uint32_t REFSEL;
volatile uint32_t EXTREFSEL;
volatile const uint32_t RESERVED5[4];
volatile uint32_t ANADETECT;
volatile const uint32_t RESERVED6[5];
volatile uint32_t HYST;
} NRF_LPCOMP_Type;
typedef struct {
volatile const uint32_t UNUSED;
} NRF_SWI_Type;
typedef struct {
volatile uint32_t TASKS_TRIGGER[16];
volatile const uint32_t RESERVED0[48];
volatile uint32_t EVENTS_TRIGGERED[16];
volatile const uint32_t RESERVED1[112];
volatile uint32_t INTEN;
volatile uint32_t INTENSET;
volatile uint32_t INTENCLR;
} NRF_EGU_Type;
typedef struct {
volatile const uint32_t RESERVED0;
volatile uint32_t TASKS_STOP;
volatile uint32_t TASKS_SEQSTART[2];
volatile uint32_t TASKS_NEXTSTEP;
volatile const uint32_t RESERVED1[60];
volatile uint32_t EVENTS_STOPPED;
volatile uint32_t EVENTS_SEQSTARTED[2];
volatile uint32_t EVENTS_SEQEND[2];
volatile uint32_t EVENTS_PWMPERIODEND;
volatile uint32_t EVENTS_LOOPSDONE;
volatile const uint32_t RESERVED2[56];
volatile uint32_t SHORTS;
volatile const uint32_t RESERVED3[63];
volatile uint32_t INTEN;
volatile uint32_t INTENSET;
volatile uint32_t INTENCLR;
volatile const uint32_t RESERVED4[125];
volatile uint32_t ENABLE;
volatile uint32_t MODE;
volatile uint32_t COUNTERTOP;
volatile uint32_t PRESCALER;
volatile uint32_t DECODER;
volatile uint32_t LOOP;
volatile const uint32_t RESERVED5[2];
PWM_SEQ_Type SEQ[2];
PWM_PSEL_Type PSEL;
} NRF_PWM_Type;
typedef struct {
volatile uint32_t TASKS_START;
volatile uint32_t TASKS_STOP;
volatile const uint32_t RESERVED0[62];
volatile uint32_t EVENTS_STARTED;
volatile uint32_t EVENTS_STOPPED;
volatile uint32_t EVENTS_END;
volatile const uint32_t RESERVED1[125];
volatile uint32_t INTEN;
volatile uint32_t INTENSET;
volatile uint32_t INTENCLR;
volatile const uint32_t RESERVED2[125];
volatile uint32_t ENABLE;
volatile uint32_t PDMCLKCTRL;
volatile uint32_t MODE;
volatile const uint32_t RESERVED3[3];
volatile uint32_t GAINL;
volatile uint32_t GAINR;
volatile uint32_t RATIO;
volatile const uint32_t RESERVED4[7];
PDM_PSEL_Type PSEL;
volatile const uint32_t RESERVED5[6];
PDM_SAMPLE_Type SAMPLE;
} NRF_PDM_Type;
typedef struct {
volatile const uint32_t RESERVED0[256];
volatile const uint32_t READY;
volatile const uint32_t RESERVED1;
volatile const uint32_t READYNEXT;
volatile const uint32_t RESERVED2[62];
volatile uint32_t CONFIG;
union {
volatile uint32_t ERASEPAGE;
volatile uint32_t ERASEPCR1;
};
volatile uint32_t ERASEALL;
volatile uint32_t ERASEPCR0;
volatile uint32_t ERASEUICR;
volatile const uint32_t RESERVED3[10];
volatile uint32_t ICACHECNF;
volatile const uint32_t RESERVED4;
volatile uint32_t IHIT;
volatile uint32_t IMISS;
} NRF_NVMC_Type;
typedef struct {
volatile const uint32_t RESERVED0[512];
ACL_ACL_Type ACL[8];
} NRF_ACL_Type;
typedef struct {
PPI_TASKS_CHG_Type TASKS_CHG[6];
volatile const uint32_t RESERVED0[308];
volatile uint32_t CHEN;
volatile uint32_t CHENSET;
volatile uint32_t CHENCLR;
volatile const uint32_t RESERVED1;
PPI_CH_Type CH[20];
volatile const uint32_t RESERVED2[148];
volatile uint32_t CHG[6];
volatile const uint32_t RESERVED3[62];
PPI_FORK_Type FORK[32];
} NRF_PPI_Type;
typedef struct {
volatile const uint32_t RESERVED0[64];
MWU_EVENTS_REGION_Type EVENTS_REGION[4];
volatile const uint32_t RESERVED1[16];
MWU_EVENTS_PREGION_Type EVENTS_PREGION[2];
volatile const uint32_t RESERVED2[100];
volatile uint32_t INTEN;
volatile uint32_t INTENSET;
volatile uint32_t INTENCLR;
volatile const uint32_t RESERVED3[5];
volatile uint32_t NMIEN;
volatile uint32_t NMIENSET;
volatile uint32_t NMIENCLR;
volatile const uint32_t RESERVED4[53];
MWU_PERREGION_Type PERREGION[2];
volatile const uint32_t RESERVED5[64];
volatile uint32_t REGIONEN;
volatile uint32_t REGIONENSET;
volatile uint32_t REGIONENCLR;
volatile const uint32_t RESERVED6[57];
MWU_REGION_Type REGION[4];
volatile const uint32_t RESERVED7[32];
MWU_PREGION_Type PREGION[2];
} NRF_MWU_Type;
typedef struct {
volatile uint32_t TASKS_START;
volatile uint32_t TASKS_STOP;
volatile const uint32_t RESERVED0[63];
volatile uint32_t EVENTS_RXPTRUPD;
volatile uint32_t EVENTS_STOPPED;
volatile const uint32_t RESERVED1[2];
volatile uint32_t EVENTS_TXPTRUPD;
volatile const uint32_t RESERVED2[122];
volatile uint32_t INTEN;
volatile uint32_t INTENSET;
volatile uint32_t INTENCLR;
volatile const uint32_t RESERVED3[125];
volatile uint32_t ENABLE;
I2S_CONFIG_Type CONFIG;
volatile const uint32_t RESERVED4[3];
I2S_RXD_Type RXD;
volatile const uint32_t RESERVED5;
I2S_TXD_Type TXD;
volatile const uint32_t RESERVED6[3];
I2S_RXTXD_Type RXTXD;
volatile const uint32_t RESERVED7[3];
I2S_PSEL_Type PSEL;
} NRF_I2S_Type;
typedef struct {
volatile const uint32_t UNUSED;
} NRF_FPU_Type;
typedef struct {
volatile const uint32_t RESERVED0;
volatile uint32_t TASKS_STARTEPIN[8];
volatile uint32_t TASKS_STARTISOIN;
volatile uint32_t TASKS_STARTEPOUT[8];
volatile uint32_t TASKS_STARTISOOUT;
volatile uint32_t TASKS_EP0RCVOUT;
volatile uint32_t TASKS_EP0STATUS;
volatile uint32_t TASKS_EP0STALL;
volatile uint32_t TASKS_DPDMDRIVE;
volatile uint32_t TASKS_DPDMNODRIVE;
volatile const uint32_t RESERVED1[40];
volatile uint32_t EVENTS_USBRESET;
volatile uint32_t EVENTS_STARTED;
volatile uint32_t EVENTS_ENDEPIN[8];
volatile uint32_t EVENTS_EP0DATADONE;
volatile uint32_t EVENTS_ENDISOIN;
volatile uint32_t EVENTS_ENDEPOUT[8];
volatile uint32_t EVENTS_ENDISOOUT;
volatile uint32_t EVENTS_SOF;
volatile uint32_t EVENTS_USBEVENT;
volatile uint32_t EVENTS_EP0SETUP;
volatile uint32_t EVENTS_EPDATA;
volatile uint32_t EVENTS_ACCESSFAULT;
volatile const uint32_t RESERVED2[38];
volatile uint32_t SHORTS;
volatile const uint32_t RESERVED3[63];
volatile uint32_t INTEN;
volatile uint32_t INTENSET;
volatile uint32_t INTENCLR;
volatile const uint32_t RESERVED4[61];
volatile uint32_t EVENTCAUSE;
volatile const uint32_t BUSSTATE;
volatile const uint32_t RESERVED5[6];
USBD_HALTED_Type HALTED;
volatile const uint32_t RESERVED6;
volatile uint32_t EPSTATUS;
volatile uint32_t EPDATASTATUS;
volatile const uint32_t USBADDR;
volatile const uint32_t RESERVED7[3];
volatile const uint32_t BMREQUESTTYPE;
volatile const uint32_t BREQUEST;
volatile const uint32_t WVALUEL;
volatile const uint32_t WVALUEH;
volatile const uint32_t WINDEXL;
volatile const uint32_t WINDEXH;
volatile const uint32_t WLENGTHL;
volatile const uint32_t WLENGTHH;
USBD_SIZE_Type SIZE;
volatile const uint32_t RESERVED8[15];
volatile uint32_t ENABLE;
volatile uint32_t USBPULLUP;
volatile uint32_t DPDMVALUE;
volatile uint32_t DTOGGLE;
volatile uint32_t EPINEN;
volatile uint32_t EPOUTEN;
volatile uint32_t EPSTALL;
volatile uint32_t ISOSPLIT;
volatile const uint32_t FRAMECNTR;
volatile const uint32_t RESERVED9[2];
volatile uint32_t LOWPOWER;
volatile uint32_t ISOINCONFIG;
volatile const uint32_t RESERVED10[51];
USBD_EPIN_Type EPIN[8];
USBD_ISOIN_Type ISOIN;
volatile const uint32_t RESERVED11[21];
USBD_EPOUT_Type EPOUT[8];
USBD_ISOOUT_Type ISOOUT;
} NRF_USBD_Type;
typedef struct {
volatile uint32_t TASKS_ACTIVATE;
volatile uint32_t TASKS_READSTART;
volatile uint32_t TASKS_WRITESTART;
volatile uint32_t TASKS_ERASESTART;
volatile uint32_t TASKS_DEACTIVATE;
volatile const uint32_t RESERVED0[59];
volatile uint32_t EVENTS_READY;
volatile const uint32_t RESERVED1[127];
volatile uint32_t INTEN;
volatile uint32_t INTENSET;
volatile uint32_t INTENCLR;
volatile const uint32_t RESERVED2[125];
volatile uint32_t ENABLE;
QSPI_READ_Type READ;
QSPI_WRITE_Type WRITE;
QSPI_ERASE_Type ERASE;
QSPI_PSEL_Type PSEL;
volatile uint32_t XIPOFFSET;
volatile uint32_t IFCONFIG0;
volatile const uint32_t RESERVED3[46];
volatile uint32_t IFCONFIG1;
volatile const uint32_t STATUS;
volatile const uint32_t RESERVED4[3];
volatile uint32_t DPMDUR;
volatile const uint32_t RESERVED5[3];
volatile uint32_t ADDRCONF;
volatile const uint32_t RESERVED6[3];
volatile uint32_t CINSTRCONF;
volatile uint32_t CINSTRDAT0;
volatile uint32_t CINSTRDAT1;
volatile uint32_t IFTIMING;
} NRF_QSPI_Type;
typedef struct {
volatile const uint32_t RESERVED0[321];
volatile uint32_t OUT;
volatile uint32_t OUTSET;
volatile uint32_t OUTCLR;
volatile const uint32_t IN;
volatile uint32_t DIR;
volatile uint32_t DIRSET;
volatile uint32_t DIRCLR;
volatile uint32_t LATCH;
volatile uint32_t DETECTMODE;
volatile const uint32_t RESERVED1[118];
volatile uint32_t PIN_CNF[32];
} NRF_GPIO_Type;
typedef struct {
volatile const uint32_t RESERVED0[320];
volatile uint32_t ENABLE;
} NRF_CRYPTOCELL_Type;
static inline unsigned int gcc_current_sp(void)
{
register unsigned sp __asm("sp");
return sp;
}
uint32_t sd_app_evt_wait(void);
static uint8_t m_in_critical_region = 0;
uint32_t sd_nvic_EnableIRQ(IRQn_Type IRQn)
{
NVIC_EnableIRQ(IRQn);
return ((0x0) + 0);
}
uint32_t sd_nvic_DisableIRQ(IRQn_Type IRQn)
{
NVIC_DisableIRQ(IRQn);
return ((0x0) + 0);
}
uint32_t sd_nvic_GetPendingIRQ(IRQn_Type IRQn, uint32_t * p_pending_irq)
{
if (p_pending_irq !=
((void *)0)
)
{
*p_pending_irq = NVIC_GetPendingIRQ(IRQn);
return ((0x0) + 0);
}
return ((0x0) + 14);
}
uint32_t sd_nvic_SetPendingIRQ(IRQn_Type IRQn)
{
NVIC_SetPendingIRQ(IRQn);
return ((0x0) + 0);
}
uint32_t sd_nvic_ClearPendingIRQ(IRQn_Type IRQn)
{
NVIC_ClearPendingIRQ(IRQn);
return ((0x0) + 0);
}
uint32_t sd_nvic_SetPriority(IRQn_Type IRQn, uint32_t priority)
{
NVIC_SetPriority(IRQn, priority);
return ((0x0) + 0);
}
uint32_t sd_nvic_GetPriority(IRQn_Type IRQn, uint32_t * p_priority)
{
if (p_priority !=
((void *)0)
)
{
*p_priority = NVIC_GetPriority(IRQn);
return ((0x0) + 0);
}
return ((0x0) + 14);
}
uint32_t sd_nvic_SystemReset(void)
{
NVIC_SystemReset();
return ((0x0) + 0);
}
uint32_t sd_nvic_critical_region_enter(uint8_t * p_is_nested_critical_region)
{
__disable_irq();
*p_is_nested_critical_region = (m_in_critical_region != 0);
m_in_critical_region++;
return ((0x0) + 0);
}
uint32_t sd_nvic_critical_region_exit(uint8_t is_nested_critical_region)
{
m_in_critical_region--;
if (is_nested_critical_region == 0)
{
m_in_critical_region = 0;
__enable_irq();
}
return ((0x0) + 0);
}
|
the_stack_data/125140773.c |
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
// The WASI implementation of assert pulls facilities for in printing to stderr
// and aborting. This is lighter weight for a unit test
static void assert(bool v)
{
if (!v) {
__builtin_unreachable();
}
}
void create_and_memset(int init_as, size_t size, char **ptr_outval)
{
char *area = malloc(size);
assert(area);
memset(area, init_as, size);
*ptr_outval = area;
}
void increment_ptr(char *ptr)
{
char val = *ptr;
*ptr = val + 1;
}
|
the_stack_data/76700397.c | #define _XOPEN_SOURCE 500
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <time.h>
#include <unistd.h>
static void sig_int(int signum);
static void sig_tstp(int signum);
int show = 1;
int main(){
struct sigaction sig_tstp_act;
sig_tstp_act.sa_handler = sig_tstp;
sigemptyset(&sig_tstp_act.sa_mask);
sig_tstp_act.sa_flags = 0;
char buffer[80];
if(signal(SIGINT, sig_int) == SIG_ERR){
fprintf(stderr, "Error with SIG_INT");
}
if(sigaction(SIGTSTP, &sig_tstp_act, NULL) == -1){
fprintf(stderr, "Error with SIG_TSTP");
}
while(1){
if(show){
time_t rawtime;
time(&rawtime);
struct tm *timeinfo = localtime(&rawtime);
strftime(buffer, 80, "%Y.%m.%d %H:%M:%S", timeinfo);
printf("%s\n", buffer);
}
sleep(1);
}
}
static void sig_int(int signum){
puts("\nOdebrano sygnal SIGINT");
exit(1);
}
static void sig_tstp(int signum){
if(show){
show = 0;
puts("\nOczekuje na CTRL+Z - kontynuacja albo CTRL+C - zakonczenie programu");
}
else{
show = 1;
}
}
|
the_stack_data/29826171.c | /*
* Copyright(C) 2009-2017 National Technology & Engineering Solutions
* of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
* NTESS, the U.S. Government retains certain rights in this software.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of NTESS nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifndef _MSC_VER
#include <sys/utsname.h>
#include <sys/times.h>
#endif
#include <time.h>
#include <unistd.h>
#ifndef __USE_XOPEN
#define __USE_XOPEN
#endif
#include <stdio.h>
void add_to_log(const char *my_name, double elapsed)
{
#ifndef _MSC_VER
#define LEN 512
char time_string[LEN];
char log_string[LEN];
double u_time, s_time;
struct utsname sys_info;
int minutes;
double seconds;
char *access_dir = NULL;
/* Don't log information if this environment variable is set */
if (getenv("SEACAS_NO_LOGGING") != NULL) {
fprintf(stderr, "SEACAS Audit logging disabled via SEACAS_NO_LOGGING setting.\n");
return;
}
/* Now try to find the $ACCESS/etc/audit.log file */
/* Don't need to try too hard since information is not critical; just useful */
access_dir = getenv("ACCESS");
if (access_dir != NULL) {
char filename[LEN];
snprintf(filename, LEN, "%s/etc/audit.log", access_dir);
if (0 == access(filename, W_OK)) {
FILE *audit = fopen(filename, "a");
if (audit != NULL) {
const char *codename = strrchr(my_name, '/');
const char *username = getlogin();
if (username == NULL) {
username = getenv("LOGNAME");
}
if (username == NULL) {
username = "UNKNOWN";
}
if (codename == NULL) {
codename = my_name;
}
else {
codename++;
}
{
time_t calendar_time = time(NULL);
struct tm *local_time = localtime(&calendar_time);
strftime(time_string, LEN, "%a %b %d %H:%M:%S %Z %Y", local_time);
}
{
int ticks_per_second;
struct tms time_buf;
times(&time_buf);
ticks_per_second = sysconf(_SC_CLK_TCK);
u_time = (double)(time_buf.tms_utime + time_buf.tms_cutime) / ticks_per_second;
s_time = (double)(time_buf.tms_stime + time_buf.tms_cstime) / ticks_per_second;
}
uname(&sys_info);
minutes = (int)(elapsed / 60.0);
seconds = elapsed - minutes * 60.0;
snprintf(log_string, LEN, "%s %s %s %.3fu %.3fs %d:%5.2f 0.0%% 0+0k 0+0io 0pf+0w %s\n",
codename, username, time_string, u_time, s_time, minutes, seconds,
sys_info.nodename) < 0
? abort()
: (void)0;
fprintf(audit, "%s", log_string);
fclose(audit);
}
}
}
#endif
}
|
the_stack_data/9514153.c | /**
* Copyright 2016 Comcast Cable Communications Management, LLC
*
* 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 "string.h"
/*----------------------------------------------------------------------------*/
/* Macros */
/*----------------------------------------------------------------------------*/
/* none */
/*----------------------------------------------------------------------------*/
/* Data Structures */
/*----------------------------------------------------------------------------*/
/* none */
/*----------------------------------------------------------------------------*/
/* File Scoped Variables */
/*----------------------------------------------------------------------------*/
/* none */
/*----------------------------------------------------------------------------*/
/* Function Prototypes */
/*----------------------------------------------------------------------------*/
/* none */
/*----------------------------------------------------------------------------*/
/* External Functions */
/*----------------------------------------------------------------------------*/
void parStrncpy(char *destStr, const char *srcStr, size_t destSize)
{
strncpy(destStr, srcStr, destSize-1);
destStr[destSize-1] = '\0';
}
/*----------------------------------------------------------------------------*/
/* Internal functions */
/*----------------------------------------------------------------------------*/
/* none */
|
the_stack_data/92325876.c | #include <stdio.h>
#include <stdlib.h>
main (){
int i = 0;
while(i < 100){
printf("%i\n", i);
i++;
}
system("pause");
return 0;
}
|
the_stack_data/100141814.c | /* Generated by CIL v. 1.7.0 */
/* print_CIL_Input is false */
struct _IO_FILE;
struct timeval;
extern float strtof(char const *str , char const *endptr ) ;
extern void signal(int sig , void *func ) ;
typedef struct _IO_FILE FILE;
extern int atoi(char const *s ) ;
extern double strtod(char const *str , char const *endptr ) ;
extern int fclose(void *stream ) ;
extern void *fopen(char const *filename , char const *mode ) ;
extern void abort() ;
extern void exit(int status ) ;
extern int raise(int sig ) ;
extern int fprintf(struct _IO_FILE *stream , char const *format , ...) ;
extern int strcmp(char const *a , char const *b ) ;
extern int rand() ;
extern unsigned long strtoul(char const *str , char const *endptr , int base ) ;
void RandomFunc(unsigned long input[1] , unsigned long output[1] ) ;
extern int strncmp(char const *s1 , char const *s2 , unsigned long maxlen ) ;
extern int gettimeofday(struct timeval *tv , void *tz , ...) ;
extern int printf(char const *format , ...) ;
int main(int argc , char *argv[] ) ;
void megaInit(void) ;
extern unsigned long strlen(char const *s ) ;
extern long strtol(char const *str , char const *endptr , int base ) ;
extern unsigned long strnlen(char const *s , unsigned long maxlen ) ;
extern void *memcpy(void *s1 , void const *s2 , unsigned long size ) ;
struct timeval {
long tv_sec ;
long tv_usec ;
};
extern void *malloc(unsigned long size ) ;
extern int scanf(char const *format , ...) ;
void megaInit(void)
{
{
}
}
void RandomFunc(unsigned long input[1] , unsigned long output[1] )
{
unsigned long state[1] ;
unsigned long local1 ;
unsigned short copy11 ;
char copy12 ;
{
state[0UL] = (input[0UL] + 914778474UL) * 67330564296145686UL;
local1 = 0UL;
while (local1 < 0UL) {
if (state[0UL] < local1) {
copy11 = *((unsigned short *)(& state[0UL]) + 0);
*((unsigned short *)(& state[0UL]) + 0) = *((unsigned short *)(& state[0UL]) + 3);
*((unsigned short *)(& state[0UL]) + 3) = copy11;
} else {
state[local1] = state[0UL] + state[local1];
}
if (state[0UL] == local1) {
copy12 = *((char *)(& state[0UL]) + 1);
*((char *)(& state[0UL]) + 1) = *((char *)(& state[0UL]) + 7);
*((char *)(& state[0UL]) + 7) = copy12;
}
local1 ++;
}
output[0UL] = state[0UL] - 348226201UL;
}
}
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] == 17188736330507584105UL) {
printf("You win!\n");
} else {
}
randomFuns_main_i7 = 0;
while (randomFuns_main_i7 < 1) {
printf("%lu\n", output[randomFuns_main_i7]);
randomFuns_main_i7 ++;
}
}
}
|
the_stack_data/126702302.c | //
// Advent of Code 2021
//
// Day 11
//
// Author: Simone Franza
//
// Thought process:
// Once an octopus flashed set its value to -9999, then after the step,
// all negative entries are set to 0
// Part 2: count flashes in a cycle and when it is == EDGE*EDGE stop
//
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define FILENAME "input"
#define EDGE 10
#define STEPS 100
void printField(int *data);
int main(int argv, char *argc[]) {
int enable_out = 0;
// Enable output
if (argv == 2 && !strcmp(argc[1], "-v"))
enable_out = 1;
// Part 1
int *data = calloc(sizeof(int), EDGE * EDGE);
int *data_pt2 = calloc(sizeof(int), EDGE * EDGE);
FILE *fp = fopen(FILENAME, "r");
size_t read_len;
for (int row = 0; row < EDGE; row++) {
char *str = fgetln(fp, &read_len);
for (int col = 0; col < EDGE; col++) {
data[row * EDGE + col] = str[col] - 48;
}
}
memcpy(data_pt2, data, sizeof(int)*EDGE*EDGE);
if(enable_out)
printField(data);
int flashes = 0;
for (int i = 0; i < STEPS; i++) {
// Update values
for (int j = 0; j < EDGE * EDGE; j++)
data[j]++;
// Flash
int total_flashes = 0;
int something_flashed = 1;
while(something_flashed) {
something_flashed = 0;
for (int row = 0; row < EDGE; row++) {
for (int col = 0; col < EDGE; col++) {
if (data[row * EDGE + col] <= 9)
continue;
// Top
if (row > 0)
data[(row - 1) * EDGE + col]++;
// Top right
if (row > 0 && col < EDGE - 1)
data[(row - 1) * EDGE + col + 1]++;
// Right
if (col < EDGE - 1)
data[row * EDGE + col + 1]++;
// Bottom right
if (col < EDGE - 1 && row < EDGE - 1)
data[(row + 1) * EDGE + col + 1]++;
// Bottom
if (row < EDGE - 1)
data[(row + 1) * EDGE + col]++;
// Bottom left
if (row < EDGE - 1 && col > 0)
data[(row + 1) * EDGE + col - 1]++;
// Left
if(col > 0)
data[row * EDGE + col - 1]++;
// Top left
if(col > 0 && row > 0)
data[(row - 1) * EDGE + col - 1]++;
something_flashed = 1;
total_flashes++;
data[row * EDGE + col] = -9999;
}
}
}
if(enable_out)
printField(data);
// Reset to zero
for(int i = 0; i < EDGE * EDGE; i++)
if(data[i] < 0)
data[i] = 0;
flashes += total_flashes;
}
printf("Total of %d flashes\n", flashes);
// Part 2
int res_steps = 1;
while(1) {
// Update values
for (int j = 0; j < EDGE * EDGE; j++)
data_pt2[j]++;
// Flash
int total_flashes = 0;
int something_flashed = 1;
while(something_flashed) {
something_flashed = 0;
for (int row = 0; row < EDGE; row++) {
for (int col = 0; col < EDGE; col++) {
if (data_pt2[row * EDGE + col] <= 9)
continue;
// Top
if (row > 0)
data_pt2[(row - 1) * EDGE + col]++;
// Top right
if (row > 0 && col < EDGE - 1)
data_pt2[(row - 1) * EDGE + col + 1]++;
// Right
if (col < EDGE - 1)
data_pt2[row * EDGE + col + 1]++;
// Bottom right
if (col < EDGE - 1 && row < EDGE - 1)
data_pt2[(row + 1) * EDGE + col + 1]++;
// Bottom
if (row < EDGE - 1)
data_pt2[(row + 1) * EDGE + col]++;
// Bottom left
if (row < EDGE - 1 && col > 0)
data_pt2[(row + 1) * EDGE + col - 1]++;
// Left
if(col > 0)
data_pt2[row * EDGE + col - 1]++;
// Top left
if(col > 0 && row > 0)
data_pt2[(row - 1) * EDGE + col - 1]++;
something_flashed = 1;
total_flashes++;
data_pt2[row * EDGE + col] = -9999;
}
}
}
if(enable_out)
printField(data_pt2);
// Reset to zero
for(int i = 0; i < EDGE * EDGE; i++)
if(data_pt2[i] < 0)
data_pt2[i] = 0;
if(total_flashes == EDGE*EDGE)
break;
res_steps++;
}
printf("Took %d steps for full flash\n", res_steps);
// Cleanup
free(data);
free(data_pt2);
fclose(fp);
return 0;
}
void printField(int *data) {
for (int i = 0; i < EDGE * EDGE; i++) {
if (data[i] < 0)
printf("\x1b[38;2;0;0;0m\x1b[48;2;255;255;255m0\x1b[0m");
else
printf("%d", data[i]);
if (i && (i + 1) % EDGE == 0)
putchar('\n');
}
putchar('\n');
}
|
the_stack_data/211080139.c | int max(int a, int b) {
if (a > b) {
return a;
} else {
return b;
}
}
void squares(int size1, int x_offset, int y_offset, int size2) {
//compute the max of size1 and (x_offset + size2). Call this w
int w = max(size1, x_offset + size2);
//compute the max of size1 and (y_offset + size2). Call this h
int h = max(size1, y_offset + size2);
//count from 0 to h. Call the number you count with y
for (int y = 0; y < h; y++) {
//count from 0 to w. Call the number you count with x
for (int x = 0; x < w; x++) {
//check if EITHER
// ((x is between x_offset and x_offset +size2) AND
// y is equal to either y_offset OR y_offset + size2 - 1 )
// OR
// ((y is between y_offset and y_offset + size2) AND
// x is equal to either x_offset OR x_offset + size2 -1)
// if so, print a *
if (((x >= x_offset && x < x_offset + size2) && (y == y_offset || y == y_offset + size2 - 1)) ||
((y >= y_offset && y < y_offset + size2) && (x == x_offset || x == x_offset + size2 - 1)))
{
printf("*");
} else if ((x < size1 && (y == 0 || y == size1 - 1)) || (y < size1 && (x == 0 || x == size1 - 1))) {
printf("#");
} else {
printf(" ");
}
//if not,
// check if EITHER
// x is less than size1 AND (y is either 0 or size1-1)
// OR
// y is less than size1 AND (x is either 0 or size1-1)
//if so, print a #
//else print a space
}
//when you finish counting x from 0 to w,
//print a newline
printf("\n");
}
}
|
the_stack_data/145453939.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
extern int __VERIFIER_nondet_int();
int main(){
int x = -2;
x++;
if (x < 2) {
if (x < 0) {
if (x < 3)
x++;
}
if (x < 5) {
if (x < 3);
}
x = x - 2;
x--;
if (x < 0)
goto ERROR;
}
EXIT: return 0;
ERROR: return 1;
}
|
the_stack_data/187643148.c | /* ------------------------------------------
* Copyright (c) 2017, Synopsys, Inc. All rights reserved.
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1) Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2) Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
* 3) Neither the name of the Synopsys, Inc., nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
--------------------------------------------- */
#if defined(MID_LWIP) && defined(MID_LWIP_CONTRIB)
#include <stddef.h>
#include <string.h>
#include "arc.h"
#include "arc_builtin.h"
#include "embARC_toolchain.h"
#include "embARC_error.h"
#include "arc_exception.h"
#include "hsdk/hsdk.h"
#ifdef ENABLE_OS
#include "os_hal_inc.h"
#endif
#include "pmwifi.h"
#define PMWIFI_CHECK_EXP(EXPR, ERROR_CODE) CHECK_EXP(EXPR, ercd, ERROR_CODE, error_exit)
#if (USE_HSDK_PMWIFI_0)
/** PMOD WIFI SPI FREQ & CLK MODE SETTINGS */
#define HSDK_PMWIFI_0_SPI_FREQ BOARD_SPI_FREQ
/* WF OPERATIONS */
#define HSDK_PMWIFI_0_SPI_ID BOARD_WIFI_SPI_ID
#define HSDK_PMWIFI_0_SPI_LINE BOARD_WIFI_SPI_LINE
#define HSDK_PMWIFI_0_GPIO_ID (DEV_GPIO_PORT_A)
#define HSDK_PMWIFI_0_INT_PIN (DEV_GPIO_PIN_22)
#define HSDK_PMWIFI_0_RST_PIN (DEV_GPIO_PIN_23)
#define HSDK_PMWIFI_0_WP_PIN (DEV_GPIO_PIN_NC)
#define HSDK_PMWIFI_0_HIB_PIN (DEV_GPIO_PIN_NC)
#define HSDK_PMWIFI_0_PIN_GAP (HSDK_PMWIFI_0_INT_PIN-WF_GPIO_INT_PIN_OFS)
/*********************PMOD WIFI -> MRF24WG*********************/
#if defined(WIFI_MRF24G)
#include "wf_dev_hal.h"
#include "mrf24g_adapter.h"
#define HSDK_PMWIFI_0_TIMER_ID TIMER_0
/** Test SPI Frequency to be 15MHz with both lock enable or disable */
//#define HSDK_PMWIFI_0_SPI_CPULOCK_ENABLE
/* gpio ops */
static int32_t pmwifi_0_gpio_open(uint32_t pin_mask, uint32_t pin_dir)
{
int32_t ercd = E_OK;
uint32_t mask;
DEV_GPIO *pmwifi_gpio_ptr;
pmwifi_gpio_ptr = gpio_get_dev(HSDK_PMWIFI_0_GPIO_ID);
PMWIFI_CHECK_EXP(pmwifi_gpio_ptr != NULL, E_OBJ);
pin_mask = ((pin_mask & WF_GPIO_PIN_MASK_ALL)<<HSDK_PMWIFI_0_PIN_GAP);
mask = (pin_dir<<HSDK_PMWIFI_0_PIN_GAP) & pin_mask;
ercd = pmwifi_gpio_ptr->gpio_open(mask);
if (ercd == E_OPNED) {
/* direction */
pmwifi_gpio_ptr->gpio_control(GPIO_CMD_SET_BIT_DIR_OUTPUT, (void *)mask);
mask = (~(pin_dir<<HSDK_PMWIFI_0_PIN_GAP)) & pin_mask;
pmwifi_gpio_ptr->gpio_control(GPIO_CMD_SET_BIT_DIR_INPUT, (void *)mask);
}
/* Default all set to pull */
ercd = pmwifi_gpio_ptr->gpio_control(GPIO_CMD_DIS_BIT_INT, (void *)pin_mask);
error_exit:
return ercd;
}
static int32_t pmwifi_0_gpio_close(uint32_t pin_mask)
{
static uint32_t close_mask = 0;
int32_t ercd = E_OK;
DEV_GPIO *pmwifi_gpio_ptr;
pmwifi_gpio_ptr = gpio_get_dev(HSDK_PMWIFI_0_GPIO_ID);
PMWIFI_CHECK_EXP(pmwifi_gpio_ptr != NULL, E_OBJ);
close_mask |= pin_mask;
close_mask &= WF_GPIO_PIN_MASK_ALL;
if (close_mask == WF_GPIO_PIN_MASK_ALL) { /* only close it when all pin need to be closed */
ercd = pmwifi_gpio_ptr->gpio_close();
close_mask = 0;
}
error_exit:
return ercd;
}
static int32_t pmwifi_0_gpio_read(uint32_t pin_mask, uint32_t *value)
{
int32_t ercd = E_OK;
DEV_GPIO *pmwifi_gpio_ptr;
pmwifi_gpio_ptr = gpio_get_dev(HSDK_PMWIFI_0_GPIO_ID);
PMWIFI_CHECK_EXP(pmwifi_gpio_ptr != NULL, E_OBJ);
pin_mask = ((pin_mask & WF_GPIO_PIN_MASK_ALL)<<HSDK_PMWIFI_0_PIN_GAP);
ercd = pmwifi_gpio_ptr->gpio_read(value, pin_mask);
*value = (*value) >> HSDK_PMWIFI_0_PIN_GAP;
error_exit:
return ercd;
}
static int32_t pmwifi_0_gpio_write(uint32_t pin_mask, uint32_t value)
{
int32_t ercd = E_OK;
DEV_GPIO *pmwifi_gpio_ptr;
pmwifi_gpio_ptr = gpio_get_dev(HSDK_PMWIFI_0_GPIO_ID);
PMWIFI_CHECK_EXP(pmwifi_gpio_ptr != NULL, E_OBJ);
pin_mask = ((pin_mask & WF_GPIO_PIN_MASK_ALL)<<HSDK_PMWIFI_0_PIN_GAP);
value = value << HSDK_PMWIFI_0_PIN_GAP;
ercd = pmwifi_gpio_ptr->gpio_write(value, pin_mask);
error_exit:
return ercd;
}
static int32_t pmwifi_0_gpio_eint_install(DEV_GPIO_HANDLER gpio_handler)
{
int32_t ercd = E_OK;
DEV_GPIO *pmwifi_gpio_ptr;
DEV_GPIO_BIT_ISR bit_isr;
DEV_GPIO_INT_CFG int_cfg;
pmwifi_gpio_ptr = gpio_get_dev(HSDK_PMWIFI_0_GPIO_ID);
PMWIFI_CHECK_EXP(pmwifi_gpio_ptr != NULL, E_OBJ);
int_cfg.int_bit_mask = (1<<HSDK_PMWIFI_0_INT_PIN);
int_cfg.int_bit_type = GPIO_INT_BIT_LEVEL_TRIG(HSDK_PMWIFI_0_INT_PIN);
int_cfg.int_bit_polarity = GPIO_INT_BIT_POL_ACT_LOW(HSDK_PMWIFI_0_INT_PIN);
int_cfg.int_bit_debounce = GPIO_INT_BIT_DIS_DEBOUNCE(HSDK_PMWIFI_0_INT_PIN);
ercd = pmwifi_gpio_ptr->gpio_control(GPIO_CMD_SET_BIT_INT_CFG, (void *)(&int_cfg));
bit_isr.int_bit_ofs = HSDK_PMWIFI_0_INT_PIN;
bit_isr.int_bit_handler = gpio_handler;
ercd = pmwifi_gpio_ptr->gpio_control(GPIO_CMD_SET_BIT_ISR, (void *)(&bit_isr));
error_exit:
return ercd;
}
static int32_t pmwifi_0_gpio_eint_is_enabled(void)
{
int32_t ercd = E_OK;
uint32_t mask;
uint32_t mthd;
DEV_GPIO *pmwifi_gpio_ptr;
pmwifi_gpio_ptr = gpio_get_dev(HSDK_PMWIFI_0_GPIO_ID);
PMWIFI_CHECK_EXP(pmwifi_gpio_ptr != NULL, E_OBJ);
mask = (1 << HSDK_PMWIFI_0_INT_PIN);
ercd = pmwifi_gpio_ptr->gpio_control(GPIO_CMD_GET_BIT_MTHD, (void *)(&mthd));
if (ercd == E_OK) {
mthd &= mask;
ercd = ((mthd==0) ? WF_EINT_DISABLE:WF_EINT_ENABLE);
}
error_exit:
return ercd;
}
static int32_t pmwifi_0_gpio_eint_control(int32_t state)
{
int32_t ercd = E_OK;
uint32_t mask;
DEV_GPIO *pmwifi_gpio_ptr;
pmwifi_gpio_ptr = gpio_get_dev(HSDK_PMWIFI_0_GPIO_ID);
PMWIFI_CHECK_EXP(pmwifi_gpio_ptr != NULL, E_OBJ);
mask = (1 << HSDK_PMWIFI_0_INT_PIN);
if (state == WF_EINT_ENABLE) {
ercd = pmwifi_gpio_ptr->gpio_control(GPIO_CMD_ENA_BIT_INT, (void *)mask);
} else {
ercd = pmwifi_gpio_ptr->gpio_control(GPIO_CMD_DIS_BIT_INT, (void *)mask);
}
error_exit:
return ercd;
}
/* wifi gpio operation object */
static WF_GPIO_OPS pmwifi_0_gpio_ops = {
pmwifi_0_gpio_open,
pmwifi_0_gpio_close,
pmwifi_0_gpio_read,
pmwifi_0_gpio_write,
pmwifi_0_gpio_eint_install,
pmwifi_0_gpio_eint_is_enabled,
pmwifi_0_gpio_eint_control
};
/* timer ops */
static int32_t pmwifi_0_timer_init(uint32_t freq)
{
return E_OK;
}
static uint32_t pmwifi_0_timer_read_ms(void)
{
return OSP_GET_CUR_MS();
}
static void pmwifi_0_timer_delay(uint32_t ms)
{
#ifdef OS_FREERTOS
vTaskDelay(ms);
#else
board_delay_ms(ms, OSP_DELAY_OS_COMPAT_ENABLE);
#endif
}
/* wifi timer operations object */
static WF_TIMER_OPS pmwifi_0_timer_ops = {
pmwifi_0_timer_init,
pmwifi_0_timer_read_ms,
pmwifi_0_timer_delay
};
/* spi ops */
static int32_t pmwifi_0_spi_open(uint32_t freq, uint32_t clk_mode)
{
int32_t ercd = E_OK;
DEV_SPI *pmwifi_spi_ptr;
pmwifi_spi_ptr = spi_get_dev(HSDK_PMWIFI_0_SPI_ID);
PMWIFI_CHECK_EXP(pmwifi_spi_ptr != NULL, E_OBJ);
ercd = pmwifi_spi_ptr->spi_open(DEV_MASTER_MODE, freq);
if ((ercd == E_OPNED) || (ercd == E_OK)) {
ercd = pmwifi_spi_ptr->spi_control(SPI_CMD_SET_CLK_MODE, CONV2VOID(clk_mode));
}
error_exit:
return ercd;
}
static int32_t pmwifi_0_spi_close(void)
{
int32_t ercd = E_OK;
DEV_SPI *pmwifi_spi_ptr;
pmwifi_spi_ptr = spi_get_dev(HSDK_PMWIFI_0_SPI_ID);
PMWIFI_CHECK_EXP(pmwifi_spi_ptr != NULL, E_OBJ);
ercd = pmwifi_spi_ptr->spi_close();
error_exit:
return ercd;
}
static int32_t pmwifi_0_spi_cs(int32_t cs)
{
int32_t ercd = E_OK;
DEV_SPI *pmwifi_spi_ptr;
uint32_t cs_line = HSDK_PMWIFI_0_SPI_LINE;
pmwifi_spi_ptr = spi_get_dev(HSDK_PMWIFI_0_SPI_ID);
PMWIFI_CHECK_EXP(pmwifi_spi_ptr != NULL, E_OBJ);
/* By default, the cs pin of DW SPI is used as chip select, which is not normal gpio
* THe cs pin will be desecelted when the FIFO of DW SPI is empty, may caused by interrupt.
* So lock cpu here to avoid this case happen
*/
if (cs == WF_CHIP_SELECTED) {
ercd = pmwifi_spi_ptr->spi_control(SPI_CMD_MST_SEL_DEV, CONV2VOID(cs_line));
} else {
ercd = pmwifi_spi_ptr->spi_control(SPI_CMD_MST_DSEL_DEV, CONV2VOID(cs_line));
}
error_exit:
return ercd;
}
static int32_t pmwifi_0_spi_transfer(DEV_SPI_TRANSFER *xfer)
{
int32_t ercd = E_OK;
DEV_SPI *pmwifi_spi_ptr;
pmwifi_spi_ptr = spi_get_dev(HSDK_PMWIFI_0_SPI_ID);
PMWIFI_CHECK_EXP(pmwifi_spi_ptr != NULL, E_OBJ);
PMWIFI_CHECK_EXP(xfer != NULL, E_PAR);
ercd = pmwifi_spi_ptr->spi_control(SPI_CMD_TRANSFER_POLLING, (void *)(xfer));
error_exit:
return ercd;
}
/* wifi spi operations object */
static WF_SPI_OPS pmwifi_0_spi_ops = {
pmwifi_0_spi_open,
pmwifi_0_spi_close,
pmwifi_0_spi_cs,
pmwifi_0_spi_transfer,
HSDK_PMWIFI_0_SPI_FREQ,
SPI_CPOL_0_CPHA_0
};
static WF_OPS pmwifi_0_ops = {
&pmwifi_0_gpio_ops,
&pmwifi_0_timer_ops,
&pmwifi_0_spi_ops
};
/** install wnic 0 to system */
#define PMWIFI_0_NAME "MRF24G"
#define PMWIFI_0_IFNAME0 'w'
#define PMWIFI_0_IFNAME1 '0'
static DEV_WNIC pmwifi_0_wnic;
const uint8_t pmwifi_0_mac_addr[WNIC_HDR_LEN] = {
HSDK_PMWIFI_0_MAC_ADDR0,
HSDK_PMWIFI_0_MAC_ADDR1,
HSDK_PMWIFI_0_MAC_ADDR2,
HSDK_PMWIFI_0_MAC_ADDR3,
HSDK_PMWIFI_0_MAC_ADDR4,
HSDK_PMWIFI_0_MAC_ADDR5
};
static int32_t pmwifi_0_wnic_get_info(uint32_t cmd, void *rinfo)
{
return mrf24g_wnic_get_info(&pmwifi_0_wnic, cmd, rinfo);
}
static int32_t pmwifi_0_wnic_control(uint32_t ctrl_cmd, void *param)
{
return mrf24g_wnic_control(&pmwifi_0_wnic, ctrl_cmd, param);
}
static int32_t pmwifi_0_wnic_init(uint32_t network_type)
{
return mrf24g_wnic_init(&pmwifi_0_wnic, network_type);
}
static int32_t pmwifi_0_poll_init_status(void)
{
return mrf24g_poll_init_status(&pmwifi_0_wnic);
}
static int32_t pmwifi_0_poll_busy_status(void)
{
return mrf24g_poll_busy_status(&pmwifi_0_wnic);
}
static int32_t pmwifi_0_set_network_type(uint32_t type)
{
return mrf24g_set_network_type(&pmwifi_0_wnic, type);
}
static int32_t pmwifi_0_set_macaddr(uint8_t *mac)
{
return mrf24g_set_macaddr(&pmwifi_0_wnic, mac);
}
static int32_t pmwifi_0_get_macaddr(uint8_t *mac)
{
return mrf24g_get_macaddr(&pmwifi_0_wnic, mac);
}
static int32_t pmwifi_0_start_scan(void)
{
return mrf24g_start_scan(&pmwifi_0_wnic);
}
static int32_t pmwifi_0_stop_scan(void)
{
return mrf24g_stop_scan(&pmwifi_0_wnic);
}
static int32_t pmwifi_0_poll_scan_status(void)
{
return mrf24g_poll_scan_status(&pmwifi_0_wnic);
}
static int32_t pmwifi_0_get_scan_result_cnt(void)
{
return mrf24g_get_scan_result_cnt(&pmwifi_0_wnic);
}
static int32_t pmwifi_0_get_scan_result(uint32_t index, WNIC_SCAN_RESULT *result)
{
return mrf24g_get_scan_result(&pmwifi_0_wnic, index, result);
}
static int32_t pmwifi_0_wnic_connect(uint32_t security, const uint8_t *ssid, WNIC_AUTH_KEY *key)
{
return mrf24g_wnic_connect(&pmwifi_0_wnic, security, ssid, key);
}
static int32_t pmwifi_0_poll_conn_status(void)
{
return mrf24g_poll_conn_status(&pmwifi_0_wnic);
}
static int32_t pmwifi_0_wnic_disconnect(void)
{
return mrf24g_wnic_disconnect(&pmwifi_0_wnic);
}
static int32_t pmwifi_0_prepare_tx(uint32_t tx_len)
{
return mrf24g_prepare_tx(&pmwifi_0_wnic, tx_len);
}
static int32_t pmwifi_0_add_tx_data(uint8_t *p_buf, uint32_t len)
{
return mrf24g_add_tx_data(&pmwifi_0_wnic, p_buf, len);
}
static int32_t pmwifi_0_commit_tx(uint32_t len)
{
return mrf24g_commit_tx(&pmwifi_0_wnic, len);
}
static int32_t pmwifi_0_prepare_rx(void)
{
return mrf24g_prepare_rx(&pmwifi_0_wnic);
}
static int32_t pmwifi_0_get_rx_data(uint8_t *p_buf, uint32_t len)
{
return mrf24g_get_rx_data(&pmwifi_0_wnic, p_buf, len);
}
static int32_t pmwifi_0_accept_rx(void)
{
return mrf24g_accept_rx(&pmwifi_0_wnic);
}
static int32_t pmwifi_0_config_power_mode(int32_t power_mode)
{
return mrf24g_config_power_mode(&pmwifi_0_wnic, power_mode);
}
static int32_t pmwifi_0_poll_power_mode(void)
{
return mrf24g_poll_power_mode(&pmwifi_0_wnic);
}
static int32_t pmwifi_0_wnic_reset(void)
{
return mrf24g_wnic_reset(&pmwifi_0_wnic);
}
static void pmwifi_0_period_process(void *ptr)
{
mrf24g_period_process(&pmwifi_0_wnic, ptr);
}
static void pmwifi_0_install(void)
{
DEV_WNIC *pmwifi_wnic_ptr = &pmwifi_0_wnic;
WF_OPS *pmwifi_ops_ptr = &pmwifi_0_ops;
DEV_WNIC_INFO *pmwifi_wnic_info_ptr = &(pmwifi_0_wnic.wnic_info);
DEV_WNIC_ON_OPS *pmwifi_wnic_on_ops_ptr = &(pmwifi_0_wnic.wnic_on_ops);
memcpy((void *)pmwifi_wnic_info_ptr->name, (void *)PMWIFI_0_NAME, strlen(PMWIFI_0_NAME));
pmwifi_wnic_info_ptr->ifname[0] = PMWIFI_0_IFNAME0;
pmwifi_wnic_info_ptr->ifname[1] = PMWIFI_0_IFNAME1;
memset((void *)&pmwifi_wnic_info_ptr->ssid, 0, sizeof(WNIC_CFG_SSID));
pmwifi_wnic_info_ptr->ssid.ssid[0] = '\0';
pmwifi_wnic_info_ptr->ctrl = (void *)pmwifi_ops_ptr;
pmwifi_wnic_info_ptr->extra = NULL;
pmwifi_wnic_info_ptr->opn_flg = DEV_CLOSED;
pmwifi_wnic_info_ptr->err_flg = DEV_GOOD;
pmwifi_wnic_info_ptr->network_type = WNIC_NETWORK_TYPE_INFRASTRUCTURE;
pmwifi_wnic_info_ptr->init_status = WNIC_NOT_INITIALIZED;
pmwifi_wnic_info_ptr->conn_status = WNIC_NOT_CONNECTED;
pmwifi_wnic_info_ptr->conn_type = WNIC_CONN_NONE;
pmwifi_wnic_info_ptr->mac_status = WNIC_MAC_NOT_UPDATED;
pmwifi_wnic_info_ptr->scan_status = WNIC_NOT_SCANED;
pmwifi_wnic_info_ptr->scan_results = 0;
memcpy((void *)pmwifi_wnic_info_ptr->mac_addr, (void *)pmwifi_0_mac_addr, WNIC_HDR_LEN);
pmwifi_wnic_info_ptr->busy_status = WNIC_IS_FREE;
pmwifi_wnic_info_ptr->tx_frame_cnt = 0;
pmwifi_wnic_info_ptr->tx_speed = 0;
pmwifi_wnic_info_ptr->tx_pending = 0;
pmwifi_wnic_info_ptr->rx_frame_cnt = 0;
pmwifi_wnic_info_ptr->rx_speed = 0;
pmwifi_wnic_info_ptr->rx_pending = 0;
pmwifi_wnic_info_ptr->power_status = WNIC_POWER_OFF;
pmwifi_wnic_on_ops_ptr->on_init_success = NULL;
pmwifi_wnic_on_ops_ptr->on_init_fail = NULL;
pmwifi_wnic_on_ops_ptr->on_connected = NULL;
pmwifi_wnic_on_ops_ptr->on_disconnected = NULL;
pmwifi_wnic_on_ops_ptr->on_mac_updated = NULL;
pmwifi_wnic_on_ops_ptr->on_scan_finished= NULL;
pmwifi_wnic_on_ops_ptr->on_rxdata_comes = NULL;
pmwifi_wnic_on_ops_ptr->on_dev_asserted = NULL;
pmwifi_wnic_ptr->wnic_get_info = pmwifi_0_wnic_get_info ;
pmwifi_wnic_ptr->wnic_control = pmwifi_0_wnic_control ;
pmwifi_wnic_ptr->wnic_init = pmwifi_0_wnic_init ;
pmwifi_wnic_ptr->poll_init_status = pmwifi_0_poll_init_status ;
pmwifi_wnic_ptr->poll_busy_status = pmwifi_0_poll_busy_status ;
pmwifi_wnic_ptr->set_network_type = pmwifi_0_set_network_type ;
pmwifi_wnic_ptr->set_macaddr = pmwifi_0_set_macaddr ;
pmwifi_wnic_ptr->get_macaddr = pmwifi_0_get_macaddr ;
pmwifi_wnic_ptr->start_scan = pmwifi_0_start_scan ;
pmwifi_wnic_ptr->stop_scan = pmwifi_0_stop_scan ;
pmwifi_wnic_ptr->poll_scan_status = pmwifi_0_poll_scan_status ;
pmwifi_wnic_ptr->get_scan_result_cnt = pmwifi_0_get_scan_result_cnt ;
pmwifi_wnic_ptr->get_scan_result = pmwifi_0_get_scan_result ;
pmwifi_wnic_ptr->wnic_connect = pmwifi_0_wnic_connect ;
pmwifi_wnic_ptr->poll_conn_status = pmwifi_0_poll_conn_status ;
pmwifi_wnic_ptr->wnic_disconnect = pmwifi_0_wnic_disconnect ;
pmwifi_wnic_ptr->prepare_tx = pmwifi_0_prepare_tx ;
pmwifi_wnic_ptr->add_tx_data = pmwifi_0_add_tx_data ;
pmwifi_wnic_ptr->commit_tx = pmwifi_0_commit_tx ;
pmwifi_wnic_ptr->prepare_rx = pmwifi_0_prepare_rx ;
pmwifi_wnic_ptr->get_rx_data = pmwifi_0_get_rx_data ;
pmwifi_wnic_ptr->accept_rx = pmwifi_0_accept_rx ;
pmwifi_wnic_ptr->config_power_mode = pmwifi_0_config_power_mode ;
pmwifi_wnic_ptr->poll_power_mode = pmwifi_0_poll_power_mode ;
pmwifi_wnic_ptr->wnic_reset = pmwifi_0_wnic_reset ;
pmwifi_wnic_ptr->period_process = pmwifi_0_period_process ;
}
WF_OPS_PTR get_wf_ops(void)
{
return &pmwifi_0_ops;
}
#else
#error "no wifi module selected"
#endif
#endif /* USE_HSDK_PMWIFI_0 */
/** get one wnic device structure */
DEV_WNIC_PTR wnic_get_dev(int32_t wnic_id)
{
static uint32_t install_flag = 0;
/* install device objects */
if (install_flag == 0) {
install_flag = 1;
pmwifi_all_install();
}
switch (wnic_id) {
#if (USE_HSDK_PMWIFI_0)
case HSDK_PMWIFI_0_ID:
return &pmwifi_0_wnic;
break;
#endif
default:
break;
}
return NULL;
}
/**
* \brief install all wnic objects
* \note \b MUST be called during system init
*/
void pmwifi_all_install(void)
{
/* use PMOD_B as pmwifi */
if (io_pmod_config(PMOD_B, PMOD_SPI, 1) != E_OK) {
while(1);
}
#if (USE_HSDK_PMWIFI_0)
pmwifi_0_install();
#endif
}
#endif /* MID_LWIP && MID_LWIP_CONTRIB */
|
the_stack_data/61329.c | #include <stdio.h>
#include <stdlib.h> /* exit() function declared here */
void filecopy(FILE *, FILE *);
int main(void)
{
FILE *src, *dst;
src = fopen("source.txt", "r");
dst = fopen("destination.txt", "w");
/* check error */
if (src == NULL || dst == NULL) {
printf("Unable to open file\n");
exit(1);
}
filecopy(src, dst);
fclose(src);
fclose(dst);
exit(0);
}
/* filecopy: copy file ifp to file ofp */
void filecopy(FILE *ifp, FILE *ofp)
{
int c;
while ((c = getc(ifp)) != EOF) {
/* The putc function normally return a copy of the byte that is has written - as confirmation of success.
If there is an error it returns EOF instead. */
if (putc(c, ofp) == EOF) {
printf("Error in writing to file\n");
exit(1);
}
}
if (feof(ifp)) { /* normal */
printf("End of file\n");
}
if (ferror(ifp)) { /* abnormal */
printf("Error in reading from file\n");
exit(1);
}
return;
} |
the_stack_data/127814.c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* rush02.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: kchenna <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/09/23 11:17:40 by eubotnar #+# #+# */
/* Updated: 2018/10/07 00:01:28 by kchenna ### ########.fr */
/* */
/* ************************************************************************** */
void ft_putchar(char c);
void ft_putstr(char *str);
void down(int i, int w, int h)
{
if (i > w && i <= w * (h - 1))
ft_putchar('B');
else if (i == 1 || i == w)
ft_putchar('A');
else
ft_putchar('C');
}
void side(int i, int w, int h)
{
if (i > 1 && i < w)
ft_putchar('B');
else if (i >= w * h - w + 1 && i < w * h)
ft_putchar('B');
else
ft_putchar(' ');
}
void rush(int w, int h)
{
int i;
i = 1;
while (i <= w * h && (w > 0 || h > 0))
{
if (i % w == 0 || i % w == 1 || i == 1)
{
down(i, w, h);
}
else
{
side(i, w, h);
}
if (i % w == 0)
ft_putchar('\n');
i++;
}
}
#include <stdlib.h>
int main(int argc, char **argv)
{
if (argc != 3)
{
ft_putchar('\n');
return (0);
}
int w = atoi(argv[1]);
int h = atoi(argv[2]);
rush(w, h);
return (0);
}
|
the_stack_data/1131187.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
typedef unsigned char __uint8_t;
typedef __uint8_t uint8_t;
struct const_passdb
{
char const
*filename;
char def[9U];
uint8_t off[9U];
uint8_t numfields;
uint8_t size_of;
};
static struct const_passdb const const_pw_db = { . filename = ( char const *) "/etc/passwd" ,
. def = "SsIIsss" ,
. off = { [ 0U ] = 0U , [ 1U ] = 8U , [ 2U ] = 16U ,
[ 7U ] = 20U , 24U , [ 5U ] = 40U } ,
. numfields = 7U , . size_of = 48U };
int main() {
char *test;
test = malloc(10);
if (test) {
if (const_pw_db.off[8] != 24) {
free(test);
}
}
return 0;
}
|
the_stack_data/168894229.c | /******************************************************************************
###############################################
# Copyright 2002-2003 Lucent Technologies Inc #
# All Rights Reserved #
###############################################
******************************************************************************/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
extern void setunpackenv();
main(argc,argv)
int argc;
char *argv[];
{
int ret;
setunpackenv();
ret = dis(argc,argv);
exit(ret);
}
/* Darwin type needs the symbols defined in uclean.c */
FORCE_UCLEAN() { uclean(); }
|
the_stack_data/154831075.c | #include <stdio.h>
int main()
{
int t,a,n,i,s;
scanf("%d %d",&a,&n);
t=a;
for(i=1;i<=n;i++)
{
s+=t;
t=t*10+a;
}
printf("%d\n",s);
return 0;
}
|
the_stack_data/231394399.c | #define _GNU_SOURCE
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <err.h>
char *TCID = "syscall.5";
int TST_TOTAL = 1;
char fname[100] = "";
void setup() {
sprintf(fname,"tfile_%d",getpid());
if( mknod(fname, S_IFIFO | 0644, (dev_t)0) < 0 )
err(1,"mknod failed");
}
void cleanup() {
unlink(fname);
}
int main() {
setup();
int result = open(fname, O_NONBLOCK | O_WRONLY);
if( result != -1 )
errx(1,"open succeeded unexpectedly");
if( errno != ENXIO )
errx(1,"Expected ENXIO");
cleanup();
return 0;
}
|
the_stack_data/92327525.c | #include <stdio.h>
#include <string.h>
int main()
{
char first[20];
char last[20];
printf("enter name:\n");
scanf("%s %s", first, last);
printf("%s %s\n", first, last);
printf("%*lu %*lu\n", (int) strlen(first), strlen(first), (int) strlen(last), strlen(last));
printf("%s %s\n", first, last);
printf("%-*lu %-*lu\n", (int) strlen(first), strlen(first), (int) strlen(last), strlen(last));
return 0;
} |
the_stack_data/385253.c | /*
* ATclock.c
* 5/16/90
* ATclock - read or set the IBM AT real-time clock
* Usage: /etc/ATclock [YY[MM[DD[HH[MM[.SS]]]]]]
* cc -s -i -O -o ATclock ATclock.c ATclockas.s
*
*/
#include <stdio.h>
#include <fcntl.h>
#define USAGE "Usage: /etc/ATclock [YY[MM[DD[HH[MM[.SS]]]]]]\n"
/* Offsets within clock memory. */
#define DIAG 14 /* Diagnostic port: bit(7) -> powerloss */
/* bit(2) -> bad time */
#define BADCLK 0x84
#define STAT 10 /* Status port: bit(7) -> updating */
#define UPDATE 0x80
#define YEAR 9
#define MON 8
#define DAY 7
#define HOUR 4
#define MIN 2
#define SEC 0
#define DEV_CMOS "/dev/cmos"
#define DEV_CLOCK "/dev/clock"
#define CLKLEN 10
/* Forward. */
int bcd();
void clock();
void clockcheck();
void fatal();
void sanity();
void set();
void usage();
int zget();
void zput();
/* Globals. */
unsigned char clkbuf[CLKLEN]; /* Clock image buffer (ten BCD digits). */
int fd_cmos;
int fd_clock;
/*
* zget()
*
* read a byte from a specified offset in CMOS
*
*/
int
zget(offset)
int offset;
{
int ret;
lseek(fd_cmos, (long)offset, 0);
if(read(fd_cmos, &ret, 1) != 1) {
fprintf(stderr, "Can't read CMOS byte %d\n", offset);
exit (1);
}
return ret & 0xff;
}
main(argc, argv) int argc; char *argv[];
{
if((fd_cmos = open(DEV_CMOS, O_RDONLY)) == -1) {
fprintf(stderr, "ATclock: can't read %s.\n",
DEV_CMOS);
exit(1);
}
if((fd_clock = open(DEV_CLOCK, O_RDONLY)) == -1) {
fprintf(stderr, "ATclock: can't read %s.\n",
DEV_CLOCK);
exit(1);
}
if (argc > 2)
usage();
if (zget(DIAG) & BADCLK)
fatal("bad clock"); /* check for valid clock */
if (read(fd_clock, clkbuf, CLKLEN) != CLKLEN) {
fprintf(stderr, "Can't read %d bytes from %s.\n",
CLKLEN, DEV_CLOCK);
exit(1);
}
if (argc == 2) {
close(fd_clock);
if((fd_clock = open(DEV_CLOCK, O_RDWR)) == -1) {
fprintf(stderr, "ATclock: can't write %s.\n",
DEV_CLOCK);
exit(1);
}
set(argv[1]); /* initialize clkbuf[] */
lseek(fd_clock, 0L, 0);
if (write(fd_clock, clkbuf, CLKLEN) != CLKLEN) {
fprintf(stderr, "Can't write %d bytes to %s.\n",
CLKLEN, DEV_CLOCK);
exit(1);
}
} else
clockcheck(); /* check clock */
/* Print formatted date. */
printf("%d%d%d%d%d%d%d%d%d%d.%d%d\n",
clkbuf[YEAR] >> 4, clkbuf[YEAR] & 15,
clkbuf[MON] >> 4, clkbuf[MON] & 15,
clkbuf[DAY] >> 4, clkbuf[DAY] & 15,
clkbuf[HOUR] >> 4, clkbuf[HOUR] & 15,
clkbuf[MIN] >> 4, clkbuf[MIN] & 15,
clkbuf[SEC] >> 4, clkbuf[SEC] & 15
);
close(fd_cmos);
close(fd_clock);
exit (0);
}
/*
* Change a numeric character string into two bcd digits.
*/
int
bcd(s) register char *s;
{
if (('0' <= s[0]) && (s[0] <= '9') && ('0' <= s[1]) && (s[1] <= '9'))
return (s[0] << 4) | (s[1] & 15);
fatal("argument contains nondigit");
}
/*
* Check the clkbuf[] for sanity.
*/
void
clockcheck()
{
sanity(YEAR, 0, 99, "year");
sanity(MON, 1, 12, "month");
sanity(DAY, 1, 31, "day");
sanity(HOUR, 0, 23, "hour");
sanity(MIN, 0, 59, "minute");
sanity(SEC, 0, 59, "second");
}
/*
* Cry and die.
*/
void
fatal(args) char *args;
{
fprintf(stderr, "/etc/ATclock: %r\n", &args);
exit(1);
}
/*
* Sanity check: make sure BCD clkbuf[i] is in the given range.
*/
void
sanity(i, min, max, msg) register int i; int min, max; char *msg;
{
register int n;
n = 10 * (clkbuf[i] >> 4) + (clkbuf[i] & 15);
if (n < min || n > max)
fatal("%s %d not in range %d to %d", msg, n, min, max);
}
/*
* Set clkbuf[] according to the argument string.
*/
void
set(s) register char *s;
{
register char *a;
a = s + strlen(s);
if ((&a[-3] >= s) && (a[-3] == '.')) {
clkbuf[SEC] = bcd(a -= 2);
a--;
} else
clkbuf[SEC] = 0;
if (&a[-2] >= s)
clkbuf[MIN] = bcd(a -= 2);
if (&a[-2] >= s)
clkbuf[HOUR] = bcd(a -= 2);
if (&a[-2] >= s)
clkbuf[DAY] = bcd(a -= 2);
if (&a[-2] >= s)
clkbuf[MON] = bcd(a -= 2);
if (&a[-2] >= s)
clkbuf[YEAR] = bcd(a -= 2);
if (a != s)
usage();
clockcheck();
}
/*
* Print a usage message and exit.
*/
void
usage()
{
fprintf(stderr, USAGE);
exit(1);
}
/* end of ATclock.c */
|
the_stack_data/103189.c | // XFAIL:*
//// Suboptimal coverage, see description below.
// REQUIRES: lldb
// UNSUPPORTED: system-windows
// RUN: %dexter --fail-lt 1.0 -w --debugger lldb \
// RUN: --builder 'clang-c' --cflags "-O3 -glldb" -- %s
//// Adapted from https://bugs.llvm.org/show_bug.cgi?id=34136#c1
//// LowerDbgDeclare has since been updated to look through bitcasts. We still
//// get suboptimal coverage at the beginning of 'main' though. For each local,
//// LowerDbgDeclare inserts a dbg.value and a dbg.value+DW_OP_deref before the
//// store (after the call to 'getint') and the call to 'alias' respectively.
//// The first dbg.value describes the result of the 'getint' call, eventually
//// becoming a register location. The second points back into the stack
//// home. There is a gap in the coverage between the quickly clobbered register
//// location and the stack location, even though the stack location is valid
//// during that gap. For x86 we end up with this code at the start of main:
//// 00000000004004b0 <main>:
//// 4004b0: sub rsp,0x18
//// 4004b4: mov edi,0x5
//// 4004b9: call 400480 <getint>
//// 4004be: mov DWORD PTR [rsp+0x14],eax
//// 4004c2: mov edi,0x5
//// 4004c7: call 400480 <getint>
//// 4004cc: mov DWORD PTR [rsp+0x10],eax
//// 4004d0: mov edi,0x5
//// 4004d5: call 400480 <getint>
//// 4004da: mov DWORD PTR [rsp+0xc],eax
//// ...
//// With these variable locations:
//// DW_TAG_variable
//// DW_AT_location (0x00000000:
//// [0x00000000004004be, 0x00000000004004cc): DW_OP_reg0 RAX
//// [0x00000000004004de, 0x0000000000400503): DW_OP_breg7 RSP+20)
//// DW_AT_name ("x")
//// ...
//// DW_TAG_variable
//// DW_AT_location (0x00000037:
//// [0x00000000004004cc, 0x00000000004004da): DW_OP_reg0 RAX
//// [0x00000000004004e8, 0x0000000000400503): DW_OP_breg7 RSP+16)
//// DW_AT_name ("y")
//// ...
//// DW_TAG_variable
//// DW_AT_location (0x0000006e:
//// [0x00000000004004da, 0x00000000004004e8): DW_OP_reg0 RAX
//// [0x00000000004004f2, 0x0000000000400503): DW_OP_breg7 RSP+12)
//// DW_AT_name ("z")
//// ...
char g = 1;
int five = 5;
__attribute__((__noinline__))
int getint(int x) {
g = x - 4;
return x * g;
}
__attribute__((__noinline__))
void alias(char* c) {
g = *c;
*c = (char)five;
}
int main() {
int x = getint(5);
int y = getint(5); // DexLabel('s1')
int z = getint(5); // DexLabel('s2')
alias((char*)&x); // DexLabel('s3')
alias((char*)&y);
alias((char*)&z);
return 0; // DexLabel('s4')
}
// DexExpectWatchValue('x', '5', from_line=ref('s1'), to_line=ref('s4'))
// DexExpectWatchValue('y', '5', from_line=ref('s2'), to_line=ref('s4'))
// DexExpectWatchValue('z', '5', from_line=ref('s3'), to_line=ref('s4'))
|
the_stack_data/1213739.c | #include <assert.h>
#include <string.h>
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/socket.h>
// DO NOT run this code!
void test_scanf() {
int n = 0, m = 0;
scanf("%d %d", &n, &m);
assert(n == 0); // UNKNOWN!
assert(m == 0); // UNKNOWN!
}
void test_memset() {
int n = 0;
memset(&n, 1, sizeof(int));
assert(n == 0); // UNKNOWN!
}
void test_bzero() {
int n = 1;
bzero(&n, sizeof(int));
assert(n == 0);
}
void test_getopt() {
}
void test_fprintf() {
}
void test_vfprintf() {
}
void test_vprintf() {
}
void test_free() {
int* n = malloc(sizeof(int));
*n = 0;
free(n);
assert(n != 0);
}
void test_memcpy() {
int dest = 0;
int src = 1;
memcpy(&dest, &src, sizeof(int));
assert(dest == 0); // UNKNOWN!
assert(src == 1);
}
void test_fopen() {
}
void test_connect() {
struct sockaddr sa;
sa.sa_family = 0;
connect(0, &sa, 0);
assert(sa.sa_family == 0);
}
void test_sprintf() {
}
void test_vsprintf() {
}
void test_localtime() {
time_t t = 1;
localtime(&t);
assert(t == 1);
}
void test_time() {
time_t t = 1;
time(&t);
assert(t == 1); // UNKNOWN!
}
void test_strftime() {
}
void test_snprintf() {
}
void test_send() {
int n = 0;
send(0, &n, sizeof(int), 0);
assert(n == 0);
}
void test_recv() {
int n = 0;
recv(0, &n, sizeof(int), 0);
assert(n == 0); // UNKNOWN!
}
void test_fwrite() {
int n = 0;
fwrite(&n, sizeof(int), 1, stdout);
assert(n == 0);
}
void test_atoi() {
}
void test_fflush() {
}
void test_strstr() {
}
void test_strlen() {
}
void test_strcmp() {
}
void test_strncpy() {
}
void test_strncmp() {
}
void test_write() {
int n = 0;
write(0, &n, sizeof(int));
assert(n == 0);
}
void test_fclose() {
}
void test_fread() {
int n = 0;
fread(&n, sizeof(int), 1, stdin);
assert(n == 0); // UNKNOWN!
}
void test_read() {
int n = 0;
read(0, &n, sizeof(int));
assert(n == 0); // UNKNOWN!
}
void test_printf() {
}
void test_sscanf() {
int n = 0, m = 0;
sscanf("10 20", "%d %d", &n, &m);
assert(n == 0); // UNKNOWN!
assert(m == 0); // UNKNOWN!
}
int main () {
test_atoi();
test_bzero();
test_connect();
test_fclose();
test_fflush();
test_fopen();
test_fprintf();
test_fread();
test_free();
test_fwrite();
test_getopt();
test_localtime();
test_memcpy();
test_memset();
test_printf();
test_read();
test_recv();
test_scanf();
test_send();
test_snprintf();
test_sprintf();
test_sscanf();
test_strcmp();
test_strftime();
test_strlen();
test_strncmp();
test_strncpy();
test_strstr();
test_time();
test_vfprintf();
test_vprintf();
test_vsprintf();
test_write();
assert(0); // FAIL!
return 0;
}
|
the_stack_data/90762059.c | #include <assert.h>
int main(void)
{
unsigned int x = 0;
unsigned int y = 0;
while (x < 0x00000A00) {
y = 0;
while (y < 10) {
y++;
}
x++;
}
assert(x % 2);
}
|
the_stack_data/162643547.c | #include<stdio.h>
int add(int a, int b);
int main()
{
int test1, test2;
test1 = 3;
test2 = 4;
int sum1 = add(test1, test2);
printf("%d\n", sum1);
return 0;
}
int add(int a, int b){
int sum;
sum = a+b;
return sum;
} |
the_stack_data/102201.c | //Classification: #default/n/ZD/AE/aS+dS/D(v)/fp/cd
//Written by: Alexey Salmin
//Reviewed by: Igor Eremeev
int f(int *p, int c) {
if (c == 0)
return 1 / *p;
return 0;
}
int main(void) {
int a = 0;
return f(&a, 1);
}
|
the_stack_data/125547.c | //
// Book: Programming in C, Prog. 2.1, p.111
//
#include <stdio.h>
int main (void)
{
printf ("Testing...\n...1\n...2\n...3\n");
return 0;
}
|
the_stack_data/37638027.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 , ...) ;
void megaInit(void)
{
{
}
}
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] == 0) {
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 RandomFunc(unsigned short input[1] , unsigned short output[1] )
{
unsigned short state[1] ;
unsigned short local2 ;
unsigned short local1 ;
{
state[0UL] = (input[0UL] | 51238316UL) >> (unsigned short)3;
local1 = 0UL;
while (local1 < input[1UL]) {
local2 = 0UL;
while (local2 < input[1UL]) {
if (state[0UL] > (local2 & local1)) {
state[local1] = state[local2] >> ((state[local2] & (unsigned short)7) | 1UL);
}
local2 += 2UL;
}
local1 += 2UL;
}
output[0UL] = state[0UL] << (unsigned short)1;
}
}
|
the_stack_data/73574467.c | #include <stdio.h>
int main() {
char s1[100] = "You need learn ", s2[] = "more and more";
int i, j;
for (i = 0; s1[i] != '\0'; ++i) {
printf("i = %d\n", i);
}
for (j = 0; s2[j] != '\0'; ++j, ++i) {
s1[i] = s2[j];
}
s1[i] = '\0';
printf("After Unification : ");
puts(s1);
return 0;
}
|
the_stack_data/1182652.c | struct bfu {
unsigned int a:4;
unsigned int :2;
unsigned int b:4;
};
unsigned int get__bfu_a(struct bfu bf) { return bf.a; }
unsigned int get__bfu_b(struct bfu bf) { return bf.b; }
unsigned int get_pbfu_a(struct bfu *bf) { return bf->a; }
unsigned int get_pbfu_b(struct bfu *bf) { return bf->b; }
struct bfs {
signed int a:4;
signed int :2;
signed int b:4;
};
signed int get__bfs_a(struct bfs bf) { return bf.a; }
signed int get__bfs_b(struct bfs bf) { return bf.b; }
signed int get_pbfs_a(struct bfs *bf) { return bf->a; }
signed int get_pbfs_b(struct bfs *bf) { return bf->b; }
/*
* check-name: bitfield size
* check-command: test-linearize -Wno-decl $file
* check-output-ignore
*
* check-output-excludes: and\\..*\\$960
* check-output-excludes: zext\\.
* check-output-pattern(4): and\\..*\\$15
* check-output-pattern(4): sext\\.
* check-output-pattern(4): trunc\\.4
* check-output-pattern(4): lsr\\..*\\$6
*/
|
the_stack_data/14574.c | /*$Header: /data/petsun4/data1/src_solaris/librms/RCS/dsvdcmp0.c,v 1.5 2013/01/20 05:51:39 avi Exp $*/
/*$Log: dsvdcmp0.c,v $
* Revision 1.5 2013/01/20 05:51:39 avi
* reconstitution documentation
*
* Revision 1.4 2012/11/26 07:18:42 avi
* void dsvdsqrtinv ()
*
* Revision 1.3 2012/09/05 22:07:43 avi
* dsvdinv();
*
* Revision 1.2 2011/03/05 02:32:48 avi
* ndsvdcmp0 () now sorts eigenvalues in reliably decreasing order
*
* Revision 1.1 2011/02/14 02:05:26 avi
* Initial revision
**/
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#define SIGN(a,b) ((b) > 0 ? fabs(a) : -fabs(a))
#define IMIN(a,b) ((a) < (b) ? (a) : (b))
#define FMAX(a,b) ((a) > (b) ? (a) : (b))
void svd_errm () {
fprintf (stderr, "memory allocation error in module dsvdcmp0\n");
exit (-1);
}
double **svd_calloc_double2 (int n1, int n2) {
int i;
double **a;
if (!(a = (double **) malloc (n1 * sizeof (double *)))) svd_errm ();
if (!(a[0] = (double *) calloc (n1 * n2, sizeof (double)))) svd_errm ();
for (i = 1; i < n1; i++) a[i] = a[0] + i*n2;
return a;
}
void svd_free_double2 (double **a) {
free (a[0]);
free (a);
}
double pythag (double a, double b) {
double absa, absb, q;
absa = fabs(a);
absb = fabs(b);
if (absa > absb) {
q = absb/absa;
return absa*sqrt(1.0+q*q);
} else {
q = absa/absb;
return (absb == 0.0) ? 0.0 : absb*sqrt(1.0+q*q);
}
}
/********************************************************************************/
/* version of svdcmp (NR p. 68) in which arrays a, w, and v use C indexing */
/********************************************************************************/
/* If dsvdcmp0 is used with FORTRAN compatible arrays (first index rows) then */
/* [E], [F], [G] are ncol x npts and V is npts x npts and W is npts */
/* tol is least allowable ratio of smallest to greatest eigenvalue */
/* [F] <- [E]; */
/* dsvdcmp0 (E, ncol, npts, W, V); */
/* n = ndsvdcmp0 (E, ncol, npts, W, V, tol); */
/* original [E] can be reconstituted as [Vt]*[W]*[E] */
/* for (j = 0; j < ncol; j++) for (i = 0; i < npts; i++) { */
/* for (k = 0; k < n; k++) G[j][i] += V[i][k]*W[k]*E[j][k]; */
/* } */
/* now [G] = [F] = original [E] */
/********************************************************************************/
void dsvdcmp0 (double **a, int m, int n, double *w, double **v) {
int flag,i,its,j,jj,k,l,nm;
double anorm,c,f,g,h,s,scale,x,y,z,*rv1;
if (!(rv1 = (double *) malloc (n*sizeof(double)))) svd_errm ();
g = scale = anorm = 0.0;
for (i = 0; i < n; i++) {
l=i+1;
rv1[i] = scale*g;
g = s = scale = 0.0;
if (i < m) {
for (k = i; k < m; k++) scale += fabs(a[k][i]);
if (scale) {
for (k = i; k < m; k++) {
a[k][i] /= scale;
s += a[k][i]*a[k][i];
}
f = a[i][i];
g = -SIGN(sqrt(s),f);
h = f*g-s;
a[i][i] = f-g;
for (j = l; j < n; j++) {
for (s = 0.0, k = i; k < m; k++) s += a[k][i]*a[k][j];
f = s/h;
for (k = i; k < m; k++) a[k][j] += f*a[k][i];
}
for (k = i; k < m; k++) a[k][i] *= scale;
}
}
w[i] = scale*g;
g = s = scale = 0.0;
if (i < m && i != n - 1) {
for (k = l; k < n; k++) scale += fabs(a[i][k]);
if (scale) {
for (k = l; k < n; k++) {
a[i][k] /= scale;
s += a[i][k]*a[i][k];
}
f = a[i][l];
g = -SIGN(sqrt(s),f);
h = f*g-s;
a[i][l] = f-g;
for (k = l; k < n; k++) rv1[k] = a[i][k]/h;
for (j = l; j < m; j++) {
for (s = 0.0, k = l; k < n; k++) s += a[j][k]*a[i][k];
for ( k = l; k < n; k++) a[j][k] += s*rv1[k];
}
for (k = l; k < n; k++) a[i][k] *= scale;
}
}
anorm = FMAX(anorm,(fabs(w[i])+fabs(rv1[i])));
}
for (i = n - 1; i >= 0; i--) {
if (i < n - 1) {
if (g) {
for (j = l; j < n; j++) v[j][i]=(a[i][j]/a[i][l])/g;
for (j = l; j < n; j++) {
for (s = 0.0, k = l; k < n; k++) s += a[i][k]*v[k][j];
for ( k = l; k < n; k++) v[k][j] += s*v[k][i];
}
}
for (j = l; j < n; j++) v[i][j]=v[j][i]=0.0;
}
v[i][i]=1.0;
g = rv1[i];
l=i;
}
for (i = IMIN(m - 1, n - 1); i >= 0; i--) {
l = i+1;
g = w[i];
for (j = l; j < n; j++) a[i][j]=0.0;
if (g) {
g = 1.0/g;
for (j = l; j < n; j++) {
for (s = 0.0, k = l; k < m; k++) s += a[k][i]*a[k][j];
f = (s/a[i][i])*g;
for (k = i; k < m; k++) a[k][j] += f*a[k][i];
}
for (j = i; j < m; j++) a[j][i] *= g;
}
else for (j = i; j < m; j++) a[j][i] = 0.0;
a[i][i] += 1.0;
}
for (k = n - 1; k >= 0; k--) {
for (its = 0; its < 30; its++) {
flag=1;
for (l = k; l > 0; l--) { /* correct apparent error in original code */
nm = l-1;
if ((double)(fabs(rv1[l])+anorm) == anorm) {
flag=0;
break;
}
if ((double)(fabs(w[nm])+anorm) == anorm) break;
}
if (flag) {
c=0.0; s=1.0;
for (i=l;i<=k;i++) {
f=s*rv1[i];
rv1[i] = c*rv1[i];
if ((double)(fabs(f)+anorm) == anorm) break;
g = w[i];
h = pythag(f,g);
w[i] = h;
h = 1.0/h;
c = g*h;
s = -f*h;
for (j = 0; j < m; j++) {
y = a[j][nm];
z = a[j][i];
a[j][nm] = y*c + z*s;
a[j][i] = z*c - y*s;
}
}
}
z=w[k];
if (l==k) {
if (z < 0.0) {
w[k] = -z;
for (j = 0; j < n; j++) v[j][k] = -v[j][k];
}
break;
}
if (its >= 30) { /* correct error in original code */
printf ("dsvdcmp0: no convergence in 30 iterations\n");
}
x = w[l];
nm = k-1;
y = w[nm];
g = rv1[nm];
h = rv1[k];
f = ((y-z)*(y+z)+(g-h)*(g+h))/(2.0*h*y);
g = pythag(f,1.0);
f = ((x-z)*(x+z)+h*((y/(f+SIGN(g,f)))-h))/x;
c = s = 1.0;
for (j=l;j<=nm;j++) {
i = j + 1;
g = rv1[i];
y = w[i];
h = s*g;
g = c*g;
z = pythag(f,h);
rv1[j] = z;
c = f/z;
s = h/z;
f = x*c + g*s;
g = g*c - x*s;
h = y*s;
y *= c;
for (jj = 0; jj < n; jj++) {
x = v[jj][j];
z = v[jj][i];
v[jj][j] = x*c + z*s;
v[jj][i] = z*c - x*s;
}
z = pythag(f,h);
w[j] = z;
if (z) {
z = 1.0/z;
c = f*z;
s = h*z;
}
f = c*g + s*y;
x = c*y - s*g;
for (jj = 0; jj < m; jj++) {
y = a[jj][j];
z = a[jj][i];
a[jj][j] = y*c + z*s;
a[jj][i] = z*c - y*s;
}
}
rv1[l] = 0.0;
rv1[k] = f;
w[k] = x;
}
}
free (rv1);
}
int mdsvdcmp0 (double **a, int m, int n, double *w, double **v, double tol) { /* obsolete */
int i, ii, j, *lw;
double wmax = 0.0;
if (!(lw = (int *) calloc (n, sizeof(int)))) svd_errm ();
for (i = 0; i < n; i++) if (w[i] > wmax) wmax = w[i];
for (i = 0; i < n; i++) if (w[i] > wmax*tol) lw[i]++;
for (ii = i = 0; i < n; i++ ) {
if (lw[i]) {
if (ii != i) {
for (j = 0; j < n; j++) v[j][ii] = v[j][i];
for (j = 0; j < m; j++) a[j][ii] = a[j][i];
w[ii] = w[i];
}
ii++;
}
}
free (lw);
return ii;
}
int ndsvdcmp0 (double **a, int m, int n, double *w, double **v, double tol) {
int i, ii, j, k;
double t, wmax = 0.0;
for (i = 0; i < n; i++) {
for (k = ii = i; k < n; k++) if (w[k] > w[ii]) ii = k;
if (ii != i) {
for (j = 0; j < n; j++) {
t = v[j][ii]; v[j][ii] = v[j][i]; v[j][i] = t;
}
for (j = 0; j < m; j++) {
t = a[j][ii]; a[j][ii] = a[j][i]; a[j][i] = t;
}
t = w[ii]; w[ii] = w[i]; w[i] = t;
}
}
for (i = 1; i < n; i++) if (w[i] < w[0]*tol) break;
return i;
}
void dsvdinv (double **A, int n, double *det) {
double **V, **H, *W;
int i, j, k;
V = svd_calloc_double2 (n, n);
H = svd_calloc_double2 (n, n);
if (!(W = (double *) malloc (n*sizeof (double)))) svd_errm ();
dsvdcmp0 (A, n, n, W, V);
*det = 1.; for (i = 0; i < n; i++) *det *= W[i];
for (j = 0; j < n; j++) for (i = 0; i < n; i++) H[j][i] = A[j][i]/W[i];
for (j = 0; j < n; j++) for (i = 0; i < n; i++) {
for (A[i][j] = k = 0; k < n; k++) A[i][j] += V[i][k]*H[j][k];
}
svd_free_double2 (V); svd_free_double2 (H); free (W);
}
void dsvdsqrtinv (double **A, int n, double *det) {
double **V, **H, *W;
int i, j, k;
V = svd_calloc_double2 (n, n);
H = svd_calloc_double2 (n, n);
if (!(W = (double *) malloc (n*sizeof (double)))) svd_errm ();
dsvdcmp0 (A, n, n, W, V);
*det = 1.; for (i = 0; i < n; i++) *det *= W[i];
for (j = 0; j < n; j++) for (i = 0; i < n; i++) H[j][i] = A[j][i]/sqrt(W[i]);
for (j = 0; j < n; j++) for (i = 0; i < n; i++) {
for (A[i][j] = k = 0; k < n; k++) A[i][j] += V[i][k]*H[j][k];
}
svd_free_double2 (V); svd_free_double2 (H); free (W);
}
|
the_stack_data/34512649.c | #include <stdio.h>
#include <stdlib.h>
struct Map {
int index;
char *keys;
int *data;
};
void apply(struct Map *map, char key, int value);
int getValue(struct Map *map, char key);
main() {
struct Map *map = (struct Map*)malloc(sizeof(struct Map));
map->index = 0;
map->keys = (char*)malloc(sizeof(char));
map->data = (int*)malloc(sizeof(int));
apply(map, "key1", 1);
apply(map, "key2", 2);
printf("%d\n", getValue(map, "key1")); // 1
printf("%d\n", getValue(map, "key2")); // 2
int v = getValue(map, "key1"); // 1
apply(map, "key1", 10);
apply(map, "key1New", v);
printf("%d\n", getValue(map, "key1")); // 10
printf("%d\n", getValue(map, "key1New")); // 1
}
void apply(struct Map *map, char key, int value) {
int index = map->index;
int find = -1;
for (int i = 0; i < index; i++) {
if (map->keys[i] == key) {
find = i;
break;
}
}
if (find < 0) {
map->keys[index] = key;
map->data[index] = value;
map->index++;
} else {
map->data[find] = value;
}
}
int getValue(struct Map *map, char key) {
int index = map->index;
int value = -1;
for (int i = 0; i < index; i++) {
if (map->keys[i] == key) {
value = map->data[i];
break;
}
}
return value;
}
|
the_stack_data/33232.c | //===-- CBackend.cpp - Library for converting LLVM code to C
//--------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===---------------------------------------------------------------------------===//
//
// This code tests to see that the CBE will execute a do-while statement
// correctly. *TW
//
//===---------------------------------------------------------------------------===//
int main() {
int x = 0;
do {
x++;
} while (x < 6);
return x;
}
|
the_stack_data/3977.c | #include <stdio.h>
int main()
{
int arr[5];
arr[0] = 5;
arr[2] = -10;
arr[3 / 2] = 2; // this is same as arr[1] = 2
arr[3] = arr[0];
printf("%d %d %d %d", arr[0], arr[1], arr[2], arr[3]);
return 0;
}
|
the_stack_data/1224125.c | /**
* Copyright (c) 2014 - 2017, Nordic Semiconductor ASA
*
* 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, except as embedded into a Nordic
* Semiconductor ASA integrated circuit in a product or a software update for
* such product, must reproduce the above copyright notice, this list of
* conditions and the following disclaimer in the documentation and/or other
* materials provided with the distribution.
*
* 3. Neither the name of Nordic Semiconductor ASA nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* 4. This software, with or without modification, must only be used with a
* Nordic Semiconductor ASA integrated circuit.
*
* 5. Any software provided in binary form under this license must not be reverse
* engineered, decompiled, modified and/or disassembled.
*
* THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/** @file
*
* @defgroup iot_sdk_app_nrf_socket_tcp_client main.c
* @{
* @ingroup iot_sdk_app_nrf
* @brief This file contains the source code for nRF TCP socket client.
*
*/
#include <stdio.h>
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <errno.h>
#define TCP_DATA_SIZE 8
int main(void)
{
struct sockaddr_in6 dest;
memset(&dest, 0, sizeof(dest));
dest.sin6_family = AF_INET6;
// Change this address to that of your server
(void)inet_pton(AF_INET6, "2001:db8::1", &dest.sin6_addr);
dest.sin6_port = htons(9000);
int ret = -1;
int s = -1;
while (ret < 0)
{
s = socket(AF_INET6, SOCK_STREAM, 0);
if (s < 0)
{
printf("Error creating socket.\r\n");
}
else
{
printf("Socket created.\r\n");
errno = 0;
ret = connect(s, (struct sockaddr *)&dest, sizeof(dest));
if (ret < 0)
{
printf("Error connecting to server, errno %d\r\n", errno);
(void) close(s);
(void) sleep(2);
}
}
}
printf("Connected to server!\r\n");
uint32_t seq_number = 0;
while (seq_number < 100)
{
uint8_t tcp_data[TCP_DATA_SIZE];
tcp_data[0] = (uint8_t )((seq_number >> 24) & 0x000000FF);
tcp_data[1] = (uint8_t )((seq_number >> 16) & 0x000000FF);
tcp_data[2] = (uint8_t )((seq_number >> 8) & 0x000000FF);
tcp_data[3] = (uint8_t )(seq_number & 0x000000FF);
tcp_data[4] = 'P';
tcp_data[5] = 'i';
tcp_data[6] = 'n';
tcp_data[7] = 'g';
errno = 0;
ssize_t nbytes = send(s, tcp_data, TCP_DATA_SIZE, 0);
if (nbytes != TCP_DATA_SIZE)
{
printf("Failed to send data, errno %d\r\n", errno);
}
else
{
printf("Data Tx, Sequence number 0x%08x\r\n", seq_number);
}
(void) sleep(1);
uint8_t rx_data[TCP_DATA_SIZE];
errno = 0;
nbytes = recv(s, rx_data, TCP_DATA_SIZE, 0);
if (nbytes != TCP_DATA_SIZE)
{
printf("Error receiving data (%d bytes), errno %d\r\n", (int)nbytes, errno);
}
else
{
uint32_t rx_seq_number = ((rx_data[0] << 24) & 0xFF000000);
rx_seq_number |= ((rx_data[1] << 16) & 0x00FF0000);
rx_seq_number |= ((rx_data[2] << 8) & 0x0000FF00);
rx_seq_number |= (rx_data[3] & 0x000000FF);
if (rx_seq_number != seq_number)
{
printf("Mismatch in sequence number.\r\n");
}
else
{
seq_number++;
}
}
}
(void) close(s);
return 0;
}
|
the_stack_data/36076410.c | /*
* Copyright (c) 1985, 1993
* The Regents of the University of California. All rights reserved.
*
* Portions copyright (c) 1999, 2000
* Intel Corporation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
*
* This product includes software developed by the University of
* California, Berkeley, Intel Corporation, and its contributors.
*
* 4. Neither the name of University, Intel Corporation, or their respective
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS, INTEL CORPORATION AND
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS,
* INTEL CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/*
* Portions Copyright (c) 1993 by Digital Equipment Corporation.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies, and that
* the name of Digital Equipment Corporation not be used in advertising or
* publicity pertaining to distribution of the document or software without
* specific, written prior permission.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
* CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
/*
* Portions Copyright (c) 1996 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)res_comp.c 8.1 (Berkeley) 6/4/93";
static char orig_rcsid[] = "From: Id: res_comp.c,v 8.11 1997/05/21 19:31:04 halley Exp $";
static char rcsid[] = "$Id: res_comp.c,v 1.1.1.1 2006/05/30 06:14:55 hhzhou Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
#include <sys/param.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <ctype.h>
#include <resolv.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#define BIND_4_COMPAT
/*
* Expand compressed domain name 'comp_dn' to full domain name.
* 'msg' is a pointer to the begining of the message,
* 'eomorig' points to the first location after the message,
* 'exp_dn' is a pointer to a buffer of size 'length' for the result.
* Return size of compressed name or -1 if there was an error.
*/
int
dn_expand(const u_char *msg, const u_char *eom, const u_char *src,
char *dst, int dstsiz)
{
int n = ns_name_uncompress(msg, eom, src, dst, (size_t)dstsiz);
if (n > 0 && dst[0] == '.')
dst[0] = '\0';
return (n);
}
/*
* Pack domain name 'exp_dn' in presentation form into 'comp_dn'.
* Return the size of the compressed name or -1.
* 'length' is the size of the array pointed to by 'comp_dn'.
*/
int
dn_comp(const char *src, u_char *dst, int dstsiz,
u_char **dnptrs, u_char **lastdnptr)
{
return (ns_name_compress(src, dst, (size_t)dstsiz,
(const u_char **)dnptrs,
(const u_char **)lastdnptr));
}
/*
* Skip over a compressed domain name. Return the size or -1.
*/
int
dn_skipname(const u_char *ptr, const u_char *eom) {
const u_char *saveptr = ptr;
if (ns_name_skip(&ptr, eom) == -1)
return (-1);
return ((int)(ptr - saveptr));
}
/*
* Verify that a domain name uses an acceptable character set.
*/
/*
* Note the conspicuous absence of ctype macros in these definitions. On
* non-ASCII hosts, we can't depend on string literals or ctype macros to
* tell us anything about network-format data. The rest of the BIND system
* is not careful about this, but for some reason, we're doing it right here.
*/
#define PERIOD 0x2e
#define hyphenchar(c) ((c) == 0x2d)
#define bslashchar(c) ((c) == 0x5c)
#define periodchar(c) ((c) == PERIOD)
#define asterchar(c) ((c) == 0x2a)
#define alphachar(c) (((c) >= 0x41 && (c) <= 0x5a) \
|| ((c) >= 0x61 && (c) <= 0x7a))
#define digitchar(c) ((c) >= 0x30 && (c) <= 0x39)
#define borderchar(c) (alphachar(c) || digitchar(c))
#define middlechar(c) (borderchar(c) || hyphenchar(c))
#define domainchar(c) ((c) > 0x20 && (c) < 0x7f)
int
res_hnok(dn)
const char *dn;
{
int ppch = '\0', pch = PERIOD, ch = *dn++;
while (ch != '\0') {
int nch = *dn++;
if (periodchar(ch)) {
(void)NULL;
} else if (periodchar(pch)) {
if (!borderchar(ch))
return (0);
} else if (periodchar(nch) || nch == '\0') {
if (!borderchar(ch))
return (0);
} else {
if (!middlechar(ch))
return (0);
}
ppch = pch, pch = ch, ch = nch;
}
return (1);
}
/*
* hostname-like (A, MX, WKS) owners can have "*" as their first label
* but must otherwise be as a host name.
*/
int
res_ownok(dn)
const char *dn;
{
if (asterchar(dn[0])) {
if (periodchar(dn[1]))
return (res_hnok(dn+2));
if (dn[1] == '\0')
return (1);
}
return (res_hnok(dn));
}
/*
* SOA RNAMEs and RP RNAMEs can have any printable character in their first
* label, but the rest of the name has to look like a host name.
*/
int
res_mailok(dn)
const char *dn;
{
int ch, escaped = 0;
/* "." is a valid missing representation */
if (*dn == '\0')
return (1);
/* otherwise <label>.<hostname> */
while ((ch = *dn++) != '\0') {
if (!domainchar(ch))
return (0);
if (!escaped && periodchar(ch))
break;
if (escaped)
escaped = 0;
else if (bslashchar(ch))
escaped = 1;
}
if (periodchar(ch))
return (res_hnok(dn));
return (0);
}
/*
* This function is quite liberal, since RFC 1034's character sets are only
* recommendations.
*/
int
res_dnok(dn)
const char *dn;
{
int ch;
while ((ch = *dn++) != '\0')
if (!domainchar(ch))
return (0);
return (1);
}
#ifdef BIND_4_COMPAT
/*
* This module must export the following externally-visible symbols:
* ___putlong
* ___putshort
* __getlong
* __getshort
* Note that one _ comes from C and the others come from us.
*/
void __putlong(u_int32_t src, u_char *dst) { ns_put32(src, dst); }
void __putshort(u_int16_t src, u_char *dst) { ns_put16(src, dst); }
u_int32_t _getlong(const u_char *src) { return (ns_get32(src)); }
u_int16_t _getshort(const u_char *src) { return (ns_get16(src)); }
#endif /*BIND_4_COMPAT*/
/*
* Weak aliases for applications that use certain private entry points,
* and fail to include <resolv.h>.
*/
#undef dn_comp
__weak_reference(__dn_comp, dn_comp);
#undef dn_expand
__weak_reference(__dn_expand, dn_expand);
|
the_stack_data/200142742.c | #include <stdio.h>
/* copy: from을 to에 복사, to가 충분히 크다*/
void copy(char from[], char to[])
{
int j;
j = 0;
while ((to[j] = from[j]) != '\0')
++j;
}
|
the_stack_data/45449472.c | #include <stdio.h>
int x=10,y=20;
int calculate (void)
{
int x=4, y=7;
return (x+y);
}
int main (void)
{
printf ("answer=%d\n",calculate());
return 0;
}
|
the_stack_data/26699138.c | /*Given a sorted array and a target value, return the index if the target is found. If not,
return the index where it would be if it were inserted in order.
You may assume no duplicates in the array.
Example 1:
Input: [1,3,5,6], 5
Output: 2
Example 2:
Input: [1,3,5,6], 2
Output: 1
Example 3:
Input: [1,3,5,6], 7
Output: 4
Example 4:
Input: [1,3,5,6], 0
Output: 0
*/
int searchInsert(int* nums, int numsSize, int target) {
int i,a=0;
for(i=0;i<numsSize;i++)
{
if(target > *(nums+i))
{
a++;
}
}
return a;
} |
the_stack_data/54866.c | #include<stdio.h>
int main(){
float pi = 3.14;
float raio = 6.50;
float area = 2 * pi * raio;
printf("%f", area);
return 0;
}
|
the_stack_data/59514045.c | #include <stdio.h>
#include <stdint.h>
int main() {
struct link {
struct link* next;
long long slot[8];
} stack[2], *sp;
for (uint64_t i = 0; i < 8388608; ++i) {
stack[0] = stack[1]; sp = stack + 1;
stack[0] = stack[1]; sp = stack + 1;
stack[0] = stack[1]; sp = stack + 1;
stack[0] = stack[1]; sp = stack + 1;
stack[0] = stack[1]; sp = stack + 1;
stack[0] = stack[1]; sp = stack + 1;
stack[0] = stack[1]; sp = stack + 1;
stack[0] = stack[1]; sp = stack + 1;
stack[0] = stack[1]; sp = stack + 1;
stack[0] = stack[1]; sp = stack + 1;
stack[0] = stack[1]; sp = stack + 1;
stack[0] = stack[1]; sp = stack + 1;
stack[0] = stack[1]; sp = stack + 1;
stack[0] = stack[1]; sp = stack + 1;
stack[0] = stack[1]; sp = stack + 1;
stack[0] = stack[1]; sp = stack + 1;
}
}
|
the_stack_data/134795.c | /*
* Copyright (c) 2015 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
typedef enum MyOption {
MyOption1 = 1 << 0,
MyOption2 = 1 << 1,
};
int main() {
enum MyOption option1 = MyOption1;
enum MyOption option2 = MyOption2;
}
|
the_stack_data/263776.c | /*
* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*/
#ifndef lint
static char sccsid[] = "@(#)error.c 5.1 (Berkeley) 04/30/85";
#endif not lint
/*
* error: default handling of errors.
*/
error(msg)
char *msg;
{
message(msg);
/* Maybe it would be nice to longjmp somewhere here */
}
|
the_stack_data/182953554.c | /* Copyright (c) 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 <unistd.h>
#include <stdlib.h>
static void prx(unsigned v)
{
char buf[10];
int i;
for (i = 0; i < 8; i++, v <<= 4)
buf[i] = "0123456789abcdef"[(v >> 28) & 15];
buf[i] = '\n';
write(1, buf, 9);
}
static void prp(void *p)
{
prx((unsigned)p);
}
int main()
{
prp(malloc(1024));
prp(malloc(2048));
prp(malloc(4096));
prp(malloc(8192));
return 0;
}
|
the_stack_data/1193480.c | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <stdbool.h>
#include <string.h>
#define SIZE 100
// the random number will be generated in range [-RANGE, RANGE]
#define RANGE 3
// divide the generated number, converted it into double. For example, if range = 10 and SCALE = 10, random number will between [-1, 1]
#define SCALE 1
clock_t start_t,finish_t;
double total_t;
double matrix[SIZE][SIZE];
double L[SIZE][SIZE];
double U[SIZE][SIZE];
double vec[SIZE][1];
double answers[SIZE][1];
double Y[SIZE][1];
void matrix_generator(){
for(int i = 0; i < SIZE; i ++){
for(int j = 0; j < SIZE; j ++){
matrix[i][j] = (double)(rand() % (RANGE * 2) - RANGE) / SCALE;
}
}
}
void vec_generator(){
for(int i = 0; i < SIZE; i ++){
vec[i][0] = (double)(rand() % (RANGE * 2) - RANGE) / SCALE;
}
}
void exporting(double* arr_2d, int rownum, int colnum, char* fname) {
// save in csv mode, split by ','
// 2d array visiting solution: https://stackoverflow.com/questions/16724368/how-to-pass-a-2d-array-by-pointer-in-c
FILE* fp = NULL;
fp = fopen(fname, "w");
double* p = (double*)arr_2d;
for (int i = 0; i < rownum; i++) {
for (int j = 0; j < colnum; j++) {
double ele = p[i * colnum + j];
fprintf(fp, "%f,", ele);
}
fprintf(fp, "\n");
}
fclose(fp);
}
void count(){
for(int i = 0; i < SIZE; i++){
double right = vec[i][0];
for(int j = 0; j < i; j++){
right -= L[i][j] * Y[j][0];
}
Y[i][0] = right/L[i][i];
}
for(int i = SIZE - 1; i > -1; i--){
double right = Y[i][0];
for(int j = SIZE - 1; j > i; j--){
right -= U[i][j] * answers[j][0];
}
answers[i][0] = right/U[i][i];
}
}
void get_lu(){
for(int i = 0; i < SIZE; i++){
for(int k = i; k < SIZE; k++){
double sum = 0;
for(int j = 0; j < i; j++){
sum += L[i][j] * U[j][k];
}
U[i][k] = matrix[i][k] - sum;
}
for(int k = i; k < SIZE; k++){
if(i == k){
L[i][i] = 1;
}
else{
double sum = 0;
for(int j = 0; j < i; j++){
sum += L[k][j] * U[j][i];
}
L[k][i] = (matrix[k][i] - sum)/U[i][i];
}
}
}
}
int find_maxrow(int col) {
int mx = 0;
int idx = 0;
for (int i = col; i < SIZE; i++) {
double cur = abs(matrix[i][col]);
if (cur > mx) {
mx = cur;
idx = i;
}
}
if (mx == 0) {
finish_t = clock();
total_t = (double)(finish_t - start_t) / CLOCKS_PER_SEC;
printf("Invalid Matrix\n");
printf("Spent time:%f \n",total_t);
exit(0);
}
return idx;
}
void swap(int a, int b) {
if (a != b) {
for (int i = 0; i < SIZE; i++) {
double tmp = matrix[a][i];
matrix[a][i] = matrix[b][i];
matrix[b][i] = tmp;
}
double tmp = vec[a][0];
vec[a][0] = vec[b][0];
vec[b][0] = tmp;
}
}
int re_arrange(){
for(int i = 0; i < SIZE; i++){
int a = find_maxrow(i);
swap(a, i);
}
}
bool checker(){
for(int i = 0; i < SIZE; i++){
double sum = 0;
for(int j = 0; j < SIZE; j++){
sum += answers[j][0] * matrix[i][j];
}
// keep 3 digits to compare
if((int)(sum * 1000 + 0.5)/1000.0 != (int)(vec[i][0] * 1000 + 0.5)/1000.0){
printf("For line %d, %f != %f\n", i, sum, vec[i][0]);
return false;
}
}
return true;
}
int main(int argc, char* argv[]){
printf("Start Processing......\n");
start_t = clock();
void *matrix_pointer = matrix;
void *vector_pointer = vec;
void *answer_pointer = answers;
void *L_pointer = L;
void *U_pointer = U;
vec_generator();
matrix_generator(matrix);
exporting(matrix_pointer, SIZE, SIZE, "matrix.csv");
exporting(vector_pointer, SIZE, 1, "vector.csv");
re_arrange();
// exporting(matrix_pointer, SIZE, SIZE, "arranged_mat.csv");
// exporting(vector_pointer, SIZE, 1, "arranged_vec.csv");
get_lu();
// exporting(L_pointer, SIZE, SIZE, "L.csv");
// exporting(U_pointer, SIZE, SIZE, "U.csv");
count();
exporting(answer_pointer, SIZE, 1, "answer.csv");
finish_t = clock();
total_t = (double)(finish_t - start_t) / CLOCKS_PER_SEC;
printf("Spent time:%f \n",total_t);
printf("Start Checking...\n");
bool result = checker();
if(result == true){
printf("Answer is correct\n");
}
else{
printf("Not a correct answer\n");
}
return 0;
} |
the_stack_data/37637031.c | #include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv){
FILE *f1,*f2;
unsigned char c1,c2;
unsigned i;
if (argc<3) return 0;
f1=fopen(argv[1],"rb");
f2=fopen(argv[2],"rb");
i=0;
c1=fgetc(f1);
c2=fgetc(f2);
while (!(feof(f1)||feof(f2))){
if (c1!=c2){
printf("at 0x%03X, c1=0x%02X and c2=0x%02X\n",i,c1,c2);
}
i++;
c1=fgetc(f1);
c2=fgetc(f2);
}
printf("bytes count: %u\n",i);
fclose(f1);
fclose(f2);
return 0;
}
|
the_stack_data/225143825.c | void f(int n) {
if (n<3) return;
n--;
f(n);
__VERIFIER_error();
}
void main() {
f(4);
}
|
the_stack_data/23368.c | /*
* C Program to Find Area of Trapezium
*/
#include <stdio.h>
int main()
{
float a, b, h;
float area;
printf("Enter the value for two bases & height of the trapezium: \n");
scanf("%f%f%f", &a, &b, &h);
area = 0.5 * (a + b) * h ;
printf("Area of the trapezium is: %.3f", area);
return 0;
}
|
the_stack_data/92328533.c | #include <stdio.h>
#include <string.h>
#define LEN 40
int main(void)
{
// string
char city1[]="pune";
char city2[]={'p', 'u', 'n', 'e', '\0'};
char city3[LEN]="Karad";
char city4[LEN]={'k', 'a', 'r', 'a','d', '\0'};
// array of char
char city5[LEN]={'k', 'a', 'r', 'a','d'};
printf("\n size of %s is %d", city1,sizeof(city1));
printf("\n length of %s is %d", city1,strlen(city1));
printf("\n size of %s is %d", city2,sizeof(city2));
printf("\n length of %s is %d", city2,strlen(city2));
printf("\n size of %s is %d", city3,sizeof(city3));
printf("\n length of %s is %d", city3,strlen(city3));
printf("\n size of %s is %d", city4,sizeof(city4));
printf("\n length of %s is %d", city4,strlen(city4));
printf("\n enter city3 :: ");
// scanf("%s", city3); // scan upto space
//gets(city3); // scan upto new line char
scanf("%[^.]s", city3);
puts(city3);
printf("\n city3=%s", city3);
char*ptr= city1;
while(*ptr!='\0')
{
printf("\t%c", *ptr);
ptr++;
}
return 0;
}
|
the_stack_data/181392464.c | /*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% M M AAA CCCC %
% MM MM A A C %
% M M M AAAAA C %
% M M A A C %
% M M A A CCCC %
% %
% %
% Macintosh Utility Methods for MagickCore %
% %
% Software Design %
% Cristy %
% September 1996 %
% %
% %
% Copyright 1999-2021 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
% obtain a copy of the License at %
% %
% https://imagemagick.org/script/license.php %
% %
% 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. %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% The directory methods are strongly based on similar methods written
% by Steve Summit, [email protected]. The Ghostscript launch code is strongly
% based on Dave Schooley's Mac Gnuplot and contributed by
% [email protected]. Mac-centric improvements contributed by
% [email protected].
%
%
*/
#if defined(macintosh)
/*
Include declarations.
*/
#define _X_H
#define _WIDGET_H
#include <AppleEvents.h>
#include <AERegistry.h>
#include <AEObjects.h>
#include <AEPackObject.h>
#include <Processes.h>
#include <QuickDraw.h>
#include <QDOffscreen.h>
#include <Palettes.h>
#include <ImageCompression.h>
#include <PictUtils.h>
#include <Files.h>
#include <Gestalt.h>
#include <TextUtils.h>
#define ColorInfo KolorInfo
#include "magick/studio.h"
#include "magick/blob.h"
#include "magick/client.h"
#include "magick/exception.h"
#include "magick/exception-private.h"
#include "magick/image-private.h"
#include "magick/list.h"
#include "magick/magick.h"
#include "magick/monitor.h"
#include "magick/monitor-private.h"
#include "magick/pixel-accessor.h"
#include "magick/quantum.h"
#include "magick/string_.h"
#include "magick/utility.h"
#include "magick/mac.h"
/*
Global declaractions.
*/
ImageDescriptionHandle
image_description = nil;
/*
Forward declaractions.
*/
static Boolean
SearchForFile(OSType,OSType,FSSpec *,short);
static pascal void
ArcMethod(GrafVerb,Rect *,short,short),
BitsMethod(BitMap *,Rect *,Rect *,short,RgnHandle),
FilenameToFSSpec(const char *filename,FSSpec *fsspec),
LineMethod(Point),
OvalMethod(GrafVerb,Rect *),
PolyMethod(GrafVerb,PolyHandle),
RRectMethod(GrafVerb,Rect *,short,short),
RectMethod(GrafVerb,Rect *),
RegionMethod(GrafVerb,RgnHandle),
StandardPixmap(PixMapPtr,Rect *,MatrixRecordPtr,short,RgnHandle,PixMapPtr,
Rect *,short),
TextMethod(short,Ptr,Point,Point);
/*
Static declarations
*/
#if defined(DISABLE_SIOUX)
static MACEventHookPtr
event_hook = nil;
static MACErrorHookPtr
exception.hook = nil;
#endif
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% B o t t l e n e c k T e s t %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% BottleneckTest() intercepts any compressed images.
%
% The format of the BottleneckTest method is:
%
% int BottleneckTest(const char *magick)
%
% A description of each parameter follows:
%
% o picture: Specifies a pointer to a PicHandle structure.
%
% o codec: the code type is returned in this CodecType pointer structure.
%
% o depth: the image depth is returned as an integer pointer.
%
% o colormap_id: the colormap ID is returned in this short pointer.
%
%
*/
static pascal void ArcMethod(GrafVerb verb,Rect *r,short startAngle,
short arcAngle)
{
#pragma unused (verb,r,startAngle,arcAngle)
}
static pascal void BitsMethod(BitMap *bitPtr,Rect *source_rectangle,
Rect *dstRect,short mode,RgnHandle maskRgn)
{
#pragma unused (bitPtr,source_rectangle,dstRect,mode,maskRgn)
}
static pascal void LineMethod(Point newPt)
{
#pragma unused (newPt)
}
static pascal void OvalMethod(GrafVerb verb,Rect *r)
{
#pragma unused (verb,r)
}
static pascal void PolyMethod(GrafVerb verb,PolyHandle poly)
{
#pragma unused (verb,poly)
}
static pascal void RectMethod(GrafVerb verb,Rect *r)
{
#pragma unused (verb,r)
}
static pascal void RegionMethod(GrafVerb verb,RgnHandle rgn)
{
#pragma unused (verb,rgn)
}
static pascal void RRectMethod(GrafVerb verb,Rect *r,short ovalWidth,
short ovalHeight)
{
#pragma unused (verb,r,ovalWidth,ovalHeight)
}
static pascal void StandardPixmap(PixMapPtr source,Rect *source_rectangle,
MatrixRecordPtr matrix,short mode,RgnHandle mask,PixMapPtr matte,
Rect *matte_rectangle,short flags)
{
#pragma unused (source_rectangle,matrix,mode,mask,matte,matte_rectangle,flags)
Ptr
data;
ssize_t
size;
GetCompressedPixMapInfo(source,&image_description,&data,&size,nil,nil);
}
static pascal void TextMethod(short byteCount,Ptr textBuf,Point numer,
Point denom)
{
#pragma unused (byteCount,textBuf,numer,denom)
}
#if !defined(DISABLE_QUICKTIME)
static short BottleneckTest(PicHandle picture,CodecType *codec,int *depth,
short *colormap_id)
{
CQDProcs
bottlenecks;
int
status;
Rect
rectangle;
ssize_t
version;
status=Gestalt(gestaltQuickTime,&version);
if (status != noErr)
{
ParamText("\pQuickTime not installed. Please install, then try again.",
"\p","\p","\p");
Alert(128,nil);
return(-1);
}
/*
Define our own bottlenecks to do nothing.
*/
SetStdCProcs(&bottlenecks);
bottlenecks.textProc=NewQDTextUPP(&TextMethod);
bottlenecks.lineProc=NewQDLineUPP(&LineMethod);
bottlenecks.rectProc=NewQDRectUPP(&RectMethod);
bottlenecks.rRectProc=NewQDRRectUPP(&RRectMethod);
bottlenecks.ovalProc=NewQDOvalUPP(&OvalMethod);
bottlenecks.arcProc=NewQDArcUPP(&ArcMethod);
bottlenecks.polyProc=NewQDPolyUPP(&PolyMethod);
bottlenecks.rgnProc=NewQDRgnUPP(&RegionMethod);
bottlenecks.bitsProc=NewQDBitsUPP(&BitsMethod);
bottlenecks.newProc1=(UniversalProcPtr) NewStdPixUPP(&StandardPixmap);
/*
Install our custom bottlenecks to intercept any compressed images.
*/
(*(qd.thePort)).grafProcs=(QDProcs *) &bottlenecks;
DrawPicture(picture,&((**picture).picFrame));
PaintRect(&rectangle);
(*(qd.thePort)).grafProcs=0L;
/*
Initialize our return values.
*/
*codec='unkn';
*depth=0;
*colormap_id=(-1);
if (image_description != nil)
{
*codec=(**image_description).cType;
*depth=(**image_description).depth;
*colormap_id=(**image_description).clutID;
}
DisposeQDTextUPP(bottlenecks.textProc);
DisposeQDLineUPP(bottlenecks.lineProc);
DisposeQDRectUPP(bottlenecks.rectProc);
DisposeQDRRectUPP(bottlenecks.rRectProc);
DisposeQDOvalUPP(bottlenecks.ovalProc);
DisposeQDArcUPP(bottlenecks.arcProc);
DisposeQDPolyUPP(bottlenecks.polyProc);
DisposeQDRgnUPP(bottlenecks.rgnProc);
DisposeQDBitsUPP(bottlenecks.bitsProc);
DisposeStdPixUPP(bottlenecks.newProc1);
return(0);
}
#endif
#if !defined(MAGICKCORE_POSIX_SUPPORT_VERSION)
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% c l o s e d i r %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% closedir() closes the named directory stream and frees the DIR structure.
%
% The format of the closedir method is:
%
% closedir(entry)
%
% A description of each parameter follows:
%
% o entry: Specifies a pointer to a DIR structure.
%
%
*/
MagickExport void closedir(DIR *entry)
{
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
assert(entry != (DIR *) NULL);
RelinquishMagickMemory(entry);
}
#endif
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% E x i t %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Exit() exits the process.
%
% The format of the exit method is:
%
% Exit(status)
%
% A description of each parameter follows:
%
% o status: an integer value representing the status of the terminating
% process.
%
%
*/
MagickExport int Exit(int status)
{
#if !defined(DISABLE_SIOUX)
(void) FormatLocaleFile(stdout,"Select File->Quit to exit.\n");
#endif
exit(status);
return(0);
}
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% F i l e n a m e T o F S S p e c %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% FilenameToFSSpec() sets the file type of an image.
%
% The format of the FilenameToFSSpec method is:
%
% FilenameToFSSpec(filename,fsspec)
%
% A description of each parameter follows:
%
% o filename: Specifies the name of the file.
%
% o fsspec: A pointer to type FSSpec.
%
%
*/
MagickExport void pascal FilenameToFSSpec(const char *filename,FSSpec *fsspec)
{
Str255
name;
assert(filename != (char *) NULL);
c2pstrcpy(name,filename);
FSMakeFSSpec(0,0,name,fsspec);
}
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% I s M a g i c k C o n f l i c t %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MACIsMagickConflict() returns true if the image format conflicts with a
% logical drive (.e.g. X:).
%
% Contributed by Mark Gavin of Digital Applications, Inc.
%
% The format of the MACIsMagickConflict method is:
%
% status=MACIsMagickConflict(magick)
%
% A description of each parameter follows:
%
% o magick: Specifies the image format.
%
%
*/
static OSErr HGetVInfo(short volume_index,StringPtr volume_name,short *volume,
size_t *free_bytes,size_t *total_bytes)
{
HParamBlockRec
pb;
OSErr
result;
size_t
blocksize;
unsigned short
allocation_blocks,
free_blocks;
/*
Use the File Manager to get the real vRefNum.
*/
pb.volumeParam.ioVRefNum=0;
pb.volumeParam.ioNamePtr=volume_name;
pb.volumeParam.ioVolIndex=volume_index;
result=PBHGetVInfoSync(&pb);
if (result != noErr)
return(result);
*volume=pb.volumeParam.ioVRefNum;
blocksize=(size_t) pb.volumeParam.ioVAlBlkSiz;
allocation_blocks=(unsigned short) pb.volumeParam.ioVNmAlBlks;
free_blocks=(unsigned short) pb.volumeParam.ioVFrBlk;
*free_bytes=free_blocks*blocksize;
*total_bytes=allocation_blocks*blocksize;
return(result);
}
MagickExport MagickBooleanType MACIsMagickConflict(const char *magick)
{
size_t
free_bytes,
number_bytes;
OSErr
status;
short
volume;
Str255
volume_name;
assert(magick != (char *) NULL);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",magick);
(void) CopyMagickString((char *) volume_name,magick,MaxTextExtent);
c2pstr((char *) volume_name);
if (volume_name[volume_name[0]] != ':')
volume_name[++volume_name[0]]=':';
status=HGetVInfo(-1,volume_name,&volume,&free_bytes,&number_bytes);
return(status != 0 ? MagickFalse : MagickTrue);
}
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
+ M A C E r r o r H a n d l e r %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MACErrorHandler() displays an error reason and then terminates the program.
%
% The format of the MACErrorHandler method is:
%
% void MACErrorHandler(const ExceptionType error,const char *reason,
% const char *description)
%
% A description of each parameter follows:
%
% o exception: Specifies the numeric error category.
%
% o reason: Specifies the reason to display before terminating the
% program.
%
% o description: Specifies any description to the reason.
%
%
*/
MagickExport void MACErrorHandler(const ExceptionType error,const char *reason,
const char *description)
{
char
buffer[3*MaxTextExtent];
if (reason == (char *) NULL)
return;
if (description == (char *) NULL)
(void) FormatLocaleString(buffer,MaxTextExtent,"%s: %s.\n",GetClientName(),
reason);
else
(void) FormatLocaleString(buffer,MaxTextExtent,"%s: %s (%s).\n",
GetClientName(),reason,description);
#if defined(DISABLE_SIOUX)
if(exception.hook != (MACErrorHookPtr) NULL)
exception.hook(error,buffer);
else
{
MagickCoreTerminus();
exit(error);
}
#else
puts(buffer);
MagickCoreTerminus();
exit(error);
#endif
}
#if defined(DISABLE_SIOUX)
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
+ M A C F a t a l E r r o r H a n d l e r %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MACFatalErrorHandler() displays an error reason and then terminates the
% program.
%
% The format of the MACFatalErrorHandler method is:
%
% void MACFatalErrorHandler(const ExceptionType severity,
% const char *reason,const char *description)
%
% A description of each parameter follows:
%
% o severity: Specifies the numeric error category.
%
% o reason: Specifies the reason to display before terminating the
% program.
%
% o description: Specifies any description to the reason.
%
*/
static void MACFatalErrorHandler(const ExceptionType severity,
const char *reason,const char *description)
{
char
buffer[3*MaxTextExtent];
if (reason == (char *) NULL)
return;
if (description == (char *) NULL)
(void) FormatLocaleString(buffer,MaxTextExtent,"%s: %s.\n",GetClientName(),
reason);
else
(void) FormatLocaleString(buffer,MaxTextExtent,"%s: %s (%s).\n",
GetClientName(),reason,description);
if(exception.hook != (MACErrorHookPtr) NULL)
exception.hook(severity, buffer);
else
{
MagickCoreTerminus();
exit(severity);
}
}
#endif
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% M a c G S E x e c u t e C o m m a n d %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MacGSExecuteCommand() executes the Ghostscript command.
%
%
*/
static OSErr MacGSExecuteCommand(const char *command,ssize_t length)
{
AEAddressDesc
event_descriptor;
AEDesc
reply = {typeNull, NULL};
AppleEvent
event = {typeNull, NULL};
DescType
descriptor_type;
int
error;
OSType
id = 'gsVR';
Size
actualSize;
/*
Send the Apple Event.
*/
(void) AECreateDesc(typeApplSignature,&id,sizeof(id),&event_descriptor);
(void) AECreateAppleEvent(id,'exec',&event_descriptor,-1,kAnyTransactionID,
&event);
(void) AEPutParamPtr(&event,keyDirectObject,typeChar,command,length);
(void) AESend(&event,&reply,kAEWaitReply+kAENeverInteract,kAENormalPriority,
kNoTimeOut,NULL,NULL);
/*
Handle the reply and exit.
*/
(void) AEGetParamPtr(&reply,keyDirectObject,typeInteger,&descriptor_type,
&error,sizeof(error),&actualSize);
(void) AEDisposeDesc(&event_descriptor);
(void) AEDisposeDesc(&event);
if (reply.descriptorType != NULL)
AEDisposeDesc(&reply);
return((OSErr) error);
}
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% M a c G S L a u n c h A p p l i c a t i o n C o r e %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MacGSLaunchApplicationCore() launches the Ghostscript command.
%
%
*/
static OSErr MacGSLaunchApplicationCore(ssize_t flags)
{
FSSpec
file_info;
LaunchParamBlockRec
launch_info;
OSErr
error;
if (!SearchForFile('gsVR','APPL',&file_info,1))
return(-43);
launch_info.launchBlockID=extendedBlock;
launch_info.launchEPBLength=extendedBlockLen;
launch_info.launchFileFlags=0;
launch_info.launchControlFlags=launchContinue+launchNoFileFlags+flags;
launch_info.launchAppSpec=(&file_info);
launch_info.launchAppParameters=nil;
error=LaunchApplication(&launch_info);
return(error);
}
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% M a c G S L a u n c h A p p l i c a t i o n %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MacGSLaunchApplication() launches the Ghostscript command.
%
%
*/
static OSErr MacGSLaunchApplication(void)
{
return(MacGSLaunchApplicationCore(launchDontSwitch));
}
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% M a c G S L a u n c h A p p l i c a t i o n T o F r o n t %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MacGSLaunchApplicationToFront() moves the Ghostscript window to the front.
%
%
*/
static OSErr MacGSLaunchApplicationToFront(void)
{
return(MacGSLaunchApplicationCore(0));
}
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% M a c G S Q u i t A p p l i c a t i o n %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MacGSQuitApplication() quits the Ghostscript application.
%
%
*/
static void MacGSQuitApplication(void)
{
AEAddressDesc
event_descriptor;
AEDesc
reply = {typeNull, NULL};
AppleEvent
event = {typeNull, NULL};
OSType
id = 'GPLT';
/*
Send the Apple Event.
*/
(void) AECreateDesc(typeApplSignature,&id,sizeof(id),&event_descriptor);
(void) AECreateAppleEvent(typeAppleEvent,kAEQuitApplication,
&event_descriptor,-1,kAnyTransactionID,&event);
(void) AESend(&event,&reply,kAENoReply,kAENormalPriority,kNoTimeOut,NULL,
NULL);
/*
Clean up and exit.
*/
(void) AEDisposeDesc(&event_descriptor);
(void) AEDisposeDesc(&event);
if (reply.descriptorType != NULL)
AEDisposeDesc(&reply);
}
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% M a c G S S e t W o r k i n g F o l d e r %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MacGSSetWorkingFolder() set the Ghostscript working folder.
%
%
*/
static OSErr MacGSSetWorkingFolder(char *directory)
{
AEDesc
application_descriptor,
event_descriptor,
object,
path_descriptor,
type_descriptor,
reply;
AppleEvent
event;
DescType
folder_type = 'wfdr';
OSErr
error;
OSType
id = 'GPLT';
/*
Send the Apple Event.
*/
AECreateDesc(typeNull,NULL,0,&application_descriptor);
AECreateDesc(typeChar,directory,strlen(directory),&path_descriptor);
(void) AECreateDesc(typeType,&folder_type,sizeof(DescType),&type_descriptor);
CreateObjSpecifier(cProperty,&application_descriptor,formPropertyID,
&type_descriptor,0,&object);
(void) AECreateDesc(typeApplSignature,&id,sizeof(id),&event_descriptor);
(void) AECreateAppleEvent(kAECoreSuite,kAESetData,&event_descriptor,-1,
kAnyTransactionID,&event);
(void) AEPutParamDesc(&event,keyDirectObject,&object);
(void) AEPutParamDesc(&event,keyAEData,&path_descriptor);
error=AESend(&event,&reply,kAENoReply+kAENeverInteract,kAENormalPriority,
kNoTimeOut,NULL,NULL);
(void) AEDisposeDesc(&event);
(void) AEDisposeDesc(&event_descriptor);
(void) AEDisposeDesc(&object);
(void) AEDisposeDesc(&type_descriptor);
(void) AEDisposeDesc(&path_descriptor);
(void) AEDisposeDesc(&application_descriptor);
return(error);
}
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% M A C S e t E r r o r H o o k %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MACSetErrorHook sets a callback function which is called if any error
% occurs within ImageMagick.
%
% The format of the MACSetErrorHook method is:
%
% int MACSetErrorHook(MACErrorHookPtr hook)
%
% A description of each parameter follows:
%
% o hook: This function pointer is the callback function.
%
%
*/
MagickExport void MACSetErrorHook(MACErrorHookPtr hook)
{
/*
We forget any previously set exception.hook.
*/
exception.hook=hook;
}
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% M A C S e t E v e n t H o o k %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MACSetEventHook sets a callback function which is called every time
% ImageMagick likes to release the processor.
%
% The format of the MACSetEventHook method is:
%
% int MACSetEventHook(MACEventHookPtr hook)
%
% A description of each parameter follows:
%
% o hook: This function pointer is the callback function.
%
%
*/
MagickExport void MACSetEventHook(MACEventHookPtr hook)
{
/*
We forget any previously set event hook.
*/
event_hook=hook;
}
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% M A C S y s t e m C o m m a n d %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Method MACSystemCommand executes the specified command and waits until it
% terminates. The returned value is the exit status of the command.
%
% The format of the MACSystemCommand method is:
%
% int MACSystemCommand(MagickFalse,const char * command)
%
% A description of each parameter follows:
%
% o command: This string is the command to execute.
%
*/
MagickExport int MACSystemCommand(const char * command)
{
/*
We only know how to launch Ghostscript.
*/
if (MacGSLaunchApplicationToFront())
return(-1);
return(MacGSExecuteCommand(command,strlen(command)));
}
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% M A C W a r n i n g H a n d l e r %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% MACWarningHandler() displays a warning reason.
%
% The format of the MACWarningHandler method is:
%
+ void MACWarningHandler(const ExceptionType warning,const char *reason,
% const char *description)
%
% A description of each parameter follows:
%
% o warning: Specifies the numeric warning category.
%
% o reason: Specifies the reason to display before terminating the
% program.
%
% o description: Specifies any description to the reason.
%
%
*/
MagickExport void MACWarningHandler(const ExceptionType warning,
const char *reason,const char *description)
{
char
buffer[1664];
if (reason == (char *) NULL)
return;
if (description == (char *) NULL)
(void) FormatLocaleString(buffer,MaxTextExtent,"%s: %s.\n",GetClientName(),
reason);
else
(void) FormatLocaleString(buffer,MaxTextExtent,"%s: %s (%s).\n",
GetClientName(),reason,description);
#if defined(DISABLE_SIOUX)
if(exception.hook != (MACErrorHookPtr) NULL)
exception.hook(warning, buffer);
#else
(void)warning;
puts(buffer);
#endif
}
#if !defined(MAGICKCORE_POSIX_SUPPORT_VERSION)
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% o p e n d i r %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% opendir() opens the directory named by filename and associates a directory
% stream with it.
%
% The format of the opendir method is:
%
% MagickExport DIR *opendir(char *path)
%
% A description of each parameter follows:
%
% o entry: Specifies a pointer to a DIR structure.
%
%
*/
MagickExport DIR *opendir(const char *path)
{
Str255 pathname;
CInfoPBRec
search_info;
DIR
*entry;
int
error;
search_info.hFileInfo.ioNamePtr=0;
if ((path != (char *) NULL) || (*path != '\0'))
if ((path[0] != '.') || (path[1] != '\0'))
{
c2pstrcpy(pathname,path);
search_info.hFileInfo.ioNamePtr=pathname;
}
search_info.hFileInfo.ioCompletion=0;
search_info.hFileInfo.ioVRefNum=0;
search_info.hFileInfo.ioFDirIndex=0;
search_info.hFileInfo.ioDirID=0;
error=PBGetCatInfoSync(&search_info);
if (error != noErr)
{
errno=error;
return((DIR *) NULL);
}
entry=(DIR *) AcquireMagickMemory(sizeof(DIR));
if (entry == (DIR *) NULL)
return((DIR *) NULL);
entry->d_VRefNum=search_info.hFileInfo.ioVRefNum;
entry->d_DirID=search_info.hFileInfo.ioDirID;
entry->d_index=1;
return(entry);
}
#endif
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% P r o c e s s P e n d i n g E v e n t s %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% ProcessPendingEvents() processes any pending events. This prevents
% ImageMagick from monopolizing the processor.
%
% The format of the ProcessPendingEvents method is:
%
% ProcessPendingEvents(text)
%
% A description of each parameter follows:
%
% o text: A character string representing the current process.
%
%
*/
MagickExport void ProcessPendingEvents(const char *text)
{
#if defined(DISABLE_SIOUX)
if (event_hook != (MACEventHookPtr) NULL)
event_hook(text);
#else
static const char
*mark = (char *) NULL;
EventRecord
event;
while (WaitNextEvent(everyEvent,&event,0L,nil))
SIOUXHandleOneEvent(&event);
if (isatty(STDIN_FILENO) && (text != mark))
{
(void) puts(text);
mark=text;
}
#endif
}
#if !defined(MAGICKCORE_POSIX_SUPPORT_VERSION)
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% r e a d d i r %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% readdir() returns a pointer to a structure representing the directory entry
% at the current position in the directory stream to which entry refers.
%
% The format of the readdir
%
% struct dirent *readdir(DIR *entry)
%
% A description of each parameter follows:
%
% o entry: Specifies a pointer to a DIR structure.
%
%
*/
MagickExport struct dirent *readdir(DIR *entry)
{
CInfoPBRec
search_info;
int
error;
static struct dirent
dir_entry;
static unsigned char
pathname[MaxTextExtent];
if (entry == (DIR *) NULL)
return((struct dirent *) NULL);
search_info.hFileInfo.ioCompletion=0;
search_info.hFileInfo.ioNamePtr=pathname;
search_info.hFileInfo.ioVRefNum=0;
search_info.hFileInfo.ioFDirIndex=entry->d_index;
search_info.hFileInfo.ioDirID=entry->d_DirID;
error=PBGetCatInfoSync(&search_info);
if (error != noErr)
{
errno=error;
return((struct dirent *) NULL);
}
entry->d_index++;
p2cstrcpy(dir_entry.d_name,search_info.hFileInfo.ioNamePtr);
dir_entry.d_namlen=strlen(dir_entry.d_name);
return(&dir_entry);
}
#endif
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% R e a d P I C T I m a g e %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% ReadPICTImage() reads an Apple Macintosh QuickDraw/PICT image file using
% MacOS QuickDraw methods and returns it. It allocates the memory necessary
% for the new Image structure and returns a pointer to the new image.
%
% This method was written and contributed by [email protected]
% (feel free to copy and use it as you want. No warranty).
%
% The format of the ReadPICTImage method is:
%
% Image *ReadPICTImage(const ImageInfo *image_info,
% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
% o image: Method ReadPICTImage returns a pointer to the image after
% reading. A null image is returned if there is a memory shortage or
% if the image cannot be read.
%
% o image_info: the image info..
%
% o exception: return any errors or warnings in this structure.
%
*/
static inline size_t MagickMax(const size_t x,const size_t y)
{
if (x > y)
return(x);
return(y);
}
MagickExport Image *ReadPICTImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
#define PICTHeaderSize 512
CodecType
codec;
GDHandle
device;
GWorldPtr
graphic_world,
port;
Image
*image;
int
depth,
status;
MagickBooleanType
proceed,
status;
PicHandle
picture_handle;
PictInfo
picture_info;
QDErr
theErr = noErr;
Rect
rectangle;
RGBColor
Pixel;
short
colormap_id;
ssize_t
y;
/*
Open image file.
*/
image=AcquireImage(image_info);
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
if (status == MagickFalse)
return(NULL);
picture_handle=(PicHandle) NewHandle(MagickMax(GetBlobSize(image)-
PICTHeaderSize,PICTHeaderSize));
if (picture_handle == nil)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
HLock((Handle) picture_handle);
(void) ReadBlob(image,PICTHeaderSize,*(unsigned char **) picture_handle);
status=ReadBlob(image,GetBlobSize(image)-PICTHeaderSize,*(unsigned char **)
picture_handle);
if (status == MagickFalse)
{
DisposeHandle((Handle) picture_handle);
ThrowReaderException(CorruptImageError,"UnableToReadImageData");
}
GetGWorld(&port,&device);
theErr=NewGWorld(&graphic_world,0,&(**picture_handle).picFrame,nil,nil,
useTempMem | keepLocal);
if ((theErr != noErr) && (graphic_world == nil))
{
DisposeHandle((Handle) picture_handle);
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
}
HUnlock((Handle) picture_handle);
SetGWorld(graphic_world,nil);
theErr=GetPictInfo(picture_handle,&picture_info,0,1,systemMethod,0);
if (theErr != noErr)
{
DisposeGWorld(graphic_world);
DisposeHandle((Handle) picture_handle);
ThrowReaderException(CorruptImageError,"UnableToReadImageData");
}
#if defined(DISABLE_QUICKTIME)
codec='unkn';
colormap_id=(-1);
depth=picture_info.depth;
#else
BottleneckTest(picture_handle,&codec,&depth,&colormap_id);
#endif
switch (codec)
{
case 'rpza':
case 'jpeg':
case 'rle ':
case 'raw ':
case 'smc ':
{
if (depth > 200)
{
depth-=32;
picture_info.theColorTable=GetCTable(colormap_id);
}
break;
}
default:
{
depth=picture_info.depth;
if (depth <= 8)
(void) GetPictInfo(picture_handle,&picture_info,returnColorTable,
(short) (1 << picture_info.depth),systemMethod,0);
break;
}
}
image->x_resolution=(picture_info.hRes) >> 16;
image->y_resolution=(picture_info.vRes) >> 16;
image->units=PixelsPerInchResolution;
image->columns=picture_info.sourceRect.right-picture_info.sourceRect.left;
image->rows=picture_info.sourceRect.bottom-picture_info.sourceRect.top;
if ((depth <= 8) && ((*(picture_info.theColorTable))->ctSize != 0))
{
size_t
number_colors;
/*
Colormapped PICT image.
*/
number_colors=(*(picture_info.theColorTable))->ctSize;
if (!AcquireImageColormap(image,number_colors))
{
if (picture_info.theColorTable != nil)
DisposeHandle((Handle) picture_info.theColorTable);
DisposeGWorld(graphic_world);
DisposeHandle((Handle) picture_handle);
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
}
for (x=0; x < image->colors; x++)
{
image->colormap[x].red=
(*(picture_info.theColorTable))->ctTable[x].rgb.red;
image->colormap[x].green=
(*(picture_info.theColorTable))->ctTable[x].rgb.green;
image->colormap[x].blue=
(*(picture_info.theColorTable))->ctTable[x].rgb.blue;
}
}
SetRect(&rectangle,0,0,image->columns,image->rows);
(void) UpdateGWorld(&graphic_world,depth,&rectangle,
picture_info.theColorTable,nil,0);
LockPixels(GetGWorldPixMap(graphic_world)); /*->portPixMap); */
EraseRect(&rectangle);
DrawPicture(picture_handle,&rectangle);
if ((depth <= 8) && (colormap_id == -1))
{
DisposeHandle((Handle) picture_info.theColorTable);
picture_info.theColorTable=nil;
}
DisposeHandle((Handle) picture_handle);
/*
Convert PICT pixels to pixel packets.
*/
for (y=0; y < image->rows; y++)
{
IndexPacket
*restrict indexes;
ssize_t
x;
PixelPacket
*restrict q;
q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
if (q == (PixelPacket *) NULL)
break;
indexes=GetAuthenticIndexQueue(image);
for (x=0; x < image->columns; x++)
{
GetCPixel(x,y,&Pixel);
SetPixelRed(q,ScaleCharToQuantum(Pixel.red & 0xff));
SetPixelGreen(q,ScaleCharToQuantum(Pixel.green & 0xff));
SetPixelBlue(q,ScaleCharToQuantum(Pixel.blue & 0xff));
if (image->storage_class == PseudoClass)
SetPixelIndex(indexes+x,Color2Index(&Pixel));
q++;
}
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
proceed=SetImageProgress(image,LoadImageTag,y,image->rows);
if (proceed == MagickFalse)
break;
}
UnlockPixels(GetGWorldPixMap(graphic_world));
SetGWorld(port,device);
if (picture_info.theColorTable != nil)
DisposeHandle((Handle) picture_info.theColorTable);
DisposeGWorld(graphic_world);
(void) CloseBlob(image);
return(image);
}
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% S e a r c h F o r F i l e %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% SearchForFile() searches for a file.
%
%
*/
static Boolean SearchForFile(OSType creator_type,OSType file_type,FSSpec *file,
short count)
{
char
*buffer;
CInfoPBRec
search1_info,
search2_info;
FSSpec
application;
HParamBlockRec
parameter_info;
OSErr
error;
ProcessInfoRec
application_info;
ProcessSerialNumber
serial_number;
ssize_t
buffer_size = MagickMinBufferExtent;
serial_number.lowLongOfPSN=kCurrentProcess;
serial_number.highLongOfPSN=0;
application_info.processInfoLength=sizeof(ProcessInfoRec);
application_info.processName=NULL;
application_info.processAppSpec=(&application);
GetProcessInformation(&serial_number,&application_info);
buffer=NewPtr(buffer_size);
if (buffer == (char *) NULL)
return(false);
parameter_info.csParam.ioCompletion=NULL;
parameter_info.csParam.ioNamePtr=NULL;
parameter_info.csParam.ioVRefNum=application.vRefNum;
parameter_info.csParam.ioMatchPtr=file;
parameter_info.csParam.ioReqMatchCount=count;
parameter_info.csParam.ioSearchBits=fsSBFlFndrInfo;
parameter_info.csParam.ioSearchInfo1=&search1_info;
parameter_info.csParam.ioSearchInfo2=&search2_info;
parameter_info.csParam.ioSearchTime=0;
parameter_info.csParam.ioCatPosition.initialize=0;
parameter_info.csParam.ioOptBuffer=buffer;
parameter_info.csParam.ioOptBufSize=buffer_size;
search1_info.hFileInfo.ioNamePtr=NULL;
search1_info.hFileInfo.ioFlFndrInfo.fdType=file_type;
search1_info.hFileInfo.ioFlFndrInfo.fdCreator=creator_type;
search1_info.hFileInfo.ioFlAttrib=0;
search1_info.hFileInfo.ioFlParID=0;
search2_info=search1_info;
search2_info.hFileInfo.ioFlAttrib=0x10;
search2_info.hFileInfo.ioFlFndrInfo.fdCreator=creator_type;
search2_info.hFileInfo.ioFlFndrInfo.fdType=(-1);
search2_info.hFileInfo.ioFlFndrInfo.fdFlags=0;
search2_info.hFileInfo.ioFlFndrInfo.fdLocation.h=0;
search2_info.hFileInfo.ioFlFndrInfo.fdLocation.v=0;
search2_info.hFileInfo.ioFlFndrInfo.fdFldr=0;
search2_info.hFileInfo.ioFlParID=0;
error=PBCatSearchSync((CSParamPtr) ¶meter_info);
DisposePtr(buffer);
if (parameter_info.csParam.ioReqMatchCount ==
parameter_info.csParam.ioActMatchCount)
error=eofErr;
if (parameter_info.csParam.ioActMatchCount == 0)
error=0;
return(error == eofErr);
}
#if !defined(MAGICKCORE_POSIX_SUPPORT_VERSION)
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% s e e k d i r %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% seekdir() sets the position of the next readdir() operation on the directory
% stream.
%
% The format of the seekdir method is:
%
% void seekdir(DIR *entry,ssize_t position)
%
% A description of each parameter follows:
%
% o entry: Specifies a pointer to a DIR structure.
%
% o position: specifies the position associated with the directory
% stream.
%
%
%
*/
MagickExport void seekdir(DIR *entry,ssize_t position)
{
assert(entry != (DIR *) NULL);
entry->d_index=position;
}
#endif
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% S e t A p p l i c a t i o n T y p e %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% SetApplicationType() sets the file type of an image.
%
% The format of the SetApplicationType method is:
%
% void SetApplicationType(const char *filename,const char *magick,
% OSType application)
%
% A description of each parameter follows:
%
% o filename: Specifies the name of the file.
%
% o filename: Specifies the file type.
%
% o application: Specifies the type of the application.
%
*/
static inline size_t MagickMin(const size_t x,const size_t y)
{
if (x < y)
return(x);
return(y);
}
MagickExport void SetApplicationType(const char *filename,const char *magick,
OSType application)
{
FSSpec
file_specification;
OSType
filetype;
Str255
name;
assert(filename != (char *) NULL);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",filename);
assert(magick != (const char *) NULL);
filetype=' ';
(void) CopyMagickString((char *) &filetype,magick,MagickMin(strlen(magick),
4));
if (LocaleCompare(magick,"JPG") == 0)
(void) CopyMagickString((char *) &filetype,"JPEG",MaxTextExtent);
c2pstrcpy(name,filename);
FSMakeFSSpec(0,0,name,&file_specification);
FSpCreate(&file_specification,application,filetype,smSystemScript);
}
#if !defined(MAGICKCORE_POSIX_SUPPORT_VERSION)
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% t e l l d i r %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Method telldir returns the current location associated with the
% named directory stream.
%
% The format of the telldir method is:
%
% telldir(DIR *entry)
%
% A description of each parameter follows:
%
% o entry: Specifies a pointer to a DIR structure.
%
%
*/
MagickExport ssize_t telldir(DIR *entry)
{
return(entry->d_index);
}
#endif
#endif
|
the_stack_data/187040.c | /*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.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.openairinterface.org/?page_id=698
*
* 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.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* [email protected]
*/
#include <sys/types.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <linux/netlink.h>
#include <signal.h>
#include <stdio.h>
#include <unistd.h>
typedef unsigned int sdu_size_t;
typedef unsigned int rb_id_t;
typedef struct pdcp_data_req_header_t {
rb_id_t rb_id;
sdu_size_t data_size;
int inst;
} pdcp_data_req_header_t;
typedef struct pdcp_data_ind_header_t {
rb_id_t rb_id;
sdu_size_t data_size;
int inst;
} pdcp_data_ind_header_t;
#define MAX_PAYLOAD 1024 /* maximum payload size*/
struct sockaddr_nl src_addr, dest_addr;
struct nlmsghdr *nlh = NULL;
struct iovec iov;
int sock_fd;
struct msghdr msg;
void foo( int sig )
{
printf("I got cntl-C, closing socket\n");
close(sock_fd);
exit(-1);
}
#define OAI_IP_DRIVER_NETLINK_ID 31
void main()
{
struct sigaction newaction;
int i=0;
int ret;
int len;
newaction.sa_handler = foo;
if ( sigaction( SIGINT, &newaction, NULL ) == -1)
perror("Could not install the new signal handler");
sock_fd = socket(PF_NETLINK, SOCK_RAW,OAI_IP_DRIVER_NETLINK_ID);
printf("Opened socket with fd %d\n",sock_fd);
ret = fcntl(sock_fd,F_SETFL,O_NONBLOCK);
printf("fcntl returns %d\n",ret);
memset(&src_addr, 0, sizeof(src_addr));
src_addr.nl_family = AF_NETLINK;
src_addr.nl_pid = 1;//getpid(); /* self pid */
src_addr.nl_groups = 0; /* not in mcast groups */
ret = bind(sock_fd, (struct sockaddr*)&src_addr,
sizeof(src_addr));
printf("bind returns %d\n",ret);
memset(&dest_addr, 0, sizeof(dest_addr));
dest_addr.nl_family = AF_NETLINK;
dest_addr.nl_pid = 0; /* For Linux Kernel */
dest_addr.nl_groups = 0; /* unicast */
nlh=(struct nlmsghdr *)malloc(NLMSG_SPACE(MAX_PAYLOAD));
/* Fill the netlink message header */
nlh->nlmsg_len = NLMSG_SPACE(MAX_PAYLOAD);
nlh->nlmsg_pid = 1;//getpid(); /* self pid */
nlh->nlmsg_flags = 0;
iov.iov_base = (void *)nlh;
iov.iov_len = nlh->nlmsg_len;
memset(&msg,0,sizeof(msg));
msg.msg_name = (void *)&dest_addr;
msg.msg_namelen = sizeof(dest_addr);
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
/* Read message from kernel */
memset(nlh, 0, NLMSG_SPACE(MAX_PAYLOAD));
while (1) {
len = recvmsg(sock_fd, &msg, 0);
if (len<0) {
// exit(-1);
} else {
printf("Received socket with length %d (nlmsg_len = %d)\n",len,nlh->nlmsg_len);
}
usleep(1000);
i=i+1;
if ((i % 100) == 0)
printf("%d\n",i);
/*
for (i=0;i<nlh->nlmsg_len - sizeof(struct nlmsghdr);i++) {
printf("%x ",
((unsigned char *)NLMSG_DATA(nlh))[i]);
}
*/
}
/* Close Netlink Socket */
}
|
the_stack_data/11076674.c | //
// Created by rahul on 29/7/19.
//
#include <stdio.h>
#include <unistd.h>
#define BUFSIZE 1000
int getchar(void)
{
static char buf[BUFSIZE];
static char *bufp=buf;
static int n=0;
if(n==0)
{
n=read(0,buf,sizeof(buf));
bufp=buf;
}
return (--n>0) ? (unsigned char ) (*bufp++) : EOF;
}
int main()
{
int c;
c=getchar();
putchar(c);
} |
the_stack_data/128802.c | #include <sys/types.h>
#include <stdint.h>
#include <stddef.h>
#undef KEY
#if defined(__i386)
# define KEY '_','_','i','3','8','6'
#elif defined(__x86_64)
# define KEY '_','_','x','8','6','_','6','4'
#elif defined(__ppc__)
# define KEY '_','_','p','p','c','_','_'
#elif defined(__ppc64__)
# define KEY '_','_','p','p','c','6','4','_','_'
#elif defined(__aarch64__)
# define KEY '_','_','a','a','r','c','h','6','4','_','_'
#elif defined(__ARM_ARCH_7A__)
# define KEY '_','_','A','R','M','_','A','R','C','H','_','7','A','_','_'
#elif defined(__ARM_ARCH_7S__)
# define KEY '_','_','A','R','M','_','A','R','C','H','_','7','S','_','_'
#endif
#define SIZE (sizeof(int_fast8_t))
char info_size[] = {'I', 'N', 'F', 'O', ':', 's','i','z','e','[',
('0' + ((SIZE / 10000)%10)),
('0' + ((SIZE / 1000)%10)),
('0' + ((SIZE / 100)%10)),
('0' + ((SIZE / 10)%10)),
('0' + (SIZE % 10)),
']',
#ifdef KEY
' ','k','e','y','[', KEY, ']',
#endif
'\0'};
#ifdef __CLASSIC_C__
int main(argc, argv) int argc; char *argv[];
#else
int main(int argc, char *argv[])
#endif
{
int require = 0;
require += info_size[argc];
(void)argv;
return require;
}
|
the_stack_data/49479.c | /* The classic producer-consumer example.
* Illustrates mutexes and conditions.
* All integers between 0 and 9999 should be printed exactly twice,
* once to the right of the arrow and once to the left.
*/
#include <stdio.h>
#include "pthread.h"
#define BUFFER_SIZE 16
/* Circular buffer of integers. */
struct prodcons
{
int buffer[BUFFER_SIZE]; /* the actual data */
pthread_mutex_t lock; /* mutex ensuring exclusive access to buffer */
int readpos, writepos, count; /* positions for reading and writing */
pthread_cond_t notempty; /* signaled when buffer is not empty */
pthread_cond_t notfull; /* signaled when buffer is not full */
};
/* Initialize a buffer */
static void
init (struct prodcons *b)
{
pthread_mutex_init (&b->lock, NULL);
pthread_cond_init (&b->notempty, NULL);
pthread_cond_init (&b->notfull, NULL);
b->readpos = 0;
b->writepos = 0;
b->count = 0;
}
/* Store an integer in the buffer */
static void
put (struct prodcons *b, int data)
{
pthread_mutex_lock (&b->lock);
/* Wait until buffer is not full */
while (b->count == BUFFER_SIZE)
{
pthread_cond_wait (&b->notfull, &b->lock);
/* pthread_cond_wait reacquired b->lock before returning */
}
/* Write the data and advance write pointer */
b->buffer[b->writepos] = data;
b->writepos++;
if (b->writepos >= BUFFER_SIZE)
b->writepos = 0;
b->count++;
/* Signal that the buffer is now not empty */
pthread_cond_signal (&b->notempty);
pthread_mutex_unlock (&b->lock);
}
/* Read and remove an integer from the buffer */
static int
get (struct prodcons *b)
{
int data;
pthread_mutex_lock (&b->lock);
/* Wait until buffer is not empty */
while (b->count == 0)
{
pthread_cond_wait (&b->notempty, &b->lock);
}
/* Read the data and advance read pointer */
data = b->buffer[b->readpos];
b->readpos++;
if (b->readpos >= BUFFER_SIZE)
b->readpos = 0;
b->count--;
/* Signal that the buffer is now not full */
pthread_cond_signal (&b->notfull);
pthread_mutex_unlock (&b->lock);
return data;
}
/* A test program: one thread inserts integers from 1 to 10000,
the other reads them and prints them. */
#define OVER (-1)
struct prodcons buffer;
static void *
producer (void *data)
{
int n;
for (n = 0; n < 10000; n++)
{
printf ("%d --->\n", n);
put (&buffer, n);
}
put (&buffer, OVER);
return NULL;
}
static void *
consumer (void *data)
{
int d;
while (1)
{
d = get (&buffer);
if (d == OVER)
break;
printf ("---> %d\n", d);
}
return NULL;
}
int
main (void)
{
pthread_t th_a, th_b;
void *retval;
init (&buffer);
/* Create the threads */
pthread_create (&th_a, NULL, producer, 0);
pthread_create (&th_b, NULL, consumer, 0);
/* Wait until producer and consumer finish. */
pthread_join (th_a, &retval);
pthread_join (th_b, &retval);
return 0;
}
|
the_stack_data/873652.c | int sizeof_array_element();
int main()
{
return !(sizeof_array_element() == 4);
} |
the_stack_data/182951807.c | /* Test rwlocks.
Copyright (C) 2000-2020 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
#define _GNU_SOURCE
#include <pthread.h>
#include <assert.h>
#include <error.h>
#include <errno.h>
#define THREADS 1
int a;
int b;
/* Get a read lock and assert that a == b. */
void *
test1 (void *arg)
{
error_t err;
pthread_rwlock_t *lock = arg;
int i;
for (i = 0; i < 200; i++)
{
err = pthread_rwlock_rdlock (lock);
assert (err == 0);
assert (a == b);
sched_yield ();
assert (a == b);
err = pthread_rwlock_unlock (lock);
assert (err == 0);
}
return 0;
}
int
main (int argc, char **argv)
{
error_t err;
pthread_rwlockattr_t attr;
pthread_rwlock_t lock;
int pshared;
int i;
pthread_t tid[THREADS];
void *ret;
err = pthread_rwlockattr_init (&attr);
if (err)
error (1, err, "pthread_rwlockattr_init");
err = pthread_rwlockattr_getpshared (&attr, &pshared);
if (err)
error (1, err, "pthread_rwlockattr_getpshared");
/* Assert the default state as mandated by POSIX. */
assert (pshared == PTHREAD_PROCESS_PRIVATE);
err = pthread_rwlockattr_setpshared (&attr, pshared);
if (err)
error (1, err, "pthread_rwlockattr_setpshared");
err = pthread_rwlock_init (&lock, &attr);
if (err)
error (1, err, "pthread_rwlock_init");
err = pthread_rwlockattr_destroy (&attr);
if (err)
error (1, err, "pthread_rwlockattr_destroy");
/* Now test the lock. */
for (i = 0; i < THREADS; i++)
{
err = pthread_create (&tid[i], 0, test1, &lock);
if (err)
error (1, err, "pthread_create");
}
for (i = 0; i < 10; i++)
{
sched_yield ();
/* Get a write lock. */
pthread_rwlock_wrlock (&lock);
/* Increment a and b giving other threads a chance to run in
between. */
sched_yield ();
a++;
sched_yield ();
b++;
sched_yield ();
/* Unlock. */
pthread_rwlock_unlock (&lock);
}
for (i = 0; i < THREADS; i++)
{
err = pthread_join (tid[i], &ret);
if (err)
error (1, err, "pthread_join");
}
/* Read lock it. */
err = pthread_rwlock_tryrdlock (&lock);
assert (err == 0);
/* Try to write lock it. It should fail with EBUSY. */
err = pthread_rwlock_trywrlock (&lock);
assert (err == EBUSY);
/* Drop the read lock. */
err = pthread_rwlock_unlock (&lock);
assert (err == 0);
/* Get a write lock. */
err = pthread_rwlock_trywrlock (&lock);
assert (err == 0);
/* Fail trying to acquire another write lock. */
err = pthread_rwlock_trywrlock (&lock);
assert (err == EBUSY);
/* Try to get a read lock which should also fail. */
err = pthread_rwlock_tryrdlock (&lock);
assert (err == EBUSY);
/* Unlock it. */
err = pthread_rwlock_unlock (&lock);
assert (err == 0);
err = pthread_rwlock_destroy (&lock);
if (err)
error (1, err, "pthread_rwlock_destroy");
return 0;
}
|
the_stack_data/22012739.c | int barfunc(int x) {
return x + 3;
}
|
the_stack_data/140240.c | #include <stdio.h>
#include <stdlib.h>
int main () {
system("cls");
/*int a, b, c;
a = 10; //Código que soma os caracteres;
b = a + 1;
c = b + 2;
printf("Atualmente, temos a = %d, b = %d e c = %d.\n", a, b, c);
char ch1, ch2, ch3, ch4, ch5;
ch1 = 'E';
ch2 = 'o';
ch3 = 's'; //Podemos substituir as letras pelo %c na ordem que queremos;
ch4 = 'z';
ch5 = 'p';
printf("%cu g%c%cto de %ciz%ca.\n", ch1, ch2, ch3, ch5, ch4);
float a, b;
a = 12.5; //Mostra na tela os números que estao nas variáveis;
b = 10.7;
printf("a = %.2f e b = %.2f\n", a, b);
char escolha;
escolha = 'b'; //Soma 1 ao caractere b, resultado = c;
escolha = escolha + 1;
printf("O sucessor de b e a letra: %c.\n", escolha);
//Código abaixo nos mostra o uso do switch para menu de opções;
int cadastrado, ativo, logado;
char opcao;
cadastrado = ativo = logado = 0;
printf("Deseja cadastrar sua conta? S/N \n");
scanf(" %c", &opcao);
if(opcao == 'S') {
cadastrado = 1;
printf("\nConta cadastrada. \n");
}
printf("Deseja ativar sua conta? S/N \n");
scanf(" %c", &opcao);
if(opcao == 'S') {
ativo = 1;
printf("\nConta ativada. \n");
}
printf("Deseja logar sua conta? S/N \n");
scanf(" %c", &opcao);
if(opcao == 'S') {
logado = 1;
printf("Conta logada. \n");
}
if((cadastrado == 1) && (ativo == 1) && (logado == 1)) {
printf("\nSeja bem vindo.\n");
}
else {
printf("\nAlgo deu errado.\n");
}
//Código mostra média aritmética;
float nota1, nota2, nota3, media, total;
printf("Informe sua primeira nota:\n");
scanf("%f", ¬a1);
fflush(stdin);
printf("Informe sua segunda nota:\n");
scanf("%f", ¬a2);
fflush(stdin);
printf("Informe sua terceira nota:\n");
scanf("%f", ¬a3);
media = (nota1 + nota2 + nota3) / 3.0;
total = media;
if(media >= 8) {
printf("\nSua nota final foi de %.2f. \nParabens!!! Voce foi aprovado.", total);
}
else {
printf("SUa nota final foi de %.2f. \nInfelizmente voce foi reprovado!", total);
}
//Código mostra caso de Estrutura de Decisão Composta com Switch;
int opcao;
printf("Entre com 1 para adicionar ou 2 para excluir: \n");
scanf("%d", &opcao);
if(opcao >= 0) {
if (opcao == 0) {
printf("\nNumero nulo.\n");
} else {
printf("\nNumero positivo.\n");
}
} else {
printf("\nNumero negativo.\n");
}
switch(opcao) {
case 1: {
printf("\nNumero 1.\n");
break;
}
case 2: {
printf("\nNumero 2.\n");
break;
}
default: printf("\nOpcao invalida.\n");
}
printf("Final do programa");
//Código mostra Estrutura de Decisão Aninhada com Média;
float media, nota1, nota2;
printf("Informe sua primeira nota: \n");
scanf("%f", ¬a1);
fflush(stdin);
printf("Informe sua segunda nota: \n");
scanf("%f", ¬a2);
media = (nota1 + nota2) / 2.0;
if (media>=6) {
printf("Parabens, voce esta aprovado!!");
}
else if (media >=4) {
printf("Voce esta em recuperacao");
}
else {
printf("Voce esta reprovado");
}
int Mat[3][5] = {{0, 1, 2, 4,}, {5, 6, 7, 8, 9}, {10, 11, 12, 13, 14}}, num;
Mat[2][4] = 90;
printf("Linha 3, coluna 4: %d", Mat[2][4]);
printf("Digite um numero qualquer: ");
scanf("%d", &num);
Mat[1][2] = num;
printf("O numero agora e: %d", Mat[1][2]);
char caractere;
printf("Digite um caractere para saber seu correspondente em ASCII: ");
scanf("%c", &caractere);
printf("Em ASCII e: %d", caractere);
int ano;
printf("Digite um ano qualquer: ");
fflush(stdin);
scanf("%i", &ano);
if (ano % 4 == 0) {
printf("O ano %i e bissexto.", ano);
} else {
printf("O ano %i e nao e bissexto", ano);
}
*/
} |
the_stack_data/209067.c | // Copyright (c) 2019-present, iQIYI, Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
// Created by caikelun on 2019-03-07.
typedef int make_iso_compilers_happy;
#ifdef __arm__
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include "xcc_errno.h"
#include "xcd_arm_exidx.h"
#include "xcd_regs.h"
#include "xcd_memory.h"
#include "xcd_util.h"
#include "xcd_log.h"
#define XCD_ARM_EXIDX_REGS_SP 13
#define XCD_ARM_EXIDX_REGS_PC 15
#define XCD_ARM_EXIDX_OP_FINISH 0xb0
typedef struct
{
xcd_regs_t *regs;
xcd_memory_t *memory;
pid_t pid;
uintptr_t vsp;
uintptr_t pc;
int pc_set;
size_t exidx_offset;
size_t exidx_size;
size_t entry_offset;
uint8_t entry[32]; //same as libunwind
size_t entry_size;
size_t entry_idx;
int no_unwind;
int finished;
} xcd_arm_exidx_t;
static void xcd_arm_exidx_init(xcd_arm_exidx_t *self, xcd_regs_t *regs, xcd_memory_t *memory,
pid_t pid, size_t exidx_offset, size_t exidx_size, uintptr_t pc)
{
self->regs = regs;
self->memory = memory;
self->pid = pid;
self->vsp = xcd_regs_get_sp(regs);
self->pc = pc;
self->pc_set = 0;
self->exidx_offset = exidx_offset;
self->exidx_size = exidx_size;
self->entry_offset = 0;
self->entry_size = 0;
self->entry_idx = 0;
self->no_unwind = 0;
self->finished = 0;
}
static int xcd_arm_exidx_prel31_addr(xcd_memory_t *memory, uint32_t offset, uint32_t* addr)
{
uint32_t data;
if(0 != xcd_memory_read_fully(memory, offset, &data, sizeof(data))) return XCC_ERRNO_MEM;
//sign extend the value if necessary
int32_t value = ((int32_t)(data) << 1) >> 1;
*addr = (uint32_t)((int32_t)offset + value);
return 0;
}
static int xcd_arm_exidx_entry_push(xcd_arm_exidx_t *self, uint8_t byte)
{
if(self->entry_size >= 32) return XCC_ERRNO_NOSPACE;
self->entry[self->entry_size] = byte;
self->entry_size++;
return 0;
}
static int xcd_arm_exidx_entry_pop(xcd_arm_exidx_t *self, uint8_t *byte)
{
if(self->entry_idx >= self->entry_size) return XCC_ERRNO_NOTFND;
*byte = self->entry[self->entry_idx];
self->entry_idx++;
return 0;
}
static int xcd_arm_exidx_get_entry_offset(xcd_arm_exidx_t *self)
{
if(0 == self->exidx_offset || 0 == self->exidx_size) return XCC_ERRNO_NOTFND;
size_t first = 0;
size_t last = self->exidx_size / 8;
size_t current;
uint32_t addr;
int r;
while (first < last)
{
current = (first + last) / 2;
if(0 != (r = xcd_arm_exidx_prel31_addr(self->memory, self->exidx_offset + current * 8, &addr))) return r;
if(self->pc == addr)
{
self->entry_offset = self->exidx_offset + current * 8;
return 0; //found
}
else if(self->pc < addr)
{
last = current;
}
else
{
first = current + 1;
}
}
if(last > 0)
{
self->entry_offset = self->exidx_offset + (last - 1) * 8;
return 0; //found
}
return XCC_ERRNO_NOTFND;
}
static int xcd_arm_exidx_get_entry(xcd_arm_exidx_t *self)
{
int r;
if(self->entry_offset & 1) return XCC_ERRNO_FORMAT;
//read entry value
uint32_t data;
if(0 != xcd_memory_read_fully(self->memory, self->entry_offset + 4, &data, sizeof(data))) return XCC_ERRNO_MEM;
if(1 == data)
{
//cantunwind
self->no_unwind = 1;
return XCC_ERRNO_FORMAT;
}
else if(data & (1UL << 31))
{
//a table entry itself (compact model: Su16)
if((data >> 24) & 0xf) return XCC_ERRNO_FORMAT;
if(0 != (r = xcd_arm_exidx_entry_push(self, (data >> 16) & 0xff))) return r;
if(0 != (r = xcd_arm_exidx_entry_push(self, (data >> 8) & 0xff))) return r;
if(0 != (r = xcd_arm_exidx_entry_push(self, data & 0xff))) return r;
if((data & 0xff) != XCD_ARM_EXIDX_OP_FINISH)
if(0 != (r = xcd_arm_exidx_entry_push(self, XCD_ARM_EXIDX_OP_FINISH))) return r;
return 0; //finished
}
else
{
//a prel31 offset of the start of the table entry
//get the address of the table entry
int32_t signed_data = (int32_t)(data << 1) >> 1;
uint32_t addr = (uint32_t)((int32_t)(self->entry_offset + 4) + signed_data);
//get the table entry
if(0 != xcd_memory_read_fully(self->memory, addr, &data, sizeof(data))) return XCC_ERRNO_MEM;
size_t num_table_words = 0;
if (data & (1UL << 31))
{
//compact model
switch((data >> 24) & 0xf)
{
case 0:
//Su16
if(0 != (r = xcd_arm_exidx_entry_push(self, (data >> 16) & 0xff))) return r;
if(0 != (r = xcd_arm_exidx_entry_push(self, (data >> 8) & 0xff))) return r;
if(0 != (r = xcd_arm_exidx_entry_push(self, data & 0xff))) return r;
if((data & 0xff) != XCD_ARM_EXIDX_OP_FINISH)
if(0 != (r = xcd_arm_exidx_entry_push(self, XCD_ARM_EXIDX_OP_FINISH))) return r;
return 0; //finished
case 1:
//Lu16
case 2:
//Lu32
num_table_words = (data >> 16) & 0xff;
if(0 != (r = xcd_arm_exidx_entry_push(self, (data >> 8) & 0xff))) return r;
if(0 != (r = xcd_arm_exidx_entry_push(self, data & 0xff))) return r;
addr += 4;
break;
default:
return XCC_ERRNO_FORMAT;
}
}
else
{
//generic model
addr += 4; //skip the personality routine data (prs_fnc_offset)
if(0 != xcd_memory_read_fully(self->memory, addr, &data, sizeof(data))) return XCC_ERRNO_MEM;
num_table_words = (data >> 24) & 0xff;
if(0 != (r = xcd_arm_exidx_entry_push(self, (data >> 16) & 0xff))) return r;
if(0 != (r = xcd_arm_exidx_entry_push(self, (data >> 8) & 0xff))) return r;
if(0 != (r = xcd_arm_exidx_entry_push(self, data & 0xff))) return r;
addr += 4;
}
if(num_table_words > 5) return XCC_ERRNO_FORMAT;
//get additional insn
size_t j;
for(j = 0; j < num_table_words; j++)
{
if(0 != xcd_memory_read_fully(self->memory, addr, &data, sizeof(data))) return XCC_ERRNO_MEM;
if(0 != (r = xcd_arm_exidx_entry_push(self, (data >> 24) & 0xff))) return r;
if(0 != (r = xcd_arm_exidx_entry_push(self, (data >> 16) & 0xff))) return r;
if(0 != (r = xcd_arm_exidx_entry_push(self, (data >> 8) & 0xff))) return r;
if(0 != (r = xcd_arm_exidx_entry_push(self, data & 0xff))) return r;
addr += 4;
}
if(0 == self->entry_size) return XCC_ERRNO_MISSING;
if(XCD_ARM_EXIDX_OP_FINISH != self->entry[self->entry_size - 1])
if(0 != (r = xcd_arm_exidx_entry_push(self, XCD_ARM_EXIDX_OP_FINISH))) return r;
return 0; //finished
}
}
static int xcd_arm_exidx_decode_entry_10_00(xcd_arm_exidx_t *self, uint8_t byte)
{
int r;
uint16_t bytes = (uint16_t)((byte & 0xf) << 8);
if(0 != (r = xcd_arm_exidx_entry_pop(self, &byte))) return r;
bytes |= byte;
if(0 == bytes)
{
// 10000000 00000000: Refuse to unwind
self->no_unwind = 1;
return XCC_ERRNO_FORMAT;
}
else
{
// 1000iiii iiiiiiii: Pop up to 12 integer registers under masks {r15-r12}, {r11-r4}
bytes <<= 4;
size_t reg;
for(reg = 4; reg < 16; reg++)
{
if(bytes & (1 << reg))
{
#if XCD_ARM_EXIDX_DEBUG
XCD_LOG_DEBUG("ARM_EXIDE: 1000, ptrace, reg=%zu, vsp=%x", reg, self->vsp);
#endif
if(0 != xcd_util_ptrace_read_fully(self->pid, self->vsp, &(self->regs->r[reg]), sizeof(uint32_t))) return XCC_ERRNO_MEM;
self->vsp += 4;
}
}
if(bytes & (1 << XCD_ARM_EXIDX_REGS_SP))
self->vsp = xcd_regs_get_sp(self->regs);
if(bytes & (1 << XCD_ARM_EXIDX_REGS_PC))
self->pc_set = 1;
return 0;
}
}
static int xcd_arm_exidx_decode_entry_10_01(xcd_arm_exidx_t *self, uint8_t byte)
{
uint8_t bits = byte & 0xf;
switch(bits)
{
case 13:
// 10011101: Reserved as prefix for ARM register to register moves
return XCC_ERRNO_FORMAT;
case 15:
// 10011111: Reserved as prefix for Intel Wireless MMX register to register moves
return XCC_ERRNO_FORMAT;
default:
// 1001nnnn: Set vsp = r[nnnn]
self->vsp = self->regs->r[bits];
return 0;
}
}
static int xcd_arm_exidx_decode_entry_10_10(xcd_arm_exidx_t *self, uint8_t byte)
{
// 10100nnn: Pop r4-r[4+nnn]
// 10101nnn: Pop r4-r[4+nnn], r14
size_t i;
for(i = 4; i <= (size_t)(4 + (byte & 0x7)); i++)
{
#if XCD_ARM_EXIDX_DEBUG
XCD_LOG_DEBUG("ARM_EXIDE: 1010, ptrace, reg=%zu, vsp=%x", i, self->vsp);
#endif
if(0 != xcd_util_ptrace_read_fully(self->pid, self->vsp, &(self->regs->r[i]), sizeof(uint32_t))) return XCC_ERRNO_MEM;
self->vsp += 4;
}
if(byte & 0x8)
{
#if XCD_ARM_EXIDX_DEBUG
XCD_LOG_DEBUG("ARM_EXIDE: 1010, ptrace, reg=%zu, vsp=%x", 14, self->vsp);
#endif
if(0 != xcd_util_ptrace_read_fully(self->pid, self->vsp, &(self->regs->r[14]), sizeof(uint32_t))) return XCC_ERRNO_MEM;
self->vsp += 4;
}
return 0;
}
static int xcd_arm_exidx_decode_entry_10_11_0000(xcd_arm_exidx_t *self)
{
// 10110000: Finish
self->finished = 1;
return XCC_ERRNO_RANGE;
}
static int xcd_arm_exidx_decode_entry_10_11_0001(xcd_arm_exidx_t *self)
{
int r;
uint8_t byte;
if(0 != (r = xcd_arm_exidx_entry_pop(self, &byte))) return r;
if(0 == byte)
{
// 10110001 00000000: Spare
return XCC_ERRNO_FORMAT;
}
else if(byte >> 4)
{
// 10110001 xxxxyyyy: Spare (xxxx != 0000)
return XCC_ERRNO_FORMAT;
}
else
{
// 10110001 0000iiii: Pop integer registers under mask {r3, r2, r1, r0}
size_t reg;
for(reg = 0; reg < 4; reg++)
{
if(byte & (1 << reg))
{
#if XCD_ARM_EXIDX_DEBUG
XCD_LOG_DEBUG("ARM_EXIDE: 10110001, ptrace, reg=%zu, vsp=%x", reg, self->vsp);
#endif
if(0 != xcd_util_ptrace_read_fully(self->pid, self->vsp, &(self->regs->r[reg]), sizeof(uint32_t))) return XCC_ERRNO_MEM;
self->vsp += 4;
}
}
}
return 0;
}
static int xcd_arm_exidx_decode_entry_10_11_0010(xcd_arm_exidx_t *self)
{
// 10110010 uleb128: vsp = vsp + 0x204 + (uleb128 << 2)
uint32_t result = 0;
uint32_t shift = 0;
uint8_t byte;
int r;
do
{
if(0 != (r = xcd_arm_exidx_entry_pop(self, &byte))) return r;
result |= (uint32_t)((byte & 0x7f) << shift);
shift += 7;
} while (byte & 0x80);
self->vsp += 0x204 + (result << 2);
return 0;
}
static int xcd_arm_exidx_decode_entry_10_11_0011(xcd_arm_exidx_t *self)
{
// 10110011 sssscccc: Pop VFP double precision registers D[ssss]-D[ssss+cccc] by FSTMFDX
uint8_t byte;
int r;
if(0 != (r = xcd_arm_exidx_entry_pop(self, &byte))) return r;
self->vsp += ((byte & 0xf) + 1) * 8 + 4;
return 0;
}
static int xcd_arm_exidx_decode_entry_10_11_1nnn(xcd_arm_exidx_t *self, uint8_t byte)
{
// 10111nnn: Pop VFP double-precision registers D[8]-D[8+nnn] by FSTMFDX
self->vsp += ((byte & 0x7) + 1) * 8 + 4;
return 0;
}
static int xcd_arm_exidx_decode_entry_10_11_01nn(xcd_arm_exidx_t *self)
{
(void)self;
// 101101nn: Spare
return XCC_ERRNO_FORMAT;
}
static int xcd_arm_exidx_decode_entry_10(xcd_arm_exidx_t *self, uint8_t byte)
{
switch((byte >> 4) & 0x3)
{
case 0:
return xcd_arm_exidx_decode_entry_10_00(self, byte);
case 1:
return xcd_arm_exidx_decode_entry_10_01(self, byte);
case 2:
return xcd_arm_exidx_decode_entry_10_10(self, byte);
default:
switch (byte & 0xf)
{
case 0:
return xcd_arm_exidx_decode_entry_10_11_0000(self);
case 1:
return xcd_arm_exidx_decode_entry_10_11_0001(self);
case 2:
return xcd_arm_exidx_decode_entry_10_11_0010(self);
case 3:
return xcd_arm_exidx_decode_entry_10_11_0011(self);
default:
if(byte & 0x8)
{
return xcd_arm_exidx_decode_entry_10_11_1nnn(self, byte);
}
else
{
return xcd_arm_exidx_decode_entry_10_11_01nn(self);
}
}
}
}
static int xcd_arm_exidx_decode_entry_11_000(xcd_arm_exidx_t *self, uint8_t byte)
{
int r;
uint8_t bits = byte & 0x7;
if(6 == bits)
{
if(0 != (r = xcd_arm_exidx_entry_pop(self, &byte))) return r;
// 11000110 sssscccc: Intel Wireless MMX pop wR[ssss]-wR[ssss+cccc]
self->vsp += ((byte & 0xf) + 1) * 8;
return 0;
}
else if(7 == bits)
{
if(0 != (r = xcd_arm_exidx_entry_pop(self, &byte))) return r;
if(0 == byte)
{
// 11000111 00000000: Spare
return XCC_ERRNO_FORMAT;
}
else if(0 == (byte >> 4))
{
// 11000111 0000iiii: Intel Wireless MMX pop wCGR registers {wCGR0,1,2,3}
self->vsp += (uintptr_t)(__builtin_popcount(byte) * 4);
return 0;
}
else
{
// 11000111 xxxxyyyy: Spare (xxxx != 0000)
return XCC_ERRNO_FORMAT;
}
}
else
{
// 11000nnn: Intel Wireless MMX pop wR[10]-wR[10+nnn] (nnn != 6, 7)
self->vsp += ((byte & 0x7) + 1) * 8;
return 0;
}
}
static int xcd_arm_exidx_decode_entry_11_001(xcd_arm_exidx_t *self, uint8_t byte)
{
int r;
uint8_t bits = byte & 0x7;
if(0 == bits)
{
if(0 != (r = xcd_arm_exidx_entry_pop(self, &byte))) return r;
// 11001000 sssscccc: Pop VFP double precision registers D[16+ssss]-D[16+ssss+cccc] by VPUSH
self->vsp += ((byte & 0xf) + 1) * 8;
return 0;
}
else if(1 == bits)
{
if(0 != (r = xcd_arm_exidx_entry_pop(self, &byte))) return r;
// 11001001 sssscccc: Pop VFP double precision registers D[ssss]-D[ssss+cccc] by VPUSH
self->vsp += ((byte & 0xf) + 1) * 8;
return 0;
}
else
{
// 11001yyy: Spare (yyy != 000, 001)
return XCC_ERRNO_FORMAT;
}
}
static int xcd_arm_exidx_decode_entry_11_010(xcd_arm_exidx_t *self, uint8_t byte)
{
// 11010nnn: Pop VFP double precision registers D[8]-D[8+nnn] by VPUSH
self->vsp += ((byte & 0x7) + 1) * 8;
return 0;
}
static int xcd_arm_exidx_decode_entry_11(xcd_arm_exidx_t *self, uint8_t byte)
{
switch ((byte >> 3) & 0x7)
{
case 0:
return xcd_arm_exidx_decode_entry_11_000(self, byte);
case 1:
return xcd_arm_exidx_decode_entry_11_001(self, byte);
case 2:
return xcd_arm_exidx_decode_entry_11_010(self, byte);
default:
// 11xxxyyy: Spare (xxx != 000, 001, 010)
return XCC_ERRNO_FORMAT;
}
}
static int xcd_arm_exidx_decode_entry(xcd_arm_exidx_t *self)
{
int r = 0;
uint8_t byte;
if(0 != (r = xcd_arm_exidx_entry_pop(self, &byte))) return r;
switch(byte >> 6)
{
case 0:
//00xxxxxx: vsp = vsp + (xxxxxx << 2) + 4
self->vsp += (uintptr_t)(((byte & 0x3f) << 2) + 4);
return 0;
case 1:
//01xxxxxx: vsp = vsp - (xxxxxx << 2) - 4
self->vsp -= (uintptr_t)(((byte & 0x3f) << 2) + 4);
return 0;
case 2:
return xcd_arm_exidx_decode_entry_10(self, byte);
default:
return xcd_arm_exidx_decode_entry_11(self, byte);
}
}
int xcd_arm_exidx_step(xcd_regs_t *regs, xcd_memory_t *memory, pid_t pid,
size_t exidx_offset, size_t exidx_size, uintptr_t load_bias,
uintptr_t pc, int *finished)
{
xcd_arm_exidx_t self;
int r;
if(pc < load_bias) return XCC_ERRNO_NOTFND;
pc -= load_bias;
xcd_arm_exidx_init(&self, regs, memory, pid, exidx_offset, exidx_size, pc);
//get entry offset
if(0 != (r = xcd_arm_exidx_get_entry_offset(&self))) return r;
//get entry
if(0 != (r = xcd_arm_exidx_get_entry(&self)))
{
if(self.no_unwind)
{
*finished = 1;
return 0;
}
return r;
}
#if XCD_ARM_EXIDX_DEBUG
size_t i;
for(i = 0; i < self.entry_size; i++)
XCD_LOG_DEBUG("ARM_EXIDX: entry[%zu]=%x", i, self.entry[i]);
#endif
//decode entry
while(0 == xcd_arm_exidx_decode_entry(&self));
if(self.no_unwind)
{
*finished = 1;
return 0;
}
//step the sp and pc
if(self.finished)
{
if(0 == self.pc_set)
{
xcd_regs_set_pc_from_lr(self.regs, self.pid);
}
xcd_regs_set_sp(self.regs, self.vsp);
//if the pc was set to zero, consider this the final frame
*finished = (0 == xcd_regs_get_pc(self.regs) ? 1 : 0);
return 0;
}
else
{
return XCC_ERRNO_UNKNOWN;
}
}
#endif
|
the_stack_data/1251778.c | struct r
{
int d1, d2;
};
struct km
{
int d;
};
struct f1
{
char *fn;
char *fd;
char *fs;
char *ic;
void (*ff) ();
};
int g ();
int y;
struct r *bs;
int bv;
void b ();
char *w ();
struct km **q;
char **mns;
int nm;
struct f1 **z;
f (char *km, char *h)
{
struct f1 *t;
int map = midn(km, strlen(km));
int V;
int c;
struct r r;
struct f1 *cm;
if (!g(&V, &cm, h, strlen(h)))
{
c = (cm - z[V]);
goto L;
}
for (c = 0; c < nm; c++)
if (!strcmp (h, mns[c]))
{
V = -1;
goto L;
}
for (c = 0; c < y; c++)
{
if (!memcmp (&bs[c], &r, 8))
goto L;
}
h = w (&r);
if (!bv)
{
bs = g (8);
t = (struct f1 *)g (20);
}
else
{
bs = g (bs, y * 8);
z[bv] = cr (z[bv], (1 + y) * 20);
t = &z[bv][y - 1];
}
bs[y - 1] = r;
t->fs[0] = sp (y - 1);
t->fs[1] = 0;
t->ic = 0;
t->fd = 0;
t->fn = cs (h);
t->ff = b;
L:
g (q[map], V, c);
}
|
the_stack_data/71273.c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_spy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: angagnie <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/07/17 07:06:56 by angagnie #+# #+# */
/* Updated: 2015/07/17 07:06:57 by angagnie ### ########.fr */
/* */
/* ************************************************************************** */
#include <unistd.h>
char *ft_to_lowercase(char *str)
{
int a;
a = -1;
while (str[++a])
{
if (str[a] >= 'A' && str[a] <= 'Z')
str[a] += ('a' - 'A');
}
return (str);
}
int match_ignore_spaces(char *str1, char *str2)
{
if (*str1 == ' ')
return (match_ignore_spaces(str1 + 1, str2));
if (*str2 == ' ')
return (match_ignore_spaces(str1, str2 + 1));
if (*str1 == 0 && *str2 == 0)
return (1);
if (*str1 == *str2)
return (match_ignore_spaces(str1 + 1, str2 + 1));
return (0);
}
int is_interesting(char *str)
{
char *one[3];
int a;
one[0] = "president";
one[1] = " attack ";
one[2] = " powers ";
a = -1;
str = ft_to_lowercase(str);
while (++a < 3)
if (match_ignore_spaces(str, one[a]))
return (1);
return (0);
}
int main(int argc, char **argv)
{
int a;
if (argc == 1)
return (0);
a = -1;
while (++a < argc)
if (is_interesting(argv[a]))
{
write(1, "Alert!!!\n", 9);
break ;
}
return (0);
}
|
the_stack_data/56535.c | // RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s -Wuninitialized
// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s -Wuninitialized
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp target parallel for'}}
#pragma omp target parallel for
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp target parallel for'}}
#pragma omp target parallel for foo
void test_no_clause(void) {
int i;
#pragma omp target parallel for
for (i = 0; i < 16; ++i)
;
// expected-error@+2 {{statement after '#pragma omp target parallel for' must be a for loop}}
#pragma omp target parallel for
++i;
}
void test_branch_protected_scope(void) {
int i = 0;
L1:
++i;
int x[24];
#pragma omp target parallel for
for (i = 0; i < 16; ++i) {
if (i == 5)
goto L1; // expected-error {{use of undeclared label 'L1'}}
else if (i == 6)
return; // expected-error {{cannot return from OpenMP region}}
else if (i == 7)
goto L2;
else if (i == 8) {
L2:
x[i]++;
}
}
if (x[0] == 0)
goto L2; // expected-error {{use of undeclared label 'L2'}}
else if (x[1] == 1)
goto L1;
}
void test_invalid_clause(void) {
int i;
// expected-warning@+1 {{extra tokens at the end of '#pragma omp target parallel for' are ignored}}
#pragma omp target parallel for foo bar
for (i = 0; i < 16; ++i)
;
}
void test_non_identifiers(void) {
int i, x;
// expected-warning@+1 {{extra tokens at the end of '#pragma omp target parallel for' are ignored}}
#pragma omp target parallel for;
for (i = 0; i < 16; ++i)
;
// expected-warning@+1 {{extra tokens at the end of '#pragma omp target parallel for' are ignored}}
#pragma omp target parallel for private(x);
for (i = 0; i < 16; ++i)
;
// expected-warning@+1 {{extra tokens at the end of '#pragma omp target parallel for' are ignored}}
#pragma omp target parallel for, private(x);
for (i = 0; i < 16; ++i)
;
}
extern int foo(void);
void test_collapse(void) {
int i;
// expected-error@+1 {{expected '('}}
#pragma omp target parallel for collapse
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp target parallel for collapse(
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expected expression}}
#pragma omp target parallel for collapse()
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp target parallel for collapse(,
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp target parallel for collapse(, )
for (i = 0; i < 16; ++i)
;
// expected-warning@+2 {{extra tokens at the end of '#pragma omp target parallel for' are ignored}}
// expected-error@+1 {{expected '('}}
#pragma omp target parallel for collapse 4)
for (i = 0; i < 16; ++i)
;
// expected-error@+2 {{expected ')'}}
// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
#pragma omp target parallel for collapse(4
for (i = 0; i < 16; ++i)
; // expected-error {{expected 4 for loops after '#pragma omp target parallel for', but found only 1}}
// expected-error@+2 {{expected ')'}}
// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
#pragma omp target parallel for collapse(4,
for (i = 0; i < 16; ++i)
; // expected-error {{expected 4 for loops after '#pragma omp target parallel for', but found only 1}}
// expected-error@+2 {{expected ')'}}
// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
#pragma omp target parallel for collapse(4, )
for (i = 0; i < 16; ++i)
; // expected-error {{expected 4 for loops after '#pragma omp target parallel for', but found only 1}}
// expected-note@+1 {{as specified in 'collapse' clause}}
#pragma omp target parallel for collapse(4)
for (i = 0; i < 16; ++i)
; // expected-error {{expected 4 for loops after '#pragma omp target parallel for', but found only 1}}
// expected-error@+2 {{expected ')'}}
// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
#pragma omp target parallel for collapse(4 4)
for (i = 0; i < 16; ++i)
; // expected-error {{expected 4 for loops after '#pragma omp target parallel for', but found only 1}}
// expected-error@+2 {{expected ')'}}
// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
#pragma omp target parallel for collapse(4, , 4)
for (i = 0; i < 16; ++i)
; // expected-error {{expected 4 for loops after '#pragma omp target parallel for', but found only 1}}
#pragma omp target parallel for collapse(4)
for (int i1 = 0; i1 < 16; ++i1)
for (int i2 = 0; i2 < 16; ++i2)
for (int i3 = 0; i3 < 16; ++i3)
for (int i4 = 0; i4 < 16; ++i4)
foo();
// expected-error@+2 {{expected ')'}}
// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
#pragma omp target parallel for collapse(4, 8)
for (i = 0; i < 16; ++i)
; // expected-error {{expected 4 for loops after '#pragma omp target parallel for', but found only 1}}
// expected-error@+1 {{integer constant expression}}
#pragma omp target parallel for collapse(2.5)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{integer constant expression}}
#pragma omp target parallel for collapse(foo())
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}}
#pragma omp target parallel for collapse(-5)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}}
#pragma omp target parallel for collapse(0)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}}
#pragma omp target parallel for collapse(5 - 5)
for (i = 0; i < 16; ++i)
;
// expected-note@+1 2 {{defined as firstprivate}}
#pragma omp target parallel for collapse(2) firstprivate(i)
for (i = 0; i < 16; ++i) // expected-error {{loop iteration variable in the associated loop of 'omp target parallel for' directive may not be firstprivate, predetermined as private}}
// expected-note@+1 {{variable with automatic storage duration is predetermined as private; perhaps you forget to enclose 'omp for' directive into a parallel or another task region?}}
for (int j = 0; j < 16; ++j)
// expected-error@+2 2 {{reduction variable must be shared}}
// expected-error@+1 {{region cannot be closely nested inside 'target parallel for' region; perhaps you forget to enclose 'omp for' directive into a parallel region?}}
#pragma omp for reduction(+ : i, j)
for (int k = 0; k < 16; ++k)
i += j;
}
void test_private(void) {
int i;
// expected-error@+2 {{expected expression}}
// expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp target parallel for private(
for (i = 0; i < 16; ++i)
;
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
// expected-error@+1 2 {{expected expression}}
#pragma omp target parallel for private(,
for (i = 0; i < 16; ++i)
;
// expected-error@+1 2 {{expected expression}}
#pragma omp target parallel for private(, )
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expected expression}}
#pragma omp target parallel for private()
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expected expression}}
#pragma omp target parallel for private(int)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expected variable name}}
#pragma omp target parallel for private(0)
for (i = 0; i < 16; ++i)
;
int x, y, z;
#pragma omp target parallel for private(x)
for (i = 0; i < 16; ++i)
;
#pragma omp target parallel for private(x, y)
for (i = 0; i < 16; ++i)
;
#pragma omp target parallel for private(x, y, z)
for (i = 0; i < 16; ++i) {
x = y * i + z;
}
}
void test_lastprivate(void) {
int i;
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
// expected-error@+1 {{expected expression}}
#pragma omp target parallel for lastprivate(
for (i = 0; i < 16; ++i)
;
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
// expected-error@+1 2 {{expected expression}}
#pragma omp target parallel for lastprivate(,
for (i = 0; i < 16; ++i)
;
// expected-error@+1 2 {{expected expression}}
#pragma omp target parallel for lastprivate(, )
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expected expression}}
#pragma omp target parallel for lastprivate()
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expected expression}}
#pragma omp target parallel for lastprivate(int)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expected variable name}}
#pragma omp target parallel for lastprivate(0)
for (i = 0; i < 16; ++i)
;
int x, y, z;
#pragma omp target parallel for lastprivate(x)
for (i = 0; i < 16; ++i)
;
#pragma omp target parallel for lastprivate(x, y)
for (i = 0; i < 16; ++i)
;
#pragma omp target parallel for lastprivate(x, y, z)
for (i = 0; i < 16; ++i)
;
}
void test_firstprivate(void) {
int i;
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
// expected-error@+1 {{expected expression}}
#pragma omp target parallel for firstprivate(
for (i = 0; i < 16; ++i)
;
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
// expected-error@+1 2 {{expected expression}}
#pragma omp target parallel for firstprivate(,
for (i = 0; i < 16; ++i)
;
// expected-error@+1 2 {{expected expression}}
#pragma omp target parallel for firstprivate(, )
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expected expression}}
#pragma omp target parallel for firstprivate()
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expected expression}}
#pragma omp target parallel for firstprivate(int)
for (i = 0; i < 16; ++i)
;
// expected-error@+1 {{expected variable name}}
#pragma omp target parallel for firstprivate(0)
for (i = 0; i < 16; ++i)
;
int x, y, z;
#pragma omp target parallel for lastprivate(x) firstprivate(x)
for (i = 0; i < 16; ++i)
;
#pragma omp target parallel for lastprivate(x, y) firstprivate(x, y)
for (i = 0; i < 16; ++i)
;
#pragma omp target parallel for lastprivate(x, y, z) firstprivate(x, y, z)
for (i = 0; i < 16; ++i)
;
}
void test_loop_messages(void) {
float a[100], b[100], c[100];
// expected-error@+2 {{variable must be of integer or pointer type}}
#pragma omp target parallel for
for (float fi = 0; fi < 10.0; fi++) {
c[(int)fi] = a[(int)fi] + b[(int)fi];
}
// expected-error@+2 {{variable must be of integer or pointer type}}
#pragma omp target parallel for
for (double fi = 0; fi < 10.0; fi++) {
c[(int)fi] = a[(int)fi] + b[(int)fi];
}
}
|
the_stack_data/20449081.c | #include <stdio.h>
int main ()
{
int n1,n2,i;
printf ("Coloque um valor ");
scanf ("%d",&n1);
do{
printf ("Coloque 1 ou 0: ");
scanf ("%d",&n2);
if(n2!=1 && n2!=0)
printf("O numero deve ser 1 ou 0");
}while (n2!=1 && n2!=0);
printf(" valor aceito:\n");
if(n2==1){
for (i=n1;i>=0;i--){
printf("%d\n",i);
}
} else {
for (i=0;i<=n1;i++)
{
printf("%d\n",i);
}
}
return 0;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.