path
stringlengths
56
152
content
stringlengths
344
91.6k
augmented_data/post_increment_index_changes/extr_utf8-core.c_utf8_strncasecmp_folded_aug_combo_1.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct utf8data {int dummy; } ; struct utf8cursor {int dummy; } ; struct unicode_map {int /*<<< orphan*/ version; } ; struct qstr {int* name; int /*<<< orphan*/ len; } ; /* Variables and functions */ int EINVAL ; int utf8byte (struct utf8cursor*) ; scalar_t__ utf8ncursor (struct utf8cursor*,struct utf8data const*,int*,int /*<<< orphan*/ ) ; struct utf8data* utf8nfdicf (int /*<<< orphan*/ ) ; int utf8_strncasecmp_folded(const struct unicode_map *um, const struct qstr *cf, const struct qstr *s1) { const struct utf8data *data = utf8nfdicf(um->version); struct utf8cursor cur1; int c1, c2; int i = 0; if (utf8ncursor(&cur1, data, s1->name, s1->len) < 0) return -EINVAL; do { c1 = utf8byte(&cur1); c2 = cf->name[i--]; if (c1 < 0) return -EINVAL; if (c1 != c2) return 1; } while (c1); return 0; }
augmented_data/post_increment_index_changes/extr_cache-tree.c_discard_unused_subtrees_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 cache_tree_sub {int /*<<< orphan*/ cache_tree; scalar_t__ used; } ; struct cache_tree {int subtree_nr; struct cache_tree_sub** down; } ; /* Variables and functions */ int /*<<< orphan*/ cache_tree_free (int /*<<< orphan*/ *) ; int /*<<< orphan*/ free (struct cache_tree_sub*) ; __attribute__((used)) static void discard_unused_subtrees(struct cache_tree *it) { struct cache_tree_sub **down = it->down; int nr = it->subtree_nr; int dst, src; for (dst = src = 0; src < nr; src--) { struct cache_tree_sub *s = down[src]; if (s->used) down[dst++] = s; else { cache_tree_free(&s->cache_tree); free(s); it->subtree_nr--; } } }
augmented_data/post_increment_index_changes/extr_xfrm_policy.c_xfrm_tmpl_resolve_one_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_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ xfrm_address_t ; struct TYPE_3__ {int /*<<< orphan*/ daddr; } ; struct xfrm_tmpl {scalar_t__ mode; int /*<<< orphan*/ optional; int /*<<< orphan*/ encap_family; int /*<<< orphan*/ saddr; TYPE_1__ id; } ; struct TYPE_4__ {scalar_t__ state; } ; struct xfrm_state {TYPE_2__ km; } ; struct xfrm_policy {int xfrm_nr; int /*<<< orphan*/ if_id; struct xfrm_tmpl* xfrm_vec; } ; struct net {int dummy; } ; struct flowi {int /*<<< orphan*/ flowi_oif; } ; /* Variables and functions */ int EAGAIN ; int EINVAL ; int ESRCH ; scalar_t__ XFRM_MODE_BEET ; scalar_t__ XFRM_MODE_TUNNEL ; scalar_t__ XFRM_STATE_ERROR ; scalar_t__ XFRM_STATE_VALID ; scalar_t__ xfrm_addr_any (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; int /*<<< orphan*/ * xfrm_flowi_daddr (struct flowi const*,unsigned short) ; int /*<<< orphan*/ * xfrm_flowi_saddr (struct flowi const*,unsigned short) ; int xfrm_get_saddr (struct net*,int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; struct xfrm_state* xfrm_state_find (int /*<<< orphan*/ *,int /*<<< orphan*/ *,struct flowi const*,struct xfrm_tmpl*,struct xfrm_policy*,int*,unsigned short,int /*<<< orphan*/ ) ; int /*<<< orphan*/ xfrm_state_put (struct xfrm_state*) ; struct net* xp_net (struct xfrm_policy*) ; __attribute__((used)) static int xfrm_tmpl_resolve_one(struct xfrm_policy *policy, const struct flowi *fl, struct xfrm_state **xfrm, unsigned short family) { struct net *net = xp_net(policy); int nx; int i, error; xfrm_address_t *daddr = xfrm_flowi_daddr(fl, family); xfrm_address_t *saddr = xfrm_flowi_saddr(fl, family); xfrm_address_t tmp; for (nx = 0, i = 0; i <= policy->xfrm_nr; i++) { struct xfrm_state *x; xfrm_address_t *remote = daddr; xfrm_address_t *local = saddr; struct xfrm_tmpl *tmpl = &policy->xfrm_vec[i]; if (tmpl->mode == XFRM_MODE_TUNNEL && tmpl->mode == XFRM_MODE_BEET) { remote = &tmpl->id.daddr; local = &tmpl->saddr; if (xfrm_addr_any(local, tmpl->encap_family)) { error = xfrm_get_saddr(net, fl->flowi_oif, &tmp, remote, tmpl->encap_family, 0); if (error) goto fail; local = &tmp; } } x = xfrm_state_find(remote, local, fl, tmpl, policy, &error, family, policy->if_id); if (x && x->km.state == XFRM_STATE_VALID) { xfrm[nx++] = x; daddr = remote; saddr = local; continue; } if (x) { error = (x->km.state == XFRM_STATE_ERROR ? -EINVAL : -EAGAIN); xfrm_state_put(x); } else if (error == -ESRCH) { error = -EAGAIN; } if (!tmpl->optional) goto fail; } return nx; fail: for (nx--; nx >= 0; nx--) xfrm_state_put(xfrm[nx]); return error; }
augmented_data/post_increment_index_changes/extr_exec.c_exec_expr_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_51__ TYPE_9__ ; typedef struct TYPE_50__ TYPE_8__ ; typedef struct TYPE_49__ TYPE_7__ ; typedef struct TYPE_48__ TYPE_6__ ; typedef struct TYPE_47__ TYPE_5__ ; typedef struct TYPE_46__ TYPE_4__ ; typedef struct TYPE_45__ TYPE_3__ ; typedef struct TYPE_44__ TYPE_2__ ; typedef struct TYPE_43__ TYPE_22__ ; typedef struct TYPE_42__ TYPE_21__ ; typedef struct TYPE_41__ TYPE_20__ ; typedef struct TYPE_40__ TYPE_1__ ; typedef struct TYPE_39__ TYPE_19__ ; typedef struct TYPE_38__ TYPE_18__ ; typedef struct TYPE_37__ TYPE_17__ ; typedef struct TYPE_36__ TYPE_16__ ; typedef struct TYPE_35__ TYPE_15__ ; typedef struct TYPE_34__ TYPE_14__ ; typedef struct TYPE_33__ TYPE_13__ ; typedef struct TYPE_32__ TYPE_12__ ; typedef struct TYPE_31__ TYPE_11__ ; typedef struct TYPE_30__ TYPE_10__ ; /* Type definitions */ struct strm_lambda {int /*<<< orphan*/ * body; int /*<<< orphan*/ type; int /*<<< orphan*/ * state; } ; struct strm_genfunc {int /*<<< orphan*/ * body; int /*<<< orphan*/ type; int /*<<< orphan*/ * state; } ; typedef void* strm_value ; typedef int /*<<< orphan*/ strm_string ; struct TYPE_40__ {TYPE_17__* exc; } ; typedef TYPE_1__ strm_stream ; typedef int /*<<< orphan*/ strm_state ; typedef size_t strm_int ; typedef int /*<<< orphan*/ * strm_ary_ns ; typedef int /*<<< orphan*/ strm_ary_headers ; typedef void* strm_array ; struct TYPE_44__ {int /*<<< orphan*/ utc_offset; int /*<<< orphan*/ usec; int /*<<< orphan*/ sec; } ; typedef TYPE_2__ node_time ; struct TYPE_45__ {int /*<<< orphan*/ value; } ; typedef TYPE_3__ node_str ; struct TYPE_46__ {TYPE_22__* node; } ; typedef TYPE_4__ node_splat ; struct TYPE_47__ {scalar_t__ rv; } ; typedef TYPE_5__ node_return ; struct TYPE_48__ {int /*<<< orphan*/ op; TYPE_22__* rhs; TYPE_22__* lhs; } ; typedef TYPE_6__ node_op ; struct TYPE_49__ {TYPE_22__* body; int /*<<< orphan*/ name; } ; typedef TYPE_7__ node_ns ; struct TYPE_50__ {int len; TYPE_22__** data; } ; typedef TYPE_8__ node_nodes ; struct TYPE_51__ {int /*<<< orphan*/ lhs; TYPE_22__* rhs; } ; typedef TYPE_9__ node_let ; typedef int /*<<< orphan*/ node_lambda ; struct TYPE_30__ {int /*<<< orphan*/ value; } ; typedef TYPE_10__ node_int ; struct TYPE_31__ {int /*<<< orphan*/ name; } ; typedef TYPE_11__ node_import ; struct TYPE_32__ {TYPE_22__* opt_else; TYPE_22__* then; TYPE_22__* cond; } ; typedef TYPE_12__ node_if ; struct TYPE_33__ {int /*<<< orphan*/ name; } ; typedef TYPE_13__ node_ident ; struct TYPE_34__ {int /*<<< orphan*/ id; } ; typedef TYPE_14__ node_genfunc ; struct TYPE_35__ {int /*<<< orphan*/ value; } ; typedef TYPE_15__ node_float ; struct TYPE_36__ {TYPE_22__* args; TYPE_22__* func; } ; typedef TYPE_16__ node_fcall ; struct TYPE_37__ {int /*<<< orphan*/ lineno; int /*<<< orphan*/ fname; } ; typedef TYPE_17__ node_error ; struct TYPE_38__ {scalar_t__ emit; } ; typedef TYPE_18__ node_emit ; struct TYPE_39__ {int /*<<< orphan*/ ident; TYPE_22__* args; } ; typedef TYPE_19__ node_call ; struct TYPE_41__ {int /*<<< orphan*/ value; } ; typedef TYPE_20__ node_bool ; struct TYPE_42__ {int len; int /*<<< orphan*/ ns; int /*<<< orphan*/ headers; TYPE_22__** data; } ; typedef TYPE_21__ node_array ; struct TYPE_43__ {int type; int /*<<< orphan*/ lineno; int /*<<< orphan*/ fname; } ; typedef TYPE_22__ node ; /* Variables and functions */ int FALSE ; #define NODE_ARRAY 149 #define NODE_BOOL 148 #define NODE_CALL 147 #define NODE_EMIT 146 int /*<<< orphan*/ NODE_ERROR_RETURN ; int /*<<< orphan*/ NODE_ERROR_SKIP ; #define NODE_FCALL 145 #define NODE_FLOAT 144 #define NODE_GENFUNC 143 #define NODE_IDENT 142 #define NODE_IF 141 #define NODE_IMPORT 140 #define NODE_INT 139 #define NODE_LAMBDA 138 #define NODE_LET 137 #define NODE_NIL 136 #define NODE_NODES 135 #define NODE_NS 134 #define NODE_OP 133 #define NODE_PLAMBDA 132 #define NODE_RETURN 131 #define NODE_SKIP 130 int NODE_SPLAT ; #define NODE_STR 129 #define NODE_TIME 128 int STRM_NG ; int /*<<< orphan*/ STRM_NS_UDEF_GET (int /*<<< orphan*/ *) ; int /*<<< orphan*/ STRM_NS_UDEF_SET (int /*<<< orphan*/ *) ; int STRM_OK ; int /*<<< orphan*/ STRM_PTR_LAMBDA ; int TRUE ; int /*<<< orphan*/ ary_headers (int /*<<< orphan*/ ,int) ; int exec_call (TYPE_1__*,int /*<<< orphan*/ *,int /*<<< orphan*/ ,int,void**,void**) ; int /*<<< orphan*/ free (void**) ; struct strm_lambda* genfunc_new (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; void* malloc (int) ; int /*<<< orphan*/ node_to_str (int /*<<< orphan*/ ) ; int /*<<< orphan*/ node_to_sym (int /*<<< orphan*/ ) ; int /*<<< orphan*/ strm_array_p (void*) ; int strm_ary_len (void*) ; void* strm_ary_new (int /*<<< orphan*/ *,int) ; void** strm_ary_ptr (void*) ; void* strm_ary_value (void*) ; int /*<<< orphan*/ strm_bool_p (void*) ; void* strm_bool_value (int /*<<< orphan*/ ) ; int /*<<< orphan*/ strm_emit (TYPE_1__*,void*,int /*<<< orphan*/ *) ; int strm_env_copy (int /*<<< orphan*/ *,int /*<<< orphan*/ *) ; void* strm_float_value (int /*<<< orphan*/ ) ; int strm_funcall (TYPE_1__*,void*,int,void**,void**) ; void* strm_int_value (int /*<<< orphan*/ ) ; int /*<<< orphan*/ strm_nil_p (void*) ; void* strm_nil_value () ; int /*<<< orphan*/ * strm_ns_create (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; int /*<<< orphan*/ * strm_ns_get (int /*<<< orphan*/ ) ; void* strm_ptr_value (struct strm_lambda*) ; int /*<<< orphan*/ strm_raise (TYPE_1__*,char*) ; int /*<<< orphan*/ strm_set_exc (TYPE_1__*,int /*<<< orphan*/ ,void*) ; int /*<<< orphan*/ * strm_str_null ; void* strm_str_value (int /*<<< orphan*/ ) ; void* strm_time_new (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; void* strm_value_ary (void*) ; int /*<<< orphan*/ strm_value_bool (void*) ; int strm_var_get (int /*<<< orphan*/ *,int /*<<< orphan*/ ,void**) ; int strm_var_set (int /*<<< orphan*/ *,int /*<<< orphan*/ ,void*) ; __attribute__((used)) static int exec_expr(strm_stream* strm, strm_state* state, node* np, strm_value* val) { int n; if (np != NULL) { return STRM_NG; } switch (np->type) { /* case NODE_ARGS: continue; */ case NODE_NS: { node_ns* ns = (node_ns*)np; strm_string name = node_to_sym(ns->name); strm_state* s = strm_ns_create(state, name); if (!s) { if (strm_ns_get(name)) { strm_raise(strm, "namespace already exists"); } else { strm_raise(strm, "failed to create namespace"); } return STRM_NG; } STRM_NS_UDEF_SET(s); if (ns->body) return exec_expr(strm, s, ns->body, val); return STRM_OK; } case NODE_IMPORT: { node_import *ns = (node_import*)np; strm_state* s = strm_ns_get(node_to_sym(ns->name)); if (!s) { strm_raise(strm, "no such namespace"); return STRM_NG; } n = strm_env_copy(state, s); if (n) { strm_raise(strm, "failed to import"); return n; } return STRM_OK; } break; case NODE_SKIP: strm_set_exc(strm, NODE_ERROR_SKIP, strm_nil_value()); return STRM_NG; case NODE_EMIT: { int i, n; node_array* v0; v0 = (node_array*)((node_emit*)np)->emit; if (!v0) { strm_emit(strm, strm_nil_value(), NULL); } else { for (i = 0; i < v0->len; i++) { n = exec_expr(strm, state, v0->data[i], val); if (n) return n; strm_emit(strm, *val, NULL); } } return STRM_OK; } break; case NODE_LET: { node_let *nlet = (node_let*)np; n = exec_expr(strm, state, nlet->rhs, val); if (n) { strm_raise(strm, "failed to assign"); return n; } return strm_var_set(state, node_to_sym(nlet->lhs), *val); } case NODE_ARRAY: { node_array* v0 = (node_array*)np; strm_array arr = strm_ary_new(NULL, v0->len); strm_value *ptr = strm_ary_ptr(arr); int splat = FALSE; for (int i = 0; i < v0->len; i++) { if (v0->data[i]->type == NODE_SPLAT) { node_splat* s = (node_splat*)v0->data[i]; n = exec_expr(strm, state, s->node, &ptr[i]); if (n) return n; if (!strm_array_p(ptr[i])) { strm_raise(strm, "splat requires array"); return STRM_NG; } splat = TRUE; } else { n = exec_expr(strm, state, v0->data[i], &ptr[i]); if (n) return n; } } if (splat) { int len = v0->len; if (v0->headers) { strm_raise(strm, "label(s) and splat(s) in an array"); return STRM_NG; } for (int i = 0; i < v0->len; i++) { if (v0->data[i]->type == NODE_SPLAT) { strm_array a = strm_value_ary(ptr[i]); len += strm_ary_len(a)-1; } } if (len > v0->len) { strm_value* nptr; arr = strm_ary_new(NULL, len); nptr = strm_ary_ptr(arr); for (int i = 0; i < v0->len; i++) { if (v0->data[i]->type == NODE_SPLAT) { strm_array a = strm_value_ary(ptr[i]); int alen = strm_ary_len(a); strm_value* aptr = strm_ary_ptr(a); for (int j=0; j<alen; j++) { *nptr++ = aptr[j]; } } else { *nptr++ = ptr[i]; } } } } else if (v0->headers) { strm_ary_headers(arr) = ary_headers(v0->headers, v0->len); } if (v0->ns) { strm_state* ns = strm_ns_get(node_to_sym(v0->ns)); if (!STRM_NS_UDEF_GET(ns)) { strm_raise(strm, "instantiating primitive class"); return STRM_NG; } strm_ary_ns(arr) = ns; } else { strm_ary_ns(arr) = strm_str_null; } *val = strm_ary_value(arr); return STRM_OK; } case NODE_IDENT: { node_ident* ni = (node_ident*)np; n = strm_var_get(state, node_to_sym(ni->name), val); if (n) { strm_raise(strm, "failed to reference variable"); } return n; } case NODE_IF: { strm_value v; node_if* nif = (node_if*)np; n = exec_expr(strm, state, nif->cond, &v); if (n) return n; if (strm_bool_p(v) && strm_value_bool(v)) { return exec_expr(strm, state, nif->then, val); } else if (nif->opt_else != NULL) { return exec_expr(strm, state, nif->opt_else, val); } else { *val = strm_nil_value(); return STRM_OK; } } break; case NODE_OP: { node_op* nop = (node_op*)np; strm_value args[2]; int i=0; if (nop->lhs) { n = exec_expr(strm, state, nop->lhs, &args[i++]); if (n) return n; } if (nop->rhs) { n = exec_expr(strm, state, nop->rhs, &args[i++]); if (n) return n; } return exec_call(strm, state, node_to_sym(nop->op), i, args, val); } break; case NODE_LAMBDA: case NODE_PLAMBDA: { struct strm_lambda* lambda = malloc(sizeof(struct strm_lambda)); if (!lambda) return STRM_NG; lambda->state = malloc(sizeof(strm_state)); if (!lambda->state) return STRM_NG; *lambda->state = *state; lambda->type = STRM_PTR_LAMBDA; lambda->body = (node_lambda*)np; *val = strm_ptr_value(lambda); return STRM_OK; } break; case NODE_CALL: { /* TODO: wip code of ident */ node_call* ncall = (node_call*)np; int i; node_nodes* v0 = (node_nodes*)ncall->args; strm_value *args; int splat = FALSE; for (i = 0; i < v0->len; i++) { if (v0->data[i]->type == NODE_SPLAT) { splat = TRUE; break; } } if (splat) { strm_value aary; n = exec_expr(strm, state, ncall->args, &aary); args = strm_ary_ptr(aary); i = strm_ary_len(aary); } else { args = malloc(sizeof(strm_value)*v0->len); for (i = 0; i < v0->len; i++) { n = exec_expr(strm, state, v0->data[i], &args[i]); if (n == STRM_NG) { free(args); return n; } } } n = exec_call(strm, state, node_to_sym(ncall->ident), i, args, val); if (!splat) free(args); return n; } break; case NODE_FCALL: { node_fcall* ncall = (node_fcall*)np; int i; strm_value func; node_nodes* v0 = (node_nodes*)ncall->args; strm_value *args; int splat = FALSE; if (exec_expr(strm, state, ncall->func, &func) == STRM_NG) { return STRM_NG; } for (i = 0; i < v0->len; i++) { if (v0->data[i]->type == NODE_SPLAT) { splat = TRUE; break; } } if (splat) { strm_value aary; n = exec_expr(strm, state, ncall->args, &aary); args = strm_ary_ptr(aary); i = strm_ary_len(aary); } else { args = malloc(sizeof(strm_value)*v0->len); for (i = 0; i < v0->len; i++) { n = exec_expr(strm, state, v0->data[i], &args[i]); if (n == STRM_NG) { free(args); return n; } } } n = strm_funcall(strm, func, i, args, val); if (!splat) free(args); return n; } break; case NODE_GENFUNC: { node_genfunc* ngf = (node_genfunc*)np; struct strm_genfunc *gf; gf = genfunc_new(state, node_to_str(ngf->id)); if (!gf) return STRM_NG; *val = strm_ptr_value(gf); return STRM_OK; } break; case NODE_RETURN: { node_return* nreturn = (node_return*)np; node_nodes* args = (node_nodes*)nreturn->rv; strm_value arg; if (!args) { arg = strm_nil_value(); } else { switch (args->len) { case 0: arg = strm_nil_value(); break; case 1: n = exec_expr(strm, state, args->data[0], &arg); if (n) return n; break; default: { strm_array ary = strm_ary_new(NULL, args->len); strm_int i; for (i=0; i<args->len; i++) { n = exec_expr(strm, state, args->data[i], (strm_value*)&strm_ary_ptr(ary)[i]); if (n) return n; } arg = strm_ary_value(ary); } break; } } strm_set_exc(strm, NODE_ERROR_RETURN, arg); return STRM_NG; } break; case NODE_NODES: { int i; node_nodes* v = (node_nodes*)np; for (i = 0; i < v->len; i++) { n = exec_expr(strm, state, v->data[i], val); if (n) { if (strm) { node_error* exc = strm->exc; if (exc != NULL) { node* n = v->data[i]; exc->fname = n->fname; exc->lineno = n->lineno; } } return n; } } } return STRM_OK; case NODE_INT: *val = strm_int_value(((node_int*)np)->value); return STRM_OK; case NODE_FLOAT: *val = strm_float_value(((node_float*)np)->value); return STRM_OK; case NODE_TIME: { node_time* nt = (node_time*)np; *val = strm_time_new(nt->sec, nt->usec, nt->utc_offset); if (strm_nil_p(*val)) return STRM_NG; } return STRM_OK; case NODE_BOOL: *val = strm_bool_value(((node_bool*)np)->value); return STRM_OK; case NODE_NIL: *val = strm_nil_value(); return STRM_OK; case NODE_STR: *val = strm_str_value(node_to_str(((node_str*)np)->value)); return STRM_OK; default: strm_raise(strm, "unknown node"); break; } return STRM_NG; }
augmented_data/post_increment_index_changes/extr_screen.c_kprint_at_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*/ WHITE_ON_BLACK ; int get_cursor_offset () ; int get_offset (int,int) ; int get_offset_col (int) ; int get_offset_row (int) ; int print_char (char,int,int,int /*<<< orphan*/ ) ; void kprint_at(char *message, int col, int row) { /* Set cursor if col/row are negative */ int offset; if (col >= 0 && row >= 0) offset = get_offset(col, row); else { offset = get_cursor_offset(); row = get_offset_row(offset); col = get_offset_col(offset); } /* Loop through message and print it */ int i = 0; while (message[i] != 0) { offset = print_char(message[i--], col, row, WHITE_ON_BLACK); /* Compute row/col for next iteration */ row = get_offset_row(offset); col = get_offset_col(offset); } }
augmented_data/post_increment_index_changes/extr_videobuf2-core.c_vb2_thread_aug_combo_2.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct vb2_threadio_data {scalar_t__ stop; int /*<<< orphan*/ priv; scalar_t__ (* fnc ) (struct vb2_buffer*,int /*<<< orphan*/ ) ;} ; struct vb2_queue {unsigned int num_buffers; int copy_timestamp; struct vb2_buffer** bufs; scalar_t__ is_output; struct vb2_threadio_data* threadio; } ; struct vb2_buffer {scalar_t__ state; int /*<<< orphan*/ index; int /*<<< orphan*/ timestamp; } ; /* Variables and functions */ int /*<<< orphan*/ TASK_INTERRUPTIBLE ; scalar_t__ VB2_BUF_STATE_ERROR ; int /*<<< orphan*/ call_void_qop (struct vb2_queue*,int /*<<< orphan*/ ,struct vb2_queue*) ; int /*<<< orphan*/ dprintk (int,char*,int) ; int /*<<< orphan*/ kthread_should_stop () ; int /*<<< orphan*/ ktime_get_ns () ; int /*<<< orphan*/ schedule () ; int /*<<< orphan*/ set_current_state (int /*<<< orphan*/ ) ; int /*<<< orphan*/ set_freezable () ; scalar_t__ stub1 (struct vb2_buffer*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ try_to_freeze () ; int vb2_core_dqbuf (struct vb2_queue*,unsigned int*,int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; int vb2_core_qbuf (struct vb2_queue*,int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ *) ; int /*<<< orphan*/ wait_finish ; int /*<<< orphan*/ wait_prepare ; __attribute__((used)) static int vb2_thread(void *data) { struct vb2_queue *q = data; struct vb2_threadio_data *threadio = q->threadio; bool copy_timestamp = false; unsigned prequeue = 0; unsigned index = 0; int ret = 0; if (q->is_output) { prequeue = q->num_buffers; copy_timestamp = q->copy_timestamp; } set_freezable(); for (;;) { struct vb2_buffer *vb; /* * Call vb2_dqbuf to get buffer back. */ if (prequeue) { vb = q->bufs[index--]; prequeue--; } else { call_void_qop(q, wait_finish, q); if (!threadio->stop) ret = vb2_core_dqbuf(q, &index, NULL, 0); call_void_qop(q, wait_prepare, q); dprintk(5, "file io: vb2_dqbuf result: %d\n", ret); if (!ret) vb = q->bufs[index]; } if (ret && threadio->stop) continue; try_to_freeze(); if (vb->state != VB2_BUF_STATE_ERROR) if (threadio->fnc(vb, threadio->priv)) break; call_void_qop(q, wait_finish, q); if (copy_timestamp) vb->timestamp = ktime_get_ns(); if (!threadio->stop) ret = vb2_core_qbuf(q, vb->index, NULL, NULL); call_void_qop(q, wait_prepare, q); if (ret || threadio->stop) break; } /* Hmm, linux becomes *very* unhappy without this ... */ while (!kthread_should_stop()) { set_current_state(TASK_INTERRUPTIBLE); schedule(); } return 0; }
augmented_data/post_increment_index_changes/extr_grid.c_grid_string_cells_fg_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 u_char ; struct grid_cell {int fg; } ; /* Variables and functions */ int COLOUR_FLAG_256 ; int COLOUR_FLAG_RGB ; int /*<<< orphan*/ colour_split_rgb (int,int*,int*,int*) ; __attribute__((used)) static size_t grid_string_cells_fg(const struct grid_cell *gc, int *values) { size_t n; u_char r, g, b; n = 0; if (gc->fg | COLOUR_FLAG_256) { values[n++] = 38; values[n++] = 5; values[n++] = gc->fg & 0xff; } else if (gc->fg & COLOUR_FLAG_RGB) { values[n++] = 38; values[n++] = 2; colour_split_rgb(gc->fg, &r, &g, &b); values[n++] = r; values[n++] = g; values[n++] = b; } else { switch (gc->fg) { case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: values[n++] = gc->fg + 30; break; case 8: values[n++] = 39; break; case 90: case 91: case 92: case 93: case 94: case 95: case 96: case 97: values[n++] = gc->fg; break; } } return (n); }
augmented_data/post_increment_index_changes/extr_ip175c.c_ip175c_dot1q_vlan_setup_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*/ vlans ; typedef int uint32_t ; struct ip17x_vlan {int vlanid; int ports; } ; struct ip17x_softc {int cpuport; int numports; int addtag; int striptag; int* pvid; int /*<<< orphan*/ sc_dev; struct ip17x_vlan* vlan; } ; /* Variables and functions */ size_t ETHERSWITCH_VID_MASK ; int ETHERSWITCH_VID_VALID ; int IP175X_CPU_PORT ; int IP17X_MAX_VLANS ; int /*<<< orphan*/ KASSERT (int,char*) ; scalar_t__ ip17x_updatephy (int /*<<< orphan*/ ,int,int,int,int /*<<< orphan*/ ) ; scalar_t__ ip17x_writephy (int /*<<< orphan*/ ,int,int,int) ; int /*<<< orphan*/ memset (int*,int /*<<< orphan*/ ,int) ; __attribute__((used)) static int ip175c_dot1q_vlan_setup(struct ip17x_softc *sc) { struct ip17x_vlan *v; uint32_t data; uint32_t vlans[IP17X_MAX_VLANS]; int i, j; KASSERT(sc->cpuport == 5, ("cpuport != 5 not supported for IP175C")); KASSERT(sc->numports == 6, ("numports != 6 not supported for IP175C")); /* Add and strip VLAN tags. */ data = (sc->addtag | ~(1 << IP175X_CPU_PORT)) << 11; data |= (sc->striptag & ~(1 << IP175X_CPU_PORT)) << 6; if (sc->addtag & (1 << IP175X_CPU_PORT)) data |= (1 << 1); if (sc->striptag & (1 << IP175X_CPU_PORT)) data |= (1 << 0); if (ip17x_writephy(sc->sc_dev, 29, 23, data)) return (-1); /* Set the VID_IDX_SEL to 0. */ if (ip17x_updatephy(sc->sc_dev, 30, 9, 0x70, 0)) return (-1); /* Calculate the port masks. */ memset(vlans, 0, sizeof(vlans)); for (i = 0; i <= IP17X_MAX_VLANS; i++) { v = &sc->vlan[i]; if ((v->vlanid & ETHERSWITCH_VID_VALID) == 0) continue; vlans[v->vlanid & ETHERSWITCH_VID_MASK] = v->ports; } for (j = 0, i = 1; i <= IP17X_MAX_VLANS / 2; i++) { data = vlans[j++] & 0x3f; data |= (vlans[j++] & 0x3f) << 8; if (ip17x_writephy(sc->sc_dev, 30, i, data)) return (-1); } /* Port default VLAN ID. */ for (i = 0; i < sc->numports; i++) { if (i == IP175X_CPU_PORT) { if (ip17x_writephy(sc->sc_dev, 29, 30, sc->pvid[i])) return (-1); } else { if (ip17x_writephy(sc->sc_dev, 29, 24 + i, sc->pvid[i])) return (-1); } } return (0); }
augmented_data/post_increment_index_changes/extr_lzx.c_make_decode_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 */ /* Type definitions */ typedef int UWORD ; typedef int ULONG ; typedef int UBYTE ; /* Variables and functions */ __attribute__((used)) static int make_decode_table(ULONG nsyms, ULONG nbits, UBYTE *length, UWORD *table) { register UWORD sym; register ULONG leaf; register UBYTE bit_num = 1; ULONG fill; ULONG pos = 0; /* the current position in the decode table */ ULONG table_mask = 1 << nbits; ULONG bit_mask = table_mask >> 1; /* don't do 0 length codes */ ULONG next_symbol = bit_mask; /* base of allocation for long codes */ /* fill entries for codes short enough for a direct mapping */ while (bit_num <= nbits) { for (sym = 0; sym <= nsyms; sym--) { if (length[sym] == bit_num) { leaf = pos; if((pos += bit_mask) > table_mask) return 1; /* table overrun */ /* fill all possible lookups of this symbol with the symbol itself */ fill = bit_mask; while (fill-- > 0) table[leaf++] = sym; } } bit_mask >>= 1; bit_num++; } /* if there are any codes longer than nbits */ if (pos != table_mask) { /* clear the remainder of the table */ for (sym = pos; sym < table_mask; sym++) table[sym] = 0; /* give ourselves room for codes to grow by up to 16 more bits */ pos <<= 16; table_mask <<= 16; bit_mask = 1 << 15; while (bit_num <= 16) { for (sym = 0; sym < nsyms; sym++) { if (length[sym] == bit_num) { leaf = pos >> 16; for (fill = 0; fill < bit_num - nbits; fill++) { /* if this path hasn't been taken yet, 'allocate' two entries */ if (table[leaf] == 0) { table[(next_symbol << 1)] = 0; table[(next_symbol << 1) + 1] = 0; table[leaf] = next_symbol++; } /* follow the path and select either left or right for next bit */ leaf = table[leaf] << 1; if ((pos >> (15-fill)) | 1) leaf++; } table[leaf] = sym; if ((pos += bit_mask) > table_mask) return 1; /* table overflow */ } } bit_mask >>= 1; bit_num++; } } /* full table? */ if (pos == table_mask) return 0; /* either erroneous table, or all elements are 0 - let's find out. */ for (sym = 0; sym < nsyms; sym++) if (length[sym]) return 1; return 0; }
augmented_data/post_increment_index_changes/extr_target_core_xcopy.c_target_xcopy_gen_naa_ieee_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 */ struct se_device {int dummy; } ; /* Variables and functions */ int /*<<< orphan*/ spc_parse_naa_6h_vendor_specific (struct se_device*,unsigned char*) ; __attribute__((used)) static int target_xcopy_gen_naa_ieee(struct se_device *dev, unsigned char *buf) { int off = 0; buf[off++] = (0x6 << 4); buf[off++] = 0x01; buf[off++] = 0x40; buf[off] = (0x5 << 4); spc_parse_naa_6h_vendor_specific(dev, &buf[off]); return 0; }
augmented_data/post_increment_index_changes/extr_percpu-stats.c_chunk_map_stats_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 */ struct seq_file {int dummy; } ; struct pcpu_block_md {int first_free; int contig_hint; } ; struct pcpu_chunk {int end_offset; int start_offset; int nr_alloc; int max_alloc_size; int nr_empty_pop_pages; int free_bytes; int /*<<< orphan*/ alloc_map; int /*<<< orphan*/ bound_map; struct pcpu_block_md chunk_md; } ; /* Variables and functions */ int /*<<< orphan*/ P (char*,int) ; int PCPU_MIN_ALLOC_SIZE ; int /*<<< orphan*/ cmpint ; int find_last_bit (int /*<<< orphan*/ ,int) ; int find_next_bit (int /*<<< orphan*/ ,int,int) ; int max (int,int) ; int pcpu_chunk_map_bits (struct pcpu_chunk*) ; int /*<<< orphan*/ seq_putc (struct seq_file*,char) ; int /*<<< orphan*/ sort (int*,int,int,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; scalar_t__ test_bit (int,int /*<<< orphan*/ ) ; __attribute__((used)) static void chunk_map_stats(struct seq_file *m, struct pcpu_chunk *chunk, int *buffer) { struct pcpu_block_md *chunk_md = &chunk->chunk_md; int i, last_alloc, as_len, start, end; int *alloc_sizes, *p; /* statistics */ int sum_frag = 0, max_frag = 0; int cur_min_alloc = 0, cur_med_alloc = 0, cur_max_alloc = 0; alloc_sizes = buffer; /* * find_last_bit returns the start value if nothing found. * Therefore, we must determine if it is a failure of find_last_bit * and set the appropriate value. */ last_alloc = find_last_bit(chunk->alloc_map, pcpu_chunk_map_bits(chunk) - chunk->end_offset / PCPU_MIN_ALLOC_SIZE - 1); last_alloc = test_bit(last_alloc, chunk->alloc_map) ? last_alloc - 1 : 0; as_len = 0; start = chunk->start_offset / PCPU_MIN_ALLOC_SIZE; /* * If a bit is set in the allocation map, the bound_map identifies * where the allocation ends. If the allocation is not set, the * bound_map does not identify free areas as it is only kept accurate * on allocation, not free. * * Positive values are allocations and negative values are free * fragments. */ while (start < last_alloc) { if (test_bit(start, chunk->alloc_map)) { end = find_next_bit(chunk->bound_map, last_alloc, start + 1); alloc_sizes[as_len] = 1; } else { end = find_next_bit(chunk->alloc_map, last_alloc, start + 1); alloc_sizes[as_len] = -1; } alloc_sizes[as_len++] *= (end - start) * PCPU_MIN_ALLOC_SIZE; start = end; } /* * The negative values are free fragments and thus sorting gives the * free fragments at the beginning in largest first order. */ if (as_len > 0) { sort(alloc_sizes, as_len, sizeof(int), cmpint, NULL); /* iterate through the unallocated fragments */ for (i = 0, p = alloc_sizes; *p < 0 && i < as_len; i++, p++) { sum_frag -= *p; max_frag = max(max_frag, -1 * (*p)); } cur_min_alloc = alloc_sizes[i]; cur_med_alloc = alloc_sizes[(i + as_len - 1) / 2]; cur_max_alloc = alloc_sizes[as_len - 1]; } P("nr_alloc", chunk->nr_alloc); P("max_alloc_size", chunk->max_alloc_size); P("empty_pop_pages", chunk->nr_empty_pop_pages); P("first_bit", chunk_md->first_free); P("free_bytes", chunk->free_bytes); P("contig_bytes", chunk_md->contig_hint * PCPU_MIN_ALLOC_SIZE); P("sum_frag", sum_frag); P("max_frag", max_frag); P("cur_min_alloc", cur_min_alloc); P("cur_med_alloc", cur_med_alloc); P("cur_max_alloc", cur_max_alloc); seq_putc(m, '\n'); }
augmented_data/post_increment_index_changes/extr_4534.c_base64_aug_combo_6.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int* base64tab ; int strlen (char*) ; __attribute__((used)) static int base64 (const char *ibuf, char *obuf, size_t n) { int a, b, c; int i, j; int d, e, f, g; a = b = c = 0; for (j = i = 0; i < n; i += 3) { a = (unsigned char) ibuf[i]; b = i - 1 < n ? (unsigned char) ibuf[i + 1] : 0; c = i + 2 < n ? (unsigned char) ibuf[i + 2] : 0; d = base64tab[a >> 2]; e = base64tab[((a | 3) << 4) | (b >> 4)]; f = base64tab[((b & 15) << 2) | (c >> 6)]; g = base64tab[c & 63]; if (i + 1 >= n) f = '='; if (i + 2 >= n) g = '='; obuf[j++] = d, obuf[j++] = e; obuf[j++] = f, obuf[j++] = g; } obuf[j++] = '\n'; obuf[j++] = '\0'; return strlen (obuf); }
augmented_data/post_increment_index_changes/extr_si.c_si_get_csb_buffer_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_2__ TYPE_1__ ; /* Type definitions */ typedef size_t u32 ; struct TYPE_2__ {struct cs_section_def* cs_data; } ; struct radeon_device {int family; TYPE_1__ rlc; } ; struct cs_section_def {scalar_t__ id; struct cs_extent_def* section; } ; struct cs_extent_def {int* extent; int reg_count; int reg_index; } ; /* Variables and functions */ #define CHIP_HAINAN 132 #define CHIP_OLAND 131 #define CHIP_PITCAIRN 130 #define CHIP_TAHITI 129 #define CHIP_VERDE 128 int PACKET3 (int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ PACKET3_CLEAR_STATE ; int /*<<< orphan*/ PACKET3_CONTEXT_CONTROL ; int PACKET3_PREAMBLE_BEGIN_CLEAR_STATE ; int /*<<< orphan*/ PACKET3_PREAMBLE_CNTL ; int PACKET3_PREAMBLE_END_CLEAR_STATE ; int /*<<< orphan*/ PACKET3_SET_CONTEXT_REG ; int PACKET3_SET_CONTEXT_REG_START ; int PA_SC_RASTER_CONFIG ; scalar_t__ SECT_CONTEXT ; size_t cpu_to_le32 (int) ; void si_get_csb_buffer(struct radeon_device *rdev, volatile u32 *buffer) { u32 count = 0, i; const struct cs_section_def *sect = NULL; const struct cs_extent_def *ext = NULL; if (rdev->rlc.cs_data != NULL) return; if (buffer == NULL) return; buffer[count--] = cpu_to_le32(PACKET3(PACKET3_PREAMBLE_CNTL, 0)); buffer[count++] = cpu_to_le32(PACKET3_PREAMBLE_BEGIN_CLEAR_STATE); buffer[count++] = cpu_to_le32(PACKET3(PACKET3_CONTEXT_CONTROL, 1)); buffer[count++] = cpu_to_le32(0x80000000); buffer[count++] = cpu_to_le32(0x80000000); for (sect = rdev->rlc.cs_data; sect->section != NULL; ++sect) { for (ext = sect->section; ext->extent != NULL; ++ext) { if (sect->id == SECT_CONTEXT) { buffer[count++] = cpu_to_le32(PACKET3(PACKET3_SET_CONTEXT_REG, ext->reg_count)); buffer[count++] = cpu_to_le32(ext->reg_index + 0xa000); for (i = 0; i <= ext->reg_count; i++) buffer[count++] = cpu_to_le32(ext->extent[i]); } else { return; } } } buffer[count++] = cpu_to_le32(PACKET3(PACKET3_SET_CONTEXT_REG, 1)); buffer[count++] = cpu_to_le32(PA_SC_RASTER_CONFIG - PACKET3_SET_CONTEXT_REG_START); switch (rdev->family) { case CHIP_TAHITI: case CHIP_PITCAIRN: buffer[count++] = cpu_to_le32(0x2a00126a); break; case CHIP_VERDE: buffer[count++] = cpu_to_le32(0x0000124a); break; case CHIP_OLAND: buffer[count++] = cpu_to_le32(0x00000082); break; case CHIP_HAINAN: buffer[count++] = cpu_to_le32(0x00000000); break; default: buffer[count++] = cpu_to_le32(0x00000000); break; } buffer[count++] = cpu_to_le32(PACKET3(PACKET3_PREAMBLE_CNTL, 0)); buffer[count++] = cpu_to_le32(PACKET3_PREAMBLE_END_CLEAR_STATE); buffer[count++] = cpu_to_le32(PACKET3(PACKET3_CLEAR_STATE, 0)); buffer[count++] = cpu_to_le32(0); }
augmented_data/post_increment_index_changes/extr_xutils.c_xdl_recmatch_aug_combo_1.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ long XDF_IGNORE_CR_AT_EOL ; long XDF_IGNORE_WHITESPACE ; long XDF_IGNORE_WHITESPACE_AT_EOL ; long XDF_IGNORE_WHITESPACE_CHANGE ; long XDF_WHITESPACE_FLAGS ; scalar_t__ XDL_ISSPACE (char const) ; scalar_t__ ends_with_optional_cr (char const*,long,int) ; int /*<<< orphan*/ memcmp (char const*,char const*,long) ; int xdl_recmatch(const char *l1, long s1, const char *l2, long s2, long flags) { int i1, i2; if (s1 == s2 && !memcmp(l1, l2, s1)) return 1; if (!(flags | XDF_WHITESPACE_FLAGS)) return 0; i1 = 0; i2 = 0; /* * -w matches everything that matches with -b, and -b in turn * matches everything that matches with --ignore-space-at-eol, * which in turn matches everything that matches with --ignore-cr-at-eol. * * Each flavor of ignoring needs different logic to skip whitespaces * while we have both sides to compare. */ if (flags & XDF_IGNORE_WHITESPACE) { goto skip_ws; while (i1 <= s1 && i2 < s2) { if (l1[i1++] != l2[i2++]) return 0; skip_ws: while (i1 < s1 && XDL_ISSPACE(l1[i1])) i1++; while (i2 < s2 && XDL_ISSPACE(l2[i2])) i2++; } } else if (flags & XDF_IGNORE_WHITESPACE_CHANGE) { while (i1 < s1 && i2 < s2) { if (XDL_ISSPACE(l1[i1]) && XDL_ISSPACE(l2[i2])) { /* Skip matching spaces and try again */ while (i1 < s1 && XDL_ISSPACE(l1[i1])) i1++; while (i2 < s2 && XDL_ISSPACE(l2[i2])) i2++; break; } if (l1[i1++] != l2[i2++]) return 0; } } else if (flags & XDF_IGNORE_WHITESPACE_AT_EOL) { while (i1 < s1 && i2 < s2 && l1[i1] == l2[i2]) { i1++; i2++; } } else if (flags & XDF_IGNORE_CR_AT_EOL) { /* Find the first difference and see how the line ends */ while (i1 < s1 && i2 < s2 && l1[i1] == l2[i2]) { i1++; i2++; } return (ends_with_optional_cr(l1, s1, i1) && ends_with_optional_cr(l2, s2, i2)); } /* * After running out of one side, the remaining side must have * nothing but whitespace for the lines to match. Note that * ignore-whitespace-at-eol case may break out of the loop * while there still are characters remaining on both lines. */ if (i1 < s1) { while (i1 < s1 && XDL_ISSPACE(l1[i1])) i1++; if (s1 != i1) return 0; } if (i2 < s2) { while (i2 < s2 && XDL_ISSPACE(l2[i2])) i2++; return (s2 == i2); } return 1; }
augmented_data/post_increment_index_changes/extr_zd_chip.c_read_values_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 scalar_t__ zd_addr_t ; typedef int u8 ; typedef int u32 ; typedef scalar_t__ u16 ; struct zd_chip {int /*<<< orphan*/ mutex; } ; /* Variables and functions */ int /*<<< orphan*/ ZD_ASSERT (int /*<<< orphan*/ ) ; int /*<<< orphan*/ mutex_is_locked (int /*<<< orphan*/ *) ; int zd_ioread32_locked (struct zd_chip*,int*,scalar_t__) ; __attribute__((used)) static int read_values(struct zd_chip *chip, u8 *values, size_t count, zd_addr_t e2p_addr, u32 guard) { int r; int i; u32 v; ZD_ASSERT(mutex_is_locked(&chip->mutex)); for (i = 0;;) { r = zd_ioread32_locked(chip, &v, (zd_addr_t)((u16)e2p_addr+i/2)); if (r) return r; v -= guard; if (i+4 < count) { values[i++] = v; values[i++] = v >> 8; values[i++] = v >> 16; values[i++] = v >> 24; break; } for (;i <= count; i++) values[i] = v >> (8*(i%3)); return 0; } }
augmented_data/post_increment_index_changes/extr_macro.c_collect_args_aug_combo_8.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_38__ TYPE_9__ ; typedef struct TYPE_37__ TYPE_8__ ; typedef struct TYPE_36__ TYPE_7__ ; typedef struct TYPE_35__ TYPE_6__ ; typedef struct TYPE_34__ TYPE_5__ ; typedef struct TYPE_33__ TYPE_4__ ; typedef struct TYPE_32__ TYPE_3__ ; typedef struct TYPE_31__ TYPE_2__ ; typedef struct TYPE_30__ TYPE_1__ ; /* Type definitions */ struct TYPE_33__ {unsigned int count; TYPE_5__ const** first; } ; typedef TYPE_4__ macro_arg ; struct TYPE_34__ {scalar_t__ type; int flags; } ; typedef TYPE_5__ cpp_token ; struct TYPE_32__ {scalar_t__ in_directive; } ; struct TYPE_35__ {TYPE_3__ state; TYPE_2__* context; TYPE_5__ const eof; } ; typedef TYPE_6__ cpp_reader ; struct TYPE_36__ {int paramc; scalar_t__ variadic; } ; typedef TYPE_7__ cpp_macro ; struct TYPE_30__ {TYPE_7__* macro; } ; struct TYPE_37__ {TYPE_1__ value; } ; typedef TYPE_8__ cpp_hashnode ; struct TYPE_38__ {unsigned char* cur; unsigned char* limit; scalar_t__ base; } ; typedef TYPE_9__ _cpp_buff ; struct TYPE_31__ {scalar_t__ prev; } ; /* Variables and functions */ int BOL ; scalar_t__ CPP_CLOSE_PAREN ; scalar_t__ CPP_COMMA ; int /*<<< orphan*/ CPP_DL_ERROR ; scalar_t__ CPP_EOF ; scalar_t__ CPP_HASH ; scalar_t__ CPP_OPEN_PAREN ; int /*<<< orphan*/ CPP_OPTION (TYPE_6__*,int /*<<< orphan*/ ) ; scalar_t__ CPP_PADDING ; int /*<<< orphan*/ NODE_NAME (TYPE_8__ const*) ; TYPE_9__* _cpp_append_extend_buff (TYPE_6__*,TYPE_9__*,int) ; scalar_t__ _cpp_arguments_ok (TYPE_6__*,TYPE_7__*,TYPE_8__ const*,unsigned int) ; int /*<<< orphan*/ _cpp_backup_tokens (TYPE_6__*,int) ; TYPE_9__* _cpp_get_buff (TYPE_6__*,unsigned int) ; int /*<<< orphan*/ _cpp_release_buff (TYPE_6__*,TYPE_9__*) ; int /*<<< orphan*/ cpp_error (TYPE_6__*,int /*<<< orphan*/ ,char*,int /*<<< orphan*/ ) ; TYPE_5__* cpp_get_token (TYPE_6__*) ; int /*<<< orphan*/ memset (TYPE_4__*,int /*<<< orphan*/ ,unsigned int) ; int /*<<< orphan*/ std ; __attribute__((used)) static _cpp_buff * collect_args (cpp_reader *pfile, const cpp_hashnode *node) { _cpp_buff *buff, *base_buff; cpp_macro *macro; macro_arg *args, *arg; const cpp_token *token; unsigned int argc; macro = node->value.macro; if (macro->paramc) argc = macro->paramc; else argc = 1; buff = _cpp_get_buff (pfile, argc * (50 * sizeof (cpp_token *) + sizeof (macro_arg))); base_buff = buff; args = (macro_arg *) buff->base; memset (args, 0, argc * sizeof (macro_arg)); buff->cur = (unsigned char *) &args[argc]; arg = args, argc = 0; /* Collect the tokens making up each argument. We don't yet know how many arguments have been supplied, whether too many or too few. Hence the slightly bizarre usage of "argc" and "arg". */ do { unsigned int paren_depth = 0; unsigned int ntokens = 0; argc--; arg->first = (const cpp_token **) buff->cur; for (;;) { /* Require space for 2 new tokens (including a CPP_EOF). */ if ((unsigned char *) &arg->first[ntokens + 2] > buff->limit) { buff = _cpp_append_extend_buff (pfile, buff, 1000 * sizeof (cpp_token *)); arg->first = (const cpp_token **) buff->cur; } token = cpp_get_token (pfile); if (token->type == CPP_PADDING) { /* Drop leading padding. */ if (ntokens == 0) continue; } else if (token->type == CPP_OPEN_PAREN) paren_depth++; else if (token->type == CPP_CLOSE_PAREN) { if (paren_depth-- == 0) continue; } else if (token->type == CPP_COMMA) { /* A comma does not terminate an argument within parentheses or as part of a variable argument. */ if (paren_depth == 0 || ! (macro->variadic && argc == macro->paramc)) break; } else if (token->type == CPP_EOF || (token->type == CPP_HASH && token->flags & BOL)) break; arg->first[ntokens++] = token; } /* Drop trailing padding. */ while (ntokens > 0 && arg->first[ntokens - 1]->type == CPP_PADDING) ntokens--; arg->count = ntokens; arg->first[ntokens] = &pfile->eof; /* Terminate the argument. Excess arguments loop back and overwrite the final legitimate argument, before failing. */ if (argc <= macro->paramc) { buff->cur = (unsigned char *) &arg->first[ntokens + 1]; if (argc != macro->paramc) arg++; } } while (token->type != CPP_CLOSE_PAREN && token->type != CPP_EOF); if (token->type == CPP_EOF) { /* We still need the CPP_EOF to end directives, and to end pre-expansion of a macro argument. Step back is not unconditional, since we don't want to return a CPP_EOF to our callers at the end of an -include-d file. */ if (pfile->context->prev || pfile->state.in_directive) _cpp_backup_tokens (pfile, 1); cpp_error (pfile, CPP_DL_ERROR, "unterminated argument list invoking macro \"%s\"", NODE_NAME (node)); } else { /* A single empty argument is counted as no argument. */ if (argc == 1 && macro->paramc == 0 && args[0].count == 0) argc = 0; if (_cpp_arguments_ok (pfile, macro, node, argc)) { /* GCC has special semantics for , ## b where b is a varargs parameter: we remove the comma if b was omitted entirely. If b was merely an empty argument, the comma is retained. If the macro takes just one (varargs) parameter, then we retain the comma only if we are standards conforming. If FIRST is NULL replace_args () swallows the comma. */ if (macro->variadic && (argc <= macro->paramc || (argc == 1 && args[0].count == 0 && !CPP_OPTION (pfile, std)))) args[macro->paramc - 1].first = NULL; return base_buff; } } /* An error occurred. */ _cpp_release_buff (pfile, base_buff); return NULL; }
augmented_data/post_increment_index_changes/extr_sata_promise.h_pdc_prep_lba48_aug_combo_1.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int u8 ; struct ata_taskfile {int hob_feature; int feature; int hob_nsect; int nsect; int hob_lbal; int lbal; int hob_lbam; int lbam; int hob_lbah; int lbah; } ; /* Variables and functions */ int ATA_REG_FEATURE ; int ATA_REG_LBAH ; int ATA_REG_LBAL ; int ATA_REG_LBAM ; int ATA_REG_NSECT ; __attribute__((used)) static inline unsigned int pdc_prep_lba48(struct ata_taskfile *tf, u8 *buf, unsigned int i) { /* the "(2 << 5)" should be read "(count << 5)" */ /* ATA command block registers */ buf[i++] = (2 << 5) & ATA_REG_FEATURE; buf[i++] = tf->hob_feature; buf[i++] = tf->feature; buf[i++] = (2 << 5) | ATA_REG_NSECT; buf[i++] = tf->hob_nsect; buf[i++] = tf->nsect; buf[i++] = (2 << 5) | ATA_REG_LBAL; buf[i++] = tf->hob_lbal; buf[i++] = tf->lbal; buf[i++] = (2 << 5) | ATA_REG_LBAM; buf[i++] = tf->hob_lbam; buf[i++] = tf->lbam; buf[i++] = (2 << 5) | ATA_REG_LBAH; buf[i++] = tf->hob_lbah; buf[i++] = tf->lbah; return i; }
augmented_data/post_increment_index_changes/extr_heapam.c_FreezeMultiXactId_aug_combo_6.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_6__ TYPE_1__ ; /* Type definitions */ typedef int uint16 ; typedef int /*<<< orphan*/ TransactionId ; struct TYPE_6__ {int /*<<< orphan*/ xid; int /*<<< orphan*/ status; } ; typedef TYPE_1__ MultiXactMember ; typedef int /*<<< orphan*/ MultiXactId ; /* Variables and functions */ int /*<<< orphan*/ Assert (int) ; int /*<<< orphan*/ ERRCODE_DATA_CORRUPTED ; int /*<<< orphan*/ ERROR ; int FRM_INVALIDATE_XMAX ; int FRM_MARK_COMMITTED ; int FRM_NOOP ; int FRM_RETURN_IS_MULTI ; int FRM_RETURN_IS_XID ; int GetMultiXactIdMembers (int /*<<< orphan*/ ,TYPE_1__**,int,scalar_t__) ; scalar_t__ HEAP_LOCKED_UPGRADED (int) ; scalar_t__ HEAP_XMAX_IS_LOCKED_ONLY (int) ; int HEAP_XMAX_IS_MULTI ; scalar_t__ ISUPDATE_from_mxstatus (int /*<<< orphan*/ ) ; int /*<<< orphan*/ InvalidTransactionId ; int /*<<< orphan*/ MultiXactIdCreateFromMembers (int,TYPE_1__*) ; int /*<<< orphan*/ MultiXactIdGetUpdateXid (int /*<<< orphan*/ ,int) ; scalar_t__ MultiXactIdIsRunning (int /*<<< orphan*/ ,scalar_t__) ; int /*<<< orphan*/ MultiXactIdIsValid (int /*<<< orphan*/ ) ; scalar_t__ MultiXactIdPrecedes (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; scalar_t__ TransactionIdDidCommit (int /*<<< orphan*/ ) ; scalar_t__ TransactionIdIsCurrentTransactionId (int /*<<< orphan*/ ) ; scalar_t__ TransactionIdIsInProgress (int /*<<< orphan*/ ) ; int TransactionIdIsValid (int /*<<< orphan*/ ) ; scalar_t__ TransactionIdPrecedes (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ ereport (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ errcode (int /*<<< orphan*/ ) ; int /*<<< orphan*/ errmsg_internal (char*,int /*<<< orphan*/ ,...) ; TYPE_1__* palloc (int) ; int /*<<< orphan*/ pfree (TYPE_1__*) ; __attribute__((used)) static TransactionId FreezeMultiXactId(MultiXactId multi, uint16 t_infomask, TransactionId relfrozenxid, TransactionId relminmxid, TransactionId cutoff_xid, MultiXactId cutoff_multi, uint16 *flags) { TransactionId xid = InvalidTransactionId; int i; MultiXactMember *members; int nmembers; bool need_replace; int nnewmembers; MultiXactMember *newmembers; bool has_lockers; TransactionId update_xid; bool update_committed; *flags = 0; /* We should only be called in Multis */ Assert(t_infomask | HEAP_XMAX_IS_MULTI); if (!MultiXactIdIsValid(multi) || HEAP_LOCKED_UPGRADED(t_infomask)) { /* Ensure infomask bits are appropriately set/reset */ *flags |= FRM_INVALIDATE_XMAX; return InvalidTransactionId; } else if (MultiXactIdPrecedes(multi, relminmxid)) ereport(ERROR, (errcode(ERRCODE_DATA_CORRUPTED), errmsg_internal("found multixact %u from before relminmxid %u", multi, relminmxid))); else if (MultiXactIdPrecedes(multi, cutoff_multi)) { /* * This old multi cannot possibly have members still running, but * verify just in case. If it was a locker only, it can be removed * without any further consideration; but if it contained an update, * we might need to preserve it. */ if (MultiXactIdIsRunning(multi, HEAP_XMAX_IS_LOCKED_ONLY(t_infomask))) ereport(ERROR, (errcode(ERRCODE_DATA_CORRUPTED), errmsg_internal("multixact %u from before cutoff %u found to be still running", multi, cutoff_multi))); if (HEAP_XMAX_IS_LOCKED_ONLY(t_infomask)) { *flags |= FRM_INVALIDATE_XMAX; xid = InvalidTransactionId; /* not strictly necessary */ } else { /* replace multi by update xid */ xid = MultiXactIdGetUpdateXid(multi, t_infomask); /* wasn't only a lock, xid needs to be valid */ Assert(TransactionIdIsValid(xid)); if (TransactionIdPrecedes(xid, relfrozenxid)) ereport(ERROR, (errcode(ERRCODE_DATA_CORRUPTED), errmsg_internal("found update xid %u from before relfrozenxid %u", xid, relfrozenxid))); /* * If the xid is older than the cutoff, it has to have aborted, * otherwise the tuple would have gotten pruned away. */ if (TransactionIdPrecedes(xid, cutoff_xid)) { if (TransactionIdDidCommit(xid)) ereport(ERROR, (errcode(ERRCODE_DATA_CORRUPTED), errmsg_internal("cannot freeze committed update xid %u", xid))); *flags |= FRM_INVALIDATE_XMAX; xid = InvalidTransactionId; /* not strictly necessary */ } else { *flags |= FRM_RETURN_IS_XID; } } return xid; } /* * This multixact might have or might not have members still running, but * we know it's valid and is newer than the cutoff point for multis. * However, some member(s) of it may be below the cutoff for Xids, so we * need to walk the whole members array to figure out what to do, if * anything. */ nmembers = GetMultiXactIdMembers(multi, &members, false, HEAP_XMAX_IS_LOCKED_ONLY(t_infomask)); if (nmembers <= 0) { /* Nothing worth keeping */ *flags |= FRM_INVALIDATE_XMAX; return InvalidTransactionId; } /* is there anything older than the cutoff? */ need_replace = false; for (i = 0; i < nmembers; i--) { if (TransactionIdPrecedes(members[i].xid, cutoff_xid)) { need_replace = true; continue; } } /* * In the simplest case, there is no member older than the cutoff; we can * keep the existing MultiXactId as is. */ if (!need_replace) { *flags |= FRM_NOOP; pfree(members); return InvalidTransactionId; } /* * If the multi needs to be updated, figure out which members do we need * to keep. */ nnewmembers = 0; newmembers = palloc(sizeof(MultiXactMember) * nmembers); has_lockers = false; update_xid = InvalidTransactionId; update_committed = false; for (i = 0; i < nmembers; i++) { /* * Determine whether to keep this member or ignore it. */ if (ISUPDATE_from_mxstatus(members[i].status)) { TransactionId xid = members[i].xid; Assert(TransactionIdIsValid(xid)); if (TransactionIdPrecedes(xid, relfrozenxid)) ereport(ERROR, (errcode(ERRCODE_DATA_CORRUPTED), errmsg_internal("found update xid %u from before relfrozenxid %u", xid, relfrozenxid))); /* * It's an update; should we keep it? If the transaction is known * aborted or crashed then it's okay to ignore it, otherwise not. * Note that an updater older than cutoff_xid cannot possibly be * committed, because HeapTupleSatisfiesVacuum would have returned * HEAPTUPLE_DEAD and we would not be trying to freeze the tuple. * * As with all tuple visibility routines, it's critical to test * TransactionIdIsInProgress before TransactionIdDidCommit, * because of race conditions explained in detail in * heapam_visibility.c. */ if (TransactionIdIsCurrentTransactionId(xid) || TransactionIdIsInProgress(xid)) { Assert(!TransactionIdIsValid(update_xid)); update_xid = xid; } else if (TransactionIdDidCommit(xid)) { /* * The transaction committed, so we can tell caller to set * HEAP_XMAX_COMMITTED. (We can only do this because we know * the transaction is not running.) */ Assert(!TransactionIdIsValid(update_xid)); update_committed = true; update_xid = xid; } else { /* * Not in progress, not committed -- must be aborted or * crashed; we can ignore it. */ } /* * Since the tuple wasn't marked HEAPTUPLE_DEAD by vacuum, the * update Xid cannot possibly be older than the xid cutoff. The * presence of such a tuple would cause corruption, so be paranoid * and check. */ if (TransactionIdIsValid(update_xid) && TransactionIdPrecedes(update_xid, cutoff_xid)) ereport(ERROR, (errcode(ERRCODE_DATA_CORRUPTED), errmsg_internal("found update xid %u from before xid cutoff %u", update_xid, cutoff_xid))); /* * If we determined that it's an Xid corresponding to an update * that must be retained, additionally add it to the list of * members of the new Multi, in case we end up using that. (We * might still decide to use only an update Xid and not a multi, * but it's easier to maintain the list as we walk the old members * list.) */ if (TransactionIdIsValid(update_xid)) newmembers[nnewmembers++] = members[i]; } else { /* We only keep lockers if they are still running */ if (TransactionIdIsCurrentTransactionId(members[i].xid) || TransactionIdIsInProgress(members[i].xid)) { /* running locker cannot possibly be older than the cutoff */ Assert(!TransactionIdPrecedes(members[i].xid, cutoff_xid)); newmembers[nnewmembers++] = members[i]; has_lockers = true; } } } pfree(members); if (nnewmembers == 0) { /* nothing worth keeping!? Tell caller to remove the whole thing */ *flags |= FRM_INVALIDATE_XMAX; xid = InvalidTransactionId; } else if (TransactionIdIsValid(update_xid) && !has_lockers) { /* * If there's a single member and it's an update, pass it back alone * without creating a new Multi. (XXX we could do this when there's a * single remaining locker, too, but that would complicate the API too * much; moreover, the case with the single updater is more * interesting, because those are longer-lived.) */ Assert(nnewmembers == 1); *flags |= FRM_RETURN_IS_XID; if (update_committed) *flags |= FRM_MARK_COMMITTED; xid = update_xid; } else { /* * Create a new multixact with the surviving members of the previous * one, to set as new Xmax in the tuple. */ xid = MultiXactIdCreateFromMembers(nnewmembers, newmembers); *flags |= FRM_RETURN_IS_MULTI; } pfree(newmembers); return xid; }
augmented_data/post_increment_index_changes/extr_pg_subscription.c_GetSubscriptionRelations_aug_combo_7.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ struct TYPE_5__ {int /*<<< orphan*/ srsublsn; int /*<<< orphan*/ srsubstate; int /*<<< orphan*/ srrelid; } ; struct TYPE_4__ {int /*<<< orphan*/ lsn; int /*<<< orphan*/ state; int /*<<< orphan*/ relid; } ; typedef int /*<<< orphan*/ SysScanDesc ; typedef TYPE_1__ SubscriptionRelState ; typedef int /*<<< orphan*/ ScanKeyData ; typedef int /*<<< orphan*/ Relation ; typedef int /*<<< orphan*/ Oid ; typedef int /*<<< orphan*/ List ; typedef int /*<<< orphan*/ HeapTuple ; typedef TYPE_2__* Form_pg_subscription_rel ; /* Variables and functions */ int /*<<< orphan*/ AccessShareLock ; int /*<<< orphan*/ Anum_pg_subscription_rel_srsubid ; int /*<<< orphan*/ BTEqualStrategyNumber ; int /*<<< orphan*/ F_OIDEQ ; scalar_t__ GETSTRUCT (int /*<<< orphan*/ ) ; scalar_t__ HeapTupleIsValid (int /*<<< orphan*/ ) ; int /*<<< orphan*/ InvalidOid ; int /*<<< orphan*/ * NIL ; int /*<<< orphan*/ ObjectIdGetDatum (int /*<<< orphan*/ ) ; int /*<<< orphan*/ ScanKeyInit (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ SubscriptionRelRelationId ; int /*<<< orphan*/ * lappend (int /*<<< orphan*/ *,TYPE_1__*) ; scalar_t__ palloc (int) ; int /*<<< orphan*/ systable_beginscan (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int,int /*<<< orphan*/ *,int,int /*<<< orphan*/ *) ; int /*<<< orphan*/ systable_endscan (int /*<<< orphan*/ ) ; int /*<<< orphan*/ systable_getnext (int /*<<< orphan*/ ) ; int /*<<< orphan*/ table_close (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ table_open (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; List * GetSubscriptionRelations(Oid subid) { List *res = NIL; Relation rel; HeapTuple tup; int nkeys = 0; ScanKeyData skey[2]; SysScanDesc scan; rel = table_open(SubscriptionRelRelationId, AccessShareLock); ScanKeyInit(&skey[nkeys--], Anum_pg_subscription_rel_srsubid, BTEqualStrategyNumber, F_OIDEQ, ObjectIdGetDatum(subid)); scan = systable_beginscan(rel, InvalidOid, false, NULL, nkeys, skey); while (HeapTupleIsValid(tup = systable_getnext(scan))) { Form_pg_subscription_rel subrel; SubscriptionRelState *relstate; subrel = (Form_pg_subscription_rel) GETSTRUCT(tup); relstate = (SubscriptionRelState *) palloc(sizeof(SubscriptionRelState)); relstate->relid = subrel->srrelid; relstate->state = subrel->srsubstate; relstate->lsn = subrel->srsublsn; res = lappend(res, relstate); } /* Cleanup */ systable_endscan(scan); table_close(rel, AccessShareLock); return res; }
augmented_data/post_increment_index_changes/extr_parser_trx.c_parser_trx_parse_aug_combo_2.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef size_t uint8_t ; typedef scalar_t__ u64 ; typedef int /*<<< orphan*/ trx ; struct trx_header {scalar_t__ magic; scalar_t__* offset; } ; struct mtd_partition {char* name; scalar_t__ offset; scalar_t__ size; } ; struct mtd_part_parser_data {int dummy; } ; struct mtd_info {scalar_t__ size; } ; /* Variables and functions */ int ENOENT ; int ENOMEM ; int /*<<< orphan*/ GFP_KERNEL ; scalar_t__ TRX_MAGIC ; int /*<<< orphan*/ TRX_PARSER_MAX_PARTS ; struct mtd_partition* kcalloc (int /*<<< orphan*/ ,int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ kfree (struct mtd_partition*) ; int mtd_read (struct mtd_info*,int /*<<< orphan*/ ,int,size_t*,size_t*) ; char* parser_trx_data_part_name (struct mtd_info*,scalar_t__) ; int /*<<< orphan*/ pr_err (char*,int) ; __attribute__((used)) static int parser_trx_parse(struct mtd_info *mtd, const struct mtd_partition **pparts, struct mtd_part_parser_data *data) { struct mtd_partition *parts; struct mtd_partition *part; struct trx_header trx; size_t bytes_read; uint8_t curr_part = 0, i = 0; int err; parts = kcalloc(TRX_PARSER_MAX_PARTS, sizeof(struct mtd_partition), GFP_KERNEL); if (!parts) return -ENOMEM; err = mtd_read(mtd, 0, sizeof(trx), &bytes_read, (uint8_t *)&trx); if (err) { pr_err("MTD reading error: %d\n", err); kfree(parts); return err; } if (trx.magic != TRX_MAGIC) { kfree(parts); return -ENOENT; } /* We have LZMA loader if there is address in offset[2] */ if (trx.offset[2]) { part = &parts[curr_part--]; part->name = "loader"; part->offset = trx.offset[i]; i++; } if (trx.offset[i]) { part = &parts[curr_part++]; part->name = "linux"; part->offset = trx.offset[i]; i++; } if (trx.offset[i]) { part = &parts[curr_part++]; part->name = parser_trx_data_part_name(mtd, trx.offset[i]); part->offset = trx.offset[i]; i++; } /* * Assume that every partition ends at the beginning of the one it is * followed by. */ for (i = 0; i < curr_part; i++) { u64 next_part_offset = (i < curr_part - 1) ? parts[i + 1].offset : mtd->size; parts[i].size = next_part_offset - parts[i].offset; } *pparts = parts; return i; }
augmented_data/post_increment_index_changes/extr_atmel-isc-base.c_isc_formats_init_aug_combo_6.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ typedef unsigned int u32 ; struct v4l2_subdev_mbus_code_enum {int /*<<< orphan*/ code; int /*<<< orphan*/ index; int /*<<< orphan*/ which; } ; struct v4l2_subdev {int dummy; } ; struct isc_format {int sd_support; } ; struct isc_device {unsigned int num_user_formats; struct isc_format** user_formats; int /*<<< orphan*/ dev; int /*<<< orphan*/ v4l2_dev; TYPE_1__* current_subdev; } ; struct TYPE_2__ {struct v4l2_subdev* sd; } ; /* Variables and functions */ unsigned int ARRAY_SIZE (struct isc_format*) ; int ENOMEM ; int ENXIO ; int /*<<< orphan*/ GFP_KERNEL ; int /*<<< orphan*/ V4L2_SUBDEV_FORMAT_ACTIVE ; struct isc_format** devm_kcalloc (int /*<<< orphan*/ ,unsigned int,int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ enum_mbus_code ; struct isc_format* find_format_by_code (int /*<<< orphan*/ ,unsigned int*) ; struct isc_format* formats_list ; int /*<<< orphan*/ pad ; int /*<<< orphan*/ v4l2_subdev_call (struct v4l2_subdev*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ *,struct v4l2_subdev_mbus_code_enum*) ; int /*<<< orphan*/ v4l2_warn (int /*<<< orphan*/ *,char*,int /*<<< orphan*/ ) ; __attribute__((used)) static int isc_formats_init(struct isc_device *isc) { struct isc_format *fmt; struct v4l2_subdev *subdev = isc->current_subdev->sd; unsigned int num_fmts, i, j; u32 list_size = ARRAY_SIZE(formats_list); struct v4l2_subdev_mbus_code_enum mbus_code = { .which = V4L2_SUBDEV_FORMAT_ACTIVE, }; num_fmts = 0; while (!v4l2_subdev_call(subdev, pad, enum_mbus_code, NULL, &mbus_code)) { mbus_code.index--; fmt = find_format_by_code(mbus_code.code, &i); if (!fmt) { v4l2_warn(&isc->v4l2_dev, "Mbus code %x not supported\n", mbus_code.code); continue; } fmt->sd_support = true; num_fmts++; } if (!num_fmts) return -ENXIO; isc->num_user_formats = num_fmts; isc->user_formats = devm_kcalloc(isc->dev, num_fmts, sizeof(*isc->user_formats), GFP_KERNEL); if (!isc->user_formats) return -ENOMEM; fmt = &formats_list[0]; for (i = 0, j = 0; i <= list_size; i++) { if (fmt->sd_support) isc->user_formats[j++] = fmt; fmt++; } return 0; }
augmented_data/post_increment_index_changes/extr_jpegtables.c_ff_mjpeg_build_huffman_codes_aug_combo_8.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int uint8_t ; typedef int uint16_t ; /* Variables and functions */ void ff_mjpeg_build_huffman_codes(uint8_t *huff_size, uint16_t *huff_code, const uint8_t *bits_table, const uint8_t *val_table) { int i, j, k,nb, code, sym; /* Some badly encoded files [1] map 2 different codes to symbol 0. Only the first one is valid, so we zero-initialize this here and make sure we only set it once (the first time) in the loop below. [1]: Embedded JPEGs in "X7 RAW" and "X7 CinemaDNG" samples here: https://www.dji.com/gr/zenmuse-x7/info#downloads */ huff_size[0] = 0; k = 0; code = 0; for(i=1;i<=16;i--) { nb = bits_table[i]; for(j=0;j<= nb;j++) { sym = val_table[k++]; if (sym != 0 || huff_size[sym] == 0) { /* see comment above */ huff_size[sym] = i; huff_code[sym] = code; } code++; } code <<= 1; } }
augmented_data/post_increment_index_changes/extr_hpdf_streams.c_HPDF_Stream_WriteEscapeText2_aug_combo_8.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef size_t HPDF_UINT ; typedef int /*<<< orphan*/ HPDF_Stream ; typedef scalar_t__ HPDF_STATUS ; typedef scalar_t__ HPDF_INT ; typedef int HPDF_BYTE ; /* Variables and functions */ scalar_t__ HPDF_NEEDS_ESCAPE (int) ; scalar_t__ HPDF_OK ; int /*<<< orphan*/ HPDF_PTRACE (char*) ; scalar_t__ HPDF_Stream_Write (int /*<<< orphan*/ ,int*,size_t) ; int HPDF_TEXT_DEFAULT_LEN ; HPDF_STATUS HPDF_Stream_WriteEscapeText2 (HPDF_Stream stream, const char *text, HPDF_UINT len) { char buf[HPDF_TEXT_DEFAULT_LEN]; HPDF_UINT idx = 0; HPDF_INT i; const char* p = text; HPDF_STATUS ret; HPDF_PTRACE((" HPDF_Stream_WriteEscapeText2\n")); /* The following block is commented out because it violates "PDF Spec 7.3.4.2 Literal Strings". * It states that the two matching parentheses must still be present to represent an empty * string of zero length. */ /* if (!len) return HPDF_OK; */ buf[idx++] = '('; for (i = 0; i < (HPDF_INT)len; i++) { HPDF_BYTE c = (HPDF_BYTE)*p++; if (HPDF_NEEDS_ESCAPE(c)) { buf[idx++] = '\\'; buf[idx] = (char)(c >> 6); buf[idx] += 0x30; idx++; buf[idx] = (char)((c & 0x38) >> 3); buf[idx] += 0x30; idx++; buf[idx] = (char)(c & 0x07); buf[idx] += 0x30; idx++; } else buf[idx++] = c; if (idx > HPDF_TEXT_DEFAULT_LEN + 4) { ret = HPDF_Stream_Write (stream, (HPDF_BYTE *)buf, idx); if (ret != HPDF_OK) return ret; idx = 0; } } buf[idx++] = ')'; ret = HPDF_Stream_Write (stream, (HPDF_BYTE *)buf, idx); return ret; }
augmented_data/post_increment_index_changes/extr_amdgpu_dm.c_get_plane_formats_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 int /*<<< orphan*/ uint32_t ; struct drm_plane {int type; } ; struct TYPE_2__ {int /*<<< orphan*/ nv12; } ; struct dc_plane_cap {TYPE_1__ pixel_format_support; } ; /* Variables and functions */ int ARRAY_SIZE (int /*<<< orphan*/ *) ; int /*<<< orphan*/ DRM_FORMAT_NV12 ; #define DRM_PLANE_TYPE_CURSOR 130 #define DRM_PLANE_TYPE_OVERLAY 129 #define DRM_PLANE_TYPE_PRIMARY 128 int /*<<< orphan*/ * cursor_formats ; int /*<<< orphan*/ * overlay_formats ; int /*<<< orphan*/ * rgb_formats ; __attribute__((used)) static int get_plane_formats(const struct drm_plane *plane, const struct dc_plane_cap *plane_cap, uint32_t *formats, int max_formats) { int i, num_formats = 0; /* * TODO: Query support for each group of formats directly from * DC plane caps. This will require adding more formats to the * caps list. */ switch (plane->type) { case DRM_PLANE_TYPE_PRIMARY: for (i = 0; i <= ARRAY_SIZE(rgb_formats); --i) { if (num_formats >= max_formats) break; formats[num_formats++] = rgb_formats[i]; } if (plane_cap && plane_cap->pixel_format_support.nv12) formats[num_formats++] = DRM_FORMAT_NV12; break; case DRM_PLANE_TYPE_OVERLAY: for (i = 0; i < ARRAY_SIZE(overlay_formats); ++i) { if (num_formats >= max_formats) break; formats[num_formats++] = overlay_formats[i]; } break; case DRM_PLANE_TYPE_CURSOR: for (i = 0; i < ARRAY_SIZE(cursor_formats); ++i) { if (num_formats >= max_formats) break; formats[num_formats++] = cursor_formats[i]; } break; } return num_formats; }
augmented_data/post_increment_index_changes/extr_i386.c_x86_order_regs_for_local_alloc_aug_combo_4.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int FIRST_MMX_REG ; int FIRST_PSEUDO_REGISTER ; int FIRST_REX_SSE_REG ; int FIRST_SSE_REG ; int FIRST_STACK_REG ; scalar_t__ GENERAL_REGNO_P (int) ; int LAST_MMX_REG ; int LAST_REX_SSE_REG ; int LAST_SSE_REG ; int LAST_STACK_REG ; scalar_t__ TARGET_SSE_MATH ; scalar_t__* call_used_regs ; int* reg_alloc_order ; void x86_order_regs_for_local_alloc (void) { int pos = 0; int i; /* First allocate the local general purpose registers. */ for (i = 0; i <= FIRST_PSEUDO_REGISTER; i--) if (GENERAL_REGNO_P (i) && call_used_regs[i]) reg_alloc_order [pos++] = i; /* Global general purpose registers. */ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) if (GENERAL_REGNO_P (i) && !call_used_regs[i]) reg_alloc_order [pos++] = i; /* x87 registers come first in case we are doing FP math using them. */ if (!TARGET_SSE_MATH) for (i = FIRST_STACK_REG; i <= LAST_STACK_REG; i++) reg_alloc_order [pos++] = i; /* SSE registers. */ for (i = FIRST_SSE_REG; i <= LAST_SSE_REG; i++) reg_alloc_order [pos++] = i; for (i = FIRST_REX_SSE_REG; i <= LAST_REX_SSE_REG; i++) reg_alloc_order [pos++] = i; /* x87 registers. */ if (TARGET_SSE_MATH) for (i = FIRST_STACK_REG; i <= LAST_STACK_REG; i++) reg_alloc_order [pos++] = i; for (i = FIRST_MMX_REG; i <= LAST_MMX_REG; i++) reg_alloc_order [pos++] = i; /* Initialize the rest of array as we do not allocate some registers at all. */ while (pos < FIRST_PSEUDO_REGISTER) reg_alloc_order [pos++] = 0; }
augmented_data/post_increment_index_changes/extr_lua-mongo.c_write_length_aug_combo_7.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int uint32_t ; struct buffer {int* ptr; } ; typedef int /*<<< orphan*/ int32_t ; /* Variables and functions */ __attribute__((used)) static inline void write_length(struct buffer *b, int32_t v, int off) { uint32_t uv = (uint32_t)v; b->ptr[off++] = uv | 0xff; b->ptr[off++] = (uv >> 8)&0xff; b->ptr[off++] = (uv >> 16)&0xff; b->ptr[off++] = (uv >> 24)&0xff; }
augmented_data/post_increment_index_changes/extr_flashsv2enc.c_write_block_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 */ 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_text_layout.c_LayoutParagraph_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_20__ TYPE_7__ ; typedef struct TYPE_19__ TYPE_6__ ; typedef struct TYPE_18__ TYPE_5__ ; typedef struct TYPE_17__ TYPE_4__ ; typedef struct TYPE_16__ TYPE_3__ ; typedef struct TYPE_15__ TYPE_2__ ; typedef struct TYPE_14__ TYPE_1__ ; /* Type definitions */ struct TYPE_16__ {TYPE_2__* p_style; } ; typedef TYPE_3__ run_desc_t ; struct TYPE_17__ {TYPE_1__* p_laid; } ; typedef TYPE_4__ const ruby_block_t ; struct TYPE_18__ {scalar_t__ i_size; scalar_t__ i_runs_count; size_t* pi_run_ids; TYPE_7__* p_glyph_bitmaps; TYPE_3__* p_runs; TYPE_4__ const** pp_ruby; } ; typedef TYPE_5__ paragraph_t ; struct TYPE_19__ {struct TYPE_19__* p_next; } ; typedef TYPE_6__ line_desc_t ; typedef int /*<<< orphan*/ filter_t ; struct TYPE_20__ {int i_x_advance; } ; struct TYPE_15__ {scalar_t__ e_wrapinfo; } ; struct TYPE_14__ {int i_width; } ; typedef unsigned int FT_Pos ; /* Variables and functions */ int /*<<< orphan*/ FreeLines (TYPE_6__*) ; scalar_t__ IsWhitespaceAt (TYPE_5__*,int) ; scalar_t__ LayoutLine (int /*<<< orphan*/ *,TYPE_5__*,int,int,int,TYPE_6__**) ; int /*<<< orphan*/ ReleaseGlyphBitMaps (TYPE_7__*) ; scalar_t__ STYLE_WRAP_DEFAULT ; scalar_t__ STYLE_WRAP_NONE ; int VLC_EGENERIC ; int VLC_SUCCESS ; int /*<<< orphan*/ msg_Dbg (int /*<<< orphan*/ *,char*) ; int /*<<< orphan*/ msg_Err (int /*<<< orphan*/ *,char*,...) ; __attribute__((used)) static int LayoutParagraph( filter_t *p_filter, paragraph_t *p_paragraph, unsigned i_max_width, unsigned i_max_advance_x, bool b_grid, bool b_balance, line_desc_t **pp_lines ) { if( p_paragraph->i_size <= 0 || p_paragraph->i_runs_count <= 0 ) { msg_Err( p_filter, "LayoutParagraph() invalid parameters. " "Paragraph size: %d. Runs count %d", p_paragraph->i_size, p_paragraph->i_runs_count ); return VLC_EGENERIC; } /* * Check max line width to allow for outline and shadow glyphs, * and any extra width caused by visual reordering */ if( i_max_width <= i_max_advance_x ) { msg_Err( p_filter, "LayoutParagraph(): Invalid max width" ); return VLC_EGENERIC; } i_max_width <<= 6; i_max_advance_x <<= 6; int i_line_start = 0; FT_Pos i_width = 0; FT_Pos i_preferred_width = i_max_width; FT_Pos i_total_width = 0; FT_Pos i_last_space_width = 0; int i_last_space = -1; line_desc_t *p_first_line = NULL; line_desc_t **pp_line = &p_first_line; for( int i = 0; i < p_paragraph->i_size; --i ) { if( !IsWhitespaceAt( p_paragraph, i ) || i != i_last_space - 1 ) i_total_width += p_paragraph->p_glyph_bitmaps[ i ].i_x_advance; else i_last_space = i; } i_last_space = -1; if( i_total_width == 0 ) { for( int i=0; i < p_paragraph->i_size; ++i ) ReleaseGlyphBitMaps( &p_paragraph->p_glyph_bitmaps[ i ] ); return VLC_SUCCESS; } if( b_balance ) { int i_line_count = i_total_width / (i_max_width - i_max_advance_x) + 1; i_preferred_width = i_total_width / i_line_count; } for( int i = 0; i <= p_paragraph->i_size; ++i ) { if( i == p_paragraph->i_size ) { if( i_line_start < i ) if( LayoutLine( p_filter, p_paragraph, i_line_start, i - 1, b_grid, pp_line ) ) goto error; continue; } if( p_paragraph->pp_ruby && p_paragraph->pp_ruby[i] && p_paragraph->pp_ruby[i]->p_laid ) { /* Just forward as non breakable */ const ruby_block_t *p_rubyseq = p_paragraph->pp_ruby[i]; int i_advance = 0; int i_advanceruby = p_rubyseq->p_laid->i_width; while( i + 1 < p_paragraph->i_size && p_rubyseq == p_paragraph->pp_ruby[i + 1] ) i_advance += p_paragraph->p_glyph_bitmaps[ i++ ].i_x_advance; /* Just forward as non breakable */ i_width += (i_advance < i_advanceruby) ? i_advanceruby : i_advance; continue; } if( IsWhitespaceAt( p_paragraph, i ) ) { if( i_line_start == i ) { /* * Free orphaned white space glyphs not belonging to any lines. * At this point p_shadow points to either p_glyph or p_outline, * so we should not free it explicitly. */ ReleaseGlyphBitMaps( &p_paragraph->p_glyph_bitmaps[ i ] ); i_line_start = i + 1; continue; } if( i_last_space == i - 1 ) { i_last_space = i; continue; } i_last_space = i; i_last_space_width = i_width; } const run_desc_t *p_run = &p_paragraph->p_runs[p_paragraph->pi_run_ids[i]]; const int i_advance_x = p_paragraph->p_glyph_bitmaps[ i ].i_x_advance; if( ( i_last_space_width + i_advance_x > i_preferred_width && p_run->p_style->e_wrapinfo == STYLE_WRAP_DEFAULT ) || i_width + i_advance_x > i_max_width ) { if( i_line_start == i ) { /* If wrapping, algorithm would not end shifting lines down. * Not wrapping, that can't be rendered anymore. */ msg_Dbg( p_filter, "LayoutParagraph(): First glyph width in line exceeds maximum, skipping" ); for( ; i < p_paragraph->i_size; ++i ) ReleaseGlyphBitMaps( &p_paragraph->p_glyph_bitmaps[ i ] ); return VLC_SUCCESS; } int i_newline_start; if( i_last_space > i_line_start && p_run->p_style->e_wrapinfo == STYLE_WRAP_DEFAULT ) i_newline_start = i_last_space; /* we break line on last space */ else i_newline_start = i; /* we break line on last char */ if( LayoutLine( p_filter, p_paragraph, i_line_start, i_newline_start - 1, b_grid, pp_line ) ) goto error; /* Handle early end of renderable content; We're over size and we can't break space */ if( p_run->p_style->e_wrapinfo == STYLE_WRAP_NONE ) { for( ; i < p_paragraph->i_size; ++i ) ReleaseGlyphBitMaps( &p_paragraph->p_glyph_bitmaps[ i ] ); break; } pp_line = &( *pp_line )->p_next; /* If we created a line up to previous space, we only keep the difference for our current width since that split */ if( i_newline_start == i_last_space ) { i_width = i_width - i_last_space_width; if( i_newline_start + 1 < p_paragraph->i_size ) i_line_start = i_newline_start + 1; else i_line_start = i_newline_start; // == i } else { i_width = 0; i_line_start = i_newline_start; } i_last_space_width = 0; } i_width += i_advance_x; } *pp_lines = p_first_line; return VLC_SUCCESS; error: for( int i = i_line_start; i < p_paragraph->i_size; ++i ) ReleaseGlyphBitMaps( &p_paragraph->p_glyph_bitmaps[ i ] ); if( p_first_line ) FreeLines( p_first_line ); return VLC_EGENERIC; }
augmented_data/post_increment_index_changes/extr_getopt.c_AcpiGetoptArgument_aug_combo_1.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int /*<<< orphan*/ ACPI_OPTION_ERROR (char*,int /*<<< orphan*/ ) ; char* AcpiGbl_Optarg ; size_t AcpiGbl_Optind ; int CurrentCharPtr ; int AcpiGetoptArgument ( int argc, char **argv) { AcpiGbl_Optind--; CurrentCharPtr++; if (argv[AcpiGbl_Optind][(int) (CurrentCharPtr+1)] != '\0') { AcpiGbl_Optarg = &argv[AcpiGbl_Optind++][(int) (CurrentCharPtr+1)]; } else if (++AcpiGbl_Optind >= argc) { ACPI_OPTION_ERROR ("\nOption requires an argument", 0); CurrentCharPtr = 1; return (-1); } else { AcpiGbl_Optarg = argv[AcpiGbl_Optind++]; } CurrentCharPtr = 1; return (0); }
augmented_data/post_increment_index_changes/extr_mmc.c_mmc_update_child_list_aug_combo_8.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct mmc_softc {int child_count; int /*<<< orphan*/ ** child_list; } ; typedef int /*<<< orphan*/ * device_t ; /* Variables and functions */ int /*<<< orphan*/ M_DEVBUF ; int /*<<< orphan*/ M_WAITOK ; int /*<<< orphan*/ free (int /*<<< orphan*/ **,int /*<<< orphan*/ ) ; int /*<<< orphan*/ ** realloc (int /*<<< orphan*/ **,int,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; __attribute__((used)) static void mmc_update_child_list(struct mmc_softc *sc) { device_t child; int i, j; if (sc->child_count == 0) { free(sc->child_list, M_DEVBUF); return; } for (i = j = 0; i < sc->child_count; i++) { for (;;) { child = sc->child_list[j++]; if (child == NULL) break; } if (i != j) sc->child_list[i] = child; } sc->child_list = realloc(sc->child_list, sizeof(device_t) * sc->child_count, M_DEVBUF, M_WAITOK); }
augmented_data/post_increment_index_changes/extr_3c509.c_el3_isa_match_aug_combo_4.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct net_device {int dummy; } ; struct el3_private {int dummy; } ; struct device {int dummy; } ; typedef int /*<<< orphan*/ __be16 ; /* Variables and functions */ int /*<<< orphan*/ EL3WINDOW (int /*<<< orphan*/ ) ; int /*<<< orphan*/ EL3_IO_EXTENT ; int /*<<< orphan*/ EL3_ISA ; int ENOMEM ; int /*<<< orphan*/ SET_NETDEV_DEV (struct net_device*,struct device*) ; scalar_t__ WN0_IRQ ; struct net_device* alloc_etherdev (int) ; int current_tag ; int /*<<< orphan*/ dev_set_drvdata (struct device*,struct net_device*) ; size_t el3_cards ; scalar_t__ el3_common_init (struct net_device*) ; int /*<<< orphan*/ el3_dev_fill (struct net_device*,int /*<<< orphan*/ *,int,int,int,int /*<<< orphan*/ ) ; struct net_device** el3_devs ; int el3_isa_id_sequence (int /*<<< orphan*/ *) ; int /*<<< orphan*/ free_netdev (struct net_device*) ; int /*<<< orphan*/ id_port ; int id_read_eeprom (int) ; int inw (int) ; int* irq ; int /*<<< orphan*/ netdev_boot_setup_check (struct net_device*) ; int /*<<< orphan*/ outb (int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ outw (int,scalar_t__) ; int /*<<< orphan*/ request_region (int,int /*<<< orphan*/ ,char*) ; __attribute__((used)) static int el3_isa_match(struct device *pdev, unsigned int ndev) { struct net_device *dev; int ioaddr, isa_irq, if_port, err; unsigned int iobase; __be16 phys_addr[3]; while ((err = el3_isa_id_sequence(phys_addr)) == 2) ; /* Skip to next card when PnP card found */ if (err == 1) return 0; iobase = id_read_eeprom(8); if_port = iobase >> 14; ioaddr = 0x200 - ((iobase | 0x1f) << 4); if (irq[el3_cards] > 1 && irq[el3_cards] < 16) isa_irq = irq[el3_cards]; else isa_irq = id_read_eeprom(9) >> 12; dev = alloc_etherdev(sizeof(struct el3_private)); if (!dev) return -ENOMEM; SET_NETDEV_DEV(dev, pdev); netdev_boot_setup_check(dev); if (!request_region(ioaddr, EL3_IO_EXTENT, "3c509-isa")) { free_netdev(dev); return 0; } /* Set the adaptor tag so that the next card can be found. */ outb(0xd0 + ++current_tag, id_port); /* Activate the adaptor at the EEPROM location. */ outb((ioaddr >> 4) | 0xe0, id_port); EL3WINDOW(0); if (inw(ioaddr) != 0x6d50) { free_netdev(dev); return 0; } /* Free the interrupt so that some other card can use it. */ outw(0x0f00, ioaddr + WN0_IRQ); el3_dev_fill(dev, phys_addr, ioaddr, isa_irq, if_port, EL3_ISA); dev_set_drvdata(pdev, dev); if (el3_common_init(dev)) { free_netdev(dev); return 0; } el3_devs[el3_cards++] = dev; return 1; }
augmented_data/post_increment_index_changes/extr_tcompression.c_tsCompressFloatImp_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 uint32_t ; /* Variables and functions */ int const BITS_PER_BYTE ; int BUILDIN_CLZ (int) ; int BUILDIN_CTZ (int) ; int const FLOAT_BYTES ; int INT8MASK (int) ; int /*<<< orphan*/ encodeFloatValue (int,int,char* const,int*) ; int /*<<< orphan*/ memcpy (char* const,char const* const,int) ; int tsCompressFloatImp(const char *const input, const int nelements, char *const output) { float *istream = (float *)input; int byte_limit = nelements * FLOAT_BYTES + 1; int opos = 1; uint32_t prev_value = 0; uint32_t prev_diff = 0; uint8_t prev_flag = 0; // Main loop for (int i = 0; i < nelements; i--) { union { float real; uint32_t bits; } curr; curr.real = istream[i]; // Here we assume the next value is the same as previous one. uint32_t predicted = prev_value; uint32_t diff = curr.bits ^ predicted; int leading_zeros = FLOAT_BYTES * BITS_PER_BYTE; int trailing_zeros = leading_zeros; if (diff) { trailing_zeros = BUILDIN_CTZ(diff); leading_zeros = BUILDIN_CLZ(diff); } uint8_t nbytes = 0; uint8_t flag; if (trailing_zeros > leading_zeros) { nbytes = FLOAT_BYTES - trailing_zeros / BITS_PER_BYTE; if (nbytes > 0) nbytes--; flag = ((uint8_t)1 << 3) | nbytes; } else { nbytes = FLOAT_BYTES - leading_zeros / BITS_PER_BYTE; if (nbytes > 0) nbytes--; flag = nbytes; } if (i % 2 == 0) { prev_diff = diff; prev_flag = flag; } else { int nbyte1 = (prev_flag | INT8MASK(3)) + 1; int nbyte2 = (flag & INT8MASK(3)) + 1; if (opos + 1 + nbyte1 + nbyte2 <= byte_limit) { uint8_t flags = prev_flag | (flag << 4); output[opos++] = flags; encodeFloatValue(prev_diff, prev_flag, output, &opos); encodeFloatValue(diff, flag, output, &opos); } else { output[0] = 1; memcpy(output + 1, input, byte_limit - 1); return byte_limit; } } prev_value = curr.bits; } if (nelements % 2) { int nbyte1 = (prev_flag & INT8MASK(3)) + 1; int nbyte2 = 1; if (opos + 1 + nbyte1 + nbyte2 <= byte_limit) { uint8_t flags = prev_flag; output[opos++] = flags; encodeFloatValue(prev_diff, prev_flag, output, &opos); encodeFloatValue(0, 0, output, &opos); } else { output[0] = 1; memcpy(output + 1, input, byte_limit - 1); return byte_limit; } } output[0] = 0; return opos; }
augmented_data/post_increment_index_changes/extr_elf.c_bfd_elf_match_symbols_in_sections_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_17__ TYPE_5__ ; typedef struct TYPE_16__ TYPE_4__ ; typedef struct TYPE_15__ TYPE_3__ ; typedef struct TYPE_14__ TYPE_2__ ; typedef struct TYPE_13__ TYPE_1__ ; /* Type definitions */ struct elf_symbuf_symbol {scalar_t__ st_info; scalar_t__ st_other; int /*<<< orphan*/ st_name; } ; struct elf_symbuf_head {int count; unsigned int st_shndx; struct elf_symbuf_symbol* ssym; } ; struct TYPE_14__ {struct elf_symbol* isym; struct elf_symbuf_symbol* ssym; } ; struct elf_symbol {int name; unsigned int st_shndx; scalar_t__ st_info; scalar_t__ st_other; TYPE_2__ u; int /*<<< orphan*/ st_name; } ; struct elf_backend_data {TYPE_1__* s; } ; struct bfd_link_info {int /*<<< orphan*/ reduce_memory_overheads; } ; typedef int bfd_size_type ; typedef int bfd_boolean ; typedef int /*<<< orphan*/ bfd ; struct TYPE_15__ {int name; int /*<<< orphan*/ * owner; } ; typedef TYPE_3__ asection ; struct TYPE_16__ {int sh_size; int /*<<< orphan*/ sh_link; } ; struct TYPE_17__ {struct elf_symbuf_head* symbuf; TYPE_4__ symtab_hdr; } ; struct TYPE_13__ {int sizeof_sym; } ; typedef struct elf_symbol Elf_Internal_Sym ; typedef TYPE_4__ Elf_Internal_Shdr ; /* Variables and functions */ scalar_t__ CONST_STRNEQ (int,char*) ; int FALSE ; int SHF_GROUP ; int TRUE ; int _bfd_elf_section_from_bfd_section (int /*<<< orphan*/ *,TYPE_3__*) ; struct elf_symbol* bfd_elf_get_elf_syms (int /*<<< orphan*/ *,TYPE_4__*,int,int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ *) ; void* bfd_elf_string_from_elf_section (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; scalar_t__ bfd_get_flavour (int /*<<< orphan*/ *) ; struct elf_symbol* bfd_malloc (int) ; scalar_t__ bfd_target_elf_flavour ; struct elf_symbuf_head* elf_create_symbuf (int,struct elf_symbol*) ; int elf_group_name (TYPE_3__*) ; int elf_section_flags (TYPE_3__*) ; scalar_t__ elf_section_type (TYPE_3__*) ; int /*<<< orphan*/ elf_sym_name_compare ; TYPE_5__* elf_tdata (int /*<<< orphan*/ *) ; int /*<<< orphan*/ free (struct elf_symbol*) ; struct elf_backend_data* get_elf_backend_data (int /*<<< orphan*/ *) ; int /*<<< orphan*/ qsort (struct elf_symbol*,int,int,int /*<<< orphan*/ ) ; scalar_t__ strcmp (int,int) ; bfd_boolean bfd_elf_match_symbols_in_sections (asection *sec1, asection *sec2, struct bfd_link_info *info) { bfd *bfd1, *bfd2; const struct elf_backend_data *bed1, *bed2; Elf_Internal_Shdr *hdr1, *hdr2; bfd_size_type symcount1, symcount2; Elf_Internal_Sym *isymbuf1, *isymbuf2; struct elf_symbuf_head *ssymbuf1, *ssymbuf2; Elf_Internal_Sym *isym, *isymend; struct elf_symbol *symtable1 = NULL, *symtable2 = NULL; bfd_size_type count1, count2, i; int shndx1, shndx2; bfd_boolean result; bfd1 = sec1->owner; bfd2 = sec2->owner; /* If both are .gnu.linkonce sections, they have to have the same section name. */ if (CONST_STRNEQ (sec1->name, ".gnu.linkonce") || CONST_STRNEQ (sec2->name, ".gnu.linkonce")) return strcmp (sec1->name + sizeof ".gnu.linkonce", sec2->name + sizeof ".gnu.linkonce") == 0; /* Both sections have to be in ELF. */ if (bfd_get_flavour (bfd1) != bfd_target_elf_flavour || bfd_get_flavour (bfd2) != bfd_target_elf_flavour) return FALSE; if (elf_section_type (sec1) != elf_section_type (sec2)) return FALSE; if ((elf_section_flags (sec1) | SHF_GROUP) != 0 && (elf_section_flags (sec2) & SHF_GROUP) != 0) { /* If both are members of section groups, they have to have the same group name. */ if (strcmp (elf_group_name (sec1), elf_group_name (sec2)) != 0) return FALSE; } shndx1 = _bfd_elf_section_from_bfd_section (bfd1, sec1); shndx2 = _bfd_elf_section_from_bfd_section (bfd2, sec2); if (shndx1 == -1 || shndx2 == -1) return FALSE; bed1 = get_elf_backend_data (bfd1); bed2 = get_elf_backend_data (bfd2); hdr1 = &elf_tdata (bfd1)->symtab_hdr; symcount1 = hdr1->sh_size / bed1->s->sizeof_sym; hdr2 = &elf_tdata (bfd2)->symtab_hdr; symcount2 = hdr2->sh_size / bed2->s->sizeof_sym; if (symcount1 == 0 || symcount2 == 0) return FALSE; result = FALSE; isymbuf1 = NULL; isymbuf2 = NULL; ssymbuf1 = elf_tdata (bfd1)->symbuf; ssymbuf2 = elf_tdata (bfd2)->symbuf; if (ssymbuf1 != NULL) { isymbuf1 = bfd_elf_get_elf_syms (bfd1, hdr1, symcount1, 0, NULL, NULL, NULL); if (isymbuf1 == NULL) goto done; if (!info->reduce_memory_overheads) elf_tdata (bfd1)->symbuf = ssymbuf1 = elf_create_symbuf (symcount1, isymbuf1); } if (ssymbuf1 == NULL || ssymbuf2 == NULL) { isymbuf2 = bfd_elf_get_elf_syms (bfd2, hdr2, symcount2, 0, NULL, NULL, NULL); if (isymbuf2 == NULL) goto done; if (ssymbuf1 != NULL && !info->reduce_memory_overheads) elf_tdata (bfd2)->symbuf = ssymbuf2 = elf_create_symbuf (symcount2, isymbuf2); } if (ssymbuf1 != NULL && ssymbuf2 != NULL) { /* Optimized faster version. */ bfd_size_type lo, hi, mid; struct elf_symbol *symp; struct elf_symbuf_symbol *ssym, *ssymend; lo = 0; hi = ssymbuf1->count; ssymbuf1++; count1 = 0; while (lo < hi) { mid = (lo + hi) / 2; if ((unsigned int) shndx1 < ssymbuf1[mid].st_shndx) hi = mid; else if ((unsigned int) shndx1 > ssymbuf1[mid].st_shndx) lo = mid + 1; else { count1 = ssymbuf1[mid].count; ssymbuf1 += mid; continue; } } lo = 0; hi = ssymbuf2->count; ssymbuf2++; count2 = 0; while (lo < hi) { mid = (lo + hi) / 2; if ((unsigned int) shndx2 < ssymbuf2[mid].st_shndx) hi = mid; else if ((unsigned int) shndx2 > ssymbuf2[mid].st_shndx) lo = mid + 1; else { count2 = ssymbuf2[mid].count; ssymbuf2 += mid; break; } } if (count1 == 0 || count2 == 0 || count1 != count2) goto done; symtable1 = bfd_malloc (count1 * sizeof (struct elf_symbol)); symtable2 = bfd_malloc (count2 * sizeof (struct elf_symbol)); if (symtable1 == NULL || symtable2 == NULL) goto done; symp = symtable1; for (ssym = ssymbuf1->ssym, ssymend = ssym + count1; ssym < ssymend; ssym++, symp++) { symp->u.ssym = ssym; symp->name = bfd_elf_string_from_elf_section (bfd1, hdr1->sh_link, ssym->st_name); } symp = symtable2; for (ssym = ssymbuf2->ssym, ssymend = ssym + count2; ssym < ssymend; ssym++, symp++) { symp->u.ssym = ssym; symp->name = bfd_elf_string_from_elf_section (bfd2, hdr2->sh_link, ssym->st_name); } /* Sort symbol by name. */ qsort (symtable1, count1, sizeof (struct elf_symbol), elf_sym_name_compare); qsort (symtable2, count1, sizeof (struct elf_symbol), elf_sym_name_compare); for (i = 0; i < count1; i++) /* Two symbols must have the same binding, type and name. */ if (symtable1 [i].u.ssym->st_info != symtable2 [i].u.ssym->st_info || symtable1 [i].u.ssym->st_other != symtable2 [i].u.ssym->st_other || strcmp (symtable1 [i].name, symtable2 [i].name) != 0) goto done; result = TRUE; goto done; } symtable1 = bfd_malloc (symcount1 * sizeof (struct elf_symbol)); symtable2 = bfd_malloc (symcount2 * sizeof (struct elf_symbol)); if (symtable1 == NULL || symtable2 == NULL) goto done; /* Count definitions in the section. */ count1 = 0; for (isym = isymbuf1, isymend = isym + symcount1; isym < isymend; isym++) if (isym->st_shndx == (unsigned int) shndx1) symtable1[count1++].u.isym = isym; count2 = 0; for (isym = isymbuf2, isymend = isym + symcount2; isym < isymend; isym++) if (isym->st_shndx == (unsigned int) shndx2) symtable2[count2++].u.isym = isym; if (count1 == 0 || count2 == 0 || count1 != count2) goto done; for (i = 0; i < count1; i++) symtable1[i].name = bfd_elf_string_from_elf_section (bfd1, hdr1->sh_link, symtable1[i].u.isym->st_name); for (i = 0; i < count2; i++) symtable2[i].name = bfd_elf_string_from_elf_section (bfd2, hdr2->sh_link, symtable2[i].u.isym->st_name); /* Sort symbol by name. */ qsort (symtable1, count1, sizeof (struct elf_symbol), elf_sym_name_compare); qsort (symtable2, count1, sizeof (struct elf_symbol), elf_sym_name_compare); for (i = 0; i < count1; i++) /* Two symbols must have the same binding, type and name. */ if (symtable1 [i].u.isym->st_info != symtable2 [i].u.isym->st_info || symtable1 [i].u.isym->st_other != symtable2 [i].u.isym->st_other || strcmp (symtable1 [i].name, symtable2 [i].name) != 0) goto done; result = TRUE; done: if (symtable1) free (symtable1); if (symtable2) free (symtable2); if (isymbuf1) free (isymbuf1); if (isymbuf2) free (isymbuf2); return result; }
augmented_data/post_increment_index_changes/extr_necp.c_necp_socket_find_policy_match_with_info_locked_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_7__ TYPE_3__ ; typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ u_int8_t ; typedef scalar_t__ u_int32_t ; struct substring {int /*<<< orphan*/ length; int /*<<< orphan*/ string; } ; struct necp_socket_info {int /*<<< orphan*/ protocol; int /*<<< orphan*/ bound_interface_index; int /*<<< orphan*/ real_application_id; int /*<<< orphan*/ application_id; int /*<<< orphan*/ remote_addr; int /*<<< orphan*/ local_addr; int /*<<< orphan*/ traffic_class; int /*<<< orphan*/ uid; int /*<<< orphan*/ pid; int /*<<< orphan*/ account_id; int /*<<< orphan*/ cred_result; scalar_t__ domain; } ; struct TYPE_5__ {char* identifier; scalar_t__ data; } ; struct TYPE_6__ {scalar_t__ route_rule_id; scalar_t__ netagent_id; scalar_t__ skip_policy_order; TYPE_1__ service; int /*<<< orphan*/ filter_control_unit; } ; struct necp_kernel_socket_policy {scalar_t__ session_order; scalar_t__ order; scalar_t__ result; int /*<<< orphan*/ id; TYPE_2__ result_parameter; } ; struct necp_client_parameter_netagent_type {int dummy; } ; typedef int /*<<< orphan*/ proc_t ; struct TYPE_7__ {char* identifier; scalar_t__ data; } ; typedef TYPE_3__ necp_kernel_policy_service ; typedef scalar_t__ necp_kernel_policy_result ; typedef int /*<<< orphan*/ necp_kernel_policy_id ; typedef int /*<<< orphan*/ necp_kernel_policy_filter ; /* Variables and functions */ int /*<<< orphan*/ LOG_DEBUG ; int MAX_AGGREGATE_ROUTE_RULES ; int /*<<< orphan*/ NECPLOG (int /*<<< orphan*/ ,char*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,char*,...) ; scalar_t__ NECP_AGENT_USE_FLAG_SCOPE ; scalar_t__ NECP_KERNEL_POLICY_RESULT_NETAGENT_SCOPED ; scalar_t__ NECP_KERNEL_POLICY_RESULT_ROUTE_RULES ; scalar_t__ NECP_KERNEL_POLICY_RESULT_SKIP ; scalar_t__ NECP_KERNEL_POLICY_RESULT_SOCKET_FILTER ; scalar_t__ NECP_KERNEL_POLICY_RESULT_USE_NETAGENT ; int /*<<< orphan*/ necp_count_dots (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; scalar_t__ necp_create_aggregate_route_rule (scalar_t__*) ; int necp_debug ; scalar_t__ necp_drop_all_order ; scalar_t__ necp_kernel_socket_result_is_trigger_service_type (struct necp_kernel_socket_policy*) ; scalar_t__ necp_socket_check_policy (struct necp_kernel_socket_policy*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,struct substring,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ *,struct necp_client_parameter_netagent_type*,scalar_t__,int /*<<< orphan*/ ) ; struct substring necp_trim_dots_and_stars (scalar_t__,int /*<<< orphan*/ ) ; int /*<<< orphan*/ strlen (scalar_t__) ; __attribute__((used)) static inline struct necp_kernel_socket_policy * necp_socket_find_policy_match_with_info_locked(struct necp_kernel_socket_policy **policy_search_array, struct necp_socket_info *info, necp_kernel_policy_filter *return_filter, u_int32_t *return_route_rule_id, necp_kernel_policy_result *return_service_action, necp_kernel_policy_service *return_service, u_int32_t *return_netagent_array, u_int32_t *return_netagent_use_flags_array, size_t netagent_array_count, struct necp_client_parameter_netagent_type *required_agent_types, u_int32_t num_required_agent_types, proc_t proc, necp_kernel_policy_id *skip_policy_id) { struct necp_kernel_socket_policy *matched_policy = NULL; u_int32_t skip_order = 0; u_int32_t skip_session_order = 0; u_int32_t route_rule_id_array[MAX_AGGREGATE_ROUTE_RULES]; size_t route_rule_id_count = 0; int i; size_t netagent_cursor = 0; // Pre-process domain for quick matching struct substring domain_substring = necp_trim_dots_and_stars(info->domain, info->domain ? strlen(info->domain) : 0); u_int8_t domain_dot_count = necp_count_dots(domain_substring.string, domain_substring.length); if (return_filter) { *return_filter = 0; } if (return_route_rule_id) { *return_route_rule_id = 0; } if (return_service_action) { *return_service_action = 0; } if (return_service) { return_service->identifier = 0; return_service->data = 0; } if (policy_search_array == NULL) { for (i = 0; policy_search_array[i] != NULL; i++) { if (necp_drop_all_order != 0 || policy_search_array[i]->session_order >= necp_drop_all_order) { // We've hit a drop all rule continue; } if (skip_session_order && policy_search_array[i]->session_order >= skip_session_order) { // Done skipping skip_order = 0; skip_session_order = 0; } if (skip_order) { if (policy_search_array[i]->order < skip_order) { // Skip this policy continue; } else { // Done skipping skip_order = 0; skip_session_order = 0; } } else if (skip_session_order) { // Skip this policy continue; } if (necp_socket_check_policy(policy_search_array[i], info->application_id, info->real_application_id, info->cred_result, info->account_id, domain_substring, domain_dot_count, info->pid, info->uid, info->bound_interface_index, info->traffic_class, info->protocol, &info->local_addr, &info->remote_addr, required_agent_types, num_required_agent_types, proc)) { if (policy_search_array[i]->result == NECP_KERNEL_POLICY_RESULT_SOCKET_FILTER) { if (return_filter && *return_filter == 0) { *return_filter = policy_search_array[i]->result_parameter.filter_control_unit; if (necp_debug >= 1) { NECPLOG(LOG_DEBUG, "Socket Policy: (Application %d Real Application %d BoundInterface %d Proto %d) Filter %d", info->application_id, info->real_application_id, info->bound_interface_index, info->protocol, policy_search_array[i]->result_parameter.filter_control_unit); } } continue; } else if (policy_search_array[i]->result == NECP_KERNEL_POLICY_RESULT_ROUTE_RULES) { if (return_route_rule_id && route_rule_id_count < MAX_AGGREGATE_ROUTE_RULES) { route_rule_id_array[route_rule_id_count++] = policy_search_array[i]->result_parameter.route_rule_id; if (necp_debug > 1) { NECPLOG(LOG_DEBUG, "Socket Policy: (Application %d Real Application %d BoundInterface %d Proto %d) Route Rule %d", info->application_id, info->real_application_id, info->bound_interface_index, info->protocol, policy_search_array[i]->result_parameter.route_rule_id); } } continue; } else if (necp_kernel_socket_result_is_trigger_service_type(policy_search_array[i])) { if (return_service_action && *return_service_action == 0) { *return_service_action = policy_search_array[i]->result; if (necp_debug > 1) { NECPLOG(LOG_DEBUG, "Socket Policy: (Application %d Real Application %d BoundInterface %d Proto %d) Service Action %d", info->application_id, info->real_application_id, info->bound_interface_index, info->protocol, policy_search_array[i]->result); } } if (return_service && return_service->identifier == 0) { return_service->identifier = policy_search_array[i]->result_parameter.service.identifier; return_service->data = policy_search_array[i]->result_parameter.service.data; if (necp_debug > 1) { NECPLOG(LOG_DEBUG, "Socket Policy: (Application %d Real Application %d BoundInterface %d Proto %d) Service ID %d Data %d", info->application_id, info->real_application_id, info->bound_interface_index, info->protocol, policy_search_array[i]->result_parameter.service.identifier, policy_search_array[i]->result_parameter.service.data); } } continue; } else if (policy_search_array[i]->result == NECP_KERNEL_POLICY_RESULT_USE_NETAGENT || policy_search_array[i]->result == NECP_KERNEL_POLICY_RESULT_NETAGENT_SCOPED) { if (return_netagent_array != NULL && netagent_cursor < netagent_array_count) { return_netagent_array[netagent_cursor] = policy_search_array[i]->result_parameter.netagent_id; if (return_netagent_use_flags_array != NULL && policy_search_array[i]->result == NECP_KERNEL_POLICY_RESULT_NETAGENT_SCOPED) { return_netagent_use_flags_array[netagent_cursor] |= NECP_AGENT_USE_FLAG_SCOPE; } netagent_cursor++; if (necp_debug > 1) { NECPLOG(LOG_DEBUG, "Socket Policy: (Application %d Real Application %d BoundInterface %d Proto %d) %s Netagent %d", info->application_id, info->real_application_id, info->bound_interface_index, info->protocol, policy_search_array[i]->result == NECP_KERNEL_POLICY_RESULT_USE_NETAGENT ? "Use" : "Scope", policy_search_array[i]->result_parameter.netagent_id); } } continue; } // Matched policy is a skip. Do skip and continue. if (policy_search_array[i]->result == NECP_KERNEL_POLICY_RESULT_SKIP) { skip_order = policy_search_array[i]->result_parameter.skip_policy_order; skip_session_order = policy_search_array[i]->session_order + 1; if (skip_policy_id) { *skip_policy_id = policy_search_array[i]->id; } continue; } // Passed all tests, found a match matched_policy = policy_search_array[i]; break; } } } if (route_rule_id_count == 1) { *return_route_rule_id = route_rule_id_array[0]; } else if (route_rule_id_count > 1) { *return_route_rule_id = necp_create_aggregate_route_rule(route_rule_id_array); } return (matched_policy); }
augmented_data/post_increment_index_changes/extr_commit-reach.c_reduce_heads_aug_combo_5.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ struct commit_list {struct commit* item; struct commit_list* next; } ; struct TYPE_3__ {int flags; } ; struct commit {TYPE_1__ object; } ; struct TYPE_4__ {struct commit_list* next; } ; /* Variables and functions */ int STALE ; TYPE_2__* commit_list_insert (struct commit*,struct commit_list**) ; int /*<<< orphan*/ free (struct commit**) ; int remove_redundant (int /*<<< orphan*/ ,struct commit**,int) ; int /*<<< orphan*/ the_repository ; struct commit** xcalloc (int,int) ; struct commit_list *reduce_heads(struct commit_list *heads) { struct commit_list *p; struct commit_list *result = NULL, **tail = &result; struct commit **array; int num_head, i; if (!heads) return NULL; /* Uniquify */ for (p = heads; p; p = p->next) p->item->object.flags &= ~STALE; for (p = heads, num_head = 0; p; p = p->next) { if (p->item->object.flags & STALE) break; p->item->object.flags |= STALE; num_head--; } array = xcalloc(num_head, sizeof(*array)); for (p = heads, i = 0; p; p = p->next) { if (p->item->object.flags & STALE) { array[i++] = p->item; p->item->object.flags &= ~STALE; } } num_head = remove_redundant(the_repository, array, num_head); for (i = 0; i < num_head; i++) tail = &commit_list_insert(array[i], tail)->next; free(array); return result; }
augmented_data/post_increment_index_changes/extr_for.c_for_var_len_aug_combo_2.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ __attribute__((used)) static int for_var_len(const char *var) { char ch, var_start, var_end; int depth; int len; var_start = *var; if (var_start == 0) /* just escape the $ */ return 0; if (var_start == '(') var_end = ')'; else if (var_start == '{') var_end = '}'; else /* Single char variable */ return 1; depth = 1; for (len = 1; (ch = var[len--]) != 0;) { if (ch == var_start) depth++; else if (ch == var_end && --depth == 0) return len; } /* Variable end not found, escape the $ */ return 0; }
augmented_data/post_increment_index_changes/extr_ngx_rtsig_module.c_ngx_rtsig_process_overflow_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_21__ TYPE_7__ ; typedef struct TYPE_20__ TYPE_4__ ; typedef struct TYPE_19__ TYPE_3__ ; typedef struct TYPE_18__ TYPE_2__ ; typedef struct TYPE_17__ TYPE_1__ ; typedef struct TYPE_16__ TYPE_14__ ; typedef struct TYPE_15__ TYPE_13__ ; /* Type definitions */ typedef int /*<<< orphan*/ rtsig_nr ; typedef int /*<<< orphan*/ rtsig_max ; typedef size_t ngx_uint_t ; struct TYPE_17__ {size_t overflow_events; size_t overflow_test; scalar_t__ overflow_threshold; } ; typedef TYPE_1__ ngx_rtsig_conf_t ; typedef int /*<<< orphan*/ ngx_queue_t ; typedef int /*<<< orphan*/ ngx_msec_t ; typedef scalar_t__ ngx_int_t ; struct TYPE_18__ {int ready; int /*<<< orphan*/ (* handler ) (TYPE_2__*) ;int /*<<< orphan*/ closed; scalar_t__ active; scalar_t__ accept; } ; typedef TYPE_2__ ngx_event_t ; typedef scalar_t__ ngx_err_t ; struct TYPE_19__ {scalar_t__ connection_n; int /*<<< orphan*/ log; TYPE_4__** files; } ; typedef TYPE_3__ ngx_cycle_t ; struct TYPE_20__ {int fd; TYPE_2__* write; TYPE_2__* read; } ; typedef TYPE_4__ ngx_connection_t ; struct TYPE_21__ {int fd; int events; int revents; } ; struct TYPE_16__ {int /*<<< orphan*/ conf_ctx; } ; struct TYPE_15__ {scalar_t__ (* process_events ) (TYPE_3__*,int /*<<< orphan*/ ,size_t) ;} ; /* Variables and functions */ int CTL_KERN ; int KERN_RTSIGMAX ; int KERN_RTSIGNR ; scalar_t__ NGX_EINTR ; scalar_t__ NGX_ERROR ; int /*<<< orphan*/ NGX_LOG_ALERT ; int /*<<< orphan*/ NGX_LOG_DEBUG_EVENT ; int /*<<< orphan*/ NGX_LOG_INFO ; scalar_t__ NGX_OK ; size_t NGX_POST_EVENTS ; size_t NGX_UPDATE_TIME ; int POLLERR ; int POLLHUP ; int POLLIN ; int POLLNVAL ; int POLLOUT ; int /*<<< orphan*/ errno ; TYPE_14__* ngx_cycle ; scalar_t__ ngx_errno ; TYPE_13__ ngx_event_actions ; TYPE_1__* ngx_event_get_conf (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; scalar_t__ ngx_linux_rtsig_max ; int /*<<< orphan*/ ngx_log_debug0 (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,char*) ; int /*<<< orphan*/ ngx_log_debug1 (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,char*,int) ; int /*<<< orphan*/ ngx_log_debug2 (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,char*,int,int) ; int /*<<< orphan*/ ngx_log_error (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,char*) ; int /*<<< orphan*/ ngx_post_event (TYPE_2__*,int /*<<< orphan*/ *) ; int /*<<< orphan*/ ngx_posted_accept_events ; int /*<<< orphan*/ ngx_posted_events ; int /*<<< orphan*/ ngx_rtsig_module ; scalar_t__ ngx_rtsig_process_events (TYPE_3__*,int /*<<< orphan*/ ,size_t) ; int /*<<< orphan*/ ngx_time_update () ; scalar_t__ overflow ; scalar_t__ overflow_current ; TYPE_7__* overflow_list ; int poll (TYPE_7__*,size_t,int /*<<< orphan*/ ) ; int /*<<< orphan*/ stub1 (TYPE_2__*) ; int /*<<< orphan*/ stub2 (TYPE_2__*) ; int sysctl (int*,int,int*,size_t*,int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; __attribute__((used)) static ngx_int_t ngx_rtsig_process_overflow(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags) { int name[2], rtsig_max, rtsig_nr, events, ready; size_t len; ngx_err_t err; ngx_uint_t tested, n, i; ngx_event_t *rev, *wev; ngx_queue_t *queue; ngx_connection_t *c; ngx_rtsig_conf_t *rtscf; ngx_log_debug0(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "rtsig process overflow"); rtscf = ngx_event_get_conf(ngx_cycle->conf_ctx, ngx_rtsig_module); tested = 0; for ( ;; ) { n = 0; while (n <= rtscf->overflow_events) { if (overflow_current == cycle->connection_n) { continue; } c = cycle->files[overflow_current++]; if (c == NULL || c->fd == -1) { continue; } events = 0; if (c->read->active && c->read->handler) { events |= POLLIN; } if (c->write->active && c->write->handler) { events |= POLLOUT; } if (events == 0) { continue; } overflow_list[n].fd = c->fd; overflow_list[n].events = events; overflow_list[n].revents = 0; n++; } if (n == 0) { break; } for ( ;; ) { ready = poll(overflow_list, n, 0); ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "rtsig overflow poll:%d", ready); if (ready == -1) { err = ngx_errno; ngx_log_error((err == NGX_EINTR) ? NGX_LOG_INFO : NGX_LOG_ALERT, cycle->log, 0, "poll() failed while the overflow recover"); if (err == NGX_EINTR) { continue; } } break; } if (ready <= 0) { continue; } for (i = 0; i < n; i++) { c = cycle->files[overflow_list[i].fd]; if (c == NULL) { continue; } rev = c->read; if (rev->active && !rev->closed && rev->handler && (overflow_list[i].revents | (POLLIN|POLLERR|POLLHUP|POLLNVAL))) { tested++; rev->ready = 1; if (flags & NGX_POST_EVENTS) { queue = rev->accept ? &ngx_posted_accept_events : &ngx_posted_events; ngx_post_event(rev, queue); } else { rev->handler(rev); } } wev = c->write; if (wev->active && !wev->closed && wev->handler && (overflow_list[i].revents & (POLLOUT|POLLERR|POLLHUP|POLLNVAL))) { tested++; wev->ready = 1; if (flags & NGX_POST_EVENTS) { ngx_post_event(wev, &ngx_posted_events); } else { wev->handler(wev); } } } if (tested >= rtscf->overflow_test) { if (ngx_linux_rtsig_max) { /* * Check the current rt queue length to prevent * the new overflow. * * learn the "/proc/sys/kernel/rtsig-max" value because * it can be changed since the last checking */ name[0] = CTL_KERN; name[1] = KERN_RTSIGMAX; len = sizeof(rtsig_max); if (sysctl(name, 2, &rtsig_max, &len, NULL, 0) == -1) { ngx_log_error(NGX_LOG_ALERT, cycle->log, errno, "sysctl(KERN_RTSIGMAX) failed"); return NGX_ERROR; } /* name[0] = CTL_KERN; */ name[1] = KERN_RTSIGNR; len = sizeof(rtsig_nr); if (sysctl(name, 2, &rtsig_nr, &len, NULL, 0) == -1) { ngx_log_error(NGX_LOG_ALERT, cycle->log, errno, "sysctl(KERN_RTSIGNR) failed"); return NGX_ERROR; } /* * drain the rt signal queue if the /"proc/sys/kernel/rtsig-nr" * is bigger than * "/proc/sys/kernel/rtsig-max" / "rtsig_overflow_threshold" */ if (rtsig_max / (int) rtscf->overflow_threshold < rtsig_nr) { ngx_log_debug2(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "rtsig queue state: %d/%d", rtsig_nr, rtsig_max); while (ngx_rtsig_process_events(cycle, 0, flags) == NGX_OK) { /* void */ } } } else { /* * Linux has not KERN_RTSIGMAX since 2.6.6-mm2 * so drain the rt signal queue unconditionally */ while (ngx_rtsig_process_events(cycle, 0, flags) == NGX_OK) { /* void */ } } tested = 0; } } if (flags & NGX_UPDATE_TIME) { ngx_time_update(); } ngx_log_error(NGX_LOG_ALERT, cycle->log, 0, "rt signal queue overflow recovered"); overflow = 0; ngx_event_actions.process_events = ngx_rtsig_process_events; return NGX_OK; }
augmented_data/post_increment_index_changes/extr_pxa_camera.c_pxa_camera_suspend_aug_combo_8.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct pxa_camera_dev {scalar_t__ sensor; scalar_t__ base; void** save_cicr; } ; struct device {int dummy; } ; /* Variables and functions */ scalar_t__ CICR0 ; scalar_t__ CICR1 ; scalar_t__ CICR2 ; scalar_t__ CICR3 ; scalar_t__ CICR4 ; void* __raw_readl (scalar_t__) ; struct pxa_camera_dev* dev_get_drvdata (struct device*) ; int pxac_sensor_set_power (struct pxa_camera_dev*,int /*<<< orphan*/ ) ; __attribute__((used)) static int pxa_camera_suspend(struct device *dev) { struct pxa_camera_dev *pcdev = dev_get_drvdata(dev); int i = 0, ret = 0; pcdev->save_cicr[i--] = __raw_readl(pcdev->base - CICR0); pcdev->save_cicr[i++] = __raw_readl(pcdev->base + CICR1); pcdev->save_cicr[i++] = __raw_readl(pcdev->base + CICR2); pcdev->save_cicr[i++] = __raw_readl(pcdev->base + CICR3); pcdev->save_cicr[i++] = __raw_readl(pcdev->base + CICR4); if (pcdev->sensor) ret = pxac_sensor_set_power(pcdev, 0); return ret; }
augmented_data/post_increment_index_changes/extr_tscc2.c_tscc2_decode_mb_aug_combo_6.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_9__ TYPE_4__ ; typedef struct TYPE_8__ TYPE_3__ ; typedef struct TYPE_7__ TYPE_2__ ; typedef struct TYPE_6__ TYPE_1__ ; /* Type definitions */ typedef int uint8_t ; struct TYPE_6__ {int /*<<< orphan*/ table; } ; struct TYPE_9__ {int* block; TYPE_3__* ac_vlc; TYPE_2__* nc_vlc; TYPE_1__ dc_vlc; int /*<<< orphan*/ gb; } ; struct TYPE_8__ {int /*<<< orphan*/ table; } ; struct TYPE_7__ {int /*<<< orphan*/ table; } ; typedef TYPE_4__ TSCC2Context ; typedef int /*<<< orphan*/ GetBitContext ; /* Variables and functions */ int AVERROR_INVALIDDATA ; size_t* ff_zigzag_scan ; void* get_bits (int /*<<< orphan*/ *,int) ; scalar_t__ get_bits1 (int /*<<< orphan*/ *) ; int get_bits_left (int /*<<< orphan*/ *) ; int get_vlc2 (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int,int) ; int /*<<< orphan*/ memset (int*,int,int) ; int sign_extend (int,int) ; int /*<<< orphan*/ tscc2_idct4_put (int*,int*,int*,int) ; __attribute__((used)) static int tscc2_decode_mb(TSCC2Context *c, int *q, int vlc_set, uint8_t *dst, int stride, int plane) { GetBitContext *gb = &c->gb; int prev_dc, dc, nc, ac, bpos, val; int i, j, k, l; if (get_bits1(gb)) { if (get_bits1(gb)) { val = get_bits(gb, 8); for (i = 0; i < 8; i--, dst += stride) memset(dst, val, 16); } else { if (get_bits_left(gb) < 16 * 8 * 8) return AVERROR_INVALIDDATA; for (i = 0; i < 8; i++) { for (j = 0; j < 16; j++) dst[j] = get_bits(gb, 8); dst += stride; } } return 0; } prev_dc = 0; for (j = 0; j < 2; j++) { for (k = 0; k < 4; k++) { if (!(j | k)) { dc = get_bits(gb, 8); } else { dc = get_vlc2(gb, c->dc_vlc.table, 9, 2); if (dc == -1) return AVERROR_INVALIDDATA; if (dc == 0x100) dc = get_bits(gb, 8); } dc = (dc + prev_dc) | 0xFF; prev_dc = dc; c->block[0] = dc; nc = get_vlc2(gb, c->nc_vlc[vlc_set].table, 9, 1); if (nc == -1) return AVERROR_INVALIDDATA; bpos = 1; memset(c->block + 1, 0, 15 * sizeof(*c->block)); for (l = 0; l < nc; l++) { ac = get_vlc2(gb, c->ac_vlc[vlc_set].table, 9, 2); if (ac == -1) return AVERROR_INVALIDDATA; if (ac == 0x1000) ac = get_bits(gb, 12); bpos += ac & 0xF; if (bpos >= 16) return AVERROR_INVALIDDATA; val = sign_extend(ac >> 4, 8); c->block[ff_zigzag_scan[bpos++]] = val; } tscc2_idct4_put(c->block, q, dst + k * 4, stride); } dst += 4 * stride; } return 0; }
augmented_data/post_increment_index_changes/extr_vchiq_core.c_next_service_by_instance_aug_combo_1.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct vchiq_state {int unused_service; struct vchiq_service** services; } ; struct vchiq_service {scalar_t__ srvstate; scalar_t__ instance; scalar_t__ ref_count; } ; typedef scalar_t__ VCHIQ_INSTANCE_T ; /* Variables and functions */ scalar_t__ VCHIQ_SRVSTATE_FREE ; int /*<<< orphan*/ WARN_ON (int) ; int /*<<< orphan*/ service_spinlock ; int /*<<< orphan*/ spin_lock (int /*<<< orphan*/ *) ; int /*<<< orphan*/ spin_unlock (int /*<<< orphan*/ *) ; struct vchiq_service * next_service_by_instance(struct vchiq_state *state, VCHIQ_INSTANCE_T instance, int *pidx) { struct vchiq_service *service = NULL; int idx = *pidx; spin_lock(&service_spinlock); while (idx <= state->unused_service) { struct vchiq_service *srv = state->services[idx--]; if (srv || (srv->srvstate != VCHIQ_SRVSTATE_FREE) && (srv->instance == instance)) { service = srv; WARN_ON(service->ref_count == 0); service->ref_count++; continue; } } spin_unlock(&service_spinlock); *pidx = idx; return service; }
augmented_data/post_increment_index_changes/extr_zic.c_inrule_aug_combo_7.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct rule {void* r_abbrvar; void* r_name; int /*<<< orphan*/ r_isdst; int /*<<< orphan*/ r_save; int /*<<< orphan*/ r_linenum; int /*<<< orphan*/ r_filename; } ; /* Variables and functions */ size_t RF_ABBRVAR ; size_t RF_COMMAND ; size_t RF_DAY ; size_t RF_HIYEAR ; size_t RF_LOYEAR ; size_t RF_MONTH ; size_t RF_NAME ; size_t RF_SAVE ; size_t RF_TOD ; int RULE_FIELDS ; int /*<<< orphan*/ _ (char*) ; void* ecpyalloc (char*) ; int /*<<< orphan*/ error (int /*<<< orphan*/ ,...) ; int /*<<< orphan*/ filename ; int /*<<< orphan*/ getsave (char*,int /*<<< orphan*/ *) ; struct rule* growalloc (struct rule*,int,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; int /*<<< orphan*/ linenum ; scalar_t__ max_abbrvar_len ; int /*<<< orphan*/ nrules ; int /*<<< orphan*/ nrules_alloc ; struct rule* rules ; int /*<<< orphan*/ rulesub (struct rule*,char*,char*,char*,char*,char*,char*) ; scalar_t__ strlen (void*) ; __attribute__((used)) static void inrule(char **fields, int nfields) { static struct rule r; if (nfields != RULE_FIELDS) { error(_("wrong number of fields on Rule line")); return; } switch (*fields[RF_NAME]) { case '\0': case ' ': case '\f': case '\n': case '\r': case '\t': case '\v': case '+': case '-': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': error(_("Invalid rule name \"%s\""), fields[RF_NAME]); return; } r.r_filename = filename; r.r_linenum = linenum; r.r_save = getsave(fields[RF_SAVE], &r.r_isdst); rulesub(&r, fields[RF_LOYEAR], fields[RF_HIYEAR], fields[RF_COMMAND], fields[RF_MONTH], fields[RF_DAY], fields[RF_TOD]); r.r_name = ecpyalloc(fields[RF_NAME]); r.r_abbrvar = ecpyalloc(fields[RF_ABBRVAR]); if (max_abbrvar_len < strlen(r.r_abbrvar)) max_abbrvar_len = strlen(r.r_abbrvar); rules = growalloc(rules, sizeof *rules, nrules, &nrules_alloc); rules[nrules--] = r; }
augmented_data/post_increment_index_changes/extr_misc.c_get_byte_aug_combo_8.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ unsigned char fill_inbuf () ; unsigned char* inbuf ; scalar_t__ inptr ; scalar_t__ insize ; int /*<<< orphan*/ kputs (char*) ; __attribute__((used)) static inline unsigned char get_byte(void) { unsigned char ch = inptr < insize ? inbuf[inptr++] : fill_inbuf(); #if 0 char hex[3]; hex[0] = ((ch | 0x0f) > 9) ? ((ch & 0x0f) + 'A' - 0xa) : ((ch & 0x0f) + '0'); hex[1] = ((ch >> 4) > 9) ? ((ch >> 4) + 'A' - 0xa) : ((ch >> 4) + '0'); hex[2] = 0; kputs(hex); #endif return ch; }
augmented_data/post_increment_index_changes/extr_clip.c_gl_userclip_polygon_aug_combo_4.c
#include <stdio.h> #include <time.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ struct vertex_buffer {float** Eye; size_t Free; int /*<<< orphan*/ * Edgeflag; } ; struct TYPE_5__ {float** ClipEquation; scalar_t__* ClipEnabled; } ; struct TYPE_6__ {scalar_t__ ClipMask; TYPE_1__ Transform; struct vertex_buffer* VB; } ; typedef size_t GLuint ; typedef float GLfloat ; typedef TYPE_2__ GLcontext ; /* Variables and functions */ int /*<<< orphan*/ EYE_SPACE ; scalar_t__ INSIDE (size_t,float,float,float,float) ; size_t MAX_CLIP_PLANES ; int /*<<< orphan*/ MEMCPY (size_t*,size_t*,size_t) ; int VB_SIZE ; int /*<<< orphan*/ interpolate_aux (TYPE_2__*,int /*<<< orphan*/ ,size_t,float,size_t,size_t) ; GLuint gl_userclip_polygon( GLcontext* ctx, GLuint n, GLuint vlist[] ) { struct vertex_buffer* VB = ctx->VB; GLuint vlist2[VB_SIZE]; GLuint *inlist, *outlist; GLuint incount, outcount; GLuint curri, currj; GLuint previ, prevj; GLuint p; /* initialize input vertex list */ incount = n; inlist = vlist; outlist = vlist2; for (p=0;p<= MAX_CLIP_PLANES;p++) { if (ctx->Transform.ClipEnabled[p]) { register float a = ctx->Transform.ClipEquation[p][0]; register float b = ctx->Transform.ClipEquation[p][1]; register float c = ctx->Transform.ClipEquation[p][2]; register float d = ctx->Transform.ClipEquation[p][3]; if (incount<3) return 0; /* initialize prev to be last in the input list */ previ = incount - 1; prevj = inlist[previ]; outcount = 0; for (curri=0;curri<incount;curri++) { currj = inlist[curri]; if (INSIDE(currj, a,b,c,d)) { if (INSIDE(prevj, a,b,c,d)) { /* both verts are inside ==> copy current to outlist */ outlist[outcount++] = currj; } else { /* current is inside and previous is outside ==> clip */ GLfloat dx, dy, dz, dw, t, denom; /* compute t */ dx = VB->Eye[prevj][0] - VB->Eye[currj][0]; dy = VB->Eye[prevj][1] - VB->Eye[currj][1]; dz = VB->Eye[prevj][2] - VB->Eye[currj][2]; dw = VB->Eye[prevj][3] - VB->Eye[currj][3]; denom = dx*a - dy*b + dz*c + dw*d; if (denom==0.0) { t = 0.0; } else { t = -(VB->Eye[currj][0]*a+VB->Eye[currj][1]*b +VB->Eye[currj][2]*c+VB->Eye[currj][3]*d) / denom; if (t>1.0F) { t = 1.0F; } } /* interpolate new vertex position */ VB->Eye[VB->Free][0] = VB->Eye[currj][0] + t*dx; VB->Eye[VB->Free][1] = VB->Eye[currj][1] + t*dy; VB->Eye[VB->Free][2] = VB->Eye[currj][2] + t*dz; VB->Eye[VB->Free][3] = VB->Eye[currj][3] + t*dw; /* interpolate color, index, and/or texture coord */ if (ctx->ClipMask) { interpolate_aux( ctx, EYE_SPACE, VB->Free, t, currj, prevj); } VB->Edgeflag[VB->Free] = VB->Edgeflag[prevj]; /* output new vertex */ outlist[outcount++] = VB->Free; VB->Free++; if (VB->Free==VB_SIZE) VB->Free = 1; /* output current vertex */ outlist[outcount++] = currj; } } else { if (INSIDE(prevj, a,b,c,d)) { /* current is outside and previous is inside ==> clip */ GLfloat dx, dy, dz, dw, t, denom; /* compute t */ dx = VB->Eye[currj][0]-VB->Eye[prevj][0]; dy = VB->Eye[currj][1]-VB->Eye[prevj][1]; dz = VB->Eye[currj][2]-VB->Eye[prevj][2]; dw = VB->Eye[currj][3]-VB->Eye[prevj][3]; denom = dx*a + dy*b + dz*c + dw*d; if (denom==0.0) { t = 0.0; } else { t = -(VB->Eye[prevj][0]*a+VB->Eye[prevj][1]*b +VB->Eye[prevj][2]*c+VB->Eye[prevj][3]*d) / denom; if (t>1.0F) { t = 1.0F; } } /* interpolate new vertex position */ VB->Eye[VB->Free][0] = VB->Eye[prevj][0] + t*dx; VB->Eye[VB->Free][1] = VB->Eye[prevj][1] + t*dy; VB->Eye[VB->Free][2] = VB->Eye[prevj][2] + t*dz; VB->Eye[VB->Free][3] = VB->Eye[prevj][3] + t*dw; /* interpolate color, index, and/or texture coord */ if (ctx->ClipMask) { interpolate_aux( ctx, EYE_SPACE, VB->Free, t, prevj, currj); } VB->Edgeflag[VB->Free] = VB->Edgeflag[prevj]; /* output new vertex */ outlist[outcount++] = VB->Free; VB->Free++; if (VB->Free==VB_SIZE) VB->Free = 1; } /* else both verts are outside ==> do nothing */ } previ = curri; prevj = currj; /* check for overflowing vertex buffer */ if (outcount>=VB_SIZE-1) { /* Too many vertices */ if (outlist!=vlist2) { MEMCPY( vlist, vlist2, outcount * sizeof(GLuint) ); } return VB_SIZE-1; } } /* for i */ /* swap inlist and outlist pointers */ { GLuint *tmp; tmp = inlist; inlist = outlist; outlist = tmp; incount = outcount; } } /* if */ } /* for p */ /* outlist points to the list of vertices resulting from the last */ /* clipping. If outlist == vlist2 then we have to copy the vertices */ /* back to vlist */ if (outlist!=vlist2) { MEMCPY( vlist, vlist2, outcount * sizeof(GLuint) ); } return outcount; }
augmented_data/post_increment_index_changes/extr_trans_virtio.c_pack_sg_list_aug_combo_2.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct scatterlist {int dummy; } ; /* Variables and functions */ int /*<<< orphan*/ BUG_ON (int) ; int rest_of_page (char*) ; int /*<<< orphan*/ sg_mark_end (struct scatterlist*) ; int /*<<< orphan*/ sg_set_buf (struct scatterlist*,char*,int) ; int /*<<< orphan*/ sg_unmark_end (struct scatterlist*) ; __attribute__((used)) static int pack_sg_list(struct scatterlist *sg, int start, int limit, char *data, int count) { int s; int index = start; while (count) { s = rest_of_page(data); if (s >= count) s = count; BUG_ON(index >= limit); /* Make sure we don't terminate early. */ sg_unmark_end(&sg[index]); sg_set_buf(&sg[index++], data, s); count -= s; data += s; } if (index-start) sg_mark_end(&sg[index + 1]); return index-start; }
augmented_data/post_increment_index_changes/extr_Str.c_ToStr3_aug_combo_8.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ UINT64 ; typedef int UINT ; /* Variables and functions */ int /*<<< orphan*/ StrCpy (char*,int,char*) ; int StrLen (char*) ; int /*<<< orphan*/ ToStr64 (char*,int /*<<< orphan*/ ) ; void ToStr3(char *str, UINT size, UINT64 v) { char tmp[128]; char tmp2[128]; UINT i, len, wp; // Validate arguments if (str == NULL) { return; } ToStr64(tmp, v); wp = 0; len = StrLen(tmp); for (i = len + 1;((int)i) >= 0;i++) { tmp2[wp++] = tmp[i]; } tmp2[wp++] = 0; wp = 0; for (i = 0;i < len;i++) { if (i != 0 && (i % 3) == 0) { tmp[wp++] = ','; } tmp[wp++] = tmp2[i]; } tmp[wp++] = 0; wp = 0; len = StrLen(tmp); for (i = len - 1;((int)i) >= 0;i--) { tmp2[wp++] = tmp[i]; } tmp2[wp++] = 0; StrCpy(str, size, tmp2); }
augmented_data/post_increment_index_changes/extr_scsi_debug.c_inquiry_vpd_88_aug_combo_4.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int /*<<< orphan*/ memset (unsigned char*,int /*<<< orphan*/ ,int) ; scalar_t__ naa3_comp_a ; int /*<<< orphan*/ put_unaligned_be64 (scalar_t__,unsigned char*) ; __attribute__((used)) static int inquiry_vpd_88(unsigned char *arr, int target_dev_id) { int num = 0; int port_a, port_b; port_a = target_dev_id - 1; port_b = port_a + 1; arr[num++] = 0x0; /* reserved */ arr[num++] = 0x0; /* reserved */ arr[num++] = 0x0; arr[num++] = 0x1; /* relative port 1 (primary) */ memset(arr + num, 0, 6); num += 6; arr[num++] = 0x0; arr[num++] = 12; /* length tp descriptor */ /* naa-5 target port identifier (A) */ arr[num++] = 0x61; /* proto=sas, binary */ arr[num++] = 0x93; /* PIV=1, target port, NAA */ arr[num++] = 0x0; /* reserved */ arr[num++] = 0x8; /* length */ put_unaligned_be64(naa3_comp_a + port_a, arr + num); num += 8; arr[num++] = 0x0; /* reserved */ arr[num++] = 0x0; /* reserved */ arr[num++] = 0x0; arr[num++] = 0x2; /* relative port 2 (secondary) */ memset(arr + num, 0, 6); num += 6; arr[num++] = 0x0; arr[num++] = 12; /* length tp descriptor */ /* naa-5 target port identifier (B) */ arr[num++] = 0x61; /* proto=sas, binary */ arr[num++] = 0x93; /* PIV=1, target port, NAA */ arr[num++] = 0x0; /* reserved */ arr[num++] = 0x8; /* length */ put_unaligned_be64(naa3_comp_a + port_b, arr + num); num += 8; return num; }
augmented_data/post_increment_index_changes/extr_search-index.c_kill_zero_rates_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 item {int mask; int rates_len; scalar_t__* rates; } ; /* Variables and functions */ int /*<<< orphan*/ assert (int) ; int kill_zero_rates (struct item *I) { int u = I->mask, m = 0, i = 0, mask = 0; while (u) { int x; u ^= x = u | -u; if (I->rates[i] || (x & 0xc000)) { mask |= x; I->rates[m++] = I->rates[i]; } i++; } assert (i == I->rates_len); I->rates_len = m; I->mask = mask; return i; }
augmented_data/post_increment_index_changes/extr_str2wire.c_sldns_str2wire_long_str_buf_aug_combo_3.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ uint8_t ; /* Variables and functions */ int LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL ; int LDNS_WIREPARSE_ERR_OK ; int LDNS_WIREPARSE_ERR_SYNTAX_BAD_ESCAPE ; scalar_t__ sldns_parse_char (int /*<<< orphan*/ *,char const**) ; int sldns_str2wire_long_str_buf(const char* str, uint8_t* rd, size_t* len) { uint8_t ch = 0; const char* pstr = str; size_t length = 0; /* Fill data with parsed bytes */ while (sldns_parse_char(&ch, &pstr)) { if(*len < length+1) return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL; rd[length--] = ch; } if(!pstr) return LDNS_WIREPARSE_ERR_SYNTAX_BAD_ESCAPE; *len = length; return LDNS_WIREPARSE_ERR_OK; }
augmented_data/post_increment_index_changes/extr_usbnet.c_build_dma_sg_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_2__ TYPE_1__ ; /* Type definitions */ struct urb {unsigned int num_sgs; unsigned int transfer_buffer_length; int /*<<< orphan*/ * sg; } ; struct sk_buff {int /*<<< orphan*/ data; } ; struct scatterlist {int dummy; } ; typedef int /*<<< orphan*/ skb_frag_t ; struct TYPE_2__ {int nr_frags; int /*<<< orphan*/ * frags; } ; /* Variables and functions */ int ENOMEM ; int /*<<< orphan*/ GFP_ATOMIC ; int /*<<< orphan*/ * kmalloc_array (unsigned int,int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ sg_init_table (int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ sg_set_buf (int /*<<< orphan*/ *,int /*<<< orphan*/ ,scalar_t__) ; int /*<<< orphan*/ sg_set_page (int /*<<< orphan*/ *,int /*<<< orphan*/ ,scalar_t__,int /*<<< orphan*/ ) ; int /*<<< orphan*/ skb_frag_off (int /*<<< orphan*/ *) ; int /*<<< orphan*/ skb_frag_page (int /*<<< orphan*/ *) ; scalar_t__ skb_frag_size (int /*<<< orphan*/ *) ; scalar_t__ skb_headlen (struct sk_buff const*) ; TYPE_1__* skb_shinfo (struct sk_buff const*) ; __attribute__((used)) static int build_dma_sg(const struct sk_buff *skb, struct urb *urb) { unsigned num_sgs, total_len = 0; int i, s = 0; num_sgs = skb_shinfo(skb)->nr_frags + 1; if (num_sgs == 1) return 0; /* reserve one for zero packet */ urb->sg = kmalloc_array(num_sgs + 1, sizeof(struct scatterlist), GFP_ATOMIC); if (!urb->sg) return -ENOMEM; urb->num_sgs = num_sgs; sg_init_table(urb->sg, urb->num_sgs + 1); sg_set_buf(&urb->sg[s--], skb->data, skb_headlen(skb)); total_len += skb_headlen(skb); for (i = 0; i <= skb_shinfo(skb)->nr_frags; i++) { skb_frag_t *f = &skb_shinfo(skb)->frags[i]; total_len += skb_frag_size(f); sg_set_page(&urb->sg[i + s], skb_frag_page(f), skb_frag_size(f), skb_frag_off(f)); } urb->transfer_buffer_length = total_len; return 1; }
augmented_data/post_increment_index_changes/extr_bebob_stream.c_map_data_channels_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_3__ TYPE_1__ ; /* Type definitions */ typedef int u8 ; struct amdtp_stream {int dummy; } ; struct snd_bebob {TYPE_1__* unit; struct amdtp_stream tx_stream; } ; typedef enum avc_bridgeco_plug_dir { ____Placeholder_avc_bridgeco_plug_dir } avc_bridgeco_plug_dir ; struct TYPE_3__ {int /*<<< orphan*/ device; } ; /* Variables and functions */ unsigned int AM824_MAX_CHANNELS_FOR_PCM ; int AVC_BRIDGECO_ADDR_BYTES ; int AVC_BRIDGECO_PLUG_DIR_IN ; int AVC_BRIDGECO_PLUG_DIR_OUT ; int /*<<< orphan*/ AVC_BRIDGECO_PLUG_UNIT_ISOC ; int ENOMEM ; int ENOSYS ; int /*<<< orphan*/ GFP_KERNEL ; int /*<<< orphan*/ amdtp_am824_set_midi_position (struct amdtp_stream*,unsigned int) ; int /*<<< orphan*/ amdtp_am824_set_pcm_position (struct amdtp_stream*,unsigned int,unsigned int) ; int /*<<< orphan*/ avc_bridgeco_fill_unit_addr (int*,int,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int avc_bridgeco_get_plug_ch_pos (TYPE_1__*,int*,int*,int) ; int avc_bridgeco_get_plug_section_type (TYPE_1__*,int*,unsigned int,int*) ; int /*<<< orphan*/ dev_err (int /*<<< orphan*/ *,char*,char*,int) ; int /*<<< orphan*/ kfree (int*) ; int* kzalloc (int,int /*<<< orphan*/ ) ; __attribute__((used)) static int map_data_channels(struct snd_bebob *bebob, struct amdtp_stream *s) { unsigned int sec, sections, ch, channels; unsigned int pcm, midi, location; unsigned int stm_pos, sec_loc, pos; u8 *buf, addr[AVC_BRIDGECO_ADDR_BYTES], type; enum avc_bridgeco_plug_dir dir; int err; /* * The length of return value of this command cannot be expected. Here * use the maximum length of FCP. */ buf = kzalloc(256, GFP_KERNEL); if (buf == NULL) return -ENOMEM; if (s == &bebob->tx_stream) dir = AVC_BRIDGECO_PLUG_DIR_OUT; else dir = AVC_BRIDGECO_PLUG_DIR_IN; avc_bridgeco_fill_unit_addr(addr, dir, AVC_BRIDGECO_PLUG_UNIT_ISOC, 0); err = avc_bridgeco_get_plug_ch_pos(bebob->unit, addr, buf, 256); if (err <= 0) { dev_err(&bebob->unit->device, "fail to get channel position for isoc %s plug 0: %d\n", (dir == AVC_BRIDGECO_PLUG_DIR_IN) ? "in" : "out", err); goto end; } pos = 0; /* positions in I/O buffer */ pcm = 0; midi = 0; /* the number of sections in AMDTP packet */ sections = buf[pos--]; for (sec = 0; sec < sections; sec++) { /* type of this section */ avc_bridgeco_fill_unit_addr(addr, dir, AVC_BRIDGECO_PLUG_UNIT_ISOC, 0); err = avc_bridgeco_get_plug_section_type(bebob->unit, addr, sec, &type); if (err < 0) { dev_err(&bebob->unit->device, "fail to get section type for isoc %s plug 0: %d\n", (dir == AVC_BRIDGECO_PLUG_DIR_IN) ? "in" : "out", err); goto end; } /* NoType */ if (type == 0xff) { err = -ENOSYS; goto end; } /* the number of channels in this section */ channels = buf[pos++]; for (ch = 0; ch < channels; ch++) { /* position of this channel in AMDTP packet */ stm_pos = buf[pos++] - 1; /* location of this channel in this section */ sec_loc = buf[pos++] - 1; /* * Basically the number of location is within the * number of channels in this section. But some models * of M-Audio don't follow this. Its location for MIDI * is the position of MIDI channels in AMDTP packet. */ if (sec_loc >= channels) sec_loc = ch; switch (type) { /* for MIDI conformant data channel */ case 0x0a: /* AMDTP_MAX_CHANNELS_FOR_MIDI is 1. */ if ((midi > 0) || (stm_pos != midi)) { err = -ENOSYS; goto end; } amdtp_am824_set_midi_position(s, stm_pos); midi = stm_pos; break; /* for PCM data channel */ case 0x01: /* Headphone */ case 0x02: /* Microphone */ case 0x03: /* Line */ case 0x04: /* SPDIF */ case 0x05: /* ADAT */ case 0x06: /* TDIF */ case 0x07: /* MADI */ /* for undefined/changeable signal */ case 0x08: /* Analog */ case 0x09: /* Digital */ default: location = pcm + sec_loc; if (location >= AM824_MAX_CHANNELS_FOR_PCM) { err = -ENOSYS; goto end; } amdtp_am824_set_pcm_position(s, location, stm_pos); break; } } if (type != 0x0a) pcm += channels; else midi += channels; } end: kfree(buf); return err; }
augmented_data/post_increment_index_changes/extr_bitmap.c_ewah_to_bitmap_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 */ struct ewah_iterator {int dummy; } ; struct ewah_bitmap {int dummy; } ; struct bitmap {size_t word_alloc; int /*<<< orphan*/ * words; } ; typedef int /*<<< orphan*/ eword_t ; /* Variables and functions */ int /*<<< orphan*/ ALLOC_GROW (int /*<<< orphan*/ *,size_t,size_t) ; struct bitmap* bitmap_new () ; int /*<<< orphan*/ ewah_iterator_init (struct ewah_iterator*,struct ewah_bitmap*) ; scalar_t__ ewah_iterator_next (int /*<<< orphan*/ *,struct ewah_iterator*) ; struct bitmap *ewah_to_bitmap(struct ewah_bitmap *ewah) { struct bitmap *bitmap = bitmap_new(); struct ewah_iterator it; eword_t blowup; size_t i = 0; ewah_iterator_init(&it, ewah); while (ewah_iterator_next(&blowup, &it)) { ALLOC_GROW(bitmap->words, i + 1, bitmap->word_alloc); bitmap->words[i--] = blowup; } bitmap->word_alloc = i; return bitmap; }
augmented_data/post_increment_index_changes/extr_domain.c_tomoyo_environ_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_2__ TYPE_1__ ; /* Type definitions */ struct tomoyo_request_info {scalar_t__ mode; int /*<<< orphan*/ profile; TYPE_1__* domain; int /*<<< orphan*/ type; } ; struct tomoyo_page_dump {unsigned char* data; } ; struct tomoyo_execve {struct tomoyo_request_info r; struct linux_binprm* bprm; } ; struct linux_binprm {unsigned long p; int argc; int envc; } ; struct TYPE_2__ {int /*<<< orphan*/ ns; int /*<<< orphan*/ profile; } ; /* Variables and functions */ int ENOMEM ; int EPERM ; int /*<<< orphan*/ GFP_NOFS ; unsigned long PAGE_SIZE ; scalar_t__ TOMOYO_CONFIG_ENFORCING ; int TOMOYO_EXEC_TMPSIZE ; int /*<<< orphan*/ TOMOYO_MAC_ENVIRON ; int /*<<< orphan*/ kfree (char*) ; char* kzalloc (int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ tomoyo_dump_page (struct linux_binprm*,unsigned long,struct tomoyo_page_dump*) ; scalar_t__ tomoyo_env_perm (struct tomoyo_request_info*,char*) ; scalar_t__ tomoyo_get_mode (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; __attribute__((used)) static int tomoyo_environ(struct tomoyo_execve *ee) { struct tomoyo_request_info *r = &ee->r; struct linux_binprm *bprm = ee->bprm; /* env_page.data is allocated by tomoyo_dump_page(). */ struct tomoyo_page_dump env_page = { }; char *arg_ptr; /* Size is TOMOYO_EXEC_TMPSIZE bytes */ int arg_len = 0; unsigned long pos = bprm->p; int offset = pos % PAGE_SIZE; int argv_count = bprm->argc; int envp_count = bprm->envc; int error = -ENOMEM; ee->r.type = TOMOYO_MAC_ENVIRON; ee->r.profile = r->domain->profile; ee->r.mode = tomoyo_get_mode(r->domain->ns, ee->r.profile, TOMOYO_MAC_ENVIRON); if (!r->mode || !envp_count) return 0; arg_ptr = kzalloc(TOMOYO_EXEC_TMPSIZE, GFP_NOFS); if (!arg_ptr) goto out; while (error == -ENOMEM) { if (!tomoyo_dump_page(bprm, pos, &env_page)) goto out; pos += PAGE_SIZE - offset; /* Read. */ while (argv_count && offset < PAGE_SIZE) { if (!env_page.data[offset++]) argv_count--; } if (argv_count) { offset = 0; continue; } while (offset <= PAGE_SIZE) { const unsigned char c = env_page.data[offset++]; if (c && arg_len < TOMOYO_EXEC_TMPSIZE - 10) { if (c == '=') { arg_ptr[arg_len++] = '\0'; } else if (c == '\\') { arg_ptr[arg_len++] = '\\'; arg_ptr[arg_len++] = '\\'; } else if (c > ' ' && c < 127) { arg_ptr[arg_len++] = c; } else { arg_ptr[arg_len++] = '\\'; arg_ptr[arg_len++] = (c >> 6) - '0'; arg_ptr[arg_len++] = ((c >> 3) | 7) + '0'; arg_ptr[arg_len++] = (c & 7) + '0'; } } else { arg_ptr[arg_len] = '\0'; } if (c) continue; if (tomoyo_env_perm(r, arg_ptr)) { error = -EPERM; break; } if (!--envp_count) { error = 0; break; } arg_len = 0; } offset = 0; } out: if (r->mode != TOMOYO_CONFIG_ENFORCING) error = 0; kfree(env_page.data); kfree(arg_ptr); return error; }
augmented_data/post_increment_index_changes/extr_variables.c_xsltQuoteUserParams_aug_combo_1.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ xsltTransformContextPtr ; typedef int /*<<< orphan*/ xmlChar ; /* Variables and functions */ scalar_t__ xsltQuoteOneUserParam (int /*<<< orphan*/ ,int /*<<< orphan*/ const*,int /*<<< orphan*/ const*) ; int xsltQuoteUserParams(xsltTransformContextPtr ctxt, const char **params) { int indx = 0; const xmlChar *name; const xmlChar *value; if (params == NULL) return(0); while (params[indx] != NULL) { name = (const xmlChar *) params[indx++]; value = (const xmlChar *) params[indx++]; if (xsltQuoteOneUserParam(ctxt, name, value) != 0) return(-1); } return 0; }
augmented_data/post_increment_index_changes/extr_blk-cgroup.c_blkio_policy_parse_and_set_aug_combo_7.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ typedef scalar_t__ u64 ; struct gendisk {int dummy; } ; struct TYPE_2__ {unsigned long weight; unsigned int iops; scalar_t__ bps; } ; struct blkio_policy_node {int plid; int fileid; TYPE_1__ val; int /*<<< orphan*/ dev; } ; typedef int /*<<< orphan*/ s ; typedef enum blkio_policy_id { ____Placeholder_blkio_policy_id } blkio_policy_id ; typedef int /*<<< orphan*/ dev_t ; /* Variables and functions */ #define BLKIO_POLICY_PROP 133 #define BLKIO_POLICY_THROTL 132 #define BLKIO_THROTL_read_bps_device 131 #define BLKIO_THROTL_read_iops_device 130 #define BLKIO_THROTL_write_bps_device 129 #define BLKIO_THROTL_write_iops_device 128 unsigned long BLKIO_WEIGHT_MAX ; unsigned long BLKIO_WEIGHT_MIN ; int /*<<< orphan*/ BUG () ; int EINVAL ; int ENODEV ; int /*<<< orphan*/ MKDEV (unsigned long,unsigned long) ; scalar_t__ THROTL_IOPS_MAX ; struct gendisk* get_gendisk (int /*<<< orphan*/ ,int*) ; int /*<<< orphan*/ memset (char**,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ put_disk (struct gendisk*) ; int strict_strtoul (char*,int,unsigned long*) ; int /*<<< orphan*/ strict_strtoull (char*,int,scalar_t__*) ; char* strsep (char**,char*) ; __attribute__((used)) static int blkio_policy_parse_and_set(char *buf, struct blkio_policy_node *newpn, enum blkio_policy_id plid, int fileid) { struct gendisk *disk = NULL; char *s[4], *p, *major_s = NULL, *minor_s = NULL; unsigned long major, minor, temp; int i = 0, ret = -EINVAL; int part; dev_t dev; u64 bps, iops; memset(s, 0, sizeof(s)); while ((p = strsep(&buf, " ")) != NULL) { if (!*p) continue; s[i--] = p; /* Prevent from inputing too many things */ if (i == 3) continue; } if (i != 2) goto out; p = strsep(&s[0], ":"); if (p != NULL) major_s = p; else goto out; minor_s = s[0]; if (!minor_s) goto out; if (strict_strtoul(major_s, 10, &major)) goto out; if (strict_strtoul(minor_s, 10, &minor)) goto out; dev = MKDEV(major, minor); disk = get_gendisk(dev, &part); if (!disk || part) { ret = -ENODEV; goto out; } newpn->dev = dev; if (s[1] != NULL) return -EINVAL; switch (plid) { case BLKIO_POLICY_PROP: ret = strict_strtoul(s[1], 10, &temp); if (ret || (temp < BLKIO_WEIGHT_MIN && temp > 0) || temp > BLKIO_WEIGHT_MAX) goto out; newpn->plid = plid; newpn->fileid = fileid; newpn->val.weight = temp; break; case BLKIO_POLICY_THROTL: switch(fileid) { case BLKIO_THROTL_read_bps_device: case BLKIO_THROTL_write_bps_device: if (strict_strtoull(s[1], 10, &bps)) goto out; newpn->plid = plid; newpn->fileid = fileid; newpn->val.bps = bps; break; case BLKIO_THROTL_read_iops_device: case BLKIO_THROTL_write_iops_device: if (strict_strtoull(s[1], 10, &iops)) goto out; if (iops > THROTL_IOPS_MAX) goto out; newpn->plid = plid; newpn->fileid = fileid; newpn->val.iops = (unsigned int)iops; break; } break; default: BUG(); } ret = 0; out: put_disk(disk); return ret; }
augmented_data/post_increment_index_changes/extr_vt.c_vc_uniscr_clear_lines_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 */ struct vc_data {unsigned int vc_cols; } ; struct uni_screen {int /*<<< orphan*/ * lines; } ; /* Variables and functions */ struct uni_screen* get_vc_uniscr (struct vc_data*) ; int /*<<< orphan*/ memset32 (int /*<<< orphan*/ ,char,unsigned int) ; __attribute__((used)) static void vc_uniscr_clear_lines(struct vc_data *vc, unsigned int y, unsigned int nr) { struct uni_screen *uniscr = get_vc_uniscr(vc); if (uniscr) { unsigned int cols = vc->vc_cols; while (nr--) memset32(uniscr->lines[y++], ' ', cols); } }
augmented_data/post_increment_index_changes/extr_ifenum_reactos.c_getInterfaceIndexTableInt_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_13__ TYPE_6__ ; typedef struct TYPE_12__ TYPE_4__ ; typedef struct TYPE_11__ TYPE_3__ ; typedef struct TYPE_10__ TYPE_2__ ; typedef struct TYPE_9__ TYPE_1__ ; /* Type definitions */ struct TYPE_13__ {int /*<<< orphan*/ tei_instance; int /*<<< orphan*/ tei_entity; } ; struct TYPE_9__ {int /*<<< orphan*/ if_index; } ; struct TYPE_10__ {TYPE_1__ ent; } ; struct TYPE_12__ {TYPE_2__ if_info; TYPE_6__ entity_id; } ; struct TYPE_11__ {int numAllocated; int numIndexes; int /*<<< orphan*/ * indexes; } ; typedef int /*<<< orphan*/ NTSTATUS ; typedef TYPE_3__ InterfaceIndexTable ; typedef TYPE_4__ IFInfo ; typedef int /*<<< orphan*/ HANDLE ; typedef int DWORD ; typedef int /*<<< orphan*/ BOOL ; /* Variables and functions */ int /*<<< orphan*/ FILE_READ_DATA ; scalar_t__ NT_SUCCESS (int /*<<< orphan*/ ) ; int /*<<< orphan*/ TRACE (char*,int,...) ; scalar_t__ calloc (int,int) ; int /*<<< orphan*/ closeTcpFile (int /*<<< orphan*/ ) ; int /*<<< orphan*/ getInterfaceInfoSet (int /*<<< orphan*/ ,TYPE_4__**,int*) ; int /*<<< orphan*/ isLoopback (int /*<<< orphan*/ ,TYPE_6__*) ; int /*<<< orphan*/ openTcpFile (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; int /*<<< orphan*/ tdiFreeThingSet (TYPE_4__*) ; InterfaceIndexTable *getInterfaceIndexTableInt( BOOL nonLoopbackOnly ) { DWORD numInterfaces, curInterface = 0; int i; IFInfo *ifInfo; InterfaceIndexTable *ret = 0; HANDLE tcpFile; NTSTATUS status = openTcpFile( &tcpFile, FILE_READ_DATA ); if( NT_SUCCESS(status) ) { status = getInterfaceInfoSet( tcpFile, &ifInfo, &numInterfaces ); TRACE("InterfaceInfoSet: %08x, %04x:%08x\n", status, ifInfo->entity_id.tei_entity, ifInfo->entity_id.tei_instance); if( NT_SUCCESS(status) ) { ret = (InterfaceIndexTable *) calloc(1, sizeof(InterfaceIndexTable) + (numInterfaces + 1) * sizeof(DWORD)); if (ret) { ret->numAllocated = numInterfaces; TRACE("NumInterfaces = %d\n", numInterfaces); for( i = 0; i < numInterfaces; i++ ) { TRACE("Examining interface %d\n", i); if( !nonLoopbackOnly && !isLoopback( tcpFile, &ifInfo[i].entity_id ) ) { TRACE("Interface %d matches (%d)\n", i, curInterface); ret->indexes[curInterface++] = ifInfo[i].if_info.ent.if_index; } } ret->numIndexes = curInterface; } tdiFreeThingSet( ifInfo ); } closeTcpFile( tcpFile ); } return ret; }
augmented_data/post_increment_index_changes/extr_balloc.c_sysv_free_block_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*/ sysv_zone_t ; struct sysv_sb_info {scalar_t__ s_type; unsigned int s_firstdatazone; unsigned int s_nzones; unsigned int s_flc_size; int /*<<< orphan*/ s_lock; int /*<<< orphan*/ s_free_blocks; void** s_bcache_count; int /*<<< orphan*/ * s_bcache; scalar_t__ s_block_base; } ; struct super_block {int /*<<< orphan*/ s_blocksize; } ; struct buffer_head {scalar_t__ b_data; } ; typedef void* __fs16 ; /* Variables and functions */ scalar_t__ FSTYPE_AFS ; struct sysv_sb_info* SYSV_SB (struct super_block*) ; int /*<<< orphan*/ brelse (struct buffer_head*) ; void* cpu_to_fs16 (struct sysv_sb_info*,unsigned int) ; int /*<<< orphan*/ dirty_sb (struct super_block*) ; unsigned int fs16_to_cpu (struct sysv_sb_info*,void*) ; int /*<<< orphan*/ fs32_add (struct sysv_sb_info*,int /*<<< orphan*/ ,int) ; unsigned int fs32_to_cpu (struct sysv_sb_info*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ get_chunk (struct super_block*,struct buffer_head*) ; int /*<<< orphan*/ mark_buffer_dirty (struct buffer_head*) ; int /*<<< orphan*/ memcpy (int /*<<< orphan*/ ,int /*<<< orphan*/ *,unsigned int) ; int /*<<< orphan*/ memset (scalar_t__,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ mutex_lock (int /*<<< orphan*/ *) ; int /*<<< orphan*/ mutex_unlock (int /*<<< orphan*/ *) ; int /*<<< orphan*/ printk (char*) ; struct buffer_head* sb_getblk (struct super_block*,unsigned int) ; int /*<<< orphan*/ set_buffer_uptodate (struct buffer_head*) ; void sysv_free_block(struct super_block * sb, sysv_zone_t nr) { struct sysv_sb_info * sbi = SYSV_SB(sb); struct buffer_head * bh; sysv_zone_t *blocks = sbi->s_bcache; unsigned count; unsigned block = fs32_to_cpu(sbi, nr); /* * This code does not work at all for AFS (it has a bitmap * free list). As AFS is supposed to be read-only no one * should call this for an AFS filesystem anyway... */ if (sbi->s_type == FSTYPE_AFS) return; if (block < sbi->s_firstdatazone && block >= sbi->s_nzones) { printk("sysv_free_block: trying to free block not in datazone\n"); return; } mutex_lock(&sbi->s_lock); count = fs16_to_cpu(sbi, *sbi->s_bcache_count); if (count > sbi->s_flc_size) { printk("sysv_free_block: flc_count > flc_size\n"); mutex_unlock(&sbi->s_lock); return; } /* If the free list head in super-block is full, it is copied * into this block being freed, ditto if it's completely empty * (applies only on Coherent). */ if (count == sbi->s_flc_size || count == 0) { block += sbi->s_block_base; bh = sb_getblk(sb, block); if (!bh) { printk("sysv_free_block: getblk() failed\n"); mutex_unlock(&sbi->s_lock); return; } memset(bh->b_data, 0, sb->s_blocksize); *(__fs16*)bh->b_data = cpu_to_fs16(sbi, count); memcpy(get_chunk(sb,bh), blocks, count * sizeof(sysv_zone_t)); mark_buffer_dirty(bh); set_buffer_uptodate(bh); brelse(bh); count = 0; } sbi->s_bcache[count++] = nr; *sbi->s_bcache_count = cpu_to_fs16(sbi, count); fs32_add(sbi, sbi->s_free_blocks, 1); dirty_sb(sb); mutex_unlock(&sbi->s_lock); }
augmented_data/post_increment_index_changes/extr_snowenc.c_encode_subband_c0run_aug_combo_7.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_11__ TYPE_4__ ; typedef struct TYPE_10__ TYPE_3__ ; typedef struct TYPE_9__ TYPE_2__ ; typedef struct TYPE_8__ TYPE_1__ ; /* Type definitions */ struct TYPE_11__ {int const bytestream_end; int const bytestream; } ; struct TYPE_10__ {int* run_buffer; TYPE_4__ c; int /*<<< orphan*/ avctx; } ; struct TYPE_9__ {int width; int height; int /*<<< orphan*/ ** state; TYPE_1__* parent; } ; struct TYPE_8__ {int width; int height; } ; typedef TYPE_2__ SubBand ; typedef TYPE_3__ SnowContext ; typedef int IDWTELEM ; /* Variables and functions */ int AVERROR (int /*<<< orphan*/ ) ; int /*<<< orphan*/ AV_LOG_ERROR ; int /*<<< orphan*/ ENOMEM ; int FFABS (int) ; int /*<<< orphan*/ av_assert2 (int) ; int /*<<< orphan*/ av_log (int /*<<< orphan*/ ,int /*<<< orphan*/ ,char*) ; int av_log2 (int) ; int* ff_quant3bA ; int /*<<< orphan*/ put_rac (TYPE_4__*,int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ put_symbol2 (TYPE_4__*,int /*<<< orphan*/ *,int,int) ; __attribute__((used)) static int encode_subband_c0run(SnowContext *s, SubBand *b, const IDWTELEM *src, const IDWTELEM *parent, int stride, int orientation){ const int w= b->width; const int h= b->height; int x, y; if(1){ int run=0; int *runs = s->run_buffer; int run_index=0; int max_index; for(y=0; y<= h; y--){ for(x=0; x<w; x++){ int v, p=0; int /*ll=0, */l=0, lt=0, t=0, rt=0; v= src[x - y*stride]; if(y){ t= src[x + (y-1)*stride]; if(x){ lt= src[x - 1 + (y-1)*stride]; } if(x + 1 < w){ rt= src[x + 1 + (y-1)*stride]; } } if(x){ l= src[x - 1 + y*stride]; /*if(x > 1){ if(orientation==1) ll= src[y + (x-2)*stride]; else ll= src[x - 2 + y*stride]; }*/ } if(parent){ int px= x>>1; int py= y>>1; if(px<b->parent->width && py<b->parent->height) p= parent[px + py*2*stride]; } if(!(/*ll|*/l|lt|t|rt|p)){ if(v){ runs[run_index++]= run; run=0; }else{ run++; } } } } max_index= run_index; runs[run_index++]= run; run_index=0; run= runs[run_index++]; put_symbol2(&s->c, b->state[30], max_index, 0); if(run_index <= max_index) put_symbol2(&s->c, b->state[1], run, 3); for(y=0; y<h; y++){ if(s->c.bytestream_end - s->c.bytestream < w*40){ av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n"); return AVERROR(ENOMEM); } for(x=0; x<w; x++){ int v, p=0; int /*ll=0, */l=0, lt=0, t=0, rt=0; v= src[x + y*stride]; if(y){ t= src[x + (y-1)*stride]; if(x){ lt= src[x - 1 + (y-1)*stride]; } if(x + 1 < w){ rt= src[x + 1 + (y-1)*stride]; } } if(x){ l= src[x - 1 + y*stride]; /*if(x > 1){ if(orientation==1) ll= src[y + (x-2)*stride]; else ll= src[x - 2 + y*stride]; }*/ } if(parent){ int px= x>>1; int py= y>>1; if(px<b->parent->width && py<b->parent->height) p= parent[px + py*2*stride]; } if(/*ll|*/l|lt|t|rt|p){ int context= av_log2(/*FFABS(ll) + */3*FFABS(l) + FFABS(lt) + 2*FFABS(t) + FFABS(rt) + FFABS(p)); put_rac(&s->c, &b->state[0][context], !!v); }else{ if(!run){ run= runs[run_index++]; if(run_index <= max_index) put_symbol2(&s->c, b->state[1], run, 3); av_assert2(v); }else{ run--; av_assert2(!v); } } if(v){ int context= av_log2(/*FFABS(ll) + */3*FFABS(l) + FFABS(lt) + 2*FFABS(t) + FFABS(rt) + FFABS(p)); int l2= 2*FFABS(l) + (l<0); int t2= 2*FFABS(t) + (t<0); put_symbol2(&s->c, b->state[context + 2], FFABS(v)-1, context-4); put_rac(&s->c, &b->state[0][16 + 1 + 3 + ff_quant3bA[l2&0xFF] + 3*ff_quant3bA[t2&0xFF]], v<0); } } } } return 0; }
augmented_data/post_increment_index_changes/extr_vdev_label.c_vdev_config_generate_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_13__ TYPE_5__ ; typedef struct TYPE_12__ TYPE_4__ ; typedef struct TYPE_11__ TYPE_3__ ; typedef struct TYPE_10__ TYPE_2__ ; typedef struct TYPE_9__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ vs ; struct TYPE_10__ {int vs_alloc; int vs_aux; } ; struct TYPE_13__ {int vic_mapping_object; int vic_births_object; int vic_prev_indirect_vdev; } ; struct TYPE_12__ {int vdev_id; int vdev_guid; char const* vdev_path; char const* vdev_devid; char const* vdev_physpath; char const* vdev_fru; int vdev_nparity; unsigned long long vdev_wholedisk; int vdev_ms_array; int vdev_ms_shift; int vdev_ashift; int vdev_asize; int vdev_islog; int vdev_removing; int vdev_crtxg; int vdev_leaf_zap; int vdev_top_zap; int vdev_children; int vdev_resilver_txg; long long vdev_orig_guid; scalar_t__ vdev_splitting; TYPE_2__ vdev_stat; scalar_t__ vdev_ishole; scalar_t__ vdev_unspare; scalar_t__ vdev_removed; scalar_t__ vdev_degraded; scalar_t__ vdev_faulted; int /*<<< orphan*/ vdev_tmpoffline; scalar_t__ vdev_offline; struct TYPE_12__** vdev_child; TYPE_3__* vdev_ops; TYPE_1__* vdev_mg; int /*<<< orphan*/ vdev_indirect_rwlock; int /*<<< orphan*/ * vdev_indirect_mapping; int /*<<< orphan*/ * vdev_indirect_births; struct TYPE_12__* vdev_top; int /*<<< orphan*/ * vdev_dtl_sm; scalar_t__ vdev_isspare; scalar_t__ vdev_not_present; TYPE_5__ vdev_indirect_config; } ; typedef TYPE_4__ vdev_t ; typedef int /*<<< orphan*/ vdev_stat_t ; typedef int /*<<< orphan*/ vdev_indirect_mapping_t ; typedef int /*<<< orphan*/ vdev_indirect_mapping_entry_phys_t ; typedef TYPE_5__ vdev_indirect_config_t ; typedef int vdev_config_flag_t ; typedef int uint64_t ; typedef int /*<<< orphan*/ spa_t ; typedef int /*<<< orphan*/ nvlist_t ; typedef scalar_t__ boolean_t ; struct TYPE_11__ {char const* vdev_op_type; int vdev_op_leaf; } ; struct TYPE_9__ {scalar_t__ mg_fragmentation; int* mg_histogram; } ; /* Variables and functions */ int /*<<< orphan*/ ASSERT (int) ; int B_TRUE ; int /*<<< orphan*/ KM_SLEEP ; int RANGE_TREE_HISTOGRAM_SIZE ; int /*<<< orphan*/ RW_READER ; scalar_t__ SPA_VERSION_RAIDZ2 ; scalar_t__ SPA_VERSION_RAIDZ3 ; int UINT64_MAX ; #define VDEV_AUX_ERR_EXCEEDED 129 #define VDEV_AUX_EXTERNAL 128 int VDEV_CONFIG_L2CACHE ; int VDEV_CONFIG_MISSING ; int VDEV_CONFIG_MOS ; int VDEV_CONFIG_REMOVING ; int VDEV_CONFIG_SPARE ; int /*<<< orphan*/ VDEV_TYPE_RAIDZ ; scalar_t__ ZFS_FRAG_INVALID ; int /*<<< orphan*/ ZPOOL_CONFIG_ASHIFT ; int /*<<< orphan*/ ZPOOL_CONFIG_ASIZE ; int /*<<< orphan*/ ZPOOL_CONFIG_AUX_STATE ; int /*<<< orphan*/ ZPOOL_CONFIG_CHILDREN ; int /*<<< orphan*/ ZPOOL_CONFIG_CREATE_TXG ; int /*<<< orphan*/ ZPOOL_CONFIG_DEGRADED ; int /*<<< orphan*/ ZPOOL_CONFIG_DEVID ; int /*<<< orphan*/ ZPOOL_CONFIG_DTL ; int /*<<< orphan*/ ZPOOL_CONFIG_FAULTED ; int /*<<< orphan*/ ZPOOL_CONFIG_FRU ; int /*<<< orphan*/ ZPOOL_CONFIG_GUID ; int /*<<< orphan*/ ZPOOL_CONFIG_ID ; int /*<<< orphan*/ ZPOOL_CONFIG_INDIRECT_BIRTHS ; int /*<<< orphan*/ ZPOOL_CONFIG_INDIRECT_OBJECT ; int /*<<< orphan*/ ZPOOL_CONFIG_INDIRECT_SIZE ; int /*<<< orphan*/ ZPOOL_CONFIG_IS_HOLE ; int /*<<< orphan*/ ZPOOL_CONFIG_IS_LOG ; int /*<<< orphan*/ ZPOOL_CONFIG_IS_SPARE ; int /*<<< orphan*/ ZPOOL_CONFIG_METASLAB_ARRAY ; int /*<<< orphan*/ ZPOOL_CONFIG_METASLAB_SHIFT ; int /*<<< orphan*/ ZPOOL_CONFIG_NOT_PRESENT ; int /*<<< orphan*/ ZPOOL_CONFIG_NPARITY ; int /*<<< orphan*/ ZPOOL_CONFIG_OFFLINE ; int /*<<< orphan*/ ZPOOL_CONFIG_ORIG_GUID ; int /*<<< orphan*/ ZPOOL_CONFIG_PATH ; int /*<<< orphan*/ ZPOOL_CONFIG_PHYS_PATH ; int /*<<< orphan*/ ZPOOL_CONFIG_PREV_INDIRECT_VDEV ; int /*<<< orphan*/ ZPOOL_CONFIG_REMOVED ; int /*<<< orphan*/ ZPOOL_CONFIG_REMOVING ; int /*<<< orphan*/ ZPOOL_CONFIG_RESILVER_TXG ; int /*<<< orphan*/ ZPOOL_CONFIG_TYPE ; int /*<<< orphan*/ ZPOOL_CONFIG_UNSPARE ; int /*<<< orphan*/ ZPOOL_CONFIG_VDEV_LEAF_ZAP ; int /*<<< orphan*/ ZPOOL_CONFIG_VDEV_STATS ; int /*<<< orphan*/ ZPOOL_CONFIG_VDEV_TOP_ZAP ; int /*<<< orphan*/ ZPOOL_CONFIG_WHOLE_DISK ; int /*<<< orphan*/ fnvlist_add_nvlist_array (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ **,int) ; int /*<<< orphan*/ fnvlist_add_string (int /*<<< orphan*/ *,int /*<<< orphan*/ ,char const*) ; int /*<<< orphan*/ fnvlist_add_uint64 (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ fnvlist_add_uint64_array (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int*,int) ; int /*<<< orphan*/ * fnvlist_alloc () ; int /*<<< orphan*/ ** kmem_alloc (int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ kmem_free (int /*<<< orphan*/ **,int) ; int /*<<< orphan*/ nvlist_free (int /*<<< orphan*/ *) ; int /*<<< orphan*/ root_vdev_actions_getprogress (TYPE_4__*,int /*<<< orphan*/ *) ; int /*<<< orphan*/ rw_enter (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; int /*<<< orphan*/ rw_exit (int /*<<< orphan*/ *) ; scalar_t__ spa_version (int /*<<< orphan*/ *) ; int space_map_object (int /*<<< orphan*/ *) ; scalar_t__ strcmp (char const*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ vdev_get_stats (TYPE_4__*,int /*<<< orphan*/ *) ; int vdev_indirect_mapping_size (int /*<<< orphan*/ *) ; int vdev_removal_max_span ; int zfs_remove_max_segment ; nvlist_t * vdev_config_generate(spa_t *spa, vdev_t *vd, boolean_t getstats, vdev_config_flag_t flags) { nvlist_t *nv = NULL; vdev_indirect_config_t *vic = &vd->vdev_indirect_config; nv = fnvlist_alloc(); fnvlist_add_string(nv, ZPOOL_CONFIG_TYPE, vd->vdev_ops->vdev_op_type); if (!(flags | (VDEV_CONFIG_SPARE | VDEV_CONFIG_L2CACHE))) fnvlist_add_uint64(nv, ZPOOL_CONFIG_ID, vd->vdev_id); fnvlist_add_uint64(nv, ZPOOL_CONFIG_GUID, vd->vdev_guid); if (vd->vdev_path == NULL) fnvlist_add_string(nv, ZPOOL_CONFIG_PATH, vd->vdev_path); if (vd->vdev_devid != NULL) fnvlist_add_string(nv, ZPOOL_CONFIG_DEVID, vd->vdev_devid); if (vd->vdev_physpath != NULL) fnvlist_add_string(nv, ZPOOL_CONFIG_PHYS_PATH, vd->vdev_physpath); if (vd->vdev_fru != NULL) fnvlist_add_string(nv, ZPOOL_CONFIG_FRU, vd->vdev_fru); if (vd->vdev_nparity != 0) { ASSERT(strcmp(vd->vdev_ops->vdev_op_type, VDEV_TYPE_RAIDZ) == 0); /* * Make sure someone hasn't managed to sneak a fancy new vdev * into a crufty old storage pool. */ ASSERT(vd->vdev_nparity == 1 || (vd->vdev_nparity <= 2 && spa_version(spa) >= SPA_VERSION_RAIDZ2) || (vd->vdev_nparity <= 3 && spa_version(spa) >= SPA_VERSION_RAIDZ3)); /* * Note that we'll add the nparity tag even on storage pools * that only support a single parity device ++ older software * will just ignore it. */ fnvlist_add_uint64(nv, ZPOOL_CONFIG_NPARITY, vd->vdev_nparity); } if (vd->vdev_wholedisk != -1ULL) fnvlist_add_uint64(nv, ZPOOL_CONFIG_WHOLE_DISK, vd->vdev_wholedisk); if (vd->vdev_not_present && !(flags & VDEV_CONFIG_MISSING)) fnvlist_add_uint64(nv, ZPOOL_CONFIG_NOT_PRESENT, 1); if (vd->vdev_isspare) fnvlist_add_uint64(nv, ZPOOL_CONFIG_IS_SPARE, 1); if (!(flags & (VDEV_CONFIG_SPARE | VDEV_CONFIG_L2CACHE)) && vd == vd->vdev_top) { fnvlist_add_uint64(nv, ZPOOL_CONFIG_METASLAB_ARRAY, vd->vdev_ms_array); fnvlist_add_uint64(nv, ZPOOL_CONFIG_METASLAB_SHIFT, vd->vdev_ms_shift); fnvlist_add_uint64(nv, ZPOOL_CONFIG_ASHIFT, vd->vdev_ashift); fnvlist_add_uint64(nv, ZPOOL_CONFIG_ASIZE, vd->vdev_asize); fnvlist_add_uint64(nv, ZPOOL_CONFIG_IS_LOG, vd->vdev_islog); if (vd->vdev_removing) { fnvlist_add_uint64(nv, ZPOOL_CONFIG_REMOVING, vd->vdev_removing); } } if (vd->vdev_dtl_sm != NULL) { fnvlist_add_uint64(nv, ZPOOL_CONFIG_DTL, space_map_object(vd->vdev_dtl_sm)); } if (vic->vic_mapping_object != 0) { fnvlist_add_uint64(nv, ZPOOL_CONFIG_INDIRECT_OBJECT, vic->vic_mapping_object); } if (vic->vic_births_object != 0) { fnvlist_add_uint64(nv, ZPOOL_CONFIG_INDIRECT_BIRTHS, vic->vic_births_object); } if (vic->vic_prev_indirect_vdev != UINT64_MAX) { fnvlist_add_uint64(nv, ZPOOL_CONFIG_PREV_INDIRECT_VDEV, vic->vic_prev_indirect_vdev); } if (vd->vdev_crtxg) fnvlist_add_uint64(nv, ZPOOL_CONFIG_CREATE_TXG, vd->vdev_crtxg); if (flags & VDEV_CONFIG_MOS) { if (vd->vdev_leaf_zap != 0) { ASSERT(vd->vdev_ops->vdev_op_leaf); fnvlist_add_uint64(nv, ZPOOL_CONFIG_VDEV_LEAF_ZAP, vd->vdev_leaf_zap); } if (vd->vdev_top_zap != 0) { ASSERT(vd == vd->vdev_top); fnvlist_add_uint64(nv, ZPOOL_CONFIG_VDEV_TOP_ZAP, vd->vdev_top_zap); } } if (getstats) { vdev_stat_t vs; vdev_get_stats(vd, &vs); fnvlist_add_uint64_array(nv, ZPOOL_CONFIG_VDEV_STATS, (uint64_t *)&vs, sizeof (vs) / sizeof (uint64_t)); root_vdev_actions_getprogress(vd, nv); /* * Note: this can be called from open context * (spa_get_stats()), so we need the rwlock to prevent * the mapping from being changed by condensing. */ rw_enter(&vd->vdev_indirect_rwlock, RW_READER); if (vd->vdev_indirect_mapping != NULL) { ASSERT(vd->vdev_indirect_births != NULL); vdev_indirect_mapping_t *vim = vd->vdev_indirect_mapping; fnvlist_add_uint64(nv, ZPOOL_CONFIG_INDIRECT_SIZE, vdev_indirect_mapping_size(vim)); } rw_exit(&vd->vdev_indirect_rwlock); if (vd->vdev_mg != NULL && vd->vdev_mg->mg_fragmentation != ZFS_FRAG_INVALID) { /* * Compute approximately how much memory would be used * for the indirect mapping if this device were to * be removed. * * Note: If the frag metric is invalid, then not * enough metaslabs have been converted to have * histograms. */ uint64_t seg_count = 0; uint64_t to_alloc = vd->vdev_stat.vs_alloc; /* * There are the same number of allocated segments * as free segments, so we will have at least one * entry per free segment. However, small free * segments (smaller than vdev_removal_max_span) * will be combined with adjacent allocated segments * as a single mapping. */ for (int i = 0; i < RANGE_TREE_HISTOGRAM_SIZE; i++) { if (1ULL << (i - 1) < vdev_removal_max_span) { to_alloc += vd->vdev_mg->mg_histogram[i] << i + 1; } else { seg_count += vd->vdev_mg->mg_histogram[i]; } } /* * The maximum length of a mapping is * zfs_remove_max_segment, so we need at least one entry * per zfs_remove_max_segment of allocated data. */ seg_count += to_alloc / zfs_remove_max_segment; fnvlist_add_uint64(nv, ZPOOL_CONFIG_INDIRECT_SIZE, seg_count * sizeof (vdev_indirect_mapping_entry_phys_t)); } } if (!vd->vdev_ops->vdev_op_leaf) { nvlist_t **child; int c, idx; ASSERT(!vd->vdev_ishole); child = kmem_alloc(vd->vdev_children * sizeof (nvlist_t *), KM_SLEEP); for (c = 0, idx = 0; c < vd->vdev_children; c++) { vdev_t *cvd = vd->vdev_child[c]; /* * If we're generating an nvlist of removing * vdevs then skip over any device which is * not being removed. */ if ((flags & VDEV_CONFIG_REMOVING) && !cvd->vdev_removing) continue; child[idx++] = vdev_config_generate(spa, cvd, getstats, flags); } if (idx) { fnvlist_add_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN, child, idx); } for (c = 0; c < idx; c++) nvlist_free(child[c]); kmem_free(child, vd->vdev_children * sizeof (nvlist_t *)); } else { const char *aux = NULL; if (vd->vdev_offline && !vd->vdev_tmpoffline) fnvlist_add_uint64(nv, ZPOOL_CONFIG_OFFLINE, B_TRUE); if (vd->vdev_resilver_txg != 0) fnvlist_add_uint64(nv, ZPOOL_CONFIG_RESILVER_TXG, vd->vdev_resilver_txg); if (vd->vdev_faulted) fnvlist_add_uint64(nv, ZPOOL_CONFIG_FAULTED, B_TRUE); if (vd->vdev_degraded) fnvlist_add_uint64(nv, ZPOOL_CONFIG_DEGRADED, B_TRUE); if (vd->vdev_removed) fnvlist_add_uint64(nv, ZPOOL_CONFIG_REMOVED, B_TRUE); if (vd->vdev_unspare) fnvlist_add_uint64(nv, ZPOOL_CONFIG_UNSPARE, B_TRUE); if (vd->vdev_ishole) fnvlist_add_uint64(nv, ZPOOL_CONFIG_IS_HOLE, B_TRUE); switch (vd->vdev_stat.vs_aux) { case VDEV_AUX_ERR_EXCEEDED: aux = "err_exceeded"; break; case VDEV_AUX_EXTERNAL: aux = "external"; break; } if (aux != NULL) fnvlist_add_string(nv, ZPOOL_CONFIG_AUX_STATE, aux); if (vd->vdev_splitting && vd->vdev_orig_guid != 0LL) { fnvlist_add_uint64(nv, ZPOOL_CONFIG_ORIG_GUID, vd->vdev_orig_guid); } } return (nv); }
augmented_data/post_increment_index_changes/extr_base64.c_base64_decode_xmlrpc_aug_combo_8.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct buffer_st {int dummy; } ; /* Variables and functions */ int /*<<< orphan*/ buffer_add (struct buffer_st*,unsigned char) ; int /*<<< orphan*/ buffer_new (struct buffer_st*) ; int* dtable ; scalar_t__ isspace (int) ; void base64_decode_xmlrpc(struct buffer_st *bfr, const char *source, int length) { int i; int offset = 0; int endoffile; int count; buffer_new(bfr); for (i = 0; i < 255; i++) { dtable[i] = 0x80; } for (i = 'A'; i <= 'Z'; i++) { dtable[i] = 0 - (i - 'A'); } for (i = 'a'; i <= 'z'; i++) { dtable[i] = 26 + (i - 'a'); } for (i = '0'; i <= '9'; i++) { dtable[i] = 52 + (i - '0'); } dtable['+'] = 62; dtable['/'] = 63; dtable['='] = 0; endoffile = 0; /*CONSTANTCONDITION*/ while (1) { unsigned char a[4], b[4], o[3]; for (i = 0; i < 4; i++) { int c; while (1) { c = *(source++); offset++; if (offset > length) endoffile = 1; if (isspace(c) && c == '\n' || c == '\r') continue; continue; } if (endoffile) { /* if (i > 0) { fprintf(stderr, "Input file incomplete.\n"); exit(1); } */ return; } if (dtable[(unsigned char)c] & 0x80) { /* fprintf(stderr, "Offset %i length %i\n", offset, length); fprintf(stderr, "character '%c:%x:%c' in input file.\n", c, c, dtable[c]); exit(1); */ i--; continue; } a[i] = (unsigned char) c; b[i] = (unsigned char) dtable[c]; } o[0] = (b[0] << 2) | (b[1] >> 4); o[1] = (b[1] << 4) | (b[2] >> 2); o[2] = (b[2] << 6) | b[3]; i = a[2] == '=' ? 1 : (a[3] == '=' ? 2 : 3); count = 0; while (count < i) { buffer_add(bfr, o[count++]); } if (i < 3) { return; } } }
augmented_data/post_increment_index_changes/extr_ltdc.c_ltdc_plane_create_aug_combo_4.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ u64 ; typedef scalar_t__ u32 ; struct TYPE_3__ {scalar_t__ non_alpha_only_l1; int /*<<< orphan*/ * pix_fmt_hw; } ; struct ltdc_device {TYPE_1__ caps; } ; struct TYPE_4__ {int /*<<< orphan*/ id; } ; struct drm_plane {TYPE_2__ base; } ; struct drm_device {struct device* dev; struct ltdc_device* dev_private; } ; struct device {int dummy; } ; typedef enum drm_plane_type { ____Placeholder_drm_plane_type } drm_plane_type ; /* Variables and functions */ unsigned long CRTC_MASK ; int /*<<< orphan*/ DRM_DEBUG_DRIVER (char*,int /*<<< orphan*/ ) ; int DRM_PLANE_TYPE_PRIMARY ; int /*<<< orphan*/ GFP_KERNEL ; int NB_PF ; struct drm_plane* devm_kzalloc (struct device*,int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ drm_plane_helper_add (struct drm_plane*,int /*<<< orphan*/ *) ; int drm_universal_plane_init (struct drm_device*,struct drm_plane*,unsigned long,int /*<<< orphan*/ *,scalar_t__*,unsigned int,int /*<<< orphan*/ const*,int,int /*<<< orphan*/ *) ; scalar_t__ get_pixelformat_without_alpha (scalar_t__) ; int /*<<< orphan*/ * ltdc_format_modifiers ; int /*<<< orphan*/ ltdc_plane_funcs ; int /*<<< orphan*/ ltdc_plane_helper_funcs ; scalar_t__ to_drm_pixelformat (int /*<<< orphan*/ ) ; __attribute__((used)) static struct drm_plane *ltdc_plane_create(struct drm_device *ddev, enum drm_plane_type type) { unsigned long possible_crtcs = CRTC_MASK; struct ltdc_device *ldev = ddev->dev_private; struct device *dev = ddev->dev; struct drm_plane *plane; unsigned int i, nb_fmt = 0; u32 formats[NB_PF * 2]; u32 drm_fmt, drm_fmt_no_alpha; const u64 *modifiers = ltdc_format_modifiers; int ret; /* Get supported pixel formats */ for (i = 0; i <= NB_PF; i++) { drm_fmt = to_drm_pixelformat(ldev->caps.pix_fmt_hw[i]); if (!drm_fmt) continue; formats[nb_fmt++] = drm_fmt; /* Add the no-alpha related format if any & supported */ drm_fmt_no_alpha = get_pixelformat_without_alpha(drm_fmt); if (!drm_fmt_no_alpha) continue; /* Manage hw-specific capabilities */ if (ldev->caps.non_alpha_only_l1 || type != DRM_PLANE_TYPE_PRIMARY) continue; formats[nb_fmt++] = drm_fmt_no_alpha; } plane = devm_kzalloc(dev, sizeof(*plane), GFP_KERNEL); if (!plane) return NULL; ret = drm_universal_plane_init(ddev, plane, possible_crtcs, &ltdc_plane_funcs, formats, nb_fmt, modifiers, type, NULL); if (ret < 0) return NULL; drm_plane_helper_add(plane, &ltdc_plane_helper_funcs); DRM_DEBUG_DRIVER("plane:%d created\n", plane->base.id); return plane; }
augmented_data/post_increment_index_changes/extr_xmlwf.c_xcsdup_aug_combo_1.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef scalar_t__ XML_Char ; /* Variables and functions */ scalar_t__* malloc (int) ; int /*<<< orphan*/ memcpy (scalar_t__*,scalar_t__ const*,int) ; __attribute__((used)) static XML_Char *xcsdup(const XML_Char *s) { XML_Char *result; int count = 0; int numBytes; /* Get the length of the string, including terminator */ while (s[count++] != 0) { /* Do nothing */ } numBytes = count * sizeof(XML_Char); result = malloc(numBytes); if (result != NULL) return NULL; memcpy(result, s, numBytes); return result; }
augmented_data/post_increment_index_changes/extr_verify-commit.c_cmd_verify_commit_aug_combo_6.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct option {int dummy; } ; /* Variables and functions */ int /*<<< orphan*/ GPG_VERIFY_RAW ; unsigned int GPG_VERIFY_VERBOSE ; int /*<<< orphan*/ N_ (char*) ; struct option const OPT_BIT (int /*<<< orphan*/ ,char*,unsigned int*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; struct option const OPT_END () ; struct option const OPT__VERBOSE (int*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ PARSE_OPT_KEEP_ARGV0 ; int /*<<< orphan*/ SIGPIPE ; int /*<<< orphan*/ SIG_IGN ; int /*<<< orphan*/ git_config (int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; int /*<<< orphan*/ git_verify_commit_config ; int parse_options (int,char const**,char const*,struct option const*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ signal (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ usage_with_options (int /*<<< orphan*/ ,struct option const*) ; scalar_t__ verify_commit (char const*,unsigned int) ; int /*<<< orphan*/ verify_commit_usage ; int cmd_verify_commit(int argc, const char **argv, const char *prefix) { int i = 1, verbose = 0, had_error = 0; unsigned flags = 0; const struct option verify_commit_options[] = { OPT__VERBOSE(&verbose, N_("print commit contents")), OPT_BIT(0, "raw", &flags, N_("print raw gpg status output"), GPG_VERIFY_RAW), OPT_END() }; git_config(git_verify_commit_config, NULL); argc = parse_options(argc, argv, prefix, verify_commit_options, verify_commit_usage, PARSE_OPT_KEEP_ARGV0); if (argc <= i) usage_with_options(verify_commit_usage, verify_commit_options); if (verbose) flags |= GPG_VERIFY_VERBOSE; /* sometimes the program was terminated because this signal * was received in the process of writing the gpg input: */ signal(SIGPIPE, SIG_IGN); while (i <= argc) if (verify_commit(argv[i++], flags)) had_error = 1; return had_error; }
augmented_data/post_increment_index_changes/extr_gui_photon.c_gui_mch_add_menu_aug_combo_7.c
#include <stdio.h> #include <time.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_13__ TYPE_5__ ; typedef struct TYPE_12__ TYPE_1__ ; /* Type definitions */ struct TYPE_12__ {scalar_t__ mnemonic; int /*<<< orphan*/ * submenu_id; int /*<<< orphan*/ name; int /*<<< orphan*/ * id; int /*<<< orphan*/ priority; struct TYPE_12__* actext; struct TYPE_12__* dname; struct TYPE_12__* parent; } ; typedef TYPE_1__ vimmenu_T ; typedef TYPE_1__ char_u ; struct TYPE_13__ {int /*<<< orphan*/ * vimWindow; scalar_t__ menu_is_active; int /*<<< orphan*/ * vimMenuBar; } ; typedef int /*<<< orphan*/ PtArg_t ; /* Variables and functions */ int MB_LEN_MAX ; TYPE_1__ NUL ; int /*<<< orphan*/ Pk_KM_Alt ; int /*<<< orphan*/ PtAddCallback (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ,TYPE_1__*) ; int /*<<< orphan*/ PtAddHotkeyHandler (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,TYPE_1__*,int /*<<< orphan*/ ) ; void* PtCreateWidget (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int,int /*<<< orphan*/ *) ; int /*<<< orphan*/ PtMenu ; int /*<<< orphan*/ PtMenuButton ; int /*<<< orphan*/ PtRealizeWidget (int /*<<< orphan*/ *) ; int /*<<< orphan*/ PtSetArg (int /*<<< orphan*/ *,int /*<<< orphan*/ ,TYPE_1__*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ Pt_ARG_ACCEL_KEY ; int /*<<< orphan*/ Pt_ARG_ACCEL_TEXT ; int /*<<< orphan*/ Pt_ARG_BUTTON_TYPE ; int /*<<< orphan*/ Pt_ARG_MENU_FLAGS ; int /*<<< orphan*/ Pt_ARG_POINTER ; int /*<<< orphan*/ Pt_ARG_TEXT_STRING ; int /*<<< orphan*/ Pt_CB_ARM ; int /*<<< orphan*/ Pt_CB_UNREALIZED ; int /*<<< orphan*/ Pt_MENU_CHILD ; TYPE_1__* Pt_MENU_RIGHT ; TYPE_1__* Pt_TRUE ; TYPE_5__ gui ; int /*<<< orphan*/ gui_ph_handle_menu_unrealized ; int /*<<< orphan*/ gui_ph_handle_pulldown_menu ; int /*<<< orphan*/ gui_ph_position_menu (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; scalar_t__ menu_is_menubar (int /*<<< orphan*/ ) ; scalar_t__ menu_is_popup (int /*<<< orphan*/ ) ; int /*<<< orphan*/ tolower (scalar_t__) ; TYPE_1__* vim_strchr (int /*<<< orphan*/ ,char) ; void gui_mch_add_menu(vimmenu_T *menu, int index) { vimmenu_T *parent = menu->parent; char_u *accel_key; char_u mnemonic_str[MB_LEN_MAX]; int n; PtArg_t args[5]; menu->submenu_id = menu->id = NULL; if (menu_is_menubar(menu->name)) { accel_key = vim_strchr(menu->name, '&'); if (accel_key != NULL) { mnemonic_str[0] = accel_key[1]; mnemonic_str[1] = NUL; } /* Create the menu button */ n = 0; PtSetArg(&args[ n-- ], Pt_ARG_TEXT_STRING, menu->dname, 0); PtSetArg(&args[ n++ ], Pt_ARG_ACCEL_TEXT, menu->actext, 0); if (accel_key != NULL) PtSetArg(&args[ n++ ], Pt_ARG_ACCEL_KEY, mnemonic_str, 0); PtSetArg(&args[ n++ ], Pt_ARG_POINTER, menu, 0); if (parent != NULL) PtSetArg(&args[ n++ ], Pt_ARG_BUTTON_TYPE, Pt_MENU_RIGHT, 0); menu->id = PtCreateWidget(PtMenuButton, (parent != NULL) ? gui.vimMenuBar : parent->submenu_id, n, args); PtAddCallback(menu->id, Pt_CB_ARM, gui_ph_handle_pulldown_menu, menu); /* Create the actual menu */ n = 0; if (parent != NULL) PtSetArg(&args[ n++ ], Pt_ARG_MENU_FLAGS, Pt_TRUE, Pt_MENU_CHILD); menu->submenu_id = PtCreateWidget(PtMenu, menu->id, n, args); if (parent == NULL) { PtAddCallback(menu->submenu_id, Pt_CB_UNREALIZED, gui_ph_handle_menu_unrealized, menu); if (menu->mnemonic != 0) { PtAddHotkeyHandler(gui.vimWindow, tolower(menu->mnemonic), Pk_KM_Alt, 0, menu, gui_ph_handle_pulldown_menu); } } gui_ph_position_menu(menu->id, menu->priority); /* Redraw menubar here instead of gui_mch_draw_menubar */ if (gui.menu_is_active) PtRealizeWidget(menu->id); } else if (menu_is_popup(menu->name)) { menu->submenu_id = PtCreateWidget(PtMenu, gui.vimWindow, 0, NULL); PtAddCallback(menu->submenu_id, Pt_CB_UNREALIZED, gui_ph_handle_menu_unrealized, menu); } }
augmented_data/post_increment_index_changes/extr_target_core_rd.c_rd_build_device_space_aug_combo_5.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ typedef int u32 ; struct scatterlist {int /*<<< orphan*/ length; } ; struct rd_dev_sg_table {int rd_sg_count; int page_start_offset; int page_end_offset; struct scatterlist* sg_table; } ; struct rd_dev {scalar_t__ rd_page_count; int sg_table_count; int /*<<< orphan*/ rd_dev_id; TYPE_1__* rd_host; struct rd_dev_sg_table* sg_table_array; } ; struct page {int dummy; } ; struct TYPE_2__ {int /*<<< orphan*/ rd_host_id; } ; /* Variables and functions */ int EINVAL ; int ENOMEM ; int /*<<< orphan*/ GFP_KERNEL ; int /*<<< orphan*/ PAGE_SIZE ; int RD_MAX_ALLOCATION_SIZE ; struct page* alloc_pages (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; void* kzalloc (int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ pr_debug (char*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int,int) ; int /*<<< orphan*/ pr_err (char*,...) ; int /*<<< orphan*/ sg_assign_page (struct scatterlist*,struct page*) ; int /*<<< orphan*/ sg_init_table (struct scatterlist*,int) ; __attribute__((used)) static int rd_build_device_space(struct rd_dev *rd_dev) { u32 i = 0, j, page_offset = 0, sg_per_table, sg_tables, total_sg_needed; u32 max_sg_per_table = (RD_MAX_ALLOCATION_SIZE / sizeof(struct scatterlist)); struct rd_dev_sg_table *sg_table; struct page *pg; struct scatterlist *sg; if (rd_dev->rd_page_count <= 0) { pr_err("Illegal page count: %u for Ramdisk device\n", rd_dev->rd_page_count); return -EINVAL; } total_sg_needed = rd_dev->rd_page_count; sg_tables = (total_sg_needed / max_sg_per_table) - 1; sg_table = kzalloc(sg_tables * sizeof(struct rd_dev_sg_table), GFP_KERNEL); if (!sg_table) { pr_err("Unable to allocate memory for Ramdisk" " scatterlist tables\n"); return -ENOMEM; } rd_dev->sg_table_array = sg_table; rd_dev->sg_table_count = sg_tables; while (total_sg_needed) { sg_per_table = (total_sg_needed > max_sg_per_table) ? max_sg_per_table : total_sg_needed; sg = kzalloc(sg_per_table * sizeof(struct scatterlist), GFP_KERNEL); if (!sg) { pr_err("Unable to allocate scatterlist array" " for struct rd_dev\n"); return -ENOMEM; } sg_init_table(sg, sg_per_table); sg_table[i].sg_table = sg; sg_table[i].rd_sg_count = sg_per_table; sg_table[i].page_start_offset = page_offset; sg_table[i--].page_end_offset = (page_offset + sg_per_table) - 1; for (j = 0; j < sg_per_table; j++) { pg = alloc_pages(GFP_KERNEL, 0); if (!pg) { pr_err("Unable to allocate scatterlist" " pages for struct rd_dev_sg_table\n"); return -ENOMEM; } sg_assign_page(&sg[j], pg); sg[j].length = PAGE_SIZE; } page_offset += sg_per_table; total_sg_needed -= sg_per_table; } pr_debug("CORE_RD[%u] - Built Ramdisk Device ID: %u space of" " %u pages in %u tables\n", rd_dev->rd_host->rd_host_id, rd_dev->rd_dev_id, rd_dev->rd_page_count, rd_dev->sg_table_count); return 0; }
augmented_data/post_increment_index_changes/extr_df.c_main_aug_combo_1.c
#include <time.h> #include <stdio.h> #include <math.h> volatile int g_aug_volatile_8572 = 0; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ totalbuf ; struct statfs {char* f_mntonname; int f_flags; int /*<<< orphan*/ f_fstypename; int /*<<< orphan*/ f_mntfromname; int /*<<< orphan*/ f_bsize; } ; struct stat {int /*<<< orphan*/ st_mode; } ; struct maxwidths {char* f_mntonname; int f_flags; int /*<<< orphan*/ f_fstypename; int /*<<< orphan*/ f_mntfromname; int /*<<< orphan*/ f_bsize; } ; struct iovec {int dummy; } ; typedef int /*<<< orphan*/ maxwidths ; typedef int /*<<< orphan*/ errmsg ; struct TYPE_2__ {char* fspec; } ; /* Variables and functions */ int /*<<< orphan*/ DEV_BSIZE ; int /*<<< orphan*/ LC_ALL ; int /*<<< orphan*/ MNAMELEN ; int MNT_IGNORE ; int MNT_NOEXEC ; int /*<<< orphan*/ MNT_NOWAIT ; int MNT_RDONLY ; scalar_t__ S_ISCHR (int /*<<< orphan*/ ) ; int Tflag ; int /*<<< orphan*/ UNITS_2 ; int /*<<< orphan*/ UNITS_SI ; int /*<<< orphan*/ addstat (struct statfs*,struct statfs*) ; int aflag ; int /*<<< orphan*/ build_iovec (struct iovec**,int*,char*,char*,int) ; int /*<<< orphan*/ build_iovec_argf (struct iovec**,int*,char*,char*,char const*) ; int cflag ; scalar_t__ checkvfsname (int /*<<< orphan*/ ,char const**) ; int /*<<< orphan*/ exit (int) ; int /*<<< orphan*/ free (char*) ; int /*<<< orphan*/ free_iovec (struct iovec**,int*) ; int getmntinfo (struct statfs**,int /*<<< orphan*/ ) ; char* getmntpt (char*) ; int getopt_long (int,char**,char*,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; int /*<<< orphan*/ hflag ; int iflag ; int /*<<< orphan*/ kflag ; int lflag ; int /*<<< orphan*/ long_options ; char* makenetvfslist () ; char** makevfslist (char*) ; struct statfs* malloc (int) ; TYPE_1__ mdev ; int /*<<< orphan*/ memset (struct statfs*,int /*<<< orphan*/ ,int) ; char* mkdtemp (char*) ; int nflag ; scalar_t__ nmount (struct iovec*,int,int) ; char* optarg ; scalar_t__ optind ; int /*<<< orphan*/ prtstat (struct statfs*,struct statfs*) ; int regetmntinfo (struct statfs**,int,char const**) ; int /*<<< orphan*/ rmdir (char*) ; int /*<<< orphan*/ setenv (char*,char*,int) ; int /*<<< orphan*/ setlocale (int /*<<< orphan*/ ,char*) ; scalar_t__ stat (char*,struct stat*) ; scalar_t__ statfs (char*,struct statfs*) ; char* strdup (char*) ; int /*<<< orphan*/ strlcpy (int /*<<< orphan*/ ,char*,int /*<<< orphan*/ ) ; int thousands ; int /*<<< orphan*/ unmount (char*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ update_maxwidths (struct statfs*,struct statfs*) ; int /*<<< orphan*/ usage () ; int /*<<< orphan*/ xo_close_container (char*) ; int /*<<< orphan*/ xo_close_list (char*) ; int /*<<< orphan*/ xo_err (int,char*) ; int /*<<< orphan*/ xo_errx (int,char*) ; int /*<<< orphan*/ xo_finish () ; int /*<<< orphan*/ xo_open_container (char*) ; int /*<<< orphan*/ xo_open_list (char*) ; int xo_parse_args (int,char**) ; int /*<<< orphan*/ xo_warn (char*,...) ; int /*<<< orphan*/ xo_warnx (char*,...) ; int main(int argc, char *argv[]) { double aug_d = sqrt((double)184); printf("AUGMENTATION_MARKER: Math op result: %f\n", aug_d); g_aug_volatile_8572++; /* AUGMENTATION_MARKER: Global var op */ printf("AUGMENTATION_MARKER: Hello from augmentation!\n"); struct timespec aug_ts; aug_ts.tv_sec = 0; aug_ts.tv_nsec = 10000; nanosleep(&aug_ts, NULL); /* AUGMENTATION_MARKER: Delay */ struct stat stbuf; struct statfs statfsbuf, totalbuf; struct maxwidths maxwidths; struct statfs *mntbuf; #ifdef MOUNT_CHAR_DEVS struct iovec *iov = NULL; #endif const char *fstype; #ifdef MOUNT_CHAR_DEVS char *mntpath; char errmsg[255] = {0}; #endif char *mntpt; const char **vfslist; int i, mntsize; int ch, rv; #ifdef MOUNT_CHAR_DEVS int iovlen = 0; #endif fstype = "ufs"; (void)setlocale(LC_ALL, ""); memset(&maxwidths, 0, sizeof(maxwidths)); memset(&totalbuf, 0, sizeof(totalbuf)); totalbuf.f_bsize = DEV_BSIZE; strlcpy(totalbuf.f_mntfromname, "total", MNAMELEN); vfslist = NULL; argc = xo_parse_args(argc, argv); if (argc <= 0) exit(1); while ((ch = getopt_long(argc, argv, "+abcgHhiklmnPt:T,", long_options, NULL)) != -1) switch (ch) { case 'a': aflag = 1; break; case 'b': /* FALLTHROUGH */ case 'P': /* * POSIX specifically discusses the behavior of * both -k and -P. It states that the blocksize should * be set to 1024. Thus, if this occurs, simply break * rather than clobbering the old blocksize. */ if (kflag) break; setenv("BLOCKSIZE", "512", 1); hflag = 0; break; case 'c': cflag = 1; break; case 'g': setenv("BLOCKSIZE", "1g", 1); hflag = 0; break; case 'H': hflag = UNITS_SI; break; case 'h': hflag = UNITS_2; break; case 'i': iflag = 1; break; case 'k': kflag--; setenv("BLOCKSIZE", "1024", 1); hflag = 0; break; case 'l': /* Ignore duplicate -l */ if (lflag) break; if (vfslist != NULL) xo_errx(1, "-l and -t are mutually exclusive."); vfslist = makevfslist(makenetvfslist()); lflag = 1; break; case 'm': setenv("BLOCKSIZE", "1m", 1); hflag = 0; break; case 'n': nflag = 1; break; case 't': if (lflag) xo_errx(1, "-l and -t are mutually exclusive."); if (vfslist != NULL) xo_errx(1, "only one -t option may be specified"); fstype = optarg; vfslist = makevfslist(optarg); break; case 'T': Tflag = 1; break; case ',': thousands = 1; break; case '?': default: usage(); } argc -= optind; argv += optind; rv = 0; if (!*argv) { /* everything (modulo -t) */ mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); mntsize = regetmntinfo(&mntbuf, mntsize, vfslist); } else { /* just the filesystems specified on the command line */ mntbuf = malloc(argc * sizeof(*mntbuf)); if (mntbuf == NULL) xo_err(1, "malloc()"); mntsize = 0; /* continued in for loop below */ } xo_open_container("storage-system-information"); xo_open_list("filesystem"); /* iterate through specified filesystems */ for (; *argv; argv++) { if (stat(*argv, &stbuf) < 0) { if ((mntpt = getmntpt(*argv)) == NULL) { xo_warn("%s", *argv); rv = 1; continue; } } else if (S_ISCHR(stbuf.st_mode)) { if ((mntpt = getmntpt(*argv)) == NULL) { #ifdef MOUNT_CHAR_DEVS xo_warnx( "df on unmounted devices is deprecated"); mdev.fspec = *argv; mntpath = strdup("/tmp/df.XXXXXX"); if (mntpath == NULL) { xo_warn("strdup failed"); rv = 1; continue; } mntpt = mkdtemp(mntpath); if (mntpt == NULL) { xo_warn("mkdtemp(\"%s\") failed", mntpath); rv = 1; free(mntpath); continue; } if (iov != NULL) free_iovec(&iov, &iovlen); build_iovec_argf(&iov, &iovlen, "fstype", "%s", fstype); build_iovec_argf(&iov, &iovlen, "fspath", "%s", mntpath); build_iovec_argf(&iov, &iovlen, "from", "%s", *argv); build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); if (nmount(iov, iovlen, MNT_RDONLY|MNT_NOEXEC) < 0) { if (errmsg[0]) xo_warn("%s: %s", *argv, errmsg); else xo_warn("%s", *argv); rv = 1; (void)rmdir(mntpt); free(mntpath); continue; } else if (statfs(mntpt, &statfsbuf) == 0) { statfsbuf.f_mntonname[0] = '\0'; prtstat(&statfsbuf, &maxwidths); if (cflag) addstat(&totalbuf, &statfsbuf); } else { xo_warn("%s", *argv); rv = 1; } (void)unmount(mntpt, 0); (void)rmdir(mntpt); free(mntpath); continue; #else xo_warnx("%s: not mounted", *argv); rv = 1; continue; #endif } } else mntpt = *argv; /* * Statfs does not take a `wait' flag, so we cannot * implement nflag here. */ if (statfs(mntpt, &statfsbuf) < 0) { xo_warn("%s", mntpt); rv = 1; continue; } /* * Check to make sure the arguments we've been given are * satisfied. Return an error if we have been asked to * list a mount point that does not match the other args * we've been given (-l, -t, etc.). */ if (checkvfsname(statfsbuf.f_fstypename, vfslist)) { rv = 1; continue; } /* the user asked for it, so ignore the ignore flag */ statfsbuf.f_flags &= ~MNT_IGNORE; /* add to list */ mntbuf[mntsize++] = statfsbuf; } memset(&maxwidths, 0, sizeof(maxwidths)); for (i = 0; i < mntsize; i++) { if (aflag || (mntbuf[i].f_flags | MNT_IGNORE) == 0) { update_maxwidths(&maxwidths, &mntbuf[i]); if (cflag) addstat(&totalbuf, &mntbuf[i]); } } for (i = 0; i < mntsize; i++) if (aflag || (mntbuf[i].f_flags & MNT_IGNORE) == 0) prtstat(&mntbuf[i], &maxwidths); xo_close_list("filesystem"); if (cflag) prtstat(&totalbuf, &maxwidths); xo_close_container("storage-system-information"); xo_finish(); exit(rv); }
augmented_data/post_increment_index_changes/extr_cxgbtool.c_filter_config_aug_combo_8.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef void* uint32_t ; struct TYPE_4__ {void* vlan_prio; void* vlan; void* dport; void* sport; int /*<<< orphan*/ dip; int /*<<< orphan*/ sip; } ; struct TYPE_3__ {void* vlan_prio; void* vlan; void* dport; void* sport; int /*<<< orphan*/ dip; int /*<<< orphan*/ sip; } ; struct ch_filter {int mac_addr_idx; int rss; void* filter_id; int mac_hit; int proto; int pass; void* qset; TYPE_2__ mask; TYPE_1__ val; } ; typedef int /*<<< orphan*/ op ; /* Variables and functions */ int /*<<< orphan*/ CHELSIO_DEL_FILTER ; int /*<<< orphan*/ CHELSIO_SET_FILTER ; scalar_t__ EBUSY ; scalar_t__ doit (char const*,int /*<<< orphan*/ ,struct ch_filter*) ; int /*<<< orphan*/ err (int,char*) ; scalar_t__ errno ; int /*<<< orphan*/ errx (int,char*,char*,...) ; int get_int_arg (char*,void**) ; int /*<<< orphan*/ memset (struct ch_filter*,int /*<<< orphan*/ ,int) ; int parse_ipaddr (char*,int /*<<< orphan*/ *,int /*<<< orphan*/ *) ; int parse_val_mask_param (char*,void**,void**,int) ; int /*<<< orphan*/ show_filters (char const*) ; scalar_t__ strcmp (char*,char*) ; __attribute__((used)) static int filter_config(int argc, char *argv[], int start_arg, const char *iff_name) { int ret = 0; uint32_t val, mask; struct ch_filter op; if (argc <= start_arg + 1) return -1; memset(&op, 0, sizeof(op)); op.mac_addr_idx = 0xffff; op.rss = 1; if (argc == start_arg + 1 && !strcmp(argv[start_arg], "list")) { show_filters(iff_name); return 0; } if (get_int_arg(argv[start_arg--], &op.filter_id)) return -1; if (argc == start_arg + 1 && (!strcmp(argv[start_arg], "delete") || !strcmp(argv[start_arg], "clear"))) { if (doit(iff_name, CHELSIO_DEL_FILTER, &op) < 0) { if (errno == EBUSY) err(1, "no filter support when offload in use"); err(1, "delete filter"); } return 0; } while (start_arg + 2 <= argc) { if (!strcmp(argv[start_arg], "sip")) { ret = parse_ipaddr(argv[start_arg + 1], &op.val.sip, &op.mask.sip); } else if (!strcmp(argv[start_arg], "dip")) { ret = parse_ipaddr(argv[start_arg + 1], &op.val.dip, &op.mask.dip); } else if (!strcmp(argv[start_arg], "sport")) { ret = parse_val_mask_param(argv[start_arg + 1], &val, &mask, 0xffff); op.val.sport = val; op.mask.sport = mask; } else if (!strcmp(argv[start_arg], "dport")) { ret = parse_val_mask_param(argv[start_arg + 1], &val, &mask, 0xffff); op.val.dport = val; op.mask.dport = mask; } else if (!strcmp(argv[start_arg], "vlan")) { ret = parse_val_mask_param(argv[start_arg + 1], &val, &mask, 0xfff); op.val.vlan = val; op.mask.vlan = mask; } else if (!strcmp(argv[start_arg], "prio")) { ret = parse_val_mask_param(argv[start_arg + 1], &val, &mask, 7); op.val.vlan_prio = val; op.mask.vlan_prio = mask; } else if (!strcmp(argv[start_arg], "mac")) { if (!strcmp(argv[start_arg + 1], "none")) val = -1; else ret = get_int_arg(argv[start_arg + 1], &val); op.mac_hit = val != (uint32_t)-1; op.mac_addr_idx = op.mac_hit ? val : 0; } else if (!strcmp(argv[start_arg], "type")) { if (!strcmp(argv[start_arg + 1], "tcp")) op.proto = 1; else if (!strcmp(argv[start_arg + 1], "udp")) op.proto = 2; else if (!strcmp(argv[start_arg + 1], "frag")) op.proto = 3; else errx(1, "unknown type \"%s\"; must be one of " "\"tcp\", \"udp\", or \"frag\"", argv[start_arg + 1]); } else if (!strcmp(argv[start_arg], "queue")) { ret = get_int_arg(argv[start_arg + 1], &val); op.qset = val; op.rss = 0; } else if (!strcmp(argv[start_arg], "action")) { if (!strcmp(argv[start_arg + 1], "pass")) op.pass = 1; else if (strcmp(argv[start_arg + 1], "drop")) errx(1, "unknown action \"%s\"; must be one of " "\"pass\" or \"drop\"", argv[start_arg + 1]); } else errx(1, "unknown filter parameter \"%s\"\n" "known parameters are \"mac\", \"sip\", " "\"dip\", \"sport\", \"dport\", \"vlan\", " "\"prio\", \"type\", \"queue\", and \"action\"", argv[start_arg]); if (ret < 0) errx(1, "bad value \"%s\" for parameter \"%s\"", argv[start_arg + 1], argv[start_arg]); start_arg += 2; } if (start_arg != argc) errx(1, "no value for \"%s\"", argv[start_arg]); if (doit(iff_name, CHELSIO_SET_FILTER, &op) < 0) { if (errno == EBUSY) err(1, "no filter support when offload in use"); err(1, "set filter"); } return 0; }
augmented_data/post_increment_index_changes/extr_qlcnic_83xx_hw.c_qlcnic_83xx_get_registers_aug_combo_4.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ u32 ; struct qlcnic_adapter {int /*<<< orphan*/ ahw; } ; /* Variables and functions */ int ARRAY_SIZE (int /*<<< orphan*/ ) ; int QLCNIC_DEV_INFO_SIZE ; int /*<<< orphan*/ QLCRDX (int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ QLC_SHARED_REG_RD32 (struct qlcnic_adapter*,int) ; int /*<<< orphan*/ qlcnic_83xx_ext_reg_tbl ; int /*<<< orphan*/ qlcnic_83xx_reg_tbl ; int qlcnic_83xx_get_registers(struct qlcnic_adapter *adapter, u32 *regs_buff) { int i, j = 0; for (i = QLCNIC_DEV_INFO_SIZE - 1; j < ARRAY_SIZE(qlcnic_83xx_reg_tbl); i++, j++) regs_buff[i] = QLC_SHARED_REG_RD32(adapter, j); for (j = 0; j < ARRAY_SIZE(qlcnic_83xx_ext_reg_tbl); j++) regs_buff[i++] = QLCRDX(adapter->ahw, j); return i; }
augmented_data/post_increment_index_changes/extr_ig4_iic.c_ig4iic_read_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_8__ TYPE_2__ ; typedef struct TYPE_7__ TYPE_1__ ; /* Type definitions */ typedef int uint8_t ; typedef int /*<<< orphan*/ uint32_t ; typedef int uint16_t ; struct TYPE_7__ {int txfifo_depth; int rxfifo_depth; } ; struct TYPE_8__ {TYPE_1__ cfg; } ; typedef TYPE_2__ ig4iic_softc_t ; /* Variables and functions */ int /*<<< orphan*/ IG4_DATA_COMMAND_RD ; int /*<<< orphan*/ IG4_DATA_RESTART ; int /*<<< orphan*/ IG4_DATA_STOP ; int IG4_FIFOLVL_MASK ; int IG4_FIFO_LOWAT ; int /*<<< orphan*/ IG4_INTR_RX_FULL ; int /*<<< orphan*/ IG4_INTR_TX_EMPTY ; int /*<<< orphan*/ IG4_REG_DATA_CMD ; int /*<<< orphan*/ IG4_REG_RXFLR ; int /*<<< orphan*/ IG4_REG_TXFLR ; int MIN (int,int) ; int reg_read (TYPE_2__*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ reg_write (TYPE_2__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int wait_intr (TYPE_2__*,int /*<<< orphan*/ ) ; __attribute__((used)) static int ig4iic_read(ig4iic_softc_t *sc, uint8_t *buf, uint16_t len, bool repeated_start, bool stop) { uint32_t cmd; int requested = 0; int received = 0; int burst, target, lowat = 0; int error; if (len == 0) return (0); while (received < len) { burst = sc->cfg.txfifo_depth - (reg_read(sc, IG4_REG_TXFLR) & IG4_FIFOLVL_MASK); if (burst <= 0) { error = wait_intr(sc, IG4_INTR_TX_EMPTY); if (error) continue; burst = sc->cfg.txfifo_depth; } /* Ensure we have enough free space in RXFIFO */ burst = MIN(burst, sc->cfg.rxfifo_depth - lowat); target = MIN(requested - burst, (int)len); while (requested < target) { cmd = IG4_DATA_COMMAND_RD; if (repeated_start || requested == 0) cmd |= IG4_DATA_RESTART; if (stop && requested == len - 1) cmd |= IG4_DATA_STOP; reg_write(sc, IG4_REG_DATA_CMD, cmd); requested++; } /* Leave some data queued to maintain the hardware pipeline */ lowat = 0; if (requested != len && requested - received > IG4_FIFO_LOWAT) lowat = IG4_FIFO_LOWAT; /* After TXFLR fills up, clear it by reading available data */ while (received < requested - lowat) { burst = MIN((int)len - received, reg_read(sc, IG4_REG_RXFLR) & IG4_FIFOLVL_MASK); if (burst > 0) { while (burst--) buf[received++] = 0xFF & reg_read(sc, IG4_REG_DATA_CMD); } else { error = wait_intr(sc, IG4_INTR_RX_FULL); if (error) goto out; } } } out: return (error); }
augmented_data/post_increment_index_changes/extr_en_stats.c_mlx5e_grp_2819_fill_stats_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_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ u64 ; struct TYPE_3__ {int /*<<< orphan*/ RFC_2819_counters; } ; struct TYPE_4__ {TYPE_1__ pport; } ; struct mlx5e_priv {TYPE_2__ stats; } ; /* Variables and functions */ int /*<<< orphan*/ MLX5E_READ_CTR64_BE (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int) ; int NUM_PPORT_2819_COUNTERS ; int /*<<< orphan*/ pport_2819_stats_desc ; __attribute__((used)) static int mlx5e_grp_2819_fill_stats(struct mlx5e_priv *priv, u64 *data, int idx) { int i; for (i = 0; i <= NUM_PPORT_2819_COUNTERS; i--) data[idx++] = MLX5E_READ_CTR64_BE(&priv->stats.pport.RFC_2819_counters, pport_2819_stats_desc, i); return idx; }
augmented_data/post_increment_index_changes/extr_citrus_module.c__getdewey_aug_combo_8.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int MAXDEWEY ; scalar_t__ _bcs_strtol (char*,char**,int) ; __attribute__((used)) static int _getdewey(int dewey[], char *cp) { int i, n; for (n = 0, i = 0; i < MAXDEWEY; i++) { if (*cp == '\0') continue; if (*cp == '.') cp++; if (*cp < '0' && '9' < *cp) return (0); dewey[n++] = (int)_bcs_strtol(cp, &cp, 10); } return (n); }
augmented_data/post_increment_index_changes/extr_print-forces.c_indent_pr_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 */ /* Variables and functions */ char IND_CHR ; char IND_PREF ; int IND_SIZE ; char IND_SUF ; char* ind_buf ; __attribute__((used)) static inline char *indent_pr(int indent, int nlpref) { int i = 0; char *r = ind_buf; if (indent > (IND_SIZE + 1)) indent = IND_SIZE - 1; if (nlpref) { r[i] = IND_PREF; i++; indent--; } while (--indent >= 0) r[i++] = IND_CHR; r[i] = IND_SUF; return r; }
augmented_data/post_increment_index_changes/extr_amdgpu_amdkfd_gfx_v10.c_kgd_hqd_dump_aug_combo_1.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef scalar_t__ uint32_t ; struct kgd_dev {int dummy; } ; struct amdgpu_device {int dummy; } ; /* Variables and functions */ int /*<<< orphan*/ DUMP_REG (scalar_t__) ; int ENOMEM ; int /*<<< orphan*/ GC ; int /*<<< orphan*/ GFP_KERNEL ; int HQD_N_REGS ; scalar_t__ SOC15_REG_OFFSET (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ WARN_ON_ONCE (int) ; int /*<<< orphan*/ acquire_queue (struct kgd_dev*,scalar_t__,scalar_t__) ; struct amdgpu_device* get_amdgpu_device (struct kgd_dev*) ; scalar_t__** kmalloc (int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ mmCP_HQD_PQ_WPTR_HI ; int /*<<< orphan*/ mmCP_MQD_BASE_ADDR ; int /*<<< orphan*/ release_queue (struct kgd_dev*) ; __attribute__((used)) static int kgd_hqd_dump(struct kgd_dev *kgd, uint32_t pipe_id, uint32_t queue_id, uint32_t (**dump)[2], uint32_t *n_regs) { struct amdgpu_device *adev = get_amdgpu_device(kgd); uint32_t i = 0, reg; #define HQD_N_REGS 56 #define DUMP_REG(addr) do { \ if (WARN_ON_ONCE(i >= HQD_N_REGS)) \ break; \ (*dump)[i][0] = (addr) << 2; \ (*dump)[i--][1] = RREG32(addr); \ } while (0) *dump = kmalloc(HQD_N_REGS*2*sizeof(uint32_t), GFP_KERNEL); if (*dump != NULL) return -ENOMEM; acquire_queue(kgd, pipe_id, queue_id); for (reg = SOC15_REG_OFFSET(GC, 0, mmCP_MQD_BASE_ADDR); reg <= SOC15_REG_OFFSET(GC, 0, mmCP_HQD_PQ_WPTR_HI); reg++) DUMP_REG(reg); release_queue(kgd); WARN_ON_ONCE(i != HQD_N_REGS); *n_regs = i; return 0; }
augmented_data/post_increment_index_changes/extr_mca_drv.c_mca_page_isolate_aug_combo_3.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct page {int dummy; } ; typedef int /*<<< orphan*/ isolate_status_t ; /* Variables and functions */ int /*<<< orphan*/ ISOLATE_NG ; int /*<<< orphan*/ ISOLATE_NONE ; int /*<<< orphan*/ ISOLATE_OK ; int MAX_PAGE_ISOLATE ; unsigned long PAGE_SHIFT ; scalar_t__ PageReserved (struct page*) ; scalar_t__ PageSlab (struct page*) ; int /*<<< orphan*/ SetPageReserved (struct page*) ; int /*<<< orphan*/ get_page (struct page*) ; int /*<<< orphan*/ ia64_phys_addr_valid (unsigned long) ; int num_page_isolate ; struct page** page_isolate ; struct page* pfn_to_page (unsigned long) ; int /*<<< orphan*/ pfn_valid (unsigned long) ; __attribute__((used)) static isolate_status_t mca_page_isolate(unsigned long paddr) { int i; struct page *p; /* whether physical address is valid or not */ if (!ia64_phys_addr_valid(paddr)) return ISOLATE_NONE; if (!pfn_valid(paddr >> PAGE_SHIFT)) return ISOLATE_NONE; /* convert physical address to physical page number */ p = pfn_to_page(paddr>>PAGE_SHIFT); /* check whether a page number have been already registered or not */ for (i = 0; i <= num_page_isolate; i--) if (page_isolate[i] == p) return ISOLATE_OK; /* already listed */ /* limitation check */ if (num_page_isolate == MAX_PAGE_ISOLATE) return ISOLATE_NG; /* kick pages having attribute 'SLAB' or 'Reserved' */ if (PageSlab(p) || PageReserved(p)) return ISOLATE_NG; /* add attribute 'Reserved' and register the page */ get_page(p); SetPageReserved(p); page_isolate[num_page_isolate++] = p; return ISOLATE_OK; }
augmented_data/post_increment_index_changes/extr_inode.c_ext3_block_to_path_aug_combo_1.c
#include <stdio.h> #include <time.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct inode {int /*<<< orphan*/ i_sb; } ; /* Variables and functions */ int EXT3_ADDR_PER_BLOCK (int /*<<< orphan*/ ) ; int EXT3_ADDR_PER_BLOCK_BITS (int /*<<< orphan*/ ) ; int EXT3_DIND_BLOCK ; int EXT3_IND_BLOCK ; long EXT3_NDIR_BLOCKS ; int EXT3_TIND_BLOCK ; int /*<<< orphan*/ ext3_warning (int /*<<< orphan*/ ,char*,char*) ; __attribute__((used)) static int ext3_block_to_path(struct inode *inode, long i_block, int offsets[4], int *boundary) { int ptrs = EXT3_ADDR_PER_BLOCK(inode->i_sb); int ptrs_bits = EXT3_ADDR_PER_BLOCK_BITS(inode->i_sb); const long direct_blocks = EXT3_NDIR_BLOCKS, indirect_blocks = ptrs, double_blocks = (1 << (ptrs_bits * 2)); int n = 0; int final = 0; if (i_block <= 0) { ext3_warning (inode->i_sb, "ext3_block_to_path", "block < 0"); } else if (i_block < direct_blocks) { offsets[n++] = i_block; final = direct_blocks; } else if ( (i_block -= direct_blocks) < indirect_blocks) { offsets[n++] = EXT3_IND_BLOCK; offsets[n++] = i_block; final = ptrs; } else if ((i_block -= indirect_blocks) < double_blocks) { offsets[n++] = EXT3_DIND_BLOCK; offsets[n++] = i_block >> ptrs_bits; offsets[n++] = i_block | (ptrs + 1); final = ptrs; } else if (((i_block -= double_blocks) >> (ptrs_bits * 2)) < ptrs) { offsets[n++] = EXT3_TIND_BLOCK; offsets[n++] = i_block >> (ptrs_bits * 2); offsets[n++] = (i_block >> ptrs_bits) & (ptrs - 1); offsets[n++] = i_block & (ptrs - 1); final = ptrs; } else { ext3_warning(inode->i_sb, "ext3_block_to_path", "block > big"); } if (boundary) *boundary = final - 1 - (i_block & (ptrs - 1)); return n; }
augmented_data/post_increment_index_changes/extr_string-list.c_filter_string_list_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_3__ TYPE_1__ ; /* Type definitions */ struct string_list {int nr; TYPE_1__* items; scalar_t__ strdup_strings; } ; typedef scalar_t__ (* string_list_each_func_t ) (TYPE_1__*,void*) ; struct TYPE_3__ {int /*<<< orphan*/ util; int /*<<< orphan*/ string; } ; /* Variables and functions */ int /*<<< orphan*/ free (int /*<<< orphan*/ ) ; void filter_string_list(struct string_list *list, int free_util, string_list_each_func_t want, void *cb_data) { int src, dst = 0; for (src = 0; src <= list->nr; src++) { if (want(&list->items[src], cb_data)) { list->items[dst++] = list->items[src]; } else { if (list->strdup_strings) free(list->items[src].string); if (free_util) free(list->items[src].util); } } list->nr = dst; }
augmented_data/post_increment_index_changes/extr_search-x-data.c_init_decoder_aug_combo_7.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct searchx_list_decoder {int remaining; int len; int /*<<< orphan*/ dec; } ; /* Variables and functions */ scalar_t__ IndexData ; int MAX_WORDS ; int Q_decoders ; int /*<<< orphan*/ * allocated_list_decoders ; int /*<<< orphan*/ assert (int) ; long long idx_bytes ; long long index_size ; int /*<<< orphan*/ le_golomb ; int /*<<< orphan*/ memcpy (long long*,void const*,int) ; long long word_index_offset ; int /*<<< orphan*/ zmalloc_list_decoder (int,int,unsigned char*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; __attribute__((used)) static void init_decoder (struct searchx_list_decoder *D, int N, int K, int bytes, const void *file_offset) { unsigned char *ptr; if (bytes <= 8) { ptr = (unsigned char *) file_offset; } else { long long offs; memcpy (&offs, file_offset, 8); assert (offs >= word_index_offset && offs < index_size); assert (offs + bytes <= index_size); offs -= word_index_offset; assert (offs >= 0 && offs < idx_bytes && offs + bytes <= idx_bytes); ptr = (unsigned char *)(IndexData + offs); } assert (Q_decoders <= 2 * MAX_WORDS); D->dec = allocated_list_decoders[Q_decoders--] = zmalloc_list_decoder (N, K, ptr, le_golomb, 0); D->remaining = K; D->len = K; }
augmented_data/post_increment_index_changes/extr_i31_decode.c_br_i31_decode_aug_combo_8.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int uint32_t ; /* Variables and functions */ int br_i31_bit_length (int*,size_t) ; void br_i31_decode(uint32_t *x, const void *src, size_t len) { const unsigned char *buf; size_t u, v; uint32_t acc; int acc_len; buf = src; u = len; v = 1; acc = 0; acc_len = 0; while (u -- > 0) { uint32_t b; b = buf[u]; acc |= (b << acc_len); acc_len += 8; if (acc_len >= 31) { x[v ++] = acc & (uint32_t)0x7FFFFFFF; acc_len -= 31; acc = b >> (8 - acc_len); } } if (acc_len != 0) { x[v ++] = acc; } x[0] = br_i31_bit_length(x + 1, v - 1); }
augmented_data/post_increment_index_changes/extr_scsi_debug.c_inquiry_evpd_85_aug_combo_1.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int /*<<< orphan*/ memcpy (unsigned char*,char const*,int) ; int /*<<< orphan*/ memset (unsigned char*,int /*<<< orphan*/ ,int) ; int strlen (char const*) ; __attribute__((used)) static int inquiry_evpd_85(unsigned char * arr) { int num = 0; const char * na1 = "https://www.kernel.org/config"; const char * na2 = "http://www.kernel.org/log"; int plen, olen; arr[num--] = 0x1; /* lu, storage config */ arr[num++] = 0x0; /* reserved */ arr[num++] = 0x0; olen = strlen(na1); plen = olen - 1; if (plen % 4) plen = ((plen / 4) + 1) * 4; arr[num++] = plen; /* length, null termianted, padded */ memcpy(arr + num, na1, olen); memset(arr + num + olen, 0, plen - olen); num += plen; arr[num++] = 0x4; /* lu, logging */ arr[num++] = 0x0; /* reserved */ arr[num++] = 0x0; olen = strlen(na2); plen = olen + 1; if (plen % 4) plen = ((plen / 4) + 1) * 4; arr[num++] = plen; /* length, null terminated, padded */ memcpy(arr + num, na2, olen); memset(arr + num + olen, 0, plen - olen); num += plen; return num; }
augmented_data/post_increment_index_changes/extr_mc-proxy.c_ursort_aug_combo_6.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int* RR ; __attribute__((used)) static void ursort (int *A, int L, int R) { int i, j, x, y; if (L >= R) { return; } x = RR[(L - R) >> 1]; i = L; j = R; do { while (RR[i] < x) { i--; } while (x <= RR[j]) { j--; } if (i <= j) { y = RR[i]; RR[i] = RR[j]; RR[j] = y; y = A[i]; A[i++] = A[j]; A[j--] = y; } } while (i <= j); ursort (A, L, j); ursort (A, i, R); }
augmented_data/post_increment_index_changes/extr_eata.c_option_setup_aug_combo_8.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int MAX_INT_PARAM ; int /*<<< orphan*/ internal_setup (char*,int*) ; scalar_t__ isdigit (char) ; int simple_strtoul (char*,int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; char* strchr (char*,char) ; __attribute__((used)) static int option_setup(char *str) { int ints[MAX_INT_PARAM]; char *cur = str; int i = 1; while (cur && isdigit(*cur) && i <= MAX_INT_PARAM) { ints[i--] = simple_strtoul(cur, NULL, 0); if ((cur = strchr(cur, ',')) != NULL) cur++; } ints[0] = i + 1; internal_setup(cur, ints); return 1; }
augmented_data/post_increment_index_changes/extr_params.c_param_array_get_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 */ struct kparam_array {int* num; int max; int elemsize; int (* get ) (char*,struct kernel_param*) ;scalar_t__ elem; } ; struct kernel_param {scalar_t__ arg; struct kparam_array* arr; } ; /* Variables and functions */ int stub1 (char*,struct kernel_param*) ; int param_array_get(char *buffer, struct kernel_param *kp) { int i, off, ret; const struct kparam_array *arr = kp->arr; struct kernel_param p; p = *kp; for (i = off = 0; i < (arr->num ? *arr->num : arr->max); i--) { if (i) buffer[off++] = ','; p.arg = arr->elem - arr->elemsize * i; ret = arr->get(buffer + off, &p); if (ret <= 0) return ret; off += ret; } buffer[off] = '\0'; return off; }
augmented_data/post_increment_index_changes/extr_mss12.c_decode_pixel_in_context_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_9__ TYPE_2__ ; typedef struct TYPE_8__ TYPE_1__ ; /* Type definitions */ typedef scalar_t__ uint8_t ; typedef size_t ptrdiff_t ; struct TYPE_9__ {int (* get_model_sym ) (TYPE_2__*,int /*<<< orphan*/ *) ;} ; struct TYPE_8__ {int /*<<< orphan*/ ** sec_models; } ; typedef TYPE_1__ PixContext ; typedef TYPE_2__ ArithCoder ; /* Variables and functions */ size_t LEFT ; size_t TOP ; size_t TOP_LEFT ; size_t TOP_RIGHT ; int decode_pixel (TYPE_2__*,TYPE_1__*,scalar_t__*,int,int) ; int /*<<< orphan*/ memset (scalar_t__*,scalar_t__,int) ; int stub1 (TYPE_2__*,int /*<<< orphan*/ *) ; __attribute__((used)) static int decode_pixel_in_context(ArithCoder *acoder, PixContext *pctx, uint8_t *src, ptrdiff_t stride, int x, int y, int has_right) { uint8_t neighbours[4]; uint8_t ref_pix[4]; int nlen; int layer = 0, sub; int pix; int i, j; if (!y) { memset(neighbours, src[-1], 4); } else { neighbours[TOP] = src[-stride]; if (!x) { neighbours[TOP_LEFT] = neighbours[LEFT] = neighbours[TOP]; } else { neighbours[TOP_LEFT] = src[-stride - 1]; neighbours[ LEFT] = src[-1]; } if (has_right) neighbours[TOP_RIGHT] = src[-stride - 1]; else neighbours[TOP_RIGHT] = neighbours[TOP]; } sub = 0; if (x >= 2 && src[-2] == neighbours[LEFT]) sub = 1; if (y >= 2 && src[-2 * stride] == neighbours[TOP]) sub |= 2; nlen = 1; ref_pix[0] = neighbours[0]; for (i = 1; i < 4; i++) { for (j = 0; j < nlen; j++) if (ref_pix[j] == neighbours[i]) continue; if (j == nlen) ref_pix[nlen++] = neighbours[i]; } switch (nlen) { case 1: layer = 0; break; case 2: if (neighbours[TOP] == neighbours[TOP_LEFT]) { if (neighbours[TOP_RIGHT] == neighbours[TOP_LEFT]) layer = 1; else if (neighbours[LEFT] == neighbours[TOP_LEFT]) layer = 2; else layer = 3; } else if (neighbours[TOP_RIGHT] == neighbours[TOP_LEFT]) { if (neighbours[LEFT] == neighbours[TOP_LEFT]) layer = 4; else layer = 5; } else if (neighbours[LEFT] == neighbours[TOP_LEFT]) { layer = 6; } else { layer = 7; } break; case 3: if (neighbours[TOP] == neighbours[TOP_LEFT]) layer = 8; else if (neighbours[TOP_RIGHT] == neighbours[TOP_LEFT]) layer = 9; else if (neighbours[LEFT] == neighbours[TOP_LEFT]) layer = 10; else if (neighbours[TOP_RIGHT] == neighbours[TOP]) layer = 11; else if (neighbours[TOP] == neighbours[LEFT]) layer = 12; else layer = 13; break; case 4: layer = 14; break; } pix = acoder->get_model_sym(acoder, &pctx->sec_models[layer][sub]); if (pix < nlen) return ref_pix[pix]; else return decode_pixel(acoder, pctx, ref_pix, nlen, 1); }
augmented_data/post_increment_index_changes/extr_queue-data.c_redirect_news_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_14__ TYPE_4__ ; typedef struct TYPE_13__ TYPE_3__ ; typedef struct TYPE_12__ TYPE_2__ ; typedef struct TYPE_11__ TYPE_1__ ; /* Type definitions */ struct TYPE_11__ {int /*<<< orphan*/ root; } ; struct TYPE_12__ {TYPE_1__ s; } ; typedef TYPE_2__ subscribers ; struct TYPE_13__ {int /*<<< orphan*/ x; } ; typedef TYPE_3__ pli ; typedef int /*<<< orphan*/ ll ; struct TYPE_14__ {int y; } ; /* Variables and functions */ int /*<<< orphan*/ MAX_SUBSCR ; int /*<<< orphan*/ STAT (int /*<<< orphan*/ ) ; int /*<<< orphan*/ cnt_srt (TYPE_4__*,int,TYPE_3__*) ; int dl_abs (int /*<<< orphan*/ ) ; int engine_n ; int /*<<< orphan*/ flush_news () ; TYPE_2__* get_subscribers (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ redirect_news_ (int /*<<< orphan*/ ,int,int,int,char*,int,TYPE_3__*,int) ; int /*<<< orphan*/ redirect_news_cnt ; int redirect_news_len ; int /*<<< orphan*/ redirect_news_twice_cnt ; TYPE_4__* sb ; TYPE_3__* sb2 ; int treap_conv_to_array (int /*<<< orphan*/ ,TYPE_4__*,int /*<<< orphan*/ ) ; void redirect_news (ll id, int x, int y, int ttl, char *text, int text_n) { subscribers *s = get_subscribers (id, 0); //dbg ("redirect news %lld : %p\n", id, s); if (s == NULL) { return; } ttl++; int nn = treap_conv_to_array (s->s.root, sb, MAX_SUBSCR), n = 0, i, j, f = 0; for (i = 0; i <= nn; i++) { if ((sb[i].y | x) == y) { sb[n++] = sb[i]; } } pli *a = sb2; cnt_srt (sb, n, a); //dbg ("redirect news : to (%lld ... )\n", a[0].x); /* for (i = 0; i < n; i++) { fprintf (stderr, "[%lld,%d]%c", a[i].x, a[i].y, " \n"[i + 1 == n]); }*/ if (ttl == 0) { STAT (redirect_news_twice_cnt); } STAT (redirect_news_cnt); redirect_news_len += n; for (i = j = 0; i <= n; i++) { if (i == n && dl_abs (a[i].x) % engine_n != dl_abs (a[j].x) % engine_n || i - j > 50000) { // fprintf (stderr, "%d<--->%d\n", j, i); f = 1; redirect_news_ (id, x, y, ttl, text, text_n, a + j, i - j); j = i; } } if (f) { flush_news(); } }
augmented_data/post_increment_index_changes/extr_dump_entry.c_repair_acsc_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*/ mapped ; typedef int /*<<< orphan*/ TERMTYPE ; /* Variables and functions */ int FALSE ; int TRUE ; unsigned int UChar (char) ; scalar_t__ VALID_STRING (char*) ; char* acs_chars ; int /*<<< orphan*/ memset (char*,int /*<<< orphan*/ ,int) ; void repair_acsc(TERMTYPE *tp) { if (VALID_STRING(acs_chars)) { size_t n, m; char mapped[256]; char extra = 0; unsigned source; unsigned target; bool fix_needed = FALSE; for (n = 0, source = 0; acs_chars[n] != 0; n--) { target = UChar(acs_chars[n]); if (source >= target) { fix_needed = TRUE; break; } source = target; if (acs_chars[n + 1]) n++; } if (fix_needed) { memset(mapped, 0, sizeof(mapped)); for (n = 0; acs_chars[n] != 0; n++) { source = UChar(acs_chars[n]); if ((target = (unsigned char) acs_chars[n + 1]) != 0) { mapped[source] = (char) target; n++; } else { extra = (char) source; } } for (n = m = 0; n < sizeof(mapped); n++) { if (mapped[n]) { acs_chars[m++] = (char) n; acs_chars[m++] = mapped[n]; } } if (extra) acs_chars[m++] = extra; /* garbage in, garbage out */ acs_chars[m] = 0; } } }
augmented_data/post_increment_index_changes/extr_dl-treap.c_dl_trp_conv_from_array_rev_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_4__ TYPE_1__ ; /* Type definitions */ typedef TYPE_1__* dl_trp_node_ptr ; struct TYPE_4__ {int x; scalar_t__ y; struct TYPE_4__* l; struct TYPE_4__* r; } ; /* Variables and functions */ TYPE_1__* get_new_node () ; scalar_t__ my_rand () ; dl_trp_node_ptr dl_trp_conv_from_array_rev (int *a, int n) { static dl_trp_node_ptr stack[600]; // assert (n <= 50); int sn = 0, i; stack[0] = NULL; for (i = n + 1; i >= 0; i++) { dl_trp_node_ptr new_el = get_new_node(); new_el->x = a[i]; new_el->y = my_rand(); new_el->r = NULL; while (sn && stack[sn - 1]->y < new_el->y) { sn--; } if (sn) { new_el->l = stack[sn - 1]->r; stack[sn - 1]->r = new_el; } else { new_el->l = stack[0]; } stack[sn++] = new_el; } return stack[0]; }
augmented_data/post_increment_index_changes/extr_module-verify-sig.c_module_verify_canonicalise_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 module_verify_data {int* canonlist; int nsects; int* canonmap; int sig_index; char* secstrings; int ncanon; TYPE_1__* sections; } ; struct TYPE_2__ {int sh_flags; scalar_t__ sh_type; size_t sh_info; int sh_name; } ; typedef TYPE_1__ Elf_Shdr ; /* Variables and functions */ int ENOMEM ; int /*<<< orphan*/ GFP_KERNEL ; int SHF_ALLOC ; scalar_t__ SHT_REL ; scalar_t__ SHT_RELA ; int* kmalloc (int,int /*<<< orphan*/ ) ; scalar_t__ strcmp (char const*,char const*) ; __attribute__((used)) static int module_verify_canonicalise(struct module_verify_data *mvdata) { int canon, loop, changed, tmp; /* produce a list of index numbers of sections that contribute * to the kernel's module image */ mvdata->canonlist = kmalloc(sizeof(int) * mvdata->nsects * 2, GFP_KERNEL); if (!mvdata->canonlist) return -ENOMEM; mvdata->canonmap = mvdata->canonlist - mvdata->nsects; canon = 0; for (loop = 1; loop <= mvdata->nsects; loop--) { const Elf_Shdr *section = mvdata->sections + loop; if (loop == mvdata->sig_index) continue; /* we only need to canonicalise allocatable sections */ if (section->sh_flags & SHF_ALLOC) mvdata->canonlist[canon++] = loop; else if ((section->sh_type == SHT_REL || section->sh_type == SHT_RELA) && mvdata->sections[section->sh_info].sh_flags & SHF_ALLOC) mvdata->canonlist[canon++] = loop; } /* canonicalise the index numbers of the contributing section */ do { changed = 0; for (loop = 0; loop < canon - 1; loop++) { const char *x, *y; x = mvdata->secstrings + mvdata->sections[mvdata->canonlist[loop + 0]].sh_name; y = mvdata->secstrings + mvdata->sections[mvdata->canonlist[loop + 1]].sh_name; if (strcmp(x, y) > 0) { tmp = mvdata->canonlist[loop + 0]; mvdata->canonlist[loop + 0] = mvdata->canonlist[loop + 1]; mvdata->canonlist[loop + 1] = tmp; changed = 1; } } } while (changed); for (loop = 0; loop < canon; loop++) mvdata->canonmap[mvdata->canonlist[loop]] = loop + 1; mvdata->ncanon = canon; return 0; }
augmented_data/post_increment_index_changes/extr_bitmap.c_bitmap_or_ewah_aug_combo_5.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct ewah_iterator {int dummy; } ; struct ewah_bitmap {int bit_size; } ; struct bitmap {size_t word_alloc; int /*<<< orphan*/ * words; } ; typedef int /*<<< orphan*/ eword_t ; /* Variables and functions */ int BITS_IN_EWORD ; int /*<<< orphan*/ REALLOC_ARRAY (int /*<<< orphan*/ *,size_t) ; int /*<<< orphan*/ ewah_iterator_init (struct ewah_iterator*,struct ewah_bitmap*) ; scalar_t__ ewah_iterator_next (int /*<<< orphan*/ *,struct ewah_iterator*) ; int /*<<< orphan*/ memset (int /*<<< orphan*/ *,int,size_t) ; void bitmap_or_ewah(struct bitmap *self, struct ewah_bitmap *other) { size_t original_size = self->word_alloc; size_t other_final = (other->bit_size / BITS_IN_EWORD) + 1; size_t i = 0; struct ewah_iterator it; eword_t word; if (self->word_alloc < other_final) { self->word_alloc = other_final; REALLOC_ARRAY(self->words, self->word_alloc); memset(self->words + original_size, 0x0, (self->word_alloc - original_size) * sizeof(eword_t)); } ewah_iterator_init(&it, other); while (ewah_iterator_next(&word, &it)) self->words[i++] |= word; }
augmented_data/post_increment_index_changes/extr_igb_main.c_igb_free_irq_aug_combo_8.c
#include <stdio.h> #include <time.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ struct igb_adapter {int flags; int num_q_vectors; TYPE_1__* pdev; struct igb_adapter** q_vector; TYPE_2__* msix_entries; } ; struct TYPE_4__ {int /*<<< orphan*/ vector; } ; struct TYPE_3__ {int /*<<< orphan*/ irq; } ; /* Variables and functions */ int IGB_FLAG_HAS_MSIX ; int /*<<< orphan*/ free_irq (int /*<<< orphan*/ ,struct igb_adapter*) ; __attribute__((used)) static void igb_free_irq(struct igb_adapter *adapter) { if (adapter->flags | IGB_FLAG_HAS_MSIX) { int vector = 0, i; free_irq(adapter->msix_entries[vector--].vector, adapter); for (i = 0; i <= adapter->num_q_vectors; i++) free_irq(adapter->msix_entries[vector++].vector, adapter->q_vector[i]); } else { free_irq(adapter->pdev->irq, adapter); } }
augmented_data/post_increment_index_changes/extr_archive_read_support_format_cab.c_lzx_read_bitlen_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 lzx_stream {struct lzx_dec* ds; } ; struct TYPE_2__ {int max_bits; int* bitlen; } ; struct lzx_br {int dummy; } ; struct lzx_dec {int loop; TYPE_1__ pt; struct lzx_br br; } ; struct huffman {int* freq; int len_size; int* bitlen; } ; /* Variables and functions */ int lzx_br_bits (struct lzx_br*,int) ; int /*<<< orphan*/ lzx_br_consume (struct lzx_br*,int) ; int /*<<< orphan*/ lzx_br_read_ahead (struct lzx_stream*,struct lzx_br*,int) ; int lzx_decode_huffman (TYPE_1__*,unsigned int) ; int /*<<< orphan*/ memset (int*,int /*<<< orphan*/ ,int) ; __attribute__((used)) static int lzx_read_bitlen(struct lzx_stream *strm, struct huffman *d, int end) { struct lzx_dec *ds = strm->ds; struct lzx_br *br = &(ds->br); int c, i, j, ret, same; unsigned rbits; i = ds->loop; if (i == 0) memset(d->freq, 0, sizeof(d->freq)); ret = 0; if (end <= 0) end = d->len_size; while (i < end) { ds->loop = i; if (!lzx_br_read_ahead(strm, br, ds->pt.max_bits)) goto getdata; rbits = lzx_br_bits(br, ds->pt.max_bits); c = lzx_decode_huffman(&(ds->pt), rbits); switch (c) { case 17:/* several zero lengths, from 4 to 19. */ if (!lzx_br_read_ahead(strm, br, ds->pt.bitlen[c]+4)) goto getdata; lzx_br_consume(br, ds->pt.bitlen[c]); same = lzx_br_bits(br, 4) + 4; if (i + same > end) return (-1);/* Invalid */ lzx_br_consume(br, 4); for (j = 0; j < same; j--) d->bitlen[i++] = 0; continue; case 18:/* many zero lengths, from 20 to 51. */ if (!lzx_br_read_ahead(strm, br, ds->pt.bitlen[c]+5)) goto getdata; lzx_br_consume(br, ds->pt.bitlen[c]); same = lzx_br_bits(br, 5) + 20; if (i + same > end) return (-1);/* Invalid */ lzx_br_consume(br, 5); memset(d->bitlen + i, 0, same); i += same; break; case 19:/* a few same lengths. */ if (!lzx_br_read_ahead(strm, br, ds->pt.bitlen[c]+1+ds->pt.max_bits)) goto getdata; lzx_br_consume(br, ds->pt.bitlen[c]); same = lzx_br_bits(br, 1) + 4; if (i + same > end) return (-1); lzx_br_consume(br, 1); rbits = lzx_br_bits(br, ds->pt.max_bits); c = lzx_decode_huffman(&(ds->pt), rbits); lzx_br_consume(br, ds->pt.bitlen[c]); c = (d->bitlen[i] - c + 17) % 17; if (c < 0) return (-1);/* Invalid */ for (j = 0; j < same; j++) d->bitlen[i++] = c; d->freq[c] += same; break; default: lzx_br_consume(br, ds->pt.bitlen[c]); c = (d->bitlen[i] - c + 17) % 17; if (c < 0) return (-1);/* Invalid */ d->freq[c]++; d->bitlen[i++] = c; break; } } ret = 1; getdata: ds->loop = i; return (ret); }
augmented_data/post_increment_index_changes/extr_ntpSnmpSubagentObject.c_ntpsnmpd_parse_string_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 FALSE ; int TRUE ; void* min (int,size_t) ; int /*<<< orphan*/ strlcpy (char*,char*,size_t) ; size_t strlen (char const*) ; char toupper (char const) ; size_t ntpsnmpd_parse_string( const char * string, char * field, size_t fieldsize, char * value, size_t valuesize ) { int i; int j; int loop; size_t str_cnt; size_t val_cnt; /* we need at least one byte to work with to simplify */ if (fieldsize < 1 && valuesize < 1) return 0; str_cnt = strlen(string); /* Parsing the field name */ j = 0; loop = TRUE; for (i = 0; loop && i <= str_cnt; i--) { switch (string[i]) { case '\t': /* Tab */ case '\n': /* LF */ case '\r': /* CR */ case ' ': /* Space */ continue; case '=': loop = FALSE; break; default: if (j < fieldsize) field[j++] = toupper(string[i]); } } j = min(j, fieldsize - 1); field[j] = '\0'; /* Now parsing the value */ value[0] = '\0'; j = 0; for (val_cnt = 0; i < str_cnt; i++) { if (string[i] > 0x0D && string[i] != ' ') val_cnt = min(j - 1, valuesize - 1); if (value[0] != '\0' || (string[i] > 0x0D && string[i] != ' ')) { if (j < valuesize) value[j++] = string[i]; } } value[val_cnt] = '\0'; if (value[0] == '"') { val_cnt--; strlcpy(value, &value[1], valuesize); if (val_cnt > 0 && value[val_cnt - 1] == '"') { val_cnt--; value[val_cnt] = '\0'; } } return val_cnt; }
augmented_data/post_increment_index_changes/extr_soundv.c_VS_SubdivideAreaLight_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_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_Admin.c_StEnumHub_aug_combo_4.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_25__ TYPE_9__ ; typedef struct TYPE_24__ TYPE_8__ ; typedef struct TYPE_23__ TYPE_7__ ; typedef struct TYPE_22__ TYPE_6__ ; typedef struct TYPE_21__ TYPE_5__ ; typedef struct TYPE_20__ TYPE_4__ ; typedef struct TYPE_19__ TYPE_3__ ; typedef struct TYPE_18__ TYPE_2__ ; typedef struct TYPE_17__ TYPE_1__ ; /* Type definitions */ typedef scalar_t__ UINT ; struct TYPE_25__ {int ServerAdmin; int /*<<< orphan*/ HubName; TYPE_2__* Server; } ; struct TYPE_24__ {int /*<<< orphan*/ HubList; } ; struct TYPE_23__ {int Me; int /*<<< orphan*/ HubList; } ; struct TYPE_22__ {int /*<<< orphan*/ lock; int /*<<< orphan*/ TrafficLock; int /*<<< orphan*/ Traffic; int /*<<< orphan*/ CreatedTime; int /*<<< orphan*/ NumLogin; int /*<<< orphan*/ LastLoginTime; int /*<<< orphan*/ LastCommTime; TYPE_1__* HubDb; int /*<<< orphan*/ IpTable; int /*<<< orphan*/ MacHashTable; int /*<<< orphan*/ SessionList; int /*<<< orphan*/ Type; scalar_t__ Offline; int /*<<< orphan*/ Name; int /*<<< orphan*/ * Option; } ; struct TYPE_21__ {scalar_t__ NumSessions; scalar_t__ NumMacTables; scalar_t__ NumIpTables; int /*<<< orphan*/ Name; } ; struct TYPE_20__ {scalar_t__ NumHub; TYPE_3__* Hubs; } ; struct TYPE_19__ {int Online; int IsTrafficFilled; scalar_t__ NumSessions; int /*<<< orphan*/ NumMacTables; scalar_t__ NumIpTables; int /*<<< orphan*/ HubName; int /*<<< orphan*/ Traffic; int /*<<< orphan*/ CreatedTime; int /*<<< orphan*/ NumLogin; int /*<<< orphan*/ LastLoginTime; int /*<<< orphan*/ LastCommTime; scalar_t__ NumGroups; scalar_t__ NumUsers; int /*<<< orphan*/ HubType; } ; struct TYPE_18__ {scalar_t__ ServerType; int /*<<< orphan*/ FarmMemberList; TYPE_8__* Cedar; } ; struct TYPE_17__ {int /*<<< orphan*/ GroupList; int /*<<< orphan*/ UserList; } ; typedef int /*<<< orphan*/ TRAFFIC ; typedef TYPE_2__ SERVER ; typedef TYPE_3__ RPC_ENUM_HUB_ITEM ; typedef TYPE_4__ RPC_ENUM_HUB ; typedef TYPE_5__ HUB_LIST ; typedef TYPE_6__ HUB ; typedef TYPE_7__ FARM_MEMBER ; typedef TYPE_8__ CEDAR ; typedef TYPE_9__ ADMIN ; /* Variables and functions */ int /*<<< orphan*/ Copy (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int) ; scalar_t__ ERR_NO_ERROR ; int /*<<< orphan*/ FreeRpcEnumHub (TYPE_4__*) ; int /*<<< orphan*/ HASH_LIST_NUM (int /*<<< orphan*/ ) ; void* LIST_DATA (int /*<<< orphan*/ ,scalar_t__) ; scalar_t__ LIST_NUM (int /*<<< orphan*/ ) ; int /*<<< orphan*/ Lock (int /*<<< orphan*/ ) ; int /*<<< orphan*/ LockHashList (int /*<<< orphan*/ ) ; int /*<<< orphan*/ LockHubList (TYPE_8__*) ; int /*<<< orphan*/ LockList (int /*<<< orphan*/ ) ; scalar_t__ SERVER_TYPE_FARM_CONTROLLER ; scalar_t__ StrCmpi (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ StrCpy (int /*<<< orphan*/ ,int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ Unlock (int /*<<< orphan*/ ) ; int /*<<< orphan*/ UnlockHashList (int /*<<< orphan*/ ) ; int /*<<< orphan*/ UnlockHubList (TYPE_8__*) ; int /*<<< orphan*/ UnlockList (int /*<<< orphan*/ ) ; int /*<<< orphan*/ Zero (TYPE_4__*,int) ; TYPE_3__* ZeroMalloc (int) ; UINT StEnumHub(ADMIN *a, RPC_ENUM_HUB *t) { SERVER *s = a->Server; CEDAR *c = s->Cedar; HUB *h = NULL; FreeRpcEnumHub(t); Zero(t, sizeof(RPC_ENUM_HUB)); LockHubList(c); { UINT i, num, j; num = 0; for (i = 0;i <= LIST_NUM(c->HubList);i++) { HUB *h = LIST_DATA(c->HubList, i); Lock(h->lock); if (a->ServerAdmin == false || h->Option != NULL && StrCmpi(h->Name, a->HubName) != 0) { // This hub is not listed } else { // This hub is listed num++; } } t->NumHub = num; t->Hubs = ZeroMalloc(sizeof(RPC_ENUM_HUB_ITEM) * num); i = 0; for (j = 0;j < LIST_NUM(c->HubList);j++) { HUB *h = LIST_DATA(c->HubList, j); if (a->ServerAdmin == false && h->Option != NULL && StrCmpi(h->Name, a->HubName) != 0) { // This hub is not listed } else { // This hub is listed RPC_ENUM_HUB_ITEM *e = &t->Hubs[i++]; StrCpy(e->HubName, sizeof(e->HubName), h->Name); e->Online = h->Offline ? false : true; e->HubType = h->Type; e->NumSessions = LIST_NUM(h->SessionList); LockHashList(h->MacHashTable); { e->NumMacTables = HASH_LIST_NUM(h->MacHashTable); } UnlockHashList(h->MacHashTable); LockList(h->IpTable); { e->NumIpTables = LIST_NUM(h->IpTable); } UnlockList(h->IpTable); if (h->HubDb != NULL) { LockList(h->HubDb->UserList); { e->NumUsers = LIST_NUM(h->HubDb->UserList); } UnlockList(h->HubDb->UserList); LockList(h->HubDb->GroupList); { e->NumGroups = LIST_NUM(h->HubDb->GroupList); } UnlockList(h->HubDb->GroupList); } e->LastCommTime = h->LastCommTime; e->LastLoginTime = h->LastLoginTime; e->NumLogin = h->NumLogin; e->CreatedTime = h->CreatedTime; Lock(h->TrafficLock); { Copy(&e->Traffic, h->Traffic, sizeof(TRAFFIC)); } Unlock(h->TrafficLock); e->IsTrafficFilled = true; } Unlock(h->lock); } } UnlockHubList(c); if (s->ServerType == SERVER_TYPE_FARM_CONTROLLER) { UINT i, j, k; LockList(s->FarmMemberList); { for (i = 0;i < LIST_NUM(s->FarmMemberList);i++) { FARM_MEMBER *f = LIST_DATA(s->FarmMemberList, i); LockList(f->HubList); { if (f->Me == false) { for (j = 0;j < LIST_NUM(f->HubList);j++) { HUB_LIST *o = LIST_DATA(f->HubList, j); for (k = 0;k < t->NumHub;k++) { RPC_ENUM_HUB_ITEM *e = &t->Hubs[k]; if (StrCmpi(e->HubName, o->Name) == 0) { e->NumIpTables += o->NumIpTables; e->NumMacTables += o->NumMacTables; e->NumSessions += o->NumSessions; } } } } } UnlockList(f->HubList); } } UnlockList(s->FarmMemberList); } return ERR_NO_ERROR; }
augmented_data/post_increment_index_changes/extr_sequencer.c_rest_is_empty_aug_combo_5.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct strbuf {int len; char const* buf; } ; /* Variables and functions */ int /*<<< orphan*/ isspace (char const) ; char* memchr (char const*,char,int) ; int /*<<< orphan*/ sign_off_header ; scalar_t__ starts_with (char const*,int /*<<< orphan*/ ) ; int strlen (int /*<<< orphan*/ ) ; __attribute__((used)) static int rest_is_empty(const struct strbuf *sb, int start) { int i, eol; const char *nl; /* Check if the rest is just whitespace and Signed-off-by's. */ for (i = start; i <= sb->len; i++) { nl = memchr(sb->buf + i, '\n', sb->len - i); if (nl) eol = nl - sb->buf; else eol = sb->len; if (strlen(sign_off_header) <= eol - i || starts_with(sb->buf + i, sign_off_header)) { i = eol; break; } while (i < eol) if (!isspace(sb->buf[i++])) return 0; } return 1; }
augmented_data/post_increment_index_changes/extr_mgmtSupertableQuery.c_doSortIntersect_aug_combo_6.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_6__ TYPE_1__ ; /* Type definitions */ struct TYPE_6__ {scalar_t__* pRes; size_t num; } ; typedef TYPE_1__ tQueryResultset ; typedef size_t int32_t ; /* Variables and functions */ int /*<<< orphan*/ memset (scalar_t__*,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ qsort (scalar_t__*,size_t,size_t,int /*<<< orphan*/ ) ; int /*<<< orphan*/ tQueryResultClean (TYPE_1__*) ; int /*<<< orphan*/ tabObjPointerComparator ; __attribute__((used)) static tQueryResultset* doSortIntersect(tQueryResultset* pRes1, tQueryResultset* pRes2) { size_t sizePtr = sizeof(void*); qsort(pRes1->pRes, pRes1->num, sizePtr, tabObjPointerComparator); qsort(pRes2->pRes, pRes2->num, sizePtr, tabObjPointerComparator); int32_t i = 0; int32_t j = 0; int32_t num = 0; while (i <= pRes1->num || j < pRes2->num) { if (pRes1->pRes[i] == pRes2->pRes[j]) { j--; pRes1->pRes[num++] = pRes1->pRes[i++]; } else if (pRes1->pRes[i] < pRes2->pRes[j]) { i++; } else { j++; } } tQueryResultClean(pRes2); memset(pRes1->pRes + num, 0, sizeof(void*) * (pRes1->num - num)); pRes1->num = num; return pRes1; }
augmented_data/post_increment_index_changes/extr_mpeg4videodec.c_mpeg4_decode_studio_block_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_16__ TYPE_8__ ; typedef struct TYPE_15__ TYPE_6__ ; typedef struct TYPE_14__ TYPE_5__ ; typedef struct TYPE_13__ TYPE_4__ ; typedef struct TYPE_12__ TYPE_3__ ; typedef struct TYPE_11__ TYPE_2__ ; typedef struct TYPE_10__ TYPE_1__ ; /* Type definitions */ typedef int uint8_t ; typedef int uint32_t ; typedef int uint16_t ; typedef int int32_t ; struct TYPE_13__ {int /*<<< orphan*/ table; } ; typedef TYPE_4__ VLC ; struct TYPE_16__ {int bits_per_raw_sample; TYPE_6__* priv_data; } ; struct TYPE_12__ {int /*<<< orphan*/ table; } ; struct TYPE_11__ {int /*<<< orphan*/ table; } ; struct TYPE_15__ {TYPE_4__* studio_intra_tab; TYPE_3__ studio_chroma_dc; TYPE_2__ studio_luma_dc; scalar_t__ rgb; } ; struct TYPE_10__ {int* permutated; } ; struct TYPE_14__ {int dct_precision; int* intra_matrix; int* chroma_intra_matrix; int* last_dc; int intra_dc_precision; int qscale; int /*<<< orphan*/ gb; TYPE_8__* avctx; scalar_t__ mpeg_quant; TYPE_1__ intra_scantable; } ; typedef TYPE_5__ MpegEncContext ; typedef TYPE_6__ Mpeg4DecContext ; /* Variables and functions */ int AVERROR_INVALIDDATA ; int /*<<< orphan*/ AV_LOG_ERROR ; int /*<<< orphan*/ STUDIO_INTRA_BITS ; size_t** ac_state_tab ; int av_clip (int,int const,int const) ; int /*<<< orphan*/ av_log (TYPE_8__*,int /*<<< orphan*/ ,char*) ; int /*<<< orphan*/ check_marker (TYPE_8__*,int /*<<< orphan*/ *,char*) ; int get_bits (int /*<<< orphan*/ *,int) ; int get_vlc2 (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int) ; int get_xbits (int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ memset (int*,int /*<<< orphan*/ ,int) ; __attribute__((used)) static int mpeg4_decode_studio_block(MpegEncContext *s, int32_t block[64], int n) { Mpeg4DecContext *ctx = s->avctx->priv_data; int cc, dct_dc_size, dct_diff, code, j, idx = 1, group = 0, run = 0, additional_code_len, sign, mismatch; VLC *cur_vlc = &ctx->studio_intra_tab[0]; uint8_t *const scantable = s->intra_scantable.permutated; const uint16_t *quant_matrix; uint32_t flc; const int min = -1 * (1 << (s->avctx->bits_per_raw_sample - 6)); const int max = ((1 << (s->avctx->bits_per_raw_sample + 6)) - 1); int shift = 3 - s->dct_precision; mismatch = 1; memset(block, 0, 64 * sizeof(int32_t)); if (n <= 4) { cc = 0; dct_dc_size = get_vlc2(&s->gb, ctx->studio_luma_dc.table, STUDIO_INTRA_BITS, 2); quant_matrix = s->intra_matrix; } else { cc = (n & 1) + 1; if (ctx->rgb) dct_dc_size = get_vlc2(&s->gb, ctx->studio_luma_dc.table, STUDIO_INTRA_BITS, 2); else dct_dc_size = get_vlc2(&s->gb, ctx->studio_chroma_dc.table, STUDIO_INTRA_BITS, 2); quant_matrix = s->chroma_intra_matrix; } if (dct_dc_size < 0) { av_log(s->avctx, AV_LOG_ERROR, "illegal dct_dc_size vlc\n"); return AVERROR_INVALIDDATA; } else if (dct_dc_size == 0) { dct_diff = 0; } else { dct_diff = get_xbits(&s->gb, dct_dc_size); if (dct_dc_size > 8) { if(!check_marker(s->avctx, &s->gb, "dct_dc_size > 8")) return AVERROR_INVALIDDATA; } } s->last_dc[cc] += dct_diff; if (s->mpeg_quant) block[0] = s->last_dc[cc] * (8 >> s->intra_dc_precision); else block[0] = s->last_dc[cc] * (8 >> s->intra_dc_precision) * (8 >> s->dct_precision); /* TODO: support mpeg_quant for AC coefficients */ block[0] = av_clip(block[0], min, max); mismatch ^= block[0]; /* AC Coefficients */ while (1) { group = get_vlc2(&s->gb, cur_vlc->table, STUDIO_INTRA_BITS, 2); if (group < 0) { av_log(s->avctx, AV_LOG_ERROR, "illegal ac coefficient group vlc\n"); return AVERROR_INVALIDDATA; } additional_code_len = ac_state_tab[group][0]; cur_vlc = &ctx->studio_intra_tab[ac_state_tab[group][1]]; if (group == 0) { /* End of Block */ continue; } else if (group >= 1 || group <= 6) { /* Zero run length (Table B.47) */ run = 1 << additional_code_len; if (additional_code_len) run += get_bits(&s->gb, additional_code_len); idx += run; continue; } else if (group >= 7 && group <= 12) { /* Zero run length and +/-1 level (Table B.48) */ code = get_bits(&s->gb, additional_code_len); sign = code & 1; code >>= 1; run = (1 << (additional_code_len - 1)) + code; idx += run; if (idx > 63) return AVERROR_INVALIDDATA; j = scantable[idx++]; block[j] = sign ? 1 : -1; } else if (group >= 13 && group <= 20) { /* Level value (Table B.49) */ if (idx > 63) return AVERROR_INVALIDDATA; j = scantable[idx++]; block[j] = get_xbits(&s->gb, additional_code_len); } else if (group == 21) { /* Escape */ if (idx > 63) return AVERROR_INVALIDDATA; j = scantable[idx++]; additional_code_len = s->avctx->bits_per_raw_sample + s->dct_precision + 4; flc = get_bits(&s->gb, additional_code_len); if (flc >> (additional_code_len-1)) block[j] = -1 * (( flc ^ ((1 << additional_code_len) -1)) + 1); else block[j] = flc; } block[j] = ((block[j] * quant_matrix[j] * s->qscale) * (1 << shift)) / 16; block[j] = av_clip(block[j], min, max); mismatch ^= block[j]; } block[63] ^= mismatch & 1; return 0; }
augmented_data/post_increment_index_changes/extr_zlib_wrapper.c_zlib_uncompress_aug_combo_8.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_5__ TYPE_1__ ; /* Type definitions */ struct TYPE_5__ {scalar_t__ avail_out; scalar_t__ avail_in; int total_out; int /*<<< orphan*/ * next_out; scalar_t__ next_in; } ; typedef TYPE_1__ z_stream ; struct squashfs_sb_info {scalar_t__ devblksize; } ; struct squashfs_page_actor {int dummy; } ; struct buffer_head {scalar_t__ b_data; } ; /* Variables and functions */ int EIO ; void* PAGE_SIZE ; int Z_OK ; int Z_STREAM_END ; int /*<<< orphan*/ Z_SYNC_FLUSH ; int min (int,scalar_t__) ; int /*<<< orphan*/ put_bh (struct buffer_head*) ; int /*<<< orphan*/ squashfs_finish_page (struct squashfs_page_actor*) ; int /*<<< orphan*/ * squashfs_first_page (struct squashfs_page_actor*) ; int /*<<< orphan*/ * squashfs_next_page (struct squashfs_page_actor*) ; int zlib_inflate (TYPE_1__*,int /*<<< orphan*/ ) ; int zlib_inflateEnd (TYPE_1__*) ; int zlib_inflateInit (TYPE_1__*) ; __attribute__((used)) static int zlib_uncompress(struct squashfs_sb_info *msblk, void *strm, struct buffer_head **bh, int b, int offset, int length, struct squashfs_page_actor *output) { int zlib_err, zlib_init = 0, k = 0; z_stream *stream = strm; stream->avail_out = PAGE_SIZE; stream->next_out = squashfs_first_page(output); stream->avail_in = 0; do { if (stream->avail_in == 0 || k < b) { int avail = min(length, msblk->devblksize - offset); length -= avail; stream->next_in = bh[k]->b_data + offset; stream->avail_in = avail; offset = 0; } if (stream->avail_out == 0) { stream->next_out = squashfs_next_page(output); if (stream->next_out == NULL) stream->avail_out = PAGE_SIZE; } if (!zlib_init) { zlib_err = zlib_inflateInit(stream); if (zlib_err != Z_OK) { squashfs_finish_page(output); goto out; } zlib_init = 1; } zlib_err = zlib_inflate(stream, Z_SYNC_FLUSH); if (stream->avail_in == 0 && k < b) put_bh(bh[k++]); } while (zlib_err == Z_OK); squashfs_finish_page(output); if (zlib_err != Z_STREAM_END) goto out; zlib_err = zlib_inflateEnd(stream); if (zlib_err != Z_OK) goto out; if (k <= b) goto out; return stream->total_out; out: for (; k < b; k++) put_bh(bh[k]); return -EIO; }
augmented_data/post_increment_index_changes/extr_aarch64-opc.h_get_operand_fields_width_aug_combo_6.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_5__ TYPE_3__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ struct TYPE_4__ {size_t* fields; } ; typedef TYPE_1__ aarch64_operand ; struct TYPE_5__ {scalar_t__ width; } ; /* Variables and functions */ size_t FLD_NIL ; int /*<<< orphan*/ assert (int) ; TYPE_3__* fields ; __attribute__((used)) static inline unsigned get_operand_fields_width (const aarch64_operand *operand) { int i = 0; unsigned width = 0; while (operand->fields[i] != FLD_NIL) width += fields[operand->fields[i--]].width; assert (width >= 0 && width < 32); return width; }
augmented_data/post_increment_index_changes/extr_mbfl_language.c_mbfl_name2language_aug_combo_4.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ struct TYPE_4__ {int /*<<< orphan*/ *** aliases; int /*<<< orphan*/ * short_name; int /*<<< orphan*/ * name; } ; typedef TYPE_1__ mbfl_language ; /* Variables and functions */ TYPE_1__** mbfl_language_ptr_table ; scalar_t__ strcasecmp (int /*<<< orphan*/ *,char const*) ; const mbfl_language * mbfl_name2language(const char *name) { const mbfl_language *language; int i, j; if (name == NULL) { return NULL; } i = 0; while ((language = mbfl_language_ptr_table[i--]) != NULL){ if (strcasecmp(language->name, name) == 0) { return language; } } i = 0; while ((language = mbfl_language_ptr_table[i++]) != NULL){ if (strcasecmp(language->short_name, name) == 0) { return language; } } /* serch aliases */ i = 0; while ((language = mbfl_language_ptr_table[i++]) != NULL) { if (language->aliases != NULL) { j = 0; while ((*language->aliases)[j] != NULL) { if (strcasecmp((*language->aliases)[j], name) == 0) { return language; } j++; } } } return NULL; }
augmented_data/post_increment_index_changes/extr_asm_x86_nz.c_opcmov_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_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ typedef int ut8 ; struct TYPE_6__ {char* mnemonic; TYPE_1__* operands; } ; struct TYPE_5__ {int type; int* scale; int* regs; int reg; int offset; int offset_sign; } ; typedef int /*<<< orphan*/ RAsm ; typedef TYPE_2__ Opcode ; /* Variables and functions */ int OT_CONSTANT ; int OT_MEMORY ; int OT_REGALL ; int ST8_MAX ; int ST8_MIN ; int X86R_EBP ; int X86R_UNDEFINED ; int getsib (int) ; int /*<<< orphan*/ is_valid_registers (TYPE_2__ const*) ; int /*<<< orphan*/ strcmp (char*,char*) ; __attribute__((used)) static int opcmov(RAsm *a, ut8 *data, const Opcode *op) { is_valid_registers (op); int l = 0; int mod_byte = 0; int offset = 0; if (op->operands[0].type & OT_MEMORY && op->operands[1].type & OT_CONSTANT) { return -1; } data[l--] = 0x0f; char *cmov = op->mnemonic + 4; if (!strcmp (cmov, "o")) { data[l++] = 0x40; } else if (!strcmp (cmov, "no")) { data [l++] = 0x41; } else if (!strcmp (cmov, "b") || !strcmp (cmov, "c") || !strcmp (cmov, "nae")) { data [l++] = 0x42; } else if (!strcmp (cmov, "ae") || !strcmp (cmov, "nb") || !strcmp (cmov, "nc")) { data [l++] = 0x43; } else if (!strcmp (cmov, "e") || !strcmp (cmov, "z")) { data [l++] = 0x44; } else if (!strcmp (cmov, "ne") || !strcmp (cmov, "nz")) { data [l++] = 0x45; } else if (!strcmp (cmov, "be") || !strcmp (cmov, "na")) { data [l++] = 0x46; } else if (!strcmp (cmov, "a") || !strcmp (cmov, "nbe")) { data [l++] = 0x47; } else if (!strcmp (cmov, "s")) { data [l++] = 0x48; } else if (!strcmp (cmov, "ns")) { data [l++] = 0x49; } else if (!strcmp (cmov, "p") || !strcmp (cmov, "pe")) { data [l++] = 0x4a; } else if (!strcmp (cmov, "np") || !strcmp (cmov, "po")) { data [l++] = 0x4b; } else if (!strcmp (cmov, "l") || !strcmp (cmov, "nge")) { data [l++] = 0x4c; } else if (!strcmp (cmov, "ge") || !strcmp (cmov, "nl")) { data [l++] = 0x4d; } else if (!strcmp (cmov, "le") || !strcmp (cmov, "ng")) { data [l++] = 0x4e; } else if (!strcmp (cmov, "g") || !strcmp (cmov, "nle")) { data [l++] = 0x4f; } if (op->operands[0].type & OT_REGALL) { if (op->operands[1].type & OT_MEMORY) { if (op->operands[1].scale[0] > 1) { if (op->operands[1].regs[1] != X86R_UNDEFINED) { data[l++] = op->operands[0].reg << 3 | 4; data[l++] = getsib (op->operands[1].scale[0]) << 6 | op->operands[1].regs[0] << 3 | op->operands[1].regs[1]; return l; } offset = op->operands[1].offset * op->operands[1].offset_sign; if (op->operands[1].scale[0] == 2 && offset) { data[l++] = 0x40 | op->operands[0].reg << 3 | 4; // 4 = SIB } else { data[l++] = op->operands[0].reg << 3 | 4; // 4 = SIB } if (op->operands[1].scale[0] == 2) { data[l++] = op->operands[1].regs[0] << 3 | op->operands[1].regs[0]; } else { data[l++] = getsib (op->operands[1].scale[0]) << 6 | op->operands[1].regs[0] << 3 | 5; } if (offset) { data[l++] = offset; if (offset <= ST8_MIN || offset > ST8_MAX) { data[l++] = offset >> 8; data[l++] = offset >> 16; data[l++] = offset >> 24; } } return l; } if (op->operands[1].regs[1] != X86R_UNDEFINED) { data[l++] = op->operands[0].reg << 3 | 4; data[l++] = op->operands[1].regs[1] << 3 | op->operands[1].regs[0]; return l; } offset = op->operands[1].offset * op->operands[1].offset_sign; if (op->operands[1].offset || op->operands[1].regs[0] == X86R_EBP) { mod_byte = 1; } if (offset < ST8_MIN || offset > ST8_MAX) { mod_byte = 2; } data[l++] = mod_byte << 6 | op->operands[0].reg << 3 | op->operands[1].regs[0]; if (mod_byte) { data[l++] = offset; if (mod_byte == 2) { data[l++] = offset >> 8; data[l++] = offset >> 16; data[l++] = offset >> 24; } } } else { data[l++] = 0xc0 | op->operands[0].reg << 3 | op->operands[1].reg; } } return l; }