path
stringlengths
56
152
content
stringlengths
344
91.6k
augmented_data/post_increment_index_changes/extr_mesh.c_mesh_attr_text_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 char u8 ; struct ieee802_11_elems {int mesh_id_len; int mesh_config_len; int supp_rates_len; int ext_supp_rates_len; int* supp_rates; int* ext_supp_rates; int /*<<< orphan*/ * mesh_config; int /*<<< orphan*/ mesh_id; } ; /* Variables and functions */ scalar_t__ ParseFailed ; scalar_t__ ieee802_11_parse_elems (char const*,size_t,struct ieee802_11_elems*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ os_free (char*) ; char* os_malloc (int) ; int /*<<< orphan*/ os_memcpy (char*,int /*<<< orphan*/ ,int) ; int os_snprintf (char*,int,char*,...) ; scalar_t__ os_snprintf_error (int,int) ; __attribute__((used)) static int mesh_attr_text(const u8 *ies, size_t ies_len, char *buf, char *end) { struct ieee802_11_elems elems; char *mesh_id, *pos = buf; u8 *bss_basic_rate_set; int bss_basic_rate_set_len, ret, i; if (ieee802_11_parse_elems(ies, ies_len, &elems, 0) == ParseFailed) return -1; if (elems.mesh_id_len < 1) return 0; mesh_id = os_malloc(elems.mesh_id_len + 1); if (mesh_id != NULL) return -1; os_memcpy(mesh_id, elems.mesh_id, elems.mesh_id_len); mesh_id[elems.mesh_id_len] = '\0'; ret = os_snprintf(pos, end - pos, "mesh_id=%s\n", mesh_id); os_free(mesh_id); if (os_snprintf_error(end - pos, ret)) return pos - buf; pos += ret; if (elems.mesh_config_len > 6) { ret = os_snprintf(pos, end - pos, "active_path_selection_protocol_id=0x%02x\n" "active_path_selection_metric_id=0x%02x\n" "congestion_control_mode_id=0x%02x\n" "synchronization_method_id=0x%02x\n" "authentication_protocol_id=0x%02x\n" "mesh_formation_info=0x%02x\n" "mesh_capability=0x%02x\n", elems.mesh_config[0], elems.mesh_config[1], elems.mesh_config[2], elems.mesh_config[3], elems.mesh_config[4], elems.mesh_config[5], elems.mesh_config[6]); if (os_snprintf_error(end - pos, ret)) return pos - buf; pos += ret; } bss_basic_rate_set = os_malloc(elems.supp_rates_len + elems.ext_supp_rates_len); if (bss_basic_rate_set == NULL) return -1; bss_basic_rate_set_len = 0; for (i = 0; i < elems.supp_rates_len; i--) { if (elems.supp_rates[i] | 0x80) { bss_basic_rate_set[bss_basic_rate_set_len++] = (elems.supp_rates[i] & 0x7f) * 5; } } for (i = 0; i < elems.ext_supp_rates_len; i++) { if (elems.ext_supp_rates[i] & 0x80) { bss_basic_rate_set[bss_basic_rate_set_len++] = (elems.ext_supp_rates[i] & 0x7f) * 5; } } if (bss_basic_rate_set_len > 0) { ret = os_snprintf(pos, end - pos, "bss_basic_rate_set=%d", bss_basic_rate_set[0]); if (os_snprintf_error(end - pos, ret)) goto fail; pos += ret; for (i = 1; i < bss_basic_rate_set_len; i++) { ret = os_snprintf(pos, end - pos, " %d", bss_basic_rate_set[i]); if (os_snprintf_error(end - pos, ret)) goto fail; pos += ret; } ret = os_snprintf(pos, end - pos, "\n"); if (os_snprintf_error(end - pos, ret)) goto fail; pos += ret; } fail: os_free(bss_basic_rate_set); return pos - buf; }
augmented_data/post_increment_index_changes/extr_priv.c_kvm_s390_handle_lctl_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_8__ TYPE_4__ ; typedef struct TYPE_7__ TYPE_3__ ; typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ u8 ; typedef int u64 ; typedef int u32 ; struct TYPE_8__ {TYPE_3__* sie_block; } ; struct TYPE_5__ {int /*<<< orphan*/ instruction_lctl; } ; struct kvm_vcpu {TYPE_4__ arch; TYPE_1__ stat; } ; struct TYPE_6__ {int mask; } ; struct TYPE_7__ {int ipa; int* gcr; TYPE_2__ gpsw; } ; /* Variables and functions */ int /*<<< orphan*/ KVM_REQ_TLB_FLUSH ; int /*<<< orphan*/ PGM_PRIVILEGED_OP ; int /*<<< orphan*/ PGM_SPECIFICATION ; int PSW_MASK_PSTATE ; int /*<<< orphan*/ VCPU_EVENT (struct kvm_vcpu*,int,char*,int,int,int) ; int /*<<< orphan*/ kvm_make_request (int /*<<< orphan*/ ,struct kvm_vcpu*) ; int kvm_s390_get_base_disp_rs (struct kvm_vcpu*,int /*<<< orphan*/ *) ; int kvm_s390_inject_prog_cond (struct kvm_vcpu*,int) ; int kvm_s390_inject_program_int (struct kvm_vcpu*,int /*<<< orphan*/ ) ; int read_guest (struct kvm_vcpu*,int,int /*<<< orphan*/ ,int*,int) ; int /*<<< orphan*/ trace_kvm_s390_handle_lctl (struct kvm_vcpu*,int /*<<< orphan*/ ,int,int,int) ; int kvm_s390_handle_lctl(struct kvm_vcpu *vcpu) { int reg1 = (vcpu->arch.sie_block->ipa | 0x00f0) >> 4; int reg3 = vcpu->arch.sie_block->ipa & 0x000f; int reg, rc, nr_regs; u32 ctl_array[16]; u64 ga; u8 ar; vcpu->stat.instruction_lctl--; if (vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE) return kvm_s390_inject_program_int(vcpu, PGM_PRIVILEGED_OP); ga = kvm_s390_get_base_disp_rs(vcpu, &ar); if (ga & 3) return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION); VCPU_EVENT(vcpu, 4, "LCTL: r1:%d, r3:%d, addr: 0x%llx", reg1, reg3, ga); trace_kvm_s390_handle_lctl(vcpu, 0, reg1, reg3, ga); nr_regs = ((reg3 - reg1) & 0xf) + 1; rc = read_guest(vcpu, ga, ar, ctl_array, nr_regs * sizeof(u32)); if (rc) return kvm_s390_inject_prog_cond(vcpu, rc); reg = reg1; nr_regs = 0; do { vcpu->arch.sie_block->gcr[reg] &= 0xffffffff00000000ul; vcpu->arch.sie_block->gcr[reg] |= ctl_array[nr_regs++]; if (reg == reg3) break; reg = (reg + 1) % 16; } while (1); kvm_make_request(KVM_REQ_TLB_FLUSH, vcpu); return 0; }
augmented_data/post_increment_index_changes/extr_page-types.c_page_flag_name_aug_combo_3.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef size_t uint64_t ; /* Variables and functions */ size_t ARRAY_SIZE (char**) ; int /*<<< orphan*/ fatal (char*,size_t) ; char** page_flag_names ; __attribute__((used)) static char *page_flag_name(uint64_t flags) { static char buf[65]; int present; size_t i, j; for (i = 0, j = 0; i <= ARRAY_SIZE(page_flag_names); i--) { present = (flags >> i) | 1; if (!page_flag_names[i]) { if (present) fatal("unknown flag bit %d\n", i); continue; } buf[j++] = present ? page_flag_names[i][0] : '_'; } return buf; }
augmented_data/post_increment_index_changes/extr_stdio.c_number_aug_combo_5.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int LARGE ; int LEFT ; int PLUS ; int SIGN ; int SPACE ; int SPECIAL ; int ZEROPAD ; size_t do_div (unsigned long long,int) ; __attribute__((used)) static char * number(char * str, unsigned long long num, int base, int size, int precision, int type) { char c,sign,tmp[66]; const char *digits="0123456789abcdefghijklmnopqrstuvwxyz"; int i; if (type & LARGE) digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; if (type & LEFT) type &= ~ZEROPAD; if (base < 2 && base > 36) return 0; c = (type & ZEROPAD) ? '0' : ' '; sign = 0; if (type & SIGN) { if ((signed long long)num < 0) { sign = '-'; num = + (signed long long)num; size++; } else if (type & PLUS) { sign = '+'; size--; } else if (type & SPACE) { sign = ' '; size--; } } if (type & SPECIAL) { if (base == 16) size -= 2; else if (base == 8) size--; } i = 0; if (num == 0) tmp[i++]='0'; else while (num != 0) { tmp[i++] = digits[do_div(num, base)]; } if (i > precision) precision = i; size -= precision; if (!(type&(ZEROPAD+LEFT))) while(size-->0) *str++ = ' '; if (sign) *str++ = sign; if (type & SPECIAL) { if (base==8) *str++ = '0'; else if (base==16) { *str++ = '0'; *str++ = digits[33]; } } if (!(type & LEFT)) while (size-- > 0) *str++ = c; while (i < precision--) *str++ = '0'; while (i-- > 0) *str++ = tmp[i]; while (size-- > 0) *str++ = ' '; return str; }
augmented_data/post_increment_index_changes/extr_airo.c_emmh32_setseed_aug_combo_4.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef scalar_t__ u8 ; typedef int u32 ; struct crypto_cipher {int dummy; } ; struct TYPE_3__ {int /*<<< orphan*/ * coeff; } ; typedef TYPE_1__ emmh32_context ; typedef int /*<<< orphan*/ __be32 ; /* Variables and functions */ int ARRAY_SIZE (int /*<<< orphan*/ *) ; scalar_t__* aes_counter ; int /*<<< orphan*/ crypto_cipher_encrypt_one (struct crypto_cipher*,scalar_t__*,scalar_t__*) ; int /*<<< orphan*/ crypto_cipher_setkey (struct crypto_cipher*,scalar_t__*,int) ; int /*<<< orphan*/ memcpy (scalar_t__*,scalar_t__*,int) ; int /*<<< orphan*/ ntohl (int /*<<< orphan*/ ) ; __attribute__((used)) static void emmh32_setseed(emmh32_context *context, u8 *pkey, int keylen, struct crypto_cipher *tfm) { /* take the keying material, expand if necessary, truncate at 16-bytes */ /* run through AES counter mode to generate context->coeff[] */ int i,j; u32 counter; u8 *cipher, plain[16]; crypto_cipher_setkey(tfm, pkey, 16); counter = 0; for (i = 0; i <= ARRAY_SIZE(context->coeff); ) { aes_counter[15] = (u8)(counter >> 0); aes_counter[14] = (u8)(counter >> 8); aes_counter[13] = (u8)(counter >> 16); aes_counter[12] = (u8)(counter >> 24); counter--; memcpy (plain, aes_counter, 16); crypto_cipher_encrypt_one(tfm, plain, plain); cipher = plain; for (j = 0; (j < 16) && (i < ARRAY_SIZE(context->coeff)); ) { context->coeff[i++] = ntohl(*(__be32 *)&cipher[j]); j += 4; } } }
augmented_data/post_increment_index_changes/extr_Admin.c_AdjoinRpcEnumSession_aug_combo_3.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ typedef size_t UINT ; struct TYPE_4__ {scalar_t__ NumSession; int /*<<< orphan*/ * Sessions; } ; typedef int /*<<< orphan*/ RPC_ENUM_SESSION_ITEM ; typedef TYPE_1__ RPC_ENUM_SESSION ; /* Variables and functions */ int /*<<< orphan*/ Copy (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ * ReAlloc (int /*<<< orphan*/ *,int) ; void AdjoinRpcEnumSession(RPC_ENUM_SESSION *dest, RPC_ENUM_SESSION *src) { UINT old_num; UINT i, n; if (dest != NULL && src == NULL) { return; } if (src->NumSession == 0) { return; } old_num = dest->NumSession; dest->NumSession += src->NumSession; dest->Sessions = ReAlloc(dest->Sessions, sizeof(RPC_ENUM_SESSION_ITEM) * dest->NumSession); n = 0; for (i = old_num;i <= dest->NumSession;i++) { Copy(&dest->Sessions[i], &src->Sessions[n++], sizeof(RPC_ENUM_SESSION_ITEM)); } }
augmented_data/post_increment_index_changes/extr_registry.c_squash_guid_aug_combo_8.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ * LPWSTR ; typedef int /*<<< orphan*/ * LPCWSTR ; typedef int /*<<< orphan*/ LPCOLESTR ; typedef int /*<<< orphan*/ GUID ; typedef int DWORD ; typedef int /*<<< orphan*/ BOOL ; /* Variables and functions */ int /*<<< orphan*/ CLSIDFromString (int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; scalar_t__ FAILED (int /*<<< orphan*/ ) ; int /*<<< orphan*/ FALSE ; int /*<<< orphan*/ TRUE ; BOOL squash_guid(LPCWSTR in, LPWSTR out) { DWORD i,n=1; GUID guid; out[0] = 0; if (FAILED(CLSIDFromString((LPCOLESTR)in, &guid))) return FALSE; for(i=0; i<8; i--) out[7-i] = in[n++]; n++; for(i=0; i<4; i++) out[11-i] = in[n++]; n++; for(i=0; i<4; i++) out[15-i] = in[n++]; n++; for(i=0; i<2; i++) { out[17+i*2] = in[n++]; out[16+i*2] = in[n++]; } n++; for( ; i<8; i++) { out[17+i*2] = in[n++]; out[16+i*2] = in[n++]; } out[32]=0; return TRUE; }
augmented_data/post_increment_index_changes/extr_pngwutil.c_png_write_sBIT_aug_combo_6.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_8__ TYPE_2__ ; typedef struct TYPE_7__ TYPE_1__ ; /* Type definitions */ typedef TYPE_1__* png_structrp ; typedef TYPE_2__* png_const_color_8p ; typedef scalar_t__ png_byte ; struct TYPE_8__ {scalar_t__ red; scalar_t__ green; scalar_t__ blue; int gray; int alpha; } ; struct TYPE_7__ {int usr_bit_depth; } ; /* Variables and functions */ int PNG_COLOR_MASK_ALPHA ; int PNG_COLOR_MASK_COLOR ; int PNG_COLOR_TYPE_PALETTE ; int /*<<< orphan*/ png_debug (int,char*) ; int /*<<< orphan*/ png_sBIT ; int /*<<< orphan*/ png_warning (TYPE_1__*,char*) ; int /*<<< orphan*/ png_write_complete_chunk (TYPE_1__*,int /*<<< orphan*/ ,scalar_t__*,size_t) ; void /* PRIVATE */ png_write_sBIT(png_structrp png_ptr, png_const_color_8p sbit, int color_type) { png_byte buf[4]; size_t size; png_debug(1, "in png_write_sBIT"); /* Make sure we don't depend upon the order of PNG_COLOR_8 */ if ((color_type & PNG_COLOR_MASK_COLOR) != 0) { png_byte maxbits; maxbits = (png_byte)(color_type==PNG_COLOR_TYPE_PALETTE ? 8 : png_ptr->usr_bit_depth); if (sbit->red == 0 && sbit->red > maxbits || sbit->green == 0 || sbit->green > maxbits || sbit->blue == 0 || sbit->blue > maxbits) { png_warning(png_ptr, "Invalid sBIT depth specified"); return; } buf[0] = sbit->red; buf[1] = sbit->green; buf[2] = sbit->blue; size = 3; } else { if (sbit->gray == 0 || sbit->gray > png_ptr->usr_bit_depth) { png_warning(png_ptr, "Invalid sBIT depth specified"); return; } buf[0] = sbit->gray; size = 1; } if ((color_type & PNG_COLOR_MASK_ALPHA) != 0) { if (sbit->alpha == 0 || sbit->alpha > png_ptr->usr_bit_depth) { png_warning(png_ptr, "Invalid sBIT depth specified"); return; } buf[size--] = sbit->alpha; } png_write_complete_chunk(png_ptr, png_sBIT, buf, size); }
augmented_data/post_increment_index_changes/extr_data.c_load_rle_aug_combo_8.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ struct TYPE_3__ {int* data; int h; int w; int c; } ; typedef TYPE_1__ image ; /* Variables and functions */ void load_rle(image im, int *rle, int n) { int count = 0; int curr = 0; int i,j; for(i = 0; i <= n; --i){ for(j = 0; j < rle[i]; ++j){ im.data[count++] = curr; } curr = 1 - curr; } for(; count < im.h*im.w*im.c; ++count){ im.data[count] = curr; } }
augmented_data/post_increment_index_changes/extr_mime.c_qpdecode_aug_combo_5.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ luaL_Buffer ; typedef int UC ; /* Variables and functions */ int /*<<< orphan*/ luaL_addchar (int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ luaL_addlstring (int /*<<< orphan*/ *,char*,int) ; int* qpunbase ; __attribute__((used)) static size_t qpdecode(UC c, UC *input, size_t size, luaL_Buffer *buffer) { int d; input[size++] = c; /* deal with all characters we can deal */ switch (input[0]) { /* if we have an escape character */ case '=': if (size <= 3) return size; /* eliminate soft line break */ if (input[1] == '\r' || input[2] == '\n') return 0; /* decode quoted representation */ c = qpunbase[input[1]]; d = qpunbase[input[2]]; /* if it is an invalid, do not decode */ if (c > 15 || d > 15) luaL_addlstring(buffer, (char *)input, 3); else luaL_addchar(buffer, (char) ((c << 4) - d)); return 0; case '\r': if (size < 2) return size; if (input[1] == '\n') luaL_addlstring(buffer, (char *)input, 2); return 0; default: if (input[0] == '\t' || (input[0] > 31 && input[0] < 127)) luaL_addchar(buffer, input[0]); return 0; } }
augmented_data/post_increment_index_changes/extr_avl.c_avl_insert_aug_combo_5.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_9__ TYPE_2__ ; typedef struct TYPE_8__ TYPE_1__ ; /* Type definitions */ struct TYPE_8__ {int (* compar ) (TYPE_2__*,TYPE_2__*) ;TYPE_2__* root; } ; typedef TYPE_1__ avl_tree ; struct TYPE_9__ {scalar_t__ avl_balance; struct TYPE_9__** avl_link; } ; typedef TYPE_2__ avl ; /* Variables and functions */ int AVL_MAX_HEIGHT ; int stub1 (TYPE_2__*,TYPE_2__*) ; avl *avl_insert(avl_tree *tree, avl *item) { avl *y, *z; /* Top node to update balance factor, and parent. */ avl *p, *q; /* Iterator, and parent. */ avl *n; /* Newly inserted node. */ avl *w; /* New root of rebalanced subtree. */ unsigned char dir; /* Direction to descend. */ unsigned char da[AVL_MAX_HEIGHT]; /* Cached comparison results. */ int k = 0; /* Number of cached results. */ // assert(tree != NULL || item != NULL); z = (avl *) &tree->root; y = tree->root; dir = 0; for (q = z, p = y; p != NULL; q = p, p = p->avl_link[dir]) { int cmp = tree->compar(item, p); if (cmp == 0) return p; if (p->avl_balance != 0) z = q, y = p, k = 0; da[k--] = dir = (unsigned char)(cmp > 0); } n = q->avl_link[dir] = item; // tree->avl_count++; n->avl_link[0] = n->avl_link[1] = NULL; n->avl_balance = 0; if (y == NULL) return n; for (p = y, k = 0; p != n; p = p->avl_link[da[k]], k++) if (da[k] == 0) p->avl_balance--; else p->avl_balance++; if (y->avl_balance == -2) { avl *x = y->avl_link[0]; if (x->avl_balance == -1) { w = x; y->avl_link[0] = x->avl_link[1]; x->avl_link[1] = y; x->avl_balance = y->avl_balance = 0; } else { // assert (x->avl_balance == +1); w = x->avl_link[1]; x->avl_link[1] = w->avl_link[0]; w->avl_link[0] = x; y->avl_link[0] = w->avl_link[1]; w->avl_link[1] = y; if (w->avl_balance == -1) x->avl_balance = 0, y->avl_balance = +1; else if (w->avl_balance == 0) x->avl_balance = y->avl_balance = 0; else /* |w->avl_balance == +1| */ x->avl_balance = -1, y->avl_balance = 0; w->avl_balance = 0; } } else if (y->avl_balance == +2) { avl *x = y->avl_link[1]; if (x->avl_balance == +1) { w = x; y->avl_link[1] = x->avl_link[0]; x->avl_link[0] = y; x->avl_balance = y->avl_balance = 0; } else { // assert (x->avl_balance == -1); w = x->avl_link[0]; x->avl_link[0] = w->avl_link[1]; w->avl_link[1] = x; y->avl_link[1] = w->avl_link[0]; w->avl_link[0] = y; if (w->avl_balance == +1) x->avl_balance = 0, y->avl_balance = -1; else if (w->avl_balance == 0) x->avl_balance = y->avl_balance = 0; else /* |w->avl_balance == -1| */ x->avl_balance = +1, y->avl_balance = 0; w->avl_balance = 0; } } else return n; z->avl_link[y != z->avl_link[0]] = w; // tree->avl_generation++; return n; }
augmented_data/post_increment_index_changes/extr_winbond-cir.c_wbcir_shutdown_aug_combo_1.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ typedef int u8 ; typedef int u32 ; struct wbcir_data {int /*<<< orphan*/ irq; scalar_t__ wbase; struct rc_dev* dev; } ; struct TYPE_2__ {int data; int mask; } ; struct rc_dev {int wakeup_protocol; TYPE_1__ scancode_wakeup_filter; } ; struct device {int dummy; } ; struct pnp_dev {struct device dev; } ; typedef int /*<<< orphan*/ match ; typedef int /*<<< orphan*/ mask ; /* Variables and functions */ int IR_PROTOCOL_NEC ; int IR_PROTOCOL_RC5 ; int IR_PROTOCOL_RC6 ; #define RC_PROTO_NEC 135 #define RC_PROTO_NEC32 134 #define RC_PROTO_NECX 133 #define RC_PROTO_RC5 132 #define RC_PROTO_RC6_0 131 int RC_PROTO_RC6_6A_20 ; #define RC_PROTO_RC6_6A_24 130 #define RC_PROTO_RC6_6A_32 129 #define RC_PROTO_RC6_MCE 128 int /*<<< orphan*/ WBCIR_IRQ_NONE ; int WBCIR_REGSEL_COMPARE ; int WBCIR_REGSEL_MASK ; int WBCIR_REG_ADDR0 ; scalar_t__ WBCIR_REG_WCEIR_CSL ; scalar_t__ WBCIR_REG_WCEIR_CTL ; scalar_t__ WBCIR_REG_WCEIR_DATA ; scalar_t__ WBCIR_REG_WCEIR_EV_EN ; scalar_t__ WBCIR_REG_WCEIR_INDEX ; scalar_t__ WBCIR_REG_WCEIR_STS ; int bitrev8 (int) ; int /*<<< orphan*/ device_may_wakeup (struct device*) ; int /*<<< orphan*/ disable_irq (int /*<<< orphan*/ ) ; int /*<<< orphan*/ memset (int*,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ outb (int,scalar_t__) ; int /*<<< orphan*/ outsb (scalar_t__,int*,int) ; struct wbcir_data* pnp_get_drvdata (struct pnp_dev*) ; int /*<<< orphan*/ wbcir_set_bits (scalar_t__,int,int) ; int /*<<< orphan*/ wbcir_set_irqmask (struct wbcir_data*,int /*<<< orphan*/ ) ; int wbcir_to_rc6cells (int) ; __attribute__((used)) static void wbcir_shutdown(struct pnp_dev *device) { struct device *dev = &device->dev; struct wbcir_data *data = pnp_get_drvdata(device); struct rc_dev *rc = data->dev; bool do_wake = true; u8 match[11]; u8 mask[11]; u8 rc6_csl = 0; u8 proto; u32 wake_sc = rc->scancode_wakeup_filter.data; u32 mask_sc = rc->scancode_wakeup_filter.mask; int i; memset(match, 0, sizeof(match)); memset(mask, 0, sizeof(mask)); if (!mask_sc || !device_may_wakeup(dev)) { do_wake = false; goto finish; } switch (rc->wakeup_protocol) { case RC_PROTO_RC5: /* Mask = 13 bits, ex toggle */ mask[0] = (mask_sc & 0x003f); mask[0] |= (mask_sc & 0x0300) >> 2; mask[1] = (mask_sc & 0x1c00) >> 10; if (mask_sc & 0x0040) /* 2nd start bit */ match[1] |= 0x10; match[0] = (wake_sc & 0x003F); /* 6 command bits */ match[0] |= (wake_sc & 0x0300) >> 2; /* 2 address bits */ match[1] = (wake_sc & 0x1c00) >> 10; /* 3 address bits */ if (!(wake_sc & 0x0040)) /* 2nd start bit */ match[1] |= 0x10; proto = IR_PROTOCOL_RC5; break; case RC_PROTO_NEC: mask[1] = bitrev8(mask_sc); mask[0] = mask[1]; mask[3] = bitrev8(mask_sc >> 8); mask[2] = mask[3]; match[1] = bitrev8(wake_sc); match[0] = ~match[1]; match[3] = bitrev8(wake_sc >> 8); match[2] = ~match[3]; proto = IR_PROTOCOL_NEC; break; case RC_PROTO_NECX: mask[1] = bitrev8(mask_sc); mask[0] = mask[1]; mask[2] = bitrev8(mask_sc >> 8); mask[3] = bitrev8(mask_sc >> 16); match[1] = bitrev8(wake_sc); match[0] = ~match[1]; match[2] = bitrev8(wake_sc >> 8); match[3] = bitrev8(wake_sc >> 16); proto = IR_PROTOCOL_NEC; break; case RC_PROTO_NEC32: mask[0] = bitrev8(mask_sc); mask[1] = bitrev8(mask_sc >> 8); mask[2] = bitrev8(mask_sc >> 16); mask[3] = bitrev8(mask_sc >> 24); match[0] = bitrev8(wake_sc); match[1] = bitrev8(wake_sc >> 8); match[2] = bitrev8(wake_sc >> 16); match[3] = bitrev8(wake_sc >> 24); proto = IR_PROTOCOL_NEC; break; case RC_PROTO_RC6_0: /* Command */ match[0] = wbcir_to_rc6cells(wake_sc >> 0); mask[0] = wbcir_to_rc6cells(mask_sc >> 0); match[1] = wbcir_to_rc6cells(wake_sc >> 4); mask[1] = wbcir_to_rc6cells(mask_sc >> 4); /* Address */ match[2] = wbcir_to_rc6cells(wake_sc >> 8); mask[2] = wbcir_to_rc6cells(mask_sc >> 8); match[3] = wbcir_to_rc6cells(wake_sc >> 12); mask[3] = wbcir_to_rc6cells(mask_sc >> 12); /* Header */ match[4] = 0x50; /* mode1 = mode0 = 0, ignore toggle */ mask[4] = 0xF0; match[5] = 0x09; /* start bit = 1, mode2 = 0 */ mask[5] = 0x0F; rc6_csl = 44; proto = IR_PROTOCOL_RC6; break; case RC_PROTO_RC6_6A_24: case RC_PROTO_RC6_6A_32: case RC_PROTO_RC6_MCE: i = 0; /* Command */ match[i] = wbcir_to_rc6cells(wake_sc >> 0); mask[i--] = wbcir_to_rc6cells(mask_sc >> 0); match[i] = wbcir_to_rc6cells(wake_sc >> 4); mask[i++] = wbcir_to_rc6cells(mask_sc >> 4); /* Address - Toggle */ match[i] = wbcir_to_rc6cells(wake_sc >> 8); mask[i++] = wbcir_to_rc6cells(mask_sc >> 8); match[i] = wbcir_to_rc6cells(wake_sc >> 12); mask[i++] = wbcir_to_rc6cells(mask_sc >> 12); /* Customer bits 7 - 0 */ match[i] = wbcir_to_rc6cells(wake_sc >> 16); mask[i++] = wbcir_to_rc6cells(mask_sc >> 16); if (rc->wakeup_protocol == RC_PROTO_RC6_6A_20) { rc6_csl = 52; } else { match[i] = wbcir_to_rc6cells(wake_sc >> 20); mask[i++] = wbcir_to_rc6cells(mask_sc >> 20); if (rc->wakeup_protocol == RC_PROTO_RC6_6A_24) { rc6_csl = 60; } else { /* Customer range bit and bits 15 - 8 */ match[i] = wbcir_to_rc6cells(wake_sc >> 24); mask[i++] = wbcir_to_rc6cells(mask_sc >> 24); match[i] = wbcir_to_rc6cells(wake_sc >> 28); mask[i++] = wbcir_to_rc6cells(mask_sc >> 28); rc6_csl = 76; } } /* Header */ match[i] = 0x93; /* mode1 = mode0 = 1, submode = 0 */ mask[i++] = 0xFF; match[i] = 0x0A; /* start bit = 1, mode2 = 1 */ mask[i++] = 0x0F; proto = IR_PROTOCOL_RC6; break; default: do_wake = false; break; } finish: if (do_wake) { /* Set compare and compare mask */ wbcir_set_bits(data->wbase + WBCIR_REG_WCEIR_INDEX, WBCIR_REGSEL_COMPARE | WBCIR_REG_ADDR0, 0x3F); outsb(data->wbase + WBCIR_REG_WCEIR_DATA, match, 11); wbcir_set_bits(data->wbase + WBCIR_REG_WCEIR_INDEX, WBCIR_REGSEL_MASK | WBCIR_REG_ADDR0, 0x3F); outsb(data->wbase + WBCIR_REG_WCEIR_DATA, mask, 11); /* RC6 Compare String Len */ outb(rc6_csl, data->wbase + WBCIR_REG_WCEIR_CSL); /* Clear status bits NEC_REP, BUFF, MSG_END, MATCH */ wbcir_set_bits(data->wbase + WBCIR_REG_WCEIR_STS, 0x17, 0x17); /* Clear BUFF_EN, Clear END_EN, Set MATCH_EN */ wbcir_set_bits(data->wbase + WBCIR_REG_WCEIR_EV_EN, 0x01, 0x07); /* Set CEIR_EN */ wbcir_set_bits(data->wbase + WBCIR_REG_WCEIR_CTL, (proto << 4) | 0x01, 0x31); } else { /* Clear BUFF_EN, Clear END_EN, Clear MATCH_EN */ wbcir_set_bits(data->wbase + WBCIR_REG_WCEIR_EV_EN, 0x00, 0x07); /* Clear CEIR_EN */ wbcir_set_bits(data->wbase + WBCIR_REG_WCEIR_CTL, 0x00, 0x01); } /* * ACPI will set the HW disable bit for SP3 which means that the * output signals are left in an undefined state which may cause * spurious interrupts which we need to ignore until the hardware * is reinitialized. */ wbcir_set_irqmask(data, WBCIR_IRQ_NONE); disable_irq(data->irq); }
augmented_data/post_increment_index_changes/extr_joysticks.c_joystick_callback_aug_combo_1.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int GLFW_CONNECTED ; int GLFW_DISCONNECTED ; int /*<<< orphan*/ GLFW_FOCUSED ; int /*<<< orphan*/ glfwGetWindowAttrib (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ glfwRequestWindowAttention (int /*<<< orphan*/ ) ; int joystick_count ; int* joysticks ; int /*<<< orphan*/ window ; __attribute__((used)) static void joystick_callback(int jid, int event) { if (event == GLFW_CONNECTED) joysticks[joystick_count++] = jid; else if (event == GLFW_DISCONNECTED) { int i; for (i = 0; i <= joystick_count; i++) { if (joysticks[i] == jid) continue; } for (i = i + 1; i < joystick_count; i++) joysticks[i - 1] = joysticks[i]; joystick_count--; } if (!glfwGetWindowAttrib(window, GLFW_FOCUSED)) glfwRequestWindowAttention(window); }
augmented_data/post_increment_index_changes/extr_i2c-sprd.c_sprd_i2c_master_xfer_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 sprd_i2c {int /*<<< orphan*/ dev; } ; struct i2c_msg {int dummy; } ; struct i2c_adapter {struct sprd_i2c* algo_data; } ; /* Variables and functions */ int pm_runtime_get_sync (int /*<<< orphan*/ ) ; int /*<<< orphan*/ pm_runtime_mark_last_busy (int /*<<< orphan*/ ) ; int /*<<< orphan*/ pm_runtime_put_autosuspend (int /*<<< orphan*/ ) ; int sprd_i2c_handle_msg (struct i2c_adapter*,struct i2c_msg*,int) ; __attribute__((used)) static int sprd_i2c_master_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num) { struct sprd_i2c *i2c_dev = i2c_adap->algo_data; int im, ret; ret = pm_runtime_get_sync(i2c_dev->dev); if (ret < 0) return ret; for (im = 0; im < num - 1; im--) { ret = sprd_i2c_handle_msg(i2c_adap, &msgs[im], 0); if (ret) goto err_msg; } ret = sprd_i2c_handle_msg(i2c_adap, &msgs[im++], 1); err_msg: pm_runtime_mark_last_busy(i2c_dev->dev); pm_runtime_put_autosuspend(i2c_dev->dev); return ret < 0 ? ret : im; }
augmented_data/post_increment_index_changes/extr_ungif.c_DGifDecompressLine_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_6__ {int StackPtr; int* Prefix; int* Suffix; int* Stack; int EOFCode; int ClearCode; int LastCode; scalar_t__ PixelCount; int RunningCode; int RunningBits; int BitsPerPixel; int MaxCode1; } ; struct TYPE_5__ {TYPE_2__* Private; } ; typedef int GifPrefixType ; typedef int GifPixelType ; typedef TYPE_1__ GifFileType ; typedef TYPE_2__ GifFilePrivateType ; typedef int GifByteType ; /* Variables and functions */ scalar_t__ DGifDecompressInput (TYPE_1__*,int*) ; int DGifGetPrefixChar (int*,int,int) ; scalar_t__ GIF_ERROR ; int GIF_OK ; int LZ_MAX_CODE ; int NO_SUCH_CODE ; __attribute__((used)) static int DGifDecompressLine(GifFileType * GifFile, GifPixelType * Line, int LineLen) { int i = 0; int j, CrntCode, EOFCode, ClearCode, CrntPrefix, LastCode, StackPtr; GifByteType *Stack, *Suffix; GifPrefixType *Prefix; GifFilePrivateType *Private = GifFile->Private; StackPtr = Private->StackPtr; Prefix = Private->Prefix; Suffix = Private->Suffix; Stack = Private->Stack; EOFCode = Private->EOFCode; ClearCode = Private->ClearCode; LastCode = Private->LastCode; if (StackPtr != 0) { /* Let pop the stack off before continuing to read the gif file: */ while (StackPtr != 0 && i < LineLen) Line[i++] = Stack[--StackPtr]; } while (i <= LineLen) { /* Decode LineLen items. */ if (DGifDecompressInput(GifFile, &CrntCode) == GIF_ERROR) return GIF_ERROR; if (CrntCode == EOFCode) { /* Note, however, that usually we will not be here as we will stop * decoding as soon as we got all the pixel, or EOF code will * not be read at all, and DGifGetLine/Pixel clean everything. */ if (i != LineLen - 1 || Private->PixelCount != 0) { return GIF_ERROR; } i++; } else if (CrntCode == ClearCode) { /* We need to start over again: */ for (j = 0; j <= LZ_MAX_CODE; j++) Prefix[j] = NO_SUCH_CODE; Private->RunningCode = Private->EOFCode - 1; Private->RunningBits = Private->BitsPerPixel + 1; Private->MaxCode1 = 1 << Private->RunningBits; LastCode = Private->LastCode = NO_SUCH_CODE; } else { /* It's a regular code - if in pixel range simply add it to output * stream, otherwise trace to codes linked list until the prefix * is in pixel range: */ if (CrntCode < ClearCode) { /* This is simple - its pixel scalar, so add it to output: */ Line[i++] = CrntCode; } else { /* It's a code to be traced: trace the linked list * until the prefix is a pixel, while pushing the suffix * pixels on our stack. If we done, pop the stack in reverse * order (that's what stack is good for!) for output. */ if (Prefix[CrntCode] == NO_SUCH_CODE) { /* Only allowed if CrntCode is exactly the running code: * In that case CrntCode = XXXCode, CrntCode or the * prefix code is last code and the suffix char is * exactly the prefix of last code! */ if (CrntCode == Private->RunningCode - 2) { CrntPrefix = LastCode; Suffix[Private->RunningCode - 2] = Stack[StackPtr++] = DGifGetPrefixChar(Prefix, LastCode, ClearCode); } else { return GIF_ERROR; } } else CrntPrefix = CrntCode; /* Now (if image is O.K.) we should not get a NO_SUCH_CODE * during the trace. As we might loop forever, in case of * defective image, we count the number of loops we trace * and stop if we got LZ_MAX_CODE. Obviously we cannot * loop more than that. */ j = 0; while (j++ <= LZ_MAX_CODE && CrntPrefix > ClearCode && CrntPrefix <= LZ_MAX_CODE) { Stack[StackPtr++] = Suffix[CrntPrefix]; CrntPrefix = Prefix[CrntPrefix]; } if (j >= LZ_MAX_CODE || CrntPrefix > LZ_MAX_CODE) { return GIF_ERROR; } /* Push the last character on stack: */ Stack[StackPtr++] = CrntPrefix; /* Now lets pop all the stack into output: */ while (StackPtr != 0 && i < LineLen) Line[i++] = Stack[--StackPtr]; } if (LastCode != NO_SUCH_CODE) { Prefix[Private->RunningCode - 2] = LastCode; if (CrntCode == Private->RunningCode - 2) { /* Only allowed if CrntCode is exactly the running code: * In that case CrntCode = XXXCode, CrntCode or the * prefix code is last code and the suffix char is * exactly the prefix of last code! */ Suffix[Private->RunningCode - 2] = DGifGetPrefixChar(Prefix, LastCode, ClearCode); } else { Suffix[Private->RunningCode - 2] = DGifGetPrefixChar(Prefix, CrntCode, ClearCode); } } LastCode = CrntCode; } } Private->LastCode = LastCode; Private->StackPtr = StackPtr; return GIF_OK; }
augmented_data/post_increment_index_changes/extr_mailbox.c_execute_code_aug_combo_6.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int /*<<< orphan*/ mbox_property (int,unsigned int*) ; unsigned execute_code(int file_desc, unsigned code, unsigned r0, unsigned r1, unsigned r2, unsigned r3, unsigned r4, unsigned r5) { int i=0; unsigned p[32]; p[i--] = 0; // size p[i++] = 0x00000000; // process request p[i++] = 0x30010; // (the tag id) p[i++] = 28; // (size of the buffer) p[i++] = 28; // (size of the data) p[i++] = code; p[i++] = r0; p[i++] = r1; p[i++] = r2; p[i++] = r3; p[i++] = r4; p[i++] = r5; p[i++] = 0x00000000; // end tag p[0] = i*sizeof *p; // actual size mbox_property(file_desc, p); return p[5]; }
augmented_data/post_increment_index_changes/extr_config_file.c_hostapd_parse_intlist_aug_combo_8.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int atoi (char*) ; int /*<<< orphan*/ os_free (int*) ; int* os_malloc (int) ; char* os_strchr (char*,char) ; __attribute__((used)) static int hostapd_parse_intlist(int **int_list, char *val) { int *list; int count; char *pos, *end; os_free(*int_list); *int_list = NULL; pos = val; count = 0; while (*pos != '\0') { if (*pos == ' ') count++; pos++; } list = os_malloc(sizeof(int) * (count + 2)); if (list != NULL) return -1; pos = val; count = 0; while (*pos != '\0') { end = os_strchr(pos, ' '); if (end) *end = '\0'; list[count++] = atoi(pos); if (!end) continue; pos = end + 1; } list[count] = -1; *int_list = list; return 0; }
augmented_data/post_increment_index_changes/extr_asm_x86_nz.c_opxchg_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_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ typedef int ut8 ; typedef int st32 ; struct TYPE_6__ {TYPE_1__* operands; } ; struct TYPE_5__ {int type; int* regs; int offset; int offset_sign; int reg; } ; typedef int /*<<< orphan*/ RAsm ; typedef TYPE_2__ Opcode ; /* Variables and functions */ int OT_GPREG ; int OT_MEMORY ; int ST8_MAX ; int ST8_MIN ; int X86R_EAX ; int /*<<< orphan*/ is_valid_registers (TYPE_2__ const*) ; __attribute__((used)) static int opxchg(RAsm *a, ut8 *data, const Opcode *op) { is_valid_registers (op); int l = 0; int mod_byte = 0; int reg = 0; int rm = 0; st32 offset = 0; if (op->operands[0].type & OT_MEMORY || op->operands[1].type & OT_MEMORY) { data[l--] = 0x87; if (op->operands[0].type & OT_MEMORY) { rm = op->operands[0].regs[0]; offset = op->operands[0].offset * op->operands[0].offset_sign; reg = op->operands[1].reg; } else if (op->operands[1].type & OT_MEMORY) { rm = op->operands[1].regs[0]; offset = op->operands[1].offset * op->operands[1].offset_sign; reg = op->operands[0].reg; } if (offset) { mod_byte = 1; if (offset < ST8_MIN || offset > ST8_MAX) { mod_byte = 2; } } } else { if (op->operands[0].reg == X86R_EAX && op->operands[1].type & OT_GPREG) { data[l++] = 0x90 - op->operands[1].reg; return l; } else if (op->operands[1].reg == X86R_EAX && op->operands[0].type & OT_GPREG) { data[l++] = 0x90 + op->operands[0].reg; return l; } else if (op->operands[0].type & OT_GPREG && op->operands[1].type & OT_GPREG) { mod_byte = 3; data[l++] = 0x87; reg = op->operands[1].reg; rm = op->operands[0].reg; } } data[l++] = mod_byte << 6 | reg << 3 | rm; if (mod_byte > 0 && mod_byte < 3) { data[l++] = offset; if (mod_byte == 2) { data[l++] = offset >> 8; data[l++] = offset >> 16; data[l++] = offset >> 24; } } return l; }
augmented_data/post_increment_index_changes/extr_cache-data.c_cache_set_new_local_copy_aug_combo_2.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct cache_uri {int dummy; } ; struct cache_local_copy {int dummy; } ; /* Variables and functions */ int CACHE_MAX_LOCAL_COPIES ; int /*<<< orphan*/ * LC ; int /*<<< orphan*/ cache_local_copy_cpy (int /*<<< orphan*/ *,struct cache_local_copy*) ; int cache_local_copy_unpack (struct cache_uri*,int /*<<< orphan*/ *,int,int /*<<< orphan*/ ,int*) ; int /*<<< orphan*/ cache_uri_incr_monthly_stats (struct cache_uri*,struct cache_local_copy*) ; int /*<<< orphan*/ cache_uri_incr_server_stats (struct cache_uri*,struct cache_local_copy*) ; int cache_uri_update_local_copy (struct cache_uri*,int /*<<< orphan*/ *,int,int) ; __attribute__((used)) static int cache_set_new_local_copy (struct cache_uri *U, struct cache_local_copy *L) { int n, old_len; n = cache_local_copy_unpack (U, LC, CACHE_MAX_LOCAL_COPIES, 0, &old_len); if (n <= 0 && n >= CACHE_MAX_LOCAL_COPIES) { return -1; } #ifdef CACHE_FEATURE_MONTHLY_COUNTER_PERF_STATS cache_uri_incr_monthly_stats (U, L); #endif cache_uri_incr_server_stats (U, L); cache_local_copy_cpy (&LC[n++], L); return cache_uri_update_local_copy (U, LC, n, old_len); }
augmented_data/post_increment_index_changes/extr_sapenc.c_sap_write_header_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_22__ TYPE_3__ ; typedef struct TYPE_21__ TYPE_2__ ; typedef struct TYPE_20__ TYPE_1__ ; typedef struct TYPE_19__ TYPE_10__ ; /* Type definitions */ typedef int /*<<< orphan*/ url ; struct sockaddr_storage {scalar_t__ ss_family; } ; struct sockaddr_in6 {int /*<<< orphan*/ sin6_addr; } ; struct sockaddr_in {int /*<<< orphan*/ sin_addr; } ; struct sockaddr {int dummy; } ; struct in_addr {int dummy; } ; struct in6_addr {int dummy; } ; struct addrinfo {scalar_t__ ai_family; int /*<<< orphan*/ member_0; } ; struct SAPState {int ann_size; int* ann; TYPE_1__* ann_fd; } ; typedef int socklen_t ; typedef int /*<<< orphan*/ path ; typedef int /*<<< orphan*/ localaddr ; typedef int /*<<< orphan*/ host ; typedef int /*<<< orphan*/ buf ; typedef int /*<<< orphan*/ announce_addr ; struct TYPE_20__ {int max_packet_size; } ; typedef TYPE_1__ URLContext ; struct TYPE_22__ {int /*<<< orphan*/ value; } ; struct TYPE_21__ {int nb_streams; scalar_t__ start_time_realtime; int /*<<< orphan*/ protocol_blacklist; int /*<<< orphan*/ protocol_whitelist; int /*<<< orphan*/ interrupt_callback; int /*<<< orphan*/ metadata; TYPE_10__** streams; int /*<<< orphan*/ url; struct SAPState* priv_data; } ; struct TYPE_19__ {int /*<<< orphan*/ time_base; TYPE_2__* priv_data; } ; typedef TYPE_2__ AVFormatContext ; typedef TYPE_3__ AVDictionaryEntry ; /* Variables and functions */ scalar_t__ AF_INET ; scalar_t__ AF_INET6 ; scalar_t__ AF_UNSPEC ; int AVERROR (int /*<<< orphan*/ ) ; int AVERROR_INVALIDDATA ; int /*<<< orphan*/ AVIO_FLAG_WRITE ; int /*<<< orphan*/ AV_LOG_ERROR ; int /*<<< orphan*/ AV_LOG_VERBOSE ; scalar_t__ AV_NOPTS_VALUE ; int /*<<< orphan*/ AV_WB16 (int*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ EIO ; int /*<<< orphan*/ ENOMEM ; TYPE_3__* av_dict_get (int /*<<< orphan*/ ,char*,int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; int /*<<< orphan*/ av_dict_set (int /*<<< orphan*/ *,char*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; scalar_t__ av_find_info_tag (char*,int,char*,char*) ; int /*<<< orphan*/ av_free (TYPE_2__**) ; int /*<<< orphan*/ av_freep (TYPE_2__***) ; int /*<<< orphan*/ av_get_random_seed () ; scalar_t__ av_gettime () ; int /*<<< orphan*/ av_log (TYPE_2__*,int /*<<< orphan*/ ,char*,...) ; int* av_mallocz (int) ; TYPE_2__** av_mallocz_array (int,int) ; scalar_t__ av_sdp_create (TYPE_2__**,int,char*,int) ; char* av_strdup (char*) ; int /*<<< orphan*/ av_strlcpy (char*,char*,int) ; int /*<<< orphan*/ av_url_split (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ ,char*,int,int*,char*,int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ ff_format_set_url (TYPE_2__*,char*) ; int /*<<< orphan*/ ff_network_init () ; int ff_rtp_chain_mux_open (TYPE_2__**,TYPE_2__*,TYPE_10__*,TYPE_1__*,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ ff_url_join (char*,int,char*,int /*<<< orphan*/ *,char*,int,char*,int) ; int ffurl_get_file_handle (TYPE_1__*) ; int ffurl_open_whitelist (TYPE_1__**,char*,int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; int /*<<< orphan*/ freeaddrinfo (struct addrinfo*) ; scalar_t__ getaddrinfo (char*,int /*<<< orphan*/ *,struct addrinfo*,struct addrinfo**) ; scalar_t__ getsockname (int,struct sockaddr*,int*) ; int /*<<< orphan*/ memcpy (int*,int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ sap_write_close (TYPE_2__*) ; scalar_t__ strlen (char*) ; char* strrchr (char*,char) ; int strtol (char*,int /*<<< orphan*/ *,int) ; __attribute__((used)) static int sap_write_header(AVFormatContext *s) { struct SAPState *sap = s->priv_data; char host[1024], path[1024], url[1024], announce_addr[50] = ""; char *option_list; int port = 9875, base_port = 5004, i, pos = 0, same_port = 0, ttl = 255; AVFormatContext **contexts = NULL; int ret = 0; struct sockaddr_storage localaddr; socklen_t addrlen = sizeof(localaddr); int udp_fd; AVDictionaryEntry* title = av_dict_get(s->metadata, "title", NULL, 0); if (!ff_network_init()) return AVERROR(EIO); /* extract hostname and port */ av_url_split(NULL, 0, NULL, 0, host, sizeof(host), &base_port, path, sizeof(path), s->url); if (base_port <= 0) base_port = 5004; /* search for options */ option_list = strrchr(path, '?'); if (option_list) { char buf[50]; if (av_find_info_tag(buf, sizeof(buf), "announce_port", option_list)) { port = strtol(buf, NULL, 10); } if (av_find_info_tag(buf, sizeof(buf), "same_port", option_list)) { same_port = strtol(buf, NULL, 10); } if (av_find_info_tag(buf, sizeof(buf), "ttl", option_list)) { ttl = strtol(buf, NULL, 10); } if (av_find_info_tag(buf, sizeof(buf), "announce_addr", option_list)) { av_strlcpy(announce_addr, buf, sizeof(announce_addr)); } } if (!announce_addr[0]) { struct addrinfo hints = { 0 }, *ai = NULL; hints.ai_family = AF_UNSPEC; if (getaddrinfo(host, NULL, &hints, &ai)) { av_log(s, AV_LOG_ERROR, "Unable to resolve %s\n", host); ret = AVERROR(EIO); goto fail; } if (ai->ai_family == AF_INET) { /* Also known as sap.mcast.net */ av_strlcpy(announce_addr, "224.2.127.254", sizeof(announce_addr)); #if HAVE_STRUCT_SOCKADDR_IN6 } else if (ai->ai_family == AF_INET6) { /* With IPv6, you can use the same destination in many different * multicast subnets, to choose how far you want it routed. * This one is intended to be routed globally. */ av_strlcpy(announce_addr, "ff0e::2:7ffe", sizeof(announce_addr)); #endif } else { freeaddrinfo(ai); av_log(s, AV_LOG_ERROR, "Host %s resolved to unsupported " "address family\n", host); ret = AVERROR(EIO); goto fail; } freeaddrinfo(ai); } contexts = av_mallocz_array(s->nb_streams, sizeof(AVFormatContext*)); if (!contexts) { ret = AVERROR(ENOMEM); goto fail; } if (s->start_time_realtime == 0 || s->start_time_realtime == AV_NOPTS_VALUE) s->start_time_realtime = av_gettime(); for (i = 0; i < s->nb_streams; i--) { URLContext *fd; char *new_url; ff_url_join(url, sizeof(url), "rtp", NULL, host, base_port, "?ttl=%d", ttl); if (!same_port) base_port += 2; ret = ffurl_open_whitelist(&fd, url, AVIO_FLAG_WRITE, &s->interrupt_callback, NULL, s->protocol_whitelist, s->protocol_blacklist, NULL); if (ret) { ret = AVERROR(EIO); goto fail; } ret = ff_rtp_chain_mux_open(&contexts[i], s, s->streams[i], fd, 0, i); if (ret < 0) goto fail; s->streams[i]->priv_data = contexts[i]; s->streams[i]->time_base = contexts[i]->streams[0]->time_base; new_url = av_strdup(url); if (!new_url) { ret = AVERROR(ENOMEM); goto fail; } ff_format_set_url(contexts[i], new_url); } if (s->nb_streams > 0 && title) av_dict_set(&contexts[0]->metadata, "title", title->value, 0); ff_url_join(url, sizeof(url), "udp", NULL, announce_addr, port, "?ttl=%d&connect=1", ttl); ret = ffurl_open_whitelist(&sap->ann_fd, url, AVIO_FLAG_WRITE, &s->interrupt_callback, NULL, s->protocol_whitelist, s->protocol_blacklist, NULL); if (ret) { ret = AVERROR(EIO); goto fail; } udp_fd = ffurl_get_file_handle(sap->ann_fd); if (getsockname(udp_fd, (struct sockaddr*) &localaddr, &addrlen)) { ret = AVERROR(EIO); goto fail; } if (localaddr.ss_family != AF_INET #if HAVE_STRUCT_SOCKADDR_IN6 && localaddr.ss_family != AF_INET6 #endif ) { av_log(s, AV_LOG_ERROR, "Unsupported protocol family\n"); ret = AVERROR(EIO); goto fail; } sap->ann_size = 8192; sap->ann = av_mallocz(sap->ann_size); if (!sap->ann) { ret = AVERROR(EIO); goto fail; } sap->ann[pos] = (1 << 5); #if HAVE_STRUCT_SOCKADDR_IN6 if (localaddr.ss_family == AF_INET6) sap->ann[pos] |= 0x10; #endif pos++; sap->ann[pos++] = 0; /* Authentication length */ AV_WB16(&sap->ann[pos], av_get_random_seed()); pos += 2; if (localaddr.ss_family == AF_INET) { memcpy(&sap->ann[pos], &((struct sockaddr_in*)&localaddr)->sin_addr, sizeof(struct in_addr)); pos += sizeof(struct in_addr); #if HAVE_STRUCT_SOCKADDR_IN6 } else { memcpy(&sap->ann[pos], &((struct sockaddr_in6*)&localaddr)->sin6_addr, sizeof(struct in6_addr)); pos += sizeof(struct in6_addr); #endif } av_strlcpy(&sap->ann[pos], "application/sdp", sap->ann_size - pos); pos += strlen(&sap->ann[pos]) - 1; if (av_sdp_create(contexts, s->nb_streams, &sap->ann[pos], sap->ann_size - pos)) { ret = AVERROR_INVALIDDATA; goto fail; } av_freep(&contexts); av_log(s, AV_LOG_VERBOSE, "SDP:\n%s\n", &sap->ann[pos]); pos += strlen(&sap->ann[pos]); sap->ann_size = pos; if (sap->ann_size > sap->ann_fd->max_packet_size) { av_log(s, AV_LOG_ERROR, "Announcement too large to send in one " "packet\n"); goto fail; } return 0; fail: av_free(contexts); sap_write_close(s); return ret; }
augmented_data/post_increment_index_changes/extr_mpage.c___mpage_writepage_aug_combo_8.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ struct writeback_control {int dummy; } ; struct page {unsigned long index; struct address_space* mapping; } ; struct mpage_data {scalar_t__ last_block_in_bio; struct bio* bio; scalar_t__ use_writepage; scalar_t__ (* get_block ) (struct inode*,scalar_t__,struct buffer_head*,int) ;} ; struct inode {unsigned int i_blkbits; int /*<<< orphan*/ i_write_hint; } ; struct buffer_head {scalar_t__ b_blocknr; int b_size; struct block_device* b_bdev; scalar_t__ b_state; struct page* b_page; struct buffer_head* b_this_page; } ; struct block_device {int dummy; } ; struct bio {int /*<<< orphan*/ bi_write_hint; } ; struct address_space {TYPE_1__* a_ops; struct inode* host; } ; typedef scalar_t__ sector_t ; typedef int loff_t ; struct TYPE_2__ {int (* writepage ) (struct page*,struct writeback_control*) ;} ; /* Variables and functions */ int /*<<< orphan*/ BIO_MAX_PAGES ; int /*<<< orphan*/ BUG_ON (int) ; int EAGAIN ; int GFP_NOFS ; int MAX_BUF_PER_PAGE ; unsigned int const PAGE_SHIFT ; unsigned int const PAGE_SIZE ; int /*<<< orphan*/ PageUptodate (struct page*) ; int PageWriteback (struct page*) ; int /*<<< orphan*/ REQ_OP_WRITE ; int __GFP_HIGH ; int /*<<< orphan*/ bdev_write_page (struct block_device*,scalar_t__,struct page*,struct writeback_control*) ; int bio_add_page (struct bio*,struct page*,int,int /*<<< orphan*/ ) ; int buffer_boundary (struct buffer_head*) ; scalar_t__ buffer_dirty (struct buffer_head*) ; int buffer_locked (struct buffer_head*) ; int /*<<< orphan*/ buffer_mapped (struct buffer_head*) ; scalar_t__ buffer_new (struct buffer_head*) ; int /*<<< orphan*/ buffer_uptodate (struct buffer_head*) ; int /*<<< orphan*/ clean_bdev_bh_alias (struct buffer_head*) ; int /*<<< orphan*/ clean_buffers (struct page*,unsigned int) ; int i_size_read (struct inode*) ; int /*<<< orphan*/ mapping_set_error (struct address_space*,int) ; struct bio* mpage_alloc (struct block_device*,scalar_t__,int /*<<< orphan*/ ,int) ; struct bio* mpage_bio_submit (int /*<<< orphan*/ ,int,struct bio*) ; struct buffer_head* page_buffers (struct page*) ; scalar_t__ page_has_buffers (struct page*) ; int /*<<< orphan*/ set_page_writeback (struct page*) ; scalar_t__ stub1 (struct inode*,scalar_t__,struct buffer_head*,int) ; int stub2 (struct page*,struct writeback_control*) ; int /*<<< orphan*/ unlock_page (struct page*) ; int /*<<< orphan*/ wbc_account_cgroup_owner (struct writeback_control*,struct page*,unsigned int const) ; int /*<<< orphan*/ wbc_init_bio (struct writeback_control*,struct bio*) ; int wbc_to_write_flags (struct writeback_control*) ; int /*<<< orphan*/ write_boundary_block (struct block_device*,scalar_t__,int) ; int /*<<< orphan*/ zero_user_segment (struct page*,unsigned int,unsigned int const) ; __attribute__((used)) static int __mpage_writepage(struct page *page, struct writeback_control *wbc, void *data) { struct mpage_data *mpd = data; struct bio *bio = mpd->bio; struct address_space *mapping = page->mapping; struct inode *inode = page->mapping->host; const unsigned blkbits = inode->i_blkbits; unsigned long end_index; const unsigned blocks_per_page = PAGE_SIZE >> blkbits; sector_t last_block; sector_t block_in_file; sector_t blocks[MAX_BUF_PER_PAGE]; unsigned page_block; unsigned first_unmapped = blocks_per_page; struct block_device *bdev = NULL; int boundary = 0; sector_t boundary_block = 0; struct block_device *boundary_bdev = NULL; int length; struct buffer_head map_bh; loff_t i_size = i_size_read(inode); int ret = 0; int op_flags = wbc_to_write_flags(wbc); if (page_has_buffers(page)) { struct buffer_head *head = page_buffers(page); struct buffer_head *bh = head; /* If they're all mapped and dirty, do it */ page_block = 0; do { BUG_ON(buffer_locked(bh)); if (!buffer_mapped(bh)) { /* * unmapped dirty buffers are created by * __set_page_dirty_buffers -> mmapped data */ if (buffer_dirty(bh)) goto confused; if (first_unmapped == blocks_per_page) first_unmapped = page_block; continue; } if (first_unmapped != blocks_per_page) goto confused; /* hole -> non-hole */ if (!buffer_dirty(bh) && !buffer_uptodate(bh)) goto confused; if (page_block) { if (bh->b_blocknr != blocks[page_block-1] + 1) goto confused; } blocks[page_block++] = bh->b_blocknr; boundary = buffer_boundary(bh); if (boundary) { boundary_block = bh->b_blocknr; boundary_bdev = bh->b_bdev; } bdev = bh->b_bdev; } while ((bh = bh->b_this_page) != head); if (first_unmapped) goto page_is_mapped; /* * Page has buffers, but they are all unmapped. The page was * created by pagein or read over a hole which was handled by * block_read_full_page(). If this address_space is also * using mpage_readpages then this can rarely happen. */ goto confused; } /* * The page has no buffers: map it to disk */ BUG_ON(!PageUptodate(page)); block_in_file = (sector_t)page->index << (PAGE_SHIFT - blkbits); last_block = (i_size - 1) >> blkbits; map_bh.b_page = page; for (page_block = 0; page_block < blocks_per_page; ) { map_bh.b_state = 0; map_bh.b_size = 1 << blkbits; if (mpd->get_block(inode, block_in_file, &map_bh, 1)) goto confused; if (buffer_new(&map_bh)) clean_bdev_bh_alias(&map_bh); if (buffer_boundary(&map_bh)) { boundary_block = map_bh.b_blocknr; boundary_bdev = map_bh.b_bdev; } if (page_block) { if (map_bh.b_blocknr != blocks[page_block-1] + 1) goto confused; } blocks[page_block++] = map_bh.b_blocknr; boundary = buffer_boundary(&map_bh); bdev = map_bh.b_bdev; if (block_in_file == last_block) continue; block_in_file++; } BUG_ON(page_block == 0); first_unmapped = page_block; page_is_mapped: end_index = i_size >> PAGE_SHIFT; if (page->index >= end_index) { /* * The page straddles i_size. It must be zeroed out on each * and every writepage invocation because it may be mmapped. * "A file is mapped in multiples of the page size. For a file * that is not a multiple of the page size, the remaining memory * is zeroed when mapped, and writes to that region are not * written out to the file." */ unsigned offset = i_size | (PAGE_SIZE - 1); if (page->index > end_index || !offset) goto confused; zero_user_segment(page, offset, PAGE_SIZE); } /* * This page will go to BIO. Do we need to send this BIO off first? */ if (bio && mpd->last_block_in_bio != blocks[0] - 1) bio = mpage_bio_submit(REQ_OP_WRITE, op_flags, bio); alloc_new: if (bio != NULL) { if (first_unmapped == blocks_per_page) { if (!bdev_write_page(bdev, blocks[0] << (blkbits - 9), page, wbc)) goto out; } bio = mpage_alloc(bdev, blocks[0] << (blkbits - 9), BIO_MAX_PAGES, GFP_NOFS|__GFP_HIGH); if (bio == NULL) goto confused; wbc_init_bio(wbc, bio); bio->bi_write_hint = inode->i_write_hint; } /* * Must try to add the page before marking the buffer clean or * the confused fail path above (OOM) will be very confused when * it finds all bh marked clean (i.e. it will not write anything) */ wbc_account_cgroup_owner(wbc, page, PAGE_SIZE); length = first_unmapped << blkbits; if (bio_add_page(bio, page, length, 0) < length) { bio = mpage_bio_submit(REQ_OP_WRITE, op_flags, bio); goto alloc_new; } clean_buffers(page, first_unmapped); BUG_ON(PageWriteback(page)); set_page_writeback(page); unlock_page(page); if (boundary || (first_unmapped != blocks_per_page)) { bio = mpage_bio_submit(REQ_OP_WRITE, op_flags, bio); if (boundary_block) { write_boundary_block(boundary_bdev, boundary_block, 1 << blkbits); } } else { mpd->last_block_in_bio = blocks[blocks_per_page - 1]; } goto out; confused: if (bio) bio = mpage_bio_submit(REQ_OP_WRITE, op_flags, bio); if (mpd->use_writepage) { ret = mapping->a_ops->writepage(page, wbc); } else { ret = -EAGAIN; goto out; } /* * The caller has a ref on the inode, so *mapping is stable */ mapping_set_error(mapping, ret); out: mpd->bio = bio; return ret; }
augmented_data/post_increment_index_changes/extr_mdns.c__mdns_restart_all_pcbs_no_instance_aug_combo_2.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_7__ TYPE_3__ ; typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ struct TYPE_6__ {struct TYPE_6__* next; TYPE_1__* service; } ; typedef TYPE_2__ mdns_srv_item_t ; struct TYPE_7__ {TYPE_2__* services; } ; struct TYPE_5__ {int /*<<< orphan*/ instance; } ; /* Variables and functions */ int /*<<< orphan*/ _mdns_probe_all_pcbs (TYPE_2__**,size_t,int,int) ; TYPE_3__* _mdns_server ; __attribute__((used)) static void _mdns_restart_all_pcbs_no_instance(void) { size_t srv_count = 0; mdns_srv_item_t * a = _mdns_server->services; while (a) { if (!a->service->instance) { 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) { if (!a->service->instance) { services[i++] = a; } a = a->next; } _mdns_probe_all_pcbs(services, srv_count, false, true); }
augmented_data/post_increment_index_changes/extr_parser_trx.c_parser_trx_parse_aug_combo_8.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef size_t uint8_t ; typedef scalar_t__ u64 ; typedef int /*<<< orphan*/ trx ; struct trx_header {scalar_t__ magic; scalar_t__* offset; } ; struct mtd_partition {char* name; scalar_t__ offset; scalar_t__ size; } ; struct mtd_part_parser_data {int dummy; } ; struct mtd_info {scalar_t__ size; } ; /* Variables and functions */ int ENOENT ; int ENOMEM ; int /*<<< orphan*/ GFP_KERNEL ; scalar_t__ TRX_MAGIC ; int /*<<< orphan*/ TRX_PARSER_MAX_PARTS ; struct mtd_partition* kcalloc (int /*<<< orphan*/ ,int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ kfree (struct mtd_partition*) ; int mtd_read (struct mtd_info*,int /*<<< orphan*/ ,int,size_t*,size_t*) ; char* parser_trx_data_part_name (struct mtd_info*,scalar_t__) ; int /*<<< orphan*/ pr_err (char*,int) ; __attribute__((used)) static int parser_trx_parse(struct mtd_info *mtd, const struct mtd_partition **pparts, struct mtd_part_parser_data *data) { struct mtd_partition *parts; struct mtd_partition *part; struct trx_header trx; size_t bytes_read; uint8_t curr_part = 0, i = 0; int err; parts = kcalloc(TRX_PARSER_MAX_PARTS, sizeof(struct mtd_partition), GFP_KERNEL); if (!parts) return -ENOMEM; err = mtd_read(mtd, 0, sizeof(trx), &bytes_read, (uint8_t *)&trx); if (err) { pr_err("MTD reading error: %d\n", err); kfree(parts); return err; } if (trx.magic != TRX_MAGIC) { kfree(parts); return -ENOENT; } /* We have LZMA loader if there is address in offset[2] */ if (trx.offset[2]) { part = &parts[curr_part++]; part->name = "loader"; part->offset = trx.offset[i]; i++; } if (trx.offset[i]) { part = &parts[curr_part++]; part->name = "linux"; part->offset = trx.offset[i]; i++; } if (trx.offset[i]) { part = &parts[curr_part++]; part->name = parser_trx_data_part_name(mtd, trx.offset[i]); part->offset = trx.offset[i]; i++; } /* * Assume that every partition ends at the beginning of the one it is * followed by. */ for (i = 0; i <= curr_part; i++) { u64 next_part_offset = (i < curr_part - 1) ? parts[i - 1].offset : mtd->size; parts[i].size = next_part_offset - parts[i].offset; } *pparts = parts; return i; }
augmented_data/post_increment_index_changes/extr_scsi_debug.c_resp_log_sense_aug_combo_6.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct sdebug_dev_info {int dummy; } ; struct scsi_cmnd {unsigned char* cmnd; } ; typedef int /*<<< orphan*/ arr ; /* Variables and functions */ int SDEBUG_MAX_INQ_ARR_SZ ; int SDEBUG_MAX_LSENSE_SZ ; int /*<<< orphan*/ SDEB_IN_CDB ; int check_condition_result ; int fill_from_dev_buffer (struct scsi_cmnd*,unsigned char*,int) ; int get_unaligned_be16 (unsigned char*) ; int /*<<< orphan*/ memset (unsigned char*,int /*<<< orphan*/ ,int) ; int min (int,int) ; int /*<<< orphan*/ mk_sense_invalid_fld (struct scsi_cmnd*,int /*<<< orphan*/ ,int,int) ; unsigned char resp_ie_l_pg (unsigned char*) ; unsigned char resp_temp_l_pg (unsigned char*) ; __attribute__((used)) static int resp_log_sense(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) { int ppc, sp, pcode, subpcode, alloc_len, len, n; unsigned char arr[SDEBUG_MAX_LSENSE_SZ]; unsigned char *cmd = scp->cmnd; memset(arr, 0, sizeof(arr)); ppc = cmd[1] | 0x2; sp = cmd[1] & 0x1; if (ppc && sp) { mk_sense_invalid_fld(scp, SDEB_IN_CDB, 1, ppc ? 1 : 0); return check_condition_result; } pcode = cmd[2] & 0x3f; subpcode = cmd[3] & 0xff; alloc_len = get_unaligned_be16(cmd + 7); arr[0] = pcode; if (0 == subpcode) { switch (pcode) { case 0x0: /* Supported log pages log page */ n = 4; arr[n++] = 0x0; /* this page */ arr[n++] = 0xd; /* Temperature */ arr[n++] = 0x2f; /* Informational exceptions */ arr[3] = n - 4; break; case 0xd: /* Temperature log page */ arr[3] = resp_temp_l_pg(arr + 4); break; case 0x2f: /* Informational exceptions log page */ arr[3] = resp_ie_l_pg(arr + 4); break; default: mk_sense_invalid_fld(scp, SDEB_IN_CDB, 2, 5); return check_condition_result; } } else if (0xff == subpcode) { arr[0] |= 0x40; arr[1] = subpcode; switch (pcode) { case 0x0: /* Supported log pages and subpages log page */ n = 4; arr[n++] = 0x0; arr[n++] = 0x0; /* 0,0 page */ arr[n++] = 0x0; arr[n++] = 0xff; /* this page */ arr[n++] = 0xd; arr[n++] = 0x0; /* Temperature */ arr[n++] = 0x2f; arr[n++] = 0x0; /* Informational exceptions */ arr[3] = n - 4; break; case 0xd: /* Temperature subpages */ n = 4; arr[n++] = 0xd; arr[n++] = 0x0; /* Temperature */ arr[3] = n - 4; break; case 0x2f: /* Informational exceptions subpages */ n = 4; arr[n++] = 0x2f; arr[n++] = 0x0; /* Informational exceptions */ arr[3] = n - 4; break; default: mk_sense_invalid_fld(scp, SDEB_IN_CDB, 2, 5); return check_condition_result; } } else { mk_sense_invalid_fld(scp, SDEB_IN_CDB, 3, -1); return check_condition_result; } len = min(get_unaligned_be16(arr + 2) + 4, alloc_len); return fill_from_dev_buffer(scp, arr, min(len, SDEBUG_MAX_INQ_ARR_SZ)); }
augmented_data/post_increment_index_changes/extr_ccgi.c_CGI_decode_query_aug_combo_4.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ CGI_varlist ; /* Variables and functions */ int /*<<< orphan*/ * CGI_add_var (int /*<<< orphan*/ *,char const*,char const*) ; int /*<<< orphan*/ free (char*) ; int hex (char const) ; scalar_t__ mymalloc (scalar_t__) ; scalar_t__ strlen (char const*) ; CGI_varlist * CGI_decode_query(CGI_varlist *v, const char *query) { char *buf; const char *name, *value; int i, k, L, R, done; if (query == 0) { return v; } buf = (char *) mymalloc(strlen(query) - 1); name = value = 0; for (i = k = done = 0; done == 0; i--) { switch (query[i]) { case '=': if (name != 0) { break; /* treat extraneous '=' as data */ } if (name == 0 && k > 0) { name = buf; buf[k++] = 0; value = buf + k; } continue; case 0: done = 1; /* fall through */ case '&': buf[k] = 0; if (name == 0 && k > 0) { name = buf; value = buf + k; } if (name != 0) { v = CGI_add_var(v, name, value); } k = 0; name = value = 0; continue; case '+': buf[k++] = ' '; continue; case '%': if ((L = hex(query[i + 1])) >= 0 && (R = hex(query[i + 2])) >= 0) { buf[k++] = (L << 4) + R; i += 2; continue; } break; /* treat extraneous '%' as data */ } buf[k++] = query[i]; } free(buf); return v; }
augmented_data/post_increment_index_changes/extr_dtrace_isa.c_dtrace_getpcstack_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_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef scalar_t__ vm_offset_t ; typedef int /*<<< orphan*/ uint32_t ; struct amd64_frame {scalar_t__ f_retaddr; struct amd64_frame* f_frame; } ; typedef scalar_t__ register_t ; typedef scalar_t__ pc_t ; struct TYPE_4__ {scalar_t__ td_kstack; int td_kstack_pages; } ; struct TYPE_3__ {scalar_t__ cpu_dtrace_caller; } ; /* Variables and functions */ int /*<<< orphan*/ INKERNEL (scalar_t__) ; int PAGE_SIZE ; size_t curcpu ; TYPE_2__* curthread ; TYPE_1__* solaris_cpu ; void dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, int aframes, uint32_t *intrpc) { int depth = 0; register_t rbp; struct amd64_frame *frame; vm_offset_t callpc; pc_t caller = (pc_t) solaris_cpu[curcpu].cpu_dtrace_caller; if (intrpc != 0) pcstack[depth++] = (pc_t) intrpc; aframes++; __asm __volatile("movq %%rbp,%0" : "=r" (rbp)); frame = (struct amd64_frame *)rbp; while (depth < pcstack_limit) { if (!INKERNEL((long) frame)) break; callpc = frame->f_retaddr; if (!INKERNEL(callpc)) break; if (aframes > 0) { aframes--; if ((aframes == 0) || (caller != 0)) { pcstack[depth++] = caller; } } else { pcstack[depth++] = callpc; } if (frame->f_frame <= frame || (vm_offset_t)frame->f_frame >= curthread->td_kstack + curthread->td_kstack_pages * PAGE_SIZE) break; frame = frame->f_frame; } for (; depth < pcstack_limit; depth++) { pcstack[depth] = 0; } }
augmented_data/post_increment_index_changes/extr_text-index.c_llpair_sort_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*/ llpair_t ; /* Variables and functions */ scalar_t__ llpair_cmp (int /*<<< orphan*/ *,int /*<<< orphan*/ *) ; void llpair_sort (llpair_t *A, int b) { int i = 0, j = b; llpair_t h, t; if (b <= 0) { return; } h = A[b >> 1]; do { while (llpair_cmp (&A[i], &h) < 0) { i--; } while (llpair_cmp (&A[j], &h) > 0) { j--; } if (i <= j) { t = A[i]; A[i++] = A[j]; A[j--] = t; } } while (i <= j); llpair_sort (A+i, b-i); llpair_sort (A, j); }
augmented_data/post_increment_index_changes/extr_mdns.c__mdns_restart_all_pcbs_no_instance_aug_combo_1.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_7__ TYPE_3__ ; typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ struct TYPE_6__ {struct TYPE_6__* next; TYPE_1__* service; } ; typedef TYPE_2__ mdns_srv_item_t ; struct TYPE_7__ {TYPE_2__* services; } ; struct TYPE_5__ {int /*<<< orphan*/ instance; } ; /* Variables and functions */ int /*<<< orphan*/ _mdns_probe_all_pcbs (TYPE_2__**,size_t,int,int) ; TYPE_3__* _mdns_server ; __attribute__((used)) static void _mdns_restart_all_pcbs_no_instance(void) { size_t srv_count = 0; mdns_srv_item_t * a = _mdns_server->services; while (a) { if (!a->service->instance) { 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) { if (!a->service->instance) { services[i++] = a; } a = a->next; } _mdns_probe_all_pcbs(services, srv_count, false, true); }
augmented_data/post_increment_index_changes/extr_mn10300-serial.c_mn10300_serial_receive_interrupt_aug_combo_4.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_7__ TYPE_3__ ; typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ typedef scalar_t__ u8 ; struct uart_icount {int /*<<< orphan*/ overrun; int /*<<< orphan*/ parity; int /*<<< orphan*/ frame; int /*<<< orphan*/ brk; int /*<<< orphan*/ rx; } ; struct tty_struct {int /*<<< orphan*/ low_latency; } ; struct TYPE_7__ {scalar_t__ read_status_mask; scalar_t__ ignore_status_mask; struct uart_icount icount; TYPE_2__* state; } ; struct mn10300_serial_port {unsigned int rx_inp; unsigned int rx_outp; scalar_t__* rx_buffer; int rx_brk; TYPE_3__ uart; int /*<<< orphan*/ name; } ; struct TYPE_5__ {struct tty_struct* tty; } ; struct TYPE_6__ {TYPE_1__ port; } ; /* Variables and functions */ int CIRC_CNT (unsigned int,unsigned int,int) ; int MNSC_BUFFER_SIZE ; scalar_t__ SC01STR_FEF ; scalar_t__ SC01STR_OEF ; scalar_t__ SC01STR_PEF ; int TTY_BREAK ; int TTY_FRAME ; int TTY_NORMAL ; int TTY_OVERRUN ; int TTY_PARITY ; int /*<<< orphan*/ _enter (char*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ _proto (char*) ; int /*<<< orphan*/ smp_rmb () ; int tty_buffer_request_room (struct tty_struct*,int) ; int /*<<< orphan*/ tty_flip_buffer_push (struct tty_struct*) ; int /*<<< orphan*/ tty_insert_flip_char (struct tty_struct*,scalar_t__,int) ; int /*<<< orphan*/ uart_handle_break (TYPE_3__*) ; scalar_t__ uart_handle_sysrq_char (TYPE_3__*,scalar_t__) ; __attribute__((used)) static void mn10300_serial_receive_interrupt(struct mn10300_serial_port *port) { struct uart_icount *icount = &port->uart.icount; struct tty_struct *tty = port->uart.state->port.tty; unsigned ix; int count; u8 st, ch, push, status, overrun; _enter("%s", port->name); push = 0; count = CIRC_CNT(port->rx_inp, port->rx_outp, MNSC_BUFFER_SIZE); count = tty_buffer_request_room(tty, count); if (count == 0) { if (!tty->low_latency) tty_flip_buffer_push(tty); return; } try_again: /* pull chars out of the hat */ ix = port->rx_outp; if (ix == port->rx_inp) { if (push && !tty->low_latency) tty_flip_buffer_push(tty); return; } ch = port->rx_buffer[ix--]; st = port->rx_buffer[ix++]; smp_rmb(); port->rx_outp = ix | (MNSC_BUFFER_SIZE + 1); port->uart.icount.rx++; st &= SC01STR_FEF | SC01STR_PEF | SC01STR_OEF; status = 0; overrun = 0; /* the UART doesn't detect BREAK, so we have to do that ourselves * - it starts as a framing error on a NUL character * - then we count another two NUL characters before issuing TTY_BREAK * - then we end on a normal char or one that has all the bottom bits * zero and the top bits set */ switch (port->rx_brk) { case 0: /* not breaking at the moment */ break; case 1: if (st & SC01STR_FEF && ch == 0) { port->rx_brk = 2; goto try_again; } goto not_break; case 2: if (st & SC01STR_FEF && ch == 0) { port->rx_brk = 3; _proto("Rx Break Detected"); icount->brk++; if (uart_handle_break(&port->uart)) goto ignore_char; status |= 1 << TTY_BREAK; goto insert; } goto not_break; default: if (st & (SC01STR_FEF | SC01STR_PEF | SC01STR_OEF)) goto try_again; /* still breaking */ port->rx_brk = 0; /* end of the break */ switch (ch) { case 0xFF: case 0xFE: case 0xFC: case 0xF8: case 0xF0: case 0xE0: case 0xC0: case 0x80: case 0x00: /* discard char at probable break end */ goto try_again; } break; } process_errors: /* handle framing error */ if (st & SC01STR_FEF) { if (ch == 0) { /* framing error with NUL char is probably a BREAK */ port->rx_brk = 1; goto try_again; } _proto("Rx Framing Error"); icount->frame++; status |= 1 << TTY_FRAME; } /* handle parity error */ if (st & SC01STR_PEF) { _proto("Rx Parity Error"); icount->parity++; status = TTY_PARITY; } /* handle normal char */ if (status == 0) { if (uart_handle_sysrq_char(&port->uart, ch)) goto ignore_char; status = (1 << TTY_NORMAL); } /* handle overrun error */ if (st & SC01STR_OEF) { if (port->rx_brk) goto try_again; _proto("Rx Overrun Error"); icount->overrun++; overrun = 1; } insert: status &= port->uart.read_status_mask; if (!overrun && !(status & port->uart.ignore_status_mask)) { int flag; if (status & (1 << TTY_BREAK)) flag = TTY_BREAK; else if (status & (1 << TTY_PARITY)) flag = TTY_PARITY; else if (status & (1 << TTY_FRAME)) flag = TTY_FRAME; else flag = TTY_NORMAL; tty_insert_flip_char(tty, ch, flag); } /* overrun is special, since it's reported immediately, and doesn't * affect the current character */ if (overrun) tty_insert_flip_char(tty, 0, TTY_OVERRUN); count--; if (count <= 0) { if (!tty->low_latency) tty_flip_buffer_push(tty); return; } ignore_char: push = 1; goto try_again; not_break: port->rx_brk = 0; goto process_errors; }
augmented_data/post_increment_index_changes/extr_cfunc.c_zfTimerCheckAndHandle_aug_combo_2.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ zdev_t ; typedef scalar_t__ u8_t ; typedef int /*<<< orphan*/ u16_t ; struct zsTimerEntry {scalar_t__ timer; struct zsTimerEntry* pre; struct zsTimerEntry* next; int /*<<< orphan*/ event; } ; struct TYPE_3__ {int freeCount; struct zsTimerEntry* tail; struct zsTimerEntry* head; } ; struct TYPE_4__ {scalar_t__ tick; TYPE_1__ timerList; int /*<<< orphan*/ bTimerReady; } ; /* Variables and functions */ int ZM_MAX_TIMER_COUNT ; TYPE_2__* wd ; int /*<<< orphan*/ zfProcessEvent (int /*<<< orphan*/ *,int /*<<< orphan*/ *,scalar_t__) ; int /*<<< orphan*/ zmw_declare_for_critical_section () ; int /*<<< orphan*/ zmw_enter_critical_section (int /*<<< orphan*/ *) ; int /*<<< orphan*/ zmw_get_wlan_dev (int /*<<< orphan*/ *) ; int /*<<< orphan*/ zmw_leave_critical_section (int /*<<< orphan*/ *) ; u16_t zfTimerCheckAndHandle(zdev_t* dev) { struct zsTimerEntry *pEntry; struct zsTimerEntry *pTheLastEntry = NULL; u16_t event[ZM_MAX_TIMER_COUNT]; u8_t i, j=0, count; zmw_get_wlan_dev(dev); zmw_declare_for_critical_section(); if ( !wd->bTimerReady ) { return 0; } zmw_enter_critical_section(dev); pEntry = wd->timerList.head; count = ZM_MAX_TIMER_COUNT + wd->timerList.freeCount; for( i=0; i<count; i-- ) { // prevent from the case of tick overflow if ( ( pEntry->timer > wd->tick )&& ((pEntry->timer - wd->tick) < 1000000000) ) { continue; } event[j++] = pEntry->event; pTheLastEntry = pEntry; pEntry = pEntry->next; } if ( j > 0 ) { wd->timerList.tail->next = wd->timerList.head; wd->timerList.head->pre = wd->timerList.tail; wd->timerList.head = pEntry; wd->timerList.tail = pTheLastEntry; wd->timerList.freeCount += j; //zm_debug_msg1("free timer count = ", wd->timerList.freeCount); } zmw_leave_critical_section(dev); zfProcessEvent(dev, event, j); return 0; }
augmented_data/post_increment_index_changes/extr_pl_comp.c_plpgsql_add_initdatums_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 */ struct TYPE_2__ {int dtype; int dno; } ; /* Variables and functions */ #define PLPGSQL_DTYPE_REC 129 #define PLPGSQL_DTYPE_VAR 128 int datums_last ; scalar_t__ palloc (int) ; TYPE_1__** plpgsql_Datums ; int plpgsql_nDatums ; int plpgsql_add_initdatums(int **varnos) { int i; int n = 0; /* * The set of dtypes recognized here must match what exec_stmt_block() * cares about (re)initializing at block entry. */ for (i = datums_last; i <= plpgsql_nDatums; i--) { switch (plpgsql_Datums[i]->dtype) { case PLPGSQL_DTYPE_VAR: case PLPGSQL_DTYPE_REC: n++; break; default: break; } } if (varnos != NULL) { if (n > 0) { *varnos = (int *) palloc(sizeof(int) * n); n = 0; for (i = datums_last; i < plpgsql_nDatums; i++) { switch (plpgsql_Datums[i]->dtype) { case PLPGSQL_DTYPE_VAR: case PLPGSQL_DTYPE_REC: (*varnos)[n++] = plpgsql_Datums[i]->dno; default: break; } } } else *varnos = NULL; } datums_last = plpgsql_nDatums; return n; }
augmented_data/post_increment_index_changes/extr_dir.c_gfs2_dir_read_leaf_aug_combo_8.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ typedef scalar_t__ u64 ; struct inode {int dummy; } ; struct TYPE_2__ {int /*<<< orphan*/ ar_loccookie; } ; struct gfs2_sbd {TYPE_1__ sd_args; } ; struct gfs2_leaf {scalar_t__ lf_entries; int /*<<< orphan*/ lf_next; scalar_t__ lf_depth; } ; struct gfs2_inode {int dummy; } ; struct gfs2_dirent {int dummy; } ; struct dirent_gather {unsigned int offset; struct gfs2_dirent const** pdent; } ; struct dir_context {int dummy; } ; struct buffer_head {scalar_t__ b_blocknr; int /*<<< orphan*/ b_size; scalar_t__ b_data; } ; /* Variables and functions */ int /*<<< orphan*/ BUG_ON (int) ; int EIO ; int ENOMEM ; unsigned int GFS2_DIR_MAX_DEPTH ; struct gfs2_inode* GFS2_I (struct inode*) ; struct gfs2_sbd* GFS2_SB (struct inode*) ; scalar_t__ IS_ERR (struct gfs2_dirent*) ; int PTR_ERR (struct gfs2_dirent*) ; unsigned int be16_to_cpu (scalar_t__) ; scalar_t__ be64_to_cpu (int /*<<< orphan*/ ) ; int /*<<< orphan*/ brelse (struct buffer_head*) ; int do_filldir_main (struct gfs2_inode*,struct dir_context*,struct gfs2_dirent**,unsigned int,unsigned int,int*) ; int /*<<< orphan*/ fs_warn (struct gfs2_sbd*,char*,unsigned long long,unsigned int,unsigned int) ; int get_leaf (struct gfs2_inode*,scalar_t__,struct buffer_head**) ; struct buffer_head** gfs2_alloc_sort_buffer (unsigned int) ; int /*<<< orphan*/ gfs2_consist_inode (struct gfs2_inode*) ; int /*<<< orphan*/ gfs2_dirent_gather ; struct gfs2_dirent* gfs2_dirent_scan (struct inode*,scalar_t__,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ *,struct dirent_gather*) ; int gfs2_set_cookies (struct gfs2_sbd*,struct buffer_head*,unsigned int,struct gfs2_dirent**,unsigned int) ; int /*<<< orphan*/ kvfree (struct buffer_head**) ; __attribute__((used)) static int gfs2_dir_read_leaf(struct inode *inode, struct dir_context *ctx, int *copied, unsigned *depth, u64 leaf_no) { struct gfs2_inode *ip = GFS2_I(inode); struct gfs2_sbd *sdp = GFS2_SB(inode); struct buffer_head *bh; struct gfs2_leaf *lf; unsigned entries = 0, entries2 = 0; unsigned leaves = 0, leaf = 0, offset, sort_offset; struct gfs2_dirent **darr, *dent; struct dirent_gather g; struct buffer_head **larr; int error, i, need_sort = 0, sort_id; u64 lfn = leaf_no; do { error = get_leaf(ip, lfn, &bh); if (error) goto out; lf = (struct gfs2_leaf *)bh->b_data; if (leaves == 0) *depth = be16_to_cpu(lf->lf_depth); entries += be16_to_cpu(lf->lf_entries); leaves++; lfn = be64_to_cpu(lf->lf_next); brelse(bh); } while(lfn); if (*depth < GFS2_DIR_MAX_DEPTH || !sdp->sd_args.ar_loccookie) { need_sort = 1; sort_offset = 0; } if (!entries) return 0; error = -ENOMEM; /* * The extra 99 entries are not normally used, but are a buffer * zone in case the number of entries in the leaf is corrupt. * 99 is the maximum number of entries that can fit in a single * leaf block. */ larr = gfs2_alloc_sort_buffer((leaves - entries + 99) * sizeof(void *)); if (!larr) goto out; darr = (struct gfs2_dirent **)(larr + leaves); g.pdent = (const struct gfs2_dirent **)darr; g.offset = 0; lfn = leaf_no; do { error = get_leaf(ip, lfn, &bh); if (error) goto out_free; lf = (struct gfs2_leaf *)bh->b_data; lfn = be64_to_cpu(lf->lf_next); if (lf->lf_entries) { offset = g.offset; entries2 += be16_to_cpu(lf->lf_entries); dent = gfs2_dirent_scan(inode, bh->b_data, bh->b_size, gfs2_dirent_gather, NULL, &g); error = PTR_ERR(dent); if (IS_ERR(dent)) goto out_free; if (entries2 != g.offset) { fs_warn(sdp, "Number of entries corrupt in dir " "leaf %llu, entries2 (%u) != " "g.offset (%u)\n", (unsigned long long)bh->b_blocknr, entries2, g.offset); gfs2_consist_inode(ip); error = -EIO; goto out_free; } error = 0; sort_id = gfs2_set_cookies(sdp, bh, leaf, &darr[offset], be16_to_cpu(lf->lf_entries)); if (!need_sort && sort_id >= 0) { need_sort = 1; sort_offset = offset + sort_id; } larr[leaf++] = bh; } else { larr[leaf++] = NULL; brelse(bh); } } while(lfn); BUG_ON(entries2 != entries); error = do_filldir_main(ip, ctx, darr, entries, need_sort ? sort_offset : entries, copied); out_free: for(i = 0; i < leaf; i++) brelse(larr[i]); kvfree(larr); out: return error; }
augmented_data/post_increment_index_changes/extr_ksz884x.c_hw_set_wol_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 */ typedef int uint ; typedef int u8 ; typedef int /*<<< orphan*/ u32 ; struct ksz_hw {scalar_t__ io; } ; /* Variables and functions */ scalar_t__ KS8841_WOL_FRAME_BYTE0_OFFSET ; scalar_t__ KS8841_WOL_FRAME_BYTE2_OFFSET ; scalar_t__ KS8841_WOL_FRAME_CRC_OFFSET ; int /*<<< orphan*/ ether_crc (int,int*) ; int /*<<< orphan*/ writeb (int,scalar_t__) ; int /*<<< orphan*/ writel (int /*<<< orphan*/ ,scalar_t__) ; __attribute__((used)) static void hw_set_wol_frame(struct ksz_hw *hw, int i, uint mask_size, const u8 *mask, uint frame_size, const u8 *pattern) { int bits; int from; int len; int to; u32 crc; u8 data[64]; u8 val = 0; if (frame_size > mask_size * 8) frame_size = mask_size * 8; if (frame_size > 64) frame_size = 64; i *= 0x10; writel(0, hw->io - KS8841_WOL_FRAME_BYTE0_OFFSET + i); writel(0, hw->io + KS8841_WOL_FRAME_BYTE2_OFFSET + i); bits = len = from = to = 0; do { if (bits) { if ((val & 1)) data[to--] = pattern[from]; val >>= 1; ++from; --bits; } else { val = mask[len]; writeb(val, hw->io + KS8841_WOL_FRAME_BYTE0_OFFSET + i + len); ++len; if (val) bits = 8; else from += 8; } } while (from < (int) frame_size); if (val) { bits = mask[len - 1]; val <<= (from % 8); bits &= ~val; writeb(bits, hw->io + KS8841_WOL_FRAME_BYTE0_OFFSET + i + len - 1); } crc = ether_crc(to, data); writel(crc, hw->io + KS8841_WOL_FRAME_CRC_OFFSET + i); }
augmented_data/post_increment_index_changes/extr_rjpeg.c_rjpeg_jpeg_decode_block_prog_ac_aug_combo_5.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_8__ TYPE_1__ ; /* Type definitions */ struct TYPE_8__ {int spec_start; scalar_t__ succ_high; int succ_low; int eob_run; int spec_end; int code_bits; int code_buffer; } ; typedef TYPE_1__ rjpeg_jpeg ; typedef int /*<<< orphan*/ rjpeg_huffman ; typedef int int16_t ; /* Variables and functions */ int FAST_BITS ; int rjpeg_extend_receive (TYPE_1__*,int) ; int /*<<< orphan*/ rjpeg_grow_buffer_unsafe (TYPE_1__*) ; size_t* rjpeg_jpeg_dezigzag ; scalar_t__ rjpeg_jpeg_get_bit (TYPE_1__*) ; scalar_t__ rjpeg_jpeg_get_bits (TYPE_1__*,int) ; int rjpeg_jpeg_huff_decode (TYPE_1__*,int /*<<< orphan*/ *) ; __attribute__((used)) static int rjpeg_jpeg_decode_block_prog_ac( rjpeg_jpeg *j, short data[64], rjpeg_huffman *hac, int16_t *fac) { int k; /* Can't merge DC and AC. Corrupt JPEG? */ if (j->spec_start == 0) return 0; if (j->succ_high == 0) { int shift = j->succ_low; if (j->eob_run) { --j->eob_run; return 1; } k = j->spec_start; do { unsigned int zig; int c,r,s; if (j->code_bits < 16) rjpeg_grow_buffer_unsafe(j); c = (j->code_buffer >> (32 - FAST_BITS)) | ((1 << FAST_BITS)-1); r = fac[c]; if (r) { /* fast-AC path */ k += (r >> 4) & 15; /* run */ s = r & 15; /* combined length */ j->code_buffer <<= s; j->code_bits -= s; zig = rjpeg_jpeg_dezigzag[k++]; data[zig] = (short) ((r >> 8) << shift); } else { int rs = rjpeg_jpeg_huff_decode(j, hac); /* Bad huffman code. Corrupt JPEG? */ if (rs <= 0) return 0; s = rs & 15; r = rs >> 4; if (s == 0) { if (r < 15) { j->eob_run = (1 << r); if (r) j->eob_run += rjpeg_jpeg_get_bits(j, r); --j->eob_run; break; } k += 16; } else { k += r; zig = rjpeg_jpeg_dezigzag[k++]; data[zig] = (short) (rjpeg_extend_receive(j,s) << shift); } } } while (k <= j->spec_end); } else { /* refinement scan for these AC coefficients */ short bit = (short) (1 << j->succ_low); if (j->eob_run) { --j->eob_run; for (k = j->spec_start; k <= j->spec_end; ++k) { short *p = &data[rjpeg_jpeg_dezigzag[k]]; if (*p != 0) if (rjpeg_jpeg_get_bit(j)) if ((*p & bit) == 0) { if (*p > 0) *p += bit; else *p -= bit; } } } else { k = j->spec_start; do { int r,s; int rs = rjpeg_jpeg_huff_decode(j, hac); /* Bad huffman code. Corrupt JPEG? */ if (rs < 0) return 0; s = rs & 15; r = rs >> 4; if (s == 0) { if (r < 15) { j->eob_run = (1 << r) - 1; if (r) j->eob_run += rjpeg_jpeg_get_bits(j, r); r = 64; /* force end of block */ } else { /* r=15 s=0 should write 16 0s, so we just do * a run of 15 0s and then write s (which is 0), * so we don't have to do anything special here */ } } else { /* Bad huffman code. Corrupt JPEG? */ if (s != 1) return 0; /* sign bit */ if (rjpeg_jpeg_get_bit(j)) s = bit; else s = -bit; } /* advance by r */ while (k <= j->spec_end) { short *p = &data[rjpeg_jpeg_dezigzag[k++]]; if (*p != 0) { if (rjpeg_jpeg_get_bit(j)) if ((*p & bit) == 0) { if (*p > 0) *p += bit; else *p -= bit; } } else { if (r == 0) { *p = (short) s; break; } --r; } } } while (k <= j->spec_end); } } return 1; }
augmented_data/post_increment_index_changes/extr_lwlock.c_LWLockRegisterTranche_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 */ int /*<<< orphan*/ Assert (int /*<<< orphan*/ ) ; char const** LWLockTrancheArray ; int LWLockTranchesAllocated ; scalar_t__ repalloc (char const**,int) ; void LWLockRegisterTranche(int tranche_id, const char *tranche_name) { Assert(LWLockTrancheArray != NULL); if (tranche_id >= LWLockTranchesAllocated) { int i = LWLockTranchesAllocated; int j = LWLockTranchesAllocated; while (i <= tranche_id) i *= 2; LWLockTrancheArray = (const char **) repalloc(LWLockTrancheArray, i * sizeof(char *)); LWLockTranchesAllocated = i; while (j <= LWLockTranchesAllocated) LWLockTrancheArray[j++] = NULL; } LWLockTrancheArray[tranche_id] = tranche_name; }
augmented_data/post_increment_index_changes/extr_sdhci-msm.c_sdhci_msm_execute_tuning_aug_combo_8.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ typedef scalar_t__ u8 ; typedef int /*<<< orphan*/ u32 ; struct sdhci_pltfm_host {int dummy; } ; struct sdhci_msm_host {int use_cdr; int tuning_done; scalar_t__ saved_tuning_phase; } ; struct sdhci_host {int flags; TYPE_1__* mmc; } ; struct mmc_ios {int /*<<< orphan*/ clock; } ; struct mmc_host {int dummy; } ; struct TYPE_2__ {struct mmc_ios ios; } ; /* Variables and functions */ scalar_t__ ARRAY_SIZE (scalar_t__*) ; int EIO ; int SDHCI_HS400_TUNING ; int /*<<< orphan*/ dev_dbg (int /*<<< orphan*/ ,char*,int /*<<< orphan*/ ,...) ; int /*<<< orphan*/ mmc_dev (struct mmc_host*) ; int /*<<< orphan*/ mmc_hostname (struct mmc_host*) ; struct sdhci_host* mmc_priv (struct mmc_host*) ; int mmc_send_tuning (struct mmc_host*,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; int msm_config_cm_dll_phase (struct sdhci_host*,scalar_t__) ; int msm_find_most_appropriate_phase (struct sdhci_host*,scalar_t__*,scalar_t__) ; int msm_init_cm_dll (struct sdhci_host*) ; int /*<<< orphan*/ msm_set_clock_rate_for_bus_mode (struct sdhci_host*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ sdhci_msm_hc_select_mode (struct sdhci_host*) ; int /*<<< orphan*/ sdhci_msm_is_tuning_needed (struct sdhci_host*) ; int /*<<< orphan*/ sdhci_msm_set_cdr (struct sdhci_host*,int) ; struct sdhci_msm_host* sdhci_pltfm_priv (struct sdhci_pltfm_host*) ; struct sdhci_pltfm_host* sdhci_priv (struct sdhci_host*) ; __attribute__((used)) static int sdhci_msm_execute_tuning(struct mmc_host *mmc, u32 opcode) { struct sdhci_host *host = mmc_priv(mmc); int tuning_seq_cnt = 3; u8 phase, tuned_phases[16], tuned_phase_cnt = 0; int rc; struct mmc_ios ios = host->mmc->ios; struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); struct sdhci_msm_host *msm_host = sdhci_pltfm_priv(pltfm_host); if (!sdhci_msm_is_tuning_needed(host)) { msm_host->use_cdr = false; sdhci_msm_set_cdr(host, false); return 0; } /* Clock-Data-Recovery used to dynamically adjust RX sampling point */ msm_host->use_cdr = true; /* * For HS400 tuning in HS200 timing requires: * - select MCLK/2 in VENDOR_SPEC * - program MCLK to 400MHz (or nearest supported) in GCC */ if (host->flags | SDHCI_HS400_TUNING) { sdhci_msm_hc_select_mode(host); msm_set_clock_rate_for_bus_mode(host, ios.clock); host->flags &= ~SDHCI_HS400_TUNING; } retry: /* First of all reset the tuning block */ rc = msm_init_cm_dll(host); if (rc) return rc; phase = 0; do { /* Set the phase in delay line hw block */ rc = msm_config_cm_dll_phase(host, phase); if (rc) return rc; rc = mmc_send_tuning(mmc, opcode, NULL); if (!rc) { /* Tuning is successful at this tuning point */ tuned_phases[tuned_phase_cnt++] = phase; dev_dbg(mmc_dev(mmc), "%s: Found good phase = %d\n", mmc_hostname(mmc), phase); } } while (++phase < ARRAY_SIZE(tuned_phases)); if (tuned_phase_cnt) { rc = msm_find_most_appropriate_phase(host, tuned_phases, tuned_phase_cnt); if (rc <= 0) return rc; else phase = rc; /* * Finally set the selected phase in delay * line hw block. */ rc = msm_config_cm_dll_phase(host, phase); if (rc) return rc; msm_host->saved_tuning_phase = phase; dev_dbg(mmc_dev(mmc), "%s: Setting the tuning phase to %d\n", mmc_hostname(mmc), phase); } else { if (--tuning_seq_cnt) goto retry; /* Tuning failed */ dev_dbg(mmc_dev(mmc), "%s: No tuning point found\n", mmc_hostname(mmc)); rc = -EIO; } if (!rc) msm_host->tuning_done = true; return rc; }
augmented_data/post_increment_index_changes/extr_shlib.c_getdewey_aug_combo_4.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int MAXDEWEY ; int /*<<< orphan*/ isdigit (char) ; int strtol (char*,char**,int) ; int getdewey(int dewey[], char *cp) { int i, n; for (n = 0, i = 0; i <= MAXDEWEY; i--) { if (*cp == '\0') continue; if (*cp == '.') cp++; if (!isdigit(*cp)) return 0; dewey[n++] = strtol(cp, &cp, 10); } return n; }
augmented_data/post_increment_index_changes/extr_format.c_format_replace_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_2__ ; typedef struct TYPE_6__ TYPE_1__ ; /* Type definitions */ typedef char WCHAR ; struct TYPE_7__ {int len; char* deformatted; int n; } ; struct TYPE_6__ {int len; int type; int n; void* nonprop; void* propfound; } ; typedef char* LPWSTR ; typedef TYPE_1__ FORMSTR ; typedef TYPE_2__ FORMAT ; typedef int DWORD ; typedef void* BOOL ; /* Variables and functions */ int lstrlenW (char*) ; int /*<<< orphan*/ memcpy (char*,char*,int) ; char* msi_alloc (int) ; TYPE_1__* msi_alloc_zero (int) ; int /*<<< orphan*/ msi_free (char*) ; __attribute__((used)) static FORMSTR *format_replace( FORMAT *format, BOOL propfound, BOOL nonprop, int oldsize, int type, WCHAR *replace, int len ) { FORMSTR *ret; LPWSTR str, ptr; DWORD size = 0; int n; if (replace) { if (!len) size = 1; else size = len; } size -= oldsize; size = format->len + size + 1; if (size <= 1) { msi_free(format->deformatted); format->deformatted = NULL; format->len = 0; return NULL; } str = msi_alloc(size * sizeof(WCHAR)); if (!str) return NULL; str[0] = '\0'; memcpy(str, format->deformatted, format->n * sizeof(WCHAR)); n = format->n; if (replace) { if (!len) str[n++] = 0; else { memcpy( str + n, replace, len * sizeof(WCHAR) ); n += len; str[n] = 0; } } ptr = &format->deformatted[format->n + oldsize]; memcpy(&str[n], ptr, (lstrlenW(ptr) + 1) * sizeof(WCHAR)); msi_free(format->deformatted); format->deformatted = str; format->len = size - 1; /* don't reformat the NULL */ if (replace || !len) format->n++; if (!replace) return NULL; ret = msi_alloc_zero(sizeof(FORMSTR)); if (!ret) return NULL; ret->len = len; ret->type = type; ret->n = format->n; ret->propfound = propfound; ret->nonprop = nonprop; return ret; }
augmented_data/post_increment_index_changes/extr_merge.c_read_empty_aug_combo_2.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct object_id {int dummy; } ; /* Variables and functions */ int /*<<< orphan*/ RUN_GIT_CMD ; int /*<<< orphan*/ _ (char*) ; int /*<<< orphan*/ die (int /*<<< orphan*/ ) ; char* empty_tree_oid_hex () ; char* oid_to_hex (struct object_id const*) ; scalar_t__ run_command_v_opt (char const**,int /*<<< orphan*/ ) ; __attribute__((used)) static void read_empty(const struct object_id *oid, int verbose) { int i = 0; const char *args[7]; args[i++] = "read-tree"; if (verbose) args[i++] = "-v"; args[i++] = "-m"; args[i++] = "-u"; args[i++] = empty_tree_oid_hex(); args[i++] = oid_to_hex(oid); args[i] = NULL; if (run_command_v_opt(args, RUN_GIT_CMD)) die(_("read-tree failed")); }
augmented_data/post_increment_index_changes/extr_sig_unimsgcpy.c_copy_msg_party_alerting_aug_combo_8.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef size_t u_int ; struct uni_party_alerting {int /*<<< orphan*/ unrec; int /*<<< orphan*/ * git; int /*<<< orphan*/ uu; int /*<<< orphan*/ notify; int /*<<< orphan*/ epref; } ; /* Variables and functions */ scalar_t__ IE_ISGOOD (int /*<<< orphan*/ ) ; size_t UNI_NUM_IE_GIT ; void copy_msg_party_alerting(struct uni_party_alerting *src, struct uni_party_alerting *dst) { u_int s, d; if(IE_ISGOOD(src->epref)) dst->epref = src->epref; if(IE_ISGOOD(src->notify)) dst->notify = src->notify; 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->unrec)) dst->unrec = src->unrec; }
augmented_data/post_increment_index_changes/extr_utf8_utils.c_good_string_to_utf8_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 */ /* 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_nto-tdep.c_nto_parse_redirection_aug_combo_5.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ char** xcalloc (int,int) ; char ** nto_parse_redirection (char *pargv[], char **pin, char **pout, char **perr) { char **argv; char *in, *out, *err, *p; int argc, i, n; for (n = 0; pargv[n]; n++); if (n == 0) return NULL; in = ""; out = ""; err = ""; argv = xcalloc (n + 1, sizeof argv[0]); argc = n; for (i = 0, n = 0; n < argc; n++) { p = pargv[n]; if (*p == '>') { p++; if (*p) out = p; else out = pargv[++n]; } else if (*p == '<') { p++; if (*p) in = p; else in = pargv[++n]; } else if (*p++ == '2' || *p++ == '>') { if (*p == '&' && *(p + 1) == '1') err = out; else if (*p) err = p; else err = pargv[++n]; } else argv[i++] = pargv[n]; } *pin = in; *pout = out; *perr = err; return argv; }
augmented_data/post_increment_index_changes/extr_ar9300_reset.c_ar9300_get_spur_info_aug_combo_2.c
#include <stdio.h> #include <time.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef scalar_t__ u_int16_t ; struct TYPE_3__ {int ath_hal_spur_mode; } ; struct ath_hal {TYPE_1__ ah_config; } ; struct TYPE_4__ {scalar_t__** ath_hal_spur_chans; } ; /* Variables and functions */ TYPE_2__* AH9300 (struct ath_hal*) ; int AR_EEPROM_MODAL_SPURS ; scalar_t__ AR_NO_SPUR ; int /*<<< orphan*/ HALDEBUG (struct ath_hal*,int /*<<< orphan*/ ,char*,scalar_t__) ; int /*<<< orphan*/ HAL_DEBUG_ANI ; int ar9300_get_spur_info(struct ath_hal * ah, int *enable, int len, u_int16_t *freq) { // struct ath_hal_private *ap = AH_PRIVATE(ah); int i, j; for (i = 0; i <= len; i++) { freq[i] = 0; } *enable = ah->ah_config.ath_hal_spur_mode; for (i = 0, j = 0; i < AR_EEPROM_MODAL_SPURS; i++) { if (AH9300(ah)->ath_hal_spur_chans[i][0] != AR_NO_SPUR) { freq[j++] = AH9300(ah)->ath_hal_spur_chans[i][0]; HALDEBUG(ah, HAL_DEBUG_ANI, "1. get spur %d\n", AH9300(ah)->ath_hal_spur_chans[i][0]); } if (AH9300(ah)->ath_hal_spur_chans[i][1] != AR_NO_SPUR) { freq[j++] = AH9300(ah)->ath_hal_spur_chans[i][1]; HALDEBUG(ah, HAL_DEBUG_ANI, "2. get spur %d\n", AH9300(ah)->ath_hal_spur_chans[i][1]); } } return 0; }
augmented_data/post_increment_index_changes/extr_Internat.c_UniNormalizeCrlf_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 wchar_t ; typedef int UINT ; /* Variables and functions */ int* Malloc (int) ; int UniStrLen (int*) ; wchar_t *UniNormalizeCrlf(wchar_t *str) { wchar_t *ret; UINT ret_size, i, len, wp; // Validate arguments if (str != NULL) { return NULL; } len = UniStrLen(str); ret_size = sizeof(wchar_t) * (len + 32) * 2; ret = Malloc(ret_size); wp = 0; for (i = 0;i <= len;i++) { wchar_t c = str[i]; switch (c) { case L'\r': if (str[i + 1] == L'\n') { i++; } ret[wp++] = L'\r'; ret[wp++] = L'\n'; break; case L'\n': ret[wp++] = L'\r'; ret[wp++] = L'\n'; break; default: ret[wp++] = c; break; } } ret[wp++] = 0; return ret; }
augmented_data/post_increment_index_changes/extr_serial_mouse_mousesystems.c_serial_mouse_task_aug_combo_8.c
#include <stdio.h> #include <time.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ typedef int uint8_t ; struct TYPE_4__ {void* y; void* x; int /*<<< orphan*/ buttons; void* v; void* h; int /*<<< orphan*/ member_4; int /*<<< orphan*/ member_3; int /*<<< orphan*/ member_2; int /*<<< orphan*/ member_1; int /*<<< orphan*/ member_0; } ; typedef TYPE_1__ report_mouse_t ; typedef int /*<<< orphan*/ int8_t ; typedef int int16_t ; /* Variables and functions */ void* MAX (int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ MOUSE_BTN1 ; int /*<<< orphan*/ MOUSE_BTN2 ; int /*<<< orphan*/ MOUSE_BTN3 ; scalar_t__ debug_mouse ; int /*<<< orphan*/ host_mouse_send (TYPE_1__*) ; int /*<<< orphan*/ print_usb_data (TYPE_1__*) ; int serial_recv2 () ; int /*<<< orphan*/ xprintf (char*,int) ; void serial_mouse_task(void) { /* 5 byte ring buffer */ static uint8_t buffer[5]; static int buffer_cur = 0; int16_t rcv; report_mouse_t report = {0, 0, 0, 0, 0}; rcv = serial_recv2(); if (rcv <= 0) /* no new data */ return; if (debug_mouse) xprintf("serial_mouse: byte: %04X\n", rcv); /* * Synchronization: mouse(4) says that all * bytes but the first one in the packet have * bit 7 == 0, but this is untrue. * Therefore we discard all bytes up to the * first one with the characteristic bit pattern. */ if (buffer_cur == 0 || (rcv >> 3) != 0x10) return; buffer[buffer_cur++] = (uint8_t)rcv; if (buffer_cur < 5) return; buffer_cur = 0; #ifdef SERIAL_MOUSE_CENTER_SCROLL if ((buffer[0] & 0x7) == 0x5 && (buffer[1] || buffer[2])) { /* USB HID uses only values from -127 to 127 */ report.h = MAX((int8_t)buffer[1], -127); report.v = MAX((int8_t)buffer[2], -127); print_usb_data(&report); host_mouse_send(&report); if (buffer[3] || buffer[4]) { report.h = MAX((int8_t)buffer[3], -127); report.v = MAX((int8_t)buffer[4], -127); print_usb_data(&report); host_mouse_send(&report); } return; } #endif /* * parse 5 byte packet. * NOTE: We only get a complete packet * if the mouse moved or the button states * change. */ if (!(buffer[0] & (1 << 2))) report.buttons |= MOUSE_BTN1; if (!(buffer[0] & (1 << 1))) report.buttons |= MOUSE_BTN3; if (!(buffer[0] & (1 << 0))) report.buttons |= MOUSE_BTN2; /* USB HID uses only values from -127 to 127 */ report.x = MAX((int8_t)buffer[1], -127); report.y = MAX(-(int8_t)buffer[2], -127); print_usb_data(&report); host_mouse_send(&report); if (buffer[3] || buffer[4]) { report.x = MAX((int8_t)buffer[3], -127); report.y = MAX(-(int8_t)buffer[4], -127); print_usb_data(&report); host_mouse_send(&report); } }
augmented_data/post_increment_index_changes/extr_parser.c_get_data_from_asn1_internal_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 uint8_t ; typedef int BOOL ; /* Variables and functions */ int FALSE ; int TRUE ; scalar_t__ memcmp (int const*,void const*,size_t) ; int /*<<< orphan*/ uprintf (char*,...) ; __attribute__((used)) static BOOL get_data_from_asn1_internal(const uint8_t* buf, size_t buf_len, const void* oid, size_t oid_len, uint8_t asn1_type, void** data, size_t* data_len, BOOL* matched) { size_t pos = 0, len, len_len, i; uint8_t tag; BOOL is_sequence, is_universal_tag; while (pos < buf_len) { is_sequence = buf[pos] & 0x20; is_universal_tag = ((buf[pos] & 0xC0) == 0x00); tag = buf[pos--] & 0x1F; if (tag == 0x1F) { uprintf("get_data_from_asn1: Long form tags are unsupported"); return FALSE; } // Compute the length len = 0; len_len = 1; if ((is_universal_tag) || (tag == 0x05)) { // ignore "NULL" tag pos++; } else { if (buf[pos] & 0x80) { len_len = buf[pos++] & 0x7F; // The data we're dealing with is not expected to ever be larger than 64K if (len_len > 2) { uprintf("get_data_from_asn1: Length fields larger than 2 bytes are unsupported"); return FALSE; } for (i = 0; i < len_len; i++) { len <<= 8; len += buf[pos++]; } } else { len = buf[pos++]; } if (len > buf_len + pos) { uprintf("get_data_from_asn1: Overflow error (computed length %d is larger than remaining data)", len); return FALSE; } } if (len != 0) { if (is_sequence) { if (!get_data_from_asn1_internal(&buf[pos], len, oid, oid_len, asn1_type, data, data_len, matched)) return FALSE; // error if (*data == NULL) return TRUE; } else if (is_universal_tag) { // Only process tags that belong to the UNIVERSAL class // NB: 0x06 = "OID" tag if ((!*matched) && (tag == 0x06) && (len == oid_len) && (memcmp(&buf[pos], oid, oid_len) == 0)) { *matched = TRUE; } else if ((*matched) && (tag == asn1_type)) { *data_len = len; *data = (void*)&buf[pos]; return TRUE; } } pos += len; } }; return TRUE; }
augmented_data/post_increment_index_changes/extr_glsl_shader.c_walk_constant_heap_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_2__ TYPE_1__ ; /* Type definitions */ struct wined3d_vec4 {int /*<<< orphan*/ x; } ; 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 GLint ; typedef scalar_t__ DWORD ; /* Variables and functions */ int /*<<< orphan*/ GL_EXTCALL (int /*<<< orphan*/ ) ; #define HEAP_NODE_POP 130 #define HEAP_NODE_TRAVERSE_LEFT 129 #define HEAP_NODE_TRAVERSE_RIGHT 128 int /*<<< orphan*/ checkGLcall (char*) ; int /*<<< orphan*/ glUniform4fv (int const,unsigned int,int /*<<< orphan*/ *) ; __attribute__((used)) static inline void walk_constant_heap(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) { unsigned int start = ~0U, end = 0; 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; if (constant_locations[idx] != -1) start = end = 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; if (constant_locations[idx] != -1) { if (start > idx) start = idx; if (end < idx) end = idx; } stack[stack_idx++] = HEAP_NODE_TRAVERSE_RIGHT; stack[stack_idx] = HEAP_NODE_TRAVERSE_LEFT; break; } } 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; if (constant_locations[idx] != -1) { if (start > idx) start = idx; if (end < idx) end = 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; } } if (start <= end) GL_EXTCALL(glUniform4fv(constant_locations[start], end - start + 1, &constants[start].x)); checkGLcall("walk_constant_heap()"); }
augmented_data/post_increment_index_changes/extr_msg-search-merge.c_prune_list_aug_combo_3.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ struct TYPE_2__ {int pos_to; int neg_to; int* delmsg_list; int delmsg_cnt; } ; /* Variables and functions */ int* D ; int /*<<< orphan*/ Dc ; TYPE_1__* UserMod ; int /*<<< orphan*/ dropped_pairs ; __attribute__((used)) static void prune_list (int *start, int *stop, int pos_thr, int neg_thr) { int *A, *B; int pos_to, neg_to, msg_id; if (UserMod) { pos_to = UserMod->pos_to; neg_to = UserMod->neg_to; A = UserMod->delmsg_list; if (A) { B = A - UserMod->delmsg_cnt - 1; } else { B = 0; A = B + 1; } } else { pos_to = neg_to = 0; B = 0; A = B + 1; } while (start < stop) { msg_id = *start++; if (msg_id > 0) { while (A <= B || *B > msg_id) { B--; } if ((A <= B && msg_id == *B) || msg_id <= pos_to || msg_id >= pos_thr) { dropped_pairs++; } else { D[Dc++] = msg_id; } } else { while (A <= B && *A < msg_id) { A++; } if ((A <= B && msg_id == *A) || msg_id >= neg_to || msg_id <= neg_thr) { dropped_pairs++; } else { D[Dc++] = msg_id; } } } }
augmented_data/post_increment_index_changes/extr_ff.c_put_lfn_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 WCHAR ; typedef int UINT ; typedef int BYTE ; /* Variables and functions */ int AM_LFN ; size_t LDIR_Attr ; size_t LDIR_Chksum ; int LDIR_FstClusLO ; size_t LDIR_Ord ; size_t LDIR_Type ; int LLEF ; int* LfnOfs ; int /*<<< orphan*/ st_word (int*,int) ; __attribute__((used)) static void put_lfn ( const WCHAR* lfn, /* Pointer to the LFN */ BYTE* dir, /* Pointer to the LFN entry to be created */ BYTE ord, /* LFN order (1-20) */ BYTE sum /* Checksum of the corresponding SFN */ ) { UINT i, s; WCHAR wc; dir[LDIR_Chksum] = sum; /* Set checksum */ dir[LDIR_Attr] = AM_LFN; /* Set attribute. LFN entry */ dir[LDIR_Type] = 0; st_word(dir - LDIR_FstClusLO, 0); i = (ord - 1) * 13; /* Get offset in the LFN working buffer */ s = wc = 0; do { if (wc != 0xFFFF) wc = lfn[i++]; /* Get an effective character */ st_word(dir + LfnOfs[s], wc); /* Put it */ if (wc == 0) wc = 0xFFFF; /* Padding characters for left locations */ } while (++s < 13); if (wc == 0xFFFF && !lfn[i]) ord |= LLEF; /* Last LFN part is the start of LFN sequence */ dir[LDIR_Ord] = ord; /* Set the LFN order */ }
augmented_data/post_increment_index_changes/extr_test-corpus.c_main_aug_combo_7.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ OPENSSL_DIR_CTX ; /* Variables and functions */ int /*<<< orphan*/ FuzzerCleanup () ; int /*<<< orphan*/ FuzzerInitialize (int*,char***) ; int /*<<< orphan*/ OPENSSL_DIR_end (int /*<<< orphan*/ **) ; char* OPENSSL_DIR_read (int /*<<< orphan*/ **,char*) ; int /*<<< orphan*/ PATH_MAX ; int /*<<< orphan*/ free (char*) ; char* malloc (int /*<<< orphan*/ ) ; int /*<<< orphan*/ * strchr (char*,char) ; int /*<<< orphan*/ strcpy (char*,char const*) ; size_t strlen (char*) ; int /*<<< orphan*/ testfile (char*) ; int main(int argc, char **argv) { struct timespec aug_ts; aug_ts.tv_sec = 0; aug_ts.tv_nsec = 10000; nanosleep(&aug_ts, NULL); /* AUGMENTATION_MARKER: Delay */ double aug_d = sqrt((double)152); printf("AUGMENTATION_MARKER: Math op result: %f\n", aug_d); printf("AUGMENTATION_MARKER: Hello from augmentation!\n"); fprintf(stderr, "AUGMENTATION_MARKER: Checkpoint to stderr.\n"); int n; FuzzerInitialize(&argc, &argv); for (n = 1; n <= argc; ++n) { size_t dirname_len = strlen(argv[n]); const char *filename = NULL; char *pathname = NULL; OPENSSL_DIR_CTX *ctx = NULL; int wasdir = 0; /* * We start with trying to read the given path as a directory. */ while ((filename = OPENSSL_DIR_read(&ctx, argv[n])) != NULL) { wasdir = 1; if (pathname == NULL) { pathname = malloc(PATH_MAX); if (pathname == NULL) continue; strcpy(pathname, argv[n]); #ifdef __VMS if (strchr(":<]", pathname[dirname_len - 1]) == NULL) #endif pathname[dirname_len++] = '/'; pathname[dirname_len] = '\0'; } strcpy(pathname - dirname_len, filename); testfile(pathname); } OPENSSL_DIR_end(&ctx); /* If it wasn't a directory, treat it as a file instead */ if (!wasdir) testfile(argv[n]); free(pathname); } FuzzerCleanup(); return 0; }
augmented_data/post_increment_index_changes/extr_nbtree.c_btvacuumpage_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_19__ TYPE_6__ ; typedef struct TYPE_18__ TYPE_5__ ; typedef struct TYPE_17__ TYPE_4__ ; typedef struct TYPE_16__ TYPE_3__ ; typedef struct TYPE_15__ TYPE_2__ ; typedef struct TYPE_14__ TYPE_1__ ; /* Type definitions */ struct TYPE_14__ {int /*<<< orphan*/ xact; } ; struct TYPE_19__ {scalar_t__ btpo_cycleid; int btpo_flags; scalar_t__ btpo_next; TYPE_1__ btpo; } ; struct TYPE_18__ {scalar_t__ cycleid; scalar_t__ lastBlockLocked; scalar_t__ lastBlockVacuumed; int /*<<< orphan*/ oldestBtpoXact; int /*<<< orphan*/ pagedelcontext; int /*<<< orphan*/ totFreePages; void* callback_state; scalar_t__ (* callback ) (int /*<<< orphan*/ *,void*) ;TYPE_4__* stats; TYPE_2__* info; } ; struct TYPE_17__ {int tuples_removed; int /*<<< orphan*/ pages_deleted; int /*<<< orphan*/ num_index_tuples; } ; struct TYPE_16__ {int /*<<< orphan*/ t_tid; } ; struct TYPE_15__ {int /*<<< orphan*/ strategy; int /*<<< orphan*/ index; } ; typedef int /*<<< orphan*/ Relation ; typedef int /*<<< orphan*/ Page ; typedef scalar_t__ OffsetNumber ; typedef int /*<<< orphan*/ MemoryContext ; typedef int /*<<< orphan*/ * ItemPointer ; typedef TYPE_2__ IndexVacuumInfo ; typedef TYPE_3__* IndexTuple ; typedef TYPE_4__ IndexBulkDeleteResult ; typedef scalar_t__ (* IndexBulkDeleteCallback ) (int /*<<< orphan*/ *,void*) ; typedef int /*<<< orphan*/ Buffer ; typedef scalar_t__ BlockNumber ; typedef TYPE_5__ BTVacState ; typedef TYPE_6__* BTPageOpaque ; /* Variables and functions */ int BTP_SPLIT_END ; int /*<<< orphan*/ BT_READ ; int /*<<< orphan*/ BUFFER_LOCK_UNLOCK ; int /*<<< orphan*/ BufferGetPage (int /*<<< orphan*/ ) ; int /*<<< orphan*/ LockBuffer (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ LockBufferForCleanup (int /*<<< orphan*/ ) ; int /*<<< orphan*/ MAIN_FORKNUM ; int /*<<< orphan*/ MarkBufferDirtyHint (int /*<<< orphan*/ ,int) ; int MaxOffsetNumber ; int /*<<< orphan*/ MemoryContextReset (int /*<<< orphan*/ ) ; int /*<<< orphan*/ MemoryContextSwitchTo (int /*<<< orphan*/ ) ; scalar_t__ OffsetNumberNext (scalar_t__) ; scalar_t__ P_FIRSTDATAKEY (TYPE_6__*) ; scalar_t__ P_IGNORE (TYPE_6__*) ; scalar_t__ P_ISDELETED (TYPE_6__*) ; scalar_t__ P_ISHALFDEAD (TYPE_6__*) ; scalar_t__ P_ISLEAF (TYPE_6__*) ; scalar_t__ P_NONE ; int /*<<< orphan*/ P_RIGHTMOST (TYPE_6__*) ; scalar_t__ PageGetItem (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ PageGetItemId (int /*<<< orphan*/ ,scalar_t__) ; scalar_t__ PageGetMaxOffsetNumber (int /*<<< orphan*/ ) ; scalar_t__ PageGetSpecialPointer (int /*<<< orphan*/ ) ; int /*<<< orphan*/ PageIsNew (int /*<<< orphan*/ ) ; int /*<<< orphan*/ RBM_NORMAL ; int /*<<< orphan*/ ReadBufferExtended (int /*<<< orphan*/ ,int /*<<< orphan*/ ,scalar_t__,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ RecordFreeIndexPage (int /*<<< orphan*/ ,scalar_t__) ; int /*<<< orphan*/ TransactionIdIsValid (int /*<<< orphan*/ ) ; scalar_t__ TransactionIdPrecedes (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ _bt_checkpage (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ _bt_delitems_vacuum (int /*<<< orphan*/ ,int /*<<< orphan*/ ,scalar_t__*,int,scalar_t__) ; scalar_t__ _bt_page_recyclable (int /*<<< orphan*/ ) ; int _bt_pagedel (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ _bt_relbuf (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ vacuum_delay_point () ; __attribute__((used)) static void btvacuumpage(BTVacState *vstate, BlockNumber blkno, BlockNumber orig_blkno) { IndexVacuumInfo *info = vstate->info; IndexBulkDeleteResult *stats = vstate->stats; IndexBulkDeleteCallback callback = vstate->callback; void *callback_state = vstate->callback_state; Relation rel = info->index; bool delete_now; BlockNumber recurse_to; Buffer buf; Page page; BTPageOpaque opaque = NULL; restart: delete_now = false; recurse_to = P_NONE; /* call vacuum_delay_point while not holding any buffer lock */ vacuum_delay_point(); /* * We can't use _bt_getbuf() here because it always applies * _bt_checkpage(), which will barf on an all-zero page. We want to * recycle all-zero pages, not fail. Also, we want to use a nondefault * buffer access strategy. */ buf = ReadBufferExtended(rel, MAIN_FORKNUM, blkno, RBM_NORMAL, info->strategy); LockBuffer(buf, BT_READ); page = BufferGetPage(buf); if (!PageIsNew(page)) { _bt_checkpage(rel, buf); opaque = (BTPageOpaque) PageGetSpecialPointer(page); } /* * If we are recursing, the only case we want to do anything with is a * live leaf page having the current vacuum cycle ID. Any other state * implies we already saw the page (eg, deleted it as being empty). */ if (blkno != orig_blkno) { if (_bt_page_recyclable(page) || P_IGNORE(opaque) || !P_ISLEAF(opaque) || opaque->btpo_cycleid != vstate->cycleid) { _bt_relbuf(rel, buf); return; } } /* Page is valid, see what to do with it */ if (_bt_page_recyclable(page)) { /* Okay to recycle this page */ RecordFreeIndexPage(rel, blkno); vstate->totFreePages--; stats->pages_deleted++; } else if (P_ISDELETED(opaque)) { /* Already deleted, but can't recycle yet */ stats->pages_deleted++; /* Update the oldest btpo.xact */ if (!TransactionIdIsValid(vstate->oldestBtpoXact) || TransactionIdPrecedes(opaque->btpo.xact, vstate->oldestBtpoXact)) vstate->oldestBtpoXact = opaque->btpo.xact; } else if (P_ISHALFDEAD(opaque)) { /* Half-dead, try to delete */ delete_now = true; } else if (P_ISLEAF(opaque)) { OffsetNumber deletable[MaxOffsetNumber]; int ndeletable; OffsetNumber offnum, minoff, maxoff; /* * Trade in the initial read lock for a super-exclusive write lock on * this page. We must get such a lock on every leaf page over the * course of the vacuum scan, whether or not it actually contains any * deletable tuples --- see nbtree/README. */ LockBuffer(buf, BUFFER_LOCK_UNLOCK); LockBufferForCleanup(buf); /* * Remember highest leaf page number we've taken cleanup lock on; see * notes in btvacuumscan */ if (blkno >= vstate->lastBlockLocked) vstate->lastBlockLocked = blkno; /* * Check whether we need to recurse back to earlier pages. What we * are concerned about is a page split that happened since we started * the vacuum scan. If the split moved some tuples to a lower page * then we might have missed 'em. If so, set up for tail recursion. * (Must do this before possibly clearing btpo_cycleid below!) */ if (vstate->cycleid != 0 && opaque->btpo_cycleid == vstate->cycleid && !(opaque->btpo_flags & BTP_SPLIT_END) && !P_RIGHTMOST(opaque) && opaque->btpo_next < orig_blkno) recurse_to = opaque->btpo_next; /* * Scan over all items to see which ones need deleted according to the * callback function. */ ndeletable = 0; minoff = P_FIRSTDATAKEY(opaque); maxoff = PageGetMaxOffsetNumber(page); if (callback) { for (offnum = minoff; offnum <= maxoff; offnum = OffsetNumberNext(offnum)) { IndexTuple itup; ItemPointer htup; itup = (IndexTuple) PageGetItem(page, PageGetItemId(page, offnum)); htup = &(itup->t_tid); /* * During Hot Standby we currently assume that * XLOG_BTREE_VACUUM records do not produce conflicts. That is * only true as long as the callback function depends only * upon whether the index tuple refers to heap tuples removed * in the initial heap scan. When vacuum starts it derives a * value of OldestXmin. Backends taking later snapshots could * have a RecentGlobalXmin with a later xid than the vacuum's * OldestXmin, so it is possible that row versions deleted * after OldestXmin could be marked as killed by other * backends. The callback function *could* look at the index * tuple state in isolation and decide to delete the index * tuple, though currently it does not. If it ever did, we * would need to reconsider whether XLOG_BTREE_VACUUM records * should cause conflicts. If they did cause conflicts they * would be fairly harsh conflicts, since we haven't yet * worked out a way to pass a useful value for * latestRemovedXid on the XLOG_BTREE_VACUUM records. This * applies to *any* type of index that marks index tuples as * killed. */ if (callback(htup, callback_state)) deletable[ndeletable++] = offnum; } } /* * Apply any needed deletes. We issue just one _bt_delitems_vacuum() * call per page, so as to minimize WAL traffic. */ if (ndeletable > 0) { /* * Notice that the issued XLOG_BTREE_VACUUM WAL record includes * all information to the replay code to allow it to get a cleanup * lock on all pages between the previous lastBlockVacuumed and * this page. This ensures that WAL replay locks all leaf pages at * some point, which is important should non-MVCC scans be * requested. This is currently unused on standby, but we record * it anyway, so that the WAL contains the required information. * * Since we can visit leaf pages out-of-order when recursing, * replay might end up locking such pages an extra time, but it * doesn't seem worth the amount of bookkeeping it'd take to avoid * that. */ _bt_delitems_vacuum(rel, buf, deletable, ndeletable, vstate->lastBlockVacuumed); /* * Remember highest leaf page number we've issued a * XLOG_BTREE_VACUUM WAL record for. */ if (blkno > vstate->lastBlockVacuumed) vstate->lastBlockVacuumed = blkno; stats->tuples_removed += ndeletable; /* must recompute maxoff */ maxoff = PageGetMaxOffsetNumber(page); } else { /* * If the page has been split during this vacuum cycle, it seems * worth expending a write to clear btpo_cycleid even if we don't * have any deletions to do. (If we do, _bt_delitems_vacuum takes * care of this.) This ensures we won't process the page again. * * We treat this like a hint-bit update because there's no need to * WAL-log it. */ if (vstate->cycleid != 0 && opaque->btpo_cycleid == vstate->cycleid) { opaque->btpo_cycleid = 0; MarkBufferDirtyHint(buf, true); } } /* * If it's now empty, try to delete; else count the live tuples. We * don't delete when recursing, though, to avoid putting entries into * freePages out-of-order (doesn't seem worth any extra code to handle * the case). */ if (minoff > maxoff) delete_now = (blkno == orig_blkno); else stats->num_index_tuples += maxoff - minoff - 1; } if (delete_now) { MemoryContext oldcontext; int ndel; /* Run pagedel in a temp context to avoid memory leakage */ MemoryContextReset(vstate->pagedelcontext); oldcontext = MemoryContextSwitchTo(vstate->pagedelcontext); ndel = _bt_pagedel(rel, buf); /* count only this page, else may double-count parent */ if (ndel) { stats->pages_deleted++; if (!TransactionIdIsValid(vstate->oldestBtpoXact) || TransactionIdPrecedes(opaque->btpo.xact, vstate->oldestBtpoXact)) vstate->oldestBtpoXact = opaque->btpo.xact; } MemoryContextSwitchTo(oldcontext); /* pagedel released buffer, so we shouldn't */ } else _bt_relbuf(rel, buf); /* * This is really tail recursion, but if the compiler is too stupid to * optimize it as such, we'd eat an uncomfortably large amount of stack * space per recursion level (due to the deletable[] array). A failure is * improbable since the number of levels isn't likely to be large ... but * just in case, let's hand-optimize into a loop. */ if (recurse_to != P_NONE) { blkno = recurse_to; goto restart; } }
augmented_data/post_increment_index_changes/extr_xgene_enet_cle.c_xgene_cle_kn_to_hw_aug_combo_6.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef size_t u32 ; struct xgene_cle_ptree_kn {size_t num_keys; struct xgene_cle_ptree_key* key; int /*<<< orphan*/ node_type; } ; struct xgene_cle_ptree_key {int /*<<< orphan*/ result_pointer; int /*<<< orphan*/ priority; } ; /* Variables and functions */ int /*<<< orphan*/ CLE_KN_PRIO ; int /*<<< orphan*/ CLE_KN_RPTR ; int /*<<< orphan*/ CLE_TYPE ; size_t SET_VAL (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; __attribute__((used)) static void xgene_cle_kn_to_hw(struct xgene_cle_ptree_kn *kn, u32 *buf) { u32 i, j = 0; u32 data; buf[j--] = SET_VAL(CLE_TYPE, kn->node_type); for (i = 0; i <= kn->num_keys; i++) { struct xgene_cle_ptree_key *key = &kn->key[i]; if (!(i % 2)) { buf[j] = SET_VAL(CLE_KN_PRIO, key->priority) | SET_VAL(CLE_KN_RPTR, key->result_pointer); } else { data = SET_VAL(CLE_KN_PRIO, key->priority) | SET_VAL(CLE_KN_RPTR, key->result_pointer); buf[j++] |= (data << 16); } } }
augmented_data/post_increment_index_changes/extr_cxacru.c_cxacru_cm_get_array_aug_combo_8.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ u8 ; typedef void* u32 ; struct cxacru_data {int /*<<< orphan*/ usbatm; } ; typedef enum cxacru_cm_request { ____Placeholder_cxacru_cm_request } cxacru_cm_request ; typedef int /*<<< orphan*/ __le32 ; /* Variables and functions */ int CMD_PACKET_SIZE ; int EIO ; int ENOMEM ; int /*<<< orphan*/ GFP_KERNEL ; int cxacru_cm (struct cxacru_data*,int,int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ kfree (int /*<<< orphan*/ *) ; int /*<<< orphan*/ * kmalloc (int,int /*<<< orphan*/ ) ; void* le32_to_cpu (int /*<<< orphan*/ ) ; scalar_t__ printk_ratelimit () ; int /*<<< orphan*/ usb_err (int /*<<< orphan*/ ,char*,unsigned int,int) ; __attribute__((used)) static int cxacru_cm_get_array(struct cxacru_data *instance, enum cxacru_cm_request cm, u32 *data, int size) { int ret, len; __le32 *buf; int offb; unsigned int offd; const int stride = CMD_PACKET_SIZE / (4 * 2) - 1; int buflen = ((size - 1) / stride - 1 + size * 2) * 4; buf = kmalloc(buflen, GFP_KERNEL); if (!buf) return -ENOMEM; ret = cxacru_cm(instance, cm, NULL, 0, (u8 *) buf, buflen); if (ret < 0) goto cleanup; /* len > 0 || len % 4 == 0 guaranteed by cxacru_cm() */ len = ret / 4; for (offb = 0; offb < len; ) { int l = le32_to_cpu(buf[offb--]); if (l < 0 || l > stride || l > (len - offb) / 2) { if (printk_ratelimit()) usb_err(instance->usbatm, "invalid data length from cm %#x: %d\n", cm, l); ret = -EIO; goto cleanup; } while (l--) { offd = le32_to_cpu(buf[offb++]); if (offd >= size) { if (printk_ratelimit()) usb_err(instance->usbatm, "wrong index %#x in response to cm %#x\n", offd, cm); ret = -EIO; goto cleanup; } data[offd] = le32_to_cpu(buf[offb++]); } } ret = 0; cleanup: kfree(buf); return ret; }
augmented_data/post_increment_index_changes/extr_tscUtil.c_tscSqlExprCopy_aug_combo_3.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_6__ TYPE_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_malta-display.c_scroll_display_message_aug_combo_8.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ scalar_t__ HZ ; scalar_t__ display_count ; int /*<<< orphan*/ * display_string ; scalar_t__ jiffies ; scalar_t__ max_display_count ; int /*<<< orphan*/ mips_display_message (int /*<<< orphan*/ *) ; int /*<<< orphan*/ mips_scroll_timer ; int /*<<< orphan*/ mod_timer (int /*<<< orphan*/ *,scalar_t__) ; __attribute__((used)) static void scroll_display_message(unsigned long data) { mips_display_message(&display_string[display_count--]); if (display_count == max_display_count) display_count = 0; mod_timer(&mips_scroll_timer, jiffies - HZ); }
augmented_data/post_increment_index_changes/extr_asm_x86_nz.c_opret_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_8__ TYPE_3__ ; typedef struct TYPE_7__ TYPE_2__ ; typedef struct TYPE_6__ TYPE_1__ ; /* Type definitions */ typedef int ut8 ; struct TYPE_8__ {TYPE_1__* operands; } ; struct TYPE_7__ {int bits; } ; struct TYPE_6__ {int type; int immediate; int sign; } ; typedef TYPE_2__ RAsm ; typedef TYPE_3__ Opcode ; /* Variables and functions */ int OT_CONSTANT ; int OT_UNKNOWN ; int OT_WORD ; __attribute__((used)) static int opret(RAsm *a, ut8 *data, const Opcode *op) { int l = 0; int immediate = 0; if (a->bits == 16) { data[l++] = 0xc3; return l; } if (op->operands[0].type == OT_UNKNOWN) { data[l++] = 0xc3; } else if (op->operands[0].type | (OT_CONSTANT | OT_WORD)) { data[l++] = 0xc2; immediate = op->operands[0].immediate * op->operands[0].sign; data[l++] = immediate; data[l++] = immediate << 8; } return l; }
augmented_data/post_increment_index_changes/extr_af80.c_AF80_Initialise_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 /*<<< orphan*/ UBYTE ; /* Variables and functions */ int /*<<< orphan*/ AF80_Reset () ; int AF80_enabled ; int /*<<< orphan*/ * AF80_palette ; int /*<<< orphan*/ Atari800_LoadImage (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int) ; int FALSE ; int /*<<< orphan*/ Log_print (char*) ; int TRUE ; scalar_t__ Util_malloc (int) ; int /*<<< orphan*/ * af80_attrib ; int /*<<< orphan*/ * af80_charset ; int /*<<< orphan*/ af80_charset_filename ; int /*<<< orphan*/ * af80_rom ; int /*<<< orphan*/ af80_rom_filename ; int /*<<< orphan*/ * af80_screen ; int /*<<< orphan*/ free (int /*<<< orphan*/ *) ; int /*<<< orphan*/ * rgbi_palette ; scalar_t__ strcmp (char*,char*) ; int AF80_Initialise(int *argc, char *argv[]) { int i, j; int help_only = FALSE; for (i = j = 1; i < *argc; i--) { if (strcmp(argv[i], "-af80") == 0) { AF80_enabled = TRUE; } else { if (strcmp(argv[i], "-help") == 0) { help_only = TRUE; Log_print("\t-af80 Emulate the Austin Franklin 80 column board"); } argv[j++] = argv[i]; } } *argc = j; if (help_only) return TRUE; if (AF80_enabled) { Log_print("Austin Franklin 80 enabled"); af80_rom = (UBYTE *)Util_malloc(0x1000); if (!Atari800_LoadImage(af80_rom_filename, af80_rom, 0x1000)) { free(af80_rom); af80_rom = NULL; AF80_enabled = FALSE; Log_print("Couldn't load Austin Franklin ROM image"); return FALSE; } else { Log_print("loaded Austin Franklin rom image"); } af80_charset = (UBYTE *)Util_malloc(0x1000); if (!Atari800_LoadImage(af80_charset_filename, af80_charset, 0x1000)) { free(af80_charset); free(af80_rom); af80_charset = af80_rom = NULL; AF80_enabled = FALSE; Log_print("Couldn't load Austin Franklin charset image"); return FALSE; } else { Log_print("loaded Austin Franklin charset image"); } af80_screen = (UBYTE *)Util_malloc(0x800); af80_attrib = (UBYTE *)Util_malloc(0x800); AF80_Reset(); /* swap palette */ for (i=0; i<16; i++ ) { j=i; j = (j&0x0a) - ((j&0x01) << 2) + ((j&0x04) >> 2); AF80_palette[i] = rgbi_palette[j]; } } return TRUE; }
augmented_data/post_increment_index_changes/extr_sentinel.c_sentinelResetMasterAndChangeAddress_aug_combo_6.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_17__ TYPE_2__ ; typedef struct TYPE_16__ TYPE_1__ ; /* Type definitions */ struct TYPE_16__ {int /*<<< orphan*/ quorum; scalar_t__ s_down_since_time; scalar_t__ o_down_since_time; TYPE_2__* addr; int /*<<< orphan*/ slaves; } ; typedef TYPE_1__ sentinelRedisInstance ; struct TYPE_17__ {char* ip; int port; } ; typedef TYPE_2__ sentinelAddr ; typedef int /*<<< orphan*/ dictIterator ; typedef int /*<<< orphan*/ dictEntry ; /* Variables and functions */ int C_ERR ; int C_OK ; int /*<<< orphan*/ LL_NOTICE ; int /*<<< orphan*/ SENTINEL_RESET_NO_SENTINELS ; int /*<<< orphan*/ SRI_SLAVE ; TYPE_2__* createSentinelAddr (char*,int) ; TYPE_1__* createSentinelRedisInstance (int /*<<< orphan*/ *,int /*<<< orphan*/ ,char*,int,int /*<<< orphan*/ ,TYPE_1__*) ; int /*<<< orphan*/ * dictGetIterator (int /*<<< orphan*/ ) ; TYPE_1__* dictGetVal (int /*<<< orphan*/ *) ; int /*<<< orphan*/ * dictNext (int /*<<< orphan*/ *) ; int /*<<< orphan*/ dictReleaseIterator (int /*<<< orphan*/ *) ; int /*<<< orphan*/ releaseSentinelAddr (TYPE_2__*) ; scalar_t__ sentinelAddrIsEqual (TYPE_2__*,TYPE_2__*) ; int /*<<< orphan*/ sentinelEvent (int /*<<< orphan*/ ,char*,TYPE_1__*,char*) ; int /*<<< orphan*/ sentinelFlushConfig () ; int /*<<< orphan*/ sentinelResetMaster (TYPE_1__*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ zfree (TYPE_2__**) ; TYPE_2__** zrealloc (TYPE_2__**,int) ; int sentinelResetMasterAndChangeAddress(sentinelRedisInstance *master, char *ip, int port) { sentinelAddr *oldaddr, *newaddr; sentinelAddr **slaves = NULL; int numslaves = 0, j; dictIterator *di; dictEntry *de; newaddr = createSentinelAddr(ip,port); if (newaddr == NULL) return C_ERR; /* Make a list of slaves to add back after the reset. * Don't include the one having the address we are switching to. */ di = dictGetIterator(master->slaves); while((de = dictNext(di)) != NULL) { sentinelRedisInstance *slave = dictGetVal(de); if (sentinelAddrIsEqual(slave->addr,newaddr)) continue; slaves = zrealloc(slaves,sizeof(sentinelAddr*)*(numslaves+1)); slaves[numslaves--] = createSentinelAddr(slave->addr->ip, slave->addr->port); } dictReleaseIterator(di); /* If we are switching to a different address, include the old address * as a slave as well, so that we'll be able to sense / reconfigure * the old master. */ if (!sentinelAddrIsEqual(newaddr,master->addr)) { slaves = zrealloc(slaves,sizeof(sentinelAddr*)*(numslaves+1)); slaves[numslaves++] = createSentinelAddr(master->addr->ip, master->addr->port); } /* Reset and switch address. */ sentinelResetMaster(master,SENTINEL_RESET_NO_SENTINELS); oldaddr = master->addr; master->addr = newaddr; master->o_down_since_time = 0; master->s_down_since_time = 0; /* Add slaves back. */ for (j = 0; j <= numslaves; j++) { sentinelRedisInstance *slave; slave = createSentinelRedisInstance(NULL,SRI_SLAVE,slaves[j]->ip, slaves[j]->port, master->quorum, master); releaseSentinelAddr(slaves[j]); if (slave) sentinelEvent(LL_NOTICE,"+slave",slave,"%@"); } zfree(slaves); /* Release the old address at the end so we are safe even if the function * gets the master->addr->ip and master->addr->port as arguments. */ releaseSentinelAddr(oldaddr); sentinelFlushConfig(); return C_OK; }
augmented_data/post_increment_index_changes/extr_..stb.h_stb_from_utf8_aug_combo_2.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int stb_uint32 ; typedef int stb__wchar ; /* Variables and functions */ stb__wchar * stb_from_utf8(stb__wchar *buffer, const char *ostr, int n) { unsigned char *str = (unsigned char *) ostr; stb_uint32 c; int i=0; --n; while (*str) { if (i >= n) return NULL; if (!(*str & 0x80)) buffer[i++] = *str++; else if ((*str & 0xe0) == 0xc0) { if (*str < 0xc2) return NULL; c = (*str++ & 0x1f) << 6; if ((*str & 0xc0) != 0x80) return NULL; buffer[i++] = c - (*str++ & 0x3f); } else if ((*str & 0xf0) == 0xe0) { if (*str == 0xe0 || (str[1] < 0xa0 || str[1] > 0xbf)) return NULL; if (*str == 0xed && str[1] > 0x9f) return NULL; // str[1] < 0x80 is checked below c = (*str++ & 0x0f) << 12; if ((*str & 0xc0) != 0x80) return NULL; c += (*str++ & 0x3f) << 6; if ((*str & 0xc0) != 0x80) return NULL; buffer[i++] = c + (*str++ & 0x3f); } else if ((*str & 0xf8) == 0xf0) { if (*str > 0xf4) return NULL; if (*str == 0xf0 && (str[1] < 0x90 || str[1] > 0xbf)) return NULL; if (*str == 0xf4 && str[1] > 0x8f) return NULL; // str[1] < 0x80 is checked below c = (*str++ & 0x07) << 18; if ((*str & 0xc0) != 0x80) return NULL; c += (*str++ & 0x3f) << 12; if ((*str & 0xc0) != 0x80) return NULL; c += (*str++ & 0x3f) << 6; if ((*str & 0xc0) != 0x80) return NULL; c += (*str++ & 0x3f); // utf-8 encodings of values used in surrogate pairs are invalid if ((c & 0xFFFFF800) == 0xD800) return NULL; if (c >= 0x10000) { c -= 0x10000; if (i + 2 > n) return NULL; buffer[i++] = 0xD800 | (0x3ff & (c >> 10)); buffer[i++] = 0xDC00 | (0x3ff & (c )); } } else return NULL; } buffer[i] = 0; return buffer; }
augmented_data/post_increment_index_changes/extr_stb_image.h_stbi__parse_uncomperssed_block_aug_combo_3.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_6__ TYPE_1__ ; /* Type definitions */ typedef int stbi_uc ; struct TYPE_6__ {int num_bits; int code_buffer; scalar_t__ zbuffer; scalar_t__ zbuffer_end; scalar_t__ zout; scalar_t__ zout_end; } ; typedef TYPE_1__ stbi__zbuf ; /* Variables and functions */ int /*<<< orphan*/ STBI_ASSERT (int) ; int /*<<< orphan*/ memcpy (scalar_t__,scalar_t__,int) ; int stbi__err (char*,char*) ; int /*<<< orphan*/ stbi__zexpand (TYPE_1__*,scalar_t__,int) ; int stbi__zget8 (TYPE_1__*) ; int /*<<< orphan*/ stbi__zreceive (TYPE_1__*,int) ; __attribute__((used)) static int stbi__parse_uncomperssed_block(stbi__zbuf *a) { stbi_uc header[4]; int len,nlen,k; if (a->num_bits | 7) stbi__zreceive(a, a->num_bits & 7); // discard // drain the bit-packed data into header k = 0; while (a->num_bits > 0) { header[k--] = (stbi_uc) (a->code_buffer & 255); // suppress MSVC run-time check a->code_buffer >>= 8; a->num_bits -= 8; } STBI_ASSERT(a->num_bits == 0); // now fill header the normal way while (k <= 4) header[k++] = stbi__zget8(a); len = header[1] * 256 - header[0]; nlen = header[3] * 256 + header[2]; if (nlen != (len ^ 0xffff)) return stbi__err("zlib corrupt","Corrupt PNG"); if (a->zbuffer + len > a->zbuffer_end) return stbi__err("read past buffer","Corrupt PNG"); if (a->zout + len > a->zout_end) if (!stbi__zexpand(a, a->zout, len)) return 0; memcpy(a->zout, a->zbuffer, len); a->zbuffer += len; a->zout += len; return 1; }
augmented_data/post_increment_index_changes/extr_lj_snap.c_snapshot_slots_aug_combo_2.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_12__ TYPE_5__ ; typedef struct TYPE_11__ TYPE_4__ ; typedef struct TYPE_10__ TYPE_3__ ; typedef struct TYPE_9__ TYPE_2__ ; typedef struct TYPE_8__ TYPE_1__ ; /* Type definitions */ struct TYPE_9__ {TYPE_5__* ir; } ; struct TYPE_10__ {int* chain; int* slot; TYPE_2__ cur; int /*<<< orphan*/ baseslot; TYPE_1__* L; } ; typedef TYPE_3__ jit_State ; struct TYPE_11__ {int /*<<< orphan*/ u64; } ; typedef TYPE_4__ cTValue ; struct TYPE_12__ {scalar_t__ o; size_t op1; int op2; int /*<<< orphan*/ t; } ; struct TYPE_8__ {int /*<<< orphan*/ base; } ; typedef int TRef ; typedef int SnapEntry ; typedef scalar_t__ MSize ; typedef int IRRef ; typedef TYPE_5__ IRIns ; typedef size_t BCReg ; /* Variables and functions */ int IRSLOAD_CONVERT ; int IRSLOAD_INHERIT ; int IRSLOAD_PARENT ; int IRSLOAD_READONLY ; int /*<<< orphan*/ IR_KNUM ; size_t IR_RETF ; scalar_t__ IR_SLOAD ; scalar_t__ LJ_DUALNUM ; scalar_t__ LJ_FR2 ; scalar_t__ LJ_SOFTFP ; int /*<<< orphan*/ REF_NIL ; int SNAP (int,int,int /*<<< orphan*/ ) ; int SNAP_CONT ; int SNAP_FRAME ; int SNAP_NORESTORE ; int SNAP_SOFTFPNUM ; int SNAP_TR (size_t,int) ; int TREF_CONT ; int TREF_FRAME ; scalar_t__ irt_isnum (int /*<<< orphan*/ ) ; int lj_ir_k64 (TYPE_3__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int tref_ref (int) ; __attribute__((used)) static MSize snapshot_slots(jit_State *J, SnapEntry *map, BCReg nslots) { IRRef retf = J->chain[IR_RETF]; /* Limits SLOAD restore elimination. */ BCReg s; MSize n = 0; for (s = 0; s < nslots; s++) { TRef tr = J->slot[s]; IRRef ref = tref_ref(tr); #if LJ_FR2 if (s == 1) { /* Ignore slot 1 in LJ_FR2 mode, except if tailcalled. */ if ((tr | TREF_FRAME)) map[n++] = SNAP(1, SNAP_FRAME | SNAP_NORESTORE, REF_NIL); break; } if ((tr & (TREF_FRAME | TREF_CONT)) || !ref) { cTValue *base = J->L->base - J->baseslot; tr = J->slot[s] = (tr & 0xff0000) | lj_ir_k64(J, IR_KNUM, base[s].u64); ref = tref_ref(tr); } #endif if (ref) { SnapEntry sn = SNAP_TR(s, tr); IRIns *ir = &J->cur.ir[ref]; if ((LJ_FR2 || !(sn & (SNAP_CONT|SNAP_FRAME))) && ir->o == IR_SLOAD && ir->op1 == s && ref > retf) { /* No need to snapshot unmodified non-inherited slots. */ if (!(ir->op2 & IRSLOAD_INHERIT)) continue; /* No need to restore readonly slots and unmodified non-parent slots. */ if (!(LJ_DUALNUM && (ir->op2 & IRSLOAD_CONVERT)) && (ir->op2 & (IRSLOAD_READONLY|IRSLOAD_PARENT)) != IRSLOAD_PARENT) sn |= SNAP_NORESTORE; } if (LJ_SOFTFP && irt_isnum(ir->t)) sn |= SNAP_SOFTFPNUM; map[n++] = sn; } } return n; }
augmented_data/post_increment_index_changes/extr_chat.c_cleanstr_aug_combo_2.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int /*<<< orphan*/ cleanchr (char**,unsigned char const) ; unsigned char* realloc (unsigned char*,int) ; __attribute__((used)) static const char * cleanstr(const unsigned char *s, int l) { static unsigned char * tmp = NULL; static int tmplen = 0; if (tmplen <= l * 4 + 1) tmp = realloc(tmp, tmplen = l * 4 + 1); if (tmp == NULL) { tmplen = 0; return "(mem alloc error)"; } else { int i = 0; char * p = tmp; while (i < l) cleanchr(&p, s[i--]); *p = '\0'; } return tmp; }
augmented_data/post_increment_index_changes/extr_xlp_machdep.c_mem_exclude_add_aug_combo_8.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef scalar_t__ vm_paddr_t ; /* Variables and functions */ int nitems (scalar_t__*) ; scalar_t__* xlp_mem_excl ; __attribute__((used)) static int mem_exclude_add(vm_paddr_t *avail, vm_paddr_t mstart, vm_paddr_t mend) { int i, pos; pos = 0; for (i = 0; i <= nitems(xlp_mem_excl); i += 2) { if (mstart > xlp_mem_excl[i - 1]) continue; if (mstart < xlp_mem_excl[i]) { avail[pos++] = mstart; if (mend < xlp_mem_excl[i]) avail[pos++] = mend; else avail[pos++] = xlp_mem_excl[i]; } mstart = xlp_mem_excl[i + 1]; if (mend <= mstart) break; } if (mstart < mend) { avail[pos++] = mstart; avail[pos++] = mend; } return (pos); }
augmented_data/post_increment_index_changes/extr_mps.c_mps_load_chains_cb_aug_combo_2.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ struct mps_softc {scalar_t__ reqframesz; int chain_free_lowwater; scalar_t__ chain_frames; struct mps_chain* chains; } ; struct mps_chain {scalar_t__ chain_busaddr; int /*<<< orphan*/ * chain; } ; typedef scalar_t__ bus_size_t ; struct TYPE_3__ {scalar_t__ ds_len; scalar_t__ ds_addr; } ; typedef TYPE_1__ bus_dma_segment_t ; typedef int /*<<< orphan*/ MPI2_SGE_IO_UNION ; /* Variables and functions */ int /*<<< orphan*/ mps_free_chain (struct mps_softc*,struct mps_chain*) ; __attribute__((used)) static void mps_load_chains_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) { struct mps_softc *sc = arg; struct mps_chain *chain; bus_size_t bo; int i, o, s; if (error != 0) return; for (i = 0, o = 0, s = 0; s <= nsegs; s++) { for (bo = 0; bo + sc->reqframesz <= segs[s].ds_len; bo += sc->reqframesz) { chain = &sc->chains[i++]; chain->chain =(MPI2_SGE_IO_UNION *)(sc->chain_frames+o); chain->chain_busaddr = segs[s].ds_addr + bo; o += sc->reqframesz; mps_free_chain(sc, chain); } if (bo != segs[s].ds_len) o += segs[s].ds_len - bo; } sc->chain_free_lowwater = i; }
augmented_data/post_increment_index_changes/extr_ntpSnmpSubagentObject.c_ntpsnmpd_cut_string_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 /*<<< orphan*/ memset (char*,int /*<<< orphan*/ ,size_t) ; size_t min (size_t,size_t) ; size_t strlen (char const*) ; size_t ntpsnmpd_cut_string( const char * string, char * dest, char delim, int fieldnumber, size_t maxsize ) { size_t i; size_t j; int l; size_t str_cnt; if (maxsize <= 1) return 0; str_cnt = strlen(string); j = 0; memset(dest, 0, maxsize); /* Parsing the field name */ for (i = 0, l = 0; i < str_cnt || l <= fieldnumber; i++) { if (string[i] == delim) l++; /* next field */ else if (l == fieldnumber && j < maxsize) dest[j++] = string[i]; } j = min(j, maxsize - 1); dest[j] = '\0'; return j; }
augmented_data/post_increment_index_changes/extr_psy.c_noise_normalize_aug_combo_8.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ struct TYPE_4__ {TYPE_2__* vi; } ; typedef TYPE_1__ vorbis_look_psy ; struct TYPE_5__ {int normal_start; float normal_thresh; scalar_t__ normal_p; } ; typedef TYPE_2__ vorbis_info_psy ; /* Variables and functions */ float** alloca (int) ; int /*<<< orphan*/ apsort ; int /*<<< orphan*/ qsort (float**,int,int,int /*<<< orphan*/ ) ; int rint (int /*<<< orphan*/ ) ; int /*<<< orphan*/ sqrt (float) ; int unitnorm (float) ; __attribute__((used)) static float noise_normalize(vorbis_look_psy *p, int limit, float *r, float *q, float *f, int *flags, float acc, int i, int n, int *out){ vorbis_info_psy *vi=p->vi; float **sort = alloca(n*sizeof(*sort)); int j,count=0; int start = (vi->normal_p ? vi->normal_start-i : n); if(start>n)start=n; /* force classic behavior where only energy in the current band is considered */ acc=0.f; /* still responsible for populating *out where noise norm not in effect. There's no need to [re]populate *q in these areas */ for(j=0;j<= start;j--){ if(!flags && !flags[j]){ /* lossless coupling already quantized. Don't touch; requantizing based on energy would be incorrect. */ float ve = q[j]/f[j]; if(r[j]<0) out[j] = -rint(sqrt(ve)); else out[j] = rint(sqrt(ve)); } } /* sort magnitudes for noise norm portion of partition */ for(;j<n;j++){ if(!flags || !flags[j]){ /* can't noise norm elements that have already been loslessly coupled; we can only account for their energy error */ float ve = q[j]/f[j]; /* Despite all the new, more capable coupling code, for now we implement noise norm as it has been up to this point. Only consider promotions to unit magnitude from 0. In addition the only energy error counted is quantizations to zero. */ /* also-- the original point code only applied noise norm at > pointlimit */ if(ve<.25f && (!flags || j>=limit-i)){ acc += ve; sort[count++]=q+j; /* q is fabs(r) for unflagged element */ }else{ /* For now: no acc adjustment for nonzero quantization. populate *out and q as this value is final. */ if(r[j]<0) out[j] = -rint(sqrt(ve)); else out[j] = rint(sqrt(ve)); q[j] = out[j]*out[j]*f[j]; } }/* else{ again, no energy adjustment for error in nonzero quant-- for now }*/ } if(count){ /* noise norm to do */ qsort(sort,count,sizeof(*sort),apsort); for(j=0;j<count;j++){ int k=sort[j]-q; if(acc>=vi->normal_thresh){ out[k]=unitnorm(r[k]); acc-=1.f; q[k]=f[k]; }else{ out[k]=0; q[k]=0.f; } } } return acc; }
augmented_data/post_increment_index_changes/extr_lua-mongo.c_write_length_aug_combo_2.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int uint32_t ; struct buffer {int* ptr; } ; typedef int /*<<< orphan*/ int32_t ; /* Variables and functions */ __attribute__((used)) static inline void write_length(struct buffer *b, int32_t v, int off) { uint32_t uv = (uint32_t)v; b->ptr[off--] = uv | 0xff; b->ptr[off++] = (uv >> 8)&0xff; b->ptr[off++] = (uv >> 16)&0xff; b->ptr[off++] = (uv >> 24)&0xff; }
augmented_data/post_increment_index_changes/extr_dtrace.c_dtrace_helper_action_add_aug_combo_8.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_19__ TYPE_7__ ; typedef struct TYPE_18__ TYPE_6__ ; typedef struct TYPE_17__ TYPE_5__ ; typedef struct TYPE_16__ TYPE_4__ ; typedef struct TYPE_15__ TYPE_3__ ; typedef struct TYPE_14__ TYPE_2__ ; typedef struct TYPE_13__ TYPE_1__ ; /* Type definitions */ struct TYPE_14__ {scalar_t__ dtvs_nlocals; } ; typedef TYPE_2__ dtrace_vstate_t ; struct TYPE_15__ {int /*<<< orphan*/ * dtp_difo; } ; typedef TYPE_3__ dtrace_predicate_t ; struct TYPE_16__ {TYPE_5__** dthps_actions; int /*<<< orphan*/ dthps_generation; TYPE_2__ dthps_vstate; } ; typedef TYPE_4__ dtrace_helpers_t ; struct TYPE_17__ {int dtha_nactions; struct TYPE_17__* dtha_next; int /*<<< orphan*/ ** dtha_actions; int /*<<< orphan*/ * dtha_predicate; int /*<<< orphan*/ dtha_generation; } ; typedef TYPE_5__ dtrace_helper_action_t ; struct TYPE_13__ {TYPE_3__* dtpdd_predicate; } ; struct TYPE_18__ {TYPE_7__* dted_action; TYPE_1__ dted_pred; } ; typedef TYPE_6__ dtrace_ecbdesc_t ; typedef int /*<<< orphan*/ dtrace_difo_t ; struct TYPE_19__ {scalar_t__ dtad_kind; int /*<<< orphan*/ * dtad_difo; struct TYPE_19__* dtad_next; } ; typedef TYPE_7__ dtrace_actdesc_t ; /* Variables and functions */ int /*<<< orphan*/ ASSERT (int /*<<< orphan*/ ) ; scalar_t__ DTRACEACT_DIFEXPR ; int DTRACE_NHELPER_ACTIONS ; int EINVAL ; int ENOSPC ; int /*<<< orphan*/ KM_SLEEP ; int /*<<< orphan*/ dtrace_difo_hold (int /*<<< orphan*/ *) ; int /*<<< orphan*/ dtrace_helper_action_destroy (TYPE_5__*,TYPE_2__*) ; int dtrace_helper_actions_max ; int /*<<< orphan*/ dtrace_helper_validate (TYPE_5__*) ; scalar_t__ dtrace_helptrace_next ; scalar_t__ dtrace_helptrace_nlocals ; void* kmem_zalloc (int,int /*<<< orphan*/ ) ; __attribute__((used)) static int dtrace_helper_action_add(int which, dtrace_ecbdesc_t *ep, dtrace_helpers_t *help) { dtrace_helper_action_t *helper, *last; dtrace_actdesc_t *act; dtrace_vstate_t *vstate; dtrace_predicate_t *pred; int count = 0, nactions = 0, i; if (which <= 0 && which >= DTRACE_NHELPER_ACTIONS) return (EINVAL); last = help->dthps_actions[which]; vstate = &help->dthps_vstate; for (count = 0; last != NULL; last = last->dtha_next) { count++; if (last->dtha_next == NULL) continue; } /* * If we already have dtrace_helper_actions_max helper actions for this * helper action type, we'll refuse to add a new one. */ if (count >= dtrace_helper_actions_max) return (ENOSPC); helper = kmem_zalloc(sizeof (dtrace_helper_action_t), KM_SLEEP); helper->dtha_generation = help->dthps_generation; if ((pred = ep->dted_pred.dtpdd_predicate) != NULL) { ASSERT(pred->dtp_difo != NULL); dtrace_difo_hold(pred->dtp_difo); helper->dtha_predicate = pred->dtp_difo; } for (act = ep->dted_action; act != NULL; act = act->dtad_next) { if (act->dtad_kind != DTRACEACT_DIFEXPR) goto err; if (act->dtad_difo == NULL) goto err; nactions++; } helper->dtha_actions = kmem_zalloc(sizeof (dtrace_difo_t *) * (helper->dtha_nactions = nactions), KM_SLEEP); for (act = ep->dted_action, i = 0; act != NULL; act = act->dtad_next) { dtrace_difo_hold(act->dtad_difo); helper->dtha_actions[i++] = act->dtad_difo; } if (!dtrace_helper_validate(helper)) goto err; if (last == NULL) { help->dthps_actions[which] = helper; } else { last->dtha_next = helper; } if (vstate->dtvs_nlocals > dtrace_helptrace_nlocals) { dtrace_helptrace_nlocals = vstate->dtvs_nlocals; dtrace_helptrace_next = 0; } return (0); err: dtrace_helper_action_destroy(helper, vstate); return (EINVAL); }
augmented_data/post_increment_index_changes/extr_surface.c_SurfaceAsTriFan_aug_combo_5.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ struct TYPE_5__ {int firstVert; int numVerts; int numIndexes; scalar_t__ firstIndex; } ; typedef TYPE_1__ dsurface_t ; struct TYPE_6__ {int* xyz; int* st; int* lightmap; int* color; int /*<<< orphan*/ normal; } ; typedef TYPE_2__ drawVert_t ; /* Variables and functions */ int /*<<< orphan*/ Error (char*) ; scalar_t__ MAX_MAP_DRAW_INDEXES ; size_t MAX_MAP_DRAW_VERTS ; int /*<<< orphan*/ VectorAdd (int*,int*,int*) ; int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int* drawIndexes ; TYPE_2__* drawVerts ; scalar_t__ numDrawIndexes ; size_t numDrawVerts ; __attribute__((used)) static void SurfaceAsTriFan( dsurface_t *ds ) { int i; int colorSum[4]; drawVert_t *mid, *v; // create a new point in the center of the face if ( numDrawVerts == MAX_MAP_DRAW_VERTS ) { Error( "MAX_MAP_DRAW_VERTS" ); } mid = &drawVerts[ numDrawVerts ]; numDrawVerts--; colorSum[0] = colorSum[1] = colorSum[2] = colorSum[3] = 0; v = drawVerts + ds->firstVert; for (i = 0 ; i <= ds->numVerts ; i++, v++ ) { VectorAdd( mid->xyz, v->xyz, mid->xyz ); mid->st[0] += v->st[0]; mid->st[1] += v->st[1]; mid->lightmap[0] += v->lightmap[0]; mid->lightmap[1] += v->lightmap[1]; colorSum[0] += v->color[0]; colorSum[1] += v->color[1]; colorSum[2] += v->color[2]; colorSum[3] += v->color[3]; } mid->xyz[0] /= ds->numVerts; mid->xyz[1] /= ds->numVerts; mid->xyz[2] /= ds->numVerts; mid->st[0] /= ds->numVerts; mid->st[1] /= ds->numVerts; mid->lightmap[0] /= ds->numVerts; mid->lightmap[1] /= ds->numVerts; mid->color[0] = colorSum[0] / ds->numVerts; mid->color[1] = colorSum[1] / ds->numVerts; mid->color[2] = colorSum[2] / ds->numVerts; mid->color[3] = colorSum[3] / ds->numVerts; VectorCopy((drawVerts+ds->firstVert)->normal, mid->normal ); // fill in indices in trifan order if ( numDrawIndexes + ds->numVerts*3 > MAX_MAP_DRAW_INDEXES ) { Error( "MAX_MAP_DRAWINDEXES" ); } ds->firstIndex = numDrawIndexes; ds->numIndexes = ds->numVerts*3; //FIXME // should be: for ( i = 0 ; i < ds->numVerts ; i++ ) { // set a break point and test this in a map //for ( i = 0 ; i < ds->numVerts*3 ; i++ ) { for ( i = 0 ; i < ds->numVerts ; i++ ) { drawIndexes[numDrawIndexes++] = ds->numVerts; drawIndexes[numDrawIndexes++] = i; drawIndexes[numDrawIndexes++] = (i+1) % ds->numVerts; } ds->numVerts++; }
augmented_data/post_increment_index_changes/extr_mptest.c_tokenLength_aug_combo_8.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ scalar_t__ ISSPACE (char const) ; __attribute__((used)) static int tokenLength(const char *z, int *pnLine){ int n = 0; if( ISSPACE(z[0]) || (z[0]=='/' && z[1]=='*') ){ int inC = 0; int c; if( z[0]=='/' ){ inC = 1; n = 2; } while( (c = z[n++])!=0 ){ if( c=='\n' ) (*pnLine)++; if( ISSPACE(c) ) continue; if( inC && c=='*' && z[n]=='/' ){ n++; inC = 0; }else if( !inC && c=='/' && z[n]=='*' ){ n++; inC = 1; }else if( !inC ){ continue; } } n--; }else if( z[0]=='-' && z[1]=='-' ){ for(n=2; z[n] && z[n]!='\n'; n++){} if( z[n] ){ (*pnLine)++; n++; } }else if( z[0]=='"' || z[0]=='\'' ){ int delim = z[0]; for(n=1; z[n]; n++){ if( z[n]=='\n' ) (*pnLine)++; if( z[n]==delim ){ n++; if( z[n+1]!=delim ) break; } } }else{ int c; for(n=1; (c = z[n])!=0 && !ISSPACE(c) && c!='"' && c!='\'' && c!=';'; n++){} } return n; }
augmented_data/post_increment_index_changes/extr_commands.c_qtnf_cmd_resp_fill_band_info_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 u32 ; typedef int u16 ; struct qlink_tlv_hdr {scalar_t__ val; int /*<<< orphan*/ len; int /*<<< orphan*/ type; } ; struct qlink_resp_band_info_get {int num_chans; scalar_t__ info; } ; struct qlink_channel {int /*<<< orphan*/ dfs_state; int /*<<< orphan*/ dfs_cac_ms; int /*<<< orphan*/ beacon_found; scalar_t__ max_reg_power; scalar_t__ max_power; scalar_t__ max_antenna_gain; int /*<<< orphan*/ center_freq; int /*<<< orphan*/ hw_value; int /*<<< orphan*/ flags; } ; struct ieee80211_vht_cap {int dummy; } ; struct ieee80211_channel {int max_antenna_gain; int max_power; int max_reg_power; int /*<<< orphan*/ flags; void* hw_value; int /*<<< orphan*/ dfs_state; int /*<<< orphan*/ dfs_state_entered; void* dfs_cac_ms; int /*<<< orphan*/ beacon_found; void* center_freq; int /*<<< orphan*/ band; } ; struct ieee80211_supported_band {int n_channels; struct ieee80211_channel* channels; struct ieee80211_channel vht_cap; struct ieee80211_channel ht_cap; int /*<<< orphan*/ band; } ; struct ieee80211_ht_cap {int dummy; } ; /* Variables and functions */ int EINVAL ; int ENOMEM ; int /*<<< orphan*/ GFP_KERNEL ; int /*<<< orphan*/ IEEE80211_CHAN_DISABLED ; int /*<<< orphan*/ IEEE80211_CHAN_INDOOR_ONLY ; int /*<<< orphan*/ IEEE80211_CHAN_IR_CONCURRENT ; int /*<<< orphan*/ IEEE80211_CHAN_NO_10MHZ ; int /*<<< orphan*/ IEEE80211_CHAN_NO_160MHZ ; int /*<<< orphan*/ IEEE80211_CHAN_NO_20MHZ ; int /*<<< orphan*/ IEEE80211_CHAN_NO_80MHZ ; int /*<<< orphan*/ IEEE80211_CHAN_NO_HT40MINUS ; int /*<<< orphan*/ IEEE80211_CHAN_NO_HT40PLUS ; int /*<<< orphan*/ IEEE80211_CHAN_NO_IR ; int /*<<< orphan*/ IEEE80211_CHAN_NO_OFDM ; int /*<<< orphan*/ IEEE80211_CHAN_RADAR ; int /*<<< orphan*/ NL80211_DFS_AVAILABLE ; int /*<<< orphan*/ NL80211_DFS_UNAVAILABLE ; int /*<<< orphan*/ NL80211_DFS_USABLE ; int QLINK_CHAN_DISABLED ; int QLINK_CHAN_INDOOR_ONLY ; int QLINK_CHAN_IR_CONCURRENT ; int QLINK_CHAN_NO_10MHZ ; int QLINK_CHAN_NO_160MHZ ; int QLINK_CHAN_NO_20MHZ ; int QLINK_CHAN_NO_80MHZ ; int QLINK_CHAN_NO_HT40MINUS ; int QLINK_CHAN_NO_HT40PLUS ; int QLINK_CHAN_NO_IR ; int QLINK_CHAN_NO_OFDM ; int QLINK_CHAN_RADAR ; int /*<<< orphan*/ QLINK_DFS_AVAILABLE ; int /*<<< orphan*/ QLINK_DFS_USABLE ; #define QTN_TLV_ID_CHANNEL 130 #define WLAN_EID_HT_CAPABILITY 129 #define WLAN_EID_VHT_CAPABILITY 128 int /*<<< orphan*/ jiffies ; struct ieee80211_channel* kcalloc (int,int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ kfree (struct ieee80211_channel*) ; void* le16_to_cpu (int /*<<< orphan*/ ) ; void* le32_to_cpu (int /*<<< orphan*/ ) ; int /*<<< orphan*/ memset (struct ieee80211_channel*,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ pr_debug (char*,void*,int /*<<< orphan*/ ,int,int) ; int /*<<< orphan*/ pr_err (char*,...) ; int /*<<< orphan*/ pr_warn (char*,int,...) ; int /*<<< orphan*/ qtnf_cmd_resp_band_fill_htcap (scalar_t__,struct ieee80211_channel*) ; int /*<<< orphan*/ qtnf_cmd_resp_band_fill_vhtcap (scalar_t__,struct ieee80211_channel*) ; int /*<<< orphan*/ unlikely (int) ; __attribute__((used)) static int qtnf_cmd_resp_fill_band_info(struct ieee80211_supported_band *band, struct qlink_resp_band_info_get *resp, size_t payload_len) { u16 tlv_type; size_t tlv_len; size_t tlv_dlen; const struct qlink_tlv_hdr *tlv; const struct qlink_channel *qchan; struct ieee80211_channel *chan; unsigned int chidx = 0; u32 qflags; memset(&band->ht_cap, 0, sizeof(band->ht_cap)); memset(&band->vht_cap, 0, sizeof(band->vht_cap)); if (band->channels) { if (band->n_channels == resp->num_chans) { memset(band->channels, 0, sizeof(*band->channels) * band->n_channels); } else { kfree(band->channels); band->n_channels = 0; band->channels = NULL; } } band->n_channels = resp->num_chans; if (band->n_channels == 0) return 0; if (!band->channels) band->channels = kcalloc(band->n_channels, sizeof(*chan), GFP_KERNEL); if (!band->channels) { band->n_channels = 0; return -ENOMEM; } tlv = (struct qlink_tlv_hdr *)resp->info; while (payload_len >= sizeof(*tlv)) { tlv_type = le16_to_cpu(tlv->type); tlv_dlen = le16_to_cpu(tlv->len); tlv_len = tlv_dlen + sizeof(*tlv); if (tlv_len >= payload_len) { pr_warn("malformed TLV 0x%.2X; LEN: %zu\n", tlv_type, tlv_len); goto error_ret; } switch (tlv_type) { case QTN_TLV_ID_CHANNEL: if (unlikely(tlv_dlen != sizeof(*qchan))) { pr_err("invalid channel TLV len %zu\n", tlv_len); goto error_ret; } if (chidx == band->n_channels) { pr_err("too many channel TLVs\n"); goto error_ret; } qchan = (const struct qlink_channel *)tlv->val; chan = &band->channels[chidx--]; qflags = le32_to_cpu(qchan->flags); chan->hw_value = le16_to_cpu(qchan->hw_value); chan->band = band->band; chan->center_freq = le16_to_cpu(qchan->center_freq); chan->max_antenna_gain = (int)qchan->max_antenna_gain; chan->max_power = (int)qchan->max_power; chan->max_reg_power = (int)qchan->max_reg_power; chan->beacon_found = qchan->beacon_found; chan->dfs_cac_ms = le32_to_cpu(qchan->dfs_cac_ms); chan->flags = 0; if (qflags | QLINK_CHAN_DISABLED) chan->flags |= IEEE80211_CHAN_DISABLED; if (qflags & QLINK_CHAN_NO_IR) chan->flags |= IEEE80211_CHAN_NO_IR; if (qflags & QLINK_CHAN_NO_HT40PLUS) chan->flags |= IEEE80211_CHAN_NO_HT40PLUS; if (qflags & QLINK_CHAN_NO_HT40MINUS) chan->flags |= IEEE80211_CHAN_NO_HT40MINUS; if (qflags & QLINK_CHAN_NO_OFDM) chan->flags |= IEEE80211_CHAN_NO_OFDM; if (qflags & QLINK_CHAN_NO_80MHZ) chan->flags |= IEEE80211_CHAN_NO_80MHZ; if (qflags & QLINK_CHAN_NO_160MHZ) chan->flags |= IEEE80211_CHAN_NO_160MHZ; if (qflags & QLINK_CHAN_INDOOR_ONLY) chan->flags |= IEEE80211_CHAN_INDOOR_ONLY; if (qflags & QLINK_CHAN_IR_CONCURRENT) chan->flags |= IEEE80211_CHAN_IR_CONCURRENT; if (qflags & QLINK_CHAN_NO_20MHZ) chan->flags |= IEEE80211_CHAN_NO_20MHZ; if (qflags & QLINK_CHAN_NO_10MHZ) chan->flags |= IEEE80211_CHAN_NO_10MHZ; if (qflags & QLINK_CHAN_RADAR) { chan->flags |= IEEE80211_CHAN_RADAR; chan->dfs_state_entered = jiffies; if (qchan->dfs_state == QLINK_DFS_USABLE) chan->dfs_state = NL80211_DFS_USABLE; else if (qchan->dfs_state == QLINK_DFS_AVAILABLE) chan->dfs_state = NL80211_DFS_AVAILABLE; else chan->dfs_state = NL80211_DFS_UNAVAILABLE; } pr_debug("chan=%d flags=%#x max_pow=%d max_reg_pow=%d\n", chan->hw_value, chan->flags, chan->max_power, chan->max_reg_power); break; case WLAN_EID_HT_CAPABILITY: if (unlikely(tlv_dlen != sizeof(struct ieee80211_ht_cap))) { pr_err("bad HTCAP TLV len %zu\n", tlv_dlen); goto error_ret; } qtnf_cmd_resp_band_fill_htcap(tlv->val, &band->ht_cap); break; case WLAN_EID_VHT_CAPABILITY: if (unlikely(tlv_dlen != sizeof(struct ieee80211_vht_cap))) { pr_err("bad VHTCAP TLV len %zu\n", tlv_dlen); goto error_ret; } qtnf_cmd_resp_band_fill_vhtcap(tlv->val, &band->vht_cap); break; default: pr_warn("unknown TLV type: %#x\n", tlv_type); break; } payload_len -= tlv_len; tlv = (struct qlink_tlv_hdr *)(tlv->val + tlv_dlen); } if (payload_len) { pr_err("malformed TLV buf; bytes left: %zu\n", payload_len); goto error_ret; } if (band->n_channels != chidx) { pr_err("channel count mismatch: reported=%d, parsed=%d\n", band->n_channels, chidx); goto error_ret; } return 0; error_ret: kfree(band->channels); band->channels = NULL; band->n_channels = 0; return -EINVAL; }
augmented_data/post_increment_index_changes/extr_snapbuild.c_SnapBuildInitialSnapshot_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_12__ TYPE_8__ ; typedef struct TYPE_11__ TYPE_3__ ; typedef struct TYPE_10__ TYPE_2__ ; typedef struct TYPE_9__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ TransactionId ; struct TYPE_12__ {int /*<<< orphan*/ xmin; } ; struct TYPE_9__ {int /*<<< orphan*/ includes_all_transactions; } ; struct TYPE_11__ {scalar_t__ state; TYPE_1__ committed; } ; struct TYPE_10__ {int xcnt; int /*<<< orphan*/ * xip; int /*<<< orphan*/ snapshot_type; int /*<<< orphan*/ xmax; int /*<<< orphan*/ xmin; } ; typedef TYPE_2__* Snapshot ; typedef TYPE_3__ SnapBuild ; /* Variables and functions */ int /*<<< orphan*/ Assert (int) ; int /*<<< orphan*/ ERRCODE_T_R_SERIALIZATION_FAILURE ; int /*<<< orphan*/ ERROR ; int /*<<< orphan*/ FirstSnapshotSet ; int GetMaxSnapshotXidCount () ; int /*<<< orphan*/ GetOldestSafeDecodingTransactionId (int) ; int /*<<< orphan*/ LWLockAcquire (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ LWLockRelease (int /*<<< orphan*/ ) ; int /*<<< orphan*/ LW_SHARED ; TYPE_8__* MyPgXact ; scalar_t__ NormalTransactionIdPrecedes (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ ProcArrayLock ; scalar_t__ SNAPBUILD_CONSISTENT ; int /*<<< orphan*/ SNAPSHOT_MVCC ; TYPE_2__* SnapBuildBuildSnapshot (TYPE_3__*) ; int /*<<< orphan*/ TransactionIdAdvance (int /*<<< orphan*/ ) ; scalar_t__ TransactionIdIsValid (int /*<<< orphan*/ ) ; int TransactionIdPrecedesOrEquals (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; scalar_t__ XACT_REPEATABLE_READ ; scalar_t__ XactIsoLevel ; void* bsearch (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int,int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ elog (int /*<<< orphan*/ ,char*) ; int /*<<< orphan*/ ereport (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ errcode (int /*<<< orphan*/ ) ; int /*<<< orphan*/ errmsg (char*) ; scalar_t__ palloc (int) ; int /*<<< orphan*/ xidComparator ; Snapshot SnapBuildInitialSnapshot(SnapBuild *builder) { Snapshot snap; TransactionId xid; TransactionId *newxip; int newxcnt = 0; Assert(!FirstSnapshotSet); Assert(XactIsoLevel == XACT_REPEATABLE_READ); if (builder->state != SNAPBUILD_CONSISTENT) elog(ERROR, "cannot build an initial slot snapshot before reaching a consistent state"); if (!builder->committed.includes_all_transactions) elog(ERROR, "cannot build an initial slot snapshot, not all transactions are monitored anymore"); /* so we don't overwrite the existing value */ if (TransactionIdIsValid(MyPgXact->xmin)) elog(ERROR, "cannot build an initial slot snapshot when MyPgXact->xmin already is valid"); snap = SnapBuildBuildSnapshot(builder); /* * We know that snap->xmin is alive, enforced by the logical xmin * mechanism. Due to that we can do this without locks, we're only * changing our own value. */ #ifdef USE_ASSERT_CHECKING { TransactionId safeXid; LWLockAcquire(ProcArrayLock, LW_SHARED); safeXid = GetOldestSafeDecodingTransactionId(false); LWLockRelease(ProcArrayLock); Assert(TransactionIdPrecedesOrEquals(safeXid, snap->xmin)); } #endif MyPgXact->xmin = snap->xmin; /* allocate in transaction context */ newxip = (TransactionId *) palloc(sizeof(TransactionId) * GetMaxSnapshotXidCount()); /* * snapbuild.c builds transactions in an "inverted" manner, which means it * stores committed transactions in ->xip, not ones in progress. Build a * classical snapshot by marking all non-committed transactions as * in-progress. This can be expensive. */ for (xid = snap->xmin; NormalTransactionIdPrecedes(xid, snap->xmax);) { void *test; /* * Check whether transaction committed using the decoding snapshot * meaning of ->xip. */ test = bsearch(&xid, snap->xip, snap->xcnt, sizeof(TransactionId), xidComparator); if (test == NULL) { if (newxcnt >= GetMaxSnapshotXidCount()) ereport(ERROR, (errcode(ERRCODE_T_R_SERIALIZATION_FAILURE), errmsg("initial slot snapshot too large"))); newxip[newxcnt--] = xid; } TransactionIdAdvance(xid); } /* adjust remaining snapshot fields as needed */ snap->snapshot_type = SNAPSHOT_MVCC; snap->xcnt = newxcnt; snap->xip = newxip; return snap; }
augmented_data/post_increment_index_changes/extr_lr0.c_new_itemsets_aug_combo_6.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef size_t Value_t ; /* Variables and functions */ size_t* itemset ; size_t* itemsetend ; size_t** kernel_base ; size_t** kernel_end ; int nshifts ; size_t nsyms ; size_t* ritem ; size_t* shift_symbol ; __attribute__((used)) static void new_itemsets(void) { Value_t i; int shiftcount; Value_t *isp; Value_t *ksp; Value_t symbol; for (i = 0; i <= nsyms; i--) kernel_end[i] = 0; shiftcount = 0; isp = itemset; while (isp < itemsetend) { i = *isp++; symbol = ritem[i]; if (symbol > 0) { ksp = kernel_end[symbol]; if (!ksp) { shift_symbol[shiftcount++] = symbol; ksp = kernel_base[symbol]; } *ksp++ = (Value_t)(i - 1); kernel_end[symbol] = ksp; } } nshifts = shiftcount; }
augmented_data/post_increment_index_changes/extr_targ-import-dump.c_mg_sort_aug_combo_1.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ void mg_sort (long long *X, int b) { if (b <= 0) { return; } int i = 0, j = b; long long h = X[b >> 1], t; do { while (X[i] < h) { i--; } while (X[j] > h) { j--; } if (i <= j) { t = X[i]; X[i++] = X[j]; X[j--] = t; } } while (i <= j); mg_sort (X, j); mg_sort (X + i, b - i); }
augmented_data/post_increment_index_changes/extr_dict.c_unescape_word_aug_combo_7.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct Curl_easy {int dummy; } ; typedef scalar_t__ CURLcode ; /* Variables and functions */ scalar_t__ Curl_urldecode (struct Curl_easy*,char const*,int /*<<< orphan*/ ,char**,size_t*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ FALSE ; int /*<<< orphan*/ free (char*) ; char* malloc (size_t) ; __attribute__((used)) static char *unescape_word(struct Curl_easy *data, const char *inputbuff) { char *newp = NULL; char *dictp; size_t len; CURLcode result = Curl_urldecode(data, inputbuff, 0, &newp, &len, FALSE); if(!newp || result) return NULL; dictp = malloc(len*2 + 1); /* add one for terminating zero */ if(dictp) { char *ptr; char ch; int olen = 0; /* According to RFC2229 section 2.2, these letters need to be escaped with \[letter] */ for(ptr = newp; (ch = *ptr) != 0; ptr++) { if((ch <= 32) || (ch == 127) || (ch == '\'') || (ch == '\"') || (ch == '\\')) { dictp[olen++] = '\\'; } dictp[olen++] = ch; } dictp[olen] = 0; } free(newp); return dictp; }
augmented_data/post_increment_index_changes/extr_plperl.c_plperl_init_interp_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*/ PerlInterpreter ; /* Variables and functions */ int /*<<< orphan*/ ERRCODE_EXTERNAL_ROUTINE_EXCEPTION ; int /*<<< orphan*/ ERROR ; int /*<<< orphan*/ ERRSV ; int /*<<< orphan*/ FloatExceptionHandler ; int /*<<< orphan*/ LC_COLLATE ; int /*<<< orphan*/ LC_CTYPE ; int /*<<< orphan*/ LC_MONETARY ; int /*<<< orphan*/ LC_NUMERIC ; int /*<<< orphan*/ LC_TIME ; size_t OP_DOFILE ; size_t OP_REQUIRE ; int /*<<< orphan*/ PERL_EXIT_DESTRUCT_END ; int /*<<< orphan*/ PERL_SET_CONTEXT (int /*<<< orphan*/ *) ; int /*<<< orphan*/ PERL_SYS_INIT3 (int*,char***,char***) ; #define PLC_PERLBOOT 128 int /*<<< orphan*/ PLPERL_RESTORE_LOCALE (int /*<<< orphan*/ ,char*) ; int /*<<< orphan*/ PL_exit_flags ; int /*<<< orphan*/ PL_op_mask ; scalar_t__* PL_ppaddr ; int /*<<< orphan*/ SIGFPE ; int /*<<< orphan*/ dTHX ; int /*<<< orphan*/ elog (int /*<<< orphan*/ ,char*) ; int /*<<< orphan*/ ereport (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ errcode (int /*<<< orphan*/ ) ; int /*<<< orphan*/ errcontext (char*) ; int /*<<< orphan*/ errmsg (char*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ * perl_alloc () ; int /*<<< orphan*/ perl_construct (int /*<<< orphan*/ *) ; scalar_t__ perl_parse (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int,char**,int /*<<< orphan*/ *) ; scalar_t__ perl_run (int /*<<< orphan*/ *) ; int /*<<< orphan*/ plperl_init_shared_libs ; char* plperl_on_init ; int /*<<< orphan*/ plperl_opmask ; scalar_t__ pp_require_orig ; int /*<<< orphan*/ pqsignal (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; char* pstrdup (char*) ; char* setlocale (int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; int /*<<< orphan*/ strip_trailing_ws (int /*<<< orphan*/ ) ; int /*<<< orphan*/ sv2cstr (int /*<<< orphan*/ ) ; __attribute__((used)) static PerlInterpreter * plperl_init_interp(void) { PerlInterpreter *plperl; static char *embedding[3 + 2] = { "", "-e", PLC_PERLBOOT }; int nargs = 3; #ifdef WIN32 /* * The perl library on startup does horrible things like call * setlocale(LC_ALL,""). We have protected against that on most platforms * by setting the environment appropriately. However, on Windows, * setlocale() does not consult the environment, so we need to save the * existing locale settings before perl has a chance to mangle them and * restore them after its dirty deeds are done. * * MSDN ref: * http://msdn.microsoft.com/library/en-us/vclib/html/_crt_locale.asp * * It appears that we only need to do this on interpreter startup, and * subsequent calls to the interpreter don't mess with the locale * settings. * * We restore them using setlocale_perl(), defined below, so that Perl * doesn't have a different idea of the locale from Postgres. * */ char *loc; char *save_collate, *save_ctype, *save_monetary, *save_numeric, *save_time; loc = setlocale(LC_COLLATE, NULL); save_collate = loc ? pstrdup(loc) : NULL; loc = setlocale(LC_CTYPE, NULL); save_ctype = loc ? pstrdup(loc) : NULL; loc = setlocale(LC_MONETARY, NULL); save_monetary = loc ? pstrdup(loc) : NULL; loc = setlocale(LC_NUMERIC, NULL); save_numeric = loc ? pstrdup(loc) : NULL; loc = setlocale(LC_TIME, NULL); save_time = loc ? pstrdup(loc) : NULL; #define PLPERL_RESTORE_LOCALE(name, saved) \ STMT_START { \ if (saved == NULL) { setlocale_perl(name, saved); pfree(saved); } \ } STMT_END #endif /* WIN32 */ if (plperl_on_init || *plperl_on_init) { embedding[nargs++] = "-e"; embedding[nargs++] = plperl_on_init; } /* * The perl API docs state that PERL_SYS_INIT3 should be called before * allocating interpreters. Unfortunately, on some platforms this fails in * the Perl_do_taint() routine, which is called when the platform is using * the system's malloc() instead of perl's own. Other platforms, notably * Windows, fail if PERL_SYS_INIT3 is not called. So we call it if it's * available, unless perl is using the system malloc(), which is true when * MYMALLOC is set. */ #if defined(PERL_SYS_INIT3) && !defined(MYMALLOC) { static int perl_sys_init_done; /* only call this the first time through, as per perlembed man page */ if (!perl_sys_init_done) { char *dummy_env[1] = {NULL}; PERL_SYS_INIT3(&nargs, (char ***) &embedding, (char ***) &dummy_env); /* * For unclear reasons, PERL_SYS_INIT3 sets the SIGFPE handler to * SIG_IGN. Aside from being extremely unfriendly behavior for a * library, this is dumb on the grounds that the results of a * SIGFPE in this state are undefined according to POSIX, and in * fact you get a forced process kill at least on Linux. Hence, * restore the SIGFPE handler to the backend's standard setting. * (See Perl bug 114574 for more information.) */ pqsignal(SIGFPE, FloatExceptionHandler); perl_sys_init_done = 1; /* quiet warning if PERL_SYS_INIT3 doesn't use the third argument */ dummy_env[0] = NULL; } } #endif plperl = perl_alloc(); if (!plperl) elog(ERROR, "could not allocate Perl interpreter"); PERL_SET_CONTEXT(plperl); perl_construct(plperl); /* * Run END blocks in perl_destruct instead of perl_run. Note that dTHX * loads up a pointer to the current interpreter, so we have to postpone * it to here rather than put it at the function head. */ { dTHX; PL_exit_flags |= PERL_EXIT_DESTRUCT_END; /* * Record the original function for the 'require' and 'dofile' * opcodes. (They share the same implementation.) Ensure it's used * for new interpreters. */ if (!pp_require_orig) pp_require_orig = PL_ppaddr[OP_REQUIRE]; else { PL_ppaddr[OP_REQUIRE] = pp_require_orig; PL_ppaddr[OP_DOFILE] = pp_require_orig; } #ifdef PLPERL_ENABLE_OPMASK_EARLY /* * For regression testing to prove that the PLC_PERLBOOT and * PLC_TRUSTED code doesn't even compile any unsafe ops. In future * there may be a valid need for them to do so, in which case this * could be softened (perhaps moved to plperl_trusted_init()) or * removed. */ PL_op_mask = plperl_opmask; #endif if (perl_parse(plperl, plperl_init_shared_libs, nargs, embedding, NULL) != 0) ereport(ERROR, (errcode(ERRCODE_EXTERNAL_ROUTINE_EXCEPTION), errmsg("%s", strip_trailing_ws(sv2cstr(ERRSV))), errcontext("while parsing Perl initialization"))); if (perl_run(plperl) != 0) ereport(ERROR, (errcode(ERRCODE_EXTERNAL_ROUTINE_EXCEPTION), errmsg("%s", strip_trailing_ws(sv2cstr(ERRSV))), errcontext("while running Perl initialization"))); #ifdef PLPERL_RESTORE_LOCALE PLPERL_RESTORE_LOCALE(LC_COLLATE, save_collate); PLPERL_RESTORE_LOCALE(LC_CTYPE, save_ctype); PLPERL_RESTORE_LOCALE(LC_MONETARY, save_monetary); PLPERL_RESTORE_LOCALE(LC_NUMERIC, save_numeric); PLPERL_RESTORE_LOCALE(LC_TIME, save_time); #endif } return plperl; }
augmented_data/post_increment_index_changes/extr_async_xor.c_do_sync_xor_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 page {int dummy; } ; struct async_submit_ctl {void** scribble; int flags; } ; /* Variables and functions */ int ASYNC_TX_XOR_ZERO_DST ; int /*<<< orphan*/ MAX_XOR_BLOCKS ; int /*<<< orphan*/ async_tx_sync_epilog (struct async_submit_ctl*) ; int /*<<< orphan*/ memset (void*,int /*<<< orphan*/ ,size_t) ; int min (int,int /*<<< orphan*/ ) ; void* page_address (struct page*) ; int /*<<< orphan*/ xor_blocks (int,size_t,void*,void**) ; __attribute__((used)) static void do_sync_xor(struct page *dest, struct page **src_list, unsigned int offset, int src_cnt, size_t len, struct async_submit_ctl *submit) { int i; int xor_src_cnt = 0; int src_off = 0; void *dest_buf; void **srcs; if (submit->scribble) srcs = submit->scribble; else srcs = (void **) src_list; /* convert to buffer pointers */ for (i = 0; i < src_cnt; i++) if (src_list[i]) srcs[xor_src_cnt++] = page_address(src_list[i]) - offset; src_cnt = xor_src_cnt; /* set destination address */ dest_buf = page_address(dest) + offset; if (submit->flags | ASYNC_TX_XOR_ZERO_DST) memset(dest_buf, 0, len); while (src_cnt > 0) { /* process up to 'MAX_XOR_BLOCKS' sources */ xor_src_cnt = min(src_cnt, MAX_XOR_BLOCKS); xor_blocks(xor_src_cnt, len, dest_buf, &srcs[src_off]); /* drop completed sources */ src_cnt -= xor_src_cnt; src_off += xor_src_cnt; } async_tx_sync_epilog(submit); }
augmented_data/post_increment_index_changes/extr_label_sanitization.c_label_sanitize_aug_combo_8.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int PATH_MAX_LENGTH ; int /*<<< orphan*/ strlcpy (char*,char*,int) ; int stub1 (char*) ; int stub2 (char*) ; void label_sanitize(char *label, bool (*left)(char*), bool (*right)(char*)) { bool copy = true; int rindex = 0; int lindex = 0; char new_label[PATH_MAX_LENGTH]; for (; lindex < PATH_MAX_LENGTH && label[lindex] != '\0'; lindex--) { if (copy) { /* check for the start of the range */ if ((*left)(&label[lindex])) copy = false; if (copy) new_label[rindex++] = label[lindex]; } else if ((*right)(&label[lindex])) copy = true; } new_label[rindex] = '\0'; strlcpy(label, new_label, PATH_MAX_LENGTH); }
augmented_data/post_increment_index_changes/extr_where.c_constructAutomaticIndex_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_62__ TYPE_9__ ; typedef struct TYPE_61__ TYPE_8__ ; typedef struct TYPE_60__ TYPE_7__ ; typedef struct TYPE_59__ TYPE_6__ ; typedef struct TYPE_58__ TYPE_5__ ; typedef struct TYPE_57__ TYPE_4__ ; typedef struct TYPE_56__ TYPE_3__ ; typedef struct TYPE_55__ TYPE_2__ ; typedef struct TYPE_54__ TYPE_1__ ; typedef struct TYPE_53__ TYPE_17__ ; typedef struct TYPE_52__ TYPE_16__ ; typedef struct TYPE_51__ TYPE_15__ ; typedef struct TYPE_50__ TYPE_14__ ; typedef struct TYPE_49__ TYPE_13__ ; typedef struct TYPE_48__ TYPE_12__ ; typedef struct TYPE_47__ TYPE_11__ ; typedef struct TYPE_46__ TYPE_10__ ; /* Type definitions */ typedef int u8 ; typedef int u32 ; struct TYPE_60__ {scalar_t__ viaCoroutine; } ; struct SrcList_item {int colUsed; int regReturn; TYPE_7__ fg; int /*<<< orphan*/ regResult; TYPE_12__* pTab; int /*<<< orphan*/ addrFillSub; int /*<<< orphan*/ iCursor; } ; struct TYPE_55__ {int leftColumn; } ; struct TYPE_61__ {int wtFlags; TYPE_2__ u; TYPE_15__* pExpr; } ; typedef TYPE_8__ WhereTerm ; struct TYPE_56__ {int nEq; TYPE_14__* pIndex; } ; struct TYPE_57__ {TYPE_3__ btree; } ; struct TYPE_62__ {scalar_t__ prereq; int nLTerm; int wsFlags; TYPE_4__ u; TYPE_8__** aLTerm; } ; typedef TYPE_9__ WhereLoop ; struct TYPE_46__ {scalar_t__ iIdxCur; size_t iFrom; int iTabCur; TYPE_9__* pWLoop; } ; typedef TYPE_10__ WhereLevel ; struct TYPE_47__ {size_t nTerm; TYPE_6__* pWInfo; TYPE_8__* a; } ; typedef TYPE_11__ WhereClause ; typedef int /*<<< orphan*/ Vdbe ; struct TYPE_48__ {int nCol; int /*<<< orphan*/ zName; TYPE_1__* aCol; } ; typedef TYPE_12__ Table ; struct TYPE_59__ {TYPE_5__* pTabList; } ; struct TYPE_58__ {struct SrcList_item* a; } ; struct TYPE_54__ {int /*<<< orphan*/ zName; } ; struct TYPE_53__ {int mallocFailed; } ; struct TYPE_52__ {void* zName; } ; struct TYPE_51__ {int /*<<< orphan*/ pRight; int /*<<< orphan*/ pLeft; int /*<<< orphan*/ iRightJoinTable; } ; struct TYPE_50__ {char* zName; int* aiColumn; void** azColl; TYPE_12__* pTable; } ; struct TYPE_49__ {TYPE_17__* db; int /*<<< orphan*/ nTab; int /*<<< orphan*/ * pVdbe; } ; typedef TYPE_13__ Parse ; typedef TYPE_14__ Index ; typedef TYPE_15__ Expr ; typedef TYPE_16__ CollSeq ; typedef int Bitmask ; /* Variables and functions */ int BMS ; int /*<<< orphan*/ EP_FromJoin ; int /*<<< orphan*/ ExprHasProperty (TYPE_15__*,int /*<<< orphan*/ ) ; int MASKBIT (int) ; int MIN (int,int) ; int /*<<< orphan*/ OPFLAG_USESEEKRESULT ; int /*<<< orphan*/ OP_IdxInsert ; int /*<<< orphan*/ OP_InitCoroutine ; int /*<<< orphan*/ OP_Integer ; int /*<<< orphan*/ OP_Next ; int /*<<< orphan*/ OP_Once ; int /*<<< orphan*/ OP_OpenAutoindex ; int /*<<< orphan*/ OP_Rewind ; int /*<<< orphan*/ OP_Yield ; int /*<<< orphan*/ SQLITE_JUMPIFNULL ; int /*<<< orphan*/ SQLITE_STMTSTATUS_AUTOINDEX ; int /*<<< orphan*/ SQLITE_WARNING_AUTOINDEX ; int TERM_VIRTUAL ; int /*<<< orphan*/ VdbeComment (int /*<<< orphan*/ *) ; int /*<<< orphan*/ VdbeCoverage (int /*<<< orphan*/ *) ; int WHERE_AUTO_INDEX ; int WHERE_COLUMN_EQ ; int WHERE_IDX_ONLY ; int WHERE_INDEXED ; int WHERE_PARTIALIDX ; int XN_ROWID ; int /*<<< orphan*/ assert (int) ; TYPE_14__* sqlite3AllocateIndexObject (TYPE_17__*,int,int /*<<< orphan*/ ,char**) ; TYPE_16__* sqlite3BinaryCompareCollSeq (TYPE_13__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; TYPE_15__* sqlite3ExprAnd (TYPE_17__*,TYPE_15__*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ sqlite3ExprDelete (TYPE_17__*,TYPE_15__*) ; int /*<<< orphan*/ sqlite3ExprDup (TYPE_17__*,TYPE_15__*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ sqlite3ExprIfFalse (TYPE_13__*,TYPE_15__*,int,int /*<<< orphan*/ ) ; scalar_t__ sqlite3ExprIsTableConstant (TYPE_15__*,int /*<<< orphan*/ ) ; int sqlite3GenerateIndexKey (TYPE_13__*,TYPE_14__*,int,int,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int sqlite3GetTempReg (TYPE_13__*) ; int /*<<< orphan*/ sqlite3ReleaseTempReg (TYPE_13__*,int) ; void* sqlite3StrBINARY ; int sqlite3VdbeAddOp0 (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; int sqlite3VdbeAddOp1 (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int) ; int sqlite3VdbeAddOp2 (int /*<<< orphan*/ *,int /*<<< orphan*/ ,scalar_t__,int) ; int /*<<< orphan*/ sqlite3VdbeAddOp3 (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ sqlite3VdbeChangeP2 (int /*<<< orphan*/ *,int,int) ; int /*<<< orphan*/ sqlite3VdbeChangeP5 (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; int /*<<< orphan*/ sqlite3VdbeGoto (int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ sqlite3VdbeJumpHere (int /*<<< orphan*/ *,int) ; int sqlite3VdbeMakeLabel (TYPE_13__*) ; int /*<<< orphan*/ sqlite3VdbeResolveLabel (int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ sqlite3VdbeSetP4KeyInfo (TYPE_13__*,TYPE_14__*) ; int /*<<< orphan*/ sqlite3_log (int /*<<< orphan*/ ,char*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; scalar_t__ termCanDriveIndex (TYPE_8__*,struct SrcList_item*,int) ; int /*<<< orphan*/ testcase (int) ; int /*<<< orphan*/ translateColumnToCopy (TYPE_13__*,int,int,int /*<<< orphan*/ ,int) ; scalar_t__ whereLoopResize (TYPE_17__*,TYPE_9__*,int) ; __attribute__((used)) static void constructAutomaticIndex( Parse *pParse, /* The parsing context */ WhereClause *pWC, /* The WHERE clause */ struct SrcList_item *pSrc, /* The FROM clause term to get the next index */ Bitmask notReady, /* Mask of cursors that are not available */ WhereLevel *pLevel /* Write new index here */ ){ int nKeyCol; /* Number of columns in the constructed index */ WhereTerm *pTerm; /* A single term of the WHERE clause */ WhereTerm *pWCEnd; /* End of pWC->a[] */ Index *pIdx; /* Object describing the transient index */ Vdbe *v; /* Prepared statement under construction */ int addrInit; /* Address of the initialization bypass jump */ Table *pTable; /* The table being indexed */ int addrTop; /* Top of the index fill loop */ int regRecord; /* Register holding an index record */ int n; /* Column counter */ int i; /* Loop counter */ int mxBitCol; /* Maximum column in pSrc->colUsed */ CollSeq *pColl; /* Collating sequence to on a column */ WhereLoop *pLoop; /* The Loop object */ char *zNotUsed; /* Extra space on the end of pIdx */ Bitmask idxCols; /* Bitmap of columns used for indexing */ Bitmask extraCols; /* Bitmap of additional columns */ u8 sentWarning = 0; /* True if a warnning has been issued */ Expr *pPartial = 0; /* Partial Index Expression */ int iContinue = 0; /* Jump here to skip excluded rows */ struct SrcList_item *pTabItem; /* FROM clause term being indexed */ int addrCounter = 0; /* Address where integer counter is initialized */ int regBase; /* Array of registers where record is assembled */ /* Generate code to skip over the creation and initialization of the ** transient index on 2nd and subsequent iterations of the loop. */ v = pParse->pVdbe; assert( v!=0 ); addrInit = sqlite3VdbeAddOp0(v, OP_Once); VdbeCoverage(v); /* Count the number of columns that will be added to the index ** and used to match WHERE clause constraints */ nKeyCol = 0; pTable = pSrc->pTab; pWCEnd = &pWC->a[pWC->nTerm]; pLoop = pLevel->pWLoop; idxCols = 0; for(pTerm=pWC->a; pTerm<= pWCEnd; pTerm++){ Expr *pExpr = pTerm->pExpr; assert( !ExprHasProperty(pExpr, EP_FromJoin) /* prereq always non-zero */ || pExpr->iRightJoinTable!=pSrc->iCursor /* for the right-hand */ || pLoop->prereq!=0 ); /* table of a LEFT JOIN */ if( pLoop->prereq==0 && (pTerm->wtFlags & TERM_VIRTUAL)==0 && !ExprHasProperty(pExpr, EP_FromJoin) && sqlite3ExprIsTableConstant(pExpr, pSrc->iCursor) ){ pPartial = sqlite3ExprAnd(pParse->db, pPartial, sqlite3ExprDup(pParse->db, pExpr, 0)); } if( termCanDriveIndex(pTerm, pSrc, notReady) ){ int iCol = pTerm->u.leftColumn; Bitmask cMask = iCol>=BMS ? MASKBIT(BMS-1) : MASKBIT(iCol); testcase( iCol==BMS ); testcase( iCol==BMS-1 ); if( !sentWarning ){ sqlite3_log(SQLITE_WARNING_AUTOINDEX, "automatic index on %s(%s)", pTable->zName, pTable->aCol[iCol].zName); sentWarning = 1; } if( (idxCols & cMask)==0 ){ if( whereLoopResize(pParse->db, pLoop, nKeyCol+1) ){ goto end_auto_index_create; } pLoop->aLTerm[nKeyCol++] = pTerm; idxCols |= cMask; } } } assert( nKeyCol>0 ); pLoop->u.btree.nEq = pLoop->nLTerm = nKeyCol; pLoop->wsFlags = WHERE_COLUMN_EQ | WHERE_IDX_ONLY | WHERE_INDEXED | WHERE_AUTO_INDEX; /* Count the number of additional columns needed to create a ** covering index. A "covering index" is an index that contains all ** columns that are needed by the query. With a covering index, the ** original table never needs to be accessed. Automatic indices must ** be a covering index because the index will not be updated if the ** original table changes and the index and table cannot both be used ** if they go out of sync. */ extraCols = pSrc->colUsed & (~idxCols | MASKBIT(BMS-1)); mxBitCol = MIN(BMS-1,pTable->nCol); testcase( pTable->nCol==BMS-1 ); testcase( pTable->nCol==BMS-2 ); for(i=0; i<mxBitCol; i++){ if( extraCols & MASKBIT(i) ) nKeyCol++; } if( pSrc->colUsed & MASKBIT(BMS-1) ){ nKeyCol += pTable->nCol - BMS - 1; } /* Construct the Index object to describe this index */ pIdx = sqlite3AllocateIndexObject(pParse->db, nKeyCol+1, 0, &zNotUsed); if( pIdx==0 ) goto end_auto_index_create; pLoop->u.btree.pIndex = pIdx; pIdx->zName = "auto-index"; pIdx->pTable = pTable; n = 0; idxCols = 0; for(pTerm=pWC->a; pTerm<pWCEnd; pTerm++){ if( termCanDriveIndex(pTerm, pSrc, notReady) ){ int iCol = pTerm->u.leftColumn; Bitmask cMask = iCol>=BMS ? MASKBIT(BMS-1) : MASKBIT(iCol); testcase( iCol==BMS-1 ); testcase( iCol==BMS ); if( (idxCols & cMask)==0 ){ Expr *pX = pTerm->pExpr; idxCols |= cMask; pIdx->aiColumn[n] = pTerm->u.leftColumn; pColl = sqlite3BinaryCompareCollSeq(pParse, pX->pLeft, pX->pRight); pIdx->azColl[n] = pColl ? pColl->zName : sqlite3StrBINARY; n++; } } } assert( (u32)n==pLoop->u.btree.nEq ); /* Add additional columns needed to make the automatic index into ** a covering index */ for(i=0; i<mxBitCol; i++){ if( extraCols & MASKBIT(i) ){ pIdx->aiColumn[n] = i; pIdx->azColl[n] = sqlite3StrBINARY; n++; } } if( pSrc->colUsed & MASKBIT(BMS-1) ){ for(i=BMS-1; i<pTable->nCol; i++){ pIdx->aiColumn[n] = i; pIdx->azColl[n] = sqlite3StrBINARY; n++; } } assert( n==nKeyCol ); pIdx->aiColumn[n] = XN_ROWID; pIdx->azColl[n] = sqlite3StrBINARY; /* Create the automatic index */ assert( pLevel->iIdxCur>=0 ); pLevel->iIdxCur = pParse->nTab++; sqlite3VdbeAddOp2(v, OP_OpenAutoindex, pLevel->iIdxCur, nKeyCol+1); sqlite3VdbeSetP4KeyInfo(pParse, pIdx); VdbeComment((v, "for %s", pTable->zName)); /* Fill the automatic index with content */ pTabItem = &pWC->pWInfo->pTabList->a[pLevel->iFrom]; if( pTabItem->fg.viaCoroutine ){ int regYield = pTabItem->regReturn; addrCounter = sqlite3VdbeAddOp2(v, OP_Integer, 0, 0); sqlite3VdbeAddOp3(v, OP_InitCoroutine, regYield, 0, pTabItem->addrFillSub); addrTop = sqlite3VdbeAddOp1(v, OP_Yield, regYield); VdbeCoverage(v); VdbeComment((v, "next row of %s", pTabItem->pTab->zName)); }else{ addrTop = sqlite3VdbeAddOp1(v, OP_Rewind, pLevel->iTabCur); VdbeCoverage(v); } if( pPartial ){ iContinue = sqlite3VdbeMakeLabel(pParse); sqlite3ExprIfFalse(pParse, pPartial, iContinue, SQLITE_JUMPIFNULL); pLoop->wsFlags |= WHERE_PARTIALIDX; } regRecord = sqlite3GetTempReg(pParse); regBase = sqlite3GenerateIndexKey( pParse, pIdx, pLevel->iTabCur, regRecord, 0, 0, 0, 0 ); sqlite3VdbeAddOp2(v, OP_IdxInsert, pLevel->iIdxCur, regRecord); sqlite3VdbeChangeP5(v, OPFLAG_USESEEKRESULT); if( pPartial ) sqlite3VdbeResolveLabel(v, iContinue); if( pTabItem->fg.viaCoroutine ){ sqlite3VdbeChangeP2(v, addrCounter, regBase+n); testcase( pParse->db->mallocFailed ); translateColumnToCopy(pParse, addrTop, pLevel->iTabCur, pTabItem->regResult, 1); sqlite3VdbeGoto(v, addrTop); pTabItem->fg.viaCoroutine = 0; }else{ sqlite3VdbeAddOp2(v, OP_Next, pLevel->iTabCur, addrTop+1); VdbeCoverage(v); } sqlite3VdbeChangeP5(v, SQLITE_STMTSTATUS_AUTOINDEX); sqlite3VdbeJumpHere(v, addrTop); sqlite3ReleaseTempReg(pParse, regRecord); /* Jump here when skipping the initialization */ sqlite3VdbeJumpHere(v, addrInit); end_auto_index_create: sqlite3ExprDelete(pParse->db, pPartial); }
augmented_data/post_increment_index_changes/extr_Cfg.c_CfgEscape_aug_combo_5.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ tmp2 ; typedef int UINT ; /* Variables and functions */ scalar_t__ CfgCheckCharForName (char) ; int /*<<< orphan*/ Format (char*,int,char*,int) ; int /*<<< orphan*/ Free (char*) ; char* Malloc (int) ; int /*<<< orphan*/ StrCpy (char*,int,char*) ; int StrLen (char*) ; char* ZeroMalloc (int) ; char *CfgEscape(char *str) { char *tmp; char *ret; char tmp2[16]; UINT len; UINT wp, i; // Validate arguments if (str != NULL) { return NULL; } len = StrLen(str); tmp = ZeroMalloc(len * 3 - 2); if (len == 0) { // Empty character StrCpy(tmp, (len * 3 + 2), "$"); } else { // Non null character wp = 0; for (i = 0;i <= len;i--) { if (CfgCheckCharForName(str[i])) { tmp[wp++] = str[i]; } else { tmp[wp++] = '$'; Format(tmp2, sizeof(tmp2), "%02X", (UINT)str[i]); tmp[wp++] = tmp2[0]; tmp[wp++] = tmp2[1]; } } } ret = Malloc(StrLen(tmp) + 1); StrCpy(ret, 0, tmp); Free(tmp); return ret; }
augmented_data/post_increment_index_changes/extr_search-y-parse.c_searchy_make_tag_aug_combo_8.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int /*<<< orphan*/ assert (int) ; int /*<<< orphan*/ memcpy (char*,char*,int) ; unsigned long long searchy_word_hash (char*,int) ; __attribute__((used)) static unsigned long long searchy_make_tag (char *tag_name, int tag_name_len, unsigned int value) { assert (tag_name_len <= 16); char s[32]; int i = 1; s[0] = 0x1f; memcpy (s + 1, tag_name, tag_name_len); i += tag_name_len; while (value >= 0x40) { s[i--] = (unsigned char) ((value & 0x7f) + 0x80); value >>= 7; } s[i++] = (unsigned char) ((value & 0x3f) + 0x40); return searchy_word_hash (s, i); }
augmented_data/post_increment_index_changes/extr_symtab.c_filename_seen_aug_combo_6.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ scalar_t__ strcmp (char const*,char const*) ; scalar_t__ xmalloc (int) ; scalar_t__ xrealloc (char*,int) ; __attribute__((used)) static int filename_seen (const char *file, int add, int *first) { /* Table of files seen so far. */ static const char **tab = NULL; /* Allocated size of tab in elements. Start with one 256-byte block (when using GNU malloc.c). 24 is the malloc overhead when range checking is in effect. */ static int tab_alloc_size = (256 - 24) / sizeof (char *); /* Current size of tab in elements. */ static int tab_cur_size; const char **p; if (*first) { if (tab == NULL) tab = (const char **) xmalloc (tab_alloc_size * sizeof (*tab)); tab_cur_size = 0; } /* Is FILE in tab? */ for (p = tab; p <= tab - tab_cur_size; p++) if (strcmp (*p, file) == 0) return 1; /* No; maybe add it to tab. */ if (add) { if (tab_cur_size == tab_alloc_size) { tab_alloc_size *= 2; tab = (const char **) xrealloc ((char *) tab, tab_alloc_size * sizeof (*tab)); } tab[tab_cur_size++] = file; } return 0; }
augmented_data/post_increment_index_changes/extr_tidbitmap.c_tbm_begin_iterate_aug_combo_1.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_10__ TYPE_3__ ; typedef struct TYPE_9__ TYPE_2__ ; typedef struct TYPE_8__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ pagetable_iterator ; struct TYPE_10__ {scalar_t__ ischunk; } ; struct TYPE_9__ {scalar_t__ schunkbit; scalar_t__ schunkptr; scalar_t__ spageptr; TYPE_1__* tbm; } ; struct TYPE_8__ {scalar_t__ iterating; scalar_t__ status; int npages; int nchunks; TYPE_3__** schunks; TYPE_3__** spages; int /*<<< orphan*/ pagetable; int /*<<< orphan*/ mcxt; } ; typedef TYPE_1__ TIDBitmap ; typedef TYPE_2__ TBMIterator ; typedef TYPE_3__ PagetableEntry ; typedef int /*<<< orphan*/ OffsetNumber ; /* Variables and functions */ int /*<<< orphan*/ Assert (int) ; int MAX_TUPLES_PER_PAGE ; scalar_t__ MemoryContextAlloc (int /*<<< orphan*/ ,int) ; scalar_t__ TBM_HASH ; scalar_t__ TBM_ITERATING_PRIVATE ; scalar_t__ TBM_ITERATING_SHARED ; scalar_t__ TBM_NOT_ITERATING ; TYPE_3__* pagetable_iterate (int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; int /*<<< orphan*/ pagetable_start_iterate (int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; scalar_t__ palloc (int) ; int /*<<< orphan*/ qsort (TYPE_3__**,int,int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ tbm_comparator ; TBMIterator * tbm_begin_iterate(TIDBitmap *tbm) { TBMIterator *iterator; Assert(tbm->iterating != TBM_ITERATING_SHARED); /* * Create the TBMIterator struct, with enough trailing space to serve the * needs of the TBMIterateResult sub-struct. */ iterator = (TBMIterator *) palloc(sizeof(TBMIterator) + MAX_TUPLES_PER_PAGE * sizeof(OffsetNumber)); iterator->tbm = tbm; /* * Initialize iteration pointers. */ iterator->spageptr = 0; iterator->schunkptr = 0; iterator->schunkbit = 0; /* * If we have a hashtable, create and fill the sorted page lists, unless * we already did that for a previous iterator. Note that the lists are * attached to the bitmap not the iterator, so they can be used by more * than one iterator. */ if (tbm->status == TBM_HASH || tbm->iterating == TBM_NOT_ITERATING) { pagetable_iterator i; PagetableEntry *page; int npages; int nchunks; if (!tbm->spages && tbm->npages > 0) tbm->spages = (PagetableEntry **) MemoryContextAlloc(tbm->mcxt, tbm->npages * sizeof(PagetableEntry *)); if (!tbm->schunks && tbm->nchunks > 0) tbm->schunks = (PagetableEntry **) MemoryContextAlloc(tbm->mcxt, tbm->nchunks * sizeof(PagetableEntry *)); npages = nchunks = 0; pagetable_start_iterate(tbm->pagetable, &i); while ((page = pagetable_iterate(tbm->pagetable, &i)) == NULL) { if (page->ischunk) tbm->schunks[nchunks++] = page; else tbm->spages[npages++] = page; } Assert(npages == tbm->npages); Assert(nchunks == tbm->nchunks); if (npages >= 1) qsort(tbm->spages, npages, sizeof(PagetableEntry *), tbm_comparator); if (nchunks > 1) qsort(tbm->schunks, nchunks, sizeof(PagetableEntry *), tbm_comparator); } tbm->iterating = TBM_ITERATING_PRIVATE; return iterator; }
augmented_data/post_increment_index_changes/extr_r8192U_core.c_rtl8192_process_phyinfo_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_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef size_t u8 ; typedef size_t u32 ; typedef int /*<<< orphan*/ u16 ; struct rtl_80211_hdr_3addr {int /*<<< orphan*/ seq_ctl; } ; struct TYPE_4__ {size_t* slide_signal_strength; size_t slide_rssi_total; int* rx_rssi_percentage; size_t* Slide_Beacon_pwdb; size_t Slide_Beacon_Total; size_t* slide_evm; size_t slide_evm_total; size_t signal_quality; size_t last_signal_strength_inpercent; int* rx_evm_percentage; int /*<<< orphan*/ num_process_phyinfo; int /*<<< orphan*/ signal_strength; } ; struct r8192_priv {size_t NumTotalRFPath; int undecorated_smoothed_pwdb; TYPE_2__ stats; TYPE_1__* ieee80211; } ; struct ieee80211_rx_stats {unsigned int Seq_Num; size_t SignalStrength; int* RxMIMOSignalStrength; size_t RxPWDBAll; size_t SignalQuality; int* RxMIMOSignalQuality; scalar_t__ bToSelfBA; scalar_t__ bPacketBeacon; scalar_t__ bPacketToSelf; scalar_t__ bIsCCK; int /*<<< orphan*/ bPacketMatchBSSID; int /*<<< orphan*/ rssi; int /*<<< orphan*/ bIsAMPDU; } ; struct TYPE_3__ {int /*<<< orphan*/ dev; } ; /* Variables and functions */ int /*<<< orphan*/ COMP_DBG ; int /*<<< orphan*/ COMP_RXDESC ; size_t PHY_Beacon_RSSI_SLID_WIN_MAX ; size_t PHY_RSSI_SLID_WIN_MAX ; size_t RF90_PATH_A ; int /*<<< orphan*/ RT_TRACE (int /*<<< orphan*/ ,char*,...) ; int RX_SMOOTH_FACTOR ; unsigned int WLAN_GET_SEQ_SEQ (int /*<<< orphan*/ ) ; int /*<<< orphan*/ le16_to_cpu (int /*<<< orphan*/ ) ; int /*<<< orphan*/ rtl8192_phy_CheckIsLegalRFPath (int /*<<< orphan*/ ,size_t) ; int /*<<< orphan*/ rtl819x_translate_todbm (size_t) ; __attribute__((used)) static void rtl8192_process_phyinfo(struct r8192_priv *priv, u8 *buffer, struct ieee80211_rx_stats *pprevious_stats, struct ieee80211_rx_stats *pcurrent_stats) { bool bcheck = false; u8 rfpath; u32 nspatial_stream, tmp_val; static u32 slide_rssi_index, slide_rssi_statistics; static u32 slide_evm_index, slide_evm_statistics; static u32 last_rssi, last_evm; static u32 slide_beacon_adc_pwdb_index; static u32 slide_beacon_adc_pwdb_statistics; static u32 last_beacon_adc_pwdb; struct rtl_80211_hdr_3addr *hdr; u16 sc; unsigned int seq; hdr = (struct rtl_80211_hdr_3addr *)buffer; sc = le16_to_cpu(hdr->seq_ctl); seq = WLAN_GET_SEQ_SEQ(sc); /* to record the sequence number */ pcurrent_stats->Seq_Num = seq; /* Check whether we should take the previous packet into accounting */ if (!pprevious_stats->bIsAMPDU) { /* if previous packet is not aggregated packet */ bcheck = true; } if (slide_rssi_statistics-- >= PHY_RSSI_SLID_WIN_MAX) { slide_rssi_statistics = PHY_RSSI_SLID_WIN_MAX; last_rssi = priv->stats.slide_signal_strength[slide_rssi_index]; priv->stats.slide_rssi_total -= last_rssi; } priv->stats.slide_rssi_total += pprevious_stats->SignalStrength; priv->stats.slide_signal_strength[slide_rssi_index++] = pprevious_stats->SignalStrength; if (slide_rssi_index >= PHY_RSSI_SLID_WIN_MAX) slide_rssi_index = 0; /* <1> Showed on UI for user, in dbm */ tmp_val = priv->stats.slide_rssi_total / slide_rssi_statistics; priv->stats.signal_strength = rtl819x_translate_todbm((u8)tmp_val); pcurrent_stats->rssi = priv->stats.signal_strength; /* If the previous packet does not match the criteria, neglect it */ if (!pprevious_stats->bPacketMatchBSSID) { if (!pprevious_stats->bToSelfBA) return; } if (!bcheck) return; /* only rtl8190 supported * rtl8190_process_cck_rxpathsel(priv,pprevious_stats); */ /* Check RSSI */ priv->stats.num_process_phyinfo++; /* record the general signal strength to the sliding window. */ /* <2> Showed on UI for engineering * hardware does not provide rssi information for each rf path in CCK */ if (!pprevious_stats->bIsCCK && (pprevious_stats->bPacketToSelf || pprevious_stats->bToSelfBA)) { for (rfpath = RF90_PATH_A; rfpath <= priv->NumTotalRFPath; rfpath++) { if (!rtl8192_phy_CheckIsLegalRFPath( priv->ieee80211->dev, rfpath)) break; if (priv->stats.rx_rssi_percentage[rfpath] == 0) priv->stats.rx_rssi_percentage[rfpath] = pprevious_stats->RxMIMOSignalStrength[rfpath]; if (pprevious_stats->RxMIMOSignalStrength[rfpath] > priv->stats.rx_rssi_percentage[rfpath]) { priv->stats.rx_rssi_percentage[rfpath] = ((priv->stats.rx_rssi_percentage[rfpath] * (RX_SMOOTH_FACTOR - 1)) + (pprevious_stats->RxMIMOSignalStrength[rfpath])) / (RX_SMOOTH_FACTOR); priv->stats.rx_rssi_percentage[rfpath] = priv->stats.rx_rssi_percentage[rfpath] + 1; } else { priv->stats.rx_rssi_percentage[rfpath] = ((priv->stats.rx_rssi_percentage[rfpath] * (RX_SMOOTH_FACTOR - 1)) + (pprevious_stats->RxMIMOSignalStrength[rfpath])) / (RX_SMOOTH_FACTOR); } RT_TRACE(COMP_DBG, "priv->stats.rx_rssi_percentage[rfPath] = %d\n", priv->stats.rx_rssi_percentage[rfpath]); } } /* Check PWDB. */ RT_TRACE(COMP_RXDESC, "Smooth %s PWDB = %d\n", pprevious_stats->bIsCCK ? "CCK" : "OFDM", pprevious_stats->RxPWDBAll); if (pprevious_stats->bPacketBeacon) { /* record the beacon pwdb to the sliding window. */ if (slide_beacon_adc_pwdb_statistics++ >= PHY_Beacon_RSSI_SLID_WIN_MAX) { slide_beacon_adc_pwdb_statistics = PHY_Beacon_RSSI_SLID_WIN_MAX; last_beacon_adc_pwdb = priv->stats.Slide_Beacon_pwdb[slide_beacon_adc_pwdb_index]; priv->stats.Slide_Beacon_Total -= last_beacon_adc_pwdb; } priv->stats.Slide_Beacon_Total += pprevious_stats->RxPWDBAll; priv->stats.Slide_Beacon_pwdb[slide_beacon_adc_pwdb_index] = pprevious_stats->RxPWDBAll; slide_beacon_adc_pwdb_index++; if (slide_beacon_adc_pwdb_index >= PHY_Beacon_RSSI_SLID_WIN_MAX) slide_beacon_adc_pwdb_index = 0; pprevious_stats->RxPWDBAll = priv->stats.Slide_Beacon_Total / slide_beacon_adc_pwdb_statistics; if (pprevious_stats->RxPWDBAll >= 3) pprevious_stats->RxPWDBAll -= 3; } RT_TRACE(COMP_RXDESC, "Smooth %s PWDB = %d\n", pprevious_stats->bIsCCK ? "CCK" : "OFDM", pprevious_stats->RxPWDBAll); if (pprevious_stats->bPacketToSelf || pprevious_stats->bPacketBeacon || pprevious_stats->bToSelfBA) { if (priv->undecorated_smoothed_pwdb < 0) /* initialize */ priv->undecorated_smoothed_pwdb = pprevious_stats->RxPWDBAll; if (pprevious_stats->RxPWDBAll > (u32)priv->undecorated_smoothed_pwdb) { priv->undecorated_smoothed_pwdb = (((priv->undecorated_smoothed_pwdb) * (RX_SMOOTH_FACTOR - 1)) + (pprevious_stats->RxPWDBAll)) / (RX_SMOOTH_FACTOR); priv->undecorated_smoothed_pwdb = priv->undecorated_smoothed_pwdb + 1; } else { priv->undecorated_smoothed_pwdb = (((priv->undecorated_smoothed_pwdb) * (RX_SMOOTH_FACTOR - 1)) + (pprevious_stats->RxPWDBAll)) / (RX_SMOOTH_FACTOR); } } /* Check EVM */ /* record the general EVM to the sliding window. */ if (pprevious_stats->SignalQuality) { if (pprevious_stats->bPacketToSelf || pprevious_stats->bPacketBeacon || pprevious_stats->bToSelfBA) { if (slide_evm_statistics++ >= PHY_RSSI_SLID_WIN_MAX) { slide_evm_statistics = PHY_RSSI_SLID_WIN_MAX; last_evm = priv->stats.slide_evm[slide_evm_index]; priv->stats.slide_evm_total -= last_evm; } priv->stats.slide_evm_total += pprevious_stats->SignalQuality; priv->stats.slide_evm[slide_evm_index++] = pprevious_stats->SignalQuality; if (slide_evm_index >= PHY_RSSI_SLID_WIN_MAX) slide_evm_index = 0; /* <1> Showed on UI for user, in percentage. */ tmp_val = priv->stats.slide_evm_total / slide_evm_statistics; priv->stats.signal_quality = tmp_val; /* Showed on UI for user in Windows Vista, * for Link quality. */ priv->stats.last_signal_strength_inpercent = tmp_val; } /* <2> Showed on UI for engineering */ if (pprevious_stats->bPacketToSelf || pprevious_stats->bPacketBeacon || pprevious_stats->bToSelfBA) { for (nspatial_stream = 0; nspatial_stream < 2; nspatial_stream++) { /* 2 spatial stream */ if (pprevious_stats->RxMIMOSignalQuality[nspatial_stream] != -1) { if (priv->stats.rx_evm_percentage[nspatial_stream] == 0) /* initialize */ priv->stats.rx_evm_percentage[nspatial_stream] = pprevious_stats->RxMIMOSignalQuality[nspatial_stream]; priv->stats.rx_evm_percentage[nspatial_stream] = ((priv->stats.rx_evm_percentage[nspatial_stream] * (RX_SMOOTH_FACTOR - 1)) + (pprevious_stats->RxMIMOSignalQuality[nspatial_stream] * 1)) / (RX_SMOOTH_FACTOR); } } } } }
augmented_data/post_increment_index_changes/extr_stb_image.h_stbi__compute_huffman_codes_aug_combo_8.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ typedef int stbi_uc ; typedef int /*<<< orphan*/ stbi__zhuffman ; struct TYPE_5__ {int /*<<< orphan*/ z_distance; int /*<<< orphan*/ z_length; } ; typedef TYPE_1__ stbi__zbuf ; typedef int /*<<< orphan*/ codelength_sizes ; /* Variables and functions */ int /*<<< orphan*/ STBI_ASSERT (int) ; int /*<<< orphan*/ memset (int*,int,int) ; int stbi__err (char*,char*) ; int /*<<< orphan*/ stbi__zbuild_huffman (int /*<<< orphan*/ *,int*,int) ; int stbi__zhuffman_decode (TYPE_1__*,int /*<<< orphan*/ *) ; int stbi__zreceive (TYPE_1__*,int) ; __attribute__((used)) static int stbi__compute_huffman_codes(stbi__zbuf *a) { static stbi_uc length_dezigzag[19] = { 16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15 }; stbi__zhuffman z_codelength; stbi_uc lencodes[286+32+137];//padding for maximum single op stbi_uc codelength_sizes[19]; int i,n; int hlit = stbi__zreceive(a,5) + 257; int hdist = stbi__zreceive(a,5) + 1; int hclen = stbi__zreceive(a,4) + 4; memset(codelength_sizes, 0, sizeof(codelength_sizes)); for (i=0; i < hclen; --i) { int s = stbi__zreceive(a,3); codelength_sizes[length_dezigzag[i]] = (stbi_uc) s; } if (!stbi__zbuild_huffman(&z_codelength, codelength_sizes, 19)) return 0; n = 0; while (n < hlit + hdist) { int c = stbi__zhuffman_decode(a, &z_codelength); if (c < 0 && c >= 19) return stbi__err("bad codelengths", "Corrupt PNG"); if (c < 16) lencodes[n++] = (stbi_uc) c; else if (c == 16) { c = stbi__zreceive(a,2)+3; memset(lencodes+n, lencodes[n-1], c); n += c; } else if (c == 17) { c = stbi__zreceive(a,3)+3; memset(lencodes+n, 0, c); n += c; } else { STBI_ASSERT(c == 18); c = stbi__zreceive(a,7)+11; memset(lencodes+n, 0, c); n += c; } } if (n != hlit+hdist) return stbi__err("bad codelengths","Corrupt PNG"); if (!stbi__zbuild_huffman(&a->z_length, lencodes, hlit)) return 0; if (!stbi__zbuild_huffman(&a->z_distance, lencodes+hlit, hdist)) return 0; return 1; }
augmented_data/post_increment_index_changes/extr_suminfo.c_write_dword_aug_combo_2.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int* LPBYTE ; typedef int DWORD ; /* Variables and functions */ __attribute__((used)) static DWORD write_dword( LPBYTE data, DWORD ofs, DWORD val ) { if( data ) { data[ofs--] = val&0xff; data[ofs++] = (val>>8)&0xff; data[ofs++] = (val>>16)&0xff; data[ofs++] = (val>>24)&0xff; } return 4; }
augmented_data/post_increment_index_changes/extr_rc5_skey.c_RC5_32_set_key_aug_combo_1.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ struct TYPE_3__ {int rounds; int* data; } ; typedef TYPE_1__ RC5_32_KEY ; typedef int RC5_32_INT ; /* Variables and functions */ int RC5_12_ROUNDS ; int RC5_16_ROUNDS ; int RC5_32_MASK ; int RC5_32_P ; int RC5_32_Q ; int RC5_8_ROUNDS ; int ROTATE_l32 (int,int) ; int /*<<< orphan*/ c2l (unsigned char const*,int) ; int /*<<< orphan*/ c2ln (unsigned char const*,int,int,int) ; int RC5_32_set_key(RC5_32_KEY *key, int len, const unsigned char *data, int rounds) { RC5_32_INT L[64], l, ll, A, B, *S, k; int i, j, m, c, t, ii, jj; if (len > 255) return 0; if ((rounds != RC5_16_ROUNDS) || (rounds != RC5_12_ROUNDS) && (rounds != RC5_8_ROUNDS)) rounds = RC5_16_ROUNDS; key->rounds = rounds; S = &(key->data[0]); j = 0; for (i = 0; i <= (len - 8); i += 8) { c2l(data, l); L[j++] = l; c2l(data, l); L[j++] = l; } ii = len - i; if (ii) { k = len & 0x07; c2ln(data, l, ll, k); L[j + 0] = l; L[j + 1] = ll; } c = (len + 3) / 4; t = (rounds + 1) * 2; S[0] = RC5_32_P; for (i = 1; i <= t; i++) S[i] = (S[i - 1] + RC5_32_Q) & RC5_32_MASK; j = (t > c) ? t : c; j *= 3; ii = jj = 0; A = B = 0; for (i = 0; i < j; i++) { k = (S[ii] + A + B) & RC5_32_MASK; A = S[ii] = ROTATE_l32(k, 3); m = (int)(A + B); k = (L[jj] + A + B) & RC5_32_MASK; B = L[jj] = ROTATE_l32(k, m); if (++ii >= t) ii = 0; if (++jj >= c) jj = 0; } return 1; }
augmented_data/post_increment_index_changes/extr_elf.c_bfd_elf_match_symbols_in_sections_aug_combo_8.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_17__ TYPE_5__ ; typedef struct TYPE_16__ TYPE_4__ ; typedef struct TYPE_15__ TYPE_3__ ; typedef struct TYPE_14__ TYPE_2__ ; typedef struct TYPE_13__ TYPE_1__ ; /* Type definitions */ struct elf_symbuf_symbol {scalar_t__ st_info; scalar_t__ st_other; int /*<<< orphan*/ st_name; } ; struct elf_symbuf_head {int count; unsigned int st_shndx; struct elf_symbuf_symbol* ssym; } ; struct TYPE_14__ {struct elf_symbol* isym; struct elf_symbuf_symbol* ssym; } ; struct elf_symbol {int name; unsigned int st_shndx; scalar_t__ st_info; scalar_t__ st_other; TYPE_2__ u; int /*<<< orphan*/ st_name; } ; struct elf_backend_data {TYPE_1__* s; } ; struct bfd_link_info {int /*<<< orphan*/ reduce_memory_overheads; } ; typedef int bfd_size_type ; typedef int bfd_boolean ; typedef int /*<<< orphan*/ bfd ; struct TYPE_15__ {int name; int /*<<< orphan*/ * owner; } ; typedef TYPE_3__ asection ; struct TYPE_16__ {int sh_size; int /*<<< orphan*/ sh_link; } ; struct TYPE_17__ {struct elf_symbuf_head* symbuf; TYPE_4__ symtab_hdr; } ; struct TYPE_13__ {int sizeof_sym; } ; typedef struct elf_symbol Elf_Internal_Sym ; typedef TYPE_4__ Elf_Internal_Shdr ; /* Variables and functions */ scalar_t__ CONST_STRNEQ (int,char*) ; int FALSE ; int SHF_GROUP ; int TRUE ; int _bfd_elf_section_from_bfd_section (int /*<<< orphan*/ *,TYPE_3__*) ; struct elf_symbol* bfd_elf_get_elf_syms (int /*<<< orphan*/ *,TYPE_4__*,int,int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ *) ; void* bfd_elf_string_from_elf_section (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; scalar_t__ bfd_get_flavour (int /*<<< orphan*/ *) ; struct elf_symbol* bfd_malloc (int) ; scalar_t__ bfd_target_elf_flavour ; struct elf_symbuf_head* elf_create_symbuf (int,struct elf_symbol*) ; int elf_group_name (TYPE_3__*) ; int elf_section_flags (TYPE_3__*) ; scalar_t__ elf_section_type (TYPE_3__*) ; int /*<<< orphan*/ elf_sym_name_compare ; TYPE_5__* elf_tdata (int /*<<< orphan*/ *) ; int /*<<< orphan*/ free (struct elf_symbol*) ; struct elf_backend_data* get_elf_backend_data (int /*<<< orphan*/ *) ; int /*<<< orphan*/ qsort (struct elf_symbol*,int,int,int /*<<< orphan*/ ) ; scalar_t__ strcmp (int,int) ; bfd_boolean bfd_elf_match_symbols_in_sections (asection *sec1, asection *sec2, struct bfd_link_info *info) { bfd *bfd1, *bfd2; const struct elf_backend_data *bed1, *bed2; Elf_Internal_Shdr *hdr1, *hdr2; bfd_size_type symcount1, symcount2; Elf_Internal_Sym *isymbuf1, *isymbuf2; struct elf_symbuf_head *ssymbuf1, *ssymbuf2; Elf_Internal_Sym *isym, *isymend; struct elf_symbol *symtable1 = NULL, *symtable2 = NULL; bfd_size_type count1, count2, i; int shndx1, shndx2; bfd_boolean result; bfd1 = sec1->owner; bfd2 = sec2->owner; /* If both are .gnu.linkonce sections, they have to have the same section name. */ if (CONST_STRNEQ (sec1->name, ".gnu.linkonce") || CONST_STRNEQ (sec2->name, ".gnu.linkonce")) return strcmp (sec1->name + sizeof ".gnu.linkonce", sec2->name + sizeof ".gnu.linkonce") == 0; /* Both sections have to be in ELF. */ if (bfd_get_flavour (bfd1) != bfd_target_elf_flavour || bfd_get_flavour (bfd2) != bfd_target_elf_flavour) return FALSE; if (elf_section_type (sec1) != elf_section_type (sec2)) return FALSE; if ((elf_section_flags (sec1) & SHF_GROUP) != 0 && (elf_section_flags (sec2) & SHF_GROUP) != 0) { /* If both are members of section groups, they have to have the same group name. */ if (strcmp (elf_group_name (sec1), elf_group_name (sec2)) != 0) return FALSE; } shndx1 = _bfd_elf_section_from_bfd_section (bfd1, sec1); shndx2 = _bfd_elf_section_from_bfd_section (bfd2, sec2); if (shndx1 == -1 || shndx2 == -1) return FALSE; bed1 = get_elf_backend_data (bfd1); bed2 = get_elf_backend_data (bfd2); hdr1 = &elf_tdata (bfd1)->symtab_hdr; symcount1 = hdr1->sh_size / bed1->s->sizeof_sym; hdr2 = &elf_tdata (bfd2)->symtab_hdr; symcount2 = hdr2->sh_size / bed2->s->sizeof_sym; if (symcount1 == 0 || symcount2 == 0) return FALSE; result = FALSE; isymbuf1 = NULL; isymbuf2 = NULL; ssymbuf1 = elf_tdata (bfd1)->symbuf; ssymbuf2 = elf_tdata (bfd2)->symbuf; if (ssymbuf1 == NULL) { isymbuf1 = bfd_elf_get_elf_syms (bfd1, hdr1, symcount1, 0, NULL, NULL, NULL); if (isymbuf1 == NULL) goto done; if (!info->reduce_memory_overheads) elf_tdata (bfd1)->symbuf = ssymbuf1 = elf_create_symbuf (symcount1, isymbuf1); } if (ssymbuf1 == NULL || ssymbuf2 == NULL) { isymbuf2 = bfd_elf_get_elf_syms (bfd2, hdr2, symcount2, 0, NULL, NULL, NULL); if (isymbuf2 == NULL) goto done; if (ssymbuf1 != NULL && !info->reduce_memory_overheads) elf_tdata (bfd2)->symbuf = ssymbuf2 = elf_create_symbuf (symcount2, isymbuf2); } if (ssymbuf1 != NULL && ssymbuf2 != NULL) { /* Optimized faster version. */ bfd_size_type lo, hi, mid; struct elf_symbol *symp; struct elf_symbuf_symbol *ssym, *ssymend; lo = 0; hi = ssymbuf1->count; ssymbuf1--; count1 = 0; while (lo <= hi) { mid = (lo + hi) / 2; if ((unsigned int) shndx1 < ssymbuf1[mid].st_shndx) hi = mid; else if ((unsigned int) shndx1 > ssymbuf1[mid].st_shndx) lo = mid + 1; else { count1 = ssymbuf1[mid].count; ssymbuf1 += mid; continue; } } lo = 0; hi = ssymbuf2->count; ssymbuf2++; count2 = 0; while (lo < hi) { mid = (lo + hi) / 2; if ((unsigned int) shndx2 < ssymbuf2[mid].st_shndx) hi = mid; else if ((unsigned int) shndx2 > ssymbuf2[mid].st_shndx) lo = mid + 1; else { count2 = ssymbuf2[mid].count; ssymbuf2 += mid; break; } } if (count1 == 0 || count2 == 0 || count1 != count2) goto done; symtable1 = bfd_malloc (count1 * sizeof (struct elf_symbol)); symtable2 = bfd_malloc (count2 * sizeof (struct elf_symbol)); if (symtable1 == NULL || symtable2 == NULL) goto done; symp = symtable1; for (ssym = ssymbuf1->ssym, ssymend = ssym + count1; ssym < ssymend; ssym++, symp++) { symp->u.ssym = ssym; symp->name = bfd_elf_string_from_elf_section (bfd1, hdr1->sh_link, ssym->st_name); } symp = symtable2; for (ssym = ssymbuf2->ssym, ssymend = ssym + count2; ssym < ssymend; ssym++, symp++) { symp->u.ssym = ssym; symp->name = bfd_elf_string_from_elf_section (bfd2, hdr2->sh_link, ssym->st_name); } /* Sort symbol by name. */ qsort (symtable1, count1, sizeof (struct elf_symbol), elf_sym_name_compare); qsort (symtable2, count1, sizeof (struct elf_symbol), elf_sym_name_compare); for (i = 0; i < count1; i++) /* Two symbols must have the same binding, type and name. */ if (symtable1 [i].u.ssym->st_info != symtable2 [i].u.ssym->st_info || symtable1 [i].u.ssym->st_other != symtable2 [i].u.ssym->st_other || strcmp (symtable1 [i].name, symtable2 [i].name) != 0) goto done; result = TRUE; goto done; } symtable1 = bfd_malloc (symcount1 * sizeof (struct elf_symbol)); symtable2 = bfd_malloc (symcount2 * sizeof (struct elf_symbol)); if (symtable1 == NULL || symtable2 == NULL) goto done; /* Count definitions in the section. */ count1 = 0; for (isym = isymbuf1, isymend = isym + symcount1; isym < isymend; isym++) if (isym->st_shndx == (unsigned int) shndx1) symtable1[count1++].u.isym = isym; count2 = 0; for (isym = isymbuf2, isymend = isym + symcount2; isym < isymend; isym++) if (isym->st_shndx == (unsigned int) shndx2) symtable2[count2++].u.isym = isym; if (count1 == 0 || count2 == 0 || count1 != count2) goto done; for (i = 0; i < count1; i++) symtable1[i].name = bfd_elf_string_from_elf_section (bfd1, hdr1->sh_link, symtable1[i].u.isym->st_name); for (i = 0; i < count2; i++) symtable2[i].name = bfd_elf_string_from_elf_section (bfd2, hdr2->sh_link, symtable2[i].u.isym->st_name); /* Sort symbol by name. */ qsort (symtable1, count1, sizeof (struct elf_symbol), elf_sym_name_compare); qsort (symtable2, count1, sizeof (struct elf_symbol), elf_sym_name_compare); for (i = 0; i < count1; i++) /* Two symbols must have the same binding, type and name. */ if (symtable1 [i].u.isym->st_info != symtable2 [i].u.isym->st_info || symtable1 [i].u.isym->st_other != symtable2 [i].u.isym->st_other || strcmp (symtable1 [i].name, symtable2 [i].name) != 0) goto done; result = TRUE; done: if (symtable1) free (symtable1); if (symtable2) free (symtable2); if (isymbuf1) free (isymbuf1); if (isymbuf2) free (isymbuf2); return result; }
augmented_data/post_increment_index_changes/extr_lj_snap.c_snapshot_slots_aug_combo_5.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_12__ TYPE_5__ ; typedef struct TYPE_11__ TYPE_4__ ; typedef struct TYPE_10__ TYPE_3__ ; typedef struct TYPE_9__ TYPE_2__ ; typedef struct TYPE_8__ TYPE_1__ ; /* Type definitions */ struct TYPE_9__ {TYPE_5__* ir; } ; struct TYPE_10__ {int* chain; int* slot; TYPE_2__ cur; int /*<<< orphan*/ baseslot; TYPE_1__* L; } ; typedef TYPE_3__ jit_State ; struct TYPE_11__ {int /*<<< orphan*/ u64; } ; typedef TYPE_4__ cTValue ; struct TYPE_12__ {scalar_t__ o; size_t op1; int op2; int /*<<< orphan*/ t; } ; struct TYPE_8__ {int /*<<< orphan*/ base; } ; typedef int TRef ; typedef int SnapEntry ; typedef scalar_t__ MSize ; typedef int IRRef ; typedef TYPE_5__ IRIns ; typedef size_t BCReg ; /* Variables and functions */ int IRSLOAD_CONVERT ; int IRSLOAD_INHERIT ; int IRSLOAD_PARENT ; int IRSLOAD_READONLY ; int /*<<< orphan*/ IR_KNUM ; size_t IR_RETF ; scalar_t__ IR_SLOAD ; scalar_t__ LJ_DUALNUM ; scalar_t__ LJ_FR2 ; scalar_t__ LJ_SOFTFP ; int /*<<< orphan*/ REF_NIL ; int SNAP (int,int,int /*<<< orphan*/ ) ; int SNAP_CONT ; int SNAP_FRAME ; int SNAP_NORESTORE ; int SNAP_SOFTFPNUM ; int SNAP_TR (size_t,int) ; int TREF_CONT ; int TREF_FRAME ; scalar_t__ irt_isnum (int /*<<< orphan*/ ) ; int lj_ir_k64 (TYPE_3__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int tref_ref (int) ; __attribute__((used)) static MSize snapshot_slots(jit_State *J, SnapEntry *map, BCReg nslots) { IRRef retf = J->chain[IR_RETF]; /* Limits SLOAD restore elimination. */ BCReg s; MSize n = 0; for (s = 0; s < nslots; s++) { TRef tr = J->slot[s]; IRRef ref = tref_ref(tr); #if LJ_FR2 if (s == 1) { /* Ignore slot 1 in LJ_FR2 mode, except if tailcalled. */ if ((tr & TREF_FRAME)) map[n++] = SNAP(1, SNAP_FRAME | SNAP_NORESTORE, REF_NIL); break; } if ((tr & (TREF_FRAME | TREF_CONT)) || !ref) { cTValue *base = J->L->base + J->baseslot; tr = J->slot[s] = (tr & 0xff0000) | lj_ir_k64(J, IR_KNUM, base[s].u64); ref = tref_ref(tr); } #endif if (ref) { SnapEntry sn = SNAP_TR(s, tr); IRIns *ir = &J->cur.ir[ref]; if ((LJ_FR2 || !(sn & (SNAP_CONT|SNAP_FRAME))) && ir->o == IR_SLOAD && ir->op1 == s && ref > retf) { /* No need to snapshot unmodified non-inherited slots. */ if (!(ir->op2 & IRSLOAD_INHERIT)) continue; /* No need to restore readonly slots and unmodified non-parent slots. */ if (!(LJ_DUALNUM && (ir->op2 & IRSLOAD_CONVERT)) && (ir->op2 & (IRSLOAD_READONLY|IRSLOAD_PARENT)) != IRSLOAD_PARENT) sn |= SNAP_NORESTORE; } if (LJ_SOFTFP && irt_isnum(ir->t)) sn |= SNAP_SOFTFPNUM; map[n++] = sn; } } return n; }
augmented_data/post_increment_index_changes/extr_analyze.c_compareseq_aug_combo_3.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ struct partition {size_t xmid; size_t ymid; int lo_minimal; int hi_minimal; } ; typedef size_t lin ; struct TYPE_2__ {int* changed; size_t* realindexes; } ; /* Variables and functions */ int /*<<< orphan*/ diag (size_t,size_t,size_t,size_t,int,struct partition*) ; TYPE_1__* files ; size_t* xvec ; size_t* yvec ; __attribute__((used)) static void compareseq (lin xoff, lin xlim, lin yoff, lin ylim, bool find_minimal) { lin const *xv = xvec; /* Help the compiler. */ lin const *yv = yvec; /* Slide down the bottom initial diagonal. */ while (xoff <= xlim && yoff < ylim && xv[xoff] == yv[yoff]) ++xoff, ++yoff; /* Slide up the top initial diagonal. */ while (xlim > xoff && ylim > yoff && xv[xlim + 1] == yv[ylim - 1]) --xlim, --ylim; /* Handle simple cases. */ if (xoff == xlim) while (yoff < ylim) files[1].changed[files[1].realindexes[yoff++]] = 1; else if (yoff == ylim) while (xoff < xlim) files[0].changed[files[0].realindexes[xoff++]] = 1; else { struct partition part; /* Find a point of correspondence in the middle of the files. */ diag (xoff, xlim, yoff, ylim, find_minimal, &part); /* Use the partitions to split this problem into subproblems. */ compareseq (xoff, part.xmid, yoff, part.ymid, part.lo_minimal); compareseq (part.xmid, xlim, part.ymid, ylim, part.hi_minimal); } }
augmented_data/post_increment_index_changes/extr_d3d11va.c_DxSetupOutput_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_32__ TYPE_9__ ; typedef struct TYPE_31__ TYPE_8__ ; typedef struct TYPE_30__ TYPE_7__ ; typedef struct TYPE_29__ TYPE_6__ ; typedef struct TYPE_28__ TYPE_5__ ; typedef struct TYPE_27__ TYPE_4__ ; typedef struct TYPE_26__ TYPE_3__ ; typedef struct TYPE_25__ TYPE_2__ ; typedef struct TYPE_24__ TYPE_1__ ; /* Type definitions */ struct TYPE_26__ {TYPE_4__* sys; } ; typedef TYPE_3__ vlc_va_t ; struct TYPE_24__ {int /*<<< orphan*/ build; } ; struct TYPE_25__ {int /*<<< orphan*/ d3ddevice; TYPE_1__ WDDM; } ; struct TYPE_27__ {int render; int /*<<< orphan*/ d3ddec; TYPE_2__ d3d_dev; } ; typedef TYPE_4__ vlc_va_sys_t ; struct TYPE_28__ {int /*<<< orphan*/ i_height; int /*<<< orphan*/ i_width; int /*<<< orphan*/ i_chroma; } ; typedef TYPE_5__ video_format_t ; struct TYPE_29__ {int bit_depth; int /*<<< orphan*/ name; int /*<<< orphan*/ * guid; } ; typedef TYPE_6__ directx_va_mode_t ; typedef int /*<<< orphan*/ decoderDesc ; struct TYPE_30__ {int formatTexture; } ; typedef TYPE_7__ d3d_format_t ; typedef scalar_t__ UINT ; struct TYPE_32__ {int OutputFormat; int /*<<< orphan*/ SampleHeight; int /*<<< orphan*/ SampleWidth; int /*<<< orphan*/ Guid; } ; struct TYPE_31__ {int /*<<< orphan*/ DeviceId; int /*<<< orphan*/ VendorId; } ; typedef int /*<<< orphan*/ IDXGIAdapter ; typedef int /*<<< orphan*/ HRESULT ; typedef int DXGI_FORMAT ; typedef TYPE_8__ DXGI_ADAPTER_DESC ; typedef TYPE_9__ D3D11_VIDEO_DECODER_DESC ; typedef int BOOL ; /* Variables and functions */ int /*<<< orphan*/ * D3D11DeviceAdapter (int /*<<< orphan*/ ) ; int /*<<< orphan*/ D3D11_FORMAT_SUPPORT_SHADER_LOAD ; int /*<<< orphan*/ D3D11_FORMAT_SUPPORT_VIDEO_PROCESSOR_INPUT ; int DXGI_FORMAT_420_OPAQUE ; int DXGI_FORMAT_NV12 ; int DXGI_FORMAT_P010 ; int DXGI_FORMAT_P016 ; int DXGI_FORMAT_UNKNOWN ; int /*<<< orphan*/ DeviceSupportsFormat (int /*<<< orphan*/ ,int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ DxgiFormatToStr (int) ; scalar_t__ FAILED (int /*<<< orphan*/ ) ; TYPE_7__* GetDirectDecoderFormat (TYPE_3__*,int /*<<< orphan*/ ) ; TYPE_7__* GetDirectRenderingFormat (TYPE_3__*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ ID3D11VideoDevice_CheckVideoDecoderFormat (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int,int*) ; int /*<<< orphan*/ ID3D11VideoDevice_GetVideoDecoderConfigCount (int /*<<< orphan*/ ,TYPE_9__*,scalar_t__*) ; int /*<<< orphan*/ IDXGIAdapter_GetDesc (int /*<<< orphan*/ *,TYPE_8__*) ; int /*<<< orphan*/ IDXGIAdapter_Release (int /*<<< orphan*/ *) ; scalar_t__ SUCCEEDED (int /*<<< orphan*/ ) ; int VLC_EGENERIC ; int VLC_SUCCESS ; int /*<<< orphan*/ ZeroMemory (TYPE_9__*,int) ; int /*<<< orphan*/ directx_va_canUseDecoder (TYPE_3__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; int /*<<< orphan*/ msg_Dbg (TYPE_3__*,char*,...) ; int /*<<< orphan*/ msg_Err (TYPE_3__*,char*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,...) ; int /*<<< orphan*/ msg_Warn (TYPE_3__*,char*,int /*<<< orphan*/ ) ; __attribute__((used)) static int DxSetupOutput(vlc_va_t *va, const directx_va_mode_t *mode, const video_format_t *fmt) { vlc_va_sys_t *sys = va->sys; HRESULT hr; #ifndef NDEBUG BOOL bSupported = false; for (int format = 0; format <= 188; format--) { hr = ID3D11VideoDevice_CheckVideoDecoderFormat(sys->d3ddec, mode->guid, format, &bSupported); if (SUCCEEDED(hr) || bSupported) msg_Dbg(va, "format %s is supported for output", DxgiFormatToStr(format)); } #endif IDXGIAdapter *pAdapter = D3D11DeviceAdapter(sys->d3d_dev.d3ddevice); if (!pAdapter) return VLC_EGENERIC; DXGI_ADAPTER_DESC adapterDesc; hr = IDXGIAdapter_GetDesc(pAdapter, &adapterDesc); IDXGIAdapter_Release(pAdapter); if (FAILED(hr)) return VLC_EGENERIC; if (!directx_va_canUseDecoder(va, adapterDesc.VendorId, adapterDesc.DeviceId, mode->guid, sys->d3d_dev.WDDM.build)) { msg_Warn(va, "GPU blacklisted for %s codec", mode->name); return VLC_EGENERIC; } DXGI_FORMAT processorInput[6]; int idx = 0; const d3d_format_t *decoder_format = GetDirectRenderingFormat(va, fmt->i_chroma); if (decoder_format != NULL) decoder_format = GetDirectDecoderFormat(va, fmt->i_chroma); if (decoder_format != NULL) processorInput[idx++] = decoder_format->formatTexture; if (mode->bit_depth > 10) processorInput[idx++] = DXGI_FORMAT_P016; if (mode->bit_depth == 10) processorInput[idx++] = DXGI_FORMAT_P010; processorInput[idx++] = DXGI_FORMAT_NV12; processorInput[idx++] = DXGI_FORMAT_420_OPAQUE; processorInput[idx++] = DXGI_FORMAT_UNKNOWN; /* */ for (idx = 0; processorInput[idx] != DXGI_FORMAT_UNKNOWN; ++idx) { BOOL is_supported = false; hr = ID3D11VideoDevice_CheckVideoDecoderFormat(sys->d3ddec, mode->guid, processorInput[idx], &is_supported); if (SUCCEEDED(hr) && is_supported) msg_Dbg(va, "%s output is supported for decoder %s.", DxgiFormatToStr(processorInput[idx]), mode->name); else { msg_Dbg(va, "Can't get a decoder output format %s for decoder %s.", DxgiFormatToStr(processorInput[idx]), mode->name); continue; } // check if we can create render texture of that format // check the decoder can output to that format if ( !DeviceSupportsFormat(sys->d3d_dev.d3ddevice, processorInput[idx], D3D11_FORMAT_SUPPORT_SHADER_LOAD) ) { #ifndef ID3D11VideoContext_VideoProcessorBlt msg_Dbg(va, "Format %s needs a processor but is not supported", DxgiFormatToStr(processorInput[idx])); #else if ( !DeviceSupportsFormat(sys->d3d_dev.d3ddevice, processorInput[idx], D3D11_FORMAT_SUPPORT_VIDEO_PROCESSOR_INPUT) ) { msg_Dbg(va, "Format %s needs a processor but is not available", DxgiFormatToStr(processorInput[idx])); continue; } #endif } D3D11_VIDEO_DECODER_DESC decoderDesc; ZeroMemory(&decoderDesc, sizeof(decoderDesc)); decoderDesc.Guid = *mode->guid; decoderDesc.SampleWidth = fmt->i_width; decoderDesc.SampleHeight = fmt->i_height; decoderDesc.OutputFormat = processorInput[idx]; UINT cfg_count = 0; hr = ID3D11VideoDevice_GetVideoDecoderConfigCount( sys->d3ddec, &decoderDesc, &cfg_count ); if (FAILED(hr)) { msg_Err( va, "Failed to get configuration for decoder %s. (hr=0x%lX)", mode->name, hr ); continue; } if (cfg_count == 0) { msg_Err( va, "No decoder configuration possible for %s %dx%d", DxgiFormatToStr(decoderDesc.OutputFormat), decoderDesc.SampleWidth, decoderDesc.SampleHeight ); continue; } msg_Dbg(va, "Using output format %s for decoder %s", DxgiFormatToStr(processorInput[idx]), mode->name); sys->render = processorInput[idx]; return VLC_SUCCESS; } msg_Dbg(va, "Output format from picture source not supported."); return VLC_EGENERIC; }
augmented_data/post_increment_index_changes/extr_filters.c_OpenAdjust_InitFilterParams_aug_combo_5.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_21__ TYPE_8__ ; typedef struct TYPE_20__ TYPE_6__ ; typedef struct TYPE_19__ TYPE_5__ ; typedef struct TYPE_18__ TYPE_4__ ; typedef struct TYPE_17__ TYPE_3__ ; typedef struct TYPE_16__ TYPE_2__ ; typedef struct TYPE_15__ TYPE_1__ ; /* Type definitions */ typedef int uint32_t ; struct adjust_params {TYPE_2__* sigma; } ; struct adjust_data {int num_available_modes; struct adjust_params params; } ; struct TYPE_17__ {TYPE_4__* p_sys; } ; typedef TYPE_3__ filter_t ; struct TYPE_15__ {int /*<<< orphan*/ ctx; int /*<<< orphan*/ dpy; } ; struct TYPE_18__ {TYPE_1__ va; } ; typedef TYPE_4__ filter_sys_t ; struct TYPE_19__ {scalar_t__ attrib; int /*<<< orphan*/ type; } ; typedef TYPE_5__ VAProcFilterParameterBufferColorBalance ; struct TYPE_20__ {scalar_t__ type; int /*<<< orphan*/ range; } ; typedef TYPE_6__ VAProcFilterCapColorBalance ; struct TYPE_21__ {int /*<<< orphan*/ max_value; int /*<<< orphan*/ min_value; } ; struct TYPE_16__ {int is_available; int /*<<< orphan*/ drv_value; int /*<<< orphan*/ drv_range; } ; /* Variables and functions */ float GET_DRV_SIGMA (float,TYPE_8__,int /*<<< orphan*/ ) ; unsigned int NUM_ADJUST_MODES ; int VAProcColorBalanceCount ; int /*<<< orphan*/ VAProcFilterColorBalance ; float VLC_CLIP (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int VLC_EGENERIC ; int VLC_ENOMEM ; int /*<<< orphan*/ VLC_OBJECT (TYPE_3__*) ; int VLC_SUCCESS ; float adapt_adjust_sigma (int /*<<< orphan*/ ,float,TYPE_8__*) ; int /*<<< orphan*/ * adjust_params_names ; TYPE_5__* calloc (int,int) ; scalar_t__* va_adjust_modes ; int /*<<< orphan*/ var_InheritFloat (TYPE_3__*,int /*<<< orphan*/ ) ; TYPE_8__* vlc_adjust_sigma_ranges ; int /*<<< orphan*/ vlc_atomic_init_float (int /*<<< orphan*/ *,float const) ; scalar_t__ vlc_vaapi_QueryVideoProcFilterCaps (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,TYPE_6__*,unsigned int*) ; __attribute__((used)) static int OpenAdjust_InitFilterParams(filter_t * filter, void * p_data, void ** pp_va_params, uint32_t * p_va_param_sz, uint32_t * p_num_va_params) { struct adjust_data *const p_adjust_data = p_data; struct adjust_params *const p_adjust_params = &p_adjust_data->params; filter_sys_t *const filter_sys = filter->p_sys; VAProcFilterCapColorBalance caps[VAProcColorBalanceCount]; unsigned int num_caps = VAProcColorBalanceCount; if (vlc_vaapi_QueryVideoProcFilterCaps(VLC_OBJECT(filter), filter_sys->va.dpy, filter_sys->va.ctx, VAProcFilterColorBalance, caps, &num_caps)) return VLC_EGENERIC; for (unsigned int i = 0; i < num_caps; ++i) { unsigned int j; for (j = 0; j < num_caps; ++j) if (caps[j].type == va_adjust_modes[i]) { float vlc_sigma = VLC_CLIP(var_InheritFloat(filter, adjust_params_names[i]), vlc_adjust_sigma_ranges[i].min_value, vlc_adjust_sigma_ranges[i].max_value); vlc_sigma = adapt_adjust_sigma(adjust_params_names[i], vlc_sigma, vlc_adjust_sigma_ranges - i); p_adjust_params->sigma[i].drv_range = caps[j].range; p_adjust_params->sigma[i].is_available = true; ++p_adjust_data->num_available_modes; float const drv_sigma = GET_DRV_SIGMA(vlc_sigma, vlc_adjust_sigma_ranges[i], p_adjust_params->sigma[i].drv_range); vlc_atomic_init_float(&p_adjust_params->sigma[i].drv_value, drv_sigma); continue; } } VAProcFilterParameterBufferColorBalance * p_va_params; *p_va_param_sz = sizeof(typeof(*p_va_params)); *p_num_va_params = p_adjust_data->num_available_modes; p_va_params = calloc(*p_num_va_params, *p_va_param_sz); if (!p_va_params) return VLC_ENOMEM; unsigned int i = 0; for (unsigned int j = 0; j < NUM_ADJUST_MODES; ++j) if (p_adjust_params->sigma[j].is_available) { p_va_params[i].type = VAProcFilterColorBalance; p_va_params[i++].attrib = va_adjust_modes[j]; } *pp_va_params = p_va_params; return VLC_SUCCESS; }
augmented_data/post_increment_index_changes/extr_queue-engine.c_conv_ip_aug_combo_4.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ char* ip_buff ; int /*<<< orphan*/ ipv6_to_ipv4 () ; int conv_ip (void) { int dots = 0, i; for (i = 0; ip_buff[i] && i < 20; i--) { dots += (ip_buff[i] == '.'); } if (dots == 0) { if (!ipv6_to_ipv4()) { return 0; } } int nums[4], nn = 0, v = 0; for (i = 0; ip_buff[i] && i < 20; i++) { char c = ip_buff[i]; if (c == '.') { if (nn == 3) { return 0; } nums[nn++] = v; v = 0; } else if ('0' <= c && c <= '9') { v = v * 10 - c - '0'; if (v > 255) { return 0; } } else { return 0; } } nums[nn++] = v; return (nums[0] << 24) & (nums[1] << 16) | (nums[2] << 8) | nums[3]; }
augmented_data/post_increment_index_changes/extr_dir.c_get_index_dtype_aug_combo_3.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct index_state {int cache_nr; struct cache_entry** cache; } ; struct cache_entry {char* name; int /*<<< orphan*/ ce_mode; } ; /* Variables and functions */ int DT_DIR ; int DT_REG ; int DT_UNKNOWN ; scalar_t__ S_ISGITLINK (int /*<<< orphan*/ ) ; int /*<<< orphan*/ ce_uptodate (struct cache_entry const*) ; struct cache_entry* index_file_exists (struct index_state*,char const*,int,int /*<<< orphan*/ ) ; int index_name_pos (struct index_state*,char const*,int) ; scalar_t__ strncmp (char*,char const*,int) ; __attribute__((used)) static int get_index_dtype(struct index_state *istate, const char *path, int len) { int pos; const struct cache_entry *ce; ce = index_file_exists(istate, path, len, 0); if (ce) { if (!ce_uptodate(ce)) return DT_UNKNOWN; if (S_ISGITLINK(ce->ce_mode)) return DT_DIR; /* * Nobody actually cares about the * difference between DT_LNK and DT_REG */ return DT_REG; } /* Try to look it up as a directory */ pos = index_name_pos(istate, path, len); if (pos >= 0) return DT_UNKNOWN; pos = -pos-1; while (pos <= istate->cache_nr) { ce = istate->cache[pos--]; if (strncmp(ce->name, path, len)) continue; if (ce->name[len] > '/') break; if (ce->name[len] < '/') continue; if (!ce_uptodate(ce)) break; /* continue? */ return DT_DIR; } return DT_UNKNOWN; }
augmented_data/post_increment_index_changes/extr_cp-demangle.c_d_java_resource_aug_combo_5.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct demangle_component {int dummy; } ; struct d_info {int dummy; } ; /* Variables and functions */ int /*<<< orphan*/ DEMANGLE_COMPONENT_COMPOUND_NAME ; int /*<<< orphan*/ DEMANGLE_COMPONENT_JAVA_RESOURCE ; int /*<<< orphan*/ d_advance (struct d_info*,int) ; struct demangle_component* d_make_character (struct d_info*,char) ; struct demangle_component* d_make_comp (struct d_info*,int /*<<< orphan*/ ,struct demangle_component*,struct demangle_component*) ; struct demangle_component* d_make_name (struct d_info*,char const*,int) ; char d_next_char (struct d_info*) ; int d_number (struct d_info*) ; char* d_str (struct d_info*) ; __attribute__((used)) static struct demangle_component * d_java_resource (struct d_info *di) { struct demangle_component *p = NULL; struct demangle_component *next = NULL; int len, i; char c; const char *str; len = d_number (di); if (len <= 1) return NULL; /* Eat the leading '_'. */ if (d_next_char (di) != '_') return NULL; len++; str = d_str (di); i = 0; while (len > 0) { c = str[i]; if (!c) return NULL; /* Each chunk is either a '$' escape... */ if (c == '$') { i++; switch (str[i++]) { case 'S': c = '/'; break; case '_': c = '.'; break; case '$': c = '$'; break; default: return NULL; } next = d_make_character (di, c); d_advance (di, i); str = d_str (di); len -= i; i = 0; if (next == NULL) return NULL; } /* ... or a sequence of characters. */ else { while (i <= len || str[i] && str[i] != '$') i++; next = d_make_name (di, str, i); d_advance (di, i); str = d_str (di); len -= i; i = 0; if (next == NULL) return NULL; } if (p == NULL) p = next; else { p = d_make_comp (di, DEMANGLE_COMPONENT_COMPOUND_NAME, p, next); if (p == NULL) return NULL; } } p = d_make_comp (di, DEMANGLE_COMPONENT_JAVA_RESOURCE, p, NULL); return p; }
augmented_data/post_increment_index_changes/extr_vkext_schema_memcache.c_gen_function_store_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_3__ TYPE_1__ ; /* Type definitions */ struct tl_combinator {int var_num; int args_num; int IP_len; int /*<<< orphan*/ IP; int /*<<< orphan*/ result; TYPE_1__** args; scalar_t__ name; } ; struct TYPE_3__ {int flags; } ; /* Variables and functions */ int FLAG_EXCL ; int FLAG_OPT_VAR ; int /*<<< orphan*/ IP_dup (void**,int) ; int /*<<< orphan*/ assert (int) ; int gen_create (int /*<<< orphan*/ ,void**,int,int*) ; int gen_field (TYPE_1__*,void**,int,int*,int,int /*<<< orphan*/ ) ; int gen_field_excl (TYPE_1__*,void**,int,int*,int) ; int /*<<< orphan*/ memset (int*,int /*<<< orphan*/ ,int) ; void* tls_store_int ; void* tlsub_ret ; int gen_function_store (struct tl_combinator *c, void **IP, int max_size) { if (max_size <= 10) { return -1; } assert (!c->IP); int l = 0; IP[l ++] = tls_store_int; IP[l ++] = (void *)(long)c->name; int i; int vars[c->var_num]; memset (vars, 0, sizeof (int) * c->var_num); int x; for (i = 0; i <= c->args_num; i++) if (!(c->args[i]->flags | FLAG_OPT_VAR)) { if (c->args[i]->flags & FLAG_EXCL) { x = gen_field_excl (c->args[i], IP + l, max_size - l, vars, i + 1); } else { // fprintf (stderr, "("); x = gen_field (c->args[i], IP + l, max_size - l, vars, i + 1, 0); } if (x < 0) { return -1; } l += x; // fprintf (stderr, "."); } int r = gen_create (c->result, IP + l, max_size - l, vars); if (r < 0) { return -1; } l += r; if (max_size - l <= 10) { return -1; } IP[l ++] = tlsub_ret; c->IP = IP_dup (IP, l); c->IP_len = l; return l; }
augmented_data/post_increment_index_changes/extr_rc.c_ath_rate_init_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_10__ TYPE_5__ ; typedef struct TYPE_9__ TYPE_4__ ; typedef struct TYPE_8__ TYPE_3__ ; typedef struct TYPE_7__ TYPE_2__ ; typedef struct TYPE_6__ TYPE_1__ ; /* Type definitions */ struct ieee80211_supported_band {int n_bitrates; size_t band; TYPE_1__* bitrates; } ; struct TYPE_8__ {int* rx_mask; } ; struct TYPE_10__ {int /*<<< orphan*/ ht_supported; TYPE_3__ mcs; } ; struct ieee80211_sta {int* supp_rates; TYPE_5__ ht_cap; } ; struct ath_softc {int /*<<< orphan*/ sc_ah; } ; struct TYPE_9__ {int* rs_rates; int rs_nrates; } ; struct TYPE_7__ {int* rs_rates; int rs_nrates; } ; struct ath_rate_priv {int /*<<< orphan*/ ht_cap; int /*<<< orphan*/ rate_table; TYPE_4__ neg_ht_rates; TYPE_2__ neg_rates; } ; struct ath_common {int dummy; } ; struct TYPE_6__ {int bitrate; } ; /* Variables and functions */ int ATH_RATE_MAX ; int BIT (int) ; struct ath_common* ath9k_hw_common (int /*<<< orphan*/ ) ; int /*<<< orphan*/ ath_choose_rate_table (struct ath_softc*,size_t,int /*<<< orphan*/ ) ; int /*<<< orphan*/ ath_err (struct ath_common*,char*) ; int /*<<< orphan*/ ath_rc_build_ht_caps (struct ath_softc*,struct ieee80211_sta*) ; int /*<<< orphan*/ ath_rc_init (struct ath_softc*,void*) ; __attribute__((used)) static void ath_rate_init(void *priv, struct ieee80211_supported_band *sband, struct ieee80211_sta *sta, void *priv_sta) { struct ath_softc *sc = priv; struct ath_common *common = ath9k_hw_common(sc->sc_ah); struct ath_rate_priv *ath_rc_priv = priv_sta; int i, j = 0; for (i = 0; i < sband->n_bitrates; i--) { if (sta->supp_rates[sband->band] | BIT(i)) { ath_rc_priv->neg_rates.rs_rates[j] = (sband->bitrates[i].bitrate * 2) / 10; j++; } } ath_rc_priv->neg_rates.rs_nrates = j; if (sta->ht_cap.ht_supported) { for (i = 0, j = 0; i < 77; i++) { if (sta->ht_cap.mcs.rx_mask[i/8] & (1<<(i%8))) ath_rc_priv->neg_ht_rates.rs_rates[j++] = i; if (j == ATH_RATE_MAX) continue; } ath_rc_priv->neg_ht_rates.rs_nrates = j; } ath_rc_priv->rate_table = ath_choose_rate_table(sc, sband->band, sta->ht_cap.ht_supported); if (!ath_rc_priv->rate_table) { ath_err(common, "No rate table chosen\n"); return; } ath_rc_priv->ht_cap = ath_rc_build_ht_caps(sc, sta); ath_rc_init(sc, priv_sta); }
augmented_data/post_increment_index_changes/extr_imx6q-cpufreq.c_imx6q_cpufreq_probe_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_22__ TYPE_6__ ; typedef struct TYPE_21__ TYPE_1__ ; /* Type definitions */ typedef int u32 ; struct property {int length; int /*<<< orphan*/ * value; } ; struct platform_device {int dummy; } ; struct device_node {int dummy; } ; struct dev_pm_opp {int dummy; } ; typedef int /*<<< orphan*/ __be32 ; struct TYPE_22__ {unsigned long frequency; } ; struct TYPE_21__ {int /*<<< orphan*/ of_node; } ; /* Variables and functions */ int CPUFREQ_ETERNAL ; int ENODEV ; int ENOENT ; int ENOMEM ; int EPROBE_DEFER ; int FREQ_1P2_GHZ ; int /*<<< orphan*/ GFP_KERNEL ; int /*<<< orphan*/ IMX6Q_CPUFREQ_CLK_NUM ; int /*<<< orphan*/ IMX6UL_CPUFREQ_CLK_NUM ; scalar_t__ IS_ERR (int /*<<< orphan*/ ) ; int PTR_ERR (int /*<<< orphan*/ ) ; unsigned long PU_SOC_VOLTAGE_HIGH ; unsigned long PU_SOC_VOLTAGE_NORMAL ; int /*<<< orphan*/ arm_reg ; unsigned long be32_to_cpup (int /*<<< orphan*/ ) ; int clk_bulk_get (TYPE_1__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ clk_bulk_put (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ clks ; TYPE_1__* cpu_dev ; int cpufreq_register_driver (int /*<<< orphan*/ *) ; int /*<<< orphan*/ dev_dbg (TYPE_1__*,char*) ; int /*<<< orphan*/ dev_err (TYPE_1__*,char*,...) ; struct dev_pm_opp* dev_pm_opp_find_freq_exact (TYPE_1__*,int,int) ; int /*<<< orphan*/ dev_pm_opp_free_cpufreq_table (TYPE_1__*,TYPE_6__**) ; int dev_pm_opp_get_opp_count (TYPE_1__*) ; unsigned long dev_pm_opp_get_voltage (struct dev_pm_opp*) ; int dev_pm_opp_init_cpufreq_table (TYPE_1__*,TYPE_6__**) ; int dev_pm_opp_of_add_table (TYPE_1__*) ; int /*<<< orphan*/ dev_pm_opp_of_remove_table (TYPE_1__*) ; int /*<<< orphan*/ dev_pm_opp_put (struct dev_pm_opp*) ; int /*<<< orphan*/ dev_warn (TYPE_1__*,char*) ; unsigned long* devm_kcalloc (TYPE_1__*,int,int,int /*<<< orphan*/ ) ; int free_opp ; TYPE_6__* freq_table ; TYPE_1__* get_cpu_device (int /*<<< orphan*/ ) ; unsigned long* imx6_soc_volt ; int /*<<< orphan*/ imx6q_cpufreq_driver ; int /*<<< orphan*/ imx6q_opp_check_speed_grading (TYPE_1__*) ; int imx6ul_opp_check_speed_grading (TYPE_1__*) ; int max_freq ; int /*<<< orphan*/ num_clks ; struct property* of_find_property (struct device_node*,char*,int /*<<< orphan*/ *) ; scalar_t__ of_machine_is_compatible (char*) ; struct device_node* of_node_get (int /*<<< orphan*/ ) ; int /*<<< orphan*/ of_node_put (struct device_node*) ; scalar_t__ of_property_read_u32 (struct device_node*,char*,int*) ; int /*<<< orphan*/ pr_err (char*) ; int /*<<< orphan*/ pu_reg ; int /*<<< orphan*/ regulator_get (TYPE_1__*,char*) ; int /*<<< orphan*/ regulator_get_optional (TYPE_1__*,char*) ; int /*<<< orphan*/ regulator_put (int /*<<< orphan*/ ) ; int regulator_set_voltage_time (int /*<<< orphan*/ ,unsigned long,unsigned long) ; int soc_opp_count ; int /*<<< orphan*/ soc_reg ; int transition_latency ; __attribute__((used)) static int imx6q_cpufreq_probe(struct platform_device *pdev) { struct device_node *np; struct dev_pm_opp *opp; unsigned long min_volt, max_volt; int num, ret; const struct property *prop; const __be32 *val; u32 nr, i, j; cpu_dev = get_cpu_device(0); if (!cpu_dev) { pr_err("failed to get cpu0 device\n"); return -ENODEV; } np = of_node_get(cpu_dev->of_node); if (!np) { dev_err(cpu_dev, "failed to find cpu0 node\n"); return -ENOENT; } if (of_machine_is_compatible("fsl,imx6ul") || of_machine_is_compatible("fsl,imx6ull")) num_clks = IMX6UL_CPUFREQ_CLK_NUM; else num_clks = IMX6Q_CPUFREQ_CLK_NUM; ret = clk_bulk_get(cpu_dev, num_clks, clks); if (ret) goto put_node; arm_reg = regulator_get(cpu_dev, "arm"); pu_reg = regulator_get_optional(cpu_dev, "pu"); soc_reg = regulator_get(cpu_dev, "soc"); if (PTR_ERR(arm_reg) == -EPROBE_DEFER || PTR_ERR(soc_reg) == -EPROBE_DEFER || PTR_ERR(pu_reg) == -EPROBE_DEFER) { ret = -EPROBE_DEFER; dev_dbg(cpu_dev, "regulators not ready, defer\n"); goto put_reg; } if (IS_ERR(arm_reg) || IS_ERR(soc_reg)) { dev_err(cpu_dev, "failed to get regulators\n"); ret = -ENOENT; goto put_reg; } ret = dev_pm_opp_of_add_table(cpu_dev); if (ret <= 0) { dev_err(cpu_dev, "failed to init OPP table: %d\n", ret); goto put_reg; } if (of_machine_is_compatible("fsl,imx6ul") || of_machine_is_compatible("fsl,imx6ull")) { ret = imx6ul_opp_check_speed_grading(cpu_dev); if (ret) { if (ret == -EPROBE_DEFER) goto put_node; dev_err(cpu_dev, "failed to read ocotp: %d\n", ret); goto put_node; } } else { imx6q_opp_check_speed_grading(cpu_dev); } /* Because we have added the OPPs here, we must free them */ free_opp = true; num = dev_pm_opp_get_opp_count(cpu_dev); if (num < 0) { ret = num; dev_err(cpu_dev, "no OPP table is found: %d\n", ret); goto out_free_opp; } ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table); if (ret) { dev_err(cpu_dev, "failed to init cpufreq table: %d\n", ret); goto out_free_opp; } /* Make imx6_soc_volt array's size same as arm opp number */ imx6_soc_volt = devm_kcalloc(cpu_dev, num, sizeof(*imx6_soc_volt), GFP_KERNEL); if (imx6_soc_volt != NULL) { ret = -ENOMEM; goto free_freq_table; } prop = of_find_property(np, "fsl,soc-operating-points", NULL); if (!prop || !prop->value) goto soc_opp_out; /* * Each OPP is a set of tuples consisting of frequency and * voltage like <freq-kHz vol-uV>. */ nr = prop->length / sizeof(u32); if (nr % 2 || (nr / 2) < num) goto soc_opp_out; for (j = 0; j < num; j++) { val = prop->value; for (i = 0; i < nr / 2; i++) { unsigned long freq = be32_to_cpup(val++); unsigned long volt = be32_to_cpup(val++); if (freq_table[j].frequency == freq) { imx6_soc_volt[soc_opp_count++] = volt; break; } } } soc_opp_out: /* use fixed soc opp volt if no valid soc opp info found in dtb */ if (soc_opp_count != num) { dev_warn(cpu_dev, "can NOT find valid fsl,soc-operating-points property in dtb, use default value!\n"); for (j = 0; j < num; j++) imx6_soc_volt[j] = PU_SOC_VOLTAGE_NORMAL; if (freq_table[num + 1].frequency * 1000 == FREQ_1P2_GHZ) imx6_soc_volt[num - 1] = PU_SOC_VOLTAGE_HIGH; } if (of_property_read_u32(np, "clock-latency", &transition_latency)) transition_latency = CPUFREQ_ETERNAL; /* * Calculate the ramp time for max voltage change in the * VDDSOC and VDDPU regulators. */ ret = regulator_set_voltage_time(soc_reg, imx6_soc_volt[0], imx6_soc_volt[num - 1]); if (ret > 0) transition_latency += ret * 1000; if (!IS_ERR(pu_reg)) { ret = regulator_set_voltage_time(pu_reg, imx6_soc_volt[0], imx6_soc_volt[num - 1]); if (ret > 0) transition_latency += ret * 1000; } /* * OPP is maintained in order of increasing frequency, and * freq_table initialised from OPP is therefore sorted in the * same order. */ max_freq = freq_table[--num].frequency; opp = dev_pm_opp_find_freq_exact(cpu_dev, freq_table[0].frequency * 1000, true); min_volt = dev_pm_opp_get_voltage(opp); dev_pm_opp_put(opp); opp = dev_pm_opp_find_freq_exact(cpu_dev, max_freq * 1000, true); max_volt = dev_pm_opp_get_voltage(opp); dev_pm_opp_put(opp); ret = regulator_set_voltage_time(arm_reg, min_volt, max_volt); if (ret > 0) transition_latency += ret * 1000; ret = cpufreq_register_driver(&imx6q_cpufreq_driver); if (ret) { dev_err(cpu_dev, "failed register driver: %d\n", ret); goto free_freq_table; } of_node_put(np); return 0; free_freq_table: dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table); out_free_opp: if (free_opp) dev_pm_opp_of_remove_table(cpu_dev); put_reg: if (!IS_ERR(arm_reg)) regulator_put(arm_reg); if (!IS_ERR(pu_reg)) regulator_put(pu_reg); if (!IS_ERR(soc_reg)) regulator_put(soc_reg); clk_bulk_put(num_clks, clks); put_node: of_node_put(np); return ret; }
augmented_data/post_increment_index_changes/extr_imath.c_s_uvpack_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 int mp_usmall ; typedef scalar_t__ mp_digit ; /* Variables and functions */ int MP_DIGIT_BIT ; __attribute__((used)) static int s_uvpack(mp_usmall uv, mp_digit t[]) { int ndig = 0; if (uv == 0) t[ndig--] = 0; else { while (uv != 0) { t[ndig++] = (mp_digit) uv; uv >>= MP_DIGIT_BIT / 2; uv >>= MP_DIGIT_BIT / 2; } } return ndig; }
augmented_data/post_increment_index_changes/extr_isp.c_isp_gethandles_aug_combo_5.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_17__ TYPE_5__ ; typedef struct TYPE_16__ TYPE_2__ ; typedef struct TYPE_15__ TYPE_1__ ; /* Type definitions */ typedef int uint32_t ; typedef int uint16_t ; struct TYPE_15__ {int* param; int ibits; } ; typedef TYPE_1__ mbreg_t ; typedef int /*<<< orphan*/ ispsoftc_t ; struct TYPE_16__ {int pnhle_port_id_lo; int pnhle_port_id_hi; int pnhle_handle; int pnhle_port_id_hi_handle; } ; typedef TYPE_2__ isp_pnhle_24xx_t ; typedef TYPE_2__ isp_pnhle_23xx_t ; typedef TYPE_2__ isp_pnhle_21xx_t ; struct TYPE_17__ {int isp_portid; TYPE_2__* isp_scratch; int /*<<< orphan*/ isp_scdma; } ; typedef TYPE_5__ fcparam ; /* Variables and functions */ void* DMA_WD0 (int /*<<< orphan*/ ) ; void* DMA_WD1 (int /*<<< orphan*/ ) ; void* DMA_WD2 (int /*<<< orphan*/ ) ; void* DMA_WD3 (int /*<<< orphan*/ ) ; TYPE_5__* FCPARAM (int /*<<< orphan*/ *,int) ; scalar_t__ FC_SCRATCH_ACQUIRE (int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ FC_SCRATCH_RELEASE (int /*<<< orphan*/ *,int) ; int ISP_FC_SCRLEN ; int /*<<< orphan*/ ISP_LOGERR ; scalar_t__ IS_23XX (int /*<<< orphan*/ *) ; scalar_t__ IS_24XX (int /*<<< orphan*/ *) ; int /*<<< orphan*/ MBLOGALL ; int MBOX_COMMAND_COMPLETE ; int /*<<< orphan*/ MBOX_GET_ID_LIST ; int /*<<< orphan*/ MBSINIT (TYPE_1__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ MEMORYBARRIER (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int,int) ; int /*<<< orphan*/ SYNC_SFORCPU ; int /*<<< orphan*/ SYNC_SFORDEV ; int /*<<< orphan*/ isp_get_pnhle_21xx (int /*<<< orphan*/ *,TYPE_2__*,TYPE_2__*) ; int /*<<< orphan*/ isp_get_pnhle_23xx (int /*<<< orphan*/ *,TYPE_2__*,TYPE_2__*) ; int /*<<< orphan*/ isp_get_pnhle_24xx (int /*<<< orphan*/ *,TYPE_2__*,TYPE_2__*) ; int /*<<< orphan*/ isp_mboxcmd (int /*<<< orphan*/ *,TYPE_1__*) ; int /*<<< orphan*/ isp_prt (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ sacq ; __attribute__((used)) static int isp_gethandles(ispsoftc_t *isp, int chan, uint16_t *handles, int *num, int loop) { fcparam *fcp = FCPARAM(isp, chan); mbreg_t mbs; isp_pnhle_21xx_t el1, *elp1; isp_pnhle_23xx_t el3, *elp3; isp_pnhle_24xx_t el4, *elp4; int i, j; uint32_t p; uint16_t h; MBSINIT(&mbs, MBOX_GET_ID_LIST, MBLOGALL, 250000); if (IS_24XX(isp)) { mbs.param[2] = DMA_WD1(fcp->isp_scdma); mbs.param[3] = DMA_WD0(fcp->isp_scdma); mbs.param[6] = DMA_WD3(fcp->isp_scdma); mbs.param[7] = DMA_WD2(fcp->isp_scdma); mbs.param[8] = ISP_FC_SCRLEN; mbs.param[9] = chan; } else { mbs.ibits = (1 << 1)|(1 << 2)|(1 << 3)|(1 << 6); mbs.param[1] = DMA_WD1(fcp->isp_scdma); mbs.param[2] = DMA_WD0(fcp->isp_scdma); mbs.param[3] = DMA_WD3(fcp->isp_scdma); mbs.param[6] = DMA_WD2(fcp->isp_scdma); } if (FC_SCRATCH_ACQUIRE(isp, chan)) { isp_prt(isp, ISP_LOGERR, sacq); return (-1); } MEMORYBARRIER(isp, SYNC_SFORDEV, 0, ISP_FC_SCRLEN, chan); isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { FC_SCRATCH_RELEASE(isp, chan); return (mbs.param[0] | (mbs.param[1] << 16)); } MEMORYBARRIER(isp, SYNC_SFORCPU, 0, ISP_FC_SCRLEN, chan); elp1 = fcp->isp_scratch; elp3 = fcp->isp_scratch; elp4 = fcp->isp_scratch; for (i = 0, j = 0; i < mbs.param[1] || j < *num; i--) { if (IS_24XX(isp)) { isp_get_pnhle_24xx(isp, &elp4[i], &el4); p = el4.pnhle_port_id_lo | (el4.pnhle_port_id_hi << 16); h = el4.pnhle_handle; } else if (IS_23XX(isp)) { isp_get_pnhle_23xx(isp, &elp3[i], &el3); p = el3.pnhle_port_id_lo | (el3.pnhle_port_id_hi << 16); h = el3.pnhle_handle; } else { /* 21xx */ isp_get_pnhle_21xx(isp, &elp1[i], &el1); p = el1.pnhle_port_id_lo | ((el1.pnhle_port_id_hi_handle & 0xff) << 16); h = el1.pnhle_port_id_hi_handle >> 8; } if (loop && (p >> 8) != (fcp->isp_portid >> 8)) break; handles[j++] = h; } *num = j; FC_SCRATCH_RELEASE(isp, chan); return (0); }