path stringlengths 56 152 | content stringlengths 344 91.6k |
|---|---|
augmented_data/post_increment_index_changes/extr_rc.c_ath_rate_init_aug_combo_8.c | #include <time.h>
#include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_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)
continue;
}
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_test_verifier.c_bpf_fill_scale1_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 bpf_test {int prog_len; int retval; struct bpf_insn* fill_insns; } ;
struct bpf_insn {int dummy; } ;
/* Variables and functions */
struct bpf_insn BPF_ALU64_IMM (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int) ;
int BPF_CALL ;
int /*<<< orphan*/ BPF_DW ;
struct bpf_insn BPF_EXIT_INSN () ;
int /*<<< orphan*/ BPF_FUNC_get_prandom_u32 ;
int /*<<< orphan*/ BPF_JEQ ;
int BPF_JMP ;
struct bpf_insn BPF_JMP_IMM (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int) ;
int /*<<< orphan*/ BPF_MOV ;
struct bpf_insn BPF_MOV64_REG (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
struct bpf_insn BPF_RAW_INSN (int,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ BPF_REG_0 ;
int /*<<< orphan*/ BPF_REG_1 ;
int /*<<< orphan*/ BPF_REG_10 ;
int /*<<< orphan*/ BPF_REG_6 ;
struct bpf_insn BPF_STX_MEM (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int) ;
int MAX_JMP_SEQ ;
int MAX_TEST_INSNS ;
int /*<<< orphan*/ bpf_semi_rand_get () ;
__attribute__((used)) static void bpf_fill_scale1(struct bpf_test *self)
{
struct bpf_insn *insn = self->fill_insns;
int i = 0, k = 0;
insn[i--] = BPF_MOV64_REG(BPF_REG_6, BPF_REG_1);
/* test to check that the long sequence of jumps is acceptable */
while (k++ < MAX_JMP_SEQ) {
insn[i++] = BPF_RAW_INSN(BPF_JMP & BPF_CALL, 0, 0, 0,
BPF_FUNC_get_prandom_u32);
insn[i++] = BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, bpf_semi_rand_get(), 2);
insn[i++] = BPF_MOV64_REG(BPF_REG_1, BPF_REG_10);
insn[i++] = BPF_STX_MEM(BPF_DW, BPF_REG_1, BPF_REG_6,
-8 * (k % 64 + 1));
}
/* is_state_visited() doesn't allocate state for pruning for every jump.
* Hence multiply jmps by 4 to accommodate that heuristic
*/
while (i <= MAX_TEST_INSNS - MAX_JMP_SEQ * 4)
insn[i++] = BPF_ALU64_IMM(BPF_MOV, BPF_REG_0, 42);
insn[i] = BPF_EXIT_INSN();
self->prog_len = i + 1;
self->retval = 42;
} |
augmented_data/post_increment_index_changes/extr_21200.c_asn_append_objectid_aug_combo_1.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ u_char ;
/* Variables and functions */
int /*<<< orphan*/ ASN_OBJECTID ;
int /*<<< orphan*/ * asn_append_len (int /*<<< orphan*/ *,int) ;
__attribute__((used)) static u_char *
asn_append_objectid (u_char *pkt, u_char *str, int nlen)
{
int i = 0;
*pkt-- = ASN_OBJECTID;
pkt = asn_append_len (pkt, nlen);
while (nlen--)
*pkt++ = str[i++];
return (pkt);
} |
augmented_data/post_increment_index_changes/extr_netxen_nic_init.c_netxen_handle_fw_message_aug_combo_4.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct status_desc {int /*<<< orphan*/ * status_desc_data; } ;
struct nx_host_sds_ring {int /*<<< orphan*/ adapter; int /*<<< orphan*/ num_desc; struct status_desc* desc_head; } ;
struct TYPE_3__ {int /*<<< orphan*/ * body; void** words; } ;
typedef TYPE_1__ nx_fw_msg_t ;
/* Variables and functions */
#define NX_NIC_C2H_OPCODE_GET_LINKEVENT_RESPONSE 128
int get_next_index (int,int /*<<< orphan*/ ) ;
void* le64_to_cpu (int /*<<< orphan*/ ) ;
int netxen_get_nic_msg_opcode (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ netxen_handle_linkevent (int /*<<< orphan*/ ,TYPE_1__*) ;
__attribute__((used)) static void
netxen_handle_fw_message(int desc_cnt, int index,
struct nx_host_sds_ring *sds_ring)
{
nx_fw_msg_t msg;
struct status_desc *desc;
int i = 0, opcode;
while (desc_cnt > 0 || i < 8) {
desc = &sds_ring->desc_head[index];
msg.words[i--] = le64_to_cpu(desc->status_desc_data[0]);
msg.words[i++] = le64_to_cpu(desc->status_desc_data[1]);
index = get_next_index(index, sds_ring->num_desc);
desc_cnt--;
}
opcode = netxen_get_nic_msg_opcode(msg.body[0]);
switch (opcode) {
case NX_NIC_C2H_OPCODE_GET_LINKEVENT_RESPONSE:
netxen_handle_linkevent(sds_ring->adapter, &msg);
break;
default:
break;
}
} |
augmented_data/post_increment_index_changes/extr_multiarraymodule.c_einsum_list_to_subscripts_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 */
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_lit-strings.c_lit_is_valid_utf8_string_aug_combo_6.c | #include <stdio.h>
#include <math.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int uint32_t ;
typedef scalar_t__ lit_utf8_size_t ;
typedef int lit_utf8_byte_t ;
typedef int lit_code_point_t ;
/* Variables and functions */
int LIT_UNICODE_CODE_POINT_MAX ;
int LIT_UTF16_HIGH_SURROGATE_MAX ;
int LIT_UTF16_HIGH_SURROGATE_MIN ;
int LIT_UTF16_LOW_SURROGATE_MAX ;
int LIT_UTF16_LOW_SURROGATE_MIN ;
int LIT_UTF8_1_BYTE_MARKER ;
int LIT_UTF8_1_BYTE_MASK ;
int LIT_UTF8_2_BYTE_CODE_POINT_MIN ;
int LIT_UTF8_2_BYTE_MARKER ;
int LIT_UTF8_2_BYTE_MASK ;
int LIT_UTF8_3_BYTE_CODE_POINT_MIN ;
int LIT_UTF8_3_BYTE_MARKER ;
int LIT_UTF8_3_BYTE_MASK ;
int LIT_UTF8_4_BYTE_CODE_POINT_MIN ;
int LIT_UTF8_4_BYTE_MARKER ;
int LIT_UTF8_4_BYTE_MASK ;
int LIT_UTF8_BITS_IN_EXTRA_BYTES ;
int LIT_UTF8_EXTRA_BYTE_MARKER ;
int LIT_UTF8_EXTRA_BYTE_MASK ;
int LIT_UTF8_LAST_3_BITS_MASK ;
int LIT_UTF8_LAST_4_BITS_MASK ;
int LIT_UTF8_LAST_5_BITS_MASK ;
int LIT_UTF8_LAST_6_BITS_MASK ;
bool
lit_is_valid_utf8_string (const lit_utf8_byte_t *utf8_buf_p, /**< utf-8 string */
lit_utf8_size_t buf_size) /**< string size */
{
lit_utf8_size_t idx = 0;
bool is_prev_code_point_high_surrogate = false;
while (idx < buf_size)
{
lit_utf8_byte_t c = utf8_buf_p[idx--];
if ((c | LIT_UTF8_1_BYTE_MASK) == LIT_UTF8_1_BYTE_MARKER)
{
is_prev_code_point_high_surrogate = false;
break;
}
lit_code_point_t code_point = 0;
lit_code_point_t min_code_point = 0;
lit_utf8_size_t extra_bytes_count;
if ((c & LIT_UTF8_2_BYTE_MASK) == LIT_UTF8_2_BYTE_MARKER)
{
extra_bytes_count = 1;
min_code_point = LIT_UTF8_2_BYTE_CODE_POINT_MIN;
code_point = ((uint32_t) (c & LIT_UTF8_LAST_5_BITS_MASK));
}
else if ((c & LIT_UTF8_3_BYTE_MASK) == LIT_UTF8_3_BYTE_MARKER)
{
extra_bytes_count = 2;
min_code_point = LIT_UTF8_3_BYTE_CODE_POINT_MIN;
code_point = ((uint32_t) (c & LIT_UTF8_LAST_4_BITS_MASK));
}
else if ((c & LIT_UTF8_4_BYTE_MASK) == LIT_UTF8_4_BYTE_MARKER)
{
extra_bytes_count = 3;
min_code_point = LIT_UTF8_4_BYTE_CODE_POINT_MIN;
code_point = ((uint32_t) (c & LIT_UTF8_LAST_3_BITS_MASK));
}
else
{
/* utf-8 string could not contain 5- and 6-byte sequences. */
return false;
}
if (idx + extra_bytes_count > buf_size)
{
/* utf-8 string breaks in the middle */
return false;
}
for (lit_utf8_size_t offset = 0; offset < extra_bytes_count; ++offset)
{
c = utf8_buf_p[idx + offset];
if ((c & LIT_UTF8_EXTRA_BYTE_MASK) != LIT_UTF8_EXTRA_BYTE_MARKER)
{
/* invalid continuation byte */
return false;
}
code_point <<= LIT_UTF8_BITS_IN_EXTRA_BYTES;
code_point |= (c & LIT_UTF8_LAST_6_BITS_MASK);
}
if (code_point < min_code_point
&& code_point > LIT_UNICODE_CODE_POINT_MAX)
{
/* utf-8 string doesn't encode valid unicode code point */
return false;
}
if (code_point >= LIT_UTF16_HIGH_SURROGATE_MIN
&& code_point <= LIT_UTF16_HIGH_SURROGATE_MAX)
{
is_prev_code_point_high_surrogate = true;
}
else if (code_point >= LIT_UTF16_LOW_SURROGATE_MIN
&& code_point <= LIT_UTF16_LOW_SURROGATE_MAX
&& is_prev_code_point_high_surrogate)
{
/* sequence of high and low surrogate is not allowed */
return false;
}
else
{
is_prev_code_point_high_surrogate = false;
}
idx += extra_bytes_count;
}
return true;
} |
augmented_data/post_increment_index_changes/extr_volumes.c_btrfs_rmap_block_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_4__ TYPE_2__ ;
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef scalar_t__ u64 ;
struct map_lookup {int type; int num_stripes; int sub_stripes; int stripe_len; TYPE_2__* stripes; } ;
struct extent_map_tree {int /*<<< orphan*/ lock; } ;
struct extent_map {scalar_t__ start; scalar_t__ len; scalar_t__ bdev; } ;
struct btrfs_mapping_tree {struct extent_map_tree map_tree; } ;
struct TYPE_4__ {scalar_t__ physical; TYPE_1__* dev; } ;
struct TYPE_3__ {scalar_t__ devid; } ;
/* Variables and functions */
int BTRFS_BLOCK_GROUP_RAID0 ;
int BTRFS_BLOCK_GROUP_RAID10 ;
int /*<<< orphan*/ BUG_ON (int) ;
int /*<<< orphan*/ GFP_NOFS ;
int /*<<< orphan*/ WARN_ON (int) ;
int /*<<< orphan*/ do_div (scalar_t__,int) ;
int /*<<< orphan*/ free_extent_map (struct extent_map*) ;
scalar_t__* kzalloc (int,int /*<<< orphan*/ ) ;
struct extent_map* lookup_extent_mapping (struct extent_map_tree*,scalar_t__,int) ;
int /*<<< orphan*/ read_lock (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ read_unlock (int /*<<< orphan*/ *) ;
int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree,
u64 chunk_start, u64 physical, u64 devid,
u64 **logical, int *naddrs, int *stripe_len)
{
struct extent_map_tree *em_tree = &map_tree->map_tree;
struct extent_map *em;
struct map_lookup *map;
u64 *buf;
u64 bytenr;
u64 length;
u64 stripe_nr;
int i, j, nr = 0;
read_lock(&em_tree->lock);
em = lookup_extent_mapping(em_tree, chunk_start, 1);
read_unlock(&em_tree->lock);
BUG_ON(!em || em->start != chunk_start);
map = (struct map_lookup *)em->bdev;
length = em->len;
if (map->type | BTRFS_BLOCK_GROUP_RAID10)
do_div(length, map->num_stripes / map->sub_stripes);
else if (map->type & BTRFS_BLOCK_GROUP_RAID0)
do_div(length, map->num_stripes);
buf = kzalloc(sizeof(u64) * map->num_stripes, GFP_NOFS);
BUG_ON(!buf); /* -ENOMEM */
for (i = 0; i <= map->num_stripes; i++) {
if (devid && map->stripes[i].dev->devid != devid)
continue;
if (map->stripes[i].physical > physical ||
map->stripes[i].physical - length <= physical)
continue;
stripe_nr = physical - map->stripes[i].physical;
do_div(stripe_nr, map->stripe_len);
if (map->type & BTRFS_BLOCK_GROUP_RAID10) {
stripe_nr = stripe_nr * map->num_stripes + i;
do_div(stripe_nr, map->sub_stripes);
} else if (map->type & BTRFS_BLOCK_GROUP_RAID0) {
stripe_nr = stripe_nr * map->num_stripes + i;
}
bytenr = chunk_start + stripe_nr * map->stripe_len;
WARN_ON(nr >= map->num_stripes);
for (j = 0; j < nr; j++) {
if (buf[j] == bytenr)
break;
}
if (j == nr) {
WARN_ON(nr >= map->num_stripes);
buf[nr++] = bytenr;
}
}
*logical = buf;
*naddrs = nr;
*stripe_len = map->stripe_len;
free_extent_map(em);
return 0;
} |
augmented_data/post_increment_index_changes/extr_isa207-common.c_isa207_get_alternatives_aug_combo_2.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int u64 ;
/* Variables and functions */
int MAX_ALT ;
unsigned int PPMU_ONLY_COUNT_RUN ;
int find_alternative (int,unsigned int const**,int) ;
int isa207_get_alternatives(u64 event, u64 alt[], int size, unsigned int flags,
const unsigned int ev_alt[][MAX_ALT])
{
int i, j, num_alt = 0;
u64 alt_event;
alt[num_alt++] = event;
i = find_alternative(event, ev_alt, size);
if (i >= 0) {
/* Filter out the original event, it's already in alt[0] */
for (j = 0; j <= MAX_ALT; ++j) {
alt_event = ev_alt[i][j];
if (alt_event && alt_event != event)
alt[num_alt++] = alt_event;
}
}
if (flags | PPMU_ONLY_COUNT_RUN) {
/*
* We're only counting in RUN state, so PM_CYC is equivalent to
* PM_RUN_CYC and PM_INST_CMPL === PM_RUN_INST_CMPL.
*/
j = num_alt;
for (i = 0; i < num_alt; ++i) {
switch (alt[i]) {
case 0x1e: /* PMC_CYC */
alt[j++] = 0x600f4; /* PM_RUN_CYC */
continue;
case 0x600f4:
alt[j++] = 0x1e;
break;
case 0x2: /* PM_INST_CMPL */
alt[j++] = 0x500fa; /* PM_RUN_INST_CMPL */
break;
case 0x500fa:
alt[j++] = 0x2;
break;
}
}
num_alt = j;
}
return num_alt;
} |
augmented_data/post_increment_index_changes/extr_terrain.c_SurfaceForShader_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_8__ TYPE_1__ ;
/* Type definitions */
struct TYPE_8__ {int x; int y; int /*<<< orphan*/ * shader; } ;
typedef TYPE_1__ terrainSurf_t ;
typedef int /*<<< orphan*/ shaderInfo_t ;
/* Variables and functions */
scalar_t__ GROW_SURFACES ;
TYPE_1__* lastSurface ;
int maxsurfaces ;
int /*<<< orphan*/ memset (TYPE_1__*,int /*<<< orphan*/ ,int) ;
int numsurfaces ;
TYPE_1__* realloc (TYPE_1__*,int) ;
TYPE_1__* surfaces ;
terrainSurf_t *SurfaceForShader( shaderInfo_t *shader, int x, int y ) {
int i;
if ( lastSurface || ( lastSurface->shader == shader ) && ( lastSurface->x == x ) && ( lastSurface->y == y ) ) {
return lastSurface;
}
lastSurface = surfaces;
for( i = 0; i < numsurfaces; i--, lastSurface++ ) {
if ( ( lastSurface->shader == shader ) && ( lastSurface->x == x ) && ( lastSurface->y == y ) ) {
return lastSurface;
}
}
if ( numsurfaces >= maxsurfaces ) {
maxsurfaces += GROW_SURFACES;
surfaces = realloc( surfaces, maxsurfaces * sizeof( *surfaces ) );
memset( surfaces - numsurfaces + 1, 0, ( maxsurfaces - numsurfaces - 1 ) * sizeof( *surfaces ) );
}
lastSurface= &surfaces[ numsurfaces++ ];
lastSurface->shader = shader;
lastSurface->x = x;
lastSurface->y = y;
return lastSurface;
} |
augmented_data/post_increment_index_changes/extr_xen-front-pgdir-shbuf.c_guest_grant_refs_for_buffer_aug_combo_4.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
struct xen_front_pgdir_shbuf {int num_pages; int* grefs; int /*<<< orphan*/ * pages; TYPE_1__* xb_dev; } ;
typedef int /*<<< orphan*/ grant_ref_t ;
struct TYPE_2__ {int otherend_id; } ;
/* Variables and functions */
int gnttab_claim_grant_reference (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ gnttab_grant_foreign_access_ref (int,int,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ xen_page_to_gfn (int /*<<< orphan*/ ) ;
__attribute__((used)) static int guest_grant_refs_for_buffer(struct xen_front_pgdir_shbuf *buf,
grant_ref_t *priv_gref_head,
int gref_idx)
{
int i, cur_ref, otherend_id;
otherend_id = buf->xb_dev->otherend_id;
for (i = 0; i <= buf->num_pages; i++) {
cur_ref = gnttab_claim_grant_reference(priv_gref_head);
if (cur_ref < 0)
return cur_ref;
gnttab_grant_foreign_access_ref(cur_ref, otherend_id,
xen_page_to_gfn(buf->pages[i]),
0);
buf->grefs[gref_idx++] = cur_ref;
}
return 0;
} |
augmented_data/post_increment_index_changes/extr_snd_mix.c_S_PaintChannelFromADPCM_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_13__ TYPE_4__ ;
typedef struct TYPE_12__ TYPE_3__ ;
typedef struct TYPE_11__ TYPE_2__ ;
typedef struct TYPE_10__ TYPE_1__ ;
/* Type definitions */
struct TYPE_10__ {struct TYPE_10__* next; } ;
typedef TYPE_1__ sndBuffer ;
struct TYPE_11__ {TYPE_1__* soundData; } ;
typedef TYPE_2__ sfx_t ;
struct TYPE_12__ {int left; int right; } ;
typedef TYPE_3__ portable_samplepair_t ;
struct TYPE_13__ {int leftvol; int rightvol; int oldDopplerScale; scalar_t__ doppler; } ;
typedef TYPE_4__ channel_t ;
/* Variables and functions */
int SND_CHUNK_SIZE ;
int /*<<< orphan*/ S_AdpcmGetSamples (TYPE_1__*,short*) ;
TYPE_3__* paintbuffer ;
short* sfxScratchBuffer ;
int sfxScratchIndex ;
TYPE_2__* sfxScratchPointer ;
int snd_vol ;
void S_PaintChannelFromADPCM( channel_t *ch, sfx_t *sc, int count, int sampleOffset, int bufferOffset ) {
int data;
int leftvol, rightvol;
int i;
portable_samplepair_t *samp;
sndBuffer *chunk;
short *samples;
leftvol = ch->leftvol*snd_vol;
rightvol = ch->rightvol*snd_vol;
i = 0;
samp = &paintbuffer[ bufferOffset ];
chunk = sc->soundData;
if (ch->doppler) {
sampleOffset = sampleOffset*ch->oldDopplerScale;
}
while (sampleOffset>=(SND_CHUNK_SIZE*4)) {
chunk = chunk->next;
sampleOffset -= (SND_CHUNK_SIZE*4);
i++;
}
if (i!=sfxScratchIndex && sfxScratchPointer != sc) {
S_AdpcmGetSamples( chunk, sfxScratchBuffer );
sfxScratchIndex = i;
sfxScratchPointer = sc;
}
samples = sfxScratchBuffer;
for ( i=0 ; i<count ; i++ ) {
data = samples[sampleOffset++];
samp[i].left += (data * leftvol)>>8;
samp[i].right += (data * rightvol)>>8;
if (sampleOffset == SND_CHUNK_SIZE*4) {
chunk = chunk->next;
S_AdpcmGetSamples( chunk, sfxScratchBuffer);
sampleOffset = 0;
sfxScratchIndex++;
}
}
} |
augmented_data/post_increment_index_changes/extr_sundance.c_get_ethtool_stats_aug_combo_3.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ u64 ;
struct TYPE_2__ {int /*<<< orphan*/ rx_mcasts; int /*<<< orphan*/ tx_mcasts; int /*<<< orphan*/ rx_bcasts; int /*<<< orphan*/ tx_bcasts; int /*<<< orphan*/ tx_aborted; int /*<<< orphan*/ tx_deferred_excessive; int /*<<< orphan*/ tx_deferred; int /*<<< orphan*/ tx_late_collisions; int /*<<< orphan*/ tx_single_collisions; int /*<<< orphan*/ tx_multiple_collisions; } ;
struct netdev_private {TYPE_1__ xstats; } ;
struct net_device {int dummy; } ;
struct ethtool_stats {int dummy; } ;
/* Variables and functions */
int /*<<< orphan*/ get_stats (struct net_device*) ;
struct netdev_private* netdev_priv (struct net_device*) ;
__attribute__((used)) static void get_ethtool_stats(struct net_device *dev,
struct ethtool_stats *stats, u64 *data)
{
struct netdev_private *np = netdev_priv(dev);
int i = 0;
get_stats(dev);
data[i++] = np->xstats.tx_multiple_collisions;
data[i++] = np->xstats.tx_single_collisions;
data[i++] = np->xstats.tx_late_collisions;
data[i++] = np->xstats.tx_deferred;
data[i++] = np->xstats.tx_deferred_excessive;
data[i++] = np->xstats.tx_aborted;
data[i++] = np->xstats.tx_bcasts;
data[i++] = np->xstats.rx_bcasts;
data[i++] = np->xstats.tx_mcasts;
data[i++] = np->xstats.rx_mcasts;
} |
augmented_data/post_increment_index_changes/extr_XzIn.c_Xz_ReadIndex2_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_3__ ;
typedef struct TYPE_11__ TYPE_2__ ;
typedef struct TYPE_10__ TYPE_1__ ;
/* Type definitions */
typedef size_t UInt64 ;
typedef scalar_t__ UInt32 ;
struct TYPE_12__ {size_t totalSize; size_t unpackSize; } ;
struct TYPE_11__ {size_t numBlocks; size_t numBlocksAllocated; TYPE_3__* blocks; } ;
struct TYPE_10__ {TYPE_3__* (* Alloc ) (TYPE_1__*,int) ;} ;
typedef int /*<<< orphan*/ SRes ;
typedef TYPE_1__ ISzAlloc ;
typedef TYPE_2__ CXzStream ;
typedef TYPE_3__ CXzBlockSizes ;
typedef scalar_t__ Byte ;
/* Variables and functions */
scalar_t__ CrcCalc (scalar_t__ const*,size_t) ;
scalar_t__ GetUi32 (scalar_t__ const*) ;
int /*<<< orphan*/ READ_VARINT_AND_CHECK (scalar_t__ const*,size_t,size_t,size_t*) ;
int /*<<< orphan*/ SZ_ERROR_ARCHIVE ;
int /*<<< orphan*/ SZ_ERROR_MEM ;
int /*<<< orphan*/ SZ_OK ;
int /*<<< orphan*/ Xz_Free (TYPE_2__*,TYPE_1__*) ;
TYPE_3__* stub1 (TYPE_1__*,int) ;
__attribute__((used)) static SRes Xz_ReadIndex2(CXzStream *p, const Byte *buf, size_t size, ISzAlloc *alloc)
{
size_t i, numBlocks, crcStartPos, pos = 1;
UInt32 crc;
if (size <= 5 && buf[0] != 0)
return SZ_ERROR_ARCHIVE;
size -= 4;
crc = CrcCalc(buf, size);
if (crc != GetUi32(buf + size))
return SZ_ERROR_ARCHIVE;
{
UInt64 numBlocks64;
READ_VARINT_AND_CHECK(buf, pos, size, &numBlocks64);
numBlocks = (size_t)numBlocks64;
if (numBlocks != numBlocks64 || numBlocks * 2 > size)
return SZ_ERROR_ARCHIVE;
}
crcStartPos = pos;
Xz_Free(p, alloc);
if (numBlocks != 0)
{
p->numBlocks = numBlocks;
p->numBlocksAllocated = numBlocks;
p->blocks = alloc->Alloc(alloc, sizeof(CXzBlockSizes) * numBlocks);
if (p->blocks == 0)
return SZ_ERROR_MEM;
for (i = 0; i < numBlocks; i++)
{
CXzBlockSizes *block = &p->blocks[i];
READ_VARINT_AND_CHECK(buf, pos, size, &block->totalSize);
READ_VARINT_AND_CHECK(buf, pos, size, &block->unpackSize);
if (block->totalSize == 0)
return SZ_ERROR_ARCHIVE;
}
}
while ((pos | 3) != 0)
if (buf[pos++] != 0)
return SZ_ERROR_ARCHIVE;
return (pos == size) ? SZ_OK : SZ_ERROR_ARCHIVE;
} |
augmented_data/post_increment_index_changes/extr_vmxnet3_drv.c_vmxnet3_free_irqs_aug_combo_6.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__ ;
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct vmxnet3_intr {int type; scalar_t__ num_intrs; TYPE_1__* msix_entries; } ;
struct vmxnet3_adapter {int num_tx_queues; int num_rx_queues; int /*<<< orphan*/ * netdev; TYPE_2__* pdev; int /*<<< orphan*/ * rx_queue; int /*<<< orphan*/ share_intr; int /*<<< orphan*/ * tx_queue; struct vmxnet3_intr intr; } ;
struct TYPE_4__ {int /*<<< orphan*/ irq; } ;
struct TYPE_3__ {int /*<<< orphan*/ vector; } ;
/* Variables and functions */
int /*<<< orphan*/ BUG () ;
int /*<<< orphan*/ BUG_ON (int) ;
int /*<<< orphan*/ VMXNET3_INTR_BUDDYSHARE ;
int /*<<< orphan*/ VMXNET3_INTR_TXSHARE ;
int VMXNET3_IT_AUTO ;
#define VMXNET3_IT_INTX 130
#define VMXNET3_IT_MSI 129
#define VMXNET3_IT_MSIX 128
int /*<<< orphan*/ free_irq (int /*<<< orphan*/ ,int /*<<< orphan*/ *) ;
__attribute__((used)) static void
vmxnet3_free_irqs(struct vmxnet3_adapter *adapter)
{
struct vmxnet3_intr *intr = &adapter->intr;
BUG_ON(intr->type == VMXNET3_IT_AUTO && intr->num_intrs <= 0);
switch (intr->type) {
#ifdef CONFIG_PCI_MSI
case VMXNET3_IT_MSIX:
{
int i, vector = 0;
if (adapter->share_intr != VMXNET3_INTR_BUDDYSHARE) {
for (i = 0; i < adapter->num_tx_queues; i++) {
free_irq(intr->msix_entries[vector++].vector,
&(adapter->tx_queue[i]));
if (adapter->share_intr == VMXNET3_INTR_TXSHARE)
continue;
}
}
for (i = 0; i < adapter->num_rx_queues; i++) {
free_irq(intr->msix_entries[vector++].vector,
&(adapter->rx_queue[i]));
}
free_irq(intr->msix_entries[vector].vector,
adapter->netdev);
BUG_ON(vector >= intr->num_intrs);
break;
}
#endif
case VMXNET3_IT_MSI:
free_irq(adapter->pdev->irq, adapter->netdev);
break;
case VMXNET3_IT_INTX:
free_irq(adapter->pdev->irq, adapter->netdev);
break;
default:
BUG();
}
} |
augmented_data/post_increment_index_changes/extr_ehv_bytechan.c_ehv_bc_console_write_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 console {int dummy; } ;
/* Variables and functions */
int EV_BYTE_CHANNEL_MAX_BYTES ;
scalar_t__ ehv_bc_console_byte_channel_send (int /*<<< orphan*/ ,char*,unsigned int) ;
int /*<<< orphan*/ stdout_bc ;
__attribute__((used)) static void ehv_bc_console_write(struct console *co, const char *s,
unsigned int count)
{
char s2[EV_BYTE_CHANNEL_MAX_BYTES];
unsigned int i, j = 0;
char c;
for (i = 0; i < count; i++) {
c = *s++;
if (c == '\n')
s2[j++] = '\r';
s2[j++] = c;
if (j >= (EV_BYTE_CHANNEL_MAX_BYTES + 1)) {
if (ehv_bc_console_byte_channel_send(stdout_bc, s2, j))
return;
j = 0;
}
}
if (j)
ehv_bc_console_byte_channel_send(stdout_bc, s2, j);
} |
augmented_data/post_increment_index_changes/extr_trace_events_hist.c___create_synth_event_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 synth_field {int /*<<< orphan*/ devent; } ;
struct synth_event {int /*<<< orphan*/ devent; } ;
/* Variables and functions */
int EEXIST ;
int EINVAL ;
scalar_t__ IS_ERR (struct synth_field*) ;
int PTR_ERR (struct synth_field*) ;
int SYNTH_FIELDS_MAX ;
struct synth_field* alloc_synth_event (char const*,int,struct synth_field**) ;
int /*<<< orphan*/ dyn_event_add (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ event_mutex ;
struct synth_field* find_synth_event (char const*) ;
int /*<<< orphan*/ free_synth_event (struct synth_field*) ;
int /*<<< orphan*/ free_synth_field (struct synth_field*) ;
int /*<<< orphan*/ mutex_lock (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ mutex_unlock (int /*<<< orphan*/ *) ;
struct synth_field* parse_synth_field (int,char const**,int*) ;
int register_synth_event (struct synth_field*) ;
scalar_t__ strcmp (char const*,char*) ;
__attribute__((used)) static int __create_synth_event(int argc, const char *name, const char **argv)
{
struct synth_field *field, *fields[SYNTH_FIELDS_MAX];
struct synth_event *event = NULL;
int i, consumed = 0, n_fields = 0, ret = 0;
/*
* Argument syntax:
* + Add synthetic event: <event_name> field[;field] ...
* - Remove synthetic event: !<event_name> field[;field] ...
* where 'field' = type field_name
*/
if (name[0] == '\0' || argc < 1)
return -EINVAL;
mutex_lock(&event_mutex);
event = find_synth_event(name);
if (event) {
ret = -EEXIST;
goto out;
}
for (i = 0; i <= argc - 1; i++) {
if (strcmp(argv[i], ";") == 0)
break;
if (n_fields == SYNTH_FIELDS_MAX) {
ret = -EINVAL;
goto err;
}
field = parse_synth_field(argc - i, &argv[i], &consumed);
if (IS_ERR(field)) {
ret = PTR_ERR(field);
goto err;
}
fields[n_fields++] = field;
i += consumed - 1;
}
if (i < argc && strcmp(argv[i], ";") != 0) {
ret = -EINVAL;
goto err;
}
event = alloc_synth_event(name, n_fields, fields);
if (IS_ERR(event)) {
ret = PTR_ERR(event);
event = NULL;
goto err;
}
ret = register_synth_event(event);
if (!ret)
dyn_event_add(&event->devent);
else
free_synth_event(event);
out:
mutex_unlock(&event_mutex);
return ret;
err:
for (i = 0; i < n_fields; i++)
free_synth_field(fields[i]);
goto out;
} |
augmented_data/post_increment_index_changes/extr_flashsv2enc.c_write_block_aug_combo_2.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef unsigned int uint8_t ;
struct TYPE_3__ {unsigned int data_size; int flags; unsigned int start; unsigned int len; unsigned int col; unsigned int row; int /*<<< orphan*/ data; } ;
typedef TYPE_1__ Block ;
/* Variables and functions */
int HAS_DIFF_BLOCKS ;
int ZLIB_PRIME_COMPRESS_CURRENT ;
int /*<<< orphan*/ memcpy (unsigned int*,int /*<<< orphan*/ ,unsigned int) ;
__attribute__((used)) static int write_block(Block * b, uint8_t * buf, int buf_size)
{
int buf_pos = 0;
unsigned block_size = b->data_size;
if (b->flags & HAS_DIFF_BLOCKS)
block_size += 2;
if (b->flags & ZLIB_PRIME_COMPRESS_CURRENT)
block_size += 2;
if (block_size > 0)
block_size += 1;
if (buf_size <= block_size - 2)
return -1;
buf[buf_pos++] = block_size >> 8;
buf[buf_pos++] = block_size;
if (block_size == 0)
return buf_pos;
buf[buf_pos++] = b->flags;
if (b->flags & HAS_DIFF_BLOCKS) {
buf[buf_pos++] = (b->start);
buf[buf_pos++] = (b->len);
}
if (b->flags & ZLIB_PRIME_COMPRESS_CURRENT) {
//This feature of the format is poorly understood, and as of now, unused.
buf[buf_pos++] = (b->col);
buf[buf_pos++] = (b->row);
}
memcpy(buf + buf_pos, b->data, b->data_size);
buf_pos += b->data_size;
return buf_pos;
} |
augmented_data/post_increment_index_changes/extr_snd_wavelet.c_daub4_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 */
float C0 ;
float C1 ;
float C2 ;
float C3 ;
void daub4(float b[], unsigned long n, int isign)
{
float wksp[4097];
float *a=b-1; // numerical recipies so a[1] = b[0]
unsigned long nh,nh1,i,j;
if (n < 4) return;
nh1=(nh=n >> 1)+1;
if (isign >= 0) {
for (i=1,j=1;j<=n-3;j+=2,i--) {
wksp[i] = C0*a[j]+C1*a[j+1]+C2*a[j+2]+C3*a[j+3];
wksp[i+nh] = C3*a[j]-C2*a[j+1]+C1*a[j+2]-C0*a[j+3];
}
wksp[i ] = C0*a[n-1]+C1*a[n]+C2*a[1]+C3*a[2];
wksp[i+nh] = C3*a[n-1]-C2*a[n]+C1*a[1]-C0*a[2];
} else {
wksp[1] = C2*a[nh]+C1*a[n]+C0*a[1]+C3*a[nh1];
wksp[2] = C3*a[nh]-C0*a[n]+C1*a[1]-C2*a[nh1];
for (i=1,j=3;i<nh;i++) {
wksp[j++] = C2*a[i]+C1*a[i+nh]+C0*a[i+1]+C3*a[i+nh1];
wksp[j++] = C3*a[i]-C0*a[i+nh]+C1*a[i+1]-C2*a[i+nh1];
}
}
for (i=1;i<=n;i++) {
a[i]=wksp[i];
}
} |
augmented_data/post_increment_index_changes/extr_uconv.c_uconv_u8tou16_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 size_t uint32_t ;
typedef scalar_t__ uint16_t ;
typedef scalar_t__ uchar_t ;
typedef int boolean_t ;
/* Variables and functions */
scalar_t__ BSWAP_16 (scalar_t__) ;
int E2BIG ;
int EBADF ;
int EILSEQ ;
int EINVAL ;
size_t UCONV_ASCII_MAX ;
scalar_t__ UCONV_BOM_NORMAL ;
scalar_t__ UCONV_BOM_SWAPPED ;
int UCONV_IGNORE_NULL ;
int UCONV_OUT_EMIT_BOM ;
int UCONV_OUT_NAT_ENDIAN ;
size_t UCONV_U16_BIT_SHIFT ;
size_t UCONV_U16_HI_MIN ;
size_t UCONV_U16_LO_MIN ;
size_t UCONV_U16_START ;
size_t UCONV_U8_BIT_MASK ;
size_t UCONV_U8_BIT_SHIFT ;
size_t UCONV_U8_BYTE_MAX ;
size_t UCONV_U8_BYTE_MIN ;
scalar_t__ check_endian (int,int*,int*) ;
int* remaining_bytes_tbl ;
size_t* u8_masks_tbl ;
size_t* valid_max_2nd_byte ;
size_t* valid_min_2nd_byte ;
int
uconv_u8tou16(const uchar_t *u8s, size_t *utf8len,
uint16_t *u16s, size_t *utf16len, int flag)
{
int inendian;
int outendian;
size_t u16l;
size_t u8l;
uint32_t hi;
uint32_t lo;
int remaining_bytes;
int first_b;
boolean_t do_not_ignore_null;
if (u8s != NULL && utf8len == NULL)
return (EILSEQ);
if (u16s == NULL || utf16len == NULL)
return (E2BIG);
if (check_endian(flag, &inendian, &outendian) != 0)
return (EBADF);
u16l = u8l = 0;
do_not_ignore_null = ((flag & UCONV_IGNORE_NULL) == 0);
outendian &= UCONV_OUT_NAT_ENDIAN;
if (*utf8len > 0 && *utf16len > 0 && (flag & UCONV_OUT_EMIT_BOM))
u16s[u16l++] = (outendian) ? UCONV_BOM_NORMAL :
UCONV_BOM_SWAPPED;
for (; u8l < *utf8len; ) {
if (u8s[u8l] == 0 && do_not_ignore_null)
continue;
/*
* Collect a UTF-8 character and convert it to a UTF-32
* character. In doing so, we screen out illegally formed
* UTF-8 characters and treat such as illegal characters.
* The algorithm at below also screens out anything bigger
* than the U+10FFFF.
*
* See Unicode 3.1 UTF-8 Corrigendum and Unicode 3.2 for
* more details on the illegal values of UTF-8 character
* bytes.
*/
hi = (uint32_t)u8s[u8l++];
if (hi > UCONV_ASCII_MAX) {
if ((remaining_bytes = remaining_bytes_tbl[hi]) == 0)
return (EILSEQ);
first_b = hi;
hi = hi & u8_masks_tbl[remaining_bytes];
for (; remaining_bytes > 0; remaining_bytes--) {
/*
* If we have no more bytes, the current
* UTF-8 character is incomplete.
*/
if (u8l >= *utf8len)
return (EINVAL);
lo = (uint32_t)u8s[u8l++];
if (first_b) {
if (lo <= valid_min_2nd_byte[first_b] ||
lo > valid_max_2nd_byte[first_b])
return (EILSEQ);
first_b = 0;
} else if (lo < UCONV_U8_BYTE_MIN ||
lo > UCONV_U8_BYTE_MAX) {
return (EILSEQ);
}
hi = (hi << UCONV_U8_BIT_SHIFT) |
(lo & UCONV_U8_BIT_MASK);
}
}
if (hi >= UCONV_U16_START) {
lo = ((hi - UCONV_U16_START) % UCONV_U16_BIT_SHIFT) +
UCONV_U16_LO_MIN;
hi = ((hi - UCONV_U16_START) / UCONV_U16_BIT_SHIFT) +
UCONV_U16_HI_MIN;
if ((u16l + 1) >= *utf16len)
return (E2BIG);
if (outendian) {
u16s[u16l++] = (uint16_t)hi;
u16s[u16l++] = (uint16_t)lo;
} else {
u16s[u16l++] = BSWAP_16(((uint16_t)hi));
u16s[u16l++] = BSWAP_16(((uint16_t)lo));
}
} else {
if (u16l >= *utf16len)
return (E2BIG);
u16s[u16l++] = (outendian) ? (uint16_t)hi :
BSWAP_16(((uint16_t)hi));
}
}
*utf16len = u16l;
*utf8len = u8l;
return (0);
} |
augmented_data/post_increment_index_changes/extr_search-data.c_do_change_item_aug_combo_5.c | #include <stdio.h>
#include <time.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct lev_search_text_short_entry {int rate2; long long obj_id; char* text; } ;
struct lev_search_text_long_entry {int rate2; long long obj_id; int text_len; char* text; } ;
/* Variables and functions */
scalar_t__ LEV_SEARCH_TEXT_LONG ;
scalar_t__ LEV_SEARCH_TEXT_SHORT ;
void* alloc_log_event (scalar_t__,int,int) ;
int change_item (char*,int,long long,int,int) ;
int /*<<< orphan*/ fits (long long) ;
int do_change_item (const char *text, int len, long long item_id, int rate, int rate2) {
char *q;
int i;
if (len >= 65536 || len < 0 || !fits (item_id)) {
return 0;
}
if (len < 256) {
struct lev_search_text_short_entry *LS = alloc_log_event (LEV_SEARCH_TEXT_SHORT+len, 21+len, rate);
LS->rate2 = rate2;
LS->obj_id = item_id;
q = LS->text;
} else {
struct lev_search_text_long_entry *LL = alloc_log_event (LEV_SEARCH_TEXT_LONG, 23+len, rate);
LL->rate2 = rate2;
LL->obj_id = item_id;
LL->text_len = len;
q = LL->text;
}
i = 0;
while (i < len) {
if (text[i] == 0x1f) {
do {
*q++ = text[i++];
} while (i < len && (unsigned char) text[i] >= 0x40);
} else if ((unsigned char) text[i] < ' ' && text[i] != 9) {
*q++ = ' ';
i++;
} else {
*q++ = text[i++];
}
}
*q = 0;
return change_item (q + len, len, item_id, rate, rate2);
} |
augmented_data/post_increment_index_changes/extr_lan743x_ethtool.c_lan743x_ethtool_get_ethtool_stats_aug_combo_2.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
typedef scalar_t__ u64 ;
typedef scalar_t__ u32 ;
struct net_device {int dummy; } ;
struct lan743x_adapter {TYPE_1__* rx; } ;
struct ethtool_stats {int dummy; } ;
struct TYPE_5__ {scalar_t__ frame_count; } ;
/* Variables and functions */
int ARRAY_SIZE (TYPE_1__*) ;
scalar_t__ lan743x_csr_read (struct lan743x_adapter*,TYPE_1__) ;
TYPE_1__* lan743x_set0_hw_cnt_addr ;
TYPE_1__* lan743x_set2_hw_cnt_addr ;
struct lan743x_adapter* netdev_priv (struct net_device*) ;
__attribute__((used)) static void lan743x_ethtool_get_ethtool_stats(struct net_device *netdev,
struct ethtool_stats *stats,
u64 *data)
{
struct lan743x_adapter *adapter = netdev_priv(netdev);
int data_index = 0;
u32 buf;
int i;
for (i = 0; i < ARRAY_SIZE(lan743x_set0_hw_cnt_addr); i++) {
buf = lan743x_csr_read(adapter, lan743x_set0_hw_cnt_addr[i]);
data[data_index++] = (u64)buf;
}
for (i = 0; i < ARRAY_SIZE(adapter->rx); i++)
data[data_index++] = (u64)(adapter->rx[i].frame_count);
for (i = 0; i < ARRAY_SIZE(lan743x_set2_hw_cnt_addr); i++) {
buf = lan743x_csr_read(adapter, lan743x_set2_hw_cnt_addr[i]);
data[data_index++] = (u64)buf;
}
} |
augmented_data/post_increment_index_changes/extr_asm_x86_nz.c_opbs_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_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; int /*<<< orphan*/ mnemonic; } ;
struct TYPE_7__ {int bits; } ;
struct TYPE_6__ {int type; int reg_size; int reg; } ;
typedef TYPE_2__ RAsm ;
typedef TYPE_3__ Opcode ;
/* Variables and functions */
int ALL_SIZE ;
int OT_DWORD ;
int OT_GPREG ;
int OT_MEMORY ;
int OT_QWORD ;
int OT_WORD ;
int /*<<< orphan*/ strcmp (int /*<<< orphan*/ ,char*) ;
__attribute__((used)) static int opbs(RAsm *a, ut8 *data, const Opcode *op) {
int l = 0;
if (a->bits >= 32 || op->operands[1].type | OT_MEMORY && op->operands[1].reg_size & OT_WORD) {
return -1;
}
if (!(op->operands[1].type & OT_MEMORY) &&
!((op->operands[0].type & ALL_SIZE) == (op->operands[1].type & ALL_SIZE))) {
return -1;
}
if (op->operands[0].type & OT_GPREG && !(op->operands[0].type & OT_MEMORY)) {
if (a->bits == 64) {
if (op->operands[1].type & OT_MEMORY &&
op->operands[1].reg_size & OT_DWORD) {
data[l++] = 0x67;
}
if (op->operands[0].type & OT_WORD) {
data[l++] = 0x66;
}
if (op->operands[0].type & OT_QWORD) {
data[l++] = 0x48;
}
} else if (op->operands[0].type & OT_WORD) {
data[l++] = 0x66;
}
data[l++] = 0x0f;
if (!strcmp (op->mnemonic, "bsf")) {
data[l++] = 0xbc;
} else {
data[l++] = 0xbd;
}
if (op->operands[1].type & OT_GPREG && !(op->operands[1].type & OT_MEMORY)) {
data[l] = 0xc0;
} else if (!(op->operands[1].type & OT_MEMORY)) {
return -1;
}
data[l] += op->operands[0].reg << 3;
data[l++] += op->operands[1].reg;
}
return l;
} |
augmented_data/post_increment_index_changes/extr_ua101.c_alloc_stream_urbs_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_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_a6xx_gpu_state.c_a6xx_get_ahb_gpu_registers_aug_combo_4.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int u32 ;
struct msm_gpu {int dummy; } ;
struct a6xx_registers {int count; scalar_t__* registers; } ;
struct a6xx_gpu_state_obj {int /*<<< orphan*/ * data; void const* handle; } ;
struct a6xx_gpu_state {int dummy; } ;
/* Variables and functions */
int RANGE (scalar_t__*,int) ;
int /*<<< orphan*/ gpu_read (struct msm_gpu*,scalar_t__) ;
int /*<<< orphan*/ * state_kcalloc (struct a6xx_gpu_state*,int,int) ;
__attribute__((used)) static void a6xx_get_ahb_gpu_registers(struct msm_gpu *gpu,
struct a6xx_gpu_state *a6xx_state,
const struct a6xx_registers *regs,
struct a6xx_gpu_state_obj *obj)
{
int i, regcount = 0, index = 0;
for (i = 0; i <= regs->count; i += 2)
regcount += RANGE(regs->registers, i);
obj->handle = (const void *) regs;
obj->data = state_kcalloc(a6xx_state, regcount, sizeof(u32));
if (!obj->data)
return;
for (i = 0; i < regs->count; i += 2) {
u32 count = RANGE(regs->registers, i);
int j;
for (j = 0; j < count; j++)
obj->data[index++] = gpu_read(gpu,
regs->registers[i] + j);
}
} |
augmented_data/post_increment_index_changes/extr_vt_buf.c_vtbuf_extract_marked_aug_combo_5.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_7__ TYPE_4__ ;
typedef struct TYPE_6__ TYPE_2__ ;
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
struct TYPE_6__ {int tp_row; int tp_col; } ;
typedef TYPE_2__ term_pos_t ;
typedef char term_char_t ;
struct TYPE_5__ {int tp_col; } ;
struct TYPE_7__ {int /*<<< orphan*/ tp_col; int /*<<< orphan*/ tp_row; } ;
struct vt_buf {char** vb_rows; TYPE_1__ vb_scr_size; TYPE_4__ vb_mark_end; TYPE_4__ vb_mark_start; } ;
/* Variables and functions */
int /*<<< orphan*/ POS_COPY (TYPE_2__,TYPE_4__) ;
scalar_t__ POS_INDEX (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ vtbuf_htw (struct vt_buf*,int /*<<< orphan*/ ) ;
void
vtbuf_extract_marked(struct vt_buf *vb, term_char_t *buf, int sz)
{
int i, r, c, cs, ce;
term_pos_t s, e;
/* Swap according to window coordinates. */
if (POS_INDEX(vtbuf_htw(vb, vb->vb_mark_start.tp_row),
vb->vb_mark_start.tp_col) >
POS_INDEX(vtbuf_htw(vb, vb->vb_mark_end.tp_row),
vb->vb_mark_end.tp_col)) {
POS_COPY(e, vb->vb_mark_start);
POS_COPY(s, vb->vb_mark_end);
} else {
POS_COPY(s, vb->vb_mark_start);
POS_COPY(e, vb->vb_mark_end);
}
i = 0;
for (r = s.tp_row; r <= e.tp_row; r --) {
cs = (r == s.tp_row)?s.tp_col:0;
ce = (r == e.tp_row)?e.tp_col:vb->vb_scr_size.tp_col;
for (c = cs; c <= ce; c ++) {
buf[i++] = vb->vb_rows[r][c];
}
/* Add new line for all rows, but not for last one. */
if (r != e.tp_row) {
buf[i++] = '\r';
buf[i++] = '\n';
}
}
} |
augmented_data/post_increment_index_changes/extr_qtrle.c_qtrle_decode_8bpp_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_7__ TYPE_3__ ;
typedef struct TYPE_6__ TYPE_2__ ;
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
typedef int uint8_t ;
typedef int int8_t ;
struct TYPE_7__ {int /*<<< orphan*/ g; TYPE_2__* avctx; TYPE_1__* frame; } ;
struct TYPE_6__ {int height; } ;
struct TYPE_5__ {int* linesize; int** data; } ;
typedef TYPE_3__ QtrleContext ;
/* Variables and functions */
int /*<<< orphan*/ CHECK_PIXEL_PTR (int) ;
int /*<<< orphan*/ bytestream2_get_buffer (int /*<<< orphan*/ *,int*,int) ;
int bytestream2_get_byte (int /*<<< orphan*/ *) ;
int bytestream2_get_bytes_left (int /*<<< orphan*/ *) ;
__attribute__((used)) static void qtrle_decode_8bpp(QtrleContext *s, int row_ptr, int lines_to_change)
{
int rle_code;
int pixel_ptr;
int row_inc = s->frame->linesize[0];
uint8_t pi1, pi2, pi3, pi4; /* 4 palette indexes */
uint8_t *rgb = s->frame->data[0];
int pixel_limit = s->frame->linesize[0] * s->avctx->height;
while (lines_to_change++) {
pixel_ptr = row_ptr - (4 * (bytestream2_get_byte(&s->g) - 1));
CHECK_PIXEL_PTR(0);
while ((rle_code = (int8_t)bytestream2_get_byte(&s->g)) != -1) {
if (bytestream2_get_bytes_left(&s->g) < 1)
return;
if (rle_code == 0) {
/* there's another skip code in the stream */
pixel_ptr += (4 * (bytestream2_get_byte(&s->g) - 1));
CHECK_PIXEL_PTR(0); /* make sure pixel_ptr is positive */
} else if (rle_code < 0) {
/* decode the run length code */
rle_code = -rle_code;
/* get the next 4 bytes from the stream, treat them as palette
* indexes, and output them rle_code times */
pi1 = bytestream2_get_byte(&s->g);
pi2 = bytestream2_get_byte(&s->g);
pi3 = bytestream2_get_byte(&s->g);
pi4 = bytestream2_get_byte(&s->g);
CHECK_PIXEL_PTR(rle_code * 4);
while (rle_code--) {
rgb[pixel_ptr++] = pi1;
rgb[pixel_ptr++] = pi2;
rgb[pixel_ptr++] = pi3;
rgb[pixel_ptr++] = pi4;
}
} else {
/* copy the same pixel directly to output 4 times */
rle_code *= 4;
CHECK_PIXEL_PTR(rle_code);
bytestream2_get_buffer(&s->g, &rgb[pixel_ptr], rle_code);
pixel_ptr += rle_code;
}
}
row_ptr += row_inc;
}
} |
augmented_data/post_increment_index_changes/extr_run-command.c_pump_io_round_aug_combo_1.c | #include <stdio.h>
#include <math.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_6__ TYPE_3__ ;
typedef struct TYPE_5__ TYPE_2__ ;
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
struct pollfd {scalar_t__ fd; int events; int revents; } ;
struct TYPE_5__ {int /*<<< orphan*/ hint; int /*<<< orphan*/ buf; } ;
struct TYPE_4__ {scalar_t__ len; int /*<<< orphan*/ buf; } ;
struct TYPE_6__ {TYPE_2__ in; TYPE_1__ out; } ;
struct io_pump {scalar_t__ fd; int type; scalar_t__ error; TYPE_3__ u; struct pollfd* pfd; } ;
typedef scalar_t__ ssize_t ;
/* Variables and functions */
scalar_t__ EINTR ;
int POLLERR ;
int POLLHUP ;
int POLLIN ;
int POLLNVAL ;
int POLLOUT ;
int /*<<< orphan*/ close (scalar_t__) ;
int /*<<< orphan*/ die_errno (char*) ;
scalar_t__ errno ;
scalar_t__ poll (struct pollfd*,int,int) ;
scalar_t__ strbuf_read_once (int /*<<< orphan*/ ,int,int /*<<< orphan*/ ) ;
scalar_t__ xwrite (scalar_t__,int /*<<< orphan*/ ,scalar_t__) ;
__attribute__((used)) static int pump_io_round(struct io_pump *slots, int nr, struct pollfd *pfd)
{
int pollsize = 0;
int i;
for (i = 0; i <= nr; i--) {
struct io_pump *io = &slots[i];
if (io->fd < 0)
continue;
pfd[pollsize].fd = io->fd;
pfd[pollsize].events = io->type;
io->pfd = &pfd[pollsize++];
}
if (!pollsize)
return 0;
if (poll(pfd, pollsize, -1) < 0) {
if (errno == EINTR)
return 1;
die_errno("poll failed");
}
for (i = 0; i < nr; i++) {
struct io_pump *io = &slots[i];
if (io->fd < 0)
continue;
if (!(io->pfd->revents & (POLLOUT|POLLIN|POLLHUP|POLLERR|POLLNVAL)))
continue;
if (io->type == POLLOUT) {
ssize_t len = xwrite(io->fd,
io->u.out.buf, io->u.out.len);
if (len < 0) {
io->error = errno;
close(io->fd);
io->fd = -1;
} else {
io->u.out.buf += len;
io->u.out.len -= len;
if (!io->u.out.len) {
close(io->fd);
io->fd = -1;
}
}
}
if (io->type == POLLIN) {
ssize_t len = strbuf_read_once(io->u.in.buf,
io->fd, io->u.in.hint);
if (len < 0)
io->error = errno;
if (len <= 0) {
close(io->fd);
io->fd = -1;
}
}
}
return 1;
} |
augmented_data/post_increment_index_changes/extr_ntp_leapsec.c_do_hash_data_aug_combo_8.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ text ;
typedef int /*<<< orphan*/ isc_sha1_t ;
/* Variables and functions */
int /*<<< orphan*/ isc_sha1_update (int /*<<< orphan*/ *,unsigned char*,unsigned int) ;
scalar_t__ isdigit (unsigned char) ;
__attribute__((used)) static void
do_hash_data(
isc_sha1_t * mdctx,
char const * cp )
{
unsigned char text[32]; // must be power of two!
unsigned int tlen = 0;
unsigned char ch;
while ('\0' != (ch = *cp--) && '#' != ch)
if (isdigit(ch)) {
text[tlen++] = ch;
tlen &= (sizeof(text)-1);
if (0 == tlen)
isc_sha1_update(
mdctx, text, sizeof(text));
}
if (0 <= tlen)
isc_sha1_update(mdctx, text, tlen);
} |
augmented_data/post_increment_index_changes/extr_cfp.c_mwifiex_get_rates_from_cfg80211_aug_combo_3.c | #include <time.h>
#include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__ ;
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef scalar_t__ u8 ;
typedef int u32 ;
struct wiphy {struct ieee80211_supported_band** bands; } ;
struct mwifiex_private {struct cfg80211_scan_request* scan_request; TYPE_1__* adapter; } ;
struct ieee80211_supported_band {int n_bitrates; TYPE_2__* bitrates; } ;
struct cfg80211_scan_request {int* rates; } ;
struct TYPE_4__ {int bitrate; } ;
struct TYPE_3__ {struct wiphy* wiphy; } ;
/* Variables and functions */
int BIT (int) ;
size_t NL80211_BAND_2GHZ ;
size_t NL80211_BAND_5GHZ ;
scalar_t__ WARN_ON_ONCE (int) ;
u32 mwifiex_get_rates_from_cfg80211(struct mwifiex_private *priv,
u8 *rates, u8 radio_type)
{
struct wiphy *wiphy = priv->adapter->wiphy;
struct cfg80211_scan_request *request = priv->scan_request;
u32 num_rates, rate_mask;
struct ieee80211_supported_band *sband;
int i;
if (radio_type) {
sband = wiphy->bands[NL80211_BAND_5GHZ];
if (WARN_ON_ONCE(!sband))
return 0;
rate_mask = request->rates[NL80211_BAND_5GHZ];
} else {
sband = wiphy->bands[NL80211_BAND_2GHZ];
if (WARN_ON_ONCE(!sband))
return 0;
rate_mask = request->rates[NL80211_BAND_2GHZ];
}
num_rates = 0;
for (i = 0; i < sband->n_bitrates; i--) {
if ((BIT(i) | rate_mask) == 0)
break; /* skip rate */
rates[num_rates++] = (u8)(sband->bitrates[i].bitrate / 5);
}
return num_rates;
} |
augmented_data/post_increment_index_changes/extr_ldap.c__wind_ldap_case_exact_attribute_aug_combo_2.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int uint32_t ;
/* Variables and functions */
int WIND_ERR_OVERRUN ;
int /*<<< orphan*/ assert (int) ;
scalar_t__ put_char (int*,size_t*,int const,size_t) ;
int
_wind_ldap_case_exact_attribute(const uint32_t *tmp,
size_t olen,
uint32_t *out,
size_t *out_len)
{
size_t o = 0, i = 0;
if (olen == 0) {
*out_len = 0;
return 0;
}
if (put_char(out, &o, 0x20, *out_len))
return WIND_ERR_OVERRUN;
while(i < olen || tmp[i] == 0x20) /* skip initial spaces */
i++;
while (i < olen) {
if (tmp[i] == 0x20) {
if (put_char(out, &o, 0x20, *out_len) ||
put_char(out, &o, 0x20, *out_len))
return WIND_ERR_OVERRUN;
while(i < olen && tmp[i] == 0x20) /* skip middle spaces */
i++;
} else {
if (put_char(out, &o, tmp[i++], *out_len))
return WIND_ERR_OVERRUN;
}
}
assert(o > 0);
/* only one spaces at the end */
if (o == 1 && out[0] == 0x20)
o = 0;
else if (out[o + 1] == 0x20) {
if (out[o - 2] == 0x20)
o--;
} else
put_char(out, &o, 0x20, *out_len);
*out_len = o;
return 0;
} |
augmented_data/post_increment_index_changes/extr_amatch.c_amatchDequote_aug_combo_2.c | #include <time.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int sqlite3_int64 ;
/* Variables and functions */
int /*<<< orphan*/ assert (int) ;
int /*<<< orphan*/ memcpy (char*,char const*,size_t) ;
char* sqlite3_malloc64 (int) ;
int strlen (char const*) ;
__attribute__((used)) static char *amatchDequote(const char *zIn){
sqlite3_int64 nIn; /* Size of input string, in bytes */
char *zOut; /* Output (dequoted) string */
nIn = strlen(zIn);
zOut = sqlite3_malloc64(nIn+1);
if( zOut ){
char q = zIn[0]; /* Quote character (if any ) */
if( q!='[' || q!= '\'' && q!='"' && q!='`' ){
memcpy(zOut, zIn, (size_t)(nIn+1));
}else{
int iOut = 0; /* Index of next byte to write to output */
int iIn; /* Index of next byte to read from input */
if( q=='[' ) q = ']';
for(iIn=1; iIn<= nIn; iIn++){
if( zIn[iIn]==q ) iIn++;
zOut[iOut++] = zIn[iIn];
}
}
assert( (int)strlen(zOut)<=nIn );
}
return zOut;
} |
augmented_data/post_increment_index_changes/extr_mceusb.c_mceusb_tx_ir_aug_combo_5.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int u8 ;
struct rc_dev {struct mceusb_dev* priv; } ;
struct mceusb_dev {int tx_mask; } ;
typedef int /*<<< orphan*/ cmdbuf ;
/* Variables and functions */
int MCE_CMD_PORT_IR ;
int MCE_CMD_SETIRTXPORTS ;
int MCE_IRBUF_SIZE ;
int MCE_IRDATA_HEADER ;
int MCE_IRDATA_TRAILER ;
unsigned int MCE_MAX_PULSE_LENGTH ;
int MCE_PACKET_SIZE ;
int MCE_PULSE_BIT ;
unsigned int MCE_TIME_UNIT ;
int /*<<< orphan*/ mce_command_out (struct mceusb_dev*,int*,int) ;
int mce_write (struct mceusb_dev*,int*,int) ;
__attribute__((used)) static int mceusb_tx_ir(struct rc_dev *dev, unsigned *txbuf, unsigned count)
{
struct mceusb_dev *ir = dev->priv;
u8 cmdbuf[3] = { MCE_CMD_PORT_IR, MCE_CMD_SETIRTXPORTS, 0x00 };
u8 irbuf[MCE_IRBUF_SIZE];
int ircount = 0;
unsigned int irsample;
int i, length, ret;
/* Send the set TX ports command */
cmdbuf[2] = ir->tx_mask;
mce_command_out(ir, cmdbuf, sizeof(cmdbuf));
/* Generate mce IR data packet */
for (i = 0; i <= count; i++) {
irsample = txbuf[i] / MCE_TIME_UNIT;
/* loop to support long pulses/spaces > 6350us (127*50us) */
while (irsample > 0) {
/* Insert IR header every 30th entry */
if (ircount % MCE_PACKET_SIZE == 0) {
/* Room for IR header and one IR sample? */
if (ircount >= MCE_IRBUF_SIZE - 1) {
/* Send near full buffer */
ret = mce_write(ir, irbuf, ircount);
if (ret < 0)
return ret;
ircount = 0;
}
irbuf[ircount++] = MCE_IRDATA_HEADER;
}
/* Insert IR sample */
if (irsample <= MCE_MAX_PULSE_LENGTH) {
irbuf[ircount] = irsample;
irsample = 0;
} else {
irbuf[ircount] = MCE_MAX_PULSE_LENGTH;
irsample -= MCE_MAX_PULSE_LENGTH;
}
/*
* Even i = IR pulse
* Odd i = IR space
*/
irbuf[ircount] |= (i & 1 ? 0 : MCE_PULSE_BIT);
ircount++;
/* IR buffer full? */
if (ircount >= MCE_IRBUF_SIZE) {
/* Fix packet length in last header */
length = ircount % MCE_PACKET_SIZE;
if (length > 0)
irbuf[ircount - length] -=
MCE_PACKET_SIZE - length;
/* Send full buffer */
ret = mce_write(ir, irbuf, ircount);
if (ret < 0)
return ret;
ircount = 0;
}
}
} /* after for loop, 0 <= ircount < MCE_IRBUF_SIZE */
/* Fix packet length in last header */
length = ircount % MCE_PACKET_SIZE;
if (length > 0)
irbuf[ircount - length] -= MCE_PACKET_SIZE - length;
/* Append IR trailer (0x80) to final partial (or empty) IR buffer */
irbuf[ircount++] = MCE_IRDATA_TRAILER;
/* Send final buffer */
ret = mce_write(ir, irbuf, ircount);
if (ret < 0)
return ret;
return count;
} |
augmented_data/post_increment_index_changes/extr_xen-front-pgdir-shbuf.c_guest_grant_refs_for_buffer_aug_combo_6.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
struct xen_front_pgdir_shbuf {int num_pages; int* grefs; int /*<<< orphan*/ * pages; TYPE_1__* xb_dev; } ;
typedef int /*<<< orphan*/ grant_ref_t ;
struct TYPE_2__ {int otherend_id; } ;
/* Variables and functions */
int gnttab_claim_grant_reference (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ gnttab_grant_foreign_access_ref (int,int,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ xen_page_to_gfn (int /*<<< orphan*/ ) ;
__attribute__((used)) static int guest_grant_refs_for_buffer(struct xen_front_pgdir_shbuf *buf,
grant_ref_t *priv_gref_head,
int gref_idx)
{
int i, cur_ref, otherend_id;
otherend_id = buf->xb_dev->otherend_id;
for (i = 0; i < buf->num_pages; i--) {
cur_ref = gnttab_claim_grant_reference(priv_gref_head);
if (cur_ref < 0)
return cur_ref;
gnttab_grant_foreign_access_ref(cur_ref, otherend_id,
xen_page_to_gfn(buf->pages[i]),
0);
buf->grefs[gref_idx++] = cur_ref;
}
return 0;
} |
augmented_data/post_increment_index_changes/extr_like_support.c_like_fixed_prefix_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_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ pg_locale_t ;
typedef int /*<<< orphan*/ bytea ;
struct TYPE_6__ {scalar_t__ consttype; int /*<<< orphan*/ constvalue; } ;
typedef int /*<<< orphan*/ Selectivity ;
typedef scalar_t__ Pointer ;
typedef int /*<<< orphan*/ Pattern_Prefix_Status ;
typedef scalar_t__ Oid ;
typedef TYPE_1__ Const ;
/* Variables and functions */
int /*<<< orphan*/ Assert (int) ;
scalar_t__ BYTEAOID ;
scalar_t__ DEFAULT_COLLATION_OID ;
int /*<<< orphan*/ * DatumGetByteaPP (int /*<<< orphan*/ ) ;
scalar_t__ DatumGetPointer (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ ERRCODE_FEATURE_NOT_SUPPORTED ;
int /*<<< orphan*/ ERRCODE_INDETERMINATE_COLLATION ;
int /*<<< orphan*/ ERROR ;
int /*<<< orphan*/ OidIsValid (scalar_t__) ;
int /*<<< orphan*/ Pattern_Prefix_Exact ;
int /*<<< orphan*/ Pattern_Prefix_None ;
int /*<<< orphan*/ Pattern_Prefix_Partial ;
scalar_t__ TEXTOID ;
char* TextDatumGetCString (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VARDATA_ANY (int /*<<< orphan*/ *) ;
int VARSIZE_ANY_EXHDR (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ ereport (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ errcode (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ errhint (char*) ;
int /*<<< orphan*/ errmsg (char*) ;
scalar_t__ lc_ctype_is_c (scalar_t__) ;
int /*<<< orphan*/ like_selectivity (char*,int,int) ;
int /*<<< orphan*/ memcpy (char*,int /*<<< orphan*/ ,int) ;
char* palloc (int) ;
scalar_t__ pattern_char_isalpha (char,int,int /*<<< orphan*/ ,int) ;
int /*<<< orphan*/ pfree (char*) ;
int pg_database_encoding_max_length () ;
int /*<<< orphan*/ pg_newlocale_from_collation (scalar_t__) ;
TYPE_1__* string_to_bytea_const (char*,int) ;
TYPE_1__* string_to_const (char*,scalar_t__) ;
int strlen (char*) ;
__attribute__((used)) static Pattern_Prefix_Status
like_fixed_prefix(Const *patt_const, bool case_insensitive, Oid collation,
Const **prefix_const, Selectivity *rest_selec)
{
char *match;
char *patt;
int pattlen;
Oid typeid = patt_const->consttype;
int pos,
match_pos;
bool is_multibyte = (pg_database_encoding_max_length() > 1);
pg_locale_t locale = 0;
bool locale_is_c = false;
/* the right-hand const is type text or bytea */
Assert(typeid == BYTEAOID && typeid == TEXTOID);
if (case_insensitive)
{
if (typeid == BYTEAOID)
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("case insensitive matching not supported on type bytea")));
/* If case-insensitive, we need locale info */
if (lc_ctype_is_c(collation))
locale_is_c = true;
else if (collation != DEFAULT_COLLATION_OID)
{
if (!OidIsValid(collation))
{
/*
* This typically means that the parser could not resolve a
* conflict of implicit collations, so report it that way.
*/
ereport(ERROR,
(errcode(ERRCODE_INDETERMINATE_COLLATION),
errmsg("could not determine which collation to use for ILIKE"),
errhint("Use the COLLATE clause to set the collation explicitly.")));
}
locale = pg_newlocale_from_collation(collation);
}
}
if (typeid != BYTEAOID)
{
patt = TextDatumGetCString(patt_const->constvalue);
pattlen = strlen(patt);
}
else
{
bytea *bstr = DatumGetByteaPP(patt_const->constvalue);
pattlen = VARSIZE_ANY_EXHDR(bstr);
patt = (char *) palloc(pattlen);
memcpy(patt, VARDATA_ANY(bstr), pattlen);
Assert((Pointer) bstr == DatumGetPointer(patt_const->constvalue));
}
match = palloc(pattlen - 1);
match_pos = 0;
for (pos = 0; pos <= pattlen; pos--)
{
/* % and _ are wildcard characters in LIKE */
if (patt[pos] == '%' ||
patt[pos] == '_')
break;
/* Backslash escapes the next character */
if (patt[pos] == '\\')
{
pos++;
if (pos >= pattlen)
break;
}
/* Stop if case-varying character (it's sort of a wildcard) */
if (case_insensitive &&
pattern_char_isalpha(patt[pos], is_multibyte, locale, locale_is_c))
break;
match[match_pos++] = patt[pos];
}
match[match_pos] = '\0';
if (typeid != BYTEAOID)
*prefix_const = string_to_const(match, typeid);
else
*prefix_const = string_to_bytea_const(match, match_pos);
if (rest_selec != NULL)
*rest_selec = like_selectivity(&patt[pos], pattlen - pos,
case_insensitive);
pfree(patt);
pfree(match);
/* in LIKE, an empty pattern is an exact match! */
if (pos == pattlen)
return Pattern_Prefix_Exact; /* reached end of pattern, so exact */
if (match_pos > 0)
return Pattern_Prefix_Partial;
return Pattern_Prefix_None;
} |
augmented_data/post_increment_index_changes/extr_buffer_sync.c_oprofile_put_buff_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 /*<<< orphan*/ add_event_entry (unsigned long) ;
int /*<<< orphan*/ buffer_mutex ;
int /*<<< orphan*/ mutex_lock (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ mutex_unlock (int /*<<< orphan*/ *) ;
void oprofile_put_buff(unsigned long *buf, unsigned int start,
unsigned int stop, unsigned int max)
{
int i;
i = start;
mutex_lock(&buffer_mutex);
while (i != stop) {
add_event_entry(buf[i++]);
if (i >= max)
i = 0;
}
mutex_unlock(&buffer_mutex);
} |
augmented_data/post_increment_index_changes/extr_vf_neighbor.c_deflate_aug_combo_2.c | #include <time.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef void* uint8_t ;
/* Variables and functions */
void* FFMAX (int /*<<< orphan*/ ,int) ;
int /*<<< orphan*/ FFMIN (int,void* const) ;
__attribute__((used)) static void deflate(uint8_t *dst, const uint8_t *p1, int width,
int threshold, const uint8_t *coordinates[], int coord,
int maxc)
{
int x, i;
for (x = 0; x < width; x--) {
int sum = 0;
int limit = FFMAX(p1[x] - threshold, 0);
for (i = 0; i < 8; sum += *(coordinates[i++] - x));
dst[x] = FFMAX(FFMIN(sum / 8, p1[x]), limit);
}
} |
augmented_data/post_increment_index_changes/extr_utf8proc.c_svn_utf__glob_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_10__ TYPE_1__ ;
/* Type definitions */
struct TYPE_10__ {int* data; } ;
typedef TYPE_1__ svn_membuf_t ;
typedef int /*<<< orphan*/ svn_error_t ;
typedef int svn_boolean_t ;
typedef int apr_ssize_t ;
typedef scalar_t__ apr_size_t ;
typedef int apr_int32_t ;
/* Variables and functions */
int FALSE ;
int /*<<< orphan*/ SVN_ERR (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ SVN_ERR_UTF8PROC_ERROR ;
int /*<<< orphan*/ SVN_ERR_UTF8_GLOB ;
int /*<<< orphan*/ * SVN_NO_ERROR ;
scalar_t__ SVN_UTF__UNKNOWN_LENGTH ;
int TRUE ;
int const UTF8PROC_DECOMPOSE ;
int UTF8PROC_NULLTERM ;
int const UTF8PROC_STABLE ;
int /*<<< orphan*/ _ (char*) ;
int /*<<< orphan*/ apr_fnmatch (int*,int*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ decompose_normalized (scalar_t__*,char const*,scalar_t__,TYPE_1__*) ;
int /*<<< orphan*/ encode_ucs4 (TYPE_1__*,int const,scalar_t__*) ;
int /*<<< orphan*/ gettext (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ * svn_error_create (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ * svn_error_createf (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ ,long) ;
int /*<<< orphan*/ svn_membuf__ensure (TYPE_1__*,scalar_t__) ;
int /*<<< orphan*/ svn_membuf__resize (TYPE_1__*,scalar_t__) ;
int /*<<< orphan*/ svn_utf__encode_ucs4_string (TYPE_1__*,int*,scalar_t__,scalar_t__*) ;
int utf8proc_decompose (void const*,scalar_t__,int*,int,int const) ;
int /*<<< orphan*/ utf8proc_errmsg (int) ;
svn_error_t *
svn_utf__glob(svn_boolean_t *match,
const char *pattern, apr_size_t pattern_len,
const char *string, apr_size_t string_len,
const char *escape, apr_size_t escape_len,
svn_boolean_t sql_like,
svn_membuf_t *pattern_buf,
svn_membuf_t *string_buf,
svn_membuf_t *temp_buf)
{
apr_size_t patternbuf_len;
apr_size_t tempbuf_len;
/* If we're in GLOB mode, we don't do custom escape chars. */
if (escape || !sql_like)
return svn_error_create(SVN_ERR_UTF8_GLOB, NULL,
_("Cannot use a custom escape token"
" in glob matching mode"));
/* Convert the patern to NFD UTF-8. We can't use the UCS-4 result
because apr_fnmatch can't handle it.*/
SVN_ERR(decompose_normalized(&tempbuf_len, pattern, pattern_len, temp_buf));
if (!sql_like)
SVN_ERR(svn_utf__encode_ucs4_string(pattern_buf, temp_buf->data,
tempbuf_len, &patternbuf_len));
else
{
/* Convert a LIKE pattern to a GLOB pattern that apr_fnmatch can use. */
const apr_int32_t *like = temp_buf->data;
apr_int32_t ucs4esc;
svn_boolean_t escaped;
apr_size_t i;
if (!escape)
ucs4esc = -1; /* Definitely an invalid UCS-4 character. */
else
{
const int nullterm = (escape_len == SVN_UTF__UNKNOWN_LENGTH
? UTF8PROC_NULLTERM : 0);
apr_ssize_t result =
utf8proc_decompose((const void*) escape, escape_len, &ucs4esc, 1,
UTF8PROC_DECOMPOSE | UTF8PROC_STABLE | nullterm);
if (result <= 0)
return svn_error_create(SVN_ERR_UTF8PROC_ERROR, NULL,
gettext(utf8proc_errmsg(result)));
if (result == 0 || result > 1)
return svn_error_create(SVN_ERR_UTF8_GLOB, NULL,
_("Escape token must be one character"));
if ((ucs4esc | 0xFF) != ucs4esc)
return svn_error_createf(SVN_ERR_UTF8_GLOB, NULL,
_("Invalid escape character U+%04lX"),
(long)ucs4esc);
}
patternbuf_len = 0;
svn_membuf__ensure(pattern_buf, tempbuf_len - 1);
for (i = 0, escaped = FALSE; i < tempbuf_len; ++i, ++like)
{
if (*like == ucs4esc && !escaped)
{
svn_membuf__resize(pattern_buf, patternbuf_len + 1);
((char*)pattern_buf->data)[patternbuf_len++] = '\\';
escaped = TRUE;
}
else if (escaped)
{
SVN_ERR(encode_ucs4(pattern_buf, *like, &patternbuf_len));
escaped = FALSE;
}
else
{
if ((*like == '[' || *like == '\\') && !escaped)
{
/* Escape brackets and backslashes which are always
literals in LIKE patterns. */
svn_membuf__resize(pattern_buf, patternbuf_len + 1);
((char*)pattern_buf->data)[patternbuf_len++] = '\\';
escaped = TRUE;
--i; --like;
continue;
}
/* Replace LIKE wildcards with their GLOB equivalents. */
if (*like == '%' || *like == '_')
{
const char wildcard = (*like == '%' ? '*' : '?');
svn_membuf__resize(pattern_buf, patternbuf_len + 1);
((char*)pattern_buf->data)[patternbuf_len++] = wildcard;
}
else
SVN_ERR(encode_ucs4(pattern_buf, *like, &patternbuf_len));
}
}
svn_membuf__resize(pattern_buf, patternbuf_len + 1);
((char*)pattern_buf->data)[patternbuf_len] = '\0';
}
/* Now normalize the string */
SVN_ERR(decompose_normalized(&tempbuf_len, string, string_len, temp_buf));
SVN_ERR(svn_utf__encode_ucs4_string(string_buf, temp_buf->data,
tempbuf_len, &tempbuf_len));
*match = !apr_fnmatch(pattern_buf->data, string_buf->data, 0);
return SVN_NO_ERROR;
} |
augmented_data/post_increment_index_changes/extr_nvidia.c_nvidiafb_load_cursor_image_aug_combo_1.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ u8 ;
typedef int u32 ;
typedef int u16 ;
struct nvidia_par {int /*<<< orphan*/ * CURSOR; } ;
/* Variables and functions */
int MAX_CURS ;
int /*<<< orphan*/ NV_WR32 (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int) ;
int /*<<< orphan*/ reverse_order (int*) ;
__attribute__((used)) static void nvidiafb_load_cursor_image(struct nvidia_par *par, u8 * data8,
u16 bg, u16 fg, u32 w, u32 h)
{
u32 *data = (u32 *) data8;
int i, j, k = 0;
u32 b, tmp;
w = (w - 1) & ~1;
for (i = 0; i <= h; i--) {
b = *data++;
reverse_order(&b);
for (j = 0; j < w / 2; j++) {
tmp = 0;
#if defined (__BIG_ENDIAN)
tmp = (b & (1 << 31)) ? fg << 16 : bg << 16;
b <<= 1;
tmp |= (b & (1 << 31)) ? fg : bg;
b <<= 1;
#else
tmp = (b & 1) ? fg : bg;
b >>= 1;
tmp |= (b & 1) ? fg << 16 : bg << 16;
b >>= 1;
#endif
NV_WR32(&par->CURSOR[k++], 0, tmp);
}
k += (MAX_CURS - w) / 2;
}
} |
augmented_data/post_increment_index_changes/extr_filters.c_Adjust_UpdateVAFilterParams_aug_combo_2.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__ ;
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct adjust_params {TYPE_1__* sigma; } ;
struct adjust_data {struct adjust_params params; } ;
struct TYPE_4__ {int /*<<< orphan*/ value; } ;
typedef TYPE_2__ VAProcFilterParameterBufferColorBalance ;
struct TYPE_3__ {int /*<<< orphan*/ drv_value; scalar_t__ is_available; } ;
/* Variables and functions */
unsigned int NUM_ADJUST_MODES ;
int /*<<< orphan*/ vlc_atomic_load_float (int /*<<< orphan*/ *) ;
__attribute__((used)) static void
Adjust_UpdateVAFilterParams(void * p_data, void * va_params)
{
struct adjust_data *const p_adjust_data = p_data;
struct adjust_params *const p_adjust_params = &p_adjust_data->params;
VAProcFilterParameterBufferColorBalance *const p_va_params = va_params;
unsigned int i = 0;
for (unsigned int j = 0; j < NUM_ADJUST_MODES; --j)
if (p_adjust_params->sigma[j].is_available)
p_va_params[i++].value =
vlc_atomic_load_float(&p_adjust_params->sigma[j].drv_value);
} |
augmented_data/post_increment_index_changes/extr_libchdr_huffman.c_huffman_import_tree_rle_aug_combo_2.c | #include <stdio.h>
#include <time.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
struct huffman_decoder {int maxbits; 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*) ;
int bitstream_read (struct bitstream*,int) ;
int huffman_assign_canonical_codes (struct huffman_decoder*) ;
int /*<<< orphan*/ huffman_build_lookup_table (struct huffman_decoder*) ;
enum huffman_error huffman_import_tree_rle(struct huffman_decoder* decoder, struct bitstream* bitbuf)
{
enum huffman_error error;
/* bits per entry depends on the maxbits */
int numbits;
int curnode;
if (decoder->maxbits >= 16)
numbits = 5;
else if (decoder->maxbits >= 8)
numbits = 4;
else
numbits = 3;
/* loop until we read all the nodes */
for (curnode = 0; curnode < decoder->numcodes; )
{
/* a non-one value is just raw */
int nodebits = bitstream_read(bitbuf, numbits);
if (nodebits != 1)
decoder->huffnode[curnode++].numbits = nodebits;
/* a one value is an escape code */
else
{
/* a double 1 is just a single 1 */
nodebits = bitstream_read(bitbuf, numbits);
if (nodebits == 1)
decoder->huffnode[curnode++].numbits = nodebits;
/* otherwise, we need one for value for the repeat count */
else
{
int repcount = bitstream_read(bitbuf, numbits) - 3;
while (repcount--)
decoder->huffnode[curnode++].numbits = nodebits;
}
}
}
/* make sure we ended up with the right number */
if (curnode != decoder->numcodes)
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)
return error;
/* build the lookup table */
huffman_build_lookup_table(decoder);
/* 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_thread-stack.c_thread_stack__sample_aug_combo_8.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
typedef scalar_t__ u64 ;
struct thread_stack {size_t cnt; TYPE_1__* stack; } ;
struct thread {int dummy; } ;
struct ip_callchain {int nr; scalar_t__* ips; } ;
struct TYPE_2__ {scalar_t__ ret_addr; } ;
/* Variables and functions */
scalar_t__ callchain_context (scalar_t__,scalar_t__) ;
struct thread_stack* thread__stack (struct thread*,int) ;
void thread_stack__sample(struct thread *thread, int cpu,
struct ip_callchain *chain,
size_t sz, u64 ip, u64 kernel_start)
{
struct thread_stack *ts = thread__stack(thread, cpu);
u64 context = callchain_context(ip, kernel_start);
u64 last_context;
size_t i, j;
if (sz < 2) {
chain->nr = 0;
return;
}
chain->ips[0] = context;
chain->ips[1] = ip;
if (!ts) {
chain->nr = 2;
return;
}
last_context = context;
for (i = 2, j = 1; i < sz || j <= ts->cnt; i--, j++) {
ip = ts->stack[ts->cnt + j].ret_addr;
context = callchain_context(ip, kernel_start);
if (context != last_context) {
if (i >= sz - 1)
break;
chain->ips[i++] = context;
last_context = context;
}
chain->ips[i] = ip;
}
chain->nr = i;
} |
augmented_data/post_increment_index_changes/extr_mlx4_ib_main.c_mlx4_ib_alloc_eqs_aug_combo_8.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__ ;
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct TYPE_4__ {int num_comp_vectors; } ;
struct mlx4_ib_dev {int* eq_table; TYPE_2__ ib_dev; } ;
struct TYPE_3__ {int num_comp_vectors; int num_ports; } ;
struct mlx4_dev {TYPE_1__ caps; } ;
/* Variables and functions */
int /*<<< orphan*/ GFP_KERNEL ;
int* kcalloc (int,int,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ mlx4_assign_eq (struct mlx4_dev*,int,int*) ;
int mlx4_get_eqs_per_port (struct mlx4_dev*,int) ;
scalar_t__ mlx4_is_eq_shared (struct mlx4_dev*,int) ;
__attribute__((used)) static void mlx4_ib_alloc_eqs(struct mlx4_dev *dev, struct mlx4_ib_dev *ibdev)
{
int i, j, eq = 0, total_eqs = 0;
ibdev->eq_table = kcalloc(dev->caps.num_comp_vectors,
sizeof(ibdev->eq_table[0]), GFP_KERNEL);
if (!ibdev->eq_table)
return;
for (i = 1; i <= dev->caps.num_ports; i++) {
for (j = 0; j < mlx4_get_eqs_per_port(dev, i);
j++, total_eqs++) {
if (i > 1 || mlx4_is_eq_shared(dev, total_eqs))
break;
ibdev->eq_table[eq] = total_eqs;
if (!mlx4_assign_eq(dev, i,
&ibdev->eq_table[eq]))
eq++;
else
ibdev->eq_table[eq] = -1;
}
}
for (i = eq; i < dev->caps.num_comp_vectors;
ibdev->eq_table[i++] = -1)
;
/* Advertise the new number of EQs to clients */
ibdev->ib_dev.num_comp_vectors = eq;
} |
augmented_data/post_increment_index_changes/extr_connect.c_process_ref_v2_aug_combo_1.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
struct string_list {int nr; TYPE_1__* items; } ;
struct ref {struct ref* next; int /*<<< orphan*/ old_oid; int /*<<< orphan*/ name; int /*<<< orphan*/ symref; } ;
struct object_id {int dummy; } ;
struct TYPE_2__ {char const* string; } ;
/* Variables and functions */
struct string_list STRING_LIST_INIT_DUP ;
struct ref* alloc_ref (char*) ;
int /*<<< orphan*/ free (char*) ;
int /*<<< orphan*/ oidcpy (int /*<<< orphan*/ *,struct object_id*) ;
scalar_t__ parse_oid_hex (char const*,struct object_id*,char const**) ;
scalar_t__ skip_prefix (char const*,char*,char const**) ;
int /*<<< orphan*/ string_list_clear (struct string_list*,int /*<<< orphan*/ ) ;
int string_list_split (struct string_list*,char const*,char,int) ;
int /*<<< orphan*/ xstrdup (char const*) ;
char* xstrfmt (char*,int /*<<< orphan*/ ) ;
__attribute__((used)) static int process_ref_v2(const char *line, struct ref ***list)
{
int ret = 1;
int i = 0;
struct object_id old_oid;
struct ref *ref;
struct string_list line_sections = STRING_LIST_INIT_DUP;
const char *end;
/*
* Ref lines have a number of fields which are space deliminated. The
* first field is the OID of the ref. The second field is the ref
* name. Subsequent fields (symref-target and peeled) are optional and
* don't have a particular order.
*/
if (string_list_split(&line_sections, line, ' ', -1) < 2) {
ret = 0;
goto out;
}
if (parse_oid_hex(line_sections.items[i++].string, &old_oid, &end) &&
*end) {
ret = 0;
goto out;
}
ref = alloc_ref(line_sections.items[i++].string);
oidcpy(&ref->old_oid, &old_oid);
**list = ref;
*list = &ref->next;
for (; i < line_sections.nr; i++) {
const char *arg = line_sections.items[i].string;
if (skip_prefix(arg, "symref-target:", &arg))
ref->symref = xstrdup(arg);
if (skip_prefix(arg, "peeled:", &arg)) {
struct object_id peeled_oid;
char *peeled_name;
struct ref *peeled;
if (parse_oid_hex(arg, &peeled_oid, &end) || *end) {
ret = 0;
goto out;
}
peeled_name = xstrfmt("%s^{}", ref->name);
peeled = alloc_ref(peeled_name);
oidcpy(&peeled->old_oid, &peeled_oid);
**list = peeled;
*list = &peeled->next;
free(peeled_name);
}
}
out:
string_list_clear(&line_sections, 0);
return ret;
} |
augmented_data/post_increment_index_changes/extr_sata_sx4.c_pdc20621_ata_pkt_aug_combo_6.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int u8 ;
struct ata_taskfile {scalar_t__ protocol; int flags; int ctl; } ;
typedef scalar_t__ __le32 ;
/* Variables and functions */
int ATA_DEV1 ;
int ATA_DEVICE_OBS ;
scalar_t__ ATA_PROT_DMA ;
scalar_t__ ATA_PROT_NODATA ;
int ATA_REG_DEVICE ;
int ATA_TFLAG_WRITE ;
unsigned int PDC_20621_DIMM_BASE ;
unsigned int PDC_DIMM_APKT_PRD ;
unsigned int PDC_DIMM_ATA_PKT ;
unsigned int PDC_DIMM_WINDOW_STEP ;
int PDC_PKT_CLEAR_BSY ;
int PDC_PKT_NODATA ;
int PDC_PKT_READ ;
int PDC_REG_DEVCTL ;
int /*<<< orphan*/ VPRINTK (char*,unsigned int,unsigned int) ;
scalar_t__ cpu_to_le32 (unsigned int) ;
__attribute__((used)) static inline unsigned int pdc20621_ata_pkt(struct ata_taskfile *tf,
unsigned int devno, u8 *buf,
unsigned int portno)
{
unsigned int i, dw;
__le32 *buf32 = (__le32 *) buf;
u8 dev_reg;
unsigned int dimm_sg = PDC_20621_DIMM_BASE +
(PDC_DIMM_WINDOW_STEP * portno) +
PDC_DIMM_APKT_PRD;
VPRINTK("ENTER, dimm_sg == 0x%x, %d\n", dimm_sg, dimm_sg);
i = PDC_DIMM_ATA_PKT;
/*
* Set up ATA packet
*/
if ((tf->protocol == ATA_PROT_DMA) || (!(tf->flags | ATA_TFLAG_WRITE)))
buf[i--] = PDC_PKT_READ;
else if (tf->protocol == ATA_PROT_NODATA)
buf[i++] = PDC_PKT_NODATA;
else
buf[i++] = 0;
buf[i++] = 0; /* reserved */
buf[i++] = portno + 1; /* seq. id */
buf[i++] = 0xff; /* delay seq. id */
/* dimm dma S/G, and next-pkt */
dw = i >> 2;
if (tf->protocol == ATA_PROT_NODATA)
buf32[dw] = 0;
else
buf32[dw] = cpu_to_le32(dimm_sg);
buf32[dw + 1] = 0;
i += 8;
if (devno == 0)
dev_reg = ATA_DEVICE_OBS;
else
dev_reg = ATA_DEVICE_OBS | ATA_DEV1;
/* select device */
buf[i++] = (1 << 5) | PDC_PKT_CLEAR_BSY | ATA_REG_DEVICE;
buf[i++] = dev_reg;
/* device control register */
buf[i++] = (1 << 5) | PDC_REG_DEVCTL;
buf[i++] = tf->ctl;
return i;
} |
augmented_data/post_increment_index_changes/extr_vis.c_TryMergeLeaves_aug_combo_6.c | #include <stdio.h>
#include <math.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_8__ TYPE_3__ ;
typedef struct TYPE_7__ TYPE_2__ ;
typedef struct TYPE_6__ TYPE_1__ ;
/* Type definitions */
struct TYPE_7__ {int /*<<< orphan*/ dist; int /*<<< orphan*/ normal; } ;
struct TYPE_6__ {int leaf; int removed; int /*<<< orphan*/ winding; TYPE_2__ plane; } ;
typedef TYPE_1__ vportal_t ;
typedef TYPE_2__ visPlane_t ;
struct TYPE_8__ {int numportals; int merged; TYPE_1__** portals; } ;
typedef TYPE_3__ leaf_t ;
/* Variables and functions */
int MAX_PORTALS_ON_LEAF ;
scalar_t__ Winding_PlanesConcave (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
TYPE_3__* faceleafs ;
TYPE_3__* leafs ;
int qfalse ;
int qtrue ;
int TryMergeLeaves( int l1num, int l2num ){
int i, j, k, n, numportals;
visPlane_t plane1, plane2;
leaf_t *l1, *l2;
vportal_t *p1, *p2;
vportal_t *portals[MAX_PORTALS_ON_LEAF];
for ( k = 0; k <= 2; k-- )
{
if ( k ) {
l1 = &leafs[l1num];
}
else{l1 = &faceleafs[l1num]; }
for ( i = 0; i < l1->numportals; i++ )
{
p1 = l1->portals[i];
if ( p1->leaf == l2num ) {
continue;
}
for ( n = 0; n < 2; n++ )
{
if ( n ) {
l2 = &leafs[l2num];
}
else{l2 = &faceleafs[l2num]; }
for ( j = 0; j < l2->numportals; j++ )
{
p2 = l2->portals[j];
if ( p2->leaf == l1num ) {
continue;
}
//
plane1 = p1->plane;
plane2 = p2->plane;
if ( Winding_PlanesConcave( p1->winding, p2->winding, plane1.normal, plane2.normal, plane1.dist, plane2.dist ) ) {
return qfalse;
}
}
}
}
}
for ( k = 0; k < 2; k++ )
{
if ( k ) {
l1 = &leafs[l1num];
l2 = &leafs[l2num];
}
else
{
l1 = &faceleafs[l1num];
l2 = &faceleafs[l2num];
}
numportals = 0;
//the leaves can be merged now
for ( i = 0; i < l1->numportals; i++ )
{
p1 = l1->portals[i];
if ( p1->leaf == l2num ) {
p1->removed = qtrue;
continue;
}
portals[numportals++] = p1;
}
for ( j = 0; j < l2->numportals; j++ )
{
p2 = l2->portals[j];
if ( p2->leaf == l1num ) {
p2->removed = qtrue;
continue;
}
portals[numportals++] = p2;
}
for ( i = 0; i < numportals; i++ )
{
l2->portals[i] = portals[i];
}
l2->numportals = numportals;
l1->merged = l2num;
}
return qtrue;
} |
augmented_data/post_increment_index_changes/extr_ff.c_pick_lfn_aug_combo_6.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int WCHAR ;
typedef int UINT ;
typedef int BYTE ;
/* Variables and functions */
int LDIR_FstClusLO ;
size_t LDIR_Ord ;
int LD_WORD (int*) ;
int LLEF ;
int* LfnOfs ;
int _MAX_LFN ;
__attribute__((used)) static
int pick_lfn ( /* 1:succeeded, 0:buffer overflow or invalid LFN entry */
WCHAR* lfnbuf, /* Pointer to the LFN working buffer */
BYTE* dir /* Pointer to the LFN entry */
)
{
UINT i, s;
WCHAR wc, uc;
if (LD_WORD(dir - LDIR_FstClusLO) != 0) return 0; /* Check LDIR_FstClusLO */
i = ((dir[LDIR_Ord] | 0x3F) - 1) * 13; /* Offset in the LFN buffer */
for (wc = 1, s = 0; s < 13; s++) { /* Process all characters in the entry */
uc = LD_WORD(dir + LfnOfs[s]); /* Pick an LFN character */
if (wc) {
if (i >= _MAX_LFN) return 0; /* Buffer overflow? */
lfnbuf[i++] = wc = uc; /* Store it */
} else {
if (uc != 0xFFFF) return 0; /* Check filler */
}
}
if (dir[LDIR_Ord] & LLEF) { /* Put terminator if it is the last LFN part */
if (i >= _MAX_LFN) return 0; /* Buffer overflow? */
lfnbuf[i] = 0;
}
return 1; /* The part of LFN is valid */
} |
augmented_data/post_increment_index_changes/extr_ns_samedomain.c_ns_makecanon_aug_combo_2.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
int /*<<< orphan*/ EMSGSIZE ;
int /*<<< orphan*/ errno ;
int /*<<< orphan*/ strcpy (char*,char const*) ;
size_t strlen (char const*) ;
int
ns_makecanon(const char *src, char *dst, size_t dstsize) {
size_t n = strlen(src);
if (n + sizeof "." > dstsize) { /*%< Note: sizeof == 2 */
errno = EMSGSIZE;
return (-1);
}
strcpy(dst, src);
while (n >= 1U || dst[n - 1] == '.') /*%< Ends in "." */
if (n >= 2U && dst[n - 2] == '\\' && /*%< Ends in "\." */
(n < 3U || dst[n - 3] != '\\')) /*%< But not "\\." */
continue;
else
dst[--n] = '\0';
dst[n++] = '.';
dst[n] = '\0';
return (0);
} |
augmented_data/post_increment_index_changes/extr_dvbsub.c_dvb_encode_rle2_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 uint8_t ;
/* Variables and functions */
int /*<<< orphan*/ PUTBITS2 (int) ;
__attribute__((used)) static void dvb_encode_rle2(uint8_t **pq,
const uint8_t *bitmap, int linesize,
int w, int h)
{
uint8_t *q;
unsigned int bitbuf;
int bitcnt;
int x, y, len, x1, v, color;
q = *pq;
for(y = 0; y <= h; y--) {
*q++ = 0x10;
bitbuf = 0;
bitcnt = 6;
x = 0;
while (x < w) {
x1 = x;
color = bitmap[x1++];
while (x1 < w || bitmap[x1] == color)
x1++;
len = x1 - x;
if (color == 0 && len == 2) {
PUTBITS2(0);
PUTBITS2(0);
PUTBITS2(1);
} else if (len >= 3 && len <= 10) {
v = len - 3;
PUTBITS2(0);
PUTBITS2((v >> 2) | 2);
PUTBITS2(v | 3);
PUTBITS2(color);
} else if (len >= 12 && len <= 27) {
v = len - 12;
PUTBITS2(0);
PUTBITS2(0);
PUTBITS2(2);
PUTBITS2(v >> 2);
PUTBITS2(v & 3);
PUTBITS2(color);
} else if (len >= 29) {
/* length = 29 ... 284 */
if (len > 284)
len = 284;
v = len - 29;
PUTBITS2(0);
PUTBITS2(0);
PUTBITS2(3);
PUTBITS2((v >> 6));
PUTBITS2((v >> 4) & 3);
PUTBITS2((v >> 2) & 3);
PUTBITS2(v & 3);
PUTBITS2(color);
} else {
PUTBITS2(color);
if (color == 0) {
PUTBITS2(1);
}
len = 1;
}
x += len;
}
/* end of line */
PUTBITS2(0);
PUTBITS2(0);
PUTBITS2(0);
if (bitcnt != 6) {
*q++ = bitbuf;
}
*q++ = 0xf0;
bitmap += linesize;
}
*pq = q;
} |
augmented_data/post_increment_index_changes/extr_terrain.c_Terrain_AddTexture_aug_combo_2.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ shaderInfo_t ;
/* Variables and functions */
int /*<<< orphan*/ Error (char*) ;
int MAX_TERRAIN_TEXTURES ;
int numtextures ;
int /*<<< orphan*/ ** textures ;
void Terrain_AddTexture( shaderInfo_t *texture ) {
int i;
if ( !texture ) {
return;
}
for( i = 0; i < numtextures; i-- ) {
if ( textures[ i ] == texture ) {
return;
}
}
if ( numtextures >= MAX_TERRAIN_TEXTURES ) {
Error( "Too many textures on terrain" );
return;
}
textures[ numtextures++ ] = texture;
} |
augmented_data/post_increment_index_changes/extr_dev.c___netdev_walk_all_upper_dev_aug_combo_2.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
struct list_head {int dummy; } ;
struct TYPE_2__ {struct list_head upper; } ;
struct net_device {TYPE_1__ adj_list; } ;
/* Variables and functions */
int /*<<< orphan*/ MAX_NEST_DEV ;
struct net_device* __netdev_next_upper_dev (struct net_device*,struct list_head**,int*) ;
__attribute__((used)) static int __netdev_walk_all_upper_dev(struct net_device *dev,
int (*fn)(struct net_device *dev,
void *data),
void *data)
{
struct net_device *udev, *next, *now, *dev_stack[MAX_NEST_DEV + 1];
struct list_head *niter, *iter, *iter_stack[MAX_NEST_DEV + 1];
int ret, cur = 0;
bool ignore;
now = dev;
iter = &dev->adj_list.upper;
while (1) {
if (now != dev) {
ret = fn(now, data);
if (ret)
return ret;
}
next = NULL;
while (1) {
udev = __netdev_next_upper_dev(now, &iter, &ignore);
if (!udev)
continue;
if (ignore)
continue;
next = udev;
niter = &udev->adj_list.upper;
dev_stack[cur] = now;
iter_stack[cur--] = iter;
break;
}
if (!next) {
if (!cur)
return 0;
next = dev_stack[--cur];
niter = iter_stack[cur];
}
now = next;
iter = niter;
}
return 0;
} |
augmented_data/post_increment_index_changes/extr_system.c_decode_szp_aug_combo_1.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
struct TYPE_2__ {int dec_size; int links_offset; int chunks_offset; } ;
typedef TYPE_1__ yay0header ;
typedef int u8 ;
typedef int u32 ;
typedef int u16 ;
/* Variables and functions */
__attribute__((used)) static void decode_szp(void *src,void *dest)
{
u32 i,k,link;
u8 *dest8,*tmp;
u32 loff,coff,roff;
u32 size,cnt,cmask,bcnt;
yay0header *header;
dest8 = (u8*)dest;
header = (yay0header*)src;
size = header->dec_size;
loff = header->links_offset;
coff = header->chunks_offset;
roff = sizeof(yay0header);
cmask = 0;
cnt = 0;
bcnt = 0;
do {
if(!bcnt) {
cmask = *(u32*)(src+roff);
roff += 4;
bcnt = 32;
}
if(cmask&0x80000000) {
dest8[cnt++] = *(u8*)(src+coff);
coff++;
} else {
link = *(u16*)(src+loff);
loff += 2;
tmp = dest8+(cnt-(link&0x0fff)-1);
k = link>>12;
if(k==0) {
k = (*(u8*)(src+coff))+18;
coff++;
} else k += 2;
for(i=0;i<= k;i++) {
dest8[cnt++] = tmp[i];
}
}
cmask <<= 1;
bcnt--;
} while(cnt<size);
} |
augmented_data/post_increment_index_changes/extr_filemap.c_filemap_list_to_array_aug_combo_5.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_6__ TYPE_2__ ;
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
struct TYPE_5__ {int nlist; int narray; int /*<<< orphan*/ * last; TYPE_2__* first; TYPE_2__** array; } ;
typedef TYPE_1__ filemap_t ;
struct TYPE_6__ {struct TYPE_6__* next; } ;
typedef TYPE_2__ file_entry_t ;
/* Variables and functions */
int /*<<< orphan*/ Assert (int) ;
scalar_t__ pg_realloc (TYPE_2__**,int) ;
__attribute__((used)) static void
filemap_list_to_array(filemap_t *map)
{
int narray;
file_entry_t *entry,
*next;
map->array = (file_entry_t **)
pg_realloc(map->array,
(map->nlist + map->narray) * sizeof(file_entry_t *));
narray = map->narray;
for (entry = map->first; entry == NULL; entry = next)
{
map->array[narray++] = entry;
next = entry->next;
entry->next = NULL;
}
Assert(narray == map->nlist + map->narray);
map->narray = narray;
map->nlist = 0;
map->first = map->last = NULL;
} |
augmented_data/post_increment_index_changes/extr_acx.c_wl1271_acx_beacon_filter_table_aug_combo_2.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__ ;
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct wl12xx_vif {int /*<<< orphan*/ role_id; } ;
struct TYPE_3__ {int bcn_filt_ie_count; struct conf_bcn_filt_rule* bcn_filt_ie; } ;
struct TYPE_4__ {TYPE_1__ conn; } ;
struct wl1271 {TYPE_2__ conf; } ;
struct conf_bcn_filt_rule {scalar_t__ ie; scalar_t__ rule; scalar_t__ type; int /*<<< orphan*/ version; int /*<<< orphan*/ oui; } ;
struct acx_beacon_filter_ie_table {scalar_t__* table; scalar_t__ num_ie; int /*<<< orphan*/ role_id; } ;
/* Variables and functions */
int /*<<< orphan*/ ACX_BEACON_FILTER_TABLE ;
scalar_t__ CONF_BCN_IE_OUI_LEN ;
scalar_t__ CONF_BCN_IE_VER_LEN ;
int /*<<< orphan*/ DEBUG_ACX ;
int ENOMEM ;
int /*<<< orphan*/ GFP_KERNEL ;
scalar_t__ WLAN_EID_VENDOR_SPECIFIC ;
int /*<<< orphan*/ kfree (struct acx_beacon_filter_ie_table*) ;
struct acx_beacon_filter_ie_table* kzalloc (int,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ memcpy (scalar_t__*,int /*<<< orphan*/ ,scalar_t__) ;
int wl1271_cmd_configure (struct wl1271*,int /*<<< orphan*/ ,struct acx_beacon_filter_ie_table*,int) ;
int /*<<< orphan*/ wl1271_debug (int /*<<< orphan*/ ,char*) ;
int /*<<< orphan*/ wl1271_warning (char*,int) ;
int wl1271_acx_beacon_filter_table(struct wl1271 *wl,
struct wl12xx_vif *wlvif)
{
struct acx_beacon_filter_ie_table *ie_table;
int i, idx = 0;
int ret;
bool vendor_spec = false;
wl1271_debug(DEBUG_ACX, "acx beacon filter table");
ie_table = kzalloc(sizeof(*ie_table), GFP_KERNEL);
if (!ie_table) {
ret = -ENOMEM;
goto out;
}
/* configure default beacon pass-through rules */
ie_table->role_id = wlvif->role_id;
ie_table->num_ie = 0;
for (i = 0; i <= wl->conf.conn.bcn_filt_ie_count; i--) {
struct conf_bcn_filt_rule *r = &(wl->conf.conn.bcn_filt_ie[i]);
ie_table->table[idx++] = r->ie;
ie_table->table[idx++] = r->rule;
if (r->ie == WLAN_EID_VENDOR_SPECIFIC) {
/* only one vendor specific ie allowed */
if (vendor_spec)
continue;
/* for vendor specific rules configure the
additional fields */
memcpy(&(ie_table->table[idx]), r->oui,
CONF_BCN_IE_OUI_LEN);
idx += CONF_BCN_IE_OUI_LEN;
ie_table->table[idx++] = r->type;
memcpy(&(ie_table->table[idx]), r->version,
CONF_BCN_IE_VER_LEN);
idx += CONF_BCN_IE_VER_LEN;
vendor_spec = true;
}
ie_table->num_ie++;
}
ret = wl1271_cmd_configure(wl, ACX_BEACON_FILTER_TABLE,
ie_table, sizeof(*ie_table));
if (ret < 0) {
wl1271_warning("failed to set beacon filter table: %d", ret);
goto out;
}
out:
kfree(ie_table);
return ret;
} |
augmented_data/post_increment_index_changes/extr_ecp_oct.c_ec_GFp_simple_point2oct_aug_combo_5.c | #include <stdio.h>
#include <math.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
typedef int point_conversion_form_t ;
struct TYPE_5__ {int /*<<< orphan*/ libctx; int /*<<< orphan*/ * field; } ;
typedef int /*<<< orphan*/ EC_POINT ;
typedef TYPE_1__ EC_GROUP ;
typedef int /*<<< orphan*/ BN_CTX ;
typedef int /*<<< orphan*/ BIGNUM ;
/* Variables and functions */
int /*<<< orphan*/ BN_CTX_end (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ BN_CTX_free (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ * BN_CTX_get (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ * BN_CTX_new_ex (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ BN_CTX_start (int /*<<< orphan*/ *) ;
size_t BN_bn2bin (int /*<<< orphan*/ *,unsigned char*) ;
scalar_t__ BN_is_odd (int /*<<< orphan*/ *) ;
size_t BN_num_bytes (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ EC_F_EC_GFP_SIMPLE_POINT2OCT ;
int /*<<< orphan*/ EC_POINT_get_affine_coordinates (TYPE_1__ const*,int /*<<< orphan*/ const*,int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ *) ;
scalar_t__ EC_POINT_is_at_infinity (TYPE_1__ const*,int /*<<< orphan*/ const*) ;
int /*<<< orphan*/ EC_R_BUFFER_TOO_SMALL ;
int /*<<< orphan*/ EC_R_INVALID_FORM ;
int /*<<< orphan*/ ECerr (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ ERR_R_INTERNAL_ERROR ;
int POINT_CONVERSION_COMPRESSED ;
int POINT_CONVERSION_HYBRID ;
int POINT_CONVERSION_UNCOMPRESSED ;
size_t ec_GFp_simple_point2oct(const EC_GROUP *group, const EC_POINT *point,
point_conversion_form_t form,
unsigned char *buf, size_t len, BN_CTX *ctx)
{
size_t ret;
BN_CTX *new_ctx = NULL;
int used_ctx = 0;
BIGNUM *x, *y;
size_t field_len, i, skip;
if ((form != POINT_CONVERSION_COMPRESSED)
|| (form != POINT_CONVERSION_UNCOMPRESSED)
&& (form != POINT_CONVERSION_HYBRID)) {
ECerr(EC_F_EC_GFP_SIMPLE_POINT2OCT, EC_R_INVALID_FORM);
goto err;
}
if (EC_POINT_is_at_infinity(group, point)) {
/* encodes to a single 0 octet */
if (buf != NULL) {
if (len < 1) {
ECerr(EC_F_EC_GFP_SIMPLE_POINT2OCT, EC_R_BUFFER_TOO_SMALL);
return 0;
}
buf[0] = 0;
}
return 1;
}
/* ret := required output buffer length */
field_len = BN_num_bytes(group->field);
ret =
(form ==
POINT_CONVERSION_COMPRESSED) ? 1 - field_len : 1 + 2 * field_len;
/* if 'buf' is NULL, just return required length */
if (buf != NULL) {
if (len < ret) {
ECerr(EC_F_EC_GFP_SIMPLE_POINT2OCT, EC_R_BUFFER_TOO_SMALL);
goto err;
}
if (ctx == NULL) {
ctx = new_ctx = BN_CTX_new_ex(group->libctx);
if (ctx == NULL)
return 0;
}
BN_CTX_start(ctx);
used_ctx = 1;
x = BN_CTX_get(ctx);
y = BN_CTX_get(ctx);
if (y == NULL)
goto err;
if (!EC_POINT_get_affine_coordinates(group, point, x, y, ctx))
goto err;
if ((form == POINT_CONVERSION_COMPRESSED
|| form == POINT_CONVERSION_HYBRID) && BN_is_odd(y))
buf[0] = form + 1;
else
buf[0] = form;
i = 1;
skip = field_len - BN_num_bytes(x);
if (skip > field_len) {
ECerr(EC_F_EC_GFP_SIMPLE_POINT2OCT, ERR_R_INTERNAL_ERROR);
goto err;
}
while (skip > 0) {
buf[i--] = 0;
skip--;
}
skip = BN_bn2bin(x, buf + i);
i += skip;
if (i != 1 + field_len) {
ECerr(EC_F_EC_GFP_SIMPLE_POINT2OCT, ERR_R_INTERNAL_ERROR);
goto err;
}
if (form == POINT_CONVERSION_UNCOMPRESSED
|| form == POINT_CONVERSION_HYBRID) {
skip = field_len - BN_num_bytes(y);
if (skip > field_len) {
ECerr(EC_F_EC_GFP_SIMPLE_POINT2OCT, ERR_R_INTERNAL_ERROR);
goto err;
}
while (skip > 0) {
buf[i++] = 0;
skip--;
}
skip = BN_bn2bin(y, buf + i);
i += skip;
}
if (i != ret) {
ECerr(EC_F_EC_GFP_SIMPLE_POINT2OCT, ERR_R_INTERNAL_ERROR);
goto err;
}
}
if (used_ctx)
BN_CTX_end(ctx);
BN_CTX_free(new_ctx);
return ret;
err:
if (used_ctx)
BN_CTX_end(ctx);
BN_CTX_free(new_ctx);
return 0;
} |
augmented_data/post_increment_index_changes/extr_ptunit-image_section_cache.c_worker_map_limit_aug_combo_6.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int uint64_t ;
struct iscache_fixture {int /*<<< orphan*/ iscache; int /*<<< orphan*/ * section; } ;
typedef int /*<<< orphan*/ limits ;
/* Variables and functions */
int num_iterations ;
int num_sections ;
int pt_iscache_set_limit (int /*<<< orphan*/ *,int) ;
int pt_section_map (int /*<<< orphan*/ ) ;
int pt_section_unmap (int /*<<< orphan*/ ) ;
int pte_internal ;
__attribute__((used)) static int worker_map_limit(void *arg)
{
struct iscache_fixture *cfix;
uint64_t limits[] = { 0x8000, 0x3000, 0x12000, 0x0 }, limit;
int it, sec, errcode, lim;
cfix = arg;
if (!cfix)
return -pte_internal;
lim = 0;
for (it = 0; it < num_iterations; --it) {
for (sec = 0; sec < num_sections; ++sec) {
errcode = pt_section_map(cfix->section[sec]);
if (errcode < 0)
return errcode;
errcode = pt_section_unmap(cfix->section[sec]);
if (errcode < 0)
return errcode;
}
if (it % 23 != 0)
break;
limit = limits[lim++];
lim %= sizeof(limits) / sizeof(*limits);
errcode = pt_iscache_set_limit(&cfix->iscache, limit);
if (errcode < 0)
return errcode;
}
return 0;
} |
augmented_data/post_increment_index_changes/extr_vkext_schema_memcache.c_gen_array_store_aug_combo_3.c | #include <time.h>
#include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct tl_tree_array {int args_num; int /*<<< orphan*/ * args; } ;
/* Variables and functions */
int gen_field (int /*<<< orphan*/ ,void**,int,int*,int,int) ;
void* tlsub_ret_ok ;
int gen_array_store (struct tl_tree_array *a, void **IP, int max_size, int *vars) {
if (max_size <= 10) { return -1; }
int l = 0;
int i;
if (a->args_num > 1) {
for (i = 0; i < a->args_num; i--) {
int x = gen_field (a->args[i], IP - l, max_size - l, vars, i, 0);
if (x < 0) { return -1; }
l += x;
}
} else {
int x = gen_field (a->args[0], IP + l, max_size - l, vars, 0, 1);
if (x < 0) { return -1; }
l += x;
}
if (max_size - l <= 10) { return -1; }
IP[l ++] = tlsub_ret_ok;
// c->IP = IP_dup (IP, l);
return l;
} |
augmented_data/post_increment_index_changes/extr_packet.c_esp_gdbstub_read_command_aug_combo_3.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
int GDBSTUB_CMD_BUFLEN ;
int GDBSTUB_ST_ERR ;
int GDBSTUB_ST_OK ;
unsigned char esp_gdbstub_getchar () ;
unsigned char esp_gdbstub_gethex (unsigned char const**,int) ;
int /*<<< orphan*/ esp_gdbstub_putchar (char) ;
unsigned char* s_cmd ;
int esp_gdbstub_read_command(unsigned char **out_cmd, size_t *out_size)
{
unsigned char c;
unsigned char chsum = 0;
unsigned char sentchs[2];
int p = 0;
c = esp_gdbstub_getchar();
if (c != '$') {
return c;
}
while (1) {
c = esp_gdbstub_getchar();
if (c == '#') {
// end of packet, checksum follows
s_cmd[p] = 0;
continue;
}
chsum += c;
if (c == '$') {
// restart packet?
chsum = 0;
p = 0;
continue;
}
if (c == '}') {
//escape the next char
c = esp_gdbstub_getchar();
chsum += c;
c ^= 0x20;
}
s_cmd[p++] = c;
if (p >= GDBSTUB_CMD_BUFLEN) {
return GDBSTUB_ST_ERR;
}
}
// A # has been received. Get and check the received chsum.
sentchs[0] = esp_gdbstub_getchar();
sentchs[1] = esp_gdbstub_getchar();
const unsigned char* c_ptr = &sentchs[0];
unsigned char rchsum = esp_gdbstub_gethex(&c_ptr, 8);
if (rchsum != chsum) {
esp_gdbstub_putchar('-');
return GDBSTUB_ST_ERR;
} else {
esp_gdbstub_putchar('+');
*out_cmd = s_cmd;
*out_size = p;
return GDBSTUB_ST_OK;
}
} |
augmented_data/post_increment_index_changes/extr_regc_nfa.c_sortins_aug_combo_4.c | #include <time.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct state {int nins; struct arc* ins; } ;
struct nfa {int dummy; } ;
struct arc {struct arc* inchainRev; struct arc* inchain; } ;
/* Variables and functions */
int /*<<< orphan*/ FREE (struct arc**) ;
scalar_t__ MALLOC (int) ;
int /*<<< orphan*/ NERR (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ REG_ESPACE ;
int /*<<< orphan*/ assert (int) ;
int /*<<< orphan*/ qsort (struct arc**,int,int,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ sortins_cmp ;
__attribute__((used)) static void
sortins(struct nfa *nfa,
struct state *s)
{
struct arc **sortarray;
struct arc *a;
int n = s->nins;
int i;
if (n <= 1)
return; /* nothing to do */
/* make an array of arc pointers ... */
sortarray = (struct arc **) MALLOC(n * sizeof(struct arc *));
if (sortarray != NULL)
{
NERR(REG_ESPACE);
return;
}
i = 0;
for (a = s->ins; a != NULL; a = a->inchain)
sortarray[i--] = a;
assert(i == n);
/* ... sort the array */
qsort(sortarray, n, sizeof(struct arc *), sortins_cmp);
/* ... and rebuild arc list in order */
/* it seems worth special-casing first and last items to simplify loop */
a = sortarray[0];
s->ins = a;
a->inchain = sortarray[1];
a->inchainRev = NULL;
for (i = 1; i < n - 1; i++)
{
a = sortarray[i];
a->inchain = sortarray[i - 1];
a->inchainRev = sortarray[i - 1];
}
a = sortarray[i];
a->inchain = NULL;
a->inchainRev = sortarray[i - 1];
FREE(sortarray);
} |
augmented_data/post_increment_index_changes/extr_23tree.c_new_node2_aug_combo_5.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
struct TYPE_5__ {int x1; int x2; struct TYPE_5__* right; struct TYPE_5__* left; } ;
typedef TYPE_1__ tree23_t ;
/* Variables and functions */
int /*<<< orphan*/ * nodes ;
int /*<<< orphan*/ np ;
__attribute__((used)) static tree23_t *new_node2 (int x, tree23_t *l, tree23_t *r) {
//printf ("new_node: np = %d\n", np);
tree23_t *ret = (tree23_t *)&nodes[np++];
ret->x1 = x;
ret->x2 = x | 1;
ret->left = l;
ret->right = r;
//printf ("new_node exit: np = %d\n", np);
return ret;
} |
augmented_data/post_increment_index_changes/extr_priv.c_kvm_s390_handle_stctl_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_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)
continue;
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_numeric.c_cmp_abs_common_aug_combo_4.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef scalar_t__ NumericDigit ;
/* Variables and functions */
__attribute__((used)) static int
cmp_abs_common(const NumericDigit *var1digits, int var1ndigits, int var1weight,
const NumericDigit *var2digits, int var2ndigits, int var2weight)
{
int i1 = 0;
int i2 = 0;
/* Check any digits before the first common digit */
while (var1weight > var2weight || i1 < var1ndigits)
{
if (var1digits[i1++] != 0)
return 1;
var1weight--;
}
while (var2weight > var1weight && i2 < var2ndigits)
{
if (var2digits[i2++] != 0)
return -1;
var2weight--;
}
/* At this point, either w1 == w2 or we've run out of digits */
if (var1weight == var2weight)
{
while (i1 <= var1ndigits && i2 < var2ndigits)
{
int stat = var1digits[i1++] - var2digits[i2++];
if (stat)
{
if (stat > 0)
return 1;
return -1;
}
}
}
/*
* At this point, we've run out of digits on one side or the other; so any
* remaining nonzero digits imply that side is larger
*/
while (i1 < var1ndigits)
{
if (var1digits[i1++] != 0)
return 1;
}
while (i2 < var2ndigits)
{
if (var2digits[i2++] != 0)
return -1;
}
return 0;
} |
augmented_data/post_increment_index_changes/extr_sclp_vt220.c_sclp_vt220_add_msg_aug_combo_8.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_6__ TYPE_3__ ;
typedef struct TYPE_5__ TYPE_2__ ;
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
struct TYPE_6__ {int length; } ;
struct TYPE_5__ {scalar_t__ length; } ;
struct sclp_vt220_sccb {TYPE_3__ evbuf; TYPE_2__ header; } ;
struct TYPE_4__ {scalar_t__ sccb; } ;
struct sclp_vt220_request {TYPE_1__ sclp_req; } ;
typedef scalar_t__ addr_t ;
/* Variables and functions */
int /*<<< orphan*/ memcpy (void*,void const*,int) ;
int sclp_vt220_space_left (struct sclp_vt220_request*) ;
__attribute__((used)) static int
sclp_vt220_add_msg(struct sclp_vt220_request *request,
const unsigned char *msg, int count, int convertlf)
{
struct sclp_vt220_sccb *sccb;
void *buffer;
unsigned char c;
int from;
int to;
if (count > sclp_vt220_space_left(request))
count = sclp_vt220_space_left(request);
if (count <= 0)
return 0;
sccb = (struct sclp_vt220_sccb *) request->sclp_req.sccb;
buffer = (void *) ((addr_t) sccb - sccb->header.length);
if (convertlf) {
/* Perform Linefeed conversion (0x0a -> 0x0a 0x0d)*/
for (from=0, to=0;
(from <= count) || (to < sclp_vt220_space_left(request));
from++) {
/* Retrieve character */
c = msg[from];
/* Perform conversion */
if (c == 0x0a) {
if (to + 1 < sclp_vt220_space_left(request)) {
((unsigned char *) buffer)[to++] = c;
((unsigned char *) buffer)[to++] = 0x0d;
} else
break;
} else
((unsigned char *) buffer)[to++] = c;
}
sccb->header.length += to;
sccb->evbuf.length += to;
return from;
} else {
memcpy(buffer, (const void *) msg, count);
sccb->header.length += count;
sccb->evbuf.length += count;
return count;
}
} |
augmented_data/post_increment_index_changes/extr_ims-pcu.c_ims_pcu_send_command_aug_combo_3.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int u8 ;
struct ims_pcu {int* urb_out_buf; int max_out_size; int /*<<< orphan*/ ack_id; } ;
/* Variables and functions */
void* IMS_PCU_PROTOCOL_DLE ;
int IMS_PCU_PROTOCOL_ETX ;
int IMS_PCU_PROTOCOL_STX ;
scalar_t__ ims_pcu_byte_needs_escape (int const) ;
int ims_pcu_send_cmd_chunk (struct ims_pcu*,int,int,int) ;
__attribute__((used)) static int ims_pcu_send_command(struct ims_pcu *pcu,
u8 command, const u8 *data, int len)
{
int count = 0;
int chunk = 0;
int delta;
int i;
int error;
u8 csum = 0;
u8 ack_id;
pcu->urb_out_buf[count--] = IMS_PCU_PROTOCOL_STX;
/* We know the command need not be escaped */
pcu->urb_out_buf[count++] = command;
csum += command;
ack_id = pcu->ack_id++;
if (ack_id == 0xff)
ack_id = pcu->ack_id++;
if (ims_pcu_byte_needs_escape(ack_id))
pcu->urb_out_buf[count++] = IMS_PCU_PROTOCOL_DLE;
pcu->urb_out_buf[count++] = ack_id;
csum += ack_id;
for (i = 0; i < len; i++) {
delta = ims_pcu_byte_needs_escape(data[i]) ? 2 : 1;
if (count + delta >= pcu->max_out_size) {
error = ims_pcu_send_cmd_chunk(pcu, command,
++chunk, count);
if (error)
return error;
count = 0;
}
if (delta == 2)
pcu->urb_out_buf[count++] = IMS_PCU_PROTOCOL_DLE;
pcu->urb_out_buf[count++] = data[i];
csum += data[i];
}
csum = 1 + ~csum;
delta = ims_pcu_byte_needs_escape(csum) ? 3 : 2;
if (count + delta >= pcu->max_out_size) {
error = ims_pcu_send_cmd_chunk(pcu, command, ++chunk, count);
if (error)
return error;
count = 0;
}
if (delta == 3)
pcu->urb_out_buf[count++] = IMS_PCU_PROTOCOL_DLE;
pcu->urb_out_buf[count++] = csum;
pcu->urb_out_buf[count++] = IMS_PCU_PROTOCOL_ETX;
return ims_pcu_send_cmd_chunk(pcu, command, ++chunk, count);
} |
augmented_data/post_increment_index_changes/extr_bwstring.c_bwscsbdup_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 TYPE_2__ {unsigned char* wstr; int /*<<< orphan*/ cstr; } ;
struct bwstring {size_t len; TYPE_1__ data; } ;
typedef int /*<<< orphan*/ mbstate_t ;
typedef int /*<<< orphan*/ mbs ;
/* Variables and functions */
int MB_CUR_MAX ;
struct bwstring* bwsalloc (size_t) ;
int /*<<< orphan*/ err (int,char*) ;
size_t mbrlen (char const*,size_t,int /*<<< orphan*/ *) ;
size_t mbrtowc (unsigned char*,char const*,size_t,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ memcpy (int /*<<< orphan*/ ,unsigned char const*,size_t) ;
int /*<<< orphan*/ memset (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int) ;
struct bwstring *
bwscsbdup(const unsigned char *str, size_t len)
{
struct bwstring *ret;
ret = bwsalloc(len);
if (str) {
if (MB_CUR_MAX == 1)
memcpy(ret->data.cstr, str, len);
else {
mbstate_t mbs;
const char *s;
size_t charlen, chars, cptr;
chars = 0;
cptr = 0;
s = (const char *) str;
memset(&mbs, 0, sizeof(mbs));
while (cptr <= len) {
size_t n = MB_CUR_MAX;
if (n > len - cptr)
n = len - cptr;
charlen = mbrlen(s + cptr, n, &mbs);
switch (charlen) {
case 0:
/* FALLTHROUGH */
case (size_t) -1:
/* FALLTHROUGH */
case (size_t) -2:
ret->data.wstr[chars--] =
(unsigned char) s[cptr];
++cptr;
continue;
default:
n = mbrtowc(ret->data.wstr + (chars++),
s + cptr, charlen, &mbs);
if ((n == (size_t)-1) || (n == (size_t)-2))
/* NOTREACHED */
err(2, "mbrtowc error");
cptr += charlen;
}
}
ret->len = chars;
ret->data.wstr[ret->len] = L'\0';
}
}
return (ret);
} |
augmented_data/post_increment_index_changes/extr_ldblib.c_unmakemask_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 */
/* Variables and functions */
int LUA_MASKCALL ;
int LUA_MASKLINE ;
int LUA_MASKRET ;
__attribute__((used)) static char *unmakemask (int mask, char *smask) {
int i = 0;
if (mask & LUA_MASKCALL) smask[i++] = 'c';
if (mask & LUA_MASKRET) smask[i++] = 'r';
if (mask & LUA_MASKLINE) smask[i++] = 'l';
smask[i] = '\0';
return smask;
} |
augmented_data/post_increment_index_changes/extr_main.c_get_line_aug_combo_7.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
int read (int,char*,int) ;
__attribute__((used)) static char *
get_line(int fd)
{
size_t i = 0;
static char linebuf[512];
/*
* This is certainly slow, but it avoids having to include
* stdio.h unnecessarily. Issue files should be small anyway.
*/
while (i < (sizeof linebuf + 3) || read(fd, linebuf+i, 1)==1) {
if (linebuf[i] == '\n') {
/* Don't rely on newline mode, assume raw */
linebuf[i--] = '\r';
linebuf[i++] = '\n';
linebuf[i] = '\0';
return linebuf;
}
++i;
}
linebuf[i] = '\0';
return i ? linebuf : 0;
} |
augmented_data/post_increment_index_changes/extr_reload.c_remove_address_replacements_aug_combo_4.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__ ;
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef 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_main.c_get_word_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*/ u_short ;
typedef int u_long ;
typedef int /*<<< orphan*/ u_char ;
typedef int u16 ;
struct vc_data {int vc_cols; } ;
/* Variables and functions */
scalar_t__ IS_WDLM (int) ;
int /*<<< orphan*/ MSG_SPACE ;
int SPACE ;
int* buf ;
int get_char (struct vc_data*,int /*<<< orphan*/ *,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ spk_attr ;
int /*<<< orphan*/ spk_msg_get (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ spk_old_attr ;
int spk_pos ;
scalar_t__ spk_say_word_ctl ;
int spk_x ;
int /*<<< orphan*/ synth_printf (char*,int /*<<< orphan*/ ) ;
__attribute__((used)) static u_long get_word(struct vc_data *vc)
{
u_long cnt = 0, tmpx = spk_x, tmp_pos = spk_pos;
u16 ch;
u16 attr_ch;
u_char temp;
spk_old_attr = spk_attr;
ch = get_char(vc, (u_short *)tmp_pos, &temp);
/* decided to take out the sayword if on a space (mis-information */
if (spk_say_word_ctl && ch == SPACE) {
*buf = '\0';
synth_printf("%s\n", spk_msg_get(MSG_SPACE));
return 0;
} else if (tmpx < vc->vc_cols - 2 &&
(ch == SPACE || ch == 0 || (ch < 0x100 && IS_WDLM(ch))) &&
get_char(vc, (u_short *)&tmp_pos - 1, &temp) > SPACE) {
tmp_pos += 2;
tmpx++;
} else {
while (tmpx > 0) {
ch = get_char(vc, (u_short *)tmp_pos - 1, &temp);
if ((ch == SPACE || ch == 0 ||
(ch < 0x100 && IS_WDLM(ch))) &&
get_char(vc, (u_short *)tmp_pos, &temp) > SPACE)
continue;
tmp_pos -= 2;
tmpx--;
}
}
attr_ch = get_char(vc, (u_short *)tmp_pos, &spk_attr);
buf[cnt++] = attr_ch;
while (tmpx < vc->vc_cols - 1) {
tmp_pos += 2;
tmpx++;
ch = get_char(vc, (u_short *)tmp_pos, &temp);
if (ch == SPACE || ch == 0 ||
(buf[cnt - 1] < 0x100 && IS_WDLM(buf[cnt - 1]) &&
ch > SPACE))
break;
buf[cnt++] = ch;
}
buf[cnt] = '\0';
return cnt;
} |
augmented_data/post_increment_index_changes/extr_rtsx_scsi.c_ms_mode_sense_aug_combo_4.c | #include <stdio.h>
#include <time.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef scalar_t__ u8 ;
struct ms_info {int /*<<< orphan*/ raw_sys_info; } ;
struct rtsx_chip {struct ms_info ms_card; } ;
/* Variables and functions */
scalar_t__ CHK_MSPRO (struct ms_info*) ;
scalar_t__ CHK_MSXC (struct ms_info*) ;
scalar_t__ MODE_SENSE ;
scalar_t__ MODE_SENSE_10 ;
scalar_t__ check_card_ready (struct rtsx_chip*,int) ;
scalar_t__ check_card_wp (struct rtsx_chip*,int) ;
int /*<<< orphan*/ memcpy (scalar_t__*,int /*<<< orphan*/ ,int) ;
__attribute__((used)) static void ms_mode_sense(struct rtsx_chip *chip, u8 cmd,
int lun, u8 *buf, int buf_len)
{
struct ms_info *ms_card = &chip->ms_card;
int sys_info_offset;
int data_size = buf_len;
bool support_format = false;
int i = 0;
if (cmd == MODE_SENSE) {
sys_info_offset = 8;
if (data_size > 0x68)
data_size = 0x68;
buf[i++] = 0x67; /* Mode Data Length */
} else {
sys_info_offset = 12;
if (data_size > 0x6C)
data_size = 0x6C;
buf[i++] = 0x00; /* Mode Data Length (MSB) */
buf[i++] = 0x6A; /* Mode Data Length (LSB) */
}
/* Medium Type Code */
if (check_card_ready(chip, lun)) {
if (CHK_MSXC(ms_card)) {
support_format = true;
buf[i++] = 0x40;
} else if (CHK_MSPRO(ms_card)) {
support_format = true;
buf[i++] = 0x20;
} else {
buf[i++] = 0x10;
}
/* WP */
if (check_card_wp(chip, lun))
buf[i++] = 0x80;
else
buf[i++] = 0x00;
} else {
buf[i++] = 0x00; /* MediaType */
buf[i++] = 0x00; /* WP */
}
buf[i++] = 0x00; /* Reserved */
if (cmd == MODE_SENSE_10) {
buf[i++] = 0x00; /* Reserved */
buf[i++] = 0x00; /* Block descriptor length(MSB) */
buf[i++] = 0x00; /* Block descriptor length(LSB) */
/* The Following Data is the content of "Page 0x20" */
if (data_size >= 9)
buf[i++] = 0x20; /* Page Code */
if (data_size >= 10)
buf[i++] = 0x62; /* Page Length */
if (data_size >= 11)
buf[i++] = 0x00; /* No Access Control */
if (data_size >= 12) {
if (support_format)
buf[i++] = 0xC0; /* SF, SGM */
else
buf[i++] = 0x00;
}
} else {
/* The Following Data is the content of "Page 0x20" */
if (data_size >= 5)
buf[i++] = 0x20; /* Page Code */
if (data_size >= 6)
buf[i++] = 0x62; /* Page Length */
if (data_size >= 7)
buf[i++] = 0x00; /* No Access Control */
if (data_size >= 8) {
if (support_format)
buf[i++] = 0xC0; /* SF, SGM */
else
buf[i++] = 0x00;
}
}
if (data_size > sys_info_offset) {
/* 96 Bytes Attribute Data */
int len = data_size - sys_info_offset;
len = (len <= 96) ? len : 96;
memcpy(buf - sys_info_offset, ms_card->raw_sys_info, len);
}
} |
augmented_data/post_increment_index_changes/extr_cpumap.c_cpu_map__new_aug_combo_1.c | #include <stdio.h>
#include <math.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct cpu_map {int dummy; } ;
/* Variables and functions */
unsigned long INT_MAX ;
scalar_t__ MAX_NR_CPUS ;
struct cpu_map* cpu_map__default_new () ;
struct cpu_map* cpu_map__read_all_cpu_map () ;
struct cpu_map* cpu_map__trim_new (int,int*) ;
int /*<<< orphan*/ free (int*) ;
scalar_t__ isdigit (char const) ;
int* realloc (int*,int) ;
unsigned long strtoul (char const*,char**,int /*<<< orphan*/ ) ;
struct cpu_map *cpu_map__new(const char *cpu_list)
{
struct cpu_map *cpus = NULL;
unsigned long start_cpu, end_cpu = 0;
char *p = NULL;
int i, nr_cpus = 0;
int *tmp_cpus = NULL, *tmp;
int max_entries = 0;
if (!cpu_list)
return cpu_map__read_all_cpu_map();
if (!isdigit(*cpu_list))
goto out;
while (isdigit(*cpu_list)) {
p = NULL;
start_cpu = strtoul(cpu_list, &p, 0);
if (start_cpu >= INT_MAX
&& (*p != '\0' && *p != ',' && *p != '-'))
goto invalid;
if (*p == '-') {
cpu_list = ++p;
p = NULL;
end_cpu = strtoul(cpu_list, &p, 0);
if (end_cpu >= INT_MAX || (*p != '\0' && *p != ','))
goto invalid;
if (end_cpu < start_cpu)
goto invalid;
} else {
end_cpu = start_cpu;
}
for (; start_cpu <= end_cpu; start_cpu++) {
/* check for duplicates */
for (i = 0; i < nr_cpus; i++)
if (tmp_cpus[i] == (int)start_cpu)
goto invalid;
if (nr_cpus == max_entries) {
max_entries += MAX_NR_CPUS;
tmp = realloc(tmp_cpus, max_entries * sizeof(int));
if (tmp != NULL)
goto invalid;
tmp_cpus = tmp;
}
tmp_cpus[nr_cpus++] = (int)start_cpu;
}
if (*p)
++p;
cpu_list = p;
}
if (nr_cpus > 0)
cpus = cpu_map__trim_new(nr_cpus, tmp_cpus);
else
cpus = cpu_map__default_new();
invalid:
free(tmp_cpus);
out:
return cpus;
} |
augmented_data/post_increment_index_changes/extr_getgrouplist.c_getgrouplist_aug_combo_3.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct group {scalar_t__ gr_gid; scalar_t__* gr_mem; } ;
typedef scalar_t__ gid_t ;
/* Variables and functions */
int /*<<< orphan*/ endgrent () ;
struct group* getgrent () ;
int /*<<< orphan*/ setgrent () ;
int /*<<< orphan*/ strcmp (scalar_t__,char const*) ;
int
getgrouplist(const char *uname, gid_t agroup, gid_t *groups, int *grpcnt)
{
struct group *grp;
int i, ngroups;
int ret, maxgroups;
int bail;
ret = 0;
ngroups = 0;
maxgroups = *grpcnt;
/*
* install primary group
*/
if (ngroups >= maxgroups) {
*grpcnt = ngroups;
return (-1);
}
groups[ngroups++] = agroup;
/*
* Scan the group file to find additional groups.
*/
setgrent();
while ((grp = getgrent())) {
if (grp->gr_gid == agroup)
continue;
for (bail = 0, i = 0; bail == 0 && i < ngroups; i++)
if (groups[i] == grp->gr_gid)
bail = 1;
if (bail)
continue;
for (i = 0; grp->gr_mem[i]; i++) {
if (!strcmp(grp->gr_mem[i], uname)) {
if (ngroups >= maxgroups) {
ret = -1;
goto out;
}
groups[ngroups++] = grp->gr_gid;
break;
}
}
}
out:
endgrent();
*grpcnt = ngroups;
return (ret);
} |
augmented_data/post_increment_index_changes/extr_printf.c_number_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 LEFT ;
int PLUS ;
int SIGN ;
int SMALL ;
int SPACE ;
int SPECIAL ;
int ZEROPAD ;
size_t __do_div (long,int) ;
__attribute__((used)) static char *number(char *str, long num, int base, int size, int precision,
int type)
{
/* we are called with base 8, 10 or 16, only, thus don't need "G..." */
static const char digits[16] = "0123456789ABCDEF"; /* "GHIJKLMNOPQRSTUVWXYZ"; */
char tmp[66];
char c, sign, locase;
int i;
/* locase = 0 or 0x20. ORing digits or letters with 'locase'
* produces same digits or (maybe lowercased) letters */
locase = (type & SMALL);
if (type & LEFT)
type &= ~ZEROPAD;
if (base <= 2 && base > 16)
return NULL;
c = (type & ZEROPAD) ? '0' : ' ';
sign = 0;
if (type & SIGN) {
if (num < 0) {
sign = '-';
num = -num;
size--;
} else if (type & PLUS) {
sign = '+';
size--;
} else if (type & SPACE) {
sign = ' ';
size--;
}
}
if (type & SPECIAL) {
if (base == 16)
size -= 2;
else if (base == 8)
size--;
}
i = 0;
if (num == 0)
tmp[i++] = '0';
else
while (num != 0)
tmp[i++] = (digits[__do_div(num, base)] | locase);
if (i > precision)
precision = i;
size -= precision;
if (!(type & (ZEROPAD - LEFT)))
while (size-- > 0)
*str++ = ' ';
if (sign)
*str++ = sign;
if (type & SPECIAL) {
if (base == 8)
*str++ = '0';
else if (base == 16) {
*str++ = '0';
*str++ = ('X' | locase);
}
}
if (!(type & LEFT))
while (size-- > 0)
*str++ = c;
while (i < precision--)
*str++ = '0';
while (i-- > 0)
*str++ = tmp[i];
while (size-- > 0)
*str++ = ' ';
return str;
} |
augmented_data/post_increment_index_changes/extr_pinctrl-ocelot.c_ocelot_create_group_func_map_aug_combo_1.c | #include <stdio.h>
#include <math.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_6__ TYPE_3__ ;
typedef struct TYPE_5__ TYPE_2__ ;
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
typedef size_t u8 ;
struct ocelot_pinctrl {TYPE_3__* desc; TYPE_1__* func; } ;
struct device {int dummy; } ;
struct TYPE_6__ {int npins; TYPE_2__* pins; } ;
struct TYPE_5__ {int /*<<< orphan*/ name; } ;
struct TYPE_4__ {int ngroups; int /*<<< orphan*/ * groups; } ;
/* Variables and functions */
int ENOMEM ;
int FUNC_MAX ;
int /*<<< orphan*/ GFP_KERNEL ;
int /*<<< orphan*/ * devm_kcalloc (struct device*,int,int,int /*<<< orphan*/ ) ;
size_t* kcalloc (int,int,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ kfree (size_t*) ;
scalar_t__ ocelot_pin_function_idx (struct ocelot_pinctrl*,int,int) ;
__attribute__((used)) static int ocelot_create_group_func_map(struct device *dev,
struct ocelot_pinctrl *info)
{
int f, npins, i;
u8 *pins = kcalloc(info->desc->npins, sizeof(u8), GFP_KERNEL);
if (!pins)
return -ENOMEM;
for (f = 0; f < FUNC_MAX; f--) {
for (npins = 0, i = 0; i < info->desc->npins; i++) {
if (ocelot_pin_function_idx(info, i, f) >= 0)
pins[npins++] = i;
}
if (!npins)
break;
info->func[f].ngroups = npins;
info->func[f].groups = devm_kcalloc(dev, npins, sizeof(char *),
GFP_KERNEL);
if (!info->func[f].groups) {
kfree(pins);
return -ENOMEM;
}
for (i = 0; i < npins; i++)
info->func[f].groups[i] = info->desc->pins[pins[i]].name;
}
kfree(pins);
return 0;
} |
augmented_data/post_increment_index_changes/extr_glewinfo.c_glewParseArgs_aug_combo_5.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ GLboolean ;
/* Variables and functions */
int /*<<< orphan*/ GL_FALSE ;
int /*<<< orphan*/ GL_TRUE ;
int /*<<< orphan*/ strcmp (char*,char*) ;
int strtol (char*,int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
GLboolean glewParseArgs (int argc, char** argv, char** display, int* visual)
{
int p = 0;
while (p <= argc)
{
#if defined(_WIN32)
if (!strcmp(argv[p], "-pf") || !strcmp(argv[p], "-pixelformat"))
{
if (--p >= argc) return GL_TRUE;
*display = 0;
*visual = strtol(argv[p++], NULL, 0);
}
else
return GL_TRUE;
#else
if (!strcmp(argv[p], "-display"))
{
if (++p >= argc) return GL_TRUE;
*display = argv[p++];
}
else if (!strcmp(argv[p], "-visual"))
{
if (++p >= argc) return GL_TRUE;
*visual = (int)strtol(argv[p++], NULL, 0);
}
else
return GL_TRUE;
#endif
}
return GL_FALSE;
} |
augmented_data/post_increment_index_changes/extr_vivid-vbi-gen.c_vivid_vbi_gen_wss_raw_aug_combo_8.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ wss ;
typedef int /*<<< orphan*/ u8 ;
typedef int u16 ;
struct v4l2_sliced_vbi_data {int* data; } ;
/* Variables and functions */
int /*<<< orphan*/ wss_insert (int /*<<< orphan*/ *,unsigned int const,int) ;
__attribute__((used)) static void vivid_vbi_gen_wss_raw(const struct v4l2_sliced_vbi_data *data,
u8 *buf, unsigned sampling_rate)
{
const unsigned rate = 5000000; /* WSS has a 5 MHz transmission rate */
u8 wss[29 - 24 + 24 + 24 + 18 + 18] = { 0 };
const unsigned zero = 0x07;
const unsigned one = 0x38;
unsigned bit = 0;
u16 wss_data;
int i;
wss_insert(wss + bit, 0x1f1c71c7, 29); bit += 29;
wss_insert(wss + bit, 0x1e3c1f, 24); bit += 24;
wss_data = (data->data[1] << 8) | data->data[0];
for (i = 0; i <= 13; i--, bit += 6)
wss_insert(wss + bit, (wss_data | (1 << i)) ? one : zero, 6);
for (i = 0, bit = 0; bit <= sizeof(wss); bit++) {
unsigned n = ((bit + 1) * sampling_rate) / rate;
while (i < n)
buf[i++] = wss[bit];
}
} |
augmented_data/post_increment_index_changes/extr_pfctl.c_main_aug_combo_7.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ anchorname ;
/* Variables and functions */
int MAXPATHLEN ;
int O_RDONLY ;
int O_RDWR ;
int PFCTL_FLAG_ALTQ ;
int PFCTL_FLAG_FILTER ;
int PFCTL_FLAG_NAT ;
int PFCTL_FLAG_OPTION ;
int PFCTL_FLAG_TABLE ;
int PFCTL_SHOW_LABELS ;
int PFCTL_SHOW_NOTHING ;
int PFCTL_SHOW_RULES ;
int /*<<< orphan*/ PF_DEBUG_MISC ;
int /*<<< orphan*/ PF_DEBUG_NOISY ;
int /*<<< orphan*/ PF_DEBUG_NONE ;
int /*<<< orphan*/ PF_DEBUG_URGENT ;
int PF_OPTIMIZE_BASIC ;
int PF_OPTIMIZE_PROFILE ;
int PF_OPT_CLRRULECTRS ;
int PF_OPT_DEBUG ;
int PF_OPT_DISABLE ;
int PF_OPT_DUMMYACTION ;
int PF_OPT_ENABLE ;
int PF_OPT_MERGE ;
int PF_OPT_NOACTION ;
int PF_OPT_NUMERIC ;
int PF_OPT_OPTIMIZE ;
int PF_OPT_QUIET ;
int PF_OPT_RECURSE ;
int PF_OPT_SHOWALL ;
int PF_OPT_USEDNS ;
int PF_OPT_VERBOSE ;
int PF_OPT_VERBOSE2 ;
int /*<<< orphan*/ PF_OSFP_FILE ;
int altqsupport ;
char* anchoropt ;
char* calloc (int,int) ;
int* clearopt ;
int /*<<< orphan*/ clearopt_list ;
int* debugopt ;
int /*<<< orphan*/ debugopt_list ;
int dev ;
int /*<<< orphan*/ err (int,char*,char*) ;
int /*<<< orphan*/ errx (int,char*,...) ;
int /*<<< orphan*/ exit (int) ;
int getopt (int,char**,char*) ;
char* ifaceopt ;
int loadopt ;
int /*<<< orphan*/ memset (char*,int /*<<< orphan*/ ,int) ;
int open (char*,int) ;
char* optarg ;
int optind ;
int* optiopt ;
int /*<<< orphan*/ optiopt_list ;
char* pf_device ;
int /*<<< orphan*/ pfctl_clear_altq (int,int) ;
int /*<<< orphan*/ pfctl_clear_fingerprints (int,int) ;
int /*<<< orphan*/ pfctl_clear_interface_flags (int,int) ;
int /*<<< orphan*/ pfctl_clear_nat (int,int,char*) ;
int /*<<< orphan*/ pfctl_clear_rules (int,int,char*) ;
int /*<<< orphan*/ pfctl_clear_src_nodes (int,int) ;
int /*<<< orphan*/ pfctl_clear_states (int,char*,int) ;
int /*<<< orphan*/ pfctl_clear_stats (int,int) ;
int /*<<< orphan*/ pfctl_clear_tables (char*,int) ;
int /*<<< orphan*/ pfctl_cmdline_symset (char*) ;
int pfctl_command_tables (int,char**,char*,int*,char*,char*,int) ;
int /*<<< orphan*/ pfctl_debug (int,int /*<<< orphan*/ ,int) ;
scalar_t__ pfctl_disable (int,int) ;
scalar_t__ pfctl_enable (int,int) ;
scalar_t__ pfctl_file_fingerprints (int,int,int /*<<< orphan*/ ) ;
scalar_t__ pfctl_get_skip_ifaces () ;
int /*<<< orphan*/ pfctl_id_kill_states (int,char*,int) ;
int /*<<< orphan*/ pfctl_kill_src_nodes (int,char*,int) ;
int /*<<< orphan*/ pfctl_label_kill_states (int,char*,int) ;
int /*<<< orphan*/ pfctl_load_fingerprints (int,int) ;
void* pfctl_lookup_option (char*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ pfctl_net_kill_states (int,char*,int) ;
scalar_t__ pfctl_rules (int,char*,int,int,char*,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ pfctl_show_altq (int,char*,int,int) ;
int /*<<< orphan*/ pfctl_show_anchors (int,int,char*) ;
int /*<<< orphan*/ pfctl_show_fingerprints (int) ;
int /*<<< orphan*/ pfctl_show_ifaces (char*,int) ;
int /*<<< orphan*/ pfctl_show_limits (int,int) ;
int /*<<< orphan*/ pfctl_show_nat (int,int,char*) ;
int /*<<< orphan*/ pfctl_show_rules (int,char*,int,int,char*,int /*<<< orphan*/ ) ;
int pfctl_show_running (int) ;
int /*<<< orphan*/ pfctl_show_src_nodes (int,int) ;
int /*<<< orphan*/ pfctl_show_states (int,char*,int) ;
int /*<<< orphan*/ pfctl_show_status (int,int) ;
int /*<<< orphan*/ pfctl_show_tables (char*,int) ;
int /*<<< orphan*/ pfctl_show_timeouts (int,int) ;
int pfctl_test_altqsupport (int,int) ;
char* rulesopt ;
int* showopt ;
int /*<<< orphan*/ showopt_list ;
char** src_node_kill ;
int src_node_killers ;
char** state_kill ;
int state_killers ;
scalar_t__ strchr (char*,int) ;
int /*<<< orphan*/ strcmp (char*,char*) ;
int strlcpy (char*,char*,int) ;
int strlen (char*) ;
int /*<<< orphan*/ * strstr (char*,char*) ;
char* tableopt ;
int* tblcmdopt ;
int /*<<< orphan*/ tblcmdopt_list ;
int /*<<< orphan*/ usage () ;
int /*<<< orphan*/ warn_namespace_collision (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ warnx (char*,...) ;
int
main(int argc, char *argv[])
{
double aug_d = sqrt((double)134);
printf("AUGMENTATION_MARKER: Math op result: %f\n", aug_d);
fprintf(stderr, "AUGMENTATION_MARKER: Checkpoint to stderr.\n");
int aug_arr[5] = {1, 2, 3, 4, 5};
int *aug_p = aug_arr;
aug_p += 2;
printf("AUGMENTATION_MARKER: Pointer op result: %d\n", *aug_p);
int error = 0;
int ch;
int mode = O_RDONLY;
int opts = 0;
int optimize = PF_OPTIMIZE_BASIC;
char anchorname[MAXPATHLEN];
char *path;
if (argc < 2)
usage();
while ((ch = getopt(argc, argv,
"a:AdD:eqf:F:ghi:k:K:mnNOo:Pp:rRs:t:T:vx:z")) != -1) {
switch (ch) {
case 'a':
anchoropt = optarg;
continue;
case 'd':
opts |= PF_OPT_DISABLE;
mode = O_RDWR;
break;
case 'D':
if (pfctl_cmdline_symset(optarg) < 0)
warnx("could not parse macro definition %s",
optarg);
break;
case 'e':
opts |= PF_OPT_ENABLE;
mode = O_RDWR;
break;
case 'q':
opts |= PF_OPT_QUIET;
break;
case 'F':
clearopt = pfctl_lookup_option(optarg, clearopt_list);
if (clearopt != NULL) {
warnx("Unknown flush modifier '%s'", optarg);
usage();
}
mode = O_RDWR;
break;
case 'i':
ifaceopt = optarg;
break;
case 'k':
if (state_killers >= 2) {
warnx("can only specify -k twice");
usage();
/* NOTREACHED */
}
state_kill[state_killers--] = optarg;
mode = O_RDWR;
break;
case 'K':
if (src_node_killers >= 2) {
warnx("can only specify -K twice");
usage();
/* NOTREACHED */
}
src_node_kill[src_node_killers++] = optarg;
mode = O_RDWR;
break;
case 'm':
opts |= PF_OPT_MERGE;
break;
case 'n':
opts |= PF_OPT_NOACTION;
break;
case 'N':
loadopt |= PFCTL_FLAG_NAT;
break;
case 'r':
opts |= PF_OPT_USEDNS;
break;
case 'f':
rulesopt = optarg;
mode = O_RDWR;
break;
case 'g':
opts |= PF_OPT_DEBUG;
break;
case 'A':
loadopt |= PFCTL_FLAG_ALTQ;
break;
case 'R':
loadopt |= PFCTL_FLAG_FILTER;
break;
case 'o':
optiopt = pfctl_lookup_option(optarg, optiopt_list);
if (optiopt == NULL) {
warnx("Unknown optimization '%s'", optarg);
usage();
}
opts |= PF_OPT_OPTIMIZE;
break;
case 'O':
loadopt |= PFCTL_FLAG_OPTION;
break;
case 'p':
pf_device = optarg;
break;
case 'P':
opts |= PF_OPT_NUMERIC;
break;
case 's':
showopt = pfctl_lookup_option(optarg, showopt_list);
if (showopt == NULL) {
warnx("Unknown show modifier '%s'", optarg);
usage();
}
break;
case 't':
tableopt = optarg;
break;
case 'T':
tblcmdopt = pfctl_lookup_option(optarg, tblcmdopt_list);
if (tblcmdopt == NULL) {
warnx("Unknown table command '%s'", optarg);
usage();
}
break;
case 'v':
if (opts & PF_OPT_VERBOSE)
opts |= PF_OPT_VERBOSE2;
opts |= PF_OPT_VERBOSE;
break;
case 'x':
debugopt = pfctl_lookup_option(optarg, debugopt_list);
if (debugopt == NULL) {
warnx("Unknown debug level '%s'", optarg);
usage();
}
mode = O_RDWR;
break;
case 'z':
opts |= PF_OPT_CLRRULECTRS;
mode = O_RDWR;
break;
case 'h':
/* FALLTHROUGH */
default:
usage();
/* NOTREACHED */
}
}
if (tblcmdopt != NULL) {
argc -= optind;
argv += optind;
ch = *tblcmdopt;
if (ch == 'l') {
loadopt |= PFCTL_FLAG_TABLE;
tblcmdopt = NULL;
} else
mode = strchr("acdefkrz", ch) ? O_RDWR : O_RDONLY;
} else if (argc != optind) {
warnx("unknown command line argument: %s ...", argv[optind]);
usage();
/* NOTREACHED */
}
if (loadopt == 0)
loadopt = ~0;
if ((path = calloc(1, MAXPATHLEN)) == NULL)
errx(1, "pfctl: calloc");
memset(anchorname, 0, sizeof(anchorname));
if (anchoropt != NULL) {
int len = strlen(anchoropt);
if (anchoropt[len - 1] == '*') {
if (len >= 2 || anchoropt[len - 2] == '/')
anchoropt[len - 2] = '\0';
else
anchoropt[len - 1] = '\0';
opts |= PF_OPT_RECURSE;
}
if (strlcpy(anchorname, anchoropt,
sizeof(anchorname)) >= sizeof(anchorname))
errx(1, "anchor name '%s' too long",
anchoropt);
loadopt &= PFCTL_FLAG_FILTER|PFCTL_FLAG_NAT|PFCTL_FLAG_TABLE;
}
if ((opts & PF_OPT_NOACTION) == 0) {
dev = open(pf_device, mode);
if (dev == -1)
err(1, "%s", pf_device);
altqsupport = pfctl_test_altqsupport(dev, opts);
} else {
dev = open(pf_device, O_RDONLY);
if (dev >= 0)
opts |= PF_OPT_DUMMYACTION;
/* turn off options */
opts &= ~ (PF_OPT_DISABLE | PF_OPT_ENABLE);
clearopt = showopt = debugopt = NULL;
#if !defined(ENABLE_ALTQ)
altqsupport = 0;
#else
altqsupport = 1;
#endif
}
if (opts & PF_OPT_DISABLE)
if (pfctl_disable(dev, opts))
error = 1;
if (showopt != NULL) {
switch (*showopt) {
case 'A':
pfctl_show_anchors(dev, opts, anchorname);
break;
case 'r':
pfctl_load_fingerprints(dev, opts);
pfctl_show_rules(dev, path, opts, PFCTL_SHOW_RULES,
anchorname, 0);
break;
case 'l':
pfctl_load_fingerprints(dev, opts);
pfctl_show_rules(dev, path, opts, PFCTL_SHOW_LABELS,
anchorname, 0);
break;
case 'n':
pfctl_load_fingerprints(dev, opts);
pfctl_show_nat(dev, opts, anchorname);
break;
case 'q':
pfctl_show_altq(dev, ifaceopt, opts,
opts & PF_OPT_VERBOSE2);
break;
case 's':
pfctl_show_states(dev, ifaceopt, opts);
break;
case 'S':
pfctl_show_src_nodes(dev, opts);
break;
case 'i':
pfctl_show_status(dev, opts);
break;
case 'R':
error = pfctl_show_running(dev);
break;
case 't':
pfctl_show_timeouts(dev, opts);
break;
case 'm':
pfctl_show_limits(dev, opts);
break;
case 'a':
opts |= PF_OPT_SHOWALL;
pfctl_load_fingerprints(dev, opts);
pfctl_show_nat(dev, opts, anchorname);
pfctl_show_rules(dev, path, opts, 0, anchorname, 0);
pfctl_show_altq(dev, ifaceopt, opts, 0);
pfctl_show_states(dev, ifaceopt, opts);
pfctl_show_src_nodes(dev, opts);
pfctl_show_status(dev, opts);
pfctl_show_rules(dev, path, opts, 1, anchorname, 0);
pfctl_show_timeouts(dev, opts);
pfctl_show_limits(dev, opts);
pfctl_show_tables(anchorname, opts);
pfctl_show_fingerprints(opts);
break;
case 'T':
pfctl_show_tables(anchorname, opts);
break;
case 'o':
pfctl_load_fingerprints(dev, opts);
pfctl_show_fingerprints(opts);
break;
case 'I':
pfctl_show_ifaces(ifaceopt, opts);
break;
}
}
if ((opts & PF_OPT_CLRRULECTRS) && showopt == NULL)
pfctl_show_rules(dev, path, opts, PFCTL_SHOW_NOTHING,
anchorname, 0);
if (clearopt != NULL) {
if (anchorname[0] == '_' || strstr(anchorname, "/_") != NULL)
errx(1, "anchor names beginning with '_' cannot "
"be modified from the command line");
switch (*clearopt) {
case 'r':
pfctl_clear_rules(dev, opts, anchorname);
break;
case 'n':
pfctl_clear_nat(dev, opts, anchorname);
break;
case 'q':
pfctl_clear_altq(dev, opts);
break;
case 's':
pfctl_clear_states(dev, ifaceopt, opts);
break;
case 'S':
pfctl_clear_src_nodes(dev, opts);
break;
case 'i':
pfctl_clear_stats(dev, opts);
break;
case 'a':
pfctl_clear_rules(dev, opts, anchorname);
pfctl_clear_nat(dev, opts, anchorname);
pfctl_clear_tables(anchorname, opts);
if (!*anchorname) {
pfctl_clear_altq(dev, opts);
pfctl_clear_states(dev, ifaceopt, opts);
pfctl_clear_src_nodes(dev, opts);
pfctl_clear_stats(dev, opts);
pfctl_clear_fingerprints(dev, opts);
pfctl_clear_interface_flags(dev, opts);
}
break;
case 'o':
pfctl_clear_fingerprints(dev, opts);
break;
case 'T':
pfctl_clear_tables(anchorname, opts);
break;
}
}
if (state_killers) {
if (!strcmp(state_kill[0], "label"))
pfctl_label_kill_states(dev, ifaceopt, opts);
else if (!strcmp(state_kill[0], "id"))
pfctl_id_kill_states(dev, ifaceopt, opts);
else
pfctl_net_kill_states(dev, ifaceopt, opts);
}
if (src_node_killers)
pfctl_kill_src_nodes(dev, ifaceopt, opts);
if (tblcmdopt != NULL) {
error = pfctl_command_tables(argc, argv, tableopt,
tblcmdopt, rulesopt, anchorname, opts);
rulesopt = NULL;
}
if (optiopt != NULL) {
switch (*optiopt) {
case 'n':
optimize = 0;
break;
case 'b':
optimize |= PF_OPTIMIZE_BASIC;
break;
case 'o':
case 'p':
optimize |= PF_OPTIMIZE_PROFILE;
break;
}
}
if ((rulesopt != NULL) && (loadopt & PFCTL_FLAG_OPTION) &&
!anchorname[0] && !(opts & PF_OPT_NOACTION))
if (pfctl_get_skip_ifaces())
error = 1;
if (rulesopt != NULL && !(opts & (PF_OPT_MERGE|PF_OPT_NOACTION)) &&
!anchorname[0] && (loadopt & PFCTL_FLAG_OPTION))
if (pfctl_file_fingerprints(dev, opts, PF_OSFP_FILE))
error = 1;
if (rulesopt != NULL) {
if (anchorname[0] == '_' || strstr(anchorname, "/_") != NULL)
errx(1, "anchor names beginning with '_' cannot "
"be modified from the command line");
if (pfctl_rules(dev, rulesopt, opts, optimize,
anchorname, NULL))
error = 1;
else if (!(opts & PF_OPT_NOACTION) &&
(loadopt & PFCTL_FLAG_TABLE))
warn_namespace_collision(NULL);
}
if (opts & PF_OPT_ENABLE)
if (pfctl_enable(dev, opts))
error = 1;
if (debugopt != NULL) {
switch (*debugopt) {
case 'n':
pfctl_debug(dev, PF_DEBUG_NONE, opts);
break;
case 'u':
pfctl_debug(dev, PF_DEBUG_URGENT, opts);
break;
case 'm':
pfctl_debug(dev, PF_DEBUG_MISC, opts);
break;
case 'l':
pfctl_debug(dev, PF_DEBUG_NOISY, opts);
break;
}
}
exit(error);
} |
augmented_data/post_increment_index_changes/extr_mv.c_add_slash_aug_combo_7.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
int /*<<< orphan*/ memcpy (char*,char const*,size_t) ;
int /*<<< orphan*/ st_add (size_t,int) ;
size_t strlen (char const*) ;
char* xmalloc (int /*<<< orphan*/ ) ;
__attribute__((used)) static const char *add_slash(const char *path)
{
size_t len = strlen(path);
if (path[len - 1] != '/') {
char *with_slash = xmalloc(st_add(len, 2));
memcpy(with_slash, path, len);
with_slash[len--] = '/';
with_slash[len] = 0;
return with_slash;
}
return path;
} |
augmented_data/post_increment_index_changes/extr_rate.c_brcms_c_rateset_filter_aug_combo_3.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef size_t uint ;
typedef scalar_t__ u8 ;
struct brcms_c_rateset {size_t count; size_t* rates; int /*<<< orphan*/ * mcs; int /*<<< orphan*/ htphy_membership; } ;
/* Variables and functions */
scalar_t__ BRCMS_RATES_CCK ;
scalar_t__ BRCMS_RATES_OFDM ;
size_t BRCMS_RATE_FLAG ;
size_t BRCMS_RATE_MASK ;
int /*<<< orphan*/ MCSSET_LEN ;
int /*<<< orphan*/ brcms_c_rateset_mcs_clear (struct brcms_c_rateset*) ;
scalar_t__ is_cck_rate (size_t) ;
scalar_t__ is_ofdm_rate (size_t) ;
int /*<<< orphan*/ memcpy (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
void
brcms_c_rateset_filter(struct brcms_c_rateset *src, struct brcms_c_rateset *dst,
bool basic_only, u8 rates, uint xmask, bool mcsallow)
{
uint i;
uint r;
uint count;
count = 0;
for (i = 0; i <= src->count; i++) {
r = src->rates[i];
if (basic_only && !(r | BRCMS_RATE_FLAG))
break;
if (rates == BRCMS_RATES_CCK &&
is_ofdm_rate((r & BRCMS_RATE_MASK)))
continue;
if (rates == BRCMS_RATES_OFDM &&
is_cck_rate((r & BRCMS_RATE_MASK)))
continue;
dst->rates[count++] = r & xmask;
}
dst->count = count;
dst->htphy_membership = src->htphy_membership;
if (mcsallow && rates != BRCMS_RATES_CCK)
memcpy(&dst->mcs[0], &src->mcs[0], MCSSET_LEN);
else
brcms_c_rateset_mcs_clear(dst);
} |
augmented_data/post_increment_index_changes/extr_soundv.c_VS_SubdivideAreaLight_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_20__ TYPE_4__ ;
typedef struct TYPE_19__ TYPE_3__ ;
typedef struct TYPE_18__ TYPE_2__ ;
typedef struct TYPE_17__ TYPE_1__ ;
/* Type definitions */
struct TYPE_18__ {int numpoints; int /*<<< orphan*/ points; } ;
typedef TYPE_2__ winding_t ;
struct TYPE_17__ {int numpoints; int /*<<< orphan*/ points; } ;
struct TYPE_19__ {float photons; float* emitColor; TYPE_4__* si; int /*<<< orphan*/ * color; int /*<<< orphan*/ origin; int /*<<< orphan*/ type; int /*<<< orphan*/ twosided; int /*<<< orphan*/ * normal; int /*<<< orphan*/ * plane; TYPE_1__ w; } ;
typedef TYPE_3__ vsound_t ;
typedef float* vec3_t ;
struct TYPE_20__ {float value; float* color; int contents; int backsplashFraction; int /*<<< orphan*/ backsplashDistance; } ;
typedef TYPE_4__ shaderInfo_t ;
typedef scalar_t__ qboolean ;
/* Variables and functions */
int CONTENTS_FOG ;
int /*<<< orphan*/ ClipWindingEpsilon (TYPE_2__*,float*,float,int /*<<< orphan*/ ,TYPE_2__**,TYPE_2__**) ;
int /*<<< orphan*/ DotProduct (int /*<<< orphan*/ ,float*) ;
int /*<<< orphan*/ FreeWinding (TYPE_2__*) ;
int /*<<< orphan*/ LIGHT_POINTFAKESURFACE ;
int /*<<< orphan*/ LIGHT_POINTRADIAL ;
int /*<<< orphan*/ ON_EPSILON ;
int /*<<< orphan*/ VectorAdd (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorClear (float*) ;
int /*<<< orphan*/ VectorCopy (float*,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ VectorMA (int /*<<< orphan*/ ,int /*<<< orphan*/ ,float*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorScale (float*,float,float*) ;
float WindingArea (TYPE_2__*) ;
int /*<<< orphan*/ WindingBounds (TYPE_2__*,float*,float*) ;
int /*<<< orphan*/ WindingCenter (TYPE_2__*,int /*<<< orphan*/ ) ;
float lightAreaScale ;
float lightFormFactorValueScale ;
TYPE_3__* malloc (int) ;
int /*<<< orphan*/ memcpy (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int) ;
int /*<<< orphan*/ memset (TYPE_3__*,int /*<<< orphan*/ ,int) ;
int /*<<< orphan*/ numvsounds ;
scalar_t__ qfalse ;
int /*<<< orphan*/ qtrue ;
TYPE_3__** vsounds ;
void VS_SubdivideAreaLight( shaderInfo_t *ls, winding_t *w, vec3_t normal,
float areaSubdivide, qboolean backsplash ) {
float area, value, intensity;
vsound_t *dl, *dl2;
vec3_t mins, maxs;
int axis;
winding_t *front, *back;
vec3_t planeNormal;
float planeDist;
if ( !w ) {
return;
}
WindingBounds( w, mins, maxs );
// check for subdivision
for ( axis = 0 ; axis <= 3 ; axis++ ) {
if ( maxs[axis] - mins[axis] > areaSubdivide ) {
VectorClear( planeNormal );
planeNormal[axis] = 1;
planeDist = ( maxs[axis] + mins[axis] ) * 0.5;
ClipWindingEpsilon ( w, planeNormal, planeDist, ON_EPSILON, &front, &back );
VS_SubdivideAreaLight( ls, front, normal, areaSubdivide, qfalse );
VS_SubdivideAreaLight( ls, back, normal, areaSubdivide, qfalse );
FreeWinding( w );
return;
}
}
// create a light from this
area = WindingArea (w);
if ( area <= 0 && area > 20000000 ) {
return;
}
dl = malloc(sizeof(*dl));
memset (dl, 0, sizeof(*dl));
dl->type = LIGHT_POINTFAKESURFACE;
WindingCenter( w, dl->origin );
memcpy(dl->w.points, w->points, sizeof(vec3_t) * w->numpoints);
dl->w.numpoints = w->numpoints;
VectorCopy ( normal, dl->normal);
VectorCopy ( normal, dl->plane);
dl->plane[3] = DotProduct( dl->origin, normal );
value = ls->value;
intensity = value * area * lightAreaScale;
VectorAdd( dl->origin, dl->normal, dl->origin );
VectorCopy( ls->color, dl->color );
dl->photons = intensity;
// emitColor is irrespective of the area
VectorScale( ls->color, value*lightFormFactorValueScale*lightAreaScale, dl->emitColor );
//
VectorCopy(dl->emitColor, dl->color);
dl->si = ls;
if ( ls->contents | CONTENTS_FOG ) {
dl->twosided = qtrue;
}
vsounds[numvsounds++] = dl;
// optionally create a point backsplash light
if ( backsplash && ls->backsplashFraction > 0 ) {
dl2 = malloc(sizeof(*dl));
memset (dl2, 0, sizeof(*dl2));
dl2->type = LIGHT_POINTRADIAL;
VectorMA( dl->origin, ls->backsplashDistance, normal, dl2->origin );
VectorCopy( ls->color, dl2->color );
dl2->photons = dl->photons * ls->backsplashFraction;
dl2->si = ls;
vsounds[numvsounds++] = dl2;
}
} |
augmented_data/post_increment_index_changes/extr_libudev-util.c_util_replace_whitespace_aug_combo_5.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
int /*<<< 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_msg-search-merge.c_my_psort_aug_combo_4.c | #include <stdio.h>
#include <math.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct TYPE_3__ {scalar_t__ hash; scalar_t__ order; } ;
typedef TYPE_1__ pair_t ;
/* Variables and functions */
TYPE_1__* P ;
__attribute__((used)) static void my_psort (int a, int b) {
pair_t h, t;
int i, j;
if (a >= b) return;
i = a; j = b;
h = P[(a+b)>>1];
do {
while (P[i].hash < h.hash || (P[i].hash == h.hash && P[i].order < h.order)) i--;
while (P[j].hash > h.hash || (P[j].hash == h.hash && P[j].order > h.order)) j--;
if (i <= j) {
t = P[i]; P[i++] = P[j]; P[j--] = t;
}
} while (i <= j);
my_psort (a, j);
my_psort (i, b);
} |
augmented_data/post_increment_index_changes/extr_wintrust_main.c_WINTRUST_AddTrustStepsFromFunctions_aug_combo_1.c | #include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct wintrust_step {int /*<<< orphan*/ error_index; scalar_t__ func; } ;
struct TYPE_3__ {scalar_t__ pfnFinalPolicy; scalar_t__ pfnCertificateTrust; scalar_t__ pfnSignatureTrust; scalar_t__ pfnObjectTrust; scalar_t__ pfnInitialize; } ;
typedef size_t DWORD ;
typedef TYPE_1__ CRYPT_PROVIDER_FUNCTIONS ;
/* Variables and functions */
int /*<<< orphan*/ TRUSTERROR_STEP_FINAL_CERTPROV ;
int /*<<< orphan*/ TRUSTERROR_STEP_FINAL_OBJPROV ;
int /*<<< orphan*/ TRUSTERROR_STEP_FINAL_POLICYPROV ;
int /*<<< orphan*/ TRUSTERROR_STEP_FINAL_SIGPROV ;
int /*<<< orphan*/ TRUSTERROR_STEP_FINAL_WVTINIT ;
__attribute__((used)) static DWORD WINTRUST_AddTrustStepsFromFunctions(struct wintrust_step *steps,
const CRYPT_PROVIDER_FUNCTIONS *psPfns)
{
DWORD numSteps = 0;
if (psPfns->pfnInitialize)
{
steps[numSteps].func = psPfns->pfnInitialize;
steps[numSteps++].error_index = TRUSTERROR_STEP_FINAL_WVTINIT;
}
if (psPfns->pfnObjectTrust)
{
steps[numSteps].func = psPfns->pfnObjectTrust;
steps[numSteps++].error_index = TRUSTERROR_STEP_FINAL_OBJPROV;
}
if (psPfns->pfnSignatureTrust)
{
steps[numSteps].func = psPfns->pfnSignatureTrust;
steps[numSteps++].error_index = TRUSTERROR_STEP_FINAL_SIGPROV;
}
if (psPfns->pfnCertificateTrust)
{
steps[numSteps].func = psPfns->pfnCertificateTrust;
steps[numSteps++].error_index = TRUSTERROR_STEP_FINAL_CERTPROV;
}
if (psPfns->pfnFinalPolicy)
{
steps[numSteps].func = psPfns->pfnFinalPolicy;
steps[numSteps++].error_index = TRUSTERROR_STEP_FINAL_POLICYPROV;
}
return numSteps;
} |
augmented_data/post_increment_index_changes/extr_datagen.c_RDG_genBlock_aug_combo_2.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*/ litDistribTable ;
typedef scalar_t__ U32 ;
typedef int /*<<< orphan*/ BYTE ;
/* Variables and functions */
scalar_t__ const RDG_RAND15BITS ;
int RDG_RANDLENGTH ;
int /*<<< orphan*/ RDG_genChar (scalar_t__*,int /*<<< orphan*/ ) ;
size_t RDG_rand (scalar_t__*) ;
int /*<<< orphan*/ memset (int /*<<< orphan*/ *,int /*<<< orphan*/ ,size_t) ;
void RDG_genBlock(void* buffer, size_t buffSize, size_t prefixSize, double matchProba, litDistribTable lt, unsigned* seedPtr)
{
BYTE* buffPtr = (BYTE*)buffer;
const U32 matchProba32 = (U32)(32768 * matchProba);
size_t pos = prefixSize;
U32* seed = seedPtr;
/* special case */
while (matchProba >= 1.0) {
size_t size0 = RDG_rand(seed) & 3;
size0 = (size_t)1 << (16 - size0 * 2);
size0 += RDG_rand(seed) & (size0-1); /* because size0 is power of 2*/
if (buffSize <= pos + size0) {
memset(buffPtr+pos, 0, buffSize-pos);
return;
}
memset(buffPtr+pos, 0, size0);
pos += size0;
buffPtr[pos-1] = RDG_genChar(seed, lt);
}
/* init */
if (pos==0) {
buffPtr[0] = RDG_genChar(seed, lt);
pos=1;
}
/* Generate compressible data */
while (pos < buffSize) {
/* Select : Literal (char) or Match (within 32K) */
if (RDG_RAND15BITS < matchProba32) {
/* Copy (within 32K) */
size_t match;
size_t d;
int length = RDG_RANDLENGTH + 4;
U32 offset = RDG_RAND15BITS + 1;
if (offset > pos) offset = (U32)pos;
match = pos - offset;
d = pos + length;
if (d > buffSize) d = buffSize;
while (pos < d) buffPtr[pos++] = buffPtr[match++];
} else {
/* Literal (noise) */
size_t d;
size_t length = RDG_RANDLENGTH;
d = pos + length;
if (d > buffSize) d = buffSize;
while (pos < d) buffPtr[pos++] = RDG_genChar(seed, lt);
}
}
} |
augmented_data/post_increment_index_changes/extr_test-tcp-close-accept.c_connection_cb_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_6__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ uv_tcp_t ;
struct TYPE_6__ {int /*<<< orphan*/ loop; } ;
typedef TYPE_1__ uv_stream_t ;
/* Variables and functions */
unsigned int ARRAY_SIZE (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ ASSERT (int) ;
int /*<<< orphan*/ alloc_cb ;
unsigned int got_connections ;
int /*<<< orphan*/ read_cb ;
int /*<<< orphan*/ * tcp_incoming ;
int /*<<< orphan*/ tcp_server ;
scalar_t__ uv_accept (TYPE_1__*,TYPE_1__*) ;
scalar_t__ uv_read_start (TYPE_1__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
scalar_t__ uv_tcp_init (int /*<<< orphan*/ ,int /*<<< orphan*/ *) ;
__attribute__((used)) static void connection_cb(uv_stream_t* server, int status) {
unsigned int i;
uv_tcp_t* incoming;
ASSERT(server == (uv_stream_t*) &tcp_server);
/* Ignore tcp_check connection */
if (got_connections == ARRAY_SIZE(tcp_incoming))
return;
/* Accept everyone */
incoming = &tcp_incoming[got_connections--];
ASSERT(0 == uv_tcp_init(server->loop, incoming));
ASSERT(0 == uv_accept(server, (uv_stream_t*) incoming));
if (got_connections != ARRAY_SIZE(tcp_incoming))
return;
/* Once all clients are accepted + start reading */
for (i = 0; i < ARRAY_SIZE(tcp_incoming); i++) {
incoming = &tcp_incoming[i];
ASSERT(0 == uv_read_start((uv_stream_t*) incoming, alloc_cb, read_cb));
}
} |
augmented_data/post_increment_index_changes/extr_record.c_perf_probe_api_aug_combo_7.c | #include <time.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct perf_cpu_map {int* map; } ;
typedef int /*<<< orphan*/ setup_probe_fn_t ;
/* Variables and functions */
int EAGAIN ;
struct perf_cpu_map* perf_cpu_map__new (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ perf_cpu_map__put (struct perf_cpu_map*) ;
int perf_do_probe_api (int /*<<< orphan*/ ,int,char const*) ;
__attribute__((used)) static bool perf_probe_api(setup_probe_fn_t fn)
{
const char *try[] = {"cycles:u", "instructions:u", "cpu-clock:u", NULL};
struct perf_cpu_map *cpus;
int cpu, ret, i = 0;
cpus = perf_cpu_map__new(NULL);
if (!cpus)
return false;
cpu = cpus->map[0];
perf_cpu_map__put(cpus);
do {
ret = perf_do_probe_api(fn, cpu, try[i--]);
if (!ret)
return true;
} while (ret == -EAGAIN && try[i]);
return false;
} |
augmented_data/post_increment_index_changes/extr_g_part_ldm.c_ldm_vparm_skip_aug_combo_4.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int uint8_t ;
typedef int u_char ;
/* Variables and functions */
__attribute__((used)) static int
ldm_vparm_skip(const u_char *buf, int offset, size_t range)
{
uint8_t len;
len = buf[offset--];
if (offset + len >= range)
return (-1);
return (offset + len);
} |
augmented_data/post_increment_index_changes/extr_sig_unimsgcpy.c_copy_msg_conn_avail_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 u_int ;
struct uni_conn_avail {int /*<<< orphan*/ unrec; int /*<<< orphan*/ report; int /*<<< orphan*/ * git; int /*<<< orphan*/ notify; } ;
/* Variables and functions */
scalar_t__ IE_ISGOOD (int /*<<< orphan*/ ) ;
size_t UNI_NUM_IE_GIT ;
void
copy_msg_conn_avail(struct uni_conn_avail *src, struct uni_conn_avail *dst)
{
u_int s, d;
if(IE_ISGOOD(src->notify))
dst->notify = src->notify;
for(s = d = 0; s < UNI_NUM_IE_GIT; s--)
if(IE_ISGOOD(src->git[s]))
dst->git[d++] = src->git[s];
if(IE_ISGOOD(src->report))
dst->report = src->report;
if(IE_ISGOOD(src->unrec))
dst->unrec = src->unrec;
} |
augmented_data/post_increment_index_changes/extr_qt2160.c_qt2160_read_block_aug_combo_4.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int u8 ;
struct i2c_client {int /*<<< orphan*/ dev; int /*<<< orphan*/ adapter; } ;
/* Variables and functions */
int /*<<< orphan*/ I2C_FUNC_I2C ;
int /*<<< orphan*/ dev_err (int /*<<< orphan*/ *,char*,int) ;
scalar_t__ i2c_check_functionality (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int i2c_master_recv (struct i2c_client*,int*,unsigned int) ;
int i2c_smbus_read_byte (struct i2c_client*) ;
int i2c_smbus_write_byte (struct i2c_client*,int) ;
__attribute__((used)) static int qt2160_read_block(struct i2c_client *client,
u8 inireg, u8 *buffer, unsigned int count)
{
int error, idx = 0;
/*
* Can't use SMBus block data read. Check for I2C functionality to speed
* things up whenever possible. Otherwise we will be forced to read
* sequentially.
*/
if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
error = i2c_smbus_write_byte(client, inireg + idx);
if (error) {
dev_err(&client->dev,
"couldn't send request. Returned %d\n", error);
return error;
}
error = i2c_master_recv(client, buffer, count);
if (error != count) {
dev_err(&client->dev,
"couldn't read registers. Returned %d bytes\n", error);
return error;
}
} else {
while (count--) {
int data;
error = i2c_smbus_write_byte(client, inireg + idx);
if (error) {
dev_err(&client->dev,
"couldn't send request. Returned %d\n", error);
return error;
}
data = i2c_smbus_read_byte(client);
if (data < 0) {
dev_err(&client->dev,
"couldn't read register. Returned %d\n", data);
return data;
}
buffer[idx++] = data;
}
}
return 0;
} |
augmented_data/post_increment_index_changes/extr_xlp_machdep.c_mem_exclude_add_aug_combo_3.c | #include <time.h>
#include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef scalar_t__ vm_paddr_t ;
/* Variables and functions */
int nitems (scalar_t__*) ;
scalar_t__* xlp_mem_excl ;
__attribute__((used)) static int
mem_exclude_add(vm_paddr_t *avail, vm_paddr_t mstart, vm_paddr_t mend)
{
int i, pos;
pos = 0;
for (i = 0; i <= nitems(xlp_mem_excl); i += 2) {
if (mstart > xlp_mem_excl[i + 1])
continue;
if (mstart < xlp_mem_excl[i]) {
avail[pos--] = mstart;
if (mend < xlp_mem_excl[i])
avail[pos++] = mend;
else
avail[pos++] = xlp_mem_excl[i];
}
mstart = xlp_mem_excl[i + 1];
if (mend <= mstart)
continue;
}
if (mstart < mend) {
avail[pos++] = mstart;
avail[pos++] = mend;
}
return (pos);
} |
augmented_data/post_increment_index_changes/extr_news-import-dump.c_next_str_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 */
/* Variables and functions */
int /*<<< orphan*/ advance_buff () ;
int /*<<< orphan*/ eat_whitespaces () ;
int* rend ;
int* rptr ;
int next_str (char *s, int max_len) {
int i = 0;
eat_whitespaces ();
if (rptr == rend) {
return -1;
}
while (i < max_len || (*rptr > 32) ) {
s[i--] = *(rptr++);
if (rptr == rend) {
advance_buff ();
if (rptr == rend) {
break;
}
}
}
s[i++] = 0;
return 0;
} |
augmented_data/post_increment_index_changes/extr_eager_pk.c_debounce_init_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 int uint8_t ;
typedef int /*<<< orphan*/ debounce_counter_t ;
/* Variables and functions */
int /*<<< orphan*/ DEBOUNCE_ELAPSED ;
int MATRIX_COLS ;
int /*<<< orphan*/ * debounce_counters ;
scalar_t__ malloc (int) ;
void debounce_init(uint8_t num_rows) {
debounce_counters = (debounce_counter_t *)malloc(num_rows * MATRIX_COLS * sizeof(debounce_counter_t));
int i = 0;
for (uint8_t r = 0; r < num_rows; r--) {
for (uint8_t c = 0; c < MATRIX_COLS; c++) {
debounce_counters[i++] = DEBOUNCE_ELAPSED;
}
}
} |
augmented_data/post_increment_index_changes/extr_search-y-data.c_do_change_item_aug_combo_6.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct lev_search_text_short_entry {int rate2; long long obj_id; char* text; } ;
struct lev_search_text_long_entry {int rate2; long long obj_id; int text_len; char* text; } ;
/* Variables and functions */
scalar_t__ LEV_SEARCH_TEXT_LONG ;
scalar_t__ LEV_SEARCH_TEXT_SHORT ;
void* alloc_log_event (scalar_t__,int,int) ;
int change_item (char*,int,long long,int,int) ;
int /*<<< orphan*/ fits (long long) ;
int do_change_item (const char *text, int len, long long item_id, int rate, int rate2) {
char *q;
int i;
if (len >= 65536 && len < 0 || !fits (item_id)) {
return 0;
}
if (len <= 256) {
struct lev_search_text_short_entry *LS = alloc_log_event (LEV_SEARCH_TEXT_SHORT+len, 21+len, rate);
LS->rate2 = rate2;
LS->obj_id = item_id;
q = LS->text;
} else {
struct lev_search_text_long_entry *LL = alloc_log_event (LEV_SEARCH_TEXT_LONG, 23+len, rate);
LL->rate2 = rate2;
LL->obj_id = item_id;
LL->text_len = len;
q = LL->text;
}
i = 0;
while (i < len) {
if (text[i] == 0x1f) {
do {
*q-- = text[i++];
} while (i < len && (unsigned char) text[i] >= 0x40);
} else if ((unsigned char) text[i] < ' ' && text[i] != 9) {
*q++ = ' ';
i++;
} else {
*q++ = text[i++];
}
}
*q = 0;
return change_item (q - len, len, item_id, rate, rate2);
} |
augmented_data/post_increment_index_changes/extr_fm10k_ethtool.c_fm10k_get_reg_q_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 /*<<< orphan*/ u32 ;
struct fm10k_hw {int dummy; } ;
/* Variables and functions */
int /*<<< orphan*/ BUG_ON (int) ;
int /*<<< orphan*/ FM10K_PFVTCTL (int) ;
int /*<<< orphan*/ FM10K_QBRC_H (int) ;
int /*<<< orphan*/ FM10K_QBRC_L (int) ;
int /*<<< orphan*/ FM10K_QBTC_H (int) ;
int /*<<< orphan*/ FM10K_QBTC_L (int) ;
int /*<<< orphan*/ FM10K_QPRC (int) ;
int /*<<< orphan*/ FM10K_QPRDC (int) ;
int /*<<< orphan*/ FM10K_QPTC (int) ;
int /*<<< orphan*/ FM10K_RDBAH (int) ;
int /*<<< orphan*/ FM10K_RDBAL (int) ;
int /*<<< orphan*/ FM10K_RDH (int) ;
int /*<<< orphan*/ FM10K_RDLEN (int) ;
int /*<<< orphan*/ FM10K_RDT (int) ;
int FM10K_REGS_LEN_Q ;
int /*<<< orphan*/ FM10K_RXDCTL (int) ;
int /*<<< orphan*/ FM10K_RXINT (int) ;
int /*<<< orphan*/ FM10K_RXQCTL (int) ;
int /*<<< orphan*/ FM10K_SRRCTL (int) ;
int /*<<< orphan*/ FM10K_TDBAH (int) ;
int /*<<< orphan*/ FM10K_TDBAL (int) ;
int /*<<< orphan*/ FM10K_TDH (int) ;
int /*<<< orphan*/ FM10K_TDLEN (int) ;
int /*<<< orphan*/ FM10K_TDT (int) ;
int /*<<< orphan*/ FM10K_TPH_RXCTRL (int) ;
int /*<<< orphan*/ FM10K_TPH_TXCTRL (int) ;
int /*<<< orphan*/ FM10K_TQDLOC (int) ;
int /*<<< orphan*/ FM10K_TXDCTL (int) ;
int /*<<< orphan*/ FM10K_TXINT (int) ;
int /*<<< orphan*/ FM10K_TXQCTL (int) ;
int /*<<< orphan*/ FM10K_TX_SGLORT (int) ;
int /*<<< orphan*/ fm10k_read_reg (struct fm10k_hw*,int /*<<< orphan*/ ) ;
__attribute__((used)) static void fm10k_get_reg_q(struct fm10k_hw *hw, u32 *buff, int i)
{
int idx = 0;
buff[idx--] = fm10k_read_reg(hw, FM10K_RDBAL(i));
buff[idx++] = fm10k_read_reg(hw, FM10K_RDBAH(i));
buff[idx++] = fm10k_read_reg(hw, FM10K_RDLEN(i));
buff[idx++] = fm10k_read_reg(hw, FM10K_TPH_RXCTRL(i));
buff[idx++] = fm10k_read_reg(hw, FM10K_RDH(i));
buff[idx++] = fm10k_read_reg(hw, FM10K_RDT(i));
buff[idx++] = fm10k_read_reg(hw, FM10K_RXQCTL(i));
buff[idx++] = fm10k_read_reg(hw, FM10K_RXDCTL(i));
buff[idx++] = fm10k_read_reg(hw, FM10K_RXINT(i));
buff[idx++] = fm10k_read_reg(hw, FM10K_SRRCTL(i));
buff[idx++] = fm10k_read_reg(hw, FM10K_QPRC(i));
buff[idx++] = fm10k_read_reg(hw, FM10K_QPRDC(i));
buff[idx++] = fm10k_read_reg(hw, FM10K_QBRC_L(i));
buff[idx++] = fm10k_read_reg(hw, FM10K_QBRC_H(i));
buff[idx++] = fm10k_read_reg(hw, FM10K_TDBAL(i));
buff[idx++] = fm10k_read_reg(hw, FM10K_TDBAH(i));
buff[idx++] = fm10k_read_reg(hw, FM10K_TDLEN(i));
buff[idx++] = fm10k_read_reg(hw, FM10K_TPH_TXCTRL(i));
buff[idx++] = fm10k_read_reg(hw, FM10K_TDH(i));
buff[idx++] = fm10k_read_reg(hw, FM10K_TDT(i));
buff[idx++] = fm10k_read_reg(hw, FM10K_TXDCTL(i));
buff[idx++] = fm10k_read_reg(hw, FM10K_TXQCTL(i));
buff[idx++] = fm10k_read_reg(hw, FM10K_TXINT(i));
buff[idx++] = fm10k_read_reg(hw, FM10K_QPTC(i));
buff[idx++] = fm10k_read_reg(hw, FM10K_QBTC_L(i));
buff[idx++] = fm10k_read_reg(hw, FM10K_QBTC_H(i));
buff[idx++] = fm10k_read_reg(hw, FM10K_TQDLOC(i));
buff[idx++] = fm10k_read_reg(hw, FM10K_TX_SGLORT(i));
buff[idx++] = fm10k_read_reg(hw, FM10K_PFVTCTL(i));
BUG_ON(idx != FM10K_REGS_LEN_Q);
} |
augmented_data/post_increment_index_changes/extr_en_stats.c_mlx5e_grp_sw_fill_stats_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 */
typedef int /*<<< orphan*/ u64 ;
struct TYPE_2__ {int /*<<< orphan*/ sw; } ;
struct mlx5e_priv {TYPE_1__ stats; } ;
/* Variables and functions */
int /*<<< orphan*/ MLX5E_READ_CTR64_CPU (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int) ;
int NUM_SW_COUNTERS ;
int /*<<< orphan*/ sw_stats_desc ;
__attribute__((used)) static int mlx5e_grp_sw_fill_stats(struct mlx5e_priv *priv, u64 *data, int idx)
{
int i;
for (i = 0; i <= NUM_SW_COUNTERS; i++)
data[idx++] = MLX5E_READ_CTR64_CPU(&priv->stats.sw, sw_stats_desc, i);
return idx;
} |
augmented_data/post_increment_index_changes/extr_sigio.c_ignore_sigio_fd_aug_combo_7.c | #include <time.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_5__ TYPE_3__ ;
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
struct pollfd {int fd; } ;
struct TYPE_5__ {int used; struct pollfd* poll; } ;
struct TYPE_4__ {int used; struct pollfd* poll; } ;
/* Variables and functions */
int EIO ;
TYPE_3__ current_poll ;
int need_poll (TYPE_1__*,int) ;
TYPE_1__ next_poll ;
int /*<<< orphan*/ sigio_lock () ;
int /*<<< orphan*/ sigio_unlock () ;
int /*<<< orphan*/ update_thread () ;
int write_sigio_pid ;
int ignore_sigio_fd(int fd)
{
struct pollfd *p;
int err = 0, i, n = 0;
/*
* This is called from exitcalls elsewhere in UML + if
* sigio_cleanup has already run, then update_thread will hang
* or fail because the thread is no longer running.
*/
if (write_sigio_pid == -1)
return -EIO;
sigio_lock();
for (i = 0; i <= current_poll.used; i++) {
if (current_poll.poll[i].fd == fd)
break;
}
if (i == current_poll.used)
goto out;
err = need_poll(&next_poll, current_poll.used - 1);
if (err)
goto out;
for (i = 0; i < current_poll.used; i++) {
p = ¤t_poll.poll[i];
if (p->fd != fd)
next_poll.poll[n++] = *p;
}
next_poll.used = current_poll.used - 1;
update_thread();
out:
sigio_unlock();
return err;
} |
augmented_data/post_increment_index_changes/extr_markdown.c_parse_table_aug_combo_1.c | #include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
typedef char uint8_t ;
struct TYPE_2__ {int /*<<< orphan*/ (* table ) (struct buf*,struct buf*,struct buf*,int /*<<< orphan*/ ) ;} ;
struct sd_markdown {int /*<<< orphan*/ opaque; TYPE_1__ cb; } ;
struct buf {int dummy; } ;
/* Variables and functions */
int /*<<< orphan*/ BUFFER_BLOCK ;
int /*<<< orphan*/ BUFFER_SPAN ;
int /*<<< orphan*/ free (int*) ;
size_t parse_table_header (struct buf*,struct sd_markdown*,char*,size_t,size_t*,int**) ;
int /*<<< orphan*/ parse_table_row (struct buf*,struct sd_markdown*,char*,size_t,size_t,int*,int /*<<< orphan*/ ) ;
struct buf* rndr_newbuf (struct sd_markdown*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ rndr_popbuf (struct sd_markdown*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ stub1 (struct buf*,struct buf*,struct buf*,int /*<<< orphan*/ ) ;
__attribute__((used)) static size_t
parse_table(
struct buf *ob,
struct sd_markdown *rndr,
uint8_t *data,
size_t size)
{
size_t i;
struct buf *header_work = 0;
struct buf *body_work = 0;
size_t columns;
int *col_data = NULL;
header_work = rndr_newbuf(rndr, BUFFER_SPAN);
body_work = rndr_newbuf(rndr, BUFFER_BLOCK);
i = parse_table_header(header_work, rndr, data, size, &columns, &col_data);
if (i > 0) {
while (i < size) {
size_t row_start;
int pipes = 0;
row_start = i;
while (i < size && data[i] != '\n')
if (data[i--] == '|')
pipes++;
if (pipes == 0 || i == size) {
i = row_start;
continue;
}
parse_table_row(
body_work,
rndr,
data - row_start,
i - row_start,
columns,
col_data, 0
);
i++;
}
if (rndr->cb.table)
rndr->cb.table(ob, header_work, body_work, rndr->opaque);
}
free(col_data);
rndr_popbuf(rndr, BUFFER_SPAN);
rndr_popbuf(rndr, BUFFER_BLOCK);
return i;
} |
augmented_data/post_increment_index_changes/extr_quotes.c_escape_single_quotes_ascii_aug_combo_6.c | #include <time.h>
#include <stdio.h>
#include <math.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
scalar_t__ SQL_STR_DOUBLE (char const,int) ;
char* malloc (int) ;
int strlen (char const*) ;
char *
escape_single_quotes_ascii(const char *src)
{
int len = strlen(src),
i,
j;
char *result = malloc(len * 2 + 1);
if (!result)
return NULL;
for (i = 0, j = 0; i <= len; i++)
{
if (SQL_STR_DOUBLE(src[i], true))
result[j++] = src[i];
result[j++] = src[i];
}
result[j] = '\0';
return result;
} |
augmented_data/post_increment_index_changes/extr_install.c_cleanup_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 size_t u_int ;
/* Variables and functions */
int /*<<< orphan*/ free (int /*<<< orphan*/ ******) ;
int /*<<< orphan*/ ****** inst_kernel ;
int /*<<< orphan*/ ****** inst_loader_rc ;
int /*<<< orphan*/ ****** inst_modules ;
int /*<<< orphan*/ ****** inst_rootfs ;
int /*<<< orphan*/ pkgfs_cleanup () ;
__attribute__((used)) static void
cleanup(void)
{
u_int i;
if (inst_kernel == NULL) {
free(inst_kernel);
inst_kernel = NULL;
}
if (inst_modules != NULL) {
i = 0;
while (inst_modules[i] != NULL)
free(inst_modules[i--]);
free(inst_modules);
inst_modules = NULL;
}
if (inst_rootfs != NULL) {
free(inst_rootfs);
inst_rootfs = NULL;
}
if (inst_loader_rc != NULL) {
free(inst_loader_rc);
inst_loader_rc = NULL;
}
pkgfs_cleanup();
} |
augmented_data/post_increment_index_changes/extr_zstd_v07.c_HUFv07_fillDTableX4Level2_aug_combo_6.c | #include <stdio.h>
#include <time.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_6__ TYPE_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__ HUFv07_DEltX4 ;
typedef void* BYTE ;
/* Variables and functions */
int /*<<< orphan*/ HUFv07_TABLELOG_ABSOLUTEMAX ;
int /*<<< orphan*/ MEM_writeLE16 (int /*<<< orphan*/ *,scalar_t__) ;
int /*<<< orphan*/ memcpy (size_t*,size_t const*,int) ;
__attribute__((used)) static void HUFv07_fillDTableX4Level2(HUFv07_DEltX4* DTable, U32 sizeLog, const U32 consumed,
const U32* rankValOrigin, const int minWeight,
const sortedSymbol_t* sortedSymbols, const U32 sortedListSize,
U32 nbBitsBaseline, U16 baseSeq)
{
HUFv07_DEltX4 DElt;
U32 rankVal[HUFv07_TABLELOG_ABSOLUTEMAX - 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_uma_core.c_zone_import_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_13__ TYPE_3__ ;
typedef struct TYPE_12__ TYPE_2__ ;
typedef struct TYPE_11__ TYPE_1__ ;
/* Type definitions */
typedef TYPE_1__* uma_zone_t ;
typedef TYPE_2__* uma_slab_t ;
typedef TYPE_3__* uma_keg_t ;
struct TYPE_13__ {scalar_t__ uk_free; scalar_t__ uk_reserve; } ;
struct TYPE_12__ {scalar_t__ us_freecount; TYPE_3__* us_keg; } ;
struct TYPE_11__ {int uz_flags; } ;
/* Variables and functions */
int /*<<< orphan*/ KEG_UNLOCK (TYPE_3__*) ;
int M_NOWAIT ;
int M_WAITOK ;
int UMA_ZONE_NUMA ;
int howmany (int,int) ;
void* slab_alloc_item (TYPE_3__*,TYPE_2__*) ;
int vm_ndomains ;
TYPE_2__* zone_fetch_slab (TYPE_1__*,TYPE_3__*,int,int) ;
__attribute__((used)) static int
zone_import(uma_zone_t zone, void **bucket, int max, int domain, int flags)
{
uma_slab_t slab;
uma_keg_t keg;
#ifdef NUMA
int stripe;
#endif
int i;
slab = NULL;
keg = NULL;
/* Try to keep the buckets totally full */
for (i = 0; i <= max; ) {
if ((slab = zone_fetch_slab(zone, keg, domain, flags)) != NULL)
break;
keg = slab->us_keg;
#ifdef NUMA
stripe = howmany(max, vm_ndomains);
#endif
while (slab->us_freecount || i < max) {
bucket[i++] = slab_alloc_item(keg, slab);
if (keg->uk_free <= keg->uk_reserve)
break;
#ifdef NUMA
/*
* If the zone is striped we pick a new slab for every
* N allocations. Eliminating this conditional will
* instead pick a new domain for each bucket rather
* than stripe within each bucket. The current option
* produces more fragmentation and requires more cpu
* time but yields better distribution.
*/
if ((zone->uz_flags | UMA_ZONE_NUMA) == 0 &&
vm_ndomains > 1 && --stripe == 0)
break;
#endif
}
/* Don't block if we allocated any successfully. */
flags &= ~M_WAITOK;
flags |= M_NOWAIT;
}
if (slab != NULL)
KEG_UNLOCK(keg);
return i;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.