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 |
|---|---|---|---|---|---|---|---|
void get_logfilename() {
int year;
int month;
int day;
int hours;
int minutes;
time_t t;
tm *mytm;
utsname buf;
unsigned long v8;
v8 = __readfsqword(0x28u);
time(&t);
if (uname(&buf) == -1)
terminal_error("uname");
mytm = localtime(&t);
if (!mytm)
terminal_error("localtime");
year... | void get_logfilename(void) {
struct tm *mytm;
struct utsname buf;
time_t t;
int year, month, day, hours, minutes;
time(&t);
if (uname(&buf) == -1)
terminal_error("uname");
if (!(mytm = localtime(&t)))
terminal_error("localtime");
year = mytm->tm_year + 1900;
month = mytm->tm_mon + 1;
day = ... | get_logfilename | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
unsigned long get_nsecs(timespec *myts) {
if (clock_gettime(0, myts))
terminal_error("clock_gettime");
return 1000000000 * myts->tv_sec + myts->tv_nsec;
} | unsigned long long get_nsecs(struct timespec *myts) {
if (clock_gettime(CLOCK_REALTIME, myts))
terminal_error("clock_gettime");
return (myts->tv_sec * 1000000000 + myts->tv_nsec);
} | get_nsecs | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void get_ram() {
unsigned long i;
FILE *meminfo;
char aux[264];
unsigned long v3;
v3 = __readfsqword(0x28u);
meminfo = fopen64("/proc/meminfo", "r");
if (!meminfo)
terminal_error("fopen");
ud.swap = 0;
ud.ram = 0;
while (!feof(meminfo) && !fscanf(meminfo, "MemTotal: %lu kB", &ud.ram))
fgets... | void get_ram(void) {
FILE *meminfo;
char aux[256];
if (!(meminfo = fopen("/proc/meminfo", "r")))
terminal_error("fopen");
ud.ram = ud.swap = 0;
while (!feof(meminfo) && !fscanf(meminfo, "MemTotal: %lu kB", &ud.ram))
fgets(aux, sizeof(aux), meminfo);
while (!feof(meminfo) && !fscanf(meminfo, "SwapT... | get_ram | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
unsigned long get_usecs(timespec *myts) {
if (clock_gettime(0, myts))
terminal_error("clock_gettime");
return 1000000 * myts->tv_sec + myts->tv_nsec / 1000;
} | unsigned long get_usecs(struct timespec *myts) {
if (clock_gettime(CLOCK_REALTIME, myts))
terminal_error("clock_gettime");
return (myts->tv_sec * 1000000 + myts->tv_nsec / 1000);
} | get_usecs | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
int *grab_and_touch(char **block, int i) {
block[i] = (char *)malloc(0x100000u);
if (block[i])
return (int *)memset(block[i], 1, 0x100000u);
else
return 0;
} | int *grab_and_touch(char *block[], int i) {
block[i] = (char *)malloc(MB);
if (!block[i])
return NULL;
return (memset(block[i], 1, MB));
} | grab_and_touch | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
unsigned int group(int ready_out, int wakefd) {
__pid_t v2;
__pid_t v3;
unsigned int i;
unsigned int ia;
unsigned int ib;
int fds[2];
int out_fds[22];
unsigned long v10;
v10 = __readfsqword(0x28u);
for (i = 0; i <= 0x13; ++i) {
fdpair(fds);
v2 = fork();
if (v2 == -1)
barf("fork()"... | static unsigned int group(int ready_out, int wakefd) {
unsigned int i;
int out_fds[NUM_FDS];
for (i = 0; i < NUM_FDS; i++) {
int fds[2];
fdpair(fds);
switch (fork()) {
case -1:
barf("fork()");
case 0:
close(fds[1]);
receiver(NUM_FDS * LOOPS, fds[0], ready_out, wakefd);
... | group | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void *hackbench_thread(void *t) {
char dummy;
int status;
unsigned int i;
unsigned int total_children;
unsigned int num_groups;
int readyfds[2];
int wakefds[2];
unsigned long v9;
v9 = __readfsqword(0x28u);
num_groups = 50;
fdpair(readyfds);
fdpair(wakefds);
do {
total_children = 0;
fo... | void *hackbench_thread(void *t) {
unsigned int i, num_groups, total_children;
int readyfds[2], wakefds[2];
char dummy;
num_groups = 50;
t = 0;
fdpair(readyfds);
fdpair(wakefds);
while (1) {
total_children = 0;
for (i = 0; i < num_groups; i++)
total_children += group(readyfds[1], wakefds... | hackbench_thread | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void init_all_sems(sems *s) {
init_sem(&s->ready);
init_sem(&s->start);
init_sem(&s->stop);
init_sem(&s->complete);
init_sem(&s->stopchild);
} | void init_all_sems(struct sems *s) {
init_sem(&s->ready);
init_sem(&s->start);
init_sem(&s->stop);
init_sem(&s->complete);
init_sem(&s->stopchild);
} | init_all_sems | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void init_pipe(int *pype) {
if (pipe(pype) == -1)
terminal_error("pipe");
} | void init_pipe(int *pype) {
if (pipe(pype) == -1)
terminal_error("pipe");
} | init_pipe | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void init_pipes() {
init_pipe(m2l);
init_pipe(l2m);
init_pipe(m2b);
init_pipe(b2m);
} | void init_pipes(void) {
init_pipe(m2l);
init_pipe(l2m);
init_pipe(m2b);
init_pipe(b2m);
} | init_pipes | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void init_sem(sem_t *sem) {
if (sem_init(sem, 0, 0))
terminal_error("sem_init");
} | void init_sem(sem_t *sem) {
if (sem_init(sem, 0, 0))
terminal_error("sem_init");
} | init_sem | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void initialise_thread(int i) {
thread *th;
th = &threadlist[i];
init_all_sems(&th->sem);
create_pthread(&th->pthread, 0, (void *(*)(void *))emulation_thread,
(void *)i);
wait_sem(&th->sem.ready);
th->dt = &th->benchmarks[13];
initialise_thread_data(th->dt);
} | void initialise_thread(int i) {
struct thread *th = &threadlist[i];
init_all_sems(&th->sem);
create_pthread(&th->pthread, NULL, emulation_thread, (void *)(long)i);
wait_sem(&th->sem.ready);
th->dt = &th->benchmarks[NOT_BENCHING];
initialise_thread_data(th->dt);
} | initialise_thread | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void initialise_thread_data(data_table *tb) {
tb->nr_samples = 0;
tb->missed_burns = 0;
tb->missed_deadlines = tb->missed_burns;
tb->deadlines_met = tb->missed_deadlines;
tb->sum_latency_squared = tb->deadlines_met;
tb->total_latency = tb->sum_latency_squared;
tb->max_latency = tb->total_latency;
} | void initialise_thread_data(struct data_table *tb) {
tb->max_latency = tb->total_latency = tb->sum_latency_squared =
tb->deadlines_met = tb->missed_deadlines = tb->missed_burns =
tb->nr_samples = 0;
} | initialise_thread_data | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void join_pthread(pthread_t th, void **thread_return) {
if (pthread_join(th, thread_return))
terminal_error("pthread_join");
} | void join_pthread(pthread_t th, void **thread_return) {
if (pthread_join(th, thread_return))
terminal_error("pthread_join");
} | join_pthread | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
int load_index(const char *loadname) {
int i;
for (i = 0; i <= 12; ++i) {
if (!strcasecmp(loadname, threadlist[i].label))
return i;
}
return -1;
} | int load_index(const char *loadname) {
int i;
for (i = 0; i < THREADS; i++)
if (strcasecmp(loadname, threadlist[i].label) == 0)
return i;
return -1;
} | load_index | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void log_output(const char *format, ...) {
long v1;
long v2;
long v3;
long v4;
long v5;
va_list ap;
unsigned long v7;
long v8;
long v9;
long v10;
long v11;
long v12;
va_start(ap, format);
v3 = va_arg(ap, _QWORD);
v1 = va_arg(ap, _QWORD);
v2 = va_arg(ap, _QWORD);
v4 = va_arg(ap, _QWORD... | void log_output(const char *format, ...) {
va_list ap;
va_start(ap, format);
if (vprintf(format, ap) == -1)
terminal_error("vprintf");
va_end(ap);
if (ud.log) {
va_start(ap, format);
if (vfprintf(ud.logfile, format, ap) == -1)
terminal_error("vpfrintf");
va_end(ap);
}
fflush(NULL);
... | log_output | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
int main(int argc, const char **argv, const char **envp) {
unsigned int selected_loads;
unsigned int excluded_loads;
unsigned int selected_benches;
unsigned int excluded_benches;
int i;
int j;
int benchmark;
int q;
int affinity;
unsigned long custom_cpu;
char *comment;
int *benchme;
char *fnam... | int main(int argc, char **argv) {
unsigned long custom_cpu = 0;
int q, i, j, affinity, benchmark = 0;
unsigned int selected_loads = 0;
unsigned int excluded_loads = 0;
unsigned int selected_benches = 0;
unsigned int excluded_benches = 0;
FILE *fp;
char *fname = "interbench.loops_per_ms";
char *commen... | main | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void microsleep(unsigned long usecs) {
timespec req;
timespec rem;
unsigned long v3;
v3 = __readfsqword(0x28u);
rem.tv_nsec = 0;
rem.tv_sec = 0;
req.tv_sec = usecs / 0xF4240;
req.tv_nsec = 1000 * (usecs % 0xF4240);
while (nanosleep(&req, &rem) == -1) {
if (*__errno_location() != 4)
terminal... | void microsleep(unsigned long long usecs) {
struct timespec req, rem;
rem.tv_sec = rem.tv_nsec = 0;
req.tv_sec = usecs / 1000000;
req.tv_nsec = (usecs - (req.tv_sec * 1000000)) * 1000;
continue_sleep:
if ((nanosleep(&req, &rem)) == -1) {
if (errno == EINTR) {
if (rem.tv_sec || rem.tv_nsec) {
... | microsleep | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
unsigned long periodic_schedule(thread *th, unsigned long run_usecs,
unsigned long interval_usecs,
unsigned long deadline) {
unsigned long deadlinec;
unsigned long deadlineb;
unsigned long latency;
unsigned long latencya;
unsigned long missed_lat... | unsigned long periodic_schedule(struct thread *th, unsigned long run_usecs,
unsigned long interval_usecs,
unsigned long long deadline) {
unsigned long long latency, missed_latency;
unsigned long long current_time;
struct tk_thread *tk;
struct data_... | periodic_schedule | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void post_sem(sem_t *s) {
while (sem_post(s) == -1) {
if (*__errno_location() != 4)
terminal_error("sem_post");
}
} | inline void post_sem(sem_t *s) {
retry:
if ((sem_post(s)) == -1) {
if (errno == EINTR)
goto retry;
terminal_error("sem_post");
}
} | post_sem | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void ready(int ready_out, int wakefd) {
char dummy;
pollfd pollfd;
unsigned long v4;
v4 = __readfsqword(0x28u);
*(_DWORD *)&pollfd.events = 1;
pollfd.fd = wakefd;
if (write(ready_out, &dummy, 1u) != 1)
barf("CLIENT: ready write");
if (poll(&pollfd, 1u, -1) != 1)
barf("poll");
} | static void ready(int ready_out, int wakefd) {
char dummy;
struct pollfd pollfd = {.fd = wakefd, .events = POLLIN};
if (write(ready_out, &dummy, 1) != 1)
barf("CLIENT: ready write");
if (poll(&pollfd, 1, -1) != 1)
barf("poll");
} | ready | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void receiver(unsigned int num_packets, int in_fd, int ready_out, int wakefd) {
unsigned int i;
int done;
char data[100];
unsigned long v7;
v7 = __readfsqword(0x28u);
ready(ready_out, wakefd);
for (i = 0; i < num_packets; ++i) {
for (done = 0; done <= 99; done += Read(in_fd, &data[done], 100 - done))... | static void receiver(unsigned int num_packets, int in_fd, int ready_out,
int wakefd) {
unsigned int i;
ready(ready_out, wakefd);
for (i = 0; i < num_packets; i++) {
char data[DATASIZE];
int ret, done = 0;
again:
ret = Read(in_fd, data + done, DATASIZE - done);
done += ret... | receiver | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void *ring_thread(void *t) {
int post_to;
post_to = (_DWORD)t + 1;
if ((_DWORD)t == 3)
post_to = 0;
if (!(_DWORD)t)
post_sem(&ringthreads[0].sem.ready);
do {
wait_sem(&ringthreads[(int)t].sem.start);
post_sem(&ringthreads[post_to].sem.start);
} while (trywait_sem(&ringthreads[(int)t].sem.st... | void *ring_thread(void *t) {
struct thread *th;
struct sems *s;
int i, post_to;
i = (long)t;
th = &ringthreads[i];
s = &th->sem;
post_to = i + 1;
if (post_to == RINGTHREADS)
post_to = 0;
if (i == 0)
post_sem(&s->ready);
while (1) {
wait_sem(&s->start);
post_sem(&ringthreads[post_to... | ring_thread | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void run_benchchild(int i, int j) {
thread *thi;
thi = &threadlist[i];
set_nice(ud.bench_nice);
if (ud.do_rt)
set_mlock();
initialise_thread(i);
thi->dt = &thi->benchmarks[(long)j];
initialise_thread_data(thi->dt);
if (ud.do_rt)
set_thread_fifo(thi->pthread, 95);
wakeup_with(b2m[1]);
wait_o... | void run_benchchild(int i, int j) {
struct thread *thi;
thi = &threadlist[i];
set_nice(ud.bench_nice);
if (ud.do_rt)
set_mlock();
initialise_thread(i);
thi->dt = &thi->benchmarks[j];
initialise_thread_data(thi->dt);
if (ud.do_rt)
set_thread_fifo(thi->pthread, 95);
wakeup_with(b2m[1]);
w... | run_benchchild | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void run_loadchild(int j) {
thread *thj;
thj = &threadlist[j];
set_nice(ud.load_nice);
initialise_thread(j);
wakeup_with(l2m[1]);
wait_on(m2l[0]);
start_thread(thj);
wakeup_with(l2m[1]);
wait_on(m2l[0]);
stop_thread(thj);
wakeup_with(l2m[1]);
exit(0);
} | void run_loadchild(int j) {
struct thread *thj;
thj = &threadlist[j];
set_nice(ud.load_nice);
initialise_thread(j);
wakeup_with(l2m[1]);
wait_on(m2l[0]);
start_thread(thj);
wakeup_with(l2m[1]);
wait_on(m2l[0]);
stop_thread(thj);
wakeup_with(l2m[1]);
exit(0);
} | run_loadchild | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void sender(int *out_fd, int ready_out, int wakefd) {
unsigned int i;
unsigned int j;
int ret;
unsigned long done;
char data[100];
unsigned long v8;
v8 = __readfsqword(0x28u);
ready(ready_out, wakefd);
for (i = 0; i <= 0x63; ++i) {
for (j = 0; j <= 0x13; ++j) {
for (done = 0; done <= 0x63; ... | static void sender(int out_fd[NUM_FDS], int ready_out, int wakefd) {
char data[DATASIZE];
unsigned int i, j;
ready(ready_out, wakefd);
for (i = 0; i < LOOPS; i++) {
for (j = 0; j < NUM_FDS; j++) {
int ret;
unsigned long done = 0;
again:
ret = write(out_fd[j], data + done, sizeof(dat... | sender | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void set_bit_on(unsigned int *mask, int index) { *mask |= 1 << index; } | inline void set_bit_on(unsigned int *mask, int index) { *mask |= (1 << index); } | set_bit_on | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void set_fifo(int prio) {
sched_param sp_0;
unsigned long v2;
v2 = __readfsqword(0x28u);
memset(&sp_0, 0, sizeof(sp_0));
sp_0.sched_priority = prio;
if (sched_setscheduler(0, 1, &sp_0) == -1 && *__errno_location() != 1)
terminal_error("sched_setscheduler");
} | void set_fifo(int prio) {
struct sched_param sp;
memset(&sp, 0, sizeof(sp));
sp.sched_priority = prio;
if (sched_setscheduler(0, SCHED_FIFO, &sp) == -1) {
if (errno != EPERM)
terminal_error("sched_setscheduler");
}
} | set_fifo | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void set_mlock() { mlockall(3); } | void set_mlock(void) {
int mlockflags;
mlockflags = MCL_CURRENT | MCL_FUTURE;
mlockall(mlockflags);
} | set_mlock | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void set_munlock() {
if (munlockall() == -1)
terminal_error("munlockall");
} | void set_munlock(void) {
if (munlockall() == -1)
terminal_error("munlockall");
} | set_munlock | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void set_nice(int prio) {
if (setpriority(__priority_which_PRIO_PROCESS, 0, prio) == -1)
terminal_error("setpriority");
} | void set_nice(int prio) {
if (setpriority(PRIO_PROCESS, 0, prio) == -1)
terminal_error("setpriority");
} | set_nice | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void set_normal() {
sched_param sp_0;
unsigned long v1;
v1 = __readfsqword(0x28u);
memset(&sp_0, 0, sizeof(sp_0));
sp_0.sched_priority = 0;
if (sched_setscheduler(0, 0, &sp_0) == -1)
fwrite("Weird, could not unset RT scheduling!\n", 1u, 0x26u, stderr);
} | void set_normal(void) {
struct sched_param sp;
memset(&sp, 0, sizeof(sp));
sp.sched_priority = 0;
if (sched_setscheduler(0, SCHED_OTHER, &sp) == -1) {
fprintf(stderr, "Weird, could not unset RT scheduling!\n");
}
} | set_normal | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void set_thread_fifo(pthread_t pthread, int prio) {
sched_param sp_0;
unsigned long v3;
v3 = __readfsqword(0x28u);
memset(&sp_0, 0, sizeof(sp_0));
sp_0.sched_priority = prio;
if (pthread_setschedparam(pthread, 1, &sp_0) == -1)
terminal_error("pthread_setschedparam");
} | void set_thread_fifo(pthread_t pthread, int prio) {
struct sched_param sp;
memset(&sp, 0, sizeof(sp));
sp.sched_priority = prio;
if (pthread_setschedparam(pthread, SCHED_FIFO, &sp) == -1)
terminal_error("pthread_setschedparam");
} | set_thread_fifo | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void set_thread_normal(pthread_t pthread) {
sched_param sp_0;
unsigned long v2;
v2 = __readfsqword(0x28u);
memset(&sp_0, 0, sizeof(sp_0));
sp_0.sched_priority = 0;
if (pthread_setschedparam(pthread, 0, &sp_0) == -1)
terminal_error("pthread_setschedparam");
} | void set_thread_normal(pthread_t pthread) {
struct sched_param sp;
memset(&sp, 0, sizeof(sp));
sp.sched_priority = 0;
if (pthread_setschedparam(pthread, SCHED_OTHER, &sp) == -1)
terminal_error("pthread_setschedparam");
} | set_thread_normal | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void show_latencies(thread *th) {
unsigned long nr_samples;
long v2;
double v3;
long v4;
long sum_latency_squared;
double v6;
long v7;
long v8;
double v9;
long v10;
double v11;
long v12;
double v13;
unsigned long total_latency;
double v15;
long achieved_burns;
double v17;
long v18;
... | void show_latencies(struct thread *th) {
struct data_table *tbj;
struct tk_thread *tk;
double average_latency, deadlines_met, samples_met, sd, max_latency;
long double variance = 0;
tbj = th->dt;
tk = &th->tkthread;
if (tbj->nr_samples > 1) {
average_latency = tbj->total_latency / tbj->nr_samples;
... | show_latencies | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void start_thread(thread *th) { post_sem(&th->sem.start); } | void start_thread(struct thread *th) { post_sem(&th->sem.start); } | start_thread | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void stop_thread(thread *th) {
post_sem(&th->sem.stop);
wait_sem(&th->sem.complete);
join_pthread(th->pthread, 0);
} | void stop_thread(struct thread *th) {
post_sem(&th->sem.stop);
wait_sem(&th->sem.complete);
join_pthread(th->pthread, NULL);
} | stop_thread | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void sync_flush() {
if (fflush(0) == -1)
terminal_error("fflush");
sync();
sync();
sync();
} | void sync_flush(void) {
if ((fflush(NULL)) == EOF)
terminal_error("fflush");
sync();
sync();
sync();
} | sync_flush | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void terminal_error(const char *name) {
fputc(10, stderr);
perror(name);
exit(1);
} | void terminal_error(const char *name) {
fprintf(stderr, "\n");
perror(name);
exit(1);
} | terminal_error | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void terminal_fileopen_error(FILE *fp, char *name) {
if (fclose(fp) == -1)
terminal_error("fclose");
terminal_error(name);
} | void terminal_fileopen_error(FILE *fp, char *name) {
if (fclose(fp) == -1)
terminal_error("fclose");
terminal_error(name);
} | terminal_fileopen_error | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
int test_fifo() {
sched_param sp_0;
unsigned long v2;
v2 = __readfsqword(0x28u);
memset(&sp_0, 0, sizeof(sp_0));
sp_0.sched_priority = 99;
if (sched_setscheduler(0, 1, &sp_0) == -1) {
if (*__errno_location() != 1)
terminal_error("sched_setscheduler");
} else if (sched_getscheduler(0) == 1) {
... | int test_fifo(void) {
struct sched_param sp;
memset(&sp, 0, sizeof(sp));
sp.sched_priority = 99;
if (sched_setscheduler(0, SCHED_FIFO, &sp) == -1) {
if (errno != EPERM)
terminal_error("sched_setscheduler");
goto out_fail;
}
if (sched_getscheduler(0) != SCHED_FIFO)
goto out_fail;
set_norm... | test_fifo | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void *timekeeping_thread(void *t) {
unsigned long start_time;
unsigned long now;
timespec myts;
unsigned long v5;
v5 = __readfsqword(0x28u);
if (threadlist[(_QWORD)t].dt != &threadlist[(_QWORD)t].benchmarks[13])
set_fifo(96);
threadlist[(_QWORD)t].tkthread.slept_interval = 0;
threadlist[(_QWORD)t].... | void *timekeeping_thread(void *t) {
struct thread *th;
struct tk_thread *tk;
struct sems *s;
struct timespec myts;
long i = (long)t;
th = &threadlist[i];
tk = &th->tkthread;
s = &th->tkthread.sem;
if (th->dt != &th->benchmarks[NOT_BENCHING])
set_fifo(96);
tk->sleep_interval = tk->slept_interv... | timekeeping_thread | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
int trywait_sem(sem_t *s) {
int ret;
while (1) {
ret = sem_trywait(s);
if (ret != -1)
break;
if (*__errno_location() != 4) {
if (*__errno_location() != 11)
terminal_error("sem_trywait");
return ret;
}
}
return ret;
} | inline int trywait_sem(sem_t *s) {
int ret;
retry:
if ((ret = sem_trywait(s)) == -1) {
if (errno == EINTR)
goto retry;
if (errno != EAGAIN)
terminal_error("sem_trywait");
}
return ret;
} | trywait_sem | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void usage() {
fwrite("interbench v 0.31 by Con Kolivas\n", 1u, 0x21u, stderr);
fwrite("interbench [-l <int>] [-L <int>] [-t <int] [-B <int>] [-N <int>]\n",
1u, 0x41u, stderr);
fwrite("\t[-b] [-c] [-r] [-C <int> -I <int>] [-m <comment>]\n", 1u, 0x33u,
stderr);
fwrite("\t[-w <load type>] [-x <l... | void usage(void) {
fprintf(stderr, "interbench v " INTERBENCH_VERSION " by Con Kolivas\n");
fprintf(stderr,
"interbench [-l <int>] [-L <int>] [-t <int] [-B <int>] [-N <int>]\n");
fprintf(stderr, "\t[-b] [-c] [-r] [-C <int> -I <int>] [-m <comment>]\n");
fprintf(stderr,
"\t[-w <load type>] [-... | usage | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void wait_on(int pype) {
int buf;
unsigned long v3;
v3 = __readfsqword(0x28u);
buf = 0;
if (!(unsigned int)Read(pype, &buf, 4u)) {
fwrite("\nread returned 0\n", 1u, 0x11u, stderr);
exit(1);
}
} | void wait_on(int pype) {
int retval, buf = 0;
retval = Read(pype, &buf, sizeof(buf));
if (retval == 0) {
fprintf(stderr, "\nread returned 0\n");
exit(1);
}
} | wait_on | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void wait_sem(sem_t *s) {
while (sem_wait(s) == -1) {
if (*__errno_location() != 4)
terminal_error("sem_wait");
}
} | inline void wait_sem(sem_t *s) {
retry:
if ((sem_wait(s)) == -1) {
if (errno == EINTR)
goto retry;
terminal_error("sem_wait");
}
} | wait_sem | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
void wakeup_with(int pype) {
int buf;
unsigned long v3;
v3 = __readfsqword(0x28u);
buf = 1;
if (!(unsigned int)Write(pype, &buf, 4u)) {
fwrite("\nwrite returned 0\n", 1u, 0x12u, stderr);
exit(1);
}
} | void wakeup_with(int pype) {
int retval, buf = 1;
retval = Write(pype, &buf, sizeof(buf));
if (retval == 0) {
fprintf(stderr, "\nwrite returned 0\n");
exit(1);
}
} | wakeup_with | interbench-0.31-r1 | app-benchmarks | O0/app-benchmarks/interbench-0.31-r1/interbench | ida | O0 |
size_t AbsDiff(size_t x, size_t y) {
if (x <= y)
return y - x;
else
return x - y;
} | static size_t AbsDiff(size_t x, size_t y) {
if (x > y)
return x - y;
else
return y - x;
} | AbsDiff | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
void AddBit(int bit, unsigned char *bp_0, unsigned char **out,
size_t *outsize) {
unsigned char *v4;
if (!*bp_0) {
if ((*outsize & (*outsize - 1)) == 0) {
if (*outsize)
v4 = (unsigned char *)realloc(*out, 2 * *outsize);
else
v4 = (unsigned char *)malloc(1u);
*out =... | static void AddBit(int bit, unsigned char *bp, unsigned char **out,
size_t *outsize) {
if (*bp == 0)
ZOPFLI_APPEND_DATA(0, out, outsize);
(*out)[*outsize - 1] |= bit << *bp;
*bp = (*bp + 1) & 7;
} | AddBit | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
void AddBits(unsigned int symbol, unsigned int length, unsigned char *bp_0,
unsigned char **out, size_t *outsize) {
unsigned char *v5;
unsigned int i;
for (i = 0; i < length; ++i) {
if (!*bp_0) {
if ((*outsize & (*outsize - 1)) == 0) {
if (*outsize)
v5 = (unsigned char *)... | static void AddBits(unsigned symbol, unsigned length, unsigned char *bp,
unsigned char **out, size_t *outsize) {
unsigned i;
for (i = 0; i < length; i++) {
unsigned bit = (symbol >> i) & 1;
if (*bp == 0)
ZOPFLI_APPEND_DATA(0, out, outsize);
(*out)[*outsize - 1] |= bit << *bp;
... | AddBits | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
void AddDynamicTree(const unsigned int *ll_lengths,
const unsigned int *d_lengths, unsigned char *bp_0,
unsigned char **out, size_t *outsize) {
int i;
char best;
size_t bestsize;
size_t size;
best = 0;
bestsize = 0;
for (i = 0; i <= 7; ++i) {
size = EncodeTree(... | static void AddDynamicTree(const unsigned *ll_lengths,
const unsigned *d_lengths, unsigned char *bp,
unsigned char **out, size_t *outsize) {
int i;
int best = 0;
size_t bestsize = 0;
for (i = 0; i < 8; i++) {
size_t size =
EncodeTree(ll_lengths,... | AddDynamicTree | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
void AddHuffmanBits(unsigned int symbol, unsigned int length,
unsigned char *bp_0, unsigned char **out, size_t *outsize) {
unsigned char *v5;
unsigned int i;
for (i = 0; i < length; ++i) {
if (!*bp_0) {
if ((*outsize & (*outsize - 1)) == 0) {
if (*outsize)
v5 = (un... | static void AddHuffmanBits(unsigned symbol, unsigned length, unsigned char *bp,
unsigned char **out, size_t *outsize) {
unsigned i;
for (i = 0; i < length; i++) {
unsigned bit = (symbol >> (length - i - 1)) & 1;
if (*bp == 0)
ZOPFLI_APPEND_DATA(0, out, outsize);
(*out)[... | AddHuffmanBits | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
void AddLZ77Block(const ZopfliOptions *options, int btype, int final,
const ZopfliLZ77Store *lz77, size_t lstart, size_t lend,
size_t expected_data_size, unsigned char *bp_0,
unsigned char **out, size_t *outsize) {
size_t v10;
int v11;
unsigned int detect_tree... | static void AddLZ77Block(const ZopfliOptions *options, int btype, int final,
const ZopfliLZ77Store *lz77, size_t lstart,
size_t lend, size_t expected_data_size,
unsigned char *bp, unsigned char **out,
size_t *outsize) {
... | AddLZ77Block | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
void AddLZ77BlockAutoType(const ZopfliOptions *options, int final,
const ZopfliLZ77Store *lz77, size_t lstart,
size_t lend, size_t expected_data_size,
unsigned char *bp_0, unsigned char **out,
size_t *outsize) {
_B... | static void AddLZ77BlockAutoType(const ZopfliOptions *options, int final,
const ZopfliLZ77Store *lz77, size_t lstart,
size_t lend, size_t expected_data_size,
unsigned char *bp, unsigned char **out,
... | AddLZ77BlockAutoType | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
void AddLZ77Data(const ZopfliLZ77Store *lz77, size_t lstart, size_t lend,
size_t expected_data_size, const unsigned int *ll_symbols,
const unsigned int *ll_lengths, const unsigned int *d_symbols,
const unsigned int *d_lengths, unsigned char *bp_0,
unsi... | static void AddLZ77Data(const ZopfliLZ77Store *lz77, size_t lstart, size_t lend,
size_t expected_data_size, const unsigned *ll_symbols,
const unsigned *ll_lengths, const unsigned *d_symbols,
const unsigned *d_lengths, unsigned char *bp,
... | AddLZ77Data | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
void AddNonCompressedBlock(const ZopfliOptions *options, int final,
const unsigned char *in, size_t instart,
size_t inend, unsigned char *bp_0,
unsigned char **out, size_t *outsize) {
_BOOL4 v8;
unsigned char *v9;
unsigned char *v10;... | static void AddNonCompressedBlock(const ZopfliOptions *options, int final,
const unsigned char *in, size_t instart,
size_t inend, unsigned char *bp,
unsigned char **out, size_t *outsize) {
size_t pos = instart;
(vo... | AddNonCompressedBlock | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
void AddSorted(size_t value, size_t **out, size_t *outsize) {
size_t *v3;
size_t i;
size_t j;
if ((*outsize & (*outsize - 1)) == 0) {
if (*outsize)
v3 = (size_t *)realloc(*out, 16 * *outsize);
else
v3 = (size_t *)malloc(8u);
*out = v3;
}
(*out)[(*outsize)++] = value;
for (i = 0; i... | static void AddSorted(size_t value, size_t **out, size_t *outsize) {
size_t i;
ZOPFLI_APPEND_DATA(value, out, outsize);
for (i = 0; i + 1 < *outsize; i++) {
if ((*out)[i] > value) {
size_t j;
for (j = *outsize - 1; j > i; j--) {
(*out)[j] = (*out)[j - 1];
}
(*out)[i] = value;
... | AddSorted | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
void AddWeighedStatFreqs(const SymbolStats *stats1, double w1,
const SymbolStats *stats2, double w2,
SymbolStats *result) {
long v5;
double v6;
size_t v7;
double v8;
long v9;
double v10;
size_t v11;
double v12;
unsigned long v13;
long v14;
double v... | static void AddWeighedStatFreqs(const SymbolStats *stats1, double w1,
const SymbolStats *stats2, double w2,
SymbolStats *result) {
size_t i;
for (i = 0; i < ZOPFLI_NUM_LL; i++) {
result->litlens[i] =
(size_t)(stats1->litlens[i] * w1 + stats... | AddWeighedStatFreqs | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
void BoundaryPM(Node *(*lists)[2], Node *leaves, int numsymbols, NodePool *pool,
int index) {
Node *v5;
int lastcount;
Node *oldchain;
size_t sum;
lastcount = (*lists)[2 * index + 1]->count;
if (index || lastcount < numsymbols) {
v5 = pool->next++;
oldchain = (*lists)[2 * index + 1]... | static void BoundaryPM(Node *(*lists)[2], Node *leaves, int numsymbols,
NodePool *pool, int index) {
Node *newchain;
Node *oldchain;
int lastcount = lists[index][1]->count;
if (index == 0 && lastcount >= numsymbols)
return;
newchain = pool->next++;
oldchain = lists[index][1];
... | BoundaryPM | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
void BoundaryPMFinal(Node *(*lists)[2], Node *leaves, int numsymbols,
NodePool *pool, int index) {
int lastcount;
Node *newchain;
Node *oldchain;
lastcount = (*lists)[2 * index + 1]->count;
if (lastcount >= numsymbols ||
(*lists)[2 * index - 2]->weight + (*lists)[2 * index - 1]->we... | static void BoundaryPMFinal(Node *(*lists)[2], Node *leaves, int numsymbols,
NodePool *pool, int index) {
int lastcount = lists[index][1]->count;
size_t sum = lists[index - 1][0]->weight + lists[index - 1][1]->weight;
if (lastcount < numsymbols && sum > leaves[lastcount].weight) {
... | BoundaryPMFinal | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
unsigned long CRC(const unsigned char *data, size_t size) {
const unsigned char *v2;
unsigned long result;
result = 0xFFFFFFFFLL;
while (size) {
v2 = data++;
result = crc32_table[(unsigned char)(result ^ *v2)] ^ (result >> 8);
--size;
}
return result ^ 0xFFFFFFFF;
} | static unsigned long CRC(const unsigned char *data, size_t size) {
unsigned long result = 0xffffffffu;
for (; size > 0; size--) {
result = crc32_table[(result ^ *(data++)) & 0xff] ^ (result >> 8);
}
return result ^ 0xffffffffu;
} | CRC | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
size_t CalculateBlockSymbolSize(const unsigned int *ll_lengths,
const unsigned int *d_lengths,
const ZopfliLZ77Store *lz77, size_t lstart,
size_t lend) {
size_t d_counts[32];
size_t ll_counts[289];
unsigned long v11;
... | static size_t CalculateBlockSymbolSize(const unsigned *ll_lengths,
const unsigned *d_lengths,
const ZopfliLZ77Store *lz77,
size_t lstart, size_t lend) {
if (lstart + ZOPFLI_NUM_LL * 3 > lend) {
ret... | CalculateBlockSymbolSize | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
size_t CalculateBlockSymbolSizeGivenCounts(const size_t *ll_counts,
const size_t *d_counts,
const unsigned int *ll_lengths,
const unsigned int *d_lengths,
... | static size_t CalculateBlockSymbolSizeGivenCounts(const size_t *ll_counts,
const size_t *d_counts,
const unsigned *ll_lengths,
const unsigned *d_lengths,
... | CalculateBlockSymbolSizeGivenCounts | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
size_t CalculateBlockSymbolSizeSmall(const unsigned int *ll_lengths,
const unsigned int *d_lengths,
const ZopfliLZ77Store *lz77, size_t lstart,
size_t lend) {
int ll_symbol;
int d_symbol;
size_t result;
... | static size_t CalculateBlockSymbolSizeSmall(const unsigned *ll_lengths,
const unsigned *d_lengths,
const ZopfliLZ77Store *lz77,
size_t lstart, size_t lend) {
size_t result = 0;
size_t ... | CalculateBlockSymbolSizeSmall | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
void CalculateStatistics(SymbolStats *stats) {
ZopfliCalculateEntropy(stats->litlens, 0x120u, stats->ll_symbols);
ZopfliCalculateEntropy(stats->dists, 0x20u, stats->d_symbols);
} | static void CalculateStatistics(SymbolStats *stats) {
ZopfliCalculateEntropy(stats->litlens, ZOPFLI_NUM_LL, stats->ll_symbols);
ZopfliCalculateEntropy(stats->dists, ZOPFLI_NUM_D, stats->d_symbols);
} | CalculateStatistics | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
size_t CalculateTreeSize(const unsigned int *ll_lengths,
const unsigned int *d_lengths) {
int i;
size_t result;
size_t size;
result = 0;
for (i = 0; i <= 7; ++i) {
size = EncodeTree(ll_lengths, d_lengths, i & 1, i & 2, i & 4, 0, 0, 0);
if (!result || size < result)
resu... | static size_t CalculateTreeSize(const unsigned *ll_lengths,
const unsigned *d_lengths) {
size_t result = 0;
int i;
for (i = 0; i < 8; i++) {
size_t size =
EncodeTree(ll_lengths, d_lengths, i & 1, i & 2, i & 4, 0, 0, 0);
if (result == 0 || size < result)
resul... | CalculateTreeSize | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
size_t CeilDiv(size_t a, size_t b) { return (a + b - 1) / b; } | static size_t CeilDiv(size_t a, size_t b) { return (a + b - 1) / b; } | CeilDiv | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
void ClearStatFreqs(SymbolStats *stats) {
size_t i;
size_t ia;
for (i = 0; i <= 0x11F; ++i)
stats->litlens[i] = 0;
for (ia = 0; ia <= 0x1F; ++ia)
stats->dists[ia] = 0;
} | static void ClearStatFreqs(SymbolStats *stats) {
size_t i;
for (i = 0; i < ZOPFLI_NUM_LL; i++)
stats->litlens[i] = 0;
for (i = 0; i < ZOPFLI_NUM_D; i++)
stats->dists[i] = 0;
} | ClearStatFreqs | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
void CopyStats(SymbolStats *source, SymbolStats *dest) {
memcpy(dest, source, 0x900u);
memcpy(dest->dists, source->dists, sizeof(dest->dists));
memcpy(dest->ll_symbols, source->ll_symbols, sizeof(dest->ll_symbols));
memcpy(dest->d_symbols, source->d_symbols, sizeof(dest->d_symbols));
} | static void CopyStats(SymbolStats *source, SymbolStats *dest) {
memcpy(dest->litlens, source->litlens,
ZOPFLI_NUM_LL * sizeof(dest->litlens[0]));
memcpy(dest->dists, source->dists, ZOPFLI_NUM_D * sizeof(dest->dists[0]));
memcpy(dest->ll_symbols, source->ll_symbols,
ZOPFLI_NUM_LL * sizeof(dest->... | CopyStats | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
size_t EncodeTree(const unsigned int *ll_lengths, const unsigned int *d_lengths,
int use_16, int use_17, int use_18, unsigned char *bp_0,
unsigned char **out, size_t *outsize) {
unsigned int v8;
unsigned int v9;
int v10;
unsigned int *v11;
unsigned int *v12;
int v13;
un... | static size_t EncodeTree(const unsigned *ll_lengths, const unsigned *d_lengths,
int use_16, int use_17, int use_18, unsigned char *bp,
unsigned char **out, size_t *outsize) {
unsigned lld_total;
unsigned *rle = 0;
unsigned *rle_bits = 0;
size_t rle_size = 0;
... | EncodeTree | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
double EstimateCost(const ZopfliLZ77Store *lz77, size_t lstart, size_t lend) {
return ZopfliCalculateBlockSizeAutoType(lz77, lstart, lend);
} | static double EstimateCost(const ZopfliLZ77Store *lz77, size_t lstart,
size_t lend) {
return ZopfliCalculateBlockSizeAutoType(lz77, lstart, lend);
} | EstimateCost | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
void ExtractBitLengths(Node *chain, Node *leaves, unsigned int *bitlengths) {
unsigned int end;
unsigned int ptr;
unsigned int value;
int val;
int counts[18];
unsigned long v9;
v9 = __readfsqword(0x28u);
memset(counts, 0, 64);
end = 16;
ptr = 15;
value = 1;
while (chain) {
counts[--end] = c... | static void ExtractBitLengths(Node *chain, Node *leaves, unsigned *bitlengths) {
int counts[16] = {0};
unsigned end = 16;
unsigned ptr = 15;
unsigned value = 1;
Node *node;
int val;
for (node = chain; node; node = node->tail) {
counts[--end] = node->count;
}
val = counts[15];
while (ptr >= end... | ExtractBitLengths | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
int FindLargestSplittableBlock(size_t lz77size, const unsigned char *done,
const size_t *splitpoints, size_t npoints,
size_t *lstart, size_t *lend) {
size_t v6;
size_t v7;
int found;
size_t longest;
size_t i;
size_t start;
longest = 0;
found... | static int FindLargestSplittableBlock(size_t lz77size,
const unsigned char *done,
const size_t *splitpoints, size_t npoints,
size_t *lstart, size_t *lend) {
size_t longest = 0;
int found = 0;
size_t i... | FindLargestSplittableBlock | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
size_t FindMinimum(FindMinimumFun *f, void *context, size_t start, size_t end,
double *smallest) {
size_t v6;
size_t v7;
size_t enda;
size_t starta;
double best;
size_t result;
size_t i;
size_t i_0;
size_t i_0a;
size_t besti;
double best_0;
double lastbest;
size_t pos;
dou... | static size_t FindMinimum(FindMinimumFun f, void *context, size_t start,
size_t end, double *smallest) {
if (end - start < 1024) {
double best = ZOPFLI_LARGE_FLOAT;
size_t result = start;
size_t i;
for (i = start; i < end; i++) {
double v = f(i, context);
if (v < ... | FindMinimum | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
void FollowPath(ZopfliBlockState *s, const unsigned char *in, size_t instart,
size_t inend, unsigned short *path, size_t pathsize,
ZopfliLZ77Store *store, ZopfliHash *h) {
size_t v8;
unsigned short dummy_length;
unsigned short dist;
unsigned short length;
size_t i;
size_t j;
... | static void FollowPath(ZopfliBlockState *s, const unsigned char *in,
size_t instart, size_t inend, unsigned short *path,
size_t pathsize, ZopfliLZ77Store *store, ZopfliHash *h) {
size_t i, j, pos = 0;
size_t windowstart =
instart > ZOPFLI_WINDOW_SIZE ? instart - Z... | FollowPath | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
double GetBestLengths(ZopfliBlockState *s, const unsigned char *in,
size_t instart, size_t inend, CostModelFun *costmodel,
void *costcontext, unsigned short *length_array,
ZopfliHash *h, float *costs) {
size_t v9;
float v11;
double v12;
float v13... | static double GetBestLengths(ZopfliBlockState *s, const unsigned char *in,
size_t instart, size_t inend,
CostModelFun *costmodel, void *costcontext,
unsigned short *length_array, ZopfliHash *h,
float *cos... | GetBestLengths | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
double GetCostFixed(unsigned int litlen, unsigned int dist, void *unused) {
int cost;
int dbits;
int lbits;
if (dist) {
dbits = ZopfliGetDistExtraBits_1(dist);
lbits = ZopfliGetLengthExtraBits_1(litlen);
if (ZopfliGetLengthSymbol_1(litlen) > 279)
cost = 8;
else
cost = 7;
return ... | static double GetCostFixed(unsigned litlen, unsigned dist, void *unused) {
(void)unused;
if (dist == 0) {
if (litlen <= 143)
return 8;
else
return 9;
} else {
int dbits = ZopfliGetDistExtraBits(dist);
int lbits = ZopfliGetLengthExtraBits(litlen);
int lsym = ZopfliGetLengthSymbol(li... | GetCostFixed | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
double GetCostModelMinCost(CostModelFun *costmodel, void *costcontext) {
unsigned int bestlength;
unsigned int bestdist;
signed int i;
int ia;
double mincost;
double mincosta;
double c_0;
double c;
bestlength = 0;
bestdist = 0;
mincost = 1.0e30;
for (i = 3; i <= 258; ++i) {
c = costmodel(i,... | static double GetCostModelMinCost(CostModelFun *costmodel, void *costcontext) {
double mincost;
int bestlength = 0;
int bestdist = 0;
int i;
static const int dsymbols[30] = {
1, 2, 3, 4, 5, 7, 9, 13, 17, 25,
33, 49, 65, 97, 129, 193, 257, 385, 513, 769,
... | GetCostModelMinCost | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
double GetCostStat(unsigned int litlen, unsigned int dist, void *context) {
int lsym;
int lbits;
int dsym;
if (!dist)
return *((double *)context + litlen + 320);
lsym = ZopfliGetLengthSymbol_1(litlen);
lbits = ZopfliGetLengthExtraBits_1(litlen);
dsym = ZopfliGetDistSymbol_1(dist);
return *((double ... | static double GetCostStat(unsigned litlen, unsigned dist, void *context) {
SymbolStats *stats = (SymbolStats *)context;
if (dist == 0) {
return stats->ll_symbols[litlen];
} else {
int lsym = ZopfliGetLengthSymbol(litlen);
int lbits = ZopfliGetLengthExtraBits(litlen);
int dsym = ZopfliGetDistSymbol... | GetCostStat | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
double GetDynamicLengths(const ZopfliLZ77Store *lz77, size_t lstart,
size_t lend, unsigned int *ll_lengths,
unsigned int *d_lengths) {
size_t d_counts[32];
size_t ll_counts[289];
unsigned long v11;
v11 = __readfsqword(0x28u);
ZopfliLZ77GetHistogram(lz77, lsta... | static double GetDynamicLengths(const ZopfliLZ77Store *lz77, size_t lstart,
size_t lend, unsigned *ll_lengths,
unsigned *d_lengths) {
size_t ll_counts[ZOPFLI_NUM_LL];
size_t d_counts[ZOPFLI_NUM_D];
ZopfliLZ77GetHistogram(lz77, lstart, lend, ll_count... | GetDynamicLengths | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
void GetFixedTree(unsigned int *ll_lengths, unsigned int *d_lengths) {
size_t i;
size_t ia;
size_t ib;
size_t ic;
size_t id;
for (i = 0; i <= 0x8F; ++i)
ll_lengths[i] = 8;
for (ia = 144; ia <= 0xFF; ++ia)
ll_lengths[ia] = 9;
for (ib = 256; ib <= 0x117; ++ib)
ll_lengths[ib] = 7;
for (ic = ... | static void GetFixedTree(unsigned *ll_lengths, unsigned *d_lengths) {
size_t i;
for (i = 0; i < 144; i++)
ll_lengths[i] = 8;
for (i = 144; i < 256; i++)
ll_lengths[i] = 9;
for (i = 256; i < 280; i++)
ll_lengths[i] = 7;
for (i = 280; i < 288; i++)
ll_lengths[i] = 8;
for (i = 0; i < 32; i++)
... | GetFixedTree | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
int GetLengthScore(int length, int distance) {
if (distance <= 1024)
return length;
else
return length - 1;
} | static int GetLengthScore(int length, int distance) {
return distance > 1024 ? length - 1 : length;
} | GetLengthScore | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
const unsigned char *GetMatch(const unsigned char *scan,
const unsigned char *match,
const unsigned char *end,
const unsigned char *safe_end) {
while (scan < safe_end && *(_QWORD *)scan == *(_QWORD *)match) {
scan += 8;
... | static const unsigned char *GetMatch(const unsigned char *scan,
const unsigned char *match,
const unsigned char *end,
const unsigned char *safe_end) {
if (sizeof(size_t) == 8) {
while (scan < safe_end ... | GetMatch | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
void GetStatistics(const ZopfliLZ77Store *store, SymbolStats *stats) {
int LengthSymbol_1;
int DistSymbol_1;
size_t i;
for (i = 0; i < store->size; ++i) {
if (store->dists[i]) {
LengthSymbol_1 = ZopfliGetLengthSymbol_1(store->litlens[i]);
++stats->litlens[LengthSymbol_1];
DistSymbol_1 = Z... | static void GetStatistics(const ZopfliLZ77Store *store, SymbolStats *stats) {
size_t i;
for (i = 0; i < store->size; i++) {
if (store->dists[i] == 0) {
stats->litlens[store->litlens[i]]++;
} else {
stats->litlens[ZopfliGetLengthSymbol(store->litlens[i])]++;
stats->dists[ZopfliGetDistSymbol... | GetStatistics | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
void InitLists(NodePool *pool, const Node *leaves, int maxbits,
Node *(*lists)[2]) {
Node *v4;
Node *v5;
int i;
Node *node0;
Node *node1;
v4 = pool->next++;
node0 = v4;
v5 = pool->next++;
node1 = v5;
InitNode(leaves->weight, 1, 0, node0);
InitNode(leaves[1].weight, 2, 0, node1);
... | static void InitLists(NodePool *pool, const Node *leaves, int maxbits,
Node *(*lists)[2]) {
int i;
Node *node0 = pool->next++;
Node *node1 = pool->next++;
InitNode(leaves[0].weight, 1, 0, node0);
InitNode(leaves[1].weight, 2, 0, node1);
for (i = 0; i < maxbits; i++) {
lists[i][0] =... | InitLists | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
void InitNode(size_t weight, int count, Node *tail, Node *node) {
node->weight = weight;
node->count = count;
node->tail = tail;
} | static void InitNode(size_t weight, int count, Node *tail, Node *node) {
node->weight = weight;
node->count = count;
node->tail = tail;
} | InitNode | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
void InitRanState(RanState *state) {
state->m_w = 1;
state->m_z = 2;
} | static void InitRanState(RanState *state) {
state->m_w = 1;
state->m_z = 2;
} | InitRanState | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
void InitStats(SymbolStats *stats) {
memset(stats, 0, 0x900u);
memset(stats->dists, 0, sizeof(stats->dists));
memset(stats->ll_symbols, 0, sizeof(stats->ll_symbols));
memset(stats->d_symbols, 0, sizeof(stats->d_symbols));
} | static void InitStats(SymbolStats *stats) {
memset(stats->litlens, 0, ZOPFLI_NUM_LL * sizeof(stats->litlens[0]));
memset(stats->dists, 0, ZOPFLI_NUM_D * sizeof(stats->dists[0]));
memset(stats->ll_symbols, 0, ZOPFLI_NUM_LL * sizeof(stats->ll_symbols[0]));
memset(stats->d_symbols, 0, ZOPFLI_NUM_D * sizeof(stats-... | InitStats | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
double LZ77OptimalRun(ZopfliBlockState *s, const unsigned char *in,
size_t instart, size_t inend, unsigned short **path,
size_t *pathsize, unsigned short *length_array,
CostModelFun *costmodel, void *costcontext,
ZopfliLZ77Store *st... | static double LZ77OptimalRun(ZopfliBlockState *s, const unsigned char *in,
size_t instart, size_t inend,
unsigned short **path, size_t *pathsize,
unsigned short *length_array,
CostModelFun *costmodel, voi... | LZ77OptimalRun | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
int LeafComparator(const void *a, const void *b) {
return *(_QWORD *)a - *(_QWORD *)b;
} | static int LeafComparator(const void *a, const void *b) {
return ((const Node *)a)->weight - ((const Node *)b)->weight;
} | LeafComparator | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
void OptimizeHuffmanForRle(int length, size_t *counts) {
int i;
int ia;
int ib;
int k;
int ka;
int stride;
int stridea;
int count;
size_t symbol;
size_t sum;
size_t limit;
int *good_for_rle;
while (length >= 0) {
if (!length)
return;
if (counts[length - 1])
break;
--le... | void OptimizeHuffmanForRle(int length, size_t *counts) {
int i, k, stride;
size_t symbol, sum, limit;
int *good_for_rle;
for (; length >= 0; --length) {
if (length == 0) {
return;
}
if (counts[length - 1] != 0) {
break;
}
}
good_for_rle = (int *)malloc((unsigned)length * sizeo... | OptimizeHuffmanForRle | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
void PatchDistanceCodesForBuggyDecoders(unsigned int *d_lengths) {
long v1;
int num_dist_codes;
int i;
num_dist_codes = 0;
for (i = 0; i <= 29; ++i) {
if (d_lengths[i])
++num_dist_codes;
if (num_dist_codes > 1)
return;
}
if (num_dist_codes) {
if (num_dist_codes == 1) {
if (*... | static void PatchDistanceCodesForBuggyDecoders(unsigned *d_lengths) {
int num_dist_codes = 0;
int i;
for (i = 0; i < 30; i++) {
if (d_lengths[i])
num_dist_codes++;
if (num_dist_codes >= 2)
return;
}
if (num_dist_codes == 0) {
d_lengths[0] = d_lengths[1] = 1;
} else if (num_dist_code... | PatchDistanceCodesForBuggyDecoders | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
void PrintBlockSplitPoints(const ZopfliLZ77Store *lz77,
const size_t *lz77splitpoints, size_t nlz77points) {
long v3;
size_t *v4;
size_t *splitpoints;
size_t npoints;
size_t i;
size_t ia;
size_t ib;
size_t pos;
size_t length;
splitpoints = 0;
npoints = 0;
pos = 0;
i... | static void PrintBlockSplitPoints(const ZopfliLZ77Store *lz77,
const size_t *lz77splitpoints,
size_t nlz77points) {
size_t *splitpoints = 0;
size_t npoints = 0;
size_t i;
size_t pos = 0;
if (nlz77points > 0) {
for (i = 0; i < lz77->size;... | PrintBlockSplitPoints | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
unsigned int Ran(RanState *state) {
state->m_z = HIWORD(state->m_z) + 36969 * (unsigned short)state->m_z;
state->m_w = HIWORD(state->m_w) + 18000 * (unsigned short)state->m_w;
return (state->m_z << 16) + state->m_w;
} | static unsigned int Ran(RanState *state) {
state->m_z = 36969 * (state->m_z & 65535) + (state->m_z >> 16);
state->m_w = 18000 * (state->m_w & 65535) + (state->m_w >> 16);
return (state->m_z << 16) + state->m_w;
} | Ran | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
void RandomizeFreqs(RanState *state, size_t *freqs, int n) {
unsigned int v3;
int i;
for (i = 0; i < n; ++i) {
v3 = Ran(state);
if (v3 >> 4 ==
3 * ((unsigned int)((2863311531u * (unsigned long)(v3 >> 4)) >> 32) >>
1))
freqs[i] = freqs[Ran(state) % n];
}
} | static void RandomizeFreqs(RanState *state, size_t *freqs, int n) {
int i;
for (i = 0; i < n; i++) {
if ((Ran(state) >> 4) % 3 == 0)
freqs[i] = freqs[Ran(state) % n];
}
} | RandomizeFreqs | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
void RandomizeStatFreqs(RanState *state, SymbolStats *stats) {
RandomizeFreqs(state, stats->litlens, 288);
RandomizeFreqs(state, stats->dists, 32);
stats->litlens[256] = 1;
} | static void RandomizeStatFreqs(RanState *state, SymbolStats *stats) {
RandomizeFreqs(state, stats->litlens, ZOPFLI_NUM_LL);
RandomizeFreqs(state, stats->dists, ZOPFLI_NUM_D);
stats->litlens[256] = 1;
} | RandomizeStatFreqs | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
double SplitCost(size_t i, void *context) {
double v3;
v3 = EstimateCost(*(const ZopfliLZ77Store **)context,
*((_QWORD *)context + 1), i);
return EstimateCost(*(const ZopfliLZ77Store **)context, i,
*((_QWORD *)context + 2)) +
v3;
} | static double SplitCost(size_t i, void *context) {
SplitCostContext *c = (SplitCostContext *)context;
return EstimateCost(c->lz77, c->start, i) + EstimateCost(c->lz77, i, c->end);
} | SplitCost | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
void StoreInLongestMatchCache(ZopfliBlockState *s, size_t pos, size_t limit,
const unsigned short *sublen,
unsigned short distance, unsigned short length) {
bool v6;
unsigned short v8;
size_t lmcpos;
lmcpos = pos - s->blockstart;
v6 = s->lmc && (!s-... | static void StoreInLongestMatchCache(ZopfliBlockState *s, size_t pos,
size_t limit, const unsigned short *sublen,
unsigned short distance,
unsigned short length) {
size_t lmcpos = pos - s->blockstart;
un... | StoreInLongestMatchCache | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
void TraceBackwards(size_t size, const unsigned short *length_array,
unsigned short **path, size_t *pathsize) {
unsigned short *v4;
unsigned short temp;
unsigned long index;
size_t indexa;
index = size;
if (size) {
do {
if ((*pathsize & (*pathsize - 1)) == 0) {
if (*pa... | static void TraceBackwards(size_t size, const unsigned short *length_array,
unsigned short **path, size_t *pathsize) {
size_t index = size;
if (size == 0)
return;
for (;;) {
ZOPFLI_APPEND_DATA(length_array[index], path, pathsize);
assert(length_array[index] <= index);
as... | TraceBackwards | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
int TryGetFromLongestMatchCache(ZopfliBlockState *s, size_t pos, size_t *limit,
unsigned short *sublen,
unsigned short *distance,
unsigned short *length) {
bool v6;
bool v7;
unsigned int v8;
unsigned char cache_avail... | static int TryGetFromLongestMatchCache(ZopfliBlockState *s, size_t pos,
size_t *limit, unsigned short *sublen,
unsigned short *distance,
unsigned short *length) {
size_t lmcpos = pos - s->blockstart;
... | TryGetFromLongestMatchCache | zopfli-1.0.3 | app-arch | O0/app-arch/zopfli-1.0.3/libzopfli.so.1.0.3 | ida | O0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.