decompiled_code:
__int64 diminuto_pipe_check()
{
int v0; // eax
unsigned int v2; // [rsp+4h] [rbp-184h]
int v3; // [rsp+1Ch] [rbp-16Ch] BYREF
struct __jmp_buf_tag env; // [rsp+20h] [rbp-168h] BYREF
char v5[136]; // [rsp+100h] [rbp-88h] BYREF

v2 = -1;
if ( (unsigned int)diminuto_criticalsection_lock(&mutex) )
goto LABEL_9;
if ( _sigsetjmp(&env, 0) )
{
diminuto_criticalsection_cleanup(&mutex);
_pthread_unwind_next((__pthread_unwind_buf_t *)&env);
}
_pthread_register_cancel((__pthread_unwind_buf_t *)&env);
v3 = 13;
if ( !(unsigned int)diminuto_uninterruptiblesection_block(&v3, 1LL, v5) )
{
if ( _sigsetjmp((struct __jmp_buf_tag *)&env.__saved_mask.__val[5], 0) )
{
((void (__fastcall *)(char *))diminuto_uninterruptiblesection_cleanup)(v5);
_pthread_unwind_next((__pthread_unwind_buf_t *)&env.__saved_mask.__val[5]);
}
_pthread_register_cancel((__pthread_unwind_buf_t *)&env.__saved_mask.__val[5]);
v0 = signaled;
signaled = 0;
v2 = v0;
_pthread_unregister_cancel((__pthread_unwind_buf_t *)&env.__saved_mask.__val[5]);
((void (__fastcall *)(char *))diminuto_uninterruptiblesection_cleanup)(v5);
}
_pthread_unregister_cancel((__pthread_unwind_buf_t *)&env);
diminuto_criticalsection_cleanup(&mutex);
if ( v2 )
{
LABEL_9:
if ( diminuto_pipe_debug[0] && (diminuto_log_mask & 1) != 0 )
diminuto_log_log(7LL, "diminuto_pipe_check: SIGPIPE");
}
return v2;
}

canonical_decompiled_code:
__int64 func2()
{
int v0; // eax
unsigned int v2; // [rsp+4h] [rbp-184h]
int v3; // [rsp+1Ch] [rbp-16Ch] BYREF
struct __jmp_buf_tag env; // [rsp+20h] [rbp-168h] BYREF
char v5[136]; // [rsp+100h] [rbp-88h] BYREF

v2 = -1;
if ( (unsigned int)diminuto_criticalsection_lock(&mutex) )
goto LABEL_9;
if ( _sigsetjmp(&env, 0) )
{
diminuto_criticalsection_cleanup(&mutex);
_pthread_unwind_next((__pthread_unwind_buf_t *)&env);
}
_pthread_register_cancel((__pthread_unwind_buf_t *)&env);
v3 = 13;
if ( !(unsigned int)diminuto_uninterruptiblesection_block(&v3, 1LL, v5) )
{
if ( _sigsetjmp((struct __jmp_buf_tag *)&env.__saved_mask.__val[5], 0) )
{
((void (__fastcall *)(char *))diminuto_uninterruptiblesection_cleanup)(v5);
_pthread_unwind_next((__pthread_unwind_buf_t *)&env.__saved_mask.__val[5]);
}
_pthread_register_cancel((__pthread_unwind_buf_t *)&env.__saved_mask.__val[5]);
v0 = signaled;
signaled = 0;
v2 = v0;
_pthread_unregister_cancel((__pthread_unwind_buf_t *)&env.__saved_mask.__val[5]);
((void (__fastcall *)(char *))diminuto_uninterruptiblesection_cleanup)(v5);
}
_pthread_unregister_cancel((__pthread_unwind_buf_t *)&env);
diminuto_criticalsection_cleanup(&mutex);
if ( v2 )
{
LABEL_9:
if ( diminuto_pipe_debug[0] && (diminuto_log_mask & 1) != 0 )
diminuto_log_log(7LL, "diminuto_pipe_check: SIGPIPE");
}
return v2;
}

original_code:
int diminuto_pipe_check(void)
{
    int mysignaled = -1;
    do { pthread_mutex_t * _diminuto_criticalsection_mp; _diminuto_criticalsection_mp = (&mutex); if (diminuto_criticalsection_lock(_diminuto_criticalsection_mp) == 0) { do { __pthread_unwind_buf_t __cancel_buf; void (*__cancel_routine) (void *) = (diminuto_criticalsection_cleanup); void *__cancel_arg = (_diminuto_criticalsection_mp); int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) __cancel_buf.__cancel_jmp_buf, 0); if (__builtin_expect ((__not_first_call), 0)) { __cancel_routine (__cancel_arg); __pthread_unwind_next (&__cancel_buf); } __pthread_register_cancel (&__cancel_buf); do {; do { ((void)0);
        do { const int _diminuto_uninterrutiblesection_signals[] = { 13 }; sigset_t _diminuto_uninterruptiblesection_set; if (diminuto_uninterruptiblesection_block(_diminuto_uninterrutiblesection_signals, (sizeof(_diminuto_uninterrutiblesection_signals) / sizeof(_diminuto_uninterrutiblesection_signals[0])), &_diminuto_uninterruptiblesection_set) == 0) { do { __pthread_unwind_buf_t __cancel_buf; void (*__cancel_routine) (void *) = (diminuto_uninterruptiblesection_cleanup); void *__cancel_arg = (&_diminuto_uninterruptiblesection_set); int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) __cancel_buf.__cancel_jmp_buf, 0); if (__builtin_expect ((__not_first_call), 0)) { __cancel_routine (__cancel_arg); __pthread_unwind_next (&__cancel_buf); } __pthread_register_cancel (&__cancel_buf); do {; do { ((void)0);
            mysignaled = signaled;
            signaled = 0;
        } while (0); do { } while (0); } while (0); __pthread_unregister_cancel (&__cancel_buf); if (!0) __cancel_routine (__cancel_arg); } while (0); } } while (0);
    } while (0); do { } while (0); } while (0); __pthread_unregister_cancel (&__cancel_buf); if (!0) __cancel_routine (__cancel_arg); } while (0); } } while (0);
    if (!mysignaled) {
    } else if (diminuto_pipe_debug) {
        ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_DEBUG)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_DEBUG, "diminuto_pipe_check: SIGPIPE") : ((void)0));
    } else {
    }
    return mysignaled;
}

canonical_original_code:
int diminuto_pipe_check()
{
    int mysignaled = -1;
    do { union pthread_mutex_t *_diminuto_criticalsection_mp; _diminuto_criticalsection_mp = (&mutex); if (diminuto_criticalsection_lock(_diminuto_criticalsection_mp) == 0) { do { struct __pthread_unwind_buf_t __cancel_buf; void (*__cancel_routine)(void *) = (diminuto_criticalsection_cleanup); void *__cancel_arg = (_diminuto_criticalsection_mp); int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) __cancel_buf.__cancel_jmp_buf, 0); if (__builtin_expect ((__not_first_call), 0)) { __cancel_routine (__cancel_arg); __pthread_unwind_next (&__cancel_buf); } __pthread_register_cancel (&__cancel_buf); do {; do { ((void)0);
        do { int _diminuto_uninterrutiblesection_signals[] = { 13 }; struct __sigset_t _diminuto_uninterruptiblesection_set; if (diminuto_uninterruptiblesection_block(_diminuto_uninterrutiblesection_signals, (sizeof(_diminuto_uninterrutiblesection_signals) / sizeof(_diminuto_uninterrutiblesection_signals[0])), &_diminuto_uninterruptiblesection_set) == 0) { do { struct __pthread_unwind_buf_t __cancel_buf; void (*__cancel_routine)(void *) = (diminuto_uninterruptiblesection_cleanup); void *__cancel_arg = (&_diminuto_uninterruptiblesection_set); int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) __cancel_buf.__cancel_jmp_buf, 0); if (__builtin_expect ((__not_first_call), 0)) { __cancel_routine (__cancel_arg); __pthread_unwind_next (&__cancel_buf); } __pthread_register_cancel (&__cancel_buf); do {; do { ((void)0);
            mysignaled = signaled;
            signaled = 0;
        } while (0); do { } while (0); } while (0); __pthread_unregister_cancel (&__cancel_buf); if (!0) __cancel_routine (__cancel_arg); } while (0); } } while (0);
    } while (0); do { } while (0); } while (0); __pthread_unregister_cancel (&__cancel_buf); if (!0) __cancel_routine (__cancel_arg); } while (0); } } while (0);
    if (!mysignaled) {
    } else if (diminuto_pipe_debug) {
        ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_DEBUG)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_DEBUG, "diminuto_pipe_check: SIGPIPE") : ((void)0));
    } else {
    }
    return mysignaled;
}

variable_types: struct __sigset_t { unsigned long __val[-1]; }


repo: coverclock/com-diag-diminuto

decompiled_code:
__int64 __fastcall diminuto_pipe_install(int a1)
{
int v1; // edx
__int64 result; // rax
struct sigaction v3; // [rsp+0h] [rbp-A8h] BYREF

v1 = a1;
memset(&v3.sa_mask, 0, 0x90uLL);
v3.sa_handler = diminuto_pipe_handler;
if ( a1 )
v1 = 0x10000000;
v3.sa_flags = v1;
if ( sigaction(13, &v3, 0LL) < 0 )
{
diminuto_log_perror("src/diminuto_pipe.c", 91LL, "diminuto_pipe_install: sigaction");
result = 0xFFFFFFFFLL;
}
else
{
result = diminuto_pipe_debug[0];
if ( diminuto_pipe_debug[0] )
{
result = diminuto_log_mask & 1;
if ( (diminuto_log_mask & 1) != 0 )
{
diminuto_log_log(7LL, "diminuto_pipe_install: SIGPIPE");
result = 0LL;
}
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func3(int a1)
{
int v1; // edx
__int64 result; // rax
struct sigaction v3; // [rsp+0h] [rbp-A8h] BYREF

v1 = a1;
memset(&v3.sa_mask, 0, 0x90uLL);
v3.sa_handler = diminuto_pipe_handler;
if ( a1 )
v1 = 0x10000000;
v3.sa_flags = v1;
if ( sigaction(13, &v3, 0LL) < 0 )
{
diminuto_log_perror("src/diminuto_pipe.c", 91LL, "diminuto_pipe_install: sigaction");
result = 0xFFFFFFFFLL;
}
else
{
result = diminuto_pipe_debug[0];
if ( diminuto_pipe_debug[0] )
{
result = diminuto_log_mask & 1;
if ( (diminuto_log_mask & 1) != 0 )
{
diminuto_log_log(7LL, "diminuto_pipe_install: SIGPIPE");
result = 0LL;
}
}
}
return result;
}

original_code:
int diminuto_pipe_install(int restart)
{
    int rc = 0;
    struct sigaction alarm = { 0 };
    alarm.__sigaction_handler.sa_handler = diminuto_pipe_handler;
    alarm.sa_flags = restart ? 0x10000000 : 0;
    if (sigaction(13, &alarm, (struct sigaction *)0) < 0) {
        diminuto_log_perror("src/diminuto_pipe.c", 91, "diminuto_pipe_install: sigaction");
        rc = -1;
    } else if (diminuto_pipe_debug) {
        ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_DEBUG)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_DEBUG, "diminuto_pipe_install: SIGPIPE") : ((void)0));
    } else {
    }
    return rc;
}

variable_types: restart int

variable_types: rc int

variable_types: struct sigaction { union { void (*sa_handler)(int); void (*sa_sigaction)(int, struct siginfo_t { int si_signo; int si_errno; int si_code; int __pad0; union { int _pad[-1]; struct { int si_pid; unsigned int si_uid; } _kill; struct { int si_tid; int si_overrun; union sigval { int sival_int; void *sival_ptr; } si_sigval; } _timer; struct { int si_pid; unsigned int si_uid; union sigval si_sigval; } _rt; struct { int si_pid; unsigned int si_uid; int si_status; long si_utime; long si_stime; } _sigchld; struct { void *si_addr; short si_addr_lsb; union { struct { void *_lower; void *_upper; } _addr_bnd; unsigned int _pkey; } _bounds; } _sigfault; struct { long si_band; int si_fd; } _sigpoll; struct { void *_call_addr; int _syscall; unsigned int _arch; } _sigsys; } _sifields; } *, void *); } __sigaction_handler; struct __sigset_t { unsigned long __val[-1]; } sa_mask; int sa_flags; void (*sa_restorer)(); }

return_type: int

user_defined_types: struct sigaction { union { void (*sa_handler)(int); void (*sa_sigaction)(int, struct siginfo_t *, void *); } __sigaction_handler; struct __sigset_t sa_mask; int sa_flags; void (*sa_restorer)(); }

user_defined_types: struct siginfo_t { int si_signo; int si_errno; int si_code; int __pad0; union { int _pad[-1]; struct { int si_pid; unsigned int si_uid; } _kill; struct { int si_tid; int si_overrun; union sigval si_sigval; } _timer; struct { int si_pid; unsigned int si_uid; union sigval si_sigval; } _rt; struct { int si_pid; unsigned int si_uid; int si_status; long si_utime; long si_stime; } _sigchld; struct { void *si_addr; short si_addr_lsb; union { struct { void *_lower; void *_upper; } _addr_bnd; unsigned int _pkey; } _bounds; } _sigfault; struct { long si_band; int si_fd; } _sigpoll; struct { void *_call_addr; int _syscall; unsigned int _arch; } _sigsys; } _sifields; }


decompiled_code:
__int64 __fastcall diminuto_framer_fini(__int64 a1)
{
*(_DWORD *)(a1 + 40) = 73;
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func7(__int64 a1)
{
*(_DWORD *)(a1 + 40) = 73;
return 0LL;
}

original_code:
static inline diminuto_framer_t * diminuto_framer_fini(diminuto_framer_t * that) {
    that->state = DIMINUTO_FRAMER_STATE_IDLE;
    return (diminuto_framer_t *)0;
}

canonical_original_code:
static inline struct DiminutoFramer *diminuto_framer_fini(struct DiminutoFramer *that) {
    that->state = DIMINUTO_FRAMER_STATE_IDLE;
    return (struct DiminutoFramer *)0;
}

variable_types:
that
struct DiminutoFramer *

return_type: struct DiminutoFramer { void *buffer; unsigned char *here; unsigned long size; unsigned long limit; unsigned long total; enum DiminutoFramerState { DIMINUTO_FRAMER_STATE_ABORT=expr, DIMINUTO_FRAMER_STATE_COMPLETE=expr, DIMINUTO_FRAMER_STATE_FAILED=expr, DIMINUTO_FRAMER_STATE_FINAL=expr, DIMINUTO_FRAMER_STATE_FLAG=expr, DIMINUTO_FRAMER_STATE_FLETCHER=expr, DIMINUTO_FRAMER_STATE_FLETCHER_ESCAPED=expr, DIMINUTO_FRAMER_STATE_IDLE=expr, DIMINUTO_FRAMER_STATE_INVALID=expr, DIMINUTO_FRAMER_STATE_KERMIT=expr, DIMINUTO_FRAMER_STATE_LENGTH=expr, DIMINUTO_FRAMER_STATE_LENGTH_ESCAPED=expr, DIMINUTO_FRAMER_STATE_NEWLINE=expr, DIMINUTO_FRAMER_STATE_OVERFLOW=expr, DIMINUTO_FRAMER_STATE_PAYLOAD=expr, DIMINUTO_FRAMER_STATE_PAYLOAD_ESCAPED=expr, DIMINUTO_FRAMER_STATE_RESET=expr, DIMINUTO_FRAMER_STATE_SEQUENCE=expr, DIMINUTO_FRAMER_STATE_SEQUENCE_ESCAPED=expr } state; unsigned short length0; unsigned short length; unsigned short sequence0; unsigned short sequence; unsigned short previous; unsigned short generated; unsigned short crc; unsigned short crc0; unsigned char a; unsigned char b; unsigned char sum[2]; unsigned char check[3]; _Bool throttle; _Bool debug; } *

user_defined_types: struct DiminutoFramer { void *buffer; unsigned char *here; unsigned long size; unsigned long limit; unsigned long total; enum DiminutoFramerState state; unsigned short length0; unsigned short length; unsigned short sequence0; unsigned short sequence; unsigned short previous; unsigned short generated; unsigned short crc; unsigned short crc0; unsigned char a; unsigned char b; unsigned char sum[2]; unsigned char check[3]; _Bool throttle; _Bool debug; }


decompiled_code:
__int64 __fastcall diminuto_framer_reset(__int64 a1)
{
*(_DWORD *)(a1 + 40) = 82;
return a1;
}

original_code:
static inline diminuto_framer_t * diminuto_framer_reset(diminuto_framer_t * that) {
    that->state = DIMINUTO_FRAMER_STATE_RESET;
    return that;
}

canonical_original_code:
static inline struct DiminutoFramer *diminuto_framer_reset(struct DiminutoFramer *that) {
    that->state = DIMINUTO_FRAMER_STATE_RESET;
    return that;
}

user_defined_types: enum DiminutoFramerState { DIMINUTO_FRAMER_STATE_ABORT=expr, DIMINUTO_FRAMER_STATE_COMPLETE=expr, DIMINUTO_FRAMER_STATE_FAILED=expr, DIMINUTO_FRAMER_STATE_FINAL=expr, DIMINUTO_FRAMER_STATE_FLAG=expr, DIMINUTO_FRAMER_STATE_FLETCHER=expr, DIMINUTO_FRAMER_STATE_FLETCHER_ESCAPED=expr, DIMINUTO_FRAMER_STATE_IDLE=expr, DIMINUTO_FRAMER_STATE_INVALID=expr, DIMINUTO_FRAMER_STATE_KERMIT=expr, DIMINUTO_FRAMER_STATE_LENGTH=expr, DIMINUTO_FRAMER_STATE_LENGTH_ESCAPED=expr, DIMINUTO_FRAMER_STATE_NEWLINE=expr, DIMINUTO_FRAMER_STATE_OVERFLOW=expr, DIMINUTO_FRAMER_STATE_PAYLOAD=expr, DIMINUTO_FRAMER_STATE_PAYLOAD_ESCAPED=expr, DIMINUTO_FRAMER_STATE_RESET=expr, DIMINUTO_FRAMER_STATE_SEQUENCE=expr, DIMINUTO_FRAMER_STATE_SEQUENCE_ESCAPED=expr }


decompiled_code:
bool __fastcall diminuto_framer_didrollover(__int64 a1)
{
return (*(_QWORD *)(a1 + 48) & 0xFFFFFFFF0000LL) == 0xFFFF00000000LL;
}

canonical_decompiled_code:
bool __fastcall func9(__int64 a1)
{
return (*(_QWORD *)(a1 + 48) & 0xFFFFFFFF0000LL) == 0xFFFF00000000LL;
}

original_code:
static inline _Bool diminuto_framer_didrollover(const diminuto_framer_t * that) {
    return (that->previous == ((65536) - 1)) && (that->sequence == 0);
}

canonical_original_code:
static inline _Bool diminuto_framer_didrollover(struct DiminutoFramer *that) {
    return (that->previous == ((65536) - 1)) && (that->sequence == 0);
}

variable_types: struct DiminutoFramer { void *buffer; unsigned char *here; unsigned long size; unsigned long limit; unsigned long total; enum DiminutoFramerState { DIMINUTO_FRAMER_STATE_ABORT=expr, DIMINUTO_FRAMER_STATE_COMPLETE=expr, DIMINUTO_FRAMER_STATE_FAILED=expr, DIMINUTO_FRAMER_STATE_FINAL=expr, DIMINUTO_FRAMER_STATE_FLAG=expr, DIMINUTO_FRAMER_STATE_FLETCHER=expr, DIMINUTO_FRAMER_STATE_FLETCHER_ESCAPED=expr, DIMINUTO_FRAMER_STATE_IDLE=expr, DIMINUTO_FRAMER_STATE_INVALID=expr, DIMINUTO_FRAMER_STATE_KERMIT=expr, DIMINUTO_FRAMER_STATE_LENGTH=expr, DIMINUTO_FRAMER_STATE_LENGTH_ESCAPED=expr, DIMINUTO_FRAMER_STATE_NEWLINE=expr, DIMINUTO_FRAMER_STATE_OVERFLOW=expr, DIMINUTO_FRAMER_STATE_PAYLOAD=expr, DIMINUTO_FRAMER_STATE_PAYLOAD_ESCAPED=expr, DIMINUTO_FRAMER_STATE_RESET=expr, DIMINUTO_FRAMER_STATE_SEQUENCE=expr, DIMINUTO_FRAMER_STATE_SEQUENCE_ESCAPED=expr } state; unsigned short length0; unsigned short length; unsigned short sequence0; unsigned short sequence; unsigned short previous; unsigned short generated; unsigned short crc; unsigned short crc0; unsigned char a; unsigned char b; unsigned char sum[2]; unsigned char check[3]; _Bool throttle; _Bool debug; } *


decompiled_code:
__int64 __fastcall diminuto_framer_getbuffer(__int64 a1)
{
__int64 *v1; // rdx
bool v2; // r8
__int64 result; // rax

v2 = diminuto_framer_iscomplete_isra_0(*(_DWORD *)(a1 + 40));
result = 0LL;
if ( v2 )
result = *v1;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func23(__int64 a1)
{
__int64 *v1; // rdx
bool v2; // r8
__int64 result; // rax

v2 = func22(*(_DWORD *)(a1 + 40));
result = 0LL;
if ( v2 )
result = *v1;
return result;
}

original_code:
static inline void * diminuto_framer_getbuffer(const diminuto_framer_t * that) {
    return diminuto_framer_iscomplete(that) ? that->buffer : (void *)0;
}

canonical_original_code:
static inline void *diminuto_framer_getbuffer(struct DiminutoFramer *that) {
    return diminuto_framer_iscomplete(that) ? that->buffer : (void *)0;
}

return_type: void *


decompiled_code:
__int64 __fastcall diminuto_framer_getlength(__int64 a1)
{
__int64 v1; // rdx
__int64 result; // rax

if ( diminuto_framer_iscomplete_isra_0(*(_DWORD *)(a1 + 40)) )
result = *(unsigned __int16 *)(v1 + 46);
else
result = -1LL;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func24(__int64 a1)
{
__int64 v1; // rdx
__int64 result; // rax

if ( func22(*(_DWORD *)(a1 + 40)) )
result = *(unsigned __int16 *)(v1 + 46);
else
result = -1LL;
return result;
}

original_code:
static inline ssize_t diminuto_framer_getlength(const diminuto_framer_t * that) {
    return diminuto_framer_iscomplete(that) ? (ssize_t)(that->length) : (ssize_t)(-1);
}

canonical_original_code:
static inline long diminuto_framer_getlength(struct DiminutoFramer *that) {
    return diminuto_framer_iscomplete(that) ? (long)(that->length) : (long)(-1);
}

return_type: long


decompiled_code:
__int64 __fastcall diminuto_framer_debug(__int64 a1, char a2)
{
__int64 result; // rax

result = *(unsigned __int8 *)(a1 + 68);
*(_BYTE *)(a1 + 68) = a2;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func25(__int64 a1, char a2)
{
__int64 result; // rax

result = *(unsigned __int8 *)(a1 + 68);
*(_BYTE *)(a1 + 68) = a2;
return result;
}

original_code:
_Bool diminuto_framer_debug(diminuto_framer_t * that, _Bool debug) {
    _Bool prior = that->debug;
    that->debug = debug;
    return prior;
}

canonical_original_code:
_Bool diminuto_framer_debug(struct DiminutoFramer *that, _Bool debug) {
    _Bool prior = that->debug;
    that->debug = debug;
    return prior;
}


decompiled_code:
__int64 __fastcall diminuto_inet_checksum(unsigned __int8 *a1, unsigned __int64 a2)
{
char v2; // r8
unsigned __int64 v3; // rsi
unsigned int v4; // eax
unsigned __int16 v5; // dx
unsigned __int8 v6; // cl
unsigned int i; // edx

v2 = a2;
if ( a2 <= 1 )
{
if ( !a2 )
return 0xFFFFFFFFLL;
v4 = 0;
}
else
{
v3 = (unsigned __int64)&a1[2 * ((a2 - 2) >> 1) + 2];
v4 = 0;
do
{
LOBYTE(v5) = *a1;
v6 = a1[1];
a1 += 2;
HIBYTE(v5) = v6;
v4 += v5;
}
while ( (unsigned __int8 *)v3 != a1 );
if ( (v2 & 1) == 0 )
goto LABEL_7;
}
v4 += *a1;
for ( i = HIWORD(v4); HIWORD(v4); i = HIWORD(v4) )
{
v4 = i + (unsigned __int16)v4;
LABEL_7:
;
}
return ~v4;
}

canonical_decompiled_code:
__int64 __fastcall func3(unsigned __int8 *a1, unsigned __int64 a2)
{
char v2; // r8
unsigned __int64 v3; // rsi
unsigned int v4; // eax
unsigned __int16 v5; // dx
unsigned __int8 v6; // cl
unsigned int i; // edx

v2 = a2;
if ( a2 <= 1 )
{
if ( !a2 )
return 0xFFFFFFFFLL;
v4 = 0;
}
else
{
v3 = (unsigned __int64)&a1[2 * ((a2 - 2) >> 1) + 2];
v4 = 0;
do
{
LOBYTE(v5) = *a1;
v6 = a1[1];
a1 += 2;
HIBYTE(v5) = v6;
v4 += v5;
}
while ( (unsigned __int8 *)v3 != a1 );
if ( (v2 & 1) == 0 )
goto LABEL_7;
}
v4 += *a1;
for ( i = HIWORD(v4); HIWORD(v4); i = HIWORD(v4) )
{
v4 = i + (unsigned __int16)v4;
LABEL_7:
;
}
return ~v4;
}

original_code:
uint16_t diminuto_inet_checksum(void * buffer, size_t size)
{
    inet_checksum_t datum;
    uint32_t accumulator = 0;
    uint8_t * here;
    here = (uint8_t *)buffer;
    while (size > 1) {
        datum.byte[0] = *(here++);
        datum.byte[1] = *(here++);
        accumulator += datum.word;
        size -= sizeof(uint16_t);
    }
    if (size > 0) {
        datum.byte[0] = *(here++);
        datum.byte[1] = 0;
        accumulator += datum.word;
    }
    while ((datum.word = accumulator >> (sizeof(uint16_t) * 8))) {
        accumulator = (accumulator & (uint16_t)~0) + datum.word;
    }
    return ~accumulator;
}

canonical_original_code:
unsigned short diminuto_inet_checksum(void *buffer, unsigned long size)
{
    union inet_checksum_t datum;
    unsigned int accumulator = 0;
    unsigned char *here;
    here = (unsigned char *)buffer;
    while (size > 1) {
        datum.byte[0] = *(here++);
        datum.byte[1] = *(here++);
        accumulator += datum.word;
        size -= sizeof(unsigned short);
    }
    if (size > 0) {
        datum.byte[0] = *(here++);
        datum.byte[1] = 0;
        accumulator += datum.word;
    }
    while ((datum.word = accumulator >> (sizeof(unsigned short) * 8))) {
        accumulator = (accumulator & (unsigned short)~0) + datum.word;
    }
    return ~accumulator;
}

variable_types:
buffer
void *

variable_types:
size
unsigned long

variable_types: union inet_checksum_t { unsigned short word; unsigned char byte[-1]; }

variable_types:
accumulator
unsigned int

variable_types:
here
unsigned char *

return_type: unsigned short


decompiled_code:
__int64 diminuto_ping4_datagram_peer()
{
int v0; // er12

v0 = socket(2, 3, 1);
if ( v0 >= 0 )
return (unsigned int)v0;
if ( *_errno_location() == 1 )
diminuto_log_perror("src/diminuto_ping4.c", 74LL, "diminuto_ping4_datagram_peer: socket: must be root");
else
diminuto_log_perror("src/diminuto_ping4.c", 76LL, "diminuto_ping4_datagram_peer: socket");
return (unsigned int)v0;
}

canonical_decompiled_code:
__int64 func4()
{
int v0; // er12

v0 = socket(2, 3, 1);
if ( v0 >= 0 )
return (unsigned int)v0;
if ( *_errno_location() == 1 )
diminuto_log_perror("src/diminuto_ping4.c", 74LL, "diminuto_ping4_datagram_peer: socket: must be root");
else
diminuto_log_perror("src/diminuto_ping4.c", 76LL, "diminuto_ping4_datagram_peer: socket");
return (unsigned int)v0;
}

original_code:
int diminuto_ping4_datagram_peer(void)
{
    int fd;
    if ((fd = socket(2, SOCK_RAW, IPPROTO_ICMP)) >= 0) {
    } else if ((*__errno_location ()) == 1) {
        diminuto_log_perror("src/diminuto_ping4.c", 74, "diminuto_ping4_datagram_peer: socket: must be root");
    } else {
        diminuto_log_perror("src/diminuto_ping4.c", 76, "diminuto_ping4_datagram_peer: socket");
    }
    return fd;
}

canonical_original_code:
int diminuto_ping4_datagram_peer()
{
    int fd;
    if ((fd = socket(2, SOCK_RAW, IPPROTO_ICMP)) >= 0) {
    } else if ((*__errno_location ()) == 1) {
        diminuto_log_perror("src/diminuto_ping4.c", 74, "diminuto_ping4_datagram_peer: socket: must be root");
    } else {
        diminuto_log_perror("src/diminuto_ping4.c", 76, "diminuto_ping4_datagram_peer: socket");
    }
    return fd;
}

variable_types: fd int


decompiled_code:
ssize_t __fastcall diminuto_ping4_datagram_send(__int64 fd, __int64 a2, __int64 a3, __int64 a4, __int64 a5, __int64 a6)
{
__int16 v6; // bp
__int16 v7; // bx
int v8; // eax
__int64 v9; // rdx
ssize_t v10; // r12
int v12; // eax
struct sockaddr v13; // [rsp+0h] [rbp-78h] BYREF
__int128 buf[6]; // [rsp+10h] [rbp-68h] BYREF

v6 = a3;
v7 = a4;
buf[1] = 0LL;
buf[2] = 0LL;
buf[3] = 0LL;
diminuto_time_clock(fd, a2, a3, a4, a5, a6, 0LL, 0LL, 0LL, 0LL);
v13.sa_family = 2;
v8 = _bswap_32(a2);
WORD2(buf[0]) = v6;
*((_QWORD *)&buf[0] + 1) = v9;
*(_DWORD *)&v13.sa_data[2] = v8;
LOBYTE(buf[0]) = 8;
WORD3(buf[0]) = v7;
WORD1(buf[0]) = diminuto_inet_checksum((unsigned __int8 *)buf, 0x40uLL);
if ( diminuto_ping4_debug )
diminuto_dump((__int64)stderr, (__int64)buf, 64LL);
v10 = sendto(fd, buf, 0x40uLL, 0, &v13, 0x10u);
if ( v10 < 0 )
{
v12 = *_errno_location();
if ( v12 != 4 && v12 != 11 )
diminuto_log_perror("src/diminuto_ping4.c", 116LL, "diminuto_ping4_datagram_send: sendto");
}
return v10;
}

canonical_decompiled_code:
ssize_t __fastcall func5(__int64 fd, __int64 a2, __int64 a3, __int64 a4, __int64 a5, __int64 a6)
{
__int16 v6; // bp
__int16 v7; // bx
int v8; // eax
__int64 v9; // rdx
ssize_t v10; // r12
int v12; // eax
struct sockaddr v13; // [rsp+0h] [rbp-78h] BYREF
__int128 buf[6]; // [rsp+10h] [rbp-68h] BYREF

v6 = a3;
v7 = a4;
buf[1] = 0LL;
buf[2] = 0LL;
buf[3] = 0LL;
diminuto_time_clock(fd, a2, a3, a4, a5, a6, 0LL, 0LL, 0LL, 0LL);
v13.sa_family = 2;
v8 = func0(a2);
WORD2(buf[0]) = v6;
*((_QWORD *)&buf[0] + 1) = v9;
*(_DWORD *)&v13.sa_data[2] = v8;
LOBYTE(buf[0]) = 8;
WORD3(buf[0]) = v7;
WORD1(buf[0]) = func3((unsigned __int8 *)buf, 0x40uLL);
if ( diminuto_ping4_debug )
func2((__int64)stderr, (__int64)buf, 64LL);
v10 = sendto(fd, buf, 0x40uLL, 0, &v13, 0x10u);
if ( v10 < 0 )
{
v12 = *_errno_location();
if ( v12 != 4 && v12 != 11 )
diminuto_log_perror("src/diminuto_ping4.c", 116LL, "diminuto_ping4_datagram_send: sendto");
}
return v10;
}

original_code:
ssize_t diminuto_ping4_datagram_send(int fd, diminuto_ipv4_t address, uint16_t id, uint16_t seq)
{
    ssize_t total;
    icmp_echo_request_datagram_t buffer = { 0 };
    struct sockaddr_in sa = { 0 };
    struct icmp * icmpp;
    diminuto_ticks_t now;
    now = diminuto_time_clock();
    sa.sin_family = 2;
    sa.sin_addr.s_addr = htonl(address);
    icmpp = (struct icmp *)(&buffer);
    icmpp->icmp_type = 8;
    icmpp->icmp_hun.ih_idseq.icd_id = id;
    icmpp->icmp_hun.ih_idseq.icd_seq = seq;
    memcpy(icmpp->icmp_dun.id_data, &now, sizeof(diminuto_ticks_t));
    icmpp->icmp_cksum = diminuto_inet_checksum(&buffer, sizeof(buffer));
    if (diminuto_ping4_debug) { diminuto_dump(stderr, &buffer, sizeof(buffer)); }
    if ((total = sendto(fd, &buffer, sizeof(buffer), 0, (struct sockaddr *)&sa, sizeof(sa))) == 0) {
    } else if (total > 0) {
    } else if (((*__errno_location ()) != 4) && ((*__errno_location ()) != 11) && ((*__errno_location ()) != 11)) {
        diminuto_log_perror("src/diminuto_ping4.c", 116, "diminuto_ping4_datagram_send: sendto");
    } else {
    }
    return total;
}

canonical_original_code:
long diminuto_ping4_datagram_send(int fd, unsigned int address, unsigned short id, unsigned short seq)
{
    long total;
    union icmp_echo_request_datagram_t buffer = { 0 };
    struct sockaddr_in sa = { 0 };
    struct icmp *icmpp;
    unsigned long now;
    now = diminuto_time_clock();
    sa.sin_family = 2;
    sa.sin_addr.s_addr = htonl(address);
    icmpp = (struct icmp *)(&buffer);
    icmpp->icmp_type = 8;
    icmpp->icmp_hun.ih_idseq.icd_id = id;
    icmpp->icmp_hun.ih_idseq.icd_seq = seq;
    memcpy(icmpp->icmp_dun.id_data, &now, sizeof(diminuto_ticks_t));
    icmpp->icmp_cksum = diminuto_inet_checksum(&buffer, sizeof(buffer));
    if (diminuto_ping4_debug) { diminuto_dump(stderr, &buffer, sizeof(buffer)); }
    if ((total = sendto(fd, &buffer, sizeof(buffer), 0, (struct sockaddr *)&sa, sizeof(sa))) == 0) {
    } else if (total > 0) {
    } else if (((*__errno_location ()) != 4) && ((*__errno_location ()) != 11) && ((*__errno_location ()) != 11)) {
        diminuto_log_perror("src/diminuto_ping4.c", 116, "diminuto_ping4_datagram_send: sendto");
    } else {
    }
    return total;
}

variable_types:
address
unsigned int

variable_types:
id
unsigned short

variable_types:
seq
unsigned short

variable_types: total long

variable_types: union icmp_echo_request_datagram_t { struct { struct icmp { unsigned char icmp_type; unsigned char icmp_code; unsigned short icmp_cksum; union { unsigned char ih_pptr; struct in_addr { unsigned int s_addr; } ih_gwaddr; struct ih_idseq { unsigned short icd_id; unsigned short icd_seq; } ih_idseq; unsigned int ih_void; struct ih_pmtu { unsigned short ipm_void; unsigned short ipm_nextmtu; } ih_pmtu; struct ih_rtradv { unsigned char irt_num_addrs; unsigned char irt_wpa; unsigned short irt_lifetime; } ih_rtradv; } icmp_hun; union { struct { unsigned int its_otime; unsigned int its_rtime; unsigned int its_ttime; } id_ts; struct { struct ip { unsigned int ip_hl; unsigned int ip_v; unsigned char ip_tos; unsigned short ip_len; unsigned short ip_id; unsigned short ip_off; unsigned char ip_ttl; unsigned char ip_p; unsigned short ip_sum; struct in_addr ip_src; } idi_ip; } id_ip; struct icmp_ra_addr { unsigned int ira_addr; unsigned int ira_preference; } id_radv; unsigned int id_mask; unsigned char id_data[1]; } icmp_dun; } icmp; } header; char payload[-1]; }

variable_types: struct sockaddr_in { unsigned short sin_family; unsigned short sin_port; struct in_addr { unsigned int s_addr; } sin_addr; unsigned char sin_zero[-1]; }

variable_types: struct icmp { unsigned char icmp_type; unsigned char icmp_code; unsigned short icmp_cksum; union { unsigned char ih_pptr; struct in_addr { unsigned int s_addr; } ih_gwaddr; struct ih_idseq { unsigned short icd_id; unsigned short icd_seq; } ih_idseq; unsigned int ih_void; struct ih_pmtu { unsigned short ipm_void; unsigned short ipm_nextmtu; } ih_pmtu; struct ih_rtradv { unsigned char irt_num_addrs; unsigned char irt_wpa; unsigned short irt_lifetime; } ih_rtradv; } icmp_hun; union { struct { unsigned int its_otime; unsigned int its_rtime; unsigned int its_ttime; } id_ts; struct { struct ip { unsigned int ip_hl; unsigned int ip_v; unsigned char ip_tos; unsigned short ip_len; unsigned short ip_id; unsigned short ip_off; unsigned char ip_ttl; unsigned char ip_p; unsigned short ip_sum; struct in_addr ip_src; } idi_ip; } id_ip; struct icmp_ra_addr { unsigned int ira_addr; unsigned int ira_preference; } id_radv; unsigned int id_mask; unsigned char id_data[1]; } icmp_dun; } *

variable_types:
now
unsigned long

user_defined_types: union icmp_echo_request_datagram_t { struct { struct icmp icmp; } header; char payload[-1]; }

user_defined_types: struct sockaddr_in { unsigned short sin_family; unsigned short sin_port; struct in_addr sin_addr; unsigned char sin_zero[-1]; }

user_defined_types: struct icmp { unsigned char icmp_type; unsigned char icmp_code; unsigned short icmp_cksum; union { unsigned char ih_pptr; struct in_addr ih_gwaddr; struct ih_idseq ih_idseq; unsigned int ih_void; struct ih_pmtu ih_pmtu; struct ih_rtradv ih_rtradv; } icmp_hun; union { struct { unsigned int its_otime; unsigned int its_rtime; unsigned int its_ttime; } id_ts; struct { struct ip idi_ip; } id_ip; struct icmp_ra_addr id_radv; unsigned int id_mask; unsigned char id_data[1]; } icmp_dun; }

user_defined_types: struct sockaddr { unsigned short sa_family; char sa_data[14]; }


decompiled_code:
__int64 __fastcall diminuto_ping4_datagram_receive(int fd, __int64 a2, char *a3, _BYTE *a4, _WORD *a5, _WORD *a6, __int64 a7, __int64 a8)
{
__int64 v10; // rax
__int64 v11; // r13
int v13; // eax
__int64 v14; // rax
char *v15; // rbp
__int64 v16; // rsi
char *v17; // rdi
__int64 v18; // rdx
__int64 v19; // rcx
__int64 v20; // r8
__int64 v21; // r9
char v22; // al
socklen_t addr_len; // [rsp+1Ch] [rbp-ACh] BYREF
struct sockaddr addr; // [rsp+20h] [rbp-A8h] BYREF
char buf[80]; // [rsp+30h] [rbp-98h] BYREF
int v28; // [rsp+80h] [rbp-48h]

memset(buf, 0, sizeof(buf));
addr = 0LL;
addr_len = 16;
v28 = 0;
v10 = recvfrom(fd, buf, 0x54uLL, 0, &addr, &addr_len);
v11 = v10;
if ( v10 > 0 )
{
if ( diminuto_ping4_debug )
diminuto_dump((__int64)stderr, (__int64)buf, v10);
diminuto_ipc4_identify(&addr, a2, 0LL, 0.0);
if ( v11 > 27 )
{
v14 = (4 * buf[0]) & 0x3C;
v15 = &buf[v14];
v16 = v11 - v14;
v17 = &buf[v14];
if ( !(unsigned __int16)diminuto_inet_checksum((unsigned __int8 *)&buf[v14], v11 - v14) )
{
v22 = *v15;
if ( a3 )
*a3 = v22;
if ( a4 )
{
v18 = (unsigned __int8)v15[1];
*a4 = v18;
}
if ( !v22 )
{
if ( a5 )
*a5 = *((_WORD *)v15 + 2);
if ( a6 )
*a6 = *((_WORD *)v15 + 3);
if ( a7 )
*(_BYTE *)a7 = buf[8];
if ( v11 > 83 )
{
if ( a8 )
*(_QWORD *)a8 = diminuto_time_clock(v17, v16, v18, v19, v20, v21, a5, a6) - *((_QWORD *)v15 + 1);
v11 -= 20LL;
return v11;
}
}
}
}
return 0LL;
}
if ( !v10 )
return 0LL;
v13 = *_errno_location();
if ( v13 != 4 && v13 != 11 )
diminuto_log_perror("src/diminuto_ping4.c", 189LL, "diminuto_ping4_datagram_recv: recvfrom");
return v11;
}

canonical_decompiled_code:
__int64 __fastcall func6(int fd, __int64 a2, char *a3, _BYTE *a4, _WORD *a5, _WORD *a6, __int64 a7, __int64 a8)
{
__int64 v10; // rax
__int64 v11; // r13
int v13; // eax
__int64 v14; // rax
char *v15; // rbp
__int64 v16; // rsi
char *v17; // rdi
__int64 v18; // rdx
__int64 v19; // rcx
__int64 v20; // r8
__int64 v21; // r9
char v22; // al
socklen_t addr_len; // [rsp+1Ch] [rbp-ACh] BYREF
struct sockaddr addr; // [rsp+20h] [rbp-A8h] BYREF
char buf[80]; // [rsp+30h] [rbp-98h] BYREF
int v28; // [rsp+80h] [rbp-48h]

memset(buf, 0, sizeof(buf));
addr = 0LL;
addr_len = 16;
v28 = 0;
v10 = recvfrom(fd, buf, 0x54uLL, 0, &addr, &addr_len);
v11 = v10;
if ( v10 > 0 )
{
if ( diminuto_ping4_debug )
func2((__int64)stderr, (__int64)buf, v10);
diminuto_ipc4_identify(&addr, a2, 0LL, 0.0);
if ( v11 > 27 )
{
v14 = (4 * buf[0]) & 0x3C;
v15 = &buf[v14];
v16 = v11 - v14;
v17 = &buf[v14];
if ( !(unsigned __int16)func3((unsigned __int8 *)&buf[v14], v11 - v14) )
{
v22 = *v15;
if ( a3 )
*a3 = v22;
if ( a4 )
{
v18 = (unsigned __int8)v15[1];
*a4 = v18;
}
if ( !v22 )
{
if ( a5 )
*a5 = *((_WORD *)v15 + 2);
if ( a6 )
*a6 = *((_WORD *)v15 + 3);
if ( a7 )
*(_BYTE *)a7 = buf[8];
if ( v11 > 83 )
{
if ( a8 )
*(_QWORD *)a8 = diminuto_time_clock(v17, v16, v18, v19, v20, v21, a5, a6) - *((_QWORD *)v15 + 1);
v11 -= 20LL;
return v11;
}
}
}
}
return 0LL;
}
if ( !v10 )
return 0LL;
v13 = *_errno_location();
if ( v13 != 4 && v13 != 11 )
diminuto_log_perror("src/diminuto_ping4.c", 189LL, "diminuto_ping4_datagram_recv: recvfrom");
return v11;
}

original_code:
ssize_t diminuto_ping4_datagram_receive(int fd, diminuto_ipv4_t * addressp, uint8_t * typep, uint8_t * codep, uint16_t * idp, uint16_t * seqp, uint8_t * ttlp, diminuto_ticks_t * elapsedp)
{
    ssize_t total;
    icmp_echo_reply_datagram_t buffer = { 0 };
    struct sockaddr_in sa = { 0 };
    socklen_t length = sizeof(sa);
    struct iphdr * ipp;
    struct icmp * icmpp;
    diminuto_ticks_t now;
    diminuto_ticks_t then;
    if ((total = recvfrom(fd, &buffer, sizeof(buffer), 0, (struct sockaddr *)&sa, &length)) > 0) {
        if (diminuto_ping4_debug) { diminuto_dump(stderr, &buffer, total); }
        diminuto_ipc4_identify((struct sockaddr *)&sa, addressp, (diminuto_port_t *)0);
        if (total < (sizeof(struct iphdr) + 8)) {
            total = 0;
        } else {
            ipp = (struct iphdr *)(&buffer);
            icmpp = (struct icmp *)((&(buffer.payload[0])) + (ipp->ihl << 2));
            if (diminuto_inet_checksum(icmpp, total - ((char *)icmpp - (char *)ipp)) != 0) {
                total = 0;
            } else {
                if (typep != (uint8_t *)0) {
                    *typep = icmpp->icmp_type;
                }
                if (codep != (uint8_t *)0) {
                    *codep = icmpp->icmp_code;
                }
                if (icmpp->icmp_type != 0) {
                    total = 0;
                } else {
                    if (idp != (uint16_t *)0) {
                        *idp = icmpp->icmp_hun.ih_idseq.icd_id;
                    }
                    if (seqp != (uint16_t *)0) {
                        *seqp = icmpp->icmp_hun.ih_idseq.icd_seq;
                    }
                    if (ttlp != (uint8_t *)0) {
                        *ttlp = ipp->ttl;
                    }
                    if (total < sizeof(buffer)) {
                        total = 0;
                    } else {
                        if (elapsedp != (diminuto_ticks_t *)0) {
                            now = diminuto_time_clock();
                            memcpy(&then, icmpp->icmp_dun.id_data, sizeof(diminuto_ticks_t));
                            *elapsedp = now - then;
                        }
                        total -= sizeof(struct iphdr);
                    }
                }
            }
        }
    } else if (total == 0) {
    } else if (((*__errno_location ()) != 4) && ((*__errno_location ()) != 11) && ((*__errno_location ()) != 11)) {
        diminuto_log_perror("src/diminuto_ping4.c", 189, "diminuto_ping4_datagram_recv: recvfrom");
    } else {
    }
    return total;
}

canonical_original_code:
long diminuto_ping4_datagram_receive(int fd, unsigned int *addressp, unsigned char *typep, unsigned char *codep, unsigned short *idp, unsigned short *seqp, unsigned char *ttlp, unsigned long *elapsedp)
{
    long total;
    union icmp_echo_reply_datagram_t buffer = { 0 };
    struct sockaddr_in sa = { 0 };
    unsigned int length = sizeof(sa);
    struct iphdr *ipp;
    struct icmp *icmpp;
    unsigned long now;
    unsigned long then;
    if ((total = recvfrom(fd, &buffer, sizeof(buffer), 0, (struct sockaddr *)&sa, &length)) > 0) {
        if (diminuto_ping4_debug) { diminuto_dump(stderr, &buffer, total); }
        diminuto_ipc4_identify((struct sockaddr *)&sa, addressp, (unsigned short *)0);
        if (total < (sizeof(struct iphdr) + 8)) {
            total = 0;
        } else {
            ipp = (struct iphdr *)(&buffer);
            icmpp = (struct icmp *)((&(buffer.payload[0])) + (ipp->ihl << 2));
            if (diminuto_inet_checksum(icmpp, total - ((char *)icmpp - (char *)ipp)) != 0) {
                total = 0;
            } else {
                if (typep != (unsigned char *)0) {
                    *typep = icmpp->icmp_type;
                }
                if (codep != (unsigned char *)0) {
                    *codep = icmpp->icmp_code;
                }
                if (icmpp->icmp_type != 0) {
                    total = 0;
                } else {
                    if (idp != (unsigned short *)0) {
                        *idp = icmpp->icmp_hun.ih_idseq.icd_id;
                    }
                    if (seqp != (unsigned short *)0) {
                        *seqp = icmpp->icmp_hun.ih_idseq.icd_seq;
                    }
                    if (ttlp != (unsigned char *)0) {
                        *ttlp = ipp->ttl;
                    }
                    if (total < sizeof(buffer)) {
                        total = 0;
                    } else {
                        if (elapsedp != (unsigned long *)0) {
                            now = diminuto_time_clock();
                            memcpy(&then, icmpp->icmp_dun.id_data, sizeof(diminuto_ticks_t));
                            *elapsedp = now - then;
                        }
                        total -= sizeof(struct iphdr);
                    }
                }
            }
        }
    } else if (total == 0) {
    } else if (((*__errno_location ()) != 4) && ((*__errno_location ()) != 11) && ((*__errno_location ()) != 11)) {
        diminuto_log_perror("src/diminuto_ping4.c", 189, "diminuto_ping4_datagram_recv: recvfrom");
    } else {
    }
    return total;
}

variable_types:
addressp
unsigned int *

variable_types:
typep
unsigned char *

variable_types:
codep
unsigned char *

variable_types:
idp
unsigned short *

variable_types:
seqp
unsigned short *

variable_types:
ttlp
unsigned char *

variable_types:
elapsedp
unsigned long *

variable_types: union icmp_echo_reply_datagram_t { struct { struct iphdr { unsigned int ihl; unsigned int version; unsigned char tos; unsigned short tot_len; unsigned short id; unsigned short frag_off; unsigned char ttl; unsigned char protocol; unsigned short check; unsigned int saddr; unsigned int daddr; } ip; struct icmp { unsigned char icmp_type; unsigned char icmp_code; unsigned short icmp_cksum; union { unsigned char ih_pptr; struct in_addr { unsigned int s_addr; } ih_gwaddr; struct ih_idseq { unsigned short icd_id; unsigned short icd_seq; } ih_idseq; unsigned int ih_void; struct ih_pmtu { unsigned short ipm_void; unsigned short ipm_nextmtu; } ih_pmtu; struct ih_rtradv { unsigned char irt_num_addrs; unsigned char irt_wpa; unsigned short irt_lifetime; } ih_rtradv; } icmp_hun; union { struct { unsigned int its_otime; unsigned int its_rtime; unsigned int its_ttime; } id_ts; struct { struct ip { unsigned int ip_hl; unsigned int ip_v; unsigned char ip_tos; unsigned short ip_len; unsigned short ip_id; unsigned short ip_off; unsigned char ip_ttl; unsigned char ip_p; unsigned short ip_sum; struct in_addr ip_src; } idi_ip; } id_ip; struct icmp_ra_addr { unsigned int ira_addr; unsigned int ira_preference; } id_radv; unsigned int id_mask; unsigned char id_data[1]; } icmp_dun; } icmp; } header; char payload[-1]; }

variable_types:
length
unsigned int

variable_types: struct iphdr { unsigned int ihl; unsigned int version; unsigned char tos; unsigned short tot_len; unsigned short id; unsigned short frag_off; unsigned char ttl; unsigned char protocol; unsigned short check; unsigned int saddr; unsigned int daddr; } *

variable_types:
then
unsigned long

user_defined_types: union icmp_echo_reply_datagram_t { struct { struct iphdr ip; struct icmp icmp; } header; char payload[-1]; }


decompiled_code:
__int64 __fastcall diminuto_atomic_apply(__int64 a1, __int64 (__fastcall *a2)(__int64, __int64), __int64 a3, __int64 a4)
{
__int64 v4; // r12
__pthread_unwind_buf_t buf; // [rsp+30h] [rbp-88h] BYREF

if ( (unsigned int)diminuto_criticalsection_lock() )
return -1LL;
if ( _sigsetjmp((struct __jmp_buf_tag *)&buf, 0) )
{
((void (__fastcall *)(__int64))diminuto_criticalsection_cleanup)(a1);
_pthread_unwind_next(&buf);
}
_pthread_register_cancel(&buf);
v4 = a2(a3, a4);
_pthread_unregister_cancel(&buf);
((void (__fastcall *)(__int64))diminuto_criticalsection_cleanup)(a1);
return v4;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, __int64 (__fastcall *a2)(__int64, __int64), __int64 a3, __int64 a4)
{
__int64 v4; // r12
__pthread_unwind_buf_t buf; // [rsp+30h] [rbp-88h] BYREF

if ( (unsigned int)diminuto_criticalsection_lock() )
return -1LL;
if ( _sigsetjmp((struct __jmp_buf_tag *)&buf, 0) )
{
((void (__fastcall *)(__int64))diminuto_criticalsection_cleanup)(a1);
_pthread_unwind_next(&buf);
}
_pthread_register_cancel(&buf);
v4 = a2(a3, a4);
_pthread_unregister_cancel(&buf);
((void (__fastcall *)(__int64))diminuto_criticalsection_cleanup)(a1);
return v4;
}

original_code:
void * diminuto_atomic_apply(pthread_mutex_t * mutexp, diminuto_atomic_functor_t * functorp, void * sharedp, void * contextp)
{
 void * resultp = (void *)DIMINUTO_ATOMIC_ERROR;
 do { pthread_mutex_t * _diminuto_criticalsection_mp; _diminuto_criticalsection_mp = (mutexp); if (diminuto_criticalsection_lock(_diminuto_criticalsection_mp) == 0) { do { __pthread_unwind_buf_t __cancel_buf; void (*__cancel_routine) (void *) = (diminuto_criticalsection_cleanup); void *__cancel_arg = (_diminuto_criticalsection_mp); int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) __cancel_buf.__cancel_jmp_buf, 0); if (__builtin_expect ((__not_first_call), 0)) { __cancel_routine (__cancel_arg); __pthread_unwind_next (&__cancel_buf); } __pthread_register_cancel (&__cancel_buf); do {; do { ((void)0);
  resultp = (*functorp)(sharedp, contextp);
 } while (0); do { } while (0); } while (0); __pthread_unregister_cancel (&__cancel_buf); if (!0) __cancel_routine (__cancel_arg); } while (0); } } while (0);
 return resultp;
}

canonical_original_code:
void *diminuto_atomic_apply(union pthread_mutex_t *mutexp, void *(*functorp)(void *sharedp, void *contextp), void *sharedp, void *contextp)
{
 void *resultp = (void *)DIMINUTO_ATOMIC_ERROR;
 do { union pthread_mutex_t *_diminuto_criticalsection_mp; _diminuto_criticalsection_mp = (mutexp); if (diminuto_criticalsection_lock(_diminuto_criticalsection_mp) == 0) { do { struct __pthread_unwind_buf_t __cancel_buf; void (*__cancel_routine)(void *) = (diminuto_criticalsection_cleanup); void *__cancel_arg = (_diminuto_criticalsection_mp); int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) __cancel_buf.__cancel_jmp_buf, 0); if (__builtin_expect ((__not_first_call), 0)) { __cancel_routine (__cancel_arg); __pthread_unwind_next (&__cancel_buf); } __pthread_register_cancel (&__cancel_buf); do {; do { ((void)0);
  resultp = (*functorp)(sharedp, contextp);
 } while (0); do { } while (0); } while (0); __pthread_unregister_cancel (&__cancel_buf); if (!0) __cancel_routine (__cancel_arg); } while (0); } } while (0);
 return resultp;
}

variable_types: union pthread_mutex_t { struct __pthread_mutex_s { int __lock; unsigned int __count; int __owner; unsigned int __nusers; int __kind; short __spins; short __elision; struct __pthread_internal_list { struct __pthread_internal_list *__prev; struct __pthread_internal_list *__next; } __list; } __data; char __size[40]; long __align; } *

variable_types: void *(*)(void *sharedp, void *contextp)

variable_types:
sharedp
void *

variable_types:
contextp
void *

variable_types:
resultp
void *

variable_types: struct __pthread_unwind_buf_t { struct { long __cancel_jmp_buf[8]; int __mask_was_saved; } __cancel_jmp_buf[1]; void *__pad[4]; }

user_defined_types: union pthread_mutex_t { struct __pthread_mutex_s __data; char __size[40]; long __align; }

user_defined_types: struct __pthread_mutex_s { int __lock; unsigned int __count; int __owner; unsigned int __nusers; int __kind; short __spins; short __elision; struct __pthread_internal_list __list; }


decompiled_code:
void *__fastcall diminuto_module_load_generic(const char *a1, char a2)
{
void *v2; // r12
char *v4; // rax

v2 = dlopen(a1, a2);
if ( !v2 && (a2 & 4) == 0 && (diminuto_log_mask & 0x10) != 0 )
{
v4 = dlerror();
diminuto_log_log(3LL, "src/diminuto_module.c@34: diminuto_module_load_generic: dlopen: %s\n", v4);
}
return v2;
}

canonical_decompiled_code:
void *__fastcall func0(const char *a1, char a2)
{
void *v2; // r12
char *v4; // rax

v2 = dlopen(a1, a2);
if ( !v2 && (a2 & 4) == 0 && (diminuto_log_mask & 0x10) != 0 )
{
v4 = dlerror();
diminuto_log_log(3LL, "src/diminuto_module.c@34: diminuto_module_load_generic: dlopen: %s\n", v4);
}
return v2;
}

original_code:
diminuto_module_handle_t diminuto_module_load_generic(const char * filename, int flags)
{
    diminuto_module_handle_t handle;
    if ((handle = dlopen(filename, flags)) != (diminuto_module_handle_t)0) {
    } else if ((flags & 0x00004) == 0x00004) {
    } else {
        ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "src/diminuto_module.c" "@" "34" ": " "diminuto_module_load_generic: dlopen: %s\n", dlerror()) : ((void)0));
    }
    return handle;
}

canonical_original_code:
void *diminuto_module_load_generic(char *filename, int flags)
{
    void *handle;
    if ((handle = dlopen(filename, flags)) != (void *)0) {
    } else if ((flags & 0x00004) == 0x00004) {
    } else {
        ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "src/diminuto_module.c" "@" "34" ": " "diminuto_module_load_generic: dlopen: %s\n", dlerror()) : ((void)0));
    }
    return handle;
}

variable_types:
filename
char *

variable_types: flags int

variable_types:
handle
void *


decompiled_code:
void *__fastcall diminuto_module_handle(const char *a1)
{
return diminuto_module_load_generic(a1, 4);
}

canonical_decompiled_code:
void *__fastcall func1(const char *a1)
{
return func0(a1, 4);
}

original_code:
diminuto_module_handle_t diminuto_module_handle(const char * filename)
{
    return diminuto_module_load_generic(filename, 0x00004);
}

canonical_original_code:
void *diminuto_module_handle(char *filename)
{
    return diminuto_module_load_generic(filename, 0x00004);
}


decompiled_code:
void *__fastcall diminuto_module_load(const char *a1)
{
return diminuto_module_load_generic(a1, 9);
}

canonical_decompiled_code:
void *__fastcall func2(const char *a1)
{
return func0(a1, 9);
}

original_code:
diminuto_module_handle_t diminuto_module_load(const char * filename)
{
    return diminuto_module_load_generic(filename, 0x00001 | 0x00100 | 0x00008);
}

canonical_original_code:
void *diminuto_module_load(char *filename)
{
    return diminuto_module_load_generic(filename, 0x00001 | 0x00100 | 0x00008);
}


decompiled_code:
void *__fastcall diminuto_module_symbol(void *a1, const char *a2, const char *a3)
{
const char *v3; // r13
void *v4; // r12
char *v6; // rax

if ( a3 )
{
v3 = "dlvsym";
v4 = dlvsym(a1, a2, a3);
if ( v4 )
return v4;
}
else
{
v3 = "dlsym";
v4 = dlsym(a1, a2);
if ( v4 )
return v4;
}
if ( (diminuto_log_mask & 0x10) != 0 )
{
v6 = dlerror();
diminuto_log_log(3LL, "src/diminuto_module.c@95: diminuto_module_symbol: %s: %s", v3, v6);
}
return v4;
}

canonical_decompiled_code:
void *__fastcall func3(void *a1, const char *a2, const char *a3)
{
const char *v3; // r13
void *v4; // r12
char *v6; // rax

if ( a3 )
{
v3 = "dlvsym";
v4 = dlvsym(a1, a2, a3);
if ( v4 )
return v4;
}
else
{
v3 = "dlsym";
v4 = dlsym(a1, a2);
if ( v4 )
return v4;
}
if ( (diminuto_log_mask & 0x10) != 0 )
{
v6 = dlerror();
diminuto_log_log(3LL, "src/diminuto_module.c@95: diminuto_module_symbol: %s: %s", v3, v6);
}
return v4;
}

original_code:
void * diminuto_module_symbol(diminuto_module_handle_t handle, const char * symbol, const char * version)
{
    void * resolved;
    const char * label;
    if (version == (const char *)0) {
        label = "dlsym";
        resolved = dlsym(handle, symbol);
    } else {
        label = "dlvsym";
        resolved = dlvsym(handle, symbol, version);
    }
    if (resolved == (void *)0) {
        ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "src/diminuto_module.c" "@" "95" ": " "diminuto_module_symbol: %s: %s", label, dlerror()) : ((void)0));
    }
    return resolved;
}

canonical_original_code:
void *diminuto_module_symbol(void *handle, char *symbol, char *version)
{
    void *resolved;
    char *label;
    if (version == (char *)0) {
        label = "dlsym";
        resolved = dlsym(handle, symbol);
    } else {
        label = "dlvsym";
        resolved = dlvsym(handle, symbol, version);
    }
    if (resolved == (void *)0) {
        ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "src/diminuto_module.c" "@" "95" ": " "diminuto_module_symbol: %s: %s", label, dlerror()) : ((void)0));
    }
    return resolved;
}

variable_types:
symbol
char *

variable_types:
version
char *

variable_types:
resolved
void *

variable_types:
label
char *


decompiled_code:
void *__fastcall diminuto_module_unload(void *handle, int a2)
{
void *v2; // r12
char *v4; // rax

while ( !dlclose(handle) )
{
if ( !a2 )
return 0LL;
}
if ( a2 )
return 0LL;
v2 = handle;
if ( (diminuto_log_mask & 0x10) == 0 )
return v2;
v4 = dlerror();
diminuto_log_log(3LL, "src/diminuto_module.c@133: diminuto_module_unload: dlclose: %s\n", v4);
return handle;
}

canonical_decompiled_code:
void *__fastcall func4(void *handle, int a2)
{
void *v2; // r12
char *v4; // rax

while ( !dlclose(handle) )
{
if ( !a2 )
return 0LL;
}
if ( a2 )
return 0LL;
v2 = handle;
if ( (diminuto_log_mask & 0x10) == 0 )
return v2;
v4 = dlerror();
diminuto_log_log(3LL, "src/diminuto_module.c@133: diminuto_module_unload: dlclose: %s\n", v4);
return handle;
}

original_code:
diminuto_module_handle_t diminuto_module_unload(diminuto_module_handle_t handle, int force)
{
    int rc;
    do {
        rc = dlclose(handle);
    } while (force && (rc == 0));
    if (force) {
        handle = (diminuto_module_handle_t)0;
    } else if (rc == 0) {
        handle = (diminuto_module_handle_t)0;
    } else {
        ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "src/diminuto_module.c" "@" "133" ": " "diminuto_module_unload: dlclose: %s\n", dlerror()) : ((void)0));
    }
    return handle;
}

canonical_original_code:
void *diminuto_module_unload(void *handle, int force)
{
    int rc;
    do {
        rc = dlclose(handle);
    } while (force && (rc == 0));
    if (force) {
        handle = (void *)0;
    } else if (rc == 0) {
        handle = (void *)0;
    } else {
        ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "src/diminuto_module.c" "@" "133" ": " "diminuto_module_unload: dlclose: %s\n", dlerror()) : ((void)0));
    }
    return handle;
}

variable_types: force int

variable_types: rc int


decompiled_code:
const void *__fastcall diminuto_buffer_malloc(__int64 a1)
{
const void *v1; // r12
__pthread_unwind_buf_t buf; // [rsp+10h] [rbp-88h] BYREF

if ( a1 )
{
if ( (unsigned int)diminuto_criticalsection_lock(&mutex) )
{
v1 = 0LL;
}
else
{
if ( _sigsetjmp((struct __jmp_buf_tag *)&buf, 0) )
{
((void (__fastcall *)(void *))diminuto_criticalsection_cleanup)(&mutex);
_pthread_unwind_next(&buf);
}
_pthread_register_cancel(&buf);
v1 = (const void *)diminuto_buffer_pool_get(&meta, a1, (unsigned int)fail);
_pthread_unregister_cancel(&buf);
((void (__fastcall *)(void *))diminuto_criticalsection_cleanup)(&mutex);
}
if ( !debug )
return v1;
}
else
{
v1 = 0LL;
*_errno_location() = 0;
if ( !debug )
return v1;
}
diminuto_log_emit("diminuto_buffer_malloc: size=%zu ptr=%p\n", a1, v1);
return v1;
}

canonical_decompiled_code:
const void *__fastcall func6(__int64 a1)
{
const void *v1; // r12
__pthread_unwind_buf_t buf; // [rsp+10h] [rbp-88h] BYREF

if ( a1 )
{
if ( (unsigned int)diminuto_criticalsection_lock(&mutex) )
{
v1 = 0LL;
}
else
{
if ( _sigsetjmp((struct __jmp_buf_tag *)&buf, 0) )
{
((void (__fastcall *)(void *))diminuto_criticalsection_cleanup)(&mutex);
_pthread_unwind_next(&buf);
}
_pthread_register_cancel(&buf);
v1 = (const void *)diminuto_buffer_pool_get(&meta, a1, (unsigned int)fail);
_pthread_unregister_cancel(&buf);
((void (__fastcall *)(void *))diminuto_criticalsection_cleanup)(&mutex);
}
if ( !debug )
return v1;
}
else
{
v1 = 0LL;
*_errno_location() = 0;
if ( !debug )
return v1;
}
diminuto_log_emit("diminuto_buffer_malloc: size=%zu ptr=%p\n", a1, v1);
return v1;
}

original_code:
void * diminuto_buffer_malloc(size_t size)
{
    void * ptr = (void *)0;
    if (size > 0) {
        do { pthread_mutex_t * _diminuto_criticalsection_mp; _diminuto_criticalsection_mp = (&mutex); if (diminuto_criticalsection_lock(_diminuto_criticalsection_mp) == 0) { do { __pthread_unwind_buf_t __cancel_buf; void (*__cancel_routine) (void *) = (diminuto_criticalsection_cleanup); void *__cancel_arg = (_diminuto_criticalsection_mp); int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) __cancel_buf.__cancel_jmp_buf, 0); if (__builtin_expect ((__not_first_call), 0)) { __cancel_routine (__cancel_arg); __pthread_unwind_next (&__cancel_buf); } __pthread_register_cancel (&__cancel_buf); do {; do { ((void)0);
            ptr = diminuto_buffer_pool_get((diminuto_buffer_pool_t *)&meta, size, fail);
        } while (0); do { } while (0); } while (0); __pthread_unregister_cancel (&__cancel_buf); if (!0) __cancel_routine (__cancel_arg); } while (0); } } while (0);
    } else {
        (*__errno_location ()) = 0;
    }
    if (debug) {
        diminuto_log_emit("diminuto_buffer_malloc: size=%zu ptr=%p\n", size, ptr);
    }
    return ptr;
}

canonical_original_code:
void *diminuto_buffer_malloc(unsigned long size)
{
    void *ptr = (void *)0;
    if (size > 0) {
        do { union pthread_mutex_t *_diminuto_criticalsection_mp; _diminuto_criticalsection_mp = (&mutex); if (diminuto_criticalsection_lock(_diminuto_criticalsection_mp) == 0) { do { struct __pthread_unwind_buf_t __cancel_buf; void (*__cancel_routine)(void *) = (diminuto_criticalsection_cleanup); void *__cancel_arg = (_diminuto_criticalsection_mp); int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) __cancel_buf.__cancel_jmp_buf, 0); if (__builtin_expect ((__not_first_call), 0)) { __cancel_routine (__cancel_arg); __pthread_unwind_next (&__cancel_buf); } __pthread_register_cancel (&__cancel_buf); do {; do { ((void)0);
            ptr = diminuto_buffer_pool_get((struct DiminutoBufferPool *)&meta, size, fail);
        } while (0); do { } while (0); } while (0); __pthread_unregister_cancel (&__cancel_buf); if (!0) __cancel_routine (__cancel_arg); } while (0); } } while (0);
    } else {
        (*__errno_location ()) = 0;
    }
    if (debug) {
        diminuto_log_emit("diminuto_buffer_malloc: size=%zu ptr=%p\n", size, ptr);
    }
    return ptr;
}

variable_types:
size
unsigned long

variable_types:
ptr
void *

user_defined_types: struct __pthread_unwind_buf_t { struct { long __cancel_jmp_buf[8]; int __mask_was_saved; } __cancel_jmp_buf[1]; void *__pad[4]; }

user_defined_types: struct DiminutoBufferPool { unsigned long count; unsigned long *sizes; void **pool; }

user_defined_types: struct __pthread_internal_list { struct __pthread_internal_list *__prev; struct __pthread_internal_list *__next; }


decompiled_code:
__int64 __fastcall diminuto_buffer_free(const void *a1)
{
__int64 result; // rax
__pthread_unwind_buf_t buf; // [rsp+10h] [rbp-78h] BYREF

result = (unsigned int)debug;
if ( debug )
result = diminuto_log_emit("diminuto_buffer_free: ptr=%p\n", a1);
if ( a1 )
{
result = diminuto_criticalsection_lock(&mutex);
if ( !(_DWORD)result )
{
if ( _sigsetjmp((struct __jmp_buf_tag *)&buf, 0) )
{
((void (__fastcall *)(void *))diminuto_criticalsection_cleanup)(&mutex);
_pthread_unwind_next(&buf);
}
_pthread_register_cancel(&buf);
diminuto_buffer_pool_put(&meta, a1);
_pthread_unregister_cancel(&buf);
result = ((__int64 (__fastcall *)(void *))diminuto_criticalsection_cleanup)(&mutex);
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func7(const void *a1)
{
__int64 result; // rax
__pthread_unwind_buf_t buf; // [rsp+10h] [rbp-78h] BYREF

result = (unsigned int)debug;
if ( debug )
result = diminuto_log_emit("diminuto_buffer_free: ptr=%p\n", a1);
if ( a1 )
{
result = diminuto_criticalsection_lock(&mutex);
if ( !(_DWORD)result )
{
if ( _sigsetjmp((struct __jmp_buf_tag *)&buf, 0) )
{
((void (__fastcall *)(void *))diminuto_criticalsection_cleanup)(&mutex);
_pthread_unwind_next(&buf);
}
_pthread_register_cancel(&buf);
diminuto_buffer_pool_put(&meta, a1);
_pthread_unregister_cancel(&buf);
result = ((__int64 (__fastcall *)(void *))diminuto_criticalsection_cleanup)(&mutex);
}
}
return result;
}

original_code:
void diminuto_buffer_free(void * ptr)
{
    if (debug) {
        diminuto_log_emit("diminuto_buffer_free: ptr=%p\n", ptr);
    }
    if (ptr != (void *)0) {
        do { pthread_mutex_t * _diminuto_criticalsection_mp; _diminuto_criticalsection_mp = (&mutex); if (diminuto_criticalsection_lock(_diminuto_criticalsection_mp) == 0) { do { __pthread_unwind_buf_t __cancel_buf; void (*__cancel_routine) (void *) = (diminuto_criticalsection_cleanup); void *__cancel_arg = (_diminuto_criticalsection_mp); int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) __cancel_buf.__cancel_jmp_buf, 0); if (__builtin_expect ((__not_first_call), 0)) { __cancel_routine (__cancel_arg); __pthread_unwind_next (&__cancel_buf); } __pthread_register_cancel (&__cancel_buf); do {; do { ((void)0);
            diminuto_buffer_pool_put((diminuto_buffer_pool_t *)&meta, ptr);
        } while (0); do { } while (0); } while (0); __pthread_unregister_cancel (&__cancel_buf); if (!0) __cancel_routine (__cancel_arg); } while (0); } } while (0);
    }
}

canonical_original_code:
void diminuto_buffer_free(void *ptr)
{
    if (debug) {
        diminuto_log_emit("diminuto_buffer_free: ptr=%p\n", ptr);
    }
    if (ptr != (void *)0) {
        do { union pthread_mutex_t *_diminuto_criticalsection_mp; _diminuto_criticalsection_mp = (&mutex); if (diminuto_criticalsection_lock(_diminuto_criticalsection_mp) == 0) { do { struct __pthread_unwind_buf_t __cancel_buf; void (*__cancel_routine)(void *) = (diminuto_criticalsection_cleanup); void *__cancel_arg = (_diminuto_criticalsection_mp); int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) __cancel_buf.__cancel_jmp_buf, 0); if (__builtin_expect ((__not_first_call), 0)) { __cancel_routine (__cancel_arg); __pthread_unwind_next (&__cancel_buf); } __pthread_register_cancel (&__cancel_buf); do {; do { ((void)0);
            diminuto_buffer_pool_put((struct DiminutoBufferPool *)&meta, ptr);
        } while (0); do { } while (0); } while (0); __pthread_unregister_cancel (&__cancel_buf); if (!0) __cancel_routine (__cancel_arg); } while (0); } } while (0);
    }
}

variable_types: union pthread_mutex_t { struct __pthread_mutex_s { int __lock; unsigned int __count; int __owner; unsigned int __nusers; int __kind; short __spins; short __elision; struct __pthread_internal_list { struct __pthread_internal_list *__prev; struct __pthread_internal_list *__next; } __list; } __data; char __size[40]; long __align; } *

return_type: void


decompiled_code:
const void *__fastcall diminuto_buffer_realloc(const void *a1, unsigned __int64 a2)
{
const void *v2; // r12
__int64 v4; // rbx
void *v5; // rax
size_t v6; // rdx
__int64 v7; // [rsp+28h] [rbp-A0h] BYREF
__pthread_unwind_buf_t buf; // [rsp+30h] [rbp-98h] BYREF

if ( !a1 )
{
v2 = diminuto_buffer_malloc(a2);
goto LABEL_4;
}
if ( !a2 )
{
v2 = 0LL;
diminuto_buffer_free(a1);
*_errno_location() = 0;
goto LABEL_4;
}
v7 = 0LL;
if ( (unsigned int)diminuto_criticalsection_lock(&mutex) )
{
v2 = a1;
goto LABEL_4;
}
if ( _sigsetjmp((struct __jmp_buf_tag *)&buf, 0) )
{
((void (__fastcall *)(void *))diminuto_criticalsection_cleanup)(&mutex);
_pthread_unwind_next(&buf);
}
_pthread_register_cancel(&buf);
v4 = buffer_pool_effective_constprop_0(*((_QWORD *)a1 - 1));
buffer_pool_hash_constprop_0(a2, &v7);
_pthread_unregister_cancel(&buf);
((void (__fastcall *)(void *))diminuto_criticalsection_cleanup)(&mutex);
v2 = a1;
if ( v7 == v4 )
{
LABEL_4:
if ( !debug )
return v2;
LABEL_14:
diminuto_log_emit("diminuto_buffer_realloc: ptr=%p size=%zu pointer=%p\n", a1, a2, v2);
return v2;
}
v5 = (void *)diminuto_buffer_malloc(a2);
v2 = v5;
if ( v5 )
{
v6 = v4 - 8;
if ( v4 - 8 > a2 )
v6 = a2;
memcpy(v5, a1, v6);
}
diminuto_buffer_free(a1);
if ( debug )
goto LABEL_14;
return v2;
}

canonical_decompiled_code:
const void *__fastcall func8(const void *a1, unsigned __int64 a2)
{
const void *v2; // r12
__int64 v4; // rbx
void *v5; // rax
size_t v6; // rdx
__int64 v7; // [rsp+28h] [rbp-A0h] BYREF
__pthread_unwind_buf_t buf; // [rsp+30h] [rbp-98h] BYREF

if ( !a1 )
{
v2 = func6(a2);
goto LABEL_4;
}
if ( !a2 )
{
v2 = 0LL;
func7(a1);
*_errno_location() = 0;
goto LABEL_4;
}
v7 = 0LL;
if ( (unsigned int)diminuto_criticalsection_lock(&mutex) )
{
v2 = a1;
goto LABEL_4;
}
if ( _sigsetjmp((struct __jmp_buf_tag *)&buf, 0) )
{
((void (__fastcall *)(void *))diminuto_criticalsection_cleanup)(&mutex);
_pthread_unwind_next(&buf);
}
_pthread_register_cancel(&buf);
v4 = func3(*((_QWORD *)a1 - 1));
func4(a2, &v7);
_pthread_unregister_cancel(&buf);
((void (__fastcall *)(void *))diminuto_criticalsection_cleanup)(&mutex);
v2 = a1;
if ( v7 == v4 )
{
LABEL_4:
if ( !debug )
return v2;
LABEL_14:
diminuto_log_emit("diminuto_buffer_realloc: ptr=%p size=%zu pointer=%p\n", a1, a2, v2);
return v2;
}
v5 = (void *)func6(a2);
v2 = v5;
if ( v5 )
{
v6 = v4 - 8;
if ( v4 - 8 > a2 )
v6 = a2;
memcpy(v5, a1, v6);
}
func7(a1);
if ( debug )
goto LABEL_14;
return v2;
}

original_code:
void * diminuto_buffer_realloc(void * ptr, size_t size)
{
    void * ptrprime = (void *)0;
    if (ptr == (void *)0) {
        ptrprime = diminuto_buffer_malloc(size);
    } else if (size == 0) {
        diminuto_buffer_free(ptr);
        (*__errno_location ()) = 0;
        ptrprime = (void *)0;
    } else {
        diminuto_buffer_t * buffer = (diminuto_buffer_t *)0;
        size_t actual = 0;
        size_t requested = 0;
        buffer = ((diminuto_buffer_t *)(((char *)(ptr)) - ((size_t)(((char *)&(((diminuto_buffer_t *)0)->payload)) - ((char *)((diminuto_buffer_t *)0))))));
        do { pthread_mutex_t * _diminuto_criticalsection_mp; _diminuto_criticalsection_mp = (&mutex); if (diminuto_criticalsection_lock(_diminuto_criticalsection_mp) == 0) { do { __pthread_unwind_buf_t __cancel_buf; void (*__cancel_routine) (void *) = (diminuto_criticalsection_cleanup); void *__cancel_arg = (_diminuto_criticalsection_mp); int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) __cancel_buf.__cancel_jmp_buf, 0); if (__builtin_expect ((__not_first_call), 0)) { __cancel_routine (__cancel_arg); __pthread_unwind_next (&__cancel_buf); } __pthread_register_cancel (&__cancel_buf); do {; do { ((void)0);
            actual = buffer_pool_effective(&meta, buffer->header.item);
            (void)buffer_pool_hash(&meta, size, &requested);
        } while (0); do { } while (0); } while (0); __pthread_unregister_cancel (&__cancel_buf); if (!0) __cancel_routine (__cancel_arg); } while (0); } } while (0);
        if (actual == requested) {
            ptrprime = ptr;
        } else {
            ptrprime = diminuto_buffer_malloc(size);
            if (ptrprime != (void *)0) {
                size_t length;
                length = actual - sizeof(diminuto_buffer_t);
                memcpy(ptrprime, ptr, size < length ? size : length);
            }
            diminuto_buffer_free(ptr);
        }
    }
    if (debug) {
        diminuto_log_emit("diminuto_buffer_realloc: ptr=%p size=%zu pointer=%p\n", ptr, size, ptrprime);
    }
    return ptrprime;
}

canonical_original_code:
void *diminuto_buffer_realloc(void *ptr, unsigned long size)
{
    void *ptrprime = (void *)0;
    if (ptr == (void *)0) {
        ptrprime = diminuto_buffer_malloc(size);
    } else if (size == 0) {
        diminuto_buffer_free(ptr);
        (*__errno_location ()) = 0;
        ptrprime = (void *)0;
    } else {
        struct DiminutoBuffer *buffer = (diminuto_buffer_t *)0;
        unsigned long actual = 0;
        unsigned long requested = 0;
        buffer = ((struct DiminutoBuffer *)(((char *)(ptr)) - ((unsigned long)(((char *)&(((struct DiminutoBuffer *)0)->payload)) - ((char *)((struct DiminutoBuffer *)0))))));
        do { union pthread_mutex_t *_diminuto_criticalsection_mp; _diminuto_criticalsection_mp = (&mutex); if (diminuto_criticalsection_lock(_diminuto_criticalsection_mp) == 0) { do { struct __pthread_unwind_buf_t __cancel_buf; void (*__cancel_routine)(void *) = (diminuto_criticalsection_cleanup); void *__cancel_arg = (_diminuto_criticalsection_mp); int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) __cancel_buf.__cancel_jmp_buf, 0); if (__builtin_expect ((__not_first_call), 0)) { __cancel_routine (__cancel_arg); __pthread_unwind_next (&__cancel_buf); } __pthread_register_cancel (&__cancel_buf); do {; do { ((void)0);
            actual = buffer_pool_effective(&meta, buffer->header.item);
            (void)buffer_pool_hash(&meta, size, &requested);
        } while (0); do { } while (0); } while (0); __pthread_unregister_cancel (&__cancel_buf); if (!0) __cancel_routine (__cancel_arg); } while (0); } } while (0);
        if (actual == requested) {
            ptrprime = ptr;
        } else {
            ptrprime = diminuto_buffer_malloc(size);
            if (ptrprime != (void *)0) {
                unsigned long length;
                length = actual - sizeof(diminuto_buffer_t);
                memcpy(ptrprime, ptr, size < length ? size : length);
            }
            diminuto_buffer_free(ptr);
        }
    }
    if (debug) {
        diminuto_log_emit("diminuto_buffer_realloc: ptr=%p size=%zu pointer=%p\n", ptr, size, ptrprime);
    }
    return ptrprime;
}

variable_types:
ptrprime
void *

variable_types: struct DiminutoBuffer { unsigned long align[]; union { unsigned long item; struct DiminutoBuffer *next; } header; unsigned long payload[]; } *

variable_types:
actual
unsigned long

variable_types:
requested
unsigned long

variable_types:
length
unsigned long


decompiled_code:
const void *__fastcall diminuto_buffer_calloc(__int64 a1, __int64 a2)
{
void *v2; // rax
const void *v3; // r12

v2 = (void *)diminuto_buffer_malloc(a2 * a1);
v3 = v2;
if ( v2 )
memset(v2, 0, a2 * a1);
if ( debug )
diminuto_log_emit("diminuto_buffer_calloc: nmemb=%zu size=%zu ptr=%p\n", a1, a2, v3);
return v3;
}

canonical_decompiled_code:
const void *__fastcall func9(__int64 a1, __int64 a2)
{
void *v2; // rax
const void *v3; // r12

v2 = (void *)func6(a2 * a1);
v3 = v2;
if ( v2 )
memset(v2, 0, a2 * a1);
if ( debug )
diminuto_log_emit("diminuto_buffer_calloc: nmemb=%zu size=%zu ptr=%p\n", a1, a2, v3);
return v3;
}

original_code:
void * diminuto_buffer_calloc(size_t nmemb, size_t size)
{
    void * ptr = (void *)0;
    size_t length = 0;
    length = nmemb * size;
    ptr = diminuto_buffer_malloc(length);
    if (ptr != (void *)0) {
        memset(ptr, 0, length);
    }
    if (debug) {
        diminuto_log_emit("diminuto_buffer_calloc: nmemb=%zu size=%zu ptr=%p\n", nmemb, size, ptr);
    }
    return ptr;
}

canonical_original_code:
void *diminuto_buffer_calloc(unsigned long nmemb, unsigned long size)
{
    void *ptr = (void *)0;
    unsigned long length = 0;
    length = nmemb * size;
    ptr = diminuto_buffer_malloc(length);
    if (ptr != (void *)0) {
        memset(ptr, 0, length);
    }
    if (debug) {
        diminuto_log_emit("diminuto_buffer_calloc: nmemb=%zu size=%zu ptr=%p\n", nmemb, size, ptr);
    }
    return ptr;
}

variable_types:
nmemb
unsigned long


decompiled_code:
char *__fastcall diminuto_buffer_strdup(char *src)
{
size_t v1; // rax
char *v2; // rax
char *v3; // r8

v1 = strlen(src);
v2 = (char *)diminuto_buffer_malloc(v1 + 1);
v3 = v2;
if ( v2 )
v3 = strcpy(v2, src);
return v3;
}

canonical_decompiled_code:
char *__fastcall func10(char *src)
{
size_t v1; // rax
char *v2; // rax
char *v3; // r8

v1 = strlen(src);
v2 = (char *)func6(v1 + 1);
v3 = v2;
if ( v2 )
v3 = strcpy(v2, src);
return v3;
}

original_code:
char * diminuto_buffer_strdup(const char * s)
{
    char * ptr = (char *)0;
    size_t length = 0;
    length = strlen(s);
    ptr = (char *)diminuto_buffer_malloc(length + 1);
    if (ptr != (char *)0) {
        strcpy(ptr, s);
    }
    return ptr;
}

canonical_original_code:
char *diminuto_buffer_strdup(char *s)
{
    char *ptr = (char *)0;
    unsigned long length = 0;
    length = strlen(s);
    ptr = (char *)diminuto_buffer_malloc(length + 1);
    if (ptr != (char *)0) {
        strcpy(ptr, s);
    }
    return ptr;
}

variable_types:
s
char *

variable_types:
ptr
char *

return_type: char *


decompiled_code:
char *__fastcall diminuto_buffer_strndup(char *src, size_t a2)
{
size_t v2; // rbx
char *v3; // rax
char *v4; // r8
char *v5; // rax

v2 = strnlen(src, a2);
v3 = (char *)diminuto_buffer_malloc(v2 + 1);
v4 = v3;
if ( v3 )
{
v5 = strncpy(v3, src, v2);
v5[v2] = 0;
v4 = v5;
}
return v4;
}

canonical_decompiled_code:
char *__fastcall func11(char *src, size_t a2)
{
size_t v2; // rbx
char *v3; // rax
char *v4; // r8
char *v5; // rax

v2 = strnlen(src, a2);
v3 = (char *)func6(v2 + 1);
v4 = v3;
if ( v3 )
{
v5 = strncpy(v3, src, v2);
v5[v2] = 0;
v4 = v5;
}
return v4;
}

original_code:
char * diminuto_buffer_strndup(const char * s, size_t n)
{
    char * ptr = (char *)0;
    size_t length = 0;
    length = strnlen(s, n);
    ptr = (char *)diminuto_buffer_malloc(length + 1);
    if (ptr != (char *)0) {
        strncpy(ptr, s, length);
        ptr[length] = '\0';
    }
    return ptr;
}

canonical_original_code:
char *diminuto_buffer_strndup(char *s, unsigned long n)
{
    char *ptr = (char *)0;
    unsigned long length = 0;
    length = strnlen(s, n);
    ptr = (char *)diminuto_buffer_malloc(length + 1);
    if (ptr != (char *)0) {
        strncpy(ptr, s, length);
        ptr[length] = '\0';
    }
    return ptr;
}

variable_types:
n
unsigned long


decompiled_code:
__int64 diminuto_buffer_fini()
{
__int64 result; // rax
__pthread_unwind_buf_t buf; // [rsp+10h] [rbp-78h] BYREF

result = diminuto_criticalsection_lock(&mutex);
if ( !(_DWORD)result )
{
if ( _sigsetjmp((struct __jmp_buf_tag *)&buf, 0) )
{
((void (__fastcall *)(void *))diminuto_criticalsection_cleanup)(&mutex);
_pthread_unwind_next(&buf);
}
_pthread_register_cancel(&buf);
diminuto_buffer_pool_free(&meta);
_pthread_unregister_cancel(&buf);
result = ((__int64 (__fastcall *)(void *))diminuto_criticalsection_cleanup)(&mutex);
}
return result;
}

canonical_decompiled_code:
__int64 func12()
{
__int64 result; // rax
__pthread_unwind_buf_t buf; // [rsp+10h] [rbp-78h] BYREF

result = diminuto_criticalsection_lock(&mutex);
if ( !(_DWORD)result )
{
if ( _sigsetjmp((struct __jmp_buf_tag *)&buf, 0) )
{
((void (__fastcall *)(void *))diminuto_criticalsection_cleanup)(&mutex);
_pthread_unwind_next(&buf);
}
_pthread_register_cancel(&buf);
diminuto_buffer_pool_free(&meta);
_pthread_unregister_cancel(&buf);
result = ((__int64 (__fastcall *)(void *))diminuto_criticalsection_cleanup)(&mutex);
}
return result;
}

original_code:
void diminuto_buffer_fini(void)
{
    do { pthread_mutex_t * _diminuto_criticalsection_mp; _diminuto_criticalsection_mp = (&mutex); if (diminuto_criticalsection_lock(_diminuto_criticalsection_mp) == 0) { do { __pthread_unwind_buf_t __cancel_buf; void (*__cancel_routine) (void *) = (diminuto_criticalsection_cleanup); void *__cancel_arg = (_diminuto_criticalsection_mp); int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) __cancel_buf.__cancel_jmp_buf, 0); if (__builtin_expect ((__not_first_call), 0)) { __cancel_routine (__cancel_arg); __pthread_unwind_next (&__cancel_buf); } __pthread_register_cancel (&__cancel_buf); do {; do { ((void)0);
        diminuto_buffer_pool_free((diminuto_buffer_pool_t *)&meta);
    } while (0); do { } while (0); } while (0); __pthread_unregister_cancel (&__cancel_buf); if (!0) __cancel_routine (__cancel_arg); } while (0); } } while (0);
}

canonical_original_code:
void diminuto_buffer_fini()
{
    do { union pthread_mutex_t *_diminuto_criticalsection_mp; _diminuto_criticalsection_mp = (&mutex); if (diminuto_criticalsection_lock(_diminuto_criticalsection_mp) == 0) { do { struct __pthread_unwind_buf_t __cancel_buf; void (*__cancel_routine)(void *) = (diminuto_criticalsection_cleanup); void *__cancel_arg = (_diminuto_criticalsection_mp); int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) __cancel_buf.__cancel_jmp_buf, 0); if (__builtin_expect ((__not_first_call), 0)) { __cancel_routine (__cancel_arg); __pthread_unwind_next (&__cancel_buf); } __pthread_register_cancel (&__cancel_buf); do {; do { ((void)0);
        diminuto_buffer_pool_free((struct DiminutoBufferPool *)&meta);
    } while (0); do { } while (0); } while (0); __pthread_unregister_cancel (&__cancel_buf); if (!0) __cancel_routine (__cancel_arg); } while (0); } } while (0);
}

variable_types: struct __pthread_unwind_buf_t { struct { long __cancel_jmp_buf[8]; int __mask_was_saved; } __cancel_jmp_buf[1]; void *__pad[4]; }


decompiled_code:
__int64 __fastcall diminuto_buffer_prealloc(__int64 a1, __int64 a2)
{
__int64 v2; // r12
__pthread_unwind_buf_t buf; // [rsp+20h] [rbp-88h] BYREF

if ( (unsigned int)diminuto_criticalsection_lock(&mutex) )
return 0LL;
if ( _sigsetjmp((struct __jmp_buf_tag *)&buf, 0) )
{
((void (__fastcall *)(void *))diminuto_criticalsection_cleanup)(&mutex);
_pthread_unwind_next(&buf);
}
_pthread_register_cancel(&buf);
v2 = diminuto_buffer_pool_prealloc(&meta, a1, a2);
_pthread_unregister_cancel(&buf);
((void (__fastcall *)(void *))diminuto_criticalsection_cleanup)(&mutex);
return v2;
}

canonical_decompiled_code:
__int64 __fastcall func13(__int64 a1, __int64 a2)
{
__int64 v2; // r12
__pthread_unwind_buf_t buf; // [rsp+20h] [rbp-88h] BYREF

if ( (unsigned int)diminuto_criticalsection_lock(&mutex) )
return 0LL;
if ( _sigsetjmp((struct __jmp_buf_tag *)&buf, 0) )
{
((void (__fastcall *)(void *))diminuto_criticalsection_cleanup)(&mutex);
_pthread_unwind_next(&buf);
}
_pthread_register_cancel(&buf);
v2 = diminuto_buffer_pool_prealloc(&meta, a1, a2);
_pthread_unregister_cancel(&buf);
((void (__fastcall *)(void *))diminuto_criticalsection_cleanup)(&mutex);
return v2;
}

original_code:
size_t diminuto_buffer_prealloc(size_t nmemb, size_t size)
{
    size_t result = 0;
    do { pthread_mutex_t * _diminuto_criticalsection_mp; _diminuto_criticalsection_mp = (&mutex); if (diminuto_criticalsection_lock(_diminuto_criticalsection_mp) == 0) { do { __pthread_unwind_buf_t __cancel_buf; void (*__cancel_routine) (void *) = (diminuto_criticalsection_cleanup); void *__cancel_arg = (_diminuto_criticalsection_mp); int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) __cancel_buf.__cancel_jmp_buf, 0); if (__builtin_expect ((__not_first_call), 0)) { __cancel_routine (__cancel_arg); __pthread_unwind_next (&__cancel_buf); } __pthread_register_cancel (&__cancel_buf); do {; do { ((void)0);
        result = diminuto_buffer_pool_prealloc((diminuto_buffer_pool_t *)&meta, nmemb, size);
    } while (0); do { } while (0); } while (0); __pthread_unregister_cancel (&__cancel_buf); if (!0) __cancel_routine (__cancel_arg); } while (0); } } while (0);
    return result;
}

canonical_original_code:
unsigned long diminuto_buffer_prealloc(unsigned long nmemb, unsigned long size)
{
    unsigned long result = 0;
    do { union pthread_mutex_t *_diminuto_criticalsection_mp; _diminuto_criticalsection_mp = (&mutex); if (diminuto_criticalsection_lock(_diminuto_criticalsection_mp) == 0) { do { struct __pthread_unwind_buf_t __cancel_buf; void (*__cancel_routine)(void *) = (diminuto_criticalsection_cleanup); void *__cancel_arg = (_diminuto_criticalsection_mp); int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) __cancel_buf.__cancel_jmp_buf, 0); if (__builtin_expect ((__not_first_call), 0)) { __cancel_routine (__cancel_arg); __pthread_unwind_next (&__cancel_buf); } __pthread_register_cancel (&__cancel_buf); do {; do { ((void)0);
        result = diminuto_buffer_pool_prealloc((struct DiminutoBufferPool *)&meta, nmemb, size);
    } while (0); do { } while (0); } while (0); __pthread_unregister_cancel (&__cancel_buf); if (!0) __cancel_routine (__cancel_arg); } while (0); } } while (0);
    return result;
}

variable_types:
result
unsigned long

return_type: unsigned long


decompiled_code:
__int64 diminuto_buffer_log()
{
__int64 v0; // r12
__pthread_unwind_buf_t buf; // [rsp+10h] [rbp-88h] BYREF

if ( (unsigned int)diminuto_criticalsection_lock(&mutex) )
return 0LL;
if ( _sigsetjmp((struct __jmp_buf_tag *)&buf, 0) )
{
((void (__fastcall *)(void *))diminuto_criticalsection_cleanup)(&mutex);
_pthread_unwind_next(&buf);
}
_pthread_register_cancel(&buf);
v0 = diminuto_buffer_pool_log(&meta);
_pthread_unregister_cancel(&buf);
((void (__fastcall *)(void *))diminuto_criticalsection_cleanup)(&mutex);
return v0;
}

canonical_decompiled_code:
__int64 func14()
{
__int64 v0; // r12
__pthread_unwind_buf_t buf; // [rsp+10h] [rbp-88h] BYREF

if ( (unsigned int)diminuto_criticalsection_lock(&mutex) )
return 0LL;
if ( _sigsetjmp((struct __jmp_buf_tag *)&buf, 0) )
{
((void (__fastcall *)(void *))diminuto_criticalsection_cleanup)(&mutex);
_pthread_unwind_next(&buf);
}
_pthread_register_cancel(&buf);
v0 = diminuto_buffer_pool_log(&meta);
_pthread_unregister_cancel(&buf);
((void (__fastcall *)(void *))diminuto_criticalsection_cleanup)(&mutex);
return v0;
}

original_code:
size_t diminuto_buffer_log(void)
{
    size_t result = 0;
    do { pthread_mutex_t * _diminuto_criticalsection_mp; _diminuto_criticalsection_mp = (&mutex); if (diminuto_criticalsection_lock(_diminuto_criticalsection_mp) == 0) { do { __pthread_unwind_buf_t __cancel_buf; void (*__cancel_routine) (void *) = (diminuto_criticalsection_cleanup); void *__cancel_arg = (_diminuto_criticalsection_mp); int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) __cancel_buf.__cancel_jmp_buf, 0); if (__builtin_expect ((__not_first_call), 0)) { __cancel_routine (__cancel_arg); __pthread_unwind_next (&__cancel_buf); } __pthread_register_cancel (&__cancel_buf); do {; do { ((void)0);
        result = diminuto_buffer_pool_log((diminuto_buffer_pool_t *)&meta);
    } while (0); do { } while (0); } while (0); __pthread_unregister_cancel (&__cancel_buf); if (!0) __cancel_routine (__cancel_arg); } while (0); } } while (0);
    return result;
}

canonical_original_code:
unsigned long diminuto_buffer_log()
{
    unsigned long result = 0;
    do { union pthread_mutex_t *_diminuto_criticalsection_mp; _diminuto_criticalsection_mp = (&mutex); if (diminuto_criticalsection_lock(_diminuto_criticalsection_mp) == 0) { do { struct __pthread_unwind_buf_t __cancel_buf; void (*__cancel_routine)(void *) = (diminuto_criticalsection_cleanup); void *__cancel_arg = (_diminuto_criticalsection_mp); int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) __cancel_buf.__cancel_jmp_buf, 0); if (__builtin_expect ((__not_first_call), 0)) { __cancel_routine (__cancel_arg); __pthread_unwind_next (&__cancel_buf); } __pthread_register_cancel (&__cancel_buf); do {; do { ((void)0);
        result = diminuto_buffer_pool_log((struct DiminutoBufferPool *)&meta);
    } while (0); do { } while (0); } while (0); __pthread_unregister_cancel (&__cancel_buf); if (!0) __cancel_routine (__cancel_arg); } while (0); } } while (0);
    return result;
}


decompiled_code:
_BOOL8 __fastcall diminuto_buffer_set(__int64 *a1)
{
__pthread_unwind_buf_t buf; // [rsp+10h] [rbp-78h] BYREF

if ( (unsigned int)diminuto_criticalsection_lock(&mutex) )
return 0LL;
if ( _sigsetjmp((struct __jmp_buf_tag *)&buf, 0) )
{
diminuto_criticalsection_cleanup(&mutex);
_pthread_unwind_next(&buf);
}
_pthread_register_cancel(&buf);
if ( a1 )
{
meta = *a1;
off_A18 = (void *)a1[1];
off_A20 = (void *)a1[2];
}
else
{
meta = 10LL;
off_A18 = &POOL;
off_A20 = &pool;
}
_pthread_unregister_cancel(&buf);
diminuto_criticalsection_cleanup(&mutex);
return a1 != 0LL;
}

canonical_decompiled_code:
_BOOL8 __fastcall func15(__int64 *a1)
{
__pthread_unwind_buf_t buf; // [rsp+10h] [rbp-78h] BYREF

if ( (unsigned int)diminuto_criticalsection_lock(&mutex) )
return 0LL;
if ( _sigsetjmp((struct __jmp_buf_tag *)&buf, 0) )
{
diminuto_criticalsection_cleanup(&mutex);
_pthread_unwind_next(&buf);
}
_pthread_register_cancel(&buf);
if ( a1 )
{
meta = *a1;
off_A18 = (void *)a1[1];
off_A20 = (void *)a1[2];
}
else
{
meta = 10LL;
off_A18 = &POOL;
off_A20 = &pool;
}
_pthread_unregister_cancel(&buf);
diminuto_criticalsection_cleanup(&mutex);
return a1 != 0LL;
}

original_code:
int diminuto_buffer_set(diminuto_buffer_pool_t * poolp)
{
    int result = 0;
    do { pthread_mutex_t * _diminuto_criticalsection_mp; _diminuto_criticalsection_mp = (&mutex); if (diminuto_criticalsection_lock(_diminuto_criticalsection_mp) == 0) { do { __pthread_unwind_buf_t __cancel_buf; void (*__cancel_routine) (void *) = (diminuto_criticalsection_cleanup); void *__cancel_arg = (_diminuto_criticalsection_mp); int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) __cancel_buf.__cancel_jmp_buf, 0); if (__builtin_expect ((__not_first_call), 0)) { __cancel_routine (__cancel_arg); __pthread_unwind_next (&__cancel_buf); } __pthread_register_cancel (&__cancel_buf); do {; do { ((void)0);
        result = (poolp != (diminuto_buffer_pool_t *)0);
        if (result) {
            meta.count = poolp->count;
            meta.sizes = poolp->sizes;
            meta.pool = (diminuto_buffer_t **)(poolp->pool);
        } else {
            meta.count = (sizeof(POOL) / sizeof(POOL[0]));
            meta.sizes = POOL;
            meta.pool = pool;
        }
    } while (0); do { } while (0); } while (0); __pthread_unregister_cancel (&__cancel_buf); if (!0) __cancel_routine (__cancel_arg); } while (0); } } while (0);
    return result;
}

canonical_original_code:
int diminuto_buffer_set(struct DiminutoBufferPool *poolp)
{
    int result = 0;
    do { union pthread_mutex_t *_diminuto_criticalsection_mp; _diminuto_criticalsection_mp = (&mutex); if (diminuto_criticalsection_lock(_diminuto_criticalsection_mp) == 0) { do { struct __pthread_unwind_buf_t __cancel_buf; void (*__cancel_routine)(void *) = (diminuto_criticalsection_cleanup); void *__cancel_arg = (_diminuto_criticalsection_mp); int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) __cancel_buf.__cancel_jmp_buf, 0); if (__builtin_expect ((__not_first_call), 0)) { __cancel_routine (__cancel_arg); __pthread_unwind_next (&__cancel_buf); } __pthread_register_cancel (&__cancel_buf); do {; do { ((void)0);
        result = (poolp != (struct DiminutoBufferPool *)0);
        if (result) {
            meta.count = poolp->count;
            meta.sizes = poolp->sizes;
            meta.pool = (struct DiminutoBuffer **)(poolp->pool);
        } else {
            meta.count = (sizeof(POOL) / sizeof(POOL[0]));
            meta.sizes = POOL;
            meta.pool = pool;
        }
    } while (0); do { } while (0); } while (0); __pthread_unregister_cancel (&__cancel_buf); if (!0) __cancel_routine (__cancel_arg); } while (0); } } while (0);
    return result;
}

variable_types: struct DiminutoBufferPool { unsigned long count; unsigned long *sizes; void **pool; } *

variable_types: result int

user_defined_types: struct DiminutoBuffer { unsigned long align[]; union { unsigned long item; struct DiminutoBuffer *next; } header; unsigned long payload[]; }


decompiled_code:
__int64 __fastcall diminuto_buffer_debug(int a1)
{
__int64 result; // rax

result = (unsigned int)debug;
debug = a1;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func16(int a1)
{
__int64 result; // rax

result = (unsigned int)debug;
debug = a1;
return result;
}

original_code:
int diminuto_buffer_debug(int after)
{
    int before = 0;
    before = debug;
    debug = after;
    return before;
}

variable_types: after int

variable_types: before int


decompiled_code:
__int64 __fastcall diminuto_buffer_nomalloc(int a1)
{
__int64 result; // rax

result = (unsigned int)fail;
fail = a1;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func17(int a1)
{
__int64 result; // rax

result = (unsigned int)fail;
fail = a1;
return result;
}

original_code:
int diminuto_buffer_nomalloc(int after)
{
    int before = 0;
    before = fail;
    fail = after;
    return before;
}


decompiled_code:
__int64 __fastcall diminuto_buffer_hash(unsigned __int64 a1, _QWORD *a2)
{
return (unsigned int)buffer_pool_hash_constprop_0(a1, a2);
}

canonical_decompiled_code:
__int64 __fastcall func18(unsigned __int64 a1, _QWORD *a2)
{
return (unsigned int)func4(a1, a2);
}

original_code:
size_t diminuto_buffer_hash(size_t requested, size_t * actualp)
{
    return buffer_pool_hash(&meta, requested, actualp);
}

canonical_original_code:
unsigned long diminuto_buffer_hash(unsigned long requested, unsigned long *actualp)
{
    return buffer_pool_hash(&meta, requested, actualp);
}

variable_types:
actualp
unsigned long *


decompiled_code:
// attributes: thunk
__int64 __fastcall diminuto_buffer_effective(unsigned __int64 a1)
{
return buffer_pool_effective_constprop_0(a1);
}

canonical_decompiled_code:
__int64 __fastcall func19(unsigned __int64 a1)
{
return func3(a1);
}

original_code:
size_t diminuto_buffer_effective(size_t item)
{
    return buffer_pool_effective(&meta, item);
}

canonical_original_code:
unsigned long diminuto_buffer_effective(unsigned long item)
{
    return buffer_pool_effective(&meta, item);
}

variable_types:
item
unsigned long


decompiled_code:
// attributes: thunk
__int64 diminuto_buffer_count()
{
return buffer_pool_count_constprop_0();
}

canonical_decompiled_code:
__int64 func20()
{
return func5();
}

original_code:
size_t diminuto_buffer_count(void)
{
    return buffer_pool_count(&meta);
}

canonical_original_code:
unsigned long diminuto_buffer_count()
{
    return buffer_pool_count(&meta);
}


decompiled_code:
// attributes: thunk
unsigned __int64 __fastcall diminuto_buffer_size(unsigned __int64 a1)
{
return buffer_pool_size_constprop_0(a1);
}

canonical_decompiled_code:
unsigned __int64 __fastcall func21(unsigned __int64 a1)
{
return func2(a1);
}

original_code:
size_t diminuto_buffer_size(size_t item)
{
    return buffer_pool_size(&meta, item);
}

canonical_original_code:
unsigned long diminuto_buffer_size(unsigned long item)
{
    return buffer_pool_size(&meta, item);
}


decompiled_code:
_BOOL8 __fastcall diminuto_buffer_isempty(unsigned __int64 a1)
{
_BOOL4 v1; // er8
_BOOL8 result; // rax

v1 = buffer_pool_isexternal_constprop_0(a1);
result = 1LL;
if ( !v1 )
result = buffer_pool_first_constprop_0(a1) == 0;
return result;
}

canonical_decompiled_code:
_BOOL8 __fastcall func22(unsigned __int64 a1)
{
_BOOL4 v1; // er8
_BOOL8 result; // rax

v1 = func1(a1);
result = 1LL;
if ( !v1 )
result = func0(a1) == 0;
return result;
}

original_code:
size_t diminuto_buffer_isempty(size_t item)
{
    return (buffer_pool_isexternal(&meta, item) || (buffer_pool_first(&meta, item) == (diminuto_buffer_t *)0));
}

canonical_original_code:
unsigned long diminuto_buffer_isempty(unsigned long item)
{
    return (buffer_pool_isexternal(&meta, item) || (buffer_pool_first(&meta, item) == (struct DiminutoBuffer *)0));
}


decompiled_code:
void __fastcall diminuto_hangup_handler(int a1)
{
if ( a1 == 1 && signaled != 0x7FFFFFFF )
++signaled;
}

canonical_decompiled_code:
void __fastcall func0(int a1)
{
if ( a1 == 1 && signaled != 0x7FFFFFFF )
++signaled;
}

original_code:
static void diminuto_hangup_handler(int signum)
{
    int mysignaled = -1;
    static const int MAXIMUM = ~(((int)1) << ((sizeof(signaled) * 8) - 1));
    if (signum == 1) {
        mysignaled = signaled;
        if (mysignaled < MAXIMUM) {
            mysignaled += 1;
            signaled = mysignaled;
        }
    }
}

canonical_original_code:
static void diminuto_hangup_handler(int signum)
{
    int mysignaled = -1;
    static int MAXIMUM = ~(((int)1) << ((sizeof(signaled) * 8) - 1));
    if (signum == 1) {
        mysignaled = signaled;
        if (mysignaled < MAXIMUM) {
            mysignaled += 1;
            signaled = mysignaled;
        }
    }
}

variable_types: signum int

variable_types: mysignaled int

variable_types: MAXIMUM int


decompiled_code:
__int64 __fastcall diminuto_hangup_signal(__pid_t a1)
{
__int64 result; // rax

if ( kill(a1, 1) < 0 )
{
diminuto_log_perror("src/diminuto_hangup.c", 32LL, "diminuto_hangup_kill: kill");
result = 0xFFFFFFFFLL;
}
else
{
result = diminuto_hangup_debug[0];
if ( diminuto_hangup_debug[0] )
{
result = diminuto_log_mask & 1;
if ( (diminuto_log_mask & 1) != 0 )
{
diminuto_log_log(7LL, "diminuto_hangup_signal: SIGHUP");
result = 0LL;
}
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func1(__pid_t a1)
{
__int64 result; // rax

if ( kill(a1, 1) < 0 )
{
diminuto_log_perror("src/diminuto_hangup.c", 32LL, "diminuto_hangup_kill: kill");
result = 0xFFFFFFFFLL;
}
else
{
result = diminuto_hangup_debug[0];
if ( diminuto_hangup_debug[0] )
{
result = diminuto_log_mask & 1;
if ( (diminuto_log_mask & 1) != 0 )
{
diminuto_log_log(7LL, "diminuto_hangup_signal: SIGHUP");
result = 0LL;
}
}
}
return result;
}

original_code:
pid_t diminuto_hangup_signal(pid_t pid)
{
    int rc = 0;
    if (kill(pid, 1) < 0) {
        diminuto_log_perror("src/diminuto_hangup.c", 32, "diminuto_hangup_kill: kill");
        rc = -1;
    } else if (diminuto_hangup_debug) {
        ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_DEBUG)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_DEBUG, "diminuto_hangup_signal: SIGHUP") : ((void)0));
    } else {
    }
    return rc;
}

canonical_original_code:
int diminuto_hangup_signal(int pid)
{
    int rc = 0;
    if (kill(pid, 1) < 0) {
        diminuto_log_perror("src/diminuto_hangup.c", 32, "diminuto_hangup_kill: kill");
        rc = -1;
    } else if (diminuto_hangup_debug) {
        ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_DEBUG)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_DEBUG, "diminuto_hangup_signal: SIGHUP") : ((void)0));
    } else {
    }
    return rc;
}

variable_types: pid int

variable_types: rc int


decompiled_code:
__int64 diminuto_hangup_check()
{
int v0; // eax
unsigned int v2; // [rsp+4h] [rbp-184h]
int v3; // [rsp+1Ch] [rbp-16Ch] BYREF
struct __jmp_buf_tag env; // [rsp+20h] [rbp-168h] BYREF
char v5[136]; // [rsp+100h] [rbp-88h] BYREF

v2 = -1;
if ( (unsigned int)diminuto_criticalsection_lock(&mutex) )
goto LABEL_9;
if ( _sigsetjmp(&env, 0) )
{
diminuto_criticalsection_cleanup(&mutex);
_pthread_unwind_next((__pthread_unwind_buf_t *)&env);
}
_pthread_register_cancel((__pthread_unwind_buf_t *)&env);
v3 = 1;
if ( !(unsigned int)diminuto_uninterruptiblesection_block(&v3, 1LL, v5) )
{
if ( _sigsetjmp((struct __jmp_buf_tag *)&env.__saved_mask.__val[5], 0) )
{
((void (__fastcall *)(char *))diminuto_uninterruptiblesection_cleanup)(v5);
_pthread_unwind_next((__pthread_unwind_buf_t *)&env.__saved_mask.__val[5]);
}
_pthread_register_cancel((__pthread_unwind_buf_t *)&env.__saved_mask.__val[5]);
v0 = signaled;
signaled = 0;
v2 = v0;
_pthread_unregister_cancel((__pthread_unwind_buf_t *)&env.__saved_mask.__val[5]);
((void (__fastcall *)(char *))diminuto_uninterruptiblesection_cleanup)(v5);
}
_pthread_unregister_cancel((__pthread_unwind_buf_t *)&env);
diminuto_criticalsection_cleanup(&mutex);
if ( v2 )
{
LABEL_9:
if ( diminuto_hangup_debug[0] && (diminuto_log_mask & 1) != 0 )
diminuto_log_log(7LL, "diminuto_hangup_check: SIGHUP");
}
return v2;
}

canonical_decompiled_code:
__int64 func2()
{
int v0; // eax
unsigned int v2; // [rsp+4h] [rbp-184h]
int v3; // [rsp+1Ch] [rbp-16Ch] BYREF
struct __jmp_buf_tag env; // [rsp+20h] [rbp-168h] BYREF
char v5[136]; // [rsp+100h] [rbp-88h] BYREF

v2 = -1;
if ( (unsigned int)diminuto_criticalsection_lock(&mutex) )
goto LABEL_9;
if ( _sigsetjmp(&env, 0) )
{
diminuto_criticalsection_cleanup(&mutex);
_pthread_unwind_next((__pthread_unwind_buf_t *)&env);
}
_pthread_register_cancel((__pthread_unwind_buf_t *)&env);
v3 = 1;
if ( !(unsigned int)diminuto_uninterruptiblesection_block(&v3, 1LL, v5) )
{
if ( _sigsetjmp((struct __jmp_buf_tag *)&env.__saved_mask.__val[5], 0) )
{
((void (__fastcall *)(char *))diminuto_uninterruptiblesection_cleanup)(v5);
_pthread_unwind_next((__pthread_unwind_buf_t *)&env.__saved_mask.__val[5]);
}
_pthread_register_cancel((__pthread_unwind_buf_t *)&env.__saved_mask.__val[5]);
v0 = signaled;
signaled = 0;
v2 = v0;
_pthread_unregister_cancel((__pthread_unwind_buf_t *)&env.__saved_mask.__val[5]);
((void (__fastcall *)(char *))diminuto_uninterruptiblesection_cleanup)(v5);
}
_pthread_unregister_cancel((__pthread_unwind_buf_t *)&env);
diminuto_criticalsection_cleanup(&mutex);
if ( v2 )
{
LABEL_9:
if ( diminuto_hangup_debug[0] && (diminuto_log_mask & 1) != 0 )
diminuto_log_log(7LL, "diminuto_hangup_check: SIGHUP");
}
return v2;
}

original_code:
int diminuto_hangup_check(void)
{
    int mysignaled = -1;
    do { pthread_mutex_t * _diminuto_criticalsection_mp; _diminuto_criticalsection_mp = (&mutex); if (diminuto_criticalsection_lock(_diminuto_criticalsection_mp) == 0) { do { __pthread_unwind_buf_t __cancel_buf; void (*__cancel_routine) (void *) = (diminuto_criticalsection_cleanup); void *__cancel_arg = (_diminuto_criticalsection_mp); int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) __cancel_buf.__cancel_jmp_buf, 0); if (__builtin_expect ((__not_first_call), 0)) { __cancel_routine (__cancel_arg); __pthread_unwind_next (&__cancel_buf); } __pthread_register_cancel (&__cancel_buf); do {; do { ((void)0);
        do { const int _diminuto_uninterrutiblesection_signals[] = { 1 }; sigset_t _diminuto_uninterruptiblesection_set; if (diminuto_uninterruptiblesection_block(_diminuto_uninterrutiblesection_signals, (sizeof(_diminuto_uninterrutiblesection_signals) / sizeof(_diminuto_uninterrutiblesection_signals[0])), &_diminuto_uninterruptiblesection_set) == 0) { do { __pthread_unwind_buf_t __cancel_buf; void (*__cancel_routine) (void *) = (diminuto_uninterruptiblesection_cleanup); void *__cancel_arg = (&_diminuto_uninterruptiblesection_set); int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) __cancel_buf.__cancel_jmp_buf, 0); if (__builtin_expect ((__not_first_call), 0)) { __cancel_routine (__cancel_arg); __pthread_unwind_next (&__cancel_buf); } __pthread_register_cancel (&__cancel_buf); do {; do { ((void)0);
            mysignaled = signaled;
            signaled = 0;
        } while (0); do { } while (0); } while (0); __pthread_unregister_cancel (&__cancel_buf); if (!0) __cancel_routine (__cancel_arg); } while (0); } } while (0);
    } while (0); do { } while (0); } while (0); __pthread_unregister_cancel (&__cancel_buf); if (!0) __cancel_routine (__cancel_arg); } while (0); } } while (0);
    if (!mysignaled) {
    } else if (diminuto_hangup_debug) {
        ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_DEBUG)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_DEBUG, "diminuto_hangup_check: SIGHUP") : ((void)0));
    } else {
    }
    return mysignaled;
}

canonical_original_code:
int diminuto_hangup_check()
{
    int mysignaled = -1;
    do { union pthread_mutex_t *_diminuto_criticalsection_mp; _diminuto_criticalsection_mp = (&mutex); if (diminuto_criticalsection_lock(_diminuto_criticalsection_mp) == 0) { do { struct __pthread_unwind_buf_t __cancel_buf; void (*__cancel_routine)(void *) = (diminuto_criticalsection_cleanup); void *__cancel_arg = (_diminuto_criticalsection_mp); int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) __cancel_buf.__cancel_jmp_buf, 0); if (__builtin_expect ((__not_first_call), 0)) { __cancel_routine (__cancel_arg); __pthread_unwind_next (&__cancel_buf); } __pthread_register_cancel (&__cancel_buf); do {; do { ((void)0);
        do { int _diminuto_uninterrutiblesection_signals[] = { 1 }; struct __sigset_t _diminuto_uninterruptiblesection_set; if (diminuto_uninterruptiblesection_block(_diminuto_uninterrutiblesection_signals, (sizeof(_diminuto_uninterrutiblesection_signals) / sizeof(_diminuto_uninterrutiblesection_signals[0])), &_diminuto_uninterruptiblesection_set) == 0) { do { struct __pthread_unwind_buf_t __cancel_buf; void (*__cancel_routine)(void *) = (diminuto_uninterruptiblesection_cleanup); void *__cancel_arg = (&_diminuto_uninterruptiblesection_set); int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) __cancel_buf.__cancel_jmp_buf, 0); if (__builtin_expect ((__not_first_call), 0)) { __cancel_routine (__cancel_arg); __pthread_unwind_next (&__cancel_buf); } __pthread_register_cancel (&__cancel_buf); do {; do { ((void)0);
            mysignaled = signaled;
            signaled = 0;
        } while (0); do { } while (0); } while (0); __pthread_unregister_cancel (&__cancel_buf); if (!0) __cancel_routine (__cancel_arg); } while (0); } } while (0);
    } while (0); do { } while (0); } while (0); __pthread_unregister_cancel (&__cancel_buf); if (!0) __cancel_routine (__cancel_arg); } while (0); } } while (0);
    if (!mysignaled) {
    } else if (diminuto_hangup_debug) {
        ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_DEBUG)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_DEBUG, "diminuto_hangup_check: SIGHUP") : ((void)0));
    } else {
    }
    return mysignaled;
}

variable_types: union pthread_mutex_t { struct __pthread_mutex_s { int __lock; unsigned int __count; int __owner; unsigned int __nusers; int __kind; short __spins; short __elision; struct __pthread_internal_list { struct __pthread_internal_list *__prev; struct __pthread_internal_list *__next; } __list; } __data; char __size[40]; long __align; } *

variable_types: struct __sigset_t { unsigned long __val[-1]; }