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 lafe_line_reader_find_eol(lafe_line_reader *lr) {
char *line_end;
const char *v2;
if (lr->nullSeparator)
v2 = &reject;
else
v2 = "\r\n";
line_end = lr->line_end;
lr->line_end = &line_end[strcspn(line_end, v2)];
*lr->line_end = 0;
} | static void lafe_line_reader_find_eol(struct lafe_line_reader *lr) {
lr->line_end += strcspn(lr->line_end, lr->nullSeparator ? "" : "\x0d\x0a");
*lr->line_end = '\0';
} | lafe_line_reader_find_eol | libarchive-3.6.1 | app-arch | O0/app-arch/libarchive-3.6.1/bsdcpio | ida | O0 |
void lafe_line_reader_free(lafe_line_reader *lr) {
free(lr->buff);
free(lr->pathname);
free(lr);
} | void lafe_line_reader_free(struct lafe_line_reader *lr) {
free(lr->buff);
free(lr->pathname);
free(lr);
} | lafe_line_reader_free | libarchive-3.6.1 | app-arch | O0/app-arch/libarchive-3.6.1/bsdcpio | ida | O0 |
const char *lafe_line_reader_next(lafe_line_reader *lr) {
char *pathname;
int *v3;
size_t new_buff_size;
char *p;
const char *line_start;
const char *line_starta;
while (1) {
while (lr->line_end < lr->buff_end) {
line_start = lr->line_start;
lr->line_start = ++lr->line_end;
lafe_lin... | const char *lafe_line_reader_next(struct lafe_line_reader *lr) {
size_t bytes_wanted, bytes_read, new_buff_size;
char *line_start, *p;
for (;;) {
while (lr->line_end < lr->buff_end) {
line_start = lr->line_start;
lr->line_start = ++lr->line_end;
lafe_line_reader_find_eol(lr);
if (lr... | lafe_line_reader_next | libarchive-3.6.1 | app-arch | O0/app-arch/libarchive-3.6.1/bsdcpio | ida | O0 |
char *lafe_readpassphrase(const char *prompt, char *buf, size_t bufsiz) {
int *v3;
char *p;
p = readpassphrase(prompt, buf, bufsiz, 0);
if (!p && *__errno_location() != 4) {
v3 = __errno_location();
lafe_errc(1, *v3, "Couldn't read passphrase");
}
return p;
} | char *lafe_readpassphrase(const char *prompt, char *buf, size_t bufsiz) {
char *p;
p = readpassphrase(prompt, buf, bufsiz, RPP_ECHO_OFF);
if (p == NULL) {
switch (errno) {
case EINTR:
break;
default:
lafe_errc(1, errno, "Couldn't read passphrase");
break;
}
}
return (p);
} | lafe_readpassphrase | libarchive-3.6.1 | app-arch | O0/app-arch/libarchive-3.6.1/bsdcpio | ida | O0 |
void list_item_verbose(cpio *cpio, archive_entry *entry) {
int64_t v2;
const char *v3;
int64_t v4;
const char *v5;
uid_t v6;
gid_t v7;
long v8;
long v9;
int64_t v10;
const char *v11;
const char *v12;
const char *v13;
const char *v14;
int v15;
const char *v16;
const char *v17;
const cha... | static void list_item_verbose(struct cpio *cpio, struct archive_entry *entry) {
char size[32];
char date[32];
char uids[16], gids[16];
const char *uname, *gname;
FILE *out = stdout;
const char *fmt;
time_t mtime;
static time_t now;
struct tm *ltime;
#if defined(HAVE_LOCALTIME_R) || defined(HAVE__LOCAL... | list_item_verbose | libarchive-3.6.1 | app-arch | O0/app-arch/libarchive-3.6.1/bsdcpio | ida | O0 |
void long_help() {
const char *v0;
const char *p;
const char *prog;
prog = lafe_getprogname();
fflush(stderr);
if (!strcmp(prog, "bsdcpio"))
v0 = &locale;
else
v0 = "(bsdcpio)";
printf("%s%s: manipulate archive files\n", prog, v0);
for (p = long_help_msg; *p; ++p) {
if (*p == 37) {
... | static void long_help(void) {
const char *prog;
const char *p;
prog = lafe_getprogname();
fflush(stderr);
p = (strcmp(prog, "bsdcpio") != 0) ? "(bsdcpio)" : "";
printf("%s%s: manipulate archive files\n", prog, p);
for (p = long_help_msg; *p != '\0'; p++) {
if (*p == '%') {
if (p[1] == 'p') {... | long_help | libarchive-3.6.1 | app-arch | O0/app-arch/libarchive-3.6.1/bsdcpio | ida | O0 |
const char *lookup_gname(cpio *cpio, gid_t gid) {
return lookup_name(cpio, &cpio->gname_cache,
(int (*)(cpio *, const char **, id_t))lookup_gname_helper,
gid);
} | static const char *lookup_gname(struct cpio *cpio, gid_t gid) {
return (
lookup_name(cpio, &cpio->gname_cache, &lookup_gname_helper, (id_t)gid));
} | lookup_gname | libarchive-3.6.1 | app-arch | O0/app-arch/libarchive-3.6.1/bsdcpio | ida | O0 |
int lookup_gname_helper(cpio *cpio, const char **name, id_t id) {
const char *v3;
int *v4;
struct group *grent;
*__errno_location() = 0;
grent = getgrgid(id);
if (grent) {
*name = grent->gr_name;
return 0;
} else {
if (*__errno_location()) {
if (*__errno_location() != 2) {
v3 = ... | static int lookup_gname_helper(struct cpio *cpio, const char **name, id_t id) {
struct group *grent;
(void)cpio;
errno = 0;
grent = getgrgid((gid_t)id);
if (grent == NULL) {
if (errno && errno != ENOENT)
lafe_warnc(errno, "getgrgid(%s) failed", cpio_i64toa((int64_t)id));
return 1;
}
*name... | lookup_gname_helper | libarchive-3.6.1 | app-arch | O0/app-arch/libarchive-3.6.1/bsdcpio | ida | O0 |
const char *lookup_name(cpio *cpio, name_cache **name_cache_variable,
int (*lookup_fn)(cpio *, const char **, id_t),
id_t id) {
char *v5;
int slot;
const char *name;
name_cache *cache;
char asnum[24];
unsigned long v12;
v12 = __readfsqword(0x28u);
if (!*n... | static const char *
lookup_name(struct cpio *cpio, struct name_cache **name_cache_variable,
int (*lookup_fn)(struct cpio *, const char **, id_t), id_t id) {
char asnum[16];
struct name_cache *cache;
const char *name;
int slot;
if (*name_cache_variable == NULL) {
*name_cache_variable = calloc(... | lookup_name | libarchive-3.6.1 | app-arch | O0/app-arch/libarchive-3.6.1/bsdcpio | ida | O0 |
const char *lookup_uname(cpio *cpio, uid_t uid) {
return lookup_name(cpio, &cpio->uname_cache,
(int (*)(cpio *, const char **, id_t))lookup_uname_helper,
uid);
} | static const char *lookup_uname(struct cpio *cpio, uid_t uid) {
return (
lookup_name(cpio, &cpio->uname_cache, &lookup_uname_helper, (id_t)uid));
} | lookup_uname | libarchive-3.6.1 | app-arch | O0/app-arch/libarchive-3.6.1/bsdcpio | ida | O0 |
int lookup_uname_helper(cpio *cpio, const char **name, id_t id) {
const char *v3;
int *v4;
struct passwd *pwent;
*__errno_location() = 0;
pwent = getpwuid(id);
if (pwent) {
*name = pwent->pw_name;
return 0;
} else {
if (*__errno_location()) {
if (*__errno_location() != 2) {
v3 =... | static int lookup_uname_helper(struct cpio *cpio, const char **name, id_t id) {
struct passwd *pwent;
(void)cpio;
errno = 0;
pwent = getpwuid((uid_t)id);
if (pwent == NULL) {
if (errno && errno != ENOENT)
lafe_warnc(errno, "getpwuid(%s) failed", cpio_i64toa((int64_t)id));
return 1;
}
*nam... | lookup_uname_helper | libarchive-3.6.1 | app-arch | O0/app-arch/libarchive-3.6.1/bsdcpio | ida | O0 |
int main(int argc, const char **argv, const char **envp) {
int extract_flags;
int v4;
int v5;
int v6;
const char *v7;
const char *v8;
int v9;
int v10;
int v11;
int v12;
int mode;
const char *v14;
int uid;
int gid;
int opt;
int t;
char *tptr;
cpio *cpio;
const char *errmsg;
cpio _... | int main(int argc, char *argv[]) {
static char buff[16384];
struct cpio _cpio;
struct cpio *cpio;
const char *errmsg;
char *tptr;
int uid, gid;
int opt, t;
cpio = &_cpio;
memset(cpio, 0, sizeof(*cpio));
cpio->buff = buff;
cpio->buff_size = sizeof(buff);
#if defined(HAVE_SIGACTION) && defined(SIG... | main | libarchive-3.6.1 | app-arch | O0/app-arch/libarchive-3.6.1/bsdcpio | ida | O0 |
void mode_in(cpio *cpio) {
const char *v1;
const char *v2;
const char *v3;
int v4;
const char *v5;
int v6;
const char *v7;
const char *v8;
const char *v9;
const char *v10;
const char *v11;
const char *v12;
int r;
int ra;
int rb;
archive_entry *entry;
const char *destpath;
archive *ex... | static void mode_in(struct cpio *cpio) {
struct archive *a;
struct archive_entry *entry;
struct archive *ext;
const char *destpath;
int r;
ext = archive_write_disk_new();
if (ext == NULL)
lafe_errc(1, 0, "Couldn't allocate restore object");
r = archive_write_disk_set_options(ext, cpio->extract_flag... | mode_in | libarchive-3.6.1 | app-arch | O0/app-arch/libarchive-3.6.1/bsdcpio | ida | O0 |
void mode_list(cpio *cpio) {
const char *v1;
const char *v2;
int v3;
const char *v4;
int v5;
const char *v6;
const char *v7;
const char *v8;
int r;
int ra;
archive_entry *entry;
archive *a;
int64_t blocks;
unsigned long v14;
v14 = __readfsqword(0x28u);
a = (archive *)archive_read_new();... | static void mode_list(struct cpio *cpio) {
struct archive *a;
struct archive_entry *entry;
int r;
a = archive_read_new();
if (a == NULL)
lafe_errc(1, 0, "Couldn't allocate archive object");
archive_read_support_filter_all(a);
archive_read_support_format_all(a);
if (cpio->option_pwb)
archive_rea... | mode_list | libarchive-3.6.1 | app-arch | O0/app-arch/libarchive-3.6.1/bsdcpio | ida | O0 |
void mode_out(cpio *cpio) {
int compress;
int add_filter;
const char *v3;
unsigned int v4;
const char *v5;
const char *v6;
const char *v7;
const char *v8;
int r;
int ra;
int rb;
archive_entry *entry;
archive_entry *spare;
lafe_line_reader *lr;
const char *p;
int64_t blocks;
unsigned lo... | static void mode_out(struct cpio *cpio) {
struct archive_entry *entry, *spare;
struct lafe_line_reader *lr;
const char *p;
int r;
if (cpio->option_append)
lafe_errc(1, 0, "Append mode not yet supported.");
cpio->archive_read_disk = archive_read_disk_new();
if (cpio->archive_read_disk == NULL)
la... | mode_out | libarchive-3.6.1 | app-arch | O0/app-arch/libarchive-3.6.1/bsdcpio | ida | O0 |
void mode_pass(cpio *cpio, const char *destdir) {
char *v2;
size_t destdir_len;
const char *v4;
const char *v5;
long v6;
const char *v7;
int r;
lafe_line_reader *lr;
const char *p;
cpio->destdir_len = strlen(destdir);
cpio->destdir = (char *)malloc(cpio->destdir_len + 8);
memcpy(cpio->destdir, ... | static void mode_pass(struct cpio *cpio, const char *destdir) {
struct lafe_line_reader *lr;
const char *p;
int r;
cpio->destdir_len = strlen(destdir);
cpio->destdir = malloc(cpio->destdir_len + 8);
memcpy(cpio->destdir, destdir, cpio->destdir_len);
if (cpio->destdir_len == 0 || destdir[cpio->destdir_len... | mode_pass | libarchive-3.6.1 | app-arch | O0/app-arch/libarchive-3.6.1/bsdcpio | ida | O0 |
const char *owner_parse(const char *spec, int *uid, int *gid) {
char *end;
const char *u;
const char *ue;
const char *g;
char *user;
passwd *pwent;
group *grp;
unsigned long v12;
v12 = __readfsqword(0x28u);
*uid = -1;
*gid = -1;
if (!*spec)
return "Invalid empty user/group spec";
if (*spe... | const char *owner_parse(const char *spec, int *uid, int *gid) {
static char errbuff[128];
const char *u, *ue, *g;
*uid = -1;
*gid = -1;
if (spec[0] == '\0')
return ("Invalid empty user/group spec");
if (*spec == ':' || *spec == '.') {
ue = u = NULL;
g = spec + 1;
} else {
ue = u = spe... | owner_parse | libarchive-3.6.1 | app-arch | O0/app-arch/libarchive-3.6.1/bsdcpio | ida | O0 |
const char *passphrase_callback(archive *a, void *_client_data) {
int *v2;
if (!*((_QWORD *)_client_data + 36)) {
*((_QWORD *)_client_data + 36) = malloc(0x400u);
if (!*((_QWORD *)_client_data + 36)) {
v2 = __errno_location();
lafe_errc(1, *v2, "Out of memory");
}
}
return lafe_readpass... | static const char *passphrase_callback(struct archive *a, void *_client_data) {
struct cpio *cpio = (struct cpio *)_client_data;
(void)a;
if (cpio->ppbuff == NULL) {
cpio->ppbuff = malloc(PPBUFF_SIZE);
if (cpio->ppbuff == NULL)
lafe_errc(1, errno, "Out of memory");
}
return lafe_readpassphrase(... | passphrase_callback | libarchive-3.6.1 | app-arch | O0/app-arch/libarchive-3.6.1/bsdcpio | ida | O0 |
void passphrase_free(char *ppbuff) {
if (ppbuff) {
memset(ppbuff, 0, 0x400u);
free(ppbuff);
}
} | static void passphrase_free(char *ppbuff) {
if (ppbuff != NULL) {
memset(ppbuff, 0, PPBUFF_SIZE);
free(ppbuff);
}
} | passphrase_free | libarchive-3.6.1 | app-arch | O0/app-arch/libarchive-3.6.1/bsdcpio | ida | O0 |
const char *remove_leading_slash(const char *p) {
const char *pa;
const char *rp;
pa = p;
if ((*p == 47 || *p == 92) && (p[1] == 47 || p[1] == 92) &&
(p[2] == 46 || p[2] == 63) && (p[3] == 47 || p[3] == 92)) {
if (p[2] == 63 && (p[4] == 85 || p[4] == 117) &&
(p[5] == 78 || p[5] == 110) && (p[... | static const char *remove_leading_slash(const char *p) {
const char *rp;
if ((p[0] == '/' || p[0] == '\\') && (p[1] == '/' || p[1] == '\\') &&
(p[2] == '.' || p[2] == '?') && (p[3] == '/' || p[3] == '\\')) {
if (p[2] == '?' && (p[4] == 'U' || p[4] == 'u') &&
(p[5] == 'N' || p[5] == 'n') && (p[6] ... | remove_leading_slash | libarchive-3.6.1 | app-arch | O0/app-arch/libarchive-3.6.1/bsdcpio | ida | O0 |
int restore_time(cpio *cpio, archive_entry *entry, const char *name, int fd) {
int *v5;
int fda;
timeval times[2];
unsigned long v9;
fda = fd;
v9 = __readfsqword(0x28u);
if (!cpio->option_atime_restore)
return fd;
times[1].tv_sec = archive_entry_mtime(entry);
times[1].tv_usec = archive_entry_mtim... | static int restore_time(struct cpio *cpio, struct archive_entry *entry,
const char *name, int fd) {
#ifndef HAVE_UTIMES
static int warned = 0;
(void)cpio;
(void)entry;
(void)name;
if (!warned)
lafe_warnc(0, "Can't restore access times on this platform");
warned = 1;
return (f... | restore_time | libarchive-3.6.1 | app-arch | O0/app-arch/libarchive-3.6.1/bsdcpio | ida | O0 |
void usage() {
const char *p;
p = lafe_getprogname();
fwrite("Brief Usage:\n", 1u, 0xDu, stderr);
fprintf(stderr, " List: %s -it < archive\n", p);
fprintf(stderr, " Extract: %s -i < archive\n", p);
fprintf(stderr, " Create: %s -o < filenames > archive\n", p);
fprintf(stderr, " Help: %s --help\... | static void usage(void) {
const char *p;
p = lafe_getprogname();
fprintf(stderr, "Brief Usage:\n");
fprintf(stderr, " List: %s -it < archive\n", p);
fprintf(stderr, " Extract: %s -i < archive\n", p);
fprintf(stderr, " Create: %s -o < filenames > archive\n", p);
fprintf(stderr, " Help: %s --he... | usage | libarchive-3.6.1 | app-arch | O0/app-arch/libarchive-3.6.1/bsdcpio | ida | O0 |
void version() {
const char *v0;
v0 = (const char *)archive_version_details();
fprintf(stdout, "bsdcpio %s - %s \n", "3.6.1", v0);
exit(0);
} | static void version(void) {
fprintf(stdout, "bsdcpio %s - %s \n", BSDCPIO_VERSION_STRING,
archive_version_details());
exit(0);
} | version | libarchive-3.6.1 | app-arch | O0/app-arch/libarchive-3.6.1/bsdcpio | ida | O0 |
bool FLZe_encode_member(FLZ_encoder *const fe,
const unsigned long member_size) {
const uint8_t *v3;
const uint8_t *v4;
int v5;
int v6;
int v7;
int v8;
unsigned long v9;
uint8_t cur_byte;
uint8_t prev_byte_0;
uint8_t cur_byte_0;
uint8_t match_byte;
int match_distance;
i... | bool FLZe_encode_member(struct FLZ_encoder *const fe,
const unsigned long long member_size) {
const unsigned long long member_size_limit =
member_size - Lt_size - max_marker_size;
int rep = 0, i;
int reps[num_rep_distances];
State state = 0;
for (i = 0; i < num_rep_distances; ++i... | FLZe_encode_member | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
int FLZe_longest_match_len(FLZ_encoder *const fe, int *const distance) {
int v2;
int v4;
int newpos1;
int maxlen;
int count;
int len;
int available;
int pos1;
int delta;
int32_t *ptr0;
const uint8_t *data;
int32_t *newptr;
if (Mb_available_bytes_0(&fe->eb.mb) > 273)
v2 = 273;
else
v... | int FLZe_longest_match_len(struct FLZ_encoder *const fe, int *const distance) {
enum { len_limit = 16 };
const int available = min(Mb_available_bytes(&fe->eb.mb), max_match_len);
if (available < len_limit)
return 0;
const uint8_t *const data = Mb_ptr_to_current_pos(&fe->eb.mb);
fe->key4 = ((fe->key4 << 4... | FLZe_longest_match_len | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
int LZd_decode_member(LZ_decoder *const d, Pretty_print *const pp) {
uint8_t v2;
uint8_t v3;
unsigned int v4;
uint8_t v5;
Bit_model *v6;
unsigned int rep0;
unsigned int rep1;
unsigned int rep2;
unsigned int rep3;
State state;
int len;
unsigned int distance;
unsigned int distance_0;
unsigned ... | int LZd_decode_member(struct LZ_decoder *const d,
struct Pretty_print *const pp) {
struct Range_decoder *const rdec = d->rdec;
Bit_model bm_literal[1 << literal_context_bits][0x300];
Bit_model bm_match[states][pos_states];
Bit_model bm_rep[states];
Bit_model bm_rep0[states];
Bit_model ... | LZd_decode_member | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void LZd_flush_data(LZ_decoder *const d) {
int *v1;
unsigned int size;
if (d->pos > d->stream_pos) {
size = d->pos - d->stream_pos;
CRC32_update_buf_1(&d->crc, &d->buffer[d->stream_pos], size);
if (d->outfd >= 0 &&
size != writeblock(d->outfd, &d->buffer[d->stream_pos], size)) {
v1 = __... | void LZd_flush_data(struct LZ_decoder *const d) {
if (d->pos > d->stream_pos) {
const int size = d->pos - d->stream_pos;
CRC32_update_buf(&d->crc, d->buffer + d->stream_pos, size);
if (d->outfd >= 0 &&
writeblock(d->outfd, d->buffer + d->stream_pos, size) != size) {
show_error("Write error",... | LZd_flush_data | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
bool LZd_verify_trailer(LZ_decoder *const d, Pretty_print *const pp) {
int v2;
unsigned int v3;
double v5;
double v6;
double v7;
double v8;
double v9;
double v10;
double v11;
double v12;
double v13;
double v14;
bool error;
int size;
unsigned int td_crc;
unsigned long data_size;
unsigne... | static bool LZd_verify_trailer(struct LZ_decoder *const d,
struct Pretty_print *const pp) {
Lzip_trailer trailer;
int size = Rd_read_data(d->rdec, trailer, Lt_size);
const unsigned long long data_size = LZd_data_position(d);
const unsigned long long member_size = Rd_member_positio... | LZd_verify_trailer | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
bool LZe_encode_member(LZ_encoder *const e, const unsigned long member_size) {
int v2;
int v3;
int v4;
char v6;
uint8_t v7;
const uint8_t *v8;
uint8_t cur_byte;
uint8_t prev_byte_0;
uint8_t cur_byte_0;
int price_counter;
int dis_price_counter;
int align_price_counter;
int i;
int ia;
int ib... | bool LZe_encode_member(struct LZ_encoder *const e,
const unsigned long long member_size) {
const unsigned long long member_size_limit =
member_size - Lt_size - max_marker_size;
const bool best = (e->match_len_limit > 12);
const int dis_price_count = best ? 1 : 512;
const int align_p... | LZe_encode_member | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
int LZe_get_match_pairs(LZ_encoder *const e, Pair *pairs) {
int v3;
int v4;
int v5;
int v6;
Pair *pairsa;
int len_limit;
int maxlen;
int num_pairs;
int newpos1;
int len;
int len0;
int len1;
int count;
int min_pos;
uint32_t tmp;
unsigned int tmpa;
int key2;
int key3;
int key4;
int... | int LZe_get_match_pairs(struct LZ_encoder *const e, struct Pair *pairs) {
int len_limit = e->match_len_limit;
if (len_limit > Mb_available_bytes(&e->eb.mb)) {
len_limit = Mb_available_bytes(&e->eb.mb);
if (len_limit < 4)
return 0;
}
int maxlen = 3;
int num_pairs = 0;
const int min_pos = (e->e... | LZe_get_match_pairs | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
int LZe_sequence_optimizer(LZ_encoder *const e, const int *reps,
const State state) {
int v3;
int v5;
int v6;
int v7;
int v8;
int v9;
int v10;
int v11;
long v12;
int v13;
int v14;
int v15;
int match_len_limit;
int v17;
int v18;
int v19;
int v20;
int v21;
... | static int LZe_sequence_optimizer(struct LZ_encoder *const e,
const int reps[num_rep_distances],
const State state) {
int num_pairs, num_trials;
int i, rep, len;
if (e->pending_num_pairs > 0) {
num_pairs = e->pending_num_pairs;
e->pendin... | LZe_sequence_optimizer | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void LZe_update_distance_prices(LZ_encoder *const e) {
int dis;
int disa;
int len_state;
int len_statea;
signed int slot;
int dis_slot;
int price;
int *dsp;
const Bit_model *bmds;
int *dp;
for (dis = 4; dis <= 127; ++dis) {
dis_slot = dis_slots[dis];
price = price_symbol_reversed(
... | static void LZe_update_distance_prices(struct LZ_encoder *const e) {
int dis, len_state;
for (dis = start_dis_model; dis < modeled_distances; ++dis) {
const int dis_slot = dis_slots[dis];
const int direct_bits = (dis_slot >> 1) - 1;
const int base = (2 | (dis_slot & 1)) << direct_bits;
const int pri... | LZe_update_distance_prices | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void LZeb_full_flush(LZ_encoder_base_0 *const eb, const State state) {
unsigned int v2;
unsigned long v3;
unsigned long v4;
int i;
int pos_state;
uint8_t trailer[24];
unsigned long v9;
v9 = __readfsqword(0x28u);
pos_state = Mb_data_position(&eb->mb) & 3;
Re_encode_bit(&eb->renc, &eb->bm_match[state... | void LZeb_full_flush(struct LZ_encoder_base *const eb, const State state) {
const int pos_state = Mb_data_position(&eb->mb) & pos_state_mask;
Re_encode_bit(&eb->renc, &eb->bm_match[state][pos_state], 1);
Re_encode_bit(&eb->renc, &eb->bm_rep[state], 0);
LZeb_encode_pair(eb, 0xFFFFFFFFU, min_match_len, pos_state)... | LZeb_full_flush | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void LZeb_reset(LZ_encoder_base_0 *const eb) {
Mb_reset(&eb->mb);
eb->crc = -1;
Bm_array_init(eb->bm_literal[0], 6144);
Bm_array_init(eb->bm_match[0], 48);
Bm_array_init(eb->bm_rep, 12);
Bm_array_init(eb->bm_rep0, 12);
Bm_array_init(eb->bm_rep1, 12);
Bm_array_init(eb->bm_rep2, 12);
Bm_array_init(eb->b... | void LZeb_reset(struct LZ_encoder_base *const eb) {
Mb_reset(&eb->mb);
eb->crc = 0xFFFFFFFFU;
Bm_array_init(eb->bm_literal[0], (1 << literal_context_bits) * 0x300);
Bm_array_init(eb->bm_match[0], states * pos_states);
Bm_array_init(eb->bm_rep, states);
Bm_array_init(eb->bm_rep0, states);
Bm_array_init(eb-... | LZeb_reset | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
bool Li_check_header_error(Lzip_index *const li, const uint8_t *header) {
uint8_t v3;
const char *v4;
unsigned int dictionary_size;
if (!Lh_verify_magic(header)) {
add_error_0(li, "Bad magic number (file not in lzip format).");
li->retval = 2;
return 1;
} else if (!Lh_verify_version(header)) {
... | static bool Li_check_header_error(struct Lzip_index *const li,
const Lzip_header header) {
if (!Lh_verify_magic(header)) {
add_error(li, bad_magic_msg);
li->retval = 2;
return true;
}
if (!Lh_verify_version(header)) {
add_error(li, bad_version(Lh_version(header)))... | Li_check_header_error | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void Li_free(Lzip_index *const li) {
Li_free_member_vector(li);
if (li->error) {
free(li->error);
li->error = 0;
}
li->error_size = 0;
} | void Li_free(struct Lzip_index *const li) {
Li_free_member_vector(li);
if (li->error) {
free(li->error);
li->error = 0;
}
li->error_size = 0;
} | Li_free | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void Li_free_member_vector(Lzip_index *const li) {
if (li->member_vector) {
free(li->member_vector);
li->member_vector = 0;
}
li->members = 0;
} | static void Li_free_member_vector(struct Lzip_index *const li) {
if (li->member_vector) {
free(li->member_vector);
li->member_vector = 0;
}
li->members = 0;
} | Li_free_member_vector | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
bool Li_init(Lzip_index *const li, const int infd, const bool ignore_trailing,
const bool loose_trailing) {
long v5;
long v6;
long data_size;
unsigned int dictionary_size;
unsigned long pos;
long i;
unsigned long member_size;
long end;
Lzip_header header;
uint8_t trailer[24];
unsigned... | bool Li_init(struct Lzip_index *const li, const int infd,
const bool ignore_trailing, const bool loose_trailing) {
li->member_vector = 0;
li->error = 0;
li->insize = lseek(infd, 0, SEEK_END);
li->members = 0;
li->error_size = 0;
li->retval = 0;
li->dictionary_size = 0;
if (li->insize < 0) {... | Li_init | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
bool Li_read_header(Lzip_index *const li, const int fd, uint8_t *header,
const long pos) {
if (seek_read(fd, header, 6, pos) == 6)
return 1;
Li_set_errno_error(li, "Error reading member header: ");
return 0;
} | static bool Li_read_header(struct Lzip_index *const li, const int fd,
Lzip_header header, const long long pos) {
if (seek_read(fd, header, Lh_size, pos) != Lh_size) {
Li_set_errno_error(li, "Error reading member header: ");
return false;
}
return true;
} | Li_read_header | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void Li_reverse_member_vector(Lzip_index *const li) {
Member *v1;
Member *v2;
long size;
long v4;
Member *v5;
long i;
long tmp;
long tmp_8;
long tmp_16;
long tmp_24;
long tmp_32;
for (i = 0; i < li->members / 2; ++i) {
v1 = &li->member_vector[i];
tmp = v1->dblock.pos;
tmp_8 = v1->db... | static void Li_reverse_member_vector(struct Lzip_index *const li) {
struct Member tmp;
long i;
for (i = 0; i < li->members / 2; ++i) {
tmp = li->member_vector[i];
li->member_vector[i] = li->member_vector[li->members - i - 1];
li->member_vector[li->members - i - 1] = tmp;
}
} | Li_reverse_member_vector | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void Li_set_errno_error(Lzip_index *const li, const char *const msg) {
int *v2;
char *v3;
add_error_0(li, msg);
v2 = __errno_location();
v3 = strerror(*v2);
add_error_0(li, v3);
li->retval = 1;
} | static void Li_set_errno_error(struct Lzip_index *const li,
const char *const msg) {
add_error(li, msg);
add_error(li, strerror(errno));
li->retval = 1;
} | Li_set_errno_error | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void Li_set_num_error(Lzip_index *const li, const char *const msg,
unsigned long num) {
char buf[88];
unsigned long v4;
v4 = __readfsqword(0x28u);
snprintf(buf, 0x50u, "%s%llu", msg, num);
add_error_0(li, buf);
li->retval = 2;
} | static void Li_set_num_error(struct Lzip_index *const li, const char *const msg,
unsigned long long num) {
char buf[80];
snprintf(buf, sizeof buf, "%s%llu", msg, num);
add_error(li, buf);
li->retval = 2;
} | Li_set_num_error | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
bool Li_skip_trailing_data(Lzip_index *const li, const int fd,
unsigned long *const pos, const bool ignore_trailing,
const bool loose_trailing) {
long v6;
long v7;
long data_size;
int bsize;
int search_size;
int rd_size;
int i;
unsigned int dictionar... | static bool Li_skip_trailing_data(struct Lzip_index *const li, const int fd,
unsigned long long *const pos,
const bool ignore_trailing,
const bool loose_trailing) {
if (*pos < min_member_size)
return false;
enu... | Li_skip_trailing_data | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
bool Mb_init(Matchfinder_base_0 *const mb, const int before_size,
const int dict_size, const int after_size, const int dict_factor,
const int num_prev_positions23, const int pos_array_factor,
const int ifd) {
int v8;
int stream_pos;
unsigned int v11;
int i;
unsigned int ... | bool Mb_init(struct Matchfinder_base *const mb, const int before_size,
const int dict_size, const int after_size, const int dict_factor,
const int num_prev_positions23, const int pos_array_factor,
const int ifd) {
const int buffer_size_limit =
(dict_factor * dict_size) + b... | Mb_init | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void Mb_normalize_pos(Matchfinder_base_0 *const mb) {
int32_t v1;
int32_t v2;
int i;
int ia;
int32_t offset;
if (mb->pos > mb->stream_pos)
internal_error("pos > stream_pos in Mb_normalize_pos.");
if (!mb->at_stream_end) {
offset = mb->pos - mb->before_size - mb->dictionary_size;
memmove(mb->b... | void Mb_normalize_pos(struct Matchfinder_base *const mb) {
if (mb->pos > mb->stream_pos)
internal_error("pos > stream_pos in Mb_normalize_pos.");
if (!mb->at_stream_end) {
int i;
const int32_t offset = mb->pos - mb->before_size - mb->dictionary_size;
const int size = mb->stream_pos - offset;
me... | Mb_normalize_pos | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
bool Mb_read_block(Matchfinder_base_0 *const mb) {
int *v1;
int size;
int rd;
if (!mb->at_stream_end && mb->stream_pos < mb->buffer_size) {
size = mb->buffer_size - mb->stream_pos;
rd = readblock(mb->infd, &mb->buffer[mb->stream_pos], size);
mb->stream_pos += rd;
if (rd != size && *__errno_loca... | bool Mb_read_block(struct Matchfinder_base *const mb) {
if (!mb->at_stream_end && mb->stream_pos < mb->buffer_size) {
const int size = mb->buffer_size - mb->stream_pos;
const int rd = readblock(mb->infd, mb->buffer + mb->stream_pos, size);
mb->stream_pos += rd;
if (rd != size && errno) {
show_er... | Mb_read_block | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void Mb_reset(Matchfinder_base_0 *const mb) {
int stream_pos;
int v2;
int i;
int size;
if (mb->stream_pos > mb->pos)
memmove(mb->buffer, &mb->buffer[mb->pos], mb->stream_pos - mb->pos);
mb->partial_data_pos = 0;
mb->stream_pos -= mb->pos;
mb->pos = 0;
mb->cyclic_pos = 0;
Mb_read_block(mb);
if... | void Mb_reset(struct Matchfinder_base *const mb) {
int i;
if (mb->stream_pos > mb->pos)
memmove(mb->buffer, mb->buffer + mb->pos, mb->stream_pos - mb->pos);
mb->partial_data_pos = 0;
mb->stream_pos -= mb->pos;
mb->pos = 0;
mb->cyclic_pos = 0;
Mb_read_block(mb);
if (mb->at_stream_end && mb->stream_po... | Mb_reset | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void Pp_init(Pretty_print *const pp, const char *const *filenames,
const int num_filenames) {
unsigned int v3;
int i;
unsigned int stdin_name_len;
const char *s;
pp->name = 0;
pp->padded_name = 0;
pp->stdin_name = "(stdin)";
pp->longest_name = 0;
pp->first_post = 0;
if (verbosity > 0) ... | static void Pp_init(struct Pretty_print *const pp,
const char *const filenames[], const int num_filenames) {
pp->name = 0;
pp->padded_name = 0;
pp->stdin_name = "(stdin)";
pp->longest_name = 0;
pp->first_post = false;
if (verbosity <= 0)
return;
const unsigned stdin_name_len = str... | Pp_init | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void Pp_reset(Pretty_print *const pp) {
if (pp->name) {
if (*pp->name)
pp->first_post = 1;
}
} | static void Pp_reset(struct Pretty_print *const pp) {
if (pp->name && pp->name[0])
pp->first_post = true;
} | Pp_reset | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void Pp_set_name(Pretty_print *const pp, const char *const filename) {
unsigned int longest_name;
unsigned int v3;
unsigned int v4;
unsigned int v5;
unsigned int i;
unsigned int ia;
unsigned int name_len;
unsigned int padded_name_len;
i = 0;
if (filename && *filename && strcmp(filename, "-"))
p... | static void Pp_set_name(struct Pretty_print *const pp,
const char *const filename) {
unsigned name_len, padded_name_len, i = 0;
if (filename && filename[0] && strcmp(filename, "-") != 0)
pp->name = filename;
else
pp->name = pp->stdin_name;
name_len = strlen(pp->name);
padded_n... | Pp_set_name | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void Pp_show_msg(Pretty_print *const pp, const char *const msg) {
if (verbosity >= 0) {
if (pp->first_post) {
pp->first_post = 0;
fputs(pp->padded_name, stderr);
if (!msg)
fflush(stderr);
}
if (msg)
fprintf(stderr, "%s\n", msg);
}
} | void Pp_show_msg(struct Pretty_print *const pp, const char *const msg) {
if (verbosity < 0)
return;
if (pp->first_post) {
pp->first_post = false;
fputs(pp->padded_name, stderr);
if (!msg)
fflush(stderr);
}
if (msg)
fprintf(stderr, "%s\n", msg);
} | Pp_show_msg | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
bool Rd_read_block(Range_decoder_0 *const rdec) {
int *v1;
if (!rdec->at_stream_end) {
rdec->stream_pos = readblock(rdec->infd, rdec->buffer, 0x4000);
if (rdec->stream_pos != 0x4000 && *__errno_location()) {
v1 = __errno_location();
show_error("Read error", *v1, 0);
cleanup_and_fail(1);
... | bool Rd_read_block(struct Range_decoder *const rdec) {
if (!rdec->at_stream_end) {
rdec->stream_pos = readblock(rdec->infd, rdec->buffer, rd_buffer_size);
if (rdec->stream_pos != rd_buffer_size && errno) {
show_error("Read error", errno, false);
cleanup_and_fail(1);
}
rdec->at_stream_end =... | Rd_read_block | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void Re_flush_data(Range_encoder *const renc) {
int *v1;
if (renc->pos > 0) {
if (renc->outfd >= 0 &&
writeblock(renc->outfd, renc->buffer, renc->pos) != renc->pos) {
v1 = __errno_location();
show_error("Write error", *v1, 0);
cleanup_and_fail(1);
}
renc->partial_member_pos +=... | void Re_flush_data(struct Range_encoder *const renc) {
if (renc->pos > 0) {
if (renc->outfd >= 0 &&
writeblock(renc->outfd, renc->buffer, renc->pos) != renc->pos) {
show_error("Write error", errno, false);
cleanup_and_fail(1);
}
renc->partial_member_pos += renc->pos;
renc->pos = 0;... | Re_flush_data | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
const char *ap_argument(const Arg_parser *const ap, const int i) {
if (i >= 0 && i < ap_arguments(ap) && ap->data[i].argument)
return ap->data[i].argument;
else
return (const char *)&unk_130B1;
} | const char *ap_argument(const struct Arg_parser *const ap, const int i) {
if (i < 0 || i >= ap_arguments(ap) || !ap->data[i].argument)
return "";
return ap->data[i].argument;
} | ap_argument | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
int ap_arguments(const Arg_parser *const ap) { return ap->data_size; } | int ap_arguments(const struct Arg_parser *const ap) { return ap->data_size; } | ap_arguments | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
int ap_code(const Arg_parser *const ap, const int i) {
if (i >= 0 && i < ap_arguments(ap))
return ap->data[i].code;
else
return 0;
} | int ap_code(const struct Arg_parser *const ap, const int i) {
if (i < 0 || i >= ap_arguments(ap))
return 0;
return ap->data[i].code;
} | ap_code | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
const char *ap_error(const Arg_parser *const ap) { return ap->error; } | const char *ap_error(const struct Arg_parser *const ap) { return ap->error; } | ap_error | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void ap_free(Arg_parser *const ap) {
free_data(ap);
if (ap->error) {
free(ap->error);
ap->error = 0;
}
ap->error_size = 0;
} | void ap_free(struct Arg_parser *const ap) {
free_data(ap);
if (ap->error) {
free(ap->error);
ap->error = 0;
}
ap->error_size = 0;
} | ap_free | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
char ap_init(Arg_parser *const ap, const int argc, const char *const *argv,
const ap_Option *options, const char in_order) {
unsigned char v6;
const char *v7;
int v8;
int v9;
const char *const *v10;
int v11;
int v12;
char done;
unsigned char ch1;
unsigned char ch2;
int argind;
int n... | char ap_init(struct Arg_parser *const ap, const int argc,
const char *const argv[], const struct ap_Option options[],
const char in_order) {
const char **non_options = 0;
int non_options_size = 0;
int argind = 1;
char done = 0;
ap->data = 0;
ap->error = 0;
ap->data_size = 0;
a... | ap_init | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
const char *ap_parsed_name(const Arg_parser *const ap, const int i) {
if (i >= 0 && i < ap_arguments(ap) && ap->data[i].parsed_name)
return ap->data[i].parsed_name;
else
return (const char *)&unk_130B1;
} | const char *ap_parsed_name(const struct Arg_parser *const ap, const int i) {
if (i < 0 || i >= ap_arguments(ap) || !ap->data[i].parsed_name)
return "";
return ap->data[i].parsed_name;
} | ap_parsed_name | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void *ap_resize_buffer(void *buf, const int min_size) {
if (buf)
return realloc(buf, min_size);
else
return malloc(min_size);
} | static void *ap_resize_buffer(void *buf, const int min_size) {
if (buf)
buf = realloc(buf, min_size);
else
buf = malloc(min_size);
return buf;
} | ap_resize_buffer | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
const char *bad_version(const unsigned int version) {
snprintf(buf_17, 0x50u, "Version %u member format not supported.", version);
return buf_17;
} | const char *bad_version(const unsigned version) {
static char buf[80];
snprintf(buf, sizeof buf, "Version %u member format not supported.", version);
return buf;
} | bad_version | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
bool check_tty_in(const char *const input_filename, const int infd,
const Mode program_mode, int *const retval) {
if (program_mode != Mode_m_decompress && program_mode != Mode_m_test ||
!isatty(infd))
return 1;
show_file_error(input_filename,
"I won't read compressed da... | static bool check_tty_in(const char *const input_filename, const int infd,
const enum Mode program_mode, int *const retval) {
if ((program_mode == m_decompress || program_mode == m_test) &&
isatty(infd)) {
show_file_error(input_filename,
"I won't read compressed ... | check_tty_in | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
bool check_tty_out(const Mode program_mode) {
const char *v1;
if (program_mode || !isatty(outfd))
return 1;
if (*output_filename)
v1 = output_filename;
else
v1 = "(stdout)";
show_file_error(v1, "I won't write compressed data to a terminal.", 0);
return 0;
} | static bool check_tty_out(const enum Mode program_mode) {
if (program_mode == m_compress && isatty(outfd)) {
show_file_error(output_filename[0] ? output_filename : "(stdout)",
"I won't write compressed data to a terminal.", 0);
return false;
}
return true;
} | check_tty_out | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void cleanup_and_fail(const int retval) {
set_signals((void (*)(int))((char *)&dword_0 + 1));
if (delete_output_on_interrupt) {
delete_output_on_interrupt = 0;
if (verbosity >= 0)
fprintf(stderr, "%s: Deleting output file '%s', if it exists.\n", "clzip",
output_filename);
if (outfd >... | void cleanup_and_fail(const int retval) {
set_signals(SIG_IGN);
if (delete_output_on_interrupt) {
delete_output_on_interrupt = false;
if (verbosity >= 0)
fprintf(stderr, "%s: Deleting output file '%s', if it exists.\n",
program_name, output_filename);
if (outfd >= 0) {
close(ou... | cleanup_and_fail | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void close_and_set_permissions(const stat *const in_statsp) {
__mode_t v1;
int *v2;
char warning;
mode_t mode;
utimbuf t;
unsigned long v6;
v6 = __readfsqword(0x28u);
warning = 0;
if (in_statsp) {
mode = in_statsp->st_mode;
if (fchown(outfd, in_statsp->st_uid, in_statsp->st_gid)) {
if (... | static void close_and_set_permissions(const struct stat *const in_statsp) {
bool warning = false;
if (in_statsp) {
const mode_t mode = in_statsp->st_mode;
if (fchown(outfd, in_statsp->st_uid, in_statsp->st_gid) == 0) {
if (fchmod(outfd, mode) != 0)
warning = true;
} else if (errno != EPER... | close_and_set_permissions | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
int compress(const unsigned long cfile_size, const unsigned long member_size,
const unsigned long volume_size, const int infd,
const Lzma_options *const encoder_options, Pretty_print *const pp,
const stat *const in_statsp, const bool zero) {
int v8;
int match_len_limit;
int ... | static int compress(const unsigned long long cfile_size,
const unsigned long long member_size,
const unsigned long long volume_size, const int infd,
const struct Lzma_options *const encoder_options,
struct Pretty_print *const pp,
... | compress | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
int decompress(const unsigned long cfile_size, const int infd,
Pretty_print *const pp, const bool ignore_trailing,
const bool loose_trailing, const bool testing) {
uint8_t v6;
const char *v7;
const char *v8;
const char *v9;
const char *v10;
bool first_member;
int retval;
in... | static int decompress(const unsigned long long cfile_size, const int infd,
struct Pretty_print *const pp, const bool ignore_trailing,
const bool loose_trailing, const bool testing) {
unsigned long long partial_file_pos = 0;
struct Range_decoder rdec;
int retval = 0;
b... | decompress | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
int extension_index(const char *const name) {
int eindex;
unsigned int name_len;
unsigned int ext_len;
const char *ext;
for (eindex = 0; known_extensions[eindex].from; ++eindex) {
ext = known_extensions[eindex].from;
name_len = strlen(name);
ext_len = strlen(ext);
if (name_len > ext_len &&
... | static int extension_index(const char *const name) {
int eindex;
for (eindex = 0; known_extensions[eindex].from; ++eindex) {
const char *const ext = known_extensions[eindex].from;
const unsigned name_len = strlen(name);
const unsigned ext_len = strlen(ext);
if (name_len > ext_len &&
strncmp(... | extension_index | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
const char *format_ds(const unsigned int dictionary_size) {
bool exact;
unsigned int num;
int i;
const char *p;
const char *np;
const char *prefix[8];
unsigned long v8;
v8 = __readfsqword(0x28u);
prefix[0] = "Ki";
prefix[1] = "Mi";
prefix[2] = "Gi";
prefix[3] = "Ti";
prefix[4] = "Pi";
prefi... | const char *format_ds(const unsigned dictionary_size) {
enum { bufsize = 16, factor = 1024 };
static char buf[bufsize];
const char *const prefix[8] = {"Ki", "Mi", "Gi", "Ti",
"Pi", "Ei", "Zi", "Yi"};
const char *p = "";
const char *np = " ";
unsigned num = dictionary_size;
... | format_ds | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
const char *format_num3(unsigned long num) {
int v1;
unsigned long numa;
char prefix;
bool split;
int i;
int ia;
int ib;
char *p;
numa = num;
v1 = current_15++;
current_15 %= 8;
p = &buffer_14[32 * v1 + 31];
*p = 0;
if (num > 0x400) {
prefix = 0;
for (i = 0; i <= 7 && numa > 0x3FF &... | static const char *format_num3(unsigned long long num) {
const char *const si_prefix = "kMGTPEZY";
const char *const binary_prefix = "KMGTPEZY";
enum { buffers = 8, bufsize = 4 * sizeof(long long) };
static char buffer[buffers][bufsize];
static int current = 0;
int i;
char *const buf = buffer[current++];
... | format_num3 | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void free_data(Arg_parser *const ap) {
int i;
for (i = 0; i < ap->data_size; ++i) {
free(ap->data[i].argument);
free(ap->data[i].parsed_name);
}
if (ap->data) {
free(ap->data);
ap->data = 0;
}
ap->data_size = 0;
} | static void free_data(struct Arg_parser *const ap) {
int i;
for (i = 0; i < ap->data_size; ++i) {
free(ap->data[i].argument);
free(ap->data[i].parsed_name);
}
if (ap->data) {
free(ap->data);
ap->data = 0;
}
ap->data_size = 0;
} | free_data | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
int get_dict_size(const char *const arg, const char *const option_name) {
char *tail;
long bits;
unsigned long v5;
v5 = __readfsqword(0x28u);
bits = strtol(arg, &tail, 0);
if (bits <= 11 || bits > 29 || *tail)
return getnum(arg, option_name, 0x1000u, 0x20000000u);
else
return 1 << bits;
} | static int get_dict_size(const char *const arg, const char *const option_name) {
char *tail;
const long bits = strtol(arg, &tail, 0);
if (bits >= min_dictionary_bits && bits <= max_dictionary_bits && *tail == 0)
return 1 << bits;
return getnum(arg, option_name, min_dictionary_size, max_dictionary_size);
} | get_dict_size | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
unsigned long getnum(const char *const arg, const char *const option_name,
const unsigned long llimit, const unsigned long ulimit) {
unsigned int v4;
const char *v5;
const char *v6;
int exponent;
int i;
char *tail;
unsigned long result;
unsigned long v14;
v14 = __readfsqword(0x28... | static unsigned long long getnum(const char *const arg,
const char *const option_name,
const unsigned long long llimit,
const unsigned long long ulimit) {
char *tail;
errno = 0;
unsigned long long result = strtoull(... | getnum | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void internal_error(const char *const msg) {
if (verbosity >= 0)
fprintf(stderr, "%s: internal error: %s\n", "clzip", msg);
exit(3);
} | void internal_error(const char *const msg) {
if (verbosity >= 0)
fprintf(stderr, "%s: internal error: %s\n", program_name, msg);
exit(3);
} | internal_error | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
int list_files(const char *const *filenames, const int num_filenames,
const bool ignore_trailing, const bool loose_trailing) {
int v4;
const char *v5;
int v6;
long v7;
unsigned long v8;
const char *v9;
bool first_post;
bool stdin_used;
bool from_stdin;
int retval;
int files;
int i... | int list_files(const char *const filenames[], const int num_filenames,
const bool ignore_trailing, const bool loose_trailing) {
unsigned long long total_comp = 0, total_uncomp = 0;
int files = 0, retval = 0;
int i;
bool first_post = true;
bool stdin_used = false;
for (i = 0; i < num_filenames... | list_files | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void list_line(const unsigned long uncomp_size, const unsigned long comp_size,
const char *const input_filename) {
double v3;
double v4;
double v5;
if (uncomp_size) {
if ((comp_size & 0x8000000000000000LL) != 0LL)
v3 = (double)(int)(comp_size & 1 | (comp_size >> 1)) +
(doubl... | static void list_line(const unsigned long long uncomp_size,
const unsigned long long comp_size,
const char *const input_filename) {
if (uncomp_size > 0)
printf("%14llu %14llu %6.2f%% %s\n", uncomp_size, comp_size,
100.0 - ((100.0 * comp_size) / uncomp_size),... | list_line | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
int main(int argc, const char **argv, const char **envp) {
const char *v4;
int v5;
int v6;
int v7;
int v8;
const char **v9;
int v10;
bool v11;
bool v12;
int v13;
stat *p_in_stats;
__off_t v15;
int *v16;
int *v17;
const char *v18;
bool force;
bool ignore_trailing;
bool keep_input_file... | int main(const int argc, const char *const argv[]) {
const struct Lzma_options option_mapping[] = {
{1 << 16, 16}, {1 << 20, 5}, {3 << 19, 6}, {1 << 21, 8},
{3 << 20, 12}, {1 << 22, 20}, {1 << 23, 36}, {1 << 24, 68},
{3 << 23, 132}, {1 << 25, 273}};
struct Lzma_options encoder_options = optio... | main | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
bool next_filename() {
int i;
int j;
unsigned int name_len;
name_len = strlen(output_filename);
if (name_len >= 8) {
i = name_len - 4;
for (j = 0; j <= 4; ++j) {
if (output_filename[i] <= 56) {
++output_filename[i];
return 1;
}
output_filename[i--] = 48;
}
}
... | static bool next_filename(void) {
const unsigned name_len = strlen(output_filename);
const unsigned ext_len = strlen(known_extensions[0].from);
int i, j;
if (name_len >= ext_len + 5)
for (i = name_len - ext_len - 1, j = 0; j < 5; --i, ++j) {
if (output_filename[i] < '9') {
++output_filename[i]... | next_filename | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
int open_instream(const char *const name, stat *const in_statsp,
const bool one_to_one, const bool reg_only) {
int v4;
bool v5;
const char *v6;
int infd;
int i;
infd = open64(name, 0);
if (infd >= 0) {
i = fstat64(infd, (struct stat64 *)in_statsp);
v5 = !i && !reg_only &&
... | int open_instream(const char *const name, struct stat *const in_statsp,
const bool one_to_one, const bool reg_only) {
int infd = open(name, O_RDONLY | O_BINARY);
if (infd < 0)
show_file_error(name, "Can't open input file", errno);
else {
const int i = fstat(infd, in_statsp);
const mo... | open_instream | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
int open_instream2(const char *const name, stat *const in_statsp,
const Mode program_mode, const int eindex,
const bool one_to_one, const bool recompress) {
if (program_mode || recompress || eindex < 0)
return open_instream(name, in_statsp, one_to_one, 0);
if (verbosity >= ... | static int open_instream2(const char *const name, struct stat *const in_statsp,
const enum Mode program_mode, const int eindex,
const bool one_to_one, const bool recompress) {
if (program_mode == m_compress && !recompress && eindex >= 0) {
if (verbosity >= 0)
... | open_instream2 | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
bool open_outstream(const bool force, const bool protect) {
unsigned int v2;
int *v3;
char *v4;
int flags;
if (protect)
v2 = 384;
else
v2 = 438;
if (force)
flags = 577;
else
flags = 193;
outfd = open64(output_filename, flags, v2);
if (outfd < 0) {
if (verbosity >= 0) {
if ... | static bool open_outstream(const bool force, const bool protect) {
const mode_t usr_rw = S_IRUSR | S_IWUSR;
const mode_t all_rw = usr_rw | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
const mode_t outfd_mode = protect ? usr_rw : all_rw;
int flags = O_CREAT | O_WRONLY | O_BINARY;
if (force)
flags |= O_TRUNC;
e... | open_outstream | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
char parse_long_option(Arg_parser *const ap, const char *const opt,
const char *const arg, const ap_Option *options,
int *const argindp) {
char exact;
char ambig;
unsigned int len;
int index;
int i;
index = -1;
exact = 0;
ambig = 0;
for (len = 0; opt[len ... | static char parse_long_option(struct Arg_parser *const ap,
const char *const opt, const char *const arg,
const struct ap_Option options[],
int *const argindp) {
unsigned len;
int index = -1, i;
char exact = 0, ambig = 0;
... | parse_long_option | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
char parse_short_option(Arg_parser *const ap, const char *const opt,
const char *const arg, const ap_Option *options,
int *const argindp) {
unsigned char c;
int cind;
int index;
int i;
char code_str[2];
unsigned long v14;
v14 = __readfsqword(0x28u);
cind ... | static char parse_short_option(struct Arg_parser *const ap,
const char *const opt, const char *const arg,
const struct ap_Option options[],
int *const argindp) {
int cind = 1;
while (cind > 0) {
int index = -1, i;
... | parse_short_option | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
bool push_back_member(Lzip_index *const li, const long dp, const long ds_0,
const long mp, const long ms,
const unsigned int dict_size) {
Member *tmp;
tmp = (Member *)resize_buffer(li->member_vector,
40 * ((unsigned int)li->members + 1));
... | static bool push_back_member(struct Lzip_index *const li, const long long dp,
const long long ds, const long long mp,
const long long ms, const unsigned dict_size) {
struct Member *p;
void *tmp = resize_buffer(li->member_vector,
(... | push_back_member | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
char push_back_record(Arg_parser *const ap, const int code,
const char *const long_name, const char *const argument) {
char *v5;
int len;
int len_0;
ap_Record *tmp;
ap_Record *p;
tmp = (ap_Record *)ap_resize_buffer(ap->data, 24 * (ap->data_size + 1));
if (!tmp)
return 0;
ap->d... | static char push_back_record(struct Arg_parser *const ap, const int code,
const char *const long_name,
const char *const argument) {
struct ap_Record *p;
void *tmp = ap_resize_buffer(ap->data,
(ap->data_size + 1) * sizeof(struc... | push_back_record | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
int readblock(const int fd, uint8_t *const buf, const int size) {
int sz;
int n;
sz = 0;
*__errno_location() = 0;
while (sz < size) {
n = read(fd, &buf[sz], size - sz);
if (n <= 0) {
if (!n || *__errno_location() != 4)
return sz;
} else {
sz += n;
}
*__errno_location()... | int readblock(const int fd, uint8_t *const buf, const int size) {
int sz = 0;
errno = 0;
while (sz < size) {
const int n = read(fd, buf + sz, size - sz);
if (n > 0)
sz += n;
else if (n == 0)
break;
else if (errno != EINTR)
break;
errno = 0;
}
return sz;
} | readblock | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void *resize_buffer(void *buf, const unsigned int min_size) {
void *bufa;
if (buf)
bufa = realloc(buf, min_size);
else
bufa = malloc(min_size);
if (!bufa) {
show_error("Not enough memory.", 0, 0);
cleanup_and_fail(1);
}
return bufa;
} | void *resize_buffer(void *buf, const unsigned min_size) {
if (buf)
buf = realloc(buf, min_size);
else
buf = malloc(min_size);
if (!buf) {
show_error(mem_msg, 0, false);
cleanup_and_fail(1);
}
return buf;
} | resize_buffer | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
int seek_read(const int fd, uint8_t *const buf, const int size,
const long pos) {
if (pos == lseek64(fd, pos, 0))
return readblock(fd, buf, size);
else
return 0;
} | static int seek_read(const int fd, uint8_t *const buf, const int size,
const long long pos) {
if (lseek(fd, pos, SEEK_SET) == pos)
return readblock(fd, buf, size);
return 0;
} | seek_read | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void set_c_outname(const char *const name, const bool filenames_given,
const bool force_ext, const bool multifile) {
int v4;
char *v5;
v4 = strlen(name);
output_filename = (char *)resize_buffer(output_filename, v4 + 9);
strcpy(output_filename, name);
if (multifile)
strcpy(&output_fil... | static void set_c_outname(const char *const name, const bool filenames_given,
const bool force_ext, const bool multifile) {
output_filename = resize_buffer(
output_filename, strlen(name) + 5 + strlen(known_extensions[0].from) + 1);
strcpy(output_filename, name);
if (multifile)
... | set_c_outname | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void set_d_outname(const char *const name, const int eindex) {
int v2;
unsigned int name_len;
unsigned int from_len;
name_len = strlen(name);
if (eindex < 0 || (from_len = strlen(known_extensions[eindex].from),
name_len <= from_len)) {
output_filename = (char *)resize_buffer(output_f... | static void set_d_outname(const char *const name, const int eindex) {
const unsigned name_len = strlen(name);
if (eindex >= 0) {
const char *const from = known_extensions[eindex].from;
const unsigned from_len = strlen(from);
if (name_len > from_len) {
output_filename = resize_buffer(
out... | set_d_outname | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void set_mode(Mode *const program_modep, const Mode new_mode) {
if (*program_modep && new_mode != *program_modep) {
show_error("Only one operation can be specified.", 0, 1);
exit(1);
}
*program_modep = new_mode;
} | static void set_mode(enum Mode *const program_modep, const enum Mode new_mode) {
if (*program_modep != m_compress && *program_modep != new_mode) {
show_error("Only one operation can be specified.", 0, true);
exit(1);
}
*program_modep = new_mode;
} | set_mode | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void set_signals(void (*action)(int)) {
signal(1, action);
signal(2, action);
signal(15, action);
} | static void set_signals(void (*action)(int)) {
signal(SIGHUP, action);
signal(SIGINT, action);
signal(SIGTERM, action);
} | set_signals | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void show_cprogress(const unsigned long cfile_size,
const unsigned long partial_size,
const Matchfinder_base *const m, Pretty_print *const p) {
double v4;
double v5;
unsigned long pos;
if (enabled_13) {
if (p) {
if (verbosity <= 1 || !isatty(2)) {
enabl... | void show_cprogress(const unsigned long long cfile_size,
const unsigned long long partial_size,
const struct Matchfinder_base *const m,
struct Pretty_print *const p) {
static unsigned long long csize = 0;
static unsigned long long psize = 0;
static const... | show_cprogress | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void show_dprogress(const unsigned long cfile_size,
const unsigned long partial_size,
const Range_decoder *const d, Pretty_print *const p) {
double v4;
double v5;
unsigned long pos;
if (enabled_8) {
if (p) {
if (verbosity <= 1 || !isatty(2)) {
enabled_8... | void show_dprogress(const unsigned long long cfile_size,
const unsigned long long partial_size,
const struct Range_decoder *const d,
struct Pretty_print *const p) {
static unsigned long long csize = 0;
static unsigned long long psize = 0;
static const st... | show_dprogress | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void show_error(const char *const msg, const int errcode, const bool help) {
char *v3;
const char *v4;
if (verbosity >= 0) {
if (msg && *msg) {
if (errcode <= 0)
v3 = (char *)&unk_13BF9;
else
v3 = strerror(errcode);
if (errcode <= 0)
v4 = (const char *)&unk_13BF9;
... | void show_error(const char *const msg, const int errcode, const bool help) {
if (verbosity < 0)
return;
if (msg && msg[0])
fprintf(stderr, "%s: %s%s%s\n", program_name, msg,
(errcode > 0) ? ": " : "", (errcode > 0) ? strerror(errcode) : "");
if (help)
fprintf(stderr, "Try '%s --help' for m... | show_error | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void show_file_error(const char *const filename, const char *const msg,
const int errcode) {
char *v3;
const char *v4;
if (verbosity >= 0) {
if (errcode <= 0)
v3 = (char *)&unk_13BF9;
else
v3 = strerror(errcode);
if (errcode <= 0)
v4 = (const char *)&unk_13BF9;
... | void show_file_error(const char *const filename, const char *const msg,
const int errcode) {
if (verbosity >= 0)
fprintf(stderr, "%s: %s: %s%s%s\n", program_name, filename, msg,
(errcode > 0) ? ": " : "", (errcode > 0) ? strerror(errcode) : "");
} | show_file_error | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void show_header(const unsigned int dictionary_size) {
const char *v1;
v1 = format_ds(dictionary_size);
fprintf(stderr, "dict %s, ", v1);
} | void show_header(const unsigned dictionary_size) {
fprintf(stderr, "dict %s, ", format_ds(dictionary_size));
} | show_header | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
void show_help() {
printf(
"Clzip is a C language version of lzip, fully compatible with lzip 1.4 "
"or\n"
"newer. As clzip is written in C, it may be easier to integrate in\n"
"applications like package managers, embedded devices, or systems "
"lacking a\n"
"C++ compiler.\n"
... | static void show_help(void) {
printf(
"Clzip is a C language version of lzip, fully compatible with lzip 1.4 "
"or\n"
"newer. As clzip is written in C, it may be easier to integrate in\n"
"applications like package managers, embedded devices, or systems "
"lacking a\n"
"C++ compile... | show_help | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
bool show_trailing_data(const uint8_t *const data, const int size,
Pretty_print *const pp, const bool all,
const int ignore_trailing) {
const char *v5;
const char *v6;
int v7;
unsigned char v8;
unsigned int v9;
unsigned int v10;
unsigned int v11;
unsigned ... | static bool show_trailing_data(const uint8_t *const data, const int size,
struct Pretty_print *const pp, const bool all,
const int ignore_trailing) {
if (verbosity >= 4 || ignore_trailing <= 0) {
int i;
char buf[80];
unsigned len =
max(... | show_trailing_data | clzip-1.13 | app-arch | O0/app-arch/clzip-1.13/clzip | ida | O0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.