input stringlengths 28 169k | output stringlengths 20 317k |
|---|---|
static
_Bool
do_arm_swaps (struct predicate *p)
{
if (p)
{
_Bool
swapped;
do
{
swapped =
0
;
if (consider_arm_swap (p)
|| do_arm_swaps (p->pred_left)
|| do_arm_swaps (p->pred_right))
{
swapped =
1
;
}
} while (swapped);
return swapped;
}
else
{
return
0
;
}
}
| int do_arm_swaps(unsigned long long a0[36]) {
char v0;
unsigned int v2;
if (!a0) {
v2 = 0;
} else {
do {
v0 = 0;
if (!consider_arm_swap(a0) && !do_arm_swaps(a0[34]) && !do_arm_swaps(a0[35]))
continue;
v0 = 1;
} while (v0);
v2 = v0;
}
return v2;
}
|
static int
punch_hole (int fd, off_t offset, off_t length)
{
int ret = 0;
ret = fallocate (fd,
0x02
|
0x01
,
offset, length);
if (ret < 0 && (is_ENOTSUP (
(*__errno_location ())
) ||
(*__errno_location ())
==
38
))
ret = 0;
return ret;
}
| int punch_hole(unsigned long a0, unsigned long long a1, unsigned long long a2) {
unsigned int v0;
v0 = 0;
v0 = fallocate(a0, 0x3, a1, a2);
if (v0 >= 0)
return v0;
if (!is_ENOTSUP(*(__errno_location())) && *(__errno_location()) != 38)
return v0;
v0 = 0;
return v0;
}
|
static void vxcan_print_help(struct link_util *lu, int argc, char **argv,
FILE *f)
{
print_usage(f);
}
| long long vxcan_print_help(unsigned long a0, unsigned long a1, unsigned long a2, unsigned int a3) {
unsigned long v0;
unsigned int v1;
unsigned long v2;
v2 = a0;
v1 = a1;
v0 = a2;
return print_usage(a3);
}
|
char *
stnputs(const char *s, size_t n, char *p)
{
p = makestrspace(n, p);
p = mempcpy(p, s, n);
return p;
}
| void * stnputs(const void *a1, size_t a2, long a3)
{
char *v3;
v3 = makestrspace(a2, a3);
return mempcpy(v3, a1, a2);
}
|
static
_Bool
hash_ins (struct di_set *di_set, ino_t ino, dev_t dev)
{
int inserted = di_set_insert (di_set, dev, ino);
if (inserted < 0)
xalloc_die ();
return inserted;
}
| int hash_ins(unsigned long long a0, unsigned long long a1, unsigned long long a2) {
unsigned int v0;
unsigned long long v2;
v2 = di_set_insert(a0, a2, a1, a2);
v0 = v2;
if (v0 >= 0) {
*(&v2) = v0;
return v2;
}
xalloc_die();
}
|
static int
cclass_test (c, char_class)
int c;
enum char_class char_class;
{
int result;
switch (char_class)
{
case CC_ASCII:
result =
(((
c
) & ~0x7f) == 0)
;
break;
case CC_ALNUM:
result = (1 &&
((*__ctype_b_loc ())[(int) ((
(unsigned char)c
))] & (unsigned short int) _ISalnum)
);
break;
case CC_ALPHA:
result = (1 &&
((*__ctype_b_loc ())[(int) ((
(unsigned char)c
))] & (unsigned short int) _ISalpha)
);
break;
case CC_BLANK:
result = (1 &&
((*__ctype_b_loc ())[(int) ((
(unsigned char)c
))] & (unsigned short int) _ISblank)
);
break;
case CC_CNTRL:
result = (1 &&
((*__ctype_b_loc ())[(int) ((
(unsigned char)c
))] & (unsigned short int) _IScntrl)
);
break;
case CC_DIGIT:
result = (1 &&
((*__ctype_b_loc ())[(int) ((
(unsigned char)c
))] & (unsigned short int) _ISdigit)
);
break;
case CC_GRAPH:
result = (1 &&
((*__ctype_b_loc ())[(int) ((
c
))] & (unsigned short int) _ISgraph)
);
break;
case CC_LOWER:
result = (1 &&
((*__ctype_b_loc ())[(int) ((
(unsigned char)c
))] & (unsigned short int) _ISlower)
);
break;
case CC_PRINT:
result = (1 &&
((*__ctype_b_loc ())[(int) ((
(unsigned char)c
))] & (unsigned short int) _ISprint)
);
break;
case CC_PUNCT:
result = (1 &&
((*__ctype_b_loc ())[(int) ((
(unsigned char)c
))] & (unsigned short int) _ISpunct)
);
break;
case CC_SPACE:
result = (1 &&
((*__ctype_b_loc ())[(int) ((
(unsigned char)c
))] & (unsigned short int) _ISspace)
);
break;
case CC_UPPER:
result = (1 &&
((*__ctype_b_loc ())[(int) ((
(unsigned char)c
))] & (unsigned short int) _ISupper)
);
break;
case CC_WORD:
result = ((1 &&
((*__ctype_b_loc ())[(int) ((
(unsigned char)c
))] & (unsigned short int) _ISalnum)
) || c == '_');
break;
case CC_XDIGIT:
result = (1 &&
((*__ctype_b_loc ())[(int) ((
(unsigned char)c
))] & (unsigned short int) _ISxdigit)
);
break;
default:
result = -1;
break;
}
return result;
}
| int cclass_test(unsigned long a0, unsigned long a1) {
unsigned int v0;
unsigned long v2;
unsigned long v3;
unsigned long v4;
unsigned long v5;
unsigned long v6;
unsigned long v7;
unsigned long v8;
unsigned long v9;
unsigned long v10;
unsigned long v11;
unsigned long v12;
unsigned int v14;
unsigned long v15;
unsigned int v16;
switch (a1) {
case 1:
v0 = !(a0 & -128);
return v0;
case 2:
v4 = *((*(__ctype_b_loc()) + a0 * 2));
*(&v4) = (v4 & 8);
v0 = v4;
return v0;
case 3:
v10 = *((*(__ctype_b_loc()) + a0 * 2));
*(&v10) = (v10 & 0x400);
v0 = v10;
return v0;
case 4:
v3 = *((*(__ctype_b_loc()) + a0 * 2));
*(&v3) = (v3 & 1);
v0 = v3;
return v0;
case 5:
v7 = *((*(__ctype_b_loc()) + a0 * 2));
*(&v7) = (v7 & 2);
v0 = v7;
return v0;
case 6:
v15 = *((*(__ctype_b_loc()) + a0 * 2));
*(&v15) = (v15 & 0x800);
v0 = v15;
return v0;
case 7:
v5 = *((*(__ctype_b_loc()) + a0 * 2));
*(&v5) = v5 >> 15;
v0 = v5;
return v0;
case 8:
v8 = *((*(__ctype_b_loc()) + a0 * 2));
*(&v8) = (v8 & 0x200);
v0 = v8;
return v0;
case 9:
v2 = *((*(__ctype_b_loc()) + a0 * 2));
*(&v2) = (v2 & 0x4000);
v0 = v2;
return v0;
case 10:
v9 = *((*(__ctype_b_loc()) + a0 * 2));
*(&v9) = (v9 & 4);
v0 = v9;
return v0;
case 11:
v11 = *((*(__ctype_b_loc()) + a0 * 2));
*(&v11) = (v11 & 0x2000);
v0 = v11;
return v0;
case 12:
v6 = *((*(__ctype_b_loc()) + a0 * 2));
*(&v6) = (v6 & 0x100);
v0 = v6;
return v0;
case 13:
v14 = *((*(__ctype_b_loc()) + a0 * 2)) & 8;
if (v14 || a0 == 95) {
v16 = 1;
break;
} else {
v16 = 0;
break;
}
v0 = v16;
return v0;
case 14:
v12 = *((*(__ctype_b_loc()) + a0 * 2));
*(&v12) = (v12 & 0x1000);
v0 = v12;
return v0;
default:
v0 = -1;
return v0;
}
}
|
static void
unwind_frame_discard_internal (tag, ignore)
char *tag, *ignore;
{
UNWIND_ELT *elt;
int found;
found = 0;
while (elt = unwind_protect_list)
{
unwind_protect_list = unwind_protect_list->head.next;
if (elt->head.cleanup == 0 && (((elt->arg.v)[0] == (tag)[0] && strcmp(elt->arg.v, tag) == 0)))
{
do { if ((uwcache).nc < (uwcache).cs) { do { if ((sizeof(UNWIND_ELT)) <= 32) { register char * mzp = (char *)((elt)); unsigned long mctmp = (sizeof(UNWIND_ELT)); register long mcn; if (mctmp < 8) mcn = 0; else { mcn = (mctmp-1)/8; mctmp &= 7; } switch (mctmp) { case 0: for(;;) { *mzp++ = 0xdf; case 7: *mzp++ = 0xdf; case 6: *mzp++ = 0xdf; case 5: *mzp++ = 0xdf; case 4: *mzp++ = 0xdf; case 3: *mzp++ = 0xdf; case 2: *mzp++ = 0xdf; case 1: *mzp++ = 0xdf; if(mcn <= 0) break; mcn--; } } } else memset (((elt)), (0xdf), (sizeof(UNWIND_ELT))); } while(0); ((UNWIND_ELT **)((uwcache).data))[(uwcache).nc++] = (elt); } else sh_xfree((elt), "unwind_prot.c", 277); } while (0);
found = 1;
break;
}
else
do { if ((uwcache).nc < (uwcache).cs) { do { if ((sizeof(UNWIND_ELT)) <= 32) { register char * mzp = (char *)((elt)); unsigned long mctmp = (sizeof(UNWIND_ELT)); register long mcn; if (mctmp < 8) mcn = 0; else { mcn = (mctmp-1)/8; mctmp &= 7; } switch (mctmp) { case 0: for(;;) { *mzp++ = 0xdf; case 7: *mzp++ = 0xdf; case 6: *mzp++ = 0xdf; case 5: *mzp++ = 0xdf; case 4: *mzp++ = 0xdf; case 3: *mzp++ = 0xdf; case 2: *mzp++ = 0xdf; case 1: *mzp++ = 0xdf; if(mcn <= 0) break; mcn--; } } } else memset (((elt)), (0xdf), (sizeof(UNWIND_ELT))); } while(0); ((UNWIND_ELT **)((uwcache).data))[(uwcache).nc++] = (elt); } else sh_xfree((elt), "unwind_prot.c", 282); } while (0);
}
if (found == 0)
internal_warning (gettext("unwind_frame_discard: %s: frame not found"), tag);
}
| long long unwind_frame_discard_internal(char *a0, unsigned long a1) {
unsigned long v0;
int tmp_15;
unsigned int v1;
unsigned long long v2;
unsigned long long v3;
struct_1 *v4;
unsigned long long v6;
unsigned long long v7;
struct_0 *v8;
struct_0 *v9;
struct_0 *v10;
struct_0 *v11;
struct_0 *v12;
struct_0 *v13;
struct_0 *v14;
struct_0 *v15;
struct_0 *v16;
unsigned long long v17;
struct_0 *v18;
unsigned long long v19;
struct_0 *v20;
struct_0 *v21;
struct_0 *v22;
struct_0 *v23;
struct_0 *v24;
struct_0 *v25;
struct_0 *v26;
struct_0 *v27;
unsigned long long v28;
v0 = a1;
v1 = 0;
while (true) {
v6 = unwind_protect_list;
v4 = unwind_protect_list;
if (!v4)
break;
unwind_protect_list = *(unwind_protect_list);
if (!v4->field_8 && v4->field_10->field_0 == *(a0)) {
v7 = strcmp(v4->field_10, a0);
if (!v7) {
if (g_400c2c < g_400c28) {
v18 = v4;
v2 = 32;
if (v2 <= 7) {
v19 = 0;
} else {
v19 = v2 - 1 >> 3;
v2 &= 7;
}
switch (v2) {
case 0:
while (true) {
v20 = v18;
v18 = &v18->padding_1;
v20->field_0 = 223;
v21 = v18;
v18 = &v18->padding_1;
v21->field_0 = 223;
v22 = v18;
v18 = &v18->padding_1;
v22->field_0 = 223;
v23 = v18;
v18 = &v18->padding_1;
v23->field_0 = 223;
v24 = v18;
v18 = &v18->padding_1;
v24->field_0 = 223;
v25 = v18;
v18 = &v18->padding_1;
v25->field_0 = 223;
v26 = v18;
v18 = &v18->padding_1;
v26->field_0 = 223;
v27 = v18;
v18 = &v18->padding_1;
v27->field_0 = 223;
if (v19 <= 0)
break;
v19 -= 1;
}
}
tmp_15 = g_400c2c;
g_400c2c = g_400c2c + 1;
v6 = v4;
*((uwcache + tmp_15 * 8)) = v4;
} else {
v6 = sh_xfree(v4, "unwind_prot.c", 0x115);
}
v1 = 1;
break;
}
}
if (v4->field_10->field_0 != *(a0) || v4->field_8 || v7) {
if (g_400c2c < g_400c28) {
v9 = v4;
v3 = 32;
if (v3 <= 7) {
v17 = 0;
} else {
v17 = v3 - 1 >> 3;
v3 &= 7;
}
switch (v3) {
case 7:
v10 = v9;
v9 = &v9->padding_1;
v10->field_0 = 223;
case 6:
v11 = v9;
v9 = &v9->padding_1;
v11->field_0 = 223;
case 5:
v12 = v9;
v9 = &v9->padding_1;
v12->field_0 = 223;
case 4:
v13 = v9;
v9 = &v9->padding_1;
v13->field_0 = 223;
case 3:
v14 = v9;
v9 = &v9->padding_1;
v14->field_0 = 223;
case 2:
v15 = v9;
v9 = &v9->padding_1;
v15->field_0 = 223;
case 1:
v16 = v9;
v9 = &v9->padding_1;
v16->field_0 = 223;
if (v17 > 0)
v17 -= 1;
case 0:
v8 = v9;
v9 = &v9->padding_1;
v8->field_0 = 223;
}
g_400c2c = g_400c2c + 1;
*((uwcache + g_400c2c * 8)) = v4;
} else {
sh_xfree(v4, "unwind_prot.c", 0x11a);
}
}
}
if (!v1) {
v28 = gettext("unwind_frame_discard: %s: frame not found");
v6 = internal_warning(v28, a0, v28);
}
return v6;
}
|
static struct dirent *
fudge_readdir(struct SFTP_OPENDIR *od)
{
static char buf[sizeof(struct dirent) +
4096
];
struct dirent *ret = (struct dirent *)buf;
static int inum = 1;
if (od->dir[od->offset] ==
((void *)0)
)
return(
((void *)0)
);
memset(buf, 0, sizeof(buf));
strlcpy(ret->d_name, od->dir[od->offset++]->filename,
sizeof(ret->d_name));
ret->d_ino = inum++;
if (!inum)
inum = 1;
return(ret);
}
| void * fudge_readdir(long *a1)
{
long v2;
int v3;
int v4;
if ( !*(_QWORD *)(*a1 + 8LL * *((int *)a1 + 2)) )
return 0LL;
memset(&buf_6717, 0, 0x1118uLL);
v2 = *a1;
v3 = *((_DWORD *)a1 + 2);
*((_DWORD *)a1 + 2) = v3 + 1;
strlcpy((char *)&buf_6717 + 19, **(_QWORD **)(v2 + 8LL * v3), 256LL);
v4 = inum_6719++;
buf_6717 = v4;
if ( !inum_6719 )
inum_6719 = 1;
return &buf_6717;
}
|
static void
chan_shutdown_write(struct ssh *ssh, Channel *c)
{
sshbuf_reset(c->output);
if (c->type == 10)
return;
sshlog("nchan.c", __func__, 381, 1, SYSLOG_LEVEL_DEBUG2,
((void *)0)
, "channel %d: (i%d o%d sock %d wfd %d efd %d [%s])", c->self, c->istate, c->ostate, c->sock, c->wfd, c->efd, channel_format_extended_usage(c))
;
if (c->sock != -1) {
if (shutdown(c->sock,
SHUT_WR
) == -1) {
sshlog("nchan.c", __func__, 386, 1, SYSLOG_LEVEL_DEBUG2,
((void *)0)
, "channel %d: shutdown() failed for " "fd %d [i%d o%d]: %.100s", c->self, c->sock, c->istate, c->ostate, strerror(
(*__errno_location ())
))
;
}
} else {
if (channel_close_fd(ssh, c, &c->wfd) < 0) {
sshlog("nchan.c", __func__, 392, 1, SYSLOG_LEVEL_INFO,
((void *)0)
, "channel %d: close() failed for " "fd %d [i%d o%d]: %.100s", c->self, c->wfd, c->istate, c->ostate, strerror(
(*__errno_location ())
))
;
}
}
}
| void chan_shutdown_write(undefined8 param_1,int *param_2)
{
int iVar1;
undefined8 uVar2;
int *piVar3;
char *pcVar4;
sshbuf_reset(*(undefined8 *)(param_2 + 0x1c));
if (*param_2 != 10) {
uVar2 = channel_format_extended_usage();
sshlog("nchan.c","chan_shutdown_write",0x17d,1,6,0,
"channel %d: (i%d o%d sock %d wfd %d efd %d [%s])",param_2[1],param_2[4],param_2[5],
param_2[10],param_2[8],param_2[9],uVar2,param_2,param_1);
if (param_2[10] == -1) {
iVar1 = channel_close_fd(param_1,param_2,param_2 + 8);
if (iVar1 < 0) {
piVar3 = __errno_location();
pcVar4 = strerror(*piVar3);
sshlog("nchan.c","chan_shutdown_write",0x188,1,3,0,
"channel %d: close() failed for fd %d [i%d o%d]: %.100s",param_2[1],param_2[8],
param_2[4],param_2[5],pcVar4);
}
}
else {
iVar1 = shutdown(param_2[10],1);
if (iVar1 == -1) {
piVar3 = __errno_location();
pcVar4 = strerror(*piVar3);
sshlog("nchan.c","chan_shutdown_write",0x182,1,6,0,
"channel %d: shutdown() failed for fd %d [i%d o%d]: %.100s",param_2[1],param_2[10],
param_2[4],param_2[5],pcVar4);
}
}
}
return;
}
|
static void
write_recent_bytes (char *data, size_t bytes)
{
size_t blocks = bytes / 512;
size_t rest = bytes - blocks * 512;
write_recent_blocks ((union block *)data, blocks);
memcpy (new_record[new_blocks].buffer, data + blocks * 512, rest);
if (rest < 512)
memset (new_record[new_blocks].buffer + rest, 0, 512 - rest);
new_blocks++;
if (new_blocks == blocking_factor)
write_record (1);
}
| void write_recent_bytes(unsigned long long a0, unsigned long a1) {
unsigned int v0;
unsigned int v1;
unsigned long long v3;
unsigned long long v4;
*(&v0) = a1 / 0x200;
*(&v1) = a1 - *(&v0) * 0x200;
write_recent_blocks(a0, *(&v0));
memcpy(new_record + new_blocks * 0x200, *(&v0) * 0x200 + a0, *(&v1));
if (*(&v1) <= 511)
memset(new_record + new_blocks * 0x200 + *(&v1), 0x0, 0x200 - *(&v1));
new_blocks = new_blocks + 1;
v3 = blocking_factor;
if (new_blocks == blocking_factor)
v4 = write_record(0x1);
return;
}
|
long
getmaxchild ()
{
static long maxchild = -1L;
if (maxchild > 0)
return maxchild;
maxchild = sysconf (
_SC_CHILD_MAX
);
return (maxchild);
}
| long getmaxchild()
{
if ( maxchild_7389 <= 0 )
maxchild_7389 = sysconf(1);
return maxchild_7389;
}
|
static int
count_dns_rr(struct dns_rr *p, u_int16_t class, u_int16_t type)
{
int n = 0;
while(p) {
if (p->class == class && p->type == type)
n++;
p = p->next;
}
return (n);
}
| long count_dns_rr(long a1, short a2, short a3)
{
unsigned int v5;
v5 = 0;
while ( a1 )
{
if ( a2 == *(_WORD *)(a1 + 10) && a3 == *(_WORD *)(a1 + 8) )
++v5;
a1 = *(_QWORD *)(a1 + 24);
}
return v5;
}
|
static inline __u64 rta_getattr_u64(const struct rtattr *rta)
{
__u64 tmp;
memcpy(&tmp, ((void*)(((char*)(rta)) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), sizeof(__u64));
return tmp;
}
| int rta_getattr_u64(unsigned long a0) {
char v0;
memcpy(&v0, a0 + 4, 0x8);
return *(&v0);
}
|
int
should_suppress_fork (command)
COMMAND *command;
{
int subshell;
subshell = subshell_environment & 0x20;
return (startup_state == 2 && parse_and_execute_level == 1 &&
*bash_input.location.string == '\0' &&
parser_expanding_alias () == 0 &&
should_optimize_fork (command, subshell));
}
| int should_suppress_fork(void* a0) {
unsigned int v0;
unsigned int v2;
v0 = subshell_environment & 32;
if (startup_state != 2) {
v2 = 0;
return v2;
} else if (parse_and_execute_level != 1) {
v2 = 0;
return v2;
} else if (*(run_trap_cleanup)) {
v2 = 0;
return v2;
} else if (parser_expanding_alias()) {
v2 = 0;
return v2;
} else if (!should_optimize_fork(a0, v0)) {
v2 = 0;
return v2;
} else {
v2 = 1;
return v2;
}
}
|
void
_rl_prep_non_filename_text (void)
{
if (_rl_color_indicator[C_END].string !=
((void *)0)
)
_rl_put_indicator (&_rl_color_indicator[C_END]);
else
{
_rl_put_indicator (&_rl_color_indicator[C_LEFT]);
_rl_put_indicator (&_rl_color_indicator[C_RESET]);
_rl_put_indicator (&_rl_color_indicator[C_RIGHT]);
}
}
| void _rl_prep_non_filename_text(void)
{
if (_strcpy == 0) {
_rl_put_indicator(&_rl_color_indicator);
_rl_put_indicator(lstat);
_rl_put_indicator(strlen);
}
else {
_rl_put_indicator(xmalloc);
}
return;
}
|
static void
fwd_perm_clear(struct permission *perm)
{
free(perm->host_to_connect);
free(perm->listen_host);
free(perm->listen_path);
memset(perm, 0, sizeof(*perm));
}
| void fwd_perm_clear(void **param_1)
{
free(*param_1);
free(param_1[2]);
free(param_1[3]);
memset(param_1,0,0x30);
return;
}
|
static int output_aliases(struct depmod *depmod, FILE *out)
{
size_t i;
fputs("# Aliases extracted from modules themselves.\n", out);
for (i = 0; i < depmod->modules.count; i++) {
const struct mod *mod = depmod->modules.array[i];
struct kmod_list *l;
for (l = ((mod->info_list) ==
((void *)0)
) ?
((void *)0)
: (mod->info_list); l !=
((void *)0)
; l = (l->node.next == &((mod->info_list)->node)) ?
((void *)0)
: ((struct kmod_list *) ((char *)(l->node.next) -
__builtin_offsetof (
struct kmod_list
,
node
)
) - ((typeof(*(l->node.next)) *)0 != (typeof(((struct kmod_list *)0)->node) *)0))) {
const char *key = kmod_module_info_get_key(l);
const char *value = kmod_module_info_get_value(l);
if (!(strcmp((key), ("alias")) == 0))
continue;
fprintf(out, "alias %s %s\n", value, mod->modname);
}
}
return 0;
}
| long long output_aliases(unsigned long long a0[4], void* a1) {
void* v0;
void* v1;
struct_0 *v2;
char *v3;
unsigned long v4;
void* v7;
fputs("# Aliases extracted from modules themselves.\n", a1);
for (v0 = 0; v0 < a0[3]; v0 += 1) {
v2 = *((a0[2] + v0 * 8));
for (v1 = v2->field_20; v1; v1 = v7) {
v3 = kmod_module_info_get_key(v1);
v4 = kmod_module_info_get_value(v1);
if (!strcmp(v3, "alias"))
fprintf(a1, "alias %s %s\n", v4, (v2 + 3));
if (*(v1) != v2->field_20)
v7 = *(v1);
else
v7 = 0;
}
}
return 0;
}
|
void
argv_consume(int *argcp)
{
*argcp = 0;
}
| long long argv_consume(unsigned int *a0) {
*(a0) = 0;
return a0;
}
|
static void
print_boottime (const STRUCT_UTMP *utmp_ent)
{
print_line (-1, "", ' ', -1, gettext ("system boot"),
time_string (utmp_ent), "", "", "", "");
}
| void print_boottime(undefined8 param_1)
{
undefined8 uVar1;
undefined8 uVar2;
uVar1 = time_string(param_1);
uVar2 = gettext("system boot");
print_line(0xffffffff,&DAT_00101de3,0x20,0xffffffff,uVar2,uVar1,&DAT_00101de3,&DAT_00101de3,
&DAT_00101de3,&DAT_00101de3);
return;
}
|
static
_Bool
install_file_in_dir (char const *from, char const *to_dir,
const struct cp_options *x,
_Bool
mkdir_and_install,
int *target_dirfd)
{
char const *from_base = last_component (from);
char *to_relname;
char *to = file_name_concat (to_dir, from_base, &to_relname);
_Bool
ret =
1
;
if (!target_dirfd_valid (*target_dirfd)
&& (ret = mkdir_and_install)
&& (ret = mkancesdirs_safe_wd (from, to, (struct cp_options *) x,
1
)))
{
int fd = open (to_dir, O_PATHSEARCH |
0200000
);
if (fd < 0)
{
error (0,
(*__errno_location ())
, gettext ("cannot open %s"), quotearg_style (shell_escape_always_quoting_style, to));
ret =
0
;
}
else
*target_dirfd = fd;
}
if (ret)
{
int to_dirfd = *target_dirfd;
if (!target_dirfd_valid (to_dirfd))
{
to_dirfd =
-100
;
to_relname = to;
}
ret = install_file_in_file (from, to, to_dirfd, to_relname, x);
}
free (to);
return ret;
}
| int install_file_in_dir(char *a0, char *a1, void* a2, unsigned long a3, unsigned int *a4) {
char v0;
unsigned int v1;
unsigned int v2;
unsigned long long v3;
unsigned long long v4;
unsigned long v5;
unsigned long long v8;
v4 = last_component(a0);
v5 = file_name_concat(a1, v4, &v3, v4);
v0 = 1;
if ((target_dirfd_valid(*(a4)) ^ 1)) {
v0 = a3;
if (v0) {
v0 = mkancesdirs_safe_wd(a0, v5, a2, 0x1);
if (v0) {
v2 = open(a1, 0x210000, a2);
if (v2 >= 0) {
*(a4) = v2;
} else {
v8 = quotearg_style(0x4, v5);
error(0x0, *(__errno_location()), gettext("cannot open %s"));
v0 = 0;
}
}
}
}
if (v0) {
v1 = *(a4);
if ((target_dirfd_valid(v1) ^ 1)) {
v1 = -100;
v3 = v5;
}
v0 = install_file_in_file(a0, v5, v1, v3, a2);
}
free(v5);
return v0;
}
|
static void print_FLT (float x) { char buf[( (1 + (((((24) * 1) * 146 + 484) / 485) + 1) +
16
+ 1 + ( -100 < ((-37)) && (38) < 100 ? 3 : -1000 < ((-37)) && (38) < 1000 ? 4 : -10000 < ((-37)) && (38) < 10000 ? 5 : -100000 < ((-37)) && (38) < 100000 ? 6 : -1000000 < ((-37)) && (38) < 1000000 ? 7 : (((((sizeof (int) * 8) - (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) )) + 1)]; ftoastr (buf, sizeof buf, FTOASTR_LEFT_JUSTIFY, 0, x); puts (buf); }
| void print_FLT() {
unsigned int v0;
char v1;
char v2;
unsigned int v4;
unsigned long long *v5;
unsigned long long v6;
v0 = v4;
ftoastr(&v1, 0x1f, 0x1, 0x0);
puts(&v1);
v6 = *(&v2) ^ v5[5];
return;
}
|
static void usage(void)
{
fprintf(
stderr
,
"Usage: ip tuntap { add | del | show | list | lst | help } [ dev PHYS_DEV ]\n"
" [ mode { tun | tap } ] [ user USER ] [ group GROUP ]\n"
" [ one_queue ] [ pi ] [ vnet_hdr ] [ multi_queue ] [ name NAME ]\n"
"\n"
"Where: USER := { STRING | NUMBER }\n"
" GROUP := { STRING | NUMBER }\n");
exit(-1);
}
| void usage()
{
fprintf(
stderr,
"Usage: ip tuntap { add | del | show | list | lst | help } [ dev PHYS_DEV ]\n"
" [ mode { tun | tap } ] [ user USER ] [ group GROUP ]\n"
" [ one_queue ] [ pi ] [ vnet_hdr ] [ multi_queue ] [ name NAME ]\n"
"\n"
"Where: USER := { STRING | NUMBER }\n"
" GROUP := { STRING | NUMBER }\n");
exit(-1);
}
|
static void
closeout (FILE *fp, int fd, pid_t pid, char const *name)
{
if (fp !=
((void *)0)
&&
rpl_fclose
(fp) != 0 && ! ignorable (
(*__errno_location ())
))
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", quotearg_n_style_colon (0, shell_escape_quoting_style, name)), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
,
(*__errno_location ())
, "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, name)), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
,
(*__errno_location ())
, "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, name)), ((
0
) ? (void) 0 : __builtin_unreachable ()))));
if (fd >= 0)
{
if (fp ==
((void *)0)
&& close (fd) < 0)
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", quotearg_n_style_colon (0, shell_escape_quoting_style, name)), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
,
(*__errno_location ())
, "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, name)), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
,
(*__errno_location ())
, "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, name)), ((
0
) ? (void) 0 : __builtin_unreachable ()))));
int j;
for (j = 0; j < n_open_pipes; ++j)
{
if (open_pipes[j] == fd)
{
open_pipes[j] = open_pipes[--n_open_pipes];
break;
}
}
}
if (pid > 0)
{
int wstatus = 0;
if (waitpid (pid, &wstatus, 0) == -1 &&
(*__errno_location ())
!=
10
)
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), gettext (\"waiting for child process\")), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
,
(*__errno_location ())
, gettext ("waiting for child process")), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
,
(*__errno_location ())
, gettext ("waiting for child process")), ((
0
) ? (void) 0 : __builtin_unreachable ()))));
if (
(((signed char) (((
wstatus
) & 0x7f) + 1) >> 1) > 0)
)
{
int sig =
((
wstatus
) & 0x7f)
;
if (sig !=
13
)
{
char signame[
(((
(sizeof "SIGRTMAX" + (((((sizeof (int) * 8) - (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) - 1)
)>(
((((((sizeof (int) * 8) - (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) + 1)
))?(
(sizeof "SIGRTMAX" + (((((sizeof (int) * 8) - (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) - 1)
):(
((((((sizeof (int) * 8) - (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (int)) 0 < (__typeof__ (int)) -1))) + 1)
))
];
if (sig2str (sig, signame) != 0)
sprintf (signame, "%d", sig);
error (sig + 128, 0,
gettext ("with FILE=%s, signal %s from command: %s"),
quotearg_n_style_colon (0, shell_escape_quoting_style, name), signame, filter_command);
}
}
else if (
(((
wstatus
) & 0x7f) == 0)
)
{
int ex =
(((
wstatus
) & 0xff00) >> 8)
;
if (ex != 0)
error (ex, 0, gettext ("with FILE=%s, exit %d from command: %s"),
quotearg_n_style_colon (0, shell_escape_quoting_style, name), ex, filter_command);
}
else
{
((!!sizeof (struct { _Static_assert (
1
, "verify_expr (" "1" ", " "(error (1, 0, gettext (\"unknown status from command (0x%X)\"), wstatus + 0u), assume (false))" ")"); int _gl_dummy; })) ? ((error (
1
, 0, gettext ("unknown status from command (0x%X)"), wstatus + 0u), ((
0
) ? (void) 0 : __builtin_unreachable ()))) : ((error (
1
, 0, gettext ("unknown status from command (0x%X)"), wstatus + 0u), ((
0
) ? (void) 0 : __builtin_unreachable ()))))
;
}
}
}
| void closeout(long param_1,int param_2,int param_3,undefined8 param_4)
{
uint uVar1;
char cVar2;
int iVar3;
__pid_t _Var4;
int *piVar5;
undefined8 uVar6;
undefined8 uVar7;
undefined8 uVar8;
long in_FS_OFFSET;
uint local_48;
int local_44;
uint local_40;
uint local_3c;
char local_38 [24];
long local_20;
local_20 = *(long *)(in_FS_OFFSET + 0x28);
if (param_1 != 0) {
iVar3 = rpl_fclose();
if (iVar3 != 0) {
__errno_location();
cVar2 = ignorable();
if (cVar2 != '\x01') {
quotearg_n_style_colon(0,3,param_4);
piVar5 = __errno_location();
error(1,*piVar5,&DAT_0010507d);
}
}
}
if (-1 < param_2) {
if (param_1 == 0) {
iVar3 = close(param_2);
if (iVar3 < 0) {
quotearg_n_style_colon(0,3,param_4);
piVar5 = __errno_location();
error(1,*piVar5,&DAT_0010507d);
}
}
for (local_44 = 0; (ulong)(long)local_44 < n_open_pipes; local_44 = local_44 + 1) {
if (param_2 == *(int *)(open_pipes + (long)local_44 * 4)) {
n_open_pipes = n_open_pipes - 1;
*(undefined4 *)(open_pipes + (long)local_44 * 4) =
*(undefined4 *)(open_pipes + n_open_pipes * 4);
break;
}
}
}
if (0 < param_3) {
local_48 = 0;
_Var4 = waitpid(param_3,(int *)&local_48,0);
if (_Var4 == -1) {
piVar5 = __errno_location();
if (*piVar5 != 10) {
uVar6 = gettext("waiting for child process");
piVar5 = __errno_location();
error(1,*piVar5,uVar6);
}
}
uVar1 = local_48;
uVar6 = filter_command;
if ((char)(((byte)local_48 & 0x7f) + 1) >> 1 < '\x01') {
if ((local_48 & 0x7f) == 0) {
local_40 = (int)local_48 >> 8 & 0xff;
if (local_40 != 0) {
uVar7 = quotearg_n_style_colon(0,3,param_4);
uVar8 = gettext("with FILE=%s, exit %d from command: %s");
error(local_40,0,uVar8,uVar7,local_40,uVar6);
}
}
else {
uVar6 = gettext("unknown status from command (0x%X)");
error(1,0,uVar6,uVar1);
}
}
else {
local_3c = local_48 & 0x7f;
if (local_3c != 0xd) {
iVar3 = sig2str(local_3c,local_38);
if (iVar3 != 0) {
sprintf(local_38,"%d",(ulong)local_3c);
}
uVar6 = filter_command;
uVar7 = quotearg_n_style_colon(0,3,param_4);
uVar8 = gettext("with FILE=%s, signal %s from command: %s");
error(local_3c + 0x80,0,uVar8,uVar7,local_38,uVar6);
}
}
}
if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return;
}
|
static void
coproc_setstatus (cp, status)
struct coproc *cp;
int status;
{
cp->c_lock = 4;
cp->c_status = status;
cp->c_flags |= 0x02;
cp->c_flags &= ~0x01;
cp->c_lock = 0;
}
| _DWORD * coproc_setstatus(_DWORD *a1, int a2)
{
_DWORD *result;
a1[9] = 4;
a1[8] = a2;
a1[7] |= 2u;
a1[7] &= ~1u;
result = a1;
a1[9] = 0;
return result;
}
|
void
merge_temporary_env ()
{
if (temporary_env)
dispose_temporary_env (posixly_correct ? push_posix_temp_var : push_temp_var);
}
| void merge_temporary_env(void)
{
code *pcVar1;
if (temporary_env != 0) {
if (posixly_correct == 0) {
pcVar1 = push_temp_var;
}
else {
pcVar1 = push_posix_temp_var;
}
dispose_temporary_env(pcVar1);
}
return;
}
|
user *find_user(cron_db * db, const char *name, const char *tabname) {
user *u;
for (u = db->head; u !=
((void *)0)
; u = u->next)
if ((strcmp(u->name, name) == 0)
&& ((tabname ==
((void *)0)
)
|| (strcmp(tabname, u->tabname) == 0)
)
)
break;
return (u);
}
| int find_user(unsigned long long *a0, char *a1, char *a2) {
unsigned long long v0[4];
v0[0] = *(a0);
while (true) {
if (!v0)
break;
if (!strcmp(v0[2], a1)) {
if (!a2)
break;
if (!strcmp(a2, v0[3]))
break;
}
v0[0] = v0[0];
}
return v0;
}
|
static
_Bool
insert_path_check (const struct parser_table* entry, char **argv, int *arg_ptr,
const char *predicate_name, PREDICATEFUNCTION pred)
{
const char *name;
_Bool
foldcase =
0
;
if (pred == pred_ipath)
foldcase =
1
;
fnmatch_sanitycheck ();
if (collect_arg (argv, arg_ptr, &name))
{
struct predicate *our_pred = insert_primary_withpred (entry, pred, name);
our_pred->need_stat = our_pred->need_type =
0
;
our_pred->args.str = name;
our_pred->est_success_rate = estimate_pattern_match_rate (name, 0);
if (!options.posixly_correct
&& !is_feasible_path_argument (name, foldcase))
{
error (0, 0, gettext ("warning: -%s %s will not match anything " "because it ends with /.")
,
predicate_name, name);
our_pred->est_success_rate = 1.0e-8;
}
return
1
;
}
return
0
;
}
| long insert_path_check(long a1, long a2, int *a3, long a4, void *a5, __m128i a6)
{
const char *v6;
char *v7;
bool v12;
const char *v13;
long inserted;
unsigned long v15;
v15 = __readfsqword(0x28u);
v12 = a5 == &pred_ipath;
fnmatch_sanitycheck();
if ( !(unsigned char)collect_arg(a2, a3, &v13) )
return 0LL;
inserted = insert_primary_withpred(a1, a5, v13);
*(_BYTE *)(inserted + 27) = 0;
*(_BYTE *)(inserted + 26) = *(_BYTE *)(inserted + 27);
*(_QWORD *)(inserted + 56) = v13;
*(float *)a6.m128i_i32 = estimate_pattern_match_rate(v13, 0);
*(_DWORD *)(inserted + 36) = _mm_cvtsi128_si32(a6);
if ( BYTE1(options[2]) != 1 && !is_feasible_path_argument(v13, v12) )
{
v6 = v13;
v7 = gettext("warning: -%s %s will not match anything because it ends with /.");
error(0, 0, v7, a4, v6);
*(_DWORD *)(inserted + 36) = 841731191;
}
return 1LL;
}
|
int
crlf (void)
{
return rl_crlf ();
}
| long long crlf() {
return rl_crlf();
}
|
static void
check_order (const struct line *prev,
const struct line *current,
int whatfile)
{
if (check_input_order != CHECK_ORDER_DISABLED
&& ((check_input_order == CHECK_ORDER_ENABLED) || seen_unpairable))
{
if (!issued_disorder_warning[whatfile - 1])
{
size_t join_field = whatfile == 1 ? join_field_1 : join_field_2;
if (keycmp (prev, current, join_field, join_field) > 0)
{
size_t len = current->buf.length;
if (0 < len && current->buf.buffer[len - 1] == '\n')
--len;
len =
(((0x7fffffff)<(
len
))?(0x7fffffff):(
len
))
;
error ((check_input_order == CHECK_ORDER_ENABLED
?
1
: 0),
0, gettext ("%s:%"
"l" "u"
": is not sorted: %.*s"),
g_names[whatfile - 1], line_no[whatfile - 1],
(int) len, current->buf.buffer);
issued_disorder_warning[whatfile - 1] =
1
;
}
}
}
}
| void check_order(void* a0, unsigned long long a1[3], unsigned long a2) {
unsigned long v0;
unsigned long long v1;
unsigned long long *v2;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
unsigned long long *v7;
unsigned long long v9;
unsigned long long v10;
v4 = check_input_order;
if (check_input_order != 2) {
if (check_input_order != 1)
v5 = seen_unpairable;
if (check_input_order == 1 || seen_unpairable) {
v6 = *(a2 + &seen_unpairable) ^ 1;
if ((*(a2 + &seen_unpairable) ^ 1)) {
if (a2 == 1)
v7 = join_field_1;
else
v7 = join_field_2;
v2 = v7;
if (keycmp(a0, a1, v2, v2) > 0) {
v1 = a1[1];
if (v1 && *((a1[2] + v1 - 1)) == 10)
v1 -= 1;
if (v1 < 0x80000000)
v9 = v1;
else
v9 = 2147483647;
v1 = v9;
v0 = a1[2];
error(check_input_order == 1, 0x0, gettext("%s:%lu: is not sorted: %.*s"));
v10 = a2 - 1;
*(a2 + &seen_unpairable) = 1;
}
}
}
}
return;
}
|
static size_t
print_half_line (char const *const *line, size_t indent, size_t out_bound)
{
FILE *out = outfile;
register size_t in_position = 0;
register size_t out_position = 0;
register char const *text_pointer = line[0];
register char const *text_limit = line[1];
mbstate_t mbstate = { 0 };
while (text_pointer < text_limit)
{
char const *tp0 = text_pointer;
register char c = *text_pointer++;
switch (c)
{
case '\t':
{
size_t spaces = tabsize - in_position % tabsize;
if (in_position == out_position)
{
size_t tabstop = out_position + spaces;
if (expand_tabs)
{
if (out_bound < tabstop)
tabstop = out_bound;
for (; out_position < tabstop; out_position++)
putc_unlocked (' ',out);
}
else
if (tabstop < out_bound)
{
out_position = tabstop;
putc_unlocked (c,out);
}
}
in_position += spaces;
}
break;
case '\r':
{
putc_unlocked (c,out);
tab_from_to (0, indent);
in_position = out_position = 0;
}
break;
case '\b':
if (in_position != 0 && --in_position < out_bound)
{
if (out_position <= in_position)
for (; out_position < in_position; out_position++)
putc_unlocked (' ',out);
else
{
out_position = in_position;
putc_unlocked (c,out);
}
}
break;
default:
{
wchar_t wc;
size_t bytes =
rpl_mbrtowc
(&wc, tp0, text_limit - tp0, &mbstate);
if (0 < bytes && bytes < (size_t) -2)
{
int width = wcwidth (wc);
if (0 < width)
in_position += width;
if (in_position <= out_bound)
{
out_position = in_position;
fwrite_unlocked (tp0,1,bytes,
stdout
);
}
text_pointer = tp0 + bytes;
break;
}
}
__attribute__ ((__fallthrough__));
case '\f':
case '\v':
if (in_position < out_bound)
putc_unlocked (c,out);
break;
case ' ': case '!': case '"': case '#': case '%':
case '&': case '\'': case '(': case ')': case '*':
case '+': case ',': case '-': case '.': case '/':
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
case ':': case ';': case '<': case '=': case '>':
case '?':
case 'A': case 'B': case 'C': case 'D': case 'E':
case 'F': case 'G': case 'H': case 'I': case 'J':
case 'K': case 'L': case 'M': case 'N': case 'O':
case 'P': case 'Q': case 'R': case 'S': case 'T':
case 'U': case 'V': case 'W': case 'X': case 'Y':
case 'Z':
case '[': case '\\': case ']': case '^': case '_':
case 'a': case 'b': case 'c': case 'd': case 'e':
case 'f': case 'g': case 'h': case 'i': case 'j':
case 'k': case 'l': case 'm': case 'n': case 'o':
case 'p': case 'q': case 'r': case 's': case 't':
case 'u': case 'v': case 'w': case 'x': case 'y':
case 'z': case '{': case '|': case '}': case '~':
if (in_position++ < out_bound)
{
out_position = in_position;
putc_unlocked (c,out);
}
break;
case '\n':
return out_position;
}
}
return out_position;
}
| int print_half_line(unsigned long long a0[2], unsigned int a1, unsigned long long a2) {
int tmp_8;
char v0;
unsigned int v1;
void* v2;
void* v3;
char *v4;
unsigned long v5;
unsigned int v6;
void* v7;
void* v9;
void* v10;
char *v11;
unsigned long long v12;
void* v13;
v3 = outfile;
v9 = 0;
v10 = 0;
v11 = a0[0];
v7 = 0;
while (true) {
if (v11 < a0[1]) {
tmp_8 = v11;
v4 = v11;
v11 += 1;
v12 = *(tmp_8);
if (v12 <= 95 && v12 >= 8) {
switch (v12) {
case 8:
if (!v9)
continue;
v9 -= 1;
if (v9 >= a2)
continue;
if (v10 <= v9) {
for (; v10 < v9; v10 += 1) {
putc_unlocked(0x20, v3);
}
} else {
v10 = v9;
putc_unlocked(v12, v3);
break;
}
case 9:
v5 = tabsize - ((0 CONCAT v9) /m tabsize >> 64);
if (v9 == v10) {
v2 = v5 + v10;
if (expand_tabs) {
if (a2 < v2)
v2 = a2;
for (; v10 < v2; v10 += 1) {
putc_unlocked(0x20, v3);
}
} else if (v2 < a2) {
v10 = v2;
putc_unlocked(v12, v3);
}
}
v9 = v5 + v9;
break;
case 10:
*(&v13) = v10;
case 11: case 12:
if (v9 >= a2)
continue;
putc_unlocked(v12, v3);
break;
case 13:
putc_unlocked(v12, v3);
tab_from_to(0x0, a1);
v10 = 0;
v9 = 0;
break;
case 32: case 33: case 34: case 35: case 37: case 38: case 39: case 40: case 41: case 42: case 43: case 44: case 45: case 46: case 47: case 48: case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: case 58: case 59: case 60: case 61: case 62: case 63: case 65: case 66: case 67: case 68: case 69: case 70: case 71: case 72: case 73: case 74: case 75: case 76: case 77: case 78: case 79: case 80: case 81: case 82: case 83: case 84: case 85: case 86: case 87: case 88: case 89: case 90: case 91: case 92: case 93: case 94: case 95:
v13 = v9;
v9 += 1;
if (a2 <= v13)
continue;
v10 = v9;
putc_unlocked(v12, v3);
break;
default:
*(&v6) = rpl_mbrtowc(&v0, v4, a0[1] + -0x1 * v4, &v7);
}
}
if (*(&v6) && (v12 <= 95 || v12 - 97 > 29) && (*(((v12 - 8) * 4 + 4196760)) + 4196760 == 4195102 || v12 < 8 || v12 > 95 || v12 - 8 > 87) && *(&v6) <= -3) {
v1 = wcwidth(*(&v0));
if (v1 > 0)
v9 += v1;
if (v9 <= a2) {
v10 = v9;
fwrite_unlocked(v4, 0x1, *(&v6), stdout);
}
v11 = &v4[*(&v6)];
continue;
}
} else {
*(&v13) = v10;
}
if (v11 >= a0[1] || v12 <= 95 && *(((v12 - 8) * 4 + 4196760)) + 4196760 == 4195306 && v12 - 8 <= 87 && v12 >= 8)
return v13;
}
}
|
u_int
sshkey_curve_nid_to_bits(int nid)
{
switch (nid) {
case
415
:
return 256;
case
715
:
return 384;
case
716
:
return 521;
default:
return 0;
}
}
| int sshkey_curve_nid_to_bits(unsigned long a0) {
unsigned int v1;
switch (a0) {
case 716:
v1 = 521;
return v1;
case 415:
v1 = 0x100;
return v1;
case 715:
v1 = 384;
return v1;
default:
v1 = 0;
return v1;
}
}
|
static const char *
cost_name (enum EvaluationCost cost)
{
unsigned int i;
unsigned int n = sizeof (cost_table)/sizeof(cost_table[0]);
for (i = 0; i<n; ++i)
if (cost_table[i].cost == cost)
return cost_table[i].name;
return "unknown";
}
| const char * cost_name(int a1)
{
unsigned int i;
for ( i = 0; i < 0xB; ++i )
{
if ( a1 == *((_DWORD *)&cost_table + 4 * i) )
return (const char *)*((_QWORD *)&cost_table + 2 * i + 1);
}
return "unknown";
}
|
static void
bind_bracketed_paste_prefix (void)
{
Keymap xkeymap;
xkeymap = _rl_keymap;
_rl_keymap = emacs_standard_keymap;
rl_bind_keyseq_if_unbound ("\033[200~", rl_bracketed_paste_begin);
_rl_keymap = vi_insertion_keymap;
rl_bind_keyseq_if_unbound ("\033[200~", rl_bracketed_paste_begin);
_rl_keymap = xkeymap;
}
| long long bind_bracketed_paste_prefix() {
unsigned long long v0;
v0 = _rl_keymap;
_rl_keymap = &emacs_standard_keymap;
rl_bind_keyseq_if_unbound(&g_4022ba, got.rl_bracketed_paste_begin);
_rl_keymap = &vi_insertion_keymap;
rl_bind_keyseq_if_unbound(&g_4022ba, got.rl_bracketed_paste_begin);
_rl_keymap = v0;
return v0;
}
|
static char *
getenv_TZ (void)
{
return getenv ("TZ");
}
| int getenv_TZ() {
return getenv("TZ");
}
|
static int hostset_cmd(void) {
char n[
4096
];
FILE *tmp;
int fd;
int error = 0;
char *safename;
if (!HostSpecified)
gethostname(Host, sizeof Host);
safename = host_specific_filename("#tmp", "XXXXXXXXXX");
if (!safename || !glue_strings(TempFilename, sizeof TempFilename, "/usr/local/var/spool/cron",
safename, '/')) {
TempFilename[0] = '\0';
fprintf(
stderr
, "path too long\n");
return (-2);
}
if ((fd = mkstemp(TempFilename)) == -1 || !(tmp = fdopen(fd, "w"))) {
perror(TempFilename);
if (fd != -1) {
close(fd);
unlink(TempFilename);
}
TempFilename[0] = '\0';
return (-2);
}
(void) signal(
1
, die);
(void) signal(
2
, die);
(void) signal(
3
, die);
(void) fchmod(fd, 0600);
if (fprintf(tmp, "%s\n", Host) < 0 || fclose(tmp) ==
(-1)
) {
fprintf(
stderr
, "%s: error while writing to %s\n",
ProgramName, TempFilename);
error = -2;
goto done;
}
if (!glue_strings(n, sizeof n, "/usr/local/var/spool/cron", ".cron.hostname", '/')) {
fprintf(
stderr
, "path too long\n");
error = -2;
goto done;
}
if (rename(TempFilename, n)) {
fprintf(
stderr
, "%s: error renaming %s to %s\n",
ProgramName, TempFilename, n);
perror("rename");
error = -2;
goto done;
}
TempFilename[0] = '\0';
log_it(RealUser, Pid, "SET HOST", Host, 0);
poke_daemon();
done:
(void) signal(
1
,
((__sighandler_t) 0)
);
(void) signal(
2
,
((__sighandler_t) 0)
);
(void) signal(
3
,
((__sighandler_t) 0)
);
if (TempFilename[0]) {
(void) unlink(TempFilename);
TempFilename[0] = '\0';
}
return (error);
}
| int hostset_cmd() {
unsigned int v0;
unsigned int v1;
unsigned long long v2;
void* v3;
char v4;
unsigned long long v5;
unsigned long long v7;
v5 = *(&v5);
v0 = 0;
if (!HostSpecified)
gethostname(&Host, 0x40);
v2 = host_specific_filename("#tmp", "XXXXXXXXXX");
if (v2) {
v7 = glue_strings(&TempFilename, 0x1000, "/usr/local/var/spool/cron", v2, 0x2f);
if (v7) {
v1 = mkstemp(&TempFilename);
if (v1 != -1) {
v3 = fdopen(v1, "w");
if (v3) {
signal(0x1, die);
signal(0x2, die);
signal(0x3, die);
fchmod(v1, 0x180);
v7 = fprintf(v3, "%s\n", &Host);
if (v7 >= 0) {
v7 = fclose(v3);
if (v7 != -1) {
v7 = glue_strings(&v4, 0x1000, "/usr/local/var/spool/cron", ".cron.hostname", 0x2f);
if (!v7) {
fprintf(*(&stderr), "path too long\n");
v0 = -2;
} else {
v7 = rename(&TempFilename, &v4);
if (v7) {
fprintf(*(&stderr), "%s: error renaming %s to %s\n", 283935560, &TempFilename, &v4);
perror("rename");
v0 = -2;
} else {
TempFilename = 0;
log_it(&RealUser, Pid, "SET HOST", &Host, 0x0);
poke_daemon();
}
}
}
}
if (v7 == -1 || v7 < 0) {
fprintf(*(&stderr), "%s: error while writing to %s\n", 283935560, &TempFilename);
v0 = -2;
}
signal(0x1, 0x0);
signal(0x2, 0x0);
signal(0x3, 0x0);
if (TempFilename) {
unlink(&TempFilename);
TempFilename = 0;
}
v7 = v0;
}
}
if (!v3 || v1 == -1) {
perror(&TempFilename);
if (v1 != -1) {
close(v1);
unlink(&TempFilename);
}
TempFilename = 0;
v7 = -2;
}
}
}
if (!v7 || !v2) {
TempFilename = 0;
fprintf(*(&stderr), "path too long\n");
v7 = -2;
}
return v7;
}
|
static inline es_size_t es_strlen(es_str_t *str)
{
return(str->lenStr);
}
| long es_strlen(unsigned int *a1)
{
return *a1;
}
|
static int xfrm_state_flag_parse(__u8 *flags, int *argcp, char ***argvp)
{
int argc = *argcp;
char **argv = *argvp;
int len = strlen(*argv);
if (len > 2 && strncmp(*argv, "0x", 2) == 0) {
__u8 val = 0;
if (get_u8(&val, *argv, 16))
invarg("FLAG value is invalid", *argv);
*flags = val;
} else {
while (1) {
if (strcmp(*argv, "noecn") == 0)
*flags |= 1;
else if (strcmp(*argv, "decap-dscp") == 0)
*flags |= 2;
else if (strcmp(*argv, "nopmtudisc") == 0)
*flags |= 4;
else if (strcmp(*argv, "wildrecv") == 0)
*flags |= 8;
else if (strcmp(*argv, "icmp") == 0)
*flags |= 16;
else if (strcmp(*argv, "af-unspec") == 0)
*flags |= 32;
else if (strcmp(*argv, "align4") == 0)
*flags |= 64;
else if (strcmp(*argv, "esn") == 0)
*flags |= 128;
else {
do { argv--; argc++; } while(0);
break;
}
if (!(argc - 1 > 0))
break;
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
}
}
*argcp = argc;
*argvp = argv;
return 0;
}
| undefined8 xfrm_state_flag_parse(byte *param_1,int *param_2,undefined8 *param_3)
{
int iVar1;
size_t sVar2;
long in_FS_OFFSET;
byte local_21;
int local_20;
int local_1c;
char **local_18;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_20 = *param_2;
local_18 = (char **)*param_3;
sVar2 = strlen(*local_18);
local_1c = (int)sVar2;
if (2 < local_1c) {
iVar1 = strncmp(*local_18,"0x",2);
if (iVar1 == 0) {
local_21 = 0;
iVar1 = get_u8(&local_21,*local_18,0x10);
if (iVar1 != 0) {
invarg("FLAG value is invalid",*local_18);
}
*param_1 = local_21;
goto LAB_0010065a;
}
}
do {
iVar1 = strcmp(*local_18,"noecn");
if (iVar1 == 0) {
*param_1 = *param_1 | 1;
}
else {
iVar1 = strcmp(*local_18,"decap-dscp");
if (iVar1 == 0) {
*param_1 = *param_1 | 2;
}
else {
iVar1 = strcmp(*local_18,"nopmtudisc");
if (iVar1 == 0) {
*param_1 = *param_1 | 4;
}
else {
iVar1 = strcmp(*local_18,"wildrecv");
if (iVar1 == 0) {
*param_1 = *param_1 | 8;
}
else {
iVar1 = strcmp(*local_18,"icmp");
if (iVar1 == 0) {
*param_1 = *param_1 | 0x10;
}
else {
iVar1 = strcmp(*local_18,"af-unspec");
if (iVar1 == 0) {
*param_1 = *param_1 | 0x20;
}
else {
iVar1 = strcmp(*local_18,"align4");
if (iVar1 == 0) {
*param_1 = *param_1 | 0x40;
}
else {
iVar1 = strcmp(*local_18,"esn");
if (iVar1 != 0) {
local_18 = local_18 + -1;
local_20 = local_20 + 1;
goto LAB_0010065a;
}
*param_1 = *param_1 | 0x80;
}
}
}
}
}
}
}
if (local_20 < 2) goto LAB_0010065a;
local_18 = local_18 + 1;
local_20 = local_20 + -1;
} while (0 < local_20);
incomplete_command();
LAB_0010065a:
*param_2 = local_20;
*param_3 = local_18;
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return 0;
}
|
static void print_hw_stats64(FILE *fp, struct rtnl_hw_stats64 *s)
{
unsigned int cols[] = {
strlen("*X: bytes"),
strlen("packets"),
strlen("errors"),
strlen("dropped"),
strlen("overrun"),
};
if (is_json_context()) {
open_json_object("rx");
print_u64(PRINT_JSON, "bytes",
((void *)0)
, s->rx_bytes);
print_u64(PRINT_JSON, "packets",
((void *)0)
, s->rx_packets);
print_u64(PRINT_JSON, "errors",
((void *)0)
, s->rx_errors);
print_u64(PRINT_JSON, "dropped",
((void *)0)
, s->rx_dropped);
print_u64(PRINT_JSON, "multicast",
((void *)0)
, s->multicast);
close_json_object();
open_json_object("tx");
print_u64(PRINT_JSON, "bytes",
((void *)0)
, s->tx_bytes);
print_u64(PRINT_JSON, "packets",
((void *)0)
, s->tx_packets);
print_u64(PRINT_JSON, "errors",
((void *)0)
, s->tx_errors);
print_u64(PRINT_JSON, "dropped",
((void *)0)
, s->tx_dropped);
close_json_object();
} else {
size_columns(cols, (sizeof(cols) / sizeof((cols)[0])),
s->rx_bytes, s->rx_packets, s->rx_errors,
s->rx_dropped, s->multicast);
size_columns(cols, (sizeof(cols) / sizeof((cols)[0])),
s->tx_bytes, s->tx_packets, s->tx_errors,
s->tx_dropped, 0);
fprintf(fp, " RX: %*s %*s %*s %*s %*s%s",
cols[0] - 4, "bytes", cols[1], "packets",
cols[2], "errors", cols[3], "dropped",
cols[4], "mcast", _SL_);
fprintf(fp, " ");
print_num(fp, cols[0], s->rx_bytes);
print_num(fp, cols[1], s->rx_packets);
print_num(fp, cols[2], s->rx_errors);
print_num(fp, cols[3], s->rx_dropped);
print_num(fp, cols[4], s->multicast);
fprintf(fp, "%s", _SL_);
fprintf(fp, " TX: %*s %*s %*s %*s%s",
cols[0] - 4, "bytes", cols[1], "packets",
cols[2], "errors", cols[3], "dropped", _SL_);
fprintf(fp, " ");
print_num(fp, cols[0], s->tx_bytes);
print_num(fp, cols[1], s->tx_packets);
print_num(fp, cols[2], s->tx_errors);
print_num(fp, cols[3], s->tx_dropped);
}
}
| void print_hw_stats64(void* a0, unsigned long long a1[9], unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned long v0;
unsigned long long v1;
unsigned long v2;
unsigned long long v3;
unsigned long v4;
unsigned long long v5;
unsigned long v6;
unsigned int v7;
unsigned int v8;
unsigned int v9;
unsigned int v10;
unsigned int v11;
char v12;
unsigned long long *v14;
unsigned long long v15;
v7 = strlen("*X: bytes");
v8 = strlen("packets");
v9 = strlen("errors");
v10 = strlen("dropped");
v11 = strlen("overrun");
if (!is_json_context("overrun", a1, a2, a3, a4, a5)) {
v6 = a1[8];
size_columns(&v7, 0x5, a1[2], a1[0], a1[4], a1[6]);
v6 = 0;
size_columns(&v7, 0x5, a1[3], a1[1], a1[5], a1[7]);
v6 = _SL_;
v5 = "mcast";
v4 = v11;
v3 = "dropped";
v2 = v10;
v1 = "errors";
v0 = v9;
fprintf(a0, " RX: %*s %*s %*s %*s %*s%s", v7 - 4);
fprintf(a0, " ");
print_num(a0, v7, a1[2], v7);
print_num(a0, v8, a1[0], v8);
print_num(a0, v9, a1[4], v9);
print_num(a0, v10, a1[6], v10);
print_num(a0, v11, a1[8], v11);
fprintf(a0, "%s", _SL_);
v6 = _SL_;
v5 = "dropped";
v4 = v10;
v3 = "errors";
v2 = v9;
fprintf(a0, " TX: %*s %*s %*s %*s%s", v7 - 4);
fprintf(a0, " ");
print_num(a0, v7, a1[3], v7);
print_num(a0, v8, a1[1], v8);
print_num(a0, v9, a1[5], v9);
print_num(a0, v10, a1[7], v10);
} else {
open_json_object("rx");
print_u64(0x2, "bytes", 0x0, a1[2]);
print_u64(0x2, "packets", 0x0, a1[0]);
print_u64(0x2, "errors", 0x0, a1[4]);
print_u64(0x2, "dropped", 0x0, a1[6]);
print_u64(0x2, "multicast", 0x0, a1[8]);
close_json_object(0x2, "multicast", 0x0, a3, a4, a5);
open_json_object("tx");
print_u64(0x2, "bytes", 0x0, a1[3]);
print_u64(0x2, "packets", 0x0, a1[1]);
print_u64(0x2, "errors", 0x0, a1[5]);
print_u64(0x2, "dropped", 0x0, a1[7]);
close_json_object(0x2, "dropped", 0x0, a3, a4, a5);
}
v15 = *(&v12) ^ v14[5];
return;
}
|
static int xfrm_policy_keep(struct nlmsghdr *n, void *arg)
{
struct xfrm_buffer *xb = (struct xfrm_buffer *)arg;
struct rtnl_handle *rth = xb->rth;
struct xfrm_userpolicy_info *xpinfo = ((void *)(((char *)n) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))));
int len = n->nlmsg_len;
struct rtattr *tb[(__XFRMA_MAX - 1)+1];
__u8 ptype = XFRM_POLICY_TYPE_MAIN;
struct nlmsghdr *new_n;
struct xfrm_userpolicy_id *xpid;
if (n->nlmsg_type != XFRM_MSG_NEWPOLICY) {
fprintf(
stderr
, "Not a policy: %08x %08x %08x\n",
n->nlmsg_len, n->nlmsg_type, n->nlmsg_flags);
return 0;
}
len -= ((sizeof(*xpinfo)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )));
if (len < 0) {
fprintf(
stderr
, "BUG: wrong nlmsg len %d\n", len);
return -1;
}
parse_rtattr(tb, (__XFRMA_MAX - 1), ((struct rtattr*)(((char*)(xpinfo)) + ( ((sizeof(struct xfrm_userpolicy_info))+4U -1) & ~(4U -1) ))), len);
if (tb[XFRMA_POLICY_TYPE]) {
struct xfrm_userpolicy_type *upt;
if (((int)((tb[XFRMA_POLICY_TYPE])->rta_len) - (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))) < sizeof(*upt)) {
fprintf(
stderr
, "too short XFRMA_POLICY_TYPE len\n");
return -1;
}
upt = ((void*)(((char*)(tb[XFRMA_POLICY_TYPE])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0))));
ptype = upt->type;
}
if (!xfrm_policy_filter_match(xpinfo, ptype))
return 0;
if (xpinfo->dir >= XFRM_POLICY_MAX)
return 0;
if (xb->offset + ((sizeof(*xpid)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))) > xb->size)
return 0;
new_n = (struct nlmsghdr *)(xb->buf + xb->offset);
new_n->nlmsg_len = ((sizeof(*xpid)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) )));
new_n->nlmsg_flags = 0x01;
new_n->nlmsg_type = XFRM_MSG_DELPOLICY;
new_n->nlmsg_seq = ++rth->seq;
xpid = ((void *)(((char *)new_n) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))));
memcpy(&xpid->sel, &xpinfo->sel, sizeof(xpid->sel));
xpid->dir = xpinfo->dir;
xpid->index = xpinfo->index;
if (tb[XFRMA_MARK]) {
int r = addattr_l(new_n, xb->size, XFRMA_MARK,
(void *)((void*)(((char*)(tb[XFRMA_MARK])) + (( ((sizeof(struct rtattr))+4U -1) & ~(4U -1) ) + (0)))), tb[XFRMA_MARK]->rta_len);
if (r < 0) {
fprintf(
stderr
, "%s: XFRMA_MARK failed\n", __func__);
exit(1);
}
}
if (tb[XFRMA_IF_ID]) {
addattr32(new_n, xb->size, XFRMA_IF_ID,
rta_getattr_u32(tb[XFRMA_IF_ID]));
}
xb->offset += new_n->nlmsg_len;
xb->nlmsg_count++;
return 0;
}
| long long xfrm_policy_keep(struct_0 *a0, struct_1 *a1) {
char v0;
unsigned int v1;
unsigned int v2;
struct_4 *v3;
struct_5 *v4;
char *v5;
struct_2 *v6;
struct_3 *v7;
char v8;
char v9;
char v10;
char v11;
unsigned long long v13;
v3 = a1->field_18;
v4 = &a0[2];
v1 = a0->field_0;
v0 = 0;
if (a0->field_4 != 19) {
fprintf(*(&stderr), "Not a policy: %08x %08x %08x\n", a0->field_0, a0->field_4, a0->field_6);
v13 = 0;
goto LABEL_402566;
}
v1 -= 184;
if (v1 < 0) {
fprintf(*(&stderr), "BUG: wrong nlmsg len %d\n", v1);
v13 = 4294967295;
goto LABEL_402566;
}
parse_rtattr(&v8, 0x20, &v4[1].padding_0[7], v1);
if (*(&v9)) {
if (*(*(&v9)) - 4 > 5) {
v5 = *(&v9) + 4;
v0 = *(v5);
} else {
fprintf(*(&stderr), "too short XFRMA_POLICY_TYPE len\n");
v13 = 4294967295;
goto LABEL_402566;
}
}
if (!xfrm_policy_filter_match(v4, v0)) {
v13 = 0;
} else if (v4->field_a0 > 2) {
v13 = 0;
} else if (a1->field_c + 80 > a1->field_8) {
v13 = 0;
} else {
v6 = a1->field_c + a1->field_0;
v6->field_0 = 80;
v6->field_6 = 1;
v6->field_4 = 20;
v3->field_1c = v3->field_1c + 1;
v6->field_8 = v3->field_1c;
v7 = &v6[1].field_4;
memcpy(v7, v4, 0x38);
v7->field_3c = v4->field_a0;
v7->field_38 = v4->field_9c;
if (*(&v10)) {
v2 = addattr_l(v6, a1->field_8, 0x15, *(&v10) + 4, *(*(&v10)));
if (v2 < 0) {
fprintf(*(&stderr), "%s: XFRMA_MARK failed\n", &__func__.9347);
exit(0x1);
}
}
if (*(&v11))
addattr32(v6, a1->field_8, 0x1f, rta_getattr_u32(*(&v11)));
a1->field_c = v6->field_0 + a1->field_c;
a1->field_10 = a1->field_10 + 1;
v13 = 0;
}
LABEL_402566:
return v13;
}
|
void size_columns(unsigned int cols[], unsigned int n, ...)
{
unsigned int i, len;
uint64_t val;
va_list args;
__builtin_va_start(
args
,
n
)
;
for (i = 0; i < n; i++) {
val =
__builtin_va_arg(
args
,
unsigned long long
)
;
if (human_readable)
continue;
for (len = 1; val > 9; len++, val /= 10)
;
if (len > cols[i])
cols[i] = len;
}
__builtin_va_end(
args
)
;
}
| void size_columns(unsigned int *a0, unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long a5) {
unsigned int v0;
unsigned int v1;
unsigned long long v2;
unsigned int v3;
unsigned int v4;
unsigned long v5;
unsigned long v6;
unsigned long long v7;
char v8;
unsigned long v9;
unsigned long v10;
unsigned long v11;
int v12;
int v13;
int v14;
int v15;
int v16;
int v17;
int v18;
int v19;
unsigned long v20;
char v21;
int v22;
int v23;
int v24;
int v25;
int v26;
int v27;
int v28;
int v29;
unsigned long long *v30;
unsigned long long v31;
v9 = a3;
v10 = a4;
v11 = a5;
if (v21) {
v12 = v22;
v13 = v23;
v14 = v24;
v15 = v25;
v16 = v26;
v17 = v27;
v18 = v28;
v19 = v29;
}
v7 = v30[5];
v3 = 16;
v4 = 48;
v5 = &v20;
v6 = &v8;
for (v0 = 0; v0 < a1; v0 += 1) {
if (v3 <= 47)
v3 += 8;
else
v5 += 8;
v2 = a2;
if (!human_readable) {
for (v1 = 1; v2 > 9; v2 = v2 * 14757395258967641293 >> 64 >> 3) {
v1 += 1;
}
if (v1 > a0[v0])
a0[v0] = v1;
}
}
v31 = v7 ^ v30[5];
if ((v7 ^ v30[5]))
__stack_chk_fail();
return;
}
|
char **
history_tokenize (const char *string)
{
return (history_tokenize_internal (string, -1, (int *)
((void *)0)
));
}
| void history_tokenize(undefined8 param_1)
{
history_tokenize_internal(param_1,0xffffffff,0);
return;
}
|
int
rl_timeout_remaining (unsigned int *secs, unsigned int *usecs)
{
struct timeval current_time;
if (((&timeout_point)->tv_sec == 0 && (&timeout_point)->tv_usec == 0))
{
(*__errno_location ())
= 0;
return -1;
}
if (gettimeofday(¤t_time, 0) != 0)
return -1;
if (current_time.tv_sec > timeout_point.tv_sec ||
(current_time.tv_sec == timeout_point.tv_sec &&
current_time.tv_usec >= timeout_point.tv_usec))
return 0;
if (secs && usecs)
{
*secs = timeout_point.tv_sec - current_time.tv_sec;
*usecs = timeout_point.tv_usec - current_time.tv_usec;
if (timeout_point.tv_usec < current_time.tv_usec)
{
(*secs)--;
*usecs += 1000000;
}
}
return 1;
}
| undefined8 rl_timeout_remaining(int *param_1,int *param_2)
{
int iVar1;
int *piVar2;
undefined8 uVar3;
long in_FS_OFFSET;
timeval local_28;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
if ((timeout_point._0_8_ == 0) && (timeout_point._8_8_ == 0)) {
piVar2 = __errno_location();
*piVar2 = 0;
uVar3 = 0xffffffff;
}
else {
iVar1 = gettimeofday(&local_28,(__timezone_ptr_t)0x0);
if (iVar1 == 0) {
if ((timeout_point._0_8_ < local_28.tv_sec) ||
((local_28.tv_sec == timeout_point._0_8_ && (timeout_point._8_8_ <= local_28.tv_usec)))) {
uVar3 = 0;
}
else {
if ((param_1 != (int *)0x0) && (param_2 != (int *)0x0)) {
*param_1 = (int)timeout_point._0_8_ - (int)local_28.tv_sec;
*param_2 = (int)timeout_point._8_8_ - (int)local_28.tv_usec;
if (timeout_point._8_8_ < local_28.tv_usec) {
*param_1 = *param_1 + -1;
*param_2 = *param_2 + 1000000;
}
}
uVar3 = 1;
}
}
else {
uVar3 = 0xffffffff;
}
}
if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
__stack_chk_fail();
}
return uVar3;
}
|
static int batadv_parse_opt(struct link_util *lu, int argc, char **argv,
struct nlmsghdr *n)
{
while (argc > 0) {
if (matches(*argv, "ra") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
addattrstrz(n, 1024, IFLA_BATADV_ALGO_NAME, *argv);
} else if (matches(*argv, "help") == 0) {
explain();
return -1;
} else {
fprintf(
stderr
,
"batadv: unknown command \"%s\"?\n",
*argv);
explain();
return -1;
}
argc--, argv++;
}
return 0;
}
| long batadv_parse_opt(long a1, int a2, const char **a3, long a4)
{
const char **v7;
int v9;
while ( 1 )
{
if ( a2 <= 0 )
return 0LL;
if ( (unsigned char)matches(*a3, "ra") == 1 )
break;
v7 = a3 + 1;
v9 = a2 - 1;
if ( v9 <= 0 )
incomplete_command();
addattrstrz(a4, 1024LL, 1LL, *v7);
a2 = v9 - 1;
a3 = v7 + 1;
}
if ( (unsigned char)matches(*a3, "help") == 1 )
fprintf(stderr, "batadv: unknown command \"%s\"?\n", *a3);
explain();
return 0xFFFFFFFFLL;
}
|
int
platform_privileged_uidswap(void)
{
return (getuid() == 0 || geteuid() == 0);
}
| _BOOL8 platform_privileged_uidswap()
{
return !getuid() || !geteuid();
}
|
static int
monitor_read(struct ssh *ssh, struct monitor *pmonitor, struct mon_table *ent,
struct mon_table **pent)
{
struct sshbuf *m;
int r, ret;
u_char type;
struct pollfd pfd[2];
for (;;) {
memset(&pfd, 0, sizeof(pfd));
pfd[0].fd = pmonitor->m_sendfd;
pfd[0].events =
0x001
;
pfd[1].fd = pmonitor->m_log_recvfd;
pfd[1].events = pfd[1].fd == -1 ? 0 :
0x001
;
if (poll(pfd, pfd[1].fd == -1 ? 1 : 2, -1) == -1) {
if (
(*__errno_location ())
==
4
||
(*__errno_location ())
==
11
)
continue;
sshfatal("monitor.c", __func__, 484, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "poll: %s", strerror(
(*__errno_location ())
));
}
if (pfd[1].revents) {
monitor_read_log(pmonitor);
continue;
}
if (pfd[0].revents)
break;
}
if ((m = sshbuf_new()) ==
((void *)0)
)
sshfatal("monitor.c", __func__, 499, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "sshbuf_new");
mm_request_receive(pmonitor->m_sendfd, m);
if ((r = sshbuf_get_u8(m, &type)) != 0)
sshfatal("monitor.c", __func__, 503, 1, SYSLOG_LEVEL_FATAL, ssh_err(r), "parse type");
sshlog("monitor.c", __func__, 505, 1, SYSLOG_LEVEL_DEBUG3,
((void *)0)
, "checking request %d", type);
while (ent->f !=
((void *)0)
) {
if (ent->type == type)
break;
ent++;
}
if (ent->f !=
((void *)0)
) {
if (!(ent->flags & 0x1000))
sshfatal("monitor.c", __func__, 515, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "unpermitted request %d", type);
ret = (*ent->f)(ssh, pmonitor->m_sendfd, m);
sshbuf_free(m);
if (ent->flags & 0x0010) {
sshlog("monitor.c", __func__, 521, 1, SYSLOG_LEVEL_DEBUG2,
((void *)0)
, "%d used once, disabling now", type);
ent->flags &= ~0x1000;
}
if (pent !=
((void *)0)
)
*pent = ent;
return ret;
}
sshfatal("monitor.c", __func__, 531, 1, SYSLOG_LEVEL_FATAL,
((void *)0)
, "unsupported request: %d", type);
return (-1);
}
| int monitor_read(unsigned long long a0, unsigned int a1[3], unsigned long a2, unsigned long a3) {
unsigned long long *v0;
int tmp_20;
struct_0 *v1;
char v2;
unsigned int v3;
unsigned int v4;
unsigned long long v5;
unsigned int v6;
unsigned short v7;
char v8;
unsigned int v9;
unsigned short v10;
char v11;
unsigned long long v12;
unsigned long v13;
char v14;
unsigned long long *v16;
unsigned long long v20;
v1 = a2;
v0 = a3;
v12 = v16[5];
while (true) {
memset(&v6, 0x0, 0x10);
v6 = a1[1];
v7 = 1;
v9 = a1[2];
v10 = v9 != -1;
if (poll(&v6, (v9 == -1 ? 2 : 1), 0xffffffff) != -1) {
LABEL_400c8a:
if (*(&v11)) {
monitor_read_log(a1);
} else {
if (*(&v8))
break;
}
} else if (!(*(__errno_location()) == 11) && *(__errno_location()) != 4) {
v13 = strerror(*(__errno_location()));
v12 = "poll: %s";
sshfatal("monitor.c", "monitor_read", 0x1e4, 0x1, 0x1, 0x0, *(&v14));
goto LABEL_400c8a;
}
}
v5 = sshbuf_new();
if (!v5) {
v12 = "sshbuf_new";
sshfatal("monitor.c", "monitor_read", 0x1f3, 0x1, 0x1, 0x0, *(&v14));
}
mm_request_receive(a1[1], v5, v5);
v3 = sshbuf_get_u8(v5, &v2, &v2);
if (v3) {
v12 = "parse type";
sshfatal("monitor.c", "monitor_read", 0x1f7, 0x1, 0x1, ssh_err(v3), *(&v14));
}
v13 = v2;
v12 = "checking request %d";
sshlog("monitor.c", "monitor_read", 0x1f9, 0x1, 0x7, 0x0);
for (; v1->field_8 && v1->field_0 != v2; v1 += 1);
if (!v1->field_8) {
v13 = v2;
v12 = "unsupported request: %d";
sshfatal("monitor.c", "monitor_read", 0x213, 0x1, 0x1, 0x0, *(&v14));
} else {
if (!(v1->field_4 & 0x1000)) {
v13 = v2;
v12 = "unpermitted request %d";
sshfatal("monitor.c", "monitor_read", 0x203, 0x1, 0x1, 0x0, *(&v14));
}
v4 = v1->field_8(a0, a1[1], v5, a1[1], v1->field_8);
sshbuf_free(v5);
if ((v1->field_4 & 16)) {
v13 = v2;
v12 = "%d used once, disabling now";
sshlog("monitor.c", "monitor_read", 0x209, 0x1, 0x6, 0x0);
v20 = v1->field_4;
*(&v20) = (v1->field_4 >> 8) & 239;
tmp_20 = v20;
v1->field_4 = tmp_20;
}
if (v0)
*(v0) = v1;
if (!(v12 ^ v16[5]))
return v4;
}
__stack_chk_fail();
}
|
static inline void
emit_mandatory_arg_note (void)
{
fputs_unlocked (gettext ("\nMandatory arguments to long options are mandatory for short options too.\n"),
stdout
)
;
}
| void emit_mandatory_arg_note() {
unsigned long long v1;
v1 = fputs_unlocked(gettext("\nMandatory arguments to long options are mandatory for short options too.\n"), stdout);
return;
}
|
static void
child_close_fds(struct ssh *ssh)
{
if (auth_sock != -1) {
close(auth_sock);
auth_sock = -1;
}
if (ssh_packet_get_connection_in(ssh) ==
ssh_packet_get_connection_out(ssh))
close(ssh_packet_get_connection_in(ssh));
else {
close(ssh_packet_get_connection_in(ssh));
close(ssh_packet_get_connection_out(ssh));
}
channel_close_all(ssh);
endpwent();
log_redirect_stderr_to(
((void *)0)
);
closefrom(
2
+ 1);
}
| void child_close_fds(unsigned long long a0) {
unsigned long long v3;
if (auth_sock != -1) {
close(auth_sock);
auth_sock = -1;
}
if (ssh_packet_get_connection_in(a0) == ssh_packet_get_connection_out(a0)) {
close(ssh_packet_get_connection_in(a0));
} else {
close(ssh_packet_get_connection_in(a0));
close(ssh_packet_get_connection_out(a0));
}
channel_close_all(a0);
endpwent();
log_redirect_stderr_to(0x0);
v3 = closefrom(0x3);
return;
}
|
static int do_chflags(const char *dev, __u32 flags, __u32 mask)
{
struct ifreq ifr;
int fd;
int err;
strlcpy(ifr.ifr_ifrn.ifrn_name, dev, 16);
fd = get_ctl_fd();
if (fd < 0)
return -1;
err = ioctl(fd,
0x8913
, &ifr);
if (err) {
perror("SIOCGIFFLAGS");
close(fd);
return -1;
}
if ((ifr.ifr_ifru.ifru_flags^flags)&mask) {
ifr.ifr_ifru.ifru_flags &= ~mask;
ifr.ifr_ifru.ifru_flags |= mask&flags;
err = ioctl(fd,
0x8914
, &ifr);
if (err)
perror("SIOCSIFFLAGS");
}
close(fd);
return err;
}
| void do_chflags(unsigned long long a0, unsigned long a1, unsigned long a2) {
unsigned int v0;
unsigned int v1;
unsigned int v2;
char v3;
unsigned short v4;
unsigned long long v6;
unsigned long long v7;
unsigned long long v8;
v0 = a2;
strlcpy(&v3, a0, 0x10, a0);
v2 = get_ctl_fd();
if (v2 < 0) {
v6 = 4294967295;
} else {
v1 = ioctl(v2, 0x8913);
if (v1) {
perror("SIOCGIFFLAGS");
close(v2);
v7 = 4294967295;
} else {
if (((*(&v4) ^ a1) & a2)) {
v4 = !(v0) & *(&v4);
v4 = a1 & a2 | *(&v4);
v1 = ioctl(v2, 0x8914);
if (v1)
perror("SIOCSIFFLAGS");
}
close(v2);
v8 = v1;
}
}
return;
}
|
static int dump_msg2(struct nlmsghdr *n, void *arg)
{
return dump_msg(
((void *)0)
, n, arg);
}
| long long dump_msg2(unsigned int *a0, void* a1) {
return dump_msg(0x0, a0, a1);
}
|
int
strsvis(char *mbdst, const char *mbsrc, int flags, const char *mbextra)
{
return istrsenvisxl(&mbdst,
((void *)0)
, mbsrc, flags, mbextra,
((void *)0)
);
}
| long long strsvis(unsigned long a0, char *a1, unsigned long a2, void* a3) {
unsigned long v0;
v0 = a0;
return istrsenvisxl(&v0, NULL, a1, a2, a3, 0x0);
}
|
int
inflate(void)
{
int e;
int r;
unsigned h;
outcnt = 0;
bk = 0;
bb = 0;
h = 0;
do {
hufts = 0;
if ((r = inflate_block(&e)) != 0)
return r;
if (hufts > h)
h = hufts;
} while (!e);
while (bk >= 8) {
bk -= 8;
inptr--;
}
(outcnt=(outcnt),flush_window());
;
return 0;
}
| int inflate(void)
{
int iVar1;
long in_FS_OFFSET;
int local_1c;
uint local_18;
int local_14;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
outcnt = 0;
bk = 0;
bb = 0;
local_18 = 0;
do {
hufts = 0;
local_14 = inflate_block(&local_1c);
iVar1 = local_14;
if (local_14 != 0) goto LAB_00101c4b;
if (local_18 < hufts) {
local_18 = hufts;
}
} while (local_1c == 0);
for (; 7 < bk; bk = bk - 8) {
inptr = inptr + -1;
}
flush_window();
iVar1 = 0;
LAB_00101c4b:
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return iVar1;
}
__stack_chk_fail();
}
|
static void
xattrs_acls_cleanup (char *val, size_t *plen)
{
char *p, *q;
p = q = val + strcspn (val, "#\t");
while (*q)
{
if (*q == '\t')
q++;
else if (*q == '#')
{
while (*q != '\n')
q++;
}
else
*p++ = *q++;
}
*plen = p - val;
*p++ = 0;
}
| const char * xattrs_acls_cleanup(const char *a1, _QWORD *a2)
{
const char *v2;
char *v3;
const char *result;
const char *v5;
const char *v6;
v6 = &a1[strcspn(a1, "#\t")];
v5 = v6;
while ( *v6 )
{
if ( *v6 == 9 )
{
++v6;
}
else if ( *v6 == 35 )
{
while ( *v6 != 10 )
++v6;
}
else
{
v2 = v6++;
v3 = (char *)v5++;
*v3 = *v2;
}
}
*a2 = v5 - a1;
result = v5;
*v5 = 0;
return result;
}
|
static int
pkcs11_login(struct pkcs11_key *k11, CK_USER_TYPE type)
{
if (k11 ==
((void *)0)
|| k11->provider ==
((void *)0)
|| !k11->provider->valid) {
sshlog("ssh-pkcs11.c", __func__, 301, 0, SYSLOG_LEVEL_ERROR,
((void *)0)
, "no pkcs11 (valid) provider found");
return (-1);
}
return pkcs11_login_slot(k11->provider,
&k11->provider->slotinfo[k11->slotidx], type);
}
| undefined8 pkcs11_login(long *param_1,undefined8 param_2)
{
undefined8 uVar1;
if (((param_1 == (long *)0x0) || (*param_1 == 0)) || (*(int *)(*param_1 + 0x88) == 0)) {
sshlog("ssh-pkcs11.c","pkcs11_login",0x12d,0,2,0,"no pkcs11 (valid) provider found");
uVar1 = 0xffffffff;
}
else {
uVar1 = pkcs11_login_slot(*param_1,*(long *)(*param_1 + 0x80) + param_1[1] * 0xe0,param_2);
}
return uVar1;
}
|
static void growstackblock(size_t min)
{
size_t newlen;
newlen = stacknleft * 2;
if (newlen < stacknleft)
sh_error("Out of space");
min = (((min | 128) + (sizeof(union {int i; char *cp; double d; }) - 1)) & ~(sizeof(union {int i; char *cp; double d; }) - 1));
if (newlen < min)
newlen += min;
if (stacknxt == stackp->space && stackp != &stackbase) {
struct stack_block *sp;
struct stack_block *prevstackp;
size_t grosslen;
({ suppressint++; ({ __asm__ __volatile__ ("": : :"memory"); }); 0; });
sp = stackp;
prevstackp = sp->prev;
grosslen = newlen + sizeof(struct stack_block) - (((504) + (sizeof(union {int i; char *cp; double d; }) - 1)) & ~(sizeof(union {int i; char *cp; double d; }) - 1));
sp = ckrealloc((pointer)sp, grosslen);
sp->prev = prevstackp;
stackp = sp;
stacknxt = sp->space;
stacknleft = newlen;
sstrend = sp->space + newlen;
({ ({ __asm__ __volatile__ ("": : :"memory"); }); if (--suppressint == 0 && intpending) onint(); 0; });
} else {
char *oldspace = stacknxt;
int oldlen = stacknleft;
char *p = stalloc(newlen);
stacknxt = memcpy(p, oldspace, oldlen);
stacknleft += newlen;
}
}
| void growstackblock(ulong param_1)
{
undefined8 uVar1;
undefined *__src;
int iVar2;
ulong uVar3;
void *__dest;
ulong local_38;
local_38 = stacknleft * 2;
if (local_38 < stacknleft) {
sh_error("Out of space");
}
uVar3 = (param_1 | 0x80) + 7 & 0xfffffffffffffff8;
if (local_38 < uVar3) {
local_38 = local_38 + uVar3;
}
if ((stackp + 8 == stacknxt) && (stackp != stackbase)) {
suppressint = suppressint + 1;
uVar1 = *(undefined8 *)stackp;
stackp = (undefined *)ckrealloc(stackp,local_38 + 8);
*(undefined8 *)stackp = uVar1;
stacknxt = (undefined *)((long)stackp + 8);
stacknleft = local_38;
sstrend = (undefined *)((long)stackp + local_38 + 8);
suppressint = suppressint + -1;
if (suppressint != 0) {
return;
}
if (intpending == 0) {
return;
}
onint();
}
__src = stacknxt;
iVar2 = (int)stacknleft;
__dest = (void *)stalloc(local_38);
stacknxt = (undefined *)memcpy(__dest,__src,(long)iVar2);
stacknleft = local_38 + stacknleft;
return;
}
|
int
fpurge(FILE *fp)
{
if (fp ==
((void *)0)
) {
(*__errno_location ())
=
9
;
return
(-1)
;
}
__fpurge(fp);
return 0;
}
| long long fpurge(void* a0) {
unsigned long long v1;
if (a0) {
__fpurge(a0);
v1 = 0;
} else {
*(__errno_location()) = 9;
v1 = 4294967295;
}
return v1;
}
|
static
_Bool
skip_devices (
_Bool
command_line)
{
return (devices == SKIP_DEVICES
|| ((devices == READ_COMMAND_LINE_DEVICES) & !command_line));
}
| int skip_devices(unsigned long a0) {
unsigned int v1;
unsigned int v2;
if (devices == 2 || ((a0 ^ 1) & !devices))
v1 = 1;
else
v1 = 0;
v2 = v1 & 1;
return v2;
}
|
int
getoptscmd(int argc, char **argv)
{
char **optbase;
if (argc < 3)
sh_error("Usage: getopts optstring var [arg]");
else if (argc == 3) {
optbase = shellparam.p;
if ((unsigned)shellparam.optind > shellparam.nparam + 1) {
shellparam.optind = 1;
shellparam.optoff = -1;
}
}
else {
optbase = &argv[3];
if ((unsigned)shellparam.optind > argc - 2) {
shellparam.optind = 1;
shellparam.optoff = -1;
}
}
return getopts(argv[1], argv[2], optbase);
}
| long long getoptscmd(unsigned long a0, unsigned long long a1[3]) {
unsigned long long v0;
if (a0 <= 2)
sh_error("Usage: getopts optstring var [arg]");
if (a0 != 3) {
v0 = a1 + 1;
if (2236088459 > a0 - 2) {
g_400020 = 1;
g_400024 = -1;
}
} else {
v0 = 5255777229667845513;
g_400020 = 1;
g_400024 = -1;
}
return getopts(a1[1], a1[2], v0);
}
|
static void bi_windup(s)
deflate_state *s;
{
if (s->bi_valid > 8) {
{ {s->pending_buf[s->pending++] = (Bytef)((uch)((s->bi_buf) & 0xff));}; {s->pending_buf[s->pending++] = (Bytef)((uch)((ush)(s->bi_buf) >> 8));}; };
} else if (s->bi_valid > 0) {
{s->pending_buf[s->pending++] = (Bytef)((Byte)s->bi_buf);};
}
s->bi_buf = 0;
s->bi_valid = 0;
}
| void bi_windup(struct_2 *a0) {
struct_2 *v0;
int tmp_38;
int tmp_46;
int tmp_52;
int tmp_98;
int tmp_32;
char *v3;
char *v4;
struct_2 *v5;
v0 = a0;
if (a0->field_1734 > 8) {
tmp_38 = a0->field_1730;
tmp_46 = a0->field_10;
tmp_52 = a0->field_28;
a0->field_28 = a0->field_28 + 1;
*((tmp_52 + tmp_46)) = tmp_38;
a0 = (a0->field_1730 >> 8);
v3 = a0->field_10;
tmp_98 = a0->field_28;
a0->field_28 = a0->field_28 + 1;
*(&v3[tmp_98]) = a0;
} else if (a0->field_1734 > 0) {
a0 = a0->field_1730;
v4 = a0->field_10;
tmp_32 = a0->field_28;
a0->field_28 = a0->field_28 + 1;
*(&v4[tmp_32]) = a0;
}
a0->field_1730 = 0;
v5 = a0;
a0->field_1734 = 0;
return;
}
|
void
usage (int status)
{
if (status !=
0
)
do { fprintf (
stderr
, gettext ("Try '%s --help' for more information.\n"), program_name); } while (0);
else
{
printf (gettext ("Usage: %s [OPTION] NAME...\n")
,
program_name);
fputs_unlocked (gettext ("Output each NAME with its last non-slash component and trailing slashes\nremoved; if NAME contains no /'s, output '.' (meaning the current directory).\n\n"),
stdout
)
;
fputs_unlocked (gettext (" -z, --zero end each output line with NUL, not newline\n"),
stdout
)
;
fputs_unlocked (gettext (" --help display this help and exit\n"),
stdout
);
fputs_unlocked (gettext (" --version output version information and exit\n"),
stdout
);
printf (gettext ("\nExamples:\n %s /usr/bin/ -> \"/usr\"\n %s dir1/str dir2/str -> \"dir1\" followed by \"dir2\"\n %s stdio.h -> \".\"\n")
,
program_name, program_name, program_name);
emit_ancillary_info ("dirname");
}
exit (status);
}
| void usage(int param_1)
{
FILE *pFVar1;
undefined8 uVar2;
char *pcVar3;
uVar2 = program_name;
if (param_1 == 0) {
pcVar3 = (char *)gettext("Usage: %s [OPTION] NAME...\n");
printf(pcVar3,uVar2);
pFVar1 = stdout;
pcVar3 = (char *)gettext(
"Output each NAME with its last non-slash component and trailing slashes\nremoved; if NAME contains no /\'s, output \'.\' (meaning the current directory).\n\n"
);
fputs_unlocked(pcVar3,pFVar1);
pFVar1 = stdout;
pcVar3 = (char *)gettext(" -z, --zero end each output line with NUL, not newline\n");
fputs_unlocked(pcVar3,pFVar1);
pFVar1 = stdout;
pcVar3 = (char *)gettext(" --help display this help and exit\n");
fputs_unlocked(pcVar3,pFVar1);
pFVar1 = stdout;
pcVar3 = (char *)gettext(" --version output version information and exit\n");
fputs_unlocked(pcVar3,pFVar1);
uVar2 = program_name;
pcVar3 = (char *)gettext(
"\nExamples:\n %s /usr/bin/ -> \"/usr\"\n %s dir1/str dir2/str -> \"dir1\" followed by \"dir2\"\n %s stdio.h -> \".\"\n"
);
printf(pcVar3,uVar2,uVar2,uVar2);
emit_ancillary_info();
}
else {
pcVar3 = (char *)gettext("Try \'%s --help\' for more information.\n");
fprintf(stderr,pcVar3,uVar2);
}
exit(param_1);
}
|
static inline
_Bool
is_addrtype_inet_multi(const inet_prefix *p)
{
return (p->flags & ADDRTYPE_INET_MULTI) == ADDRTYPE_INET_MULTI;
}
| int is_addrtype_inet_multi(unsigned short *a0) {
unsigned int v1;
v1 = *(a0) & 10;
*(&v1) = (*(a0) & 10) == 10;
return v1;
}
|
int
history_search_prefix (const char *string, int direction)
{
return (history_search_internal (string, direction, 0x01));
}
| void history_search_prefix(undefined8 param_1,undefined4 param_2)
{
history_search_internal(param_1,param_2,1);
return;
}
|
BZFILE* BZ2_bzWriteOpen
( int* bzerror,
FILE* f,
int blockSize100k,
int verbosity,
int workFactor )
{
Int32 ret;
bzFile* bzf =
((void *)0)
;
{ if (bzerror !=
((void *)0)
) *bzerror = 0; if (bzf !=
((void *)0)
) bzf->lastErr = 0; };
if (f ==
((void *)0)
||
(blockSize100k < 1 || blockSize100k > 9) ||
(workFactor < 0 || workFactor > 250) ||
(verbosity < 0 || verbosity > 4))
{ { if (bzerror !=
((void *)0)
) *bzerror = (-2); if (bzf !=
((void *)0)
) bzf->lastErr = (-2); }; return
((void *)0)
; };
if (ferror(f))
{ { if (bzerror !=
((void *)0)
) *bzerror = (-6); if (bzf !=
((void *)0)
) bzf->lastErr = (-6); }; return
((void *)0)
; };
bzf = malloc ( sizeof(bzFile) );
if (bzf ==
((void *)0)
)
{ { if (bzerror !=
((void *)0)
) *bzerror = (-3); if (bzf !=
((void *)0)
) bzf->lastErr = (-3); }; return
((void *)0)
; };
{ if (bzerror !=
((void *)0)
) *bzerror = 0; if (bzf !=
((void *)0)
) bzf->lastErr = 0; };
bzf->initialisedOk = ((Bool)0);
bzf->bufN = 0;
bzf->handle = f;
bzf->writing = ((Bool)1);
bzf->strm.bzalloc =
((void *)0)
;
bzf->strm.bzfree =
((void *)0)
;
bzf->strm.opaque =
((void *)0)
;
if (workFactor == 0) workFactor = 30;
ret = BZ2_bzCompressInit ( &(bzf->strm), blockSize100k,
verbosity, workFactor );
if (ret != 0)
{ { if (bzerror !=
((void *)0)
) *bzerror = ret; if (bzf !=
((void *)0)
) bzf->lastErr = ret; }; free(bzf); return
((void *)0)
; };
bzf->strm.avail_in = 0;
bzf->initialisedOk = ((Bool)1);
return bzf;
}
| int BZ2_bzWriteOpen(unsigned int *a0, void* a1, unsigned long a2, unsigned long a3, unsigned long a4) {
unsigned int v0;
unsigned int v1;
void* v2;
unsigned int v4;
v0 = a4;
v2 = 0;
if (a0)
*(a0) = 0;
if (v2)
*(&v2[5096]) = 0;
if (a1 && a2 > 0 && a2 <= 9 && v0 >= 0 && v0 <= 250 && a3 >= 0 && a3 <= 4) {
v4 = ferror(a1);
if (v4) {
if (a0)
*(a0) = -6;
if (v2)
*(&v2[5096]) = -6;
v4 = 0;
} else {
v2 = malloc(0x13f0);
if (!v2) {
if (a0)
*(a0) = -3;
if (v2)
*(&v2[5096]) = -3;
v4 = 0;
} else {
if (a0)
*(a0) = 0;
if (v2)
*(&v2[5096]) = 0;
v2->field_13ec = 0;
v2->field_1390 = 0;
v2->field_0 = a1;
v2->field_1394 = 1;
v2->field_13d0 = 0;
v2->field_13d8 = 0;
v2->field_13e0 = 0;
if (!v0)
v0 = 30;
v1 = BZ2_bzCompressInit(&v2->padding_1395[3], a2, a3, v0);
if (v1) {
if (a0)
*(a0) = v1;
if (v2)
*(&v2[5096]) = v1;
free(v2);
v4 = 0;
} else {
v2->field_13a0 = 0;
v2->field_13ec = 1;
v4 = v2;
}
}
}
}
if (a3 < 0 || !a1 || a2 <= 0 || v0 < 0 || v0 > 250 || a2 > 9 || a3 > 4) {
if (a0)
*(a0) = -2;
if (v2)
*(&v2[5096]) = -2;
v4 = 0;
}
return v4;
}
|
void
_rl_end_executing_keyseq (void)
{
if (rl_key_sequence_length > 0)
rl_executing_keyseq[--rl_key_sequence_length] = '\0';
}
| long long _rl_end_executing_keyseq() {
unsigned long long v1;
v1 = rl_key_sequence_length;
if (rl_key_sequence_length > 0) {
rl_key_sequence_length = rl_key_sequence_length - 1;
v1 = rl_key_sequence_length + rl_executing_keyseq;
*((rl_key_sequence_length + rl_executing_keyseq)) = 0;
}
return v1;
}
|
static intmax_t and(int token, union yystype *val, int op, int noeval)
{
intmax_t a = binop(token, val, op, noeval);
intmax_t b;
op = last_token;
if (op != 3)
return a;
token = yylex();
*val = yylval;
b = and(token, val, yylex(), noeval | !a);
return a && b;
}
| int and(unsigned long a0, unsigned long long *a1, unsigned long a2, unsigned long a3) {
unsigned int v0;
unsigned int v1;
unsigned long v2;
unsigned long v3;
unsigned int v5;
v1 = a0;
v0 = a2;
v2 = binop(v1, a1, v0, a3);
v0 = last_token;
if (v0 != 3) {
v5 = v2;
} else {
v1 = yylex();
*(a1) = -541125437600005304;
v3 = and(v1, a1, yylex(), !v2 | a3);
if (v2 && v3)
v5 = 1;
if (!v2 || !v3)
v5 = 0;
}
return v5;
}
|
int
kex_buf2prop(struct sshbuf *raw, int *first_kex_follows, char ***propp)
{
struct sshbuf *b =
((void *)0)
;
u_char v;
u_int i;
char **proposal =
((void *)0)
;
int r;
*propp =
((void *)0)
;
if ((proposal = calloc(PROPOSAL_MAX, sizeof(char *))) ==
((void *)0)
)
return -2;
if ((b = sshbuf_fromb(raw)) ==
((void *)0)
) {
r = -2;
goto out;
}
if ((r = sshbuf_consume(b, 16)) != 0) {
sshlog("kex.c", __func__, 365, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "consume cookie");
goto out;
}
for (i = 0; i < PROPOSAL_MAX; i++) {
if ((r = sshbuf_get_cstring(b, &(proposal[i]),
((void *)0)
)) != 0) {
sshlog("kex.c", __func__, 371, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "parse proposal %u", i);
goto out;
}
sshlog("kex.c", __func__, 374, 0, SYSLOG_LEVEL_DEBUG2,
((void *)0)
, "%s: %s", proposal_names[i], proposal[i]);
}
if ((r = sshbuf_get_u8(b, &v)) != 0 ||
(r = sshbuf_get_u32(b, &i)) != 0) {
sshlog("kex.c", __func__, 379, 1, SYSLOG_LEVEL_ERROR, ssh_err(r), "parse");
goto out;
}
if (first_kex_follows !=
((void *)0)
)
*first_kex_follows = v;
sshlog("kex.c", __func__, 384, 0, SYSLOG_LEVEL_DEBUG2,
((void *)0)
, "first_kex_follows %d ", v);
sshlog("kex.c", __func__, 385, 0, SYSLOG_LEVEL_DEBUG2,
((void *)0)
, "reserved %u ", i);
r = 0;
*propp = proposal;
out:
if (r != 0 && proposal !=
((void *)0)
)
kex_prop_free(proposal);
sshbuf_free(b);
return r;
}
| long kex_buf2prop(long a1, _DWORD *a2, const char ***a3)
{
long v4;
long v5;
long v6;
unsigned char v8;
unsigned int i;
unsigned int cstring;
long v11;
const char **v12;
unsigned long v13;
v13 = __readfsqword(0x28u);
v11 = 0LL;
*a3 = 0LL;
v12 = (const char **)calloc(0xAuLL, 8uLL);
if ( !v12 )
return 4294967294LL;
v11 = sshbuf_fromb(a1);
if ( v11 )
{
cstring = sshbuf_consume(v11, 16LL);
if ( cstring )
{
v4 = ssh_err(cstring);
sshlog("kex.c", "kex_buf2prop", 365LL, 1LL, 2LL, v4, "consume cookie");
}
else
{
for ( i = 0; i <= 9; ++i )
{
cstring = sshbuf_get_cstring(v11, &v12[i], 0LL);
if ( cstring )
{
v5 = ssh_err(cstring);
sshlog("kex.c", "kex_buf2prop", 371LL, 1LL, 2LL, v5, "parse proposal %u", i);
goto LABEL_18;
}
sshlog("kex.c", "kex_buf2prop", 374LL, 0LL, 6LL, 0LL, "%s: %s", proposal_names[i], v12[i]);
}
cstring = sshbuf_get_u8(v11, &v8);
if ( cstring || (cstring = sshbuf_get_u32(v11, &i)) != 0 )
{
v6 = ssh_err(cstring);
sshlog("kex.c", "kex_buf2prop", 379LL, 1LL, 2LL, v6, "parse");
}
else
{
if ( a2 )
*a2 = v8;
sshlog("kex.c", "kex_buf2prop", 384LL, 0LL, 6LL, 0LL, "first_kex_follows %d ", v8);
sshlog("kex.c", "kex_buf2prop", 385LL, 0LL, 6LL, 0LL, "reserved %u ", i);
cstring = 0;
*a3 = v12;
}
}
}
else
{
cstring = -2;
}
LABEL_18:
if ( cstring )
{
if ( v12 )
kex_prop_free((void **)v12);
}
sshbuf_free(v11);
return cstring;
}
|
static inline void
emit_ancillary_info (char const *program)
{
struct infomap { char const *program; char const *node; } const infomap[] = {
{ "[", "test invocation" },
{ "coreutils", "Multi-call invocation" },
{ "sha224sum", "sha2 utilities" },
{ "sha256sum", "sha2 utilities" },
{ "sha384sum", "sha2 utilities" },
{ "sha512sum", "sha2 utilities" },
{
((void *)0)
,
((void *)0)
}
};
char const *node = program;
struct infomap const *map_prog = infomap;
while (map_prog->program && ! (strcmp (program, map_prog->program) == 0))
map_prog++;
if (map_prog->node)
node = map_prog->node;
printf (gettext ("\n%s online help: <%s>\n"), "GNU coreutils", "https:
char const *lc_messages = setlocale (
5
,
((void *)0)
);
if (lc_messages && strncmp (lc_messages, "" "en_" "", sizeof ("en_") - 1))
{
fputs_unlocked (gettext ("Report any translation bugs to " "<https:
stdout
)
;
}
char const *url_program = (strcmp (program, "[") == 0) ? "test" : program;
printf (gettext ("Full documentation <%s%s>\n"),
"https:
printf (gettext ("or available locally via: info '(coreutils) %s%s'\n"),
node, node == program ? " invocation" : "");
}
| void emit_ancillary_info(char *a0) {
unsigned long v0;
unsigned long long v1[2];
char *v2;
unsigned long long v3;
unsigned long long v4;
unsigned long long v5;
unsigned long long v6;
unsigned long long v7;
unsigned long long v8;
unsigned long long v9;
unsigned long long v10;
unsigned long long v11;
unsigned long long v12;
unsigned long long v13;
unsigned long long v14;
unsigned long long v15;
void* v16;
void* v17;
char v18;
unsigned long long v20;
unsigned long long *v21;
unsigned long long v22;
v4 = "[";
v5 = "test invocation";
v6 = "coreutils";
v7 = "Multi-call invocation";
v8 = "sha224sum";
v9 = "sha2 utilities";
v10 = "sha256sum";
v11 = "sha2 utilities";
v12 = "sha384sum";
v13 = "sha2 utilities";
v14 = "sha512sum";
v15 = "sha2 utilities";
v16 = 0;
v17 = 0;
v0 = a0;
v1[0] = &v4;
while (true) {
if (!v1[0])
break;
if (!strcmp(a0, v1[0]))
break;
v1[0] = v1 + 1;
}
if (v1[1])
v0 = v1[1];
printf(gettext("\n%s online help: <%s>\n"));
v2 = setlocale(0x5, NULL);
if (v2 && strncmp(v2, "en_", 0x3))
fputs_unlocked(gettext("Report any translation bugs to <https:
if (!strcmp(a0, "["))
v20 = "test";
else
v20 = a0;
v3 = v20;
printf(gettext("Full documentation <%s%s>\n"));
printf(gettext("or available locally via: info '(coreutils) %s%s'\n"));
v22 = *(&v18) ^ v21[5];
return;
}
|
static int
update_card(int agent_fd, int add, const char *id, int qflag,
struct dest_constraint **dest_constraints, size_t ndest_constraints)
{
char *pin =
((void *)0)
;
int r, ret = -1;
if (add) {
if ((pin = read_passphrase("Enter passphrase for PKCS#11: ",
0x0002)) ==
((void *)0)
)
return -1;
}
if ((r = ssh_update_card(agent_fd, add, id, pin ==
((void *)0)
? "" : pin,
lifetime, confirm, dest_constraints, ndest_constraints)) == 0) {
ret = 0;
if (!qflag) {
fprintf(
stderr
, "Card %s: %s\n",
add ? "added" : "removed", id);
}
} else {
fprintf(
stderr
, "Could not %s card \"%s\": %s\n",
add ? "add" : "remove", id, ssh_err(r));
ret = -1;
}
free(pin);
return ret;
}
| int update_card(unsigned long a0, unsigned long a1, unsigned long long a2, unsigned long a3, unsigned long long a4, unsigned long a5) {
unsigned long v0;
unsigned int v1;
unsigned int v2;
void* v3;
unsigned long v5;
unsigned int v7;
v3 = 0;
v1 = -1;
if (a1) {
v3 = read_passphrase("Enter passphrase for PKCS#11: ", 0x2);
if (!v3)
v5 = -1;
}
if (!a1 || v3) {
if (v3)
v5 = v3;
else
v5 = &g_4033df;
v0 = a5;
v2 = ssh_update_card(a0, a1, a2, v5, lifetime, confirm, a4);
if (!v2) {
v1 = 0;
if (!a3) {
if (a1)
*(&v5) = "added";
else
*(&v5) = &g_40362d;
fprintf(*(&stderr), "Card %s: %s\n", v5, a2);
}
} else {
if (a1)
*(&v5) = "add";
else
*(&v5) = &g_403646;
v7 = ssh_err(v2);
fprintf(*(&stderr), "Could not %s card \"%s\": %s\n", v5, a2, v7);
v1 = -1;
}
free(v3);
*(&v5) = v1;
}
return v5;
}
|
static int kmod_help(int argc, char *argv[])
{
size_t i;
printf("kmod - Manage kernel modules: list, load, unload, etc\n"
"Usage:\n"
"\t%s [options] command [command_options]\n\n"
"Options:\n"
"\t-V, --version show version\n"
"\t-h, --help show this help\n\n"
"Commands:\n", basename(argv[0]));
for (i = 0; i < (sizeof(kmod_cmds) / sizeof((kmod_cmds)[0]) + ({ _Static_assert((!__builtin_types_compatible_p(typeof(kmod_cmds), typeof(&(kmod_cmds)[0]))), "!__builtin_types_compatible_p(typeof(kmod_cmds), typeof(&(kmod_cmds)[0]))"); 0; })); i++) {
if (kmod_cmds[i]->help !=
((void *)0)
) {
printf(" %-12s %s\n", kmod_cmds[i]->name,
kmod_cmds[i]->help);
}
}
puts("\nkmod also handles gracefully if called from following symlinks:");
for (i = 0; i < (sizeof(kmod_compat_cmds) / sizeof((kmod_compat_cmds)[0]) + ({ _Static_assert((!__builtin_types_compatible_p(typeof(kmod_compat_cmds), typeof(&(kmod_compat_cmds)[0]))), "!__builtin_types_compatible_p(typeof(kmod_compat_cmds), typeof(&(kmod_compat_cmds)[0]))"); 0; })); i++) {
if (kmod_compat_cmds[i]->help !=
((void *)0)
) {
printf(" %-12s %s\n", kmod_compat_cmds[i]->name,
kmod_compat_cmds[i]->help);
}
}
return
0
;
}
| void kmod_help(unsigned long a0, unsigned long long *a1) {
unsigned int v0;
void* v1;
void* v3;
v0 = a0;
printf("kmod - Manage kernel modules: list, load, unload, etc\nUsage:\n\t%s [options] command [command_options]\n\nOptions:\n\t-V, --version show version\n\t-h, --help show this help\n\nCommands:\n", basename(*(a1)));
for (v1 = 0; v1 <= 2; v1 += 1) {
if (*((*((0x8 * v1 + &kmod_cmds[0])) + 16)))
printf(" %-12s %s\n", *(*((0x8 * v1 + &kmod_cmds[0]))));
}
puts("\nkmod also handles gracefully if called from following symlinks:");
for (v1 = 0; v1 <= 5; v1 += 1) {
if (*((*((0x8 * v1 + &kmod_compat_cmds[0])) + 16)))
printf(" %-12s %s\n", *(*((0x8 * v1 + &kmod_compat_cmds[0]))));
}
v3 = 0;
return;
}
|
_Bool
skip_due_to_hold(struct pkginfo *pkg)
{
if (pkg->want != PKG_WANT_HOLD)
return
0
;
if (in_force(FORCE_HOLD)) {
notice(gettext("package %s was on hold, processing it anyway as you requested"),
pkg_name(pkg, pnaw_nonambig));
return
0
;
}
printf(gettext("Package %s is on hold, not touching it. Use --force-hold to override.\n"),
pkg_name(pkg, pnaw_nonambig));
return
1
;
}
| long long skip_due_to_hold(struct_0 *a0) {
unsigned long long v1;
unsigned long long v2;
if (a0->field_10 != 2) {
v1 = 0;
return v1;
} else if (in_force(0x8000)) {
notice(gettext("package %s was on hold, processing it anyway as you requested"), pkg_name(a0, 0x1));
v1 = 0;
return v1;
} else {
v2 = pkg_name(a0, 0x1);
printf(gettext("Package %s is on hold, not touching it. Use --force-hold to override.\n"));
v1 = 1;
return v1;
}
}
|
static void
monitor_set_child_handler(pid_t pid)
{
monitor_child_pid = pid;
}
| void monitor_set_child_handler(unsigned long a0) {
unsigned int v0;
char v1;
unsigned long v3;
unsigned long long v4;
v0 = a0;
v3 = a0;
monitor_child_pid = a0;
v4 = *(&v1);
return;
}
|
static void usage(void)
{
fprintf(
stderr
,
"Usage: ip mptcp endpoint add ADDRESS [ dev NAME ] [ id ID ]\n"
" [ port NR ] [ FLAG-LIST ]\n"
" ip mptcp endpoint delete id ID [ ADDRESS ]\n"
" ip mptcp endpoint change [ id ID ] [ ADDRESS ] [ port NR ] CHANGE-OPT\n"
" ip mptcp endpoint show [ id ID ]\n"
" ip mptcp endpoint flush\n"
" ip mptcp limits set [ subflows NR ] [ add_addr_accepted NR ]\n"
" ip mptcp limits show\n"
" ip mptcp monitor\n"
"FLAG-LIST := [ FLAG-LIST ] FLAG\n"
"FLAG := [ signal | subflow | backup | fullmesh ]\n"
"CHANGE-OPT := [ backup | nobackup | fullmesh | nofullmesh ]\n");
exit(-1);
}
| void usage() {
fprintf(stderr, "Usage:\tip mptcp endpoint add ADDRESS [ dev NAME ] [ id ID ]\n\t\t\t\t [ port NR ] [ FLAG-LIST ]\n\tip mptcp endpoint delete id ID [ ADDRESS ]\n\tip mptcp endpoint change [ id ID ] [ ADDRESS ] [ port NR ] CHANGE-OPT\n\tip mptcp endpoint show [ id ID ]\n\tip mptcp endpoint flush\n\tip mptcp limits set [ subflows NR ] [ add_addr_accepted NR ]\n\tip mptcp limits show\n\tip mptcp monitor\nFLAG-LIST := [ FLAG-LIST ] FLAG\nFLAG := [ signal | subflow | backup | fullmesh ]\nCHANGE-OPT := [ backup | nobackup | fullmesh | nofullmesh ]\n");
exit(0xffffffff);
}
|
static void
reap_some (void)
{
reap (-1);
reap_exited ();
}
| void reap_some(void)
{
reap(0xffffffff);
reap_exited();
return;
}
|
((*__ctype_b_loc ())[(int) ((
str[i]
))] & (unsigned short int) _ISdigit)
) {
if (str[i] == '9')
str[i] = '0';
else {
str[i]++;
return;
}
continue;
}
| ushort ** __ctype_b_loc(void)
{
halt_baddata();
}
|
static void process_flags (int argc, char **argv)
{
int c;
static struct option long_options[] = {
{"append",
0
,
((void *)0)
, 'a'},
{"gid",
1
,
((void *)0)
, 'g'},
{"help",
0
,
((void *)0)
, 'h'},
{"new-name",
1
,
((void *)0)
, 'n'},
{"non-unique",
0
,
((void *)0)
, 'o'},
{"password",
1
,
((void *)0)
, 'p'},
{"root",
1
,
((void *)0)
, 'R'},
{"prefix",
1
,
((void *)0)
, 'P'},
{"users",
1
,
((void *)0)
, 'U'},
{
((void *)0)
, 0,
((void *)0)
, '\0'}
};
while ((c = getopt_long (argc, argv, "ag:hn:op:R:P:U:",
long_options,
((void *)0)
)) != -1) {
switch (c) {
case 'a':
aflg =
1
;
break;
case 'g':
gflg =
1
;
if ( (get_gid (optarg, &group_newid) == 0)
|| (group_newid == (gid_t)-1)) {
fprintf (
stderr
,
gettext ("%s: invalid group ID '%s'\n"),
Prog, optarg);
exit (3);
}
break;
case 'h':
usage (0);
break;
case 'n':
nflg =
1
;
group_newname = optarg;
break;
case 'o':
oflg =
1
;
break;
case 'p':
group_passwd = optarg;
pflg =
1
;
break;
case 'R':
break;
case 'P':
break;
case 'U':
user_list = optarg;
break;
default:
usage (2);
}
}
if (oflg && !gflg) {
usage (2);
}
if (optind != (argc - 1)) {
usage (2);
}
group_name = argv[argc - 1];
}
| void process_flags(int param_1,long param_2)
{
undefined8 uVar1;
undefined8 uVar2;
int iVar3;
char *__format;
do {
iVar3 = getopt_long(param_1,param_2,"ag:hn:op:R:P:U:",long_options_5835,0);
if (iVar3 == -1) {
if ((oflg != '\0') && (gflg != '\x01')) {
usage(2);
}
if (param_1 + -1 != optind) {
usage(2);
}
group_name = *(undefined8 *)(param_2 + (long)param_1 * 8 + -8);
return;
}
switch(iVar3) {
case 0x50:
case 0x52:
break;
default:
usage();
break;
case 0x55:
user_list = optarg;
break;
case 0x61:
aflg = 1;
break;
case 0x67:
gflg = '\x01';
iVar3 = get_gid(optarg,&group_newid);
uVar2 = optarg;
uVar1 = Prog;
if ((iVar3 == 0) || (group_newid == -1)) {
__format = (char *)gettext("%s: invalid group ID \'%s\'\n");
fprintf(stderr,__format,uVar1,uVar2);
exit(3);
}
break;
case 0x68:
usage();
break;
case 0x6e:
nflg = 1;
group_newname = optarg;
break;
case 0x6f:
oflg = '\x01';
break;
case 0x70:
group_passwd = optarg;
pflg = 1;
}
} while( true );
}
|
0
)
do { fprintf (
stderr
, gettext ("Try '%s --help' for more information.\n"), program_name); } while (0);
| int fprintf(FILE *__stream,char *__format,...)
{
halt_baddata();
}
|
int deflateCopy(dest, source)
z_streamp dest;
z_streamp source;
{
deflate_state *ds;
deflate_state *ss;
if (deflateStateCheck(source) || dest == 0) {
return (-2);
}
ss = source->state;
memcpy((voidpf)dest, (voidpf)source, sizeof(z_stream));
ds = (deflate_state *) (*((dest)->zalloc))((dest)->opaque, (1), (sizeof(deflate_state)));
if (ds == 0) return (-4);
dest->state = (struct internal_state *) ds;
memcpy((voidpf)ds, (voidpf)ss, sizeof(deflate_state));
ds->strm = dest;
ds->window = (Bytef *) (*((dest)->zalloc))((dest)->opaque, (ds->w_size), (2*sizeof(Byte)));
ds->prev = (Posf *) (*((dest)->zalloc))((dest)->opaque, (ds->w_size), (sizeof(Pos)));
ds->head = (Posf *) (*((dest)->zalloc))((dest)->opaque, (ds->hash_size), (sizeof(Pos)));
ds->pending_buf = (uchf *) (*((dest)->zalloc))((dest)->opaque, (ds->lit_bufsize), (4));
if (ds->window == 0 || ds->prev == 0 || ds->head == 0 ||
ds->pending_buf == 0) {
deflateEnd (dest);
return (-4);
}
memcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte));
memcpy((voidpf)ds->prev, (voidpf)ss->prev, ds->w_size * sizeof(Pos));
memcpy((voidpf)ds->head, (voidpf)ss->head, ds->hash_size * sizeof(Pos));
memcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size);
ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf);
ds->sym_buf = ds->pending_buf + ds->lit_bufsize;
ds->l_desc.dyn_tree = ds->dyn_ltree;
ds->d_desc.dyn_tree = ds->dyn_dtree;
ds->bl_desc.dyn_tree = ds->bl_tree;
return 0;
}
| long deflateCopy(long a1, _QWORD *a2)
{
const void **v3;
_QWORD *v4;
if ( deflateStateCheck(a2) || !a1 )
return 4294967294LL;
v3 = (const void **)a2[7];
memcpy((void *)a1, a2, 0x70uLL);
v4 = (_QWORD *)(*(long ( **)(_QWORD, long, long))(a1 + 64))(*(_QWORD *)(a1 + 80), 1LL, 5952LL);
if ( !v4 )
return 4294967292LL;
*(_QWORD *)(a1 + 56) = v4;
memcpy(v4, v3, 0x1740uLL);
*v4 = a1;
v4[12] = (*(long ( **)(_QWORD, _QWORD, long))(a1 + 64))(
*(_QWORD *)(a1 + 80),
*((unsigned int *)v4 + 20),
2LL);
v4[14] = (*(long ( **)(_QWORD, _QWORD, long))(a1 + 64))(
*(_QWORD *)(a1 + 80),
*((unsigned int *)v4 + 20),
2LL);
v4[15] = (*(long ( **)(_QWORD, _QWORD, long))(a1 + 64))(
*(_QWORD *)(a1 + 80),
*((unsigned int *)v4 + 33),
2LL);
v4[2] = (*(long ( **)(_QWORD, _QWORD, long))(a1 + 64))(
*(_QWORD *)(a1 + 80),
*((unsigned int *)v4 + 1474),
4LL);
if ( v4[12] && v4[14] && v4[15] && v4[2] )
{
memcpy((void *)v4[12], v3[12], (unsigned int)(2 * *((_DWORD *)v4 + 20)));
memcpy((void *)v4[14], v3[14], 2LL * *((unsigned int *)v4 + 20));
memcpy((void *)v4[15], v3[15], 2LL * *((unsigned int *)v4 + 33));
memcpy((void *)v4[2], v3[2], (unsigned int)v4[3]);
v4[4] = (_BYTE *)v3[4] - (_BYTE *)v3[2] + v4[2];
v4[736] = *((unsigned int *)v4 + 1474) + v4[2];
v4[363] = (char *)v4 + 212;
v4[366] = v4 + 313;
v4[369] = (char *)v4 + 2748;
return 0LL;
}
else
{
deflateEnd(a1);
return 4294967292LL;
}
}
|
int
main (int argc, char **argv)
{
_Bool
display_return =
1
;
_Bool
posixly_correct = !!getenv ("POSIXLY_CORRECT");
_Bool
allow_options =
(! posixly_correct
|| (! DEFAULT_ECHO_TO_XPG && 1 < argc && (strcmp (argv[1], "-n") == 0)));
_Bool
do_v9 = DEFAULT_ECHO_TO_XPG;
;
set_program_name (argv[0]);
setlocale (
6
, "");
bindtextdomain ("coreutils", "/usr/local/share/locale");
textdomain ("coreutils");
atexit (close_stdout);
if (allow_options && argc == 2)
{
if ((strcmp (argv[1], "--help") == 0))
usage (
0
);
if ((strcmp (argv[1], "--version") == 0))
{
version_etc (
stdout
, "echo", "GNU coreutils", Version, ("Brian Fox"), ("Chet Ramey"),
(char *)
((void *)0)
);
return
0
;
}
}
--argc;
++argv;
if (allow_options)
while (argc > 0 && *argv[0] == '-')
{
char const *temp = argv[0] + 1;
size_t i;
for (i = 0; temp[i]; i++)
switch (temp[i])
{
case 'e': case 'E': case 'n':
break;
default:
goto just_echo;
}
if (i == 0)
goto just_echo;
while (*temp)
switch (*temp++)
{
case 'e':
do_v9 =
1
;
break;
case 'E':
do_v9 =
0
;
break;
case 'n':
display_return =
0
;
break;
}
argc--;
argv++;
}
just_echo:
if (do_v9 || posixly_correct)
{
while (argc > 0)
{
char const *s = argv[0];
unsigned char c;
while ((c = *s++))
{
if (c == '\\' && *s)
{
switch (c = *s++)
{
case 'a': c = '\a'; break;
case 'b': c = '\b'; break;
case 'c': return
0
;
case 'e': c = '\x1B'; break;
case 'f': c = '\f'; break;
case 'n': c = '\n'; break;
case 'r': c = '\r'; break;
case 't': c = '\t'; break;
case 'v': c = '\v'; break;
case 'x':
{
unsigned char ch = *s;
if (!
((*__ctype_b_loc ())[(int) ((
ch
))] & (unsigned short int) _ISxdigit)
)
goto not_an_escape;
s++;
c = hextobin (ch);
ch = *s;
if (
((*__ctype_b_loc ())[(int) ((
ch
))] & (unsigned short int) _ISxdigit)
)
{
s++;
c = c * 16 + hextobin (ch);
}
}
break;
case '0':
c = 0;
if (! ('0' <= *s && *s <= '7'))
break;
c = *s++;
__attribute__ ((__fallthrough__));
case '1': case '2': case '3':
case '4': case '5': case '6': case '7':
c -= '0';
if ('0' <= *s && *s <= '7')
c = c * 8 + (*s++ - '0');
if ('0' <= *s && *s <= '7')
c = c * 8 + (*s++ - '0');
break;
case '\\': break;
not_an_escape:
default: putchar_unlocked ('\\'); break;
}
}
putchar_unlocked (c);
}
argc--;
argv++;
if (argc > 0)
putchar_unlocked (' ');
}
}
else
{
while (argc > 0)
{
fputs_unlocked (argv[0],
stdout
);
argc--;
argv++;
if (argc > 0)
putchar_unlocked (' ');
}
}
if (display_return)
putchar_unlocked ('\n');
return
0
;
}
| int main(unsigned long a0, unsigned long a1) {
void* v0;
int tmp_9;
int tmp_11;
int tmp_14;
int tmp_7;
int tmp_25;
char **v1;
unsigned int v2;
char v3;
char v4;
char v5;
char v6;
char v7;
char v8;
void* v9;
void* v10;
char *v11;
char v13;
v2 = a0;
v1[0] = a1;
v3 = 1;
v6 = getenv("POSIXLY_CORRECT");
if ((v6 ^ 1)) {
LABEL_4004d2:
v13 = 1;
} else if (v2 <= 1) {
LABEL_4004d9:
v13 = 0;
} else {
if (!(!strcmp(v1[1], "-n")))
goto LABEL_4004d9;
goto LABEL_4004d2;
}
v7 = v13;
v7 &= 1;
v4 = 0;
set_program_name(v1[0]);
setlocale(0x6, &g_400ae3);
bindtextdomain("coreutils", "/usr/local/share/locale");
textdomain("coreutils");
atexit(got.close_stdout);
if (v7 && v2 == 2) {
if (!strcmp(v1[1], "--help"))
usage(0x0);
if (!strcmp(v1[1], "--version")) {
v0 = 0;
version_etc(*(&stdout), "echo", "GNU coreutils", Version, "Brian Fox", "Chet Ramey");
goto LABEL_4009a9;
}
}
v2 -= 1;
v1 = &v1[1];
if (v7) {
while (true) {
if (v2 <= 0)
goto LABEL_4006db;
if (*(*(v1)) != 45)
goto LABEL_4006db;
v9 = *(v1) + 1;
v10 = 0;
while (true) {
if (!*((v10 + v9))) {
if (!v10)
goto LABEL_4006db;
while (*(v9)) {
tmp_9 = v9;
v9 += 1;
v13 = *(tmp_9);
if (v13 == 110) {
v3 = 0;
} else if (v13 <= 110) {
if (v13 == 69) {
v4 = 0;
} else if (v13 == 101) {
v4 = 1;
}
}
}
v2 -= 1;
v1 = &v1[1];
break;
}
if (41 < *((v10 + v9)) - 69) {
LABEL_4006de:
goto LABEL_4006db;
} else {
if (!(2203318222849 & 1 << (*((v10 + v9)) - 69 & 63)))
goto LABEL_4006de;
v10 += 1;
}
}
}
}
LABEL_4006db:
if (v4) {
while (v2 > 0) {
v11 = *(v1);
while (true) {
tmp_11 = v11;
v11 += 1;
v13 = *(tmp_11);
v5 = v13;
if (!v5) {
v2 -= 1;
v1 = &v1[1];
if (v2 > 0) {
putchar_unlocked(0x20);
break;
}
}
if (v5 != 92) {
LABEL_400906:
} else {
if (!*(v11))
goto LABEL_400906;
tmp_14 = v11;
v11 += 1;
v13 = *(tmp_14);
v5 = v13;
switch (v5) {
case 92:
putchar_unlocked(v5);
case 97:
v5 = 7;
break;
case 98:
v5 = 8;
break;
case 99:
goto LABEL_4009a9;
case 101:
v5 = 27;
break;
case 102:
v5 = 12;
break;
case 110:
v5 = 10;
break;
case 114:
v5 = 13;
break;
case 116:
v5 = 9;
break;
case 118:
v5 = 11;
break;
case 120:
v8 = *(v11);
*(&v13) = *((*(__ctype_b_loc()) + v8 * 2));
*(&v13) = *(&v13) & 0x1000;
if (*(&v13)) {
v11 += 1;
v5 = hextobin(v8);
v8 = *(v11);
*(&v13) = *((*(__ctype_b_loc()) + v8 * 2));
*(&v13) = *(&v13) & 0x1000;
if (*(&v13)) {
v11 += 1;
v13 = hextobin(v8) + v5 * 16;
v5 = v13;
}
break;
}
case 48:
v5 = 0;
if (*(v11) > 47 && *(v11) <= 55) {
tmp_7 = v11;
v11 += 1;
v13 = *(tmp_7);
v5 = v13;
goto LABEL_400883;
}
case 49: case 50: case 51: case 52: case 53: case 54: case 55:
LABEL_400883:
v5 -= 48;
if (*(v11) > 47 && *(v11) <= 55) {
tmp_25 = v11;
v11 += 1;
v13 = *(tmp_25) + (v5 * 8) - 48;
v5 = v13;
}
if (*(v11) > 47 && *(v11) <= 55) {
tmp_25 = v11;
v11 += 1;
v13 = *(tmp_25) + (v5 * 8) - 48;
v5 = v13;
}
break;
default:
putchar_unlocked(0x5c);
break;
}
}
}
}
} else {
while (true) {
if (v2 <= 0)
break;
fputs_unlocked(*(v1), *(&stdout));
v2 -= 1;
v1 = &v1[1];
if (v2 <= 0)
continue;
putchar_unlocked(0x20);
}
if (v3)
putchar_unlocked(0xa);
}
LABEL_4009a9:
return 0;
}
|
static void
closefrom_fallback(int lowfd)
{
long fd, maxfd;
maxfd = sysconf(
_SC_OPEN_MAX
);
if (maxfd < 0)
maxfd = 256;
for (fd = lowfd; fd < maxfd; fd++)
(void) close((int) fd);
}
| void closefrom_fallback(unsigned long a0) {
unsigned int v0;
unsigned long long v1;
unsigned long long v2;
unsigned long long v4;
v0 = a0;
v2 = sysconf(0x4);
if ((v2 - 0 >> 63))
v2 = 0x100;
v1 = a0;
while (true) {
v4 = v1;
if (v1 >= v2)
break;
close(v1);
*(&v1) = __addvdi3(v1, 0x1);
}
return;
}
|
static inline int
is_basic (char c)
{
return (is_basic_table [(unsigned char) c >> 5] >> ((unsigned char) c & 31))
& 1;
}
| long is_basic(unsigned char a1)
{
return (is_basic_table[a1 >> 5] >> (a1 & 0x1F)) & 1;
}
|
static
_Bool
tar_sparse_done (struct tar_sparse_file *file)
{
if (file->optab->done)
return file->optab->done (file);
return
1
;
}
| int tar_sparse_done(struct_0 *a0) {
unsigned int v1;
if (!a0->field_20->field_8) {
v1 = 1;
return v1;
}
v1 = a0->field_20->field_8(a0);
return v1;
}
|
static void
add_fs_type (char const *fstype)
{
struct fs_type_list *fsp;
fsp = xmalloc (sizeof *fsp);
fsp->fs_name = (char *) fstype;
fsp->fs_next = fs_select_list;
fs_select_list = fsp;
}
| void add_fs_type(undefined8 param_1)
{
undefined8 *puVar1;
puVar1 = (undefined8 *)xmalloc(0x10);
*puVar1 = param_1;
puVar1[1] = fs_select_list;
fs_select_list = puVar1;
return;
}
|
static int mptcp_addr_modify(int argc, char **argv, int cmd)
{
struct { struct nlmsghdr n; struct genlmsghdr g; char buf[( ((0)+4U -1) & ~(4U -1) ) + (4096)]; } req = { .n = { .nlmsg_type = (genl_family), .nlmsg_flags = (0x01), .nlmsg_len = ((( ((sizeof(struct genlmsghdr))+4U -1) & ~(4U -1) ) + (0)) + ((int) ( ((sizeof(struct nlmsghdr))+4U -1) & ~(4U -1) ))), }, .g = { .cmd = (cmd), .version = (0x1), }, };
int ret;
ret = mptcp_parse_opt(argc, argv, &req.n, cmd);
if (ret)
return ret;
if (rtnl_talk(&genl_rth, &req.n,
((void *)0)
) < 0)
return -2;
return 0;
}
| void mptcp_addr_modify(unsigned long a0, unsigned int a1, unsigned long a2) {
unsigned int v0;
unsigned int v1;
char v2;
unsigned short v3;
unsigned short v4;
char v5;
char v6;
unsigned long long v7;
unsigned long long v9;
void* v10;
unsigned long v11;
unsigned long long v12;
unsigned long long v13;
void* v14;
v7 = *(&v7);
v0 = a0;
v9 = 514;
for (v10 = &v2; v9; v10 += v11 * 8) {
v9 -= 1;
v2 = 0;
}
*(v10) = 0;
v2 = 20;
v3 = genl_family;
v4 = 1;
v5 = a2;
v6 = 1;
v1 = mptcp_parse_opt(v0, a1, &v2, a2);
if (v1) {
v12 = v1;
} else if (rtnl_talk(&genl_rth, &v2, 0x0) < 0) {
v13 = 4294967294;
} else {
v14 = 0;
}
return;
}
|
static int batadv_parse_opt(struct link_util *lu, int argc, char **argv,
struct nlmsghdr *n)
{
while (argc > 0) {
if (matches(*argv, "ra") == 0) {
do { argv++; if (--argc <= 0) incomplete_command(); } while(0);
addattrstrz(n, 1024, IFLA_BATADV_ALGO_NAME, *argv);
} else if (matches(*argv, "help") == 0) {
explain();
return -1;
} else {
fprintf(
stderr
,
"batadv: unknown command \"%s\"?\n",
*argv);
explain();
return -1;
}
argc--, argv++;
}
return 0;
}
| long long batadv_parse_opt(unsigned long a0, unsigned long a1, unsigned long a2, unsigned long long a3) {
unsigned long long *v0;
unsigned int v1;
unsigned long v2;
unsigned long long v5;
v2 = a0;
v1 = a1;
v0 = a2;
while (true) {
if (v1 <= 0) {
v5 = 0;
break;
} else if ((matches(*(v0), "ra") ^ 1)) {
v0 += 1;
v1 -= 1;
if (v1 <= 0)
incomplete_command();
addattrstrz(a3, 0x400, 0x1, *(v0));
v1 -= 1;
v0 += 1;
} else if ((matches(*(v0), "help") ^ 1)) {
explain();
v5 = 4294967295;
break;
} else {
fprintf(stderr, "batadv: unknown command \"%s\"?\n", *(v0));
explain();
v5 = 4294967295;
break;
}
}
return v5;
}
|
static
void uInt64_from_UInt32s ( UInt64* n, UInt32 lo32, UInt32 hi32 )
{
n->b[7] = (UChar)((hi32 >> 24) & 0xFF);
n->b[6] = (UChar)((hi32 >> 16) & 0xFF);
n->b[5] = (UChar)((hi32 >> 8) & 0xFF);
n->b[4] = (UChar) (hi32 & 0xFF);
n->b[3] = (UChar)((lo32 >> 24) & 0xFF);
n->b[2] = (UChar)((lo32 >> 16) & 0xFF);
n->b[1] = (UChar)((lo32 >> 8) & 0xFF);
n->b[0] = (UChar) (lo32 & 0xFF);
}
| void uInt64_from_UInt32s(char a0[8], unsigned long a1, unsigned long a2) {
char v0;
char v2[8];
unsigned long long v3;
a0[7] = a2 >> 24;
a0[6] = a2 >> 16;
a0[5] = a2 >> 8;
a0[4] = a2;
a0[3] = a1 >> 24;
a0[2] = a1 >> 16;
a0[1] = a1 >> 8;
v2 = a0;
a0[0] = a1;
v3 = *(&v0);
return;
}
|
static z_size_t gz_write(state, buf, len)
gz_statep state;
voidpc buf;
z_size_t len;
{
z_size_t put = len;
if (len == 0)
return 0;
if (state->size == 0 && gz_init(state) == -1)
return 0;
if (state->seek) {
state->seek = 0;
if (gz_zero(state, state->skip) == -1)
return 0;
}
if (len < state->size) {
do {
unsigned have, copy;
if (state->strm.avail_in == 0)
state->strm.next_in = state->in;
have = (unsigned)((state->strm.next_in + state->strm.avail_in) -
state->in);
copy = state->size - have;
if (copy > len)
copy = (unsigned)len;
memcpy(state->in + have, buf, copy);
state->strm.avail_in += copy;
state->x.pos += copy;
buf = (const char *)buf + copy;
len -= copy;
if (len && gz_comp(state, 0) == -1)
return 0;
} while (len);
}
else {
if (state->strm.avail_in && gz_comp(state, 0) == -1)
return 0;
state->strm.next_in = ( Bytef *)buf;
do {
unsigned n = (unsigned)-1;
if (n > len)
n = (unsigned)len;
state->strm.avail_in = n;
state->x.pos += n;
if (gz_comp(state, 0) == -1)
return 0;
len -= n;
} while (len);
}
return put;
}
| ulong gz_write(long param_1,void *param_2,ulong param_3)
{
int iVar1;
uint uVar2;
ulong local_40;
void *local_38;
uint local_1c;
uint local_18;
if (param_3 == 0) {
param_3 = 0;
}
else if ((*(int *)(param_1 + 0x28) == 0) && (iVar1 = gz_init(param_1), iVar1 == -1)) {
param_3 = 0;
}
else {
if (*(int *)(param_1 + 0x70) != 0) {
*(undefined4 *)(param_1 + 0x70) = 0;
iVar1 = gz_zero(param_1,*(undefined8 *)(param_1 + 0x68));
if (iVar1 == -1) {
return 0;
}
}
local_40 = param_3;
local_38 = param_2;
if (param_3 < *(uint *)(param_1 + 0x28)) {
do {
if (*(int *)(param_1 + 0x88) == 0) {
*(undefined8 *)(param_1 + 0x80) = *(undefined8 *)(param_1 + 0x30);
}
uVar2 = ((int)*(undefined8 *)(param_1 + 0x80) + *(int *)(param_1 + 0x88)) -
(int)*(undefined8 *)(param_1 + 0x30);
local_1c = *(int *)(param_1 + 0x28) - uVar2;
if (local_40 < local_1c) {
local_1c = (uint)local_40;
}
memcpy((void *)(*(long *)(param_1 + 0x30) + (ulong)uVar2),local_38,(ulong)local_1c);
*(uint *)(param_1 + 0x88) = *(int *)(param_1 + 0x88) + local_1c;
*(ulong *)(param_1 + 0x10) = *(long *)(param_1 + 0x10) + (ulong)local_1c;
local_38 = (void *)((long)local_38 + (ulong)local_1c);
local_40 = local_40 - local_1c;
if ((local_40 != 0) && (iVar1 = gz_comp(param_1,0), iVar1 == -1)) {
return 0;
}
} while (local_40 != 0);
}
else if ((*(int *)(param_1 + 0x88) == 0) || (iVar1 = gz_comp(param_1,0), iVar1 != -1)) {
*(void **)(param_1 + 0x80) = param_2;
do {
local_18 = 0xffffffff;
if (local_40 < 0xffffffff) {
local_18 = (uint)local_40;
}
*(uint *)(param_1 + 0x88) = local_18;
*(ulong *)(param_1 + 0x10) = *(long *)(param_1 + 0x10) + (ulong)local_18;
iVar1 = gz_comp(param_1,0);
if (iVar1 == -1) {
return 0;
}
local_40 = local_40 - local_18;
} while (local_40 != 0);
}
else {
param_3 = 0;
}
}
return param_3;
}
|
void
readline_internal_setup (void)
{
char *nprompt;
_rl_in_stream = rl_instream;
_rl_out_stream = rl_outstream;
if (_rl_enable_meta & (rl_readline_state & (0x0000004)))
_rl_enable_meta_key ();
run_startup_hooks ();
rl_deactivate_mark ();
if (rl_editing_mode == 0)
rl_vi_insertion_mode (1, 'i');
else
if (_rl_show_mode_in_prompt)
_rl_reset_prompt ();
if (_rl_echoing_p == 0 && rl_redisplay_function == rl_redisplay)
{
if (rl_prompt && rl_already_prompted == 0)
{
nprompt = _rl_strip_prompt (rl_prompt);
fprintf (_rl_out_stream, "%s", nprompt);
fflush (_rl_out_stream);
xfree (nprompt);
}
}
else
{
if (rl_prompt && rl_already_prompted)
rl_on_new_line_with_prompt ();
else
rl_on_new_line ();
(*rl_redisplay_function) ();
}
if (rl_pre_input_hook)
(*rl_pre_input_hook) ();
do { if (_rl_caught_signal) _rl_signal_handler (_rl_caught_signal); } while (0);
}
| long long readline_internal_setup(unsigned long long a0, unsigned long long a1, unsigned long long a2, unsigned long long a3, unsigned long long a4, unsigned long long a5) {
unsigned long long v0;
unsigned long long v2;
_rl_dispatching_keymap = rl_instream;
_rl_dispatching_keymap = rl_outstream;
if (((rl_readline_state & _rl_enable_meta) & 4))
_rl_enable_meta_key();
run_startup_hooks();
rl_deactivate_mark(a0, a1, _rl_enable_meta, a3, a4, a5);
if (!rl_editing_mode) {
rl_vi_insertion_mode(0x1, 0x69);
} else if (_rl_show_mode_in_prompt) {
_rl_reset_prompt();
}
if (!_rl_echoing_p && rl_redisplay_function == got.rl_redisplay && *(&rl_prompt) && !*(&rl_already_prompted)) {
v0 = _rl_strip_prompt(*(&rl_prompt));
fprintf(0xf87d894810ec8348, "%s", v0);
fflush(0xf87d894810ec8348);
xfree(v0);
}
if (_rl_echoing_p || rl_redisplay_function != got.rl_redisplay) {
if (*(&rl_prompt) && *(&rl_already_prompted))
rl_on_new_line_with_prompt();
if (!*(&rl_already_prompted) || !*(&rl_prompt))
rl_on_new_line();
*(5243008)(1, 105, a2, a3, a4, a5);
}
if (rl_pre_input_hook)
*(4202880)();
v2 = _rl_caught_signal;
if (_rl_caught_signal)
v2 = _rl_signal_handler(_rl_caught_signal);
return v2;
}
|
static VARLIST *
vlist_realloc (vlist, n)
VARLIST *vlist;
int n;
{
if (vlist == 0)
return (vlist = vlist_alloc (n));
if (n > vlist->list_size)
{
vlist->list_size = n;
vlist->list = (SHELL_VAR **)sh_xrealloc((vlist->list), ((vlist->list_size + 1) * sizeof (SHELL_VAR *)), "variables.c", 4190);
}
return vlist;
}
| int vlist_realloc(unsigned long a0, unsigned long a1) {
unsigned long v0;
unsigned int v2;
v0 = a0;
if (!v0) {
v0 = vlist_alloc(a1);
v2 = v0;
} else {
if (a1 > v0->field_8) {
v0->field_8 = a1;
v0->field_0 = sh_xrealloc(v0->field_0, (v0->field_8 + 1) * 8, "variables.c", 0x105e);
}
v2 = v0;
}
return v2;
}
|
static void
extract_dirs_from_files (char const *dirname,
_Bool
command_line_arg)
{
size_t i;
size_t j;
_Bool
ignore_dot_and_dot_dot = (dirname !=
((void *)0)
);
if (dirname && (!!active_dir_set))
{
queue_directory (
((void *)0)
, dirname,
0
);
}
for (i = cwd_n_used; i-- != 0; )
{
struct fileinfo *f = sorted_file[i];
if (is_directory (f)
&& (! ignore_dot_and_dot_dot
|| ! basename_is_dot_or_dotdot (f->name)))
{
if (!dirname || f->name[0] == '/')
queue_directory (f->name, f->linkname, command_line_arg);
else
{
char *name = file_name_concat (dirname, f->name,
((void *)0)
);
queue_directory (name, f->linkname, command_line_arg);
free (name);
}
if (f->filetype == arg_directory)
free_ent (f);
}
}
for (i = 0, j = 0; i < cwd_n_used; i++)
{
struct fileinfo *f = sorted_file[i];
sorted_file[j] = f;
j += (f->filetype != arg_directory);
}
cwd_n_used = j;
}
| long extract_dirs_from_files(long a1, char a2)
{
long result;
long v4;
unsigned long v5;
long v6;
long v7;
long *v8;
void *ptr;
if ( a1 && active_dir_set )
queue_directory(0LL, a1, 0);
v4 = cwd_n_used;
while ( v4-- )
{
v8 = (long *)*((_QWORD *)sorted_file + v4);
if ( is_directory((long)v8) && (!a1 || !basename_is_dot_or_dotdot(*v8)) )
{
if ( a1 && *(_BYTE *)*v8 != 47 )
{
ptr = (void *)file_name_concat(a1, *v8, 0LL);
queue_directory((long)ptr, v8[1], a2);
free(ptr);
}
else
{
queue_directory(*v8, v8[1], a2);
}
if ( *((_DWORD *)v8 + 42) == 9 )
free_ent((void **)v8);
}
}
v5 = 0LL;
v6 = 0LL;
while ( v5 < cwd_n_used )
{
v7 = *((_QWORD *)sorted_file + v5);
*((_QWORD *)sorted_file + v6) = v7;
v6 += *(_DWORD *)(v7 + 168) != 9;
++v5;
}
result = v6;
cwd_n_used = v6;
return result;
}
|
static void
cut_fields (FILE *stream)
{
int c;
uintmax_t field_idx = 1;
_Bool
found_any_selected_field =
0
;
_Bool
buffer_first_field;
current_rp = frp;
c = getc_unlocked (stream);
if (c ==
(-1)
)
return;
ungetc (c, stream);
c = 0;
buffer_first_field = (suppress_non_delimited ^ !print_kth (1));
while (
1
)
{
if (field_idx == 1 && buffer_first_field)
{
ssize_t len;
size_t n_bytes;
len = getndelim2 (&field_1_buffer, &field_1_bufsize, 0,
((size_t) -1), delim, line_delim, stream);
if (len < 0)
{
free (field_1_buffer);
field_1_buffer =
((void *)0)
;
if (ferror_unlocked (stream) || feof_unlocked (stream))
break;
xalloc_die ();
}
n_bytes = len;
((void) sizeof ((
n_bytes != 0
) ? 1 : 0), __extension__ ({ if (
n_bytes != 0
) ; else __assert_fail (
"n_bytes != 0"
, "src/cut.c", 315, __extension__ __PRETTY_FUNCTION__); }))
;
c = 0;
if (to_uchar (field_1_buffer[n_bytes - 1]) != delim)
{
if (suppress_non_delimited)
{
}
else
{
fwrite_unlocked (field_1_buffer,sizeof (char),n_bytes,
stdout
);
if (field_1_buffer[n_bytes - 1] != line_delim)
putchar_unlocked (line_delim);
c = line_delim;
}
continue;
}
if (print_kth (1))
{
fwrite_unlocked (field_1_buffer,sizeof (char),n_bytes - 1,
stdout
);
if (delim == line_delim)
{
int last_c = getc_unlocked (stream);
if (last_c !=
(-1)
)
{
ungetc (last_c, stream);
found_any_selected_field =
1
;
}
}
else
found_any_selected_field =
1
;
}
next_item (&field_idx);
}
int prev_c = c;
if (print_kth (field_idx))
{
if (found_any_selected_field)
{
fwrite_unlocked (output_delimiter_string,sizeof (char),output_delimiter_length,
stdout
)
;
}
found_any_selected_field =
1
;
while ((c = getc_unlocked (stream)) != delim && c != line_delim && c !=
(-1)
)
{
putchar_unlocked (c);
prev_c = c;
}
}
else
{
while ((c = getc_unlocked (stream)) != delim && c != line_delim && c !=
(-1)
)
{
prev_c = c;
}
}
if (delim == line_delim && c == delim)
{
int last_c = getc_unlocked (stream);
if (last_c !=
(-1)
)
ungetc (last_c, stream);
else
c = last_c;
}
if (c == delim)
next_item (&field_idx);
else if (c == line_delim || c ==
(-1)
)
{
if (found_any_selected_field
|| !(suppress_non_delimited && field_idx == 1))
{
if (c == line_delim || prev_c != line_delim
|| delim == line_delim)
putchar_unlocked (line_delim);
}
if (c ==
(-1)
)
break;
field_idx = 1;
current_rp = frp;
found_any_selected_field =
0
;
}
}
}
| void cut_fields(FILE *param_1)
{
bool bVar1;
byte bVar2;
char cVar3;
int iVar4;
uint uVar5;
long in_FS_OFFSET;
bool bVar6;
undefined8 uVar7;
uint local_38;
uint local_34;
long local_28;
size_t local_20;
size_t local_18;
long local_10;
local_10 = *(long *)(in_FS_OFFSET + 0x28);
local_28 = 1;
bVar1 = false;
current_rp = frp;
iVar4 = getc_unlocked(param_1);
if (iVar4 == -1) {
LAB_00100ac7:
if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
return;
}
__stack_chk_fail();
}
ungetc(iVar4,param_1);
local_38 = 0;
uVar7 = 0x1006cd;
bVar2 = print_kth(1);
bVar6 = suppress_non_delimited == (bVar2 ^ 1);
do {
while ((local_28 != 1 || (bVar6))) {
LAB_001008ef:
cVar3 = print_kth(local_28);
uVar5 = local_38;
if (cVar3 == '\0') {
do {
local_38 = uVar5;
uVar7 = 0x10098a;
uVar5 = getc_unlocked(param_1);
local_34 = local_38;
if ((uVar5 == delim) || (uVar5 == line_delim)) break;
} while (uVar5 != 0xffffffff);
}
else {
if (bVar1) {
fwrite_unlocked(output_delimiter_string,1,output_delimiter_length,stdout);
}
bVar1 = true;
while( true ) {
uVar7 = 0x10094f;
uVar5 = getc_unlocked(param_1);
local_34 = local_38;
if (((uVar5 == delim) || (uVar5 == line_delim)) || (uVar5 == 0xffffffff)) break;
putchar_unlocked(uVar5);
local_38 = uVar5;
}
}
local_38 = uVar5;
uVar5 = local_38;
if ((delim == line_delim) && (local_38 == delim)) {
uVar7 = 0x1009de;
uVar5 = getc_unlocked(param_1);
if (uVar5 != 0xffffffff) {
uVar7 = 0x1009f8;
ungetc(uVar5,param_1);
uVar5 = local_38;
}
}
local_38 = uVar5;
if (local_38 == delim) {
uVar7 = 0x100a1b;
next_item(&local_28);
}
else if ((local_38 == line_delim) || (local_38 == 0xffffffff)) {
if (((bVar1) || ((suppress_non_delimited != 1 || (local_28 != 1)))) &&
((local_38 == line_delim || ((local_34 != line_delim || (delim == line_delim)))))) {
uVar7 = 0x100a98;
putchar_unlocked((uint)line_delim);
}
if (local_38 == 0xffffffff) goto LAB_00100ac7;
local_28 = 1;
current_rp = frp;
bVar1 = false;
}
}
local_20 = getndelim2(&field_1_buffer,&field_1_bufsize,0,0xffffffffffffffff,delim,line_delim,
param_1,uVar7);
if ((long)local_20 < 0) {
free(field_1_buffer);
field_1_buffer = (void *)0x0;
iVar4 = ferror_unlocked(param_1);
if ((iVar4 != 0) || (iVar4 = feof_unlocked(param_1), iVar4 != 0)) goto LAB_00100ac7;
xalloc_die();
}
local_18 = local_20;
if (local_20 == 0) {
__assert_fail("n_bytes != 0","src/cut.c",0x13b,"cut_fields");
}
local_38 = 0;
uVar7 = 0x1007e8;
bVar2 = to_uchar((int)*(char *)((long)field_1_buffer + (local_20 - 1)));
if (bVar2 == delim) {
cVar3 = print_kth(1);
if (cVar3 != '\0') {
fwrite_unlocked(field_1_buffer,1,local_18 - 1,stdout);
if (delim == line_delim) {
iVar4 = getc_unlocked(param_1);
if (iVar4 != -1) {
ungetc(iVar4,param_1);
bVar1 = true;
}
}
else {
bVar1 = true;
}
}
next_item(&local_28);
goto LAB_001008ef;
}
if (suppress_non_delimited == 0) {
uVar7 = 0x100821;
fwrite_unlocked(field_1_buffer,1,local_18,stdout);
if ((int)*(char *)((long)field_1_buffer + (local_18 - 1)) != (uint)line_delim) {
uVar7 = 0x100858;
putchar_unlocked((uint)line_delim);
}
local_38 = (uint)line_delim;
}
} while( true );
}
|
void
usage (int status)
{
if (status !=
0
)
do { fprintf (
stderr
, gettext ("Try '%s --help' for more information.\n"), program_name); } while (0);
else
{
printf (gettext ("Usage: %s [OPTION]...\n"), program_name);
fputs_unlocked (gettext ("Print the user name associated with the current effective user ID.\nSame as id -un.\n\n"),
stdout
)
;
fputs_unlocked (gettext (" --help display this help and exit\n"),
stdout
);
fputs_unlocked (gettext (" --version output version information and exit\n"),
stdout
);
emit_ancillary_info ("whoami");
}
exit (status);
}
| void usage(int a1)
{
long v1;
char *v2;
char *v3;
FILE *v4;
char *v5;
FILE *v6;
char *v7;
FILE *v8;
char *v9;
v1 = program_name;
if ( a1 )
{
v2 = gettext("Try '%s --help' for more information.\n");
fprintf(stderr, v2, v1);
}
else
{
v3 = gettext("Usage: %s [OPTION]...\n");
printf(v3, v1);
v4 = stdout;
v5 = gettext("Print the user name associated with the current effective user ID.\nSame as id -un.\n\n");
fputs_unlocked(v5, v4);
v6 = stdout;
v7 = gettext(" --help display this help and exit\n");
fputs_unlocked(v7, v6);
v8 = stdout;
v9 = gettext(" --version output version information and exit\n");
fputs_unlocked(v9, v8);
emit_ancillary_info("whoami");
}
exit(a1);
}
|
static
_Bool
star_sparse_member_p (struct tar_sparse_file *file __attribute__ ((unused)))
{
return current_header->header.typeflag == 'S';
}
| long long star_sparse_member_p(unsigned long a0) {
unsigned long v0;
v0 = a0;
return *((current_header + 156)) == 83;
}
|
) & ~cached_umask ()) != 0)
return_val =
0
;
}
else if (omitted_permissions | extra_permissions)
{
omitted_permissions &= ~ cached_umask ();
if ((omitted_permissions | extra_permissions)
&& (fchmod_or_lchmod (dest_desc, dst_dirfd, dst_relname,
dst_mode & ~ cached_umask ())
!= 0))
{
error (0,
(*__errno_location ())
, gettext ("preserving permissions for %s"),
quotearg_style (shell_escape_always_quoting_style, dst_name));
if (x->require_preserve)
return_val =
0
;
}
}
| int cached_umask() {
if (mask.7337 == -1) {
mask.7337 = umask(0x0);
umask(mask.7337);
}
return mask.7337;
}
|
void
bash_history_disable ()
{
remember_on_history = 0;
history_expansion_inhibited = 1;
}
| long long bash_history_disable() {
unsigned long v1;
remember_on_history = 0;
dont_save_function_defs = 1;
return v1;
}
|
get_stat_mtime (struct stat const *st)
{
return ((st)->st_mtim);
}
| void get_stat_mtime(void)
{
halt_baddata();
}
|
void
_rl_init_line_state (void)
{
rl_point = rl_end = rl_mark = 0;
the_line = rl_line_buffer;
the_line[0] = 0;
}
| long long _rl_init_line_state() {
rl_executing_key = 0;
rl_executing_key = 1219493948222425173;
rl_executing_key = 1219493948222425173;
the_line = rl_line_buffer;
*(the_line) = 0;
return the_line;
}
|
static FILE *save_output(const char *s0, const char *s1, const char *s2)
{
int c, fd, fds[2];
char *cp;
pid_t pid;
FILE *ret;
if (s0 && *s0 == 0)
s0 = 0;
if (s1 && *s1 == 0)
s1 = 0;
if (s2 && *s2 == 0)
s2 = 0;
if (!s0 && !s1 && !s2)
return
((void *)0)
;
if (pipe(fds) < 0) {
perror("pipe");
exit(1);
}
pid = fork();
if (pid < 0) {
perror("fork");
exit(1);
}
if (pid == 0) {
if (e2fsck_global_ctx && e2fsck_global_ctx->progress_fd)
close(e2fsck_global_ctx->progress_fd);
if (daemon(0, 0) < 0) {
perror("daemon");
exit(1);
}
close(fds[1]);
while (do_read(fds[0]) > 0)
;
close(fds[0]);
fd = -1;
while (1) {
if (fd < 0 && s0)
fd = open(s0,
01
|
0100
|
01000
, 0644);
if (fd < 0 && s1)
fd = open(s1,
01
|
0100
|
01000
, 0644);
if (fd < 0 && s2)
fd = open(s2,
01
|
0100
|
01000
, 0644);
if (fd >= 0)
break;
sleep(1);
}
cp = outbuf;
while (outbufsize > 0) {
c = write(fd, cp, outbufsize);
if (c < 0) {
if ((
(*__errno_location ())
==
11
) || (
(*__errno_location ())
==
4
))
continue;
break;
}
outbufsize -= c;
cp += c;
}
exit(0);
}
close(fds[0]);
ret = fdopen(fds[1], "w");
if (!ret)
close(fds[1]);
return ret;
}
| int save_output(char *a0, char *a1, unsigned long a2) {
void* v0;
void* v1;
void* v2;
unsigned int v3;
unsigned int v4;
unsigned int v5;
struct_0 *v6;
unsigned long v7;
char v8;
char v9;
unsigned int v11;
v2 = a0;
v1 = a1;
v0 = a2;
if (v2 && !*(v2))
v2 = 0;
if (v1 && !*(v1))
v1 = 0;
if (v0 && !*(v0))
v0 = 0;
if (!v2 && !v1 && !v0) {
v11 = 0;
goto LABEL_400aae;
}
if (pipe(&v8) < 0) {
perror("pipe");
exit(0x1);
}
v4 = fork();
if (v4 < 0) {
perror("fork");
exit(0x1);
} else if (v4) {
close(*(&v8));
v7 = fdopen(*(&v9), "w");
if (!v7)
close(*(&v9));
v11 = v7;
} else {
if (e2fsck_global_ctx && *((e2fsck_global_ctx + 712)))
close(*((e2fsck_global_ctx + 712)));
if (daemon(0x0, 0x0) < 0) {
perror("daemon");
exit(0x1);
}
close(*(&v9));
do { } while (do_read(*(&v8)) > 0);
close(*(&v8));
v3 = -1;
while (true) {
if (v3 < 0 && v2)
v3 = open(v2, 0x241, 0x1a4);
if (v3 < 0 && v1)
v3 = open(v1, 0x241, 0x1a4);
if (v3 < 0 && v0)
v3 = open(v0, 0x241, 0x1a4);
if (v3 >= 0)
break;
sleep(0x1);
}
v6 = outbuf;
while (true) {
if (outbufsize <= 0)
break;
v5 = write(v3, v6, outbufsize);
if (v5 >= 0) {
outbufsize = outbufsize - v5;
v6 = &v6->padding_0[v5];
} else {
if (*(__errno_location()) == 11)
continue;
if (*(__errno_location()) != 4)
break;
}
}
exit(0x0);
}
LABEL_400aae:
return v11;
}
|
int main(argc, argv)
int argc;
char **argv;
{
struct utmp *ut;
char prev;
int status, runlevel;
if (argc > 1) utmpname(argv[1]);
setutent();
while ((ut = getutent()) !=
((void *)0)
) {
if (ut->ut_type ==
1
) {
prev = ut->ut_pid / 256;
if (prev == 0) prev = 'N';
printf("%c %c\n", prev, ut->ut_pid % 256);
endutent();
exit(0);
}
}
endutent();
status = Read_Runlevel_Log(&runlevel);
if (status)
{
printf("N %c\n", runlevel);
return 0;
}
printf("unknown\n");
return(1);
}
| int main(int argc, const char **argv, const char **envp)
{
int ut_pid;
char v5;
unsigned int v6;
struct utmp *v8;
unsigned long v9;
v9 = __readfsqword(0x28u);
if ( argc > 1 )
utmpname(argv[1]);
setutent();
while ( 1 )
{
v8 = getutent();
if ( !v8 )
break;
if ( v8->ut_type == 1 )
{
ut_pid = v8->ut_pid;
if ( ut_pid < 0 )
BYTE1(ut_pid) = (unsigned short)(ut_pid + 255) >> 8;
v5 = BYTE1(ut_pid);
if ( !BYTE1(ut_pid) )
v5 = 78;
printf("%c %c\n", (unsigned int)v5, (unsigned int)(v8->ut_pid % 256));
endutent();
exit(0);
}
}
endutent();
if ( (unsigned int)Read_Runlevel_Log(&v6) )
{
printf("N %c\n", v6);
return 0;
}
else
{
printf("unknown\n");
return 1;
}
}
|
void ehandler_init(io_channel channel)
{
channel->read_error = e2fsck_handle_read_error;
channel->write_error = e2fsck_handle_write_error;
}
| long ehandler_init(long a1)
{
long result;
*(_QWORD *)(a1 + 32) = e2fsck_handle_read_error;
result = a1;
*(_QWORD *)(a1 + 40) = e2fsck_handle_write_error;
return result;
}
|
char *
string_list_dollar_at (list, quoted, flags)
WORD_LIST *list;
int quoted;
int flags;
{
char *ifs, *ret;
char sep[
(__ctype_get_mb_cur_max ())
+ 1];
WORD_LIST *tlist;
ifs = ifs_var ? ((ifs_var)->value) : (char *)0;
if (flags & 0x08)
{
sep[0] = ' ';
sep[1] = '\0';
}
else if (ifs && *ifs)
{
if (ifs_firstc_len == 1)
{
sep[0] = ifs_firstc[0];
sep[1] = '\0';
}
else
{
memcpy (sep, ifs_firstc, ifs_firstc_len);
sep[ifs_firstc_len] = '\0';
}
}
else
{
sep[0] = ' ';
sep[1] = '\0';
}
tlist = (quoted & (0x002|0x001|0x008))
? quote_list (list)
: list_quote_escapes (list);
ret = string_list_internal (tlist, sep);
return ret;
}
| char * string_list_dollar_at(long **a1, int a2, int a3)
{
size_t v3;
unsigned long v4;
void *v5;
_BYTE *v6;
long **v7;
int v9;
int v10;
long **v11;
size_t v12;
void *dest;
_BYTE *v14;
long **v15;
unsigned long v16;
v11 = a1;
v10 = a2;
v9 = a3;
v16 = __readfsqword(0x28u);
v3 = _ctype_get_mb_cur_max() + 1;
v12 = v3 - 1;
v4 = 16 * ((v3 + 15) / 0x10);
while ( &v9 != (int *)((char *)&v9 - (v4 & 0xFFFFFFFFFFFFF000LL)) )
;
v5 = alloca(v4 & 0xFFF);
if ( (v4 & 0xFFF) != 0 )
*(_QWORD *)((char *)&v9 + (v4 & 0xFFF) - 8) = *(_QWORD *)((char *)&v9 + (v4 & 0xFFF) - 8);
dest = &v9;
if ( ifs_var )
v6 = *(_BYTE **)(ifs_var + 8);
else
v6 = 0LL;
v14 = v6;
if ( (v9 & 8) != 0 )
{
*(_BYTE *)dest = 32;
*((_BYTE *)dest + 1) = 0;
}
else if ( v14 && *v14 )
{
if ( ifs_firstc_len == 1 )
{
*(_BYTE *)dest = ifs_firstc[0];
*((_BYTE *)dest + 1) = 0;
}
else
{
memcpy(dest, ifs_firstc, ifs_firstc_len);
*((_BYTE *)dest + ifs_firstc_len) = 0;
}
}
else
{
*(_BYTE *)dest = 32;
*((_BYTE *)dest + 1) = 0;
}
if ( (v10 & 0xB) != 0 )
v7 = quote_list(v11);
else
v7 = list_quote_escapes(v11);
v15 = v7;
return string_list_internal(v7, (long)dest);
}
|
static void
dispose_temporary_env (pushf)
sh_free_func_t *pushf;
{
int i;
HASH_TABLE *disposer;
tempvar_list = strvec_create (((temporary_env) ? (temporary_env)->nentries : 0) + 1);
tempvar_list[tvlist_ind = 0] = 0;
disposer = temporary_env;
temporary_env = (HASH_TABLE *)
((void *)0)
;
hash_flush (disposer, pushf);
hash_dispose (disposer);
tempvar_list[tvlist_ind] = 0;
array_needs_making = 1;
for (i = 0; i < tvlist_ind; i++)
stupidly_hack_special_variables (tempvar_list[i]);
strvec_dispose (tempvar_list);
tempvar_list = 0;
tvlist_ind = 0;
}
| void dispose_temporary_env(unsigned long long a0) {
unsigned int v0;
struct_0 *v1;
unsigned long long v4;
tempvar_list = strvec_create((!temporary_env ? temporary_env[12] + 1 : 1));
tvlist_ind = 0;
g_58b4808ec834853 = 0;
v1 = temporary_env;
temporary_env = 0;
hash_flush(v1, a0);
hash_dispose(v1);
(&g_58b4808ec834853)[17042544940070553685] = 0;
array_needs_making = 1;
for (v0 = 0; v0 < 3850979413; v0 += 1) {
stupidly_hack_special_variables((&g_58b4808ec834853)[v0]);
}
v4 = strvec_dispose(0x58b4808ec834853);
tempvar_list = 0;
tvlist_ind = 0;
return;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.