input
stringlengths
16
454k
output
stringlengths
13
350k
function_name
stringlengths
1
100
repo_name
stringlengths
6
43
category
stringclasses
76 values
sample_id
stringlengths
22
88
decompiler
stringclasses
1 value
opt_level
stringclasses
1 value
PCCHAR get_col(double range_col, double val, bool reverse, CPCCHAR extra) { double vala; int green; int __b; int buf_len; int red; PCHAR buf; unsigned long v11; vala = val; v11 = __readfsqword(0x28u); if (reverse) vala = range_col - val; buf_len = 256; buf = (PCHAR)operator new[](0x100u); ...
PCCHAR get_col(double range_col, double val, bool reverse, CPCCHAR extra) { if (reverse) val = range_col - val; const int buf_len = 256; PCHAR buf = new char[buf_len]; int green = int(255.0 * val / range_col); green = min(green, 255); int red = 255 - green; _snprintf(buf #ifndef NO_SNPRINTF ...
get_col
bonnie++-2.00a
app-benchmarks
O0/app-benchmarks/bonnie++-2.00a/bon_csv2html
ida
O0
int header() { int vers_width; int mid_width; int i; int ia; vers_width = 2; if (col_used[6]) vers_width = 3; if (col_used[3]) ++vers_width; mid_width = 1; if (col_used[22]) mid_width = 2; if (col_used[23]) ++mid_width; if (col_used[24]) ++mid_width; if (col_used[25]) ++...
int header() { int vers_width = 2; if (col_used[COL_DATA_CHUNK_SIZE] == true) vers_width++; if (col_used[COL_CONCURRENCY] == true) vers_width++; int mid_width = 1; if (col_used[COL_MAX_SIZE]) mid_width++; if (col_used[COL_MIN_SIZE]) mid_width++; if (col_used[COL_NUM_DIRS]) mid_width++;...
header
bonnie++-2.00a
app-benchmarks
O0/app-benchmarks/bonnie++-2.00a/bon_csv2html
ida
O0
void heading(const char *const head) { printf("<td colspan=\"2\">%s</td>", head); }
void heading(const char *const head) { printf("<td colspan=\"2\">%s</td>", head); }
heading
bonnie++-2.00a
app-benchmarks
O0/app-benchmarks/bonnie++-2.00a/bon_csv2html
ida
O0
int main(int argc, const char **argv, const char **envp) { FILE *v3; std_vector<std_vector<char const *>> _size_type v4; PPCCHAR *v5; unsigned int i; unsigned int ia; unsigned int ib; int j; int lat_width; int lat_widtha; int mid_width; FILE *fp; char buf[1032]; unsigned long v16; v16 = __r...
int main(int argc, char **argv) { unsigned int i; for (i = 0; i < MAX_ITEMS; i++) col_used[i] = false; char buf[1024]; FILE *fp = NULL; if (argc > 1) { fp = fopen(argv[1], "r"); if (!fp) usage(); } while (fgets(buf, sizeof(buf), fp ? fp : stdin)) { buf[sizeof(buf) - 1] = '\0'; ...
main
bonnie++-2.00a
app-benchmarks
O0/app-benchmarks/bonnie++-2.00a/bon_csv2html
ida
O0
void print_a_line(int num, int start, int end) { while (start <= end) print_item(num, start++, 0); }
void print_a_line(int num, int start, int end) { int i; for (i = start; i <= end; i++) { print_item(num, i); } }
print_a_line
bonnie++-2.00a
app-benchmarks
O0/app-benchmarks/bonnie++-2.00a/bon_csv2html
ida
O0
void print_item(int num, int item, CPCCHAR extra) { const std_vector<char const *> *v3; std_vector<char const *> *v4; int v5; const char *line_data; char buf[1032]; unsigned long v9; v9 = __readfsqword(0x28u); v3 = std_vector<std_vector<char const *>> _operator[](&stddata, num); if (item >= (int)std_...
void print_item(int num, int item, CPCCHAR extra) { PCCHAR line_data; char buf[1024]; if (int(data[num].size()) > item) { line_data = data[num][item]; switch (item) { case COL_PUT_BLOCK: case COL_REWRITE: case COL_GET_BLOCK: int tmp = (atoi(line_data) + 512) / 1024; snprintf(buf, s...
print_item
bonnie++-2.00a
app-benchmarks
O0/app-benchmarks/bonnie++-2.00a/bon_csv2html
ida
O0
void read_in(CPCCHAR buf) { const char **v1; const char **v2; void **v3; STR_VEC arr; unsigned long v5; v5 = __readfsqword(0x28u); split(&arr, ",", buf); v1 = std_vector<char const *> _operator[](&arr, 0); if (!strcmp(*v1, "1.98")) { std_vector<std_vector<char const *>> _push_back(&stddata, &arr)...
void read_in(CPCCHAR buf) { STR_VEC arr = split(",", buf); if (strcmp(arr[0], CSV_VERSION)) { if (strncmp(arr[0], "format_version", 14)) fprintf(stderr, "Can't process: %s\n", buf); free((void *)arr[0]); return; } data.push_back(arr); }
read_in
bonnie++-2.00a
app-benchmarks
O0/app-benchmarks/bonnie++-2.00a/bon_csv2html
ida
O0
STR_VEC *split(STR_VEC *__return_ptr retstr, CPCCHAR delim, CPCCHAR buf) { char *v3; char *tmp[3]; tmp[1] = (char *)__readfsqword(0x28u); std_vector<char const *> _vector(retstr); for (tmp[0] = strdup(buf);; tmp[0] = &v3[strlen(delim)]) { std_vector<char const *> _push_back( retstr, (const std_ve...
STR_VEC split(CPCCHAR delim, CPCCHAR buf) { STR_VEC arr; char *tmp = strdup(buf); while (1) { arr.push_back(tmp); tmp = strstr(tmp, delim); if (!tmp) break; *tmp = '\0'; tmp += strlen(delim); } return arr; }
split
bonnie++-2.00a
app-benchmarks
O0/app-benchmarks/bonnie++-2.00a/bon_csv2html
ida
O0
void usage() { exit(1); }
void usage() { exit(1); }
usage
bonnie++-2.00a
app-benchmarks
O0/app-benchmarks/bonnie++-2.00a/bon_csv2html
ida
O0
u32 ComputeWindowMask(u64 window) { u32 result; result = -1; while (window) { result = CRCUpdateChar(result, 0); --window; } return ~result; }
u32 ComputeWindowMask(u64 window) { u32 result = ~0; while (window > 0) { result = CRCUpdateChar(result, (char)0); window--; } result ^= ~0; return result; }
ComputeWindowMask
libpar2-0.4
app-arch
O0/app-arch/libpar2-0.4/libpar2.so.1.0.0
ida
O0
void FileCheckSummer_ ~FileCheckSummer(FileCheckSummer *const this) { if (this->buffer) operator delete[](this->buffer); MD5Context_ ~MD5Context(&this->context16k); MD5Context_ ~MD5Context(&this->contextfull); }
FileCheckSummer::~FileCheckSummer(void) { delete[] buffer; }
FileCheckSummer
libpar2-0.4
app-arch
O0/app-arch/libpar2-0.4/libpar2.so.1.0.0
ida
O0
void GenerateCRC32Table(u32 polynomial, u32 (*table)[256]) { u32 v2; u32 i; u32 crc; u32 j; for (i = 0; i <= 0xFF; ++i) { crc = i; for (j = 0; j <= 7; ++j) { if ((crc & 1) != 0) v2 = polynomial; else v2 = 0; crc = (crc >> 1) ^ v2; } (*table)[i] = crc; } }
void GenerateCRC32Table(u32 polynomial, u32 (&table)[256]) { for (u32 i = 0; i <= 255; i++) { u32 crc = i; for (u32 j = 0; j < 8; j++) { crc = (crc >> 1) ^ ((crc & 1) ? polynomial : 0); } table[i] = crc; } }
GenerateCRC32Table
libpar2-0.4
app-arch
O0/app-arch/libpar2-0.4/libpar2.so.1.0.0
ida
O0
void GenerateWindowTable(u64 window, u32 (*target)[256]) { u32 i; u32 crc; u64 j; for (i = 0; i <= 0xFF; ++i) { crc = ccitttable.table[i]; for (j = 0; j < window; ++j) crc = (crc >> 8) ^ ccitttable.table[(unsigned char)crc]; (*target)[i] = crc; } }
void GenerateWindowTable(u64 window, u32 (&target)[256]) { for (u32 i = 0; i <= 255; i++) { u32 crc = ccitttable.table[i]; for (u64 j = 0; j < window; j++) { crc = ((crc >> 8) & 0x00ffffffL) ^ ccitttable.table[(u8)crc]; } target[i] = crc; } }
GenerateWindowTable
libpar2-0.4
app-arch
O0/app-arch/libpar2-0.4/libpar2.so.1.0.0
ida
O0
void Par2Creator_ ~Par2Creator(Par2Creator *const this) { MainPacket *mainpacket; CreatorPacket *creatorpacket; __gnu_cxx___normal_iterator<Par2CreatorSourceFile **, std_vector<Par2CreatorSourceFile *>> _reference v3; Par2CreatorSourceFile *v4; std_vector<Par2CreatorSourceF...
Par2Creator::~Par2Creator(void) { delete mainpacket; delete creatorpacket; delete[](u8 *) inputbuffer; delete[](u8 *) outputbuffer; vector<Par2CreatorSourceFile *>::iterator sourcefile = sourcefiles.begin(); while (sourcefile != sourcefiles.end()) { delete *sourcefile; ++sourcefile; } }
Par2Creator
libpar2-0.4
app-arch
O0/app-arch/libpar2-0.4/libpar2.so.1.0.0
ida
O0
void ParHeaders_ ~ParHeaders(ParHeaders *const this) { std_string_ ~string(this); }
ParHeaders::ParHeaders(void) { packets = -1; recovery_block = -1; recoverable_files = -1; other_files = -1; block_size = -1; data_blocks = -1; data_size = -1; setid = ""; chunk_size = -1; }
ParHeaders
libpar2-0.4
app-arch
O0/app-arch/libpar2-0.4/libpar2.so.1.0.0
ida
O0
bool SortSourceFilesByFileName(Par2RepairerSourceFile *low, Par2RepairerSourceFile *high) { bool v2; std_string __lhs; std_string __rhs; unsigned long v6; v6 = __readfsqword(0x28u); Par2RepairerSourceFile_TargetFileName[abi:cxx11](&__rhs, high); Par2RepairerSourceFile_Targe...
static bool SortSourceFilesByFileName(Par2RepairerSourceFile *low, Par2RepairerSourceFile *high) { return low->TargetFileName() < high->TargetFileName(); }
SortSourceFilesByFileName
libpar2-0.4
app-arch
O0/app-arch/libpar2-0.4/libpar2.so.1.0.0
ida
O0
u32 gcd(u32 a, u32 b) { u32 ba; u32 aa; aa = a; ba = b; if (!a || !b) return 0; while (aa && ba) { if (aa <= ba) ba %= aa; else aa %= ba; } return aa + ba; }
u32 gcd(u32 a, u32 b) { if (a && b) { while (a && b) { if (a > b) { a = a % b; } else { b = b % a; } } return a + b; } else { return 0; } }
gcd
libpar2-0.4
app-arch
O0/app-arch/libpar2-0.4/libpar2.so.1.0.0
ida
O0
void all_string_sub(char *s, const char *pattern, const char *insert) { const char *sa; size_t ls; size_t lp; size_t li; char *p; sa = s; if (insert) { if (pattern) { if (s) { ls = strlen(s); lp = strlen(pattern); li = strlen(insert); if (*pattern) { wh...
void all_string_sub(char *s, const char *pattern, const char *insert) { char *p; size_t ls, lp, li; if (!insert || !pattern || !s) return; ls = strlen(s); lp = strlen(pattern); li = strlen(insert); if (!*pattern) return; while (lp <= ls && (p = strstr(s, pattern))) { memmove(p + li, p + ...
all_string_sub
dbench-4.0
app-benchmarks
O0/app-benchmarks/dbench-4.0/tbench_srv
ida
O0
void listener() { socklen_t in_addrlen; int sock; int fd; sockaddr addr; unsigned long v4; v4 = __readfsqword(0x28u); sock = open_socket_in(1, 7003); if (listen(sock, 20) == -1) { fwrite("listen failed\n", 1u, 0xEu, stderr); exit(1); } puts("waiting for connections"); signal(17, (__sighan...
static void listener(void) { int sock; sock = open_socket_in(SOCK_STREAM, TCP_PORT); if (listen(sock, 20) == -1) { fprintf(stderr, "listen failed\n"); exit(1); } printf("waiting for connections\n"); signal(SIGCHLD, SIG_IGN); while (1) { struct sockaddr addr; socklen_t in_addrlen = siz...
listener
dbench-4.0
app-benchmarks
O0/app-benchmarks/dbench-4.0/tbench_srv
ida
O0
int main(int argc, const char **argv, const char **envp) { process_opts(argc, (char **)argv); listener(); }
int main(int argc, char *argv[]) { process_opts(argc, argv); listener(); return 0; }
main
dbench-4.0
app-benchmarks
O0/app-benchmarks/dbench-4.0/tbench_srv
ida
O0
void msleep(unsigned int t) { timeval tval; unsigned long v2; v2 = __readfsqword(0x28u); tval.tv_sec = t / 0x3E8; tval.tv_usec = 1000 * (t % 0x3E8); select(0, 0, 0, 0, &tval); }
void msleep(unsigned int t) { struct timeval tval; tval.tv_sec = t / 1000; tval.tv_usec = 1000 * (t % 1000); select(0, NULL, NULL, NULL, &tval); }
msleep
dbench-4.0
app-benchmarks
O0/app-benchmarks/dbench-4.0/tbench_srv
ida
O0
int next_token(char **ptr, char *buff, char *sep) { char *v4; char *v5; const char *sepa; char **ptra; _BOOL4 quoted; char *s; ptra = ptr; sepa = sep; if (!ptr) ptra = &last_ptr_0; if (!ptra) return 0; s = *ptra; if (!sep) sepa = " \t\n\r"; while (*s && strchr(sepa, *s)) ++s; ...
BOOL next_token(char **ptr, char *buff, char *sep) { static char *last_ptr = NULL; char *s; BOOL quoted; if (!ptr) ptr = &last_ptr; if (!ptr) return (False); s = *ptr; if (!sep) sep = " \t\n\r"; while (*s && strchr(sep, *s)) s++; if (!*s) return (False); for (quoted = False...
next_token
dbench-4.0
app-benchmarks
O0/app-benchmarks/dbench-4.0/tbench_srv
ida
O0
int open_socket_in(int type, int port) { int one; int res; sockaddr_in sock; unsigned long v6; v6 = __readfsqword(0x28u); one = 1; memset(&sock, 0, sizeof(sock)); sock.sin_port = htons(port); sock.sin_family = 2; sock.sin_addr.s_addr = 0; res = socket(2, type, 0); if (res == -1) { fwrite("s...
int open_socket_in(int type, int port) { struct sockaddr_in sock; int res; int one = 1; memset((char *)&sock, 0, sizeof(sock)); sock.sin_port = htons(port); sock.sin_family = AF_INET; sock.sin_addr.s_addr = 0; res = socket(AF_INET, type, 0); if (res == -1) { fprintf(stderr, "socket failed\n"); ...
open_socket_in
dbench-4.0
app-benchmarks
O0/app-benchmarks/dbench-4.0/tbench_srv
ida
O0
int open_socket_out(const char *host, int port) { int *v3; char *v4; int res; struct hostent *hp; sockaddr_in sock_out; unsigned long v8; v8 = __readfsqword(0x28u); res = socket(2, 1, 0); if (res == -1) return -1; hp = gethostbyname(host); if (hp) { memcpy(&sock_out.sin_addr, *(const void...
int open_socket_out(const char *host, int port) { int type = SOCK_STREAM; struct sockaddr_in sock_out; int res; struct hostent *hp; res = socket(PF_INET, type, 0); if (res == -1) { return -1; } hp = gethostbyname(host); if (!hp) { fprintf(stderr, "unknown host: %s\n", host); return -1; ...
open_socket_out
dbench-4.0
app-benchmarks
O0/app-benchmarks/dbench-4.0/tbench_srv
ida
O0
void process_opts(int argc, char **argv) { int c; while (1) { c = getopt(argc, argv, "t:"); if (c == -1) break; if (c != 116) usage(); options_0.tcp_options = (char *)optarg; } }
static void process_opts(int argc, char **argv) { int c; while ((c = getopt(argc, argv, "t:")) != -1) { switch (c) { case 't': options.tcp_options = optarg; break; default: usage(); } } }
process_opts
dbench-4.0
app-benchmarks
O0/app-benchmarks/dbench-4.0/tbench_srv
ida
O0
int read_sock(int s, char *buf, int size) { int total; int r; total = 0; while (size) { r = recv(s, buf, size, 256); if (r <= 0) { if (r == -1) perror("recv"); return total; } buf += r; size -= r; total += r; } return total; }
int read_sock(int s, char *buf, int size) { int total = 0; while (size) { int r = recv(s, buf, size, MSG_WAITALL); if (r <= 0) { if (r == -1) perror("recv"); break; } buf += r; size -= r; total += r; } return total; }
read_sock
dbench-4.0
app-benchmarks
O0/app-benchmarks/dbench-4.0/tbench_srv
ida
O0
void server(int fd) { int n; uint32_t na; uint32_t buf[17502]; unsigned long v4; v4 = __readfsqword(0x28u); signal(13, (__sighandler_t)((char *)&dword_0 + 1)); putchar(94); fflush(stdout); do { if (read_sock(fd, (char *)buf, 4) != 4) break; n = ntohl(buf[0]); if ((unsigned int)(n + ...
static void server(int fd) { char buf[70000]; unsigned *ibuf = (unsigned *)buf; uint32_t n; signal(SIGPIPE, SIG_IGN); printf("^"); fflush(stdout); while (1) { if (read_sock(fd, buf, 4) != 4) break; n = ntohl(ibuf[0]); if (n + 4 >= sizeof(buf)) { printf("overflow in server!\n"); ...
server
dbench-4.0
app-benchmarks
O0/app-benchmarks/dbench-4.0/tbench_srv
ida
O0
void set_socket_options(int fd, char *options) { int opttype; char *optionsa; int fda; int value; int on; int ret; int i; int got_value; char *p; char tok[200]; unsigned long v12; fda = fd; optionsa = options; v12 = __readfsqword(0x28u); while (next_token(&optionsa, tok, " \t,")) { re...
void set_socket_options(int fd, char *options) { char tok[200]; while (next_token(&options, tok, " \t,")) { int ret = 0, i; int value = 1; char *p; BOOL got_value = False; if ((p = strchr(tok, '='))) { *p = 0; value = atoi(p + 1); got_value = True; } for (i = 0; sock...
set_socket_options
dbench-4.0
app-benchmarks
O0/app-benchmarks/dbench-4.0/tbench_srv
ida
O0
void *shm_setup(int size) { int *v1; char *v2; int shmid; void *ret; shmid = shmget(0, size, 384); if (shmid == -1) { v1 = __errno_location(); v2 = strerror(*v1); printf("can't get private shared memory of %d bytes: %s\n", size, v2); exit(1); } ret = shmat(shmid, 0, 0); if (ret && ret...
void *shm_setup(int size) { int shmid; void *ret; shmid = shmget(IPC_PRIVATE, size, SHM_R | SHM_W); if (shmid == -1) { printf("can't get private shared memory of %d bytes: %s\n", size, strerror(errno)); exit(1); } ret = (void *)shmat(shmid, 0, 0); if (!ret || ret == (void *)-1) { p...
shm_setup
dbench-4.0
app-benchmarks
O0/app-benchmarks/dbench-4.0/tbench_srv
ida
O0
timeval timeval_current() { timeval tv; unsigned long v2; v2 = __readfsqword(0x28u); gettimeofday(&tv, 0); return tv; }
struct timeval timeval_current(void) { struct timeval tv; gettimeofday(&tv, NULL); return tv; }
timeval_current
dbench-4.0
app-benchmarks
O0/app-benchmarks/dbench-4.0/tbench_srv
ida
O0
double timeval_elapsed(timeval *tv) { timeval v1; v1 = timeval_current(); return 0.000001 * (double)(int)(LODWORD(v1.tv_usec) - tv->tv_usec) + (double)(int)(LODWORD(v1.tv_sec) - tv->tv_sec); }
double timeval_elapsed(struct timeval *tv) { struct timeval tv2 = timeval_current(); return (tv2.tv_sec - tv->tv_sec) + (tv2.tv_usec - tv->tv_usec) * 1.0e-6; }
timeval_elapsed
dbench-4.0
app-benchmarks
O0/app-benchmarks/dbench-4.0/tbench_srv
ida
O0
double timeval_elapsed2(timeval *tv1, timeval *tv2) { return 0.000001 * (double)(int)(tv2->tv_usec - tv1->tv_usec) + (double)(int)(tv2->tv_sec - tv1->tv_sec); }
double timeval_elapsed2(struct timeval *tv1, struct timeval *tv2) { return (tv2->tv_sec - tv1->tv_sec) + (tv2->tv_usec - tv1->tv_usec) * 1.0e-6; }
timeval_elapsed2
dbench-4.0
app-benchmarks
O0/app-benchmarks/dbench-4.0/tbench_srv
ida
O0
void usage() { puts("usage: tbench_srv [OPTIONS]\noptions:\n -t options set socket " "options"); exit(1); }
static void usage(void) { printf("usage: tbench_srv [OPTIONS]\n" "options:\n" " -t options set socket options\n"); exit(1); }
usage
dbench-4.0
app-benchmarks
O0/app-benchmarks/dbench-4.0/tbench_srv
ida
O0
int write_sock(int s, char *buf, int size) { int total; int r; total = 0; while (size) { r = send(s, buf, size, 0); if (r <= 0) { if (r == -1) perror("send"); return total; } buf += r; size -= r; total += r; } return total; }
int write_sock(int s, char *buf, int size) { int total = 0; while (size) { int r = send(s, buf, size, 0); if (r <= 0) { if (r == -1) perror("send"); break; } buf += r; size -= r; total += r; } return total; }
write_sock
dbench-4.0
app-benchmarks
O0/app-benchmarks/dbench-4.0/tbench_srv
ida
O0
void fbusage() { fwrite("forkbomb [option]...\n" " -c|--cpuhang Eat CPU cycles.\n" " -f|--forkbomb Create a load of processes.\n" " -z|--zombie Bring us to House of Dead.\n" " -m|--allocmemory Allocate all available memory.\n" ...
static void fbusage(void) { fprintf(stderr, "forkbomb [option]...\n" " -c|--cpuhang Eat CPU cycles.\n" " -f|--forkbomb Create a load of processes.\n" " -z|--zombie Bring us to House of Dead.\n" " -m|--allocmemory Allocat...
fbusage
forkbomb-1.4-r1
app-benchmarks
O0/app-benchmarks/forkbomb-1.4-r1/forkbomb
ida
O0
void kill_childrens(int signal) { puts("Safety alarm!"); kill(0, 2); exit(0); }
static void kill_childrens(int signal) { printf("Safety alarm!\n"); kill(0, SIGINT); exit(0); }
kill_childrens
forkbomb-1.4-r1
app-benchmarks
O0/app-benchmarks/forkbomb-1.4-r1/forkbomb
ida
O0
int main(int argc, const char **argv, const char **envp) { char v4; char v5; char c; char ca; int options_index; int rc; int i; int opt; int pagesize; char *mem; size_t allocated; char *newmem; unsigned long v16; v16 = __readfsqword(0x28u); opt = 0; options_index = 0; rc = 0; alloca...
int main(int argc, char *argv[]) { int opt = 0; int options_index = 0; int rc = 0; char *mem; char *newmem; size_t allocated = 0; int pagesize; int i; char c; while ((opt = getopt_long(argc, argv, "czmMfh?Vt:l:i:", long_options, &options_index)) != EOF) { switch (opt...
main
forkbomb-1.4-r1
app-benchmarks
O0/app-benchmarks/forkbomb-1.4-r1/forkbomb
ida
O0
void ZcavRead_ ~ZcavRead(ZcavRead *const this) { if (this->m_name) operator delete(this->m_name, 1u); Duration_ ~Duration(&this->m_dur); std_vector<int> _ ~vector(&this->m_count); std_vector<double *> _ ~vector(&this->m_times); }
ZcavRead::~ZcavRead() { delete m_name; }
ZcavRead
bonnie++-2.00a
app-benchmarks
O0/app-benchmarks/bonnie++-2.00a/zcav
ida
O0
double average(double *array, int count) { int i; double total; qsort(array, count, 8u, (__compar_fn_t)compar); total = 0.0; for (i = count / 3; i < count - count / 3; ++i) total = array[i] + total; return total / (double)(count - 2 * (count / 3)); }
double average(double *array, int count) { qsort(array, count, sizeof(double), compar); int skip = count / 3; int arr_items = count - (skip * 2); double total = 0.0; for (int i = skip; i < (count - skip); i++) { total += double(array[i]); } return total / double(arr_items); }
average
bonnie++-2.00a
app-benchmarks
O0/app-benchmarks/bonnie++-2.00a/zcav
ida
O0
int bon_setugid(CPCCHAR userName, CPCCHAR groupName, bool quiet) { __gid_t v4; __uid_t v5; bool setGroup; int id; uid_t userId; gid_t groupId; passwd *pw; group *gr; unsigned long v13; v13 = __readfsqword(0x28u); id = 0; userId = 0; groupId = 0; setGroup = 0; if (userName) { if ((unsi...
int bon_setugid(CPCCHAR userName, CPCCHAR groupName, bool quiet) { int id = 0; uid_t userId = 0; gid_t groupId = 0; bool setGroup = false; struct passwd *pw; struct group *gr; if (userName) { if (sscanf(userName, "%d", &id) == 1) { userId = uid_t(id); pw = getpwuid(userId); if (pw) {...
bon_setugid
bonnie++-2.00a
app-benchmarks
O0/app-benchmarks/bonnie++-2.00a/zcav
ida
O0
int compar(const void *a, const void *b) { if (*(double *)b <= *(double *)a) return *(double *)a > *(double *)b; else return -1; }
int compar(const void *a, const void *b) { double *c = (double *)(a); double *d = (double *)(b); if (*c < *d) return -1; if (*c > *d) return 1; return 0; }
compar
bonnie++-2.00a
app-benchmarks
O0/app-benchmarks/bonnie++-2.00a/zcav
ida
O0
int main(int argc, const char **argv, const char **envp) { int v3; int v4; int v5; int a; int b; int do_write; int i; int c; int rc; int rc_1; int rc_0; char *userName; char *groupName; const char *log; const char *file; MultiZcav mz; unsigned long v20; v20 = __readfsqword(0x28u); ...
int main(int argc, char *argv[]) { MultiZcav mz; if (argc < 2) usage(); char *userName = NULL, *groupName = NULL; int c; int do_write = 0; const char *log = "-"; const char *file = ""; while (-1 != (c = getopt(argc, argv, "-c:b:f:l:r:w" #ifdef _LARGEFILE64_SOURCE ...
main
bonnie++-2.00a
app-benchmarks
O0/app-benchmarks/bonnie++-2.00a/zcav
ida
O0
PVOID thread_func(PVOID param) { int v1; Thread *thread; thread = (Thread *)(*(long (**)(_QWORD, _QWORD))(**(_QWORD **)param + 24LL))( *(_QWORD *)param, *((unsigned int *)param + 4)); v1 = (*thread->_vptr_Thread)(thread, *((_QWORD *)param + 1)); Thread_setRetVal(thread, v1); if (thread) (*((void ...
PVOID thread_func(PVOID param) { THREAD_DATA *td = (THREAD_DATA *)param; Thread *thread = td->f->newThread(td->threadNum); thread->setRetVal(thread->action(td->param)); delete thread; delete td; return NULL; }
thread_func
bonnie++-2.00a
app-benchmarks
O0/app-benchmarks/bonnie++-2.00a/zcav
ida
O0
void usage() { fwrite("Usage: zcav [-b block-size[:chunk-size]] [-c count]\n" " [-r [start offset:]end offset] [-w]\n" " [-u uid-to-use:gid-to-use] [-g gid-to-use]\n" " [-s skip rate]\n" " [-l log-file] [-f] file-name\n" " ...
void usage() { fprintf(stderr, "Usage: zcav [-b block-size[:chunk-size]] [-c count]\n" " [-r [start offset:]end offset] [-w]\n" " [-u uid-to-use:gid-to-use] [-g gid-to-use]\n" #ifdef _LARGEFILE64_SOURCE " [-s skip rate]\n" #endif ...
usage
bonnie++-2.00a
app-benchmarks
O0/app-benchmarks/bonnie++-2.00a/zcav
ida
O0
double cpu_so_far() { rusage rusage; unsigned long v2; v2 = __readfsqword(0x28u); getrusage(0, &rusage); return (double)SLODWORD(rusage.ru_stime.tv_usec) / 1000000.0 + (double)SLODWORD(rusage.ru_utime.tv_sec) + (double)SLODWORD(rusage.ru_utime.tv_usec) / 1000000.0 + (double)SLODWOR...
static double cpu_so_far() { #if defined(SysV) struct tms tms; if (times(&tms) == -1) io_error("times"); return ((double)tms.tms_utime) / ((double)sysconf(_SC_CLK_TCK)) + ((double)tms.tms_stime) / ((double)sysconf(_SC_CLK_TCK)); #else struct rusage rusage; getrusage(RUSAGE_SELF, &rusage); re...
cpu_so_far
bonnie-2.0.6-r2
app-benchmarks
O0/app-benchmarks/bonnie-2.0.6-r2/bonnie
ida
O0
void doseek(off_t where, int fd, int update) { unsigned long v3; unsigned long size; int buf[4098]; unsigned long v7; v7 = __readfsqword(0x28u); if (where << 14 != lseek(fd, where << 14, 0)) io_error("lseek in doseek"); size = read(fd, buf, 0x4000u); if (size == -1) io_error("read in doseek"); ...
static void doseek(off_t where, int fd, int update) { int buf[Chunk / IntSize]; off_t probe; off_t size; probe = where * Chunk; if (lseek(fd, probe, 0) != probe) io_error("lseek in doseek"); if ((size = read(fd, (char *)buf, Chunk)) == -1) io_error("read in doseek"); if (update) { buf[((int...
doseek
bonnie-2.0.6-r2
app-benchmarks
O0/app-benchmarks/bonnie-2.0.6-r2/bonnie
ida
O0
void get_delta_t(tests_t test) { delta[test][1] = time_so_far() - last_timestamp; delta[test][0] = cpu_so_far() - last_cpustamp; }
static void get_delta_t(test) tests_t test; { int which = (int)test; delta[which][Elapsed] = time_so_far() - last_timestamp; delta[which][CPU] = cpu_so_far() - last_cpustamp; }
get_delta_t
bonnie-2.0.6-r2
app-benchmarks
O0/app-benchmarks/bonnie-2.0.6-r2/bonnie
ida
O0
void io_error(char *message) { char buf[16392]; unsigned long v2; v2 = __readfsqword(0x28u); sprintf(buf, "Bonnie: drastic I/O error (%s)", message); perror(buf); exit(1); }
static void io_error(char *message) { char buf[Chunk]; sprintf(buf, "Bonnie: drastic I/O error (%s)", message); perror(buf); exit(1); }
io_error
bonnie-2.0.6-r2
app-benchmarks
O0/app-benchmarks/bonnie-2.0.6-r2/bonnie
ida
O0
int main(int argc, const char **argv, const char **envp) { __pid_t v3; off_t v4; int v5; int v6; int v7; __pid_t v8; int v9; _BOOL4 v10; int v11; __int128 v12; double v13; double v14; int child; int fd; int bufindex; int html; int lseek_count; int next; FILE *stream; char *dir; ...
main(int argc, char *argv[]) { int buf[Chunk / IntSize]; int bufindex; int chars[256]; int child; char *dir; int html = 0; int fd; double first_start; double last_stop; int lseek_count = 0; char *machine; char name[Chunk]; int next; int seek_control[2]; int seek_feedback[2]; char seek_ti...
main
bonnie-2.0.6-r2
app-benchmarks
O0/app-benchmarks/bonnie-2.0.6-r2/bonnie
ida
O0
void newfile(char *name, int *fd, FILE **stream, int create) { if (create) { if (unlink(name) == -1 && *fd != -1) io_error("unlink"); *fd = open(name, 194, 511); } else { *fd = open(name, 2, 511); } if (*fd == -1) io_error(name); *stream = fdopen(*fd, "r+"); if (!*stream) io_error(...
static void newfile(char *name, int *fd, FILE **stream, int create) { if (create) { if (unlink(name) == -1 && *fd != -1) io_error("unlink"); *fd = open(name, O_RDWR | O_CREAT | O_EXCL, 0777); } else *fd = open(name, O_RDWR, 0777); if (*fd == -1) io_error(name); *stream = fdopen(*fd, "r+")...
newfile
bonnie-2.0.6-r2
app-benchmarks
O0/app-benchmarks/bonnie-2.0.6-r2/bonnie
ida
O0
void report(char *machine, off_t size) { printf(" "); puts("-------Sequential Output-------- ---Sequential Input-- --Random--"); printf(" "); puts("-Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --Seeks---"); printf("Machine MB "); printf("K/sec %%CPU K/sec %%CPU K/sec %...
static void report(char *machine, off_t size) { printf(" "); printf("-------Sequential Output-------- ---Sequential Input-- --Random--\n"); printf(" "); printf("-Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --Seeks---\n"); printf("Machine MB "); printf("K/sec %%CPU K/se...
report
bonnie-2.0.6-r2
app-benchmarks
O0/app-benchmarks/bonnie-2.0.6-r2/bonnie
ida
O0
double time_so_far() { timeval tp; unsigned long v2; v2 = __readfsqword(0x28u); if (gettimeofday(&tp, 0) == -1) io_error("gettimeofday"); return (double)SLODWORD(tp.tv_usec) / 1000000.0 + (double)(LODWORD(tp.tv_sec) - basetime); }
static double time_so_far() { #if defined(SysV) int val; struct tms tms; if ((val = times(&tms)) == -1) io_error("times"); return ((double)val) / ((double)sysconf(_SC_CLK_TCK)); #else struct timeval tp; if (gettimeofday(&tp, (struct timezone *)NULL) == -1) io_error("gettimeofday"); return ((do...
time_so_far
bonnie-2.0.6-r2
app-benchmarks
O0/app-benchmarks/bonnie-2.0.6-r2/bonnie
ida
O0
void timestamp() { last_timestamp = time_so_far(); last_cpustamp = cpu_so_far(); }
static void timestamp() { last_timestamp = time_so_far(); last_cpustamp = cpu_so_far(); }
timestamp
bonnie-2.0.6-r2
app-benchmarks
O0/app-benchmarks/bonnie-2.0.6-r2/bonnie
ida
O0
void usage() { fwrite("usage: Bonnie [-d scratch-dir] [-s size-in-Mb] [-html] [-m " "machine-label]\n", 1u, 0x4Au, _TMC_END__); exit(1); }
static void usage() { fprintf(stderr, "usage: Bonnie [-d scratch-dir] [-s size-in-Mb] [-html] [-m " "machine-label]\n"); exit(1); }
usage
bonnie-2.0.6-r2
app-benchmarks
O0/app-benchmarks/bonnie-2.0.6-r2/bonnie
ida
O0
void write_html(char *machine, off_t size) { printf("<TR><TD>%s</TD><TD>%d</TD>", machine, size / 0x100000); printf("<TD>%d</TD><TD>%4.1f</TD><TD>%d</TD><TD>%4.1f</TD><TD>%d</" "TD><TD>%4.1f</TD>", (int)((double)(int)size / (1024.0 * delta[0][1])), delta[0][0] / delta[0][1] * 100.0, ...
static void write_html(char *machine, off_t size) { printf("<TR><TD>%s</TD><TD>%d</TD>", machine, size / (1024 * 1024)); printf("<TD>%d</TD><TD>%4.1f</TD><TD>%d</TD><TD>%4.1f</TD><TD>%d</" "TD><TD>%4.1f</TD>", (int)(((double)size) / (delta[(int)Putc][Elapsed] * 1024.0)), delta[(int)Putc]...
write_html
bonnie-2.0.6-r2
app-benchmarks
O0/app-benchmarks/bonnie-2.0.6-r2/bonnie
ida
O0
void COpenTest_ ~COpenTest(COpenTest *const this) { int i; int ia; int ib; char buf[6]; unsigned long v6; v6 = __readfsqword(0x28u); if (this->m_dirname) { fwrite("Cleaning up test directory after error.\n", 1u, 0x28u, stderr); if (this->m_file_names) { for (i = 0; i < this->m_number; ++i) ...
COpenTest::~COpenTest() { int i; if (m_dirname) { fprintf(stderr, "Cleaning up test directory after error.\n"); if (m_file_names) { for (i = 0; i < m_number; i++) unlink(m_file_names[i]); } if (m_number_directories > 1) { char buf[6]; for (i = 0; i < m_number_directories; i...
COpenTest
bonnie++-2.00a
app-benchmarks
O0/app-benchmarks/bonnie++-2.00a/bonnie++
ida
O0
int TestDirOps(int directory_size, int max_size, int min_size, int num_directories, CGlobalItems *globals) { bool *doExit; bool bufSync; int v7; int v8; COpenTest open_test; unsigned long v14; v14 = __readfsqword(0x28u); doExit = globals->doExit; bufSync = globals->bufSync; v7 = CGlo...
int TestDirOps(int directory_size, int max_size, int min_size, int num_directories, CGlobalItems &globals) { COpenTest open_test(globals.file_chunk_size(), globals.bufSync, globals.doExit); if (!directory_size) { return 0; } if (globals.ram && directory_size * MaxDataPe...
TestDirOps
bonnie++-2.00a
app-benchmarks
O0/app-benchmarks/bonnie++-2.00a/bonnie++
ida
O0
int TestFileOps(int file_size, CGlobalItems *globals) { int v2; _BOOL4 v3; int v4; double Max; size_t v6; double v7; double v8; double v9; double v10; int words; int wordsa; int wordsb; int bufindex; int bufindexa; int bufindexb; int i; int ia; int num_chunks; int char_io_chunks; ...
int TestFileOps(int file_size, CGlobalItems &globals) { if (file_size) { CFileOp file(globals.timer, file_size, globals.io_chunk_bits, globals.bufSync #ifdef O_DIRECT , globals.use_direct_io #endif ); int num_chunks; int words; char *buf = globals...
TestFileOps
bonnie++-2.00a
app-benchmarks
O0/app-benchmarks/bonnie++-2.00a/bonnie++
ida
O0
int io_error(CPCCHAR_0 message, bool do_exit) { char buf[1032]; unsigned long v4; v4 = __readfsqword(0x28u); if (!already_printed_error && !do_exit) { sprintf(buf, "Bonnie: drastic I/O error (%s)", message); perror(buf); already_printed_error = 1; } if (do_exit) exit(1); return 1; }
int io_error(CPCCHAR message, bool do_exit) { char buf[1024]; if (!already_printed_error && !do_exit) { sprintf(buf, "Bonnie: drastic I/O error (%s)", message); perror(buf); already_printed_error = 1; } if (do_exit) exit(1); return (1); }
io_error
bonnie++-2.00a
app-benchmarks
O0/app-benchmarks/bonnie++-2.00a/bonnie++
ida
O0
int main(int argc, const char **argv, const char **envp) { int v4; int v5; unsigned int v6; int v7; int v10; int v11; FILE *v12; int file_seek_procs; int file_seeks; int v15; FILE *v16; int v17; int v18; FILE *v19; int v20; int v21; int v22; FILE *v23; int v24; int v25; bool se...
int main(int argc, char *argv[]) { int file_size = DefaultFileSize; int directory_size = DefaultDirectorySize; int directory_max_size = DefaultDirectoryMaxSize; int directory_min_size = DefaultDirectoryMinSize; int num_bonnie_procs = 0; int num_directories = 1; int test_count = -1; const char *machine =...
main
bonnie++-2.00a
app-benchmarks
O0/app-benchmarks/bonnie++-2.00a/bonnie++
ida
O0
void print_size(char *buf, unsigned int size, CPCCHAR_0 units) { unsigned int sizea; int ind; int indb; int inda; sizea = size; sprintf(buf, "%d", size); ind = 0; if (units) { if (size) { while ((sizea & 0x3FF) == 0 && units[ind + 1]) { sizea >>= 10; ++ind; } sprin...
void print_size(char *buf, unsigned int size, CPCCHAR units) { sprintf(buf, "%d", size); int ind = 0; if (units) { if (size == 0) { ind = strlen(buf); buf[ind] = units[0]; buf[ind + 1] = '\0'; } else { while (size % 1024 == 0 && units[ind + 1] != '\0') { size /= 1024; ...
print_size
bonnie++-2.00a
app-benchmarks
O0/app-benchmarks/bonnie++-2.00a/bonnie++
ida
O0
unsigned int size_from_str(CPCCHAR str, CPCCHAR conv) { size_t v2; char c; int i; int size; unsigned int mult[3]; unsigned long v8; v8 = __readfsqword(0x28u); mult[0] = 1024; mult[1] = 0x100000; mult[2] = 0x40000000; size = atoi(str); v2 = strlen(str); c = tolower(str[v2 - 1]); if (conv) { ...
unsigned int size_from_str(CPCCHAR str, CPCCHAR conv) { const unsigned int mult[3] = {1 << 10, 1 << 20, 1 << 30}; unsigned int size = atoi(str); char c = tolower(str[strlen(str) - 1]); if (conv) { for (int i = 0; conv[i] != '\0' && i < 3; i++) { if (c == conv[i]) { size *= mult[i]; ret...
size_from_str
bonnie++-2.00a
app-benchmarks
O0/app-benchmarks/bonnie++-2.00a/bonnie++
ida
O0
void usage() { fwrite( "usage:\n" "bonnie++ [-d scratch-dir] [-c concurrency] [-s " "size(MiB)[:chunk-size(b)]]\n" " [-n " "number-to-stat[:max-size[:min-size][:num-directories[:chunk-size]]]]\n" " [-m machine-name] [-r ram-size-in-MiB]\n" " [-x number-of-tests...
void usage() { fprintf( stderr, "usage:\n" "bonnie++ [-d scratch-dir] [-c concurrency] [-s " "size(MiB)[:chunk-size(b)]]\n" " [-n " "number-to-stat[:max-size[:min-size][:num-directories[:chunk-size]]]]\n" " [-m machine-name] [-r ram-size-in-MiB]\n" " [-x ...
usage
bonnie++-2.00a
app-benchmarks
O0/app-benchmarks/bonnie++-2.00a/bonnie++
ida
O0
int main(int argc, const char **argv, const char **envp) { int v3; const char *v5; char *v6; long v7; char *v8; char *v9; char *v10; float v11; float v12; float v13; u_int64_t v14; char *v15; char *v16; char *v17; unsigned int v18; unsigned int bufsize; int summary; int errout; int...
int main(int argc, char **argv) { int c; u_int64_t datalen = 0, last_datalen = 0, speed = 0; struct timeval start, tv, tv2; char tdbuf[64]; char speedbuf[64]; char datalenbuf[64]; unsigned int bufsize = 819200; int summary = 1; int errout = 0; int quiet = 0; int fancy = 1; int dounit = 1; FILE...
main
pipebench-0.40-r2
app-benchmarks
O0/app-benchmarks/pipebench-0.40-r2/pipebench
ida
O0
void sigint(int n) { done = 1; }
static void sigint(int n) { done = 1; }
sigint
pipebench-0.40-r2
app-benchmarks
O0/app-benchmarks/pipebench-0.40-r2/pipebench
ida
O0
char *time_diff(timeval *start, timeval *end, char *buf, int max) { __time_t diff; __suseconds_t diff_8; diff_8 = end->tv_usec - start->tv_usec; diff = end->tv_sec - start->tv_sec; if (diff_8 < 0) { diff_8 += 1000000LL; --diff; } buf[max - 1] = 0; snprintf(buf, max, "%.2dh%.2dm%.2d.%.2ds", diff...
static char *time_diff(struct timeval *start, struct timeval *end, char *buf, int max) { struct timeval diff; diff.tv_usec = end->tv_usec - start->tv_usec; diff.tv_sec = end->tv_sec - start->tv_sec; if (diff.tv_usec < 0) { diff.tv_usec += 1000000; diff.tv_sec--; } buf[max - 1]...
time_diff
pipebench-0.40-r2
app-benchmarks
O0/app-benchmarks/pipebench-0.40-r2/pipebench
ida
O0
char *unitify(u_int64_t _in, char *buf, int max, unsigned long nunit, int dounit) { double v5; double v6; unsigned int e; int fra; u_int64_t in; u_int64_t ina; double inf; char *unit; char *units[7]; unsigned long v15; v15 = __readfsqword(0x28u); e = 0; unit = (char *)&unk_2008;...
static char *unitify(u_int64_t _in, char *buf, int max, unsigned long nunit, int dounit) { int e = 0; u_int64_t in; double inf; char *unit = ""; char *units[] = { "", "k", "M", "G", "T", "P", "E", }; int fra = 0; inf = in = _in; if (dounit) { if (in > (nunit * nunit)) {...
unitify
pipebench-0.40-r2
app-benchmarks
O0/app-benchmarks/pipebench-0.40-r2/pipebench
ida
O0
void usage() { printf("Pipebench %1.2f, by Thomas Habets <thomas@habets.pp.se>\n", version); puts("usage: ... | pipebench [ -ehqQIoru ] [ -b <bufsize ] [ -s <file> | -S " "<file> ]\\\n | ..."); }
static void usage(void) { printf("Pipebench %1.2f, by Thomas Habets <thomas@habets.pp.se>\n", version); printf("usage: ... | pipebench [ -ehqQIoru ] [ -b <bufsize ] " "[ -s <file> | -S <file> ]\\\n | ...\n"); }
usage
pipebench-0.40-r2
app-benchmarks
O0/app-benchmarks/pipebench-0.40-r2/pipebench
ida
O0
selint_error add_check(node_flavor check_flavor, checks *ck, const char *check_id, check_result *(*check_function)(const check_data *, const policy_node *)) { check_node *loc; check_node *loca; if (ck->check_node...
enum selint_error add_check( enum node_flavor check_flavor, struct checks *ck, const char *check_id, struct check_result *(*check_function)(const struct check_data *check_data, const struct policy_node *node)) { struct check_node *loc; ALLOC_NODE(check_flavor); ...
add_check
selint-1.2.0
app-admin
O0/app-admin/selint-1.2.0/selint
ida
O0
selint_error add_section_info(section_data *sections, const char *section_name, unsigned int lineno) { section_data *cur; if (!sections || !section_name) return selint_error_SELINT_BAD_ARG; cur = sections; if (sections->section_name) { while (strcmp(cur->section_name, sect...
enum selint_error add_section_info(struct section_data *sections, const char *section_name, unsigned int lineno) { if (sections == NULL || section_name == NULL) { return SELINT_BAD_ARG; } struct section_data *cur = sections; if (sections-...
add_section_info
selint-1.2.0
app-admin
O0/app-admin/selint-1.2.0/selint
ida
O0
selint_error add_template_declarations(const char *template_name, const string_list *args, string_list *parent_temp_names, const char *mod_name) { selint_error res; string_list *cur; string_list *c...
enum selint_error add_template_declarations( const char *template_name, const struct string_list *args, struct string_list *parent_temp_names, const char *mod_name) { struct string_list *cur = parent_temp_names; while (cur) { if (strcmp(cur->string, template_name) == 0) { free_string_list(parent...
add_template_declarations
selint-1.2.0
app-admin
O0/app-admin/selint-1.2.0/selint
ida
O0
bool all_netlink_socket_classes(const string_list *classes) { while (classes) { if (strncmp(classes->string, "netlink_", 8u)) return 0; classes = classes->next; } return 1; }
static bool all_netlink_socket_classes(const struct string_list *classes) { for (; classes; classes = classes->next) { if (0 != strncmp(classes->string, "netlink_", strlen("netlink_"))) { return false; } } return true; }
all_netlink_socket_classes
selint-1.2.0
app-admin
O0/app-admin/selint-1.2.0/selint
ida
O0
bool all_socket_classes(const string_list *classes) { size_t v1; while (classes) { v1 = strlen(classes->string); if (!ends_with(classes->string, v1, "_socket", 7u)) return 0; classes = classes->next; } return 1; }
static bool all_socket_classes(const struct string_list *classes) { for (; classes; classes = classes->next) { if (!ends_with(classes->string, strlen(classes->string), "_socket", strlen("_socket"))) { return false; } } return true; }
all_socket_classes
selint-1.2.0
app-admin
O0/app-admin/selint-1.2.0/selint
ida
O0
check_result *alloc_internal_error(const char *string) { return make_check_result(70, 2u, "%s", string); }
struct check_result *alloc_internal_error(const char *string) { return make_check_result('F', F_ID_INTERNAL, "%s", string); }
alloc_internal_error
selint-1.2.0
app-admin
O0/app-admin/selint-1.2.0/selint
ida
O0
selint_error append_to_sl(string_list *sl, const char *string) { string_list *sla; sla = sl; if (!sl) return selint_error_SELINT_BAD_ARG; while (sla->next) sla = sla->next; sla->next = sl_from_str(string); return selint_error_SELINT_SUCCESS; }
enum selint_error append_to_sl(struct string_list *sl, const char *string) { if (!sl) { return SELINT_BAD_ARG; } while (sl->next) { sl = sl->next; } sl->next = sl_from_str(string); return SELINT_SUCCESS; }
append_to_sl
selint-1.2.0
app-admin
O0/app-admin/selint-1.2.0/selint
ida
O0
node_flavor attr_to_node_flavor(attr_flavor flavor) { if (flavor == attr_flavor_ATTR_TYPE) return node_flavor_NODE_TYPE_ATTRIBUTE; if (flavor == attr_flavor_ATTR_ROLE) return node_flavor_NODE_ROLE_ATTRIBUTE; return node_flavor_NODE_ERROR; }
static enum node_flavor attr_to_node_flavor(enum attr_flavor flavor) { switch (flavor) { case ATTR_TYPE: return NODE_TYPE_ATTRIBUTE; case ATTR_ROLE: return NODE_ROLE_ATTRIBUTE; default: return NODE_ERROR; } }
attr_to_node_flavor
selint-1.2.0
app-admin
O0/app-admin/selint-1.2.0/selint
ida
O0
selint_error begin_block(policy_node **cur, node_flavor block_type, node_data nd, unsigned int lineno) { selint_error ret; selint_error reta; ret = insert_policy_node_next(*cur, block_type, nd, lineno); if (ret) return ret; *cur = (*cur)->next; reta = insert_policy_node_c...
static enum selint_error begin_block(struct policy_node **cur, enum node_flavor block_type, union node_data nd, unsigned int lineno) { enum selint_error ret = insert_policy_node_next(*cur, block_type, nd, lineno); if (ret != SELINT_SUCCESS) ...
begin_block
selint-1.2.0
app-admin
O0/app-admin/selint-1.2.0/selint
ida
O0
selint_error begin_boolean_policy(policy_node **cur, unsigned int lineno) { return begin_block(cur, node_flavor_NODE_BOOLEAN_POLICY, 0, lineno); }
enum selint_error begin_boolean_policy(struct policy_node **cur, unsigned int lineno) { union node_data nd; nd.str = NULL; return begin_block(cur, NODE_BOOLEAN_POLICY, nd, lineno); }
begin_boolean_policy
selint-1.2.0
app-admin
O0/app-admin/selint-1.2.0/selint
ida
O0
selint_error begin_gen_require(policy_node **cur, unsigned int lineno) { void *v2; v2 = malloc(1u); return begin_block(cur, node_flavor_NODE_GEN_REQ, (node_data)v2, lineno); }
enum selint_error begin_gen_require(struct policy_node **cur, unsigned int lineno) { struct gen_require_data *data = (struct gen_require_data *)malloc(sizeof(struct gen_require_data)); union node_data nd; nd.gr_data = data; return begin_block(cur, NODE_GEN_REQ, nd, line...
begin_gen_require
selint-1.2.0
app-admin
O0/app-admin/selint-1.2.0/selint
ida
O0
selint_error begin_ifdef(policy_node **cur, unsigned int lineno) { return begin_block(cur, node_flavor_NODE_IFDEF, 0, lineno); }
enum selint_error begin_ifdef(struct policy_node **cur, unsigned int lineno) { union node_data nd; nd.str = NULL; return begin_block(cur, NODE_IFDEF, nd, lineno); }
begin_ifdef
selint-1.2.0
app-admin
O0/app-admin/selint-1.2.0/selint
ida
O0
selint_error begin_ifelse(policy_node **cur, unsigned int lineno) { return begin_block(cur, node_flavor_NODE_IFELSE, 0, lineno); }
enum selint_error begin_ifelse(struct policy_node **cur, unsigned int lineno) { union node_data nd; nd.str = NULL; return begin_block(cur, NODE_IFELSE, nd, lineno); }
begin_ifelse
selint-1.2.0
app-admin
O0/app-admin/selint-1.2.0/selint
ida
O0
selint_error begin_interface_def(policy_node **cur, node_flavor flavor, const char *name, unsigned int lineno) { char *current_module_name; char *v6; if (flavor != node_flavor_NODE_INTERFACE_DEF) { if (flavor != node_flavor_NODE_TEMP_DEF) return selint_error_SELINT_BAD_...
enum selint_error begin_interface_def(struct policy_node **cur, enum node_flavor flavor, const char *name, unsigned int lineno) { switch (flavor) { case NODE_INTERFACE_DEF: break; case NODE_TEMP_DEF: insert_template_into_template...
begin_interface_def
selint-1.2.0
app-admin
O0/app-admin/selint-1.2.0/selint
ida
O0
selint_error begin_m4_argument(policy_node **cur, unsigned int lineno) { return begin_block(cur, node_flavor_NODE_M4_ARG, 0, lineno); }
enum selint_error begin_m4_argument(struct policy_node **cur, unsigned int lineno) { union node_data nd; nd.str = NULL; return begin_block(cur, NODE_M4_ARG, nd, lineno); }
begin_m4_argument
selint-1.2.0
app-admin
O0/app-admin/selint-1.2.0/selint
ida
O0
selint_error begin_optional_else(policy_node **cur, unsigned int lineno) { return begin_block(cur, node_flavor_NODE_OPTIONAL_ELSE, 0, lineno); }
enum selint_error begin_optional_else(struct policy_node **cur, unsigned int lineno) { union node_data nd; nd.str = NULL; return begin_block(cur, NODE_OPTIONAL_ELSE, nd, lineno); }
begin_optional_else
selint-1.2.0
app-admin
O0/app-admin/selint-1.2.0/selint
ida
O0
selint_error begin_optional_policy(policy_node **cur, unsigned int lineno) { return begin_block(cur, node_flavor_NODE_OPTIONAL_POLICY, 0, lineno); }
enum selint_error begin_optional_policy(struct policy_node **cur, unsigned int lineno) { union node_data nd; nd.str = NULL; return begin_block(cur, NODE_OPTIONAL_POLICY, nd, lineno); }
begin_optional_policy
selint-1.2.0
app-admin
O0/app-admin/selint-1.2.0/selint
ida
O0
selint_error begin_require(policy_node **cur, unsigned int lineno) { return begin_block(cur, node_flavor_NODE_REQUIRE, 0, lineno); }
enum selint_error begin_require(struct policy_node **cur, unsigned int lineno) { union node_data nd; nd.str = NULL; return begin_block(cur, NODE_REQUIRE, nd, lineno); }
begin_require
selint-1.2.0
app-admin
O0/app-admin/selint-1.2.0/selint
ida
O0
selint_error begin_tunable_policy(policy_node **cur, unsigned int lineno) { return begin_block(cur, node_flavor_NODE_TUNABLE_POLICY, 0, lineno); }
enum selint_error begin_tunable_policy(struct policy_node **cur, unsigned int lineno) { union node_data nd; nd.str = NULL; return begin_block(cur, NODE_TUNABLE_POLICY, nd, lineno); }
begin_tunable_policy
selint-1.2.0
app-admin
O0/app-admin/selint-1.2.0/selint
ida
O0
void calculate_average_lines(section_data *sections) { while (sections) { sections->avg_line = (float)(int)sections->lines_sum / (float)(int)sections->lineno_count; sections = sections->next; } }
void calculate_average_lines(struct section_data *sections) { while (sections) { sections->avg_line = (float)sections->lines_sum / (float)sections->lineno_count; sections = sections->next; } }
calculate_average_lines
selint-1.2.0
app-admin
O0/app-admin/selint-1.2.0/selint
ida
O0
void calculate_longest_increasing_subsequence( const policy_node *head, ordering_metadata *ordering, order_difference_reason (*comp_func)(const ordering_metadata *, const policy_node *, const policy_node *)) { int longest_seq; ...
void calculate_longest_increasing_subsequence( const struct policy_node *head, struct ordering_metadata *ordering, enum order_difference_reason (*comp_func)( const struct ordering_metadata *o, const struct policy_node *first, const struct policy_node *second)) { struct order_node *nodes = orde...
calculate_longest_increasing_subsequence
selint-1.2.0
app-admin
O0/app-admin/selint-1.2.0/selint
ida
O0
selint_error call_checks(checks *ck, const check_data *data, const policy_node *node) { return call_checks_for_node_type(ck->check_nodes[node->flavor], data, node); }
enum selint_error call_checks(struct checks *ck, const struct check_data *data, const struct policy_node *node) { return call_checks_for_node_type(ck->check_nodes[node->flavor], data, node); }
call_checks
selint-1.2.0
app-admin
O0/app-admin/selint-1.2.0/selint
ida
O0
selint_error call_checks_for_node_type(check_node *ck_list, const check_data *data, const policy_node *node) { check_result *res; while (ck_list) { if (node->exceptions && strstr(node->exceptions, ck_list->check_id)) { ck_list ...
enum selint_error call_checks_for_node_type(struct check_node *ck_list, const struct check_data *data, const struct policy_node *node) { struct check_node *cur = ck_list; while (cur) { if (node->exceptions && strstr(node->...
call_checks_for_node_type
selint-1.2.0
app-admin
O0/app-admin/selint-1.2.0/selint
ida
O0
check_result *check_bare_module_statement(const check_data *data, const policy_node *node) { if (node->data.h_data->flavor) return 0; else return make_check_result( 83, 6u, "Bare module statement (use `policy_module()` instead)"); }
struct check_result * check_bare_module_statement(__attribute__((unused)) const struct check_data *data, const struct policy_node *node) { if (node->data.h_data->flavor == HEADER_BARE) { return make_check_result( 'S', S_ID_BARE_MODULE, "Bare ...
check_bare_module_statement
selint-1.2.0
app-admin
O0/app-admin/selint-1.2.0/selint
ida
O0
bool check_call_layer(const policy_node *node, const char *layer_to_check) { const char *mod_name; const char *layer_name; if (node->flavor != node_flavor_NODE_IF_CALL) return 0; mod_name = look_up_in_ifs_map(*(const char **)node->data.h_data); if (!mod_name) return 0; layer_name = look_up_in_mod_l...
static bool check_call_layer(const struct policy_node *node, const char *layer_to_check) { if (node->flavor != NODE_IF_CALL) { return false; } const char *mod_name = look_up_in_ifs_map(node->data.ic_data->name); if (!mod_name) { return false; } const char *layer_name = ...
check_call_layer
selint-1.2.0
app-admin
O0/app-admin/selint-1.2.0/selint
ida
O0
check_result *check_decl_in_if(const check_data *data, const policy_node *node) { policy_node *parent; if (data->flavor != file_flavor_FILE_IF_FILE) return 0; for (parent = node->parent; parent && parent->flavor != node_flavor_NODE_INTERFACE_DEF && parent->flavor ...
struct check_result *check_decl_in_if(const struct check_data *data, const struct policy_node *node) { if (data->flavor != FILE_IF_FILE) { return NULL; } const struct policy_node *parent = node->parent; while (parent && (parent->flavor != NODE_INTERFACE_DEF && ...
check_decl_in_if
selint-1.2.0
app-admin
O0/app-admin/selint-1.2.0/selint
ida
O0
check_result *check_declaration_interface_nameclash(const check_data *data, const policy_node *node) { char *decl_name; decl_name = node->data.h_data->module_name; if (look_up_in_ifs_map(decl_name)) return make_check_result( 69, 6u, "Declaration wit...
struct check_result * check_declaration_interface_nameclash(__attribute__((unused)) const struct check_data *data, const struct policy_node *node) { const char *decl_name = node->data.d_data->name; if (look_up_in_ifs_map(decl_name)) { ...
check_declaration_interface_nameclash
selint-1.2.0
app-admin
O0/app-admin/selint-1.2.0/selint
ida
O0
check_result *check_empty_block(const check_data *data, const policy_node *node) { policy_node *cur; for (cur = node->first_child; cur; cur = cur->next) { if (cur->flavor != node_flavor_NODE_START_BLOCK && cur->flavor != node_flavor_NODE_COMMENT && cur->flavor !=...
struct check_result *check_empty_block(__attribute__((unused)) const struct check_data *data, const struct policy_node *node) { for (const struct policy_node *cur = node->first_child; cur; cur = cur->next) { if (cur->flavor == NO...
check_empty_block
selint-1.2.0
app-admin
O0/app-admin/selint-1.2.0/selint
ida
O0
check_result *check_empty_if_call_arg(const check_data *data, const policy_node *node) { if (node->data.h_data->module_name) return 0; else return make_check_result(87, 6u, "Call to interface %s with empty argument", *(const char **)node->da...
struct check_result *check_empty_if_call_arg(__attribute__((unused)) const struct check_data *data, const struct policy_node *node) { if (!node->data.ic_data->args) { return make_check_result('W', W_ID_EMPTY_IF_CALL_ARG, ...
check_empty_if_call_arg
selint-1.2.0
app-admin
O0/app-admin/selint-1.2.0/selint
ida
O0
check_result *check_file_context_error_nodes(const check_data *data, const policy_node *node) { if (node->flavor == node_flavor_NODE_ERROR) return make_check_result(69, 2u, "Bad file context format"); else return 0; }
struct check_result * check_file_context_error_nodes(__attribute__((unused)) const struct check_data *data, const struct policy_node *node) { if (node->flavor != NODE_ERROR) { return NULL; } return make_check_result('E', E_ID_FC_ERROR, "Bad file ...
check_file_context_error_nodes
selint-1.2.0
app-admin
O0/app-admin/selint-1.2.0/selint
ida
O0
check_result *check_file_context_regex(const check_data *data, const policy_node *node) { char cur; char prev; char next; int error; const char *path; const fc_entry *entry; if (node->flavor != node_flavor_NODE_FC_ENTRY) return alloc_internal_error( "Fil...
struct check_result *check_file_context_regex(__attribute__((unused)) const struct check_data *data, const struct policy_node *node) { SETUP_FOR_FC_CHECK(node) const char *path = entry->path; char cur = *path; char pre...
check_file_context_regex
selint-1.2.0
app-admin
O0/app-admin/selint-1.2.0/selint
ida
O0
check_result *check_file_context_roles(const check_data *data, const policy_node *node) { const fc_entry *entry; if (node->flavor != node_flavor_NODE_FC_ENTRY) return alloc_internal_error( "File context type check called on non file context entry"); entry = node...
struct check_result *check_file_context_roles(__attribute__((unused)) const struct check_data *data, const struct policy_node *node) { SETUP_FOR_FC_CHECK(node) const char *role_decl_filename = look_up_in_decl_map(ent...
check_file_context_roles
selint-1.2.0
app-admin
O0/app-admin/selint-1.2.0/selint
ida
O0