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 |
|---|---|---|---|---|---|---|---|
sb_event_t *file_next_event(sb_event_t *__return_ptr retstr, int thread_id) {
if (test_mode == MODE_WRITE || test_mode == MODE_REWRITE ||
test_mode == MODE_READ)
file_get_seq_request(retstr);
else
file_get_rnd_request(retstr, thread_id);
return retstr;
} | sb_event_t file_next_event(int thread_id) {
if (test_mode == MODE_WRITE || test_mode == MODE_REWRITE ||
test_mode == MODE_READ)
return file_get_seq_request();
return file_get_rnd_request(thread_id);
} | file_next_event | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
ssize_t file_pread(unsigned int file_id, void *buf, ssize_t count, long offset,
int thread_id) {
FILE_DESCRIPTOR fd;
iocb iocb;
unsigned long v10;
v10 = __readfsqword(0x28u);
fd = files[file_id];
switch (file_io_mode) {
case FILE_IO_MODE_SYNC:
return pread(fd, buf, count, offset);
... | ssize_t file_pread(unsigned int file_id, void *buf, ssize_t count,
long long offset, int thread_id) {
FILE_DESCRIPTOR fd = files[file_id];
#ifdef HAVE_MMAP
void *start;
long long page_addr;
long long page_offset;
#endif
#ifdef HAVE_LIBAIO
struct iocb iocb;
#else
(void)thread_id;
#endif
... | file_pread | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
int file_prepare() {
long v0;
long v1;
long v2;
FILE_DESCRIPTOR *v4;
long v5;
long v6;
long v7;
long v8;
long v9;
long v10;
long v11;
long v12;
long v13;
long v14;
char *v15;
char *v16;
long v17;
long v18;
long v19;
long v20;
long v21;
unsigned int i;
stat buf;
char ss1[1... | int file_prepare(void) {
unsigned int i;
char file_name[512];
for (i = 0; i < num_files; i++) {
snprintf(file_name, sizeof(file_name), "test_file.%d", i);
if (test_mode == MODE_WRITE) {
unlink(file_name);
if (sb_create(file_name)) {
log_errno(LOG_FATAL, "Cannot create file '%s'", fil... | file_prepare | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
void file_print_mode() {
char *v0;
long v1;
long v2;
char *v3;
long v4;
long v5;
long v6;
char *v7;
long v8;
long v9;
long v10;
long v11;
long v12;
long v13;
long v14;
char *v15;
long v16;
long v17;
long v18;
long v19;
long v20;
long v21;
long v22;
const char *io_mode_str... | void file_print_mode(void) {
char sizestr[16];
print_file_extra_flags();
log_text(LOG_NOTICE, "%d files, %sB each", num_files,
sb_print_value_size(sizestr, sizeof(sizestr), file_size));
log_text(
LOG_NOTICE, "%sB total file size",
sb_print_value_size(sizestr, sizeof(sizestr), file_size *... | file_print_mode | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
ssize_t file_pwrite(unsigned int file_id, void *buf, ssize_t count, long offset,
int thread_id) {
FILE_DESCRIPTOR fd;
iocb iocb;
unsigned long v10;
v10 = __readfsqword(0x28u);
fd = files[file_id];
switch (file_io_mode) {
case FILE_IO_MODE_SYNC:
return pwrite(fd, buf, count, offset... | ssize_t file_pwrite(unsigned int file_id, void *buf, ssize_t count,
long long offset, int thread_id) {
FILE_DESCRIPTOR fd = files[file_id];
#ifdef HAVE_MMAP
void *start;
size_t page_addr;
size_t page_offset;
#endif
#ifdef HAVE_LIBAIO
struct iocb iocb;
#else
(void)thread_id;
#endif
if ... | file_pwrite | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
void file_report_cumulative(sb_stat_t *stat) {
unsigned long v1;
long v2;
long v3;
long v4;
double v5;
double v6;
double v7;
long v8;
long v9;
long v10;
long v11;
double seconds;
seconds = stat->time_interval;
pthread_mutex_lock(&mutex);
if ((bytes_written & 0x8000000000000000LL) != 0LL) ... | void file_report_cumulative(sb_stat_t *stat) {
const double seconds = stat->time_interval;
SB_THREAD_MUTEX_LOCK();
log_text(LOG_NOTICE,
"\n"
"File operations:\n"
" reads/s: %4.2f\n"
" writes/s: %4.2f\n"
" fs... | file_report_cumulative | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
void file_report_intermediate(sb_stat_t *stat) {
double v1;
double v2;
double v3;
double v4;
double v5;
unsigned long diff_read;
unsigned long diff_written;
unsigned long diff_other_ops;
pthread_mutex_lock(&mutex);
diff_read = bytes_read - last_bytes_read;
diff_written = bytes_written - last_byte... | void file_report_intermediate(sb_stat_t *stat) {
unsigned long long diff_read;
unsigned long long diff_written;
unsigned long long diff_other_ops;
SB_THREAD_MUTEX_LOCK();
diff_read = bytes_read - last_bytes_read;
diff_written = bytes_written - last_bytes_written;
diff_other_ops = other_ops - last_other_... | file_report_intermediate | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
int file_submit_or_wait(iocb *iocb, sb_file_op_t type, ssize_t len,
int thread_id) {
long v4;
long v5;
long v6;
long v7;
long v9;
long v10;
long v11;
long v12;
iocb *iocbp;
sb_aio_oper_t *oper;
unsigned long v17;
v17 = __readfsqword(0x28u);
oper = (sb_aio_oper_t *)mall... | int file_submit_or_wait(struct iocb *iocb, sb_file_op_t type, ssize_t len,
int thread_id) {
sb_aio_oper_t *oper;
struct iocb *iocbp;
oper = (sb_aio_oper_t *)malloc(sizeof(sb_aio_oper_t));
if (oper == NULL) {
log_text(LOG_FATAL, "Failed to allocate AIO operation!");
return 1;
}... | file_submit_or_wait | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
int file_thread_done(int thread_id) {
unsigned int i;
if (file_fsync_end && test_mode && test_mode != MODE_RND_READ) {
for (i = 0; i < num_files; ++i) {
if (file_fsync(i, thread_id))
return 1;
}
}
if (file_io_mode == FILE_IO_MODE_ASYNC && aio_ctxts[thread_id].nrequests)
return file_wa... | int file_thread_done(int thread_id) {
if (file_fsync_end && test_mode != MODE_READ && test_mode != MODE_RND_READ) {
for (unsigned i = 0; i < num_files; i++) {
if (file_fsync(i, thread_id))
return 1;
}
}
#ifdef HAVE_LIBAIO
if (file_io_mode == FILE_IO_MODE_ASYNC && aio_ctxts[thread_id].nreque... | file_thread_done | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
int file_validate_buffer(unsigned char *buf, unsigned int len, size_t offset) {
long v3;
long v4;
long v5;
long v6;
long v7;
long v9;
long v10;
long v11;
unsigned int cs_offset;
unsigned int checksum;
cs_offset = len - 12;
checksum = crc32(0, buf, len - 12);
if (checksum == *(_DWORD *)&buf[le... | int file_validate_buffer(unsigned char *buf, unsigned int len, size_t offset) {
unsigned int checksum;
unsigned int cs_offset;
cs_offset = len - (FILE_CHECKSUM_LENGTH + FILE_OFFSET_LENGTH);
checksum = (unsigned int)crc32(0, (unsigned char *)buf, cs_offset);
if (checksum != *(unsigned int *)(void *)(buf + c... | file_validate_buffer | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
int file_wait(int thread_id, long nreq) {
int v2;
long v3;
long v4;
long v5;
long v6;
io_event *events;
unsigned int type;
long res;
long v11;
long i;
long nr;
io_event *event;
sb_aio_oper_t *oper;
v2 = io_getevents(aio_ctxts[thread_id].io_ctxt, nreq, file_async_backlog,
... | int file_wait(int thread_id, long nreq) {
long i;
long nr;
struct io_event *event;
sb_aio_oper_t *oper;
struct iocb *iocbp;
#ifdef HAVE_OLD_GETEVENTS
(void)nreq;
nr = io_getevents(aio_ctxts[thread_id].io_ctxt, file_async_backlog,
aio_ctxts[thread_id].events, NULL);
#else
nr = io_get... | file_wait | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
const char *get_io_mode_str(file_io_mode_t mode) {
if (mode == FILE_IO_MODE_MMAP)
return "fast mmaped";
if ((unsigned int)mode > FILE_IO_MODE_MMAP)
return "(unknown)";
if (mode)
return "asynchronous";
return "synchronous";
} | const char *get_io_mode_str(file_io_mode_t mode) {
switch (mode) {
case FILE_IO_MODE_SYNC:
return "synchronous";
case FILE_IO_MODE_ASYNC:
return "asynchronous";
case FILE_IO_MODE_MMAP:
#if SIZEOF_SIZE_T == 4
return "slow mmaped";
#else
return "fast mmaped";
#endif
default:
break;
}
re... | get_io_mode_str | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
const char *get_test_mode_str(file_test_mode_t mode) {
const char *result;
switch (mode) {
case MODE_READ:
result = "sequential read";
break;
case MODE_WRITE:
result = "sequential write (creation)";
break;
case MODE_REWRITE:
result = "sequential rewrite";
break;
case MODE_RND_READ:
... | const char *get_test_mode_str(file_test_mode_t mode) {
switch (mode) {
case MODE_WRITE:
return "sequential write (creation)";
case MODE_REWRITE:
return "sequential rewrite";
case MODE_READ:
return "sequential read";
case MODE_RND_READ:
return "random read";
case MODE_RND_WRITE:
return "r... | get_test_mode_str | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
void *hugetlb_alloc(size_t size) {
long v1;
long v2;
long v3;
long v5;
long v6;
long v7;
long v8;
int shmid;
void *ptr;
shmid_ds buf;
unsigned long v12;
v12 = __readfsqword(0x28u);
shmid = shmget(0, ((size - 1) & 0xFFFFFFFFFFBFFFFFLL) + 0x400000, 2432);
if (shmid >= 0) {
ptr = shmat(shm... | void *hugetlb_alloc(size_t size) {
int shmid;
void *ptr;
struct shmid_ds buf;
size = ((size - 1) & ~LARGE_PAGE_SIZE) + LARGE_PAGE_SIZE;
shmid = shmget(IPC_PRIVATE, size, SHM_HUGETLB | SHM_R | SHM_W);
if (shmid < 0) {
log_errno(LOG_FATAL, "Failed to allocate %zd bytes from HugeTLB memory.",
... | hugetlb_alloc | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
void init_vars() {
position = 0;
current_file = 0;
fsynced_file = 0;
req_performed = 0;
is_dirty = 0;
if (byte_99A20) {
prev_req.size = 0;
prev_req.operation = FILE_OP_TYPE_NULL;
prev_req.file_id = 0;
prev_req.pos = 0;
}
} | void init_vars(void) {
position = 0;
current_file = 0;
fsynced_file = 0;
req_performed = 0;
is_dirty = 0;
if (sb_globals.validate) {
prev_req.size = 0;
prev_req.operation = FILE_OP_TYPE_NULL;
prev_req.file_id = 0;
prev_req.pos = 0;
}
} | init_vars | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
int memory_init() {
long value_string;
long v1;
long v2;
long v3;
long v5;
long v6;
long v7;
long v8;
long v9;
long v10;
long v11;
long v12;
long v13;
long v14;
long v15;
long v16;
long v17;
size_t v18;
long v19;
long v20;
long v21;
long v22;
size_t **v23;
long v24;
lon... | int memory_init(void) {
unsigned int i;
char *s;
memory_block_size = sb_get_value_size("memory-block-size");
if (memory_block_size < SIZEOF_SIZE_T ||
(memory_block_size & (memory_block_size - 1)) != 0) {
log_text(LOG_FATAL, "Invalid value for memory-block-size: %s",
sb_get_value_string(... | memory_init | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
sb_event_t *memory_next_event(sb_event_t *__return_ptr retstr, int thread_id) {
unsigned long v2;
sb_event_t req;
if (memory_total_size <= 0 || (v2 = __readfsqword(0xFFFFFFC0),
__writefsqword(0xFFFFFFC0, v2 - 1), v2)) {
req.type = 2;
*retstr = req;
} else {
req.type... | sb_event_t memory_next_event(int thread_id) {
sb_event_t req;
(void)thread_id;
if (memory_total_size > 0 && !tls_total_ops--) {
req.type = SB_REQ_TYPE_NULL;
return req;
}
req.type = SB_REQ_TYPE_MEMORY;
return req;
} | memory_next_event | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
void memory_print_mode() {
long v0;
long v1;
long v2;
long v3;
long v4;
long v5;
long v6;
long v7;
long v8;
long v9;
long v10;
long v11;
long v12;
long v13;
long v14;
long v15;
long v16;
long v17;
long v18;
long v19;
long v20;
log_text(3u, "Running memory speed test with the... | void memory_print_mode(void) {
char *str;
log_text(LOG_NOTICE, "Running memory speed test with the following options:");
log_text(LOG_NOTICE, " block size: %ldKiB",
(long)(memory_block_size / 1024));
log_text(LOG_NOTICE, " total size: %ldMiB",
(long)(memory_total_size / 1024 / 1024));
... | memory_print_mode | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
void memory_report_cumulative(sb_stat_t *stat) {
long v1;
long v2;
long v3;
signed long events;
double v5;
uint64_t v6;
const char *v7;
long v8;
long v9;
long v10;
long v11;
long v12;
signed long v13;
double v14;
events = stat->events;
if (events < 0) {
v6 = stat->events & 1 | ((uns... | void memory_report_cumulative(sb_stat_t *stat) {
const double megabyte = 1024.0 * 1024.0;
log_text(LOG_NOTICE, "Total operations: %" PRIu64 " (%8.2f per second)\n",
stat->events, stat->events / stat->time_interval);
if (memory_oper != SB_MEM_OP_NONE) {
const double mb = stat->events * memory_bloc... | memory_report_cumulative | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
void memory_report_intermediate(sb_stat_t *stat) {
uint64_t v1;
double v2;
v1 = memory_block_size * stat->events;
if ((v1 & 0x8000000000000000LL) != 0LL)
v2 = (double)(int)(v1 & 1 | (v1 >> 1)) + (double)(int)(v1 & 1 | (v1 >> 1));
else
v2 = (double)(int)v1;
log_timestamp(3u, "%4.2f MiB/sec", stat->t... | void memory_report_intermediate(sb_stat_t *stat) {
const double megabyte = 1024.0 * 1024.0;
log_timestamp(LOG_NOTICE, stat->time_total, "%4.2f MiB/sec",
stat->events * memory_block_size / megabyte /
stat->time_interval);
} | memory_report_intermediate | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
int memory_thread_init(int thread_id) {
long v1;
long v2;
long v3;
long v4;
if (memory_total_size > 0) {
v2 = memory_block_size;
v1 = memory_total_size / memory_block_size % (unsigned int)dword_99600;
__writefsqword(0xFFFFFFC0, memory_total_size / memory_block_size /
... | int memory_thread_init(int thread_id) {
(void)thread_id;
if (memory_total_size > 0) {
tls_total_ops = memory_total_size / memory_block_size / sb_globals.threads;
}
switch (memory_scope) {
case SB_MEM_SCOPE_GLOBAL:
tls_buf = buffer;
break;
case SB_MEM_SCOPE_LOCAL:
tls_buf = buffers[thread_i... | memory_thread_init | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
int mutex_done() {
unsigned int i;
for (i = 0; i < mutex_num; ++i)
pthread_mutex_destroy(&thread_locks_0[i].mutex);
free(thread_locks_0);
return 0;
} | int mutex_done(void) {
unsigned int i;
for (i = 0; i < mutex_num; i++)
pthread_mutex_destroy(&thread_locks[i].mutex);
free(thread_locks);
return 0;
} | mutex_done | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
int mutex_execute_event(sb_event_t *sb_req, int thread_id) {
unsigned int i;
unsigned int current_lock;
sb_event_t_$2F9103B6E2A714A69FEA91D11449AADC *mutex_req;
mutex_req = &sb_req->u;
do {
current_lock = sb_rand_uniform(0, mutex_num - 1);
for (i = 0; i < sb_req->u.mutex_request.nloops; ++i)
ck... | int mutex_execute_event(sb_event_t *sb_req, int thread_id) {
unsigned int i;
unsigned int current_lock;
sb_mutex_request_t *mutex_req = &sb_req->u.mutex_request;
(void)thread_id;
do {
current_lock = sb_rand_uniform(0, mutex_num - 1);
for (i = 0; i < mutex_req->nloops; i++)
ck_pr_barrier();
... | mutex_execute_event | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
int mutex_init() {
long v0;
long v1;
long v2;
long v3;
unsigned int i;
mutex_num = sb_get_value_int("mutex-num");
mutex_loops = sb_get_value_int("mutex-loops");
mutex_locks = sb_get_value_int("mutex-locks");
thread_locks_0 = (thread_lock *)malloc(296LL * mutex_num);
if (thread_locks_0) {
for (i... | int mutex_init(void) {
unsigned int i;
mutex_num = sb_get_value_int("mutex-num");
mutex_loops = sb_get_value_int("mutex-loops");
mutex_locks = sb_get_value_int("mutex-locks");
thread_locks = (thread_lock *)malloc(mutex_num * sizeof(thread_lock));
if (thread_locks == NULL) {
log_text(LOG_FATAL, "Memory... | mutex_init | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
sb_event_t *mutex_next_event(sb_event_t *__return_ptr retstr, int thread_id) {
int v2;
sb_event_t sb_req;
v2 = __readfsdword(0xFFFFFFD8);
__writefsdword(0xFFFFFFD8, v2 + 1);
if (v2 <= 0) {
sb_req.type = 6;
*(_QWORD *)&sb_req.u.file_request.file_id =
__PAIR64__(mutex_loops, mutex_locks);
} e... | sb_event_t mutex_next_event(int thread_id) {
sb_event_t sb_req;
sb_mutex_request_t *mutex_req = &sb_req.u.mutex_request;
(void)thread_id;
if (tls_counter++ > 0)
sb_req.type = SB_REQ_TYPE_NULL;
else {
sb_req.type = SB_REQ_TYPE_MUTEX;
mutex_req->nlocks = mutex_locks;
mutex_req->nloops = mutex_... | mutex_next_event | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
void mutex_print_mode() {
long v0;
long v1;
long v2;
long v3;
log_text(4u, "Doing mutex performance test", v0, v1, v2, v3);
} | void mutex_print_mode(void) {
log_text(LOG_INFO, "Doing mutex performance test");
} | mutex_print_mode | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
int parse_arguments() {
long v0;
long v1;
long v2;
long v4;
long v5;
long v6;
long v7;
long v8;
long v9;
long v10;
long v11;
long v12;
long v13;
long v14;
long v15;
long v16;
long v17;
long v18;
long v19;
long v20;
long v21;
long v22;
long v23;
long v24;
long v25;
lon... | int parse_arguments(void) {
char *mode;
unsigned int i;
num_files = sb_get_value_int("file-num");
if (num_files <= 0) {
log_text(LOG_FATAL, "Invalid value for file-num: %d", num_files);
return 1;
}
total_size = sb_get_value_size("file-total-size");
if (total_size <= 0) {
log_text(LOG_FATAL, ... | parse_arguments | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
void print_file_extra_flags() {
const char *v0;
const char *v1;
const char *v2;
const char *v3;
if ((file_extra_flags & 4) != 0)
v0 = "directio";
else
v0 = (const char *)&unk_52EA2;
if ((file_extra_flags & 2) != 0)
v1 = "dsync ";
else
v1 = (const char *)&unk_52EA2;
if ((file_extra_fla... | static void print_file_extra_flags(void) {
log_text(LOG_NOTICE, "Extra file open flags: %s%s%s%s",
file_extra_flags == 0 ? "(none)" : "",
file_extra_flags & SB_FILE_FLAG_SYNC ? "sync " : "",
file_extra_flags & SB_FILE_FLAG_DSYNC ? "dsync " : "",
file_extra_flags & SB_FILE_F... | print_file_extra_flags | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
int register_test_cpu(sb_list_t *tests) {
cpu_test.listitem.prev_p = tests->prev_p;
cpu_test.listitem.next_p = tests;
tests->prev_p = &cpu_test.listitem;
cpu_test.listitem.prev_p->next_p = &cpu_test.listitem;
return 0;
} | int register_test_cpu(sb_list_t *tests) {
SB_LIST_ADD_TAIL(&cpu_test.listitem, tests);
return 0;
} | register_test_cpu | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
int register_test_fileio(sb_list_t *tests) {
fileio_test.listitem.prev_p = tests->prev_p;
fileio_test.listitem.next_p = tests;
tests->prev_p = &fileio_test.listitem;
fileio_test.listitem.prev_p->next_p = &fileio_test.listitem;
return 0;
} | int register_test_fileio(sb_list_t *tests) {
SB_LIST_ADD_TAIL(&fileio_test.listitem, tests);
return 0;
} | register_test_fileio | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
int register_test_memory(sb_list_t *tests) {
memory_test.listitem.prev_p = tests->prev_p;
memory_test.listitem.next_p = tests;
tests->prev_p = &memory_test.listitem;
memory_test.listitem.prev_p->next_p = &memory_test.listitem;
return 0;
} | int register_test_memory(sb_list_t *tests) {
SB_LIST_ADD_TAIL(&memory_test.listitem, tests);
return 0;
} | register_test_memory | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
int register_test_mutex(sb_list_t *tests) {
mutex_test.listitem.prev_p = tests->prev_p;
mutex_test.listitem.next_p = tests;
tests->prev_p = &mutex_test.listitem;
mutex_test.listitem.prev_p->next_p = &mutex_test.listitem;
return 0;
} | int register_test_mutex(sb_list_t *tests) {
SB_LIST_ADD_TAIL(&mutex_test.listitem, tests);
return 0;
} | register_test_mutex | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
int register_test_threads(sb_list_t *tests) {
threads_test.listitem.prev_p = tests->prev_p;
threads_test.listitem.next_p = tests;
tests->prev_p = &threads_test.listitem;
threads_test.listitem.prev_p->next_p = &threads_test.listitem;
return 0;
} | int register_test_threads(sb_list_t *tests) {
SB_LIST_ADD_TAIL(&threads_test.listitem, tests);
return 0;
} | register_test_threads | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
int remove_files() {
long v0;
long v1;
long v2;
long v3;
unsigned int i;
char file_name[520];
unsigned long v7;
v7 = __readfsqword(0x28u);
log_text(3u, "Removing test files...", v0, v1, v2, v3);
for (i = 0; i < num_files; ++i) {
snprintf(file_name, 0x200u, "test_file.%d", i);
unlink(file_na... | int remove_files(void) {
unsigned int i;
char file_name[512];
log_text(LOG_NOTICE, "Removing test files...");
for (i = 0; i < num_files; i++) {
snprintf(file_name, sizeof(file_name), "test_file.%d", i);
unlink(file_name);
}
return 0;
} | remove_files | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
int sb_create(const char *path) {
FILE_DESCRIPTOR file;
file = open(path, 192, 384);
close(file);
return file < 0;
} | static int sb_create(const char *path) {
FILE_DESCRIPTOR file;
int res;
#ifndef _WIN32
file = open(path, O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
res = !VALID_FILE(file);
close(file);
#else
file = CreateFile(path, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_NEW, 0,
NULL);
res = !VALID_... | sb_create | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
void sb_free_memaligned(void *buf) { free(buf); } | static void sb_free_memaligned(void *buf) {
#ifdef _WIN32
VirtualFree(buf, 0, MEM_FREE);
#else
free(buf);
#endif
} | sb_free_memaligned | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
unsigned long sb_get_allocation_granularity() { return sb_getpagesize(); } | unsigned long sb_get_allocation_granularity(void) {
#ifdef _WIN32
SYSTEM_INFO info;
GetSystemInfo(&info);
return info.dwAllocationGranularity;
#else
return sb_getpagesize();
#endif
} | sb_get_allocation_granularity | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
FILE_DESCRIPTOR sb_open(const char *name) {
int flags;
unsigned long v3;
v3 = __readfsqword(0x28u);
flags = 0;
if (convert_extra_flags(file_extra_flags, &flags))
return -1;
else
return open(name, flags | 2, 384);
} | static FILE_DESCRIPTOR sb_open(const char *name) {
FILE_DESCRIPTOR file;
int flags = 0;
if (convert_extra_flags(file_extra_flags, &flags))
return SB_INVALID_FILE;
#ifndef _WIN32
file = open(name, O_RDWR | flags, S_IRUSR | S_IWUSR);
#else
file = CreateFile(name, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPE... | sb_open | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
int threads_cleanup() {
unsigned int i;
for (i = 0; i < thread_locks; ++i)
pthread_mutex_destroy(&test_mutexes[i]);
free(test_mutexes);
return 0;
} | int threads_cleanup(void) {
unsigned int i;
for (i = 0; i < thread_locks; i++)
pthread_mutex_destroy(test_mutexes + i);
free(test_mutexes);
return 0;
} | threads_cleanup | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
int threads_execute_event(sb_event_t *sb_req, int thread_id) {
unsigned int i;
sb_event_t_$2F9103B6E2A714A69FEA91D11449AADC *threads_req;
threads_req = &sb_req->u;
for (i = 0; i < thread_yields; ++i) {
pthread_mutex_lock(&test_mutexes[threads_req->file_request.file_id]);
pthread_yield();
pthread_mu... | int threads_execute_event(sb_event_t *sb_req, int thread_id) {
unsigned int i;
sb_threads_request_t *threads_req = &sb_req->u.threads_request;
(void)thread_id;
for (i = 0; i < thread_yields; i++) {
pthread_mutex_lock(&test_mutexes[threads_req->lock_num]);
YIELD();
pthread_mutex_unlock(&test_mutexe... | threads_execute_event | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
int threads_init() {
thread_yields = sb_get_value_int("thread-yields");
thread_locks = sb_get_value_int("thread-locks");
req_performed_0 = 0;
return 0;
} | int threads_init(void) {
thread_yields = sb_get_value_int("thread-yields");
thread_locks = sb_get_value_int("thread-locks");
req_performed = 0;
return 0;
} | threads_init | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
sb_event_t *threads_next_event(sb_event_t *__return_ptr retstr, int thread_id) {
sb_event_t sb_req;
sb_req.type = 5;
sb_req.u.file_request.file_id =
ck_pr_faa_uint_11(&req_performed_0, 1u) % thread_locks;
*retstr = sb_req;
return retstr;
} | sb_event_t threads_next_event(int thread_id) {
sb_event_t sb_req;
sb_threads_request_t *threads_req = &sb_req.u.threads_request;
(void)thread_id;
sb_req.type = SB_REQ_TYPE_THREADS;
threads_req->lock_num = ck_pr_faa_uint(&req_performed, 1) % thread_locks;
return sb_req;
} | threads_next_event | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
int threads_prepare() {
long v0;
long v1;
long v2;
long v3;
unsigned int i;
test_mutexes = (pthread_mutex_t *)malloc(40LL * thread_locks);
if (test_mutexes) {
for (i = 0; i < thread_locks; ++i)
pthread_mutex_init(&test_mutexes[i], 0);
return 0;
} else {
log_text(0, "Memory allocation ... | int threads_prepare(void) {
unsigned int i;
test_mutexes =
(pthread_mutex_t *)malloc(thread_locks * sizeof(pthread_mutex_t));
if (test_mutexes == NULL) {
log_text(LOG_FATAL, "Memory allocation failure!");
return 1;
}
for (i = 0; i < thread_locks; i++)
pthread_mutex_init(test_mutexes + i, N... | threads_prepare | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
void threads_print_mode() {
long v0;
long v1;
long v2;
long v3;
long v4;
long v5;
log_text(4u, "Doing thread subsystem performance test", v0, v1, v2, v3);
log_text(4u, "Thread yields per test: %d Locks used: %d", thread_yields,
thread_locks, v4, v5);
} | void threads_print_mode(void) {
log_text(LOG_INFO, "Doing thread subsystem performance test");
log_text(LOG_INFO, "Thread yields per test: %d Locks used: %d", thread_yields,
thread_locks);
} | threads_print_mode | sysbench-1.0.20-r101 | app-benchmarks | O0/app-benchmarks/sysbench-1.0.20-r101/sysbench | ida | O0 |
void append_comment(char *s) {
size_t v1;
if (!st_cmt) {
st_cmt = (char *)malloc(0x400u);
if (!st_cmt) {
fwrite("Out of memory entering comment", 1u, 0x1Eu, stderr);
exit(1);
}
st_cmt_size = 1024;
*st_cmt = 0;
}
while (1) {
v1 = strlen(st_cmt);
if (v1 + strlen(s) <= st_c... | static void append_comment(char *s) {
if (st_cmt == NULL) {
st_cmt = malloc(1024);
if (!st_cmt) {
fprintf(stderr, "Out of memory entering comment");
exit(1);
}
st_cmt_size = 1024;
st_cmt[0] = 0;
}
while (strlen(st_cmt) + strlen(s) > st_cmt_size) {
st_cmt = realloc(st_cmt, 2 * s... | append_comment | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/dskconv | ida | O0 |
void args_complete(int *argc, char **argv) {
int n;
for (n = 1; n < *argc; ++n) {
if (!strcasecmp(argv[n], "--")) {
excise_arg(n, argc, argv);
return;
}
if (*argv[n] == 45) {
fprintf(stderr, "Unknown option: %s\n", argv[n]);
exit(1);
}
}
} | void args_complete(int *argc, char **argv) {
int n;
for (n = 1; n < *argc; n++) {
if (!strcmpi(argv[n], "--")) {
excise_arg(n, argc, argv);
return;
}
if (argv[n][0] == '-') {
fprintf(stderr, "Unknown option: %s\n", argv[n]);
exit(1);
}
}
} | args_complete | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/dskconv | ida | O0 |
char *check_comment(char *arg, int *argc, char **argv) {
int n;
char *v;
n = find_arg(arg, *argc, argv);
if (n < 0)
return 0;
excise_arg(n, argc, argv);
if (n >= *argc)
return get_comment_stdin();
v = argv[n];
excise_arg(n, argc, argv);
if (*v != 64)
return v;
if (v[1] == 45)
return... | char *check_comment(char *arg, int *argc, char **argv) {
int n = find_arg(arg, *argc, argv);
char *v;
if (n < 0)
return NULL;
excise_arg(n, argc, argv);
if (n >= *argc) {
return get_comment_stdin();
}
v = argv[n];
excise_arg(n, argc, argv);
if (v[0] == '@') {
if (v[1] == '-')
retur... | check_comment | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/dskconv | ida | O0 |
int check_forcehead(char *arg, int *argc, char **argv) {
int n;
int fh;
n = find_arg(arg, *argc, argv);
if (n < 0)
return -1;
excise_arg(n, argc, argv);
if (n >= *argc || *argv[n] <= 47 || *argv[n] > 49) {
fprintf(stderr, "Syntax error: use '%s 0' or '%s 1'\n", arg, arg);
exit(1);
}
fh = *a... | int check_forcehead(char *arg, int *argc, char **argv) {
int n = find_arg(arg, *argc, argv);
int fh;
if (n < 0)
return -1;
excise_arg(n, argc, argv);
if (n >= *argc || argv[n][0] < '0' || argv[n][0] > '1') {
fprintf(stderr, "Syntax error: use '%s 0' or '%s 1'\n", arg, arg);
exit(1);
}
fh = a... | check_forcehead | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/dskconv | ida | O0 |
dsk_format_t check_format(char *arg, int *argc, char **argv) {
dsk_format_t fmt;
int n;
dsk_cchar_t fname;
char *argname;
unsigned long v9;
v9 = __readfsqword(0x28u);
n = find_arg(arg, *argc, argv);
if (n < 0)
return FMT_UNKNOWN;
excise_arg(n, argc, argv);
if (n >= *argc) {
fprintf(stderr, ... | dsk_format_t check_format(char *arg, int *argc, char **argv) {
int fmt;
int n = find_arg(arg, *argc, argv);
dsk_cchar_t fname;
char *argname;
if (n < 0)
return -1;
excise_arg(n, argc, argv);
if (n >= *argc) {
fprintf(stderr, "Syntax error: use '%s <format>'\n", arg);
exit(1);
}
argname = ... | check_format | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/dskconv | ida | O0 |
unsigned int check_retry(char *arg, int *argc, char **argv) {
int n;
int nr;
n = find_arg(arg, *argc, argv);
if (n < 0)
return 1;
excise_arg(n, argc, argv);
if (n >= *argc || !atoi(argv[n])) {
fprintf(stderr, "Syntax error: use '%s nnn' where nnn is nonzero\n", arg);
exit(1);
}
nr = atoi(ar... | unsigned check_retry(char *arg, int *argc, char **argv) {
int n = find_arg(arg, *argc, argv);
unsigned nr;
if (n < 0)
return 1;
excise_arg(n, argc, argv);
if (n >= *argc || atoi(argv[n]) == 0) {
fprintf(stderr, "Syntax error: use '%s nnn' where nnn is nonzero\n", arg);
exit(1);
}
nr = atoi(a... | check_retry | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/dskconv | ida | O0 |
char *check_type(char *arg, int *argc, char **argv) {
int n;
char *v;
n = find_arg(arg, *argc, argv);
if (n < 0)
return 0;
excise_arg(n, argc, argv);
if (n >= *argc) {
fprintf(stderr, "Syntax error: use '%s <type>'\n", arg);
exit(1);
}
v = argv[n];
excise_arg(n, argc, argv);
if (!strcas... | char *check_type(char *arg, int *argc, char **argv) {
int n = find_arg(arg, *argc, argv);
char *v;
if (n < 0)
return NULL;
excise_arg(n, argc, argv);
if (n >= *argc) {
fprintf(stderr, "Syntax error: use '%s <type>'\n", arg);
exit(1);
}
v = argv[n];
excise_arg(n, argc, argv);
if (!strcm... | check_type | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/dskconv | ida | O0 |
int do_copy(char *infile, char *outfile) {
const char *v2;
const char *v3;
const char *v5;
unsigned int e;
DSK_PDRIVER indr;
DSK_PDRIVER outdr;
DSK_GEOMETRY *dg;
char *op;
DSK_GEOMETRY tmp;
unsigned long v12;
v12 = __readfsqword(0x28u);
indr = 0;
outdr = 0;
op = "Opening";
dsk_reportfunc_... | int do_copy(char *infile, char *outfile) {
DSK_PDRIVER indr = NULL, outdr = NULL;
DSK_GEOMETRY *dg;
DSK_GEOMETRY tmp;
dsk_err_t e;
char *op = "Opening";
dsk_reportfunc_set(report, report_end);
e = dsk_open(&indr, infile, intyp, incomp);
if (!e)
e = dsk_creat(&outdr, outfile, outtyp, outcomp);
p... | do_copy | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/dskconv | ida | O0 |
void excise_arg(int na, int *argc, char **argv) {
--*argc;
while (na < *argc) {
argv[na] = argv[na + 1];
++na;
}
} | void excise_arg(int na, int *argc, char **argv) {
int n;
--(*argc);
for (n = na; n < *argc; n++) {
argv[n] = argv[n + 1];
}
} | excise_arg | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/dskconv | ida | O0 |
int find_arg(char *arg, int argc, char **argv) {
int n;
for (n = 1; n < argc; ++n) {
if (!strcasecmp(argv[n], "--"))
return -1;
if (!strcasecmp(argv[n], arg))
return n;
}
return -1;
} | int find_arg(char *arg, int argc, char **argv) {
int n;
for (n = 1; n < argc; n++) {
if (!strcmpi(argv[n], "--"))
return -1;
if (!strcmpi(argv[n], arg))
return n;
}
return -1;
} | find_arg | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/dskconv | ida | O0 |
int formats() {
dsk_format_t v0;
dsk_format_t format;
dsk_cchar_t fname;
dsk_cchar_t fdesc[2];
fdesc[1] = (dsk_cchar_t)__readfsqword(0x28u);
puts("Disk formats supported:\n");
format = FMT_180K;
while (1) {
v0 = format++;
if ((unsigned int)dg_stdformat(0, (unsigned int)v0, &fname, fdesc))
... | int formats(void) {
dsk_format_t format;
dsk_cchar_t fname, fdesc;
printf("Disk formats supported:\n\n");
format = FMT_180K;
while (dg_stdformat(NULL, format++, &fname, &fdesc) == DSK_ERR_OK) {
printf(" %-10.10s : %s\n", fname, fdesc);
}
return 0;
} | formats | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/dskconv | ida | O0 |
char *get_comment(char *filename) {
FILE *fp;
char buf[88];
unsigned long v4;
v4 = __readfsqword(0x28u);
fp = fopen(filename, "r");
if (!fp) {
perror(filename);
exit(1);
}
while (fgets(buf, 81, fp))
append_comment(buf);
fclose(fp);
return st_cmt;
} | static char *get_comment(char *filename) {
char buf[81];
FILE *fp = fopen(filename, "r");
if (!fp) {
perror(filename);
exit(1);
}
while (fgets(buf, sizeof(buf), fp)) {
append_comment(buf);
}
fclose(fp);
return st_cmt;
} | get_comment | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/dskconv | ida | O0 |
char *get_comment_stdin() {
char *p;
char buf[88];
unsigned long v3;
v3 = __readfsqword(0x28u);
puts("Enter the comment. Use a dot on a line by itself to mark the end.");
while (1) {
putchar(58);
fflush(stdout);
p = fgets(buf, 81, stdin);
if (!p || !strcmp(p, ".") || !strcmp(p, ".\n"))
... | static char *get_comment_stdin(void) {
char buf[81];
char *p;
printf("Enter the comment. Use a dot on a line by itself to mark the "
"end.\n");
do {
putchar(':');
fflush(stdout);
p = fgets(buf, sizeof(buf), stdin);
if ((p == NULL) || !strcmp(p, ".") || !strcmp(p, ".\n"))
break;
... | get_comment_stdin | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/dskconv | ida | O0 |
const char *guess_type(const char *arg) {
int n;
char *ext;
const char *exta;
if (!strncmp(arg, "gotek:", 6u) || !strncmp(arg, "gotek144:", 9u) ||
!strncmp(arg, "gotek1440:", 0xAu))
return "gotek1440";
if (!strncmp(arg, "gotek72:", 8u) || !strncmp(arg, "gotek720:", 9u))
return "gotek720";
if ... | const char *guess_type(const char *arg) {
const char *ext;
int n;
if (!strncmp(arg, "gotek:", 6) || !strncmp(arg, "gotek144:", 9) ||
!strncmp(arg, "gotek1440:", 10))
return "gotek1440";
if (!strncmp(arg, "gotek72:", 8) || !strncmp(arg, "gotek720:", 9))
return "gotek720";
#ifdef HAVE_LINUX_FDREG_... | guess_type | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/dskconv | ida | O0 |
int help(int argc, char **argv) {
char *v2;
char *v3;
char *v4;
char *v5;
char *v6;
v2 = __xpg_basename(*argv);
fprintf(stderr, "Syntax: \n %s {options} in-image out-image\n", v2);
v3 = __xpg_basename(*argv);
v4 = __xpg_basename(*argv);
fprintf(stderr,
"\n"
"Options are:\n"... | int help(int argc, char **argv) {
fprintf(stderr,
"Syntax: \n"
" %s {options} in-image out-image\n",
AV0);
fprintf(stderr,
"\nOptions are:\n"
"-itype <type> type of input disc image\n"
"-otype <type> type of output disc image\n"
" ... | help | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/dskconv | ida | O0 |
int ignore_arg(char *arg, int count, int *argc, char **argv) {
int n;
n = find_arg(arg, *argc, argv);
if (n < 0)
return 0;
fwrite("Warning: option '", 1u, 0x11u, stderr);
do {
if (!count)
break;
fprintf(stderr, "%s ", argv[n]);
excise_arg(n, argc, argv);
--count;
} while (n < *arg... | int ignore_arg(char *arg, int count, int *argc, char **argv) {
int n = find_arg(arg, *argc, argv);
if (n < 0)
return 0;
fprintf(stderr, "Warning: option '");
while (count) {
fprintf(stderr, "%s ", argv[n]);
excise_arg(n, argc, argv);
--count;
if (n >= *argc)
break;
}
fprintf(stde... | ignore_arg | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/dskconv | ida | O0 |
int main(int argc, const char **argv, const char **envp) {
int argca[4];
argca[0] = argc;
if (!standard_args(argc, (char **)argv))
return 0;
if (argca[0] <= 2 || find_arg("--help", argca[0], (char **)argv) > 0)
return help(argca[0], (char **)argv);
ignore_arg("-type", 2, argca, (char **)argv);
igno... | int main(int argc, char **argv) {
int stdret;
stdret = standard_args(argc, argv);
if (!stdret)
return 0;
if (argc < 3)
return help(argc, argv);
if (find_arg("--help", argc, argv) > 0)
return help(argc, argv);
ignore_arg("-type", 2, &argc, argv);
ignore_arg("-comp", 2, &argc, argv);
intyp ... | main | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/dskconv | ida | O0 |
int present_arg(char *arg, int *argc, char **argv) {
int n;
n = find_arg(arg, *argc, argv);
if (n < 0)
return 0;
excise_arg(n, argc, argv);
return 1;
} | int present_arg(char *arg, int *argc, char **argv) {
int n = find_arg(arg, *argc, argv);
if (n < 0)
return 0;
excise_arg(n, argc, argv);
return 1;
} | present_arg | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/dskconv | ida | O0 |
void report(const char *s) {
printf("%-79.79s\r", s);
fflush(stdout);
} | static void report(const char *s) {
printf("%-79.79s\r", s);
fflush(stdout);
} | report | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/dskconv | ida | O0 |
void report_end() {
printf("\r%-79.79s\r", (const char *)&unk_3012);
fflush(stdout);
} | static void report_end(void) {
printf("\r%-79.79s\r", "");
fflush(stdout);
} | report_end | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/dskconv | ida | O0 |
int standard_args(int argc, char **argv) {
if (find_arg("--version", argc, argv) > 0 ||
find_arg("-version", argc, argv) > 0)
return version();
if (find_arg("--formats", argc, argv) > 0 ||
find_arg("-formats", argc, argv) > 0)
return formats();
if (find_arg("--types", argc, argv) <= 0 &&
... | int standard_args(int argc, char **argv) {
if (find_arg("--version", argc, argv) > 0 ||
find_arg("-version", argc, argv) > 0)
return version();
if (find_arg("--formats", argc, argv) > 0 ||
find_arg("-formats", argc, argv) > 0)
return formats();
if (find_arg("--types", argc, argv) > 0 || find_a... | standard_args | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/dskconv | ida | O0 |
int types() {
unsigned int v0;
unsigned int n;
char *type;
char *desc[2];
desc[1] = (char *)__readfsqword(0x28u);
n = 0;
puts("Disk image types supported:\n");
while (!(unsigned int)dsk_type_enum(n, &type)) {
v0 = n++;
dsk_typedesc_enum(v0, desc);
printf(" %-10.10s : %s\n", type, desc[0])... | int types(void) {
int n = 0;
char *type, *desc;
printf("Disk image types supported:\n\n");
while (!dsk_type_enum(n, &type)) {
dsk_typedesc_enum(n++, &desc);
printf(" %-10.10s : %s\n", type, desc);
}
return 0;
} | types | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/dskconv | ida | O0 |
int version() {
printf("libdsk version %s\n", "1.5.18");
return 0;
} | int version(void) {
printf("libdsk version %s\n", LIBDSK_VERSION);
return 0;
} | version | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/dskconv | ida | O0 |
void Cleanup() {
char *v0;
if (pszInputBuff) {
free(pszInputBuff);
v0 = pszCommandBuff;
if (pszCommandBuff)
LABEL_3:
free(v0);
} else {
v0 = pszCommandBuff;
if (pszCommandBuff)
goto LABEL_3;
}
} | void Cleanup() {
if (pszInputBuff)
free(pszInputBuff);
if (pszCommandBuff)
free(pszCommandBuff);
} | Cleanup | hercules-3.13-r1 | app-emulation | O0/app-emulation/hercules-3.13-r1/dyngui.so | ida | O0 |
REGS *CopyREGS(int cpu) {
long v1;
long v2;
char *v3;
long v4;
REGS *v5;
long v6;
REGS *v8;
if (cpu < 0) {
v2 = 184;
v1 = 0;
} else if (sysblk[28] <= cpu) {
v2 = 184;
v1 = 0;
} else {
v1 = cpu;
v2 = 40LL * cpu + 184;
}
v3 = (char *)sysblk + v2;
ptt_pthread_mutex_lock(v... | REGS *CopyREGS(int cpu) {
REGS *regs;
if (cpu < 0 || cpu >= sysblk.maxcpu)
cpu = 0;
obtain_lock(&sysblk.cpulock[cpu]);
if (!(regs = sysblk.regs[cpu])) {
release_lock(&sysblk.cpulock[cpu]);
return &sysblk.dummyregs;
}
memcpy(©regs, regs, sysblk.regs_copy_len);
if (!copyregs.hostregs) {... | CopyREGS | hercules-3.13-r1 | app-emulation | O0/app-emulation/hercules-3.13-r1/dyngui.so | ida | O0 |
void HandleForcedRefresh() {
prev_mips_rate = 0x7FFFFFFF;
prev_sios_rate = 0x7FFFFFFF;
prev_instcount = -1;
prev_pcpu = 0x7FFFFFFF;
pPrevTargetCPU_REGS = 0;
prev_cpustate = -1;
*(_OWORD *)prev_psw = -1;
*(_OWORD *)prev_gr = -1;
*(_OWORD *)&prev_gr[4] = -1;
*(_OWORD *)&prev_gr[8] = -1;
*(_OWORD *)&... | void HandleForcedRefresh() {
#ifdef OPTION_MIPS_COUNTING
prev_mips_rate = INT_MAX;
prev_sios_rate = INT_MAX;
#endif
prev_instcount = ULLONG_MAX;
prev_pcpu = INT_MAX;
pPrevTargetCPU_REGS = NULL;
prev_cpustate = 0xFF;
memset(prev_psw, 0xFF, sizeof(prev_psw));
memset(&prev_gr[0], 0xFF, sizeof(prev_gr));
... | HandleForcedRefresh | hercules-3.13-r1 | app-emulation | O0/app-emulation/hercules-3.13-r1/dyngui.so | ida | O0 |
void Initialize() {
int *v0;
char *v1;
const char *v2;
char *v3;
int *v4;
char *v5;
fStatusStream = stderr;
nInputStreamFileNum = fileno(stdin);
pszInputBuff = (char *)calloc(nInputBuffSize, 1u);
if (!pszInputBuff) {
v0 = __errno_location();
v1 = strerror(*v0);
v2 = "HHCDG006S malloc ps... | void Initialize() {
fOutputStream = OUTPUT_STREAM_FILE_PTR;
fStatusStream = STATUS_STREAM_FILE_PTR;
nInputStreamFileNum = fileno(INPUT_STREAM_FILE_PTR);
if (!(pszInputBuff = (char *)malloc(nInputBuffSize))) {
fprintf(stderr, _("HHCDG006S malloc pszInputBuff failed: %s\n"),
strerror(errno));
... | Initialize | hercules-3.13-r1 | app-emulation | O0/app-emulation/hercules-3.13-r1/dyngui.so | ida | O0 |
void NewUpdateDevStats() {
char v0;
long *v1;
char v2;
long v3;
char v4;
int v5;
long v6;
long v7;
long v8;
char v9;
long v10;
const char *v11;
const char **v12;
const char *v13;
const char *v14[9];
v14[1] = (const char *)__readfsqword(0x28u);
v0 = sysblk[547] & 0x40;
if (v0)
re... | void NewUpdateDevStats() {
DEVBLK *pDEVBLK;
GUISTAT *pGUIStat;
char *pDEVClass;
BYTE chOnlineStat, chBusyStat, chPendingStat, chOpenStat;
BOOL bUpdatesSent = FALSE;
static BOOL bFirstBatch = TRUE;
if (sysblk.shutdown)
return;
for (pDEVBLK = sysblk.firstdev; pDEVBLK != NULL; pDEVBLK = pDEVBLK->next... | NewUpdateDevStats | hercules-3.13-r1 | app-emulation | O0/app-emulation/hercules-3.13-r1/dyngui.so | ida | O0 |
void ProcessInputData() {
int v0;
int v1;
int v2;
int v3;
char *v4;
char *v5;
char *v6;
v0 = 0;
if (nInputLen >= 0)
v0 = nInputLen;
if (nInputBuffSize - 1 <= v0)
v0 = nInputBuffSize - 1;
nInputLen = v0;
for (pszInputBuff[v0] = 0; nInputLen; pszInputBuff[nInputLen] = 0) {
v4 = pszInp... | void ProcessInputData() {
char *pNewLineChar;
MINMAX(nInputLen, 0, (nInputBuffSize - 1));
*(pszInputBuff + nInputLen) = 0;
while (nInputLen && (pNewLineChar = strchr(pszInputBuff, '\n')) != NULL) {
nCommandLen = (pNewLineChar - pszInputBuff);
MINMAX(nCommandLen, 0, (nCommandBuffSize - 1));
memcpy... | ProcessInputData | hercules-3.13-r1 | app-emulation | O0/app-emulation/hercules-3.13-r1/dyngui.so | ida | O0 |
void ProcessingLoop() {
LOBYTE(sysblk[547]) |= 2u;
while (!bDoneProcessing) {
UpdateTargetCPU();
UpdateStatus();
ReadInputData(sysblk[439]);
ProcessInputData();
}
} | void ProcessingLoop() {
sysblk.panel_init = 1;
while (!bDoneProcessing) {
UpdateTargetCPU();
UpdateStatus();
ReadInputData(sysblk.panrate);
ProcessInputData();
}
} | ProcessingLoop | hercules-3.13-r1 | app-emulation | O0/app-emulation/hercules-3.13-r1/dyngui.so | ida | O0 |
void ReadInputData(int nTimeoutMillsecs) {
long v2;
int v3;
int v4;
int v5;
int v6;
int v7;
char *v8;
int v9;
char *v10;
timeval wait_interval_timeval;
fd_set input_fd_set;
unsigned long v13;
v13 = __readfsqword(0x28u);
memset(&input_fd_set, 0, sizeof(input_fd_set));
v2 = __fdelt_chk(nInp... | void ReadInputData(int nTimeoutMillsecs) {
size_t nMaxBytesToRead;
int nBytesRead;
char *pReadBuffer;
#if !defined(_MSVC_)
fd_set input_fd_set;
struct timeval wait_interval_timeval;
int rc;
FD_ZERO(&input_fd_set);
FD_SET(nInputStreamFileNum, &input_fd_set);
wait_interval_timeval.tv_sec = nTimeoutM... | ReadInputData | hercules-3.13-r1 | app-emulation | O0/app-emulation/hercules-3.13-r1/dyngui.so | ida | O0 |
void UpdateCPUStatus() {
char v0;
unsigned int v1;
long v2;
long v3;
char v4;
const char *v5;
U32 mipsrate;
U32 *p_siosrate;
U32 *p_mipsrate;
const char *v9;
char v10;
v0 = sysblk[547];
if ((v0 & 0x40) == 0) {
if (pTargetCPU_REGS == (REGS *)&sysblk[658]) {
v9 = "CP";
v10 = *((... | void UpdateCPUStatus() {
if (sysblk.shutdown)
return;
if (pTargetCPU_REGS == &sysblk.dummyregs) {
gui_fprintf(
fStatusStream,
"STATUS="
"%s%02X (((((((((((((((((((((((( OFFLINE ))))))))))))))))))))))))\n",
PTYPSTR(pcpu), pcpu);
} else {
gui_fprintf(fStatusStream,
... | UpdateCPUStatus | hercules-3.13-r1 | app-emulation | O0/app-emulation/hercules-3.13-r1/dyngui.so | ida | O0 |
void UpdateDeviceStatus() {
long *i;
long v1;
long v2;
long v3;
long v4;
long v5;
char v6;
int v7;
const char *v8[7];
v8[1] = (const char *)__readfsqword(0x28u);
if ((sysblk[547] & 0x40) == 0) {
for (i = *(long **)&sysblk[488]; i; i = (long *)*i) {
if (*((_DWORD *)i + 14) && (*((_BYTE *... | void UpdateDeviceStatus() {
DEVBLK *pDEVBLK;
char *pDEVClass;
BYTE chOnlineStat, chBusyStat, chPendingStat, chOpenStat;
if (sysblk.shutdown)
return;
for (pDEVBLK = sysblk.firstdev; pDEVBLK != NULL; pDEVBLK = pDEVBLK->nextdev) {
if (!pDEVBLK->allocated || !(pDEVBLK->pmcw.flag5 & PMCW5_V))
cont... | UpdateDeviceStatus | hercules-3.13-r1 | app-emulation | O0/app-emulation/hercules-3.13-r1/dyngui.so | ida | O0 |
void UpdateRegisters() {
REGS *v0;
FW v1;
FW v2;
FW v3;
FW v4;
FILE *v5;
U32 F;
U32 v7;
U32 v8;
U32 v9;
FILE *v10;
U32 v11;
U32 v12;
U32 v13;
U32 v14;
FILE *v15;
U32 v16;
U32 v17;
U32 v18;
U32 v19;
FILE *v20;
REGS *v21;
DW v22;
DW v23;
FILE *v24;
U64 D;
U64 v26;
F... | void UpdateRegisters() {
if (sysblk.shutdown)
return;
if (gui_wants_gregs) {
if (0 || prev_gr[0] != pTargetCPU_REGS->GR_L(0) ||
prev_gr[1] != pTargetCPU_REGS->GR_L(1) ||
prev_gr[2] != pTargetCPU_REGS->GR_L(2) ||
prev_gr[3] != pTargetCPU_REGS->GR_L(3)) {
prev_gr[0] = pTargetCPU... | UpdateRegisters | hercules-3.13-r1 | app-emulation | O0/app-emulation/hercules-3.13-r1/dyngui.so | ida | O0 |
void UpdateStatus() {
BYTE v0;
int v1;
int *v2;
int v3;
int *v4;
int v5;
long v6;
long v7;
long v8;
int v9;
REGS *v10;
int v11;
BYTE cpustate;
U64 v13;
__m128i si128;
if ((sysblk[547] & 0x40) != 0)
return;
copy_psw(pTargetCPU_REGS, psw);
v0 = psw[1] & 2;
wait_bit = v0;
if ((... | void UpdateStatus() {
BOOL bStatusChanged = FALSE;
if (sysblk.shutdown)
return;
copy_psw(pTargetCPU_REGS, psw);
wait_bit = (psw[1] & 0x02);
if (!(0 || CPUSTATE_STOPPING == pTargetCPU_REGS->cpustate ||
CPUSTATE_STOPPED == pTargetCPU_REGS->cpustate)) {
gui_fprintf(fStatusStream,
... | UpdateStatus | hercules-3.13-r1 | app-emulation | O0/app-emulation/hercules-3.13-r1/dyngui.so | ida | O0 |
void UpdateTargetCPU() {
if ((sysblk[547] & 0x40) == 0) {
pcpu = sysblk[580];
pTargetCPU_REGS = CopyREGS(pcpu);
}
} | void UpdateTargetCPU() {
if (!sysblk.shutdown)
pTargetCPU_REGS = CopyREGS(pcpu = sysblk.pcpu);
} | UpdateTargetCPU | hercules-3.13-r1 | app-emulation | O0/app-emulation/hercules-3.13-r1/dyngui.so | ida | O0 |
void *gui_debug_cd_cmd(char *pszCWD) {
if (gui_version >= 1.12)
gui_fprintf(fStatusStream, "]CWD=%s\n", pszCWD);
return 0;
} | void *gui_debug_cd_cmd(char *pszCWD) {
ASSERT(pszCWD);
if (gui_version >= 1.12)
gui_fprintf(fStatusStream, "]CWD=%s\n", pszCWD);
return NULL;
} | gui_debug_cd_cmd | hercules-3.13-r1 | app-emulation | O0/app-emulation/hercules-3.13-r1/dyngui.so | ida | O0 |
void *gui_debug_cpu_state(REGS *pREGS) {
char v1;
char v2;
long v3;
long v4;
void *(*v5)(REGS *);
if ((sysblk[547] & 0x40) == 0) {
v1 = 0;
if (pTargetCPU_REGS && pTargetCPU_REGS != pREGS)
return 0;
v2 = (*((_BYTE *)pREGS + 729) & 8) != 0;
if (bLoading_2 == v2) {
v3 = (unsigned c... | void *gui_debug_cpu_state(REGS *pREGS) {
void *(*next_debug_call)(REGS *);
static BOOL bLoading = FALSE;
static BOOL bStopped = FALSE;
if (sysblk.shutdown)
return NULL;
if (pTargetCPU_REGS && pREGS != pTargetCPU_REGS)
return NULL;
if (bLoading != (pREGS->loadstate ? TRUE : FALSE)) {
bLoading... | gui_debug_cpu_state | hercules-3.13-r1 | app-emulation | O0/app-emulation/hercules-3.13-r1/dyngui.so | ida | O0 |
void gui_fprintf(FILE *stream, const char *pszFormat, ...) {
va_list vl;
unsigned long v3;
va_start(vl, pszFormat);
v3 = __readfsqword(0x28u);
ptt_pthread_mutex_lock(&gui_fprintf_lock, "dyngui.c:1947");
((void (*)(FILE *, long, const char *, __va_list_tag *))__vfprintf_chk)(
stream, 1, pszFormat, vl)... | void gui_fprintf(FILE *stream, const char *pszFormat, ...) {
va_list vl;
va_start(vl, pszFormat);
obtain_lock(&gui_fprintf_lock);
vfprintf(stream, pszFormat, vl);
fflush(stream);
release_lock(&gui_fprintf_lock);
} | gui_fprintf | hercules-3.13-r1 | app-emulation | O0/app-emulation/hercules-3.13-r1/dyngui.so | ida | O0 |
void *gui_panel_command(char *pszCommand) {
char v1;
void *(*v2)(char *);
const char *v4;
BYTE v5;
char *v6;
char *v7;
long v8;
v1 = *pszCommand;
if (*pszCommand != 93) {
if (v1 == 42) {
logmsg("%s\n", pszCommand);
return 0;
}
if (v1 != 35) {
v2 = (void *(*)(char *))hdl_... | void *gui_panel_command(char *pszCommand) {
void *(*next_panel_command_handler)(char *pszCommand);
if (']' != *pszCommand)
goto NotSpecialGUICommand;
gui_forced_refresh = 1;
pszCommand++;
if (strncasecmp(pszCommand, "VERS=", 5) == 0) {
gui_version = atof(pszCommand + 5);
return NULL;
}
if... | gui_panel_command | hercules-3.13-r1 | app-emulation | O0/app-emulation/hercules-3.13-r1/dyngui.so | ida | O0 |
void gui_panel_display() {
ProcessConfigCommand(3, &DisQuietCmd_0, 0);
if (!bDoneProcessing) {
logmsg("HHCDG001I dyngui.dll initiated\n");
Initialize();
ProcessingLoop();
logmsg("HHCDG002I dyngui.dll terminated\n");
Cleanup();
}
} | void gui_panel_display() {
static char *DisQuietCmd[] = {"$zapcmd", "quiet", "NoCmd"};
SET_THREAD_NAME("dyngui");
ProcessConfigCommand(3, DisQuietCmd, NULL);
if (!bDoneProcessing) {
logmsg(_("HHCDG001I dyngui.dll initiated\n"));
Initialize();
ProcessingLoop();
logmsg(_("HHCDG002I dyngui.dll t... | gui_panel_display | hercules-3.13-r1 | app-emulation | O0/app-emulation/hercules-3.13-r1/dyngui.so | ida | O0 |
int apricot_to_pcdos(byte *buf, const char *filename, int verbose) {
short heads;
short sectors;
byte buf2[512];
unsigned long v8;
v8 = __readfsqword(0x28u);
memset(buf2, 0, sizeof(buf2));
if (!memcmp(buf + 324, pcd_magic, 0xCu)) {
memcpy(buf2, buf + 336, 0xA0u);
memcpy(buf2, pcdos_dummy, 3u);
... | static int apricot_to_pcdos(byte *buf, const char *filename, int verbose) {
byte buf2[512];
memset(buf2, 0, sizeof(buf2));
if (!memcmp(buf + 0x144, pcd_magic, sizeof(pcd_magic))) {
memcpy(buf2, buf + 0x150, 0xA0);
memcpy(buf2, pcdos_dummy, 3);
memcpy(buf2 + 0x40, pcdos_dummy + 0x40, 4);
} else {
... | apricot_to_pcdos | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/apriboot | ida | O0 |
int do_swapboot(int argc, char *outfile, char *outtyp, char *outcomp,
int forcehead) {
const char *v6;
unsigned int e;
DSK_PDRIVER outdr;
DSK_GEOMETRY dg;
unsigned long v13;
v13 = __readfsqword(0x28u);
outdr = 0;
dsk_reportfunc_set(report, report_end);
e = dsk_open(&outdr, outfile, ou... | int do_swapboot(int argc, char *outfile, char *outtyp, char *outcomp,
int forcehead) {
DSK_PDRIVER outdr = NULL;
dsk_err_t e;
DSK_GEOMETRY dg;
dsk_reportfunc_set(report, report_end);
e = dsk_open(&outdr, outfile, outtyp, outcomp);
if (!e)
e = dsk_set_retry(outdr, retries);
if (forcehe... | do_swapboot | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/apriboot | ida | O0 |
int help(int argc, char **argv) {
char *v2;
v2 = __xpg_basename(*argv);
fprintf(stderr,
"Syntax: \n"
" %s { options } dskimage { dskimage ... }\n"
"\n"
"Options are:\n"
" -pcdos: Force PCDOS format\n"
" -apricot: Force Apricot... | int help(int argc, char **argv) {
fprintf(stderr,
"Syntax: \n"
" %s { options } dskimage { dskimage ... }\n\n"
"Options are:\n"
" -pcdos: Force PCDOS format\n"
" -apricot: Force Apricot format\n"
" -type <type>: Type of disc ... | help | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/apriboot | ida | O0 |
int main(int argc, const char **argv, const char **envp) {
int arg;
int v5;
int v6;
int v7;
int argca;
int n;
int err;
int forcehead;
char *outtyp;
char *outcomp;
argca = argc;
if (!standard_args(argc, (char **)argv))
return 0;
if (argca <= 1)
return help(argca, (char **)argv);
igno... | int main(int argc, char **argv) {
char *outtyp;
char *outcomp;
int forcehead;
int n, err;
int stdret;
stdret = standard_args(argc, argv);
if (!stdret)
return 0;
if (argc < 2)
return help(argc, argv);
ignore_arg("-itype", 2, &argc, argv);
ignore_arg("-iside", 2, &argc, argv);
ignore_arg("... | main | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/apriboot | ida | O0 |
int pcdos_to_apricot(byte *buf, const char *filename, int verbose) {
int v3;
int v4;
int dirsize;
int heads;
long cylinders;
byte buf2[512];
unsigned long v11;
v11 = __readfsqword(0x28u);
memset(buf2, 0, sizeof(buf2));
if (!memcmp(buf + 324, apri_magic, 0xCu)) {
memcpy(buf2, buf + 336, 0xA0u);
... | static int pcdos_to_apricot(byte *buf, const char *filename, int verbose) {
byte buf2[512];
memset(buf2, 0, sizeof(buf2));
if (!memcmp(buf + 0x144, apri_magic, sizeof(apri_magic))) {
memcpy(buf2, buf + 0x150, 0xA0);
} else {
int bootsecs = buf[14] + 256 * buf[15];
int fatcopies = buf[16];
int ... | pcdos_to_apricot | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/apriboot | ida | O0 |
void report(const char *s) {
fprintf(stderr, "%-79.79s\r", s);
fflush(stderr);
} | static void report(const char *s) {
fprintf(stderr, "%-79.79s\r", s);
fflush(stderr);
} | report | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/apriboot | ida | O0 |
void report_end() {
fprintf(stderr, "\r%-79.79s\r", (const char *)&unk_5166);
fflush(stderr);
} | static void report_end(void) {
fprintf(stderr, "\r%-79.79s\r", "");
fflush(stderr);
} | report_end | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/apriboot | ida | O0 |
int sector_is_apricot(byte *buf) {
int n;
for (n = 0; n <= 7; ++n) {
if (buf[n] && (buf[n] <= 0x1Fu || buf[n] > 0x7Eu))
return 0;
}
return !buf[80] && buf[81] == 2;
} | static int sector_is_apricot(byte *buf) {
int n;
for (n = 0; n < 8; n++) {
if (buf[n] != 0 && (buf[n] < ' ' || buf[n] > '~')) {
return 0;
}
}
if (buf[80] != 0 || buf[81] != 2) {
return 0;
}
return 1;
} | sector_is_apricot | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/apriboot | ida | O0 |
int sector_is_pcdos(byte *buf) {
if (*buf && *buf != 0xE9 && *buf != 0xEB)
return 0;
return !buf[11] && buf[12] == 2;
} | static int sector_is_pcdos(byte *buf) {
if (buf[0] != 0 && buf[0] != 0xE9 && buf[0] != 0xEB) {
return 0;
}
if (buf[11] != 0 || buf[12] != 2) {
return 0;
}
return 1;
} | sector_is_pcdos | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/apriboot | ida | O0 |
int transform(MODE md, byte *buf, const char *filename, int verbose) {
int is_pcdos;
is_pcdos = 0;
if (sector_is_pcdos(buf)) {
is_pcdos = 1;
if (md == FORCE_PCDOS) {
fprintf(stderr, "%s: Is already in PCDOS format\n", filename);
return 0;
}
} else {
if (!sector_is_apricot(buf)) {
... | int transform(MODE md, byte *buf, const char *filename, int verbose) {
int is_pcdos = 0;
if (sector_is_pcdos(buf)) {
is_pcdos = 1;
if (md == FORCE_PCDOS) {
fprintf(stderr, "%s: Is already in PCDOS format\n", filename);
return 0;
}
} else if (sector_is_apricot(buf)) {
if (md == FORCE_A... | transform | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/apriboot | ida | O0 |
int check_numeric(char *arg, int *argc, char **argv) {
int n;
unsigned int nr;
n = find_arg(arg, *argc, argv);
if (n < 0)
return -1;
excise_arg(n, argc, argv);
if (n >= *argc || !atoi(argv[n])) {
fprintf(stderr, "Syntax error: use '%s nnn' where nnn is nonzero\n", arg);
exit(1);
}
nr = atoi... | int check_numeric(char *arg, int *argc, char **argv) {
int n = find_arg(arg, *argc, argv);
unsigned nr;
if (n < 0)
return -1;
excise_arg(n, argc, argv);
if (n >= *argc || atoi(argv[n]) == 0) {
fprintf(stderr, "Syntax error: use '%s nnn' where nnn is nonzero\n", arg);
exit(1);
}
nr = atoi(argv... | check_numeric | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/dskdump | ida | O0 |
int do_copy(char *infile, char *outfile) {
const char *v2;
unsigned int e;
unsigned int cyl;
dsk_phead_t head;
DSK_PDRIVER indr;
DSK_PDRIVER outdr;
char *cmt;
DSK_GEOMETRY dg;
unsigned long v11;
v11 = __readfsqword(0x28u);
indr = 0;
outdr = 0;
cmt = 0;
dsk_reportfunc_set(report, report_end)... | int do_copy(char *infile, char *outfile) {
DSK_PDRIVER indr = NULL, outdr = NULL;
dsk_err_t e;
dsk_pcyl_t cyl;
dsk_phead_t head;
char *cmt = NULL;
DSK_GEOMETRY dg;
dsk_reportfunc_set(report, report_end);
e = dsk_open(&indr, infile, intyp, incomp);
if (!e)
e = dsk_set_retry(indr, retries);
if (... | do_copy | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/dskdump | ida | O0 |
int dump_cyl(DSK_PDRIVER indr, DSK_GEOMETRY *dg, DSK_PDRIVER outdr,
dsk_pcyl_t cyl, dsk_phead_t head) {
DSK_FORMAT *v6;
long v7;
dsk_psect_t sector_count;
int deleted;
dsk_err_t err;
dsk_psect_t secnum;
unsigned int buflen;
dsk_psect_t osec;
DSK_FORMAT *fmt_track;
unsigned char *buf;
... | int dump_cyl(DSK_PDRIVER indr, DSK_GEOMETRY *dg, DSK_PDRIVER outdr,
dsk_pcyl_t cyl, dsk_phead_t head) {
dsk_err_t err = DSK_ERR_OK;
DSK_FORMAT sector_id;
DSK_FORMAT *fmt_track;
dsk_psect_t osec;
dsk_psect_t sector_count;
dsk_psect_t secnum;
unsigned buflen = 128;
dg->dg_noskip = 1;
for ... | dump_cyl | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/dskdump | ida | O0 |
int help(int argc, char **argv) {
char *v2;
char *v3;
char *v4;
char *v5;
char *v6;
v2 = __xpg_basename(*argv);
fprintf(stderr, "Syntax: \n %s {options} in-image { out-image }\n", v2);
v3 = __xpg_basename(*argv);
v4 = __xpg_basename(*argv);
fprintf(stderr,
"\n"
"Options are... | int help(int argc, char **argv) {
fprintf(stderr,
"Syntax: \n"
" %s {options} in-image { out-image }\n",
AV0);
fprintf(stderr,
"\nOptions are:\n"
"-itype <type> type of input disc image\n"
"-otype <type> type of output disc image\n"
" ... | help | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/dskdump | ida | O0 |
int main(int argc, const char **argv, const char **envp) {
int argca[4];
argca[0] = argc;
if (!standard_args(argc, (char **)argv))
return 0;
if (argca[0] <= 1 || find_arg("--help", argca[0], (char **)argv) > 0)
return help(argca[0], (char **)argv);
ignore_arg("-type", 2, argca, (char **)argv);
igno... | int main(int argc, char **argv) {
int stdret;
stdret = standard_args(argc, argv);
if (!stdret)
return 0;
if (argc < 2)
return help(argc, argv);
if (find_arg("--help", argc, argv) > 0)
return help(argc, argv);
ignore_arg("-type", 2, &argc, argv);
ignore_arg("-side", 2, &argc, argv);
ignore_... | main | libdsk-1.5.18 | app-emulation | O0/app-emulation/libdsk-1.5.18/dskdump | ida | O0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.