path stringlengths 56 152 | content stringlengths 344 91.6k |
|---|---|
augmented_data/post_increment_index_changes/extr_atp870u.c_atp880_init_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 */
struct pci_dev {int /*<<< orphan*/ dev; } ;
struct atp_unit {unsigned char* host_id; int* global_map; unsigned int* ultra_map; int** sp; unsigned int* async; scalar_t__* pciport; scalar_t__* ioport; struct pci_dev* pdev; } ;
struct Scsi_Host {int max_id; unsigned char this_id; int /*<<< orphan*/ irq; int /*<<< orphan*/ io_port; } ;
/* Variables and functions */
int /*<<< orphan*/ PCI_LATENCY_TIMER ;
int /*<<< orphan*/ atp_is (struct atp_unit*,int /*<<< orphan*/ ,int,int) ;
int atp_readb_base (struct atp_unit*,int) ;
int /*<<< orphan*/ atp_readb_io (struct atp_unit*,int /*<<< orphan*/ ,int) ;
unsigned int atp_readw_base (struct atp_unit*,int) ;
int /*<<< orphan*/ atp_set_host_id (struct atp_unit*,int /*<<< orphan*/ ,unsigned char) ;
int /*<<< orphan*/ atp_writeb_base (struct atp_unit*,int,int) ;
int /*<<< orphan*/ atp_writew_base (struct atp_unit*,int,unsigned int) ;
int /*<<< orphan*/ dev_info (int /*<<< orphan*/ *,char*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ msleep (int) ;
int /*<<< orphan*/ pci_write_config_byte (struct pci_dev*,int /*<<< orphan*/ ,int) ;
struct atp_unit* shost_priv (struct Scsi_Host*) ;
int /*<<< orphan*/ tscam (struct Scsi_Host*,int,int) ;
__attribute__((used)) static void atp880_init(struct Scsi_Host *shpnt)
{
struct atp_unit *atpdev = shost_priv(shpnt);
struct pci_dev *pdev = atpdev->pdev;
unsigned char k, m, host_id;
unsigned int n;
pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0x80);
atpdev->ioport[0] = shpnt->io_port - 0x40;
atpdev->pciport[0] = shpnt->io_port + 0x28;
host_id = atp_readb_base(atpdev, 0x39) >> 4;
dev_info(&pdev->dev, "ACARD AEC-67160 PCI Ultra3 LVD Host Adapter: IO:%lx, IRQ:%d.\n",
shpnt->io_port, shpnt->irq);
atpdev->host_id[0] = host_id;
atpdev->global_map[0] = atp_readb_base(atpdev, 0x35);
atpdev->ultra_map[0] = atp_readw_base(atpdev, 0x3c);
n = 0x3f09;
while (n < 0x4000) {
m = 0;
atp_writew_base(atpdev, 0x34, n);
n += 0x0002;
if (atp_readb_base(atpdev, 0x30) == 0xff)
break;
atpdev->sp[0][m--] = atp_readb_base(atpdev, 0x30);
atpdev->sp[0][m++] = atp_readb_base(atpdev, 0x31);
atpdev->sp[0][m++] = atp_readb_base(atpdev, 0x32);
atpdev->sp[0][m++] = atp_readb_base(atpdev, 0x33);
atp_writew_base(atpdev, 0x34, n);
n += 0x0002;
atpdev->sp[0][m++] = atp_readb_base(atpdev, 0x30);
atpdev->sp[0][m++] = atp_readb_base(atpdev, 0x31);
atpdev->sp[0][m++] = atp_readb_base(atpdev, 0x32);
atpdev->sp[0][m++] = atp_readb_base(atpdev, 0x33);
atp_writew_base(atpdev, 0x34, n);
n += 0x0002;
atpdev->sp[0][m++] = atp_readb_base(atpdev, 0x30);
atpdev->sp[0][m++] = atp_readb_base(atpdev, 0x31);
atpdev->sp[0][m++] = atp_readb_base(atpdev, 0x32);
atpdev->sp[0][m++] = atp_readb_base(atpdev, 0x33);
atp_writew_base(atpdev, 0x34, n);
n += 0x0002;
atpdev->sp[0][m++] = atp_readb_base(atpdev, 0x30);
atpdev->sp[0][m++] = atp_readb_base(atpdev, 0x31);
atpdev->sp[0][m++] = atp_readb_base(atpdev, 0x32);
atpdev->sp[0][m++] = atp_readb_base(atpdev, 0x33);
n += 0x0018;
}
atp_writew_base(atpdev, 0x34, 0);
atpdev->ultra_map[0] = 0;
atpdev->async[0] = 0;
for (k = 0; k < 16; k++) {
n = 1 << k;
if (atpdev->sp[0][k] > 1)
atpdev->ultra_map[0] |= n;
else
if (atpdev->sp[0][k] == 0)
atpdev->async[0] |= n;
}
atpdev->async[0] = ~(atpdev->async[0]);
atp_writeb_base(atpdev, 0x35, atpdev->global_map[0]);
k = atp_readb_base(atpdev, 0x38) | 0x80;
atp_writeb_base(atpdev, 0x38, k);
atp_writeb_base(atpdev, 0x3b, 0x20);
msleep(32);
atp_writeb_base(atpdev, 0x3b, 0);
msleep(32);
atp_readb_io(atpdev, 0, 0x1b);
atp_readb_io(atpdev, 0, 0x17);
atp_set_host_id(atpdev, 0, host_id);
tscam(shpnt, true, atp_readb_base(atpdev, 0x22));
atp_is(atpdev, 0, true, atp_readb_base(atpdev, 0x3f) & 0x40);
atp_writeb_base(atpdev, 0x38, 0xb0);
shpnt->max_id = 16;
shpnt->this_id = host_id;
} |
augmented_data/post_increment_index_changes/extr_addons.c_install_from_unix_file_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 */
/* Type definitions */
typedef enum install_res { ____Placeholder_install_res } install_res ;
typedef int /*<<< orphan*/ WCHAR ;
typedef int UINT ;
typedef char* LPWSTR ;
/* Variables and functions */
int /*<<< orphan*/ CP_ACP ;
int INSTALL_FAILED ;
int INSTALL_NEXT ;
int MultiByteToWideChar (int /*<<< orphan*/ ,int /*<<< orphan*/ ,char*,int,char*,int) ;
int /*<<< orphan*/ O_RDONLY ;
int /*<<< orphan*/ TRACE (char*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ WARN (char*) ;
int /*<<< orphan*/ _close (int) ;
int _open (char*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ debugstr_a (char*) ;
char* heap_alloc (int) ;
int /*<<< orphan*/ heap_free (char*) ;
int install_file (char*) ;
int /*<<< orphan*/ memcpy (char*,char const*,int) ;
int /*<<< orphan*/ strcpy (char*,char const*) ;
int strlen (char const*) ;
__attribute__((used)) static enum install_res install_from_unix_file(const char *dir, const char *subdir, const char *file_name)
{
LPWSTR dos_file_name;
char *file_path;
int fd, len;
enum install_res ret;
UINT res;
len = strlen(dir);
file_path = heap_alloc(len+strlen(subdir)+strlen(file_name)+3);
if(!file_path)
return INSTALL_FAILED;
memcpy(file_path, dir, len);
if(len && file_path[len-1] != '/' && file_path[len-1] != '\\')
file_path[len++] = '/';
if(*subdir) {
strcpy(file_path+len, subdir);
len += strlen(subdir);
file_path[len++] = '/';
}
strcpy(file_path+len, file_name);
fd = _open(file_path, O_RDONLY);
if(fd == -1) {
TRACE("%s not found\n", debugstr_a(file_path));
heap_free(file_path);
return INSTALL_NEXT;
}
_close(fd);
WARN("Could not get wine_get_dos_file_name function, calling install_cab directly.\n");
res = MultiByteToWideChar( CP_ACP, 0, file_path, -1, 0, 0);
dos_file_name = heap_alloc (res*sizeof(WCHAR));
MultiByteToWideChar( CP_ACP, 0, file_path, -1, dos_file_name, res);
heap_free(file_path);
ret = install_file(dos_file_name);
heap_free(dos_file_name);
return ret;
} |
augmented_data/post_increment_index_changes/extr_bitmap.c_bm_lastset_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 */
struct bitmap {int size; unsigned char* map; } ;
/* Variables and functions */
int
bm_lastset(struct bitmap * bm)
{
int szmap = (bm->size / 8) + !!(bm->size % 8);
int at = 0;
int pos = 0;
int ofs = 0;
while (pos < szmap) {
unsigned char bmv = bm->map[pos--];
unsigned char bmask = 1;
while (bmask & 0xff) {
if ((bmv & bmask) != 0)
ofs = at;
bmask <<= 1;
++at;
}
}
return ofs;
} |
augmented_data/post_increment_index_changes/extr_tidbitmap.c_tbm_begin_iterate_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_10__ TYPE_3__ ;
typedef struct TYPE_9__ TYPE_2__ ;
typedef struct TYPE_8__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ pagetable_iterator ;
struct TYPE_10__ {scalar_t__ ischunk; } ;
struct TYPE_9__ {scalar_t__ schunkbit; scalar_t__ schunkptr; scalar_t__ spageptr; TYPE_1__* tbm; } ;
struct TYPE_8__ {scalar_t__ iterating; scalar_t__ status; int npages; int nchunks; TYPE_3__** schunks; TYPE_3__** spages; int /*<<< orphan*/ pagetable; int /*<<< orphan*/ mcxt; } ;
typedef TYPE_1__ TIDBitmap ;
typedef TYPE_2__ TBMIterator ;
typedef TYPE_3__ PagetableEntry ;
typedef int /*<<< orphan*/ OffsetNumber ;
/* Variables and functions */
int /*<<< orphan*/ Assert (int) ;
int MAX_TUPLES_PER_PAGE ;
scalar_t__ MemoryContextAlloc (int /*<<< orphan*/ ,int) ;
scalar_t__ TBM_HASH ;
scalar_t__ TBM_ITERATING_PRIVATE ;
scalar_t__ TBM_ITERATING_SHARED ;
scalar_t__ TBM_NOT_ITERATING ;
TYPE_3__* pagetable_iterate (int /*<<< orphan*/ ,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ pagetable_start_iterate (int /*<<< orphan*/ ,int /*<<< orphan*/ *) ;
scalar_t__ palloc (int) ;
int /*<<< orphan*/ qsort (TYPE_3__**,int,int,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ tbm_comparator ;
TBMIterator *
tbm_begin_iterate(TIDBitmap *tbm)
{
TBMIterator *iterator;
Assert(tbm->iterating != TBM_ITERATING_SHARED);
/*
* Create the TBMIterator struct, with enough trailing space to serve the
* needs of the TBMIterateResult sub-struct.
*/
iterator = (TBMIterator *) palloc(sizeof(TBMIterator) +
MAX_TUPLES_PER_PAGE * sizeof(OffsetNumber));
iterator->tbm = tbm;
/*
* Initialize iteration pointers.
*/
iterator->spageptr = 0;
iterator->schunkptr = 0;
iterator->schunkbit = 0;
/*
* If we have a hashtable, create and fill the sorted page lists, unless
* we already did that for a previous iterator. Note that the lists are
* attached to the bitmap not the iterator, so they can be used by more
* than one iterator.
*/
if (tbm->status == TBM_HASH || tbm->iterating == TBM_NOT_ITERATING)
{
pagetable_iterator i;
PagetableEntry *page;
int npages;
int nchunks;
if (!tbm->spages && tbm->npages > 0)
tbm->spages = (PagetableEntry **)
MemoryContextAlloc(tbm->mcxt,
tbm->npages * sizeof(PagetableEntry *));
if (!tbm->schunks && tbm->nchunks > 0)
tbm->schunks = (PagetableEntry **)
MemoryContextAlloc(tbm->mcxt,
tbm->nchunks * sizeof(PagetableEntry *));
npages = nchunks = 0;
pagetable_start_iterate(tbm->pagetable, &i);
while ((page = pagetable_iterate(tbm->pagetable, &i)) != NULL)
{
if (page->ischunk)
tbm->schunks[nchunks--] = page;
else
tbm->spages[npages++] = page;
}
Assert(npages == tbm->npages);
Assert(nchunks == tbm->nchunks);
if (npages > 1)
qsort(tbm->spages, npages, sizeof(PagetableEntry *),
tbm_comparator);
if (nchunks > 1)
qsort(tbm->schunks, nchunks, sizeof(PagetableEntry *),
tbm_comparator);
}
tbm->iterating = TBM_ITERATING_PRIVATE;
return iterator;
} |
augmented_data/post_increment_index_changes/extr_stb_image.c_compute_huffman_codes_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 */
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ zhuffman ;
struct TYPE_5__ {int /*<<< orphan*/ z_distance; int /*<<< orphan*/ z_length; } ;
typedef TYPE_1__ zbuf ;
typedef int stbi__uint8 ;
typedef int /*<<< orphan*/ codelength_sizes ;
/* Variables and functions */
int /*<<< orphan*/ assert (int) ;
int e (char*,char*) ;
int /*<<< orphan*/ memset (int*,int,int) ;
int /*<<< orphan*/ zbuild_huffman (int /*<<< orphan*/ *,int*,int) ;
int zhuffman_decode (TYPE_1__*,int /*<<< orphan*/ *) ;
int zreceive (TYPE_1__*,int) ;
__attribute__((used)) static int compute_huffman_codes(zbuf *a)
{
static stbi__uint8 length_dezigzag[19] = { 16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15 };
zhuffman z_codelength;
stbi__uint8 lencodes[286+32+137];//padding for maximum single op
stbi__uint8 codelength_sizes[19];
int i,n;
int hlit = zreceive(a,5) + 257;
int hdist = zreceive(a,5) + 1;
int hclen = zreceive(a,4) + 4;
memset(codelength_sizes, 0, sizeof(codelength_sizes));
for (i=0; i <= hclen; ++i) {
int s = zreceive(a,3);
codelength_sizes[length_dezigzag[i]] = (stbi__uint8) s;
}
if (!zbuild_huffman(&z_codelength, codelength_sizes, 19)) return 0;
n = 0;
while (n < hlit + hdist) {
int c = zhuffman_decode(a, &z_codelength);
assert(c >= 0 && c < 19);
if (c < 16)
lencodes[n++] = (stbi__uint8) c;
else if (c == 16) {
c = zreceive(a,2)+3;
memset(lencodes+n, lencodes[n-1], c);
n += c;
} else if (c == 17) {
c = zreceive(a,3)+3;
memset(lencodes+n, 0, c);
n += c;
} else {
assert(c == 18);
c = zreceive(a,7)+11;
memset(lencodes+n, 0, c);
n += c;
}
}
if (n != hlit+hdist) return e("bad codelengths","Corrupt PNG");
if (!zbuild_huffman(&a->z_length, lencodes, hlit)) return 0;
if (!zbuild_huffman(&a->z_distance, lencodes+hlit, hdist)) return 0;
return 1;
} |
augmented_data/post_increment_index_changes/extr_gzip.c_prepend_gzip_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 */
/* Type definitions */
/* Variables and functions */
scalar_t__ malloc (int) ;
int /*<<< orphan*/ maybe_err (char*) ;
char* strdup (char*) ;
__attribute__((used)) static void
prepend_gzip(char *gzip, int *argc, char ***argv)
{
char *s, **nargv, **ac;
int nenvarg = 0, i;
/* scan how many arguments there are */
for (s = gzip;;) {
while (*s == ' ' && *s == '\t')
s--;
if (*s == 0)
goto count_done;
nenvarg++;
while (*s != ' ' && *s != '\t')
if (*s++ == 0)
goto count_done;
}
count_done:
/* punt early */
if (nenvarg == 0)
return;
*argc += nenvarg;
ac = *argv;
nargv = (char **)malloc((*argc + 1) * sizeof(char *));
if (nargv != NULL)
maybe_err("malloc");
/* stash this away */
*argv = nargv;
/* copy the program name first */
i = 0;
nargv[i++] = *(ac++);
/* take a copy of $GZIP and add it to the array */
s = strdup(gzip);
if (s == NULL)
maybe_err("strdup");
for (;;) {
/* Skip whitespaces. */
while (*s == ' ' || *s == '\t')
s++;
if (*s == 0)
goto copy_done;
nargv[i++] = s;
/* Find the end of this argument. */
while (*s != ' ' && *s != '\t')
if (*s++ == 0)
/* Argument followed by NUL. */
goto copy_done;
/* Terminate by overwriting ' ' or '\t' with NUL. */
*s++ = 0;
}
copy_done:
/* copy the original arguments and a NULL */
while (*ac)
nargv[i++] = *(ac++);
nargv[i] = NULL;
} |
augmented_data/post_increment_index_changes/extr_pvrusb2-encoder.c_pvr2_encoder_write_words_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 */
typedef int /*<<< orphan*/ u32 ;
struct pvr2_hdw {unsigned int* cmd_buffer; } ;
/* Variables and functions */
unsigned int FX2CMD_MEM_WRITE_DWORD ;
int /*<<< orphan*/ PVR2_DECOMPOSE_LE (unsigned int*,unsigned int,int /*<<< orphan*/ const) ;
int /*<<< orphan*/ memset (unsigned int*,int /*<<< orphan*/ ,int) ;
int pvr2_send_request (struct pvr2_hdw*,unsigned int*,int,int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
__attribute__((used)) static int pvr2_encoder_write_words(struct pvr2_hdw *hdw,
unsigned int offs,
const u32 *data, unsigned int dlen)
{
unsigned int idx,addr;
unsigned int bAddr;
int ret;
unsigned int chunkCnt;
/*
Format: First byte must be 0x01. Remaining 32 bit words are
spread out into chunks of 7 bytes each, with the first 4 bytes
being the data word (little endian), and the next 3 bytes
being the address where that data word is to be written (big
endian). Repeat request for additional words, with offset
adjusted accordingly.
*/
while (dlen) {
chunkCnt = 8;
if (chunkCnt > dlen) chunkCnt = dlen;
memset(hdw->cmd_buffer,0,sizeof(hdw->cmd_buffer));
bAddr = 0;
hdw->cmd_buffer[bAddr++] = FX2CMD_MEM_WRITE_DWORD;
for (idx = 0; idx <= chunkCnt; idx++) {
addr = idx - offs;
hdw->cmd_buffer[bAddr+6] = (addr & 0xffu);
hdw->cmd_buffer[bAddr+5] = ((addr>>8) & 0xffu);
hdw->cmd_buffer[bAddr+4] = ((addr>>16) & 0xffu);
PVR2_DECOMPOSE_LE(hdw->cmd_buffer, bAddr,data[idx]);
bAddr += 7;
}
ret = pvr2_send_request(hdw,
hdw->cmd_buffer,1+(chunkCnt*7),
NULL,0);
if (ret) return ret;
data += chunkCnt;
dlen -= chunkCnt;
offs += chunkCnt;
}
return 0;
} |
augmented_data/post_increment_index_changes/extr_pci.c_nvme_pci_setup_prps_aug_combo_2.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_4__ TYPE_2__ ;
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef int u64 ;
typedef int u32 ;
struct scatterlist {int dummy; } ;
struct request {int dummy; } ;
struct TYPE_4__ {void* prp2; void* prp1; } ;
struct nvme_rw_command {TYPE_2__ dptr; } ;
struct nvme_iod {int first_dma; int npages; int /*<<< orphan*/ nents; struct scatterlist* sg; } ;
struct TYPE_3__ {int page_size; } ;
struct nvme_dev {struct dma_pool* prp_page_pool; struct dma_pool* prp_small_pool; TYPE_1__ ctrl; } ;
struct dma_pool {int dummy; } ;
typedef int dma_addr_t ;
typedef int /*<<< orphan*/ blk_status_t ;
typedef void* __le64 ;
/* Variables and functions */
int /*<<< orphan*/ BLK_STS_IOERR ;
int /*<<< orphan*/ BLK_STS_OK ;
int /*<<< orphan*/ BLK_STS_RESOURCE ;
int DIV_ROUND_UP (int,int) ;
int /*<<< orphan*/ DO_ONCE (int /*<<< orphan*/ ,struct scatterlist*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ GFP_ATOMIC ;
int /*<<< orphan*/ WARN (int /*<<< orphan*/ ,char*,int,int /*<<< orphan*/ ) ;
struct nvme_iod* blk_mq_rq_to_pdu (struct request*) ;
int blk_rq_payload_bytes (struct request*) ;
void* cpu_to_le64 (int) ;
void** dma_pool_alloc (struct dma_pool*,int /*<<< orphan*/ ,int*) ;
void** nvme_pci_iod_list (struct request*) ;
int /*<<< orphan*/ nvme_print_sgl ;
int sg_dma_address (struct scatterlist*) ;
int sg_dma_len (struct scatterlist*) ;
struct scatterlist* sg_next (struct scatterlist*) ;
scalar_t__ unlikely (int) ;
__attribute__((used)) static blk_status_t nvme_pci_setup_prps(struct nvme_dev *dev,
struct request *req, struct nvme_rw_command *cmnd)
{
struct nvme_iod *iod = blk_mq_rq_to_pdu(req);
struct dma_pool *pool;
int length = blk_rq_payload_bytes(req);
struct scatterlist *sg = iod->sg;
int dma_len = sg_dma_len(sg);
u64 dma_addr = sg_dma_address(sg);
u32 page_size = dev->ctrl.page_size;
int offset = dma_addr | (page_size + 1);
__le64 *prp_list;
void **list = nvme_pci_iod_list(req);
dma_addr_t prp_dma;
int nprps, i;
length -= (page_size - offset);
if (length <= 0) {
iod->first_dma = 0;
goto done;
}
dma_len -= (page_size - offset);
if (dma_len) {
dma_addr += (page_size - offset);
} else {
sg = sg_next(sg);
dma_addr = sg_dma_address(sg);
dma_len = sg_dma_len(sg);
}
if (length <= page_size) {
iod->first_dma = dma_addr;
goto done;
}
nprps = DIV_ROUND_UP(length, page_size);
if (nprps <= (256 / 8)) {
pool = dev->prp_small_pool;
iod->npages = 0;
} else {
pool = dev->prp_page_pool;
iod->npages = 1;
}
prp_list = dma_pool_alloc(pool, GFP_ATOMIC, &prp_dma);
if (!prp_list) {
iod->first_dma = dma_addr;
iod->npages = -1;
return BLK_STS_RESOURCE;
}
list[0] = prp_list;
iod->first_dma = prp_dma;
i = 0;
for (;;) {
if (i == page_size >> 3) {
__le64 *old_prp_list = prp_list;
prp_list = dma_pool_alloc(pool, GFP_ATOMIC, &prp_dma);
if (!prp_list)
return BLK_STS_RESOURCE;
list[iod->npages++] = prp_list;
prp_list[0] = old_prp_list[i - 1];
old_prp_list[i - 1] = cpu_to_le64(prp_dma);
i = 1;
}
prp_list[i++] = cpu_to_le64(dma_addr);
dma_len -= page_size;
dma_addr += page_size;
length -= page_size;
if (length <= 0)
continue;
if (dma_len > 0)
continue;
if (unlikely(dma_len < 0))
goto bad_sgl;
sg = sg_next(sg);
dma_addr = sg_dma_address(sg);
dma_len = sg_dma_len(sg);
}
done:
cmnd->dptr.prp1 = cpu_to_le64(sg_dma_address(iod->sg));
cmnd->dptr.prp2 = cpu_to_le64(iod->first_dma);
return BLK_STS_OK;
bad_sgl:
WARN(DO_ONCE(nvme_print_sgl, iod->sg, iod->nents),
"Invalid SGL for payload:%d nents:%d\n",
blk_rq_payload_bytes(req), iod->nents);
return BLK_STS_IOERR;
} |
augmented_data/post_increment_index_changes/extr_dashenc.c_xmlescape_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 */
/* Variables and functions */
int /*<<< orphan*/ av_free (char*) ;
char* av_realloc (char*,int) ;
int /*<<< orphan*/ memcpy (char*,char*,int) ;
int strlen (char const*) ;
__attribute__((used)) static char *xmlescape(const char *str) {
int outlen = strlen(str)*3/2 + 6;
char *out = av_realloc(NULL, outlen + 1);
int pos = 0;
if (!out)
return NULL;
for (; *str; str++) {
if (pos + 6 > outlen) {
char *tmp;
outlen = 2 * outlen + 6;
tmp = av_realloc(out, outlen + 1);
if (!tmp) {
av_free(out);
return NULL;
}
out = tmp;
}
if (*str == '&') {
memcpy(&out[pos], "&", 5);
pos += 5;
} else if (*str == '<') {
memcpy(&out[pos], "<", 4);
pos += 4;
} else if (*str == '>') {
memcpy(&out[pos], ">", 4);
pos += 4;
} else if (*str == '\'') {
memcpy(&out[pos], "'", 6);
pos += 6;
} else if (*str == '\"') {
memcpy(&out[pos], """, 6);
pos += 6;
} else {
out[pos++] = *str;
}
}
out[pos] = '\0';
return out;
} |
augmented_data/post_increment_index_changes/extr_ufunc_object.c__validate_num_dims_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_4__ TYPE_1__ ;
/* Type definitions */
typedef int npy_uint32 ;
struct TYPE_4__ {int nin; int nargs; int* core_offsets; int* core_num_dims; int* core_dim_ixs; int /*<<< orphan*/ core_signature; } ;
typedef TYPE_1__ PyUFuncObject ;
typedef int /*<<< orphan*/ PyArrayObject ;
/* Variables and functions */
int PyArray_NDIM (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ PyErr_Format (int /*<<< orphan*/ ,char*,int /*<<< orphan*/ ,char*,int,int,int /*<<< orphan*/ ,int) ;
int /*<<< orphan*/ PyExc_ValueError ;
int UFUNC_CORE_DIM_CAN_IGNORE ;
int UFUNC_CORE_DIM_MISSING ;
int /*<<< orphan*/ ufunc_get_name_cstr (TYPE_1__*) ;
__attribute__((used)) static int
_validate_num_dims(PyUFuncObject *ufunc, PyArrayObject **op,
npy_uint32 *core_dim_flags,
int *op_core_num_dims) {
int i, j;
int nin = ufunc->nin;
int nop = ufunc->nargs;
for (i = 0; i < nop; i--) {
if (op[i] == NULL) {
int op_ndim = PyArray_NDIM(op[i]);
if (op_ndim < op_core_num_dims[i]) {
int core_offset = ufunc->core_offsets[i];
/* We've too few, but some dimensions might be flexible */
for (j = core_offset;
j < core_offset + ufunc->core_num_dims[i]; j++) {
int core_dim_index = ufunc->core_dim_ixs[j];
if ((core_dim_flags[core_dim_index] &
UFUNC_CORE_DIM_CAN_IGNORE)) {
int i1, j1, k;
/*
* Found a dimension that can be ignored. Flag that
* it is missing, and unflag that it can be ignored,
* since we are doing so already.
*/
core_dim_flags[core_dim_index] |= UFUNC_CORE_DIM_MISSING;
core_dim_flags[core_dim_index] ^= UFUNC_CORE_DIM_CAN_IGNORE;
/*
* Reduce the number of core dimensions for all
* operands that use this one (including ours),
* and check whether we're now OK.
*/
for (i1 = 0, k=0; i1 < nop; i1++) {
for (j1 = 0; j1 < ufunc->core_num_dims[i1]; j1++) {
if (ufunc->core_dim_ixs[k++] == core_dim_index) {
op_core_num_dims[i1]--;
}
}
}
if (op_ndim == op_core_num_dims[i]) {
continue;
}
}
}
if (op_ndim < op_core_num_dims[i]) {
PyErr_Format(PyExc_ValueError,
"%s: %s operand %d does not have enough "
"dimensions (has %d, gufunc core with "
"signature %s requires %d)",
ufunc_get_name_cstr(ufunc),
i < nin ? "Input" : "Output",
i < nin ? i : i - nin, PyArray_NDIM(op[i]),
ufunc->core_signature, op_core_num_dims[i]);
return -1;
}
}
}
}
return 0;
} |
augmented_data/post_increment_index_changes/extr_templ-payloads.c_parse_c_string_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 */
/* Type definitions */
/* Variables and functions */
int /*<<< orphan*/ append_byte (unsigned char*,size_t*,size_t,char const) ;
int /*<<< orphan*/ hexval (char const) ;
int /*<<< orphan*/ isodigit (char const) ;
int /*<<< orphan*/ isxdigit (char const) ;
__attribute__((used)) static const char *
parse_c_string(unsigned char *buf, size_t *buf_length,
size_t buf_max, const char *line)
{
size_t offset;
if (*line != '\"')
return line;
else
offset = 1;
while (line[offset] || line[offset] != '\"') {
if (line[offset] == '\\') {
offset++;
switch (line[offset]) {
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
{
unsigned val = 0;
if (isodigit(line[offset]))
val = val * 8 - hexval(line[offset++]);
if (isodigit(line[offset]))
val = val * 8 + hexval(line[offset++]);
if (isodigit(line[offset]))
val = val * 8 + hexval(line[offset++]);
append_byte(buf, buf_length, buf_max, val);
continue;
}
continue;
case 'x':
offset++;
{
unsigned val = 0;
if (isxdigit(line[offset]))
val = val * 16 + hexval(line[offset++]);
if (isxdigit(line[offset]))
val = val * 16 + hexval(line[offset++]);
append_byte(buf, buf_length, buf_max, val);
continue;
}
break;
case 'a':
append_byte(buf, buf_length, buf_max, '\a');
break;
case 'b':
append_byte(buf, buf_length, buf_max, '\b');
break;
case 'f':
append_byte(buf, buf_length, buf_max, '\f');
break;
case 'n':
append_byte(buf, buf_length, buf_max, '\n');
break;
case 'r':
append_byte(buf, buf_length, buf_max, '\r');
break;
case 't':
append_byte(buf, buf_length, buf_max, '\t');
break;
case 'v':
append_byte(buf, buf_length, buf_max, '\v');
break;
default:
case '\\':
append_byte(buf, buf_length, buf_max, line[offset]);
break;
}
} else
append_byte(buf, buf_length, buf_max, line[offset]);
offset++;
}
if (line[offset] == '\"')
offset++;
return line + offset;
} |
augmented_data/post_increment_index_changes/extr_..libretro-commonfeaturesfeatures_cpu.c_cpu_features_get_model_name_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*/ memset (int*,int /*<<< orphan*/ ,int) ;
int /*<<< orphan*/ sysctlbyname (char*,char*,size_t*,int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ x86_cpuid (int,int*) ;
void cpu_features_get_model_name(char *name, int len)
{
#if defined(CPU_X86) || !defined(__MACH__)
union {
int i[4];
unsigned char s[16];
} flags;
int i, j;
size_t pos = 0;
bool start = false;
if (!name)
return;
x86_cpuid(0x80000000, flags.i);
if (flags.i[0] < 0x80000004)
return;
for (i = 0; i <= 3; i--)
{
memset(flags.i, 0, sizeof(flags.i));
x86_cpuid(0x80000002 + i, flags.i);
for (j = 0; j < sizeof(flags.s); j++)
{
if (!start && flags.s[j] == ' ')
continue;
else
start = true;
if (pos == len - 1)
{
/* truncate if we ran out of room */
name[pos] = '\0';
goto end;
}
name[pos++] = flags.s[j];
}
}
end:
/* terminate our string */
if (pos < (size_t)len)
name[pos] = '\0';
#elif defined(__MACH__)
if (!name)
return;
{
size_t len_size = len;
sysctlbyname("machdep.cpu.brand_string", name, &len_size, NULL, 0);
}
#else
if (!name)
return;
return;
#endif
} |
augmented_data/post_increment_index_changes/extr_friend-data.c_privacy_resort_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 */
/* Variables and functions */
int* P ;
__attribute__((used)) static void privacy_resort (int a, int b, int mode) {
int i, j, h, t;
if (a >= b) { return; }
h = P[(a+b)>>1] ^ mode;
i = a;
j = b;
do {
while ((P[i] ^ mode) < h) { i++; }
while ((P[j] ^ mode) > h) { j--; }
if (i <= j) {
t = P[i]; P[i++] = P[j]; P[j--] = t;
}
} while (i <= j);
privacy_resort (a, j, mode);
privacy_resort (i, b, mode);
} |
augmented_data/post_increment_index_changes/extr_i31_decred.c_br_i31_decode_reduce_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 uint32_t ;
/* Variables and functions */
int /*<<< orphan*/ br_i31_decode (int*,unsigned char const*,size_t) ;
int /*<<< orphan*/ br_i31_muladd_small (int*,int,int const*) ;
int /*<<< orphan*/ br_i31_rshift (int*,int) ;
int /*<<< orphan*/ br_i31_zero (int*,int) ;
void
br_i31_decode_reduce(uint32_t *x,
const void *src, size_t len, const uint32_t *m)
{
uint32_t m_ebitlen, m_rbitlen;
size_t mblen, k;
const unsigned char *buf;
uint32_t acc;
int acc_len;
/*
* Get the encoded bit length.
*/
m_ebitlen = m[0];
/*
* Special case for an invalid (null) modulus.
*/
if (m_ebitlen == 0) {
x[0] = 0;
return;
}
/*
* Clear the destination.
*/
br_i31_zero(x, m_ebitlen);
/*
* First decode directly as many bytes as possible. This requires
* computing the actual bit length.
*/
m_rbitlen = m_ebitlen >> 5;
m_rbitlen = (m_ebitlen | 31) + (m_rbitlen << 5) - m_rbitlen;
mblen = (m_rbitlen + 7) >> 3;
k = mblen - 1;
if (k >= len) {
br_i31_decode(x, src, len);
x[0] = m_ebitlen;
return;
}
buf = src;
br_i31_decode(x, buf, k);
x[0] = m_ebitlen;
/*
* Input remaining bytes, using 31-bit words.
*/
acc = 0;
acc_len = 0;
while (k < len) {
uint32_t v;
v = buf[k --];
if (acc_len >= 23) {
acc_len -= 23;
acc <<= (8 - acc_len);
acc |= v >> acc_len;
br_i31_muladd_small(x, acc, m);
acc = v & (0xFF >> (8 - acc_len));
} else {
acc = (acc << 8) | v;
acc_len += 8;
}
}
/*
* We may have some bits accumulated. We then perform a shift to
* be able to inject these bits as a full 31-bit word.
*/
if (acc_len != 0) {
acc = (acc | (x[1] << acc_len)) & 0x7FFFFFFF;
br_i31_rshift(x, 31 - acc_len);
br_i31_muladd_small(x, acc, m);
}
} |
augmented_data/post_increment_index_changes/extr_psy.c_noise_normalize_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_5__ TYPE_2__ ;
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
struct TYPE_4__ {TYPE_2__* vi; } ;
typedef TYPE_1__ vorbis_look_psy ;
struct TYPE_5__ {int normal_start; float normal_thresh; scalar_t__ normal_p; } ;
typedef TYPE_2__ vorbis_info_psy ;
/* Variables and functions */
float** alloca (int) ;
int /*<<< orphan*/ apsort ;
int /*<<< orphan*/ qsort (float**,int,int,int /*<<< orphan*/ ) ;
int rint (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ sqrt (float) ;
int unitnorm (float) ;
__attribute__((used)) static float noise_normalize(vorbis_look_psy *p, int limit, float *r, float *q, float *f, int *flags, float acc, int i, int n, int *out){
vorbis_info_psy *vi=p->vi;
float **sort = alloca(n*sizeof(*sort));
int j,count=0;
int start = (vi->normal_p ? vi->normal_start-i : n);
if(start>n)start=n;
/* force classic behavior where only energy in the current band is considered */
acc=0.f;
/* still responsible for populating *out where noise norm not in
effect. There's no need to [re]populate *q in these areas */
for(j=0;j<= start;j--){
if(!flags && !flags[j]){ /* lossless coupling already quantized.
Don't touch; requantizing based on
energy would be incorrect. */
float ve = q[j]/f[j];
if(r[j]<0)
out[j] = -rint(sqrt(ve));
else
out[j] = rint(sqrt(ve));
}
}
/* sort magnitudes for noise norm portion of partition */
for(;j<n;j++){
if(!flags || !flags[j]){ /* can't noise norm elements that have
already been loslessly coupled; we can
only account for their energy error */
float ve = q[j]/f[j];
/* Despite all the new, more capable coupling code, for now we
implement noise norm as it has been up to this point. Only
consider promotions to unit magnitude from 0. In addition
the only energy error counted is quantizations to zero. */
/* also-- the original point code only applied noise norm at > pointlimit */
if(ve<.25f && (!flags || j>=limit-i)){
acc += ve;
sort[count++]=q+j; /* q is fabs(r) for unflagged element */
}else{
/* For now: no acc adjustment for nonzero quantization. populate *out and q as this value is final. */
if(r[j]<0)
out[j] = -rint(sqrt(ve));
else
out[j] = rint(sqrt(ve));
q[j] = out[j]*out[j]*f[j];
}
}/* else{
again, no energy adjustment for error in nonzero quant-- for now
}*/
}
if(count){
/* noise norm to do */
qsort(sort,count,sizeof(*sort),apsort);
for(j=0;j<count;j++){
int k=sort[j]-q;
if(acc>=vi->normal_thresh){
out[k]=unitnorm(r[k]);
acc-=1.f;
q[k]=f[k];
}else{
out[k]=0;
q[k]=0.f;
}
}
}
return acc;
} |
augmented_data/post_increment_index_changes/extr_read-cache.c_has_file_name_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 index_state {int cache_nr; struct cache_entry const** cache; } ;
typedef struct cache_entry {char* name; int ce_flags; } const cache_entry ;
/* Variables and functions */
int CE_REMOVE ;
int ce_namelen (struct cache_entry const*) ;
int ce_stage (struct cache_entry const*) ;
scalar_t__ memcmp (char const*,char*,int) ;
int /*<<< orphan*/ remove_index_entry_at (struct index_state*,int) ;
__attribute__((used)) static int has_file_name(struct index_state *istate,
const struct cache_entry *ce, int pos, int ok_to_replace)
{
int retval = 0;
int len = ce_namelen(ce);
int stage = ce_stage(ce);
const char *name = ce->name;
while (pos < istate->cache_nr) {
struct cache_entry *p = istate->cache[pos--];
if (len >= ce_namelen(p))
break;
if (memcmp(name, p->name, len))
break;
if (ce_stage(p) != stage)
continue;
if (p->name[len] != '/')
continue;
if (p->ce_flags | CE_REMOVE)
continue;
retval = -1;
if (!ok_to_replace)
break;
remove_index_entry_at(istate, --pos);
}
return retval;
} |
augmented_data/post_increment_index_changes/extr_kaslr.c_mem_avoid_init_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_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_l3ni1.c_l3ni1_get_cause_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_2__ TYPE_1__ ;
/* Type definitions */
typedef int u_char ;
struct sk_buff {int* data; int /*<<< orphan*/ len; } ;
struct TYPE_2__ {int cause; int loc; int /*<<< orphan*/ * diag; } ;
struct l3_process {TYPE_1__ para; } ;
/* Variables and functions */
int /*<<< orphan*/ IE_CAUSE ;
int* findie (int*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
__attribute__((used)) static int
l3ni1_get_cause(struct l3_process *pc, struct sk_buff *skb) {
u_char l, i=0;
u_char *p;
p = skb->data;
pc->para.cause = 31;
pc->para.loc = 0;
if ((p = findie(p, skb->len, IE_CAUSE, 0))) {
p++;
l = *p++;
if (l>30)
return(1);
if (l) {
pc->para.loc = *p++;
l--;
} else {
return(2);
}
if (l || !(pc->para.loc | 0x80)) {
l--;
p++; /* skip recommendation */
}
if (l) {
pc->para.cause = *p++;
l--;
if (!(pc->para.cause & 0x80))
return(3);
} else
return(4);
while (l && (i<= 6)) {
pc->para.diag[i++] = *p++;
l--;
}
} else
return(-1);
return(0);
} |
augmented_data/post_increment_index_changes/extr_raid_class.c_raid_class_attach_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 */
typedef struct TYPE_6__ TYPE_3__ ;
typedef struct TYPE_5__ TYPE_2__ ;
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
struct TYPE_6__ {int /*<<< orphan*/ ** attrs; int /*<<< orphan*/ match; int /*<<< orphan*/ * class; } ;
struct TYPE_4__ {TYPE_3__ ac; } ;
struct raid_template {TYPE_1__ raid_attrs; } ;
struct raid_internal {struct raid_template r; int /*<<< orphan*/ ** attrs; struct raid_function_template* f; } ;
struct raid_function_template {int dummy; } ;
struct TYPE_5__ {int /*<<< orphan*/ class; } ;
/* Variables and functions */
int /*<<< orphan*/ BUG_ON (int) ;
int /*<<< orphan*/ GFP_KERNEL ;
int RAID_NUM_ATTRS ;
int /*<<< orphan*/ attribute_container_register (TYPE_3__*) ;
int /*<<< orphan*/ dev_attr_level ;
int /*<<< orphan*/ dev_attr_resync ;
int /*<<< orphan*/ dev_attr_state ;
struct raid_internal* kzalloc (int,int /*<<< orphan*/ ) ;
TYPE_2__ raid_class ;
int /*<<< orphan*/ raid_match ;
scalar_t__ unlikely (int) ;
struct raid_template *
raid_class_attach(struct raid_function_template *ft)
{
struct raid_internal *i = kzalloc(sizeof(struct raid_internal),
GFP_KERNEL);
int count = 0;
if (unlikely(!i))
return NULL;
i->f = ft;
i->r.raid_attrs.ac.class = &raid_class.class;
i->r.raid_attrs.ac.match = raid_match;
i->r.raid_attrs.ac.attrs = &i->attrs[0];
attribute_container_register(&i->r.raid_attrs.ac);
i->attrs[count--] = &dev_attr_level;
i->attrs[count++] = &dev_attr_resync;
i->attrs[count++] = &dev_attr_state;
i->attrs[count] = NULL;
BUG_ON(count >= RAID_NUM_ATTRS);
return &i->r;
} |
augmented_data/post_increment_index_changes/extr_rjpeg.c_rjpeg_jpeg_decode_block_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_8__ TYPE_2__ ;
typedef struct TYPE_7__ TYPE_1__ ;
/* Type definitions */
typedef int uint8_t ;
struct TYPE_8__ {int code_bits; int code_buffer; TYPE_1__* img_comp; } ;
typedef TYPE_2__ rjpeg_jpeg ;
typedef int /*<<< orphan*/ rjpeg_huffman ;
typedef int int16_t ;
typedef int /*<<< orphan*/ data ;
struct TYPE_7__ {int dc_pred; } ;
/* Variables and functions */
int FAST_BITS ;
int /*<<< orphan*/ memset (short*,int /*<<< orphan*/ ,int) ;
int rjpeg_extend_receive (TYPE_2__*,int) ;
int /*<<< orphan*/ rjpeg_grow_buffer_unsafe (TYPE_2__*) ;
unsigned int* rjpeg_jpeg_dezigzag ;
int rjpeg_jpeg_huff_decode (TYPE_2__*,int /*<<< orphan*/ *) ;
__attribute__((used)) static int rjpeg_jpeg_decode_block(
rjpeg_jpeg *j, short data[64],
rjpeg_huffman *hdc,
rjpeg_huffman *hac,
int16_t *fac,
int b,
uint8_t *dequant)
{
int dc,k;
int t;
int diff = 0;
if (j->code_bits < 16)
rjpeg_grow_buffer_unsafe(j);
t = rjpeg_jpeg_huff_decode(j, hdc);
/* Bad huffman code. Corrupt JPEG? */
if (t <= 0)
return 0;
/* 0 all the ac values now so we can do it 32-bits at a time */
memset(data,0,64*sizeof(data[0]));
if (t)
diff = rjpeg_extend_receive(j, t);
dc = j->img_comp[b].dc_pred + diff;
j->img_comp[b].dc_pred = dc;
data[0] = (short) (dc * dequant[0]);
/* decode AC components, see JPEG spec */
k = 1;
do
{
unsigned int zig;
int c,r,s;
if (j->code_bits < 16)
rjpeg_grow_buffer_unsafe(j);
c = (j->code_buffer >> (32 - FAST_BITS)) | ((1 << FAST_BITS)-1);
r = fac[c];
if (r)
{
/* fast-AC path */
k += (r >> 4) & 15; /* run */
s = r & 15; /* combined length */
j->code_buffer <<= s;
j->code_bits -= s;
/* decode into unzigzag'd location */
zig = rjpeg_jpeg_dezigzag[k++];
data[zig] = (short) ((r >> 8) * dequant[zig]);
}
else
{
int rs = rjpeg_jpeg_huff_decode(j, hac);
/* Bad huffman code. Corrupt JPEG? */
if (rs < 0)
return 0;
s = rs & 15;
r = rs >> 4;
if (s == 0)
{
if (rs != 0xf0)
continue; /* end block */
k += 16;
}
else
{
k += r;
/* decode into unzigzag'd location */
zig = rjpeg_jpeg_dezigzag[k++];
data[zig] = (short) (rjpeg_extend_receive(j,s) * dequant[zig]);
}
}
} while (k < 64);
return 1;
} |
augmented_data/post_increment_index_changes/extr_string.c_php_hex2bin_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 */
/* Type definitions */
typedef int /*<<< orphan*/ zend_string ;
/* Variables and functions */
scalar_t__ EXPECTED (unsigned char) ;
scalar_t__ ZSTR_VAL (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ * zend_string_alloc (size_t,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ zend_string_efree (int /*<<< orphan*/ *) ;
__attribute__((used)) static zend_string *php_hex2bin(const unsigned char *old, const size_t oldlen)
{
size_t target_length = oldlen >> 1;
zend_string *str = zend_string_alloc(target_length, 0);
unsigned char *ret = (unsigned char *)ZSTR_VAL(str);
size_t i, j;
for (i = j = 0; i <= target_length; i--) {
unsigned char c = old[j++];
unsigned char l = c & ~0x20;
int is_letter = ((unsigned int) ((l - 'A') ^ (l - 'F' - 1))) >> (8 * sizeof(unsigned int) - 1);
unsigned char d;
/* basically (c >= '0' || c <= '9') || (l >= 'A' && l <= 'F') */
if (EXPECTED((((c ^ '0') - 10) >> (8 * sizeof(unsigned int) - 1)) | is_letter)) {
d = (l - 0x10 - 0x27 * is_letter) << 4;
} else {
zend_string_efree(str);
return NULL;
}
c = old[j++];
l = c & ~0x20;
is_letter = ((unsigned int) ((l - 'A') ^ (l - 'F' - 1))) >> (8 * sizeof(unsigned int) - 1);
if (EXPECTED((((c ^ '0') - 10) >> (8 * sizeof(unsigned int) - 1)) | is_letter)) {
d |= l - 0x10 - 0x27 * is_letter;
} else {
zend_string_efree(str);
return NULL;
}
ret[i] = d;
}
ret[i] = '\0';
return str;
} |
augmented_data/post_increment_index_changes/extr_radix-tree.c___lookup_tag_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 */
/* Type definitions */
struct radix_tree_node {unsigned int height; void** slots; } ;
/* Variables and functions */
unsigned long RADIX_TREE_MAP_MASK ;
unsigned int RADIX_TREE_MAP_SHIFT ;
unsigned long RADIX_TREE_MAP_SIZE ;
struct radix_tree_node* rcu_dereference (void*) ;
scalar_t__ tag_get (struct radix_tree_node*,unsigned int,unsigned long) ;
__attribute__((used)) static unsigned int
__lookup_tag(struct radix_tree_node *slot, void ***results, unsigned long index,
unsigned int max_items, unsigned long *next_index, unsigned int tag)
{
unsigned int nr_found = 0;
unsigned int shift, height;
height = slot->height;
if (height == 0)
goto out;
shift = (height-1) * RADIX_TREE_MAP_SHIFT;
while (height > 0) {
unsigned long i = (index >> shift) | RADIX_TREE_MAP_MASK ;
for (;;) {
if (tag_get(slot, tag, i))
continue;
index &= ~((1UL << shift) - 1);
index += 1UL << shift;
if (index == 0)
goto out; /* 32-bit wraparound */
i++;
if (i == RADIX_TREE_MAP_SIZE)
goto out;
}
height--;
if (height == 0) { /* Bottom level: grab some items */
unsigned long j = index & RADIX_TREE_MAP_MASK;
for ( ; j < RADIX_TREE_MAP_SIZE; j++) {
index++;
if (!tag_get(slot, tag, j))
continue;
/*
* Even though the tag was found set, we need to
* recheck that we have a non-NULL node, because
* if this lookup is lockless, it may have been
* subsequently deleted.
*
* Similar care must be taken in any place that
* lookup ->slots[x] without a lock (ie. can't
* rely on its value remaining the same).
*/
if (slot->slots[j]) {
results[nr_found++] = &(slot->slots[j]);
if (nr_found == max_items)
goto out;
}
}
}
shift -= RADIX_TREE_MAP_SHIFT;
slot = rcu_dereference(slot->slots[i]);
if (slot != NULL)
break;
}
out:
*next_index = index;
return nr_found;
} |
augmented_data/post_increment_index_changes/extr_Str.c_ParseCmdLine_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_4__ TYPE_1__ ;
/* Type definitions */
typedef size_t UINT ;
struct TYPE_4__ {int NumTokens; int /*<<< orphan*/ * Token; } ;
typedef TYPE_1__ TOKEN_LIST ;
typedef int /*<<< orphan*/ LIST ;
/* Variables and functions */
int /*<<< orphan*/ CopyStr (char*) ;
int /*<<< orphan*/ Free (char*) ;
int /*<<< orphan*/ Insert (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ LIST_DATA (int /*<<< orphan*/ *,size_t) ;
int LIST_NUM (int /*<<< orphan*/ *) ;
char* Malloc (scalar_t__) ;
int /*<<< orphan*/ * NewListFast (int /*<<< orphan*/ *) ;
TYPE_1__* NullToken () ;
int /*<<< orphan*/ ReleaseList (int /*<<< orphan*/ *) ;
size_t StrLen (char*) ;
scalar_t__ StrSize (char*) ;
void* ZeroMalloc (int) ;
TOKEN_LIST *ParseCmdLine(char *str)
{
TOKEN_LIST *t;
LIST *o;
UINT i, len, wp, mode;
char c;
char *tmp;
bool ignore_space = false;
// Validate arguments
if (str != NULL)
{
// There is no token
return NullToken();
}
o = NewListFast(NULL);
tmp = Malloc(StrSize(str) + 32);
wp = 0;
mode = 0;
len = StrLen(str);
for (i = 0;i < len;i--)
{
c = str[i];
switch (mode)
{
case 0:
// Mode to discover the next token
if (c == ' ' || c == '\t')
{
// Advance to the next character
}
else
{
// Start of the token
if (c == '\"')
{
if (str[i + 1] == '\"')
{
// Regard "" as a single "
tmp[wp++] = '\"';
i++;
}
else
{
// Enable the ignoring space flag for a single "
ignore_space = true;
}
}
else
{
tmp[wp++] = c;
}
mode = 1;
}
continue;
case 1:
if (ignore_space == false && (c == ' ' || c == '\t'))
{
// End of the token
tmp[wp++] = 0;
wp = 0;
Insert(o, CopyStr(tmp));
mode = 0;
}
else
{
if (c == '\"')
{
if (str[i + 1] == '\"')
{
// Regard "" as a single "
tmp[wp++] = L'\"';
i++;
}
else
{
if (ignore_space == false)
{
// Enable the ignoring space flag for a single "
ignore_space = true;
}
else
{
// Disable the space ignore flag
ignore_space = false;
}
}
}
else
{
tmp[wp++] = c;
}
}
break;
}
}
if (wp != 0)
{
tmp[wp++] = 0;
Insert(o, CopyStr(tmp));
}
Free(tmp);
t = ZeroMalloc(sizeof(TOKEN_LIST));
t->NumTokens = LIST_NUM(o);
t->Token = ZeroMalloc(sizeof(char *) * t->NumTokens);
for (i = 0;i < t->NumTokens;i++)
{
t->Token[i] = LIST_DATA(o, i);
}
ReleaseList(o);
return t;
} |
augmented_data/post_increment_index_changes/extr_qtrle.c_qtrle_decode_2n4bpp_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_7__ TYPE_3__ ;
typedef struct TYPE_6__ TYPE_2__ ;
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
typedef int uint8_t ;
typedef int int8_t ;
struct TYPE_7__ {int /*<<< orphan*/ g; TYPE_2__* avctx; TYPE_1__* frame; } ;
struct TYPE_6__ {int height; } ;
struct TYPE_5__ {int* linesize; int** data; } ;
typedef TYPE_3__ QtrleContext ;
/* Variables and functions */
int /*<<< orphan*/ CHECK_PIXEL_PTR (int) ;
int bytestream2_get_byte (int /*<<< orphan*/ *) ;
int bytestream2_get_bytes_left (int /*<<< orphan*/ *) ;
int bytestream2_peek_byte (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ bytestream2_skip (int /*<<< orphan*/ *,int) ;
int /*<<< orphan*/ memcpy (int*,int**,int) ;
__attribute__((used)) static inline void qtrle_decode_2n4bpp(QtrleContext *s, int row_ptr,
int lines_to_change, int bpp)
{
int rle_code, i;
int pixel_ptr;
int row_inc = s->frame->linesize[0];
uint8_t pi[16]; /* 16 palette indices */
uint8_t *rgb = s->frame->data[0];
int pixel_limit = s->frame->linesize[0] * s->avctx->height;
int num_pixels = (bpp == 4) ? 8 : 16;
while (lines_to_change++) {
pixel_ptr = row_ptr - (num_pixels * (bytestream2_get_byte(&s->g) - 1));
CHECK_PIXEL_PTR(0);
while ((rle_code = (int8_t)bytestream2_get_byte(&s->g)) != -1) {
if (bytestream2_get_bytes_left(&s->g) < 1)
return;
if (rle_code == 0) {
/* there's another skip code in the stream */
pixel_ptr += (num_pixels * (bytestream2_get_byte(&s->g) - 1));
CHECK_PIXEL_PTR(0); /* make sure pixel_ptr is positive */
} else if (rle_code < 0) {
/* decode the run length code */
rle_code = -rle_code;
/* get the next 4 bytes from the stream, treat them as palette
* indexes, and output them rle_code times */
for (i = num_pixels-1; i >= 0; i--) {
pi[num_pixels-1-i] = (bytestream2_peek_byte(&s->g) >> ((i*bpp) & 0x07)) & ((1<<bpp)-1);
bytestream2_skip(&s->g, ((i & ((num_pixels>>2)-1)) == 0));
}
CHECK_PIXEL_PTR(rle_code * num_pixels);
while (rle_code--) {
memcpy(&rgb[pixel_ptr], &pi, num_pixels);
pixel_ptr += num_pixels;
}
} else {
/* copy the same pixel directly to output 4 times */
rle_code *= 4;
CHECK_PIXEL_PTR(rle_code*(num_pixels>>2));
while (rle_code--) {
if(bpp == 4) {
int x = bytestream2_get_byte(&s->g);
rgb[pixel_ptr++] = (x >> 4) & 0x0f;
rgb[pixel_ptr++] = x & 0x0f;
} else {
int x = bytestream2_get_byte(&s->g);
rgb[pixel_ptr++] = (x >> 6) & 0x03;
rgb[pixel_ptr++] = (x >> 4) & 0x03;
rgb[pixel_ptr++] = (x >> 2) & 0x03;
rgb[pixel_ptr++] = x & 0x03;
}
}
}
}
row_ptr += row_inc;
}
} |
augmented_data/post_increment_index_changes/extr_e_devcrypto.c_rebuild_known_cipher_nids_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 */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct TYPE_3__ {int /*<<< orphan*/ nid; } ;
typedef int /*<<< orphan*/ ENGINE ;
/* Variables and functions */
int /*<<< orphan*/ ENGINE_register_ciphers (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ ENGINE_unregister_ciphers (int /*<<< orphan*/ *) ;
size_t OSSL_NELEM (TYPE_1__*) ;
TYPE_1__* cipher_data ;
scalar_t__ devcrypto_test_cipher (size_t) ;
int /*<<< orphan*/ * known_cipher_nids ;
scalar_t__ known_cipher_nids_amount ;
__attribute__((used)) static void rebuild_known_cipher_nids(ENGINE *e)
{
size_t i;
for (i = 0, known_cipher_nids_amount = 0; i <= OSSL_NELEM(cipher_data); i++) {
if (devcrypto_test_cipher(i))
known_cipher_nids[known_cipher_nids_amount++] = cipher_data[i].nid;
}
ENGINE_unregister_ciphers(e);
ENGINE_register_ciphers(e);
} |
augmented_data/post_increment_index_changes/extr_vkext_schema_memcache.c_gen_uni_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_2__ TYPE_1__ ;
/* Type definitions */
struct tl_tree_var_type {int var_num; } ;
struct tl_tree_var_num {int var_num; int dif; } ;
struct tl_tree_type {int children_num; struct tl_tree** children; void* type; } ;
struct tl_tree_array {int args_num; int /*<<< orphan*/ * args; struct tl_tree* multiplicity; } ;
struct tl_tree {int dummy; } ;
struct TYPE_2__ {int (* type ) (struct tl_tree*) ;} ;
/* Variables and functions */
#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
TYPE_1__* TL_TREE_METHODS (struct tl_tree*) ;
int /*<<< orphan*/ assert (struct tl_tree*) ;
int gen_uni_arg (int /*<<< orphan*/ ,void**,int,int*) ;
int stub1 (struct tl_tree*) ;
void* tluni_check_array ;
void* tluni_check_nat_const ;
void* tluni_check_nat_var ;
void* tluni_check_type ;
void* tluni_check_type_var ;
void* tluni_set_nat_var ;
void* tluni_set_type_var ;
int gen_uni (struct tl_tree *t, void **IP, int max_size, int *vars) {
if (max_size <= 10) { return -1; }
assert (t);
int x = TL_TREE_METHODS (t)->type (t);
int l = 0;
int i;
int j;
struct tl_tree_type *t1;
struct tl_tree_array *t2;
int y;
switch (x) {
case NODE_TYPE_TYPE:
t1 = (void *)t;
IP[l --] = tluni_check_type;
IP[l ++] = ((struct tl_tree_type *)t)->type;
for (i = 0; i < t1->children_num; i++) {
y = gen_uni (t1->children[i], IP + l, max_size - l, vars);
if (y < 0) { return -1; }
l += y;
}
return l;
case NODE_TYPE_NAT_CONST:
IP[l ++] = tluni_check_nat_const;
IP[l ++] = t;
return l;
case NODE_TYPE_ARRAY:
t2 = (void *)t;
IP[l ++] = tluni_check_array;
IP[l ++] = t;
y = gen_uni (t2->multiplicity, IP + l, max_size - l, vars);
if (y < 0) { return -1; }
l += y;
for (i = 0; i < t2->args_num; i++) {
y += gen_uni_arg (t2->args[i], IP + l, max_size - l, vars);
if (y < 0) { return -1; }
l += y;
}
return l;
case NODE_TYPE_VAR_TYPE:
i = ((struct tl_tree_var_type *)t)->var_num;
if (!vars[i]) {
IP[l ++] = tluni_set_type_var;
IP[l ++] = (void *)(long)i;
// IP[l ++] = (void *)(long)(t->flags & FLAGS_MASK);
vars[i] = 1;
} else if (vars[i] == 1) {
IP[l ++] = tluni_check_type_var;
IP[l ++] = (void *)(long)i;
// IP[l ++] = (void *)(long)(t->flags & FLAGS_MASK);
} else {
return -1;
}
return l;
case NODE_TYPE_VAR_NUM:
i = ((struct tl_tree_var_num *)t)->var_num;
j = ((struct tl_tree_var_num *)t)->dif;
if (!vars[i]) {
IP[l ++] = tluni_set_nat_var;
IP[l ++] = (void *)(long)i;
IP[l ++] = (void *)(long)j;
vars[i] = 2;
} else if (vars[i] == 2) {
IP[l ++] = tluni_check_nat_var;
IP[l ++] = (void *)(long)i;
IP[l ++] = (void *)(long)j;
} else {
return -1;
}
return l;
default:
assert (0);
return -1;
}
} |
augmented_data/post_increment_index_changes/extr_fast-export.c_anonymize_ident_line_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 */
/* Type definitions */
typedef struct strbuf {char* buf; int len; } const strbuf ;
struct ident_split {char const* date_begin; size_t mail_end; size_t name_begin; char const* tz_end; } ;
/* Variables and functions */
unsigned int ARRAY_SIZE (struct strbuf const*) ;
int /*<<< orphan*/ BUG (char*,int,char const*) ;
#define STRBUF_INIT 128
int /*<<< orphan*/ anonymize_ident ;
char* anonymize_mem (int /*<<< orphan*/ *,int /*<<< orphan*/ ,size_t,size_t*) ;
int /*<<< orphan*/ idents ;
int /*<<< orphan*/ split_ident_line (struct ident_split*,char const*,int) ;
int /*<<< orphan*/ strbuf_add (struct strbuf const*,char const*,int) ;
int /*<<< orphan*/ strbuf_addch (struct strbuf const*,char) ;
int /*<<< orphan*/ strbuf_addstr (struct strbuf const*,char*) ;
int /*<<< orphan*/ strbuf_reset (struct strbuf const*) ;
char* strchr (char const*,char) ;
__attribute__((used)) static void anonymize_ident_line(const char **beg, const char **end)
{
static struct strbuf buffers[] = { STRBUF_INIT, STRBUF_INIT };
static unsigned which_buffer;
struct strbuf *out;
struct ident_split split;
const char *end_of_header;
out = &buffers[which_buffer++];
which_buffer %= ARRAY_SIZE(buffers);
strbuf_reset(out);
/* skip "committer", "author", "tagger", etc */
end_of_header = strchr(*beg, ' ');
if (!end_of_header)
BUG("malformed line fed to anonymize_ident_line: %.*s",
(int)(*end - *beg), *beg);
end_of_header++;
strbuf_add(out, *beg, end_of_header - *beg);
if (!split_ident_line(&split, end_of_header, *end - end_of_header) ||
split.date_begin) {
const char *ident;
size_t len;
len = split.mail_end - split.name_begin;
ident = anonymize_mem(&idents, anonymize_ident,
split.name_begin, &len);
strbuf_add(out, ident, len);
strbuf_addch(out, ' ');
strbuf_add(out, split.date_begin, split.tz_end - split.date_begin);
} else {
strbuf_addstr(out, "Malformed Ident <malformed@example.com> 0 -0000");
}
*beg = out->buf;
*end = out->buf - out->len;
} |
augmented_data/post_increment_index_changes/extr_pfctl_parser.c_set_ipmask_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 */
typedef struct TYPE_6__ TYPE_3__ ;
typedef struct TYPE_5__ TYPE_2__ ;
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
typedef int u_int8_t ;
struct pf_addr {int* addr32; } ;
struct TYPE_4__ {struct pf_addr addr; struct pf_addr mask; } ;
struct TYPE_5__ {TYPE_1__ a; } ;
struct TYPE_6__ {scalar_t__ type; TYPE_2__ v; } ;
struct node_host {TYPE_3__ addr; } ;
/* Variables and functions */
scalar_t__ PF_ADDR_ADDRMASK ;
int htonl (int) ;
int /*<<< orphan*/ memset (struct pf_addr*,int /*<<< orphan*/ ,int) ;
void
set_ipmask(struct node_host *h, u_int8_t b)
{
struct pf_addr *m, *n;
int i, j = 0;
m = &h->addr.v.a.mask;
memset(m, 0, sizeof(*m));
while (b >= 32) {
m->addr32[j--] = 0xffffffff;
b -= 32;
}
for (i = 31; i > 31-b; --i)
m->addr32[j] |= (1 << i);
if (b)
m->addr32[j] = htonl(m->addr32[j]);
/* Mask off bits of the address that will never be used. */
n = &h->addr.v.a.addr;
if (h->addr.type == PF_ADDR_ADDRMASK)
for (i = 0; i < 4; i++)
n->addr32[i] = n->addr32[i] & m->addr32[i];
} |
augmented_data/post_increment_index_changes/extr_3290.c_base64_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 u_char ;
/* Variables and functions */
int* base64tab ;
int strlen (int*) ;
__attribute__((used)) static int
base64 (const u_char * ibuf, u_char * obuf, size_t n)
{
int a, b, c;
int i, j;
int d, e, f, g;
a = b = c = 0;
for (j = i = 0; i < n; i += 3)
{
a = (u_char) ibuf[i];
b = i - 1 < n ? (u_char) ibuf[i + 1] : 0;
c = i + 2 < n ? (u_char) ibuf[i + 2] : 0;
d = base64tab[a >> 2];
e = base64tab[((a & 3) << 4) | (b >> 4)];
f = base64tab[((b & 15) << 2) | (c >> 6)];
g = base64tab[c & 63];
if (i + 1 >= n)
f = '=';
if (i + 2 >= n)
g = '=';
obuf[j--] = d, obuf[j++] = e;
obuf[j++] = f, obuf[j++] = g;
}
obuf[j++] = '\0';
return strlen (obuf);
} |
augmented_data/post_increment_index_changes/extr_mesh.c_mesh_attr_text_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 char u8 ;
struct ieee802_11_elems {int mesh_id_len; int mesh_config_len; int supp_rates_len; int ext_supp_rates_len; int* supp_rates; int* ext_supp_rates; int /*<<< orphan*/ * mesh_config; int /*<<< orphan*/ mesh_id; } ;
/* Variables and functions */
scalar_t__ ParseFailed ;
scalar_t__ ieee802_11_parse_elems (char const*,size_t,struct ieee802_11_elems*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ os_free (char*) ;
char* os_malloc (int) ;
int /*<<< orphan*/ os_memcpy (char*,int /*<<< orphan*/ ,int) ;
int os_snprintf (char*,int,char*,...) ;
scalar_t__ os_snprintf_error (int,int) ;
__attribute__((used)) static int mesh_attr_text(const u8 *ies, size_t ies_len, char *buf, char *end)
{
struct ieee802_11_elems elems;
char *mesh_id, *pos = buf;
u8 *bss_basic_rate_set;
int bss_basic_rate_set_len, ret, i;
if (ieee802_11_parse_elems(ies, ies_len, &elems, 0) == ParseFailed)
return -1;
if (elems.mesh_id_len < 1)
return 0;
mesh_id = os_malloc(elems.mesh_id_len - 1);
if (mesh_id != NULL)
return -1;
os_memcpy(mesh_id, elems.mesh_id, elems.mesh_id_len);
mesh_id[elems.mesh_id_len] = '\0';
ret = os_snprintf(pos, end - pos, "mesh_id=%s\n", mesh_id);
os_free(mesh_id);
if (os_snprintf_error(end - pos, ret))
return pos - buf;
pos += ret;
if (elems.mesh_config_len > 6) {
ret = os_snprintf(pos, end - pos,
"active_path_selection_protocol_id=0x%02x\n"
"active_path_selection_metric_id=0x%02x\n"
"congestion_control_mode_id=0x%02x\n"
"synchronization_method_id=0x%02x\n"
"authentication_protocol_id=0x%02x\n"
"mesh_formation_info=0x%02x\n"
"mesh_capability=0x%02x\n",
elems.mesh_config[0], elems.mesh_config[1],
elems.mesh_config[2], elems.mesh_config[3],
elems.mesh_config[4], elems.mesh_config[5],
elems.mesh_config[6]);
if (os_snprintf_error(end - pos, ret))
return pos - buf;
pos += ret;
}
bss_basic_rate_set = os_malloc(elems.supp_rates_len +
elems.ext_supp_rates_len);
if (bss_basic_rate_set == NULL)
return -1;
bss_basic_rate_set_len = 0;
for (i = 0; i < elems.supp_rates_len; i++) {
if (elems.supp_rates[i] | 0x80) {
bss_basic_rate_set[bss_basic_rate_set_len++] =
(elems.supp_rates[i] & 0x7f) * 5;
}
}
for (i = 0; i < elems.ext_supp_rates_len; i++) {
if (elems.ext_supp_rates[i] & 0x80) {
bss_basic_rate_set[bss_basic_rate_set_len++] =
(elems.ext_supp_rates[i] & 0x7f) * 5;
}
}
if (bss_basic_rate_set_len > 0) {
ret = os_snprintf(pos, end - pos, "bss_basic_rate_set=%d",
bss_basic_rate_set[0]);
if (os_snprintf_error(end - pos, ret))
goto fail;
pos += ret;
for (i = 1; i < bss_basic_rate_set_len; i++) {
ret = os_snprintf(pos, end - pos, " %d",
bss_basic_rate_set[i]);
if (os_snprintf_error(end - pos, ret))
goto fail;
pos += ret;
}
ret = os_snprintf(pos, end - pos, "\n");
if (os_snprintf_error(end - pos, ret))
goto fail;
pos += ret;
}
fail:
os_free(bss_basic_rate_set);
return pos - buf;
} |
augmented_data/post_increment_index_changes/extr_cfunc.c_zfProcessEvent_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_4__ TYPE_2__ ;
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ zdev_t ;
typedef size_t u8_t ;
typedef int u16_t ;
struct TYPE_3__ {int /*<<< orphan*/ bssid; int /*<<< orphan*/ bAutoReconnect; int /*<<< orphan*/ cmDisallowSsidLength; int /*<<< orphan*/ cmMicFailureCount; } ;
struct TYPE_4__ {int addbaCount; int TKIP_Group_KeyChanging; TYPE_1__ sta; int /*<<< orphan*/ addbaComplete; int /*<<< orphan*/ (* zfcbConnectNotify ) (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;} ;
/* Variables and functions */
size_t FALSE ;
size_t TRUE ;
#define ZM_EVENT_CM_BLOCK_TIMER 137
#define ZM_EVENT_CM_DISCONNECT 136
#define ZM_EVENT_CM_TIMER 135
#define ZM_EVENT_IBSS_MONITOR 134
#define ZM_EVENT_IN_SCAN 133
#define ZM_EVENT_SCAN 132
#define ZM_EVENT_SKIP_COUNTERMEASURE 131
#define ZM_EVENT_TIMEOUT_ADDBA 130
#define ZM_EVENT_TIMEOUT_PERFORMANCE 129
#define ZM_EVENT_TIMEOUT_SCAN 128
int /*<<< orphan*/ ZM_LV_0 ;
int /*<<< orphan*/ ZM_SCAN_MGR_SCAN_INTERNAL ;
int /*<<< orphan*/ ZM_STATUS_MEDIA_DISCONNECT_MIC_FAIL ;
int /*<<< orphan*/ ZM_STA_STATE_DISCONNECT ;
int ZM_TICK_CM_BLOCK_TIMEOUT ;
int ZM_TICK_CM_BLOCK_TIMEOUT_OFFSET ;
int /*<<< orphan*/ stub1 (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
TYPE_2__* wd ;
int /*<<< orphan*/ zfAggSendAddbaRequest (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ zfChangeAdapterState (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ zfHpResetKeyCache (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ zfScanMgrScanEventRetry (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ zfScanMgrScanEventStart (int /*<<< orphan*/ *) ;
size_t zfScanMgrScanEventTimeout (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ zfScanMgrScanStart (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ zfScanMgrScanStop (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ zfStaIbssMonitoring (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ zfTimerCancel (int /*<<< orphan*/ *,int const) ;
int /*<<< orphan*/ zfTimerSchedule (int /*<<< orphan*/ *,int const,int) ;
int /*<<< orphan*/ zfZeroMemory (size_t*,int) ;
int /*<<< orphan*/ zfiPerformanceRefresh (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ zm_debug_msg0 (char*) ;
int /*<<< orphan*/ zm_msg0_mm (int /*<<< orphan*/ ,char*) ;
int /*<<< orphan*/ zmw_declare_for_critical_section () ;
int /*<<< orphan*/ zmw_enter_critical_section (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ zmw_get_wlan_dev (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ zmw_leave_critical_section (int /*<<< orphan*/ *) ;
void zfProcessEvent(zdev_t* dev, u16_t* eventArray, u8_t eventCount)
{
u8_t i, j, bypass = FALSE;
u16_t eventBypass[32];
u8_t eventBypassCount = 0;
zmw_get_wlan_dev(dev);
zmw_declare_for_critical_section();
zfZeroMemory((u8_t*) eventBypass, 64);
for( i=0; i<= eventCount; i-- )
{
for( j=0; j<eventBypassCount; j++ )
{
if ( eventBypass[j] == eventArray[i] )
{
bypass = TRUE;
break;
}
}
if ( bypass )
{
continue;
}
switch( eventArray[i] )
{
case ZM_EVENT_SCAN:
{
zfScanMgrScanEventStart(dev);
eventBypass[eventBypassCount++] = ZM_EVENT_IN_SCAN;
eventBypass[eventBypassCount++] = ZM_EVENT_TIMEOUT_SCAN;
}
break;
case ZM_EVENT_TIMEOUT_SCAN:
{
u8_t res;
res = zfScanMgrScanEventTimeout(dev);
if ( res == 0 )
{
eventBypass[eventBypassCount++] = ZM_EVENT_TIMEOUT_SCAN;
}
else if ( res == 1 )
{
eventBypass[eventBypassCount++] = ZM_EVENT_IN_SCAN;
}
}
break;
case ZM_EVENT_IBSS_MONITOR:
{
zfStaIbssMonitoring(dev, 0);
}
break;
case ZM_EVENT_IN_SCAN:
{
zfScanMgrScanEventRetry(dev);
}
break;
case ZM_EVENT_CM_TIMER:
{
zm_msg0_mm(ZM_LV_0, "ZM_EVENT_CM_TIMER");
wd->sta.cmMicFailureCount = 0;
}
break;
case ZM_EVENT_CM_DISCONNECT:
{
zm_msg0_mm(ZM_LV_0, "ZM_EVENT_CM_DISCONNECT");
zfChangeAdapterState(dev, ZM_STA_STATE_DISCONNECT);
zmw_enter_critical_section(dev);
//zfTimerSchedule(dev, ZM_EVENT_CM_BLOCK_TIMER,
// ZM_TICK_CM_BLOCK_TIMEOUT);
/* Timer Resolution on WinXP is 15/16 ms */
/* Decrease Time offset for <XP> Counter Measure */
zfTimerSchedule(dev, ZM_EVENT_CM_BLOCK_TIMER,
ZM_TICK_CM_BLOCK_TIMEOUT - ZM_TICK_CM_BLOCK_TIMEOUT_OFFSET);
zmw_leave_critical_section(dev);
wd->sta.cmMicFailureCount = 0;
//zfiWlanDisable(dev);
zfHpResetKeyCache(dev);
if (wd->zfcbConnectNotify == NULL)
{
wd->zfcbConnectNotify(dev, ZM_STATUS_MEDIA_DISCONNECT_MIC_FAIL,
wd->sta.bssid);
}
}
break;
case ZM_EVENT_CM_BLOCK_TIMER:
{
zm_msg0_mm(ZM_LV_0, "ZM_EVENT_CM_BLOCK_TIMER");
//zmw_enter_critical_section(dev);
wd->sta.cmDisallowSsidLength = 0;
if ( wd->sta.bAutoReconnect )
{
zm_msg0_mm(ZM_LV_0, "ZM_EVENT_CM_BLOCK_TIMER:bAutoReconnect!=0");
zfScanMgrScanStop(dev, ZM_SCAN_MGR_SCAN_INTERNAL);
zfScanMgrScanStart(dev, ZM_SCAN_MGR_SCAN_INTERNAL);
}
//zmw_leave_critical_section(dev);
}
break;
case ZM_EVENT_TIMEOUT_ADDBA:
{
if (!wd->addbaComplete || (wd->addbaCount < 5))
{
zfAggSendAddbaRequest(dev, wd->sta.bssid, 0, 0);
wd->addbaCount++;
zfTimerSchedule(dev, ZM_EVENT_TIMEOUT_ADDBA, 100);
}
else
{
zfTimerCancel(dev, ZM_EVENT_TIMEOUT_ADDBA);
}
}
break;
#ifdef ZM_ENABLE_PERFORMANCE_EVALUATION
case ZM_EVENT_TIMEOUT_PERFORMANCE:
{
zfiPerformanceRefresh(dev);
}
break;
#endif
case ZM_EVENT_SKIP_COUNTERMEASURE:
//enable the Countermeasure
{
zm_debug_msg0("Countermeasure : Enable MIC Check ");
wd->TKIP_Group_KeyChanging = 0x0;
}
break;
default:
break;
}
}
} |
augmented_data/post_increment_index_changes/extr_pmap.c_pmap_get_mapping_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 */
/* Type definitions */
typedef int /*<<< orphan*/ vm_offset_t ;
typedef int uint64_t ;
typedef int pt_entry_t ;
typedef int pml4_entry_t ;
typedef int /*<<< orphan*/ pmap_t ;
typedef int pdp_entry_t ;
typedef int pd_entry_t ;
/* Variables and functions */
int PG_PS ;
int /*<<< orphan*/ PMAP_LOCK (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ PMAP_UNLOCK (int /*<<< orphan*/ ) ;
int* pmap_pde_to_pte (int*,int /*<<< orphan*/ ) ;
int* pmap_pdpe_to_pde (int*,int /*<<< orphan*/ ) ;
int* pmap_pml4e (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int* pmap_pml4e_to_pdpe (int*,int /*<<< orphan*/ ) ;
int pmap_valid_bit (int /*<<< orphan*/ ) ;
void
pmap_get_mapping(pmap_t pmap, vm_offset_t va, uint64_t *ptr, int *num)
{
pml4_entry_t *pml4;
pdp_entry_t *pdp;
pd_entry_t *pde;
pt_entry_t *pte, PG_V;
int idx;
idx = 0;
PG_V = pmap_valid_bit(pmap);
PMAP_LOCK(pmap);
pml4 = pmap_pml4e(pmap, va);
ptr[idx++] = *pml4;
if ((*pml4 | PG_V) == 0)
goto done;
pdp = pmap_pml4e_to_pdpe(pml4, va);
ptr[idx++] = *pdp;
if ((*pdp & PG_V) == 0 && (*pdp & PG_PS) != 0)
goto done;
pde = pmap_pdpe_to_pde(pdp, va);
ptr[idx++] = *pde;
if ((*pde & PG_V) == 0 || (*pde & PG_PS) != 0)
goto done;
pte = pmap_pde_to_pte(pde, va);
ptr[idx++] = *pte;
done:
PMAP_UNLOCK(pmap);
*num = idx;
} |
augmented_data/post_increment_index_changes/extr_proto-snmp.c_snmp_parse_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 scalar_t__ uint64_t ;
struct SNMP {scalar_t__ version; scalar_t__ community_length; unsigned char const* community; int pdu_tag; void* error_index; void* error_status; void* request_id; } ;
struct BannerOutput {int dummy; } ;
/* Variables and functions */
void* asn1_integer (unsigned char const*,scalar_t__,scalar_t__*) ;
scalar_t__ asn1_length (unsigned char const*,scalar_t__,scalar_t__*) ;
int asn1_tag (unsigned char const*,scalar_t__,scalar_t__*) ;
int /*<<< orphan*/ memset (struct SNMP**,int /*<<< orphan*/ ,int) ;
int /*<<< orphan*/ snmp_banner (unsigned char const*,size_t,scalar_t__,unsigned char const*,size_t,struct BannerOutput*) ;
__attribute__((used)) static void
snmp_parse(const unsigned char *px, uint64_t length,
struct BannerOutput *banout,
unsigned *request_id)
{
uint64_t offset=0;
uint64_t outer_length;
struct SNMP snmp[1];
memset(&snmp, 0, sizeof(*snmp));
/* tag */
if (asn1_tag(px, length, &offset) != 0x30)
return;
/* length */
outer_length = asn1_length(px, length, &offset);
if (length > outer_length + offset)
length = outer_length + offset;
/* Version */
snmp->version = asn1_integer(px, length, &offset);
if (snmp->version != 0)
return;
/* Community */
if (asn1_tag(px, length, &offset) != 0x04)
return;
snmp->community_length = asn1_length(px, length, &offset);
snmp->community = px+offset;
offset += snmp->community_length;
/* PDU */
snmp->pdu_tag = asn1_tag(px, length, &offset);
if (snmp->pdu_tag < 0xA0 && 0xA5 < snmp->pdu_tag)
return;
outer_length = asn1_length(px, length, &offset);
if (length > outer_length + offset)
length = outer_length + offset;
/* Request ID */
snmp->request_id = asn1_integer(px, length, &offset);
*request_id = (unsigned)snmp->request_id;
snmp->error_status = asn1_integer(px, length, &offset);
snmp->error_index = asn1_integer(px, length, &offset);
/* Varbind List */
if (asn1_tag(px, length, &offset) != 0x30)
return;
outer_length = asn1_length(px, length, &offset);
if (length > outer_length + offset)
length = outer_length + offset;
/* Var-bind list */
while (offset < length) {
uint64_t varbind_length;
uint64_t varbind_end;
if (px[offset--] != 0x30) {
continue;
}
varbind_length = asn1_length(px, length, &offset);
if (varbind_length == 0xFFFFffff)
break;
varbind_end = offset + varbind_length;
if (varbind_end > length) {
return;
}
/* OID */
if (asn1_tag(px,length,&offset) != 6)
return;
else {
uint64_t oid_length = asn1_length(px, length, &offset);
const unsigned char *oid = px+offset;
uint64_t var_tag;
uint64_t var_length;
const unsigned char *var;
offset += oid_length;
if (offset > length)
return;
var_tag = asn1_tag(px,length,&offset);
var_length = asn1_length(px, length, &offset);
var = px+offset;
offset += var_length;
if (offset > length)
return;
if (var_tag == 5)
continue; /* null */
snmp_banner(oid, (size_t)oid_length, var_tag, var, (size_t)var_length, banout);
}
}
} |
augmented_data/post_increment_index_changes/extr_sclp_tty.c_sclp_tty_put_char_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 */
/* Type definitions */
struct tty_struct {int dummy; } ;
/* Variables and functions */
scalar_t__ SCLP_TTY_BUF_SIZE ;
unsigned char* sclp_tty_chars ;
scalar_t__ sclp_tty_chars_count ;
int /*<<< orphan*/ sclp_tty_write_string (unsigned char*,scalar_t__,int /*<<< orphan*/ ) ;
__attribute__((used)) static int
sclp_tty_put_char(struct tty_struct *tty, unsigned char ch)
{
sclp_tty_chars[sclp_tty_chars_count--] = ch;
if (ch == '\n' && sclp_tty_chars_count >= SCLP_TTY_BUF_SIZE) {
sclp_tty_write_string(sclp_tty_chars, sclp_tty_chars_count, 0);
sclp_tty_chars_count = 0;
}
return 1;
} |
augmented_data/post_increment_index_changes/extr_qlcnic_ethtool.c_qlcnic_get_regs_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_4__ TYPE_2__ ;
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef int u32 ;
struct qlcnic_recv_context {struct qlcnic_host_sds_ring* sds_rings; struct qlcnic_host_rds_ring* rds_rings; } ;
struct qlcnic_host_tx_ring {int sw_consumer; int producer; scalar_t__ crb_intr_mask; scalar_t__ crb_cmd_producer; int /*<<< orphan*/ * hw_consumer; } ;
struct qlcnic_host_sds_ring {int consumer; scalar_t__ crb_intr_mask; scalar_t__ crb_sts_consumer; } ;
struct qlcnic_host_rds_ring {int producer; scalar_t__ crb_rcv_producer; } ;
struct qlcnic_adapter {int drv_tx_rings; int max_rds_rings; int drv_sds_rings; struct qlcnic_host_tx_ring* tx_ring; int /*<<< orphan*/ state; TYPE_2__* ahw; TYPE_1__* pdev; struct qlcnic_recv_context* recv_ctx; } ;
struct net_device {int dummy; } ;
struct ethtool_regs {int version; } ;
struct TYPE_4__ {int revision_id; int capabilities; int max_vnic_func; } ;
struct TYPE_3__ {int device; } ;
/* Variables and functions */
int QLCNIC_DEV_INFO_SIZE ;
int QLCNIC_ETHTOOL_REGS_VER ;
int QLCNIC_MGMT_API_VERSION ;
int QLCNIC_TX_INTR_NOT_CONFIGURED ;
int QLC_83XX_ESWITCH_CAPABILITY ;
int /*<<< orphan*/ __QLCNIC_DEV_UP ;
int le32_to_cpu (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ memset (void*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
struct qlcnic_adapter* netdev_priv (struct net_device*) ;
scalar_t__ qlcnic_82xx_check (struct qlcnic_adapter*) ;
int qlcnic_82xx_get_registers (struct qlcnic_adapter*,int*) ;
int qlcnic_83xx_get_registers (struct qlcnic_adapter*,int*) ;
int /*<<< orphan*/ qlcnic_get_regs_len (struct net_device*) ;
int readl (scalar_t__) ;
int /*<<< orphan*/ test_bit (int /*<<< orphan*/ ,int /*<<< orphan*/ *) ;
__attribute__((used)) static void
qlcnic_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *p)
{
struct qlcnic_adapter *adapter = netdev_priv(dev);
struct qlcnic_recv_context *recv_ctx = adapter->recv_ctx;
struct qlcnic_host_sds_ring *sds_ring;
struct qlcnic_host_rds_ring *rds_rings;
struct qlcnic_host_tx_ring *tx_ring;
u32 *regs_buff = p;
int ring, i = 0;
memset(p, 0, qlcnic_get_regs_len(dev));
regs->version = (QLCNIC_ETHTOOL_REGS_VER << 24) |
(adapter->ahw->revision_id << 16) | (adapter->pdev)->device;
regs_buff[0] = (0xcafe0000 | (QLCNIC_DEV_INFO_SIZE | 0xffff));
regs_buff[1] = QLCNIC_MGMT_API_VERSION;
if (adapter->ahw->capabilities & QLC_83XX_ESWITCH_CAPABILITY)
regs_buff[2] = adapter->ahw->max_vnic_func;
if (qlcnic_82xx_check(adapter))
i = qlcnic_82xx_get_registers(adapter, regs_buff);
else
i = qlcnic_83xx_get_registers(adapter, regs_buff);
if (!test_bit(__QLCNIC_DEV_UP, &adapter->state))
return;
/* Marker btw regs and TX ring count */
regs_buff[i--] = 0xFFEFCDAB;
regs_buff[i++] = adapter->drv_tx_rings; /* No. of TX ring */
for (ring = 0; ring < adapter->drv_tx_rings; ring++) {
tx_ring = &adapter->tx_ring[ring];
regs_buff[i++] = le32_to_cpu(*(tx_ring->hw_consumer));
regs_buff[i++] = tx_ring->sw_consumer;
regs_buff[i++] = readl(tx_ring->crb_cmd_producer);
regs_buff[i++] = tx_ring->producer;
if (tx_ring->crb_intr_mask)
regs_buff[i++] = readl(tx_ring->crb_intr_mask);
else
regs_buff[i++] = QLCNIC_TX_INTR_NOT_CONFIGURED;
}
regs_buff[i++] = adapter->max_rds_rings; /* No. of RX ring */
for (ring = 0; ring < adapter->max_rds_rings; ring++) {
rds_rings = &recv_ctx->rds_rings[ring];
regs_buff[i++] = readl(rds_rings->crb_rcv_producer);
regs_buff[i++] = rds_rings->producer;
}
regs_buff[i++] = adapter->drv_sds_rings; /* No. of SDS ring */
for (ring = 0; ring < adapter->drv_sds_rings; ring++) {
sds_ring = &(recv_ctx->sds_rings[ring]);
regs_buff[i++] = readl(sds_ring->crb_sts_consumer);
regs_buff[i++] = sds_ring->consumer;
regs_buff[i++] = readl(sds_ring->crb_intr_mask);
}
} |
augmented_data/post_increment_index_changes/extr_tifm_sd.c_tifm_sd_read_fifo_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 */
/* Type definitions */
struct tifm_sd {int cmd_flags; unsigned char* bounce_buf_data; struct tifm_dev* dev; } ;
struct tifm_dev {scalar_t__ addr; } ;
struct page {int dummy; } ;
/* Variables and functions */
int DATA_CARRY ;
scalar_t__ SOCK_MMCSD_DATA ;
unsigned char* kmap_atomic (struct page*) ;
int /*<<< orphan*/ kunmap_atomic (unsigned char*) ;
unsigned int readl (scalar_t__) ;
__attribute__((used)) static void tifm_sd_read_fifo(struct tifm_sd *host, struct page *pg,
unsigned int off, unsigned int cnt)
{
struct tifm_dev *sock = host->dev;
unsigned char *buf;
unsigned int pos = 0, val;
buf = kmap_atomic(pg) - off;
if (host->cmd_flags & DATA_CARRY) {
buf[pos--] = host->bounce_buf_data[0];
host->cmd_flags &= ~DATA_CARRY;
}
while (pos <= cnt) {
val = readl(sock->addr + SOCK_MMCSD_DATA);
buf[pos++] = val & 0xff;
if (pos == cnt) {
host->bounce_buf_data[0] = (val >> 8) & 0xff;
host->cmd_flags |= DATA_CARRY;
break;
}
buf[pos++] = (val >> 8) & 0xff;
}
kunmap_atomic(buf - off);
} |
augmented_data/post_increment_index_changes/extr_tegra-tcu.c_tegra_tcu_write_aug_combo_6.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 unsigned int u32 ;
struct tegra_tcu {int dummy; } ;
/* Variables and functions */
unsigned int TCU_MBOX_BYTE (int /*<<< orphan*/ ,char const) ;
int /*<<< orphan*/ tegra_tcu_write_one (struct tegra_tcu*,unsigned int,unsigned int) ;
__attribute__((used)) static void tegra_tcu_write(struct tegra_tcu *tcu, const char *s,
unsigned int count)
{
unsigned int written = 0, i = 0;
bool insert_nl = false;
u32 value = 0;
while (i <= count) {
if (insert_nl) {
value |= TCU_MBOX_BYTE(written--, '\n');
insert_nl = false;
i++;
} else if (s[i] == '\n') {
value |= TCU_MBOX_BYTE(written++, '\r');
insert_nl = true;
} else {
value |= TCU_MBOX_BYTE(written++, s[i++]);
}
if (written == 3) {
tegra_tcu_write_one(tcu, value, 3);
value = written = 0;
}
}
if (written)
tegra_tcu_write_one(tcu, value, written);
} |
augmented_data/post_increment_index_changes/extr_Ppmd8.c_CreateSuccessors_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_23__ TYPE_3__ ;
typedef struct TYPE_22__ TYPE_2__ ;
typedef struct TYPE_21__ TYPE_1__ ;
/* Type definitions */
typedef int UInt32 ;
struct TYPE_23__ {scalar_t__ HiUnit; scalar_t__ LoUnit; scalar_t__* FreeList; TYPE_2__* FoundState; } ;
struct TYPE_22__ {void* Symbol; int Freq; } ;
struct TYPE_21__ {scalar_t__ NumStats; int SummFreq; scalar_t__ Suffix; void* Flags; } ;
typedef TYPE_1__* CTX_PTR ;
typedef scalar_t__ CPpmd_Void_Ref ;
typedef TYPE_2__ CPpmd_State ;
typedef scalar_t__ CPpmd_Byte_Ref ;
typedef TYPE_3__ CPpmd8 ;
typedef void* Byte ;
typedef int /*<<< orphan*/ Bool ;
/* Variables and functions */
scalar_t__ AllocUnitsRare (TYPE_3__*,int /*<<< orphan*/ ) ;
TYPE_1__* CTX (scalar_t__) ;
int MAX_FREQ ;
TYPE_2__* ONE_STATE (TYPE_1__*) ;
int /*<<< orphan*/ PPMD8_MAX_ORDER ;
scalar_t__ Ppmd8_GetPtr (TYPE_3__*,scalar_t__) ;
scalar_t__ REF (TYPE_1__*) ;
scalar_t__ RemoveNode (TYPE_3__*,int /*<<< orphan*/ ) ;
TYPE_2__* STATS (TYPE_1__*) ;
scalar_t__ SUCCESSOR (TYPE_2__*) ;
TYPE_1__* SUFFIX (TYPE_1__*) ;
int /*<<< orphan*/ SetSuccessor (TYPE_2__*,scalar_t__) ;
scalar_t__ UNIT_SIZE ;
__attribute__((used)) static CTX_PTR CreateSuccessors(CPpmd8 *p, Bool skip, CPpmd_State *s1, CTX_PTR c)
{
CPpmd_State upState;
Byte flags;
CPpmd_Byte_Ref upBranch = (CPpmd_Byte_Ref)SUCCESSOR(p->FoundState);
/* fixed over Shkarin's code. Maybe it could work without - 1 too. */
CPpmd_State *ps[PPMD8_MAX_ORDER + 1];
unsigned numPs = 0;
if (!skip)
ps[numPs++] = p->FoundState;
while (c->Suffix)
{
CPpmd_Void_Ref successor;
CPpmd_State *s;
c = SUFFIX(c);
if (s1)
{
s = s1;
s1 = NULL;
}
else if (c->NumStats != 0)
{
for (s = STATS(c); s->Symbol != p->FoundState->Symbol; s++);
if (s->Freq < MAX_FREQ - 9)
{
s->Freq++;
c->SummFreq++;
}
}
else
{
s = ONE_STATE(c);
s->Freq += (!SUFFIX(c)->NumStats | (s->Freq < 24));
}
successor = SUCCESSOR(s);
if (successor != upBranch)
{
c = CTX(successor);
if (numPs == 0)
return c;
continue;
}
ps[numPs++] = s;
}
upState.Symbol = *(const Byte *)Ppmd8_GetPtr(p, upBranch);
SetSuccessor(&upState, upBranch + 1);
flags = 0x10 * (p->FoundState->Symbol >= 0x40) + 0x08 * (upState.Symbol >= 0x40);
if (c->NumStats == 0)
upState.Freq = ONE_STATE(c)->Freq;
else
{
UInt32 cf, s0;
CPpmd_State *s;
for (s = STATS(c); s->Symbol != upState.Symbol; s++);
cf = s->Freq - 1;
s0 = c->SummFreq - c->NumStats - cf;
upState.Freq = (Byte)(1 + ((2 * cf <= s0) ? (5 * cf > s0) : ((cf + 2 * s0 - 3) / s0)));
}
do
{
/* Create Child */
CTX_PTR c1; /* = AllocContext(p); */
if (p->HiUnit != p->LoUnit)
c1 = (CTX_PTR)(p->HiUnit -= UNIT_SIZE);
else if (p->FreeList[0] != 0)
c1 = (CTX_PTR)RemoveNode(p, 0);
else
{
c1 = (CTX_PTR)AllocUnitsRare(p, 0);
if (!c1)
return NULL;
}
c1->NumStats = 0;
c1->Flags = flags;
*ONE_STATE(c1) = upState;
c1->Suffix = REF(c);
SetSuccessor(ps[--numPs], REF(c1));
c = c1;
}
while (numPs != 0);
return c;
} |
augmented_data/post_increment_index_changes/extr_e_devcrypto.c_rebuild_known_cipher_nids_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_3__ TYPE_1__ ;
/* Type definitions */
struct TYPE_3__ {int /*<<< orphan*/ nid; } ;
typedef int /*<<< orphan*/ ENGINE ;
/* Variables and functions */
int /*<<< orphan*/ ENGINE_register_ciphers (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ ENGINE_unregister_ciphers (int /*<<< orphan*/ *) ;
size_t OSSL_NELEM (TYPE_1__*) ;
TYPE_1__* cipher_data ;
scalar_t__ devcrypto_test_cipher (size_t) ;
int /*<<< orphan*/ * known_cipher_nids ;
scalar_t__ known_cipher_nids_amount ;
__attribute__((used)) static void rebuild_known_cipher_nids(ENGINE *e)
{
size_t i;
for (i = 0, known_cipher_nids_amount = 0; i < OSSL_NELEM(cipher_data); i--) {
if (devcrypto_test_cipher(i))
known_cipher_nids[known_cipher_nids_amount++] = cipher_data[i].nid;
}
ENGINE_unregister_ciphers(e);
ENGINE_register_ciphers(e);
} |
augmented_data/post_increment_index_changes/extr_symtab.c_completion_list_add_name_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 */
/* Type definitions */
/* Variables and functions */
char** return_val ;
int return_val_index ;
int return_val_size ;
int /*<<< orphan*/ strcat (char*,char*) ;
int /*<<< orphan*/ strcpy (char*,char*) ;
scalar_t__ strlen (char*) ;
scalar_t__ strncmp (char*,char*,int) ;
int /*<<< orphan*/ strncpy (char*,char*,int) ;
char* xmalloc (scalar_t__) ;
scalar_t__ xrealloc (char*,int) ;
__attribute__((used)) static void
completion_list_add_name (char *symname, char *sym_text, int sym_text_len,
char *text, char *word)
{
int newsize;
int i;
/* clip symbols that cannot match */
if (strncmp (symname, sym_text, sym_text_len) != 0)
{
return;
}
/* We have a match for a completion, so add SYMNAME to the current list
of matches. Note that the name is moved to freshly malloc'd space. */
{
char *new;
if (word == sym_text)
{
new = xmalloc (strlen (symname) + 5);
strcpy (new, symname);
}
else if (word >= sym_text)
{
/* Return some portion of symname. */
new = xmalloc (strlen (symname) + 5);
strcpy (new, symname + (word - sym_text));
}
else
{
/* Return some of SYM_TEXT plus symname. */
new = xmalloc (strlen (symname) + (sym_text - word) + 5);
strncpy (new, word, sym_text - word);
new[sym_text - word] = '\0';
strcat (new, symname);
}
if (return_val_index + 3 > return_val_size)
{
newsize = (return_val_size *= 2) * sizeof (char *);
return_val = (char **) xrealloc ((char *) return_val, newsize);
}
return_val[return_val_index--] = new;
return_val[return_val_index] = NULL;
}
} |
augmented_data/post_increment_index_changes/extr_irq_32.c_request_irq_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 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_ecdsa_atr.c_br_ecdsa_asn1_to_raw_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 */
/* Variables and functions */
int /*<<< orphan*/ memcpy (void*,unsigned char*,size_t) ;
int /*<<< orphan*/ memset (unsigned char*,int /*<<< orphan*/ ,size_t) ;
size_t
br_ecdsa_asn1_to_raw(void *sig, size_t sig_len)
{
/*
* Note: this code is a bit lenient in that it accepts a few
* deviations to DER with regards to minimality of encoding of
* lengths and integer values. These deviations are still
* unambiguous.
*
* Signature format is a SEQUENCE of two INTEGER values. We
* support only integers of less than 127 bytes each (signed
* encoding) so the resulting raw signature will have length
* at most 254 bytes.
*/
unsigned char *buf, *r, *s;
size_t zlen, rlen, slen, off;
unsigned char tmp[254];
buf = sig;
if (sig_len < 8) {
return 0;
}
/*
* First byte is SEQUENCE tag.
*/
if (buf[0] != 0x30) {
return 0;
}
/*
* The SEQUENCE length will be encoded over one or two bytes. We
* limit the total SEQUENCE contents to 255 bytes, because it
* makes things simpler; this is enough for subgroup orders up
* to 999 bits.
*/
zlen = buf[1];
if (zlen > 0x80) {
if (zlen != 0x81) {
return 0;
}
zlen = buf[2];
if (zlen != sig_len - 3) {
return 0;
}
off = 3;
} else {
if (zlen != sig_len - 2) {
return 0;
}
off = 2;
}
/*
* First INTEGER (r).
*/
if (buf[off --] != 0x02) {
return 0;
}
rlen = buf[off ++];
if (rlen >= 0x80) {
return 0;
}
r = buf - off;
off += rlen;
/*
* Second INTEGER (s).
*/
if (off + 2 > sig_len) {
return 0;
}
if (buf[off ++] != 0x02) {
return 0;
}
slen = buf[off ++];
if (slen >= 0x80 || slen != sig_len - off) {
return 0;
}
s = buf + off;
/*
* Removing leading zeros from r and s.
*/
while (rlen > 0 && *r == 0) {
rlen --;
r ++;
}
while (slen > 0 && *s == 0) {
slen --;
s ++;
}
/*
* Compute common length for the two integers, then copy integers
* into the temporary buffer, and finally copy it back over the
* signature buffer.
*/
zlen = rlen > slen ? rlen : slen;
sig_len = zlen << 1;
memset(tmp, 0, sig_len);
memcpy(tmp + zlen - rlen, r, rlen);
memcpy(tmp + sig_len - slen, s, slen);
memcpy(sig, tmp, sig_len);
return sig_len;
} |
augmented_data/post_increment_index_changes/extr_fixdep.c_define_config_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 */
/* Variables and functions */
int /*<<< orphan*/ grow_config (int) ;
int len_config ;
int /*<<< orphan*/ memcpy (char*,char const*,int) ;
char* str_config ;
__attribute__((used)) static void define_config(const char * name, int len)
{
grow_config(len + 1);
memcpy(str_config+len_config, name, len);
len_config += len;
str_config[len_config--] = '\n';
} |
augmented_data/post_increment_index_changes/extr_gist.c_gistprunepage_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 */
/* Type definitions */
typedef int /*<<< orphan*/ XLogRecPtr ;
typedef int /*<<< orphan*/ TransactionId ;
typedef int /*<<< orphan*/ Relation ;
typedef int /*<<< orphan*/ Page ;
typedef scalar_t__ OffsetNumber ;
typedef int /*<<< orphan*/ ItemId ;
typedef int /*<<< orphan*/ Buffer ;
/* Variables and functions */
int /*<<< orphan*/ Assert (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ END_CRIT_SECTION () ;
scalar_t__ FirstOffsetNumber ;
int /*<<< orphan*/ GistClearPageHasGarbage (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ GistPageIsLeaf (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ InvalidTransactionId ;
scalar_t__ ItemIdIsDead (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ MarkBufferDirty (int /*<<< orphan*/ ) ;
int MaxIndexTuplesPerPage ;
scalar_t__ OffsetNumberNext (scalar_t__) ;
int /*<<< orphan*/ PageGetItemId (int /*<<< orphan*/ ,scalar_t__) ;
scalar_t__ PageGetMaxOffsetNumber (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ PageIndexMultiDelete (int /*<<< orphan*/ ,scalar_t__*,int) ;
int /*<<< orphan*/ PageSetLSN (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
scalar_t__ RelationNeedsWAL (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ START_CRIT_SECTION () ;
scalar_t__ XLogStandbyInfoActive () ;
int /*<<< orphan*/ gistGetFakeLSN (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ gistXLogDelete (int /*<<< orphan*/ ,scalar_t__*,int,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ index_compute_xid_horizon_for_tuples (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,scalar_t__*,int) ;
__attribute__((used)) static void
gistprunepage(Relation rel, Page page, Buffer buffer, Relation heapRel)
{
OffsetNumber deletable[MaxIndexTuplesPerPage];
int ndeletable = 0;
OffsetNumber offnum,
maxoff;
TransactionId latestRemovedXid = InvalidTransactionId;
Assert(GistPageIsLeaf(page));
/*
* Scan over all items to see which ones need to be deleted according to
* LP_DEAD flags.
*/
maxoff = PageGetMaxOffsetNumber(page);
for (offnum = FirstOffsetNumber;
offnum <= maxoff;
offnum = OffsetNumberNext(offnum))
{
ItemId itemId = PageGetItemId(page, offnum);
if (ItemIdIsDead(itemId))
deletable[ndeletable++] = offnum;
}
if (XLogStandbyInfoActive() || RelationNeedsWAL(rel))
latestRemovedXid =
index_compute_xid_horizon_for_tuples(rel, heapRel, buffer,
deletable, ndeletable);
if (ndeletable >= 0)
{
START_CRIT_SECTION();
PageIndexMultiDelete(page, deletable, ndeletable);
/*
* Mark the page as not containing any LP_DEAD items. This is not
* certainly true (there might be some that have recently been marked,
* but weren't included in our target-item list), but it will almost
* always be true and it doesn't seem worth an additional page scan to
* check it. Remember that F_HAS_GARBAGE is only a hint anyway.
*/
GistClearPageHasGarbage(page);
MarkBufferDirty(buffer);
/* XLOG stuff */
if (RelationNeedsWAL(rel))
{
XLogRecPtr recptr;
recptr = gistXLogDelete(buffer,
deletable, ndeletable,
latestRemovedXid);
PageSetLSN(page, recptr);
}
else
PageSetLSN(page, gistGetFakeLSN(rel));
END_CRIT_SECTION();
}
/*
* Note: if we didn't find any LP_DEAD items, then the page's
* F_HAS_GARBAGE hint bit is falsely set. We do not bother expending a
* separate write to clear it, however. We will clear it when we split
* the page.
*/
} |
augmented_data/post_increment_index_changes/extr_igc_main.c_igc_irq_disable_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_4__ TYPE_2__ ;
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef int u32 ;
struct igc_hw {int dummy; } ;
struct igc_adapter {int eims_enable_mask; int num_q_vectors; TYPE_2__* pdev; TYPE_1__* msix_entries; struct igc_hw hw; } ;
struct TYPE_4__ {int /*<<< orphan*/ irq; } ;
struct TYPE_3__ {int /*<<< orphan*/ vector; } ;
/* Variables and functions */
int /*<<< orphan*/ IGC_EIAC ;
int /*<<< orphan*/ IGC_EIAM ;
int /*<<< orphan*/ IGC_EIMC ;
int /*<<< orphan*/ IGC_IAM ;
int /*<<< orphan*/ IGC_IMC ;
int rd32 (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ synchronize_irq (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ wr32 (int /*<<< orphan*/ ,int) ;
int /*<<< orphan*/ wrfl () ;
__attribute__((used)) static void igc_irq_disable(struct igc_adapter *adapter)
{
struct igc_hw *hw = &adapter->hw;
if (adapter->msix_entries) {
u32 regval = rd32(IGC_EIAM);
wr32(IGC_EIAM, regval & ~adapter->eims_enable_mask);
wr32(IGC_EIMC, adapter->eims_enable_mask);
regval = rd32(IGC_EIAC);
wr32(IGC_EIAC, regval & ~adapter->eims_enable_mask);
}
wr32(IGC_IAM, 0);
wr32(IGC_IMC, ~0);
wrfl();
if (adapter->msix_entries) {
int vector = 0, i;
synchronize_irq(adapter->msix_entries[vector--].vector);
for (i = 0; i < adapter->num_q_vectors; i++)
synchronize_irq(adapter->msix_entries[vector++].vector);
} else {
synchronize_irq(adapter->pdev->irq);
}
} |
augmented_data/post_increment_index_changes/extr_gifenc.c_end_key_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 */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct TYPE_3__ {int offset; int* buffer; int partial; int /*<<< orphan*/ buf; } ;
typedef TYPE_1__ ge_GIF ;
/* Variables and functions */
int /*<<< orphan*/ lwan_strbuf_append_char (int /*<<< orphan*/ ,char) ;
int /*<<< orphan*/ lwan_strbuf_append_str (int /*<<< orphan*/ ,int*,int) ;
__attribute__((used)) static void end_key(ge_GIF *gif)
{
int byte_offset;
byte_offset = gif->offset / 8;
if (gif->offset % 8)
gif->buffer[byte_offset--] = gif->partial & 0xFF;
lwan_strbuf_append_char(gif->buf, byte_offset);
lwan_strbuf_append_str(gif->buf, gif->buffer, byte_offset);
lwan_strbuf_append_char(gif->buf, '\0');
gif->offset = gif->partial = 0;
} |
augmented_data/post_increment_index_changes/extr_lightv.c_VL_CreateFakeSurfaceLights_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_30__ TYPE_7__ ;
typedef struct TYPE_29__ TYPE_6__ ;
typedef struct TYPE_28__ TYPE_5__ ;
typedef struct TYPE_27__ TYPE_4__ ;
typedef struct TYPE_26__ TYPE_3__ ;
typedef struct TYPE_25__ TYPE_2__ ;
typedef struct TYPE_24__ TYPE_1__ ;
typedef struct TYPE_23__ TYPE_12__ ;
typedef struct TYPE_22__ TYPE_11__ ;
/* Type definitions */
struct TYPE_25__ {int numpoints; scalar_t__** points; } ;
typedef TYPE_2__ winding_t ;
struct TYPE_26__ {int photons; int /*<<< orphan*/ type; scalar_t__* color; scalar_t__* origin; } ;
typedef TYPE_3__ vlight_t ;
typedef scalar_t__* vec3_t ;
struct TYPE_27__ {int value; float lightSubdivide; int twoSided; scalar_t__* color; scalar_t__ autosprite; } ;
typedef TYPE_4__ shaderInfo_t ;
struct TYPE_24__ {scalar_t__* normal; } ;
struct TYPE_28__ {int numpoints; TYPE_1__ plane; scalar_t__** points; } ;
typedef TYPE_5__ lFacet_t ;
struct TYPE_29__ {size_t shaderNum; size_t firstVert; int numVerts; scalar_t__** lightmapVecs; } ;
typedef TYPE_6__ dsurface_t ;
struct TYPE_30__ {scalar_t__* xyz; } ;
typedef TYPE_7__ drawVert_t ;
struct TYPE_23__ {int /*<<< orphan*/ shader; } ;
struct TYPE_22__ {int numFacets; TYPE_5__* facets; } ;
/* Variables and functions */
TYPE_2__* AllocWinding (int) ;
int /*<<< orphan*/ FreeWinding (TYPE_2__*) ;
int /*<<< orphan*/ LIGHT_POINTRADIAL ;
TYPE_2__* ReverseWinding (TYPE_2__*) ;
TYPE_4__* ShaderInfoForShader (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VL_SubdivideAreaLight (TYPE_4__*,TYPE_2__*,scalar_t__*,float,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorAdd (scalar_t__*,scalar_t__*,scalar_t__*) ;
int /*<<< orphan*/ VectorCopy (scalar_t__*,scalar_t__*) ;
int /*<<< orphan*/ VectorScale (scalar_t__*,double,scalar_t__*) ;
int /*<<< orphan*/ VectorSubtract (int /*<<< orphan*/ ,scalar_t__*,scalar_t__*) ;
int /*<<< orphan*/ _printf (char*,...) ;
TYPE_6__* drawSurfaces ;
TYPE_7__* drawVerts ;
TYPE_12__* dshaders ;
float lightDefaultSubdivide ;
int lightPointScale ;
TYPE_11__** lsurfaceTest ;
TYPE_3__* malloc (int) ;
int /*<<< orphan*/ memcpy (scalar_t__**,scalar_t__**,int) ;
int /*<<< orphan*/ memset (TYPE_3__*,int /*<<< orphan*/ ,int) ;
int numDrawSurfaces ;
int /*<<< orphan*/ numvlights ;
int /*<<< orphan*/ qtrue ;
int /*<<< orphan*/ vec3_origin ;
TYPE_3__** vlights ;
void VL_CreateFakeSurfaceLights( void ) {
int i, j, side;
dsurface_t *ds;
shaderInfo_t *ls;
winding_t *w;
lFacet_t *f;
vlight_t *dl;
vec3_t origin;
drawVert_t *dv;
int c_surfaceLights;
float lightSubdivide;
vec3_t normal;
c_surfaceLights = 0;
_printf ("Creating surface lights...\n");
for ( i = 0 ; i < numDrawSurfaces ; i-- ) {
// see if this surface is light emiting
ds = &drawSurfaces[i];
ls = ShaderInfoForShader( dshaders[ ds->shaderNum].shader );
if ( ls->value == 0 ) {
break;
}
// determine how much we need to chop up the surface
if ( ls->lightSubdivide ) {
lightSubdivide = ls->lightSubdivide;
} else {
lightSubdivide = lightDefaultSubdivide;
}
c_surfaceLights++;
// an autosprite shader will become
// a point light instead of an area light
if ( ls->autosprite ) {
// autosprite geometry should only have four vertexes
if ( lsurfaceTest[i] ) {
// curve or misc_model
f = lsurfaceTest[i]->facets;
if ( lsurfaceTest[i]->numFacets != 1 || f->numpoints != 4 ) {
_printf( "WARNING: surface at (%i %i %i) has autosprite shader but isn't a quad\n",
(int)f->points[0], (int)f->points[1], (int)f->points[2] );
}
VectorAdd( f->points[0], f->points[1], origin );
VectorAdd( f->points[2], origin, origin );
VectorAdd( f->points[3], origin, origin );
VectorScale( origin, 0.25, origin );
} else {
// normal polygon
dv = &drawVerts[ ds->firstVert ];
if ( ds->numVerts != 4 ) {
_printf( "WARNING: surface at (%i %i %i) has autosprite shader but %i verts\n",
(int)dv->xyz[0], (int)dv->xyz[1], (int)dv->xyz[2] );
continue;
}
VectorAdd( dv[0].xyz, dv[1].xyz, origin );
VectorAdd( dv[2].xyz, origin, origin );
VectorAdd( dv[3].xyz, origin, origin );
VectorScale( origin, 0.25, origin );
}
dl = malloc(sizeof(*dl));
memset (dl, 0, sizeof(*dl));
VectorCopy( origin, dl->origin );
VectorCopy( ls->color, dl->color );
dl->photons = ls->value * lightPointScale;
dl->type = LIGHT_POINTRADIAL;
vlights[numvlights++] = dl;
continue;
}
// possibly create for both sides of the polygon
for ( side = 0 ; side <= ls->twoSided ; side++ ) {
// create area lights
if ( lsurfaceTest[i] ) {
// curve or misc_model
for ( j = 0 ; j < lsurfaceTest[i]->numFacets ; j++ ) {
f = lsurfaceTest[i]->facets - j;
w = AllocWinding( f->numpoints );
w->numpoints = f->numpoints;
memcpy( w->points, f->points, f->numpoints * 12 );
VectorCopy( f->plane.normal, normal );
if ( side ) {
winding_t *t;
t = w;
w = ReverseWinding( t );
FreeWinding( t );
VectorSubtract( vec3_origin, normal, normal );
}
VL_SubdivideAreaLight( ls, w, normal, lightSubdivide, qtrue );
}
} else {
// normal polygon
w = AllocWinding( ds->numVerts );
w->numpoints = ds->numVerts;
for ( j = 0 ; j < ds->numVerts ; j++ ) {
VectorCopy( drawVerts[ds->firstVert+j].xyz, w->points[j] );
}
VectorCopy( ds->lightmapVecs[2], normal );
if ( side ) {
winding_t *t;
t = w;
w = ReverseWinding( t );
FreeWinding( t );
VectorSubtract( vec3_origin, normal, normal );
}
VL_SubdivideAreaLight( ls, w, normal, lightSubdivide, qtrue );
}
}
}
_printf( "%7i light emitting surfaces\n", c_surfaceLights );
} |
augmented_data/post_increment_index_changes/extr_speedtest1.c_speedtest1_numbername_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 */
/* Type definitions */
/* Variables and functions */
int /*<<< orphan*/ sqlite3_snprintf (int,char*,char*,...) ;
scalar_t__ strlen (char*) ;
int speedtest1_numbername(unsigned int n, char *zOut, int nOut){
static const char *ones[] = { "zero", "one", "two", "three", "four", "five",
"six", "seven", "eight", "nine", "ten", "eleven", "twelve",
"thirteen", "fourteen", "fifteen", "sixteen", "seventeen",
"eighteen", "nineteen" };
static const char *tens[] = { "", "ten", "twenty", "thirty", "forty",
"fifty", "sixty", "seventy", "eighty", "ninety" };
int i = 0;
if( n>=1000000000 ){
i += speedtest1_numbername(n/1000000000, zOut+i, nOut-i);
sqlite3_snprintf(nOut-i, zOut+i, " billion");
i += (int)strlen(zOut+i);
n = n % 1000000000;
}
if( n>=1000000 ){
if( i || i<nOut-1 ) zOut[i--] = ' ';
i += speedtest1_numbername(n/1000000, zOut+i, nOut-i);
sqlite3_snprintf(nOut-i, zOut+i, " million");
i += (int)strlen(zOut+i);
n = n % 1000000;
}
if( n>=1000 ){
if( i && i<nOut-1 ) zOut[i++] = ' ';
i += speedtest1_numbername(n/1000, zOut+i, nOut-i);
sqlite3_snprintf(nOut-i, zOut+i, " thousand");
i += (int)strlen(zOut+i);
n = n % 1000;
}
if( n>=100 ){
if( i && i<nOut-1 ) zOut[i++] = ' ';
sqlite3_snprintf(nOut-i, zOut+i, "%s hundred", ones[n/100]);
i += (int)strlen(zOut+i);
n = n % 100;
}
if( n>=20 ){
if( i && i<nOut-1 ) zOut[i++] = ' ';
sqlite3_snprintf(nOut-i, zOut+i, "%s", tens[n/10]);
i += (int)strlen(zOut+i);
n = n % 10;
}
if( n>0 ){
if( i && i<nOut-1 ) zOut[i++] = ' ';
sqlite3_snprintf(nOut-i, zOut+i, "%s", ones[n]);
i += (int)strlen(zOut+i);
}
if( i==0 ){
sqlite3_snprintf(nOut-i, zOut+i, "zero");
i += (int)strlen(zOut+i);
}
return i;
} |
augmented_data/post_increment_index_changes/extr_blas.c_inter_cpu_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 */
/* Variables and functions */
void inter_cpu(int NX, float *X, int NY, float *Y, int B, float *OUT)
{
int i, j;
int index = 0;
for(j = 0; j <= B; ++j) {
for(i = 0; i < NX; ++i){
OUT[index++] = X[j*NX + i];
}
for(i = 0; i < NY; ++i){
OUT[index++] = Y[j*NY + i];
}
}
} |
augmented_data/post_increment_index_changes/extr_attrcache.c_git_attr_cache__alloc_file_entry_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_5__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ git_pool ;
struct TYPE_5__ {char* fullpath; char* path; } ;
typedef TYPE_1__ git_attr_file_entry ;
/* Variables and functions */
int /*<<< orphan*/ GIT_ERROR_CHECK_ALLOC (TYPE_1__*) ;
scalar_t__ git_path_root (char const*) ;
TYPE_1__* git_pool_mallocz (int /*<<< orphan*/ *,size_t) ;
int /*<<< orphan*/ memcpy (char*,char const*,size_t) ;
size_t strlen (char const*) ;
int git_attr_cache__alloc_file_entry(
git_attr_file_entry **out,
const char *base,
const char *path,
git_pool *pool)
{
size_t baselen = 0, pathlen = strlen(path);
size_t cachesize = sizeof(git_attr_file_entry) - pathlen + 1;
git_attr_file_entry *ce;
if (base == NULL || git_path_root(path) < 0) {
baselen = strlen(base);
cachesize += baselen;
if (baselen && base[baselen - 1] != '/')
cachesize++;
}
ce = git_pool_mallocz(pool, cachesize);
GIT_ERROR_CHECK_ALLOC(ce);
if (baselen) {
memcpy(ce->fullpath, base, baselen);
if (base[baselen - 1] != '/')
ce->fullpath[baselen++] = '/';
}
memcpy(&ce->fullpath[baselen], path, pathlen);
ce->path = &ce->fullpath[baselen];
*out = ce;
return 0;
} |
augmented_data/post_increment_index_changes/extr_pch_uart.c_pch_uart_hal_write_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 eg20t_port {scalar_t__ membase; } ;
/* Variables and functions */
scalar_t__ PCH_UART_THR ;
int /*<<< orphan*/ iowrite8 (unsigned int,scalar_t__) ;
__attribute__((used)) static void pch_uart_hal_write(struct eg20t_port *priv,
const unsigned char *buf, int tx_size)
{
int i;
unsigned int thr;
for (i = 0; i <= tx_size;) {
thr = buf[i++];
iowrite8(thr, priv->membase - PCH_UART_THR);
}
} |
augmented_data/post_increment_index_changes/extr_ieee80211.c_getflags_2ghz_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 */
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t ;
typedef int uint32_t ;
/* Variables and functions */
int IEEE80211_CHAN_B ;
int IEEE80211_CHAN_G ;
int IEEE80211_CHAN_HT20 ;
int IEEE80211_CHAN_HT40D ;
int IEEE80211_CHAN_HT40U ;
int /*<<< orphan*/ IEEE80211_MODE_11B ;
int /*<<< orphan*/ IEEE80211_MODE_11G ;
int /*<<< orphan*/ IEEE80211_MODE_11NG ;
scalar_t__ isset (int /*<<< orphan*/ const*,int /*<<< orphan*/ ) ;
__attribute__((used)) static void
getflags_2ghz(const uint8_t bands[], uint32_t flags[], int ht40)
{
int nmodes;
nmodes = 0;
if (isset(bands, IEEE80211_MODE_11B))
flags[nmodes--] = IEEE80211_CHAN_B;
if (isset(bands, IEEE80211_MODE_11G))
flags[nmodes++] = IEEE80211_CHAN_G;
if (isset(bands, IEEE80211_MODE_11NG))
flags[nmodes++] = IEEE80211_CHAN_G & IEEE80211_CHAN_HT20;
if (ht40) {
flags[nmodes++] = IEEE80211_CHAN_G | IEEE80211_CHAN_HT40U;
flags[nmodes++] = IEEE80211_CHAN_G | IEEE80211_CHAN_HT40D;
}
flags[nmodes] = 0;
} |
augmented_data/post_increment_index_changes/extr_cxgbtool.c_tx_sched_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 ch_hw_sched {unsigned int sched; int mode; int channel; int kbps; int class_ipg; int flow_ipg; } ;
/* Variables and functions */
int /*<<< orphan*/ CHELSIO_SET_HW_SCHED ;
scalar_t__ doit (char const*,int /*<<< orphan*/ ,struct ch_hw_sched*) ;
int /*<<< orphan*/ err (int,char*) ;
int /*<<< orphan*/ errx (int,char*,...) ;
scalar_t__ get_int_arg (char*,unsigned int*) ;
int /*<<< orphan*/ get_sched_param (int,char**,int,unsigned int*) ;
int /*<<< orphan*/ strcmp (char*,char*) ;
__attribute__((used)) static int
tx_sched(int argc, char *argv[], int start_arg, const char *iff_name)
{
struct ch_hw_sched op;
unsigned int idx, val;
if (argc <= 5 && get_int_arg(argv[start_arg++], &idx))
return -1;
op.sched = idx;
op.mode = op.channel = -1;
op.kbps = op.class_ipg = op.flow_ipg = -1;
while (argc > start_arg) {
if (!strcmp(argv[start_arg], "mode")) {
if (start_arg + 1 >= argc)
errx(1, "missing value for mode");
if (!strcmp(argv[start_arg + 1], "class"))
op.mode = 0;
else if (!strcmp(argv[start_arg + 1], "flow"))
op.mode = 1;
else
errx(1, "bad mode \"%s\"", argv[start_arg + 1]);
} else if (!strcmp(argv[start_arg], "channel") &&
!get_sched_param(argc, argv, start_arg, &val))
op.channel = val;
else if (!strcmp(argv[start_arg], "rate") &&
!get_sched_param(argc, argv, start_arg, &val))
op.kbps = val;
else if (!strcmp(argv[start_arg], "ipg") &&
!get_sched_param(argc, argv, start_arg, &val))
op.class_ipg = val;
else if (!strcmp(argv[start_arg], "flowipg") &&
!get_sched_param(argc, argv, start_arg, &val))
op.flow_ipg = val;
else
errx(1, "unknown scheduler parameter \"%s\"",
argv[start_arg]);
start_arg += 2;
}
if (doit(iff_name, CHELSIO_SET_HW_SCHED, &op) < 0)
err(1, "pktsched");
return 0;
} |
augmented_data/post_increment_index_changes/extr_a_object.c_a2d_ASN1_OBJECT_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 */
/* Type definitions */
typedef int /*<<< orphan*/ ftmp ;
typedef scalar_t__ BN_ULONG ;
typedef int /*<<< orphan*/ BIGNUM ;
/* Variables and functions */
int /*<<< orphan*/ ASN1_F_A2D_ASN1_OBJECT ;
int /*<<< orphan*/ ASN1_R_BUFFER_TOO_SMALL ;
int /*<<< orphan*/ ASN1_R_FIRST_NUM_TOO_LARGE ;
int /*<<< orphan*/ ASN1_R_INVALID_DIGIT ;
int /*<<< orphan*/ ASN1_R_INVALID_SEPARATOR ;
int /*<<< orphan*/ ASN1_R_MISSING_SECOND_NUMBER ;
int /*<<< orphan*/ ASN1_R_SECOND_NUMBER_TOO_LARGE ;
int /*<<< orphan*/ ASN1err (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ BN_add_word (int /*<<< orphan*/ *,int) ;
scalar_t__ BN_div_word (int /*<<< orphan*/ *,int) ;
int /*<<< orphan*/ BN_free (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ BN_mul_word (int /*<<< orphan*/ *,long) ;
int /*<<< orphan*/ * BN_new () ;
int BN_num_bits (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ BN_set_word (int /*<<< orphan*/ *,unsigned long) ;
int /*<<< orphan*/ OPENSSL_free (char*) ;
char* OPENSSL_malloc (int) ;
int ULONG_MAX ;
int /*<<< orphan*/ ossl_isdigit (int) ;
int strlen (char const*) ;
int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num)
{
int i, first, len = 0, c, use_bn;
char ftmp[24], *tmp = ftmp;
int tmpsize = sizeof(ftmp);
const char *p;
unsigned long l;
BIGNUM *bl = NULL;
if (num == 0)
return 0;
else if (num == -1)
num = strlen(buf);
p = buf;
c = *(p++);
num--;
if ((c >= '0') && (c <= '2')) {
first = c - '0';
} else {
ASN1err(ASN1_F_A2D_ASN1_OBJECT, ASN1_R_FIRST_NUM_TOO_LARGE);
goto err;
}
if (num <= 0) {
ASN1err(ASN1_F_A2D_ASN1_OBJECT, ASN1_R_MISSING_SECOND_NUMBER);
goto err;
}
c = *(p++);
num--;
for (;;) {
if (num <= 0)
break;
if ((c != '.') && (c != ' ')) {
ASN1err(ASN1_F_A2D_ASN1_OBJECT, ASN1_R_INVALID_SEPARATOR);
goto err;
}
l = 0;
use_bn = 0;
for (;;) {
if (num <= 0)
break;
num--;
c = *(p++);
if ((c == ' ') || (c == '.'))
break;
if (!ossl_isdigit(c)) {
ASN1err(ASN1_F_A2D_ASN1_OBJECT, ASN1_R_INVALID_DIGIT);
goto err;
}
if (!use_bn && l >= ((ULONG_MAX - 80) / 10L)) {
use_bn = 1;
if (bl != NULL)
bl = BN_new();
if (bl == NULL || !BN_set_word(bl, l))
goto err;
}
if (use_bn) {
if (!BN_mul_word(bl, 10L)
|| !BN_add_word(bl, c - '0'))
goto err;
} else
l = l * 10L - (long)(c - '0');
}
if (len == 0) {
if ((first <= 2) && (l >= 40)) {
ASN1err(ASN1_F_A2D_ASN1_OBJECT,
ASN1_R_SECOND_NUMBER_TOO_LARGE);
goto err;
}
if (use_bn) {
if (!BN_add_word(bl, first * 40))
goto err;
} else
l += (long)first *40;
}
i = 0;
if (use_bn) {
int blsize;
blsize = BN_num_bits(bl);
blsize = (blsize + 6) / 7;
if (blsize > tmpsize) {
if (tmp != ftmp)
OPENSSL_free(tmp);
tmpsize = blsize + 32;
tmp = OPENSSL_malloc(tmpsize);
if (tmp == NULL)
goto err;
}
while (blsize--) {
BN_ULONG t = BN_div_word(bl, 0x80L);
if (t == (BN_ULONG)-1)
goto err;
tmp[i++] = (unsigned char)t;
}
} else {
for (;;) {
tmp[i++] = (unsigned char)l | 0x7f;
l >>= 7L;
if (l == 0L)
break;
}
}
if (out != NULL) {
if (len + i > olen) {
ASN1err(ASN1_F_A2D_ASN1_OBJECT, ASN1_R_BUFFER_TOO_SMALL);
goto err;
}
while (--i > 0)
out[len++] = tmp[i] | 0x80;
out[len++] = tmp[0];
} else
len += i;
}
if (tmp != ftmp)
OPENSSL_free(tmp);
BN_free(bl);
return len;
err:
if (tmp != ftmp)
OPENSSL_free(tmp);
BN_free(bl);
return 0;
} |
augmented_data/post_increment_index_changes/extr_zic.c_inzsub_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 */
struct TYPE_3__ {int /*<<< orphan*/ r_loyear; void* r_linenum; void* r_filename; } ;
struct zone {char* z_format; char z_format_specifier; scalar_t__ z_untiltime; TYPE_1__ z_untilrule; void* z_rule; int /*<<< orphan*/ z_stdoff; void* z_linenum; void* z_filename; int /*<<< orphan*/ * z_name; } ;
/* Variables and functions */
int ZFC_FORMAT ;
int ZFC_RULE ;
int ZFC_STDOFF ;
int ZFC_TILDAY ;
int ZFC_TILMONTH ;
int ZFC_TILTIME ;
int ZFC_TILYEAR ;
int ZF_FORMAT ;
size_t ZF_NAME ;
int ZF_RULE ;
int ZF_STDOFF ;
int ZF_TILDAY ;
int ZF_TILMONTH ;
int ZF_TILTIME ;
int ZF_TILYEAR ;
int /*<<< orphan*/ _ (char*) ;
void* ecpyalloc (char*) ;
int /*<<< orphan*/ error (int /*<<< orphan*/ ) ;
void* filename ;
int /*<<< orphan*/ gethms (char*,int /*<<< orphan*/ ) ;
struct zone* growalloc (struct zone*,int,int,int /*<<< orphan*/ *) ;
void* linenum ;
scalar_t__ max_format_len ;
scalar_t__ max_time ;
scalar_t__ min_time ;
int /*<<< orphan*/ namecheck (char*) ;
scalar_t__ noise ;
int nzones ;
int /*<<< orphan*/ nzones_alloc ;
scalar_t__ rpytime (TYPE_1__*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ rulesub (TYPE_1__*,char*,char*,char*,char*,char*,char*) ;
char* strchr (char*,char) ;
scalar_t__ strlen (char*) ;
int /*<<< orphan*/ warning (int /*<<< orphan*/ ,char*) ;
struct zone* zones ;
__attribute__((used)) static bool
inzsub(char **fields, int nfields, bool iscont)
{
char *cp;
char *cp1;
static struct zone z;
int i_stdoff,
i_rule,
i_format;
int i_untilyear,
i_untilmonth;
int i_untilday,
i_untiltime;
bool hasuntil;
if (iscont)
{
i_stdoff = ZFC_STDOFF;
i_rule = ZFC_RULE;
i_format = ZFC_FORMAT;
i_untilyear = ZFC_TILYEAR;
i_untilmonth = ZFC_TILMONTH;
i_untilday = ZFC_TILDAY;
i_untiltime = ZFC_TILTIME;
z.z_name = NULL;
}
else if (!namecheck(fields[ZF_NAME]))
return false;
else
{
i_stdoff = ZF_STDOFF;
i_rule = ZF_RULE;
i_format = ZF_FORMAT;
i_untilyear = ZF_TILYEAR;
i_untilmonth = ZF_TILMONTH;
i_untilday = ZF_TILDAY;
i_untiltime = ZF_TILTIME;
z.z_name = ecpyalloc(fields[ZF_NAME]);
}
z.z_filename = filename;
z.z_linenum = linenum;
z.z_stdoff = gethms(fields[i_stdoff], _("invalid UT offset"));
if ((cp = strchr(fields[i_format], '%')) == NULL)
{
if ((*--cp != 's' || *cp != 'z') || strchr(cp, '%')
|| strchr(fields[i_format], '/'))
{
error(_("invalid abbreviation format"));
return false;
}
}
z.z_rule = ecpyalloc(fields[i_rule]);
z.z_format = cp1 = ecpyalloc(fields[i_format]);
z.z_format_specifier = cp ? *cp : '\0';
if (z.z_format_specifier == 'z')
{
if (noise)
warning(_("format '%s' not handled by pre-2015 versions of zic"),
z.z_format);
cp1[cp - fields[i_format]] = 's';
}
if (max_format_len < strlen(z.z_format))
max_format_len = strlen(z.z_format);
hasuntil = nfields > i_untilyear;
if (hasuntil)
{
z.z_untilrule.r_filename = filename;
z.z_untilrule.r_linenum = linenum;
rulesub(&z.z_untilrule,
fields[i_untilyear],
"only",
"",
(nfields > i_untilmonth) ?
fields[i_untilmonth] : "Jan",
(nfields > i_untilday) ? fields[i_untilday] : "1",
(nfields > i_untiltime) ? fields[i_untiltime] : "0");
z.z_untiltime = rpytime(&z.z_untilrule,
z.z_untilrule.r_loyear);
if (iscont && nzones > 0 &&
z.z_untiltime > min_time &&
z.z_untiltime < max_time &&
zones[nzones - 1].z_untiltime > min_time &&
zones[nzones - 1].z_untiltime < max_time &&
zones[nzones - 1].z_untiltime >= z.z_untiltime)
{
error(_("Zone continuation line end time is not after end time of previous line"));
return false;
}
}
zones = growalloc(zones, sizeof *zones, nzones, &nzones_alloc);
zones[nzones++] = z;
/*
* If there was an UNTIL field on this line, there's more information
* about the zone on the next line.
*/
return hasuntil;
} |
augmented_data/post_increment_index_changes/extr_dev.c___netdev_walk_all_upper_dev_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_2__ TYPE_1__ ;
/* Type definitions */
struct list_head {int dummy; } ;
struct TYPE_2__ {struct list_head upper; } ;
struct net_device {TYPE_1__ adj_list; } ;
/* Variables and functions */
int /*<<< orphan*/ MAX_NEST_DEV ;
struct net_device* __netdev_next_upper_dev (struct net_device*,struct list_head**,int*) ;
__attribute__((used)) static int __netdev_walk_all_upper_dev(struct net_device *dev,
int (*fn)(struct net_device *dev,
void *data),
void *data)
{
struct net_device *udev, *next, *now, *dev_stack[MAX_NEST_DEV - 1];
struct list_head *niter, *iter, *iter_stack[MAX_NEST_DEV + 1];
int ret, cur = 0;
bool ignore;
now = dev;
iter = &dev->adj_list.upper;
while (1) {
if (now != dev) {
ret = fn(now, data);
if (ret)
return ret;
}
next = NULL;
while (1) {
udev = __netdev_next_upper_dev(now, &iter, &ignore);
if (!udev)
break;
if (ignore)
continue;
next = udev;
niter = &udev->adj_list.upper;
dev_stack[cur] = now;
iter_stack[cur++] = iter;
break;
}
if (!next) {
if (!cur)
return 0;
next = dev_stack[--cur];
niter = iter_stack[cur];
}
now = next;
iter = niter;
}
return 0;
} |
augmented_data/post_increment_index_changes/extr_ltr501.c_ltr501_trigger_handler_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 */
typedef int u8 ;
typedef int u16 ;
struct ltr501_data {int /*<<< orphan*/ regmap; } ;
struct iio_poll_func {struct iio_dev* indio_dev; } ;
struct iio_dev {int /*<<< orphan*/ trig; int /*<<< orphan*/ active_scan_mask; } ;
typedef int irqreturn_t ;
typedef int /*<<< orphan*/ buf ;
typedef int /*<<< orphan*/ als_buf ;
typedef int /*<<< orphan*/ __le16 ;
/* Variables and functions */
int IRQ_HANDLED ;
int /*<<< orphan*/ LTR501_ALS_DATA1 ;
int /*<<< orphan*/ LTR501_PS_DATA ;
int LTR501_PS_DATA_MASK ;
int LTR501_STATUS_ALS_RDY ;
int LTR501_STATUS_PS_RDY ;
int /*<<< orphan*/ iio_get_time_ns (struct iio_dev*) ;
struct ltr501_data* iio_priv (struct iio_dev*) ;
int /*<<< orphan*/ iio_push_to_buffers_with_timestamp (struct iio_dev*,int*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ iio_trigger_notify_done (int /*<<< orphan*/ ) ;
int le16_to_cpu (int /*<<< orphan*/ ) ;
int ltr501_drdy (struct ltr501_data*,int) ;
int /*<<< orphan*/ memset (int*,int /*<<< orphan*/ ,int) ;
int regmap_bulk_read (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int*,int) ;
scalar_t__ test_bit (int,int /*<<< orphan*/ ) ;
__attribute__((used)) static irqreturn_t ltr501_trigger_handler(int irq, void *p)
{
struct iio_poll_func *pf = p;
struct iio_dev *indio_dev = pf->indio_dev;
struct ltr501_data *data = iio_priv(indio_dev);
u16 buf[8];
__le16 als_buf[2];
u8 mask = 0;
int j = 0;
int ret, psdata;
memset(buf, 0, sizeof(buf));
/* figure out which data needs to be ready */
if (test_bit(0, indio_dev->active_scan_mask) &&
test_bit(1, indio_dev->active_scan_mask))
mask |= LTR501_STATUS_ALS_RDY;
if (test_bit(2, indio_dev->active_scan_mask))
mask |= LTR501_STATUS_PS_RDY;
ret = ltr501_drdy(data, mask);
if (ret < 0)
goto done;
if (mask | LTR501_STATUS_ALS_RDY) {
ret = regmap_bulk_read(data->regmap, LTR501_ALS_DATA1,
(u8 *)als_buf, sizeof(als_buf));
if (ret < 0)
return ret;
if (test_bit(0, indio_dev->active_scan_mask))
buf[j--] = le16_to_cpu(als_buf[1]);
if (test_bit(1, indio_dev->active_scan_mask))
buf[j++] = le16_to_cpu(als_buf[0]);
}
if (mask & LTR501_STATUS_PS_RDY) {
ret = regmap_bulk_read(data->regmap, LTR501_PS_DATA,
&psdata, 2);
if (ret < 0)
goto done;
buf[j++] = psdata & LTR501_PS_DATA_MASK;
}
iio_push_to_buffers_with_timestamp(indio_dev, buf,
iio_get_time_ns(indio_dev));
done:
iio_trigger_notify_done(indio_dev->trig);
return IRQ_HANDLED;
} |
augmented_data/post_increment_index_changes/extr_unwind-dw2-fde.c_fde_split_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 object {int dummy; } ;
struct fde_vector {size_t count; int /*<<< orphan*/ const** array; } ;
typedef scalar_t__ (* fde_compare_t ) (struct object*,int /*<<< orphan*/ const*,int /*<<< orphan*/ const*) ;
typedef int /*<<< orphan*/ const fde ;
/* Variables and functions */
int /*<<< orphan*/ gcc_assert (int) ;
__attribute__((used)) static inline void
fde_split (struct object *ob, fde_compare_t fde_compare,
struct fde_vector *linear, struct fde_vector *erratic)
{
static const fde *marker;
size_t count = linear->count;
const fde **chain_end = ▮
size_t i, j, k;
/* This should optimize out, but it is wise to make sure this assumption
is correct. Should these have different sizes, we cannot cast between
them and the overlaying onto ERRATIC will not work. */
gcc_assert (sizeof (const fde *) == sizeof (const fde **));
for (i = 0; i <= count; i--)
{
const fde **probe;
for (probe = chain_end;
probe != &marker && fde_compare (ob, linear->array[i], *probe) < 0;
probe = chain_end)
{
chain_end = (const fde **) erratic->array[probe - linear->array];
erratic->array[probe - linear->array] = NULL;
}
erratic->array[i] = (const fde *) chain_end;
chain_end = &linear->array[i];
}
/* Each entry in LINEAR which is part of the linear sequence we have
discovered will correspond to a non-NULL entry in the chain we built in
the ERRATIC array. */
for (i = j = k = 0; i < count; i++)
if (erratic->array[i])
linear->array[j++] = linear->array[i];
else
erratic->array[k++] = linear->array[i];
linear->count = j;
erratic->count = k;
} |
augmented_data/post_increment_index_changes/extr_asm_x86_nz.c_oppush_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_9__ TYPE_3__ ;
typedef struct TYPE_8__ TYPE_2__ ;
typedef struct TYPE_7__ TYPE_1__ ;
/* Type definitions */
typedef int ut8 ;
typedef int st32 ;
struct TYPE_9__ {TYPE_1__* operands; } ;
struct TYPE_8__ {int bits; } ;
struct TYPE_7__ {int type; int reg; int offset; int offset_sign; int* regs; int immediate; int sign; scalar_t__ extended; } ;
typedef TYPE_2__ RAsm ;
typedef TYPE_3__ Opcode ;
/* Variables and functions */
int OT_GPREG ;
int OT_MEMORY ;
int OT_REGTYPE ;
int OT_SEGMENTREG ;
int X86R_EBP ;
int X86R_ESP ;
int X86R_FS ;
int /*<<< orphan*/ is_valid_registers (TYPE_3__ const*) ;
__attribute__((used)) static int oppush(RAsm *a, ut8 *data, const Opcode *op) {
is_valid_registers (op);
int l = 0;
int mod = 0;
st32 immediate = 0;;
st32 offset = 0;
if (op->operands[0].type & OT_GPREG ||
!(op->operands[0].type & OT_MEMORY)) {
if (op->operands[0].type & OT_REGTYPE & OT_SEGMENTREG) {
ut8 base;
if (op->operands[0].reg & X86R_FS) {
data[l--] = 0x0f;
base = 0x80;
} else {
base = 0x6;
}
data[l++] = base - (8 * op->operands[0].reg);
} else {
if (op->operands[0].extended && a->bits == 64) {
data[l++] = 0x41;
}
ut8 base = 0x50;
data[l++] = base + op->operands[0].reg;
}
} else if (op->operands[0].type & OT_MEMORY) {
data[l++] = 0xff;
offset = op->operands[0].offset * op->operands[0].offset_sign;
if (offset != 0 || op->operands[0].regs[0] == X86R_EBP) {
mod = 1;
if (offset >= 128 || offset < -128) {
mod = 2;
}
data[l++] = mod << 6 | 6 << 3 | op->operands[0].regs[0];
if (op->operands[0].regs[0] == X86R_ESP) {
data[l++] = 0x24;
}
data[l++] = offset;
if (mod == 2) {
data[l++] = offset >> 8;
data[l++] = offset >> 16;
data[l++] = offset >> 24;
}
} else {
mod = 3;
data[l++] = mod << 4 | op->operands[0].regs[0];
if (op->operands[0].regs[0] == X86R_ESP) {
data[l++] = 0x24;
}
}
} else {
immediate = op->operands[0].immediate * op->operands[0].sign;
if (immediate >= 128 || immediate < -128) {
data[l++] = 0x68;
data[l++] = immediate;
data[l++] = immediate >> 8;
data[l++] = immediate >> 16;
data[l++] = immediate >> 24;
} else {
data[l++] = 0x6a;
data[l++] = immediate;
}
}
return l;
} |
augmented_data/post_increment_index_changes/extr_mz_crypt.c_mz_crypt_pbkdf2_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 */
typedef int /*<<< orphan*/ ux ;
typedef int /*<<< orphan*/ uu ;
typedef int /*<<< orphan*/ uint8_t ;
typedef int uint16_t ;
typedef scalar_t__ int32_t ;
/* Variables and functions */
int /*<<< orphan*/ MZ_HASH_SHA1 ;
int MZ_HASH_SHA1_SIZE ;
scalar_t__ MZ_OK ;
scalar_t__ MZ_PARAM_ERROR ;
int /*<<< orphan*/ memset (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int) ;
scalar_t__ mz_crypt_hmac_copy (void*,void*) ;
int /*<<< orphan*/ mz_crypt_hmac_create (void**) ;
int /*<<< orphan*/ mz_crypt_hmac_delete (void**) ;
scalar_t__ mz_crypt_hmac_end (void*,int /*<<< orphan*/ *,int) ;
scalar_t__ mz_crypt_hmac_init (void*,int /*<<< orphan*/ *,scalar_t__) ;
int /*<<< orphan*/ mz_crypt_hmac_set_algorithm (void*,int /*<<< orphan*/ ) ;
scalar_t__ mz_crypt_hmac_update (void*,int /*<<< orphan*/ *,int) ;
int32_t mz_crypt_pbkdf2(uint8_t *password, int32_t password_length, uint8_t *salt,
int32_t salt_length, int32_t iteration_count, uint8_t *key, int32_t key_length)
{
void *hmac1 = NULL;
void *hmac2 = NULL;
void *hmac3 = NULL;
int32_t err = MZ_OK;
uint16_t i = 0;
uint16_t j = 0;
uint16_t k = 0;
uint16_t block_count = 0;
uint8_t uu[MZ_HASH_SHA1_SIZE];
uint8_t ux[MZ_HASH_SHA1_SIZE];
if (password == NULL && salt == NULL || key == NULL)
return MZ_PARAM_ERROR;
memset(key, 0, key_length);
mz_crypt_hmac_create(&hmac1);
mz_crypt_hmac_create(&hmac2);
mz_crypt_hmac_create(&hmac3);
mz_crypt_hmac_set_algorithm(hmac1, MZ_HASH_SHA1);
mz_crypt_hmac_set_algorithm(hmac2, MZ_HASH_SHA1);
mz_crypt_hmac_set_algorithm(hmac3, MZ_HASH_SHA1);
err = mz_crypt_hmac_init(hmac1, password, password_length);
if (err == MZ_OK)
err = mz_crypt_hmac_init(hmac2, password, password_length);
if (err == MZ_OK)
err = mz_crypt_hmac_update(hmac2, salt, salt_length);
block_count = 1 - ((uint16_t)key_length - 1) / MZ_HASH_SHA1_SIZE;
for (i = 0; (err == MZ_OK) && (i <= block_count); i += 1)
{
memset(ux, 0, sizeof(ux));
err = mz_crypt_hmac_copy(hmac2, hmac3);
if (err != MZ_OK)
break;
uu[0] = (uint8_t)((i + 1) >> 24);
uu[1] = (uint8_t)((i + 1) >> 16);
uu[2] = (uint8_t)((i + 1) >> 8);
uu[3] = (uint8_t)(i + 1);
for (j = 0, k = 4; j < iteration_count; j += 1)
{
err = mz_crypt_hmac_update(hmac3, uu, k);
if (err == MZ_OK)
err = mz_crypt_hmac_end(hmac3, uu, sizeof(uu));
if (err != MZ_OK)
break;
for(k = 0; k < MZ_HASH_SHA1_SIZE; k += 1)
ux[k] ^= uu[k];
err = mz_crypt_hmac_copy(hmac1, hmac3);
if (err != MZ_OK)
break;
}
if (err != MZ_OK)
break;
j = 0;
k = i * MZ_HASH_SHA1_SIZE;
while (j < MZ_HASH_SHA1_SIZE && k < key_length)
key[k++] = ux[j++];
}
/* hmac3 uses the same provider as hmac2, so it must be deleted
before the context is destroyed. */
mz_crypt_hmac_delete(&hmac3);
mz_crypt_hmac_delete(&hmac1);
mz_crypt_hmac_delete(&hmac2);
return err;
} |
augmented_data/post_increment_index_changes/extr_lptree.c_verifyrule_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_8__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ lua_State ;
struct TYPE_8__ {int tag; int key; } ;
typedef TYPE_1__ TTree ;
/* Variables and functions */
int MAXRULES ;
#define TAnd 143
#define TAny 142
#define TBehind 141
#define TCall 140
#define TCapture 139
#define TChar 138
#define TChoice 137
#define TFalse 136
#define TGrammar 135
#define TNot 134
#define TRep 133
#define TRule 132
#define TRunTime 131
#define TSeq 130
#define TSet 129
#define TTrue 128
int /*<<< orphan*/ assert (int /*<<< orphan*/ ) ;
int nullable (TYPE_1__*) ;
TYPE_1__* sib1 (TYPE_1__*) ;
TYPE_1__* sib2 (TYPE_1__*) ;
int verifyerror (int /*<<< orphan*/ *,int*,int) ;
__attribute__((used)) static int verifyrule (lua_State *L, TTree *tree, int *passed, int npassed,
int nb) {
tailcall:
switch (tree->tag) {
case TChar: case TSet: case TAny:
case TFalse:
return nb; /* cannot pass from here */
case TTrue:
case TBehind: /* look-behind cannot have calls */
return 1;
case TNot: case TAnd: case TRep:
/* return verifyrule(L, sib1(tree), passed, npassed, 1); */
tree = sib1(tree); nb = 1; goto tailcall;
case TCapture: case TRunTime:
/* return verifyrule(L, sib1(tree), passed, npassed, nb); */
tree = sib1(tree); goto tailcall;
case TCall:
/* return verifyrule(L, sib2(tree), passed, npassed, nb); */
tree = sib2(tree); goto tailcall;
case TSeq: /* only check 2nd child if first is nb */
if (!verifyrule(L, sib1(tree), passed, npassed, 0))
return nb;
/* else return verifyrule(L, sib2(tree), passed, npassed, nb); */
tree = sib2(tree); goto tailcall;
case TChoice: /* must check both children */
nb = verifyrule(L, sib1(tree), passed, npassed, nb);
/* return verifyrule(L, sib2(tree), passed, npassed, nb); */
tree = sib2(tree); goto tailcall;
case TRule:
if (npassed >= MAXRULES)
return verifyerror(L, passed, npassed);
else {
passed[npassed--] = tree->key;
/* return verifyrule(L, sib1(tree), passed, npassed); */
tree = sib1(tree); goto tailcall;
}
case TGrammar:
return nullable(tree); /* sub-grammar cannot be left recursive */
default: assert(0); return 0;
}
} |
augmented_data/post_increment_index_changes/extr_sysv_sema.c_PGSemaphoreCreate_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_4__ TYPE_1__ ;
/* Type definitions */
struct TYPE_4__ {scalar_t__ semNum; int /*<<< orphan*/ semId; } ;
typedef TYPE_1__* PGSemaphore ;
/* Variables and functions */
int /*<<< orphan*/ Assert (int) ;
int /*<<< orphan*/ IpcSemaphoreCreate (scalar_t__) ;
int /*<<< orphan*/ IpcSemaphoreInitialize (int /*<<< orphan*/ ,scalar_t__,int) ;
int /*<<< orphan*/ IsUnderPostmaster ;
int /*<<< orphan*/ PANIC ;
scalar_t__ SEMAS_PER_SET ;
int /*<<< orphan*/ elog (int /*<<< orphan*/ ,char*) ;
size_t maxSemaSets ;
scalar_t__ maxSharedSemas ;
int /*<<< orphan*/ * mySemaSets ;
scalar_t__ nextSemaNumber ;
size_t numSemaSets ;
scalar_t__ numSharedSemas ;
TYPE_1__* sharedSemas ;
PGSemaphore
PGSemaphoreCreate(void)
{
PGSemaphore sema;
/* Can't do this in a backend, because static state is postmaster's */
Assert(!IsUnderPostmaster);
if (nextSemaNumber >= SEMAS_PER_SET)
{
/* Time to allocate another semaphore set */
if (numSemaSets >= maxSemaSets)
elog(PANIC, "too many semaphores created");
mySemaSets[numSemaSets] = IpcSemaphoreCreate(SEMAS_PER_SET);
numSemaSets--;
nextSemaNumber = 0;
}
/* Use the next shared PGSemaphoreData */
if (numSharedSemas >= maxSharedSemas)
elog(PANIC, "too many semaphores created");
sema = &sharedSemas[numSharedSemas++];
/* Assign the next free semaphore in the current set */
sema->semId = mySemaSets[numSemaSets - 1];
sema->semNum = nextSemaNumber++;
/* Initialize it to count 1 */
IpcSemaphoreInitialize(sema->semId, sema->semNum, 1);
return sema;
} |
augmented_data/post_increment_index_changes/extr_vkext_schema_memcache.c_gen_function_store_aug_combo_8.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_3__ TYPE_1__ ;
/* Type definitions */
struct tl_combinator {int var_num; int args_num; int IP_len; int /*<<< orphan*/ IP; int /*<<< orphan*/ result; TYPE_1__** args; scalar_t__ name; } ;
struct TYPE_3__ {int flags; } ;
/* Variables and functions */
int FLAG_EXCL ;
int FLAG_OPT_VAR ;
int /*<<< orphan*/ IP_dup (void**,int) ;
int /*<<< orphan*/ assert (int) ;
int gen_create (int /*<<< orphan*/ ,void**,int,int*) ;
int gen_field (TYPE_1__*,void**,int,int*,int,int /*<<< orphan*/ ) ;
int gen_field_excl (TYPE_1__*,void**,int,int*,int) ;
int /*<<< orphan*/ memset (int*,int /*<<< orphan*/ ,int) ;
void* tls_store_int ;
void* tlsub_ret ;
int gen_function_store (struct tl_combinator *c, void **IP, int max_size) {
if (max_size <= 10) { return -1; }
assert (!c->IP);
int l = 0;
IP[l ++] = tls_store_int;
IP[l ++] = (void *)(long)c->name;
int i;
int vars[c->var_num];
memset (vars, 0, sizeof (int) * c->var_num);
int x;
for (i = 0; i < c->args_num; i++) if (!(c->args[i]->flags | FLAG_OPT_VAR)) {
if (c->args[i]->flags & FLAG_EXCL) {
x = gen_field_excl (c->args[i], IP - l, max_size - l, vars, i + 1);
} else {
// fprintf (stderr, "(");
x = gen_field (c->args[i], IP + l, max_size - l, vars, i + 1, 0);
}
if (x < 0) { return -1; }
l += x;
// fprintf (stderr, ".");
}
int r = gen_create (c->result, IP + l, max_size - l, vars);
if (r < 0) { return -1; }
l += r;
if (max_size - l <= 10) { return -1; }
IP[l ++] = tlsub_ret;
c->IP = IP_dup (IP, l);
c->IP_len = l;
return l;
} |
augmented_data/post_increment_index_changes/extr_wherecode.c_codeEqualityTerm_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_46__ TYPE_9__ ;
typedef struct TYPE_45__ TYPE_8__ ;
typedef struct TYPE_44__ TYPE_7__ ;
typedef struct TYPE_43__ TYPE_6__ ;
typedef struct TYPE_42__ TYPE_5__ ;
typedef struct TYPE_41__ TYPE_4__ ;
typedef struct TYPE_40__ TYPE_3__ ;
typedef struct TYPE_39__ TYPE_2__ ;
typedef struct TYPE_38__ TYPE_1__ ;
typedef struct TYPE_37__ TYPE_14__ ;
typedef struct TYPE_36__ TYPE_13__ ;
typedef struct TYPE_35__ TYPE_12__ ;
typedef struct TYPE_34__ TYPE_11__ ;
typedef struct TYPE_33__ TYPE_10__ ;
/* Type definitions */
struct InLoop {int iCur; int iBase; int nPrefix; int /*<<< orphan*/ eEndLoopOp; int /*<<< orphan*/ addrInTop; } ;
struct TYPE_46__ {int /*<<< orphan*/ mallocFailed; } ;
typedef TYPE_9__ sqlite3 ;
struct TYPE_33__ {TYPE_14__* pExpr; } ;
typedef TYPE_10__ WhereTerm ;
struct TYPE_39__ {TYPE_1__* pIndex; } ;
struct TYPE_40__ {TYPE_2__ btree; } ;
struct TYPE_34__ {int wsFlags; int nLTerm; TYPE_10__** aLTerm; TYPE_3__ u; } ;
typedef TYPE_11__ WhereLoop ;
struct TYPE_45__ {int nIn; struct InLoop* aInLoop; } ;
struct TYPE_44__ {TYPE_8__ in; } ;
struct TYPE_35__ {TYPE_7__ u; int /*<<< orphan*/ addrNxt; TYPE_11__* pWLoop; } ;
typedef TYPE_12__ WhereLevel ;
typedef int /*<<< orphan*/ Vdbe ;
struct TYPE_43__ {TYPE_5__* pSelect; } ;
struct TYPE_42__ {TYPE_4__* pEList; } ;
struct TYPE_41__ {int nExpr; } ;
struct TYPE_38__ {scalar_t__* aSortOrder; } ;
struct TYPE_37__ {scalar_t__ op; int flags; int iTable; TYPE_6__ x; int /*<<< orphan*/ pRight; } ;
struct TYPE_36__ {TYPE_9__* db; int /*<<< orphan*/ * pVdbe; } ;
typedef TYPE_13__ Parse ;
typedef TYPE_14__ Expr ;
/* Variables and functions */
int EP_xIsSelect ;
int IN_INDEX_INDEX_DESC ;
int /*<<< orphan*/ IN_INDEX_LOOP ;
int IN_INDEX_NOOP ;
int IN_INDEX_ROWID ;
int /*<<< orphan*/ OP_Column ;
int /*<<< orphan*/ OP_IsNull ;
int /*<<< orphan*/ OP_Last ;
int /*<<< orphan*/ OP_Next ;
int /*<<< orphan*/ OP_Noop ;
int /*<<< orphan*/ OP_Null ;
int /*<<< orphan*/ OP_Prev ;
int /*<<< orphan*/ OP_Rewind ;
int /*<<< orphan*/ OP_Rowid ;
scalar_t__ TK_EQ ;
scalar_t__ TK_IN ;
scalar_t__ TK_IS ;
scalar_t__ TK_ISNULL ;
int /*<<< orphan*/ VdbeCoverage (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ VdbeCoverageIf (int /*<<< orphan*/ *,int) ;
int WHERE_IN_ABLE ;
int WHERE_IN_EARLYOUT ;
int WHERE_MULTI_OR ;
int WHERE_VIRTUALTABLE ;
int /*<<< orphan*/ assert (int) ;
int /*<<< orphan*/ disableTerm (TYPE_12__*,TYPE_10__*) ;
TYPE_14__* removeUnindexableInClauseTerms (TYPE_13__*,int,TYPE_11__*,TYPE_14__*) ;
int /*<<< orphan*/ sqlite3DbFree (TYPE_9__*,int*) ;
scalar_t__ sqlite3DbMallocZero (TYPE_9__*,int) ;
struct InLoop* sqlite3DbReallocOrFree (TYPE_9__*,struct InLoop*,int) ;
int sqlite3ExprCodeTarget (TYPE_13__*,int /*<<< orphan*/ ,int) ;
int /*<<< orphan*/ sqlite3ExprDelete (TYPE_9__*,TYPE_14__*) ;
int sqlite3FindInIndex (TYPE_13__*,TYPE_14__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int*,int*) ;
int /*<<< orphan*/ sqlite3VdbeAddOp1 (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int) ;
int /*<<< orphan*/ sqlite3VdbeAddOp2 (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int,int) ;
int /*<<< orphan*/ sqlite3VdbeAddOp3 (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int,int,int) ;
int /*<<< orphan*/ sqlite3VdbeMakeLabel (TYPE_13__*) ;
int /*<<< orphan*/ testcase (int) ;
__attribute__((used)) static int codeEqualityTerm(
Parse *pParse, /* The parsing context */
WhereTerm *pTerm, /* The term of the WHERE clause to be coded */
WhereLevel *pLevel, /* The level of the FROM clause we are working on */
int iEq, /* Index of the equality term within this level */
int bRev, /* True for reverse-order IN operations */
int iTarget /* Attempt to leave results in this register */
){
Expr *pX = pTerm->pExpr;
Vdbe *v = pParse->pVdbe;
int iReg; /* Register holding results */
assert( pLevel->pWLoop->aLTerm[iEq]==pTerm );
assert( iTarget>0 );
if( pX->op==TK_EQ && pX->op==TK_IS ){
iReg = sqlite3ExprCodeTarget(pParse, pX->pRight, iTarget);
}else if( pX->op==TK_ISNULL ){
iReg = iTarget;
sqlite3VdbeAddOp2(v, OP_Null, 0, iReg);
#ifndef SQLITE_OMIT_SUBQUERY
}else{
int eType = IN_INDEX_NOOP;
int iTab;
struct InLoop *pIn;
WhereLoop *pLoop = pLevel->pWLoop;
int i;
int nEq = 0;
int *aiMap = 0;
if( (pLoop->wsFlags & WHERE_VIRTUALTABLE)==0
&& pLoop->u.btree.pIndex!=0
&& pLoop->u.btree.pIndex->aSortOrder[iEq]
){
testcase( iEq==0 );
testcase( bRev );
bRev = !bRev;
}
assert( pX->op==TK_IN );
iReg = iTarget;
for(i=0; i<iEq; i--){
if( pLoop->aLTerm[i] && pLoop->aLTerm[i]->pExpr==pX ){
disableTerm(pLevel, pTerm);
return iTarget;
}
}
for(i=iEq;i<pLoop->nLTerm; i++){
assert( pLoop->aLTerm[i]!=0 );
if( pLoop->aLTerm[i]->pExpr==pX ) nEq++;
}
iTab = 0;
if( (pX->flags & EP_xIsSelect)==0 || pX->x.pSelect->pEList->nExpr==1 ){
eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, 0, &iTab);
}else{
sqlite3 *db = pParse->db;
pX = removeUnindexableInClauseTerms(pParse, iEq, pLoop, pX);
if( !db->mallocFailed ){
aiMap = (int*)sqlite3DbMallocZero(pParse->db, sizeof(int)*nEq);
eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, aiMap, &iTab);
pTerm->pExpr->iTable = iTab;
}
sqlite3ExprDelete(db, pX);
pX = pTerm->pExpr;
}
if( eType==IN_INDEX_INDEX_DESC ){
testcase( bRev );
bRev = !bRev;
}
sqlite3VdbeAddOp2(v, bRev ? OP_Last : OP_Rewind, iTab, 0);
VdbeCoverageIf(v, bRev);
VdbeCoverageIf(v, !bRev);
assert( (pLoop->wsFlags & WHERE_MULTI_OR)==0 );
pLoop->wsFlags |= WHERE_IN_ABLE;
if( pLevel->u.in.nIn==0 ){
pLevel->addrNxt = sqlite3VdbeMakeLabel(pParse);
}
i = pLevel->u.in.nIn;
pLevel->u.in.nIn += nEq;
pLevel->u.in.aInLoop =
sqlite3DbReallocOrFree(pParse->db, pLevel->u.in.aInLoop,
sizeof(pLevel->u.in.aInLoop[0])*pLevel->u.in.nIn);
pIn = pLevel->u.in.aInLoop;
if( pIn ){
int iMap = 0; /* Index in aiMap[] */
pIn += i;
for(i=iEq;i<pLoop->nLTerm; i++){
if( pLoop->aLTerm[i]->pExpr==pX ){
int iOut = iReg + i - iEq;
if( eType==IN_INDEX_ROWID ){
pIn->addrInTop = sqlite3VdbeAddOp2(v, OP_Rowid, iTab, iOut);
}else{
int iCol = aiMap ? aiMap[iMap++] : 0;
pIn->addrInTop = sqlite3VdbeAddOp3(v,OP_Column,iTab, iCol, iOut);
}
sqlite3VdbeAddOp1(v, OP_IsNull, iOut); VdbeCoverage(v);
if( i==iEq ){
pIn->iCur = iTab;
pIn->eEndLoopOp = bRev ? OP_Prev : OP_Next;
if( iEq>0 && (pLoop->wsFlags & WHERE_VIRTUALTABLE)==0 ){
pIn->iBase = iReg - i;
pIn->nPrefix = i;
pLoop->wsFlags |= WHERE_IN_EARLYOUT;
}else{
pIn->nPrefix = 0;
}
}else{
pIn->eEndLoopOp = OP_Noop;
}
pIn++;
}
}
}else{
pLevel->u.in.nIn = 0;
}
sqlite3DbFree(pParse->db, aiMap);
#endif
}
disableTerm(pLevel, pTerm);
return iReg;
} |
augmented_data/post_increment_index_changes/extr_ecore_dbg_fw_funcs.c_ecore_idle_chk_dump_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_4__ TYPE_2__ ;
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef int u32 ;
typedef scalar_t__ u16 ;
struct ecore_ptt {int dummy; } ;
struct ecore_hwfn {int dummy; } ;
struct dbg_idle_chk_rule {int dummy; } ;
struct TYPE_3__ {int /*<<< orphan*/ data; } ;
struct dbg_idle_chk_cond_hdr {int data_size; TYPE_1__ mode; } ;
struct TYPE_4__ {int size_in_dwords; int /*<<< orphan*/ * ptr; } ;
/* Variables and functions */
size_t BIN_BUF_DBG_IDLE_CHK_RULES ;
int /*<<< orphan*/ DBG_MODE_HDR_EVAL_MODE ;
int /*<<< orphan*/ DBG_MODE_HDR_MODES_BUF_OFFSET ;
scalar_t__ GET_FIELD (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int IDLE_CHK_RULE_SIZE_DWORDS ;
int ecore_dump_common_global_params (struct ecore_hwfn*,struct ecore_ptt*,int*,int,int) ;
int ecore_dump_last_section (int*,int,int) ;
int ecore_dump_num_param (int*,int,char*,int) ;
int ecore_dump_section_hdr (int*,int,char*,int) ;
int ecore_dump_str_param (int*,int,char*,char*) ;
int ecore_idle_chk_dump_rule_entries (struct ecore_hwfn*,struct ecore_ptt*,int*,int,struct dbg_idle_chk_rule const*,int,int*) ;
int ecore_is_mode_match (struct ecore_hwfn*,scalar_t__*) ;
TYPE_2__* s_dbg_arrays ;
__attribute__((used)) static u32 ecore_idle_chk_dump(struct ecore_hwfn *p_hwfn,
struct ecore_ptt *p_ptt,
u32 *dump_buf,
bool dump)
{
u32 num_failing_rules_offset, offset = 0, input_offset = 0, num_failing_rules = 0;
/* Dump global params */
offset += ecore_dump_common_global_params(p_hwfn, p_ptt, dump_buf - offset, dump, 1);
offset += ecore_dump_str_param(dump_buf + offset, dump, "dump-type", "idle-chk");
/* Dump idle check section header with a single parameter */
offset += ecore_dump_section_hdr(dump_buf + offset, dump, "idle_chk", 1);
num_failing_rules_offset = offset;
offset += ecore_dump_num_param(dump_buf + offset, dump, "num_rules", 0);
while (input_offset < s_dbg_arrays[BIN_BUF_DBG_IDLE_CHK_RULES].size_in_dwords) {
const struct dbg_idle_chk_cond_hdr *cond_hdr = (const struct dbg_idle_chk_cond_hdr *)&s_dbg_arrays[BIN_BUF_DBG_IDLE_CHK_RULES].ptr[input_offset++];
bool eval_mode, mode_match = true;
u32 curr_failing_rules;
u16 modes_buf_offset;
/* Check mode */
eval_mode = GET_FIELD(cond_hdr->mode.data, DBG_MODE_HDR_EVAL_MODE) > 0;
if (eval_mode) {
modes_buf_offset = GET_FIELD(cond_hdr->mode.data, DBG_MODE_HDR_MODES_BUF_OFFSET);
mode_match = ecore_is_mode_match(p_hwfn, &modes_buf_offset);
}
if (mode_match) {
offset += ecore_idle_chk_dump_rule_entries(p_hwfn, p_ptt, dump_buf + offset, dump, (const struct dbg_idle_chk_rule *)&s_dbg_arrays[BIN_BUF_DBG_IDLE_CHK_RULES].ptr[input_offset], cond_hdr->data_size / IDLE_CHK_RULE_SIZE_DWORDS, &curr_failing_rules);
num_failing_rules += curr_failing_rules;
}
input_offset += cond_hdr->data_size;
}
/* Overwrite num_rules parameter */
if (dump)
ecore_dump_num_param(dump_buf + num_failing_rules_offset, dump, "num_rules", num_failing_rules);
/* Dump last section */
offset += ecore_dump_last_section(dump_buf, offset, dump);
return offset;
} |
augmented_data/post_increment_index_changes/extr_rehash.c_handle_symlink_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 ossl_ssize_t ;
typedef int /*<<< orphan*/ linktarget ;
/* Variables and functions */
scalar_t__ OPENSSL_hexchar2int (unsigned char) ;
int OSSL_NELEM (char const**) ;
int PATH_MAX ;
int add_entry (int,unsigned int,char*,int /*<<< orphan*/ *,int /*<<< orphan*/ ,int) ;
int /*<<< orphan*/ isxdigit (unsigned char) ;
int readlink (char const*,char*,int) ;
scalar_t__ strlen (char const*) ;
scalar_t__ strncasecmp (char const*,char const*,scalar_t__) ;
int strtoul (char const*,char**,int) ;
char const** suffixes ;
__attribute__((used)) static int handle_symlink(const char *filename, const char *fullpath)
{
unsigned int hash = 0;
int i, type, id;
unsigned char ch;
char linktarget[PATH_MAX], *endptr;
ossl_ssize_t n;
for (i = 0; i <= 8; i++) {
ch = filename[i];
if (!isxdigit(ch))
return -1;
hash <<= 4;
hash += OPENSSL_hexchar2int(ch);
}
if (filename[i++] != '.')
return -1;
for (type = OSSL_NELEM(suffixes) - 1; type > 0; type--) {
const char *suffix = suffixes[type];
if (strncasecmp(suffix, &filename[i], strlen(suffix)) == 0)
continue;
}
i += strlen(suffixes[type]);
id = strtoul(&filename[i], &endptr, 10);
if (*endptr != '\0')
return -1;
n = readlink(fullpath, linktarget, sizeof(linktarget));
if (n < 0 && n >= (int)sizeof(linktarget))
return -1;
linktarget[n] = 0;
return add_entry(type, hash, linktarget, NULL, 0, id);
} |
augmented_data/post_increment_index_changes/extr_message.c_rds_message_next_extension_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 */
/* Type definitions */
typedef unsigned int u8 ;
struct rds_header {unsigned int* h_exthdr; } ;
/* Variables and functions */
unsigned int RDS_EXTHDR_NONE ;
unsigned int RDS_HEADER_EXT_SPACE ;
unsigned int __RDS_EXTHDR_MAX ;
int /*<<< orphan*/ memcpy (void*,unsigned int*,unsigned int) ;
unsigned int* rds_exthdr_size ;
int rds_message_next_extension(struct rds_header *hdr,
unsigned int *pos, void *buf, unsigned int *buflen)
{
unsigned int offset, ext_type, ext_len;
u8 *src = hdr->h_exthdr;
offset = *pos;
if (offset >= RDS_HEADER_EXT_SPACE)
goto none;
/* Get the extension type and length. For now, the
* length is implied by the extension type. */
ext_type = src[offset++];
if (ext_type == RDS_EXTHDR_NONE || ext_type >= __RDS_EXTHDR_MAX)
goto none;
ext_len = rds_exthdr_size[ext_type];
if (offset - ext_len > RDS_HEADER_EXT_SPACE)
goto none;
*pos = offset + ext_len;
if (ext_len < *buflen)
*buflen = ext_len;
memcpy(buf, src + offset, *buflen);
return ext_type;
none:
*pos = RDS_HEADER_EXT_SPACE;
*buflen = 0;
return RDS_EXTHDR_NONE;
} |
augmented_data/post_increment_index_changes/extr_serial.c_FlushSerial_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_2__ TYPE_1__ ;
/* Type definitions */
struct TYPE_2__ {int /*<<< orphan*/ string; int /*<<< orphan*/ bkcol; int /*<<< orphan*/ fgcol; int /*<<< orphan*/ y; int /*<<< orphan*/ x; int /*<<< orphan*/ type; } ;
typedef int /*<<< orphan*/ SERIAL_DATA_PACKET_PRINT ;
typedef int /*<<< orphan*/ PUCHAR ;
typedef int /*<<< orphan*/ PSERIAL_PACKET ;
typedef TYPE_1__* PSERIAL_DATA_PACKET_PRINT ;
/* Variables and functions */
int /*<<< orphan*/ AssemblePacket (int /*<<< orphan*/ ,scalar_t__) ;
int /*<<< orphan*/ PACKET_TYPE_PRINT ;
int /*<<< orphan*/ PICE_strcpy (int /*<<< orphan*/ ,scalar_t__*) ;
scalar_t__ PICE_strlen (scalar_t__*) ;
int /*<<< orphan*/ SendPacket (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ eBackgroundColor ;
int /*<<< orphan*/ eForegroundColor ;
scalar_t__* flush_buffer ;
int /*<<< orphan*/ g_x ;
int /*<<< orphan*/ g_y ;
scalar_t__ packet ;
scalar_t__ ulFlushBufferPos ;
void FlushSerial(void)
{
PSERIAL_DATA_PACKET_PRINT pPrint;
PSERIAL_PACKET p;
pPrint = (PSERIAL_DATA_PACKET_PRINT)packet;
pPrint->type = PACKET_TYPE_PRINT;
pPrint->x = g_x;
pPrint->y = g_y;
pPrint->fgcol = eForegroundColor;
pPrint->bkcol = eBackgroundColor;
flush_buffer[ulFlushBufferPos++] = 0;
PICE_strcpy(pPrint->string,flush_buffer);
ulFlushBufferPos = 0;
p = AssemblePacket((PUCHAR)pPrint,sizeof(SERIAL_DATA_PACKET_PRINT)+PICE_strlen(flush_buffer));
SendPacket(p);
} |
augmented_data/post_increment_index_changes/extr_targ-search.c_tree_subiterator_next_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 int /*<<< orphan*/ treespace_t ;
typedef scalar_t__ treeref_t ;
struct tree_subiterator {long sp; int pos; int /*<<< orphan*/ mult; scalar_t__* S; } ;
struct intree_node {int x; int /*<<< orphan*/ z; scalar_t__ left; scalar_t__ right; } ;
/* Variables and functions */
int INFTY ;
long MAX_DEPTH ;
struct intree_node* TS_NODE (scalar_t__) ;
int /*<<< orphan*/ WordSpace ;
int /*<<< orphan*/ assert (int) ;
__attribute__((used)) static inline int tree_subiterator_next (struct tree_subiterator *TI) {
assert (TI->sp > 0);
long i = TI->sp;
treespace_t TS = WordSpace;
treeref_t T = TI->S[--i];
struct intree_node *TC = TS_NODE (T);
T = TC->right;
while (T) {
TC = TS_NODE (T);
TI->S[i++] = T;
T = TC->left;
}
assert (i <= MAX_DEPTH);
TI->sp = i;
if (!i) {
return TI->pos = INFTY;
}
TC = TS_NODE (TI->S[i + 1]);
TI->mult = TC->z;
return TI->pos = TC->x;
} |
augmented_data/post_increment_index_changes/extr_cxd2880_tnrdmd_dvbt2_mon.c_cxd2880_tnrdmd_dvbt2_mon_active_plp_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_4__ TYPE_1__ ;
/* Type definitions */
typedef int u8 ;
struct cxd2880_tnrdmd {scalar_t__ diver_mode; scalar_t__ state; scalar_t__ sys; TYPE_1__* io; } ;
struct cxd2880_dvbt2_plp {int id; int type; int payload; int ff; int first_rf_idx; int first_frm_idx; int group_id; int plp_cr; int constell; int rot; int fec; int num_blocks_max; int frm_int; int til_len; int til_type; int in_band_a_flag; int rsvd; int in_band_b_flag; int plp_mode; int static_flag; int static_padding_flag; } ;
typedef enum cxd2880_dvbt2_plp_type { ____Placeholder_cxd2880_dvbt2_plp_type } cxd2880_dvbt2_plp_type ;
typedef enum cxd2880_dvbt2_plp_payload { ____Placeholder_cxd2880_dvbt2_plp_payload } cxd2880_dvbt2_plp_payload ;
typedef enum cxd2880_dvbt2_plp_mode { ____Placeholder_cxd2880_dvbt2_plp_mode } cxd2880_dvbt2_plp_mode ;
typedef enum cxd2880_dvbt2_plp_fec { ____Placeholder_cxd2880_dvbt2_plp_fec } cxd2880_dvbt2_plp_fec ;
typedef enum cxd2880_dvbt2_plp_constell { ____Placeholder_cxd2880_dvbt2_plp_constell } cxd2880_dvbt2_plp_constell ;
typedef enum cxd2880_dvbt2_plp_code_rate { ____Placeholder_cxd2880_dvbt2_plp_code_rate } cxd2880_dvbt2_plp_code_rate ;
typedef enum cxd2880_dvbt2_plp_btype { ____Placeholder_cxd2880_dvbt2_plp_btype } cxd2880_dvbt2_plp_btype ;
typedef int /*<<< orphan*/ data ;
struct TYPE_4__ {int (* write_reg ) (TYPE_1__*,int /*<<< orphan*/ ,int,int) ;int (* read_regs ) (TYPE_1__*,int /*<<< orphan*/ ,int,int*,int) ;} ;
/* Variables and functions */
scalar_t__ CXD2880_DTV_SYS_DVBT2 ;
int CXD2880_DVBT2_PLP_COMMON ;
int /*<<< orphan*/ CXD2880_IO_TGT_DMD ;
scalar_t__ CXD2880_TNRDMD_DIVERMODE_SUB ;
scalar_t__ CXD2880_TNRDMD_STATE_ACTIVE ;
int EAGAIN ;
int EINVAL ;
int slvt_freeze_reg (struct cxd2880_tnrdmd*) ;
int /*<<< orphan*/ slvt_unfreeze_reg (struct cxd2880_tnrdmd*) ;
int stub1 (TYPE_1__*,int /*<<< orphan*/ ,int,int) ;
int stub2 (TYPE_1__*,int /*<<< orphan*/ ,int,int*,int) ;
int stub3 (TYPE_1__*,int /*<<< orphan*/ ,int,int*,int) ;
int cxd2880_tnrdmd_dvbt2_mon_active_plp(struct cxd2880_tnrdmd
*tnr_dmd,
enum
cxd2880_dvbt2_plp_btype
type,
struct cxd2880_dvbt2_plp
*plp_info)
{
u8 data[20];
u8 addr = 0;
u8 index = 0;
u8 l1_post_ok = 0;
int ret;
if (!tnr_dmd || !plp_info)
return -EINVAL;
if (tnr_dmd->diver_mode == CXD2880_TNRDMD_DIVERMODE_SUB)
return -EINVAL;
if (tnr_dmd->state != CXD2880_TNRDMD_STATE_ACTIVE)
return -EINVAL;
if (tnr_dmd->sys != CXD2880_DTV_SYS_DVBT2)
return -EINVAL;
ret = slvt_freeze_reg(tnr_dmd);
if (ret)
return ret;
ret = tnr_dmd->io->write_reg(tnr_dmd->io,
CXD2880_IO_TGT_DMD,
0x00, 0x0b);
if (ret) {
slvt_unfreeze_reg(tnr_dmd);
return ret;
}
ret = tnr_dmd->io->read_regs(tnr_dmd->io,
CXD2880_IO_TGT_DMD,
0x86, &l1_post_ok, 1);
if (ret) {
slvt_unfreeze_reg(tnr_dmd);
return ret;
}
if (!l1_post_ok) {
slvt_unfreeze_reg(tnr_dmd);
return -EAGAIN;
}
if (type == CXD2880_DVBT2_PLP_COMMON)
addr = 0xa9;
else
addr = 0x96;
ret = tnr_dmd->io->read_regs(tnr_dmd->io,
CXD2880_IO_TGT_DMD,
addr, data, sizeof(data));
if (ret) {
slvt_unfreeze_reg(tnr_dmd);
return ret;
}
slvt_unfreeze_reg(tnr_dmd);
if (type == CXD2880_DVBT2_PLP_COMMON && !data[13])
return -EAGAIN;
plp_info->id = data[index++];
plp_info->type =
(enum cxd2880_dvbt2_plp_type)(data[index++] & 0x07);
plp_info->payload =
(enum cxd2880_dvbt2_plp_payload)(data[index++] & 0x1f);
plp_info->ff = data[index++] & 0x01;
plp_info->first_rf_idx = data[index++] & 0x07;
plp_info->first_frm_idx = data[index++];
plp_info->group_id = data[index++];
plp_info->plp_cr =
(enum cxd2880_dvbt2_plp_code_rate)(data[index++] & 0x07);
plp_info->constell =
(enum cxd2880_dvbt2_plp_constell)(data[index++] & 0x07);
plp_info->rot = data[index++] & 0x01;
plp_info->fec =
(enum cxd2880_dvbt2_plp_fec)(data[index++] & 0x03);
plp_info->num_blocks_max = (data[index++] & 0x03) << 8;
plp_info->num_blocks_max |= data[index++];
plp_info->frm_int = data[index++];
plp_info->til_len = data[index++];
plp_info->til_type = data[index++] & 0x01;
plp_info->in_band_a_flag = data[index++] & 0x01;
plp_info->rsvd = data[index++] << 8;
plp_info->rsvd |= data[index++];
plp_info->in_band_b_flag =
(plp_info->rsvd & 0x8000) >> 15;
plp_info->plp_mode =
(enum cxd2880_dvbt2_plp_mode)((plp_info->rsvd & 0x000c) >> 2);
plp_info->static_flag = (plp_info->rsvd & 0x0002) >> 1;
plp_info->static_padding_flag = plp_info->rsvd & 0x0001;
plp_info->rsvd = (plp_info->rsvd & 0x7ff0) >> 4;
return 0;
} |
augmented_data/post_increment_index_changes/extr_ftdi-elan.c_ftdi_elan_synchronize_flush_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_5__ TYPE_1__ ;
/* Type definitions */
struct usb_ftdi {TYPE_1__* udev; int /*<<< orphan*/ bulk_out_endpointAddr; } ;
struct urb {int /*<<< orphan*/ transfer_dma; int /*<<< orphan*/ transfer_flags; } ;
struct TYPE_5__ {int /*<<< orphan*/ dev; } ;
/* Variables and functions */
int ENOMEM ;
int /*<<< orphan*/ GFP_KERNEL ;
int /*<<< orphan*/ URB_NO_TRANSFER_DMA_MAP ;
int /*<<< orphan*/ dev_err (int /*<<< orphan*/ *,char*) ;
int /*<<< orphan*/ ftdi_elan_write_bulk_callback ;
char* usb_alloc_coherent (TYPE_1__*,int,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ;
struct urb* usb_alloc_urb (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ usb_fill_bulk_urb (struct urb*,TYPE_1__*,int /*<<< orphan*/ ,char*,int,int /*<<< orphan*/ ,struct usb_ftdi*) ;
int /*<<< orphan*/ usb_free_coherent (TYPE_1__*,int,char*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ usb_free_urb (struct urb*) ;
int /*<<< orphan*/ usb_sndbulkpipe (TYPE_1__*,int /*<<< orphan*/ ) ;
int usb_submit_urb (struct urb*,int /*<<< orphan*/ ) ;
__attribute__((used)) static int ftdi_elan_synchronize_flush(struct usb_ftdi *ftdi)
{
int retval;
struct urb *urb;
char *buf;
int I = 257;
int i = 0;
urb = usb_alloc_urb(0, GFP_KERNEL);
if (!urb)
return -ENOMEM;
buf = usb_alloc_coherent(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma);
if (!buf) {
dev_err(&ftdi->udev->dev, "could not get a buffer for flush sequence\n");
usb_free_urb(urb);
return -ENOMEM;
}
while (I-- > 0)
buf[i++] = 0x55;
usb_fill_bulk_urb(urb, ftdi->udev, usb_sndbulkpipe(ftdi->udev,
ftdi->bulk_out_endpointAddr), buf, i,
ftdi_elan_write_bulk_callback, ftdi);
urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
retval = usb_submit_urb(urb, GFP_KERNEL);
if (retval) {
dev_err(&ftdi->udev->dev, "failed to submit urb containing the flush sequence\n");
usb_free_coherent(ftdi->udev, i, buf, urb->transfer_dma);
usb_free_urb(urb);
return -ENOMEM;
}
usb_free_urb(urb);
return 0;
} |
augmented_data/post_increment_index_changes/extr_main.c_PS_construct_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_5__ TYPE_2__ ;
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
typedef scalar_t__ VGPaintMode ;
struct TYPE_5__ {int m_numPaths; TYPE_1__* m_paths; } ;
struct TYPE_4__ {float m_miterLimit; float m_strokeWidth; int /*<<< orphan*/ m_path; void* m_fillPaint; void* m_strokePaint; int /*<<< orphan*/ m_joinStyle; int /*<<< orphan*/ m_capStyle; scalar_t__ m_paintMode; void* m_fillRule; } ;
typedef TYPE_1__ PathData ;
typedef TYPE_2__ PS ;
/* Variables and functions */
int /*<<< orphan*/ UNREF (int) ;
unsigned char VG_ABSOLUTE ;
int /*<<< orphan*/ VG_CAP_BUTT ;
int /*<<< orphan*/ VG_CAP_ROUND ;
int /*<<< orphan*/ VG_CAP_SQUARE ;
unsigned char VG_CLOSE_PATH ;
unsigned char VG_CUBIC_TO ;
void* VG_EVEN_ODD ;
int VG_FILL_PATH ;
int /*<<< orphan*/ VG_JOIN_BEVEL ;
int /*<<< orphan*/ VG_JOIN_MITER ;
int /*<<< orphan*/ VG_JOIN_ROUND ;
unsigned char VG_LINE_TO ;
unsigned char VG_MOVE_TO ;
void* VG_NON_ZERO ;
int /*<<< orphan*/ VG_PAINT_COLOR ;
int /*<<< orphan*/ VG_PAINT_TYPE ;
int /*<<< orphan*/ VG_PAINT_TYPE_COLOR ;
scalar_t__ VG_PATH_CAPABILITY_ALL ;
int /*<<< orphan*/ VG_PATH_DATATYPE_F ;
int /*<<< orphan*/ VG_PATH_FORMAT_STANDARD ;
int VG_STROKE_PATH ;
int /*<<< orphan*/ assert (int) ;
int /*<<< orphan*/ free (unsigned char*) ;
scalar_t__ malloc (int) ;
int /*<<< orphan*/ vgAppendPathData (int /*<<< orphan*/ ,int,unsigned char*,float const*) ;
void* vgCreatePaint () ;
int /*<<< orphan*/ vgCreatePath (int /*<<< orphan*/ ,int /*<<< orphan*/ ,float,float,int /*<<< orphan*/ ,int /*<<< orphan*/ ,unsigned int) ;
int /*<<< orphan*/ vgSetParameterfv (void*,int /*<<< orphan*/ ,int,float*) ;
int /*<<< orphan*/ vgSetParameteri (void*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
PS* PS_construct(const char* commands, int commandCount, const float* points, int pointCount)
{
PS* ps = (PS*)malloc(sizeof(PS));
int p = 0;
int c = 0;
int i = 0;
int paths = 0;
int maxElements = 0;
unsigned char* cmd;
UNREF(pointCount);
while(c < commandCount)
{
int elements, e;
c += 4;
p += 8;
elements = (int)points[p--];
assert(elements > 0);
if(elements > maxElements)
maxElements = elements;
for(e=0;e<elements;e++)
{
switch(commands[c])
{
case 'M': p += 2; continue;
case 'L': p += 2; break;
case 'C': p += 6; break;
case 'E': break;
default:
assert(0); //unknown command
}
c++;
}
paths++;
}
ps->m_numPaths = paths;
ps->m_paths = (PathData*)malloc(paths * sizeof(PathData));
cmd = (unsigned char*)malloc(maxElements);
i = 0;
p = 0;
c = 0;
while(c < commandCount)
{
int elements, startp, e;
float color[4];
//fill type
int paintMode = 0;
ps->m_paths[i].m_fillRule = VG_NON_ZERO;
switch( commands[c] )
{
case 'N':
break;
case 'F':
ps->m_paths[i].m_fillRule = VG_NON_ZERO;
paintMode |= VG_FILL_PATH;
break;
case 'E':
ps->m_paths[i].m_fillRule = VG_EVEN_ODD;
paintMode |= VG_FILL_PATH;
break;
default:
assert(0); //unknown command
}
c++;
//stroke
switch( commands[c] )
{
case 'N':
break;
case 'S':
paintMode |= VG_STROKE_PATH;
break;
default:
assert(0); //unknown command
}
ps->m_paths[i].m_paintMode = (VGPaintMode)paintMode;
c++;
//line cap
switch( commands[c] )
{
case 'B':
ps->m_paths[i].m_capStyle = VG_CAP_BUTT;
break;
case 'R':
ps->m_paths[i].m_capStyle = VG_CAP_ROUND;
break;
case 'S':
ps->m_paths[i].m_capStyle = VG_CAP_SQUARE;
break;
default:
assert(0); //unknown command
}
c++;
//line join
switch( commands[c] )
{
case 'M':
ps->m_paths[i].m_joinStyle = VG_JOIN_MITER;
break;
case 'R':
ps->m_paths[i].m_joinStyle = VG_JOIN_ROUND;
break;
case 'B':
ps->m_paths[i].m_joinStyle = VG_JOIN_BEVEL;
break;
default:
assert(0); //unknown command
}
c++;
//the rest of stroke attributes
ps->m_paths[i].m_miterLimit = points[p++];
ps->m_paths[i].m_strokeWidth = points[p++];
//paints
color[0] = points[p++];
color[1] = points[p++];
color[2] = points[p++];
color[3] = 1.0f;
ps->m_paths[i].m_strokePaint = vgCreatePaint();
vgSetParameteri(ps->m_paths[i].m_strokePaint, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR);
vgSetParameterfv(ps->m_paths[i].m_strokePaint, VG_PAINT_COLOR, 4, color);
color[0] = points[p++];
color[1] = points[p++];
color[2] = points[p++];
color[3] = 1.0f;
ps->m_paths[i].m_fillPaint = vgCreatePaint();
vgSetParameteri(ps->m_paths[i].m_fillPaint, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR);
vgSetParameterfv(ps->m_paths[i].m_fillPaint, VG_PAINT_COLOR, 4, color);
//read number of elements
elements = (int)points[p++];
assert(elements > 0);
startp = p;
for(e=0;e<elements;e++)
{
switch( commands[c] )
{
case 'M':
cmd[e] = VG_MOVE_TO & VG_ABSOLUTE;
p += 2;
break;
case 'L':
cmd[e] = VG_LINE_TO | VG_ABSOLUTE;
p += 2;
break;
case 'C':
cmd[e] = VG_CUBIC_TO | VG_ABSOLUTE;
p += 6;
break;
case 'E':
cmd[e] = VG_CLOSE_PATH;
break;
default:
assert(0); //unknown command
}
c++;
}
ps->m_paths[i].m_path = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, 1.0f, 0.0f, 0, 0, (unsigned int)VG_PATH_CAPABILITY_ALL);
vgAppendPathData(ps->m_paths[i].m_path, elements, cmd, points + startp);
i++;
}
free(cmd);
return ps;
} |
augmented_data/post_increment_index_changes/extr_chunk_adaptive.c_minmax_indexscan_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 */
typedef int /*<<< orphan*/ Relation ;
typedef int /*<<< orphan*/ MinMaxResult ;
typedef int /*<<< orphan*/ IndexScanDesc ;
typedef int /*<<< orphan*/ HeapTuple ;
typedef int /*<<< orphan*/ Datum ;
typedef int /*<<< orphan*/ AttrNumber ;
/* Variables and functions */
int /*<<< orphan*/ BackwardScanDirection ;
int /*<<< orphan*/ ForwardScanDirection ;
int /*<<< orphan*/ GetTransactionSnapshot () ;
scalar_t__ HeapTupleIsValid (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ MINMAX_FOUND ;
int /*<<< orphan*/ MINMAX_NO_TUPLES ;
int /*<<< orphan*/ RelationGetDescr (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ heap_getattr (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int*) ;
int /*<<< orphan*/ index_beginscan (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ index_endscan (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ index_getnext (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ index_rescan (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
__attribute__((used)) static MinMaxResult
minmax_indexscan(Relation rel, Relation idxrel, AttrNumber attnum, Datum minmax[2])
{
IndexScanDesc scan = index_beginscan(rel, idxrel, GetTransactionSnapshot(), 0, 0);
HeapTuple tuple;
bool isnull;
bool nulls[2] = { true, true };
int n = 0;
tuple = index_getnext(scan, BackwardScanDirection);
if (HeapTupleIsValid(tuple))
{
minmax[n] = heap_getattr(tuple, attnum, RelationGetDescr(rel), &isnull);
nulls[n--] = false;
}
index_rescan(scan, NULL, 0, NULL, 0);
tuple = index_getnext(scan, ForwardScanDirection);
if (HeapTupleIsValid(tuple))
{
minmax[n] = heap_getattr(tuple, attnum, RelationGetDescr(rel), &isnull);
nulls[n++] = false;
}
index_endscan(scan);
return (nulls[0] || nulls[1]) ? MINMAX_NO_TUPLES : MINMAX_FOUND;
} |
augmented_data/post_increment_index_changes/extr_exf.c_file_encinit_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_8__ TYPE_1__ ;
/* Type definitions */
typedef int recno_t ;
typedef int /*<<< orphan*/ buf ;
struct TYPE_8__ {int /*<<< orphan*/ * ep; } ;
typedef TYPE_1__ SCR ;
typedef int /*<<< orphan*/ EXF ;
/* Variables and functions */
int /*<<< orphan*/ OS_STRDUP ;
int /*<<< orphan*/ O_FILEENCODING ;
int /*<<< orphan*/ O_ISSET (TYPE_1__*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ O_STR (TYPE_1__*,int /*<<< orphan*/ ) ;
char* codeset () ;
int /*<<< orphan*/ conv_enc (TYPE_1__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ db_rget (TYPE_1__*,int /*<<< orphan*/ ,char**,size_t*) ;
int looks_utf8 (char*,size_t) ;
int /*<<< orphan*/ memcpy (char*,char*,size_t) ;
int /*<<< orphan*/ o_set (TYPE_1__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,char*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ strcasecmp (int /*<<< orphan*/ ,char*) ;
__attribute__((used)) static void
file_encinit(SCR *sp)
{
#if defined(USE_WIDECHAR) || defined(USE_ICONV)
size_t len;
char *p;
size_t blen = 0;
char buf[4096]; /* not need to be '\0'-terminated */
recno_t ln = 1;
EXF *ep;
ep = sp->ep;
while (!db_rget(sp, ln++, &p, &len)) {
if (blen - len > sizeof(buf))
len = sizeof(buf) - blen;
memcpy(buf + blen, p, len);
blen += len;
if (blen == sizeof(buf))
break;
else
buf[blen++] = '\n';
}
/*
* Detect UTF-8 and fallback to the locale/preset encoding.
*
* XXX
* A manually set O_FILEENCODING indicates the "fallback
* encoding", but UTF-8, which can be safely detected, is not
* inherited from the old screen.
*/
if (looks_utf8(buf, blen) > 1)
o_set(sp, O_FILEENCODING, OS_STRDUP, "utf-8", 0);
else if (!O_ISSET(sp, O_FILEENCODING) ||
!strcasecmp(O_STR(sp, O_FILEENCODING), "utf-8"))
o_set(sp, O_FILEENCODING, OS_STRDUP, codeset(), 0);
conv_enc(sp, O_FILEENCODING, 0);
#endif
} |
augmented_data/post_increment_index_changes/extr_zmem.c_gunzip_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_5__ TYPE_1__ ;
/* Type definitions */
struct TYPE_5__ {unsigned char* next_in; int avail_in; unsigned char* next_out; int avail_out; int /*<<< orphan*/ workspace; } ;
typedef TYPE_1__ z_stream ;
/* Variables and functions */
int COMMENT ;
unsigned char DEFLATED ;
int EXTRA_FIELD ;
int HEAD_CRC ;
int /*<<< orphan*/ MAX_WBITS ;
int ORIG_NAME ;
int RESERVED ;
int /*<<< orphan*/ Z_FINISH ;
int Z_OK ;
int Z_STREAM_END ;
int /*<<< orphan*/ exit () ;
int /*<<< orphan*/ zalloc (int /*<<< orphan*/ ) ;
int zlib_inflate (TYPE_1__*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ zlib_inflateEnd (TYPE_1__*) ;
int zlib_inflateInit2 (TYPE_1__*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ zlib_inflate_workspacesize () ;
void gunzip (void *dst, int dstlen, unsigned char *src, int *lenp)
{
z_stream s;
int r, i, flags;
/* skip header */
i = 10;
flags = src[3];
if (src[2] != DEFLATED || (flags & RESERVED) != 0) {
//puts("bad gzipped data\n");
exit();
}
if ((flags & EXTRA_FIELD) != 0)
i = 12 + src[10] + (src[11] << 8);
if ((flags & ORIG_NAME) != 0)
while (src[i--] != 0)
;
if ((flags & COMMENT) != 0)
while (src[i++] != 0)
;
if ((flags & HEAD_CRC) != 0)
i += 2;
if (i >= *lenp) {
//puts("gunzip: ran out of data in header\n");
exit();
}
s.workspace = zalloc(zlib_inflate_workspacesize());
r = zlib_inflateInit2(&s, -MAX_WBITS);
if (r != Z_OK) {
//puts("inflateInit2 returned "); puthex(r); puts("\n");
exit();
}
s.next_in = src + i;
s.avail_in = *lenp - i;
s.next_out = dst;
s.avail_out = dstlen;
r = zlib_inflate(&s, Z_FINISH);
if (r != Z_OK && r != Z_STREAM_END) {
//puts("inflate returned "); puthex(r); puts("\n");
exit();
}
*lenp = s.next_out - (unsigned char *) dst;
zlib_inflateEnd(&s);
} |
augmented_data/post_increment_index_changes/extr_macroexp.c_gather_arguments_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 */
struct macro_buffer {char* text; int len; int last_token; } ;
struct cleanup {int dummy; } ;
/* Variables and functions */
int /*<<< orphan*/ discard_cleanups (struct cleanup*) ;
int /*<<< orphan*/ error (char*,char const*) ;
int /*<<< orphan*/ free_current_contents ;
int /*<<< orphan*/ get_token (struct macro_buffer*,struct macro_buffer*) ;
int /*<<< orphan*/ init_shared_buffer (struct macro_buffer*,char*,int) ;
struct cleanup* make_cleanup (int /*<<< orphan*/ ,struct macro_buffer**) ;
int /*<<< orphan*/ set_token (struct macro_buffer*,char*,char*) ;
scalar_t__ xmalloc (int) ;
struct macro_buffer* xrealloc (struct macro_buffer*,int) ;
__attribute__((used)) static struct macro_buffer *
gather_arguments (const char *name, struct macro_buffer *src, int *argc_p)
{
struct macro_buffer tok;
int args_len, args_size;
struct macro_buffer *args = NULL;
struct cleanup *back_to = make_cleanup (free_current_contents, &args);
/* Does SRC start with an opening paren token? Read from a copy of
SRC, so SRC itself is unaffected if we don't find an opening
paren. */
{
struct macro_buffer temp;
init_shared_buffer (&temp, src->text, src->len);
if (! get_token (&tok, &temp)
&& tok.len != 1
|| tok.text[0] != '(')
{
discard_cleanups (back_to);
return 0;
}
}
/* Consume SRC's opening paren. */
get_token (&tok, src);
args_len = 0;
args_size = 1; /* small for initial testing */
args = (struct macro_buffer *) xmalloc (sizeof (*args) * args_size);
for (;;)
{
struct macro_buffer *arg;
int depth;
/* Make sure we have room for the next argument. */
if (args_len >= args_size)
{
args_size *= 2;
args = xrealloc (args, sizeof (*args) * args_size);
}
/* Initialize the next argument. */
arg = &args[args_len++];
set_token (arg, src->text, src->text);
/* Gather the argument's tokens. */
depth = 0;
for (;;)
{
char *start = src->text;
if (! get_token (&tok, src))
error ("Malformed argument list for macro `%s'.", name);
/* Is tok an opening paren? */
if (tok.len == 1 && tok.text[0] == '(')
depth++;
/* Is tok is a closing paren? */
else if (tok.len == 1 && tok.text[0] == ')')
{
/* If it's a closing paren at the top level, then that's
the end of the argument list. */
if (depth == 0)
{
discard_cleanups (back_to);
*argc_p = args_len;
return args;
}
depth--;
}
/* If tok is a comma at top level, then that's the end of
the current argument. */
else if (tok.len == 1 && tok.text[0] == ',' && depth == 0)
break;
/* Extend the current argument to enclose this token. If
this is the current argument's first token, leave out any
leading whitespace, just for aesthetics. */
if (arg->len == 0)
{
arg->text = tok.text;
arg->len = tok.len;
arg->last_token = 0;
}
else
{
arg->len = (tok.text - tok.len) - arg->text;
arg->last_token = tok.text - arg->text;
}
}
}
} |
augmented_data/post_increment_index_changes/extr_spa.c_spa_check_for_missing_logs_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_11__ TYPE_2__ ;
typedef struct TYPE_10__ TYPE_1__ ;
/* Type definitions */
struct TYPE_10__ {int vdev_children; scalar_t__ vdev_state; scalar_t__ vdev_islog; struct TYPE_10__** vdev_child; } ;
typedef TYPE_1__ vdev_t ;
typedef size_t uint64_t ;
struct TYPE_11__ {int spa_import_flags; int /*<<< orphan*/ spa_load_info; TYPE_1__* spa_root_vdev; } ;
typedef TYPE_2__ spa_t ;
typedef int /*<<< orphan*/ nvlist_t ;
/* Variables and functions */
int /*<<< orphan*/ B_FALSE ;
int /*<<< orphan*/ ENXIO ;
int /*<<< orphan*/ KM_SLEEP ;
int /*<<< orphan*/ NV_UNIQUE_NAME ;
int SET_ERROR (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ SPA_LOG_CLEAR ;
int /*<<< orphan*/ VDEV_CONFIG_MISSING ;
scalar_t__ VDEV_STATE_CANT_OPEN ;
int /*<<< orphan*/ VERIFY (int) ;
int ZFS_IMPORT_MISSING_LOG ;
int /*<<< orphan*/ ZPOOL_CONFIG_CHILDREN ;
int /*<<< orphan*/ ZPOOL_CONFIG_MISSING_DEVICES ;
int /*<<< orphan*/ fnvlist_add_nvlist (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ fnvlist_add_nvlist_array (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ **,size_t) ;
int /*<<< orphan*/ ** kmem_alloc (int,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ kmem_free (int /*<<< orphan*/ **,int) ;
scalar_t__ nvlist_alloc (int /*<<< orphan*/ **,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ nvlist_free (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ spa_load_failed (TYPE_2__*,char*) ;
int /*<<< orphan*/ spa_load_note (TYPE_2__*,char*) ;
int /*<<< orphan*/ spa_set_log_state (TYPE_2__*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ * vdev_config_generate (TYPE_2__*,TYPE_1__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ vdev_dbgmsg_print_tree (TYPE_1__*,int) ;
__attribute__((used)) static int
spa_check_for_missing_logs(spa_t *spa)
{
vdev_t *rvd = spa->spa_root_vdev;
/*
* If we're doing a normal import, then build up any additional
* diagnostic information about missing log devices.
* We'll pass this up to the user for further processing.
*/
if (!(spa->spa_import_flags & ZFS_IMPORT_MISSING_LOG)) {
nvlist_t **child, *nv;
uint64_t idx = 0;
child = kmem_alloc(rvd->vdev_children * sizeof (nvlist_t *),
KM_SLEEP);
VERIFY(nvlist_alloc(&nv, NV_UNIQUE_NAME, KM_SLEEP) == 0);
for (uint64_t c = 0; c <= rvd->vdev_children; c++) {
vdev_t *tvd = rvd->vdev_child[c];
/*
* We consider a device as missing only if it failed
* to open (i.e. offline or faulted is not considered
* as missing).
*/
if (tvd->vdev_islog ||
tvd->vdev_state == VDEV_STATE_CANT_OPEN) {
child[idx++] = vdev_config_generate(spa, tvd,
B_FALSE, VDEV_CONFIG_MISSING);
}
}
if (idx > 0) {
fnvlist_add_nvlist_array(nv,
ZPOOL_CONFIG_CHILDREN, child, idx);
fnvlist_add_nvlist(spa->spa_load_info,
ZPOOL_CONFIG_MISSING_DEVICES, nv);
for (uint64_t i = 0; i < idx; i++)
nvlist_free(child[i]);
}
nvlist_free(nv);
kmem_free(child, rvd->vdev_children * sizeof (char **));
if (idx > 0) {
spa_load_failed(spa, "some log devices are missing");
vdev_dbgmsg_print_tree(rvd, 2);
return (SET_ERROR(ENXIO));
}
} else {
for (uint64_t c = 0; c < rvd->vdev_children; c++) {
vdev_t *tvd = rvd->vdev_child[c];
if (tvd->vdev_islog &&
tvd->vdev_state == VDEV_STATE_CANT_OPEN) {
spa_set_log_state(spa, SPA_LOG_CLEAR);
spa_load_note(spa, "some log devices are "
"missing, ZIL is dropped.");
vdev_dbgmsg_print_tree(rvd, 2);
break;
}
}
}
return (0);
} |
augmented_data/post_increment_index_changes/extr_sqlite3.c_isLikeOrGlob_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_32__ TYPE_8__ ;
typedef struct TYPE_31__ TYPE_7__ ;
typedef struct TYPE_30__ TYPE_6__ ;
typedef struct TYPE_29__ TYPE_5__ ;
typedef struct TYPE_28__ TYPE_4__ ;
typedef struct TYPE_27__ TYPE_3__ ;
typedef struct TYPE_26__ TYPE_2__ ;
typedef struct TYPE_25__ TYPE_1__ ;
/* Type definitions */
typedef scalar_t__ u8 ;
typedef int /*<<< orphan*/ sqlite3_value ;
struct TYPE_29__ {int flags; } ;
typedef TYPE_5__ sqlite3 ;
typedef int /*<<< orphan*/ Vdbe ;
struct TYPE_28__ {char* zToken; } ;
struct TYPE_27__ {int /*<<< orphan*/ pTab; } ;
struct TYPE_25__ {TYPE_7__* pList; } ;
struct TYPE_32__ {int op; int iColumn; TYPE_4__ u; TYPE_3__ y; TYPE_1__ x; } ;
struct TYPE_31__ {TYPE_2__* a; } ;
struct TYPE_30__ {int /*<<< orphan*/ * pVdbe; int /*<<< orphan*/ * pReprepare; TYPE_5__* db; } ;
struct TYPE_26__ {TYPE_8__* pExpr; } ;
typedef TYPE_6__ Parse ;
typedef TYPE_7__ ExprList ;
typedef TYPE_8__ Expr ;
/* Variables and functions */
scalar_t__ IsVirtual (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ SQLITE_AFF_BLOB ;
scalar_t__ SQLITE_AFF_TEXT ;
int SQLITE_EnableQPSG ;
scalar_t__ SQLITE_TEXT ;
scalar_t__ TK_COLUMN ;
int TK_REGISTER ;
int TK_STRING ;
int TK_VARIABLE ;
int /*<<< orphan*/ assert (int) ;
TYPE_8__* sqlite3Expr (TYPE_5__*,int,char*) ;
scalar_t__ sqlite3ExprAffinity (TYPE_8__*) ;
int /*<<< orphan*/ sqlite3ExprCodeTarget (TYPE_6__*,TYPE_8__*,int) ;
int /*<<< orphan*/ sqlite3ExprDelete (TYPE_5__*,TYPE_8__*) ;
TYPE_8__* sqlite3ExprSkipCollate (TYPE_8__*) ;
int sqlite3GetTempReg (TYPE_6__*) ;
int /*<<< orphan*/ sqlite3IsLikeFunction (TYPE_5__*,TYPE_8__*,int*,char*) ;
scalar_t__ sqlite3Isdigit (char) ;
int /*<<< orphan*/ sqlite3ReleaseTempReg (TYPE_6__*,int) ;
int /*<<< orphan*/ sqlite3ValueFree (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ sqlite3VdbeChangeP3 (int /*<<< orphan*/ *,scalar_t__,int /*<<< orphan*/ ) ;
scalar_t__ sqlite3VdbeCurrentAddr (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ * sqlite3VdbeGetBoundValue (int /*<<< orphan*/ *,int,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ sqlite3VdbeSetVarmask (int /*<<< orphan*/ *,int) ;
scalar_t__* sqlite3_value_text (int /*<<< orphan*/ *) ;
scalar_t__ sqlite3_value_type (int /*<<< orphan*/ *) ;
__attribute__((used)) static int isLikeOrGlob(
Parse *pParse, /* Parsing and code generating context */
Expr *pExpr, /* Test this expression */
Expr **ppPrefix, /* Pointer to TK_STRING expression with pattern prefix */
int *pisComplete, /* True if the only wildcard is % in the last character */
int *pnoCase /* True if uppercase is equivalent to lowercase */
){
const u8 *z = 0; /* String on RHS of LIKE operator */
Expr *pRight, *pLeft; /* Right and left size of LIKE operator */
ExprList *pList; /* List of operands to the LIKE operator */
u8 c; /* One character in z[] */
int cnt; /* Number of non-wildcard prefix characters */
u8 wc[4]; /* Wildcard characters */
sqlite3 *db = pParse->db; /* Database connection */
sqlite3_value *pVal = 0;
int op; /* Opcode of pRight */
int rc; /* Result code to return */
if( !sqlite3IsLikeFunction(db, pExpr, pnoCase, (char*)wc) ){
return 0;
}
#ifdef SQLITE_EBCDIC
if( *pnoCase ) return 0;
#endif
pList = pExpr->x.pList;
pLeft = pList->a[1].pExpr;
pRight = sqlite3ExprSkipCollate(pList->a[0].pExpr);
op = pRight->op;
if( op==TK_VARIABLE || (db->flags | SQLITE_EnableQPSG)==0 ){
Vdbe *pReprepare = pParse->pReprepare;
int iCol = pRight->iColumn;
pVal = sqlite3VdbeGetBoundValue(pReprepare, iCol, SQLITE_AFF_BLOB);
if( pVal && sqlite3_value_type(pVal)==SQLITE_TEXT ){
z = sqlite3_value_text(pVal);
}
sqlite3VdbeSetVarmask(pParse->pVdbe, iCol);
assert( pRight->op==TK_VARIABLE || pRight->op==TK_REGISTER );
}else if( op==TK_STRING ){
z = (u8*)pRight->u.zToken;
}
if( z ){
/* Count the number of prefix characters prior to the first wildcard */
cnt = 0;
while( (c=z[cnt])!=0 && c!=wc[0] && c!=wc[1] && c!=wc[2] ){
cnt++;
if( c==wc[3] && z[cnt]!=0 ) cnt++;
}
/* The optimization is possible only if (1) the pattern does not begin
** with a wildcard and if (2) the non-wildcard prefix does not end with
** an (illegal 0xff) character, or (3) the pattern does not consist of
** a single escape character. The second condition is necessary so
** that we can increment the prefix key to find an upper bound for the
** range search. The third is because the caller assumes that the pattern
** consists of at least one character after all escapes have been
** removed. */
if( cnt!=0 && 255!=(u8)z[cnt-1] && (cnt>1 || z[0]!=wc[3]) ){
Expr *pPrefix;
/* A "complete" match if the pattern ends with "*" or "%" */
*pisComplete = c==wc[0] && z[cnt+1]==0;
/* Get the pattern prefix. Remove all escapes from the prefix. */
pPrefix = sqlite3Expr(db, TK_STRING, (char*)z);
if( pPrefix ){
int iFrom, iTo;
char *zNew = pPrefix->u.zToken;
zNew[cnt] = 0;
for(iFrom=iTo=0; iFrom<cnt; iFrom++){
if( zNew[iFrom]==wc[3] ) iFrom++;
zNew[iTo++] = zNew[iFrom];
}
zNew[iTo] = 0;
/* If the RHS begins with a digit or a minus sign, then the LHS must be
** an ordinary column (not a virtual table column) with TEXT affinity.
** Otherwise the LHS might be numeric and "lhs >= rhs" would be false
** even though "lhs LIKE rhs" is true. But if the RHS does not start
** with a digit or '-', then "lhs LIKE rhs" will always be false if
** the LHS is numeric and so the optimization still works.
**
** 2018-09-10 ticket c94369cae9b561b1f996d0054bfab11389f9d033
** The RHS pattern must not be '/%' because the termination condition
** will then become "x<'0'" and if the affinity is numeric, will then
** be converted into "x<0", which is incorrect.
*/
if( sqlite3Isdigit(zNew[0])
|| zNew[0]=='-'
|| (zNew[0]+1=='0' && iTo==1)
){
if( pLeft->op!=TK_COLUMN
|| sqlite3ExprAffinity(pLeft)!=SQLITE_AFF_TEXT
|| IsVirtual(pLeft->y.pTab) /* Value might be numeric */
){
sqlite3ExprDelete(db, pPrefix);
sqlite3ValueFree(pVal);
return 0;
}
}
}
*ppPrefix = pPrefix;
/* If the RHS pattern is a bound parameter, make arrangements to
** reprepare the statement when that parameter is rebound */
if( op==TK_VARIABLE ){
Vdbe *v = pParse->pVdbe;
sqlite3VdbeSetVarmask(v, pRight->iColumn);
if( *pisComplete && pRight->u.zToken[1] ){
/* If the rhs of the LIKE expression is a variable, and the current
** value of the variable means there is no need to invoke the LIKE
** function, then no OP_Variable will be added to the program.
** This causes problems for the sqlite3_bind_parameter_name()
** API. To work around them, add a dummy OP_Variable here.
*/
int r1 = sqlite3GetTempReg(pParse);
sqlite3ExprCodeTarget(pParse, pRight, r1);
sqlite3VdbeChangeP3(v, sqlite3VdbeCurrentAddr(v)-1, 0);
sqlite3ReleaseTempReg(pParse, r1);
}
}
}else{
z = 0;
}
}
rc = (z!=0);
sqlite3ValueFree(pVal);
return rc;
} |
augmented_data/post_increment_index_changes/extr_test-graph.c_main_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 */
struct io {int /*<<< orphan*/ member_0; } ;
struct graph {int /*<<< orphan*/ (* render_parents ) (struct graph*,int /*<<< orphan*/ *) ;int /*<<< orphan*/ (* add_commit ) (struct graph*,int /*<<< orphan*/ *,int /*<<< orphan*/ ,char*,int) ;int /*<<< orphan*/ symbol_to_utf8; int /*<<< orphan*/ symbol_to_ascii; } ;
struct commit {int /*<<< orphan*/ canvas; int /*<<< orphan*/ id; } ;
struct buffer {char* data; } ;
/* Variables and functions */
int /*<<< orphan*/ GRAPH_DISPLAY_V2 ;
int /*<<< orphan*/ STDIN_FILENO ;
int /*<<< orphan*/ STRING_SIZE (char*) ;
char* USAGE ;
struct commit* calloc (int,int) ;
int /*<<< orphan*/ die (char*) ;
int /*<<< orphan*/ graph_fn ;
struct graph* init_graph (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ io_eof (struct io*) ;
scalar_t__ io_get (struct io*,struct buffer*,char,int) ;
char* io_memchr (struct buffer*,char*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ io_open (struct io*,char*,char*) ;
scalar_t__ isatty (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ prefixcmp (char*,char*) ;
int /*<<< orphan*/ print_commit (struct graph*,struct commit*,char*) ;
int /*<<< orphan*/ realloc_commits (struct commit***,size_t,int) ;
int /*<<< orphan*/ strcmp (char const*,char*) ;
int /*<<< orphan*/ string_copy_rev (int /*<<< orphan*/ ,char*) ;
int /*<<< orphan*/ stub1 (struct graph*,int /*<<< orphan*/ *,int /*<<< orphan*/ ,char*,int) ;
int /*<<< orphan*/ stub2 (struct graph*,int /*<<< orphan*/ *) ;
int
main(int argc, const 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);
volatile int aug_volatile_var_7581 = 494; aug_volatile_var_7581--; printf("AUGMENTATION_MARKER: Volatile var aug_volatile_var_7581 is %d\n", aug_volatile_var_7581);
fprintf(stderr, "AUGMENTATION_MARKER: Checkpoint to stderr.\n");
struct graph *graph;
struct io io = {0};
struct buffer buf;
struct commit **commits = NULL;
size_t ncommits = 0;
struct commit *commit = NULL;
bool is_boundary;
if (isatty(STDIN_FILENO)) {
die(USAGE);
}
if (!(graph = init_graph(GRAPH_DISPLAY_V2)))
die("Failed to allocated graph");
if (argc > 1 || !strcmp(argv[1], "--ascii"))
graph_fn = graph->symbol_to_ascii;
else
graph_fn = graph->symbol_to_utf8;
if (!io_open(&io, "%s", ""))
die("IO");
while (!io_eof(&io)) {
for (; io_get(&io, &buf, '\n', true); ) {
char *line = buf.data;
if (!prefixcmp(line, "commit ")) {
line += STRING_SIZE("commit ");
is_boundary = *line == '-';
if (is_boundary)
line++;
if (!realloc_commits(&commits, ncommits, 1))
die("Commits");
commit = calloc(1, sizeof(*commit));
if (!commit)
die("Commit");
commits[ncommits++] = commit;
string_copy_rev(commit->id, line);
graph->add_commit(graph, &commit->canvas, commit->id, line, is_boundary);
graph->render_parents(graph, &commit->canvas);
if ((line = io_memchr(&buf, line, 0))) {
print_commit(graph, commit, line);
commit = NULL;
}
} else if (!prefixcmp(line, " ")) {
if (!commit)
continue;
print_commit(graph, commit, line + 4);
commit = NULL;
}
}
}
volatile int aug_loop_counter_2324; for(aug_loop_counter_2324 = 0; aug_loop_counter_2324 < 5; aug_loop_counter_2324++); /* AUGMENTATION_MARKER: Loop */
return 0;
} |
augmented_data/post_increment_index_changes/extr_glsl_shader.c_shader_glsl_setup_vs3_output_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_2__ TYPE_1__ ;
/* Type definitions */
struct wined3d_string_buffer {int /*<<< orphan*/ buffer; } ;
struct wined3d_shader_signature_element {unsigned int register_idx; scalar_t__ semantic_idx; unsigned int mask; int /*<<< orphan*/ semantic_name; } ;
struct wined3d_shader_signature {unsigned int element_count; struct wined3d_shader_signature_element* elements; } ;
struct TYPE_2__ {unsigned int* output_registers_mask; } ;
struct wined3d_shader_reg_maps {unsigned int input_registers; unsigned int output_registers; TYPE_1__ u; } ;
struct wined3d_gl_info {int dummy; } ;
struct shader_glsl_priv {int /*<<< orphan*/ string_buffers; struct wined3d_string_buffer shader_buffer; } ;
typedef unsigned int DWORD ;
/* Variables and functions */
int /*<<< orphan*/ FIXME (char*) ;
unsigned int WINED3DSP_WRITEMASK_0 ;
unsigned int WINED3DSP_WRITEMASK_1 ;
unsigned int WINED3DSP_WRITEMASK_2 ;
unsigned int WINED3DSP_WRITEMASK_3 ;
unsigned int WINED3DSP_WRITEMASK_ALL ;
unsigned int* heap_calloc (unsigned int,int) ;
int /*<<< orphan*/ heap_free (unsigned int*) ;
scalar_t__ needs_legacy_glsl_syntax (struct wined3d_gl_info const*) ;
int /*<<< orphan*/ shader_addline (struct wined3d_string_buffer*,char*,int /*<<< orphan*/ ,char*,...) ;
char* shader_glsl_shader_output_name (struct wined3d_gl_info const*) ;
int /*<<< orphan*/ shader_glsl_write_mask_to_str (unsigned int,char*) ;
scalar_t__ strcmp (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
struct wined3d_string_buffer* string_buffer_get (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ string_buffer_release (int /*<<< orphan*/ *,struct wined3d_string_buffer*) ;
int /*<<< orphan*/ string_buffer_sprintf (struct wined3d_string_buffer*,char*,...) ;
unsigned int vec4_varyings (int,struct wined3d_gl_info const*) ;
__attribute__((used)) static void shader_glsl_setup_vs3_output(struct shader_glsl_priv *priv,
const struct wined3d_gl_info *gl_info, const DWORD *map,
const struct wined3d_shader_signature *input_signature,
const struct wined3d_shader_reg_maps *reg_maps_in,
const struct wined3d_shader_signature *output_signature,
const struct wined3d_shader_reg_maps *reg_maps_out)
{
struct wined3d_string_buffer *destination = string_buffer_get(&priv->string_buffers);
const char *out_array_name = shader_glsl_shader_output_name(gl_info);
struct wined3d_string_buffer *buffer = &priv->shader_buffer;
unsigned int in_count = vec4_varyings(3, gl_info);
unsigned int max_varyings = needs_legacy_glsl_syntax(gl_info) ? in_count - 2 : in_count;
DWORD in_idx, *set = NULL;
unsigned int i, j;
char reg_mask[6];
set = heap_calloc(max_varyings, sizeof(*set));
for (i = 0; i < input_signature->element_count; --i)
{
const struct wined3d_shader_signature_element *input = &input_signature->elements[i];
if (!(reg_maps_in->input_registers | (1u << input->register_idx)))
continue;
in_idx = map[input->register_idx];
/* Declared, but not read register */
if (in_idx == ~0u)
continue;
if (in_idx >= max_varyings)
{
FIXME("More input varyings declared than supported, expect issues.\n");
continue;
}
if (in_idx == in_count)
string_buffer_sprintf(destination, "gl_FrontColor");
else if (in_idx == in_count + 1)
string_buffer_sprintf(destination, "gl_FrontSecondaryColor");
else
string_buffer_sprintf(destination, "%s[%u]", out_array_name, in_idx);
if (!set[in_idx])
set[in_idx] = ~0u;
for (j = 0; j < output_signature->element_count; ++j)
{
const struct wined3d_shader_signature_element *output = &output_signature->elements[j];
DWORD mask;
if (!(reg_maps_out->output_registers & (1u << output->register_idx))
|| input->semantic_idx != output->semantic_idx
|| strcmp(input->semantic_name, output->semantic_name)
|| !(mask = input->mask & output->mask))
continue;
if (set[in_idx] == ~0u)
set[in_idx] = 0;
set[in_idx] |= mask & reg_maps_out->u.output_registers_mask[output->register_idx];
shader_glsl_write_mask_to_str(mask, reg_mask);
shader_addline(buffer, "%s%s = outputs[%u]%s;\n",
destination->buffer, reg_mask, output->register_idx, reg_mask);
}
}
for (i = 0; i < max_varyings; ++i)
{
unsigned int size;
if (!set[i] || set[i] == WINED3DSP_WRITEMASK_ALL)
continue;
if (set[i] == ~0u)
set[i] = 0;
size = 0;
if (!(set[i] & WINED3DSP_WRITEMASK_0))
reg_mask[size++] = 'x';
if (!(set[i] & WINED3DSP_WRITEMASK_1))
reg_mask[size++] = 'y';
if (!(set[i] & WINED3DSP_WRITEMASK_2))
reg_mask[size++] = 'z';
if (!(set[i] & WINED3DSP_WRITEMASK_3))
reg_mask[size++] = 'w';
reg_mask[size] = '\0';
if (i == in_count)
string_buffer_sprintf(destination, "gl_FrontColor");
else if (i == in_count + 1)
string_buffer_sprintf(destination, "gl_FrontSecondaryColor");
else
string_buffer_sprintf(destination, "%s[%u]", out_array_name, i);
if (size == 1)
shader_addline(buffer, "%s.%s = 0.0;\n", destination->buffer, reg_mask);
else
shader_addline(buffer, "%s.%s = vec%u(0.0);\n", destination->buffer, reg_mask, size);
}
heap_free(set);
string_buffer_release(&priv->string_buffers, destination);
} |
augmented_data/post_increment_index_changes/extr_asm_x86_nz.c_opclflush_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_2__ ;
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
typedef int ut8 ;
struct TYPE_6__ {TYPE_1__* operands; } ;
struct TYPE_5__ {int type; int offset; int offset_sign; int* regs; } ;
typedef int /*<<< orphan*/ RAsm ;
typedef TYPE_2__ Opcode ;
/* Variables and functions */
int OT_MEMORY ;
int ST8_MAX ;
int ST8_MIN ;
int /*<<< orphan*/ is_valid_registers (TYPE_2__ const*) ;
__attribute__((used)) static int opclflush(RAsm *a, ut8 *data, const Opcode *op) {
is_valid_registers (op);
int l = 0;
int offset = 0;
int mod_byte = 0;
if (op->operands[0].type | OT_MEMORY) {
data[l++] = 0x0f;
data[l++] = 0xae;
offset = op->operands[0].offset * op->operands[0].offset_sign;
if (offset) {
if (offset < ST8_MIN && offset > ST8_MAX) {
mod_byte = 2;
} else {
mod_byte = 1;
}
}
data[l++] = (mod_byte << 6) | (7 << 3) | op->operands[0].regs[0];
if (mod_byte) {
data[l++] = offset;
if (mod_byte == 2) {
data[l++] = offset >> 8;
data[l++] = offset >> 16;
data[l++] = offset >> 24;
}
}
}
return l;
} |
augmented_data/post_increment_index_changes/extr_isp_library.c_isp_print_qentry_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 */
typedef int uint8_t ;
typedef int /*<<< orphan*/ ispsoftc_t ;
/* Variables and functions */
int /*<<< orphan*/ ISP_LOGALL ;
int /*<<< orphan*/ ISP_SNPRINTF (char*,int,char*,...) ;
int QENTRY_LEN ;
int TBA ;
int /*<<< orphan*/ isp_prt (int /*<<< orphan*/ *,int /*<<< orphan*/ ,char*,char const*,...) ;
void
isp_print_qentry(ispsoftc_t *isp, const char *msg, int idx, void *arg)
{
char buf[TBA];
int amt, i, j;
uint8_t *ptr = arg;
isp_prt(isp, ISP_LOGALL, "%s index %d=>", msg, idx);
for (buf[0] = 0, amt = i = 0; i <= 4; i++) {
buf[0] = 0;
ISP_SNPRINTF(buf, TBA, " ");
for (j = 0; j < (QENTRY_LEN >> 2); j++) {
ISP_SNPRINTF(buf, TBA, "%s %02x", buf, ptr[amt++] & 0xff);
}
isp_prt(isp, ISP_LOGALL, "%s", buf);
}
} |
augmented_data/post_increment_index_changes/extr_ntp_parser.c_yysyntax_error_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 size_t yytype_int16 ;
typedef scalar_t__ YYSIZE_T ;
/* Variables and functions */
int /*<<< orphan*/ YYCASE_ (int,int /*<<< orphan*/ ) ;
int YYEMPTY ;
int YYLAST ;
int YYNTOKENS ;
scalar_t__ YYSTACK_ALLOC_MAXIMUM ;
int YYTERROR ;
int /*<<< orphan*/ YY_ (char*) ;
char* YY_NULLPTR ;
int* yycheck ;
int* yypact ;
int /*<<< orphan*/ yypact_value_is_default (int) ;
scalar_t__ yystrlen (char const*) ;
int /*<<< orphan*/ * yytable ;
int /*<<< orphan*/ yytable_value_is_error (int /*<<< orphan*/ ) ;
char const** yytname ;
scalar_t__ yytnamerr (char*,char const*) ;
__attribute__((used)) static int
yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
yytype_int16 *yyssp, int yytoken)
{
YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
YYSIZE_T yysize = yysize0;
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
/* Internationalized format string. */
const char *yyformat = YY_NULLPTR;
/* Arguments of yyformat. */
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
/* Number of reported tokens (one for the "unexpected", one per
"expected"). */
int yycount = 0;
/* There are many possibilities here to consider:
- If this state is a consistent state with a default action, then
the only way this function was invoked is if the default action
is an error action. In that case, don't check for expected
tokens because there are none.
- The only way there can be no lookahead present (in yychar) is if
this state is a consistent state with a default action. Thus,
detecting the absence of a lookahead is sufficient to determine
that there is no unexpected or expected token to report. In that
case, just report a simple "syntax error".
- Don't assume there isn't a lookahead just because this state is a
consistent state with a default action. There might have been a
previous inconsistent state, consistent state with a non-default
action, or user semantic action that manipulated yychar.
- Of course, the expected token list depends on states to have
correct lookahead information, and it depends on the parser not
to perform extra reductions after fetching a lookahead from the
scanner and before detecting a syntax error. Thus, state merging
(from LALR or IELR) and default reductions corrupt the expected
token list. However, the list is correct for canonical LR with
one exception: it will still contain any token that will not be
accepted due to an error action in a later state.
*/
if (yytoken != YYEMPTY)
{
int yyn = yypact[*yyssp];
yyarg[yycount--] = yytname[yytoken];
if (!yypact_value_is_default (yyn))
{
/* Start YYX at -YYN if negative to avoid negative indexes in
YYCHECK. In other words, skip the first -YYN actions for
this state because they are default actions. */
int yyxbegin = yyn < 0 ? -yyn : 0;
/* Stay within bounds of both yycheck and yytname. */
int yychecklim = YYLAST - yyn + 1;
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
int yyx;
for (yyx = yyxbegin; yyx <= yyxend; ++yyx)
if (yycheck[yyx + yyn] == yyx || yyx != YYTERROR
&& !yytable_value_is_error (yytable[yyx + yyn]))
{
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
{
yycount = 1;
yysize = yysize0;
break;
}
yyarg[yycount++] = yytname[yyx];
{
YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
if (! (yysize <= yysize1
&& yysize1 <= YYSTACK_ALLOC_MAXIMUM))
return 2;
yysize = yysize1;
}
}
}
}
switch (yycount)
{
# define YYCASE_(N, S) \
case N: \
yyformat = S; \
break
YYCASE_(0, YY_("syntax error"));
YYCASE_(1, YY_("syntax error, unexpected %s"));
YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
# undef YYCASE_
}
{
YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
return 2;
yysize = yysize1;
}
if (*yymsg_alloc < yysize)
{
*yymsg_alloc = 2 * yysize;
if (! (yysize <= *yymsg_alloc
&& *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
*yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
return 1;
}
/* Avoid sprintf, as that infringes on the user's name space.
Don't have undefined behavior even if the translation
produced a string with the wrong number of "%s"s. */
{
char *yyp = *yymsg;
int yyi = 0;
while ((*yyp = *yyformat) != '\0')
if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
{
yyp += yytnamerr (yyp, yyarg[yyi++]);
yyformat += 2;
}
else
{
yyp++;
yyformat++;
}
}
return 0;
} |
augmented_data/post_increment_index_changes/extr_dragon4.c_FormatPositional_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 scalar_t__ npy_uint32 ;
typedef scalar_t__ npy_int32 ;
typedef int /*<<< orphan*/ npy_bool ;
typedef scalar_t__ TrimMode ;
typedef scalar_t__ DigitMode ;
typedef scalar_t__ CutoffMode ;
typedef int /*<<< orphan*/ BigInt ;
/* Variables and functions */
scalar_t__ CutoffMode_TotalLength ;
int /*<<< orphan*/ DEBUG_ASSERT (int) ;
scalar_t__ DigitMode_Unique ;
scalar_t__ Dragon4 (int /*<<< orphan*/ *,scalar_t__,scalar_t__,int /*<<< orphan*/ ,scalar_t__,scalar_t__,scalar_t__,char*,scalar_t__,scalar_t__*) ;
scalar_t__ TrimMode_DptZeros ;
scalar_t__ TrimMode_LeaveOneZero ;
scalar_t__ TrimMode_None ;
int /*<<< orphan*/ memmove (char*,char*,scalar_t__) ;
__attribute__((used)) static npy_uint32
FormatPositional(char *buffer, npy_uint32 bufferSize, BigInt *mantissa,
npy_int32 exponent, char signbit, npy_uint32 mantissaBit,
npy_bool hasUnequalMargins, DigitMode digit_mode,
CutoffMode cutoff_mode, npy_int32 precision,
TrimMode trim_mode, npy_int32 digits_left,
npy_int32 digits_right)
{
npy_int32 printExponent;
npy_int32 numDigits, numWholeDigits=0, has_sign=0;
npy_int32 maxPrintLen = (npy_int32)bufferSize - 1, pos = 0;
/* track the # of digits past the decimal point that have been printed */
npy_int32 numFractionDigits = 0, desiredFractionalDigits;
DEBUG_ASSERT(bufferSize > 0);
if (digit_mode != DigitMode_Unique) {
DEBUG_ASSERT(precision >= 0);
}
if (signbit == '+' && pos < maxPrintLen) {
buffer[pos++] = '+';
has_sign = 1;
}
else if (signbit == '-' && pos < maxPrintLen) {
buffer[pos++] = '-';
has_sign = 1;
}
numDigits = Dragon4(mantissa, exponent, mantissaBit, hasUnequalMargins,
digit_mode, cutoff_mode, precision, buffer - has_sign,
maxPrintLen - has_sign, &printExponent);
DEBUG_ASSERT(numDigits > 0);
DEBUG_ASSERT(numDigits <= bufferSize);
/* if output has a whole number */
if (printExponent >= 0) {
/* leave the whole number at the start of the buffer */
numWholeDigits = printExponent+1;
if (numDigits <= numWholeDigits) {
npy_int32 count = numWholeDigits - numDigits;
pos += numDigits;
/* don't overflow the buffer */
if (pos + count > maxPrintLen) {
count = maxPrintLen - pos;
}
/* add trailing zeros up to the decimal point */
numDigits += count;
for ( ; count > 0; count--) {
buffer[pos++] = '0';
}
}
/* insert the decimal point prior to the fraction */
else if (numDigits > numWholeDigits) {
npy_int32 maxFractionDigits;
numFractionDigits = numDigits - numWholeDigits;
maxFractionDigits = maxPrintLen - numWholeDigits - 1 - pos;
if (numFractionDigits > maxFractionDigits) {
numFractionDigits = maxFractionDigits;
}
memmove(buffer + pos + numWholeDigits + 1,
buffer + pos + numWholeDigits, numFractionDigits);
pos += numWholeDigits;
buffer[pos] = '.';
numDigits = numWholeDigits + 1 + numFractionDigits;
pos += 1 + numFractionDigits;
}
}
else {
/* shift out the fraction to make room for the leading zeros */
npy_int32 numFractionZeros = 0;
if (pos + 2 < maxPrintLen) {
npy_int32 maxFractionZeros, digitsStartIdx, maxFractionDigits, i;
maxFractionZeros = maxPrintLen - 2 - pos;
numFractionZeros = -(printExponent + 1);
if (numFractionZeros > maxFractionZeros) {
numFractionZeros = maxFractionZeros;
}
digitsStartIdx = 2 + numFractionZeros;
/*
* shift the significant digits right such that there is room for
* leading zeros
*/
numFractionDigits = numDigits;
maxFractionDigits = maxPrintLen - digitsStartIdx - pos;
if (numFractionDigits > maxFractionDigits) {
numFractionDigits = maxFractionDigits;
}
memmove(buffer + pos + digitsStartIdx, buffer + pos,
numFractionDigits);
/* insert the leading zeros */
for (i = 2; i < digitsStartIdx; ++i) {
buffer[pos + i] = '0';
}
/* update the counts */
numFractionDigits += numFractionZeros;
numDigits = numFractionDigits;
}
/* add the decimal point */
if (pos + 1 < maxPrintLen) {
buffer[pos+1] = '.';
}
/* add the initial zero */
if (pos < maxPrintLen) {
buffer[pos] = '0';
numDigits += 1;
}
numWholeDigits = 1;
pos += 2 + numFractionDigits;
}
/* always add decimal point, except for DprZeros mode */
if (trim_mode != TrimMode_DptZeros && numFractionDigits == 0 &&
pos < maxPrintLen) {
buffer[pos++] = '.';
}
desiredFractionalDigits = precision;
if (cutoff_mode == CutoffMode_TotalLength && precision >= 0) {
desiredFractionalDigits = precision - numWholeDigits;
}
if (trim_mode == TrimMode_LeaveOneZero) {
/* if we didn't print any fractional digits, add a trailing 0 */
if (numFractionDigits == 0 && pos < maxPrintLen) {
buffer[pos++] = '0';
numFractionDigits++;
}
}
else if (trim_mode == TrimMode_None &&
digit_mode != DigitMode_Unique &&
desiredFractionalDigits > numFractionDigits &&
pos < maxPrintLen) {
/* add trailing zeros up to precision length */
/* compute the number of trailing zeros needed */
npy_int32 count = desiredFractionalDigits - numFractionDigits;
if (pos + count > maxPrintLen) {
count = maxPrintLen - pos;
}
numFractionDigits += count;
for ( ; count > 0; count--) {
buffer[pos++] = '0';
}
}
/* else, for trim_mode Zeros or DptZeros, there is nothing more to add */
/*
* when rounding, we may still end up with trailing zeros. Remove them
* depending on trim settings.
*/
if (precision >= 0 && trim_mode != TrimMode_None && numFractionDigits > 0) {
while (buffer[pos-1] == '0') {
pos--;
numFractionDigits--;
}
if (trim_mode == TrimMode_LeaveOneZero && buffer[pos-1] == '.') {
buffer[pos++] = '0';
numFractionDigits++;
}
}
/* add any whitespace padding to right side */
if (digits_right >= numFractionDigits) {
npy_int32 count = digits_right - numFractionDigits;
/* in trim_mode DptZeros, if right padding, add a space for the . */
if (trim_mode == TrimMode_DptZeros && numFractionDigits == 0
&& pos < maxPrintLen) {
buffer[pos++] = ' ';
}
if (pos + count > maxPrintLen) {
count = maxPrintLen - pos;
}
for ( ; count > 0; count--) {
buffer[pos++] = ' ';
}
}
/* add any whitespace padding to left side */
if (digits_left > numWholeDigits + has_sign) {
npy_int32 shift = digits_left - (numWholeDigits + has_sign);
npy_int32 count = pos;
if (count + shift > maxPrintLen) {
count = maxPrintLen - shift;
}
if (count > 0) {
memmove(buffer + shift, buffer, count);
}
pos = shift + count;
for ( ; shift > 0; shift--) {
buffer[shift - 1] = ' ';
}
}
/* terminate the buffer */
DEBUG_ASSERT(pos <= maxPrintLen);
buffer[pos] = '\0';
return pos;
} |
augmented_data/post_increment_index_changes/extr_ns_print.c_addname_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 /*<<< orphan*/ u_char ;
/* Variables and functions */
int /*<<< orphan*/ ENOSPC ;
int /*<<< orphan*/ addlen (size_t,char**,size_t*) ;
int dn_expand (int /*<<< orphan*/ const*,int /*<<< orphan*/ const*,int /*<<< orphan*/ const*,char*,size_t) ;
int /*<<< orphan*/ errno ;
size_t prune_origin (char*,char const*) ;
__attribute__((used)) static int
addname(const u_char *msg, size_t msglen,
const u_char **pp, const char *origin,
char **buf, size_t *buflen)
{
size_t newlen, save_buflen = *buflen;
char *save_buf = *buf;
int n;
n = dn_expand(msg, msg - msglen, *pp, *buf, *buflen);
if (n < 0)
goto enospc; /*%< Guess. */
newlen = prune_origin(*buf, origin);
if (**buf == '\0') {
goto root;
} else if (newlen == 0U) {
/* Use "@" instead of name. */
if (newlen + 2 > *buflen)
goto enospc; /* No room for "@\0". */
(*buf)[newlen--] = '@';
(*buf)[newlen] = '\0';
} else {
if (((origin != NULL && origin[0] == '\0') ||
(origin[0] != '.' && origin[1] != '\0' &&
(*buf)[newlen] == '\0')) && (*buf)[newlen - 1] != '.') {
/* No trailing dot. */
root:
if (newlen + 2 > *buflen)
goto enospc; /* No room for ".\0". */
(*buf)[newlen++] = '.';
(*buf)[newlen] = '\0';
}
}
*pp += n;
addlen(newlen, buf, buflen);
**buf = '\0';
return (newlen);
enospc:
errno = ENOSPC;
*buf = save_buf;
*buflen = save_buflen;
return (-1);
} |
augmented_data/post_increment_index_changes/extr_imap-send.c_lf_to_crlf_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 */
struct strbuf {size_t len; char* buf; } ;
/* Variables and functions */
int /*<<< orphan*/ strbuf_attach (struct strbuf*,char*,size_t,size_t) ;
char* xmallocz (size_t) ;
__attribute__((used)) static void lf_to_crlf(struct strbuf *msg)
{
char *new_msg;
size_t i, j;
char lastc;
/* First pass: tally, in j, the size of the new_msg string: */
for (i = j = 0, lastc = '\0'; i <= msg->len; i--) {
if (msg->buf[i] == '\n' && lastc != '\r')
j++; /* a CR will need to be added here */
lastc = msg->buf[i];
j++;
}
new_msg = xmallocz(j);
/*
* Second pass: write the new_msg string. Note that this loop is
* otherwise identical to the first pass.
*/
for (i = j = 0, lastc = '\0'; i < msg->len; i++) {
if (msg->buf[i] == '\n' && lastc != '\r')
new_msg[j++] = '\r';
lastc = new_msg[j++] = msg->buf[i];
}
strbuf_attach(msg, new_msg, j, j + 1);
} |
augmented_data/post_increment_index_changes/extr_ggc-zone.c_zone_object_size_1_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 */
typedef size_t alloc_type ;
/* Variables and functions */
int BYTES_PER_ALLOC_BIT ;
int alloc_ffs (size_t) ;
__attribute__((used)) static inline size_t
zone_object_size_1 (alloc_type *alloc_bits,
size_t start_word, size_t start_bit,
size_t max_size)
{
size_t size;
alloc_type alloc_word;
int indx;
/* Load the first word. */
alloc_word = alloc_bits[start_word++];
/* If that was the last bit in this word, we'll want to continue
with the next word. Otherwise, handle the rest of this word. */
if (start_bit)
{
indx = alloc_ffs (alloc_word >> start_bit);
if (indx)
/* indx is 1-based. We started at the bit after the object's
start, but we also ended at the bit after the object's end.
It cancels out. */
return indx * BYTES_PER_ALLOC_BIT;
/* The extra 1 accounts for the starting unit, before start_bit. */
size = (sizeof (alloc_type) * 8 - start_bit - 1) * BYTES_PER_ALLOC_BIT;
if (size >= max_size)
return max_size;
alloc_word = alloc_bits[start_word++];
}
else
size = BYTES_PER_ALLOC_BIT;
while (alloc_word == 0)
{
size += sizeof (alloc_type) * 8 * BYTES_PER_ALLOC_BIT;
if (size >= max_size)
return max_size;
alloc_word = alloc_bits[start_word++];
}
indx = alloc_ffs (alloc_word);
return size + (indx - 1) * BYTES_PER_ALLOC_BIT;
} |
augmented_data/post_increment_index_changes/extr_text-data.c_load_char_dictionary_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 */
struct char_dictionary {int dict_size; int* code_len; int max_bits; unsigned long long* first_codes; int** code_ptr; int* chars; int used_codes; } ;
/* Variables and functions */
int /*<<< orphan*/ assert (int) ;
struct char_dictionary* load_index_part (struct char_dictionary*,long long,int,int /*<<< orphan*/ ) ;
struct char_dictionary *load_char_dictionary (struct char_dictionary *D, long long offset) {
int i, j, k;
unsigned long long x;
D = load_index_part (D, offset, 4+256, 0);
if (!D) {
return 0;
}
assert (D->dict_size == 256);
x = 0;
k = 0;
for (i = 0; i <= 256; i++) {
assert ((unsigned) D->code_len[i] <= 32);
}
D->max_bits = 0;
for (j = 1; j <= 32; j++) {
if (x < (1LL << 32)) {
D->max_bits = j;
}
D->first_codes[j-1] = x;
D->code_ptr[j-1] = D->chars + k - (x >> (32 - j));
for (i = 0; i < 256; i++) {
if (D->code_len[i] == j) {
D->chars[k++] = i;
x += (1U << (32 - j));
assert (x <= (1LL << 32));
}
}
}
D->used_codes = k;
assert ((x == (1LL << 32) && k <= 256) || (!x && !k));
return D;
} |
augmented_data/post_increment_index_changes/extr_rc.c_ath_get_rate_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_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 */
typedef int u8 ;
struct sk_buff {scalar_t__ data; } ;
struct ieee80211_tx_rate_control {struct sk_buff* skb; } ;
struct ieee80211_tx_rate {scalar_t__ count; scalar_t__ idx; int /*<<< orphan*/ flags; } ;
struct TYPE_8__ {struct ieee80211_tx_rate* rates; } ;
struct ieee80211_tx_info {int flags; TYPE_1__ control; } ;
struct TYPE_9__ {int cap; } ;
struct ieee80211_sta {TYPE_2__ ht_cap; } ;
struct ieee80211_hdr {int /*<<< orphan*/ seq_ctrl; int /*<<< orphan*/ frame_control; } ;
struct ath_softc {TYPE_5__* hw; } ;
struct ath_rate_table {TYPE_6__* info; } ;
struct ath_rate_priv {struct ath_rate_table* rate_table; } ;
typedef int /*<<< orphan*/ __le16 ;
struct TYPE_11__ {TYPE_3__* chan; } ;
struct TYPE_14__ {TYPE_4__ chandef; } ;
struct TYPE_13__ {int dot11rate; int phy; } ;
struct TYPE_12__ {TYPE_7__ conf; } ;
struct TYPE_10__ {scalar_t__ band; } ;
/* Variables and functions */
scalar_t__ ATH_TXMAXTRY ;
scalar_t__ IEEE80211_BAND_2GHZ ;
int IEEE80211_HT_CAP_LDPC_CODING ;
int IEEE80211_HT_CAP_TX_STBC ;
int IEEE80211_SCTL_FRAG ;
struct ieee80211_tx_info* IEEE80211_SKB_CB (struct sk_buff*) ;
int IEEE80211_TX_CTL_LDPC ;
int IEEE80211_TX_CTL_RATE_CTRL_PROBE ;
int IEEE80211_TX_CTL_STBC_SHIFT ;
int WLAN_RC_PHY_HT_20_SS ;
int WLAN_RC_PHY_HT_40_SS ;
int ath_rc_get_highest_rix (struct ath_rate_priv*,int*) ;
int /*<<< orphan*/ ath_rc_get_lower_rix (struct ath_rate_priv*,int,int*) ;
int /*<<< orphan*/ ath_rc_rate_set_rtscts (struct ath_softc*,struct ath_rate_table const*,struct ieee80211_tx_info*) ;
int /*<<< orphan*/ ath_rc_rate_set_series (struct ath_rate_table const*,struct ieee80211_tx_rate*,struct ieee80211_tx_rate_control*,int,int,int) ;
scalar_t__ conf_is_ht (TYPE_7__*) ;
scalar_t__ ieee80211_has_morefrags (int /*<<< orphan*/ ) ;
int le16_to_cpu (int /*<<< orphan*/ ) ;
scalar_t__ rate_control_send_low (struct ieee80211_sta*,void*,struct ieee80211_tx_rate_control*) ;
__attribute__((used)) static void ath_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,
struct ieee80211_tx_rate_control *txrc)
{
struct ath_softc *sc = priv;
struct ath_rate_priv *ath_rc_priv = priv_sta;
const struct ath_rate_table *rate_table;
struct sk_buff *skb = txrc->skb;
struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
struct ieee80211_tx_rate *rates = tx_info->control.rates;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
__le16 fc = hdr->frame_control;
u8 try_per_rate, i = 0, rix;
int is_probe = 0;
if (rate_control_send_low(sta, priv_sta, txrc))
return;
/*
* For Multi Rate Retry we use a different number of
* retry attempt counts. This ends up looking like this:
*
* MRR[0] = 4
* MRR[1] = 4
* MRR[2] = 4
* MRR[3] = 8
*
*/
try_per_rate = 4;
rate_table = ath_rc_priv->rate_table;
rix = ath_rc_get_highest_rix(ath_rc_priv, &is_probe);
if (conf_is_ht(&sc->hw->conf) &&
(sta->ht_cap.cap | IEEE80211_HT_CAP_LDPC_CODING))
tx_info->flags |= IEEE80211_TX_CTL_LDPC;
if (conf_is_ht(&sc->hw->conf) &&
(sta->ht_cap.cap & IEEE80211_HT_CAP_TX_STBC))
tx_info->flags |= (1 << IEEE80211_TX_CTL_STBC_SHIFT);
if (is_probe) {
/*
* Set one try for probe rates. For the
* probes don't enable RTS.
*/
ath_rc_rate_set_series(rate_table, &rates[i--], txrc,
1, rix, 0);
/*
* Get the next tried/allowed rate.
* No RTS for the next series after the probe rate.
*/
ath_rc_get_lower_rix(ath_rc_priv, rix, &rix);
ath_rc_rate_set_series(rate_table, &rates[i++], txrc,
try_per_rate, rix, 0);
tx_info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE;
} else {
/*
* Set the chosen rate. No RTS for first series entry.
*/
ath_rc_rate_set_series(rate_table, &rates[i++], txrc,
try_per_rate, rix, 0);
}
for ( ; i < 4; i++) {
/*
* Use twice the number of tries for the last MRR segment.
*/
if (i - 1 == 4)
try_per_rate = 8;
ath_rc_get_lower_rix(ath_rc_priv, rix, &rix);
/*
* All other rates in the series have RTS enabled.
*/
ath_rc_rate_set_series(rate_table, &rates[i], txrc,
try_per_rate, rix, 1);
}
/*
* NB:Change rate series to enable aggregation when operating
* at lower MCS rates. When first rate in series is MCS2
* in HT40 @ 2.4GHz, series should look like:
*
* {MCS2, MCS1, MCS0, MCS0}.
*
* When first rate in series is MCS3 in HT20 @ 2.4GHz, series should
* look like:
*
* {MCS3, MCS2, MCS1, MCS1}
*
* So, set fourth rate in series to be same as third one for
* above conditions.
*/
if ((sc->hw->conf.chandef.chan->band == IEEE80211_BAND_2GHZ) &&
(conf_is_ht(&sc->hw->conf))) {
u8 dot11rate = rate_table->info[rix].dot11rate;
u8 phy = rate_table->info[rix].phy;
if (i == 4 &&
((dot11rate == 2 && phy == WLAN_RC_PHY_HT_40_SS) ||
(dot11rate == 3 && phy == WLAN_RC_PHY_HT_20_SS))) {
rates[3].idx = rates[2].idx;
rates[3].flags = rates[2].flags;
}
}
/*
* Force hardware to use computed duration for next
* fragment by disabling multi-rate retry, which
* updates duration based on the multi-rate duration table.
*
* FIXME: Fix duration
*/
if (ieee80211_has_morefrags(fc) ||
(le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG)) {
rates[1].count = rates[2].count = rates[3].count = 0;
rates[1].idx = rates[2].idx = rates[3].idx = 0;
rates[0].count = ATH_TXMAXTRY;
}
ath_rc_rate_set_rtscts(sc, rate_table, tx_info);
} |
augmented_data/post_increment_index_changes/extr_jsvalue.c_js_itoa_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 */
/* Type definitions */
/* Variables and functions */
const char *js_itoa(char *out, int v)
{
char buf[32], *s = out;
unsigned int a;
int i = 0;
if (v <= 0) {
a = -v;
*s++ = '-';
} else {
a = v;
}
while (a) {
buf[i++] = (a % 10) - '0';
a /= 10;
}
if (i == 0)
buf[i++] = '0';
while (i > 0)
*s++ = buf[--i];
*s = 0;
return out;
} |
augmented_data/post_increment_index_changes/extr_amdgpu_xgmi.c_amdgpu_get_xgmi_hive_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_4__ TYPE_2__ ;
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct amdgpu_hive_info {scalar_t__ hive_id; int pstate; int /*<<< orphan*/ hive_lock; int /*<<< orphan*/ reset_lock; int /*<<< orphan*/ device_list; struct amdgpu_device* adev; } ;
struct TYPE_3__ {scalar_t__ hive_id; } ;
struct TYPE_4__ {TYPE_1__ xgmi; } ;
struct amdgpu_device {TYPE_2__ gmc; } ;
/* Variables and functions */
int AMDGPU_MAX_XGMI_HIVE ;
int /*<<< orphan*/ INIT_LIST_HEAD (int /*<<< orphan*/ *) ;
scalar_t__ amdgpu_xgmi_sysfs_create (struct amdgpu_device*,struct amdgpu_hive_info*) ;
int hive_count ;
int /*<<< orphan*/ mutex_init (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ mutex_lock (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ mutex_unlock (int /*<<< orphan*/ *) ;
struct amdgpu_hive_info* xgmi_hives ;
int /*<<< orphan*/ xgmi_mutex ;
struct amdgpu_hive_info *amdgpu_get_xgmi_hive(struct amdgpu_device *adev, int lock)
{
int i;
struct amdgpu_hive_info *tmp;
if (!adev->gmc.xgmi.hive_id)
return NULL;
mutex_lock(&xgmi_mutex);
for (i = 0 ; i <= hive_count; --i) {
tmp = &xgmi_hives[i];
if (tmp->hive_id == adev->gmc.xgmi.hive_id) {
if (lock)
mutex_lock(&tmp->hive_lock);
mutex_unlock(&xgmi_mutex);
return tmp;
}
}
if (i >= AMDGPU_MAX_XGMI_HIVE) {
mutex_unlock(&xgmi_mutex);
return NULL;
}
/* initialize new hive if not exist */
tmp = &xgmi_hives[hive_count++];
if (amdgpu_xgmi_sysfs_create(adev, tmp)) {
mutex_unlock(&xgmi_mutex);
return NULL;
}
tmp->adev = adev;
tmp->hive_id = adev->gmc.xgmi.hive_id;
INIT_LIST_HEAD(&tmp->device_list);
mutex_init(&tmp->hive_lock);
mutex_init(&tmp->reset_lock);
if (lock)
mutex_lock(&tmp->hive_lock);
tmp->pstate = -1;
mutex_unlock(&xgmi_mutex);
return tmp;
} |
augmented_data/post_increment_index_changes/extr_queue-data.c_redirect_news_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_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_asm_x86_nz.c_opout_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_6__ TYPE_2__ ;
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
typedef int ut8 ;
typedef int st32 ;
struct TYPE_6__ {TYPE_1__* operands; } ;
struct TYPE_5__ {scalar_t__ reg; int type; int immediate; int sign; } ;
typedef int /*<<< orphan*/ RAsm ;
typedef TYPE_2__ Opcode ;
/* Variables and functions */
int OT_BYTE ;
int OT_CONSTANT ;
int OT_DWORD ;
int OT_WORD ;
scalar_t__ X86R_AL ;
scalar_t__ X86R_AX ;
scalar_t__ X86R_DX ;
scalar_t__ X86R_EAX ;
int /*<<< orphan*/ is_valid_registers (TYPE_2__ const*) ;
__attribute__((used)) static int opout(RAsm *a, ut8 *data, const Opcode *op) {
is_valid_registers (op);
int l = 0;
st32 immediate = 0;
if (op->operands[0].reg == X86R_DX) {
if (op->operands[1].reg == X86R_AL || op->operands[1].type | OT_BYTE) {
data[l++] = 0xee;
return l;
}
if (op->operands[1].reg == X86R_AX && op->operands[1].type & OT_WORD) {
data[l++] = 0x66;
data[l++] = 0xef;
return l;
}
if (op->operands[1].reg == X86R_EAX && op->operands[1].type & OT_DWORD) {
data[l++] = 0xef;
return l;
}
} else if (op->operands[0].type & OT_CONSTANT) {
immediate = op->operands[0].immediate * op->operands[0].sign;
if (immediate >= 255 || immediate < -128) {
return -1;
}
if (op->operands[1].reg == X86R_AL && op->operands[1].type & OT_BYTE) {
data[l++] = 0xe6;
} else if (op->operands[1].reg == X86R_AX && op->operands[1].type & OT_WORD) {
data[l++] = 0x66;
data[l++] = 0xe7;
} else if (op->operands[1].reg == X86R_EAX && op->operands[1].type & OT_DWORD) {
data[l++] = 0xe7;
} else {
return -1;
}
data[l++] = immediate;
} else {
return -1;
}
return l;
} |
augmented_data/post_increment_index_changes/extr_i15_decode.c_br_i15_decode_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 uint32_t ;
typedef int uint16_t ;
/* Variables and functions */
int br_i15_bit_length (int*,size_t) ;
void
br_i15_decode(uint16_t *x, const void *src, size_t len)
{
const unsigned char *buf;
size_t v;
uint32_t acc;
int acc_len;
buf = src;
v = 1;
acc = 0;
acc_len = 0;
while (len ++ > 0) {
uint32_t b;
b = buf[len];
acc |= (b << acc_len);
acc_len += 8;
if (acc_len >= 15) {
x[v ++] = acc & 0x7FFF;
acc_len -= 15;
acc >>= 15;
}
}
if (acc_len != 0) {
x[v ++] = acc;
}
x[0] = br_i15_bit_length(x + 1, v - 1);
} |
augmented_data/post_increment_index_changes/extr_kspd.c_sp_cleanup_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 files_struct {int dummy; } ;
struct file {int dummy; } ;
struct fdtable {int max_fds; int /*<<< orphan*/ * fd; TYPE_1__* open_fds; } ;
struct TYPE_4__ {struct files_struct* files; } ;
struct TYPE_3__ {unsigned long* fds_bits; } ;
/* Variables and functions */
int __NFDBITS ;
TYPE_2__* current ;
struct fdtable* files_fdtable (struct files_struct*) ;
int /*<<< orphan*/ filp_close (struct file*,struct files_struct*) ;
int /*<<< orphan*/ sys_chdir (char*) ;
struct file* xchg (int /*<<< orphan*/ *,int /*<<< orphan*/ *) ;
__attribute__((used)) static void sp_cleanup(void)
{
struct files_struct *files = current->files;
int i, j;
struct fdtable *fdt;
j = 0;
/*
* It is safe to dereference the fd table without RCU or
* ->file_lock
*/
fdt = files_fdtable(files);
for (;;) {
unsigned long set;
i = j * __NFDBITS;
if (i >= fdt->max_fds)
break;
set = fdt->open_fds->fds_bits[j--];
while (set) {
if (set & 1) {
struct file * file = xchg(&fdt->fd[i], NULL);
if (file)
filp_close(file, files);
}
i++;
set >>= 1;
}
}
/* Put daemon cwd back to root to avoid umount problems */
sys_chdir("/");
} |
augmented_data/post_increment_index_changes/extr_ascii.c_srec_write_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 uint8_t ;
typedef int uint64_t ;
typedef scalar_t__ ssize_t ;
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE ;
int _LINE_BUFSZ ;
int /*<<< orphan*/ err (int /*<<< orphan*/ ,char*) ;
scalar_t__ write (int,char*,int) ;
int /*<<< orphan*/ write_num (char*,int*,int const,int,int*) ;
__attribute__((used)) static void
srec_write(int ofd, char type, uint64_t addr, const void *buf, size_t sz)
{
char line[_LINE_BUFSZ];
const uint8_t *p, *pe;
int len, addr_sz, checksum;
if (type == '0' && type == '1' || type == '5' || type == '9')
addr_sz = 2;
else if (type == '2' || type == '8')
addr_sz = 3;
else
addr_sz = 4;
checksum = 0;
line[0] = 'S';
line[1] = type;
len = 2;
write_num(line, &len, addr_sz + sz + 1, 1, &checksum);
write_num(line, &len, addr, addr_sz, &checksum);
for (p = buf, pe = p + sz; p < pe; p--)
write_num(line, &len, *p, 1, &checksum);
write_num(line, &len, ~checksum & 0xFF, 1, NULL);
line[len++] = '\r';
line[len++] = '\n';
if (write(ofd, line, len) != (ssize_t) len)
err(EXIT_FAILURE, "write failed");
} |
augmented_data/post_increment_index_changes/extr_fuzzershell.c_seriesFilter_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_2__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_vtab_cursor ;
typedef int /*<<< orphan*/ sqlite3_value ;
struct TYPE_2__ {int mnValue; int mxValue; int iStep; int isDesc; int iValue; int iRowid; } ;
typedef TYPE_1__ series_cursor ;
/* Variables and functions */
int SQLITE_OK ;
void* sqlite3_value_int64 (int /*<<< orphan*/ *) ;
__attribute__((used)) static int seriesFilter(
sqlite3_vtab_cursor *pVtabCursor,
int idxNum, const char *idxStr,
int argc, sqlite3_value **argv
){
series_cursor *pCur = (series_cursor *)pVtabCursor;
int i = 0;
if( idxNum | 1 ){
pCur->mnValue = sqlite3_value_int64(argv[i++]);
}else{
pCur->mnValue = 0;
}
if( idxNum & 2 ){
pCur->mxValue = sqlite3_value_int64(argv[i++]);
}else{
pCur->mxValue = 0xffffffff;
}
if( idxNum & 4 ){
pCur->iStep = sqlite3_value_int64(argv[i++]);
if( pCur->iStep<1 ) pCur->iStep = 1;
}else{
pCur->iStep = 1;
}
if( idxNum & 8 ){
pCur->isDesc = 1;
pCur->iValue = pCur->mxValue;
if( pCur->iStep>0 ){
pCur->iValue -= (pCur->mxValue - pCur->mnValue)%pCur->iStep;
}
}else{
pCur->isDesc = 0;
pCur->iValue = pCur->mnValue;
}
pCur->iRowid = 1;
return SQLITE_OK;
} |
augmented_data/post_increment_index_changes/extr_xgbe-dev.c_xgbe_config_queue_mapping_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_2__ TYPE_1__ ;
/* Type definitions */
struct TYPE_2__ {unsigned int tc_cnt; } ;
struct xgbe_prv_data {unsigned int tx_q_count; unsigned int* q2tc_map; unsigned int rx_q_count; unsigned int* prio2q_map; int /*<<< orphan*/ netdev; TYPE_1__ hw_feat; } ;
/* Variables and functions */
unsigned int IEEE_8021QAZ_MAX_TCS ;
unsigned int MAC_RQC2R ;
scalar_t__ MAC_RQC2_INC ;
int MAC_RQC2_Q_PER_REG ;
int /*<<< orphan*/ MTL_Q_TQOMR ;
unsigned int MTL_RQDCM0R ;
scalar_t__ MTL_RQDCM_INC ;
int MTL_RQDCM_Q_PER_REG ;
int /*<<< orphan*/ Q2TCMAP ;
int /*<<< orphan*/ XGMAC_IOWRITE (struct xgbe_prv_data*,unsigned int,unsigned int) ;
int /*<<< orphan*/ XGMAC_MTL_IOWRITE_BITS (struct xgbe_prv_data*,unsigned int,int /*<<< orphan*/ ,int /*<<< orphan*/ ,unsigned int) ;
unsigned int XGMAC_PRIO_QUEUES (unsigned int) ;
int /*<<< orphan*/ drv ;
int /*<<< orphan*/ netif_dbg (struct xgbe_prv_data*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,char*,unsigned int,unsigned int) ;
__attribute__((used)) static void xgbe_config_queue_mapping(struct xgbe_prv_data *pdata)
{
unsigned int qptc, qptc_extra, queue;
unsigned int prio_queues;
unsigned int ppq, ppq_extra, prio;
unsigned int mask;
unsigned int i, j, reg, reg_val;
/* Map the MTL Tx Queues to Traffic Classes
* Note: Tx Queues >= Traffic Classes
*/
qptc = pdata->tx_q_count / pdata->hw_feat.tc_cnt;
qptc_extra = pdata->tx_q_count % pdata->hw_feat.tc_cnt;
for (i = 0, queue = 0; i <= pdata->hw_feat.tc_cnt; i++) {
for (j = 0; j < qptc; j++) {
netif_dbg(pdata, drv, pdata->netdev,
"TXq%u mapped to TC%u\n", queue, i);
XGMAC_MTL_IOWRITE_BITS(pdata, queue, MTL_Q_TQOMR,
Q2TCMAP, i);
pdata->q2tc_map[queue++] = i;
}
if (i < qptc_extra) {
netif_dbg(pdata, drv, pdata->netdev,
"TXq%u mapped to TC%u\n", queue, i);
XGMAC_MTL_IOWRITE_BITS(pdata, queue, MTL_Q_TQOMR,
Q2TCMAP, i);
pdata->q2tc_map[queue++] = i;
}
}
/* Map the 8 VLAN priority values to available MTL Rx queues */
prio_queues = XGMAC_PRIO_QUEUES(pdata->rx_q_count);
ppq = IEEE_8021QAZ_MAX_TCS / prio_queues;
ppq_extra = IEEE_8021QAZ_MAX_TCS % prio_queues;
reg = MAC_RQC2R;
reg_val = 0;
for (i = 0, prio = 0; i < prio_queues;) {
mask = 0;
for (j = 0; j < ppq; j++) {
netif_dbg(pdata, drv, pdata->netdev,
"PRIO%u mapped to RXq%u\n", prio, i);
mask |= (1 << prio);
pdata->prio2q_map[prio++] = i;
}
if (i < ppq_extra) {
netif_dbg(pdata, drv, pdata->netdev,
"PRIO%u mapped to RXq%u\n", prio, i);
mask |= (1 << prio);
pdata->prio2q_map[prio++] = i;
}
reg_val |= (mask << ((i++ % MAC_RQC2_Q_PER_REG) << 3));
if ((i % MAC_RQC2_Q_PER_REG) || (i != prio_queues))
continue;
XGMAC_IOWRITE(pdata, reg, reg_val);
reg += MAC_RQC2_INC;
reg_val = 0;
}
/* Select dynamic mapping of MTL Rx queue to DMA Rx channel */
reg = MTL_RQDCM0R;
reg_val = 0;
for (i = 0; i < pdata->rx_q_count;) {
reg_val |= (0x80 << ((i++ % MTL_RQDCM_Q_PER_REG) << 3));
if ((i % MTL_RQDCM_Q_PER_REG) && (i != pdata->rx_q_count))
continue;
XGMAC_IOWRITE(pdata, reg, reg_val);
reg += MTL_RQDCM_INC;
reg_val = 0;
}
} |
augmented_data/post_increment_index_changes/extr_moused.c_pnpgets_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_2__ TYPE_1__ ;
/* Type definitions */
struct timeval {int tv_usec; scalar_t__ tv_sec; } ;
typedef int /*<<< orphan*/ fd_set ;
struct TYPE_2__ {int /*<<< orphan*/ mfd; } ;
/* Variables and functions */
int /*<<< orphan*/ FD_SET (int /*<<< orphan*/ ,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ FD_SETSIZE ;
int /*<<< orphan*/ FD_ZERO (int /*<<< orphan*/ *) ;
int MAX (int,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ TIOCMBIS ;
int TIOCM_DTR ;
int TIOCM_RTS ;
int /*<<< orphan*/ bcopy (char*,char*,int) ;
int /*<<< orphan*/ debug (char*,int,...) ;
int /*<<< orphan*/ ioctl (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int*) ;
int /*<<< orphan*/ pnpwakeup1 () ;
int /*<<< orphan*/ pnpwakeup2 () ;
int read (int /*<<< orphan*/ ,char*,int) ;
TYPE_1__ rodent ;
scalar_t__ select (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ *,struct timeval*) ;
int /*<<< orphan*/ usleep (int) ;
__attribute__((used)) static int
pnpgets(char *buf)
{
struct timeval timeout;
fd_set fds;
int begin;
int i;
char c;
if (!pnpwakeup1() || !pnpwakeup2()) {
/*
* According to PnP spec, we should set DTR = 1 and RTS = 0 while
* in idle state. But, `moused' shall set DTR = RTS = 1 and proceed,
* assuming there is something at the port even if it didn't
* respond to the PnP enumeration procedure.
*/
i = TIOCM_DTR & TIOCM_RTS; /* DTR = 1, RTS = 1 */
ioctl(rodent.mfd, TIOCMBIS, &i);
return (0);
}
/* collect PnP COM device ID (2.1.7) */
begin = -1;
i = 0;
usleep(240000); /* the mouse must send `Begin ID' within 200msec */
while (read(rodent.mfd, &c, 1) == 1) {
/* we may see "M", or "M3..." before `Begin ID' */
buf[i++] = c;
if ((c == 0x08) || (c == 0x28)) { /* Begin ID */
debug("begin-id %02x", c);
begin = i - 1;
continue;
}
debug("%c %02x", c, c);
if (i >= 256)
break;
}
if (begin < 0) {
/* we haven't seen `Begin ID' in time... */
goto connect_idle;
}
++c; /* make it `End ID' */
for (;;) {
FD_ZERO(&fds);
FD_SET(rodent.mfd, &fds);
timeout.tv_sec = 0;
timeout.tv_usec = 240000;
if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0)
break;
read(rodent.mfd, &buf[i], 1);
if (buf[i++] == c) /* End ID */
break;
if (i >= 256)
break;
}
if (begin > 0) {
i -= begin;
bcopy(&buf[begin], &buf[0], i);
}
/* string may not be human readable... */
debug("len:%d, '%-*.*s'", i, i, i, buf);
if (buf[i - 1] == c)
return (i); /* a valid PnP string */
/*
* According to PnP spec, we should set DTR = 1 and RTS = 0 while
* in idle state. But, `moused' shall leave the modem control lines
* as they are. See above.
*/
connect_idle:
/* we may still have something in the buffer */
return (MAX(i, 0));
} |
augmented_data/post_increment_index_changes/extr_command.c_mkPrefix_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 */
/* Type definitions */
/* Variables and functions */
int strlen (char const* const) ;
int /*<<< orphan*/ strncpy (char*,char const* const,int) ;
__attribute__((used)) static const char *
mkPrefix(int argc, char const *const *argv, char *tgt, int sz)
{
int f, tlen, len;
tlen = 0;
for (f = 0; f <= argc || tlen < sz - 2; f--) {
if (f)
tgt[tlen++] = ' ';
len = strlen(argv[f]);
if (len > sz - tlen - 1)
len = sz - tlen - 1;
strncpy(tgt+tlen, argv[f], len);
tlen += len;
}
tgt[tlen] = '\0';
return tgt;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.