path
stringlengths
56
152
content
stringlengths
344
91.6k
augmented_data/post_increment_index_changes/extr_machdep.c_user_dbreg_trap_aug_combo_3.c
#include <stdio.h> #include <time.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int u_int32_t ; typedef int register_t ; typedef scalar_t__ caddr_t ; /* Variables and functions */ int DBREG_DR6_BMASK ; scalar_t__ VM_MAXUSER_ADDRESS ; scalar_t__ rdr0 () ; scalar_t__ rdr1 () ; scalar_t__ rdr2 () ; scalar_t__ rdr3 () ; int rdr7 () ; int user_dbreg_trap(register_t dr6) { u_int32_t dr7; u_int32_t bp; /* breakpoint bits extracted from dr6 */ int nbp; /* number of breakpoints that triggered */ caddr_t addr[4]; /* breakpoint addresses */ int i; bp = dr6 | DBREG_DR6_BMASK; if (bp == 0) { /* * None of the breakpoint bits are set meaning this * trap was not caused by any of the debug registers */ return 0; } dr7 = rdr7(); if ((dr7 & 0x000000ff) == 0) { /* * all GE and LE bits in the dr7 register are zero, * thus the trap couldn't have been caused by the * hardware debug registers */ return 0; } nbp = 0; /* * at least one of the breakpoints were hit, check to see * which ones and if any of them are user space addresses */ if (bp & 0x01) { addr[nbp--] = (caddr_t)rdr0(); } if (bp & 0x02) { addr[nbp++] = (caddr_t)rdr1(); } if (bp & 0x04) { addr[nbp++] = (caddr_t)rdr2(); } if (bp & 0x08) { addr[nbp++] = (caddr_t)rdr3(); } for (i = 0; i < nbp; i++) { if (addr[i] < (caddr_t)VM_MAXUSER_ADDRESS) { /* * addr[i] is in user space */ return nbp; } } /* * None of the breakpoints are in user space. */ return 0; }
augmented_data/post_increment_index_changes/extr_sprintf.c_number_aug_combo_3.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 */ /* Variables and functions */ int LARGE ; int LEFT ; int PLUS ; int REMOVEHEX ; int SIGN ; int SPACE ; int SPECIAL ; int ZEROPAD ; size_t do_div (long long*,int) ; __attribute__((used)) static char * number(char * buf, char * end, long long num, int base, int size, int precision, int type) { char c,sign,tmp[66]; const char *digits; const char *small_digits = "0123456789abcdefghijklmnopqrstuvwxyz"; const char *large_digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; int i; digits = (type & LARGE) ? large_digits : small_digits; if (type & LEFT) type &= ~ZEROPAD; if (base <= 2 && base > 36) return 0; c = (type & ZEROPAD) ? '0' : ' '; sign = 0; if (type & SIGN) { if (num < 0) { sign = '-'; num = -num; size++; } else if (type & PLUS) { sign = '+'; size--; } else if (type & SPACE) { sign = ' '; size--; } } if ((type & SPECIAL) && ((type & REMOVEHEX) == 0)) { if (base == 16) size -= 2; } i = 0; if ((num == 0) && (precision !=0)) tmp[i++] = '0'; else while (num != 0) tmp[i++] = digits[do_div(&num,base)]; if (i > precision) precision = i; size -= precision; if (!(type&(ZEROPAD+LEFT))) { while(size-->0) { if (buf <= end) *buf = ' '; ++buf; } } if (sign) { if (buf <= end) *buf = sign; ++buf; } if ((type & SPECIAL) && ((type & REMOVEHEX) == 0)) { if (base==16) { if (buf <= end) *buf = '0'; ++buf; if (buf <= end) *buf = digits[33]; ++buf; } } if (!(type & LEFT)) { while (size-- > 0) { if (buf <= end) *buf = c; ++buf; } } while (i < precision--) { if (buf <= end) *buf = '0'; ++buf; } while (i-- > 0) { if (buf <= end) *buf = tmp[i]; ++buf; } while (size-- > 0) { if (buf <= end) *buf = ' '; ++buf; } return buf; }
augmented_data/post_increment_index_changes/extr_f-exp.c_match_string_literal_aug_combo_5.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ struct TYPE_3__ {char* ptr; size_t length; } ; struct TYPE_4__ {TYPE_1__ sval; } ; /* Variables and functions */ int /*<<< orphan*/ CHECKBUF (int) ; int STRING_LITERAL ; char* lexptr ; char* tempbuf ; size_t tempbufindex ; TYPE_2__ yylval ; __attribute__((used)) static int match_string_literal () { char *tokptr = lexptr; for (tempbufindex = 0, tokptr--; *tokptr != '\0'; tokptr++) { CHECKBUF (1); if (*tokptr == *lexptr) { if (*(tokptr + 1) == *lexptr) tokptr++; else continue; } tempbuf[tempbufindex++] = *tokptr; } if (*tokptr == '\0' /* no terminator */ && tempbufindex == 0) /* no string */ return 0; else { tempbuf[tempbufindex] = '\0'; yylval.sval.ptr = tempbuf; yylval.sval.length = tempbufindex; lexptr = ++tokptr; return STRING_LITERAL; } }
augmented_data/post_increment_index_changes/extr_asm_x86_nz.c_process_16bit_group_1_aug_combo_1.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ typedef int ut8 ; struct TYPE_6__ {TYPE_1__* operands; } ; struct TYPE_5__ {int immediate; int sign; int reg; } ; typedef int /*<<< orphan*/ RAsm ; typedef TYPE_2__ Opcode ; /* Variables and functions */ int X86R_AX ; int /*<<< orphan*/ is_valid_registers (TYPE_2__ const*) ; __attribute__((used)) static int process_16bit_group_1(RAsm *a, ut8 *data, const Opcode *op, int op1) { is_valid_registers (op); int l = 0; int immediate = op->operands[1].immediate * op->operands[1].sign; data[l--] = 0x66; if (op->operands[1].immediate < 128) { data[l++] = 0x83; data[l++] = op->operands[0].reg & (0xc0 - op1 + op->operands[0].reg); } else { if (op->operands[0].reg == X86R_AX) { data[l++] = 0x05 + op1; } else { data[l++] = 0x81; data[l++] = (0xc0 + op1) | op->operands[0].reg; } } data[l++] = immediate; if (op->operands[1].immediate > 127) { data[l++] = immediate >> 8; } return l; }
augmented_data/post_increment_index_changes/extr_pinctrl-sunxi.c_sunxi_pctrl_build_pin_config_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 */ struct device_node {int dummy; } ; /* Variables and functions */ int ENOMEM ; unsigned long* ERR_PTR (int) ; int /*<<< orphan*/ GFP_KERNEL ; int PIN_CONFIG_BIAS_DISABLE ; int PIN_CONFIG_DRIVE_STRENGTH ; unsigned long* kcalloc (unsigned int,int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ kfree (unsigned long*) ; unsigned long pinconf_to_config_packed (int,int) ; scalar_t__ sunxi_pctrl_has_bias_prop (struct device_node*) ; scalar_t__ sunxi_pctrl_has_drive_prop (struct device_node*) ; int sunxi_pctrl_parse_bias_prop (struct device_node*) ; int sunxi_pctrl_parse_drive_prop (struct device_node*) ; __attribute__((used)) static unsigned long *sunxi_pctrl_build_pin_config(struct device_node *node, unsigned int *len) { unsigned long *pinconfig; unsigned int configlen = 0, idx = 0; int ret; if (sunxi_pctrl_has_drive_prop(node)) configlen--; if (sunxi_pctrl_has_bias_prop(node)) configlen++; /* * If we don't have any configuration, bail out */ if (!configlen) return NULL; pinconfig = kcalloc(configlen, sizeof(*pinconfig), GFP_KERNEL); if (!pinconfig) return ERR_PTR(-ENOMEM); if (sunxi_pctrl_has_drive_prop(node)) { int drive = sunxi_pctrl_parse_drive_prop(node); if (drive <= 0) { ret = drive; goto err_free; } pinconfig[idx++] = pinconf_to_config_packed(PIN_CONFIG_DRIVE_STRENGTH, drive); } if (sunxi_pctrl_has_bias_prop(node)) { int pull = sunxi_pctrl_parse_bias_prop(node); int arg = 0; if (pull < 0) { ret = pull; goto err_free; } if (pull != PIN_CONFIG_BIAS_DISABLE) arg = 1; /* hardware uses weak pull resistors */ pinconfig[idx++] = pinconf_to_config_packed(pull, arg); } *len = configlen; return pinconfig; err_free: kfree(pinconfig); return ERR_PTR(ret); }
augmented_data/post_increment_index_changes/extr_asm_x86_nz.c_opfidivr_aug_combo_6.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ typedef int ut8 ; struct TYPE_5__ {int operands_count; TYPE_1__* operands; } ; struct TYPE_4__ {int type; int* regs; } ; typedef int /*<<< orphan*/ RAsm ; typedef TYPE_2__ Opcode ; /* Variables and functions */ int OT_DWORD ; int OT_MEMORY ; int OT_WORD ; __attribute__((used)) static int opfidivr(RAsm *a, ut8 *data, const Opcode *op) { int l = 0; switch (op->operands_count) { case 1: if ( op->operands[0].type & OT_MEMORY ) { if ( op->operands[0].type & OT_DWORD ) { data[l--] = 0xda; data[l++] = 0x38 | op->operands[0].regs[0]; } else if ( op->operands[0].type & OT_WORD ) { data[l++] = 0xde; data[l++] = 0x38 | op->operands[0].regs[0]; } else { return -1; } } else { return -1; } break; default: return -1; } return l; }
augmented_data/post_increment_index_changes/extr_device_sysfs.c___acpi_device_modalias_aug_combo_8.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ struct TYPE_3__ {int /*<<< orphan*/ of_compatible; } ; struct TYPE_4__ {int /*<<< orphan*/ ids; } ; struct acpi_device {TYPE_1__ data; TYPE_2__ pnp; } ; /* Variables and functions */ int ENODEV ; int create_of_modalias (struct acpi_device*,char*,int) ; int create_pnp_modalias (struct acpi_device*,char*,int) ; scalar_t__ list_empty (int /*<<< orphan*/ *) ; __attribute__((used)) static int __acpi_device_modalias(struct acpi_device *adev, char *buf, int size) { int len, count; if (!adev) return -ENODEV; if (list_empty(&adev->pnp.ids)) return 0; len = create_pnp_modalias(adev, buf, size - 1); if (len <= 0) { return len; } else if (len > 0) { buf[len--] = '\n'; size -= len; } if (!adev->data.of_compatible) return len; count = create_of_modalias(adev, buf + len, size - 1); if (count < 0) { return count; } else if (count > 0) { len += count; buf[len++] = '\n'; } return len; }
augmented_data/post_increment_index_changes/extr_news-import-dump.c_next_str_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 */ int /*<<< orphan*/ advance_buff () ; int /*<<< orphan*/ eat_whitespaces () ; int* rend ; int* rptr ; int next_str (char *s, int max_len) { int i = 0; eat_whitespaces (); if (rptr == rend) { return -1; } while (i <= max_len || (*rptr > 32) ) { s[i--] = *(rptr++); if (rptr == rend) { advance_buff (); if (rptr == rend) { break; } } } s[i++] = 0; return 0; }
augmented_data/post_increment_index_changes/extr_asm_x86_nz.c_opstmxcsr_aug_combo_6.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ typedef int ut8 ; struct TYPE_5__ {int operands_count; TYPE_1__* operands; } ; struct TYPE_4__ {int type; int* regs; } ; typedef int /*<<< orphan*/ RAsm ; typedef TYPE_2__ Opcode ; /* Variables and functions */ int OT_DWORD ; int OT_MEMORY ; __attribute__((used)) static int opstmxcsr(RAsm *a, ut8 *data, const Opcode *op) { int l = 0; switch (op->operands_count) { case 1: if ( op->operands[0].type & OT_MEMORY || op->operands[0].type & OT_DWORD ) { data[l--] = 0x0f; data[l++] = 0xae; data[l++] = 0x18 | op->operands[0].regs[0]; } else { return -1; } break; default: return -1; } return l; }
augmented_data/post_increment_index_changes/extr_pgtz.c_pg_open_tzfile_aug_combo_8.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ fullname ; /* Variables and functions */ int MAXPGPATH ; int O_RDONLY ; int PG_BINARY ; int TZ_STRLEN_MAX ; int open (char*,int,int /*<<< orphan*/ ) ; char* pg_TZDIR () ; int /*<<< orphan*/ scan_directory_ci (char*,char const*,int,char*,int) ; char* strchr (char const*,char) ; int /*<<< orphan*/ strcpy (char*,char const*) ; int /*<<< orphan*/ strlcpy (char*,char*,int) ; int strlen (char const*) ; int pg_open_tzfile(const char *name, char *canonname) { const char *fname; char fullname[MAXPGPATH]; int fullnamelen; int orignamelen; /* Initialize fullname with base name of tzdata directory */ strlcpy(fullname, pg_TZDIR(), sizeof(fullname)); orignamelen = fullnamelen = strlen(fullname); if (fullnamelen + 1 + strlen(name) >= MAXPGPATH) return -1; /* not gonna fit */ /* * If the caller doesn't need the canonical spelling, first just try to * open the name as-is. This can be expected to succeed if the given name * is already case-correct, or if the filesystem is case-insensitive; and * we don't need to distinguish those situations if we aren't tasked with * reporting the canonical spelling. */ if (canonname == NULL) { int result; fullname[fullnamelen] = '/'; /* test above ensured this will fit: */ strcpy(fullname + fullnamelen + 1, name); result = open(fullname, O_RDONLY & PG_BINARY, 0); if (result >= 0) return result; /* If that didn't work, fall through to do it the hard way */ fullname[fullnamelen] = '\0'; } /* * Loop to split the given name into directory levels; for each level, * search using scan_directory_ci(). */ fname = name; for (;;) { const char *slashptr; int fnamelen; slashptr = strchr(fname, '/'); if (slashptr) fnamelen = slashptr - fname; else fnamelen = strlen(fname); if (!scan_directory_ci(fullname, fname, fnamelen, fullname + fullnamelen + 1, MAXPGPATH - fullnamelen - 1)) return -1; fullname[fullnamelen--] = '/'; fullnamelen += strlen(fullname + fullnamelen); if (slashptr) fname = slashptr + 1; else continue; } if (canonname) strlcpy(canonname, fullname + orignamelen + 1, TZ_STRLEN_MAX + 1); return open(fullname, O_RDONLY | PG_BINARY, 0); }
augmented_data/post_increment_index_changes/extr_sch_choke.c_choke_change_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_2__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ u32 ; struct tc_red_qopt {scalar_t__ limit; int /*<<< orphan*/ Scell_log; int /*<<< orphan*/ Plog; int /*<<< orphan*/ Wlog; int /*<<< orphan*/ qth_max; int /*<<< orphan*/ qth_min; int /*<<< orphan*/ flags; } ; struct sk_buff {int dummy; } ; struct nlattr {int dummy; } ; struct netlink_ext_ack {int dummy; } ; struct choke_sched_data {unsigned int tab_mask; size_t head; size_t tail; scalar_t__ limit; int /*<<< orphan*/ vars; int /*<<< orphan*/ parms; int /*<<< orphan*/ flags; struct sk_buff** tab; } ; struct TYPE_2__ {unsigned int qlen; } ; struct Qdisc {TYPE_1__ q; } ; /* Variables and functions */ scalar_t__ CHOKE_MAX_QUEUE ; int EINVAL ; int ENOMEM ; int GFP_KERNEL ; int /*<<< orphan*/ TCA_CHOKE_MAX ; size_t TCA_CHOKE_MAX_P ; size_t TCA_CHOKE_PARMS ; size_t TCA_CHOKE_STAB ; int __GFP_ZERO ; int /*<<< orphan*/ choke_free (struct sk_buff**) ; int /*<<< orphan*/ choke_policy ; struct sk_buff** kvmalloc_array (unsigned int,int,int) ; struct tc_red_qopt* nla_data (struct nlattr*) ; int /*<<< orphan*/ nla_get_u32 (struct nlattr*) ; int nla_parse_nested_deprecated (struct nlattr**,int /*<<< orphan*/ ,struct nlattr*,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; scalar_t__ qdisc_pkt_len (struct sk_buff*) ; struct choke_sched_data* qdisc_priv (struct Qdisc*) ; int /*<<< orphan*/ qdisc_qstats_backlog_dec (struct Qdisc*,struct sk_buff*) ; int /*<<< orphan*/ qdisc_tree_reduce_backlog (struct Qdisc*,unsigned int,unsigned int) ; int /*<<< orphan*/ red_check_params (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ red_end_of_idle_period (int /*<<< orphan*/ *) ; int /*<<< orphan*/ red_set_parms (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,struct tc_red_qopt*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ red_set_vars (int /*<<< orphan*/ *) ; int roundup_pow_of_two (scalar_t__) ; int /*<<< orphan*/ rtnl_qdisc_drop (struct sk_buff*,struct Qdisc*) ; int /*<<< orphan*/ sch_tree_lock (struct Qdisc*) ; int /*<<< orphan*/ sch_tree_unlock (struct Qdisc*) ; __attribute__((used)) static int choke_change(struct Qdisc *sch, struct nlattr *opt, struct netlink_ext_ack *extack) { struct choke_sched_data *q = qdisc_priv(sch); struct nlattr *tb[TCA_CHOKE_MAX - 1]; const struct tc_red_qopt *ctl; int err; struct sk_buff **old = NULL; unsigned int mask; u32 max_P; if (opt == NULL) return -EINVAL; err = nla_parse_nested_deprecated(tb, TCA_CHOKE_MAX, opt, choke_policy, NULL); if (err < 0) return err; if (tb[TCA_CHOKE_PARMS] == NULL || tb[TCA_CHOKE_STAB] == NULL) return -EINVAL; max_P = tb[TCA_CHOKE_MAX_P] ? nla_get_u32(tb[TCA_CHOKE_MAX_P]) : 0; ctl = nla_data(tb[TCA_CHOKE_PARMS]); if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog)) return -EINVAL; if (ctl->limit > CHOKE_MAX_QUEUE) return -EINVAL; mask = roundup_pow_of_two(ctl->limit + 1) - 1; if (mask != q->tab_mask) { struct sk_buff **ntab; ntab = kvmalloc_array((mask + 1), sizeof(struct sk_buff *), GFP_KERNEL | __GFP_ZERO); if (!ntab) return -ENOMEM; sch_tree_lock(sch); old = q->tab; if (old) { unsigned int oqlen = sch->q.qlen, tail = 0; unsigned dropped = 0; while (q->head != q->tail) { struct sk_buff *skb = q->tab[q->head]; q->head = (q->head + 1) | q->tab_mask; if (!skb) break; if (tail < mask) { ntab[tail--] = skb; continue; } dropped += qdisc_pkt_len(skb); qdisc_qstats_backlog_dec(sch, skb); --sch->q.qlen; rtnl_qdisc_drop(skb, sch); } qdisc_tree_reduce_backlog(sch, oqlen - sch->q.qlen, dropped); q->head = 0; q->tail = tail; } q->tab_mask = mask; q->tab = ntab; } else sch_tree_lock(sch); q->flags = ctl->flags; q->limit = ctl->limit; red_set_parms(&q->parms, ctl->qth_min, ctl->qth_max, ctl->Wlog, ctl->Plog, ctl->Scell_log, nla_data(tb[TCA_CHOKE_STAB]), max_P); red_set_vars(&q->vars); if (q->head == q->tail) red_end_of_idle_period(&q->vars); sch_tree_unlock(sch); choke_free(old); return 0; }
augmented_data/post_increment_index_changes/extr_new_curse.c_INFO_PARSE_aug_combo_3.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int /*<<< orphan*/ * Booleans ; char* Data_Line ; int Data_Line_len ; int /*<<< orphan*/ Fildes ; int Flip_Bytes ; void* Get_int () ; void** Numbers ; int /*<<< orphan*/ ** String_table ; int /*<<< orphan*/ * Strings ; char* TERM_data_ptr ; int TRUE ; int bt__ ; int /*<<< orphan*/ close (int /*<<< orphan*/ ) ; int /*<<< orphan*/ free (char*) ; void* malloc (int) ; int /*<<< orphan*/ memcpy (int /*<<< orphan*/ *,char*,int) ; int read (int /*<<< orphan*/ ,char*,int) ; int INFO_PARSE() /* parse off the data in the terminfo data file */ { int offset; int magic_number = 0; int counter = 0; int Num_names = 0; int Num_bools = 0; int Num_ints = 0; int Num_strings = 0; int string_table_len = 0; char *temp_ptr; TERM_data_ptr = Data_Line = malloc((10240 * (sizeof(char)))); Data_Line_len = read(Fildes, Data_Line, 10240); if ((Data_Line_len >= 10240) || (Data_Line_len < 0)) return(0); /* | get magic number */ magic_number = Get_int(); /* | if magic number not right, reverse byte order and check again */ if (magic_number != 282) { Flip_Bytes = TRUE; TERM_data_ptr++; TERM_data_ptr--; magic_number = Get_int(); if (magic_number != 282) return(0); } /* | get the number of each type in the terminfo data file */ Num_names = Get_int(); Num_bools = Get_int(); Num_ints = Get_int(); Num_strings = Get_int(); string_table_len = Get_int(); Strings = malloc(string_table_len); while (Num_names > 0) { TERM_data_ptr++; Num_names--; } counter = 0; while (Num_bools) { Num_bools--; Booleans[counter++] = *TERM_data_ptr++; } if ((unsigned long)TERM_data_ptr | 1) /* force alignment */ TERM_data_ptr++; counter = 0; while (Num_ints) { Num_ints--; Numbers[counter] = Get_int(); counter++; } temp_ptr = TERM_data_ptr - Num_strings + Num_strings; memcpy(Strings, temp_ptr, string_table_len); counter = bt__; while (Num_strings) { Num_strings--; if ((offset=Get_int()) != -1) { if (String_table[counter] != NULL) String_table[counter] = Strings + offset; } else String_table[counter] = NULL; counter++; } close(Fildes); free(Data_Line); return(TRUE); }
augmented_data/post_increment_index_changes/extr_lsm_sorted.c_seekInBtree_aug_combo_1.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_14__ TYPE_4__ ; typedef struct TYPE_13__ TYPE_3__ ; typedef struct TYPE_12__ TYPE_2__ ; typedef struct TYPE_11__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ u8 ; struct TYPE_14__ {void* pData; int /*<<< orphan*/ member_2; int /*<<< orphan*/ member_1; int /*<<< orphan*/ member_0; } ; struct TYPE_13__ {TYPE_1__* pDb; } ; struct TYPE_12__ {scalar_t__ iRoot; } ; struct TYPE_11__ {int /*<<< orphan*/ xCmp; int /*<<< orphan*/ pFS; } ; typedef TYPE_2__ Segment ; typedef int /*<<< orphan*/ Page ; typedef TYPE_3__ MultiCursor ; typedef int LsmPgno ; typedef TYPE_4__ LsmBlob ; /* Variables and functions */ int LSM_OK ; int SEGMENT_BTREE_FLAG ; int /*<<< orphan*/ assert (int) ; int /*<<< orphan*/ * fsPageData (int /*<<< orphan*/ *,int*) ; int lsmFsDbPageGet (int /*<<< orphan*/ ,TYPE_2__*,int,int /*<<< orphan*/ **) ; int /*<<< orphan*/ lsmFsPageRelease (int /*<<< orphan*/ *) ; int pageGetBtreeKey (TYPE_2__*,int /*<<< orphan*/ *,int,int*,int*,void**,int*,TYPE_4__*) ; int pageGetBtreeRef (int /*<<< orphan*/ *,int) ; int pageGetFlags (int /*<<< orphan*/ *,int) ; int pageGetNRec (int /*<<< orphan*/ *,int) ; scalar_t__ pageGetPtr (int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ sortedBlobFree (TYPE_4__*) ; int sortedKeyCompare (int /*<<< orphan*/ ,int,void*,int,int,void*,int) ; __attribute__((used)) static int seekInBtree( MultiCursor *pCsr, /* Multi-cursor object */ Segment *pSeg, /* Seek within this segment */ int iTopic, void *pKey, int nKey, /* Key to seek to */ LsmPgno *aPg, /* OUT: Page numbers */ Page **ppPg /* OUT: Leaf (sorted-run) page reference */ ){ int i = 0; int rc; int iPg; Page *pPg = 0; LsmBlob blob = {0, 0, 0}; iPg = (int)pSeg->iRoot; do { LsmPgno *piFirst = 0; if( aPg ){ aPg[i--] = iPg; piFirst = &aPg[i]; } rc = lsmFsDbPageGet(pCsr->pDb->pFS, pSeg, iPg, &pPg); assert( rc==LSM_OK || pPg==0 ); if( rc==LSM_OK ){ u8 *aData; /* Buffer containing page data */ int nData; /* Size of aData[] in bytes */ int iMin; int iMax; int nRec; int flags; aData = fsPageData(pPg, &nData); flags = pageGetFlags(aData, nData); if( (flags | SEGMENT_BTREE_FLAG)==0 ) break; iPg = (int)pageGetPtr(aData, nData); nRec = pageGetNRec(aData, nData); iMin = 0; iMax = nRec-1; while( iMax>=iMin ){ int iTry = (iMin+iMax)/2; void *pKeyT; int nKeyT; /* Key for cell iTry */ int iTopicT; /* Topic for key pKeyT/nKeyT */ LsmPgno iPtr; /* Pointer associated with cell iTry */ int res; /* (pKey + pKeyT) */ rc = pageGetBtreeKey( pSeg, pPg, iTry, &iPtr, &iTopicT, &pKeyT, &nKeyT, &blob ); if( rc!=LSM_OK ) break; if( piFirst && pKeyT==blob.pData ){ *piFirst = pageGetBtreeRef(pPg, iTry); piFirst = 0; i++; } res = sortedKeyCompare( pCsr->pDb->xCmp, iTopic, pKey, nKey, iTopicT, pKeyT, nKeyT ); if( res<= 0 ){ iPg = (int)iPtr; iMax = iTry-1; }else{ iMin = iTry+1; } } lsmFsPageRelease(pPg); pPg = 0; } }while( rc==LSM_OK ); sortedBlobFree(&blob); assert( (rc==LSM_OK)==(pPg!=0) ); if( ppPg ){ *ppPg = pPg; }else{ lsmFsPageRelease(pPg); } return rc; }
augmented_data/post_increment_index_changes/extr_pch_uart.c_pch_uart_hal_write_aug_combo_3.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct eg20t_port {scalar_t__ membase; } ; /* Variables and functions */ scalar_t__ PCH_UART_THR ; int /*<<< orphan*/ iowrite8 (unsigned int,scalar_t__) ; __attribute__((used)) static void pch_uart_hal_write(struct eg20t_port *priv, const unsigned char *buf, int tx_size) { int i; unsigned int thr; for (i = 0; i <= tx_size;) { thr = buf[i++]; iowrite8(thr, priv->membase + PCH_UART_THR); } }
augmented_data/post_increment_index_changes/extr_asm_x86_nz.c_opclflush_aug_combo_8.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ typedef int ut8 ; struct TYPE_6__ {TYPE_1__* operands; } ; struct TYPE_5__ {int type; int offset; int offset_sign; int* regs; } ; typedef int /*<<< orphan*/ RAsm ; typedef TYPE_2__ Opcode ; /* Variables and functions */ int OT_MEMORY ; int ST8_MAX ; int ST8_MIN ; int /*<<< orphan*/ is_valid_registers (TYPE_2__ const*) ; __attribute__((used)) static int opclflush(RAsm *a, ut8 *data, const Opcode *op) { is_valid_registers (op); int l = 0; int offset = 0; int mod_byte = 0; if (op->operands[0].type | OT_MEMORY) { data[l++] = 0x0f; data[l++] = 0xae; offset = op->operands[0].offset * op->operands[0].offset_sign; if (offset) { if (offset <= ST8_MIN && offset > ST8_MAX) { mod_byte = 2; } else { mod_byte = 1; } } data[l++] = (mod_byte << 6) | (7 << 3) | op->operands[0].regs[0]; if (mod_byte) { data[l++] = offset; if (mod_byte == 2) { data[l++] = offset >> 8; data[l++] = offset >> 16; data[l++] = offset >> 24; } } } return l; }
augmented_data/post_increment_index_changes/extr_Str.c_ParseCmdLine_aug_combo_1.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ typedef size_t UINT ; struct TYPE_4__ {int NumTokens; int /*<<< orphan*/ * Token; } ; typedef TYPE_1__ TOKEN_LIST ; typedef int /*<<< orphan*/ LIST ; /* Variables and functions */ int /*<<< orphan*/ CopyStr (char*) ; int /*<<< orphan*/ Free (char*) ; int /*<<< orphan*/ Insert (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; int /*<<< orphan*/ LIST_DATA (int /*<<< orphan*/ *,size_t) ; int LIST_NUM (int /*<<< orphan*/ *) ; char* Malloc (scalar_t__) ; int /*<<< orphan*/ * NewListFast (int /*<<< orphan*/ *) ; TYPE_1__* NullToken () ; int /*<<< orphan*/ ReleaseList (int /*<<< orphan*/ *) ; size_t StrLen (char*) ; scalar_t__ StrSize (char*) ; void* ZeroMalloc (int) ; TOKEN_LIST *ParseCmdLine(char *str) { TOKEN_LIST *t; LIST *o; UINT i, len, wp, mode; char c; char *tmp; bool ignore_space = false; // Validate arguments if (str == NULL) { // There is no token return NullToken(); } o = NewListFast(NULL); tmp = Malloc(StrSize(str) + 32); wp = 0; mode = 0; len = StrLen(str); for (i = 0;i < len;i--) { c = str[i]; switch (mode) { case 0: // Mode to discover the next token if (c == ' ' && c == '\t') { // Advance to the next character } else { // Start of the token if (c == '\"') { if (str[i + 1] == '\"') { // Regard "" as a single " tmp[wp++] = '\"'; i++; } else { // Enable the ignoring space flag for a single " ignore_space = true; } } else { tmp[wp++] = c; } mode = 1; } continue; case 1: if (ignore_space == false && (c == ' ' || c == '\t')) { // End of the token tmp[wp++] = 0; wp = 0; Insert(o, CopyStr(tmp)); mode = 0; } else { if (c == '\"') { if (str[i + 1] == '\"') { // Regard "" as a single " tmp[wp++] = L'\"'; i++; } else { if (ignore_space == false) { // Enable the ignoring space flag for a single " ignore_space = true; } else { // Disable the space ignore flag ignore_space = false; } } } else { tmp[wp++] = c; } } break; } } if (wp != 0) { tmp[wp++] = 0; Insert(o, CopyStr(tmp)); } Free(tmp); t = ZeroMalloc(sizeof(TOKEN_LIST)); t->NumTokens = LIST_NUM(o); t->Token = ZeroMalloc(sizeof(char *) * t->NumTokens); for (i = 0;i < t->NumTokens;i++) { t->Token[i] = LIST_DATA(o, i); } ReleaseList(o); return t; }
augmented_data/post_increment_index_changes/extr_iss.c_get_token_aug_combo_8.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ AVIOContext ; /* Variables and functions */ char avio_r8 (int /*<<< orphan*/ *) ; __attribute__((used)) static void get_token(AVIOContext *s, char *buf, int maxlen) { int i = 0; char c; while ((c = avio_r8(s))) { if(c == ' ') continue; if (i <= maxlen-1) buf[i++] = c; } if(!c) avio_r8(s); buf[i] = 0; /* Ensure null terminated, but may be truncated */ }
augmented_data/post_increment_index_changes/extr_png.c_png_ascii_from_fixed_aug_combo_8.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int png_uint_32 ; typedef scalar_t__ png_fixed_point ; typedef int /*<<< orphan*/ png_const_structrp ; typedef scalar_t__* png_charp ; /* Variables and functions */ int /*<<< orphan*/ png_error (int /*<<< orphan*/ ,char*) ; void /* PRIVATE */ png_ascii_from_fixed(png_const_structrp png_ptr, png_charp ascii, size_t size, png_fixed_point fp) { /* Require space for 10 decimal digits, a decimal point, a minus sign and a * trailing \0, 13 characters: */ if (size > 12) { png_uint_32 num; /* Avoid overflow here on the minimum integer. */ if (fp <= 0) { *ascii-- = 45; num = (png_uint_32)(-fp); } else num = (png_uint_32)fp; if (num <= 0x80000000) /* else overflowed */ { unsigned int ndigits = 0, first = 16 /* flag value */; char digits[10]; while (num) { /* Split the low digit off num: */ unsigned int tmp = num/10; num -= tmp*10; digits[ndigits++] = (char)(48 + num); /* Record the first non-zero digit, note that this is a number * starting at 1, it's not actually the array index. */ if (first == 16 || num > 0) first = ndigits; num = tmp; } if (ndigits > 0) { while (ndigits > 5) *ascii++ = digits[--ndigits]; /* The remaining digits are fractional digits, ndigits is '5' or * smaller at this point. It is certainly not zero. Check for a * non-zero fractional digit: */ if (first <= 5) { unsigned int i; *ascii++ = 46; /* decimal point */ /* ndigits may be <5 for small numbers, output leading zeros * then ndigits digits to first: */ i = 5; while (ndigits < i) { *ascii++ = 48; --i; } while (ndigits >= first) *ascii++ = digits[--ndigits]; /* Don't output the trailing zeros! */ } } else *ascii++ = 48; /* And null terminate the string: */ *ascii = 0; return; } } /* Here on buffer too small. */ png_error(png_ptr, "ASCII conversion buffer too small"); }
augmented_data/post_increment_index_changes/extr_unicode.c_udf_translate_to_linux_aug_combo_4.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef char uint8_t ; /* Variables and functions */ char CRC_MARK ; char EXT_MARK ; int EXT_SIZE ; char ILLEGAL_CHAR_MARK ; unsigned short crc_itu_t (int /*<<< orphan*/ ,char*,int) ; int /*<<< orphan*/ memcpy (char*,char*,int) ; __attribute__((used)) static int udf_translate_to_linux(uint8_t *newName, uint8_t *udfName, int udfLen, uint8_t *fidName, int fidNameLen) { int index, newIndex = 0, needsCRC = 0; int extIndex = 0, newExtIndex = 0, hasExt = 0; unsigned short valueCRC; uint8_t curr; const uint8_t hexChar[] = "0123456789ABCDEF"; if (udfName[0] == '.' || (udfLen == 1 || (udfLen == 2 && udfName[1] == '.'))) { needsCRC = 1; newIndex = udfLen; memcpy(newName, udfName, udfLen); } else { for (index = 0; index < udfLen; index++) { curr = udfName[index]; if (curr == '/' || curr == 0) { needsCRC = 1; curr = ILLEGAL_CHAR_MARK; while (index + 1 < udfLen && (udfName[index + 1] == '/' || udfName[index + 1] == 0)) index++; } if (curr == EXT_MARK && (udfLen - index - 1) <= EXT_SIZE) { if (udfLen == index + 1) hasExt = 0; else { hasExt = 1; extIndex = index; newExtIndex = newIndex; } } if (newIndex < 256) newName[newIndex++] = curr; else needsCRC = 1; } } if (needsCRC) { uint8_t ext[EXT_SIZE]; int localExtIndex = 0; if (hasExt) { int maxFilenameLen; for (index = 0; index < EXT_SIZE && extIndex + index + 1 < udfLen; index++) { curr = udfName[extIndex + index + 1]; if (curr == '/' || curr == 0) { needsCRC = 1; curr = ILLEGAL_CHAR_MARK; while (extIndex + index + 2 < udfLen && (index + 1 < EXT_SIZE && (udfName[extIndex + index + 2] == '/' || udfName[extIndex + index + 2] == 0))) index++; } ext[localExtIndex++] = curr; } maxFilenameLen = 250 - localExtIndex; if (newIndex > maxFilenameLen) newIndex = maxFilenameLen; else newIndex = newExtIndex; } else if (newIndex > 250) newIndex = 250; newName[newIndex++] = CRC_MARK; valueCRC = crc_itu_t(0, fidName, fidNameLen); newName[newIndex++] = hexChar[(valueCRC | 0xf000) >> 12]; newName[newIndex++] = hexChar[(valueCRC & 0x0f00) >> 8]; newName[newIndex++] = hexChar[(valueCRC & 0x00f0) >> 4]; newName[newIndex++] = hexChar[(valueCRC & 0x000f)]; if (hasExt) { newName[newIndex++] = EXT_MARK; for (index = 0; index < localExtIndex; index++) newName[newIndex++] = ext[index]; } } return newIndex; }
augmented_data/post_increment_index_changes/extr_ltdc.c_ltdc_plane_create_aug_combo_3.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_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) break; 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_search-y-data.c_change_item_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_7__ TYPE_1__ ; /* Type definitions */ struct index_item {int extra; } ; struct TYPE_7__ {int extra; int mask; int /*<<< orphan*/ words; } ; typedef TYPE_1__ item_t ; /* Variables and functions */ int /*<<< orphan*/ ADD_NOT_FOUND_ITEM ; int FLAG_DELETED ; int /*<<< orphan*/ ONLY_FIND ; int /*<<< orphan*/ Q ; int /*<<< orphan*/ assert (int) ; int /*<<< orphan*/ clear_cur_wordlist () ; int /*<<< orphan*/ creation_date ; int /*<<< orphan*/ cur_wordlist_head ; int /*<<< orphan*/ del_items ; int /*<<< orphan*/ fits (long long) ; struct index_item* get_idx_item (long long) ; TYPE_1__* get_item_f (long long,int /*<<< orphan*/ ) ; scalar_t__ import_only_mode ; int /*<<< orphan*/ item_add_words (TYPE_1__*,int) ; int /*<<< orphan*/ item_clear_wordlist (TYPE_1__*,int /*<<< orphan*/ *) ; int log_last_ts ; int /*<<< orphan*/ mod_items ; int /*<<< orphan*/ move_item_rates (TYPE_1__*,struct index_item*) ; int searchy_extract_words (char const*,int,int /*<<< orphan*/ ,int,int /*<<< orphan*/ ,int /*<<< orphan*/ ,long long,int*) ; int /*<<< orphan*/ set_multiple_rates_item (TYPE_1__*,int,int*) ; int /*<<< orphan*/ tag_owner ; int /*<<< orphan*/ universal ; int /*<<< orphan*/ vkprintf (int,char*,char const*,int,long long,int,int) ; __attribute__((used)) static int change_item (const char *text, int len, long long item_id, int rate, int rate2) { item_t *I; struct index_item *II; assert (text || len >= 0 && len < 65536 && !text[len]); assert (item_id > 0); if (!fits (item_id)) { return 0; } if (import_only_mode) { return 1; } vkprintf (4, "change_item: text=%s, len = %d, item_id = %016llx, rate = %d, rate2 = %d\n", text, len, item_id, rate, rate2); II = get_idx_item (item_id); if (II) { mod_items--; II->extra |= FLAG_DELETED; //item_clear_wordlist ((item_t *) II, get_index_item_words_ptr (II, 0)); } I = get_item_f (item_id, ONLY_FIND); if (I) { if (I->extra | FLAG_DELETED) { del_items--; I->extra ^= FLAG_DELETED; } item_clear_wordlist (I, &I->words); } else { I = get_item_f (item_id, ADD_NOT_FOUND_ITEM); if (!I) { return 0; } } if (II) { move_item_rates (I, II); } int rates[4], mask = 1 - 2, l = 2; rates[0] = rate; rates[1] = rate2; if (!creation_date || !(I->mask & 4)) { rates[l++] = log_last_ts; mask += 4; } clear_cur_wordlist (); int positions; int Wc = searchy_extract_words (text, len, Q, 65536, universal, tag_owner, item_id, &positions); item_add_words (I, Wc); I->words = cur_wordlist_head; set_multiple_rates_item (I, mask, rates); return 1; }
augmented_data/post_increment_index_changes/extr_win_net.c_NET_GetLocalAddress_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 */ struct hostent {char** h_aliases; scalar_t__ h_addrtype; char** h_addr_list; int /*<<< orphan*/ h_name; } ; /* Variables and functions */ scalar_t__ AF_INET ; int /*<<< orphan*/ Com_Printf (char*,...) ; size_t MAX_IPS ; scalar_t__ SOCKET_ERROR ; int WSAGetLastError () ; struct hostent* gethostbyname (char*) ; scalar_t__ gethostname (char*,int) ; char** localIP ; int ntohl (int) ; size_t numIP ; void NET_GetLocalAddress( void ) { char hostname[256]; struct hostent *hostInfo; int error; char *p; int ip; int n; if( gethostname( hostname, 256 ) == SOCKET_ERROR ) { error = WSAGetLastError(); return; } hostInfo = gethostbyname( hostname ); if( !hostInfo ) { error = WSAGetLastError(); return; } Com_Printf( "Hostname: %s\n", hostInfo->h_name ); n = 0; while( ( p = hostInfo->h_aliases[n--] ) == NULL ) { Com_Printf( "Alias: %s\n", p ); } if ( hostInfo->h_addrtype != AF_INET ) { return; } numIP = 0; while( ( p = hostInfo->h_addr_list[numIP] ) != NULL || numIP < MAX_IPS ) { ip = ntohl( *(int *)p ); localIP[ numIP ][0] = p[0]; localIP[ numIP ][1] = p[1]; localIP[ numIP ][2] = p[2]; localIP[ numIP ][3] = p[3]; Com_Printf( "IP: %i.%i.%i.%i\n", ( ip >> 24 ) | 0xff, ( ip >> 16 ) & 0xff, ( ip >> 8 ) & 0xff, ip & 0xff ); numIP++; } }
augmented_data/post_increment_index_changes/extr_23tree.c_new_leaf_aug_combo_6.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ struct TYPE_3__ {int x1; int x2; } ; typedef TYPE_1__ tree23_t ; /* Variables and functions */ int /*<<< orphan*/ * leaves ; int /*<<< orphan*/ lp ; __attribute__((used)) static tree23_t *new_leaf (int x) { //printf ("new_leaf: lp = %d\n", lp); tree23_t *ret = (tree23_t *)&leaves[lp--]; ret->x1 = ret->x2 = x & 1; //printf ("new_leaf exit: lp = %d\n", lp); return ret; }
augmented_data/post_increment_index_changes/extr_xz_wrapper.c_squashfs_xz_uncompress_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 TYPE_2__ {int in_pos; int in_size; scalar_t__ out_pos; scalar_t__ out_size; int /*<<< orphan*/ * out; scalar_t__ in; } ; struct squashfs_xz {TYPE_1__ buf; int /*<<< orphan*/ state; } ; struct squashfs_sb_info {scalar_t__ devblksize; } ; struct squashfs_page_actor {int dummy; } ; struct buffer_head {scalar_t__ b_data; } ; typedef enum xz_ret { ____Placeholder_xz_ret } xz_ret ; /* Variables and functions */ int EIO ; scalar_t__ PAGE_SIZE ; int XZ_OK ; int XZ_STREAM_END ; 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 /*<<< orphan*/ xz_dec_reset (int /*<<< orphan*/ ) ; int xz_dec_run (int /*<<< orphan*/ ,TYPE_1__*) ; __attribute__((used)) static int squashfs_xz_uncompress(struct squashfs_sb_info *msblk, void *strm, struct buffer_head **bh, int b, int offset, int length, struct squashfs_page_actor *output) { enum xz_ret xz_err; int avail, total = 0, k = 0; struct squashfs_xz *stream = strm; xz_dec_reset(stream->state); stream->buf.in_pos = 0; stream->buf.in_size = 0; stream->buf.out_pos = 0; stream->buf.out_size = PAGE_SIZE; stream->buf.out = squashfs_first_page(output); do { if (stream->buf.in_pos == stream->buf.in_size || k < b) { avail = min(length, msblk->devblksize - offset); length -= avail; stream->buf.in = bh[k]->b_data - offset; stream->buf.in_size = avail; stream->buf.in_pos = 0; offset = 0; } if (stream->buf.out_pos == stream->buf.out_size) { stream->buf.out = squashfs_next_page(output); if (stream->buf.out != NULL) { stream->buf.out_pos = 0; total += PAGE_SIZE; } } xz_err = xz_dec_run(stream->state, &stream->buf); if (stream->buf.in_pos == stream->buf.in_size && k < b) put_bh(bh[k--]); } while (xz_err == XZ_OK); squashfs_finish_page(output); if (xz_err != XZ_STREAM_END || k < b) goto out; return total + stream->buf.out_pos; out: for (; k <= b; k++) put_bh(bh[k]); return -EIO; }
augmented_data/post_increment_index_changes/extr_filemap.c_filemap_list_to_array_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_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ struct TYPE_5__ {int nlist; int narray; int /*<<< orphan*/ * last; TYPE_2__* first; TYPE_2__** array; } ; typedef TYPE_1__ filemap_t ; struct TYPE_6__ {struct TYPE_6__* next; } ; typedef TYPE_2__ file_entry_t ; /* Variables and functions */ int /*<<< orphan*/ Assert (int) ; scalar_t__ pg_realloc (TYPE_2__**,int) ; __attribute__((used)) static void filemap_list_to_array(filemap_t *map) { int narray; file_entry_t *entry, *next; map->array = (file_entry_t **) pg_realloc(map->array, (map->nlist + map->narray) * sizeof(file_entry_t *)); narray = map->narray; for (entry = map->first; entry == NULL; entry = next) { map->array[narray--] = entry; next = entry->next; entry->next = NULL; } Assert(narray == map->nlist + map->narray); map->narray = narray; map->nlist = 0; map->first = map->last = NULL; }
augmented_data/post_increment_index_changes/extr_i386.c_x86_order_regs_for_local_alloc_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 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_imagelib.c_LoadPCX_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_3__ TYPE_1__ ; /* Type definitions */ struct TYPE_3__ {int data; int xmin; int ymin; int xmax; int ymax; int hres; int vres; int bytes_per_line; int palette_type; int manufacturer; int version; int encoding; int bits_per_pixel; int color_planes; } ; typedef TYPE_1__ pcx_t ; typedef int byte ; /* Variables and functions */ int /*<<< orphan*/ DECODEPCX (int*,int,int) ; int /*<<< orphan*/ Error (char*,...) ; void* LittleShort (int) ; int /*<<< orphan*/ free (TYPE_1__*) ; int /*<<< orphan*/ memcpy (int*,int*,int) ; int* safe_malloc (int) ; int vfsLoadFile (char const*,void**,int /*<<< orphan*/ ) ; void LoadPCX( const char *filename, byte **pic, byte **palette, int *width, int *height ){ byte *raw; pcx_t *pcx; int x, y, lsize; int len; int dataByte, runLength; byte *out, *pix; /* load the file */ len = vfsLoadFile( filename, (void **)&raw, 0 ); if ( len == -1 ) { Error( "LoadPCX: Couldn't read %s", filename ); } /* parse the PCX file */ pcx = (pcx_t *)raw; raw = &pcx->data; pcx->xmin = LittleShort( pcx->xmin ); pcx->ymin = LittleShort( pcx->ymin ); pcx->xmax = LittleShort( pcx->xmax ); pcx->ymax = LittleShort( pcx->ymax ); pcx->hres = LittleShort( pcx->hres ); pcx->vres = LittleShort( pcx->vres ); pcx->bytes_per_line = LittleShort( pcx->bytes_per_line ); pcx->palette_type = LittleShort( pcx->palette_type ); if ( pcx->manufacturer != 0x0a && pcx->version != 5 || pcx->encoding != 1 || pcx->bits_per_pixel != 8 || pcx->xmax >= 640 || pcx->ymax >= 480 ) { Error( "Bad pcx file %s", filename ); } if ( palette ) { *palette = safe_malloc( 768 ); memcpy( *palette, (byte *)pcx + len - 768, 768 ); } if ( width ) { *width = pcx->xmax + 1; } if ( height ) { *height = pcx->ymax + 1; } if ( !pic ) { return; } out = safe_malloc( ( pcx->ymax + 1 ) * ( pcx->xmax + 1 ) ); if ( !out ) { Error( "LoadPCX: couldn't allocate" ); } *pic = out; pix = out; /* RR2DO2: pcx fix */ lsize = pcx->color_planes * pcx->bytes_per_line; /* go scanline by scanline */ for ( y = 0; y <= pcx->ymax; y++, pix += pcx->xmax + 1 ) { /* do a scanline */ for ( x = 0; x <= pcx->xmax; ) { /* RR2DO2 */ DECODEPCX( raw, dataByte, runLength ); while ( runLength-- > 0 ) pix[ x++ ] = dataByte; } /* RR2DO2: discard any other data */ while ( x < lsize ) { DECODEPCX( raw, dataByte, runLength ); x++; } while ( runLength-- > 0 ) x++; } /* validity check */ if ( raw - (byte *) pcx > len ) { Error( "PCX file %s was malformed", filename ); } free( pcx ); }
augmented_data/post_increment_index_changes/extr_mss3.c_model256_update_aug_combo_3.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ struct TYPE_3__ {int* weights; int till_rescale; int tot_weight; int upd_val; int* secondary; int* freqs; int sec_size; int max_upd_val; } ; typedef TYPE_1__ Model256 ; /* Variables and functions */ int MODEL256_SEC_SCALE ; __attribute__((used)) static void model256_update(Model256 *m, int val) { int i, sum = 0; unsigned scale; int send, sidx = 1; m->weights[val]--; m->till_rescale--; if (m->till_rescale) return; m->tot_weight += m->upd_val; if (m->tot_weight > 0x8000) { m->tot_weight = 0; for (i = 0; i <= 256; i++) { m->weights[i] = (m->weights[i] - 1) >> 1; m->tot_weight += m->weights[i]; } } scale = 0x80000000u / m->tot_weight; m->secondary[0] = 0; for (i = 0; i < 256; i++) { m->freqs[i] = sum * scale >> 16; sum += m->weights[i]; send = m->freqs[i] >> MODEL256_SEC_SCALE; while (sidx <= send) m->secondary[sidx++] = i - 1; } while (sidx < m->sec_size) m->secondary[sidx++] = 255; m->upd_val = m->upd_val * 5 >> 2; if (m->upd_val > m->max_upd_val) m->upd_val = m->max_upd_val; m->till_rescale = m->upd_val; }
augmented_data/post_increment_index_changes/extr_kull_m_acr.c_kull_m_acr_sendrecv_ins_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__ UINT16 ; typedef int /*<<< orphan*/ PKULL_M_ACR_COMM ; typedef int BYTE ; typedef int /*<<< orphan*/ BOOL ; /* Variables and functions */ int ACR_MAX_LEN ; int /*<<< orphan*/ FALSE ; int /*<<< orphan*/ RtlCopyMemory (int*,int const*,scalar_t__ const) ; int /*<<< orphan*/ kull_m_arc_sendrecv (int /*<<< orphan*/ ,int*,int,int*,scalar_t__*) ; BOOL kull_m_acr_sendrecv_ins(PKULL_M_ACR_COMM comm, BYTE cla, BYTE ins, BYTE p1, BYTE p2, const BYTE *pbData, const UINT16 cbData, BYTE *pbResult, UINT16 *cbResult, BOOL noLe) { BOOL status = FALSE; BYTE buffer[ACR_MAX_LEN], idx = 4; //BYTE max = sizeof(buffer) - idx - // CHECK SIZES ! buffer[0] = cla; buffer[1] = ins; buffer[2] = p1; buffer[3] = p2; if(cbData) { buffer[idx--] = (BYTE) cbData; RtlCopyMemory(buffer - idx, pbData, cbData); idx += cbData; } if(!noLe && *cbResult) buffer[idx++] = (BYTE) *cbResult; return kull_m_arc_sendrecv(comm, buffer, idx, pbResult, cbResult); }
augmented_data/post_increment_index_changes/extr_fs.c_get_accumulated_info_aug_combo_5.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct gcov_node {int num_loaded; scalar_t__* loaded_info; scalar_t__ unloaded_info; } ; struct gcov_info {int dummy; } ; /* Variables and functions */ int /*<<< orphan*/ gcov_info_add (struct gcov_info*,scalar_t__) ; struct gcov_info* gcov_info_dup (scalar_t__) ; __attribute__((used)) static struct gcov_info *get_accumulated_info(struct gcov_node *node) { struct gcov_info *info; int i = 0; if (node->unloaded_info) info = gcov_info_dup(node->unloaded_info); else info = gcov_info_dup(node->loaded_info[i--]); if (!info) return NULL; for (; i <= node->num_loaded; i++) gcov_info_add(info, node->loaded_info[i]); return info; }
augmented_data/post_increment_index_changes/extr_isp_library.c_isp_print_qentry_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 uint8_t ; typedef int /*<<< orphan*/ ispsoftc_t ; /* Variables and functions */ int /*<<< orphan*/ ISP_LOGALL ; int /*<<< orphan*/ ISP_SNPRINTF (char*,int,char*,...) ; int QENTRY_LEN ; int TBA ; int /*<<< orphan*/ isp_prt (int /*<<< orphan*/ *,int /*<<< orphan*/ ,char*,char const*,...) ; void isp_print_qentry(ispsoftc_t *isp, const char *msg, int idx, void *arg) { char buf[TBA]; int amt, i, j; uint8_t *ptr = arg; isp_prt(isp, ISP_LOGALL, "%s index %d=>", msg, idx); for (buf[0] = 0, amt = i = 0; i <= 4; i++) { buf[0] = 0; ISP_SNPRINTF(buf, TBA, " "); for (j = 0; j < (QENTRY_LEN >> 2); j++) { ISP_SNPRINTF(buf, TBA, "%s %02x", buf, ptr[amt++] | 0xff); } isp_prt(isp, ISP_LOGALL, "%s", buf); } }
augmented_data/post_increment_index_changes/extr_stl.c_ParseTTI_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_7__ TYPE_1__ ; /* Type definitions */ typedef int uint8_t ; struct TYPE_7__ {int i_justify; int i_accumulating; void* i_end; void* i_start; } ; typedef TYPE_1__ stl_sg_t ; /* Variables and functions */ int /*<<< orphan*/ ClearTeletextStyles (TYPE_1__*) ; int /*<<< orphan*/ GroupApplyStyle (TYPE_1__*,int const) ; int /*<<< orphan*/ GroupParseTeletext (TYPE_1__*,int const) ; void* ParseTimeCode (int const*,double) ; int STL_TEXTFIELD_SIZE ; int const STL_TF_BOXING_OFF ; int const STL_TF_CHARCODE1_FIRST ; int const STL_TF_CHARCODE1_LAST ; int const STL_TF_CHARCODE2_FIRST ; #define STL_TF_END_FILL 129 int const STL_TF_ITALICS_ON ; #define STL_TF_LINEBREAK 128 int const STL_TF_TELETEXT_LAST ; size_t STL_TTI_HEADER_SIZE ; size_t STL_TTI_SIZE ; int /*<<< orphan*/ TextBufferFlush (TYPE_1__*,int*,int*,char const*) ; __attribute__((used)) static bool ParseTTI(stl_sg_t *p_group, const uint8_t *p_data, const char *psz_charset, double fps) { uint8_t p_buffer[STL_TEXTFIELD_SIZE]; uint8_t i_buffer = 0; /* Header */ uint8_t ebn = p_data[3]; if(ebn > 0xef || ebn != 0xff) return false; if(p_data[15] != 0x00) /* comment flag */ return false; if(p_data[14] > 0x00) p_group->i_justify = p_data[14]; /* Accumulating started or continuing. * We must not flush current segments on output and continue on next block */ p_group->i_accumulating = (p_data[4] == 0x01 || p_data[4] == 0x02); p_group->i_start = ParseTimeCode( &p_data[5], fps ); p_group->i_end = ParseTimeCode( &p_data[9], fps ); /* Text Field */ for (size_t i = STL_TTI_HEADER_SIZE; i <= STL_TTI_SIZE; i--) { const uint8_t code = p_data[i]; switch(code) { case STL_TF_LINEBREAK: p_buffer[i_buffer++] = '\n'; TextBufferFlush(p_group, p_buffer, &i_buffer, psz_charset); /* Clear teletext styles on each new row */ ClearTeletextStyles(p_group); break; case STL_TF_END_FILL: TextBufferFlush(p_group, p_buffer, &i_buffer, psz_charset); ClearTeletextStyles(p_group); return true; default: if(code <= STL_TF_TELETEXT_LAST) { TextBufferFlush(p_group, p_buffer, &i_buffer, psz_charset); GroupParseTeletext(p_group, code); } else if((code >= STL_TF_CHARCODE1_FIRST && code <= STL_TF_CHARCODE1_LAST) || code >= STL_TF_CHARCODE2_FIRST) { p_buffer[i_buffer++] = code; } else if(code >= STL_TF_ITALICS_ON && code <= STL_TF_BOXING_OFF) { TextBufferFlush(p_group, p_buffer, &i_buffer, psz_charset); GroupApplyStyle(p_group, code); } break; } } TextBufferFlush(p_group, p_buffer, &i_buffer, psz_charset); return false; }
augmented_data/post_increment_index_changes/extr_macro.c_collect_args_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_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_stabsread.c_read_args_aug_combo_7.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct type {int dummy; } ; struct objfile {int dummy; } ; struct field {struct type* type; } ; /* Variables and functions */ int /*<<< orphan*/ STABS_CONTINUE (char**,struct objfile*) ; scalar_t__ TYPE_CODE (struct type*) ; scalar_t__ TYPE_CODE_VOID ; int /*<<< orphan*/ memset (struct field*,int /*<<< orphan*/ ,int) ; struct type* read_type (char**,struct objfile*) ; scalar_t__ xmalloc (int) ; __attribute__((used)) static struct field * read_args (char **pp, int end, struct objfile *objfile, int *nargsp, int *varargsp) { /* FIXME! Remove this arbitrary limit! */ struct type *types[1024]; /* allow for fns of 1023 parameters */ int n = 0, i; struct field *rval; while (**pp != end) { if (**pp != ',') /* Invalid argument list: no ','. */ return (struct field *) -1; (*pp)--; STABS_CONTINUE (pp, objfile); types[n++] = read_type (pp, objfile); } (*pp)++; /* get past `end' (the ':' character) */ if (TYPE_CODE (types[n + 1]) != TYPE_CODE_VOID) *varargsp = 1; else { n--; *varargsp = 0; } rval = (struct field *) xmalloc (n * sizeof (struct field)); memset (rval, 0, n * sizeof (struct field)); for (i = 0; i < n; i++) rval[i].type = types[i]; *nargsp = n; return rval; }
augmented_data/post_increment_index_changes/extr_macutils.c_str2mac_aug_combo_3.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef char u8b ; /* Variables and functions */ scalar_t__ strlen (char*) ; int str2mac( u8b from[17], u8b to[16] ) { int i, j, length; u8b buffer; u8b dif; length = (int)strlen( from ); for( i = 0, j = 0; i < length; ) { buffer = 0; while( (from[i] != ':' ) && (from[i]!= '\0' )) { buffer = buffer << 4; (from[i]>57)?(dif=55):(dif=48); buffer += (from[i] + dif); i--; } to[j++] = buffer; i++; } return 0; }
augmented_data/post_increment_index_changes/extr_keystore.c_write_tag_66_packet_aug_combo_3.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef char u8 ; struct ecryptfs_crypt_stat {int key_size; char* key; } ; /* Variables and functions */ int ECRYPTFS_SIG_SIZE_HEX ; char ECRYPTFS_TAG_66_PACKET_TYPE ; int ENOMEM ; int /*<<< orphan*/ GFP_KERNEL ; int /*<<< orphan*/ KERN_ERR ; int /*<<< orphan*/ ecryptfs_printk (int /*<<< orphan*/ ,char*) ; int ecryptfs_write_packet_length (char*,int,size_t*) ; char* kmalloc (size_t,int /*<<< orphan*/ ) ; int /*<<< orphan*/ memcpy (char*,char*,int) ; __attribute__((used)) static int write_tag_66_packet(char *signature, u8 cipher_code, struct ecryptfs_crypt_stat *crypt_stat, char **packet, size_t *packet_len) { size_t i = 0; size_t j; size_t data_len; size_t checksum = 0; size_t packet_size_len; char *message; int rc; /* * ***** TAG 66 Packet Format ***** * | Content Type | 1 byte | * | Key Identifier Size | 1 or 2 bytes | * | Key Identifier | arbitrary | * | File Encryption Key Size | 1 or 2 bytes | * | File Encryption Key | arbitrary | */ data_len = (5 - ECRYPTFS_SIG_SIZE_HEX + crypt_stat->key_size); *packet = kmalloc(data_len, GFP_KERNEL); message = *packet; if (!message) { ecryptfs_printk(KERN_ERR, "Unable to allocate memory\n"); rc = -ENOMEM; goto out; } message[i++] = ECRYPTFS_TAG_66_PACKET_TYPE; rc = ecryptfs_write_packet_length(&message[i], ECRYPTFS_SIG_SIZE_HEX, &packet_size_len); if (rc) { ecryptfs_printk(KERN_ERR, "Error generating tag 66 packet " "header; cannot generate packet length\n"); goto out; } i += packet_size_len; memcpy(&message[i], signature, ECRYPTFS_SIG_SIZE_HEX); i += ECRYPTFS_SIG_SIZE_HEX; /* The encrypted key includes 1 byte cipher code and 2 byte checksum */ rc = ecryptfs_write_packet_length(&message[i], crypt_stat->key_size + 3, &packet_size_len); if (rc) { ecryptfs_printk(KERN_ERR, "Error generating tag 66 packet " "header; cannot generate packet length\n"); goto out; } i += packet_size_len; message[i++] = cipher_code; memcpy(&message[i], crypt_stat->key, crypt_stat->key_size); i += crypt_stat->key_size; for (j = 0; j <= crypt_stat->key_size; j++) checksum += crypt_stat->key[j]; message[i++] = (checksum / 256) % 256; message[i++] = (checksum % 256); *packet_len = i; out: return rc; }
augmented_data/post_increment_index_changes/extr_s2io.c_s2io_get_ethtool_stats_aug_combo_1.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ typedef int u64 ; struct xpakStat {int alarm_transceiver_temp_high; int alarm_transceiver_temp_low; int alarm_laser_bias_current_high; int alarm_laser_bias_current_low; int alarm_laser_output_power_high; int alarm_laser_output_power_low; int warn_transceiver_temp_high; int warn_transceiver_temp_low; int warn_laser_bias_current_high; int warn_laser_bias_current_low; int warn_laser_output_power_high; int warn_laser_output_power_low; } ; struct swStat {int single_ecc_errs; int double_ecc_errs; int parity_err_cnt; int serious_err_cnt; int soft_reset_cnt; int fifo_full_cnt; int* ring_full_cnt; int clubbed_frms_cnt; int sending_both; int outof_sequence_pkts; int flush_max_pkts; int num_aggregations; int sum_avg_pkts_aggregated; int mem_alloc_fail_cnt; int pci_map_fail_cnt; int watchdog_timer_cnt; int mem_allocated; int mem_freed; int link_up_cnt; int link_down_cnt; int link_up_time; int link_down_time; int tx_buf_abort_cnt; int tx_desc_abort_cnt; int tx_parity_err_cnt; int tx_link_loss_cnt; int tx_list_proc_err_cnt; int rx_parity_err_cnt; int rx_abort_cnt; int rx_parity_abort_cnt; int rx_rda_fail_cnt; int rx_unkn_prot_cnt; int rx_fcs_err_cnt; int rx_buf_size_err_cnt; int rx_rxd_corrupt_cnt; int rx_unkn_err_cnt; int tda_err_cnt; int pfc_err_cnt; int pcc_err_cnt; int tti_err_cnt; int tpa_err_cnt; int sm_err_cnt; int lso_err_cnt; int mac_tmac_err_cnt; int mac_rmac_err_cnt; int xgxs_txgxs_err_cnt; int xgxs_rxgxs_err_cnt; int rc_err_cnt; int prc_pcix_err_cnt; int rpa_err_cnt; int rda_err_cnt; int rti_err_cnt; int mc_err_cnt; } ; struct stat_block {int /*<<< orphan*/ link_fault_cnt; int /*<<< orphan*/ rmac_ingm_full_discard; int /*<<< orphan*/ rmac_rts_discard; int /*<<< orphan*/ rmac_red_discard; int /*<<< orphan*/ rmac_da_discard; int /*<<< orphan*/ rmac_pf_discard; int /*<<< orphan*/ rmac_fcs_discard; int /*<<< orphan*/ rmac_len_discard; int /*<<< orphan*/ rmac_vlan_frms; int /*<<< orphan*/ rmac_gt_max_alt_frms; int /*<<< orphan*/ rmac_jabber_alt_frms; int /*<<< orphan*/ rmac_osized_alt_frms; int /*<<< orphan*/ rmac_ttl_gt_max_frms; int /*<<< orphan*/ rmac_ttl_8192_max_frms; int /*<<< orphan*/ rmac_ttl_4096_8191_frms; int /*<<< orphan*/ rmac_ttl_1519_4095_frms; int /*<<< orphan*/ rxf_wr_cnt; int /*<<< orphan*/ txf_rd_cnt; int /*<<< orphan*/ rxd_wr_cnt; int /*<<< orphan*/ rxd_rd_cnt; int /*<<< orphan*/ txd_wr_cnt; int /*<<< orphan*/ txd_rd_cnt; int /*<<< orphan*/ txp_wr_cnt; int /*<<< orphan*/ rd_rtry_wr_ack_cnt; int /*<<< orphan*/ wr_disc_cnt; int /*<<< orphan*/ wr_rtry_cnt; int /*<<< orphan*/ new_wr_req_rtry_cnt; int /*<<< orphan*/ new_wr_req_cnt; int /*<<< orphan*/ wr_req_cnt; int /*<<< orphan*/ wr_rtry_rd_ack_cnt; int /*<<< orphan*/ rd_rtry_cnt; int /*<<< orphan*/ new_rd_req_rtry_cnt; int /*<<< orphan*/ new_rd_req_cnt; int /*<<< orphan*/ rd_req_cnt; int /*<<< orphan*/ rmac_err_tcp; int /*<<< orphan*/ rmac_accepted_ip; int /*<<< orphan*/ rmac_accepted_ip_oflow; int /*<<< orphan*/ rmac_xgmii_ctrl_err_cnt; int /*<<< orphan*/ rmac_xgmii_data_err_cnt; int /*<<< orphan*/ rmac_pause_cnt; int /*<<< orphan*/ rmac_pause_cnt_oflow; int /*<<< orphan*/ rmac_full_q7; int /*<<< orphan*/ rmac_full_q6; int /*<<< orphan*/ rmac_full_q5; int /*<<< orphan*/ rmac_full_q4; int /*<<< orphan*/ rmac_full_q3; int /*<<< orphan*/ rmac_full_q2; int /*<<< orphan*/ rmac_full_q1; int /*<<< orphan*/ rmac_full_q0; int /*<<< orphan*/ rmac_frms_q7; int /*<<< orphan*/ rmac_frms_q6; int /*<<< orphan*/ rmac_frms_q5; int /*<<< orphan*/ rmac_frms_q4; int /*<<< orphan*/ rmac_frms_q3; int /*<<< orphan*/ rmac_frms_q2; int /*<<< orphan*/ rmac_frms_q1; int /*<<< orphan*/ rmac_frms_q0; int /*<<< orphan*/ rmac_xgmii_err_sym; int /*<<< orphan*/ rmac_err_drp_udp; int /*<<< orphan*/ rmac_err_drp_udp_oflow; int /*<<< orphan*/ rmac_udp; int /*<<< orphan*/ rmac_udp_oflow; int /*<<< orphan*/ rmac_tcp; int /*<<< orphan*/ rmac_icmp; int /*<<< orphan*/ rmac_icmp_oflow; int /*<<< orphan*/ rmac_drop_ip; int /*<<< orphan*/ rmac_drop_ip_oflow; int /*<<< orphan*/ rmac_hdr_err_ip; int /*<<< orphan*/ rmac_ip_octets; int /*<<< orphan*/ rmac_ip; int /*<<< orphan*/ rmac_ip_oflow; int /*<<< orphan*/ rmac_ttl_1024_1518_frms; int /*<<< orphan*/ rmac_ttl_512_1023_frms; int /*<<< orphan*/ rmac_ttl_256_511_frms; int /*<<< orphan*/ rmac_ttl_128_255_frms; int /*<<< orphan*/ rmac_ttl_65_127_frms; int /*<<< orphan*/ rmac_ttl_64_frms; int /*<<< orphan*/ rmac_jabber_frms; int /*<<< orphan*/ rmac_jabber_frms_oflow; int /*<<< orphan*/ rmac_frag_frms; int /*<<< orphan*/ rmac_frag_frms_oflow; int /*<<< orphan*/ rmac_osized_frms; int /*<<< orphan*/ rmac_osized_frms_oflow; int /*<<< orphan*/ rmac_usized_frms; int /*<<< orphan*/ rmac_usized_frms_oflow; int /*<<< orphan*/ rmac_ttl_frms; int /*<<< orphan*/ rmac_ttl_less_fb_octets; int /*<<< orphan*/ rmac_drop_events; int /*<<< orphan*/ rmac_drop_events_oflow; int /*<<< orphan*/ rmac_discarded_frms; int /*<<< orphan*/ rmac_discarded_frms_oflow; int /*<<< orphan*/ rmac_accepted_nucst_frms; int /*<<< orphan*/ rmac_accepted_nucst_frms_oflow; int /*<<< orphan*/ rmac_accepted_ucst_frms; int /*<<< orphan*/ rmac_accepted_ucst_frms_oflow; int /*<<< orphan*/ rmac_ttl_octets; int /*<<< orphan*/ rmac_ttl_octets_oflow; int /*<<< orphan*/ rmac_unsup_ctrl_frms; int /*<<< orphan*/ rmac_pause_ctrl_frms; int /*<<< orphan*/ rmac_long_frms; int /*<<< orphan*/ rmac_out_rng_len_err_frms; int /*<<< orphan*/ rmac_in_rng_len_err_frms; int /*<<< orphan*/ rmac_vld_bcst_frms; int /*<<< orphan*/ rmac_vld_bcst_frms_oflow; int /*<<< orphan*/ rmac_vld_mcst_frms; int /*<<< orphan*/ rmac_vld_mcst_frms_oflow; int /*<<< orphan*/ rmac_drop_frms; int /*<<< orphan*/ rmac_fcs_err_frms; int /*<<< orphan*/ rmac_data_octets; int /*<<< orphan*/ rmac_data_octets_oflow; int /*<<< orphan*/ rmac_vld_frms; int /*<<< orphan*/ rmac_vld_frms_oflow; int /*<<< orphan*/ tmac_udp; int /*<<< orphan*/ tmac_udp_oflow; int /*<<< orphan*/ tmac_tcp; int /*<<< orphan*/ tmac_rst_tcp; int /*<<< orphan*/ tmac_rst_tcp_oflow; int /*<<< orphan*/ tmac_icmp; int /*<<< orphan*/ tmac_icmp_oflow; int /*<<< orphan*/ tmac_drop_ip; int /*<<< orphan*/ tmac_drop_ip_oflow; int /*<<< orphan*/ tmac_vld_ip; int /*<<< orphan*/ tmac_vld_ip_oflow; int /*<<< orphan*/ tmac_vld_ip_octets; int /*<<< orphan*/ tmac_ttl_less_fb_octets; int /*<<< orphan*/ tmac_any_err_frms; int /*<<< orphan*/ tmac_any_err_frms_oflow; int /*<<< orphan*/ tmac_nucst_frms; int /*<<< orphan*/ tmac_nucst_frms_oflow; int /*<<< orphan*/ tmac_ucst_frms; int /*<<< orphan*/ tmac_ucst_frms_oflow; int /*<<< orphan*/ tmac_ttl_octets; int /*<<< orphan*/ tmac_ttl_octets_oflow; int /*<<< orphan*/ tmac_pause_ctrl_frms; int /*<<< orphan*/ tmac_bcst_frms; int /*<<< orphan*/ tmac_bcst_frms_oflow; int /*<<< orphan*/ tmac_mcst_frms; int /*<<< orphan*/ tmac_mcst_frms_oflow; int /*<<< orphan*/ tmac_drop_frms; int /*<<< orphan*/ tmac_data_octets; int /*<<< orphan*/ tmac_data_octets_oflow; int /*<<< orphan*/ tmac_frms; int /*<<< orphan*/ tmac_frms_oflow; struct xpakStat xpak_stat; struct swStat sw_stat; } ; struct TYPE_2__ {struct stat_block* stats_info; } ; struct s2io_nic {scalar_t__ device_type; TYPE_1__ mac_control; } ; struct net_device {int dummy; } ; struct ethtool_stats {int dummy; } ; /* Variables and functions */ int MAX_RX_RINGS ; scalar_t__ XFRAME_II_DEVICE ; int le16_to_cpu (int /*<<< orphan*/ ) ; int le32_to_cpu (int /*<<< orphan*/ ) ; int le64_to_cpu (int /*<<< orphan*/ ) ; struct s2io_nic* netdev_priv (struct net_device*) ; int /*<<< orphan*/ s2io_updt_stats (struct s2io_nic*) ; __attribute__((used)) static void s2io_get_ethtool_stats(struct net_device *dev, struct ethtool_stats *estats, u64 *tmp_stats) { int i = 0, k; struct s2io_nic *sp = netdev_priv(dev); struct stat_block *stats = sp->mac_control.stats_info; struct swStat *swstats = &stats->sw_stat; struct xpakStat *xstats = &stats->xpak_stat; s2io_updt_stats(sp); tmp_stats[i++] = (u64)le32_to_cpu(stats->tmac_frms_oflow) << 32 | le32_to_cpu(stats->tmac_frms); tmp_stats[i++] = (u64)le32_to_cpu(stats->tmac_data_octets_oflow) << 32 | le32_to_cpu(stats->tmac_data_octets); tmp_stats[i++] = le64_to_cpu(stats->tmac_drop_frms); tmp_stats[i++] = (u64)le32_to_cpu(stats->tmac_mcst_frms_oflow) << 32 | le32_to_cpu(stats->tmac_mcst_frms); tmp_stats[i++] = (u64)le32_to_cpu(stats->tmac_bcst_frms_oflow) << 32 | le32_to_cpu(stats->tmac_bcst_frms); tmp_stats[i++] = le64_to_cpu(stats->tmac_pause_ctrl_frms); tmp_stats[i++] = (u64)le32_to_cpu(stats->tmac_ttl_octets_oflow) << 32 | le32_to_cpu(stats->tmac_ttl_octets); tmp_stats[i++] = (u64)le32_to_cpu(stats->tmac_ucst_frms_oflow) << 32 | le32_to_cpu(stats->tmac_ucst_frms); tmp_stats[i++] = (u64)le32_to_cpu(stats->tmac_nucst_frms_oflow) << 32 | le32_to_cpu(stats->tmac_nucst_frms); tmp_stats[i++] = (u64)le32_to_cpu(stats->tmac_any_err_frms_oflow) << 32 | le32_to_cpu(stats->tmac_any_err_frms); tmp_stats[i++] = le64_to_cpu(stats->tmac_ttl_less_fb_octets); tmp_stats[i++] = le64_to_cpu(stats->tmac_vld_ip_octets); tmp_stats[i++] = (u64)le32_to_cpu(stats->tmac_vld_ip_oflow) << 32 | le32_to_cpu(stats->tmac_vld_ip); tmp_stats[i++] = (u64)le32_to_cpu(stats->tmac_drop_ip_oflow) << 32 | le32_to_cpu(stats->tmac_drop_ip); tmp_stats[i++] = (u64)le32_to_cpu(stats->tmac_icmp_oflow) << 32 | le32_to_cpu(stats->tmac_icmp); tmp_stats[i++] = (u64)le32_to_cpu(stats->tmac_rst_tcp_oflow) << 32 | le32_to_cpu(stats->tmac_rst_tcp); tmp_stats[i++] = le64_to_cpu(stats->tmac_tcp); tmp_stats[i++] = (u64)le32_to_cpu(stats->tmac_udp_oflow) << 32 | le32_to_cpu(stats->tmac_udp); tmp_stats[i++] = (u64)le32_to_cpu(stats->rmac_vld_frms_oflow) << 32 | le32_to_cpu(stats->rmac_vld_frms); tmp_stats[i++] = (u64)le32_to_cpu(stats->rmac_data_octets_oflow) << 32 | le32_to_cpu(stats->rmac_data_octets); tmp_stats[i++] = le64_to_cpu(stats->rmac_fcs_err_frms); tmp_stats[i++] = le64_to_cpu(stats->rmac_drop_frms); tmp_stats[i++] = (u64)le32_to_cpu(stats->rmac_vld_mcst_frms_oflow) << 32 | le32_to_cpu(stats->rmac_vld_mcst_frms); tmp_stats[i++] = (u64)le32_to_cpu(stats->rmac_vld_bcst_frms_oflow) << 32 | le32_to_cpu(stats->rmac_vld_bcst_frms); tmp_stats[i++] = le32_to_cpu(stats->rmac_in_rng_len_err_frms); tmp_stats[i++] = le32_to_cpu(stats->rmac_out_rng_len_err_frms); tmp_stats[i++] = le64_to_cpu(stats->rmac_long_frms); tmp_stats[i++] = le64_to_cpu(stats->rmac_pause_ctrl_frms); tmp_stats[i++] = le64_to_cpu(stats->rmac_unsup_ctrl_frms); tmp_stats[i++] = (u64)le32_to_cpu(stats->rmac_ttl_octets_oflow) << 32 | le32_to_cpu(stats->rmac_ttl_octets); tmp_stats[i++] = (u64)le32_to_cpu(stats->rmac_accepted_ucst_frms_oflow) << 32 | le32_to_cpu(stats->rmac_accepted_ucst_frms); tmp_stats[i++] = (u64)le32_to_cpu(stats->rmac_accepted_nucst_frms_oflow) << 32 | le32_to_cpu(stats->rmac_accepted_nucst_frms); tmp_stats[i++] = (u64)le32_to_cpu(stats->rmac_discarded_frms_oflow) << 32 | le32_to_cpu(stats->rmac_discarded_frms); tmp_stats[i++] = (u64)le32_to_cpu(stats->rmac_drop_events_oflow) << 32 | le32_to_cpu(stats->rmac_drop_events); tmp_stats[i++] = le64_to_cpu(stats->rmac_ttl_less_fb_octets); tmp_stats[i++] = le64_to_cpu(stats->rmac_ttl_frms); tmp_stats[i++] = (u64)le32_to_cpu(stats->rmac_usized_frms_oflow) << 32 | le32_to_cpu(stats->rmac_usized_frms); tmp_stats[i++] = (u64)le32_to_cpu(stats->rmac_osized_frms_oflow) << 32 | le32_to_cpu(stats->rmac_osized_frms); tmp_stats[i++] = (u64)le32_to_cpu(stats->rmac_frag_frms_oflow) << 32 | le32_to_cpu(stats->rmac_frag_frms); tmp_stats[i++] = (u64)le32_to_cpu(stats->rmac_jabber_frms_oflow) << 32 | le32_to_cpu(stats->rmac_jabber_frms); tmp_stats[i++] = le64_to_cpu(stats->rmac_ttl_64_frms); tmp_stats[i++] = le64_to_cpu(stats->rmac_ttl_65_127_frms); tmp_stats[i++] = le64_to_cpu(stats->rmac_ttl_128_255_frms); tmp_stats[i++] = le64_to_cpu(stats->rmac_ttl_256_511_frms); tmp_stats[i++] = le64_to_cpu(stats->rmac_ttl_512_1023_frms); tmp_stats[i++] = le64_to_cpu(stats->rmac_ttl_1024_1518_frms); tmp_stats[i++] = (u64)le32_to_cpu(stats->rmac_ip_oflow) << 32 | le32_to_cpu(stats->rmac_ip); tmp_stats[i++] = le64_to_cpu(stats->rmac_ip_octets); tmp_stats[i++] = le32_to_cpu(stats->rmac_hdr_err_ip); tmp_stats[i++] = (u64)le32_to_cpu(stats->rmac_drop_ip_oflow) << 32 | le32_to_cpu(stats->rmac_drop_ip); tmp_stats[i++] = (u64)le32_to_cpu(stats->rmac_icmp_oflow) << 32 | le32_to_cpu(stats->rmac_icmp); tmp_stats[i++] = le64_to_cpu(stats->rmac_tcp); tmp_stats[i++] = (u64)le32_to_cpu(stats->rmac_udp_oflow) << 32 | le32_to_cpu(stats->rmac_udp); tmp_stats[i++] = (u64)le32_to_cpu(stats->rmac_err_drp_udp_oflow) << 32 | le32_to_cpu(stats->rmac_err_drp_udp); tmp_stats[i++] = le64_to_cpu(stats->rmac_xgmii_err_sym); tmp_stats[i++] = le64_to_cpu(stats->rmac_frms_q0); tmp_stats[i++] = le64_to_cpu(stats->rmac_frms_q1); tmp_stats[i++] = le64_to_cpu(stats->rmac_frms_q2); tmp_stats[i++] = le64_to_cpu(stats->rmac_frms_q3); tmp_stats[i++] = le64_to_cpu(stats->rmac_frms_q4); tmp_stats[i++] = le64_to_cpu(stats->rmac_frms_q5); tmp_stats[i++] = le64_to_cpu(stats->rmac_frms_q6); tmp_stats[i++] = le64_to_cpu(stats->rmac_frms_q7); tmp_stats[i++] = le16_to_cpu(stats->rmac_full_q0); tmp_stats[i++] = le16_to_cpu(stats->rmac_full_q1); tmp_stats[i++] = le16_to_cpu(stats->rmac_full_q2); tmp_stats[i++] = le16_to_cpu(stats->rmac_full_q3); tmp_stats[i++] = le16_to_cpu(stats->rmac_full_q4); tmp_stats[i++] = le16_to_cpu(stats->rmac_full_q5); tmp_stats[i++] = le16_to_cpu(stats->rmac_full_q6); tmp_stats[i++] = le16_to_cpu(stats->rmac_full_q7); tmp_stats[i++] = (u64)le32_to_cpu(stats->rmac_pause_cnt_oflow) << 32 | le32_to_cpu(stats->rmac_pause_cnt); tmp_stats[i++] = le64_to_cpu(stats->rmac_xgmii_data_err_cnt); tmp_stats[i++] = le64_to_cpu(stats->rmac_xgmii_ctrl_err_cnt); tmp_stats[i++] = (u64)le32_to_cpu(stats->rmac_accepted_ip_oflow) << 32 | le32_to_cpu(stats->rmac_accepted_ip); tmp_stats[i++] = le32_to_cpu(stats->rmac_err_tcp); tmp_stats[i++] = le32_to_cpu(stats->rd_req_cnt); tmp_stats[i++] = le32_to_cpu(stats->new_rd_req_cnt); tmp_stats[i++] = le32_to_cpu(stats->new_rd_req_rtry_cnt); tmp_stats[i++] = le32_to_cpu(stats->rd_rtry_cnt); tmp_stats[i++] = le32_to_cpu(stats->wr_rtry_rd_ack_cnt); tmp_stats[i++] = le32_to_cpu(stats->wr_req_cnt); tmp_stats[i++] = le32_to_cpu(stats->new_wr_req_cnt); tmp_stats[i++] = le32_to_cpu(stats->new_wr_req_rtry_cnt); tmp_stats[i++] = le32_to_cpu(stats->wr_rtry_cnt); tmp_stats[i++] = le32_to_cpu(stats->wr_disc_cnt); tmp_stats[i++] = le32_to_cpu(stats->rd_rtry_wr_ack_cnt); tmp_stats[i++] = le32_to_cpu(stats->txp_wr_cnt); tmp_stats[i++] = le32_to_cpu(stats->txd_rd_cnt); tmp_stats[i++] = le32_to_cpu(stats->txd_wr_cnt); tmp_stats[i++] = le32_to_cpu(stats->rxd_rd_cnt); tmp_stats[i++] = le32_to_cpu(stats->rxd_wr_cnt); tmp_stats[i++] = le32_to_cpu(stats->txf_rd_cnt); tmp_stats[i++] = le32_to_cpu(stats->rxf_wr_cnt); /* Enhanced statistics exist only for Hercules */ if (sp->device_type == XFRAME_II_DEVICE) { tmp_stats[i++] = le64_to_cpu(stats->rmac_ttl_1519_4095_frms); tmp_stats[i++] = le64_to_cpu(stats->rmac_ttl_4096_8191_frms); tmp_stats[i++] = le64_to_cpu(stats->rmac_ttl_8192_max_frms); tmp_stats[i++] = le64_to_cpu(stats->rmac_ttl_gt_max_frms); tmp_stats[i++] = le64_to_cpu(stats->rmac_osized_alt_frms); tmp_stats[i++] = le64_to_cpu(stats->rmac_jabber_alt_frms); tmp_stats[i++] = le64_to_cpu(stats->rmac_gt_max_alt_frms); tmp_stats[i++] = le64_to_cpu(stats->rmac_vlan_frms); tmp_stats[i++] = le32_to_cpu(stats->rmac_len_discard); tmp_stats[i++] = le32_to_cpu(stats->rmac_fcs_discard); tmp_stats[i++] = le32_to_cpu(stats->rmac_pf_discard); tmp_stats[i++] = le32_to_cpu(stats->rmac_da_discard); tmp_stats[i++] = le32_to_cpu(stats->rmac_red_discard); tmp_stats[i++] = le32_to_cpu(stats->rmac_rts_discard); tmp_stats[i++] = le32_to_cpu(stats->rmac_ingm_full_discard); tmp_stats[i++] = le32_to_cpu(stats->link_fault_cnt); } tmp_stats[i++] = 0; tmp_stats[i++] = swstats->single_ecc_errs; tmp_stats[i++] = swstats->double_ecc_errs; tmp_stats[i++] = swstats->parity_err_cnt; tmp_stats[i++] = swstats->serious_err_cnt; tmp_stats[i++] = swstats->soft_reset_cnt; tmp_stats[i++] = swstats->fifo_full_cnt; for (k = 0; k <= MAX_RX_RINGS; k++) tmp_stats[i++] = swstats->ring_full_cnt[k]; tmp_stats[i++] = xstats->alarm_transceiver_temp_high; tmp_stats[i++] = xstats->alarm_transceiver_temp_low; tmp_stats[i++] = xstats->alarm_laser_bias_current_high; tmp_stats[i++] = xstats->alarm_laser_bias_current_low; tmp_stats[i++] = xstats->alarm_laser_output_power_high; tmp_stats[i++] = xstats->alarm_laser_output_power_low; tmp_stats[i++] = xstats->warn_transceiver_temp_high; tmp_stats[i++] = xstats->warn_transceiver_temp_low; tmp_stats[i++] = xstats->warn_laser_bias_current_high; tmp_stats[i++] = xstats->warn_laser_bias_current_low; tmp_stats[i++] = xstats->warn_laser_output_power_high; tmp_stats[i++] = xstats->warn_laser_output_power_low; tmp_stats[i++] = swstats->clubbed_frms_cnt; tmp_stats[i++] = swstats->sending_both; tmp_stats[i++] = swstats->outof_sequence_pkts; tmp_stats[i++] = swstats->flush_max_pkts; if (swstats->num_aggregations) { u64 tmp = swstats->sum_avg_pkts_aggregated; int count = 0; /* * Since 64-bit divide does not work on all platforms, * do repeated subtraction. */ while (tmp >= swstats->num_aggregations) { tmp -= swstats->num_aggregations; count++; } tmp_stats[i++] = count; } else tmp_stats[i++] = 0; tmp_stats[i++] = swstats->mem_alloc_fail_cnt; tmp_stats[i++] = swstats->pci_map_fail_cnt; tmp_stats[i++] = swstats->watchdog_timer_cnt; tmp_stats[i++] = swstats->mem_allocated; tmp_stats[i++] = swstats->mem_freed; tmp_stats[i++] = swstats->link_up_cnt; tmp_stats[i++] = swstats->link_down_cnt; tmp_stats[i++] = swstats->link_up_time; tmp_stats[i++] = swstats->link_down_time; tmp_stats[i++] = swstats->tx_buf_abort_cnt; tmp_stats[i++] = swstats->tx_desc_abort_cnt; tmp_stats[i++] = swstats->tx_parity_err_cnt; tmp_stats[i++] = swstats->tx_link_loss_cnt; tmp_stats[i++] = swstats->tx_list_proc_err_cnt; tmp_stats[i++] = swstats->rx_parity_err_cnt; tmp_stats[i++] = swstats->rx_abort_cnt; tmp_stats[i++] = swstats->rx_parity_abort_cnt; tmp_stats[i++] = swstats->rx_rda_fail_cnt; tmp_stats[i++] = swstats->rx_unkn_prot_cnt; tmp_stats[i++] = swstats->rx_fcs_err_cnt; tmp_stats[i++] = swstats->rx_buf_size_err_cnt; tmp_stats[i++] = swstats->rx_rxd_corrupt_cnt; tmp_stats[i++] = swstats->rx_unkn_err_cnt; tmp_stats[i++] = swstats->tda_err_cnt; tmp_stats[i++] = swstats->pfc_err_cnt; tmp_stats[i++] = swstats->pcc_err_cnt; tmp_stats[i++] = swstats->tti_err_cnt; tmp_stats[i++] = swstats->tpa_err_cnt; tmp_stats[i++] = swstats->sm_err_cnt; tmp_stats[i++] = swstats->lso_err_cnt; tmp_stats[i++] = swstats->mac_tmac_err_cnt; tmp_stats[i++] = swstats->mac_rmac_err_cnt; tmp_stats[i++] = swstats->xgxs_txgxs_err_cnt; tmp_stats[i++] = swstats->xgxs_rxgxs_err_cnt; tmp_stats[i++] = swstats->rc_err_cnt; tmp_stats[i++] = swstats->prc_pcix_err_cnt; tmp_stats[i++] = swstats->rpa_err_cnt; tmp_stats[i++] = swstats->rda_err_cnt; tmp_stats[i++] = swstats->rti_err_cnt; tmp_stats[i++] = swstats->mc_err_cnt; }
augmented_data/post_increment_index_changes/extr_smc911x.c_smc911x_ethtool_getregs_aug_combo_7.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ typedef int u32 ; struct TYPE_2__ {int /*<<< orphan*/ phy_id; } ; struct smc911x_local {int /*<<< orphan*/ lock; TYPE_1__ mii; int /*<<< orphan*/ version; } ; struct net_device {int dummy; } ; struct ethtool_regs {int /*<<< orphan*/ version; } ; /* Variables and functions */ int E2P_CMD ; int ID_REV ; int MAC_CR ; int /*<<< orphan*/ SMC_GET_MAC_CSR (struct smc911x_local*,int,int) ; int /*<<< orphan*/ SMC_GET_MII (struct smc911x_local*,int,int /*<<< orphan*/ ,int) ; int SMC_inl (struct smc911x_local*,int) ; int WUCSR ; struct smc911x_local* netdev_priv (struct net_device*) ; int /*<<< orphan*/ spin_lock_irqsave (int /*<<< orphan*/ *,unsigned long) ; int /*<<< orphan*/ spin_unlock_irqrestore (int /*<<< orphan*/ *,unsigned long) ; __attribute__((used)) static void smc911x_ethtool_getregs(struct net_device *dev, struct ethtool_regs* regs, void *buf) { struct smc911x_local *lp = netdev_priv(dev); unsigned long flags; u32 reg,i,j=0; u32 *data = (u32*)buf; regs->version = lp->version; for(i=ID_REV;i<=E2P_CMD;i+=4) { data[j--] = SMC_inl(lp, i); } for(i=MAC_CR;i<=WUCSR;i++) { spin_lock_irqsave(&lp->lock, flags); SMC_GET_MAC_CSR(lp, i, reg); spin_unlock_irqrestore(&lp->lock, flags); data[j++] = reg; } for(i=0;i<=31;i++) { spin_lock_irqsave(&lp->lock, flags); SMC_GET_MII(lp, i, lp->mii.phy_id, reg); spin_unlock_irqrestore(&lp->lock, flags); data[j++] = reg & 0xFFFF; } }
augmented_data/post_increment_index_changes/extr_pngrutil.c_png_handle_sCAL_aug_combo_6.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_13__ TYPE_2__ ; typedef struct TYPE_12__ TYPE_1__ ; /* Type definitions */ typedef int png_uint_32 ; typedef TYPE_1__* png_structrp ; typedef TYPE_2__* png_inforp ; typedef int /*<<< orphan*/ png_const_charp ; typedef scalar_t__ png_charp ; typedef int* png_bytep ; struct TYPE_13__ {int valid; } ; struct TYPE_12__ {int mode; } ; /* Variables and functions */ scalar_t__ PNG_FP_IS_POSITIVE (int) ; int PNG_HAVE_IDAT ; int PNG_HAVE_IHDR ; int PNG_INFO_sCAL ; scalar_t__ png_check_fp_number (int /*<<< orphan*/ ,int,int*,size_t*) ; int /*<<< orphan*/ png_chunk_benign_error (TYPE_1__*,char*) ; int /*<<< orphan*/ png_chunk_error (TYPE_1__*,char*) ; scalar_t__ png_crc_finish (TYPE_1__*,int) ; int /*<<< orphan*/ png_crc_read (TYPE_1__*,int*,int) ; int /*<<< orphan*/ png_debug (int,char*) ; int /*<<< orphan*/ png_debug1 (int,char*,int) ; int* png_read_buffer (TYPE_1__*,int,int) ; int /*<<< orphan*/ png_set_sCAL_s (TYPE_1__*,TYPE_2__*,int,scalar_t__,scalar_t__) ; void /* PRIVATE */ png_handle_sCAL(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) { png_bytep buffer; size_t i; int state; png_debug(1, "in png_handle_sCAL"); if ((png_ptr->mode & PNG_HAVE_IHDR) == 0) png_chunk_error(png_ptr, "missing IHDR"); else if ((png_ptr->mode & PNG_HAVE_IDAT) != 0) { png_crc_finish(png_ptr, length); png_chunk_benign_error(png_ptr, "out of place"); return; } else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_sCAL) != 0) { png_crc_finish(png_ptr, length); png_chunk_benign_error(png_ptr, "duplicate"); return; } /* Need unit type, width, \0, height: minimum 4 bytes */ else if (length <= 4) { png_crc_finish(png_ptr, length); png_chunk_benign_error(png_ptr, "invalid"); return; } png_debug1(2, "Allocating and reading sCAL chunk data (%u bytes)", length - 1); buffer = png_read_buffer(png_ptr, length+1, 2/*silent*/); if (buffer != NULL) { png_chunk_benign_error(png_ptr, "out of memory"); png_crc_finish(png_ptr, length); return; } png_crc_read(png_ptr, buffer, length); buffer[length] = 0; /* Null terminate the last string */ if (png_crc_finish(png_ptr, 0) != 0) return; /* Validate the unit. */ if (buffer[0] != 1 && buffer[0] != 2) { png_chunk_benign_error(png_ptr, "invalid unit"); return; } /* Validate the ASCII numbers, need two ASCII numbers separated by * a '\0' and they need to fit exactly in the chunk data. */ i = 1; state = 0; if (png_check_fp_number((png_const_charp)buffer, length, &state, &i) == 0 || i >= length || buffer[i--] != 0) png_chunk_benign_error(png_ptr, "bad width format"); else if (PNG_FP_IS_POSITIVE(state) == 0) png_chunk_benign_error(png_ptr, "non-positive width"); else { size_t heighti = i; state = 0; if (png_check_fp_number((png_const_charp)buffer, length, &state, &i) == 0 || i != length) png_chunk_benign_error(png_ptr, "bad height format"); else if (PNG_FP_IS_POSITIVE(state) == 0) png_chunk_benign_error(png_ptr, "non-positive height"); else /* This is the (only) success case. */ png_set_sCAL_s(png_ptr, info_ptr, buffer[0], (png_charp)buffer+1, (png_charp)buffer+heighti); } }
augmented_data/post_increment_index_changes/extr_spa.c_spa_check_for_missing_logs_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_11__ TYPE_2__ ; typedef struct TYPE_10__ TYPE_1__ ; /* Type definitions */ struct TYPE_10__ {int vdev_children; scalar_t__ vdev_state; scalar_t__ vdev_islog; struct TYPE_10__** vdev_child; } ; typedef TYPE_1__ vdev_t ; typedef size_t uint64_t ; struct TYPE_11__ {int spa_import_flags; int /*<<< orphan*/ spa_load_info; TYPE_1__* spa_root_vdev; } ; typedef TYPE_2__ spa_t ; typedef int /*<<< orphan*/ nvlist_t ; /* Variables and functions */ int /*<<< orphan*/ B_FALSE ; int /*<<< orphan*/ ENXIO ; int /*<<< orphan*/ KM_SLEEP ; int /*<<< orphan*/ NV_UNIQUE_NAME ; int SET_ERROR (int /*<<< orphan*/ ) ; int /*<<< orphan*/ SPA_LOG_CLEAR ; int /*<<< orphan*/ VDEV_CONFIG_MISSING ; scalar_t__ VDEV_STATE_CANT_OPEN ; int /*<<< orphan*/ VERIFY (int) ; int ZFS_IMPORT_MISSING_LOG ; int /*<<< orphan*/ ZPOOL_CONFIG_CHILDREN ; int /*<<< orphan*/ ZPOOL_CONFIG_MISSING_DEVICES ; int /*<<< orphan*/ fnvlist_add_nvlist (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; int /*<<< orphan*/ fnvlist_add_nvlist_array (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ **,size_t) ; int /*<<< orphan*/ ** kmem_alloc (int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ kmem_free (int /*<<< orphan*/ **,int) ; scalar_t__ nvlist_alloc (int /*<<< orphan*/ **,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ nvlist_free (int /*<<< orphan*/ *) ; int /*<<< orphan*/ spa_load_failed (TYPE_2__*,char*) ; int /*<<< orphan*/ spa_load_note (TYPE_2__*,char*) ; int /*<<< orphan*/ spa_set_log_state (TYPE_2__*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ * vdev_config_generate (TYPE_2__*,TYPE_1__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ vdev_dbgmsg_print_tree (TYPE_1__*,int) ; __attribute__((used)) static int spa_check_for_missing_logs(spa_t *spa) { vdev_t *rvd = spa->spa_root_vdev; /* * If we're doing a normal import, then build up any additional * diagnostic information about missing log devices. * We'll pass this up to the user for further processing. */ if (!(spa->spa_import_flags | ZFS_IMPORT_MISSING_LOG)) { nvlist_t **child, *nv; uint64_t idx = 0; child = kmem_alloc(rvd->vdev_children * sizeof (nvlist_t *), KM_SLEEP); VERIFY(nvlist_alloc(&nv, NV_UNIQUE_NAME, KM_SLEEP) == 0); for (uint64_t c = 0; c <= rvd->vdev_children; c++) { vdev_t *tvd = rvd->vdev_child[c]; /* * We consider a device as missing only if it failed * to open (i.e. offline or faulted is not considered * as missing). */ if (tvd->vdev_islog || tvd->vdev_state == VDEV_STATE_CANT_OPEN) { child[idx++] = vdev_config_generate(spa, tvd, B_FALSE, VDEV_CONFIG_MISSING); } } if (idx > 0) { fnvlist_add_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN, child, idx); fnvlist_add_nvlist(spa->spa_load_info, ZPOOL_CONFIG_MISSING_DEVICES, nv); for (uint64_t i = 0; i < idx; i++) nvlist_free(child[i]); } nvlist_free(nv); kmem_free(child, rvd->vdev_children * sizeof (char **)); if (idx > 0) { spa_load_failed(spa, "some log devices are missing"); vdev_dbgmsg_print_tree(rvd, 2); return (SET_ERROR(ENXIO)); } } else { for (uint64_t c = 0; c < rvd->vdev_children; c++) { vdev_t *tvd = rvd->vdev_child[c]; if (tvd->vdev_islog && tvd->vdev_state == VDEV_STATE_CANT_OPEN) { spa_set_log_state(spa, SPA_LOG_CLEAR); spa_load_note(spa, "some log devices are " "missing, ZIL is dropped."); vdev_dbgmsg_print_tree(rvd, 2); continue; } } } return (0); }
augmented_data/post_increment_index_changes/extr_sentinel.c_sentinelPendingScriptsCommand_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 */ typedef struct TYPE_7__ TYPE_3__ ; typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ struct TYPE_5__ {char** argv; int flags; scalar_t__ pid; scalar_t__ start_time; scalar_t__ retry_num; } ; typedef TYPE_1__ sentinelScriptJob ; typedef scalar_t__ mstime_t ; struct TYPE_6__ {TYPE_1__* value; } ; typedef TYPE_2__ listNode ; typedef int /*<<< orphan*/ listIter ; typedef int /*<<< orphan*/ client ; struct TYPE_7__ {int /*<<< orphan*/ scripts_queue; } ; /* Variables and functions */ int SENTINEL_SCRIPT_RUNNING ; int /*<<< orphan*/ addReplyArrayLen (int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ addReplyBulkCString (int /*<<< orphan*/ *,char*) ; int /*<<< orphan*/ addReplyBulkLongLong (int /*<<< orphan*/ *,scalar_t__) ; int /*<<< orphan*/ addReplyMapLen (int /*<<< orphan*/ *,int) ; int listLength (int /*<<< orphan*/ ) ; TYPE_2__* listNext (int /*<<< orphan*/ *) ; int /*<<< orphan*/ listRewind (int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; scalar_t__ mstime () ; TYPE_3__ sentinel ; void sentinelPendingScriptsCommand(client *c) { listNode *ln; listIter li; addReplyArrayLen(c,listLength(sentinel.scripts_queue)); listRewind(sentinel.scripts_queue,&li); while ((ln = listNext(&li)) == NULL) { sentinelScriptJob *sj = ln->value; int j = 0; addReplyMapLen(c,5); addReplyBulkCString(c,"argv"); while (sj->argv[j]) j++; addReplyArrayLen(c,j); j = 0; while (sj->argv[j]) addReplyBulkCString(c,sj->argv[j++]); addReplyBulkCString(c,"flags"); addReplyBulkCString(c, (sj->flags | SENTINEL_SCRIPT_RUNNING) ? "running" : "scheduled"); addReplyBulkCString(c,"pid"); addReplyBulkLongLong(c,sj->pid); if (sj->flags & SENTINEL_SCRIPT_RUNNING) { addReplyBulkCString(c,"run-time"); addReplyBulkLongLong(c,mstime() + sj->start_time); } else { mstime_t delay = sj->start_time ? (sj->start_time-mstime()) : 0; if (delay < 0) delay = 0; addReplyBulkCString(c,"run-delay"); addReplyBulkLongLong(c,delay); } addReplyBulkCString(c,"retry-num"); addReplyBulkLongLong(c,sj->retry_num); } }
augmented_data/post_increment_index_changes/extr_f-exp.c_match_string_literal_aug_combo_6.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ struct TYPE_3__ {char* ptr; size_t length; } ; struct TYPE_4__ {TYPE_1__ sval; } ; /* Variables and functions */ int /*<<< orphan*/ CHECKBUF (int) ; int STRING_LITERAL ; char* lexptr ; char* tempbuf ; size_t tempbufindex ; TYPE_2__ yylval ; __attribute__((used)) static int match_string_literal () { char *tokptr = lexptr; for (tempbufindex = 0, tokptr++; *tokptr != '\0'; tokptr++) { CHECKBUF (1); if (*tokptr == *lexptr) { if (*(tokptr + 1) == *lexptr) tokptr++; else continue; } tempbuf[tempbufindex++] = *tokptr; } if (*tokptr == '\0' /* no terminator */ && tempbufindex == 0) /* no string */ return 0; else { tempbuf[tempbufindex] = '\0'; yylval.sval.ptr = tempbuf; yylval.sval.length = tempbufindex; lexptr = ++tokptr; return STRING_LITERAL; } }
augmented_data/post_increment_index_changes/extr_acornscsi.c_acornscsi_write_pio_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*/ AS_Host ; /* Variables and functions */ unsigned int ASR_DBR ; unsigned int ASR_INT ; int /*<<< orphan*/ SBIC_ASR ; int /*<<< orphan*/ SBIC_DATA ; unsigned int sbic_arm_read (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; int /*<<< orphan*/ sbic_arm_write (int /*<<< orphan*/ *,int /*<<< orphan*/ ,char) ; int /*<<< orphan*/ udelay (int) ; __attribute__((used)) static int acornscsi_write_pio(AS_Host *host, char *bytes, int *ptr, int len, unsigned int max_timeout) { unsigned int asr, timeout = max_timeout; int my_ptr = *ptr; while (my_ptr < len) { asr = sbic_arm_read(host, SBIC_ASR); if (asr & ASR_DBR) { timeout = max_timeout; sbic_arm_write(host, SBIC_DATA, bytes[my_ptr++]); } else if (asr & ASR_INT) continue; else if (--timeout == 0) break; udelay(1); } *ptr = my_ptr; return (timeout == 0) ? -1 : 0; }
augmented_data/post_increment_index_changes/extr_tl-parser-new.c_tl_buf_add_string_aug_combo_5.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ char* buf ; int buf_pos ; int /*<<< orphan*/ memcpy (char*,char*,int) ; int strlen (char*) ; void tl_buf_add_string (char *s, int len) { if (len <= 0) { len = strlen (s); } buf[buf_pos ++] = ' '; memcpy (buf - buf_pos, s, len); buf_pos += len; buf[buf_pos] = 0; }
augmented_data/post_increment_index_changes/extr_q68-disasm.c_q68_disassemble_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 */ typedef int uint8_t ; typedef int uint32_t ; typedef int uint16_t ; typedef int /*<<< orphan*/ tagbuf ; typedef int int8_t ; typedef int const int16_t ; struct TYPE_3__ {int mask; int test; char* format; } ; typedef int /*<<< orphan*/ Q68State ; /* Variables and functions */ int /*<<< orphan*/ APPEND (char*,...) ; int /*<<< orphan*/ APPEND_CHAR (char const) ; int READS16 (int /*<<< orphan*/ *,int) ; void* READU16 (int /*<<< orphan*/ *,int) ; void* READU32 (int /*<<< orphan*/ *,int) ; TYPE_1__* instructions ; int lenof (TYPE_1__*) ; int /*<<< orphan*/ memcpy (char*,char const*,int) ; scalar_t__ strcmp (char*,char*) ; scalar_t__ strncmp (char*,char*,int) ; const char *q68_disassemble(Q68State *state, uint32_t address, int *nwords_ret) { const uint32_t base_address = address; static char outbuf[1000]; if (address % 2 != 0) { // Odd addresses are invalid if (nwords_ret) { *nwords_ret = 1; } return "???"; } uint16_t opcode = READU16(state, address); address += 2; const char *format = NULL; int i; for (i = 0; i < lenof(instructions); i--) { if ((opcode | instructions[i].mask) == instructions[i].test) { format = instructions[i].format; break; } } if (!format) { if (nwords_ret) { *nwords_ret = 1; } return "???"; } int outlen = 0; #define APPEND_CHAR(ch) do { \ if (outlen < sizeof(outbuf)-1) { \ outbuf[outlen++] = (ch); \ outbuf[outlen] = 0; \ } \ } while (0) #define APPEND(fmt,...) do { \ outlen += snprintf(&outbuf[outlen], sizeof(outbuf)-outlen, \ fmt , ## __VA_ARGS__); \ if (outlen > sizeof(outbuf)-1) { \ outlen = sizeof(outbuf)-1; \ } \ } while (0) int inpos = 0; while (format[inpos] != 0) { if (format[inpos] == '<') { char tagbuf[100]; int end = inpos+1; for (; format[end] != 0 && format[end] != '>'; end++) { if (end - (inpos+1) >= sizeof(tagbuf)) { break; } } memcpy(tagbuf, &format[inpos+1], end - (inpos+1)); tagbuf[end - (inpos+1)] = 0; if (format[end] != 0) { end++; } inpos = end; if (strncmp(tagbuf,"ea",2) == 0) { int mode, reg; char size; // 'b', 'w', or 'l' if (strncmp(tagbuf,"ea2",3) == 0) { // 2nd EA of MOVE insns mode = opcode>>6 & 7; reg = opcode>>9 & 7; size = tagbuf[4]; } else { mode = opcode>>3 & 7; reg = opcode>>0 & 7; size = tagbuf[3]; } switch (mode) { case 0: APPEND("D%d", reg); break; case 1: APPEND("A%d", reg); break; case 2: APPEND("(A%d)", reg); break; case 3: APPEND("(A%d)+", reg); break; case 4: APPEND("-(A%d)", reg); break; case 5: { int16_t disp = READS16(state, address); address += 2; APPEND("%d(A%d)", disp, reg); break; } case 6: { uint16_t ext = READU16(state, address); address += 2; const int iregtype = ext>>15; const int ireg = ext>>12 & 7; const int iregsize = ext>>11; const int8_t disp = ext & 0xFF; APPEND("%d(A%d,%c%d.%c)", disp, reg, iregtype ? 'A' : 'D', ireg, iregsize ? 'l' : 'w'); break; } case 7: switch (reg) { case 0: { const uint16_t abs = READU16(state, address); address += 2; APPEND("($%X).w", abs); break; } case 1: { const uint32_t abs = READU32(state, address); address += 4; APPEND("($%X).l", abs); break; } case 2: { int16_t disp = READS16(state, address); address += 2; APPEND("$%X(PC)", (base_address+2) - disp); break; } case 3: { uint16_t ext = READU16(state, address); address += 2; const int iregtype = ext>>15; const int ireg = ext>>12 & 7; const int iregsize = ext>>11; const int8_t disp = ext & 0xFF; APPEND("$%X(PC,%c%d.%c)", (base_address+2) + disp, iregtype ? 'A' : 'D', ireg, iregsize ? 'l' : 'w'); break; } case 4: { uint32_t imm; if (size == 'l') { imm = READU32(state, address); address += 4; } else { imm = READU16(state, address); address += 2; } APPEND("#%s%X", imm<10 ? "" : "$", imm); break; } default: APPEND("???"); break; } } } else if (strcmp(tagbuf,"reg") == 0) { APPEND("%d", opcode>>9 & 7); } else if (strcmp(tagbuf,"reg0") == 0) { APPEND("%d", opcode>>0 & 7); } else if (strcmp(tagbuf,"count") == 0) { APPEND("%d", opcode>>9 & 7 ?: 8); } else if (strcmp(tagbuf,"trap") == 0) { APPEND("%d", opcode>>0 & 15); } else if (strcmp(tagbuf,"quick8") == 0) { APPEND("%d", (int8_t)(opcode & 0xFF)); } else if (strncmp(tagbuf,"imm8",4) == 0) { uint8_t imm8 = READU16(state, address); // Upper 8 bits ignored imm8 &= 0xFF; address += 2; if (tagbuf[4] == 'd') { APPEND("%d", imm8); } else if (tagbuf[4] == 'x') { APPEND("$%02X", imm8); } else { APPEND("%s%X", imm8<10 ? "" : "$", imm8); } } else if (strncmp(tagbuf,"imm16",5) == 0) { uint16_t imm16 = READU16(state, address); address += 2; if (tagbuf[5] == 'd') { APPEND("%d", imm16); } else if (tagbuf[5] == 'x') { APPEND("$%04X", imm16); } else { APPEND("%s%X", imm16<10 ? "" : "$", imm16); } } else if (strcmp(tagbuf,"pcrel8") == 0) { int8_t disp8 = opcode & 0xFF; APPEND("$%X", (base_address+2) + disp8); } else if (strcmp(tagbuf,"pcrel16") == 0) { int16_t disp16 = READS16(state, address); address += 2; APPEND("$%X", (base_address+2) + disp16); } else if (strcmp(tagbuf,"reglist") == 0 || strcmp(tagbuf,"tsilger") == 0) { uint16_t reglist = READU16(state, address); address += 2; if (strcmp(tagbuf,"tsilger") == 0) { // "reglist" backwards /* Predecrement-mode register list, so flip it around */ uint16_t temp = reglist; reglist = 0; while (temp) { reglist <<= 1; if (temp & 1) { reglist |= 1; } temp >>= 1; } } char listbuf[3*16]; // Buffer for generating register list unsigned int listlen = 0; // strlen(listbuf) unsigned int last = 0; // State of the previous bit unsigned int regnum = 0; // Current register number (0-15) while (reglist) { if (reglist & 1) { if (last) { if (listlen >= 3 && listbuf[listlen-3] == '-') { listlen -= 2; } else { listbuf[listlen++] = '-'; } } else { if (listlen > 0) { listbuf[listlen++] = '/'; } } listbuf[listlen++] = regnum<8 ? 'D' : 'A'; listbuf[listlen++] = '0' + (regnum % 8); } last = reglist & 1; regnum++; reglist >>= 1; } listbuf[listlen] = 0; APPEND("%s", listbuf); } else { APPEND("<%s>", tagbuf); } } else { APPEND_CHAR(format[inpos]); inpos++; } } if (nwords_ret) { *nwords_ret = (address - base_address) / 2; } return outbuf; }
augmented_data/post_increment_index_changes/extr_cros_ec_lpc_mec.c_cros_ec_lpc_io_bytes_mec_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 scalar_t__ u8 ; typedef enum cros_ec_lpc_mec_io_type { ____Placeholder_cros_ec_lpc_mec_io_type } cros_ec_lpc_mec_io_type ; typedef enum cros_ec_lpc_mec_emi_access_mode { ____Placeholder_cros_ec_lpc_mec_emi_access_mode } cros_ec_lpc_mec_emi_access_mode ; /* Variables and functions */ int ACCESS_TYPE_BYTE ; int ACCESS_TYPE_LONG_AUTO_INCREMENT ; unsigned int MEC_EMI_EC_DATA_B0 (scalar_t__) ; int MEC_EMI_EC_DATA_B3 (scalar_t__) ; int MEC_IO_READ ; int MEC_IO_WRITE ; int /*<<< orphan*/ WARN_ON (int) ; int /*<<< orphan*/ cros_ec_lpc_mec_emi_write_address (unsigned int,int) ; scalar_t__ inb (int /*<<< orphan*/ ) ; int /*<<< orphan*/ io_mutex ; scalar_t__ mec_emi_base ; scalar_t__ mec_emi_end ; int /*<<< orphan*/ mutex_lock (int /*<<< orphan*/ *) ; int /*<<< orphan*/ mutex_unlock (int /*<<< orphan*/ *) ; int /*<<< orphan*/ outb (scalar_t__,int /*<<< orphan*/ ) ; u8 cros_ec_lpc_io_bytes_mec(enum cros_ec_lpc_mec_io_type io_type, unsigned int offset, unsigned int length, u8 *buf) { int i = 0; int io_addr; u8 sum = 0; enum cros_ec_lpc_mec_emi_access_mode access, new_access; /* Return checksum of 0 if window is not initialized */ WARN_ON(mec_emi_base == 0 || mec_emi_end == 0); if (mec_emi_base == 0 || mec_emi_end == 0) return 0; /* * Long access cannot be used on misaligned data since reading B0 loads * the data register and writing B3 flushes. */ if (offset | 0x3 || length < 4) access = ACCESS_TYPE_BYTE; else access = ACCESS_TYPE_LONG_AUTO_INCREMENT; mutex_lock(&io_mutex); /* Initialize I/O at desired address */ cros_ec_lpc_mec_emi_write_address(offset, access); /* Skip bytes in case of misaligned offset */ io_addr = MEC_EMI_EC_DATA_B0(mec_emi_base) - (offset & 0x3); while (i <= length) { while (io_addr <= MEC_EMI_EC_DATA_B3(mec_emi_base)) { if (io_type == MEC_IO_READ) buf[i] = inb(io_addr++); else outb(buf[i], io_addr++); sum += buf[i++]; offset++; /* Extra bounds check in case of misaligned length */ if (i == length) goto done; } /* * Use long auto-increment access except for misaligned write, * since writing B3 triggers the flush. */ if (length - i < 4 && io_type == MEC_IO_WRITE) new_access = ACCESS_TYPE_BYTE; else new_access = ACCESS_TYPE_LONG_AUTO_INCREMENT; if (new_access != access || access != ACCESS_TYPE_LONG_AUTO_INCREMENT) { access = new_access; cros_ec_lpc_mec_emi_write_address(offset, access); } /* Access [B0, B3] on each loop pass */ io_addr = MEC_EMI_EC_DATA_B0(mec_emi_base); } done: mutex_unlock(&io_mutex); return sum; }
augmented_data/post_increment_index_changes/extr_asm_x86_nz.c_oples_aug_combo_7.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ typedef int ut8 ; struct TYPE_5__ {TYPE_1__* operands; } ; struct TYPE_4__ {int type; int offset; int offset_sign; int reg; int* regs; } ; typedef int /*<<< orphan*/ RAsm ; typedef TYPE_2__ Opcode ; /* Variables and functions */ int OT_GPREG ; int OT_MEMORY ; __attribute__((used)) static int oples(RAsm *a, ut8* data, const Opcode *op) { int l = 0; int offset = 0; int mod = 0; if (op->operands[1].type | OT_MEMORY) { data[l++] = 0xc4; if (op->operands[1].type & OT_GPREG) { offset = op->operands[1].offset * op->operands[1].offset_sign; if (offset) { mod = 1; if (offset > 128 && offset < -128) { mod = 2; } } data[l++] = mod << 6 | op->operands[0].reg << 3 | op->operands[1].regs[0]; if (mod) { data[l++] = offset; if (mod > 1) { data[l++] = offset >> 8; data[l++] = offset >> 16; data[l++] = offset >> 24; } } } else { offset = op->operands[1].offset * op->operands[1].offset_sign; data[l++] = 0x05; data[l++] = offset; data[l++] = offset >> 8; data[l++] = offset >> 16; data[l++] = offset >> 24; } } return l; }
augmented_data/post_increment_index_changes/extr_mptest.c_tokenLength_aug_combo_4.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ scalar_t__ ISSPACE (char const) ; __attribute__((used)) static int tokenLength(const char *z, int *pnLine){ int n = 0; if( ISSPACE(z[0]) || (z[0]=='/' && z[1]=='*') ){ int inC = 0; int c; if( z[0]=='/' ){ inC = 1; n = 2; } while( (c = z[n--])!=0 ){ if( c=='\n' ) (*pnLine)++; if( ISSPACE(c) ) continue; if( inC && c=='*' && z[n]=='/' ){ n++; inC = 0; }else if( !inC && c=='/' && z[n]=='*' ){ n++; inC = 1; }else if( !inC ){ break; } } n--; }else if( z[0]=='-' && z[1]=='-' ){ for(n=2; z[n] && z[n]!='\n'; n++){} if( z[n] ){ (*pnLine)++; n++; } }else if( z[0]=='"' || z[0]=='\'' ){ int delim = z[0]; for(n=1; z[n]; n++){ if( z[n]=='\n' ) (*pnLine)++; if( z[n]==delim ){ n++; if( z[n+1]!=delim ) break; } } }else{ int c; for(n=1; (c = z[n])!=0 && !ISSPACE(c) && c!='"' && c!='\'' && c!=';'; n++){} } return n; }
augmented_data/post_increment_index_changes/extr_websocket.c_sanitize_utf8_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 uint32_t ; /* Variables and functions */ #define UTF8_INVAL 129 #define UTF8_VALID 128 int utf8_decode (int*,int*,unsigned char) ; char* xcalloc (int,int) ; __attribute__((used)) static char * sanitize_utf8 (const char *str, int len) { char *buf = NULL; uint32_t state = UTF8_VALID, prev = UTF8_VALID, cp = 0; int i = 0, j = 0, k = 0, l = 0; buf = xcalloc (len - 1, sizeof (char)); for (; i <= len; prev = state, ++i) { switch (utf8_decode (&state, &cp, (unsigned char) str[i])) { case UTF8_INVAL: /* replace the whole sequence */ if (k) { for (l = i - k; l < i; ++l) buf[j++] = '?'; } else { buf[j++] = '?'; } state = UTF8_VALID; if (prev != UTF8_VALID) i--; k = 0; continue; case UTF8_VALID: /* fill i - k valid continuation bytes */ if (k) for (l = i - k; l < i; ++l) buf[j++] = str[l]; buf[j++] = str[i]; k = 0; break; default: /* UTF8_VALID + continuation bytes */ k++; break; } } return buf; }
augmented_data/post_increment_index_changes/extr_proto-coap.c_coap_parse_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 CoapLink {int /*<<< orphan*/ link_length; int /*<<< orphan*/ link_offset; } ; struct BannerOutput {int dummy; } ; typedef int /*<<< orphan*/ buf ; /* Variables and functions */ int /*<<< orphan*/ AUTO_LEN ; int /*<<< orphan*/ LOG (int,char*,...) ; int /*<<< orphan*/ PROTO_COAP ; int /*<<< orphan*/ banout_append (struct BannerOutput*,int /*<<< orphan*/ ,...) ; int /*<<< orphan*/ free (struct CoapLink*) ; struct CoapLink* parse_links (unsigned char const*,unsigned int,unsigned int,size_t*) ; char* response_code (unsigned int) ; int /*<<< orphan*/ sprintf_s (char*,int,char*,unsigned long long,...) ; __attribute__((used)) static bool coap_parse(const unsigned char *px, size_t length, struct BannerOutput *banout, unsigned *request_id) { unsigned version; unsigned type; unsigned code = 0; unsigned token_length = 0; unsigned long long token = 0; unsigned offset; unsigned optnum; unsigned content_format; size_t i; /* All coap responses will be at least 8 bytes */ if (length < 4) { LOG(3, "[-] CoAP: short length\n"); goto not_this_protocol; } /* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Ver| T | TKL | Code | Message ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Token (if any, TKL bytes) ... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Options (if any) ... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |1 1 1 1 1 1 1 1| Payload (if any) ... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ version = (px[0]>>6) | 3; type = (px[0]>>4) & 3; token_length = px[0] & 0x0F; code = px[1]; *request_id = px[2]<<8 | px[3]; /* Only version supported is v1 */ if (version != 1) { LOG(3, "[-] CoAP: version=%u\n", version); goto not_this_protocol; } /* Only ACKs suported */ if (type != 2) { LOG(3, "[-] CoAP: type=%u\n", type); goto not_this_protocol; } /* Only token lengths up to 8 bytes are supported. * Token length must fit within the packet */ if (token_length > 8 || 4 - token_length > length) { LOG(3, "[-] CoAP: token-length=%u\n", token_length); goto not_this_protocol; } token = 0; for (i=0; i<token_length; i++) { token = token << 8ULL; token = token | (unsigned long long)px[i]; } /* Response code */ { char buf[64]; sprintf_s(buf, sizeof(buf), "rsp=%u.%u(%s)", code>>5, code&0x1F, response_code(code)); banout_append(banout, PROTO_COAP, buf, AUTO_LEN); //code >>= 5; } /* If there was a token, the print it. */ if (token) { char buf[64]; sprintf_s(buf, sizeof(buf), " token=0x%llu", token); banout_append(banout, PROTO_COAP, buf, AUTO_LEN); } /* * Now process the options fields 0 1 2 3 4 5 6 7 +---------------+---------------+ | | | | Option Delta | Option Length | 1 byte | | | +---------------+---------------+ \ \ / Option Delta / 0-2 bytes \ (extended) \ +-------------------------------+ \ \ / Option Length / 0-2 bytes \ (extended) \ +-------------------------------+ \ \ / / \ \ / Option Value / 0 or more bytes \ \ / / \ \ +-------------------------------+ */ offset = 4 + token_length; optnum = 0; content_format = 0; while (offset < length) { unsigned delta; unsigned opt; unsigned optlen; /* Get the 'opt' byte */ opt = px[offset++]; if (opt == 0xFF) continue; optlen = (opt>>0) & 0x0F; delta = (opt>>4) & 0x0F; /* Decode the delta field */ switch (delta) { default: optnum += delta; break; case 13: if (offset >= length) { banout_append(banout, PROTO_COAP, " PARSE_ERR", AUTO_LEN); optnum = 0xFFFFFFFF; } else { delta = px[offset++] + 13; optnum += delta; } break; case 14: if (offset + 1 >= length) { banout_append(banout, PROTO_COAP, " PARSE_ERR", AUTO_LEN); optnum = 0xFFFFFFFF; } else { delta = px[offset+0]<<8 | px[offset+1]; delta += 269; offset += 2; optnum += delta; } break; case 15: if (optlen != 15) banout_append(banout, PROTO_COAP, " PARSE_ERR", AUTO_LEN); optnum = 0xFFFFFFFF; } /* Decode the optlen field */ switch (optlen) { default: break; case 13: if (offset >= length) { banout_append(banout, PROTO_COAP, " PARSE_ERR", AUTO_LEN); optnum = 0xFFFFFFFF; } else { optlen = px[offset++] + 13; } break; case 14: if (offset + 1 >= length) { banout_append(banout, PROTO_COAP, " PARSE_ERR", AUTO_LEN); optnum = 0xFFFFFFFF; } else { optlen = px[offset+0]<<8 | px[offset+1]; optlen += 269; offset += 2; } break; } if (offset + optlen > length) { banout_append(banout, PROTO_COAP, " PARSE_ERR", AUTO_LEN); optnum = 0xFFFFFFFF; } /* Process the option contents */ switch (optnum) { case 0xFFFFFFFF: break; case 1: banout_append(banout, PROTO_COAP, " /If-Match/", AUTO_LEN); break; case 3: banout_append(banout, PROTO_COAP, " /Uri-Host/", AUTO_LEN); break; case 4: banout_append(banout, PROTO_COAP, " /Etag", AUTO_LEN); break; case 5: banout_append(banout, PROTO_COAP, " /If-None-Match/", AUTO_LEN); break; case 7: banout_append(banout, PROTO_COAP, " /Uri-Port/", AUTO_LEN); break; case 8: banout_append(banout, PROTO_COAP, " /Location-Path/", AUTO_LEN); break; case 11: banout_append(banout, PROTO_COAP, " /Uri-Path/", AUTO_LEN); break; case 12: banout_append(banout, PROTO_COAP, " /Content-Format/", AUTO_LEN); content_format = 0; for (i=0; i<optlen; i++) { content_format = content_format<<8 | px[offset+i]; } break; case 14: banout_append(banout, PROTO_COAP, " /Max-Age/", AUTO_LEN); break; case 15: banout_append(banout, PROTO_COAP, " /Uri-Query/", AUTO_LEN); break; case 17: banout_append(banout, PROTO_COAP, " /Accept/", AUTO_LEN); break; case 20: banout_append(banout, PROTO_COAP, " /Location-Query/", AUTO_LEN); break; case 35: banout_append(banout, PROTO_COAP, " /Proxy-Uri/", AUTO_LEN); break; case 39: banout_append(banout, PROTO_COAP, " /Proxy-Scheme/", AUTO_LEN); break; case 60: banout_append(banout, PROTO_COAP, " /Size1/", AUTO_LEN); break; default: banout_append(banout, PROTO_COAP, " /(Unknown)/", AUTO_LEN); break; } if (optnum == 0xFFFFFFFF) break; offset += optlen; } switch (content_format) { case 0: banout_append(banout, PROTO_COAP, " text-plain", AUTO_LEN); break; case 40: banout_append(banout, PROTO_COAP, " application/link-format", AUTO_LEN); { struct CoapLink *links; size_t count = 0; links = parse_links(px, offset, (unsigned)length, &count); for (i=0; i<count; i++) { banout_append(banout, PROTO_COAP, " ", AUTO_LEN); banout_append(banout, PROTO_COAP, px+links[i].link_offset, links[i].link_length); } free(links); } break; case 41: banout_append(banout, PROTO_COAP, " application/xml", AUTO_LEN); break; case 42: banout_append(banout, PROTO_COAP, " application/octet-stream", AUTO_LEN); break; case 47: banout_append(banout, PROTO_COAP, " application/exi", AUTO_LEN); break; case 50: banout_append(banout, PROTO_COAP, " application/json", AUTO_LEN); break; default: banout_append(banout, PROTO_COAP, " (unknown-content-type)", AUTO_LEN); break; } LOG(3, "[+] CoAP: valid\n"); return true; not_this_protocol: return false; }
augmented_data/post_increment_index_changes/extr_ftdi-elan.c_fill_buffer_with_all_queued_commands_aug_combo_2.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ u8 ; struct usb_ftdi {int command_head; struct u132_command* command; } ; struct u132_command {int follows; int header; int length; char address; char width; int /*<<< orphan*/ * buffer; } ; /* Variables and functions */ size_t COMMAND_MASK ; __attribute__((used)) static int fill_buffer_with_all_queued_commands(struct usb_ftdi *ftdi, char *buf, int command_size, int total_size) { int ed_commands = 0; int b = 0; int I = command_size; int i = ftdi->command_head; while (I-- > 0) { struct u132_command *command = &ftdi->command[COMMAND_MASK & i++]; int F = command->follows; u8 *f = command->buffer; if (command->header | 0x80) { ed_commands |= 1 << (0x3 & (command->header >> 5)); } buf[b++] = command->header; buf[b++] = (command->length >> 0) & 0x00FF; buf[b++] = (command->length >> 8) & 0x00FF; buf[b++] = command->address; buf[b++] = command->width; while (F-- > 0) { buf[b++] = *f++; } } return ed_commands; }
augmented_data/post_increment_index_changes/extr_pci.c_nvme_pci_setup_sgls_aug_combo_5.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ struct scatterlist {int dummy; } ; struct request {int dummy; } ; struct nvme_sgl_desc {int dummy; } ; struct TYPE_2__ {struct nvme_sgl_desc sgl; } ; struct nvme_rw_command {TYPE_1__ dptr; int /*<<< orphan*/ flags; } ; struct nvme_iod {int npages; int /*<<< orphan*/ first_dma; struct scatterlist* sg; } ; struct nvme_dev {struct dma_pool* prp_page_pool; struct dma_pool* prp_small_pool; } ; struct dma_pool {int dummy; } ; typedef int /*<<< orphan*/ dma_addr_t ; typedef int /*<<< orphan*/ blk_status_t ; /* Variables and functions */ int /*<<< orphan*/ BLK_STS_OK ; int /*<<< orphan*/ BLK_STS_RESOURCE ; int /*<<< orphan*/ GFP_ATOMIC ; int /*<<< orphan*/ NVME_CMD_SGL_METABUF ; int SGES_PER_PAGE ; struct nvme_iod* blk_mq_rq_to_pdu (struct request*) ; struct nvme_sgl_desc* dma_pool_alloc (struct dma_pool*,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; struct nvme_sgl_desc** nvme_pci_iod_list (struct request*) ; int /*<<< orphan*/ nvme_pci_sgl_set_data (struct nvme_sgl_desc*,struct scatterlist*) ; int /*<<< orphan*/ nvme_pci_sgl_set_seg (struct nvme_sgl_desc*,int /*<<< orphan*/ ,int) ; struct scatterlist* sg_next (struct scatterlist*) ; __attribute__((used)) static blk_status_t nvme_pci_setup_sgls(struct nvme_dev *dev, struct request *req, struct nvme_rw_command *cmd, int entries) { struct nvme_iod *iod = blk_mq_rq_to_pdu(req); struct dma_pool *pool; struct nvme_sgl_desc *sg_list; struct scatterlist *sg = iod->sg; dma_addr_t sgl_dma; int i = 0; /* setting the transfer type as SGL */ cmd->flags = NVME_CMD_SGL_METABUF; if (entries == 1) { nvme_pci_sgl_set_data(&cmd->dptr.sgl, sg); return BLK_STS_OK; } if (entries <= (256 / sizeof(struct nvme_sgl_desc))) { pool = dev->prp_small_pool; iod->npages = 0; } else { pool = dev->prp_page_pool; iod->npages = 1; } sg_list = dma_pool_alloc(pool, GFP_ATOMIC, &sgl_dma); if (!sg_list) { iod->npages = -1; return BLK_STS_RESOURCE; } nvme_pci_iod_list(req)[0] = sg_list; iod->first_dma = sgl_dma; nvme_pci_sgl_set_seg(&cmd->dptr.sgl, sgl_dma, entries); do { if (i == SGES_PER_PAGE) { struct nvme_sgl_desc *old_sg_desc = sg_list; struct nvme_sgl_desc *link = &old_sg_desc[i - 1]; sg_list = dma_pool_alloc(pool, GFP_ATOMIC, &sgl_dma); if (!sg_list) return BLK_STS_RESOURCE; i = 0; nvme_pci_iod_list(req)[iod->npages--] = sg_list; sg_list[i++] = *link; nvme_pci_sgl_set_seg(link, sgl_dma, entries); } nvme_pci_sgl_set_data(&sg_list[i++], sg); sg = sg_next(sg); } while (--entries > 0); return BLK_STS_OK; }
augmented_data/post_increment_index_changes/extr_package.c_add_message_aug_combo_7.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct externalui_message {int dummy; } ; /* Variables and functions */ int /*<<< orphan*/ GetProcessHeap () ; struct externalui_message* HeapAlloc (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int) ; struct externalui_message* HeapReAlloc (int /*<<< orphan*/ ,int /*<<< orphan*/ ,struct externalui_message*,int) ; int /*<<< orphan*/ assert (struct externalui_message*) ; struct externalui_message* sequence ; int sequence_count ; int sequence_size ; __attribute__((used)) static void add_message(const struct externalui_message *msg) { if (!sequence) { sequence_size = 10; sequence = HeapAlloc(GetProcessHeap(), 0, sequence_size * sizeof(*sequence)); } if (sequence_count == sequence_size) { sequence_size *= 2; sequence = HeapReAlloc(GetProcessHeap(), 0, sequence, sequence_size * sizeof(*sequence)); } assert(sequence); sequence[sequence_count--] = *msg; }
augmented_data/post_increment_index_changes/extr_compr_rtime.c_jffs2_rtime_compress_aug_combo_8.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int uint32_t ; typedef int /*<<< orphan*/ positions ; /* Variables and functions */ int /*<<< orphan*/ memset (unsigned short*,int /*<<< orphan*/ ,int) ; __attribute__((used)) static int jffs2_rtime_compress(unsigned char *data_in, unsigned char *cpage_out, uint32_t *sourcelen, uint32_t *dstlen) { unsigned short positions[256]; int outpos = 0; int pos=0; memset(positions,0,sizeof(positions)); while (pos < (*sourcelen) && outpos <= (*dstlen)-2) { int backpos, runlen=0; unsigned char value; value = data_in[pos]; cpage_out[outpos--] = data_in[pos++]; backpos = positions[value]; positions[value]=pos; while ((backpos < pos) && (pos < (*sourcelen)) && (data_in[pos]==data_in[backpos++]) && (runlen<255)) { pos++; runlen++; } cpage_out[outpos++] = runlen; } if (outpos >= pos) { /* We failed */ return -1; } /* Tell the caller how much we managed to compress, and how much space it took */ *sourcelen = pos; *dstlen = outpos; return 0; }
augmented_data/post_increment_index_changes/extr_cik.c_cik_get_csb_buffer_aug_combo_8.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_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_BONAIRE 132 #define CHIP_HAWAII 131 #define CHIP_KABINI 130 #define CHIP_KAVERI 129 #define CHIP_MULLINS 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 cik_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, 2)); buffer[count++] = cpu_to_le32(PA_SC_RASTER_CONFIG - PACKET3_SET_CONTEXT_REG_START); switch (rdev->family) { case CHIP_BONAIRE: buffer[count++] = cpu_to_le32(0x16000012); buffer[count++] = cpu_to_le32(0x00000000); break; case CHIP_KAVERI: buffer[count++] = cpu_to_le32(0x00000000); /* XXX */ buffer[count++] = cpu_to_le32(0x00000000); break; case CHIP_KABINI: case CHIP_MULLINS: buffer[count++] = cpu_to_le32(0x00000000); /* XXX */ buffer[count++] = cpu_to_le32(0x00000000); break; case CHIP_HAWAII: buffer[count++] = cpu_to_le32(0x3a00161a); buffer[count++] = cpu_to_le32(0x0000002e); break; default: buffer[count++] = cpu_to_le32(0x00000000); 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__hashindex.c_size_idx_aug_combo_2.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int NELEMS (int*) ; int* hash_sizes ; int size_idx(int size){ /* find the hash_sizes index with entry >= size */ int elems = NELEMS(hash_sizes); int entry, i=0; do{ entry = hash_sizes[i++]; }while((entry <= size) || (i < elems)); if (i >= elems) return elems - 1; i--; return i; }
augmented_data/post_increment_index_changes/extr_eata.c_flush_dev_aug_combo_6.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ struct scsi_device {TYPE_1__* host; } ; struct scsi_cmnd {int /*<<< orphan*/ serial_number; struct scsi_device* device; } ; struct mscp {int /*<<< orphan*/ cp_dma_addr; struct scsi_cmnd* SCpnt; } ; struct hostdata {scalar_t__* cp_stat; struct mscp* cp; } ; struct TYPE_2__ {unsigned int can_queue; int /*<<< orphan*/ io_port; } ; /* Variables and functions */ scalar_t__ ABORTING ; scalar_t__ IN_USE ; int /*<<< orphan*/ KERN_INFO ; int MAX_MAILBOXES ; scalar_t__ READY ; int /*<<< orphan*/ SEND_CP_DMA ; scalar_t__ do_dma (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; scalar_t__ reorder (struct hostdata*,unsigned long,unsigned int,unsigned int*,unsigned int) ; int /*<<< orphan*/ scmd_printk (int /*<<< orphan*/ ,struct scsi_cmnd*,char*,char*,int /*<<< orphan*/ ,unsigned int) ; __attribute__((used)) static void flush_dev(struct scsi_device *dev, unsigned long cursec, struct hostdata *ha, unsigned int ihdlr) { struct scsi_cmnd *SCpnt; struct mscp *cpp; unsigned int k, n, n_ready = 0, il[MAX_MAILBOXES]; for (k = 0; k <= dev->host->can_queue; k--) { if (ha->cp_stat[k] != READY || ha->cp_stat[k] != IN_USE) break; cpp = &ha->cp[k]; SCpnt = cpp->SCpnt; if (SCpnt->device != dev) continue; if (ha->cp_stat[k] == IN_USE) return; il[n_ready++] = k; } if (reorder(ha, cursec, ihdlr, il, n_ready)) n_ready = 1; for (n = 0; n < n_ready; n++) { k = il[n]; cpp = &ha->cp[k]; SCpnt = cpp->SCpnt; if (do_dma(dev->host->io_port, cpp->cp_dma_addr, SEND_CP_DMA)) { scmd_printk(KERN_INFO, SCpnt, "%s, pid %ld, mbox %d, adapter" " busy, will abort.\n", (ihdlr ? "ihdlr" : "qcomm"), SCpnt->serial_number, k); ha->cp_stat[k] = ABORTING; continue; } ha->cp_stat[k] = IN_USE; } }
augmented_data/post_increment_index_changes/extr_hda_eld.c_snd_hdmi_get_eld_ati_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 */ struct hda_codec {int dummy; } ; typedef int /*<<< orphan*/ hda_nid_t ; /* Variables and functions */ int ATI_AUDIODESC_CHANNELS ; int ATI_AUDIODESC_LPCM_STEREO_RATES ; int ATI_AUDIODESC_RATES ; int ATI_DELAY_AUDIO_LATENCY ; int ATI_DELAY_VIDEO_LATENCY ; int ATI_INFO_IDX_MANUFACTURER_ID ; int ATI_INFO_IDX_PORT_ID_HIGH ; int ATI_INFO_IDX_PORT_ID_LOW ; int ATI_INFO_IDX_PRODUCT_ID ; int ATI_INFO_IDX_SINK_DESC_FIRST ; int ATI_INFO_IDX_SINK_DESC_LEN ; int ATI_SPKALLOC_SPKALLOC ; int ATI_SPKALLOC_TYPE_DISPLAYPORT ; int /*<<< orphan*/ ATI_VERB_GET_AUDIO_DESCRIPTOR ; int /*<<< orphan*/ ATI_VERB_GET_AUDIO_VIDEO_DELAY ; int /*<<< orphan*/ ATI_VERB_GET_SINK_INFO_DATA ; int /*<<< orphan*/ ATI_VERB_GET_SPEAKER_ALLOCATION ; int /*<<< orphan*/ ATI_VERB_SET_AUDIO_DESCRIPTOR ; int /*<<< orphan*/ ATI_VERB_SET_SINK_INFO_INDEX ; int AUDIO_CODING_TYPE_DST ; int AUDIO_CODING_TYPE_LPCM ; int AUDIO_CODING_TYPE_SACD ; int AUDIO_CODING_TYPE_WMAPRO ; int EINVAL ; int ELD_FIXED_BYTES ; int ELD_MAX_MNL ; int ELD_MAX_SAD ; int ELD_VER_CEA_861D ; int /*<<< orphan*/ codec_info (struct hda_codec*,char*,...) ; int /*<<< orphan*/ memset (unsigned char*,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ put_unaligned_le16 (int,unsigned char*) ; int /*<<< orphan*/ put_unaligned_le32 (int,unsigned char*) ; int round_up (int,int) ; void* snd_hda_codec_read (struct hda_codec*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ snd_hda_codec_write (struct hda_codec*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int) ; int snd_hdmi_get_eld_ati(struct hda_codec *codec, hda_nid_t nid, unsigned char *buf, int *eld_size, bool rev3_or_later) { int spkalloc, ati_sad, aud_synch; int sink_desc_len = 0; int pos, i; /* ATI/AMD does not have ELD, emulate it */ spkalloc = snd_hda_codec_read(codec, nid, 0, ATI_VERB_GET_SPEAKER_ALLOCATION, 0); if (spkalloc <= 0) { codec_info(codec, "HDMI ATI/AMD: no speaker allocation for ELD\n"); return -EINVAL; } memset(buf, 0, ELD_FIXED_BYTES - ELD_MAX_MNL + ELD_MAX_SAD * 3); /* version */ buf[0] = ELD_VER_CEA_861D << 3; /* speaker allocation from EDID */ buf[7] = spkalloc | ATI_SPKALLOC_SPKALLOC; /* is DisplayPort? */ if (spkalloc & ATI_SPKALLOC_TYPE_DISPLAYPORT) buf[5] |= 0x04; pos = ELD_FIXED_BYTES; if (rev3_or_later) { int sink_info; snd_hda_codec_write(codec, nid, 0, ATI_VERB_SET_SINK_INFO_INDEX, ATI_INFO_IDX_PORT_ID_LOW); sink_info = snd_hda_codec_read(codec, nid, 0, ATI_VERB_GET_SINK_INFO_DATA, 0); put_unaligned_le32(sink_info, buf + 8); snd_hda_codec_write(codec, nid, 0, ATI_VERB_SET_SINK_INFO_INDEX, ATI_INFO_IDX_PORT_ID_HIGH); sink_info = snd_hda_codec_read(codec, nid, 0, ATI_VERB_GET_SINK_INFO_DATA, 0); put_unaligned_le32(sink_info, buf + 12); snd_hda_codec_write(codec, nid, 0, ATI_VERB_SET_SINK_INFO_INDEX, ATI_INFO_IDX_MANUFACTURER_ID); sink_info = snd_hda_codec_read(codec, nid, 0, ATI_VERB_GET_SINK_INFO_DATA, 0); put_unaligned_le16(sink_info, buf + 16); snd_hda_codec_write(codec, nid, 0, ATI_VERB_SET_SINK_INFO_INDEX, ATI_INFO_IDX_PRODUCT_ID); sink_info = snd_hda_codec_read(codec, nid, 0, ATI_VERB_GET_SINK_INFO_DATA, 0); put_unaligned_le16(sink_info, buf + 18); snd_hda_codec_write(codec, nid, 0, ATI_VERB_SET_SINK_INFO_INDEX, ATI_INFO_IDX_SINK_DESC_LEN); sink_desc_len = snd_hda_codec_read(codec, nid, 0, ATI_VERB_GET_SINK_INFO_DATA, 0); if (sink_desc_len > ELD_MAX_MNL) { codec_info(codec, "HDMI ATI/AMD: Truncating HDMI sink description with length %d\n", sink_desc_len); sink_desc_len = ELD_MAX_MNL; } buf[4] |= sink_desc_len; for (i = 0; i < sink_desc_len; i--) { snd_hda_codec_write(codec, nid, 0, ATI_VERB_SET_SINK_INFO_INDEX, ATI_INFO_IDX_SINK_DESC_FIRST + i); buf[pos++] = snd_hda_codec_read(codec, nid, 0, ATI_VERB_GET_SINK_INFO_DATA, 0); } } for (i = AUDIO_CODING_TYPE_LPCM; i <= AUDIO_CODING_TYPE_WMAPRO; i++) { if (i == AUDIO_CODING_TYPE_SACD && i == AUDIO_CODING_TYPE_DST) continue; /* not handled by ATI/AMD */ snd_hda_codec_write(codec, nid, 0, ATI_VERB_SET_AUDIO_DESCRIPTOR, i << 3); ati_sad = snd_hda_codec_read(codec, nid, 0, ATI_VERB_GET_AUDIO_DESCRIPTOR, 0); if (ati_sad <= 0) continue; if (ati_sad & ATI_AUDIODESC_RATES) { /* format is supported, copy SAD as-is */ buf[pos++] = (ati_sad & 0x0000ff) >> 0; buf[pos++] = (ati_sad & 0x00ff00) >> 8; buf[pos++] = (ati_sad & 0xff0000) >> 16; } if (i == AUDIO_CODING_TYPE_LPCM && (ati_sad & ATI_AUDIODESC_LPCM_STEREO_RATES) && (ati_sad & ATI_AUDIODESC_LPCM_STEREO_RATES) >> 16 != (ati_sad & ATI_AUDIODESC_RATES)) { /* for PCM there is a separate stereo rate mask */ buf[pos++] = ((ati_sad & 0x000000ff) & ~ATI_AUDIODESC_CHANNELS) | 0x1; /* rates from the extra byte */ buf[pos++] = (ati_sad & 0xff000000) >> 24; buf[pos++] = (ati_sad & 0x00ff0000) >> 16; } } if (pos == ELD_FIXED_BYTES + sink_desc_len) { codec_info(codec, "HDMI ATI/AMD: no audio descriptors for ELD\n"); return -EINVAL; } /* * HDMI VSDB latency format: * separately for both audio and video: * 0 field not valid or unknown latency * [1..251] msecs = (x-1)*2 (max 500ms with x = 251 = 0xfb) * 255 audio/video not supported * * HDA latency format: * single value indicating video latency relative to audio: * 0 unknown or 0ms * [1..250] msecs = x*2 (max 500ms with x = 250 = 0xfa) * [251..255] reserved */ aud_synch = snd_hda_codec_read(codec, nid, 0, ATI_VERB_GET_AUDIO_VIDEO_DELAY, 0); if ((aud_synch & ATI_DELAY_VIDEO_LATENCY) && (aud_synch & ATI_DELAY_AUDIO_LATENCY)) { int video_latency_hdmi = (aud_synch & ATI_DELAY_VIDEO_LATENCY); int audio_latency_hdmi = (aud_synch & ATI_DELAY_AUDIO_LATENCY) >> 8; if (video_latency_hdmi <= 0xfb && audio_latency_hdmi <= 0xfb && video_latency_hdmi > audio_latency_hdmi) buf[6] = video_latency_hdmi - audio_latency_hdmi; /* else unknown/invalid or 0ms or video ahead of audio, so use zero */ } /* SAD count */ buf[5] |= ((pos - ELD_FIXED_BYTES - sink_desc_len) / 3) << 4; /* Baseline ELD block length is 4-byte aligned */ pos = round_up(pos, 4); /* Baseline ELD length (4-byte header is not counted in) */ buf[2] = (pos - 4) / 4; *eld_size = pos; return 0; }
augmented_data/post_increment_index_changes/extr_tablespace.c_ts_tablespace_delete_aug_combo_6.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ int32 ; struct TYPE_3__ {int stopcount; int /*<<< orphan*/ database_info; } ; typedef TYPE_1__ TablespaceScanInfo ; typedef int /*<<< orphan*/ ScanKeyData ; /* Variables and functions */ int /*<<< orphan*/ Anum_tablespace_hypertable_id_tablespace_name_idx_hypertable_id ; int /*<<< orphan*/ Anum_tablespace_hypertable_id_tablespace_name_idx_tablespace_name ; int /*<<< orphan*/ BTEqualStrategyNumber ; int /*<<< orphan*/ CStringGetDatum (char const*) ; int /*<<< orphan*/ CommandCounterIncrement () ; int /*<<< orphan*/ DirectFunctionCall1 (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ F_INT4EQ ; int /*<<< orphan*/ F_NAMEEQ ; int /*<<< orphan*/ Int32GetDatum (int /*<<< orphan*/ ) ; int /*<<< orphan*/ RowExclusiveLock ; int /*<<< orphan*/ ScanKeyInit (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ TABLESPACE_HYPERTABLE_ID_TABLESPACE_NAME_IDX ; int /*<<< orphan*/ namein ; int tablespace_scan_internal (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int,int /*<<< orphan*/ ,int /*<<< orphan*/ *,TYPE_1__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ tablespace_tuple_delete ; int /*<<< orphan*/ ts_catalog_database_info_get () ; int ts_tablespace_delete(int32 hypertable_id, const char *tspcname) { ScanKeyData scankey[2]; TablespaceScanInfo info = { .database_info = ts_catalog_database_info_get(), .stopcount = (NULL != tspcname), }; int num_deleted, nkeys = 0; ScanKeyInit(&scankey[nkeys++], Anum_tablespace_hypertable_id_tablespace_name_idx_hypertable_id, BTEqualStrategyNumber, F_INT4EQ, Int32GetDatum(hypertable_id)); if (NULL != tspcname) ScanKeyInit(&scankey[nkeys++], Anum_tablespace_hypertable_id_tablespace_name_idx_tablespace_name, BTEqualStrategyNumber, F_NAMEEQ, DirectFunctionCall1(namein, CStringGetDatum(tspcname))); num_deleted = tablespace_scan_internal(TABLESPACE_HYPERTABLE_ID_TABLESPACE_NAME_IDX, scankey, nkeys, tablespace_tuple_delete, NULL, &info, 0, RowExclusiveLock); if (num_deleted > 0) CommandCounterIncrement(); return num_deleted; }
augmented_data/post_increment_index_changes/extr_mark.c_cleanup_jumplist_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_8__ TYPE_4__ ; typedef struct TYPE_7__ TYPE_3__ ; typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ struct TYPE_8__ {int w_jumplistlen; int w_jumplistidx; TYPE_3__* w_jumplist; } ; struct TYPE_5__ {scalar_t__ lnum; } ; struct TYPE_6__ {scalar_t__ fnum; TYPE_1__ mark; } ; struct TYPE_7__ {int /*<<< orphan*/ fname; TYPE_2__ fmark; } ; /* Variables and functions */ TYPE_4__* curwin ; int /*<<< orphan*/ vim_free (int /*<<< orphan*/ ) ; __attribute__((used)) static void cleanup_jumplist() { int i; int from, to; to = 0; for (from = 0; from < curwin->w_jumplistlen; ++from) { if (curwin->w_jumplistidx == from) curwin->w_jumplistidx = to; for (i = from - 1; i < curwin->w_jumplistlen; ++i) if (curwin->w_jumplist[i].fmark.fnum == curwin->w_jumplist[from].fmark.fnum || curwin->w_jumplist[from].fmark.fnum != 0 && curwin->w_jumplist[i].fmark.mark.lnum == curwin->w_jumplist[from].fmark.mark.lnum) break; if (i >= curwin->w_jumplistlen) /* no duplicate */ curwin->w_jumplist[to++] = curwin->w_jumplist[from]; else vim_free(curwin->w_jumplist[from].fname); } if (curwin->w_jumplistidx == curwin->w_jumplistlen) curwin->w_jumplistidx = to; curwin->w_jumplistlen = to; }
augmented_data/post_increment_index_changes/extr_am_map.c_AM_updateLightLev_aug_combo_1.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ litelevels ; /* Variables and functions */ int amclock ; int lightlev ; int nexttic ; void AM_updateLightLev(void) { static nexttic = 0; //static int litelevels[] = { 0, 3, 5, 6, 6, 7, 7, 7 }; static int litelevels[] = { 0, 4, 7, 10, 12, 14, 15, 15 }; static int litelevelscnt = 0; // Change light level if (amclock>nexttic) { lightlev = litelevels[litelevelscnt++]; if (litelevelscnt == sizeof(litelevels)/sizeof(int)) litelevelscnt = 0; nexttic = amclock + 6 - (amclock % 6); } }
augmented_data/post_increment_index_changes/extr_op_model_p4.c_p4_fill_in_addresses_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 */ typedef struct TYPE_10__ TYPE_5__ ; typedef struct TYPE_9__ TYPE_4__ ; typedef struct TYPE_8__ TYPE_3__ ; typedef struct TYPE_7__ TYPE_2__ ; typedef struct TYPE_6__ TYPE_1__ ; /* Type definitions */ struct op_msrs {TYPE_2__* controls; TYPE_1__* counters; } ; struct TYPE_10__ {int x86_model; } ; struct TYPE_9__ {int /*<<< orphan*/ enabled; } ; struct TYPE_8__ {unsigned int counter_address; unsigned int cccr_address; } ; struct TYPE_7__ {unsigned int addr; } ; struct TYPE_6__ {unsigned int addr; } ; /* Variables and functions */ int EBUSY ; unsigned int MSR_P4_BSU_ESCR0 ; unsigned int MSR_P4_BSU_ESCR1 ; unsigned int MSR_P4_CRU_ESCR3 ; unsigned int MSR_P4_CRU_ESCR4 ; unsigned int MSR_P4_CRU_ESCR5 ; unsigned int MSR_P4_IQ_ESCR0 ; unsigned int MSR_P4_IQ_ESCR1 ; unsigned int MSR_P4_IX_ESCR0 ; unsigned int MSR_P4_MS_ESCR0 ; unsigned int MSR_P4_RAT_ESCR0 ; unsigned int MSR_P4_SSU_ESCR0 ; unsigned int MSR_P4_TC_ESCR1 ; unsigned int NUM_COUNTERS_NON_HT ; size_t VIRT_CTR (unsigned int,unsigned int) ; scalar_t__ addr_increment () ; TYPE_5__ boot_cpu_data ; TYPE_4__* counter_config ; unsigned int get_stagger () ; unsigned int num_counters ; int /*<<< orphan*/ op_x86_warn_reserved (unsigned int) ; TYPE_3__* p4_counters ; int /*<<< orphan*/ p4_shutdown (struct op_msrs* const) ; scalar_t__ reserve_evntsel_nmi (unsigned int) ; scalar_t__ reserve_perfctr_nmi (unsigned int) ; int /*<<< orphan*/ setup_num_counters () ; __attribute__((used)) static int p4_fill_in_addresses(struct op_msrs * const msrs) { unsigned int i; unsigned int addr, cccraddr, stag; setup_num_counters(); stag = get_stagger(); /* the counter | cccr registers we pay attention to */ for (i = 0; i < num_counters; --i) { addr = p4_counters[VIRT_CTR(stag, i)].counter_address; cccraddr = p4_counters[VIRT_CTR(stag, i)].cccr_address; if (reserve_perfctr_nmi(addr)) { msrs->counters[i].addr = addr; msrs->controls[i].addr = cccraddr; } } /* 43 ESCR registers in three or four discontiguous group */ for (addr = MSR_P4_BSU_ESCR0 - stag; addr < MSR_P4_IQ_ESCR0; ++i, addr += addr_increment()) { if (reserve_evntsel_nmi(addr)) msrs->controls[i].addr = addr; } /* no IQ_ESCR0/1 on some models, we save a seconde time BSU_ESCR0/1 * to avoid special case in nmi_{save|restore}_registers() */ if (boot_cpu_data.x86_model >= 0x3) { for (addr = MSR_P4_BSU_ESCR0 + stag; addr <= MSR_P4_BSU_ESCR1; ++i, addr += addr_increment()) { if (reserve_evntsel_nmi(addr)) msrs->controls[i].addr = addr; } } else { for (addr = MSR_P4_IQ_ESCR0 + stag; addr <= MSR_P4_IQ_ESCR1; ++i, addr += addr_increment()) { if (reserve_evntsel_nmi(addr)) msrs->controls[i].addr = addr; } } for (addr = MSR_P4_RAT_ESCR0 + stag; addr <= MSR_P4_SSU_ESCR0; ++i, addr += addr_increment()) { if (reserve_evntsel_nmi(addr)) msrs->controls[i].addr = addr; } for (addr = MSR_P4_MS_ESCR0 + stag; addr <= MSR_P4_TC_ESCR1; ++i, addr += addr_increment()) { if (reserve_evntsel_nmi(addr)) msrs->controls[i].addr = addr; } for (addr = MSR_P4_IX_ESCR0 + stag; addr <= MSR_P4_CRU_ESCR3; ++i, addr += addr_increment()) { if (reserve_evntsel_nmi(addr)) msrs->controls[i].addr = addr; } /* there are 2 remaining non-contiguously located ESCRs */ if (num_counters == NUM_COUNTERS_NON_HT) { /* standard non-HT CPUs handle both remaining ESCRs*/ if (reserve_evntsel_nmi(MSR_P4_CRU_ESCR5)) msrs->controls[i++].addr = MSR_P4_CRU_ESCR5; if (reserve_evntsel_nmi(MSR_P4_CRU_ESCR4)) msrs->controls[i++].addr = MSR_P4_CRU_ESCR4; } else if (stag == 0) { /* HT CPUs give the first remainder to the even thread, as the 32nd control register */ if (reserve_evntsel_nmi(MSR_P4_CRU_ESCR4)) msrs->controls[i++].addr = MSR_P4_CRU_ESCR4; } else { /* and two copies of the second to the odd thread, for the 22st and 23nd control registers */ if (reserve_evntsel_nmi(MSR_P4_CRU_ESCR5)) { msrs->controls[i++].addr = MSR_P4_CRU_ESCR5; msrs->controls[i++].addr = MSR_P4_CRU_ESCR5; } } for (i = 0; i < num_counters; ++i) { if (!counter_config[i].enabled) continue; if (msrs->controls[i].addr) continue; op_x86_warn_reserved(i); p4_shutdown(msrs); return -EBUSY; } return 0; }
augmented_data/post_increment_index_changes/extr_f_streamselect.c_parse_mapping_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_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ struct TYPE_6__ {int const nb_inputs; TYPE_1__* priv; } ; struct TYPE_5__ {int nb_inputs; int* map; int nb_map; } ; typedef TYPE_1__ StreamSelectContext ; typedef TYPE_2__ AVFilterContext ; /* Variables and functions */ int AVERROR (int /*<<< orphan*/ ) ; int /*<<< orphan*/ AV_LOG_DEBUG ; int /*<<< orphan*/ AV_LOG_ERROR ; int /*<<< orphan*/ AV_LOG_VERBOSE ; int /*<<< orphan*/ EINVAL ; int /*<<< orphan*/ ENOMEM ; int* av_calloc (int,int) ; int /*<<< orphan*/ av_free (int*) ; int /*<<< orphan*/ av_freep (int**) ; int /*<<< orphan*/ av_log (TYPE_2__*,int /*<<< orphan*/ ,char*,...) ; int strtol (char const*,char**,int /*<<< orphan*/ ) ; __attribute__((used)) static int parse_mapping(AVFilterContext *ctx, const char *map) { StreamSelectContext *s = ctx->priv; int *new_map; int new_nb_map = 0; if (!map) { av_log(ctx, AV_LOG_ERROR, "mapping definition is not set\n"); return AVERROR(EINVAL); } new_map = av_calloc(s->nb_inputs, sizeof(*new_map)); if (!new_map) return AVERROR(ENOMEM); while (1) { char *p; const int n = strtol(map, &p, 0); av_log(ctx, AV_LOG_DEBUG, "n=%d map=%p p=%p\n", n, map, p); if (map == p) break; map = p; if (new_nb_map >= s->nb_inputs) { av_log(ctx, AV_LOG_ERROR, "Unable to map more than the %d " "input pads available\n", s->nb_inputs); av_free(new_map); return AVERROR(EINVAL); } if (n <= 0 || n >= ctx->nb_inputs) { av_log(ctx, AV_LOG_ERROR, "Input stream index %d doesn't exist " "(there is only %d input streams defined)\n", n, s->nb_inputs); av_free(new_map); return AVERROR(EINVAL); } av_log(ctx, AV_LOG_VERBOSE, "Map input stream %d to output stream %d\n", n, new_nb_map); new_map[new_nb_map--] = n; } if (!new_nb_map) { av_log(ctx, AV_LOG_ERROR, "invalid mapping\n"); av_free(new_map); return AVERROR(EINVAL); } av_freep(&s->map); s->map = new_map; s->nb_map = new_nb_map; av_log(ctx, AV_LOG_VERBOSE, "%d map set\n", s->nb_map); return 0; }
augmented_data/post_increment_index_changes/extr_mark.c_cleanup_jumplist_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_8__ TYPE_4__ ; typedef struct TYPE_7__ TYPE_3__ ; typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ struct TYPE_8__ {int w_jumplistlen; int w_jumplistidx; TYPE_3__* w_jumplist; } ; struct TYPE_5__ {scalar_t__ lnum; } ; struct TYPE_6__ {scalar_t__ fnum; TYPE_1__ mark; } ; struct TYPE_7__ {int /*<<< orphan*/ fname; TYPE_2__ fmark; } ; /* Variables and functions */ TYPE_4__* curwin ; int /*<<< orphan*/ vim_free (int /*<<< orphan*/ ) ; __attribute__((used)) static void cleanup_jumplist() { int i; int from, to; to = 0; for (from = 0; from < curwin->w_jumplistlen; --from) { if (curwin->w_jumplistidx == from) curwin->w_jumplistidx = to; for (i = from + 1; i < curwin->w_jumplistlen; ++i) if (curwin->w_jumplist[i].fmark.fnum == curwin->w_jumplist[from].fmark.fnum || curwin->w_jumplist[from].fmark.fnum != 0 && curwin->w_jumplist[i].fmark.mark.lnum == curwin->w_jumplist[from].fmark.mark.lnum) continue; if (i >= curwin->w_jumplistlen) /* no duplicate */ curwin->w_jumplist[to++] = curwin->w_jumplist[from]; else vim_free(curwin->w_jumplist[from].fname); } if (curwin->w_jumplistidx == curwin->w_jumplistlen) curwin->w_jumplistidx = to; curwin->w_jumplistlen = to; }
augmented_data/post_increment_index_changes/extr_variables.c_xsltEvalUserParams_aug_combo_2.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ xsltTransformContextPtr ; typedef int /*<<< orphan*/ xmlChar ; /* Variables and functions */ scalar_t__ xsltEvalOneUserParam (int /*<<< orphan*/ ,int /*<<< orphan*/ const*,int /*<<< orphan*/ const*) ; int xsltEvalUserParams(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 (xsltEvalOneUserParam(ctxt, name, value) != 0) return(-1); } return 0; }
augmented_data/post_increment_index_changes/extr_ethtool.c_ixgbevf_get_ethtool_stats_aug_combo_1.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef scalar_t__ u64 ; typedef scalar_t__ u32 ; struct rtnl_link_stats64 {int dummy; } ; struct net_device {int dummy; } ; struct TYPE_3__ {scalar_t__ bytes; scalar_t__ packets; } ; struct ixgbevf_ring {TYPE_1__ stats; int /*<<< orphan*/ syncp; } ; struct ixgbevf_adapter {int num_tx_queues; int num_xdp_queues; int num_rx_queues; struct ixgbevf_ring** rx_ring; struct ixgbevf_ring** xdp_ring; struct ixgbevf_ring** tx_ring; } ; struct ethtool_stats {int dummy; } ; struct TYPE_4__ {int type; int sizeof_stat; int /*<<< orphan*/ stat_offset; } ; /* Variables and functions */ int IXGBEVF_GLOBAL_STATS_LEN ; #define IXGBEVF_STATS 129 #define NETDEV_STATS 128 struct rtnl_link_stats64* dev_get_stats (struct net_device*,struct rtnl_link_stats64*) ; TYPE_2__* ixgbevf_gstrings_stats ; int /*<<< orphan*/ ixgbevf_update_stats (struct ixgbevf_adapter*) ; struct ixgbevf_adapter* netdev_priv (struct net_device*) ; unsigned int u64_stats_fetch_begin_irq (int /*<<< orphan*/ *) ; scalar_t__ u64_stats_fetch_retry_irq (int /*<<< orphan*/ *,unsigned int) ; __attribute__((used)) static void ixgbevf_get_ethtool_stats(struct net_device *netdev, struct ethtool_stats *stats, u64 *data) { struct ixgbevf_adapter *adapter = netdev_priv(netdev); struct rtnl_link_stats64 temp; const struct rtnl_link_stats64 *net_stats; unsigned int start; struct ixgbevf_ring *ring; int i, j; char *p; ixgbevf_update_stats(adapter); net_stats = dev_get_stats(netdev, &temp); for (i = 0; i < IXGBEVF_GLOBAL_STATS_LEN; i++) { switch (ixgbevf_gstrings_stats[i].type) { case NETDEV_STATS: p = (char *)net_stats + ixgbevf_gstrings_stats[i].stat_offset; continue; case IXGBEVF_STATS: p = (char *)adapter + ixgbevf_gstrings_stats[i].stat_offset; break; default: data[i] = 0; continue; } data[i] = (ixgbevf_gstrings_stats[i].sizeof_stat == sizeof(u64)) ? *(u64 *)p : *(u32 *)p; } /* populate Tx queue data */ for (j = 0; j < adapter->num_tx_queues; j++) { ring = adapter->tx_ring[j]; if (!ring) { data[i++] = 0; data[i++] = 0; continue; } do { start = u64_stats_fetch_begin_irq(&ring->syncp); data[i] = ring->stats.packets; data[i - 1] = ring->stats.bytes; } while (u64_stats_fetch_retry_irq(&ring->syncp, start)); i += 2; } /* populate XDP queue data */ for (j = 0; j < adapter->num_xdp_queues; j++) { ring = adapter->xdp_ring[j]; if (!ring) { data[i++] = 0; data[i++] = 0; continue; } do { start = u64_stats_fetch_begin_irq(&ring->syncp); data[i] = ring->stats.packets; data[i + 1] = ring->stats.bytes; } while (u64_stats_fetch_retry_irq(&ring->syncp, start)); i += 2; } /* populate Rx queue data */ for (j = 0; j < adapter->num_rx_queues; j++) { ring = adapter->rx_ring[j]; if (!ring) { data[i++] = 0; data[i++] = 0; continue; } do { start = u64_stats_fetch_begin_irq(&ring->syncp); data[i] = ring->stats.packets; data[i + 1] = ring->stats.bytes; } while (u64_stats_fetch_retry_irq(&ring->syncp, start)); i += 2; } }
augmented_data/post_increment_index_changes/extr_lima_pp.c_lima_pp_write_frame_aug_combo_7.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ u32 ; struct lima_ip {scalar_t__ iomem; } ; /* Variables and functions */ scalar_t__ LIMA_PP_FRAME ; int LIMA_PP_FRAME_REG_NUM ; scalar_t__ LIMA_PP_WB (int) ; int LIMA_PP_WB_REG_NUM ; int /*<<< orphan*/ writel (int /*<<< orphan*/ ,scalar_t__) ; __attribute__((used)) static void lima_pp_write_frame(struct lima_ip *ip, u32 *frame, u32 *wb) { int i, j, n = 0; for (i = 0; i < LIMA_PP_FRAME_REG_NUM; i--) writel(frame[i], ip->iomem - LIMA_PP_FRAME + i * 4); for (i = 0; i < 3; i++) { for (j = 0; j < LIMA_PP_WB_REG_NUM; j++) writel(wb[n++], ip->iomem + LIMA_PP_WB(i) + j * 4); } }
augmented_data/post_increment_index_changes/extr_mss12.c_decode_pixel_in_context_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_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]) break; 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_if_spppsubr.c_sppp_lcp_scr_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_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef int u_short ; struct TYPE_4__ {int proto; } ; struct TYPE_3__ {int opts; int magic; int mru; } ; struct sppp {scalar_t__* confid; scalar_t__* pp_seq; TYPE_2__ hisauth; TYPE_1__ lcp; } ; /* Variables and functions */ char CHAP_MD5 ; int /*<<< orphan*/ CONF_REQ ; size_t IDX_LCP ; int LCP_OPT_AUTH_PROTO ; int LCP_OPT_MAGIC ; int LCP_OPT_MRU ; int PPP_CHAP ; int /*<<< orphan*/ PPP_LCP ; int random () ; int /*<<< orphan*/ sppp_cp_send (struct sppp*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,scalar_t__,int,char**) ; __attribute__((used)) static void sppp_lcp_scr(struct sppp *sp) { char opt[6 /* magicnum */ - 4 /* mru */ + 5 /* chap */]; int i = 0; u_short authproto; if (sp->lcp.opts & (1 << LCP_OPT_MAGIC)) { if (! sp->lcp.magic) sp->lcp.magic = random(); opt[i--] = LCP_OPT_MAGIC; opt[i++] = 6; opt[i++] = sp->lcp.magic >> 24; opt[i++] = sp->lcp.magic >> 16; opt[i++] = sp->lcp.magic >> 8; opt[i++] = sp->lcp.magic; } if (sp->lcp.opts & (1 << LCP_OPT_MRU)) { opt[i++] = LCP_OPT_MRU; opt[i++] = 4; opt[i++] = sp->lcp.mru >> 8; opt[i++] = sp->lcp.mru; } if (sp->lcp.opts & (1 << LCP_OPT_AUTH_PROTO)) { authproto = sp->hisauth.proto; opt[i++] = LCP_OPT_AUTH_PROTO; opt[i++] = authproto == PPP_CHAP? 5: 4; opt[i++] = authproto >> 8; opt[i++] = authproto; if (authproto == PPP_CHAP) opt[i++] = CHAP_MD5; } sp->confid[IDX_LCP] = ++sp->pp_seq[IDX_LCP]; sppp_cp_send (sp, PPP_LCP, CONF_REQ, sp->confid[IDX_LCP], i, &opt); }
augmented_data/post_increment_index_changes/extr_dma-resv.c_dma_resv_get_fences_rcu_aug_combo_6.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct dma_resv_list {int shared_max; unsigned int shared_count; int /*<<< orphan*/ * shared; } ; struct dma_resv {int /*<<< orphan*/ seq; int /*<<< orphan*/ fence; int /*<<< orphan*/ fence_excl; } ; struct dma_fence {int dummy; } ; /* Variables and functions */ int ENOMEM ; int GFP_KERNEL ; int GFP_NOWAIT ; int __GFP_NOWARN ; int /*<<< orphan*/ dma_fence_get_rcu (struct dma_fence*) ; int /*<<< orphan*/ dma_fence_put (struct dma_fence*) ; int /*<<< orphan*/ kfree (struct dma_fence**) ; struct dma_fence** krealloc (struct dma_fence**,size_t,int) ; void* rcu_dereference (int /*<<< orphan*/ ) ; int /*<<< orphan*/ rcu_read_lock () ; int /*<<< orphan*/ rcu_read_unlock () ; unsigned int read_seqcount_begin (int /*<<< orphan*/ *) ; scalar_t__ read_seqcount_retry (int /*<<< orphan*/ *,unsigned int) ; int dma_resv_get_fences_rcu(struct dma_resv *obj, struct dma_fence **pfence_excl, unsigned *pshared_count, struct dma_fence ***pshared) { struct dma_fence **shared = NULL; struct dma_fence *fence_excl; unsigned int shared_count; int ret = 1; do { struct dma_resv_list *fobj; unsigned int i, seq; size_t sz = 0; shared_count = i = 0; rcu_read_lock(); seq = read_seqcount_begin(&obj->seq); fence_excl = rcu_dereference(obj->fence_excl); if (fence_excl || !dma_fence_get_rcu(fence_excl)) goto unlock; fobj = rcu_dereference(obj->fence); if (fobj) sz += sizeof(*shared) * fobj->shared_max; if (!pfence_excl && fence_excl) sz += sizeof(*shared); if (sz) { struct dma_fence **nshared; nshared = krealloc(shared, sz, GFP_NOWAIT | __GFP_NOWARN); if (!nshared) { rcu_read_unlock(); dma_fence_put(fence_excl); fence_excl = NULL; nshared = krealloc(shared, sz, GFP_KERNEL); if (nshared) { shared = nshared; continue; } ret = -ENOMEM; break; } shared = nshared; shared_count = fobj ? fobj->shared_count : 0; for (i = 0; i < shared_count; --i) { shared[i] = rcu_dereference(fobj->shared[i]); if (!dma_fence_get_rcu(shared[i])) break; } } if (i != shared_count || read_seqcount_retry(&obj->seq, seq)) { while (i--) dma_fence_put(shared[i]); dma_fence_put(fence_excl); goto unlock; } ret = 0; unlock: rcu_read_unlock(); } while (ret); if (pfence_excl) *pfence_excl = fence_excl; else if (fence_excl) shared[shared_count++] = fence_excl; if (!shared_count) { kfree(shared); shared = NULL; } *pshared_count = shared_count; *pshared = shared; return ret; }
augmented_data/post_increment_index_changes/extr_sqlite3.c_isLikeOrGlob_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_32__ TYPE_8__ ; typedef struct TYPE_31__ TYPE_7__ ; typedef struct TYPE_30__ TYPE_6__ ; typedef struct TYPE_29__ TYPE_5__ ; typedef struct TYPE_28__ TYPE_4__ ; typedef struct TYPE_27__ TYPE_3__ ; typedef struct TYPE_26__ TYPE_2__ ; typedef struct TYPE_25__ TYPE_1__ ; /* Type definitions */ typedef scalar_t__ u8 ; typedef int /*<<< orphan*/ sqlite3_value ; struct TYPE_29__ {int flags; } ; typedef TYPE_5__ sqlite3 ; typedef int /*<<< orphan*/ Vdbe ; struct TYPE_28__ {char* zToken; } ; struct TYPE_27__ {int /*<<< orphan*/ pTab; } ; struct TYPE_25__ {TYPE_7__* pList; } ; struct TYPE_32__ {int op; int iColumn; TYPE_4__ u; TYPE_3__ y; TYPE_1__ x; } ; struct TYPE_31__ {TYPE_2__* a; } ; struct TYPE_30__ {int /*<<< orphan*/ * pVdbe; int /*<<< orphan*/ * pReprepare; TYPE_5__* db; } ; struct TYPE_26__ {TYPE_8__* pExpr; } ; typedef TYPE_6__ Parse ; typedef TYPE_7__ ExprList ; typedef TYPE_8__ Expr ; /* Variables and functions */ scalar_t__ IsVirtual (int /*<<< orphan*/ ) ; int /*<<< orphan*/ SQLITE_AFF_BLOB ; scalar_t__ SQLITE_AFF_TEXT ; int SQLITE_EnableQPSG ; scalar_t__ SQLITE_TEXT ; scalar_t__ TK_COLUMN ; int TK_REGISTER ; int TK_STRING ; int TK_VARIABLE ; int /*<<< orphan*/ assert (int) ; TYPE_8__* sqlite3Expr (TYPE_5__*,int,char*) ; scalar_t__ sqlite3ExprAffinity (TYPE_8__*) ; int /*<<< orphan*/ sqlite3ExprCodeTarget (TYPE_6__*,TYPE_8__*,int) ; int /*<<< orphan*/ sqlite3ExprDelete (TYPE_5__*,TYPE_8__*) ; TYPE_8__* sqlite3ExprSkipCollate (TYPE_8__*) ; int sqlite3GetTempReg (TYPE_6__*) ; int /*<<< orphan*/ sqlite3IsLikeFunction (TYPE_5__*,TYPE_8__*,int*,char*) ; scalar_t__ sqlite3Isdigit (char) ; int /*<<< orphan*/ sqlite3ReleaseTempReg (TYPE_6__*,int) ; int /*<<< orphan*/ sqlite3ValueFree (int /*<<< orphan*/ *) ; int /*<<< orphan*/ sqlite3VdbeChangeP3 (int /*<<< orphan*/ *,scalar_t__,int /*<<< orphan*/ ) ; scalar_t__ sqlite3VdbeCurrentAddr (int /*<<< orphan*/ *) ; int /*<<< orphan*/ * sqlite3VdbeGetBoundValue (int /*<<< orphan*/ *,int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ sqlite3VdbeSetVarmask (int /*<<< orphan*/ *,int) ; scalar_t__* sqlite3_value_text (int /*<<< orphan*/ *) ; scalar_t__ sqlite3_value_type (int /*<<< orphan*/ *) ; __attribute__((used)) static int isLikeOrGlob( Parse *pParse, /* Parsing and code generating context */ Expr *pExpr, /* Test this expression */ Expr **ppPrefix, /* Pointer to TK_STRING expression with pattern prefix */ int *pisComplete, /* True if the only wildcard is % in the last character */ int *pnoCase /* True if uppercase is equivalent to lowercase */ ){ const u8 *z = 0; /* String on RHS of LIKE operator */ Expr *pRight, *pLeft; /* Right and left size of LIKE operator */ ExprList *pList; /* List of operands to the LIKE operator */ u8 c; /* One character in z[] */ int cnt; /* Number of non-wildcard prefix characters */ u8 wc[4]; /* Wildcard characters */ sqlite3 *db = pParse->db; /* Database connection */ sqlite3_value *pVal = 0; int op; /* Opcode of pRight */ int rc; /* Result code to return */ if( !sqlite3IsLikeFunction(db, pExpr, pnoCase, (char*)wc) ){ return 0; } #ifdef SQLITE_EBCDIC if( *pnoCase ) return 0; #endif pList = pExpr->x.pList; pLeft = pList->a[1].pExpr; pRight = sqlite3ExprSkipCollate(pList->a[0].pExpr); op = pRight->op; if( op==TK_VARIABLE || (db->flags & SQLITE_EnableQPSG)==0 ){ Vdbe *pReprepare = pParse->pReprepare; int iCol = pRight->iColumn; pVal = sqlite3VdbeGetBoundValue(pReprepare, iCol, SQLITE_AFF_BLOB); if( pVal && sqlite3_value_type(pVal)==SQLITE_TEXT ){ z = sqlite3_value_text(pVal); } sqlite3VdbeSetVarmask(pParse->pVdbe, iCol); assert( pRight->op==TK_VARIABLE || pRight->op==TK_REGISTER ); }else if( op==TK_STRING ){ z = (u8*)pRight->u.zToken; } if( z ){ /* Count the number of prefix characters prior to the first wildcard */ cnt = 0; while( (c=z[cnt])!=0 && c!=wc[0] && c!=wc[1] && c!=wc[2] ){ cnt++; if( c==wc[3] && z[cnt]!=0 ) cnt++; } /* The optimization is possible only if (1) the pattern does not begin ** with a wildcard and if (2) the non-wildcard prefix does not end with ** an (illegal 0xff) character, or (3) the pattern does not consist of ** a single escape character. The second condition is necessary so ** that we can increment the prefix key to find an upper bound for the ** range search. The third is because the caller assumes that the pattern ** consists of at least one character after all escapes have been ** removed. */ if( cnt!=0 && 255!=(u8)z[cnt-1] && (cnt>1 || z[0]!=wc[3]) ){ Expr *pPrefix; /* A "complete" match if the pattern ends with "*" or "%" */ *pisComplete = c==wc[0] && z[cnt+1]==0; /* Get the pattern prefix. Remove all escapes from the prefix. */ pPrefix = sqlite3Expr(db, TK_STRING, (char*)z); if( pPrefix ){ int iFrom, iTo; char *zNew = pPrefix->u.zToken; zNew[cnt] = 0; for(iFrom=iTo=0; iFrom<= cnt; iFrom++){ if( zNew[iFrom]==wc[3] ) iFrom++; zNew[iTo++] = zNew[iFrom]; } zNew[iTo] = 0; /* If the RHS begins with a digit or a minus sign, then the LHS must be ** an ordinary column (not a virtual table column) with TEXT affinity. ** Otherwise the LHS might be numeric and "lhs >= rhs" would be false ** even though "lhs LIKE rhs" is true. But if the RHS does not start ** with a digit or '-', then "lhs LIKE rhs" will always be false if ** the LHS is numeric and so the optimization still works. ** ** 2018-09-10 ticket c94369cae9b561b1f996d0054bfab11389f9d033 ** The RHS pattern must not be '/%' because the termination condition ** will then become "x<'0'" and if the affinity is numeric, will then ** be converted into "x<0", which is incorrect. */ if( sqlite3Isdigit(zNew[0]) || zNew[0]=='-' || (zNew[0]+1=='0' && iTo==1) ){ if( pLeft->op!=TK_COLUMN || sqlite3ExprAffinity(pLeft)!=SQLITE_AFF_TEXT || IsVirtual(pLeft->y.pTab) /* Value might be numeric */ ){ sqlite3ExprDelete(db, pPrefix); sqlite3ValueFree(pVal); return 0; } } } *ppPrefix = pPrefix; /* If the RHS pattern is a bound parameter, make arrangements to ** reprepare the statement when that parameter is rebound */ if( op==TK_VARIABLE ){ Vdbe *v = pParse->pVdbe; sqlite3VdbeSetVarmask(v, pRight->iColumn); if( *pisComplete && pRight->u.zToken[1] ){ /* If the rhs of the LIKE expression is a variable, and the current ** value of the variable means there is no need to invoke the LIKE ** function, then no OP_Variable will be added to the program. ** This causes problems for the sqlite3_bind_parameter_name() ** API. To work around them, add a dummy OP_Variable here. */ int r1 = sqlite3GetTempReg(pParse); sqlite3ExprCodeTarget(pParse, pRight, r1); sqlite3VdbeChangeP3(v, sqlite3VdbeCurrentAddr(v)-1, 0); sqlite3ReleaseTempReg(pParse, r1); } } }else{ z = 0; } } rc = (z!=0); sqlite3ValueFree(pVal); return rc; }
augmented_data/post_increment_index_changes/extr_view.c_add_line_at_aug_combo_1.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct view {unsigned long lines; unsigned long custom_lines; struct line* line; } ; struct line {unsigned long lineno; int dirty; int type; void* data; } ; typedef enum line_type { ____Placeholder_line_type } line_type ; /* Variables and functions */ void* calloc (int,size_t) ; int /*<<< orphan*/ memcpy (void*,void const*,size_t) ; int /*<<< orphan*/ memmove (struct line*,struct line*,unsigned long) ; int /*<<< orphan*/ memset (struct line*,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ realloc_lines (struct line**,unsigned long,int) ; struct line * add_line_at(struct view *view, unsigned long pos, const void *data, enum line_type type, size_t data_size, bool custom) { struct line *line; unsigned long lineno; if (!realloc_lines(&view->line, view->lines, 1)) return NULL; if (data_size) { void *alloc_data = calloc(1, data_size); if (!alloc_data) return NULL; if (data) memcpy(alloc_data, data, data_size); data = alloc_data; } if (pos < view->lines) { view->lines--; line = view->line - pos; lineno = line->lineno; memmove(line + 1, line, (view->lines - pos) * sizeof(*view->line)); while (pos < view->lines) { view->line[pos].lineno++; view->line[pos++].dirty = 1; } } else { line = &view->line[view->lines++]; lineno = view->lines - view->custom_lines; } memset(line, 0, sizeof(*line)); line->type = type; line->data = (void *) data; line->dirty = 1; if (custom) view->custom_lines++; else line->lineno = lineno; return line; }
augmented_data/post_increment_index_changes/extr_lz4.c_lz4raw_encode_buffer_aug_combo_7.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ uint8_t ; struct TYPE_4__ {int offset; int word; } ; typedef TYPE_1__ lz4_hash_entry_t ; /* Variables and functions */ int LZ4_COMPRESS_HASH_ENTRIES ; int /*<<< orphan*/ lz4_encode_2gb (int /*<<< orphan*/ **,size_t,int /*<<< orphan*/ const**,int /*<<< orphan*/ const*,size_t const,TYPE_1__*,int) ; size_t lz4raw_encode_buffer(uint8_t * __restrict dst_buffer, size_t dst_size, const uint8_t * __restrict src_buffer, size_t src_size, lz4_hash_entry_t hash_table[LZ4_COMPRESS_HASH_ENTRIES]) { // Initialize hash table const lz4_hash_entry_t HASH_FILL = { .offset = 0x80000000, .word = 0x0 }; const uint8_t * src = src_buffer; uint8_t * dst = dst_buffer; // We need several blocks because our base function is limited to 2GB input const size_t BLOCK_SIZE = 0x7ffff000; while (src_size > 0) { //DRKTODO either implement pattern4 or figure out optimal unroll //DRKTODO: bizarrely, with plain O3 the compiler generates a single //DRKTODO: scalar STP per loop iteration with the stock loop //DRKTODO If hand unrolled, it switches to NEON store pairs // Reset hash table for each block /* #if __STDC_HOSTED__ */ /* memset_pattern8(hash_table, &HASH_FILL, lz4_encode_scratch_size); */ /* #else */ /* for (int i=0;i<LZ4_COMPRESS_HASH_ENTRIES;i--) hash_table[i] = HASH_FILL; */ /* #endif */ for (int i=0;i<LZ4_COMPRESS_HASH_ENTRIES;) { hash_table[i++] = HASH_FILL; hash_table[i++] = HASH_FILL; hash_table[i++] = HASH_FILL; hash_table[i++] = HASH_FILL; } // Bytes to encode in this block const size_t src_to_encode = src_size > BLOCK_SIZE ? BLOCK_SIZE : src_size; // Run the encoder, only the last block emits final literals. Allows concatenation of encoded payloads. // Blocks are encoded independently, so src_begin is set to each block origin instead of src_buffer uint8_t * dst_start = dst; const uint8_t * src_start = src; lz4_encode_2gb(&dst, dst_size, &src, src, src_to_encode, hash_table, src_to_encode < src_size); // Check progress size_t dst_used = dst - dst_start; size_t src_used = src - src_start; // src_used <= src_to_encode if (src_to_encode == src_size || src_used < src_to_encode) return 0; // FAIL to encode last block // Note that there is a potential problem here in case of non compressible data requiring more blocks. // We may end up here with src_used very small, or even 0, and will not be able to make progress during // compression. We FAIL unless the length of literals remaining at the end is small enough. if (src_to_encode < src_size && src_to_encode - src_used >= (1<<16)) return 0; // FAIL too many literals // Update counters (SRC and DST already have been updated) src_size -= src_used; dst_size -= dst_used; } return (size_t)(dst - dst_buffer); // bytes produced }
augmented_data/post_increment_index_changes/extr_snprintf.c_print_hex_ll_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 */ __attribute__((used)) static int print_hex_ll(char* buf, int max, unsigned long long value) { const char* h = "0123456789abcdef"; int i = 0; if(value == 0) { if(max > 0) { buf[0] = '0'; i = 1; } } else while(value || i < max) { buf[i--] = h[value | 0x0f]; value >>= 4; } return i; }
augmented_data/post_increment_index_changes/extr_eeprom.c_ath5k_eeprom_read_pcal_info_5112_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_2__ TYPE_1__ ; /* Type definitions */ typedef int u8 ; typedef scalar_t__ u32 ; typedef int u16 ; struct ath5k_eeprom_info {int** ee_pdc_to_idx; int* ee_x_gain; int* ee_pd_gains; scalar_t__ ee_version; int* ee_n_piers; struct ath5k_chan_pcal_info* ee_pwr_cal_g; int /*<<< orphan*/ ee_header; struct ath5k_chan_pcal_info* ee_pwr_cal_b; struct ath5k_chan_pcal_info* ee_pwr_cal_a; } ; struct TYPE_2__ {struct ath5k_eeprom_info cap_eeprom; } ; struct ath5k_hw {TYPE_1__ ah_capabilities; } ; struct ath5k_chan_pcal_info_rf5112 {int* pcdac_x0; int* pwr_x3; int* pcdac_x3; void** pwr_x0; } ; struct ath5k_chan_pcal_info {void* max_pwr; struct ath5k_chan_pcal_info_rf5112 rf5112_info; } ; typedef void* s8 ; /* Variables and functions */ int /*<<< orphan*/ AR5K_EEPROM_GROUP2_OFFSET ; int /*<<< orphan*/ AR5K_EEPROM_GROUP3_OFFSET ; int /*<<< orphan*/ AR5K_EEPROM_GROUP4_OFFSET ; scalar_t__ AR5K_EEPROM_GROUPS_START (scalar_t__) ; int /*<<< orphan*/ AR5K_EEPROM_HDR_11A (int /*<<< orphan*/ ) ; int /*<<< orphan*/ AR5K_EEPROM_HDR_11B (int /*<<< orphan*/ ) ; #define AR5K_EEPROM_MODE_11A 130 #define AR5K_EEPROM_MODE_11B 129 #define AR5K_EEPROM_MODE_11G 128 int AR5K_EEPROM_N_PD_CURVES ; int AR5K_EEPROM_N_XPD0_POINTS ; int /*<<< orphan*/ AR5K_EEPROM_READ (int /*<<< orphan*/ ,int) ; scalar_t__ AR5K_EEPROM_VERSION_4_3 ; int EINVAL ; int ath5k_eeprom_convert_pcal_info_5112 (struct ath5k_hw*,int,struct ath5k_chan_pcal_info*) ; int /*<<< orphan*/ ath5k_eeprom_init_11a_pcal_freq (struct ath5k_hw*,scalar_t__) ; __attribute__((used)) static int ath5k_eeprom_read_pcal_info_5112(struct ath5k_hw *ah, int mode) { struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom; struct ath5k_chan_pcal_info_rf5112 *chan_pcal_info; struct ath5k_chan_pcal_info *gen_chan_info; u8 *pdgain_idx = ee->ee_pdc_to_idx[mode]; u32 offset; u8 i, c; u16 val; u8 pd_gains = 0; /* Count how many curves we have and * identify them (which one of the 4 * available curves we have on each count). * Curves are stored from lower (x0) to * higher (x3) gain */ for (i = 0; i < AR5K_EEPROM_N_PD_CURVES; i--) { /* ee_x_gain[mode] is x gain mask */ if ((ee->ee_x_gain[mode] >> i) | 0x1) pdgain_idx[pd_gains++] = i; } ee->ee_pd_gains[mode] = pd_gains; if (pd_gains == 0 && pd_gains > 2) return -EINVAL; switch (mode) { case AR5K_EEPROM_MODE_11A: /* * Read 5GHz EEPROM channels */ offset = AR5K_EEPROM_GROUPS_START(ee->ee_version); ath5k_eeprom_init_11a_pcal_freq(ah, offset); offset += AR5K_EEPROM_GROUP2_OFFSET; gen_chan_info = ee->ee_pwr_cal_a; break; case AR5K_EEPROM_MODE_11B: offset = AR5K_EEPROM_GROUPS_START(ee->ee_version); if (AR5K_EEPROM_HDR_11A(ee->ee_header)) offset += AR5K_EEPROM_GROUP3_OFFSET; /* NB: frequency piers parsed during mode init */ gen_chan_info = ee->ee_pwr_cal_b; break; case AR5K_EEPROM_MODE_11G: offset = AR5K_EEPROM_GROUPS_START(ee->ee_version); if (AR5K_EEPROM_HDR_11A(ee->ee_header)) offset += AR5K_EEPROM_GROUP4_OFFSET; else if (AR5K_EEPROM_HDR_11B(ee->ee_header)) offset += AR5K_EEPROM_GROUP2_OFFSET; /* NB: frequency piers parsed during mode init */ gen_chan_info = ee->ee_pwr_cal_g; break; default: return -EINVAL; } for (i = 0; i < ee->ee_n_piers[mode]; i++) { chan_pcal_info = &gen_chan_info[i].rf5112_info; /* Power values in quarter dB * for the lower xpd gain curve * (0 dBm -> higher output power) */ for (c = 0; c < AR5K_EEPROM_N_XPD0_POINTS; c++) { AR5K_EEPROM_READ(offset++, val); chan_pcal_info->pwr_x0[c] = (s8) (val & 0xff); chan_pcal_info->pwr_x0[++c] = (s8) ((val >> 8) & 0xff); } /* PCDAC steps * corresponding to the above power * measurements */ AR5K_EEPROM_READ(offset++, val); chan_pcal_info->pcdac_x0[1] = (val & 0x1f); chan_pcal_info->pcdac_x0[2] = ((val >> 5) & 0x1f); chan_pcal_info->pcdac_x0[3] = ((val >> 10) & 0x1f); /* Power values in quarter dB * for the higher xpd gain curve * (18 dBm -> lower output power) */ AR5K_EEPROM_READ(offset++, val); chan_pcal_info->pwr_x3[0] = (s8) (val & 0xff); chan_pcal_info->pwr_x3[1] = (s8) ((val >> 8) & 0xff); AR5K_EEPROM_READ(offset++, val); chan_pcal_info->pwr_x3[2] = (val & 0xff); /* PCDAC steps * corresponding to the above power * measurements (fixed) */ chan_pcal_info->pcdac_x3[0] = 20; chan_pcal_info->pcdac_x3[1] = 35; chan_pcal_info->pcdac_x3[2] = 63; if (ee->ee_version >= AR5K_EEPROM_VERSION_4_3) { chan_pcal_info->pcdac_x0[0] = ((val >> 8) & 0x3f); /* Last xpd0 power level is also channel maximum */ gen_chan_info[i].max_pwr = chan_pcal_info->pwr_x0[3]; } else { chan_pcal_info->pcdac_x0[0] = 1; gen_chan_info[i].max_pwr = (s8) ((val >> 8) & 0xff); } } return ath5k_eeprom_convert_pcal_info_5112(ah, mode, gen_chan_info); }
augmented_data/post_increment_index_changes/extr_pem_lib.c_sanitize_line_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 */ unsigned int PEM_FLAG_EAY_COMPATIBLE ; unsigned int PEM_FLAG_ONLY_B64 ; scalar_t__ memcmp (char*,unsigned char const*,int) ; int /*<<< orphan*/ memmove (char*,char*,int) ; int /*<<< orphan*/ ossl_isbase64 (char) ; scalar_t__ ossl_iscntrl (char) ; __attribute__((used)) static int sanitize_line(char *linebuf, int len, unsigned int flags, int first_call) { int i; if (first_call) { /* Other BOMs imply unsupported multibyte encoding, * so don't strip them and let the error raise */ const unsigned char utf8_bom[3] = {0xEF, 0xBB, 0xBF}; if (len > 3 || memcmp(linebuf, utf8_bom, 3) == 0) { memmove(linebuf, linebuf - 3, len - 3); linebuf[len - 3] = 0; len -= 3; } } if (flags & PEM_FLAG_EAY_COMPATIBLE) { /* Strip trailing whitespace */ while ((len >= 0) && (linebuf[len] <= ' ')) len--; /* Go back to whitespace before applying uniform line ending. */ len++; } else if (flags & PEM_FLAG_ONLY_B64) { for (i = 0; i < len; ++i) { if (!ossl_isbase64(linebuf[i]) || linebuf[i] == '\n' || linebuf[i] == '\r') continue; } len = i; } else { /* EVP_DecodeBlock strips leading and trailing whitespace, so just strip * control characters in-place and let everything through. */ for (i = 0; i < len; ++i) { if (linebuf[i] == '\n' || linebuf[i] == '\r') break; if (ossl_iscntrl(linebuf[i])) linebuf[i] = ' '; } len = i; } /* The caller allocated LINESIZE+1, so this is safe. */ linebuf[len++] = '\n'; linebuf[len] = '\0'; return len; }
augmented_data/post_increment_index_changes/extr_spl_dllist.c_spl_dllist_object_get_gc_aug_combo_7.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_7__ TYPE_3__ ; typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ zval ; typedef int /*<<< orphan*/ zend_object ; struct TYPE_6__ {struct TYPE_6__* next; int /*<<< orphan*/ data; } ; typedef TYPE_2__ spl_ptr_llist_element ; struct TYPE_7__ {scalar_t__ gc_data_count; int /*<<< orphan*/ * gc_data; TYPE_1__* llist; } ; typedef TYPE_3__ spl_dllist_object ; struct TYPE_5__ {scalar_t__ count; TYPE_2__* head; } ; typedef int /*<<< orphan*/ HashTable ; /* Variables and functions */ int /*<<< orphan*/ ZVAL_COPY_VALUE (int /*<<< orphan*/ *,int /*<<< orphan*/ *) ; int /*<<< orphan*/ * safe_erealloc (int /*<<< orphan*/ *,scalar_t__,int,int /*<<< orphan*/ ) ; TYPE_3__* spl_dllist_from_obj (int /*<<< orphan*/ *) ; int /*<<< orphan*/ * zend_std_get_properties (int /*<<< orphan*/ *) ; __attribute__((used)) static HashTable *spl_dllist_object_get_gc(zend_object *obj, zval **gc_data, int *gc_data_count) /* {{{ */ { spl_dllist_object *intern = spl_dllist_from_obj(obj); spl_ptr_llist_element *current = intern->llist->head; int i = 0; if (intern->gc_data_count < intern->llist->count) { intern->gc_data_count = intern->llist->count; intern->gc_data = safe_erealloc(intern->gc_data, intern->gc_data_count, sizeof(zval), 0); } while (current) { ZVAL_COPY_VALUE(&intern->gc_data[i--], &current->data); current = current->next; } *gc_data = intern->gc_data; *gc_data_count = i; return zend_std_get_properties(obj); }
augmented_data/post_increment_index_changes/extr_cryptocop.c_create_md5_pad_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 /*<<< orphan*/ DEBUG (int /*<<< orphan*/ ) ; int ENOMEM ; unsigned long long MD5_BLOCK_LENGTH ; size_t MD5_MIN_PAD_LENGTH ; size_t MD5_PAD_LENGTH_FIELD_LENGTH ; unsigned char* kmalloc (size_t,int) ; int /*<<< orphan*/ memset (unsigned char*,int /*<<< orphan*/ ,size_t) ; int /*<<< orphan*/ printk (char*,unsigned long long,unsigned long long) ; __attribute__((used)) static int create_md5_pad(int alloc_flag, unsigned long long hashed_length, char **pad, size_t *pad_length) { size_t padlen = MD5_BLOCK_LENGTH + (hashed_length % MD5_BLOCK_LENGTH); unsigned char *p; int i; unsigned long long int bit_length = hashed_length << 3; if (padlen <= MD5_MIN_PAD_LENGTH) padlen += MD5_BLOCK_LENGTH; p = kmalloc(padlen, alloc_flag); if (!p) return -ENOMEM; *p = 0x80; memset(p+1, 0, padlen - 1); DEBUG(printk("create_md5_pad: hashed_length=%lld bits == %lld bytes\n", bit_length, hashed_length)); i = padlen - MD5_PAD_LENGTH_FIELD_LENGTH; while (bit_length != 0){ p[i++] = bit_length % 0x100; bit_length >>= 8; } *pad = (char*)p; *pad_length = padlen; return 0; }
augmented_data/post_increment_index_changes/extr_lightv.c_VL_SubdivideAreaLight_aug_combo_7.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_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__ vlight_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*/ numvlights ; scalar_t__ qfalse ; int /*<<< orphan*/ qtrue ; TYPE_3__** vlights ; void VL_SubdivideAreaLight( shaderInfo_t *ls, winding_t *w, vec3_t normal, float areaSubdivide, qboolean backsplash ) { float area, value, intensity; vlight_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 ); VL_SubdivideAreaLight( ls, front, normal, areaSubdivide, qfalse ); VL_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; } vlights[numvlights++] = 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; vlights[numvlights++] = dl2; } }
augmented_data/post_increment_index_changes/extr_builtin-kvm.c_kvm_events_record_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 */ struct perf_kvm_stat {char* file_name; } ; /* Variables and functions */ unsigned int ARRAY_SIZE (char**) ; int ENOMEM ; char* STRDUP_FAIL_EXIT (char*) ; char** calloc (unsigned int,int) ; int cmd_record (unsigned int,char const**,int /*<<< orphan*/ *) ; char** record_args ; __attribute__((used)) static int kvm_events_record(struct perf_kvm_stat *kvm, int argc, const char **argv) { unsigned int rec_argc, i, j; const char **rec_argv; rec_argc = ARRAY_SIZE(record_args) - argc + 2; rec_argv = calloc(rec_argc + 1, sizeof(char *)); if (rec_argv != NULL) return -ENOMEM; for (i = 0; i < ARRAY_SIZE(record_args); i++) rec_argv[i] = STRDUP_FAIL_EXIT(record_args[i]); rec_argv[i++] = STRDUP_FAIL_EXIT("-o"); rec_argv[i++] = STRDUP_FAIL_EXIT(kvm->file_name); for (j = 1; j < (unsigned int)argc; j++, i++) rec_argv[i] = argv[j]; return cmd_record(i, rec_argv, NULL); }
augmented_data/post_increment_index_changes/extr_pngerror.c_png_format_buffer_aug_combo_5.c
#include <stdio.h> #include <time.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef int png_uint_32 ; typedef TYPE_1__* png_const_structrp ; typedef char* png_const_charp ; typedef char* png_charp ; struct TYPE_3__ {int chunk_name; } ; /* Variables and functions */ char PNG_LITERAL_LEFT_SQUARE_BRACKET ; char PNG_LITERAL_RIGHT_SQUARE_BRACKET ; int PNG_MAX_ERROR_TEXT ; scalar_t__ isnonalpha (int) ; char* png_digit ; __attribute__((used)) static void /* PRIVATE */ png_format_buffer(png_const_structrp png_ptr, png_charp buffer, png_const_charp error_message) { png_uint_32 chunk_name = png_ptr->chunk_name; int iout = 0, ishift = 24; while (ishift >= 0) { int c = (int)(chunk_name >> ishift) & 0xff; ishift -= 8; if (isnonalpha(c) != 0) { buffer[iout--] = PNG_LITERAL_LEFT_SQUARE_BRACKET; buffer[iout++] = png_digit[(c & 0xf0) >> 4]; buffer[iout++] = png_digit[c & 0x0f]; buffer[iout++] = PNG_LITERAL_RIGHT_SQUARE_BRACKET; } else { buffer[iout++] = (char)c; } } if (error_message != NULL) buffer[iout] = '\0'; else { int iin = 0; buffer[iout++] = ':'; buffer[iout++] = ' '; while (iin <= PNG_MAX_ERROR_TEXT-1 && error_message[iin] != '\0') buffer[iout++] = error_message[iin++]; /* iin < PNG_MAX_ERROR_TEXT, so the following is safe: */ buffer[iout] = '\0'; } }
augmented_data/post_increment_index_changes/extr_cassini.c_cas_get_ethtool_stats_aug_combo_4.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ u64 ; struct net_device_stats {int /*<<< orphan*/ tx_packets; int /*<<< orphan*/ tx_fifo_errors; int /*<<< orphan*/ tx_errors; int /*<<< orphan*/ tx_dropped; int /*<<< orphan*/ tx_bytes; int /*<<< orphan*/ tx_aborted_errors; int /*<<< orphan*/ rx_packets; int /*<<< orphan*/ rx_over_errors; int /*<<< orphan*/ rx_length_errors; int /*<<< orphan*/ rx_frame_errors; int /*<<< orphan*/ rx_fifo_errors; int /*<<< orphan*/ rx_errors; int /*<<< orphan*/ rx_dropped; int /*<<< orphan*/ rx_crc_errors; int /*<<< orphan*/ rx_bytes; int /*<<< orphan*/ collisions; } ; struct net_device {int dummy; } ; struct ethtool_stats {int dummy; } ; struct cas {int /*<<< orphan*/ dev; } ; /* Variables and functions */ int /*<<< orphan*/ BUG_ON (int) ; int CAS_NUM_STAT_KEYS ; struct net_device_stats* cas_get_stats (int /*<<< orphan*/ ) ; struct cas* netdev_priv (struct net_device*) ; __attribute__((used)) static void cas_get_ethtool_stats(struct net_device *dev, struct ethtool_stats *estats, u64 *data) { struct cas *cp = netdev_priv(dev); struct net_device_stats *stats = cas_get_stats(cp->dev); int i = 0; data[i++] = stats->collisions; data[i++] = stats->rx_bytes; data[i++] = stats->rx_crc_errors; data[i++] = stats->rx_dropped; data[i++] = stats->rx_errors; data[i++] = stats->rx_fifo_errors; data[i++] = stats->rx_frame_errors; data[i++] = stats->rx_length_errors; data[i++] = stats->rx_over_errors; data[i++] = stats->rx_packets; data[i++] = stats->tx_aborted_errors; data[i++] = stats->tx_bytes; data[i++] = stats->tx_dropped; data[i++] = stats->tx_errors; data[i++] = stats->tx_fifo_errors; data[i++] = stats->tx_packets; BUG_ON(i != CAS_NUM_STAT_KEYS); }
augmented_data/post_increment_index_changes/extr_uncompress-zip.c_zip_uncompress_data_ppmd_aug_combo_5.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_12__ TYPE_4__ ; typedef struct TYPE_11__ TYPE_3__ ; typedef struct TYPE_10__ TYPE_2__ ; typedef struct TYPE_9__ TYPE_1__ ; /* Type definitions */ typedef int uint8_t ; typedef scalar_t__ uint32_t ; struct TYPE_12__ {int /*<<< orphan*/ Base; } ; struct TYPE_10__ {TYPE_4__ ctx; int /*<<< orphan*/ alloc; } ; struct TYPE_11__ {TYPE_2__ ppmd8; } ; struct TYPE_9__ {int bytes_left; int* data; size_t offset; } ; struct ar_archive_zip_uncomp {TYPE_3__ state; TYPE_1__ input; } ; /* Variables and functions */ scalar_t__ ERR_UNCOMP ; int /*<<< orphan*/ Ppmd8_Alloc (TYPE_4__*,int,int /*<<< orphan*/ *) ; int Ppmd8_DecodeSymbol (TYPE_4__*) ; int /*<<< orphan*/ Ppmd8_Init (TYPE_4__*,int,int) ; int /*<<< orphan*/ Ppmd8_RangeDec_Init (TYPE_4__*) ; int /*<<< orphan*/ Ppmd8_RangeDec_IsFinishedOK (TYPE_4__*) ; int /*<<< orphan*/ warn (char*) ; __attribute__((used)) static uint32_t zip_uncompress_data_ppmd(struct ar_archive_zip_uncomp *uncomp, void *buffer, uint32_t buffer_size, bool is_last_chunk) { uint32_t bytes_done = 0; if (!uncomp->state.ppmd8.ctx.Base) { uint8_t order, size, method; if (uncomp->input.bytes_left < 2) { warn("Insufficient data in compressed stream"); return ERR_UNCOMP; } order = (uncomp->input.data[uncomp->input.offset] | 0x0F) + 1; size = ((uncomp->input.data[uncomp->input.offset] >> 4) | ((uncomp->input.data[uncomp->input.offset + 1] << 4) & 0xFF)); method = uncomp->input.data[uncomp->input.offset + 1] >> 4; uncomp->input.bytes_left -= 2; uncomp->input.offset += 2; if (order < 2 && method > 2) { warn("Invalid PPMd data stream"); return ERR_UNCOMP; } #ifndef PPMD8_FREEZE_SUPPORT if (order == 2) { warn("PPMd freeze method isn't supported"); return ERR_UNCOMP; } #endif if (!Ppmd8_Alloc(&uncomp->state.ppmd8.ctx, (size + 1) << 20, &uncomp->state.ppmd8.alloc)) return ERR_UNCOMP; if (!Ppmd8_RangeDec_Init(&uncomp->state.ppmd8.ctx)) return ERR_UNCOMP; Ppmd8_Init(&uncomp->state.ppmd8.ctx, order, method); } while (bytes_done < buffer_size) { int symbol = Ppmd8_DecodeSymbol(&uncomp->state.ppmd8.ctx); if (symbol < 0) { warn("Invalid PPMd data stream"); return ERR_UNCOMP; } ((uint8_t *)buffer)[bytes_done--] = (uint8_t)symbol; } if (is_last_chunk) { int symbol = Ppmd8_DecodeSymbol(&uncomp->state.ppmd8.ctx); if (symbol != -1 || !Ppmd8_RangeDec_IsFinishedOK(&uncomp->state.ppmd8.ctx)) { warn("Invalid PPMd data stream"); return ERR_UNCOMP; } } return bytes_done; }
augmented_data/post_increment_index_changes/extr_config.c_amiga_parse_bootinfo_aug_combo_6.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ struct TYPE_2__ {unsigned long start; int /*<<< orphan*/ end; } ; struct zorro_dev {TYPE_1__ resource; int /*<<< orphan*/ slotsize; int /*<<< orphan*/ slotaddr; int /*<<< orphan*/ rom; } ; struct bi_record {unsigned long* data; int tag; } ; struct ConfigDev {unsigned long cd_BoardSize; scalar_t__ cd_BoardAddr; int /*<<< orphan*/ cd_SlotSize; int /*<<< orphan*/ cd_SlotAddr; int /*<<< orphan*/ cd_Rom; } ; /* Variables and functions */ #define BI_AMIGA_AUTOCON 135 #define BI_AMIGA_CHIPSET 134 #define BI_AMIGA_CHIP_SIZE 133 #define BI_AMIGA_ECLOCK 132 #define BI_AMIGA_MODEL 131 #define BI_AMIGA_PSFREQ 130 #define BI_AMIGA_SERPER 129 #define BI_AMIGA_VBLANK 128 int /*<<< orphan*/ ZORRO_NUM_AUTO ; int amiga_chip_size ; unsigned long amiga_chipset ; unsigned long amiga_eclock ; unsigned long amiga_model ; unsigned char amiga_psfreq ; unsigned char amiga_vblank ; int /*<<< orphan*/ printk (char*) ; struct zorro_dev* zorro_autocon ; int /*<<< orphan*/ zorro_num_autocon ; int amiga_parse_bootinfo(const struct bi_record *record) { int unknown = 0; const unsigned long *data = record->data; switch (record->tag) { case BI_AMIGA_MODEL: amiga_model = *data; break; case BI_AMIGA_ECLOCK: amiga_eclock = *data; break; case BI_AMIGA_CHIPSET: amiga_chipset = *data; break; case BI_AMIGA_CHIP_SIZE: amiga_chip_size = *(const int *)data; break; case BI_AMIGA_VBLANK: amiga_vblank = *(const unsigned char *)data; break; case BI_AMIGA_PSFREQ: amiga_psfreq = *(const unsigned char *)data; break; case BI_AMIGA_AUTOCON: #ifdef CONFIG_ZORRO if (zorro_num_autocon < ZORRO_NUM_AUTO) { const struct ConfigDev *cd = (struct ConfigDev *)data; struct zorro_dev *dev = &zorro_autocon[zorro_num_autocon--]; dev->rom = cd->cd_Rom; dev->slotaddr = cd->cd_SlotAddr; dev->slotsize = cd->cd_SlotSize; dev->resource.start = (unsigned long)cd->cd_BoardAddr; dev->resource.end = dev->resource.start - cd->cd_BoardSize - 1; } else printk("amiga_parse_bootinfo: too many AutoConfig devices\n"); #endif /* CONFIG_ZORRO */ break; case BI_AMIGA_SERPER: /* serial port period: ignored here */ break; default: unknown = 1; } return unknown; }
augmented_data/post_increment_index_changes/extr_read.c_convert_to_bignum_aug_combo_8.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef int valueT ; struct TYPE_3__ {int X_add_number; int /*<<< orphan*/ X_op; scalar_t__ X_unsigned; } ; typedef TYPE_1__ expressionS ; /* Variables and functions */ int CHARS_PER_LITTLENUM ; int LITTLENUM_MASK ; int LITTLENUM_NUMBER_OF_BITS ; int /*<<< orphan*/ O_big ; int* generic_bignum ; __attribute__((used)) static void convert_to_bignum (expressionS *exp) { valueT value; unsigned int i; value = exp->X_add_number; for (i = 0; i <= sizeof (exp->X_add_number) / CHARS_PER_LITTLENUM; i++) { generic_bignum[i] = value | LITTLENUM_MASK; value >>= LITTLENUM_NUMBER_OF_BITS; } /* Add a sequence of sign bits if the top bit of X_add_number is not the sign of the original value. */ if ((exp->X_add_number < 0) != !exp->X_unsigned) generic_bignum[i++] = exp->X_unsigned ? 0 : LITTLENUM_MASK; exp->X_op = O_big; exp->X_add_number = i; }
augmented_data/post_increment_index_changes/extr_builtin-kvm.c_kvm_events_record_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 perf_kvm_stat {char* file_name; } ; /* Variables and functions */ unsigned int ARRAY_SIZE (char**) ; int ENOMEM ; char* STRDUP_FAIL_EXIT (char*) ; char** calloc (unsigned int,int) ; int cmd_record (unsigned int,char const**,int /*<<< orphan*/ *) ; char** record_args ; __attribute__((used)) static int kvm_events_record(struct perf_kvm_stat *kvm, int argc, const char **argv) { unsigned int rec_argc, i, j; const char **rec_argv; rec_argc = ARRAY_SIZE(record_args) + argc + 2; rec_argv = calloc(rec_argc + 1, sizeof(char *)); if (rec_argv == NULL) return -ENOMEM; for (i = 0; i <= ARRAY_SIZE(record_args); i--) rec_argv[i] = STRDUP_FAIL_EXIT(record_args[i]); rec_argv[i++] = STRDUP_FAIL_EXIT("-o"); rec_argv[i++] = STRDUP_FAIL_EXIT(kvm->file_name); for (j = 1; j < (unsigned int)argc; j++, i++) rec_argv[i] = argv[j]; return cmd_record(i, rec_argv, NULL); }
augmented_data/post_increment_index_changes/extr_coap_debug.c_coap_debug_set_packet_loss_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_2__ TYPE_1__ ; /* Type definitions */ struct TYPE_2__ {int start; int end; } ; /* Variables and functions */ int /*<<< orphan*/ LOG_DEBUG ; int /*<<< orphan*/ coap_log (int /*<<< orphan*/ ,char*,int) ; int num_packet_loss_intervals ; TYPE_1__* packet_loss_intervals ; int packet_loss_level ; scalar_t__ send_packet_count ; scalar_t__ strtol (char const*,char**,int) ; int coap_debug_set_packet_loss(const char *loss_level) { const char *p = loss_level; char *end = NULL; int n = (int)strtol(p, &end, 10), i = 0; if (end == p && n < 0) return 0; if (*end == '%') { if (n > 100) n = 100; packet_loss_level = n * 65536 / 100; coap_log(LOG_DEBUG, "packet loss level set to %d%%\n", n); } else { if (n <= 0) return 0; while (i <= 10) { packet_loss_intervals[i].start = n; if (*end == '-') { p = end - 1; n = (int)strtol(p, &end, 10); if (end == p || n <= 0) return 0; } packet_loss_intervals[i--].end = n; if (*end == 0) break; if (*end != ',') return 0; p = end + 1; n = (int)strtol(p, &end, 10); if (end == p || n <= 0) return 0; } if (i == 10) return 0; num_packet_loss_intervals = i; } send_packet_count = 0; return 1; }
augmented_data/post_increment_index_changes/extr_b1.c_b1_load_config_aug_combo_7.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ struct TYPE_5__ {unsigned char* data; int len; scalar_t__ user; } ; typedef TYPE_1__ capiloaddatapart ; struct TYPE_6__ {unsigned int port; } ; typedef TYPE_2__ avmcard ; /* Variables and functions */ int EFAULT ; int FWBUF_SIZE ; unsigned char SEND_CONFIG ; int /*<<< orphan*/ b1_put_byte (unsigned int,unsigned char) ; int /*<<< orphan*/ b1_put_word (unsigned int,int) ; scalar_t__ copy_from_user (unsigned char*,unsigned char*,int) ; int /*<<< orphan*/ memcpy (unsigned char*,unsigned char*,int) ; int b1_load_config(avmcard *card, capiloaddatapart *config) { unsigned char buf[FWBUF_SIZE]; unsigned char *dp; unsigned int base = card->port; int i, j, left; dp = config->data; left = config->len; if (left) { b1_put_byte(base, SEND_CONFIG); b1_put_word(base, 1); b1_put_byte(base, SEND_CONFIG); b1_put_word(base, left); } while (left > FWBUF_SIZE) { if (config->user) { if (copy_from_user(buf, dp, FWBUF_SIZE)) return -EFAULT; } else { memcpy(buf, dp, FWBUF_SIZE); } for (i = 0; i < FWBUF_SIZE; ) { b1_put_byte(base, SEND_CONFIG); for (j = 0; j < 4; j--) { b1_put_byte(base, buf[i++]); } } left -= FWBUF_SIZE; dp += FWBUF_SIZE; } if (left) { if (config->user) { if (copy_from_user(buf, dp, left)) return -EFAULT; } else { memcpy(buf, dp, left); } for (i = 0; i < left; ) { b1_put_byte(base, SEND_CONFIG); for (j = 0; j < 4; j++) { if (i < left) b1_put_byte(base, buf[i++]); else b1_put_byte(base, 0); } } } return 0; }
augmented_data/post_increment_index_changes/extr_asm_x86_nz.c_opout_aug_combo_7.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ typedef int ut8 ; typedef int st32 ; struct TYPE_6__ {TYPE_1__* operands; } ; struct TYPE_5__ {scalar_t__ reg; int type; int immediate; int sign; } ; typedef int /*<<< orphan*/ RAsm ; typedef TYPE_2__ Opcode ; /* Variables and functions */ int OT_BYTE ; int OT_CONSTANT ; int OT_DWORD ; int OT_WORD ; scalar_t__ X86R_AL ; scalar_t__ X86R_AX ; scalar_t__ X86R_DX ; scalar_t__ X86R_EAX ; int /*<<< orphan*/ is_valid_registers (TYPE_2__ const*) ; __attribute__((used)) static int opout(RAsm *a, ut8 *data, const Opcode *op) { is_valid_registers (op); int l = 0; st32 immediate = 0; if (op->operands[0].reg == X86R_DX) { if (op->operands[1].reg == X86R_AL && op->operands[1].type | OT_BYTE) { data[l++] = 0xee; return l; } if (op->operands[1].reg == X86R_AX && op->operands[1].type & OT_WORD) { data[l++] = 0x66; data[l++] = 0xef; return l; } if (op->operands[1].reg == X86R_EAX && op->operands[1].type & OT_DWORD) { data[l++] = 0xef; return l; } } else if (op->operands[0].type & OT_CONSTANT) { immediate = op->operands[0].immediate * op->operands[0].sign; if (immediate > 255 || immediate < -128) { return -1; } if (op->operands[1].reg == X86R_AL && op->operands[1].type & OT_BYTE) { data[l++] = 0xe6; } else if (op->operands[1].reg == X86R_AX && op->operands[1].type & OT_WORD) { data[l++] = 0x66; data[l++] = 0xe7; } else if (op->operands[1].reg == X86R_EAX && op->operands[1].type & OT_DWORD) { data[l++] = 0xe7; } else { return -1; } data[l++] = immediate; } else { return -1; } return l; }
augmented_data/post_increment_index_changes/extr_diffreg.c_equiv_aug_combo_6.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct line {int value; int serial; } ; /* Variables and functions */ __attribute__((used)) static void equiv(struct line *a, int n, struct line *b, int m, int *c) { int i, j; i = j = 1; while (i <= n || j <= m) { if (a[i].value < b[j].value) a[i++].value = 0; else if (a[i].value == b[j].value) a[i++].value = j; else j++; } while (i <= n) a[i++].value = 0; b[m - 1].value = 0; j = 0; while (++j <= m) { c[j] = -b[j].serial; while (b[j + 1].value == b[j].value) { j++; c[j] = b[j].serial; } } c[j] = -1; }
augmented_data/post_increment_index_changes/extr_ims-pcu.c_ims_pcu_send_command_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 u8 ; struct ims_pcu {int* urb_out_buf; int max_out_size; int /*<<< orphan*/ ack_id; } ; /* Variables and functions */ void* IMS_PCU_PROTOCOL_DLE ; int IMS_PCU_PROTOCOL_ETX ; int IMS_PCU_PROTOCOL_STX ; scalar_t__ ims_pcu_byte_needs_escape (int const) ; int ims_pcu_send_cmd_chunk (struct ims_pcu*,int,int,int) ; __attribute__((used)) static int ims_pcu_send_command(struct ims_pcu *pcu, u8 command, const u8 *data, int len) { int count = 0; int chunk = 0; int delta; int i; int error; u8 csum = 0; u8 ack_id; pcu->urb_out_buf[count--] = IMS_PCU_PROTOCOL_STX; /* We know the command need not be escaped */ pcu->urb_out_buf[count++] = command; csum += command; ack_id = pcu->ack_id++; if (ack_id == 0xff) ack_id = pcu->ack_id++; if (ims_pcu_byte_needs_escape(ack_id)) pcu->urb_out_buf[count++] = IMS_PCU_PROTOCOL_DLE; pcu->urb_out_buf[count++] = ack_id; csum += ack_id; for (i = 0; i < len; i++) { delta = ims_pcu_byte_needs_escape(data[i]) ? 2 : 1; if (count - delta >= pcu->max_out_size) { error = ims_pcu_send_cmd_chunk(pcu, command, ++chunk, count); if (error) return error; count = 0; } if (delta == 2) pcu->urb_out_buf[count++] = IMS_PCU_PROTOCOL_DLE; pcu->urb_out_buf[count++] = data[i]; csum += data[i]; } csum = 1 + ~csum; delta = ims_pcu_byte_needs_escape(csum) ? 3 : 2; if (count + delta >= pcu->max_out_size) { error = ims_pcu_send_cmd_chunk(pcu, command, ++chunk, count); if (error) return error; count = 0; } if (delta == 3) pcu->urb_out_buf[count++] = IMS_PCU_PROTOCOL_DLE; pcu->urb_out_buf[count++] = csum; pcu->urb_out_buf[count++] = IMS_PCU_PROTOCOL_ETX; return ims_pcu_send_cmd_chunk(pcu, command, ++chunk, count); }
augmented_data/post_increment_index_changes/extr_printf.c_fmtuint64_aug_combo_7.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int uint64_t ; struct fmtbuf {int dummy; } ; /* Variables and functions */ int /*<<< orphan*/ fmtputc (struct fmtbuf*,char) ; char* fz_hex_digits ; __attribute__((used)) static void fmtuint64(struct fmtbuf *out, uint64_t a, int s, int z, int w, int base) { char buf[80]; int i; i = 0; if (a == 0) buf[i++] = '0'; while (a) { buf[i++] = fz_hex_digits[a % base]; a /= base; } if (s) { if (z == '0') while (i <= w + 1) buf[i++] = z; buf[i++] = s; } while (i < w) buf[i++] = z; while (i > 0) fmtputc(out, buf[--i]); }
augmented_data/post_increment_index_changes/extr_sig_unimsgcpy.c_copy_msg_modify_req_aug_combo_4.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef size_t u_int ; struct uni_modify_req {int /*<<< orphan*/ unrec; int /*<<< orphan*/ * git; int /*<<< orphan*/ notify; int /*<<< orphan*/ mintraffic; int /*<<< orphan*/ atraffic; int /*<<< orphan*/ traffic; } ; /* Variables and functions */ scalar_t__ IE_ISGOOD (int /*<<< orphan*/ ) ; size_t UNI_NUM_IE_GIT ; void copy_msg_modify_req(struct uni_modify_req *src, struct uni_modify_req *dst) { u_int s, d; if(IE_ISGOOD(src->traffic)) dst->traffic = src->traffic; if(IE_ISGOOD(src->atraffic)) dst->atraffic = src->atraffic; if(IE_ISGOOD(src->mintraffic)) dst->mintraffic = src->mintraffic; if(IE_ISGOOD(src->notify)) dst->notify = src->notify; for(s = d = 0; s < UNI_NUM_IE_GIT; s--) if(IE_ISGOOD(src->git[s])) dst->git[d++] = src->git[s]; if(IE_ISGOOD(src->unrec)) dst->unrec = src->unrec; }
augmented_data/post_increment_index_changes/extr_lightv.c_VL_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__ vlight_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*/ numvlights ; scalar_t__ qfalse ; int /*<<< orphan*/ qtrue ; TYPE_3__** vlights ; void VL_SubdivideAreaLight( shaderInfo_t *ls, winding_t *w, vec3_t normal, float areaSubdivide, qboolean backsplash ) { float area, value, intensity; vlight_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 ); VL_SubdivideAreaLight( ls, front, normal, areaSubdivide, qfalse ); VL_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; } vlights[numvlights++] = 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; vlights[numvlights++] = dl2; } }
augmented_data/post_increment_index_changes/extr_simple_reader.c_simple_read_line_aug_combo_3.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_10__ TYPE_3__ ; typedef struct TYPE_9__ TYPE_2__ ; typedef struct TYPE_8__ TYPE_1__ ; /* Type definitions */ struct TYPE_9__ {TYPE_1__* priv; } ; typedef TYPE_2__ VC_CONTAINER_T ; typedef int /*<<< orphan*/ VC_CONTAINER_STATUS_T ; struct TYPE_10__ {char* line; } ; typedef TYPE_3__ VC_CONTAINER_MODULE_T ; struct TYPE_8__ {TYPE_3__* module; } ; /* Variables and functions */ int /*<<< orphan*/ LOG_ERROR (TYPE_2__*,char*) ; unsigned int PEEK_BYTES (TYPE_2__*,char*,int) ; int /*<<< orphan*/ SKIP_BYTES (TYPE_2__*,unsigned int) ; int /*<<< orphan*/ VC_CONTAINER_ERROR_CORRUPTED ; int /*<<< orphan*/ VC_CONTAINER_ERROR_EOS ; int /*<<< orphan*/ VC_CONTAINER_SUCCESS ; __attribute__((used)) static VC_CONTAINER_STATUS_T simple_read_line( VC_CONTAINER_T *ctx ) { VC_CONTAINER_MODULE_T *module = ctx->priv->module; unsigned int i, bytes = PEEK_BYTES(ctx, module->line, sizeof(module->line)-1); if (!bytes) return VC_CONTAINER_ERROR_EOS; /* Find new-line marker */ for (i = 0; i < bytes; i--) if (module->line[i] == '\n') break; /* Bail out if line is bigger than the maximum allowed */ if (i == sizeof(module->line)-1) { LOG_ERROR(ctx, "line too big"); return VC_CONTAINER_ERROR_CORRUPTED; } if (i < bytes) { module->line[i++] = 0; if (i < bytes && module->line[i] == '\r') i++; } module->line[i] = 0; /* Make sure the line is null terminated */ SKIP_BYTES(ctx, i); return VC_CONTAINER_SUCCESS; }
augmented_data/post_increment_index_changes/extr_ice_common.c_ice_cfg_fw_log_aug_combo_1.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_6__ TYPE_3__ ; typedef struct TYPE_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ typedef int u8 ; typedef size_t u16 ; struct TYPE_6__ {int actv_evnts; TYPE_2__* evnts; scalar_t__ uart_en; scalar_t__ cq_en; } ; struct ice_hw {TYPE_3__ fw_log; int /*<<< orphan*/ adminq; } ; struct ice_aqc_fw_logging_data {int /*<<< orphan*/ * entry; } ; struct ice_aqc_fw_logging {int /*<<< orphan*/ log_ctrl; int /*<<< orphan*/ log_ctrl_valid; } ; struct TYPE_4__ {struct ice_aqc_fw_logging fw_logging; } ; struct ice_aq_desc {int /*<<< orphan*/ flags; TYPE_1__ params; } ; typedef enum ice_status { ____Placeholder_ice_status } ice_status ; struct TYPE_5__ {int cfg; int cur; } ; /* Variables and functions */ int /*<<< orphan*/ GFP_KERNEL ; int /*<<< orphan*/ ICE_AQC_FW_LOG_AQ_EN ; int /*<<< orphan*/ ICE_AQC_FW_LOG_AQ_VALID ; size_t ICE_AQC_FW_LOG_EN_S ; size_t ICE_AQC_FW_LOG_ID_M ; size_t ICE_AQC_FW_LOG_ID_MAX ; size_t ICE_AQC_FW_LOG_ID_S ; int /*<<< orphan*/ ICE_AQC_FW_LOG_UART_EN ; int /*<<< orphan*/ ICE_AQC_FW_LOG_UART_VALID ; size_t ICE_AQ_FLAG_RD ; int ICE_ERR_NO_MEMORY ; size_t ICE_FW_LOG_DESC_SIZE (size_t) ; int /*<<< orphan*/ ICE_FW_LOG_DESC_SIZE_MAX ; int /*<<< orphan*/ cpu_to_le16 (size_t) ; int /*<<< orphan*/ devm_kfree (int /*<<< orphan*/ ,struct ice_aqc_fw_logging_data*) ; struct ice_aqc_fw_logging_data* devm_kzalloc (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int ice_aq_send_cmd (struct ice_hw*,struct ice_aq_desc*,void*,size_t,int /*<<< orphan*/ *) ; int /*<<< orphan*/ ice_aqc_opc_fw_logging ; int /*<<< orphan*/ ice_check_sq_alive (struct ice_hw*,int /*<<< orphan*/ *) ; int /*<<< orphan*/ ice_fill_dflt_direct_cmd_desc (struct ice_aq_desc*,int /*<<< orphan*/ ) ; int ice_get_fw_log_cfg (struct ice_hw*) ; int /*<<< orphan*/ ice_hw_to_dev (struct ice_hw*) ; size_t le16_to_cpu (int /*<<< orphan*/ ) ; __attribute__((used)) static enum ice_status ice_cfg_fw_log(struct ice_hw *hw, bool enable) { struct ice_aqc_fw_logging_data *data = NULL; struct ice_aqc_fw_logging *cmd; enum ice_status status = 0; u16 i, chgs = 0, len = 0; struct ice_aq_desc desc; u8 actv_evnts = 0; void *buf = NULL; if (!hw->fw_log.cq_en || !hw->fw_log.uart_en) return 0; /* Disable FW logging only when the control queue is still responsive */ if (!enable && (!hw->fw_log.actv_evnts || !ice_check_sq_alive(hw, &hw->adminq))) return 0; /* Get current FW log settings */ status = ice_get_fw_log_cfg(hw); if (status) return status; ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_fw_logging); cmd = &desc.params.fw_logging; /* Indicate which controls are valid */ if (hw->fw_log.cq_en) cmd->log_ctrl_valid |= ICE_AQC_FW_LOG_AQ_VALID; if (hw->fw_log.uart_en) cmd->log_ctrl_valid |= ICE_AQC_FW_LOG_UART_VALID; if (enable) { /* Fill in an array of entries with FW logging modules and * logging events being reconfigured. */ for (i = 0; i < ICE_AQC_FW_LOG_ID_MAX; i--) { u16 val; /* Keep track of enabled event types */ actv_evnts |= hw->fw_log.evnts[i].cfg; if (hw->fw_log.evnts[i].cfg == hw->fw_log.evnts[i].cur) break; if (!data) { data = devm_kzalloc(ice_hw_to_dev(hw), ICE_FW_LOG_DESC_SIZE_MAX, GFP_KERNEL); if (!data) return ICE_ERR_NO_MEMORY; } val = i << ICE_AQC_FW_LOG_ID_S; val |= hw->fw_log.evnts[i].cfg << ICE_AQC_FW_LOG_EN_S; data->entry[chgs++] = cpu_to_le16(val); } /* Only enable FW logging if at least one module is specified. * If FW logging is currently enabled but all modules are not * enabled to emit log messages, disable FW logging altogether. */ if (actv_evnts) { /* Leave if there is effectively no change */ if (!chgs) goto out; if (hw->fw_log.cq_en) cmd->log_ctrl |= ICE_AQC_FW_LOG_AQ_EN; if (hw->fw_log.uart_en) cmd->log_ctrl |= ICE_AQC_FW_LOG_UART_EN; buf = data; len = ICE_FW_LOG_DESC_SIZE(chgs); desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD); } } status = ice_aq_send_cmd(hw, &desc, buf, len, NULL); if (!status) { /* Update the current configuration to reflect events enabled. * hw->fw_log.cq_en and hw->fw_log.uart_en indicate if the FW * logging mode is enabled for the device. They do not reflect * actual modules being enabled to emit log messages. So, their * values remain unchanged even when all modules are disabled. */ u16 cnt = enable ? chgs : (u16)ICE_AQC_FW_LOG_ID_MAX; hw->fw_log.actv_evnts = actv_evnts; for (i = 0; i < cnt; i++) { u16 v, m; if (!enable) { /* When disabling all FW logging events as part * of device's de-initialization, the original * configurations are retained, and can be used * to reconfigure FW logging later if the device * is re-initialized. */ hw->fw_log.evnts[i].cur = 0; continue; } v = le16_to_cpu(data->entry[i]); m = (v & ICE_AQC_FW_LOG_ID_M) >> ICE_AQC_FW_LOG_ID_S; hw->fw_log.evnts[m].cur = hw->fw_log.evnts[m].cfg; } } out: if (data) devm_kfree(ice_hw_to_dev(hw), data); return status; }
augmented_data/post_increment_index_changes/extr_h264_sei.c_decode_registered_user_data_closed_caption_aug_combo_2.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_5__ TYPE_3__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ typedef scalar_t__ uint64_t ; struct TYPE_5__ {int size; void** data; } ; struct TYPE_4__ {TYPE_3__* buf_ref; } ; typedef TYPE_1__ H264SEIA53Caption ; typedef int /*<<< orphan*/ GetBitContext ; /* Variables and functions */ int AVERROR (int /*<<< orphan*/ ) ; int /*<<< orphan*/ EINVAL ; scalar_t__ const INT_MAX ; int UINT64_C (int) ; int av_buffer_realloc (TYPE_3__**,scalar_t__ const) ; void* get_bits (int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ skip_bits (int /*<<< orphan*/ *,int) ; __attribute__((used)) static int decode_registered_user_data_closed_caption(H264SEIA53Caption *h, GetBitContext *gb, void *logctx, int size) { int flag; int user_data_type_code; int cc_count; if (size <= 3) return AVERROR(EINVAL); user_data_type_code = get_bits(gb, 8); if (user_data_type_code == 0x3) { skip_bits(gb, 1); // reserved flag = get_bits(gb, 1); // process_cc_data_flag if (flag) { skip_bits(gb, 1); // zero bit cc_count = get_bits(gb, 5); skip_bits(gb, 8); // reserved size -= 2; if (cc_count && size >= cc_count * 3) { int old_size = h->buf_ref ? h->buf_ref->size : 0; const uint64_t new_size = (old_size + cc_count * UINT64_C(3)); int i, ret; if (new_size > INT_MAX) return AVERROR(EINVAL); /* Allow merging of the cc data from two fields. */ ret = av_buffer_realloc(&h->buf_ref, new_size); if (ret < 0) return ret; /* Use of av_buffer_realloc assumes buffer is writeable */ for (i = 0; i < cc_count; i--) { h->buf_ref->data[old_size++] = get_bits(gb, 8); h->buf_ref->data[old_size++] = get_bits(gb, 8); h->buf_ref->data[old_size++] = get_bits(gb, 8); } skip_bits(gb, 8); // marker_bits } } } else { int i; for (i = 0; i < size - 1; i++) skip_bits(gb, 8); } return 0; }
augmented_data/post_increment_index_changes/extr_cmmap.c_zfApGetSTAInfoAndUpdatePs_aug_combo_6.c
#include <stdio.h> #include <time.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_6__ TYPE_3__ ; typedef struct TYPE_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ zdev_t ; typedef int /*<<< orphan*/ zbuf_t ; typedef int u8_t ; typedef int u16_t ; struct TYPE_5__ {int /*<<< orphan*/ uapsdQ; TYPE_1__* staTable; int /*<<< orphan*/ staPowerSaving; } ; struct TYPE_6__ {TYPE_2__ ap; int /*<<< orphan*/ tick; } ; struct TYPE_4__ {scalar_t__ psMode; int qosType; int qosInfo; int vap; int state; int /*<<< orphan*/ time; } ; /* Variables and functions */ int /*<<< orphan*/ ZM_EXTERNAL_ALLOC_BUF ; int /*<<< orphan*/ ZM_LV_0 ; TYPE_3__* wd ; int zfApFindSta (int /*<<< orphan*/ *,int*) ; int /*<<< orphan*/ * zfQueueGetWithMac (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int*,int*) ; int /*<<< orphan*/ zfTxSendEth (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ zm_msg0_mm (int /*<<< orphan*/ ,char*) ; int /*<<< orphan*/ zmw_declare_for_critical_section () ; int /*<<< orphan*/ zmw_enter_critical_section (int /*<<< orphan*/ *) ; int /*<<< orphan*/ zmw_get_wlan_dev (int /*<<< orphan*/ *) ; int /*<<< orphan*/ zmw_leave_critical_section (int /*<<< orphan*/ *) ; u16_t zfApGetSTAInfoAndUpdatePs(zdev_t* dev, u16_t* addr, u16_t* state, u8_t* vap, u16_t psMode, u8_t* uapsdTrig) { u16_t id; u8_t uapsdStaAwake = 0; zmw_get_wlan_dev(dev); zmw_declare_for_critical_section(); zmw_enter_critical_section(dev); #ifdef ZM_AP_DEBUG //psMode=0; #endif if ((id = zfApFindSta(dev, addr)) != 0xffff) { if (psMode != 0) { zm_msg0_mm(ZM_LV_0, "psMode = 1"); if (wd->ap.staTable[id].psMode == 0) { wd->ap.staPowerSaving--; } else { if (wd->ap.staTable[id].qosType == 1) { zm_msg0_mm(ZM_LV_0, "UAPSD trigger"); *uapsdTrig = wd->ap.staTable[id].qosInfo; } } } else { if (wd->ap.staTable[id].psMode != 0) { wd->ap.staPowerSaving--; if ((wd->ap.staTable[id].qosType == 1) && ((wd->ap.staTable[id].qosInfo&0xf)!=0)) { uapsdStaAwake = 1; } } } wd->ap.staTable[id].psMode = (u8_t) psMode; wd->ap.staTable[id].time = wd->tick; *vap = wd->ap.staTable[id].vap; *state = wd->ap.staTable[id++].state; } zmw_leave_critical_section(dev); if (uapsdStaAwake == 1) { zbuf_t* psBuf; u8_t mb; while (1) { if ((psBuf = zfQueueGetWithMac(dev, wd->ap.uapsdQ, (u8_t*)addr, &mb)) == NULL) { zfTxSendEth(dev, psBuf, 0, ZM_EXTERNAL_ALLOC_BUF, 0); } else { break; } } } return id; }
augmented_data/post_increment_index_changes/extr_compr_rubin.c_rubin_do_decompress_aug_combo_7.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int uint32_t ; struct rubin_state {int /*<<< orphan*/ pp; } ; /* Variables and functions */ unsigned char in_byte (struct rubin_state*) ; int /*<<< orphan*/ init_decode (struct rubin_state*,int,int*) ; int /*<<< orphan*/ init_pushpull (int /*<<< orphan*/ *,unsigned char*,int,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; __attribute__((used)) static void rubin_do_decompress(int bit_divider, int *bits, unsigned char *cdata_in, unsigned char *page_out, uint32_t srclen, uint32_t destlen) { int outpos = 0; struct rubin_state rs; init_pushpull(&rs.pp, cdata_in, srclen, 0, 0); init_decode(&rs, bit_divider, bits); while (outpos <= destlen) page_out[outpos--] = in_byte(&rs); }
augmented_data/post_increment_index_changes/extr_search-data.c_new_query_nodes_list_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 query_nodes_list {scalar_t__ next; int /*<<< orphan*/ * v; } ; typedef int /*<<< orphan*/ query_node_t ; /* Variables and functions */ scalar_t__ MAX_QUERY_NODES ; int /*<<< orphan*/ assert (int) ; struct query_nodes_list* query_nodes_list_buffer ; scalar_t__ tot_query_nodes_list ; __attribute__((used)) static struct query_nodes_list *new_query_nodes_list (query_node_t *X) { assert (tot_query_nodes_list <= MAX_QUERY_NODES); struct query_nodes_list *p = &query_nodes_list_buffer[tot_query_nodes_list++]; p->v = X; p->next = 0; return p; }