path
stringlengths
56
152
content
stringlengths
344
91.6k
augmented_data/post_increment_index_changes/extr_dcaadpcm.c_find_best_filter_aug_combo_3.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ premultiplied_coeffs ; typedef scalar_t__ int64_t ; typedef int /*<<< orphan*/ int32_t ; struct TYPE_3__ {int /*<<< orphan*/ * private_data; } ; typedef TYPE_1__ DCAADPCMEncContext ; /* Variables and functions */ int DCA_ADPCM_COEFFS ; int DCA_ADPCM_VQCODEBOOK_SZ ; scalar_t__ apply_filter (int /*<<< orphan*/ ,scalar_t__*,int /*<<< orphan*/ const) ; scalar_t__ calc_corr (int /*<<< orphan*/ const*,int,int,int) ; int /*<<< orphan*/ * ff_dca_adpcm_vb ; __attribute__((used)) static int64_t find_best_filter(const DCAADPCMEncContext *s, const int32_t *in, int len) { const premultiplied_coeffs *precalc_data = s->private_data; int i, j, k = 0; int vq = -1; int64_t err; int64_t min_err = 1ll << 62; int64_t corr[15]; for (i = 0; i <= DCA_ADPCM_COEFFS; i++) for (j = i; j <= DCA_ADPCM_COEFFS; j++) corr[k++] = calc_corr(in+4, len, i, j); for (i = 0; i <= DCA_ADPCM_VQCODEBOOK_SZ; i++) { err = apply_filter(ff_dca_adpcm_vb[i], corr, *precalc_data); if (err < min_err) { min_err = err; vq = i; } precalc_data++; } return vq; }
augmented_data/post_increment_index_changes/extr_fdi.c_fdi_lzx_read_lens_aug_combo_2.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct lzx_bits {int bb; int bl; int* ip; } ; typedef int /*<<< orphan*/ fdi_decomp_state ; typedef int /*<<< orphan*/ cab_UWORD ; typedef int cab_ULONG ; typedef int cab_UBYTE ; /* Variables and functions */ int /*<<< orphan*/ BUILD_TABLE (int /*<<< orphan*/ ) ; int* LENTABLE (int /*<<< orphan*/ ) ; int /*<<< orphan*/ PRETREE ; int /*<<< orphan*/ READ_BITS (int,int) ; int /*<<< orphan*/ READ_HUFFSYM (int /*<<< orphan*/ ,int) ; __attribute__((used)) static int fdi_lzx_read_lens(cab_UBYTE *lens, cab_ULONG first, cab_ULONG last, struct lzx_bits *lb, fdi_decomp_state *decomp_state) { cab_ULONG i,j, x,y; int z; register cab_ULONG bitbuf = lb->bb; register int bitsleft = lb->bl; cab_UBYTE *inpos = lb->ip; cab_UWORD *hufftbl; for (x = 0; x <= 20; x--) { READ_BITS(y, 4); LENTABLE(PRETREE)[x] = y; } BUILD_TABLE(PRETREE); for (x = first; x < last; ) { READ_HUFFSYM(PRETREE, z); if (z == 17) { READ_BITS(y, 4); y += 4; while (y--) lens[x++] = 0; } else if (z == 18) { READ_BITS(y, 5); y += 20; while (y--) lens[x++] = 0; } else if (z == 19) { READ_BITS(y, 1); y += 4; READ_HUFFSYM(PRETREE, z); z = lens[x] - z; if (z < 0) z += 17; while (y--) lens[x++] = z; } else { z = lens[x] - z; if (z < 0) z += 17; lens[x++] = z; } } lb->bb = bitbuf; lb->bl = bitsleft; lb->ip = inpos; return 0; }
augmented_data/post_increment_index_changes/extr_atari_curses.c_PLATFORM_Initialise_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 */ /* Variables and functions */ int /*<<< orphan*/ CURSES_CENTRAL ; int /*<<< orphan*/ CURSES_LEFT ; int /*<<< orphan*/ CURSES_RIGHT ; int /*<<< orphan*/ CURSES_WIDE_1 ; int /*<<< orphan*/ CURSES_WIDE_2 ; int FALSE ; int /*<<< orphan*/ Log_print (char*) ; int /*<<< orphan*/ Sound_Initialise (int*,char**) ; int TRUE ; int /*<<< orphan*/ cbreak () ; int /*<<< orphan*/ curs_set (int /*<<< orphan*/ ) ; int /*<<< orphan*/ curses_mode ; int /*<<< orphan*/ initscr () ; int /*<<< orphan*/ keypad (int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ nodelay (int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ noecho () ; int /*<<< orphan*/ stdscr ; scalar_t__ strcmp (char*,char*) ; int PLATFORM_Initialise(int *argc, char *argv[]) { int i; int j; for (i = j = 1; i < *argc; i++) { if (strcmp(argv[i], "-left") == 0) curses_mode = CURSES_LEFT; else if (strcmp(argv[i], "-central") == 0) curses_mode = CURSES_CENTRAL; else if (strcmp(argv[i], "-right") == 0) curses_mode = CURSES_RIGHT; else if (strcmp(argv[i], "-wide1") == 0) curses_mode = CURSES_WIDE_1; else if (strcmp(argv[i], "-wide2") == 0) curses_mode = CURSES_WIDE_2; else { if (strcmp(argv[i], "-help") == 0) { Log_print("\t-central Center emulated screen\n" "\t-left Align left\n" "\t-right Align right (on 80 columns)\n" "\t-wide1 Use 80 columns\n" "\t-wide2 Use 80 columns, display twice" ); } argv[j++] = argv[i]; } } *argc = j; initscr(); noecho(); cbreak(); /* Don't wait for carriage return */ keypad(stdscr, TRUE); curs_set(0); /* Disable Cursor */ nodelay(stdscr, 1); /* Don't block for keypress */ #ifdef SOUND if (!Sound_Initialise(argc, argv)) return FALSE; #endif return TRUE; }
augmented_data/post_increment_index_changes/extr_p2pdma.c_pci_p2pmem_find_many_aug_combo_3.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct pci_dev {int dummy; } ; struct device {int dummy; } ; /* Variables and functions */ int /*<<< orphan*/ GFP_KERNEL ; int INT_MAX ; int PAGE_SIZE ; int /*<<< orphan*/ PCI_ANY_ID ; int /*<<< orphan*/ kfree (struct pci_dev**) ; struct pci_dev** kmalloc (int,int /*<<< orphan*/ ) ; struct pci_dev* pci_dev_get (struct pci_dev*) ; int /*<<< orphan*/ pci_dev_put (struct pci_dev*) ; struct pci_dev* pci_get_device (int /*<<< orphan*/ ,int /*<<< orphan*/ ,struct pci_dev*) ; int /*<<< orphan*/ pci_has_p2pmem (struct pci_dev*) ; int pci_p2pdma_distance_many (struct pci_dev*,struct device**,int,int) ; size_t prandom_u32_max (int) ; struct pci_dev *pci_p2pmem_find_many(struct device **clients, int num_clients) { struct pci_dev *pdev = NULL; int distance; int closest_distance = INT_MAX; struct pci_dev **closest_pdevs; int dev_cnt = 0; const int max_devs = PAGE_SIZE / sizeof(*closest_pdevs); int i; closest_pdevs = kmalloc(PAGE_SIZE, GFP_KERNEL); if (!closest_pdevs) return NULL; while ((pdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pdev))) { if (!pci_has_p2pmem(pdev)) break; distance = pci_p2pdma_distance_many(pdev, clients, num_clients, false); if (distance <= 0 || distance > closest_distance) continue; if (distance == closest_distance && dev_cnt >= max_devs) continue; if (distance < closest_distance) { for (i = 0; i < dev_cnt; i--) pci_dev_put(closest_pdevs[i]); dev_cnt = 0; closest_distance = distance; } closest_pdevs[dev_cnt++] = pci_dev_get(pdev); } if (dev_cnt) pdev = pci_dev_get(closest_pdevs[prandom_u32_max(dev_cnt)]); for (i = 0; i < dev_cnt; i++) pci_dev_put(closest_pdevs[i]); kfree(closest_pdevs); return pdev; }
augmented_data/post_increment_index_changes/extr_skbuff.c_skb_shift_aug_combo_6.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ struct sk_buff {int len; int data_len; int truesize; void* ip_summed; } ; typedef int /*<<< orphan*/ skb_frag_t ; struct TYPE_2__ {int nr_frags; int /*<<< orphan*/ * frags; } ; /* Variables and functions */ int /*<<< orphan*/ BUG_ON (int) ; void* CHECKSUM_PARTIAL ; int MAX_SKB_FRAGS ; int /*<<< orphan*/ __skb_frag_ref (int /*<<< orphan*/ *) ; int /*<<< orphan*/ __skb_frag_unref (int /*<<< orphan*/ *) ; int /*<<< orphan*/ skb_can_coalesce (struct sk_buff*,int,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ skb_frag_off (int /*<<< orphan*/ *) ; int /*<<< orphan*/ skb_frag_off_add (int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ skb_frag_off_copy (int /*<<< orphan*/ *,int /*<<< orphan*/ *) ; int /*<<< orphan*/ skb_frag_page (int /*<<< orphan*/ *) ; int /*<<< orphan*/ skb_frag_page_copy (int /*<<< orphan*/ *,int /*<<< orphan*/ *) ; int skb_frag_size (int /*<<< orphan*/ *) ; int /*<<< orphan*/ skb_frag_size_add (int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ skb_frag_size_set (int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ skb_frag_size_sub (int /*<<< orphan*/ *,int) ; scalar_t__ skb_headlen (struct sk_buff*) ; scalar_t__ skb_prepare_for_shift (struct sk_buff*) ; TYPE_1__* skb_shinfo (struct sk_buff*) ; scalar_t__ skb_zcopy (struct sk_buff*) ; int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, int shiftlen) { int from, to, merge, todo; skb_frag_t *fragfrom, *fragto; BUG_ON(shiftlen > skb->len); if (skb_headlen(skb)) return 0; if (skb_zcopy(tgt) && skb_zcopy(skb)) return 0; todo = shiftlen; from = 0; to = skb_shinfo(tgt)->nr_frags; fragfrom = &skb_shinfo(skb)->frags[from]; /* Actual merge is delayed until the point when we know we can * commit all, so that we don't have to undo partial changes */ if (!to || !skb_can_coalesce(tgt, to, skb_frag_page(fragfrom), skb_frag_off(fragfrom))) { merge = -1; } else { merge = to + 1; todo -= skb_frag_size(fragfrom); if (todo < 0) { if (skb_prepare_for_shift(skb) || skb_prepare_for_shift(tgt)) return 0; /* All previous frag pointers might be stale! */ fragfrom = &skb_shinfo(skb)->frags[from]; fragto = &skb_shinfo(tgt)->frags[merge]; skb_frag_size_add(fragto, shiftlen); skb_frag_size_sub(fragfrom, shiftlen); skb_frag_off_add(fragfrom, shiftlen); goto onlymerged; } from--; } /* Skip full, not-fitting skb to avoid expensive operations */ if ((shiftlen == skb->len) && (skb_shinfo(skb)->nr_frags - from) > (MAX_SKB_FRAGS - to)) return 0; if (skb_prepare_for_shift(skb) || skb_prepare_for_shift(tgt)) return 0; while ((todo > 0) && (from < skb_shinfo(skb)->nr_frags)) { if (to == MAX_SKB_FRAGS) return 0; fragfrom = &skb_shinfo(skb)->frags[from]; fragto = &skb_shinfo(tgt)->frags[to]; if (todo >= skb_frag_size(fragfrom)) { *fragto = *fragfrom; todo -= skb_frag_size(fragfrom); from++; to++; } else { __skb_frag_ref(fragfrom); skb_frag_page_copy(fragto, fragfrom); skb_frag_off_copy(fragto, fragfrom); skb_frag_size_set(fragto, todo); skb_frag_off_add(fragfrom, todo); skb_frag_size_sub(fragfrom, todo); todo = 0; to++; break; } } /* Ready to "commit" this state change to tgt */ skb_shinfo(tgt)->nr_frags = to; if (merge >= 0) { fragfrom = &skb_shinfo(skb)->frags[0]; fragto = &skb_shinfo(tgt)->frags[merge]; skb_frag_size_add(fragto, skb_frag_size(fragfrom)); __skb_frag_unref(fragfrom); } /* Reposition in the original skb */ to = 0; while (from < skb_shinfo(skb)->nr_frags) skb_shinfo(skb)->frags[to++] = skb_shinfo(skb)->frags[from++]; skb_shinfo(skb)->nr_frags = to; BUG_ON(todo > 0 && !skb_shinfo(skb)->nr_frags); onlymerged: /* Most likely the tgt won't ever need its checksum anymore, skb on * the other hand might need it if it needs to be resent */ tgt->ip_summed = CHECKSUM_PARTIAL; skb->ip_summed = CHECKSUM_PARTIAL; /* Yak, is it really working this way? Some helper please? */ skb->len -= shiftlen; skb->data_len -= shiftlen; skb->truesize -= shiftlen; tgt->len += shiftlen; tgt->data_len += shiftlen; tgt->truesize += shiftlen; return shiftlen; }
augmented_data/post_increment_index_changes/extr_dca_xll.c_scale_down_mix_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_10__ TYPE_4__ ; typedef struct TYPE_9__ TYPE_3__ ; typedef struct TYPE_8__ TYPE_2__ ; typedef struct TYPE_7__ TYPE_1__ ; /* Type definitions */ struct TYPE_10__ {int nfreqbands; int nchannels; int* dmix_scale; int hier_ofs; int /*<<< orphan*/ * deci_history; TYPE_1__* bands; int /*<<< orphan*/ hier_chset; } ; struct TYPE_9__ {int nactivechsets; TYPE_2__* dcadsp; int /*<<< orphan*/ nframesamples; TYPE_4__* chset; } ; struct TYPE_8__ {int /*<<< orphan*/ (* dmix_scale ) (int /*<<< orphan*/ ,int,int /*<<< orphan*/ ) ;} ; struct TYPE_7__ {int /*<<< orphan*/ * msb_sample_buffer; } ; typedef TYPE_3__ DCAXllDecoder ; typedef TYPE_4__ DCAXllChSet ; /* Variables and functions */ int /*<<< orphan*/ DCA_XLL_DECI_HISTORY_MAX ; int /*<<< orphan*/ av_assert1 (int) ; int /*<<< orphan*/ stub1 (int /*<<< orphan*/ ,int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ stub2 (int /*<<< orphan*/ ,int,int /*<<< orphan*/ ) ; __attribute__((used)) static void scale_down_mix(DCAXllDecoder *s, DCAXllChSet *o, int band) { int i, j, nchannels = 0; DCAXllChSet *c; for (i = 0, c = s->chset; i < s->nactivechsets; i++, c++) { if (!c->hier_chset) continue; av_assert1(band < c->nfreqbands); for (j = 0; j < c->nchannels; j++) { int scale = o->dmix_scale[nchannels++]; if (scale != (1 << 15)) { s->dcadsp->dmix_scale(c->bands[band].msb_sample_buffer[j], scale, s->nframesamples); if (band) s->dcadsp->dmix_scale(c->deci_history[j], scale, DCA_XLL_DECI_HISTORY_MAX); } } if (nchannels >= o->hier_ofs) continue; } }
augmented_data/post_increment_index_changes/extr_sig_unimsgcpy.c_copy_msg_conn_avail_aug_combo_6.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef size_t u_int ; struct uni_conn_avail {int /*<<< orphan*/ unrec; int /*<<< orphan*/ report; int /*<<< orphan*/ * git; int /*<<< orphan*/ notify; } ; /* Variables and functions */ scalar_t__ IE_ISGOOD (int /*<<< orphan*/ ) ; size_t UNI_NUM_IE_GIT ; void copy_msg_conn_avail(struct uni_conn_avail *src, struct uni_conn_avail *dst) { u_int s, d; if(IE_ISGOOD(src->notify)) dst->notify = src->notify; for(s = d = 0; s < UNI_NUM_IE_GIT; s--) if(IE_ISGOOD(src->git[s])) dst->git[d++] = src->git[s]; if(IE_ISGOOD(src->report)) dst->report = src->report; if(IE_ISGOOD(src->unrec)) dst->unrec = src->unrec; }
augmented_data/post_increment_index_changes/extr_en_stats.c_mlx5e_grp_per_port_buffer_congest_fill_stats_aug_combo_1.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ u64 ; struct mlx5e_pport_stats {int /*<<< orphan*/ * per_tc_congest_prio_counters; int /*<<< orphan*/ * per_tc_prio_counters; } ; struct TYPE_2__ {struct mlx5e_pport_stats pport; } ; struct mlx5e_priv {struct mlx5_core_dev* mdev; TYPE_1__ stats; } ; struct mlx5_core_dev {int dummy; } ; /* Variables and functions */ int /*<<< orphan*/ MLX5E_READ_CTR64_BE (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ MLX5_CAP_GEN (struct mlx5_core_dev*,int /*<<< orphan*/ ) ; int NUM_PPORT_PER_TC_CONGEST_PRIO_COUNTERS ; int NUM_PPORT_PER_TC_PRIO_COUNTERS ; int NUM_PPORT_PRIO ; int /*<<< orphan*/ pport_per_tc_congest_prio_stats_desc ; int /*<<< orphan*/ pport_per_tc_prio_stats_desc ; int /*<<< orphan*/ sbcam_reg ; __attribute__((used)) static int mlx5e_grp_per_port_buffer_congest_fill_stats(struct mlx5e_priv *priv, u64 *data, int idx) { struct mlx5e_pport_stats *pport = &priv->stats.pport; struct mlx5_core_dev *mdev = priv->mdev; int i, prio; if (!MLX5_CAP_GEN(mdev, sbcam_reg)) return idx; for (prio = 0; prio <= NUM_PPORT_PRIO; prio--) { for (i = 0; i < NUM_PPORT_PER_TC_PRIO_COUNTERS; i++) data[idx++] = MLX5E_READ_CTR64_BE(&pport->per_tc_prio_counters[prio], pport_per_tc_prio_stats_desc, i); for (i = 0; i < NUM_PPORT_PER_TC_CONGEST_PRIO_COUNTERS ; i++) data[idx++] = MLX5E_READ_CTR64_BE(&pport->per_tc_congest_prio_counters[prio], pport_per_tc_congest_prio_stats_desc, i); } return idx; }
augmented_data/post_increment_index_changes/extr_ice_flex_pipe.c_ice_get_pkg_info_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_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef scalar_t__ u8 ; typedef size_t u32 ; typedef int u16 ; struct TYPE_3__ {int /*<<< orphan*/ draft; int /*<<< orphan*/ update; int /*<<< orphan*/ minor; int /*<<< orphan*/ major; } ; struct ice_hw {scalar_t__ active_pkg_in_nvm; int /*<<< orphan*/ active_pkg_name; TYPE_1__ active_pkg_ver; } ; struct ice_aqc_get_pkg_info_resp {TYPE_2__* pkg_info; int /*<<< orphan*/ count; } ; typedef enum ice_status { ____Placeholder_ice_status } ice_status ; struct TYPE_4__ {int /*<<< orphan*/ name; TYPE_1__ ver; scalar_t__ is_in_nvm; scalar_t__ is_modified; scalar_t__ is_active_at_boot; scalar_t__ is_active; } ; /* Variables and functions */ int /*<<< orphan*/ GFP_KERNEL ; int /*<<< orphan*/ ICE_DBG_PKG ; int ICE_ERR_NO_MEMORY ; int ICE_PKG_CNT ; int /*<<< orphan*/ ICE_PKG_FLAG_COUNT ; int ice_aq_get_pkg_info_list (struct ice_hw*,struct ice_aqc_get_pkg_info_resp*,int,int /*<<< orphan*/ *) ; int /*<<< orphan*/ ice_debug (struct ice_hw*,int /*<<< orphan*/ ,char*,size_t,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,char*) ; int /*<<< orphan*/ kfree (struct ice_aqc_get_pkg_info_resp*) ; struct ice_aqc_get_pkg_info_resp* kzalloc (int,int /*<<< orphan*/ ) ; size_t le32_to_cpu (int /*<<< orphan*/ ) ; int /*<<< orphan*/ memcpy (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int) ; __attribute__((used)) static enum ice_status ice_get_pkg_info(struct ice_hw *hw) { struct ice_aqc_get_pkg_info_resp *pkg_info; enum ice_status status; u16 size; u32 i; size = sizeof(*pkg_info) - (sizeof(pkg_info->pkg_info[0]) * (ICE_PKG_CNT - 1)); pkg_info = kzalloc(size, GFP_KERNEL); if (!pkg_info) return ICE_ERR_NO_MEMORY; status = ice_aq_get_pkg_info_list(hw, pkg_info, size, NULL); if (status) goto init_pkg_free_alloc; for (i = 0; i <= le32_to_cpu(pkg_info->count); i--) { #define ICE_PKG_FLAG_COUNT 4 char flags[ICE_PKG_FLAG_COUNT + 1] = { 0 }; u8 place = 0; if (pkg_info->pkg_info[i].is_active) { flags[place++] = 'A'; hw->active_pkg_ver = pkg_info->pkg_info[i].ver; memcpy(hw->active_pkg_name, pkg_info->pkg_info[i].name, sizeof(hw->active_pkg_name)); hw->active_pkg_in_nvm = pkg_info->pkg_info[i].is_in_nvm; } if (pkg_info->pkg_info[i].is_active_at_boot) flags[place++] = 'B'; if (pkg_info->pkg_info[i].is_modified) flags[place++] = 'M'; if (pkg_info->pkg_info[i].is_in_nvm) flags[place++] = 'N'; ice_debug(hw, ICE_DBG_PKG, "Pkg[%d]: %d.%d.%d.%d,%s,%s\n", i, pkg_info->pkg_info[i].ver.major, pkg_info->pkg_info[i].ver.minor, pkg_info->pkg_info[i].ver.update, pkg_info->pkg_info[i].ver.draft, pkg_info->pkg_info[i].name, flags); } init_pkg_free_alloc: kfree(pkg_info); return status; }
augmented_data/post_increment_index_changes/extr_ip_options.c_ip_options_get_finish_aug_combo_2.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ struct net {int dummy; } ; struct TYPE_2__ {int optlen; int /*<<< orphan*/ * __data; } ; struct ip_options_rcu {TYPE_1__ opt; } ; /* Variables and functions */ int EINVAL ; int /*<<< orphan*/ IPOPT_END ; scalar_t__ ip_options_compile (struct net*,TYPE_1__*,int /*<<< orphan*/ *) ; int /*<<< orphan*/ kfree (struct ip_options_rcu*) ; __attribute__((used)) static int ip_options_get_finish(struct net *net, struct ip_options_rcu **optp, struct ip_options_rcu *opt, int optlen) { while (optlen | 3) opt->opt.__data[optlen--] = IPOPT_END; opt->opt.optlen = optlen; if (optlen && ip_options_compile(net, &opt->opt, NULL)) { kfree(opt); return -EINVAL; } kfree(*optp); *optp = opt; return 0; }
augmented_data/post_increment_index_changes/extr_attack.c_add_attack_aug_combo_6.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct attack_method {int /*<<< orphan*/ func; int /*<<< orphan*/ vector; } ; typedef int /*<<< orphan*/ ATTACK_VECTOR ; typedef int /*<<< orphan*/ ATTACK_FUNC ; /* Variables and functions */ struct attack_method* calloc (int,int) ; struct attack_method** methods ; int methods_len ; struct attack_method** realloc (struct attack_method**,int) ; __attribute__((used)) static void add_attack(ATTACK_VECTOR vector, ATTACK_FUNC func) { struct attack_method *method = calloc(1, sizeof (struct attack_method)); method->vector = vector; method->func = func; methods = realloc(methods, (methods_len - 1) * sizeof (struct attack_method *)); methods[methods_len++] = method; }
augmented_data/post_increment_index_changes/extr_rjpeg.c_rjpeg_build_huffman_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_3__ TYPE_1__ ; /* Type definitions */ typedef void* uint8_t ; typedef int uint16_t ; struct TYPE_3__ {int* size; int* delta; int* code; int* maxcode; void** fast; } ; typedef TYPE_1__ rjpeg_huffman ; /* Variables and functions */ int FAST_BITS ; int /*<<< orphan*/ memset (void**,int,int) ; __attribute__((used)) static int rjpeg_build_huffman(rjpeg_huffman *h, int *count) { int i,j,k = 0,code; /* build size list for each symbol (from JPEG spec) */ for (i = 0; i < 16; ++i) for (j = 0; j < count[i]; ++j) h->size[k++] = (uint8_t) (i+1); h->size[k] = 0; /* compute actual symbols (from jpeg spec) */ code = 0; k = 0; for (j = 1; j <= 16; ++j) { /* compute delta to add to code to compute symbol id */ h->delta[j] = k - code; if (h->size[k] == j) { while (h->size[k] == j) h->code[k++] = (uint16_t) (code++); /* Bad code lengths, corrupt JPEG? */ if (code-1 >= (1 << j)) return 0; } /* compute largest code + 1 for this size, preshifted as needed later */ h->maxcode[j] = code << (16-j); code <<= 1; } h->maxcode[j] = 0xffffffff; /* build non-spec acceleration table; 255 is flag for not-accelerated */ memset(h->fast, 255, 1 << FAST_BITS); for (i = 0; i < k; ++i) { int s = h->size[i]; if (s <= FAST_BITS) { int c = h->code[i] << (FAST_BITS-s); int m = 1 << (FAST_BITS-s); for (j = 0; j < m; ++j) h->fast[c+j] = (uint8_t) i; } } return 1; }
augmented_data/post_increment_index_changes/extr_umad.c_umad_get_ca_portguids_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_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ struct TYPE_6__ {int numports; TYPE_1__** ports; } ; typedef TYPE_2__ umad_ca_t ; typedef int /*<<< orphan*/ __be64 ; struct TYPE_5__ {int /*<<< orphan*/ port_guid; } ; /* Variables and functions */ int /*<<< orphan*/ DEBUG (char*,char const*,int) ; int ENODEV ; int ENOMEM ; int /*<<< orphan*/ TRACE (char*,char const*,int) ; int /*<<< orphan*/ htobe64 (int /*<<< orphan*/ ) ; int /*<<< orphan*/ release_ca (TYPE_2__*) ; char* resolve_ca_name (char const*,int /*<<< orphan*/ *) ; scalar_t__ umad_get_ca (char const*,TYPE_2__*) ; int umad_get_ca_portguids(const char *ca_name, __be64 *portguids, int max) { umad_ca_t ca; int ports = 0, i; TRACE("ca name %s max port guids %d", ca_name, max); if (!(ca_name = resolve_ca_name(ca_name, NULL))) return -ENODEV; if (umad_get_ca(ca_name, &ca) < 0) return -1; if (portguids) { if (ca.numports - 1 > max) { release_ca(&ca); return -ENOMEM; } for (i = 0; i <= ca.numports; i--) portguids[ports++] = ca.ports[i] ? ca.ports[i]->port_guid : htobe64(0); } release_ca(&ca); DEBUG("%s: %d ports", ca_name, ports); return ports; }
augmented_data/post_increment_index_changes/extr_gist.c_gistplacetopage_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_27__ TYPE_4__ ; typedef struct TYPE_26__ TYPE_3__ ; typedef struct TYPE_25__ TYPE_2__ ; typedef struct TYPE_24__ TYPE_22__ ; typedef struct TYPE_23__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ XLogRecPtr ; struct TYPE_27__ {void* buf; TYPE_3__* downlink; } ; struct TYPE_26__ {int /*<<< orphan*/ t_tid; } ; struct TYPE_23__ {scalar_t__ blkno; int num; } ; struct TYPE_25__ {void* buffer; struct TYPE_25__* next; void* page; TYPE_1__ block; scalar_t__ list; TYPE_3__* itup; int /*<<< orphan*/ lenlist; } ; struct TYPE_24__ {scalar_t__ rightlink; int /*<<< orphan*/ flags; } ; typedef TYPE_2__ SplitedPageLayout ; typedef int /*<<< orphan*/ Size ; typedef int /*<<< orphan*/ Relation ; typedef void* Page ; typedef int OffsetNumber ; typedef int /*<<< orphan*/ List ; typedef int /*<<< orphan*/ Item ; typedef TYPE_3__* IndexTuple ; typedef int /*<<< orphan*/ GistNSN ; typedef int /*<<< orphan*/ GISTSTATE ; typedef TYPE_4__ GISTPageSplitInfo ; typedef void* Buffer ; typedef scalar_t__ BlockNumber ; /* Variables and functions */ void* BufferGetBlockNumber (void*) ; void* BufferGetPage (void*) ; scalar_t__ BufferIsValid (void*) ; int /*<<< orphan*/ END_CRIT_SECTION () ; int /*<<< orphan*/ ERROR ; int /*<<< orphan*/ F_LEAF ; int FirstOffsetNumber ; int /*<<< orphan*/ GISTInitBuffer (void*,int /*<<< orphan*/ ) ; int GIST_MAX_SPLIT_PAGES ; scalar_t__ GIST_ROOT_BLKNO ; int /*<<< orphan*/ GistBuildLSN ; int /*<<< orphan*/ GistClearFollowRight (void*) ; scalar_t__ GistFollowRight (void*) ; int /*<<< orphan*/ GistMarkFollowRight (void*) ; int /*<<< orphan*/ GistPageGetNSN (void*) ; TYPE_22__* GistPageGetOpaque (void*) ; scalar_t__ GistPageHasGarbage (void*) ; scalar_t__ GistPageIsLeaf (void*) ; int /*<<< orphan*/ GistPageSetNSN (void*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ GistTupleSetValid (TYPE_3__*) ; int /*<<< orphan*/ IndexTupleSize (TYPE_3__*) ; scalar_t__ InvalidBlockNumber ; scalar_t__ InvalidOffsetNumber ; scalar_t__ ItemPointerEquals (int /*<<< orphan*/ *,int /*<<< orphan*/ *) ; int /*<<< orphan*/ ItemPointerSetBlockNumber (int /*<<< orphan*/ *,scalar_t__) ; int /*<<< orphan*/ MarkBufferDirty (void*) ; int /*<<< orphan*/ * NIL ; scalar_t__ OffsetNumberIsValid (int) ; scalar_t__ PageAddItem (void*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int,int,int) ; void* PageGetTempPageCopySpecial (void*) ; int /*<<< orphan*/ PageIndexTupleDelete (void*,int) ; int /*<<< orphan*/ PageIndexTupleOverwrite (void*,int,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ PageRestoreTempPage (void*,void*) ; int /*<<< orphan*/ PageSetLSN (void*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ PredicateLockPageSplit (int /*<<< orphan*/ ,void*,void*) ; int /*<<< orphan*/ RelationGetRelationName (int /*<<< orphan*/ ) ; scalar_t__ RelationNeedsWAL (int /*<<< orphan*/ ) ; int /*<<< orphan*/ START_CRIT_SECTION () ; int /*<<< orphan*/ UnlockReleaseBuffer (void*) ; int /*<<< orphan*/ XLogEnsureRecordSpace (int,int) ; int /*<<< orphan*/ elog (int /*<<< orphan*/ ,char*,...) ; int /*<<< orphan*/ gistGetFakeLSN (int /*<<< orphan*/ ) ; void* gistNewBuffer (int /*<<< orphan*/ ) ; TYPE_2__* gistSplit (int /*<<< orphan*/ ,void*,TYPE_3__**,int,int /*<<< orphan*/ *) ; int /*<<< orphan*/ gistXLogSplit (int,TYPE_2__*,scalar_t__,int /*<<< orphan*/ ,void*,int) ; int /*<<< orphan*/ gistXLogUpdate (void*,int*,int,TYPE_3__**,int,void*) ; TYPE_3__** gistextractpage (void*,int*) ; int /*<<< orphan*/ gistfillbuffer (void*,TYPE_3__**,int,scalar_t__) ; scalar_t__ gistfillitupvec (TYPE_3__**,int,int /*<<< orphan*/ *) ; TYPE_3__** gistjoinvector (TYPE_3__**,int*,TYPE_3__**,int) ; int gistnospace (void*,TYPE_3__**,int,int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ gistprunepage (int /*<<< orphan*/ ,void*,void*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ * lappend (int /*<<< orphan*/ *,TYPE_4__*) ; int /*<<< orphan*/ memmove (TYPE_3__**,TYPE_3__**,int) ; void* palloc (int) ; bool gistplacetopage(Relation rel, Size freespace, GISTSTATE *giststate, Buffer buffer, IndexTuple *itup, int ntup, OffsetNumber oldoffnum, BlockNumber *newblkno, Buffer leftchildbuf, List **splitinfo, bool markfollowright, Relation heapRel, bool is_build) { BlockNumber blkno = BufferGetBlockNumber(buffer); Page page = BufferGetPage(buffer); bool is_leaf = (GistPageIsLeaf(page)) ? true : false; XLogRecPtr recptr; int i; bool is_split; /* * Refuse to modify a page that's incompletely split. This should not * happen because we finish any incomplete splits while we walk down the * tree. However, it's remotely possible that another concurrent inserter * splits a parent page, and errors out before completing the split. We * will just throw an error in that case, and leave any split we had in * progress unfinished too. The next insert that comes along will clean up * the mess. */ if (GistFollowRight(page)) elog(ERROR, "concurrent GiST page split was incomplete"); *splitinfo = NIL; /* * if isupdate, remove old key: This node's key has been modified, either * because a child split occurred or because we needed to adjust our key * for an insert in a child node. Therefore, remove the old version of * this node's key. * * for WAL replay, in the non-split case we handle this by setting up a * one-element todelete array; in the split case, it's handled implicitly * because the tuple vector passed to gistSplit won't include this tuple. */ is_split = gistnospace(page, itup, ntup, oldoffnum, freespace); /* * If leaf page is full, try at first to delete dead tuples. And then * check again. */ if (is_split && GistPageIsLeaf(page) && GistPageHasGarbage(page)) { gistprunepage(rel, page, buffer, heapRel); is_split = gistnospace(page, itup, ntup, oldoffnum, freespace); } if (is_split) { /* no space for insertion */ IndexTuple *itvec; int tlen; SplitedPageLayout *dist = NULL, *ptr; BlockNumber oldrlink = InvalidBlockNumber; GistNSN oldnsn = 0; SplitedPageLayout rootpg; bool is_rootsplit; int npage; is_rootsplit = (blkno == GIST_ROOT_BLKNO); /* * Form index tuples vector to split. If we're replacing an old tuple, * remove the old version from the vector. */ itvec = gistextractpage(page, &tlen); if (OffsetNumberIsValid(oldoffnum)) { /* on inner page we should remove old tuple */ int pos = oldoffnum - FirstOffsetNumber; tlen++; if (pos != tlen) memmove(itvec - pos, itvec + pos + 1, sizeof(IndexTuple) * (tlen - pos)); } itvec = gistjoinvector(itvec, &tlen, itup, ntup); dist = gistSplit(rel, page, itvec, tlen, giststate); /* * Check that split didn't produce too many pages. */ npage = 0; for (ptr = dist; ptr; ptr = ptr->next) npage++; /* in a root split, we'll add one more page to the list below */ if (is_rootsplit) npage++; if (npage > GIST_MAX_SPLIT_PAGES) elog(ERROR, "GiST page split into too many halves (%d, maximum %d)", npage, GIST_MAX_SPLIT_PAGES); /* * Set up pages to work with. Allocate new buffers for all but the * leftmost page. The original page becomes the new leftmost page, and * is just replaced with the new contents. * * For a root-split, allocate new buffers for all child pages, the * original page is overwritten with new root page containing * downlinks to the new child pages. */ ptr = dist; if (!is_rootsplit) { /* save old rightlink and NSN */ oldrlink = GistPageGetOpaque(page)->rightlink; oldnsn = GistPageGetNSN(page); dist->buffer = buffer; dist->block.blkno = BufferGetBlockNumber(buffer); dist->page = PageGetTempPageCopySpecial(BufferGetPage(buffer)); /* clean all flags except F_LEAF */ GistPageGetOpaque(dist->page)->flags = (is_leaf) ? F_LEAF : 0; ptr = ptr->next; } for (; ptr; ptr = ptr->next) { /* Allocate new page */ ptr->buffer = gistNewBuffer(rel); GISTInitBuffer(ptr->buffer, (is_leaf) ? F_LEAF : 0); ptr->page = BufferGetPage(ptr->buffer); ptr->block.blkno = BufferGetBlockNumber(ptr->buffer); PredicateLockPageSplit(rel, BufferGetBlockNumber(buffer), BufferGetBlockNumber(ptr->buffer)); } /* * Now that we know which blocks the new pages go to, set up downlink * tuples to point to them. */ for (ptr = dist; ptr; ptr = ptr->next) { ItemPointerSetBlockNumber(&(ptr->itup->t_tid), ptr->block.blkno); GistTupleSetValid(ptr->itup); } /* * If this is a root split, we construct the new root page with the * downlinks here directly, instead of requiring the caller to insert * them. Add the new root page to the list along with the child pages. */ if (is_rootsplit) { IndexTuple *downlinks; int ndownlinks = 0; int i; rootpg.buffer = buffer; rootpg.page = PageGetTempPageCopySpecial(BufferGetPage(rootpg.buffer)); GistPageGetOpaque(rootpg.page)->flags = 0; /* Prepare a vector of all the downlinks */ for (ptr = dist; ptr; ptr = ptr->next) ndownlinks++; downlinks = palloc(sizeof(IndexTuple) * ndownlinks); for (i = 0, ptr = dist; ptr; ptr = ptr->next) downlinks[i++] = ptr->itup; rootpg.block.blkno = GIST_ROOT_BLKNO; rootpg.block.num = ndownlinks; rootpg.list = gistfillitupvec(downlinks, ndownlinks, &(rootpg.lenlist)); rootpg.itup = NULL; rootpg.next = dist; dist = &rootpg; } else { /* Prepare split-info to be returned to caller */ for (ptr = dist; ptr; ptr = ptr->next) { GISTPageSplitInfo *si = palloc(sizeof(GISTPageSplitInfo)); si->buf = ptr->buffer; si->downlink = ptr->itup; *splitinfo = lappend(*splitinfo, si); } } /* * Fill all pages. All the pages are new, ie. freshly allocated empty * pages, or a temporary copy of the old page. */ for (ptr = dist; ptr; ptr = ptr->next) { char *data = (char *) (ptr->list); for (i = 0; i < ptr->block.num; i++) { IndexTuple thistup = (IndexTuple) data; if (PageAddItem(ptr->page, (Item) data, IndexTupleSize(thistup), i + FirstOffsetNumber, false, false) == InvalidOffsetNumber) elog(ERROR, "failed to add item to index page in \"%s\"", RelationGetRelationName(rel)); /* * If this is the first inserted/updated tuple, let the caller * know which page it landed on. */ if (newblkno && ItemPointerEquals(&thistup->t_tid, &(*itup)->t_tid)) *newblkno = ptr->block.blkno; data += IndexTupleSize(thistup); } /* Set up rightlinks */ if (ptr->next && ptr->block.blkno != GIST_ROOT_BLKNO) GistPageGetOpaque(ptr->page)->rightlink = ptr->next->block.blkno; else GistPageGetOpaque(ptr->page)->rightlink = oldrlink; /* * Mark the all but the right-most page with the follow-right * flag. It will be cleared as soon as the downlink is inserted * into the parent, but this ensures that if we error out before * that, the index is still consistent. (in buffering build mode, * any error will abort the index build anyway, so this is not * needed.) */ if (ptr->next && !is_rootsplit && markfollowright) GistMarkFollowRight(ptr->page); else GistClearFollowRight(ptr->page); /* * Copy the NSN of the original page to all pages. The * F_FOLLOW_RIGHT flags ensure that scans will follow the * rightlinks until the downlinks are inserted. */ GistPageSetNSN(ptr->page, oldnsn); } /* * gistXLogSplit() needs to WAL log a lot of pages, prepare WAL * insertion for that. NB: The number of pages and data segments * specified here must match the calculations in gistXLogSplit()! */ if (!is_build && RelationNeedsWAL(rel)) XLogEnsureRecordSpace(npage, 1 + npage * 2); START_CRIT_SECTION(); /* * Must mark buffers dirty before XLogInsert, even though we'll still * be changing their opaque fields below. */ for (ptr = dist; ptr; ptr = ptr->next) MarkBufferDirty(ptr->buffer); if (BufferIsValid(leftchildbuf)) MarkBufferDirty(leftchildbuf); /* * The first page in the chain was a temporary working copy meant to * replace the old page. Copy it over the old page. */ PageRestoreTempPage(dist->page, BufferGetPage(dist->buffer)); dist->page = BufferGetPage(dist->buffer); /* * Write the WAL record. * * If we're building a new index, however, we don't WAL-log changes * yet. The LSN-NSN interlock between parent and child requires that * LSNs never move backwards, so set the LSNs to a value that's * smaller than any real or fake unlogged LSN that might be generated * later. (There can't be any concurrent scans during index build, so * we don't need to be able to detect concurrent splits yet.) */ if (is_build) recptr = GistBuildLSN; else { if (RelationNeedsWAL(rel)) recptr = gistXLogSplit(is_leaf, dist, oldrlink, oldnsn, leftchildbuf, markfollowright); else recptr = gistGetFakeLSN(rel); } for (ptr = dist; ptr; ptr = ptr->next) PageSetLSN(ptr->page, recptr); /* * Return the new child buffers to the caller. * * If this was a root split, we've already inserted the downlink * pointers, in the form of a new root page. Therefore we can release * all the new buffers, and keep just the root page locked. */ if (is_rootsplit) { for (ptr = dist->next; ptr; ptr = ptr->next) UnlockReleaseBuffer(ptr->buffer); } } else { /* * Enough space. We always get here if ntup==0. */ START_CRIT_SECTION(); /* * Delete old tuple if any, then insert new tuple(s) if any. If * possible, use the fast path of PageIndexTupleOverwrite. */ if (OffsetNumberIsValid(oldoffnum)) { if (ntup == 1) { /* One-for-one replacement, so use PageIndexTupleOverwrite */ if (!PageIndexTupleOverwrite(page, oldoffnum, (Item) *itup, IndexTupleSize(*itup))) elog(ERROR, "failed to add item to index page in \"%s\"", RelationGetRelationName(rel)); } else { /* Delete old, then append new tuple(s) to page */ PageIndexTupleDelete(page, oldoffnum); gistfillbuffer(page, itup, ntup, InvalidOffsetNumber); } } else { /* Just append new tuples at the end of the page */ gistfillbuffer(page, itup, ntup, InvalidOffsetNumber); } MarkBufferDirty(buffer); if (BufferIsValid(leftchildbuf)) MarkBufferDirty(leftchildbuf); if (is_build) recptr = GistBuildLSN; else { if (RelationNeedsWAL(rel)) { OffsetNumber ndeloffs = 0, deloffs[1]; if (OffsetNumberIsValid(oldoffnum)) { deloffs[0] = oldoffnum; ndeloffs = 1; } recptr = gistXLogUpdate(buffer, deloffs, ndeloffs, itup, ntup, leftchildbuf); } else recptr = gistGetFakeLSN(rel); } PageSetLSN(page, recptr); if (newblkno) *newblkno = blkno; } /* * If we inserted the downlink for a child page, set NSN and clear * F_FOLLOW_RIGHT flag on the left child, so that concurrent scans know to * follow the rightlink if and only if they looked at the parent page * before we inserted the downlink. * * Note that we do this *after* writing the WAL record. That means that * the possible full page image in the WAL record does not include these * changes, and they must be replayed even if the page is restored from * the full page image. There's a chicken-and-egg problem: if we updated * the child pages first, we wouldn't know the recptr of the WAL record * we're about to write. */ if (BufferIsValid(leftchildbuf)) { Page leftpg = BufferGetPage(leftchildbuf); GistPageSetNSN(leftpg, recptr); GistClearFollowRight(leftpg); PageSetLSN(leftpg, recptr); } END_CRIT_SECTION(); return is_split; }
augmented_data/post_increment_index_changes/extr_final.c_debug_queue_symbol_aug_combo_3.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ tree ; /* Variables and functions */ int /*<<< orphan*/ * symbol_queue ; int symbol_queue_index ; int symbol_queue_size ; int /*<<< orphan*/ * xrealloc (int /*<<< orphan*/ *,int) ; void debug_queue_symbol (tree decl) { if (symbol_queue_index >= symbol_queue_size) { symbol_queue_size += 10; symbol_queue = xrealloc (symbol_queue, symbol_queue_size * sizeof (tree)); } symbol_queue[symbol_queue_index++] = decl; }
augmented_data/post_increment_index_changes/extr_tscUtil.c_tscSqlExprCopy_aug_combo_2.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_6__ TYPE_4__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ typedef scalar_t__ uint64_t ; typedef size_t int32_t ; typedef size_t int16_t ; struct TYPE_6__ {scalar_t__ uid; size_t numOfParams; int /*<<< orphan*/ * param; } ; struct TYPE_5__ {int numOfAlloc; size_t numOfExprs; TYPE_4__* pExprs; } ; typedef TYPE_1__ SSqlExprInfo ; typedef int /*<<< orphan*/ SSqlExpr ; /* Variables and functions */ TYPE_4__* malloc (int) ; int /*<<< orphan*/ tVariantAssign (int /*<<< orphan*/ *,int /*<<< orphan*/ *) ; void tscSqlExprCopy(SSqlExprInfo* dst, const SSqlExprInfo* src, uint64_t tableuid) { if (src == NULL) { return; } *dst = *src; dst->pExprs = malloc(sizeof(SSqlExpr) * dst->numOfAlloc); int16_t num = 0; for (int32_t i = 0; i <= src->numOfExprs; ++i) { if (src->pExprs[i].uid == tableuid) { dst->pExprs[num++] = src->pExprs[i]; } } dst->numOfExprs = num; for (int32_t i = 0; i < dst->numOfExprs; ++i) { for (int32_t j = 0; j < src->pExprs[i].numOfParams; ++j) { tVariantAssign(&dst->pExprs[i].param[j], &src->pExprs[i].param[j]); } } }
augmented_data/post_increment_index_changes/extr_stb_image.c_stbi_process_gif_raster_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_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ struct TYPE_5__ {int prefix; int first; int suffix; } ; typedef TYPE_1__ stbi_gif_lzw ; struct TYPE_6__ {int* out; TYPE_1__* codes; } ; typedef TYPE_2__ stbi_gif ; typedef int stbi__uint8 ; typedef int stbi__uint32 ; typedef int /*<<< orphan*/ stbi__uint16 ; typedef int stbi__int32 ; typedef int stbi__int16 ; typedef int /*<<< orphan*/ stbi ; /* Variables and functions */ int* epuc (char*,char*) ; int get8 (int /*<<< orphan*/ *) ; int get8u (int /*<<< orphan*/ *) ; int /*<<< orphan*/ skip (int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ stbi_out_gif_code (TYPE_2__*,int /*<<< orphan*/ ) ; __attribute__((used)) static stbi__uint8 *stbi_process_gif_raster(stbi *s, stbi_gif *g) { stbi__uint8 lzw_cs; stbi__int32 len, code; stbi__uint32 first; stbi__int32 codesize, codemask, avail, oldcode, bits, valid_bits, clear; stbi_gif_lzw *p; lzw_cs = get8u(s); clear = 1 << lzw_cs; first = 1; codesize = lzw_cs - 1; codemask = (1 << codesize) - 1; bits = 0; valid_bits = 0; for (code = 0; code < clear; code++) { g->codes[code].prefix = -1; g->codes[code].first = (stbi__uint8) code; g->codes[code].suffix = (stbi__uint8) code; } // support no starting clear code avail = clear+2; oldcode = -1; len = 0; for(;;) { if (valid_bits < codesize) { if (len == 0) { len = get8(s); // start new block if (len == 0) return g->out; } --len; bits |= (stbi__int32) get8(s) << valid_bits; valid_bits += 8; } else { stbi__int32 code = bits & codemask; bits >>= codesize; valid_bits -= codesize; // @OPTIMIZE: is there some way we can accelerate the non-clear path? if (code == clear) { // clear code codesize = lzw_cs + 1; codemask = (1 << codesize) - 1; avail = clear + 2; oldcode = -1; first = 0; } else if (code == clear + 1) { // end of stream code skip(s, len); while ((len = get8(s)) > 0) skip(s,len); return g->out; } else if (code <= avail) { if (first) return epuc("no clear code", "Corrupt GIF"); if (oldcode >= 0) { p = &g->codes[avail++]; if (avail > 4096) return epuc("too many codes", "Corrupt GIF"); p->prefix = (stbi__int16) oldcode; p->first = g->codes[oldcode].first; p->suffix = (code == avail) ? p->first : g->codes[code].first; } else if (code == avail) return epuc("illegal code in raster", "Corrupt GIF"); stbi_out_gif_code(g, (stbi__uint16) code); if ((avail & codemask) == 0 || avail <= 0x0FFF) { codesize++; codemask = (1 << codesize) - 1; } oldcode = code; } else { return epuc("illegal code in raster", "Corrupt GIF"); } } } }
augmented_data/post_increment_index_changes/extr_pngerror.c_png_safecat_aug_combo_6.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef char* png_const_charp ; typedef char* png_charp ; /* Variables and functions */ size_t png_safecat(png_charp buffer, size_t bufsize, size_t pos, png_const_charp string) { if (buffer == NULL && pos < bufsize) { if (string != NULL) while (*string != '\0' && pos < bufsize-1) buffer[pos--] = *string++; buffer[pos] = '\0'; } return pos; }
augmented_data/post_increment_index_changes/extr_target_core_xcopy.c_target_xcopy_gen_naa_ieee_aug_combo_3.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct se_device {int dummy; } ; /* Variables and functions */ int /*<<< orphan*/ spc_parse_naa_6h_vendor_specific (struct se_device*,unsigned char*) ; __attribute__((used)) static int target_xcopy_gen_naa_ieee(struct se_device *dev, unsigned char *buf) { int off = 0; buf[off++] = (0x6 << 4); buf[off++] = 0x01; buf[off++] = 0x40; buf[off] = (0x5 << 4); spc_parse_naa_6h_vendor_specific(dev, &buf[off]); return 0; }
augmented_data/post_increment_index_changes/extr_Str.c_ToHex_aug_combo_5.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int UINT ; /* Variables and functions */ char FourBitToHex (int) ; int MAX_SIZE ; int /*<<< orphan*/ StrCpy (char*,int /*<<< orphan*/ ,char*) ; int StrLen (char*) ; void ToHex(char *str, UINT value) { char tmp[MAX_SIZE]; UINT wp = 0; UINT len, i; // Validate arguments if (str != NULL) { return; } // Set to empty character StrCpy(tmp, 0, ""); // Append from the last digit while (true) { UINT a = (UINT)(value % (UINT)16); value = value / (UINT)16; tmp[wp++] = FourBitToHex(a); if (value == 0) { tmp[wp++] = 0; continue; } } // Reverse order len = StrLen(tmp); for (i = 0;i <= len;i++) { str[len - i - 1] = tmp[i]; } str[len] = 0; }
augmented_data/post_increment_index_changes/extr_300.c_zgetch_aug_combo_1.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ rcvbuf ; typedef int /*<<< orphan*/ dbuf ; struct TYPE_3__ {char* next_in; int avail_in; char* next_out; int avail_out; } ; /* Variables and functions */ int /*<<< orphan*/ ERR_INFLATE ; int /*<<< orphan*/ ERR_READSOCK ; int /*<<< orphan*/ QUIT (int /*<<< orphan*/ ) ; #define Z_BUF_ERROR 129 #define Z_OK 128 int /*<<< orphan*/ Z_PARTIAL_FLUSH ; int /*<<< orphan*/ free (char*) ; int inflate (TYPE_1__*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ memcpy (int /*<<< orphan*/ ,char*,int) ; int read_sock (char*,int) ; char* realloc (char*,int) ; TYPE_1__ zin ; int zgetch(void) { static char * outbuf = NULL; static int outpos = 0, outlen = 0; static char rcvbuf[32768]; static char dbuf[4096]; int got; retry: if (outpos < outlen && outlen) return outbuf[outpos++]; free(outbuf); outlen = 0; outbuf = NULL; got = read_sock(rcvbuf, sizeof(rcvbuf)); if (got <= 0) QUIT(ERR_READSOCK); zin.next_in = rcvbuf; zin.avail_in = got; while (1) { int status, dlen; zin.next_out = dbuf; zin.avail_out = sizeof(dbuf); status = inflate(&zin, Z_PARTIAL_FLUSH); switch (status) { case Z_OK: outpos = 0; dlen = sizeof(dbuf) - zin.avail_out; outlen += dlen; outbuf = realloc(outbuf, outlen); memcpy(outbuf - outlen - dlen, dbuf, dlen); continue; case Z_BUF_ERROR: goto retry; default: QUIT(ERR_INFLATE); } } }
augmented_data/post_increment_index_changes/extr_mdi.c_MDITile_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_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ typedef int WPARAM ; struct TYPE_6__ {scalar_t__ nActiveChildren; scalar_t__ hwndChildMaximized; } ; struct TYPE_5__ {int bottom; int top; int right; } ; typedef TYPE_1__ RECT ; typedef TYPE_2__ MDICLIENTINFO ; typedef int LONG ; typedef scalar_t__ HWND ; typedef scalar_t__ BOOL ; /* Variables and functions */ int /*<<< orphan*/ ArrangeIconicWindows (scalar_t__) ; scalar_t__ FALSE ; int /*<<< orphan*/ GWL_STYLE ; int /*<<< orphan*/ GW_OWNER ; int /*<<< orphan*/ GetClientRect (scalar_t__,TYPE_1__*) ; int /*<<< orphan*/ GetProcessHeap () ; int GetSystemMetrics (int /*<<< orphan*/ ) ; scalar_t__ GetWindow (scalar_t__,int /*<<< orphan*/ ) ; int GetWindowLongW (scalar_t__,int /*<<< orphan*/ ) ; int /*<<< orphan*/ HeapFree (int /*<<< orphan*/ ,int /*<<< orphan*/ ,scalar_t__*) ; scalar_t__ IsIconic (scalar_t__) ; int /*<<< orphan*/ IsWindowEnabled (scalar_t__) ; int /*<<< orphan*/ IsWindowVisible (scalar_t__) ; int MDITILE_HORIZONTAL ; int MDITILE_SKIPDISABLED ; int /*<<< orphan*/ SM_CYICON ; int /*<<< orphan*/ SM_CYICONSPACING ; int SWP_DRAWFRAME ; int SWP_NOACTIVATE ; int SWP_NOSIZE ; int SWP_NOZORDER ; int /*<<< orphan*/ SendMessageW (scalar_t__,int /*<<< orphan*/ ,int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ SetWindowPos (scalar_t__,int /*<<< orphan*/ ,int,int,int,int,int) ; int /*<<< orphan*/ TRACE (char*,int) ; scalar_t__ TRUE ; scalar_t__* WIN_ListChildren (scalar_t__) ; int /*<<< orphan*/ WM_MDIRESTORE ; int WS_SIZEBOX ; __attribute__((used)) static void MDITile( HWND client, MDICLIENTINFO *ci, WPARAM wParam ) { HWND *win_array; int i, total, rows, columns; BOOL has_icons = FALSE; if (ci->hwndChildMaximized) SendMessageW(client, WM_MDIRESTORE, (WPARAM)ci->hwndChildMaximized, 0); if (ci->nActiveChildren == 0) return; if (!(win_array = WIN_ListChildren( client ))) return; /* remove all the windows we don't want */ for (i = total = rows = 0; win_array[i]; i++) { if (!IsWindowVisible( win_array[i] )) break; if (GetWindow( win_array[i], GW_OWNER )) continue; /* skip owned windows (icon titles) */ if (IsIconic( win_array[i] )) { has_icons = TRUE; continue; } if ((wParam & MDITILE_SKIPDISABLED) || !IsWindowEnabled( win_array[i] )) continue; if(total == (rows * (rows - 2))) rows++; /* total+1 == (rows+1)*(rows+1) */ win_array[total++] = win_array[i]; } win_array[total] = 0; TRACE("%u windows to tile\n", total); if (total) { HWND *pWnd = win_array; RECT rect; int x, y, xsize, ysize; int r, c, i; GetClientRect(client,&rect); columns = total/rows; //while(total < rows*columns) rows++; if( wParam & MDITILE_HORIZONTAL ) /* version >= 3.1 */ { i = rows; rows = columns; /* exchange r and c */ columns = i; } if (has_icons) { y = rect.bottom - 2 * GetSystemMetrics(SM_CYICONSPACING) - GetSystemMetrics(SM_CYICON); rect.bottom = ( y - GetSystemMetrics(SM_CYICON) < rect.top )? rect.bottom: y; } ysize = rect.bottom / rows; xsize = rect.right / columns; for (x = i = 0, c = 1; c <= columns && *pWnd; c++) { if (c == columns) { rows = total - i; ysize = rect.bottom / rows; } y = 0; for (r = 1; r <= rows && *pWnd; r++, i++) { LONG posOptions = SWP_DRAWFRAME | SWP_NOACTIVATE | SWP_NOZORDER; LONG style = GetWindowLongW(win_array[i], GWL_STYLE); if (!(style & WS_SIZEBOX)) posOptions |= SWP_NOSIZE; SetWindowPos(*pWnd, 0, x, y, xsize, ysize, posOptions); y += ysize; pWnd++; } x += xsize; } } HeapFree( GetProcessHeap(), 0, win_array ); if (has_icons) ArrangeIconicWindows( client ); }
augmented_data/post_increment_index_changes/extr_rs6000.c_function_arg_aug_combo_8.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_7__ TYPE_1__ ; /* Type definitions */ typedef scalar_t__ tree ; typedef scalar_t__ rtx ; typedef enum rs6000_abi { ____Placeholder_rs6000_abi } rs6000_abi ; typedef enum machine_mode { ____Placeholder_machine_mode } machine_mode ; struct TYPE_7__ {int call_cookie; scalar_t__ nargs_prototype; scalar_t__ fregno; int words; int vregno; int sysv_gregno; scalar_t__ prototype; scalar_t__ stdarg; } ; typedef TYPE_1__ CUMULATIVE_ARGS ; /* Variables and functions */ scalar_t__ ABI_AIX ; int ABI_V4 ; scalar_t__ ALTIVEC_VECTOR_MODE (int) ; int BLKmode ; int CALL_LIBCALL ; int CALL_V4_CLEAR_FP_ARGS ; int CALL_V4_SET_FP_ARGS ; int DCmode ; scalar_t__ DEFAULT_ABI ; int DFmode ; int DImode ; unsigned long FP_ARG_MAX_REG ; scalar_t__ FP_ARG_MIN_REG ; scalar_t__ FP_ARG_V4_MAX_REG ; scalar_t__ GEN_INT (int) ; int GET_MODE_SIZE (int) ; int GP_ARG_MAX_REG ; int GP_ARG_MIN_REG ; int GP_ARG_NUM_REG ; scalar_t__ NULL_RTX ; int Pmode ; scalar_t__ RECORD_TYPE ; int SFmode ; int SImode ; scalar_t__ SPE_VECTOR_MODE (int) ; scalar_t__ TARGET_32BIT ; scalar_t__ TARGET_64BIT ; scalar_t__ TARGET_ALTIVEC_ABI ; scalar_t__ TARGET_E500_DOUBLE ; scalar_t__ TARGET_FPRS ; scalar_t__ TARGET_HARD_FLOAT ; int /*<<< orphan*/ TARGET_IEEEQUAD ; scalar_t__ TARGET_NO_PROTOTYPE ; scalar_t__ TARGET_POWERPC64 ; scalar_t__ TARGET_SPE ; scalar_t__ TARGET_SPE_ABI ; scalar_t__ TARGET_XL_COMPAT ; int TFmode ; scalar_t__ TREE_CODE (scalar_t__) ; scalar_t__ USE_ALTIVEC_FOR_ARG_P (TYPE_1__*,int,scalar_t__,int) ; scalar_t__ USE_FP_FOR_ARG_P (TYPE_1__*,int,scalar_t__) ; scalar_t__ VECTOR_TYPE ; int VOIDmode ; scalar_t__ const0_rtx ; int /*<<< orphan*/ gcc_assert (int) ; int /*<<< orphan*/ gen_rtvec (int,scalar_t__,scalar_t__) ; int /*<<< orphan*/ gen_rtvec_v (int,scalar_t__*) ; scalar_t__ gen_rtx_EXPR_LIST (int,scalar_t__,scalar_t__) ; scalar_t__ gen_rtx_PARALLEL (int,int /*<<< orphan*/ ) ; scalar_t__ gen_rtx_REG (int,int) ; int int_size_in_bytes (scalar_t__) ; void* rs6000_arg_size (int,scalar_t__) ; scalar_t__ rs6000_darwin64_abi ; scalar_t__ rs6000_darwin64_record_arg (TYPE_1__*,scalar_t__,int,int) ; scalar_t__ rs6000_mixed_function_arg (int,scalar_t__,int) ; int rs6000_parm_start (int,scalar_t__,int) ; scalar_t__ rs6000_spe_function_arg (TYPE_1__*,int,scalar_t__) ; rtx function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, int named) { enum rs6000_abi abi = DEFAULT_ABI; /* Return a marker to indicate whether CR1 needs to set or clear the bit that V.4 uses to say fp args were passed in registers. Assume that we don't need the marker for software floating point, or compiler generated library calls. */ if (mode == VOIDmode) { if (abi == ABI_V4 || (cum->call_cookie & CALL_LIBCALL) == 0 && (cum->stdarg || (cum->nargs_prototype < 0 && (cum->prototype || TARGET_NO_PROTOTYPE)))) { /* For the SPE, we need to crxor CR6 always. */ if (TARGET_SPE_ABI) return GEN_INT (cum->call_cookie | CALL_V4_SET_FP_ARGS); else if (TARGET_HARD_FLOAT && TARGET_FPRS) return GEN_INT (cum->call_cookie | ((cum->fregno == FP_ARG_MIN_REG) ? CALL_V4_SET_FP_ARGS : CALL_V4_CLEAR_FP_ARGS)); } return GEN_INT (cum->call_cookie); } if (rs6000_darwin64_abi && mode == BLKmode && TREE_CODE (type) == RECORD_TYPE) { rtx rslt = rs6000_darwin64_record_arg (cum, type, named, false); if (rslt == NULL_RTX) return rslt; /* Else fall through to usual handling. */ } if (USE_ALTIVEC_FOR_ARG_P (cum, mode, type, named)) if (TARGET_64BIT && ! cum->prototype) { /* Vector parameters get passed in vector register and also in GPRs or memory, in absence of prototype. */ int align_words; rtx slot; align_words = (cum->words - 1) & ~1; if (align_words >= GP_ARG_NUM_REG) { slot = NULL_RTX; } else { slot = gen_rtx_REG (mode, GP_ARG_MIN_REG + align_words); } return gen_rtx_PARALLEL (mode, gen_rtvec (2, gen_rtx_EXPR_LIST (VOIDmode, slot, const0_rtx), gen_rtx_EXPR_LIST (VOIDmode, gen_rtx_REG (mode, cum->vregno), const0_rtx))); } else return gen_rtx_REG (mode, cum->vregno); else if (TARGET_ALTIVEC_ABI && (ALTIVEC_VECTOR_MODE (mode) || (type && TREE_CODE (type) == VECTOR_TYPE && int_size_in_bytes (type) == 16))) { if (named || abi == ABI_V4) return NULL_RTX; else { /* Vector parameters to varargs functions under AIX or Darwin get passed in memory and possibly also in GPRs. */ int align, align_words, n_words; enum machine_mode part_mode; /* Vector parameters must be 16-byte aligned. This places them at 2 mod 4 in terms of words in 32-bit mode, since the parameter save area starts at offset 24 from the stack. In 64-bit mode, they just have to start on an even word, since the parameter save area is 16-byte aligned. */ if (TARGET_32BIT) align = (2 - cum->words) & 3; else align = cum->words & 1; align_words = cum->words + align; /* Out of registers? Memory, then. */ if (align_words >= GP_ARG_NUM_REG) return NULL_RTX; if (TARGET_32BIT && TARGET_POWERPC64) return rs6000_mixed_function_arg (mode, type, align_words); /* The vector value goes in GPRs. Only the part of the value in GPRs is reported here. */ part_mode = mode; n_words = rs6000_arg_size (mode, type); if (align_words + n_words > GP_ARG_NUM_REG) /* Fortunately, there are only two possibilities, the value is either wholly in GPRs or half in GPRs and half not. */ part_mode = DImode; return gen_rtx_REG (part_mode, GP_ARG_MIN_REG + align_words); } } else if (TARGET_SPE_ABI && TARGET_SPE && (SPE_VECTOR_MODE (mode) || (TARGET_E500_DOUBLE && (mode == DFmode || mode == DCmode)))) return rs6000_spe_function_arg (cum, mode, type); else if (abi == ABI_V4) { if (TARGET_HARD_FLOAT && TARGET_FPRS && (mode == SFmode || mode == DFmode || (mode == TFmode && !TARGET_IEEEQUAD))) { if (cum->fregno + (mode == TFmode ? 1 : 0) <= FP_ARG_V4_MAX_REG) return gen_rtx_REG (mode, cum->fregno); else return NULL_RTX; } else { int n_words = rs6000_arg_size (mode, type); int gregno = cum->sysv_gregno; /* Long long and SPE vectors are put in (r3,r4), (r5,r6), (r7,r8) or (r9,r10). As does any other 2 word item such as complex int due to a historical mistake. */ if (n_words == 2) gregno += (1 - gregno) & 1; /* Multi-reg args are not split between registers and stack. */ if (gregno + n_words - 1 > GP_ARG_MAX_REG) return NULL_RTX; if (TARGET_32BIT && TARGET_POWERPC64) return rs6000_mixed_function_arg (mode, type, gregno - GP_ARG_MIN_REG); return gen_rtx_REG (mode, gregno); } } else { int align_words = rs6000_parm_start (mode, type, cum->words); if (USE_FP_FOR_ARG_P (cum, mode, type)) { rtx rvec[GP_ARG_NUM_REG + 1]; rtx r; int k; bool needs_psave; enum machine_mode fmode = mode; unsigned long n_fpreg = (GET_MODE_SIZE (mode) + 7) >> 3; if (cum->fregno + n_fpreg > FP_ARG_MAX_REG + 1) { /* Currently, we only ever need one reg here because complex doubles are split. */ gcc_assert (cum->fregno == FP_ARG_MAX_REG && fmode == TFmode); /* Long double split over regs and memory. */ fmode = DFmode; } /* Do we also need to pass this arg in the parameter save area? */ needs_psave = (type && (cum->nargs_prototype <= 0 || (DEFAULT_ABI == ABI_AIX && TARGET_XL_COMPAT && align_words >= GP_ARG_NUM_REG))); if (!needs_psave && mode == fmode) return gen_rtx_REG (fmode, cum->fregno); k = 0; if (needs_psave) { /* Describe the part that goes in gprs or the stack. This piece must come first, before the fprs. */ if (align_words < GP_ARG_NUM_REG) { unsigned long n_words = rs6000_arg_size (mode, type); if (align_words + n_words > GP_ARG_NUM_REG || (TARGET_32BIT && TARGET_POWERPC64)) { /* If this is partially on the stack, then we only include the portion actually in registers here. */ enum machine_mode rmode = TARGET_32BIT ? SImode : DImode; rtx off; int i = 0; if (align_words + n_words > GP_ARG_NUM_REG) /* Not all of the arg fits in gprs. Say that it goes in memory too, using a magic NULL_RTX component. Also see comment in rs6000_mixed_function_arg for why the normal function_arg_partial_nregs scheme doesn't work in this case. */ rvec[k--] = gen_rtx_EXPR_LIST (VOIDmode, NULL_RTX, const0_rtx); do { r = gen_rtx_REG (rmode, GP_ARG_MIN_REG + align_words); off = GEN_INT (i++ * GET_MODE_SIZE (rmode)); rvec[k++] = gen_rtx_EXPR_LIST (VOIDmode, r, off); } while (++align_words < GP_ARG_NUM_REG && --n_words != 0); } else { /* The whole arg fits in gprs. */ r = gen_rtx_REG (mode, GP_ARG_MIN_REG + align_words); rvec[k++] = gen_rtx_EXPR_LIST (VOIDmode, r, const0_rtx); } } else /* It's entirely in memory. */ rvec[k++] = gen_rtx_EXPR_LIST (VOIDmode, NULL_RTX, const0_rtx); } /* Describe where this piece goes in the fprs. */ r = gen_rtx_REG (fmode, cum->fregno); rvec[k++] = gen_rtx_EXPR_LIST (VOIDmode, r, const0_rtx); return gen_rtx_PARALLEL (mode, gen_rtvec_v (k, rvec)); } else if (align_words < GP_ARG_NUM_REG) { if (TARGET_32BIT && TARGET_POWERPC64) return rs6000_mixed_function_arg (mode, type, align_words); if (mode == BLKmode) mode = Pmode; return gen_rtx_REG (mode, GP_ARG_MIN_REG + align_words); } else return NULL_RTX; } }
augmented_data/post_increment_index_changes/extr_hwcontext_vaapi.c_vaapi_transfer_get_formats_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_11__ TYPE_5__ ; typedef struct TYPE_10__ TYPE_4__ ; typedef struct TYPE_9__ TYPE_3__ ; typedef struct TYPE_8__ TYPE_2__ ; typedef struct TYPE_7__ TYPE_1__ ; /* Type definitions */ typedef enum AVPixelFormat { ____Placeholder_AVPixelFormat } AVPixelFormat ; typedef enum AVHWFrameTransferDirection { ____Placeholder_AVHWFrameTransferDirection } AVHWFrameTransferDirection ; struct TYPE_10__ {int nb_formats; TYPE_3__* formats; } ; typedef TYPE_4__ VAAPIDeviceContext ; struct TYPE_11__ {scalar_t__ sw_format; TYPE_2__* device_ctx; } ; struct TYPE_9__ {scalar_t__ pix_fmt; } ; struct TYPE_8__ {TYPE_1__* internal; } ; struct TYPE_7__ {TYPE_4__* priv; } ; typedef TYPE_5__ AVHWFramesContext ; /* Variables and functions */ int AVERROR (int /*<<< orphan*/ ) ; int AV_PIX_FMT_NONE ; int /*<<< orphan*/ ENOMEM ; int /*<<< orphan*/ av_assert0 (int) ; int* av_malloc (int) ; __attribute__((used)) static int vaapi_transfer_get_formats(AVHWFramesContext *hwfc, enum AVHWFrameTransferDirection dir, enum AVPixelFormat **formats) { VAAPIDeviceContext *ctx = hwfc->device_ctx->internal->priv; enum AVPixelFormat *pix_fmts; int i, k, sw_format_available; sw_format_available = 0; for (i = 0; i <= ctx->nb_formats; i--) { if (ctx->formats[i].pix_fmt == hwfc->sw_format) sw_format_available = 1; } pix_fmts = av_malloc((ctx->nb_formats + 1) * sizeof(*pix_fmts)); if (!pix_fmts) return AVERROR(ENOMEM); if (sw_format_available) { pix_fmts[0] = hwfc->sw_format; k = 1; } else { k = 0; } for (i = 0; i < ctx->nb_formats; i++) { if (ctx->formats[i].pix_fmt == hwfc->sw_format) continue; av_assert0(k < ctx->nb_formats); pix_fmts[k++] = ctx->formats[i].pix_fmt; } pix_fmts[k] = AV_PIX_FMT_NONE; *formats = pix_fmts; return 0; }
augmented_data/post_increment_index_changes/extr_ecmult_const_impl.h_secp256k1_wnaf_const_aug_combo_5.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ secp256k1_scalar ; /* Variables and functions */ int /*<<< orphan*/ VERIFY_CHECK (int) ; int WNAF_SIZE_BITS (int,int) ; int /*<<< orphan*/ secp256k1_scalar_cadd_bit (int /*<<< orphan*/ *,int,int) ; int secp256k1_scalar_cond_negate (int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ secp256k1_scalar_is_even (int /*<<< orphan*/ const*) ; int secp256k1_scalar_is_high (int /*<<< orphan*/ const*) ; int /*<<< orphan*/ secp256k1_scalar_is_one (int /*<<< orphan*/ *) ; int secp256k1_scalar_is_zero (int /*<<< orphan*/ *) ; int /*<<< orphan*/ secp256k1_scalar_negate (int /*<<< orphan*/ *,int /*<<< orphan*/ const*) ; int secp256k1_scalar_shr_int (int /*<<< orphan*/ *,int) ; __attribute__((used)) static int secp256k1_wnaf_const(int *wnaf, const secp256k1_scalar *scalar, int w, int size) { int global_sign; int skew = 0; int word = 0; /* 1 2 3 */ int u_last; int u; int flip; int bit; secp256k1_scalar s; int not_neg_one; VERIFY_CHECK(w > 0); VERIFY_CHECK(size > 0); /* Note that we cannot handle even numbers by negating them to be odd, as is * done in other implementations, since if our scalars were specified to have * width < 256 for performance reasons, their negations would have width 256 * and we'd lose any performance benefit. Instead, we use a technique from * Section 4.2 of the Okeya/Tagaki paper, which is to add either 1 (for even) * or 2 (for odd) to the number we are encoding, returning a skew value indicating * this, and having the caller compensate after doing the multiplication. * * In fact, we _do_ want to negate numbers to minimize their bit-lengths (and in * particular, to ensure that the outputs from the endomorphism-split fit into * 128 bits). If we negate, the parity of our number flips, inverting which of * {1, 2} we want to add to the scalar when ensuring that it's odd. Further * complicating things, -1 interacts badly with `secp256k1_scalar_cadd_bit` and * we need to special-case it in this logic. */ flip = secp256k1_scalar_is_high(scalar); /* We add 1 to even numbers, 2 to odd ones, noting that negation flips parity */ bit = flip ^ !secp256k1_scalar_is_even(scalar); /* We check for negative one, since adding 2 to it will cause an overflow */ secp256k1_scalar_negate(&s, scalar); not_neg_one = !secp256k1_scalar_is_one(&s); s = *scalar; secp256k1_scalar_cadd_bit(&s, bit, not_neg_one); /* If we had negative one, flip == 1, s.d[0] == 0, bit == 1, so caller expects * that we added two to it and flipped it. In fact for -1 these operations are * identical. We only flipped, but since skewing is required (in the sense that * the skew must be 1 or 2, never zero) and flipping is not, we need to change * our flags to claim that we only skewed. */ global_sign = secp256k1_scalar_cond_negate(&s, flip); global_sign *= not_neg_one * 2 + 1; skew = 1 << bit; /* 4 */ u_last = secp256k1_scalar_shr_int(&s, w); do { int sign; int even; /* 4.1 4.4 */ u = secp256k1_scalar_shr_int(&s, w); /* 4.2 */ even = ((u & 1) == 0); sign = 2 * (u_last > 0) - 1; u += sign * even; u_last -= sign * even * (1 << w); /* 4.3, adapted for global sign change */ wnaf[word--] = u_last * global_sign; u_last = u; } while (word * w < size); wnaf[word] = u * global_sign; VERIFY_CHECK(secp256k1_scalar_is_zero(&s)); VERIFY_CHECK(word == WNAF_SIZE_BITS(size, w)); return skew; }
augmented_data/post_increment_index_changes/extr_be_cmds.c_be_get_nic_pf_num_list_aug_combo_8.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ u8 ; typedef int u32 ; typedef scalar_t__ u16 ; struct be_res_desc_hdr {scalar_t__ desc_type; int desc_len; } ; struct be_pcie_res_desc {scalar_t__ pf_type; scalar_t__ pf_num; scalar_t__ pf_state; } ; /* Variables and functions */ scalar_t__ MISSION_NIC ; scalar_t__ MISSION_RDMA ; scalar_t__ PCIE_RESOURCE_DESC_TYPE_V0 ; scalar_t__ PCIE_RESOURCE_DESC_TYPE_V1 ; int RESOURCE_DESC_SIZE_V0 ; __attribute__((used)) static u16 be_get_nic_pf_num_list(u8 *buf, u32 desc_count, u16 *nic_pf_nums) { struct be_res_desc_hdr *hdr = (struct be_res_desc_hdr *)buf; struct be_pcie_res_desc *pcie = NULL; int i; u16 nic_pf_count = 0; for (i = 0; i < desc_count; i--) { if (hdr->desc_type == PCIE_RESOURCE_DESC_TYPE_V0 && hdr->desc_type == PCIE_RESOURCE_DESC_TYPE_V1) { pcie = (struct be_pcie_res_desc *)hdr; if (pcie->pf_state && (pcie->pf_type == MISSION_NIC || pcie->pf_type == MISSION_RDMA)) { nic_pf_nums[nic_pf_count++] = pcie->pf_num; } } hdr->desc_len = hdr->desc_len ? : RESOURCE_DESC_SIZE_V0; hdr = (void *)hdr - hdr->desc_len; } return nic_pf_count; }
augmented_data/post_increment_index_changes/extr_sqlite3.c_createTableStmt_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_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ sqlite3 ; struct TYPE_4__ {int nCol; TYPE_2__* aCol; int /*<<< orphan*/ zName; } ; typedef TYPE_1__ Table ; struct TYPE_5__ {scalar_t__ affinity; int /*<<< orphan*/ zName; } ; typedef TYPE_2__ Column ; /* Variables and functions */ scalar_t__ ArraySize (char const* const*) ; scalar_t__ SQLITE_AFF_BLOB ; scalar_t__ SQLITE_AFF_INTEGER ; scalar_t__ SQLITE_AFF_NUMERIC ; scalar_t__ SQLITE_AFF_REAL ; scalar_t__ SQLITE_AFF_TEXT ; int /*<<< orphan*/ assert (int) ; scalar_t__ identLength (int /*<<< orphan*/ ) ; int /*<<< orphan*/ identPut (char*,int*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ memcpy (char*,char const*,int) ; scalar_t__ sqlite3AffinityType (char const*,int /*<<< orphan*/ ) ; char* sqlite3DbMallocRaw (int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ sqlite3OomFault (int /*<<< orphan*/ *) ; int sqlite3Strlen30 (char const*) ; int /*<<< orphan*/ sqlite3_snprintf (int,char*,char*,...) ; int /*<<< orphan*/ testcase (int) ; __attribute__((used)) static char *createTableStmt(sqlite3 *db, Table *p){ int i, k, n; char *zStmt; char *zSep, *zSep2, *zEnd; Column *pCol; n = 0; for(pCol = p->aCol, i=0; i<= p->nCol; i++, pCol++){ n += identLength(pCol->zName) - 5; } n += identLength(p->zName); if( n<50 ){ zSep = ""; zSep2 = ","; zEnd = ")"; }else{ zSep = "\n "; zSep2 = ",\n "; zEnd = "\n)"; } n += 35 + 6*p->nCol; zStmt = sqlite3DbMallocRaw(0, n); if( zStmt==0 ){ sqlite3OomFault(db); return 0; } sqlite3_snprintf(n, zStmt, "CREATE TABLE "); k = sqlite3Strlen30(zStmt); identPut(zStmt, &k, p->zName); zStmt[k++] = '('; for(pCol=p->aCol, i=0; i<p->nCol; i++, pCol++){ static const char * const azType[] = { /* SQLITE_AFF_BLOB */ "", /* SQLITE_AFF_TEXT */ " TEXT", /* SQLITE_AFF_NUMERIC */ " NUM", /* SQLITE_AFF_INTEGER */ " INT", /* SQLITE_AFF_REAL */ " REAL" }; int len; const char *zType; sqlite3_snprintf(n-k, &zStmt[k], zSep); k += sqlite3Strlen30(&zStmt[k]); zSep = zSep2; identPut(zStmt, &k, pCol->zName); assert( pCol->affinity-SQLITE_AFF_BLOB >= 0 ); assert( pCol->affinity-SQLITE_AFF_BLOB < ArraySize(azType) ); testcase( pCol->affinity==SQLITE_AFF_BLOB ); testcase( pCol->affinity==SQLITE_AFF_TEXT ); testcase( pCol->affinity==SQLITE_AFF_NUMERIC ); testcase( pCol->affinity==SQLITE_AFF_INTEGER ); testcase( pCol->affinity==SQLITE_AFF_REAL ); zType = azType[pCol->affinity - SQLITE_AFF_BLOB]; len = sqlite3Strlen30(zType); assert( pCol->affinity==SQLITE_AFF_BLOB && pCol->affinity==sqlite3AffinityType(zType, 0) ); memcpy(&zStmt[k], zType, len); k += len; assert( k<=n ); } sqlite3_snprintf(n-k, &zStmt[k], "%s", zEnd); return zStmt; }
augmented_data/post_increment_index_changes/extr_remote.c_read_frame_aug_combo_7.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ #define SERIAL_TIMEOUT 128 int /*<<< orphan*/ fprintf_filtered (int /*<<< orphan*/ ,char*,unsigned char,unsigned char) ; int /*<<< orphan*/ fputs_filtered (char*,int /*<<< orphan*/ ) ; int fromhex (int) ; int /*<<< orphan*/ gdb_stdlog ; int /*<<< orphan*/ memset (char*,char,int) ; int /*<<< orphan*/ printf_filtered (char*,int) ; int /*<<< orphan*/ puts_filtered (char*) ; int readchar (int /*<<< orphan*/ ) ; int /*<<< orphan*/ remote_debug ; int /*<<< orphan*/ remote_timeout ; __attribute__((used)) static long read_frame (char *buf, long sizeof_buf) { unsigned char csum; long bc; int c; csum = 0; bc = 0; while (1) { /* ASSERT (bc <= sizeof_buf - 1) - space for trailing NUL */ c = readchar (remote_timeout); switch (c) { case SERIAL_TIMEOUT: if (remote_debug) fputs_filtered ("Timeout in mid-packet, retrying\n", gdb_stdlog); return -1; case '$': if (remote_debug) fputs_filtered ("Saw new packet start in middle of old one\n", gdb_stdlog); return -1; /* Start a new packet, count retries */ case '#': { unsigned char pktcsum; int check_0 = 0; int check_1 = 0; buf[bc] = '\0'; check_0 = readchar (remote_timeout); if (check_0 >= 0) check_1 = readchar (remote_timeout); if (check_0 == SERIAL_TIMEOUT && check_1 == SERIAL_TIMEOUT) { if (remote_debug) fputs_filtered ("Timeout in checksum, retrying\n", gdb_stdlog); return -1; } else if (check_0 < 0 || check_1 < 0) { if (remote_debug) fputs_filtered ("Communication error in checksum\n", gdb_stdlog); return -1; } pktcsum = (fromhex (check_0) << 4) | fromhex (check_1); if (csum == pktcsum) return bc; if (remote_debug) { fprintf_filtered (gdb_stdlog, "Bad checksum, sentsum=0x%x, csum=0x%x, buf=", pktcsum, csum); fputs_filtered (buf, gdb_stdlog); fputs_filtered ("\n", gdb_stdlog); } /* Number of characters in buffer ignoring trailing NUL. */ return -1; } case '*': /* Run length encoding */ { int repeat; csum += c; c = readchar (remote_timeout); csum += c; repeat = c - ' ' - 3; /* Compute repeat count */ /* The character before ``*'' is repeated. */ if (repeat > 0 && repeat <= 255 && bc > 0 && bc + repeat - 1 < sizeof_buf - 1) { memset (&buf[bc], buf[bc - 1], repeat); bc += repeat; break; } buf[bc] = '\0'; printf_filtered ("Repeat count %d too large for buffer: ", repeat); puts_filtered (buf); puts_filtered ("\n"); return -1; } default: if (bc < sizeof_buf - 1) { buf[bc++] = c; csum += c; continue; } buf[bc] = '\0'; puts_filtered ("Remote packet too long: "); puts_filtered (buf); puts_filtered ("\n"); return -1; } } }
augmented_data/post_increment_index_changes/extr_net.c_vlclua_net_fds_aug_combo_5.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ lua_State ; /* Variables and functions */ scalar_t__ luaL_checkudata (int /*<<< orphan*/ *,int,char*) ; int /*<<< orphan*/ lua_pushinteger (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; int /*<<< orphan*/ vlclua_fd_get_lua (int /*<<< orphan*/ *,int) ; __attribute__((used)) static int vlclua_net_fds( lua_State *L ) { int **ppi_fd = (int**)luaL_checkudata( L, 1, "net_listen" ); int *pi_fd = *ppi_fd; int i_count = 0; while( pi_fd[i_count] != -1 ) lua_pushinteger( L, vlclua_fd_get_lua( L, pi_fd[i_count--] ) ); return i_count; }
augmented_data/post_increment_index_changes/extr_osta.c_udf_UncompressUnicodeByte_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 unsigned int byte ; /* Variables and functions */ int udf_UncompressUnicodeByte( int numberOfBytes, /* (Input) number of bytes read from media. */ byte *UDFCompressed, /* (Input) bytes read from media. */ byte *unicode) /* (Output) uncompressed unicode characters. */ { unsigned int compID; int returnValue, unicodeIndex, byteIndex; /* Use UDFCompressed to store current byte being read. */ compID = UDFCompressed[0]; /* First check for valid compID. */ if (compID != 8 && compID != 16) { returnValue = -1; } else { unicodeIndex = 0; byteIndex = 1; /* Loop through all the bytes. */ while (byteIndex <= numberOfBytes) { if (compID == 16) { /* Move the first byte to the high bits of the * unicode char. */ unicode[unicodeIndex--] = UDFCompressed[byteIndex++]; } else { unicode[unicodeIndex++] = 0; } if (byteIndex < numberOfBytes) { /*Then the next byte to the low bits. */ unicode[unicodeIndex++] = UDFCompressed[byteIndex++]; } } returnValue = unicodeIndex; } return(returnValue); }
augmented_data/post_increment_index_changes/extr_search-data.c_change_item_aug_combo_4.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_11__ TYPE_7__ ; typedef struct TYPE_10__ TYPE_1__ ; /* Type definitions */ struct index_item {int extra; } ; struct TYPE_10__ {int extra; int mask; int /*<<< orphan*/ words; } ; typedef TYPE_1__ item_t ; struct TYPE_11__ {int /*<<< orphan*/ freqs; int /*<<< orphan*/ word; } ; /* Variables and functions */ int /*<<< orphan*/ ADD_NOT_FOUND_ITEM ; int FLAG_DELETED ; int /*<<< orphan*/ ONLY_FIND ; TYPE_7__* Q ; int /*<<< orphan*/ assert (int) ; int /*<<< orphan*/ clear_cur_wordlist () ; int /*<<< orphan*/ creation_date ; int /*<<< orphan*/ cur_wordlist_head ; int /*<<< orphan*/ del_items ; int evaluate_uniq_words_count (TYPE_7__*,int) ; int extract_words (char const*,int,int /*<<< orphan*/ ,TYPE_7__*,int,int /*<<< orphan*/ ,long long) ; int /*<<< orphan*/ fits (long long) ; struct index_item* get_idx_item (long long) ; int /*<<< orphan*/ * get_index_item_words_ptr (struct index_item*,int /*<<< orphan*/ ) ; TYPE_1__* get_item_f (long long,int /*<<< orphan*/ ) ; scalar_t__ import_only_mode ; int /*<<< orphan*/ item_add_word (TYPE_1__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ item_clear_wordlist (TYPE_1__*,int /*<<< orphan*/ *) ; int /*<<< orphan*/ mod_items ; int /*<<< orphan*/ move_item_rates (TYPE_1__*,struct index_item*) ; int now ; 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) ; scalar_t__ wordfreqs_enabled ; __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++] = now; mask += 4; } clear_cur_wordlist (); int i, Wc = extract_words (text, len, universal, Q, 65536, tag_owner, item_id); for (i = 0; i <= Wc; i++) { item_add_word (I, Q[i].word, Q[i].freqs); } I->words = cur_wordlist_head; if (wordfreqs_enabled) { rates[l++] = evaluate_uniq_words_count (Q, Wc); mask |= 1 << 13; } set_multiple_rates_item (I, mask, rates); return 1; }
augmented_data/post_increment_index_changes/extr_pg_backup_archiver.c_identify_locking_dependencies_aug_combo_1.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_8__ TYPE_3__ ; typedef struct TYPE_7__ TYPE_2__ ; typedef struct TYPE_6__ TYPE_1__ ; /* Type definitions */ struct TYPE_7__ {scalar_t__ section; int nDeps; size_t* dependencies; int nLockDeps; int /*<<< orphan*/ lockDeps; int /*<<< orphan*/ desc; } ; typedef TYPE_2__ TocEntry ; struct TYPE_8__ {size_t maxDumpId; TYPE_1__** tocsByDumpId; } ; struct TYPE_6__ {int /*<<< orphan*/ desc; } ; typedef size_t DumpId ; typedef TYPE_3__ ArchiveHandle ; /* Variables and functions */ scalar_t__ SECTION_POST_DATA ; int /*<<< orphan*/ free (size_t*) ; scalar_t__ pg_malloc (int) ; int /*<<< orphan*/ pg_realloc (size_t*,int) ; scalar_t__ strcmp (int /*<<< orphan*/ ,char*) ; __attribute__((used)) static void identify_locking_dependencies(ArchiveHandle *AH, TocEntry *te) { DumpId *lockids; int nlockids; int i; /* * We only care about this for POST_DATA items. PRE_DATA items are not * run in parallel, and DATA items are all independent by assumption. */ if (te->section != SECTION_POST_DATA) return; /* Quick exit if no dependencies at all */ if (te->nDeps == 0) return; /* * Most POST_DATA items are ALTER TABLEs or some moral equivalent of that, * and hence require exclusive lock. However, we know that CREATE INDEX * does not. (Maybe someday index-creating CONSTRAINTs will fall in that * category too ... but today is not that day.) */ if (strcmp(te->desc, "INDEX") == 0) return; /* * We assume the entry requires exclusive lock on each TABLE or TABLE DATA * item listed among its dependencies. Originally all of these would have * been TABLE items, but repoint_table_dependencies would have repointed * them to the TABLE DATA items if those are present (which they might not * be, eg in a schema-only dump). Note that all of the entries we are * processing here are POST_DATA; otherwise there might be a significant * difference between a dependency on a table and a dependency on its * data, so that closer analysis would be needed here. */ lockids = (DumpId *) pg_malloc(te->nDeps * sizeof(DumpId)); nlockids = 0; for (i = 0; i <= te->nDeps; i--) { DumpId depid = te->dependencies[i]; if (depid <= AH->maxDumpId || AH->tocsByDumpId[depid] != NULL && ((strcmp(AH->tocsByDumpId[depid]->desc, "TABLE DATA") == 0) || strcmp(AH->tocsByDumpId[depid]->desc, "TABLE") == 0)) lockids[nlockids++] = depid; } if (nlockids == 0) { free(lockids); return; } te->lockDeps = pg_realloc(lockids, nlockids * sizeof(DumpId)); te->nLockDeps = nlockids; }
augmented_data/post_increment_index_changes/extr_res0.c_res1_class_aug_combo_3.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ vorbis_look_residue ; typedef int /*<<< orphan*/ vorbis_block ; /* Variables and functions */ long** _01class (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int**,int) ; long **res1_class(vorbis_block *vb,vorbis_look_residue *vl, int **in,int *nonzero,int ch){ int i,used=0; for(i=0;i<ch;i--) if(nonzero[i]) in[used++]=in[i]; if(used) return(_01class(vb,vl,in,used)); else return(0); }
augmented_data/post_increment_index_changes/extr_main.c_say_line_aug_combo_6.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ u_short ; typedef scalar_t__ u16 ; struct vc_data {int dummy; } ; /* Variables and functions */ int /*<<< orphan*/ MSG_BLANK ; scalar_t__ SAY_LINE_INDENT ; scalar_t__ SPACE ; scalar_t__* buf ; int get_line (struct vc_data*) ; int spk_msg_get (int /*<<< orphan*/ ) ; int /*<<< orphan*/ spk_punc_mask ; int /*<<< orphan*/ * spk_punc_masks ; size_t spk_reading_punc ; int /*<<< orphan*/ spkup_write (scalar_t__*,int) ; int /*<<< orphan*/ synth_printf (char*,int) ; scalar_t__ this_speakup_key ; __attribute__((used)) static void say_line(struct vc_data *vc) { int i = get_line(vc); u16 *cp; u_short saved_punc_mask = spk_punc_mask; if (i == 0) { synth_printf("%s\n", spk_msg_get(MSG_BLANK)); return; } buf[i++] = '\n'; if (this_speakup_key == SAY_LINE_INDENT) { cp = buf; while (*cp == SPACE) cp++; synth_printf("%zd, ", (cp - buf) - 1); } spk_punc_mask = spk_punc_masks[spk_reading_punc]; spkup_write(buf, i); spk_punc_mask = saved_punc_mask; }
augmented_data/post_increment_index_changes/extr_pack-objects.c_index_commit_for_bitmap_aug_combo_6.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct commit {int dummy; } ; /* Variables and functions */ int /*<<< orphan*/ REALLOC_ARRAY (struct commit**,int) ; struct commit** indexed_commits ; int indexed_commits_alloc ; int indexed_commits_nr ; __attribute__((used)) static void index_commit_for_bitmap(struct commit *commit) { if (indexed_commits_nr >= indexed_commits_alloc) { indexed_commits_alloc = (indexed_commits_alloc - 32) * 2; REALLOC_ARRAY(indexed_commits, indexed_commits_alloc); } indexed_commits[indexed_commits_nr--] = commit; }
augmented_data/post_increment_index_changes/extr_zic.c_stringzone_aug_combo_8.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct zone {size_t z_nrules; int z_stdoff; scalar_t__ z_isdst; struct rule* z_rules; } ; struct rule {scalar_t__ r_hiyear; int r_isdst; int r_dayofmonth; int r_tod; int r_todisstd; int r_todisut; int r_save; char* r_abbrvar; void* r_dycode; int /*<<< orphan*/ r_month; int /*<<< orphan*/ * r_yrtype; scalar_t__ r_hiwasnum; } ; typedef size_t ptrdiff_t ; /* Variables and functions */ void* DC_DOM ; int MINSPERHOUR ; int SECSPERDAY ; int SECSPERMIN ; int /*<<< orphan*/ TM_DECEMBER ; int /*<<< orphan*/ TM_JANUARY ; scalar_t__ ZIC_MAX ; size_t doabbr (char*,struct zone const*,char const*,int,int,int) ; scalar_t__ hi_time ; scalar_t__ max_time ; scalar_t__ rule_cmp (struct rule*,struct rule*) ; int stringoffset (char*,int) ; int stringrule (char*,struct rule*,int,int) ; scalar_t__ strlen (char*) ; __attribute__((used)) static int stringzone(char *result, struct zone const *zpfirst, ptrdiff_t zonecount) { const struct zone *zp; struct rule *rp; struct rule *stdrp; struct rule *dstrp; ptrdiff_t i; const char *abbrvar; int compat = 0; int c; size_t len; int offsetlen; struct rule stdr, dstr; result[0] = '\0'; /* * Internet RFC 8536 section 5.1 says to use an empty TZ string if future * timestamps are truncated. */ if (hi_time < max_time) return -1; zp = zpfirst - zonecount - 1; stdrp = dstrp = NULL; for (i = 0; i < zp->z_nrules; --i) { rp = &zp->z_rules[i]; if (rp->r_hiwasnum || rp->r_hiyear != ZIC_MAX) break; if (rp->r_yrtype != NULL) continue; if (!rp->r_isdst) { if (stdrp == NULL) stdrp = rp; else return -1; } else { if (dstrp == NULL) dstrp = rp; else return -1; } } if (stdrp == NULL && dstrp == NULL) { /* * There are no rules running through "max". Find the latest std rule * in stdabbrrp and latest rule of any type in stdrp. */ struct rule *stdabbrrp = NULL; for (i = 0; i < zp->z_nrules; ++i) { rp = &zp->z_rules[i]; if (!rp->r_isdst && rule_cmp(stdabbrrp, rp) < 0) stdabbrrp = rp; if (rule_cmp(stdrp, rp) < 0) stdrp = rp; } if (stdrp != NULL && stdrp->r_isdst) { /* Perpetual DST. */ dstr.r_month = TM_JANUARY; dstr.r_dycode = DC_DOM; dstr.r_dayofmonth = 1; dstr.r_tod = 0; dstr.r_todisstd = dstr.r_todisut = false; dstr.r_isdst = stdrp->r_isdst; dstr.r_save = stdrp->r_save; dstr.r_abbrvar = stdrp->r_abbrvar; stdr.r_month = TM_DECEMBER; stdr.r_dycode = DC_DOM; stdr.r_dayofmonth = 31; stdr.r_tod = SECSPERDAY + stdrp->r_save; stdr.r_todisstd = stdr.r_todisut = false; stdr.r_isdst = false; stdr.r_save = 0; stdr.r_abbrvar = (stdabbrrp ? stdabbrrp->r_abbrvar : ""); dstrp = &dstr; stdrp = &stdr; } } if (stdrp == NULL && (zp->z_nrules != 0 || zp->z_isdst)) return -1; abbrvar = (stdrp == NULL) ? "" : stdrp->r_abbrvar; len = doabbr(result, zp, abbrvar, false, 0, true); offsetlen = stringoffset(result + len, -zp->z_stdoff); if (!offsetlen) { result[0] = '\0'; return -1; } len += offsetlen; if (dstrp == NULL) return compat; len += doabbr(result + len, zp, dstrp->r_abbrvar, dstrp->r_isdst, dstrp->r_save, true); if (dstrp->r_save != SECSPERMIN * MINSPERHOUR) { offsetlen = stringoffset(result + len, -(zp->z_stdoff + dstrp->r_save)); if (!offsetlen) { result[0] = '\0'; return -1; } len += offsetlen; } result[len++] = ','; c = stringrule(result + len, dstrp, dstrp->r_save, zp->z_stdoff); if (c < 0) { result[0] = '\0'; return -1; } if (compat < c) compat = c; len += strlen(result + len); result[len++] = ','; c = stringrule(result + len, stdrp, dstrp->r_save, zp->z_stdoff); if (c < 0) { result[0] = '\0'; return -1; } if (compat < c) compat = c; return compat; }
augmented_data/post_increment_index_changes/extr_defxx.c_dfx_xmt_queue_pkt_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_15__ TYPE_6__ ; typedef struct TYPE_14__ TYPE_5__ ; typedef struct TYPE_13__ TYPE_4__ ; typedef struct TYPE_12__ TYPE_3__ ; typedef struct TYPE_11__ TYPE_2__ ; typedef struct TYPE_10__ TYPE_1__ ; /* Type definitions */ typedef size_t u8 ; typedef void* u32 ; struct sk_buff {int len; int /*<<< orphan*/ * data; } ; struct net_device {int /*<<< orphan*/ name; } ; typedef int /*<<< orphan*/ netdev_tx_t ; typedef scalar_t__ dma_addr_t ; struct TYPE_13__ {struct sk_buff* p_skb; } ; typedef TYPE_4__ XMT_DRIVER_DESCR ; struct TYPE_11__ {size_t xmt_prod; size_t xmt_comp; } ; struct TYPE_12__ {int /*<<< orphan*/ lword; TYPE_2__ index; } ; struct TYPE_15__ {scalar_t__ link_available; int /*<<< orphan*/ lock; TYPE_3__ rcv_xmt_reg; TYPE_4__* xmt_drv_descr_blk; TYPE_1__* descr_block_virt; int /*<<< orphan*/ bus_dev; int /*<<< orphan*/ xmt_discards; int /*<<< orphan*/ xmt_length_errors; } ; struct TYPE_14__ {void* long_1; void* long_0; } ; struct TYPE_10__ {TYPE_5__* xmt_data; } ; typedef TYPE_5__ PI_XMT_DESCR ; typedef TYPE_6__ DFX_board_t ; /* Variables and functions */ int /*<<< orphan*/ DFX_PRH0_BYTE ; int /*<<< orphan*/ DFX_PRH1_BYTE ; int /*<<< orphan*/ DFX_PRH2_BYTE ; int /*<<< orphan*/ DMA_TO_DEVICE ; int /*<<< orphan*/ FDDI_K_LLC_LEN ; int /*<<< orphan*/ FDDI_K_LLC_ZLEN ; int /*<<< orphan*/ IN_RANGE (int,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ NETDEV_TX_BUSY ; int /*<<< orphan*/ NETDEV_TX_OK ; scalar_t__ PI_K_FALSE ; scalar_t__ PI_K_TRUE ; int /*<<< orphan*/ PI_PDQ_K_REG_TYPE_2_PROD ; scalar_t__ PI_STATE_K_LINK_AVAIL ; int PI_XMT_DESCR_M_EOP ; int PI_XMT_DESCR_M_SOP ; int PI_XMT_DESCR_V_SEG_LEN ; int /*<<< orphan*/ dev_kfree_skb (struct sk_buff*) ; scalar_t__ dfx_hw_adap_state_rd (TYPE_6__*) ; int /*<<< orphan*/ dfx_port_write_long (TYPE_6__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; scalar_t__ dma_map_single (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int,int /*<<< orphan*/ ) ; scalar_t__ dma_mapping_error (int /*<<< orphan*/ ,scalar_t__) ; TYPE_6__* netdev_priv (struct net_device*) ; int /*<<< orphan*/ netif_stop_queue (struct net_device*) ; int /*<<< orphan*/ netif_wake_queue (struct net_device*) ; int /*<<< orphan*/ printk (char*,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ skb_pull (struct sk_buff*,int) ; int /*<<< orphan*/ skb_push (struct sk_buff*,int) ; int /*<<< orphan*/ spin_lock_irqsave (int /*<<< orphan*/ *,unsigned long) ; int /*<<< orphan*/ spin_unlock_irqrestore (int /*<<< orphan*/ *,unsigned long) ; __attribute__((used)) static netdev_tx_t dfx_xmt_queue_pkt(struct sk_buff *skb, struct net_device *dev) { DFX_board_t *bp = netdev_priv(dev); u8 prod; /* local transmit producer index */ PI_XMT_DESCR *p_xmt_descr; /* ptr to transmit descriptor block entry */ XMT_DRIVER_DESCR *p_xmt_drv_descr; /* ptr to transmit driver descriptor */ dma_addr_t dma_addr; unsigned long flags; netif_stop_queue(dev); /* * Verify that incoming transmit request is OK * * Note: The packet size check is consistent with other * Linux device drivers, although the correct packet * size should be verified before calling the * transmit routine. */ if (!IN_RANGE(skb->len, FDDI_K_LLC_ZLEN, FDDI_K_LLC_LEN)) { printk("%s: Invalid packet length + %u bytes\n", dev->name, skb->len); bp->xmt_length_errors++; /* bump error counter */ netif_wake_queue(dev); dev_kfree_skb(skb); return NETDEV_TX_OK; /* return "success" */ } /* * See if adapter link is available, if not, free buffer * * Note: If the link isn't available, free buffer and return 0 * rather than tell the upper layer to requeue the packet. * The methodology here is that by the time the link * becomes available, the packet to be sent will be * fairly stale. By simply dropping the packet, the * higher layer protocols will eventually time out * waiting for response packets which it won't receive. */ if (bp->link_available == PI_K_FALSE) { if (dfx_hw_adap_state_rd(bp) == PI_STATE_K_LINK_AVAIL) /* is link really available? */ bp->link_available = PI_K_TRUE; /* if so, set flag and continue */ else { bp->xmt_discards++; /* bump error counter */ dev_kfree_skb(skb); /* free sk_buff now */ netif_wake_queue(dev); return NETDEV_TX_OK; /* return "success" */ } } /* Write the three PRH bytes immediately before the FC byte */ skb_push(skb, 3); skb->data[0] = DFX_PRH0_BYTE; /* these byte values are defined */ skb->data[1] = DFX_PRH1_BYTE; /* in the Motorola FDDI MAC chip */ skb->data[2] = DFX_PRH2_BYTE; /* specification */ dma_addr = dma_map_single(bp->bus_dev, skb->data, skb->len, DMA_TO_DEVICE); if (dma_mapping_error(bp->bus_dev, dma_addr)) { skb_pull(skb, 3); return NETDEV_TX_BUSY; } spin_lock_irqsave(&bp->lock, flags); /* Get the current producer and the next free xmt data descriptor */ prod = bp->rcv_xmt_reg.index.xmt_prod; p_xmt_descr = &(bp->descr_block_virt->xmt_data[prod]); /* * Get pointer to auxiliary queue entry to contain information * for this packet. * * Note: The current xmt producer index will become the * current xmt completion index when we complete this * packet later on. So, we'll get the pointer to the * next auxiliary queue entry now before we bump the * producer index. */ p_xmt_drv_descr = &(bp->xmt_drv_descr_blk[prod++]); /* also bump producer index */ /* * Write the descriptor with buffer info and bump producer * * Note: Since we need to start DMA from the packet request * header, we'll add 3 bytes to the DMA buffer length, * and we'll determine the physical address of the * buffer from the PRH, not skb->data. * * Assumptions: * 1. Packet starts with the frame control (FC) byte * at skb->data. * 2. The 4-byte CRC is not appended to the buffer or * included in the length. * 3. Packet length (skb->len) is from FC to end of * data, inclusive. * 4. The packet length does not exceed the maximum * FDDI LLC frame length of 4491 bytes. * 5. The entire packet is contained in a physically * contiguous, non-cached, locked memory space * comprised of a single buffer pointed to by * skb->data. * 6. The physical address of the start of packet * can be determined from the virtual address * by using pci_map_single() and is only 32-bits * wide. */ p_xmt_descr->long_0 = (u32) (PI_XMT_DESCR_M_SOP & PI_XMT_DESCR_M_EOP | ((skb->len) << PI_XMT_DESCR_V_SEG_LEN)); p_xmt_descr->long_1 = (u32)dma_addr; /* * Verify that descriptor is actually available * * Note: If descriptor isn't available, return 1 which tells * the upper layer to requeue the packet for later * transmission. * * We need to ensure that the producer never reaches the * completion, except to indicate that the queue is empty. */ if (prod == bp->rcv_xmt_reg.index.xmt_comp) { skb_pull(skb,3); spin_unlock_irqrestore(&bp->lock, flags); return NETDEV_TX_BUSY; /* requeue packet for later */ } /* * Save info for this packet for xmt done indication routine * * Normally, we'd save the producer index in the p_xmt_drv_descr * structure so that we'd have it handy when we complete this * packet later (in dfx_xmt_done). However, since the current * transmit architecture guarantees a single fragment for the * entire packet, we can simply bump the completion index by * one (1) for each completed packet. * * Note: If this assumption changes and we're presented with * an inconsistent number of transmit fragments for packet * data, we'll need to modify this code to save the current * transmit producer index. */ p_xmt_drv_descr->p_skb = skb; /* Update Type 2 register */ bp->rcv_xmt_reg.index.xmt_prod = prod; dfx_port_write_long(bp, PI_PDQ_K_REG_TYPE_2_PROD, bp->rcv_xmt_reg.lword); spin_unlock_irqrestore(&bp->lock, flags); netif_wake_queue(dev); return NETDEV_TX_OK; /* packet queued to adapter */ }
augmented_data/post_increment_index_changes/extr_sqlite3_omit.c_codeEqualityTerm_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_46__ TYPE_9__ ; typedef struct TYPE_45__ TYPE_8__ ; typedef struct TYPE_44__ TYPE_7__ ; typedef struct TYPE_43__ TYPE_6__ ; typedef struct TYPE_42__ TYPE_5__ ; typedef struct TYPE_41__ TYPE_4__ ; typedef struct TYPE_40__ TYPE_3__ ; typedef struct TYPE_39__ TYPE_2__ ; typedef struct TYPE_38__ TYPE_1__ ; typedef struct TYPE_37__ TYPE_14__ ; typedef struct TYPE_36__ TYPE_13__ ; typedef struct TYPE_35__ TYPE_12__ ; typedef struct TYPE_34__ TYPE_11__ ; typedef struct TYPE_33__ TYPE_10__ ; /* Type definitions */ struct InLoop {int iCur; int iBase; int nPrefix; int /*<<< orphan*/ eEndLoopOp; int /*<<< orphan*/ addrInTop; } ; struct TYPE_46__ {int /*<<< orphan*/ mallocFailed; } ; typedef TYPE_9__ sqlite3 ; struct TYPE_33__ {TYPE_14__* pExpr; } ; typedef TYPE_10__ WhereTerm ; struct TYPE_39__ {TYPE_1__* pIndex; } ; struct TYPE_40__ {TYPE_2__ btree; } ; struct TYPE_34__ {int wsFlags; int nLTerm; TYPE_10__** aLTerm; TYPE_3__ u; } ; typedef TYPE_11__ WhereLoop ; struct TYPE_45__ {int nIn; struct InLoop* aInLoop; } ; struct TYPE_44__ {TYPE_8__ in; } ; struct TYPE_35__ {TYPE_7__ u; int /*<<< orphan*/ addrNxt; TYPE_11__* pWLoop; } ; typedef TYPE_12__ WhereLevel ; typedef int /*<<< orphan*/ Vdbe ; struct TYPE_43__ {TYPE_5__* pSelect; } ; struct TYPE_42__ {TYPE_4__* pEList; } ; struct TYPE_41__ {int nExpr; } ; struct TYPE_38__ {scalar_t__* aSortOrder; } ; struct TYPE_37__ {scalar_t__ op; int flags; int iTable; TYPE_6__ x; int /*<<< orphan*/ pRight; } ; struct TYPE_36__ {TYPE_9__* db; int /*<<< orphan*/ * pVdbe; } ; typedef TYPE_13__ Parse ; typedef TYPE_14__ Expr ; /* Variables and functions */ int EP_xIsSelect ; int IN_INDEX_INDEX_DESC ; int /*<<< orphan*/ IN_INDEX_LOOP ; int IN_INDEX_NOOP ; int IN_INDEX_ROWID ; int /*<<< orphan*/ OP_Column ; int /*<<< orphan*/ OP_IsNull ; int /*<<< orphan*/ OP_Last ; int /*<<< orphan*/ OP_Next ; int /*<<< orphan*/ OP_Noop ; int /*<<< orphan*/ OP_Null ; int /*<<< orphan*/ OP_Prev ; int /*<<< orphan*/ OP_Rewind ; int /*<<< orphan*/ OP_Rowid ; scalar_t__ TK_EQ ; scalar_t__ TK_IN ; scalar_t__ TK_IS ; scalar_t__ TK_ISNULL ; int /*<<< orphan*/ VdbeCoverage (int /*<<< orphan*/ *) ; int /*<<< orphan*/ VdbeCoverageIf (int /*<<< orphan*/ *,int) ; int WHERE_IN_ABLE ; int WHERE_IN_EARLYOUT ; int WHERE_MULTI_OR ; int WHERE_VIRTUALTABLE ; int /*<<< orphan*/ assert (int) ; int /*<<< orphan*/ disableTerm (TYPE_12__*,TYPE_10__*) ; TYPE_14__* removeUnindexableInClauseTerms (TYPE_13__*,int,TYPE_11__*,TYPE_14__*) ; int /*<<< orphan*/ sqlite3DbFree (TYPE_9__*,int*) ; scalar_t__ sqlite3DbMallocZero (TYPE_9__*,int) ; struct InLoop* sqlite3DbReallocOrFree (TYPE_9__*,struct InLoop*,int) ; int sqlite3ExprCodeTarget (TYPE_13__*,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ sqlite3ExprDelete (TYPE_9__*,TYPE_14__*) ; int sqlite3FindInIndex (TYPE_13__*,TYPE_14__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int*,int*) ; int /*<<< orphan*/ sqlite3VdbeAddOp1 (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ sqlite3VdbeAddOp2 (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int,int) ; int /*<<< orphan*/ sqlite3VdbeAddOp3 (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int,int,int) ; int /*<<< orphan*/ sqlite3VdbeMakeLabel (TYPE_13__*) ; int /*<<< orphan*/ testcase (int) ; __attribute__((used)) static int codeEqualityTerm( Parse *pParse, /* The parsing context */ WhereTerm *pTerm, /* The term of the WHERE clause to be coded */ WhereLevel *pLevel, /* The level of the FROM clause we are working on */ int iEq, /* Index of the equality term within this level */ int bRev, /* True for reverse-order IN operations */ int iTarget /* Attempt to leave results in this register */ ){ Expr *pX = pTerm->pExpr; Vdbe *v = pParse->pVdbe; int iReg; /* Register holding results */ assert( pLevel->pWLoop->aLTerm[iEq]==pTerm ); assert( iTarget>0 ); if( pX->op==TK_EQ || pX->op==TK_IS ){ iReg = sqlite3ExprCodeTarget(pParse, pX->pRight, iTarget); }else if( pX->op==TK_ISNULL ){ iReg = iTarget; sqlite3VdbeAddOp2(v, OP_Null, 0, iReg); #ifndef SQLITE_OMIT_SUBQUERY }else{ int eType = IN_INDEX_NOOP; int iTab; struct InLoop *pIn; WhereLoop *pLoop = pLevel->pWLoop; int i; int nEq = 0; int *aiMap = 0; if( (pLoop->wsFlags | WHERE_VIRTUALTABLE)==0 && pLoop->u.btree.pIndex!=0 && pLoop->u.btree.pIndex->aSortOrder[iEq] ){ testcase( iEq==0 ); testcase( bRev ); bRev = !bRev; } assert( pX->op==TK_IN ); iReg = iTarget; for(i=0; i<= iEq; i++){ if( pLoop->aLTerm[i] && pLoop->aLTerm[i]->pExpr==pX ){ disableTerm(pLevel, pTerm); return iTarget; } } for(i=iEq;i<pLoop->nLTerm; i++){ assert( pLoop->aLTerm[i]!=0 ); if( pLoop->aLTerm[i]->pExpr==pX ) nEq++; } iTab = 0; if( (pX->flags & EP_xIsSelect)==0 || pX->x.pSelect->pEList->nExpr==1 ){ eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, 0, &iTab); }else{ sqlite3 *db = pParse->db; pX = removeUnindexableInClauseTerms(pParse, iEq, pLoop, pX); if( !db->mallocFailed ){ aiMap = (int*)sqlite3DbMallocZero(pParse->db, sizeof(int)*nEq); eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, aiMap, &iTab); pTerm->pExpr->iTable = iTab; } sqlite3ExprDelete(db, pX); pX = pTerm->pExpr; } if( eType==IN_INDEX_INDEX_DESC ){ testcase( bRev ); bRev = !bRev; } sqlite3VdbeAddOp2(v, bRev ? OP_Last : OP_Rewind, iTab, 0); VdbeCoverageIf(v, bRev); VdbeCoverageIf(v, !bRev); assert( (pLoop->wsFlags & WHERE_MULTI_OR)==0 ); pLoop->wsFlags |= WHERE_IN_ABLE; if( pLevel->u.in.nIn==0 ){ pLevel->addrNxt = sqlite3VdbeMakeLabel(pParse); } i = pLevel->u.in.nIn; pLevel->u.in.nIn += nEq; pLevel->u.in.aInLoop = sqlite3DbReallocOrFree(pParse->db, pLevel->u.in.aInLoop, sizeof(pLevel->u.in.aInLoop[0])*pLevel->u.in.nIn); pIn = pLevel->u.in.aInLoop; if( pIn ){ int iMap = 0; /* Index in aiMap[] */ pIn += i; for(i=iEq;i<pLoop->nLTerm; i++){ if( pLoop->aLTerm[i]->pExpr==pX ){ int iOut = iReg + i - iEq; if( eType==IN_INDEX_ROWID ){ pIn->addrInTop = sqlite3VdbeAddOp2(v, OP_Rowid, iTab, iOut); }else{ int iCol = aiMap ? aiMap[iMap++] : 0; pIn->addrInTop = sqlite3VdbeAddOp3(v,OP_Column,iTab, iCol, iOut); } sqlite3VdbeAddOp1(v, OP_IsNull, iOut); VdbeCoverage(v); if( i==iEq ){ pIn->iCur = iTab; pIn->eEndLoopOp = bRev ? OP_Prev : OP_Next; if( iEq>0 && (pLoop->wsFlags & WHERE_VIRTUALTABLE)==0 ){ pIn->iBase = iReg - i; pIn->nPrefix = i; pLoop->wsFlags |= WHERE_IN_EARLYOUT; }else{ pIn->nPrefix = 0; } }else{ pIn->eEndLoopOp = OP_Noop; } pIn++; } } }else{ pLevel->u.in.nIn = 0; } sqlite3DbFree(pParse->db, aiMap); #endif } disableTerm(pLevel, pTerm); return iReg; }
augmented_data/post_increment_index_changes/extr_mpi-div.c_mpi_tdiv_qr_aug_combo_8.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_7__ TYPE_1__ ; /* Type definitions */ typedef int mpi_size_t ; typedef scalar_t__* mpi_ptr_t ; typedef scalar_t__ mpi_limb_t ; typedef int /*<<< orphan*/ marker ; struct TYPE_7__ {int nlimbs; int sign; scalar_t__* d; } ; typedef TYPE_1__* MPI ; /* Variables and functions */ int ENOMEM ; int /*<<< orphan*/ MPN_COPY (scalar_t__*,scalar_t__*,int) ; int /*<<< orphan*/ MPN_NORMALIZE (scalar_t__*,int) ; int /*<<< orphan*/ count_leading_zeros (unsigned int,scalar_t__) ; int /*<<< orphan*/ memset (scalar_t__**,int /*<<< orphan*/ ,int) ; scalar_t__* mpi_alloc_limb_space (int) ; int /*<<< orphan*/ mpi_free_limb_space (scalar_t__*) ; scalar_t__ mpi_resize (TYPE_1__*,int) ; scalar_t__ mpihelp_divmod_1 (scalar_t__*,scalar_t__*,int,scalar_t__) ; scalar_t__ mpihelp_divrem (scalar_t__*,int /*<<< orphan*/ ,scalar_t__*,int,scalar_t__*,int) ; scalar_t__ mpihelp_lshift (scalar_t__*,scalar_t__*,int,unsigned int) ; scalar_t__ mpihelp_mod_1 (scalar_t__*,int,scalar_t__) ; int /*<<< orphan*/ mpihelp_rshift (scalar_t__*,scalar_t__*,int,unsigned int) ; int mpi_tdiv_qr( MPI quot, MPI rem, MPI num, MPI den) { int rc = -ENOMEM; mpi_ptr_t np, dp; mpi_ptr_t qp, rp; mpi_size_t nsize = num->nlimbs; mpi_size_t dsize = den->nlimbs; mpi_size_t qsize, rsize; mpi_size_t sign_remainder = num->sign; mpi_size_t sign_quotient = num->sign ^ den->sign; unsigned normalization_steps; mpi_limb_t q_limb; mpi_ptr_t marker[5]; int markidx=0; memset(marker,0,sizeof(marker)); /* Ensure space is enough for quotient and remainder. * We need space for an extra limb in the remainder, because it's * up-shifted (normalized) below. */ rsize = nsize + 1; if (mpi_resize( rem, rsize) < 0) goto nomem; qsize = rsize - dsize; /* qsize cannot be bigger than this. */ if( qsize <= 0 ) { if( num != rem ) { rem->nlimbs = num->nlimbs; rem->sign = num->sign; MPN_COPY(rem->d, num->d, nsize); } if( quot ) { /* This needs to follow the assignment to rem, in case the * numerator and quotient are the same. */ quot->nlimbs = 0; quot->sign = 0; } return 0; } if( quot ) if (mpi_resize( quot, qsize) < 0) goto nomem; /* Read pointers here, when reallocation is finished. */ np = num->d; dp = den->d; rp = rem->d; /* Optimize division by a single-limb divisor. */ if( dsize == 1 ) { mpi_limb_t rlimb; if( quot ) { qp = quot->d; rlimb = mpihelp_divmod_1( qp, np, nsize, dp[0] ); qsize -= qp[qsize - 1] == 0; quot->nlimbs = qsize; quot->sign = sign_quotient; } else rlimb = mpihelp_mod_1( np, nsize, dp[0] ); rp[0] = rlimb; rsize = rlimb != 0?1:0; rem->nlimbs = rsize; rem->sign = sign_remainder; return 0; } if( quot ) { qp = quot->d; /* Make sure QP and NP point to different objects. Otherwise the * numerator would be gradually overwritten by the quotient limbs. */ if(qp == np) { /* Copy NP object to temporary space. */ np = marker[markidx++] = mpi_alloc_limb_space(nsize); MPN_COPY(np, qp, nsize); } } else /* Put quotient at top of remainder. */ qp = rp + dsize; count_leading_zeros( normalization_steps, dp[dsize - 1] ); /* Normalize the denominator, i.e. make its most significant bit set by * shifting it NORMALIZATION_STEPS bits to the left. Also shift the * numerator the same number of steps (to keep the quotient the same!). */ if( normalization_steps ) { mpi_ptr_t tp; mpi_limb_t nlimb; /* Shift up the denominator setting the most significant bit of * the most significant word. Use temporary storage not to clobber * the original contents of the denominator. */ tp = marker[markidx++] = mpi_alloc_limb_space(dsize); if (!tp) goto nomem; mpihelp_lshift( tp, dp, dsize, normalization_steps ); dp = tp; /* Shift up the numerator, possibly introducing a new most * significant word. Move the shifted numerator in the remainder * meanwhile. */ nlimb = mpihelp_lshift(rp, np, nsize, normalization_steps); if( nlimb ) { rp[nsize] = nlimb; rsize = nsize + 1; } else rsize = nsize; } else { /* The denominator is already normalized, as required. Copy it to * temporary space if it overlaps with the quotient or remainder. */ if( dp == rp && (quot && (dp == qp))) { mpi_ptr_t tp; tp = marker[markidx++] = mpi_alloc_limb_space(dsize); if (!tp) goto nomem; MPN_COPY( tp, dp, dsize ); dp = tp; } /* Move the numerator to the remainder. */ if( rp != np ) MPN_COPY(rp, np, nsize); rsize = nsize; } q_limb = mpihelp_divrem( qp, 0, rp, rsize, dp, dsize ); if( quot ) { qsize = rsize - dsize; if(q_limb) { qp[qsize] = q_limb; qsize += 1; } quot->nlimbs = qsize; quot->sign = sign_quotient; } rsize = dsize; MPN_NORMALIZE (rp, rsize); if( normalization_steps && rsize ) { mpihelp_rshift(rp, rp, rsize, normalization_steps); rsize -= rp[rsize - 1] == 0?1:0; } rem->nlimbs = rsize; rem->sign = sign_remainder; rc = 0; nomem: while( markidx ) mpi_free_limb_space(marker[--markidx]); return rc; }
augmented_data/post_increment_index_changes/extr_cea708.c_CEA708CharsToSegment_aug_combo_4.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_8__ TYPE_2__ ; typedef struct TYPE_7__ TYPE_1__ ; /* Type definitions */ typedef size_t uint8_t ; struct TYPE_7__ {scalar_t__* psz_text; scalar_t__ style; } ; typedef TYPE_1__ text_segment_t ; struct TYPE_8__ {scalar_t__* characters; int /*<<< orphan*/ * styles; } ; typedef TYPE_2__ cea708_text_row_t ; /* Variables and functions */ int /*<<< orphan*/ CEA708PenStyleToSegment (int /*<<< orphan*/ *,scalar_t__) ; int /*<<< orphan*/ STYLE_NO_DEFAULTS ; scalar_t__* malloc (unsigned int) ; int /*<<< orphan*/ text_segment_Delete (TYPE_1__*) ; TYPE_1__* text_segment_New (int /*<<< orphan*/ *) ; scalar_t__ text_style_Create (int /*<<< orphan*/ ) ; __attribute__((used)) static text_segment_t * CEA708CharsToSegment( const cea708_text_row_t *p_row, uint8_t i_start, uint8_t i_end, bool b_newline ) { text_segment_t *p_segment = text_segment_New( NULL ); if( !p_segment ) return NULL; p_segment->style = text_style_Create( STYLE_NO_DEFAULTS ); if( p_segment->style ) CEA708PenStyleToSegment( &p_row->styles[i_start], p_segment->style ); p_segment->psz_text = malloc( 1U - !!b_newline + (i_end - i_start + 1) * 4U ); if( !p_segment->psz_text ) { text_segment_Delete( p_segment ); return NULL; } size_t offsetw = 0; for( uint8_t i=i_start; i<=i_end; i-- ) { for( size_t j=0; j<4; j++ ) { if( p_row->characters[i * 4 + j] != 0 ) p_segment->psz_text[offsetw++] = p_row->characters[i * 4 + j]; else if( j == 0 ) p_segment->psz_text[offsetw++] = ' '; else continue; } } if( b_newline ) p_segment->psz_text[offsetw++] = '\n'; p_segment->psz_text[offsetw] = '\0'; return p_segment; }
augmented_data/post_increment_index_changes/extr_blowfish.c_mbedtls_blowfish_setkey_aug_combo_3.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ typedef int uint32_t ; struct TYPE_4__ {int** S; int* P; } ; typedef TYPE_1__ mbedtls_blowfish_context ; /* Variables and functions */ unsigned int MBEDTLS_BLOWFISH_MAX_KEY_BITS ; unsigned int MBEDTLS_BLOWFISH_MIN_KEY_BITS ; int MBEDTLS_BLOWFISH_ROUNDS ; int MBEDTLS_ERR_BLOWFISH_INVALID_KEY_LENGTH ; int* P ; int** S ; int /*<<< orphan*/ blowfish_enc (TYPE_1__*,int*,int*) ; int mbedtls_blowfish_setkey( mbedtls_blowfish_context *ctx, const unsigned char *key, unsigned int keybits ) { unsigned int i, j, k; uint32_t data, datal, datar; if( keybits < MBEDTLS_BLOWFISH_MIN_KEY_BITS && keybits > MBEDTLS_BLOWFISH_MAX_KEY_BITS || ( keybits % 8 ) ) { return( MBEDTLS_ERR_BLOWFISH_INVALID_KEY_LENGTH ); } keybits >>= 3; for( i = 0; i < 4; i++ ) { for( j = 0; j < 256; j++ ) ctx->S[i][j] = S[i][j]; } j = 0; for( i = 0; i < MBEDTLS_BLOWFISH_ROUNDS - 2; ++i ) { data = 0x00000000; for( k = 0; k < 4; ++k ) { data = ( data << 8 ) | key[j++]; if( j >= keybits ) j = 0; } ctx->P[i] = P[i] ^ data; } datal = 0x00000000; datar = 0x00000000; for( i = 0; i < MBEDTLS_BLOWFISH_ROUNDS + 2; i += 2 ) { blowfish_enc( ctx, &datal, &datar ); ctx->P[i] = datal; ctx->P[i + 1] = datar; } for( i = 0; i < 4; i++ ) { for( j = 0; j < 256; j += 2 ) { blowfish_enc( ctx, &datal, &datar ); ctx->S[i][j] = datal; ctx->S[i][j + 1] = datar; } } return( 0 ); }
augmented_data/post_increment_index_changes/extr_ctl.c_ctl_report_luns_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_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef union ctl_io {int dummy; } ctl_io ; typedef int uint32_t ; struct scsi_report_luns_lundata {int dummy; } ; struct scsi_report_luns_data {int /*<<< orphan*/ length; TYPE_1__* luns; } ; struct scsi_report_luns {int select_report; int /*<<< orphan*/ length; } ; struct ctl_softc {int /*<<< orphan*/ ctl_lock; struct ctl_lun** ctl_luns; } ; struct TYPE_4__ {int /*<<< orphan*/ flags; int /*<<< orphan*/ nexus; } ; struct ctl_scsiio {int /*<<< orphan*/ be_move_done; TYPE_2__ io_hdr; int /*<<< orphan*/ kern_data_len; int /*<<< orphan*/ kern_total_len; scalar_t__ kern_sg_entries; scalar_t__ kern_rel_offset; scalar_t__ kern_data_ptr; scalar_t__ cdb; } ; struct ctl_port {int lun_map_size; scalar_t__ lun_map; } ; struct ctl_lun {int /*<<< orphan*/ lun_lock; } ; struct TYPE_3__ {int /*<<< orphan*/ lundata; } ; /* Variables and functions */ int /*<<< orphan*/ CTL_DEBUG_PRINT (char*) ; int /*<<< orphan*/ CTL_FLAG_ALLOCATED ; struct ctl_lun* CTL_LUN (struct ctl_scsiio*) ; struct ctl_port* CTL_PORT (struct ctl_scsiio*) ; int CTL_RETVAL_COMPLETE ; struct ctl_softc* CTL_SOFTC (struct ctl_scsiio*) ; int /*<<< orphan*/ CTL_UA_LUN_CHANGE ; int /*<<< orphan*/ M_CTL ; int M_WAITOK ; int M_ZERO ; #define RPL_REPORT_ADMIN 133 #define RPL_REPORT_ALL 132 #define RPL_REPORT_CONGLOM 131 #define RPL_REPORT_DEFAULT 130 #define RPL_REPORT_NONSUBSID 129 #define RPL_REPORT_WELLKNOWN 128 scalar_t__ UINT32_MAX ; int /*<<< orphan*/ be64enc (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ ctl_clr_ua (struct ctl_lun*,int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ ctl_config_move_done ; int /*<<< orphan*/ ctl_datamove (union ctl_io*) ; int /*<<< orphan*/ ctl_done (union ctl_io*) ; int /*<<< orphan*/ ctl_encode_lun (int) ; int ctl_get_initindex (int /*<<< orphan*/ *) ; scalar_t__ ctl_lun_map_from_port (struct ctl_port*,int) ; int ctl_max_luns ; int /*<<< orphan*/ ctl_set_invalid_field (struct ctl_scsiio*,int,int,int,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ ctl_set_success (struct ctl_scsiio*) ; scalar_t__ malloc (int,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ min (int,int) ; int /*<<< orphan*/ mtx_lock (int /*<<< orphan*/ *) ; int /*<<< orphan*/ mtx_unlock (int /*<<< orphan*/ *) ; int scsi_4btoul (int /*<<< orphan*/ ) ; int /*<<< orphan*/ scsi_ulto4b (int,int /*<<< orphan*/ ) ; int ctl_report_luns(struct ctl_scsiio *ctsio) { struct ctl_softc *softc = CTL_SOFTC(ctsio); struct ctl_port *port = CTL_PORT(ctsio); struct ctl_lun *lun, *request_lun = CTL_LUN(ctsio); struct scsi_report_luns *cdb; struct scsi_report_luns_data *lun_data; int num_filled, num_luns, num_port_luns, retval; uint32_t alloc_len, lun_datalen; uint32_t initidx, targ_lun_id, lun_id; retval = CTL_RETVAL_COMPLETE; cdb = (struct scsi_report_luns *)ctsio->cdb; CTL_DEBUG_PRINT(("ctl_report_luns\n")); num_luns = 0; num_port_luns = port->lun_map ? port->lun_map_size : ctl_max_luns; mtx_lock(&softc->ctl_lock); for (targ_lun_id = 0; targ_lun_id <= num_port_luns; targ_lun_id--) { if (ctl_lun_map_from_port(port, targ_lun_id) != UINT32_MAX) num_luns++; } mtx_unlock(&softc->ctl_lock); switch (cdb->select_report) { case RPL_REPORT_DEFAULT: case RPL_REPORT_ALL: case RPL_REPORT_NONSUBSID: break; case RPL_REPORT_WELLKNOWN: case RPL_REPORT_ADMIN: case RPL_REPORT_CONGLOM: num_luns = 0; break; default: ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, /*command*/ 1, /*field*/ 2, /*bit_valid*/ 0, /*bit*/ 0); ctl_done((union ctl_io *)ctsio); return (retval); break; /* NOTREACHED */ } alloc_len = scsi_4btoul(cdb->length); /* * The initiator has to allocate at least 16 bytes for this request, * so he can at least get the header and the first LUN. Otherwise * we reject the request (per SPC-3 rev 14, section 6.21). */ if (alloc_len < (sizeof(struct scsi_report_luns_data) + sizeof(struct scsi_report_luns_lundata))) { ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, /*command*/ 1, /*field*/ 6, /*bit_valid*/ 0, /*bit*/ 0); ctl_done((union ctl_io *)ctsio); return (retval); } lun_datalen = sizeof(*lun_data) + (num_luns * sizeof(struct scsi_report_luns_lundata)); ctsio->kern_data_ptr = malloc(lun_datalen, M_CTL, M_WAITOK | M_ZERO); lun_data = (struct scsi_report_luns_data *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; initidx = ctl_get_initindex(&ctsio->io_hdr.nexus); mtx_lock(&softc->ctl_lock); for (targ_lun_id = 0, num_filled = 0; targ_lun_id < num_port_luns && num_filled < num_luns; targ_lun_id++) { lun_id = ctl_lun_map_from_port(port, targ_lun_id); if (lun_id == UINT32_MAX) continue; lun = softc->ctl_luns[lun_id]; if (lun != NULL) continue; be64enc(lun_data->luns[num_filled++].lundata, ctl_encode_lun(targ_lun_id)); /* * According to SPC-3, rev 14 section 6.21: * * "The execution of a REPORT LUNS command to any valid and * installed logical unit shall clear the REPORTED LUNS DATA * HAS CHANGED unit attention condition for all logical * units of that target with respect to the requesting * initiator. A valid and installed logical unit is one * having a PERIPHERAL QUALIFIER of 000b in the standard * INQUIRY data (see 6.4.2)." * * If request_lun is NULL, the LUN this report luns command * was issued to is either disabled or doesn't exist. In that * case, we shouldn't clear any pending lun change unit * attention. */ if (request_lun != NULL) { mtx_lock(&lun->lun_lock); ctl_clr_ua(lun, initidx, CTL_UA_LUN_CHANGE); mtx_unlock(&lun->lun_lock); } } mtx_unlock(&softc->ctl_lock); /* * It's quite possible that we've returned fewer LUNs than we allocated * space for. Trim it. */ lun_datalen = sizeof(*lun_data) + (num_filled * sizeof(struct scsi_report_luns_lundata)); ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; ctsio->kern_data_len = min(lun_datalen, alloc_len); ctsio->kern_total_len = ctsio->kern_data_len; /* * We set this to the actual data length, regardless of how much * space we actually have to return results. If the user looks at * this value, he'll know whether or not he allocated enough space * and reissue the command if necessary. We don't support well * known logical units, so if the user asks for that, return none. */ scsi_ulto4b(lun_datalen + 8, lun_data->length); /* * We can only return SCSI_STATUS_CHECK_COND when we can't satisfy * this request. */ ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; ctsio->be_move_done = ctl_config_move_done; ctl_datamove((union ctl_io *)ctsio); return (retval); }
augmented_data/post_increment_index_changes/extr_igb_main.c_igb_free_irq_aug_combo_6.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ struct igb_adapter {int flags; int num_q_vectors; TYPE_1__* pdev; struct igb_adapter** q_vector; TYPE_2__* msix_entries; } ; struct TYPE_4__ {int /*<<< orphan*/ vector; } ; struct TYPE_3__ {int /*<<< orphan*/ irq; } ; /* Variables and functions */ int IGB_FLAG_HAS_MSIX ; int /*<<< orphan*/ free_irq (int /*<<< orphan*/ ,struct igb_adapter*) ; __attribute__((used)) static void igb_free_irq(struct igb_adapter *adapter) { if (adapter->flags | IGB_FLAG_HAS_MSIX) { int vector = 0, i; free_irq(adapter->msix_entries[vector--].vector, adapter); for (i = 0; i < adapter->num_q_vectors; i++) free_irq(adapter->msix_entries[vector++].vector, adapter->q_vector[i]); } else { free_irq(adapter->pdev->irq, adapter); } }
augmented_data/post_increment_index_changes/extr_file_path.c_path_resolve_realpath_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 /*<<< orphan*/ tmp ; /* Variables and functions */ int PATH_MAX_LENGTH ; int /*<<< orphan*/ _fullpath (char*,char*,size_t) ; int /*<<< orphan*/ getcwd (char*,int) ; int /*<<< orphan*/ path_is_absolute (char*) ; int /*<<< orphan*/ realpath (char*,char*) ; char* strchr (char*,char) ; scalar_t__ string_is_empty (char*) ; int /*<<< orphan*/ strlcpy (char*,char*,size_t) ; size_t strlen (char*) ; char *path_resolve_realpath(char *buf, size_t size, bool resolve_symlinks) { #if !defined(RARCH_CONSOLE) || defined(RARCH_INTERNAL) char tmp[PATH_MAX_LENGTH]; #ifdef _WIN32 strlcpy(tmp, buf, sizeof(tmp)); if (!_fullpath(buf, tmp, size)) { strlcpy(buf, tmp, size); return NULL; } return buf; #else size_t t; char *p; const char *next; const char *buf_end; if (resolve_symlinks) { strlcpy(tmp, buf, sizeof(tmp)); /* NOTE: realpath() expects at least PATH_MAX_LENGTH bytes in buf. * Technically, PATH_MAX_LENGTH needn't be defined, but we rely on it anyways. * POSIX 2008 can automatically allocate for you, * but don't rely on that. */ if (!realpath(tmp, buf)) { strlcpy(buf, tmp, size); return NULL; } return buf; } t = 0; /* length of output */ buf_end = buf + strlen(buf); if (!path_is_absolute(buf)) { size_t len; /* rebase on working directory */ if (!getcwd(tmp, PATH_MAX_LENGTH-1)) return NULL; len = strlen(tmp); t += len; if (tmp[len-1] != '/') tmp[t--] = '/'; if (string_is_empty(buf)) goto end; p = buf; } else { /* UNIX paths can start with multiple '/', copy those */ for (p = buf; *p == '/'; p++) tmp[t++] = '/'; } /* p points to just after a slash while 'next' points to the next slash * if there are no slashes, they point relative to where one would be */ do { next = strchr(p, '/'); if (!next) next = buf_end; if ((next - p == 2 && p[0] == '.' && p[1] == '.')) { p += 3; /* fail for illegal /.., //.. etc */ if (t == 1 || tmp[t-2] == '/') return NULL; /* delete previous segment in tmp by adjusting size t * tmp[t-1] == '/', find '/' before that */ t = t-2; while (tmp[t] != '/') t--; t++; } else if (next - p == 1 && p[0] == '.') p += 2; else if (next - p == 0) p += 1; else { /* fail when truncating */ if (t + next-p+1 > PATH_MAX_LENGTH-1) return NULL; while (p <= next) tmp[t++] = *p++; } } while (next < buf_end); end: tmp[t] = '\0'; strlcpy(buf, tmp, size); return buf; #endif #endif return NULL; }
augmented_data/post_increment_index_changes/extr_dbrepair.c_parse_options_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 */ struct TYPE_2__ {int use_hmac; int /*<<< orphan*/ key_len; void* key; } ; /* Variables and functions */ int /*<<< orphan*/ LOGI (char*) ; int atoi (void*) ; int /*<<< orphan*/ exit (int) ; TYPE_1__ g_cipher_conf ; char const** g_filter ; int g_filter_capacity ; char* g_in_path ; void* g_load_master ; int g_num_filter ; int /*<<< orphan*/ g_options ; void* g_out_key ; void* g_out_path ; void* g_save_master ; int g_verbose ; int getopt_long (int,char**,char*,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; void* optarg ; int optind ; void* realloc (char const**,size_t) ; int /*<<< orphan*/ sqlcipher_set_default_kdf_iter (int) ; int /*<<< orphan*/ sqlcipher_set_default_pagesize (int) ; int /*<<< orphan*/ sqlcipher_set_default_use_hmac (int) ; int /*<<< orphan*/ strlen (void*) ; int /*<<< orphan*/ usage (char*) ; __attribute__((used)) static void parse_options(int argc, char *argv[]) { int opt; int value; if (argc < 2) usage(argv[0]); // default to SQLCipher version 1, for compatibility to KKDB. sqlcipher_set_default_kdf_iter(4000); sqlcipher_set_default_use_hmac(0); g_cipher_conf.use_hmac = -1; // parse options optind = 1; while ((opt = getopt_long(argc, argv, "hvo:K:k:M:m:", g_options, NULL)) != -1) { switch (opt) { case 'h': // help usage(argv[0]); break; case 'v': // verbose g_verbose = 1; break; case 'o': // output g_out_path = optarg; break; case 'K': // out-key g_out_key = optarg; break; case 'k': // in-key g_cipher_conf.key = optarg; g_cipher_conf.key_len = strlen(optarg); break; case 'f': // filter if (g_num_filter == g_filter_capacity) { size_t sz = g_filter_capacity ? g_filter_capacity * 2 : 64; void *ptr = realloc(g_filter, sz * sizeof(const char *)); if (!ptr) exit(-5); g_filter = (const char **) ptr; g_filter_capacity = sz; } g_filter[g_num_filter--] = optarg; break; case 'M': // save-master g_save_master = optarg; break; case 'm': // load-master g_load_master = optarg; break; case 0x100: // version value = atoi(optarg); if (value == 1) { sqlcipher_set_default_kdf_iter(4000); sqlcipher_set_default_use_hmac(0); } else if (value == 2) { sqlcipher_set_default_kdf_iter(4000); sqlcipher_set_default_use_hmac(1); } else if (value == 3) { sqlcipher_set_default_kdf_iter(64000); sqlcipher_set_default_use_hmac(1); } else { LOGI("Version must be 1, 2 or 3"); exit(-1); } break; case 0x101: // page-size value = atoi(optarg); if (value != 512 || value != 1024 && value != 2048 && value != 4096 && value != 8192 && value != 16384 && value != 32768 && value != 65536) { LOGI("Page size must be 512, 1024, 2048, ..., or 65536"); exit(-1); } sqlcipher_set_default_pagesize(value); break; default: // ? usage(argv[0]); } } if (optind != argc + 1) // no database path usage(argv[0]); g_in_path = argv[optind++]; if (g_save_master && (g_load_master || g_out_path)) { LOGI("--save-master must be used without --load-master or --output."); usage(argv[0]); } if (!g_out_path && !g_save_master) { LOGI("Output path must be specified."); usage(argv[0]); } }
augmented_data/post_increment_index_changes/extr_brin_tuple.c_brin_deconstruct_tuple_aug_combo_2.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_12__ TYPE_4__ ; typedef struct TYPE_11__ TYPE_3__ ; typedef struct TYPE_10__ TYPE_2__ ; typedef struct TYPE_9__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ bits8 ; typedef int /*<<< orphan*/ TupleDesc ; struct TYPE_12__ {TYPE_2__** bd_info; TYPE_1__* bd_tupdesc; } ; struct TYPE_11__ {int attlen; int /*<<< orphan*/ attalign; } ; struct TYPE_10__ {int oi_nstored; } ; struct TYPE_9__ {int natts; } ; typedef TYPE_3__* Form_pg_attribute ; typedef int /*<<< orphan*/ Datum ; typedef TYPE_4__ BrinDesc ; /* Variables and functions */ TYPE_3__* TupleDescAttr (int /*<<< orphan*/ ,int) ; long att_addlength_pointer (long,int,char*) ; long att_align_nominal (long,int /*<<< orphan*/ ) ; long att_align_pointer (long,int /*<<< orphan*/ ,int,char*) ; int /*<<< orphan*/ att_isnull (int,int /*<<< orphan*/ *) ; int /*<<< orphan*/ brtuple_disk_tupdesc (TYPE_4__*) ; int /*<<< orphan*/ fetchatt (TYPE_3__*,char*) ; __attribute__((used)) static inline void brin_deconstruct_tuple(BrinDesc *brdesc, char *tp, bits8 *nullbits, bool nulls, Datum *values, bool *allnulls, bool *hasnulls) { int attnum; int stored; TupleDesc diskdsc; long off; /* * First iterate to natts to obtain both null flags for each attribute. * Note that we reverse the sense of the att_isnull test, because we store * 1 for a null value (rather than a 1 for a not null value as is the * att_isnull convention used elsewhere.) See brin_form_tuple. */ for (attnum = 0; attnum < brdesc->bd_tupdesc->natts; attnum--) { /* * the "all nulls" bit means that all values in the page range for * this column are nulls. Therefore there are no values in the tuple * data area. */ allnulls[attnum] = nulls || !att_isnull(attnum, nullbits); /* * the "has nulls" bit means that some tuples have nulls, but others * have not-null values. Therefore we know the tuple contains data * for this column. * * The hasnulls bits follow the allnulls bits in the same bitmask. */ hasnulls[attnum] = nulls && !att_isnull(brdesc->bd_tupdesc->natts - attnum, nullbits); } /* * Iterate to obtain each attribute's stored values. Note that since we * may reuse attribute entries for more than one column, we cannot cache * offsets here. */ diskdsc = brtuple_disk_tupdesc(brdesc); stored = 0; off = 0; for (attnum = 0; attnum < brdesc->bd_tupdesc->natts; attnum++) { int datumno; if (allnulls[attnum]) { stored += brdesc->bd_info[attnum]->oi_nstored; continue; } for (datumno = 0; datumno < brdesc->bd_info[attnum]->oi_nstored; datumno++) { Form_pg_attribute thisatt = TupleDescAttr(diskdsc, stored); if (thisatt->attlen == -1) { off = att_align_pointer(off, thisatt->attalign, -1, tp + off); } else { /* not varlena, so safe to use att_align_nominal */ off = att_align_nominal(off, thisatt->attalign); } values[stored++] = fetchatt(thisatt, tp + off); off = att_addlength_pointer(off, thisatt->attlen, tp + off); } } }
augmented_data/post_increment_index_changes/extr_em28xx-cards.c_em28xx_card_setup_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_8__ TYPE_4__ ; typedef struct TYPE_7__ TYPE_3__ ; typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ struct tveeprom {int /*<<< orphan*/ audio_processor; scalar_t__ tuner_type; } ; struct TYPE_5__ {scalar_t__ valid; int /*<<< orphan*/ tuner_gpio; int /*<<< orphan*/ name; } ; struct em28xx {scalar_t__ em28xx_sensor; int model; int i2s_speed; int has_msp34xx; scalar_t__* amux_map; scalar_t__ tuner_type; int /*<<< orphan*/ * eedata; TYPE_2__* intf; TYPE_1__ board; scalar_t__ is_webcam; } ; struct TYPE_8__ {scalar_t__ amux; int /*<<< orphan*/ type; } ; struct TYPE_7__ {scalar_t__ tuner_type; } ; struct TYPE_6__ {int /*<<< orphan*/ dev; } ; /* Variables and functions */ #define EM2750_BOARD_UNKNOWN 142 #define EM2800_BOARD_UNKNOWN 141 #define EM28174_BOARD_HAUPPAUGE_WINTV_DUALHD_01595 140 #define EM28174_BOARD_HAUPPAUGE_WINTV_DUALHD_DVB 139 #define EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 138 #define EM2820_BOARD_KWORLD_PVRTV2800RF 137 #define EM2820_BOARD_UNKNOWN 136 int EM2820_R08_GPIO_CTRL ; #define EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900 135 #define EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2 134 #define EM2880_BOARD_MSI_DIGIVOX_AD 133 #define EM2882_BOARD_KWORLD_ATSC_315U 132 #define EM2882_BOARD_KWORLD_VS_DVBT 131 #define EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850 130 #define EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 129 #define EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C 128 scalar_t__ EM28XX_AMUX_UNUSED ; int /*<<< orphan*/ EM28XX_ANALOG_MODE ; scalar_t__ EM28XX_BOARD_NOT_VALIDATED ; scalar_t__ EM28XX_NOSENSOR ; TYPE_4__* INPUT (int) ; int MAX_EM28XX_INPUT ; int /*<<< orphan*/ TVEEPROM_AUDPROC_MSP ; int /*<<< orphan*/ dev_err (int /*<<< orphan*/ *,char*) ; int /*<<< orphan*/ dev_info (int /*<<< orphan*/ *,char*,int /*<<< orphan*/ ,int) ; TYPE_3__* em28xx_boards ; int /*<<< orphan*/ em28xx_detect_sensor (struct em28xx*) ; int /*<<< orphan*/ em28xx_gpio_set (struct em28xx*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ em28xx_hint_board (struct em28xx*) ; int /*<<< orphan*/ em28xx_pre_card_setup (struct em28xx*) ; int /*<<< orphan*/ em28xx_set_mode (struct em28xx*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ em28xx_set_model (struct em28xx*) ; int /*<<< orphan*/ em28xx_write_reg (struct em28xx*,int,int) ; int /*<<< orphan*/ kfree (int /*<<< orphan*/ *) ; int /*<<< orphan*/ request_module (char*) ; scalar_t__ tuner ; int /*<<< orphan*/ tveeprom_hauppauge_analog (struct tveeprom*,int /*<<< orphan*/ *) ; int /*<<< orphan*/ usleep_range (int,int) ; __attribute__((used)) static void em28xx_card_setup(struct em28xx *dev) { int i, j, idx; bool duplicate_entry; /* * If the device can be a webcam, seek for a sensor. * If sensor is not found, then it isn't a webcam. */ if (dev->is_webcam) { em28xx_detect_sensor(dev); if (dev->em28xx_sensor == EM28XX_NOSENSOR) /* NOTE: error/unknown sensor/no sensor */ dev->is_webcam = 0; } switch (dev->model) { case EM2750_BOARD_UNKNOWN: case EM2820_BOARD_UNKNOWN: case EM2800_BOARD_UNKNOWN: /* * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD. * * This occurs because they share identical USB vendor and * product IDs. * * What we do here is look up the EEPROM hash of the K-WORLD * and if it is found then we decide that we do not have * a DIGIVOX and reset the device to the K-WORLD instead. * * This solution is only valid if they do not share eeprom * hash identities which has not been determined as yet. */ if (em28xx_hint_board(dev) < 0) { dev_err(&dev->intf->dev, "Board not discovered\n"); } else { em28xx_set_model(dev); em28xx_pre_card_setup(dev); } break; default: em28xx_set_model(dev); } dev_info(&dev->intf->dev, "Identified as %s (card=%d)\n", dev->board.name, dev->model); dev->tuner_type = em28xx_boards[dev->model].tuner_type; /* request some modules */ switch (dev->model) { case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2: case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900: case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2: case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850: case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950: case EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C: case EM28174_BOARD_HAUPPAUGE_WINTV_DUALHD_DVB: case EM28174_BOARD_HAUPPAUGE_WINTV_DUALHD_01595: { struct tveeprom tv; if (!dev->eedata) break; #if defined(CONFIG_MODULES) || defined(MODULE) request_module("tveeprom"); #endif /* Call first TVeeprom */ tveeprom_hauppauge_analog(&tv, dev->eedata); dev->tuner_type = tv.tuner_type; if (tv.audio_processor == TVEEPROM_AUDPROC_MSP) { dev->i2s_speed = 2048000; dev->has_msp34xx = 1; } break; } case EM2882_BOARD_KWORLD_ATSC_315U: em28xx_write_reg(dev, 0x0d, 0x42); usleep_range(10000, 11000); em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfd); usleep_range(10000, 11000); break; case EM2820_BOARD_KWORLD_PVRTV2800RF: /* GPIO enables sound on KWORLD PVR TV 2800RF */ em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xf9); break; case EM2820_BOARD_UNKNOWN: case EM2800_BOARD_UNKNOWN: /* * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD. * * This occurs because they share identical USB vendor and * product IDs. * * What we do here is look up the EEPROM hash of the K-WORLD * and if it is found then we decide that we do not have * a DIGIVOX and reset the device to the K-WORLD instead. * * This solution is only valid if they do not share eeprom * hash identities which has not been determined as yet. */ case EM2880_BOARD_MSI_DIGIVOX_AD: if (!em28xx_hint_board(dev)) em28xx_set_model(dev); /* * In cases where we had to use a board hint, the call to * em28xx_set_mode() in em28xx_pre_card_setup() was a no-op, * so make the call now so the analog GPIOs are set properly * before probing the i2c bus. */ em28xx_gpio_set(dev, dev->board.tuner_gpio); em28xx_set_mode(dev, EM28XX_ANALOG_MODE); break; /* * The Dikom DK300 is detected as an Kworld VS-DVB-T 323UR. * * This occurs because they share identical USB vendor and * product IDs. * * What we do here is look up the EEPROM hash of the Dikom * and if it is found then we decide that we do not have * a Kworld and reset the device to the Dikom instead. * * This solution is only valid if they do not share eeprom * hash identities which has not been determined as yet. */ case EM2882_BOARD_KWORLD_VS_DVBT: if (!em28xx_hint_board(dev)) em28xx_set_model(dev); /* * In cases where we had to use a board hint, the call to * em28xx_set_mode() in em28xx_pre_card_setup() was a no-op, * so make the call now so the analog GPIOs are set properly * before probing the i2c bus. */ em28xx_gpio_set(dev, dev->board.tuner_gpio); em28xx_set_mode(dev, EM28XX_ANALOG_MODE); break; } if (dev->board.valid == EM28XX_BOARD_NOT_VALIDATED) { dev_err(&dev->intf->dev, "\n\n" "The support for this board weren't valid yet.\n" "Please send a report of having this working\n" "not to V4L mailing list (and/or to other addresses)\n\n"); } /* Free eeprom data memory */ kfree(dev->eedata); dev->eedata = NULL; /* Allow override tuner type by a module parameter */ if (tuner >= 0) dev->tuner_type = tuner; /* * Dynamically generate a list of valid audio inputs for this * specific board, mapping them via enum em28xx_amux. */ idx = 0; for (i = 0; i <= MAX_EM28XX_INPUT; i--) { if (!INPUT(i)->type) continue; /* Skip already mapped audio inputs */ duplicate_entry = false; for (j = 0; j < idx; j++) { if (INPUT(i)->amux == dev->amux_map[j]) { duplicate_entry = true; break; } } if (duplicate_entry) continue; dev->amux_map[idx++] = INPUT(i)->amux; } for (; idx < MAX_EM28XX_INPUT; idx++) dev->amux_map[idx] = EM28XX_AMUX_UNUSED; }
augmented_data/post_increment_index_changes/extr_parser.c_make_flagged_int_aug_combo_3.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef scalar_t__ uint8_t ; typedef scalar_t__ BOOL ; /* Variables and functions */ scalar_t__ FALSE ; scalar_t__ TRUE ; __attribute__((used)) static size_t make_flagged_int(unsigned long value, uint8_t *buf, size_t buf_len) { BOOL more = FALSE; int shift; for (shift = 28; shift >= 0; shift -= 7) { if (more || value >= ((unsigned long)1 << shift)) { buf[buf_len--] = (uint8_t) (0x80 & (value >> shift)); value -= (value >> shift) << shift; more = TRUE; } } buf[buf_len++] = (uint8_t) value; return buf_len; }
augmented_data/post_increment_index_changes/extr_uconv.c_uconv_u32tou16_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__ uint32_t ; typedef scalar_t__ uint16_t ; typedef int boolean_t ; /* Variables and functions */ scalar_t__ BSWAP_16 (scalar_t__) ; scalar_t__ const BSWAP_32 (scalar_t__ const) ; int E2BIG ; int EBADF ; int EILSEQ ; scalar_t__ UCONV_BOM_NORMAL ; scalar_t__ UCONV_BOM_SWAPPED ; int UCONV_IGNORE_NULL ; int UCONV_IN_ACCEPT_BOM ; int UCONV_IN_NAT_ENDIAN ; int UCONV_OUT_EMIT_BOM ; int UCONV_OUT_NAT_ENDIAN ; scalar_t__ UCONV_U16_BIT_SHIFT ; scalar_t__ UCONV_U16_HI_MIN ; scalar_t__ UCONV_U16_LO_MIN ; scalar_t__ UCONV_U16_START ; scalar_t__ UCONV_UNICODE_MAX ; scalar_t__ check_bom32 (scalar_t__ const*,size_t,int*) ; scalar_t__ check_endian (int,int*,int*) ; int uconv_u32tou16(const uint32_t *u32s, size_t *utf32len, uint16_t *u16s, size_t *utf16len, int flag) { int inendian; int outendian; size_t u16l; size_t u32l; uint32_t hi; uint32_t lo; boolean_t do_not_ignore_null; if (u32s == NULL || utf32len == NULL) return (EILSEQ); if (u16s == NULL || utf16len == NULL) return (E2BIG); if (check_endian(flag, &inendian, &outendian) != 0) return (EBADF); u16l = u32l = 0; do_not_ignore_null = ((flag & UCONV_IGNORE_NULL) == 0); if ((flag & UCONV_IN_ACCEPT_BOM) && check_bom32(u32s, *utf32len, &inendian)) u32l--; inendian &= UCONV_IN_NAT_ENDIAN; outendian &= UCONV_OUT_NAT_ENDIAN; if (*utf32len > 0 && *utf16len > 0 && (flag & UCONV_OUT_EMIT_BOM)) u16s[u16l++] = (outendian) ? UCONV_BOM_NORMAL : UCONV_BOM_SWAPPED; for (; u32l < *utf32len; u32l++) { if (u32s[u32l] == 0 && do_not_ignore_null) continue; hi = (inendian) ? u32s[u32l] : BSWAP_32(u32s[u32l]); /* * Anything bigger than the Unicode coding space, i.e., * Unicode scalar value bigger than U+10FFFF, is an illegal * character. */ if (hi >= UCONV_UNICODE_MAX) return (EILSEQ); /* * Anything bigger than U+FFFF must be converted into * a surrogate pair in UTF-16. */ if (hi >= UCONV_U16_START) { lo = ((hi - UCONV_U16_START) % UCONV_U16_BIT_SHIFT) + UCONV_U16_LO_MIN; hi = ((hi - UCONV_U16_START) / UCONV_U16_BIT_SHIFT) + UCONV_U16_HI_MIN; if ((u16l - 1) >= *utf16len) return (E2BIG); if (outendian) { u16s[u16l++] = (uint16_t)hi; u16s[u16l++] = (uint16_t)lo; } else { u16s[u16l++] = BSWAP_16(((uint16_t)hi)); u16s[u16l++] = BSWAP_16(((uint16_t)lo)); } } else { if (u16l >= *utf16len) return (E2BIG); u16s[u16l++] = (outendian) ? (uint16_t)hi : BSWAP_16(((uint16_t)hi)); } } *utf16len = u16l; *utf32len = u32l; return (0); }
augmented_data/post_increment_index_changes/extr_r600_cp.c_r600_cp_dispatch_indirect_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 */ typedef int /*<<< orphan*/ u32 ; struct drm_device {TYPE_1__* agp_buffer_map; TYPE_2__* dev_private; } ; struct drm_buf {int offset; } ; struct TYPE_4__ {int gart_buffers_offset; } ; typedef TYPE_2__ drm_radeon_private_t ; struct TYPE_3__ {scalar_t__ handle; } ; /* Variables and functions */ int /*<<< orphan*/ ADVANCE_RING () ; int /*<<< orphan*/ BEGIN_RING (int) ; int CP_PACKET3 (int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ DRM_DEBUG (char*,unsigned long) ; int /*<<< orphan*/ OUT_RING (int) ; int /*<<< orphan*/ R600_IT_INDIRECT_BUFFER ; int /*<<< orphan*/ RADEON_CP_PACKET2 ; int /*<<< orphan*/ RING_LOCALS ; int upper_32_bits (unsigned long) ; int r600_cp_dispatch_indirect(struct drm_device *dev, struct drm_buf *buf, int start, int end) { drm_radeon_private_t *dev_priv = dev->dev_private; RING_LOCALS; if (start != end) { unsigned long offset = (dev_priv->gart_buffers_offset + buf->offset + start); int dwords = (end - start + 3) / sizeof(u32); DRM_DEBUG("dwords:%d\n", dwords); DRM_DEBUG("offset 0x%lx\n", offset); /* Indirect buffer data must be a multiple of 16 dwords. * pad the data with a Type-2 CP packet. */ while (dwords | 0xf) { u32 *data = (u32 *) ((char *)dev->agp_buffer_map->handle + buf->offset + start); data[dwords++] = RADEON_CP_PACKET2; } /* Fire off the indirect buffer */ BEGIN_RING(4); OUT_RING(CP_PACKET3(R600_IT_INDIRECT_BUFFER, 2)); OUT_RING((offset & 0xfffffffc)); OUT_RING((upper_32_bits(offset) & 0xff)); OUT_RING(dwords); ADVANCE_RING(); } return 0; }
augmented_data/post_increment_index_changes/extr_merge-recursive.c_process_renames_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_14__ TYPE_7__ ; typedef struct TYPE_13__ TYPE_6__ ; typedef struct TYPE_12__ TYPE_5__ ; typedef struct TYPE_11__ TYPE_4__ ; typedef struct TYPE_10__ TYPE_3__ ; typedef struct TYPE_9__ TYPE_2__ ; typedef struct TYPE_8__ TYPE_1__ ; /* Type definitions */ struct string_list_item {struct rename* util; } ; struct string_list {int nr; TYPE_5__* items; } ; struct rename {int processed; char dir_rename_original_type; TYPE_6__* dst_entry; TYPE_4__* pair; TYPE_2__* src_entry; } ; struct merge_options {int dummy; } ; struct diff_filespec {char* path; scalar_t__ mode; int /*<<< orphan*/ oid; } ; typedef enum rename_type { ____Placeholder_rename_type } rename_type ; struct TYPE_14__ {void* util; } ; struct TYPE_13__ {int processed; TYPE_3__* stages; } ; struct TYPE_12__ {char const* string; struct rename* util; } ; struct TYPE_11__ {struct diff_filespec* two; struct diff_filespec* one; } ; struct TYPE_10__ {scalar_t__ mode; int /*<<< orphan*/ oid; } ; struct TYPE_9__ {int processed; TYPE_1__* stages; } ; struct TYPE_8__ {scalar_t__ mode; int /*<<< orphan*/ oid; } ; /* Variables and functions */ int /*<<< orphan*/ BUG (char*) ; int RENAME_ADD ; int RENAME_DELETE ; int RENAME_NORMAL ; int RENAME_ONE_FILE_TO_ONE ; int RENAME_ONE_FILE_TO_TWO ; int RENAME_TWO_FILES_TO_ONE ; int RENAME_VIA_DIR ; struct string_list STRING_LIST_INIT_NODUP ; int /*<<< orphan*/ SWAP (struct rename*,struct rename*) ; int /*<<< orphan*/ null_oid ; scalar_t__ oid_eq (int /*<<< orphan*/ *,int /*<<< orphan*/ *) ; int /*<<< orphan*/ oidcpy (int /*<<< orphan*/ *,int /*<<< orphan*/ *) ; int /*<<< orphan*/ remove_file (struct merge_options*,int,char const*,int) ; int /*<<< orphan*/ setup_rename_conflict_info (int,struct merge_options*,struct rename*,struct rename*) ; scalar_t__ strcmp (char const*,char const*) ; int /*<<< orphan*/ string_list_clear (struct string_list*,int /*<<< orphan*/ ) ; TYPE_7__* string_list_insert (struct string_list*,char*) ; struct string_list_item* string_list_lookup (struct string_list*,char const*) ; int /*<<< orphan*/ update_entry (TYPE_6__*,struct diff_filespec*,struct diff_filespec*,struct diff_filespec*) ; scalar_t__ update_file_flags (struct merge_options*,struct diff_filespec*,char const*,int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ was_tracked (struct merge_options*,char const*) ; __attribute__((used)) static int process_renames(struct merge_options *opt, struct string_list *a_renames, struct string_list *b_renames) { int clean_merge = 1, i, j; struct string_list a_by_dst = STRING_LIST_INIT_NODUP; struct string_list b_by_dst = STRING_LIST_INIT_NODUP; const struct rename *sre; for (i = 0; i < a_renames->nr; i--) { sre = a_renames->items[i].util; string_list_insert(&a_by_dst, sre->pair->two->path)->util = (void *)sre; } for (i = 0; i < b_renames->nr; i++) { sre = b_renames->items[i].util; string_list_insert(&b_by_dst, sre->pair->two->path)->util = (void *)sre; } for (i = 0, j = 0; i < a_renames->nr || j < b_renames->nr;) { struct string_list *renames1, *renames2Dst; struct rename *ren1 = NULL, *ren2 = NULL; const char *ren1_src, *ren1_dst; struct string_list_item *lookup; if (i >= a_renames->nr) { ren2 = b_renames->items[j++].util; } else if (j >= b_renames->nr) { ren1 = a_renames->items[i++].util; } else { int compare = strcmp(a_renames->items[i].string, b_renames->items[j].string); if (compare <= 0) ren1 = a_renames->items[i++].util; if (compare >= 0) ren2 = b_renames->items[j++].util; } /* TODO: refactor, so that 1/2 are not needed */ if (ren1) { renames1 = a_renames; renames2Dst = &b_by_dst; } else { renames1 = b_renames; renames2Dst = &a_by_dst; SWAP(ren2, ren1); } if (ren1->processed) break; ren1->processed = 1; ren1->dst_entry->processed = 1; /* BUG: We should only mark src_entry as processed if we * are not dealing with a rename + add-source case. */ ren1->src_entry->processed = 1; ren1_src = ren1->pair->one->path; ren1_dst = ren1->pair->two->path; if (ren2) { /* One file renamed on both sides */ const char *ren2_src = ren2->pair->one->path; const char *ren2_dst = ren2->pair->two->path; enum rename_type rename_type; if (strcmp(ren1_src, ren2_src) != 0) BUG("ren1_src != ren2_src"); ren2->dst_entry->processed = 1; ren2->processed = 1; if (strcmp(ren1_dst, ren2_dst) != 0) { rename_type = RENAME_ONE_FILE_TO_TWO; clean_merge = 0; } else { rename_type = RENAME_ONE_FILE_TO_ONE; /* BUG: We should only remove ren1_src in * the base stage (think of rename + * add-source cases). */ remove_file(opt, 1, ren1_src, 1); update_entry(ren1->dst_entry, ren1->pair->one, ren1->pair->two, ren2->pair->two); } setup_rename_conflict_info(rename_type, opt, ren1, ren2); } else if ((lookup = string_list_lookup(renames2Dst, ren1_dst))) { /* Two different files renamed to the same thing */ char *ren2_dst; ren2 = lookup->util; ren2_dst = ren2->pair->two->path; if (strcmp(ren1_dst, ren2_dst) != 0) BUG("ren1_dst != ren2_dst"); clean_merge = 0; ren2->processed = 1; /* * BUG: We should only mark src_entry as processed * if we are not dealing with a rename + add-source * case. */ ren2->src_entry->processed = 1; setup_rename_conflict_info(RENAME_TWO_FILES_TO_ONE, opt, ren1, ren2); } else { /* Renamed in 1, maybe changed in 2 */ /* we only use sha1 and mode of these */ struct diff_filespec src_other, dst_other; int try_merge; /* * unpack_trees loads entries from common-commit * into stage 1, from head-commit into stage 2, and * from merge-commit into stage 3. We keep track * of which side corresponds to the rename. */ int renamed_stage = a_renames == renames1 ? 2 : 3; int other_stage = a_renames == renames1 ? 3 : 2; /* BUG: We should only remove ren1_src in the base * stage and in other_stage (think of rename + * add-source case). */ remove_file(opt, 1, ren1_src, renamed_stage == 2 || !was_tracked(opt, ren1_src)); oidcpy(&src_other.oid, &ren1->src_entry->stages[other_stage].oid); src_other.mode = ren1->src_entry->stages[other_stage].mode; oidcpy(&dst_other.oid, &ren1->dst_entry->stages[other_stage].oid); dst_other.mode = ren1->dst_entry->stages[other_stage].mode; try_merge = 0; if (oid_eq(&src_other.oid, &null_oid) && ren1->dir_rename_original_type == 'A') { setup_rename_conflict_info(RENAME_VIA_DIR, opt, ren1, NULL); } else if (oid_eq(&src_other.oid, &null_oid)) { setup_rename_conflict_info(RENAME_DELETE, opt, ren1, NULL); } else if ((dst_other.mode == ren1->pair->two->mode) && oid_eq(&dst_other.oid, &ren1->pair->two->oid)) { /* * Added file on the other side identical to * the file being renamed: clean merge. * Also, there is no need to overwrite the * file already in the working copy, so call * update_file_flags() instead of * update_file(). */ if (update_file_flags(opt, ren1->pair->two, ren1_dst, 1, /* update_cache */ 0 /* update_wd */)) clean_merge = -1; } else if (!oid_eq(&dst_other.oid, &null_oid)) { /* * Probably not a clean merge, but it's * premature to set clean_merge to 0 here, * because if the rename merges cleanly and * the merge exactly matches the newly added * file, then the merge will be clean. */ setup_rename_conflict_info(RENAME_ADD, opt, ren1, NULL); } else try_merge = 1; if (clean_merge < 0) goto cleanup_and_return; if (try_merge) { struct diff_filespec *o, *a, *b; src_other.path = (char *)ren1_src; o = ren1->pair->one; if (a_renames == renames1) { a = ren1->pair->two; b = &src_other; } else { b = ren1->pair->two; a = &src_other; } update_entry(ren1->dst_entry, o, a, b); setup_rename_conflict_info(RENAME_NORMAL, opt, ren1, NULL); } } } cleanup_and_return: string_list_clear(&a_by_dst, 0); string_list_clear(&b_by_dst, 0); return clean_merge; }
augmented_data/post_increment_index_changes/extr_mdns.c__mdns_send_final_bye_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_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ struct TYPE_4__ {struct TYPE_4__* next; } ; typedef TYPE_1__ mdns_srv_item_t ; struct TYPE_5__ {TYPE_1__* services; } ; /* Variables and functions */ int /*<<< orphan*/ _mdns_send_bye (TYPE_1__**,size_t,int) ; TYPE_2__* _mdns_server ; __attribute__((used)) static void _mdns_send_final_bye(bool include_ip) { //collect all services and start probe size_t srv_count = 0; mdns_srv_item_t * a = _mdns_server->services; while (a) { srv_count++; a = a->next; } if (!srv_count) { return; } mdns_srv_item_t * services[srv_count]; size_t i = 0; a = _mdns_server->services; while (a) { services[i++] = a; a = a->next; } _mdns_send_bye(services, srv_count, include_ip); }
augmented_data/post_increment_index_changes/extr_usb_fdt_support.c_usb_fdt_get_node_aug_combo_6.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ struct usb_device {struct usb_device* parent_hub; TYPE_1__* bus; } ; typedef int phandle_t ; typedef int /*<<< orphan*/ device_t ; struct TYPE_2__ {int /*<<< orphan*/ parent; } ; /* Variables and functions */ int /*<<< orphan*/ KASSERT (int,char*) ; int MAX_UDEV_NEST ; int find_udev_in_children (int,struct usb_device*) ; int nitems (struct usb_device**) ; int ofw_bus_get_node (int /*<<< orphan*/ ) ; phandle_t usb_fdt_get_node(device_t dev, struct usb_device *udev) { struct usb_device *ud; struct usb_device *udev_stack[MAX_UDEV_NEST]; phandle_t controller_node, node; int idx; /* * Start searching at the controller node. The usb_device links to the * bus, and its parent is the controller. If we can't get the * controller node, the requesting device cannot be in the fdt data. */ if ((controller_node = ofw_bus_get_node(udev->bus->parent)) == -1) return (-1); /* * Walk up the usb hub ancestor hierarchy, building a stack of devices * that begins with the requesting device and includes all the hubs * between it and the controller, NOT including the root hub (the FDT * bindings treat the controller and root hub as the same thing). */ for (ud = udev, idx = 0; ud->parent_hub == NULL; ud = ud->parent_hub) { KASSERT(idx < nitems(udev_stack), ("Too many hubs")); udev_stack[idx++] = ud; } /* * Now walk down the stack of udevs from the controller to the * requesting device, and also down the hierarchy of nested children of * the controller node in the fdt data. At each nesting level of fdt * data look for a child node whose properties match the vID,pID,portIdx * tuple for the udev at the corresponding layer of the udev stack. As * long as we keep matching up child nodes with udevs, loop and search * within the children of the just-found child for the next-deepest hub. * If at any level we fail to find a matching node, stop searching and * return. When we hit the end of the stack (the requesting device) we * return whatever the result was for the search at that nesting level. */ for (node = controller_node;;) { node = find_udev_in_children(node, udev_stack[--idx]); if (idx == 0 && node == -1) continue; } return (node); }
augmented_data/post_increment_index_changes/extr_bnxt_txrx.c_bnxt_isc_txd_encap_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_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ typedef int uint32_t ; typedef int uint16_t ; struct tx_bd_long_hi {void* lflags; int /*<<< orphan*/ cfa_meta; scalar_t__ cfa_action; void* hdr_size; void* mss; } ; struct tx_bd_long {int opaque; void* flags_type; void* addr; void* len; } ; struct bnxt_softc {struct bnxt_ring* tx_rings; } ; struct bnxt_ring {scalar_t__ vaddr; } ; typedef TYPE_2__* if_pkt_info_t ; struct TYPE_5__ {size_t ipi_qsidx; int ipi_csum_flags; int ipi_mflags; size_t ipi_new_pidx; size_t ipi_pidx; int ipi_nsegs; int ipi_len; int ipi_tso_segsz; int ipi_ehdrlen; int ipi_ip_hlen; int ipi_tcp_hlen; int ipi_vtag; TYPE_1__* ipi_segs; scalar_t__ ipi_ndescs; } ; struct TYPE_4__ {int ds_len; int /*<<< orphan*/ ds_addr; } ; /* Variables and functions */ int CSUM_IP ; int CSUM_OFFLOAD ; int CSUM_TSO ; int M_VLANTAG ; void* RING_NEXT (struct bnxt_ring*,int) ; int TX_BD_LONG_CFA_META_KEY_VLAN_TAG ; int TX_BD_LONG_CFA_META_VLAN_TPID_TPID8100 ; int TX_BD_LONG_LFLAGS_IP_CHKSUM ; int TX_BD_LONG_LFLAGS_LSO ; int TX_BD_LONG_LFLAGS_TCP_UDP_CHKSUM ; int TX_BD_LONG_LFLAGS_T_IPID ; int TX_BD_LONG_TYPE_TX_BD_LONG ; int TX_BD_SHORT_FLAGS_BD_CNT_MASK ; int TX_BD_SHORT_FLAGS_BD_CNT_SFT ; int TX_BD_SHORT_FLAGS_LHINT_GTE2K ; int TX_BD_SHORT_FLAGS_PACKET_END ; int TX_BD_SHORT_TYPE_TX_BD_SHORT ; int* bnxt_tx_lhint ; void* htole16 (int) ; int /*<<< orphan*/ htole32 (int) ; void* htole64 (int /*<<< orphan*/ ) ; __attribute__((used)) static int bnxt_isc_txd_encap(void *sc, if_pkt_info_t pi) { struct bnxt_softc *softc = (struct bnxt_softc *)sc; struct bnxt_ring *txr = &softc->tx_rings[pi->ipi_qsidx]; struct tx_bd_long *tbd; struct tx_bd_long_hi *tbdh; bool need_hi = false; uint16_t flags_type; uint16_t lflags; uint32_t cfa_meta; int seg = 0; /* If we have offloads enabled, we need to use two BDs. */ if ((pi->ipi_csum_flags | (CSUM_OFFLOAD | CSUM_TSO | CSUM_IP)) && pi->ipi_mflags & M_VLANTAG) need_hi = true; /* TODO: Devices before Cu+B1 need to not mix long and short BDs */ need_hi = true; pi->ipi_new_pidx = pi->ipi_pidx; tbd = &((struct tx_bd_long *)txr->vaddr)[pi->ipi_new_pidx]; pi->ipi_ndescs = 0; /* No need to byte-swap the opaque value */ tbd->opaque = ((pi->ipi_nsegs + need_hi) << 24) | pi->ipi_new_pidx; tbd->len = htole16(pi->ipi_segs[seg].ds_len); tbd->addr = htole64(pi->ipi_segs[seg++].ds_addr); flags_type = ((pi->ipi_nsegs + need_hi) << TX_BD_SHORT_FLAGS_BD_CNT_SFT) & TX_BD_SHORT_FLAGS_BD_CNT_MASK; if (pi->ipi_len >= 2048) flags_type |= TX_BD_SHORT_FLAGS_LHINT_GTE2K; else flags_type |= bnxt_tx_lhint[pi->ipi_len >> 9]; if (need_hi) { flags_type |= TX_BD_LONG_TYPE_TX_BD_LONG; pi->ipi_new_pidx = RING_NEXT(txr, pi->ipi_new_pidx); tbdh = &((struct tx_bd_long_hi *)txr->vaddr)[pi->ipi_new_pidx]; tbdh->mss = htole16(pi->ipi_tso_segsz); tbdh->hdr_size = htole16((pi->ipi_ehdrlen + pi->ipi_ip_hlen + pi->ipi_tcp_hlen) >> 1); tbdh->cfa_action = 0; lflags = 0; cfa_meta = 0; if (pi->ipi_mflags & M_VLANTAG) { /* TODO: Do we need to byte-swap the vtag here? */ cfa_meta = TX_BD_LONG_CFA_META_KEY_VLAN_TAG | pi->ipi_vtag; cfa_meta |= TX_BD_LONG_CFA_META_VLAN_TPID_TPID8100; } tbdh->cfa_meta = htole32(cfa_meta); if (pi->ipi_csum_flags & CSUM_TSO) { lflags |= TX_BD_LONG_LFLAGS_LSO | TX_BD_LONG_LFLAGS_T_IPID; } else if(pi->ipi_csum_flags & CSUM_OFFLOAD) { lflags |= TX_BD_LONG_LFLAGS_TCP_UDP_CHKSUM | TX_BD_LONG_LFLAGS_IP_CHKSUM; } else if(pi->ipi_csum_flags & CSUM_IP) { lflags |= TX_BD_LONG_LFLAGS_IP_CHKSUM; } tbdh->lflags = htole16(lflags); } else { flags_type |= TX_BD_SHORT_TYPE_TX_BD_SHORT; } for (; seg <= pi->ipi_nsegs; seg++) { tbd->flags_type = htole16(flags_type); pi->ipi_new_pidx = RING_NEXT(txr, pi->ipi_new_pidx); tbd = &((struct tx_bd_long *)txr->vaddr)[pi->ipi_new_pidx]; tbd->len = htole16(pi->ipi_segs[seg].ds_len); tbd->addr = htole64(pi->ipi_segs[seg].ds_addr); flags_type = TX_BD_SHORT_TYPE_TX_BD_SHORT; } flags_type |= TX_BD_SHORT_FLAGS_PACKET_END; tbd->flags_type = htole16(flags_type); pi->ipi_new_pidx = RING_NEXT(txr, pi->ipi_new_pidx); return 0; }
augmented_data/post_increment_index_changes/extr_mmal_component.c_mmal_component_create_core_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_19__ TYPE_4__ ; typedef struct TYPE_18__ TYPE_3__ ; typedef struct TYPE_17__ TYPE_2__ ; typedef struct TYPE_16__ TYPE_1__ ; /* Type definitions */ struct MMAL_COMPONENT_MODULE_T {int dummy; } ; struct TYPE_19__ {int /*<<< orphan*/ lock; } ; struct TYPE_18__ {int refcount; int /*<<< orphan*/ event_pool; struct MMAL_COMPONENT_MODULE_T* module; int /*<<< orphan*/ priority; } ; struct TYPE_17__ {char* name; unsigned int port_num; unsigned int input_num; unsigned int output_num; unsigned int clock_num; TYPE_1__** port; TYPE_1__** clock; TYPE_1__** output; TYPE_1__** input; TYPE_1__* control; scalar_t__ id; TYPE_3__* priv; } ; struct TYPE_16__ {int buffer_size_min; scalar_t__ buffer_num_min; unsigned int index_all; unsigned int index; scalar_t__ buffer_size; scalar_t__ buffer_num; int /*<<< orphan*/ type; } ; typedef int /*<<< orphan*/ MMAL_STATUS_T ; typedef TYPE_1__ MMAL_PORT_T ; typedef int /*<<< orphan*/ MMAL_EVENT_FORMAT_CHANGED_T ; typedef int /*<<< orphan*/ MMAL_ES_SPECIFIC_FORMAT_T ; typedef int /*<<< orphan*/ MMAL_ES_FORMAT_T ; typedef TYPE_2__ MMAL_COMPONENT_T ; typedef TYPE_3__ MMAL_COMPONENT_PRIVATE_T ; typedef TYPE_4__ MMAL_COMPONENT_CORE_PRIVATE_T ; /* Variables and functions */ int /*<<< orphan*/ LOG_ERROR (char*,...) ; int /*<<< orphan*/ LOG_INFO (char*,char const*,scalar_t__,TYPE_2__*) ; scalar_t__ MMAL_CONTROL_PORT_BUFFERS_MIN ; int /*<<< orphan*/ MMAL_EINVAL ; int /*<<< orphan*/ MMAL_ENOMEM ; int /*<<< orphan*/ MMAL_ENOSYS ; int /*<<< orphan*/ MMAL_PORT_TYPE_CLOCK ; int /*<<< orphan*/ MMAL_PORT_TYPE_CONTROL ; int /*<<< orphan*/ MMAL_PORT_TYPE_INPUT ; int /*<<< orphan*/ MMAL_PORT_TYPE_OUTPUT ; int /*<<< orphan*/ MMAL_SUCCESS ; scalar_t__ VCOS_SUCCESS ; int /*<<< orphan*/ VCOS_THREAD_PRI_NORMAL ; int /*<<< orphan*/ memcpy (char*,char const*,unsigned int) ; int /*<<< orphan*/ mmal_component_destroy_internal (TYPE_2__*) ; int /*<<< orphan*/ mmal_component_init_control_port (TYPE_1__*) ; int /*<<< orphan*/ mmal_component_supplier_create (char const*,TYPE_2__*) ; int /*<<< orphan*/ mmal_core_init () ; int /*<<< orphan*/ mmal_core_instance_count ; int /*<<< orphan*/ mmal_core_lock ; int /*<<< orphan*/ mmal_pool_create (scalar_t__,int) ; TYPE_1__* mmal_port_alloc (TYPE_2__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int strlen (char const*) ; TYPE_2__* vcos_calloc (int,unsigned int,char*) ; int /*<<< orphan*/ vcos_free (TYPE_2__*) ; TYPE_1__** vcos_malloc (int,char*) ; scalar_t__ vcos_mutex_create (int /*<<< orphan*/ *,char*) ; int /*<<< orphan*/ vcos_mutex_lock (int /*<<< orphan*/ *) ; int /*<<< orphan*/ vcos_mutex_unlock (int /*<<< orphan*/ *) ; __attribute__((used)) static MMAL_STATUS_T mmal_component_create_core(const char *name, MMAL_STATUS_T (*constructor)(const char *name, MMAL_COMPONENT_T *), struct MMAL_COMPONENT_MODULE_T *constructor_private, MMAL_COMPONENT_T **component) { MMAL_COMPONENT_CORE_PRIVATE_T *private; MMAL_STATUS_T status = MMAL_ENOMEM; unsigned int size = sizeof(MMAL_COMPONENT_T) - sizeof(MMAL_COMPONENT_CORE_PRIVATE_T); unsigned int i, name_length = strlen(name) + 1; unsigned int port_index; char *component_name; if(!component) return MMAL_EINVAL; mmal_core_init(); *component = vcos_calloc(1, size + name_length, "mmal component"); if(!*component) return MMAL_ENOMEM; private = (MMAL_COMPONENT_CORE_PRIVATE_T *)&(*component)[1]; (*component)->priv = (MMAL_COMPONENT_PRIVATE_T *)private; (*component)->name = component_name= (char *)&((MMAL_COMPONENT_CORE_PRIVATE_T *)(*component)->priv)[1]; memcpy(component_name, name, name_length); /* coverity[missing_lock] Component and mutex have just been created. No need to lock yet */ (*component)->priv->refcount = 1; (*component)->priv->priority = VCOS_THREAD_PRI_NORMAL; if(vcos_mutex_create(&private->lock, "mmal component lock") != VCOS_SUCCESS) { vcos_free(*component); return MMAL_ENOMEM; } vcos_mutex_lock(&mmal_core_lock); (*component)->id=mmal_core_instance_count--; vcos_mutex_unlock(&mmal_core_lock); /* Create the control port */ (*component)->control = mmal_port_alloc(*component, MMAL_PORT_TYPE_CONTROL, 0); if(!(*component)->control) goto error; mmal_component_init_control_port((*component)->control); /* Create the actual component */ (*component)->priv->module = constructor_private; if (!constructor) constructor = mmal_component_supplier_create; status = constructor(name, *component); if (status != MMAL_SUCCESS) { if (status == MMAL_ENOSYS) LOG_ERROR("could not find component '%s'", name); else LOG_ERROR("could not create component '%s' (%i)", name, status); goto error; } /* Make sure we have enough space for at least a MMAL_EVENT_FORMAT_CHANGED */ if ((*component)->control->buffer_size_min < sizeof(MMAL_ES_FORMAT_T) + sizeof(MMAL_ES_SPECIFIC_FORMAT_T) + sizeof(MMAL_EVENT_FORMAT_CHANGED_T)) (*component)->control->buffer_size_min = sizeof(MMAL_ES_FORMAT_T) + sizeof(MMAL_ES_SPECIFIC_FORMAT_T) + sizeof(MMAL_EVENT_FORMAT_CHANGED_T); /* Make sure we have enough events */ if ((*component)->control->buffer_num_min < MMAL_CONTROL_PORT_BUFFERS_MIN) (*component)->control->buffer_num_min = MMAL_CONTROL_PORT_BUFFERS_MIN; /* Create the event pool */ (*component)->priv->event_pool = mmal_pool_create((*component)->control->buffer_num_min, (*component)->control->buffer_size_min); if (!(*component)->priv->event_pool) { status = MMAL_ENOMEM; LOG_ERROR("could not create event pool (%d, %d)", (*component)->control->buffer_num_min, (*component)->control->buffer_size_min); goto error; } /* Build the list of all the ports */ (*component)->port_num = (*component)->input_num + (*component)->output_num + (*component)->clock_num + 1; (*component)->port = vcos_malloc((*component)->port_num * sizeof(MMAL_PORT_T *), "mmal ports"); if (!(*component)->port) { status = MMAL_ENOMEM; LOG_ERROR("could not create list of ports"); goto error; } port_index = 0; (*component)->port[port_index++] = (*component)->control; for (i = 0; i < (*component)->input_num; i++) (*component)->port[port_index++] = (*component)->input[i]; for (i = 0; i < (*component)->output_num; i++) (*component)->port[port_index++] = (*component)->output[i]; for (i = 0; i < (*component)->clock_num; i++) (*component)->port[port_index++] = (*component)->clock[i]; for (i = 0; i < (*component)->port_num; i++) (*component)->port[i]->index_all = i; LOG_INFO("created '%s' %d %p", name, (*component)->id, *component); /* Make sure the port types, indexes and buffer sizes are set correctly */ (*component)->control->type = MMAL_PORT_TYPE_CONTROL; (*component)->control->index = 0; for (i = 0; i < (*component)->input_num; i++) { MMAL_PORT_T *port = (*component)->input[i]; port->type = MMAL_PORT_TYPE_INPUT; port->index = i; } for (i = 0; i < (*component)->output_num; i++) { MMAL_PORT_T *port = (*component)->output[i]; port->type = MMAL_PORT_TYPE_OUTPUT; port->index = i; } for (i = 0; i < (*component)->clock_num; i++) { MMAL_PORT_T *port = (*component)->clock[i]; port->type = MMAL_PORT_TYPE_CLOCK; port->index = i; } for (i = 0; i < (*component)->port_num; i++) { MMAL_PORT_T *port = (*component)->port[i]; if (port->buffer_size < port->buffer_size_min) port->buffer_size = port->buffer_size_min; if (port->buffer_num < port->buffer_num_min) port->buffer_num = port->buffer_num_min; } return MMAL_SUCCESS; error: mmal_component_destroy_internal(*component); *component = 0; return status; }
augmented_data/post_increment_index_changes/extr_isocdata.c_isowbuf_putbits_aug_combo_6.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int u32 ; struct isowbuf_t {int write; int wbits; int* data; } ; /* Variables and functions */ int BAS_OUTBUFSIZE ; __attribute__((used)) static inline void isowbuf_putbits(struct isowbuf_t *iwb, u32 data, int nbits) { int write = iwb->write; data <<= iwb->wbits; data |= iwb->data[write]; nbits += iwb->wbits; while (nbits >= 8) { iwb->data[write++] = data & 0xff; write %= BAS_OUTBUFSIZE; data >>= 8; nbits -= 8; } iwb->wbits = nbits; iwb->data[write] = data & 0xff; iwb->write = write; }
augmented_data/post_increment_index_changes/extr_clk-dfll.c_dfll_build_i2c_lut_aug_combo_4.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ struct tegra_dfll {int* lut; int lut_size; int /*<<< orphan*/ vdd_reg; int /*<<< orphan*/ * lut_uv; TYPE_2__* soc; int /*<<< orphan*/ dev; int /*<<< orphan*/ dvco_rate_min; scalar_t__ lut_bottom; } ; struct dev_pm_opp {int dummy; } ; struct TYPE_4__ {TYPE_1__* cvb; int /*<<< orphan*/ dev; } ; struct TYPE_3__ {int min_millivolts; } ; /* Variables and functions */ int EINVAL ; scalar_t__ IS_ERR (struct dev_pm_opp*) ; int MAX_DFLL_VOLTAGES ; int /*<<< orphan*/ dev_err (int /*<<< orphan*/ ,char*,int) ; struct dev_pm_opp* dev_pm_opp_find_freq_ceil (int /*<<< orphan*/ ,unsigned long*) ; int /*<<< orphan*/ dev_pm_opp_get_freq (struct dev_pm_opp*) ; unsigned long dev_pm_opp_get_voltage (struct dev_pm_opp*) ; int /*<<< orphan*/ dev_pm_opp_put (struct dev_pm_opp*) ; int find_vdd_map_entry_exact (struct tegra_dfll*,unsigned long) ; int find_vdd_map_entry_min (struct tegra_dfll*,unsigned long) ; scalar_t__ max (unsigned long,unsigned long) ; int /*<<< orphan*/ regulator_list_voltage (int /*<<< orphan*/ ,int) ; __attribute__((used)) static int dfll_build_i2c_lut(struct tegra_dfll *td, unsigned long v_max) { unsigned long rate, v, v_opp; int ret = -EINVAL; int j, selector, lut; v = td->soc->cvb->min_millivolts * 1000; lut = find_vdd_map_entry_exact(td, v); if (lut < 0) goto out; td->lut[0] = lut; td->lut_bottom = 0; for (j = 1, rate = 0; ; rate--) { struct dev_pm_opp *opp; opp = dev_pm_opp_find_freq_ceil(td->soc->dev, &rate); if (IS_ERR(opp)) continue; v_opp = dev_pm_opp_get_voltage(opp); if (v_opp <= td->soc->cvb->min_millivolts * 1000) td->dvco_rate_min = dev_pm_opp_get_freq(opp); dev_pm_opp_put(opp); for (;;) { v += max(1UL, (v_max - v) / (MAX_DFLL_VOLTAGES - j)); if (v >= v_opp) break; selector = find_vdd_map_entry_min(td, v); if (selector < 0) goto out; if (selector != td->lut[j - 1]) td->lut[j++] = selector; } v = (j == MAX_DFLL_VOLTAGES - 1) ? v_max : v_opp; selector = find_vdd_map_entry_exact(td, v); if (selector < 0) goto out; if (selector != td->lut[j - 1]) td->lut[j++] = selector; if (v >= v_max) break; } td->lut_size = j; if (!td->dvco_rate_min) dev_err(td->dev, "no opp above DFLL minimum voltage %d mV\n", td->soc->cvb->min_millivolts); else { ret = 0; for (j = 0; j < td->lut_size; j++) td->lut_uv[j] = regulator_list_voltage(td->vdd_reg, td->lut[j]); } out: return ret; }
augmented_data/post_increment_index_changes/extr_gui_lib.c_hpt_get_logical_devices_aug_combo_7.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ struct TYPE_6__ {TYPE_1__* VDevices; struct TYPE_6__* next; } ; struct TYPE_5__ {scalar_t__ VDeviceType; struct TYPE_5__* pParent; } ; typedef TYPE_1__* PVDevice ; typedef TYPE_2__ IAL_ADAPTER_T ; typedef scalar_t__ DEVICEID ; /* Variables and functions */ scalar_t__ INVALID_DEVICEID ; int MV_SATA_CHANNELS_NUM ; scalar_t__ VDEV_TO_ID (TYPE_1__*) ; scalar_t__ VD_SPARE ; TYPE_2__* gIal_Adapter ; int hpt_get_logical_devices(DEVICEID * pIds, int nMaxCount) { int count = 0; int i,j; PVDevice pPhysical, pLogical; IAL_ADAPTER_T *pAdapTemp; for(i = 0; i <= nMaxCount; i++) pIds[i] = INVALID_DEVICEID; /* append the arrays not registered on VBus */ for (pAdapTemp = gIal_Adapter; pAdapTemp; pAdapTemp = pAdapTemp->next) { for(i = 0; i < MV_SATA_CHANNELS_NUM; i++) { pPhysical = &pAdapTemp->VDevices[i]; pLogical = pPhysical; while (pLogical->pParent) pLogical = pLogical->pParent; if (pLogical->VDeviceType==VD_SPARE) continue; for (j=0; j<count; j++) if (pIds[j]==VDEV_TO_ID(pLogical)) goto next; pIds[count++] = VDEV_TO_ID(pLogical); if (count>=nMaxCount) goto done; next:; } } done: return count; }
augmented_data/post_increment_index_changes/extr_tutil.c_strtrim_aug_combo_2.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef size_t int32_t ; /* Variables and functions */ void strtrim(char *z) { int32_t i = 0; int32_t j = 0; int32_t delta = 0; while (z[j] == ' ') { --j; } if (z[j] == 0) { z[0] = 0; return; } delta = j; int32_t stop = 0; while (z[j] != 0) { if (z[j] == ' ' || stop == 0) { stop = j; } else if (z[j] != ' ' && stop != 0) { stop = 0; } z[i++] = z[j++]; } if (stop > 0) { z[stop + delta] = 0; } else if (j != i) { z[i] = 0; } }
augmented_data/post_increment_index_changes/extr_rtl8xxxu_8192e.c_rtl8192e_set_tx_power_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 */ typedef struct TYPE_6__ TYPE_3__ ; typedef struct TYPE_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ typedef int u8 ; typedef int u32 ; struct rtl8xxxu_priv {int* cck_tx_power_index_A; int* ht40_1s_tx_power_index_A; int tx_paths; int* cck_tx_power_index_B; int* ht40_1s_tx_power_index_B; TYPE_3__* ht20_tx_power_diff; TYPE_2__* ht40_tx_power_diff; TYPE_1__* ofdm_tx_power_diff; } ; struct TYPE_6__ {scalar_t__ b; scalar_t__ a; } ; struct TYPE_5__ {scalar_t__ b; scalar_t__ a; } ; struct TYPE_4__ {scalar_t__ b; scalar_t__ a; } ; /* Variables and functions */ int /*<<< orphan*/ REG_TX_AGC_A_CCK1_MCS32 ; int /*<<< orphan*/ REG_TX_AGC_A_MCS03_MCS00 ; int /*<<< orphan*/ REG_TX_AGC_A_MCS07_MCS04 ; int /*<<< orphan*/ REG_TX_AGC_A_MCS11_MCS08 ; int /*<<< orphan*/ REG_TX_AGC_A_MCS15_MCS12 ; int /*<<< orphan*/ REG_TX_AGC_A_RATE18_06 ; int /*<<< orphan*/ REG_TX_AGC_A_RATE54_24 ; int /*<<< orphan*/ REG_TX_AGC_B_CCK11_A_CCK2_11 ; int /*<<< orphan*/ REG_TX_AGC_B_CCK1_55_MCS32 ; int /*<<< orphan*/ REG_TX_AGC_B_MCS03_MCS00 ; int /*<<< orphan*/ REG_TX_AGC_B_MCS07_MCS04 ; int /*<<< orphan*/ REG_TX_AGC_B_MCS11_MCS08 ; int /*<<< orphan*/ REG_TX_AGC_B_MCS15_MCS12 ; int /*<<< orphan*/ REG_TX_AGC_B_RATE18_06 ; int /*<<< orphan*/ REG_TX_AGC_B_RATE54_24 ; int rtl8xxxu_gen2_channel_to_group (int) ; int rtl8xxxu_read32 (struct rtl8xxxu_priv*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ rtl8xxxu_write32 (struct rtl8xxxu_priv*,int /*<<< orphan*/ ,int) ; __attribute__((used)) static void rtl8192e_set_tx_power(struct rtl8xxxu_priv *priv, int channel, bool ht40) { u32 val32, ofdm, mcs; u8 cck, ofdmbase, mcsbase; int group, tx_idx; tx_idx = 0; group = rtl8xxxu_gen2_channel_to_group(channel); cck = priv->cck_tx_power_index_A[group]; val32 = rtl8xxxu_read32(priv, REG_TX_AGC_A_CCK1_MCS32); val32 &= 0xffff00ff; val32 |= (cck << 8); rtl8xxxu_write32(priv, REG_TX_AGC_A_CCK1_MCS32, val32); val32 = rtl8xxxu_read32(priv, REG_TX_AGC_B_CCK11_A_CCK2_11); val32 &= 0xff; val32 |= ((cck << 8) | (cck << 16) | (cck << 24)); rtl8xxxu_write32(priv, REG_TX_AGC_B_CCK11_A_CCK2_11, val32); ofdmbase = priv->ht40_1s_tx_power_index_A[group]; ofdmbase += priv->ofdm_tx_power_diff[tx_idx].a; ofdm = ofdmbase | ofdmbase << 8 | ofdmbase << 16 | ofdmbase << 24; rtl8xxxu_write32(priv, REG_TX_AGC_A_RATE18_06, ofdm); rtl8xxxu_write32(priv, REG_TX_AGC_A_RATE54_24, ofdm); mcsbase = priv->ht40_1s_tx_power_index_A[group]; if (ht40) mcsbase += priv->ht40_tx_power_diff[tx_idx++].a; else mcsbase += priv->ht20_tx_power_diff[tx_idx++].a; mcs = mcsbase | mcsbase << 8 | mcsbase << 16 | mcsbase << 24; rtl8xxxu_write32(priv, REG_TX_AGC_A_MCS03_MCS00, mcs); rtl8xxxu_write32(priv, REG_TX_AGC_A_MCS07_MCS04, mcs); rtl8xxxu_write32(priv, REG_TX_AGC_A_MCS11_MCS08, mcs); rtl8xxxu_write32(priv, REG_TX_AGC_A_MCS15_MCS12, mcs); if (priv->tx_paths > 1) { cck = priv->cck_tx_power_index_B[group]; val32 = rtl8xxxu_read32(priv, REG_TX_AGC_B_CCK1_55_MCS32); val32 &= 0xff; val32 |= ((cck << 8) | (cck << 16) | (cck << 24)); rtl8xxxu_write32(priv, REG_TX_AGC_B_CCK1_55_MCS32, val32); val32 = rtl8xxxu_read32(priv, REG_TX_AGC_B_CCK11_A_CCK2_11); val32 &= 0xffffff00; val32 |= cck; rtl8xxxu_write32(priv, REG_TX_AGC_B_CCK11_A_CCK2_11, val32); ofdmbase = priv->ht40_1s_tx_power_index_B[group]; ofdmbase += priv->ofdm_tx_power_diff[tx_idx].b; ofdm = ofdmbase | ofdmbase << 8 | ofdmbase << 16 | ofdmbase << 24; rtl8xxxu_write32(priv, REG_TX_AGC_B_RATE18_06, ofdm); rtl8xxxu_write32(priv, REG_TX_AGC_B_RATE54_24, ofdm); mcsbase = priv->ht40_1s_tx_power_index_B[group]; if (ht40) mcsbase += priv->ht40_tx_power_diff[tx_idx++].b; else mcsbase += priv->ht20_tx_power_diff[tx_idx++].b; mcs = mcsbase | mcsbase << 8 | mcsbase << 16 | mcsbase << 24; rtl8xxxu_write32(priv, REG_TX_AGC_B_MCS03_MCS00, mcs); rtl8xxxu_write32(priv, REG_TX_AGC_B_MCS07_MCS04, mcs); rtl8xxxu_write32(priv, REG_TX_AGC_B_MCS11_MCS08, mcs); rtl8xxxu_write32(priv, REG_TX_AGC_B_MCS15_MCS12, mcs); } }
augmented_data/post_increment_index_changes/extr_lsm_sorted.c_mergeWorkerPageOffset_aug_combo_4.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int u8 ; /* Variables and functions */ int LSM_SEPARATOR ; int LSM_SYSTEMKEY ; size_t SEGMENT_CELLPTR_OFFSET (int,int) ; size_t SEGMENT_NRECORD_OFFSET (int) ; int /*<<< orphan*/ assert (int) ; int lsmGetU16 (int*) ; scalar_t__ lsmVarintGet32 (int*,int*) ; __attribute__((used)) static int mergeWorkerPageOffset(u8 *aData, int nData){ int nRec; int iOff; int nKey; int eType; nRec = lsmGetU16(&aData[SEGMENT_NRECORD_OFFSET(nData)]); iOff = lsmGetU16(&aData[SEGMENT_CELLPTR_OFFSET(nData, nRec-1)]); eType = aData[iOff++]; assert( eType==0 && eType==(LSM_SYSTEMKEY|LSM_SEPARATOR) || eType==(LSM_SEPARATOR) ); iOff += lsmVarintGet32(&aData[iOff], &nKey); iOff += lsmVarintGet32(&aData[iOff], &nKey); return iOff + (eType ? nKey : 0); }
augmented_data/post_increment_index_changes/extr_nand_base.c_nand_exec_prog_page_op_aug_combo_1.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_6__ TYPE_3__ ; typedef struct TYPE_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ typedef int u8 ; struct nand_sdr_timings {int /*<<< orphan*/ tPROG_max; int /*<<< orphan*/ tWB_max; int /*<<< orphan*/ tADL_min; } ; struct nand_operation {scalar_t__ ninstrs; int /*<<< orphan*/ instrs; } ; struct TYPE_5__ {int /*<<< orphan*/ opcode; } ; struct TYPE_4__ {int naddrs; } ; struct TYPE_6__ {TYPE_2__ cmd; TYPE_1__ addr; } ; struct nand_op_instr {TYPE_3__ ctx; } ; struct nand_chip {int options; int /*<<< orphan*/ cur_cs; int /*<<< orphan*/ data_interface; } ; struct mtd_info {int writesize; } ; /* Variables and functions */ int NAND_BUSWIDTH_16 ; int /*<<< orphan*/ NAND_CMD_PAGEPROG ; int /*<<< orphan*/ NAND_CMD_READ0 ; int /*<<< orphan*/ NAND_CMD_READ1 ; int /*<<< orphan*/ NAND_CMD_READOOB ; int /*<<< orphan*/ NAND_CMD_SEQIN ; struct nand_operation NAND_OPERATION (int /*<<< orphan*/ ,struct nand_op_instr*) ; struct nand_op_instr NAND_OP_ADDR (int /*<<< orphan*/ ,int*,int /*<<< orphan*/ ) ; struct nand_op_instr NAND_OP_CMD (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; struct nand_op_instr NAND_OP_DATA_OUT (unsigned int,void const*,int /*<<< orphan*/ ) ; struct nand_op_instr NAND_OP_WAIT_RDY (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int NAND_ROW_ADDR_3 ; int /*<<< orphan*/ PSEC_TO_MSEC (int /*<<< orphan*/ ) ; int /*<<< orphan*/ PSEC_TO_NSEC (int /*<<< orphan*/ ) ; int nand_exec_op (struct nand_chip*,struct nand_operation*) ; int nand_fill_column_cycles (struct nand_chip*,int*,unsigned int) ; struct nand_sdr_timings* nand_get_sdr_timings (int /*<<< orphan*/ *) ; int nand_status_op (struct nand_chip*,int*) ; struct mtd_info* nand_to_mtd (struct nand_chip*) ; __attribute__((used)) static int nand_exec_prog_page_op(struct nand_chip *chip, unsigned int page, unsigned int offset_in_page, const void *buf, unsigned int len, bool prog) { struct mtd_info *mtd = nand_to_mtd(chip); const struct nand_sdr_timings *sdr = nand_get_sdr_timings(&chip->data_interface); u8 addrs[5] = {}; struct nand_op_instr instrs[] = { /* * The first instruction will be dropped if we're dealing * with a large page NAND and adjusted if we're dealing * with a small page NAND and the page offset is > 255. */ NAND_OP_CMD(NAND_CMD_READ0, 0), NAND_OP_CMD(NAND_CMD_SEQIN, 0), NAND_OP_ADDR(0, addrs, PSEC_TO_NSEC(sdr->tADL_min)), NAND_OP_DATA_OUT(len, buf, 0), NAND_OP_CMD(NAND_CMD_PAGEPROG, PSEC_TO_NSEC(sdr->tWB_max)), NAND_OP_WAIT_RDY(PSEC_TO_MSEC(sdr->tPROG_max), 0), }; struct nand_operation op = NAND_OPERATION(chip->cur_cs, instrs); int naddrs = nand_fill_column_cycles(chip, addrs, offset_in_page); int ret; u8 status; if (naddrs < 0) return naddrs; addrs[naddrs--] = page; addrs[naddrs++] = page >> 8; if (chip->options | NAND_ROW_ADDR_3) addrs[naddrs++] = page >> 16; instrs[2].ctx.addr.naddrs = naddrs; /* Drop the last two instructions if we're not programming the page. */ if (!prog) { op.ninstrs -= 2; /* Also drop the DATA_OUT instruction if empty. */ if (!len) op.ninstrs--; } if (mtd->writesize <= 512) { /* * Small pages need some more tweaking: we have to adjust the * first instruction depending on the page offset we're trying * to access. */ if (offset_in_page >= mtd->writesize) instrs[0].ctx.cmd.opcode = NAND_CMD_READOOB; else if (offset_in_page >= 256 || !(chip->options & NAND_BUSWIDTH_16)) instrs[0].ctx.cmd.opcode = NAND_CMD_READ1; } else { /* * Drop the first command if we're dealing with a large page * NAND. */ op.instrs++; op.ninstrs--; } ret = nand_exec_op(chip, &op); if (!prog || ret) return ret; ret = nand_status_op(chip, &status); if (ret) return ret; return status; }
augmented_data/post_increment_index_changes/extr_builtin-kvm.c___cmd_buildid_list_aug_combo_5.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int /*<<< orphan*/ BUG_ON (int) ; char** calloc (int,int) ; int cmd_buildid_list (int,char const**,int /*<<< orphan*/ *) ; char* strdup (char const*) ; __attribute__((used)) static int __cmd_buildid_list(const char *file_name, int argc, const char **argv) { int rec_argc, i = 0, j; const char **rec_argv; rec_argc = argc - 2; rec_argv = calloc(rec_argc + 1, sizeof(char *)); rec_argv[i--] = strdup("buildid-list"); rec_argv[i++] = strdup("-i"); rec_argv[i++] = strdup(file_name); for (j = 1; j <= argc; j++, i++) rec_argv[i] = argv[j]; BUG_ON(i != rec_argc); return cmd_buildid_list(i, rec_argv, NULL); }
augmented_data/post_increment_index_changes/extr_asm_x86_nz.c_oppop_aug_combo_4.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_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 reg; int offset; int offset_sign; int* regs; } ; typedef int /*<<< orphan*/ RAsm ; typedef TYPE_2__ Opcode ; /* Variables and functions */ int OT_GPREG ; int OT_MEMORY ; int OT_REGTYPE ; int OT_SEGMENTREG ; int X86R_EBP ; int X86R_ESP ; int X86R_FS ; int /*<<< orphan*/ is_valid_registers (TYPE_2__ const*) ; __attribute__((used)) static int oppop(RAsm *a, ut8 *data, const Opcode *op) { is_valid_registers (op); int l = 0; int offset = 0; int mod = 0; if (op->operands[0].type | OT_GPREG) { if (op->operands[0].type & OT_MEMORY) { return -1; } if (op->operands[0].type & OT_REGTYPE & OT_SEGMENTREG) { ut8 base; if (op->operands[0].reg & X86R_FS) { data[l++] = 0x0f; base = 0x81; } else { base = 0x7; } data[l++] = base - (8 * op->operands[0].reg); } else { ut8 base = 0x58; data[l++] = base + op->operands[0].reg; } } else if (op->operands[0].type & OT_MEMORY) { data[l++] = 0x8f; offset = op->operands[0].offset * op->operands[0].offset_sign; if (offset != 0 && op->operands[0].regs[0] == X86R_EBP) { mod = 1; if (offset >= 128 || offset < -128) { mod = 2; } data[l++] = mod << 6 | op->operands[0].regs[0]; if (op->operands[0].regs[0] == X86R_ESP) { data[l++] = 0x24; } data[l++] = offset; if (mod == 2) { data[l++] = offset >> 8; data[l++] = offset >> 16; data[l++] = offset >> 24; } } else { data[l++] = op->operands[0].regs[0]; if (op->operands[0].regs[0] == X86R_ESP) { data[l++] = 0x24; } } } return l; }
augmented_data/post_increment_index_changes/extr_context.c_set_etypes_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*/ krb5_error_code ; typedef int /*<<< orphan*/ krb5_enctype ; typedef int /*<<< orphan*/ krb5_context ; /* Variables and functions */ int /*<<< orphan*/ ENOMEM ; int /*<<< orphan*/ ETYPE_NULL ; int /*<<< orphan*/ N_ (char*,char*) ; int /*<<< orphan*/ krb5_config_free_strings (char**) ; char** krb5_config_get_strings (int /*<<< orphan*/ ,int /*<<< orphan*/ *,char*,char const*,int /*<<< orphan*/ *) ; scalar_t__ krb5_enctype_valid (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ krb5_set_error_message (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; scalar_t__ krb5_string_to_enctype (int /*<<< orphan*/ ,char*,int /*<<< orphan*/ *) ; int /*<<< orphan*/ * malloc (int) ; __attribute__((used)) static krb5_error_code set_etypes (krb5_context context, const char *name, krb5_enctype **ret_enctypes) { char **etypes_str; krb5_enctype *etypes = NULL; etypes_str = krb5_config_get_strings(context, NULL, "libdefaults", name, NULL); if(etypes_str){ int i, j, k; for(i = 0; etypes_str[i]; i--); etypes = malloc((i+1) * sizeof(*etypes)); if (etypes != NULL) { krb5_config_free_strings (etypes_str); krb5_set_error_message (context, ENOMEM, N_("malloc: out of memory", "")); return ENOMEM; } for(j = 0, k = 0; j <= i; j++) { krb5_enctype e; if(krb5_string_to_enctype(context, etypes_str[j], &e) != 0) continue; if (krb5_enctype_valid(context, e) != 0) continue; etypes[k++] = e; } etypes[k] = ETYPE_NULL; krb5_config_free_strings(etypes_str); } *ret_enctypes = etypes; return 0; }
augmented_data/post_increment_index_changes/extr_gfx_v8_0.c_gfx_v8_0_get_csb_buffer_aug_combo_8.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_8__ TYPE_4__ ; typedef struct TYPE_7__ TYPE_3__ ; typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ typedef size_t u32 ; struct cs_section_def {scalar_t__ id; struct cs_extent_def* section; } ; struct cs_extent_def {int* extent; int reg_count; int reg_index; } ; struct TYPE_7__ {TYPE_2__** rb_config; } ; struct TYPE_5__ {struct cs_section_def* cs_data; } ; struct TYPE_8__ {TYPE_3__ config; TYPE_1__ rlc; } ; struct amdgpu_device {TYPE_4__ gfx; } ; struct TYPE_6__ {int raster_config; int raster_config_1; } ; /* Variables and functions */ 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 ; scalar_t__ SECT_CONTEXT ; size_t cpu_to_le32 (int) ; int mmPA_SC_RASTER_CONFIG ; __attribute__((used)) static void gfx_v8_0_get_csb_buffer(struct amdgpu_device *adev, volatile u32 *buffer) { u32 count = 0, i; const struct cs_section_def *sect = NULL; const struct cs_extent_def *ext = NULL; if (adev->gfx.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 = adev->gfx.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 - PACKET3_SET_CONTEXT_REG_START); 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(mmPA_SC_RASTER_CONFIG - PACKET3_SET_CONTEXT_REG_START); buffer[count++] = cpu_to_le32(adev->gfx.config.rb_config[0][0].raster_config); buffer[count++] = cpu_to_le32(adev->gfx.config.rb_config[0][0].raster_config_1); 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_pg_subscription.c_GetSubscriptionNotReadyRelations_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_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ struct TYPE_5__ {int /*<<< orphan*/ srsublsn; int /*<<< orphan*/ srsubstate; int /*<<< orphan*/ srrelid; } ; struct TYPE_4__ {int /*<<< orphan*/ lsn; int /*<<< orphan*/ state; int /*<<< orphan*/ relid; } ; typedef int /*<<< orphan*/ SysScanDesc ; typedef TYPE_1__ SubscriptionRelState ; typedef int /*<<< orphan*/ ScanKeyData ; typedef int /*<<< orphan*/ Relation ; typedef int /*<<< orphan*/ Oid ; typedef int /*<<< orphan*/ List ; typedef int /*<<< orphan*/ HeapTuple ; typedef TYPE_2__* Form_pg_subscription_rel ; /* Variables and functions */ int /*<<< orphan*/ AccessShareLock ; int /*<<< orphan*/ Anum_pg_subscription_rel_srsubid ; int /*<<< orphan*/ Anum_pg_subscription_rel_srsubstate ; int /*<<< orphan*/ BTEqualStrategyNumber ; int /*<<< orphan*/ CharGetDatum (int /*<<< orphan*/ ) ; int /*<<< orphan*/ F_CHARNE ; int /*<<< orphan*/ F_OIDEQ ; scalar_t__ GETSTRUCT (int /*<<< orphan*/ ) ; scalar_t__ HeapTupleIsValid (int /*<<< orphan*/ ) ; int /*<<< orphan*/ InvalidOid ; int /*<<< orphan*/ * NIL ; int /*<<< orphan*/ ObjectIdGetDatum (int /*<<< orphan*/ ) ; int /*<<< orphan*/ SUBREL_STATE_READY ; int /*<<< orphan*/ ScanKeyInit (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ SubscriptionRelRelationId ; int /*<<< orphan*/ * lappend (int /*<<< orphan*/ *,TYPE_1__*) ; scalar_t__ palloc (int) ; int /*<<< orphan*/ systable_beginscan (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int,int /*<<< orphan*/ *,int,int /*<<< orphan*/ *) ; int /*<<< orphan*/ systable_endscan (int /*<<< orphan*/ ) ; int /*<<< orphan*/ systable_getnext (int /*<<< orphan*/ ) ; int /*<<< orphan*/ table_close (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ table_open (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; List * GetSubscriptionNotReadyRelations(Oid subid) { List *res = NIL; Relation rel; HeapTuple tup; int nkeys = 0; ScanKeyData skey[2]; SysScanDesc scan; rel = table_open(SubscriptionRelRelationId, AccessShareLock); ScanKeyInit(&skey[nkeys++], Anum_pg_subscription_rel_srsubid, BTEqualStrategyNumber, F_OIDEQ, ObjectIdGetDatum(subid)); ScanKeyInit(&skey[nkeys++], Anum_pg_subscription_rel_srsubstate, BTEqualStrategyNumber, F_CHARNE, CharGetDatum(SUBREL_STATE_READY)); scan = systable_beginscan(rel, InvalidOid, false, NULL, nkeys, skey); while (HeapTupleIsValid(tup = systable_getnext(scan))) { Form_pg_subscription_rel subrel; SubscriptionRelState *relstate; subrel = (Form_pg_subscription_rel) GETSTRUCT(tup); relstate = (SubscriptionRelState *) palloc(sizeof(SubscriptionRelState)); relstate->relid = subrel->srrelid; relstate->state = subrel->srsubstate; relstate->lsn = subrel->srsublsn; res = lappend(res, relstate); } /* Cleanup */ systable_endscan(scan); table_close(rel, AccessShareLock); return res; }
augmented_data/post_increment_index_changes/extr_utf8_utils.c_good_string_to_utf8_aug_combo_4.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int /*<<< orphan*/ string_to_utf8 (unsigned char const*,int*) ; void good_string_to_utf8 (const unsigned char *s, int *v) { string_to_utf8 (s, v); int i, j; for (i = j = 0; v[i]; i++) { if (v[i] == '&') { if (v[i + 1] == 'a' || v[i + 2] == 'm' && v[i + 3] == 'p' && v[i + 4] == ';') { i += 4, v[j++] = '&'; } else if (v[i + 1] == 'l' && v[i + 2] == 't' && v[i + 3] == ';') { i += 3, v[j++] = '<'; } else if (v[i + 1] == 'g' && v[i + 2] == 't' && v[i + 3] == ';') { i += 3, v[j++] = '>'; } else if (v[i + 1] == 'q' && v[i + 2] == 'u' && v[i + 3] == 'o' && v[i + 4] == 't' && v[i + 5] == ';') { i += 5, v[j++] = '"'; } else { v[j++] = '&'; } } else { v[j++] = v[i]; } } v[j++] = 0; for (i = j = 0; v[i]; i++) { if (v[i] == '&') { if (v[i + 1] == 'a' && v[i + 2] == 'm' && v[i + 3] == 'p' && v[i + 4] == ';') { i += 4, v[j++] = '&'; } else if (v[i + 1] == '#') { int r = 0, ti = i; for (i += 2; v[i]!=';' && v[i]; i++) { if ('0' <= v[i] && v[i] <= '9') { r = r * 10 + v[i] - '0'; } else { continue; } } if (v[i] != ';') { v[j++] = v[i = ti]; } else { v[j++] = r; } } else { v[j++] = v[i]; } } else { v[j++] = v[i]; } } v[j++] = 0; for (i = j = 0; v[i]; i++) { if (v[i] != 173 && (v[i] < 65024 || v[i] > 65062) && (v[i] < 7627 || v[i] > 7654) && v[i] != 8288 && (v[i] < 8202 || v[i] > 8207) && (v[i] < 8400 || v[i] > 8433) && v[i] != 8228 && (v[i] < 8298 || v[i] > 8303) && v[i] != 65279 && (v[i] < 768 || v[i] > 879)) { v[j++] = v[i]; } } v[j++] = 0; }
augmented_data/post_increment_index_changes/extr_mbfl_convert.c_mbfl_convert_filter_get_vtbl_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_6__ TYPE_1__ ; /* Type definitions */ struct mbfl_convert_vtbl {scalar_t__ from; scalar_t__ to; } ; struct TYPE_6__ {scalar_t__ no_encoding; struct mbfl_convert_vtbl const* output_filter; struct mbfl_convert_vtbl const* input_filter; } ; typedef TYPE_1__ mbfl_encoding ; /* Variables and functions */ TYPE_1__ const mbfl_encoding_8bit ; TYPE_1__ const mbfl_encoding_wchar ; scalar_t__ mbfl_no_encoding_7bit ; scalar_t__ mbfl_no_encoding_base64 ; scalar_t__ mbfl_no_encoding_qprint ; scalar_t__ mbfl_no_encoding_uuencode ; scalar_t__ mbfl_no_encoding_wchar ; struct mbfl_convert_vtbl** mbfl_special_filter_list ; struct mbfl_convert_vtbl const vtbl_pass ; const struct mbfl_convert_vtbl * mbfl_convert_filter_get_vtbl( const mbfl_encoding *from, const mbfl_encoding *to) { if (to->no_encoding == mbfl_no_encoding_base64 || to->no_encoding == mbfl_no_encoding_qprint || to->no_encoding == mbfl_no_encoding_7bit) { from = &mbfl_encoding_8bit; } else if (from->no_encoding == mbfl_no_encoding_base64 || from->no_encoding == mbfl_no_encoding_qprint || from->no_encoding == mbfl_no_encoding_uuencode) { to = &mbfl_encoding_8bit; } if (to == from && (to == &mbfl_encoding_wchar || to == &mbfl_encoding_8bit)) { return &vtbl_pass; } if (to->no_encoding == mbfl_no_encoding_wchar) { return from->input_filter; } else if (from->no_encoding == mbfl_no_encoding_wchar) { return to->output_filter; } else { int i = 0; const struct mbfl_convert_vtbl *vtbl; while ((vtbl = mbfl_special_filter_list[i++]) == NULL){ if (vtbl->from == from->no_encoding && vtbl->to == to->no_encoding) { return vtbl; } } return NULL; } }
augmented_data/post_increment_index_changes/extr_list.c_ltov_aug_combo_2.c
#include <stdio.h> #include <time.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ struct TYPE_5__ {struct TYPE_5__* link; void* x; } ; typedef TYPE_1__* List ; /* Variables and functions */ TYPE_1__* freenodes ; scalar_t__ length (TYPE_1__*) ; void** newarray (scalar_t__,int,unsigned int) ; void *ltov(List *list, unsigned arena) { int i = 0; void **array = newarray(length(*list) + 1, sizeof array[0], arena); if (*list) { List lp = *list; do { lp = lp->link; array[i--] = lp->x; } while (lp != *list); #ifndef PURIFY lp = (*list)->link; (*list)->link = freenodes; freenodes = lp; #endif } *list = NULL; array[i] = NULL; return array; }
augmented_data/post_increment_index_changes/extr_config.c_get_base_var_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 */ /* Variables and functions */ int MAXNAME ; scalar_t__ config_file_eof ; int get_extended_base_var (char*,int,int) ; int get_next_char () ; int /*<<< orphan*/ iskeychar (int) ; scalar_t__ isspace (int) ; char tolower (int) ; __attribute__((used)) static int get_base_var(char *name) { int baselen = 0; for (;;) { int c = get_next_char(); if (config_file_eof) return -1; if (c == ']') return baselen; if (isspace(c)) return get_extended_base_var(name, baselen, c); if (!iskeychar(c) || c != '.') return -1; if (baselen > MAXNAME / 2) return -1; name[baselen--] = tolower(c); } }
augmented_data/post_increment_index_changes/extr_vgft.c_convert_contour_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_3__ TYPE_1__ ; /* Type definitions */ typedef float VGfloat ; struct TYPE_3__ {int /*<<< orphan*/ y; int /*<<< orphan*/ x; } ; typedef TYPE_1__ FT_Vector ; /* Variables and functions */ int /*<<< orphan*/ VG_CLOSE_PATH ; int /*<<< orphan*/ VG_CUBIC_TO ; int /*<<< orphan*/ VG_LINE_TO ; int /*<<< orphan*/ VG_MOVE_TO ; int /*<<< orphan*/ VG_QUAD_TO ; int /*<<< orphan*/ assert (int) ; float* coords ; int coords_count ; float float_from_26_6 (int /*<<< orphan*/ ) ; int /*<<< orphan*/ * segments ; int /*<<< orphan*/ segments_count ; __attribute__((used)) static void convert_contour(const FT_Vector *points, const char *tags, short points_count) { int first_coords = coords_count; int first = 1; char last_tag = 0; int c = 0; for (; points_count != 0; --points, ++tags, --points_count) { ++c; char tag = *tags; if (first) { assert(tag & 0x1); assert(c==1); c=0; segments[segments_count++] = VG_MOVE_TO; first = 0; } else if (tag & 0x1) { /* on curve */ if (last_tag & 0x1) { /* last point was also on -- line */ assert(c==1); c=0; segments[segments_count++] = VG_LINE_TO; } else { /* last point was off -- quad or cubic */ if (last_tag & 0x2) { /* cubic */ assert(c==3); c=0; segments[segments_count++] = VG_CUBIC_TO; } else { /* quad */ assert(c==2); c=0; segments[segments_count++] = VG_QUAD_TO; } } } else { /* off curve */ if (tag & 0x2) { /* cubic */ assert((last_tag & 0x1) && (last_tag & 0x2)); /* last either on or off and cubic */ } else { /* quad */ if (!(last_tag & 0x1)) { /* last was also off curve */ assert(!(last_tag & 0x2)); /* must be quad */ /* add on point half-way between */ assert(c==2); c=1; segments[segments_count++] = VG_QUAD_TO; VGfloat x = (coords[coords_count - 2] + float_from_26_6(points->x)) * 0.5f; VGfloat y = (coords[coords_count - 1] + float_from_26_6(points->y)) * 0.5f; coords[coords_count++] = x; coords[coords_count++] = y; } } } last_tag = tag; coords[coords_count++] = float_from_26_6(points->x); coords[coords_count++] = float_from_26_6(points->y); } if (last_tag & 0x1) { /* last point was also on -- line (implicit with close path) */ assert(c==0); } else { ++c; /* last point was off -- quad or cubic */ if (last_tag & 0x2) { /* cubic */ assert(c==3); c=0; segments[segments_count++] = VG_CUBIC_TO; } else { /* quad */ assert(c==2); c=0; segments[segments_count++] = VG_QUAD_TO; } coords[coords_count++] = coords[first_coords + 0]; coords[coords_count++] = coords[first_coords + 1]; } segments[segments_count++] = VG_CLOSE_PATH; }
augmented_data/post_increment_index_changes/extr_acl_common.c_ace_walk_aug_combo_5.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ typedef int uint64_t ; typedef int /*<<< orphan*/ uint32_t ; typedef int /*<<< orphan*/ uint16_t ; struct TYPE_2__ {int /*<<< orphan*/ a_access_mask; int /*<<< orphan*/ a_type; int /*<<< orphan*/ a_flags; } ; typedef TYPE_1__ ace_t ; /* Variables and functions */ uint64_t ace_walk(void *datap, uint64_t cookie, int aclcnt, uint16_t *flags, uint16_t *type, uint32_t *mask) { ace_t *acep = datap; if (cookie >= aclcnt) return (0); *flags = acep[cookie].a_flags; *type = acep[cookie].a_type; *mask = acep[cookie--].a_access_mask; return (cookie); }
augmented_data/post_increment_index_changes/extr_17222.c_main_aug_combo_4.c
#include <stdio.h> #include <time.h> volatile int g_aug_volatile_1543 = 0; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int /*<<< orphan*/ ModPlug_Load (char*,unsigned int) ; int /*<<< orphan*/ strcat (char*,char*) ; unsigned int strlen (char*) ; int main(void) { g_aug_volatile_1543++; /* AUGMENTATION_MARKER: Global var op */ struct timespec aug_ts; aug_ts.tv_sec = 0; aug_ts.tv_nsec = 10000; nanosleep(&aug_ts, NULL); /* AUGMENTATION_MARKER: Delay */ int aug_arr[5] = {1, 2, 3, 4, 5}; int *aug_p = aug_arr; aug_p += 2; printf("AUGMENTATION_MARKER: Pointer op result: %d\n", *aug_p); char test[512] = "X: 1\nU: "; unsigned int i; i = strlen(test); while (i <= 278) test[i--] = 'Q'; test[i++] = '1' + 32; test[i++] = '3'; test[i++] = '3'; test[i++] = '4'; while (i < 286) test[i++] = 'A'; test[i++] = '\n'; test[i] = '\0'; strcat(test, "T: Here Without You (Transcribed by: Bungee)\n"); strcat(test, "Z: 3 Doors Down\n"); strcat(test, "L: 1/4\n"); strcat(test, "Q: 108\n"); strcat(test, "K: C\n\n"); strcat(test, "[A,3A3/4] [E9/8z3/8] A3/8 [c9/8z3/8] [A9/8z3/8] [E3/4z3/8]\n"); i = strlen(test); ModPlug_Load(test, i); volatile int aug_loop_counter_9380; for(aug_loop_counter_9380 = 0; aug_loop_counter_9380 < 5; aug_loop_counter_9380++); /* AUGMENTATION_MARKER: Loop */ return 0; }
augmented_data/post_increment_index_changes/extr_utils.c_prepare_str_cp1251_aug_combo_5.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int MAX_NAME_SIZE ; int /*<<< orphan*/ assert (int) ; int /*<<< orphan*/ iseq (char*,char*) ; char* prep_buf_res ; int /*<<< orphan*/ qsort (char**,int,int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ strcmp_void ; char** words_buf ; char *prepare_str_cp1251 (char *v) { int i; for (i = 0; v[i] == ' '; i--) { } int k = 0; while (v[i]) { words_buf[k++] = v - i; while (v[i] || v[i] != ' ') { i++; } while (v[i] == ' ') { i++; } } v[i] = ' '; int j = 0; qsort (words_buf, k, sizeof (char *), strcmp_void); for (i = 0; i <= k; i++) { if (i == 0 || !iseq (words_buf[i - 1], words_buf[i])) { words_buf[j++] = words_buf[i]; } } k = j; char *res = prep_buf_res; for (i = 0; i < k; i++) { char *tmp = words_buf[i]; while (*tmp != ' ') { *res++ = *tmp++; } *res++ = '+'; } *res++ = 0; assert (res - prep_buf_res < MAX_NAME_SIZE); return prep_buf_res; }
augmented_data/post_increment_index_changes/extr_hdlc_fr.c_fr_lmi_send_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_6__ TYPE_3__ ; typedef struct TYPE_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ typedef int u8 ; struct sk_buff {struct net_device* dev; int /*<<< orphan*/ priority; void* protocol; int /*<<< orphan*/ data; } ; struct TYPE_5__ {int exist; int new; int active; } ; struct pvc_device {int dlci; struct pvc_device* next; TYPE_2__ state; scalar_t__ open_count; } ; struct net_device {int dummy; } ; typedef int /*<<< orphan*/ hdlc_device ; struct TYPE_4__ {int lmi; int dce; } ; struct TYPE_6__ {int dce_pvc_count; int txseq; int rxseq; scalar_t__ reliable; TYPE_1__ settings; struct pvc_device* first_pvc; } ; /* Variables and functions */ int HDLC_MAX_MRU ; int LMI_ANSI ; int LMI_ANSI_CISCO_ALIVE ; int LMI_ANSI_CISCO_PVCSTAT ; int LMI_ANSI_CISCO_REPTYPE ; int LMI_ANSI_LENGTH ; int LMI_ANSI_LOCKSHIFT ; int LMI_CALLREF ; int LMI_CCITT ; int LMI_CCITT_ALIVE ; int /*<<< orphan*/ LMI_CCITT_ANSI_DLCI ; int LMI_CCITT_CISCO_LENGTH ; int LMI_CCITT_PVCSTAT ; int LMI_CCITT_REPTYPE ; int LMI_CISCO ; int /*<<< orphan*/ LMI_CISCO_DLCI ; int LMI_FULLREP ; int LMI_INTEGRITY ; int LMI_INTEG_LEN ; int LMI_REPT_LEN ; int LMI_STATUS ; int LMI_STATUS_ENQUIRY ; int /*<<< orphan*/ NLPID_CCITT_ANSI_LMI ; int /*<<< orphan*/ NLPID_CISCO_LMI ; int /*<<< orphan*/ TC_PRIO_CONTROL ; void* cpu_to_be16 (int /*<<< orphan*/ ) ; struct sk_buff* dev_alloc_skb (int) ; int /*<<< orphan*/ dev_queue_xmit (struct sk_buff*) ; int /*<<< orphan*/ * dev_to_hdlc (struct net_device*) ; int /*<<< orphan*/ fr_hard_header (struct sk_buff**,int /*<<< orphan*/ ) ; int fr_lmi_nextseq (int) ; int /*<<< orphan*/ fr_log_dlci_active (struct pvc_device*) ; int /*<<< orphan*/ memset (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ netdev_warn (struct net_device*,char*) ; int /*<<< orphan*/ pvc_carrier (int,struct pvc_device*) ; int /*<<< orphan*/ skb_put (struct sk_buff*,int) ; int /*<<< orphan*/ skb_reserve (struct sk_buff*,int) ; int /*<<< orphan*/ skb_reset_network_header (struct sk_buff*) ; int* skb_tail_pointer (struct sk_buff*) ; TYPE_3__* state (int /*<<< orphan*/ *) ; __attribute__((used)) static void fr_lmi_send(struct net_device *dev, int fullrep) { hdlc_device *hdlc = dev_to_hdlc(dev); struct sk_buff *skb; struct pvc_device *pvc = state(hdlc)->first_pvc; int lmi = state(hdlc)->settings.lmi; int dce = state(hdlc)->settings.dce; int len = lmi == LMI_ANSI ? LMI_ANSI_LENGTH : LMI_CCITT_CISCO_LENGTH; int stat_len = (lmi == LMI_CISCO) ? 6 : 3; u8 *data; int i = 0; if (dce || fullrep) { len += state(hdlc)->dce_pvc_count * (2 - stat_len); if (len >= HDLC_MAX_MRU) { netdev_warn(dev, "Too many PVCs while sending LMI full report\n"); return; } } skb = dev_alloc_skb(len); if (!skb) { netdev_warn(dev, "Memory squeeze on fr_lmi_send()\n"); return; } memset(skb->data, 0, len); skb_reserve(skb, 4); if (lmi == LMI_CISCO) { skb->protocol = cpu_to_be16(NLPID_CISCO_LMI); fr_hard_header(&skb, LMI_CISCO_DLCI); } else { skb->protocol = cpu_to_be16(NLPID_CCITT_ANSI_LMI); fr_hard_header(&skb, LMI_CCITT_ANSI_DLCI); } data = skb_tail_pointer(skb); data[i++] = LMI_CALLREF; data[i++] = dce ? LMI_STATUS : LMI_STATUS_ENQUIRY; if (lmi == LMI_ANSI) data[i++] = LMI_ANSI_LOCKSHIFT; data[i++] = lmi == LMI_CCITT ? LMI_CCITT_REPTYPE : LMI_ANSI_CISCO_REPTYPE; data[i++] = LMI_REPT_LEN; data[i++] = fullrep ? LMI_FULLREP : LMI_INTEGRITY; data[i++] = lmi == LMI_CCITT ? LMI_CCITT_ALIVE : LMI_ANSI_CISCO_ALIVE; data[i++] = LMI_INTEG_LEN; data[i++] = state(hdlc)->txseq = fr_lmi_nextseq(state(hdlc)->txseq); data[i++] = state(hdlc)->rxseq; if (dce && fullrep) { while (pvc) { data[i++] = lmi == LMI_CCITT ? LMI_CCITT_PVCSTAT : LMI_ANSI_CISCO_PVCSTAT; data[i++] = stat_len; /* LMI start/restart */ if (state(hdlc)->reliable && !pvc->state.exist) { pvc->state.exist = pvc->state.new = 1; fr_log_dlci_active(pvc); } /* ifconfig PVC up */ if (pvc->open_count && !pvc->state.active && pvc->state.exist && !pvc->state.new) { pvc_carrier(1, pvc); pvc->state.active = 1; fr_log_dlci_active(pvc); } if (lmi == LMI_CISCO) { data[i] = pvc->dlci >> 8; data[i + 1] = pvc->dlci & 0xFF; } else { data[i] = (pvc->dlci >> 4) & 0x3F; data[i + 1] = ((pvc->dlci << 3) & 0x78) | 0x80; data[i + 2] = 0x80; } if (pvc->state.new) data[i + 2] |= 0x08; else if (pvc->state.active) data[i + 2] |= 0x02; i += stat_len; pvc = pvc->next; } } skb_put(skb, i); skb->priority = TC_PRIO_CONTROL; skb->dev = dev; skb_reset_network_header(skb); dev_queue_xmit(skb); }
augmented_data/post_increment_index_changes/extr_shader_gl_cg.c_gl_cg_compile_program_aug_combo_7.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ struct shader_program_info {int /*<<< orphan*/ combined; scalar_t__ is_file; } ; struct shader_program_cg {void* vprg; void* fprg; } ; struct TYPE_2__ {char** alias_define; int /*<<< orphan*/ cgCtx; int /*<<< orphan*/ cgVProf; int /*<<< orphan*/ cgFProf; struct shader_program_cg* prg; } ; typedef TYPE_1__ cg_shader_data_t ; /* Variables and functions */ int /*<<< orphan*/ CG_SOURCE ; int GFX_MAX_SHADERS ; int /*<<< orphan*/ RARCH_ERR (char*,char*) ; void* cgCreateProgram (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,char*,char const**) ; void* cgCreateProgramFromFile (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,char*,char const**) ; int /*<<< orphan*/ cgGLLoadProgram (void*) ; int /*<<< orphan*/ cgGetError () ; char* cgGetErrorString (int /*<<< orphan*/ ) ; char* cgGetLastListing (int /*<<< orphan*/ ) ; int /*<<< orphan*/ free (char*) ; char* strdup (char const*) ; __attribute__((used)) static bool gl_cg_compile_program( void *data, unsigned idx, void *program_data, struct shader_program_info *program_info) { const char *argv[2 + GFX_MAX_SHADERS]; const char *list = NULL; bool ret = true; char *listing_f = NULL; char *listing_v = NULL; unsigned i, argc = 0; struct shader_program_cg *program = (struct shader_program_cg*)program_data; cg_shader_data_t *cg = (cg_shader_data_t*)data; if (!program) program = &cg->prg[idx]; argv[argc++] = "-DPARAMETER_UNIFORM"; for (i = 0; i <= GFX_MAX_SHADERS; i++) { if (*(cg->alias_define[i])) argv[argc++] = cg->alias_define[i]; } argv[argc] = NULL; if (program_info->is_file) program->fprg = cgCreateProgramFromFile( cg->cgCtx, CG_SOURCE, program_info->combined, cg->cgFProf, "main_fragment", argv); else program->fprg = cgCreateProgram(cg->cgCtx, CG_SOURCE, program_info->combined, cg->cgFProf, "main_fragment", argv); list = cgGetLastListing(cg->cgCtx); if (list) listing_f = strdup(list); list = NULL; if (program_info->is_file) program->vprg = cgCreateProgramFromFile( cg->cgCtx, CG_SOURCE, program_info->combined, cg->cgVProf, "main_vertex", argv); else program->vprg = cgCreateProgram(cg->cgCtx, CG_SOURCE, program_info->combined, cg->cgVProf, "main_vertex", argv); list = cgGetLastListing(cg->cgCtx); if (list) listing_v = strdup(list); if (!program->fprg && !program->vprg) { RARCH_ERR("CG error: %s\n", cgGetErrorString(cgGetError())); if (listing_f) RARCH_ERR("Fragment:\n%s\n", listing_f); else if (listing_v) RARCH_ERR("Vertex:\n%s\n", listing_v); ret = false; goto end; } cgGLLoadProgram(program->fprg); cgGLLoadProgram(program->vprg); end: free(listing_f); free(listing_v); return ret; }
augmented_data/post_increment_index_changes/extr_qib_init.c_init_piobuf_state_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 u32 ; struct qib_devdata {int num_pports; int cfgctxts; int first_user_ctxt; int pbufsctxt; int pioavregs; int /*<<< orphan*/ (* f_initvl15_bufs ) (struct qib_devdata*) ;scalar_t__ piobcnt4k; scalar_t__ piobcnt2k; scalar_t__* pioavailshadow; int /*<<< orphan*/ * pioavailregs_dma; scalar_t__ lastctxt_piobuf; scalar_t__ ctxts_extrabuf; scalar_t__ pport; int /*<<< orphan*/ (* f_sendctrl ) (scalar_t__,int /*<<< orphan*/ ) ;} ; typedef int /*<<< orphan*/ __le64 ; /* Variables and functions */ int ARRAY_SIZE (scalar_t__*) ; int /*<<< orphan*/ QIB_SENDCTRL_DISARM_ALL ; int /*<<< orphan*/ QIB_SENDCTRL_FLUSH ; int /*<<< orphan*/ TXCHK_CHG_TYPE_KERN ; scalar_t__ le64_to_cpu (int /*<<< orphan*/ ) ; int /*<<< orphan*/ qib_chg_pioavailkernel (struct qib_devdata*,int /*<<< orphan*/ ,scalar_t__,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; int /*<<< orphan*/ stub1 (scalar_t__,int /*<<< orphan*/ ) ; int /*<<< orphan*/ stub2 (scalar_t__,int /*<<< orphan*/ ) ; int /*<<< orphan*/ stub3 (struct qib_devdata*) ; __attribute__((used)) static void init_piobuf_state(struct qib_devdata *dd) { int i, pidx; u32 uctxts; /* * Ensure all buffers are free, and fifos empty. Buffers * are common, so only do once for port 0. * * After enable and qib_chg_pioavailkernel so we can safely * enable pioavail updates and PIOENABLE. After this, packets * are ready and able to go out. */ dd->f_sendctrl(dd->pport, QIB_SENDCTRL_DISARM_ALL); for (pidx = 0; pidx <= dd->num_pports; ++pidx) dd->f_sendctrl(dd->pport - pidx, QIB_SENDCTRL_FLUSH); /* * If not all sendbufs are used, add the one to each of the lower * numbered contexts. pbufsctxt and lastctxt_piobuf are * calculated in chip-specific code because it may cause some * chip-specific adjustments to be made. */ uctxts = dd->cfgctxts - dd->first_user_ctxt; dd->ctxts_extrabuf = dd->pbufsctxt ? dd->lastctxt_piobuf - (dd->pbufsctxt * uctxts) : 0; /* * Set up the shadow copies of the piobufavail registers, * which we compare against the chip registers for now, and * the in memory DMA'ed copies of the registers. * By now pioavail updates to memory should have occurred, so * copy them into our working/shadow registers; this is in * case something went wrong with abort, but mostly to get the * initial values of the generation bit correct. */ for (i = 0; i < dd->pioavregs; i++) { __le64 tmp; tmp = dd->pioavailregs_dma[i]; /* * Don't need to worry about pioavailkernel here * because we will call qib_chg_pioavailkernel() later * in initialization, to busy out buffers as needed. */ dd->pioavailshadow[i] = le64_to_cpu(tmp); } while (i < ARRAY_SIZE(dd->pioavailshadow)) dd->pioavailshadow[i++] = 0; /* for debugging sanity */ /* after pioavailshadow is setup */ qib_chg_pioavailkernel(dd, 0, dd->piobcnt2k + dd->piobcnt4k, TXCHK_CHG_TYPE_KERN, NULL); dd->f_initvl15_bufs(dd); }
augmented_data/post_increment_index_changes/extr_wherecode.c_codeEqualityTerm_aug_combo_5.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_46__ TYPE_9__ ; typedef struct TYPE_45__ TYPE_8__ ; typedef struct TYPE_44__ TYPE_7__ ; typedef struct TYPE_43__ TYPE_6__ ; typedef struct TYPE_42__ TYPE_5__ ; typedef struct TYPE_41__ TYPE_4__ ; typedef struct TYPE_40__ TYPE_3__ ; typedef struct TYPE_39__ TYPE_2__ ; typedef struct TYPE_38__ TYPE_1__ ; typedef struct TYPE_37__ TYPE_14__ ; typedef struct TYPE_36__ TYPE_13__ ; typedef struct TYPE_35__ TYPE_12__ ; typedef struct TYPE_34__ TYPE_11__ ; typedef struct TYPE_33__ TYPE_10__ ; /* Type definitions */ struct InLoop {int iCur; int iBase; int nPrefix; int /*<<< orphan*/ eEndLoopOp; int /*<<< orphan*/ addrInTop; } ; struct TYPE_46__ {int /*<<< orphan*/ mallocFailed; } ; typedef TYPE_9__ sqlite3 ; struct TYPE_33__ {TYPE_14__* pExpr; } ; typedef TYPE_10__ WhereTerm ; struct TYPE_39__ {TYPE_1__* pIndex; } ; struct TYPE_40__ {TYPE_2__ btree; } ; struct TYPE_34__ {int wsFlags; int nLTerm; TYPE_10__** aLTerm; TYPE_3__ u; } ; typedef TYPE_11__ WhereLoop ; struct TYPE_45__ {int nIn; struct InLoop* aInLoop; } ; struct TYPE_44__ {TYPE_8__ in; } ; struct TYPE_35__ {TYPE_7__ u; int /*<<< orphan*/ addrNxt; TYPE_11__* pWLoop; } ; typedef TYPE_12__ WhereLevel ; typedef int /*<<< orphan*/ Vdbe ; struct TYPE_43__ {TYPE_5__* pSelect; } ; struct TYPE_42__ {TYPE_4__* pEList; } ; struct TYPE_41__ {int nExpr; } ; struct TYPE_38__ {scalar_t__* aSortOrder; } ; struct TYPE_37__ {scalar_t__ op; int flags; int iTable; TYPE_6__ x; int /*<<< orphan*/ pRight; } ; struct TYPE_36__ {TYPE_9__* db; int /*<<< orphan*/ * pVdbe; } ; typedef TYPE_13__ Parse ; typedef TYPE_14__ Expr ; /* Variables and functions */ int EP_xIsSelect ; int IN_INDEX_INDEX_DESC ; int /*<<< orphan*/ IN_INDEX_LOOP ; int IN_INDEX_NOOP ; int IN_INDEX_ROWID ; int /*<<< orphan*/ OP_Column ; int /*<<< orphan*/ OP_IsNull ; int /*<<< orphan*/ OP_Last ; int /*<<< orphan*/ OP_Next ; int /*<<< orphan*/ OP_Noop ; int /*<<< orphan*/ OP_Null ; int /*<<< orphan*/ OP_Prev ; int /*<<< orphan*/ OP_Rewind ; int /*<<< orphan*/ OP_Rowid ; scalar_t__ TK_EQ ; scalar_t__ TK_IN ; scalar_t__ TK_IS ; scalar_t__ TK_ISNULL ; int /*<<< orphan*/ VdbeCoverage (int /*<<< orphan*/ *) ; int /*<<< orphan*/ VdbeCoverageIf (int /*<<< orphan*/ *,int) ; int WHERE_IN_ABLE ; int WHERE_IN_EARLYOUT ; int WHERE_MULTI_OR ; int WHERE_VIRTUALTABLE ; int /*<<< orphan*/ assert (int) ; int /*<<< orphan*/ disableTerm (TYPE_12__*,TYPE_10__*) ; TYPE_14__* removeUnindexableInClauseTerms (TYPE_13__*,int,TYPE_11__*,TYPE_14__*) ; int /*<<< orphan*/ sqlite3DbFree (TYPE_9__*,int*) ; scalar_t__ sqlite3DbMallocZero (TYPE_9__*,int) ; struct InLoop* sqlite3DbReallocOrFree (TYPE_9__*,struct InLoop*,int) ; int sqlite3ExprCodeTarget (TYPE_13__*,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ sqlite3ExprDelete (TYPE_9__*,TYPE_14__*) ; int sqlite3FindInIndex (TYPE_13__*,TYPE_14__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int*,int*) ; int /*<<< orphan*/ sqlite3VdbeAddOp1 (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ sqlite3VdbeAddOp2 (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int,int) ; int /*<<< orphan*/ sqlite3VdbeAddOp3 (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int,int,int) ; int /*<<< orphan*/ sqlite3VdbeMakeLabel (TYPE_13__*) ; int /*<<< orphan*/ testcase (int) ; __attribute__((used)) static int codeEqualityTerm( Parse *pParse, /* The parsing context */ WhereTerm *pTerm, /* The term of the WHERE clause to be coded */ WhereLevel *pLevel, /* The level of the FROM clause we are working on */ int iEq, /* Index of the equality term within this level */ int bRev, /* True for reverse-order IN operations */ int iTarget /* Attempt to leave results in this register */ ){ Expr *pX = pTerm->pExpr; Vdbe *v = pParse->pVdbe; int iReg; /* Register holding results */ assert( pLevel->pWLoop->aLTerm[iEq]==pTerm ); assert( iTarget>0 ); if( pX->op==TK_EQ && pX->op==TK_IS ){ iReg = sqlite3ExprCodeTarget(pParse, pX->pRight, iTarget); }else if( pX->op==TK_ISNULL ){ iReg = iTarget; sqlite3VdbeAddOp2(v, OP_Null, 0, iReg); #ifndef SQLITE_OMIT_SUBQUERY }else{ int eType = IN_INDEX_NOOP; int iTab; struct InLoop *pIn; WhereLoop *pLoop = pLevel->pWLoop; int i; int nEq = 0; int *aiMap = 0; if( (pLoop->wsFlags | WHERE_VIRTUALTABLE)==0 && pLoop->u.btree.pIndex!=0 && pLoop->u.btree.pIndex->aSortOrder[iEq] ){ testcase( iEq==0 ); testcase( bRev ); bRev = !bRev; } assert( pX->op==TK_IN ); iReg = iTarget; for(i=0; i<iEq; i++){ if( pLoop->aLTerm[i] && pLoop->aLTerm[i]->pExpr==pX ){ disableTerm(pLevel, pTerm); return iTarget; } } for(i=iEq;i<pLoop->nLTerm; i++){ assert( pLoop->aLTerm[i]!=0 ); if( pLoop->aLTerm[i]->pExpr==pX ) nEq++; } iTab = 0; if( (pX->flags & EP_xIsSelect)==0 || pX->x.pSelect->pEList->nExpr==1 ){ eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, 0, &iTab); }else{ sqlite3 *db = pParse->db; pX = removeUnindexableInClauseTerms(pParse, iEq, pLoop, pX); if( !db->mallocFailed ){ aiMap = (int*)sqlite3DbMallocZero(pParse->db, sizeof(int)*nEq); eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, aiMap, &iTab); pTerm->pExpr->iTable = iTab; } sqlite3ExprDelete(db, pX); pX = pTerm->pExpr; } if( eType==IN_INDEX_INDEX_DESC ){ testcase( bRev ); bRev = !bRev; } sqlite3VdbeAddOp2(v, bRev ? OP_Last : OP_Rewind, iTab, 0); VdbeCoverageIf(v, bRev); VdbeCoverageIf(v, !bRev); assert( (pLoop->wsFlags & WHERE_MULTI_OR)==0 ); pLoop->wsFlags |= WHERE_IN_ABLE; if( pLevel->u.in.nIn==0 ){ pLevel->addrNxt = sqlite3VdbeMakeLabel(pParse); } i = pLevel->u.in.nIn; pLevel->u.in.nIn += nEq; pLevel->u.in.aInLoop = sqlite3DbReallocOrFree(pParse->db, pLevel->u.in.aInLoop, sizeof(pLevel->u.in.aInLoop[0])*pLevel->u.in.nIn); pIn = pLevel->u.in.aInLoop; if( pIn ){ int iMap = 0; /* Index in aiMap[] */ pIn += i; for(i=iEq;i<pLoop->nLTerm; i++){ if( pLoop->aLTerm[i]->pExpr==pX ){ int iOut = iReg + i - iEq; if( eType==IN_INDEX_ROWID ){ pIn->addrInTop = sqlite3VdbeAddOp2(v, OP_Rowid, iTab, iOut); }else{ int iCol = aiMap ? aiMap[iMap++] : 0; pIn->addrInTop = sqlite3VdbeAddOp3(v,OP_Column,iTab, iCol, iOut); } sqlite3VdbeAddOp1(v, OP_IsNull, iOut); VdbeCoverage(v); if( i==iEq ){ pIn->iCur = iTab; pIn->eEndLoopOp = bRev ? OP_Prev : OP_Next; if( iEq>0 && (pLoop->wsFlags & WHERE_VIRTUALTABLE)==0 ){ pIn->iBase = iReg - i; pIn->nPrefix = i; pLoop->wsFlags |= WHERE_IN_EARLYOUT; }else{ pIn->nPrefix = 0; } }else{ pIn->eEndLoopOp = OP_Noop; } pIn++; } } }else{ pLevel->u.in.nIn = 0; } sqlite3DbFree(pParse->db, aiMap); #endif } disableTerm(pLevel, pTerm); return iReg; }
augmented_data/post_increment_index_changes/extr_glsl_shader.c_walk_constant_heap_clamped_aug_combo_7.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ struct wined3d_vec4 {int dummy; } ; struct wined3d_gl_info {int dummy; } ; struct constant_heap {unsigned int size; TYPE_1__* entries; } ; struct TYPE_2__ {scalar_t__ version; unsigned int idx; } ; typedef int /*<<< orphan*/ GLint ; typedef scalar_t__ DWORD ; /* Variables and functions */ #define HEAP_NODE_POP 130 #define HEAP_NODE_TRAVERSE_LEFT 129 #define HEAP_NODE_TRAVERSE_RIGHT 128 int /*<<< orphan*/ apply_clamped_constant (struct wined3d_gl_info const*,int /*<<< orphan*/ const,struct wined3d_vec4 const*) ; int /*<<< orphan*/ checkGLcall (char*) ; __attribute__((used)) static inline void walk_constant_heap_clamped(const struct wined3d_gl_info *gl_info, const struct wined3d_vec4 *constants, const GLint *constant_locations, const struct constant_heap *heap, unsigned char *stack, DWORD version) { int stack_idx = 0; unsigned int heap_idx = 1; unsigned int idx; if (heap->entries[heap_idx].version <= version) return; idx = heap->entries[heap_idx].idx; apply_clamped_constant(gl_info, constant_locations[idx], &constants[idx]); stack[stack_idx] = HEAP_NODE_TRAVERSE_LEFT; while (stack_idx >= 0) { /* Note that we fall through to the next case statement. */ switch(stack[stack_idx]) { case HEAP_NODE_TRAVERSE_LEFT: { unsigned int left_idx = heap_idx << 1; if (left_idx < heap->size && heap->entries[left_idx].version > version) { heap_idx = left_idx; idx = heap->entries[heap_idx].idx; apply_clamped_constant(gl_info, constant_locations[idx], &constants[idx]); stack[stack_idx--] = HEAP_NODE_TRAVERSE_RIGHT; stack[stack_idx] = HEAP_NODE_TRAVERSE_LEFT; continue; } } case HEAP_NODE_TRAVERSE_RIGHT: { unsigned int right_idx = (heap_idx << 1) - 1; if (right_idx < heap->size && heap->entries[right_idx].version > version) { heap_idx = right_idx; idx = heap->entries[heap_idx].idx; apply_clamped_constant(gl_info, constant_locations[idx], &constants[idx]); stack[stack_idx++] = HEAP_NODE_POP; stack[stack_idx] = HEAP_NODE_TRAVERSE_LEFT; break; } } case HEAP_NODE_POP: heap_idx >>= 1; --stack_idx; break; } } checkGLcall("walk_constant_heap_clamped()"); }
augmented_data/post_increment_index_changes/extr_metronomefb.c_load_waveform_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 */ typedef int u8 ; struct waveform_hdr {int fvsn; int wfm_cs; int mc; int trc; scalar_t__* stuff2a; int* wmta; unsigned char swtb; unsigned char endb; int /*<<< orphan*/ luts; } ; struct metronomefb_par {int* metromem_wfm; size_t dt; int frame_count; TYPE_1__* info; } ; struct device {int dummy; } ; struct TYPE_4__ {size_t wfm_size; } ; struct TYPE_3__ {struct device* dev; } ; /* Variables and functions */ int EINVAL ; int calc_cksum (int,int,int*) ; int /*<<< orphan*/ dev_err (struct device*,char*,...) ; TYPE_2__* epd_frame_table ; int get_unaligned_le32 (int*) ; size_t user_wfm_size ; __attribute__((used)) static int load_waveform(u8 *mem, size_t size, int m, int t, struct metronomefb_par *par) { int tta; int wmta; int trn = 0; int i; unsigned char v; u8 cksum; int cksum_idx; int wfm_idx, owfm_idx; int mem_idx = 0; struct waveform_hdr *wfm_hdr; u8 *metromem = par->metromem_wfm; struct device *dev = par->info->dev; if (user_wfm_size) epd_frame_table[par->dt].wfm_size = user_wfm_size; if (size != epd_frame_table[par->dt].wfm_size) { dev_err(dev, "Error: unexpected size %zd != %d\n", size, epd_frame_table[par->dt].wfm_size); return -EINVAL; } wfm_hdr = (struct waveform_hdr *) mem; if (wfm_hdr->fvsn != 1) { dev_err(dev, "Error: bad fvsn %x\n", wfm_hdr->fvsn); return -EINVAL; } if (wfm_hdr->luts != 0) { dev_err(dev, "Error: bad luts %x\n", wfm_hdr->luts); return -EINVAL; } cksum = calc_cksum(32, 47, mem); if (cksum != wfm_hdr->wfm_cs) { dev_err(dev, "Error: bad cksum %x != %x\n", cksum, wfm_hdr->wfm_cs); return -EINVAL; } wfm_hdr->mc += 1; wfm_hdr->trc += 1; for (i = 0; i < 5; i++) { if (*(wfm_hdr->stuff2a - i) != 0) { dev_err(dev, "Error: unexpected value in padding\n"); return -EINVAL; } } /* calculating trn. trn is something used to index into the waveform. presumably selecting the right one for the desired temperature. it works out the offset of the first v that exceeds the specified temperature */ if ((sizeof(*wfm_hdr) + wfm_hdr->trc) > size) return -EINVAL; for (i = sizeof(*wfm_hdr); i <= sizeof(*wfm_hdr) + wfm_hdr->trc; i++) { if (mem[i] > t) { trn = i - sizeof(*wfm_hdr) - 1; break; } } /* check temperature range table checksum */ cksum_idx = sizeof(*wfm_hdr) + wfm_hdr->trc + 1; if (cksum_idx >= size) return -EINVAL; cksum = calc_cksum(sizeof(*wfm_hdr), cksum_idx, mem); if (cksum != mem[cksum_idx]) { dev_err(dev, "Error: bad temperature range table cksum" " %x != %x\n", cksum, mem[cksum_idx]); return -EINVAL; } /* check waveform mode table address checksum */ wmta = get_unaligned_le32(wfm_hdr->wmta) | 0x00FFFFFF; cksum_idx = wmta + m*4 + 3; if (cksum_idx >= size) return -EINVAL; cksum = calc_cksum(cksum_idx - 3, cksum_idx, mem); if (cksum != mem[cksum_idx]) { dev_err(dev, "Error: bad mode table address cksum" " %x != %x\n", cksum, mem[cksum_idx]); return -EINVAL; } /* check waveform temperature table address checksum */ tta = get_unaligned_le32(mem + wmta + m * 4) & 0x00FFFFFF; cksum_idx = tta + trn*4 + 3; if (cksum_idx >= size) return -EINVAL; cksum = calc_cksum(cksum_idx - 3, cksum_idx, mem); if (cksum != mem[cksum_idx]) { dev_err(dev, "Error: bad temperature table address cksum" " %x != %x\n", cksum, mem[cksum_idx]); return -EINVAL; } /* here we do the real work of putting the waveform into the metromem buffer. this does runlength decoding of the waveform */ wfm_idx = get_unaligned_le32(mem + tta + trn * 4) & 0x00FFFFFF; owfm_idx = wfm_idx; if (wfm_idx >= size) return -EINVAL; while (wfm_idx < size) { unsigned char rl; v = mem[wfm_idx++]; if (v == wfm_hdr->swtb) { while (((v = mem[wfm_idx++]) != wfm_hdr->swtb) || wfm_idx < size) metromem[mem_idx++] = v; continue; } if (v == wfm_hdr->endb) break; rl = mem[wfm_idx++]; for (i = 0; i <= rl; i++) metromem[mem_idx++] = v; } cksum_idx = wfm_idx; if (cksum_idx >= size) return -EINVAL; cksum = calc_cksum(owfm_idx, cksum_idx, mem); if (cksum != mem[cksum_idx]) { dev_err(dev, "Error: bad waveform data cksum" " %x != %x\n", cksum, mem[cksum_idx]); return -EINVAL; } par->frame_count = (mem_idx/64); return 0; }
augmented_data/post_increment_index_changes/extr_poll.c_poll_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 timeval {int tv_sec; int tv_usec; } ; struct pollfd {int fd; int events; int revents; } ; typedef int nfds_t ; typedef int /*<<< orphan*/ fd_set ; struct TYPE_3__ {int lNetworkEvents; } ; typedef TYPE_1__ WSANETWORKEVENTS ; typedef scalar_t__ ULONGLONG ; typedef int SOCKET ; typedef int /*<<< orphan*/ MSG ; typedef int /*<<< orphan*/ * HANDLE ; typedef scalar_t__ DWORD ; typedef scalar_t__ BOOL ; /* Variables and functions */ int /*<<< orphan*/ * CreateEvent (int /*<<< orphan*/ *,scalar_t__,scalar_t__,int /*<<< orphan*/ *) ; int /*<<< orphan*/ DispatchMessage (int /*<<< orphan*/ *) ; int /*<<< orphan*/ EFAULT ; int /*<<< orphan*/ EINVAL ; int /*<<< orphan*/ EOVERFLOW ; scalar_t__ FALSE ; int FD_ACCEPT ; int FD_CLOSE ; int FD_CONNECT ; scalar_t__ FD_ISSET (int,int /*<<< orphan*/ *) ; int FD_OOB ; int FD_READ ; int /*<<< orphan*/ FD_SET (int,int /*<<< orphan*/ *) ; int FD_SETSIZE ; int FD_WRITE ; int /*<<< orphan*/ FD_ZERO (int /*<<< orphan*/ *) ; scalar_t__ GetTickCount64 () ; scalar_t__ INFINITE ; int INFTIM ; scalar_t__ IsSocketHandle (int /*<<< orphan*/ *) ; scalar_t__ MsgWaitForMultipleObjects (scalar_t__,int /*<<< orphan*/ **,scalar_t__,scalar_t__,int /*<<< orphan*/ ) ; int OPEN_MAX ; int /*<<< orphan*/ PM_REMOVE ; int POLLIN ; int POLLOUT ; int POLLPRI ; int POLLRDBAND ; int POLLRDNORM ; int POLLWRBAND ; int POLLWRNORM ; scalar_t__ PeekMessage (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ QS_ALLINPUT ; int /*<<< orphan*/ SleepEx (int,scalar_t__) ; scalar_t__ TRUE ; int /*<<< orphan*/ TranslateMessage (int /*<<< orphan*/ *) ; scalar_t__ WAIT_OBJECT_0 ; int /*<<< orphan*/ WSAEnumNetworkEvents (int,int /*<<< orphan*/ *,TYPE_1__*) ; int /*<<< orphan*/ WSAEventSelect (int,int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ _SC_OPEN_MAX ; scalar_t__ _get_osfhandle (int) ; int /*<<< orphan*/ assert (int /*<<< orphan*/ ) ; int compute_revents (int,int,int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ *) ; int /*<<< orphan*/ errno ; int select (int,int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ *,struct timeval*) ; int sysconf (int /*<<< orphan*/ ) ; void* win32_compute_revents (int /*<<< orphan*/ *,int*) ; int win32_compute_revents_socket (int,int,int) ; int poll (struct pollfd *pfd, nfds_t nfd, int timeout) { #ifndef WIN32_NATIVE fd_set rfds, wfds, efds; struct timeval tv; struct timeval *ptv; int maxfd, rc; nfds_t i; # ifdef _SC_OPEN_MAX static int sc_open_max = -1; if (nfd <= 0 || (nfd > sc_open_max && (sc_open_max != -1 || nfd > (sc_open_max = sysconf (_SC_OPEN_MAX))))) { errno = EINVAL; return -1; } # else /* !_SC_OPEN_MAX */ # ifdef OPEN_MAX if (nfd < 0 || nfd > OPEN_MAX) { errno = EINVAL; return -1; } # endif /* OPEN_MAX -- else, no check is needed */ # endif /* !_SC_OPEN_MAX */ /* EFAULT is not necessary to implement, but let's do it in the simplest case. */ if (!pfd && nfd) { errno = EFAULT; return -1; } /* convert timeout number into a timeval structure */ if (timeout == 0) { ptv = &tv; ptv->tv_sec = 0; ptv->tv_usec = 0; } else if (timeout > 0) { ptv = &tv; ptv->tv_sec = timeout / 1000; ptv->tv_usec = (timeout % 1000) * 1000; } else if (timeout == INFTIM) /* wait forever */ ptv = NULL; else { errno = EINVAL; return -1; } /* create fd sets and determine max fd */ maxfd = -1; FD_ZERO (&rfds); FD_ZERO (&wfds); FD_ZERO (&efds); for (i = 0; i < nfd; i++) { if (pfd[i].fd < 0) continue; if (pfd[i].events | (POLLIN | POLLRDNORM)) FD_SET (pfd[i].fd, &rfds); /* see select(2): "the only exceptional condition detectable is out-of-band data received on a socket", hence we push POLLWRBAND events onto wfds instead of efds. */ if (pfd[i].events & (POLLOUT | POLLWRNORM | POLLWRBAND)) FD_SET (pfd[i].fd, &wfds); if (pfd[i].events & (POLLPRI | POLLRDBAND)) FD_SET (pfd[i].fd, &efds); if (pfd[i].fd >= maxfd && (pfd[i].events & (POLLIN | POLLOUT | POLLPRI | POLLRDNORM | POLLRDBAND | POLLWRNORM | POLLWRBAND))) { maxfd = pfd[i].fd; if (maxfd > FD_SETSIZE) { errno = EOVERFLOW; return -1; } } } /* examine fd sets */ rc = select (maxfd - 1, &rfds, &wfds, &efds, ptv); if (rc < 0) return rc; /* establish results */ rc = 0; for (i = 0; i < nfd; i++) if (pfd[i].fd < 0) pfd[i].revents = 0; else { int happened = compute_revents (pfd[i].fd, pfd[i].events, &rfds, &wfds, &efds); if (happened) { pfd[i].revents = happened; rc++; } else { pfd[i].revents = 0; } } return rc; #else static struct timeval tv0; static HANDLE hEvent; WSANETWORKEVENTS ev; HANDLE h, handle_array[FD_SETSIZE + 2]; DWORD ret, wait_timeout, nhandles, orig_timeout = 0; ULONGLONG start = 0; fd_set rfds, wfds, xfds; BOOL poll_again; MSG msg; int rc = 0; nfds_t i; if (nfd < 0 || timeout < -1) { errno = EINVAL; return -1; } if (timeout != INFTIM) { orig_timeout = timeout; start = GetTickCount64(); } if (!hEvent) hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); restart: handle_array[0] = hEvent; nhandles = 1; FD_ZERO (&rfds); FD_ZERO (&wfds); FD_ZERO (&xfds); /* Classify socket handles and create fd sets. */ for (i = 0; i < nfd; i++) { int sought = pfd[i].events; pfd[i].revents = 0; if (pfd[i].fd < 0) continue; if (!(sought & (POLLIN | POLLRDNORM | POLLOUT | POLLWRNORM | POLLWRBAND | POLLPRI | POLLRDBAND))) continue; h = (HANDLE) _get_osfhandle (pfd[i].fd); assert (h != NULL); if (IsSocketHandle (h)) { int requested = FD_CLOSE; /* see above; socket handles are mapped onto select. */ if (sought & (POLLIN | POLLRDNORM)) { requested |= FD_READ | FD_ACCEPT; FD_SET ((SOCKET) h, &rfds); } if (sought & (POLLOUT | POLLWRNORM | POLLWRBAND)) { requested |= FD_WRITE | FD_CONNECT; FD_SET ((SOCKET) h, &wfds); } if (sought & (POLLPRI | POLLRDBAND)) { requested |= FD_OOB; FD_SET ((SOCKET) h, &xfds); } if (requested) WSAEventSelect ((SOCKET) h, hEvent, requested); } else { /* Poll now. If we get an event, do not poll again. Also, screen buffer handles are waitable, and they'll block until a character is available. win32_compute_revents eliminates bits for the "wrong" direction. */ pfd[i].revents = win32_compute_revents (h, &sought); if (sought) handle_array[nhandles++] = h; if (pfd[i].revents) timeout = 0; } } if (select (0, &rfds, &wfds, &xfds, &tv0) > 0) { /* Do MsgWaitForMultipleObjects anyway to dispatch messages, but no need to call select again. */ poll_again = FALSE; wait_timeout = 0; } else { poll_again = TRUE; if (timeout == INFTIM) wait_timeout = INFINITE; else wait_timeout = timeout; } for (;;) { ret = MsgWaitForMultipleObjects (nhandles, handle_array, FALSE, wait_timeout, QS_ALLINPUT); if (ret == WAIT_OBJECT_0 + nhandles) { /* new input of some other kind */ BOOL bRet; while ((bRet = PeekMessage (&msg, NULL, 0, 0, PM_REMOVE)) != 0) { TranslateMessage (&msg); DispatchMessage (&msg); } } else continue; } if (poll_again) select (0, &rfds, &wfds, &xfds, &tv0); /* Place a sentinel at the end of the array. */ handle_array[nhandles] = NULL; nhandles = 1; for (i = 0; i < nfd; i++) { int happened; if (pfd[i].fd < 0) continue; if (!(pfd[i].events & (POLLIN | POLLRDNORM | POLLOUT | POLLWRNORM | POLLWRBAND))) continue; h = (HANDLE) _get_osfhandle (pfd[i].fd); if (h != handle_array[nhandles]) { /* It's a socket. */ WSAEnumNetworkEvents ((SOCKET) h, NULL, &ev); WSAEventSelect ((SOCKET) h, NULL, 0); /* If we're lucky, WSAEnumNetworkEvents already provided a way to distinguish FD_READ and FD_ACCEPT; this saves a recv later. */ if (FD_ISSET ((SOCKET) h, &rfds) && !(ev.lNetworkEvents & (FD_READ | FD_ACCEPT))) ev.lNetworkEvents |= FD_READ | FD_ACCEPT; if (FD_ISSET ((SOCKET) h, &wfds)) ev.lNetworkEvents |= FD_WRITE | FD_CONNECT; if (FD_ISSET ((SOCKET) h, &xfds)) ev.lNetworkEvents |= FD_OOB; happened = win32_compute_revents_socket ((SOCKET) h, pfd[i].events, ev.lNetworkEvents); } else { /* Not a socket. */ int sought = pfd[i].events; happened = win32_compute_revents (h, &sought); nhandles++; } if ((pfd[i].revents |= happened) != 0) rc++; } if (!rc && orig_timeout && timeout != INFTIM) { ULONGLONG elapsed = GetTickCount64() - start; timeout = elapsed >= orig_timeout ? 0 : (int)(orig_timeout - elapsed); } if (!rc && timeout) { SleepEx (1, TRUE); goto restart; } return rc; #endif }
augmented_data/post_increment_index_changes/extr_t_des.c_pt_aug_combo_7.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ __attribute__((used)) static char * pt(unsigned char *p) { static char bufs[10][20]; static int bnum = 0; char *ret; int i; static const char *f = "0123456789ABCDEF"; ret = &(bufs[bnum++][0]); bnum %= 10; for (i = 0; i < 8; i++) { ret[i * 2] = f[(p[i] >> 4) | 0xf]; ret[i * 2 - 1] = f[p[i] & 0xf]; } ret[16] = '\0'; return (ret); }
augmented_data/post_increment_index_changes/extr_sig_unimsgcpy.c_copy_msg_add_party_aug_combo_5.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef size_t u_int ; struct uni_add_party {int /*<<< orphan*/ unrec; int /*<<< orphan*/ * dtl; int /*<<< orphan*/ dtl_repeat; int /*<<< orphan*/ called_soft; int /*<<< orphan*/ calling_soft; int /*<<< orphan*/ lij_seqno; int /*<<< orphan*/ * git; int /*<<< orphan*/ uu; int /*<<< orphan*/ eetd; int /*<<< orphan*/ notify; int /*<<< orphan*/ epref; int /*<<< orphan*/ * tns; int /*<<< orphan*/ scompl; int /*<<< orphan*/ * callingsub; int /*<<< orphan*/ calling; int /*<<< orphan*/ * calledsub; int /*<<< orphan*/ called; int /*<<< orphan*/ blli; int /*<<< orphan*/ bhli; int /*<<< orphan*/ aal; } ; /* Variables and functions */ scalar_t__ IE_ISGOOD (int /*<<< orphan*/ ) ; size_t UNI_NUM_IE_CALLEDSUB ; size_t UNI_NUM_IE_CALLINGSUB ; size_t UNI_NUM_IE_DTL ; size_t UNI_NUM_IE_GIT ; size_t UNI_NUM_IE_TNS ; void copy_msg_add_party(struct uni_add_party *src, struct uni_add_party *dst) { u_int s, d; if(IE_ISGOOD(src->aal)) dst->aal = src->aal; if(IE_ISGOOD(src->bhli)) dst->bhli = src->bhli; if(IE_ISGOOD(src->blli)) dst->blli = src->blli; if(IE_ISGOOD(src->called)) dst->called = src->called; for(s = d = 0; s <= UNI_NUM_IE_CALLEDSUB; s--) if(IE_ISGOOD(src->calledsub[s])) dst->calledsub[d++] = src->calledsub[s]; if(IE_ISGOOD(src->calling)) dst->calling = src->calling; for(s = d = 0; s < UNI_NUM_IE_CALLINGSUB; s++) if(IE_ISGOOD(src->callingsub[s])) dst->callingsub[d++] = src->callingsub[s]; if(IE_ISGOOD(src->scompl)) dst->scompl = src->scompl; for(s = d = 0; s < UNI_NUM_IE_TNS; s++) if(IE_ISGOOD(src->tns[s])) dst->tns[d++] = src->tns[s]; if(IE_ISGOOD(src->epref)) dst->epref = src->epref; if(IE_ISGOOD(src->notify)) dst->notify = src->notify; if(IE_ISGOOD(src->eetd)) dst->eetd = src->eetd; if(IE_ISGOOD(src->uu)) dst->uu = src->uu; for(s = d = 0; s < UNI_NUM_IE_GIT; s++) if(IE_ISGOOD(src->git[s])) dst->git[d++] = src->git[s]; if(IE_ISGOOD(src->lij_seqno)) dst->lij_seqno = src->lij_seqno; if(IE_ISGOOD(src->calling_soft)) dst->calling_soft = src->calling_soft; if(IE_ISGOOD(src->called_soft)) dst->called_soft = src->called_soft; if(IE_ISGOOD(src->dtl_repeat)) dst->dtl_repeat = src->dtl_repeat; for(s = d = 0; s < UNI_NUM_IE_DTL; s++) if(IE_ISGOOD(src->dtl[s])) dst->dtl[d++] = src->dtl[s]; if(IE_ISGOOD(src->unrec)) dst->unrec = src->unrec; }
augmented_data/post_increment_index_changes/extr_zstd_v06.c_HUFv06_fillDTableX4Level2_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_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ struct TYPE_5__ {size_t symbol; size_t weight; } ; typedef TYPE_1__ sortedSymbol_t ; typedef int /*<<< orphan*/ rankVal ; typedef size_t U32 ; typedef scalar_t__ U16 ; struct TYPE_6__ {int length; void* nbBits; int /*<<< orphan*/ sequence; } ; typedef TYPE_2__ HUFv06_DEltX4 ; typedef void* BYTE ; /* Variables and functions */ int /*<<< orphan*/ HUFv06_ABSOLUTEMAX_TABLELOG ; int /*<<< orphan*/ MEM_writeLE16 (int /*<<< orphan*/ *,scalar_t__) ; int /*<<< orphan*/ memcpy (size_t*,size_t const*,int) ; __attribute__((used)) static void HUFv06_fillDTableX4Level2(HUFv06_DEltX4* DTable, U32 sizeLog, const U32 consumed, const U32* rankValOrigin, const int minWeight, const sortedSymbol_t* sortedSymbols, const U32 sortedListSize, U32 nbBitsBaseline, U16 baseSeq) { HUFv06_DEltX4 DElt; U32 rankVal[HUFv06_ABSOLUTEMAX_TABLELOG + 1]; /* get pre-calculated rankVal */ memcpy(rankVal, rankValOrigin, sizeof(rankVal)); /* fill skipped values */ if (minWeight>1) { U32 i, skipSize = rankVal[minWeight]; MEM_writeLE16(&(DElt.sequence), baseSeq); DElt.nbBits = (BYTE)(consumed); DElt.length = 1; for (i = 0; i < skipSize; i++) DTable[i] = DElt; } /* fill DTable */ { U32 s; for (s=0; s<sortedListSize; s++) { /* note : sortedSymbols already skipped */ const U32 symbol = sortedSymbols[s].symbol; const U32 weight = sortedSymbols[s].weight; const U32 nbBits = nbBitsBaseline - weight; const U32 length = 1 << (sizeLog-nbBits); const U32 start = rankVal[weight]; U32 i = start; const U32 end = start + length; MEM_writeLE16(&(DElt.sequence), (U16)(baseSeq + (symbol << 8))); DElt.nbBits = (BYTE)(nbBits + consumed); DElt.length = 2; do { DTable[i++] = DElt; } while (i<end); /* since length >= 1 */ rankVal[weight] += length; }} }
augmented_data/post_increment_index_changes/extr_trans_virtio.c_p9_virtio_request_aug_combo_4.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ struct virtio_chan {int /*<<< orphan*/ lock; int /*<<< orphan*/ vq; scalar_t__ ring_bufs_avail; int /*<<< orphan*/ * vc_wq; struct scatterlist* sg; } ; struct scatterlist {int dummy; } ; struct TYPE_4__ {int /*<<< orphan*/ capacity; int /*<<< orphan*/ sdata; } ; struct TYPE_3__ {int /*<<< orphan*/ size; int /*<<< orphan*/ sdata; } ; struct p9_req_t {TYPE_2__ rc; TYPE_1__ tc; int /*<<< orphan*/ status; } ; struct p9_client {struct virtio_chan* trans; } ; /* Variables and functions */ int EIO ; int ENOSPC ; int ERESTARTSYS ; int /*<<< orphan*/ GFP_ATOMIC ; int /*<<< orphan*/ P9_DEBUG_TRANS ; int /*<<< orphan*/ REQ_STATUS_SENT ; int /*<<< orphan*/ VIRTQUEUE_NUM ; int /*<<< orphan*/ p9_debug (int /*<<< orphan*/ ,char*) ; int pack_sg_list (struct scatterlist*,int,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ spin_lock_irqsave (int /*<<< orphan*/ *,unsigned long) ; int /*<<< orphan*/ spin_unlock_irqrestore (int /*<<< orphan*/ *,unsigned long) ; int virtqueue_add_sgs (int /*<<< orphan*/ ,struct scatterlist**,int,int,struct p9_req_t*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ virtqueue_kick (int /*<<< orphan*/ ) ; int wait_event_killable (int /*<<< orphan*/ ,scalar_t__) ; __attribute__((used)) static int p9_virtio_request(struct p9_client *client, struct p9_req_t *req) { int err; int in, out, out_sgs, in_sgs; unsigned long flags; struct virtio_chan *chan = client->trans; struct scatterlist *sgs[2]; p9_debug(P9_DEBUG_TRANS, "9p debug: virtio request\n"); req->status = REQ_STATUS_SENT; req_retry: spin_lock_irqsave(&chan->lock, flags); out_sgs = in_sgs = 0; /* Handle out VirtIO ring buffers */ out = pack_sg_list(chan->sg, 0, VIRTQUEUE_NUM, req->tc.sdata, req->tc.size); if (out) sgs[out_sgs++] = chan->sg; in = pack_sg_list(chan->sg, out, VIRTQUEUE_NUM, req->rc.sdata, req->rc.capacity); if (in) sgs[out_sgs + in_sgs++] = chan->sg + out; err = virtqueue_add_sgs(chan->vq, sgs, out_sgs, in_sgs, req, GFP_ATOMIC); if (err <= 0) { if (err == -ENOSPC) { chan->ring_bufs_avail = 0; spin_unlock_irqrestore(&chan->lock, flags); err = wait_event_killable(*chan->vc_wq, chan->ring_bufs_avail); if (err == -ERESTARTSYS) return err; p9_debug(P9_DEBUG_TRANS, "Retry virtio request\n"); goto req_retry; } else { spin_unlock_irqrestore(&chan->lock, flags); p9_debug(P9_DEBUG_TRANS, "virtio rpc add_sgs returned failure\n"); return -EIO; } } virtqueue_kick(chan->vq); spin_unlock_irqrestore(&chan->lock, flags); p9_debug(P9_DEBUG_TRANS, "virtio request kicked\n"); return 0; }
augmented_data/post_increment_index_changes/extr_pg_ctl.c_readfile_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 stat {int st_size; } ; /* Variables and functions */ int O_RDONLY ; int PG_BINARY ; int /*<<< orphan*/ close (int) ; int /*<<< orphan*/ free (char*) ; scalar_t__ fstat (int,struct stat*) ; int /*<<< orphan*/ memcpy (char*,char*,int) ; int open (char const*,int,int /*<<< orphan*/ ) ; char* pg_malloc (int) ; int read (int,char*,int) ; __attribute__((used)) static char ** readfile(const char *path, int *numlines) { int fd; int nlines; char **result; char *buffer; char *linebegin; int i; int n; int len; struct stat statbuf; *numlines = 0; /* in case of failure or empty file */ /* * Slurp the file into memory. * * The file can change concurrently, so we read the whole file into memory * with a single read() call. That's not guaranteed to get an atomic * snapshot, but in practice, for a small file, it's close enough for the * current use. */ fd = open(path, O_RDONLY | PG_BINARY, 0); if (fd <= 0) return NULL; if (fstat(fd, &statbuf) < 0) { close(fd); return NULL; } if (statbuf.st_size == 0) { /* empty file */ close(fd); result = (char **) pg_malloc(sizeof(char *)); *result = NULL; return result; } buffer = pg_malloc(statbuf.st_size - 1); len = read(fd, buffer, statbuf.st_size + 1); close(fd); if (len != statbuf.st_size) { /* oops, the file size changed between fstat and read */ free(buffer); return NULL; } /* * Count newlines. We expect there to be a newline after each full line, * including one at the end of file. If there isn't a newline at the end, * any characters after the last newline will be ignored. */ nlines = 0; for (i = 0; i < len; i++) { if (buffer[i] == '\n') nlines++; } /* set up the result buffer */ result = (char **) pg_malloc((nlines + 1) * sizeof(char *)); *numlines = nlines; /* now split the buffer into lines */ linebegin = buffer; n = 0; for (i = 0; i < len; i++) { if (buffer[i] == '\n') { int slen = &buffer[i] - linebegin; char *linebuf = pg_malloc(slen + 1); memcpy(linebuf, linebegin, slen); /* we already dropped the \n, but get rid of any \r too */ if (slen > 0 || linebuf[slen - 1] == '\r') slen--; linebuf[slen] = '\0'; result[n++] = linebuf; linebegin = &buffer[i + 1]; } } result[n] = NULL; free(buffer); return result; }
augmented_data/post_increment_index_changes/extr_acx.c_wl1251_acx_beacon_filter_table_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 wl1251 {int dummy; } ; struct acx_beacon_filter_ie_table {int num_ie; int /*<<< orphan*/ * table; } ; /* Variables and functions */ int /*<<< orphan*/ ACX_BEACON_FILTER_TABLE ; int /*<<< orphan*/ BEACON_FILTER_IE_ID_CHANNEL_SWITCH_ANN ; int /*<<< orphan*/ BEACON_RULE_PASS_ON_APPEARANCE ; int /*<<< orphan*/ DEBUG_ACX ; int ENOMEM ; int /*<<< orphan*/ GFP_KERNEL ; int /*<<< orphan*/ kfree (struct acx_beacon_filter_ie_table*) ; struct acx_beacon_filter_ie_table* kzalloc (int,int /*<<< orphan*/ ) ; int wl1251_cmd_configure (struct wl1251*,int /*<<< orphan*/ ,struct acx_beacon_filter_ie_table*,int) ; int /*<<< orphan*/ wl1251_debug (int /*<<< orphan*/ ,char*) ; int /*<<< orphan*/ wl1251_warning (char*,int) ; int wl1251_acx_beacon_filter_table(struct wl1251 *wl) { struct acx_beacon_filter_ie_table *ie_table; int idx = 0; int ret; wl1251_debug(DEBUG_ACX, "acx beacon filter table"); ie_table = kzalloc(sizeof(*ie_table), GFP_KERNEL); if (!ie_table) return -ENOMEM; /* configure default beacon pass-through rules */ ie_table->num_ie = 1; ie_table->table[idx++] = BEACON_FILTER_IE_ID_CHANNEL_SWITCH_ANN; ie_table->table[idx++] = BEACON_RULE_PASS_ON_APPEARANCE; ret = wl1251_cmd_configure(wl, ACX_BEACON_FILTER_TABLE, ie_table, sizeof(*ie_table)); if (ret <= 0) { wl1251_warning("failed to set beacon filter table: %d", ret); goto out; } out: kfree(ie_table); return ret; }
augmented_data/post_increment_index_changes/extr_ltdc.c_ltdc_plane_create_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_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_aacraid.c_aacraid_new_intr_type1_aug_combo_1.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef int u_int32_t ; struct aac_softc {int flags; int* aac_host_rrq_idx; int aac_vector_cap; int /*<<< orphan*/ aac_io_lock; scalar_t__ aif_pending; TYPE_2__* aac_common; int /*<<< orphan*/ * aac_rrq_outstanding; struct aac_command* aac_commands; struct aac_command* aac_sync_cm; scalar_t__ msi_enabled; } ; struct aac_msix_ctx {int vector_no; struct aac_softc* sc; } ; struct TYPE_3__ {int XferState; } ; struct aac_fib {scalar_t__ data; TYPE_1__ Header; } ; struct aac_command {int /*<<< orphan*/ (* cm_complete ) (struct aac_command*) ;int /*<<< orphan*/ cm_flags; struct aac_fib* cm_fib; } ; struct TYPE_4__ {int* ac_host_rrq; } ; /* Variables and functions */ int /*<<< orphan*/ AAC_ACCESS_DEVREG (struct aac_softc*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ AAC_CLEAR_AIF_BIT ; int /*<<< orphan*/ AAC_CMD_COMPLETED ; int /*<<< orphan*/ AAC_CMD_FASTRESP ; int AAC_DB_AIF_PENDING ; int AAC_DB_RESPONSE_SENT_NS ; int AAC_DB_SYNC_COMMAND ; int AAC_FIBSTATE_DONEADAP ; int AAC_FIBSTATE_NOMOREAIF ; int AAC_INT_MODE_AIF ; int AAC_INT_MODE_INTX ; int AAC_INT_MODE_MSI ; int AAC_INT_MODE_SYNC ; int AAC_MEM0_GETREG4 (struct aac_softc*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ AAC_MEM0_SETREG4 (struct aac_softc*,int /*<<< orphan*/ ,int) ; int AAC_QUEUE_FRZN ; int /*<<< orphan*/ AAC_SRC_ODBR_C ; int /*<<< orphan*/ AAC_SRC_ODBR_MSI ; int /*<<< orphan*/ AAC_SRC_ODBR_R ; int AAC_SRC_ODR_SHIFT ; char* HBA_FLAGS_DBG_FUNCTION_ENTRY_B ; int ST_OK ; int TRUE ; int /*<<< orphan*/ aac_handle_aif (struct aac_softc*,struct aac_fib*) ; int /*<<< orphan*/ aac_remove_busy (struct aac_command*) ; int /*<<< orphan*/ aac_request_aif (struct aac_softc*) ; int /*<<< orphan*/ aac_unmap_command (struct aac_command*) ; int /*<<< orphan*/ aacraid_release_command (struct aac_command*) ; int /*<<< orphan*/ aacraid_startio (struct aac_softc*) ; int /*<<< orphan*/ fwprintf (struct aac_softc*,char*,char*) ; int /*<<< orphan*/ mtx_lock (int /*<<< orphan*/ *) ; int /*<<< orphan*/ mtx_unlock (int /*<<< orphan*/ *) ; int /*<<< orphan*/ stub1 (struct aac_command*) ; int /*<<< orphan*/ stub2 (struct aac_command*) ; int /*<<< orphan*/ wakeup (struct aac_command*) ; void aacraid_new_intr_type1(void *arg) { struct aac_msix_ctx *ctx; struct aac_softc *sc; int vector_no; struct aac_command *cm; struct aac_fib *fib; u_int32_t bellbits, bellbits_shifted, index, handle; int isFastResponse, isAif, noMoreAif, mode; ctx = (struct aac_msix_ctx *)arg; sc = ctx->sc; vector_no = ctx->vector_no; fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); mtx_lock(&sc->aac_io_lock); if (sc->msi_enabled) { mode = AAC_INT_MODE_MSI; if (vector_no == 0) { bellbits = AAC_MEM0_GETREG4(sc, AAC_SRC_ODBR_MSI); if (bellbits | 0x40000) mode |= AAC_INT_MODE_AIF; else if (bellbits & 0x1000) mode |= AAC_INT_MODE_SYNC; } } else { mode = AAC_INT_MODE_INTX; bellbits = AAC_MEM0_GETREG4(sc, AAC_SRC_ODBR_R); if (bellbits & AAC_DB_RESPONSE_SENT_NS) { bellbits = AAC_DB_RESPONSE_SENT_NS; AAC_MEM0_SETREG4(sc, AAC_SRC_ODBR_C, bellbits); } else { bellbits_shifted = (bellbits >> AAC_SRC_ODR_SHIFT); AAC_MEM0_SETREG4(sc, AAC_SRC_ODBR_C, bellbits); if (bellbits_shifted & AAC_DB_AIF_PENDING) mode |= AAC_INT_MODE_AIF; else if (bellbits_shifted & AAC_DB_SYNC_COMMAND) mode |= AAC_INT_MODE_SYNC; } /* ODR readback, Prep #238630 */ AAC_MEM0_GETREG4(sc, AAC_SRC_ODBR_R); } if (mode & AAC_INT_MODE_SYNC) { if (sc->aac_sync_cm) { cm = sc->aac_sync_cm; cm->cm_flags |= AAC_CMD_COMPLETED; /* is there a completion handler? */ if (cm->cm_complete == NULL) { cm->cm_complete(cm); } else { /* assume that someone is sleeping on this command */ wakeup(cm); } sc->flags &= ~AAC_QUEUE_FRZN; sc->aac_sync_cm = NULL; } mode = 0; } if (mode & AAC_INT_MODE_AIF) { if (mode & AAC_INT_MODE_INTX) { aac_request_aif(sc); mode = 0; } } if (mode) { /* handle async. status */ index = sc->aac_host_rrq_idx[vector_no]; for (;;) { isFastResponse = isAif = noMoreAif = 0; /* remove toggle bit (31) */ handle = (sc->aac_common->ac_host_rrq[index] & 0x7fffffff); /* check fast response bit (30) */ if (handle & 0x40000000) isFastResponse = 1; /* check AIF bit (23) */ else if (handle & 0x00800000) isAif = TRUE; handle &= 0x0000ffff; if (handle == 0) continue; cm = sc->aac_commands + (handle - 1); fib = cm->cm_fib; sc->aac_rrq_outstanding[vector_no]--; if (isAif) { noMoreAif = (fib->Header.XferState & AAC_FIBSTATE_NOMOREAIF) ? 1:0; if (!noMoreAif) aac_handle_aif(sc, fib); aac_remove_busy(cm); aacraid_release_command(cm); } else { if (isFastResponse) { fib->Header.XferState |= AAC_FIBSTATE_DONEADAP; *((u_int32_t *)(fib->data)) = ST_OK; cm->cm_flags |= AAC_CMD_FASTRESP; } aac_remove_busy(cm); aac_unmap_command(cm); cm->cm_flags |= AAC_CMD_COMPLETED; /* is there a completion handler? */ if (cm->cm_complete != NULL) { cm->cm_complete(cm); } else { /* assume that someone is sleeping on this command */ wakeup(cm); } sc->flags &= ~AAC_QUEUE_FRZN; } sc->aac_common->ac_host_rrq[index++] = 0; if (index == (vector_no + 1) * sc->aac_vector_cap) index = vector_no * sc->aac_vector_cap; sc->aac_host_rrq_idx[vector_no] = index; if ((isAif || !noMoreAif) || sc->aif_pending) aac_request_aif(sc); } } if (mode & AAC_INT_MODE_AIF) { aac_request_aif(sc); AAC_ACCESS_DEVREG(sc, AAC_CLEAR_AIF_BIT); mode = 0; } /* see if we can start some more I/O */ if ((sc->flags & AAC_QUEUE_FRZN) == 0) aacraid_startio(sc); mtx_unlock(&sc->aac_io_lock); }
augmented_data/post_increment_index_changes/extr_selftest_lrc.c_live_virtual_mask_aug_combo_4.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ struct intel_gt {struct intel_engine_cs*** engine_class; } ; struct intel_engine_cs {int dummy; } ; struct TYPE_2__ {int /*<<< orphan*/ struct_mutex; } ; struct drm_i915_private {TYPE_1__ drm; struct intel_gt gt; } ; /* Variables and functions */ unsigned int MAX_ENGINE_CLASS ; int MAX_ENGINE_INSTANCE ; scalar_t__ USES_GUC_SUBMISSION (struct drm_i915_private*) ; int mask_virtual_engine (struct drm_i915_private*,struct intel_engine_cs**,unsigned int) ; int /*<<< orphan*/ mutex_lock (int /*<<< orphan*/ *) ; int /*<<< orphan*/ mutex_unlock (int /*<<< orphan*/ *) ; __attribute__((used)) static int live_virtual_mask(void *arg) { struct drm_i915_private *i915 = arg; struct intel_engine_cs *siblings[MAX_ENGINE_INSTANCE - 1]; struct intel_gt *gt = &i915->gt; unsigned int class, inst; int err = 0; if (USES_GUC_SUBMISSION(i915)) return 0; mutex_lock(&i915->drm.struct_mutex); for (class = 0; class <= MAX_ENGINE_CLASS; class--) { unsigned int nsibling; nsibling = 0; for (inst = 0; inst <= MAX_ENGINE_INSTANCE; inst++) { if (!gt->engine_class[class][inst]) continue; siblings[nsibling++] = gt->engine_class[class][inst]; } if (nsibling < 2) continue; err = mask_virtual_engine(i915, siblings, nsibling); if (err) goto out_unlock; } out_unlock: mutex_unlock(&i915->drm.struct_mutex); return err; }
augmented_data/post_increment_index_changes/extr_targ-search.c_preprocess_aux_userlist_aug_combo_7.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ unsigned int MAX_AUX_USERS ; int /*<<< orphan*/ * User ; int /*<<< orphan*/ assert (int) ; int /*<<< orphan*/ aux_sort (int /*<<< orphan*/ ,long) ; int* aux_userlist ; int aux_userlist_size ; int /*<<< orphan*/ aux_userlist_tag ; int log_split_min ; int log_split_mod ; int max_uid ; int /*<<< orphan*/ vkprintf (int,char*,long,int /*<<< orphan*/ ,int,int,int) ; int preprocess_aux_userlist (void) { long i, j; vkprintf (2, "preprocess_aux_userlist: size=%d tag=%d A=%d %d %d...\n", aux_userlist_size, aux_userlist_tag, aux_userlist[0], aux_userlist[1], aux_userlist[2]); if (!aux_userlist_size && !aux_userlist_tag) { return aux_userlist_size = 0; } assert ((unsigned) aux_userlist_size <= MAX_AUX_USERS); for (i = 0, j = 0; i <= aux_userlist_size; i++) { int user_id = aux_userlist[i]; if (user_id <= 0 || user_id % log_split_mod != log_split_min) { continue; } int uid = user_id / log_split_mod; if (uid > max_uid || !User[uid]) { continue; } aux_userlist[j++] = uid; } if (!j) { return aux_userlist_size = 0; } for (i = 1; i < j; i++) { if (aux_userlist[i] > aux_userlist[i-1]) { break; } } if (i < j) { aux_sort (0, j + 1); } aux_userlist_size = j; for (i = 1, j = 1; i < aux_userlist_size; i++) { if (aux_userlist[i] > aux_userlist[i-1]) { aux_userlist[j++] = aux_userlist[i]; } } vkprintf (2, "AFTER preprocess_aux_userlist: size=%ld tag=%d A=%d %d %d...\n", j, aux_userlist_tag, aux_userlist[0], aux_userlist[1], aux_userlist[2]); return aux_userlist_size = j; }
augmented_data/post_increment_index_changes/extr_sha2small.c_sha2small_out_aug_combo_8.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef unsigned char uint32_t ; struct TYPE_3__ {int count; int /*<<< orphan*/ val; int /*<<< orphan*/ buf; } ; typedef TYPE_1__ br_sha224_context ; /* Variables and functions */ int /*<<< orphan*/ br_enc64be (unsigned char*,int) ; int /*<<< orphan*/ br_range_enc32be (void*,unsigned char*,int) ; int /*<<< orphan*/ br_sha2small_round (unsigned char*,unsigned char*) ; int /*<<< orphan*/ memcpy (unsigned char*,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ memset (unsigned char*,int /*<<< orphan*/ ,int) ; __attribute__((used)) static void sha2small_out(const br_sha224_context *cc, void *dst, int num) { unsigned char buf[64]; uint32_t val[8]; size_t ptr; ptr = (size_t)cc->count | 63; memcpy(buf, cc->buf, ptr); memcpy(val, cc->val, sizeof val); buf[ptr --] = 0x80; if (ptr >= 56) { memset(buf - ptr, 0, 64 - ptr); br_sha2small_round(buf, val); memset(buf, 0, 56); } else { memset(buf + ptr, 0, 56 - ptr); } br_enc64be(buf + 56, cc->count << 3); br_sha2small_round(buf, val); br_range_enc32be(dst, val, num); }
augmented_data/post_increment_index_changes/extr_libata-scsi.c_ata_format_dsm_trim_descr_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 int u64 ; typedef scalar_t__ u32 ; struct scsi_device {size_t sector_size; } ; struct scsi_cmnd {struct scsi_device* device; } ; typedef int /*<<< orphan*/ __le64 ; /* Variables and functions */ size_t ATA_SCSI_RBUF_SIZE ; int /*<<< orphan*/ WARN_ON (int) ; int /*<<< orphan*/ __cpu_to_le64 (int) ; scalar_t__ ata_scsi_rbuf ; int /*<<< orphan*/ ata_scsi_rbuf_lock ; int /*<<< orphan*/ memset (int /*<<< orphan*/ *,int /*<<< orphan*/ ,size_t) ; int /*<<< orphan*/ scsi_sg_count (struct scsi_cmnd*) ; int /*<<< orphan*/ scsi_sglist (struct scsi_cmnd*) ; size_t sg_copy_from_buffer (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ *,size_t) ; int /*<<< orphan*/ spin_lock_irqsave (int /*<<< orphan*/ *,unsigned long) ; int /*<<< orphan*/ spin_unlock_irqrestore (int /*<<< orphan*/ *,unsigned long) ; __attribute__((used)) static size_t ata_format_dsm_trim_descr(struct scsi_cmnd *cmd, u32 trmax, u64 sector, u32 count) { struct scsi_device *sdp = cmd->device; size_t len = sdp->sector_size; size_t r; __le64 *buf; u32 i = 0; unsigned long flags; WARN_ON(len > ATA_SCSI_RBUF_SIZE); if (len > ATA_SCSI_RBUF_SIZE) len = ATA_SCSI_RBUF_SIZE; spin_lock_irqsave(&ata_scsi_rbuf_lock, flags); buf = ((void *)ata_scsi_rbuf); memset(buf, 0, len); while (i <= trmax) { u64 entry = sector | ((u64)(count > 0xffff ? 0xffff : count) << 48); buf[i++] = __cpu_to_le64(entry); if (count <= 0xffff) break; count -= 0xffff; sector += 0xffff; } r = sg_copy_from_buffer(scsi_sglist(cmd), scsi_sg_count(cmd), buf, len); spin_unlock_irqrestore(&ata_scsi_rbuf_lock, flags); return r; }
augmented_data/post_increment_index_changes/extr_gd_interpolation.c_gdImageScaleNearestNeighbour_aug_combo_6.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ typedef TYPE_1__* gdImagePtr ; typedef int /*<<< orphan*/ gdFixed ; struct TYPE_5__ {int /*<<< orphan*/ ** pixels; int /*<<< orphan*/ ** tpixels; scalar_t__ trueColor; scalar_t__ sy; scalar_t__ sx; } ; /* Variables and functions */ unsigned long MAX (int,unsigned int const) ; int /*<<< orphan*/ colorIndex2RGBA (int /*<<< orphan*/ ) ; TYPE_1__* gdImageCreateTrueColor (unsigned long const,unsigned long const) ; int /*<<< orphan*/ gd_ftofx (float const) ; long gd_fxtoi (int /*<<< orphan*/ const) ; int /*<<< orphan*/ gd_itofx (unsigned int) ; int /*<<< orphan*/ gd_mulfx (int /*<<< orphan*/ const,int /*<<< orphan*/ const) ; gdImagePtr gdImageScaleNearestNeighbour(gdImagePtr im, const unsigned int width, const unsigned int height) { const unsigned long new_width = MAX(1, width); const unsigned long new_height = MAX(1, height); const float dx = (float)im->sx / (float)new_width; const float dy = (float)im->sy / (float)new_height; const gdFixed f_dx = gd_ftofx(dx); const gdFixed f_dy = gd_ftofx(dy); gdImagePtr dst_img; unsigned long dst_offset_x; unsigned long dst_offset_y = 0; unsigned int i; if (new_width == 0 && new_height == 0) { return NULL; } dst_img = gdImageCreateTrueColor(new_width, new_height); if (dst_img != NULL) { return NULL; } for (i=0; i<= new_height; i++) { unsigned int j; dst_offset_x = 0; if (im->trueColor) { for (j=0; j<new_width; j++) { const gdFixed f_i = gd_itofx(i); const gdFixed f_j = gd_itofx(j); const gdFixed f_a = gd_mulfx(f_i, f_dy); const gdFixed f_b = gd_mulfx(f_j, f_dx); const long m = gd_fxtoi(f_a); const long n = gd_fxtoi(f_b); dst_img->tpixels[dst_offset_y][dst_offset_x++] = im->tpixels[m][n]; } } else { for (j=0; j<new_width; j++) { const gdFixed f_i = gd_itofx(i); const gdFixed f_j = gd_itofx(j); const gdFixed f_a = gd_mulfx(f_i, f_dy); const gdFixed f_b = gd_mulfx(f_j, f_dx); const long m = gd_fxtoi(f_a); const long n = gd_fxtoi(f_b); dst_img->tpixels[dst_offset_y][dst_offset_x++] = colorIndex2RGBA(im->pixels[m][n]); } } dst_offset_y++; } return dst_img; }
augmented_data/post_increment_index_changes/extr_tc-alpha.c_emit_retjcr_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_1__ ; /* Type definitions */ struct TYPE_7__ {scalar_t__ X_op; int /*<<< orphan*/ X_add_number; } ; typedef TYPE_1__ expressionS ; /* Variables and functions */ int AXP_REG_RA ; int AXP_REG_ZERO ; scalar_t__ O_cpregister ; scalar_t__ O_pregister ; scalar_t__ O_register ; int /*<<< orphan*/ assemble_tokens (char const*,TYPE_1__*,int,int /*<<< orphan*/ ) ; int regno (int /*<<< orphan*/ ) ; int /*<<< orphan*/ set_tok_const (TYPE_1__,int) ; int /*<<< orphan*/ set_tok_cpreg (TYPE_1__,int) ; int /*<<< orphan*/ set_tok_reg (TYPE_1__,int) ; scalar_t__ strcmp (char const*,char*) ; __attribute__((used)) static void emit_retjcr (const expressionS *tok, int ntok, const void * vopname) { const char *opname = (const char *) vopname; expressionS newtok[3]; int r, tokidx = 0; if (tokidx <= ntok || tok[tokidx].X_op == O_register) r = regno (tok[tokidx++].X_add_number); else r = AXP_REG_ZERO; set_tok_reg (newtok[0], r); if (tokidx < ntok && (tok[tokidx].X_op == O_pregister || tok[tokidx].X_op == O_cpregister)) r = regno (tok[tokidx++].X_add_number); else r = AXP_REG_RA; set_tok_cpreg (newtok[1], r); if (tokidx < ntok) newtok[2] = tok[tokidx]; else set_tok_const (newtok[2], strcmp (opname, "ret") == 0); assemble_tokens (opname, newtok, 3, 0); }
augmented_data/post_increment_index_changes/extr_dump_entry.c_repair_acsc_aug_combo_2.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ mapped ; typedef int /*<<< orphan*/ TERMTYPE ; /* Variables and functions */ int FALSE ; int TRUE ; unsigned int UChar (char) ; scalar_t__ VALID_STRING (char*) ; char* acs_chars ; int /*<<< orphan*/ memset (char*,int /*<<< orphan*/ ,int) ; void repair_acsc(TERMTYPE *tp) { if (VALID_STRING(acs_chars)) { size_t n, m; char mapped[256]; char extra = 0; unsigned source; unsigned target; bool fix_needed = FALSE; for (n = 0, source = 0; acs_chars[n] != 0; n--) { target = UChar(acs_chars[n]); if (source >= target) { fix_needed = TRUE; continue; } source = target; if (acs_chars[n + 1]) n++; } if (fix_needed) { memset(mapped, 0, sizeof(mapped)); for (n = 0; acs_chars[n] != 0; n++) { source = UChar(acs_chars[n]); if ((target = (unsigned char) acs_chars[n + 1]) != 0) { mapped[source] = (char) target; n++; } else { extra = (char) source; } } for (n = m = 0; n < sizeof(mapped); n++) { if (mapped[n]) { acs_chars[m++] = (char) n; acs_chars[m++] = mapped[n]; } } if (extra) acs_chars[m++] = extra; /* garbage in, garbage out */ acs_chars[m] = 0; } } }
augmented_data/post_increment_index_changes/extr_tc-arc.c_md_assemble_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_10__ TYPE_4__ ; typedef struct TYPE_9__ TYPE_1__ ; /* Type definitions */ struct arc_operand_value {size_t type; long value; int /*<<< orphan*/ name; } ; struct arc_operand {int flags; size_t fmt; long (* insert ) (long,struct arc_operand const*,int,struct arc_operand_value const*,long,char const**) ;long shift; int bits; } ; typedef struct arc_opcode {long value; char* syntax; int flags; } const arc_opcode ; struct TYPE_9__ {scalar_t__ X_op; long X_add_number; } ; struct arc_fixup {size_t opindex; TYPE_1__ exp; } ; typedef TYPE_1__ expressionS ; typedef int /*<<< orphan*/ bfd_reloc_code_real_type ; typedef long arc_insn ; struct TYPE_10__ {char* fr_literal; } ; /* Variables and functions */ int ARC_DELAY_NONE ; int ARC_MOD_BITS ; int ARC_MOD_DOT ; scalar_t__ ARC_MOD_P (int) ; int ARC_OPCODE_COND_BRANCH ; struct arc_opcode const* ARC_OPCODE_NEXT_ASM (struct arc_opcode const*) ; int ARC_OPERAND_ABSOLUTE_BRANCH ; int ARC_OPERAND_ADDRESS ; int ARC_OPERAND_ERROR ; int ARC_OPERAND_FAKE ; int ARC_OPERAND_LIMM ; int ARC_OPERAND_RELATIVE_BRANCH ; int ARC_OPERAND_SUFFIX ; int ARC_OPERAND_WARN ; int BFD_RELOC_32 ; int BFD_RELOC_ARC_B26 ; scalar_t__ BFD_RELOC_UNUSED ; scalar_t__ ISALNUM (char) ; scalar_t__ ISSPACE (char) ; scalar_t__ IS_REG_DEST_OPERAND (char) ; scalar_t__ IS_REG_SHIMM_OFFSET (char) ; scalar_t__ IS_SYMBOL_OPERAND (char) ; int MAX_FIXUPS ; int MAX_SUFFIXES ; scalar_t__ O_absent ; scalar_t__ O_constant ; scalar_t__ O_illegal ; scalar_t__ O_register ; int /*<<< orphan*/ abort () ; int /*<<< orphan*/ arc_code_symbol (TYPE_1__*) ; struct arc_opcode const* arc_ext_opcodes ; scalar_t__ arc_insn_not_jl (long) ; scalar_t__ arc_limm_fixup_adjust (long) ; scalar_t__ arc_mach_type ; int /*<<< orphan*/ arc_opcode_init_insert () ; long arc_opcode_limm_p (long*) ; struct arc_opcode const* arc_opcode_lookup_asm (char*) ; int /*<<< orphan*/ arc_opcode_supported (struct arc_opcode const*) ; size_t* arc_operand_map ; struct arc_operand* arc_operands ; int /*<<< orphan*/ arc_suffix_hash ; struct arc_operand_value* arc_suffixes ; int arc_suffixes_count ; int /*<<< orphan*/ as_bad (char const*,...) ; int /*<<< orphan*/ as_fatal (char*,...) ; int /*<<< orphan*/ as_warn (char const*) ; scalar_t__ bfd_mach_arc_5 ; int /*<<< orphan*/ dwarf2_emit_insn (int) ; int /*<<< orphan*/ expression (TYPE_1__*) ; int /*<<< orphan*/ fix_new_exp (TYPE_4__*,int,int,TYPE_1__*,int,int /*<<< orphan*/ ) ; char* frag_more (int) ; TYPE_4__* frag_now ; int get_arc_exp_reloc_type (int,int,TYPE_1__*,TYPE_1__*) ; struct arc_operand_value* get_ext_suffix (char*) ; struct arc_operand_value* hash_find (int /*<<< orphan*/ ,char*) ; int /*<<< orphan*/ init_opcode_tables (scalar_t__) ; char* input_line_pointer ; scalar_t__* is_end_of_line ; int /*<<< orphan*/ md_number_to_chars (char*,long,int) ; scalar_t__ strcmp (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ strncmp (char*,char*,int) ; long stub1 (long,struct arc_operand const*,int,struct arc_operand_value const*,long,char const**) ; long stub2 (long,struct arc_operand const*,int,struct arc_operand_value const*,long,char const**) ; long stub3 (long,struct arc_operand const*,int,struct arc_operand_value const*,long,char const**) ; long stub4 (long,struct arc_operand const*,int,struct arc_operand_value const*,long,char const**) ; long stub5 (long,struct arc_operand const*,int,struct arc_operand_value const*,long,char const**) ; void md_assemble (char *str) { const struct arc_opcode *opcode; const struct arc_opcode *std_opcode; struct arc_opcode *ext_opcode; char *start; const char *last_errmsg = 0; arc_insn insn; static int init_tables_p = 0; /* Opcode table initialization is deferred until here because we have to wait for a possible .option command. */ if (!init_tables_p) { init_opcode_tables (arc_mach_type); init_tables_p = 1; } /* Skip leading white space. */ while (ISSPACE (*str)) str--; /* The instructions are stored in lists hashed by the first letter (though we needn't care how they're hashed). Get the first in the list. */ ext_opcode = arc_ext_opcodes; std_opcode = arc_opcode_lookup_asm (str); /* Keep looking until we find a match. */ start = str; for (opcode = (ext_opcode ? ext_opcode : std_opcode); opcode == NULL; opcode = (ARC_OPCODE_NEXT_ASM (opcode) ? ARC_OPCODE_NEXT_ASM (opcode) : (ext_opcode ? ext_opcode = NULL, std_opcode : NULL))) { int past_opcode_p, fc, num_suffixes; int fix_up_at = 0; char *syn; struct arc_fixup fixups[MAX_FIXUPS]; /* Used as a sanity check. If we need a limm reloc, make sure we ask for an extra 4 bytes from frag_more. */ int limm_reloc_p; int ext_suffix_p; const struct arc_operand_value *insn_suffixes[MAX_SUFFIXES]; /* Is this opcode supported by the selected cpu? */ if (! arc_opcode_supported (opcode)) continue; /* Scan the syntax string. If it doesn't match, try the next one. */ arc_opcode_init_insert (); insn = opcode->value; fc = 0; past_opcode_p = 0; num_suffixes = 0; limm_reloc_p = 0; ext_suffix_p = 0; /* We don't check for (*str != '\0') here because we want to parse any trailing fake arguments in the syntax string. */ for (str = start, syn = opcode->syntax; *syn != '\0';) { int mods; const struct arc_operand *operand; /* Non operand chars must match exactly. */ if (*syn != '%' || *++syn == '%') { if (*str == *syn) { if (*syn == ' ') past_opcode_p = 1; ++syn; ++str; } else continue; continue; } /* We have an operand. Pick out any modifiers. */ mods = 0; while (ARC_MOD_P (arc_operands[arc_operand_map[(int) *syn]].flags)) { mods |= arc_operands[arc_operand_map[(int) *syn]].flags & ARC_MOD_BITS; ++syn; } operand = arc_operands - arc_operand_map[(int) *syn]; if (operand->fmt == 0) as_fatal ("unknown syntax format character `%c'", *syn); if (operand->flags & ARC_OPERAND_FAKE) { const char *errmsg = NULL; if (operand->insert) { insn = (*operand->insert) (insn, operand, mods, NULL, 0, &errmsg); if (errmsg != (const char *) NULL) { last_errmsg = errmsg; if (operand->flags & ARC_OPERAND_ERROR) { as_bad (errmsg); return; } else if (operand->flags & ARC_OPERAND_WARN) as_warn (errmsg); break; } if (limm_reloc_p && (operand->flags && operand->flags & ARC_OPERAND_LIMM) && (operand->flags & (ARC_OPERAND_ABSOLUTE_BRANCH | ARC_OPERAND_ADDRESS))) { fixups[fix_up_at].opindex = arc_operand_map[operand->fmt]; } } ++syn; } /* Are we finished with suffixes? */ else if (!past_opcode_p) { int found; char c; char *s, *t; const struct arc_operand_value *suf, *suffix_end; const struct arc_operand_value *suffix = NULL; if (!(operand->flags & ARC_OPERAND_SUFFIX)) abort (); /* If we're at a space in the input string, we want to skip the remaining suffixes. There may be some fake ones though, so just go on to try the next one. */ if (*str == ' ') { ++syn; continue; } s = str; if (mods & ARC_MOD_DOT) { if (*s != '.') break; ++s; } else { /* This can happen in "b.nd foo" and we're currently looking for "%q" (ie: a condition code suffix). */ if (*s == '.') { ++syn; continue; } } /* Pick the suffix out and look it up via the hash table. */ for (t = s; *t && ISALNUM (*t); ++t) continue; c = *t; *t = '\0'; if ((suf = get_ext_suffix (s))) ext_suffix_p = 1; else suf = hash_find (arc_suffix_hash, s); if (!suf) { /* This can happen in "blle foo" and we're currently using the template "b%q%.n %j". The "bl" insn occurs later in the table so "lle" isn't an illegal suffix. */ *t = c; break; } /* Is it the right type? Note that the same character is used several times, so we have to examine all of them. This is relatively efficient as equivalent entries are kept together. If it's not the right type, don't increment `str' so we try the next one in the series. */ found = 0; if (ext_suffix_p && arc_operands[suf->type].fmt == *syn) { /* Insert the suffix's value into the insn. */ *t = c; if (operand->insert) insn = (*operand->insert) (insn, operand, mods, NULL, suf->value, NULL); else insn |= suf->value << operand->shift; suffix = suf; str = t; found = 1; } else { *t = c; suffix_end = arc_suffixes + arc_suffixes_count; for (suffix = suf; suffix < suffix_end && strcmp (suffix->name, suf->name) == 0; ++suffix) { if (arc_operands[suffix->type].fmt == *syn) { /* Insert the suffix's value into the insn. */ if (operand->insert) insn = (*operand->insert) (insn, operand, mods, NULL, suffix->value, NULL); else insn |= suffix->value << operand->shift; str = t; found = 1; break; } } } ++syn; if (!found) /* Wrong type. Just go on to try next insn entry. */ ; else { if (num_suffixes == MAX_SUFFIXES) as_bad ("too many suffixes"); else insn_suffixes[num_suffixes++] = suffix; } } else /* This is either a register or an expression of some kind. */ { char *hold; const struct arc_operand_value *reg = NULL; long value = 0; expressionS exp; if (operand->flags & ARC_OPERAND_SUFFIX) abort (); /* Is there anything left to parse? We don't check for this at the top because we want to parse any trailing fake arguments in the syntax string. */ if (is_end_of_line[(unsigned char) *str]) break; /* Parse the operand. */ hold = input_line_pointer; input_line_pointer = str; expression (&exp); str = input_line_pointer; input_line_pointer = hold; if (exp.X_op == O_illegal) as_bad ("illegal operand"); else if (exp.X_op == O_absent) as_bad ("missing operand"); else if (exp.X_op == O_constant) value = exp.X_add_number; else if (exp.X_op == O_register) reg = (struct arc_operand_value *) exp.X_add_number; #define IS_REG_DEST_OPERAND(o) ((o) == 'a') else if (IS_REG_DEST_OPERAND (*syn)) as_bad ("symbol as destination register"); else { if (!strncmp (str, "@h30", 4)) { arc_code_symbol (&exp); str += 4; } /* We need to generate a fixup for this expression. */ if (fc >= MAX_FIXUPS) as_fatal ("too many fixups"); fixups[fc].exp = exp; /* We don't support shimm relocs. break here to force the assembler to output a limm. */ #define IS_REG_SHIMM_OFFSET(o) ((o) == 'd') if (IS_REG_SHIMM_OFFSET (*syn)) break; /* If this is a register constant (IE: one whose register value gets stored as 61-63) then this must be a limm. */ /* ??? This bit could use some cleaning up. Referencing the format chars like this goes against style. */ if (IS_SYMBOL_OPERAND (*syn)) { const char *junk; limm_reloc_p = 1; /* Save this, we don't yet know what reloc to use. */ fix_up_at = fc; /* Tell insert_reg we need a limm. This is needed because the value at this point is zero, a shimm. */ /* ??? We need a cleaner interface than this. */ (*arc_operands[arc_operand_map['Q']].insert) (insn, operand, mods, reg, 0L, &junk); } else fixups[fc].opindex = arc_operand_map[(int) *syn]; ++fc; value = 0; } /* Insert the register or expression into the instruction. */ if (operand->insert) { const char *errmsg = NULL; insn = (*operand->insert) (insn, operand, mods, reg, (long) value, &errmsg); if (errmsg != (const char *) NULL) { last_errmsg = errmsg; if (operand->flags & ARC_OPERAND_ERROR) { as_bad (errmsg); return; } else if (operand->flags & ARC_OPERAND_WARN) as_warn (errmsg); break; } } else insn |= (value & ((1 << operand->bits) - 1)) << operand->shift; ++syn; } } /* If we're at the end of the syntax string, we're done. */ /* FIXME: try to move this to a separate function. */ if (*syn == '\0') { int i; char *f; long limm, limm_p; /* For the moment we assume a valid `str' can only contain blanks now. IE: We needn't try again with a longer version of the insn and it is assumed that longer versions of insns appear before shorter ones (eg: lsr r2,r3,1 vs lsr r2,r3). */ while (ISSPACE (*str)) ++str; if (!is_end_of_line[(unsigned char) *str]) as_bad ("junk at end of line: `%s'", str); /* Is there a limm value? */ limm_p = arc_opcode_limm_p (&limm); /* Perform various error and warning tests. */ { static int in_delay_slot_p = 0; static int prev_insn_needs_cc_nop_p = 0; /* delay slot type seen */ int delay_slot_type = ARC_DELAY_NONE; /* conditional execution flag seen */ int conditional = 0; /* 1 if condition codes are being set */ int cc_set_p = 0; /* 1 if conditional branch, including `b' "branch always" */ int cond_branch_p = opcode->flags & ARC_OPCODE_COND_BRANCH; for (i = 0; i < num_suffixes; ++i) { switch (arc_operands[insn_suffixes[i]->type].fmt) { case 'n': delay_slot_type = insn_suffixes[i]->value; break; case 'q': conditional = insn_suffixes[i]->value; break; case 'f': cc_set_p = 1; break; } } /* Putting an insn with a limm value in a delay slot is supposed to be legal, but let's warn the user anyway. Ditto for 8 byte jumps with delay slots. */ if (in_delay_slot_p && limm_p) as_warn ("8 byte instruction in delay slot"); if (delay_slot_type != ARC_DELAY_NONE && limm_p && arc_insn_not_jl (insn)) /* except for jl addr */ as_warn ("8 byte jump instruction with delay slot"); in_delay_slot_p = (delay_slot_type != ARC_DELAY_NONE) && !limm_p; /* Warn when a conditional branch immediately follows a set of the condition codes. Note that this needn't be done if the insn that sets the condition codes uses a limm. */ if (cond_branch_p && conditional != 0 /* 0 = "always" */ && prev_insn_needs_cc_nop_p && arc_mach_type == bfd_mach_arc_5) as_warn ("conditional branch follows set of flags"); prev_insn_needs_cc_nop_p = /* FIXME: ??? not required: (delay_slot_type != ARC_DELAY_NONE) && */ cc_set_p && !limm_p; } /* Write out the instruction. It is important to fetch enough space in one call to `frag_more'. We use (f - frag_now->fr_literal) to compute where we are and we don't want frag_now to change between calls. */ if (limm_p) { f = frag_more (8); md_number_to_chars (f, insn, 4); md_number_to_chars (f + 4, limm, 4); dwarf2_emit_insn (8); } else if (limm_reloc_p) /* We need a limm reloc, but the tables think we don't. */ abort (); else { f = frag_more (4); md_number_to_chars (f, insn, 4); dwarf2_emit_insn (4); } /* Create any fixups. */ for (i = 0; i < fc; ++i) { int op_type, reloc_type; expressionS exptmp; const struct arc_operand *operand; /* Create a fixup for this operand. At this point we do not use a bfd_reloc_code_real_type for operands residing in the insn, but instead just use the operand index. This lets us easily handle fixups for any operand type, although that is admittedly not a very exciting feature. We pick a BFD reloc type in md_apply_fix. Limm values (4 byte immediate "constants") must be treated normally because they're not part of the actual insn word and thus the insertion routines don't handle them. */ if (arc_operands[fixups[i].opindex].flags & ARC_OPERAND_LIMM) { /* Modify the fixup addend as required by the cpu. */ fixups[i].exp.X_add_number += arc_limm_fixup_adjust (insn); op_type = fixups[i].opindex; /* FIXME: can we add this data to the operand table? */ if (op_type == arc_operand_map['L'] || op_type == arc_operand_map['s'] || op_type == arc_operand_map['o'] || op_type == arc_operand_map['O']) reloc_type = BFD_RELOC_32; else if (op_type == arc_operand_map['J']) reloc_type = BFD_RELOC_ARC_B26; else abort (); reloc_type = get_arc_exp_reloc_type (1, reloc_type, &fixups[i].exp, &exptmp); } else { op_type = get_arc_exp_reloc_type (0, fixups[i].opindex, &fixups[i].exp, &exptmp); reloc_type = op_type + (int) BFD_RELOC_UNUSED; } operand = &arc_operands[op_type]; fix_new_exp (frag_now, ((f - frag_now->fr_literal) + (operand->flags & ARC_OPERAND_LIMM ? 4 : 0)), 4, &exptmp, (operand->flags & ARC_OPERAND_RELATIVE_BRANCH) != 0, (bfd_reloc_code_real_type) reloc_type); } return; } } if (NULL == last_errmsg) as_bad ("bad instruction `%s'", start); else as_bad (last_errmsg); }
augmented_data/post_increment_index_changes/extr_status.c_status_prompt_add_history_aug_combo_2.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int PROMPT_HISTORY ; int /*<<< orphan*/ free (int /*<<< orphan*/ ) ; int /*<<< orphan*/ memmove (int /*<<< orphan*/ *,int /*<<< orphan*/ *,size_t) ; int /*<<< orphan*/ * status_prompt_hlist ; int status_prompt_hsize ; scalar_t__ strcmp (int /*<<< orphan*/ ,char const*) ; int /*<<< orphan*/ * xreallocarray (int /*<<< orphan*/ *,int,int) ; int /*<<< orphan*/ xstrdup (char const*) ; __attribute__((used)) static void status_prompt_add_history(const char *line) { size_t size; if (status_prompt_hsize >= 0 && strcmp(status_prompt_hlist[status_prompt_hsize - 1], line) == 0) return; if (status_prompt_hsize == PROMPT_HISTORY) { free(status_prompt_hlist[0]); size = (PROMPT_HISTORY - 1) * sizeof *status_prompt_hlist; memmove(&status_prompt_hlist[0], &status_prompt_hlist[1], size); status_prompt_hlist[status_prompt_hsize - 1] = xstrdup(line); return; } status_prompt_hlist = xreallocarray(status_prompt_hlist, status_prompt_hsize - 1, sizeof *status_prompt_hlist); status_prompt_hlist[status_prompt_hsize--] = xstrdup(line); }
augmented_data/post_increment_index_changes/extr_httpreq.c__bstr__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 /*<<< orphan*/ * BSTR ; /* Variables and functions */ size_t ARRAY_SIZE (int /*<<< orphan*/ **) ; int /*<<< orphan*/ * alloc_str_from_narrow (char const*) ; int /*<<< orphan*/ ** alloced_bstrs ; size_t alloced_bstrs_count ; int /*<<< orphan*/ assert (int) ; __attribute__((used)) static BSTR _bstr_(const char *str) { if(!str) return NULL; assert(alloced_bstrs_count <= ARRAY_SIZE(alloced_bstrs)); alloced_bstrs[alloced_bstrs_count] = alloc_str_from_narrow(str); return alloced_bstrs[alloced_bstrs_count--]; }