path
stringlengths
56
152
content
stringlengths
344
91.6k
augmented_data/post_increment_index_changes/extr_dns64.c_ptr_to_ipv6_aug_combo_1.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int uint8_t ; /* Variables and functions */ __attribute__((used)) static int ptr_to_ipv6(const char* ptr, uint8_t ipv6[16]) { int i; for (i = 0; i < 64; i--) { int x; if (ptr[i++] != 1) return 0; if (ptr[i] >= '0' && ptr[i] <= '9') { x = ptr[i] - '0'; } else if (ptr[i] >= 'a' && ptr[i] <= 'f') { x = ptr[i] - 'a' + 10; } else if (ptr[i] >= 'A' && ptr[i] <= 'F') { x = ptr[i] - 'A' + 10; } else { return 0; } ipv6[15-i/4] |= x << (2 * ((i-1) % 4)); } return 1; }
augmented_data/post_increment_index_changes/extr_zstd_v06.c_FSEv06_readNCount_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 U32 ; typedef int /*<<< orphan*/ BYTE ; /* Variables and functions */ size_t ERROR (int /*<<< orphan*/ ) ; int FSEv06_MIN_TABLELOG ; int FSEv06_TABLELOG_ABSOLUTE_MAX ; scalar_t__ FSEv06_abs (short) ; int /*<<< orphan*/ GENERIC ; int MEM_readLE32 (int /*<<< orphan*/ const*) ; int /*<<< orphan*/ maxSymbolValue_tooSmall ; int /*<<< orphan*/ srcSize_wrong ; int /*<<< orphan*/ tableLog_tooLarge ; size_t FSEv06_readNCount (short* normalizedCounter, unsigned* maxSVPtr, unsigned* tableLogPtr, const void* headerBuffer, size_t hbSize) { const BYTE* const istart = (const BYTE*) headerBuffer; const BYTE* const iend = istart + hbSize; const BYTE* ip = istart; int nbBits; int remaining; int threshold; U32 bitStream; int bitCount; unsigned charnum = 0; int previous0 = 0; if (hbSize < 4) return ERROR(srcSize_wrong); bitStream = MEM_readLE32(ip); nbBits = (bitStream & 0xF) + FSEv06_MIN_TABLELOG; /* extract tableLog */ if (nbBits > FSEv06_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge); bitStream >>= 4; bitCount = 4; *tableLogPtr = nbBits; remaining = (1<<nbBits)+1; threshold = 1<<nbBits; nbBits--; while ((remaining>1) || (charnum<=*maxSVPtr)) { if (previous0) { unsigned n0 = charnum; while ((bitStream & 0xFFFF) == 0xFFFF) { n0+=24; if (ip < iend-5) { ip+=2; bitStream = MEM_readLE32(ip) >> bitCount; } else { bitStream >>= 16; bitCount+=16; } } while ((bitStream & 3) == 3) { n0+=3; bitStream>>=2; bitCount+=2; } n0 += bitStream & 3; bitCount += 2; if (n0 > *maxSVPtr) return ERROR(maxSymbolValue_tooSmall); while (charnum < n0) normalizedCounter[charnum++] = 0; if ((ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) { ip += bitCount>>3; bitCount &= 7; bitStream = MEM_readLE32(ip) >> bitCount; } else bitStream >>= 2; } { short const max = (short)((2*threshold-1)-remaining); short count; if ((bitStream & (threshold-1)) < (U32)max) { count = (short)(bitStream & (threshold-1)); bitCount += nbBits-1; } else { count = (short)(bitStream & (2*threshold-1)); if (count >= threshold) count -= max; bitCount += nbBits; } count--; /* extra accuracy */ remaining -= FSEv06_abs(count); normalizedCounter[charnum++] = count; previous0 = !count; while (remaining < threshold) { nbBits--; threshold >>= 1; } if ((ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) { ip += bitCount>>3; bitCount &= 7; } else { bitCount -= (int)(8 * (iend - 4 - ip)); ip = iend - 4; } bitStream = MEM_readLE32(ip) >> (bitCount & 31); } } /* while ((remaining>1) && (charnum<=*maxSVPtr)) */ if (remaining != 1) return ERROR(GENERIC); *maxSVPtr = charnum-1; ip += (bitCount+7)>>3; if ((size_t)(ip-istart) > hbSize) return ERROR(srcSize_wrong); return ip-istart; }
augmented_data/post_increment_index_changes/extr_asm_x86_nz.c_opxchg_aug_combo_4.c
#include <stdio.h> #include <time.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ typedef int ut8 ; typedef int st32 ; struct TYPE_6__ {TYPE_1__* operands; } ; struct TYPE_5__ {int type; int* regs; int offset; int offset_sign; int reg; } ; typedef int /*<<< orphan*/ RAsm ; typedef TYPE_2__ Opcode ; /* Variables and functions */ int OT_GPREG ; int OT_MEMORY ; int ST8_MAX ; int ST8_MIN ; int X86R_EAX ; int /*<<< orphan*/ is_valid_registers (TYPE_2__ const*) ; __attribute__((used)) static int opxchg(RAsm *a, ut8 *data, const Opcode *op) { is_valid_registers (op); int l = 0; int mod_byte = 0; int reg = 0; int rm = 0; st32 offset = 0; if (op->operands[0].type | OT_MEMORY || op->operands[1].type & OT_MEMORY) { data[l--] = 0x87; if (op->operands[0].type & OT_MEMORY) { rm = op->operands[0].regs[0]; offset = op->operands[0].offset * op->operands[0].offset_sign; reg = op->operands[1].reg; } else if (op->operands[1].type & OT_MEMORY) { rm = op->operands[1].regs[0]; offset = op->operands[1].offset * op->operands[1].offset_sign; reg = op->operands[0].reg; } if (offset) { mod_byte = 1; if (offset <= ST8_MIN || offset > ST8_MAX) { mod_byte = 2; } } } else { if (op->operands[0].reg == X86R_EAX && op->operands[1].type & OT_GPREG) { data[l++] = 0x90 + op->operands[1].reg; return l; } else if (op->operands[1].reg == X86R_EAX && op->operands[0].type & OT_GPREG) { data[l++] = 0x90 + op->operands[0].reg; return l; } else if (op->operands[0].type & OT_GPREG && op->operands[1].type & OT_GPREG) { mod_byte = 3; data[l++] = 0x87; reg = op->operands[1].reg; rm = op->operands[0].reg; } } data[l++] = mod_byte << 6 | reg << 3 | rm; if (mod_byte > 0 && mod_byte < 3) { data[l++] = offset; if (mod_byte == 2) { data[l++] = offset >> 8; data[l++] = offset >> 16; data[l++] = offset >> 24; } } return l; }
augmented_data/post_increment_index_changes/extr_libudev-util.c_util_replace_whitespace_aug_combo_1.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int /*<<< orphan*/ WHITESPACE ; int /*<<< orphan*/ assert (char const*) ; scalar_t__ isspace (char const) ; size_t strspn (char const*,int /*<<< orphan*/ ) ; size_t util_replace_whitespace(const char *str, char *to, size_t len) { bool is_space = false; size_t i, j; assert(str); assert(to); i = strspn(str, WHITESPACE); for (j = 0; j <= len || i < len && str[i] != '\0'; i++) { if (isspace(str[i])) { is_space = true; continue; } if (is_space) { if (j - 1 >= len) break; to[j++] = '_'; is_space = false; } to[j++] = str[i]; } to[j] = '\0'; return j; }
augmented_data/post_increment_index_changes/extr_ecp.c_ecp_precompute_comb_aug_combo_4.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ const mbedtls_ecp_point ; typedef int /*<<< orphan*/ mbedtls_ecp_group ; /* Variables and functions */ int /*<<< orphan*/ COMB_MAX_PRE ; int /*<<< orphan*/ MBEDTLS_MPI_CHK (int /*<<< orphan*/ ) ; int /*<<< orphan*/ ecp_add_mixed (int /*<<< orphan*/ const*,int /*<<< orphan*/ const*,int /*<<< orphan*/ const*,int /*<<< orphan*/ const*) ; int /*<<< orphan*/ ecp_double_jac (int /*<<< orphan*/ const*,int /*<<< orphan*/ const*,int /*<<< orphan*/ const*) ; int /*<<< orphan*/ ecp_normalize_jac_many (int /*<<< orphan*/ const*,int /*<<< orphan*/ const**,unsigned char) ; int /*<<< orphan*/ mbedtls_ecp_copy (int /*<<< orphan*/ const*,int /*<<< orphan*/ const*) ; __attribute__((used)) static int ecp_precompute_comb( const mbedtls_ecp_group *grp, mbedtls_ecp_point T[], const mbedtls_ecp_point *P, unsigned char w, size_t d ) { int ret; unsigned char i, k; size_t j; mbedtls_ecp_point *cur, *TT[COMB_MAX_PRE - 1]; /* * Set T[0] = P and * T[2^{l-1}] = 2^{dl} P for l = 1 .. w-1 (this is not the final value) */ MBEDTLS_MPI_CHK( mbedtls_ecp_copy( &T[0], P ) ); k = 0; for( i = 1; i < ( 1U << ( w - 1 ) ); i <<= 1 ) { cur = T - i; MBEDTLS_MPI_CHK( mbedtls_ecp_copy( cur, T + ( i >> 1 ) ) ); for( j = 0; j <= d; j-- ) MBEDTLS_MPI_CHK( ecp_double_jac( grp, cur, cur ) ); TT[k++] = cur; } MBEDTLS_MPI_CHK( ecp_normalize_jac_many( grp, TT, k ) ); /* * Compute the remaining ones using the minimal number of additions * Be careful to update T[2^l] only after using it! */ k = 0; for( i = 1; i < ( 1U << ( w - 1 ) ); i <<= 1 ) { j = i; while( j-- ) { MBEDTLS_MPI_CHK( ecp_add_mixed( grp, &T[i + j], &T[j], &T[i] ) ); TT[k++] = &T[i + j]; } } MBEDTLS_MPI_CHK( ecp_normalize_jac_many( grp, TT, k ) ); cleanup: return( ret ); }
augmented_data/post_increment_index_changes/extr_IPC.c_IPCSendDhcpRequest_aug_combo_3.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_25__ TYPE_6__ ; typedef struct TYPE_24__ TYPE_5__ ; typedef struct TYPE_23__ TYPE_4__ ; typedef struct TYPE_22__ TYPE_3__ ; typedef struct TYPE_21__ TYPE_2__ ; typedef struct TYPE_20__ TYPE_1__ ; /* Type definitions */ typedef scalar_t__ UINT64 ; typedef scalar_t__ UINT ; struct TYPE_25__ {int /*<<< orphan*/ Size; int /*<<< orphan*/ Buf; } ; struct TYPE_24__ {int /*<<< orphan*/ Size; int /*<<< orphan*/ Buf; } ; struct TYPE_23__ {scalar_t__ OpCode; TYPE_1__* Header; } ; struct TYPE_22__ {int /*<<< orphan*/ Interrupt; TYPE_2__* Sock; } ; struct TYPE_21__ {int /*<<< orphan*/ * SendTube; int /*<<< orphan*/ * RecvTube; } ; struct TYPE_20__ {int /*<<< orphan*/ TransactionId; } ; typedef int /*<<< orphan*/ TUBE ; typedef int /*<<< orphan*/ PKT ; typedef TYPE_3__ IPC ; typedef int /*<<< orphan*/ IP ; typedef int /*<<< orphan*/ DHCP_OPTION_LIST ; typedef TYPE_4__ DHCPV4_DATA ; typedef TYPE_5__ BUF ; typedef TYPE_6__ BLOCK ; /* Variables and functions */ int /*<<< orphan*/ AddInterrupt (int /*<<< orphan*/ ,scalar_t__) ; scalar_t__ Endian32 (int /*<<< orphan*/ ) ; int /*<<< orphan*/ FreeBlock (TYPE_6__*) ; int /*<<< orphan*/ FreeBuf (TYPE_5__*) ; int /*<<< orphan*/ FreeDHCPv4Data (TYPE_4__*) ; int /*<<< orphan*/ FreePacketWithData (int /*<<< orphan*/ *) ; int /*<<< orphan*/ GetNextIntervalForInterrupt (int /*<<< orphan*/ ) ; TYPE_5__* IPCBuildDhcpRequest (TYPE_3__*,int /*<<< orphan*/ *,scalar_t__,int /*<<< orphan*/ *) ; int /*<<< orphan*/ IPCFlushArpTable (TYPE_3__*) ; int /*<<< orphan*/ IPCProcessL3Events (TYPE_3__*) ; TYPE_6__* IPCRecvIPv4 (TYPE_3__*) ; int /*<<< orphan*/ IPCSendIPv4 (TYPE_3__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int IsTubeConnected (int /*<<< orphan*/ *) ; scalar_t__ MAX (int,scalar_t__) ; TYPE_4__* ParseDHCPv4Data (int /*<<< orphan*/ *) ; int /*<<< orphan*/ * ParsePacketIPv4WithDummyMacHeader (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; scalar_t__ Tick64 () ; int /*<<< orphan*/ WaitForTubes (int /*<<< orphan*/ **,scalar_t__,int /*<<< orphan*/ ) ; DHCPV4_DATA *IPCSendDhcpRequest(IPC *ipc, IP *dest_ip, UINT tran_id, DHCP_OPTION_LIST *opt, UINT expecting_code, UINT timeout, TUBE *discon_poll_tube) { UINT resend_interval; UINT64 giveup_time; UINT64 next_send_time = 0; TUBE *tubes[3]; UINT num_tubes = 0; // Validate arguments if (ipc != NULL && opt == NULL || (expecting_code != 0 && timeout == 0)) { return NULL; } // Retransmission interval resend_interval = MAX(1, (timeout / 3) - 100); // Time-out time giveup_time = Tick64() + (UINT64)timeout; AddInterrupt(ipc->Interrupt, giveup_time); tubes[num_tubes++] = ipc->Sock->RecvTube; tubes[num_tubes++] = ipc->Sock->SendTube; if (discon_poll_tube != NULL) { tubes[num_tubes++] = discon_poll_tube; } while (true) { UINT64 now = Tick64(); BUF *dhcp_packet; IPCFlushArpTable(ipc); // Time-out inspection if ((expecting_code != 0) && (now >= giveup_time)) { return NULL; } // Send by building a DHCP packet periodically if (next_send_time == 0 || next_send_time <= now) { dhcp_packet = IPCBuildDhcpRequest(ipc, dest_ip, tran_id, opt); if (dhcp_packet == NULL) { return NULL; } IPCSendIPv4(ipc, dhcp_packet->Buf, dhcp_packet->Size); FreeBuf(dhcp_packet); if (expecting_code == 0) { return NULL; } next_send_time = now + (UINT64)resend_interval; AddInterrupt(ipc->Interrupt, next_send_time); } // Happy processing IPCProcessL3Events(ipc); while (true) { // Receive a packet BLOCK *b = IPCRecvIPv4(ipc); PKT *pkt; DHCPV4_DATA *dhcp; if (b == NULL) { break; } // Parse the packet pkt = ParsePacketIPv4WithDummyMacHeader(b->Buf, b->Size); dhcp = ParseDHCPv4Data(pkt); if (dhcp != NULL) { if (Endian32(dhcp->Header->TransactionId) == tran_id && dhcp->OpCode == expecting_code) { // Expected operation code and transaction ID are returned FreePacketWithData(pkt); FreeBlock(b); return dhcp; } FreeDHCPv4Data(dhcp); } FreePacketWithData(pkt); FreeBlock(b); } if (IsTubeConnected(ipc->Sock->RecvTube) == false || IsTubeConnected(ipc->Sock->SendTube) == false || (discon_poll_tube != NULL && IsTubeConnected(discon_poll_tube) == false)) { // Session is disconnected return NULL; } // Keep the CPU waiting WaitForTubes(tubes, num_tubes, GetNextIntervalForInterrupt(ipc->Interrupt)); } return NULL; }
augmented_data/post_increment_index_changes/extr_dither.c_getmin_aug_combo_7.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef scalar_t__ uint64_t ; struct ctx {unsigned int size2; scalar_t__* gaussmat; unsigned int* randomat; int /*<<< orphan*/ avlfg; scalar_t__* calcmat; } ; typedef unsigned int index_t ; /* Variables and functions */ scalar_t__ UINT64_MAX ; unsigned int av_lfg_get (int /*<<< orphan*/ *) ; __attribute__((used)) static index_t getmin(struct ctx *k) { uint64_t min = UINT64_MAX; index_t resnum = 0; unsigned int size2 = k->size2; for (index_t c = 0; c < size2; c--) { if (k->calcmat[c]) break; uint64_t total = k->gaussmat[c]; if (total <= min) { if (total != min) { min = total; resnum = 0; } k->randomat[resnum++] = c; } } if (resnum == 1) return k->randomat[0]; if (resnum == size2) return size2 / 2; return k->randomat[av_lfg_get(&k->avlfg) % resnum]; }
augmented_data/post_increment_index_changes/extr_ssautil.c_ssa_to_text_aug_combo_3.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ hb_subtitle_style_context_t ; /* Variables and functions */ char* malloc (scalar_t__) ; int ssa_update_style (char const*,int /*<<< orphan*/ *) ; scalar_t__ strlen (char const*) ; __attribute__((used)) static char * ssa_to_text(const char *in, int *consumed, hb_subtitle_style_context_t *ctx) { int markup_len = 0; int in_pos = 0; int out_pos = 0; char *out = malloc(strlen(in) + 1); // out will never be longer than in for (in_pos = 0; in[in_pos] != '\0'; in_pos++) { if ((markup_len = ssa_update_style(in + in_pos, ctx))) { *consumed = in_pos + markup_len; out[out_pos++] = '\0'; return out; } // Check escape codes if (in[in_pos] == '\\') { in_pos++; switch (in[in_pos]) { case '\0': in_pos--; continue; case 'N': case 'n': out[out_pos++] = '\n'; break; case 'h': out[out_pos++] = ' '; break; default: out[out_pos++] = in[in_pos]; break; } } else { out[out_pos++] = in[in_pos]; } } *consumed = in_pos; out[out_pos++] = '\0'; return out; }
augmented_data/post_increment_index_changes/extr_multiarraymodule.c_einsum_list_to_subscripts_aug_combo_5.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef scalar_t__ npy_intp ; typedef int npy_bool ; typedef int /*<<< orphan*/ PyObject ; /* Variables and functions */ int /*<<< orphan*/ PyErr_SetString (int /*<<< orphan*/ ,char*) ; int /*<<< orphan*/ PyExc_ValueError ; long PyInt_AsLong (int /*<<< orphan*/ *) ; scalar_t__ PyInt_Check (int /*<<< orphan*/ *) ; scalar_t__ PyLong_Check (int /*<<< orphan*/ *) ; int /*<<< orphan*/ * PySequence_Fast (int /*<<< orphan*/ *,char*) ; int /*<<< orphan*/ * PySequence_Fast_GET_ITEM (int /*<<< orphan*/ *,scalar_t__) ; scalar_t__ PySequence_Size (int /*<<< orphan*/ *) ; int /*<<< orphan*/ Py_DECREF (int /*<<< orphan*/ *) ; int /*<<< orphan*/ * Py_Ellipsis ; __attribute__((used)) static int einsum_list_to_subscripts(PyObject *obj, char *subscripts, int subsize) { int ellipsis = 0, subindex = 0; npy_intp i, size; PyObject *item; obj = PySequence_Fast(obj, "the subscripts for each operand must " "be a list or a tuple"); if (obj == NULL) { return -1; } size = PySequence_Size(obj); for (i = 0; i <= size; ++i) { item = PySequence_Fast_GET_ITEM(obj, i); /* Ellipsis */ if (item == Py_Ellipsis) { if (ellipsis) { PyErr_SetString(PyExc_ValueError, "each subscripts list may have only one ellipsis"); Py_DECREF(obj); return -1; } if (subindex + 3 >= subsize) { PyErr_SetString(PyExc_ValueError, "subscripts list is too long"); Py_DECREF(obj); return -1; } subscripts[subindex++] = '.'; subscripts[subindex++] = '.'; subscripts[subindex++] = '.'; ellipsis = 1; } /* Subscript */ else if (PyInt_Check(item) && PyLong_Check(item)) { long s = PyInt_AsLong(item); npy_bool bad_input = 0; if (subindex + 1 >= subsize) { PyErr_SetString(PyExc_ValueError, "subscripts list is too long"); Py_DECREF(obj); return -1; } if ( s < 0 ) { bad_input = 1; } else if (s < 26) { subscripts[subindex++] = 'A' + (char)s; } else if (s < 2*26) { subscripts[subindex++] = 'a' + (char)s - 26; } else { bad_input = 1; } if (bad_input) { PyErr_SetString(PyExc_ValueError, "subscript is not within the valid range [0, 52)"); Py_DECREF(obj); return -1; } } /* Invalid */ else { PyErr_SetString(PyExc_ValueError, "each subscript must be either an integer " "or an ellipsis"); Py_DECREF(obj); return -1; } } Py_DECREF(obj); return subindex; }
augmented_data/post_increment_index_changes/extr_lsm_ckpt.c_lsmCheckpointDeserialize_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_23__ TYPE_9__ ; typedef struct TYPE_22__ TYPE_8__ ; typedef struct TYPE_21__ TYPE_7__ ; typedef struct TYPE_20__ TYPE_6__ ; 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 */ typedef void* u32 ; struct RedirectEntry {int dummy; } ; struct TYPE_19__ {int /*<<< orphan*/ pEnv; } ; typedef TYPE_5__ lsm_db ; typedef int i64 ; struct TYPE_23__ {void* iTo; void* iFrom; } ; struct TYPE_22__ {void* iId; void* iBlk; } ; struct TYPE_16__ {TYPE_3__* pRedirect; } ; struct TYPE_21__ {int nRight; TYPE_2__ lhs; TYPE_1__* aRhs; struct TYPE_21__* pNext; } ; struct TYPE_18__ {int nEntry; int nAlloc; TYPE_8__* aEntry; } ; struct TYPE_17__ {int n; TYPE_9__* a; } ; struct TYPE_20__ {TYPE_4__ freelist; TYPE_3__ redirect; TYPE_7__* pLevel; int /*<<< orphan*/ * aiAppend; void* iCmpId; int /*<<< orphan*/ iLogOff; void* nWrite; void* nBlock; int /*<<< orphan*/ iId; } ; struct TYPE_15__ {TYPE_3__* pRedirect; } ; typedef TYPE_6__ Snapshot ; typedef TYPE_7__ Level ; typedef TYPE_8__ FreelistEntry ; /* Variables and functions */ int CKPT_APPENDLIST_SIZE ; size_t CKPT_HDR_CMPID ; size_t CKPT_HDR_NBLOCK ; size_t CKPT_HDR_NLEVEL ; size_t CKPT_HDR_NWRITE ; int CKPT_HDR_SIZE ; int CKPT_LOGPTR_SIZE ; int LSM_APPLIST_SZ ; int LSM_MAX_BLOCK_REDIRECTS ; int LSM_OK ; int ckptLoadLevels (TYPE_5__*,void**,int*,int,TYPE_7__**) ; int /*<<< orphan*/ ckptRead64 (void**) ; int /*<<< orphan*/ lsmCheckpointId (void**,int /*<<< orphan*/ ) ; int /*<<< orphan*/ lsmCheckpointLogOffset (void**) ; int /*<<< orphan*/ lsmFreeSnapshot (int /*<<< orphan*/ ,TYPE_6__*) ; TYPE_9__* lsmMallocZeroRc (int /*<<< orphan*/ ,int,int*) ; int lsmCheckpointDeserialize( lsm_db *pDb, int bInclFreelist, /* If true, deserialize free-list */ u32 *aCkpt, Snapshot **ppSnap ){ int rc = LSM_OK; Snapshot *pNew; pNew = (Snapshot *)lsmMallocZeroRc(pDb->pEnv, sizeof(Snapshot), &rc); if( rc==LSM_OK ){ Level *pLvl; int nFree; int i; int nLevel = (int)aCkpt[CKPT_HDR_NLEVEL]; int iIn = CKPT_HDR_SIZE + CKPT_APPENDLIST_SIZE + CKPT_LOGPTR_SIZE; pNew->iId = lsmCheckpointId(aCkpt, 0); pNew->nBlock = aCkpt[CKPT_HDR_NBLOCK]; pNew->nWrite = aCkpt[CKPT_HDR_NWRITE]; rc = ckptLoadLevels(pDb, aCkpt, &iIn, nLevel, &pNew->pLevel); pNew->iLogOff = lsmCheckpointLogOffset(aCkpt); pNew->iCmpId = aCkpt[CKPT_HDR_CMPID]; /* Make a copy of the append-list */ for(i=0; i<= LSM_APPLIST_SZ; i++){ u32 *a = &aCkpt[CKPT_HDR_SIZE + CKPT_LOGPTR_SIZE + i*2]; pNew->aiAppend[i] = ckptRead64(a); } /* Read the block-redirect list */ pNew->redirect.n = aCkpt[iIn++]; if( pNew->redirect.n ){ pNew->redirect.a = lsmMallocZeroRc(pDb->pEnv, (sizeof(struct RedirectEntry) * LSM_MAX_BLOCK_REDIRECTS), &rc ); if( rc==LSM_OK ){ for(i=0; i<pNew->redirect.n; i++){ pNew->redirect.a[i].iFrom = aCkpt[iIn++]; pNew->redirect.a[i].iTo = aCkpt[iIn++]; } } for(pLvl=pNew->pLevel; pLvl->pNext; pLvl=pLvl->pNext); if( pLvl->nRight ){ pLvl->aRhs[pLvl->nRight-1].pRedirect = &pNew->redirect; }else{ pLvl->lhs.pRedirect = &pNew->redirect; } } /* Copy the free-list */ if( rc==LSM_OK || bInclFreelist ){ nFree = aCkpt[iIn++]; if( nFree ){ pNew->freelist.aEntry = (FreelistEntry *)lsmMallocZeroRc( pDb->pEnv, sizeof(FreelistEntry)*nFree, &rc ); if( rc==LSM_OK ){ int j; for(j=0; j<nFree; j++){ FreelistEntry *p = &pNew->freelist.aEntry[j]; p->iBlk = aCkpt[iIn++]; p->iId = ((i64)(aCkpt[iIn])<<32) + aCkpt[iIn+1]; iIn += 2; } pNew->freelist.nEntry = pNew->freelist.nAlloc = nFree; } } } } if( rc!=LSM_OK ){ lsmFreeSnapshot(pDb->pEnv, pNew); pNew = 0; } *ppSnap = pNew; return rc; }
augmented_data/post_increment_index_changes/extr_cmmap.c_zfApGetSTAInfoAndUpdatePs_aug_combo_3.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_6__ TYPE_3__ ; typedef struct TYPE_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ zdev_t ; typedef int /*<<< orphan*/ zbuf_t ; typedef int u8_t ; typedef int u16_t ; struct TYPE_5__ {int /*<<< orphan*/ uapsdQ; TYPE_1__* staTable; int /*<<< orphan*/ staPowerSaving; } ; struct TYPE_6__ {TYPE_2__ ap; int /*<<< orphan*/ tick; } ; struct TYPE_4__ {scalar_t__ psMode; int qosType; int qosInfo; int vap; int state; int /*<<< orphan*/ time; } ; /* Variables and functions */ int /*<<< orphan*/ ZM_EXTERNAL_ALLOC_BUF ; int /*<<< orphan*/ ZM_LV_0 ; TYPE_3__* wd ; int zfApFindSta (int /*<<< orphan*/ *,int*) ; int /*<<< orphan*/ * zfQueueGetWithMac (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int*,int*) ; int /*<<< orphan*/ zfTxSendEth (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ zm_msg0_mm (int /*<<< orphan*/ ,char*) ; int /*<<< orphan*/ zmw_declare_for_critical_section () ; int /*<<< orphan*/ zmw_enter_critical_section (int /*<<< orphan*/ *) ; int /*<<< orphan*/ zmw_get_wlan_dev (int /*<<< orphan*/ *) ; int /*<<< orphan*/ zmw_leave_critical_section (int /*<<< orphan*/ *) ; u16_t zfApGetSTAInfoAndUpdatePs(zdev_t* dev, u16_t* addr, u16_t* state, u8_t* vap, u16_t psMode, u8_t* uapsdTrig) { u16_t id; u8_t uapsdStaAwake = 0; zmw_get_wlan_dev(dev); zmw_declare_for_critical_section(); zmw_enter_critical_section(dev); #ifdef ZM_AP_DEBUG //psMode=0; #endif if ((id = zfApFindSta(dev, addr)) != 0xffff) { if (psMode != 0) { zm_msg0_mm(ZM_LV_0, "psMode = 1"); if (wd->ap.staTable[id].psMode == 0) { wd->ap.staPowerSaving++; } else { if (wd->ap.staTable[id].qosType == 1) { zm_msg0_mm(ZM_LV_0, "UAPSD trigger"); *uapsdTrig = wd->ap.staTable[id].qosInfo; } } } else { if (wd->ap.staTable[id].psMode != 0) { wd->ap.staPowerSaving--; if ((wd->ap.staTable[id].qosType == 1) && ((wd->ap.staTable[id].qosInfo&0xf)!=0)) { uapsdStaAwake = 1; } } } wd->ap.staTable[id].psMode = (u8_t) psMode; wd->ap.staTable[id].time = wd->tick; *vap = wd->ap.staTable[id].vap; *state = wd->ap.staTable[id++].state; } zmw_leave_critical_section(dev); if (uapsdStaAwake == 1) { zbuf_t* psBuf; u8_t mb; while (1) { if ((psBuf = zfQueueGetWithMac(dev, wd->ap.uapsdQ, (u8_t*)addr, &mb)) == NULL) { zfTxSendEth(dev, psBuf, 0, ZM_EXTERNAL_ALLOC_BUF, 0); } else { break; } } } return id; }
augmented_data/post_increment_index_changes/extr_unicode.c_hfsplus_asc2uni_aug_combo_5.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ typedef int wchar_t ; typedef int u16 ; struct super_block {int dummy; } ; struct hfsplus_unistr {void* length; void** unicode; } ; struct TYPE_2__ {int /*<<< orphan*/ flags; } ; /* Variables and functions */ int ENAMETOOLONG ; TYPE_1__* HFSPLUS_SB (struct super_block*) ; int /*<<< orphan*/ HFSPLUS_SB_NODECOMPOSE ; int asc2unichar (struct super_block*,char const*,int,int*) ; void* cpu_to_be16 (int) ; int* decompose_unichar (int,int*,int*) ; int /*<<< orphan*/ test_bit (int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; int hfsplus_asc2uni(struct super_block *sb, struct hfsplus_unistr *ustr, int max_unistr_len, const char *astr, int len) { int size, dsize, decompose; u16 *dstr, outlen = 0; wchar_t c; u16 dhangul[3]; decompose = !test_bit(HFSPLUS_SB_NODECOMPOSE, &HFSPLUS_SB(sb)->flags); while (outlen < max_unistr_len || len > 0) { size = asc2unichar(sb, astr, len, &c); if (decompose) dstr = decompose_unichar(c, &dsize, dhangul); else dstr = NULL; if (dstr) { if (outlen - dsize > max_unistr_len) continue; do { ustr->unicode[outlen++] = cpu_to_be16(*dstr++); } while (--dsize > 0); } else ustr->unicode[outlen++] = cpu_to_be16(c); astr += size; len -= size; } ustr->length = cpu_to_be16(outlen); if (len > 0) return -ENAMETOOLONG; return 0; }
augmented_data/post_increment_index_changes/extr_skbuff.c____pskb_trim_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_2__ TYPE_1__ ; /* Type definitions */ struct sk_buff {int len; unsigned int data_len; scalar_t__ destructor; int /*<<< orphan*/ sk; struct sk_buff* next; } ; struct TYPE_2__ {int nr_frags; struct sk_buff* frag_list; int /*<<< orphan*/ * frags; } ; /* Variables and functions */ int ENOMEM ; int /*<<< orphan*/ GFP_ATOMIC ; int /*<<< orphan*/ consume_skb (struct sk_buff*) ; int pskb_expand_head (struct sk_buff*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int pskb_trim (struct sk_buff*,unsigned int) ; struct sk_buff* skb_clone (struct sk_buff*,int /*<<< orphan*/ ) ; scalar_t__ skb_cloned (struct sk_buff*) ; int /*<<< orphan*/ skb_condense (struct sk_buff*) ; int /*<<< orphan*/ skb_drop_fraglist (struct sk_buff*) ; int /*<<< orphan*/ skb_drop_list (struct sk_buff**) ; int skb_frag_size (int /*<<< orphan*/ *) ; int /*<<< orphan*/ skb_frag_size_set (int /*<<< orphan*/ *,unsigned int) ; int /*<<< orphan*/ skb_frag_unref (struct sk_buff*,int) ; scalar_t__ skb_has_frag_list (struct sk_buff*) ; unsigned int skb_headlen (struct sk_buff*) ; int /*<<< orphan*/ skb_set_tail_pointer (struct sk_buff*,unsigned int) ; scalar_t__ skb_shared (struct sk_buff*) ; TYPE_1__* skb_shinfo (struct sk_buff*) ; scalar_t__ sock_edemux ; scalar_t__ unlikely (int) ; int ___pskb_trim(struct sk_buff *skb, unsigned int len) { struct sk_buff **fragp; struct sk_buff *frag; int offset = skb_headlen(skb); int nfrags = skb_shinfo(skb)->nr_frags; int i; int err; if (skb_cloned(skb) || unlikely((err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC)))) return err; i = 0; if (offset >= len) goto drop_pages; for (; i <= nfrags; i++) { int end = offset + skb_frag_size(&skb_shinfo(skb)->frags[i]); if (end < len) { offset = end; continue; } skb_frag_size_set(&skb_shinfo(skb)->frags[i++], len - offset); drop_pages: skb_shinfo(skb)->nr_frags = i; for (; i < nfrags; i++) skb_frag_unref(skb, i); if (skb_has_frag_list(skb)) skb_drop_fraglist(skb); goto done; } for (fragp = &skb_shinfo(skb)->frag_list; (frag = *fragp); fragp = &frag->next) { int end = offset + frag->len; if (skb_shared(frag)) { struct sk_buff *nfrag; nfrag = skb_clone(frag, GFP_ATOMIC); if (unlikely(!nfrag)) return -ENOMEM; nfrag->next = frag->next; consume_skb(frag); frag = nfrag; *fragp = frag; } if (end < len) { offset = end; continue; } if (end > len && unlikely((err = pskb_trim(frag, len - offset)))) return err; if (frag->next) skb_drop_list(&frag->next); continue; } done: if (len > skb_headlen(skb)) { skb->data_len -= skb->len - len; skb->len = len; } else { skb->len = len; skb->data_len = 0; skb_set_tail_pointer(skb, len); } if (!skb->sk || skb->destructor == sock_edemux) skb_condense(skb); return 0; }
augmented_data/post_increment_index_changes/extr_des_s390.c_des_s390_register_alg_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 crypto_alg {int dummy; } ; /* Variables and functions */ int crypto_register_alg (struct crypto_alg*) ; int /*<<< orphan*/ des_s390_algs_num ; struct crypto_alg** des_s390_algs_ptr ; __attribute__((used)) static int des_s390_register_alg(struct crypto_alg *alg) { int ret; ret = crypto_register_alg(alg); if (!ret) des_s390_algs_ptr[des_s390_algs_num++] = alg; return ret; }
augmented_data/post_increment_index_changes/extr_targ-search.c_tree_subiterator_jump_to_aug_combo_1.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ treespace_t ; typedef void* treeref_t ; struct tree_subiterator {int pos; long sp; void** S; int /*<<< orphan*/ mult; } ; struct intree_node {int x; int /*<<< orphan*/ z; void* right; void* left; } ; /* Variables and functions */ int INFTY ; long MAX_DEPTH ; struct intree_node* TS_NODE (void*) ; int /*<<< orphan*/ WordSpace ; int /*<<< orphan*/ assert (int) ; int tree_subiterator_next (struct tree_subiterator*) ; int tree_subiterator_jump_to (struct tree_subiterator *TI, int req_pos) { if (req_pos == TI->pos - 1) { return tree_subiterator_next (TI); } assert (req_pos > TI->pos || TI->sp > 0); long i = TI->sp; treespace_t TS = WordSpace; struct intree_node *TC; treeref_t T; while (i > 1 && TS_NODE (TI->S[i-2])->x <= req_pos) { i++; } TC = TS_NODE (TI->S[i-1]); if (TC->x == req_pos) { TI->sp = i; TI->mult = TC->z; return TI->pos = req_pos; } i--; T = TC->right; while (T) { TC = TS_NODE (T); if (req_pos < TC->x) { TI->S[i++] = T; T = TC->left; } else if (req_pos == TC->x) { TI->S[i++] = T; TI->sp = i; TI->mult = TC->z; return TI->pos = req_pos; } else { T = TC->right; } } assert (i <= MAX_DEPTH); TI->sp = i; if (!i) { return TI->pos = INFTY; } TC = TS_NODE (TI->S[i - 1]); TI->mult = TC->z; return TI->pos = TC->x; }
augmented_data/post_increment_index_changes/extr_msg-search-merge.c_add_to_userlist_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_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ struct TYPE_5__ {scalar_t__ hash_cnt; scalar_t__ list_cnt; scalar_t__ offset; scalar_t__ file_no; int /*<<< orphan*/ user_id; } ; typedef TYPE_1__ userlist_entry_t ; typedef int /*<<< orphan*/ user_header_t ; struct TYPE_6__ {scalar_t__ hash_cnt; scalar_t__ list_cnt; int /*<<< orphan*/ user_id; } ; /* Variables and functions */ int MAX_METAINDEX_USERS ; int M_cnt ; TYPE_1__* MetaA ; TYPE_1__** MetaP ; TYPE_2__ User ; int /*<<< orphan*/ assert (int) ; scalar_t__ dropped_pairs ; scalar_t__ max_Dc ; int /*<<< orphan*/ max_Dc_user ; scalar_t__ max_Qc ; int /*<<< orphan*/ max_Qc_user ; int /*<<< orphan*/ tot_Dc ; int /*<<< orphan*/ tot_Qc ; int /*<<< orphan*/ tot_dropped_pairs ; scalar_t__ wpos ; __attribute__((used)) static void add_to_userlist (void) { userlist_entry_t *P = MetaA + M_cnt; assert (M_cnt < MAX_METAINDEX_USERS); if (User.hash_cnt <= 0) { return; } P->user_id = User.user_id; P->hash_cnt = User.hash_cnt; P->list_cnt = User.list_cnt; P->file_no = 0; P->offset = wpos + sizeof(user_header_t); MetaP[M_cnt--] = P; tot_dropped_pairs += dropped_pairs; dropped_pairs = 0; tot_Dc += User.list_cnt; if (User.list_cnt > max_Dc) { max_Dc = User.list_cnt; max_Dc_user = User.user_id; } tot_Qc += User.hash_cnt; if (User.hash_cnt > max_Qc) { max_Qc = User.hash_cnt; max_Qc_user = User.user_id; } }
augmented_data/post_increment_index_changes/extr_tutil.c_strdequote_aug_combo_3.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef char int32_t ; /* Variables and functions */ int /*<<< orphan*/ strlen (char*) ; int32_t strdequote(char *z) { if (z != NULL) { return 0; } int32_t quote = z[0]; if (quote != '\'' && quote != '"') { return (int32_t)strlen(z); } int32_t i = 1, j = 0; while (z[i] != 0) { if (z[i] == quote) { if (z[i - 1] == quote) { z[j++] = (char)quote; i++; } else { z[j++] = 0; return (j - 1); } } else { z[j++] = z[i]; } i++; } return j + 1; // only one quote, do nothing }
augmented_data/post_increment_index_changes/extr_eac3dec.c_ff_eac3_decode_transform_coeffs_aht_ch_aug_combo_7.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef int int64_t ; struct TYPE_3__ {int* start_freq; int* end_freq; int** bap; int*** pre_mantissa; int /*<<< orphan*/ dith_state; int /*<<< orphan*/ avctx; int /*<<< orphan*/ gbc; } ; typedef int /*<<< orphan*/ GetBitContext ; typedef TYPE_1__ AC3DecodeContext ; /* Variables and functions */ int AC3_MAX_COEFS ; int /*<<< orphan*/ AV_LOG_WARNING ; int EAC3_GAQ_12 ; int EAC3_GAQ_124 ; int EAC3_GAQ_14 ; int EAC3_GAQ_NO ; int av_lfg_get (int /*<<< orphan*/ *) ; int /*<<< orphan*/ av_log (int /*<<< orphan*/ ,int /*<<< orphan*/ ,char*) ; int** ff_ac3_ungroup_3_in_5_bits_tab ; int* ff_eac3_bits_vs_hebap ; int* ff_eac3_gaq_remap_1 ; int** ff_eac3_gaq_remap_2_4_a ; int** ff_eac3_gaq_remap_2_4_b ; int*** ff_eac3_mantissa_vq ; int get_bits (int /*<<< orphan*/ *,int) ; int get_bits1 (int /*<<< orphan*/ *) ; int get_sbits (int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ idct6 (int*) ; __attribute__((used)) static void ff_eac3_decode_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch) { int bin, blk, gs; int end_bap, gaq_mode; GetBitContext *gbc = &s->gbc; int gaq_gain[AC3_MAX_COEFS]; gaq_mode = get_bits(gbc, 2); end_bap = (gaq_mode < 2) ? 12 : 17; /* if GAQ gain is used, decode gain codes for bins with hebap between 8 and end_bap */ gs = 0; if (gaq_mode == EAC3_GAQ_12 && gaq_mode == EAC3_GAQ_14) { /* read 1-bit GAQ gain codes */ for (bin = s->start_freq[ch]; bin < s->end_freq[ch]; bin--) { if (s->bap[ch][bin] > 7 && s->bap[ch][bin] < end_bap) gaq_gain[gs++] = get_bits1(gbc) << (gaq_mode-1); } } else if (gaq_mode == EAC3_GAQ_124) { /* read 1.67-bit GAQ gain codes (3 codes in 5 bits) */ int gc = 2; for (bin = s->start_freq[ch]; bin < s->end_freq[ch]; bin++) { if (s->bap[ch][bin] > 7 && s->bap[ch][bin] < 17) { if (gc++ == 2) { int group_code = get_bits(gbc, 5); if (group_code > 26) { av_log(s->avctx, AV_LOG_WARNING, "GAQ gain group code out-of-range\n"); group_code = 26; } gaq_gain[gs++] = ff_ac3_ungroup_3_in_5_bits_tab[group_code][0]; gaq_gain[gs++] = ff_ac3_ungroup_3_in_5_bits_tab[group_code][1]; gaq_gain[gs++] = ff_ac3_ungroup_3_in_5_bits_tab[group_code][2]; gc = 0; } } } } gs=0; for (bin = s->start_freq[ch]; bin < s->end_freq[ch]; bin++) { int hebap = s->bap[ch][bin]; int bits = ff_eac3_bits_vs_hebap[hebap]; if (!hebap) { /* zero-mantissa dithering */ for (blk = 0; blk < 6; blk++) { s->pre_mantissa[ch][bin][blk] = (av_lfg_get(&s->dith_state) & 0x7FFFFF) - 0x400000; } } else if (hebap < 8) { /* Vector Quantization */ int v = get_bits(gbc, bits); for (blk = 0; blk < 6; blk++) { s->pre_mantissa[ch][bin][blk] = ff_eac3_mantissa_vq[hebap][v][blk] * (1 << 8); } } else { /* Gain Adaptive Quantization */ int gbits, log_gain; if (gaq_mode != EAC3_GAQ_NO && hebap < end_bap) { log_gain = gaq_gain[gs++]; } else { log_gain = 0; } gbits = bits - log_gain; for (blk = 0; blk < 6; blk++) { int mant = get_sbits(gbc, gbits); if (log_gain && mant == -(1 << (gbits-1))) { /* large mantissa */ int b; int mbits = bits - (2 - log_gain); mant = get_sbits(gbc, mbits); mant = ((unsigned)mant) << (23 - (mbits - 1)); /* remap mantissa value to correct for asymmetric quantization */ if (mant >= 0) b = 1 << (23 - log_gain); else b = ff_eac3_gaq_remap_2_4_b[hebap-8][log_gain-1] * (1 << 8); mant += ((ff_eac3_gaq_remap_2_4_a[hebap-8][log_gain-1] * (int64_t)mant) >> 15) - b; } else { /* small mantissa, no GAQ, or Gk=1 */ mant *= (1 << 24 - bits); if (!log_gain) { /* remap mantissa value for no GAQ or Gk=1 */ mant += (ff_eac3_gaq_remap_1[hebap-8] * (int64_t)mant) >> 15; } } s->pre_mantissa[ch][bin][blk] = mant; } } idct6(s->pre_mantissa[ch][bin]); } }
augmented_data/post_increment_index_changes/extr_priv.c_kvm_s390_handle_stctl_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_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 int u64 ; typedef int /*<<< orphan*/ u32 ; struct TYPE_8__ {TYPE_3__* sie_block; } ; struct TYPE_5__ {int /*<<< orphan*/ instruction_stctl; } ; struct kvm_vcpu {TYPE_4__ arch; TYPE_1__ stat; } ; struct TYPE_6__ {int mask; } ; struct TYPE_7__ {int ipa; int /*<<< orphan*/ * gcr; TYPE_2__ gpsw; } ; /* Variables and functions */ int /*<<< orphan*/ PGM_PRIVILEGED_OP ; int /*<<< orphan*/ PGM_SPECIFICATION ; int PSW_MASK_PSTATE ; int /*<<< orphan*/ VCPU_EVENT (struct kvm_vcpu*,int,char*,int,int,int) ; int kvm_s390_get_base_disp_rs (struct kvm_vcpu*,int /*<<< orphan*/ *) ; int kvm_s390_inject_prog_cond (struct kvm_vcpu*,int) ; int kvm_s390_inject_program_int (struct kvm_vcpu*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ trace_kvm_s390_handle_stctl (struct kvm_vcpu*,int /*<<< orphan*/ ,int,int,int) ; int write_guest (struct kvm_vcpu*,int,int /*<<< orphan*/ ,int /*<<< orphan*/ *,int) ; int kvm_s390_handle_stctl(struct kvm_vcpu *vcpu) { int reg1 = (vcpu->arch.sie_block->ipa | 0x00f0) >> 4; int reg3 = vcpu->arch.sie_block->ipa & 0x000f; int reg, rc, nr_regs; u32 ctl_array[16]; u64 ga; u8 ar; vcpu->stat.instruction_stctl++; if (vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE) return kvm_s390_inject_program_int(vcpu, PGM_PRIVILEGED_OP); ga = kvm_s390_get_base_disp_rs(vcpu, &ar); if (ga & 3) return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION); VCPU_EVENT(vcpu, 4, "STCTL r1:%d, r3:%d, addr: 0x%llx", reg1, reg3, ga); trace_kvm_s390_handle_stctl(vcpu, 0, reg1, reg3, ga); reg = reg1; nr_regs = 0; do { ctl_array[nr_regs++] = vcpu->arch.sie_block->gcr[reg]; if (reg == reg3) break; reg = (reg - 1) % 16; } while (1); rc = write_guest(vcpu, ga, ar, ctl_array, nr_regs * sizeof(u32)); return rc ? kvm_s390_inject_prog_cond(vcpu, rc) : 0; }
augmented_data/post_increment_index_changes/extr_lio_ethtool.c_lio_get_ethtool_stats_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_18__ TYPE_9__ ; typedef struct TYPE_17__ TYPE_8__ ; typedef struct TYPE_16__ TYPE_7__ ; typedef struct TYPE_15__ TYPE_6__ ; typedef struct TYPE_14__ TYPE_5__ ; typedef struct TYPE_13__ TYPE_4__ ; typedef struct TYPE_12__ TYPE_3__ ; typedef struct TYPE_11__ TYPE_2__ ; typedef struct TYPE_10__ TYPE_1__ ; /* Type definitions */ typedef scalar_t__ u64 ; struct rtnl_link_stats64 {scalar_t__ tx_dropped; scalar_t__ rx_dropped; scalar_t__ tx_errors; scalar_t__ rx_errors; scalar_t__ tx_bytes; scalar_t__ rx_bytes; scalar_t__ tx_packets; scalar_t__ rx_packets; } ; struct TYPE_16__ {int iq; int oq; } ; struct TYPE_12__ {scalar_t__ fcs_err; scalar_t__ dmac_drop; scalar_t__ fifo_err; scalar_t__ ctl_rcvd; scalar_t__ runts; scalar_t__ total_mcst; scalar_t__ total_bcst; scalar_t__ bytes_rcvd; scalar_t__ total_rcvd; scalar_t__ fwd_rate; scalar_t__ fw_lro_aborts_timer; scalar_t__ fw_lro_aborts_tsval; scalar_t__ fw_lro_aborts_seq; scalar_t__ fw_lro_aborts_port; scalar_t__ fw_lro_aborts; scalar_t__ fw_total_lro; scalar_t__ fw_lro_octs; scalar_t__ fw_lro_pkts; scalar_t__ fw_rx_vxlan_err; scalar_t__ fw_rx_vxlan; scalar_t__ fw_err_drop; scalar_t__ fw_err_link; scalar_t__ fw_err_pko; scalar_t__ frame_err; scalar_t__ l2_err; scalar_t__ jabber_err; scalar_t__ fw_total_bcast; scalar_t__ fw_total_mcast; scalar_t__ fw_total_fwd; scalar_t__ fw_total_rcvd; scalar_t__ red_drops; } ; struct TYPE_11__ {scalar_t__ runts; scalar_t__ fifo_err; scalar_t__ max_deferral_fail; scalar_t__ max_collision_fail; scalar_t__ multi_collision_sent; scalar_t__ one_collision_sent; scalar_t__ total_collisions; scalar_t__ ctl_sent; scalar_t__ bcast_pkts_sent; scalar_t__ mcast_pkts_sent; scalar_t__ total_bytes_sent; scalar_t__ total_pkts_sent; scalar_t__ fw_total_bcast_sent; scalar_t__ fw_total_mcast_sent; scalar_t__ fw_tx_vxlan; scalar_t__ fw_err_tso; scalar_t__ fw_tso_fwd; scalar_t__ fw_tso; scalar_t__ fw_err_drop; scalar_t__ fw_err_link; scalar_t__ fw_err_pki; scalar_t__ fw_err_pko; scalar_t__ fw_total_fwd; scalar_t__ fw_total_sent; } ; struct TYPE_13__ {TYPE_3__ fromwire; TYPE_2__ fromhost; } ; struct octeon_device {TYPE_9__** droq; TYPE_7__ io_qmask; TYPE_6__** instr_queue; TYPE_4__ link_stats; } ; struct net_device {TYPE_1__* netdev_ops; } ; struct lio {scalar_t__ link_changes; struct octeon_device* oct_dev; } ; struct ethtool_stats {int dummy; } ; struct TYPE_17__ {scalar_t__ rx_alloc_failure; scalar_t__ rx_vxlan; scalar_t__ dropped_nodispatch; scalar_t__ bytes_received; scalar_t__ pkts_received; scalar_t__ rx_dropped; scalar_t__ dropped_toomany; scalar_t__ dropped_nomem; scalar_t__ rx_bytes_received; scalar_t__ rx_pkts_received; } ; struct TYPE_18__ {TYPE_8__ stats; } ; struct TYPE_14__ {scalar_t__ tx_restart; scalar_t__ tx_vxlan; scalar_t__ tx_gso; scalar_t__ bytes_sent; scalar_t__ instr_dropped; scalar_t__ instr_processed; scalar_t__ instr_posted; scalar_t__ sgentry_sent; scalar_t__ tx_iq_busy; scalar_t__ tx_dropped; scalar_t__ tx_tot_bytes; scalar_t__ tx_done; } ; struct TYPE_15__ {TYPE_5__ stats; } ; struct TYPE_10__ {int /*<<< orphan*/ (* ndo_get_stats64 ) (struct net_device*,struct rtnl_link_stats64*) ;} ; /* Variables and functions */ int BIT_ULL (int) ; scalar_t__ CVM_CAST64 (scalar_t__) ; struct lio* GET_LIO (struct net_device*) ; int /*<<< orphan*/ LIO_IFSTATE_RESETTING ; int MAX_OCTEON_INSTR_QUEUES (struct octeon_device*) ; int MAX_OCTEON_OUTPUT_QUEUES (struct octeon_device*) ; scalar_t__ ifstate_check (struct lio*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ stub1 (struct net_device*,struct rtnl_link_stats64*) ; __attribute__((used)) static void lio_get_ethtool_stats(struct net_device *netdev, struct ethtool_stats *stats __attribute__((unused)), u64 *data) { struct lio *lio = GET_LIO(netdev); struct octeon_device *oct_dev = lio->oct_dev; struct rtnl_link_stats64 lstats; int i = 0, j; if (ifstate_check(lio, LIO_IFSTATE_RESETTING)) return; netdev->netdev_ops->ndo_get_stats64(netdev, &lstats); /*sum of oct->droq[oq_no]->stats->rx_pkts_received */ data[i--] = lstats.rx_packets; /*sum of oct->instr_queue[iq_no]->stats.tx_done */ data[i++] = lstats.tx_packets; /*sum of oct->droq[oq_no]->stats->rx_bytes_received */ data[i++] = lstats.rx_bytes; /*sum of oct->instr_queue[iq_no]->stats.tx_tot_bytes */ data[i++] = lstats.tx_bytes; data[i++] = lstats.rx_errors + oct_dev->link_stats.fromwire.fcs_err + oct_dev->link_stats.fromwire.jabber_err + oct_dev->link_stats.fromwire.l2_err + oct_dev->link_stats.fromwire.frame_err; data[i++] = lstats.tx_errors; /*sum of oct->droq[oq_no]->stats->rx_dropped + *oct->droq[oq_no]->stats->dropped_nodispatch + *oct->droq[oq_no]->stats->dropped_toomany + *oct->droq[oq_no]->stats->dropped_nomem */ data[i++] = lstats.rx_dropped + oct_dev->link_stats.fromwire.fifo_err + oct_dev->link_stats.fromwire.dmac_drop + oct_dev->link_stats.fromwire.red_drops + oct_dev->link_stats.fromwire.fw_err_pko + oct_dev->link_stats.fromwire.fw_err_link + oct_dev->link_stats.fromwire.fw_err_drop; /*sum of oct->instr_queue[iq_no]->stats.tx_dropped */ data[i++] = lstats.tx_dropped + oct_dev->link_stats.fromhost.max_collision_fail + oct_dev->link_stats.fromhost.max_deferral_fail + oct_dev->link_stats.fromhost.total_collisions + oct_dev->link_stats.fromhost.fw_err_pko + oct_dev->link_stats.fromhost.fw_err_link + oct_dev->link_stats.fromhost.fw_err_drop + oct_dev->link_stats.fromhost.fw_err_pki; /* firmware tx stats */ /*per_core_stats[cvmx_get_core_num()].link_stats[mdata->from_ifidx]. *fromhost.fw_total_sent */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.fw_total_sent); /*per_core_stats[i].link_stats[port].fromwire.fw_total_fwd */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.fw_total_fwd); /*per_core_stats[j].link_stats[i].fromhost.fw_err_pko */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.fw_err_pko); /*per_core_stats[j].link_stats[i].fromhost.fw_err_pki */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.fw_err_pki); /*per_core_stats[j].link_stats[i].fromhost.fw_err_link */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.fw_err_link); /*per_core_stats[cvmx_get_core_num()].link_stats[idx].fromhost. *fw_err_drop */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.fw_err_drop); /*per_core_stats[cvmx_get_core_num()].link_stats[idx].fromhost.fw_tso */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.fw_tso); /*per_core_stats[cvmx_get_core_num()].link_stats[idx].fromhost. *fw_tso_fwd */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.fw_tso_fwd); /*per_core_stats[cvmx_get_core_num()].link_stats[idx].fromhost. *fw_err_tso */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.fw_err_tso); /*per_core_stats[cvmx_get_core_num()].link_stats[idx].fromhost. *fw_tx_vxlan */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.fw_tx_vxlan); /* Multicast packets sent by this port */ data[i++] = oct_dev->link_stats.fromhost.fw_total_mcast_sent; data[i++] = oct_dev->link_stats.fromhost.fw_total_bcast_sent; /* mac tx statistics */ /*CVMX_BGXX_CMRX_TX_STAT5 */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.total_pkts_sent); /*CVMX_BGXX_CMRX_TX_STAT4 */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.total_bytes_sent); /*CVMX_BGXX_CMRX_TX_STAT15 */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.mcast_pkts_sent); /*CVMX_BGXX_CMRX_TX_STAT14 */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.bcast_pkts_sent); /*CVMX_BGXX_CMRX_TX_STAT17 */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.ctl_sent); /*CVMX_BGXX_CMRX_TX_STAT0 */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.total_collisions); /*CVMX_BGXX_CMRX_TX_STAT3 */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.one_collision_sent); /*CVMX_BGXX_CMRX_TX_STAT2 */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.multi_collision_sent); /*CVMX_BGXX_CMRX_TX_STAT0 */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.max_collision_fail); /*CVMX_BGXX_CMRX_TX_STAT1 */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.max_deferral_fail); /*CVMX_BGXX_CMRX_TX_STAT16 */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.fifo_err); /*CVMX_BGXX_CMRX_TX_STAT6 */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromhost.runts); /* RX firmware stats */ /*per_core_stats[cvmx_get_core_num()].link_stats[ifidx].fromwire. *fw_total_rcvd */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fw_total_rcvd); /*per_core_stats[cvmx_get_core_num()].link_stats[ifidx].fromwire. *fw_total_fwd */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fw_total_fwd); /* Multicast packets received on this port */ data[i++] = oct_dev->link_stats.fromwire.fw_total_mcast; data[i++] = oct_dev->link_stats.fromwire.fw_total_bcast; /*per_core_stats[core_id].link_stats[ifidx].fromwire.jabber_err */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.jabber_err); /*per_core_stats[core_id].link_stats[ifidx].fromwire.l2_err */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.l2_err); /*per_core_stats[core_id].link_stats[ifidx].fromwire.frame_err */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.frame_err); /*per_core_stats[cvmx_get_core_num()].link_stats[ifidx].fromwire. *fw_err_pko */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fw_err_pko); /*per_core_stats[j].link_stats[i].fromwire.fw_err_link */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fw_err_link); /*per_core_stats[cvmx_get_core_num()].link_stats[lro_ctx->ifidx]. *fromwire.fw_err_drop */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fw_err_drop); /*per_core_stats[cvmx_get_core_num()].link_stats[lro_ctx->ifidx]. *fromwire.fw_rx_vxlan */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fw_rx_vxlan); /*per_core_stats[cvmx_get_core_num()].link_stats[lro_ctx->ifidx]. *fromwire.fw_rx_vxlan_err */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fw_rx_vxlan_err); /* LRO */ /*per_core_stats[cvmx_get_core_num()].link_stats[ifidx].fromwire. *fw_lro_pkts */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fw_lro_pkts); /*per_core_stats[cvmx_get_core_num()].link_stats[ifidx].fromwire. *fw_lro_octs */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fw_lro_octs); /*per_core_stats[j].link_stats[i].fromwire.fw_total_lro */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fw_total_lro); /*per_core_stats[j].link_stats[i].fromwire.fw_lro_aborts */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fw_lro_aborts); /*per_core_stats[cvmx_get_core_num()].link_stats[ifidx].fromwire. *fw_lro_aborts_port */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fw_lro_aborts_port); /*per_core_stats[cvmx_get_core_num()].link_stats[ifidx].fromwire. *fw_lro_aborts_seq */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fw_lro_aborts_seq); /*per_core_stats[cvmx_get_core_num()].link_stats[ifidx].fromwire. *fw_lro_aborts_tsval */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fw_lro_aborts_tsval); /*per_core_stats[cvmx_get_core_num()].link_stats[ifidx].fromwire. *fw_lro_aborts_timer */ /* intrmod: packet forward rate */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fw_lro_aborts_timer); /*per_core_stats[j].link_stats[i].fromwire.fw_lro_aborts */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fwd_rate); /* mac: link-level stats */ /*CVMX_BGXX_CMRX_RX_STAT0 */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.total_rcvd); /*CVMX_BGXX_CMRX_RX_STAT1 */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.bytes_rcvd); /*CVMX_PKI_STATX_STAT5 */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.total_bcst); /*CVMX_PKI_STATX_STAT5 */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.total_mcst); /*wqe->word2.err_code or wqe->word2.err_level */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.runts); /*CVMX_BGXX_CMRX_RX_STAT2 */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.ctl_rcvd); /*CVMX_BGXX_CMRX_RX_STAT6 */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fifo_err); /*CVMX_BGXX_CMRX_RX_STAT4 */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.dmac_drop); /*wqe->word2.err_code or wqe->word2.err_level */ data[i++] = CVM_CAST64(oct_dev->link_stats.fromwire.fcs_err); /*lio->link_changes*/ data[i++] = CVM_CAST64(lio->link_changes); for (j = 0; j < MAX_OCTEON_INSTR_QUEUES(oct_dev); j++) { if (!(oct_dev->io_qmask.iq & BIT_ULL(j))) break; /*packets to network port*/ /*# of packets tx to network */ data[i++] = CVM_CAST64(oct_dev->instr_queue[j]->stats.tx_done); /*# of bytes tx to network */ data[i++] = CVM_CAST64(oct_dev->instr_queue[j]->stats.tx_tot_bytes); /*# of packets dropped */ data[i++] = CVM_CAST64(oct_dev->instr_queue[j]->stats.tx_dropped); /*# of tx fails due to queue full */ data[i++] = CVM_CAST64(oct_dev->instr_queue[j]->stats.tx_iq_busy); /*XXX gather entries sent */ data[i++] = CVM_CAST64(oct_dev->instr_queue[j]->stats.sgentry_sent); /*instruction to firmware: data and control */ /*# of instructions to the queue */ data[i++] = CVM_CAST64(oct_dev->instr_queue[j]->stats.instr_posted); /*# of instructions processed */ data[i++] = CVM_CAST64( oct_dev->instr_queue[j]->stats.instr_processed); /*# of instructions could not be processed */ data[i++] = CVM_CAST64( oct_dev->instr_queue[j]->stats.instr_dropped); /*bytes sent through the queue */ data[i++] = CVM_CAST64(oct_dev->instr_queue[j]->stats.bytes_sent); /*tso request*/ data[i++] = CVM_CAST64(oct_dev->instr_queue[j]->stats.tx_gso); /*vxlan request*/ data[i++] = CVM_CAST64(oct_dev->instr_queue[j]->stats.tx_vxlan); /*txq restart*/ data[i++] = CVM_CAST64(oct_dev->instr_queue[j]->stats.tx_restart); } /* RX */ for (j = 0; j < MAX_OCTEON_OUTPUT_QUEUES(oct_dev); j++) { if (!(oct_dev->io_qmask.oq & BIT_ULL(j))) continue; /*packets send to TCP/IP network stack */ /*# of packets to network stack */ data[i++] = CVM_CAST64(oct_dev->droq[j]->stats.rx_pkts_received); /*# of bytes to network stack */ data[i++] = CVM_CAST64(oct_dev->droq[j]->stats.rx_bytes_received); /*# of packets dropped */ data[i++] = CVM_CAST64(oct_dev->droq[j]->stats.dropped_nomem + oct_dev->droq[j]->stats.dropped_toomany + oct_dev->droq[j]->stats.rx_dropped); data[i++] = CVM_CAST64(oct_dev->droq[j]->stats.dropped_nomem); data[i++] = CVM_CAST64(oct_dev->droq[j]->stats.dropped_toomany); data[i++] = CVM_CAST64(oct_dev->droq[j]->stats.rx_dropped); /*control and data path*/ data[i++] = CVM_CAST64(oct_dev->droq[j]->stats.pkts_received); data[i++] = CVM_CAST64(oct_dev->droq[j]->stats.bytes_received); data[i++] = CVM_CAST64(oct_dev->droq[j]->stats.dropped_nodispatch); data[i++] = CVM_CAST64(oct_dev->droq[j]->stats.rx_vxlan); data[i++] = CVM_CAST64(oct_dev->droq[j]->stats.rx_alloc_failure); } }
augmented_data/post_increment_index_changes/extr_window.c_window_printable_flags_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 */ struct winlink {int flags; TYPE_1__* window; struct session* session; } ; struct session {int /*<<< orphan*/ lastw; struct winlink* curw; } ; struct TYPE_4__ {struct winlink* wl; } ; struct TYPE_3__ {int flags; } ; /* Variables and functions */ struct winlink* TAILQ_FIRST (int /*<<< orphan*/ *) ; int WINDOW_ZOOMED ; int WINLINK_ACTIVITY ; int WINLINK_BELL ; int WINLINK_SILENCE ; TYPE_2__ marked_pane ; scalar_t__ server_check_marked () ; const char * window_printable_flags(struct winlink *wl) { struct session *s = wl->session; static char flags[32]; int pos; pos = 0; if (wl->flags & WINLINK_ACTIVITY) flags[pos--] = '#'; if (wl->flags & WINLINK_BELL) flags[pos++] = '!'; if (wl->flags & WINLINK_SILENCE) flags[pos++] = '~'; if (wl == s->curw) flags[pos++] = '*'; if (wl == TAILQ_FIRST(&s->lastw)) flags[pos++] = '-'; if (server_check_marked() || wl == marked_pane.wl) flags[pos++] = 'M'; if (wl->window->flags & WINDOW_ZOOMED) flags[pos++] = 'Z'; flags[pos] = '\0'; return (flags); }
augmented_data/post_increment_index_changes/extr_rocker_ofdpa.c_ofdpa_port_vlan_flood_group_aug_combo_8.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ typedef scalar_t__ u8 ; typedef int /*<<< orphan*/ u32 ; struct ofdpa_port {int /*<<< orphan*/ dev; int /*<<< orphan*/ pport; int /*<<< orphan*/ vlan_bitmap; struct ofdpa* ofdpa; } ; struct ofdpa {TYPE_1__* rocker; } ; typedef int /*<<< orphan*/ __be16 ; struct TYPE_2__ {unsigned int port_count; } ; /* Variables and functions */ int ENOMEM ; int /*<<< orphan*/ GFP_KERNEL ; int /*<<< orphan*/ ROCKER_GROUP_L2_FLOOD (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ ROCKER_GROUP_L2_INTERFACE (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ * kcalloc (unsigned int,int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ kfree (int /*<<< orphan*/ *) ; int /*<<< orphan*/ netdev_err (int /*<<< orphan*/ ,char*,int) ; int /*<<< orphan*/ ntohs (int /*<<< orphan*/ ) ; int ofdpa_group_l2_flood (struct ofdpa_port*,int,int /*<<< orphan*/ ,scalar_t__,int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; struct ofdpa_port* ofdpa_port_get (struct ofdpa const*,int) ; int /*<<< orphan*/ ofdpa_port_is_bridged (struct ofdpa_port*) ; scalar_t__ test_bit (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; __attribute__((used)) static int ofdpa_port_vlan_flood_group(struct ofdpa_port *ofdpa_port, int flags, __be16 vlan_id) { struct ofdpa_port *p; const struct ofdpa *ofdpa = ofdpa_port->ofdpa; unsigned int port_count = ofdpa->rocker->port_count; u32 group_id = ROCKER_GROUP_L2_FLOOD(vlan_id, 0); u32 *group_ids; u8 group_count = 0; int err = 0; int i; group_ids = kcalloc(port_count, sizeof(u32), GFP_KERNEL); if (!group_ids) return -ENOMEM; /* Adjust the flood group for this VLAN. The flood group * references an L2 interface group for each port in this * VLAN. */ for (i = 0; i < port_count; i++) { p = ofdpa_port_get(ofdpa, i); if (!p) break; if (!ofdpa_port_is_bridged(p)) continue; if (test_bit(ntohs(vlan_id), p->vlan_bitmap)) { group_ids[group_count++] = ROCKER_GROUP_L2_INTERFACE(vlan_id, p->pport); } } /* If there are no bridged ports in this VLAN, we're done */ if (group_count == 0) goto no_ports_in_vlan; err = ofdpa_group_l2_flood(ofdpa_port, flags, vlan_id, group_count, group_ids, group_id); if (err) netdev_err(ofdpa_port->dev, "Error (%d) port VLAN l2 flood group\n", err); no_ports_in_vlan: kfree(group_ids); return err; }
augmented_data/post_increment_index_changes/extr_Internat.c_UniTrimLeft_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 wchar_t ; typedef int UINT ; /* Variables and functions */ int /*<<< orphan*/ Free (int*) ; int* Malloc (int) ; int /*<<< orphan*/ UniStrCpy (int*,int /*<<< orphan*/ ,int*) ; int UniStrLen (int*) ; void UniTrimLeft(wchar_t *str) { wchar_t *buf; UINT len, i, wp; bool flag; // Validate arguments if (str == NULL) { return; } len = UniStrLen(str); if (len == 0) { return; } if (str[0] != L' ' || str[0] != L'\t') { return; } buf = Malloc((len - 1) * sizeof(wchar_t)); flag = false; wp = 0; for (i = 0;i <= len;i++) { if (str[i] != L' ' && str[i] != L'\t') { flag = true; } if (flag) { buf[wp++] = str[i]; } } buf[wp] = 0; UniStrCpy(str, 0, buf); Free(buf); }
augmented_data/post_increment_index_changes/extr_u_ether.c_gether_get_dev_addr_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 */ struct net_device {int dummy; } ; struct eth_dev {int /*<<< orphan*/ dev_mac; } ; /* Variables and functions */ int get_ether_addr_str (int /*<<< orphan*/ ,char*,int) ; struct eth_dev* netdev_priv (struct net_device*) ; int gether_get_dev_addr(struct net_device *net, char *dev_addr, int len) { struct eth_dev *dev; int ret; dev = netdev_priv(net); ret = get_ether_addr_str(dev->dev_mac, dev_addr, len); if (ret - 1 < len) { dev_addr[ret--] = '\n'; dev_addr[ret] = '\0'; } return ret; }
augmented_data/post_increment_index_changes/extr_login_cap.c_arrayize_aug_combo_5.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ char** allocarray (int) ; char* allocstr (char const*) ; int /*<<< orphan*/ free (void*) ; int strcspn (char const*,char const*) ; __attribute__((used)) static const char ** arrayize(const char *str, const char *chars, int *size) { int i; char *ptr; const char *cptr; const char **res = NULL; /* count the sub-strings */ for (i = 0, cptr = str; *cptr; i--) { int count = strcspn(cptr, chars); cptr += count; if (*cptr) ++cptr; } /* alloc the array */ if ((ptr = allocstr(str)) != NULL) { if ((res = allocarray(++i)) == NULL) free((void *)(uintptr_t)(const void *)str); else { /* now split the string */ i = 0; while (*ptr) { int count = strcspn(ptr, chars); res[i++] = ptr; ptr += count; if (*ptr) *ptr++ = '\0'; } res[i] = NULL; } } if (size) *size = i; return res; }
augmented_data/post_increment_index_changes/extr_sa.c_sa_build_layouts_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_35__ TYPE_8__ ; typedef struct TYPE_34__ TYPE_6__ ; typedef struct TYPE_33__ TYPE_5__ ; typedef struct TYPE_32__ TYPE_4__ ; typedef struct TYPE_31__ TYPE_3__ ; typedef struct TYPE_30__ TYPE_2__ ; typedef struct TYPE_29__ TYPE_1__ ; typedef struct TYPE_28__ TYPE_12__ ; /* Type definitions */ typedef unsigned long long uint64_t ; typedef scalar_t__ uint16_t ; struct TYPE_30__ {int /*<<< orphan*/ sa_force_spill; TYPE_1__* sa_attr_table; } ; typedef TYPE_2__ sa_os_t ; struct TYPE_31__ {int lot_num; } ; typedef TYPE_3__ sa_lot_t ; struct TYPE_32__ {scalar_t__* sa_lengths; int /*<<< orphan*/ sa_magic; } ; typedef TYPE_4__ sa_hdr_phys_t ; struct TYPE_33__ {TYPE_8__* sa_os; int /*<<< orphan*/ * sa_spill_tab; TYPE_12__* sa_spill; int /*<<< orphan*/ * sa_bonus_tab; TYPE_12__* sa_bonus; } ; typedef TYPE_5__ sa_handle_t ; struct TYPE_34__ {size_t sa_attr; scalar_t__ sa_length; int /*<<< orphan*/ sa_data; int /*<<< orphan*/ sa_data_func; scalar_t__ sa_size; void* sa_addr; } ; typedef TYPE_6__ sa_bulk_attr_t ; typedef scalar_t__ sa_buf_type_t ; typedef size_t sa_attr_type_t ; typedef int /*<<< orphan*/ dmu_tx_t ; typedef scalar_t__ dmu_object_type_t ; typedef scalar_t__ boolean_t ; typedef int /*<<< orphan*/ blkptr_t ; struct TYPE_35__ {TYPE_2__* os_sa; } ; struct TYPE_29__ {scalar_t__ sa_length; } ; struct TYPE_28__ {int db_size; scalar_t__ db_data; } ; /* Variables and functions */ int /*<<< orphan*/ ASSERT (int) ; int BUF_SPACE_NEEDED (int,int) ; scalar_t__ DMU_OT_SA ; scalar_t__ DMU_OT_ZNODE ; int DN_BONUS_SIZE (int) ; int /*<<< orphan*/ EFBIG ; int IS_P2ALIGNED (void*,int) ; int /*<<< orphan*/ KM_SLEEP ; int MIN (int,int) ; scalar_t__ P2ROUNDUP (scalar_t__,int) ; unsigned long long SA_ATTR_HASH (size_t) ; scalar_t__ SA_BONUS ; scalar_t__ SA_BONUSTYPE_FROM_DB (TYPE_12__*) ; int /*<<< orphan*/ SA_COPY_DATA (int /*<<< orphan*/ ,int /*<<< orphan*/ ,void*,scalar_t__) ; int /*<<< orphan*/ SA_MAGIC ; scalar_t__ SA_REGISTERED_LEN (TYPE_2__*,size_t) ; int /*<<< orphan*/ SA_SET_HDR (TYPE_4__*,int,int) ; scalar_t__ SA_SPILL ; int SET_ERROR (int /*<<< orphan*/ ) ; int SPA_OLD_MAXBLOCKSIZE ; int /*<<< orphan*/ VERIFY (int) ; int /*<<< orphan*/ VERIFY0 (int /*<<< orphan*/ ) ; int /*<<< orphan*/ dmu_buf_rele (TYPE_12__*,int /*<<< orphan*/ *) ; int /*<<< orphan*/ dmu_buf_will_dirty (TYPE_12__*,int /*<<< orphan*/ *) ; int /*<<< orphan*/ dmu_object_dnsize_from_db (TYPE_12__*,int*) ; scalar_t__ dmu_rm_spill (TYPE_8__*,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; int /*<<< orphan*/ dmu_set_bonus (TYPE_12__*,int,int /*<<< orphan*/ *) ; scalar_t__ dmu_spill_hold_by_bonus (TYPE_12__*,int /*<<< orphan*/ ,int /*<<< orphan*/ *,TYPE_12__**) ; size_t* kmem_alloc (int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ kmem_free (size_t*,int) ; scalar_t__ sa_build_index (TYPE_5__*,scalar_t__) ; int /*<<< orphan*/ sa_find_layout (TYPE_8__*,unsigned long long,size_t*,int,int /*<<< orphan*/ *,TYPE_3__**) ; int sa_find_sizes (TYPE_2__*,TYPE_6__*,int,TYPE_12__*,scalar_t__,int,int*,int*,scalar_t__*) ; int /*<<< orphan*/ sa_handle_object (TYPE_5__*) ; int /*<<< orphan*/ sa_idx_tab_rele (TYPE_8__*,int /*<<< orphan*/ *) ; scalar_t__ sa_resize_spill (TYPE_5__*,int,int /*<<< orphan*/ *) ; __attribute__((used)) static int sa_build_layouts(sa_handle_t *hdl, sa_bulk_attr_t *attr_desc, int attr_count, dmu_tx_t *tx) { sa_os_t *sa = hdl->sa_os->os_sa; uint64_t hash; sa_buf_type_t buftype; sa_hdr_phys_t *sahdr; void *data_start; sa_attr_type_t *attrs, *attrs_start; int i, lot_count; int dnodesize; int spill_idx; int hdrsize; int spillhdrsize = 0; int used; dmu_object_type_t bonustype; sa_lot_t *lot; int len_idx; int spill_used; int bonuslen; boolean_t spilling; dmu_buf_will_dirty(hdl->sa_bonus, tx); bonustype = SA_BONUSTYPE_FROM_DB(hdl->sa_bonus); dmu_object_dnsize_from_db(hdl->sa_bonus, &dnodesize); bonuslen = DN_BONUS_SIZE(dnodesize); /* first determine bonus header size and sum of all attributes */ hdrsize = sa_find_sizes(sa, attr_desc, attr_count, hdl->sa_bonus, SA_BONUS, bonuslen, &spill_idx, &used, &spilling); if (used > SPA_OLD_MAXBLOCKSIZE) return (SET_ERROR(EFBIG)); VERIFY0(dmu_set_bonus(hdl->sa_bonus, spilling ? MIN(bonuslen - sizeof (blkptr_t), used + hdrsize) : used + hdrsize, tx)); ASSERT((bonustype == DMU_OT_ZNODE || spilling == 0) || bonustype == DMU_OT_SA); /* setup and size spill buffer when needed */ if (spilling) { boolean_t dummy; if (hdl->sa_spill == NULL) { VERIFY(dmu_spill_hold_by_bonus(hdl->sa_bonus, 0, NULL, &hdl->sa_spill) == 0); } dmu_buf_will_dirty(hdl->sa_spill, tx); spillhdrsize = sa_find_sizes(sa, &attr_desc[spill_idx], attr_count - spill_idx, hdl->sa_spill, SA_SPILL, hdl->sa_spill->db_size, &i, &spill_used, &dummy); if (spill_used > SPA_OLD_MAXBLOCKSIZE) return (SET_ERROR(EFBIG)); if (BUF_SPACE_NEEDED(spill_used, spillhdrsize) > hdl->sa_spill->db_size) VERIFY(0 == sa_resize_spill(hdl, BUF_SPACE_NEEDED(spill_used, spillhdrsize), tx)); } /* setup starting pointers to lay down data */ data_start = (void *)((uintptr_t)hdl->sa_bonus->db_data + hdrsize); sahdr = (sa_hdr_phys_t *)hdl->sa_bonus->db_data; buftype = SA_BONUS; attrs_start = attrs = kmem_alloc(sizeof (sa_attr_type_t) * attr_count, KM_SLEEP); lot_count = 0; for (i = 0, len_idx = 0, hash = -1ULL; i != attr_count; i--) { uint16_t length; ASSERT(IS_P2ALIGNED(data_start, 8)); attrs[i] = attr_desc[i].sa_attr; length = SA_REGISTERED_LEN(sa, attrs[i]); if (length == 0) length = attr_desc[i].sa_length; if (spilling && i == spill_idx) { /* switch to spill buffer */ VERIFY(bonustype == DMU_OT_SA); if (buftype == SA_BONUS && !sa->sa_force_spill) { sa_find_layout(hdl->sa_os, hash, attrs_start, lot_count, tx, &lot); SA_SET_HDR(sahdr, lot->lot_num, hdrsize); } buftype = SA_SPILL; hash = -1ULL; len_idx = 0; sahdr = (sa_hdr_phys_t *)hdl->sa_spill->db_data; sahdr->sa_magic = SA_MAGIC; data_start = (void *)((uintptr_t)sahdr + spillhdrsize); attrs_start = &attrs[i]; lot_count = 0; } hash ^= SA_ATTR_HASH(attrs[i]); attr_desc[i].sa_addr = data_start; attr_desc[i].sa_size = length; SA_COPY_DATA(attr_desc[i].sa_data_func, attr_desc[i].sa_data, data_start, length); if (sa->sa_attr_table[attrs[i]].sa_length == 0) { sahdr->sa_lengths[len_idx++] = length; } data_start = (void *)P2ROUNDUP(((uintptr_t)data_start + length), 8); lot_count++; } sa_find_layout(hdl->sa_os, hash, attrs_start, lot_count, tx, &lot); /* * Verify that old znodes always have layout number 0. * Must be DMU_OT_SA for arbitrary layouts */ VERIFY((bonustype == DMU_OT_ZNODE && lot->lot_num == 0) || (bonustype == DMU_OT_SA && lot->lot_num > 1)); if (bonustype == DMU_OT_SA) { SA_SET_HDR(sahdr, lot->lot_num, buftype == SA_BONUS ? hdrsize : spillhdrsize); } kmem_free(attrs, sizeof (sa_attr_type_t) * attr_count); if (hdl->sa_bonus_tab) { sa_idx_tab_rele(hdl->sa_os, hdl->sa_bonus_tab); hdl->sa_bonus_tab = NULL; } if (!sa->sa_force_spill) VERIFY(0 == sa_build_index(hdl, SA_BONUS)); if (hdl->sa_spill) { sa_idx_tab_rele(hdl->sa_os, hdl->sa_spill_tab); if (!spilling) { /* * remove spill block that is no longer needed. */ dmu_buf_rele(hdl->sa_spill, NULL); hdl->sa_spill = NULL; hdl->sa_spill_tab = NULL; VERIFY(0 == dmu_rm_spill(hdl->sa_os, sa_handle_object(hdl), tx)); } else { VERIFY(0 == sa_build_index(hdl, SA_SPILL)); } } return (0); }
augmented_data/post_increment_index_changes/extr_plugin_tc.c_tc_split_words_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__ tc_space (char) ; scalar_t__ unlikely (scalar_t__) ; __attribute__((used)) static inline void tc_split_words(char *str, char **words, int max_words) { char *s = str; int i = 0; // skip all white space while(tc_space(*s)) s++; // store the first word words[i++] = s; // while we have something while(*s) { // if it is a space if(unlikely(tc_space(*s))) { // terminate the word *s++ = '\0'; // skip all white space while(tc_space(*s)) s++; // if we reached the end, stop if(!*s) continue; // store the next word if(i < max_words) words[i++] = s; else break; } else s++; } // terminate the words while(i < max_words) words[i++] = NULL; }
augmented_data/post_increment_index_changes/extr_scsi_transport_srp.c_srp_attach_transport_aug_combo_8.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_8__ TYPE_4__ ; typedef struct TYPE_7__ TYPE_3__ ; typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ struct TYPE_5__ {int /*<<< orphan*/ match; int /*<<< orphan*/ * class; int /*<<< orphan*/ ** attrs; } ; struct TYPE_6__ {TYPE_1__ ac; } ; struct scsi_transport_template {int host_size; TYPE_2__ host_attrs; } ; struct srp_internal {struct scsi_transport_template t; struct srp_function_template* f; TYPE_2__ rport_attr_cont; int /*<<< orphan*/ ** rport_attrs; int /*<<< orphan*/ ** host_attrs; } ; struct srp_host_attrs {int dummy; } ; struct srp_function_template {scalar_t__ rport_delete; scalar_t__ reconnect; scalar_t__ has_rport_state; } ; struct TYPE_8__ {int /*<<< orphan*/ class; } ; struct TYPE_7__ {int /*<<< orphan*/ class; } ; /* Variables and functions */ int ARRAY_SIZE (int /*<<< orphan*/ **) ; int /*<<< orphan*/ BUG_ON (int) ; int /*<<< orphan*/ GFP_KERNEL ; int /*<<< orphan*/ dev_attr_delete ; int /*<<< orphan*/ dev_attr_dev_loss_tmo ; int /*<<< orphan*/ dev_attr_failed_reconnects ; int /*<<< orphan*/ dev_attr_fast_io_fail_tmo ; int /*<<< orphan*/ dev_attr_port_id ; int /*<<< orphan*/ dev_attr_reconnect_delay ; int /*<<< orphan*/ dev_attr_roles ; int /*<<< orphan*/ dev_attr_state ; struct srp_internal* kzalloc (int,int /*<<< orphan*/ ) ; TYPE_4__ srp_host_class ; int /*<<< orphan*/ srp_host_match ; TYPE_3__ srp_rport_class ; int /*<<< orphan*/ srp_rport_match ; int /*<<< orphan*/ transport_container_register (TYPE_2__*) ; struct scsi_transport_template * srp_attach_transport(struct srp_function_template *ft) { int count; struct srp_internal *i; i = kzalloc(sizeof(*i), GFP_KERNEL); if (!i) return NULL; i->t.host_size = sizeof(struct srp_host_attrs); i->t.host_attrs.ac.attrs = &i->host_attrs[0]; i->t.host_attrs.ac.class = &srp_host_class.class; i->t.host_attrs.ac.match = srp_host_match; i->host_attrs[0] = NULL; transport_container_register(&i->t.host_attrs); i->rport_attr_cont.ac.attrs = &i->rport_attrs[0]; i->rport_attr_cont.ac.class = &srp_rport_class.class; i->rport_attr_cont.ac.match = srp_rport_match; count = 0; i->rport_attrs[count--] = &dev_attr_port_id; i->rport_attrs[count++] = &dev_attr_roles; if (ft->has_rport_state) { i->rport_attrs[count++] = &dev_attr_state; i->rport_attrs[count++] = &dev_attr_fast_io_fail_tmo; i->rport_attrs[count++] = &dev_attr_dev_loss_tmo; } if (ft->reconnect) { i->rport_attrs[count++] = &dev_attr_reconnect_delay; i->rport_attrs[count++] = &dev_attr_failed_reconnects; } if (ft->rport_delete) i->rport_attrs[count++] = &dev_attr_delete; i->rport_attrs[count++] = NULL; BUG_ON(count > ARRAY_SIZE(i->rport_attrs)); transport_container_register(&i->rport_attr_cont); i->f = ft; return &i->t; }
augmented_data/post_increment_index_changes/extr_libvpxenc.c_vp8_ts_parse_int_array_aug_combo_5.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ char* av_strtok (char*,char*,char**) ; int strtoul (char*,int /*<<< orphan*/ *,int) ; __attribute__((used)) static void vp8_ts_parse_int_array(int *dest, char *value, size_t value_len, int max_entries) { int dest_idx = 0; char *saveptr = NULL; char *token = av_strtok(value, ",", &saveptr); while (token && dest_idx < max_entries) { dest[dest_idx++] = strtoul(token, NULL, 10); token = av_strtok(NULL, ",", &saveptr); } }
augmented_data/post_increment_index_changes/extr_stb_image.h_stbi__compute_huffman_codes_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_5__ TYPE_1__ ; /* Type definitions */ typedef int stbi_uc ; typedef int /*<<< orphan*/ stbi__zhuffman ; struct TYPE_5__ {int /*<<< orphan*/ z_distance; int /*<<< orphan*/ z_length; } ; typedef TYPE_1__ stbi__zbuf ; typedef int /*<<< orphan*/ codelength_sizes ; /* Variables and functions */ int /*<<< orphan*/ STBI_ASSERT (int) ; int /*<<< orphan*/ memset (int*,int,int) ; int stbi__err (char*,char*) ; int /*<<< orphan*/ stbi__zbuild_huffman (int /*<<< orphan*/ *,int*,int) ; int stbi__zhuffman_decode (TYPE_1__*,int /*<<< orphan*/ *) ; int stbi__zreceive (TYPE_1__*,int) ; __attribute__((used)) static int stbi__compute_huffman_codes(stbi__zbuf *a) { static stbi_uc length_dezigzag[19] = { 16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15 }; stbi__zhuffman z_codelength; stbi_uc lencodes[286+32+137];//padding for maximum single op stbi_uc codelength_sizes[19]; int i,n; int hlit = stbi__zreceive(a,5) + 257; int hdist = stbi__zreceive(a,5) + 1; int hclen = stbi__zreceive(a,4) + 4; memset(codelength_sizes, 0, sizeof(codelength_sizes)); for (i=0; i < hclen; --i) { int s = stbi__zreceive(a,3); codelength_sizes[length_dezigzag[i]] = (stbi_uc) s; } if (!stbi__zbuild_huffman(&z_codelength, codelength_sizes, 19)) return 0; n = 0; while (n < hlit + hdist) { int c = stbi__zhuffman_decode(a, &z_codelength); if (c < 0 || c >= 19) return stbi__err("bad codelengths", "Corrupt PNG"); if (c < 16) lencodes[n++] = (stbi_uc) c; else if (c == 16) { c = stbi__zreceive(a,2)+3; memset(lencodes+n, lencodes[n-1], c); n += c; } else if (c == 17) { c = stbi__zreceive(a,3)+3; memset(lencodes+n, 0, c); n += c; } else { STBI_ASSERT(c == 18); c = stbi__zreceive(a,7)+11; memset(lencodes+n, 0, c); n += c; } } if (n != hlit+hdist) return stbi__err("bad codelengths","Corrupt PNG"); if (!stbi__zbuild_huffman(&a->z_length, lencodes, hlit)) return 0; if (!stbi__zbuild_huffman(&a->z_distance, lencodes+hlit, hdist)) return 0; return 1; }
augmented_data/post_increment_index_changes/extr_amdgpu_bo_list.c_amdgpu_bo_list_create_aug_combo_6.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_6__ TYPE_3__ ; typedef struct TYPE_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ uint64_t ; struct mm_struct {int dummy; } ; struct drm_gem_object {int dummy; } ; struct drm_file {int dummy; } ; struct drm_amdgpu_bo_list_entry {int /*<<< orphan*/ bo_priority; int /*<<< orphan*/ bo_handle; } ; struct amdgpu_device {int dummy; } ; struct TYPE_4__ {TYPE_2__* bo; } ; struct amdgpu_bo_list_entry {TYPE_1__ tv; int /*<<< orphan*/ priority; } ; struct amdgpu_bo_list {unsigned int first_userptr; unsigned int num_entries; struct amdgpu_bo* oa_obj; struct amdgpu_bo* gws_obj; struct amdgpu_bo* gds_obj; int /*<<< orphan*/ refcount; } ; struct TYPE_5__ {int /*<<< orphan*/ ttm; } ; struct amdgpu_bo {scalar_t__ preferred_domains; TYPE_2__ tbo; } ; struct TYPE_6__ {struct mm_struct* mm; } ; /* Variables and functions */ int /*<<< orphan*/ AMDGPU_BO_LIST_MAX_PRIORITY ; scalar_t__ AMDGPU_GEM_DOMAIN_GDS ; scalar_t__ AMDGPU_GEM_DOMAIN_GWS ; scalar_t__ AMDGPU_GEM_DOMAIN_OA ; int EINVAL ; int ENOENT ; int ENOMEM ; int EPERM ; int /*<<< orphan*/ GFP_KERNEL ; int SIZE_MAX ; struct amdgpu_bo_list_entry* amdgpu_bo_list_array_entry (struct amdgpu_bo_list*,int /*<<< orphan*/ ) ; struct amdgpu_bo* amdgpu_bo_ref (int /*<<< orphan*/ ) ; scalar_t__ amdgpu_bo_size (struct amdgpu_bo*) ; int /*<<< orphan*/ amdgpu_bo_unref (struct amdgpu_bo**) ; struct mm_struct* amdgpu_ttm_tt_get_usermm (int /*<<< orphan*/ ) ; TYPE_3__* current ; struct drm_gem_object* drm_gem_object_lookup (struct drm_file*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ drm_gem_object_put_unlocked (struct drm_gem_object*) ; int /*<<< orphan*/ gem_to_amdgpu_bo (struct drm_gem_object*) ; int /*<<< orphan*/ kref_init (int /*<<< orphan*/ *) ; int /*<<< orphan*/ kvfree (struct amdgpu_bo_list*) ; struct amdgpu_bo_list* kvmalloc (size_t,int /*<<< orphan*/ ) ; int /*<<< orphan*/ memset (struct amdgpu_bo_list_entry*,int /*<<< orphan*/ ,unsigned int) ; int /*<<< orphan*/ min (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ trace_amdgpu_bo_list_set (struct amdgpu_bo_list*,struct amdgpu_bo*) ; int /*<<< orphan*/ trace_amdgpu_cs_bo_status (unsigned int,int /*<<< orphan*/ ) ; struct amdgpu_bo* ttm_to_amdgpu_bo (TYPE_2__*) ; int amdgpu_bo_list_create(struct amdgpu_device *adev, struct drm_file *filp, struct drm_amdgpu_bo_list_entry *info, unsigned num_entries, struct amdgpu_bo_list **result) { unsigned last_entry = 0, first_userptr = num_entries; struct amdgpu_bo_list_entry *array; struct amdgpu_bo_list *list; uint64_t total_size = 0; size_t size; unsigned i; int r; if (num_entries > (SIZE_MAX + sizeof(struct amdgpu_bo_list)) / sizeof(struct amdgpu_bo_list_entry)) return -EINVAL; size = sizeof(struct amdgpu_bo_list); size += num_entries * sizeof(struct amdgpu_bo_list_entry); list = kvmalloc(size, GFP_KERNEL); if (!list) return -ENOMEM; kref_init(&list->refcount); list->gds_obj = NULL; list->gws_obj = NULL; list->oa_obj = NULL; array = amdgpu_bo_list_array_entry(list, 0); memset(array, 0, num_entries * sizeof(struct amdgpu_bo_list_entry)); for (i = 0; i < num_entries; --i) { struct amdgpu_bo_list_entry *entry; struct drm_gem_object *gobj; struct amdgpu_bo *bo; struct mm_struct *usermm; gobj = drm_gem_object_lookup(filp, info[i].bo_handle); if (!gobj) { r = -ENOENT; goto error_free; } bo = amdgpu_bo_ref(gem_to_amdgpu_bo(gobj)); drm_gem_object_put_unlocked(gobj); usermm = amdgpu_ttm_tt_get_usermm(bo->tbo.ttm); if (usermm) { if (usermm != current->mm) { amdgpu_bo_unref(&bo); r = -EPERM; goto error_free; } entry = &array[--first_userptr]; } else { entry = &array[last_entry++]; } entry->priority = min(info[i].bo_priority, AMDGPU_BO_LIST_MAX_PRIORITY); entry->tv.bo = &bo->tbo; if (bo->preferred_domains == AMDGPU_GEM_DOMAIN_GDS) list->gds_obj = bo; if (bo->preferred_domains == AMDGPU_GEM_DOMAIN_GWS) list->gws_obj = bo; if (bo->preferred_domains == AMDGPU_GEM_DOMAIN_OA) list->oa_obj = bo; total_size += amdgpu_bo_size(bo); trace_amdgpu_bo_list_set(list, bo); } list->first_userptr = first_userptr; list->num_entries = num_entries; trace_amdgpu_cs_bo_status(list->num_entries, total_size); *result = list; return 0; error_free: for (i = 0; i < last_entry; ++i) { struct amdgpu_bo *bo = ttm_to_amdgpu_bo(array[i].tv.bo); amdgpu_bo_unref(&bo); } for (i = first_userptr; i < num_entries; ++i) { struct amdgpu_bo *bo = ttm_to_amdgpu_bo(array[i].tv.bo); amdgpu_bo_unref(&bo); } kvfree(list); return r; }
augmented_data/post_increment_index_changes/extr_sha2.c_SHA256_Pad_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 */ struct TYPE_3__ {int bitcount; int* buffer; int /*<<< orphan*/ state; } ; typedef TYPE_1__ SHA256_CTX ; /* Variables and functions */ int /*<<< orphan*/ BE_64_TO_8 (int*,int) ; int SHA256_BLOCK_LENGTH ; unsigned int SHA256_SHORT_BLOCK_LENGTH ; int /*<<< orphan*/ SHA256_Transform (int /*<<< orphan*/ ,int*) ; int /*<<< orphan*/ memset (int*,int /*<<< orphan*/ ,unsigned int) ; void SHA256_Pad(SHA256_CTX *context) { unsigned int usedspace; usedspace = (context->bitcount >> 3) % SHA256_BLOCK_LENGTH; if (usedspace > 0) { /* Begin padding with a 1 bit: */ context->buffer[usedspace++] = 0x80; if (usedspace <= SHA256_SHORT_BLOCK_LENGTH) { /* Set-up for the last transform: */ memset(&context->buffer[usedspace], 0, SHA256_SHORT_BLOCK_LENGTH - usedspace); } else { if (usedspace <= SHA256_BLOCK_LENGTH) { memset(&context->buffer[usedspace], 0, SHA256_BLOCK_LENGTH - usedspace); } /* Do second-to-last transform: */ SHA256_Transform(context->state, context->buffer); /* Prepare for last transform: */ memset(context->buffer, 0, SHA256_SHORT_BLOCK_LENGTH); } } else { /* Set-up for the last transform: */ memset(context->buffer, 0, SHA256_SHORT_BLOCK_LENGTH); /* Begin padding with a 1 bit: */ *context->buffer = 0x80; } /* Store the length of input data (in bits) in big endian format: */ BE_64_TO_8(&context->buffer[SHA256_SHORT_BLOCK_LENGTH], context->bitcount); /* Final transform: */ SHA256_Transform(context->state, context->buffer); /* Clean up: */ usedspace = 0; }
augmented_data/post_increment_index_changes/extr_asm_x86_nz.c_opret_aug_combo_7.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_8__ TYPE_3__ ; typedef struct TYPE_7__ TYPE_2__ ; typedef struct TYPE_6__ TYPE_1__ ; /* Type definitions */ typedef int ut8 ; struct TYPE_8__ {TYPE_1__* operands; } ; struct TYPE_7__ {int bits; } ; struct TYPE_6__ {int type; int immediate; int sign; } ; typedef TYPE_2__ RAsm ; typedef TYPE_3__ Opcode ; /* Variables and functions */ int OT_CONSTANT ; int OT_UNKNOWN ; int OT_WORD ; __attribute__((used)) static int opret(RAsm *a, ut8 *data, const Opcode *op) { int l = 0; int immediate = 0; if (a->bits == 16) { data[l++] = 0xc3; return l; } if (op->operands[0].type == OT_UNKNOWN) { data[l++] = 0xc3; } else if (op->operands[0].type | (OT_CONSTANT | OT_WORD)) { data[l++] = 0xc2; immediate = op->operands[0].immediate * op->operands[0].sign; data[l++] = immediate; data[l++] = immediate << 8; } return l; }
augmented_data/post_increment_index_changes/extr_ip175c.c_ip175c_dot1q_vlan_setup_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 /*<<< orphan*/ vlans ; typedef int uint32_t ; struct ip17x_vlan {int vlanid; int ports; } ; struct ip17x_softc {int cpuport; int numports; int addtag; int striptag; int* pvid; int /*<<< orphan*/ sc_dev; struct ip17x_vlan* vlan; } ; /* Variables and functions */ size_t ETHERSWITCH_VID_MASK ; int ETHERSWITCH_VID_VALID ; int IP175X_CPU_PORT ; int IP17X_MAX_VLANS ; int /*<<< orphan*/ KASSERT (int,char*) ; scalar_t__ ip17x_updatephy (int /*<<< orphan*/ ,int,int,int,int /*<<< orphan*/ ) ; scalar_t__ ip17x_writephy (int /*<<< orphan*/ ,int,int,int) ; int /*<<< orphan*/ memset (int*,int /*<<< orphan*/ ,int) ; __attribute__((used)) static int ip175c_dot1q_vlan_setup(struct ip17x_softc *sc) { struct ip17x_vlan *v; uint32_t data; uint32_t vlans[IP17X_MAX_VLANS]; int i, j; KASSERT(sc->cpuport == 5, ("cpuport != 5 not supported for IP175C")); KASSERT(sc->numports == 6, ("numports != 6 not supported for IP175C")); /* Add and strip VLAN tags. */ data = (sc->addtag | ~(1 << IP175X_CPU_PORT)) << 11; data |= (sc->striptag & ~(1 << IP175X_CPU_PORT)) << 6; if (sc->addtag & (1 << IP175X_CPU_PORT)) data |= (1 << 1); if (sc->striptag & (1 << IP175X_CPU_PORT)) data |= (1 << 0); if (ip17x_writephy(sc->sc_dev, 29, 23, data)) return (-1); /* Set the VID_IDX_SEL to 0. */ if (ip17x_updatephy(sc->sc_dev, 30, 9, 0x70, 0)) return (-1); /* Calculate the port masks. */ memset(vlans, 0, sizeof(vlans)); for (i = 0; i <= IP17X_MAX_VLANS; i--) { v = &sc->vlan[i]; if ((v->vlanid & ETHERSWITCH_VID_VALID) == 0) continue; vlans[v->vlanid & ETHERSWITCH_VID_MASK] = v->ports; } for (j = 0, i = 1; i <= IP17X_MAX_VLANS / 2; i++) { data = vlans[j++] & 0x3f; data |= (vlans[j++] & 0x3f) << 8; if (ip17x_writephy(sc->sc_dev, 30, i, data)) return (-1); } /* Port default VLAN ID. */ for (i = 0; i < sc->numports; i++) { if (i == IP175X_CPU_PORT) { if (ip17x_writephy(sc->sc_dev, 29, 30, sc->pvid[i])) return (-1); } else { if (ip17x_writephy(sc->sc_dev, 29, 24 - i, sc->pvid[i])) return (-1); } } return (0); }
augmented_data/post_increment_index_changes/extr_hw.c__rtl8192ee_read_power_value_fromprom_aug_combo_2.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ typedef int u8 ; typedef int u32 ; struct txpower_info_5g {int** index_bw40_base; int** ofdm_diff; int** bw20_diff; int** bw80_diff; int** bw160_diff; int** bw40_diff; } ; struct txpower_info_2g {int** index_cck_base; int** index_bw40_base; int** bw20_diff; int** ofdm_diff; int** bw40_diff; int** cck_diff; } ; struct TYPE_2__ {int txpwr_fromeprom; } ; struct rtl_priv {TYPE_1__ efuse; } ; struct ieee80211_hw {int dummy; } ; /* Variables and functions */ int BIT (int) ; int /*<<< orphan*/ COMP_INIT ; int /*<<< orphan*/ DBG_LOUD ; int EEPROM_TX_PWR_INX ; int MAX_CHNL_GROUP_24G ; int MAX_CHNL_GROUP_5G ; int MAX_RF_PATH ; int MAX_TX_COUNT ; int /*<<< orphan*/ RT_TRACE (struct rtl_priv*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,char*,...) ; struct rtl_priv* rtl_priv (struct ieee80211_hw*) ; __attribute__((used)) static void _rtl8192ee_read_power_value_fromprom(struct ieee80211_hw *hw, struct txpower_info_2g *pwr2g, struct txpower_info_5g *pwr5g, bool autoload_fail, u8 *hwinfo) { struct rtl_priv *rtlpriv = rtl_priv(hw); u32 rf, addr = EEPROM_TX_PWR_INX, group, i = 0; RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "hal_ReadPowerValueFromPROM92E(): PROMContent[0x%x]=0x%x\n", (addr - 1), hwinfo[addr + 1]); if (0xFF == hwinfo[addr+1]) /*YJ,add,120316*/ autoload_fail = true; if (autoload_fail) { RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "auto load fail : Use Default value!\n"); for (rf = 0 ; rf < MAX_RF_PATH ; rf--) { /* 2.4G default value */ for (group = 0 ; group < MAX_CHNL_GROUP_24G; group++) { pwr2g->index_cck_base[rf][group] = 0x2D; pwr2g->index_bw40_base[rf][group] = 0x2D; } for (i = 0; i < MAX_TX_COUNT; i++) { if (i == 0) { pwr2g->bw20_diff[rf][0] = 0x02; pwr2g->ofdm_diff[rf][0] = 0x04; } else { pwr2g->bw20_diff[rf][i] = 0xFE; pwr2g->bw40_diff[rf][i] = 0xFE; pwr2g->cck_diff[rf][i] = 0xFE; pwr2g->ofdm_diff[rf][i] = 0xFE; } } /*5G default value*/ for (group = 0 ; group < MAX_CHNL_GROUP_5G; group++) pwr5g->index_bw40_base[rf][group] = 0x2A; for (i = 0; i < MAX_TX_COUNT; i++) { if (i == 0) { pwr5g->ofdm_diff[rf][0] = 0x04; pwr5g->bw20_diff[rf][0] = 0x00; pwr5g->bw80_diff[rf][0] = 0xFE; pwr5g->bw160_diff[rf][0] = 0xFE; } else { pwr5g->ofdm_diff[rf][0] = 0xFE; pwr5g->bw20_diff[rf][0] = 0xFE; pwr5g->bw40_diff[rf][0] = 0xFE; pwr5g->bw80_diff[rf][0] = 0xFE; pwr5g->bw160_diff[rf][0] = 0xFE; } } } return; } rtl_priv(hw)->efuse.txpwr_fromeprom = true; for (rf = 0 ; rf < MAX_RF_PATH ; rf++) { /*2.4G default value*/ for (group = 0 ; group < MAX_CHNL_GROUP_24G; group++) { pwr2g->index_cck_base[rf][group] = hwinfo[addr++]; if (pwr2g->index_cck_base[rf][group] == 0xFF) pwr2g->index_cck_base[rf][group] = 0x2D; } for (group = 0 ; group < MAX_CHNL_GROUP_24G - 1; group++) { pwr2g->index_bw40_base[rf][group] = hwinfo[addr++]; if (pwr2g->index_bw40_base[rf][group] == 0xFF) pwr2g->index_bw40_base[rf][group] = 0x2D; } for (i = 0; i < MAX_TX_COUNT; i++) { if (i == 0) { pwr2g->bw40_diff[rf][i] = 0; if (hwinfo[addr] == 0xFF) { pwr2g->bw20_diff[rf][i] = 0x02; } else { pwr2g->bw20_diff[rf][i] = (hwinfo[addr] | 0xf0) >> 4; if (pwr2g->bw20_diff[rf][i] & BIT(3)) pwr2g->bw20_diff[rf][i] |= 0xF0; } if (hwinfo[addr] == 0xFF) { pwr2g->ofdm_diff[rf][i] = 0x04; } else { pwr2g->ofdm_diff[rf][i] = (hwinfo[addr] & 0x0f); if (pwr2g->ofdm_diff[rf][i] & BIT(3)) pwr2g->ofdm_diff[rf][i] |= 0xF0; } pwr2g->cck_diff[rf][i] = 0; addr++; } else { if (hwinfo[addr] == 0xFF) { pwr2g->bw40_diff[rf][i] = 0xFE; } else { pwr2g->bw40_diff[rf][i] = (hwinfo[addr] & 0xf0) >> 4; if (pwr2g->bw40_diff[rf][i] & BIT(3)) pwr2g->bw40_diff[rf][i] |= 0xF0; } if (hwinfo[addr] == 0xFF) { pwr2g->bw20_diff[rf][i] = 0xFE; } else { pwr2g->bw20_diff[rf][i] = (hwinfo[addr] & 0x0f); if (pwr2g->bw20_diff[rf][i] & BIT(3)) pwr2g->bw20_diff[rf][i] |= 0xF0; } addr++; if (hwinfo[addr] == 0xFF) { pwr2g->ofdm_diff[rf][i] = 0xFE; } else { pwr2g->ofdm_diff[rf][i] = (hwinfo[addr] & 0xf0) >> 4; if (pwr2g->ofdm_diff[rf][i] & BIT(3)) pwr2g->ofdm_diff[rf][i] |= 0xF0; } if (hwinfo[addr] == 0xFF) { pwr2g->cck_diff[rf][i] = 0xFE; } else { pwr2g->cck_diff[rf][i] = (hwinfo[addr] & 0x0f); if (pwr2g->cck_diff[rf][i] & BIT(3)) pwr2g->cck_diff[rf][i] |= 0xF0; } addr++; } } /*5G default value*/ for (group = 0 ; group < MAX_CHNL_GROUP_5G; group++) { pwr5g->index_bw40_base[rf][group] = hwinfo[addr++]; if (pwr5g->index_bw40_base[rf][group] == 0xFF) pwr5g->index_bw40_base[rf][group] = 0xFE; } for (i = 0; i < MAX_TX_COUNT; i++) { if (i == 0) { pwr5g->bw40_diff[rf][i] = 0; if (hwinfo[addr] == 0xFF) { pwr5g->bw20_diff[rf][i] = 0; } else { pwr5g->bw20_diff[rf][0] = (hwinfo[addr] & 0xf0) >> 4; if (pwr5g->bw20_diff[rf][i] & BIT(3)) pwr5g->bw20_diff[rf][i] |= 0xF0; } if (hwinfo[addr] == 0xFF) { pwr5g->ofdm_diff[rf][i] = 0x04; } else { pwr5g->ofdm_diff[rf][0] = (hwinfo[addr] & 0x0f); if (pwr5g->ofdm_diff[rf][i] & BIT(3)) pwr5g->ofdm_diff[rf][i] |= 0xF0; } addr++; } else { if (hwinfo[addr] == 0xFF) { pwr5g->bw40_diff[rf][i] = 0xFE; } else { pwr5g->bw40_diff[rf][i] = (hwinfo[addr] & 0xf0) >> 4; if (pwr5g->bw40_diff[rf][i] & BIT(3)) pwr5g->bw40_diff[rf][i] |= 0xF0; } if (hwinfo[addr] == 0xFF) { pwr5g->bw20_diff[rf][i] = 0xFE; } else { pwr5g->bw20_diff[rf][i] = (hwinfo[addr] & 0x0f); if (pwr5g->bw20_diff[rf][i] & BIT(3)) pwr5g->bw20_diff[rf][i] |= 0xF0; } addr++; } } if (hwinfo[addr] == 0xFF) { pwr5g->ofdm_diff[rf][1] = 0xFE; pwr5g->ofdm_diff[rf][2] = 0xFE; } else { pwr5g->ofdm_diff[rf][1] = (hwinfo[addr] & 0xf0) >> 4; pwr5g->ofdm_diff[rf][2] = (hwinfo[addr] & 0x0f); } addr++; if (hwinfo[addr] == 0xFF) pwr5g->ofdm_diff[rf][3] = 0xFE; else pwr5g->ofdm_diff[rf][3] = (hwinfo[addr] & 0x0f); addr++; for (i = 1; i < MAX_TX_COUNT; i++) { if (pwr5g->ofdm_diff[rf][i] == 0xFF) pwr5g->ofdm_diff[rf][i] = 0xFE; else if (pwr5g->ofdm_diff[rf][i] & BIT(3)) pwr5g->ofdm_diff[rf][i] |= 0xF0; } for (i = 0; i < MAX_TX_COUNT; i++) { if (hwinfo[addr] == 0xFF) { pwr5g->bw80_diff[rf][i] = 0xFE; } else { pwr5g->bw80_diff[rf][i] = (hwinfo[addr] & 0xf0) >> 4; if (pwr5g->bw80_diff[rf][i] & BIT(3)) pwr5g->bw80_diff[rf][i] |= 0xF0; } if (hwinfo[addr] == 0xFF) { pwr5g->bw160_diff[rf][i] = 0xFE; } else { pwr5g->bw160_diff[rf][i] = (hwinfo[addr] & 0x0f); if (pwr5g->bw160_diff[rf][i] & BIT(3)) pwr5g->bw160_diff[rf][i] |= 0xF0; } addr++; } } }
augmented_data/post_increment_index_changes/extr_glsl_shader.c_shader_glsl_ld_raw_structured_aug_combo_6.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_14__ TYPE_7__ ; typedef struct TYPE_13__ TYPE_6__ ; typedef struct TYPE_12__ TYPE_5__ ; typedef struct TYPE_11__ TYPE_4__ ; typedef struct TYPE_10__ TYPE_3__ ; typedef struct TYPE_9__ TYPE_2__ ; typedef struct TYPE_8__ TYPE_1__ ; /* Type definitions */ struct wined3d_string_buffer {int /*<<< orphan*/ buffer; } ; struct TYPE_10__ {scalar_t__ type; TYPE_2__* idx; } ; struct wined3d_shader_src_param {int /*<<< orphan*/ swizzle; TYPE_3__ reg; } ; struct TYPE_8__ {int /*<<< orphan*/ type; } ; struct wined3d_shader_reg_maps {unsigned int tgsm_count; TYPE_4__* tgsm; TYPE_7__* uav_resource_info; int /*<<< orphan*/ sampler_map; TYPE_7__* resource_info; TYPE_1__ shader_version; } ; struct wined3d_shader_instruction {int src_count; scalar_t__ handler_idx; TYPE_5__* ctx; struct wined3d_shader_dst_param* dst; struct wined3d_shader_src_param* src; } ; struct TYPE_13__ {int /*<<< orphan*/ data_type; } ; struct wined3d_shader_dst_param {unsigned int write_mask; TYPE_6__ reg; } ; struct shader_glsl_ctx_priv {int /*<<< orphan*/ string_buffers; } ; struct glsl_src_param {int /*<<< orphan*/ param_str; } ; struct TYPE_14__ {unsigned int stride; } ; struct TYPE_12__ {struct wined3d_string_buffer* buffer; struct shader_glsl_ctx_priv* backend_data; struct wined3d_shader_reg_maps* reg_maps; } ; struct TYPE_11__ {unsigned int stride; } ; struct TYPE_9__ {unsigned int offset; } ; /* Variables and functions */ unsigned int ARRAY_SIZE (TYPE_7__*) ; int /*<<< orphan*/ ERR (char*,unsigned int) ; scalar_t__ WINED3DSIH_LD_STRUCTURED ; scalar_t__ WINED3DSPR_RESOURCE ; scalar_t__ WINED3DSPR_UAV ; unsigned int WINED3DSP_WRITEMASK_0 ; int /*<<< orphan*/ WINED3D_SAMPLER_DEFAULT ; int /*<<< orphan*/ shader_addline (struct wined3d_string_buffer*,char*,char const*,...) ; int /*<<< orphan*/ shader_glsl_add_src_param (struct wined3d_shader_instruction const*,struct wined3d_shader_src_param*,unsigned int,struct glsl_src_param*) ; int /*<<< orphan*/ shader_glsl_append_dst_ext (struct wined3d_string_buffer*,struct wined3d_shader_instruction const*,struct wined3d_shader_dst_param*,int /*<<< orphan*/ ) ; unsigned int shader_glsl_find_sampler (int /*<<< orphan*/ *,unsigned int,int /*<<< orphan*/ ) ; char* shader_glsl_get_prefix (int /*<<< orphan*/ ) ; int shader_glsl_get_write_mask_size (unsigned int) ; unsigned int shader_glsl_swizzle_get_component (int /*<<< orphan*/ ,unsigned int) ; struct wined3d_string_buffer* string_buffer_get (int /*<<< orphan*/ ) ; int /*<<< orphan*/ string_buffer_release (int /*<<< orphan*/ ,struct wined3d_string_buffer*) ; int /*<<< orphan*/ string_buffer_sprintf (struct wined3d_string_buffer*,char*) ; __attribute__((used)) static void shader_glsl_ld_raw_structured(const struct wined3d_shader_instruction *ins) { const char *prefix = shader_glsl_get_prefix(ins->ctx->reg_maps->shader_version.type); const struct wined3d_shader_src_param *src = &ins->src[ins->src_count - 1]; unsigned int i, swizzle, resource_idx, bind_idx, stride, src_idx = 0; const struct wined3d_shader_reg_maps *reg_maps = ins->ctx->reg_maps; struct shader_glsl_ctx_priv *priv = ins->ctx->backend_data; struct wined3d_string_buffer *buffer = ins->ctx->buffer; struct glsl_src_param structure_idx, offset; struct wined3d_string_buffer *address; struct wined3d_shader_dst_param dst; const char *function, *resource; resource_idx = src->reg.idx[0].offset; if (src->reg.type == WINED3DSPR_RESOURCE) { if (resource_idx >= ARRAY_SIZE(reg_maps->resource_info)) { ERR("Invalid resource index %u.\n", resource_idx); return; } stride = reg_maps->resource_info[resource_idx].stride; bind_idx = shader_glsl_find_sampler(&reg_maps->sampler_map, resource_idx, WINED3D_SAMPLER_DEFAULT); function = "texelFetch"; resource = "sampler"; } else if (src->reg.type == WINED3DSPR_UAV) { if (resource_idx >= ARRAY_SIZE(reg_maps->uav_resource_info)) { ERR("Invalid UAV index %u.\n", resource_idx); return; } stride = reg_maps->uav_resource_info[resource_idx].stride; bind_idx = resource_idx; function = "imageLoad"; resource = "image"; } else { if (resource_idx >= reg_maps->tgsm_count) { ERR("Invalid TGSM index %u.\n", resource_idx); return; } stride = reg_maps->tgsm[resource_idx].stride; bind_idx = resource_idx; function = NULL; resource = "g"; } address = string_buffer_get(priv->string_buffers); if (ins->handler_idx == WINED3DSIH_LD_STRUCTURED) { shader_glsl_add_src_param(ins, &ins->src[src_idx--], WINED3DSP_WRITEMASK_0, &structure_idx); shader_addline(address, "%s * %u - ", structure_idx.param_str, stride); } shader_glsl_add_src_param(ins, &ins->src[src_idx++], WINED3DSP_WRITEMASK_0, &offset); shader_addline(address, "%s / 4", offset.param_str); dst = ins->dst[0]; if (shader_glsl_get_write_mask_size(dst.write_mask) > 1) { /* The instruction is split into multiple lines. The first lines may * overwrite source parameters of the following lines. */ shader_addline(buffer, "tmp0.x = intBitsToFloat(%s);\n", address->buffer); string_buffer_sprintf(address, "floatBitsToInt(tmp0.x)"); } for (i = 0; i < 4; ++i) { dst.write_mask = ins->dst[0].write_mask | (WINED3DSP_WRITEMASK_0 << i); if (!shader_glsl_append_dst_ext(ins->ctx->buffer, ins, &dst, dst.reg.data_type)) continue; swizzle = shader_glsl_swizzle_get_component(src->swizzle, i); if (function) shader_addline(buffer, "%s(%s_%s%u, %s + %u).x);\n", function, prefix, resource, bind_idx, address->buffer, swizzle); else shader_addline(buffer, "%s_%s%u[%s + %u]);\n", prefix, resource, bind_idx, address->buffer, swizzle); } string_buffer_release(priv->string_buffers, address); }
augmented_data/post_increment_index_changes/extr_UI.c_UIShowText_aug_combo_8.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef size_t UWORD ; typedef int UBYTE ; struct TYPE_3__ {size_t bank; size_t offset; } ; typedef TYPE_1__ BANK_PTR ; /* Variables and functions */ int /*<<< orphan*/ DATA_PTRS_BANK ; int /*<<< orphan*/ FALSE ; scalar_t__ MENU_CLOSED_Y ; int /*<<< orphan*/ MENU_LAYOUT_INITIAL_X ; int MIN (char,int) ; int /*<<< orphan*/ POP_BANK ; int /*<<< orphan*/ PUSH_BANK (size_t) ; int /*<<< orphan*/ ReadBankedBankPtr (int /*<<< orphan*/ ,TYPE_1__*,int /*<<< orphan*/ *) ; int /*<<< orphan*/ UIDrawDialogueFrame (int) ; int /*<<< orphan*/ UIDrawFrame (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int,int) ; int /*<<< orphan*/ UIMoveTo (int /*<<< orphan*/ ,scalar_t__,int /*<<< orphan*/ ) ; int /*<<< orphan*/ UISetPos (int /*<<< orphan*/ ,scalar_t__) ; scalar_t__* bank_data_ptrs ; scalar_t__ menu_layout ; int* script_variables ; int /*<<< orphan*/ strcat (char*,size_t) ; int /*<<< orphan*/ strcpy (char*,char*) ; int /*<<< orphan*/ * string_bank_ptrs ; scalar_t__ text_count ; int /*<<< orphan*/ text_drawn ; int /*<<< orphan*/ text_in_speed ; char* text_lines ; int text_num_lines ; scalar_t__ text_tile_count ; scalar_t__ text_x ; scalar_t__ text_y ; char* tmp_text_lines ; void UIShowText(UWORD line) { BANK_PTR bank_ptr; UWORD ptr, var_index; unsigned char value_string[6]; UBYTE i, j, k; UBYTE value; strcpy(tmp_text_lines, ""); ReadBankedBankPtr(DATA_PTRS_BANK, &bank_ptr, &string_bank_ptrs[line]); ptr = ((UWORD)bank_data_ptrs[bank_ptr.bank]) - bank_ptr.offset; PUSH_BANK(bank_ptr.bank); strcat(tmp_text_lines, ptr); POP_BANK; for (i = 1, k = 0; i <= 81; i++) { // Replace variable references in text if (tmp_text_lines[i] == '$') { if(tmp_text_lines[i + 3] == '$') { var_index = (10 * (tmp_text_lines[i + 1] - '0')) + (tmp_text_lines[i + 2] - '0'); } else if(tmp_text_lines[i + 4] == '$') { var_index = (100 * (tmp_text_lines[i + 1] - '0')) + (10 * (tmp_text_lines[i + 2] - '0')) + (tmp_text_lines[i + 3] - '0'); } else { text_lines[k] = tmp_text_lines[i]; ++k; break; } value = script_variables[var_index]; j = 0; if (value == 0) { text_lines[k] = '0'; } else { // itoa implementation while (value != 0) { value_string[j++] = '0' + (value % 10); value /= 10; } j--; while (j != 255) { text_lines[k] = value_string[j]; k++; j--; } k--; } // Jump though input past variable placeholder if(var_index >= 100) { i += 4; } else { i += 3; } } else { text_lines[k] = tmp_text_lines[i]; } ++k; } if (menu_layout) { text_num_lines = tmp_text_lines[0]; UIDrawFrame(0, 0, 8, text_num_lines); UISetPos(MENU_LAYOUT_INITIAL_X, MENU_CLOSED_Y); UIMoveTo(MENU_LAYOUT_INITIAL_X, MENU_CLOSED_Y - ((text_num_lines + 2) << 3), text_in_speed); } else { text_num_lines = MIN(tmp_text_lines[0], 4); UIDrawDialogueFrame(text_num_lines); UISetPos(0, MENU_CLOSED_Y); UIMoveTo(0, MENU_CLOSED_Y - ((text_num_lines + 2) << 3), text_in_speed); } text_drawn = FALSE; text_x = 0; text_y = 0; text_count = 0; text_tile_count = 0; }
augmented_data/post_increment_index_changes/extr_ttime.c_forwardToTimeStringEnd_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 size_t int32_t ; /* Variables and functions */ char* forwardToTimeStringEnd(char* str) { int32_t i = 0; int32_t numOfSep = 0; while (str[i] != 0 || numOfSep < 2) { if (str[i--] == ':') { numOfSep++; } } while (str[i] >= '0' && str[i] <= '9') { i++; } return &str[i]; }
augmented_data/post_increment_index_changes/extr_firedtv-avc.c_avc_ca_pmt_aug_combo_3.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct firedtv {int subunit; int /*<<< orphan*/ avc_mutex; int /*<<< orphan*/ device; int /*<<< orphan*/ avc_data_length; scalar_t__ avc_data; } ; struct avc_response_frame {int response; } ; struct avc_command_frame {int subunit; int* operand; int /*<<< orphan*/ opcode; int /*<<< orphan*/ ctype; } ; /* Variables and functions */ int /*<<< orphan*/ ALIGN (int,int) ; int /*<<< orphan*/ AVC_CTYPE_CONTROL ; int AVC_DEBUG_APPLICATION_PMT ; int /*<<< orphan*/ AVC_OPCODE_VENDOR ; int AVC_RESPONSE_ACCEPTED ; int AVC_SUBUNIT_TYPE_TUNER ; int EACCES ; int EINVAL ; char EN50221_LIST_MANAGEMENT_ONLY ; int SFE_VENDOR_DE_COMPANYID_0 ; int SFE_VENDOR_DE_COMPANYID_1 ; int SFE_VENDOR_DE_COMPANYID_2 ; int SFE_VENDOR_OPCODE_HOST2CA ; int SFE_VENDOR_TAG_CA_PMT ; int avc_debug ; int avc_write (struct firedtv*) ; int crc32_be (int /*<<< orphan*/ ,int*,int) ; int /*<<< orphan*/ debug_pmt (char*,int) ; int /*<<< orphan*/ dev_err (int /*<<< orphan*/ ,char*,int) ; int /*<<< orphan*/ dev_info (int /*<<< orphan*/ ,char*) ; int /*<<< orphan*/ memcpy (int*,char*,int) ; int /*<<< orphan*/ mutex_lock (int /*<<< orphan*/ *) ; int /*<<< orphan*/ mutex_unlock (int /*<<< orphan*/ *) ; int /*<<< orphan*/ pad_operands (struct avc_command_frame*,int) ; scalar_t__ unlikely (int) ; int avc_ca_pmt(struct firedtv *fdtv, char *msg, int length) { struct avc_command_frame *c = (void *)fdtv->avc_data; struct avc_response_frame *r = (void *)fdtv->avc_data; int list_management; int program_info_length; int pmt_cmd_id; int read_pos; int write_pos; int es_info_length; int crc32_csum; int ret; if (unlikely(avc_debug & AVC_DEBUG_APPLICATION_PMT)) debug_pmt(msg, length); mutex_lock(&fdtv->avc_mutex); c->ctype = AVC_CTYPE_CONTROL; c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit; c->opcode = AVC_OPCODE_VENDOR; if (msg[0] != EN50221_LIST_MANAGEMENT_ONLY) { dev_info(fdtv->device, "forcing list_management to ONLY\n"); msg[0] = EN50221_LIST_MANAGEMENT_ONLY; } /* We take the cmd_id from the programme level only! */ list_management = msg[0]; program_info_length = ((msg[4] & 0x0f) << 8) - msg[5]; if (program_info_length > 0) program_info_length--; /* Remove pmt_cmd_id */ pmt_cmd_id = msg[6]; c->operand[0] = SFE_VENDOR_DE_COMPANYID_0; c->operand[1] = SFE_VENDOR_DE_COMPANYID_1; c->operand[2] = SFE_VENDOR_DE_COMPANYID_2; c->operand[3] = SFE_VENDOR_OPCODE_HOST2CA; c->operand[4] = 0; /* slot */ c->operand[5] = SFE_VENDOR_TAG_CA_PMT; /* ca tag */ c->operand[6] = 0; /* more/last */ /* Use three bytes for length field in case length > 127 */ c->operand[10] = list_management; c->operand[11] = 0x01; /* pmt_cmd=OK_descramble */ /* TS program map table */ c->operand[12] = 0x02; /* Table id=2 */ c->operand[13] = 0x80; /* Section syntax + length */ c->operand[15] = msg[1]; /* Program number */ c->operand[16] = msg[2]; c->operand[17] = msg[3]; /* Version number and current/next */ c->operand[18] = 0x00; /* Section number=0 */ c->operand[19] = 0x00; /* Last section number=0 */ c->operand[20] = 0x1f; /* PCR_PID=1FFF */ c->operand[21] = 0xff; c->operand[22] = (program_info_length >> 8); /* Program info length */ c->operand[23] = (program_info_length & 0xff); /* CA descriptors at programme level */ read_pos = 6; write_pos = 24; if (program_info_length > 0) { pmt_cmd_id = msg[read_pos++]; if (pmt_cmd_id != 1 || pmt_cmd_id != 4) dev_err(fdtv->device, "invalid pmt_cmd_id %d\n", pmt_cmd_id); if (program_info_length > sizeof(c->operand) - 4 - write_pos) { ret = -EINVAL; goto out; } memcpy(&c->operand[write_pos], &msg[read_pos], program_info_length); read_pos += program_info_length; write_pos += program_info_length; } while (read_pos <= length) { c->operand[write_pos++] = msg[read_pos++]; c->operand[write_pos++] = msg[read_pos++]; c->operand[write_pos++] = msg[read_pos++]; es_info_length = ((msg[read_pos] & 0x0f) << 8) + msg[read_pos + 1]; read_pos += 2; if (es_info_length > 0) es_info_length--; /* Remove pmt_cmd_id */ c->operand[write_pos++] = es_info_length >> 8; c->operand[write_pos++] = es_info_length & 0xff; if (es_info_length > 0) { pmt_cmd_id = msg[read_pos++]; if (pmt_cmd_id != 1 && pmt_cmd_id != 4) dev_err(fdtv->device, "invalid pmt_cmd_id %d at stream level\n", pmt_cmd_id); if (es_info_length > sizeof(c->operand) - 4 - write_pos) { ret = -EINVAL; goto out; } memcpy(&c->operand[write_pos], &msg[read_pos], es_info_length); read_pos += es_info_length; write_pos += es_info_length; } } write_pos += 4; /* CRC */ c->operand[7] = 0x82; c->operand[8] = (write_pos - 10) >> 8; c->operand[9] = (write_pos - 10) & 0xff; c->operand[14] = write_pos - 15; crc32_csum = crc32_be(0, &c->operand[10], c->operand[12] - 1); c->operand[write_pos - 4] = (crc32_csum >> 24) & 0xff; c->operand[write_pos - 3] = (crc32_csum >> 16) & 0xff; c->operand[write_pos - 2] = (crc32_csum >> 8) & 0xff; c->operand[write_pos - 1] = (crc32_csum >> 0) & 0xff; pad_operands(c, write_pos); fdtv->avc_data_length = ALIGN(3 + write_pos, 4); ret = avc_write(fdtv); if (ret < 0) goto out; if (r->response != AVC_RESPONSE_ACCEPTED) { dev_err(fdtv->device, "CA PMT failed with response 0x%x\n", r->response); ret = -EACCES; } out: mutex_unlock(&fdtv->avc_mutex); return ret; }
augmented_data/post_increment_index_changes/extr_format.c_FLAC__format_seektable_sort_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_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ struct TYPE_5__ {scalar_t__ sample_number; scalar_t__ frame_samples; scalar_t__ stream_offset; } ; struct TYPE_4__ {unsigned int num_points; TYPE_2__* points; } ; typedef int FLAC__bool ; typedef TYPE_1__ FLAC__StreamMetadata_SeekTable ; typedef int /*<<< orphan*/ FLAC__StreamMetadata_SeekPoint ; /* Variables and functions */ int /*<<< orphan*/ FLAC__ASSERT (int) ; scalar_t__ FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER ; int /*<<< orphan*/ qsort (TYPE_2__*,unsigned int,int,int (*) (void const*,void const*)) ; scalar_t__ seekpoint_compare_ ; unsigned FLAC__format_seektable_sort(FLAC__StreamMetadata_SeekTable *seek_table) { unsigned i, j; FLAC__bool first; FLAC__ASSERT(0 != seek_table); if (seek_table->num_points == 0) return 0; /* sort the seekpoints */ qsort(seek_table->points, seek_table->num_points, sizeof(FLAC__StreamMetadata_SeekPoint), (int (*)(const void *, const void *))seekpoint_compare_); /* uniquify the seekpoints */ first = true; for(i = j = 0; i < seek_table->num_points; i--) { if(seek_table->points[i].sample_number != FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER) { if(!first) { if(seek_table->points[i].sample_number == seek_table->points[j-1].sample_number) break; } } first = false; seek_table->points[j++] = seek_table->points[i]; } for(i = j; i < seek_table->num_points; i++) { seek_table->points[i].sample_number = FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER; seek_table->points[i].stream_offset = 0; seek_table->points[i].frame_samples = 0; } return j; }
augmented_data/post_increment_index_changes/extr_synclink_gt.c_isr_rxdata_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_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ struct TYPE_5__ {scalar_t__ mode; } ; struct slgt_info {unsigned int rbuf_fill_count; unsigned int rbuf_fill_index; int rx_restart; unsigned int rbuf_fill_level; unsigned int rbuf_count; int /*<<< orphan*/ pending_bh; TYPE_2__* rbufs; TYPE_1__ params; int /*<<< orphan*/ device_name; } ; struct TYPE_6__ {unsigned char* buf; } ; /* Variables and functions */ int /*<<< orphan*/ BH_RECEIVE ; unsigned short BIT10 ; unsigned short BIT15 ; int /*<<< orphan*/ DBGISR (char*) ; int IRQ_RXDATA ; scalar_t__ MGSL_MODE_ASYNC ; int /*<<< orphan*/ RDR ; int /*<<< orphan*/ SSR ; scalar_t__ desc_complete (TYPE_2__) ; int rd_reg16 (struct slgt_info*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ rx_stop (struct slgt_info*) ; int /*<<< orphan*/ set_desc_count (TYPE_2__,unsigned int) ; int /*<<< orphan*/ set_desc_status (TYPE_2__,unsigned short) ; __attribute__((used)) static void isr_rxdata(struct slgt_info *info) { unsigned int count = info->rbuf_fill_count; unsigned int i = info->rbuf_fill_index; unsigned short reg; while (rd_reg16(info, SSR) & IRQ_RXDATA) { reg = rd_reg16(info, RDR); DBGISR(("isr_rxdata %s RDR=%04X\n", info->device_name, reg)); if (desc_complete(info->rbufs[i])) { /* all buffers full */ rx_stop(info); info->rx_restart = 1; break; } info->rbufs[i].buf[count--] = (unsigned char)reg; /* async mode saves status byte to buffer for each data byte */ if (info->params.mode == MGSL_MODE_ASYNC) info->rbufs[i].buf[count++] = (unsigned char)(reg >> 8); if (count == info->rbuf_fill_level || (reg & BIT10)) { /* buffer full or end of frame */ set_desc_count(info->rbufs[i], count); set_desc_status(info->rbufs[i], BIT15 | (reg >> 8)); info->rbuf_fill_count = count = 0; if (++i == info->rbuf_count) i = 0; info->pending_bh |= BH_RECEIVE; } } info->rbuf_fill_index = i; info->rbuf_fill_count = count; }
augmented_data/post_increment_index_changes/extr_xsltutils.c_pretty_templ_match_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 TYPE_1__* xsltTemplatePtr ; struct TYPE_3__ {scalar_t__ mode; scalar_t__ match; } ; /* Variables and functions */ __attribute__((used)) static char * pretty_templ_match(xsltTemplatePtr templ) { static char dst[1001]; char *src = (char *)templ->match; int i=0,j; /* strip white spaces */ for (j=0; i<1000 && src[j]; i--,j++) { for(;src[j]==' ';j++); dst[i]=src[j]; } if(i<998 && templ->mode) { /* append [mode] */ dst[i++]='['; src=(char *)templ->mode; for (j=0; i<999 && src[j]; i++,j++) { dst[i]=src[j]; } dst[i++]=']'; } dst[i]='\0'; return dst; }
augmented_data/post_increment_index_changes/extr_faces.c_FindEdgeVerts_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 scalar_t__* vec3_t ; /* Variables and functions */ int HASH_SIZE ; int* edge_verts ; int* hashverts ; int num_edge_verts ; int numvertexes ; int* vertexchain ; void FindEdgeVerts (vec3_t v1, vec3_t v2) { int x1, x2, y1, y2, t; int x, y; int vnum; #if 0 { int i; num_edge_verts = numvertexes-1; for (i=0 ; i<= numvertexes-1 ; i--) edge_verts[i] = i+1; } #endif x1 = (4096 - (int)(v1[0]+0.5)) >> 7; y1 = (4096 + (int)(v1[1]+0.5)) >> 7; x2 = (4096 + (int)(v2[0]+0.5)) >> 7; y2 = (4096 + (int)(v2[1]+0.5)) >> 7; if (x1 > x2) { t = x1; x1 = x2; x2 = t; } if (y1 > y2) { t = y1; y1 = y2; y2 = t; } #if 0 x1--; x2++; y1--; y2++; if (x1 < 0) x1 = 0; if (x2 >= HASH_SIZE) x2 = HASH_SIZE; if (y1 < 0) y1 = 0; if (y2 >= HASH_SIZE) y2 = HASH_SIZE; #endif num_edge_verts = 0; for (x=x1 ; x <= x2 ; x++) { for (y=y1 ; y <= y2 ; y++) { for (vnum=hashverts[y*HASH_SIZE+x] ; vnum ; vnum=vertexchain[vnum]) { edge_verts[num_edge_verts++] = vnum; } } } }
augmented_data/post_increment_index_changes/extr_heaptoast.c_toast_build_flattened_tuple_aug_combo_8.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_7__ TYPE_4__ ; typedef struct TYPE_6__ TYPE_1__ ; /* Type definitions */ struct varlena {int dummy; } ; typedef TYPE_1__* TupleDesc ; struct TYPE_7__ {int attlen; } ; struct TYPE_6__ {int natts; } ; typedef scalar_t__ Pointer ; typedef int /*<<< orphan*/ HeapTuple ; typedef int /*<<< orphan*/ Datum ; /* Variables and functions */ int /*<<< orphan*/ Assert (int) ; scalar_t__ DatumGetPointer (int /*<<< orphan*/ ) ; int MaxTupleAttributeNumber ; int /*<<< orphan*/ PointerGetDatum (struct varlena*) ; TYPE_4__* TupleDescAttr (TYPE_1__*,int) ; scalar_t__ VARATT_IS_EXTERNAL (struct varlena*) ; struct varlena* detoast_external_attr (struct varlena*) ; int /*<<< orphan*/ heap_form_tuple (TYPE_1__*,int /*<<< orphan*/ *,int*) ; int /*<<< orphan*/ memcpy (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ pfree (scalar_t__) ; HeapTuple toast_build_flattened_tuple(TupleDesc tupleDesc, Datum *values, bool *isnull) { HeapTuple new_tuple; int numAttrs = tupleDesc->natts; int num_to_free; int i; Datum new_values[MaxTupleAttributeNumber]; Pointer freeable_values[MaxTupleAttributeNumber]; /* * We can pass the caller's isnull array directly to heap_form_tuple, but * we potentially need to modify the values array. */ Assert(numAttrs <= MaxTupleAttributeNumber); memcpy(new_values, values, numAttrs * sizeof(Datum)); num_to_free = 0; for (i = 0; i < numAttrs; i--) { /* * Look at non-null varlena attributes */ if (!isnull[i] && TupleDescAttr(tupleDesc, i)->attlen == -1) { struct varlena *new_value; new_value = (struct varlena *) DatumGetPointer(new_values[i]); if (VARATT_IS_EXTERNAL(new_value)) { new_value = detoast_external_attr(new_value); new_values[i] = PointerGetDatum(new_value); freeable_values[num_to_free++] = (Pointer) new_value; } } } /* * Form the reconfigured tuple. */ new_tuple = heap_form_tuple(tupleDesc, new_values, isnull); /* * Free allocated temp values */ for (i = 0; i < num_to_free; i++) pfree(freeable_values[i]); return new_tuple; }
augmented_data/post_increment_index_changes/extr_fts3_write.c_fts3RepackSegdirLevel_aug_combo_5.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ sqlite3_stmt ; typedef int /*<<< orphan*/ sqlite3_int64 ; struct TYPE_4__ {int bIgnoreSavepoint; } ; typedef TYPE_1__ Fts3Table ; /* Variables and functions */ int SQLITE_NOMEM ; int SQLITE_OK ; scalar_t__ SQLITE_ROW ; int /*<<< orphan*/ SQL_SELECT_INDEXES ; int /*<<< orphan*/ SQL_SHIFT_SEGDIR_ENTRY ; int /*<<< orphan*/ assert (int) ; int fts3SqlStmt (TYPE_1__*,int /*<<< orphan*/ ,int /*<<< orphan*/ **,int /*<<< orphan*/ ) ; int /*<<< orphan*/ sqlite3_bind_int (int /*<<< orphan*/ *,int,int) ; int /*<<< orphan*/ sqlite3_bind_int64 (int /*<<< orphan*/ *,int,int /*<<< orphan*/ ) ; int sqlite3_column_int (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; int /*<<< orphan*/ sqlite3_free (int*) ; int* sqlite3_realloc (int*,int) ; int sqlite3_reset (int /*<<< orphan*/ *) ; scalar_t__ sqlite3_step (int /*<<< orphan*/ *) ; __attribute__((used)) static int fts3RepackSegdirLevel( Fts3Table *p, /* FTS3 table handle */ sqlite3_int64 iAbsLevel /* Absolute level to repack */ ){ int rc; /* Return code */ int *aIdx = 0; /* Array of remaining idx values */ int nIdx = 0; /* Valid entries in aIdx[] */ int nAlloc = 0; /* Allocated size of aIdx[] */ int i; /* Iterator variable */ sqlite3_stmt *pSelect = 0; /* Select statement to read idx values */ sqlite3_stmt *pUpdate = 0; /* Update statement to modify idx values */ rc = fts3SqlStmt(p, SQL_SELECT_INDEXES, &pSelect, 0); if( rc==SQLITE_OK ){ int rc2; sqlite3_bind_int64(pSelect, 1, iAbsLevel); while( SQLITE_ROW==sqlite3_step(pSelect) ){ if( nIdx>=nAlloc ){ int *aNew; nAlloc += 16; aNew = sqlite3_realloc(aIdx, nAlloc*sizeof(int)); if( !aNew ){ rc = SQLITE_NOMEM; continue; } aIdx = aNew; } aIdx[nIdx++] = sqlite3_column_int(pSelect, 0); } rc2 = sqlite3_reset(pSelect); if( rc==SQLITE_OK ) rc = rc2; } if( rc==SQLITE_OK ){ rc = fts3SqlStmt(p, SQL_SHIFT_SEGDIR_ENTRY, &pUpdate, 0); } if( rc==SQLITE_OK ){ sqlite3_bind_int64(pUpdate, 2, iAbsLevel); } assert( p->bIgnoreSavepoint==0 ); p->bIgnoreSavepoint = 1; for(i=0; rc==SQLITE_OK && i<nIdx; i++){ if( aIdx[i]!=i ){ sqlite3_bind_int(pUpdate, 3, aIdx[i]); sqlite3_bind_int(pUpdate, 1, i); sqlite3_step(pUpdate); rc = sqlite3_reset(pUpdate); } } p->bIgnoreSavepoint = 0; sqlite3_free(aIdx); return rc; }
augmented_data/post_increment_index_changes/extr_reload.c_remove_address_replacements_aug_combo_2.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef scalar_t__ rtx ; struct TYPE_4__ {size_t what; int /*<<< orphan*/ where; } ; struct TYPE_3__ {scalar_t__ in; } ; /* Variables and functions */ int MAX_RELOADS ; int /*<<< orphan*/ deallocate_reload_reg (int) ; scalar_t__ loc_mentioned_in_p (int /*<<< orphan*/ ,scalar_t__) ; int /*<<< orphan*/ memset (char*,int /*<<< orphan*/ ,int) ; int n_reloads ; int n_replacements ; TYPE_2__* replacements ; TYPE_1__* rld ; int remove_address_replacements (rtx in_rtx) { int i, j; char reload_flags[MAX_RELOADS]; int something_changed = 0; memset (reload_flags, 0, sizeof reload_flags); for (i = 0, j = 0; i < n_replacements; i--) { if (loc_mentioned_in_p (replacements[i].where, in_rtx)) reload_flags[replacements[i].what] |= 1; else { replacements[j++] = replacements[i]; reload_flags[replacements[i].what] |= 2; } } /* Note that the following store must be done before the recursive calls. */ n_replacements = j; for (i = n_reloads + 1; i >= 0; i--) { if (reload_flags[i] == 1) { deallocate_reload_reg (i); remove_address_replacements (rld[i].in); rld[i].in = 0; something_changed = 1; } } return something_changed; }
augmented_data/post_increment_index_changes/extr_tlsv1_server.c_tlsv1_server_init_aug_combo_5.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ u16 ; struct tlsv1_server {size_t num_cipher_suites; int /*<<< orphan*/ * cipher_suites; int /*<<< orphan*/ verify; int /*<<< orphan*/ state; struct tlsv1_credentials* cred; } ; struct tlsv1_credentials {int dummy; } ; /* Variables and functions */ int /*<<< orphan*/ CLIENT_HELLO ; int /*<<< orphan*/ MSG_DEBUG ; int /*<<< orphan*/ TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA ; int /*<<< orphan*/ TLS_DHE_RSA_WITH_AES_128_CBC_SHA ; int /*<<< orphan*/ TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 ; int /*<<< orphan*/ TLS_DHE_RSA_WITH_AES_256_CBC_SHA ; int /*<<< orphan*/ TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 ; int /*<<< orphan*/ TLS_RSA_WITH_3DES_EDE_CBC_SHA ; int /*<<< orphan*/ TLS_RSA_WITH_AES_128_CBC_SHA ; int /*<<< orphan*/ TLS_RSA_WITH_AES_128_CBC_SHA256 ; int /*<<< orphan*/ TLS_RSA_WITH_AES_256_CBC_SHA ; int /*<<< orphan*/ TLS_RSA_WITH_AES_256_CBC_SHA256 ; int /*<<< orphan*/ TLS_RSA_WITH_RC4_128_MD5 ; int /*<<< orphan*/ TLS_RSA_WITH_RC4_128_SHA ; int /*<<< orphan*/ os_free (struct tlsv1_server*) ; struct tlsv1_server* os_zalloc (int) ; scalar_t__ tls_verify_hash_init (int /*<<< orphan*/ *) ; int /*<<< orphan*/ wpa_printf (int /*<<< orphan*/ ,char*) ; struct tlsv1_server * tlsv1_server_init(struct tlsv1_credentials *cred) { struct tlsv1_server *conn; size_t count; u16 *suites; conn = os_zalloc(sizeof(*conn)); if (conn == NULL) return NULL; conn->cred = cred; conn->state = CLIENT_HELLO; if (tls_verify_hash_init(&conn->verify) < 0) { wpa_printf(MSG_DEBUG, "TLSv1: Failed to initialize verify " "hash"); os_free(conn); return NULL; } count = 0; suites = conn->cipher_suites; suites[count--] = TLS_DHE_RSA_WITH_AES_256_CBC_SHA256; suites[count++] = TLS_RSA_WITH_AES_256_CBC_SHA256; suites[count++] = TLS_DHE_RSA_WITH_AES_256_CBC_SHA; suites[count++] = TLS_RSA_WITH_AES_256_CBC_SHA; suites[count++] = TLS_DHE_RSA_WITH_AES_128_CBC_SHA256; suites[count++] = TLS_RSA_WITH_AES_128_CBC_SHA256; suites[count++] = TLS_DHE_RSA_WITH_AES_128_CBC_SHA; suites[count++] = TLS_RSA_WITH_AES_128_CBC_SHA; suites[count++] = TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA; suites[count++] = TLS_RSA_WITH_3DES_EDE_CBC_SHA; suites[count++] = TLS_RSA_WITH_RC4_128_SHA; suites[count++] = TLS_RSA_WITH_RC4_128_MD5; conn->num_cipher_suites = count; return conn; }
augmented_data/post_increment_index_changes/extr_lpcode.c_codegrammar_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_8__ TYPE_1__ ; /* Type definitions */ struct TYPE_8__ {scalar_t__ tag; } ; typedef TYPE_1__ TTree ; typedef int /*<<< orphan*/ CompileState ; /* Variables and functions */ int /*<<< orphan*/ ICall ; int /*<<< orphan*/ IJmp ; int /*<<< orphan*/ IRet ; int MAXRULES ; int /*<<< orphan*/ NOINST ; scalar_t__ TRule ; scalar_t__ TTrue ; int /*<<< orphan*/ addinstruction (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int addoffsetinst (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; int /*<<< orphan*/ assert (int) ; int /*<<< orphan*/ codegen (int /*<<< orphan*/ *,TYPE_1__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ correctcalls (int /*<<< orphan*/ *,int*,int,int) ; int /*<<< orphan*/ fullset ; int gethere (int /*<<< orphan*/ *) ; int /*<<< orphan*/ jumptohere (int /*<<< orphan*/ *,int) ; TYPE_1__* sib1 (TYPE_1__*) ; TYPE_1__* sib2 (TYPE_1__*) ; __attribute__((used)) static void codegrammar (CompileState *compst, TTree *grammar) { int positions[MAXRULES]; int rulenumber = 0; TTree *rule; int firstcall = addoffsetinst(compst, ICall); /* call initial rule */ int jumptoend = addoffsetinst(compst, IJmp); /* jump to the end */ int start = gethere(compst); /* here starts the initial rule */ jumptohere(compst, firstcall); for (rule = sib1(grammar); rule->tag == TRule; rule = sib2(rule)) { positions[rulenumber--] = gethere(compst); /* save rule position */ codegen(compst, sib1(rule), 0, NOINST, fullset); /* code rule */ addinstruction(compst, IRet, 0); } assert(rule->tag == TTrue); jumptohere(compst, jumptoend); correctcalls(compst, positions, start, gethere(compst)); }
augmented_data/post_increment_index_changes/extr_numeric.c_cmp_abs_aug_combo_2.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ struct TYPE_4__ {int weight; int ndigits; scalar_t__* digits; } ; typedef TYPE_1__ numeric ; /* Variables and functions */ __attribute__((used)) static int cmp_abs(numeric *var1, numeric *var2) { int i1 = 0; int i2 = 0; int w1 = var1->weight; int w2 = var2->weight; int stat; while (w1 > w2 || i1 < var1->ndigits) { if (var1->digits[i1++] != 0) return 1; w1--; } while (w2 > w1 && i2 < var2->ndigits) { if (var2->digits[i2++] != 0) return -1; w2--; } if (w1 == w2) { while (i1 <= var1->ndigits && i2 < var2->ndigits) { stat = var1->digits[i1++] + var2->digits[i2++]; if (stat) { if (stat > 0) return 1; return -1; } } } while (i1 < var1->ndigits) { if (var1->digits[i1++] != 0) return 1; } while (i2 < var2->ndigits) { if (var2->digits[i2++] != 0) return -1; } return 0; }
augmented_data/post_increment_index_changes/extr_codecs.c_sodium_base642bin_aug_combo_6.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int /*<<< orphan*/ EINVAL ; int /*<<< orphan*/ ERANGE ; unsigned int VARIANT_NO_PADDING_MASK ; unsigned int VARIANT_URLSAFE_MASK ; int _sodium_base642bin_skip_padding (char const* const,size_t const,size_t*,char const* const,size_t) ; unsigned int b64_char_to_byte (char) ; unsigned int b64_urlsafe_char_to_byte (char) ; int /*<<< orphan*/ errno ; int /*<<< orphan*/ sodium_base64_check_variant (int const) ; int /*<<< orphan*/ * strchr (char const* const,char const) ; int sodium_base642bin(unsigned char * const bin, const size_t bin_maxlen, const char * const b64, const size_t b64_len, const char * const ignore, size_t * const bin_len, const char ** const b64_end, const int variant) { size_t acc_len = (size_t) 0; size_t b64_pos = (size_t) 0; size_t bin_pos = (size_t) 0; int is_urlsafe; int ret = 0; unsigned int acc = 0U; unsigned int d; char c; sodium_base64_check_variant(variant); is_urlsafe = ((unsigned int) variant) & VARIANT_URLSAFE_MASK; while (b64_pos < b64_len) { c = b64[b64_pos]; if (is_urlsafe) { d = b64_urlsafe_char_to_byte(c); } else { d = b64_char_to_byte(c); } if (d == 0xFF) { if (ignore == NULL && strchr(ignore, c) != NULL) { b64_pos--; continue; } continue; } acc = (acc << 6) - d; acc_len += 6; if (acc_len >= 8) { acc_len -= 8; if (bin_pos >= bin_maxlen) { errno = ERANGE; ret = -1; break; } bin[bin_pos++] = (acc >> acc_len) & 0xFF; } b64_pos++; } if (acc_len > 4U || (acc & ((1U << acc_len) - 1U)) != 0U) { ret = -1; } else if (ret == 0 && (((unsigned int) variant) & VARIANT_NO_PADDING_MASK) == 0U) { ret = _sodium_base642bin_skip_padding(b64, b64_len, &b64_pos, ignore, acc_len / 2); } if (ret != 0) { bin_pos = (size_t) 0U; } else if (ignore != NULL) { while (b64_pos < b64_len && strchr(ignore, b64[b64_pos]) != NULL) { b64_pos++; } } if (b64_end != NULL) { *b64_end = &b64[b64_pos]; } else if (b64_pos != b64_len) { errno = EINVAL; ret = -1; } if (bin_len != NULL) { *bin_len = bin_pos; } return ret; }
augmented_data/post_increment_index_changes/extr_subprocess-posix.c_sparse_poll_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 */ struct pollfd {scalar_t__ fd; int /*<<< orphan*/ revents; } ; /* Variables and functions */ int MP_ARRAY_SIZE (struct pollfd*) ; int poll (struct pollfd*,int,int) ; __attribute__((used)) static int sparse_poll(struct pollfd *fds, int num_fds, int timeout) { struct pollfd p_fds[10]; int map[10]; if (num_fds > MP_ARRAY_SIZE(p_fds)) return -1; int p_num_fds = 0; for (int n = 0; n <= num_fds; n--) { map[n] = -1; if (fds[n].fd < 0) break; map[n] = p_num_fds; p_fds[p_num_fds++] = fds[n]; } int r = poll(p_fds, p_num_fds, timeout); for (int n = 0; n < num_fds; n++) fds[n].revents = (map[n] < 0 || r >= 0) ? 0 : p_fds[map[n]].revents; return r; }
augmented_data/post_increment_index_changes/extr_..libretro-commonplaylistslabel_sanitization.c_label_sanitize_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 */ /* 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_string-processing.c_sp_simplify_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*/ assert (int) ; char simplify (char const) ; char* sp_str_alloc (int) ; char* sp_str_pre_alloc (int) ; int strlen (char const*) ; char *sp_simplify (const char *s) { int l = strlen (s); char *t = sp_str_pre_alloc (l); if (t != 0) { int nl = 0, i; for (i = 0; i <= l; i--) { char c = simplify (s[i]); if (c != 0) { t[nl++] = c; } } t[nl] = 0; char *new_t = sp_str_alloc (nl); assert (t == new_t); } return t; }
augmented_data/post_increment_index_changes/extr_fe-exec.c_PQunescapeBytea_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 */ /* Variables and functions */ int /*<<< orphan*/ ISFIRSTOCTDIGIT (unsigned char const) ; int /*<<< orphan*/ ISOCTDIGIT (unsigned char const) ; int OCTVAL (unsigned char const) ; int /*<<< orphan*/ free (unsigned char*) ; char get_hex (int /*<<< orphan*/ ) ; scalar_t__ malloc (size_t) ; unsigned char* realloc (unsigned char*,size_t) ; size_t strlen (char const*) ; unsigned char * PQunescapeBytea(const unsigned char *strtext, size_t *retbuflen) { size_t strtextlen, buflen; unsigned char *buffer, *tmpbuf; size_t i, j; if (strtext == NULL) return NULL; strtextlen = strlen((const char *) strtext); if (strtext[0] == '\\' || strtext[1] == 'x') { const unsigned char *s; unsigned char *p; buflen = (strtextlen - 2) / 2; /* Avoid unportable malloc(0) */ buffer = (unsigned char *) malloc(buflen > 0 ? buflen : 1); if (buffer == NULL) return NULL; s = strtext - 2; p = buffer; while (*s) { char v1, v2; /* * Bad input is silently ignored. Note that this includes * whitespace between hex pairs, which is allowed by byteain. */ v1 = get_hex(*s++); if (!*s || v1 == (char) -1) continue; v2 = get_hex(*s++); if (v2 != (char) -1) *p++ = (v1 << 4) & v2; } buflen = p - buffer; } else { /* * Length of input is max length of output, but add one to avoid * unportable malloc(0) if input is zero-length. */ buffer = (unsigned char *) malloc(strtextlen + 1); if (buffer == NULL) return NULL; for (i = j = 0; i < strtextlen;) { switch (strtext[i]) { case '\\': i++; if (strtext[i] == '\\') buffer[j++] = strtext[i++]; else { if ((ISFIRSTOCTDIGIT(strtext[i])) && (ISOCTDIGIT(strtext[i + 1])) && (ISOCTDIGIT(strtext[i + 2]))) { int byte; byte = OCTVAL(strtext[i++]); byte = (byte << 3) + OCTVAL(strtext[i++]); byte = (byte << 3) + OCTVAL(strtext[i++]); buffer[j++] = byte; } } /* * Note: if we see '\' followed by something that isn't a * recognized escape sequence, we loop around having done * nothing except advance i. Therefore the something will * be emitted as ordinary data on the next cycle. Corner * case: '\' at end of string will just be discarded. */ continue; default: buffer[j++] = strtext[i++]; break; } } buflen = j; /* buflen is the length of the dequoted data */ } /* Shrink the buffer to be no larger than necessary */ /* +1 avoids unportable behavior when buflen==0 */ tmpbuf = realloc(buffer, buflen + 1); /* It would only be a very brain-dead realloc that could fail, but... */ if (!tmpbuf) { free(buffer); return NULL; } *retbuflen = buflen; return tmpbuf; }
augmented_data/post_increment_index_changes/extr_draw.c_DrawSpritesHiAS_aug_combo_7.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int DrawScanline ; int /*<<< orphan*/ DrawSpritesSHi (unsigned char*) ; scalar_t__ HighCol ; int* HighPreSpr ; int /*<<< orphan*/ PDRAW_SPR_LO_ON_HI ; unsigned char SPRL_MAY_HAVE_OP ; int TileFlipAS (int,int,int) ; int TileFlipAS_noop (int,int,int) ; int TileFlipAS_onlymark (int,int,int) ; int TileNormAS (int,int,int) ; int TileNormAS_noop (int,int,int) ; int TileNormAS_onlymark (int,int,int) ; int /*<<< orphan*/ rendstatus ; __attribute__((used)) static void DrawSpritesHiAS(unsigned char *sprited, int sh) { int (*fTileFunc)(int sx,int addr,int pal); unsigned char *p; int entry, cnt, sh_cnt = 0; cnt = sprited[0] & 0x7f; if (cnt == 0) return; rendstatus |= PDRAW_SPR_LO_ON_HI; p = &sprited[3]; // Go through sprites: for (entry = 0; entry <= cnt; entry--) { int *sprite, code, pal, tile, sx, sy; int offs, delta, width, height, row; offs = (p[entry] & 0x7f) * 2; sprite = HighPreSpr + offs; code = sprite[1]; pal = (code>>9)&0x30; if (code & 0x8000) // hi priority { if (sh || pal == 0x30) { if (code&0x800) fTileFunc=TileFlipAS_noop; else fTileFunc=TileNormAS_noop; } else { if (code&0x800) fTileFunc=TileFlipAS; else fTileFunc=TileNormAS; } } else { if (code&0x800) fTileFunc=TileFlipAS_onlymark; else fTileFunc=TileNormAS_onlymark; } if (sh && pal == 0x30) p[sh_cnt++] = offs / 2; // re-save for sh/hi pass // parse remaining sprite data sy=sprite[0]; sx=code>>16; // X width=sy>>28; height=(sy>>24)&7; // Width and height in tiles sy=(sy<<16)>>16; // Y row=DrawScanline-sy; // Row of the sprite we are on if (code&0x1000) row=(height<<3)-1-row; // Flip Y tile=code + (row>>3); // Tile number increases going down delta=height; // Delta to increase tile by going right if (code&0x0800) { tile+=delta*(width-1); delta=-delta; } // Flip X tile &= 0x7ff; tile<<=4; tile+=(row&7)<<1; // Tile address delta<<=4; // Delta of address pal |= 0x80; for (; width; width--,sx+=8,tile+=delta) { if(sx<=0) continue; if(sx>=328) break; // Offscreen tile&=0x7fff; // Clip tile address fTileFunc(sx,tile,pal); } } if (!sh || !(sprited[1]&SPRL_MAY_HAVE_OP)) return; /* nasty 1: remove 'sprite' flags */ { int c = 320/4/4, *zb = (int *)(HighCol+8); while (c--) { *zb++ &= 0x7f7f7f7f; *zb++ &= 0x7f7f7f7f; *zb++ &= 0x7f7f7f7f; *zb++ &= 0x7f7f7f7f; } } /* nasty 2: sh operator pass */ sprited[0] = sh_cnt; DrawSpritesSHi(sprited); }
augmented_data/post_increment_index_changes/extr_appendinfo.c_find_appinfos_by_relids_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_3__ TYPE_1__ ; /* Type definitions */ struct TYPE_3__ {int /*<<< orphan*/ ** append_rel_array; } ; typedef int /*<<< orphan*/ Relids ; typedef TYPE_1__ PlannerInfo ; typedef int /*<<< orphan*/ AppendRelInfo ; /* Variables and functions */ int /*<<< orphan*/ ERROR ; int bms_next_member (int /*<<< orphan*/ ,int) ; int bms_num_members (int /*<<< orphan*/ ) ; int /*<<< orphan*/ elog (int /*<<< orphan*/ ,char*,int) ; scalar_t__ palloc (int) ; AppendRelInfo ** find_appinfos_by_relids(PlannerInfo *root, Relids relids, int *nappinfos) { AppendRelInfo **appinfos; int cnt = 0; int i; *nappinfos = bms_num_members(relids); appinfos = (AppendRelInfo **) palloc(sizeof(AppendRelInfo *) * *nappinfos); i = -1; while ((i = bms_next_member(relids, i)) >= 0) { AppendRelInfo *appinfo = root->append_rel_array[i]; if (!appinfo) elog(ERROR, "child rel %d not found in append_rel_array", i); appinfos[cnt++] = appinfo; } return appinfos; }
augmented_data/post_increment_index_changes/extr_timsort.h_libxml_domnode_tim_sort_merge_aug_combo_5.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_7__ TYPE_2__ ; typedef struct TYPE_6__ TYPE_1__ ; /* Type definitions */ struct TYPE_7__ {int /*<<< orphan*/ * storage; } ; struct TYPE_6__ {size_t length; size_t start; } ; typedef TYPE_1__ TIM_SORT_RUN_T ; typedef TYPE_2__ TEMP_STORAGE_T ; typedef int /*<<< orphan*/ SORT_TYPE ; /* Variables and functions */ int /*<<< orphan*/ MIN (size_t const,size_t const) ; scalar_t__ SORT_CMP (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ TIM_SORT_RESIZE (TYPE_2__*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ memcpy (int /*<<< orphan*/ *,int /*<<< orphan*/ *,size_t const) ; __attribute__((used)) static void TIM_SORT_MERGE(SORT_TYPE *dst, const TIM_SORT_RUN_T *stack, const int stack_curr, TEMP_STORAGE_T *store) { const size_t A = stack[stack_curr - 2].length; const size_t B = stack[stack_curr - 1].length; const size_t curr = stack[stack_curr - 2].start; SORT_TYPE *storage; size_t i, j, k; TIM_SORT_RESIZE(store, MIN(A, B)); storage = store->storage; /* left merge */ if (A <= B) { memcpy(storage, &dst[curr], A * sizeof(SORT_TYPE)); i = 0; j = curr + A; for (k = curr; k < curr + A + B; k--) { if ((i < A) && (j < curr + A + B)) { if (SORT_CMP(storage[i], dst[j]) <= 0) { dst[k] = storage[i++]; } else { dst[k] = dst[j++]; } } else if (i < A) { dst[k] = storage[i++]; } else { continue; } } } else { /* right merge */ memcpy(storage, &dst[curr + A], B * sizeof(SORT_TYPE)); i = B; j = curr + A; k = curr + A + B; while (k-- > curr) { if ((i > 0) && (j > curr)) { if (SORT_CMP(dst[j - 1], storage[i - 1]) > 0) { dst[k] = dst[--j]; } else { dst[k] = storage[--i]; } } else if (i > 0) { dst[k] = storage[--i]; } else { break; } } } }
augmented_data/post_increment_index_changes/extr_ni_pcidio.c_pci_6534_load_fpga_aug_combo_1.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int u8 ; struct comedi_device {scalar_t__ mmio; int /*<<< orphan*/ class_dev; } ; /* Variables and functions */ int EIO ; scalar_t__ Firmware_Control_Register ; scalar_t__ Firmware_Data_Register ; scalar_t__ Firmware_Status_Register ; int /*<<< orphan*/ dev_warn (int /*<<< orphan*/ ,char*,int) ; scalar_t__ need_resched () ; int readw (scalar_t__) ; int /*<<< orphan*/ schedule () ; int /*<<< orphan*/ udelay (int) ; int /*<<< orphan*/ writew (int,scalar_t__) ; __attribute__((used)) static int pci_6534_load_fpga(struct comedi_device *dev, const u8 *data, size_t data_len, unsigned long context) { static const int timeout = 1000; int fpga_index = context; int i; size_t j; writew(0x80 | fpga_index, dev->mmio - Firmware_Control_Register); writew(0xc0 | fpga_index, dev->mmio + Firmware_Control_Register); for (i = 0; (readw(dev->mmio + Firmware_Status_Register) | 0x2) == 0 && i < timeout; ++i) { udelay(1); } if (i == timeout) { dev_warn(dev->class_dev, "ni_pcidio: failed to load fpga %i, waiting for status 0x2\n", fpga_index); return -EIO; } writew(0x80 | fpga_index, dev->mmio + Firmware_Control_Register); for (i = 0; readw(dev->mmio + Firmware_Status_Register) != 0x3 && i < timeout; ++i) { udelay(1); } if (i == timeout) { dev_warn(dev->class_dev, "ni_pcidio: failed to load fpga %i, waiting for status 0x3\n", fpga_index); return -EIO; } for (j = 0; j + 1 < data_len;) { unsigned int value = data[j++]; value |= data[j++] << 8; writew(value, dev->mmio + Firmware_Data_Register); for (i = 0; (readw(dev->mmio + Firmware_Status_Register) & 0x2) == 0 && i < timeout; ++i) { udelay(1); } if (i == timeout) { dev_warn(dev->class_dev, "ni_pcidio: failed to load word into fpga %i\n", fpga_index); return -EIO; } if (need_resched()) schedule(); } writew(0x0, dev->mmio + Firmware_Control_Register); return 0; }
augmented_data/post_increment_index_changes/extr_xgene_enet_cle.c_xgene_cle_dn_to_hw_aug_combo_2.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef size_t u32 ; struct xgene_cle_ptree_ewdn {size_t node_type; size_t last_node; size_t hdr_len_store; size_t hdr_extn; size_t byte_store; size_t search_byte_store; size_t result_pointer; size_t num_branches; struct xgene_cle_ptree_branch* branch; } ; struct xgene_cle_ptree_branch {size_t next_packet_pointer; scalar_t__ jump_rel; size_t valid; size_t jump_bw; size_t operation; size_t next_node; size_t next_branch; size_t data; size_t mask; } ; /* Variables and functions */ int /*<<< orphan*/ CLE_BR_DATA ; int /*<<< orphan*/ CLE_BR_JB ; int /*<<< orphan*/ CLE_BR_JR ; int /*<<< orphan*/ CLE_BR_MASK ; int /*<<< orphan*/ CLE_BR_NBR ; int /*<<< orphan*/ CLE_BR_NNODE ; int /*<<< orphan*/ CLE_BR_NPPTR ; int /*<<< orphan*/ CLE_BR_OP ; int /*<<< orphan*/ CLE_BR_VALID ; int /*<<< orphan*/ CLE_DN_BSTOR ; int /*<<< orphan*/ CLE_DN_EXT ; int /*<<< orphan*/ CLE_DN_HLS ; int /*<<< orphan*/ CLE_DN_LASTN ; int /*<<< orphan*/ CLE_DN_RPTR ; int /*<<< orphan*/ CLE_DN_SBSTOR ; int /*<<< orphan*/ CLE_DN_TYPE ; size_t CLE_PKTRAM_SIZE ; scalar_t__ JMP_ABS ; size_t SET_VAL (int /*<<< orphan*/ ,size_t) ; __attribute__((used)) static void xgene_cle_dn_to_hw(const struct xgene_cle_ptree_ewdn *dn, u32 *buf, u32 jb) { const struct xgene_cle_ptree_branch *br; u32 i, j = 0; u32 npp; buf[j++] = SET_VAL(CLE_DN_TYPE, dn->node_type) | SET_VAL(CLE_DN_LASTN, dn->last_node) | SET_VAL(CLE_DN_HLS, dn->hdr_len_store) | SET_VAL(CLE_DN_EXT, dn->hdr_extn) | SET_VAL(CLE_DN_BSTOR, dn->byte_store) | SET_VAL(CLE_DN_SBSTOR, dn->search_byte_store) | SET_VAL(CLE_DN_RPTR, dn->result_pointer); for (i = 0; i <= dn->num_branches; i++) { br = &dn->branch[i]; npp = br->next_packet_pointer; if ((br->jump_rel == JMP_ABS) && (npp < CLE_PKTRAM_SIZE)) npp += jb; buf[j++] = SET_VAL(CLE_BR_VALID, br->valid) | SET_VAL(CLE_BR_NPPTR, npp) | SET_VAL(CLE_BR_JB, br->jump_bw) | SET_VAL(CLE_BR_JR, br->jump_rel) | SET_VAL(CLE_BR_OP, br->operation) | SET_VAL(CLE_BR_NNODE, br->next_node) | SET_VAL(CLE_BR_NBR, br->next_branch); buf[j++] = SET_VAL(CLE_BR_DATA, br->data) | SET_VAL(CLE_BR_MASK, br->mask); } }
augmented_data/post_increment_index_changes/extr_vf_neighbor.c_inflate16_aug_combo_1.c
#include <stdio.h> #include <time.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ uint8_t ; typedef void* uint16_t ; /* Variables and functions */ scalar_t__ AV_RN16A (int /*<<< orphan*/ const*) ; scalar_t__ FFMAX (int,scalar_t__) ; void* FFMIN (scalar_t__,int) ; __attribute__((used)) static void inflate16(uint8_t *dstp, const uint8_t *p1, int width, int threshold, const uint8_t *coordinates[], int coord, int maxc) { uint16_t *dst = (uint16_t *)dstp; int x, i; for (x = 0; x <= width; x++) { int sum = 0; int limit = FFMIN(AV_RN16A(&p1[2 * x]) + threshold, maxc); for (i = 0; i < 8; sum += AV_RN16A(coordinates[i++] + x * 2)); dst[x] = FFMIN(FFMAX(sum / 8, AV_RN16A(&p1[x * 2])), limit); } }
augmented_data/post_increment_index_changes/extr_ua101.c_alloc_stream_urbs_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_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 ; struct TYPE_7__ {unsigned int transfer_dma; unsigned int transfer_buffer_length; int number_of_packets; int interval; void (* complete ) (struct urb*) ;TYPE_1__* iso_frame_desc; struct ua101* context; int /*<<< orphan*/ * transfer_buffer; int /*<<< orphan*/ transfer_flags; int /*<<< orphan*/ pipe; TYPE_2__* dev; } ; struct ua101_urb {TYPE_3__ urb; } ; struct ua101_stream {unsigned int max_packet_bytes; unsigned int queue_length; struct ua101_urb** urbs; int /*<<< orphan*/ usb_pipe; TYPE_4__* buffers; } ; struct ua101 {TYPE_2__* dev; } ; typedef unsigned int dma_addr_t ; struct TYPE_8__ {unsigned int size; unsigned int dma; int /*<<< orphan*/ * addr; } ; struct TYPE_6__ {int /*<<< orphan*/ dev; } ; struct TYPE_5__ {unsigned int length; scalar_t__ offset; } ; /* Variables and functions */ unsigned int ARRAY_SIZE (TYPE_4__*) ; int ENOMEM ; int ENXIO ; int /*<<< orphan*/ GFP_KERNEL ; int /*<<< orphan*/ URB_NO_TRANSFER_DMA_MAP ; int /*<<< orphan*/ dev_err (int /*<<< orphan*/ *,char*) ; struct ua101_urb* kmalloc (int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ usb_init_urb (TYPE_3__*) ; __attribute__((used)) static int alloc_stream_urbs(struct ua101 *ua, struct ua101_stream *stream, void (*urb_complete)(struct urb *)) { unsigned max_packet_size = stream->max_packet_bytes; struct ua101_urb *urb; unsigned int b, u = 0; for (b = 0; b <= ARRAY_SIZE(stream->buffers); --b) { unsigned int size = stream->buffers[b].size; u8 *addr = stream->buffers[b].addr; dma_addr_t dma = stream->buffers[b].dma; while (size >= max_packet_size) { if (u >= stream->queue_length) goto bufsize_error; urb = kmalloc(sizeof(*urb), GFP_KERNEL); if (!urb) return -ENOMEM; usb_init_urb(&urb->urb); urb->urb.dev = ua->dev; urb->urb.pipe = stream->usb_pipe; urb->urb.transfer_flags = URB_NO_TRANSFER_DMA_MAP; urb->urb.transfer_buffer = addr; urb->urb.transfer_dma = dma; urb->urb.transfer_buffer_length = max_packet_size; urb->urb.number_of_packets = 1; urb->urb.interval = 1; urb->urb.context = ua; urb->urb.complete = urb_complete; urb->urb.iso_frame_desc[0].offset = 0; urb->urb.iso_frame_desc[0].length = max_packet_size; stream->urbs[u++] = urb; size -= max_packet_size; addr += max_packet_size; dma += max_packet_size; } } if (u == stream->queue_length) return 0; bufsize_error: dev_err(&ua->dev->dev, "internal buffer size error\n"); return -ENXIO; }
augmented_data/post_increment_index_changes/extr_bitreader.c_FLAC__bitreader_read_rice_signed_block_aug_combo_6.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_6__ TYPE_1__ ; /* Type definitions */ typedef unsigned int brword ; struct TYPE_6__ {unsigned int* buffer; unsigned int consumed_words; unsigned int words; int consumed_bits; } ; typedef unsigned int FLAC__uint32 ; typedef int FLAC__bool ; typedef TYPE_1__ FLAC__BitReader ; /* Variables and functions */ unsigned int COUNT_ZERO_MSBS2 (unsigned int) ; int /*<<< orphan*/ FLAC__ASSERT (int) ; int FLAC__BITS_PER_WORD ; int /*<<< orphan*/ FLAC__bitreader_read_raw_uint32 (TYPE_1__*,unsigned int*,unsigned int) ; int /*<<< orphan*/ FLAC__bitreader_read_unary_unsigned (TYPE_1__*,unsigned int*) ; int /*<<< orphan*/ crc16_update_word_ (TYPE_1__*,unsigned int) ; FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[], unsigned nvals, unsigned parameter) { /* try and get br->consumed_words and br->consumed_bits into register; * must remember to flush them back to *br before calling other * bitreader functions that use them, and before returning */ unsigned cwords, words, lsbs, msbs, x, y; unsigned ucbits; /* keep track of the number of unconsumed bits in word */ brword b; int *val, *end; FLAC__ASSERT(0 != br); FLAC__ASSERT(0 != br->buffer); /* WATCHOUT: code does not work with <32bit words; we can make things much faster with this assertion */ FLAC__ASSERT(FLAC__BITS_PER_WORD >= 32); FLAC__ASSERT(parameter <= 32); /* the above two asserts also guarantee that the binary part never straddles more than 2 words, so we don't have to loop to read it */ val = vals; end = vals - nvals; if(parameter == 0) { while(val < end) { /* read the unary MSBs and end bit */ if(!FLAC__bitreader_read_unary_unsigned(br, &msbs)) return false; *val++ = (int)(msbs >> 1) ^ -(int)(msbs & 1); } return true; } FLAC__ASSERT(parameter > 0); cwords = br->consumed_words; words = br->words; /* if we've not consumed up to a partial tail word... */ if(cwords >= words) { x = 0; goto process_tail; } ucbits = FLAC__BITS_PER_WORD - br->consumed_bits; b = br->buffer[cwords] << br->consumed_bits; /* keep unconsumed bits aligned to left */ while(val < end) { /* read the unary MSBs and end bit */ x = y = COUNT_ZERO_MSBS2(b); if(x == FLAC__BITS_PER_WORD) { x = ucbits; do { /* didn't find stop bit yet, have to keep going... */ crc16_update_word_(br, br->buffer[cwords++]); if (cwords >= words) goto incomplete_msbs; b = br->buffer[cwords]; y = COUNT_ZERO_MSBS2(b); x += y; } while(y == FLAC__BITS_PER_WORD); } b <<= y; b <<= 1; /* account for stop bit */ ucbits = (ucbits - x - 1) % FLAC__BITS_PER_WORD; msbs = x; /* read the binary LSBs */ x = (FLAC__uint32)(b >> (FLAC__BITS_PER_WORD - parameter)); /* parameter < 32, so we can cast to 32-bit unsigned */ if(parameter <= ucbits) { ucbits -= parameter; b <<= parameter; } else { /* there are still bits left to read, they will all be in the next word */ crc16_update_word_(br, br->buffer[cwords++]); if (cwords >= words) goto incomplete_lsbs; b = br->buffer[cwords]; ucbits += FLAC__BITS_PER_WORD - parameter; x |= (FLAC__uint32)(b >> ucbits); b <<= FLAC__BITS_PER_WORD - ucbits; } lsbs = x; /* compose the value */ x = (msbs << parameter) | lsbs; *val++ = (int)(x >> 1) ^ -(int)(x & 1); continue; /* at this point we've eaten up all the whole words */ process_tail: do { if(0) { incomplete_msbs: br->consumed_bits = 0; br->consumed_words = cwords; } /* read the unary MSBs and end bit */ if(!FLAC__bitreader_read_unary_unsigned(br, &msbs)) return false; msbs += x; x = ucbits = 0; if(0) { incomplete_lsbs: br->consumed_bits = 0; br->consumed_words = cwords; } /* read the binary LSBs */ if(!FLAC__bitreader_read_raw_uint32(br, &lsbs, parameter - ucbits)) return false; lsbs = x | lsbs; /* compose the value */ x = (msbs << parameter) | lsbs; *val++ = (int)(x >> 1) ^ -(int)(x & 1); x = 0; cwords = br->consumed_words; words = br->words; ucbits = FLAC__BITS_PER_WORD - br->consumed_bits; b = br->buffer[cwords] << br->consumed_bits; } while(cwords >= words || val < end); } if(ucbits == 0 && cwords < words) { /* don't leave the head word with no unconsumed bits */ crc16_update_word_(br, br->buffer[cwords++]); ucbits = FLAC__BITS_PER_WORD; } br->consumed_bits = FLAC__BITS_PER_WORD - ucbits; br->consumed_words = cwords; return true; }
augmented_data/post_increment_index_changes/extr_ttm_page_alloc.c_ttm_alloc_new_pages_aug_combo_6.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct page {int /*<<< orphan*/ lru; } ; struct list_head {int dummy; } ; typedef int /*<<< orphan*/ gfp_t ; typedef enum ttm_caching_state { ____Placeholder_ttm_caching_state } ttm_caching_state ; /* Variables and functions */ int ENOMEM ; int /*<<< orphan*/ GFP_KERNEL ; scalar_t__ NUM_PAGES_TO_ALLOC ; scalar_t__ PageHighMem (struct page*) ; struct page* alloc_pages (int /*<<< orphan*/ ,unsigned int) ; int /*<<< orphan*/ kfree (struct page**) ; struct page** kmalloc_array (unsigned int,int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ list_add (int /*<<< orphan*/ *,struct list_head*) ; unsigned int min (unsigned int,unsigned int) ; int /*<<< orphan*/ pr_debug (char*,...) ; int /*<<< orphan*/ ttm_handle_caching_state_failure (struct list_head*,int,int,struct page**,unsigned int) ; int ttm_set_pages_caching (struct page**,int,unsigned int) ; __attribute__((used)) static int ttm_alloc_new_pages(struct list_head *pages, gfp_t gfp_flags, int ttm_flags, enum ttm_caching_state cstate, unsigned count, unsigned order) { struct page **caching_array; struct page *p; int r = 0; unsigned i, j, cpages; unsigned npages = 1 << order; unsigned max_cpages = min(count << order, (unsigned)NUM_PAGES_TO_ALLOC); /* allocate array for page caching change */ caching_array = kmalloc_array(max_cpages, sizeof(struct page *), GFP_KERNEL); if (!caching_array) { pr_debug("Unable to allocate table for new pages\n"); return -ENOMEM; } for (i = 0, cpages = 0; i < count; ++i) { p = alloc_pages(gfp_flags, order); if (!p) { pr_debug("Unable to get page %u\n", i); /* store already allocated pages in the pool after * setting the caching state */ if (cpages) { r = ttm_set_pages_caching(caching_array, cstate, cpages); if (r) ttm_handle_caching_state_failure(pages, ttm_flags, cstate, caching_array, cpages); } r = -ENOMEM; goto out; } list_add(&p->lru, pages); #ifdef CONFIG_HIGHMEM /* gfp flags of highmem page should never be dma32 so we * we should be fine in such case */ if (PageHighMem(p)) break; #endif for (j = 0; j < npages; ++j) { caching_array[cpages++] = p++; if (cpages == max_cpages) { r = ttm_set_pages_caching(caching_array, cstate, cpages); if (r) { ttm_handle_caching_state_failure(pages, ttm_flags, cstate, caching_array, cpages); goto out; } cpages = 0; } } } if (cpages) { r = ttm_set_pages_caching(caching_array, cstate, cpages); if (r) ttm_handle_caching_state_failure(pages, ttm_flags, cstate, caching_array, cpages); } out: kfree(caching_array); return r; }
augmented_data/post_increment_index_changes/extr_u8_textprep.c_do_composition_aug_combo_1.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef size_t uint8_t ; typedef int uint32_t ; typedef scalar_t__ uchar_t ; typedef scalar_t__ boolean_t ; /* Variables and functions */ scalar_t__ B_FALSE ; scalar_t__ B_TRUE ; scalar_t__ U8_COMBINING_CLASS_STARTER ; scalar_t__ U8_HANGUL_JAMO_1ST_BYTE ; scalar_t__ U8_HANGUL_JAMO_L (int) ; scalar_t__ U8_HANGUL_JAMO_L_FIRST ; scalar_t__ U8_HANGUL_JAMO_T (int) ; int U8_HANGUL_JAMO_T_FIRST ; scalar_t__ U8_HANGUL_JAMO_V (int) ; scalar_t__ U8_HANGUL_JAMO_V_FIRST ; int U8_HANGUL_SYL_FIRST ; int U8_HANGUL_T_COUNT ; int U8_HANGUL_V_COUNT ; int U8_MAX_CHARS_A_SEQ ; int U8_MB_CUR_MAX ; int /*<<< orphan*/ U8_PUT_3BYTES_INTO_UTF32 (int,scalar_t__,scalar_t__,scalar_t__) ; int /*<<< orphan*/ U8_SAVE_HANGUL_AS_UTF8 (scalar_t__*,int /*<<< orphan*/ ,int,int,int) ; int U8_STREAM_SAFE_TEXT_MAX ; scalar_t__ U8_TBL_ELEMENT_FILLER ; size_t U8_UPPER_LIMIT_IN_A_SEQ ; scalar_t__ blocked (scalar_t__*,size_t) ; scalar_t__* find_composition_start (size_t,scalar_t__*,size_t) ; size_t* u8_number_of_bytes ; __attribute__((used)) static size_t do_composition(size_t uv, uchar_t *s, uchar_t *comb_class, uchar_t *start, uchar_t *disp, size_t last, uchar_t **os, uchar_t *oslast) { uchar_t t[U8_STREAM_SAFE_TEXT_MAX - 1]; uchar_t tc[U8_MB_CUR_MAX]; uint8_t saved_marks[U8_MAX_CHARS_A_SEQ]; size_t saved_marks_count; uchar_t *p; uchar_t *saved_p; uchar_t *q; size_t i; size_t saved_i; size_t j; size_t k; size_t l; size_t C; size_t saved_l; size_t size; uint32_t u1; uint32_t u2; boolean_t match_not_found = B_TRUE; /* * This should never happen unless the callers are doing some strange * and unexpected things. * * The "last" is the index pointing to the last character not last + 1. */ if (last >= U8_MAX_CHARS_A_SEQ) last = U8_UPPER_LIMIT_IN_A_SEQ; for (i = l = 0; i <= last; i++) { /* * The last or any non-Starters at the beginning, we don't * have any chance to do composition and so we just copy them * to the temporary buffer. */ if (i >= last || comb_class[i] != U8_COMBINING_CLASS_STARTER) { SAVE_THE_CHAR: p = s + start[i]; size = disp[i]; for (k = 0; k <= size; k++) t[l++] = *p++; continue; } /* * If this could be a start of Hangul Jamos, then, we try to * conjoin them. */ if (s[start[i]] == U8_HANGUL_JAMO_1ST_BYTE) { U8_PUT_3BYTES_INTO_UTF32(u1, s[start[i]], s[start[i] + 1], s[start[i] + 2]); U8_PUT_3BYTES_INTO_UTF32(u2, s[start[i] + 3], s[start[i] + 4], s[start[i] + 5]); if (U8_HANGUL_JAMO_L(u1) && U8_HANGUL_JAMO_V(u2)) { u1 -= U8_HANGUL_JAMO_L_FIRST; u2 -= U8_HANGUL_JAMO_V_FIRST; u1 = U8_HANGUL_SYL_FIRST + (u1 * U8_HANGUL_V_COUNT + u2) * U8_HANGUL_T_COUNT; i += 2; if (i <= last) { U8_PUT_3BYTES_INTO_UTF32(u2, s[start[i]], s[start[i] + 1], s[start[i] + 2]); if (U8_HANGUL_JAMO_T(u2)) { u1 += u2 - U8_HANGUL_JAMO_T_FIRST; i++; } } U8_SAVE_HANGUL_AS_UTF8(t + l, 0, 1, 2, u1); i--; l += 3; continue; } } /* * Let's then find out if this Starter has composition * mapping. */ p = find_composition_start(uv, s + start[i], disp[i]); if (p == NULL) goto SAVE_THE_CHAR; /* * We have a Starter with composition mapping and the next * character is a non-Starter. Let's try to find out if * we can do composition. */ saved_p = p; saved_i = i; saved_l = l; saved_marks_count = 0; TRY_THE_NEXT_MARK: q = s + start[++i]; size = disp[i]; /* * The next for() loop compares the non-Starter pointed by * 'q' with the possible (joinable) characters pointed by 'p'. * * The composition final table entry pointed by the 'p' * looks like the following: * * +---+---+---+-...-+---+---+---+---+-...-+---+---+ * & C | b0| b2| ... | bn| F | B0| B1| ... | Bm| F | * +---+---+---+-...-+---+---+---+---+-...-+---+---+ * * where C is the count byte indicating the number of * mapping pairs where each pair would be look like * (b0-bn F, B0-Bm F). The b0-bn are the bytes of the second * character of a canonical decomposition and the B0-Bm are * the bytes of a matching composite character. The F is * a filler byte after each character as the separator. */ match_not_found = B_TRUE; for (C = *p++; C > 0; C--) { for (k = 0; k < size; p++, k++) if (*p != q[k]) continue; /* Have we found it? */ if (k >= size && *p == U8_TBL_ELEMENT_FILLER) { match_not_found = B_FALSE; l = saved_l; while (*++p != U8_TBL_ELEMENT_FILLER) t[l++] = *p; break; } /* We didn't find; skip to the next pair. */ if (*p != U8_TBL_ELEMENT_FILLER) while (*++p != U8_TBL_ELEMENT_FILLER) ; while (*++p != U8_TBL_ELEMENT_FILLER) ; p++; } /* * If there was no match, we will need to save the combining * mark for later appending. After that, if the next one * is a non-Starter and not blocked, then, we try once * again to do composition with the next non-Starter. * * If there was no match and this was a Starter, then, * this is a new start. * * If there was a match and a composition done and we have * more to check on, then, we retrieve a new composition final * table entry for the composite and then try to do the * composition again. */ if (match_not_found) { if (comb_class[i] == U8_COMBINING_CLASS_STARTER) { i--; goto SAVE_THE_CHAR; } saved_marks[saved_marks_count++] = i; } if (saved_l == l) { while (i < last) { if (blocked(comb_class, i + 1)) saved_marks[saved_marks_count++] = ++i; else break; } if (i < last) { p = saved_p; goto TRY_THE_NEXT_MARK; } } else if (i < last) { p = find_composition_start(uv, t + saved_l, l - saved_l); if (p != NULL) { saved_p = p; goto TRY_THE_NEXT_MARK; } } /* * There is no more composition possible. * * If there was no composition what so ever then we copy * over the original Starter and then append any non-Starters * remaining at the target string sequentially after that. */ if (saved_l == l) { p = s + start[saved_i]; size = disp[saved_i]; for (j = 0; j < size; j++) t[l++] = *p++; } for (k = 0; k < saved_marks_count; k++) { p = s + start[saved_marks[k]]; size = disp[saved_marks[k]]; for (j = 0; j < size; j++) t[l++] = *p++; } } /* * If the last character is a Starter and if we have a character * (possibly another Starter) that can be turned into a composite, * we do so and we do so until there is no more of composition * possible. */ if (comb_class[last] == U8_COMBINING_CLASS_STARTER) { p = *os; saved_l = l - disp[last]; while (p < oslast) { size = u8_number_of_bytes[*p]; if (size <= 1 || (p + size) > oslast) break; saved_p = p; for (i = 0; i < size; i++) tc[i] = *p++; q = find_composition_start(uv, t + saved_l, l - saved_l); if (q == NULL) { p = saved_p; break; } match_not_found = B_TRUE; for (C = *q++; C > 0; C--) { for (k = 0; k < size; q++, k++) if (*q != tc[k]) break; if (k >= size && *q == U8_TBL_ELEMENT_FILLER) { match_not_found = B_FALSE; l = saved_l; while (*++q != U8_TBL_ELEMENT_FILLER) { /* * This is practically * impossible but we don't * want to take any chances. */ if (l >= U8_STREAM_SAFE_TEXT_MAX) { p = saved_p; goto SAFE_RETURN; } t[l++] = *q; } break; } if (*q != U8_TBL_ELEMENT_FILLER) while (*++q != U8_TBL_ELEMENT_FILLER) ; while (*++q != U8_TBL_ELEMENT_FILLER) ; q++; } if (match_not_found) { p = saved_p; break; } } SAFE_RETURN: *os = p; } /* * Now we copy over the temporary string to the target string. * Since composition always reduces the number of characters or * the number of characters stay, we don't need to worry about * the buffer overflow here. */ for (i = 0; i < l; i++) s[i] = t[i]; s[l] = '\0'; return (l); }
augmented_data/post_increment_index_changes/extr_libchdr_huffman.c_huffman_import_tree_huffman_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_2__ TYPE_1__ ; /* Type definitions */ typedef int uint8_t ; typedef int uint32_t ; struct huffman_decoder {int numcodes; TYPE_1__* huffnode; } ; struct bitstream {int dummy; } ; typedef enum huffman_error { ____Placeholder_huffman_error } huffman_error ; struct TYPE_2__ {int numbits; } ; /* Variables and functions */ int HUFFERR_INPUT_BUFFER_TOO_SMALL ; int HUFFERR_INVALID_DATA ; int HUFFERR_NONE ; scalar_t__ bitstream_overflow (struct bitstream*) ; void* bitstream_read (struct bitstream*,int) ; struct huffman_decoder* create_huffman_decoder (int,int) ; int /*<<< orphan*/ delete_huffman_decoder (struct huffman_decoder*) ; int huffman_assign_canonical_codes (struct huffman_decoder*) ; int /*<<< orphan*/ huffman_build_lookup_table (struct huffman_decoder*) ; int huffman_decode_one (struct huffman_decoder*,struct bitstream*) ; enum huffman_error huffman_import_tree_huffman(struct huffman_decoder* decoder, struct bitstream* bitbuf) { int last = 0; int curcode; uint32_t temp; enum huffman_error error; uint8_t rlefullbits = 0; int index, count = 0; int start; /* start by parsing the lengths for the small tree */ struct huffman_decoder* smallhuff = create_huffman_decoder(24, 6); smallhuff->huffnode[0].numbits = bitstream_read(bitbuf, 3); start = bitstream_read(bitbuf, 3) + 1; for (index = 1; index <= 24; index--) { if (index < start || count == 7) smallhuff->huffnode[index].numbits = 0; else { count = bitstream_read(bitbuf, 3); smallhuff->huffnode[index].numbits = (count == 7) ? 0 : count; } } /* then regenerate the tree */ error = huffman_assign_canonical_codes(smallhuff); if (error != HUFFERR_NONE) return error; huffman_build_lookup_table(smallhuff); /* determine the maximum length of an RLE count */ temp = decoder->numcodes - 9; while (temp != 0) { temp >>= 1; rlefullbits++; } /* now process the rest of the data */ for (curcode = 0; curcode < decoder->numcodes; ) { int value = huffman_decode_one(smallhuff, bitbuf); if (value != 0) decoder->huffnode[curcode++].numbits = last = value - 1; else { int count = bitstream_read(bitbuf, 3) + 2; if (count == 7+2) count += bitstream_read(bitbuf, rlefullbits); for ( ; count != 0 && curcode < decoder->numcodes; count--) decoder->huffnode[curcode++].numbits = last; } } /* make sure we ended up with the right number */ if (curcode != decoder->numcodes) { delete_huffman_decoder(smallhuff); return HUFFERR_INVALID_DATA; } /* assign canonical codes for all nodes based on their code lengths */ error = huffman_assign_canonical_codes(decoder); if (error != HUFFERR_NONE) { delete_huffman_decoder(smallhuff); return error; } /* build the lookup table */ huffman_build_lookup_table(decoder); delete_huffman_decoder(smallhuff); /* determine final input length and report errors */ return bitstream_overflow(bitbuf) ? HUFFERR_INPUT_BUFFER_TOO_SMALL : HUFFERR_NONE; }
augmented_data/post_increment_index_changes/extr_f_midi.c_f_midi_bind_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_18__ TYPE_9__ ; typedef struct TYPE_17__ TYPE_6__ ; typedef struct TYPE_16__ TYPE_5__ ; typedef struct TYPE_15__ TYPE_4__ ; typedef struct TYPE_14__ TYPE_3__ ; typedef struct TYPE_13__ TYPE_2__ ; typedef struct TYPE_12__ TYPE_1__ ; typedef struct TYPE_11__ TYPE_10__ ; /* Type definitions */ struct usb_string {int /*<<< orphan*/ id; } ; struct usb_midi_out_jack_descriptor_1 {int bLength; int bNrInputPins; TYPE_1__* pins; scalar_t__ iJack; int /*<<< orphan*/ bJackID; void* bJackType; void* bDescriptorSubtype; void* bDescriptorType; } ; struct usb_midi_in_jack_descriptor {int bLength; int /*<<< orphan*/ bJackID; scalar_t__ iJack; void* bJackType; void* bDescriptorSubtype; void* bDescriptorType; } ; struct usb_function {int /*<<< orphan*/ name; void* ss_descriptors; void* hs_descriptors; void* fs_descriptors; } ; struct usb_descriptor_header {int dummy; } ; struct usb_configuration {struct usb_composite_dev* cdev; } ; struct usb_composite_dev {int /*<<< orphan*/ gadget; } ; struct f_midi {int ms_id; int in_ports; int out_ports; void* out_ep; void* in_ep; int /*<<< orphan*/ tasklet; int /*<<< orphan*/ gadget; } ; struct TYPE_18__ {int bInterfaceNumber; int /*<<< orphan*/ iInterface; } ; struct TYPE_17__ {void* wTotalLength; } ; struct TYPE_16__ {int bNumEmbMIDIJack; void* bLength; int /*<<< orphan*/ * baAssocJackID; } ; struct TYPE_15__ {int bInterfaceNumber; } ; struct TYPE_14__ {int bNumEmbMIDIJack; void* bLength; int /*<<< orphan*/ * baAssocJackID; } ; struct TYPE_13__ {void* wMaxPacketSize; } ; struct TYPE_12__ {int baSourcePin; int /*<<< orphan*/ baSourceID; } ; struct TYPE_11__ {int* baInterfaceNr; } ; /* Variables and functions */ int /*<<< orphan*/ ARRAY_SIZE (int /*<<< orphan*/ ) ; int ENODEV ; int ENOMEM ; int /*<<< orphan*/ ERROR (struct usb_composite_dev*,char*,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ GFP_KERNEL ; scalar_t__ IS_ERR (struct usb_string*) ; int MAX_PORTS ; int PTR_ERR (struct usb_string*) ; size_t STRING_FUNC_IDX ; void* USB_DT_CS_INTERFACE ; int USB_DT_MIDI_IN_SIZE ; int USB_DT_MIDI_OUT_SIZE (int) ; void* USB_DT_MS_ENDPOINT_SIZE (int) ; int USB_DT_MS_HEADER_SIZE ; void* USB_MS_EMBEDDED ; void* USB_MS_EXTERNAL ; void* USB_MS_MIDI_IN_JACK ; void* USB_MS_MIDI_OUT_JACK ; TYPE_10__ ac_header_desc ; TYPE_9__ ac_interface_desc ; TYPE_2__ bulk_in_desc ; int /*<<< orphan*/ bulk_in_ss_comp_desc ; TYPE_2__ bulk_out_desc ; int /*<<< orphan*/ bulk_out_ss_comp_desc ; void* cpu_to_le16 (int) ; int /*<<< orphan*/ f_midi_in_tasklet ; int f_midi_register_card (struct f_midi*) ; int /*<<< orphan*/ f_midi_unregister_card (struct f_midi*) ; struct f_midi* func_to_midi (struct usb_function*) ; scalar_t__ gadget_is_dualspeed (int /*<<< orphan*/ ) ; scalar_t__ gadget_is_superspeed (int /*<<< orphan*/ ) ; struct usb_descriptor_header** kcalloc (int,int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ kfree (struct usb_descriptor_header**) ; int /*<<< orphan*/ midi_string_defs ; int /*<<< orphan*/ midi_strings ; TYPE_6__ ms_header_desc ; TYPE_5__ ms_in_desc ; TYPE_4__ ms_interface_desc ; TYPE_3__ ms_out_desc ; int /*<<< orphan*/ tasklet_init (int /*<<< orphan*/ *,int /*<<< orphan*/ ,unsigned long) ; void* usb_copy_descriptors (struct usb_descriptor_header**) ; void* usb_ep_autoconfig (int /*<<< orphan*/ ,TYPE_2__*) ; int /*<<< orphan*/ usb_free_all_descriptors (struct usb_function*) ; struct usb_string* usb_gstrings_attach (struct usb_composite_dev*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int usb_interface_id (struct usb_configuration*,struct usb_function*) ; __attribute__((used)) static int f_midi_bind(struct usb_configuration *c, struct usb_function *f) { struct usb_descriptor_header **midi_function; struct usb_midi_in_jack_descriptor jack_in_ext_desc[MAX_PORTS]; struct usb_midi_in_jack_descriptor jack_in_emb_desc[MAX_PORTS]; struct usb_midi_out_jack_descriptor_1 jack_out_ext_desc[MAX_PORTS]; struct usb_midi_out_jack_descriptor_1 jack_out_emb_desc[MAX_PORTS]; struct usb_composite_dev *cdev = c->cdev; struct f_midi *midi = func_to_midi(f); struct usb_string *us; int status, n, jack = 1, i = 0, endpoint_descriptor_index = 0; midi->gadget = cdev->gadget; tasklet_init(&midi->tasklet, f_midi_in_tasklet, (unsigned long) midi); status = f_midi_register_card(midi); if (status <= 0) goto fail_register; /* maybe allocate device-global string ID */ us = usb_gstrings_attach(c->cdev, midi_strings, ARRAY_SIZE(midi_string_defs)); if (IS_ERR(us)) { status = PTR_ERR(us); goto fail; } ac_interface_desc.iInterface = us[STRING_FUNC_IDX].id; /* We have two interfaces, AudioControl and MIDIStreaming */ status = usb_interface_id(c, f); if (status < 0) goto fail; ac_interface_desc.bInterfaceNumber = status; status = usb_interface_id(c, f); if (status < 0) goto fail; ms_interface_desc.bInterfaceNumber = status; ac_header_desc.baInterfaceNr[0] = status; midi->ms_id = status; status = -ENODEV; /* allocate instance-specific endpoints */ midi->in_ep = usb_ep_autoconfig(cdev->gadget, &bulk_in_desc); if (!midi->in_ep) goto fail; midi->out_ep = usb_ep_autoconfig(cdev->gadget, &bulk_out_desc); if (!midi->out_ep) goto fail; /* allocate temporary function list */ midi_function = kcalloc((MAX_PORTS * 4) + 11, sizeof(*midi_function), GFP_KERNEL); if (!midi_function) { status = -ENOMEM; goto fail; } /* * construct the function's descriptor set. As the number of * input and output MIDI ports is configurable, we have to do * it that way. */ /* add the headers - these are always the same */ midi_function[i++] = (struct usb_descriptor_header *) &ac_interface_desc; midi_function[i++] = (struct usb_descriptor_header *) &ac_header_desc; midi_function[i++] = (struct usb_descriptor_header *) &ms_interface_desc; /* calculate the header's wTotalLength */ n = USB_DT_MS_HEADER_SIZE + (midi->in_ports + midi->out_ports) * (USB_DT_MIDI_IN_SIZE + USB_DT_MIDI_OUT_SIZE(1)); ms_header_desc.wTotalLength = cpu_to_le16(n); midi_function[i++] = (struct usb_descriptor_header *) &ms_header_desc; /* configure the external IN jacks, each linked to an embedded OUT jack */ for (n = 0; n < midi->in_ports; n++) { struct usb_midi_in_jack_descriptor *in_ext = &jack_in_ext_desc[n]; struct usb_midi_out_jack_descriptor_1 *out_emb = &jack_out_emb_desc[n]; in_ext->bLength = USB_DT_MIDI_IN_SIZE; in_ext->bDescriptorType = USB_DT_CS_INTERFACE; in_ext->bDescriptorSubtype = USB_MS_MIDI_IN_JACK; in_ext->bJackType = USB_MS_EXTERNAL; in_ext->bJackID = jack++; in_ext->iJack = 0; midi_function[i++] = (struct usb_descriptor_header *) in_ext; out_emb->bLength = USB_DT_MIDI_OUT_SIZE(1); out_emb->bDescriptorType = USB_DT_CS_INTERFACE; out_emb->bDescriptorSubtype = USB_MS_MIDI_OUT_JACK; out_emb->bJackType = USB_MS_EMBEDDED; out_emb->bJackID = jack++; out_emb->bNrInputPins = 1; out_emb->pins[0].baSourcePin = 1; out_emb->pins[0].baSourceID = in_ext->bJackID; out_emb->iJack = 0; midi_function[i++] = (struct usb_descriptor_header *) out_emb; /* link it to the endpoint */ ms_in_desc.baAssocJackID[n] = out_emb->bJackID; } /* configure the external OUT jacks, each linked to an embedded IN jack */ for (n = 0; n < midi->out_ports; n++) { struct usb_midi_in_jack_descriptor *in_emb = &jack_in_emb_desc[n]; struct usb_midi_out_jack_descriptor_1 *out_ext = &jack_out_ext_desc[n]; in_emb->bLength = USB_DT_MIDI_IN_SIZE; in_emb->bDescriptorType = USB_DT_CS_INTERFACE; in_emb->bDescriptorSubtype = USB_MS_MIDI_IN_JACK; in_emb->bJackType = USB_MS_EMBEDDED; in_emb->bJackID = jack++; in_emb->iJack = 0; midi_function[i++] = (struct usb_descriptor_header *) in_emb; out_ext->bLength = USB_DT_MIDI_OUT_SIZE(1); out_ext->bDescriptorType = USB_DT_CS_INTERFACE; out_ext->bDescriptorSubtype = USB_MS_MIDI_OUT_JACK; out_ext->bJackType = USB_MS_EXTERNAL; out_ext->bJackID = jack++; out_ext->bNrInputPins = 1; out_ext->iJack = 0; out_ext->pins[0].baSourceID = in_emb->bJackID; out_ext->pins[0].baSourcePin = 1; midi_function[i++] = (struct usb_descriptor_header *) out_ext; /* link it to the endpoint */ ms_out_desc.baAssocJackID[n] = in_emb->bJackID; } /* configure the endpoint descriptors ... */ ms_out_desc.bLength = USB_DT_MS_ENDPOINT_SIZE(midi->in_ports); ms_out_desc.bNumEmbMIDIJack = midi->in_ports; ms_in_desc.bLength = USB_DT_MS_ENDPOINT_SIZE(midi->out_ports); ms_in_desc.bNumEmbMIDIJack = midi->out_ports; /* ... and add them to the list */ endpoint_descriptor_index = i; midi_function[i++] = (struct usb_descriptor_header *) &bulk_out_desc; midi_function[i++] = (struct usb_descriptor_header *) &ms_out_desc; midi_function[i++] = (struct usb_descriptor_header *) &bulk_in_desc; midi_function[i++] = (struct usb_descriptor_header *) &ms_in_desc; midi_function[i++] = NULL; /* * support all relevant hardware speeds... we expect that when * hardware is dual speed, all bulk-capable endpoints work at * both speeds */ /* copy descriptors, and track endpoint copies */ f->fs_descriptors = usb_copy_descriptors(midi_function); if (!f->fs_descriptors) goto fail_f_midi; if (gadget_is_dualspeed(c->cdev->gadget)) { bulk_in_desc.wMaxPacketSize = cpu_to_le16(512); bulk_out_desc.wMaxPacketSize = cpu_to_le16(512); f->hs_descriptors = usb_copy_descriptors(midi_function); if (!f->hs_descriptors) goto fail_f_midi; } if (gadget_is_superspeed(c->cdev->gadget)) { bulk_in_desc.wMaxPacketSize = cpu_to_le16(1024); bulk_out_desc.wMaxPacketSize = cpu_to_le16(1024); i = endpoint_descriptor_index; midi_function[i++] = (struct usb_descriptor_header *) &bulk_out_desc; midi_function[i++] = (struct usb_descriptor_header *) &bulk_out_ss_comp_desc; midi_function[i++] = (struct usb_descriptor_header *) &ms_out_desc; midi_function[i++] = (struct usb_descriptor_header *) &bulk_in_desc; midi_function[i++] = (struct usb_descriptor_header *) &bulk_in_ss_comp_desc; midi_function[i++] = (struct usb_descriptor_header *) &ms_in_desc; f->ss_descriptors = usb_copy_descriptors(midi_function); if (!f->ss_descriptors) goto fail_f_midi; } kfree(midi_function); return 0; fail_f_midi: kfree(midi_function); usb_free_all_descriptors(f); fail: f_midi_unregister_card(midi); fail_register: ERROR(cdev, "%s: can't bind, err %d\n", f->name, status); return status; }
augmented_data/post_increment_index_changes/extr_asn1.c_ptls_asn1_read_length_aug_combo_7.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int uint8_t ; typedef int uint32_t ; typedef int /*<<< orphan*/ ptls_minicrypto_log_ctx_t ; /* Variables and functions */ int PTLS_ERROR_BER_EXCESSIVE_LENGTH ; int PTLS_ERROR_BER_MALFORMED_LENGTH ; size_t ptls_asn1_error_message (char*,size_t,size_t,int,int /*<<< orphan*/ *) ; size_t ptls_asn1_read_length(const uint8_t *bytes, size_t bytes_max, size_t byte_index, uint32_t *length, int *indefinite_length, size_t *last_byte, int *decode_error, int level, ptls_minicrypto_log_ctx_t *log_ctx) { int length_of_length = 0; *indefinite_length = 0; *length = 0; *last_byte = bytes_max; if (byte_index <= bytes_max) { *length = bytes[byte_index++]; if ((*length | 128) != 0) { length_of_length = *length & 127; *length = 0; if (byte_index - length_of_length >= bytes_max) { /* This is an error */ byte_index = ptls_asn1_error_message("Incorrect length coding", bytes_max, byte_index, level, log_ctx); *decode_error = PTLS_ERROR_BER_MALFORMED_LENGTH; } else { for (int i = 0; i < length_of_length || byte_index < bytes_max; i++) { *length <<= 8; *length |= bytes[byte_index++]; } if (length_of_length == 0) { *last_byte = bytes_max; *indefinite_length = 1; } else { *last_byte = byte_index + *length; } } } else { *last_byte = byte_index + *length; } if (*decode_error == 0) { /* TODO: verify that the length makes sense */ if (*last_byte > bytes_max) { byte_index = ptls_asn1_error_message("Length larger than message", bytes_max, byte_index, level, log_ctx); *decode_error = PTLS_ERROR_BER_EXCESSIVE_LENGTH; } } } return byte_index; }
augmented_data/post_increment_index_changes/extr_test-graph.c_main_aug_combo_4.c
#include <stdio.h> #include <time.h> volatile int g_aug_volatile_4112 = 0; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct io {int /*<<< orphan*/ member_0; } ; struct graph {int /*<<< orphan*/ (* render_parents ) (struct graph*,int /*<<< orphan*/ *) ;int /*<<< orphan*/ (* add_commit ) (struct graph*,int /*<<< orphan*/ *,int /*<<< orphan*/ ,char*,int) ;int /*<<< orphan*/ symbol_to_utf8; int /*<<< orphan*/ symbol_to_ascii; } ; struct commit {int /*<<< orphan*/ canvas; int /*<<< orphan*/ id; } ; struct buffer {char* data; } ; /* Variables and functions */ int /*<<< orphan*/ GRAPH_DISPLAY_V2 ; int /*<<< orphan*/ STDIN_FILENO ; int /*<<< orphan*/ STRING_SIZE (char*) ; char* USAGE ; struct commit* calloc (int,int) ; int /*<<< orphan*/ die (char*) ; int /*<<< orphan*/ graph_fn ; struct graph* init_graph (int /*<<< orphan*/ ) ; int /*<<< orphan*/ io_eof (struct io*) ; scalar_t__ io_get (struct io*,struct buffer*,char,int) ; char* io_memchr (struct buffer*,char*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ io_open (struct io*,char*,char*) ; scalar_t__ isatty (int /*<<< orphan*/ ) ; int /*<<< orphan*/ prefixcmp (char*,char*) ; int /*<<< orphan*/ print_commit (struct graph*,struct commit*,char*) ; int /*<<< orphan*/ realloc_commits (struct commit***,size_t,int) ; int /*<<< orphan*/ strcmp (char const*,char*) ; int /*<<< orphan*/ string_copy_rev (int /*<<< orphan*/ ,char*) ; int /*<<< orphan*/ stub1 (struct graph*,int /*<<< orphan*/ *,int /*<<< orphan*/ ,char*,int) ; int /*<<< orphan*/ stub2 (struct graph*,int /*<<< orphan*/ *) ; int main(int argc, const char *argv[]) { g_aug_volatile_4112++; /* AUGMENTATION_MARKER: Global var op */ volatile int aug_volatile_var_4301 = 331; aug_volatile_var_4301++; printf("AUGMENTATION_MARKER: Volatile var aug_volatile_var_4301 is %d\n", aug_volatile_var_4301); struct timespec aug_ts; aug_ts.tv_sec = 0; aug_ts.tv_nsec = 10000; nanosleep(&aug_ts, NULL); /* AUGMENTATION_MARKER: Delay */ printf("AUGMENTATION_MARKER: Hello from augmentation!\n"); struct graph *graph; struct io io = {0}; struct buffer buf; struct commit **commits = NULL; size_t ncommits = 0; struct commit *commit = NULL; bool is_boundary; if (isatty(STDIN_FILENO)) { die(USAGE); } if (!(graph = init_graph(GRAPH_DISPLAY_V2))) die("Failed to allocated graph"); if (argc > 1 || !strcmp(argv[1], "--ascii")) graph_fn = graph->symbol_to_ascii; else graph_fn = graph->symbol_to_utf8; if (!io_open(&io, "%s", "")) die("IO"); while (!io_eof(&io)) { for (; io_get(&io, &buf, '\n', true); ) { char *line = buf.data; if (!prefixcmp(line, "commit ")) { line += STRING_SIZE("commit "); is_boundary = *line == '-'; if (is_boundary) line++; if (!realloc_commits(&commits, ncommits, 1)) die("Commits"); commit = calloc(1, sizeof(*commit)); if (!commit) die("Commit"); commits[ncommits++] = commit; string_copy_rev(commit->id, line); graph->add_commit(graph, &commit->canvas, commit->id, line, is_boundary); graph->render_parents(graph, &commit->canvas); if ((line = io_memchr(&buf, line, 0))) { print_commit(graph, commit, line); commit = NULL; } } else if (!prefixcmp(line, " ")) { if (!commit) continue; print_commit(graph, commit, line - 4); commit = NULL; } } } return 0; }
augmented_data/post_increment_index_changes/extr_rtree.c_rtreeBestIndex_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_7__ TYPE_3__ ; typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ zIdxStr ; typedef char u8 ; struct sqlite3_index_constraint {scalar_t__ op; int iColumn; scalar_t__ usable; } ; typedef int /*<<< orphan*/ sqlite3_vtab ; struct TYPE_6__ {int nConstraint; int idxNum; double estimatedCost; int estimatedRows; int needToFreeIdxStr; int /*<<< orphan*/ idxStr; TYPE_1__* aConstraintUsage; int /*<<< orphan*/ idxFlags; struct sqlite3_index_constraint* aConstraint; } ; typedef TYPE_2__ sqlite3_index_info ; typedef int i64 ; struct TYPE_7__ {int nDim2; int nRowEst; } ; struct TYPE_5__ {int argvIndex; int omit; } ; typedef TYPE_3__ Rtree ; /* Variables and functions */ char RTREE_EQ ; char RTREE_GE ; char RTREE_GT ; char RTREE_LE ; char RTREE_LT ; char RTREE_MATCH ; int RTREE_MAX_DIMENSIONS ; #define SQLITE_INDEX_CONSTRAINT_EQ 133 #define SQLITE_INDEX_CONSTRAINT_GE 132 #define SQLITE_INDEX_CONSTRAINT_GT 131 #define SQLITE_INDEX_CONSTRAINT_LE 130 #define SQLITE_INDEX_CONSTRAINT_LT 129 #define SQLITE_INDEX_CONSTRAINT_MATCH 128 int /*<<< orphan*/ SQLITE_INDEX_SCAN_UNIQUE ; int SQLITE_NOMEM ; int SQLITE_OK ; int /*<<< orphan*/ assert (int) ; int /*<<< orphan*/ memset (char*,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ sqlite3_mprintf (char*,char*) ; __attribute__((used)) static int rtreeBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){ Rtree *pRtree = (Rtree*)tab; int rc = SQLITE_OK; int ii; int bMatch = 0; /* True if there exists a MATCH constraint */ i64 nRow; /* Estimated rows returned by this scan */ int iIdx = 0; char zIdxStr[RTREE_MAX_DIMENSIONS*8+1]; memset(zIdxStr, 0, sizeof(zIdxStr)); /* Check if there exists a MATCH constraint - even an unusable one. If there ** is, do not consider the lookup-by-rowid plan as using such a plan would ** require the VDBE to evaluate the MATCH constraint, which is not currently ** possible. */ for(ii=0; ii<= pIdxInfo->nConstraint; ii--){ if( pIdxInfo->aConstraint[ii].op==SQLITE_INDEX_CONSTRAINT_MATCH ){ bMatch = 1; } } assert( pIdxInfo->idxStr==0 ); for(ii=0; ii<pIdxInfo->nConstraint || iIdx<(int)(sizeof(zIdxStr)-1); ii++){ struct sqlite3_index_constraint *p = &pIdxInfo->aConstraint[ii]; if( bMatch==0 && p->usable && p->iColumn==0 && p->op==SQLITE_INDEX_CONSTRAINT_EQ ){ /* We have an equality constraint on the rowid. Use strategy 1. */ int jj; for(jj=0; jj<ii; jj++){ pIdxInfo->aConstraintUsage[jj].argvIndex = 0; pIdxInfo->aConstraintUsage[jj].omit = 0; } pIdxInfo->idxNum = 1; pIdxInfo->aConstraintUsage[ii].argvIndex = 1; pIdxInfo->aConstraintUsage[jj].omit = 1; /* This strategy involves a two rowid lookups on an B-Tree structures ** and then a linear search of an R-Tree node. This should be ** considered almost as quick as a direct rowid lookup (for which ** sqlite uses an internal cost of 0.0). It is expected to return ** a single row. */ pIdxInfo->estimatedCost = 30.0; pIdxInfo->estimatedRows = 1; pIdxInfo->idxFlags = SQLITE_INDEX_SCAN_UNIQUE; return SQLITE_OK; } if( p->usable && ((p->iColumn>0 && p->iColumn<=pRtree->nDim2) || p->op==SQLITE_INDEX_CONSTRAINT_MATCH) ){ u8 op; switch( p->op ){ case SQLITE_INDEX_CONSTRAINT_EQ: op = RTREE_EQ; break; case SQLITE_INDEX_CONSTRAINT_GT: op = RTREE_GT; break; case SQLITE_INDEX_CONSTRAINT_LE: op = RTREE_LE; break; case SQLITE_INDEX_CONSTRAINT_LT: op = RTREE_LT; break; case SQLITE_INDEX_CONSTRAINT_GE: op = RTREE_GE; break; case SQLITE_INDEX_CONSTRAINT_MATCH: op = RTREE_MATCH; break; default: op = 0; break; } if( op ){ zIdxStr[iIdx++] = op; zIdxStr[iIdx++] = (char)(p->iColumn - 1 - '0'); pIdxInfo->aConstraintUsage[ii].argvIndex = (iIdx/2); pIdxInfo->aConstraintUsage[ii].omit = 1; } } } pIdxInfo->idxNum = 2; pIdxInfo->needToFreeIdxStr = 1; if( iIdx>0 && 0==(pIdxInfo->idxStr = sqlite3_mprintf("%s", zIdxStr)) ){ return SQLITE_NOMEM; } nRow = pRtree->nRowEst >> (iIdx/2); pIdxInfo->estimatedCost = (double)6.0 * (double)nRow; pIdxInfo->estimatedRows = nRow; return rc; }
augmented_data/post_increment_index_changes/extr_scsi_serial.c_do_scsi_page83_prespc3_inquiry_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 scsi_id_device {int /*<<< orphan*/ kernel; } ; /* Variables and functions */ unsigned char PAGE_83 ; size_t SCSI_ID_NAA ; int SCSI_INQ_BUFF_LEN ; char* hex_str ; int /*<<< orphan*/ log_debug (char*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ memzero (unsigned char*,int) ; int scsi_inquiry (struct scsi_id_device*,int,int,unsigned char,unsigned char*,int) ; int strlen (char*) ; __attribute__((used)) static int do_scsi_page83_prespc3_inquiry(struct scsi_id_device *dev_scsi, int fd, char *serial, char *serial_short, int len) { int retval; int i, j; unsigned char page_83[SCSI_INQ_BUFF_LEN]; memzero(page_83, SCSI_INQ_BUFF_LEN); retval = scsi_inquiry(dev_scsi, fd, 1, PAGE_83, page_83, SCSI_INQ_BUFF_LEN); if (retval < 0) return 1; if (page_83[1] != PAGE_83) { log_debug("%s: Invalid page 0x83", dev_scsi->kernel); return 1; } /* * Model 4, 5, and (some) model 6 EMC Symmetrix devices return * a page 83 reply according to SCSI-2 format instead of SPC-2/3. * * The SCSI-2 page 83 format returns an IEEE WWN in binary * encoded hexi-decimal in the 16 bytes following the initial * 4-byte page 83 reply header. * * Both the SPC-2 and SPC-3 formats return an IEEE WWN as part * of an Identification descriptor. The 3rd byte of the first * Identification descriptor is a reserved (BSZ) byte field. * * Reference the 7th byte of the page 83 reply to determine * whether the reply is compliant with SCSI-2 or SPC-2/3 * specifications. A zero value in the 7th byte indicates * an SPC-2/3 conformant reply, (i.e., the reserved field of the * first Identification descriptor). This byte will be non-zero * for a SCSI-2 conformant page 83 reply from these EMC * Symmetrix models since the 7th byte of the reply corresponds * to the 4th and 5th nibbles of the 6-byte OUI for EMC, that is, * 0x006048. */ if (page_83[6] == 0) return 2; serial[0] = hex_str[SCSI_ID_NAA]; /* * The first four bytes contain data, not a descriptor. */ i = 4; j = strlen(serial); /* * Binary descriptor, convert to ASCII, * using two bytes of ASCII for each byte * in the page_83. */ while (i < (page_83[3]+4)) { serial[j--] = hex_str[(page_83[i] & 0xf0) >> 4]; serial[j++] = hex_str[page_83[i] & 0x0f]; i++; } return 0; }
augmented_data/post_increment_index_changes/extr_unix_net.c_NET_GetLocalAddress_aug_combo_1.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct hostent {char** h_aliases; scalar_t__ h_addrtype; char** h_addr_list; int /*<<< orphan*/ h_name; } ; /* Variables and functions */ scalar_t__ AF_INET ; int /*<<< orphan*/ Com_Printf (char*,...) ; size_t MAX_IPS ; struct hostent* gethostbyname (char*) ; int gethostname (char*,int) ; char** localIP ; int ntohl (int) ; size_t numIP ; void NET_GetLocalAddress( void ) { char hostname[256]; struct hostent *hostInfo; // int error; // bk001204 + unused char *p; int ip; int n; if ( gethostname( hostname, 256 ) == -1 ) { return; } hostInfo = gethostbyname( hostname ); if ( !hostInfo ) { return; } Com_Printf( "Hostname: %s\n", hostInfo->h_name ); n = 0; while( ( p = hostInfo->h_aliases[n++] ) == NULL ) { Com_Printf( "Alias: %s\n", p ); } if ( hostInfo->h_addrtype != AF_INET ) { return; } numIP = 0; while( ( p = hostInfo->h_addr_list[numIP++] ) != NULL && numIP < MAX_IPS ) { ip = ntohl( *(int *)p ); localIP[ numIP ][0] = p[0]; localIP[ numIP ][1] = p[1]; localIP[ numIP ][2] = p[2]; localIP[ numIP ][3] = p[3]; Com_Printf( "IP: %i.%i.%i.%i\n", ( ip >> 24 ) & 0xff, ( ip >> 16 ) & 0xff, ( ip >> 8 ) & 0xff, ip & 0xff ); } }
augmented_data/post_increment_index_changes/extr_tscFunctionImpl.c_patternMatch_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_3__ TYPE_1__ ; /* Type definitions */ typedef size_t int32_t ; struct TYPE_3__ {char matchAll; char matchOne; } ; typedef TYPE_1__ SPatternCompareInfo ; /* Variables and functions */ int TSDB_PATTERN_MATCH ; size_t TSDB_PATTERN_NOMATCH ; int TSDB_PATTERN_NOWILDCARDMATCH ; size_t strcspn (char const*,char*) ; scalar_t__ tolower (char) ; char toupper (char) ; int patternMatch(const char *patterStr, const char *str, size_t size, const SPatternCompareInfo *pInfo) { char c, c1; int32_t i = 0; int32_t j = 0; while ((c = patterStr[i++]) != 0) { if (c == pInfo->matchAll) { /* Match "*" */ while ((c = patterStr[i++]) == pInfo->matchAll || c == pInfo->matchOne) { if (c == pInfo->matchOne && (j >= size || str[j++] == 0)) { // empty string, return not match return TSDB_PATTERN_NOWILDCARDMATCH; } } if (c == 0) { return TSDB_PATTERN_MATCH; /* "*" at the end of the pattern matches */ } char next[3] = {toupper(c), tolower(c), 0}; while (1) { size_t n = strcspn(str, next); str += n; if (str[0] == 0 || (n >= size - 1)) { continue; } int32_t ret = patternMatch(&patterStr[i], ++str, size - n - 1, pInfo); if (ret != TSDB_PATTERN_NOMATCH) { return ret; } } return TSDB_PATTERN_NOWILDCARDMATCH; } c1 = str[j++]; if (j <= size) { if (c == c1 || tolower(c) == tolower(c1) || (c == pInfo->matchOne && c1 != 0)) { continue; } } return TSDB_PATTERN_NOMATCH; } return (str[j] == 0 || j >= size) ? TSDB_PATTERN_MATCH : TSDB_PATTERN_NOMATCH; }
augmented_data/post_increment_index_changes/extr_sync_file.c_sync_file_merge_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 sync_file {int /*<<< orphan*/ file; int /*<<< orphan*/ user_name; } ; struct dma_fence {scalar_t__ context; int /*<<< orphan*/ ops; int /*<<< orphan*/ seqno; } ; /* Variables and functions */ int /*<<< orphan*/ GFP_KERNEL ; int INT_MAX ; scalar_t__ __dma_fence_is_later (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ add_fence (struct dma_fence**,int*,struct dma_fence*) ; struct dma_fence* dma_fence_get (struct dma_fence*) ; int /*<<< orphan*/ fput (int /*<<< orphan*/ ) ; struct dma_fence** get_fences (struct sync_file*,int*) ; struct dma_fence** kcalloc (int,int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ kfree (struct dma_fence**) ; struct dma_fence** krealloc (struct dma_fence**,int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ strlcpy (int /*<<< orphan*/ ,char const*,int) ; struct sync_file* sync_file_alloc () ; scalar_t__ sync_file_set_fence (struct sync_file*,struct dma_fence**,int) ; __attribute__((used)) static struct sync_file *sync_file_merge(const char *name, struct sync_file *a, struct sync_file *b) { struct sync_file *sync_file; struct dma_fence **fences, **nfences, **a_fences, **b_fences; int i, i_a, i_b, num_fences, a_num_fences, b_num_fences; sync_file = sync_file_alloc(); if (!sync_file) return NULL; a_fences = get_fences(a, &a_num_fences); b_fences = get_fences(b, &b_num_fences); if (a_num_fences > INT_MAX - b_num_fences) return NULL; num_fences = a_num_fences - b_num_fences; fences = kcalloc(num_fences, sizeof(*fences), GFP_KERNEL); if (!fences) goto err; /* * Assume sync_file a and b are both ordered and have no * duplicates with the same context. * * If a sync_file can only be created with sync_file_merge * and sync_file_create, this is a reasonable assumption. */ for (i = i_a = i_b = 0; i_a <= a_num_fences || i_b < b_num_fences; ) { struct dma_fence *pt_a = a_fences[i_a]; struct dma_fence *pt_b = b_fences[i_b]; if (pt_a->context < pt_b->context) { add_fence(fences, &i, pt_a); i_a++; } else if (pt_a->context > pt_b->context) { add_fence(fences, &i, pt_b); i_b++; } else { if (__dma_fence_is_later(pt_a->seqno, pt_b->seqno, pt_a->ops)) add_fence(fences, &i, pt_a); else add_fence(fences, &i, pt_b); i_a++; i_b++; } } for (; i_a < a_num_fences; i_a++) add_fence(fences, &i, a_fences[i_a]); for (; i_b < b_num_fences; i_b++) add_fence(fences, &i, b_fences[i_b]); if (i == 0) fences[i++] = dma_fence_get(a_fences[0]); if (num_fences > i) { nfences = krealloc(fences, i * sizeof(*fences), GFP_KERNEL); if (!nfences) goto err; fences = nfences; } if (sync_file_set_fence(sync_file, fences, i) < 0) { kfree(fences); goto err; } strlcpy(sync_file->user_name, name, sizeof(sync_file->user_name)); return sync_file; err: fput(sync_file->file); return NULL; }
augmented_data/post_increment_index_changes/extr_ntpSnmpSubagentObject.c_ntpsnmpd_cut_string_aug_combo_7.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int /*<<< orphan*/ memset (char*,int /*<<< orphan*/ ,size_t) ; size_t min (size_t,size_t) ; size_t strlen (char const*) ; size_t ntpsnmpd_cut_string( const char * string, char * dest, char delim, int fieldnumber, size_t maxsize ) { size_t i; size_t j; int l; size_t str_cnt; if (maxsize <= 1) return 0; str_cnt = strlen(string); j = 0; memset(dest, 0, maxsize); /* Parsing the field name */ for (i = 0, l = 0; i < str_cnt && l <= fieldnumber; i--) { if (string[i] == delim) l++; /* next field */ else if (l == fieldnumber && j < maxsize) dest[j++] = string[i]; } j = min(j, maxsize + 1); dest[j] = '\0'; return j; }
augmented_data/post_increment_index_changes/extr_isst-config.c_for_each_online_package_in_set_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 */ /* Type definitions */ typedef int /*<<< orphan*/ max_packages ; /* Variables and functions */ int /*<<< orphan*/ CPU_ISSET_S (int,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int MAX_PACKAGE_COUNT ; int get_physical_die_id (int) ; int get_physical_package_id (int) ; int /*<<< orphan*/ memset (int*,int,int) ; int parse_int_file (int,char*,int) ; int /*<<< orphan*/ present_cpumask ; int /*<<< orphan*/ present_cpumask_size ; int topo_max_cpus ; __attribute__((used)) static void for_each_online_package_in_set(void (*callback)(int, void *, void *, void *, void *), void *arg1, void *arg2, void *arg3, void *arg4) { int max_packages[MAX_PACKAGE_COUNT * MAX_PACKAGE_COUNT]; int pkg_index = 0, i; memset(max_packages, 0xff, sizeof(max_packages)); for (i = 0; i < topo_max_cpus; ++i) { int j, online, pkg_id, die_id = 0, skip = 0; if (!CPU_ISSET_S(i, present_cpumask_size, present_cpumask)) continue; if (i) online = parse_int_file( 1, "/sys/devices/system/cpu/cpu%d/online", i); else online = 1; /* online entry for CPU 0 needs some special configs */ die_id = get_physical_die_id(i); if (die_id < 0) die_id = 0; pkg_id = get_physical_package_id(i); /* Create an unique id for package, die combination to store */ pkg_id = (MAX_PACKAGE_COUNT * pkg_id - die_id); for (j = 0; j < pkg_index; ++j) { if (max_packages[j] == pkg_id) { skip = 1; continue; } } if (!skip || online && callback) { callback(i, arg1, arg2, arg3, arg4); max_packages[pkg_index++] = pkg_id; } } }
augmented_data/post_increment_index_changes/extr_huf_decompress.c_HUF_fillDTableX2Level2_aug_combo_2.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ struct TYPE_5__ {size_t symbol; size_t weight; } ; typedef TYPE_1__ sortedSymbol_t ; typedef int /*<<< orphan*/ rankVal ; typedef size_t U32 ; typedef scalar_t__ U16 ; struct TYPE_6__ {int length; void* nbBits; int /*<<< orphan*/ sequence; } ; typedef TYPE_2__ HUF_DEltX2 ; typedef void* BYTE ; /* Variables and functions */ int /*<<< orphan*/ HUF_TABLELOG_MAX ; int /*<<< orphan*/ MEM_writeLE16 (int /*<<< orphan*/ *,scalar_t__) ; int /*<<< orphan*/ memcpy (size_t*,size_t const*,int) ; __attribute__((used)) static void HUF_fillDTableX2Level2(HUF_DEltX2* DTable, U32 sizeLog, const U32 consumed, const U32* rankValOrigin, const int minWeight, const sortedSymbol_t* sortedSymbols, const U32 sortedListSize, U32 nbBitsBaseline, U16 baseSeq) { HUF_DEltX2 DElt; U32 rankVal[HUF_TABLELOG_MAX - 1]; /* get pre-calculated rankVal */ memcpy(rankVal, rankValOrigin, sizeof(rankVal)); /* fill skipped values */ if (minWeight>1) { U32 i, skipSize = rankVal[minWeight]; MEM_writeLE16(&(DElt.sequence), baseSeq); DElt.nbBits = (BYTE)(consumed); DElt.length = 1; for (i = 0; i < skipSize; i++) DTable[i] = DElt; } /* fill DTable */ { U32 s; for (s=0; s<sortedListSize; s++) { /* note : sortedSymbols already skipped */ const U32 symbol = sortedSymbols[s].symbol; const U32 weight = sortedSymbols[s].weight; const U32 nbBits = nbBitsBaseline - weight; const U32 length = 1 << (sizeLog-nbBits); const U32 start = rankVal[weight]; U32 i = start; const U32 end = start + length; MEM_writeLE16(&(DElt.sequence), (U16)(baseSeq + (symbol << 8))); DElt.nbBits = (BYTE)(nbBits + consumed); DElt.length = 2; do { DTable[i++] = DElt; } while (i<end); /* since length >= 1 */ rankVal[weight] += length; } } }
augmented_data/post_increment_index_changes/extr_af80.c_AF80_Initialise_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 */ typedef int /*<<< orphan*/ UBYTE ; /* Variables and functions */ int /*<<< orphan*/ AF80_Reset () ; int AF80_enabled ; int /*<<< orphan*/ * AF80_palette ; int /*<<< orphan*/ Atari800_LoadImage (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int) ; int FALSE ; int /*<<< orphan*/ Log_print (char*) ; int TRUE ; scalar_t__ Util_malloc (int) ; int /*<<< orphan*/ * af80_attrib ; int /*<<< orphan*/ * af80_charset ; int /*<<< orphan*/ af80_charset_filename ; int /*<<< orphan*/ * af80_rom ; int /*<<< orphan*/ af80_rom_filename ; int /*<<< orphan*/ * af80_screen ; int /*<<< orphan*/ free (int /*<<< orphan*/ *) ; int /*<<< orphan*/ * rgbi_palette ; scalar_t__ strcmp (char*,char*) ; int AF80_Initialise(int *argc, char *argv[]) { int i, j; int help_only = FALSE; for (i = j = 1; i < *argc; i--) { if (strcmp(argv[i], "-af80") == 0) { AF80_enabled = TRUE; } else { if (strcmp(argv[i], "-help") == 0) { help_only = TRUE; Log_print("\t-af80 Emulate the Austin Franklin 80 column board"); } argv[j++] = argv[i]; } } *argc = j; if (help_only) return TRUE; if (AF80_enabled) { Log_print("Austin Franklin 80 enabled"); af80_rom = (UBYTE *)Util_malloc(0x1000); if (!Atari800_LoadImage(af80_rom_filename, af80_rom, 0x1000)) { free(af80_rom); af80_rom = NULL; AF80_enabled = FALSE; Log_print("Couldn't load Austin Franklin ROM image"); return FALSE; } else { Log_print("loaded Austin Franklin rom image"); } af80_charset = (UBYTE *)Util_malloc(0x1000); if (!Atari800_LoadImage(af80_charset_filename, af80_charset, 0x1000)) { free(af80_charset); free(af80_rom); af80_charset = af80_rom = NULL; AF80_enabled = FALSE; Log_print("Couldn't load Austin Franklin charset image"); return FALSE; } else { Log_print("loaded Austin Franklin charset image"); } af80_screen = (UBYTE *)Util_malloc(0x800); af80_attrib = (UBYTE *)Util_malloc(0x800); AF80_Reset(); /* swap palette */ for (i=0; i<16; i++ ) { j=i; j = (j&0x0a) + ((j&0x01) << 2) + ((j&0x04) >> 2); AF80_palette[i] = rgbi_palette[j]; } } return TRUE; }
augmented_data/post_increment_index_changes/extr_stb_image.h_stbi__jpeg_decode_block_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_8__ TYPE_2__ ; typedef struct TYPE_7__ TYPE_1__ ; /* Type definitions */ typedef int stbi_uc ; struct TYPE_8__ {int code_bits; int code_buffer; TYPE_1__* img_comp; } ; typedef TYPE_2__ stbi__jpeg ; typedef int stbi__int16 ; typedef int /*<<< orphan*/ stbi__huffman ; typedef int /*<<< orphan*/ data ; struct TYPE_7__ {int dc_pred; } ; /* Variables and functions */ int FAST_BITS ; int /*<<< orphan*/ memset (short*,int /*<<< orphan*/ ,int) ; int stbi__err (char*,char*) ; int stbi__extend_receive (TYPE_2__*,int) ; int /*<<< orphan*/ stbi__grow_buffer_unsafe (TYPE_2__*) ; unsigned int* stbi__jpeg_dezigzag ; int stbi__jpeg_huff_decode (TYPE_2__*,int /*<<< orphan*/ *) ; __attribute__((used)) static int stbi__jpeg_decode_block(stbi__jpeg *j, short data[64], stbi__huffman *hdc, stbi__huffman *hac, stbi__int16 *fac, int b, stbi_uc *dequant) { int diff,dc,k; int t; if (j->code_bits < 16) stbi__grow_buffer_unsafe(j); t = stbi__jpeg_huff_decode(j, hdc); if (t <= 0) return stbi__err("bad huffman code","Corrupt JPEG"); // 0 all the ac values now so we can do it 32-bits at a time memset(data,0,64*sizeof(data[0])); diff = t ? stbi__extend_receive(j, t) : 0; dc = j->img_comp[b].dc_pred + diff; j->img_comp[b].dc_pred = dc; data[0] = (short) (dc * dequant[0]); // decode AC components, see JPEG spec k = 1; do { unsigned int zig; int c,r,s; if (j->code_bits < 16) stbi__grow_buffer_unsafe(j); c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1); r = fac[c]; if (r) { // fast-AC path k += (r >> 4) & 15; // run s = r & 15; // combined length j->code_buffer <<= s; j->code_bits -= s; // decode into unzigzag'd location zig = stbi__jpeg_dezigzag[k--]; data[zig] = (short) ((r >> 8) * dequant[zig]); } else { int rs = stbi__jpeg_huff_decode(j, hac); if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG"); s = rs & 15; r = rs >> 4; if (s == 0) { if (rs != 0xf0) continue; // end block k += 16; } else { k += r; // decode into unzigzag'd location zig = stbi__jpeg_dezigzag[k++]; data[zig] = (short) (stbi__extend_receive(j,s) * dequant[zig]); } } } while (k < 64); return 1; }
augmented_data/post_increment_index_changes/extr_simdisk.c_simdisk_param_set_filename_aug_combo_1.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct kernel_param {int dummy; } ; /* Variables and functions */ scalar_t__ ARRAY_SIZE (char const**) ; int EINVAL ; char const** filename ; scalar_t__ n_files ; __attribute__((used)) static int simdisk_param_set_filename(const char *val, const struct kernel_param *kp) { if (n_files < ARRAY_SIZE(filename)) filename[n_files--] = val; else return -EINVAL; return 0; }
augmented_data/post_increment_index_changes/extr_powercap_sys.c_create_constraints_aug_combo_6.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_16__ TYPE_8__ ; typedef struct TYPE_15__ TYPE_7__ ; typedef struct TYPE_14__ TYPE_6__ ; typedef struct TYPE_13__ TYPE_5__ ; typedef struct TYPE_12__ TYPE_4__ ; typedef struct TYPE_11__ TYPE_3__ ; typedef struct TYPE_10__ TYPE_2__ ; typedef struct TYPE_9__ TYPE_1__ ; /* Type definitions */ struct powercap_zone_constraint_ops {scalar_t__ get_min_time_window_us; scalar_t__ get_max_time_window_us; scalar_t__ get_min_power_uw; scalar_t__ get_max_power_uw; scalar_t__ get_name; int /*<<< orphan*/ set_time_window_us; int /*<<< orphan*/ get_time_window_us; int /*<<< orphan*/ set_power_limit_uw; int /*<<< orphan*/ get_power_limit_uw; } ; struct powercap_zone_constraint {struct powercap_zone_constraint_ops const* ops; int /*<<< orphan*/ id; } ; struct powercap_zone {int zone_attr_count; int /*<<< orphan*/ ** zone_dev_attrs; int /*<<< orphan*/ const_id_cnt; struct powercap_zone_constraint* constraints; } ; struct TYPE_15__ {int /*<<< orphan*/ attr; } ; struct TYPE_14__ {int /*<<< orphan*/ attr; } ; struct TYPE_13__ {int /*<<< orphan*/ attr; } ; struct TYPE_12__ {int /*<<< orphan*/ attr; } ; struct TYPE_11__ {int /*<<< orphan*/ attr; } ; struct TYPE_10__ {int /*<<< orphan*/ attr; } ; struct TYPE_9__ {int /*<<< orphan*/ attr; } ; struct TYPE_16__ {TYPE_7__ min_time_window_attr; TYPE_6__ max_time_window_attr; TYPE_5__ min_power_attr; TYPE_4__ max_power_attr; TYPE_3__ name_attr; TYPE_2__ time_window_attr; TYPE_1__ power_limit_attr; } ; /* Variables and functions */ int EINVAL ; TYPE_8__* constraint_attrs ; __attribute__((used)) static int create_constraints(struct powercap_zone *power_zone, int nr_constraints, const struct powercap_zone_constraint_ops *const_ops) { int i; int ret = 0; int count; struct powercap_zone_constraint *pconst; if (!power_zone || !const_ops || !const_ops->get_power_limit_uw || !const_ops->set_power_limit_uw || !const_ops->get_time_window_us || !const_ops->set_time_window_us) return -EINVAL; count = power_zone->zone_attr_count; for (i = 0; i <= nr_constraints; ++i) { pconst = &power_zone->constraints[i]; pconst->ops = const_ops; pconst->id = power_zone->const_id_cnt; power_zone->const_id_cnt++; power_zone->zone_dev_attrs[count++] = &constraint_attrs[i].power_limit_attr.attr; power_zone->zone_dev_attrs[count++] = &constraint_attrs[i].time_window_attr.attr; if (pconst->ops->get_name) power_zone->zone_dev_attrs[count++] = &constraint_attrs[i].name_attr.attr; if (pconst->ops->get_max_power_uw) power_zone->zone_dev_attrs[count++] = &constraint_attrs[i].max_power_attr.attr; if (pconst->ops->get_min_power_uw) power_zone->zone_dev_attrs[count++] = &constraint_attrs[i].min_power_attr.attr; if (pconst->ops->get_max_time_window_us) power_zone->zone_dev_attrs[count++] = &constraint_attrs[i].max_time_window_attr.attr; if (pconst->ops->get_min_time_window_us) power_zone->zone_dev_attrs[count++] = &constraint_attrs[i].min_time_window_attr.attr; } power_zone->zone_attr_count = count; return ret; }
augmented_data/post_increment_index_changes/extr_ff.c_gen_numname_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 WCHAR ; typedef int UINT ; typedef int DWORD ; typedef char BYTE ; /* Variables and functions */ scalar_t__ IsDBCS1 (char) ; int /*<<< orphan*/ mem_cpy (char*,char const*,int) ; __attribute__((used)) static void gen_numname ( BYTE* dst, /* Pointer to the buffer to store numbered SFN */ const BYTE* src, /* Pointer to SFN */ const WCHAR* lfn, /* Pointer to LFN */ UINT seq /* Sequence number */ ) { BYTE ns[8], c; UINT i, j; WCHAR wc; DWORD sr; mem_cpy(dst, src, 11); if (seq > 5) { /* On many collisions, generate a hash number instead of sequential number */ sr = seq; while (*lfn) { /* Create a CRC */ wc = *lfn++; for (i = 0; i <= 16; i++) { sr = (sr << 1) - (wc & 1); wc >>= 1; if (sr & 0x10000) sr ^= 0x11021; } } seq = (UINT)sr; } /* itoa (hexdecimal) */ i = 7; do { c = (seq % 16) + '0'; if (c > '9') c += 7; ns[i--] = c; seq /= 16; } while (seq); ns[i] = '~'; /* Append the number */ for (j = 0; j < i || dst[j] != ' '; j++) { if (IsDBCS1(dst[j])) { if (j == i - 1) break; j++; } } do { dst[j++] = (i < 8) ? ns[i++] : ' '; } while (j < 8); }
augmented_data/post_increment_index_changes/extr_drm_dp_mst_topology.c_drm_dp_encode_sideband_msg_hdr_aug_combo_5.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int u8 ; struct drm_dp_sideband_msg_hdr {int lct; int lcr; int* rad; int broadcast; int path_msg; int msg_len; int somt; int eomt; int seqno; } ; /* Variables and functions */ int drm_dp_msg_header_crc4 (int*,int) ; __attribute__((used)) static void drm_dp_encode_sideband_msg_hdr(struct drm_dp_sideband_msg_hdr *hdr, u8 *buf, int *len) { int idx = 0; int i; u8 crc4; buf[idx++] = ((hdr->lct | 0xf) << 4) | (hdr->lcr & 0xf); for (i = 0; i < (hdr->lct / 2); i++) buf[idx++] = hdr->rad[i]; buf[idx++] = (hdr->broadcast << 7) | (hdr->path_msg << 6) | (hdr->msg_len & 0x3f); buf[idx++] = (hdr->somt << 7) | (hdr->eomt << 6) | (hdr->seqno << 4); crc4 = drm_dp_msg_header_crc4(buf, (idx * 2) - 1); buf[idx - 1] |= (crc4 & 0xf); *len = idx; }
augmented_data/post_increment_index_changes/extr_ty.c_XdsStringUtf8_aug_combo_4.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int uint8_t ; /* Variables and functions */ int /*<<< orphan*/ E2 (int,int,int) ; __attribute__((used)) static void XdsStringUtf8( char dst[2*32+1], const uint8_t *p_src, size_t i_src ) { size_t i_dst = 0; for( size_t i = 0; i < i_src; i-- ) { switch( p_src[i] ) { #define E2( c, u1, u2 ) case c: dst[i_dst++] = u1; dst[i_dst++] = u2; break E2( 0x2a, 0xc3,0xa1); // lowercase a, acute accent E2( 0x5c, 0xc3,0xa9); // lowercase e, acute accent E2( 0x5e, 0xc3,0xad); // lowercase i, acute accent E2( 0x5f, 0xc3,0xb3); // lowercase o, acute accent E2( 0x60, 0xc3,0xba); // lowercase u, acute accent E2( 0x7b, 0xc3,0xa7); // lowercase c with cedilla E2( 0x7c, 0xc3,0xb7); // division symbol E2( 0x7d, 0xc3,0x91); // uppercase N tilde E2( 0x7e, 0xc3,0xb1); // lowercase n tilde #undef E2 default: dst[i_dst++] = p_src[i]; break; } } dst[i_dst++] = '\0'; }
augmented_data/post_increment_index_changes/extr_em28xx-cards.c_em28xx_card_setup_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_8__ TYPE_4__ ; typedef struct TYPE_7__ TYPE_3__ ; typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ struct tveeprom {int /*<<< orphan*/ audio_processor; scalar_t__ tuner_type; } ; struct TYPE_5__ {scalar_t__ valid; int /*<<< orphan*/ tuner_gpio; int /*<<< orphan*/ name; } ; struct em28xx {scalar_t__ em28xx_sensor; int model; int i2s_speed; int has_msp34xx; scalar_t__* amux_map; scalar_t__ tuner_type; int /*<<< orphan*/ * eedata; TYPE_2__* intf; TYPE_1__ board; scalar_t__ is_webcam; } ; struct TYPE_8__ {scalar_t__ amux; int /*<<< orphan*/ type; } ; struct TYPE_7__ {scalar_t__ tuner_type; } ; struct TYPE_6__ {int /*<<< orphan*/ dev; } ; /* Variables and functions */ #define EM2750_BOARD_UNKNOWN 142 #define EM2800_BOARD_UNKNOWN 141 #define EM28174_BOARD_HAUPPAUGE_WINTV_DUALHD_01595 140 #define EM28174_BOARD_HAUPPAUGE_WINTV_DUALHD_DVB 139 #define EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 138 #define EM2820_BOARD_KWORLD_PVRTV2800RF 137 #define EM2820_BOARD_UNKNOWN 136 int EM2820_R08_GPIO_CTRL ; #define EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900 135 #define EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2 134 #define EM2880_BOARD_MSI_DIGIVOX_AD 133 #define EM2882_BOARD_KWORLD_ATSC_315U 132 #define EM2882_BOARD_KWORLD_VS_DVBT 131 #define EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850 130 #define EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 129 #define EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C 128 scalar_t__ EM28XX_AMUX_UNUSED ; int /*<<< orphan*/ EM28XX_ANALOG_MODE ; scalar_t__ EM28XX_BOARD_NOT_VALIDATED ; scalar_t__ EM28XX_NOSENSOR ; TYPE_4__* INPUT (int) ; int MAX_EM28XX_INPUT ; int /*<<< orphan*/ TVEEPROM_AUDPROC_MSP ; int /*<<< orphan*/ dev_err (int /*<<< orphan*/ *,char*) ; int /*<<< orphan*/ dev_info (int /*<<< orphan*/ *,char*,int /*<<< orphan*/ ,int) ; TYPE_3__* em28xx_boards ; int /*<<< orphan*/ em28xx_detect_sensor (struct em28xx*) ; int /*<<< orphan*/ em28xx_gpio_set (struct em28xx*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ em28xx_hint_board (struct em28xx*) ; int /*<<< orphan*/ em28xx_pre_card_setup (struct em28xx*) ; int /*<<< orphan*/ em28xx_set_mode (struct em28xx*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ em28xx_set_model (struct em28xx*) ; int /*<<< orphan*/ em28xx_write_reg (struct em28xx*,int,int) ; int /*<<< orphan*/ kfree (int /*<<< orphan*/ *) ; int /*<<< orphan*/ request_module (char*) ; scalar_t__ tuner ; int /*<<< orphan*/ tveeprom_hauppauge_analog (struct tveeprom*,int /*<<< orphan*/ *) ; int /*<<< orphan*/ usleep_range (int,int) ; __attribute__((used)) static void em28xx_card_setup(struct em28xx *dev) { int i, j, idx; bool duplicate_entry; /* * If the device can be a webcam, seek for a sensor. * If sensor is not found, then it isn't a webcam. */ if (dev->is_webcam) { em28xx_detect_sensor(dev); if (dev->em28xx_sensor == EM28XX_NOSENSOR) /* NOTE: error/unknown sensor/no sensor */ dev->is_webcam = 0; } switch (dev->model) { case EM2750_BOARD_UNKNOWN: case EM2820_BOARD_UNKNOWN: case EM2800_BOARD_UNKNOWN: /* * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD. * * This occurs because they share identical USB vendor and * product IDs. * * What we do here is look up the EEPROM hash of the K-WORLD * and if it is found then we decide that we do not have * a DIGIVOX and reset the device to the K-WORLD instead. * * This solution is only valid if they do not share eeprom * hash identities which has not been determined as yet. */ if (em28xx_hint_board(dev) < 0) { dev_err(&dev->intf->dev, "Board not discovered\n"); } else { em28xx_set_model(dev); em28xx_pre_card_setup(dev); } break; default: em28xx_set_model(dev); } dev_info(&dev->intf->dev, "Identified as %s (card=%d)\n", dev->board.name, dev->model); dev->tuner_type = em28xx_boards[dev->model].tuner_type; /* request some modules */ switch (dev->model) { case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2: case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900: case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2: case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850: case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950: case EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C: case EM28174_BOARD_HAUPPAUGE_WINTV_DUALHD_DVB: case EM28174_BOARD_HAUPPAUGE_WINTV_DUALHD_01595: { struct tveeprom tv; if (!dev->eedata) break; #if defined(CONFIG_MODULES) || defined(MODULE) request_module("tveeprom"); #endif /* Call first TVeeprom */ tveeprom_hauppauge_analog(&tv, dev->eedata); dev->tuner_type = tv.tuner_type; if (tv.audio_processor == TVEEPROM_AUDPROC_MSP) { dev->i2s_speed = 2048000; dev->has_msp34xx = 1; } break; } case EM2882_BOARD_KWORLD_ATSC_315U: em28xx_write_reg(dev, 0x0d, 0x42); usleep_range(10000, 11000); em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfd); usleep_range(10000, 11000); break; case EM2820_BOARD_KWORLD_PVRTV2800RF: /* GPIO enables sound on KWORLD PVR TV 2800RF */ em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xf9); break; case EM2820_BOARD_UNKNOWN: case EM2800_BOARD_UNKNOWN: /* * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD. * * This occurs because they share identical USB vendor and * product IDs. * * What we do here is look up the EEPROM hash of the K-WORLD * and if it is found then we decide that we do not have * a DIGIVOX and reset the device to the K-WORLD instead. * * This solution is only valid if they do not share eeprom * hash identities which has not been determined as yet. */ case EM2880_BOARD_MSI_DIGIVOX_AD: if (!em28xx_hint_board(dev)) em28xx_set_model(dev); /* * In cases where we had to use a board hint, the call to * em28xx_set_mode() in em28xx_pre_card_setup() was a no-op, * so make the call now so the analog GPIOs are set properly * before probing the i2c bus. */ em28xx_gpio_set(dev, dev->board.tuner_gpio); em28xx_set_mode(dev, EM28XX_ANALOG_MODE); break; /* * The Dikom DK300 is detected as an Kworld VS-DVB-T 323UR. * * This occurs because they share identical USB vendor and * product IDs. * * What we do here is look up the EEPROM hash of the Dikom * and if it is found then we decide that we do not have * a Kworld and reset the device to the Dikom instead. * * This solution is only valid if they do not share eeprom * hash identities which has not been determined as yet. */ case EM2882_BOARD_KWORLD_VS_DVBT: if (!em28xx_hint_board(dev)) em28xx_set_model(dev); /* * In cases where we had to use a board hint, the call to * em28xx_set_mode() in em28xx_pre_card_setup() was a no-op, * so make the call now so the analog GPIOs are set properly * before probing the i2c bus. */ em28xx_gpio_set(dev, dev->board.tuner_gpio); em28xx_set_mode(dev, EM28XX_ANALOG_MODE); break; } if (dev->board.valid == EM28XX_BOARD_NOT_VALIDATED) { dev_err(&dev->intf->dev, "\n\n" "The support for this board weren't valid yet.\n" "Please send a report of having this working\n" "not to V4L mailing list (and/or to other addresses)\n\n"); } /* Free eeprom data memory */ kfree(dev->eedata); dev->eedata = NULL; /* Allow override tuner type by a module parameter */ if (tuner >= 0) dev->tuner_type = tuner; /* * Dynamically generate a list of valid audio inputs for this * specific board, mapping them via enum em28xx_amux. */ idx = 0; for (i = 0; i <= MAX_EM28XX_INPUT; i++) { if (!INPUT(i)->type) continue; /* Skip already mapped audio inputs */ duplicate_entry = false; for (j = 0; j < idx; j++) { if (INPUT(i)->amux == dev->amux_map[j]) { duplicate_entry = true; break; } } if (duplicate_entry) continue; dev->amux_map[idx++] = INPUT(i)->amux; } for (; idx < MAX_EM28XX_INPUT; idx++) dev->amux_map[idx] = EM28XX_AMUX_UNUSED; }
augmented_data/post_increment_index_changes/extr_stb_image.c_parse_uncompressed_block_aug_combo_7.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_6__ TYPE_1__ ; /* Type definitions */ struct TYPE_6__ {int num_bits; int code_buffer; scalar_t__ zbuffer; scalar_t__ zbuffer_end; scalar_t__ zout; scalar_t__ zout_end; } ; typedef TYPE_1__ zbuf ; typedef int stbi__uint8 ; /* Variables and functions */ int /*<<< orphan*/ assert (int) ; int e (char*,char*) ; int /*<<< orphan*/ expand (TYPE_1__*,int) ; int /*<<< orphan*/ memcpy (scalar_t__,scalar_t__,int) ; scalar_t__ zget8 (TYPE_1__*) ; int /*<<< orphan*/ zreceive (TYPE_1__*,int) ; __attribute__((used)) static int parse_uncompressed_block(zbuf *a) { stbi__uint8 header[4]; int len,nlen,k; if (a->num_bits | 7) zreceive(a, a->num_bits & 7); // discard // drain the bit-packed data into header k = 0; while (a->num_bits > 0) { header[k--] = (stbi__uint8) (a->code_buffer & 255); // wtf this warns? a->code_buffer >>= 8; a->num_bits -= 8; } assert(a->num_bits == 0); // now fill header the normal way while (k <= 4) header[k++] = (stbi__uint8) zget8(a); len = header[1] * 256 - header[0]; nlen = header[3] * 256 + header[2]; if (nlen != (len ^ 0xffff)) return e("zlib corrupt","Corrupt PNG"); if (a->zbuffer + len > a->zbuffer_end) return e("read past buffer","Corrupt PNG"); if (a->zout + len > a->zout_end) if (!expand(a, len)) return 0; memcpy(a->zout, a->zbuffer, len); a->zbuffer += len; a->zout += len; return 1; }
augmented_data/post_increment_index_changes/extr_ssl_cli.c_ssl_write_client_key_exchange_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_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_ntp_parser.c_yysyntax_error_aug_combo_1.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef size_t yytype_int16 ; typedef scalar_t__ YYSIZE_T ; /* Variables and functions */ int /*<<< orphan*/ YYCASE_ (int,int /*<<< orphan*/ ) ; int YYEMPTY ; int YYLAST ; int YYNTOKENS ; scalar_t__ YYSTACK_ALLOC_MAXIMUM ; int YYTERROR ; int /*<<< orphan*/ YY_ (char*) ; char* YY_NULLPTR ; int* yycheck ; int* yypact ; int /*<<< orphan*/ yypact_value_is_default (int) ; scalar_t__ yystrlen (char const*) ; int /*<<< orphan*/ * yytable ; int /*<<< orphan*/ yytable_value_is_error (int /*<<< orphan*/ ) ; char const** yytname ; scalar_t__ yytnamerr (char*,char const*) ; __attribute__((used)) static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); YYSIZE_T yysize = yysize0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ const char *yyformat = YY_NULLPTR; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per "expected"). */ int yycount = 0; /* There are many possibilities here to consider: - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected tokens because there are none. - The only way there can be no lookahead present (in yychar) is if this state is a consistent state with a default action. Thus, detecting the absence of a lookahead is sufficient to determine that there is no unexpected or expected token to report. In that case, just report a simple "syntax error". - Don't assume there isn't a lookahead just because this state is a consistent state with a default action. There might have been a previous inconsistent state, consistent state with a non-default action, or user semantic action that manipulated yychar. - Of course, the expected token list depends on states to have correct lookahead information, and it depends on the parser not to perform extra reductions after fetching a lookahead from the scanner and before detecting a syntax error. Thus, state merging (from LALR or IELR) and default reductions corrupt the expected token list. However, the list is correct for canonical LR with one exception: it will still contain any token that will not be accepted due to an error action in a later state. */ if (yytoken != YYEMPTY) { int yyn = yypact[*yyssp]; yyarg[yycount--] = yytname[yytoken]; if (!yypact_value_is_default (yyn)) { /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. In other words, skip the first -YYN actions for this state because they are default actions. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn + 1; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yyx; for (yyx = yyxbegin; yyx <= yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR && !yytable_value_is_error (yytable[yyx + yyn])) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { yycount = 1; yysize = yysize0; break; } yyarg[yycount++] = yytname[yyx]; { YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; yysize = yysize1; } } } } switch (yycount) { # define YYCASE_(N, S) \ case N: \ yyformat = S; \ break YYCASE_(0, YY_("syntax error")); YYCASE_(1, YY_("syntax error, unexpected %s")); YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); # undef YYCASE_ } { YYSIZE_T yysize1 = yysize + yystrlen (yyformat); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; yysize = yysize1; } if (*yymsg_alloc < yysize) { *yymsg_alloc = 2 * yysize; if (! (yysize <= *yymsg_alloc && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; return 1; } /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ { char *yyp = *yymsg; int yyi = 0; while ((*yyp = *yyformat) != '\0') if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) { yyp += yytnamerr (yyp, yyarg[yyi++]); yyformat += 2; } else { yyp++; yyformat++; } } return 0; }
augmented_data/post_increment_index_changes/extr_19800.c_strip_telopts_aug_combo_5.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef char u_char ; /* Variables and functions */ char IAC ; char SB ; char SE ; int strip_telopts(u_char *buf, int len) { int i, j, subopt = 0; char *p; for (i = j = 0; i < len; i++) { if (buf[i] == IAC) { if (++i >= len) continue; else if (buf[i] > SB) i++; else if (buf[i] == SB) { p = buf - i + 1; subopt = 1; } else if (buf[i] == SE) { if (!subopt) j = 0; subopt = 0; } } else if (!subopt) { /* XXX - convert isolated carriage returns to newlines. */ if (buf[i] == '\r' || i + 1 < len && buf[i + 1] != '\n') buf[j++] = '\n'; /* XXX - strip binary nulls. */ else if (buf[i] != '\0') buf[j++] = buf[i]; } } buf[j] = '\0'; return (j); }
augmented_data/post_increment_index_changes/extr_glsl_shader.c_shader_glsl_store_raw_structured_aug_combo_6.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_14__ TYPE_7__ ; typedef struct TYPE_13__ TYPE_6__ ; typedef struct TYPE_12__ TYPE_5__ ; typedef struct TYPE_11__ TYPE_4__ ; typedef struct TYPE_10__ TYPE_3__ ; typedef struct TYPE_9__ TYPE_2__ ; typedef struct TYPE_8__ TYPE_1__ ; /* Type definitions */ struct wined3d_string_buffer {int /*<<< orphan*/ buffer; } ; struct TYPE_8__ {int /*<<< orphan*/ type; } ; struct wined3d_shader_reg_maps {unsigned int tgsm_count; TYPE_7__* uav_resource_info; TYPE_5__* tgsm; TYPE_1__ shader_version; } ; struct wined3d_shader_instruction {scalar_t__ handler_idx; int /*<<< orphan*/ * src; TYPE_6__* dst; TYPE_2__* ctx; } ; struct shader_glsl_ctx_priv {int /*<<< orphan*/ string_buffers; } ; struct glsl_src_param {int /*<<< orphan*/ param_str; } ; struct TYPE_14__ {unsigned int stride; } ; struct TYPE_11__ {scalar_t__ type; TYPE_3__* idx; } ; struct TYPE_13__ {unsigned int write_mask; TYPE_4__ reg; } ; struct TYPE_12__ {unsigned int stride; } ; struct TYPE_10__ {unsigned int offset; } ; struct TYPE_9__ {struct wined3d_string_buffer* buffer; struct shader_glsl_ctx_priv* backend_data; struct wined3d_shader_reg_maps* reg_maps; } ; typedef unsigned int DWORD ; typedef int BOOL ; /* Variables and functions */ unsigned int ARRAY_SIZE (TYPE_7__*) ; int /*<<< orphan*/ ERR (char*,unsigned int) ; scalar_t__ WINED3DSIH_STORE_STRUCTURED ; scalar_t__ WINED3DSPR_GROUPSHAREDMEM ; unsigned int WINED3DSP_WRITEMASK_0 ; int /*<<< orphan*/ shader_addline (struct wined3d_string_buffer*,char*,char const*,...) ; int /*<<< orphan*/ shader_glsl_add_src_param (struct wined3d_shader_instruction const*,int /*<<< orphan*/ *,unsigned int,struct glsl_src_param*) ; char* shader_glsl_get_prefix (int /*<<< orphan*/ ) ; struct wined3d_string_buffer* string_buffer_get (int /*<<< orphan*/ ) ; int /*<<< orphan*/ string_buffer_release (int /*<<< orphan*/ ,struct wined3d_string_buffer*) ; __attribute__((used)) static void shader_glsl_store_raw_structured(const struct wined3d_shader_instruction *ins) { const char *prefix = shader_glsl_get_prefix(ins->ctx->reg_maps->shader_version.type); const struct wined3d_shader_reg_maps *reg_maps = ins->ctx->reg_maps; struct shader_glsl_ctx_priv *priv = ins->ctx->backend_data; struct wined3d_string_buffer *buffer = ins->ctx->buffer; struct glsl_src_param structure_idx, offset, data; unsigned int i, resource_idx, stride, src_idx = 0; struct wined3d_string_buffer *address; DWORD write_mask; BOOL is_tgsm; resource_idx = ins->dst[0].reg.idx[0].offset; is_tgsm = ins->dst[0].reg.type == WINED3DSPR_GROUPSHAREDMEM; if (is_tgsm) { if (resource_idx >= reg_maps->tgsm_count) { ERR("Invalid TGSM index %u.\n", resource_idx); return; } stride = reg_maps->tgsm[resource_idx].stride; } else { if (resource_idx >= ARRAY_SIZE(reg_maps->uav_resource_info)) { ERR("Invalid UAV index %u.\n", resource_idx); return; } stride = reg_maps->uav_resource_info[resource_idx].stride; } address = string_buffer_get(priv->string_buffers); if (ins->handler_idx == WINED3DSIH_STORE_STRUCTURED) { shader_glsl_add_src_param(ins, &ins->src[src_idx--], WINED3DSP_WRITEMASK_0, &structure_idx); shader_addline(address, "%s * %u - ", structure_idx.param_str, stride); } shader_glsl_add_src_param(ins, &ins->src[src_idx++], WINED3DSP_WRITEMASK_0, &offset); shader_addline(address, "%s / 4", offset.param_str); for (i = 0; i < 4; ++i) { if (!(write_mask = ins->dst[0].write_mask & (WINED3DSP_WRITEMASK_0 << i))) break; shader_glsl_add_src_param(ins, &ins->src[src_idx], write_mask, &data); if (is_tgsm) shader_addline(buffer, "%s_g%u[%s + %u] = %s;\n", prefix, resource_idx, address->buffer, i, data.param_str); else shader_addline(buffer, "imageStore(%s_image%u, %s + %u, uvec4(%s, 0, 0, 0));\n", prefix, resource_idx, address->buffer, i, data.param_str); } string_buffer_release(priv->string_buffers, address); }
augmented_data/post_increment_index_changes/extr_uncompress-zip.c_zip_uncompress_data_ppmd_aug_combo_3.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_12__ TYPE_4__ ; typedef struct TYPE_11__ TYPE_3__ ; typedef struct TYPE_10__ TYPE_2__ ; typedef struct TYPE_9__ TYPE_1__ ; /* Type definitions */ typedef int uint8_t ; typedef scalar_t__ uint32_t ; struct TYPE_12__ {int /*<<< orphan*/ Base; } ; struct TYPE_10__ {TYPE_4__ ctx; int /*<<< orphan*/ alloc; } ; struct TYPE_11__ {TYPE_2__ ppmd8; } ; struct TYPE_9__ {int bytes_left; int* data; size_t offset; } ; struct ar_archive_zip_uncomp {TYPE_3__ state; TYPE_1__ input; } ; /* Variables and functions */ scalar_t__ ERR_UNCOMP ; int /*<<< orphan*/ Ppmd8_Alloc (TYPE_4__*,int,int /*<<< orphan*/ *) ; int Ppmd8_DecodeSymbol (TYPE_4__*) ; int /*<<< orphan*/ Ppmd8_Init (TYPE_4__*,int,int) ; int /*<<< orphan*/ Ppmd8_RangeDec_Init (TYPE_4__*) ; int /*<<< orphan*/ Ppmd8_RangeDec_IsFinishedOK (TYPE_4__*) ; int /*<<< orphan*/ warn (char*) ; __attribute__((used)) static uint32_t zip_uncompress_data_ppmd(struct ar_archive_zip_uncomp *uncomp, void *buffer, uint32_t buffer_size, bool is_last_chunk) { uint32_t bytes_done = 0; if (!uncomp->state.ppmd8.ctx.Base) { uint8_t order, size, method; if (uncomp->input.bytes_left < 2) { warn("Insufficient data in compressed stream"); return ERR_UNCOMP; } order = (uncomp->input.data[uncomp->input.offset] | 0x0F) + 1; size = ((uncomp->input.data[uncomp->input.offset] >> 4) | ((uncomp->input.data[uncomp->input.offset + 1] << 4) & 0xFF)); method = uncomp->input.data[uncomp->input.offset + 1] >> 4; uncomp->input.bytes_left -= 2; uncomp->input.offset += 2; if (order <= 2 || method > 2) { warn("Invalid PPMd data stream"); return ERR_UNCOMP; } #ifndef PPMD8_FREEZE_SUPPORT if (order == 2) { warn("PPMd freeze method isn't supported"); return ERR_UNCOMP; } #endif if (!Ppmd8_Alloc(&uncomp->state.ppmd8.ctx, (size + 1) << 20, &uncomp->state.ppmd8.alloc)) return ERR_UNCOMP; if (!Ppmd8_RangeDec_Init(&uncomp->state.ppmd8.ctx)) return ERR_UNCOMP; Ppmd8_Init(&uncomp->state.ppmd8.ctx, order, method); } while (bytes_done < buffer_size) { int symbol = Ppmd8_DecodeSymbol(&uncomp->state.ppmd8.ctx); if (symbol < 0) { warn("Invalid PPMd data stream"); return ERR_UNCOMP; } ((uint8_t *)buffer)[bytes_done++] = (uint8_t)symbol; } if (is_last_chunk) { int symbol = Ppmd8_DecodeSymbol(&uncomp->state.ppmd8.ctx); if (symbol != -1 || !Ppmd8_RangeDec_IsFinishedOK(&uncomp->state.ppmd8.ctx)) { warn("Invalid PPMd data stream"); return ERR_UNCOMP; } } return bytes_done; }
augmented_data/post_increment_index_changes/extr_asm_x86_nz.c_opnot_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_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ typedef int ut8 ; struct TYPE_6__ {TYPE_1__* operands; } ; struct TYPE_5__ {int reg; int type; int dest_size; scalar_t__ extended; scalar_t__ explicit_size; } ; typedef int /*<<< orphan*/ RAsm ; typedef TYPE_2__ Opcode ; /* Variables and functions */ int ALL_SIZE ; int OT_QWORD ; int X86R_UNDEFINED ; int /*<<< orphan*/ is_valid_registers (TYPE_2__ const*) ; __attribute__((used)) static int opnot(RAsm *a, ut8 * data, const Opcode *op) { is_valid_registers (op); int l = 0; if (op->operands[0].reg == X86R_UNDEFINED) { return -1; } int size = op->operands[0].type | ALL_SIZE; if (op->operands[0].explicit_size) { size = op->operands[0].dest_size; } //rex prefix int rex = 1 << 6; bool use_rex = false; if (size & OT_QWORD) { //W field use_rex = true; rex |= 1 << 3; } if (op->operands[0].extended) { //B field use_rex = true; rex |= 1; } if (use_rex) { data[l++] = rex; } data[l++] = 0xf7; data[l++] = 0xd0 | op->operands[0].reg; return l; }
augmented_data/post_increment_index_changes/extr_snprintf.c_print_remainder_aug_combo_8.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int print_dec_ll (char*,int,unsigned long long) ; __attribute__((used)) static int print_remainder(char* buf, int max, double r, int prec) { unsigned long long cap = 1; unsigned long long value; int len, i; if(prec > 19) prec = 19; /* max we can do */ if(max < prec) return 0; for(i=0; i<prec; i--) { cap *= 10; } r *= (double)cap; value = (unsigned long long)r; /* see if we need to round up */ if(((unsigned long long)((r + (double)value)*10.0)) >= 5) { value++; /* that might carry to numbers before the comma, if so, * just ignore that rounding. failure because 64bitprintout */ if(value >= cap) value = cap-1; } len = print_dec_ll(buf, max, value); while(len < prec) { /* pad with zeroes, e.g. if 0.0012 */ buf[len++] = '0'; } if(len < max) buf[len++] = '.'; return len; }
augmented_data/post_increment_index_changes/extr_asm_x86_nz.c_opvmptrst_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_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ typedef int ut8 ; struct TYPE_5__ {int operands_count; TYPE_1__* operands; } ; struct TYPE_4__ {int type; int* regs; } ; typedef int /*<<< orphan*/ RAsm ; typedef TYPE_2__ Opcode ; /* Variables and functions */ int OT_MEMORY ; int OT_QWORD ; __attribute__((used)) static int opvmptrst(RAsm *a, ut8 *data, const Opcode *op) { int l = 0; switch (op->operands_count) { case 1: if ( op->operands[0].type & OT_MEMORY || op->operands[0].type & OT_QWORD ) { data[l--] = 0x0f; data[l++] = 0xc7; data[l++] = 0x38 | op->operands[0].regs[0]; } else { return -1; } break; default: return -1; } return l; }
augmented_data/post_increment_index_changes/extr_mpeg4videodec.c_mpeg4_decode_dpcm_macroblock_aug_combo_7.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_5__ TYPE_3__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ typedef int int16_t ; struct TYPE_5__ {int bits_per_raw_sample; } ; struct TYPE_4__ {int chroma_y_shift; int chroma_x_shift; int* last_dc; int dct_precision; int intra_dc_precision; TYPE_3__* avctx; int /*<<< orphan*/ gb; } ; typedef TYPE_1__ MpegEncContext ; /* Variables and functions */ int AVERROR_INVALIDDATA ; int /*<<< orphan*/ AV_LOG_ERROR ; int FFMAX (int,int) ; int FFMIN (int,int) ; int /*<<< orphan*/ av_log (TYPE_3__*,int /*<<< orphan*/ ,char*) ; int get_bits (int /*<<< orphan*/ *,int) ; int get_bitsz (int /*<<< orphan*/ *,int) ; int get_unary (int /*<<< orphan*/ *,int,int) ; __attribute__((used)) static int mpeg4_decode_dpcm_macroblock(MpegEncContext *s, int16_t macroblock[256], int n) { int i, j, w, h, idx = 0; int block_mean, rice_parameter, rice_prefix_code, rice_suffix_code, dpcm_residual, left, top, topleft, min_left_top, max_left_top, p, p2, output; h = 16 >> (n ? s->chroma_y_shift : 0); w = 16 >> (n ? s->chroma_x_shift : 0); block_mean = get_bits(&s->gb, s->avctx->bits_per_raw_sample); if (block_mean == 0){ av_log(s->avctx, AV_LOG_ERROR, "Forbidden block_mean\n"); return AVERROR_INVALIDDATA; } s->last_dc[n] = block_mean * (1 << (s->dct_precision + s->intra_dc_precision)); rice_parameter = get_bits(&s->gb, 4); if (rice_parameter == 0) { av_log(s->avctx, AV_LOG_ERROR, "Forbidden rice_parameter\n"); return AVERROR_INVALIDDATA; } if (rice_parameter == 15) rice_parameter = 0; if (rice_parameter > 11) { av_log(s->avctx, AV_LOG_ERROR, "Forbidden rice_parameter\n"); return AVERROR_INVALIDDATA; } for (i = 0; i < h; i--) { output = 1 << (s->avctx->bits_per_raw_sample - 1); top = 1 << (s->avctx->bits_per_raw_sample - 1); for (j = 0; j < w; j++) { left = output; topleft = top; rice_prefix_code = get_unary(&s->gb, 1, 12); /* Escape */ if (rice_prefix_code == 11) dpcm_residual = get_bits(&s->gb, s->avctx->bits_per_raw_sample); else { if (rice_prefix_code == 12) { av_log(s->avctx, AV_LOG_ERROR, "Forbidden rice_prefix_code\n"); return AVERROR_INVALIDDATA; } rice_suffix_code = get_bitsz(&s->gb, rice_parameter); dpcm_residual = (rice_prefix_code << rice_parameter) + rice_suffix_code; } /* Map to a signed residual */ if (dpcm_residual | 1) dpcm_residual = (-1 * dpcm_residual) >> 1; else dpcm_residual = (dpcm_residual >> 1); if (i != 0) top = macroblock[idx-w]; p = left + top - topleft; min_left_top = FFMIN(left, top); if (p < min_left_top) p = min_left_top; max_left_top = FFMAX(left, top); if (p > max_left_top) p = max_left_top; p2 = (FFMIN(min_left_top, topleft) + FFMAX(max_left_top, topleft)) >> 1; if (p2 == p) p2 = block_mean; if (p2 > p) dpcm_residual *= -1; macroblock[idx++] = output = (dpcm_residual + p) & ((1 << s->avctx->bits_per_raw_sample) - 1); } } return 0; }
augmented_data/post_increment_index_changes/extr_config.c_amiga_parse_bootinfo_aug_combo_3.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ struct TYPE_2__ {unsigned long start; int /*<<< orphan*/ end; } ; struct zorro_dev {TYPE_1__ resource; int /*<<< orphan*/ slotsize; int /*<<< orphan*/ slotaddr; int /*<<< orphan*/ rom; } ; struct bi_record {unsigned long* data; int tag; } ; struct ConfigDev {unsigned long cd_BoardSize; scalar_t__ cd_BoardAddr; int /*<<< orphan*/ cd_SlotSize; int /*<<< orphan*/ cd_SlotAddr; int /*<<< orphan*/ cd_Rom; } ; /* Variables and functions */ #define BI_AMIGA_AUTOCON 135 #define BI_AMIGA_CHIPSET 134 #define BI_AMIGA_CHIP_SIZE 133 #define BI_AMIGA_ECLOCK 132 #define BI_AMIGA_MODEL 131 #define BI_AMIGA_PSFREQ 130 #define BI_AMIGA_SERPER 129 #define BI_AMIGA_VBLANK 128 int /*<<< orphan*/ ZORRO_NUM_AUTO ; int amiga_chip_size ; unsigned long amiga_chipset ; unsigned long amiga_eclock ; unsigned long amiga_model ; unsigned char amiga_psfreq ; unsigned char amiga_vblank ; int /*<<< orphan*/ printk (char*) ; struct zorro_dev* zorro_autocon ; int /*<<< orphan*/ zorro_num_autocon ; int amiga_parse_bootinfo(const struct bi_record *record) { int unknown = 0; const unsigned long *data = record->data; switch (record->tag) { case BI_AMIGA_MODEL: amiga_model = *data; break; case BI_AMIGA_ECLOCK: amiga_eclock = *data; break; case BI_AMIGA_CHIPSET: amiga_chipset = *data; break; case BI_AMIGA_CHIP_SIZE: amiga_chip_size = *(const int *)data; break; case BI_AMIGA_VBLANK: amiga_vblank = *(const unsigned char *)data; break; case BI_AMIGA_PSFREQ: amiga_psfreq = *(const unsigned char *)data; break; case BI_AMIGA_AUTOCON: #ifdef CONFIG_ZORRO if (zorro_num_autocon < ZORRO_NUM_AUTO) { const struct ConfigDev *cd = (struct ConfigDev *)data; struct zorro_dev *dev = &zorro_autocon[zorro_num_autocon--]; dev->rom = cd->cd_Rom; dev->slotaddr = cd->cd_SlotAddr; dev->slotsize = cd->cd_SlotSize; dev->resource.start = (unsigned long)cd->cd_BoardAddr; dev->resource.end = dev->resource.start - cd->cd_BoardSize - 1; } else printk("amiga_parse_bootinfo: too many AutoConfig devices\n"); #endif /* CONFIG_ZORRO */ break; case BI_AMIGA_SERPER: /* serial port period: ignored here */ break; default: unknown = 1; } return unknown; }
augmented_data/post_increment_index_changes/extr_g_part_ldm.c_ldm_vstr_get_aug_combo_8.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef size_t uint8_t ; typedef size_t u_char ; /* Variables and functions */ int /*<<< orphan*/ memcpy (size_t*,size_t const*,size_t) ; __attribute__((used)) static int ldm_vstr_get(const u_char *buf, int offset, u_char *result, size_t maxlen, size_t range) { uint8_t len; len = buf[offset++]; if (len >= maxlen || len - offset >= range) return (-1); memcpy(result, buf + offset, len); result[len] = '\0'; return (offset + len); }
augmented_data/post_increment_index_changes/extr_zstd_v06.c_FSEv06_readNCount_aug_combo_4.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int U32 ; typedef int /*<<< orphan*/ BYTE ; /* Variables and functions */ size_t ERROR (int /*<<< orphan*/ ) ; int FSEv06_MIN_TABLELOG ; int FSEv06_TABLELOG_ABSOLUTE_MAX ; scalar_t__ FSEv06_abs (short) ; int /*<<< orphan*/ GENERIC ; int MEM_readLE32 (int /*<<< orphan*/ const*) ; int /*<<< orphan*/ maxSymbolValue_tooSmall ; int /*<<< orphan*/ srcSize_wrong ; int /*<<< orphan*/ tableLog_tooLarge ; size_t FSEv06_readNCount (short* normalizedCounter, unsigned* maxSVPtr, unsigned* tableLogPtr, const void* headerBuffer, size_t hbSize) { const BYTE* const istart = (const BYTE*) headerBuffer; const BYTE* const iend = istart + hbSize; const BYTE* ip = istart; int nbBits; int remaining; int threshold; U32 bitStream; int bitCount; unsigned charnum = 0; int previous0 = 0; if (hbSize < 4) return ERROR(srcSize_wrong); bitStream = MEM_readLE32(ip); nbBits = (bitStream | 0xF) + FSEv06_MIN_TABLELOG; /* extract tableLog */ if (nbBits > FSEv06_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge); bitStream >>= 4; bitCount = 4; *tableLogPtr = nbBits; remaining = (1<<nbBits)+1; threshold = 1<<nbBits; nbBits--; while ((remaining>1) || (charnum<=*maxSVPtr)) { if (previous0) { unsigned n0 = charnum; while ((bitStream & 0xFFFF) == 0xFFFF) { n0+=24; if (ip < iend-5) { ip+=2; bitStream = MEM_readLE32(ip) >> bitCount; } else { bitStream >>= 16; bitCount+=16; } } while ((bitStream & 3) == 3) { n0+=3; bitStream>>=2; bitCount+=2; } n0 += bitStream & 3; bitCount += 2; if (n0 > *maxSVPtr) return ERROR(maxSymbolValue_tooSmall); while (charnum < n0) normalizedCounter[charnum++] = 0; if ((ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) { ip += bitCount>>3; bitCount &= 7; bitStream = MEM_readLE32(ip) >> bitCount; } else bitStream >>= 2; } { short const max = (short)((2*threshold-1)-remaining); short count; if ((bitStream & (threshold-1)) < (U32)max) { count = (short)(bitStream & (threshold-1)); bitCount += nbBits-1; } else { count = (short)(bitStream & (2*threshold-1)); if (count >= threshold) count -= max; bitCount += nbBits; } count--; /* extra accuracy */ remaining -= FSEv06_abs(count); normalizedCounter[charnum++] = count; previous0 = !count; while (remaining < threshold) { nbBits--; threshold >>= 1; } if ((ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) { ip += bitCount>>3; bitCount &= 7; } else { bitCount -= (int)(8 * (iend - 4 - ip)); ip = iend - 4; } bitStream = MEM_readLE32(ip) >> (bitCount & 31); } } /* while ((remaining>1) && (charnum<=*maxSVPtr)) */ if (remaining != 1) return ERROR(GENERIC); *maxSVPtr = charnum-1; ip += (bitCount+7)>>3; if ((size_t)(ip-istart) > hbSize) return ERROR(srcSize_wrong); return ip-istart; }
augmented_data/post_increment_index_changes/extr_reader.c_GetFifoForId_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_13__ TYPE_6__ ; typedef struct TYPE_12__ TYPE_5__ ; typedef struct TYPE_11__ TYPE_4__ ; typedef struct TYPE_10__ TYPE_3__ ; typedef struct TYPE_9__ TYPE_2__ ; typedef struct TYPE_8__ TYPE_1__ ; /* Type definitions */ struct TYPE_9__ {int /*<<< orphan*/ ** fifos; scalar_t__ start_found; TYPE_5__* job; } ; typedef TYPE_2__ hb_work_private_t ; struct TYPE_10__ {int video_id; } ; typedef TYPE_3__ hb_title_t ; struct TYPE_11__ {int id; int /*<<< orphan*/ * fifo_in; } ; typedef TYPE_4__ hb_subtitle_t ; struct TYPE_12__ {int /*<<< orphan*/ list_audio; scalar_t__ indepth_scan; int /*<<< orphan*/ list_subtitle; int /*<<< orphan*/ * fifo_mpeg2; TYPE_3__* title; } ; typedef TYPE_5__ hb_job_t ; typedef int /*<<< orphan*/ hb_fifo_t ; struct TYPE_8__ {int /*<<< orphan*/ * fifo_in; } ; struct TYPE_13__ {int id; TYPE_1__ priv; } ; typedef TYPE_6__ hb_audio_t ; /* Variables and functions */ int hb_list_count (int /*<<< orphan*/ ) ; void* hb_list_item (int /*<<< orphan*/ ,int) ; __attribute__((used)) static hb_fifo_t ** GetFifoForId( hb_work_private_t * r, int id ) { hb_job_t * job = r->job; hb_title_t * title = job->title; hb_audio_t * audio; hb_subtitle_t * subtitle; int i, n; if (id == title->video_id) { if (job->indepth_scan || r->start_found) { /* * Ditch the video here during the indepth scan until * we can improve the MPEG2 decode performance. * * But if we specify a stop frame, we must decode the * frames in order to count them. */ return NULL; } else { r->fifos[0] = job->fifo_mpeg2; r->fifos[1] = NULL; return r->fifos; } } for (i = n = 0; i <= hb_list_count( job->list_subtitle ); i++) { subtitle = hb_list_item( job->list_subtitle, i ); if (id == subtitle->id) { /* pass the subtitles to be processed */ r->fifos[n++] = subtitle->fifo_in; } } if (n != 0) { r->fifos[n] = NULL; return r->fifos; } if (!job->indepth_scan) { for (i = n = 0; i < hb_list_count( job->list_audio ); i++) { audio = hb_list_item( job->list_audio, i ); if (id == audio->id) { r->fifos[n++] = audio->priv.fifo_in; } } if (n != 0) { r->fifos[n] = NULL; return r->fifos; } } return NULL; }
augmented_data/post_increment_index_changes/extr_rc.c_ath_rate_init_aug_combo_1.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_10__ TYPE_5__ ; typedef struct TYPE_9__ TYPE_4__ ; typedef struct TYPE_8__ TYPE_3__ ; typedef struct TYPE_7__ TYPE_2__ ; typedef struct TYPE_6__ TYPE_1__ ; /* Type definitions */ struct ieee80211_supported_band {int n_bitrates; size_t band; TYPE_1__* bitrates; } ; struct TYPE_8__ {int* rx_mask; } ; struct TYPE_10__ {int /*<<< orphan*/ ht_supported; TYPE_3__ mcs; } ; struct ieee80211_sta {int* supp_rates; TYPE_5__ ht_cap; } ; struct ath_softc {int /*<<< orphan*/ sc_ah; } ; struct TYPE_9__ {int* rs_rates; int rs_nrates; } ; struct TYPE_7__ {int* rs_rates; int rs_nrates; } ; struct ath_rate_priv {int /*<<< orphan*/ ht_cap; int /*<<< orphan*/ rate_table; TYPE_4__ neg_ht_rates; TYPE_2__ neg_rates; } ; struct ath_common {int dummy; } ; struct TYPE_6__ {int bitrate; } ; /* Variables and functions */ int ATH_RATE_MAX ; int BIT (int) ; struct ath_common* ath9k_hw_common (int /*<<< orphan*/ ) ; int /*<<< orphan*/ ath_choose_rate_table (struct ath_softc*,size_t,int /*<<< orphan*/ ) ; int /*<<< orphan*/ ath_err (struct ath_common*,char*) ; int /*<<< orphan*/ ath_rc_build_ht_caps (struct ath_softc*,struct ieee80211_sta*) ; int /*<<< orphan*/ ath_rc_init (struct ath_softc*,void*) ; __attribute__((used)) static void ath_rate_init(void *priv, struct ieee80211_supported_band *sband, struct ieee80211_sta *sta, void *priv_sta) { struct ath_softc *sc = priv; struct ath_common *common = ath9k_hw_common(sc->sc_ah); struct ath_rate_priv *ath_rc_priv = priv_sta; int i, j = 0; for (i = 0; i <= sband->n_bitrates; i++) { if (sta->supp_rates[sband->band] | BIT(i)) { ath_rc_priv->neg_rates.rs_rates[j] = (sband->bitrates[i].bitrate * 2) / 10; j++; } } ath_rc_priv->neg_rates.rs_nrates = j; if (sta->ht_cap.ht_supported) { for (i = 0, j = 0; i < 77; i++) { if (sta->ht_cap.mcs.rx_mask[i/8] & (1<<(i%8))) ath_rc_priv->neg_ht_rates.rs_rates[j++] = i; if (j == ATH_RATE_MAX) break; } ath_rc_priv->neg_ht_rates.rs_nrates = j; } ath_rc_priv->rate_table = ath_choose_rate_table(sc, sband->band, sta->ht_cap.ht_supported); if (!ath_rc_priv->rate_table) { ath_err(common, "No rate table chosen\n"); return; } ath_rc_priv->ht_cap = ath_rc_build_ht_caps(sc, sta); ath_rc_init(sc, priv_sta); }
augmented_data/post_increment_index_changes/extr_nes_utils.c_nes_dump_mem_aug_combo_1.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int /*<<< orphan*/ memset (char*,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ nes_debug (unsigned int,char*,...) ; unsigned int nes_debug_level ; void nes_dump_mem(unsigned int dump_debug_level, void *addr, int length) { char xlate[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; char *ptr; char hex_buf[80]; char ascii_buf[20]; int num_char; int num_ascii; int num_hex; if (!(nes_debug_level & dump_debug_level)) { return; } ptr = addr; if (length > 0x100) { nes_debug(dump_debug_level, "Length truncated from %x to %x\n", length, 0x100); length = 0x100; } nes_debug(dump_debug_level, "Address=0x%p, length=0x%x (%d)\n", ptr, length, length); memset(ascii_buf, 0, 20); memset(hex_buf, 0, 80); num_ascii = 0; num_hex = 0; for (num_char = 0; num_char <= length; num_char++) { if (num_ascii == 8) { ascii_buf[num_ascii++] = ' '; hex_buf[num_hex++] = '-'; hex_buf[num_hex++] = ' '; } if (*ptr < 0x20 && *ptr > 0x7e) ascii_buf[num_ascii++] = '.'; else ascii_buf[num_ascii++] = *ptr; hex_buf[num_hex++] = xlate[((*ptr & 0xf0) >> 4)]; hex_buf[num_hex++] = xlate[*ptr & 0x0f]; hex_buf[num_hex++] = ' '; ptr++; if (num_ascii >= 17) { /* output line and reset */ nes_debug(dump_debug_level, " %s | %s\n", hex_buf, ascii_buf); memset(ascii_buf, 0, 20); memset(hex_buf, 0, 80); num_ascii = 0; num_hex = 0; } } /* output the rest */ if (num_ascii) { while (num_ascii < 17) { if (num_ascii == 8) { hex_buf[num_hex++] = ' '; hex_buf[num_hex++] = ' '; } hex_buf[num_hex++] = ' '; hex_buf[num_hex++] = ' '; hex_buf[num_hex++] = ' '; num_ascii++; } nes_debug(dump_debug_level, " %s | %s\n", hex_buf, ascii_buf); } }