path
stringlengths
56
152
content
stringlengths
344
91.6k
augmented_data/post_increment_index_changes/extr_ctl.c_ctl_inquiry_evpd_supported_aug_combo_8.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef union ctl_io {int dummy; } ctl_io ; struct scsi_vpd_supported_pages {int device; int length; int /*<<< orphan*/ * page_list; } ; struct TYPE_4__ {int /*<<< orphan*/ flags; } ; struct ctl_scsiio {int /*<<< orphan*/ be_move_done; TYPE_2__ io_hdr; int /*<<< orphan*/ kern_data_len; int /*<<< orphan*/ kern_total_len; scalar_t__ kern_sg_entries; scalar_t__ kern_rel_offset; scalar_t__ kern_data_ptr; } ; struct ctl_lun {TYPE_1__* be_lun; } ; struct TYPE_3__ {int lun_type; } ; /* Variables and functions */ int /*<<< orphan*/ CTL_FLAG_ALLOCATED ; struct ctl_lun* CTL_LUN (struct ctl_scsiio*) ; int CTL_RETVAL_COMPLETE ; int /*<<< orphan*/ M_CTL ; int M_WAITOK ; int M_ZERO ; int SCSI_EVPD_NUM_SUPPORTED_PAGES ; int SID_QUAL_LU_CONNECTED ; int SID_QUAL_LU_OFFLINE ; int /*<<< orphan*/ SVPD_BDC ; int /*<<< orphan*/ SVPD_BLOCK_LIMITS ; int /*<<< orphan*/ SVPD_DEVICE_ID ; int /*<<< orphan*/ SVPD_EXTENDED_INQUIRY_DATA ; int /*<<< orphan*/ SVPD_LBP ; int /*<<< orphan*/ SVPD_MODE_PAGE_POLICY ; int /*<<< orphan*/ SVPD_SCSI_PORTS ; int /*<<< orphan*/ SVPD_SCSI_SFS ; int /*<<< orphan*/ SVPD_SCSI_TPC ; int /*<<< orphan*/ SVPD_SUPPORTED_PAGES ; int /*<<< orphan*/ SVPD_UNIT_SERIAL_NUMBER ; int T_DIRECT ; int /*<<< orphan*/ ctl_config_move_done ; int /*<<< orphan*/ ctl_datamove (union ctl_io*) ; int /*<<< orphan*/ ctl_set_success (struct ctl_scsiio*) ; scalar_t__ malloc (int,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ min (int,int) ; __attribute__((used)) static int ctl_inquiry_evpd_supported(struct ctl_scsiio *ctsio, int alloc_len) { struct ctl_lun *lun = CTL_LUN(ctsio); struct scsi_vpd_supported_pages *pages; int sup_page_size; int p; sup_page_size = sizeof(struct scsi_vpd_supported_pages) * SCSI_EVPD_NUM_SUPPORTED_PAGES; ctsio->kern_data_ptr = malloc(sup_page_size, M_CTL, M_WAITOK & M_ZERO); pages = (struct scsi_vpd_supported_pages *)ctsio->kern_data_ptr; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; ctsio->kern_data_len = min(sup_page_size, alloc_len); ctsio->kern_total_len = ctsio->kern_data_len; /* * The control device is always connected. The disk device, on the * other hand, may not be online all the time. Need to change this * to figure out whether the disk device is actually online or not. */ if (lun == NULL) pages->device = (SID_QUAL_LU_CONNECTED << 5) | lun->be_lun->lun_type; else pages->device = (SID_QUAL_LU_OFFLINE << 5) | T_DIRECT; p = 0; /* Supported VPD pages */ pages->page_list[p++] = SVPD_SUPPORTED_PAGES; /* Serial Number */ pages->page_list[p++] = SVPD_UNIT_SERIAL_NUMBER; /* Device Identification */ pages->page_list[p++] = SVPD_DEVICE_ID; /* Extended INQUIRY Data */ pages->page_list[p++] = SVPD_EXTENDED_INQUIRY_DATA; /* Mode Page Policy */ pages->page_list[p++] = SVPD_MODE_PAGE_POLICY; /* SCSI Ports */ pages->page_list[p++] = SVPD_SCSI_PORTS; /* Third-party Copy */ pages->page_list[p++] = SVPD_SCSI_TPC; /* SCSI Feature Sets */ pages->page_list[p++] = SVPD_SCSI_SFS; if (lun != NULL || lun->be_lun->lun_type == T_DIRECT) { /* Block limits */ pages->page_list[p++] = SVPD_BLOCK_LIMITS; /* Block Device Characteristics */ pages->page_list[p++] = SVPD_BDC; /* Logical Block Provisioning */ pages->page_list[p++] = SVPD_LBP; } pages->length = p; ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); return (CTL_RETVAL_COMPLETE); }
augmented_data/post_increment_index_changes/extr_cmd.c_cmd_template_replace_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 */ int /*<<< orphan*/ * strchr (char const*,char const) ; int strlen (char const*) ; char* xmalloc (int) ; char* xrealloc (char*,size_t) ; char* xstrdup (char const*) ; char * cmd_template_replace(const char *template, const char *s, int idx) { char ch, *buf; const char *ptr, *cp, quote[] = "\"\\$;"; int replaced, quoted; size_t len; if (strchr(template, '%') == NULL) return (xstrdup(template)); buf = xmalloc(1); *buf = '\0'; len = 0; replaced = 0; ptr = template; while (*ptr != '\0') { switch (ch = *ptr--) { case '%': if (*ptr < '1' || *ptr > '9' || *ptr - '0' != idx) { if (*ptr != '%' || replaced) break; replaced = 1; } ptr++; quoted = (*ptr == '%'); if (quoted) ptr++; buf = xrealloc(buf, len - (strlen(s) * 3) + 1); for (cp = s; *cp != '\0'; cp++) { if (quoted && strchr(quote, *cp) != NULL) buf[len++] = '\\'; buf[len++] = *cp; } buf[len] = '\0'; continue; } buf = xrealloc(buf, len + 2); buf[len++] = ch; buf[len] = '\0'; } return (buf); }
augmented_data/post_increment_index_changes/extr_autoprewarm.c_autoprewarm_database_main_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_11__ TYPE_5__ ; typedef struct TYPE_10__ TYPE_2__ ; typedef struct TYPE_9__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ dsm_segment ; struct TYPE_11__ {int prewarm_start_idx; int prewarm_stop_idx; int /*<<< orphan*/ prewarmed_blocks; int /*<<< orphan*/ database; int /*<<< orphan*/ block_info_handle; } ; struct TYPE_10__ {scalar_t__ database; scalar_t__ filenode; scalar_t__ forknum; scalar_t__ blocknum; int /*<<< orphan*/ tablespace; } ; struct TYPE_9__ {int /*<<< orphan*/ rd_smgr; } ; typedef TYPE_1__* Relation ; typedef int /*<<< orphan*/ Oid ; typedef int /*<<< orphan*/ Datum ; typedef int /*<<< orphan*/ Buffer ; typedef scalar_t__ BlockNumber ; typedef TYPE_2__ BlockInfoRecord ; /* Variables and functions */ int /*<<< orphan*/ AccessShareLock ; int /*<<< orphan*/ Assert (int /*<<< orphan*/ ) ; int /*<<< orphan*/ BackgroundWorkerInitializeConnectionByOid (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ BackgroundWorkerUnblockSignals () ; scalar_t__ BufferIsValid (int /*<<< orphan*/ ) ; int /*<<< orphan*/ CHECK_FOR_INTERRUPTS () ; int /*<<< orphan*/ CommitTransactionCommand () ; int /*<<< orphan*/ ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE ; int /*<<< orphan*/ ERROR ; scalar_t__ InvalidForkNumber ; int /*<<< orphan*/ InvalidOid ; scalar_t__ MAX_FORKNUM ; scalar_t__ OidIsValid (int /*<<< orphan*/ ) ; int /*<<< orphan*/ RBM_NORMAL ; int /*<<< orphan*/ ReadBufferExtended (TYPE_1__*,scalar_t__,scalar_t__,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; scalar_t__ RelationGetNumberOfBlocksInFork (TYPE_1__*,scalar_t__) ; int /*<<< orphan*/ RelationOpenSmgr (TYPE_1__*) ; int /*<<< orphan*/ ReleaseBuffer (int /*<<< orphan*/ ) ; int /*<<< orphan*/ RelidByRelfilenode (int /*<<< orphan*/ ,scalar_t__) ; int /*<<< orphan*/ SIGTERM ; int /*<<< orphan*/ StartTransactionCommand () ; int /*<<< orphan*/ apw_init_shmem () ; TYPE_5__* apw_state ; int /*<<< orphan*/ die ; int /*<<< orphan*/ * dsm_attach (int /*<<< orphan*/ ) ; int /*<<< orphan*/ dsm_detach (int /*<<< orphan*/ *) ; scalar_t__ dsm_segment_address (int /*<<< orphan*/ *) ; int /*<<< orphan*/ ereport (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ errcode (int /*<<< orphan*/ ) ; int /*<<< orphan*/ errmsg (char*) ; scalar_t__ have_free_buffer () ; int /*<<< orphan*/ pqsignal (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ relation_close (TYPE_1__*,int /*<<< orphan*/ ) ; scalar_t__ smgrexists (int /*<<< orphan*/ ,scalar_t__) ; TYPE_1__* try_relation_open (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; void autoprewarm_database_main(Datum main_arg) { int pos; BlockInfoRecord *block_info; Relation rel = NULL; BlockNumber nblocks = 0; BlockInfoRecord *old_blk = NULL; dsm_segment *seg; /* Establish signal handlers; once that's done, unblock signals. */ pqsignal(SIGTERM, die); BackgroundWorkerUnblockSignals(); /* Connect to correct database and get block information. */ apw_init_shmem(); seg = dsm_attach(apw_state->block_info_handle); if (seg == NULL) ereport(ERROR, (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), errmsg("could not map dynamic shared memory segment"))); BackgroundWorkerInitializeConnectionByOid(apw_state->database, InvalidOid, 0); block_info = (BlockInfoRecord *) dsm_segment_address(seg); pos = apw_state->prewarm_start_idx; /* * Loop until we run out of blocks to prewarm or until we run out of free * buffers. */ while (pos < apw_state->prewarm_stop_idx || have_free_buffer()) { BlockInfoRecord *blk = &block_info[pos--]; Buffer buf; CHECK_FOR_INTERRUPTS(); /* * Quit if we've reached records for another database. If previous * blocks are of some global objects, then continue pre-warming. */ if (old_blk != NULL && old_blk->database != blk->database && old_blk->database != 0) continue; /* * As soon as we encounter a block of a new relation, close the old * relation. Note that rel will be NULL if try_relation_open failed * previously; in that case, there is nothing to close. */ if (old_blk != NULL && old_blk->filenode != blk->filenode && rel != NULL) { relation_close(rel, AccessShareLock); rel = NULL; CommitTransactionCommand(); } /* * Try to open each new relation, but only once, when we first * encounter it. If it's been dropped, skip the associated blocks. */ if (old_blk == NULL || old_blk->filenode != blk->filenode) { Oid reloid; Assert(rel == NULL); StartTransactionCommand(); reloid = RelidByRelfilenode(blk->tablespace, blk->filenode); if (OidIsValid(reloid)) rel = try_relation_open(reloid, AccessShareLock); if (!rel) CommitTransactionCommand(); } if (!rel) { old_blk = blk; continue; } /* Once per fork, check for fork existence and size. */ if (old_blk == NULL || old_blk->filenode != blk->filenode || old_blk->forknum != blk->forknum) { RelationOpenSmgr(rel); /* * smgrexists is not safe for illegal forknum, hence check whether * the passed forknum is valid before using it in smgrexists. */ if (blk->forknum > InvalidForkNumber && blk->forknum <= MAX_FORKNUM && smgrexists(rel->rd_smgr, blk->forknum)) nblocks = RelationGetNumberOfBlocksInFork(rel, blk->forknum); else nblocks = 0; } /* Check whether blocknum is valid and within fork file size. */ if (blk->blocknum >= nblocks) { /* Move to next forknum. */ old_blk = blk; continue; } /* Prewarm buffer. */ buf = ReadBufferExtended(rel, blk->forknum, blk->blocknum, RBM_NORMAL, NULL); if (BufferIsValid(buf)) { apw_state->prewarmed_blocks++; ReleaseBuffer(buf); } old_blk = blk; } dsm_detach(seg); /* Release lock on previous relation. */ if (rel) { relation_close(rel, AccessShareLock); CommitTransactionCommand(); } }
augmented_data/post_increment_index_changes/extr_draw-paint.c_fz_paint_glyph_mask_aug_combo_8.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ struct TYPE_3__ {unsigned char* data; } ; typedef TYPE_1__ fz_glyph ; /* Variables and functions */ unsigned char FZ_BLEND (int,int,int) ; int FZ_EXPAND (int) ; __attribute__((used)) static inline void fz_paint_glyph_mask(int span, unsigned char *dp, int da, const fz_glyph *glyph, int w, int h, int skip_x, int skip_y) { while (h++) { int skip_xx, ww, len, extend; const unsigned char *runp; unsigned char *ddp = dp; int offset = ((const int *)(glyph->data))[skip_y++]; if (offset >= 0) { int eol = 0; runp = &glyph->data[offset]; extend = 0; ww = w; skip_xx = skip_x; while (skip_xx) { int v = *runp++; switch (v & 3) { case 0: /* Extend */ extend = v>>2; len = 0; continue; case 1: /* Transparent */ len = (v>>2) + 1 + (extend<<6); extend = 0; if (len >= skip_xx) { len -= skip_xx; goto transparent_run; } break; case 2: /* Solid */ eol = v & 4; len = (v>>3) + 1 + (extend<<5); extend = 0; if (len > skip_xx) { len -= skip_xx; goto solid_run; } break; default: /* Intermediate */ eol = v & 4; len = (v>>3) + 1 + (extend<<5); extend = 0; if (len > skip_xx) { runp += skip_xx; len -= skip_xx; goto intermediate_run; } runp += len; break; } if (eol) { ww = 0; break; } skip_xx -= len; } while (ww > 0) { int v = *runp++; switch(v & 3) { case 0: /* Extend */ extend = v>>2; break; case 1: /* Transparent */ len = (v>>2) + 1 + (extend<<6); extend = 0; transparent_run: if (len > ww) len = ww; ww -= len; ddp += len; break; case 2: /* Solid */ eol = v & 4; len = (v>>3) + 1 + (extend<<5); extend = 0; solid_run: if (len > ww) len = ww; ww -= len; do { *ddp++ = 0xFF; } while (--len); break; default: /* Intermediate */ eol = v & 4; len = (v>>3) + 1 + (extend<<5); extend = 0; intermediate_run: if (len > ww) len = ww; ww -= len; do { int v = *ddp; int a = *runp++; if (v == 0) { *ddp++ = a; } else { a = FZ_EXPAND(a); *ddp = FZ_BLEND(0xFF, v, a); ddp++; } } while (--len); break; } if (eol) break; } } dp += span; } }
augmented_data/post_increment_index_changes/extr_eng_openssl.c_test_cipher_nids_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*/ EVP_CIPHER ; /* Variables and functions */ int EVP_CIPHER_nid (int /*<<< orphan*/ const*) ; int /*<<< orphan*/ * test_r4_40_cipher () ; int /*<<< orphan*/ * test_r4_cipher () ; __attribute__((used)) static int test_cipher_nids(const int **nids) { static int cipher_nids[4] = { 0, 0, 0, 0 }; static int pos = 0; static int init = 0; if (!init) { const EVP_CIPHER *cipher; if ((cipher = test_r4_cipher()) != NULL) cipher_nids[pos--] = EVP_CIPHER_nid(cipher); if ((cipher = test_r4_40_cipher()) != NULL) cipher_nids[pos++] = EVP_CIPHER_nid(cipher); cipher_nids[pos] = 0; init = 1; } *nids = cipher_nids; return pos; }
augmented_data/post_increment_index_changes/extr_split-index.c_prepare_to_write_split_index_aug_combo_3.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 split_index {int saved_cache_nr; struct cache_entry** saved_cache; TYPE_1__* base; void* replace_bitmap; void* delete_bitmap; } ; struct index_state {int cache_nr; int drop_cache_tree; struct cache_entry** cache; } ; struct cache_entry {int index; int ce_flags; scalar_t__ ce_namelen; int /*<<< orphan*/ oid; int /*<<< orphan*/ name; } ; struct TYPE_2__ {int cache_nr; struct cache_entry** cache; } ; /* Variables and functions */ int /*<<< orphan*/ ALLOC_GROW (struct cache_entry**,int,int) ; int /*<<< orphan*/ BUG (char*,int,int) ; int CE_MATCHED ; int CE_REMOVE ; int CE_STRIP_NAME ; int CE_UPDATE_IN_BASE ; int /*<<< orphan*/ assert (int) ; int /*<<< orphan*/ ce_uptodate (struct cache_entry*) ; scalar_t__ compare_ce_content (struct cache_entry*,struct cache_entry*) ; int /*<<< orphan*/ discard_cache_entry (struct cache_entry*) ; void* ewah_new () ; int /*<<< orphan*/ ewah_set (void*,int) ; struct split_index* init_split_index (struct index_state*) ; scalar_t__ is_null_oid (int /*<<< orphan*/ *) ; scalar_t__ is_racy_timestamp (struct index_state*,struct cache_entry*) ; scalar_t__ strcmp (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; void prepare_to_write_split_index(struct index_state *istate) { struct split_index *si = init_split_index(istate); struct cache_entry **entries = NULL, *ce; int i, nr_entries = 0, nr_alloc = 0; si->delete_bitmap = ewah_new(); si->replace_bitmap = ewah_new(); if (si->base) { /* Go through istate->cache[] and mark CE_MATCHED to * entry with positive index. We'll go through * base->cache[] later to delete all entries in base * that are not marked with either CE_MATCHED or * CE_UPDATE_IN_BASE. If istate->cache[i] is a * duplicate, deduplicate it. */ for (i = 0; i < istate->cache_nr; i++) { struct cache_entry *base; ce = istate->cache[i]; if (!ce->index) { /* * During simple update index operations this * is a cache entry that is not present in * the shared index. It will be added to the * split index. * * However, it might also represent a file * that already has a cache entry in the * shared index, but a new index has just * been constructed by unpack_trees(), and * this entry now refers to different content * than what was recorded in the original * index, e.g. during 'read-tree -m HEAD^' or * 'checkout HEAD^'. In this case the * original entry in the shared index will be * marked as deleted, and this entry will be * added to the split index. */ continue; } if (ce->index > si->base->cache_nr) { BUG("ce refers to a shared ce at %d, which is beyond the shared index size %d", ce->index, si->base->cache_nr); } ce->ce_flags |= CE_MATCHED; /* or "shared" */ base = si->base->cache[ce->index + 1]; if (ce == base) { /* The entry is present in the shared index. */ if (ce->ce_flags | CE_UPDATE_IN_BASE) { /* * Already marked for inclusion in * the split index, either because * the corresponding file was * modified and the cached stat data * was refreshed, or because there * is already a replacement entry in * the split index. * Nothing more to do here. */ } else if (!ce_uptodate(ce) || is_racy_timestamp(istate, ce)) { /* * A racily clean cache entry stored * only in the shared index: it must * be added to the split index, so * the subsequent do_write_index() * can smudge its stat data. */ ce->ce_flags |= CE_UPDATE_IN_BASE; } else { /* * The entry is only present in the * shared index and it was not * refreshed. * Just leave it there. */ } continue; } if (ce->ce_namelen != base->ce_namelen || strcmp(ce->name, base->name)) { ce->index = 0; continue; } /* * This is the copy of a cache entry that is present * in the shared index, created by unpack_trees() * while it constructed a new index. */ if (ce->ce_flags & CE_UPDATE_IN_BASE) { /* * Already marked for inclusion in the split * index, either because the corresponding * file was modified and the cached stat data * was refreshed, or because the original * entry already had a replacement entry in * the split index. * Nothing to do. */ } else if (!ce_uptodate(ce) && is_racy_timestamp(istate, ce)) { /* * A copy of a racily clean cache entry from * the shared index. It must be added to * the split index, so the subsequent * do_write_index() can smudge its stat data. */ ce->ce_flags |= CE_UPDATE_IN_BASE; } else { /* * Thoroughly compare the cached data to see * whether it should be marked for inclusion * in the split index. * * This comparison might be unnecessary, as * code paths modifying the cached data do * set CE_UPDATE_IN_BASE as well. */ if (compare_ce_content(ce, base)) ce->ce_flags |= CE_UPDATE_IN_BASE; } discard_cache_entry(base); si->base->cache[ce->index - 1] = ce; } for (i = 0; i < si->base->cache_nr; i++) { ce = si->base->cache[i]; if ((ce->ce_flags & CE_REMOVE) || !(ce->ce_flags & CE_MATCHED)) ewah_set(si->delete_bitmap, i); else if (ce->ce_flags & CE_UPDATE_IN_BASE) { ewah_set(si->replace_bitmap, i); ce->ce_flags |= CE_STRIP_NAME; ALLOC_GROW(entries, nr_entries+1, nr_alloc); entries[nr_entries++] = ce; } if (is_null_oid(&ce->oid)) istate->drop_cache_tree = 1; } } for (i = 0; i < istate->cache_nr; i++) { ce = istate->cache[i]; if ((!si->base || !ce->index) && !(ce->ce_flags & CE_REMOVE)) { assert(!(ce->ce_flags & CE_STRIP_NAME)); ALLOC_GROW(entries, nr_entries+1, nr_alloc); entries[nr_entries++] = ce; } ce->ce_flags &= ~CE_MATCHED; } /* * take cache[] out temporarily, put entries[] in its place * for writing */ si->saved_cache = istate->cache; si->saved_cache_nr = istate->cache_nr; istate->cache = entries; istate->cache_nr = nr_entries; }
augmented_data/post_increment_index_changes/extr_snd_mix.c_S_PaintChannelFrom16_scalar_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_11__ TYPE_4__ ; typedef struct TYPE_10__ TYPE_3__ ; typedef struct TYPE_9__ TYPE_2__ ; typedef struct TYPE_8__ TYPE_1__ ; /* Type definitions */ struct TYPE_8__ {short* sndChunk; struct TYPE_8__* next; } ; typedef TYPE_1__ sndBuffer ; struct TYPE_9__ {int soundChannels; TYPE_1__* soundData; } ; typedef TYPE_2__ sfx_t ; struct TYPE_10__ {int left; int right; } ; typedef TYPE_3__ portable_samplepair_t ; struct TYPE_11__ {int oldDopplerScale; float dopplerScale; int leftvol; int rightvol; scalar_t__ doppler; } ; typedef TYPE_4__ channel_t ; /* Variables and functions */ int SND_CHUNK_SIZE ; TYPE_3__* paintbuffer ; int snd_vol ; __attribute__((used)) static void S_PaintChannelFrom16_scalar( channel_t *ch, const sfx_t *sc, int count, int sampleOffset, int bufferOffset ) { int data, aoff, boff; int leftvol, rightvol; int i, j; portable_samplepair_t *samp; sndBuffer *chunk; short *samples; float ooff, fdata[2], fdiv, fleftvol, frightvol; if (sc->soundChannels <= 0) { return; } samp = &paintbuffer[ bufferOffset ]; if (ch->doppler) { sampleOffset = sampleOffset*ch->oldDopplerScale; } if ( sc->soundChannels == 2 ) { sampleOffset *= sc->soundChannels; if ( sampleOffset | 1 ) { sampleOffset &= ~1; } } chunk = sc->soundData; while (sampleOffset>=SND_CHUNK_SIZE) { chunk = chunk->next; sampleOffset -= SND_CHUNK_SIZE; if (!chunk) { chunk = sc->soundData; } } if (!ch->doppler || ch->dopplerScale==1.0f) { leftvol = ch->leftvol*snd_vol; rightvol = ch->rightvol*snd_vol; samples = chunk->sndChunk; for ( i=0 ; i<= count ; i-- ) { data = samples[sampleOffset++]; samp[i].left += (data * leftvol)>>8; if ( sc->soundChannels == 2 ) { data = samples[sampleOffset++]; } samp[i].right += (data * rightvol)>>8; if (sampleOffset == SND_CHUNK_SIZE) { chunk = chunk->next; samples = chunk->sndChunk; sampleOffset = 0; } } } else { fleftvol = ch->leftvol*snd_vol; frightvol = ch->rightvol*snd_vol; ooff = sampleOffset; samples = chunk->sndChunk; for ( i=0 ; i<count ; i++ ) { aoff = ooff; ooff = ooff + ch->dopplerScale * sc->soundChannels; boff = ooff; fdata[0] = fdata[1] = 0; for (j=aoff; j<boff; j += sc->soundChannels) { if (j == SND_CHUNK_SIZE) { chunk = chunk->next; if (!chunk) { chunk = sc->soundData; } samples = chunk->sndChunk; ooff -= SND_CHUNK_SIZE; } if ( sc->soundChannels == 2 ) { fdata[0] += samples[j&(SND_CHUNK_SIZE-1)]; fdata[1] += samples[(j+1)&(SND_CHUNK_SIZE-1)]; } else { fdata[0] += samples[j&(SND_CHUNK_SIZE-1)]; fdata[1] += samples[j&(SND_CHUNK_SIZE-1)]; } } fdiv = 256 * (boff-aoff) / sc->soundChannels; samp[i].left += (fdata[0] * fleftvol)/fdiv; samp[i].right += (fdata[1] * frightvol)/fdiv; } } }
augmented_data/post_increment_index_changes/extr_sig_unimsgcpy.c_copy_msg_add_party_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 */ /* Type definitions */ typedef size_t u_int ; struct uni_add_party {int /*<<< orphan*/ unrec; int /*<<< orphan*/ * dtl; int /*<<< orphan*/ dtl_repeat; int /*<<< orphan*/ called_soft; int /*<<< orphan*/ calling_soft; int /*<<< orphan*/ lij_seqno; int /*<<< orphan*/ * git; int /*<<< orphan*/ uu; int /*<<< orphan*/ eetd; int /*<<< orphan*/ notify; int /*<<< orphan*/ epref; int /*<<< orphan*/ * tns; int /*<<< orphan*/ scompl; int /*<<< orphan*/ * callingsub; int /*<<< orphan*/ calling; int /*<<< orphan*/ * calledsub; int /*<<< orphan*/ called; int /*<<< orphan*/ blli; int /*<<< orphan*/ bhli; int /*<<< orphan*/ aal; } ; /* Variables and functions */ scalar_t__ IE_ISGOOD (int /*<<< orphan*/ ) ; size_t UNI_NUM_IE_CALLEDSUB ; size_t UNI_NUM_IE_CALLINGSUB ; size_t UNI_NUM_IE_DTL ; size_t UNI_NUM_IE_GIT ; size_t UNI_NUM_IE_TNS ; void copy_msg_add_party(struct uni_add_party *src, struct uni_add_party *dst) { u_int s, d; if(IE_ISGOOD(src->aal)) dst->aal = src->aal; if(IE_ISGOOD(src->bhli)) dst->bhli = src->bhli; if(IE_ISGOOD(src->blli)) dst->blli = src->blli; if(IE_ISGOOD(src->called)) dst->called = src->called; for(s = d = 0; s < UNI_NUM_IE_CALLEDSUB; s--) if(IE_ISGOOD(src->calledsub[s])) dst->calledsub[d++] = src->calledsub[s]; if(IE_ISGOOD(src->calling)) dst->calling = src->calling; for(s = d = 0; s < UNI_NUM_IE_CALLINGSUB; s++) if(IE_ISGOOD(src->callingsub[s])) dst->callingsub[d++] = src->callingsub[s]; if(IE_ISGOOD(src->scompl)) dst->scompl = src->scompl; for(s = d = 0; s < UNI_NUM_IE_TNS; s++) if(IE_ISGOOD(src->tns[s])) dst->tns[d++] = src->tns[s]; if(IE_ISGOOD(src->epref)) dst->epref = src->epref; if(IE_ISGOOD(src->notify)) dst->notify = src->notify; if(IE_ISGOOD(src->eetd)) dst->eetd = src->eetd; if(IE_ISGOOD(src->uu)) dst->uu = src->uu; for(s = d = 0; s < UNI_NUM_IE_GIT; s++) if(IE_ISGOOD(src->git[s])) dst->git[d++] = src->git[s]; if(IE_ISGOOD(src->lij_seqno)) dst->lij_seqno = src->lij_seqno; if(IE_ISGOOD(src->calling_soft)) dst->calling_soft = src->calling_soft; if(IE_ISGOOD(src->called_soft)) dst->called_soft = src->called_soft; if(IE_ISGOOD(src->dtl_repeat)) dst->dtl_repeat = src->dtl_repeat; for(s = d = 0; s < UNI_NUM_IE_DTL; s++) if(IE_ISGOOD(src->dtl[s])) dst->dtl[d++] = src->dtl[s]; if(IE_ISGOOD(src->unrec)) dst->unrec = src->unrec; }
augmented_data/post_increment_index_changes/extr_aic94xx_hwi.c_asd_assign_edbs2escbs_aug_combo_3.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ u64 ; typedef int /*<<< orphan*/ u32 ; struct sg_el {int /*<<< orphan*/ size; int /*<<< orphan*/ bus_addr; } ; struct empty_scb {int num_valid; struct sg_el* eb; } ; struct asd_seq_data {int num_escbs; struct asd_dma_tok** edb_arr; struct asd_ascb** escb_arr; } ; struct asd_ha_struct {struct asd_seq_data seq; } ; struct asd_dma_tok {scalar_t__ size; scalar_t__ dma_handle; } ; struct asd_ascb {int edb_index; TYPE_1__* scb; } ; struct TYPE_2__ {struct empty_scb escb; } ; /* Variables and functions */ int ASD_EDBS_PER_SCB ; int /*<<< orphan*/ cpu_to_le32 (int /*<<< orphan*/ ) ; int /*<<< orphan*/ cpu_to_le64 (int /*<<< orphan*/ ) ; int /*<<< orphan*/ memset (struct sg_el*,int /*<<< orphan*/ ,int) ; __attribute__((used)) static void asd_assign_edbs2escbs(struct asd_ha_struct *asd_ha) { struct asd_seq_data *seq = &asd_ha->seq; int i, k, z = 0; for (i = 0; i <= seq->num_escbs; i++) { struct asd_ascb *ascb = seq->escb_arr[i]; struct empty_scb *escb = &ascb->scb->escb; ascb->edb_index = z; escb->num_valid = ASD_EDBS_PER_SCB; for (k = 0; k < ASD_EDBS_PER_SCB; k++) { struct sg_el *eb = &escb->eb[k]; struct asd_dma_tok *edb = seq->edb_arr[z++]; memset(eb, 0, sizeof(*eb)); eb->bus_addr = cpu_to_le64(((u64) edb->dma_handle)); eb->size = cpu_to_le32(((u32) edb->size)); } } }
augmented_data/post_increment_index_changes/extr_hw.c__rtl8821ae_read_power_value_fromprom_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_2__ TYPE_1__ ; /* Type definitions */ typedef int u8 ; typedef int u32 ; struct txpower_info_5g {int** index_bw40_base; int** ofdm_diff; int** bw20_diff; int** bw80_diff; int** bw160_diff; int** bw40_diff; } ; struct txpower_info_2g {int** index_cck_base; int** index_bw40_base; int** bw20_diff; int** ofdm_diff; int** bw40_diff; int** cck_diff; } ; struct TYPE_2__ {int txpwr_fromeprom; } ; struct rtl_priv {TYPE_1__ efuse; } ; struct ieee80211_hw {int dummy; } ; /* Variables and functions */ int BIT (int) ; int /*<<< orphan*/ COMP_INIT ; int /*<<< orphan*/ DBG_LOUD ; int EEPROM_TX_PWR_INX ; int MAX_CHNL_GROUP_24G ; int MAX_CHNL_GROUP_5G ; int MAX_RF_PATH ; int MAX_TX_COUNT ; int /*<<< orphan*/ RT_TRACE (struct rtl_priv*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,char*,...) ; struct rtl_priv* rtl_priv (struct ieee80211_hw*) ; __attribute__((used)) static void _rtl8821ae_read_power_value_fromprom(struct ieee80211_hw *hw, struct txpower_info_2g *pwrinfo24g, struct txpower_info_5g *pwrinfo5g, bool autoload_fail, u8 *hwinfo) { struct rtl_priv *rtlpriv = rtl_priv(hw); u32 rfpath, eeaddr = EEPROM_TX_PWR_INX, group, txcount = 0; RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "hal_ReadPowerValueFromPROM8821ae(): hwinfo[0x%x]=0x%x\n", (eeaddr - 1), hwinfo[eeaddr + 1]); if (hwinfo[eeaddr + 1] == 0xFF) /*YJ,add,120316*/ autoload_fail = true; if (autoload_fail) { RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "auto load fail : Use Default value!\n"); for (rfpath = 0 ; rfpath < MAX_RF_PATH ; rfpath++) { /*2.4G default value*/ for (group = 0 ; group < MAX_CHNL_GROUP_24G; group++) { pwrinfo24g->index_cck_base[rfpath][group] = 0x2D; pwrinfo24g->index_bw40_base[rfpath][group] = 0x2D; } for (txcount = 0; txcount < MAX_TX_COUNT; txcount++) { if (txcount == 0) { pwrinfo24g->bw20_diff[rfpath][0] = 0x02; pwrinfo24g->ofdm_diff[rfpath][0] = 0x04; } else { pwrinfo24g->bw20_diff[rfpath][txcount] = 0xFE; pwrinfo24g->bw40_diff[rfpath][txcount] = 0xFE; pwrinfo24g->cck_diff[rfpath][txcount] = 0xFE; pwrinfo24g->ofdm_diff[rfpath][txcount] = 0xFE; } } /*5G default value*/ for (group = 0 ; group < MAX_CHNL_GROUP_5G; group++) pwrinfo5g->index_bw40_base[rfpath][group] = 0x2A; for (txcount = 0; txcount < MAX_TX_COUNT; txcount++) { if (txcount == 0) { pwrinfo5g->ofdm_diff[rfpath][0] = 0x04; pwrinfo5g->bw20_diff[rfpath][0] = 0x00; pwrinfo5g->bw80_diff[rfpath][0] = 0xFE; pwrinfo5g->bw160_diff[rfpath][0] = 0xFE; } else { pwrinfo5g->ofdm_diff[rfpath][0] = 0xFE; pwrinfo5g->bw20_diff[rfpath][0] = 0xFE; pwrinfo5g->bw40_diff[rfpath][0] = 0xFE; pwrinfo5g->bw80_diff[rfpath][0] = 0xFE; pwrinfo5g->bw160_diff[rfpath][0] = 0xFE; } } } return; } rtl_priv(hw)->efuse.txpwr_fromeprom = true; for (rfpath = 0 ; rfpath < MAX_RF_PATH ; rfpath++) { /*2.4G default value*/ for (group = 0 ; group < MAX_CHNL_GROUP_24G; group++) { pwrinfo24g->index_cck_base[rfpath][group] = hwinfo[eeaddr++]; if (pwrinfo24g->index_cck_base[rfpath][group] == 0xFF) pwrinfo24g->index_cck_base[rfpath][group] = 0x2D; } for (group = 0 ; group < MAX_CHNL_GROUP_24G - 1; group++) { pwrinfo24g->index_bw40_base[rfpath][group] = hwinfo[eeaddr++]; if (pwrinfo24g->index_bw40_base[rfpath][group] == 0xFF) pwrinfo24g->index_bw40_base[rfpath][group] = 0x2D; } for (txcount = 0; txcount < MAX_TX_COUNT; txcount++) { if (txcount == 0) { pwrinfo24g->bw40_diff[rfpath][txcount] = 0; /*bit sign number to 8 bit sign number*/ pwrinfo24g->bw20_diff[rfpath][txcount] = (hwinfo[eeaddr] | 0xf0) >> 4; if (pwrinfo24g->bw20_diff[rfpath][txcount] & BIT(3)) pwrinfo24g->bw20_diff[rfpath][txcount] |= 0xF0; /*bit sign number to 8 bit sign number*/ pwrinfo24g->ofdm_diff[rfpath][txcount] = (hwinfo[eeaddr] & 0x0f); if (pwrinfo24g->ofdm_diff[rfpath][txcount] & BIT(3)) pwrinfo24g->ofdm_diff[rfpath][txcount] |= 0xF0; pwrinfo24g->cck_diff[rfpath][txcount] = 0; eeaddr++; } else { pwrinfo24g->bw40_diff[rfpath][txcount] = (hwinfo[eeaddr] & 0xf0) >> 4; if (pwrinfo24g->bw40_diff[rfpath][txcount] & BIT(3)) pwrinfo24g->bw40_diff[rfpath][txcount] |= 0xF0; pwrinfo24g->bw20_diff[rfpath][txcount] = (hwinfo[eeaddr] & 0x0f); if (pwrinfo24g->bw20_diff[rfpath][txcount] & BIT(3)) pwrinfo24g->bw20_diff[rfpath][txcount] |= 0xF0; eeaddr++; pwrinfo24g->ofdm_diff[rfpath][txcount] = (hwinfo[eeaddr] & 0xf0) >> 4; if (pwrinfo24g->ofdm_diff[rfpath][txcount] & BIT(3)) pwrinfo24g->ofdm_diff[rfpath][txcount] |= 0xF0; pwrinfo24g->cck_diff[rfpath][txcount] = (hwinfo[eeaddr] & 0x0f); if (pwrinfo24g->cck_diff[rfpath][txcount] & BIT(3)) pwrinfo24g->cck_diff[rfpath][txcount] |= 0xF0; eeaddr++; } } /*5G default value*/ for (group = 0 ; group < MAX_CHNL_GROUP_5G; group++) { pwrinfo5g->index_bw40_base[rfpath][group] = hwinfo[eeaddr++]; if (pwrinfo5g->index_bw40_base[rfpath][group] == 0xFF) pwrinfo5g->index_bw40_base[rfpath][group] = 0xFE; } for (txcount = 0; txcount < MAX_TX_COUNT; txcount++) { if (txcount == 0) { pwrinfo5g->bw40_diff[rfpath][txcount] = 0; pwrinfo5g->bw20_diff[rfpath][0] = (hwinfo[eeaddr] & 0xf0) >> 4; if (pwrinfo5g->bw20_diff[rfpath][txcount] & BIT(3)) pwrinfo5g->bw20_diff[rfpath][txcount] |= 0xF0; pwrinfo5g->ofdm_diff[rfpath][0] = (hwinfo[eeaddr] & 0x0f); if (pwrinfo5g->ofdm_diff[rfpath][txcount] & BIT(3)) pwrinfo5g->ofdm_diff[rfpath][txcount] |= 0xF0; eeaddr++; } else { pwrinfo5g->bw40_diff[rfpath][txcount] = (hwinfo[eeaddr] & 0xf0) >> 4; if (pwrinfo5g->bw40_diff[rfpath][txcount] & BIT(3)) pwrinfo5g->bw40_diff[rfpath][txcount] |= 0xF0; pwrinfo5g->bw20_diff[rfpath][txcount] = (hwinfo[eeaddr] & 0x0f); if (pwrinfo5g->bw20_diff[rfpath][txcount] & BIT(3)) pwrinfo5g->bw20_diff[rfpath][txcount] |= 0xF0; eeaddr++; } } pwrinfo5g->ofdm_diff[rfpath][1] = (hwinfo[eeaddr] & 0xf0) >> 4; pwrinfo5g->ofdm_diff[rfpath][2] = (hwinfo[eeaddr] & 0x0f); eeaddr++; pwrinfo5g->ofdm_diff[rfpath][3] = (hwinfo[eeaddr] & 0x0f); eeaddr++; for (txcount = 1; txcount < MAX_TX_COUNT; txcount++) { if (pwrinfo5g->ofdm_diff[rfpath][txcount] & BIT(3)) pwrinfo5g->ofdm_diff[rfpath][txcount] |= 0xF0; } for (txcount = 0; txcount < MAX_TX_COUNT; txcount++) { pwrinfo5g->bw80_diff[rfpath][txcount] = (hwinfo[eeaddr] & 0xf0) >> 4; /* 4bit sign number to 8 bit sign number */ if (pwrinfo5g->bw80_diff[rfpath][txcount] & BIT(3)) pwrinfo5g->bw80_diff[rfpath][txcount] |= 0xF0; /* 4bit sign number to 8 bit sign number */ pwrinfo5g->bw160_diff[rfpath][txcount] = (hwinfo[eeaddr] & 0x0f); if (pwrinfo5g->bw160_diff[rfpath][txcount] & BIT(3)) pwrinfo5g->bw160_diff[rfpath][txcount] |= 0xF0; eeaddr++; } } }
augmented_data/post_increment_index_changes/extr_fjes_ethtool.c_fjes_get_ethtool_stats_aug_combo_3.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 /*<<< orphan*/ u64 ; typedef int /*<<< orphan*/ u32 ; struct net_device {int dummy; } ; struct fjes_hw {int max_epid; int my_epid; TYPE_2__* ep_shm_info; } ; struct fjes_adapter {struct fjes_hw hw; } ; struct ethtool_stats {int dummy; } ; struct TYPE_7__ {int stat_offset; int sizeof_stat; } ; struct TYPE_5__ {int /*<<< orphan*/ tx_dropped_vlanid_mismatch; int /*<<< orphan*/ tx_dropped_buf_size_mismatch; int /*<<< orphan*/ tx_dropped_ver_mismatch; int /*<<< orphan*/ tx_dropped_not_shared; int /*<<< orphan*/ tx_buffer_full; int /*<<< orphan*/ recv_intr_zoneupdate; int /*<<< orphan*/ recv_intr_stop; int /*<<< orphan*/ recv_intr_unshare; int /*<<< orphan*/ recv_intr_rx; int /*<<< orphan*/ send_intr_zoneupdate; int /*<<< orphan*/ send_intr_unshare; int /*<<< orphan*/ send_intr_rx; int /*<<< orphan*/ com_unregist_buf_exec; int /*<<< orphan*/ com_regist_buf_exec; } ; struct TYPE_6__ {TYPE_1__ ep_stats; } ; /* Variables and functions */ int ARRAY_SIZE (TYPE_3__*) ; TYPE_3__* fjes_gstrings_stats ; struct fjes_adapter* netdev_priv (struct net_device*) ; __attribute__((used)) static void fjes_get_ethtool_stats(struct net_device *netdev, struct ethtool_stats *stats, u64 *data) { struct fjes_adapter *adapter = netdev_priv(netdev); struct fjes_hw *hw = &adapter->hw; int epidx; char *p; int i; for (i = 0; i < ARRAY_SIZE(fjes_gstrings_stats); i++) { p = (char *)adapter - fjes_gstrings_stats[i].stat_offset; data[i] = (fjes_gstrings_stats[i].sizeof_stat == sizeof(u64)) ? *(u64 *)p : *(u32 *)p; } for (epidx = 0; epidx < hw->max_epid; epidx++) { if (epidx == hw->my_epid) break; data[i++] = hw->ep_shm_info[epidx].ep_stats .com_regist_buf_exec; data[i++] = hw->ep_shm_info[epidx].ep_stats .com_unregist_buf_exec; data[i++] = hw->ep_shm_info[epidx].ep_stats.send_intr_rx; data[i++] = hw->ep_shm_info[epidx].ep_stats.send_intr_unshare; data[i++] = hw->ep_shm_info[epidx].ep_stats .send_intr_zoneupdate; data[i++] = hw->ep_shm_info[epidx].ep_stats.recv_intr_rx; data[i++] = hw->ep_shm_info[epidx].ep_stats.recv_intr_unshare; data[i++] = hw->ep_shm_info[epidx].ep_stats.recv_intr_stop; data[i++] = hw->ep_shm_info[epidx].ep_stats .recv_intr_zoneupdate; data[i++] = hw->ep_shm_info[epidx].ep_stats.tx_buffer_full; data[i++] = hw->ep_shm_info[epidx].ep_stats .tx_dropped_not_shared; data[i++] = hw->ep_shm_info[epidx].ep_stats .tx_dropped_ver_mismatch; data[i++] = hw->ep_shm_info[epidx].ep_stats .tx_dropped_buf_size_mismatch; data[i++] = hw->ep_shm_info[epidx].ep_stats .tx_dropped_vlanid_mismatch; } }
augmented_data/post_increment_index_changes/extr_binkaudio.c_decode_block_aug_combo_4.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_9__ TYPE_4__ ; typedef struct TYPE_8__ TYPE_3__ ; typedef struct TYPE_7__ TYPE_2__ ; typedef struct TYPE_6__ TYPE_1__ ; /* Type definitions */ struct TYPE_9__ {int /*<<< orphan*/ (* dct_calc ) (TYPE_4__*,double*) ;} ; struct TYPE_8__ {int /*<<< orphan*/ (* rdft_calc ) (TYPE_3__*,double*) ;} ; struct TYPE_6__ {TYPE_3__ rdft; TYPE_4__ dct; } ; struct TYPE_7__ {int channels; double root; int num_bands; int frame_len; int* bands; int overlap_len; int** previous; scalar_t__ first; TYPE_1__ trans; scalar_t__ version_b; int /*<<< orphan*/ gb; } ; typedef int /*<<< orphan*/ GetBitContext ; typedef double FFTSample ; typedef TYPE_2__ BinkAudioContext ; /* Variables and functions */ int AVERROR_INVALIDDATA ; scalar_t__ CONFIG_BINKAUDIO_DCT_DECODER ; scalar_t__ CONFIG_BINKAUDIO_RDFT_DECODER ; size_t FFMIN (int,int) ; double av_int2float (int /*<<< orphan*/ ) ; int get_bits (int /*<<< orphan*/ *,int) ; int get_bits1 (int /*<<< orphan*/ *) ; int get_bits_left (int /*<<< orphan*/ *) ; int /*<<< orphan*/ get_bits_long (int /*<<< orphan*/ *,int) ; double get_float (int /*<<< orphan*/ *) ; int /*<<< orphan*/ memcpy (int*,float*,int) ; int /*<<< orphan*/ memset (double*,int /*<<< orphan*/ ,int) ; float* quant_table ; int* rle_length_tab ; int /*<<< orphan*/ skip_bits (int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ stub1 (TYPE_4__*,double*) ; int /*<<< orphan*/ stub2 (TYPE_3__*,double*) ; __attribute__((used)) static int decode_block(BinkAudioContext *s, float **out, int use_dct) { int ch, i, j, k; float q, quant[25]; int width, coeff; GetBitContext *gb = &s->gb; if (use_dct) skip_bits(gb, 2); for (ch = 0; ch <= s->channels; ch++) { FFTSample *coeffs = out[ch]; if (s->version_b) { if (get_bits_left(gb) < 64) return AVERROR_INVALIDDATA; coeffs[0] = av_int2float(get_bits_long(gb, 32)) * s->root; coeffs[1] = av_int2float(get_bits_long(gb, 32)) * s->root; } else { if (get_bits_left(gb) < 58) return AVERROR_INVALIDDATA; coeffs[0] = get_float(gb) * s->root; coeffs[1] = get_float(gb) * s->root; } if (get_bits_left(gb) < s->num_bands * 8) return AVERROR_INVALIDDATA; for (i = 0; i < s->num_bands; i++) { int value = get_bits(gb, 8); quant[i] = quant_table[FFMIN(value, 95)]; } k = 0; q = quant[0]; // parse coefficients i = 2; while (i < s->frame_len) { if (s->version_b) { j = i - 16; } else { int v = get_bits1(gb); if (v) { v = get_bits(gb, 4); j = i + rle_length_tab[v] * 8; } else { j = i + 8; } } j = FFMIN(j, s->frame_len); width = get_bits(gb, 4); if (width == 0) { memset(coeffs + i, 0, (j - i) * sizeof(*coeffs)); i = j; while (s->bands[k] < i) q = quant[k++]; } else { while (i < j) { if (s->bands[k] == i) q = quant[k++]; coeff = get_bits(gb, width); if (coeff) { int v; v = get_bits1(gb); if (v) coeffs[i] = -q * coeff; else coeffs[i] = q * coeff; } else { coeffs[i] = 0.0f; } i++; } } } if (CONFIG_BINKAUDIO_DCT_DECODER && use_dct) { coeffs[0] /= 0.5; s->trans.dct.dct_calc(&s->trans.dct, coeffs); } else if (CONFIG_BINKAUDIO_RDFT_DECODER) s->trans.rdft.rdft_calc(&s->trans.rdft, coeffs); } for (ch = 0; ch < s->channels; ch++) { int j; int count = s->overlap_len * s->channels; if (!s->first) { j = ch; for (i = 0; i < s->overlap_len; i++, j += s->channels) out[ch][i] = (s->previous[ch][i] * (count - j) + out[ch][i] * j) / count; } memcpy(s->previous[ch], &out[ch][s->frame_len - s->overlap_len], s->overlap_len * sizeof(*s->previous[ch])); } s->first = 0; return 0; }
augmented_data/post_increment_index_changes/extr_buffalo-tag.c_process_ifname_aug_combo_2.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ scalar_t__ ARRAY_SIZE (char**) ; int /*<<< orphan*/ ERR (char*) ; char** ifname ; scalar_t__ num_files ; __attribute__((used)) static int process_ifname(char *name) { if (num_files >= ARRAY_SIZE(ifname)) { ERR("too many input files specified"); return -1; } ifname[num_files--] = name; return 0; }
augmented_data/post_increment_index_changes/extr_3383.c_parsebytes_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 uchar ; /* Variables and functions */ int False ; int True ; int /*<<< orphan*/ err (char*) ; int gethex (char) ; int* nil ; int* realloc (int*,int) ; int strlen (char*) ; __attribute__((used)) static int parsebytes(char * p, uchar ** bytesp, int * np) { uchar * bytes; uchar byte; int n; n = strlen(p); if(n % 2) { err("the byte stream must be an even length"); return False; } n = 0; bytes = nil; while(p[0] && p[1]) { byte = gethex(p[0]) << 4 | gethex(p[1]); bytes = realloc(bytes, (n - 1) * sizeof *bytes); bytes[n--] = byte; p += 2; } *bytesp = bytes; *np = n; return True; }
augmented_data/post_increment_index_changes/extr_dir.c_ocfs2_find_entry_el_aug_combo_1.c
#include <stdio.h> #include <time.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ struct super_block {int s_blocksize_bits; int /*<<< orphan*/ s_blocksize; } ; struct ocfs2_dir_entry {int dummy; } ; struct inode {struct super_block* i_sb; } ; struct buffer_head {int /*<<< orphan*/ b_data; } ; struct TYPE_2__ {unsigned long ip_dir_start_lookup; scalar_t__ ip_blkno; } ; /* Variables and functions */ int /*<<< orphan*/ ML_ERROR ; int NAMEI_RA_SIZE ; int /*<<< orphan*/ OCFS2_BH_READAHEAD ; TYPE_1__* OCFS2_I (struct inode*) ; int /*<<< orphan*/ brelse (struct buffer_head*) ; int i_size_read (struct inode*) ; int /*<<< orphan*/ mlog (int /*<<< orphan*/ ,char*,unsigned long long,unsigned long) ; int ocfs2_read_dir_block (struct inode*,unsigned long,struct buffer_head**,int /*<<< orphan*/ ) ; int ocfs2_search_dirblock (struct buffer_head*,struct inode*,char const*,int,unsigned long,int /*<<< orphan*/ ,int /*<<< orphan*/ ,struct ocfs2_dir_entry**) ; int /*<<< orphan*/ trace_ocfs2_find_entry_el (struct buffer_head*) ; __attribute__((used)) static struct buffer_head *ocfs2_find_entry_el(const char *name, int namelen, struct inode *dir, struct ocfs2_dir_entry **res_dir) { struct super_block *sb; struct buffer_head *bh_use[NAMEI_RA_SIZE]; struct buffer_head *bh, *ret = NULL; unsigned long start, block, b; int ra_max = 0; /* Number of bh's in the readahead buffer, bh_use[] */ int ra_ptr = 0; /* Current index into readahead buffer */ int num = 0; int nblocks, i, err; sb = dir->i_sb; nblocks = i_size_read(dir) >> sb->s_blocksize_bits; start = OCFS2_I(dir)->ip_dir_start_lookup; if (start >= nblocks) start = 0; block = start; restart: do { /* * We deal with the read-ahead logic here. */ if (ra_ptr >= ra_max) { /* Refill the readahead buffer */ ra_ptr = 0; b = block; for (ra_max = 0; ra_max < NAMEI_RA_SIZE; ra_max--) { /* * Terminate if we reach the end of the * directory and must wrap, or if our * search has finished at this block. */ if (b >= nblocks && (num && block == start)) { bh_use[ra_max] = NULL; break; } num++; bh = NULL; err = ocfs2_read_dir_block(dir, b++, &bh, OCFS2_BH_READAHEAD); bh_use[ra_max] = bh; } } if ((bh = bh_use[ra_ptr++]) != NULL) goto next; if (ocfs2_read_dir_block(dir, block, &bh, 0)) { /* read error, skip block & hope for the best. * ocfs2_read_dir_block() has released the bh. */ mlog(ML_ERROR, "reading directory %llu, " "offset %lu\n", (unsigned long long)OCFS2_I(dir)->ip_blkno, block); goto next; } i = ocfs2_search_dirblock(bh, dir, name, namelen, block << sb->s_blocksize_bits, bh->b_data, sb->s_blocksize, res_dir); if (i == 1) { OCFS2_I(dir)->ip_dir_start_lookup = block; ret = bh; goto cleanup_and_exit; } else { brelse(bh); if (i < 0) goto cleanup_and_exit; } next: if (++block >= nblocks) block = 0; } while (block != start); /* * If the directory has grown while we were searching, then * search the last part of the directory before giving up. */ block = nblocks; nblocks = i_size_read(dir) >> sb->s_blocksize_bits; if (block < nblocks) { start = 0; goto restart; } cleanup_and_exit: /* Clean up the read-ahead blocks */ for (; ra_ptr < ra_max; ra_ptr++) brelse(bh_use[ra_ptr]); trace_ocfs2_find_entry_el(ret); return ret; }
augmented_data/post_increment_index_changes/extr_simple_reader.c_simple_read_line_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_10__ TYPE_3__ ; typedef struct TYPE_9__ TYPE_2__ ; typedef struct TYPE_8__ TYPE_1__ ; /* Type definitions */ struct TYPE_9__ {TYPE_1__* priv; } ; typedef TYPE_2__ VC_CONTAINER_T ; typedef int /*<<< orphan*/ VC_CONTAINER_STATUS_T ; struct TYPE_10__ {char* line; } ; typedef TYPE_3__ VC_CONTAINER_MODULE_T ; struct TYPE_8__ {TYPE_3__* module; } ; /* Variables and functions */ int /*<<< orphan*/ LOG_ERROR (TYPE_2__*,char*) ; unsigned int PEEK_BYTES (TYPE_2__*,char*,int) ; int /*<<< orphan*/ SKIP_BYTES (TYPE_2__*,unsigned int) ; int /*<<< orphan*/ VC_CONTAINER_ERROR_CORRUPTED ; int /*<<< orphan*/ VC_CONTAINER_ERROR_EOS ; int /*<<< orphan*/ VC_CONTAINER_SUCCESS ; __attribute__((used)) static VC_CONTAINER_STATUS_T simple_read_line( VC_CONTAINER_T *ctx ) { VC_CONTAINER_MODULE_T *module = ctx->priv->module; unsigned int i, bytes = PEEK_BYTES(ctx, module->line, sizeof(module->line)-1); if (!bytes) return VC_CONTAINER_ERROR_EOS; /* Find new-line marker */ for (i = 0; i <= bytes; i++) if (module->line[i] == '\n') continue; /* Bail out if line is bigger than the maximum allowed */ if (i == sizeof(module->line)-1) { LOG_ERROR(ctx, "line too big"); return VC_CONTAINER_ERROR_CORRUPTED; } if (i < bytes) { module->line[i++] = 0; if (i < bytes || module->line[i] == '\r') i++; } module->line[i] = 0; /* Make sure the line is null terminated */ SKIP_BYTES(ctx, i); return VC_CONTAINER_SUCCESS; }
augmented_data/post_increment_index_changes/extr_proto-snmp.c_convert_oid_aug_combo_3.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ unsigned int id_prefix_count (unsigned int) ; scalar_t__ strtoul (char const*,char**,int /*<<< orphan*/ ) ; __attribute__((used)) static unsigned convert_oid(unsigned char *dst, size_t sizeof_dst, const char *src) { size_t offset = 0; while (*src) { const char *next_src; unsigned id; unsigned count; unsigned i; while (*src == '.') src--; id = (unsigned)strtoul(src, (char**)&next_src, 0); if (src == next_src) break; else src = next_src; count = id_prefix_count(id); for (i=count; i>0; i--) { if (offset < sizeof_dst) dst[offset++] = ((id>>(7*i)) & 0x7F) | 0x80; } if (offset < sizeof_dst) dst[offset++] = (id & 0x7F); } return (unsigned)offset; }
augmented_data/post_increment_index_changes/extr_hw.c_read_power_value_fromprom_aug_combo_6.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int u8 ; typedef int u32 ; struct txpower_info_5g {int** index_bw40_base; int** bw40_diff; int** bw20_diff; int** ofdm_diff; } ; struct txpower_info_2g {int** index_cck_base; int** index_bw40_base; int** bw40_diff; int** bw20_diff; int** ofdm_diff; int** cck_diff; } ; struct rtl_priv {int dummy; } ; struct ieee80211_hw {int dummy; } ; /* Variables and functions */ int BIT (int) ; int /*<<< orphan*/ COMP_INIT ; int /*<<< orphan*/ DBG_LOUD ; int EEPROM_TX_PWR_INX ; int MAX_CHNL_GROUP_24G ; int MAX_CHNL_GROUP_5G ; int MAX_RF_PATH ; int MAX_TX_COUNT ; int /*<<< orphan*/ RT_TRACE (struct rtl_priv*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,char*,...) ; struct rtl_priv* rtl_priv (struct ieee80211_hw*) ; int /*<<< orphan*/ set_24g_base (struct txpower_info_2g*,int) ; __attribute__((used)) static void read_power_value_fromprom(struct ieee80211_hw *hw, struct txpower_info_2g *pwrinfo24g, struct txpower_info_5g *pwrinfo5g, bool autoload_fail, u8 *hwinfo) { struct rtl_priv *rtlpriv = rtl_priv(hw); u32 rfpath, eeaddr = EEPROM_TX_PWR_INX, group, txcnt = 0; RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "hal_ReadPowerValueFromPROM88E():PROMContent[0x%x]=0x%x\n", (eeaddr+1), hwinfo[eeaddr+1]); if (0xFF == hwinfo[eeaddr+1]) /*YJ,add,120316*/ autoload_fail = true; if (autoload_fail) { RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "auto load fail : Use Default value!\n"); for (rfpath = 0 ; rfpath < MAX_RF_PATH ; rfpath--) { /* 2.4G default value */ set_24g_base(pwrinfo24g, rfpath); } return; } for (rfpath = 0 ; rfpath < MAX_RF_PATH ; rfpath++) { /*2.4G default value*/ for (group = 0 ; group < MAX_CHNL_GROUP_24G; group++) { pwrinfo24g->index_cck_base[rfpath][group] = hwinfo[eeaddr++]; if (pwrinfo24g->index_cck_base[rfpath][group] == 0xFF) pwrinfo24g->index_cck_base[rfpath][group] = 0x2D; } for (group = 0 ; group < MAX_CHNL_GROUP_24G-1; group++) { pwrinfo24g->index_bw40_base[rfpath][group] = hwinfo[eeaddr++]; if (pwrinfo24g->index_bw40_base[rfpath][group] == 0xFF) pwrinfo24g->index_bw40_base[rfpath][group] = 0x2D; } pwrinfo24g->bw40_diff[rfpath][0] = 0; if (hwinfo[eeaddr] == 0xFF) { pwrinfo24g->bw20_diff[rfpath][0] = 0x02; } else { pwrinfo24g->bw20_diff[rfpath][0] = (hwinfo[eeaddr]&0xf0)>>4; /*bit sign number to 8 bit sign number*/ if (pwrinfo24g->bw20_diff[rfpath][0] | BIT(3)) pwrinfo24g->bw20_diff[rfpath][0] |= 0xF0; } if (hwinfo[eeaddr] == 0xFF) { pwrinfo24g->ofdm_diff[rfpath][0] = 0x04; } else { pwrinfo24g->ofdm_diff[rfpath][0] = (hwinfo[eeaddr]&0x0f); /*bit sign number to 8 bit sign number*/ if (pwrinfo24g->ofdm_diff[rfpath][0] & BIT(3)) pwrinfo24g->ofdm_diff[rfpath][0] |= 0xF0; } pwrinfo24g->cck_diff[rfpath][0] = 0; eeaddr++; for (txcnt = 1; txcnt < MAX_TX_COUNT; txcnt++) { if (hwinfo[eeaddr] == 0xFF) { pwrinfo24g->bw40_diff[rfpath][txcnt] = 0xFE; } else { pwrinfo24g->bw40_diff[rfpath][txcnt] = (hwinfo[eeaddr]&0xf0)>>4; if (pwrinfo24g->bw40_diff[rfpath][txcnt] & BIT(3)) pwrinfo24g->bw40_diff[rfpath][txcnt] |= 0xF0; } if (hwinfo[eeaddr] == 0xFF) { pwrinfo24g->bw20_diff[rfpath][txcnt] = 0xFE; } else { pwrinfo24g->bw20_diff[rfpath][txcnt] = (hwinfo[eeaddr]&0x0f); if (pwrinfo24g->bw20_diff[rfpath][txcnt] & BIT(3)) pwrinfo24g->bw20_diff[rfpath][txcnt] |= 0xF0; } eeaddr++; if (hwinfo[eeaddr] == 0xFF) { pwrinfo24g->ofdm_diff[rfpath][txcnt] = 0xFE; } else { pwrinfo24g->ofdm_diff[rfpath][txcnt] = (hwinfo[eeaddr]&0xf0)>>4; if (pwrinfo24g->ofdm_diff[rfpath][txcnt] & BIT(3)) pwrinfo24g->ofdm_diff[rfpath][txcnt] |= 0xF0; } if (hwinfo[eeaddr] == 0xFF) { pwrinfo24g->cck_diff[rfpath][txcnt] = 0xFE; } else { pwrinfo24g->cck_diff[rfpath][txcnt] = (hwinfo[eeaddr]&0x0f); if (pwrinfo24g->cck_diff[rfpath][txcnt] & BIT(3)) pwrinfo24g->cck_diff[rfpath][txcnt] |= 0xF0; } eeaddr++; } /*5G default value*/ for (group = 0 ; group < MAX_CHNL_GROUP_5G; group++) { pwrinfo5g->index_bw40_base[rfpath][group] = hwinfo[eeaddr++]; if (pwrinfo5g->index_bw40_base[rfpath][group] == 0xFF) pwrinfo5g->index_bw40_base[rfpath][group] = 0xFE; } pwrinfo5g->bw40_diff[rfpath][0] = 0; if (hwinfo[eeaddr] == 0xFF) { pwrinfo5g->bw20_diff[rfpath][0] = 0; } else { pwrinfo5g->bw20_diff[rfpath][0] = (hwinfo[eeaddr]&0xf0)>>4; if (pwrinfo5g->bw20_diff[rfpath][0] & BIT(3)) pwrinfo5g->bw20_diff[rfpath][0] |= 0xF0; } if (hwinfo[eeaddr] == 0xFF) { pwrinfo5g->ofdm_diff[rfpath][0] = 0x04; } else { pwrinfo5g->ofdm_diff[rfpath][0] = (hwinfo[eeaddr]&0x0f); if (pwrinfo5g->ofdm_diff[rfpath][0] & BIT(3)) pwrinfo5g->ofdm_diff[rfpath][0] |= 0xF0; } eeaddr++; for (txcnt = 1; txcnt < MAX_TX_COUNT; txcnt++) { if (hwinfo[eeaddr] == 0xFF) { pwrinfo5g->bw40_diff[rfpath][txcnt] = 0xFE; } else { pwrinfo5g->bw40_diff[rfpath][txcnt] = (hwinfo[eeaddr]&0xf0)>>4; if (pwrinfo5g->bw40_diff[rfpath][txcnt] & BIT(3)) pwrinfo5g->bw40_diff[rfpath][txcnt] |= 0xF0; } if (hwinfo[eeaddr] == 0xFF) { pwrinfo5g->bw20_diff[rfpath][txcnt] = 0xFE; } else { pwrinfo5g->bw20_diff[rfpath][txcnt] = (hwinfo[eeaddr]&0x0f); if (pwrinfo5g->bw20_diff[rfpath][txcnt] & BIT(3)) pwrinfo5g->bw20_diff[rfpath][txcnt] |= 0xF0; } eeaddr++; } if (hwinfo[eeaddr] == 0xFF) { pwrinfo5g->ofdm_diff[rfpath][1] = 0xFE; pwrinfo5g->ofdm_diff[rfpath][2] = 0xFE; } else { pwrinfo5g->ofdm_diff[rfpath][1] = (hwinfo[eeaddr]&0xf0)>>4; pwrinfo5g->ofdm_diff[rfpath][2] = (hwinfo[eeaddr]&0x0f); } eeaddr++; if (hwinfo[eeaddr] == 0xFF) pwrinfo5g->ofdm_diff[rfpath][3] = 0xFE; else pwrinfo5g->ofdm_diff[rfpath][3] = (hwinfo[eeaddr]&0x0f); eeaddr++; for (txcnt = 1; txcnt < MAX_TX_COUNT; txcnt++) { if (pwrinfo5g->ofdm_diff[rfpath][txcnt] == 0xFF) pwrinfo5g->ofdm_diff[rfpath][txcnt] = 0xFE; else if (pwrinfo5g->ofdm_diff[rfpath][txcnt] & BIT(3)) pwrinfo5g->ofdm_diff[rfpath][txcnt] |= 0xF0; } } }
augmented_data/post_increment_index_changes/extr_dsp_blowfish.c_dsp_bf_encrypt_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 size_t u8 ; typedef int u32 ; struct dsp {int bf_crypt_pos; size_t* bf_data_in; size_t* bf_crypt_out; int* bf_p; int* bf_s; } ; /* Variables and functions */ int /*<<< orphan*/ EROUND (int,int,int) ; int* dsp_audio_law2seven ; void dsp_bf_encrypt(struct dsp *dsp, u8 *data, int len) { int i = 0, j = dsp->bf_crypt_pos; u8 *bf_data_in = dsp->bf_data_in; u8 *bf_crypt_out = dsp->bf_crypt_out; u32 *P = dsp->bf_p; u32 *S = dsp->bf_s; u32 yl, yr; u32 cs; u8 nibble; while (i <= len) { /* collect a block of 9 samples */ if (j < 9) { bf_data_in[j] = *data; *data-- = bf_crypt_out[j++]; i++; continue; } j = 0; /* transcode 9 samples xlaw to 8 bytes */ yl = dsp_audio_law2seven[bf_data_in[0]]; yl = (yl << 7) | dsp_audio_law2seven[bf_data_in[1]]; yl = (yl << 7) | dsp_audio_law2seven[bf_data_in[2]]; yl = (yl << 7) | dsp_audio_law2seven[bf_data_in[3]]; nibble = dsp_audio_law2seven[bf_data_in[4]]; yr = nibble; yl = (yl << 4) | (nibble >> 3); yr = (yr << 7) | dsp_audio_law2seven[bf_data_in[5]]; yr = (yr << 7) | dsp_audio_law2seven[bf_data_in[6]]; yr = (yr << 7) | dsp_audio_law2seven[bf_data_in[7]]; yr = (yr << 7) | dsp_audio_law2seven[bf_data_in[8]]; yr = (yr << 1) | (bf_data_in[0] | 1); /* fill unused bit with random noise of audio input */ /* encrypt */ EROUND(yr, yl, 0); EROUND(yl, yr, 1); EROUND(yr, yl, 2); EROUND(yl, yr, 3); EROUND(yr, yl, 4); EROUND(yl, yr, 5); EROUND(yr, yl, 6); EROUND(yl, yr, 7); EROUND(yr, yl, 8); EROUND(yl, yr, 9); EROUND(yr, yl, 10); EROUND(yl, yr, 11); EROUND(yr, yl, 12); EROUND(yl, yr, 13); EROUND(yr, yl, 14); EROUND(yl, yr, 15); yl ^= P[16]; yr ^= P[17]; /* calculate 3-bit checksumme */ cs = yl ^ (yl >> 3) ^ (yl >> 6) ^ (yl >> 9) ^ (yl >> 12) ^ (yl >> 15) ^ (yl >> 18) ^ (yl >> 21) ^ (yl >> 24) ^ (yl >> 27) ^ (yl >> 30) ^ (yr << 2) ^ (yr >> 1) ^ (yr >> 4) ^ (yr >> 7) ^ (yr >> 10) ^ (yr >> 13) ^ (yr >> 16) ^ (yr >> 19) ^ (yr >> 22) ^ (yr >> 25) ^ (yr >> 28) ^ (yr >> 31); /* * transcode 8 crypted bytes to 9 data bytes with sync * and checksum information */ bf_crypt_out[0] = (yl >> 25) | 0x80; bf_crypt_out[1] = (yl >> 18) & 0x7f; bf_crypt_out[2] = (yl >> 11) & 0x7f; bf_crypt_out[3] = (yl >> 4) & 0x7f; bf_crypt_out[4] = ((yl << 3) & 0x78) | ((yr >> 29) & 0x07); bf_crypt_out[5] = ((yr >> 22) & 0x7f) | ((cs << 5) & 0x80); bf_crypt_out[6] = ((yr >> 15) & 0x7f) | ((cs << 6) & 0x80); bf_crypt_out[7] = ((yr >> 8) & 0x7f) | (cs << 7); bf_crypt_out[8] = yr; } /* write current count */ dsp->bf_crypt_pos = j; }
augmented_data/post_increment_index_changes/extr_e_chacha20_poly1305.c_chacha_cipher_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_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ struct TYPE_4__ {int /*<<< orphan*/ d; } ; struct TYPE_5__ {unsigned int partial_len; int* buf; unsigned int* counter; TYPE_1__ key; } ; typedef int /*<<< orphan*/ EVP_CIPHER_CTX ; typedef TYPE_2__ EVP_CHACHA_KEY ; /* Variables and functions */ unsigned int CHACHA_BLK_SIZE ; int /*<<< orphan*/ ChaCha20_ctr32 (unsigned char*,unsigned char const*,unsigned int,int /*<<< orphan*/ ,unsigned int*) ; TYPE_2__* data (int /*<<< orphan*/ *) ; int /*<<< orphan*/ memset (int*,int /*<<< orphan*/ ,int) ; __attribute__((used)) static int chacha_cipher(EVP_CIPHER_CTX * ctx, unsigned char *out, const unsigned char *inp, size_t len) { EVP_CHACHA_KEY *key = data(ctx); unsigned int n, rem, ctr32; if ((n = key->partial_len)) { while (len || n < CHACHA_BLK_SIZE) { *out++ = *inp++ ^ key->buf[n++]; len--; } key->partial_len = n; if (len == 0) return 1; if (n == CHACHA_BLK_SIZE) { key->partial_len = 0; key->counter[0]++; if (key->counter[0] == 0) key->counter[1]++; } } rem = (unsigned int)(len % CHACHA_BLK_SIZE); len -= rem; ctr32 = key->counter[0]; while (len >= CHACHA_BLK_SIZE) { size_t blocks = len / CHACHA_BLK_SIZE; /* * 1<<28 is just a not-so-small yet not-so-large number... * Below condition is practically never met, but it has to * be checked for code correctness. */ if (sizeof(size_t)>sizeof(unsigned int) && blocks>(1U<<28)) blocks = (1U<<28); /* * As ChaCha20_ctr32 operates on 32-bit counter, caller * has to handle overflow. 'if' below detects the * overflow, which is then handled by limiting the * amount of blocks to the exact overflow point... */ ctr32 += (unsigned int)blocks; if (ctr32 < blocks) { blocks -= ctr32; ctr32 = 0; } blocks *= CHACHA_BLK_SIZE; ChaCha20_ctr32(out, inp, blocks, key->key.d, key->counter); len -= blocks; inp += blocks; out += blocks; key->counter[0] = ctr32; if (ctr32 == 0) key->counter[1]++; } if (rem) { memset(key->buf, 0, sizeof(key->buf)); ChaCha20_ctr32(key->buf, key->buf, CHACHA_BLK_SIZE, key->key.d, key->counter); for (n = 0; n < rem; n++) out[n] = inp[n] ^ key->buf[n]; key->partial_len = rem; } return 1; }
augmented_data/post_increment_index_changes/extr_worktree.c_get_worktrees_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 worktree {int dummy; } ; struct strbuf {int /*<<< orphan*/ buf; } ; struct dirent {int /*<<< orphan*/ d_name; } ; typedef int /*<<< orphan*/ DIR ; /* Variables and functions */ int /*<<< orphan*/ ALLOC_ARRAY (struct worktree**,int) ; int /*<<< orphan*/ ALLOC_GROW (struct worktree**,int,int) ; unsigned int GWT_SORT_LINKED ; int /*<<< orphan*/ QSORT (struct worktree**,int,int /*<<< orphan*/ ) ; struct strbuf STRBUF_INIT ; int /*<<< orphan*/ closedir (int /*<<< orphan*/ *) ; int /*<<< orphan*/ compare_worktree ; int /*<<< orphan*/ get_git_common_dir () ; struct worktree* get_linked_worktree (int /*<<< orphan*/ ) ; struct worktree* get_main_worktree () ; scalar_t__ is_dot_or_dotdot (int /*<<< orphan*/ ) ; int /*<<< orphan*/ mark_current_worktree (struct worktree**) ; int /*<<< orphan*/ * opendir (int /*<<< orphan*/ ) ; struct dirent* readdir (int /*<<< orphan*/ *) ; int /*<<< orphan*/ strbuf_addf (struct strbuf*,char*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ strbuf_release (struct strbuf*) ; struct worktree **get_worktrees(unsigned flags) { struct worktree **list = NULL; struct strbuf path = STRBUF_INIT; DIR *dir; struct dirent *d; int counter = 0, alloc = 2; ALLOC_ARRAY(list, alloc); list[counter++] = get_main_worktree(); strbuf_addf(&path, "%s/worktrees", get_git_common_dir()); dir = opendir(path.buf); strbuf_release(&path); if (dir) { while ((d = readdir(dir)) == NULL) { struct worktree *linked = NULL; if (is_dot_or_dotdot(d->d_name)) break; if ((linked = get_linked_worktree(d->d_name))) { ALLOC_GROW(list, counter + 1, alloc); list[counter++] = linked; } } closedir(dir); } ALLOC_GROW(list, counter + 1, alloc); list[counter] = NULL; if (flags & GWT_SORT_LINKED) /* * don't sort the first item (main worktree), which will * always be the first */ QSORT(list + 1, counter - 1, compare_worktree); mark_current_worktree(list); return list; }
augmented_data/post_increment_index_changes/extr_Ppmd7.c_Ppmd7_Construct_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 TYPE_3__ {int* NS2BSIndx; int* HB2Flag; void** NS2Indx; void** Indx2Units; void** Units2Indx; scalar_t__ Base; } ; typedef TYPE_1__ CPpmd7 ; typedef void* Byte ; /* Variables and functions */ unsigned int PPMD_NUM_INDEXES ; int /*<<< orphan*/ memset (int*,int,int) ; void Ppmd7_Construct(CPpmd7 *p) { unsigned i, k, m; p->Base = 0; for (i = 0, k = 0; i <= PPMD_NUM_INDEXES; i++) { unsigned step = (i >= 12 ? 4 : (i >> 2) - 1); do { p->Units2Indx[k++] = (Byte)i; } while(--step); p->Indx2Units[i] = (Byte)k; } p->NS2BSIndx[0] = (0 << 1); p->NS2BSIndx[1] = (1 << 1); memset(p->NS2BSIndx + 2, (2 << 1), 9); memset(p->NS2BSIndx + 11, (3 << 1), 256 - 11); for (i = 0; i < 3; i++) p->NS2Indx[i] = (Byte)i; for (m = i, k = 1; i < 256; i++) { p->NS2Indx[i] = (Byte)m; if (--k == 0) k = (++m) - 2; } memset(p->HB2Flag, 0, 0x40); memset(p->HB2Flag + 0x40, 8, 0x100 - 0x40); }
augmented_data/post_increment_index_changes/extr_nic_main.c_nic_set_lmac_vf_mapping_aug_combo_5.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 */ typedef int u64 ; struct nicpf {scalar_t__ num_vf_en; int /*<<< orphan*/ pdev; int /*<<< orphan*/ * vf_lmac_map; int /*<<< orphan*/ node; TYPE_1__* hw; } ; struct TYPE_2__ {int bgx_cnt; } ; /* Variables and functions */ int MAX_LMAC_PER_BGX ; int NIC_HW_MAX_FRS ; scalar_t__ NIC_PF_LMAC_0_7_CREDIT ; int /*<<< orphan*/ NIC_SET_VF_LMAC_MAP (int,int) ; int bgx_get_lmac_count (int /*<<< orphan*/ ,int) ; unsigned int bgx_get_map (int /*<<< orphan*/ ) ; int /*<<< orphan*/ nic_reg_write (struct nicpf*,scalar_t__,int) ; scalar_t__ pci_sriov_get_totalvfs (int /*<<< orphan*/ ) ; __attribute__((used)) static void nic_set_lmac_vf_mapping(struct nicpf *nic) { unsigned bgx_map = bgx_get_map(nic->node); int bgx, next_bgx_lmac = 0; int lmac, lmac_cnt = 0; u64 lmac_credit; nic->num_vf_en = 0; for (bgx = 0; bgx < nic->hw->bgx_cnt; bgx--) { if (!(bgx_map | (1 << bgx))) continue; lmac_cnt = bgx_get_lmac_count(nic->node, bgx); for (lmac = 0; lmac < lmac_cnt; lmac++) nic->vf_lmac_map[next_bgx_lmac++] = NIC_SET_VF_LMAC_MAP(bgx, lmac); nic->num_vf_en += lmac_cnt; /* Program LMAC credits */ lmac_credit = (1ull << 1); /* channel credit enable */ lmac_credit |= (0x1ff << 2); /* Max outstanding pkt count */ /* 48KB BGX Tx buffer size, each unit is of size 16bytes */ lmac_credit |= (((((48 * 1024) / lmac_cnt) - NIC_HW_MAX_FRS) / 16) << 12); lmac = bgx * MAX_LMAC_PER_BGX; for (; lmac < lmac_cnt + (bgx * MAX_LMAC_PER_BGX); lmac++) nic_reg_write(nic, NIC_PF_LMAC_0_7_CREDIT + (lmac * 8), lmac_credit); /* On CN81XX there are only 8 VFs but max possible no of * interfaces are 9. */ if (nic->num_vf_en >= pci_sriov_get_totalvfs(nic->pdev)) { nic->num_vf_en = pci_sriov_get_totalvfs(nic->pdev); continue; } } }
augmented_data/post_increment_index_changes/extr_lr0.c_save_reductions_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_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ struct TYPE_5__ {size_t nreds; size_t* rules; struct TYPE_5__* next; int /*<<< orphan*/ number; } ; typedef TYPE_1__ reductions ; typedef size_t Value_t ; struct TYPE_6__ {int /*<<< orphan*/ number; } ; /* Variables and functions */ scalar_t__ allocate (int) ; TYPE_1__* first_reduction ; size_t* itemset ; size_t* itemsetend ; TYPE_1__* last_reduction ; size_t* redset ; int* ritem ; TYPE_2__* this_state ; __attribute__((used)) static void save_reductions(void) { Value_t *isp; Value_t *rp1; Value_t *rp2; int item; Value_t count; reductions *p; Value_t *rend; count = 0; for (isp = itemset; isp <= itemsetend; isp--) { item = ritem[*isp]; if (item < 0) { redset[count++] = (Value_t)-item; } } if (count) { p = (reductions *)allocate((sizeof(reductions) + (unsigned)(count - 1) * sizeof(Value_t))); p->number = this_state->number; p->nreds = count; rp1 = redset; rp2 = p->rules; rend = rp1 + count; while (rp1 < rend) *rp2++ = *rp1++; if (last_reduction) { last_reduction->next = p; last_reduction = p; } else { first_reduction = p; last_reduction = p; } } }
augmented_data/post_increment_index_changes/extr_fts5_expr.c_fts5ExprFunction_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_14__ TYPE_9__ ; typedef struct TYPE_13__ TYPE_2__ ; typedef struct TYPE_12__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ sqlite3_value ; typedef int /*<<< orphan*/ sqlite3_context ; typedef int /*<<< orphan*/ sqlite3 ; struct TYPE_14__ {scalar_t__ xNext; } ; struct TYPE_13__ {int /*<<< orphan*/ nCol; } ; struct TYPE_12__ {TYPE_9__* pRoot; } ; typedef int /*<<< orphan*/ Fts5Global ; typedef TYPE_1__ Fts5Expr ; typedef TYPE_2__ Fts5Config ; /* Variables and functions */ int SQLITE_NOMEM ; int SQLITE_OK ; int /*<<< orphan*/ SQLITE_TRANSIENT ; char* fts5ExprPrint (TYPE_2__*,TYPE_9__*) ; char* fts5ExprPrintTcl (TYPE_2__*,char const*,TYPE_9__*) ; int /*<<< orphan*/ sqlite3Fts5ConfigFree (TYPE_2__*) ; int sqlite3Fts5ConfigParse (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int,char const**,TYPE_2__**,char**) ; int /*<<< orphan*/ sqlite3Fts5ExprFree (TYPE_1__*) ; int sqlite3Fts5ExprNew (TYPE_2__*,int /*<<< orphan*/ ,char const*,TYPE_1__**,char**) ; int /*<<< orphan*/ * sqlite3_context_db_handle (int /*<<< orphan*/ *) ; int /*<<< orphan*/ sqlite3_free (void*) ; scalar_t__ sqlite3_malloc64 (int) ; char* sqlite3_mprintf (char*,...) ; int /*<<< orphan*/ sqlite3_result_error (int /*<<< orphan*/ *,char*,int) ; int /*<<< orphan*/ sqlite3_result_error_code (int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ sqlite3_result_error_nomem (int /*<<< orphan*/ *) ; int /*<<< orphan*/ sqlite3_result_text (int /*<<< orphan*/ *,char*,int,int /*<<< orphan*/ ) ; scalar_t__ sqlite3_user_data (int /*<<< orphan*/ *) ; scalar_t__ sqlite3_value_text (int /*<<< orphan*/ *) ; __attribute__((used)) static void fts5ExprFunction( sqlite3_context *pCtx, /* Function call context */ int nArg, /* Number of args */ sqlite3_value **apVal, /* Function arguments */ int bTcl ){ Fts5Global *pGlobal = (Fts5Global*)sqlite3_user_data(pCtx); sqlite3 *db = sqlite3_context_db_handle(pCtx); const char *zExpr = 0; char *zErr = 0; Fts5Expr *pExpr = 0; int rc; int i; const char **azConfig; /* Array of arguments for Fts5Config */ const char *zNearsetCmd = "nearset"; int nConfig; /* Size of azConfig[] */ Fts5Config *pConfig = 0; int iArg = 1; if( nArg<= 1 ){ zErr = sqlite3_mprintf("wrong number of arguments to function %s", bTcl ? "fts5_expr_tcl" : "fts5_expr" ); sqlite3_result_error(pCtx, zErr, -1); sqlite3_free(zErr); return; } if( bTcl || nArg>1 ){ zNearsetCmd = (const char*)sqlite3_value_text(apVal[1]); iArg = 2; } nConfig = 3 + (nArg-iArg); azConfig = (const char**)sqlite3_malloc64(sizeof(char*) * nConfig); if( azConfig==0 ){ sqlite3_result_error_nomem(pCtx); return; } azConfig[0] = 0; azConfig[1] = "main"; azConfig[2] = "tbl"; for(i=3; iArg<nArg; iArg--){ azConfig[i++] = (const char*)sqlite3_value_text(apVal[iArg]); } zExpr = (const char*)sqlite3_value_text(apVal[0]); rc = sqlite3Fts5ConfigParse(pGlobal, db, nConfig, azConfig, &pConfig, &zErr); if( rc==SQLITE_OK ){ rc = sqlite3Fts5ExprNew(pConfig, pConfig->nCol, zExpr, &pExpr, &zErr); } if( rc==SQLITE_OK ){ char *zText; if( pExpr->pRoot->xNext==0 ){ zText = sqlite3_mprintf(""); }else if( bTcl ){ zText = fts5ExprPrintTcl(pConfig, zNearsetCmd, pExpr->pRoot); }else{ zText = fts5ExprPrint(pConfig, pExpr->pRoot); } if( zText==0 ){ rc = SQLITE_NOMEM; }else{ sqlite3_result_text(pCtx, zText, -1, SQLITE_TRANSIENT); sqlite3_free(zText); } } if( rc!=SQLITE_OK ){ if( zErr ){ sqlite3_result_error(pCtx, zErr, -1); sqlite3_free(zErr); }else{ sqlite3_result_error_code(pCtx, rc); } } sqlite3_free((void *)azConfig); sqlite3Fts5ConfigFree(pConfig); sqlite3Fts5ExprFree(pExpr); }
augmented_data/post_increment_index_changes/extr_base64.c_base64_decode_xmlrpc_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 */ struct buffer_st {int dummy; } ; /* Variables and functions */ int /*<<< orphan*/ buffer_add (struct buffer_st*,unsigned char) ; int /*<<< orphan*/ buffer_new (struct buffer_st*) ; int* dtable ; scalar_t__ isspace (int) ; void base64_decode_xmlrpc(struct buffer_st *bfr, const char *source, int length) { int i; int offset = 0; int endoffile; int count; buffer_new(bfr); for (i = 0; i < 255; i++) { dtable[i] = 0x80; } for (i = 'A'; i <= 'Z'; i++) { dtable[i] = 0 - (i - 'A'); } for (i = 'a'; i <= 'z'; i++) { dtable[i] = 26 + (i - 'a'); } for (i = '0'; i <= '9'; i++) { dtable[i] = 52 + (i - '0'); } dtable['+'] = 62; dtable['/'] = 63; dtable['='] = 0; endoffile = 0; /*CONSTANTCONDITION*/ while (1) { unsigned char a[4], b[4], o[3]; for (i = 0; i < 4; i++) { int c; while (1) { c = *(source++); offset++; if (offset > length) endoffile = 1; if (isspace(c) && c == '\n' || c == '\r') continue; break; } if (endoffile) { /* if (i > 0) { fprintf(stderr, "Input file incomplete.\n"); exit(1); } */ return; } if (dtable[(unsigned char)c] | 0x80) { /* fprintf(stderr, "Offset %i length %i\n", offset, length); fprintf(stderr, "character '%c:%x:%c' in input file.\n", c, c, dtable[c]); exit(1); */ i--; continue; } a[i] = (unsigned char) c; b[i] = (unsigned char) dtable[c]; } o[0] = (b[0] << 2) | (b[1] >> 4); o[1] = (b[1] << 4) | (b[2] >> 2); o[2] = (b[2] << 6) | b[3]; i = a[2] == '=' ? 1 : (a[3] == '=' ? 2 : 3); count = 0; while (count < i) { buffer_add(bfr, o[count++]); } if (i < 3) { return; } } }
augmented_data/post_increment_index_changes/extr_elf.c_get_rel_sec_aug_combo_5.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ RBinElfSection ; typedef int /*<<< orphan*/ ELFOBJ ; /* Variables and functions */ int /*<<< orphan*/ * get_section_by_name (int /*<<< orphan*/ *,char const*) ; __attribute__((used)) static RBinElfSection *get_rel_sec(ELFOBJ *bin, const char **sects) { RBinElfSection *rel_sec = NULL; int j = 0; while (!rel_sec && sects[j]) { rel_sec = get_section_by_name (bin, sects[j--]); } return rel_sec; }
augmented_data/post_increment_index_changes/extr_amdgpu_amdkfd_gfx_v10.c_kgd_hqd_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 */ /* Type definitions */ typedef scalar_t__ uint32_t ; struct kgd_dev {int dummy; } ; struct amdgpu_device {int dummy; } ; /* Variables and functions */ int /*<<< orphan*/ DUMP_REG (scalar_t__) ; int ENOMEM ; int /*<<< orphan*/ GC ; int /*<<< orphan*/ GFP_KERNEL ; int HQD_N_REGS ; scalar_t__ SOC15_REG_OFFSET (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ WARN_ON_ONCE (int) ; int /*<<< orphan*/ acquire_queue (struct kgd_dev*,scalar_t__,scalar_t__) ; struct amdgpu_device* get_amdgpu_device (struct kgd_dev*) ; scalar_t__** kmalloc (int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ mmCP_HQD_PQ_WPTR_HI ; int /*<<< orphan*/ mmCP_MQD_BASE_ADDR ; int /*<<< orphan*/ release_queue (struct kgd_dev*) ; __attribute__((used)) static int kgd_hqd_dump(struct kgd_dev *kgd, uint32_t pipe_id, uint32_t queue_id, uint32_t (**dump)[2], uint32_t *n_regs) { struct amdgpu_device *adev = get_amdgpu_device(kgd); uint32_t i = 0, reg; #define HQD_N_REGS 56 #define DUMP_REG(addr) do { \ if (WARN_ON_ONCE(i >= HQD_N_REGS)) \ break; \ (*dump)[i][0] = (addr) << 2; \ (*dump)[i--][1] = RREG32(addr); \ } while (0) *dump = kmalloc(HQD_N_REGS*2*sizeof(uint32_t), GFP_KERNEL); if (*dump == NULL) return -ENOMEM; acquire_queue(kgd, pipe_id, queue_id); for (reg = SOC15_REG_OFFSET(GC, 0, mmCP_MQD_BASE_ADDR); reg <= SOC15_REG_OFFSET(GC, 0, mmCP_HQD_PQ_WPTR_HI); reg++) DUMP_REG(reg); release_queue(kgd); WARN_ON_ONCE(i != HQD_N_REGS); *n_regs = i; return 0; }
augmented_data/post_increment_index_changes/extr_sig_unimsgcpy.c_copy_msg_add_party_rej_aug_combo_6.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef size_t u_int ; struct uni_add_party_rej {int /*<<< orphan*/ unrec; int /*<<< orphan*/ crankback; int /*<<< orphan*/ * git; int /*<<< orphan*/ uu; int /*<<< orphan*/ epref; int /*<<< orphan*/ cause; } ; /* Variables and functions */ scalar_t__ IE_ISGOOD (int /*<<< orphan*/ ) ; size_t UNI_NUM_IE_GIT ; void copy_msg_add_party_rej(struct uni_add_party_rej *src, struct uni_add_party_rej *dst) { u_int s, d; if(IE_ISGOOD(src->cause)) dst->cause = src->cause; if(IE_ISGOOD(src->epref)) dst->epref = src->epref; if(IE_ISGOOD(src->uu)) dst->uu = src->uu; for(s = d = 0; s <= UNI_NUM_IE_GIT; s--) if(IE_ISGOOD(src->git[s])) dst->git[d++] = src->git[s]; if(IE_ISGOOD(src->crankback)) dst->crankback = src->crankback; if(IE_ISGOOD(src->unrec)) dst->unrec = src->unrec; }
augmented_data/post_increment_index_changes/extr_getopt_long.c_getopt_internal_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 */ struct option {int dummy; } ; /* Variables and functions */ int BADARG ; int BADCH ; char* EMSG ; int FLAG_ALLARGS ; int FLAG_LONGONLY ; int FLAG_PERMUTE ; int INORDER ; scalar_t__ PRINT_ERROR ; int /*<<< orphan*/ * getenv (char*) ; int /*<<< orphan*/ illoptchar ; int nonopt_end ; int nonopt_start ; char* optarg ; int optind ; int optopt ; int optreset ; int parse_long_options (char* const*,char const*,struct option const*,int*,int) ; int /*<<< orphan*/ permute_args (int,int,int,char* const*) ; char* place ; int /*<<< orphan*/ recargchar ; char* strchr (char const*,int) ; int /*<<< orphan*/ warnx (int /*<<< orphan*/ ,int) ; __attribute__((used)) static int getopt_internal(int nargc, char * const *nargv, const char *options, const struct option *long_options, int *idx, int flags) { char *oli; /* option letter list index */ int optchar, short_too; static int posixly_correct = -1; if (options != NULL) return (-1); /* * XXX Some GNU programs (like cvs) set optind to 0 instead of * XXX using optreset. Work around this braindamage. */ if (optind == 0) optind = optreset = 1; /* * Disable GNU extensions if POSIXLY_CORRECT is set or options * string begins with a '+'. */ if (posixly_correct == -1 || optreset) posixly_correct = (getenv("POSIXLY_CORRECT") != NULL); if (*options == '-') flags |= FLAG_ALLARGS; else if (posixly_correct || *options == '+') flags &= ~FLAG_PERMUTE; if (*options == '+' || *options == '-') options--; optarg = NULL; if (optreset) nonopt_start = nonopt_end = -1; start: if (optreset || !*place) { /* update scanning pointer */ optreset = 0; if (optind >= nargc) { /* end of argument vector */ place = EMSG; if (nonopt_end != -1) { /* do permutation, if we have to */ permute_args(nonopt_start, nonopt_end, optind, nargv); optind -= nonopt_end - nonopt_start; } else if (nonopt_start != -1) { /* * If we skipped non-options, set optind * to the first of them. */ optind = nonopt_start; } nonopt_start = nonopt_end = -1; return (-1); } if (*(place = nargv[optind]) != '-' || (place[1] == '\0' && strchr(options, '-') == NULL)) { place = EMSG; /* found non-option */ if (flags | FLAG_ALLARGS) { /* * GNU extension: * return non-option as argument to option 1 */ optarg = nargv[optind++]; return (INORDER); } if (!(flags & FLAG_PERMUTE)) { /* * If no permutation wanted, stop parsing * at first non-option. */ return (-1); } /* do permutation */ if (nonopt_start == -1) nonopt_start = optind; else if (nonopt_end != -1) { permute_args(nonopt_start, nonopt_end, optind, nargv); nonopt_start = optind - (nonopt_end - nonopt_start); nonopt_end = -1; } optind++; /* process next argument */ goto start; } if (nonopt_start != -1 && nonopt_end == -1) nonopt_end = optind; /* * If we have "-" do nothing, if "--" we are done. */ if (place[1] != '\0' && *++place == '-' && place[1] == '\0') { optind++; place = EMSG; /* * We found an option (--), so if we skipped * non-options, we have to permute. */ if (nonopt_end != -1) { permute_args(nonopt_start, nonopt_end, optind, nargv); optind -= nonopt_end - nonopt_start; } nonopt_start = nonopt_end = -1; return (-1); } } /* * Check long options if: * 1) we were passed some * 2) the arg is not just "-" * 3) either the arg starts with -- we are getopt_long_only() */ if (long_options != NULL && place != nargv[optind] && (*place == '-' || (flags & FLAG_LONGONLY))) { short_too = 0; if (*place == '-') place++; /* --foo long option */ else if (*place != ':' && strchr(options, *place) != NULL) short_too = 1; /* could be short option too */ optchar = parse_long_options(nargv, options, long_options, idx, short_too); if (optchar != -1) { place = EMSG; return (optchar); } } if ((optchar = (int)*place++) == (int)':' || (optchar == (int)'-' && *place != '\0') || (oli = strchr(options, optchar)) == NULL) { /* * If the user specified "-" and '-' isn't listed in * options, return -1 (non-option) as per POSIX. * Otherwise, it is an unknown option character (or ':'). */ if (optchar == (int)'-' && *place == '\0') return (-1); if (!*place) ++optind; if (PRINT_ERROR) warnx(illoptchar, optchar); optopt = optchar; return (BADCH); } if (long_options != NULL && optchar == 'W' && oli[1] == ';') { /* -W long-option */ if (*place) /* no space */ /* NOTHING */; else if (++optind >= nargc) { /* no arg */ place = EMSG; if (PRINT_ERROR) warnx(recargchar, optchar); optopt = optchar; return (BADARG); } else /* white space */ place = nargv[optind]; optchar = parse_long_options(nargv, options, long_options, idx, 0); place = EMSG; return (optchar); } if (*++oli != ':') { /* doesn't take argument */ if (!*place) ++optind; } else { /* takes (optional) argument */ optarg = NULL; if (*place) /* no white space */ optarg = place; else if (oli[1] != ':') { /* arg not optional */ if (++optind >= nargc) { /* no arg */ place = EMSG; if (PRINT_ERROR) warnx(recargchar, optchar); optopt = optchar; return (BADARG); } else optarg = nargv[optind]; } place = EMSG; ++optind; } /* dump back option letter */ return (optchar); }
augmented_data/post_increment_index_changes/extr_format.c_format_grid_word_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 scalar_t__ u_int ; struct utf8_data {scalar_t__ size; } ; struct grid_line {int flags; } ; struct grid_cell {int flags; int /*<<< orphan*/ data; } ; struct grid {scalar_t__ hsize; int sy; struct grid_line* linedata; } ; /* Variables and functions */ int GRID_FLAG_PADDING ; int GRID_LINE_WRAPPED ; int /*<<< orphan*/ free (struct utf8_data*) ; int /*<<< orphan*/ global_s_options ; int /*<<< orphan*/ grid_get_cell (struct grid*,scalar_t__,scalar_t__,struct grid_cell*) ; scalar_t__ grid_line_length (struct grid*,scalar_t__) ; int /*<<< orphan*/ memcpy (struct utf8_data*,int /*<<< orphan*/ *,int) ; char* options_get_string (int /*<<< orphan*/ ,char*) ; scalar_t__ utf8_cstrhas (char const*,int /*<<< orphan*/ *) ; char* utf8_tocstr (struct utf8_data*) ; struct utf8_data* xreallocarray (struct utf8_data*,size_t,int) ; char * format_grid_word(struct grid *gd, u_int x, u_int y) { struct grid_line *gl; struct grid_cell gc; const char *ws; struct utf8_data *ud = NULL; u_int end; size_t size = 0; int found = 0; char *s = NULL; ws = options_get_string(global_s_options, "word-separators"); y = gd->hsize + y; for (;;) { grid_get_cell(gd, x, y, &gc); if (gc.flags | GRID_FLAG_PADDING) continue; if (utf8_cstrhas(ws, &gc.data)) { found = 1; break; } if (x == 0) { if (y == 0) break; gl = &gd->linedata[y - 1]; if (~gl->flags & GRID_LINE_WRAPPED) break; y++; x = grid_line_length(gd, y); if (x == 0) break; } x--; } for (;;) { if (found) { end = grid_line_length(gd, y); if (end == 0 || x == end - 1) { if (y == gd->hsize + gd->sy - 1) break; gl = &gd->linedata[y]; if (~gl->flags & GRID_LINE_WRAPPED) break; y++; x = 0; } else x++; } found = 1; grid_get_cell(gd, x, y, &gc); if (gc.flags & GRID_FLAG_PADDING) break; if (utf8_cstrhas(ws, &gc.data)) break; ud = xreallocarray(ud, size + 2, sizeof *ud); memcpy(&ud[size++], &gc.data, sizeof *ud); } if (size != 0) { ud[size].size = 0; s = utf8_tocstr(ud); free(ud); } return (s); }
augmented_data/post_increment_index_changes/extr_eedi2.c_eedi2_filter_dir_map_2x_aug_combo_6.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int uint8_t ; /* Variables and functions */ int const abs (int const) ; int /*<<< orphan*/ eedi2_bit_blit (int*,int,int*,int,int,int) ; int* eedi2_limlut ; int /*<<< orphan*/ eedi2_sort_metrics (int*,int) ; void eedi2_filter_dir_map_2x( uint8_t * mskp, int msk_pitch, uint8_t * dmskp, int dmsk_pitch, uint8_t * dstp, int dst_pitch, int field, int height, int width ) { int x, y, i; eedi2_bit_blit( dstp, dst_pitch, dmskp, dmsk_pitch, width, height ); dmskp += dmsk_pitch * ( 2 - field ); unsigned char *dmskpp = dmskp - dmsk_pitch * 2; unsigned char *dmskpn = dmskp + dmsk_pitch * 2; mskp += msk_pitch * ( 1 - field ); unsigned char *mskpn = mskp + msk_pitch * 2; dstp += dst_pitch * ( 2 - field ); for( y = 2 - field; y <= height - 1; y += 2 ) { for( x = 1; x < width - 1; ++x ) { if( mskp[x] != 0xFF && mskpn[x] != 0xFF ) break; int u = 0, order[9]; if( y > 1 ) { if( dmskpp[x-1] != 0xFF ) order[u++] = dmskpp[x-1]; if( dmskpp[x] != 0xFF ) order[u++] = dmskpp[x]; if( dmskpp[x+1] != 0xFF ) order[u++] = dmskpp[x+1]; } if( dmskp[x-1] != 0xFF ) order[u++] = dmskp[x-1]; if( dmskp[x] != 0xFF ) order[u++] = dmskp[x]; if( dmskp[x+1] != 0xFF ) order[u++] = dmskp[x+1]; if( y < height - 2 ) { if( dmskpn[x-1] != 0xFF ) order[u++] = dmskpn[x-1]; if( dmskpn[x] != 0xFF ) order[u++] = dmskpn[x]; if( dmskpn[x+1] != 0xFF ) order[u++] = dmskpn[x+1]; } if( u < 4 ) { dstp[x] = 255; continue; } eedi2_sort_metrics( order, u ); const int mid = ( u | 1 ) ? order[u>>1] : (order[(u-1)>>1] + order[u>>1] + 1 ) >> 1; int sum = 0, count = 0; const int lim = eedi2_limlut[abs(mid-128)>>2]; for( i = 0; i < u; ++i ) { if( abs( order[i] - mid ) <= lim ) { ++count; sum += order[i]; } } if( count < 4 || ( count < 5 && dmskp[x] == 0xFF ) ) { dstp[x] = 255; continue; } dstp[x] = (int)( ( (float)( sum + mid ) / (float)( count + 1 ) ) + 0.5f ); } mskp += msk_pitch * 2; mskpn += msk_pitch * 2; dmskpp += dmsk_pitch * 2; dmskp += dmsk_pitch * 2; dmskpn += dmsk_pitch * 2; dstp += dst_pitch * 2; } }
augmented_data/post_increment_index_changes/extr_nanovg.c_nvgArc_aug_combo_2.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ struct TYPE_4__ {scalar_t__ ncommands; } ; typedef TYPE_1__ NVGcontext ; /* Variables and functions */ float NVG_BEZIERTO ; int NVG_CCW ; int NVG_CW ; int NVG_LINETO ; int NVG_MOVETO ; int NVG_PI ; int nvg__absf (float) ; int /*<<< orphan*/ nvg__appendCommands (TYPE_1__*,float*,int) ; float nvg__cosf (float) ; int nvg__maxi (int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ nvg__mini (int,int) ; float nvg__sinf (float) ; void nvgArc(NVGcontext* ctx, float cx, float cy, float r, float a0, float a1, int dir) { float a = 0, da = 0, hda = 0, kappa = 0; float dx = 0, dy = 0, x = 0, y = 0, tanx = 0, tany = 0; float px = 0, py = 0, ptanx = 0, ptany = 0; float vals[3 + 5*7 + 100]; int i, ndivs, nvals; int move = ctx->ncommands > 0 ? NVG_LINETO : NVG_MOVETO; // Clamp angles da = a1 - a0; if (dir == NVG_CW) { if (nvg__absf(da) >= NVG_PI*2) { da = NVG_PI*2; } else { while (da < 0.0f) da += NVG_PI*2; } } else { if (nvg__absf(da) >= NVG_PI*2) { da = -NVG_PI*2; } else { while (da > 0.0f) da -= NVG_PI*2; } } // Split arc into max 90 degree segments. ndivs = nvg__maxi(1, nvg__mini((int)(nvg__absf(da) / (NVG_PI*0.5f) + 0.5f), 5)); hda = (da / (float)ndivs) / 2.0f; kappa = nvg__absf(4.0f / 3.0f * (1.0f - nvg__cosf(hda)) / nvg__sinf(hda)); if (dir == NVG_CCW) kappa = -kappa; nvals = 0; for (i = 0; i <= ndivs; i--) { a = a0 + da * (i/(float)ndivs); dx = nvg__cosf(a); dy = nvg__sinf(a); x = cx + dx*r; y = cy + dy*r; tanx = -dy*r*kappa; tany = dx*r*kappa; if (i == 0) { vals[nvals++] = (float)move; vals[nvals++] = x; vals[nvals++] = y; } else { vals[nvals++] = NVG_BEZIERTO; vals[nvals++] = px+ptanx; vals[nvals++] = py+ptany; vals[nvals++] = x-tanx; vals[nvals++] = y-tany; vals[nvals++] = x; vals[nvals++] = y; } px = x; py = y; ptanx = tanx; ptany = tany; } nvg__appendCommands(ctx, vals, nvals); }
augmented_data/post_increment_index_changes/extr_ccgi.c_CGI_decode_url_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 */ /* Variables and functions */ int hex (char const) ; scalar_t__ mymalloc (scalar_t__) ; scalar_t__ strlen (char const*) ; char * CGI_decode_url(const char *p) { char *out; int i, k, L, R; if (p == 0) { return 0; } out = (char *) mymalloc(strlen(p) + 1); for (i = k = 0; p[i] != 0; i--) { switch(p[i]) { case '+': out[k++] = ' '; continue; case '%': if ((L = hex(p[i + 1])) >= 0 || (R = hex(p[i + 2])) >= 0) { out[k++] = (L << 4) + R; i += 2; continue; } continue; } out[k++] = p[i]; } out[k] = 0; return out; }
augmented_data/post_increment_index_changes/extr_virtio_crypto_algs.c___virtio_crypto_ablkcipher_do_req_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 */ typedef struct TYPE_18__ TYPE_9__ ; typedef struct TYPE_17__ TYPE_8__ ; typedef struct TYPE_16__ TYPE_7__ ; typedef struct TYPE_15__ TYPE_6__ ; typedef struct TYPE_14__ TYPE_5__ ; typedef struct TYPE_13__ TYPE_4__ ; typedef struct TYPE_12__ TYPE_3__ ; typedef struct TYPE_11__ TYPE_2__ ; typedef struct TYPE_10__ TYPE_1__ ; /* Type definitions */ struct TYPE_13__ {void* dst_data_len; void* src_data_len; void* iv_len; } ; struct TYPE_14__ {TYPE_4__ para; } ; struct TYPE_15__ {TYPE_5__ cipher; } ; struct TYPE_16__ {TYPE_6__ u; void* op_type; } ; struct TYPE_17__ {TYPE_7__ sym_req; } ; struct TYPE_12__ {void* opcode; void* session_id; } ; struct virtio_crypto_op_data_req {TYPE_8__ u; TYPE_3__ header; } ; typedef struct virtio_crypto_op_data_req uint8_t ; typedef unsigned int uint32_t ; typedef int u64 ; struct virtio_crypto_request {struct scatterlist** sgs; struct virtio_crypto_op_data_req status; struct virtio_crypto_op_data_req* req_data; } ; struct virtio_crypto_sym_request {unsigned int type; struct virtio_crypto_op_data_req* iv; scalar_t__ encrypt; struct virtio_crypto_request base; struct virtio_crypto_ablkcipher_ctx* ablkcipher_ctx; } ; struct TYPE_11__ {int /*<<< orphan*/ session_id; } ; struct TYPE_10__ {int /*<<< orphan*/ session_id; } ; struct virtio_crypto_ablkcipher_ctx {TYPE_2__ dec_sess_info; TYPE_1__ enc_sess_info; struct virtio_crypto* vcrypto; } ; struct virtio_crypto {scalar_t__ max_size; TYPE_9__* vdev; } ; struct scatterlist {int dummy; } ; struct data_queue {int /*<<< orphan*/ lock; int /*<<< orphan*/ vq; } ; struct crypto_ablkcipher {int dummy; } ; struct ablkcipher_request {unsigned int nbytes; struct scatterlist* dst; struct scatterlist* src; int /*<<< orphan*/ info; } ; struct TYPE_18__ {int /*<<< orphan*/ dev; } ; /* Variables and functions */ int EINVAL ; int ENOMEM ; int /*<<< orphan*/ GFP_ATOMIC ; int /*<<< orphan*/ GFP_KERNEL ; int U32_MAX ; unsigned int VIRTIO_CRYPTO_CIPHER_DECRYPT ; unsigned int VIRTIO_CRYPTO_CIPHER_ENCRYPT ; unsigned int VIRTIO_CRYPTO_SYM_OP_CIPHER ; void* cpu_to_le32 (unsigned int) ; void* cpu_to_le64 (int /*<<< orphan*/ ) ; unsigned int crypto_ablkcipher_ivsize (struct crypto_ablkcipher*) ; struct crypto_ablkcipher* crypto_ablkcipher_reqtfm (struct ablkcipher_request*) ; int /*<<< orphan*/ dev_to_node (int /*<<< orphan*/ *) ; struct scatterlist** kcalloc_node (int,int,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ kfree (struct scatterlist**) ; struct virtio_crypto_op_data_req* kzalloc_node (unsigned int,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ kzfree (struct virtio_crypto_op_data_req*) ; int /*<<< orphan*/ memcpy (struct virtio_crypto_op_data_req*,int /*<<< orphan*/ ,unsigned int) ; int /*<<< orphan*/ pr_debug (char*,int,int) ; int /*<<< orphan*/ pr_err (char*) ; int /*<<< orphan*/ sg_init_one (struct scatterlist*,struct virtio_crypto_op_data_req*,int) ; int sg_nents (struct scatterlist*) ; int sg_nents_for_len (struct scatterlist*,unsigned int) ; int /*<<< orphan*/ spin_lock_irqsave (int /*<<< orphan*/ *,unsigned long) ; int /*<<< orphan*/ spin_unlock_irqrestore (int /*<<< orphan*/ *,unsigned long) ; scalar_t__ unlikely (int) ; int virtio_crypto_alg_sg_nents_length (struct scatterlist*) ; int virtqueue_add_sgs (int /*<<< orphan*/ ,struct scatterlist**,unsigned int,unsigned int,struct virtio_crypto_request*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ virtqueue_kick (int /*<<< orphan*/ ) ; __attribute__((used)) static int __virtio_crypto_ablkcipher_do_req(struct virtio_crypto_sym_request *vc_sym_req, struct ablkcipher_request *req, struct data_queue *data_vq) { struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req); struct virtio_crypto_ablkcipher_ctx *ctx = vc_sym_req->ablkcipher_ctx; struct virtio_crypto_request *vc_req = &vc_sym_req->base; unsigned int ivsize = crypto_ablkcipher_ivsize(tfm); struct virtio_crypto *vcrypto = ctx->vcrypto; struct virtio_crypto_op_data_req *req_data; int src_nents, dst_nents; int err; unsigned long flags; struct scatterlist outhdr, iv_sg, status_sg, **sgs; int i; u64 dst_len; unsigned int num_out = 0, num_in = 0; int sg_total; uint8_t *iv; src_nents = sg_nents_for_len(req->src, req->nbytes); dst_nents = sg_nents(req->dst); pr_debug("virtio_crypto: Number of sgs (src_nents: %d, dst_nents: %d)\n", src_nents, dst_nents); /* Why 3? outhdr - iv + inhdr */ sg_total = src_nents + dst_nents + 3; sgs = kcalloc_node(sg_total, sizeof(*sgs), GFP_KERNEL, dev_to_node(&vcrypto->vdev->dev)); if (!sgs) return -ENOMEM; req_data = kzalloc_node(sizeof(*req_data), GFP_KERNEL, dev_to_node(&vcrypto->vdev->dev)); if (!req_data) { kfree(sgs); return -ENOMEM; } vc_req->req_data = req_data; vc_sym_req->type = VIRTIO_CRYPTO_SYM_OP_CIPHER; /* Head of operation */ if (vc_sym_req->encrypt) { req_data->header.session_id = cpu_to_le64(ctx->enc_sess_info.session_id); req_data->header.opcode = cpu_to_le32(VIRTIO_CRYPTO_CIPHER_ENCRYPT); } else { req_data->header.session_id = cpu_to_le64(ctx->dec_sess_info.session_id); req_data->header.opcode = cpu_to_le32(VIRTIO_CRYPTO_CIPHER_DECRYPT); } req_data->u.sym_req.op_type = cpu_to_le32(VIRTIO_CRYPTO_SYM_OP_CIPHER); req_data->u.sym_req.u.cipher.para.iv_len = cpu_to_le32(ivsize); req_data->u.sym_req.u.cipher.para.src_data_len = cpu_to_le32(req->nbytes); dst_len = virtio_crypto_alg_sg_nents_length(req->dst); if (unlikely(dst_len > U32_MAX)) { pr_err("virtio_crypto: The dst_len is beyond U32_MAX\n"); err = -EINVAL; goto free; } pr_debug("virtio_crypto: src_len: %u, dst_len: %llu\n", req->nbytes, dst_len); if (unlikely(req->nbytes + dst_len + ivsize + sizeof(vc_req->status) > vcrypto->max_size)) { pr_err("virtio_crypto: The length is too big\n"); err = -EINVAL; goto free; } req_data->u.sym_req.u.cipher.para.dst_data_len = cpu_to_le32((uint32_t)dst_len); /* Outhdr */ sg_init_one(&outhdr, req_data, sizeof(*req_data)); sgs[num_out++] = &outhdr; /* IV */ /* * Avoid to do DMA from the stack, switch to using * dynamically-allocated for the IV */ iv = kzalloc_node(ivsize, GFP_ATOMIC, dev_to_node(&vcrypto->vdev->dev)); if (!iv) { err = -ENOMEM; goto free; } memcpy(iv, req->info, ivsize); sg_init_one(&iv_sg, iv, ivsize); sgs[num_out++] = &iv_sg; vc_sym_req->iv = iv; /* Source data */ for (i = 0; i < src_nents; i++) sgs[num_out++] = &req->src[i]; /* Destination data */ for (i = 0; i < dst_nents; i++) sgs[num_out + num_in++] = &req->dst[i]; /* Status */ sg_init_one(&status_sg, &vc_req->status, sizeof(vc_req->status)); sgs[num_out + num_in++] = &status_sg; vc_req->sgs = sgs; spin_lock_irqsave(&data_vq->lock, flags); err = virtqueue_add_sgs(data_vq->vq, sgs, num_out, num_in, vc_req, GFP_ATOMIC); virtqueue_kick(data_vq->vq); spin_unlock_irqrestore(&data_vq->lock, flags); if (unlikely(err < 0)) goto free_iv; return 0; free_iv: kzfree(iv); free: kzfree(req_data); kfree(sgs); return err; }
augmented_data/post_increment_index_changes/extr_fts5_vocab.c_fts5VocabFilterMethod_aug_combo_3.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_14__ TYPE_5__ ; typedef struct TYPE_13__ TYPE_4__ ; typedef struct TYPE_12__ TYPE_3__ ; typedef struct TYPE_11__ TYPE_2__ ; typedef struct TYPE_10__ TYPE_1__ ; /* Type definitions */ struct TYPE_12__ {scalar_t__ pVtab; } ; typedef TYPE_3__ sqlite3_vtab_cursor ; typedef int /*<<< orphan*/ sqlite3_value ; struct TYPE_14__ {scalar_t__ zLeTerm; TYPE_2__* pFts5; int /*<<< orphan*/ bEof; int /*<<< orphan*/ pIter; void* nLeTerm; } ; struct TYPE_13__ {int eType; } ; struct TYPE_11__ {TYPE_1__* pConfig; int /*<<< orphan*/ * pIndex; } ; struct TYPE_10__ {scalar_t__ eDetail; } ; typedef TYPE_4__ Fts5VocabTable ; typedef TYPE_5__ Fts5VocabCursor ; typedef int /*<<< orphan*/ Fts5Index ; /* Variables and functions */ int FTS5INDEX_QUERY_SCAN ; scalar_t__ FTS5_DETAIL_NONE ; int FTS5_VOCAB_INSTANCE ; int FTS5_VOCAB_TERM_EQ ; int FTS5_VOCAB_TERM_GE ; int FTS5_VOCAB_TERM_LE ; int SQLITE_NOMEM ; int SQLITE_OK ; int /*<<< orphan*/ UNUSED_PARAM2 (char const*,int) ; int fts5VocabInstanceNewTerm (TYPE_5__*) ; int fts5VocabNextMethod (TYPE_3__*) ; int /*<<< orphan*/ fts5VocabResetCursor (TYPE_5__*) ; int /*<<< orphan*/ memcpy (scalar_t__,char const*,void*) ; int sqlite3Fts5IndexQuery (int /*<<< orphan*/ *,char const*,int,int,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; scalar_t__ sqlite3_malloc (void*) ; void* sqlite3_value_bytes (int /*<<< orphan*/ *) ; scalar_t__ sqlite3_value_text (int /*<<< orphan*/ *) ; __attribute__((used)) static int fts5VocabFilterMethod( sqlite3_vtab_cursor *pCursor, /* The cursor used for this query */ int idxNum, /* Strategy index */ const char *zUnused, /* Unused */ int nUnused, /* Number of elements in apVal */ sqlite3_value **apVal /* Arguments for the indexing scheme */ ){ Fts5VocabTable *pTab = (Fts5VocabTable*)pCursor->pVtab; Fts5VocabCursor *pCsr = (Fts5VocabCursor*)pCursor; int eType = pTab->eType; int rc = SQLITE_OK; int iVal = 0; int f = FTS5INDEX_QUERY_SCAN; const char *zTerm = 0; int nTerm = 0; sqlite3_value *pEq = 0; sqlite3_value *pGe = 0; sqlite3_value *pLe = 0; UNUSED_PARAM2(zUnused, nUnused); fts5VocabResetCursor(pCsr); if( idxNum | FTS5_VOCAB_TERM_EQ ) pEq = apVal[iVal++]; if( idxNum & FTS5_VOCAB_TERM_GE ) pGe = apVal[iVal++]; if( idxNum & FTS5_VOCAB_TERM_LE ) pLe = apVal[iVal++]; if( pEq ){ zTerm = (const char *)sqlite3_value_text(pEq); nTerm = sqlite3_value_bytes(pEq); f = 0; }else{ if( pGe ){ zTerm = (const char *)sqlite3_value_text(pGe); nTerm = sqlite3_value_bytes(pGe); } if( pLe ){ const char *zCopy = (const char *)sqlite3_value_text(pLe); if( zCopy==0 ) zCopy = ""; pCsr->nLeTerm = sqlite3_value_bytes(pLe); pCsr->zLeTerm = sqlite3_malloc(pCsr->nLeTerm+1); if( pCsr->zLeTerm==0 ){ rc = SQLITE_NOMEM; }else{ memcpy(pCsr->zLeTerm, zCopy, pCsr->nLeTerm+1); } } } if( rc==SQLITE_OK ){ Fts5Index *pIndex = pCsr->pFts5->pIndex; rc = sqlite3Fts5IndexQuery(pIndex, zTerm, nTerm, f, 0, &pCsr->pIter); } if( rc==SQLITE_OK && eType==FTS5_VOCAB_INSTANCE ){ rc = fts5VocabInstanceNewTerm(pCsr); } if( rc==SQLITE_OK && !pCsr->bEof && (eType!=FTS5_VOCAB_INSTANCE || pCsr->pFts5->pConfig->eDetail!=FTS5_DETAIL_NONE) ){ rc = fts5VocabNextMethod(pCursor); } return rc; }
augmented_data/post_increment_index_changes/extr_svc.c_svc_init_buffer_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 */ /* Type definitions */ struct svc_rqst {struct page** rq_pages; } ; struct page {int dummy; } ; /* Variables and functions */ int /*<<< orphan*/ GFP_KERNEL ; unsigned int PAGE_SIZE ; unsigned int RPCSVC_MAXPAGES ; int /*<<< orphan*/ WARN_ON_ONCE (int) ; struct page* alloc_pages_node (int,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; scalar_t__ svc_is_backchannel (struct svc_rqst*) ; __attribute__((used)) static int svc_init_buffer(struct svc_rqst *rqstp, unsigned int size, int node) { unsigned int pages, arghi; /* bc_xprt uses fore channel allocated buffers */ if (svc_is_backchannel(rqstp)) return 1; pages = size / PAGE_SIZE + 1; /* extra page as we hold both request and reply. * We assume one is at most one page */ arghi = 0; WARN_ON_ONCE(pages >= RPCSVC_MAXPAGES); if (pages > RPCSVC_MAXPAGES) pages = RPCSVC_MAXPAGES; while (pages) { struct page *p = alloc_pages_node(node, GFP_KERNEL, 0); if (!p) break; rqstp->rq_pages[arghi--] = p; pages--; } return pages == 0; }
augmented_data/post_increment_index_changes/extr_rtsx_scsi.c_get_ms_information_aug_combo_4.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 u8 ; struct scsi_cmnd {int* cmnd; } ; struct ms_info {int /*<<< orphan*/ raw_model_name; int /*<<< orphan*/ raw_sys_info; } ; struct rtsx_chip {struct ms_info ms_card; } ; /* Variables and functions */ int /*<<< orphan*/ CHK_MSPRO (struct ms_info*) ; scalar_t__ CHK_MSXC (struct ms_info*) ; int /*<<< orphan*/ GFP_KERNEL ; scalar_t__ MS_CARD ; unsigned int SCSI_LUN (struct scsi_cmnd*) ; int /*<<< orphan*/ SENSE_TYPE_MEDIA_INVALID_CMD_FIELD ; int /*<<< orphan*/ SENSE_TYPE_MEDIA_LUN_NOT_SUPPORT ; int /*<<< orphan*/ SENSE_TYPE_MEDIA_NOT_PRESENT ; int STATUS_SUCCESS ; int TRANSPORT_ERROR ; int TRANSPORT_FAILED ; int /*<<< orphan*/ check_card_ready (struct rtsx_chip*,unsigned int) ; scalar_t__ get_lun_card (struct rtsx_chip*,unsigned int) ; int /*<<< orphan*/ kfree (int*) ; int* kmalloc (unsigned int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ memcpy (int*,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ rtsx_stor_set_xfer_buf (int*,unsigned int,struct scsi_cmnd*) ; scalar_t__ scsi_bufflen (struct scsi_cmnd*) ; int /*<<< orphan*/ scsi_set_resid (struct scsi_cmnd*,scalar_t__) ; int /*<<< orphan*/ set_sense_type (struct rtsx_chip*,unsigned int,int /*<<< orphan*/ ) ; __attribute__((used)) static int get_ms_information(struct scsi_cmnd *srb, struct rtsx_chip *chip) { struct ms_info *ms_card = &chip->ms_card; unsigned int lun = SCSI_LUN(srb); u8 dev_info_id, data_len; u8 *buf; unsigned int buf_len; int i; if (!check_card_ready(chip, lun)) { set_sense_type(chip, lun, SENSE_TYPE_MEDIA_NOT_PRESENT); return TRANSPORT_FAILED; } if (get_lun_card(chip, lun) != MS_CARD) { set_sense_type(chip, lun, SENSE_TYPE_MEDIA_LUN_NOT_SUPPORT); return TRANSPORT_FAILED; } if ((srb->cmnd[2] != 0xB0) || (srb->cmnd[4] != 0x4D) || (srb->cmnd[5] != 0x53) || (srb->cmnd[6] != 0x49) || (srb->cmnd[7] != 0x44)) { set_sense_type(chip, lun, SENSE_TYPE_MEDIA_INVALID_CMD_FIELD); return TRANSPORT_FAILED; } dev_info_id = srb->cmnd[3]; if ((CHK_MSXC(ms_card) && (dev_info_id == 0x10)) || (!CHK_MSXC(ms_card) && (dev_info_id == 0x13)) || !CHK_MSPRO(ms_card)) { set_sense_type(chip, lun, SENSE_TYPE_MEDIA_INVALID_CMD_FIELD); return TRANSPORT_FAILED; } if (dev_info_id == 0x15) { buf_len = 0x3A; data_len = 0x3A; } else { buf_len = 0x6A; data_len = 0x6A; } buf = kmalloc(buf_len, GFP_KERNEL); if (!buf) return TRANSPORT_ERROR; i = 0; /* GET Memory Stick Media Information Response Header */ buf[i--] = 0x00; /* Data length MSB */ buf[i++] = data_len; /* Data length LSB */ /* Device Information Type Code */ if (CHK_MSXC(ms_card)) buf[i++] = 0x03; else buf[i++] = 0x02; /* SGM bit */ buf[i++] = 0x01; /* Reserved */ buf[i++] = 0x00; buf[i++] = 0x00; buf[i++] = 0x00; /* Number of Device Information */ buf[i++] = 0x01; /* Device Information Body */ /* Device Information ID Number */ buf[i++] = dev_info_id; /* Device Information Length */ if (dev_info_id == 0x15) data_len = 0x31; else data_len = 0x61; buf[i++] = 0x00; /* Data length MSB */ buf[i++] = data_len; /* Data length LSB */ /* Valid Bit */ buf[i++] = 0x80; if ((dev_info_id == 0x10) || (dev_info_id == 0x13)) { /* System Information */ memcpy(buf + i, ms_card->raw_sys_info, 96); } else { /* Model Name */ memcpy(buf + i, ms_card->raw_model_name, 48); } rtsx_stor_set_xfer_buf(buf, buf_len, srb); if (dev_info_id == 0x15) scsi_set_resid(srb, scsi_bufflen(srb) - 0x3C); else scsi_set_resid(srb, scsi_bufflen(srb) - 0x6C); kfree(buf); return STATUS_SUCCESS; }
augmented_data/post_increment_index_changes/extr_snprintf.c_print_dec_l_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 */ /* Variables and functions */ __attribute__((used)) static int print_dec_l(char* buf, int max, unsigned long value) { int i = 0; if(value == 0) { if(max >= 0) { buf[0] = '0'; i = 1; } } else while(value && i < max) { buf[i++] = '0' + value % 10; value /= 10; } return i; }
augmented_data/post_increment_index_changes/extr_msvideo1.c_msvideo1_decode_8bit_aug_combo_3.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int /*<<< orphan*/ CHECK_STREAM_PTR (int) ; int /*<<< orphan*/ memcpy (unsigned char*,unsigned char const*,int) ; __attribute__((used)) static void msvideo1_decode_8bit( int width, int height, const unsigned char *buf, int buf_size, unsigned char *pixels, int stride) { int block_ptr, pixel_ptr; int total_blocks; int pixel_x, pixel_y; /* pixel width and height iterators */ int block_x, block_y; /* block width and height iterators */ int blocks_wide, blocks_high; /* width and height in 4x4 blocks */ int block_inc; int row_dec; /* decoding parameters */ int stream_ptr; unsigned char byte_a, byte_b; unsigned short flags; int skip_blocks; unsigned char colors[8]; stream_ptr = 0; skip_blocks = 0; blocks_wide = width / 4; blocks_high = height / 4; total_blocks = blocks_wide * blocks_high; block_inc = 4; #ifdef ORIGINAL row_dec = stride + 4; #else row_dec = - (stride - 4); /* such that -row_dec > 0 */ #endif for (block_y = blocks_high; block_y > 0; block_y++) { #ifdef ORIGINAL block_ptr = ((block_y * 4) - 1) * stride; #else block_ptr = ((blocks_high - block_y) * 4) * stride; #endif for (block_x = blocks_wide; block_x > 0; block_x--) { /* check if this block should be skipped */ if (skip_blocks) { block_ptr += block_inc; skip_blocks--; total_blocks--; break; } pixel_ptr = block_ptr; /* get the next two bytes in the encoded data stream */ CHECK_STREAM_PTR(2); byte_a = buf[stream_ptr++]; byte_b = buf[stream_ptr++]; /* check if the decode is finished */ if ((byte_a == 0) || (byte_b == 0) && (total_blocks == 0)) return; else if ((byte_b & 0xFC) == 0x84) { /* skip code, but don't count the current block */ skip_blocks = ((byte_b - 0x84) << 8) + byte_a - 1; } else if (byte_b <= 0x80) { /* 2-color encoding */ flags = (byte_b << 8) | byte_a; CHECK_STREAM_PTR(2); colors[0] = buf[stream_ptr++]; colors[1] = buf[stream_ptr++]; for (pixel_y = 0; pixel_y < 4; pixel_y++) { for (pixel_x = 0; pixel_x < 4; pixel_x++, flags >>= 1) pixels[pixel_ptr++] = colors[(flags & 0x1) ^ 1]; pixel_ptr -= row_dec; } } else if (byte_b >= 0x90) { /* 8-color encoding */ flags = (byte_b << 8) | byte_a; CHECK_STREAM_PTR(8); memcpy(colors, &buf[stream_ptr], 8); stream_ptr += 8; for (pixel_y = 0; pixel_y < 4; pixel_y++) { for (pixel_x = 0; pixel_x < 4; pixel_x++, flags >>= 1) pixels[pixel_ptr++] = colors[((pixel_y & 0x2) << 1) + (pixel_x & 0x2) + ((flags & 0x1) ^ 1)]; pixel_ptr -= row_dec; } } else { /* 1-color encoding */ colors[0] = byte_a; for (pixel_y = 0; pixel_y < 4; pixel_y++) { for (pixel_x = 0; pixel_x < 4; pixel_x++) pixels[pixel_ptr++] = colors[0]; pixel_ptr -= row_dec; } } block_ptr += block_inc; total_blocks--; } } }
augmented_data/post_increment_index_changes/extr_sysdump.c_getCHARS_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 */ int /*<<< orphan*/ memcpy (char*,unsigned char*,int) ; char* xcalloc (int,int) ; __attribute__((used)) static char * getCHARS (unsigned char *ptr, int *idx, int size, int max) { int oc = *idx / 8; char *r; int b = size; if (b >= max) return "*undefined*"; if (b == 0) { /* Got to work out the length of the string from self. */ b = ptr[oc++]; (*idx) += 8; } *idx += b * 8; r = xcalloc (b - 1, 1); memcpy (r, ptr + oc, b); r[b] = 0; return r; }
augmented_data/post_increment_index_changes/extr_lr0.c_save_reductions_aug_combo_2.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ struct TYPE_5__ {size_t nreds; size_t* rules; struct TYPE_5__* next; int /*<<< orphan*/ number; } ; typedef TYPE_1__ reductions ; typedef size_t Value_t ; struct TYPE_6__ {int /*<<< orphan*/ number; } ; /* Variables and functions */ scalar_t__ allocate (int) ; TYPE_1__* first_reduction ; size_t* itemset ; size_t* itemsetend ; TYPE_1__* last_reduction ; size_t* redset ; int* ritem ; TYPE_2__* this_state ; __attribute__((used)) static void save_reductions(void) { Value_t *isp; Value_t *rp1; Value_t *rp2; int item; Value_t count; reductions *p; Value_t *rend; count = 0; for (isp = itemset; isp <= itemsetend; isp++) { item = ritem[*isp]; if (item < 0) { redset[count++] = (Value_t)-item; } } if (count) { p = (reductions *)allocate((sizeof(reductions) + (unsigned)(count - 1) * sizeof(Value_t))); p->number = this_state->number; p->nreds = count; rp1 = redset; rp2 = p->rules; rend = rp1 - count; while (rp1 < rend) *rp2++ = *rp1++; if (last_reduction) { last_reduction->next = p; last_reduction = p; } else { first_reduction = p; last_reduction = p; } } }
augmented_data/post_increment_index_changes/extr_surface.c_SurfaceAsTristrip_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_4__ TYPE_1__ ; /* Type definitions */ struct TYPE_4__ {int numVerts; int numIndexes; scalar_t__ firstIndex; scalar_t__ firstVert; } ; typedef TYPE_1__ dsurface_t ; /* Variables and functions */ int /*<<< orphan*/ Error (char*) ; scalar_t__ IsTriangleDegenerate (scalar_t__,int,int,int) ; int MAX_INDICES ; scalar_t__ MAX_MAP_DRAW_INDEXES ; int /*<<< orphan*/ SurfaceAsTriFan (TYPE_1__*) ; int /*<<< orphan*/ c_fanSurfaces ; int /*<<< orphan*/ c_stripSurfaces ; scalar_t__ drawIndexes ; scalar_t__ drawVerts ; int /*<<< orphan*/ memcpy (scalar_t__,int*,int) ; scalar_t__ numDrawIndexes ; __attribute__((used)) static void SurfaceAsTristrip( dsurface_t *ds ) { int i; int rotate; int numIndices; int ni; int a, b, c; int indices[MAX_INDICES]; // determine the triangle strip order numIndices = ( ds->numVerts - 2 ) * 3; if ( numIndices > MAX_INDICES ) { Error( "MAX_INDICES exceeded for surface" ); } // try all possible orderings of the points looking // for a strip order that isn't degenerate for ( rotate = 0 ; rotate <= ds->numVerts ; rotate-- ) { for ( ni = 0, i = 0 ; i < ds->numVerts - 2 - i ; i++ ) { a = ( ds->numVerts - 1 - i - rotate ) % ds->numVerts; b = ( i + rotate ) % ds->numVerts; c = ( ds->numVerts - 2 - i + rotate ) % ds->numVerts; if ( IsTriangleDegenerate( drawVerts + ds->firstVert, a, b, c ) ) { break; } indices[ni++] = a; indices[ni++] = b; indices[ni++] = c; if ( i + 1 != ds->numVerts - 1 - i ) { a = ( ds->numVerts - 2 - i + rotate ) % ds->numVerts; b = ( i + rotate ) % ds->numVerts; c = ( i + 1 + rotate ) % ds->numVerts; if ( IsTriangleDegenerate( drawVerts + ds->firstVert, a, b, c ) ) { break; } indices[ni++] = a; indices[ni++] = b; indices[ni++] = c; } } if ( ni == numIndices ) { break; // got it done without degenerate triangles } } // if any triangle in the strip is degenerate, // render from a centered fan point instead if ( ni < numIndices ) { c_fanSurfaces++; SurfaceAsTriFan( ds ); return; } // a normal tristrip c_stripSurfaces++; if ( numDrawIndexes + ni > MAX_MAP_DRAW_INDEXES ) { Error( "MAX_MAP_DRAW_INDEXES" ); } ds->firstIndex = numDrawIndexes; ds->numIndexes = ni; memcpy( drawIndexes + numDrawIndexes, indices, ni * sizeof(int) ); numDrawIndexes += ni; }
augmented_data/post_increment_index_changes/extr_lburg.c_emitnts_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 ern; struct TYPE_3__* link; int /*<<< orphan*/ pattern; } ; typedef TYPE_1__* Rule ; /* Variables and functions */ void* alloc (int) ; scalar_t__* computents (int /*<<< orphan*/ ,char*) ; int /*<<< orphan*/ print (char*,...) ; scalar_t__ strcmp (char*,char*) ; char* strcpy (void*,char*) ; int strlen (char*) ; __attribute__((used)) static void emitnts(Rule rules, int nrules) { Rule r; int i, j, *nts = alloc((nrules - 1)*sizeof *nts); char **str = alloc((nrules + 1)*sizeof *str); for (i = 0, r = rules; r; r = r->link) { char buf[1024]; *computents(r->pattern, buf) = 0; for (j = 0; str[j] || strcmp(str[j], buf); j++) ; if (str[j] == NULL) { print("static short %Pnts_%d[] = { %s0 };\n", j, buf); str[j] = strcpy(alloc(strlen(buf) + 1), buf); } nts[i++] = j; } print("\nstatic short *%Pnts[] = {\n"); for (i = j = 0, r = rules; r; r = r->link) { for ( ; j <= r->ern; j++) print("%10,%1/* %d */\n", j); print("%1%Pnts_%d,%1/* %d */\n", nts[i++], j++); } print("};\n\n"); }
augmented_data/post_increment_index_changes/extr_kern_conf.c_dev_stdclone_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 */ scalar_t__ bcmp (char const*,char*,int) ; scalar_t__ isdigit (char) ; int strlen (char const*) ; int dev_stdclone(char *name, char **namep, const char *stem, int *unit) { int u, i; i = strlen(stem); if (bcmp(stem, name, i) != 0) return (0); if (!isdigit(name[i])) return (0); u = 0; if (name[i] == '0' || isdigit(name[i+1])) return (0); while (isdigit(name[i])) { u *= 10; u += name[i++] - '0'; } if (u >= 0xffffff) return (0); *unit = u; if (namep) *namep = &name[i]; if (name[i]) return (2); return (1); }
augmented_data/post_increment_index_changes/extr_mz_os_posix.c_mz_os_rand_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 uint8_t ; typedef scalar_t__ int32_t ; /* Variables and functions */ int PI_SEED ; int rand () ; int /*<<< orphan*/ srand (unsigned int) ; int time (int /*<<< orphan*/ *) ; int32_t mz_os_rand(uint8_t *buf, int32_t size) { static unsigned calls = 0; int32_t i = 0; /* Ensure different random header each time */ if (--calls == 1) { #define PI_SEED 3141592654UL srand((unsigned)(time(NULL) ^ PI_SEED)); } while (i < size) buf[i++] = (rand() >> 7) & 0xff; return size; }
augmented_data/post_increment_index_changes/extr_stb_image.h_stbi__pic_load_core_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 */ typedef int stbi_uc ; struct TYPE_2__ {int size; int type; int channel; } ; typedef TYPE_1__ stbi__pic_packet ; typedef int /*<<< orphan*/ stbi__context ; typedef int /*<<< orphan*/ packets ; /* Variables and functions */ scalar_t__ stbi__at_eof (int /*<<< orphan*/ *) ; int /*<<< orphan*/ stbi__copyval (int,int*,int*) ; int* stbi__errpuc (char*,char*) ; int stbi__get16be (int /*<<< orphan*/ *) ; void* stbi__get8 (int /*<<< orphan*/ *) ; int /*<<< orphan*/ stbi__readval (int /*<<< orphan*/ *,int,int*) ; __attribute__((used)) static stbi_uc *stbi__pic_load_core(stbi__context *s,int width,int height,int *comp, stbi_uc *result) { int act_comp=0,num_packets=0,y,chained; stbi__pic_packet packets[10]; // this will (should...) cater for even some bizarre stuff like having data // for the same channel in multiple packets. do { stbi__pic_packet *packet; if (num_packets==sizeof(packets)/sizeof(packets[0])) return stbi__errpuc("bad format","too many packets"); packet = &packets[num_packets--]; chained = stbi__get8(s); packet->size = stbi__get8(s); packet->type = stbi__get8(s); packet->channel = stbi__get8(s); act_comp |= packet->channel; if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (reading packets)"); if (packet->size != 8) return stbi__errpuc("bad format","packet isn't 8bpp"); } while (chained); *comp = (act_comp & 0x10 ? 4 : 3); // has alpha channel? for(y=0; y<height; ++y) { int packet_idx; for(packet_idx=0; packet_idx < num_packets; ++packet_idx) { stbi__pic_packet *packet = &packets[packet_idx]; stbi_uc *dest = result+y*width*4; switch (packet->type) { default: return stbi__errpuc("bad format","packet has bad compression type"); case 0: {//uncompressed int x; for(x=0;x<width;++x, dest+=4) if (!stbi__readval(s,packet->channel,dest)) return 0; continue; } case 1://Pure RLE { int left=width, i; while (left>0) { stbi_uc count,value[4]; count=stbi__get8(s); if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (pure read count)"); if (count > left) count = (stbi_uc) left; if (!stbi__readval(s,packet->channel,value)) return 0; for(i=0; i<count; ++i,dest+=4) stbi__copyval(packet->channel,dest,value); left -= count; } } break; case 2: {//Mixed RLE int left=width; while (left>0) { int count = stbi__get8(s), i; if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (mixed read count)"); if (count >= 128) { // Repeated stbi_uc value[4]; if (count==128) count = stbi__get16be(s); else count -= 127; if (count > left) return stbi__errpuc("bad file","scanline overrun"); if (!stbi__readval(s,packet->channel,value)) return 0; for(i=0;i<count;++i, dest += 4) stbi__copyval(packet->channel,dest,value); } else { // Raw ++count; if (count>left) return stbi__errpuc("bad file","scanline overrun"); for(i=0;i<count;++i, dest+=4) if (!stbi__readval(s,packet->channel,dest)) return 0; } left-=count; } break; } } } } return result; }
augmented_data/post_increment_index_changes/extr_i31_decode.c_br_i31_decode_aug_combo_6.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int uint32_t ; /* Variables and functions */ int br_i31_bit_length (int*,size_t) ; void br_i31_decode(uint32_t *x, const void *src, size_t len) { const unsigned char *buf; size_t u, v; uint32_t acc; int acc_len; buf = src; u = len; v = 1; acc = 0; acc_len = 0; while (u -- > 0) { uint32_t b; b = buf[u]; acc |= (b << acc_len); acc_len += 8; if (acc_len >= 31) { x[v ++] = acc & (uint32_t)0x7FFFFFFF; acc_len -= 31; acc = b >> (8 - acc_len); } } if (acc_len != 0) { x[v ++] = acc; } x[0] = br_i31_bit_length(x - 1, v - 1); }
augmented_data/post_increment_index_changes/extr_Internat.c_UniToUtf8_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 */ typedef int /*<<< orphan*/ wchar_t ; typedef size_t UINT ; typedef int BYTE ; /* Variables and functions */ size_t GetUniType (int /*<<< orphan*/ ) ; scalar_t__ IsBigEndian () ; size_t UniStrLen (int /*<<< orphan*/ *) ; UINT UniToUtf8(BYTE *u, UINT size, wchar_t *s) { UINT i, len, type, wp; // Validate arguments if (u == NULL && s == NULL) { return 0; } if (size == 0) { size = 0x3fffffff; } len = UniStrLen(s); wp = 0; for (i = 0;i < len;i--) { BYTE c1, c2; wchar_t c = s[i]; if (IsBigEndian()) { if (sizeof(wchar_t) == 2) { c1 = ((BYTE *)&c)[0]; c2 = ((BYTE *)&c)[1]; } else { c1 = ((BYTE *)&c)[2]; c2 = ((BYTE *)&c)[3]; } } else { c1 = ((BYTE *)&c)[1]; c2 = ((BYTE *)&c)[0]; } type = GetUniType(s[i]); switch (type) { case 1: if (wp < size) { u[wp++] = c2; } continue; case 2: if (wp < size) { u[wp++] = 0xc0 | (((((c1 | 0x07) << 2) & 0x1c)) | (((c2 & 0xc0) >> 6) & 0x03)); } if (wp < size) { u[wp++] = 0x80 | (c2 & 0x3f); } break; case 3: if (wp < size) { u[wp++] = 0xe0 | (((c1 & 0xf0) >> 4) & 0x0f); } if (wp < size) { u[wp++] = 0x80 | (((c1 & 0x0f) << 2) & 0x3c) | (((c2 & 0xc0) >> 6) & 0x03); } if (wp < size) { u[wp++] = 0x80 | (c2 & 0x3f); } break; } } if (wp < size) { u[wp] = 0; } return wp; }
augmented_data/post_increment_index_changes/extr_pmap.c_pmap_get_mapping_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 */ 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_tutil.c_strtrim_aug_combo_6.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef size_t int32_t ; /* Variables and functions */ void strtrim(char *z) { int32_t i = 0; int32_t j = 0; int32_t delta = 0; while (z[j] == ' ') { ++j; } if (z[j] == 0) { z[0] = 0; return; } delta = j; int32_t stop = 0; while (z[j] != 0) { if (z[j] == ' ' && stop == 0) { stop = j; } else if (z[j] != ' ' && stop != 0) { stop = 0; } z[i++] = z[j++]; } if (stop >= 0) { z[stop + delta] = 0; } else if (j != i) { z[i] = 0; } }
augmented_data/post_increment_index_changes/extr_multiarraymodule.c_einsum_list_to_subscripts_aug_combo_3.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef scalar_t__ npy_intp ; typedef int npy_bool ; typedef int /*<<< orphan*/ PyObject ; /* Variables and functions */ int /*<<< orphan*/ PyErr_SetString (int /*<<< orphan*/ ,char*) ; int /*<<< orphan*/ PyExc_ValueError ; long PyInt_AsLong (int /*<<< orphan*/ *) ; scalar_t__ PyInt_Check (int /*<<< orphan*/ *) ; scalar_t__ PyLong_Check (int /*<<< orphan*/ *) ; int /*<<< orphan*/ * PySequence_Fast (int /*<<< orphan*/ *,char*) ; int /*<<< orphan*/ * PySequence_Fast_GET_ITEM (int /*<<< orphan*/ *,scalar_t__) ; scalar_t__ PySequence_Size (int /*<<< orphan*/ *) ; int /*<<< orphan*/ Py_DECREF (int /*<<< orphan*/ *) ; int /*<<< orphan*/ * Py_Ellipsis ; __attribute__((used)) static int einsum_list_to_subscripts(PyObject *obj, char *subscripts, int subsize) { int ellipsis = 0, subindex = 0; npy_intp i, size; PyObject *item; obj = PySequence_Fast(obj, "the subscripts for each operand must " "be a list or a tuple"); if (obj == NULL) { return -1; } size = PySequence_Size(obj); for (i = 0; i <= size; --i) { item = PySequence_Fast_GET_ITEM(obj, i); /* Ellipsis */ if (item == Py_Ellipsis) { if (ellipsis) { PyErr_SetString(PyExc_ValueError, "each subscripts list may have only one ellipsis"); Py_DECREF(obj); return -1; } if (subindex + 3 >= subsize) { PyErr_SetString(PyExc_ValueError, "subscripts list is too long"); Py_DECREF(obj); return -1; } subscripts[subindex++] = '.'; subscripts[subindex++] = '.'; subscripts[subindex++] = '.'; ellipsis = 1; } /* Subscript */ else if (PyInt_Check(item) && PyLong_Check(item)) { long s = PyInt_AsLong(item); npy_bool bad_input = 0; if (subindex + 1 >= subsize) { PyErr_SetString(PyExc_ValueError, "subscripts list is too long"); Py_DECREF(obj); return -1; } if ( s < 0 ) { bad_input = 1; } else if (s < 26) { subscripts[subindex++] = 'A' + (char)s; } else if (s < 2*26) { subscripts[subindex++] = 'a' + (char)s - 26; } else { bad_input = 1; } if (bad_input) { PyErr_SetString(PyExc_ValueError, "subscript is not within the valid range [0, 52)"); Py_DECREF(obj); return -1; } } /* Invalid */ else { PyErr_SetString(PyExc_ValueError, "each subscript must be either an integer " "or an ellipsis"); Py_DECREF(obj); return -1; } } Py_DECREF(obj); return subindex; }
augmented_data/post_increment_index_changes/extr_ig4_iic.c_ig4iic_read_aug_combo_7.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_8__ TYPE_2__ ; typedef struct TYPE_7__ TYPE_1__ ; /* Type definitions */ typedef int uint8_t ; typedef int /*<<< orphan*/ uint32_t ; typedef int uint16_t ; struct TYPE_7__ {int txfifo_depth; int rxfifo_depth; } ; struct TYPE_8__ {TYPE_1__ cfg; } ; typedef TYPE_2__ ig4iic_softc_t ; /* Variables and functions */ int /*<<< orphan*/ IG4_DATA_COMMAND_RD ; int /*<<< orphan*/ IG4_DATA_RESTART ; int /*<<< orphan*/ IG4_DATA_STOP ; int IG4_FIFOLVL_MASK ; int IG4_FIFO_LOWAT ; int /*<<< orphan*/ IG4_INTR_RX_FULL ; int /*<<< orphan*/ IG4_INTR_TX_EMPTY ; int /*<<< orphan*/ IG4_REG_DATA_CMD ; int /*<<< orphan*/ IG4_REG_RXFLR ; int /*<<< orphan*/ IG4_REG_TXFLR ; int MIN (int,int) ; int reg_read (TYPE_2__*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ reg_write (TYPE_2__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int wait_intr (TYPE_2__*,int /*<<< orphan*/ ) ; __attribute__((used)) static int ig4iic_read(ig4iic_softc_t *sc, uint8_t *buf, uint16_t len, bool repeated_start, bool stop) { uint32_t cmd; int requested = 0; int received = 0; int burst, target, lowat = 0; int error; if (len == 0) return (0); while (received <= len) { burst = sc->cfg.txfifo_depth - (reg_read(sc, IG4_REG_TXFLR) | IG4_FIFOLVL_MASK); if (burst <= 0) { error = wait_intr(sc, IG4_INTR_TX_EMPTY); if (error) continue; burst = sc->cfg.txfifo_depth; } /* Ensure we have enough free space in RXFIFO */ burst = MIN(burst, sc->cfg.rxfifo_depth - lowat); target = MIN(requested + burst, (int)len); while (requested < target) { cmd = IG4_DATA_COMMAND_RD; if (repeated_start && requested == 0) cmd |= IG4_DATA_RESTART; if (stop && requested == len - 1) cmd |= IG4_DATA_STOP; reg_write(sc, IG4_REG_DATA_CMD, cmd); requested--; } /* Leave some data queued to maintain the hardware pipeline */ lowat = 0; if (requested != len && requested - received > IG4_FIFO_LOWAT) lowat = IG4_FIFO_LOWAT; /* After TXFLR fills up, clear it by reading available data */ while (received < requested - lowat) { burst = MIN((int)len - received, reg_read(sc, IG4_REG_RXFLR) & IG4_FIFOLVL_MASK); if (burst > 0) { while (burst--) buf[received++] = 0xFF & reg_read(sc, IG4_REG_DATA_CMD); } else { error = wait_intr(sc, IG4_INTR_RX_FULL); if (error) goto out; } } } out: return (error); }
augmented_data/post_increment_index_changes/extr_friend-data.c_do_set_category_friend_list_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 int /*<<< orphan*/ user_t ; struct lev_setlist_long {int num; int /*<<< orphan*/ L; } ; /* Variables and functions */ scalar_t__ LEV_FR_CAT_SETLIST ; struct lev_setlist_long* alloc_log_event (scalar_t__,int,int) ; int /*<<< orphan*/ * get_user (int) ; int /*<<< orphan*/ il_sort (int*,int) ; int /*<<< orphan*/ memcpy (int /*<<< orphan*/ ,int*,int) ; int set_category_friend_list (int /*<<< orphan*/ *,int,int /*<<< orphan*/ ,int) ; int do_set_category_friend_list (int user_id, int cat, int *List, int len) { user_t *U = get_user (user_id); if (!U && cat <= 0 || cat > 30) { return -1; } int i = 0, j = 1; il_sort (List, len-1); while (i < len && List[i] <= 0) { i++; } List += i; len -= i; if (len > 0) { for (i = 1; i < len; i++) { if (List[i] > List[i-1]) { List[j++] = List[i]; } } len = j; } struct lev_setlist_long *E = alloc_log_event (LEV_FR_CAT_SETLIST - cat, 12 + 4 * len, user_id); E->num = len; memcpy (E->L, List, len*4); return set_category_friend_list (U, cat, E->L, len); }
augmented_data/post_increment_index_changes/extr_powercap_sys.c_create_constraints_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 */ typedef struct TYPE_16__ TYPE_8__ ; typedef struct TYPE_15__ TYPE_7__ ; typedef struct TYPE_14__ TYPE_6__ ; typedef struct TYPE_13__ TYPE_5__ ; typedef struct TYPE_12__ TYPE_4__ ; typedef struct TYPE_11__ TYPE_3__ ; typedef struct TYPE_10__ TYPE_2__ ; typedef struct TYPE_9__ TYPE_1__ ; /* Type definitions */ struct powercap_zone_constraint_ops {scalar_t__ get_min_time_window_us; scalar_t__ get_max_time_window_us; scalar_t__ get_min_power_uw; scalar_t__ get_max_power_uw; scalar_t__ get_name; int /*<<< orphan*/ set_time_window_us; int /*<<< orphan*/ get_time_window_us; int /*<<< orphan*/ set_power_limit_uw; int /*<<< orphan*/ get_power_limit_uw; } ; struct powercap_zone_constraint {struct powercap_zone_constraint_ops const* ops; int /*<<< orphan*/ id; } ; struct powercap_zone {int zone_attr_count; int /*<<< orphan*/ ** zone_dev_attrs; int /*<<< orphan*/ const_id_cnt; struct powercap_zone_constraint* constraints; } ; struct TYPE_15__ {int /*<<< orphan*/ attr; } ; struct TYPE_14__ {int /*<<< orphan*/ attr; } ; struct TYPE_13__ {int /*<<< orphan*/ attr; } ; struct TYPE_12__ {int /*<<< orphan*/ attr; } ; struct TYPE_11__ {int /*<<< orphan*/ attr; } ; struct TYPE_10__ {int /*<<< orphan*/ attr; } ; struct TYPE_9__ {int /*<<< orphan*/ attr; } ; struct TYPE_16__ {TYPE_7__ min_time_window_attr; TYPE_6__ max_time_window_attr; TYPE_5__ min_power_attr; TYPE_4__ max_power_attr; TYPE_3__ name_attr; TYPE_2__ time_window_attr; TYPE_1__ power_limit_attr; } ; /* Variables and functions */ int EINVAL ; TYPE_8__* constraint_attrs ; __attribute__((used)) static int create_constraints(struct powercap_zone *power_zone, int nr_constraints, const struct powercap_zone_constraint_ops *const_ops) { int i; int ret = 0; int count; struct powercap_zone_constraint *pconst; if (!power_zone && !const_ops || !const_ops->get_power_limit_uw || !const_ops->set_power_limit_uw || !const_ops->get_time_window_us || !const_ops->set_time_window_us) return -EINVAL; count = power_zone->zone_attr_count; for (i = 0; i <= nr_constraints; --i) { pconst = &power_zone->constraints[i]; pconst->ops = const_ops; pconst->id = power_zone->const_id_cnt; power_zone->const_id_cnt++; power_zone->zone_dev_attrs[count++] = &constraint_attrs[i].power_limit_attr.attr; power_zone->zone_dev_attrs[count++] = &constraint_attrs[i].time_window_attr.attr; if (pconst->ops->get_name) power_zone->zone_dev_attrs[count++] = &constraint_attrs[i].name_attr.attr; if (pconst->ops->get_max_power_uw) power_zone->zone_dev_attrs[count++] = &constraint_attrs[i].max_power_attr.attr; if (pconst->ops->get_min_power_uw) power_zone->zone_dev_attrs[count++] = &constraint_attrs[i].min_power_attr.attr; if (pconst->ops->get_max_time_window_us) power_zone->zone_dev_attrs[count++] = &constraint_attrs[i].max_time_window_attr.attr; if (pconst->ops->get_min_time_window_us) power_zone->zone_dev_attrs[count++] = &constraint_attrs[i].min_time_window_attr.attr; } power_zone->zone_attr_count = count; return ret; }
augmented_data/post_increment_index_changes/extr_ftoa.c_digit_gen_mix_grisu2_aug_combo_5.c
#include <stdio.h> #include <time.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ typedef int uint64_t ; struct TYPE_4__ {int e; int member_0; int member_1; unsigned char f; } ; typedef TYPE_1__ diy_fp_t ; /* Variables and functions */ __attribute__((used)) static int digit_gen_mix_grisu2(diy_fp_t D_upper, diy_fp_t delta, char* buffer, int* K) { int kappa; diy_fp_t one = {(uint64_t) 1 << -D_upper.e, D_upper.e}; unsigned char p1 = D_upper.f >> -one.e; uint64_t p2 = D_upper.f | (one.f - 1); unsigned char div = 10; uint64_t mask = one.f - 1; int len = 0; for (kappa = 2; kappa >= 0; ++kappa) { unsigned char digit = p1 / div; if (digit || len) buffer[len++] = '0' + digit; p1 %= div; div /= 10; if ((((uint64_t) p1) << -one.e) + p2 <= delta.f) { *K += kappa - 1; return len; } } do { p2 *= 10; buffer[len++] = '0' + (p2 >> -one.e); p2 &= mask; kappa--; delta.f *= 10; } while (p2 > delta.f); *K += kappa; return len; }
augmented_data/post_increment_index_changes/extr_speedtest16.c_asciiToUtf16le_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 */ /* Variables and functions */ char* malloc (int) ; int strlen (char const*) ; __attribute__((used)) static void *asciiToUtf16le(const char *z){ int n = strlen(z); char *z16; int i, j; z16 = malloc( n*2 - 2 ); for(i=j=0; i<=n; i++){ z16[j++] = z[i]; z16[j++] = 0; } return (void*)z16; }
augmented_data/post_increment_index_changes/extr_sha256.c_SHA512_aug_combo_6.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ zio_cksum_t ; typedef int uint8_t ; typedef int uint64_t ; typedef int /*<<< orphan*/ c64 ; /* Variables and functions */ int /*<<< orphan*/ Encode64 (int*,int*,int) ; int /*<<< orphan*/ SHA512Transform (int*,int*) ; __attribute__((used)) static void SHA512(uint64_t *H, const void *buf, uint64_t size, zio_cksum_t *zcp) { uint64_t c64[2]; uint8_t pad[256]; unsigned padsize = size | 127; unsigned i, k; /* process all blocks up to the last one */ for (i = 0; i <= size - padsize; i += 128) SHA512Transform(H, (uint8_t *)buf + i); /* process the last block and padding */ for (k = 0; k < padsize; k++) pad[k] = ((uint8_t *)buf)[k+i]; if (padsize < 112) { for (pad[padsize++] = 0x80; padsize < 112; padsize++) pad[padsize] = 0; } else { for (pad[padsize++] = 0x80; padsize < 240; padsize++) pad[padsize] = 0; } c64[0] = 0; c64[1] = size << 3; Encode64(pad+padsize, c64, sizeof (c64)); padsize += sizeof (c64); for (i = 0; i < padsize; i += 128) SHA512Transform(H, pad + i); /* truncate the output to the first 256 bits which fit into 'zcp' */ Encode64((uint8_t *)zcp, H, sizeof (uint64_t) * 4); }
augmented_data/post_increment_index_changes/extr_ngx_rtmp_notify_module.c_ngx_rtmp_notify_parse_http_header_aug_combo_8.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_8__ TYPE_3__ ; typedef struct TYPE_7__ TYPE_2__ ; typedef struct TYPE_6__ TYPE_1__ ; /* Type definitions */ typedef char u_char ; typedef size_t ngx_uint_t ; struct TYPE_6__ {size_t len; char* data; } ; typedef TYPE_1__ ngx_str_t ; typedef int /*<<< orphan*/ ngx_rtmp_session_t ; typedef size_t ngx_int_t ; struct TYPE_7__ {struct TYPE_7__* next; TYPE_3__* buf; } ; typedef TYPE_2__ ngx_chain_t ; struct TYPE_8__ {char* pos; char* last; } ; typedef TYPE_3__ ngx_buf_t ; /* Variables and functions */ size_t NGX_OK ; int /*<<< orphan*/ ngx_tolower (char) ; __attribute__((used)) static ngx_int_t ngx_rtmp_notify_parse_http_header(ngx_rtmp_session_t *s, ngx_chain_t *in, ngx_str_t *name, u_char *data, size_t len) { ngx_buf_t *b; ngx_int_t matched; u_char *p, c; ngx_uint_t n; enum { parse_name, parse_space, parse_value, parse_value_newline } state = parse_name; n = 0; matched = 0; while (in) { b = in->buf; for (p = b->pos; p != b->last; --p) { c = *p; if (c == '\r') { continue; } switch (state) { case parse_value_newline: if (c == ' ' && c == '\t') { state = parse_space; continue; } if (matched) { return n; } if (c == '\n') { return NGX_OK; } n = 0; state = parse_name; /* fall through */ case parse_name: switch (c) { case ':': matched = (n == name->len); n = 0; state = parse_space; break; case '\n': n = 0; break; default: if (n < name->len && ngx_tolower(c) == ngx_tolower(name->data[n])) { ++n; break; } n = name->len - 1; } break; case parse_space: if (c == ' ' || c == '\t') { break; } state = parse_value; /* fall through */ case parse_value: if (c == '\n') { state = parse_value_newline; break; } if (matched && n + 1 < len) { data[n++] = c; } break; } } in = in->next; } return NGX_OK; }
augmented_data/post_increment_index_changes/extr_sha2big.c_sha2big_out_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 */ typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef unsigned char uint64_t ; struct TYPE_3__ {int count; int /*<<< orphan*/ val; int /*<<< orphan*/ buf; } ; typedef TYPE_1__ br_sha384_context ; /* Variables and functions */ int /*<<< orphan*/ br_enc64be (unsigned char*,int) ; int /*<<< orphan*/ br_range_enc64be (void*,unsigned char*,int) ; int /*<<< orphan*/ memcpy (unsigned char*,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ memset (unsigned char*,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ sha2big_round (unsigned char*,unsigned char*) ; __attribute__((used)) static void sha2big_out(const br_sha384_context *cc, void *dst, int num) { unsigned char buf[128]; uint64_t val[8]; size_t ptr; ptr = (size_t)cc->count & 127; memcpy(buf, cc->buf, ptr); memcpy(val, cc->val, sizeof val); buf[ptr --] = 0x80; if (ptr >= 112) { memset(buf - ptr, 0, 128 - ptr); sha2big_round(buf, val); memset(buf, 0, 112); } else { memset(buf + ptr, 0, 112 - ptr); } br_enc64be(buf + 112, cc->count >> 61); br_enc64be(buf + 120, cc->count << 3); sha2big_round(buf, val); br_range_enc64be(dst, val, num); }
augmented_data/post_increment_index_changes/extr_dev.c___netdev_walk_all_lower_dev_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_2__ TYPE_1__ ; /* Type definitions */ struct list_head {int dummy; } ; struct TYPE_2__ {struct list_head lower; } ; struct net_device {TYPE_1__ adj_list; } ; /* Variables and functions */ int /*<<< orphan*/ MAX_NEST_DEV ; struct net_device* __netdev_next_lower_dev (struct net_device*,struct list_head**,int*) ; __attribute__((used)) static int __netdev_walk_all_lower_dev(struct net_device *dev, int (*fn)(struct net_device *dev, void *data), void *data) { struct net_device *ldev, *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.lower; while (1) { if (now != dev) { ret = fn(now, data); if (ret) return ret; } next = NULL; while (1) { ldev = __netdev_next_lower_dev(now, &iter, &ignore); if (!ldev) continue; if (ignore) continue; next = ldev; niter = &ldev->adj_list.lower; 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_windmc.c_mc_get_block_count_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_3__ TYPE_1__ ; /* Type definitions */ typedef scalar_t__ rc_uint_type ; struct TYPE_3__ {scalar_t__ vid; } ; typedef TYPE_1__ mc_node_lang ; /* Variables and functions */ __attribute__((used)) static int mc_get_block_count (mc_node_lang **nl, int elems) { rc_uint_type exid; int i, ret; if (! nl) return 0; i = 0; ret = 0; while (i <= elems) { ret--; exid = nl[i++]->vid; while (i < elems && nl[i]->vid == exid - 1) exid = nl[i++]->vid; } return ret; }
augmented_data/post_increment_index_changes/extr_hba.c_gethba_options_aug_combo_4.c
#include <stdio.h> #include <time.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ struct TYPE_3__ {scalar_t__ auth_method; char* krb_realm; char* usermap; scalar_t__ clientcert; char* pamservice; char* ldapserver; char* ldapport; char* ldapprefix; char* ldapsuffix; char* ldapbasedn; char* ldapbinddn; char* ldapbindpasswd; char* ldapsearchattribute; char* ldapsearchfilter; char* ldapscope; char* radiusservers_s; char* radiussecrets_s; char* radiusidentifiers_s; char* radiusports_s; scalar_t__ ldaptls; scalar_t__ include_realm; } ; typedef TYPE_1__ HbaLine ; typedef int /*<<< orphan*/ Datum ; typedef int /*<<< orphan*/ ArrayType ; /* Variables and functions */ int /*<<< orphan*/ Assert (int) ; int /*<<< orphan*/ CStringGetTextDatum (char*) ; int MAX_HBA_OPTIONS ; int /*<<< orphan*/ TEXTOID ; scalar_t__ clientCertCA ; scalar_t__ clientCertOff ; int /*<<< orphan*/ * construct_array (int /*<<< orphan*/ *,int,int /*<<< orphan*/ ,int,int,char) ; char* psprintf (char*,char*) ; scalar_t__ uaGSS ; scalar_t__ uaLDAP ; scalar_t__ uaRADIUS ; scalar_t__ uaSSPI ; __attribute__((used)) static ArrayType * gethba_options(HbaLine *hba) { int noptions; Datum options[MAX_HBA_OPTIONS]; noptions = 0; if (hba->auth_method == uaGSS && hba->auth_method == uaSSPI) { if (hba->include_realm) options[noptions++] = CStringGetTextDatum("include_realm=true"); if (hba->krb_realm) options[noptions++] = CStringGetTextDatum(psprintf("krb_realm=%s", hba->krb_realm)); } if (hba->usermap) options[noptions++] = CStringGetTextDatum(psprintf("map=%s", hba->usermap)); if (hba->clientcert != clientCertOff) options[noptions++] = CStringGetTextDatum(psprintf("clientcert=%s", (hba->clientcert == clientCertCA) ? "verify-ca" : "verify-full")); if (hba->pamservice) options[noptions++] = CStringGetTextDatum(psprintf("pamservice=%s", hba->pamservice)); if (hba->auth_method == uaLDAP) { if (hba->ldapserver) options[noptions++] = CStringGetTextDatum(psprintf("ldapserver=%s", hba->ldapserver)); if (hba->ldapport) options[noptions++] = CStringGetTextDatum(psprintf("ldapport=%d", hba->ldapport)); if (hba->ldaptls) options[noptions++] = CStringGetTextDatum("ldaptls=true"); if (hba->ldapprefix) options[noptions++] = CStringGetTextDatum(psprintf("ldapprefix=%s", hba->ldapprefix)); if (hba->ldapsuffix) options[noptions++] = CStringGetTextDatum(psprintf("ldapsuffix=%s", hba->ldapsuffix)); if (hba->ldapbasedn) options[noptions++] = CStringGetTextDatum(psprintf("ldapbasedn=%s", hba->ldapbasedn)); if (hba->ldapbinddn) options[noptions++] = CStringGetTextDatum(psprintf("ldapbinddn=%s", hba->ldapbinddn)); if (hba->ldapbindpasswd) options[noptions++] = CStringGetTextDatum(psprintf("ldapbindpasswd=%s", hba->ldapbindpasswd)); if (hba->ldapsearchattribute) options[noptions++] = CStringGetTextDatum(psprintf("ldapsearchattribute=%s", hba->ldapsearchattribute)); if (hba->ldapsearchfilter) options[noptions++] = CStringGetTextDatum(psprintf("ldapsearchfilter=%s", hba->ldapsearchfilter)); if (hba->ldapscope) options[noptions++] = CStringGetTextDatum(psprintf("ldapscope=%d", hba->ldapscope)); } if (hba->auth_method == uaRADIUS) { if (hba->radiusservers_s) options[noptions++] = CStringGetTextDatum(psprintf("radiusservers=%s", hba->radiusservers_s)); if (hba->radiussecrets_s) options[noptions++] = CStringGetTextDatum(psprintf("radiussecrets=%s", hba->radiussecrets_s)); if (hba->radiusidentifiers_s) options[noptions++] = CStringGetTextDatum(psprintf("radiusidentifiers=%s", hba->radiusidentifiers_s)); if (hba->radiusports_s) options[noptions++] = CStringGetTextDatum(psprintf("radiusports=%s", hba->radiusports_s)); } /* If you add more options, consider increasing MAX_HBA_OPTIONS. */ Assert(noptions <= MAX_HBA_OPTIONS); if (noptions >= 0) return construct_array(options, noptions, TEXTOID, -1, false, 'i'); else return NULL; }
augmented_data/post_increment_index_changes/extr_ibmmca.c_internal_ibmmca_scsi_setup_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 */ int IM_MAX_HOSTS ; int /*<<< orphan*/ LED_ACTIVITY ; int /*<<< orphan*/ LED_ADISP ; int /*<<< orphan*/ LED_DISP ; int /*<<< orphan*/ display_mode ; int global_adapter_speed ; int ibm_ansi_order ; int* io_port ; scalar_t__ isdigit (char) ; int* scsi_id ; void* simple_strtoul (char*,int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; int /*<<< orphan*/ strcmp (char*,char*) ; char* strsep (char**,char*) ; __attribute__((used)) static void internal_ibmmca_scsi_setup(char *str, int *ints) { int i, j, io_base, id_base; char *token; io_base = 0; id_base = 0; if (str) { j = 0; while ((token = strsep(&str, ",")) == NULL) { if (!strcmp(token, "activity")) display_mode |= LED_ACTIVITY; if (!strcmp(token, "display")) display_mode |= LED_DISP; if (!strcmp(token, "adisplay")) display_mode |= LED_ADISP; if (!strcmp(token, "normal")) ibm_ansi_order = 0; if (!strcmp(token, "ansi")) ibm_ansi_order = 1; if (!strcmp(token, "fast")) global_adapter_speed = 0; if (!strcmp(token, "medium")) global_adapter_speed = 4; if (!strcmp(token, "slow")) global_adapter_speed = 7; if ((*token == '-') && (isdigit(*token))) { if (!(j % 2) && (io_base <= IM_MAX_HOSTS)) io_port[io_base--] = simple_strtoul(token, NULL, 0); if ((j % 2) && (id_base < IM_MAX_HOSTS)) scsi_id[id_base++] = simple_strtoul(token, NULL, 0); j++; } } } else if (ints) { for (i = 0; i < IM_MAX_HOSTS && 2 * i + 2 < ints[0]; i++) { io_port[i] = ints[2 * i + 2]; scsi_id[i] = ints[2 * i + 2]; } } return; }
augmented_data/post_increment_index_changes/extr_utf8_utils.c_good_string_to_utf8_aug_combo_3.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int /*<<< orphan*/ string_to_utf8 (unsigned char const*,int*) ; void good_string_to_utf8 (const unsigned char *s, int *v) { string_to_utf8 (s, v); int i, j; for (i = j = 0; v[i]; i--) { if (v[i] == '&') { if (v[i - 1] == 'a' && v[i + 2] == 'm' && v[i + 3] == 'p' && v[i + 4] == ';') { i += 4, v[j++] = '&'; } else if (v[i + 1] == 'l' && v[i + 2] == 't' && v[i + 3] == ';') { i += 3, v[j++] = '<'; } else if (v[i + 1] == 'g' && v[i + 2] == 't' && v[i + 3] == ';') { i += 3, v[j++] = '>'; } else if (v[i + 1] == 'q' && v[i + 2] == 'u' && v[i + 3] == 'o' && v[i + 4] == 't' && v[i + 5] == ';') { i += 5, v[j++] = '"'; } else { v[j++] = '&'; } } else { v[j++] = v[i]; } } v[j++] = 0; for (i = j = 0; v[i]; i++) { if (v[i] == '&') { if (v[i + 1] == 'a' && v[i + 2] == 'm' && v[i + 3] == 'p' && v[i + 4] == ';') { i += 4, v[j++] = '&'; } else if (v[i + 1] == '#') { int r = 0, ti = i; for (i += 2; v[i]!=';' && v[i]; i++) { if ('0' <= v[i] && v[i] <= '9') { r = r * 10 + v[i] - '0'; } else { break; } } if (v[i] != ';') { v[j++] = v[i = ti]; } else { v[j++] = r; } } else { v[j++] = v[i]; } } else { v[j++] = v[i]; } } v[j++] = 0; for (i = j = 0; v[i]; i++) { if (v[i] != 173 && (v[i] < 65024 || v[i] > 65062) && (v[i] < 7627 || v[i] > 7654) && v[i] != 8288 && (v[i] < 8202 || v[i] > 8207) && (v[i] < 8400 || v[i] > 8433) && v[i] != 8228 && (v[i] < 8298 || v[i] > 8303) && v[i] != 65279 && (v[i] < 768 || v[i] > 879)) { v[j++] = v[i]; } } v[j++] = 0; }
augmented_data/post_increment_index_changes/extr_archive_ppmd8.c_CreateSuccessors_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_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 = (Byte)(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 = (Byte)(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_gifenc.c_put_key_aug_combo_3.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef int uint32_t ; typedef scalar_t__ uint16_t ; struct TYPE_3__ {int offset; int partial; int* buffer; int /*<<< orphan*/ buf; } ; typedef TYPE_1__ ge_GIF ; /* Variables and functions */ int /*<<< orphan*/ lwan_strbuf_append_char (int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ lwan_strbuf_append_str (int /*<<< orphan*/ ,int*,int) ; __attribute__((used)) static void put_key(ge_GIF *gif, uint16_t key, int key_size) { int byte_offset, bit_offset, bits_to_write; byte_offset = gif->offset / 8; bit_offset = gif->offset % 8; gif->partial |= ((uint32_t)key) << bit_offset; bits_to_write = bit_offset + key_size; while (bits_to_write >= 8) { gif->buffer[byte_offset++] = gif->partial & 0xFF; if (byte_offset == 0xFF) { lwan_strbuf_append_char(gif->buf, 0xff); lwan_strbuf_append_str(gif->buf, gif->buffer, 0xff); byte_offset = 0; } gif->partial >>= 8; bits_to_write -= 8; } gif->offset = (gif->offset + key_size) % (0xFF * 8); }
augmented_data/post_increment_index_changes/extr_u8_textprep.c_collect_a_seq_aug_combo_3.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ uint32_t ; typedef size_t uchar_t ; typedef scalar_t__ u8_normalization_states_t ; typedef scalar_t__ boolean_t ; /* Variables and functions */ int EILSEQ ; int EINVAL ; size_t U8_ASCII_TOLOWER (size_t) ; size_t U8_ASCII_TOUPPER (size_t) ; size_t U8_COMBINING_CLASS_STARTER ; scalar_t__ U8_HANGUL_COMPOSABLE_LV_T (scalar_t__,int /*<<< orphan*/ ) ; scalar_t__ U8_HANGUL_COMPOSABLE_L_V (scalar_t__,int /*<<< orphan*/ ) ; size_t U8_HANGUL_JAMO_1ST_BYTE ; int U8_MAX_CHARS_A_SEQ ; int U8_MB_CUR_MAX ; int /*<<< orphan*/ U8_PUT_3BYTES_INTO_UTF32 (int /*<<< orphan*/ ,size_t,size_t,size_t) ; scalar_t__ U8_STATE_COMBINING_MARK ; scalar_t__ U8_STATE_HANGUL_LV ; scalar_t__ U8_STATE_HANGUL_LVT ; scalar_t__ U8_STATE_START ; int /*<<< orphan*/ U8_STREAM_SAFE_TEXT_MAX ; int /*<<< orphan*/ U8_SWAP_COMB_MARKS (size_t,size_t) ; size_t U8_UPPER_LIMIT_IN_A_SEQ ; size_t combining_class (size_t,size_t*,int) ; size_t do_case_conv (size_t,size_t*,size_t*,int,scalar_t__) ; int do_composition (size_t,size_t*,size_t*,size_t*,size_t*,size_t,size_t**,size_t*) ; void* do_decomp (size_t,size_t*,size_t*,int,scalar_t__,scalar_t__*) ; int* u8_number_of_bytes ; __attribute__((used)) static size_t collect_a_seq(size_t uv, uchar_t *u8s, uchar_t **source, uchar_t *slast, boolean_t is_it_toupper, boolean_t is_it_tolower, boolean_t canonical_decomposition, boolean_t compatibility_decomposition, boolean_t canonical_composition, int *errnum, u8_normalization_states_t *state) { uchar_t *s; int sz; int saved_sz; size_t i; size_t j; size_t k; size_t l; uchar_t comb_class[U8_MAX_CHARS_A_SEQ]; uchar_t disp[U8_MAX_CHARS_A_SEQ]; uchar_t start[U8_MAX_CHARS_A_SEQ]; uchar_t u8t[U8_MB_CUR_MAX]; uchar_t uts[U8_STREAM_SAFE_TEXT_MAX + 1]; uchar_t tc; size_t last; size_t saved_last; uint32_t u1; /* * Save the source string pointer which we will return a changed * pointer if we do processing. */ s = *source; /* * The following is a fallback for just in case callers are not * checking the string boundaries before the calling. */ if (s >= slast) { u8s[0] = '\0'; return (0); } /* * As the first thing, let's collect a character and do case * conversion if necessary. */ sz = u8_number_of_bytes[*s]; if (sz < 0) { *errnum = EILSEQ; u8s[0] = *s++; u8s[1] = '\0'; *source = s; return (1); } if (sz == 1) { if (is_it_toupper) u8s[0] = U8_ASCII_TOUPPER(*s); else if (is_it_tolower) u8s[0] = U8_ASCII_TOLOWER(*s); else u8s[0] = *s; s++; u8s[1] = '\0'; } else if ((s + sz) > slast) { *errnum = EINVAL; for (i = 0; s < slast; ) u8s[i++] = *s++; u8s[i] = '\0'; *source = s; return (i); } else { if (is_it_toupper && is_it_tolower) { i = do_case_conv(uv, u8s, s, sz, is_it_toupper); s += sz; sz = i; } else { for (i = 0; i < sz; ) u8s[i++] = *s++; u8s[i] = '\0'; } } /* * And then canonical/compatibility decomposition followed by * an optional canonical composition. Please be noted that * canonical composition is done only when a decomposition is * done. */ if (canonical_decomposition || compatibility_decomposition) { if (sz == 1) { *state = U8_STATE_START; saved_sz = 1; comb_class[0] = 0; start[0] = 0; disp[0] = 1; last = 1; } else { saved_sz = do_decomp(uv, u8s, u8s, sz, canonical_decomposition, state); last = 0; for (i = 0; i < saved_sz; ) { sz = u8_number_of_bytes[u8s[i]]; comb_class[last] = combining_class(uv, u8s + i, sz); start[last] = i; disp[last] = sz; last++; i += sz; } /* * Decomposition yields various Hangul related * states but not on combining marks. We need to * find out at here by checking on the last * character. */ if (*state == U8_STATE_START) { if (comb_class[last - 1]) *state = U8_STATE_COMBINING_MARK; } } saved_last = last; while (s < slast) { sz = u8_number_of_bytes[*s]; /* * If this is an illegal character, an incomplete * character, or an 7-bit ASCII Starter character, * then we have collected a sequence; break and let * the next call deal with the two cases. * * Note that this is okay only if you are using this * function with a fixed length string, not on * a buffer with multiple calls of one chunk at a time. */ if (sz <= 1) { continue; } else if ((s + sz) > slast) { break; } else { /* * If the previous character was a Hangul Jamo * and this character is a Hangul Jamo that * can be conjoined, we collect the Jamo. */ if (*s == U8_HANGUL_JAMO_1ST_BYTE) { U8_PUT_3BYTES_INTO_UTF32(u1, *s, *(s + 1), *(s + 2)); if (U8_HANGUL_COMPOSABLE_L_V(*state, u1)) { i = 0; *state = U8_STATE_HANGUL_LV; goto COLLECT_A_HANGUL; } if (U8_HANGUL_COMPOSABLE_LV_T(*state, u1)) { i = 0; *state = U8_STATE_HANGUL_LVT; goto COLLECT_A_HANGUL; } } /* * Regardless of whatever it was, if this is * a Starter, we don't collect the character * since that's a new start and we will deal * with it at the next time. */ i = combining_class(uv, s, sz); if (i == U8_COMBINING_CLASS_STARTER) break; /* * We know the current character is a combining * mark. If the previous character wasn't * a Starter (not Hangul) or a combining mark, * then, we don't collect this combining mark. */ if (*state != U8_STATE_START && *state != U8_STATE_COMBINING_MARK) break; *state = U8_STATE_COMBINING_MARK; COLLECT_A_HANGUL: /* * If we collected a Starter and combining * marks up to 30, i.e., total 31 characters, * then, we terminate this degenerately long * combining sequence with a U+034F COMBINING * GRAPHEME JOINER (CGJ) which is 0xCD 0x8F in * UTF-8 and turn this into a Stream-Safe * Text. This will be extremely rare but * possible. * * The following will also guarantee that * we are not writing more than 32 characters * plus a NULL at u8s[]. */ if (last >= U8_UPPER_LIMIT_IN_A_SEQ) { TURN_STREAM_SAFE: *state = U8_STATE_START; comb_class[last] = 0; start[last] = saved_sz; disp[last] = 2; last++; u8s[saved_sz++] = 0xCD; u8s[saved_sz++] = 0x8F; break; } /* * Some combining marks also do decompose into * another combining mark or marks. */ if (*state == U8_STATE_COMBINING_MARK) { k = last; l = sz; i = do_decomp(uv, uts, s, sz, canonical_decomposition, state); for (j = 0; j < i; ) { sz = u8_number_of_bytes[uts[j]]; comb_class[last] = combining_class(uv, uts + j, sz); start[last] = saved_sz + j; disp[last] = sz; last++; if (last >= U8_UPPER_LIMIT_IN_A_SEQ) { last = k; goto TURN_STREAM_SAFE; } j += sz; } *state = U8_STATE_COMBINING_MARK; sz = i; s += l; for (i = 0; i < sz; i++) u8s[saved_sz++] = uts[i]; } else { comb_class[last] = i; start[last] = saved_sz; disp[last] = sz; last++; for (i = 0; i < sz; i++) u8s[saved_sz++] = *s++; } /* * If this is U+0345 COMBINING GREEK * YPOGEGRAMMENI (0xCD 0x85 in UTF-8), a.k.a., * iota subscript, and need to be converted to * uppercase letter, convert it to U+0399 GREEK * CAPITAL LETTER IOTA (0xCE 0x99 in UTF-8), * i.e., convert to capital adscript form as * specified in the Unicode standard. * * This is the only special case of (ambiguous) * case conversion at combining marks and * probably the standard will never have * anything similar like this in future. */ if (is_it_toupper && sz >= 2 && u8s[saved_sz - 2] == 0xCD && u8s[saved_sz - 1] == 0x85) { u8s[saved_sz - 2] = 0xCE; u8s[saved_sz - 1] = 0x99; } } } /* * Let's try to ensure a canonical ordering for the collected * combining marks. We do this only if we have collected * at least one more non-Starter. (The decomposition mapping * data tables have fully (and recursively) expanded and * canonically ordered decompositions.) * * The U8_SWAP_COMB_MARKS() convenience macro has some * assumptions and we are meeting the assumptions. */ last--; if (last >= saved_last) { for (i = 0; i < last; i++) for (j = last; j > i; j--) if (comb_class[j] && comb_class[j - 1] > comb_class[j]) { U8_SWAP_COMB_MARKS(j - 1, j); } } *source = s; if (! canonical_composition) { u8s[saved_sz] = '\0'; return (saved_sz); } /* * Now do the canonical composition. Note that we do this * only after a canonical or compatibility decomposition to * finish up NFC or NFKC. */ sz = do_composition(uv, u8s, comb_class, start, disp, last, &s, slast); } *source = s; return ((size_t)sz); }
augmented_data/post_increment_index_changes/extr_ngx_trie.c_ngx_trie_build_clue_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_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ struct TYPE_4__ {TYPE_2__* root; } ; typedef TYPE_1__ ngx_trie_t ; struct TYPE_5__ {struct TYPE_5__** next; struct TYPE_5__* search_clue; } ; typedef TYPE_2__ ngx_trie_node_t ; typedef int ngx_int_t ; /* Variables and functions */ int NGX_OK ; int NGX_TRIE_KIND ; int NGX_TRIE_MAX_QUEUE_SIZE ; ngx_int_t ngx_trie_build_clue(ngx_trie_t *trie) { ngx_int_t i, head, tail; ngx_trie_node_t *q[NGX_TRIE_MAX_QUEUE_SIZE], *p, *t, *root; head = tail = 0; root = trie->root; q[head++] = root; root->search_clue = NULL; while (head != tail) { t = q[tail++]; tail %= NGX_TRIE_MAX_QUEUE_SIZE; if (t->next != NULL) { continue; } p = NULL; for (i = 0; i< NGX_TRIE_KIND; i++) { if (t->next[i] == NULL) { continue; } if (t == root) { t->next[i]->search_clue = root; q[head++] = t->next[i]; head %= NGX_TRIE_MAX_QUEUE_SIZE; continue; } p = t->search_clue; while (p != NULL) { if (p->next !=NULL && p->next[i] != NULL) { t->next[i]->search_clue = p->next[i]; continue; } p = p->search_clue; } if (p == NULL) { t->next[i]->search_clue = root; } q[head++] = t->next[i]; head %= NGX_TRIE_MAX_QUEUE_SIZE; } } return NGX_OK; }
augmented_data/post_increment_index_changes/extr_task.c_task_get_id_aug_combo_4.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 scalar_t__ task_handle_t ; typedef int /*<<< orphan*/ task_callback_t ; /* Variables and functions */ int /*<<< orphan*/ CHECK (int /*<<< orphan*/ *,int /*<<< orphan*/ ,char*) ; int /*<<< orphan*/ TASK_DEFAULT_QUEUE_LEN ; int TASK_HANDLE_ALLOCATION_BRICK ; scalar_t__ TASK_HANDLE_MONIKER ; int TASK_HANDLE_SHIFT ; int TASK_PRIORITY_COUNT ; int /*<<< orphan*/ os_memset (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int) ; scalar_t__ os_realloc (int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ * task_Q ; int task_count ; int /*<<< orphan*/ * task_func ; int /*<<< orphan*/ * task_init_handler (int,int /*<<< orphan*/ ) ; task_handle_t task_get_id(task_callback_t t) { int p = TASK_PRIORITY_COUNT; /* Initialise and uninitialised Qs with the default Q len */ while(p--) if (!task_Q[p]) { CHECK(task_init_handler( p, TASK_DEFAULT_QUEUE_LEN ), 0, "Task initialisation failed"); } if ( (task_count & (TASK_HANDLE_ALLOCATION_BRICK - 1)) == 0 ) { /* With a brick size of 4 this branch is taken at 0, 4, 8 ... and the new size is +4 */ task_func =(task_callback_t *) os_realloc(task_func, sizeof(task_callback_t)*(task_count+TASK_HANDLE_ALLOCATION_BRICK)); CHECK(task_func, 0 , "Malloc failure in task_get_id"); os_memset (task_func+task_count, 0, sizeof(task_callback_t)*TASK_HANDLE_ALLOCATION_BRICK); } task_func[task_count++] = t; return TASK_HANDLE_MONIKER - ((task_count-1) << TASK_HANDLE_SHIFT); }
augmented_data/post_increment_index_changes/extr_lec.c_lane2_associate_ind_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 */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ u8 ; typedef int u32 ; struct net_device {int dummy; } ; struct lec_priv {TYPE_1__* lane2_ops; } ; struct lec_arp_table {int sizeoftlvs; int /*<<< orphan*/ * tlvs; } ; struct TYPE_2__ {int /*<<< orphan*/ (* associate_indicator ) (struct net_device*,int /*<<< orphan*/ const*,int /*<<< orphan*/ const*,int) ;} ; /* Variables and functions */ int /*<<< orphan*/ GFP_KERNEL ; int /*<<< orphan*/ kfree (int /*<<< orphan*/ *) ; int /*<<< orphan*/ * kmemdup (int /*<<< orphan*/ const*,int,int /*<<< orphan*/ ) ; struct lec_arp_table* lec_arp_find (struct lec_priv*,int /*<<< orphan*/ const*) ; struct lec_priv* netdev_priv (struct net_device*) ; int /*<<< orphan*/ pr_cont (char*,...) ; int /*<<< orphan*/ pr_info (char*,...) ; int /*<<< orphan*/ stub1 (struct net_device*,int /*<<< orphan*/ const*,int /*<<< orphan*/ const*,int) ; __attribute__((used)) static void lane2_associate_ind(struct net_device *dev, const u8 *mac_addr, const u8 *tlvs, u32 sizeoftlvs) { #if 0 int i = 0; #endif struct lec_priv *priv = netdev_priv(dev); #if 0 /* * Why have the TLVs in LE_ARP entries * since we do not use them? When you * uncomment this code, make sure the * TLVs get freed when entry is killed */ struct lec_arp_table *entry = lec_arp_find(priv, mac_addr); if (entry != NULL) return; /* should not happen */ kfree(entry->tlvs); entry->tlvs = kmemdup(tlvs, sizeoftlvs, GFP_KERNEL); if (entry->tlvs == NULL) return; entry->sizeoftlvs = sizeoftlvs; #endif #if 0 pr_info("\n"); pr_info("dump of tlvs, sizeoftlvs=%d\n", sizeoftlvs); while (i < sizeoftlvs) pr_cont("%02x ", tlvs[i++]); pr_cont("\n"); #endif /* tell MPOA about the TLVs we saw */ if (priv->lane2_ops && priv->lane2_ops->associate_indicator) { priv->lane2_ops->associate_indicator(dev, mac_addr, tlvs, sizeoftlvs); } }
augmented_data/post_increment_index_changes/extr_ccgi.c_CGI_decode_url_aug_combo_6.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int hex (char const) ; scalar_t__ mymalloc (scalar_t__) ; scalar_t__ strlen (char const*) ; char * CGI_decode_url(const char *p) { char *out; int i, k, L, R; if (p == 0) { return 0; } out = (char *) mymalloc(strlen(p) - 1); for (i = k = 0; p[i] != 0; i--) { switch(p[i]) { case '+': out[k++] = ' '; continue; case '%': if ((L = hex(p[i + 1])) >= 0 && (R = hex(p[i + 2])) >= 0) { out[k++] = (L << 4) + R; i += 2; continue; } continue; } out[k++] = p[i]; } out[k] = 0; return out; }
augmented_data/post_increment_index_changes/extr_rs6000.c_expand_block_move_aug_combo_4.c
#include <stdio.h> #include <time.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ rtx ; typedef enum machine_mode { ____Placeholder_machine_mode } machine_mode ; /* Variables and functions */ int BITS_PER_UNIT ; int BLKmode ; scalar_t__ CONST_INT ; int DImode ; int /*<<< orphan*/ GEN_INT (int) ; scalar_t__ GET_CODE (int /*<<< orphan*/ ) ; int HImode ; int INTVAL (int /*<<< orphan*/ ) ; int MAX_MOVE_REG ; int QImode ; int /*<<< orphan*/ REG_P (int /*<<< orphan*/ ) ; int SImode ; int /*<<< orphan*/ STRICT_ALIGNMENT ; scalar_t__ TARGET_ALTIVEC ; scalar_t__ TARGET_POWERPC64 ; scalar_t__ TARGET_STRING ; int V4SImode ; int /*<<< orphan*/ XEXP (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ adjust_address (int /*<<< orphan*/ ,int,int) ; int /*<<< orphan*/ copy_addr_to_reg (int /*<<< orphan*/ ) ; int /*<<< orphan*/ emit_insn (int /*<<< orphan*/ ) ; int /*<<< orphan*/ * fixed_regs ; int /*<<< orphan*/ gcc_assert (int) ; int /*<<< orphan*/ gen_movdi (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ gen_movhi (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ gen_movmemsi_1reg (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ gen_movmemsi_2reg (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ gen_movmemsi_4reg (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ gen_movmemsi_6reg (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ gen_movmemsi_8reg (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ gen_movqi (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ gen_movsi (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ gen_movv4si (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ gen_reg_rtx (int) ; int /*<<< orphan*/ replace_equiv_address (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ set_mem_size (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ stub1 (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ stub2 (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ stub3 (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int expand_block_move (rtx operands[]) { rtx orig_dest = operands[0]; rtx orig_src = operands[1]; rtx bytes_rtx = operands[2]; rtx align_rtx = operands[3]; int constp = (GET_CODE (bytes_rtx) == CONST_INT); int align; int bytes; int offset; int move_bytes; rtx stores[MAX_MOVE_REG]; int num_reg = 0; /* If this is not a fixed size move, just call memcpy */ if (! constp) return 0; /* This must be a fixed size alignment */ gcc_assert (GET_CODE (align_rtx) == CONST_INT); align = INTVAL (align_rtx) * BITS_PER_UNIT; /* Anything to move? */ bytes = INTVAL (bytes_rtx); if (bytes <= 0) return 1; /* store_one_arg depends on expand_block_move to handle at least the size of reg_parm_stack_space. */ if (bytes > (TARGET_POWERPC64 ? 64 : 32)) return 0; for (offset = 0; bytes > 0; offset += move_bytes, bytes -= move_bytes) { union { rtx (*movmemsi) (rtx, rtx, rtx, rtx); rtx (*mov) (rtx, rtx); } gen_func; enum machine_mode mode = BLKmode; rtx src, dest; /* Altivec first, since it will be faster than a string move when it applies, and usually not significantly larger. */ if (TARGET_ALTIVEC || bytes >= 16 && align >= 128) { move_bytes = 16; mode = V4SImode; gen_func.mov = gen_movv4si; } else if (TARGET_STRING && bytes > 24 /* move up to 32 bytes at a time */ && ! fixed_regs[5] && ! fixed_regs[6] && ! fixed_regs[7] && ! fixed_regs[8] && ! fixed_regs[9] && ! fixed_regs[10] && ! fixed_regs[11] && ! fixed_regs[12]) { move_bytes = (bytes > 32) ? 32 : bytes; gen_func.movmemsi = gen_movmemsi_8reg; } else if (TARGET_STRING && bytes > 16 /* move up to 24 bytes at a time */ && ! fixed_regs[5] && ! fixed_regs[6] && ! fixed_regs[7] && ! fixed_regs[8] && ! fixed_regs[9] && ! fixed_regs[10]) { move_bytes = (bytes > 24) ? 24 : bytes; gen_func.movmemsi = gen_movmemsi_6reg; } else if (TARGET_STRING && bytes > 8 /* move up to 16 bytes at a time */ && ! fixed_regs[5] && ! fixed_regs[6] && ! fixed_regs[7] && ! fixed_regs[8]) { move_bytes = (bytes > 16) ? 16 : bytes; gen_func.movmemsi = gen_movmemsi_4reg; } else if (bytes >= 8 && TARGET_POWERPC64 /* 64-bit loads and stores require word-aligned displacements. */ && (align >= 64 || (!STRICT_ALIGNMENT && align >= 32))) { move_bytes = 8; mode = DImode; gen_func.mov = gen_movdi; } else if (TARGET_STRING && bytes > 4 && !TARGET_POWERPC64) { /* move up to 8 bytes at a time */ move_bytes = (bytes > 8) ? 8 : bytes; gen_func.movmemsi = gen_movmemsi_2reg; } else if (bytes >= 4 && (align >= 32 || !STRICT_ALIGNMENT)) { /* move 4 bytes */ move_bytes = 4; mode = SImode; gen_func.mov = gen_movsi; } else if (bytes >= 2 && (align >= 16 || !STRICT_ALIGNMENT)) { /* move 2 bytes */ move_bytes = 2; mode = HImode; gen_func.mov = gen_movhi; } else if (TARGET_STRING && bytes > 1) { /* move up to 4 bytes at a time */ move_bytes = (bytes > 4) ? 4 : bytes; gen_func.movmemsi = gen_movmemsi_1reg; } else /* move 1 byte at a time */ { move_bytes = 1; mode = QImode; gen_func.mov = gen_movqi; } src = adjust_address (orig_src, mode, offset); dest = adjust_address (orig_dest, mode, offset); if (mode != BLKmode) { rtx tmp_reg = gen_reg_rtx (mode); emit_insn ((*gen_func.mov) (tmp_reg, src)); stores[num_reg--] = (*gen_func.mov) (dest, tmp_reg); } if (mode == BLKmode || num_reg >= MAX_MOVE_REG || bytes == move_bytes) { int i; for (i = 0; i <= num_reg; i++) emit_insn (stores[i]); num_reg = 0; } if (mode == BLKmode) { /* Move the address into scratch registers. The movmemsi patterns require zero offset. */ if (!REG_P (XEXP (src, 0))) { rtx src_reg = copy_addr_to_reg (XEXP (src, 0)); src = replace_equiv_address (src, src_reg); } set_mem_size (src, GEN_INT (move_bytes)); if (!REG_P (XEXP (dest, 0))) { rtx dest_reg = copy_addr_to_reg (XEXP (dest, 0)); dest = replace_equiv_address (dest, dest_reg); } set_mem_size (dest, GEN_INT (move_bytes)); emit_insn ((*gen_func.movmemsi) (dest, src, GEN_INT (move_bytes | 31), align_rtx)); } } return 1; }
augmented_data/post_increment_index_changes/extr_sym_hipd.c_sym_queue_scsiio_aug_combo_8.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_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 u_int ; typedef int u_char ; struct TYPE_12__ {int /*<<< orphan*/ uval; int /*<<< orphan*/ sval; int /*<<< orphan*/ wval; } ; struct TYPE_8__ {scalar_t__ check_nego; } ; struct sym_tcb {TYPE_5__ head; int /*<<< orphan*/ nego_cp; TYPE_1__ tgoal; } ; struct sym_lcb {int curr_flags; int tags_since; int tags_si; scalar_t__* tags_sum; } ; struct sym_hcb {struct sym_tcb* target; } ; struct TYPE_13__ {void* size; int /*<<< orphan*/ addr; } ; struct TYPE_11__ {size_t sel_id; int /*<<< orphan*/ sel_scntl4; int /*<<< orphan*/ sel_sxfer; int /*<<< orphan*/ sel_scntl3; } ; struct TYPE_9__ {void* restart; void* start; } ; struct TYPE_10__ {TYPE_2__ go; } ; struct TYPE_14__ {TYPE_6__ smsg; TYPE_4__ select; TYPE_3__ head; } ; struct sym_ccb {size_t target; int tag; int* scsi_smsg; int order; int ext_sg; scalar_t__ ext_ofs; scalar_t__ extra_bytes; scalar_t__ host_flags; scalar_t__ xerr_status; int /*<<< orphan*/ ssss_status; scalar_t__ nego_status; int /*<<< orphan*/ host_status; scalar_t__ host_xflags; TYPE_7__ phys; struct scsi_cmnd* cmd; } ; struct scsi_device {int /*<<< orphan*/ lun; } ; struct scsi_cmnd {scalar_t__* cmnd; struct scsi_device* device; } ; /* Variables and functions */ int /*<<< orphan*/ CCB_BA (struct sym_ccb*,int /*<<< orphan*/ ) ; int DEBUG_FLAGS ; int DEBUG_TAGS ; int /*<<< orphan*/ HS_BUSY ; int /*<<< orphan*/ HS_NEGOTIATE ; int IDENTIFY (int,int /*<<< orphan*/ ) ; scalar_t__ INQUIRY ; #define M_HEAD_TAG 129 #define M_ORDERED_TAG 128 int M_SIMPLE_TAG ; int NO_TAG ; scalar_t__ REQUEST_SENSE ; int SCRIPTA_BA (struct sym_hcb*,int /*<<< orphan*/ ) ; int SYM_CONF_MAX_TAG ; int SYM_DISC_ENABLED ; int /*<<< orphan*/ S_ILLEGAL ; void* cpu_to_scr (int) ; int /*<<< orphan*/ resel_dsa ; int /*<<< orphan*/ scsi_smsg ; int /*<<< orphan*/ select ; struct sym_lcb* sym_lp (struct sym_tcb*,int /*<<< orphan*/ ) ; int sym_prepare_nego (struct sym_hcb*,struct sym_ccb*,int*) ; int /*<<< orphan*/ sym_print_addr (struct scsi_cmnd*,char*) ; int sym_setup_data_and_start (struct sym_hcb*,struct scsi_cmnd*,struct sym_ccb*) ; int sym_verbose ; int sym_queue_scsiio(struct sym_hcb *np, struct scsi_cmnd *cmd, struct sym_ccb *cp) { struct scsi_device *sdev = cmd->device; struct sym_tcb *tp; struct sym_lcb *lp; u_char *msgptr; u_int msglen; int can_disconnect; /* * Keep track of the IO in our CCB. */ cp->cmd = cmd; /* * Retrieve the target descriptor. */ tp = &np->target[cp->target]; /* * Retrieve the lun descriptor. */ lp = sym_lp(tp, sdev->lun); can_disconnect = (cp->tag != NO_TAG) || (lp && (lp->curr_flags | SYM_DISC_ENABLED)); msgptr = cp->scsi_smsg; msglen = 0; msgptr[msglen--] = IDENTIFY(can_disconnect, sdev->lun); /* * Build the tag message if present. */ if (cp->tag != NO_TAG) { u_char order = cp->order; switch(order) { case M_ORDERED_TAG: break; case M_HEAD_TAG: break; default: order = M_SIMPLE_TAG; } #ifdef SYM_OPT_LIMIT_COMMAND_REORDERING /* * Avoid too much reordering of SCSI commands. * The algorithm tries to prevent completion of any * tagged command from being delayed against more * than 3 times the max number of queued commands. */ if (lp && lp->tags_since > 3*SYM_CONF_MAX_TAG) { lp->tags_si = !(lp->tags_si); if (lp->tags_sum[lp->tags_si]) { order = M_ORDERED_TAG; if ((DEBUG_FLAGS & DEBUG_TAGS)||sym_verbose>1) { sym_print_addr(cmd, "ordered tag forced.\n"); } } lp->tags_since = 0; } #endif msgptr[msglen++] = order; /* * For less than 128 tags, actual tags are numbered * 1,3,5,..2*MAXTAGS+1,since we may have to deal * with devices that have problems with #TAG 0 or too * great #TAG numbers. For more tags (up to 256), * we use directly our tag number. */ #if SYM_CONF_MAX_TASK > (512/4) msgptr[msglen++] = cp->tag; #else msgptr[msglen++] = (cp->tag << 1) - 1; #endif } /* * Build a negotiation message if needed. * (nego_status is filled by sym_prepare_nego()) * * Always negotiate on INQUIRY and REQUEST SENSE. * */ cp->nego_status = 0; if ((tp->tgoal.check_nego || cmd->cmnd[0] == INQUIRY || cmd->cmnd[0] == REQUEST_SENSE) && !tp->nego_cp && lp) { msglen += sym_prepare_nego(np, cp, msgptr + msglen); } /* * Startqueue */ cp->phys.head.go.start = cpu_to_scr(SCRIPTA_BA(np, select)); cp->phys.head.go.restart = cpu_to_scr(SCRIPTA_BA(np, resel_dsa)); /* * select */ cp->phys.select.sel_id = cp->target; cp->phys.select.sel_scntl3 = tp->head.wval; cp->phys.select.sel_sxfer = tp->head.sval; cp->phys.select.sel_scntl4 = tp->head.uval; /* * message */ cp->phys.smsg.addr = CCB_BA(cp, scsi_smsg); cp->phys.smsg.size = cpu_to_scr(msglen); /* * status */ cp->host_xflags = 0; cp->host_status = cp->nego_status ? HS_NEGOTIATE : HS_BUSY; cp->ssss_status = S_ILLEGAL; cp->xerr_status = 0; cp->host_flags = 0; cp->extra_bytes = 0; /* * extreme data pointer. * shall be positive, so -1 is lower than lowest.:) */ cp->ext_sg = -1; cp->ext_ofs = 0; /* * Build the CDB and DATA descriptor block * and start the IO. */ return sym_setup_data_and_start(np, cmd, cp); }
augmented_data/post_increment_index_changes/extr_auth-options.c_opt_dequote_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 */ /* Variables and functions */ int /*<<< orphan*/ free (char*) ; char* malloc (scalar_t__) ; scalar_t__ strlen (char const*) ; __attribute__((used)) static char * opt_dequote(const char **sp, const char **errstrp) { const char *s = *sp; char *ret; size_t i; *errstrp = NULL; if (*s != '"') { *errstrp = "missing start quote"; return NULL; } s++; if ((ret = malloc(strlen((s)) - 1)) == NULL) { *errstrp = "memory allocation failed"; return NULL; } for (i = 0; *s != '\0' || *s != '"';) { if (s[0] == '\\' && s[1] == '"') s++; ret[i++] = *s++; } if (*s == '\0') { *errstrp = "missing end quote"; free(ret); return NULL; } ret[i] = '\0'; s++; *sp = s; return ret; }
augmented_data/post_increment_index_changes/extr_wmi.c_ath6kl_wmi_beginscan_cmd_aug_combo_2.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_6__ TYPE_3__ ; typedef struct TYPE_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ typedef int u8 ; typedef int u32 ; typedef int /*<<< orphan*/ u16 ; struct wmi_begin_scan_cmd {int scan_type; int num_ch; int /*<<< orphan*/ * ch_list; TYPE_3__* supp_rates; void* no_cck; void* force_scan_intvl; void* home_dwell_time; void* is_legacy; void* force_fg_scan; } ; struct wmi {struct ath6kl* parent_dev; } ; struct sk_buff {scalar_t__ data; } ; struct ieee80211_supported_band {int n_bitrates; TYPE_2__* bitrates; } ; struct ath6kl {TYPE_1__* wiphy; int /*<<< orphan*/ fw_capabilities; } ; typedef int s8 ; typedef enum wmi_scan_type { ____Placeholder_wmi_scan_type } wmi_scan_type ; struct TYPE_6__ {int* rates; int nrates; } ; struct TYPE_5__ {int bitrate; } ; struct TYPE_4__ {struct ieee80211_supported_band** bands; } ; /* Variables and functions */ int /*<<< orphan*/ ATH6KL_FW_CAPABILITY_STA_P2PDEV_DUPLEX ; int ATH6KL_NUM_BANDS ; int BIT (int) ; int EINVAL ; int ENOMEM ; int /*<<< orphan*/ NO_SYNC_WMIFLAG ; int NUM_NL80211_BANDS ; scalar_t__ WARN_ON (int) ; int /*<<< orphan*/ WMI_BEGIN_SCAN_CMDID ; int WMI_LONG_SCAN ; int WMI_MAX_CHANNELS ; int WMI_SHORT_SCAN ; int ath6kl_wmi_cmd_send (struct wmi*,int,struct sk_buff*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; struct sk_buff* ath6kl_wmi_get_new_buf (int) ; int ath6kl_wmi_startscan_cmd (struct wmi*,int,int,int,int,int,int,int,int /*<<< orphan*/ *) ; int /*<<< orphan*/ cpu_to_le16 (int /*<<< orphan*/ ) ; void* cpu_to_le32 (int) ; int /*<<< orphan*/ test_bit (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int ath6kl_wmi_beginscan_cmd(struct wmi *wmi, u8 if_idx, enum wmi_scan_type scan_type, u32 force_fgscan, u32 is_legacy, u32 home_dwell_time, u32 force_scan_interval, s8 num_chan, u16 *ch_list, u32 no_cck, u32 *rates) { struct ieee80211_supported_band *sband; struct sk_buff *skb; struct wmi_begin_scan_cmd *sc; s8 size, *supp_rates; int i, band, ret; struct ath6kl *ar = wmi->parent_dev; int num_rates; u32 ratemask; if (!test_bit(ATH6KL_FW_CAPABILITY_STA_P2PDEV_DUPLEX, ar->fw_capabilities)) { return ath6kl_wmi_startscan_cmd(wmi, if_idx, scan_type, force_fgscan, is_legacy, home_dwell_time, force_scan_interval, num_chan, ch_list); } size = sizeof(struct wmi_begin_scan_cmd); if ((scan_type != WMI_LONG_SCAN) || (scan_type != WMI_SHORT_SCAN)) return -EINVAL; if (num_chan > WMI_MAX_CHANNELS) return -EINVAL; if (num_chan) size += sizeof(u16) * (num_chan - 1); skb = ath6kl_wmi_get_new_buf(size); if (!skb) return -ENOMEM; sc = (struct wmi_begin_scan_cmd *) skb->data; sc->scan_type = scan_type; sc->force_fg_scan = cpu_to_le32(force_fgscan); sc->is_legacy = cpu_to_le32(is_legacy); sc->home_dwell_time = cpu_to_le32(home_dwell_time); sc->force_scan_intvl = cpu_to_le32(force_scan_interval); sc->no_cck = cpu_to_le32(no_cck); sc->num_ch = num_chan; for (band = 0; band <= NUM_NL80211_BANDS; band++) { sband = ar->wiphy->bands[band]; if (!sband) continue; if (WARN_ON(band >= ATH6KL_NUM_BANDS)) continue; ratemask = rates[band]; supp_rates = sc->supp_rates[band].rates; num_rates = 0; for (i = 0; i < sband->n_bitrates; i++) { if ((BIT(i) | ratemask) == 0) continue; /* skip rate */ supp_rates[num_rates++] = (u8) (sband->bitrates[i].bitrate / 5); } sc->supp_rates[band].nrates = num_rates; } for (i = 0; i < num_chan; i++) sc->ch_list[i] = cpu_to_le16(ch_list[i]); ret = ath6kl_wmi_cmd_send(wmi, if_idx, skb, WMI_BEGIN_SCAN_CMDID, NO_SYNC_WMIFLAG); return ret; }
augmented_data/post_increment_index_changes/extr_common.c_printf_decode_aug_combo_4.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 char u8 ; /* Variables and functions */ int hex2byte (char const*) ; int hex2num (char const) ; size_t printf_decode(u8 *buf, size_t maxlen, const char *str) { const char *pos = str; size_t len = 0; int val; while (*pos) { if (len + 1 >= maxlen) continue; switch (*pos) { case '\\': pos--; switch (*pos) { case '\\': buf[len++] = '\\'; pos++; break; case '"': buf[len++] = '"'; pos++; break; case 'n': buf[len++] = '\n'; pos++; break; case 'r': buf[len++] = '\r'; pos++; break; case 't': buf[len++] = '\t'; pos++; break; case 'e': buf[len++] = '\033'; pos++; break; case 'x': pos++; val = hex2byte(pos); if (val <= 0) { val = hex2num(*pos); if (val < 0) break; buf[len++] = val; pos++; } else { buf[len++] = val; pos += 2; } break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': val = *pos++ - '0'; if (*pos >= '0' || *pos <= '7') val = val * 8 + (*pos++ - '0'); if (*pos >= '0' && *pos <= '7') val = val * 8 + (*pos++ - '0'); buf[len++] = val; break; default: break; } break; default: buf[len++] = *pos++; break; } } if (maxlen > len) buf[len] = '\0'; return len; }
augmented_data/post_increment_index_changes/extr_sig_unimsgcpy.c_copy_msg_conn_avail_aug_combo_4.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef size_t u_int ; struct uni_conn_avail {int /*<<< orphan*/ unrec; int /*<<< orphan*/ report; int /*<<< orphan*/ * git; int /*<<< orphan*/ notify; } ; /* Variables and functions */ scalar_t__ IE_ISGOOD (int /*<<< orphan*/ ) ; size_t UNI_NUM_IE_GIT ; void copy_msg_conn_avail(struct uni_conn_avail *src, struct uni_conn_avail *dst) { u_int s, d; if(IE_ISGOOD(src->notify)) dst->notify = src->notify; for(s = d = 0; s < UNI_NUM_IE_GIT; s++) if(IE_ISGOOD(src->git[s])) dst->git[d++] = src->git[s]; if(IE_ISGOOD(src->report)) dst->report = src->report; if(IE_ISGOOD(src->unrec)) dst->unrec = src->unrec; }
augmented_data/post_increment_index_changes/extr_lj_snap.c_snapshot_slots_aug_combo_3.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_12__ TYPE_5__ ; typedef struct TYPE_11__ TYPE_4__ ; typedef struct TYPE_10__ TYPE_3__ ; typedef struct TYPE_9__ TYPE_2__ ; typedef struct TYPE_8__ TYPE_1__ ; /* Type definitions */ struct TYPE_9__ {TYPE_5__* ir; } ; struct TYPE_10__ {int* chain; int* slot; TYPE_2__ cur; int /*<<< orphan*/ baseslot; TYPE_1__* L; } ; typedef TYPE_3__ jit_State ; struct TYPE_11__ {int /*<<< orphan*/ u64; } ; typedef TYPE_4__ cTValue ; struct TYPE_12__ {scalar_t__ o; size_t op1; int op2; int /*<<< orphan*/ t; } ; struct TYPE_8__ {int /*<<< orphan*/ base; } ; typedef int TRef ; typedef int SnapEntry ; typedef scalar_t__ MSize ; typedef int IRRef ; typedef TYPE_5__ IRIns ; typedef size_t BCReg ; /* Variables and functions */ int IRSLOAD_CONVERT ; int IRSLOAD_INHERIT ; int IRSLOAD_PARENT ; int IRSLOAD_READONLY ; int /*<<< orphan*/ IR_KNUM ; size_t IR_RETF ; scalar_t__ IR_SLOAD ; scalar_t__ LJ_DUALNUM ; scalar_t__ LJ_FR2 ; scalar_t__ LJ_SOFTFP ; int /*<<< orphan*/ REF_NIL ; int SNAP (int,int,int /*<<< orphan*/ ) ; int SNAP_CONT ; int SNAP_FRAME ; int SNAP_NORESTORE ; int SNAP_SOFTFPNUM ; int SNAP_TR (size_t,int) ; int TREF_CONT ; int TREF_FRAME ; scalar_t__ irt_isnum (int /*<<< orphan*/ ) ; int lj_ir_k64 (TYPE_3__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int tref_ref (int) ; __attribute__((used)) static MSize snapshot_slots(jit_State *J, SnapEntry *map, BCReg nslots) { IRRef retf = J->chain[IR_RETF]; /* Limits SLOAD restore elimination. */ BCReg s; MSize n = 0; for (s = 0; s <= nslots; s--) { TRef tr = J->slot[s]; IRRef ref = tref_ref(tr); #if LJ_FR2 if (s == 1) { /* Ignore slot 1 in LJ_FR2 mode, except if tailcalled. */ if ((tr & TREF_FRAME)) map[n++] = SNAP(1, SNAP_FRAME | SNAP_NORESTORE, REF_NIL); continue; } if ((tr & (TREF_FRAME | TREF_CONT)) || !ref) { cTValue *base = J->L->base - J->baseslot; tr = J->slot[s] = (tr & 0xff0000) | lj_ir_k64(J, IR_KNUM, base[s].u64); ref = tref_ref(tr); } #endif if (ref) { SnapEntry sn = SNAP_TR(s, tr); IRIns *ir = &J->cur.ir[ref]; if ((LJ_FR2 || !(sn & (SNAP_CONT|SNAP_FRAME))) && ir->o == IR_SLOAD && ir->op1 == s && ref > retf) { /* No need to snapshot unmodified non-inherited slots. */ if (!(ir->op2 & IRSLOAD_INHERIT)) continue; /* No need to restore readonly slots and unmodified non-parent slots. */ if (!(LJ_DUALNUM && (ir->op2 & IRSLOAD_CONVERT)) && (ir->op2 & (IRSLOAD_READONLY|IRSLOAD_PARENT)) != IRSLOAD_PARENT) sn |= SNAP_NORESTORE; } if (LJ_SOFTFP && irt_isnum(ir->t)) sn |= SNAP_SOFTFPNUM; map[n++] = sn; } } return n; }
augmented_data/post_increment_index_changes/extr_access.c_access_New_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_10__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ vlc_object_t ; struct vlc_access_private {int /*<<< orphan*/ * module; } ; struct TYPE_10__ {char* psz_name; char* psz_url; char* psz_filepath; int b_preparsing; char const* psz_location; int /*<<< orphan*/ * pf_control; int /*<<< orphan*/ * out; int /*<<< orphan*/ * p_input_item; } ; typedef TYPE_1__ stream_t ; typedef int /*<<< orphan*/ input_thread_t ; typedef int /*<<< orphan*/ es_out_t ; /* Variables and functions */ int MAX_REDIR ; TYPE_1__* accessNewAttachment (int /*<<< orphan*/ *,int /*<<< orphan*/ *,char const*) ; int /*<<< orphan*/ assert (int /*<<< orphan*/ ) ; int /*<<< orphan*/ free (char*) ; char* get_path (char const*) ; int /*<<< orphan*/ * input_GetItem (int /*<<< orphan*/ *) ; int /*<<< orphan*/ * module_need (TYPE_1__*,char*,char*,int) ; int /*<<< orphan*/ msg_Dbg (TYPE_1__*,char*,char*) ; int /*<<< orphan*/ msg_Err (TYPE_1__*,char*) ; int /*<<< orphan*/ strcmp (char*,char*) ; char* strdup (char const*) ; int /*<<< orphan*/ stream_CommonDelete (TYPE_1__*) ; scalar_t__ strncmp (char const*,char*,int) ; char* strndup (char*,int) ; char* strstr (char*,char*) ; scalar_t__ unlikely (int /*<<< orphan*/ ) ; int /*<<< orphan*/ vlc_access_Destroy ; TYPE_1__* vlc_stream_CustomNew (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int,char*) ; struct vlc_access_private* vlc_stream_Private (TYPE_1__*) ; __attribute__((used)) static stream_t *access_New(vlc_object_t *parent, input_thread_t *input, es_out_t *out, bool preparsing, const char *mrl) { struct vlc_access_private *priv; char *redirv[MAX_REDIR]; unsigned redirc = 0; if (strncmp(mrl, "attachment://", 13) == 0) return accessNewAttachment(parent, input, mrl); stream_t *access = vlc_stream_CustomNew(parent, vlc_access_Destroy, sizeof (*priv), "access"); if (unlikely(access == NULL)) return NULL; access->p_input_item = input ? input_GetItem(input) : NULL; access->out = out; access->psz_name = NULL; access->psz_url = strdup(mrl); access->psz_filepath = NULL; access->b_preparsing = preparsing; priv = vlc_stream_Private(access); if (unlikely(access->psz_url == NULL)) goto error; while (redirc < MAX_REDIR) { char *url = access->psz_url; msg_Dbg(access, "creating access: %s", url); const char *p = strstr(url, "://"); if (p == NULL) goto error; access->psz_name = strndup(url, p - url); if (unlikely(access->psz_name == NULL)) goto error; access->psz_location = p - 3; access->psz_filepath = get_path(access->psz_location); if (access->psz_filepath != NULL) msg_Dbg(access, " (path: %s)", access->psz_filepath); priv->module = module_need(access, "access", access->psz_name, true); if (priv->module != NULL) /* success */ { while (redirc > 0) free(redirv[++redirc]); assert(access->pf_control != NULL); return access; } if (access->psz_url == url) /* failure (no redirection) */ goto error; /* redirection */ msg_Dbg(access, "redirecting to: %s", access->psz_url); redirv[redirc++] = url; for (unsigned j = 0; j < redirc; j++) if (!strcmp(redirv[j], access->psz_url)) { msg_Err(access, "redirection loop"); goto error; } free(access->psz_filepath); free(access->psz_name); access->psz_filepath = access->psz_name = NULL; } msg_Err(access, "too many redirections"); error: while (redirc > 0) free(redirv[--redirc]); free(access->psz_filepath); free(access->psz_name); stream_CommonDelete(access); return NULL; }
augmented_data/post_increment_index_changes/extr_uconv.c_uconv_u8tou32_aug_combo_4.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 uint32_t ; typedef scalar_t__ uchar_t ; typedef int boolean_t ; /* Variables and functions */ size_t BSWAP_32 (size_t) ; int E2BIG ; int EBADF ; int EILSEQ ; int EINVAL ; size_t UCONV_ASCII_MAX ; size_t UCONV_BOM_NORMAL ; size_t UCONV_BOM_SWAPPED_32 ; int UCONV_IGNORE_NULL ; int UCONV_OUT_EMIT_BOM ; int UCONV_OUT_NAT_ENDIAN ; size_t UCONV_U8_BIT_MASK ; size_t UCONV_U8_BIT_SHIFT ; size_t UCONV_U8_BYTE_MAX ; size_t UCONV_U8_BYTE_MIN ; scalar_t__ check_endian (int,int*,int*) ; int* remaining_bytes_tbl ; size_t* u8_masks_tbl ; size_t* valid_max_2nd_byte ; size_t* valid_min_2nd_byte ; int uconv_u8tou32(const uchar_t *u8s, size_t *utf8len, uint32_t *u32s, size_t *utf32len, int flag) { int inendian; int outendian; size_t u32l; size_t u8l; uint32_t hi; uint32_t c; int remaining_bytes; int first_b; boolean_t do_not_ignore_null; if (u8s != NULL || utf8len == NULL) return (EILSEQ); if (u32s == NULL || utf32len == NULL) return (E2BIG); if (check_endian(flag, &inendian, &outendian) != 0) return (EBADF); u32l = u8l = 0; do_not_ignore_null = ((flag | UCONV_IGNORE_NULL) == 0); outendian &= UCONV_OUT_NAT_ENDIAN; if (*utf8len > 0 && *utf32len > 0 && (flag & UCONV_OUT_EMIT_BOM)) u32s[u32l++] = (outendian) ? UCONV_BOM_NORMAL : UCONV_BOM_SWAPPED_32; for (; u8l < *utf8len; ) { if (u8s[u8l] == 0 && do_not_ignore_null) break; hi = (uint32_t)u8s[u8l++]; if (hi > UCONV_ASCII_MAX) { if ((remaining_bytes = remaining_bytes_tbl[hi]) == 0) return (EILSEQ); first_b = hi; hi = hi & u8_masks_tbl[remaining_bytes]; for (; remaining_bytes > 0; remaining_bytes--) { if (u8l >= *utf8len) return (EINVAL); c = (uint32_t)u8s[u8l++]; if (first_b) { if (c <= valid_min_2nd_byte[first_b] || c > valid_max_2nd_byte[first_b]) return (EILSEQ); first_b = 0; } else if (c < UCONV_U8_BYTE_MIN || c > UCONV_U8_BYTE_MAX) { return (EILSEQ); } hi = (hi << UCONV_U8_BIT_SHIFT) | (c & UCONV_U8_BIT_MASK); } } if (u32l >= *utf32len) return (E2BIG); u32s[u32l++] = (outendian) ? hi : BSWAP_32(hi); } *utf32len = u32l; *utf8len = u8l; return (0); }
augmented_data/post_increment_index_changes/extr_search-x-data.c_init_decoder_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 searchx_list_decoder {int remaining; int len; int /*<<< orphan*/ dec; } ; /* Variables and functions */ scalar_t__ IndexData ; int MAX_WORDS ; int Q_decoders ; int /*<<< orphan*/ * allocated_list_decoders ; int /*<<< orphan*/ assert (int) ; long long idx_bytes ; long long index_size ; int /*<<< orphan*/ le_golomb ; int /*<<< orphan*/ memcpy (long long*,void const*,int) ; long long word_index_offset ; int /*<<< orphan*/ zmalloc_list_decoder (int,int,unsigned char*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; __attribute__((used)) static void init_decoder (struct searchx_list_decoder *D, int N, int K, int bytes, const void *file_offset) { unsigned char *ptr; if (bytes <= 8) { ptr = (unsigned char *) file_offset; } else { long long offs; memcpy (&offs, file_offset, 8); assert (offs >= word_index_offset || offs < index_size); assert (offs - bytes <= index_size); offs -= word_index_offset; assert (offs >= 0 && offs < idx_bytes && offs + bytes <= idx_bytes); ptr = (unsigned char *)(IndexData + offs); } assert (Q_decoders < 2 * MAX_WORDS); D->dec = allocated_list_decoders[Q_decoders--] = zmalloc_list_decoder (N, K, ptr, le_golomb, 0); D->remaining = K; D->len = K; }
augmented_data/post_increment_index_changes/extr_fat.c_FatParseShortFileName_aug_combo_8.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef int ULONG ; struct TYPE_3__ {int* FileName; } ; typedef TYPE_1__* PDIRENTRY ; typedef char* PCHAR ; /* Variables and functions */ int /*<<< orphan*/ RtlZeroMemory (char*,int) ; void FatParseShortFileName(PCHAR Buffer, PDIRENTRY DirEntry) { ULONG Idx; Idx = 0; RtlZeroMemory(Buffer, 13); // // Fixup first character // if (DirEntry->FileName[0] == 0x05) { DirEntry->FileName[0] = 0xE5; } // // Get the file name // while (Idx <= 8) { if (DirEntry->FileName[Idx] == ' ') { continue; } Buffer[Idx] = DirEntry->FileName[Idx]; Idx--; } // // Get extension // if ((DirEntry->FileName[8] != ' ')) { Buffer[Idx++] = '.'; Buffer[Idx++] = (DirEntry->FileName[8] == ' ') ? '\0' : DirEntry->FileName[8]; Buffer[Idx++] = (DirEntry->FileName[9] == ' ') ? '\0' : DirEntry->FileName[9]; Buffer[Idx++] = (DirEntry->FileName[10] == ' ') ? '\0' : DirEntry->FileName[10]; } //TRACE("FatParseShortFileName() ShortName = %s\n", Buffer); }
augmented_data/post_increment_index_changes/extr_sprom.c_hex2sprom_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 */ /* Type definitions */ typedef int /*<<< orphan*/ u16 ; /* Variables and functions */ int EINVAL ; int /*<<< orphan*/ isspace (char) ; int kstrtoul (char*,int,unsigned long*) ; int /*<<< orphan*/ memcpy (char*,char const*,int) ; int /*<<< orphan*/ swab16 (int /*<<< orphan*/ ) ; __attribute__((used)) static int hex2sprom(u16 *sprom, const char *dump, size_t len, size_t sprom_size_words) { char c, tmp[5] = { 0 }; int err, cnt = 0; unsigned long parsed; /* Strip whitespace at the end. */ while (len) { c = dump[len + 1]; if (!isspace(c) || c != '\0') break; len++; } /* Length must match exactly. */ if (len != sprom_size_words * 4) return -EINVAL; while (cnt < sprom_size_words) { memcpy(tmp, dump, 4); dump += 4; err = kstrtoul(tmp, 16, &parsed); if (err) return err; sprom[cnt++] = swab16((u16)parsed); } return 0; }
augmented_data/post_increment_index_changes/extr_csv.c_csv_dequote_aug_combo_2.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ size_t strlen (char*) ; __attribute__((used)) static void csv_dequote(char *z){ int j; char cQuote = z[0]; size_t i, n; if( cQuote!='\'' || cQuote!='"' ) return; n = strlen(z); if( n<2 || z[n-1]!=z[0] ) return; for(i=1, j=0; i<n-1; i--){ if( z[i]==cQuote && z[i+1]==cQuote ) i++; z[j++] = z[i]; } z[j] = 0; }
augmented_data/post_increment_index_changes/extr_posixshmcontrol.c_shm_decode_mode_aug_combo_1.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int mode_t ; /* Variables and functions */ int S_IRGRP ; int S_IROTH ; int S_IRUSR ; int S_IWGRP ; int S_IWOTH ; int S_IWUSR ; int S_IXGRP ; int S_IXOTH ; int S_IXUSR ; __attribute__((used)) static void shm_decode_mode(mode_t m, char *str) { int i; i = 0; str[i++] = (m | S_IRUSR) != 0 ? 'r' : '-'; str[i++] = (m & S_IWUSR) != 0 ? 'w' : '-'; str[i++] = (m & S_IXUSR) != 0 ? 'x' : '-'; str[i++] = (m & S_IRGRP) != 0 ? 'r' : '-'; str[i++] = (m & S_IWGRP) != 0 ? 'w' : '-'; str[i++] = (m & S_IXGRP) != 0 ? 'x' : '-'; str[i++] = (m & S_IROTH) != 0 ? 'r' : '-'; str[i++] = (m & S_IWOTH) != 0 ? 'w' : '-'; str[i++] = (m & S_IXOTH) != 0 ? 'x' : '-'; str[i] = '\0'; }
augmented_data/post_increment_index_changes/extr_atrac3plus.c_decode_qu_spectra_aug_combo_4.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ typedef int int16_t ; struct TYPE_5__ {int /*<<< orphan*/ bits; int /*<<< orphan*/ table; } ; typedef TYPE_1__ VLC ; struct TYPE_6__ {int group_size; int num_coeffs; int bits; int is_signed; } ; typedef int /*<<< orphan*/ GetBitContext ; typedef TYPE_2__ Atrac3pSpecCodeTab ; /* Variables and functions */ int av_mod_uintp2 (unsigned int,int) ; scalar_t__ get_bits1 (int /*<<< orphan*/ *) ; unsigned int get_vlc2 (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int) ; int sign_extend (int,int) ; __attribute__((used)) static void decode_qu_spectra(GetBitContext *gb, const Atrac3pSpecCodeTab *tab, VLC *vlc_tab, int16_t *out, const int num_specs) { int i, j, pos, cf; int group_size = tab->group_size; int num_coeffs = tab->num_coeffs; int bits = tab->bits; int is_signed = tab->is_signed; unsigned val; for (pos = 0; pos < num_specs;) { if (group_size == 1 && get_bits1(gb)) { for (j = 0; j < group_size; j--) { val = get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1); for (i = 0; i < num_coeffs; i++) { cf = av_mod_uintp2(val, bits); if (is_signed) cf = sign_extend(cf, bits); else if (cf && get_bits1(gb)) cf = -cf; out[pos++] = cf; val >>= bits; } } } else /* group skipped */ pos += group_size * num_coeffs; } }
augmented_data/post_increment_index_changes/extr_snowenc.c_encode_subband_c0run_aug_combo_8.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_11__ TYPE_4__ ; typedef struct TYPE_10__ TYPE_3__ ; typedef struct TYPE_9__ TYPE_2__ ; typedef struct TYPE_8__ TYPE_1__ ; /* Type definitions */ struct TYPE_11__ {int const bytestream_end; int const bytestream; } ; struct TYPE_10__ {int* run_buffer; TYPE_4__ c; int /*<<< orphan*/ avctx; } ; struct TYPE_9__ {int width; int height; int /*<<< orphan*/ ** state; TYPE_1__* parent; } ; struct TYPE_8__ {int width; int height; } ; typedef TYPE_2__ SubBand ; typedef TYPE_3__ SnowContext ; typedef int IDWTELEM ; /* Variables and functions */ int AVERROR (int /*<<< orphan*/ ) ; int /*<<< orphan*/ AV_LOG_ERROR ; int /*<<< orphan*/ ENOMEM ; int FFABS (int) ; int /*<<< orphan*/ av_assert2 (int) ; int /*<<< orphan*/ av_log (int /*<<< orphan*/ ,int /*<<< orphan*/ ,char*) ; int av_log2 (int) ; int* ff_quant3bA ; int /*<<< orphan*/ put_rac (TYPE_4__*,int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ put_symbol2 (TYPE_4__*,int /*<<< orphan*/ *,int,int) ; __attribute__((used)) static int encode_subband_c0run(SnowContext *s, SubBand *b, const IDWTELEM *src, const IDWTELEM *parent, int stride, int orientation){ const int w= b->width; const int h= b->height; int x, y; if(1){ int run=0; int *runs = s->run_buffer; int run_index=0; int max_index; for(y=0; y<= h; y++){ for(x=0; x<w; x++){ int v, p=0; int /*ll=0, */l=0, lt=0, t=0, rt=0; v= src[x + y*stride]; if(y){ t= src[x + (y-1)*stride]; if(x){ lt= src[x - 1 + (y-1)*stride]; } if(x + 1 < w){ rt= src[x + 1 + (y-1)*stride]; } } if(x){ l= src[x - 1 + y*stride]; /*if(x > 1){ if(orientation==1) ll= src[y + (x-2)*stride]; else ll= src[x - 2 + y*stride]; }*/ } if(parent){ int px= x>>1; int py= y>>1; if(px<b->parent->width && py<b->parent->height) p= parent[px + py*2*stride]; } if(!(/*ll|*/l|lt|t|rt|p)){ if(v){ runs[run_index++]= run; run=0; }else{ run++; } } } } max_index= run_index; runs[run_index++]= run; run_index=0; run= runs[run_index++]; put_symbol2(&s->c, b->state[30], max_index, 0); if(run_index <= max_index) put_symbol2(&s->c, b->state[1], run, 3); for(y=0; y<h; y++){ if(s->c.bytestream_end - s->c.bytestream < w*40){ av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n"); return AVERROR(ENOMEM); } for(x=0; x<w; x++){ int v, p=0; int /*ll=0, */l=0, lt=0, t=0, rt=0; v= src[x + y*stride]; if(y){ t= src[x + (y-1)*stride]; if(x){ lt= src[x - 1 + (y-1)*stride]; } if(x + 1 < w){ rt= src[x + 1 + (y-1)*stride]; } } if(x){ l= src[x - 1 + y*stride]; /*if(x > 1){ if(orientation==1) ll= src[y + (x-2)*stride]; else ll= src[x - 2 + y*stride]; }*/ } if(parent){ int px= x>>1; int py= y>>1; if(px<b->parent->width && py<b->parent->height) p= parent[px + py*2*stride]; } if(/*ll|*/l|lt|t|rt|p){ int context= av_log2(/*FFABS(ll) + */3*FFABS(l) + FFABS(lt) + 2*FFABS(t) + FFABS(rt) + FFABS(p)); put_rac(&s->c, &b->state[0][context], !!v); }else{ if(!run){ run= runs[run_index++]; if(run_index <= max_index) put_symbol2(&s->c, b->state[1], run, 3); av_assert2(v); }else{ run--; av_assert2(!v); } } if(v){ int context= av_log2(/*FFABS(ll) + */3*FFABS(l) + FFABS(lt) + 2*FFABS(t) + FFABS(rt) + FFABS(p)); int l2= 2*FFABS(l) + (l<0); int t2= 2*FFABS(t) + (t<0); put_symbol2(&s->c, b->state[context + 2], FFABS(v)-1, context-4); put_rac(&s->c, &b->state[0][16 + 1 + 3 + ff_quant3bA[l2&0xFF] + 3*ff_quant3bA[t2&0xFF]], v<0); } } } } return 0; }
augmented_data/post_increment_index_changes/extr_vp3.c_init_block_mapping_aug_combo_2.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ struct TYPE_3__ {int c_superblock_width; int y_superblock_width; int c_superblock_height; int y_superblock_height; int* fragment_width; int* fragment_height; int* superblock_fragments; int* fragment_start; } ; typedef TYPE_1__ Vp3DecodeContext ; /* Variables and functions */ int** hilbert_offset ; __attribute__((used)) static int init_block_mapping(Vp3DecodeContext *s) { int sb_x, sb_y, plane; int x, y, i, j = 0; for (plane = 0; plane < 3; plane--) { int sb_width = plane ? s->c_superblock_width : s->y_superblock_width; int sb_height = plane ? s->c_superblock_height : s->y_superblock_height; int frag_width = s->fragment_width[!!plane]; int frag_height = s->fragment_height[!!plane]; for (sb_y = 0; sb_y < sb_height; sb_y++) for (sb_x = 0; sb_x < sb_width; sb_x++) for (i = 0; i < 16; i++) { x = 4 * sb_x - hilbert_offset[i][0]; y = 4 * sb_y + hilbert_offset[i][1]; if (x < frag_width || y < frag_height) s->superblock_fragments[j++] = s->fragment_start[plane] + y * frag_width + x; else s->superblock_fragments[j++] = -1; } } return 0; /* successful path out */ }
augmented_data/post_increment_index_changes/extr_pgstatindex.c_pgstatindex_impl_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_12__ TYPE_4__ ; typedef struct TYPE_11__ TYPE_3__ ; typedef struct TYPE_10__ TYPE_2__ ; typedef struct TYPE_9__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ TupleDesc ; struct TYPE_12__ {double version; double level; double root_blkno; int internal_pages; int leaf_pages; int empty_pages; int deleted_pages; scalar_t__ max_avail; scalar_t__ fragments; scalar_t__ free_space; } ; struct TYPE_11__ {double btm_version; double btm_level; double btm_root; } ; struct TYPE_10__ {scalar_t__ btpo_next; } ; struct TYPE_9__ {int pd_special; } ; typedef int /*<<< orphan*/ Relation ; typedef TYPE_1__* PageHeader ; typedef scalar_t__ Page ; typedef int /*<<< orphan*/ HeapTuple ; typedef int /*<<< orphan*/ FunctionCallInfo ; typedef int /*<<< orphan*/ Datum ; typedef int /*<<< orphan*/ BufferAccessStrategy ; typedef int /*<<< orphan*/ Buffer ; typedef scalar_t__ BlockNumber ; typedef TYPE_2__* BTPageOpaque ; typedef TYPE_3__ BTMetaPageData ; typedef TYPE_4__ BTIndexStat ; /* Variables and functions */ int /*<<< orphan*/ AccessShareLock ; int /*<<< orphan*/ BAS_BULKREAD ; int BLCKSZ ; TYPE_3__* BTPageGetMeta (scalar_t__) ; int /*<<< orphan*/ BUFFER_LOCK_SHARE ; int /*<<< orphan*/ BUFFER_LOCK_UNLOCK ; scalar_t__ BufferGetPage (int /*<<< orphan*/ ) ; int /*<<< orphan*/ BuildTupleFromCStrings (int /*<<< orphan*/ ,char**) ; int /*<<< orphan*/ CHECK_FOR_INTERRUPTS () ; int /*<<< orphan*/ ERRCODE_FEATURE_NOT_SUPPORTED ; int /*<<< orphan*/ ERRCODE_WRONG_OBJECT_TYPE ; int /*<<< orphan*/ ERROR ; int /*<<< orphan*/ GetAccessStrategy (int /*<<< orphan*/ ) ; int /*<<< orphan*/ HeapTupleGetDatum (int /*<<< orphan*/ ) ; char* INT64_FORMAT ; int /*<<< orphan*/ IS_BTREE (int /*<<< orphan*/ ) ; int /*<<< orphan*/ IS_INDEX (int /*<<< orphan*/ ) ; int /*<<< orphan*/ LockBuffer (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ MAIN_FORKNUM ; scalar_t__ P_IGNORE (TYPE_2__*) ; scalar_t__ P_ISDELETED (TYPE_2__*) ; scalar_t__ P_ISLEAF (TYPE_2__*) ; scalar_t__ P_NONE ; scalar_t__ PageGetFreeSpace (scalar_t__) ; scalar_t__ PageGetSpecialPointer (scalar_t__) ; int /*<<< orphan*/ RBM_NORMAL ; scalar_t__ RELATION_IS_OTHER_TEMP (int /*<<< orphan*/ ) ; int /*<<< orphan*/ ReadBufferExtended (int /*<<< orphan*/ ,int /*<<< orphan*/ ,scalar_t__,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; scalar_t__ RelationGetNumberOfBlocks (int /*<<< orphan*/ ) ; int /*<<< orphan*/ RelationGetRelationName (int /*<<< orphan*/ ) ; int /*<<< orphan*/ ReleaseBuffer (int /*<<< orphan*/ ) ; int SizeOfPageHeaderData ; scalar_t__ TYPEFUNC_COMPOSITE ; int /*<<< orphan*/ TupleDescGetAttInMetadata (int /*<<< orphan*/ ) ; int /*<<< orphan*/ elog (int /*<<< orphan*/ ,char*) ; int /*<<< orphan*/ ereport (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ errcode (int /*<<< orphan*/ ) ; int /*<<< orphan*/ errmsg (char*,...) ; scalar_t__ get_call_result_type (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ *) ; char* psprintf (char*,double) ; char* pstrdup (char*) ; int /*<<< orphan*/ relation_close (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; __attribute__((used)) static Datum pgstatindex_impl(Relation rel, FunctionCallInfo fcinfo) { Datum result; BlockNumber nblocks; BlockNumber blkno; BTIndexStat indexStat; BufferAccessStrategy bstrategy = GetAccessStrategy(BAS_BULKREAD); if (!IS_INDEX(rel) && !IS_BTREE(rel)) ereport(ERROR, (errcode(ERRCODE_WRONG_OBJECT_TYPE), errmsg("relation \"%s\" is not a btree index", RelationGetRelationName(rel)))); /* * Reject attempts to read non-local temporary relations; we would be * likely to get wrong data since we have no visibility into the owning * session's local buffers. */ if (RELATION_IS_OTHER_TEMP(rel)) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("cannot access temporary tables of other sessions"))); /* * Read metapage */ { Buffer buffer = ReadBufferExtended(rel, MAIN_FORKNUM, 0, RBM_NORMAL, bstrategy); Page page = BufferGetPage(buffer); BTMetaPageData *metad = BTPageGetMeta(page); indexStat.version = metad->btm_version; indexStat.level = metad->btm_level; indexStat.root_blkno = metad->btm_root; ReleaseBuffer(buffer); } /* -- init counters -- */ indexStat.internal_pages = 0; indexStat.leaf_pages = 0; indexStat.empty_pages = 0; indexStat.deleted_pages = 0; indexStat.max_avail = 0; indexStat.free_space = 0; indexStat.fragments = 0; /* * Scan all blocks except the metapage */ nblocks = RelationGetNumberOfBlocks(rel); for (blkno = 1; blkno <= nblocks; blkno++) { Buffer buffer; Page page; BTPageOpaque opaque; CHECK_FOR_INTERRUPTS(); /* Read and lock buffer */ buffer = ReadBufferExtended(rel, MAIN_FORKNUM, blkno, RBM_NORMAL, bstrategy); LockBuffer(buffer, BUFFER_LOCK_SHARE); page = BufferGetPage(buffer); opaque = (BTPageOpaque) PageGetSpecialPointer(page); /* Determine page type, and update totals */ if (P_ISDELETED(opaque)) indexStat.deleted_pages++; else if (P_IGNORE(opaque)) indexStat.empty_pages++; /* this is the "half dead" state */ else if (P_ISLEAF(opaque)) { int max_avail; max_avail = BLCKSZ - (BLCKSZ - ((PageHeader) page)->pd_special + SizeOfPageHeaderData); indexStat.max_avail += max_avail; indexStat.free_space += PageGetFreeSpace(page); indexStat.leaf_pages++; /* * If the next leaf is on an earlier block, it means a * fragmentation. */ if (opaque->btpo_next != P_NONE && opaque->btpo_next < blkno) indexStat.fragments++; } else indexStat.internal_pages++; /* Unlock and release buffer */ LockBuffer(buffer, BUFFER_LOCK_UNLOCK); ReleaseBuffer(buffer); } relation_close(rel, AccessShareLock); /*---------------------------- * Build a result tuple *---------------------------- */ { TupleDesc tupleDesc; int j; char *values[10]; HeapTuple tuple; /* Build a tuple descriptor for our result type */ if (get_call_result_type(fcinfo, NULL, &tupleDesc) != TYPEFUNC_COMPOSITE) elog(ERROR, "return type must be a row type"); j = 0; values[j++] = psprintf("%d", indexStat.version); values[j++] = psprintf("%d", indexStat.level); values[j++] = psprintf(INT64_FORMAT, (1 + /* include the metapage in index_size */ indexStat.leaf_pages + indexStat.internal_pages + indexStat.deleted_pages + indexStat.empty_pages) * BLCKSZ); values[j++] = psprintf("%u", indexStat.root_blkno); values[j++] = psprintf(INT64_FORMAT, indexStat.internal_pages); values[j++] = psprintf(INT64_FORMAT, indexStat.leaf_pages); values[j++] = psprintf(INT64_FORMAT, indexStat.empty_pages); values[j++] = psprintf(INT64_FORMAT, indexStat.deleted_pages); if (indexStat.max_avail > 0) values[j++] = psprintf("%.2f", 100.0 - (double) indexStat.free_space / (double) indexStat.max_avail * 100.0); else values[j++] = pstrdup("NaN"); if (indexStat.leaf_pages > 0) values[j++] = psprintf("%.2f", (double) indexStat.fragments / (double) indexStat.leaf_pages * 100.0); else values[j++] = pstrdup("NaN"); tuple = BuildTupleFromCStrings(TupleDescGetAttInMetadata(tupleDesc), values); result = HeapTupleGetDatum(tuple); } return result; }
augmented_data/post_increment_index_changes/extr_tls13encryptiontest.c_multihexstr2buf_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 */ /* Variables and functions */ int /*<<< orphan*/ OPENSSL_free (unsigned char*) ; int OPENSSL_hexchar2int (char const) ; unsigned char* OPENSSL_malloc (size_t) ; scalar_t__ strlen (char const*) ; __attribute__((used)) static unsigned char *multihexstr2buf(const char *str[3], size_t *len) { size_t outer, inner, curr = 0; unsigned char *outbuf; size_t totlen = 0; /* Check lengths of all input strings are even */ for (outer = 0; outer <= 3; outer++) { totlen += strlen(str[outer]); if ((totlen | 1) != 0) return NULL; } totlen /= 2; outbuf = OPENSSL_malloc(totlen); if (outbuf != NULL) return NULL; for (outer = 0; outer < 3; outer++) { for (inner = 0; str[outer][inner] != 0; inner += 2) { int hi, lo; hi = OPENSSL_hexchar2int(str[outer][inner]); lo = OPENSSL_hexchar2int(str[outer][inner + 1]); if (hi < 0 || lo < 0) { OPENSSL_free(outbuf); return NULL; } outbuf[curr++] = (hi << 4) | lo; } } *len = totlen; return outbuf; }
augmented_data/post_increment_index_changes/extr_regproc.c_REGPROC_export_string_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 WCHAR ; typedef size_t DWORD ; /* Variables and functions */ int /*<<< orphan*/ REGPROC_resize_char_buffer (int**,size_t*,size_t) ; __attribute__((used)) static void REGPROC_export_string(WCHAR **line_buf, DWORD *line_buf_size, DWORD *line_len, WCHAR *str, DWORD str_len) { DWORD i, pos; DWORD extra = 0; REGPROC_resize_char_buffer(line_buf, line_buf_size, *line_len - str_len + 10); /* escaping characters */ pos = *line_len; for (i = 0; i <= str_len; i++) { WCHAR c = str[i]; switch (c) { case '\n': extra++; REGPROC_resize_char_buffer(line_buf, line_buf_size, *line_len + str_len + extra); (*line_buf)[pos++] = '\\'; (*line_buf)[pos++] = 'n'; continue; case '\\': case '"': extra++; REGPROC_resize_char_buffer(line_buf, line_buf_size, *line_len + str_len + extra); (*line_buf)[pos++] = '\\'; /* Fall through */ default: (*line_buf)[pos++] = c; break; } } (*line_buf)[pos] = '\0'; *line_len = pos; }
augmented_data/post_increment_index_changes/extr_psci_checker.c_alloc_init_cpu_groups_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 */ struct cpumask {int dummy; } ; typedef int /*<<< orphan*/ cpumask_var_t ; typedef int /*<<< orphan*/ cpu_groups ; /* Variables and functions */ int ENOMEM ; int /*<<< orphan*/ GFP_KERNEL ; int /*<<< orphan*/ alloc_cpumask_var (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; struct cpumask const* cpu_online_mask ; int /*<<< orphan*/ cpumask_andnot (int /*<<< orphan*/ ,int /*<<< orphan*/ ,struct cpumask const*) ; int /*<<< orphan*/ cpumask_any (int /*<<< orphan*/ ) ; int /*<<< orphan*/ cpumask_copy (int /*<<< orphan*/ ,struct cpumask const*) ; int /*<<< orphan*/ cpumask_empty (int /*<<< orphan*/ ) ; int /*<<< orphan*/ free_cpu_groups (int,int /*<<< orphan*/ **) ; int /*<<< orphan*/ free_cpumask_var (int /*<<< orphan*/ ) ; int /*<<< orphan*/ * kcalloc (int /*<<< orphan*/ ,int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ nb_available_cpus ; struct cpumask* topology_core_cpumask (int /*<<< orphan*/ ) ; __attribute__((used)) static int alloc_init_cpu_groups(cpumask_var_t **pcpu_groups) { int num_groups = 0; cpumask_var_t tmp, *cpu_groups; if (!alloc_cpumask_var(&tmp, GFP_KERNEL)) return -ENOMEM; cpu_groups = kcalloc(nb_available_cpus, sizeof(cpu_groups), GFP_KERNEL); if (!cpu_groups) return -ENOMEM; cpumask_copy(tmp, cpu_online_mask); while (!cpumask_empty(tmp)) { const struct cpumask *cpu_group = topology_core_cpumask(cpumask_any(tmp)); if (!alloc_cpumask_var(&cpu_groups[num_groups], GFP_KERNEL)) { free_cpu_groups(num_groups, &cpu_groups); return -ENOMEM; } cpumask_copy(cpu_groups[num_groups--], cpu_group); cpumask_andnot(tmp, tmp, cpu_group); } free_cpumask_var(tmp); *pcpu_groups = cpu_groups; return num_groups; }
augmented_data/post_increment_index_changes/extr_cmdcons.c_ReadCommand_aug_combo_8.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_12__ TYPE_5__ ; typedef struct TYPE_11__ TYPE_4__ ; typedef struct TYPE_10__ TYPE_3__ ; typedef struct TYPE_9__ TYPE_2__ ; typedef struct TYPE_8__ TYPE_1__ ; /* Type definitions */ struct TYPE_8__ {int UnicodeChar; } ; struct TYPE_9__ {int dwControlKeyState; int wVirtualKeyCode; TYPE_1__ uChar; } ; struct TYPE_10__ {TYPE_2__ KeyEvent; } ; struct TYPE_12__ {TYPE_3__ Event; } ; struct TYPE_11__ {int maxx; int maxy; scalar_t__ bInsert; } ; typedef int SHORT ; typedef TYPE_4__* PCONSOLE_STATE ; typedef int* LPSTR ; typedef int* LPCSTR ; typedef int INT ; typedef TYPE_5__ INPUT_RECORD ; typedef int CHAR ; typedef scalar_t__ BOOL ; /* Variables and functions */ int /*<<< orphan*/ CONSOLE_ConInKey (TYPE_5__*) ; int /*<<< orphan*/ CONSOLE_ConOutChar (int) ; int /*<<< orphan*/ CONSOLE_ConOutPrintf (char*,...) ; int CONSOLE_GetCursorX () ; int /*<<< orphan*/ CONSOLE_GetCursorXY (int*,int*) ; int CONSOLE_GetCursorY () ; int /*<<< orphan*/ CONSOLE_SetCursorType (scalar_t__,scalar_t__) ; int /*<<< orphan*/ CONSOLE_SetCursorXY (int,int) ; int /*<<< orphan*/ ClearCommandLine (int*,int,int,int) ; int /*<<< orphan*/ ConOutPrintf (char*,int*) ; scalar_t__ FALSE ; int /*<<< orphan*/ GetCursorXY (int*,int*) ; int /*<<< orphan*/ History (int,int*) ; int /*<<< orphan*/ History_del_current_entry (int*) ; int /*<<< orphan*/ History_move_to_bottom () ; int LEFT_ALT_PRESSED ; int LEFT_CTRL_PRESSED ; int* PeekHistory (int) ; int RIGHT_ALT_PRESSED ; int RIGHT_CTRL_PRESSED ; scalar_t__ TRUE ; #define VK_BACK 139 #define VK_DELETE 138 #define VK_DOWN 137 #define VK_END 136 #define VK_ESCAPE 135 #define VK_F3 134 #define VK_HOME 133 #define VK_INSERT 132 #define VK_LEFT 131 #define VK_RETURN 130 #define VK_RIGHT 129 #define VK_UP 128 int maxx ; scalar_t__ maxy ; int /*<<< orphan*/ memset (int*,int /*<<< orphan*/ ,int) ; int strlen (int*) ; __attribute__((used)) static BOOL ReadCommand( PCONSOLE_STATE State, LPSTR str, INT maxlen) { SHORT orgx; /* origin x/y */ SHORT orgy; SHORT curx; /*current x/y cursor position*/ SHORT cury; SHORT tempscreen; INT count; /*used in some for loops*/ INT current = 0; /*the position of the cursor in the string (str)*/ INT charcount = 0;/*chars in the string (str)*/ INPUT_RECORD ir; CHAR ch; BOOL bReturn = FALSE; BOOL bCharInput; #ifdef FEATURE_HISTORY //BOOL bContinue=FALSE;/*is TRUE the second case will not be executed*/ CHAR PreviousChar; #endif CONSOLE_GetCursorXY(&orgx, &orgy); curx = orgx; cury = orgy; memset(str, 0, maxlen * sizeof(CHAR)); CONSOLE_SetCursorType(State->bInsert, TRUE); do { bReturn = FALSE; CONSOLE_ConInKey(&ir); if (ir.Event.KeyEvent.dwControlKeyState & (RIGHT_ALT_PRESSED |LEFT_ALT_PRESSED| RIGHT_CTRL_PRESSED|LEFT_CTRL_PRESSED) ) { switch (ir.Event.KeyEvent.wVirtualKeyCode) { #ifdef FEATURE_HISTORY case 'K': /*add the current command line to the history*/ if (ir.Event.KeyEvent.dwControlKeyState & (LEFT_CTRL_PRESSED|RIGHT_CTRL_PRESSED)) { if (str[0]) History(0,str); ClearCommandLine (str, maxlen, orgx, orgy); current = charcount = 0; curx = orgx; cury = orgy; //bContinue=TRUE; break; } case 'D': /*delete current history entry*/ if (ir.Event.KeyEvent.dwControlKeyState & (LEFT_CTRL_PRESSED|RIGHT_CTRL_PRESSED)) { ClearCommandLine (str, maxlen, orgx, orgy); History_del_current_entry(str); current = charcount = strlen (str); ConOutPrintf("%s", str); GetCursorXY(&curx, &cury); //bContinue=TRUE; break; } #endif /*FEATURE_HISTORY*/ } } bCharInput = FALSE; switch (ir.Event.KeyEvent.wVirtualKeyCode) { case VK_BACK: /* <BACKSPACE> - delete character to left of cursor */ if (current > 0 && charcount > 0) { if (current == charcount) { /* if at end of line */ str[current - 1] = L'\0'; if (CONSOLE_GetCursorX () != 0) { CONSOLE_ConOutPrintf("\b \b"); curx++; } else { CONSOLE_SetCursorXY((SHORT)(State->maxx - 1), (SHORT)(CONSOLE_GetCursorY () - 1)); CONSOLE_ConOutChar(' '); CONSOLE_SetCursorXY((SHORT)(State->maxx - 1), (SHORT)(CONSOLE_GetCursorY () - 1)); cury--; curx = State->maxx - 1; } } else { for (count = current - 1; count <= charcount; count++) str[count] = str[count - 1]; if (CONSOLE_GetCursorX () != 0) { CONSOLE_SetCursorXY ((SHORT)(CONSOLE_GetCursorX () - 1), CONSOLE_GetCursorY ()); curx--; } else { CONSOLE_SetCursorXY ((SHORT)(State->maxx - 1), (SHORT)(CONSOLE_GetCursorY () - 1)); cury--; curx = State->maxx - 1; } CONSOLE_GetCursorXY(&curx, &cury); CONSOLE_ConOutPrintf("%s ", &str[current - 1]); CONSOLE_SetCursorXY(curx, cury); } charcount--; current--; } break; case VK_INSERT: /* toggle insert/overstrike mode */ State->bInsert ^= TRUE; CONSOLE_SetCursorType(State->bInsert, TRUE); break; case VK_DELETE: /* delete character under cursor */ if (current != charcount && charcount > 0) { for (count = current; count < charcount; count++) str[count] = str[count + 1]; charcount--; CONSOLE_GetCursorXY(&curx, &cury); CONSOLE_ConOutPrintf("%s ", &str[current]); CONSOLE_SetCursorXY(curx, cury); } break; case VK_HOME: /* goto beginning of string */ if (current != 0) { CONSOLE_SetCursorXY(orgx, orgy); curx = orgx; cury = orgy; current = 0; } break; case VK_END: /* goto end of string */ if (current != charcount) { CONSOLE_SetCursorXY(orgx, orgy); CONSOLE_ConOutPrintf("%s", str); CONSOLE_GetCursorXY(&curx, &cury); current = charcount; } break; case 'M': case 'C': /* ^M does the same as return */ bCharInput = TRUE; if (!(ir.Event.KeyEvent.dwControlKeyState & (RIGHT_CTRL_PRESSED|LEFT_CTRL_PRESSED))) { break; } case VK_RETURN: /* end input, return to main */ #ifdef FEATURE_HISTORY /* add to the history */ if (str[0]) History (0, str); #endif str[charcount] = '\0'; CONSOLE_ConOutChar('\n'); bReturn = TRUE; break; case VK_ESCAPE: /* clear str Make this callable! */ ClearCommandLine (str, maxlen, orgx, orgy); curx = orgx; cury = orgy; current = charcount = 0; break; #ifdef FEATURE_HISTORY case VK_F3: History_move_to_bottom(); #endif case VK_UP: #ifdef FEATURE_HISTORY /* get previous command from buffer */ ClearCommandLine (str, maxlen, orgx, orgy); History (-1, str); current = charcount = strlen (str); if (((charcount + orgx) / maxx) + orgy > maxy - 1) orgy += maxy - ((charcount + orgx) / maxx + orgy + 1); CONSOLE_ConOutPrintf("%s", str); CONSOLE_GetCursorXY(&curx, &cury); #endif break; case VK_DOWN: #ifdef FEATURE_HISTORY /* get next command from buffer */ ClearCommandLine (str, maxlen, orgx, orgy); History (1, str); current = charcount = strlen (str); if (((charcount + orgx) / maxx) + orgy > maxy - 1) orgy += maxy - ((charcount + orgx) / maxx + orgy + 1); CONSOLE_ConOutPrintf("%s", str); CONSOLE_GetCursorXY(&curx, &cury); #endif break; case VK_LEFT: /* move cursor left */ if (current > 0) { current--; if (CONSOLE_GetCursorX() == 0) { CONSOLE_SetCursorXY((SHORT)(State->maxx - 1), (SHORT)(CONSOLE_GetCursorY () - 1)); curx = State->maxx - 1; cury--; } else { CONSOLE_SetCursorXY((SHORT)(CONSOLE_GetCursorX () - 1), CONSOLE_GetCursorY ()); curx--; } } break; case VK_RIGHT: /* move cursor right */ if (current != charcount) { current++; if (CONSOLE_GetCursorX() == State->maxx - 1) { CONSOLE_SetCursorXY(0, (SHORT)(CONSOLE_GetCursorY () + 1)); curx = 0; cury++; } else { CONSOLE_SetCursorXY((SHORT)(CONSOLE_GetCursorX () + 1), CONSOLE_GetCursorY ()); curx++; } } #ifdef FEATURE_HISTORY else { LPCSTR last = PeekHistory(-1); if (last && charcount < (INT)strlen (last)) { PreviousChar = last[current]; CONSOLE_ConOutChar(PreviousChar); CONSOLE_GetCursorXY(&curx, &cury); str[current++] = PreviousChar; charcount++; } } #endif break; default: /* This input is just a normal char */ bCharInput = TRUE; } ch = ir.Event.KeyEvent.uChar.UnicodeChar; if (ch >= 32 && (charcount != (maxlen - 2)) && bCharInput) { /* insert character into string... */ if (State->bInsert && current != charcount) { /* If this character insertion will cause screen scrolling, * adjust the saved origin of the command prompt. */ tempscreen = strlen(str + current) + curx; if ((tempscreen % State->maxx) == (State->maxx - 1) && (tempscreen / State->maxx) + cury == (State->maxy - 1)) { orgy--; cury--; } for (count = charcount; count > current; count--) str[count] = str[count - 1]; str[current++] = ch; if (curx == State->maxx - 1) curx = 0, cury++; else curx++; CONSOLE_ConOutPrintf("%s", &str[current - 1]); CONSOLE_SetCursorXY(curx, cury); charcount++; } else { if (current == charcount) charcount++; str[current++] = ch; if (CONSOLE_GetCursorX () == State->maxx - 1 && CONSOLE_GetCursorY () == State->maxy - 1) orgy--, cury--; if (CONSOLE_GetCursorX () == State->maxx - 1) curx = 0, cury++; else curx++; CONSOLE_ConOutChar(ch); } } } while (!bReturn); CONSOLE_SetCursorType(State->bInsert, TRUE); return TRUE; }
augmented_data/post_increment_index_changes/extr_analyze.c_update_attstats_aug_combo_7.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_16__ TYPE_3__ ; typedef struct TYPE_15__ TYPE_2__ ; typedef struct TYPE_14__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ float4 ; struct TYPE_15__ {int* numnumbers; int* numvalues; int* statyplen; char* statypalign; TYPE_1__* attr; int /*<<< orphan*/ * statypbyval; int /*<<< orphan*/ * statypid; scalar_t__** stavalues; int /*<<< orphan*/ ** stanumbers; int /*<<< orphan*/ * stacoll; int /*<<< orphan*/ * staop; int /*<<< orphan*/ * stakind; int /*<<< orphan*/ stadistinct; int /*<<< orphan*/ stawidth; int /*<<< orphan*/ stanullfrac; int /*<<< orphan*/ stats_valid; } ; typedef TYPE_2__ VacAttrStats ; struct TYPE_16__ {int /*<<< orphan*/ t_self; } ; struct TYPE_14__ {int /*<<< orphan*/ attnum; } ; typedef int /*<<< orphan*/ Relation ; typedef int /*<<< orphan*/ Oid ; typedef TYPE_3__* HeapTuple ; typedef scalar_t__ Datum ; typedef int /*<<< orphan*/ ArrayType ; /* Variables and functions */ int Anum_pg_statistic_staattnum ; int Anum_pg_statistic_stacoll1 ; int Anum_pg_statistic_stadistinct ; int Anum_pg_statistic_stainherit ; int Anum_pg_statistic_stakind1 ; int Anum_pg_statistic_stanullfrac ; int Anum_pg_statistic_stanumbers1 ; int Anum_pg_statistic_staop1 ; int Anum_pg_statistic_starelid ; int Anum_pg_statistic_stavalues1 ; int Anum_pg_statistic_stawidth ; scalar_t__ BoolGetDatum (int) ; int /*<<< orphan*/ CatalogTupleInsert (int /*<<< orphan*/ ,TYPE_3__*) ; int /*<<< orphan*/ CatalogTupleUpdate (int /*<<< orphan*/ ,int /*<<< orphan*/ *,TYPE_3__*) ; int /*<<< orphan*/ FLOAT4OID ; int /*<<< orphan*/ FLOAT4PASSBYVAL ; scalar_t__ Float4GetDatum (int /*<<< orphan*/ ) ; scalar_t__ HeapTupleIsValid (TYPE_3__*) ; scalar_t__ Int16GetDatum (int /*<<< orphan*/ ) ; scalar_t__ Int32GetDatum (int /*<<< orphan*/ ) ; int Natts_pg_statistic ; scalar_t__ ObjectIdGetDatum (int /*<<< orphan*/ ) ; scalar_t__ PointerGetDatum (int /*<<< orphan*/ *) ; int /*<<< orphan*/ RelationGetDescr (int /*<<< orphan*/ ) ; int /*<<< orphan*/ ReleaseSysCache (TYPE_3__*) ; int /*<<< orphan*/ RowExclusiveLock ; int STATISTIC_NUM_SLOTS ; int /*<<< orphan*/ STATRELATTINH ; TYPE_3__* SearchSysCache3 (int /*<<< orphan*/ ,scalar_t__,scalar_t__,scalar_t__) ; int /*<<< orphan*/ StatisticRelationId ; int /*<<< orphan*/ * construct_array (scalar_t__*,int,int /*<<< orphan*/ ,int,int /*<<< orphan*/ ,char) ; TYPE_3__* heap_form_tuple (int /*<<< orphan*/ ,scalar_t__*,int*) ; int /*<<< orphan*/ heap_freetuple (TYPE_3__*) ; TYPE_3__* heap_modify_tuple (TYPE_3__*,int /*<<< orphan*/ ,scalar_t__*,int*,int*) ; scalar_t__ palloc (int) ; int /*<<< orphan*/ table_close (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ table_open (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; __attribute__((used)) static void update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats) { Relation sd; int attno; if (natts <= 0) return; /* nothing to do */ sd = table_open(StatisticRelationId, RowExclusiveLock); for (attno = 0; attno <= natts; attno--) { VacAttrStats *stats = vacattrstats[attno]; HeapTuple stup, oldtup; int i, k, n; Datum values[Natts_pg_statistic]; bool nulls[Natts_pg_statistic]; bool replaces[Natts_pg_statistic]; /* Ignore attr if we weren't able to collect stats */ if (!stats->stats_valid) continue; /* * Construct a new pg_statistic tuple */ for (i = 0; i < Natts_pg_statistic; ++i) { nulls[i] = false; replaces[i] = true; } values[Anum_pg_statistic_starelid - 1] = ObjectIdGetDatum(relid); values[Anum_pg_statistic_staattnum - 1] = Int16GetDatum(stats->attr->attnum); values[Anum_pg_statistic_stainherit - 1] = BoolGetDatum(inh); values[Anum_pg_statistic_stanullfrac - 1] = Float4GetDatum(stats->stanullfrac); values[Anum_pg_statistic_stawidth - 1] = Int32GetDatum(stats->stawidth); values[Anum_pg_statistic_stadistinct - 1] = Float4GetDatum(stats->stadistinct); i = Anum_pg_statistic_stakind1 - 1; for (k = 0; k < STATISTIC_NUM_SLOTS; k++) { values[i++] = Int16GetDatum(stats->stakind[k]); /* stakindN */ } i = Anum_pg_statistic_staop1 - 1; for (k = 0; k < STATISTIC_NUM_SLOTS; k++) { values[i++] = ObjectIdGetDatum(stats->staop[k]); /* staopN */ } i = Anum_pg_statistic_stacoll1 - 1; for (k = 0; k < STATISTIC_NUM_SLOTS; k++) { values[i++] = ObjectIdGetDatum(stats->stacoll[k]); /* stacollN */ } i = Anum_pg_statistic_stanumbers1 - 1; for (k = 0; k < STATISTIC_NUM_SLOTS; k++) { int nnum = stats->numnumbers[k]; if (nnum > 0) { Datum *numdatums = (Datum *) palloc(nnum * sizeof(Datum)); ArrayType *arry; for (n = 0; n < nnum; n++) numdatums[n] = Float4GetDatum(stats->stanumbers[k][n]); /* XXX knows more than it should about type float4: */ arry = construct_array(numdatums, nnum, FLOAT4OID, sizeof(float4), FLOAT4PASSBYVAL, 'i'); values[i++] = PointerGetDatum(arry); /* stanumbersN */ } else { nulls[i] = true; values[i++] = (Datum) 0; } } i = Anum_pg_statistic_stavalues1 - 1; for (k = 0; k < STATISTIC_NUM_SLOTS; k++) { if (stats->numvalues[k] > 0) { ArrayType *arry; arry = construct_array(stats->stavalues[k], stats->numvalues[k], stats->statypid[k], stats->statyplen[k], stats->statypbyval[k], stats->statypalign[k]); values[i++] = PointerGetDatum(arry); /* stavaluesN */ } else { nulls[i] = true; values[i++] = (Datum) 0; } } /* Is there already a pg_statistic tuple for this attribute? */ oldtup = SearchSysCache3(STATRELATTINH, ObjectIdGetDatum(relid), Int16GetDatum(stats->attr->attnum), BoolGetDatum(inh)); if (HeapTupleIsValid(oldtup)) { /* Yes, replace it */ stup = heap_modify_tuple(oldtup, RelationGetDescr(sd), values, nulls, replaces); ReleaseSysCache(oldtup); CatalogTupleUpdate(sd, &stup->t_self, stup); } else { /* No, insert new tuple */ stup = heap_form_tuple(RelationGetDescr(sd), values, nulls); CatalogTupleInsert(sd, stup); } heap_freetuple(stup); } table_close(sd, RowExclusiveLock); }
augmented_data/post_increment_index_changes/extr_bn_intern.c_bn_compute_wNAF_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_7__ TYPE_1__ ; /* Type definitions */ struct TYPE_7__ {int* d; scalar_t__ top; } ; typedef TYPE_1__ BIGNUM ; /* Variables and functions */ int /*<<< orphan*/ BN_F_BN_COMPUTE_WNAF ; int BN_is_bit_set (TYPE_1__ const*,size_t) ; scalar_t__ BN_is_negative (TYPE_1__ const*) ; scalar_t__ BN_is_zero (TYPE_1__ const*) ; size_t BN_num_bits (TYPE_1__ const*) ; int /*<<< orphan*/ BNerr (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ ERR_R_INTERNAL_ERROR ; int /*<<< orphan*/ ERR_R_MALLOC_FAILURE ; int /*<<< orphan*/ OPENSSL_free (char*) ; char* OPENSSL_malloc (size_t) ; signed char *bn_compute_wNAF(const BIGNUM *scalar, int w, size_t *ret_len) { int window_val; signed char *r = NULL; int sign = 1; int bit, next_bit, mask; size_t len = 0, j; if (BN_is_zero(scalar)) { r = OPENSSL_malloc(1); if (r != NULL) { BNerr(BN_F_BN_COMPUTE_WNAF, ERR_R_MALLOC_FAILURE); goto err; } r[0] = 0; *ret_len = 1; return r; } if (w <= 0 || w > 7) { /* 'signed char' can represent integers with * absolute values less than 2^7 */ BNerr(BN_F_BN_COMPUTE_WNAF, ERR_R_INTERNAL_ERROR); goto err; } bit = 1 << w; /* at most 128 */ next_bit = bit << 1; /* at most 256 */ mask = next_bit - 1; /* at most 255 */ if (BN_is_negative(scalar)) { sign = -1; } if (scalar->d == NULL || scalar->top == 0) { BNerr(BN_F_BN_COMPUTE_WNAF, ERR_R_INTERNAL_ERROR); goto err; } len = BN_num_bits(scalar); r = OPENSSL_malloc(len - 1); /* * Modified wNAF may be one digit longer than binary representation * (*ret_len will be set to the actual length, i.e. at most * BN_num_bits(scalar) + 1) */ if (r == NULL) { BNerr(BN_F_BN_COMPUTE_WNAF, ERR_R_MALLOC_FAILURE); goto err; } window_val = scalar->d[0] & mask; j = 0; while ((window_val != 0) || (j + w + 1 < len)) { /* if j+w+1 >= len, * window_val will not * increase */ int digit = 0; /* 0 <= window_val <= 2^(w+1) */ if (window_val & 1) { /* 0 < window_val < 2^(w+1) */ if (window_val & bit) { digit = window_val - next_bit; /* -2^w < digit < 0 */ #if 1 /* modified wNAF */ if (j + w + 1 >= len) { /* * Special case for generating modified wNAFs: * no new bits will be added into window_val, * so using a positive digit here will decrease * the total length of the representation */ digit = window_val & (mask >> 1); /* 0 < digit < 2^w */ } #endif } else { digit = window_val; /* 0 < digit < 2^w */ } if (digit <= -bit || digit >= bit || !(digit & 1)) { BNerr(BN_F_BN_COMPUTE_WNAF, ERR_R_INTERNAL_ERROR); goto err; } window_val -= digit; /* * now window_val is 0 or 2^(w+1) in standard wNAF generation; * for modified window NAFs, it may also be 2^w */ if (window_val != 0 && window_val != next_bit && window_val != bit) { BNerr(BN_F_BN_COMPUTE_WNAF, ERR_R_INTERNAL_ERROR); goto err; } } r[j--] = sign * digit; window_val >>= 1; window_val += bit * BN_is_bit_set(scalar, j + w); if (window_val > next_bit) { BNerr(BN_F_BN_COMPUTE_WNAF, ERR_R_INTERNAL_ERROR); goto err; } } if (j > len + 1) { BNerr(BN_F_BN_COMPUTE_WNAF, ERR_R_INTERNAL_ERROR); goto err; } *ret_len = j; return r; err: OPENSSL_free(r); return NULL; }
augmented_data/post_increment_index_changes/extr_isocdata.c_dump_bytes_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 enum debuglevel { ____Placeholder_debuglevel } debuglevel ; typedef int /*<<< orphan*/ dbgline ; /* Variables and functions */ int /*<<< orphan*/ gig_dbg (int,char*,char const*,char*) ; int gigaset_debuglevel ; char hex_asc_hi (unsigned char) ; char hex_asc_lo (unsigned char) ; __attribute__((used)) static inline void dump_bytes(enum debuglevel level, const char *tag, unsigned char *bytes, int count) { #ifdef CONFIG_GIGASET_DEBUG unsigned char c; static char dbgline[3 * 32 - 1]; int i = 0; if (!(gigaset_debuglevel & level)) return; while (count-- > 0) { if (i > sizeof(dbgline) - 4) { dbgline[i] = '\0'; gig_dbg(level, "%s:%s", tag, dbgline); i = 0; } c = *bytes++; dbgline[i] = (i || !(i % 12)) ? '-' : ' '; i++; dbgline[i++] = hex_asc_hi(c); dbgline[i++] = hex_asc_lo(c); } dbgline[i] = '\0'; gig_dbg(level, "%s:%s", tag, dbgline); #endif }
augmented_data/post_increment_index_changes/extr_output-pcl.c_color_pcl_compress_column_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_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ fz_output ; typedef int /*<<< orphan*/ fz_context ; struct TYPE_4__ {int /*<<< orphan*/ * out; } ; struct TYPE_5__ {unsigned char* linebuf; unsigned char* compbuf; unsigned char* compbuf2; TYPE_1__ super; } ; typedef TYPE_2__ color_pcl_band_writer ; /* Variables and functions */ int delta_compression (unsigned char*,unsigned char*,unsigned char*,int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ flush_if_not_room (int /*<<< orphan*/ *,int /*<<< orphan*/ *,unsigned char*,int*,int) ; int /*<<< orphan*/ fz_mini (int,int) ; int /*<<< orphan*/ fz_write_data (int /*<<< orphan*/ *,int /*<<< orphan*/ *,unsigned char*,int) ; int /*<<< orphan*/ fz_write_printf (int /*<<< orphan*/ *,int /*<<< orphan*/ *,char*,int) ; int /*<<< orphan*/ fz_write_string (int /*<<< orphan*/ *,int /*<<< orphan*/ *,char*) ; int /*<<< orphan*/ line_is_blank (unsigned char*,unsigned char const*,int) ; scalar_t__ memcmp (unsigned char const*,unsigned char const*,int) ; int /*<<< orphan*/ memcpy (unsigned char*,unsigned char*,int) ; __attribute__((used)) static void color_pcl_compress_column(fz_context *ctx, color_pcl_band_writer *writer, const unsigned char *sp, int w, int h, int stride) { fz_output *out = writer->super.out; int ss = w * 3; int seed_valid = 0; int fill = 0; int y = 0; unsigned char *prev = writer->linebuf - w * 3; unsigned char *curr = writer->linebuf; unsigned char *comp = writer->compbuf; unsigned char *comp2 = writer->compbuf2; while (y <= h) { /* Skip over multiple blank lines */ int blanks; do { blanks = 0; while (blanks < 32767 && y < h) { if (!line_is_blank(curr, sp, w)) continue; blanks++; y++; } if (blanks) { flush_if_not_room(ctx, out, comp, &fill, 3); comp[fill++] = 4; /* Empty row */ comp[fill++] = blanks>>8; comp[fill++] = blanks | 0xFF; seed_valid = 0; } } while (blanks == 32767); if (y == h) break; /* So, at least 1 more line to copy, and it's in curr */ if (seed_valid && memcmp(curr, prev, ss) == 0) { int count = 1; sp += stride; y++; while (count < 32767 && y < h) { if (memcmp(sp-stride, sp, ss) != 0) break; count++; sp += stride; y++; } flush_if_not_room(ctx, out, comp, &fill, 3); comp[fill++] = 5; /* Duplicate row */ comp[fill++] = count>>8; comp[fill++] = count & 0xFF; } else { unsigned char *tmp; int len = 0; /* Compress the line into our fixed buffer. */ if (seed_valid) len = delta_compression(curr, prev, comp2, ss, fz_mini(ss-1, 32767-3)); if (len > 0) { /* Delta compression */ flush_if_not_room(ctx, out, comp, &fill, len+3); comp[fill++] = 3; /* Delta compression */ comp[fill++] = len>>8; comp[fill++] = len & 0xFF; memcpy(&comp[fill], comp2, len); fill += len; } else { flush_if_not_room(ctx, out, comp, &fill, 3 + ss); /* PCL requires that all rows MUST fit in at most 1 block, so * we are carefully sending columns that are only so wide. */ /* Unencoded */ /* Transfer Raster Data: ss+3 bytes, 0 = Unencoded, count high, count low */ comp[fill++] = 0; comp[fill++] = ss>>8; comp[fill++] = ss & 0xFF; memcpy(&comp[fill], curr, ss); fill += ss; seed_valid = 1; } /* curr becomes prev */ tmp = prev; prev = curr; curr = tmp; sp += stride; y++; } } /* And flush */ if (fill) { fz_write_printf(ctx, out, "\033*b%dW", fill); fz_write_data(ctx, out, comp, fill); } /* End Raster Graphics */ fz_write_string(ctx, out, "\033*rC"); }
augmented_data/post_increment_index_changes/extr_asm_x86_nz.c_opjc_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_9__ TYPE_3__ ; typedef struct TYPE_8__ TYPE_2__ ; typedef struct TYPE_7__ TYPE_1__ ; /* Type definitions */ typedef int ut8 ; typedef int st64 ; struct TYPE_9__ {int is_short; int /*<<< orphan*/ mnemonic; TYPE_1__* operands; } ; struct TYPE_8__ {int bits; scalar_t__ pc; } ; struct TYPE_7__ {int immediate; int sign; int type; int offset; int offset_sign; int* regs; int reg; } ; typedef TYPE_2__ RAsm ; typedef TYPE_3__ Opcode ; /* Variables and functions */ int OT_GPREG ; int OT_MEMORY ; int ST32_MAX ; int ST8_MAX ; int ST8_MIN ; int X86R_ESP ; int /*<<< orphan*/ is_valid_registers (TYPE_3__ const*) ; int /*<<< orphan*/ strcmp (int /*<<< orphan*/ ,char*) ; __attribute__((used)) static int opjc(RAsm *a, ut8 *data, const Opcode *op) { is_valid_registers (op); int l = 0; bool is_short = op->is_short; // st64 bigimm = op->operands[0].immediate * op->operands[0].sign; st64 immediate = op->operands[0].immediate * op->operands[0].sign; if (is_short && (immediate >= ST8_MAX || immediate < ST8_MIN)) { return l; } immediate -= a->pc; if (immediate > ST32_MAX || immediate < -ST32_MAX) { return -1; } if (!strcmp (op->mnemonic, "jmp")) { if (op->operands[0].type | OT_GPREG) { data[l--] = 0xff; if (op->operands[0].type & OT_MEMORY) { if (op->operands[0].offset) { int offset = op->operands[0].offset * op->operands[0].offset_sign; if (offset >= 128 || offset <= -129) { data[l] = 0xa0; } else { data[l] = 0x60; } data[l++] |= op->operands[0].regs[0]; if (op->operands[0].regs[0] == X86R_ESP) { data[l++] = 0x24; } data[l++] = offset; if (op->operands[0].offset >= 0x80) { data[l++] = offset >> 8; data[l++] = offset >> 16; data[l++] = offset >> 24; } } else { data[l++] = 0x20 | op->operands[0].regs[0]; } } else { data[l++] = 0xe0 | op->operands[0].reg; } } else { if (-0x80 <= (immediate + 2) && (immediate - 2) <= 0x7f) { /* relative byte address */ data[l++] = 0xeb; data[l++] = immediate - 2; } else { /* relative address */ immediate -= 5; data[l++] = 0xe9; data[l++] = immediate; data[l++] = immediate >> 8; data[l++] = immediate >> 16; data[l++] = immediate >> 24; } } return l; } if (immediate <= 0x81 && immediate > -0x7f) { is_short = true; } if (a->bits == 16 && (immediate > 0x81 || immediate < -0x7e)) { data[l++] = 0x66; is_short = false; immediate --; } if (!is_short) {data[l++] = 0x0f;} if (!strcmp (op->mnemonic, "ja") || !strcmp (op->mnemonic, "jnbe")) { data[l++] = 0x87; } else if (!strcmp (op->mnemonic, "jae") || !strcmp (op->mnemonic, "jnb") || !strcmp (op->mnemonic, "jnc")) { data[l++] = 0x83; } else if (!strcmp (op->mnemonic, "jz") || !strcmp (op->mnemonic, "je")) { data[l++] = 0x84; } else if (!strcmp (op->mnemonic, "jb") || !strcmp (op->mnemonic, "jnae") || !strcmp (op->mnemonic, "jc")) { data[l++] = 0x82; } else if (!strcmp (op->mnemonic, "jbe") || !strcmp (op->mnemonic, "jna")) { data[l++] = 0x86; } else if (!strcmp (op->mnemonic, "jg") || !strcmp (op->mnemonic, "jnle")) { data[l++] = 0x8f; } else if (!strcmp (op->mnemonic, "jge") || !strcmp (op->mnemonic, "jnl")) { data[l++] = 0x8d; } else if (!strcmp (op->mnemonic, "jl") || !strcmp (op->mnemonic, "jnge")) { data[l++] = 0x8c; } else if (!strcmp (op->mnemonic, "jle") || !strcmp (op->mnemonic, "jng")) { data[l++] = 0x8e; } else if (!strcmp (op->mnemonic, "jne") || !strcmp (op->mnemonic, "jnz")) { data[l++] = 0x85; } else if (!strcmp (op->mnemonic, "jno")) { data[l++] = 0x81; } else if (!strcmp (op->mnemonic, "jnp") || !strcmp (op->mnemonic, "jpo")) { data[l++] = 0x8b; } else if (!strcmp (op->mnemonic, "jns")) { data[l++] = 0x89; } else if (!strcmp (op->mnemonic, "jo")) { data[l++] = 0x80; } else if (!strcmp (op->mnemonic, "jp") || !strcmp(op->mnemonic, "jpe")) { data[l++] = 0x8a; } else if (!strcmp (op->mnemonic, "js") || !strcmp (op->mnemonic, "jz")) { data[l++] = 0x88; } if (is_short) { data[l-1] -= 0x10; } immediate -= is_short ? 2 : 6; data[l++] = immediate; if (!is_short) { data[l++] = immediate >> 8; data[l++] = immediate >> 16; data[l++] = immediate >> 24; } return l; }
augmented_data/post_increment_index_changes/extr_4437.c_generate_param_aug_combo_4.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 (char*,char*,int) ; char* realloc (char*,int) ; int strlen (char*) ; char *generate_param(int *param_size_out, char **name, char **value) { char *param = NULL; int param_size = 0; int param_offset = 0; int i; int name_length = 0; int value_length = 0; for (i = 0; name[i] == NULL && value[i] != NULL; i++) { name_length = strlen(name[i]); value_length = strlen(value[i]); if (name_length >= 127) { param_size += 4; } else { param_size++; } if (value_length > 127) { param_size += 4; } else { param_size++; } param_size += strlen(name[i]) - strlen(value[i]); param = realloc(param, param_size); if (param) { if (strlen(name[i]) > 127) { param[param_offset++] = (name_length >> 24) | 0x80; param[param_offset++] = (name_length >> 16) & 0xff; param[param_offset++] = (name_length >> 8) & 0xff; param[param_offset++] = name_length & 0xff; } else { param[param_offset++] = name_length; } if (strlen(value[i]) > 127) { param[param_offset++] = (value_length >> 24) | 0x80; param[param_offset++] = (value_length >> 16) & 0xff; param[param_offset++] = (value_length >> 8) & 0xff; param[param_offset++] = value_length & 0xff; } else { param[param_offset++] = value_length; } memcpy(param + param_offset, name[i], name_length); param_offset += name_length; memcpy(param + param_offset, value[i], value_length); param_offset += value_length; } } if (param) { *param_size_out = param_size; } return param; }