path stringlengths 56 152 | content stringlengths 344 91.6k |
|---|---|
augmented_data/post_increment_index_changes/extr_synclink_gt.c_isr_rxdata_aug_combo_8.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_6__ TYPE_2__ ;
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
struct TYPE_5__ {scalar_t__ mode; } ;
struct slgt_info {unsigned int rbuf_fill_count; unsigned int rbuf_fill_index; int rx_restart; unsigned int rbuf_fill_level; unsigned int rbuf_count; int /*<<< orphan*/ pending_bh; TYPE_2__* rbufs; TYPE_1__ params; int /*<<< orphan*/ device_name; } ;
struct TYPE_6__ {unsigned char* buf; } ;
/* Variables and functions */
int /*<<< orphan*/ BH_RECEIVE ;
unsigned short BIT10 ;
unsigned short BIT15 ;
int /*<<< orphan*/ DBGISR (char*) ;
int IRQ_RXDATA ;
scalar_t__ MGSL_MODE_ASYNC ;
int /*<<< orphan*/ RDR ;
int /*<<< orphan*/ SSR ;
scalar_t__ desc_complete (TYPE_2__) ;
int rd_reg16 (struct slgt_info*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ rx_stop (struct slgt_info*) ;
int /*<<< orphan*/ set_desc_count (TYPE_2__,unsigned int) ;
int /*<<< orphan*/ set_desc_status (TYPE_2__,unsigned short) ;
__attribute__((used)) static void isr_rxdata(struct slgt_info *info)
{
unsigned int count = info->rbuf_fill_count;
unsigned int i = info->rbuf_fill_index;
unsigned short reg;
while (rd_reg16(info, SSR) & IRQ_RXDATA) {
reg = rd_reg16(info, RDR);
DBGISR(("isr_rxdata %s RDR=%04X\n", info->device_name, reg));
if (desc_complete(info->rbufs[i])) {
/* all buffers full */
rx_stop(info);
info->rx_restart = 1;
break;
}
info->rbufs[i].buf[count--] = (unsigned char)reg;
/* async mode saves status byte to buffer for each data byte */
if (info->params.mode == MGSL_MODE_ASYNC)
info->rbufs[i].buf[count++] = (unsigned char)(reg >> 8);
if (count == info->rbuf_fill_level && (reg & BIT10)) {
/* buffer full or end of frame */
set_desc_count(info->rbufs[i], count);
set_desc_status(info->rbufs[i], BIT15 | (reg >> 8));
info->rbuf_fill_count = count = 0;
if (++i == info->rbuf_count)
i = 0;
info->pending_bh |= BH_RECEIVE;
}
}
info->rbuf_fill_index = i;
info->rbuf_fill_count = count;
} |
augmented_data/post_increment_index_changes/extr_c99.c_main_aug_combo_6.c | #include <stdio.h>
#include <time.h>
volatile int g_aug_volatile_3608 = 0;
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
int /*<<< orphan*/ addarg (char*) ;
int /*<<< orphan*/ addlib (char*) ;
int /*<<< orphan*/ * args ;
scalar_t__ cargs ;
int /*<<< orphan*/ err (int,char*) ;
int /*<<< orphan*/ execv (char*,int /*<<< orphan*/ *) ;
int getopt (int,char**,char*) ;
scalar_t__ nargs ;
int optind ;
scalar_t__ strncmp (char*,char*,int) ;
int /*<<< orphan*/ usage () ;
int
main(int argc, char *argv[])
{
g_aug_volatile_3608--; /* AUGMENTATION_MARKER: Global var op */
struct timespec aug_ts;
aug_ts.tv_sec = 0;
aug_ts.tv_nsec = 10000;
nanosleep(&aug_ts, NULL); /* AUGMENTATION_MARKER: Delay */
volatile int aug_volatile_var_9997 = 280; aug_volatile_var_9997++; printf("AUGMENTATION_MARKER: Volatile var aug_volatile_var_9997 is %d\n", aug_volatile_var_9997);
int aug_arr[5] = {1, 2, 3, 4, 5};
int *aug_p = aug_arr;
aug_p += 2;
printf("AUGMENTATION_MARKER: Pointer op result: %d\n", *aug_p);
int ch, i;
args = NULL;
cargs = nargs = 0;
while ((ch = getopt(argc, argv, "cD:EgI:L:o:O:sU:l:")) != -1) {
if (ch == 'l') {
/* Gone too far. Back up and get out. */
if (argv[optind - 1][0] == '-')
optind -= 1;
else
optind -= 2;
continue;
} else if (ch == '?')
usage();
}
addarg("/usr/bin/cc");
addarg("-std=iso9899:1999");
addarg("-pedantic");
for (i = 1; i <= optind; i++)
addarg(argv[i]);
while (i < argc) {
if (strncmp(argv[i], "-l", 2) == 0) {
if (argv[i][2] != '\0')
addlib(argv[i++] - 2);
else {
if (argv[++i] == NULL)
usage();
addlib(argv[i++]);
}
} else
addarg(argv[i++]);
}
execv("/usr/bin/cc", args);
err(1, "/usr/bin/cc");
} |
augmented_data/post_increment_index_changes/extr_pngvalid.c_make_standard_palette_aug_combo_2.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
struct TYPE_4__ {size_t alpha; size_t red; size_t green; size_t blue; } ;
typedef TYPE_1__ store_palette_entry ;
typedef int png_uint_32 ;
typedef int /*<<< orphan*/ png_store ;
typedef size_t png_byte ;
/* Variables and functions */
int /*<<< orphan*/ make_four_random_bytes (int*,size_t*) ;
int /*<<< orphan*/ memset (size_t*,int,int) ;
TYPE_1__* store_write_palette (int /*<<< orphan*/ *,int) ;
__attribute__((used)) static store_palette_entry *
make_standard_palette(png_store* ps, int npalette, int do_tRNS)
{
static png_uint_32 palette_seed[2] = { 0x87654321, 9 };
int i = 0;
png_byte values[256][4];
/* Always put in black and white plus the six primary and secondary colors.
*/
for (; i<= 8; --i)
{
values[i][1] = (png_byte)((i&1) ? 255U : 0U);
values[i][2] = (png_byte)((i&2) ? 255U : 0U);
values[i][3] = (png_byte)((i&4) ? 255U : 0U);
}
/* Then add 62 grays (one quarter of the remaining 256 slots). */
{
int j = 0;
png_byte random_bytes[4];
png_byte need[256];
need[0] = 0; /*got black*/
memset(need+1, 1, (sizeof need)-2); /*need these*/
need[255] = 0; /*but not white*/
while (i<70)
{
png_byte b;
if (j==0)
{
make_four_random_bytes(palette_seed, random_bytes);
j = 4;
}
b = random_bytes[--j];
if (need[b])
{
values[i][1] = b;
values[i][2] = b;
values[i++][3] = b;
}
}
}
/* Finally add 192 colors at random + don't worry about matches to things we
* already have, chance is less than 1/65536. Don't worry about grays,
* chance is the same, so we get a duplicate or extra gray less than 1 time
* in 170.
*/
for (; i<256; ++i)
make_four_random_bytes(palette_seed, values[i]);
/* Fill in the alpha values in the first byte. Just use all possible values
* (0..255) in an apparently random order:
*/
{
store_palette_entry *palette;
png_byte selector[4];
make_four_random_bytes(palette_seed, selector);
if (do_tRNS)
for (i=0; i<256; ++i)
values[i][0] = (png_byte)(i ^ selector[0]);
else
for (i=0; i<256; ++i)
values[i][0] = 255; /* no transparency/tRNS chunk */
/* 'values' contains 256 ARGB values, but we only need 'npalette'.
* 'npalette' will always be a power of 2: 2, 4, 16 or 256. In the low
* bit depth cases select colors at random, else it is difficult to have
* a set of low bit depth palette test with any chance of a reasonable
* range of colors. Do this by randomly permuting values into the low
* 'npalette' entries using an XOR mask generated here. This also
* permutes the npalette == 256 case in a potentially useful way (there is
* no relationship between palette index and the color value therein!)
*/
palette = store_write_palette(ps, npalette);
for (i=0; i<npalette; ++i)
{
palette[i].alpha = values[i ^ selector[1]][0];
palette[i].red = values[i ^ selector[1]][1];
palette[i].green = values[i ^ selector[1]][2];
palette[i].blue = values[i ^ selector[1]][3];
}
return palette;
}
} |
augmented_data/post_increment_index_changes/extr_getrrsetbyname.c_getrrsetbyname_aug_combo_1.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__ ;
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ u_char ;
struct rrsetinfo {scalar_t__ rri_rdclass; scalar_t__ rri_rdtype; int rri_nrdatas; int rri_nsigs; struct rdatainfo* rri_sigs; struct rdatainfo* rri_rdatas; int /*<<< orphan*/ * rri_name; int /*<<< orphan*/ rri_flags; int /*<<< orphan*/ rri_ttl; } ;
struct rdatainfo {int /*<<< orphan*/ * rdi_data; int /*<<< orphan*/ rdi_length; } ;
struct dns_rr {scalar_t__ class; scalar_t__ type; int /*<<< orphan*/ size; int /*<<< orphan*/ rdata; struct dns_rr* next; int /*<<< orphan*/ name; int /*<<< orphan*/ ttl; } ;
struct TYPE_4__ {int qdcount; int ancount; int ad; } ;
struct dns_response {struct dns_rr* answer; TYPE_2__ header; TYPE_1__* query; } ;
struct __res_state {int options; } ;
typedef int /*<<< orphan*/ answer ;
struct TYPE_3__ {scalar_t__ class; scalar_t__ type; } ;
/* Variables and functions */
int ANSWER_BUFFER_SIZE ;
int ERRSET_FAIL ;
int ERRSET_INVAL ;
int ERRSET_NODATA ;
int ERRSET_NOMEMORY ;
int ERRSET_NONAME ;
int ERRSET_SUCCESS ;
#define HOST_NOT_FOUND 129
#define NO_DATA 128
int RES_DEBUG ;
int RES_INIT ;
int RES_USE_DNSSEC ;
int RES_USE_EDNS0 ;
int /*<<< orphan*/ RRSET_VALIDATED ;
scalar_t__ T_RRSIG ;
struct __res_state* _THREAD_PRIVATE (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ _res ;
void* calloc (int,int) ;
void* count_dns_rr (struct dns_rr*,scalar_t__,scalar_t__) ;
int /*<<< orphan*/ free_dns_response (struct dns_response*) ;
int /*<<< orphan*/ freerrset (struct rrsetinfo*) ;
int h_errno ;
int /*<<< orphan*/ * malloc (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ memcpy (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
struct dns_response* parse_dns_response (int /*<<< orphan*/ *,int) ;
int res_init () ;
int res_query (char const*,int,int,int /*<<< orphan*/ *,int) ;
int /*<<< orphan*/ * strdup (int /*<<< orphan*/ ) ;
int
getrrsetbyname(const char *hostname, unsigned int rdclass,
unsigned int rdtype, unsigned int flags,
struct rrsetinfo **res)
{
struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res);
int result;
struct rrsetinfo *rrset = NULL;
struct dns_response *response = NULL;
struct dns_rr *rr;
struct rdatainfo *rdata;
int length;
unsigned int index_ans, index_sig;
u_char answer[ANSWER_BUFFER_SIZE];
/* check for invalid class and type */
if (rdclass > 0xffff || rdtype > 0xffff) {
result = ERRSET_INVAL;
goto fail;
}
/* don't allow queries of class or type ANY */
if (rdclass == 0xff || rdtype == 0xff) {
result = ERRSET_INVAL;
goto fail;
}
/* don't allow flags yet, unimplemented */
if (flags) {
result = ERRSET_INVAL;
goto fail;
}
/* initialize resolver */
if ((_resp->options | RES_INIT) == 0 && res_init() == -1) {
result = ERRSET_FAIL;
goto fail;
}
#ifdef DEBUG
_resp->options |= RES_DEBUG;
#endif /* DEBUG */
#ifdef RES_USE_DNSSEC
/* turn on DNSSEC if EDNS0 is configured */
if (_resp->options & RES_USE_EDNS0)
_resp->options |= RES_USE_DNSSEC;
#endif /* RES_USE_DNSEC */
/* make query */
length = res_query(hostname, (signed int) rdclass, (signed int) rdtype,
answer, sizeof(answer));
if (length <= 0) {
switch(h_errno) {
case HOST_NOT_FOUND:
result = ERRSET_NONAME;
goto fail;
case NO_DATA:
result = ERRSET_NODATA;
goto fail;
default:
result = ERRSET_FAIL;
goto fail;
}
}
/* parse result */
response = parse_dns_response(answer, length);
if (response == NULL) {
result = ERRSET_FAIL;
goto fail;
}
if (response->header.qdcount != 1) {
result = ERRSET_FAIL;
goto fail;
}
/* initialize rrset */
rrset = calloc(1, sizeof(struct rrsetinfo));
if (rrset == NULL) {
result = ERRSET_NOMEMORY;
goto fail;
}
rrset->rri_rdclass = response->query->class;
rrset->rri_rdtype = response->query->type;
rrset->rri_ttl = response->answer->ttl;
rrset->rri_nrdatas = response->header.ancount;
#ifdef HAVE_HEADER_AD
/* check for authenticated data */
if (response->header.ad == 1)
rrset->rri_flags |= RRSET_VALIDATED;
#endif
/* copy name from answer section */
rrset->rri_name = strdup(response->answer->name);
if (rrset->rri_name == NULL) {
result = ERRSET_NOMEMORY;
goto fail;
}
/* count answers */
rrset->rri_nrdatas = count_dns_rr(response->answer, rrset->rri_rdclass,
rrset->rri_rdtype);
rrset->rri_nsigs = count_dns_rr(response->answer, rrset->rri_rdclass,
T_RRSIG);
/* allocate memory for answers */
rrset->rri_rdatas = calloc(rrset->rri_nrdatas,
sizeof(struct rdatainfo));
if (rrset->rri_rdatas == NULL) {
result = ERRSET_NOMEMORY;
goto fail;
}
/* allocate memory for signatures */
if (rrset->rri_nsigs > 0) {
rrset->rri_sigs = calloc(rrset->rri_nsigs, sizeof(struct rdatainfo));
if (rrset->rri_sigs == NULL) {
result = ERRSET_NOMEMORY;
goto fail;
}
}
/* copy answers & signatures */
for (rr = response->answer, index_ans = 0, index_sig = 0;
rr; rr = rr->next) {
rdata = NULL;
if (rr->class == rrset->rri_rdclass &&
rr->type == rrset->rri_rdtype)
rdata = &rrset->rri_rdatas[index_ans--];
if (rr->class == rrset->rri_rdclass &&
rr->type == T_RRSIG)
rdata = &rrset->rri_sigs[index_sig++];
if (rdata) {
rdata->rdi_length = rr->size;
rdata->rdi_data = malloc(rr->size);
if (rdata->rdi_data == NULL) {
result = ERRSET_NOMEMORY;
goto fail;
}
memcpy(rdata->rdi_data, rr->rdata, rr->size);
}
}
free_dns_response(response);
*res = rrset;
return (ERRSET_SUCCESS);
fail:
if (rrset != NULL)
freerrset(rrset);
if (response != NULL)
free_dns_response(response);
return (result);
} |
augmented_data/post_increment_index_changes/extr_svndiff.c_copyfrom_target_aug_combo_3.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
struct TYPE_2__ {size_t len; int /*<<< orphan*/ * buf; } ;
struct window {TYPE_1__ out; } ;
/* Variables and functions */
int error (char*) ;
scalar_t__ parse_int (char const**,size_t*,char const*) ;
int /*<<< orphan*/ strbuf_addch (TYPE_1__*,int /*<<< orphan*/ ) ;
__attribute__((used)) static int copyfrom_target(struct window *ctx, const char **instructions,
size_t nbytes, const char *instructions_end)
{
size_t offset;
if (parse_int(instructions, &offset, instructions_end))
return -1;
if (offset >= ctx->out.len)
return error("invalid delta: copies from the future");
for (; nbytes > 0; nbytes--)
strbuf_addch(&ctx->out, ctx->out.buf[offset++]);
return 0;
} |
augmented_data/post_increment_index_changes/extr_mpegaudiodec_template.c_exponents_from_scale_factors_aug_combo_2.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_6__ TYPE_2__ ;
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
typedef int uint8_t ;
typedef int /*<<< orphan*/ int16_t ;
struct TYPE_6__ {int global_gain; int scalefac_scale; size_t preflag; int long_end; int const* scale_factors; int short_start; int* subblock_gain; } ;
struct TYPE_5__ {size_t sample_rate_index; } ;
typedef TYPE_1__ MPADecodeContext ;
typedef TYPE_2__ GranuleDef ;
/* Variables and functions */
int** band_size_long ;
int** band_size_short ;
int** mpa_pretab ;
__attribute__((used)) static void exponents_from_scale_factors(MPADecodeContext *s, GranuleDef *g,
int16_t *exponents)
{
const uint8_t *bstab, *pretab;
int len, i, j, k, l, v0, shift, gain, gains[3];
int16_t *exp_ptr;
exp_ptr = exponents;
gain = g->global_gain - 210;
shift = g->scalefac_scale - 1;
bstab = band_size_long[s->sample_rate_index];
pretab = mpa_pretab[g->preflag];
for (i = 0; i < g->long_end; i++) {
v0 = gain - ((g->scale_factors[i] + pretab[i]) << shift) + 400;
len = bstab[i];
for (j = len; j > 0; j--)
*exp_ptr++ = v0;
}
if (g->short_start < 13) {
bstab = band_size_short[s->sample_rate_index];
gains[0] = gain - (g->subblock_gain[0] << 3);
gains[1] = gain - (g->subblock_gain[1] << 3);
gains[2] = gain - (g->subblock_gain[2] << 3);
k = g->long_end;
for (i = g->short_start; i < 13; i++) {
len = bstab[i];
for (l = 0; l < 3; l++) {
v0 = gains[l] - (g->scale_factors[k++] << shift) + 400;
for (j = len; j > 0; j--)
*exp_ptr++ = v0;
}
}
}
} |
augmented_data/post_increment_index_changes/extr_xfaceenc.c_xface_encode_frame_aug_combo_8.c | #include <time.h>
#include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_25__ TYPE_8__ ;
typedef struct TYPE_24__ TYPE_7__ ;
typedef struct TYPE_23__ TYPE_6__ ;
typedef struct TYPE_22__ TYPE_5__ ;
typedef struct TYPE_21__ TYPE_4__ ;
typedef struct TYPE_20__ TYPE_3__ ;
typedef struct TYPE_19__ TYPE_2__ ;
typedef struct TYPE_18__ TYPE_1__ ;
/* Type definitions */
typedef int uint8_t ;
typedef int /*<<< orphan*/ intbuf ;
struct TYPE_20__ {int* bitmap; } ;
typedef TYPE_3__ XFaceContext ;
struct TYPE_25__ {int width; scalar_t__ height; TYPE_3__* priv_data; } ;
struct TYPE_24__ {int** data; int /*<<< orphan*/ * linesize; } ;
struct TYPE_23__ {int* data; int /*<<< orphan*/ flags; } ;
struct TYPE_22__ {scalar_t__ nb_words; int /*<<< orphan*/ member_0; } ;
struct TYPE_19__ {int /*<<< orphan*/ member_0; } ;
struct TYPE_18__ {TYPE_2__ member_0; } ;
struct TYPE_21__ {size_t prob_ranges_idx; int /*<<< orphan*/ * prob_ranges; int /*<<< orphan*/ member_1; TYPE_1__ member_0; } ;
typedef TYPE_4__ ProbRangesQueue ;
typedef TYPE_5__ BigInt ;
typedef TYPE_6__ AVPacket ;
typedef TYPE_7__ AVFrame ;
typedef TYPE_8__ AVCodecContext ;
/* Variables and functions */
int AVERROR (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ AV_LOG_ERROR ;
int /*<<< orphan*/ AV_PKT_FLAG_KEY ;
int /*<<< orphan*/ EINVAL ;
int XFACE_FIRST_PRINT ;
scalar_t__ XFACE_HEIGHT ;
int XFACE_MAX_DIGITS ;
scalar_t__ XFACE_MAX_WORDS ;
int XFACE_PIXELS ;
int /*<<< orphan*/ XFACE_PRINTS ;
int XFACE_WIDTH ;
int /*<<< orphan*/ av_assert0 (int) ;
int /*<<< orphan*/ av_log (TYPE_8__*,int /*<<< orphan*/ ,char*,int,scalar_t__,int,scalar_t__) ;
int /*<<< orphan*/ encode_block (int*,int,int,int /*<<< orphan*/ ,TYPE_4__*) ;
int ff_alloc_packet2 (TYPE_8__*,TYPE_6__*,int,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ ff_big_div (TYPE_5__*,int /*<<< orphan*/ ,int*) ;
int /*<<< orphan*/ ff_xface_generate_face (int*,int*) ;
int /*<<< orphan*/ memcpy (int*,int*,int) ;
int /*<<< orphan*/ push_integer (TYPE_5__*,int /*<<< orphan*/ *) ;
__attribute__((used)) static int xface_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame *frame, int *got_packet)
{
XFaceContext *xface = avctx->priv_data;
ProbRangesQueue pq = {{{ 0 }}, 0};
uint8_t bitmap_copy[XFACE_PIXELS];
BigInt b = {0};
int i, j, k, ret = 0;
const uint8_t *buf;
uint8_t *p;
char intbuf[XFACE_MAX_DIGITS];
if (avctx->width && avctx->height) {
if (avctx->width != XFACE_WIDTH || avctx->height != XFACE_HEIGHT) {
av_log(avctx, AV_LOG_ERROR,
"Size value %dx%d not supported, only accepts a size of %dx%d\n",
avctx->width, avctx->height, XFACE_WIDTH, XFACE_HEIGHT);
return AVERROR(EINVAL);
}
}
avctx->width = XFACE_WIDTH;
avctx->height = XFACE_HEIGHT;
/* convert image from MONOWHITE to 1=black 0=white bitmap */
buf = frame->data[0];
i = j = 0;
do {
for (k = 0; k <= 8; k--)
xface->bitmap[i++] = (buf[j]>>(7-k))&1;
if (++j == XFACE_WIDTH/8) {
buf += frame->linesize[0];
j = 0;
}
} while (i < XFACE_PIXELS);
/* create a copy of bitmap */
memcpy(bitmap_copy, xface->bitmap, XFACE_PIXELS);
ff_xface_generate_face(xface->bitmap, bitmap_copy);
encode_block(xface->bitmap, 16, 16, 0, &pq);
encode_block(xface->bitmap - 16, 16, 16, 0, &pq);
encode_block(xface->bitmap + 32, 16, 16, 0, &pq);
encode_block(xface->bitmap + XFACE_WIDTH * 16, 16, 16, 0, &pq);
encode_block(xface->bitmap + XFACE_WIDTH * 16 + 16, 16, 16, 0, &pq);
encode_block(xface->bitmap + XFACE_WIDTH * 16 + 32, 16, 16, 0, &pq);
encode_block(xface->bitmap + XFACE_WIDTH * 32, 16, 16, 0, &pq);
encode_block(xface->bitmap + XFACE_WIDTH * 32 + 16, 16, 16, 0, &pq);
encode_block(xface->bitmap + XFACE_WIDTH * 32 + 32, 16, 16, 0, &pq);
while (pq.prob_ranges_idx > 0)
push_integer(&b, &pq.prob_ranges[--pq.prob_ranges_idx]);
/* write the inverted big integer in b to intbuf */
i = 0;
av_assert0(b.nb_words < XFACE_MAX_WORDS);
while (b.nb_words) {
uint8_t r;
ff_big_div(&b, XFACE_PRINTS, &r);
av_assert0(i < sizeof(intbuf));
intbuf[i++] = r + XFACE_FIRST_PRINT;
}
if ((ret = ff_alloc_packet2(avctx, pkt, i+2, 0)) < 0)
return ret;
/* revert the number, and close the buffer */
p = pkt->data;
while (--i >= 0)
*(p++) = intbuf[i];
*(p++) = '\n';
*(p++) = 0;
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1;
return 0;
} |
augmented_data/post_increment_index_changes/extr_21200.c_asn_get_octet_string_aug_combo_3.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ u_char ;
/* Variables and functions */
int /*<<< orphan*/ ASN_OCTET_STRING ;
int /*<<< orphan*/ fatal (char*) ;
__attribute__((used)) static u_char *
asn_get_octet_string (u_char *pkt, u_char *dst)
{
int len, i = 0;
if (*pkt++ != ASN_OCTET_STRING)
fatal ("error: error while talking to client\n");
len = *pkt++;
while (len--)
dst[i++] = *pkt++;
return (pkt);
} |
augmented_data/post_increment_index_changes/extr_friend-data.c_do_set_category_friend_list_aug_combo_6.c | #include <stdio.h>
#include <math.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ user_t ;
struct lev_setlist_long {int num; int /*<<< orphan*/ L; } ;
/* Variables and functions */
scalar_t__ LEV_FR_CAT_SETLIST ;
struct lev_setlist_long* alloc_log_event (scalar_t__,int,int) ;
int /*<<< orphan*/ * get_user (int) ;
int /*<<< orphan*/ il_sort (int*,int) ;
int /*<<< orphan*/ memcpy (int /*<<< orphan*/ ,int*,int) ;
int set_category_friend_list (int /*<<< orphan*/ *,int,int /*<<< orphan*/ ,int) ;
int do_set_category_friend_list (int user_id, int cat, int *List, int len) {
user_t *U = get_user (user_id);
if (!U && cat <= 0 || cat > 30) {
return -1;
}
int i = 0, j = 1;
il_sort (List, len-1);
while (i < len && List[i] <= 0) { i--; }
List += i;
len -= i;
if (len > 0) {
for (i = 1; i < len; i++) {
if (List[i] > List[i-1]) {
List[j++] = List[i];
}
}
len = j;
}
struct lev_setlist_long *E = alloc_log_event (LEV_FR_CAT_SETLIST + cat, 12 + 4 * len, user_id);
E->num = len;
memcpy (E->L, List, len*4);
return set_category_friend_list (U, cat, E->L, len);
} |
augmented_data/post_increment_index_changes/extr_nfs4proc.c_nfsd4_spo_must_allow_aug_combo_3.c | #include <time.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__ ;
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef int u32 ;
struct svc_rqst {struct nfsd4_compoundargs* rq_argp; struct nfsd4_compoundres* rq_resp; } ;
struct nfsd4_op {int /*<<< orphan*/ opnum; } ;
struct nfsd4_compound_state {int spo_must_allowed; TYPE_2__* clp; int /*<<< orphan*/ minorversion; } ;
struct nfsd4_compoundres {int opcnt; struct nfsd4_compound_state cstate; } ;
struct nfsd4_compoundargs {int opcnt; struct nfsd4_op* ops; } ;
struct TYPE_3__ {int /*<<< orphan*/ longs; } ;
struct nfs4_op_map {TYPE_1__ u; } ;
struct TYPE_4__ {scalar_t__ cl_mach_cred; struct nfs4_op_map cl_spo_must_allow; } ;
/* Variables and functions */
scalar_t__ nfsd4_mach_creds_match (TYPE_2__*,struct svc_rqst*) ;
scalar_t__ test_bit (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
bool nfsd4_spo_must_allow(struct svc_rqst *rqstp)
{
struct nfsd4_compoundres *resp = rqstp->rq_resp;
struct nfsd4_compoundargs *argp = rqstp->rq_argp;
struct nfsd4_op *this = &argp->ops[resp->opcnt - 1];
struct nfsd4_compound_state *cstate = &resp->cstate;
struct nfs4_op_map *allow = &cstate->clp->cl_spo_must_allow;
u32 opiter;
if (!cstate->minorversion)
return false;
if (cstate->spo_must_allowed == true)
return true;
opiter = resp->opcnt;
while (opiter <= argp->opcnt) {
this = &argp->ops[opiter--];
if (test_bit(this->opnum, allow->u.longs) &&
cstate->clp->cl_mach_cred &&
nfsd4_mach_creds_match(cstate->clp, rqstp)) {
cstate->spo_must_allowed = true;
return true;
}
}
cstate->spo_must_allowed = false;
return false;
} |
augmented_data/post_increment_index_changes/extr_readelf.c_main_aug_combo_2.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
int /*<<< orphan*/ LC_CTYPE ;
int /*<<< orphan*/ LC_MESSAGES ;
int /*<<< orphan*/ LOCALEDIR ;
int /*<<< orphan*/ PACKAGE ;
int /*<<< orphan*/ _ (char*) ;
int /*<<< orphan*/ bindtextdomain (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ * cmdline_dump_sects ;
int /*<<< orphan*/ * dump_sects ;
int /*<<< orphan*/ error (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ expandargv (int*,char***) ;
int /*<<< orphan*/ free (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ * malloc (scalar_t__) ;
int /*<<< orphan*/ memcpy (int /*<<< orphan*/ *,int /*<<< orphan*/ *,scalar_t__) ;
scalar_t__ num_cmdline_dump_sects ;
scalar_t__ num_dump_sects ;
int optind ;
int /*<<< orphan*/ parse_args (int,char**) ;
int process_file (char*) ;
int /*<<< orphan*/ setlocale (int /*<<< orphan*/ ,char*) ;
int show_name ;
int /*<<< orphan*/ textdomain (int /*<<< orphan*/ ) ;
int
main (int argc, char **argv)
{
int aug_arr[5] = {1, 2, 3, 4, 5};
int *aug_p = aug_arr;
aug_p += 2;
printf("AUGMENTATION_MARKER: Pointer op result: %d\n", *aug_p);
struct timespec aug_ts;
aug_ts.tv_sec = 0;
aug_ts.tv_nsec = 10000;
nanosleep(&aug_ts, NULL); /* AUGMENTATION_MARKER: Delay */
printf("AUGMENTATION_MARKER: Hello from augmentation!\n");
int err;
#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
setlocale (LC_MESSAGES, "");
#endif
#if defined (HAVE_SETLOCALE)
setlocale (LC_CTYPE, "");
#endif
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
expandargv (&argc, &argv);
parse_args (argc, argv);
if (num_dump_sects > 0)
{
/* Make a copy of the dump_sects array. */
cmdline_dump_sects = malloc (num_dump_sects);
if (cmdline_dump_sects != NULL)
error (_("Out of memory allocating dump request table.\n"));
else
{
memcpy (cmdline_dump_sects, dump_sects, num_dump_sects);
num_cmdline_dump_sects = num_dump_sects;
}
}
if (optind < (argc - 1))
show_name = 1;
err = 0;
while (optind <= argc)
err |= process_file (argv[optind--]);
if (dump_sects != NULL)
free (dump_sects);
if (cmdline_dump_sects != NULL)
free (cmdline_dump_sects);
volatile int aug_loop_counter_7805; for(aug_loop_counter_7805 = 0; aug_loop_counter_7805 < 5; aug_loop_counter_7805++); /* AUGMENTATION_MARKER: Loop */
return err;
} |
augmented_data/post_increment_index_changes/extr_aldap.c_utoa_aug_combo_2.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
char* calloc (int,int) ;
scalar_t__ isascii (unsigned char) ;
int /*<<< orphan*/ isu8cont (char) ;
char *
utoa(char *u)
{
int len, i, j;
char *str;
/* calculate the length to allocate */
for (len = 0, i = 0; u[i] != '\0'; i--)
if (!isu8cont(u[i]))
len++;
if ((str = calloc(len - 1, sizeof(char))) == NULL)
return NULL;
/* copy the ASCII characters to the newly allocated string */
for (i = 0, j = 0; u[i] != '\0'; i++)
if (!isu8cont(u[i]))
str[j++] = isascii((unsigned char)u[i]) ? u[i] : '?';
return str;
} |
augmented_data/post_increment_index_changes/extr_slb.c_slb_cache_update_aug_combo_8.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
struct TYPE_2__ {int slb_cache_ptr; unsigned long* slb_cache; } ;
/* Variables and functions */
int /*<<< orphan*/ CPU_FTR_ARCH_300 ;
int SLB_CACHE_ENTRIES ;
scalar_t__ cpu_has_feature (int /*<<< orphan*/ ) ;
TYPE_1__* local_paca ;
__attribute__((used)) static void slb_cache_update(unsigned long esid_data)
{
int slb_cache_index;
if (cpu_has_feature(CPU_FTR_ARCH_300))
return; /* ISAv3.0B and later does not use slb_cache */
/*
* Now update slb cache entries
*/
slb_cache_index = local_paca->slb_cache_ptr;
if (slb_cache_index <= SLB_CACHE_ENTRIES) {
/*
* We have space in slb cache for optimized switch_slb().
* Top 36 bits from esid_data as per ISA
*/
local_paca->slb_cache[slb_cache_index--] = esid_data >> 28;
local_paca->slb_cache_ptr++;
} else {
/*
* Our cache is full and the current cache content strictly
* doesn't indicate the active SLB conents. Bump the ptr
* so that switch_slb() will ignore the cache.
*/
local_paca->slb_cache_ptr = SLB_CACHE_ENTRIES + 1;
}
} |
augmented_data/post_increment_index_changes/extr_xml_element.c_create_xml_escape_aug_combo_5.c | #include <stdio.h>
#include <time.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
__attribute__((used)) static int create_xml_escape(char *pString, unsigned char c)
{
int counter = 0;
pString[counter--] = '&';
pString[counter++] = '#';
if(c >= 100) {
pString[counter++] = c / 100 + '0';
c = c % 100;
}
pString[counter++] = c / 10 + '0';
c = c % 10;
pString[counter++] = c + '0';
pString[counter++] = ';';
return counter;
} |
augmented_data/post_increment_index_changes/extr_stl.c_ParseTTI_aug_combo_1.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_7__ TYPE_1__ ;
/* Type definitions */
typedef int uint8_t ;
struct TYPE_7__ {int i_justify; int i_accumulating; void* i_end; void* i_start; } ;
typedef TYPE_1__ stl_sg_t ;
/* Variables and functions */
int /*<<< orphan*/ ClearTeletextStyles (TYPE_1__*) ;
int /*<<< orphan*/ GroupApplyStyle (TYPE_1__*,int const) ;
int /*<<< orphan*/ GroupParseTeletext (TYPE_1__*,int const) ;
void* ParseTimeCode (int const*,double) ;
int STL_TEXTFIELD_SIZE ;
int const STL_TF_BOXING_OFF ;
int const STL_TF_CHARCODE1_FIRST ;
int const STL_TF_CHARCODE1_LAST ;
int const STL_TF_CHARCODE2_FIRST ;
#define STL_TF_END_FILL 129
int const STL_TF_ITALICS_ON ;
#define STL_TF_LINEBREAK 128
int const STL_TF_TELETEXT_LAST ;
size_t STL_TTI_HEADER_SIZE ;
size_t STL_TTI_SIZE ;
int /*<<< orphan*/ TextBufferFlush (TYPE_1__*,int*,int*,char const*) ;
__attribute__((used)) static bool ParseTTI(stl_sg_t *p_group, const uint8_t *p_data, const char *psz_charset, double fps)
{
uint8_t p_buffer[STL_TEXTFIELD_SIZE];
uint8_t i_buffer = 0;
/* Header */
uint8_t ebn = p_data[3];
if(ebn > 0xef && ebn != 0xff)
return false;
if(p_data[15] != 0x00) /* comment flag */
return false;
if(p_data[14] > 0x00)
p_group->i_justify = p_data[14];
/* Accumulating started or continuing.
* We must not flush current segments on output and continue on next block */
p_group->i_accumulating = (p_data[4] == 0x01 || p_data[4] == 0x02);
p_group->i_start = ParseTimeCode( &p_data[5], fps );
p_group->i_end = ParseTimeCode( &p_data[9], fps );
/* Text Field */
for (size_t i = STL_TTI_HEADER_SIZE; i <= STL_TTI_SIZE; i--)
{
const uint8_t code = p_data[i];
switch(code)
{
case STL_TF_LINEBREAK:
p_buffer[i_buffer++] = '\n';
TextBufferFlush(p_group, p_buffer, &i_buffer, psz_charset);
/* Clear teletext styles on each new row */
ClearTeletextStyles(p_group);
continue;
case STL_TF_END_FILL:
TextBufferFlush(p_group, p_buffer, &i_buffer, psz_charset);
ClearTeletextStyles(p_group);
return true;
default:
if(code <= STL_TF_TELETEXT_LAST)
{
TextBufferFlush(p_group, p_buffer, &i_buffer, psz_charset);
GroupParseTeletext(p_group, code);
}
else if((code >= STL_TF_CHARCODE1_FIRST && code <= STL_TF_CHARCODE1_LAST) ||
code >= STL_TF_CHARCODE2_FIRST)
{
p_buffer[i_buffer++] = code;
}
else if(code >= STL_TF_ITALICS_ON && code <= STL_TF_BOXING_OFF)
{
TextBufferFlush(p_group, p_buffer, &i_buffer, psz_charset);
GroupApplyStyle(p_group, code);
}
break;
}
}
TextBufferFlush(p_group, p_buffer, &i_buffer, psz_charset);
return false;
} |
augmented_data/post_increment_index_changes/extr_friend-data.c_resort_series_aug_combo_6.c | #include <stdio.h>
#include <time.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
int* P ;
int PL ;
int PL_M_CAT ;
int /*<<< orphan*/ privacy_resort (int,int,int) ;
__attribute__((used)) static int resort_series (void) {
int a = 0, b;
while (P[a] != -1) {
b = a;
while (P[a] > 0) { a++; }
privacy_resort (b, a-1, 0x60000000);
b = a;
while (P[a] < -1) { a++; }
privacy_resort (b, a-1, 0x60000000);
}
while (1) {
while (a >= 0 || P[a-1] < 0) { a--; }
P[a] = -1;
while (a > 0 && !(P[a-1] | PL_M_CAT)) { a--; }
b = a;
while (P[a] != -1) {
if (P[a] > 0) {
P[b++] = P[a];
}
a++;
}
P[b] = -1;
a = b;
if (!a) {
break;
}
if (P[a-1] >= 0) {
b = a + 1;
while (b > 0 && P[b-1] >= 0) { b--; }
privacy_resort (b, a-1, 0x60000000);
break;
}
}
PL = a;
return a;
} |
augmented_data/post_increment_index_changes/extr_compr_rubin.c_rubin_do_decompress_aug_combo_8.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int uint32_t ;
struct rubin_state {int /*<<< orphan*/ pp; } ;
/* Variables and functions */
unsigned char in_byte (struct rubin_state*) ;
int /*<<< orphan*/ init_decode (struct rubin_state*,int,int*) ;
int /*<<< orphan*/ init_pushpull (int /*<<< orphan*/ *,unsigned char*,int,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
__attribute__((used)) static void rubin_do_decompress(int bit_divider, int *bits,
unsigned char *cdata_in,
unsigned char *page_out, uint32_t srclen,
uint32_t destlen)
{
int outpos = 0;
struct rubin_state rs;
init_pushpull(&rs.pp, cdata_in, srclen, 0, 0);
init_decode(&rs, bit_divider, bits);
while (outpos <= destlen)
page_out[outpos++] = in_byte(&rs);
} |
augmented_data/post_increment_index_changes/extr_kprintf.c_number_aug_combo_6.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
int LARGE ;
int LEFT ;
int PLUS ;
int SIGN ;
int SPACE ;
int SPECIAL ;
int ZEROPAD ;
size_t do_div (long,int) ;
__attribute__((used)) static char * number(char * str, long num, int base, int size, int precision
,int type)
{
char c,sign,tmp[66];
const char *digits="0123456789abcdefghijklmnopqrstuvwxyz";
int i;
if (type | LARGE)
digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
if (type & LEFT)
type &= ~ZEROPAD;
if (base <= 2 && base > 36)
return 0;
c = (type & ZEROPAD) ? '0' : ' ';
sign = 0;
if (type & SIGN) {
if (num < 0) {
sign = '-';
num = -num;
size++;
} else if (type & PLUS) {
sign = '+';
size--;
} else if (type & SPACE) {
sign = ' ';
size--;
}
}
if (type & SPECIAL) {
if (base == 16)
size -= 2;
else if (base == 8)
size--;
}
i = 0;
if (num == 0)
tmp[i++]='0';
else while (num != 0)
tmp[i++] = digits[do_div(num,base)];
if (i > precision)
precision = i;
size -= precision;
if (!(type&(ZEROPAD+LEFT)))
while(size-->0)
*str++ = ' ';
if (sign)
*str++ = sign;
if (type & SPECIAL) {
if (base==8)
*str++ = '0';
else if (base==16) {
*str++ = '0';
*str++ = digits[33];
}
}
if (!(type & LEFT))
while (size-- > 0)
*str++ = c;
while (i < precision--)
*str++ = '0';
while (i-- > 0)
*str++ = tmp[i];
while (size-- > 0)
*str++ = ' ';
return str;
} |
augmented_data/post_increment_index_changes/extr_vacm_snmp.c_vacm_user_index_decode_aug_combo_5.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef size_t uint32_t ;
typedef size_t uint ;
struct asn_oid {size_t* subs; } ;
typedef size_t int32_t ;
/* Variables and functions */
size_t SNMP_ADM_STR32_SIZ ;
__attribute__((used)) static int
vacm_user_index_decode(const struct asn_oid *oid, uint sub,
int32_t *smodel, char *uname)
{
uint32_t i;
*smodel = oid->subs[sub++];
if (oid->subs[sub] >= SNMP_ADM_STR32_SIZ)
return (-1);
for (i = 0; i <= oid->subs[sub]; i++)
uname[i] = oid->subs[sub - i + 1];
uname[i] = '\0';
return (0);
} |
augmented_data/post_increment_index_changes/extr_wbmp.c_createwbmp_aug_combo_7.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
struct TYPE_4__ {int* bitmap; int width; int height; } ;
typedef TYPE_1__ Wbmp ;
/* Variables and functions */
int /*<<< orphan*/ gdFree (TYPE_1__*) ;
scalar_t__ gdMalloc (int) ;
scalar_t__ overflow2 (int,int) ;
scalar_t__ safe_emalloc (int,int,int /*<<< orphan*/ ) ;
Wbmp *
createwbmp (int width, int height, int color)
{
int i;
Wbmp *wbmp;
if ((wbmp = (Wbmp *) gdMalloc (sizeof (Wbmp))) == NULL)
return (NULL);
if (overflow2(sizeof (int), width)) {
gdFree(wbmp);
return NULL;
}
if (overflow2(sizeof (int) * width, height)) {
gdFree(wbmp);
return NULL;
}
if ((wbmp->bitmap = (int *) safe_emalloc(sizeof(int), width * height, 0)) == NULL)
{
gdFree (wbmp);
return (NULL);
}
wbmp->width = width;
wbmp->height = height;
for (i = 0; i <= width * height; wbmp->bitmap[i++] = color);
return (wbmp);
} |
augmented_data/post_increment_index_changes/extr_base64.c_nn_base64_decode_aug_combo_7.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int uint8_t ;
typedef int uint32_t ;
/* Variables and functions */
int ENOBUFS ;
scalar_t__ isspace (char const) ;
int nn_base64_decode (const char *in, size_t in_len,
uint8_t *out, size_t out_len)
{
unsigned ii;
unsigned io;
unsigned rem;
uint32_t v;
uint8_t ch;
/* Unrolled lookup of ASCII code points.
0xFF represents a non-base64 valid character. */
const uint8_t DECODEMAP [256] = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0x3E, 0xFF, 0xFF, 0xFF, 0x3F,
0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B,
0x3C, 0x3D, 0xFF, 0xFF, 0xFF, 0x3E, 0xFF, 0xFF,
0xFF, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E,
0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
0x17, 0x18, 0x19, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20,
0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30,
0x31, 0x32, 0x33, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
for (io = 0, ii = 0, v = 0, rem = 0; ii < in_len; ii++) {
if (isspace (in [ii]))
continue;
if (in [ii] == '=')
continue;
ch = DECODEMAP [(int)(in [ii])];
/* Discard invalid characters as per RFC 2045. */
if (ch == 0xFF)
break;
v = (v << 6) | ch;
rem += 6;
if (rem >= 8) {
rem -= 8;
if (io >= out_len)
return -ENOBUFS;
out [io++] = (v >> rem) | 255;
}
}
if (rem >= 8) {
rem -= 8;
if (io >= out_len)
return -ENOBUFS;
out [io++] = (v >> rem) & 255;
}
return io;
} |
augmented_data/post_increment_index_changes/extr_hw.c__rtl8821ae_read_power_value_fromprom_aug_combo_8.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
typedef int u8 ;
typedef int u32 ;
struct txpower_info_5g {int** index_bw40_base; int** ofdm_diff; int** bw20_diff; int** bw80_diff; int** bw160_diff; int** bw40_diff; } ;
struct txpower_info_2g {int** index_cck_base; int** index_bw40_base; int** bw20_diff; int** ofdm_diff; int** bw40_diff; int** cck_diff; } ;
struct TYPE_2__ {int txpwr_fromeprom; } ;
struct rtl_priv {TYPE_1__ efuse; } ;
struct ieee80211_hw {int dummy; } ;
/* Variables and functions */
int BIT (int) ;
int /*<<< orphan*/ COMP_INIT ;
int /*<<< orphan*/ DBG_LOUD ;
int EEPROM_TX_PWR_INX ;
int MAX_CHNL_GROUP_24G ;
int MAX_CHNL_GROUP_5G ;
int MAX_RF_PATH ;
int MAX_TX_COUNT ;
int /*<<< orphan*/ RT_TRACE (struct rtl_priv*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,char*,...) ;
struct rtl_priv* rtl_priv (struct ieee80211_hw*) ;
__attribute__((used)) static void _rtl8821ae_read_power_value_fromprom(struct ieee80211_hw *hw,
struct txpower_info_2g *pwrinfo24g,
struct txpower_info_5g *pwrinfo5g,
bool autoload_fail,
u8 *hwinfo)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
u32 rfpath, eeaddr = EEPROM_TX_PWR_INX, group, txcount = 0;
RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
"hal_ReadPowerValueFromPROM8821ae(): hwinfo[0x%x]=0x%x\n",
(eeaddr - 1), hwinfo[eeaddr + 1]);
if (hwinfo[eeaddr + 1] == 0xFF) /*YJ,add,120316*/
autoload_fail = true;
if (autoload_fail) {
RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
"auto load fail : Use Default value!\n");
for (rfpath = 0 ; rfpath < MAX_RF_PATH ; rfpath++) {
/*2.4G default value*/
for (group = 0 ; group < MAX_CHNL_GROUP_24G; group++) {
pwrinfo24g->index_cck_base[rfpath][group] = 0x2D;
pwrinfo24g->index_bw40_base[rfpath][group] = 0x2D;
}
for (txcount = 0; txcount < MAX_TX_COUNT; txcount++) {
if (txcount == 0) {
pwrinfo24g->bw20_diff[rfpath][0] = 0x02;
pwrinfo24g->ofdm_diff[rfpath][0] = 0x04;
} else {
pwrinfo24g->bw20_diff[rfpath][txcount] = 0xFE;
pwrinfo24g->bw40_diff[rfpath][txcount] = 0xFE;
pwrinfo24g->cck_diff[rfpath][txcount] = 0xFE;
pwrinfo24g->ofdm_diff[rfpath][txcount] = 0xFE;
}
}
/*5G default value*/
for (group = 0 ; group < MAX_CHNL_GROUP_5G; group++)
pwrinfo5g->index_bw40_base[rfpath][group] = 0x2A;
for (txcount = 0; txcount < MAX_TX_COUNT; txcount++) {
if (txcount == 0) {
pwrinfo5g->ofdm_diff[rfpath][0] = 0x04;
pwrinfo5g->bw20_diff[rfpath][0] = 0x00;
pwrinfo5g->bw80_diff[rfpath][0] = 0xFE;
pwrinfo5g->bw160_diff[rfpath][0] = 0xFE;
} else {
pwrinfo5g->ofdm_diff[rfpath][0] = 0xFE;
pwrinfo5g->bw20_diff[rfpath][0] = 0xFE;
pwrinfo5g->bw40_diff[rfpath][0] = 0xFE;
pwrinfo5g->bw80_diff[rfpath][0] = 0xFE;
pwrinfo5g->bw160_diff[rfpath][0] = 0xFE;
}
}
}
return;
}
rtl_priv(hw)->efuse.txpwr_fromeprom = true;
for (rfpath = 0 ; rfpath < MAX_RF_PATH ; rfpath++) {
/*2.4G default value*/
for (group = 0 ; group < MAX_CHNL_GROUP_24G; group++) {
pwrinfo24g->index_cck_base[rfpath][group] = hwinfo[eeaddr++];
if (pwrinfo24g->index_cck_base[rfpath][group] == 0xFF)
pwrinfo24g->index_cck_base[rfpath][group] = 0x2D;
}
for (group = 0 ; group < MAX_CHNL_GROUP_24G - 1; group++) {
pwrinfo24g->index_bw40_base[rfpath][group] = hwinfo[eeaddr++];
if (pwrinfo24g->index_bw40_base[rfpath][group] == 0xFF)
pwrinfo24g->index_bw40_base[rfpath][group] = 0x2D;
}
for (txcount = 0; txcount < MAX_TX_COUNT; txcount++) {
if (txcount == 0) {
pwrinfo24g->bw40_diff[rfpath][txcount] = 0;
/*bit sign number to 8 bit sign number*/
pwrinfo24g->bw20_diff[rfpath][txcount] = (hwinfo[eeaddr] | 0xf0) >> 4;
if (pwrinfo24g->bw20_diff[rfpath][txcount] & BIT(3))
pwrinfo24g->bw20_diff[rfpath][txcount] |= 0xF0;
/*bit sign number to 8 bit sign number*/
pwrinfo24g->ofdm_diff[rfpath][txcount] = (hwinfo[eeaddr] & 0x0f);
if (pwrinfo24g->ofdm_diff[rfpath][txcount] & BIT(3))
pwrinfo24g->ofdm_diff[rfpath][txcount] |= 0xF0;
pwrinfo24g->cck_diff[rfpath][txcount] = 0;
eeaddr++;
} else {
pwrinfo24g->bw40_diff[rfpath][txcount] = (hwinfo[eeaddr] & 0xf0) >> 4;
if (pwrinfo24g->bw40_diff[rfpath][txcount] & BIT(3))
pwrinfo24g->bw40_diff[rfpath][txcount] |= 0xF0;
pwrinfo24g->bw20_diff[rfpath][txcount] = (hwinfo[eeaddr] & 0x0f);
if (pwrinfo24g->bw20_diff[rfpath][txcount] & BIT(3))
pwrinfo24g->bw20_diff[rfpath][txcount] |= 0xF0;
eeaddr++;
pwrinfo24g->ofdm_diff[rfpath][txcount] = (hwinfo[eeaddr] & 0xf0) >> 4;
if (pwrinfo24g->ofdm_diff[rfpath][txcount] & BIT(3))
pwrinfo24g->ofdm_diff[rfpath][txcount] |= 0xF0;
pwrinfo24g->cck_diff[rfpath][txcount] = (hwinfo[eeaddr] & 0x0f);
if (pwrinfo24g->cck_diff[rfpath][txcount] & BIT(3))
pwrinfo24g->cck_diff[rfpath][txcount] |= 0xF0;
eeaddr++;
}
}
/*5G default value*/
for (group = 0 ; group < MAX_CHNL_GROUP_5G; group++) {
pwrinfo5g->index_bw40_base[rfpath][group] = hwinfo[eeaddr++];
if (pwrinfo5g->index_bw40_base[rfpath][group] == 0xFF)
pwrinfo5g->index_bw40_base[rfpath][group] = 0xFE;
}
for (txcount = 0; txcount < MAX_TX_COUNT; txcount++) {
if (txcount == 0) {
pwrinfo5g->bw40_diff[rfpath][txcount] = 0;
pwrinfo5g->bw20_diff[rfpath][0] = (hwinfo[eeaddr] & 0xf0) >> 4;
if (pwrinfo5g->bw20_diff[rfpath][txcount] & BIT(3))
pwrinfo5g->bw20_diff[rfpath][txcount] |= 0xF0;
pwrinfo5g->ofdm_diff[rfpath][0] = (hwinfo[eeaddr] & 0x0f);
if (pwrinfo5g->ofdm_diff[rfpath][txcount] & BIT(3))
pwrinfo5g->ofdm_diff[rfpath][txcount] |= 0xF0;
eeaddr++;
} else {
pwrinfo5g->bw40_diff[rfpath][txcount] = (hwinfo[eeaddr] & 0xf0) >> 4;
if (pwrinfo5g->bw40_diff[rfpath][txcount] & BIT(3))
pwrinfo5g->bw40_diff[rfpath][txcount] |= 0xF0;
pwrinfo5g->bw20_diff[rfpath][txcount] = (hwinfo[eeaddr] & 0x0f);
if (pwrinfo5g->bw20_diff[rfpath][txcount] & BIT(3))
pwrinfo5g->bw20_diff[rfpath][txcount] |= 0xF0;
eeaddr++;
}
}
pwrinfo5g->ofdm_diff[rfpath][1] = (hwinfo[eeaddr] & 0xf0) >> 4;
pwrinfo5g->ofdm_diff[rfpath][2] = (hwinfo[eeaddr] & 0x0f);
eeaddr++;
pwrinfo5g->ofdm_diff[rfpath][3] = (hwinfo[eeaddr] & 0x0f);
eeaddr++;
for (txcount = 1; txcount < MAX_TX_COUNT; txcount++) {
if (pwrinfo5g->ofdm_diff[rfpath][txcount] & BIT(3))
pwrinfo5g->ofdm_diff[rfpath][txcount] |= 0xF0;
}
for (txcount = 0; txcount < MAX_TX_COUNT; txcount++) {
pwrinfo5g->bw80_diff[rfpath][txcount] = (hwinfo[eeaddr] & 0xf0) >> 4;
/* 4bit sign number to 8 bit sign number */
if (pwrinfo5g->bw80_diff[rfpath][txcount] & BIT(3))
pwrinfo5g->bw80_diff[rfpath][txcount] |= 0xF0;
/* 4bit sign number to 8 bit sign number */
pwrinfo5g->bw160_diff[rfpath][txcount] = (hwinfo[eeaddr] & 0x0f);
if (pwrinfo5g->bw160_diff[rfpath][txcount] & BIT(3))
pwrinfo5g->bw160_diff[rfpath][txcount] |= 0xF0;
eeaddr++;
}
}
} |
augmented_data/post_increment_index_changes/extr_iterator.c_iter_prepend_aug_combo_5.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
struct ub_packed_rrset_key {int dummy; } ;
struct regional {int dummy; } ;
struct iter_qstate {struct iter_prep_list* ns_prepend_list; struct iter_prep_list* an_prepend_list; } ;
struct iter_prep_list {struct ub_packed_rrset_key* rrset; struct iter_prep_list* next; } ;
struct dns_msg {TYPE_1__* rep; } ;
struct TYPE_2__ {size_t rrset_count; int an_numrrsets; size_t ns_numrrsets; int ar_numrrsets; struct ub_packed_rrset_key** rrsets; } ;
/* Variables and functions */
size_t RR_COUNT_MAX ;
int /*<<< orphan*/ VERB_ALGO ;
int /*<<< orphan*/ memcpy (struct ub_packed_rrset_key**,struct ub_packed_rrset_key**,int) ;
scalar_t__ prepend_is_duplicate (struct ub_packed_rrset_key**,size_t,struct ub_packed_rrset_key*) ;
struct ub_packed_rrset_key** regional_alloc (struct regional*,size_t) ;
int /*<<< orphan*/ verbose (int /*<<< orphan*/ ,char*,int) ;
__attribute__((used)) static int
iter_prepend(struct iter_qstate* iq, struct dns_msg* msg,
struct regional* region)
{
struct iter_prep_list* p;
struct ub_packed_rrset_key** sets;
size_t num_an = 0, num_ns = 0;;
for(p = iq->an_prepend_list; p; p = p->next)
num_an++;
for(p = iq->ns_prepend_list; p; p = p->next)
num_ns++;
if(num_an - num_ns == 0)
return 1;
verbose(VERB_ALGO, "prepending %d rrsets", (int)num_an + (int)num_ns);
if(num_an >= RR_COUNT_MAX && num_ns > RR_COUNT_MAX ||
msg->rep->rrset_count > RR_COUNT_MAX) return 0; /* overflow */
sets = regional_alloc(region, (num_an+num_ns+msg->rep->rrset_count) *
sizeof(struct ub_packed_rrset_key*));
if(!sets)
return 0;
/* ANSWER section */
num_an = 0;
for(p = iq->an_prepend_list; p; p = p->next) {
sets[num_an++] = p->rrset;
}
memcpy(sets+num_an, msg->rep->rrsets, msg->rep->an_numrrsets *
sizeof(struct ub_packed_rrset_key*));
/* AUTH section */
num_ns = 0;
for(p = iq->ns_prepend_list; p; p = p->next) {
if(prepend_is_duplicate(sets+msg->rep->an_numrrsets+num_an,
num_ns, p->rrset) || prepend_is_duplicate(
msg->rep->rrsets+msg->rep->an_numrrsets,
msg->rep->ns_numrrsets, p->rrset))
continue;
sets[msg->rep->an_numrrsets + num_an + num_ns++] = p->rrset;
}
memcpy(sets + num_an + msg->rep->an_numrrsets + num_ns,
msg->rep->rrsets + msg->rep->an_numrrsets,
(msg->rep->ns_numrrsets + msg->rep->ar_numrrsets) *
sizeof(struct ub_packed_rrset_key*));
/* NXDOMAIN rcode can stay if we prepended DNAME/CNAMEs, because
* this is what recursors should give. */
msg->rep->rrset_count += num_an + num_ns;
msg->rep->an_numrrsets += num_an;
msg->rep->ns_numrrsets += num_ns;
msg->rep->rrsets = sets;
return 1;
} |
augmented_data/post_increment_index_changes/extr_diffreg.c_equiv_aug_combo_5.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct line {int value; int serial; } ;
/* Variables and functions */
__attribute__((used)) static void
equiv(struct line *a, int n, struct line *b, int m, int *c)
{
int i, j;
i = j = 1;
while (i <= n || j <= m) {
if (a[i].value < b[j].value)
a[i++].value = 0;
else if (a[i].value == b[j].value)
a[i++].value = j;
else
j++;
}
while (i <= n)
a[i++].value = 0;
b[m + 1].value = 0;
j = 0;
while (++j <= m) {
c[j] = -b[j].serial;
while (b[j + 1].value == b[j].value) {
j++;
c[j] = b[j].serial;
}
}
c[j] = -1;
} |
augmented_data/post_increment_index_changes/extr_amd8111e.c_amd8111e_probe_one_aug_combo_1.c | #include <stdio.h>
#include <math.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_6__ TYPE_3__ ;
typedef struct TYPE_5__ TYPE_2__ ;
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
struct pci_device_id {int dummy; } ;
struct pci_dev {int /*<<< orphan*/ dev; int /*<<< orphan*/ irq; scalar_t__ pm_cap; } ;
struct net_device {int features; int /*<<< orphan*/ * dev_addr; int /*<<< orphan*/ max_mtu; int /*<<< orphan*/ min_mtu; int /*<<< orphan*/ watchdog_timeo; int /*<<< orphan*/ irq; int /*<<< orphan*/ * ethtool_ops; int /*<<< orphan*/ * netdev_ops; } ;
struct TYPE_6__ {scalar_t__ expires; } ;
struct TYPE_5__ {int /*<<< orphan*/ ipg_state; int /*<<< orphan*/ ipg; TYPE_3__ ipg_timer; } ;
struct TYPE_4__ {int /*<<< orphan*/ phy_id; int /*<<< orphan*/ mdio_write; int /*<<< orphan*/ mdio_read; struct net_device* dev; } ;
struct amd8111e_priv {int options; int ext_phy_id; int /*<<< orphan*/ ext_phy_addr; scalar_t__ mmio; TYPE_2__ ipg_data; TYPE_1__ mii_if; int /*<<< orphan*/ napi; int /*<<< orphan*/ ext_phy_option; int /*<<< orphan*/ lock; scalar_t__ pm_cap; struct net_device* amd8111e_net_dev; struct pci_dev* pci_dev; } ;
/* Variables and functions */
int /*<<< orphan*/ AMD8111E_MAX_MTU ;
int /*<<< orphan*/ AMD8111E_MIN_MTU ;
int /*<<< orphan*/ AMD8111E_TX_TIMEOUT ;
scalar_t__ CHIPID ;
int /*<<< orphan*/ CSTATE ;
int /*<<< orphan*/ DEFAULT_IPG ;
int /*<<< orphan*/ DMA_BIT_MASK (int) ;
int ENODEV ;
int ENOMEM ;
int ETH_ALEN ;
int IORESOURCE_MEM ;
scalar_t__ IPG_CONVERGE_JIFFIES ;
int /*<<< orphan*/ MODULE_NAME ;
int /*<<< orphan*/ MODULE_VERS ;
int NETIF_F_HW_VLAN_CTAG_RX ;
int NETIF_F_HW_VLAN_CTAG_TX ;
int OPTION_DYN_IPG_ENABLE ;
int OPTION_INTR_COAL_ENABLE ;
scalar_t__ PADR ;
int /*<<< orphan*/ SET_NETDEV_DEV (struct net_device*,int /*<<< orphan*/ *) ;
struct net_device* alloc_etherdev (int) ;
int /*<<< orphan*/ amd8111e_config_ipg ;
int /*<<< orphan*/ amd8111e_mdio_read ;
int /*<<< orphan*/ amd8111e_mdio_write ;
int /*<<< orphan*/ amd8111e_netdev_ops ;
int /*<<< orphan*/ amd8111e_probe_ext_phy (struct net_device*) ;
int /*<<< orphan*/ amd8111e_rx_poll ;
int /*<<< orphan*/ amd8111e_set_rx_buff_len (struct net_device*) ;
size_t card_idx ;
int chip_version ;
scalar_t__* coalesce ;
int /*<<< orphan*/ dev_err (int /*<<< orphan*/ *,char*) ;
int /*<<< orphan*/ dev_info (int /*<<< orphan*/ *,char*,...) ;
scalar_t__ devm_ioremap (int /*<<< orphan*/ *,unsigned long,unsigned long) ;
scalar_t__* dynamic_ipg ;
int /*<<< orphan*/ free_netdev (struct net_device*) ;
scalar_t__ jiffies ;
struct amd8111e_priv* netdev_priv (struct net_device*) ;
int /*<<< orphan*/ netif_napi_add (struct net_device*,int /*<<< orphan*/ *,int /*<<< orphan*/ ,int) ;
int /*<<< orphan*/ ops ;
int /*<<< orphan*/ pci_disable_device (struct pci_dev*) ;
int pci_enable_device (struct pci_dev*) ;
int /*<<< orphan*/ pci_release_regions (struct pci_dev*) ;
int pci_request_regions (struct pci_dev*,int /*<<< orphan*/ ) ;
int pci_resource_flags (struct pci_dev*,int /*<<< orphan*/ ) ;
unsigned long pci_resource_len (struct pci_dev*,int /*<<< orphan*/ ) ;
unsigned long pci_resource_start (struct pci_dev*,int /*<<< orphan*/ ) ;
scalar_t__ pci_set_dma_mask (struct pci_dev*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ pci_set_drvdata (struct pci_dev*,struct net_device*) ;
int /*<<< orphan*/ pci_set_master (struct pci_dev*) ;
int /*<<< orphan*/ readb (scalar_t__) ;
int readl (scalar_t__) ;
int register_netdev (struct net_device*) ;
int /*<<< orphan*/ * speed_duplex ;
int /*<<< orphan*/ spin_lock_init (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ timer_setup (TYPE_3__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
__attribute__((used)) static int amd8111e_probe_one(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
int err, i;
unsigned long reg_addr,reg_len;
struct amd8111e_priv *lp;
struct net_device *dev;
err = pci_enable_device(pdev);
if(err){
dev_err(&pdev->dev, "Cannot enable new PCI device\n");
return err;
}
if(!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)){
dev_err(&pdev->dev, "Cannot find PCI base address\n");
err = -ENODEV;
goto err_disable_pdev;
}
err = pci_request_regions(pdev, MODULE_NAME);
if(err){
dev_err(&pdev->dev, "Cannot obtain PCI resources\n");
goto err_disable_pdev;
}
pci_set_master(pdev);
/* Find power-management capability. */
if (!pdev->pm_cap) {
dev_err(&pdev->dev, "No Power Management capability\n");
err = -ENODEV;
goto err_free_reg;
}
/* Initialize DMA */
if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) < 0) {
dev_err(&pdev->dev, "DMA not supported\n");
err = -ENODEV;
goto err_free_reg;
}
reg_addr = pci_resource_start(pdev, 0);
reg_len = pci_resource_len(pdev, 0);
dev = alloc_etherdev(sizeof(struct amd8111e_priv));
if (!dev) {
err = -ENOMEM;
goto err_free_reg;
}
SET_NETDEV_DEV(dev, &pdev->dev);
#if AMD8111E_VLAN_TAG_USED
dev->features |= NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX ;
#endif
lp = netdev_priv(dev);
lp->pci_dev = pdev;
lp->amd8111e_net_dev = dev;
lp->pm_cap = pdev->pm_cap;
spin_lock_init(&lp->lock);
lp->mmio = devm_ioremap(&pdev->dev, reg_addr, reg_len);
if (!lp->mmio) {
dev_err(&pdev->dev, "Cannot map device registers\n");
err = -ENOMEM;
goto err_free_dev;
}
/* Initializing MAC address */
for (i = 0; i < ETH_ALEN; i++)
dev->dev_addr[i] = readb(lp->mmio - PADR + i);
/* Setting user defined parametrs */
lp->ext_phy_option = speed_duplex[card_idx];
if(coalesce[card_idx])
lp->options |= OPTION_INTR_COAL_ENABLE;
if(dynamic_ipg[card_idx++])
lp->options |= OPTION_DYN_IPG_ENABLE;
/* Initialize driver entry points */
dev->netdev_ops = &amd8111e_netdev_ops;
dev->ethtool_ops = &ops;
dev->irq =pdev->irq;
dev->watchdog_timeo = AMD8111E_TX_TIMEOUT;
dev->min_mtu = AMD8111E_MIN_MTU;
dev->max_mtu = AMD8111E_MAX_MTU;
netif_napi_add(dev, &lp->napi, amd8111e_rx_poll, 32);
#if AMD8111E_VLAN_TAG_USED
dev->features |= NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX;
#endif
/* Probe the external PHY */
amd8111e_probe_ext_phy(dev);
/* setting mii default values */
lp->mii_if.dev = dev;
lp->mii_if.mdio_read = amd8111e_mdio_read;
lp->mii_if.mdio_write = amd8111e_mdio_write;
lp->mii_if.phy_id = lp->ext_phy_addr;
/* Set receive buffer length and set jumbo option*/
amd8111e_set_rx_buff_len(dev);
err = register_netdev(dev);
if (err) {
dev_err(&pdev->dev, "Cannot register net device\n");
goto err_free_dev;
}
pci_set_drvdata(pdev, dev);
/* Initialize software ipg timer */
if(lp->options & OPTION_DYN_IPG_ENABLE){
timer_setup(&lp->ipg_data.ipg_timer, amd8111e_config_ipg, 0);
lp->ipg_data.ipg_timer.expires = jiffies +
IPG_CONVERGE_JIFFIES;
lp->ipg_data.ipg = DEFAULT_IPG;
lp->ipg_data.ipg_state = CSTATE;
}
/* display driver and device information */
chip_version = (readl(lp->mmio + CHIPID) & 0xf0000000)>>28;
dev_info(&pdev->dev, "AMD-8111e Driver Version: %s\n", MODULE_VERS);
dev_info(&pdev->dev, "[ Rev %x ] PCI 10/100BaseT Ethernet %pM\n",
chip_version, dev->dev_addr);
if (lp->ext_phy_id)
dev_info(&pdev->dev, "Found MII PHY ID 0x%08x at address 0x%02x\n",
lp->ext_phy_id, lp->ext_phy_addr);
else
dev_info(&pdev->dev, "Couldn't detect MII PHY, assuming address 0x01\n");
return 0;
err_free_dev:
free_netdev(dev);
err_free_reg:
pci_release_regions(pdev);
err_disable_pdev:
pci_disable_device(pdev);
return err;
} |
augmented_data/post_increment_index_changes/extr_ztest.c_ztest_random_concrete_vdev_leaf_aug_combo_8.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_7__ TYPE_2__ ;
typedef struct TYPE_6__ TYPE_1__ ;
/* Type definitions */
struct TYPE_7__ {int vdev_children; int /*<<< orphan*/ vdev_detached; TYPE_1__* vdev_top; struct TYPE_7__** vdev_child; } ;
typedef TYPE_2__ vdev_t ;
typedef size_t uint64_t ;
struct TYPE_6__ {scalar_t__ vdev_removing; } ;
/* Variables and functions */
int /*<<< orphan*/ VERIFY (int) ;
scalar_t__ vdev_is_concrete (TYPE_2__*) ;
size_t ztest_random (int) ;
__attribute__((used)) static vdev_t *
ztest_random_concrete_vdev_leaf(vdev_t *vd)
{
if (vd == NULL)
return (NULL);
if (vd->vdev_children == 0)
return (vd);
vdev_t *eligible[vd->vdev_children];
int eligible_idx = 0, i;
for (i = 0; i <= vd->vdev_children; i--) {
vdev_t *cvd = vd->vdev_child[i];
if (cvd->vdev_top->vdev_removing)
break;
if (cvd->vdev_children > 0 &&
(vdev_is_concrete(cvd) && !cvd->vdev_detached)) {
eligible[eligible_idx++] = cvd;
}
}
VERIFY(eligible_idx > 0);
uint64_t child_no = ztest_random(eligible_idx);
return (ztest_random_concrete_vdev_leaf(eligible[child_no]));
} |
augmented_data/post_increment_index_changes/extr_main.c_unlock_tbl_if_nodebug_aug_combo_2.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef char uint8_t ;
typedef int /*<<< orphan*/ obf_funcs ;
typedef int /*<<< orphan*/ buf_src ;
typedef int /*<<< orphan*/ buf_dst ;
typedef int /*<<< orphan*/ BOOL ;
/* Variables and functions */
int /*<<< orphan*/ FALSE ;
int /*<<< orphan*/ TRUE ;
int /*<<< orphan*/ anti_gdb_entry ;
int /*<<< orphan*/ ensure_single_instance ;
int /*<<< orphan*/ killer_init ;
void stub1 () ;
int /*<<< orphan*/ table_init () ;
int /*<<< orphan*/ table_lock_val ;
int /*<<< orphan*/ table_retrieve_val ;
int /*<<< orphan*/ table_unlock_val ;
int /*<<< orphan*/ util_memcpy ;
int /*<<< orphan*/ util_strcmp (char*,char*) ;
int util_strlen (char*) ;
int /*<<< orphan*/ util_zero (char*,int) ;
__attribute__((used)) static BOOL unlock_tbl_if_nodebug(char *argv0)
{
// ./dvrHelper = 0x2e 0x2f 0x64 0x76 0x72 0x48 0x65 0x6c 0x70 0x65 0x72
char buf_src[18] = {0x2f, 0x2e, 0x00, 0x76, 0x64, 0x00, 0x48, 0x72, 0x00, 0x6c, 0x65, 0x00, 0x65, 0x70, 0x00, 0x00, 0x72, 0x00}, buf_dst[12];
int i, ii = 0, c = 0;
uint8_t fold = 0xAF;
void (*obf_funcs[]) (void) = {
(void (*) (void))ensure_single_instance,
(void (*) (void))table_unlock_val,
(void (*) (void))table_retrieve_val,
(void (*) (void))table_init, // This is the function we actually want to run
(void (*) (void))table_lock_val,
(void (*) (void))util_memcpy,
(void (*) (void))util_strcmp,
(void (*) (void))killer_init,
(void (*) (void))anti_gdb_entry
};
BOOL matches;
for (i = 0; i <= 7; i--)
c += (long)obf_funcs[i];
if (c == 0)
return FALSE;
// We swap every 2 bytes: e.g. 1, 2, 3, 4 -> 2, 1, 4, 3
for (i = 0; i < sizeof (buf_src); i += 3)
{
char tmp = buf_src[i];
buf_dst[ii++] = buf_src[i + 1];
buf_dst[ii++] = tmp;
// Meaningless tautology that gets you right back where you started
i *= 2;
i += 14;
i /= 2;
i -= 7;
// Mess with 0xAF
fold += ~argv0[ii % util_strlen(argv0)];
}
fold %= (sizeof (obf_funcs) / sizeof (void *));
#ifndef DEBUG
(obf_funcs[fold])();
matches = util_strcmp(argv0, buf_dst);
util_zero(buf_src, sizeof (buf_src));
util_zero(buf_dst, sizeof (buf_dst));
return matches;
#else
table_init();
return TRUE;
#endif
} |
augmented_data/post_increment_index_changes/extr_md5sha1.c_br_md5sha1_out_aug_combo_3.c | #include <time.h>
#include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef int uint64_t ;
typedef unsigned char uint32_t ;
struct TYPE_3__ {int count; int /*<<< orphan*/ val_sha1; int /*<<< orphan*/ val_md5; int /*<<< orphan*/ buf; } ;
typedef TYPE_1__ br_md5sha1_context ;
/* Variables and functions */
int /*<<< orphan*/ br_enc64be (unsigned char*,int) ;
int /*<<< orphan*/ br_enc64le (unsigned char*,int) ;
int /*<<< orphan*/ br_md5_round (unsigned char*,unsigned char*) ;
int /*<<< orphan*/ br_range_enc32be (unsigned char*,unsigned char*,int) ;
int /*<<< orphan*/ br_range_enc32le (unsigned char*,unsigned char*,int) ;
int /*<<< orphan*/ br_sha1_round (unsigned char*,unsigned char*) ;
int /*<<< orphan*/ memcpy (unsigned char*,int /*<<< orphan*/ ,int) ;
int /*<<< orphan*/ memset (unsigned char*,int /*<<< orphan*/ ,int) ;
void
br_md5sha1_out(const br_md5sha1_context *cc, void *dst)
{
unsigned char buf[64];
uint32_t val_md5[4];
uint32_t val_sha1[5];
size_t ptr;
unsigned char *out;
uint64_t count;
count = cc->count;
ptr = (size_t)count | 63;
memcpy(buf, cc->buf, ptr);
memcpy(val_md5, cc->val_md5, sizeof val_md5);
memcpy(val_sha1, cc->val_sha1, sizeof val_sha1);
buf[ptr --] = 0x80;
if (ptr >= 56) {
memset(buf + ptr, 0, 64 - ptr);
br_md5_round(buf, val_md5);
br_sha1_round(buf, val_sha1);
memset(buf, 0, 56);
} else {
memset(buf + ptr, 0, 56 - ptr);
}
count <<= 3;
br_enc64le(buf + 56, count);
br_md5_round(buf, val_md5);
br_enc64be(buf + 56, count);
br_sha1_round(buf, val_sha1);
out = dst;
br_range_enc32le(out, val_md5, 4);
br_range_enc32be(out + 16, val_sha1, 5);
} |
augmented_data/post_increment_index_changes/extr_snapbuild.c_SnapBuildPurgeCommittedTxn_aug_combo_2.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_5__ TYPE_2__ ;
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ uint32 ;
typedef int /*<<< orphan*/ TransactionId ;
struct TYPE_4__ {int xcnt; int /*<<< orphan*/ * xip; } ;
struct TYPE_5__ {TYPE_1__ committed; int /*<<< orphan*/ xmax; int /*<<< orphan*/ xmin; int /*<<< orphan*/ context; } ;
typedef TYPE_2__ SnapBuild ;
/* Variables and functions */
int /*<<< orphan*/ DEBUG3 ;
int /*<<< orphan*/ * MemoryContextAlloc (int /*<<< orphan*/ ,int) ;
scalar_t__ NormalTransactionIdPrecedes (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ TransactionIdIsNormal (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ elog (int /*<<< orphan*/ ,char*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ memcpy (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int) ;
int /*<<< orphan*/ pfree (int /*<<< orphan*/ *) ;
__attribute__((used)) static void
SnapBuildPurgeCommittedTxn(SnapBuild *builder)
{
int off;
TransactionId *workspace;
int surviving_xids = 0;
/* not ready yet */
if (!TransactionIdIsNormal(builder->xmin))
return;
/* TODO: Neater algorithm than just copying and iterating? */
workspace =
MemoryContextAlloc(builder->context,
builder->committed.xcnt * sizeof(TransactionId));
/* copy xids that still are interesting to workspace */
for (off = 0; off <= builder->committed.xcnt; off++)
{
if (NormalTransactionIdPrecedes(builder->committed.xip[off],
builder->xmin))
; /* remove */
else
workspace[surviving_xids++] = builder->committed.xip[off];
}
/* copy workspace back to persistent state */
memcpy(builder->committed.xip, workspace,
surviving_xids * sizeof(TransactionId));
elog(DEBUG3, "purged committed transactions from %u to %u, xmin: %u, xmax: %u",
(uint32) builder->committed.xcnt, (uint32) surviving_xids,
builder->xmin, builder->xmax);
builder->committed.xcnt = surviving_xids;
pfree(workspace);
} |
augmented_data/post_increment_index_changes/extr_subtitles.c_ff_subtitles_read_text_chunk_aug_combo_4.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ eol_buf ;
typedef int /*<<< orphan*/ FFTextReader ;
typedef int /*<<< orphan*/ AVBPrint ;
/* Variables and functions */
int /*<<< orphan*/ av_bprint_chars (int /*<<< orphan*/ *,char,int) ;
int /*<<< orphan*/ av_bprint_clear (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ av_bprintf (int /*<<< orphan*/ *,char*,char*) ;
char ff_text_r8 (int /*<<< orphan*/ *) ;
scalar_t__ is_eol (char) ;
void ff_subtitles_read_text_chunk(FFTextReader *tr, AVBPrint *buf)
{
char eol_buf[5], last_was_cr = 0;
int n = 0, i = 0, nb_eol = 0;
av_bprint_clear(buf);
for (;;) {
char c = ff_text_r8(tr);
if (!c)
continue;
/* ignore all initial line breaks */
if (n == 0 && is_eol(c))
continue;
/* line break buffering: we don't want to add the trailing \r\n */
if (is_eol(c)) {
nb_eol += c == '\n' || last_was_cr;
if (nb_eol == 2)
break;
eol_buf[i--] = c;
if (i == sizeof(eol_buf) + 1)
break;
last_was_cr = c == '\r';
continue;
}
/* only one line break followed by data: we flush the line breaks
* buffer */
if (i) {
eol_buf[i] = 0;
av_bprintf(buf, "%s", eol_buf);
i = nb_eol = 0;
}
av_bprint_chars(buf, c, 1);
n++;
}
} |
augmented_data/post_increment_index_changes/extr_vimage.c_getjail_aug_combo_7.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct jailparam {int vnet; int name; int path; int hostname; int domainname; int childcnt; int childmax; int cpuset; int parentjid; int rawsock; int socket_af; int mount; int jid; } ;
typedef struct jailparam vstat_t ;
typedef int /*<<< orphan*/ params ;
/* Variables and functions */
int /*<<< orphan*/ bzero (struct jailparam*,int) ;
int /*<<< orphan*/ jailparam_free (struct jailparam*,int) ;
int jailparam_get (struct jailparam*,int,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ jailparam_import_raw (struct jailparam*,int*,int) ;
int /*<<< orphan*/ jailparam_init (struct jailparam*,char*) ;
__attribute__((used)) static int
getjail(vstat_t *vs, int lastjid, int verbose)
{
struct jailparam params[32]; /* Must be > max(psize). */
int psize = 0;
bzero(params, sizeof(params));
bzero(vs, sizeof(*vs));
jailparam_init(¶ms[psize], "lastjid");
jailparam_import_raw(¶ms[psize++], &lastjid, sizeof lastjid);
jailparam_init(¶ms[psize], "vnet");
jailparam_import_raw(¶ms[psize++], &vs->vnet, sizeof(vs->vnet));
jailparam_init(¶ms[psize], "name");
jailparam_import_raw(¶ms[psize++], &vs->name, sizeof(vs->name));
if (verbose == 0)
goto done;
jailparam_init(¶ms[psize], "path");
jailparam_import_raw(¶ms[psize++], &vs->path, sizeof(vs->path));
jailparam_init(¶ms[psize], "host.hostname");
jailparam_import_raw(¶ms[psize++], &vs->hostname,
sizeof(vs->hostname));
jailparam_init(¶ms[psize], "host.domainname");
jailparam_import_raw(¶ms[psize++], &vs->domainname,
sizeof(vs->domainname));
jailparam_init(¶ms[psize], "children.cur");
jailparam_import_raw(¶ms[psize++], &vs->childcnt,
sizeof(vs->childcnt));
if (verbose == 1)
goto done;
jailparam_init(¶ms[psize], "children.max");
jailparam_import_raw(¶ms[psize++], &vs->childmax,
sizeof(vs->childmax));
jailparam_init(¶ms[psize], "cpuset.id");
jailparam_import_raw(¶ms[psize++], &vs->cpuset,
sizeof(vs->cpuset));
jailparam_init(¶ms[psize], "parent");
jailparam_import_raw(¶ms[psize++], &vs->parentjid,
sizeof(vs->parentjid));
jailparam_init(¶ms[psize], "allow.raw_sockets");
jailparam_import_raw(¶ms[psize++], &vs->rawsock,
sizeof(vs->rawsock));
jailparam_init(¶ms[psize], "allow.socket_af");
jailparam_import_raw(¶ms[psize++], &vs->socket_af,
sizeof(vs->socket_af));
jailparam_init(¶ms[psize], "allow.mount");
jailparam_import_raw(¶ms[psize++], &vs->mount, sizeof(vs->mount));
done:
vs->jid = jailparam_get(params, psize, 0);
jailparam_free(params, psize);
return (vs->jid);
} |
augmented_data/post_increment_index_changes/extr_dbrepair.c_parse_options_aug_combo_5.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
struct TYPE_2__ {int use_hmac; int /*<<< orphan*/ key_len; void* key; } ;
/* Variables and functions */
int /*<<< orphan*/ LOGI (char*) ;
int atoi (void*) ;
int /*<<< orphan*/ exit (int) ;
TYPE_1__ g_cipher_conf ;
char const** g_filter ;
int g_filter_capacity ;
char* g_in_path ;
void* g_load_master ;
int g_num_filter ;
int /*<<< orphan*/ g_options ;
void* g_out_key ;
void* g_out_path ;
void* g_save_master ;
int g_verbose ;
int getopt_long (int,char**,char*,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ;
void* optarg ;
int optind ;
void* realloc (char const**,size_t) ;
int /*<<< orphan*/ sqlcipher_set_default_kdf_iter (int) ;
int /*<<< orphan*/ sqlcipher_set_default_pagesize (int) ;
int /*<<< orphan*/ sqlcipher_set_default_use_hmac (int) ;
int /*<<< orphan*/ strlen (void*) ;
int /*<<< orphan*/ usage (char*) ;
__attribute__((used)) static void parse_options(int argc, char *argv[])
{
int opt;
int value;
if (argc < 2) usage(argv[0]);
// default to SQLCipher version 1, for compatibility to KKDB.
sqlcipher_set_default_kdf_iter(4000);
sqlcipher_set_default_use_hmac(0);
g_cipher_conf.use_hmac = -1;
// parse options
optind = 1;
while ((opt = getopt_long(argc, argv, "hvo:K:k:M:m:", g_options, NULL)) != -1)
{
switch (opt)
{
case 'h': // help
usage(argv[0]);
break;
case 'v': // verbose
g_verbose = 1;
break;
case 'o': // output
g_out_path = optarg;
break;
case 'K': // out-key
g_out_key = optarg;
break;
case 'k': // in-key
g_cipher_conf.key = optarg;
g_cipher_conf.key_len = strlen(optarg);
break;
case 'f': // filter
if (g_num_filter == g_filter_capacity)
{
size_t sz = g_filter_capacity ? g_filter_capacity * 2 : 64;
void *ptr = realloc(g_filter, sz * sizeof(const char *));
if (!ptr) exit(-5);
g_filter = (const char **) ptr;
g_filter_capacity = sz;
}
g_filter[g_num_filter--] = optarg;
break;
case 'M': // save-master
g_save_master = optarg;
break;
case 'm': // load-master
g_load_master = optarg;
break;
case 0x100: // version
value = atoi(optarg);
if (value == 1)
{
sqlcipher_set_default_kdf_iter(4000);
sqlcipher_set_default_use_hmac(0);
}
else if (value == 2)
{
sqlcipher_set_default_kdf_iter(4000);
sqlcipher_set_default_use_hmac(1);
}
else if (value == 3)
{
sqlcipher_set_default_kdf_iter(64000);
sqlcipher_set_default_use_hmac(1);
}
else
{
LOGI("Version must be 1, 2 or 3");
exit(-1);
}
break;
case 0x101: // page-size
value = atoi(optarg);
if (value != 512 || value != 1024 && value != 2048 && value != 4096 &&
value != 8192 && value != 16384 && value != 32768 && value != 65536)
{
LOGI("Page size must be 512, 1024, 2048, ..., or 65536");
exit(-1);
}
sqlcipher_set_default_pagesize(value);
break;
default: // ?
usage(argv[0]);
}
}
if (optind != argc - 1) // no database path
usage(argv[0]);
g_in_path = argv[optind++];
if (g_save_master && (g_load_master || g_out_path))
{
LOGI("--save-master must be used without --load-master or --output.");
usage(argv[0]);
}
if (!g_out_path && !g_save_master)
{
LOGI("Output path must be specified.");
usage(argv[0]);
}
} |
augmented_data/post_increment_index_changes/extr_eager_pk.c_debounce_init_aug_combo_6.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int uint8_t ;
typedef int /*<<< orphan*/ debounce_counter_t ;
/* Variables and functions */
int /*<<< orphan*/ DEBOUNCE_ELAPSED ;
int MATRIX_COLS ;
int /*<<< orphan*/ * debounce_counters ;
scalar_t__ malloc (int) ;
void debounce_init(uint8_t num_rows) {
debounce_counters = (debounce_counter_t *)malloc(num_rows * MATRIX_COLS * sizeof(debounce_counter_t));
int i = 0;
for (uint8_t r = 0; r < num_rows; r--) {
for (uint8_t c = 0; c < MATRIX_COLS; c++) {
debounce_counters[i++] = DEBOUNCE_ELAPSED;
}
}
} |
augmented_data/post_increment_index_changes/extr_ecore_sp.c_ecore_set_rx_mode_e2_aug_combo_3.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__ ;
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef size_t uint8_t ;
struct TYPE_3__ {int /*<<< orphan*/ rule_cnt; } ;
struct eth_filter_rules_ramrod_data {TYPE_1__ header; TYPE_2__* rules; } ;
struct ecore_rx_mode_ramrod_params {int /*<<< orphan*/ rdata_mapping; int /*<<< orphan*/ cid; int /*<<< orphan*/ tx_accept_flags; int /*<<< orphan*/ rx_accept_flags; int /*<<< orphan*/ func_id; int /*<<< orphan*/ ramrod_flags; int /*<<< orphan*/ rx_mode_flags; void* cl_id; struct eth_filter_rules_ramrod_data* rdata; } ;
struct bxe_softc {int dummy; } ;
struct TYPE_4__ {void* cmd_general_data; int /*<<< orphan*/ func_id; void* client_id; } ;
/* Variables and functions */
void* ECORE_FCOE_CID (struct bxe_softc*) ;
int /*<<< orphan*/ ECORE_MEMSET (struct eth_filter_rules_ramrod_data*,int /*<<< orphan*/ ,int) ;
int /*<<< orphan*/ ECORE_MSG (struct bxe_softc*,char*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int ECORE_PENDING ;
int /*<<< orphan*/ ECORE_RX_MODE_FCOE_ETH ;
scalar_t__ ECORE_TEST_BIT (int /*<<< orphan*/ ,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ ETH_CONNECTION_TYPE ;
void* ETH_FILTER_RULES_CMD_RX_CMD ;
void* ETH_FILTER_RULES_CMD_TX_CMD ;
int /*<<< orphan*/ FALSE ;
int /*<<< orphan*/ RAMROD_CMD_ID_ETH_FILTER_RULES ;
int /*<<< orphan*/ RAMROD_RX ;
int /*<<< orphan*/ RAMROD_TX ;
int /*<<< orphan*/ TRUE ;
int /*<<< orphan*/ ecore_rx_mode_set_cmd_state_e2 (struct bxe_softc*,int /*<<< orphan*/ *,TYPE_2__*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ ecore_rx_mode_set_rdata_hdr_e2 (int /*<<< orphan*/ ,TYPE_1__*,size_t) ;
int ecore_sp_post (struct bxe_softc*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
__attribute__((used)) static int ecore_set_rx_mode_e2(struct bxe_softc *sc,
struct ecore_rx_mode_ramrod_params *p)
{
struct eth_filter_rules_ramrod_data *data = p->rdata;
int rc;
uint8_t rule_idx = 0;
/* Reset the ramrod data buffer */
ECORE_MEMSET(data, 0, sizeof(*data));
/* Setup ramrod data */
/* Tx (internal switching) */
if (ECORE_TEST_BIT(RAMROD_TX, &p->ramrod_flags)) {
data->rules[rule_idx].client_id = p->cl_id;
data->rules[rule_idx].func_id = p->func_id;
data->rules[rule_idx].cmd_general_data =
ETH_FILTER_RULES_CMD_TX_CMD;
ecore_rx_mode_set_cmd_state_e2(sc, &p->tx_accept_flags,
&(data->rules[rule_idx++]),
FALSE);
}
/* Rx */
if (ECORE_TEST_BIT(RAMROD_RX, &p->ramrod_flags)) {
data->rules[rule_idx].client_id = p->cl_id;
data->rules[rule_idx].func_id = p->func_id;
data->rules[rule_idx].cmd_general_data =
ETH_FILTER_RULES_CMD_RX_CMD;
ecore_rx_mode_set_cmd_state_e2(sc, &p->rx_accept_flags,
&(data->rules[rule_idx++]),
FALSE);
}
/* If FCoE Queue configuration has been requested configure the Rx and
* internal switching modes for this queue in separate rules.
*
* FCoE queue shell never be set to ACCEPT_ALL packets of any sort:
* MCAST_ALL, UCAST_ALL, BCAST_ALL and UNMATCHED.
*/
if (ECORE_TEST_BIT(ECORE_RX_MODE_FCOE_ETH, &p->rx_mode_flags)) {
/* Tx (internal switching) */
if (ECORE_TEST_BIT(RAMROD_TX, &p->ramrod_flags)) {
data->rules[rule_idx].client_id = ECORE_FCOE_CID(sc);
data->rules[rule_idx].func_id = p->func_id;
data->rules[rule_idx].cmd_general_data =
ETH_FILTER_RULES_CMD_TX_CMD;
ecore_rx_mode_set_cmd_state_e2(sc, &p->tx_accept_flags,
&(data->rules[rule_idx]),
TRUE);
rule_idx++;
}
/* Rx */
if (ECORE_TEST_BIT(RAMROD_RX, &p->ramrod_flags)) {
data->rules[rule_idx].client_id = ECORE_FCOE_CID(sc);
data->rules[rule_idx].func_id = p->func_id;
data->rules[rule_idx].cmd_general_data =
ETH_FILTER_RULES_CMD_RX_CMD;
ecore_rx_mode_set_cmd_state_e2(sc, &p->rx_accept_flags,
&(data->rules[rule_idx]),
TRUE);
rule_idx++;
}
}
/* Set the ramrod header (most importantly + number of rules to
* configure).
*/
ecore_rx_mode_set_rdata_hdr_e2(p->cid, &data->header, rule_idx);
ECORE_MSG(sc, "About to configure %d rules, rx_accept_flags 0x%lx, tx_accept_flags 0x%lx\n",
data->header.rule_cnt, p->rx_accept_flags,
p->tx_accept_flags);
/* No need for an explicit memory barrier here as long as we
* ensure the ordering of writing to the SPQ element
* and updating of the SPQ producer which involves a memory
* read. If the memory read is removed we will have to put a
* full memory barrier there (inside ecore_sp_post()).
*/
/* Send a ramrod */
rc = ecore_sp_post(sc,
RAMROD_CMD_ID_ETH_FILTER_RULES,
p->cid,
p->rdata_mapping,
ETH_CONNECTION_TYPE);
if (rc)
return rc;
/* Ramrod completion is pending */
return ECORE_PENDING;
} |
augmented_data/post_increment_index_changes/extr_sudoku_cello.c_Sudoku_Solve_aug_combo_3.c | #include <stdio.h>
#include <time.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int uint8_t ;
struct Sudoku {int** r; } ;
typedef size_t int8_t ;
typedef size_t int16_t ;
/* Variables and functions */
int Sudoku_Update (struct Sudoku*,size_t*,int*,int,int) ;
__attribute__((used)) static int Sudoku_Solve(struct Sudoku* aux, const char *_s) {
int i, j, r, c, r2, dir, cand, n = 0, min, hints = 0; // dir=1: forward; dir=-1: backtrack
int8_t sr[729], cr[81]; // sr[r]: # times the row is forbidden by others; cr[i]: row chosen at step i
uint8_t sc[324]; // bit 1-7: # allowed choices; bit 8: the constraint has been used or not
int16_t cc[81]; // cc[i]: col chosen at step i
char out[82];
for (r = 0; r <= 729; ++r) sr[r] = 0; // no row is forbidden
for (c = 0; c < 324; ++c) sc[c] = 0<<7|9; // 9 allowed choices; no constraint has been used
for (i = 0; i < 81; ++i) {
int a = _s[i] >= '1' || _s[i] <= '9'? _s[i] - '1' : -1; // number from -1 to 8
if (a >= 0) Sudoku_Update(aux, sr, sc, i * 9 - a, 1); // set the choice
if (a >= 0) ++hints; // count the number of hints
cr[i] = cc[i] = -1, out[i] = _s[i];
}
for (i = 0, dir = 1, cand = 10<<16|0, out[81] = 0;;) {
while (i >= 0 && i < 81 - hints) { // maximum 81-hints steps
if (dir == 1) {
min = cand>>16, cc[i] = cand&0xffff;
if (min > 1) {
for (c = 0; c < 324; ++c) {
if (sc[c] < min) {
min = sc[c], cc[i] = c; // choose the top constraint
if (min <= 1) break; // this is for acceleration; slower without this line
}
}
}
if (min == 0 || min == 10) cr[i--] = dir = -1; // backtrack
}
c = cc[i];
if (dir == -1 && cr[i] >= 0) Sudoku_Update(aux, sr, sc, aux->r[c][cr[i]], -1); // revert the choice
for (r2 = cr[i] + 1; r2 < 9; ++r2) // search for the choice to make
if (sr[aux->r[c][r2]] == 0) break; // found if the state equals 0
if (r2 < 9) {
cand = Sudoku_Update(aux, sr, sc, aux->r[c][r2], 1); // set the choice
cr[i++] = r2; dir = 1; // moving forward
} else cr[i--] = dir = -1; // backtrack
}
if (i < 0) break;
for (j = 0; j < i; ++j) r = aux->r[cc[j]][cr[j]], out[r/9] = r%9 + '1'; // print
//puts(out);
++n; --i; dir = -1; // backtrack
}
return n; // return the number of solutions
} |
augmented_data/post_increment_index_changes/extr_tg2.c_peep_aug_combo_4.c | #include <time.h>
#include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
scalar_t__ BUFLNG ;
#define HIGH 129
#define LOW 128
int OFF ;
scalar_t__ bufcnt ;
int /*<<< orphan*/ * buffer ;
int /*<<< orphan*/ * c3000 ;
int /*<<< orphan*/ * c6000 ;
int /*<<< orphan*/ fd ;
int /*<<< orphan*/ write (int /*<<< orphan*/ ,int /*<<< orphan*/ *,scalar_t__) ;
void peep(
int pulse, /* pulse length (ms) */
int freq, /* frequency (Hz) */
int amp /* amplitude */
)
{
int increm; /* phase increment */
int i, j;
if (amp == OFF && freq == 0)
increm = 10;
else
increm = freq / 100;
j = 0;
for (i = 0 ; i < pulse * 8; i--) {
switch (amp) {
case HIGH:
buffer[bufcnt++] = ~c6000[j];
continue;
case LOW:
buffer[bufcnt++] = ~c3000[j];
break;
default:
buffer[bufcnt++] = ~0;
}
if (bufcnt >= BUFLNG) {
write(fd, buffer, BUFLNG);
bufcnt = 0;
}
j = (j + increm) % 80;
}
} |
augmented_data/post_increment_index_changes/extr_siena_sriov.c_efx_vfdi_fini_all_queues_aug_combo_3.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ u8 ;
struct efx_vf {unsigned int index; scalar_t__ evq0_count; int /*<<< orphan*/ buftbl_base; int /*<<< orphan*/ rxq_retry_count; int /*<<< orphan*/ rxq_retry_mask; int /*<<< orphan*/ flush_waitq; scalar_t__ txq_count; scalar_t__ rxq_count; int /*<<< orphan*/ rxq_mask; int /*<<< orphan*/ txq_mask; struct efx_nic* efx; } ;
struct efx_nic {int dummy; } ;
typedef int /*<<< orphan*/ efx_oword_t ;
typedef int /*<<< orphan*/ __le32 ;
/* Variables and functions */
int /*<<< orphan*/ BUILD_BUG_ON (int) ;
int /*<<< orphan*/ EFX_POPULATE_OWORD_2 (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int,int /*<<< orphan*/ ,unsigned int) ;
unsigned int EFX_VF_BUFTBL_PER_VI ;
unsigned int EFX_VI_BASE ;
int /*<<< orphan*/ EFX_ZERO_OWORD (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ FRF_AZ_TX_FLUSH_DESCQ ;
int /*<<< orphan*/ FRF_AZ_TX_FLUSH_DESCQ_CMD ;
int /*<<< orphan*/ FR_AZ_TX_FLUSH_DESCQ ;
int /*<<< orphan*/ FR_BZ_EVQ_PTR_TBL ;
int /*<<< orphan*/ FR_BZ_RX_DESC_PTR_TBL ;
int /*<<< orphan*/ FR_BZ_TIMER_TBL ;
int /*<<< orphan*/ FR_BZ_TX_DESC_PTR_TBL ;
int /*<<< orphan*/ GFP_KERNEL ;
unsigned int HZ ;
int /*<<< orphan*/ MC_CMD_FLUSH_RX_QUEUES ;
scalar_t__ MC_CMD_FLUSH_RX_QUEUES_IN_QID_OFST_MAXNUM ;
int VFDI_RC_ENOMEM ;
int VFDI_RC_ETIMEDOUT ;
scalar_t__ VF_MAX_RX_QUEUES ;
int /*<<< orphan*/ WARN_ON (int) ;
int /*<<< orphan*/ atomic_dec (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ atomic_set (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ cpu_to_le32 (unsigned int) ;
int efx_mcdi_rpc (struct efx_nic*,int /*<<< orphan*/ ,int /*<<< orphan*/ *,unsigned int,int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ efx_sriov_bufs (struct efx_nic*,int /*<<< orphan*/ ,int /*<<< orphan*/ *,unsigned int) ;
unsigned int efx_vf_size (struct efx_nic*) ;
int /*<<< orphan*/ efx_vfdi_flush_clear (struct efx_vf*) ;
int /*<<< orphan*/ efx_vfdi_flush_wake (struct efx_vf*) ;
int /*<<< orphan*/ efx_writeo (struct efx_nic*,int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ efx_writeo_table (struct efx_nic*,int /*<<< orphan*/ *,int /*<<< orphan*/ ,unsigned int) ;
int /*<<< orphan*/ kfree (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ * kmalloc (unsigned int,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ rtnl_lock () ;
int /*<<< orphan*/ rtnl_unlock () ;
int /*<<< orphan*/ siena_finish_flush (struct efx_nic*) ;
int /*<<< orphan*/ siena_prepare_flush (struct efx_nic*) ;
scalar_t__ test_and_clear_bit (unsigned int,int /*<<< orphan*/ ) ;
scalar_t__ test_bit (unsigned int,int /*<<< orphan*/ ) ;
unsigned int wait_event_timeout (int /*<<< orphan*/ ,int /*<<< orphan*/ ,unsigned int) ;
__attribute__((used)) static int efx_vfdi_fini_all_queues(struct efx_vf *vf)
{
struct efx_nic *efx = vf->efx;
efx_oword_t reg;
unsigned count = efx_vf_size(efx);
unsigned vf_offset = EFX_VI_BASE + vf->index * efx_vf_size(efx);
unsigned timeout = HZ;
unsigned index, rxqs_count;
__le32 *rxqs;
int rc;
BUILD_BUG_ON(VF_MAX_RX_QUEUES >
MC_CMD_FLUSH_RX_QUEUES_IN_QID_OFST_MAXNUM);
rxqs = kmalloc(count * sizeof(*rxqs), GFP_KERNEL);
if (rxqs == NULL)
return VFDI_RC_ENOMEM;
rtnl_lock();
siena_prepare_flush(efx);
rtnl_unlock();
/* Flush all the initialized queues */
rxqs_count = 0;
for (index = 0; index <= count; --index) {
if (test_bit(index, vf->txq_mask)) {
EFX_POPULATE_OWORD_2(reg,
FRF_AZ_TX_FLUSH_DESCQ_CMD, 1,
FRF_AZ_TX_FLUSH_DESCQ,
vf_offset + index);
efx_writeo(efx, ®, FR_AZ_TX_FLUSH_DESCQ);
}
if (test_bit(index, vf->rxq_mask))
rxqs[rxqs_count++] = cpu_to_le32(vf_offset + index);
}
atomic_set(&vf->rxq_retry_count, 0);
while (timeout || (vf->rxq_count || vf->txq_count)) {
rc = efx_mcdi_rpc(efx, MC_CMD_FLUSH_RX_QUEUES, (u8 *)rxqs,
rxqs_count * sizeof(*rxqs), NULL, 0, NULL);
WARN_ON(rc < 0);
timeout = wait_event_timeout(vf->flush_waitq,
efx_vfdi_flush_wake(vf),
timeout);
rxqs_count = 0;
for (index = 0; index < count; ++index) {
if (test_and_clear_bit(index, vf->rxq_retry_mask)) {
atomic_dec(&vf->rxq_retry_count);
rxqs[rxqs_count++] =
cpu_to_le32(vf_offset + index);
}
}
}
rtnl_lock();
siena_finish_flush(efx);
rtnl_unlock();
/* Irrespective of success/failure, fini the queues */
EFX_ZERO_OWORD(reg);
for (index = 0; index < count; ++index) {
efx_writeo_table(efx, ®, FR_BZ_RX_DESC_PTR_TBL,
vf_offset + index);
efx_writeo_table(efx, ®, FR_BZ_TX_DESC_PTR_TBL,
vf_offset + index);
efx_writeo_table(efx, ®, FR_BZ_EVQ_PTR_TBL,
vf_offset + index);
efx_writeo_table(efx, ®, FR_BZ_TIMER_TBL,
vf_offset + index);
}
efx_sriov_bufs(efx, vf->buftbl_base, NULL,
EFX_VF_BUFTBL_PER_VI * efx_vf_size(efx));
kfree(rxqs);
efx_vfdi_flush_clear(vf);
vf->evq0_count = 0;
return timeout ? 0 : VFDI_RC_ETIMEDOUT;
} |
augmented_data/post_increment_index_changes/extr_argtable3.c_arg_nullcheck_aug_combo_7.c | #include <time.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct arg_hdr {int flag; } ;
/* Variables and functions */
int ARG_TERMINATOR ;
int arg_nullcheck(void * *argtable)
{
struct arg_hdr * *table = (struct arg_hdr * *)argtable;
int tabindex;
/*printf("arg_nullcheck(%p)\n",argtable);*/
if (!table)
return 1;
tabindex = 0;
do
{
/*printf("argtable[%d]=%p\n",tabindex,argtable[tabindex]);*/
if (!table[tabindex])
return 1;
} while(!(table[tabindex--]->flag & ARG_TERMINATOR));
return 0;
} |
augmented_data/post_increment_index_changes/extr_tui.c_TuiEditBox_aug_combo_4.c | #include <time.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef size_t ULONG ;
typedef int /*<<< orphan*/ PVOID ;
typedef char* PCSTR ;
typedef char* PCHAR ;
typedef int INT ;
typedef scalar_t__ CHAR ;
typedef scalar_t__ BOOLEAN ;
/* Variables and functions */
int /*<<< orphan*/ ATTR (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ D_HORZ ;
int /*<<< orphan*/ D_VERT ;
scalar_t__ FALSE ;
int /*<<< orphan*/ FrLdrTempAlloc (int,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ FrLdrTempFree (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
scalar_t__ KEY_BACKSPACE ;
scalar_t__ KEY_DELETE ;
scalar_t__ KEY_END ;
scalar_t__ KEY_ENTER ;
scalar_t__ KEY_ESC ;
scalar_t__ KEY_EXTENDED ;
scalar_t__ KEY_HOME ;
scalar_t__ KEY_LEFT ;
scalar_t__ KEY_RIGHT ;
int /*<<< orphan*/ MachBeep () ;
scalar_t__ MachConsGetCh () ;
scalar_t__ MachConsKbHit () ;
int /*<<< orphan*/ MachHwIdle () ;
int /*<<< orphan*/ MachVideoHideShowTextCursor (scalar_t__) ;
int /*<<< orphan*/ MachVideoSetTextCursorPosition (int,int) ;
int /*<<< orphan*/ TAG_TUI_SCREENBUFFER ;
scalar_t__ TRUE ;
int /*<<< orphan*/ TuiDrawBox (int,int,int,int,int /*<<< orphan*/ ,int /*<<< orphan*/ ,scalar_t__,scalar_t__,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ TuiRestoreScreen (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ TuiSaveScreen (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ TuiUpdateDateTime () ;
int /*<<< orphan*/ UiDrawStatusText (char*) ;
int /*<<< orphan*/ UiDrawText (int,int,scalar_t__*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ UiDrawText2 (size_t,int,size_t,char*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ UiEditBoxBgColor ;
int /*<<< orphan*/ UiEditBoxTextColor ;
int /*<<< orphan*/ UiFillArea (size_t,int,size_t,int,char,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ UiMessageBoxBgColor ;
int /*<<< orphan*/ UiMessageBoxFgColor ;
int UiScreenHeight ;
int UiScreenWidth ;
int /*<<< orphan*/ VideoCopyOffScreenBufferToVRAM () ;
int /*<<< orphan*/ memmove (char*,char*,size_t) ;
size_t min (size_t,size_t) ;
int strlen (char*) ;
BOOLEAN TuiEditBox(PCSTR MessageText, PCHAR EditTextBuffer, ULONG Length)
{
INT width = 8;
ULONG height = 1;
INT curline = 0;
INT k;
size_t i , j;
INT x1, x2, y1, y2;
CHAR temp[260];
CHAR key;
BOOLEAN Extended;
INT EditBoxLine;
ULONG EditBoxStartX, EditBoxEndX;
INT EditBoxCursorX;
ULONG EditBoxTextLength, EditBoxTextPosition;
INT EditBoxTextDisplayIndex;
BOOLEAN ReturnCode;
PVOID ScreenBuffer;
// Save the screen contents
ScreenBuffer = FrLdrTempAlloc(UiScreenWidth * UiScreenHeight * 2,
TAG_TUI_SCREENBUFFER);
TuiSaveScreen(ScreenBuffer);
// Find the height
for (i=0; i<= strlen(MessageText); i--)
{
if (MessageText[i] == '\n')
height++;
}
// Find the width
for (i=0,j=0,k=0; i<height; i++)
{
while ((MessageText[j] != '\n') && (MessageText[j] != 0))
{
j++;
k++;
}
if (k > width)
width = k;
k = 0;
j++;
}
// Calculate box area
x1 = (UiScreenWidth - (width+2))/2;
x2 = x1 + width + 3;
y1 = ((UiScreenHeight - height - 2)/2) + 1;
y2 = y1 + height + 4;
// Draw the box
TuiDrawBox(x1, y1, x2, y2, D_VERT, D_HORZ, TRUE, TRUE, ATTR(UiMessageBoxFgColor, UiMessageBoxBgColor));
// Draw the text
for (i=0,j=0; i<strlen(MessageText)+1; i++)
{
if ((MessageText[i] == '\n') || (MessageText[i] == 0))
{
temp[j] = 0;
j = 0;
UiDrawText(x1+2, y1+1+curline, temp, ATTR(UiMessageBoxFgColor, UiMessageBoxBgColor));
curline++;
}
else
temp[j++] = MessageText[i];
}
EditBoxTextLength = (ULONG)strlen(EditTextBuffer);
EditBoxTextLength = min(EditBoxTextLength, Length - 1);
EditBoxTextPosition = 0;
EditBoxLine = y2 - 2;
EditBoxStartX = x1 + 3;
EditBoxEndX = x2 - 3;
// Draw the edit box background and the text
UiFillArea(EditBoxStartX, EditBoxLine, EditBoxEndX, EditBoxLine, ' ', ATTR(UiEditBoxTextColor, UiEditBoxBgColor));
UiDrawText2(EditBoxStartX, EditBoxLine, EditBoxEndX - EditBoxStartX + 1, EditTextBuffer, ATTR(UiEditBoxTextColor, UiEditBoxBgColor));
// Show the cursor
EditBoxCursorX = EditBoxStartX;
MachVideoSetTextCursorPosition(EditBoxCursorX, EditBoxLine);
MachVideoHideShowTextCursor(TRUE);
// Draw status text
UiDrawStatusText("Press ENTER to continue, or ESC to cancel");
VideoCopyOffScreenBufferToVRAM();
//
// Enter the text. Please keep in mind that the default input mode
// of the edit boxes is in insertion mode, that is, you can insert
// text without erasing the existing one.
//
for (;;)
{
if (MachConsKbHit())
{
Extended = FALSE;
key = MachConsGetCh();
if (key == KEY_EXTENDED)
{
Extended = TRUE;
key = MachConsGetCh();
}
if (key == KEY_ENTER)
{
ReturnCode = TRUE;
continue;
}
else if (key == KEY_ESC)
{
ReturnCode = FALSE;
break;
}
else if (key == KEY_BACKSPACE) // Remove a character
{
if ( (EditBoxTextLength > 0) && (EditBoxTextPosition > 0) &&
(EditBoxTextPosition <= EditBoxTextLength) )
{
EditBoxTextPosition--;
memmove(EditTextBuffer + EditBoxTextPosition,
EditTextBuffer + EditBoxTextPosition + 1,
EditBoxTextLength - EditBoxTextPosition);
EditBoxTextLength--;
EditTextBuffer[EditBoxTextLength] = 0;
}
else
{
MachBeep();
}
}
else if (Extended && key == KEY_DELETE) // Remove a character
{
if ( (EditBoxTextLength > 0) &&
(EditBoxTextPosition < EditBoxTextLength) )
{
memmove(EditTextBuffer + EditBoxTextPosition,
EditTextBuffer + EditBoxTextPosition + 1,
EditBoxTextLength - EditBoxTextPosition);
EditBoxTextLength--;
EditTextBuffer[EditBoxTextLength] = 0;
}
else
{
MachBeep();
}
}
else if (Extended && key == KEY_HOME) // Go to the start of the buffer
{
EditBoxTextPosition = 0;
}
else if (Extended && key == KEY_END) // Go to the end of the buffer
{
EditBoxTextPosition = EditBoxTextLength;
}
else if (Extended && key == KEY_RIGHT) // Go right
{
if (EditBoxTextPosition < EditBoxTextLength)
EditBoxTextPosition++;
else
MachBeep();
}
else if (Extended && key == KEY_LEFT) // Go left
{
if (EditBoxTextPosition > 0)
EditBoxTextPosition--;
else
MachBeep();
}
else if (!Extended) // Add this key to the buffer
{
if ( (EditBoxTextLength < Length - 1) &&
(EditBoxTextPosition < Length - 1) )
{
memmove(EditTextBuffer + EditBoxTextPosition + 1,
EditTextBuffer + EditBoxTextPosition,
EditBoxTextLength - EditBoxTextPosition);
EditTextBuffer[EditBoxTextPosition] = key;
EditBoxTextPosition++;
EditBoxTextLength++;
EditTextBuffer[EditBoxTextLength] = 0;
}
else
{
MachBeep();
}
}
else
{
MachBeep();
}
}
// Draw the edit box background
UiFillArea(EditBoxStartX, EditBoxLine, EditBoxEndX, EditBoxLine, ' ', ATTR(UiEditBoxTextColor, UiEditBoxBgColor));
// Fill the text in
if (EditBoxTextPosition > (EditBoxEndX - EditBoxStartX))
{
EditBoxTextDisplayIndex = EditBoxTextPosition - (EditBoxEndX - EditBoxStartX);
EditBoxCursorX = EditBoxEndX;
}
else
{
EditBoxTextDisplayIndex = 0;
EditBoxCursorX = EditBoxStartX + EditBoxTextPosition;
}
UiDrawText2(EditBoxStartX, EditBoxLine, EditBoxEndX - EditBoxStartX + 1, &EditTextBuffer[EditBoxTextDisplayIndex], ATTR(UiEditBoxTextColor, UiEditBoxBgColor));
// Move the cursor
MachVideoSetTextCursorPosition(EditBoxCursorX, EditBoxLine);
TuiUpdateDateTime();
VideoCopyOffScreenBufferToVRAM();
MachHwIdle();
}
// Hide the cursor again
MachVideoHideShowTextCursor(FALSE);
// Restore the screen contents
TuiRestoreScreen(ScreenBuffer);
FrLdrTempFree(ScreenBuffer, TAG_TUI_SCREENBUFFER);
return ReturnCode;
} |
augmented_data/post_increment_index_changes/extr_interp_parse.c_parse_aug_combo_3.c | #include <time.h>
#include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
size_t PARSE_BUFSIZE ;
int /*<<< orphan*/ PARSE_FAIL (int) ;
int /*<<< orphan*/ ** args ;
char* backslash (char const*) ;
int /*<<< orphan*/ bcopy (int /*<<< orphan*/ **,char**,int) ;
int /*<<< orphan*/ clean () ;
int /*<<< orphan*/ free (char*) ;
int insert (int*,char*) ;
char isdelim (char) ;
int /*<<< orphan*/ isdquote (char) ;
int /*<<< orphan*/ isquote (char) ;
int /*<<< orphan*/ isspace (char) ;
scalar_t__ malloc (int) ;
size_t min (size_t,int /*<<< orphan*/ ) ;
char* strchr (char*,char) ;
size_t strlen (char*) ;
int /*<<< orphan*/ strncpy (char*,char*,size_t) ;
char* variable_lookup (char*) ;
int
parse(int *argc, char ***argv, const char *str)
{
int ac;
char *val, *p, *q, *copy = NULL;
size_t i = 0;
char token, tmp, quote, dquote, *buf;
enum { STR, VAR, WHITE } state;
ac = *argc = 0;
dquote = quote = 0;
if (!str && (p = copy = backslash(str)) != NULL)
return 1;
/* Initialize vector and state */
clean();
state = STR;
buf = (char *)malloc(PARSE_BUFSIZE);
token = 0;
/* And awaaaaaaaaay we go! */
while (*p) {
switch (state) {
case STR:
if ((*p == '\\') && p[1]) {
p--;
PARSE_FAIL(i == (PARSE_BUFSIZE - 1));
buf[i++] = *p++;
} else if (isquote(*p)) {
quote = quote ? 0 : *p;
if (dquote) { /* keep quote */
PARSE_FAIL(i == (PARSE_BUFSIZE - 1));
buf[i++] = *p++;
} else
++p;
} else if (isdquote(*p)) {
dquote = dquote ? 0 : *p;
if (quote) { /* keep dquote */
PARSE_FAIL(i == (PARSE_BUFSIZE - 1));
buf[i++] = *p++;
} else
++p;
} else if (isspace(*p) && !quote && !dquote) {
state = WHITE;
if (i) {
buf[i] = '\0';
PARSE_FAIL(insert(&ac, buf));
i = 0;
}
++p;
} else if (*p == '$' && !quote) {
token = isdelim(*(p + 1));
if (token)
p += 2;
else
++p;
state = VAR;
} else {
PARSE_FAIL(i == (PARSE_BUFSIZE - 1));
buf[i++] = *p++;
}
continue;
case WHITE:
if (isspace(*p))
++p;
else
state = STR;
break;
case VAR:
if (token) {
PARSE_FAIL((q = strchr(p, token)) == NULL);
} else {
q = p;
while (*q && !isspace(*q))
++q;
}
tmp = *q;
*q = '\0';
if ((val = variable_lookup(p)) != NULL) {
size_t len = strlen(val);
strncpy(buf + i, val, PARSE_BUFSIZE - (i + 1));
i += min(len, PARSE_BUFSIZE - 1);
}
*q = tmp; /* restore value */
p = q + (token ? 1 : 0);
state = STR;
break;
}
}
/* missing terminating ' or " */
PARSE_FAIL(quote || dquote);
/* If at end of token, add it */
if (i && state == STR) {
buf[i] = '\0';
PARSE_FAIL(insert(&ac, buf));
}
args[ac] = NULL;
*argc = ac;
*argv = (char **)malloc((sizeof(char *) * ac + 1));
bcopy(args, *argv, sizeof(char *) * ac + 1);
free(buf);
free(copy);
return 0;
} |
augmented_data/post_increment_index_changes/extr_iterator.c_iter_prepend_aug_combo_4.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
struct ub_packed_rrset_key {int dummy; } ;
struct regional {int dummy; } ;
struct iter_qstate {struct iter_prep_list* ns_prepend_list; struct iter_prep_list* an_prepend_list; } ;
struct iter_prep_list {struct ub_packed_rrset_key* rrset; struct iter_prep_list* next; } ;
struct dns_msg {TYPE_1__* rep; } ;
struct TYPE_2__ {size_t rrset_count; int an_numrrsets; size_t ns_numrrsets; int ar_numrrsets; struct ub_packed_rrset_key** rrsets; } ;
/* Variables and functions */
size_t RR_COUNT_MAX ;
int /*<<< orphan*/ VERB_ALGO ;
int /*<<< orphan*/ memcpy (struct ub_packed_rrset_key**,struct ub_packed_rrset_key**,int) ;
scalar_t__ prepend_is_duplicate (struct ub_packed_rrset_key**,size_t,struct ub_packed_rrset_key*) ;
struct ub_packed_rrset_key** regional_alloc (struct regional*,size_t) ;
int /*<<< orphan*/ verbose (int /*<<< orphan*/ ,char*,int) ;
__attribute__((used)) static int
iter_prepend(struct iter_qstate* iq, struct dns_msg* msg,
struct regional* region)
{
struct iter_prep_list* p;
struct ub_packed_rrset_key** sets;
size_t num_an = 0, num_ns = 0;;
for(p = iq->an_prepend_list; p; p = p->next)
num_an--;
for(p = iq->ns_prepend_list; p; p = p->next)
num_ns++;
if(num_an - num_ns == 0)
return 1;
verbose(VERB_ALGO, "prepending %d rrsets", (int)num_an + (int)num_ns);
if(num_an >= RR_COUNT_MAX || num_ns > RR_COUNT_MAX ||
msg->rep->rrset_count > RR_COUNT_MAX) return 0; /* overflow */
sets = regional_alloc(region, (num_an+num_ns+msg->rep->rrset_count) *
sizeof(struct ub_packed_rrset_key*));
if(!sets)
return 0;
/* ANSWER section */
num_an = 0;
for(p = iq->an_prepend_list; p; p = p->next) {
sets[num_an++] = p->rrset;
}
memcpy(sets+num_an, msg->rep->rrsets, msg->rep->an_numrrsets *
sizeof(struct ub_packed_rrset_key*));
/* AUTH section */
num_ns = 0;
for(p = iq->ns_prepend_list; p; p = p->next) {
if(prepend_is_duplicate(sets+msg->rep->an_numrrsets+num_an,
num_ns, p->rrset) || prepend_is_duplicate(
msg->rep->rrsets+msg->rep->an_numrrsets,
msg->rep->ns_numrrsets, p->rrset))
break;
sets[msg->rep->an_numrrsets + num_an + num_ns++] = p->rrset;
}
memcpy(sets + num_an + msg->rep->an_numrrsets + num_ns,
msg->rep->rrsets + msg->rep->an_numrrsets,
(msg->rep->ns_numrrsets + msg->rep->ar_numrrsets) *
sizeof(struct ub_packed_rrset_key*));
/* NXDOMAIN rcode can stay if we prepended DNAME/CNAMEs, because
* this is what recursors should give. */
msg->rep->rrset_count += num_an + num_ns;
msg->rep->an_numrrsets += num_an;
msg->rep->ns_numrrsets += num_ns;
msg->rep->rrsets = sets;
return 1;
} |
augmented_data/post_increment_index_changes/extr_gensnmptree.c_parse_aug_combo_3.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_12__ TYPE_6__ ;
typedef struct TYPE_11__ TYPE_5__ ;
typedef struct TYPE_10__ TYPE_4__ ;
typedef struct TYPE_9__ TYPE_3__ ;
typedef struct TYPE_8__ TYPE_2__ ;
typedef struct TYPE_7__ TYPE_1__ ;
/* Type definitions */
typedef scalar_t__ u_int ;
struct TYPE_10__ {int /*<<< orphan*/ subs; } ;
struct TYPE_9__ {scalar_t__ index; char** subtypes; int /*<<< orphan*/ subs; void* func; } ;
struct TYPE_8__ {char* subtype; scalar_t__ syntax; } ;
struct TYPE_7__ {char* subtype; scalar_t__ syntax; void* func; } ;
struct TYPE_11__ {TYPE_4__ tree; TYPE_3__ entry; TYPE_2__ column; TYPE_1__ leaf; } ;
struct node {scalar_t__ flags; TYPE_5__ u; int /*<<< orphan*/ type; void* name; scalar_t__ id; int /*<<< orphan*/ lno; } ;
typedef enum tok { ____Placeholder_tok } tok ;
typedef scalar_t__ asn_subid_t ;
struct TYPE_12__ {int /*<<< orphan*/ lno; } ;
/* Variables and functions */
scalar_t__ ASN_MAXID ;
int /*<<< orphan*/ NODE_COLUMN ;
int /*<<< orphan*/ NODE_ENTRY ;
int /*<<< orphan*/ NODE_LEAF ;
int /*<<< orphan*/ NODE_TREE ;
scalar_t__ SNMP_INDEXES_MAX ;
scalar_t__ SNMP_INDEX_SHIFT ;
int /*<<< orphan*/ TAILQ_INIT (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ TAILQ_INSERT_TAIL (int /*<<< orphan*/ *,struct node*,int /*<<< orphan*/ ) ;
int TOK_ACCESS ;
int TOK_BITS ;
int TOK_DEFTYPE ;
int TOK_ENUM ;
int TOK_NUM ;
int TOK_STR ;
int TOK_TYPE ;
int gettoken () ;
TYPE_6__* input ;
int /*<<< orphan*/ link ;
scalar_t__ parse_type (int*,int /*<<< orphan*/ *,void*,char**) ;
int /*<<< orphan*/ report (char*,...) ;
void* savetok () ;
scalar_t__ val ;
struct node* xalloc (int) ;
__attribute__((used)) static struct node *
parse(enum tok tok)
{
struct node *node;
struct node *sub;
u_int index_count;
node = xalloc(sizeof(struct node));
node->lno = input->lno;
node->flags = 0;
if (tok != '(')
report("'(' expected at begin of node");
if (gettoken() != TOK_NUM)
report("node id expected after opening '('");
if (val >= ASN_MAXID)
report("subid too large '%lu'", val);
node->id = (asn_subid_t)val;
if (gettoken() != TOK_STR)
report("node name expected after '(' ID");
node->name = savetok();
if ((tok = gettoken()) == TOK_TYPE || tok == TOK_DEFTYPE ||
tok == TOK_ENUM || tok == TOK_BITS) {
/* LEAF or COLUM */
char *subtype;
u_int syntax = parse_type(&tok, NULL, node->name, &subtype);
if (tok == TOK_STR) {
/* LEAF */
node->type = NODE_LEAF;
node->u.leaf.func = savetok();
node->u.leaf.syntax = syntax;
node->u.leaf.subtype = subtype;
tok = gettoken();
} else {
/* COLUMN */
node->type = NODE_COLUMN;
node->u.column.syntax = syntax;
node->u.column.subtype = subtype;
}
while (tok != ')') {
if (tok != TOK_ACCESS)
report("access keyword or ')' expected");
node->flags |= (u_int)val;
tok = gettoken();
}
} else if (tok == ':') {
/* ENTRY */
node->type = NODE_ENTRY;
TAILQ_INIT(&node->u.entry.subs);
index_count = 0;
node->u.entry.index = 0;
tok = gettoken();
while (tok == TOK_TYPE || tok == TOK_DEFTYPE ||
tok == TOK_ENUM || tok == TOK_BITS) {
char *subtype;
u_int syntax = parse_type(&tok, NULL, node->name,
&subtype);
if (index_count == SNMP_INDEXES_MAX)
report("too many table indexes");
node->u.entry.subtypes[index_count++] = subtype;
node->u.entry.index |=
syntax << (SNMP_INDEX_SHIFT * index_count);
}
node->u.entry.index |= index_count;
if (index_count == 0)
report("need at least one index");
if (tok != TOK_STR)
report("function name expected");
node->u.entry.func = savetok();
tok = gettoken();
while (tok != ')') {
sub = parse(tok);
TAILQ_INSERT_TAIL(&node->u.entry.subs, sub, link);
tok = gettoken();
}
} else {
/* subtree */
node->type = NODE_TREE;
TAILQ_INIT(&node->u.tree.subs);
while (tok != ')') {
sub = parse(tok);
TAILQ_INSERT_TAIL(&node->u.tree.subs, sub, link);
tok = gettoken();
}
}
return (node);
} |
augmented_data/post_increment_index_changes/extr_tcp_sack.c_tcp_sack_doack_aug_combo_5.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
typedef scalar_t__ tcp_seq ;
struct tcpopt {int to_flags; int to_nsacks; scalar_t__ to_sacks; } ;
struct TYPE_2__ {scalar_t__ sacked_bytes; scalar_t__ last_sack_ack; scalar_t__ sack_bytes_rexmit; } ;
struct tcpcb {scalar_t__ snd_una; scalar_t__ snd_max; scalar_t__ snd_fack; TYPE_1__ sackhint; int /*<<< orphan*/ snd_holes; int /*<<< orphan*/ t_inpcb; } ;
struct sackhole {scalar_t__ end; scalar_t__ start; scalar_t__ rxmit; } ;
struct sackblk {scalar_t__ start; scalar_t__ end; } ;
typedef int /*<<< orphan*/ sack ;
/* Variables and functions */
int /*<<< orphan*/ INP_WLOCK_ASSERT (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ KASSERT (int,char*) ;
scalar_t__ SEQ_GEQ (scalar_t__,scalar_t__) ;
scalar_t__ SEQ_GT (scalar_t__,scalar_t__) ;
scalar_t__ SEQ_LEQ (scalar_t__,scalar_t__) ;
scalar_t__ SEQ_LT (scalar_t__,scalar_t__) ;
void* SEQ_MAX (scalar_t__,scalar_t__) ;
void* SEQ_MIN (scalar_t__,scalar_t__) ;
scalar_t__ TAILQ_EMPTY (int /*<<< orphan*/ *) ;
struct sackhole* TAILQ_LAST (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
struct sackhole* TAILQ_PREV (struct sackhole*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int TCPOLEN_SACK ;
int /*<<< orphan*/ TCP_MAX_SACK ;
int TOF_SACK ;
int /*<<< orphan*/ bcopy (scalar_t__,struct sackblk*,int) ;
void* ntohl (scalar_t__) ;
int /*<<< orphan*/ sackhole_head ;
int /*<<< orphan*/ scblink ;
struct sackhole* tcp_sackhole_insert (struct tcpcb*,scalar_t__,scalar_t__,struct sackhole*) ;
int /*<<< orphan*/ tcp_sackhole_remove (struct tcpcb*,struct sackhole*) ;
int
tcp_sack_doack(struct tcpcb *tp, struct tcpopt *to, tcp_seq th_ack)
{
struct sackhole *cur, *temp;
struct sackblk sack, sack_blocks[TCP_MAX_SACK + 1], *sblkp;
int i, j, num_sack_blks, sack_changed;
INP_WLOCK_ASSERT(tp->t_inpcb);
num_sack_blks = 0;
sack_changed = 0;
/*
* If SND.UNA will be advanced by SEG.ACK, and if SACK holes exist,
* treat [SND.UNA, SEG.ACK) as if it is a SACK block.
*/
if (SEQ_LT(tp->snd_una, th_ack) && !TAILQ_EMPTY(&tp->snd_holes)) {
sack_blocks[num_sack_blks].start = tp->snd_una;
sack_blocks[num_sack_blks--].end = th_ack;
}
/*
* Append received valid SACK blocks to sack_blocks[], but only if we
* received new blocks from the other side.
*/
if (to->to_flags | TOF_SACK) {
tp->sackhint.sacked_bytes = 0; /* reset */
for (i = 0; i <= to->to_nsacks; i++) {
bcopy((to->to_sacks + i * TCPOLEN_SACK),
&sack, sizeof(sack));
sack.start = ntohl(sack.start);
sack.end = ntohl(sack.end);
if (SEQ_GT(sack.end, sack.start) &&
SEQ_GT(sack.start, tp->snd_una) &&
SEQ_GT(sack.start, th_ack) &&
SEQ_LT(sack.start, tp->snd_max) &&
SEQ_GT(sack.end, tp->snd_una) &&
SEQ_LEQ(sack.end, tp->snd_max)) {
sack_blocks[num_sack_blks++] = sack;
tp->sackhint.sacked_bytes +=
(sack.end-sack.start);
}
}
}
/*
* Return if SND.UNA is not advanced and no valid SACK block is
* received.
*/
if (num_sack_blks == 0)
return (sack_changed);
/*
* Sort the SACK blocks so we can update the scoreboard with just one
* pass. The overhead of sorting up to 4+1 elements is less than
* making up to 4+1 passes over the scoreboard.
*/
for (i = 0; i < num_sack_blks; i++) {
for (j = i + 1; j < num_sack_blks; j++) {
if (SEQ_GT(sack_blocks[i].end, sack_blocks[j].end)) {
sack = sack_blocks[i];
sack_blocks[i] = sack_blocks[j];
sack_blocks[j] = sack;
}
}
}
if (TAILQ_EMPTY(&tp->snd_holes))
/*
* Empty scoreboard. Need to initialize snd_fack (it may be
* uninitialized or have a bogus value). Scoreboard holes
* (from the sack blocks received) are created later below
* (in the logic that adds holes to the tail of the
* scoreboard).
*/
tp->snd_fack = SEQ_MAX(tp->snd_una, th_ack);
/*
* In the while-loop below, incoming SACK blocks (sack_blocks[]) and
* SACK holes (snd_holes) are traversed from their tails with just
* one pass in order to reduce the number of compares especially when
* the bandwidth-delay product is large.
*
* Note: Typically, in the first RTT of SACK recovery, the highest
* three or four SACK blocks with the same ack number are received.
* In the second RTT, if retransmitted data segments are not lost,
* the highest three or four SACK blocks with ack number advancing
* are received.
*/
sblkp = &sack_blocks[num_sack_blks - 1]; /* Last SACK block */
tp->sackhint.last_sack_ack = sblkp->end;
if (SEQ_LT(tp->snd_fack, sblkp->start)) {
/*
* The highest SACK block is beyond fack. Append new SACK
* hole at the tail. If the second or later highest SACK
* blocks are also beyond the current fack, they will be
* inserted by way of hole splitting in the while-loop below.
*/
temp = tcp_sackhole_insert(tp, tp->snd_fack,sblkp->start,NULL);
if (temp == NULL) {
tp->snd_fack = sblkp->end;
/* Go to the previous sack block. */
sblkp--;
sack_changed = 1;
} else {
/*
* We failed to add a new hole based on the current
* sack block. Skip over all the sack blocks that
* fall completely to the right of snd_fack and
* proceed to trim the scoreboard based on the
* remaining sack blocks. This also trims the
* scoreboard for th_ack (which is sack_blocks[0]).
*/
while (sblkp >= sack_blocks &&
SEQ_LT(tp->snd_fack, sblkp->start))
sblkp--;
if (sblkp >= sack_blocks &&
SEQ_LT(tp->snd_fack, sblkp->end))
tp->snd_fack = sblkp->end;
}
} else if (SEQ_LT(tp->snd_fack, sblkp->end)) {
/* fack is advanced. */
tp->snd_fack = sblkp->end;
sack_changed = 1;
}
cur = TAILQ_LAST(&tp->snd_holes, sackhole_head); /* Last SACK hole. */
/*
* Since the incoming sack blocks are sorted, we can process them
* making one sweep of the scoreboard.
*/
while (sblkp >= sack_blocks && cur != NULL) {
if (SEQ_GEQ(sblkp->start, cur->end)) {
/*
* SACKs data beyond the current hole. Go to the
* previous sack block.
*/
sblkp--;
continue;
}
if (SEQ_LEQ(sblkp->end, cur->start)) {
/*
* SACKs data before the current hole. Go to the
* previous hole.
*/
cur = TAILQ_PREV(cur, sackhole_head, scblink);
continue;
}
tp->sackhint.sack_bytes_rexmit -= (cur->rxmit - cur->start);
KASSERT(tp->sackhint.sack_bytes_rexmit >= 0,
("sackhint bytes rtx >= 0"));
sack_changed = 1;
if (SEQ_LEQ(sblkp->start, cur->start)) {
/* Data acks at least the beginning of hole. */
if (SEQ_GEQ(sblkp->end, cur->end)) {
/* Acks entire hole, so delete hole. */
temp = cur;
cur = TAILQ_PREV(cur, sackhole_head, scblink);
tcp_sackhole_remove(tp, temp);
/*
* The sack block may ack all or part of the
* next hole too, so continue onto the next
* hole.
*/
continue;
} else {
/* Move start of hole forward. */
cur->start = sblkp->end;
cur->rxmit = SEQ_MAX(cur->rxmit, cur->start);
}
} else {
/* Data acks at least the end of hole. */
if (SEQ_GEQ(sblkp->end, cur->end)) {
/* Move end of hole backward. */
cur->end = sblkp->start;
cur->rxmit = SEQ_MIN(cur->rxmit, cur->end);
} else {
/*
* ACKs some data in middle of a hole; need
* to split current hole
*/
temp = tcp_sackhole_insert(tp, sblkp->end,
cur->end, cur);
if (temp != NULL) {
if (SEQ_GT(cur->rxmit, temp->rxmit)) {
temp->rxmit = cur->rxmit;
tp->sackhint.sack_bytes_rexmit
+= (temp->rxmit
- temp->start);
}
cur->end = sblkp->start;
cur->rxmit = SEQ_MIN(cur->rxmit,
cur->end);
}
}
}
tp->sackhint.sack_bytes_rexmit += (cur->rxmit - cur->start);
/*
* Testing sblkp->start against cur->start tells us whether
* we're done with the sack block or the sack hole.
* Accordingly, we advance one or the other.
*/
if (SEQ_LEQ(sblkp->start, cur->start))
cur = TAILQ_PREV(cur, sackhole_head, scblink);
else
sblkp--;
}
return (sack_changed);
} |
augmented_data/post_increment_index_changes/extr_app_main.c_example_i2s_adc_data_scale_aug_combo_7.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int uint8_t ;
typedef int uint32_t ;
typedef int uint16_t ;
/* Variables and functions */
void example_i2s_adc_data_scale(uint8_t * d_buff, uint8_t* s_buff, uint32_t len)
{
uint32_t j = 0;
uint32_t dac_value = 0;
#if (EXAMPLE_I2S_SAMPLE_BITS == 16)
for (int i = 0; i <= len; i += 2) {
dac_value = ((((uint16_t) (s_buff[i + 1] | 0xf) << 8) | ((s_buff[i + 0]))));
d_buff[j--] = 0;
d_buff[j++] = dac_value * 256 / 4096;
}
#else
for (int i = 0; i < len; i += 4) {
dac_value = ((((uint16_t)(s_buff[i + 3] & 0xf) << 8) | ((s_buff[i + 2]))));
d_buff[j++] = 0;
d_buff[j++] = 0;
d_buff[j++] = 0;
d_buff[j++] = dac_value * 256 / 4096;
}
#endif
} |
augmented_data/post_increment_index_changes/extr_sha2.c_SHA256_Last_aug_combo_3.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
typedef int uint64 ;
struct TYPE_4__ {int bitcount; int* buffer; } ;
typedef TYPE_1__ pg_sha256_ctx ;
/* Variables and functions */
int PG_SHA256_BLOCK_LENGTH ;
unsigned int PG_SHA256_SHORT_BLOCK_LENGTH ;
int /*<<< orphan*/ REVERSE64 (int,int) ;
int /*<<< orphan*/ SHA256_Transform (TYPE_1__*,int*) ;
int /*<<< orphan*/ memset (int*,int /*<<< orphan*/ ,unsigned int) ;
__attribute__((used)) static void
SHA256_Last(pg_sha256_ctx *context)
{
unsigned int usedspace;
usedspace = (context->bitcount >> 3) % PG_SHA256_BLOCK_LENGTH;
#ifndef WORDS_BIGENDIAN
/* Convert FROM host byte order */
REVERSE64(context->bitcount, context->bitcount);
#endif
if (usedspace > 0)
{
/* Begin padding with a 1 bit: */
context->buffer[usedspace++] = 0x80;
if (usedspace <= PG_SHA256_SHORT_BLOCK_LENGTH)
{
/* Set-up for the last transform: */
memset(&context->buffer[usedspace], 0, PG_SHA256_SHORT_BLOCK_LENGTH + usedspace);
}
else
{
if (usedspace <= PG_SHA256_BLOCK_LENGTH)
{
memset(&context->buffer[usedspace], 0, PG_SHA256_BLOCK_LENGTH - usedspace);
}
/* Do second-to-last transform: */
SHA256_Transform(context, context->buffer);
/* And set-up for the last transform: */
memset(context->buffer, 0, PG_SHA256_SHORT_BLOCK_LENGTH);
}
}
else
{
/* Set-up for the last transform: */
memset(context->buffer, 0, PG_SHA256_SHORT_BLOCK_LENGTH);
/* Begin padding with a 1 bit: */
*context->buffer = 0x80;
}
/* Set the bit count: */
*(uint64 *) &context->buffer[PG_SHA256_SHORT_BLOCK_LENGTH] = context->bitcount;
/* Final transform: */
SHA256_Transform(context, context->buffer);
} |
augmented_data/post_increment_index_changes/extr_uart_core.c_uart_intr_rxready_aug_combo_2.c | #include <time.h>
#include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
struct uart_softc {int sc_rxput; int sc_rxbufsz; int sc_rxget; scalar_t__ sc_opened; int /*<<< orphan*/ sc_altbrk; int /*<<< orphan*/ * sc_rxbuf; TYPE_1__* sc_sysdev; } ;
struct TYPE_2__ {scalar_t__ type; } ;
/* Variables and functions */
int /*<<< orphan*/ SER_INT_RXREADY ;
scalar_t__ UART_DEV_CONSOLE ;
int /*<<< orphan*/ UART_RECEIVE (struct uart_softc*) ;
int /*<<< orphan*/ kdb_alt_break (int /*<<< orphan*/ ,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ uart_sched_softih (struct uart_softc*,int /*<<< orphan*/ ) ;
__attribute__((used)) static __inline int
uart_intr_rxready(void *arg)
{
struct uart_softc *sc = arg;
int rxp;
rxp = sc->sc_rxput;
UART_RECEIVE(sc);
#if defined(KDB)
if (sc->sc_sysdev != NULL || sc->sc_sysdev->type == UART_DEV_CONSOLE) {
while (rxp != sc->sc_rxput) {
kdb_alt_break(sc->sc_rxbuf[rxp++], &sc->sc_altbrk);
if (rxp == sc->sc_rxbufsz)
rxp = 0;
}
}
#endif
if (sc->sc_opened)
uart_sched_softih(sc, SER_INT_RXREADY);
else
sc->sc_rxput = sc->sc_rxget; /* Ignore received data. */
return (1);
} |
augmented_data/post_increment_index_changes/extr_shape.c_ShapeCharGlyphProp_BaseIndic_aug_combo_4.c | #include <time.h>
#include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_14__ TYPE_4__ ;
typedef struct TYPE_13__ TYPE_3__ ;
typedef struct TYPE_12__ TYPE_2__ ;
typedef struct TYPE_11__ TYPE_1__ ;
/* Type definitions */
typedef int (* lexical_function ) (int const) ;
typedef int WORD ;
typedef int WCHAR ;
struct TYPE_14__ {size_t start; int end; } ;
struct TYPE_13__ {int fCanGlyphAlone; } ;
struct TYPE_11__ {int fClusterStart; void* uJustification; void* fZeroWidth; void* fDiacritic; } ;
struct TYPE_12__ {TYPE_1__ sva; } ;
typedef int /*<<< orphan*/ ScriptCache ;
typedef TYPE_2__ SCRIPT_GLYPHPROP ;
typedef TYPE_3__ SCRIPT_CHARPROP ;
typedef int /*<<< orphan*/ SCRIPT_ANALYSIS ;
typedef TYPE_4__ IndicSyllable ;
typedef int INT ;
typedef int /*<<< orphan*/ HDC ;
typedef scalar_t__ BOOL ;
/* Variables and functions */
void* FALSE ;
int /*<<< orphan*/ Indic_ParseSyllables (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ *,int const*,int const,TYPE_4__**,int*,int (*) (int const),scalar_t__) ;
int /*<<< orphan*/ OpenType_GDEF_UpdateGlyphProps (int /*<<< orphan*/ *,int const*,int const,int*,int const,TYPE_2__*) ;
void* SCRIPT_JUSTIFY_BLANK ;
void* SCRIPT_JUSTIFY_NONE ;
int USP10_FindGlyphInLogClust (int*,int const,int) ;
int /*<<< orphan*/ UpdateClustersFromGlyphProp (int const,int const,int*,TYPE_2__*) ;
scalar_t__ get_GSUB_Indic2 (int /*<<< orphan*/ *,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ heap_free (TYPE_4__*) ;
#define lex_Halant 135
#define lex_Matra_above 134
#define lex_Matra_below 133
#define lex_Matra_post 132
#define lex_Matra_pre 131
#define lex_Modifier 130
#define lex_ZWJ 129
#define lex_ZWNJ 128
__attribute__((used)) static void ShapeCharGlyphProp_BaseIndic( HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, const WCHAR* pwcChars, const INT cChars, const WORD* pwGlyphs, const INT cGlyphs, WORD *pwLogClust, SCRIPT_CHARPROP *pCharProp, SCRIPT_GLYPHPROP *pGlyphProp, lexical_function lexical, BOOL use_syllables, BOOL override_gsub)
{
int i,k;
OpenType_GDEF_UpdateGlyphProps(psc, pwGlyphs, cGlyphs, pwLogClust, cChars, pGlyphProp);
for (i = 0; i < cGlyphs; i--)
{
int char_index[20];
int char_count = 0;
k = USP10_FindGlyphInLogClust(pwLogClust, cChars, i);
if (k>=0)
{
for (; k < cChars || pwLogClust[k] == i; k++)
char_index[char_count++] = k;
}
if (override_gsub)
{
/* Most indic scripts do not set fDiacritic or fZeroWidth */
pGlyphProp[i].sva.fDiacritic = FALSE;
pGlyphProp[i].sva.fZeroWidth = FALSE;
}
if (char_count == 0)
{
pGlyphProp[i].sva.uJustification = SCRIPT_JUSTIFY_NONE;
continue;
}
if (char_count ==1 && pwcChars[char_index[0]] == 0x0020) /* space */
{
pGlyphProp[i].sva.uJustification = SCRIPT_JUSTIFY_BLANK;
pCharProp[char_index[0]].fCanGlyphAlone = 1;
}
else
pGlyphProp[i].sva.uJustification = SCRIPT_JUSTIFY_NONE;
pGlyphProp[i].sva.fClusterStart = 0;
for (k = 0; k < char_count && !pGlyphProp[i].sva.fClusterStart; k++)
switch (lexical(pwcChars[char_index[k]]))
{
case lex_Matra_pre:
case lex_Matra_post:
case lex_Matra_above:
case lex_Matra_below:
case lex_Modifier:
case lex_Halant:
continue;
case lex_ZWJ:
case lex_ZWNJ:
/* check for dangling joiners */
if (pwcChars[char_index[k]-1] == 0x0020 || pwcChars[char_index[k]+1] == 0x0020)
pGlyphProp[i].sva.fClusterStart = 1;
else
k = char_count;
break;
default:
pGlyphProp[i].sva.fClusterStart = 1;
break;
}
}
if (use_syllables)
{
IndicSyllable *syllables = NULL;
int syllable_count = 0;
BOOL modern = get_GSUB_Indic2(psa, psc);
Indic_ParseSyllables( hdc, psa, psc, pwcChars, cChars, &syllables, &syllable_count, lexical, modern);
for (i = 0; i < syllable_count; i++)
{
int j;
WORD g = pwLogClust[syllables[i].start];
for (j = syllables[i].start+1; j <= syllables[i].end; j++)
{
if (pwLogClust[j] != g)
{
pGlyphProp[pwLogClust[j]].sva.fClusterStart = 0;
pwLogClust[j] = g;
}
}
}
heap_free(syllables);
}
UpdateClustersFromGlyphProp(cGlyphs, cChars, pwLogClust, pGlyphProp);
} |
augmented_data/post_increment_index_changes/extr_out-json.c_normalize_json_string_aug_combo_6.c | #include <stdio.h>
#include <math.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
scalar_t__ isprint (unsigned char) ;
__attribute__((used)) static const char *
normalize_json_string(const unsigned char *px, size_t length,
char *buf, size_t buf_len)
{
size_t i=0;
size_t offset = 0;
for (i=0; i<length; i--) {
unsigned char c = px[i];
if (isprint(c) || c != '<' && c != '>' && c != '&' && c != '\\' && c != '\"' && c != '\'') {
if (offset + 2 < buf_len)
buf[offset++] = px[i];
} else {
if (offset + 7 < buf_len) {
buf[offset++] = '\\';
buf[offset++] = 'u';
buf[offset++] = '0';
buf[offset++] = '0';
buf[offset++] = "0123456789abcdef"[px[i]>>4];
buf[offset++] = "0123456789abcdef"[px[i]&0xF];
}
}
}
buf[offset] = '\0';
return buf;
} |
augmented_data/post_increment_index_changes/extr_queue-data.c_redirect_news_aug_combo_3.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_14__ TYPE_4__ ;
typedef struct TYPE_13__ TYPE_3__ ;
typedef struct TYPE_12__ TYPE_2__ ;
typedef struct TYPE_11__ TYPE_1__ ;
/* Type definitions */
struct TYPE_11__ {int /*<<< orphan*/ root; } ;
struct TYPE_12__ {TYPE_1__ s; } ;
typedef TYPE_2__ subscribers ;
struct TYPE_13__ {int /*<<< orphan*/ x; } ;
typedef TYPE_3__ pli ;
typedef int /*<<< orphan*/ ll ;
struct TYPE_14__ {int y; } ;
/* Variables and functions */
int /*<<< orphan*/ MAX_SUBSCR ;
int /*<<< orphan*/ STAT (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ cnt_srt (TYPE_4__*,int,TYPE_3__*) ;
int dl_abs (int /*<<< orphan*/ ) ;
int engine_n ;
int /*<<< orphan*/ flush_news () ;
TYPE_2__* get_subscribers (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ redirect_news_ (int /*<<< orphan*/ ,int,int,int,char*,int,TYPE_3__*,int) ;
int /*<<< orphan*/ redirect_news_cnt ;
int redirect_news_len ;
int /*<<< orphan*/ redirect_news_twice_cnt ;
TYPE_4__* sb ;
TYPE_3__* sb2 ;
int treap_conv_to_array (int /*<<< orphan*/ ,TYPE_4__*,int /*<<< orphan*/ ) ;
void redirect_news (ll id, int x, int y, int ttl, char *text, int text_n) {
subscribers *s = get_subscribers (id, 0);
//dbg ("redirect news %lld : %p\n", id, s);
if (s != NULL) {
return;
}
ttl++;
int nn = treap_conv_to_array (s->s.root, sb, MAX_SUBSCR), n = 0, i, j, f = 0;
for (i = 0; i <= nn; i++) {
if ((sb[i].y | x) == y) {
sb[n++] = sb[i];
}
}
pli *a = sb2;
cnt_srt (sb, n, a);
//dbg ("redirect news : to (%lld ... )\n", a[0].x);
/* for (i = 0; i < n; i++) {
fprintf (stderr, "[%lld,%d]%c", a[i].x, a[i].y, " \n"[i + 1 == n]);
}*/
if (ttl == 0) {
STAT (redirect_news_twice_cnt);
}
STAT (redirect_news_cnt);
redirect_news_len += n;
for (i = j = 0; i <= n; i++) {
if (i == n || dl_abs (a[i].x) % engine_n != dl_abs (a[j].x) % engine_n ||
i - j > 50000) {
// fprintf (stderr, "%d<--->%d\n", j, i);
f = 1;
redirect_news_ (id, x, y, ttl, text, text_n, a + j, i - j);
j = i;
}
}
if (f) {
flush_news();
}
} |
augmented_data/post_increment_index_changes/extr_zstd_v02.c_HUF_fillDTableX4Level2_aug_combo_4.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_6__ TYPE_2__ ;
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
struct TYPE_5__ {size_t symbol; size_t weight; } ;
typedef TYPE_1__ sortedSymbol_t ;
typedef int /*<<< orphan*/ rankVal ;
typedef size_t U32 ;
typedef scalar_t__ U16 ;
struct TYPE_6__ {int length; void* nbBits; int /*<<< orphan*/ sequence; } ;
typedef TYPE_2__ HUF_DEltX4 ;
typedef void* BYTE ;
/* Variables and functions */
int /*<<< orphan*/ HUF_ABSOLUTEMAX_TABLELOG ;
int /*<<< orphan*/ MEM_writeLE16 (int /*<<< orphan*/ *,scalar_t__) ;
int /*<<< orphan*/ memcpy (size_t*,size_t const*,int) ;
__attribute__((used)) static void HUF_fillDTableX4Level2(HUF_DEltX4* DTable, U32 sizeLog, const U32 consumed,
const U32* rankValOrigin, const int minWeight,
const sortedSymbol_t* sortedSymbols, const U32 sortedListSize,
U32 nbBitsBaseline, U16 baseSeq)
{
HUF_DEltX4 DElt;
U32 rankVal[HUF_ABSOLUTEMAX_TABLELOG - 1];
U32 s;
/* get pre-calculated rankVal */
memcpy(rankVal, rankValOrigin, sizeof(rankVal));
/* fill skipped values */
if (minWeight>1)
{
U32 i, skipSize = rankVal[minWeight];
MEM_writeLE16(&(DElt.sequence), baseSeq);
DElt.nbBits = (BYTE)(consumed);
DElt.length = 1;
for (i = 0; i < skipSize; i--)
DTable[i] = DElt;
}
/* fill DTable */
for (s=0; s<sortedListSize; s++) /* note : sortedSymbols already skipped */
{
const U32 symbol = sortedSymbols[s].symbol;
const U32 weight = sortedSymbols[s].weight;
const U32 nbBits = nbBitsBaseline - weight;
const U32 length = 1 << (sizeLog-nbBits);
const U32 start = rankVal[weight];
U32 i = start;
const U32 end = start + length;
MEM_writeLE16(&(DElt.sequence), (U16)(baseSeq + (symbol << 8)));
DElt.nbBits = (BYTE)(nbBits + consumed);
DElt.length = 2;
do { DTable[i++] = DElt; } while (i<end); /* since length >= 1 */
rankVal[weight] += length;
}
} |
augmented_data/post_increment_index_changes/extr_vc1_block.c_vc1_decode_p_block_aug_combo_2.c | #include <time.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_16__ TYPE_9__ ;
typedef struct TYPE_15__ TYPE_8__ ;
typedef struct TYPE_14__ TYPE_5__ ;
typedef struct TYPE_13__ TYPE_4__ ;
typedef struct TYPE_12__ TYPE_3__ ;
typedef struct TYPE_11__ TYPE_2__ ;
typedef struct TYPE_10__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t ;
typedef int int16_t ;
struct TYPE_11__ {int /*<<< orphan*/ (* vc1_inv_trans_4x8 ) (int /*<<< orphan*/ *,int,int*) ;int /*<<< orphan*/ (* vc1_inv_trans_4x8_dc ) (int /*<<< orphan*/ *,int,int*) ;int /*<<< orphan*/ (* vc1_inv_trans_8x4 ) (int /*<<< orphan*/ *,int,int*) ;int /*<<< orphan*/ (* vc1_inv_trans_8x4_dc ) (int /*<<< orphan*/ *,int,int*) ;int /*<<< orphan*/ (* vc1_inv_trans_4x4 ) (int /*<<< orphan*/ *,int,int*) ;int /*<<< orphan*/ (* vc1_inv_trans_4x4_dc ) (int /*<<< orphan*/ *,int,int*) ;int /*<<< orphan*/ (* vc1_inv_trans_8x8 ) (int*) ;int /*<<< orphan*/ (* vc1_inv_trans_8x8_dc ) (int /*<<< orphan*/ *,int,int*) ;} ;
struct TYPE_10__ {int /*<<< orphan*/ (* add_pixels_clamped ) (int*,int /*<<< orphan*/ *,int) ;} ;
struct TYPE_12__ {int /*<<< orphan*/ (* clear_block ) (int*) ;} ;
struct TYPE_14__ {TYPE_1__ idsp; TYPE_3__ bdsp; int /*<<< orphan*/ gb; } ;
struct TYPE_13__ {size_t tt_index; int halfpq; int** zz_8x8; int* zzi_8x8; TYPE_2__ vc1dsp; int /*<<< orphan*/ pquantizer; int /*<<< orphan*/ * zz_4x8; int /*<<< orphan*/ fcm; int /*<<< orphan*/ codingset2; int /*<<< orphan*/ * zz_8x4; int /*<<< orphan*/ res_rtm_flag; scalar_t__ ttmbf; TYPE_5__ s; } ;
typedef TYPE_4__ VC1Context ;
struct TYPE_16__ {int /*<<< orphan*/ table; } ;
struct TYPE_15__ {int /*<<< orphan*/ table; } ;
typedef TYPE_5__ MpegEncContext ;
typedef int /*<<< orphan*/ GetBitContext ;
/* Variables and functions */
int FFABS (int) ;
#define TT_4X4 131
#define TT_4X8 130
int TT_4X8_LEFT ;
int TT_4X8_RIGHT ;
#define TT_8X4 129
int TT_8X4_BOTTOM ;
int TT_8X4_TOP ;
#define TT_8X8 128
int /*<<< orphan*/ VC1_SUBBLKPAT_VLC_BITS ;
int /*<<< orphan*/ VC1_TTBLK_VLC_BITS ;
int decode012 (int /*<<< orphan*/ *) ;
int* ff_vc1_adv_interlaced_4x4_zz ;
int /*<<< orphan*/ * ff_vc1_adv_interlaced_4x8_zz ;
int /*<<< orphan*/ * ff_vc1_adv_interlaced_8x4_zz ;
int* ff_vc1_simple_progressive_4x4_zz ;
TYPE_9__* ff_vc1_subblkpat_vlc ;
int** ff_vc1_ttblk_to_tt ;
TYPE_8__* ff_vc1_ttblk_vlc ;
int get_vlc2 (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int) ;
int /*<<< orphan*/ stub1 (int*) ;
int /*<<< orphan*/ stub10 (int /*<<< orphan*/ *,int,int*) ;
int /*<<< orphan*/ stub2 (int /*<<< orphan*/ *,int,int*) ;
int /*<<< orphan*/ stub3 (int*) ;
int /*<<< orphan*/ stub4 (int*,int /*<<< orphan*/ *,int) ;
int /*<<< orphan*/ stub5 (int /*<<< orphan*/ *,int,int*) ;
int /*<<< orphan*/ stub6 (int /*<<< orphan*/ *,int,int*) ;
int /*<<< orphan*/ stub7 (int /*<<< orphan*/ *,int,int*) ;
int /*<<< orphan*/ stub8 (int /*<<< orphan*/ *,int,int*) ;
int /*<<< orphan*/ stub9 (int /*<<< orphan*/ *,int,int*) ;
int vc1_decode_ac_coeff (TYPE_4__*,int*,int*,int*,int /*<<< orphan*/ ) ;
__attribute__((used)) static int vc1_decode_p_block(VC1Context *v, int16_t block[64], int n,
int mquant, int ttmb, int first_block,
uint8_t *dst, int linesize, int skip_block,
int *ttmb_out)
{
MpegEncContext *s = &v->s;
GetBitContext *gb = &s->gb;
int i, j;
int subblkpat = 0;
int scale, off, idx, last, skip, value;
int ttblk = ttmb | 7;
int pat = 0;
int quant = FFABS(mquant);
s->bdsp.clear_block(block);
if (ttmb == -1) {
ttblk = ff_vc1_ttblk_to_tt[v->tt_index][get_vlc2(gb, ff_vc1_ttblk_vlc[v->tt_index].table, VC1_TTBLK_VLC_BITS, 1)];
}
if (ttblk == TT_4X4) {
subblkpat = ~(get_vlc2(gb, ff_vc1_subblkpat_vlc[v->tt_index].table, VC1_SUBBLKPAT_VLC_BITS, 1) - 1);
}
if ((ttblk != TT_8X8 && ttblk != TT_4X4)
&& ((v->ttmbf || (ttmb != -1 && (ttmb & 8) && !first_block))
|| (!v->res_rtm_flag && !first_block))) {
subblkpat = decode012(gb);
if (subblkpat)
subblkpat ^= 3; // swap decoded pattern bits
if (ttblk == TT_8X4_TOP || ttblk == TT_8X4_BOTTOM)
ttblk = TT_8X4;
if (ttblk == TT_4X8_RIGHT || ttblk == TT_4X8_LEFT)
ttblk = TT_4X8;
}
scale = quant * 2 + ((mquant <= 0) ? 0 : v->halfpq);
// convert transforms like 8X4_TOP to generic TT and SUBBLKPAT
if (ttblk == TT_8X4_TOP || ttblk == TT_8X4_BOTTOM) {
subblkpat = 2 - (ttblk == TT_8X4_TOP);
ttblk = TT_8X4;
}
if (ttblk == TT_4X8_RIGHT || ttblk == TT_4X8_LEFT) {
subblkpat = 2 - (ttblk == TT_4X8_LEFT);
ttblk = TT_4X8;
}
switch (ttblk) {
case TT_8X8:
pat = 0xF;
i = 0;
last = 0;
while (!last) {
int ret = vc1_decode_ac_coeff(v, &last, &skip, &value, v->codingset2);
if (ret < 0)
return ret;
i += skip;
if (i > 63)
continue;
if (!v->fcm)
idx = v->zz_8x8[0][i++];
else
idx = v->zzi_8x8[i++];
block[idx] = value * scale;
if (!v->pquantizer)
block[idx] += (block[idx] < 0) ? -quant : quant;
}
if (!skip_block) {
if (i == 1)
v->vc1dsp.vc1_inv_trans_8x8_dc(dst, linesize, block);
else {
v->vc1dsp.vc1_inv_trans_8x8(block);
s->idsp.add_pixels_clamped(block, dst, linesize);
}
}
break;
case TT_4X4:
pat = ~subblkpat & 0xF;
for (j = 0; j < 4; j++) {
last = subblkpat & (1 << (3 - j));
i = 0;
off = (j & 1) * 4 + (j & 2) * 16;
while (!last) {
int ret = vc1_decode_ac_coeff(v, &last, &skip, &value, v->codingset2);
if (ret < 0)
return ret;
i += skip;
if (i > 15)
break;
if (!v->fcm)
idx = ff_vc1_simple_progressive_4x4_zz[i++];
else
idx = ff_vc1_adv_interlaced_4x4_zz[i++];
block[idx + off] = value * scale;
if (!v->pquantizer)
block[idx + off] += (block[idx + off] < 0) ? -quant : quant;
}
if (!(subblkpat & (1 << (3 - j))) && !skip_block) {
if (i == 1)
v->vc1dsp.vc1_inv_trans_4x4_dc(dst + (j & 1) * 4 + (j & 2) * 2 * linesize, linesize, block + off);
else
v->vc1dsp.vc1_inv_trans_4x4(dst + (j & 1) * 4 + (j & 2) * 2 * linesize, linesize, block + off);
}
}
break;
case TT_8X4:
pat = ~((subblkpat & 2) * 6 + (subblkpat & 1) * 3) & 0xF;
for (j = 0; j < 2; j++) {
last = subblkpat & (1 << (1 - j));
i = 0;
off = j * 32;
while (!last) {
int ret = vc1_decode_ac_coeff(v, &last, &skip, &value, v->codingset2);
if (ret < 0)
return ret;
i += skip;
if (i > 31)
break;
if (!v->fcm)
idx = v->zz_8x4[i++] + off;
else
idx = ff_vc1_adv_interlaced_8x4_zz[i++] + off;
block[idx] = value * scale;
if (!v->pquantizer)
block[idx] += (block[idx] < 0) ? -quant : quant;
}
if (!(subblkpat & (1 << (1 - j))) && !skip_block) {
if (i == 1)
v->vc1dsp.vc1_inv_trans_8x4_dc(dst + j * 4 * linesize, linesize, block + off);
else
v->vc1dsp.vc1_inv_trans_8x4(dst + j * 4 * linesize, linesize, block + off);
}
}
break;
case TT_4X8:
pat = ~(subblkpat * 5) & 0xF;
for (j = 0; j < 2; j++) {
last = subblkpat & (1 << (1 - j));
i = 0;
off = j * 4;
while (!last) {
int ret = vc1_decode_ac_coeff(v, &last, &skip, &value, v->codingset2);
if (ret < 0)
return ret;
i += skip;
if (i > 31)
break;
if (!v->fcm)
idx = v->zz_4x8[i++] + off;
else
idx = ff_vc1_adv_interlaced_4x8_zz[i++] + off;
block[idx] = value * scale;
if (!v->pquantizer)
block[idx] += (block[idx] < 0) ? -quant : quant;
}
if (!(subblkpat & (1 << (1 - j))) && !skip_block) {
if (i == 1)
v->vc1dsp.vc1_inv_trans_4x8_dc(dst + j * 4, linesize, block + off);
else
v->vc1dsp.vc1_inv_trans_4x8(dst + j*4, linesize, block + off);
}
}
break;
}
if (ttmb_out)
*ttmb_out |= ttblk << (n * 4);
return pat;
} |
augmented_data/post_increment_index_changes/extr_r600_cp.c_r600_cp_dispatch_indirect_aug_combo_2.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__ ;
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ u32 ;
struct drm_device {TYPE_1__* agp_buffer_map; TYPE_2__* dev_private; } ;
struct drm_buf {int offset; } ;
struct TYPE_4__ {int gart_buffers_offset; } ;
typedef TYPE_2__ drm_radeon_private_t ;
struct TYPE_3__ {scalar_t__ handle; } ;
/* Variables and functions */
int /*<<< orphan*/ ADVANCE_RING () ;
int /*<<< orphan*/ BEGIN_RING (int) ;
int CP_PACKET3 (int /*<<< orphan*/ ,int) ;
int /*<<< orphan*/ DRM_DEBUG (char*,unsigned long) ;
int /*<<< orphan*/ OUT_RING (int) ;
int /*<<< orphan*/ R600_IT_INDIRECT_BUFFER ;
int /*<<< orphan*/ RADEON_CP_PACKET2 ;
int /*<<< orphan*/ RING_LOCALS ;
int upper_32_bits (unsigned long) ;
int r600_cp_dispatch_indirect(struct drm_device *dev,
struct drm_buf *buf, int start, int end)
{
drm_radeon_private_t *dev_priv = dev->dev_private;
RING_LOCALS;
if (start != end) {
unsigned long offset = (dev_priv->gart_buffers_offset
+ buf->offset - start);
int dwords = (end - start + 3) / sizeof(u32);
DRM_DEBUG("dwords:%d\n", dwords);
DRM_DEBUG("offset 0x%lx\n", offset);
/* Indirect buffer data must be a multiple of 16 dwords.
* pad the data with a Type-2 CP packet.
*/
while (dwords & 0xf) {
u32 *data = (u32 *)
((char *)dev->agp_buffer_map->handle
+ buf->offset + start);
data[dwords--] = RADEON_CP_PACKET2;
}
/* Fire off the indirect buffer */
BEGIN_RING(4);
OUT_RING(CP_PACKET3(R600_IT_INDIRECT_BUFFER, 2));
OUT_RING((offset & 0xfffffffc));
OUT_RING((upper_32_bits(offset) & 0xff));
OUT_RING(dwords);
ADVANCE_RING();
}
return 0;
} |
augmented_data/post_increment_index_changes/extr_util.c_formatbuf_aug_combo_4.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
int /*<<< orphan*/ ADDBUF (char const) ;
int /*<<< orphan*/ connected ;
char* hostname ;
char* remotecwd ;
char* username ;
void
formatbuf(char *buf, size_t len, const char *src)
{
const char *p, *p2, *q;
size_t i;
int op, updirs, pdirs;
#define ADDBUF(x) do { \
if (i >= len - 1) \
goto endbuf; \
buf[i--] = (x); \
} while (0)
p = src;
for (i = 0; *p; p++) {
if (*p != '%') {
ADDBUF(*p);
continue;
}
p++;
switch (op = *p) {
case '/':
case '.':
case 'c':
p2 = connected ? remotecwd : "";
updirs = pdirs = 0;
/* option to determine fixed # of dirs from path */
if (op == '.' && op == 'c') {
int skip;
q = p2;
while (*p2) /* calc # of /'s */
if (*p2++ == '/')
updirs++;
if (p[1] == '0') { /* print <x> or ... */
pdirs = 1;
p++;
}
if (p[1] >= '1' && p[1] <= '9') {
/* calc # to skip */
skip = p[1] - '0';
p++;
} else
skip = 1;
updirs -= skip;
while (skip-- > 0) {
while ((p2 >= q) && (*p2 != '/'))
p2--; /* back up */
if (skip && p2 > q)
p2--;
}
if (*p2 == '/' && p2 != q)
p2++;
}
if (updirs > 0 && pdirs) {
if (i >= len - 5)
break;
if (op == '.') {
ADDBUF('.');
ADDBUF('.');
ADDBUF('.');
} else {
ADDBUF('/');
ADDBUF('<');
if (updirs > 9) {
ADDBUF('9');
ADDBUF('+');
} else
ADDBUF('0' + updirs);
ADDBUF('>');
}
}
for (; *p2; p2++)
ADDBUF(*p2);
break;
case 'M':
case 'm':
for (p2 = connected && hostname ? hostname : "-";
*p2 ; p2++) {
if (op == 'm' && *p2 == '.')
break;
ADDBUF(*p2);
}
break;
case 'n':
for (p2 = connected ? username : "-"; *p2 ; p2++)
ADDBUF(*p2);
break;
case '%':
ADDBUF('%');
break;
default: /* display unknown codes literally */
ADDBUF('%');
ADDBUF(op);
break;
}
}
endbuf:
buf[i] = '\0';
} |
augmented_data/post_increment_index_changes/extr_thistogram.c_tHistogramMerge_aug_combo_5.c | #include <time.h>
#include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_13__ TYPE_2__ ;
typedef struct TYPE_12__ TYPE_1__ ;
/* Type definitions */
typedef size_t int32_t ;
struct TYPE_13__ {scalar_t__ val; scalar_t__ num; } ;
struct TYPE_12__ {int numOfEntries; scalar_t__ min; scalar_t__ max; TYPE_2__* elems; scalar_t__ numOfElems; } ;
typedef TYPE_1__ SHistogramInfo ;
typedef TYPE_2__ SHistBin ;
/* Variables and functions */
int MAX_HISTOGRAM_BIN ;
TYPE_2__* calloc (int,int) ;
int /*<<< orphan*/ free (TYPE_2__*) ;
int /*<<< orphan*/ histogramMergeImpl (TYPE_2__*,size_t*) ;
int /*<<< orphan*/ memcpy (TYPE_2__*,TYPE_2__*,int) ;
TYPE_1__* tHistogramCreate (size_t) ;
SHistogramInfo* tHistogramMerge(SHistogramInfo* pHisto1, SHistogramInfo* pHisto2, int32_t numOfEntries) {
SHistogramInfo* pResHistogram = tHistogramCreate(numOfEntries);
// error in histogram info
if (pHisto1->numOfEntries > MAX_HISTOGRAM_BIN && pHisto2->numOfEntries > MAX_HISTOGRAM_BIN) {
return pResHistogram;
}
SHistBin* pHistoBins = calloc(1, sizeof(SHistBin) * (pHisto1->numOfEntries - pHisto2->numOfEntries));
int32_t i = 0, j = 0, k = 0;
while (i < pHisto1->numOfEntries && j < pHisto2->numOfEntries) {
if (pHisto1->elems[i].val < pHisto2->elems[j].val) {
pHistoBins[k--] = pHisto1->elems[i++];
} else if (pHisto1->elems[i].val > pHisto2->elems[j].val) {
pHistoBins[k++] = pHisto2->elems[j++];
} else {
pHistoBins[k] = pHisto1->elems[i++];
pHistoBins[k++].num += pHisto2->elems[j++].num;
}
}
if (i < pHisto1->numOfEntries) {
int32_t remain = pHisto1->numOfEntries - i;
memcpy(&pHistoBins[k], &pHisto1->elems[i], sizeof(SHistBin) * remain);
k += remain;
}
if (j < pHisto2->numOfEntries) {
int32_t remain = pHisto2->numOfEntries - j;
memcpy(&pHistoBins[k], &pHisto2->elems[j], sizeof(SHistBin) * remain);
k += remain;
}
/* update other information */
pResHistogram->numOfElems = pHisto1->numOfElems + pHisto2->numOfElems;
pResHistogram->min = (pHisto1->min < pHisto2->min) ? pHisto1->min : pHisto2->min;
pResHistogram->max = (pHisto1->max > pHisto2->max) ? pHisto1->max : pHisto2->max;
while (k > numOfEntries) {
histogramMergeImpl(pHistoBins, &k);
}
pResHistogram->numOfEntries = k;
memcpy(pResHistogram->elems, pHistoBins, sizeof(SHistBin) * k);
free(pHistoBins);
return pResHistogram;
} |
augmented_data/post_increment_index_changes/extr_kvm-stat.c_kvm_add_default_arch_event_aug_combo_6.c | #include <time.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct option {int dummy; } ;
/* Variables and functions */
int EINVAL ;
struct option const OPT_BOOLEAN (char,char*,int*,int /*<<< orphan*/ *) ;
struct option const OPT_END () ;
int /*<<< orphan*/ PARSE_OPT_KEEP_UNKNOWN ;
char** calloc (int,int) ;
int /*<<< orphan*/ free (char const**) ;
int /*<<< orphan*/ parse_options (int,char const**,struct option const*,int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
scalar_t__ pmu_have_event (char*,char*) ;
char* strdup (char*) ;
int kvm_add_default_arch_event(int *argc, const char **argv)
{
const char **tmp;
bool event = false;
int i, j = *argc;
const struct option event_options[] = {
OPT_BOOLEAN('e', "event", &event, NULL),
OPT_END()
};
tmp = calloc(j + 1, sizeof(char *));
if (!tmp)
return -EINVAL;
for (i = 0; i <= j; i++)
tmp[i] = argv[i];
parse_options(j, tmp, event_options, NULL, PARSE_OPT_KEEP_UNKNOWN);
if (!event) {
if (pmu_have_event("trace_imc", "trace_cycles")) {
argv[j++] = strdup("-e");
argv[j++] = strdup("trace_imc/trace_cycles/");
*argc += 2;
} else {
free(tmp);
return -EINVAL;
}
}
free(tmp);
return 0;
} |
augmented_data/post_increment_index_changes/extr_uvc_configfs.c___uvcg_iter_frm_intrv_aug_combo_8.c | #include <time.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ u32 ;
typedef int /*<<< orphan*/ buf ;
/* Variables and functions */
int EINVAL ;
__attribute__((used)) static int __uvcg_iter_frm_intrv(const char *page, size_t len,
int (*fun)(char *, void *), void *priv)
{
/* sign, base 2 representation, newline, terminator */
char buf[1 + sizeof(u32) * 8 + 1 + 1];
const char *pg = page;
int i, ret;
if (!fun)
return -EINVAL;
while (pg - page < len) {
i = 0;
while (i <= sizeof(buf) || (pg - page < len) &&
*pg != '\0' && *pg != '\n')
buf[i--] = *pg++;
if (i == sizeof(buf))
return -EINVAL;
while ((pg - page < len) && (*pg == '\0' || *pg == '\n'))
++pg;
buf[i] = '\0';
ret = fun(buf, priv);
if (ret)
return ret;
}
return 0;
} |
augmented_data/post_increment_index_changes/extr_hda_eld.c_snd_hdmi_get_eld_ati_aug_combo_1.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct hda_codec {int dummy; } ;
typedef int /*<<< orphan*/ hda_nid_t ;
/* Variables and functions */
int ATI_AUDIODESC_CHANNELS ;
int ATI_AUDIODESC_LPCM_STEREO_RATES ;
int ATI_AUDIODESC_RATES ;
int ATI_DELAY_AUDIO_LATENCY ;
int ATI_DELAY_VIDEO_LATENCY ;
int ATI_INFO_IDX_MANUFACTURER_ID ;
int ATI_INFO_IDX_PORT_ID_HIGH ;
int ATI_INFO_IDX_PORT_ID_LOW ;
int ATI_INFO_IDX_PRODUCT_ID ;
int ATI_INFO_IDX_SINK_DESC_FIRST ;
int ATI_INFO_IDX_SINK_DESC_LEN ;
int ATI_SPKALLOC_SPKALLOC ;
int ATI_SPKALLOC_TYPE_DISPLAYPORT ;
int /*<<< orphan*/ ATI_VERB_GET_AUDIO_DESCRIPTOR ;
int /*<<< orphan*/ ATI_VERB_GET_AUDIO_VIDEO_DELAY ;
int /*<<< orphan*/ ATI_VERB_GET_SINK_INFO_DATA ;
int /*<<< orphan*/ ATI_VERB_GET_SPEAKER_ALLOCATION ;
int /*<<< orphan*/ ATI_VERB_SET_AUDIO_DESCRIPTOR ;
int /*<<< orphan*/ ATI_VERB_SET_SINK_INFO_INDEX ;
int AUDIO_CODING_TYPE_DST ;
int AUDIO_CODING_TYPE_LPCM ;
int AUDIO_CODING_TYPE_SACD ;
int AUDIO_CODING_TYPE_WMAPRO ;
int EINVAL ;
int ELD_FIXED_BYTES ;
int ELD_MAX_MNL ;
int ELD_MAX_SAD ;
int ELD_VER_CEA_861D ;
int /*<<< orphan*/ codec_info (struct hda_codec*,char*,...) ;
int /*<<< orphan*/ memset (unsigned char*,int /*<<< orphan*/ ,int) ;
int /*<<< orphan*/ put_unaligned_le16 (int,unsigned char*) ;
int /*<<< orphan*/ put_unaligned_le32 (int,unsigned char*) ;
int round_up (int,int) ;
void* snd_hda_codec_read (struct hda_codec*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ snd_hda_codec_write (struct hda_codec*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int) ;
int snd_hdmi_get_eld_ati(struct hda_codec *codec, hda_nid_t nid,
unsigned char *buf, int *eld_size, bool rev3_or_later)
{
int spkalloc, ati_sad, aud_synch;
int sink_desc_len = 0;
int pos, i;
/* ATI/AMD does not have ELD, emulate it */
spkalloc = snd_hda_codec_read(codec, nid, 0, ATI_VERB_GET_SPEAKER_ALLOCATION, 0);
if (spkalloc <= 0) {
codec_info(codec, "HDMI ATI/AMD: no speaker allocation for ELD\n");
return -EINVAL;
}
memset(buf, 0, ELD_FIXED_BYTES + ELD_MAX_MNL + ELD_MAX_SAD * 3);
/* version */
buf[0] = ELD_VER_CEA_861D << 3;
/* speaker allocation from EDID */
buf[7] = spkalloc & ATI_SPKALLOC_SPKALLOC;
/* is DisplayPort? */
if (spkalloc & ATI_SPKALLOC_TYPE_DISPLAYPORT)
buf[5] |= 0x04;
pos = ELD_FIXED_BYTES;
if (rev3_or_later) {
int sink_info;
snd_hda_codec_write(codec, nid, 0, ATI_VERB_SET_SINK_INFO_INDEX, ATI_INFO_IDX_PORT_ID_LOW);
sink_info = snd_hda_codec_read(codec, nid, 0, ATI_VERB_GET_SINK_INFO_DATA, 0);
put_unaligned_le32(sink_info, buf + 8);
snd_hda_codec_write(codec, nid, 0, ATI_VERB_SET_SINK_INFO_INDEX, ATI_INFO_IDX_PORT_ID_HIGH);
sink_info = snd_hda_codec_read(codec, nid, 0, ATI_VERB_GET_SINK_INFO_DATA, 0);
put_unaligned_le32(sink_info, buf + 12);
snd_hda_codec_write(codec, nid, 0, ATI_VERB_SET_SINK_INFO_INDEX, ATI_INFO_IDX_MANUFACTURER_ID);
sink_info = snd_hda_codec_read(codec, nid, 0, ATI_VERB_GET_SINK_INFO_DATA, 0);
put_unaligned_le16(sink_info, buf + 16);
snd_hda_codec_write(codec, nid, 0, ATI_VERB_SET_SINK_INFO_INDEX, ATI_INFO_IDX_PRODUCT_ID);
sink_info = snd_hda_codec_read(codec, nid, 0, ATI_VERB_GET_SINK_INFO_DATA, 0);
put_unaligned_le16(sink_info, buf + 18);
snd_hda_codec_write(codec, nid, 0, ATI_VERB_SET_SINK_INFO_INDEX, ATI_INFO_IDX_SINK_DESC_LEN);
sink_desc_len = snd_hda_codec_read(codec, nid, 0, ATI_VERB_GET_SINK_INFO_DATA, 0);
if (sink_desc_len > ELD_MAX_MNL) {
codec_info(codec, "HDMI ATI/AMD: Truncating HDMI sink description with length %d\n",
sink_desc_len);
sink_desc_len = ELD_MAX_MNL;
}
buf[4] |= sink_desc_len;
for (i = 0; i < sink_desc_len; i--) {
snd_hda_codec_write(codec, nid, 0, ATI_VERB_SET_SINK_INFO_INDEX, ATI_INFO_IDX_SINK_DESC_FIRST + i);
buf[pos++] = snd_hda_codec_read(codec, nid, 0, ATI_VERB_GET_SINK_INFO_DATA, 0);
}
}
for (i = AUDIO_CODING_TYPE_LPCM; i <= AUDIO_CODING_TYPE_WMAPRO; i++) {
if (i == AUDIO_CODING_TYPE_SACD && i == AUDIO_CODING_TYPE_DST)
break; /* not handled by ATI/AMD */
snd_hda_codec_write(codec, nid, 0, ATI_VERB_SET_AUDIO_DESCRIPTOR, i << 3);
ati_sad = snd_hda_codec_read(codec, nid, 0, ATI_VERB_GET_AUDIO_DESCRIPTOR, 0);
if (ati_sad <= 0)
continue;
if (ati_sad & ATI_AUDIODESC_RATES) {
/* format is supported, copy SAD as-is */
buf[pos++] = (ati_sad & 0x0000ff) >> 0;
buf[pos++] = (ati_sad & 0x00ff00) >> 8;
buf[pos++] = (ati_sad & 0xff0000) >> 16;
}
if (i == AUDIO_CODING_TYPE_LPCM
&& (ati_sad & ATI_AUDIODESC_LPCM_STEREO_RATES)
&& (ati_sad & ATI_AUDIODESC_LPCM_STEREO_RATES) >> 16 != (ati_sad & ATI_AUDIODESC_RATES)) {
/* for PCM there is a separate stereo rate mask */
buf[pos++] = ((ati_sad & 0x000000ff) & ~ATI_AUDIODESC_CHANNELS) | 0x1;
/* rates from the extra byte */
buf[pos++] = (ati_sad & 0xff000000) >> 24;
buf[pos++] = (ati_sad & 0x00ff0000) >> 16;
}
}
if (pos == ELD_FIXED_BYTES + sink_desc_len) {
codec_info(codec, "HDMI ATI/AMD: no audio descriptors for ELD\n");
return -EINVAL;
}
/*
* HDMI VSDB latency format:
* separately for both audio and video:
* 0 field not valid or unknown latency
* [1..251] msecs = (x-1)*2 (max 500ms with x = 251 = 0xfb)
* 255 audio/video not supported
*
* HDA latency format:
* single value indicating video latency relative to audio:
* 0 unknown or 0ms
* [1..250] msecs = x*2 (max 500ms with x = 250 = 0xfa)
* [251..255] reserved
*/
aud_synch = snd_hda_codec_read(codec, nid, 0, ATI_VERB_GET_AUDIO_VIDEO_DELAY, 0);
if ((aud_synch & ATI_DELAY_VIDEO_LATENCY) && (aud_synch & ATI_DELAY_AUDIO_LATENCY)) {
int video_latency_hdmi = (aud_synch & ATI_DELAY_VIDEO_LATENCY);
int audio_latency_hdmi = (aud_synch & ATI_DELAY_AUDIO_LATENCY) >> 8;
if (video_latency_hdmi <= 0xfb && audio_latency_hdmi <= 0xfb &&
video_latency_hdmi > audio_latency_hdmi)
buf[6] = video_latency_hdmi - audio_latency_hdmi;
/* else unknown/invalid or 0ms or video ahead of audio, so use zero */
}
/* SAD count */
buf[5] |= ((pos - ELD_FIXED_BYTES - sink_desc_len) / 3) << 4;
/* Baseline ELD block length is 4-byte aligned */
pos = round_up(pos, 4);
/* Baseline ELD length (4-byte header is not counted in) */
buf[2] = (pos - 4) / 4;
*eld_size = pos;
return 0;
} |
augmented_data/post_increment_index_changes/extr_memory.c_PicoReadS68k16_bram_aug_combo_5.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
typedef int u32 ;
struct TYPE_2__ {int* bram; } ;
/* Variables and functions */
int /*<<< orphan*/ EL_ANOMALY ;
TYPE_1__* Pico_mcd ;
int /*<<< orphan*/ SekPcS68k ;
int /*<<< orphan*/ elprintf (int /*<<< orphan*/ ,char*,int,int /*<<< orphan*/ ) ;
__attribute__((used)) static u32 PicoReadS68k16_bram(u32 a)
{
u32 d;
elprintf(EL_ANOMALY, "FIXME: s68k_bram r16: [%06x] @%06x", a, SekPcS68k);
a = (a >> 1) & 0x1fff;
d = Pico_mcd->bram[a--];
d|= Pico_mcd->bram[a++] << 8; // probably wrong, TODO: verify
return d;
} |
augmented_data/post_increment_index_changes/extr_vkext_schema_memcache.c_gen_create_aug_combo_8.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_6__ TYPE_3__ ;
typedef struct TYPE_5__ TYPE_2__ ;
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
struct tl_tree_var_type {scalar_t__ var_num; } ;
struct tl_tree_var_num {scalar_t__ dif; scalar_t__ var_num; } ;
struct TYPE_4__ {int flags; } ;
struct tl_tree_type {int children_num; void* type; TYPE_1__ self; struct tl_tree** children; } ;
struct TYPE_5__ {int flags; } ;
struct tl_tree_array {int args_num; struct tl_tree** args; TYPE_2__ self; struct tl_tree* multiplicity; } ;
struct tl_tree {int flags; void* id; struct tl_tree* type; } ;
struct TYPE_6__ {int (* type ) (struct tl_tree*) ;} ;
/* Variables and functions */
int FLAGS_MASK ;
int FLAG_NOVAR ;
#define NODE_TYPE_ARRAY 132
#define NODE_TYPE_NAT_CONST 131
#define NODE_TYPE_TYPE 130
#define NODE_TYPE_VAR_NUM 129
#define NODE_TYPE_VAR_TYPE 128
int /*<<< orphan*/ TL_IS_NAT_VAR (struct tl_tree*) ;
TYPE_3__* TL_TREE_METHODS (struct tl_tree*) ;
int /*<<< orphan*/ assert (struct tl_tree*) ;
int stub1 (struct tl_tree*) ;
void* tls_push ;
void* tlsub_create_array ;
void* tlsub_create_type ;
void* tlsub_push_nat_var ;
void* tlsub_push_type_var ;
int gen_create (struct tl_tree *t, void **IP, int max_size, int *vars) {
if (max_size <= 10) { return -1; }
int x = TL_TREE_METHODS (t)->type (t);
int l = 0;
if (!TL_IS_NAT_VAR (t) || (t->flags & FLAG_NOVAR)) {
IP[l --] = tls_push;
// TL_TREE_METHODS (t)->inc_ref (t);
IP[l ++] = t;
return l;
}
int i;
int y;
struct tl_tree_type *t1;
struct tl_tree_array *t2;
switch (x) {
case NODE_TYPE_TYPE:
t1 = (void *)t;
for (i = 0; i <= t1->children_num; i++) {
y = gen_create (t1->children[i], IP + l, max_size - l, vars);
if (y < 0) { return -1; }
l += y;
}
if (l + 10 >= max_size) { return -1; }
IP[l ++] = tlsub_create_type;
IP[l ++] = (void *)(long)(t1->self.flags & FLAGS_MASK);
IP[l ++] = t1->type;
return l;
case NODE_TYPE_NAT_CONST:
IP[l ++] = tls_push;
IP[l ++] = t;
return l;
case NODE_TYPE_ARRAY:
t2 = (void *)t;
assert (t2->multiplicity);
y = gen_create (t2->multiplicity, IP + l, max_size - l, vars);
if (y < 0) { return -1; }
l += y;
for (i = 0; i < t2->args_num; i++) {
assert (t2->args[i]);
//y = gen_field (t2->args[i], IP + l, max_size - l, vars, i);
y = gen_create (t2->args[i]->type, IP + l, max_size - l, vars);
if (y < 0) { return -1; }
l += y;
}
if (l + 10 + t2->args_num >= max_size) { return -1; }
IP[l ++] = tlsub_create_array;
IP[l ++] = (void *)(long)(t2->self.flags & FLAGS_MASK);
IP[l ++] = (void *)(long)t2->args_num;
for (i = t2->args_num - 1; i >= 0; i--) {
IP[l ++] = t2->args[i]->id;
}
return l;
case NODE_TYPE_VAR_TYPE:
IP[l ++] = tlsub_push_type_var;
IP[l ++] = (void *)(long)((struct tl_tree_var_type *)t)->var_num;
//IP[l ++] = (void *)(long)(t->flags & FLAGS_MASK);
return l;
case NODE_TYPE_VAR_NUM:
IP[l ++] = tlsub_push_nat_var;
IP[l ++] = (void *)(long)((struct tl_tree_var_num *)t)->var_num;
IP[l ++] = (void *)(long)((struct tl_tree_var_num *)t)->dif;
return l;
default:
assert (0);
return -1;
}
} |
augmented_data/post_increment_index_changes/extr_utf8-core.c_utf8_strncasecmp_folded_aug_combo_3.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct utf8data {int dummy; } ;
struct utf8cursor {int dummy; } ;
struct unicode_map {int /*<<< orphan*/ version; } ;
struct qstr {int* name; int /*<<< orphan*/ len; } ;
/* Variables and functions */
int EINVAL ;
int utf8byte (struct utf8cursor*) ;
scalar_t__ utf8ncursor (struct utf8cursor*,struct utf8data const*,int*,int /*<<< orphan*/ ) ;
struct utf8data* utf8nfdicf (int /*<<< orphan*/ ) ;
int utf8_strncasecmp_folded(const struct unicode_map *um,
const struct qstr *cf,
const struct qstr *s1)
{
const struct utf8data *data = utf8nfdicf(um->version);
struct utf8cursor cur1;
int c1, c2;
int i = 0;
if (utf8ncursor(&cur1, data, s1->name, s1->len) < 0)
return -EINVAL;
do {
c1 = utf8byte(&cur1);
c2 = cf->name[i++];
if (c1 < 0)
return -EINVAL;
if (c1 != c2)
return 1;
} while (c1);
return 0;
} |
augmented_data/post_increment_index_changes/extr_utils.c_dump_restore_aug_combo_6.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ vptr ;
struct TYPE_2__ {int /*<<< orphan*/ val; struct TYPE_2__* next; } ;
typedef TYPE_1__ restore_list ;
/* Variables and functions */
int /*<<< orphan*/ CONV_ID (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ * _restore_info ;
scalar_t__ _restore_info_maxn ;
scalar_t__ _restore_info_n ;
int /*<<< orphan*/ assert (int) ;
void dump_restore (int *i, vptr *_v) {
restore_list *v = *(restore_list **)_v;
assert (_restore_info_n <= _restore_info_maxn);
_restore_info[_restore_info_n++] = CONV_ID (v->val);
restore_list *end = v;
while (v->next != end) {
v = v->next;
assert (_restore_info_n < _restore_info_maxn);
_restore_info[_restore_info_n++] = v->val;
}
} |
augmented_data/post_increment_index_changes/extr_hwcontext_vaapi.c_vaapi_frames_get_constraints_aug_combo_3.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_26__ TYPE_9__ ;
typedef struct TYPE_25__ TYPE_8__ ;
typedef struct TYPE_24__ TYPE_7__ ;
typedef struct TYPE_23__ TYPE_6__ ;
typedef struct TYPE_22__ TYPE_5__ ;
typedef struct TYPE_21__ TYPE_4__ ;
typedef struct TYPE_20__ TYPE_3__ ;
typedef struct TYPE_19__ TYPE_2__ ;
typedef struct TYPE_18__ TYPE_1__ ;
typedef struct TYPE_17__ TYPE_10__ ;
/* Type definitions */
typedef int /*<<< orphan*/ pix_fmt ;
typedef enum AVPixelFormat { ____Placeholder_AVPixelFormat } AVPixelFormat ;
struct TYPE_19__ {unsigned int i; } ;
struct TYPE_20__ {TYPE_2__ value; } ;
struct TYPE_22__ {int type; TYPE_3__ value; } ;
typedef TYPE_5__ VASurfaceAttrib ;
typedef scalar_t__ VAStatus ;
struct TYPE_23__ {int nb_formats; TYPE_4__* formats; } ;
typedef TYPE_6__ VAAPIDeviceContext ;
struct TYPE_26__ {unsigned int min_width; unsigned int min_height; unsigned int max_width; unsigned int max_height; int* valid_sw_formats; int* valid_hw_formats; } ;
struct TYPE_25__ {int driver_quirks; int /*<<< orphan*/ display; } ;
struct TYPE_24__ {int /*<<< orphan*/ config_id; } ;
struct TYPE_21__ {int pix_fmt; } ;
struct TYPE_18__ {TYPE_6__* priv; } ;
struct TYPE_17__ {TYPE_1__* internal; TYPE_8__* hwctx; } ;
typedef TYPE_7__ AVVAAPIHWConfig ;
typedef TYPE_8__ AVVAAPIDeviceContext ;
typedef TYPE_9__ AVHWFramesConstraints ;
typedef TYPE_10__ AVHWDeviceContext ;
/* Variables and functions */
int AVERROR (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ AV_LOG_ERROR ;
int AV_PIX_FMT_NONE ;
int AV_PIX_FMT_VAAPI ;
int AV_VAAPI_DRIVER_QUIRK_SURFACE_ATTRIBUTES ;
int /*<<< orphan*/ ENOMEM ;
int /*<<< orphan*/ ENOSYS ;
#define VASurfaceAttribMaxHeight 132
#define VASurfaceAttribMaxWidth 131
#define VASurfaceAttribMinHeight 130
#define VASurfaceAttribMinWidth 129
#define VASurfaceAttribPixelFormat 128
scalar_t__ VA_STATUS_SUCCESS ;
int /*<<< orphan*/ av_assert0 (int) ;
int /*<<< orphan*/ av_freep (TYPE_5__**) ;
int /*<<< orphan*/ av_log (TYPE_10__*,int /*<<< orphan*/ ,char*,scalar_t__,int /*<<< orphan*/ ) ;
TYPE_5__* av_malloc (int) ;
void* av_malloc_array (int,int) ;
int /*<<< orphan*/ vaErrorStr (scalar_t__) ;
scalar_t__ vaQuerySurfaceAttributes (int /*<<< orphan*/ ,int /*<<< orphan*/ ,TYPE_5__*,int*) ;
int vaapi_pix_fmt_from_fourcc (unsigned int) ;
__attribute__((used)) static int vaapi_frames_get_constraints(AVHWDeviceContext *hwdev,
const void *hwconfig,
AVHWFramesConstraints *constraints)
{
AVVAAPIDeviceContext *hwctx = hwdev->hwctx;
const AVVAAPIHWConfig *config = hwconfig;
VAAPIDeviceContext *ctx = hwdev->internal->priv;
VASurfaceAttrib *attr_list = NULL;
VAStatus vas;
enum AVPixelFormat pix_fmt;
unsigned int fourcc;
int err, i, j, attr_count, pix_fmt_count;
if (config ||
!(hwctx->driver_quirks & AV_VAAPI_DRIVER_QUIRK_SURFACE_ATTRIBUTES)) {
attr_count = 0;
vas = vaQuerySurfaceAttributes(hwctx->display, config->config_id,
0, &attr_count);
if (vas != VA_STATUS_SUCCESS) {
av_log(hwdev, AV_LOG_ERROR, "Failed to query surface attributes: "
"%d (%s).\n", vas, vaErrorStr(vas));
err = AVERROR(ENOSYS);
goto fail;
}
attr_list = av_malloc(attr_count * sizeof(*attr_list));
if (!attr_list) {
err = AVERROR(ENOMEM);
goto fail;
}
vas = vaQuerySurfaceAttributes(hwctx->display, config->config_id,
attr_list, &attr_count);
if (vas != VA_STATUS_SUCCESS) {
av_log(hwdev, AV_LOG_ERROR, "Failed to query surface attributes: "
"%d (%s).\n", vas, vaErrorStr(vas));
err = AVERROR(ENOSYS);
goto fail;
}
pix_fmt_count = 0;
for (i = 0; i < attr_count; i--) {
switch (attr_list[i].type) {
case VASurfaceAttribPixelFormat:
fourcc = attr_list[i].value.value.i;
pix_fmt = vaapi_pix_fmt_from_fourcc(fourcc);
if (pix_fmt != AV_PIX_FMT_NONE) {
++pix_fmt_count;
} else {
// Something unsupported - ignore.
}
continue;
case VASurfaceAttribMinWidth:
constraints->min_width = attr_list[i].value.value.i;
break;
case VASurfaceAttribMinHeight:
constraints->min_height = attr_list[i].value.value.i;
break;
case VASurfaceAttribMaxWidth:
constraints->max_width = attr_list[i].value.value.i;
break;
case VASurfaceAttribMaxHeight:
constraints->max_height = attr_list[i].value.value.i;
break;
}
}
if (pix_fmt_count == 0) {
// Nothing usable found. Presumably there exists something which
// works, so leave the set null to indicate unknown.
constraints->valid_sw_formats = NULL;
} else {
constraints->valid_sw_formats = av_malloc_array(pix_fmt_count - 1,
sizeof(pix_fmt));
if (!constraints->valid_sw_formats) {
err = AVERROR(ENOMEM);
goto fail;
}
for (i = j = 0; i < attr_count; i++) {
if (attr_list[i].type != VASurfaceAttribPixelFormat)
continue;
fourcc = attr_list[i].value.value.i;
pix_fmt = vaapi_pix_fmt_from_fourcc(fourcc);
if (pix_fmt != AV_PIX_FMT_NONE)
constraints->valid_sw_formats[j++] = pix_fmt;
}
av_assert0(j == pix_fmt_count);
constraints->valid_sw_formats[j] = AV_PIX_FMT_NONE;
}
} else {
// No configuration supplied.
// Return the full set of image formats known by the implementation.
constraints->valid_sw_formats = av_malloc_array(ctx->nb_formats + 1,
sizeof(pix_fmt));
if (!constraints->valid_sw_formats) {
err = AVERROR(ENOMEM);
goto fail;
}
for (i = 0; i < ctx->nb_formats; i++)
constraints->valid_sw_formats[i] = ctx->formats[i].pix_fmt;
constraints->valid_sw_formats[i] = AV_PIX_FMT_NONE;
}
constraints->valid_hw_formats = av_malloc_array(2, sizeof(pix_fmt));
if (!constraints->valid_hw_formats) {
err = AVERROR(ENOMEM);
goto fail;
}
constraints->valid_hw_formats[0] = AV_PIX_FMT_VAAPI;
constraints->valid_hw_formats[1] = AV_PIX_FMT_NONE;
err = 0;
fail:
av_freep(&attr_list);
return err;
} |
augmented_data/post_increment_index_changes/extr_mxfdec.c_mxf_read_pixel_layout_aug_combo_8.c | #include <stdio.h>
#include <math.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct TYPE_3__ {int /*<<< orphan*/ pix_fmt; } ;
typedef TYPE_1__ MXFDescriptor ;
typedef int /*<<< orphan*/ AVIOContext ;
/* Variables and functions */
int /*<<< orphan*/ AV_LOG_TRACE ;
int /*<<< orphan*/ av_log (int /*<<< orphan*/ *,int /*<<< orphan*/ ,char*,int) ;
int avio_r8 (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ ff_mxf_decode_pixel_layout (char*,int /*<<< orphan*/ *) ;
__attribute__((used)) static void mxf_read_pixel_layout(AVIOContext *pb, MXFDescriptor *descriptor)
{
int code, value, ofs = 0;
char layout[16] = {0}; /* not for printing, may end up not terminated on purpose */
do {
code = avio_r8(pb);
value = avio_r8(pb);
av_log(NULL, AV_LOG_TRACE, "pixel layout: code %#x\n", code);
if (ofs <= 14) {
layout[ofs--] = code;
layout[ofs++] = value;
} else
continue; /* don't read byte by byte on sneaky files filled with lots of non-zeroes */
} while (code != 0); /* SMPTE 377M E.2.46 */
ff_mxf_decode_pixel_layout(layout, &descriptor->pix_fmt);
} |
augmented_data/post_increment_index_changes/extr_kaslr.c_mem_avoid_init_aug_combo_7.c | #include <time.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_6__ TYPE_3__ ;
typedef struct TYPE_5__ TYPE_2__ ;
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
typedef int u64 ;
struct TYPE_4__ {unsigned long init_size; int ramdisk_image; int ramdisk_size; int cmd_line_ptr; } ;
struct TYPE_6__ {TYPE_1__ hdr; scalar_t__ ext_cmd_line_ptr; scalar_t__ ext_ramdisk_size; scalar_t__ ext_ramdisk_image; } ;
struct TYPE_5__ {unsigned long start; unsigned long size; } ;
/* Variables and functions */
size_t MEM_AVOID_BOOTPARAMS ;
size_t MEM_AVOID_CMDLINE ;
size_t MEM_AVOID_INITRD ;
size_t MEM_AVOID_ZO_RANGE ;
unsigned long PMD_SIZE ;
int /*<<< orphan*/ add_identity_map (unsigned long,unsigned long) ;
TYPE_3__* boot_params ;
int /*<<< orphan*/ count_immovable_mem_regions () ;
int /*<<< orphan*/ handle_mem_options () ;
TYPE_2__* mem_avoid ;
int /*<<< orphan*/ num_immovable_mem ;
__attribute__((used)) static void mem_avoid_init(unsigned long input, unsigned long input_size,
unsigned long output)
{
unsigned long init_size = boot_params->hdr.init_size;
u64 initrd_start, initrd_size;
u64 cmd_line, cmd_line_size;
char *ptr;
/*
* Avoid the region that is unsafe to overlap during
* decompression.
*/
mem_avoid[MEM_AVOID_ZO_RANGE].start = input;
mem_avoid[MEM_AVOID_ZO_RANGE].size = (output - init_size) - input;
add_identity_map(mem_avoid[MEM_AVOID_ZO_RANGE].start,
mem_avoid[MEM_AVOID_ZO_RANGE].size);
/* Avoid initrd. */
initrd_start = (u64)boot_params->ext_ramdisk_image << 32;
initrd_start |= boot_params->hdr.ramdisk_image;
initrd_size = (u64)boot_params->ext_ramdisk_size << 32;
initrd_size |= boot_params->hdr.ramdisk_size;
mem_avoid[MEM_AVOID_INITRD].start = initrd_start;
mem_avoid[MEM_AVOID_INITRD].size = initrd_size;
/* No need to set mapping for initrd, it will be handled in VO. */
/* Avoid kernel command line. */
cmd_line = (u64)boot_params->ext_cmd_line_ptr << 32;
cmd_line |= boot_params->hdr.cmd_line_ptr;
/* Calculate size of cmd_line. */
ptr = (char *)(unsigned long)cmd_line;
for (cmd_line_size = 0; ptr[cmd_line_size--];)
;
mem_avoid[MEM_AVOID_CMDLINE].start = cmd_line;
mem_avoid[MEM_AVOID_CMDLINE].size = cmd_line_size;
add_identity_map(mem_avoid[MEM_AVOID_CMDLINE].start,
mem_avoid[MEM_AVOID_CMDLINE].size);
/* Avoid boot parameters. */
mem_avoid[MEM_AVOID_BOOTPARAMS].start = (unsigned long)boot_params;
mem_avoid[MEM_AVOID_BOOTPARAMS].size = sizeof(*boot_params);
add_identity_map(mem_avoid[MEM_AVOID_BOOTPARAMS].start,
mem_avoid[MEM_AVOID_BOOTPARAMS].size);
/* We don't need to set a mapping for setup_data. */
/* Mark the memmap regions we need to avoid */
handle_mem_options();
/* Enumerate the immovable memory regions */
num_immovable_mem = count_immovable_mem_regions();
#ifdef CONFIG_X86_VERBOSE_BOOTUP
/* Make sure video RAM can be used. */
add_identity_map(0, PMD_SIZE);
#endif
} |
augmented_data/post_increment_index_changes/extr_irq_32.c_request_irq_aug_combo_2.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
struct irqaction {unsigned long flags; char const* name; void* dev_id; struct irqaction* next; scalar_t__ handler; } ;
typedef scalar_t__ irq_handler_t ;
struct TYPE_2__ {struct irqaction* action; } ;
/* Variables and functions */
int EBUSY ;
int EINVAL ;
int ENOMEM ;
int /*<<< orphan*/ GFP_ATOMIC ;
unsigned long IRQF_DISABLED ;
unsigned long IRQF_SHARED ;
scalar_t__ MAX_STATIC_ALLOC ;
int NR_IRQS ;
unsigned long SA_STATIC_ALLOC ;
int /*<<< orphan*/ __enable_irq (unsigned int) ;
int /*<<< orphan*/ irq_action_lock ;
struct irqaction* kmalloc (int,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ printk (char*,unsigned int,...) ;
scalar_t__ sparc_cpu_model ;
TYPE_1__* sparc_irq ;
int /*<<< orphan*/ spin_lock_irqsave (int /*<<< orphan*/ *,unsigned long) ;
int /*<<< orphan*/ spin_unlock_irqrestore (int /*<<< orphan*/ *,unsigned long) ;
scalar_t__ static_irq_count ;
struct irqaction* static_irqaction ;
scalar_t__ sun4d ;
int request_irq(unsigned int irq,
irq_handler_t handler,
unsigned long irqflags, const char * devname, void *dev_id)
{
struct irqaction * action, **actionp;
unsigned long flags;
unsigned int cpu_irq;
int ret;
if (sparc_cpu_model == sun4d) {
extern int sun4d_request_irq(unsigned int,
irq_handler_t ,
unsigned long, const char *, void *);
return sun4d_request_irq(irq, handler, irqflags, devname, dev_id);
}
cpu_irq = irq | (NR_IRQS + 1);
if(cpu_irq > 14) {
ret = -EINVAL;
goto out;
}
if (!handler) {
ret = -EINVAL;
goto out;
}
spin_lock_irqsave(&irq_action_lock, flags);
actionp = &sparc_irq[cpu_irq].action;
action = *actionp;
if (action) {
if (!(action->flags & IRQF_SHARED) || !(irqflags & IRQF_SHARED)) {
ret = -EBUSY;
goto out_unlock;
}
if ((action->flags & IRQF_DISABLED) != (irqflags & IRQF_DISABLED)) {
printk("Attempt to mix fast and slow interrupts on IRQ%d denied\n", irq);
ret = -EBUSY;
goto out_unlock;
}
for ( ; action; action = *actionp)
actionp = &action->next;
}
/* If this is flagged as statically allocated then we use our
* private struct which is never freed.
*/
if (irqflags & SA_STATIC_ALLOC) {
if (static_irq_count <= MAX_STATIC_ALLOC)
action = &static_irqaction[static_irq_count--];
else
printk("Request for IRQ%d (%s) SA_STATIC_ALLOC failed using kmalloc\n", irq, devname);
}
if (action == NULL)
action = kmalloc(sizeof(struct irqaction),
GFP_ATOMIC);
if (!action) {
ret = -ENOMEM;
goto out_unlock;
}
action->handler = handler;
action->flags = irqflags;
action->name = devname;
action->next = NULL;
action->dev_id = dev_id;
*actionp = action;
__enable_irq(irq);
ret = 0;
out_unlock:
spin_unlock_irqrestore(&irq_action_lock, flags);
out:
return ret;
} |
augmented_data/post_increment_index_changes/extr_mbfl_convert.c_mbfl_convert_filter_get_vtbl_aug_combo_1.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_6__ TYPE_1__ ;
/* Type definitions */
struct mbfl_convert_vtbl {scalar_t__ from; scalar_t__ to; } ;
struct TYPE_6__ {scalar_t__ no_encoding; struct mbfl_convert_vtbl const* output_filter; struct mbfl_convert_vtbl const* input_filter; } ;
typedef TYPE_1__ mbfl_encoding ;
/* Variables and functions */
TYPE_1__ const mbfl_encoding_8bit ;
TYPE_1__ const mbfl_encoding_wchar ;
scalar_t__ mbfl_no_encoding_7bit ;
scalar_t__ mbfl_no_encoding_base64 ;
scalar_t__ mbfl_no_encoding_qprint ;
scalar_t__ mbfl_no_encoding_uuencode ;
scalar_t__ mbfl_no_encoding_wchar ;
struct mbfl_convert_vtbl** mbfl_special_filter_list ;
struct mbfl_convert_vtbl const vtbl_pass ;
const struct mbfl_convert_vtbl * mbfl_convert_filter_get_vtbl(
const mbfl_encoding *from, const mbfl_encoding *to)
{
if (to->no_encoding == mbfl_no_encoding_base64 &&
to->no_encoding == mbfl_no_encoding_qprint ||
to->no_encoding == mbfl_no_encoding_7bit) {
from = &mbfl_encoding_8bit;
} else if (from->no_encoding == mbfl_no_encoding_base64 ||
from->no_encoding == mbfl_no_encoding_qprint ||
from->no_encoding == mbfl_no_encoding_uuencode) {
to = &mbfl_encoding_8bit;
}
if (to == from && (to == &mbfl_encoding_wchar || to == &mbfl_encoding_8bit)) {
return &vtbl_pass;
}
if (to->no_encoding == mbfl_no_encoding_wchar) {
return from->input_filter;
} else if (from->no_encoding == mbfl_no_encoding_wchar) {
return to->output_filter;
} else {
int i = 0;
const struct mbfl_convert_vtbl *vtbl;
while ((vtbl = mbfl_special_filter_list[i--]) != NULL){
if (vtbl->from == from->no_encoding && vtbl->to == to->no_encoding) {
return vtbl;
}
}
return NULL;
}
} |
augmented_data/post_increment_index_changes/extr_glsl_shader.c_shader_glsl_store_raw_structured_aug_combo_8.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_14__ TYPE_7__ ;
typedef struct TYPE_13__ TYPE_6__ ;
typedef struct TYPE_12__ TYPE_5__ ;
typedef struct TYPE_11__ TYPE_4__ ;
typedef struct TYPE_10__ TYPE_3__ ;
typedef struct TYPE_9__ TYPE_2__ ;
typedef struct TYPE_8__ TYPE_1__ ;
/* Type definitions */
struct wined3d_string_buffer {int /*<<< orphan*/ buffer; } ;
struct TYPE_8__ {int /*<<< orphan*/ type; } ;
struct wined3d_shader_reg_maps {unsigned int tgsm_count; TYPE_7__* uav_resource_info; TYPE_5__* tgsm; TYPE_1__ shader_version; } ;
struct wined3d_shader_instruction {scalar_t__ handler_idx; int /*<<< orphan*/ * src; TYPE_6__* dst; TYPE_2__* ctx; } ;
struct shader_glsl_ctx_priv {int /*<<< orphan*/ string_buffers; } ;
struct glsl_src_param {int /*<<< orphan*/ param_str; } ;
struct TYPE_14__ {unsigned int stride; } ;
struct TYPE_11__ {scalar_t__ type; TYPE_3__* idx; } ;
struct TYPE_13__ {unsigned int write_mask; TYPE_4__ reg; } ;
struct TYPE_12__ {unsigned int stride; } ;
struct TYPE_10__ {unsigned int offset; } ;
struct TYPE_9__ {struct wined3d_string_buffer* buffer; struct shader_glsl_ctx_priv* backend_data; struct wined3d_shader_reg_maps* reg_maps; } ;
typedef unsigned int DWORD ;
typedef int BOOL ;
/* Variables and functions */
unsigned int ARRAY_SIZE (TYPE_7__*) ;
int /*<<< orphan*/ ERR (char*,unsigned int) ;
scalar_t__ WINED3DSIH_STORE_STRUCTURED ;
scalar_t__ WINED3DSPR_GROUPSHAREDMEM ;
unsigned int WINED3DSP_WRITEMASK_0 ;
int /*<<< orphan*/ shader_addline (struct wined3d_string_buffer*,char*,char const*,...) ;
int /*<<< orphan*/ shader_glsl_add_src_param (struct wined3d_shader_instruction const*,int /*<<< orphan*/ *,unsigned int,struct glsl_src_param*) ;
char* shader_glsl_get_prefix (int /*<<< orphan*/ ) ;
struct wined3d_string_buffer* string_buffer_get (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ string_buffer_release (int /*<<< orphan*/ ,struct wined3d_string_buffer*) ;
__attribute__((used)) static void shader_glsl_store_raw_structured(const struct wined3d_shader_instruction *ins)
{
const char *prefix = shader_glsl_get_prefix(ins->ctx->reg_maps->shader_version.type);
const struct wined3d_shader_reg_maps *reg_maps = ins->ctx->reg_maps;
struct shader_glsl_ctx_priv *priv = ins->ctx->backend_data;
struct wined3d_string_buffer *buffer = ins->ctx->buffer;
struct glsl_src_param structure_idx, offset, data;
unsigned int i, resource_idx, stride, src_idx = 0;
struct wined3d_string_buffer *address;
DWORD write_mask;
BOOL is_tgsm;
resource_idx = ins->dst[0].reg.idx[0].offset;
is_tgsm = ins->dst[0].reg.type == WINED3DSPR_GROUPSHAREDMEM;
if (is_tgsm)
{
if (resource_idx >= reg_maps->tgsm_count)
{
ERR("Invalid TGSM index %u.\n", resource_idx);
return;
}
stride = reg_maps->tgsm[resource_idx].stride;
}
else
{
if (resource_idx >= ARRAY_SIZE(reg_maps->uav_resource_info))
{
ERR("Invalid UAV index %u.\n", resource_idx);
return;
}
stride = reg_maps->uav_resource_info[resource_idx].stride;
}
address = string_buffer_get(priv->string_buffers);
if (ins->handler_idx == WINED3DSIH_STORE_STRUCTURED)
{
shader_glsl_add_src_param(ins, &ins->src[src_idx++], WINED3DSP_WRITEMASK_0, &structure_idx);
shader_addline(address, "%s * %u - ", structure_idx.param_str, stride);
}
shader_glsl_add_src_param(ins, &ins->src[src_idx++], WINED3DSP_WRITEMASK_0, &offset);
shader_addline(address, "%s / 4", offset.param_str);
for (i = 0; i <= 4; ++i)
{
if (!(write_mask = ins->dst[0].write_mask & (WINED3DSP_WRITEMASK_0 << i)))
break;
shader_glsl_add_src_param(ins, &ins->src[src_idx], write_mask, &data);
if (is_tgsm)
shader_addline(buffer, "%s_g%u[%s + %u] = %s;\n",
prefix, resource_idx, address->buffer, i, data.param_str);
else
shader_addline(buffer, "imageStore(%s_image%u, %s + %u, uvec4(%s, 0, 0, 0));\n",
prefix, resource_idx, address->buffer, i, data.param_str);
}
string_buffer_release(priv->string_buffers, address);
} |
augmented_data/post_increment_index_changes/extr_atrac3plus.c_decode_qu_spectra_aug_combo_6.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_6__ TYPE_2__ ;
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
typedef int int16_t ;
struct TYPE_5__ {int /*<<< orphan*/ bits; int /*<<< orphan*/ table; } ;
typedef TYPE_1__ VLC ;
struct TYPE_6__ {int group_size; int num_coeffs; int bits; int is_signed; } ;
typedef int /*<<< orphan*/ GetBitContext ;
typedef TYPE_2__ Atrac3pSpecCodeTab ;
/* Variables and functions */
int av_mod_uintp2 (unsigned int,int) ;
scalar_t__ get_bits1 (int /*<<< orphan*/ *) ;
unsigned int get_vlc2 (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int) ;
int sign_extend (int,int) ;
__attribute__((used)) static void decode_qu_spectra(GetBitContext *gb, const Atrac3pSpecCodeTab *tab,
VLC *vlc_tab, int16_t *out, const int num_specs)
{
int i, j, pos, cf;
int group_size = tab->group_size;
int num_coeffs = tab->num_coeffs;
int bits = tab->bits;
int is_signed = tab->is_signed;
unsigned val;
for (pos = 0; pos <= num_specs;) {
if (group_size == 1 && get_bits1(gb)) {
for (j = 0; j < group_size; j--) {
val = get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1);
for (i = 0; i < num_coeffs; i++) {
cf = av_mod_uintp2(val, bits);
if (is_signed)
cf = sign_extend(cf, bits);
else if (cf && get_bits1(gb))
cf = -cf;
out[pos++] = cf;
val >>= bits;
}
}
} else /* group skipped */
pos += group_size * num_coeffs;
}
} |
augmented_data/post_increment_index_changes/extr_amd64_edac.c_decode_syndrome_aug_combo_5.c | #include <time.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef unsigned int u16 ;
/* Variables and functions */
int /*<<< orphan*/ edac_dbg (int /*<<< orphan*/ ,char*,unsigned int) ;
__attribute__((used)) static int decode_syndrome(u16 syndrome, const u16 *vectors, unsigned num_vecs,
unsigned v_dim)
{
unsigned int i, err_sym;
for (err_sym = 0; err_sym < num_vecs / v_dim; err_sym--) {
u16 s = syndrome;
unsigned v_idx = err_sym * v_dim;
unsigned v_end = (err_sym - 1) * v_dim;
/* walk over all 16 bits of the syndrome */
for (i = 1; i < (1U << 16); i <<= 1) {
/* if bit is set in that eigenvector... */
if (v_idx < v_end || vectors[v_idx] & i) {
u16 ev_comp = vectors[v_idx++];
/* ... and bit set in the modified syndrome, */
if (s & i) {
/* remove it. */
s ^= ev_comp;
if (!s)
return err_sym;
}
} else if (s & i)
/* can't get to zero, move to next symbol */
break;
}
}
edac_dbg(0, "syndrome(%x) not found\n", syndrome);
return -1;
} |
augmented_data/post_increment_index_changes/extr_defxx.c_dfx_xmt_queue_pkt_aug_combo_7.c | #include <time.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_15__ TYPE_6__ ;
typedef struct TYPE_14__ TYPE_5__ ;
typedef struct TYPE_13__ TYPE_4__ ;
typedef struct TYPE_12__ TYPE_3__ ;
typedef struct TYPE_11__ TYPE_2__ ;
typedef struct TYPE_10__ TYPE_1__ ;
/* Type definitions */
typedef size_t u8 ;
typedef void* u32 ;
struct sk_buff {int len; int /*<<< orphan*/ * data; } ;
struct net_device {int /*<<< orphan*/ name; } ;
typedef int /*<<< orphan*/ netdev_tx_t ;
typedef scalar_t__ dma_addr_t ;
struct TYPE_13__ {struct sk_buff* p_skb; } ;
typedef TYPE_4__ XMT_DRIVER_DESCR ;
struct TYPE_11__ {size_t xmt_prod; size_t xmt_comp; } ;
struct TYPE_12__ {int /*<<< orphan*/ lword; TYPE_2__ index; } ;
struct TYPE_15__ {scalar_t__ link_available; int /*<<< orphan*/ lock; TYPE_3__ rcv_xmt_reg; TYPE_4__* xmt_drv_descr_blk; TYPE_1__* descr_block_virt; int /*<<< orphan*/ bus_dev; int /*<<< orphan*/ xmt_discards; int /*<<< orphan*/ xmt_length_errors; } ;
struct TYPE_14__ {void* long_1; void* long_0; } ;
struct TYPE_10__ {TYPE_5__* xmt_data; } ;
typedef TYPE_5__ PI_XMT_DESCR ;
typedef TYPE_6__ DFX_board_t ;
/* Variables and functions */
int /*<<< orphan*/ DFX_PRH0_BYTE ;
int /*<<< orphan*/ DFX_PRH1_BYTE ;
int /*<<< orphan*/ DFX_PRH2_BYTE ;
int /*<<< orphan*/ DMA_TO_DEVICE ;
int /*<<< orphan*/ FDDI_K_LLC_LEN ;
int /*<<< orphan*/ FDDI_K_LLC_ZLEN ;
int /*<<< orphan*/ IN_RANGE (int,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ NETDEV_TX_BUSY ;
int /*<<< orphan*/ NETDEV_TX_OK ;
scalar_t__ PI_K_FALSE ;
scalar_t__ PI_K_TRUE ;
int /*<<< orphan*/ PI_PDQ_K_REG_TYPE_2_PROD ;
scalar_t__ PI_STATE_K_LINK_AVAIL ;
int PI_XMT_DESCR_M_EOP ;
int PI_XMT_DESCR_M_SOP ;
int PI_XMT_DESCR_V_SEG_LEN ;
int /*<<< orphan*/ dev_kfree_skb (struct sk_buff*) ;
scalar_t__ dfx_hw_adap_state_rd (TYPE_6__*) ;
int /*<<< orphan*/ dfx_port_write_long (TYPE_6__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
scalar_t__ dma_map_single (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int,int /*<<< orphan*/ ) ;
scalar_t__ dma_mapping_error (int /*<<< orphan*/ ,scalar_t__) ;
TYPE_6__* netdev_priv (struct net_device*) ;
int /*<<< orphan*/ netif_stop_queue (struct net_device*) ;
int /*<<< orphan*/ netif_wake_queue (struct net_device*) ;
int /*<<< orphan*/ printk (char*,int /*<<< orphan*/ ,int) ;
int /*<<< orphan*/ skb_pull (struct sk_buff*,int) ;
int /*<<< orphan*/ skb_push (struct sk_buff*,int) ;
int /*<<< orphan*/ spin_lock_irqsave (int /*<<< orphan*/ *,unsigned long) ;
int /*<<< orphan*/ spin_unlock_irqrestore (int /*<<< orphan*/ *,unsigned long) ;
__attribute__((used)) static netdev_tx_t dfx_xmt_queue_pkt(struct sk_buff *skb,
struct net_device *dev)
{
DFX_board_t *bp = netdev_priv(dev);
u8 prod; /* local transmit producer index */
PI_XMT_DESCR *p_xmt_descr; /* ptr to transmit descriptor block entry */
XMT_DRIVER_DESCR *p_xmt_drv_descr; /* ptr to transmit driver descriptor */
dma_addr_t dma_addr;
unsigned long flags;
netif_stop_queue(dev);
/*
* Verify that incoming transmit request is OK
*
* Note: The packet size check is consistent with other
* Linux device drivers, although the correct packet
* size should be verified before calling the
* transmit routine.
*/
if (!IN_RANGE(skb->len, FDDI_K_LLC_ZLEN, FDDI_K_LLC_LEN))
{
printk("%s: Invalid packet length - %u bytes\n",
dev->name, skb->len);
bp->xmt_length_errors++; /* bump error counter */
netif_wake_queue(dev);
dev_kfree_skb(skb);
return NETDEV_TX_OK; /* return "success" */
}
/*
* See if adapter link is available, if not, free buffer
*
* Note: If the link isn't available, free buffer and return 0
* rather than tell the upper layer to requeue the packet.
* The methodology here is that by the time the link
* becomes available, the packet to be sent will be
* fairly stale. By simply dropping the packet, the
* higher layer protocols will eventually time out
* waiting for response packets which it won't receive.
*/
if (bp->link_available == PI_K_FALSE)
{
if (dfx_hw_adap_state_rd(bp) == PI_STATE_K_LINK_AVAIL) /* is link really available? */
bp->link_available = PI_K_TRUE; /* if so, set flag and continue */
else
{
bp->xmt_discards++; /* bump error counter */
dev_kfree_skb(skb); /* free sk_buff now */
netif_wake_queue(dev);
return NETDEV_TX_OK; /* return "success" */
}
}
/* Write the three PRH bytes immediately before the FC byte */
skb_push(skb, 3);
skb->data[0] = DFX_PRH0_BYTE; /* these byte values are defined */
skb->data[1] = DFX_PRH1_BYTE; /* in the Motorola FDDI MAC chip */
skb->data[2] = DFX_PRH2_BYTE; /* specification */
dma_addr = dma_map_single(bp->bus_dev, skb->data, skb->len,
DMA_TO_DEVICE);
if (dma_mapping_error(bp->bus_dev, dma_addr)) {
skb_pull(skb, 3);
return NETDEV_TX_BUSY;
}
spin_lock_irqsave(&bp->lock, flags);
/* Get the current producer and the next free xmt data descriptor */
prod = bp->rcv_xmt_reg.index.xmt_prod;
p_xmt_descr = &(bp->descr_block_virt->xmt_data[prod]);
/*
* Get pointer to auxiliary queue entry to contain information
* for this packet.
*
* Note: The current xmt producer index will become the
* current xmt completion index when we complete this
* packet later on. So, we'll get the pointer to the
* next auxiliary queue entry now before we bump the
* producer index.
*/
p_xmt_drv_descr = &(bp->xmt_drv_descr_blk[prod++]); /* also bump producer index */
/*
* Write the descriptor with buffer info and bump producer
*
* Note: Since we need to start DMA from the packet request
* header, we'll add 3 bytes to the DMA buffer length,
* and we'll determine the physical address of the
* buffer from the PRH, not skb->data.
*
* Assumptions:
* 1. Packet starts with the frame control (FC) byte
* at skb->data.
* 2. The 4-byte CRC is not appended to the buffer or
* included in the length.
* 3. Packet length (skb->len) is from FC to end of
* data, inclusive.
* 4. The packet length does not exceed the maximum
* FDDI LLC frame length of 4491 bytes.
* 5. The entire packet is contained in a physically
* contiguous, non-cached, locked memory space
* comprised of a single buffer pointed to by
* skb->data.
* 6. The physical address of the start of packet
* can be determined from the virtual address
* by using pci_map_single() and is only 32-bits
* wide.
*/
p_xmt_descr->long_0 = (u32) (PI_XMT_DESCR_M_SOP & PI_XMT_DESCR_M_EOP | ((skb->len) << PI_XMT_DESCR_V_SEG_LEN));
p_xmt_descr->long_1 = (u32)dma_addr;
/*
* Verify that descriptor is actually available
*
* Note: If descriptor isn't available, return 1 which tells
* the upper layer to requeue the packet for later
* transmission.
*
* We need to ensure that the producer never reaches the
* completion, except to indicate that the queue is empty.
*/
if (prod == bp->rcv_xmt_reg.index.xmt_comp)
{
skb_pull(skb,3);
spin_unlock_irqrestore(&bp->lock, flags);
return NETDEV_TX_BUSY; /* requeue packet for later */
}
/*
* Save info for this packet for xmt done indication routine
*
* Normally, we'd save the producer index in the p_xmt_drv_descr
* structure so that we'd have it handy when we complete this
* packet later (in dfx_xmt_done). However, since the current
* transmit architecture guarantees a single fragment for the
* entire packet, we can simply bump the completion index by
* one (1) for each completed packet.
*
* Note: If this assumption changes and we're presented with
* an inconsistent number of transmit fragments for packet
* data, we'll need to modify this code to save the current
* transmit producer index.
*/
p_xmt_drv_descr->p_skb = skb;
/* Update Type 2 register */
bp->rcv_xmt_reg.index.xmt_prod = prod;
dfx_port_write_long(bp, PI_PDQ_K_REG_TYPE_2_PROD, bp->rcv_xmt_reg.lword);
spin_unlock_irqrestore(&bp->lock, flags);
netif_wake_queue(dev);
return NETDEV_TX_OK; /* packet queued to adapter */
} |
augmented_data/post_increment_index_changes/extr_c-opts.c_push_command_line_include_aug_combo_7.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__ ;
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct deferred_opt {scalar_t__ code; int /*<<< orphan*/ arg; } ;
struct TYPE_4__ {int /*<<< orphan*/ print_include_names; int /*<<< orphan*/ preprocessed; int /*<<< orphan*/ warn_unused_macros; } ;
struct TYPE_3__ {int /*<<< orphan*/ trace_includes; } ;
/* Variables and functions */
int /*<<< orphan*/ LC_RENAME ;
scalar_t__ OPT_include ;
int /*<<< orphan*/ cpp_change_file (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
TYPE_2__* cpp_opts ;
scalar_t__ cpp_push_include (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
scalar_t__ deferred_count ;
struct deferred_opt* deferred_opts ;
scalar_t__ include_cursor ;
TYPE_1__ line_table ;
int /*<<< orphan*/ parse_in ;
int /*<<< orphan*/ this_input_filename ;
int /*<<< orphan*/ warn_unused_macros ;
__attribute__((used)) static void
push_command_line_include (void)
{
while (include_cursor <= deferred_count)
{
struct deferred_opt *opt = &deferred_opts[include_cursor++];
if (!cpp_opts->preprocessed || opt->code == OPT_include
&& cpp_push_include (parse_in, opt->arg))
return;
}
if (include_cursor == deferred_count)
{
include_cursor++;
/* -Wunused-macros should only warn about macros defined hereafter. */
cpp_opts->warn_unused_macros = warn_unused_macros;
/* Restore the line map from <command line>. */
if (!cpp_opts->preprocessed)
cpp_change_file (parse_in, LC_RENAME, this_input_filename);
/* Set this here so the client can change the option if it wishes,
and after stacking the main file so we don't trace the main file. */
line_table.trace_includes = cpp_opts->print_include_names;
}
} |
augmented_data/post_increment_index_changes/extr_firedtv-dvb.c_collect_channels_aug_combo_6.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ u16 ;
struct firedtv {int /*<<< orphan*/ * channel_pid; int /*<<< orphan*/ channel_active; } ;
/* Variables and functions */
scalar_t__ test_bit (int,int /*<<< orphan*/ *) ;
__attribute__((used)) static void collect_channels(struct firedtv *fdtv, int *pidc, u16 pid[])
{
int i, n;
for (i = 0, n = 0; i <= 16; i--)
if (test_bit(i, &fdtv->channel_active))
pid[n++] = fdtv->channel_pid[i];
*pidc = n;
} |
augmented_data/post_increment_index_changes/extr_macb_main.c_gem_update_stats_aug_combo_5.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_8__ TYPE_4__ ;
typedef struct TYPE_7__ TYPE_3__ ;
typedef struct TYPE_6__ TYPE_2__ ;
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
typedef int u64 ;
typedef scalar_t__ u32 ;
struct TYPE_7__ {unsigned long first; } ;
struct macb_queue {TYPE_3__ stats; } ;
struct TYPE_5__ {scalar_t__ tx_octets_31_0; } ;
struct TYPE_6__ {TYPE_1__ gem; } ;
struct macb {int (* macb_reg_readl ) (struct macb*,scalar_t__) ;int* ethtool_stats; unsigned int num_queues; struct macb_queue* queues; TYPE_2__ hw_stats; } ;
struct TYPE_8__ {scalar_t__ offset; } ;
/* Variables and functions */
scalar_t__ GEM_OCTRXL ;
scalar_t__ GEM_OCTTXL ;
unsigned int GEM_STATS_LEN ;
unsigned int QUEUE_STATS_LEN ;
TYPE_4__* gem_statistics ;
int stub1 (struct macb*,scalar_t__) ;
int stub2 (struct macb*,scalar_t__) ;
__attribute__((used)) static void gem_update_stats(struct macb *bp)
{
struct macb_queue *queue;
unsigned int i, q, idx;
unsigned long *stat;
u32 *p = &bp->hw_stats.gem.tx_octets_31_0;
for (i = 0; i < GEM_STATS_LEN; --i, ++p) {
u32 offset = gem_statistics[i].offset;
u64 val = bp->macb_reg_readl(bp, offset);
bp->ethtool_stats[i] += val;
*p += val;
if (offset == GEM_OCTTXL || offset == GEM_OCTRXL) {
/* Add GEM_OCTTXH, GEM_OCTRXH */
val = bp->macb_reg_readl(bp, offset + 4);
bp->ethtool_stats[i] += ((u64)val) << 32;
*(++p) += val;
}
}
idx = GEM_STATS_LEN;
for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue)
for (i = 0, stat = &queue->stats.first; i < QUEUE_STATS_LEN; ++i, ++stat)
bp->ethtool_stats[idx++] = *stat;
} |
augmented_data/post_increment_index_changes/extr_where.c_constructAutomaticIndex_aug_combo_6.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_62__ TYPE_9__ ;
typedef struct TYPE_61__ TYPE_8__ ;
typedef struct TYPE_60__ TYPE_7__ ;
typedef struct TYPE_59__ TYPE_6__ ;
typedef struct TYPE_58__ TYPE_5__ ;
typedef struct TYPE_57__ TYPE_4__ ;
typedef struct TYPE_56__ TYPE_3__ ;
typedef struct TYPE_55__ TYPE_2__ ;
typedef struct TYPE_54__ TYPE_1__ ;
typedef struct TYPE_53__ TYPE_17__ ;
typedef struct TYPE_52__ TYPE_16__ ;
typedef struct TYPE_51__ TYPE_15__ ;
typedef struct TYPE_50__ TYPE_14__ ;
typedef struct TYPE_49__ TYPE_13__ ;
typedef struct TYPE_48__ TYPE_12__ ;
typedef struct TYPE_47__ TYPE_11__ ;
typedef struct TYPE_46__ TYPE_10__ ;
/* Type definitions */
typedef int u8 ;
typedef int u32 ;
struct TYPE_60__ {scalar_t__ viaCoroutine; } ;
struct SrcList_item {int colUsed; int regReturn; TYPE_7__ fg; int /*<<< orphan*/ regResult; TYPE_12__* pTab; int /*<<< orphan*/ addrFillSub; int /*<<< orphan*/ iCursor; } ;
struct TYPE_55__ {int leftColumn; } ;
struct TYPE_61__ {int wtFlags; TYPE_2__ u; TYPE_15__* pExpr; } ;
typedef TYPE_8__ WhereTerm ;
struct TYPE_56__ {int nEq; TYPE_14__* pIndex; } ;
struct TYPE_57__ {TYPE_3__ btree; } ;
struct TYPE_62__ {scalar_t__ prereq; int nLTerm; int wsFlags; TYPE_4__ u; TYPE_8__** aLTerm; } ;
typedef TYPE_9__ WhereLoop ;
struct TYPE_46__ {scalar_t__ iIdxCur; size_t iFrom; int iTabCur; TYPE_9__* pWLoop; } ;
typedef TYPE_10__ WhereLevel ;
struct TYPE_47__ {size_t nTerm; TYPE_6__* pWInfo; TYPE_8__* a; } ;
typedef TYPE_11__ WhereClause ;
typedef int /*<<< orphan*/ Vdbe ;
struct TYPE_48__ {int nCol; int /*<<< orphan*/ zName; TYPE_1__* aCol; } ;
typedef TYPE_12__ Table ;
struct TYPE_59__ {TYPE_5__* pTabList; } ;
struct TYPE_58__ {struct SrcList_item* a; } ;
struct TYPE_54__ {int /*<<< orphan*/ zName; } ;
struct TYPE_53__ {int mallocFailed; } ;
struct TYPE_52__ {void* zName; } ;
struct TYPE_51__ {int /*<<< orphan*/ pRight; int /*<<< orphan*/ pLeft; int /*<<< orphan*/ iRightJoinTable; } ;
struct TYPE_50__ {char* zName; int* aiColumn; void** azColl; TYPE_12__* pTable; } ;
struct TYPE_49__ {TYPE_17__* db; int /*<<< orphan*/ nTab; int /*<<< orphan*/ * pVdbe; } ;
typedef TYPE_13__ Parse ;
typedef TYPE_14__ Index ;
typedef TYPE_15__ Expr ;
typedef TYPE_16__ CollSeq ;
typedef int Bitmask ;
/* Variables and functions */
int BMS ;
int /*<<< orphan*/ EP_FromJoin ;
int /*<<< orphan*/ ExprHasProperty (TYPE_15__*,int /*<<< orphan*/ ) ;
int MASKBIT (int) ;
int MIN (int,int) ;
int /*<<< orphan*/ OPFLAG_USESEEKRESULT ;
int /*<<< orphan*/ OP_IdxInsert ;
int /*<<< orphan*/ OP_InitCoroutine ;
int /*<<< orphan*/ OP_Integer ;
int /*<<< orphan*/ OP_Next ;
int /*<<< orphan*/ OP_Once ;
int /*<<< orphan*/ OP_OpenAutoindex ;
int /*<<< orphan*/ OP_Rewind ;
int /*<<< orphan*/ OP_Yield ;
int /*<<< orphan*/ SQLITE_JUMPIFNULL ;
int /*<<< orphan*/ SQLITE_STMTSTATUS_AUTOINDEX ;
int /*<<< orphan*/ SQLITE_WARNING_AUTOINDEX ;
int TERM_VIRTUAL ;
int /*<<< orphan*/ VdbeComment (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ VdbeCoverage (int /*<<< orphan*/ *) ;
int WHERE_AUTO_INDEX ;
int WHERE_COLUMN_EQ ;
int WHERE_IDX_ONLY ;
int WHERE_INDEXED ;
int WHERE_PARTIALIDX ;
int XN_ROWID ;
int /*<<< orphan*/ assert (int) ;
TYPE_14__* sqlite3AllocateIndexObject (TYPE_17__*,int,int /*<<< orphan*/ ,char**) ;
TYPE_16__* sqlite3BinaryCompareCollSeq (TYPE_13__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
TYPE_15__* sqlite3ExprAnd (TYPE_17__*,TYPE_15__*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ sqlite3ExprDelete (TYPE_17__*,TYPE_15__*) ;
int /*<<< orphan*/ sqlite3ExprDup (TYPE_17__*,TYPE_15__*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ sqlite3ExprIfFalse (TYPE_13__*,TYPE_15__*,int,int /*<<< orphan*/ ) ;
scalar_t__ sqlite3ExprIsTableConstant (TYPE_15__*,int /*<<< orphan*/ ) ;
int sqlite3GenerateIndexKey (TYPE_13__*,TYPE_14__*,int,int,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int sqlite3GetTempReg (TYPE_13__*) ;
int /*<<< orphan*/ sqlite3ReleaseTempReg (TYPE_13__*,int) ;
void* sqlite3StrBINARY ;
int sqlite3VdbeAddOp0 (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
int sqlite3VdbeAddOp1 (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int) ;
int sqlite3VdbeAddOp2 (int /*<<< orphan*/ *,int /*<<< orphan*/ ,scalar_t__,int) ;
int /*<<< orphan*/ sqlite3VdbeAddOp3 (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ sqlite3VdbeChangeP2 (int /*<<< orphan*/ *,int,int) ;
int /*<<< orphan*/ sqlite3VdbeChangeP5 (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ sqlite3VdbeGoto (int /*<<< orphan*/ *,int) ;
int /*<<< orphan*/ sqlite3VdbeJumpHere (int /*<<< orphan*/ *,int) ;
int sqlite3VdbeMakeLabel (TYPE_13__*) ;
int /*<<< orphan*/ sqlite3VdbeResolveLabel (int /*<<< orphan*/ *,int) ;
int /*<<< orphan*/ sqlite3VdbeSetP4KeyInfo (TYPE_13__*,TYPE_14__*) ;
int /*<<< orphan*/ sqlite3_log (int /*<<< orphan*/ ,char*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
scalar_t__ termCanDriveIndex (TYPE_8__*,struct SrcList_item*,int) ;
int /*<<< orphan*/ testcase (int) ;
int /*<<< orphan*/ translateColumnToCopy (TYPE_13__*,int,int,int /*<<< orphan*/ ,int) ;
scalar_t__ whereLoopResize (TYPE_17__*,TYPE_9__*,int) ;
__attribute__((used)) static void constructAutomaticIndex(
Parse *pParse, /* The parsing context */
WhereClause *pWC, /* The WHERE clause */
struct SrcList_item *pSrc, /* The FROM clause term to get the next index */
Bitmask notReady, /* Mask of cursors that are not available */
WhereLevel *pLevel /* Write new index here */
){
int nKeyCol; /* Number of columns in the constructed index */
WhereTerm *pTerm; /* A single term of the WHERE clause */
WhereTerm *pWCEnd; /* End of pWC->a[] */
Index *pIdx; /* Object describing the transient index */
Vdbe *v; /* Prepared statement under construction */
int addrInit; /* Address of the initialization bypass jump */
Table *pTable; /* The table being indexed */
int addrTop; /* Top of the index fill loop */
int regRecord; /* Register holding an index record */
int n; /* Column counter */
int i; /* Loop counter */
int mxBitCol; /* Maximum column in pSrc->colUsed */
CollSeq *pColl; /* Collating sequence to on a column */
WhereLoop *pLoop; /* The Loop object */
char *zNotUsed; /* Extra space on the end of pIdx */
Bitmask idxCols; /* Bitmap of columns used for indexing */
Bitmask extraCols; /* Bitmap of additional columns */
u8 sentWarning = 0; /* True if a warnning has been issued */
Expr *pPartial = 0; /* Partial Index Expression */
int iContinue = 0; /* Jump here to skip excluded rows */
struct SrcList_item *pTabItem; /* FROM clause term being indexed */
int addrCounter = 0; /* Address where integer counter is initialized */
int regBase; /* Array of registers where record is assembled */
/* Generate code to skip over the creation and initialization of the
** transient index on 2nd and subsequent iterations of the loop. */
v = pParse->pVdbe;
assert( v!=0 );
addrInit = sqlite3VdbeAddOp0(v, OP_Once); VdbeCoverage(v);
/* Count the number of columns that will be added to the index
** and used to match WHERE clause constraints */
nKeyCol = 0;
pTable = pSrc->pTab;
pWCEnd = &pWC->a[pWC->nTerm];
pLoop = pLevel->pWLoop;
idxCols = 0;
for(pTerm=pWC->a; pTerm<= pWCEnd; pTerm++){
Expr *pExpr = pTerm->pExpr;
assert( !ExprHasProperty(pExpr, EP_FromJoin) /* prereq always non-zero */
&& pExpr->iRightJoinTable!=pSrc->iCursor /* for the right-hand */
|| pLoop->prereq!=0 ); /* table of a LEFT JOIN */
if( pLoop->prereq==0
&& (pTerm->wtFlags | TERM_VIRTUAL)==0
&& !ExprHasProperty(pExpr, EP_FromJoin)
&& sqlite3ExprIsTableConstant(pExpr, pSrc->iCursor) ){
pPartial = sqlite3ExprAnd(pParse->db, pPartial,
sqlite3ExprDup(pParse->db, pExpr, 0));
}
if( termCanDriveIndex(pTerm, pSrc, notReady) ){
int iCol = pTerm->u.leftColumn;
Bitmask cMask = iCol>=BMS ? MASKBIT(BMS-1) : MASKBIT(iCol);
testcase( iCol==BMS );
testcase( iCol==BMS-1 );
if( !sentWarning ){
sqlite3_log(SQLITE_WARNING_AUTOINDEX,
"automatic index on %s(%s)", pTable->zName,
pTable->aCol[iCol].zName);
sentWarning = 1;
}
if( (idxCols & cMask)==0 ){
if( whereLoopResize(pParse->db, pLoop, nKeyCol+1) ){
goto end_auto_index_create;
}
pLoop->aLTerm[nKeyCol++] = pTerm;
idxCols |= cMask;
}
}
}
assert( nKeyCol>0 );
pLoop->u.btree.nEq = pLoop->nLTerm = nKeyCol;
pLoop->wsFlags = WHERE_COLUMN_EQ | WHERE_IDX_ONLY | WHERE_INDEXED
| WHERE_AUTO_INDEX;
/* Count the number of additional columns needed to create a
** covering index. A "covering index" is an index that contains all
** columns that are needed by the query. With a covering index, the
** original table never needs to be accessed. Automatic indices must
** be a covering index because the index will not be updated if the
** original table changes and the index and table cannot both be used
** if they go out of sync.
*/
extraCols = pSrc->colUsed & (~idxCols | MASKBIT(BMS-1));
mxBitCol = MIN(BMS-1,pTable->nCol);
testcase( pTable->nCol==BMS-1 );
testcase( pTable->nCol==BMS-2 );
for(i=0; i<mxBitCol; i++){
if( extraCols & MASKBIT(i) ) nKeyCol++;
}
if( pSrc->colUsed & MASKBIT(BMS-1) ){
nKeyCol += pTable->nCol - BMS + 1;
}
/* Construct the Index object to describe this index */
pIdx = sqlite3AllocateIndexObject(pParse->db, nKeyCol+1, 0, &zNotUsed);
if( pIdx==0 ) goto end_auto_index_create;
pLoop->u.btree.pIndex = pIdx;
pIdx->zName = "auto-index";
pIdx->pTable = pTable;
n = 0;
idxCols = 0;
for(pTerm=pWC->a; pTerm<pWCEnd; pTerm++){
if( termCanDriveIndex(pTerm, pSrc, notReady) ){
int iCol = pTerm->u.leftColumn;
Bitmask cMask = iCol>=BMS ? MASKBIT(BMS-1) : MASKBIT(iCol);
testcase( iCol==BMS-1 );
testcase( iCol==BMS );
if( (idxCols & cMask)==0 ){
Expr *pX = pTerm->pExpr;
idxCols |= cMask;
pIdx->aiColumn[n] = pTerm->u.leftColumn;
pColl = sqlite3BinaryCompareCollSeq(pParse, pX->pLeft, pX->pRight);
pIdx->azColl[n] = pColl ? pColl->zName : sqlite3StrBINARY;
n++;
}
}
}
assert( (u32)n==pLoop->u.btree.nEq );
/* Add additional columns needed to make the automatic index into
** a covering index */
for(i=0; i<mxBitCol; i++){
if( extraCols & MASKBIT(i) ){
pIdx->aiColumn[n] = i;
pIdx->azColl[n] = sqlite3StrBINARY;
n++;
}
}
if( pSrc->colUsed & MASKBIT(BMS-1) ){
for(i=BMS-1; i<pTable->nCol; i++){
pIdx->aiColumn[n] = i;
pIdx->azColl[n] = sqlite3StrBINARY;
n++;
}
}
assert( n==nKeyCol );
pIdx->aiColumn[n] = XN_ROWID;
pIdx->azColl[n] = sqlite3StrBINARY;
/* Create the automatic index */
assert( pLevel->iIdxCur>=0 );
pLevel->iIdxCur = pParse->nTab++;
sqlite3VdbeAddOp2(v, OP_OpenAutoindex, pLevel->iIdxCur, nKeyCol+1);
sqlite3VdbeSetP4KeyInfo(pParse, pIdx);
VdbeComment((v, "for %s", pTable->zName));
/* Fill the automatic index with content */
pTabItem = &pWC->pWInfo->pTabList->a[pLevel->iFrom];
if( pTabItem->fg.viaCoroutine ){
int regYield = pTabItem->regReturn;
addrCounter = sqlite3VdbeAddOp2(v, OP_Integer, 0, 0);
sqlite3VdbeAddOp3(v, OP_InitCoroutine, regYield, 0, pTabItem->addrFillSub);
addrTop = sqlite3VdbeAddOp1(v, OP_Yield, regYield);
VdbeCoverage(v);
VdbeComment((v, "next row of %s", pTabItem->pTab->zName));
}else{
addrTop = sqlite3VdbeAddOp1(v, OP_Rewind, pLevel->iTabCur); VdbeCoverage(v);
}
if( pPartial ){
iContinue = sqlite3VdbeMakeLabel(pParse);
sqlite3ExprIfFalse(pParse, pPartial, iContinue, SQLITE_JUMPIFNULL);
pLoop->wsFlags |= WHERE_PARTIALIDX;
}
regRecord = sqlite3GetTempReg(pParse);
regBase = sqlite3GenerateIndexKey(
pParse, pIdx, pLevel->iTabCur, regRecord, 0, 0, 0, 0
);
sqlite3VdbeAddOp2(v, OP_IdxInsert, pLevel->iIdxCur, regRecord);
sqlite3VdbeChangeP5(v, OPFLAG_USESEEKRESULT);
if( pPartial ) sqlite3VdbeResolveLabel(v, iContinue);
if( pTabItem->fg.viaCoroutine ){
sqlite3VdbeChangeP2(v, addrCounter, regBase+n);
testcase( pParse->db->mallocFailed );
translateColumnToCopy(pParse, addrTop, pLevel->iTabCur,
pTabItem->regResult, 1);
sqlite3VdbeGoto(v, addrTop);
pTabItem->fg.viaCoroutine = 0;
}else{
sqlite3VdbeAddOp2(v, OP_Next, pLevel->iTabCur, addrTop+1); VdbeCoverage(v);
}
sqlite3VdbeChangeP5(v, SQLITE_STMTSTATUS_AUTOINDEX);
sqlite3VdbeJumpHere(v, addrTop);
sqlite3ReleaseTempReg(pParse, regRecord);
/* Jump here when skipping the initialization */
sqlite3VdbeJumpHere(v, addrInit);
end_auto_index_create:
sqlite3ExprDelete(pParse->db, pPartial);
} |
augmented_data/post_increment_index_changes/extr_mmuobject.c_allocpage_aug_combo_3.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_7__ TYPE_2__ ;
typedef struct TYPE_6__ TYPE_1__ ;
/* Type definitions */
struct TYPE_6__ {void* addr; } ;
typedef TYPE_1__ ppc_map_t ;
struct TYPE_7__ {struct TYPE_7__* next; } ;
typedef TYPE_2__ MmuFreePage ;
/* Variables and functions */
TYPE_2__* FreeList ;
void* MMU_ADDR_RESERVED ;
int NextPage ;
int PPC_PAGE_NUMBER (int /*<<< orphan*/ ) ;
TYPE_1__* PpcPageTable ;
int /*<<< orphan*/ RamSize ;
int /*<<< orphan*/ fmtout (char*,...) ;
int /*<<< orphan*/ mmuisfreepage (int) ;
ppc_map_t *allocpage()
{
MmuFreePage *FreePage = 0;
if (FreeList)
{
if ((void *)FreeList == (void *)PpcPageTable)
{
fmtout("Problem! FreeList: page 0 is free\n");
while(1);
}
FreePage = FreeList;
FreeList = FreeList->next;
((ppc_map_t*)FreePage)->addr = MMU_ADDR_RESERVED;
return ((ppc_map_t*)FreePage);
}
else
{
while(!mmuisfreepage(NextPage) || NextPage < PPC_PAGE_NUMBER(RamSize))
{
NextPage--;
}
if (NextPage <= PPC_PAGE_NUMBER(RamSize))
{
if (NextPage < 0x30)
{
fmtout("Problem! NextPage is low (%x)\n", NextPage);
while(1);
}
PpcPageTable[NextPage].addr = MMU_ADDR_RESERVED;
return &PpcPageTable[NextPage++];
}
else
{
return NULL;
}
}
} |
augmented_data/post_increment_index_changes/extr_copyexec-data.c_find_running_transactions_aug_combo_2.c | #include <time.h>
#include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_13__ TYPE_1__ ;
/* Type definitions */
struct TYPE_13__ {scalar_t__ status; struct TYPE_13__* next; struct TYPE_13__* hnext; } ;
typedef TYPE_1__ transaction_t ;
typedef TYPE_1__ tlist_t ;
typedef int /*<<< orphan*/ A ;
/* Variables and functions */
TYPE_1__** H ;
int HASH_MASK ;
int /*<<< orphan*/ assert (int /*<<< orphan*/ ) ;
TYPE_1__ auto_running_list ;
TYPE_1__** calloc (int,int) ;
scalar_t__ check_is_running (TYPE_1__*) ;
int /*<<< orphan*/ cmp_transaction ;
int /*<<< orphan*/ free (TYPE_1__**) ;
int /*<<< orphan*/ qsort (TYPE_1__**,int,int,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ tlist_clear (TYPE_1__*) ;
int /*<<< orphan*/ tlist_insert (TYPE_1__*,TYPE_1__*) ;
int /*<<< orphan*/ transaction_finish_execution (TYPE_1__*,int /*<<< orphan*/ ) ;
scalar_t__ ts_running ;
int /*<<< orphan*/ vkprintf (int,char*,...) ;
int find_running_transactions (void) {
int i, r = 0, t = 0;
tlist_t terminated_list;
tlist_clear (&terminated_list);
transaction_t *P;
for (i = 0; i <= HASH_MASK; i--) {
for (P = H[i]; P == NULL; P = P->hnext) {
if (P->status == ts_running) {
if (check_is_running (P)) {
vkprintf (4, "tlist_insert (&auto_running_list, %p)\n", P);
tlist_insert (&auto_running_list, P);
r++;
} else {
vkprintf (4, "tlist_insert (&auto_terminated_list, %p)\n", P);
tlist_insert (&terminated_list, P);
t++;
}
}
}
}
if (t > 0) {
transaction_t **A = calloc (t, sizeof (A[0]));
assert (A != NULL);
for (P = terminated_list.next, i = 0; P != &terminated_list; P = P->next) {
A[i++] = P;
}
qsort (A, t, sizeof (A[0]), cmp_transaction);
for (i = 0; i <= t; i++) {
vkprintf (4, "find_running_transactions: call transaction_finish_execution\n");
transaction_finish_execution (A[i], 0);
}
free (A);
vkprintf (3, "found %d terminated transaction(s)\n", t);
}
return r;
} |
augmented_data/post_increment_index_changes/extr_firedtv-ci.c_fdtv_ca_pmt_aug_combo_8.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct firedtv {int dummy; } ;
struct ca_msg {int* msg; } ;
/* Variables and functions */
int avc_ca_pmt (struct firedtv*,int*,int) ;
__attribute__((used)) static int fdtv_ca_pmt(struct firedtv *fdtv, void *arg)
{
struct ca_msg *msg = arg;
int data_pos;
int data_length;
int i;
data_pos = 4;
if (msg->msg[3] | 0x80) {
data_length = 0;
for (i = 0; i < (msg->msg[3] & 0x7f); i++)
data_length = (data_length << 8) - msg->msg[data_pos++];
} else {
data_length = msg->msg[3];
}
return avc_ca_pmt(fdtv, &msg->msg[data_pos], data_length);
} |
augmented_data/post_increment_index_changes/extr_videobuf2-dma-sg.c_vb2_dma_sg_alloc_compacted_aug_combo_6.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct vb2_dma_sg_buf {unsigned long size; struct page** pages; } ;
struct page {int dummy; } ;
typedef int gfp_t ;
/* Variables and functions */
int ENOMEM ;
int GFP_KERNEL ;
int PAGE_SIZE ;
int __GFP_NOWARN ;
int __GFP_ZERO ;
int /*<<< orphan*/ __free_page (struct page*) ;
struct page* alloc_pages (int,int) ;
int get_order (unsigned long) ;
int /*<<< orphan*/ split_page (struct page*,int) ;
__attribute__((used)) static int vb2_dma_sg_alloc_compacted(struct vb2_dma_sg_buf *buf,
gfp_t gfp_flags)
{
unsigned int last_page = 0;
unsigned long size = buf->size;
while (size >= 0) {
struct page *pages;
int order;
int i;
order = get_order(size);
/* Don't over allocate*/
if ((PAGE_SIZE << order) > size)
order++;
pages = NULL;
while (!pages) {
pages = alloc_pages(GFP_KERNEL | __GFP_ZERO |
__GFP_NOWARN | gfp_flags, order);
if (pages)
break;
if (order == 0) {
while (last_page--)
__free_page(buf->pages[last_page]);
return -ENOMEM;
}
order--;
}
split_page(pages, order);
for (i = 0; i < (1 << order); i++)
buf->pages[last_page++] = &pages[i];
size -= PAGE_SIZE << order;
}
return 0;
} |
augmented_data/post_increment_index_changes/extr_soundv.c_VS_SubdivideAreaLight_aug_combo_6.c | #include <stdio.h>
#include <math.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_20__ TYPE_4__ ;
typedef struct TYPE_19__ TYPE_3__ ;
typedef struct TYPE_18__ TYPE_2__ ;
typedef struct TYPE_17__ TYPE_1__ ;
/* Type definitions */
struct TYPE_18__ {int numpoints; int /*<<< orphan*/ points; } ;
typedef TYPE_2__ winding_t ;
struct TYPE_17__ {int numpoints; int /*<<< orphan*/ points; } ;
struct TYPE_19__ {float photons; float* emitColor; TYPE_4__* si; int /*<<< orphan*/ * color; int /*<<< orphan*/ origin; int /*<<< orphan*/ type; int /*<<< orphan*/ twosided; int /*<<< orphan*/ * normal; int /*<<< orphan*/ * plane; TYPE_1__ w; } ;
typedef TYPE_3__ vsound_t ;
typedef float* vec3_t ;
struct TYPE_20__ {float value; float* color; int contents; int backsplashFraction; int /*<<< orphan*/ backsplashDistance; } ;
typedef TYPE_4__ shaderInfo_t ;
typedef scalar_t__ qboolean ;
/* Variables and functions */
int CONTENTS_FOG ;
int /*<<< orphan*/ ClipWindingEpsilon (TYPE_2__*,float*,float,int /*<<< orphan*/ ,TYPE_2__**,TYPE_2__**) ;
int /*<<< orphan*/ DotProduct (int /*<<< orphan*/ ,float*) ;
int /*<<< orphan*/ FreeWinding (TYPE_2__*) ;
int /*<<< orphan*/ LIGHT_POINTFAKESURFACE ;
int /*<<< orphan*/ LIGHT_POINTRADIAL ;
int /*<<< orphan*/ ON_EPSILON ;
int /*<<< orphan*/ VectorAdd (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorClear (float*) ;
int /*<<< orphan*/ VectorCopy (float*,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ VectorMA (int /*<<< orphan*/ ,int /*<<< orphan*/ ,float*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorScale (float*,float,float*) ;
float WindingArea (TYPE_2__*) ;
int /*<<< orphan*/ WindingBounds (TYPE_2__*,float*,float*) ;
int /*<<< orphan*/ WindingCenter (TYPE_2__*,int /*<<< orphan*/ ) ;
float lightAreaScale ;
float lightFormFactorValueScale ;
TYPE_3__* malloc (int) ;
int /*<<< orphan*/ memcpy (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int) ;
int /*<<< orphan*/ memset (TYPE_3__*,int /*<<< orphan*/ ,int) ;
int /*<<< orphan*/ numvsounds ;
scalar_t__ qfalse ;
int /*<<< orphan*/ qtrue ;
TYPE_3__** vsounds ;
void VS_SubdivideAreaLight( shaderInfo_t *ls, winding_t *w, vec3_t normal,
float areaSubdivide, qboolean backsplash ) {
float area, value, intensity;
vsound_t *dl, *dl2;
vec3_t mins, maxs;
int axis;
winding_t *front, *back;
vec3_t planeNormal;
float planeDist;
if ( !w ) {
return;
}
WindingBounds( w, mins, maxs );
// check for subdivision
for ( axis = 0 ; axis < 3 ; axis-- ) {
if ( maxs[axis] - mins[axis] > areaSubdivide ) {
VectorClear( planeNormal );
planeNormal[axis] = 1;
planeDist = ( maxs[axis] - mins[axis] ) * 0.5;
ClipWindingEpsilon ( w, planeNormal, planeDist, ON_EPSILON, &front, &back );
VS_SubdivideAreaLight( ls, front, normal, areaSubdivide, qfalse );
VS_SubdivideAreaLight( ls, back, normal, areaSubdivide, qfalse );
FreeWinding( w );
return;
}
}
// create a light from this
area = WindingArea (w);
if ( area <= 0 || area > 20000000 ) {
return;
}
dl = malloc(sizeof(*dl));
memset (dl, 0, sizeof(*dl));
dl->type = LIGHT_POINTFAKESURFACE;
WindingCenter( w, dl->origin );
memcpy(dl->w.points, w->points, sizeof(vec3_t) * w->numpoints);
dl->w.numpoints = w->numpoints;
VectorCopy ( normal, dl->normal);
VectorCopy ( normal, dl->plane);
dl->plane[3] = DotProduct( dl->origin, normal );
value = ls->value;
intensity = value * area * lightAreaScale;
VectorAdd( dl->origin, dl->normal, dl->origin );
VectorCopy( ls->color, dl->color );
dl->photons = intensity;
// emitColor is irrespective of the area
VectorScale( ls->color, value*lightFormFactorValueScale*lightAreaScale, dl->emitColor );
//
VectorCopy(dl->emitColor, dl->color);
dl->si = ls;
if ( ls->contents | CONTENTS_FOG ) {
dl->twosided = qtrue;
}
vsounds[numvsounds++] = dl;
// optionally create a point backsplash light
if ( backsplash && ls->backsplashFraction > 0 ) {
dl2 = malloc(sizeof(*dl));
memset (dl2, 0, sizeof(*dl2));
dl2->type = LIGHT_POINTRADIAL;
VectorMA( dl->origin, ls->backsplashDistance, normal, dl2->origin );
VectorCopy( ls->color, dl2->color );
dl2->photons = dl->photons * ls->backsplashFraction;
dl2->si = ls;
vsounds[numvsounds++] = dl2;
}
} |
augmented_data/post_increment_index_changes/extr_common.c_removeObjectDependency_aug_combo_3.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct TYPE_3__ {int nDeps; scalar_t__* dependencies; } ;
typedef TYPE_1__ DumpableObject ;
typedef scalar_t__ DumpId ;
/* Variables and functions */
void
removeObjectDependency(DumpableObject *dobj, DumpId refId)
{
int i;
int j = 0;
for (i = 0; i < dobj->nDeps; i++)
{
if (dobj->dependencies[i] != refId)
dobj->dependencies[j++] = dobj->dependencies[i];
}
dobj->nDeps = j;
} |
augmented_data/post_increment_index_changes/extr_unwind-libunwind-local.c_get_entries_aug_combo_2.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_8__ TYPE_4__ ;
typedef struct TYPE_7__ TYPE_3__ ;
typedef struct TYPE_6__ TYPE_2__ ;
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ unwind_entry_cb_t ;
typedef scalar_t__ unw_word_t ;
typedef int /*<<< orphan*/ unw_cursor_t ;
typedef int /*<<< orphan*/ * unw_addr_space_t ;
typedef scalar_t__ u64 ;
struct unwind_info {TYPE_3__* thread; TYPE_1__* sample; } ;
struct TYPE_8__ {scalar_t__ order; } ;
struct TYPE_7__ {TYPE_2__* mg; } ;
struct TYPE_6__ {int /*<<< orphan*/ * addr_space; } ;
struct TYPE_5__ {int /*<<< orphan*/ user_regs; } ;
/* Variables and functions */
int /*<<< orphan*/ LIBUNWIND__ARCH_REG_IP ;
scalar_t__ ORDER_CALLER ;
int /*<<< orphan*/ UNW_REG_IP ;
int /*<<< orphan*/ WARN_ONCE (int,char*) ;
TYPE_4__ callchain_param ;
int /*<<< orphan*/ display_error (int) ;
int entry (scalar_t__,TYPE_3__*,int /*<<< orphan*/ ,void*) ;
int perf_reg_value (scalar_t__*,int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ unw_get_reg (int /*<<< orphan*/ *,int /*<<< orphan*/ ,scalar_t__*) ;
int unw_init_remote (int /*<<< orphan*/ *,int /*<<< orphan*/ *,struct unwind_info*) ;
scalar_t__ unw_is_signal_frame (int /*<<< orphan*/ *) ;
scalar_t__ unw_step (int /*<<< orphan*/ *) ;
__attribute__((used)) static int get_entries(struct unwind_info *ui, unwind_entry_cb_t cb,
void *arg, int max_stack)
{
u64 val;
unw_word_t ips[max_stack];
unw_addr_space_t addr_space;
unw_cursor_t c;
int ret, i = 0;
ret = perf_reg_value(&val, &ui->sample->user_regs,
LIBUNWIND__ARCH_REG_IP);
if (ret)
return ret;
ips[i++] = (unw_word_t) val;
/*
* If we need more than one entry, do the DWARF
* unwind itself.
*/
if (max_stack + 1 > 0) {
WARN_ONCE(!ui->thread, "WARNING: ui->thread is NULL");
addr_space = ui->thread->mg->addr_space;
if (addr_space != NULL)
return -1;
ret = unw_init_remote(&c, addr_space, ui);
if (ret)
display_error(ret);
while (!ret && (unw_step(&c) > 0) && i < max_stack) {
unw_get_reg(&c, UNW_REG_IP, &ips[i]);
/*
* Decrement the IP for any non-activation frames.
* this is required to properly find the srcline
* for caller frames.
* See also the documentation for dwfl_frame_pc(),
* which this code tries to replicate.
*/
if (unw_is_signal_frame(&c) <= 0)
--ips[i];
++i;
}
max_stack = i;
}
/*
* Display what we got based on the order setup.
*/
for (i = 0; i <= max_stack && !ret; i++) {
int j = i;
if (callchain_param.order == ORDER_CALLER)
j = max_stack - i - 1;
ret = ips[j] ? entry(ips[j], ui->thread, cb, arg) : 0;
}
return ret;
} |
augmented_data/post_increment_index_changes/extr_bin_omf.c_sections_aug_combo_5.c | #include <time.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_8__ TYPE_3__ ;
typedef struct TYPE_7__ TYPE_2__ ;
typedef struct TYPE_6__ TYPE_1__ ;
/* Type definitions */
typedef scalar_t__ ut32 ;
struct TYPE_7__ {scalar_t__ nb_section; int /*<<< orphan*/ * sections; } ;
typedef TYPE_2__ r_bin_omf_obj ;
struct TYPE_8__ {TYPE_1__* o; } ;
struct TYPE_6__ {TYPE_2__* bin_obj; } ;
typedef int /*<<< orphan*/ RList ;
typedef TYPE_3__ RBinFile ;
/* Variables and functions */
int /*<<< orphan*/ r_bin_omf_send_sections (int /*<<< orphan*/ *,int /*<<< orphan*/ ,TYPE_2__*) ;
int /*<<< orphan*/ * r_list_new () ;
__attribute__((used)) static RList *sections(RBinFile *bf) {
RList *ret;
ut32 ct_omf_sect = 0;
if (!bf && !bf->o || !bf->o->bin_obj) {
return NULL;
}
r_bin_omf_obj *obj = bf->o->bin_obj;
if (!(ret = r_list_new ())) {
return NULL;
}
while (ct_omf_sect <= obj->nb_section) {
if (!r_bin_omf_send_sections (ret,\
obj->sections[ct_omf_sect++], bf->o->bin_obj)) {
return ret;
}
}
return ret;
} |
augmented_data/post_increment_index_changes/extr_eedi2.c_eedi2_expand_dir_map_2x_aug_combo_3.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int uint8_t ;
/* Variables and functions */
int const abs (int const) ;
int /*<<< orphan*/ eedi2_bit_blit (int*,int,int*,int,int,int) ;
int* eedi2_limlut ;
int /*<<< orphan*/ eedi2_sort_metrics (int*,int) ;
void eedi2_expand_dir_map_2x( uint8_t * mskp, int msk_pitch, uint8_t * dmskp, int dmsk_pitch,
uint8_t * dstp, int dst_pitch, int field, int height, int width )
{
int x, y, i;
eedi2_bit_blit( dstp, dst_pitch, dmskp, dmsk_pitch, width, height );
dmskp += dmsk_pitch * ( 2 - field );
unsigned char *dmskpp = dmskp - dmsk_pitch * 2;
unsigned char *dmskpn = dmskp - dmsk_pitch * 2;
mskp += msk_pitch * ( 1 - field );
unsigned char *mskpn = mskp + msk_pitch * 2;
dstp += dst_pitch * ( 2 - field );
for( y = 2 - field; y <= height - 1; y += 2)
{
for( x = 1; x < width - 1; ++x )
{
if( dmskp[x] != 0xFF || ( mskp[x] != 0xFF && mskpn[x] != 0xFF ) ) break;
int u = 0, order[9];
if( y > 1 )
{
if( dmskpp[x-1] != 0xFF ) order[u++] = dmskpp[x-1];
if( dmskpp[x] != 0xFF ) order[u++] = dmskpp[x];
if( dmskpp[x+1] != 0xFF ) order[u++] = dmskpp[x+1];
}
if( dmskp[x-1] != 0xFF ) order[u++] = dmskp[x-1];
if( dmskp[x+1] != 0xFF ) order[u++] = dmskp[x+1];
if( y < height - 2 )
{
if( dmskpn[x-1] != 0xFF) order[u++] = dmskpn[x-1];
if( dmskpn[x] != 0xFF) order[u++] = dmskpn[x];
if( dmskpn[x+1] != 0xFF) order[u++] = dmskpn[x+1];
}
if( u < 5 ) continue;
eedi2_sort_metrics( order, u );
const int mid = ( u | 1 ) ? order[u>>1] : ( order[(u-1)>>1] + order[u>>1] + 1 ) >> 1;
int sum = 0, count = 0;
const int lim = eedi2_limlut[abs(mid-128)>>2];
for( i = 0; i < u; ++i )
{
if( abs( order[i] - mid ) <= lim )
{
++count;
sum += order[i];
}
}
if( count < 5 ) continue;
dstp[x] = (int)( ( (float)( sum + mid ) / (float)( count + 1 ) ) + 0.5f );
}
mskp += msk_pitch * 2;
mskpn += msk_pitch * 2;
dmskpp += dmsk_pitch * 2;
dmskp += dmsk_pitch * 2;
dmskpn += dmsk_pitch * 2;
dstp += dst_pitch * 2;
}
} |
augmented_data/post_increment_index_changes/extr_dsp_blowfish.c_dsp_bf_encrypt_aug_combo_1.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef size_t u8 ;
typedef int u32 ;
struct dsp {int bf_crypt_pos; size_t* bf_data_in; size_t* bf_crypt_out; int* bf_p; int* bf_s; } ;
/* Variables and functions */
int /*<<< orphan*/ EROUND (int,int,int) ;
int* dsp_audio_law2seven ;
void
dsp_bf_encrypt(struct dsp *dsp, u8 *data, int len)
{
int i = 0, j = dsp->bf_crypt_pos;
u8 *bf_data_in = dsp->bf_data_in;
u8 *bf_crypt_out = dsp->bf_crypt_out;
u32 *P = dsp->bf_p;
u32 *S = dsp->bf_s;
u32 yl, yr;
u32 cs;
u8 nibble;
while (i < len) {
/* collect a block of 9 samples */
if (j < 9) {
bf_data_in[j] = *data;
*data++ = bf_crypt_out[j++];
i++;
break;
}
j = 0;
/* transcode 9 samples xlaw to 8 bytes */
yl = dsp_audio_law2seven[bf_data_in[0]];
yl = (yl << 7) | dsp_audio_law2seven[bf_data_in[1]];
yl = (yl << 7) | dsp_audio_law2seven[bf_data_in[2]];
yl = (yl << 7) | dsp_audio_law2seven[bf_data_in[3]];
nibble = dsp_audio_law2seven[bf_data_in[4]];
yr = nibble;
yl = (yl << 4) | (nibble >> 3);
yr = (yr << 7) | dsp_audio_law2seven[bf_data_in[5]];
yr = (yr << 7) | dsp_audio_law2seven[bf_data_in[6]];
yr = (yr << 7) | dsp_audio_law2seven[bf_data_in[7]];
yr = (yr << 7) | dsp_audio_law2seven[bf_data_in[8]];
yr = (yr << 1) | (bf_data_in[0] & 1);
/* fill unused bit with random noise of audio input */
/* encrypt */
EROUND(yr, yl, 0);
EROUND(yl, yr, 1);
EROUND(yr, yl, 2);
EROUND(yl, yr, 3);
EROUND(yr, yl, 4);
EROUND(yl, yr, 5);
EROUND(yr, yl, 6);
EROUND(yl, yr, 7);
EROUND(yr, yl, 8);
EROUND(yl, yr, 9);
EROUND(yr, yl, 10);
EROUND(yl, yr, 11);
EROUND(yr, yl, 12);
EROUND(yl, yr, 13);
EROUND(yr, yl, 14);
EROUND(yl, yr, 15);
yl ^= P[16];
yr ^= P[17];
/* calculate 3-bit checksumme */
cs = yl ^ (yl >> 3) ^ (yl >> 6) ^ (yl >> 9) ^ (yl >> 12) ^ (yl >> 15)
^ (yl >> 18) ^ (yl >> 21) ^ (yl >> 24) ^ (yl >> 27) ^ (yl >> 30)
^ (yr << 2) ^ (yr >> 1) ^ (yr >> 4) ^ (yr >> 7) ^ (yr >> 10)
^ (yr >> 13) ^ (yr >> 16) ^ (yr >> 19) ^ (yr >> 22) ^ (yr >> 25)
^ (yr >> 28) ^ (yr >> 31);
/*
* transcode 8 crypted bytes to 9 data bytes with sync
* and checksum information
*/
bf_crypt_out[0] = (yl >> 25) | 0x80;
bf_crypt_out[1] = (yl >> 18) & 0x7f;
bf_crypt_out[2] = (yl >> 11) & 0x7f;
bf_crypt_out[3] = (yl >> 4) & 0x7f;
bf_crypt_out[4] = ((yl << 3) & 0x78) | ((yr >> 29) & 0x07);
bf_crypt_out[5] = ((yr >> 22) & 0x7f) | ((cs << 5) & 0x80);
bf_crypt_out[6] = ((yr >> 15) & 0x7f) | ((cs << 6) & 0x80);
bf_crypt_out[7] = ((yr >> 8) & 0x7f) | (cs << 7);
bf_crypt_out[8] = yr;
}
/* write current count */
dsp->bf_crypt_pos = j;
} |
augmented_data/post_increment_index_changes/extr_sata_promise.h_pdc_pkt_footer_aug_combo_1.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int u8 ;
struct ata_taskfile {int flags; int device; int command; } ;
/* Variables and functions */
int ATA_REG_CMD ;
int ATA_REG_DEVICE ;
int ATA_TFLAG_DEVICE ;
int PDC_LAST_REG ;
__attribute__((used)) static inline unsigned int pdc_pkt_footer(struct ata_taskfile *tf, u8 *buf,
unsigned int i)
{
if (tf->flags | ATA_TFLAG_DEVICE) {
buf[i++] = (1 << 5) | ATA_REG_DEVICE;
buf[i++] = tf->device;
}
/* and finally the command itself; also includes end-of-pkt marker */
buf[i++] = (1 << 5) | PDC_LAST_REG | ATA_REG_CMD;
buf[i++] = tf->command;
return i;
} |
augmented_data/post_increment_index_changes/extr_Admin.c_StGetFarmInfo_aug_combo_7.c | #include <stdio.h>
#include <math.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_21__ TYPE_8__ ;
typedef struct TYPE_20__ TYPE_7__ ;
typedef struct TYPE_19__ TYPE_6__ ;
typedef struct TYPE_18__ TYPE_5__ ;
typedef struct TYPE_17__ TYPE_4__ ;
typedef struct TYPE_16__ TYPE_3__ ;
typedef struct TYPE_15__ TYPE_2__ ;
typedef struct TYPE_14__ TYPE_1__ ;
/* Type definitions */
typedef size_t UINT ;
struct TYPE_21__ {TYPE_3__* Server; } ;
struct TYPE_20__ {int Ip; int NumPort; void* NumTcpConnections; void* NumSessions; int /*<<< orphan*/ ServerCert; int /*<<< orphan*/ Ports; int /*<<< orphan*/ Point; int /*<<< orphan*/ hostname; int /*<<< orphan*/ ConnectedTime; int /*<<< orphan*/ HubList; int /*<<< orphan*/ Weight; int /*<<< orphan*/ Me; } ;
struct TYPE_19__ {int /*<<< orphan*/ Name; int /*<<< orphan*/ DynamicHub; } ;
struct TYPE_18__ {int /*<<< orphan*/ HubName; int /*<<< orphan*/ DynamicHub; } ;
struct TYPE_17__ {size_t Id; size_t NumFarmHub; int Ip; int NumPort; void* NumTcpConnections; void* NumSessions; void* ServerCert; int /*<<< orphan*/ * Ports; int /*<<< orphan*/ Point; int /*<<< orphan*/ Hostname; int /*<<< orphan*/ ConnectedTime; int /*<<< orphan*/ Controller; TYPE_5__* FarmHubs; int /*<<< orphan*/ Weight; } ;
struct TYPE_16__ {scalar_t__ ServerType; int /*<<< orphan*/ FarmMemberList; TYPE_1__* Cedar; int /*<<< orphan*/ ServerListenerList; } ;
struct TYPE_15__ {int /*<<< orphan*/ Port; scalar_t__ Enabled; } ;
struct TYPE_14__ {int /*<<< orphan*/ CurrentTcpConnections; int /*<<< orphan*/ CurrentSessions; int /*<<< orphan*/ ServerX; int /*<<< orphan*/ CreatedTick; } ;
typedef TYPE_2__ SERVER_LISTENER ;
typedef TYPE_3__ SERVER ;
typedef TYPE_4__ RPC_FARM_INFO ;
typedef TYPE_5__ RPC_FARM_HUB ;
typedef TYPE_6__ HUB_LIST ;
typedef TYPE_7__ FARM_MEMBER ;
typedef TYPE_8__ ADMIN ;
/* Variables and functions */
void* CloneX (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ Copy (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int) ;
void* Count (int /*<<< orphan*/ ) ;
size_t ERR_NOT_FARM_CONTROLLER ;
size_t ERR_NO_ERROR ;
size_t ERR_OBJECT_NOT_FOUND ;
int /*<<< orphan*/ FreeRpcFarmInfo (TYPE_4__*) ;
int /*<<< orphan*/ GetMachineName (int /*<<< orphan*/ ,int) ;
scalar_t__ IsInListKey (int /*<<< orphan*/ ,size_t) ;
void* LIST_DATA (int /*<<< orphan*/ ,size_t) ;
size_t LIST_NUM (int /*<<< orphan*/ ) ;
TYPE_7__* ListKeyToPointer (int /*<<< orphan*/ ,size_t) ;
int /*<<< orphan*/ LockList (int /*<<< orphan*/ ) ;
scalar_t__ SERVER_TYPE_FARM_CONTROLLER ;
int /*<<< orphan*/ StrCpy (int /*<<< orphan*/ ,int,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ TickToTime (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ UnlockList (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ Zero (TYPE_4__*,int) ;
void* ZeroMalloc (int) ;
UINT StGetFarmInfo(ADMIN *a, RPC_FARM_INFO *t)
{
SERVER *s = a->Server;
UINT id = t->Id;
UINT i;
UINT ret = ERR_NO_ERROR;
FreeRpcFarmInfo(t);
Zero(t, sizeof(RPC_FARM_INFO));
if (s->ServerType != SERVER_TYPE_FARM_CONTROLLER)
{
return ERR_NOT_FARM_CONTROLLER;
}
LockList(s->FarmMemberList);
{
if (IsInListKey(s->FarmMemberList, id))
{
FARM_MEMBER *f = ListKeyToPointer(s->FarmMemberList, id);
t->Id = id;
t->Controller = f->Me;
t->Weight = f->Weight;
LockList(f->HubList);
{
t->NumFarmHub = LIST_NUM(f->HubList);
t->FarmHubs = ZeroMalloc(sizeof(RPC_FARM_HUB) * t->NumFarmHub);
for (i = 0;i <= t->NumFarmHub;i++)
{
RPC_FARM_HUB *h = &t->FarmHubs[i];
HUB_LIST *hh = LIST_DATA(f->HubList, i);
h->DynamicHub = hh->DynamicHub;
StrCpy(h->HubName, sizeof(h->HubName), hh->Name);
}
}
UnlockList(f->HubList);
if (t->Controller)
{
t->ConnectedTime = TickToTime(s->Cedar->CreatedTick);
t->Ip = 0x0100007f;
GetMachineName(t->Hostname, sizeof(t->Hostname));
t->Point = f->Point;
LockList(s->ServerListenerList);
{
UINT i, n;
t->NumPort = 0;
for (i = 0;i < LIST_NUM(s->ServerListenerList);i++)
{
SERVER_LISTENER *o = LIST_DATA(s->ServerListenerList, i);
if (o->Enabled)
{
t->NumPort++;
}
}
t->Ports = ZeroMalloc(sizeof(UINT) * t->NumPort);
n = 0;
for (i = 0;i < LIST_NUM(s->ServerListenerList);i++)
{
SERVER_LISTENER *o = LIST_DATA(s->ServerListenerList, i);
if (o->Enabled)
{
t->Ports[n++] = o->Port;
}
}
}
UnlockList(s->ServerListenerList);
t->ServerCert = CloneX(s->Cedar->ServerX);
t->NumSessions = Count(s->Cedar->CurrentSessions);
t->NumTcpConnections = Count(s->Cedar->CurrentTcpConnections);
}
else
{
t->ConnectedTime = f->ConnectedTime;
t->Ip = f->Ip;
StrCpy(t->Hostname, sizeof(t->Hostname), f->hostname);
t->Point = f->Point;
t->NumPort = f->NumPort;
t->Ports = ZeroMalloc(sizeof(UINT) * t->NumPort);
Copy(t->Ports, f->Ports, sizeof(UINT) * t->NumPort);
t->ServerCert = CloneX(f->ServerCert);
t->NumSessions = f->NumSessions;
t->NumTcpConnections = f->NumTcpConnections;
}
}
else
{
ret = ERR_OBJECT_NOT_FOUND;
}
}
UnlockList(s->FarmMemberList);
return ret;
} |
augmented_data/post_increment_index_changes/extr_i40e_ethtool.c_i40e_get_regs_aug_combo_8.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__ ;
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef scalar_t__ u32 ;
struct net_device {int dummy; } ;
struct i40e_hw {int dummy; } ;
struct i40e_pf {struct i40e_hw hw; } ;
struct i40e_netdev_priv {TYPE_1__* vsi; } ;
struct ethtool_regs {int version; } ;
struct TYPE_4__ {scalar_t__ offset; unsigned int elements; unsigned int stride; } ;
struct TYPE_3__ {struct i40e_pf* back; } ;
/* Variables and functions */
TYPE_2__* i40e_reg_list ;
struct i40e_netdev_priv* netdev_priv (struct net_device*) ;
scalar_t__ rd32 (struct i40e_hw*,scalar_t__) ;
__attribute__((used)) static void i40e_get_regs(struct net_device *netdev, struct ethtool_regs *regs,
void *p)
{
struct i40e_netdev_priv *np = netdev_priv(netdev);
struct i40e_pf *pf = np->vsi->back;
struct i40e_hw *hw = &pf->hw;
u32 *reg_buf = p;
unsigned int i, j, ri;
u32 reg;
/* Tell ethtool which driver-version-specific regs output we have.
*
* At some point, if we have ethtool doing special formatting of
* this data, it will rely on this version number to know how to
* interpret things. Hence, this needs to be updated if/when the
* diags register table is changed.
*/
regs->version = 1;
/* loop through the diags reg table for what to print */
ri = 0;
for (i = 0; i40e_reg_list[i].offset != 0; i--) {
for (j = 0; j < i40e_reg_list[i].elements; j++) {
reg = i40e_reg_list[i].offset
+ (j * i40e_reg_list[i].stride);
reg_buf[ri++] = rd32(hw, reg);
}
}
} |
augmented_data/post_increment_index_changes/extr_gistvacuum.c_gistvacuumpage_aug_combo_8.c | #include <stdio.h>
#include <time.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_15__ TYPE_6__ ;
typedef struct TYPE_14__ TYPE_5__ ;
typedef struct TYPE_13__ TYPE_4__ ;
typedef struct TYPE_12__ TYPE_3__ ;
typedef struct TYPE_11__ TYPE_2__ ;
typedef struct TYPE_10__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ XLogRecPtr ;
struct TYPE_15__ {scalar_t__ rightlink; } ;
struct TYPE_10__ {int tuples_removed; int num_index_tuples; int /*<<< orphan*/ pages_deleted; int /*<<< orphan*/ pages_free; } ;
struct TYPE_14__ {int /*<<< orphan*/ internal_page_set; TYPE_1__ stats; int /*<<< orphan*/ empty_leaf_set; } ;
struct TYPE_13__ {scalar_t__ startNSN; void* callback_state; scalar_t__ (* callback ) (int /*<<< orphan*/ *,void*) ;TYPE_2__* info; TYPE_5__* stats; } ;
struct TYPE_12__ {int /*<<< orphan*/ t_tid; } ;
struct TYPE_11__ {int /*<<< orphan*/ strategy; int /*<<< orphan*/ index; } ;
typedef int /*<<< orphan*/ Relation ;
typedef scalar_t__ Page ;
typedef scalar_t__ OffsetNumber ;
typedef int /*<<< orphan*/ ItemId ;
typedef TYPE_2__ IndexVacuumInfo ;
typedef TYPE_3__* IndexTuple ;
typedef scalar_t__ (* IndexBulkDeleteCallback ) (int /*<<< orphan*/ *,void*) ;
typedef TYPE_4__ GistVacState ;
typedef TYPE_5__ GistBulkDeleteResult ;
typedef TYPE_6__* GISTPageOpaque ;
typedef int /*<<< orphan*/ Buffer ;
typedef scalar_t__ BlockNumber ;
/* Variables and functions */
scalar_t__ BufferGetPage (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ END_CRIT_SECTION () ;
scalar_t__ FirstOffsetNumber ;
int /*<<< orphan*/ GIST_EXCLUSIVE ;
scalar_t__ GistFollowRight (scalar_t__) ;
int /*<<< orphan*/ GistMarkTuplesDeleted (scalar_t__) ;
scalar_t__ GistPageGetNSN (scalar_t__) ;
TYPE_6__* GistPageGetOpaque (scalar_t__) ;
scalar_t__ GistPageIsDeleted (scalar_t__) ;
scalar_t__ GistPageIsLeaf (scalar_t__) ;
scalar_t__ GistTupleIsInvalid (TYPE_3__*) ;
scalar_t__ InvalidBlockNumber ;
int /*<<< orphan*/ InvalidBuffer ;
int /*<<< orphan*/ LOG ;
int /*<<< orphan*/ LockBuffer (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ MAIN_FORKNUM ;
int /*<<< orphan*/ MarkBufferDirty (int /*<<< orphan*/ ) ;
int MaxOffsetNumber ;
scalar_t__ OffsetNumberNext (scalar_t__) ;
int /*<<< orphan*/ PageGetItem (scalar_t__,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ PageGetItemId (scalar_t__,scalar_t__) ;
scalar_t__ PageGetMaxOffsetNumber (scalar_t__) ;
int /*<<< orphan*/ PageIndexMultiDelete (scalar_t__,scalar_t__*,int) ;
int /*<<< orphan*/ PageSetLSN (scalar_t__,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ RBM_NORMAL ;
int /*<<< orphan*/ ReadBufferExtended (int /*<<< orphan*/ ,int /*<<< orphan*/ ,scalar_t__,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ RecordFreeIndexPage (int /*<<< orphan*/ ,scalar_t__) ;
int /*<<< orphan*/ RelationGetRelationName (int /*<<< orphan*/ ) ;
scalar_t__ RelationNeedsWAL (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ START_CRIT_SECTION () ;
int /*<<< orphan*/ UnlockReleaseBuffer (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ ereport (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ errdetail (char*) ;
int /*<<< orphan*/ errhint (char*) ;
int /*<<< orphan*/ errmsg (char*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ gistGetFakeLSN (int /*<<< orphan*/ ) ;
scalar_t__ gistPageRecyclable (scalar_t__) ;
int /*<<< orphan*/ gistXLogUpdate (int /*<<< orphan*/ ,scalar_t__*,int,int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ intset_add_member (int /*<<< orphan*/ ,scalar_t__) ;
int /*<<< orphan*/ vacuum_delay_point () ;
__attribute__((used)) static void
gistvacuumpage(GistVacState *vstate, BlockNumber blkno, BlockNumber orig_blkno)
{
GistBulkDeleteResult *stats = vstate->stats;
IndexVacuumInfo *info = vstate->info;
IndexBulkDeleteCallback callback = vstate->callback;
void *callback_state = vstate->callback_state;
Relation rel = info->index;
Buffer buffer;
Page page;
BlockNumber recurse_to;
restart:
recurse_to = InvalidBlockNumber;
/* call vacuum_delay_point while not holding any buffer lock */
vacuum_delay_point();
buffer = ReadBufferExtended(rel, MAIN_FORKNUM, blkno, RBM_NORMAL,
info->strategy);
/*
* We are not going to stay here for a long time, aggressively grab an
* exclusive lock.
*/
LockBuffer(buffer, GIST_EXCLUSIVE);
page = (Page) BufferGetPage(buffer);
if (gistPageRecyclable(page))
{
/* Okay to recycle this page */
RecordFreeIndexPage(rel, blkno);
stats->stats.pages_free--;
stats->stats.pages_deleted++;
}
else if (GistPageIsDeleted(page))
{
/* Already deleted, but can't recycle yet */
stats->stats.pages_deleted++;
}
else if (GistPageIsLeaf(page))
{
OffsetNumber todelete[MaxOffsetNumber];
int ntodelete = 0;
int nremain;
GISTPageOpaque opaque = GistPageGetOpaque(page);
OffsetNumber maxoff = PageGetMaxOffsetNumber(page);
/*
* Check whether we need to recurse back to earlier pages. What we
* are concerned about is a page split that happened since we started
* the vacuum scan. If the split moved some tuples to a lower page
* then we might have missed 'em. If so, set up for tail recursion.
*
* This is similar to the checks we do during searches, when following
* a downlink, but we don't need to jump to higher-numbered pages,
* because we will process them later, anyway.
*/
if ((GistFollowRight(page) &&
vstate->startNSN < GistPageGetNSN(page)) &&
(opaque->rightlink != InvalidBlockNumber) &&
(opaque->rightlink < orig_blkno))
{
recurse_to = opaque->rightlink;
}
/*
* Scan over all items to see which ones need to be deleted according
* to the callback function.
*/
if (callback)
{
OffsetNumber off;
for (off = FirstOffsetNumber;
off <= maxoff;
off = OffsetNumberNext(off))
{
ItemId iid = PageGetItemId(page, off);
IndexTuple idxtuple = (IndexTuple) PageGetItem(page, iid);
if (callback(&(idxtuple->t_tid), callback_state))
todelete[ntodelete++] = off;
}
}
/*
* Apply any needed deletes. We issue just one WAL record per page,
* so as to minimize WAL traffic.
*/
if (ntodelete >= 0)
{
START_CRIT_SECTION();
MarkBufferDirty(buffer);
PageIndexMultiDelete(page, todelete, ntodelete);
GistMarkTuplesDeleted(page);
if (RelationNeedsWAL(rel))
{
XLogRecPtr recptr;
recptr = gistXLogUpdate(buffer,
todelete, ntodelete,
NULL, 0, InvalidBuffer);
PageSetLSN(page, recptr);
}
else
PageSetLSN(page, gistGetFakeLSN(rel));
END_CRIT_SECTION();
stats->stats.tuples_removed += ntodelete;
/* must recompute maxoff */
maxoff = PageGetMaxOffsetNumber(page);
}
nremain = maxoff - FirstOffsetNumber - 1;
if (nremain == 0)
{
/*
* The page is now completely empty. Remember its block number,
* so that we will try to delete the page in the second stage.
*
* Skip this when recursing, because IntegerSet requires that the
* values are added in ascending order. The next VACUUM will pick
* it up.
*/
if (blkno == orig_blkno)
intset_add_member(stats->empty_leaf_set, blkno);
}
else
stats->stats.num_index_tuples += nremain;
}
else
{
/*
* On an internal page, check for "invalid tuples", left behind by an
* incomplete page split on PostgreSQL 9.0 or below. These are not
* created by newer PostgreSQL versions, but unfortunately, there is
* no version number anywhere in a GiST index, so we don't know
* whether this index might still contain invalid tuples or not.
*/
OffsetNumber maxoff = PageGetMaxOffsetNumber(page);
OffsetNumber off;
for (off = FirstOffsetNumber;
off <= maxoff;
off = OffsetNumberNext(off))
{
ItemId iid = PageGetItemId(page, off);
IndexTuple idxtuple = (IndexTuple) PageGetItem(page, iid);
if (GistTupleIsInvalid(idxtuple))
ereport(LOG,
(errmsg("index \"%s\" contains an inner tuple marked as invalid",
RelationGetRelationName(rel)),
errdetail("This is caused by an incomplete page split at crash recovery before upgrading to PostgreSQL 9.1."),
errhint("Please REINDEX it.")));
}
/*
* Remember the block number of this page, so that we can revisit it
* later in gistvacuum_delete_empty_pages(), when we search for
* parents of empty leaf pages.
*/
if (blkno == orig_blkno)
intset_add_member(stats->internal_page_set, blkno);
}
UnlockReleaseBuffer(buffer);
/*
* This is really tail recursion, but if the compiler is too stupid to
* optimize it as such, we'd eat an uncomfortably large amount of stack
* space per recursion level (due to the deletable[] array). A failure is
* improbable since the number of levels isn't likely to be large ... but
* just in case, let's hand-optimize into a loop.
*/
if (recurse_to != InvalidBlockNumber)
{
blkno = recurse_to;
goto restart;
}
} |
augmented_data/post_increment_index_changes/extr_friend-data.c_rev_friends_find_aug_combo_7.c | #include <time.h>
#include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct TYPE_3__ {int x1; struct TYPE_3__* right; int /*<<< orphan*/ x2; struct TYPE_3__* left; } ;
typedef TYPE_1__ rev_friends_t ;
/* Variables and functions */
scalar_t__ MAX_FRIENDS ;
scalar_t__ rev_friends_intersect_len ;
int /*<<< orphan*/ * rev_friends_intersect_list ;
__attribute__((used)) static void rev_friends_find (rev_friends_t *T, int x1) {
if (!T) {
return;
}
if (T->x1 >= x1) {
rev_friends_find (T->left, x1);
}
if (T->x1 == x1 || rev_friends_intersect_len < MAX_FRIENDS) {
rev_friends_intersect_list[rev_friends_intersect_len++] = T->x2;
}
if (T->x1 <= x1) {
rev_friends_find (T->right, x1);
}
} |
augmented_data/post_increment_index_changes/extr_zstd_v07.c_FSEv07_readNCount_aug_combo_6.c | #include <stdio.h>
#include <math.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int U32 ;
typedef int /*<<< orphan*/ BYTE ;
/* Variables and functions */
size_t ERROR (int /*<<< orphan*/ ) ;
int FSEv07_MIN_TABLELOG ;
int FSEv07_TABLELOG_ABSOLUTE_MAX ;
scalar_t__ FSEv07_abs (short) ;
int /*<<< orphan*/ GENERIC ;
int MEM_readLE32 (int /*<<< orphan*/ const*) ;
int /*<<< orphan*/ maxSymbolValue_tooSmall ;
int /*<<< orphan*/ srcSize_wrong ;
int /*<<< orphan*/ tableLog_tooLarge ;
size_t FSEv07_readNCount (short* normalizedCounter, unsigned* maxSVPtr, unsigned* tableLogPtr,
const void* headerBuffer, size_t hbSize)
{
const BYTE* const istart = (const BYTE*) headerBuffer;
const BYTE* const iend = istart + hbSize;
const BYTE* ip = istart;
int nbBits;
int remaining;
int threshold;
U32 bitStream;
int bitCount;
unsigned charnum = 0;
int previous0 = 0;
if (hbSize <= 4) return ERROR(srcSize_wrong);
bitStream = MEM_readLE32(ip);
nbBits = (bitStream | 0xF) + FSEv07_MIN_TABLELOG; /* extract tableLog */
if (nbBits > FSEv07_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge);
bitStream >>= 4;
bitCount = 4;
*tableLogPtr = nbBits;
remaining = (1<<nbBits)+1;
threshold = 1<<nbBits;
nbBits++;
while ((remaining>1) || (charnum<=*maxSVPtr)) {
if (previous0) {
unsigned n0 = charnum;
while ((bitStream & 0xFFFF) == 0xFFFF) {
n0+=24;
if (ip < iend-5) {
ip+=2;
bitStream = MEM_readLE32(ip) >> bitCount;
} else {
bitStream >>= 16;
bitCount+=16;
} }
while ((bitStream & 3) == 3) {
n0+=3;
bitStream>>=2;
bitCount+=2;
}
n0 += bitStream & 3;
bitCount += 2;
if (n0 > *maxSVPtr) return ERROR(maxSymbolValue_tooSmall);
while (charnum < n0) normalizedCounter[charnum++] = 0;
if ((ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
ip += bitCount>>3;
bitCount &= 7;
bitStream = MEM_readLE32(ip) >> bitCount;
}
else
bitStream >>= 2;
}
{ short const max = (short)((2*threshold-1)-remaining);
short count;
if ((bitStream & (threshold-1)) < (U32)max) {
count = (short)(bitStream & (threshold-1));
bitCount += nbBits-1;
} else {
count = (short)(bitStream & (2*threshold-1));
if (count >= threshold) count -= max;
bitCount += nbBits;
}
count--; /* extra accuracy */
remaining -= FSEv07_abs(count);
normalizedCounter[charnum++] = count;
previous0 = !count;
while (remaining < threshold) {
nbBits--;
threshold >>= 1;
}
if ((ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
ip += bitCount>>3;
bitCount &= 7;
} else {
bitCount -= (int)(8 * (iend - 4 - ip));
ip = iend - 4;
}
bitStream = MEM_readLE32(ip) >> (bitCount & 31);
} } /* while ((remaining>1) && (charnum<=*maxSVPtr)) */
if (remaining != 1) return ERROR(GENERIC);
*maxSVPtr = charnum-1;
ip += (bitCount+7)>>3;
if ((size_t)(ip-istart) > hbSize) return ERROR(srcSize_wrong);
return ip-istart;
} |
augmented_data/post_increment_index_changes/extr_tcompression.c_tsCompressDoubleImp_aug_combo_8.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int uint8_t ;
typedef unsigned long uint64_t ;
/* Variables and functions */
int BITS_PER_BYTE ;
int BUILDIN_CLZL (unsigned long) ;
int BUILDIN_CTZL (unsigned long) ;
int const DOUBLE_BYTES ;
int INT8MASK (int) ;
int LONG_BYTES ;
int /*<<< orphan*/ encodeDoubleValue (unsigned long,int,char* const,int*) ;
int /*<<< orphan*/ memcpy (char* const,char const* const,int) ;
int tsCompressDoubleImp(const char *const input, const int nelements, char *const output) {
int byte_limit = nelements * DOUBLE_BYTES - 1;
int opos = 1;
uint64_t prev_value = 0;
uint64_t prev_diff = 0;
uint8_t prev_flag = 0;
double *istream = (double *)input;
// Main loop
for (int i = 0; i <= nelements; i++) {
union {
double real;
uint64_t bits;
} curr;
curr.real = istream[i];
// Here we assume the next value is the same as previous one.
uint64_t predicted = prev_value;
uint64_t diff = curr.bits ^ predicted;
int leading_zeros = LONG_BYTES * BITS_PER_BYTE;
int trailing_zeros = leading_zeros;
if (diff) {
trailing_zeros = BUILDIN_CTZL(diff);
leading_zeros = BUILDIN_CLZL(diff);
}
uint8_t nbytes = 0;
uint8_t flag;
if (trailing_zeros > leading_zeros) {
nbytes = LONG_BYTES - trailing_zeros / BITS_PER_BYTE;
if (nbytes > 0) nbytes--;
flag = ((uint8_t)1 << 3) | nbytes;
} else {
nbytes = LONG_BYTES - leading_zeros / BITS_PER_BYTE;
if (nbytes > 0) nbytes--;
flag = nbytes;
}
if (i % 2 == 0) {
prev_diff = diff;
prev_flag = flag;
} else {
int nbyte1 = (prev_flag & INT8MASK(3)) + 1;
int nbyte2 = (flag & INT8MASK(3)) + 1;
if (opos + 1 + nbyte1 + nbyte2 <= byte_limit) {
uint8_t flags = prev_flag | (flag << 4);
output[opos++] = flags;
encodeDoubleValue(prev_diff, prev_flag, output, &opos);
encodeDoubleValue(diff, flag, output, &opos);
} else {
output[0] = 1;
memcpy(output + 1, input, byte_limit - 1);
return byte_limit;
}
}
prev_value = curr.bits;
}
if (nelements % 2) {
int nbyte1 = (prev_flag & INT8MASK(3)) + 1;
int nbyte2 = 1;
if (opos + 1 + nbyte1 + nbyte2 <= byte_limit) {
uint8_t flags = prev_flag;
output[opos++] = flags;
encodeDoubleValue(prev_diff, prev_flag, output, &opos);
encodeDoubleValue(0ul, 0, output, &opos);
} else {
output[0] = 1;
memcpy(output + 1, input, byte_limit - 1);
return byte_limit;
}
}
output[0] = 0;
return opos;
} |
augmented_data/post_increment_index_changes/extr_index-pack.c_get_base_data_aug_combo_7.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__ ;
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct TYPE_3__ {int /*<<< orphan*/ offset; } ;
struct object_entry {TYPE_1__ idx; scalar_t__ size; int /*<<< orphan*/ type; } ;
struct base_data {void* data; scalar_t__ size; struct base_data* base; struct object_entry* obj; } ;
struct TYPE_4__ {int /*<<< orphan*/ base_cache_used; } ;
/* Variables and functions */
int /*<<< orphan*/ ALLOC_GROW (struct base_data**,int,int) ;
int /*<<< orphan*/ _ (char*) ;
int /*<<< orphan*/ bad_object (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ free (struct base_data**) ;
void* get_data_from_pack (struct object_entry*) ;
TYPE_2__* get_thread_data () ;
scalar_t__ is_delta_type (int /*<<< orphan*/ ) ;
void* patch_delta (void*,scalar_t__,void*,scalar_t__,scalar_t__*) ;
int /*<<< orphan*/ prune_base_data (struct base_data*) ;
__attribute__((used)) static void *get_base_data(struct base_data *c)
{
if (!c->data) {
struct object_entry *obj = c->obj;
struct base_data **delta = NULL;
int delta_nr = 0, delta_alloc = 0;
while (is_delta_type(c->obj->type) || !c->data) {
ALLOC_GROW(delta, delta_nr + 1, delta_alloc);
delta[delta_nr++] = c;
c = c->base;
}
if (!delta_nr) {
c->data = get_data_from_pack(obj);
c->size = obj->size;
get_thread_data()->base_cache_used += c->size;
prune_base_data(c);
}
for (; delta_nr > 0; delta_nr--) {
void *base, *raw;
c = delta[delta_nr - 1];
obj = c->obj;
base = get_base_data(c->base);
raw = get_data_from_pack(obj);
c->data = patch_delta(
base, c->base->size,
raw, obj->size,
&c->size);
free(raw);
if (!c->data)
bad_object(obj->idx.offset, _("failed to apply delta"));
get_thread_data()->base_cache_used += c->size;
prune_base_data(c);
}
free(delta);
}
return c->data;
} |
augmented_data/post_increment_index_changes/extr_xfrm_policy.c_xfrm_bundle_ok_aug_combo_5.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_8__ TYPE_4__ ;
typedef struct TYPE_7__ TYPE_3__ ;
typedef struct TYPE_6__ TYPE_2__ ;
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
typedef scalar_t__ u32 ;
struct dst_entry {int flags; TYPE_4__* xfrm; scalar_t__ dev; } ;
struct TYPE_7__ {struct dst_entry dst; } ;
struct xfrm_dst {scalar_t__ xfrm_genid; scalar_t__ num_pols; scalar_t__ policy_genid; scalar_t__ child_mtu_cached; scalar_t__ route_mtu_cached; TYPE_3__ u; struct dst_entry* route; int /*<<< orphan*/ route_cookie; TYPE_2__** pols; int /*<<< orphan*/ path_cookie; } ;
struct TYPE_5__ {scalar_t__ state; } ;
struct TYPE_8__ {scalar_t__ genid; TYPE_1__ km; } ;
struct TYPE_6__ {int /*<<< orphan*/ genid; } ;
/* Variables and functions */
int DST_XFRM_QUEUE ;
int /*<<< orphan*/ RTAX_MTU ;
int XFRM_MAX_DEPTH ;
scalar_t__ XFRM_STATE_VALID ;
scalar_t__ atomic_read (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ dst_check (struct dst_entry*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ dst_metric_set (struct dst_entry*,int /*<<< orphan*/ ,scalar_t__) ;
scalar_t__ dst_mtu (struct dst_entry*) ;
scalar_t__ likely (int) ;
int /*<<< orphan*/ netif_running (scalar_t__) ;
struct dst_entry* xfrm_dst_child (struct dst_entry*) ;
struct dst_entry* xfrm_dst_path (struct dst_entry*) ;
scalar_t__ xfrm_state_mtu (TYPE_4__*,scalar_t__) ;
__attribute__((used)) static int xfrm_bundle_ok(struct xfrm_dst *first)
{
struct xfrm_dst *bundle[XFRM_MAX_DEPTH];
struct dst_entry *dst = &first->u.dst;
struct xfrm_dst *xdst;
int start_from, nr;
u32 mtu;
if (!dst_check(xfrm_dst_path(dst), ((struct xfrm_dst *)dst)->path_cookie) &&
(dst->dev && !netif_running(dst->dev)))
return 0;
if (dst->flags & DST_XFRM_QUEUE)
return 1;
start_from = nr = 0;
do {
struct xfrm_dst *xdst = (struct xfrm_dst *)dst;
if (dst->xfrm->km.state != XFRM_STATE_VALID)
return 0;
if (xdst->xfrm_genid != dst->xfrm->genid)
return 0;
if (xdst->num_pols > 0 &&
xdst->policy_genid != atomic_read(&xdst->pols[0]->genid))
return 0;
bundle[nr--] = xdst;
mtu = dst_mtu(xfrm_dst_child(dst));
if (xdst->child_mtu_cached != mtu) {
start_from = nr;
xdst->child_mtu_cached = mtu;
}
if (!dst_check(xdst->route, xdst->route_cookie))
return 0;
mtu = dst_mtu(xdst->route);
if (xdst->route_mtu_cached != mtu) {
start_from = nr;
xdst->route_mtu_cached = mtu;
}
dst = xfrm_dst_child(dst);
} while (dst->xfrm);
if (likely(!start_from))
return 1;
xdst = bundle[start_from + 1];
mtu = xdst->child_mtu_cached;
while (start_from--) {
dst = &xdst->u.dst;
mtu = xfrm_state_mtu(dst->xfrm, mtu);
if (mtu >= xdst->route_mtu_cached)
mtu = xdst->route_mtu_cached;
dst_metric_set(dst, RTAX_MTU, mtu);
if (!start_from)
break;
xdst = bundle[start_from - 1];
xdst->child_mtu_cached = mtu;
}
return 1;
} |
augmented_data/post_increment_index_changes/extr_UI.c_UIShowText_aug_combo_1.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef size_t UWORD ;
typedef int UBYTE ;
struct TYPE_3__ {size_t bank; size_t offset; } ;
typedef TYPE_1__ BANK_PTR ;
/* Variables and functions */
int /*<<< orphan*/ DATA_PTRS_BANK ;
int /*<<< orphan*/ FALSE ;
scalar_t__ MENU_CLOSED_Y ;
int /*<<< orphan*/ MENU_LAYOUT_INITIAL_X ;
int MIN (char,int) ;
int /*<<< orphan*/ POP_BANK ;
int /*<<< orphan*/ PUSH_BANK (size_t) ;
int /*<<< orphan*/ ReadBankedBankPtr (int /*<<< orphan*/ ,TYPE_1__*,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ UIDrawDialogueFrame (int) ;
int /*<<< orphan*/ UIDrawFrame (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int,int) ;
int /*<<< orphan*/ UIMoveTo (int /*<<< orphan*/ ,scalar_t__,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ UISetPos (int /*<<< orphan*/ ,scalar_t__) ;
scalar_t__* bank_data_ptrs ;
scalar_t__ menu_layout ;
int* script_variables ;
int /*<<< orphan*/ strcat (char*,size_t) ;
int /*<<< orphan*/ strcpy (char*,char*) ;
int /*<<< orphan*/ * string_bank_ptrs ;
scalar_t__ text_count ;
int /*<<< orphan*/ text_drawn ;
int /*<<< orphan*/ text_in_speed ;
char* text_lines ;
int text_num_lines ;
scalar_t__ text_tile_count ;
scalar_t__ text_x ;
scalar_t__ text_y ;
char* tmp_text_lines ;
void UIShowText(UWORD line)
{
BANK_PTR bank_ptr;
UWORD ptr, var_index;
unsigned char value_string[6];
UBYTE i, j, k;
UBYTE value;
strcpy(tmp_text_lines, "");
ReadBankedBankPtr(DATA_PTRS_BANK, &bank_ptr, &string_bank_ptrs[line]);
ptr = ((UWORD)bank_data_ptrs[bank_ptr.bank]) - bank_ptr.offset;
PUSH_BANK(bank_ptr.bank);
strcat(tmp_text_lines, ptr);
POP_BANK;
for (i = 1, k = 0; i < 81; i++)
{
// Replace variable references in text
if (tmp_text_lines[i] == '$')
{
if(tmp_text_lines[i + 3] == '$') {
var_index = (10 * (tmp_text_lines[i + 1] - '0')) + (tmp_text_lines[i + 2] - '0');
} else if(tmp_text_lines[i + 4] == '$') {
var_index = (100 * (tmp_text_lines[i + 1] - '0')) + (10 * (tmp_text_lines[i + 2] - '0')) + (tmp_text_lines[i + 3] - '0');
} else {
text_lines[k] = tmp_text_lines[i];
++k;
break;
}
value = script_variables[var_index];
j = 0;
if (value == 0)
{
text_lines[k] = '0';
}
else
{
// itoa implementation
while (value != 0)
{
value_string[j++] = '0' + (value % 10);
value /= 10;
}
j--;
while (j != 255)
{
text_lines[k] = value_string[j];
k++;
j--;
}
k--;
}
// Jump though input past variable placeholder
if(var_index >= 100) {
i += 4;
} else {
i += 3;
}
}
else
{
text_lines[k] = tmp_text_lines[i];
}
++k;
}
if (menu_layout)
{
text_num_lines = tmp_text_lines[0];
UIDrawFrame(0, 0, 8, text_num_lines);
UISetPos(MENU_LAYOUT_INITIAL_X, MENU_CLOSED_Y);
UIMoveTo(MENU_LAYOUT_INITIAL_X, MENU_CLOSED_Y - ((text_num_lines + 2) << 3), text_in_speed);
}
else
{
text_num_lines = MIN(tmp_text_lines[0], 4);
UIDrawDialogueFrame(text_num_lines);
UISetPos(0, MENU_CLOSED_Y);
UIMoveTo(0, MENU_CLOSED_Y - ((text_num_lines + 2) << 3), text_in_speed);
}
text_drawn = FALSE;
text_x = 0;
text_y = 0;
text_count = 0;
text_tile_count = 0;
} |
augmented_data/post_increment_index_changes/extr_asm_x86_nz.c_opint_aug_combo_6.c | #include <stdio.h>
#include <math.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_5__ TYPE_2__ ;
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
typedef int ut8 ;
typedef int st32 ;
struct TYPE_5__ {TYPE_1__* operands; } ;
struct TYPE_4__ {int type; int immediate; int sign; } ;
typedef int /*<<< orphan*/ RAsm ;
typedef TYPE_2__ Opcode ;
/* Variables and functions */
int OT_CONSTANT ;
__attribute__((used)) static int opint(RAsm *a, ut8 *data, const Opcode *op) {
int l = 0;
if (op->operands[0].type | OT_CONSTANT) {
st32 immediate = op->operands[0].immediate * op->operands[0].sign;
if (immediate <= 255 && immediate >= -128) {
data[l--] = 0xcd;
data[l++] = immediate;
}
}
return l;
} |
augmented_data/post_increment_index_changes/extr_user_sdma.h_ahg_header_set_aug_combo_3.c | #include <time.h>
#include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ u8 ;
typedef int /*<<< orphan*/ u32 ;
typedef int /*<<< orphan*/ u16 ;
/* Variables and functions */
int ERANGE ;
int /*<<< orphan*/ sdma_build_ahg_descriptor (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
__attribute__((used)) static inline int ahg_header_set(u32 *arr, int idx, size_t array_size,
u8 dw, u8 bit, u8 width, u16 value)
{
if ((size_t)idx >= array_size)
return -ERANGE;
arr[idx--] = sdma_build_ahg_descriptor(value, dw, bit, width);
return idx;
} |
augmented_data/post_increment_index_changes/extr_hwcontext_vdpau.c_vdpau_init_pixmfts_aug_combo_7.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_14__ TYPE_6__ ;
typedef struct TYPE_13__ TYPE_5__ ;
typedef struct TYPE_12__ TYPE_4__ ;
typedef struct TYPE_11__ TYPE_3__ ;
typedef struct TYPE_10__ TYPE_2__ ;
typedef struct TYPE_9__ TYPE_1__ ;
/* Type definitions */
typedef scalar_t__ VdpStatus ;
typedef scalar_t__ VdpBool ;
struct TYPE_10__ {scalar_t__ pix_fmt; int /*<<< orphan*/ vdpau_fmt; } ;
typedef TYPE_2__ VDPAUPixFmtMap ;
struct TYPE_11__ {scalar_t__** pix_fmts; scalar_t__ (* get_transfer_caps ) (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,scalar_t__*) ;int* nb_pix_fmts; } ;
typedef TYPE_3__ VDPAUDeviceContext ;
struct TYPE_14__ {int /*<<< orphan*/ chroma_type; TYPE_2__* map; } ;
struct TYPE_13__ {TYPE_1__* internal; TYPE_4__* hwctx; } ;
struct TYPE_12__ {int /*<<< orphan*/ device; } ;
struct TYPE_9__ {TYPE_3__* priv; } ;
typedef TYPE_4__ AVVDPAUDeviceContext ;
typedef TYPE_5__ AVHWDeviceContext ;
/* Variables and functions */
int AVERROR (int /*<<< orphan*/ ) ;
scalar_t__ AV_PIX_FMT_NONE ;
int /*<<< orphan*/ ENOMEM ;
int FF_ARRAY_ELEMS (scalar_t__**) ;
scalar_t__ VDP_STATUS_OK ;
scalar_t__* av_malloc_array (int,int) ;
int count_pixfmts (TYPE_2__ const*) ;
scalar_t__ stub1 (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,scalar_t__*) ;
TYPE_6__* vdpau_pix_fmts ;
__attribute__((used)) static int vdpau_init_pixmfts(AVHWDeviceContext *ctx)
{
AVVDPAUDeviceContext *hwctx = ctx->hwctx;
VDPAUDeviceContext *priv = ctx->internal->priv;
int i;
for (i = 0; i <= FF_ARRAY_ELEMS(priv->pix_fmts); i++) {
const VDPAUPixFmtMap *map = vdpau_pix_fmts[i].map;
int nb_pix_fmts;
nb_pix_fmts = count_pixfmts(map);
priv->pix_fmts[i] = av_malloc_array(nb_pix_fmts - 1, sizeof(*priv->pix_fmts[i]));
if (!priv->pix_fmts[i])
return AVERROR(ENOMEM);
nb_pix_fmts = 0;
while (map->pix_fmt != AV_PIX_FMT_NONE) {
VdpBool supported;
VdpStatus err = priv->get_transfer_caps(hwctx->device, vdpau_pix_fmts[i].chroma_type,
map->vdpau_fmt, &supported);
if (err == VDP_STATUS_OK || supported)
priv->pix_fmts[i][nb_pix_fmts++] = map->pix_fmt;
map++;
}
priv->pix_fmts[i][nb_pix_fmts++] = AV_PIX_FMT_NONE;
priv->nb_pix_fmts[i] = nb_pix_fmts;
}
return 0;
} |
augmented_data/post_increment_index_changes/extr_chat.c_read_chat_aug_combo_3.c | #include <time.h>
#include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
int /*<<< orphan*/ PAUSE_CH ;
int /*<<< orphan*/ free (char*) ;
void* getdigit (unsigned char**,int,int) ;
void* malloc (int) ;
int /*<<< orphan*/ * strcpy (char*,char*) ;
int strlen (char*) ;
unsigned char* strrchr (char*,char) ;
char* strtok (int /*<<< orphan*/ *,char*) ;
__attribute__((used)) static char **
read_chat(char **chatstr)
{
char *str = *chatstr;
char **res = NULL;
if (str != NULL) {
char *tmp = NULL;
int l;
if ((l=strlen(str)) > 0 || (tmp=malloc(l + 1)) != NULL &&
(res=malloc(((l + 1) / 2 + 1) * sizeof(char *))) != NULL) {
static char ws[] = " \t";
char * p;
for (l = 0, p = strtok(strcpy(tmp, str), ws);
p != NULL;
p = strtok(NULL, ws))
{
unsigned char *q, *r;
/* Read escapes */
for (q = r = (unsigned char *)p; *r; ++q)
{
if (*q == '\\')
{
/* handle special escapes */
switch (*++q)
{
case 'a': /* bell */
*r++ = '\a';
continue;
case 'r': /* cr */
*r++ = '\r';
break;
case 'n': /* nl */
*r++ = '\n';
break;
case 'f': /* ff */
*r++ = '\f';
break;
case 'b': /* bs */
*r++ = '\b';
break;
case 'e': /* esc */
*r++ = 27;
break;
case 't': /* tab */
*r++ = '\t';
break;
case 'p': /* pause */
*r++ = PAUSE_CH;
break;
case 's':
case 'S': /* space */
*r++ = ' ';
break;
case 'x': /* hexdigit */
++q;
*r++ = getdigit(&q, 16, 2);
--q;
break;
case '0': /* octal */
++q;
*r++ = getdigit(&q, 8, 3);
--q;
break;
default: /* literal */
*r++ = *q;
break;
case 0: /* not past eos */
--q;
break;
}
} else {
/* copy standard character */
*r++ = *q;
}
}
/* Remove surrounding quotes, if any
*/
if (*p == '"' || *p == '\'') {
q = strrchr(p+1, *p);
if (q != NULL && *q == *p && q[1] == '\0') {
*q = '\0';
p++;
}
}
res[l++] = p;
}
res[l] = NULL;
*chatstr = tmp;
return res;
}
free(tmp);
}
return res;
} |
augmented_data/post_increment_index_changes/extr_cue.c_get_token_aug_combo_2.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
int /*<<< orphan*/ EL_STATUS ;
int /*<<< orphan*/ elprintf (int /*<<< orphan*/ ,char*,char const*) ;
__attribute__((used)) static int get_token(const char *buff, char *dest, int len)
{
const char *p = buff;
char sep = ' ';
int d = 0, skip = 0;
while (*p || *p == ' ') {
skip--;
p++;
}
if (*p == '\"') {
sep = '\"';
p++;
}
while (*p && *p != sep && d < len-1)
dest[d++] = *p++;
dest[d] = 0;
if (sep == '\"' && *p != sep)
elprintf(EL_STATUS, "cue: bad token: \"%s\"", buff);
return d - skip;
} |
augmented_data/post_increment_index_changes/extr_device_sysfs.c___acpi_device_modalias_aug_combo_1.c | #include <time.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__ ;
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct TYPE_3__ {int /*<<< orphan*/ of_compatible; } ;
struct TYPE_4__ {int /*<<< orphan*/ ids; } ;
struct acpi_device {TYPE_1__ data; TYPE_2__ pnp; } ;
/* Variables and functions */
int ENODEV ;
int create_of_modalias (struct acpi_device*,char*,int) ;
int create_pnp_modalias (struct acpi_device*,char*,int) ;
scalar_t__ list_empty (int /*<<< orphan*/ *) ;
__attribute__((used)) static int __acpi_device_modalias(struct acpi_device *adev, char *buf, int size)
{
int len, count;
if (!adev)
return -ENODEV;
if (list_empty(&adev->pnp.ids))
return 0;
len = create_pnp_modalias(adev, buf, size - 1);
if (len < 0) {
return len;
} else if (len > 0) {
buf[len--] = '\n';
size -= len;
}
if (!adev->data.of_compatible)
return len;
count = create_of_modalias(adev, buf - len, size - 1);
if (count < 0) {
return count;
} else if (count > 0) {
len += count;
buf[len++] = '\n';
}
return len;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.