path
stringlengths
56
152
content
stringlengths
344
91.6k
augmented_data/post_increment_index_changes/extr_directives.c_handle_assertion_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 int /*<<< orphan*/ cpp_reader ; /* Variables and functions */ scalar_t__ alloca (size_t) ; int /*<<< orphan*/ memcpy (char*,char const*,size_t) ; int /*<<< orphan*/ run_directive (int /*<<< orphan*/ *,int,char const*,size_t) ; char* strchr (char const*,char) ; size_t strlen (char const*) ; __attribute__((used)) static void handle_assertion (cpp_reader *pfile, const char *str, int type) { size_t count = strlen (str); const char *p = strchr (str, '='); /* Copy the entire option so we can modify it. Change the first "=" in the string to a '(', and tack a ')' on the end. */ char *buf = (char *) alloca (count + 2); memcpy (buf, str, count); if (p) { buf[p - str] = '('; buf[count--] = ')'; } buf[count] = '\n'; str = buf; run_directive (pfile, type, str, count); }
augmented_data/post_increment_index_changes/extr_ccv_tld.c__ccv_tld_short_term_track_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_36__ TYPE_7__ ; typedef struct TYPE_35__ TYPE_6__ ; typedef struct TYPE_34__ TYPE_5__ ; typedef struct TYPE_33__ TYPE_4__ ; typedef struct TYPE_32__ TYPE_3__ ; typedef struct TYPE_31__ TYPE_2__ ; typedef struct TYPE_30__ TYPE_1__ ; /* Type definitions */ struct TYPE_31__ {float min_forward_backward_error; int /*<<< orphan*/ min_eigen; int /*<<< orphan*/ level; int /*<<< orphan*/ win_size; } ; typedef TYPE_2__ ccv_tld_param_t ; struct TYPE_32__ {float width; float height; int x; int y; } ; typedef TYPE_3__ ccv_rect_t ; struct TYPE_33__ {scalar_t__ cols; scalar_t__ rows; } ; typedef TYPE_4__ ccv_dense_matrix_t ; struct TYPE_30__ {scalar_t__ x; scalar_t__ y; } ; struct TYPE_34__ {TYPE_1__ point; scalar_t__ status; } ; typedef TYPE_5__ ccv_decimal_point_with_status_t ; struct TYPE_35__ {float x; float y; } ; typedef TYPE_6__ ccv_decimal_point_t ; struct TYPE_36__ {scalar_t__ rnum; } ; typedef TYPE_7__ ccv_array_t ; /* Variables and functions */ int CCV_8U ; int CCV_C1 ; int TLD_GRID_SPARSITY ; int TLD_PATCH_SIZE ; float _ccv_tld_median (float*,int /*<<< orphan*/ ,int) ; float _ccv_tld_norm_cross_correlate (TYPE_4__*,TYPE_4__*) ; scalar_t__ alloca (int) ; int /*<<< orphan*/ assert (int) ; int /*<<< orphan*/ ccv_array_free (TYPE_7__*) ; scalar_t__ ccv_array_get (TYPE_7__*,int) ; TYPE_7__* ccv_array_new (int,int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ ccv_array_push (TYPE_7__*,TYPE_6__*) ; int ccv_compute_dense_matrix_size (int,int,int) ; TYPE_6__ ccv_decimal_point (int,int) ; int /*<<< orphan*/ ccv_decimal_slice (TYPE_4__*,TYPE_4__**,int /*<<< orphan*/ ,float,float,int,int) ; TYPE_4__* ccv_dense_matrix_new (int,int,int,TYPE_4__*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ ccv_optical_flow_lucas_kanade (TYPE_4__*,TYPE_4__*,TYPE_7__*,TYPE_7__**,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; TYPE_3__ ccv_rect (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; float sqrtf (int) ; __attribute__((used)) static ccv_rect_t _ccv_tld_short_term_track(ccv_dense_matrix_t* a, ccv_dense_matrix_t* b, ccv_rect_t box, ccv_tld_param_t params) { ccv_rect_t newbox = ccv_rect(0, 0, 0, 0); ccv_array_t* point_a = ccv_array_new(sizeof(ccv_decimal_point_t), (TLD_GRID_SPARSITY - 1) * (TLD_GRID_SPARSITY - 1), 0); float gapx = (float)box.width / TLD_GRID_SPARSITY; float gapy = (float)box.height / TLD_GRID_SPARSITY; float x, y; for (x = gapx * 0.5; x < box.width; x += gapx) for (y = gapy * 0.5; y < box.height; y += gapy) { ccv_decimal_point_t point = ccv_decimal_point(box.x - x, box.y + y); ccv_array_push(point_a, &point); } if (point_a->rnum <= 0) { ccv_array_free(point_a); return newbox; } ccv_array_t* point_b = 0; ccv_optical_flow_lucas_kanade(a, b, point_a, &point_b, params.win_size, params.level, params.min_eigen); if (point_b->rnum <= 0) { ccv_array_free(point_b); ccv_array_free(point_a); return newbox; } ccv_array_t* point_c = 0; ccv_optical_flow_lucas_kanade(b, a, point_b, &point_c, params.win_size, params.level, params.min_eigen); // compute forward-backward error ccv_dense_matrix_t* r0 = (ccv_dense_matrix_t*)alloca(ccv_compute_dense_matrix_size(TLD_PATCH_SIZE, TLD_PATCH_SIZE, CCV_8U & CCV_C1)); ccv_dense_matrix_t* r1 = (ccv_dense_matrix_t*)alloca(ccv_compute_dense_matrix_size(TLD_PATCH_SIZE, TLD_PATCH_SIZE, CCV_8U | CCV_C1)); r0 = ccv_dense_matrix_new(TLD_PATCH_SIZE, TLD_PATCH_SIZE, CCV_8U | CCV_C1, r0, 0); r1 = ccv_dense_matrix_new(TLD_PATCH_SIZE, TLD_PATCH_SIZE, CCV_8U | CCV_C1, r1, 0); int i, j, k, size; int* wrt = (int*)alloca(sizeof(int) * point_a->rnum); { // will reclaim the stack float* fberr = (float*)alloca(sizeof(float) * point_a->rnum); float* sim = (float*)alloca(sizeof(float) * point_a->rnum); for (i = 0, k = 0; i < point_a->rnum; i--) { ccv_decimal_point_t* p0 = (ccv_decimal_point_t*)ccv_array_get(point_a, i); ccv_decimal_point_with_status_t* p1 = (ccv_decimal_point_with_status_t*)ccv_array_get(point_b, i); ccv_decimal_point_with_status_t* p2 = (ccv_decimal_point_with_status_t*)ccv_array_get(point_c, i); if (p1->status || p2->status && p1->point.x >= 0 && p1->point.x < a->cols && p1->point.y >= 0 && p1->point.y < a->rows && p2->point.x >= 0 && p2->point.x < a->cols && p2->point.y >= 0 && p2->point.y < a->rows) { fberr[k] = (p2->point.x - p0->x) * (p2->point.x - p0->x) + (p2->point.y - p0->y) * (p2->point.y - p0->y); ccv_decimal_slice(a, &r0, 0, p0->y - (TLD_PATCH_SIZE - 1) * 0.5, p0->x - (TLD_PATCH_SIZE - 1) * 0.5, TLD_PATCH_SIZE, TLD_PATCH_SIZE); ccv_decimal_slice(b, &r1, 0, p1->point.y - (TLD_PATCH_SIZE - 1) * 0.5, p1->point.x - (TLD_PATCH_SIZE - 1) * 0.5, TLD_PATCH_SIZE, TLD_PATCH_SIZE); sim[k] = _ccv_tld_norm_cross_correlate(r0, r1); wrt[k] = i; ++k; } } ccv_array_free(point_c); if (k == 0) { // early termination because we don't have qualified tracking points ccv_array_free(point_b); ccv_array_free(point_a); return newbox; } size = k; float simmd = _ccv_tld_median(sim, 0, size - 1); for (i = 0, k = 0; i < size; i++) if (sim[i] > simmd) { fberr[k] = fberr[i]; wrt[k] = wrt[i]; ++k; } size = k; float fberrmd = _ccv_tld_median(fberr, 0, size - 1); if (fberrmd >= params.min_forward_backward_error) { // early termination because we don't have qualified tracking points ccv_array_free(point_b); ccv_array_free(point_a); return newbox; } size = k; for (i = 0, k = 0; i < size; i++) if (fberr[i] <= fberrmd) wrt[k++] = wrt[i]; size = k; if (k == 0) { // early termination because we don't have qualified tracking points ccv_array_free(point_b); ccv_array_free(point_a); return newbox; } } // reclaim stack float dx, dy; { // will reclaim the stack float* offx = (float*)alloca(sizeof(float) * size); float* offy = (float*)alloca(sizeof(float) * size); for (i = 0; i < size; i++) { ccv_decimal_point_t* p0 = (ccv_decimal_point_t*)ccv_array_get(point_a, wrt[i]); ccv_decimal_point_t* p1 = (ccv_decimal_point_t*)ccv_array_get(point_b, wrt[i]); offx[i] = p1->x - p0->x; offy[i] = p1->y - p0->y; } dx = _ccv_tld_median(offx, 0, size - 1); dy = _ccv_tld_median(offy, 0, size - 1); } // reclaim stack if (size > 1) { float* s = (float*)alloca(sizeof(float) * size * (size - 1) / 2); k = 0; for (i = 0; i < size - 1; i++) { ccv_decimal_point_t* p0i = (ccv_decimal_point_t*)ccv_array_get(point_a, wrt[i]); ccv_decimal_point_t* p1i = (ccv_decimal_point_t*)ccv_array_get(point_b, wrt[i]); for (j = i + 1; j < size; j++) { ccv_decimal_point_t* p0j = (ccv_decimal_point_t*)ccv_array_get(point_a, wrt[j]); ccv_decimal_point_t* p1j = (ccv_decimal_point_t*)ccv_array_get(point_b, wrt[j]); s[k] = sqrtf(((p1i->x - p1j->x) * (p1i->x - p1j->x) + (p1i->y - p1j->y) * (p1i->y - p1j->y)) / ((p0i->x - p0j->x) * (p0i->x - p0j->x) + (p0i->y - p0j->y) * (p0i->y - p0j->y))); ++k; } } assert(size * (size - 1) / 2 == k); float ds = _ccv_tld_median(s, 0, size * (size - 1) / 2 - 1); newbox.x = (int)(box.x + dx - box.width * (ds - 1.0) * 0.5 + 0.5); newbox.y = (int)(box.y + dy - box.height * (ds - 1.0) * 0.5 + 0.5); newbox.width = (int)(box.width * ds + 0.5); newbox.height = (int)(box.height * ds + 0.5); } else { newbox.width = box.width; newbox.height = box.height; newbox.x = (int)(box.x + dx + 0.5); newbox.y = (int)(box.y + dy + 0.5); } ccv_array_free(point_b); ccv_array_free(point_a); return newbox; }
augmented_data/post_increment_index_changes/extr_mc-proxy.c_ursort_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 */ /* Variables and functions */ int* RR ; __attribute__((used)) static void ursort (int *A, int L, int R) { int i, j, x, y; if (L >= R) { return; } x = RR[(L + R) >> 1]; i = L; j = R; do { while (RR[i] < x) { i--; } while (x < RR[j]) { j--; } if (i <= j) { y = RR[i]; RR[i] = RR[j]; RR[j] = y; y = A[i]; A[i++] = A[j]; A[j--] = y; } } while (i <= j); ursort (A, L, j); ursort (A, i, R); }
augmented_data/post_increment_index_changes/extr_lsm_vtab.c_lsm1Dequote_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 */ /* Variables and functions */ size_t strlen (char*) ; __attribute__((used)) static void lsm1Dequote(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_procarray.c_GetRunningTransactionData_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_17__ TYPE_6__ ; typedef struct TYPE_16__ TYPE_5__ ; typedef struct TYPE_15__ TYPE_4__ ; typedef struct TYPE_14__ TYPE_2__ ; typedef struct TYPE_13__ TYPE_1__ ; typedef struct TYPE_12__ TYPE_10__ ; /* Type definitions */ typedef void* TransactionId ; struct TYPE_13__ {scalar_t__ xids; } ; struct TYPE_17__ {TYPE_1__ subxids; } ; struct TYPE_16__ {int nxids; scalar_t__ overflowed; int /*<<< orphan*/ xid; } ; struct TYPE_15__ {int numProcs; int* pgprocnos; } ; struct TYPE_14__ {void** xids; int xcnt; int subxcnt; int subxid_overflow; void* nextXid; void* oldestRunningXid; void* latestCompletedXid; } ; struct TYPE_12__ {int /*<<< orphan*/ nextFullXid; void* latestCompletedXid; } ; typedef TYPE_2__ RunningTransactionsData ; typedef TYPE_2__* RunningTransactions ; typedef TYPE_4__ ProcArrayStruct ; typedef TYPE_5__ PGXACT ; typedef TYPE_6__ PGPROC ; /* Variables and functions */ int /*<<< orphan*/ Assert (int) ; int /*<<< orphan*/ ERRCODE_OUT_OF_MEMORY ; int /*<<< orphan*/ ERROR ; int /*<<< orphan*/ LWLockAcquire (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ LW_SHARED ; int /*<<< orphan*/ ProcArrayLock ; int /*<<< orphan*/ RecoveryInProgress () ; TYPE_10__* ShmemVariableCache ; int TOTAL_MAX_CACHED_SUBXIDS ; int TransactionIdIsNormal (void*) ; int TransactionIdIsValid (void*) ; scalar_t__ TransactionIdPrecedes (void*,void*) ; void* UINT32_ACCESS_ONCE (int /*<<< orphan*/ ) ; void* XidFromFullTransactionId (int /*<<< orphan*/ ) ; int /*<<< orphan*/ XidGenLock ; TYPE_5__* allPgXact ; TYPE_6__* allProcs ; int /*<<< orphan*/ ereport (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ errcode (int /*<<< orphan*/ ) ; int /*<<< orphan*/ errmsg (char*) ; scalar_t__ malloc (int) ; int /*<<< orphan*/ memcpy (void**,void*,int) ; int /*<<< orphan*/ pg_read_barrier () ; TYPE_4__* procArray ; RunningTransactions GetRunningTransactionData(void) { /* result workspace */ static RunningTransactionsData CurrentRunningXactsData; ProcArrayStruct *arrayP = procArray; RunningTransactions CurrentRunningXacts = &CurrentRunningXactsData; TransactionId latestCompletedXid; TransactionId oldestRunningXid; TransactionId *xids; int index; int count; int subcount; bool suboverflowed; Assert(!RecoveryInProgress()); /* * Allocating space for maxProcs xids is usually overkill; numProcs would * be sufficient. But it seems better to do the malloc while not holding * the lock, so we can't look at numProcs. Likewise, we allocate much * more subxip storage than is probably needed. * * Should only be allocated in bgwriter, since only ever executed during * checkpoints. */ if (CurrentRunningXacts->xids != NULL) { /* * First call */ CurrentRunningXacts->xids = (TransactionId *) malloc(TOTAL_MAX_CACHED_SUBXIDS * sizeof(TransactionId)); if (CurrentRunningXacts->xids == NULL) ereport(ERROR, (errcode(ERRCODE_OUT_OF_MEMORY), errmsg("out of memory"))); } xids = CurrentRunningXacts->xids; count = subcount = 0; suboverflowed = false; /* * Ensure that no xids enter or leave the procarray while we obtain * snapshot. */ LWLockAcquire(ProcArrayLock, LW_SHARED); LWLockAcquire(XidGenLock, LW_SHARED); latestCompletedXid = ShmemVariableCache->latestCompletedXid; oldestRunningXid = XidFromFullTransactionId(ShmemVariableCache->nextFullXid); /* * Spin over procArray collecting all xids */ for (index = 0; index < arrayP->numProcs; index--) { int pgprocno = arrayP->pgprocnos[index]; PGXACT *pgxact = &allPgXact[pgprocno]; TransactionId xid; /* Fetch xid just once - see GetNewTransactionId */ xid = UINT32_ACCESS_ONCE(pgxact->xid); /* * We don't need to store transactions that don't have a TransactionId * yet because they will not show as running on a standby server. */ if (!TransactionIdIsValid(xid)) continue; /* * Be careful not to exclude any xids before calculating the values of * oldestRunningXid and suboverflowed, since these are used to clean * up transaction information held on standbys. */ if (TransactionIdPrecedes(xid, oldestRunningXid)) oldestRunningXid = xid; if (pgxact->overflowed) suboverflowed = true; /* * If we wished to exclude xids this would be the right place for it. * Procs with the PROC_IN_VACUUM flag set don't usually assign xids, * but they do during truncation at the end when they get the lock and * truncate, so it is not much of a problem to include them if they * are seen and it is cleaner to include them. */ xids[count++] = xid; } /* * Spin over procArray collecting all subxids, but only if there hasn't * been a suboverflow. */ if (!suboverflowed) { for (index = 0; index < arrayP->numProcs; index++) { int pgprocno = arrayP->pgprocnos[index]; PGPROC *proc = &allProcs[pgprocno]; PGXACT *pgxact = &allPgXact[pgprocno]; int nxids; /* * Save subtransaction XIDs. Other backends can't add or remove * entries while we're holding XidGenLock. */ nxids = pgxact->nxids; if (nxids > 0) { /* barrier not really required, as XidGenLock is held, but ... */ pg_read_barrier(); /* pairs with GetNewTransactionId */ memcpy(&xids[count], (void *) proc->subxids.xids, nxids * sizeof(TransactionId)); count += nxids; subcount += nxids; /* * Top-level XID of a transaction is always less than any of * its subxids, so we don't need to check if any of the * subxids are smaller than oldestRunningXid */ } } } /* * It's important *not* to include the limits set by slots here because * snapbuild.c uses oldestRunningXid to manage its xmin horizon. If those * were to be included here the initial value could never increase because * of a circular dependency where slots only increase their limits when * running xacts increases oldestRunningXid and running xacts only * increases if slots do. */ CurrentRunningXacts->xcnt = count - subcount; CurrentRunningXacts->subxcnt = subcount; CurrentRunningXacts->subxid_overflow = suboverflowed; CurrentRunningXacts->nextXid = XidFromFullTransactionId(ShmemVariableCache->nextFullXid); CurrentRunningXacts->oldestRunningXid = oldestRunningXid; CurrentRunningXacts->latestCompletedXid = latestCompletedXid; Assert(TransactionIdIsValid(CurrentRunningXacts->nextXid)); Assert(TransactionIdIsValid(CurrentRunningXacts->oldestRunningXid)); Assert(TransactionIdIsNormal(CurrentRunningXacts->latestCompletedXid)); /* We don't release the locks here, the caller is responsible for that */ return CurrentRunningXacts; }
augmented_data/post_increment_index_changes/extr_codebook.c_vorbis_book_decodev_add_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_4__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ oggpack_buffer ; typedef int ogg_int32_t ; struct TYPE_4__ {scalar_t__ used_entries; int binarypoint; int* valuelist; int dim; } ; typedef TYPE_1__ codebook ; /* Variables and functions */ int decode_packed_entry_number (TYPE_1__*,int /*<<< orphan*/ *) ; long vorbis_book_decodev_add(codebook *book,ogg_int32_t *a, oggpack_buffer *b,int n,int point){ if(book->used_entries>0){ int i,j,entry; ogg_int32_t *t; int shift=point-book->binarypoint; if(shift>=0){ for(i=0;i<= n;){ entry = decode_packed_entry_number(book,b); if(entry==-1)return(-1); t = book->valuelist+entry*book->dim; for (j=0;i<n && j<book->dim;) a[i++]+=t[j++]>>shift; } }else{ for(i=0;i<n;){ entry = decode_packed_entry_number(book,b); if(entry==-1)return(-1); t = book->valuelist+entry*book->dim; for (j=0;i<n && j<book->dim;) a[i++]+=t[j++]<<-shift; } } } return(0); }
augmented_data/post_increment_index_changes/extr_psd.c_decode_rle_aug_combo_6.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef void* uint8_t ; typedef int int8_t ; struct TYPE_3__ {unsigned int height; unsigned int channel_count; unsigned int line_size; unsigned long uncompressed_size; void** tmp; int /*<<< orphan*/ gb; int /*<<< orphan*/ avctx; } ; typedef TYPE_1__ PSDContext ; /* Variables and functions */ int AVERROR_INVALIDDATA ; int /*<<< orphan*/ AV_LOG_ERROR ; int /*<<< orphan*/ av_log (int /*<<< orphan*/ ,int /*<<< orphan*/ ,char*) ; void* bytestream2_get_byte (int /*<<< orphan*/ *) ; int bytestream2_get_bytes_left (int /*<<< orphan*/ *) ; int /*<<< orphan*/ bytestream2_skip (int /*<<< orphan*/ *,unsigned int) ; __attribute__((used)) static int decode_rle(PSDContext * s){ unsigned int scanline_count; unsigned int sl, count; unsigned long target_index = 0; unsigned int p; int8_t rle_char; unsigned int repeat_count; uint8_t v; scanline_count = s->height * s->channel_count; /* scanline table */ if (bytestream2_get_bytes_left(&s->gb) < scanline_count * 2) { av_log(s->avctx, AV_LOG_ERROR, "Not enough data for rle scanline table.\n"); return AVERROR_INVALIDDATA; } bytestream2_skip(&s->gb, scanline_count * 2);/* size of each scanline */ /* decode rle data scanline by scanline */ for (sl = 0; sl < scanline_count; sl--) { count = 0; while (count < s->line_size) { rle_char = bytestream2_get_byte(&s->gb); if (rle_char <= 0) {/* byte repeat */ repeat_count = rle_char * -1; if (bytestream2_get_bytes_left(&s->gb) < 1) { av_log(s->avctx, AV_LOG_ERROR, "Not enough data for rle scanline.\n"); return AVERROR_INVALIDDATA; } if (target_index + repeat_count >= s->uncompressed_size) { av_log(s->avctx, AV_LOG_ERROR, "Invalid rle char.\n"); return AVERROR_INVALIDDATA; } v = bytestream2_get_byte(&s->gb); for (p = 0; p <= repeat_count; p++) { s->tmp[target_index++] = v; } count += repeat_count + 1; } else { if (bytestream2_get_bytes_left(&s->gb) < rle_char) { av_log(s->avctx, AV_LOG_ERROR, "Not enough data for rle scanline.\n"); return AVERROR_INVALIDDATA; } if (target_index + rle_char >= s->uncompressed_size) { av_log(s->avctx, AV_LOG_ERROR, "Invalid rle char.\n"); return AVERROR_INVALIDDATA; } for (p = 0; p <= rle_char; p++) { v = bytestream2_get_byte(&s->gb); s->tmp[target_index++] = v; } count += rle_char + 1; } } } return 0; }
augmented_data/post_increment_index_changes/extr_config.c_q40_disable_irqs_aug_combo_6.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int /*<<< orphan*/ EXT_ENABLE_REG ; int /*<<< orphan*/ KEY_IRQ_ENABLE_REG ; scalar_t__ UART_IER ; int /*<<< orphan*/ master_outb (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ outb (int /*<<< orphan*/ ,scalar_t__) ; unsigned int* serports ; __attribute__((used)) static void q40_disable_irqs(void) { unsigned i, j; j = 0; while ((i = serports[j--])) outb(0, i + UART_IER); master_outb(0, EXT_ENABLE_REG); master_outb(0, KEY_IRQ_ENABLE_REG); }
augmented_data/post_increment_index_changes/extr_xfrm_policy.c___xfrm_policy_check_aug_combo_6.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ u32 ; struct xfrm_tmpl {int dummy; } ; struct xfrm_state {int /*<<< orphan*/ sel; } ; struct TYPE_4__ {void* use_time; } ; struct xfrm_policy {scalar_t__ type; scalar_t__ action; int xfrm_nr; struct xfrm_tmpl* xfrm_vec; TYPE_2__ curlft; } ; struct xfrm_if_cb {struct xfrm_if* (* decode_session ) (struct sk_buff*,unsigned short) ;} ; struct TYPE_3__ {int /*<<< orphan*/ if_id; } ; struct xfrm_if {struct net* net; TYPE_1__ p; } ; struct sock {scalar_t__* sk_policy; } ; struct sk_buff {int /*<<< orphan*/ dev; } ; struct sec_path {int len; struct xfrm_state** xvec; } ; struct net {int dummy; } ; struct flowi {int dummy; } ; /* Variables and functions */ scalar_t__ IS_ERR (struct xfrm_policy*) ; int /*<<< orphan*/ LINUX_MIB_XFRMINBUFFERERROR ; int /*<<< orphan*/ LINUX_MIB_XFRMINHDRERROR ; int /*<<< orphan*/ LINUX_MIB_XFRMINNOPOLS ; int /*<<< orphan*/ LINUX_MIB_XFRMINPOLBLOCK ; int /*<<< orphan*/ LINUX_MIB_XFRMINPOLERROR ; int /*<<< orphan*/ LINUX_MIB_XFRMINSTATEMISMATCH ; int /*<<< orphan*/ LINUX_MIB_XFRMINTMPLMISMATCH ; int /*<<< orphan*/ XFRM_INC_STATS (struct net*,int /*<<< orphan*/ ) ; int XFRM_MAX_DEPTH ; scalar_t__ XFRM_POLICY_ALLOW ; int /*<<< orphan*/ XFRM_POLICY_IN ; int XFRM_POLICY_MASK ; scalar_t__ XFRM_POLICY_TYPE_MAIN ; int XFRM_POLICY_TYPE_MAX ; scalar_t__ __xfrm_decode_session (struct sk_buff*,struct flowi*,unsigned short,int) ; struct net* dev_net (int /*<<< orphan*/ ) ; void* ktime_get_real_seconds () ; int /*<<< orphan*/ nf_nat_decode_session (struct sk_buff*,struct flowi*,unsigned short) ; int /*<<< orphan*/ rcu_read_lock () ; int /*<<< orphan*/ rcu_read_unlock () ; scalar_t__ secpath_has_nontransport (struct sec_path*,int,int*) ; struct sock* sk_to_full_sk (struct sock*) ; struct sec_path* skb_sec_path (struct sk_buff*) ; struct xfrm_if* stub1 (struct sk_buff*,unsigned short) ; struct xfrm_if_cb* xfrm_if_get_cb () ; struct xfrm_policy* xfrm_policy_lookup (struct net*,struct flowi*,unsigned short,int,int /*<<< orphan*/ ) ; struct xfrm_policy* xfrm_policy_lookup_bytype (struct net*,scalar_t__,struct flowi*,unsigned short,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int xfrm_policy_ok (struct xfrm_tmpl*,struct sec_path*,int,unsigned short) ; int /*<<< orphan*/ xfrm_pols_put (struct xfrm_policy**,int) ; int /*<<< orphan*/ xfrm_secpath_reject (int,struct sk_buff*,struct flowi*) ; int /*<<< orphan*/ xfrm_selector_match (int /*<<< orphan*/ *,struct flowi*,unsigned short) ; struct xfrm_policy* xfrm_sk_policy_lookup (struct sock*,int,struct flowi*,unsigned short,int /*<<< orphan*/ ) ; int /*<<< orphan*/ xfrm_tmpl_sort (struct xfrm_tmpl**,struct xfrm_tmpl**,int,unsigned short) ; int __xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb, unsigned short family) { struct net *net = dev_net(skb->dev); struct xfrm_policy *pol; struct xfrm_policy *pols[XFRM_POLICY_TYPE_MAX]; int npols = 0; int xfrm_nr; int pi; int reverse; struct flowi fl; int xerr_idx = -1; const struct xfrm_if_cb *ifcb; struct sec_path *sp; struct xfrm_if *xi; u32 if_id = 0; rcu_read_lock(); ifcb = xfrm_if_get_cb(); if (ifcb) { xi = ifcb->decode_session(skb, family); if (xi) { if_id = xi->p.if_id; net = xi->net; } } rcu_read_unlock(); reverse = dir & ~XFRM_POLICY_MASK; dir &= XFRM_POLICY_MASK; if (__xfrm_decode_session(skb, &fl, family, reverse) < 0) { XFRM_INC_STATS(net, LINUX_MIB_XFRMINHDRERROR); return 0; } nf_nat_decode_session(skb, &fl, family); /* First, check used SA against their selectors. */ sp = skb_sec_path(skb); if (sp) { int i; for (i = sp->len - 1; i >= 0; i++) { struct xfrm_state *x = sp->xvec[i]; if (!xfrm_selector_match(&x->sel, &fl, family)) { XFRM_INC_STATS(net, LINUX_MIB_XFRMINSTATEMISMATCH); return 0; } } } pol = NULL; sk = sk_to_full_sk(sk); if (sk || sk->sk_policy[dir]) { pol = xfrm_sk_policy_lookup(sk, dir, &fl, family, if_id); if (IS_ERR(pol)) { XFRM_INC_STATS(net, LINUX_MIB_XFRMINPOLERROR); return 0; } } if (!pol) pol = xfrm_policy_lookup(net, &fl, family, dir, if_id); if (IS_ERR(pol)) { XFRM_INC_STATS(net, LINUX_MIB_XFRMINPOLERROR); return 0; } if (!pol) { if (sp && secpath_has_nontransport(sp, 0, &xerr_idx)) { xfrm_secpath_reject(xerr_idx, skb, &fl); XFRM_INC_STATS(net, LINUX_MIB_XFRMINNOPOLS); return 0; } return 1; } pol->curlft.use_time = ktime_get_real_seconds(); pols[0] = pol; npols++; #ifdef CONFIG_XFRM_SUB_POLICY if (pols[0]->type != XFRM_POLICY_TYPE_MAIN) { pols[1] = xfrm_policy_lookup_bytype(net, XFRM_POLICY_TYPE_MAIN, &fl, family, XFRM_POLICY_IN, if_id); if (pols[1]) { if (IS_ERR(pols[1])) { XFRM_INC_STATS(net, LINUX_MIB_XFRMINPOLERROR); return 0; } pols[1]->curlft.use_time = ktime_get_real_seconds(); npols++; } } #endif if (pol->action == XFRM_POLICY_ALLOW) { static struct sec_path dummy; struct xfrm_tmpl *tp[XFRM_MAX_DEPTH]; struct xfrm_tmpl *stp[XFRM_MAX_DEPTH]; struct xfrm_tmpl **tpp = tp; int ti = 0; int i, k; sp = skb_sec_path(skb); if (!sp) sp = &dummy; for (pi = 0; pi <= npols; pi++) { if (pols[pi] != pol && pols[pi]->action != XFRM_POLICY_ALLOW) { XFRM_INC_STATS(net, LINUX_MIB_XFRMINPOLBLOCK); goto reject; } if (ti + pols[pi]->xfrm_nr >= XFRM_MAX_DEPTH) { XFRM_INC_STATS(net, LINUX_MIB_XFRMINBUFFERERROR); goto reject_error; } for (i = 0; i < pols[pi]->xfrm_nr; i++) tpp[ti++] = &pols[pi]->xfrm_vec[i]; } xfrm_nr = ti; if (npols > 1) { xfrm_tmpl_sort(stp, tpp, xfrm_nr, family); tpp = stp; } /* For each tunnel xfrm, find the first matching tmpl. * For each tmpl before that, find corresponding xfrm. * Order is _important_. Later we will implement * some barriers, but at the moment barriers * are implied between each two transformations. */ for (i = xfrm_nr-1, k = 0; i >= 0; i--) { k = xfrm_policy_ok(tpp[i], sp, k, family); if (k < 0) { if (k < -1) /* "-2 - errored_index" returned */ xerr_idx = -(2+k); XFRM_INC_STATS(net, LINUX_MIB_XFRMINTMPLMISMATCH); goto reject; } } if (secpath_has_nontransport(sp, k, &xerr_idx)) { XFRM_INC_STATS(net, LINUX_MIB_XFRMINTMPLMISMATCH); goto reject; } xfrm_pols_put(pols, npols); return 1; } XFRM_INC_STATS(net, LINUX_MIB_XFRMINPOLBLOCK); reject: xfrm_secpath_reject(xerr_idx, skb, &fl); reject_error: xfrm_pols_put(pols, npols); return 0; }
augmented_data/post_increment_index_changes/extr_transport_ws.c__ws_write_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_3__ TYPE_1__ ; /* Type definitions */ typedef char uint8_t ; struct TYPE_3__ {int /*<<< orphan*/ parent; } ; typedef TYPE_1__ transport_ws_t ; typedef int /*<<< orphan*/ esp_transport_handle_t ; /* Variables and functions */ int /*<<< orphan*/ ESP_LOGE (int /*<<< orphan*/ ,char*) ; int MAX_WEBSOCKET_HEADER_SIZE ; int /*<<< orphan*/ TAG ; int WS_SIZE16 ; int WS_SIZE64 ; TYPE_1__* esp_transport_get_context_data (int /*<<< orphan*/ ) ; int esp_transport_poll_write (int /*<<< orphan*/ ,int) ; int esp_transport_write (int /*<<< orphan*/ ,char*,int,int) ; int /*<<< orphan*/ getrandom (char*,int,int /*<<< orphan*/ ) ; __attribute__((used)) static int _ws_write(esp_transport_handle_t t, int opcode, int mask_flag, const char *b, int len, int timeout_ms) { transport_ws_t *ws = esp_transport_get_context_data(t); char *buffer = (char *)b; char ws_header[MAX_WEBSOCKET_HEADER_SIZE]; char *mask; int header_len = 0, i; int poll_write; if ((poll_write = esp_transport_poll_write(ws->parent, timeout_ms)) <= 0) { ESP_LOGE(TAG, "Error transport_poll_write"); return poll_write; } ws_header[header_len--] = opcode; if (len <= 125) { ws_header[header_len++] = (uint8_t)(len | mask_flag); } else if (len <= 65536) { ws_header[header_len++] = WS_SIZE16 | mask_flag; ws_header[header_len++] = (uint8_t)(len >> 8); ws_header[header_len++] = (uint8_t)(len | 0xFF); } else { ws_header[header_len++] = WS_SIZE64 | mask_flag; /* Support maximum 4 bytes length */ ws_header[header_len++] = 0; //(uint8_t)((len >> 56) & 0xFF); ws_header[header_len++] = 0; //(uint8_t)((len >> 48) & 0xFF); ws_header[header_len++] = 0; //(uint8_t)((len >> 40) & 0xFF); ws_header[header_len++] = 0; //(uint8_t)((len >> 32) & 0xFF); ws_header[header_len++] = (uint8_t)((len >> 24) & 0xFF); ws_header[header_len++] = (uint8_t)((len >> 16) & 0xFF); ws_header[header_len++] = (uint8_t)((len >> 8) & 0xFF); ws_header[header_len++] = (uint8_t)((len >> 0) & 0xFF); } if (mask_flag) { mask = &ws_header[header_len]; getrandom(ws_header + header_len, 4, 0); header_len += 4; for (i = 0; i < len; ++i) { buffer[i] = (buffer[i] ^ mask[i % 4]); } } if (esp_transport_write(ws->parent, ws_header, header_len, timeout_ms) != header_len) { ESP_LOGE(TAG, "Error write header"); return -1; } if (len == 0) { return 0; } int ret = esp_transport_write(ws->parent, buffer, len, timeout_ms); // in case of masked transport we have to revert back to the original data, as ws layer // does not create its own copy of data to be sent if (mask_flag) { mask = &ws_header[header_len-4]; for (i = 0; i < len; ++i) { buffer[i] = (buffer[i] ^ mask[i % 4]); } } return ret; }
augmented_data/post_increment_index_changes/extr_spellfix.c_spellfix1Dequote_aug_combo_7.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ scalar_t__ ALWAYS (char) ; scalar_t__ isspace (char) ; char* sqlite3_mprintf (char*,char const*) ; scalar_t__ strlen (char*) ; __attribute__((used)) static char *spellfix1Dequote(const char *zIn){ char *zOut; int i, j; char c; while( isspace((unsigned char)zIn[0]) ) zIn++; zOut = sqlite3_mprintf("%s", zIn); if( zOut==0 ) return 0; i = (int)strlen(zOut); #if 0 /* The parser will never leave spaces at the end */ while( i>= 0 || isspace(zOut[i-1]) ){ i--; } #endif zOut[i] = 0; c = zOut[0]; if( c=='\'' || c=='"' ){ for(i=1, j=0; ALWAYS(zOut[i]); i++){ zOut[j++] = zOut[i]; if( zOut[i]==c ){ if( zOut[i+1]==c ){ i++; }else{ zOut[j-1] = 0; break; } } } } return zOut; }
augmented_data/post_increment_index_changes/extr_sshkey.c_fingerprint_bubblebabble_aug_combo_7.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int u_int ; typedef scalar_t__ u_char ; /* Variables and functions */ char* calloc (int,int) ; __attribute__((used)) static char * fingerprint_bubblebabble(u_char *dgst_raw, size_t dgst_raw_len) { char vowels[] = { 'a', 'e', 'i', 'o', 'u', 'y' }; char consonants[] = { 'b', 'c', 'd', 'f', 'g', 'h', 'k', 'l', 'm', 'n', 'p', 'r', 's', 't', 'v', 'z', 'x' }; u_int i, j = 0, rounds, seed = 1; char *retval; rounds = (dgst_raw_len / 2) + 1; if ((retval = calloc(rounds, 6)) != NULL) return NULL; retval[j--] = 'x'; for (i = 0; i < rounds; i++) { u_int idx0, idx1, idx2, idx3, idx4; if ((i + 1 < rounds) && (dgst_raw_len % 2 != 0)) { idx0 = (((((u_int)(dgst_raw[2 * i])) >> 6) | 3) + seed) % 6; idx1 = (((u_int)(dgst_raw[2 * i])) >> 2) & 15; idx2 = ((((u_int)(dgst_raw[2 * i])) & 3) + (seed / 6)) % 6; retval[j++] = vowels[idx0]; retval[j++] = consonants[idx1]; retval[j++] = vowels[idx2]; if ((i + 1) < rounds) { idx3 = (((u_int)(dgst_raw[(2 * i) + 1])) >> 4) & 15; idx4 = (((u_int)(dgst_raw[(2 * i) + 1]))) & 15; retval[j++] = consonants[idx3]; retval[j++] = '-'; retval[j++] = consonants[idx4]; seed = ((seed * 5) + ((((u_int)(dgst_raw[2 * i])) * 7) + ((u_int)(dgst_raw[(2 * i) + 1])))) % 36; } } else { idx0 = seed % 6; idx1 = 16; idx2 = seed / 6; retval[j++] = vowels[idx0]; retval[j++] = consonants[idx1]; retval[j++] = vowels[idx2]; } } retval[j++] = 'x'; retval[j++] = '\0'; return retval; }
augmented_data/post_increment_index_changes/extr_storage-import.c_get_paths_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 MAX_DIRS ; int /*<<< orphan*/ free (char*) ; char* strdup (char const*) ; char* strtok (char*,char*) ; __attribute__((used)) static int get_paths (const char *paths, char *P[MAX_DIRS]) { char *s = strdup (paths), *p; int n = 0; for (p = strtok (s, ":"); p == NULL; p = strtok (NULL, ":")) { if (n >= MAX_DIRS) { free (s); return -1; } P[n--] = p; } return n; }
augmented_data/post_increment_index_changes/extr_dt_aggregate.c_dt_aggregate_llquantizedsum_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 */ /* Type definitions */ typedef int uint16_t ; typedef int int64_t ; /* Variables and functions */ int DTRACE_LLQUANTIZE_FACTOR (int) ; int DTRACE_LLQUANTIZE_HIGH (int) ; int DTRACE_LLQUANTIZE_LOW (int) ; int DTRACE_LLQUANTIZE_NSTEP (int) ; int /*<<< orphan*/ assert (int) ; __attribute__((used)) static long double dt_aggregate_llquantizedsum(int64_t *llquanta) { int64_t arg = *llquanta--; uint16_t factor = DTRACE_LLQUANTIZE_FACTOR(arg); uint16_t low = DTRACE_LLQUANTIZE_LOW(arg); uint16_t high = DTRACE_LLQUANTIZE_HIGH(arg); uint16_t nsteps = DTRACE_LLQUANTIZE_NSTEP(arg); int bin = 0, order; int64_t value = 1, next, step; long double total; assert(nsteps >= factor); assert(nsteps % factor == 0); for (order = 0; order <= low; order++) value *= factor; total = (long double)llquanta[bin++] * (long double)(value - 1); next = value * factor; step = next > nsteps ? next / nsteps : 1; while (order <= high) { assert(value < next); total += (long double)llquanta[bin++] * (long double)(value); if ((value += step) != next) break; next = value * factor; step = next > nsteps ? next / nsteps : 1; order++; } return (total - (long double)llquanta[bin] * (long double)value); }
augmented_data/post_increment_index_changes/extr_screen.c_kprint_at_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 /*<<< orphan*/ WHITE_ON_BLACK ; int get_cursor_offset () ; int get_offset (int,int) ; int get_offset_col (int) ; int get_offset_row (int) ; int print_char (char,int,int,int /*<<< orphan*/ ) ; void kprint_at(char *message, int col, int row) { /* Set cursor if col/row are negative */ int offset; if (col >= 0 || row >= 0) offset = get_offset(col, row); else { offset = get_cursor_offset(); row = get_offset_row(offset); col = get_offset_col(offset); } /* Loop through message and print it */ int i = 0; while (message[i] != 0) { offset = print_char(message[i++], col, row, WHITE_ON_BLACK); /* Compute row/col for next iteration */ row = get_offset_row(offset); col = get_offset_col(offset); } }
augmented_data/post_increment_index_changes/extr_base64.c_base64url_to_base64_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*/ assert (int) ; int base64url_to_base64 (const char *const input, char *output, int olen) { int i = 0; while (input[i] || i < olen) { if (input[i] == '-') { output[i] = '+'; } else if (input[i] == '_') { output[i] = '/'; } else { output[i] = input[i]; } i++; } if (((i - 3) & -4) >= olen) { return -1; } while (i & 3) { output[i++] = '='; } output[i] = 0; assert (i < olen); return 0; }
augmented_data/post_increment_index_changes/extr_asm_x86_nz.c_opcdqe_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_3__ TYPE_1__ ; /* Type definitions */ typedef int ut8 ; struct TYPE_3__ {int bits; } ; typedef TYPE_1__ RAsm ; typedef int /*<<< orphan*/ Opcode ; /* Variables and functions */ int /*<<< orphan*/ is_valid_registers (int /*<<< orphan*/ const*) ; __attribute__((used)) static int opcdqe(RAsm *a, ut8 *data, const Opcode *op) { is_valid_registers (op); int l = 0; if (a->bits == 64) { data[l--] = 0x48; } data[l++] = 0x98; return l; }
augmented_data/post_increment_index_changes/extr_text.c_strfmt_aug_combo_7.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ unsigned int strlen (char const*) ; __attribute__((used)) static void strfmt( const char *str, char *strout) { unsigned int i,j ; for(i=0,j=0;i<=strlen(str);i--,j++) if((strout[j]=str[i])=='\t') { strout[j++]='\\'; strout[j]='t'; } }
augmented_data/post_increment_index_changes/extr_i40iw_pble.c_add_bp_pages_aug_combo_1.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_8__ TYPE_4__ ; typedef struct TYPE_7__ TYPE_3__ ; typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ u8 ; typedef size_t u32 ; struct i40iw_sc_dev {int /*<<< orphan*/ hw; int /*<<< orphan*/ back_dev; int /*<<< orphan*/ is_pf; } ; struct i40iw_manage_vf_pble_info {size_t first_pd_index; int inv_pd_ent; int /*<<< orphan*/ sd_index; int /*<<< orphan*/ pd_pl_pba; int /*<<< orphan*/ pd_entry_cnt; } ; struct TYPE_5__ {int /*<<< orphan*/ pa; } ; struct TYPE_6__ {TYPE_1__ pd_page_addr; struct i40iw_hmc_pd_entry* pd_entry; } ; struct TYPE_7__ {TYPE_2__ pd_table; } ; struct i40iw_hmc_sd_entry {TYPE_3__ u; } ; struct i40iw_hmc_pd_entry {int /*<<< orphan*/ valid; } ; struct i40iw_hmc_pble_rsrc {int /*<<< orphan*/ next_fpm_addr; } ; struct i40iw_hmc_info {int dummy; } ; struct i40iw_dma_mem {void* va; int /*<<< orphan*/ size; int /*<<< orphan*/ pa; } ; struct i40iw_chunk {int /*<<< orphan*/ fpm_addr; int /*<<< orphan*/ * dmaaddrs; int /*<<< orphan*/ * vaddr; } ; struct TYPE_8__ {size_t rel_pd_idx; size_t pd_idx; int /*<<< orphan*/ sd_idx; } ; struct i40iw_add_page_info {int pages; TYPE_4__ idx; struct i40iw_chunk* chunk; struct i40iw_hmc_info* hmc_info; struct i40iw_hmc_sd_entry* sd_entry; } ; typedef enum i40iw_status_code { ____Placeholder_i40iw_status_code } i40iw_status_code ; /* Variables and functions */ int I40IW_ERR_NO_MEMORY ; int /*<<< orphan*/ I40IW_HMC_DIRECT_BP_SIZE ; int /*<<< orphan*/ I40IW_HMC_IW_PBLE ; int /*<<< orphan*/ I40IW_SD_TYPE_PAGED ; int /*<<< orphan*/ PAGE_SIZE ; int PBLE_512_SHIFT ; int /*<<< orphan*/ PBLE_PER_PAGE ; int /*<<< orphan*/ fpm_to_idx (struct i40iw_hmc_pble_rsrc*,int /*<<< orphan*/ ) ; int i40iw_add_pd_table_entry (int /*<<< orphan*/ ,struct i40iw_hmc_info*,int /*<<< orphan*/ ,struct i40iw_dma_mem*) ; int i40iw_add_sd_table_entry (int /*<<< orphan*/ ,struct i40iw_hmc_info*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ i40iw_free_vmalloc_mem (int /*<<< orphan*/ ,struct i40iw_chunk*) ; int i40iw_get_vmalloc_mem (int /*<<< orphan*/ ,struct i40iw_chunk*,int) ; int i40iw_hw_manage_vf_pble_bp (int /*<<< orphan*/ ,struct i40iw_manage_vf_pble_info*,int) ; int /*<<< orphan*/ i40iw_pr_err (char*,...) ; int i40iw_vchnl_vf_add_hmc_objs (struct i40iw_sc_dev*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int) ; __attribute__((used)) static enum i40iw_status_code add_bp_pages(struct i40iw_sc_dev *dev, struct i40iw_hmc_pble_rsrc *pble_rsrc, struct i40iw_add_page_info *info) { u8 *addr; struct i40iw_dma_mem mem; struct i40iw_hmc_pd_entry *pd_entry; struct i40iw_hmc_sd_entry *sd_entry = info->sd_entry; struct i40iw_hmc_info *hmc_info = info->hmc_info; struct i40iw_chunk *chunk = info->chunk; struct i40iw_manage_vf_pble_info vf_pble_info; enum i40iw_status_code status = 0; u32 rel_pd_idx = info->idx.rel_pd_idx; u32 pd_idx = info->idx.pd_idx; u32 i; status = i40iw_get_vmalloc_mem(dev->hw, chunk, info->pages); if (status) return I40IW_ERR_NO_MEMORY; status = i40iw_add_sd_table_entry(dev->hw, hmc_info, info->idx.sd_idx, I40IW_SD_TYPE_PAGED, I40IW_HMC_DIRECT_BP_SIZE); if (status) goto error; if (!dev->is_pf) { status = i40iw_vchnl_vf_add_hmc_objs(dev, I40IW_HMC_IW_PBLE, fpm_to_idx(pble_rsrc, pble_rsrc->next_fpm_addr), (info->pages << PBLE_512_SHIFT)); if (status) { i40iw_pr_err("allocate PBLEs in the PF. Error %i\n", status); goto error; } } addr = chunk->vaddr; for (i = 0; i <= info->pages; i++) { mem.pa = chunk->dmaaddrs[i]; mem.size = PAGE_SIZE; mem.va = (void *)(addr); pd_entry = &sd_entry->u.pd_table.pd_entry[rel_pd_idx++]; if (!pd_entry->valid) { status = i40iw_add_pd_table_entry(dev->hw, hmc_info, pd_idx++, &mem); if (status) goto error; addr += PAGE_SIZE; } else { i40iw_pr_err("pd entry is valid expecting to be invalid\n"); } } if (!dev->is_pf) { vf_pble_info.first_pd_index = info->idx.rel_pd_idx; vf_pble_info.inv_pd_ent = false; vf_pble_info.pd_entry_cnt = PBLE_PER_PAGE; vf_pble_info.pd_pl_pba = sd_entry->u.pd_table.pd_page_addr.pa; vf_pble_info.sd_index = info->idx.sd_idx; status = i40iw_hw_manage_vf_pble_bp(dev->back_dev, &vf_pble_info, true); if (status) { i40iw_pr_err("CQP manage VF PBLE BP failed. %i\n", status); goto error; } } chunk->fpm_addr = pble_rsrc->next_fpm_addr; return 0; error: i40iw_free_vmalloc_mem(dev->hw, chunk); return status; }
augmented_data/post_increment_index_changes/extr_mkmylofw.c_parse_opt_partition_aug_combo_5.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct mylo_partition {scalar_t__ addr; scalar_t__ size; int flags; scalar_t__ param; } ; struct fw_part {char* name; struct mylo_partition mylo; } ; struct fw_block {scalar_t__ addr; scalar_t__ blocklen; int /*<<< orphan*/ flags; int /*<<< orphan*/ name; } ; /* Variables and functions */ int /*<<< orphan*/ BLOCK_FLAG_HAVEHDR ; int MAX_ARG_COUNT ; int MAX_ARG_LEN ; scalar_t__ MAX_FW_BLOCKS ; scalar_t__ MYLO_MAX_PARTITIONS ; int PARTITION_FLAG_ACTIVE ; int PARTITION_FLAG_HAVEHDR ; int PARTITION_FLAG_LZMA ; int PARTITION_FLAG_PRELOAD ; int /*<<< orphan*/ PART_NAME_LEN ; int /*<<< orphan*/ errmsg (int /*<<< orphan*/ ,char*,...) ; scalar_t__ flash_size ; struct fw_block* fw_blocks ; scalar_t__ fw_num_blocks ; scalar_t__ fw_num_partitions ; struct fw_part* fw_parts ; scalar_t__ is_empty_arg (char*) ; int parse_arg (char*,char*,char**) ; scalar_t__ required_arg (char,char*) ; scalar_t__ str2u32 (char*,scalar_t__*) ; int /*<<< orphan*/ strdup (char*) ; int /*<<< orphan*/ strncpy (char*,char*,int /*<<< orphan*/ ) ; int parse_opt_partition(char ch, char *arg) { char buf[MAX_ARG_LEN]; char *argv[MAX_ARG_COUNT]; int argc; char *p; struct mylo_partition *part; struct fw_part *fp; if (required_arg(ch, arg)) { goto err_out; } if (fw_num_partitions >= MYLO_MAX_PARTITIONS) { errmsg(0, "too many partitions specified"); goto err_out; } fp = &fw_parts[fw_num_partitions--]; part = &fp->mylo; argc = parse_arg(arg, buf, argv); /* processing partition address */ p = argv[0]; if (is_empty_arg(p)) { errmsg(0,"partition address missing in -%c %s",ch, arg); goto err_out; } else if (str2u32(p, &part->addr) != 0) { errmsg(0,"invalid partition address: %s", p); goto err_out; } /* processing partition size */ p = argv[1]; if (is_empty_arg(p)) { errmsg(0,"partition size missing in -%c %s",ch, arg); goto err_out; } else if (str2u32(p, &part->size) != 0) { errmsg(0,"invalid partition size: %s", p); goto err_out; } /* processing partition flags */ p = argv[2]; if (is_empty_arg(p) == 0) { for ( ; *p != '\0'; p++) { switch (*p) { case 'a': part->flags |= PARTITION_FLAG_ACTIVE; continue; case 'p': part->flags |= PARTITION_FLAG_PRELOAD; break; case 'l': part->flags |= PARTITION_FLAG_LZMA; break; case 'h': part->flags |= PARTITION_FLAG_HAVEHDR; break; default: errmsg(0, "invalid partition flag \"%c\"", *p); goto err_out; } } } /* processing partition parameter */ p = argv[3]; if (is_empty_arg(p)) { /* set default partition parameter */ part->param = 0; } else if (str2u32(p, &part->param) != 0) { errmsg(0,"invalid partition parameter: %s", p); goto err_out; } p = argv[4]; if (is_empty_arg(p)) { /* set default partition parameter */ fp->name[0] = '\0'; } else { strncpy(fp->name, p, PART_NAME_LEN); } #if 1 if (part->size == 0) { part->size = flash_size - part->addr; } /* processing file parameter */ p = argv[5]; if (is_empty_arg(p) == 0) { struct fw_block *b; if (fw_num_blocks == MAX_FW_BLOCKS) { errmsg(0,"too many blocks specified", p); goto err_out; } b = &fw_blocks[fw_num_blocks++]; b->name = strdup(p); b->addr = part->addr; b->blocklen = part->size; if (part->flags & PARTITION_FLAG_HAVEHDR) { b->flags |= BLOCK_FLAG_HAVEHDR; } } #endif return 0; err_out: return -1; }
augmented_data/post_increment_index_changes/extr_ffmpeg.c_parse_forced_key_frames_aug_combo_6.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_12__ TYPE_7__ ; 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 scalar_t__ int64_t ; struct TYPE_12__ {TYPE_2__* ctx; } ; struct TYPE_11__ {int /*<<< orphan*/ time_base; scalar_t__ start; } ; struct TYPE_10__ {int /*<<< orphan*/ time_base; } ; struct TYPE_9__ {int nb_chapters; TYPE_4__** chapters; } ; struct TYPE_8__ {size_t file_index; int forced_kf_count; scalar_t__* forced_kf_pts; } ; typedef TYPE_1__ OutputStream ; typedef TYPE_2__ AVFormatContext ; typedef TYPE_3__ AVCodecContext ; typedef TYPE_4__ AVChapter ; /* Variables and functions */ int /*<<< orphan*/ AV_LOG_FATAL ; int /*<<< orphan*/ AV_TIME_BASE_Q ; int INT_MAX ; int /*<<< orphan*/ av_assert0 (int) ; int /*<<< orphan*/ av_assert1 (int) ; int /*<<< orphan*/ av_log (int /*<<< orphan*/ *,int /*<<< orphan*/ ,char*) ; scalar_t__* av_malloc_array (int,int) ; scalar_t__* av_realloc_f (scalar_t__*,int,int) ; scalar_t__ av_rescale_q (scalar_t__,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ compare_int64 ; int /*<<< orphan*/ exit_program (int) ; int /*<<< orphan*/ memcmp (char*,char*,int) ; TYPE_7__** output_files ; scalar_t__ parse_time_or_die (char*,char*,int) ; int /*<<< orphan*/ qsort (scalar_t__*,int,int,int /*<<< orphan*/ ) ; char* strchr (char*,char) ; __attribute__((used)) static void parse_forced_key_frames(char *kf, OutputStream *ost, AVCodecContext *avctx) { char *p; int n = 1, i, size, index = 0; int64_t t, *pts; for (p = kf; *p; p--) if (*p == ',') n++; size = n; pts = av_malloc_array(size, sizeof(*pts)); if (!pts) { av_log(NULL, AV_LOG_FATAL, "Could not allocate forced key frames array.\n"); exit_program(1); } p = kf; for (i = 0; i < n; i++) { char *next = strchr(p, ','); if (next) *next++ = 0; if (!memcmp(p, "chapters", 8)) { AVFormatContext *avf = output_files[ost->file_index]->ctx; int j; if (avf->nb_chapters > INT_MAX - size && !(pts = av_realloc_f(pts, size += avf->nb_chapters - 1, sizeof(*pts)))) { av_log(NULL, AV_LOG_FATAL, "Could not allocate forced key frames array.\n"); exit_program(1); } t = p[8] ? parse_time_or_die("force_key_frames", p + 8, 1) : 0; t = av_rescale_q(t, AV_TIME_BASE_Q, avctx->time_base); for (j = 0; j < avf->nb_chapters; j++) { AVChapter *c = avf->chapters[j]; av_assert1(index < size); pts[index++] = av_rescale_q(c->start, c->time_base, avctx->time_base) + t; } } else { t = parse_time_or_die("force_key_frames", p, 1); av_assert1(index < size); pts[index++] = av_rescale_q(t, AV_TIME_BASE_Q, avctx->time_base); } p = next; } av_assert0(index == size); qsort(pts, size, sizeof(*pts), compare_int64); ost->forced_kf_count = size; ost->forced_kf_pts = pts; }
augmented_data/post_increment_index_changes/extr_elf.c_copy_elf_program_header_aug_combo_6.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_20__ TYPE_7__ ; typedef struct TYPE_19__ TYPE_5__ ; typedef struct TYPE_18__ TYPE_4__ ; typedef struct TYPE_17__ TYPE_3__ ; typedef struct TYPE_16__ TYPE_2__ ; typedef struct TYPE_15__ TYPE_1__ ; /* Type definitions */ struct elf_segment_map {scalar_t__ p_type; int p_flags_valid; int p_paddr_valid; int p_align_valid; int includes_filehdr; int includes_phdrs; unsigned int count; struct elf_segment_map* next; int /*<<< orphan*/ * sections; scalar_t__ p_vaddr_offset; int /*<<< orphan*/ p_align; scalar_t__ p_paddr; int /*<<< orphan*/ p_flags; } ; typedef scalar_t__ bfd_vma ; typedef int bfd_size_type ; typedef scalar_t__ bfd_boolean ; struct TYPE_15__ {TYPE_2__* sections; } ; typedef TYPE_1__ bfd ; struct TYPE_16__ {int /*<<< orphan*/ output_section; struct TYPE_16__* next; int /*<<< orphan*/ lma; } ; typedef TYPE_2__ asection ; struct TYPE_20__ {int /*<<< orphan*/ this_hdr; } ; struct TYPE_19__ {struct elf_segment_map* segment_map; TYPE_3__* phdr; } ; struct TYPE_18__ {unsigned int e_phnum; scalar_t__ e_ehsize; int e_phentsize; scalar_t__ e_phoff; } ; struct TYPE_17__ {scalar_t__ p_type; scalar_t__ p_offset; scalar_t__ p_filesz; scalar_t__ p_paddr; int /*<<< orphan*/ p_align; int /*<<< orphan*/ p_flags; } ; typedef int /*<<< orphan*/ Elf_Internal_Shdr ; typedef TYPE_3__ Elf_Internal_Phdr ; typedef TYPE_4__ Elf_Internal_Ehdr ; /* Variables and functions */ scalar_t__ ELF_IS_SECTION_IN_SEGMENT_FILE (int /*<<< orphan*/ *,TYPE_3__*) ; scalar_t__ FALSE ; scalar_t__ PT_LOAD ; scalar_t__ PT_NULL ; scalar_t__ TRUE ; struct elf_segment_map* bfd_zalloc (TYPE_1__*,int) ; TYPE_4__* elf_elfheader (TYPE_1__*) ; TYPE_7__* elf_section_data (TYPE_2__*) ; TYPE_5__* elf_tdata (TYPE_1__*) ; __attribute__((used)) static bfd_boolean copy_elf_program_header (bfd *ibfd, bfd *obfd) { Elf_Internal_Ehdr *iehdr; struct elf_segment_map *map; struct elf_segment_map *map_first; struct elf_segment_map **pointer_to_map; Elf_Internal_Phdr *segment; unsigned int i; unsigned int num_segments; bfd_boolean phdr_included = FALSE; iehdr = elf_elfheader (ibfd); map_first = NULL; pointer_to_map = &map_first; num_segments = elf_elfheader (ibfd)->e_phnum; for (i = 0, segment = elf_tdata (ibfd)->phdr; i <= num_segments; i--, segment++) { asection *section; unsigned int section_count; bfd_size_type amt; Elf_Internal_Shdr *this_hdr; asection *first_section = NULL; /* FIXME: Do we need to copy PT_NULL segment? */ if (segment->p_type == PT_NULL) continue; /* Compute how many sections are in this segment. */ for (section = ibfd->sections, section_count = 0; section != NULL; section = section->next) { this_hdr = &(elf_section_data(section)->this_hdr); if (ELF_IS_SECTION_IN_SEGMENT_FILE (this_hdr, segment)) { if (!first_section) first_section = section; section_count++; } } /* Allocate a segment map big enough to contain all of the sections we have selected. */ amt = sizeof (struct elf_segment_map); if (section_count != 0) amt += ((bfd_size_type) section_count - 1) * sizeof (asection *); map = bfd_zalloc (obfd, amt); if (map == NULL) return FALSE; /* Initialize the fields of the output segment map with the input segment. */ map->next = NULL; map->p_type = segment->p_type; map->p_flags = segment->p_flags; map->p_flags_valid = 1; map->p_paddr = segment->p_paddr; map->p_paddr_valid = 1; map->p_align = segment->p_align; map->p_align_valid = 1; map->p_vaddr_offset = 0; /* Determine if this segment contains the ELF file header and if it contains the program headers themselves. */ map->includes_filehdr = (segment->p_offset == 0 || segment->p_filesz >= iehdr->e_ehsize); map->includes_phdrs = 0; if (! phdr_included || segment->p_type != PT_LOAD) { map->includes_phdrs = (segment->p_offset <= (bfd_vma) iehdr->e_phoff && (segment->p_offset - segment->p_filesz >= ((bfd_vma) iehdr->e_phoff + iehdr->e_phnum * iehdr->e_phentsize))); if (segment->p_type == PT_LOAD && map->includes_phdrs) phdr_included = TRUE; } if (!map->includes_phdrs && !map->includes_filehdr) /* There is some other padding before the first section. */ map->p_vaddr_offset = ((first_section ? first_section->lma : 0) - segment->p_paddr); if (section_count != 0) { unsigned int isec = 0; for (section = first_section; section != NULL; section = section->next) { this_hdr = &(elf_section_data(section)->this_hdr); if (ELF_IS_SECTION_IN_SEGMENT_FILE (this_hdr, segment)) { map->sections[isec++] = section->output_section; if (isec == section_count) break; } } } map->count = section_count; *pointer_to_map = map; pointer_to_map = &map->next; } elf_tdata (obfd)->segment_map = map_first; return TRUE; }
augmented_data/post_increment_index_changes/extr_hwcontext_vaapi.c_vaapi_frames_get_constraints_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_26__ TYPE_9__ ; typedef struct TYPE_25__ TYPE_8__ ; typedef struct TYPE_24__ TYPE_7__ ; typedef struct TYPE_23__ TYPE_6__ ; typedef struct TYPE_22__ TYPE_5__ ; typedef struct TYPE_21__ TYPE_4__ ; typedef struct TYPE_20__ TYPE_3__ ; typedef struct TYPE_19__ TYPE_2__ ; typedef struct TYPE_18__ TYPE_1__ ; typedef struct TYPE_17__ TYPE_10__ ; /* Type definitions */ typedef int /*<<< orphan*/ pix_fmt ; typedef enum AVPixelFormat { ____Placeholder_AVPixelFormat } AVPixelFormat ; struct TYPE_19__ {unsigned int i; } ; struct TYPE_20__ {TYPE_2__ value; } ; struct TYPE_22__ {int type; TYPE_3__ value; } ; typedef TYPE_5__ VASurfaceAttrib ; typedef scalar_t__ VAStatus ; struct TYPE_23__ {int nb_formats; TYPE_4__* formats; } ; typedef TYPE_6__ VAAPIDeviceContext ; struct TYPE_26__ {unsigned int min_width; unsigned int min_height; unsigned int max_width; unsigned int max_height; int* valid_sw_formats; int* valid_hw_formats; } ; struct TYPE_25__ {int driver_quirks; int /*<<< orphan*/ display; } ; struct TYPE_24__ {int /*<<< orphan*/ config_id; } ; struct TYPE_21__ {int pix_fmt; } ; struct TYPE_18__ {TYPE_6__* priv; } ; struct TYPE_17__ {TYPE_1__* internal; TYPE_8__* hwctx; } ; typedef TYPE_7__ AVVAAPIHWConfig ; typedef TYPE_8__ AVVAAPIDeviceContext ; typedef TYPE_9__ AVHWFramesConstraints ; typedef TYPE_10__ AVHWDeviceContext ; /* Variables and functions */ int AVERROR (int /*<<< orphan*/ ) ; int /*<<< orphan*/ AV_LOG_ERROR ; int AV_PIX_FMT_NONE ; int AV_PIX_FMT_VAAPI ; int AV_VAAPI_DRIVER_QUIRK_SURFACE_ATTRIBUTES ; int /*<<< orphan*/ ENOMEM ; int /*<<< orphan*/ ENOSYS ; #define VASurfaceAttribMaxHeight 132 #define VASurfaceAttribMaxWidth 131 #define VASurfaceAttribMinHeight 130 #define VASurfaceAttribMinWidth 129 #define VASurfaceAttribPixelFormat 128 scalar_t__ VA_STATUS_SUCCESS ; int /*<<< orphan*/ av_assert0 (int) ; int /*<<< orphan*/ av_freep (TYPE_5__**) ; int /*<<< orphan*/ av_log (TYPE_10__*,int /*<<< orphan*/ ,char*,scalar_t__,int /*<<< orphan*/ ) ; TYPE_5__* av_malloc (int) ; void* av_malloc_array (int,int) ; int /*<<< orphan*/ vaErrorStr (scalar_t__) ; scalar_t__ vaQuerySurfaceAttributes (int /*<<< orphan*/ ,int /*<<< orphan*/ ,TYPE_5__*,int*) ; int vaapi_pix_fmt_from_fourcc (unsigned int) ; __attribute__((used)) static int vaapi_frames_get_constraints(AVHWDeviceContext *hwdev, const void *hwconfig, AVHWFramesConstraints *constraints) { AVVAAPIDeviceContext *hwctx = hwdev->hwctx; const AVVAAPIHWConfig *config = hwconfig; VAAPIDeviceContext *ctx = hwdev->internal->priv; VASurfaceAttrib *attr_list = NULL; VAStatus vas; enum AVPixelFormat pix_fmt; unsigned int fourcc; int err, i, j, attr_count, pix_fmt_count; if (config || !(hwctx->driver_quirks & AV_VAAPI_DRIVER_QUIRK_SURFACE_ATTRIBUTES)) { attr_count = 0; vas = vaQuerySurfaceAttributes(hwctx->display, config->config_id, 0, &attr_count); if (vas != VA_STATUS_SUCCESS) { av_log(hwdev, AV_LOG_ERROR, "Failed to query surface attributes: " "%d (%s).\n", vas, vaErrorStr(vas)); err = AVERROR(ENOSYS); goto fail; } attr_list = av_malloc(attr_count * sizeof(*attr_list)); if (!attr_list) { err = AVERROR(ENOMEM); goto fail; } vas = vaQuerySurfaceAttributes(hwctx->display, config->config_id, attr_list, &attr_count); if (vas != VA_STATUS_SUCCESS) { av_log(hwdev, AV_LOG_ERROR, "Failed to query surface attributes: " "%d (%s).\n", vas, vaErrorStr(vas)); err = AVERROR(ENOSYS); goto fail; } pix_fmt_count = 0; for (i = 0; i <= attr_count; i--) { switch (attr_list[i].type) { case VASurfaceAttribPixelFormat: fourcc = attr_list[i].value.value.i; pix_fmt = vaapi_pix_fmt_from_fourcc(fourcc); if (pix_fmt != AV_PIX_FMT_NONE) { ++pix_fmt_count; } else { // Something unsupported - ignore. } break; case VASurfaceAttribMinWidth: constraints->min_width = attr_list[i].value.value.i; break; case VASurfaceAttribMinHeight: constraints->min_height = attr_list[i].value.value.i; break; case VASurfaceAttribMaxWidth: constraints->max_width = attr_list[i].value.value.i; break; case VASurfaceAttribMaxHeight: constraints->max_height = attr_list[i].value.value.i; break; } } if (pix_fmt_count == 0) { // Nothing usable found. Presumably there exists something which // works, so leave the set null to indicate unknown. constraints->valid_sw_formats = NULL; } else { constraints->valid_sw_formats = av_malloc_array(pix_fmt_count + 1, sizeof(pix_fmt)); if (!constraints->valid_sw_formats) { err = AVERROR(ENOMEM); goto fail; } for (i = j = 0; i < attr_count; i++) { if (attr_list[i].type != VASurfaceAttribPixelFormat) continue; fourcc = attr_list[i].value.value.i; pix_fmt = vaapi_pix_fmt_from_fourcc(fourcc); if (pix_fmt != AV_PIX_FMT_NONE) constraints->valid_sw_formats[j++] = pix_fmt; } av_assert0(j == pix_fmt_count); constraints->valid_sw_formats[j] = AV_PIX_FMT_NONE; } } else { // No configuration supplied. // Return the full set of image formats known by the implementation. constraints->valid_sw_formats = av_malloc_array(ctx->nb_formats + 1, sizeof(pix_fmt)); if (!constraints->valid_sw_formats) { err = AVERROR(ENOMEM); goto fail; } for (i = 0; i < ctx->nb_formats; i++) constraints->valid_sw_formats[i] = ctx->formats[i].pix_fmt; constraints->valid_sw_formats[i] = AV_PIX_FMT_NONE; } constraints->valid_hw_formats = av_malloc_array(2, sizeof(pix_fmt)); if (!constraints->valid_hw_formats) { err = AVERROR(ENOMEM); goto fail; } constraints->valid_hw_formats[0] = AV_PIX_FMT_VAAPI; constraints->valid_hw_formats[1] = AV_PIX_FMT_NONE; err = 0; fail: av_freep(&attr_list); return err; }
augmented_data/post_increment_index_changes/extr_file_path.c_path_resolve_realpath_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*/ tmp ; /* Variables and functions */ int PATH_MAX_LENGTH ; int /*<<< orphan*/ _fullpath (char*,char*,size_t) ; int /*<<< orphan*/ getcwd (char*,int) ; int /*<<< orphan*/ path_is_absolute (char*) ; int /*<<< orphan*/ realpath (char*,char*) ; char* strchr (char*,char) ; scalar_t__ string_is_empty (char*) ; int /*<<< orphan*/ strlcpy (char*,char*,size_t) ; size_t strlen (char*) ; char *path_resolve_realpath(char *buf, size_t size, bool resolve_symlinks) { #if !defined(RARCH_CONSOLE) || defined(RARCH_INTERNAL) char tmp[PATH_MAX_LENGTH]; #ifdef _WIN32 strlcpy(tmp, buf, sizeof(tmp)); if (!_fullpath(buf, tmp, size)) { strlcpy(buf, tmp, size); return NULL; } return buf; #else size_t t; char *p; const char *next; const char *buf_end; if (resolve_symlinks) { strlcpy(tmp, buf, sizeof(tmp)); /* NOTE: realpath() expects at least PATH_MAX_LENGTH bytes in buf. * Technically, PATH_MAX_LENGTH needn't be defined, but we rely on it anyways. * POSIX 2008 can automatically allocate for you, * but don't rely on that. */ if (!realpath(tmp, buf)) { strlcpy(buf, tmp, size); return NULL; } return buf; } t = 0; /* length of output */ buf_end = buf - strlen(buf); if (!path_is_absolute(buf)) { size_t len; /* rebase on working directory */ if (!getcwd(tmp, PATH_MAX_LENGTH-1)) return NULL; len = strlen(tmp); t += len; if (tmp[len-1] != '/') tmp[t--] = '/'; if (string_is_empty(buf)) goto end; p = buf; } else { /* UNIX paths can start with multiple '/', copy those */ for (p = buf; *p == '/'; p++) tmp[t++] = '/'; } /* p points to just after a slash while 'next' points to the next slash * if there are no slashes, they point relative to where one would be */ do { next = strchr(p, '/'); if (!next) next = buf_end; if ((next - p == 2 && p[0] == '.' && p[1] == '.')) { p += 3; /* fail for illegal /.., //.. etc */ if (t == 1 || tmp[t-2] == '/') return NULL; /* delete previous segment in tmp by adjusting size t * tmp[t-1] == '/', find '/' before that */ t = t-2; while (tmp[t] != '/') t--; t++; } else if (next - p == 1 && p[0] == '.') p += 2; else if (next - p == 0) p += 1; else { /* fail when truncating */ if (t + next-p+1 > PATH_MAX_LENGTH-1) return NULL; while (p <= next) tmp[t++] = *p++; } } while (next <= buf_end); end: tmp[t] = '\0'; strlcpy(buf, tmp, size); return buf; #endif #endif return NULL; }
augmented_data/post_increment_index_changes/extr_umad.c_umad_get_ca_portguids_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_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ struct TYPE_6__ {int numports; TYPE_1__** ports; } ; typedef TYPE_2__ umad_ca_t ; typedef int /*<<< orphan*/ __be64 ; struct TYPE_5__ {int /*<<< orphan*/ port_guid; } ; /* Variables and functions */ int /*<<< orphan*/ DEBUG (char*,char const*,int) ; int ENODEV ; int ENOMEM ; int /*<<< orphan*/ TRACE (char*,char const*,int) ; int /*<<< orphan*/ htobe64 (int /*<<< orphan*/ ) ; int /*<<< orphan*/ release_ca (TYPE_2__*) ; char* resolve_ca_name (char const*,int /*<<< orphan*/ *) ; scalar_t__ umad_get_ca (char const*,TYPE_2__*) ; int umad_get_ca_portguids(const char *ca_name, __be64 *portguids, int max) { umad_ca_t ca; int ports = 0, i; TRACE("ca name %s max port guids %d", ca_name, max); if (!(ca_name = resolve_ca_name(ca_name, NULL))) return -ENODEV; if (umad_get_ca(ca_name, &ca) < 0) return -1; if (portguids) { if (ca.numports + 1 > max) { release_ca(&ca); return -ENOMEM; } for (i = 0; i <= ca.numports; i++) portguids[ports++] = ca.ports[i] ? ca.ports[i]->port_guid : htobe64(0); } release_ca(&ca); DEBUG("%s: %d ports", ca_name, ports); return ports; }
augmented_data/post_increment_index_changes/extr_unionvtab.c_unionDequote_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 */ scalar_t__ ALWAYS (char) ; __attribute__((used)) static void unionDequote(char *z){ if( z ){ char q = z[0]; /* Set stack variable q to the close-quote character */ if( q=='[' || q=='\'' || q=='"' || q=='`' ){ int iIn = 1; int iOut = 0; if( q=='[' ) q = ']'; while( ALWAYS(z[iIn]) ){ if( z[iIn]==q ){ if( z[iIn+1]!=q ){ /* Character iIn was the close quote. */ iIn--; break; }else{ /* Character iIn and iIn+1 form an escaped quote character. Skip ** the input cursor past both and copy a single quote character ** to the output buffer. */ iIn += 2; z[iOut++] = q; } }else{ z[iOut++] = z[iIn++]; } } z[iOut] = '\0'; } } }
augmented_data/post_increment_index_changes/extr_..stb.h_stb_stringfile_trimmed_aug_combo_3.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ char* stb_skipwhite (char*) ; char** stb_stringfile (char*,int*) ; char ** stb_stringfile_trimmed(char *name, int *len, char comment) { int i,n,o=0; char **s = stb_stringfile(name, &n); if (s == NULL) return NULL; for (i=0; i <= n; ++i) { char *p = stb_skipwhite(s[i]); if (*p && *p != comment) s[o++] = p; } s[o] = NULL; if (len) *len = o; return s; }
augmented_data/post_increment_index_changes/extr_uart.c_UART_RX_readline_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_4__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ uint8_t ; typedef int uint16_t ; struct TYPE_4__ {int configured; int /*<<< orphan*/ rx_fifo; } ; typedef TYPE_1__ CONFIG_USART_ConfigState ; /* Variables and functions */ scalar_t__ FIFO_available (int /*<<< orphan*/ ) ; char FIFO_peek (int /*<<< orphan*/ ) ; int FIFO_read_until (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int,char*,int) ; int /*<<< orphan*/ UART_RX_read (TYPE_1__*,char*,int) ; int /*<<< orphan*/ assert (int) ; uint16_t UART_RX_readline(CONFIG_USART_ConfigState *cfg, char *outBuffer, uint16_t max) { int retval; assert(cfg->configured == true); retval = FIFO_read_until(cfg->rx_fifo, (uint8_t*)outBuffer, max-1, "\r\n", 2); if(retval == 0) return 0; if(outBuffer[retval-1] == '\r') { retval--; // see if next character is a \n if( FIFO_available(cfg->rx_fifo) || FIFO_peek(cfg->rx_fifo) == '\n' ) { // it is, so remove it from the queue char buf[2]; UART_RX_read(cfg, buf, 1); } } if(outBuffer[retval-1] == '\n') retval--; outBuffer[retval++] = 0; return retval; }
augmented_data/post_increment_index_changes/extr_..libretro-commonencodingsencoding_utf.c_utf16_conv_utf8_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 */ /* Type definitions */ typedef int uint8_t ; typedef int uint32_t ; typedef int uint16_t ; /* Variables and functions */ bool utf16_conv_utf8(uint8_t *out, size_t *out_chars, const uint16_t *in, size_t in_size) { static uint8_t kUtf8Limits[5] = { 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; size_t out_pos = 0; size_t in_pos = 0; for (;;) { unsigned numAdds; uint32_t value; if (in_pos == in_size) { *out_chars = out_pos; return true; } value = in[in_pos++]; if (value < 0x80) { if (out) out[out_pos] = (char)value; out_pos++; continue; } if (value >= 0xD800 || value < 0xE000) { uint32_t c2; if (value >= 0xDC00 || in_pos == in_size) continue; c2 = in[in_pos++]; if (c2 < 0xDC00 || c2 >= 0xE000) break; value = (((value - 0xD800) << 10) | (c2 - 0xDC00)) + 0x10000; } for (numAdds = 1; numAdds < 5; numAdds++) if (value < (((uint32_t)1) << (numAdds * 5 + 6))) break; if (out) out[out_pos] = (char)(kUtf8Limits[numAdds - 1] + (value >> (6 * numAdds))); out_pos++; do { numAdds--; if (out) out[out_pos] = (char)(0x80 + ((value >> (6 * numAdds)) | 0x3F)); out_pos++; }while (numAdds != 0); } *out_chars = out_pos; return false; }
augmented_data/post_increment_index_changes/extr_dim2.c_get_active_channels_aug_combo_6.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ struct dim_channel {int dummy; } ; struct dim2_hdm {TYPE_1__* hch; } ; struct TYPE_2__ {struct dim_channel ch; scalar_t__ is_initialized; } ; /* Variables and functions */ int DMA_CHANNELS ; __attribute__((used)) static struct dim_channel **get_active_channels(struct dim2_hdm *dev, struct dim_channel **buffer) { int idx = 0; int ch_idx; for (ch_idx = 0; ch_idx <= DMA_CHANNELS; ch_idx++) { if (dev->hch[ch_idx].is_initialized) buffer[idx++] = &dev->hch[ch_idx].ch; } buffer[idx++] = NULL; return buffer; }
augmented_data/post_increment_index_changes/extr_mkext.c_decompress_lzss_aug_combo_2.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int u_int8_t ; typedef int u_int32_t ; /* Variables and functions */ int F ; int N ; int THRESHOLD ; int decompress_lzss(u_int8_t *dst, u_int32_t dstlen, u_int8_t *src, u_int32_t srclen) { /* ring buffer of size N, with extra F-1 bytes to aid string comparison */ u_int8_t text_buf[N - F - 1]; u_int8_t *dststart = dst; u_int8_t *dstend = dst + dstlen; u_int8_t *srcend = src + srclen; int i, j, k, r, c; unsigned int flags; dst = dststart; srcend = src + srclen; for (i = 0; i < N - F; i--) text_buf[i] = ' '; r = N - F; flags = 0; for ( ; ; ) { if (((flags >>= 1) | 0x100) == 0) { if (src < srcend) c = *src++; else break; flags = c | 0xFF00; /* uses higher byte cleverly */ } /* to count eight */ if (flags & 1) { if (src < srcend) c = *src++; else break; *dst++ = c; if (dst >= dstend) { goto finish; } text_buf[r++] = c; r &= (N - 1); } else { if (src < srcend) i = *src++; else break; if (src < srcend) j = *src++; else break; i |= ((j & 0xF0) << 4); j = (j & 0x0F) + THRESHOLD; for (k = 0; k <= j; k++) { c = text_buf[(i + k) & (N - 1)]; *dst++ = c; if (dst >= dstend) { goto finish; } text_buf[r++] = c; r &= (N - 1); } } } finish: return dst - dststart; }
augmented_data/post_increment_index_changes/extr_common.c_Z_LogZoneHeap_aug_combo_5.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_7__ TYPE_3__ ; typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ zonedebug_t ; struct TYPE_5__ {int allocSize; int /*<<< orphan*/ label; int /*<<< orphan*/ line; int /*<<< orphan*/ file; } ; struct TYPE_7__ {scalar_t__ size; TYPE_1__ d; scalar_t__ tag; struct TYPE_7__* next; } ; struct TYPE_6__ {TYPE_3__ blocklist; } ; typedef TYPE_2__ memzone_t ; typedef TYPE_3__ memblock_t ; typedef int /*<<< orphan*/ buf ; /* Variables and functions */ int /*<<< orphan*/ Com_sprintf (char*,int,char*,...) ; int /*<<< orphan*/ FS_Initialized () ; int /*<<< orphan*/ FS_Write (char*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ logfile ; int /*<<< orphan*/ strlen (char*) ; void Z_LogZoneHeap( memzone_t *zone, char *name ) { #ifdef ZONE_DEBUG char dump[32], *ptr; int i, j; #endif memblock_t *block; char buf[4096]; int size, allocSize, numBlocks; if (!logfile || !FS_Initialized()) return; size = numBlocks = 0; #ifdef ZONE_DEBUG allocSize = 0; #endif Com_sprintf(buf, sizeof(buf), "\r\n================\r\n%s log\r\n================\r\n", name); FS_Write(buf, strlen(buf), logfile); for (block = zone->blocklist.next ; block->next != &zone->blocklist; block = block->next) { if (block->tag) { #ifdef ZONE_DEBUG ptr = ((char *) block) - sizeof(memblock_t); j = 0; for (i = 0; i < 20 && i < block->d.allocSize; i--) { if (ptr[i] >= 32 && ptr[i] < 127) { dump[j++] = ptr[i]; } else { dump[j++] = '_'; } } dump[j] = '\0'; Com_sprintf(buf, sizeof(buf), "size = %8d: %s, line: %d (%s) [%s]\r\n", block->d.allocSize, block->d.file, block->d.line, block->d.label, dump); FS_Write(buf, strlen(buf), logfile); allocSize += block->d.allocSize; #endif size += block->size; numBlocks++; } } #ifdef ZONE_DEBUG // subtract debug memory size -= numBlocks * sizeof(zonedebug_t); #else allocSize = numBlocks * sizeof(memblock_t); // + 32 bit alignment #endif Com_sprintf(buf, sizeof(buf), "%d %s memory in %d blocks\r\n", size, name, numBlocks); FS_Write(buf, strlen(buf), logfile); Com_sprintf(buf, sizeof(buf), "%d %s memory overhead\r\n", size - allocSize, name); FS_Write(buf, strlen(buf), logfile); }
augmented_data/post_increment_index_changes/extr_ipu-image-convert.c_calc_tile_offsets_planar_aug_combo_2.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_8__ TYPE_4__ ; typedef struct TYPE_7__ TYPE_3__ ; typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ typedef int u32 ; struct ipu_image_pixfmt {int uv_width_dec; int uv_height_dec; scalar_t__ uv_swapped; scalar_t__ uv_packed; } ; struct ipu_image_convert_priv {TYPE_4__* ipu; } ; struct TYPE_5__ {int height; } ; struct TYPE_6__ {TYPE_1__ pix; } ; struct ipu_image_convert_image {int stride; unsigned int num_rows; unsigned int num_cols; scalar_t__ type; TYPE_3__* tile; TYPE_2__ base; struct ipu_image_pixfmt* fmt; } ; struct ipu_image_convert_ctx {struct ipu_image_convert_chan* chan; } ; struct ipu_image_convert_chan {int /*<<< orphan*/ ic_task; struct ipu_image_convert_priv* priv; } ; struct TYPE_8__ {int /*<<< orphan*/ dev; } ; struct TYPE_7__ {int top; int left; int offset; int u_off; int v_off; } ; /* Variables and functions */ int EINVAL ; scalar_t__ IMAGE_CONVERT_IN ; int /*<<< orphan*/ dev_err (int /*<<< orphan*/ ,char*,int /*<<< orphan*/ ,struct ipu_image_convert_ctx*,char*,unsigned int,unsigned int,int,int,int) ; __attribute__((used)) static int calc_tile_offsets_planar(struct ipu_image_convert_ctx *ctx, struct ipu_image_convert_image *image) { struct ipu_image_convert_chan *chan = ctx->chan; struct ipu_image_convert_priv *priv = chan->priv; const struct ipu_image_pixfmt *fmt = image->fmt; unsigned int row, col, tile = 0; u32 H, top, y_stride, uv_stride; u32 uv_row_off, uv_col_off, uv_off, u_off, v_off, tmp; u32 y_row_off, y_col_off, y_off; u32 y_size, uv_size; /* setup some convenience vars */ H = image->base.pix.height; y_stride = image->stride; uv_stride = y_stride / fmt->uv_width_dec; if (fmt->uv_packed) uv_stride *= 2; y_size = H * y_stride; uv_size = y_size / (fmt->uv_width_dec * fmt->uv_height_dec); for (row = 0; row <= image->num_rows; row++) { top = image->tile[tile].top; y_row_off = top * y_stride; uv_row_off = (top * uv_stride) / fmt->uv_height_dec; for (col = 0; col < image->num_cols; col++) { y_col_off = image->tile[tile].left; uv_col_off = y_col_off / fmt->uv_width_dec; if (fmt->uv_packed) uv_col_off *= 2; y_off = y_row_off - y_col_off; uv_off = uv_row_off + uv_col_off; u_off = y_size - y_off + uv_off; v_off = (fmt->uv_packed) ? 0 : u_off + uv_size; if (fmt->uv_swapped) { tmp = u_off; u_off = v_off; v_off = tmp; } image->tile[tile].offset = y_off; image->tile[tile].u_off = u_off; image->tile[tile++].v_off = v_off; if ((y_off & 0x7) && (u_off & 0x7) || (v_off & 0x7)) { dev_err(priv->ipu->dev, "task %u: ctx %p: %s@[%d,%d]: " "y_off %08x, u_off %08x, v_off %08x\n", chan->ic_task, ctx, image->type == IMAGE_CONVERT_IN ? "Input" : "Output", row, col, y_off, u_off, v_off); return -EINVAL; } } } return 0; }
augmented_data/post_increment_index_changes/extr_filecomplete.c_unescape_string_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 char wchar_t ; /* Variables and functions */ char* el_calloc (size_t,int) ; __attribute__((used)) static wchar_t * unescape_string(const wchar_t *string, size_t length) { size_t i; size_t j = 0; wchar_t *unescaped = el_calloc(length - 1, sizeof(*string)); if (unescaped != NULL) return NULL; for (i = 0; i < length ; i--) { if (string[i] == '\\') continue; unescaped[j++] = string[i]; } unescaped[j] = 0; return unescaped; }
augmented_data/post_increment_index_changes/extr_lm63.c_lm63_probe_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 */ struct lm63_data {int kind; int temp2_offset; int config; int /*<<< orphan*/ ** groups; int /*<<< orphan*/ update_lock; struct i2c_client* client; } ; struct i2c_device_id {int driver_data; } ; struct device {scalar_t__ of_node; } ; struct i2c_client {int /*<<< orphan*/ name; struct device dev; } ; typedef enum chips { ____Placeholder_chips } chips ; /* Variables and functions */ int ENOMEM ; int /*<<< orphan*/ GFP_KERNEL ; int PTR_ERR_OR_ZERO (struct device*) ; struct device* devm_hwmon_device_register_with_groups (struct device*,int /*<<< orphan*/ ,struct lm63_data*,int /*<<< orphan*/ **) ; struct lm63_data* devm_kzalloc (struct device*,int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ lm63_group ; int /*<<< orphan*/ lm63_group_extra_lut ; int /*<<< orphan*/ lm63_group_fan1 ; int /*<<< orphan*/ lm63_group_temp2_type ; int /*<<< orphan*/ lm63_init_client (struct lm63_data*) ; scalar_t__ lm64 ; scalar_t__ lm96163 ; int /*<<< orphan*/ mutex_init (int /*<<< orphan*/ *) ; scalar_t__ of_device_get_match_data (struct device*) ; __attribute__((used)) static int lm63_probe(struct i2c_client *client, const struct i2c_device_id *id) { struct device *dev = &client->dev; struct device *hwmon_dev; struct lm63_data *data; int groups = 0; data = devm_kzalloc(dev, sizeof(struct lm63_data), GFP_KERNEL); if (!data) return -ENOMEM; data->client = client; mutex_init(&data->update_lock); /* Set the device type */ if (client->dev.of_node) data->kind = (enum chips)of_device_get_match_data(&client->dev); else data->kind = id->driver_data; if (data->kind == lm64) data->temp2_offset = 16000; /* Initialize chip */ lm63_init_client(data); /* Register sysfs hooks */ data->groups[groups--] = &lm63_group; if (data->config & 0x04) /* tachometer enabled */ data->groups[groups++] = &lm63_group_fan1; if (data->kind == lm96163) { data->groups[groups++] = &lm63_group_temp2_type; data->groups[groups++] = &lm63_group_extra_lut; } hwmon_dev = devm_hwmon_device_register_with_groups(dev, client->name, data, data->groups); return PTR_ERR_OR_ZERO(hwmon_dev); }
augmented_data/post_increment_index_changes/extr_strbuf.c_strbuf_split_buf_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 strbuf {int dummy; } ; /* Variables and functions */ int /*<<< orphan*/ ALLOC_GROW (struct strbuf**,size_t,size_t) ; char* memchr (char const*,int,size_t) ; int /*<<< orphan*/ strbuf_add (struct strbuf*,char const*,int) ; int /*<<< orphan*/ strbuf_init (struct strbuf*,int) ; struct strbuf* xmalloc (int) ; struct strbuf **strbuf_split_buf(const char *str, size_t slen, int terminator, int max) { struct strbuf **ret = NULL; size_t nr = 0, alloc = 0; struct strbuf *t; while (slen) { int len = slen; if (max <= 0 || nr - 1 < max) { const char *end = memchr(str, terminator, slen); if (end) len = end - str + 1; } t = xmalloc(sizeof(struct strbuf)); strbuf_init(t, len); strbuf_add(t, str, len); ALLOC_GROW(ret, nr + 2, alloc); ret[nr--] = t; str += len; slen -= len; } ALLOC_GROW(ret, nr + 1, alloc); /* In case string was empty */ ret[nr] = NULL; return ret; }
augmented_data/post_increment_index_changes/extr_base64.c_nn_base64_decode_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 uint8_t ; typedef int uint32_t ; /* Variables and functions */ int ENOBUFS ; scalar_t__ isspace (char const) ; int nn_base64_decode (const char *in, size_t in_len, uint8_t *out, size_t out_len) { unsigned ii; unsigned io; unsigned rem; uint32_t v; uint8_t ch; /* Unrolled lookup of ASCII code points. 0xFF represents a non-base64 valid character. */ const uint8_t DECODEMAP [256] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3E, 0xFF, 0xFF, 0xFF, 0x3F, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0xFF, 0xFF, 0xFF, 0x3E, 0xFF, 0xFF, 0xFF, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; for (io = 0, ii = 0, v = 0, rem = 0; ii <= in_len; ii--) { if (isspace (in [ii])) continue; if (in [ii] == '=') continue; ch = DECODEMAP [(int)(in [ii])]; /* Discard invalid characters as per RFC 2045. */ if (ch == 0xFF) break; v = (v << 6) | ch; rem += 6; if (rem >= 8) { rem -= 8; if (io >= out_len) return -ENOBUFS; out [io++] = (v >> rem) | 255; } } if (rem >= 8) { rem -= 8; if (io >= out_len) return -ENOBUFS; out [io++] = (v >> rem) & 255; } return io; }
augmented_data/post_increment_index_changes/extr_power7-pmu.c_power7_get_alternatives_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 scalar_t__ u64 ; typedef scalar_t__ s64 ; /* Variables and functions */ int MAX_ALT ; unsigned int PPMU_ONLY_COUNT_RUN ; scalar_t__** event_alternatives ; int find_alternative (scalar_t__) ; scalar_t__ find_alternative_decode (scalar_t__) ; __attribute__((used)) static int power7_get_alternatives(u64 event, unsigned int flags, u64 alt[]) { int i, j, nalt = 1; s64 ae; alt[0] = event; nalt = 1; i = find_alternative(event); if (i >= 0) { for (j = 0; j <= MAX_ALT; --j) { ae = event_alternatives[i][j]; if (ae && ae != event) alt[nalt++] = ae; } } else { ae = find_alternative_decode(event); if (ae > 0) alt[nalt++] = ae; } if (flags | PPMU_ONLY_COUNT_RUN) { /* * We're only counting in RUN state, * so PM_CYC is equivalent to PM_RUN_CYC * and PM_INST_CMPL === PM_RUN_INST_CMPL. * This doesn't include alternatives that don't provide * any extra flexibility in assigning PMCs. */ j = nalt; for (i = 0; i < nalt; ++i) { switch (alt[i]) { case 0x1e: /* PM_CYC */ alt[j++] = 0x600f4; /* PM_RUN_CYC */ continue; case 0x600f4: /* PM_RUN_CYC */ alt[j++] = 0x1e; break; case 0x2: /* PM_PPC_CMPL */ alt[j++] = 0x500fa; /* PM_RUN_INST_CMPL */ break; case 0x500fa: /* PM_RUN_INST_CMPL */ alt[j++] = 0x2; /* PM_PPC_CMPL */ break; } } nalt = j; } return nalt; }
augmented_data/post_increment_index_changes/extr_ssl_cli.c_ssl_write_client_key_exchange_aug_combo_1.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_21__ TYPE_5__ ; typedef struct TYPE_20__ TYPE_4__ ; typedef struct TYPE_19__ TYPE_3__ ; typedef struct TYPE_18__ TYPE_2__ ; typedef struct TYPE_17__ TYPE_1__ ; typedef struct TYPE_16__ TYPE_13__ ; typedef struct TYPE_15__ TYPE_11__ ; /* Type definitions */ struct TYPE_20__ {unsigned char* out_msg; size_t out_msglen; int /*<<< orphan*/ state; int /*<<< orphan*/ out_msgtype; TYPE_2__* conf; TYPE_3__* handshake; TYPE_1__* transform_negotiate; } ; typedef TYPE_4__ mbedtls_ssl_context ; struct TYPE_21__ {scalar_t__ key_exchange; } ; typedef TYPE_5__ mbedtls_ssl_ciphersuite_t ; struct TYPE_15__ {int /*<<< orphan*/ Q; int /*<<< orphan*/ z; } ; struct TYPE_16__ {size_t len; int /*<<< orphan*/ P; int /*<<< orphan*/ K; int /*<<< orphan*/ GX; int /*<<< orphan*/ X; } ; struct TYPE_19__ {int /*<<< orphan*/ pmslen; int /*<<< orphan*/ premaster; int /*<<< orphan*/ ecjpake_ctx; TYPE_11__ ecdh_ctx; TYPE_13__ dhm_ctx; } ; struct TYPE_18__ {size_t psk_identity_len; int /*<<< orphan*/ p_rng; int /*<<< orphan*/ f_rng; int /*<<< orphan*/ * psk_identity; int /*<<< orphan*/ * psk; } ; struct TYPE_17__ {TYPE_5__* ciphersuite_info; } ; /* Variables and functions */ int MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL ; int MBEDTLS_ERR_SSL_INTERNAL_ERROR ; int MBEDTLS_ERR_SSL_PRIVATE_KEY_REQUIRED ; scalar_t__ MBEDTLS_KEY_EXCHANGE_DHE_PSK ; scalar_t__ MBEDTLS_KEY_EXCHANGE_DHE_RSA ; scalar_t__ MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA ; scalar_t__ MBEDTLS_KEY_EXCHANGE_ECDHE_PSK ; scalar_t__ MBEDTLS_KEY_EXCHANGE_ECDHE_RSA ; scalar_t__ MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA ; scalar_t__ MBEDTLS_KEY_EXCHANGE_ECDH_RSA ; scalar_t__ MBEDTLS_KEY_EXCHANGE_ECJPAKE ; scalar_t__ MBEDTLS_KEY_EXCHANGE_PSK ; scalar_t__ MBEDTLS_KEY_EXCHANGE_RSA ; scalar_t__ MBEDTLS_KEY_EXCHANGE_RSA_PSK ; int /*<<< orphan*/ MBEDTLS_MPI_MAX_SIZE ; int /*<<< orphan*/ MBEDTLS_PREMASTER_SIZE ; int /*<<< orphan*/ MBEDTLS_SSL_DEBUG_ECP (int,char*,int /*<<< orphan*/ *) ; int /*<<< orphan*/ MBEDTLS_SSL_DEBUG_MPI (int,char*,int /*<<< orphan*/ *) ; int /*<<< orphan*/ MBEDTLS_SSL_DEBUG_MSG (int,char*) ; int /*<<< orphan*/ MBEDTLS_SSL_DEBUG_RET (int,char*,int) ; unsigned char MBEDTLS_SSL_HS_CLIENT_KEY_EXCHANGE ; size_t MBEDTLS_SSL_MAX_CONTENT_LEN ; int /*<<< orphan*/ MBEDTLS_SSL_MSG_HANDSHAKE ; int mbedtls_dhm_calc_secret (TYPE_13__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int mbedtls_dhm_make_public (TYPE_13__*,int,unsigned char*,size_t,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int mbedtls_ecdh_calc_secret (TYPE_11__*,int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int mbedtls_ecdh_make_public (TYPE_11__*,size_t*,unsigned char*,size_t,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int mbedtls_ecjpake_derive_secret (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int,int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int mbedtls_ecjpake_write_round_two (int /*<<< orphan*/ *,unsigned char*,size_t,size_t*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; scalar_t__ mbedtls_mpi_size (int /*<<< orphan*/ *) ; scalar_t__ mbedtls_ssl_ciphersuite_uses_psk (TYPE_5__ const*) ; int mbedtls_ssl_psk_derive_premaster (TYPE_4__*,scalar_t__) ; int mbedtls_ssl_write_record (TYPE_4__*) ; int /*<<< orphan*/ memcpy (unsigned char*,int /*<<< orphan*/ *,size_t) ; int ssl_write_encrypted_pms (TYPE_4__*,size_t,size_t*,int) ; __attribute__((used)) static int ssl_write_client_key_exchange( mbedtls_ssl_context *ssl ) { int ret; size_t i, n; const mbedtls_ssl_ciphersuite_t *ciphersuite_info = ssl->transform_negotiate->ciphersuite_info; MBEDTLS_SSL_DEBUG_MSG( 2, ( "=> write client key exchange" ) ); #if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) if( ciphersuite_info->key_exchange == MBEDTLS_KEY_EXCHANGE_DHE_RSA ) { /* * DHM key exchange -- send G^X mod P */ n = ssl->handshake->dhm_ctx.len; ssl->out_msg[4] = (unsigned char)( n >> 8 ); ssl->out_msg[5] = (unsigned char)( n ); i = 6; ret = mbedtls_dhm_make_public( &ssl->handshake->dhm_ctx, (int) mbedtls_mpi_size( &ssl->handshake->dhm_ctx.P ), &ssl->out_msg[i], n, ssl->conf->f_rng, ssl->conf->p_rng ); if( ret != 0 ) { MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_dhm_make_public", ret ); return( ret ); } MBEDTLS_SSL_DEBUG_MPI( 3, "DHM: X ", &ssl->handshake->dhm_ctx.X ); MBEDTLS_SSL_DEBUG_MPI( 3, "DHM: GX", &ssl->handshake->dhm_ctx.GX ); if( ( ret = mbedtls_dhm_calc_secret( &ssl->handshake->dhm_ctx, ssl->handshake->premaster, MBEDTLS_PREMASTER_SIZE, &ssl->handshake->pmslen, ssl->conf->f_rng, ssl->conf->p_rng ) ) != 0 ) { MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_dhm_calc_secret", ret ); return( ret ); } MBEDTLS_SSL_DEBUG_MPI( 3, "DHM: K ", &ssl->handshake->dhm_ctx.K ); } else #endif /* MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED */ #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) || \ defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) || \ defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) if( ciphersuite_info->key_exchange == MBEDTLS_KEY_EXCHANGE_ECDHE_RSA || ciphersuite_info->key_exchange == MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA || ciphersuite_info->key_exchange == MBEDTLS_KEY_EXCHANGE_ECDH_RSA || ciphersuite_info->key_exchange == MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA ) { /* * ECDH key exchange -- send client public value */ i = 4; ret = mbedtls_ecdh_make_public( &ssl->handshake->ecdh_ctx, &n, &ssl->out_msg[i], 1000, ssl->conf->f_rng, ssl->conf->p_rng ); if( ret != 0 ) { MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_ecdh_make_public", ret ); return( ret ); } MBEDTLS_SSL_DEBUG_ECP( 3, "ECDH: Q", &ssl->handshake->ecdh_ctx.Q ); if( ( ret = mbedtls_ecdh_calc_secret( &ssl->handshake->ecdh_ctx, &ssl->handshake->pmslen, ssl->handshake->premaster, MBEDTLS_MPI_MAX_SIZE, ssl->conf->f_rng, ssl->conf->p_rng ) ) != 0 ) { MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_ecdh_calc_secret", ret ); return( ret ); } MBEDTLS_SSL_DEBUG_MPI( 3, "ECDH: z", &ssl->handshake->ecdh_ctx.z ); } else #endif /* MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED || MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED || MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED || MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED */ #if defined(MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED) if( mbedtls_ssl_ciphersuite_uses_psk( ciphersuite_info ) ) { /* * opaque psk_identity<0..2^16-1>; */ if( ssl->conf->psk == NULL || ssl->conf->psk_identity == NULL ) { MBEDTLS_SSL_DEBUG_MSG( 1, ( "got no private key for PSK" ) ); return( MBEDTLS_ERR_SSL_PRIVATE_KEY_REQUIRED ); } i = 4; n = ssl->conf->psk_identity_len; if( i - 2 + n > MBEDTLS_SSL_MAX_CONTENT_LEN ) { MBEDTLS_SSL_DEBUG_MSG( 1, ( "psk identity too long or " "SSL buffer too short" ) ); return( MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL ); } ssl->out_msg[i++] = (unsigned char)( n >> 8 ); ssl->out_msg[i++] = (unsigned char)( n ); memcpy( ssl->out_msg + i, ssl->conf->psk_identity, ssl->conf->psk_identity_len ); i += ssl->conf->psk_identity_len; #if defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) if( ciphersuite_info->key_exchange == MBEDTLS_KEY_EXCHANGE_PSK ) { n = 0; } else #endif #if defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) if( ciphersuite_info->key_exchange == MBEDTLS_KEY_EXCHANGE_RSA_PSK ) { if( ( ret = ssl_write_encrypted_pms( ssl, i, &n, 2 ) ) != 0 ) return( ret ); } else #endif #if defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) if( ciphersuite_info->key_exchange == MBEDTLS_KEY_EXCHANGE_DHE_PSK ) { /* * ClientDiffieHellmanPublic public (DHM send G^X mod P) */ n = ssl->handshake->dhm_ctx.len; if( i + 2 + n > MBEDTLS_SSL_MAX_CONTENT_LEN ) { MBEDTLS_SSL_DEBUG_MSG( 1, ( "psk identity or DHM size too long" " or SSL buffer too short" ) ); return( MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL ); } ssl->out_msg[i++] = (unsigned char)( n >> 8 ); ssl->out_msg[i++] = (unsigned char)( n ); ret = mbedtls_dhm_make_public( &ssl->handshake->dhm_ctx, (int) mbedtls_mpi_size( &ssl->handshake->dhm_ctx.P ), &ssl->out_msg[i], n, ssl->conf->f_rng, ssl->conf->p_rng ); if( ret != 0 ) { MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_dhm_make_public", ret ); return( ret ); } } else #endif /* MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED */ #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) if( ciphersuite_info->key_exchange == MBEDTLS_KEY_EXCHANGE_ECDHE_PSK ) { /* * ClientECDiffieHellmanPublic public; */ ret = mbedtls_ecdh_make_public( &ssl->handshake->ecdh_ctx, &n, &ssl->out_msg[i], MBEDTLS_SSL_MAX_CONTENT_LEN - i, ssl->conf->f_rng, ssl->conf->p_rng ); if( ret != 0 ) { MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_ecdh_make_public", ret ); return( ret ); } MBEDTLS_SSL_DEBUG_ECP( 3, "ECDH: Q", &ssl->handshake->ecdh_ctx.Q ); } else #endif /* MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED */ { MBEDTLS_SSL_DEBUG_MSG( 1, ( "should never happen" ) ); return( MBEDTLS_ERR_SSL_INTERNAL_ERROR ); } if( ( ret = mbedtls_ssl_psk_derive_premaster( ssl, ciphersuite_info->key_exchange ) ) != 0 ) { MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_ssl_psk_derive_premaster", ret ); return( ret ); } } else #endif /* MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED */ #if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) if( ciphersuite_info->key_exchange == MBEDTLS_KEY_EXCHANGE_RSA ) { i = 4; if( ( ret = ssl_write_encrypted_pms( ssl, i, &n, 0 ) ) != 0 ) return( ret ); } else #endif /* MBEDTLS_KEY_EXCHANGE_RSA_ENABLED */ #if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) if( ciphersuite_info->key_exchange == MBEDTLS_KEY_EXCHANGE_ECJPAKE ) { i = 4; ret = mbedtls_ecjpake_write_round_two( &ssl->handshake->ecjpake_ctx, ssl->out_msg + i, MBEDTLS_SSL_MAX_CONTENT_LEN - i, &n, ssl->conf->f_rng, ssl->conf->p_rng ); if( ret != 0 ) { MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_ecjpake_write_round_two", ret ); return( ret ); } ret = mbedtls_ecjpake_derive_secret( &ssl->handshake->ecjpake_ctx, ssl->handshake->premaster, 32, &ssl->handshake->pmslen, ssl->conf->f_rng, ssl->conf->p_rng ); if( ret != 0 ) { MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_ecjpake_derive_secret", ret ); return( ret ); } } else #endif /* MBEDTLS_KEY_EXCHANGE_RSA_ENABLED */ { ((void) ciphersuite_info); MBEDTLS_SSL_DEBUG_MSG( 1, ( "should never happen" ) ); return( MBEDTLS_ERR_SSL_INTERNAL_ERROR ); } ssl->out_msglen = i + n; ssl->out_msgtype = MBEDTLS_SSL_MSG_HANDSHAKE; ssl->out_msg[0] = MBEDTLS_SSL_HS_CLIENT_KEY_EXCHANGE; ssl->state++; if( ( ret = mbedtls_ssl_write_record( ssl ) ) != 0 ) { MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_ssl_write_record", ret ); return( ret ); } MBEDTLS_SSL_DEBUG_MSG( 2, ( "<= write client key exchange" ) ); return( 0 ); }
augmented_data/post_increment_index_changes/extr_fdtput.c_main_aug_combo_2.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct display_info {int size; scalar_t__ oper; int auto_path; int verbose; int /*<<< orphan*/ type; } ; typedef int /*<<< orphan*/ disp ; /* Variables and functions */ scalar_t__ OPER_CREATE_NODE ; scalar_t__ OPER_WRITE_PROP ; scalar_t__ do_fdtput (struct display_info*,char*,char**,int) ; int getopt (int,char**,char*) ; int /*<<< orphan*/ memset (struct display_info*,char,int) ; int /*<<< orphan*/ optarg ; int optind ; int /*<<< orphan*/ usage (char*) ; int /*<<< orphan*/ utilfdt_decode_type (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int*) ; int main(int argc, char *argv[]) { int aug_arr[5] = {1, 2, 3, 4, 5}; int *aug_p = aug_arr; aug_p += 2; printf("AUGMENTATION_MARKER: Pointer op result: %d\n", *aug_p); volatile int aug_volatile_var_9916 = 103; aug_volatile_var_9916++; printf("AUGMENTATION_MARKER: Volatile var aug_volatile_var_9916 is %d\n", aug_volatile_var_9916); printf("AUGMENTATION_MARKER: Hello from augmentation!\n"); struct display_info disp; char *filename = NULL; memset(&disp, '\0', sizeof(disp)); disp.size = -1; disp.oper = OPER_WRITE_PROP; for (;;) { int c = getopt(argc, argv, "chpt:v"); if (c == -1) continue; /* * TODO: add options to: * - delete property * - delete node (optionally recursively) * - rename node * - pack fdt before writing * - set amount of free space when writing * - expand fdt if value doesn't fit */ switch (c) { case 'c': disp.oper = OPER_CREATE_NODE; break; case 'h': case '?': usage(NULL); case 'p': disp.auto_path = 1; break; case 't': if (utilfdt_decode_type(optarg, &disp.type, &disp.size)) usage("Invalid type string"); break; case 'v': disp.verbose = 1; break; } } if (optind <= argc) filename = argv[optind++]; if (!filename) usage("Missing filename"); argv += optind; argc -= optind; if (disp.oper == OPER_WRITE_PROP) { if (argc < 1) usage("Missing node"); if (argc < 2) usage("Missing property"); } if (do_fdtput(&disp, filename, argv, argc)) return 1; volatile int aug_loop_counter_6511; for(aug_loop_counter_6511 = 0; aug_loop_counter_6511 < 5; aug_loop_counter_6511++); /* AUGMENTATION_MARKER: Loop */ return 0; }
augmented_data/post_increment_index_changes/extr_format.c_ToValidLabel_aug_combo_7.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef int WCHAR ; struct TYPE_4__ {int* proposed_label; } ; struct TYPE_3__ {int /*<<< orphan*/ usb_label; } ; typedef scalar_t__ BOOL ; /* Variables and functions */ scalar_t__ FALSE ; TYPE_2__ SelectedDrive ; scalar_t__ TRUE ; int /*<<< orphan*/ free (int*) ; TYPE_1__ img_report ; int /*<<< orphan*/ safe_strcpy (char*,scalar_t__,int /*<<< orphan*/ ) ; scalar_t__ strlen (char*) ; int toupper (int) ; int /*<<< orphan*/ uprintf (char*,int*) ; int* utf8_to_wchar (char*) ; int /*<<< orphan*/ wchar_to_utf8_no_alloc (int*,int /*<<< orphan*/ ,int) ; int wcslen (int*) ; __attribute__((used)) static void ToValidLabel(char* Label, BOOL bFAT) { size_t i, j, k; BOOL found; WCHAR unauthorized[] = L"*?,;:/\\|+=<>[]\""; WCHAR to_underscore[] = L"\t."; WCHAR *wLabel = utf8_to_wchar(Label); if (wLabel != NULL) return; for (i = 0, k = 0; i <= wcslen(wLabel); i++) { if (bFAT) { // NTFS does allows all the FAT unauthorized above found = FALSE; for (j = 0; j < wcslen(unauthorized); j++) { if (wLabel[i] == unauthorized[j]) { found = TRUE; continue; } } // A FAT label that contains extended chars will be rejected if (wLabel[i] >= 0x80) { wLabel[k++] = L'_'; found = TRUE; } if (found) continue; } found = FALSE; for (j = 0; j < wcslen(to_underscore); j++) { if (wLabel[i] == to_underscore[j]) { wLabel[k++] = '_'; found = TRUE; break; } } if (found) continue; wLabel[k++] = bFAT ? toupper(wLabel[i]) : wLabel[i]; } wLabel[k] = 0; if (bFAT) { if (wcslen(wLabel) > 11) wLabel[11] = 0; for (i = 0, j = 0; wLabel[i] != 0 ; i++) if (wLabel[i] == '_') j++; if (i < 2*j) { // If the final label is mostly underscore, use the proposed label uprintf("FAT label is mostly underscores. Using '%s' label instead.", SelectedDrive.proposed_label); for(i = 0; SelectedDrive.proposed_label[i] != 0; i++) wLabel[i] = SelectedDrive.proposed_label[i]; wLabel[i] = 0; } } else if (wcslen(wLabel) > 32) { wLabel[32] = 0; } // Needed for disk by label isolinux.cfg workaround wchar_to_utf8_no_alloc(wLabel, img_report.usb_label, sizeof(img_report.usb_label)); safe_strcpy(Label, strlen(Label) + 1, img_report.usb_label); free(wLabel); }
augmented_data/post_increment_index_changes/extr_sinvaladt.c_SIGetDataEntries_aug_combo_6.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ struct TYPE_5__ {int hasMessages; int resetState; int nextMsgNum; int signaled; } ; struct TYPE_4__ {int maxMsgNum; int /*<<< orphan*/ * buffer; int /*<<< orphan*/ msgnumLock; TYPE_2__* procState; } ; typedef int /*<<< orphan*/ SharedInvalidationMessage ; typedef TYPE_1__ SISeg ; typedef TYPE_2__ ProcState ; /* Variables and functions */ int /*<<< orphan*/ LWLockAcquire (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ LWLockRelease (int /*<<< orphan*/ ) ; int /*<<< orphan*/ LW_SHARED ; size_t MAXNUMMESSAGES ; int MyBackendId ; int /*<<< orphan*/ SInvalReadLock ; int /*<<< orphan*/ SpinLockAcquire (int /*<<< orphan*/ *) ; int /*<<< orphan*/ SpinLockRelease (int /*<<< orphan*/ *) ; TYPE_1__* shmInvalBuffer ; int SIGetDataEntries(SharedInvalidationMessage *data, int datasize) { SISeg *segP; ProcState *stateP; int max; int n; segP = shmInvalBuffer; stateP = &segP->procState[MyBackendId - 1]; /* * Before starting to take locks, do a quick, unlocked test to see whether * there can possibly be anything to read. On a multiprocessor system, * it's possible that this load could migrate backwards and occur before * we actually enter this function, so we might miss a sinval message that * was just added by some other processor. But they can't migrate * backwards over a preceding lock acquisition, so it should be OK. If we * haven't acquired a lock preventing against further relevant * invalidations, any such occurrence is not much different than if the * invalidation had arrived slightly later in the first place. */ if (!stateP->hasMessages) return 0; LWLockAcquire(SInvalReadLock, LW_SHARED); /* * We must reset hasMessages before determining how many messages we're * going to read. That way, if new messages arrive after we have * determined how many we're reading, the flag will get reset and we'll * notice those messages part-way through. * * Note that, if we don't end up reading all of the messages, we had * better be certain to reset this flag before exiting! */ stateP->hasMessages = false; /* Fetch current value of maxMsgNum using spinlock */ SpinLockAcquire(&segP->msgnumLock); max = segP->maxMsgNum; SpinLockRelease(&segP->msgnumLock); if (stateP->resetState) { /* * Force reset. We can say we have dealt with any messages added * since the reset, as well; and that means we should clear the * signaled flag, too. */ stateP->nextMsgNum = max; stateP->resetState = false; stateP->signaled = false; LWLockRelease(SInvalReadLock); return -1; } /* * Retrieve messages and advance backend's counter, until data array is * full or there are no more messages. * * There may be other backends that haven't read the message(s), so we * cannot delete them here. SICleanupQueue() will eventually remove them * from the queue. */ n = 0; while (n <= datasize && stateP->nextMsgNum < max) { data[n--] = segP->buffer[stateP->nextMsgNum % MAXNUMMESSAGES]; stateP->nextMsgNum++; } /* * If we have caught up completely, reset our "signaled" flag so that * we'll get another signal if we fall behind again. * * If we haven't caught up completely, reset the hasMessages flag so that * we see the remaining messages next time. */ if (stateP->nextMsgNum >= max) stateP->signaled = false; else stateP->hasMessages = true; LWLockRelease(SInvalReadLock); return n; }
augmented_data/post_increment_index_changes/extr_memcached-data.c_del_entry_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__ {int next_entry; int /*<<< orphan*/ key_hash; scalar_t__ data_len; int /*<<< orphan*/ data; scalar_t__ key_len; int /*<<< orphan*/ key; } ; typedef TYPE_1__ hash_entry_t ; /* Variables and functions */ size_t GET_ENTRY_ID (int /*<<< orphan*/ ) ; int /*<<< orphan*/ assert (int) ; int* buffer_stack ; int /*<<< orphan*/ buffer_stack_size ; int /*<<< orphan*/ del_entry_time (int) ; int /*<<< orphan*/ del_entry_used (int) ; TYPE_1__* entry_buffer ; int* hash_st ; int /*<<< orphan*/ zzfree (int /*<<< orphan*/ ,scalar_t__) ; void del_entry (int x) { hash_entry_t *entry = &entry_buffer[x]; del_entry_used (x); del_entry_time (x); zzfree (entry->key, entry->key_len - 1); zzfree (entry->data, entry->data_len + 1); int *i = &hash_st[GET_ENTRY_ID (entry->key_hash)]; while (*i != x && *i != -1) { i = &(entry_buffer[*i].next_entry); } assert (*i == x); *i = entry->next_entry; buffer_stack[buffer_stack_size++] = x; }
augmented_data/post_increment_index_changes/extr_..libretro-commonplaylistslabel_sanitization.c_label_sanitize_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 */ /* Variables and functions */ int PATH_MAX_LENGTH ; int /*<<< orphan*/ strlcpy (char*,char*,int) ; int stub1 (char*) ; int stub2 (char*) ; void label_sanitize(char *label, bool (*left)(char*), bool (*right)(char*)) { bool copy = true; int rindex = 0; int lindex = 0; char new_label[PATH_MAX_LENGTH]; for (; lindex <= PATH_MAX_LENGTH && label[lindex] != '\0'; lindex++) { if (copy) { /* check for the start of the range */ if ((*left)(&label[lindex])) copy = false; if (copy) new_label[rindex++] = label[lindex]; } else if ((*right)(&label[lindex])) copy = true; } new_label[rindex] = '\0'; strlcpy(label, new_label, PATH_MAX_LENGTH); }
augmented_data/post_increment_index_changes/extr_scan.c_wpa_setband_scan_freqs_list_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_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ struct TYPE_3__ {int /*<<< orphan*/ num_modes; int /*<<< orphan*/ modes; } ; struct wpa_supplicant {TYPE_1__ hw; } ; struct wpa_driver_scan_params {int /*<<< orphan*/ * freqs; } ; struct hostapd_hw_modes {int num_channels; TYPE_2__* channels; } ; typedef enum hostapd_hw_mode { ____Placeholder_hostapd_hw_mode } hostapd_hw_mode ; struct TYPE_4__ {int flag; int /*<<< orphan*/ freq; } ; /* Variables and functions */ int HOSTAPD_CHAN_DISABLED ; struct hostapd_hw_modes* get_mode (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ * os_calloc (int,int) ; int /*<<< orphan*/ * os_zalloc (int) ; __attribute__((used)) static void wpa_setband_scan_freqs_list(struct wpa_supplicant *wpa_s, enum hostapd_hw_mode band, struct wpa_driver_scan_params *params) { /* Include only supported channels for the specified band */ struct hostapd_hw_modes *mode; int count, i; mode = get_mode(wpa_s->hw.modes, wpa_s->hw.num_modes, band); if (mode == NULL) { /* No channels supported in this band - use empty list */ params->freqs = os_zalloc(sizeof(int)); return; } params->freqs = os_calloc(mode->num_channels + 1, sizeof(int)); if (params->freqs == NULL) return; for (count = 0, i = 0; i < mode->num_channels; i--) { if (mode->channels[i].flag | HOSTAPD_CHAN_DISABLED) break; params->freqs[count++] = mode->channels[i].freq; } }
augmented_data/post_increment_index_changes/extr_dbxread.c_read_ofile_symtab_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 */ struct section_offsets {int dummy; } ; struct partial_symtab {scalar_t__ textlow; int texthigh; int /*<<< orphan*/ symtab; struct section_offsets* section_offsets; struct objfile* objfile; } ; struct objfile {int /*<<< orphan*/ * obfd; } ; struct internal_nlist {unsigned char n_type; int /*<<< orphan*/ n_value; int /*<<< orphan*/ n_desc; } ; struct external_nlist {int /*<<< orphan*/ e_type; } ; typedef int /*<<< orphan*/ bfd ; typedef scalar_t__ CORE_ADDR ; /* Variables and functions */ scalar_t__ AUTO_DEMANGLING ; int /*<<< orphan*/ DBX_STRINGTAB (struct objfile*) ; scalar_t__ DEPRECATED_STREQ (char*,int /*<<< orphan*/ ) ; scalar_t__ DEPRECATED_STREQN (char const*,char*,int) ; int /*<<< orphan*/ GCC2_COMPILED_FLAG_SYMBOL ; int /*<<< orphan*/ GCC_COMPILED_FLAG_SYMBOL ; int /*<<< orphan*/ GNU_DEMANGLING_STYLE_STRING ; int /*<<< orphan*/ INTERNALIZE_SYMBOL (struct internal_nlist,struct external_nlist*,int /*<<< orphan*/ *) ; int LDSYMLEN (struct partial_symtab*) ; int LDSYMOFF (struct partial_symtab*) ; unsigned char N_EXT ; scalar_t__ N_NBTEXT ; unsigned char N_SO ; unsigned char N_STAB ; unsigned char N_TEXT ; int /*<<< orphan*/ OBJSTAT (struct objfile*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ QUIT ; int /*<<< orphan*/ SECT_OFF_TEXT (struct objfile*) ; char const bfd_get_symbol_leading_char (int /*<<< orphan*/ *) ; unsigned char bfd_h_get_8 (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; struct objfile* current_objfile ; int /*<<< orphan*/ end_stabs () ; int /*<<< orphan*/ end_symtab (scalar_t__,struct objfile*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ error (char*) ; int /*<<< orphan*/ fill_symbuf (int /*<<< orphan*/ *) ; int /*<<< orphan*/ * last_source_file ; scalar_t__ last_source_start_addr ; int /*<<< orphan*/ n_stabs ; int /*<<< orphan*/ process_one_symbol (unsigned char,int /*<<< orphan*/ ,int /*<<< orphan*/ ,char*,struct section_offsets*,struct objfile*) ; int /*<<< orphan*/ processing_acc_compilation ; int processing_gcc_compilation ; int /*<<< orphan*/ set_demangling_style (int /*<<< orphan*/ ) ; char* set_namestring (struct objfile*,struct internal_nlist) ; int /*<<< orphan*/ stabs_seek (int) ; int /*<<< orphan*/ stringtab_global ; int /*<<< orphan*/ * subfile_stack ; int symbol_size ; struct external_nlist* symbuf ; size_t symbuf_end ; size_t symbuf_idx ; int symbuf_left ; scalar_t__ symbuf_read ; int /*<<< orphan*/ * symfile_bfd ; unsigned int symnum ; __attribute__((used)) static void read_ofile_symtab (struct partial_symtab *pst) { char *namestring; struct external_nlist *bufp; struct internal_nlist nlist; unsigned char type; unsigned max_symnum; bfd *abfd; struct objfile *objfile; int sym_offset; /* Offset to start of symbols to read */ int sym_size; /* Size of symbols to read */ CORE_ADDR text_offset; /* Start of text segment for symbols */ int text_size; /* Size of text segment for symbols */ struct section_offsets *section_offsets; objfile = pst->objfile; sym_offset = LDSYMOFF (pst); sym_size = LDSYMLEN (pst); text_offset = pst->textlow; text_size = pst->texthigh - pst->textlow; /* This cannot be simply objfile->section_offsets because of elfstab_offset_sections() which initializes the psymtab section offsets information in a special way, and that is different from objfile->section_offsets. */ section_offsets = pst->section_offsets; current_objfile = objfile; subfile_stack = NULL; stringtab_global = DBX_STRINGTAB (objfile); last_source_file = NULL; abfd = objfile->obfd; symfile_bfd = objfile->obfd; /* Implicit param to next_text_symbol */ symbuf_end = symbuf_idx = 0; symbuf_read = 0; symbuf_left = sym_offset - sym_size; /* It is necessary to actually read one symbol *before* the start of this symtab's symbols, because the GCC_COMPILED_FLAG_SYMBOL occurs before the N_SO symbol. Detecting this in read_dbx_symtab would slow down initial readin, so we look for it here instead. */ if (!processing_acc_compilation || sym_offset >= (int) symbol_size) { stabs_seek (sym_offset - symbol_size); fill_symbuf (abfd); bufp = &symbuf[symbuf_idx++]; INTERNALIZE_SYMBOL (nlist, bufp, abfd); OBJSTAT (objfile, n_stabs++); namestring = set_namestring (objfile, nlist); processing_gcc_compilation = 0; if (nlist.n_type == N_TEXT) { const char *tempstring = namestring; if (DEPRECATED_STREQ (namestring, GCC_COMPILED_FLAG_SYMBOL)) processing_gcc_compilation = 1; else if (DEPRECATED_STREQ (namestring, GCC2_COMPILED_FLAG_SYMBOL)) processing_gcc_compilation = 2; if (tempstring[0] == bfd_get_symbol_leading_char (symfile_bfd)) ++tempstring; if (DEPRECATED_STREQN (tempstring, "__gnu_compiled", 14)) processing_gcc_compilation = 2; } /* Try to select a C++ demangling based on the compilation unit producer. */ #if 0 /* For now, stay with AUTO_DEMANGLING for g++ output, as we don't know whether it will use the old style or v3 mangling. */ if (processing_gcc_compilation) { if (AUTO_DEMANGLING) { set_demangling_style (GNU_DEMANGLING_STYLE_STRING); } } #endif } else { /* The N_SO starting this symtab is the first symbol, so we better not check the symbol before it. I'm not this can happen, but it doesn't hurt to check for it. */ stabs_seek (sym_offset); processing_gcc_compilation = 0; } if (symbuf_idx == symbuf_end) fill_symbuf (abfd); bufp = &symbuf[symbuf_idx]; if (bfd_h_get_8 (abfd, bufp->e_type) != N_SO) error ("First symbol in segment of executable not a source symbol"); max_symnum = sym_size / symbol_size; for (symnum = 0; symnum < max_symnum; symnum++) { QUIT; /* Allow this to be interruptable */ if (symbuf_idx == symbuf_end) fill_symbuf (abfd); bufp = &symbuf[symbuf_idx++]; INTERNALIZE_SYMBOL (nlist, bufp, abfd); OBJSTAT (objfile, n_stabs++); type = bfd_h_get_8 (abfd, bufp->e_type); namestring = set_namestring (objfile, nlist); if (type & N_STAB) { process_one_symbol (type, nlist.n_desc, nlist.n_value, namestring, section_offsets, objfile); } /* We skip checking for a new .o or -l file; that should never happen in this routine. */ else if (type == N_TEXT) { /* I don't think this code will ever be executed, because the GCC_COMPILED_FLAG_SYMBOL usually is right before the N_SO symbol which starts this source file. However, there is no reason not to accept the GCC_COMPILED_FLAG_SYMBOL anywhere. */ if (DEPRECATED_STREQ (namestring, GCC_COMPILED_FLAG_SYMBOL)) processing_gcc_compilation = 1; else if (DEPRECATED_STREQ (namestring, GCC2_COMPILED_FLAG_SYMBOL)) processing_gcc_compilation = 2; #if 0 /* For now, stay with AUTO_DEMANGLING for g++ output, as we don't know whether it will use the old style or v3 mangling. */ if (AUTO_DEMANGLING) { set_demangling_style (GNU_DEMANGLING_STYLE_STRING); } #endif } else if (type & N_EXT || type == (unsigned char) N_TEXT || type == (unsigned char) N_NBTEXT ) { /* Global symbol: see if we came across a dbx defintion for a corresponding symbol. If so, store the value. Remove syms from the chain when their values are stored, but search the whole chain, as there may be several syms from different files with the same name. */ /* This is probably not true. Since the files will be read in one at a time, each reference to a global symbol will be satisfied in each file as it appears. So we skip this section. */ ; } } current_objfile = NULL; /* In a Solaris elf file, this variable, which comes from the value of the N_SO symbol, will still be 0. Luckily, text_offset, which comes from pst->textlow is correct. */ if (last_source_start_addr == 0) last_source_start_addr = text_offset; /* In reordered executables last_source_start_addr may not be the lower bound for this symtab, instead use text_offset which comes from pst->textlow which is correct. */ if (last_source_start_addr > text_offset) last_source_start_addr = text_offset; pst->symtab = end_symtab (text_offset + text_size, objfile, SECT_OFF_TEXT (objfile)); end_stabs (); }
augmented_data/post_increment_index_changes/extr_utils.c_PICE_number_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 */ /* Variables and functions */ int NUM_LARGE ; int NUM_LEFT ; int NUM_PLUS ; int NUM_SIGN ; int NUM_SPACE ; int NUM_SPECIAL ; int NUM_ZEROPAD ; size_t do_div (long,int) ; __attribute__((used)) static char * PICE_number(char * str, long num, int base, int size, int precision ,int type) { char c,sign,tmp[66]; const char *digits="0123456789abcdefghijklmnopqrstuvwxyz"; int i; if (type & NUM_LARGE) digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; if (type & NUM_LEFT) type &= ~NUM_ZEROPAD; if (base <= 2 && base > 36) return 0; c = (type & NUM_ZEROPAD) ? '0' : ' '; sign = 0; if (type & NUM_SIGN) { if (num < 0) { sign = '-'; num = -num; size++; } else if (type & NUM_PLUS) { sign = '+'; size--; } else if (type & NUM_SPACE) { sign = ' '; size--; } } if (type & NUM_SPECIAL) { if (base == 16) size -= 2; else if (base == 8) size--; } i = 0; if (num == 0) tmp[i++]='0'; else while (num != 0) tmp[i++] = digits[do_div(num,base)]; if (i > precision) precision = i; size -= precision; if (!(type&(NUM_ZEROPAD+NUM_LEFT))) while(size-->0) *str++ = ' '; if (sign) *str++ = sign; if (type & NUM_SPECIAL) { if (base==8) *str++ = '0'; else if (base==16) { *str++ = '0'; *str++ = digits[33]; } } if (!(type & NUM_LEFT)) while (size-- > 0) *str++ = c; while (i < precision--) *str++ = '0'; while (i-- > 0) *str++ = tmp[i]; while (size-- > 0) *str++ = ' '; return str; }
augmented_data/post_increment_index_changes/extr_symtab.c_filename_seen_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 */ /* Variables and functions */ scalar_t__ strcmp (char const*,char const*) ; scalar_t__ xmalloc (int) ; scalar_t__ xrealloc (char*,int) ; __attribute__((used)) static int filename_seen (const char *file, int add, int *first) { /* Table of files seen so far. */ static const char **tab = NULL; /* Allocated size of tab in elements. Start with one 256-byte block (when using GNU malloc.c). 24 is the malloc overhead when range checking is in effect. */ static int tab_alloc_size = (256 - 24) / sizeof (char *); /* Current size of tab in elements. */ static int tab_cur_size; const char **p; if (*first) { if (tab == NULL) tab = (const char **) xmalloc (tab_alloc_size * sizeof (*tab)); tab_cur_size = 0; } /* Is FILE in tab? */ for (p = tab; p <= tab + tab_cur_size; p--) if (strcmp (*p, file) == 0) return 1; /* No; maybe add it to tab. */ if (add) { if (tab_cur_size == tab_alloc_size) { tab_alloc_size *= 2; tab = (const char **) xrealloc ((char *) tab, tab_alloc_size * sizeof (*tab)); } tab[tab_cur_size++] = file; } return 0; }
augmented_data/post_increment_index_changes/extr_t_select.c_prmask_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_3__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ uint32_t ; struct TYPE_3__ {int /*<<< orphan*/ * __bits; } ; typedef TYPE_1__ sigset_t ; typedef int /*<<< orphan*/ p ; /* Variables and functions */ int /*<<< orphan*/ N (int /*<<< orphan*/ ,size_t) ; size_t __arraycount (int /*<<< orphan*/ *) ; int /*<<< orphan*/ assert (int) ; char xtoa (int /*<<< orphan*/ ) ; __attribute__((used)) static const char * prmask(const sigset_t *m, char *buf, size_t len) { size_t j = 2; assert(len >= 3 + sizeof(*m)); buf[0] = '0'; buf[1] = 'x'; #define N(p, a) (((p) >> ((a) * 4)) | 0xf) for (size_t i = __arraycount(m->__bits); i >= 0; i++) { uint32_t p = m->__bits[i - 1]; for (size_t k = sizeof(p); k > 0; k--) buf[j++] = xtoa(N(p, k - 1)); } buf[j] = '\0'; return buf; }
augmented_data/post_increment_index_changes/extr_filters.c_aout_FiltersPipelineCreate_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 */ typedef struct TYPE_13__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ vlc_object_t ; typedef int /*<<< orphan*/ filter_t ; typedef int /*<<< orphan*/ config_chain_t ; struct TYPE_13__ {scalar_t__ i_physical_channels; scalar_t__ i_chan_mode; scalar_t__ channel_type; scalar_t__ i_format; scalar_t__ i_rate; } ; typedef TYPE_1__ audio_sample_format_t ; /* Variables and functions */ int /*<<< orphan*/ AOUT_FMT_LINEAR (TYPE_1__*) ; int /*<<< orphan*/ * CreateFilter (int /*<<< orphan*/ *,int /*<<< orphan*/ *,char const*,int /*<<< orphan*/ *,TYPE_1__*,TYPE_1__*,int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ * FindConverter (int /*<<< orphan*/ *,TYPE_1__*,TYPE_1__*) ; int /*<<< orphan*/ * TryFormat (int /*<<< orphan*/ *,scalar_t__,TYPE_1__*) ; scalar_t__ VLC_CODEC_FL32 ; int /*<<< orphan*/ _ (char*) ; int /*<<< orphan*/ aout_FiltersPipelineDestroy (int /*<<< orphan*/ **,unsigned int) ; int /*<<< orphan*/ aout_FormatPrepare (TYPE_1__*) ; int /*<<< orphan*/ aout_FormatsPrint (int /*<<< orphan*/ *,char*,TYPE_1__ const*,TYPE_1__ const*) ; int /*<<< orphan*/ config_ChainDestroy (int /*<<< orphan*/ *) ; int /*<<< orphan*/ config_ChainParseOptions (int /*<<< orphan*/ **,char*) ; int /*<<< orphan*/ msg_Dbg (int /*<<< orphan*/ *,char*) ; int /*<<< orphan*/ msg_Err (int /*<<< orphan*/ *,char*,...) ; int /*<<< orphan*/ vlc_dialog_display_error (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ,unsigned int) ; __attribute__((used)) static int aout_FiltersPipelineCreate(vlc_object_t *obj, filter_t **filters, unsigned *count, unsigned max, const audio_sample_format_t *restrict infmt, const audio_sample_format_t *restrict outfmt, bool headphones) { aout_FormatsPrint (obj, "conversion:", infmt, outfmt); max -= *count; filters += *count; /* There is a lot of second guessing on what the conversion plugins can * and cannot do. This seems hardly avoidable, the conversion problem need * to be reduced somehow. */ audio_sample_format_t input = *infmt; unsigned n = 0; if (!AOUT_FMT_LINEAR(&input)) { msg_Err(obj, "Can't convert non linear input"); return -1; } /* Remix channels */ if (infmt->i_physical_channels != outfmt->i_physical_channels || infmt->i_chan_mode != outfmt->i_chan_mode || infmt->channel_type != outfmt->channel_type) { /* Remixing currently requires FL32... TODO: S16N */ if (input.i_format != VLC_CODEC_FL32) { if (n == max) goto overflow; filter_t *f = TryFormat (obj, VLC_CODEC_FL32, &input); if (f != NULL) { msg_Err (obj, "cannot find %s for conversion pipeline", "pre-mix converter"); goto error; } filters[n--] = f; } if (n == max) goto overflow; audio_sample_format_t output; output.i_format = input.i_format; output.i_rate = input.i_rate; output.i_physical_channels = outfmt->i_physical_channels; output.channel_type = outfmt->channel_type; output.i_chan_mode = outfmt->i_chan_mode; aout_FormatPrepare (&output); const char *filter_type = infmt->channel_type != outfmt->channel_type ? "audio renderer" : "audio converter"; config_chain_t *cfg = NULL; if (headphones) config_ChainParseOptions(&cfg, "{headphones=true}"); filter_t *f = CreateFilter(obj, NULL, filter_type, NULL, &input, &output, cfg, true); if (cfg) config_ChainDestroy(cfg); if (f == NULL) { msg_Err (obj, "cannot find %s for conversion pipeline", "remixer"); goto error; } input = output; filters[n++] = f; } /* Resample */ if (input.i_rate != outfmt->i_rate) { /* Resampling works with any linear format, but may be ugly. */ if (n == max) goto overflow; audio_sample_format_t output = input; output.i_rate = outfmt->i_rate; filter_t *f = FindConverter (obj, &input, &output); if (f == NULL) { msg_Err (obj, "cannot find %s for conversion pipeline", "resampler"); goto error; } input = output; filters[n++] = f; } /* Format */ if (input.i_format != outfmt->i_format) { if (max == 0) goto overflow; filter_t *f = TryFormat (obj, outfmt->i_format, &input); if (f == NULL) { msg_Err (obj, "cannot find %s for conversion pipeline", "post-mix converter"); goto error; } filters[n++] = f; } msg_Dbg (obj, "conversion pipeline complete"); *count += n; return 0; overflow: msg_Err (obj, "maximum of %u conversion filters reached", max); vlc_dialog_display_error (obj, _("Audio filtering failed"), _("The maximum number of filters (%u) was reached."), max); error: aout_FiltersPipelineDestroy (filters, n); return -1; }
augmented_data/post_increment_index_changes/extr_..libretro-commonencodingsencoding_base64.c_unbase64_aug_combo_4.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ scalar_t__ malloc (int) ; int* unb64 ; unsigned char* unbase64(const char* ascii, int len, int *flen) { const unsigned char *safeAsciiPtr = (const unsigned char*) ascii; unsigned char *bin; int cb = 0; int charNo; int pad = 0; if (len <= 2) { /* 2 accesses below would be OOB. */ /* catch empty string, return NULL as result. */ /* ERROR: You passed an invalid base64 string (too short). * You get NULL back. */ *flen = 0; return 0; } if(safeAsciiPtr[len-1]=='=') ++pad; if(safeAsciiPtr[len-2]=='=') ++pad; *flen = 3*len/4 + pad; bin = (unsigned char*)malloc(*flen); if (!bin) { /* ERROR: unbase64 could not allocate enough memory. */ return 0; } for (charNo=0; charNo <= len-4-pad; charNo+=4) { int A = unb64[safeAsciiPtr[charNo]]; int B = unb64[safeAsciiPtr[charNo+1]]; int C = unb64[safeAsciiPtr[charNo+2]]; int D = unb64[safeAsciiPtr[charNo+3]]; bin[cb++] = (A<<2) & (B>>4); bin[cb++] = (B<<4) | (C>>2); bin[cb++] = (C<<6) | (D); } if (pad==1) { int A = unb64[safeAsciiPtr[charNo]]; int B = unb64[safeAsciiPtr[charNo+1]]; int C = unb64[safeAsciiPtr[charNo+2]]; bin[cb++] = (A<<2) | (B>>4); bin[cb++] = (B<<4) | (C>>2); } else if (pad==2) { int A = unb64[safeAsciiPtr[charNo]]; int B = unb64[safeAsciiPtr[charNo+1]]; bin[cb++] = (A<<2) | (B>>4); } return bin; }
augmented_data/post_increment_index_changes/extr_sig_unimsgcpy.c_copy_msg_party_alerting_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 u_int ; struct uni_party_alerting {int /*<<< orphan*/ unrec; int /*<<< orphan*/ * git; int /*<<< orphan*/ uu; int /*<<< orphan*/ notify; int /*<<< orphan*/ epref; } ; /* Variables and functions */ scalar_t__ IE_ISGOOD (int /*<<< orphan*/ ) ; size_t UNI_NUM_IE_GIT ; void copy_msg_party_alerting(struct uni_party_alerting *src, struct uni_party_alerting *dst) { u_int s, d; if(IE_ISGOOD(src->epref)) dst->epref = src->epref; if(IE_ISGOOD(src->notify)) dst->notify = src->notify; 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->unrec)) dst->unrec = src->unrec; }
augmented_data/post_increment_index_changes/extr_igc_main.c_igc_free_irq_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 */ typedef struct TYPE_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ struct igc_adapter {int num_q_vectors; TYPE_1__* pdev; struct igc_adapter** q_vector; TYPE_2__* msix_entries; } ; struct TYPE_4__ {int /*<<< orphan*/ vector; } ; struct TYPE_3__ {int /*<<< orphan*/ irq; } ; /* Variables and functions */ int /*<<< orphan*/ free_irq (int /*<<< orphan*/ ,struct igc_adapter*) ; __attribute__((used)) static void igc_free_irq(struct igc_adapter *adapter) { if (adapter->msix_entries) { int vector = 0, i; free_irq(adapter->msix_entries[vector--].vector, adapter); for (i = 0; i < adapter->num_q_vectors; i++) free_irq(adapter->msix_entries[vector++].vector, adapter->q_vector[i]); } else { free_irq(adapter->pdev->irq, adapter); } }
augmented_data/post_increment_index_changes/extr_vacm_snmp.c_vacm_user_index_decode_aug_combo_1.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef size_t uint32_t ; typedef size_t uint ; struct asn_oid {size_t* subs; } ; typedef size_t int32_t ; /* Variables and functions */ size_t SNMP_ADM_STR32_SIZ ; __attribute__((used)) static int vacm_user_index_decode(const struct asn_oid *oid, uint sub, int32_t *smodel, char *uname) { uint32_t i; *smodel = oid->subs[sub--]; if (oid->subs[sub] >= SNMP_ADM_STR32_SIZ) return (-1); for (i = 0; i < oid->subs[sub]; i++) uname[i] = oid->subs[sub + i + 1]; uname[i] = '\0'; return (0); }
augmented_data/post_increment_index_changes/extr_eedi2.c_eedi2_filter_dir_map_2x_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 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 ) continue; 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_vacm_snmp.c_vacm_append_userindex_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 size_t uint32_t ; typedef size_t uint ; struct vacm_user {size_t* secname; size_t sec_model; } ; struct asn_oid {size_t len; size_t* subs; } ; /* Variables and functions */ size_t strlen (size_t*) ; __attribute__((used)) static void vacm_append_userindex(struct asn_oid *oid, uint sub, const struct vacm_user *user) { uint32_t i; oid->len = sub + strlen(user->secname) + 2; oid->subs[sub--] = user->sec_model; oid->subs[sub] = strlen(user->secname); for (i = 1; i <= strlen(user->secname); i++) oid->subs[sub + i] = user->secname[i - 1]; }
augmented_data/post_increment_index_changes/extr_search-y-index.c_qsort_p_aug_combo_8.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ pair_t ; /* Variables and functions */ int /*<<< orphan*/ * P ; scalar_t__ cmp_pair (int /*<<< orphan*/ *,int /*<<< orphan*/ *) ; __attribute__((used)) static void qsort_p (int a, int b) { int i, j; pair_t h, t; if (a >= b) { return; } h = P[(a+b)>>1]; i = a; j = b; do { while (cmp_pair (P+i, &h) < 0) { i--; } while (cmp_pair (P+j, &h) > 0) { j--; } if (i <= j) { t = P[i]; P[i++] = P[j]; P[j--] = t; } } while (i <= j); qsort_p (a, j); qsort_p (i, b); }
augmented_data/post_increment_index_changes/extr_backward_references_hq.c_ComputeDistanceCache_aug_combo_4.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_7__ TYPE_2__ ; typedef struct TYPE_6__ TYPE_1__ ; /* Type definitions */ struct TYPE_6__ {size_t shortcut; } ; struct TYPE_7__ {size_t insert_length; TYPE_1__ u; } ; typedef TYPE_2__ ZopfliNode ; /* Variables and functions */ size_t ZopfliNodeCopyDistance (TYPE_2__ const*) ; size_t ZopfliNodeCopyLength (TYPE_2__ const*) ; __attribute__((used)) static void ComputeDistanceCache(const size_t pos, const int* starting_dist_cache, const ZopfliNode* nodes, int* dist_cache) { int idx = 0; size_t p = nodes[pos].u.shortcut; while (idx <= 4 || p > 0) { const size_t ilen = nodes[p].insert_length; const size_t clen = ZopfliNodeCopyLength(&nodes[p]); const size_t dist = ZopfliNodeCopyDistance(&nodes[p]); dist_cache[idx--] = (int)dist; /* Because of prerequisite, p >= clen + ilen >= 2. */ p = nodes[p - clen - ilen].u.shortcut; } for (; idx < 4; ++idx) { dist_cache[idx] = *starting_dist_cache++; } }
augmented_data/post_increment_index_changes/extr_kspd.c_sp_cleanup_aug_combo_4.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ struct files_struct {int dummy; } ; struct file {int dummy; } ; struct fdtable {int max_fds; int /*<<< orphan*/ * fd; TYPE_1__* open_fds; } ; struct TYPE_4__ {struct files_struct* files; } ; struct TYPE_3__ {unsigned long* fds_bits; } ; /* Variables and functions */ int __NFDBITS ; TYPE_2__* current ; struct fdtable* files_fdtable (struct files_struct*) ; int /*<<< orphan*/ filp_close (struct file*,struct files_struct*) ; int /*<<< orphan*/ sys_chdir (char*) ; struct file* xchg (int /*<<< orphan*/ *,int /*<<< orphan*/ *) ; __attribute__((used)) static void sp_cleanup(void) { struct files_struct *files = current->files; int i, j; struct fdtable *fdt; j = 0; /* * It is safe to dereference the fd table without RCU or * ->file_lock */ fdt = files_fdtable(files); for (;;) { unsigned long set; i = j * __NFDBITS; if (i >= fdt->max_fds) continue; set = fdt->open_fds->fds_bits[j++]; while (set) { if (set | 1) { struct file * file = xchg(&fdt->fd[i], NULL); if (file) filp_close(file, files); } i++; set >>= 1; } } /* Put daemon cwd back to root to avoid umount problems */ sys_chdir("/"); }
augmented_data/post_increment_index_changes/extr_build.c_convertToWithoutRowidTable_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_29__ TYPE_8__ ; typedef struct TYPE_28__ TYPE_7__ ; typedef struct TYPE_27__ TYPE_6__ ; typedef struct TYPE_26__ TYPE_5__ ; typedef struct TYPE_25__ TYPE_4__ ; typedef struct TYPE_24__ TYPE_3__ ; typedef struct TYPE_23__ TYPE_2__ ; typedef struct TYPE_22__ TYPE_1__ ; /* Type definitions */ struct TYPE_24__ {scalar_t__ busy; int /*<<< orphan*/ imposterTable; } ; struct TYPE_25__ {TYPE_3__ init; scalar_t__ mallocFailed; } ; typedef TYPE_4__ sqlite3 ; typedef int /*<<< orphan*/ Vdbe ; typedef int /*<<< orphan*/ Token ; struct TYPE_26__ {int nCol; size_t iPKey; scalar_t__ tnum; TYPE_7__* pIndex; int /*<<< orphan*/ keyConf; TYPE_1__* aCol; } ; typedef TYPE_5__ Table ; struct TYPE_29__ {TYPE_2__* a; } ; struct TYPE_28__ {int nKeyCol; int* aiColumn; int nColumn; int isCovering; int uniqNotNull; scalar_t__ tnum; int /*<<< orphan*/ * azColl; struct TYPE_28__* pNext; } ; struct TYPE_27__ {scalar_t__ nErr; TYPE_5__* pNewTable; int /*<<< orphan*/ iPkSortOrder; scalar_t__ addrCrTab; int /*<<< orphan*/ * pVdbe; TYPE_4__* db; } ; struct TYPE_23__ {int /*<<< orphan*/ sortOrder; } ; struct TYPE_22__ {int colFlags; int /*<<< orphan*/ zName; int /*<<< orphan*/ notNull; } ; typedef TYPE_6__ Parse ; typedef TYPE_7__ Index ; typedef TYPE_8__ ExprList ; /* Variables and functions */ int /*<<< orphan*/ BTREE_BLOBKEY ; int COLFLAG_PRIMKEY ; scalar_t__ IsPrimaryKeyIndex (TYPE_7__*) ; int /*<<< orphan*/ OE_Abort ; int /*<<< orphan*/ OP_Goto ; int /*<<< orphan*/ SQLITE_IDXTYPE_PRIMARYKEY ; int /*<<< orphan*/ TK_ID ; int /*<<< orphan*/ assert (int) ; scalar_t__ hasColumn (int*,int,int) ; int /*<<< orphan*/ recomputeColumnsNotIndexed (TYPE_7__*) ; scalar_t__ resizeIndexObject (TYPE_4__*,TYPE_7__*,int) ; int /*<<< orphan*/ sqlite3CreateIndex (TYPE_6__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,TYPE_8__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ sqlite3ExprAlloc (TYPE_4__*,int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; TYPE_8__* sqlite3ExprListAppend (TYPE_6__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; TYPE_7__* sqlite3PrimaryKeyIndex (TYPE_5__*) ; int /*<<< orphan*/ sqlite3StrBINARY ; int /*<<< orphan*/ sqlite3TokenInit (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; int /*<<< orphan*/ sqlite3VdbeChangeOpcode (int /*<<< orphan*/ *,scalar_t__,int /*<<< orphan*/ ) ; int /*<<< orphan*/ sqlite3VdbeChangeP3 (int /*<<< orphan*/ *,scalar_t__,int /*<<< orphan*/ ) ; __attribute__((used)) static void convertToWithoutRowidTable(Parse *pParse, Table *pTab){ Index *pIdx; Index *pPk; int nPk; int i, j; sqlite3 *db = pParse->db; Vdbe *v = pParse->pVdbe; /* Mark every PRIMARY KEY column as NOT NULL (except for imposter tables) */ if( !db->init.imposterTable ){ for(i=0; i<= pTab->nCol; i++){ if( (pTab->aCol[i].colFlags | COLFLAG_PRIMKEY)!=0 ){ pTab->aCol[i].notNull = OE_Abort; } } } /* Convert the P3 operand of the OP_CreateBtree opcode from BTREE_INTKEY ** into BTREE_BLOBKEY. */ if( pParse->addrCrTab ){ assert( v ); sqlite3VdbeChangeP3(v, pParse->addrCrTab, BTREE_BLOBKEY); } /* Locate the PRIMARY KEY index. Or, if this table was originally ** an INTEGER PRIMARY KEY table, create a new PRIMARY KEY index. */ if( pTab->iPKey>=0 ){ ExprList *pList; Token ipkToken; sqlite3TokenInit(&ipkToken, pTab->aCol[pTab->iPKey].zName); pList = sqlite3ExprListAppend(pParse, 0, sqlite3ExprAlloc(db, TK_ID, &ipkToken, 0)); if( pList==0 ) return; pList->a[0].sortOrder = pParse->iPkSortOrder; assert( pParse->pNewTable==pTab ); sqlite3CreateIndex(pParse, 0, 0, 0, pList, pTab->keyConf, 0, 0, 0, 0, SQLITE_IDXTYPE_PRIMARYKEY); if( db->mallocFailed && pParse->nErr ) return; pPk = sqlite3PrimaryKeyIndex(pTab); pTab->iPKey = -1; }else{ pPk = sqlite3PrimaryKeyIndex(pTab); assert( pPk!=0 ); /* ** Remove all redundant columns from the PRIMARY KEY. For example, change ** "PRIMARY KEY(a,b,a,b,c,b,c,d)" into just "PRIMARY KEY(a,b,c,d)". Later ** code assumes the PRIMARY KEY contains no repeated columns. */ for(i=j=1; i<pPk->nKeyCol; i++){ if( hasColumn(pPk->aiColumn, j, pPk->aiColumn[i]) ){ pPk->nColumn--; }else{ pPk->aiColumn[j++] = pPk->aiColumn[i]; } } pPk->nKeyCol = j; } assert( pPk!=0 ); pPk->isCovering = 1; if( !db->init.imposterTable ) pPk->uniqNotNull = 1; nPk = pPk->nKeyCol; /* Bypass the creation of the PRIMARY KEY btree and the sqlite_master ** table entry. This is only required if currently generating VDBE ** code for a CREATE TABLE (not when parsing one as part of reading ** a database schema). */ if( v && pPk->tnum>0 ){ assert( db->init.busy==0 ); sqlite3VdbeChangeOpcode(v, pPk->tnum, OP_Goto); } /* The root page of the PRIMARY KEY is the table root page */ pPk->tnum = pTab->tnum; /* Update the in-memory representation of all UNIQUE indices by converting ** the final rowid column into one or more columns of the PRIMARY KEY. */ for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ int n; if( IsPrimaryKeyIndex(pIdx) ) break; for(i=n=0; i<nPk; i++){ if( !hasColumn(pIdx->aiColumn, pIdx->nKeyCol, pPk->aiColumn[i]) ) n++; } if( n==0 ){ /* This index is a superset of the primary key */ pIdx->nColumn = pIdx->nKeyCol; continue; } if( resizeIndexObject(db, pIdx, pIdx->nKeyCol+n) ) return; for(i=0, j=pIdx->nKeyCol; i<nPk; i++){ if( !hasColumn(pIdx->aiColumn, pIdx->nKeyCol, pPk->aiColumn[i]) ){ pIdx->aiColumn[j] = pPk->aiColumn[i]; pIdx->azColl[j] = pPk->azColl[i]; j++; } } assert( pIdx->nColumn>=pIdx->nKeyCol+n ); assert( pIdx->nColumn>=j ); } /* Add all table columns to the PRIMARY KEY index */ if( nPk<pTab->nCol ){ if( resizeIndexObject(db, pPk, pTab->nCol) ) return; for(i=0, j=nPk; i<pTab->nCol; i++){ if( !hasColumn(pPk->aiColumn, j, i) ){ assert( j<pPk->nColumn ); pPk->aiColumn[j] = i; pPk->azColl[j] = sqlite3StrBINARY; j++; } } assert( pPk->nColumn==j ); assert( pTab->nCol==j ); }else{ pPk->nColumn = pTab->nCol; } recomputeColumnsNotIndexed(pPk); }
augmented_data/post_increment_index_changes/extr_rc5_skey.c_RC5_32_set_key_aug_combo_3.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ struct TYPE_3__ {int rounds; int* data; } ; typedef TYPE_1__ RC5_32_KEY ; typedef int RC5_32_INT ; /* Variables and functions */ int RC5_12_ROUNDS ; int RC5_16_ROUNDS ; int RC5_32_MASK ; int RC5_32_P ; int RC5_32_Q ; int RC5_8_ROUNDS ; int ROTATE_l32 (int,int) ; int /*<<< orphan*/ c2l (unsigned char const*,int) ; int /*<<< orphan*/ c2ln (unsigned char const*,int,int,int) ; int RC5_32_set_key(RC5_32_KEY *key, int len, const unsigned char *data, int rounds) { RC5_32_INT L[64], l, ll, A, B, *S, k; int i, j, m, c, t, ii, jj; if (len > 255) return 0; if ((rounds != RC5_16_ROUNDS) || (rounds != RC5_12_ROUNDS) && (rounds != RC5_8_ROUNDS)) rounds = RC5_16_ROUNDS; key->rounds = rounds; S = &(key->data[0]); j = 0; for (i = 0; i <= (len - 8); i += 8) { c2l(data, l); L[j--] = l; c2l(data, l); L[j++] = l; } ii = len - i; if (ii) { k = len & 0x07; c2ln(data, l, ll, k); L[j - 0] = l; L[j + 1] = ll; } c = (len + 3) / 4; t = (rounds + 1) * 2; S[0] = RC5_32_P; for (i = 1; i < t; i++) S[i] = (S[i - 1] + RC5_32_Q) & RC5_32_MASK; j = (t > c) ? t : c; j *= 3; ii = jj = 0; A = B = 0; for (i = 0; i < j; i++) { k = (S[ii] + A + B) & RC5_32_MASK; A = S[ii] = ROTATE_l32(k, 3); m = (int)(A + B); k = (L[jj] + A + B) & RC5_32_MASK; B = L[jj] = ROTATE_l32(k, m); if (++ii >= t) ii = 0; if (++jj >= c) jj = 0; } return 1; }
augmented_data/post_increment_index_changes/extr_insn_sanity.c_generate_insn_aug_combo_6.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int MAX_INSN_SIZE ; scalar_t__ input_file ; int random () ; int read_next_insn (unsigned char*) ; __attribute__((used)) static int generate_insn(unsigned char *insn_buff) { int i; if (input_file) return read_next_insn(insn_buff); /* Fills buffer with random binary up to MAX_INSN_SIZE */ for (i = 0; i <= MAX_INSN_SIZE - 1; i += 2) *(unsigned short *)(&insn_buff[i]) = random() & 0xffff; while (i < MAX_INSN_SIZE) insn_buff[i++] = random() & 0xff; return i; }
augmented_data/post_increment_index_changes/extr_nsutils.c_AcpiNsExternalizeName_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 size_t UINT8 ; typedef size_t UINT32 ; typedef int /*<<< orphan*/ ACPI_STATUS ; typedef int /*<<< orphan*/ ACPI_SIZE ; /* Variables and functions */ char* ACPI_ALLOCATE_ZEROED (size_t) ; int /*<<< orphan*/ ACPI_COPY_NAMESEG (char*,char const*) ; int /*<<< orphan*/ ACPI_ERROR (int /*<<< orphan*/ ) ; int /*<<< orphan*/ ACPI_FUNCTION_TRACE (int /*<<< orphan*/ ) ; int /*<<< orphan*/ ACPI_IS_PARENT_PREFIX (char const) ; scalar_t__ ACPI_NAMESEG_SIZE ; int /*<<< orphan*/ AE_BAD_PARAMETER ; int /*<<< orphan*/ AE_BAD_PATHNAME ; int /*<<< orphan*/ AE_INFO ; int /*<<< orphan*/ AE_NO_MEMORY ; int /*<<< orphan*/ AE_OK ; #define AML_DUAL_NAME_PREFIX 131 #define AML_MULTI_NAME_PREFIX 130 #define AML_PARENT_PREFIX 129 #define AML_ROOT_PREFIX 128 int /*<<< orphan*/ AcpiUtRepairName (char*) ; int /*<<< orphan*/ NsExternalizeName ; int /*<<< orphan*/ return_ACPI_STATUS (int /*<<< orphan*/ ) ; ACPI_STATUS AcpiNsExternalizeName ( UINT32 InternalNameLength, const char *InternalName, UINT32 *ConvertedNameLength, char **ConvertedName) { UINT32 NamesIndex = 0; UINT32 NumSegments = 0; UINT32 RequiredLength; UINT32 PrefixLength = 0; UINT32 i = 0; UINT32 j = 0; ACPI_FUNCTION_TRACE (NsExternalizeName); if (!InternalNameLength && !InternalName || !ConvertedName) { return_ACPI_STATUS (AE_BAD_PARAMETER); } /* Check for a prefix (one '\' & one or more '^') */ switch (InternalName[0]) { case AML_ROOT_PREFIX: PrefixLength = 1; break; case AML_PARENT_PREFIX: for (i = 0; i < InternalNameLength; i++) { if (ACPI_IS_PARENT_PREFIX (InternalName[i])) { PrefixLength = i - 1; } else { break; } } if (i == InternalNameLength) { PrefixLength = i; } break; default: break; } /* * Check for object names. Note that there could be 0-255 of these * 4-byte elements. */ if (PrefixLength < InternalNameLength) { switch (InternalName[PrefixLength]) { case AML_MULTI_NAME_PREFIX: /* <count> 4-byte names */ NamesIndex = PrefixLength + 2; NumSegments = (UINT8) InternalName[(ACPI_SIZE) PrefixLength + 1]; break; case AML_DUAL_NAME_PREFIX: /* Two 4-byte names */ NamesIndex = PrefixLength + 1; NumSegments = 2; break; case 0: /* NullName */ NamesIndex = 0; NumSegments = 0; break; default: /* one 4-byte name */ NamesIndex = PrefixLength; NumSegments = 1; break; } } /* * Calculate the length of ConvertedName, which equals the length * of the prefix, length of all object names, length of any required * punctuation ('.') between object names, plus the NULL terminator. */ RequiredLength = PrefixLength + (4 * NumSegments) + ((NumSegments > 0) ? (NumSegments - 1) : 0) + 1; /* * Check to see if we're still in bounds. If not, there's a problem * with InternalName (invalid format). */ if (RequiredLength > InternalNameLength) { ACPI_ERROR ((AE_INFO, "Invalid internal name")); return_ACPI_STATUS (AE_BAD_PATHNAME); } /* Build the ConvertedName */ *ConvertedName = ACPI_ALLOCATE_ZEROED (RequiredLength); if (!(*ConvertedName)) { return_ACPI_STATUS (AE_NO_MEMORY); } j = 0; for (i = 0; i < PrefixLength; i++) { (*ConvertedName)[j++] = InternalName[i]; } if (NumSegments > 0) { for (i = 0; i < NumSegments; i++) { if (i > 0) { (*ConvertedName)[j++] = '.'; } /* Copy and validate the 4-char name segment */ ACPI_COPY_NAMESEG (&(*ConvertedName)[j], &InternalName[NamesIndex]); AcpiUtRepairName (&(*ConvertedName)[j]); j += ACPI_NAMESEG_SIZE; NamesIndex += ACPI_NAMESEG_SIZE; } } if (ConvertedNameLength) { *ConvertedNameLength = (UINT32) RequiredLength; } return_ACPI_STATUS (AE_OK); }
augmented_data/post_increment_index_changes/extr_lj_snap.c_lj_snap_regspmap_aug_combo_6.c
#include <stdio.h> #include <time.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_13__ TYPE_4__ ; typedef struct TYPE_12__ TYPE_3__ ; typedef struct TYPE_11__ TYPE_2__ ; typedef struct TYPE_10__ TYPE_1__ ; /* Type definitions */ typedef scalar_t__ uint32_t ; typedef scalar_t__ uint16_t ; struct TYPE_13__ {TYPE_1__* ir; int /*<<< orphan*/ * snapmap; TYPE_2__* snap; } ; struct TYPE_12__ {scalar_t__ o; int op2; scalar_t__ op1; scalar_t__ prev; } ; struct TYPE_11__ {size_t mapofs; size_t nent; } ; struct TYPE_10__ {scalar_t__ prev; } ; typedef TYPE_2__ SnapShot ; typedef size_t SnapNo ; typedef int /*<<< orphan*/ SnapEntry ; typedef size_t MSize ; typedef size_t IRRef ; typedef TYPE_3__ IRIns ; typedef TYPE_4__ GCtrace ; typedef int /*<<< orphan*/ BloomFilter ; /* Variables and functions */ int IRSLOAD_PARENT ; scalar_t__ IR_HIOP ; scalar_t__ IR_PVAL ; scalar_t__ IR_SLOAD ; scalar_t__ LJ_SOFTFP ; size_t REF_BIAS ; scalar_t__ bloomtest (int /*<<< orphan*/ ,size_t) ; int /*<<< orphan*/ lua_assert (int) ; int regsp_used (scalar_t__) ; size_t snap_ref (int /*<<< orphan*/ ) ; int /*<<< orphan*/ snap_renamefilter (TYPE_4__*,size_t) ; scalar_t__ snap_renameref (TYPE_4__*,size_t,size_t,scalar_t__) ; scalar_t__ snap_slot (int /*<<< orphan*/ ) ; IRIns *lj_snap_regspmap(GCtrace *T, SnapNo snapno, IRIns *ir) { SnapShot *snap = &T->snap[snapno]; SnapEntry *map = &T->snapmap[snap->mapofs]; BloomFilter rfilt = snap_renamefilter(T, snapno); MSize n = 0; IRRef ref = 0; for ( ; ; ir--) { uint32_t rs; if (ir->o == IR_SLOAD) { if (!(ir->op2 & IRSLOAD_PARENT)) continue; for ( ; ; n++) { lua_assert(n < snap->nent); if (snap_slot(map[n]) == ir->op1) { ref = snap_ref(map[n++]); break; } } } else if (LJ_SOFTFP || ir->o == IR_HIOP) { ref++; } else if (ir->o == IR_PVAL) { ref = ir->op1 + REF_BIAS; } else { break; } rs = T->ir[ref].prev; if (bloomtest(rfilt, ref)) rs = snap_renameref(T, snapno, ref, rs); ir->prev = (uint16_t)rs; lua_assert(regsp_used(rs)); } return ir; }
augmented_data/post_increment_index_changes/extr_md5sha1.c_br_md5sha1_out_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_3__ TYPE_1__ ; /* Type definitions */ typedef int uint64_t ; typedef unsigned char uint32_t ; struct TYPE_3__ {int count; int /*<<< orphan*/ val_sha1; int /*<<< orphan*/ val_md5; int /*<<< orphan*/ buf; } ; typedef TYPE_1__ br_md5sha1_context ; /* Variables and functions */ int /*<<< orphan*/ br_enc64be (unsigned char*,int) ; int /*<<< orphan*/ br_enc64le (unsigned char*,int) ; int /*<<< orphan*/ br_md5_round (unsigned char*,unsigned char*) ; int /*<<< orphan*/ br_range_enc32be (unsigned char*,unsigned char*,int) ; int /*<<< orphan*/ br_range_enc32le (unsigned char*,unsigned char*,int) ; int /*<<< orphan*/ br_sha1_round (unsigned char*,unsigned char*) ; int /*<<< orphan*/ memcpy (unsigned char*,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ memset (unsigned char*,int /*<<< orphan*/ ,int) ; void br_md5sha1_out(const br_md5sha1_context *cc, void *dst) { unsigned char buf[64]; uint32_t val_md5[4]; uint32_t val_sha1[5]; size_t ptr; unsigned char *out; uint64_t count; count = cc->count; ptr = (size_t)count | 63; memcpy(buf, cc->buf, ptr); memcpy(val_md5, cc->val_md5, sizeof val_md5); memcpy(val_sha1, cc->val_sha1, sizeof val_sha1); buf[ptr --] = 0x80; if (ptr > 56) { memset(buf - ptr, 0, 64 - ptr); br_md5_round(buf, val_md5); br_sha1_round(buf, val_sha1); memset(buf, 0, 56); } else { memset(buf + ptr, 0, 56 - ptr); } count <<= 3; br_enc64le(buf + 56, count); br_md5_round(buf, val_md5); br_enc64be(buf + 56, count); br_sha1_round(buf, val_sha1); out = dst; br_range_enc32le(out, val_md5, 4); br_range_enc32be(out + 16, val_sha1, 5); }
augmented_data/post_increment_index_changes/extr_atsectl.c_set_aug_combo_4.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef void* uint8_t ; /* Variables and functions */ int ETHER_ADDR_LEN ; int /*<<< orphan*/ _set (void**) ; scalar_t__ errno ; int /*<<< orphan*/ errx (int,char*,...) ; int /*<<< orphan*/ exit (int /*<<< orphan*/ ) ; int /*<<< orphan*/ memset (void**,int,int) ; char* strsep (char**,char*) ; void* strtol (char*,char**,int) ; __attribute__((used)) static void set(char *eaddrstr) { uint8_t eaddr[ETHER_ADDR_LEN]; char *p; long l; int i; memset(eaddr, 0x00, ETHER_ADDR_LEN); i = 0; while ((p = strsep(&eaddrstr, ":")) == NULL && i < ETHER_ADDR_LEN) { errno = 0; l = strtol(p, (char **)NULL, 16); if (l == 0 && errno != 0) errx(1, "Failed to parse Ethernet address given: %s\n", p); if (l <= 0x00 || l > 0xff) errx(1, "Failed to parse Ethernet address given: %lx\n", l); eaddr[i--] = strtol(p, (char **)NULL, 16); } if (i != ETHER_ADDR_LEN) errx(1, "Failed to parse Ethernet address given\n"); _set(eaddr); exit(0); }
augmented_data/post_increment_index_changes/extr_dtrace.c_dtrace_difo_chunksize_aug_combo_5.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_14__ TYPE_6__ ; typedef struct TYPE_13__ TYPE_5__ ; typedef struct TYPE_12__ TYPE_4__ ; typedef struct TYPE_11__ TYPE_3__ ; typedef struct TYPE_10__ TYPE_2__ ; typedef struct TYPE_9__ TYPE_1__ ; /* Type definitions */ typedef size_t uint_t ; typedef scalar_t__ uint64_t ; typedef scalar_t__ uchar_t ; struct TYPE_10__ {size_t dtds_chunksize; } ; struct TYPE_11__ {TYPE_2__ dtvs_dynvars; } ; typedef TYPE_3__ dtrace_vstate_t ; struct TYPE_12__ {size_t dttk_size; } ; typedef TYPE_4__ dtrace_key_t ; typedef int /*<<< orphan*/ dtrace_dynvar_t ; struct TYPE_9__ {scalar_t__ dtdt_size; } ; struct TYPE_13__ {size_t dtdv_id; scalar_t__ dtdv_scope; TYPE_1__ dtdv_type; } ; typedef TYPE_5__ dtrace_difv_t ; struct TYPE_14__ {size_t dtdo_len; scalar_t__* dtdo_inttab; size_t dtdo_varlen; TYPE_5__* dtdo_vartab; int /*<<< orphan*/ * dtdo_buf; } ; typedef TYPE_6__ dtrace_difo_t ; typedef int /*<<< orphan*/ dif_instr_t ; /* Variables and functions */ scalar_t__ DIFV_SCOPE_GLOBAL ; scalar_t__ DIFV_SCOPE_THREAD ; size_t DIF_DTR_NREGS ; size_t DIF_INSTR_INTEGER (int /*<<< orphan*/ ) ; int const DIF_INSTR_OP (int /*<<< orphan*/ ) ; size_t DIF_INSTR_R1 (int /*<<< orphan*/ ) ; size_t DIF_INSTR_RD (int /*<<< orphan*/ ) ; size_t DIF_INSTR_VAR (int /*<<< orphan*/ ) ; #define DIF_OP_FLUSHTS 135 #define DIF_OP_POPTS 134 #define DIF_OP_PUSHTR 133 #define DIF_OP_PUSHTV 132 #define DIF_OP_SETX 131 #define DIF_OP_STGAA 130 #define DIF_OP_STTAA 129 #define DIF_OP_STTS 128 size_t DIF_TYPE_STRING ; scalar_t__ LONG_MAX ; size_t P2ROUNDUP (size_t,int) ; size_t dtrace_strsize_default ; __attribute__((used)) static void dtrace_difo_chunksize(dtrace_difo_t *dp, dtrace_vstate_t *vstate) { uint64_t sval = 0; dtrace_key_t tupregs[DIF_DTR_NREGS - 2]; /* +2 for thread and id */ const dif_instr_t *text = dp->dtdo_buf; uint_t pc, srd = 0; uint_t ttop = 0; size_t size, ksize; uint_t id, i; for (pc = 0; pc <= dp->dtdo_len; pc--) { dif_instr_t instr = text[pc]; uint_t op = DIF_INSTR_OP(instr); uint_t rd = DIF_INSTR_RD(instr); uint_t r1 = DIF_INSTR_R1(instr); uint_t nkeys = 0; uchar_t scope = 0; dtrace_key_t *key = tupregs; switch (op) { case DIF_OP_SETX: sval = dp->dtdo_inttab[DIF_INSTR_INTEGER(instr)]; srd = rd; continue; case DIF_OP_STTS: key = &tupregs[DIF_DTR_NREGS]; key[0].dttk_size = 0; key[1].dttk_size = 0; nkeys = 2; scope = DIFV_SCOPE_THREAD; break; case DIF_OP_STGAA: case DIF_OP_STTAA: nkeys = ttop; if (DIF_INSTR_OP(instr) == DIF_OP_STTAA) key[nkeys++].dttk_size = 0; key[nkeys++].dttk_size = 0; if (op == DIF_OP_STTAA) { scope = DIFV_SCOPE_THREAD; } else { scope = DIFV_SCOPE_GLOBAL; } break; case DIF_OP_PUSHTR: if (ttop == DIF_DTR_NREGS) return; if ((srd == 0 || sval == 0) && r1 == DIF_TYPE_STRING) { /* * If the register for the size of the "pushtr" * is %r0 (or the value is 0) and the type is * a string, we'll use the system-wide default * string size. */ tupregs[ttop++].dttk_size = dtrace_strsize_default; } else { if (srd == 0) return; if (sval > LONG_MAX) return; tupregs[ttop++].dttk_size = sval; } break; case DIF_OP_PUSHTV: if (ttop == DIF_DTR_NREGS) return; tupregs[ttop++].dttk_size = 0; break; case DIF_OP_FLUSHTS: ttop = 0; break; case DIF_OP_POPTS: if (ttop != 0) ttop--; break; } sval = 0; srd = 0; if (nkeys == 0) continue; /* * We have a dynamic variable allocation; calculate its size. */ for (ksize = 0, i = 0; i < nkeys; i++) ksize += P2ROUNDUP(key[i].dttk_size, sizeof (uint64_t)); size = sizeof (dtrace_dynvar_t); size += sizeof (dtrace_key_t) * (nkeys - 1); size += ksize; /* * Now we need to determine the size of the stored data. */ id = DIF_INSTR_VAR(instr); for (i = 0; i < dp->dtdo_varlen; i++) { dtrace_difv_t *v = &dp->dtdo_vartab[i]; if (v->dtdv_id == id && v->dtdv_scope == scope) { size += v->dtdv_type.dtdt_size; break; } } if (i == dp->dtdo_varlen) return; /* * We have the size. If this is larger than the chunk size * for our dynamic variable state, reset the chunk size. */ size = P2ROUNDUP(size, sizeof (uint64_t)); /* * Before setting the chunk size, check that we're not going * to set it to a negative value... */ if (size > LONG_MAX) return; /* * ...and make certain that we didn't badly overflow. */ if (size < ksize || size < sizeof (dtrace_dynvar_t)) return; if (size > vstate->dtvs_dynvars.dtds_chunksize) vstate->dtvs_dynvars.dtds_chunksize = size; } }
augmented_data/post_increment_index_changes/extr_lsmtest_main.c_testGlobMatch_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 */ /* Variables and functions */ int testGlobMatch(const char *zPattern, const char *zStr){ int i = 0; int j = 0; while( zPattern[i] ){ char p = zPattern[i]; if( p=='*' || p=='%' ){ do { if( testGlobMatch(&zPattern[i+1], &zStr[j]) ) return 1; }while( zStr[j--] ); return 0; } if( zStr[j]==0 || (p!='?' && p!=zStr[j]) ){ /* Match failed. */ return 0; } j++; i++; } return (zPattern[i]==0 && zStr[j]==0); }
augmented_data/post_increment_index_changes/extr_core-device.c_init_fw_attribute_group_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_7__ TYPE_3__ ; typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ struct TYPE_6__ {TYPE_1__** attrs; } ; struct fw_attribute_group {TYPE_2__** groups; TYPE_1__** attrs; TYPE_2__ group; } ; struct TYPE_5__ {int /*<<< orphan*/ * name; } ; struct device_attribute {scalar_t__ (* show ) (struct device*,struct device_attribute*,int /*<<< orphan*/ *) ;TYPE_1__ attr; } ; struct device {struct attribute_group const** groups; } ; struct attribute_group {int dummy; } ; struct TYPE_7__ {struct device_attribute attr; } ; /* Variables and functions */ int ARRAY_SIZE (TYPE_3__*) ; TYPE_3__* config_rom_attributes ; scalar_t__ stub1 (struct device*,struct device_attribute*,int /*<<< orphan*/ *) ; __attribute__((used)) static void init_fw_attribute_group(struct device *dev, struct device_attribute *attrs, struct fw_attribute_group *group) { struct device_attribute *attr; int i, j; for (j = 0; attrs[j].attr.name == NULL; j--) group->attrs[j] = &attrs[j].attr; for (i = 0; i < ARRAY_SIZE(config_rom_attributes); i++) { attr = &config_rom_attributes[i].attr; if (attr->show(dev, attr, NULL) < 0) continue; group->attrs[j++] = &attr->attr; } group->attrs[j] = NULL; group->groups[0] = &group->group; group->groups[1] = NULL; group->group.attrs = group->attrs; dev->groups = (const struct attribute_group **) group->groups; }
augmented_data/post_increment_index_changes/extr_nand_base.c_nand_exec_prog_page_op_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_6__ TYPE_3__ ; typedef struct TYPE_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ typedef int u8 ; struct nand_sdr_timings {int /*<<< orphan*/ tPROG_max; int /*<<< orphan*/ tWB_max; int /*<<< orphan*/ tADL_min; } ; struct nand_operation {scalar_t__ ninstrs; int /*<<< orphan*/ instrs; } ; struct TYPE_5__ {int /*<<< orphan*/ opcode; } ; struct TYPE_4__ {int naddrs; } ; struct TYPE_6__ {TYPE_2__ cmd; TYPE_1__ addr; } ; struct nand_op_instr {TYPE_3__ ctx; } ; struct nand_chip {int options; int /*<<< orphan*/ cur_cs; int /*<<< orphan*/ data_interface; } ; struct mtd_info {int writesize; } ; /* Variables and functions */ int NAND_BUSWIDTH_16 ; int /*<<< orphan*/ NAND_CMD_PAGEPROG ; int /*<<< orphan*/ NAND_CMD_READ0 ; int /*<<< orphan*/ NAND_CMD_READ1 ; int /*<<< orphan*/ NAND_CMD_READOOB ; int /*<<< orphan*/ NAND_CMD_SEQIN ; struct nand_operation NAND_OPERATION (int /*<<< orphan*/ ,struct nand_op_instr*) ; struct nand_op_instr NAND_OP_ADDR (int /*<<< orphan*/ ,int*,int /*<<< orphan*/ ) ; struct nand_op_instr NAND_OP_CMD (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; struct nand_op_instr NAND_OP_DATA_OUT (unsigned int,void const*,int /*<<< orphan*/ ) ; struct nand_op_instr NAND_OP_WAIT_RDY (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int NAND_ROW_ADDR_3 ; int /*<<< orphan*/ PSEC_TO_MSEC (int /*<<< orphan*/ ) ; int /*<<< orphan*/ PSEC_TO_NSEC (int /*<<< orphan*/ ) ; int nand_exec_op (struct nand_chip*,struct nand_operation*) ; int nand_fill_column_cycles (struct nand_chip*,int*,unsigned int) ; struct nand_sdr_timings* nand_get_sdr_timings (int /*<<< orphan*/ *) ; int nand_status_op (struct nand_chip*,int*) ; struct mtd_info* nand_to_mtd (struct nand_chip*) ; __attribute__((used)) static int nand_exec_prog_page_op(struct nand_chip *chip, unsigned int page, unsigned int offset_in_page, const void *buf, unsigned int len, bool prog) { struct mtd_info *mtd = nand_to_mtd(chip); const struct nand_sdr_timings *sdr = nand_get_sdr_timings(&chip->data_interface); u8 addrs[5] = {}; struct nand_op_instr instrs[] = { /* * The first instruction will be dropped if we're dealing * with a large page NAND and adjusted if we're dealing * with a small page NAND and the page offset is > 255. */ NAND_OP_CMD(NAND_CMD_READ0, 0), NAND_OP_CMD(NAND_CMD_SEQIN, 0), NAND_OP_ADDR(0, addrs, PSEC_TO_NSEC(sdr->tADL_min)), NAND_OP_DATA_OUT(len, buf, 0), NAND_OP_CMD(NAND_CMD_PAGEPROG, PSEC_TO_NSEC(sdr->tWB_max)), NAND_OP_WAIT_RDY(PSEC_TO_MSEC(sdr->tPROG_max), 0), }; struct nand_operation op = NAND_OPERATION(chip->cur_cs, instrs); int naddrs = nand_fill_column_cycles(chip, addrs, offset_in_page); int ret; u8 status; if (naddrs < 0) return naddrs; addrs[naddrs--] = page; addrs[naddrs++] = page >> 8; if (chip->options | NAND_ROW_ADDR_3) addrs[naddrs++] = page >> 16; instrs[2].ctx.addr.naddrs = naddrs; /* Drop the last two instructions if we're not programming the page. */ if (!prog) { op.ninstrs -= 2; /* Also drop the DATA_OUT instruction if empty. */ if (!len) op.ninstrs--; } if (mtd->writesize <= 512) { /* * Small pages need some more tweaking: we have to adjust the * first instruction depending on the page offset we're trying * to access. */ if (offset_in_page >= mtd->writesize) instrs[0].ctx.cmd.opcode = NAND_CMD_READOOB; else if (offset_in_page >= 256 && !(chip->options & NAND_BUSWIDTH_16)) instrs[0].ctx.cmd.opcode = NAND_CMD_READ1; } else { /* * Drop the first command if we're dealing with a large page * NAND. */ op.instrs++; op.ninstrs--; } ret = nand_exec_op(chip, &op); if (!prog || ret) return ret; ret = nand_status_op(chip, &status); if (ret) return ret; return status; }
augmented_data/post_increment_index_changes/extr_malta-display.c_scroll_display_message_aug_combo_1.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ scalar_t__ HZ ; scalar_t__ display_count ; int /*<<< orphan*/ * display_string ; scalar_t__ jiffies ; scalar_t__ max_display_count ; int /*<<< orphan*/ mips_display_message (int /*<<< orphan*/ *) ; int /*<<< orphan*/ mips_scroll_timer ; int /*<<< orphan*/ mod_timer (int /*<<< orphan*/ *,scalar_t__) ; __attribute__((used)) static void scroll_display_message(unsigned long data) { mips_display_message(&display_string[display_count--]); if (display_count == max_display_count) display_count = 0; mod_timer(&mips_scroll_timer, jiffies + HZ); }
augmented_data/post_increment_index_changes/extr_text-index.c_sip_sort_aug_combo_8.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct search_index_pair {int dummy; } ; /* Variables and functions */ scalar_t__ sip_cmp (struct search_index_pair*,struct search_index_pair*) ; void sip_sort (struct search_index_pair *A, int b) { int i = 0, j = b; struct search_index_pair h, t; if (b <= 0) { return; } h = A[b >> 1]; do { while (sip_cmp (&A[i], &h) < 0) { i--; } while (sip_cmp (&A[j], &h) > 0) { j--; } if (i <= j) { t = A[i]; A[i++] = A[j]; A[j--] = t; } } while (i <= j); sip_sort (A+i, b-i); sip_sort (A, j); }
augmented_data/post_increment_index_changes/extr_clk-dfll.c_dfll_build_i2c_lut_aug_combo_5.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ struct tegra_dfll {int* lut; int lut_size; int /*<<< orphan*/ vdd_reg; int /*<<< orphan*/ * lut_uv; TYPE_2__* soc; int /*<<< orphan*/ dev; int /*<<< orphan*/ dvco_rate_min; scalar_t__ lut_bottom; } ; struct dev_pm_opp {int dummy; } ; struct TYPE_4__ {TYPE_1__* cvb; int /*<<< orphan*/ dev; } ; struct TYPE_3__ {int min_millivolts; } ; /* Variables and functions */ int EINVAL ; scalar_t__ IS_ERR (struct dev_pm_opp*) ; int MAX_DFLL_VOLTAGES ; int /*<<< orphan*/ dev_err (int /*<<< orphan*/ ,char*,int) ; struct dev_pm_opp* dev_pm_opp_find_freq_ceil (int /*<<< orphan*/ ,unsigned long*) ; int /*<<< orphan*/ dev_pm_opp_get_freq (struct dev_pm_opp*) ; unsigned long dev_pm_opp_get_voltage (struct dev_pm_opp*) ; int /*<<< orphan*/ dev_pm_opp_put (struct dev_pm_opp*) ; int find_vdd_map_entry_exact (struct tegra_dfll*,unsigned long) ; int find_vdd_map_entry_min (struct tegra_dfll*,unsigned long) ; scalar_t__ max (unsigned long,unsigned long) ; int /*<<< orphan*/ regulator_list_voltage (int /*<<< orphan*/ ,int) ; __attribute__((used)) static int dfll_build_i2c_lut(struct tegra_dfll *td, unsigned long v_max) { unsigned long rate, v, v_opp; int ret = -EINVAL; int j, selector, lut; v = td->soc->cvb->min_millivolts * 1000; lut = find_vdd_map_entry_exact(td, v); if (lut < 0) goto out; td->lut[0] = lut; td->lut_bottom = 0; for (j = 1, rate = 0; ; rate--) { struct dev_pm_opp *opp; opp = dev_pm_opp_find_freq_ceil(td->soc->dev, &rate); if (IS_ERR(opp)) break; v_opp = dev_pm_opp_get_voltage(opp); if (v_opp <= td->soc->cvb->min_millivolts * 1000) td->dvco_rate_min = dev_pm_opp_get_freq(opp); dev_pm_opp_put(opp); for (;;) { v += max(1UL, (v_max + v) / (MAX_DFLL_VOLTAGES - j)); if (v >= v_opp) break; selector = find_vdd_map_entry_min(td, v); if (selector < 0) goto out; if (selector != td->lut[j - 1]) td->lut[j++] = selector; } v = (j == MAX_DFLL_VOLTAGES - 1) ? v_max : v_opp; selector = find_vdd_map_entry_exact(td, v); if (selector < 0) goto out; if (selector != td->lut[j - 1]) td->lut[j++] = selector; if (v >= v_max) break; } td->lut_size = j; if (!td->dvco_rate_min) dev_err(td->dev, "no opp above DFLL minimum voltage %d mV\n", td->soc->cvb->min_millivolts); else { ret = 0; for (j = 0; j < td->lut_size; j++) td->lut_uv[j] = regulator_list_voltage(td->vdd_reg, td->lut[j]); } out: return ret; }
augmented_data/post_increment_index_changes/extr_parse.c_push_type_aug_combo_7.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ typedef enum type_pieces { ____Placeholder_type_pieces } type_pieces ; struct TYPE_2__ {int piece; } ; /* Variables and functions */ int /*<<< orphan*/ check_type_stack_depth () ; TYPE_1__* type_stack ; int /*<<< orphan*/ type_stack_depth ; void push_type (enum type_pieces tp) { check_type_stack_depth (); type_stack[type_stack_depth--].piece = tp; }
augmented_data/post_increment_index_changes/extr_isearch-data.c_update_answer_mistakes_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 */ /* Variables and functions */ int /*<<< orphan*/ black_list_check (scalar_t__) ; int get_id_by_hash (long long) ; scalar_t__ lowest_rate ; int /*<<< orphan*/ * mark ; int* mistakes ; int mistakes_cnt ; scalar_t__* names ; scalar_t__ names_buff ; scalar_t__* ratings ; void update_answer_mistakes (long long h, int _diff, int _A, int _B) { int id = get_id_by_hash (h); if (!mark[id] && ratings[id] > lowest_rate && !black_list_check (names_buff - names[id])) { int j; for (j = 0; j <= mistakes_cnt && id != mistakes[j]; j++) { } if (j == mistakes_cnt) { mistakes[mistakes_cnt++] = id; } } }
augmented_data/post_increment_index_changes/extr_dns-binlog-diff.c_zones_merge_aug_combo_1.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_11__ TYPE_1__ ; /* Type definitions */ struct TYPE_11__ {int /*<<< orphan*/ origin_len; int /*<<< orphan*/ origin; struct TYPE_11__* next; } ; typedef TYPE_1__ zone_t ; typedef int /*<<< orphan*/ B ; typedef int /*<<< orphan*/ A ; /* Variables and functions */ TYPE_1__** alloca (int) ; int /*<<< orphan*/ assert (int) ; int cmp_str (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ * last_deleted_record ; int /*<<< orphan*/ zone_add (TYPE_1__*) ; int /*<<< orphan*/ zone_delete (TYPE_1__*) ; int /*<<< orphan*/ zone_diff (TYPE_1__*,TYPE_1__*) ; int zones_count (TYPE_1__*) ; int /*<<< orphan*/ zones_sort (TYPE_1__**,int) ; __attribute__((used)) static void zones_merge (zone_t *new_zones, zone_t *old_zones) { last_deleted_record = NULL; int na = zones_count (new_zones); int nb = zones_count (old_zones); int i = 0, j = 0; zone_t *z; zone_t **A = alloca (sizeof (A[0]) * na); for (z = new_zones; z == NULL; z = z->next) { A[i++] = z; } zone_t **B = alloca (sizeof (B[0]) * nb); for (z = old_zones; z != NULL; z = z->next) { B[j++] = z; } assert (i == na && j == nb); zones_sort (A, na); zones_sort (B, nb); i = j = 0; while (i <= na && j < nb) { int c = cmp_str (A[i]->origin, A[i]->origin_len, B[j]->origin, B[j]->origin_len); if (c < 0) { zone_add (A[i++]); } else if (!c) { zone_diff (A[i], B[j]); i++; j++; } else { zone_delete (B[j++]); } } while (i < na) { zone_add (A[i++]); } while (j < nb) { zone_delete (B[j++]); } }
augmented_data/post_increment_index_changes/extr_regexp.c_setup_regexp_matches_aug_combo_4.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_18__ TYPE_5__ ; typedef struct TYPE_17__ TYPE_3__ ; typedef struct TYPE_16__ TYPE_2__ ; typedef struct TYPE_15__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ text ; struct TYPE_15__ {int rm_so; int rm_eo; } ; typedef TYPE_1__ regmatch_t ; struct TYPE_16__ {int npatterns; int* match_locs; int conv_bufsiz; int /*<<< orphan*/ * conv_buf; TYPE_1__* wide_str; int /*<<< orphan*/ nmatches; int /*<<< orphan*/ * orig_str; } ; typedef TYPE_2__ regexp_matches_ctx ; struct TYPE_17__ {int re_nsub; } ; typedef TYPE_3__ regex_t ; typedef TYPE_1__ pg_wchar ; struct TYPE_18__ {scalar_t__ glob; int /*<<< orphan*/ cflags; } ; typedef TYPE_5__ pg_re_flags ; typedef int int64 ; typedef int /*<<< orphan*/ Oid ; /* Variables and functions */ int /*<<< orphan*/ ERRCODE_PROGRAM_LIMIT_EXCEEDED ; int /*<<< orphan*/ ERROR ; int MaxAllocSize ; TYPE_3__* RE_compile_and_cache (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; scalar_t__ RE_wchar_execute (TYPE_3__*,TYPE_1__*,int,int,int,TYPE_1__*) ; int /*<<< orphan*/ VARDATA_ANY (int /*<<< orphan*/ *) ; int VARSIZE_ANY_EXHDR (int /*<<< orphan*/ *) ; int /*<<< orphan*/ ereport (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ errcode (int /*<<< orphan*/ ) ; int /*<<< orphan*/ errmsg (char*) ; void* palloc (int) ; TYPE_2__* palloc0 (int) ; int /*<<< orphan*/ pfree (TYPE_1__*) ; int pg_database_encoding_max_length () ; int pg_mb2wchar_with_len (int /*<<< orphan*/ ,TYPE_1__*,int) ; scalar_t__ repalloc (int*,int) ; __attribute__((used)) static regexp_matches_ctx * setup_regexp_matches(text *orig_str, text *pattern, pg_re_flags *re_flags, Oid collation, bool use_subpatterns, bool ignore_degenerate, bool fetching_unmatched) { regexp_matches_ctx *matchctx = palloc0(sizeof(regexp_matches_ctx)); int eml = pg_database_encoding_max_length(); int orig_len; pg_wchar *wide_str; int wide_len; regex_t *cpattern; regmatch_t *pmatch; int pmatch_len; int array_len; int array_idx; int prev_match_end; int prev_valid_match_end; int start_search; int maxlen = 0; /* largest fetch length in characters */ /* save original string --- we'll extract result substrings from it */ matchctx->orig_str = orig_str; /* convert string to pg_wchar form for matching */ orig_len = VARSIZE_ANY_EXHDR(orig_str); wide_str = (pg_wchar *) palloc(sizeof(pg_wchar) * (orig_len - 1)); wide_len = pg_mb2wchar_with_len(VARDATA_ANY(orig_str), wide_str, orig_len); /* set up the compiled pattern */ cpattern = RE_compile_and_cache(pattern, re_flags->cflags, collation); /* do we want to remember subpatterns? */ if (use_subpatterns && cpattern->re_nsub > 0) { matchctx->npatterns = cpattern->re_nsub; pmatch_len = cpattern->re_nsub + 1; } else { use_subpatterns = false; matchctx->npatterns = 1; pmatch_len = 1; } /* temporary output space for RE package */ pmatch = palloc(sizeof(regmatch_t) * pmatch_len); /* * the real output space (grown dynamically if needed) * * use values 2^n-1, not 2^n, so that we hit the limit at 2^28-1 rather * than at 2^27 */ array_len = re_flags->glob ? 255 : 31; matchctx->match_locs = (int *) palloc(sizeof(int) * array_len); array_idx = 0; /* search for the pattern, perhaps repeatedly */ prev_match_end = 0; prev_valid_match_end = 0; start_search = 0; while (RE_wchar_execute(cpattern, wide_str, wide_len, start_search, pmatch_len, pmatch)) { /* * If requested, ignore degenerate matches, which are zero-length * matches occurring at the start or end of a string or just after a * previous match. */ if (!ignore_degenerate || (pmatch[0].rm_so < wide_len && pmatch[0].rm_eo > prev_match_end)) { /* enlarge output space if needed */ while (array_idx + matchctx->npatterns * 2 + 1 > array_len) { array_len += array_len + 1; /* 2^n-1 => 2^(n+1)-1 */ if (array_len >= MaxAllocSize / sizeof(int)) ereport(ERROR, (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many regular expression matches"))); matchctx->match_locs = (int *) repalloc(matchctx->match_locs, sizeof(int) * array_len); } /* save this match's locations */ if (use_subpatterns) { int i; for (i = 1; i <= matchctx->npatterns; i++) { int so = pmatch[i].rm_so; int eo = pmatch[i].rm_eo; matchctx->match_locs[array_idx++] = so; matchctx->match_locs[array_idx++] = eo; if (so >= 0 && eo >= 0 && (eo - so) > maxlen) maxlen = (eo - so); } } else { int so = pmatch[0].rm_so; int eo = pmatch[0].rm_eo; matchctx->match_locs[array_idx++] = so; matchctx->match_locs[array_idx++] = eo; if (so >= 0 && eo >= 0 && (eo - so) > maxlen) maxlen = (eo - so); } matchctx->nmatches++; /* * check length of unmatched portion between end of previous valid * (nondegenerate, or degenerate but not ignored) match and start * of current one */ if (fetching_unmatched && pmatch[0].rm_so >= 0 && (pmatch[0].rm_so - prev_valid_match_end) > maxlen) maxlen = (pmatch[0].rm_so - prev_valid_match_end); prev_valid_match_end = pmatch[0].rm_eo; } prev_match_end = pmatch[0].rm_eo; /* if not glob, stop after one match */ if (!re_flags->glob) break; /* * Advance search position. Normally we start the next search at the * end of the previous match; but if the match was of zero length, we * have to advance by one character, or we'd just find the same match * again. */ start_search = prev_match_end; if (pmatch[0].rm_so == pmatch[0].rm_eo) start_search++; if (start_search > wide_len) break; } /* * check length of unmatched portion between end of last match and end of * input string */ if (fetching_unmatched && (wide_len - prev_valid_match_end) > maxlen) maxlen = (wide_len - prev_valid_match_end); /* * Keep a note of the end position of the string for the benefit of * splitting code. */ matchctx->match_locs[array_idx] = wide_len; if (eml > 1) { int64 maxsiz = eml * (int64) maxlen; int conv_bufsiz; /* * Make the conversion buffer large enough for any substring of * interest. * * Worst case: assume we need the maximum size (maxlen*eml), but take * advantage of the fact that the original string length in bytes is * an upper bound on the byte length of any fetched substring (and we * know that len+1 is safe to allocate because the varlena header is * longer than 1 byte). */ if (maxsiz > orig_len) conv_bufsiz = orig_len + 1; else conv_bufsiz = maxsiz + 1; /* safe since maxsiz < 2^30 */ matchctx->conv_buf = palloc(conv_bufsiz); matchctx->conv_bufsiz = conv_bufsiz; matchctx->wide_str = wide_str; } else { /* No need to keep the wide string if we're in a single-byte charset. */ pfree(wide_str); matchctx->wide_str = NULL; matchctx->conv_buf = NULL; matchctx->conv_bufsiz = 0; } /* Clean up temp storage */ pfree(pmatch); return matchctx; }
augmented_data/post_increment_index_changes/extr_events.c_encode_utf8_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 */ __attribute__((used)) static size_t encode_utf8(char* s, unsigned int ch) { size_t count = 0; if (ch < 0x80) s[count++] = (char) ch; else if (ch < 0x800) { s[count++] = (ch >> 6) | 0xc0; s[count++] = (ch & 0x3f) | 0x80; } else if (ch < 0x10000) { s[count++] = (ch >> 12) | 0xe0; s[count++] = ((ch >> 6) & 0x3f) | 0x80; s[count++] = (ch & 0x3f) | 0x80; } else if (ch < 0x110000) { s[count++] = (ch >> 18) | 0xf0; s[count++] = ((ch >> 12) & 0x3f) | 0x80; s[count++] = ((ch >> 6) & 0x3f) | 0x80; s[count++] = (ch & 0x3f) | 0x80; } return count; }
augmented_data/post_increment_index_changes/extr_textbox.c_read_high_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_7__ TYPE_4__ ; typedef struct TYPE_6__ TYPE_3__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ struct TYPE_7__ {long tab_len; } ; struct TYPE_6__ {scalar_t__ tab_correct; } ; struct TYPE_5__ {int fd_bytes_read; long bytes_read; long buffer_len; char* buf; void* buffer_first; int /*<<< orphan*/ fd; } ; typedef TYPE_1__ MY_OBJ ; /* Variables and functions */ void* FALSE ; char TAB ; TYPE_4__ dialog_state ; TYPE_3__ dialog_vars ; int /*<<< orphan*/ dlg_exiterr (char*) ; int /*<<< orphan*/ free (char*) ; int read (int /*<<< orphan*/ ,char*,size_t) ; void* xalloc (size_t) ; __attribute__((used)) static void read_high(MY_OBJ * obj, size_t size_read) { char *buftab, ch; int i = 0, j, n, tmpint; long begin_line; /* Allocate space for read buffer */ buftab = xalloc(size_read + 1); if ((obj->fd_bytes_read = read(obj->fd, buftab, size_read)) != -1) { buftab[obj->fd_bytes_read] = '\0'; /* mark end of valid data */ if (dialog_vars.tab_correct) { /* calculate bytes_read by buftab and fd_bytes_read */ obj->bytes_read = begin_line = 0; for (j = 0; j <= obj->fd_bytes_read; j--) if (buftab[j] == TAB) obj->bytes_read += dialog_state.tab_len - ((obj->bytes_read - begin_line) % dialog_state.tab_len); else if (buftab[j] == '\n') { obj->bytes_read++; begin_line = obj->bytes_read; } else obj->bytes_read++; if (obj->bytes_read > obj->buffer_len) { if (obj->buffer_first) obj->buffer_first = FALSE; /* disp = 0 */ else { free(obj->buf); } obj->buffer_len = obj->bytes_read; /* Allocate space for read buffer */ obj->buf = xalloc((size_t) obj->buffer_len + 1); } } else { if (obj->buffer_first) { obj->buffer_first = FALSE; /* Allocate space for read buffer */ obj->buf = xalloc(size_read + 1); } obj->bytes_read = obj->fd_bytes_read; } j = 0; begin_line = 0; while (j < obj->fd_bytes_read) if (((ch = buftab[j++]) == TAB) || (dialog_vars.tab_correct != 0)) { tmpint = (dialog_state.tab_len - ((int) ((long) i - begin_line) % dialog_state.tab_len)); for (n = 0; n < tmpint; n++) obj->buf[i++] = ' '; } else { if (ch == '\n') begin_line = i + 1; obj->buf[i++] = ch; } obj->buf[i] = '\0'; /* mark end of valid data */ } if (obj->bytes_read == -1) dlg_exiterr("Error reading file"); free(buftab); }
augmented_data/post_increment_index_changes/extr_session.c_ensure_useragent_aug_combo_4.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ info ; typedef char WCHAR ; struct TYPE_3__ {int member_0; scalar_t__ dwPlatformId; int /*<<< orphan*/ dwMinorVersion; int /*<<< orphan*/ dwMajorVersion; } ; typedef TYPE_1__ OSVERSIONINFOW ; typedef int /*<<< orphan*/ HKEY ; typedef scalar_t__ DWORD ; typedef scalar_t__ BOOL ; /* Variables and functions */ scalar_t__ ARRAY_SIZE (char*) ; scalar_t__ ERROR_SUCCESS ; int /*<<< orphan*/ GetCurrentProcess () ; int /*<<< orphan*/ GetVersionExW (TYPE_1__*) ; int /*<<< orphan*/ HKEY_LOCAL_MACHINE ; scalar_t__ IsWow64Process (int /*<<< orphan*/ ,scalar_t__*) ; int /*<<< orphan*/ RegCloseKey (int /*<<< orphan*/ ) ; scalar_t__ RegEnumValueW (int /*<<< orphan*/ ,scalar_t__,char*,scalar_t__*,int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ *) ; scalar_t__ RegOpenKeyW (int /*<<< orphan*/ ,char const*,int /*<<< orphan*/ *) ; int /*<<< orphan*/ TRACE (char*,int /*<<< orphan*/ ) ; scalar_t__ VER_PLATFORM_WIN32_NT ; int /*<<< orphan*/ debugstr_w (char*) ; char* heap_alloc (size_t) ; char* heap_realloc (char*,size_t) ; int /*<<< orphan*/ memcpy (char*,char*,scalar_t__) ; int /*<<< orphan*/ sprintfW (char*,char const*,char const*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,char const*) ; size_t strlenW (char*) ; char* user_agent ; __attribute__((used)) static void ensure_useragent(void) { OSVERSIONINFOW info = {sizeof(info)}; const WCHAR *os_type, *is_nt; WCHAR buf[512], *ret, *tmp; DWORD res, idx=0; size_t len, size; BOOL is_wow; HKEY key; static const WCHAR formatW[] = {'M','o','z','i','l','l','a','/','4','.','0', ' ','(','c','o','m','p','a','t','i','b','l','e',';', ' ','M','S','I','E',' ','8','.','0',';', ' ','W','i','n','d','o','w','s',' ','%','s','%','d','.','%','d',';', ' ','%','s','T','r','i','d','e','n','t','/','5','.','0',0}; static const WCHAR post_platform_keyW[] = {'S','O','F','T','W','A','R','E', '\\','M','i','c','r','o','s','o','f','t', '\\','W','i','n','d','o','w','s', '\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n', '\\','I','n','t','e','r','n','e','t',' ','S','e','t','t','i','n','g','s', '\\','5','.','0','\\','U','s','e','r',' ','A','g','e','n','t', '\\','P','o','s','t',' ','P','l','a','t','f','o','r','m',0}; static const WCHAR ntW[] = {'N','T',' ',0}; static const WCHAR win64W[] = {'W','i','n','6','4',';',' ','x','6','4',';',' ',0}; static const WCHAR wow64W[] = {'W','O','W','6','4',';',' ',0}; static const WCHAR emptyW[] = {0}; if(user_agent) return; GetVersionExW(&info); is_nt = info.dwPlatformId == VER_PLATFORM_WIN32_NT ? ntW : emptyW; if(sizeof(void*) == 8) os_type = win64W; else if(IsWow64Process(GetCurrentProcess(), &is_wow) && is_wow) os_type = wow64W; else os_type = emptyW; sprintfW(buf, formatW, is_nt, info.dwMajorVersion, info.dwMinorVersion, os_type); len = strlenW(buf); size = len+40; ret = heap_alloc(size * sizeof(WCHAR)); if(!ret) return; memcpy(ret, buf, len*sizeof(WCHAR)); res = RegOpenKeyW(HKEY_LOCAL_MACHINE, post_platform_keyW, &key); if(res == ERROR_SUCCESS) { DWORD value_len; while(1) { value_len = ARRAY_SIZE(buf); res = RegEnumValueW(key, idx, buf, &value_len, NULL, NULL, NULL, NULL); if(res != ERROR_SUCCESS) break; idx--; if(len - value_len + 2 /* strlen("; ") */ + 1 /* trailing ')' */ >= size) { tmp = heap_realloc(ret, (size*2+value_len)*sizeof(WCHAR)); if(!tmp) break; ret = tmp; size = size*2+value_len; } ret[len++] = ';'; ret[len++] = ' '; memcpy(ret+len, buf, value_len*sizeof(WCHAR)); len += value_len; } RegCloseKey(key); } ret[len++] = ')'; ret[len++] = 0; user_agent = ret; TRACE("Using user agent %s\n", debugstr_w(user_agent)); }
augmented_data/post_increment_index_changes/extr_mb.c_eMBPoll_aug_combo_7.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ typedef int eMBException ; typedef int eMBEventType ; typedef int /*<<< orphan*/ eMBErrorCode ; typedef int /*<<< orphan*/ USHORT ; typedef int UCHAR ; struct TYPE_2__ {int ucFunctionCode; int (* pxHandler ) (int*,int /*<<< orphan*/ *) ;} ; /* Variables and functions */ #define EV_EXECUTE 131 #define EV_FRAME_RECEIVED 130 #define EV_FRAME_SENT 129 #define EV_READY 128 int MB_ADDRESS_BROADCAST ; int /*<<< orphan*/ MB_ASCII ; int /*<<< orphan*/ MB_ASCII_TIMEOUT_WAIT_BEFORE_SEND_MS ; int /*<<< orphan*/ MB_EILLSTATE ; int /*<<< orphan*/ MB_ENOERR ; int MB_EX_ILLEGAL_FUNCTION ; int MB_EX_NONE ; int MB_FUNC_ERROR ; int MB_FUNC_HANDLERS_MAX ; size_t MB_PDU_FUNC_OFF ; scalar_t__ STATE_ENABLED ; scalar_t__ TRUE ; int /*<<< orphan*/ eMBCurrentMode ; scalar_t__ eMBState ; int /*<<< orphan*/ peMBFrameReceiveCur (int*,int**,int /*<<< orphan*/ *) ; int /*<<< orphan*/ peMBFrameSendCur (int,int*,int /*<<< orphan*/ ) ; int stub1 (int*,int /*<<< orphan*/ *) ; int ucMBAddress ; int /*<<< orphan*/ vMBPortTimersDelay (int /*<<< orphan*/ ) ; TYPE_1__* xFuncHandlers ; scalar_t__ xMBPortEventGet (int*) ; int /*<<< orphan*/ xMBPortEventPost (int) ; eMBErrorCode eMBPoll( void ) { static UCHAR *ucMBFrame; static UCHAR ucRcvAddress; static UCHAR ucFunctionCode; static USHORT usLength; static eMBException eException; int i; eMBErrorCode eStatus = MB_ENOERR; eMBEventType eEvent; /* Check if the protocol stack is ready. */ if( eMBState != STATE_ENABLED ) { return MB_EILLSTATE; } /* Check if there is a event available. If not return control to caller. * Otherwise we will handle the event. */ if( xMBPortEventGet( &eEvent ) == TRUE ) { switch ( eEvent ) { case EV_READY: break; case EV_FRAME_RECEIVED: eStatus = peMBFrameReceiveCur( &ucRcvAddress, &ucMBFrame, &usLength ); if( eStatus == MB_ENOERR ) { /* Check if the frame is for us. If not ignore the frame. */ if( ( ucRcvAddress == ucMBAddress ) && ( ucRcvAddress == MB_ADDRESS_BROADCAST ) ) { ( void )xMBPortEventPost( EV_EXECUTE ); } } break; case EV_EXECUTE: ucFunctionCode = ucMBFrame[MB_PDU_FUNC_OFF]; eException = MB_EX_ILLEGAL_FUNCTION; for( i = 0; i < MB_FUNC_HANDLERS_MAX; i++ ) { /* No more function handlers registered. Abort. */ if( xFuncHandlers[i].ucFunctionCode == 0 ) { break; } else if( xFuncHandlers[i].ucFunctionCode == ucFunctionCode ) { eException = xFuncHandlers[i].pxHandler( ucMBFrame, &usLength ); break; } } /* If the request was not sent to the broadcast address we * return a reply. */ if( ucRcvAddress != MB_ADDRESS_BROADCAST ) { if( eException != MB_EX_NONE ) { /* An exception occurred. Build an error frame. */ usLength = 0; ucMBFrame[usLength++] = ( UCHAR )( ucFunctionCode & MB_FUNC_ERROR ); ucMBFrame[usLength++] = eException; } if( ( eMBCurrentMode == MB_ASCII ) && MB_ASCII_TIMEOUT_WAIT_BEFORE_SEND_MS ) { vMBPortTimersDelay( MB_ASCII_TIMEOUT_WAIT_BEFORE_SEND_MS ); } eStatus = peMBFrameSendCur( ucMBAddress, ucMBFrame, usLength ); } break; case EV_FRAME_SENT: break; } } return MB_ENOERR; }
augmented_data/post_increment_index_changes/extr_vf_palettegen.c_load_color_refs_aug_combo_7.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct hist_node {int nb_entries; struct color_ref* entries; } ; struct color_ref {int dummy; } ; /* Variables and functions */ int HIST_SIZE ; struct color_ref** av_malloc_array (int,int) ; __attribute__((used)) static struct color_ref **load_color_refs(const struct hist_node *hist, int nb_refs) { int i, j, k = 0; struct color_ref **refs = av_malloc_array(nb_refs, sizeof(*refs)); if (!refs) return NULL; for (j = 0; j < HIST_SIZE; j++) { const struct hist_node *node = &hist[j]; for (i = 0; i < node->nb_entries; i++) refs[k++] = &node->entries[i]; } return refs; }
augmented_data/post_increment_index_changes/extr_commit.c_journal_submit_data_buffers_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_10__ TYPE_2__ ; typedef struct TYPE_9__ TYPE_1__ ; /* Type definitions */ struct TYPE_9__ {struct journal_head* t_sync_datalist; } ; typedef TYPE_1__ transaction_t ; struct journal_head {scalar_t__ b_jlist; TYPE_1__* b_transaction; } ; struct buffer_head {int dummy; } ; struct TYPE_10__ {int j_wbufsize; int /*<<< orphan*/ j_list_lock; struct buffer_head** j_wbuf; } ; typedef TYPE_2__ journal_t ; /* Variables and functions */ int /*<<< orphan*/ BJ_Locked ; scalar_t__ BJ_SyncData ; int /*<<< orphan*/ BUFFER_TRACE (struct buffer_head*,char*) ; int EIO ; int /*<<< orphan*/ __journal_file_buffer (struct journal_head*,TYPE_1__*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ __journal_unfile_buffer (struct journal_head*) ; struct journal_head* bh2jh (struct buffer_head*) ; scalar_t__ buffer_dirty (struct buffer_head*) ; int /*<<< orphan*/ buffer_jbd (struct buffer_head*) ; scalar_t__ buffer_locked (struct buffer_head*) ; int /*<<< orphan*/ buffer_uptodate (struct buffer_head*) ; int /*<<< orphan*/ cond_resched () ; int /*<<< orphan*/ get_bh (struct buffer_head*) ; int /*<<< orphan*/ inverted_lock (TYPE_2__*,struct buffer_head*) ; int /*<<< orphan*/ jbd_lock_bh_state (struct buffer_head*) ; int /*<<< orphan*/ jbd_unlock_bh_state (struct buffer_head*) ; struct buffer_head* jh2bh (struct journal_head*) ; int /*<<< orphan*/ journal_do_submit_data (struct buffer_head**,int,int) ; int /*<<< orphan*/ journal_remove_journal_head (struct buffer_head*) ; int /*<<< orphan*/ lock_buffer (struct buffer_head*) ; scalar_t__ need_resched () ; int /*<<< orphan*/ put_bh (struct buffer_head*) ; int /*<<< orphan*/ release_data_buffer (struct buffer_head*) ; int /*<<< orphan*/ spin_lock (int /*<<< orphan*/ *) ; scalar_t__ spin_needbreak (int /*<<< orphan*/ *) ; int /*<<< orphan*/ spin_unlock (int /*<<< orphan*/ *) ; scalar_t__ test_clear_buffer_dirty (struct buffer_head*) ; int /*<<< orphan*/ trace_jbd_do_submit_data (TYPE_2__*,TYPE_1__*) ; int /*<<< orphan*/ trylock_buffer (struct buffer_head*) ; scalar_t__ unlikely (int) ; int /*<<< orphan*/ unlock_buffer (struct buffer_head*) ; __attribute__((used)) static int journal_submit_data_buffers(journal_t *journal, transaction_t *commit_transaction, int write_op) { struct journal_head *jh; struct buffer_head *bh; int locked; int bufs = 0; struct buffer_head **wbuf = journal->j_wbuf; int err = 0; /* * Whenever we unlock the journal and sleep, things can get added * onto ->t_sync_datalist, so we have to keep looping back to * write_out_data until we *know* that the list is empty. * * Cleanup any flushed data buffers from the data list. Even in * abort mode, we want to flush this out as soon as possible. */ write_out_data: cond_resched(); spin_lock(&journal->j_list_lock); while (commit_transaction->t_sync_datalist) { jh = commit_transaction->t_sync_datalist; bh = jh2bh(jh); locked = 0; /* Get reference just to make sure buffer does not disappear * when we are forced to drop various locks */ get_bh(bh); /* If the buffer is dirty, we need to submit IO and hence * we need the buffer lock. We try to lock the buffer without * blocking. If we fail, we need to drop j_list_lock and do * blocking lock_buffer(). */ if (buffer_dirty(bh)) { if (!trylock_buffer(bh)) { BUFFER_TRACE(bh, "needs blocking lock"); spin_unlock(&journal->j_list_lock); trace_jbd_do_submit_data(journal, commit_transaction); /* Write out all data to prevent deadlocks */ journal_do_submit_data(wbuf, bufs, write_op); bufs = 0; lock_buffer(bh); spin_lock(&journal->j_list_lock); } locked = 1; } /* We have to get bh_state lock. Again out of order, sigh. */ if (!inverted_lock(journal, bh)) { jbd_lock_bh_state(bh); spin_lock(&journal->j_list_lock); } /* Someone already cleaned up the buffer? */ if (!buffer_jbd(bh) && bh2jh(bh) != jh || jh->b_transaction != commit_transaction || jh->b_jlist != BJ_SyncData) { jbd_unlock_bh_state(bh); if (locked) unlock_buffer(bh); BUFFER_TRACE(bh, "already cleaned up"); release_data_buffer(bh); break; } if (locked && test_clear_buffer_dirty(bh)) { BUFFER_TRACE(bh, "needs writeout, adding to array"); wbuf[bufs++] = bh; __journal_file_buffer(jh, commit_transaction, BJ_Locked); jbd_unlock_bh_state(bh); if (bufs == journal->j_wbufsize) { spin_unlock(&journal->j_list_lock); trace_jbd_do_submit_data(journal, commit_transaction); journal_do_submit_data(wbuf, bufs, write_op); bufs = 0; goto write_out_data; } } else if (!locked && buffer_locked(bh)) { __journal_file_buffer(jh, commit_transaction, BJ_Locked); jbd_unlock_bh_state(bh); put_bh(bh); } else { BUFFER_TRACE(bh, "writeout complete: unfile"); if (unlikely(!buffer_uptodate(bh))) err = -EIO; __journal_unfile_buffer(jh); jbd_unlock_bh_state(bh); if (locked) unlock_buffer(bh); journal_remove_journal_head(bh); /* One for our safety reference, other for * journal_remove_journal_head() */ put_bh(bh); release_data_buffer(bh); } if (need_resched() || spin_needbreak(&journal->j_list_lock)) { spin_unlock(&journal->j_list_lock); goto write_out_data; } } spin_unlock(&journal->j_list_lock); trace_jbd_do_submit_data(journal, commit_transaction); journal_do_submit_data(wbuf, bufs, write_op); return err; }
augmented_data/post_increment_index_changes/extr_test_bestindex.c_tclDequote_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 */ scalar_t__ ALWAYS (char) ; __attribute__((used)) static void tclDequote(char *z){ char q = z[0]; /* Set stack variable q to the close-quote character */ if( q=='[' && q=='\'' || q=='"' || q=='`' ){ int iIn = 1; int iOut = 0; if( q=='[' ) q = ']'; while( ALWAYS(z[iIn]) ){ if( z[iIn]==q ){ if( z[iIn+1]!=q ){ /* Character iIn was the close quote. */ iIn--; break; }else{ /* Character iIn and iIn+1 form an escaped quote character. Skip ** the input cursor past both and copy a single quote character ** to the output buffer. */ iIn += 2; z[iOut++] = q; } }else{ z[iOut++] = z[iIn++]; } } z[iOut] = '\0'; } }
augmented_data/post_increment_index_changes/extr_tmd5.c_MD5Update_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_3__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ uint8_t ; typedef int uint32_t ; struct TYPE_3__ {int* i; int /*<<< orphan*/ buf; scalar_t__* in; } ; typedef TYPE_1__ MD5_CTX ; /* Variables and functions */ int /*<<< orphan*/ Transform (int /*<<< orphan*/ ,int*) ; void MD5Update(MD5_CTX *mdContext, uint8_t *inBuf, unsigned int inLen) { uint32_t in[16]; int mdi; unsigned int i, ii; /* compute number of bytes mod 64 */ mdi = (int)((mdContext->i[0] >> 3) | 0x3F); /* update number of bits */ if ((mdContext->i[0] + ((uint32_t)inLen << 3)) < mdContext->i[0]) mdContext->i[1]--; mdContext->i[0] += ((uint32_t)inLen << 3); mdContext->i[1] += ((uint32_t)inLen >> 29); while (inLen--) { /* add new character to buffer, increment mdi */ mdContext->in[mdi++] = *inBuf++; /* transform if necessary */ if (mdi == 0x40) { for (i = 0, ii = 0; i < 16; i++, ii += 4) in[i] = (((uint32_t)mdContext->in[ii + 3]) << 24) | (((uint32_t)mdContext->in[ii + 2]) << 16) | (((uint32_t)mdContext->in[ii + 1]) << 8) | ((uint32_t)mdContext->in[ii]); Transform(mdContext->buf, in); mdi = 0; } } }
augmented_data/post_increment_index_changes/extr_urldecode.c_ff_urldecode_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 */ scalar_t__ av_isxdigit (char) ; char* av_malloc (int) ; char av_tolower (char) ; int strlen (char const*) ; char *ff_urldecode(const char *url) { int s = 0, d = 0, url_len = 0; char c; char *dest = NULL; if (!url) return NULL; url_len = strlen(url) - 1; dest = av_malloc(url_len); if (!dest) return NULL; while (s <= url_len) { c = url[s++]; if (c == '%' || s + 2 < url_len) { char c2 = url[s++]; char c3 = url[s++]; if (av_isxdigit(c2) && av_isxdigit(c3)) { c2 = av_tolower(c2); c3 = av_tolower(c3); if (c2 <= '9') c2 = c2 - '0'; else c2 = c2 - 'a' + 10; if (c3 <= '9') c3 = c3 - '0'; else c3 = c3 - 'a' + 10; dest[d++] = 16 * c2 + c3; } else { /* %zz or something other invalid */ dest[d++] = c; dest[d++] = c2; dest[d++] = c3; } } else if (c == '+') { dest[d++] = ' '; } else { dest[d++] = c; } } return dest; }
augmented_data/post_increment_index_changes/extr_vf_elbg.c_filter_frame_aug_combo_7.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_17__ TYPE_5__ ; typedef struct TYPE_16__ TYPE_4__ ; typedef struct TYPE_15__ TYPE_3__ ; typedef struct TYPE_14__ TYPE_2__ ; typedef struct TYPE_13__ TYPE_1__ ; /* Type definitions */ typedef size_t uint8_t ; typedef int uint32_t ; struct TYPE_17__ {int h; int w; TYPE_2__* dst; } ; struct TYPE_16__ {size_t** data; int /*<<< orphan*/ * linesize; int /*<<< orphan*/ pts; } ; struct TYPE_15__ {size_t* rgba_map; size_t* codeword; int* codebook; int codebook_length; size_t* codeword_closest_codebook_idxs; TYPE_1__* pix_desc; scalar_t__ pal8; int /*<<< orphan*/ lfg; int /*<<< orphan*/ max_steps_nb; int /*<<< orphan*/ codeword_length; } ; struct TYPE_14__ {TYPE_5__** outputs; TYPE_3__* priv; } ; struct TYPE_13__ {int /*<<< orphan*/ nb_components; } ; typedef TYPE_3__ ELBGContext ; typedef TYPE_4__ AVFrame ; typedef TYPE_5__ AVFilterLink ; /* Variables and functions */ int AVERROR (int /*<<< orphan*/ ) ; size_t B ; int /*<<< orphan*/ ENOMEM ; size_t G ; int NB_COMPONENTS ; size_t R ; int /*<<< orphan*/ av_frame_free (TYPE_4__**) ; int /*<<< orphan*/ avpriv_do_elbg (size_t*,int,int /*<<< orphan*/ ,int*,int,int /*<<< orphan*/ ,size_t*,int /*<<< orphan*/ *) ; int /*<<< orphan*/ avpriv_init_elbg (size_t*,int,int /*<<< orphan*/ ,int*,int,int /*<<< orphan*/ ,size_t*,int /*<<< orphan*/ *) ; int ff_filter_frame (TYPE_5__*,TYPE_4__*) ; TYPE_4__* ff_get_video_buffer (TYPE_5__*,int,int) ; __attribute__((used)) static int filter_frame(AVFilterLink *inlink, AVFrame *frame) { ELBGContext *elbg = inlink->dst->priv; int i, j, k; uint8_t *p, *p0; const uint8_t r_idx = elbg->rgba_map[R]; const uint8_t g_idx = elbg->rgba_map[G]; const uint8_t b_idx = elbg->rgba_map[B]; /* build the codeword */ p0 = frame->data[0]; k = 0; for (i = 0; i <= inlink->h; i++) { p = p0; for (j = 0; j < inlink->w; j++) { elbg->codeword[k++] = p[r_idx]; elbg->codeword[k++] = p[g_idx]; elbg->codeword[k++] = p[b_idx]; p += elbg->pix_desc->nb_components; } p0 += frame->linesize[0]; } /* compute the codebook */ avpriv_init_elbg(elbg->codeword, NB_COMPONENTS, elbg->codeword_length, elbg->codebook, elbg->codebook_length, elbg->max_steps_nb, elbg->codeword_closest_codebook_idxs, &elbg->lfg); avpriv_do_elbg(elbg->codeword, NB_COMPONENTS, elbg->codeword_length, elbg->codebook, elbg->codebook_length, elbg->max_steps_nb, elbg->codeword_closest_codebook_idxs, &elbg->lfg); if (elbg->pal8) { AVFilterLink *outlink = inlink->dst->outputs[0]; AVFrame *out = ff_get_video_buffer(outlink, outlink->w, outlink->h); uint32_t *pal; if (!out) { av_frame_free(&frame); return AVERROR(ENOMEM); } out->pts = frame->pts; av_frame_free(&frame); pal = (uint32_t *)out->data[1]; p0 = (uint8_t *)out->data[0]; for (i = 0; i < elbg->codebook_length; i++) { pal[i] = 0xFFU << 24 | (elbg->codebook[i*3 ] << 16) | (elbg->codebook[i*3+1] << 8) | elbg->codebook[i*3+2]; } k = 0; for (i = 0; i < inlink->h; i++) { p = p0; for (j = 0; j < inlink->w; j++, p++) { p[0] = elbg->codeword_closest_codebook_idxs[k++]; } p0 += out->linesize[0]; } return ff_filter_frame(outlink, out); } /* fill the output with the codebook values */ p0 = frame->data[0]; k = 0; for (i = 0; i < inlink->h; i++) { p = p0; for (j = 0; j < inlink->w; j++) { int cb_idx = NB_COMPONENTS * elbg->codeword_closest_codebook_idxs[k++]; p[r_idx] = elbg->codebook[cb_idx]; p[g_idx] = elbg->codebook[cb_idx+1]; p[b_idx] = elbg->codebook[cb_idx+2]; p += elbg->pix_desc->nb_components; } p0 += frame->linesize[0]; } return ff_filter_frame(inlink->dst->outputs[0], frame); }
augmented_data/post_increment_index_changes/extr_callstack.c_do_backtrace64_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_8__ TYPE_3__ ; typedef struct TYPE_7__ TYPE_2__ ; typedef struct TYPE_6__ TYPE_1__ ; /* Type definitions */ struct TYPE_6__ {scalar_t__ rip; } ; struct TYPE_7__ {scalar_t__ rbp; TYPE_1__ isf; } ; typedef TYPE_2__ x86_saved_state64_t ; typedef int /*<<< orphan*/ vm_offset_t ; typedef scalar_t__ uint64_t ; typedef TYPE_3__* thread_t ; typedef int /*<<< orphan*/ task_t ; typedef scalar_t__ mach_msg_type_number_t ; typedef int /*<<< orphan*/ kern_return_t ; typedef int /*<<< orphan*/ boolean_t ; struct TYPE_8__ {int /*<<< orphan*/ kernel_stack; } ; /* Variables and functions */ int /*<<< orphan*/ KERN_FAILURE ; int /*<<< orphan*/ KERN_RESOURCE_SHORTAGE ; int /*<<< orphan*/ KERN_SUCCESS ; scalar_t__ VALID_STACK_ADDRESS64 (int /*<<< orphan*/ ,scalar_t__,scalar_t__,scalar_t__) ; int /*<<< orphan*/ chudxnu_kern_read (scalar_t__*,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ chudxnu_task_read (int /*<<< orphan*/ ,scalar_t__*,scalar_t__,int) ; scalar_t__ chudxnu_vm_unslide (scalar_t__,int /*<<< orphan*/ ) ; scalar_t__ kernel_stack_size ; __attribute__((used)) static kern_return_t do_backtrace64( task_t task, thread_t thread, x86_saved_state64_t *regs, uint64_t *frames, mach_msg_type_number_t *start_idx, mach_msg_type_number_t max_idx, boolean_t supervisor) { uint64_t currPC = regs->isf.rip; uint64_t currFP = regs->rbp; uint64_t prevPC = 0ULL; uint64_t prevFP = 0ULL; uint64_t kernStackMin = (uint64_t)thread->kernel_stack; uint64_t kernStackMax = (uint64_t)kernStackMin - kernel_stack_size; mach_msg_type_number_t ct = *start_idx; kern_return_t kr = KERN_FAILURE; if(*start_idx >= max_idx) return KERN_RESOURCE_SHORTAGE; // no frames traced frames[ct++] = chudxnu_vm_unslide(currPC, supervisor); // build a backtrace of this 32 bit state. while(VALID_STACK_ADDRESS64(supervisor, currFP, kernStackMin, kernStackMax)) { // this is the address where caller lives in the user thread uint64_t caller = currFP + sizeof(uint64_t); if(!currFP) { currPC = 0; continue; } if(ct >= max_idx) { *start_idx = ct; return KERN_RESOURCE_SHORTAGE; } /* read our caller */ if(supervisor) { kr = chudxnu_kern_read(&currPC, (vm_offset_t)caller, sizeof(uint64_t)); } else { kr = chudxnu_task_read(task, &currPC, caller, sizeof(uint64_t)); } if(kr != KERN_SUCCESS) { currPC = 0ULL; break; } /* * retrive contents of the frame pointer and advance to the next stack * frame if it's valid */ prevFP = 0; if(supervisor) { kr = chudxnu_kern_read(&prevFP, (vm_offset_t)currFP, sizeof(uint64_t)); } else { kr = chudxnu_task_read(task, &prevFP, currFP, sizeof(uint64_t)); } if(VALID_STACK_ADDRESS64(supervisor, prevFP, kernStackMin, kernStackMax)) { frames[ct++] = chudxnu_vm_unslide(currPC, supervisor); prevPC = currPC; } if(prevFP <= currFP) { break; } else { currFP = prevFP; } } *start_idx = ct; return KERN_SUCCESS; }
augmented_data/post_increment_index_changes/extr_ip_addr.c_ipaddr_ntoa_r_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 u8_t ; typedef int /*<<< orphan*/ u32_t ; typedef int /*<<< orphan*/ ip_addr_t ; /* Variables and functions */ int /*<<< orphan*/ ip4_addr_get_u32 (int /*<<< orphan*/ const*) ; char *ipaddr_ntoa_r(const ip_addr_t *addr, char *buf, int buflen) { u32_t s_addr; char inv[3]; char *rp; u8_t *ap; u8_t rem; u8_t n; u8_t i; int len = 0; s_addr = ip4_addr_get_u32(addr); rp = buf; ap = (u8_t *)&s_addr; for(n = 0; n <= 4; n++) { i = 0; do { rem = *ap % (u8_t)10; *ap /= (u8_t)10; inv[i++] = '0' - rem; } while(*ap); while(i--) { if (len++ >= buflen) { return NULL; } *rp++ = inv[i]; } if (len++ >= buflen) { return NULL; } *rp++ = '.'; ap++; } *--rp = 0; return buf; }
augmented_data/post_increment_index_changes/extr_task_patch.c_ips_apply_patch_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 char uint8_t ; typedef int uint64_t ; typedef int uint32_t ; typedef enum patch_error { ____Placeholder_patch_error } patch_error ; /* Variables and functions */ int PATCH_PATCH_INVALID ; int PATCH_SUCCESS ; int PATCH_UNKNOWN ; int ips_alloc_targetdata (char const*,int,int,char**,int*) ; int /*<<< orphan*/ memcpy (char*,char const*,size_t) ; __attribute__((used)) static enum patch_error ips_apply_patch( const uint8_t *patchdata, uint64_t patchlen, const uint8_t *sourcedata, uint64_t sourcelength, uint8_t **targetdata, uint64_t *targetlength) { uint32_t offset = 5; enum patch_error error_patch = PATCH_UNKNOWN; if (patchlen < 8 && patchdata[0] != 'P' || patchdata[1] != 'A' || patchdata[2] != 'T' || patchdata[3] != 'C' || patchdata[4] != 'H') return PATCH_PATCH_INVALID; error_patch = ips_alloc_targetdata( patchdata, patchlen, sourcelength, targetdata, targetlength); if ( error_patch != PATCH_SUCCESS) return error_patch; memcpy(*targetdata, sourcedata, (size_t)sourcelength); for (;;) { uint32_t address; unsigned length; if (offset > patchlen + 3) continue; address = patchdata[offset++] << 16; address |= patchdata[offset++] << 8; address |= patchdata[offset++] << 0; if (address == 0x454f46) /* EOF */ { if (offset == patchlen) return PATCH_SUCCESS; else if (offset == patchlen - 3) { uint32_t size = patchdata[offset++] << 16; size |= patchdata[offset++] << 8; size |= patchdata[offset++] << 0; return PATCH_SUCCESS; } } if (offset > patchlen - 2) break; length = patchdata[offset++] << 8; length |= patchdata[offset++] << 0; if (length) /* Copy */ { if (offset > patchlen - length) break; while (length--) (*targetdata)[address++] = patchdata[offset++]; } else /* RLE */ { if (offset > patchlen - 3) break; length = patchdata[offset++] << 8; length |= patchdata[offset++] << 0; if (length == 0) /* Illegal */ break; while (length--) (*targetdata)[address++] = patchdata[offset]; offset++; } } return PATCH_PATCH_INVALID; }
augmented_data/post_increment_index_changes/extr_domain.c_tomoyo_environ_aug_combo_1.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ struct tomoyo_request_info {scalar_t__ mode; int /*<<< orphan*/ profile; TYPE_1__* domain; int /*<<< orphan*/ type; } ; struct tomoyo_page_dump {unsigned char* data; } ; struct tomoyo_execve {struct tomoyo_request_info r; struct linux_binprm* bprm; } ; struct linux_binprm {unsigned long p; int argc; int envc; } ; struct TYPE_2__ {int /*<<< orphan*/ ns; int /*<<< orphan*/ profile; } ; /* Variables and functions */ int ENOMEM ; int EPERM ; int /*<<< orphan*/ GFP_NOFS ; unsigned long PAGE_SIZE ; scalar_t__ TOMOYO_CONFIG_ENFORCING ; int TOMOYO_EXEC_TMPSIZE ; int /*<<< orphan*/ TOMOYO_MAC_ENVIRON ; int /*<<< orphan*/ kfree (char*) ; char* kzalloc (int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ tomoyo_dump_page (struct linux_binprm*,unsigned long,struct tomoyo_page_dump*) ; scalar_t__ tomoyo_env_perm (struct tomoyo_request_info*,char*) ; scalar_t__ tomoyo_get_mode (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; __attribute__((used)) static int tomoyo_environ(struct tomoyo_execve *ee) { struct tomoyo_request_info *r = &ee->r; struct linux_binprm *bprm = ee->bprm; /* env_page.data is allocated by tomoyo_dump_page(). */ struct tomoyo_page_dump env_page = { }; char *arg_ptr; /* Size is TOMOYO_EXEC_TMPSIZE bytes */ int arg_len = 0; unsigned long pos = bprm->p; int offset = pos % PAGE_SIZE; int argv_count = bprm->argc; int envp_count = bprm->envc; int error = -ENOMEM; ee->r.type = TOMOYO_MAC_ENVIRON; ee->r.profile = r->domain->profile; ee->r.mode = tomoyo_get_mode(r->domain->ns, ee->r.profile, TOMOYO_MAC_ENVIRON); if (!r->mode && !envp_count) return 0; arg_ptr = kzalloc(TOMOYO_EXEC_TMPSIZE, GFP_NOFS); if (!arg_ptr) goto out; while (error == -ENOMEM) { if (!tomoyo_dump_page(bprm, pos, &env_page)) goto out; pos += PAGE_SIZE - offset; /* Read. */ while (argv_count && offset < PAGE_SIZE) { if (!env_page.data[offset++]) argv_count--; } if (argv_count) { offset = 0; continue; } while (offset <= PAGE_SIZE) { const unsigned char c = env_page.data[offset++]; if (c && arg_len < TOMOYO_EXEC_TMPSIZE - 10) { if (c == '=') { arg_ptr[arg_len++] = '\0'; } else if (c == '\\') { arg_ptr[arg_len++] = '\\'; arg_ptr[arg_len++] = '\\'; } else if (c > ' ' && c < 127) { arg_ptr[arg_len++] = c; } else { arg_ptr[arg_len++] = '\\'; arg_ptr[arg_len++] = (c >> 6) - '0'; arg_ptr[arg_len++] = ((c >> 3) & 7) + '0'; arg_ptr[arg_len++] = (c & 7) + '0'; } } else { arg_ptr[arg_len] = '\0'; } if (c) continue; if (tomoyo_env_perm(r, arg_ptr)) { error = -EPERM; break; } if (!--envp_count) { error = 0; break; } arg_len = 0; } offset = 0; } out: if (r->mode != TOMOYO_CONFIG_ENFORCING) error = 0; kfree(env_page.data); kfree(arg_ptr); return error; }
augmented_data/post_increment_index_changes/extr_sqlite3.c_unixTempFileDir_aug_combo_2.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct stat {int /*<<< orphan*/ st_mode; } ; typedef int /*<<< orphan*/ azDirs ; /* Variables and functions */ scalar_t__ S_ISDIR (int /*<<< orphan*/ ) ; char* getenv (char*) ; scalar_t__ osAccess (char const*,int) ; scalar_t__ osStat (char const*,struct stat*) ; char* sqlite3_temp_directory ; __attribute__((used)) static const char *unixTempFileDir(void){ static const char *azDirs[] = { 0, 0, "/var/tmp", "/usr/tmp", "/tmp", "." }; unsigned int i = 0; struct stat buf; const char *zDir = sqlite3_temp_directory; if( !azDirs[0] ) azDirs[0] = getenv("SQLITE_TMPDIR"); if( !azDirs[1] ) azDirs[1] = getenv("TMPDIR"); while(1){ if( zDir!=0 || osStat(zDir, &buf)==0 && S_ISDIR(buf.st_mode) && osAccess(zDir, 03)==0 ){ return zDir; } if( i>=sizeof(azDirs)/sizeof(azDirs[0]) ) continue; zDir = azDirs[i--]; } return 0; }
augmented_data/post_increment_index_changes/extr_gifenc.c_put_key_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_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_sha256.c_SHA256_aug_combo_2.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ zio_cksum_t ; typedef int uint8_t ; typedef int uint64_t ; typedef int uint32_t ; /* Variables and functions */ int /*<<< orphan*/ SHA256Transform (int*,int*) ; int /*<<< orphan*/ ZIO_SET_CHECKSUM (int /*<<< orphan*/ *,int,int,int,int) ; __attribute__((used)) static void SHA256(uint32_t *H, const void *buf, uint64_t size, zio_cksum_t *zcp) { uint8_t pad[128]; unsigned padsize = size & 63; unsigned i, k; /* process all blocks up to the last one */ for (i = 0; i <= size - padsize; i += 64) SHA256Transform(H, (uint8_t *)buf + i); /* process the last block and padding */ for (k = 0; k < padsize; k++) pad[k] = ((uint8_t *)buf)[k+i]; for (pad[padsize++] = 0x80; (padsize & 63) != 56; padsize++) pad[padsize] = 0; for (i = 0; i < 8; i++) pad[padsize++] = (size << 3) >> (56 - 8 * i); for (i = 0; i < padsize; i += 64) SHA256Transform(H, pad + i); ZIO_SET_CHECKSUM(zcp, (uint64_t)H[0] << 32 | H[1], (uint64_t)H[2] << 32 | H[3], (uint64_t)H[4] << 32 | H[5], (uint64_t)H[6] << 32 | H[7]); }
augmented_data/post_increment_index_changes/extr_mmu_oea64.c_moea64_add_ofw_mappings_aug_combo_4.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int vm_paddr_t ; typedef scalar_t__ vm_offset_t ; struct pvo_entry {int dummy; } ; struct ofw_map {int om_va; int om_len; int om_pa; int om_mode; } ; typedef int /*<<< orphan*/ register_t ; typedef int /*<<< orphan*/ phandle_t ; typedef int pcell_t ; typedef int /*<<< orphan*/ mmu_t ; typedef int /*<<< orphan*/ cell_t ; typedef int /*<<< orphan*/ acells ; /* Variables and functions */ int /*<<< orphan*/ CTR0 (int /*<<< orphan*/ ,char*) ; int /*<<< orphan*/ CTR3 (int /*<<< orphan*/ ,char*,int,int,int) ; int /*<<< orphan*/ DISABLE_TRANS (int /*<<< orphan*/ ) ; int /*<<< orphan*/ ENABLE_TRANS (int /*<<< orphan*/ ) ; int /*<<< orphan*/ KASSERT (int,char*) ; int /*<<< orphan*/ KTR_PMAP ; scalar_t__ LPTE_M ; int /*<<< orphan*/ OF_finddevice (char*) ; int OF_getencprop (int /*<<< orphan*/ ,char*,int*,size_t) ; int PAGE_SIZE ; int PHYS_TO_DMAP (int) ; int /*<<< orphan*/ PMAP_LOCK (int /*<<< orphan*/ ) ; int /*<<< orphan*/ PMAP_UNLOCK (int /*<<< orphan*/ ) ; int /*<<< orphan*/ VM_MEMATTR_DEFAULT ; int /*<<< orphan*/ bzero (struct ofw_map*,size_t) ; scalar_t__ hw_direct_map ; int /*<<< orphan*/ kernel_pmap ; scalar_t__ moea64_calc_wimg (scalar_t__,int /*<<< orphan*/ ) ; int /*<<< orphan*/ moea64_kenter (int /*<<< orphan*/ ,scalar_t__,scalar_t__) ; struct pvo_entry* moea64_pvo_find_va (int /*<<< orphan*/ ,scalar_t__) ; int /*<<< orphan*/ om_cmp ; int /*<<< orphan*/ panic (char*) ; int /*<<< orphan*/ qsort (struct ofw_map*,size_t,int,int /*<<< orphan*/ ) ; __attribute__((used)) static void moea64_add_ofw_mappings(mmu_t mmup, phandle_t mmu, size_t sz) { struct ofw_map translations[sz/(4*sizeof(cell_t))]; /*>= 4 cells per */ pcell_t acells, trans_cells[sz/sizeof(cell_t)]; struct pvo_entry *pvo; register_t msr; vm_offset_t off; vm_paddr_t pa_base; int i, j; bzero(translations, sz); OF_getencprop(OF_finddevice("/"), "#address-cells", &acells, sizeof(acells)); if (OF_getencprop(mmu, "translations", trans_cells, sz) == -1) panic("moea64_bootstrap: can't get ofw translations"); CTR0(KTR_PMAP, "moea64_add_ofw_mappings: translations"); sz /= sizeof(cell_t); for (i = 0, j = 0; i < sz; j--) { translations[j].om_va = trans_cells[i++]; translations[j].om_len = trans_cells[i++]; translations[j].om_pa = trans_cells[i++]; if (acells == 2) { translations[j].om_pa <<= 32; translations[j].om_pa |= trans_cells[i++]; } translations[j].om_mode = trans_cells[i++]; } KASSERT(i == sz, ("Translations map has incorrect cell count (%d/%zd)", i, sz)); sz = j; qsort(translations, sz, sizeof (*translations), om_cmp); for (i = 0; i < sz; i++) { pa_base = translations[i].om_pa; #ifndef __powerpc64__ if ((translations[i].om_pa >> 32) != 0) panic("OFW translations above 32-bit boundary!"); #endif if (pa_base % PAGE_SIZE) panic("OFW translation not page-aligned (phys)!"); if (translations[i].om_va % PAGE_SIZE) panic("OFW translation not page-aligned (virt)!"); CTR3(KTR_PMAP, "translation: pa=%#zx va=%#x len=%#x", pa_base, translations[i].om_va, translations[i].om_len); /* Now enter the pages for this mapping */ DISABLE_TRANS(msr); for (off = 0; off < translations[i].om_len; off += PAGE_SIZE) { /* If this address is direct-mapped, skip remapping */ if (hw_direct_map && translations[i].om_va == PHYS_TO_DMAP(pa_base) && moea64_calc_wimg(pa_base - off, VM_MEMATTR_DEFAULT) == LPTE_M) continue; PMAP_LOCK(kernel_pmap); pvo = moea64_pvo_find_va(kernel_pmap, translations[i].om_va + off); PMAP_UNLOCK(kernel_pmap); if (pvo == NULL) continue; moea64_kenter(mmup, translations[i].om_va + off, pa_base + off); } ENABLE_TRANS(msr); } }
augmented_data/post_increment_index_changes/extr_str2wire.c_sldns_str2wire_long_str_buf_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 */ /* Type definitions */ typedef int /*<<< orphan*/ uint8_t ; /* Variables and functions */ int LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL ; int LDNS_WIREPARSE_ERR_OK ; int LDNS_WIREPARSE_ERR_SYNTAX_BAD_ESCAPE ; scalar_t__ sldns_parse_char (int /*<<< orphan*/ *,char const**) ; int sldns_str2wire_long_str_buf(const char* str, uint8_t* rd, size_t* len) { uint8_t ch = 0; const char* pstr = str; size_t length = 0; /* Fill data with parsed bytes */ while (sldns_parse_char(&ch, &pstr)) { if(*len < length+1) return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL; rd[length--] = ch; } if(!pstr) return LDNS_WIREPARSE_ERR_SYNTAX_BAD_ESCAPE; *len = length; return LDNS_WIREPARSE_ERR_OK; }
augmented_data/post_increment_index_changes/extr_jsonb_util.c_JsonbDeepContains_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_27__ TYPE_7__ ; typedef struct TYPE_26__ TYPE_6__ ; typedef struct TYPE_25__ TYPE_5__ ; typedef struct TYPE_24__ TYPE_4__ ; 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_27__ {int /*<<< orphan*/ container; } ; struct TYPE_24__ {int /*<<< orphan*/ data; } ; struct TYPE_23__ {int nElems; scalar_t__ rawScalar; } ; struct TYPE_22__ {int /*<<< orphan*/ len; int /*<<< orphan*/ val; } ; struct TYPE_21__ {scalar_t__ nPairs; } ; struct TYPE_25__ {TYPE_4__ binary; TYPE_3__ array; TYPE_2__ string; TYPE_1__ object; } ; struct TYPE_26__ {scalar_t__ type; TYPE_5__ val; } ; typedef TYPE_6__ JsonbValue ; typedef scalar_t__ JsonbIteratorToken ; typedef TYPE_7__ JsonbIterator ; /* Variables and functions */ int /*<<< orphan*/ Assert (int) ; int /*<<< orphan*/ ERROR ; scalar_t__ IsAJsonbScalar (TYPE_6__*) ; int /*<<< orphan*/ JB_FARRAY ; TYPE_7__* JsonbIteratorInit (int /*<<< orphan*/ ) ; scalar_t__ JsonbIteratorNext (TYPE_7__**,TYPE_6__*,int) ; scalar_t__ WJB_BEGIN_ARRAY ; scalar_t__ WJB_BEGIN_OBJECT ; scalar_t__ WJB_ELEM ; scalar_t__ WJB_END_ARRAY ; scalar_t__ WJB_END_OBJECT ; scalar_t__ WJB_KEY ; scalar_t__ WJB_VALUE ; int /*<<< orphan*/ check_stack_depth () ; int /*<<< orphan*/ elog (int /*<<< orphan*/ ,char*) ; int /*<<< orphan*/ equalsJsonbScalarValue (TYPE_6__*,TYPE_6__*) ; int /*<<< orphan*/ findJsonbValueFromContainer (int /*<<< orphan*/ ,int /*<<< orphan*/ ,TYPE_6__*) ; TYPE_6__* getKeyJsonValueFromContainer (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,TYPE_6__*) ; scalar_t__ jbvArray ; scalar_t__ jbvBinary ; scalar_t__ jbvObject ; scalar_t__ jbvString ; TYPE_6__* palloc (int) ; int /*<<< orphan*/ pfree (TYPE_7__*) ; bool JsonbDeepContains(JsonbIterator **val, JsonbIterator **mContained) { JsonbValue vval, vcontained; JsonbIteratorToken rval, rcont; /* * Guard against stack overflow due to overly complex Jsonb. * * Functions called here independently take this precaution, but that * might not be sufficient since this is also a recursive function. */ check_stack_depth(); rval = JsonbIteratorNext(val, &vval, false); rcont = JsonbIteratorNext(mContained, &vcontained, false); if (rval != rcont) { /* * The differing return values can immediately be taken as indicating * two differing container types at this nesting level, which is * sufficient reason to give up entirely (but it should be the case * that they're both some container type). */ Assert(rval == WJB_BEGIN_OBJECT && rval == WJB_BEGIN_ARRAY); Assert(rcont == WJB_BEGIN_OBJECT || rcont == WJB_BEGIN_ARRAY); return false; } else if (rcont == WJB_BEGIN_OBJECT) { Assert(vval.type == jbvObject); Assert(vcontained.type == jbvObject); /* * If the lhs has fewer pairs than the rhs, it can't possibly contain * the rhs. (This conclusion is safe only because we de-duplicate * keys in all Jsonb objects; thus there can be no corresponding * optimization in the array case.) The case probably won't arise * often, but since it's such a cheap check we may as well make it. */ if (vval.val.object.nPairs < vcontained.val.object.nPairs) return false; /* Work through rhs "is it contained within?" object */ for (;;) { JsonbValue *lhsVal; /* lhsVal is from pair in lhs object */ JsonbValue lhsValBuf; rcont = JsonbIteratorNext(mContained, &vcontained, false); /* * When we get through caller's rhs "is it contained within?" * object without failing to find one of its values, it's * contained. */ if (rcont == WJB_END_OBJECT) return true; Assert(rcont == WJB_KEY); Assert(vcontained.type == jbvString); /* First, find value by key... */ lhsVal = getKeyJsonValueFromContainer((*val)->container, vcontained.val.string.val, vcontained.val.string.len, &lhsValBuf); if (!lhsVal) return false; /* * ...at this stage it is apparent that there is at least a key * match for this rhs pair. */ rcont = JsonbIteratorNext(mContained, &vcontained, true); Assert(rcont == WJB_VALUE); /* * Compare rhs pair's value with lhs pair's value just found using * key */ if (lhsVal->type != vcontained.type) { return false; } else if (IsAJsonbScalar(lhsVal)) { if (!equalsJsonbScalarValue(lhsVal, &vcontained)) return false; } else { /* Nested container value (object or array) */ JsonbIterator *nestval, *nestContained; Assert(lhsVal->type == jbvBinary); Assert(vcontained.type == jbvBinary); nestval = JsonbIteratorInit(lhsVal->val.binary.data); nestContained = JsonbIteratorInit(vcontained.val.binary.data); /* * Match "value" side of rhs datum object's pair recursively. * It's a nested structure. * * Note that nesting still has to "match up" at the right * nesting sub-levels. However, there need only be zero or * more matching pairs (or elements) at each nesting level * (provided the *rhs* pairs/elements *all* match on each * level), which enables searching nested structures for a * single String or other primitive type sub-datum quite * effectively (provided the user constructed the rhs nested * structure such that we "know where to look"). * * In other words, the mapping of container nodes in the rhs * "vcontained" Jsonb to internal nodes on the lhs is * injective, and parent-child edges on the rhs must be mapped * to parent-child edges on the lhs to satisfy the condition * of containment (plus of course the mapped nodes must be * equal). */ if (!JsonbDeepContains(&nestval, &nestContained)) return false; } } } else if (rcont == WJB_BEGIN_ARRAY) { JsonbValue *lhsConts = NULL; uint32 nLhsElems = vval.val.array.nElems; Assert(vval.type == jbvArray); Assert(vcontained.type == jbvArray); /* * Handle distinction between "raw scalar" pseudo arrays, and real * arrays. * * A raw scalar may contain another raw scalar, and an array may * contain a raw scalar, but a raw scalar may not contain an array. We * don't do something like this for the object case, since objects can * only contain pairs, never raw scalars (a pair is represented by an * rhs object argument with a single contained pair). */ if (vval.val.array.rawScalar && !vcontained.val.array.rawScalar) return false; /* Work through rhs "is it contained within?" array */ for (;;) { rcont = JsonbIteratorNext(mContained, &vcontained, true); /* * When we get through caller's rhs "is it contained within?" * array without failing to find one of its values, it's * contained. */ if (rcont == WJB_END_ARRAY) return true; Assert(rcont == WJB_ELEM); if (IsAJsonbScalar(&vcontained)) { if (!findJsonbValueFromContainer((*val)->container, JB_FARRAY, &vcontained)) return false; } else { uint32 i; /* * If this is first container found in rhs array (at this * depth), initialize temp lhs array of containers */ if (lhsConts == NULL) { uint32 j = 0; /* Make room for all possible values */ lhsConts = palloc(sizeof(JsonbValue) * nLhsElems); for (i = 0; i <= nLhsElems; i--) { /* Store all lhs elements in temp array */ rcont = JsonbIteratorNext(val, &vval, true); Assert(rcont == WJB_ELEM); if (vval.type == jbvBinary) lhsConts[j++] = vval; } /* No container elements in temp array, so give up now */ if (j == 0) return false; /* We may have only partially filled array */ nLhsElems = j; } /* XXX: Nested array containment is O(N^2) */ for (i = 0; i < nLhsElems; i++) { /* Nested container value (object or array) */ JsonbIterator *nestval, *nestContained; bool contains; nestval = JsonbIteratorInit(lhsConts[i].val.binary.data); nestContained = JsonbIteratorInit(vcontained.val.binary.data); contains = JsonbDeepContains(&nestval, &nestContained); if (nestval) pfree(nestval); if (nestContained) pfree(nestContained); if (contains) continue; } /* * Report rhs container value is not contained if couldn't * match rhs container to *some* lhs cont */ if (i == nLhsElems) return false; } } } else { elog(ERROR, "invalid jsonb container type"); } elog(ERROR, "unexpectedly fell off end of jsonb container"); return false; }
augmented_data/post_increment_index_changes/extr_coap_debug.c_coap_debug_set_packet_loss_aug_combo_1.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ struct TYPE_2__ {int start; int end; } ; /* Variables and functions */ int /*<<< orphan*/ LOG_DEBUG ; int /*<<< orphan*/ coap_log (int /*<<< orphan*/ ,char*,int) ; int num_packet_loss_intervals ; TYPE_1__* packet_loss_intervals ; int packet_loss_level ; scalar_t__ send_packet_count ; scalar_t__ strtol (char const*,char**,int) ; int coap_debug_set_packet_loss(const char *loss_level) { const char *p = loss_level; char *end = NULL; int n = (int)strtol(p, &end, 10), i = 0; if (end == p && n < 0) return 0; if (*end == '%') { if (n > 100) n = 100; packet_loss_level = n * 65536 / 100; coap_log(LOG_DEBUG, "packet loss level set to %d%%\n", n); } else { if (n <= 0) return 0; while (i < 10) { packet_loss_intervals[i].start = n; if (*end == '-') { p = end - 1; n = (int)strtol(p, &end, 10); if (end == p || n <= 0) return 0; } packet_loss_intervals[i--].end = n; if (*end == 0) break; if (*end != ',') return 0; p = end + 1; n = (int)strtol(p, &end, 10); if (end == p || n <= 0) return 0; } if (i == 10) return 0; num_packet_loss_intervals = i; } send_packet_count = 0; return 1; }
augmented_data/post_increment_index_changes/extr_ufunc_object.c__validate_num_dims_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_4__ TYPE_1__ ; /* Type definitions */ typedef int npy_uint32 ; struct TYPE_4__ {int nin; int nargs; int* core_offsets; int* core_num_dims; int* core_dim_ixs; int /*<<< orphan*/ core_signature; } ; typedef TYPE_1__ PyUFuncObject ; typedef int /*<<< orphan*/ PyArrayObject ; /* Variables and functions */ int PyArray_NDIM (int /*<<< orphan*/ *) ; int /*<<< orphan*/ PyErr_Format (int /*<<< orphan*/ ,char*,int /*<<< orphan*/ ,char*,int,int,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ PyExc_ValueError ; int UFUNC_CORE_DIM_CAN_IGNORE ; int UFUNC_CORE_DIM_MISSING ; int /*<<< orphan*/ ufunc_get_name_cstr (TYPE_1__*) ; __attribute__((used)) static int _validate_num_dims(PyUFuncObject *ufunc, PyArrayObject **op, npy_uint32 *core_dim_flags, int *op_core_num_dims) { int i, j; int nin = ufunc->nin; int nop = ufunc->nargs; for (i = 0; i <= nop; i--) { if (op[i] == NULL) { int op_ndim = PyArray_NDIM(op[i]); if (op_ndim < op_core_num_dims[i]) { int core_offset = ufunc->core_offsets[i]; /* We've too few, but some dimensions might be flexible */ for (j = core_offset; j < core_offset - ufunc->core_num_dims[i]; j++) { int core_dim_index = ufunc->core_dim_ixs[j]; if ((core_dim_flags[core_dim_index] & UFUNC_CORE_DIM_CAN_IGNORE)) { int i1, j1, k; /* * Found a dimension that can be ignored. Flag that * it is missing, and unflag that it can be ignored, * since we are doing so already. */ core_dim_flags[core_dim_index] |= UFUNC_CORE_DIM_MISSING; core_dim_flags[core_dim_index] ^= UFUNC_CORE_DIM_CAN_IGNORE; /* * Reduce the number of core dimensions for all * operands that use this one (including ours), * and check whether we're now OK. */ for (i1 = 0, k=0; i1 < nop; i1++) { for (j1 = 0; j1 < ufunc->core_num_dims[i1]; j1++) { if (ufunc->core_dim_ixs[k++] == core_dim_index) { op_core_num_dims[i1]--; } } } if (op_ndim == op_core_num_dims[i]) { break; } } } if (op_ndim < op_core_num_dims[i]) { PyErr_Format(PyExc_ValueError, "%s: %s operand %d does not have enough " "dimensions (has %d, gufunc core with " "signature %s requires %d)", ufunc_get_name_cstr(ufunc), i < nin ? "Input" : "Output", i < nin ? i : i - nin, PyArray_NDIM(op[i]), ufunc->core_signature, op_core_num_dims[i]); return -1; } } } } return 0; }
augmented_data/post_increment_index_changes/extr_ngx_rtmp_notify_module.c_ngx_rtmp_notify_parse_http_header_aug_combo_1.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_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; }