decompiled_code:
void *__fastcall diminuto_string_strndup_set(char *(**a1)(const char *string, size_t n))
{
void *v1; // rbx
char *(**v2)(const char *, size_t); // rax
__pthread_unwind_buf_t buf; // [rsp+10h] [rbp-78h] BYREF

if ( !(unsigned int)diminuto_criticalsection_lock(&mutex_0) )
{
if ( _sigsetjmp((struct __jmp_buf_tag *)&buf, 0) )
{
diminuto_criticalsection_cleanup(&mutex_0);
_pthread_unwind_next(&buf);
}
_pthread_register_cancel(&buf);
v1 = diminuto_string_strndup_func_p;
v2 = a1;
if ( !a1 )
v2 = &strndup;
diminuto_string_strndup_func_p = v2;
_pthread_unregister_cancel(&buf);
diminuto_criticalsection_cleanup(&mutex_0);
}
return v1;
}

canonical_decompiled_code:
void *__fastcall func1(char *(**a1)(const char *string, size_t n))
{
void *v1; // rbx
char *(**v2)(const char *, size_t); // rax
__pthread_unwind_buf_t buf; // [rsp+10h] [rbp-78h] BYREF

if ( !(unsigned int)diminuto_criticalsection_lock(&mutex_0) )
{
if ( _sigsetjmp((struct __jmp_buf_tag *)&buf, 0) )
{
diminuto_criticalsection_cleanup(&mutex_0);
_pthread_unwind_next(&buf);
}
_pthread_register_cancel(&buf);
v1 = diminuto_string_strndup_func_p;
v2 = a1;
if ( !a1 )
v2 = &strndup;
diminuto_string_strndup_func_p = v2;
_pthread_unregister_cancel(&buf);
diminuto_criticalsection_cleanup(&mutex_0);
}
return v1;
}

original_code: diminuto_string_strndup_func_t * diminuto_string_strndup_set(diminuto_string_strndup_func_t * now) { static pthread_mutex_t mutex = { { 0, 0, 0, 0, 0, 0, 0, { 0, 0 } } }; diminuto_string_strndup_func_t * was; 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); was = diminuto_string_strndup_func_p; diminuto_string_strndup_func_p = (now != (diminuto_string_strndup_func_t *)0) ? now : &strndup; } while (0); do { } while (0); } while (0); __pthread_unregister_cancel (&__cancel_buf); if (!0) __cancel_routine (__cancel_arg); } while (0); } } while (0); return was; }

canonical_original_code: char *(*diminuto_string_strndup_set(char *(*now)(char *s, unsigned long n)))(char *s, unsigned long n) { static union pthread_mutex_t mutex = { { 0, 0, 0, 0, 0, 0, 0, { 0, 0 } } }; char *(*was)(char *s, unsigned long n); 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); was = diminuto_string_strndup_func_p; diminuto_string_strndup_func_p = (now != (char *(*)(char *s, unsigned long n))0) ? now : &strndup; } while (0); do { } while (0); } while (0); __pthread_unregister_cancel (&__cancel_buf); if (!0) __cancel_routine (__cancel_arg); } while (0); } } while (0); return was; }

variable_types:
now
char *(*)(char *s, unsigned long n)

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:
was
char *(*)(char *s, unsigned long n)

return_type: char *(*)(char *s, unsigned long n)

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]; }


repo: coverclock/com-diag-diminuto

decompiled_code:
__int64 diminuto_string_strdup()
{
return diminuto_string_strdup_func_p();
}

canonical_decompiled_code:
__int64 func2()
{
return diminuto_string_strdup_func_p();
}

original_code: char * diminuto_string_strdup (const char * s) { return (*diminuto_string_strdup_func_p)(s); }

canonical_original_code: char *diminuto_string_strdup(char *s) { return (*diminuto_string_strdup_func_p)(s); }

variable_types:
s
char *

return_type: char *


decompiled_code:
__int64 diminuto_string_strndup()
{
return diminuto_string_strndup_func_p();
}

canonical_decompiled_code:
__int64 func3()
{
return diminuto_string_strndup_func_p();
}

original_code: char * diminuto_string_strndup (const char * s, size_t n) { return (*diminuto_string_strndup_func_p)(s, n); }

canonical_original_code: char *diminuto_string_strndup(char *s, unsigned long n) { return (*diminuto_string_strndup_func_p)(s, n); }

variable_types:
n
unsigned long


decompiled_code:
__int64 __fastcall diminuto_daemon_test(int a1)
{
unsigned int v1; // edx

v1 = diminuto_daemon_testing;
diminuto_daemon_testing = a1;
return v1;
}

canonical_decompiled_code:
__int64 __fastcall func0(int a1)
{
unsigned int v1; // edx

v1 = diminuto_daemon_testing;
diminuto_daemon_testing = a1;
return v1;
}

original_code:
diminuto_daemon_test_t diminuto_daemon_test(diminuto_daemon_test_t test)
{
    int tested;
    tested = diminuto_daemon_testing;
    diminuto_daemon_testing = test;
    return tested;
}

canonical_original_code:
enum DiminutoDaemonTest diminuto_daemon_test(enum DiminutoDaemonTest test)
{
    int tested;
    tested = diminuto_daemon_testing;
    diminuto_daemon_testing = test;
    return tested;
}

variable_types: enum DiminutoDaemonTest { DIMINUTO_DAEMON_TEST_NONE=0, DIMINUTO_DAEMON_TEST_GETPPID=1, DIMINUTO_DAEMON_TEST_INIT=2, DIMINUTO_DAEMON_TEST_FORK=3, DIMINUTO_DAEMON_TEST_WAITPID=4, DIMINUTO_DAEMON_TEST_REFORK=5 }

variable_types: tested int


decompiled_code:
__int64 __fastcall diminuto_daemon_install(int sig, void (*a2)(int))
{
struct sigaction v3; // [rsp+0h] [rbp-A8h] BYREF

memset(&v3.sa_mask, 0, 0x90uLL);
v3.sa_handler = a2;
if ( sigaction(sig, &v3, 0LL) >= 0 )
return 0LL;
diminuto_log_serror("src/diminuto_daemon.c", 49LL, "diminuto_daemon: sigaction");
return 0xFFFFFFFFLL;
}

canonical_decompiled_code:
__int64 __fastcall func1(int sig, void (*a2)(int))
{
struct sigaction v3; // [rsp+0h] [rbp-A8h] BYREF

memset(&v3.sa_mask, 0, 0x90uLL);
v3.sa_handler = a2;
if ( sigaction(sig, &v3, 0LL) >= 0 )
return 0LL;
diminuto_log_serror("src/diminuto_daemon.c", 49LL, "diminuto_daemon: sigaction");
return 0xFFFFFFFFLL;
}

original_code:
int diminuto_daemon_install(int signum, void (*handler)(int))
{
    struct sigaction action;
    memset(&action, 0, sizeof(action));
    action.__sigaction_handler.sa_handler = handler;
    if (sigaction(signum, &action, (struct sigaction *)0) < 0) {
        diminuto_log_serror("src/diminuto_daemon.c", 49, "diminuto_daemon: sigaction");
        return -1;
    }
    return 0;
}

variable_types: signum int

variable_types:
handler
void (*)(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:
int diminuto_daemon_prepare()
{
int result; // eax

if ( fflush(stdout) == -1 )
diminuto_log_serror("src/diminuto_daemon.c", 59LL, "diminuto_daemon: fflush(stdout)");
result = fflush(stderr);
if ( result == -1 )
result = diminuto_log_serror("src/diminuto_daemon.c", 63LL, "diminuto_daemon: fflush(stderr)");
return result;
}

canonical_decompiled_code:
int func4()
{
int result; // eax

if ( fflush(stdout) == -1 )
diminuto_log_serror("src/diminuto_daemon.c", 59LL, "diminuto_daemon: fflush(stdout)");
result = fflush(stderr);
if ( result == -1 )
result = diminuto_log_serror("src/diminuto_daemon.c", 63LL, "diminuto_daemon: fflush(stderr)");
return result;
}

original_code:
void diminuto_daemon_prepare(void)
{
    if (fflush(stdout) == (-1)) {
        diminuto_log_serror("src/diminuto_daemon.c", 59, "diminuto_daemon: fflush(stdout)");
    }
    if (fflush(stderr) == (-1)) {
        diminuto_log_serror("src/diminuto_daemon.c", 63, "diminuto_daemon: fflush(stderr)");
    }
}

canonical_original_code:
void diminuto_daemon_prepare()
{
    if (fflush(stdout) == (-1)) {
        diminuto_log_serror("src/diminuto_daemon.c", 59, "diminuto_daemon: fflush(stdout)");
    }
    if (fflush(stderr) == (-1)) {
        diminuto_log_serror("src/diminuto_daemon.c", 63, "diminuto_daemon: fflush(stderr)");
    }
}

return_type: void


decompiled_code:
__int64 diminuto_daemon_verify()
{
__int64 result; // rax
__pid_t v1; // edx

result = 0xFFFFFFFFLL;
if ( diminuto_daemon_testing != 1 )
{
v1 = getppid();
if ( v1 < 0 )
{
diminuto_log_perror("src/diminuto_daemon.c", 75LL, "diminuto_daemon: getppid");
result = 0xFFFFFFFFLL;
}
else
{
result = (v1 == 1) | (unsigned __int8)(diminuto_daemon_testing == 2);
}
}
return result;
}

canonical_decompiled_code:
__int64 func5()
{
__int64 result; // rax
__pid_t v1; // edx

result = 0xFFFFFFFFLL;
if ( diminuto_daemon_testing != 1 )
{
v1 = getppid();
if ( v1 < 0 )
{
diminuto_log_perror("src/diminuto_daemon.c", 75LL, "diminuto_daemon: getppid");
result = 0xFFFFFFFFLL;
}
else
{
result = (v1 == 1) | (unsigned __int8)(diminuto_daemon_testing == 2);
}
}
return result;
}

original_code:
int diminuto_daemon_verify(void)
{
    int rc = -1;
    pid_t pid = -1;
    if (diminuto_daemon_testing == DIMINUTO_DAEMON_TEST_GETPPID) {
    } else if ((pid = getppid()) < 0) {
        diminuto_log_perror("src/diminuto_daemon.c", 75, "diminuto_daemon: getppid");
    } else if (diminuto_daemon_testing == DIMINUTO_DAEMON_TEST_INIT) {
        rc = 1;
    } else if (pid == 1) {
        rc = 1;
    } else {
        rc = 0;
    }
    return rc;
}

canonical_original_code:
int diminuto_daemon_verify()
{
    int rc = -1;
    int pid = -1;
    if (diminuto_daemon_testing == DIMINUTO_DAEMON_TEST_GETPPID) {
    } else if ((pid = getppid()) < 0) {
        diminuto_log_perror("src/diminuto_daemon.c", 75, "diminuto_daemon: getppid");
    } else if (diminuto_daemon_testing == DIMINUTO_DAEMON_TEST_INIT) {
        rc = 1;
    } else if (pid == 1) {
        rc = 1;
    } else {
        rc = 0;
    }
    return rc;
}

variable_types: rc int

variable_types: pid int


decompiled_code:
__int64 diminuto_daemon_fork()
{
__pid_t v0; // eax
unsigned int v1; // ebx
__pid_t v2; // ebp
int v3; // eax
int stat_loc; // [rsp+Ch] [rbp-1Ch] BYREF

stat_loc = -1;
if ( diminuto_daemon_testing == 3 )
return (unsigned int)-1;
v0 = fork();
v1 = v0;
if ( v0 < 0 )
{
diminuto_log_perror("src/diminuto_daemon.c", 99LL, "diminuto_daemon: fork");
}
else if ( v0 )
{
v2 = -1;
while ( diminuto_daemon_testing != 4 )
{
v2 = waitpid(v1, &stat_loc, 0);
if ( v2 >= 0 )
break;
v3 = *_errno_location();
if ( v3 != 4 )
{
if ( v3 != 10 )
diminuto_log_serror("src/diminuto_daemon.c", 115LL, "diminuto_daemon: waitpid");
return (unsigned int)-1;
}
}
if ( v2 <= 0 )
{
v1 = -1;
}
else if ( stat_loc & 0x7F | BYTE1(stat_loc) )
{
v1 = -1;
}
}
return v1;
}

canonical_decompiled_code:
__int64 func6()
{
__pid_t v0; // eax
unsigned int v1; // ebx
__pid_t v2; // ebp
int v3; // eax
int stat_loc; // [rsp+Ch] [rbp-1Ch] BYREF

stat_loc = -1;
if ( diminuto_daemon_testing == 3 )
return (unsigned int)-1;
v0 = fork();
v1 = v0;
if ( v0 < 0 )
{
diminuto_log_perror("src/diminuto_daemon.c", 99LL, "diminuto_daemon: fork");
}
else if ( v0 )
{
v2 = -1;
while ( diminuto_daemon_testing != 4 )
{
v2 = waitpid(v1, &stat_loc, 0);
if ( v2 >= 0 )
break;
v3 = *_errno_location();
if ( v3 != 4 )
{
if ( v3 != 10 )
diminuto_log_serror("src/diminuto_daemon.c", 115LL, "diminuto_daemon: waitpid");
return (unsigned int)-1;
}
}
if ( v2 <= 0 )
{
v1 = -1;
}
else if ( stat_loc & 0x7F | BYTE1(stat_loc) )
{
v1 = -1;
}
}
return v1;
}

original_code:
pid_t diminuto_daemon_fork(void)
{
    pid_t pid = -1;
    int rc = -1;
    int status = -1;
    if (diminuto_daemon_testing == DIMINUTO_DAEMON_TEST_FORK) {
    } else if ((pid = fork()) < 0) {
        diminuto_log_perror("src/diminuto_daemon.c", 99, "diminuto_daemon: fork");
    } else if (pid == 0) {
    } else {
        while (!0) {
            if (diminuto_daemon_testing == DIMINUTO_DAEMON_TEST_WAITPID) {
                break;
            } else if ((rc = waitpid(pid, &status, 0)) > 0) {
                break;
            } else if (rc == 0) {
                break;
            } else if ((*__errno_location ()) == 4) {
                continue;
            } else if ((*__errno_location ()) == 10) {
                break;
            } else {
                diminuto_log_serror("src/diminuto_daemon.c", 115, "diminuto_daemon: waitpid");
                break;
            }
        }
        if (rc <= 0) {
            pid = -1;
        } else if (!(((status) & 0x7f) == 0)) {
            pid = -1;
        } else if ((((status) & 0xff00) >> 8) != 0) {
            pid = -1;
        } else {
        }
    }
    return pid;
}

canonical_original_code:
int diminuto_daemon_fork()
{
    int pid = -1;
    int rc = -1;
    int status = -1;
    if (diminuto_daemon_testing == DIMINUTO_DAEMON_TEST_FORK) {
    } else if ((pid = fork()) < 0) {
        diminuto_log_perror("src/diminuto_daemon.c", 99, "diminuto_daemon: fork");
    } else if (pid == 0) {
    } else {
        while (!0) {
            if (diminuto_daemon_testing == DIMINUTO_DAEMON_TEST_WAITPID) {
                break;
            } else if ((rc = waitpid(pid, &status, 0)) > 0) {
                break;
            } else if (rc == 0) {
                break;
            } else if ((*__errno_location ()) == 4) {
                continue;
            } else if ((*__errno_location ()) == 10) {
                break;
            } else {
                diminuto_log_serror("src/diminuto_daemon.c", 115, "diminuto_daemon: waitpid");
                break;
            }
        }
        if (rc <= 0) {
            pid = -1;
        } else if (!(((status) & 0x7f) == 0)) {
            pid = -1;
        } else if ((((status) & 0xff00) >> 8) != 0) {
            pid = -1;
        } else {
        }
    }
    return pid;
}

variable_types: status int


decompiled_code:
__int64 diminuto_daemon_refork()
{
__pid_t v0; // ebx

if ( diminuto_daemon_testing == 5 )
{
v0 = -1;
}
else
{
v0 = fork();
if ( v0 < 0 )
diminuto_log_serror("src/diminuto_daemon.c", 143LL, "diminuto_daemon: refork");
}
return (unsigned int)v0;
}

canonical_decompiled_code:
__int64 func7()
{
__pid_t v0; // ebx

if ( diminuto_daemon_testing == 5 )
{
v0 = -1;
}
else
{
v0 = fork();
if ( v0 < 0 )
diminuto_log_serror("src/diminuto_daemon.c", 143LL, "diminuto_daemon: refork");
}
return (unsigned int)v0;
}

original_code:
pid_t diminuto_daemon_refork(void)
{
    pid_t pid = -1;
    if (diminuto_daemon_testing == DIMINUTO_DAEMON_TEST_REFORK) {
    } else if ((pid = fork()) < 0) {
        diminuto_log_serror("src/diminuto_daemon.c", 143, "diminuto_daemon: refork");
    } else {
    }
    return pid;
}

canonical_original_code:
int diminuto_daemon_refork()
{
    int pid = -1;
    if (diminuto_daemon_testing == DIMINUTO_DAEMON_TEST_REFORK) {
    } else if ((pid = fork()) < 0) {
        diminuto_log_serror("src/diminuto_daemon.c", 143, "diminuto_daemon: refork");
    } else {
    }
    return pid;
}


decompiled_code:
int __fastcall diminuto_daemon_sanitize(__int64 a1, const char *a2)
{
__int64 v2; // rax
__int64 v3; // r12
__int64 v4; // rbp
unsigned int v5; // ebx

if ( setsid() < 0 )
diminuto_log_serror("src/diminuto_daemon.c", 222LL, "diminuto_daemon: setsid");
diminuto_daemon_ignore(14);
diminuto_daemon_default(17);
diminuto_daemon_ignore(20);
diminuto_daemon_ignore(22);
diminuto_daemon_ignore(21);
diminuto_daemon_ignore(1);
diminuto_daemon_default(15);
umask(0);
if ( chdir("/") < 0 )
diminuto_log_serror("src/diminuto_daemon.c", 248LL, "diminuto_daemon: chdir");
if ( a2 )
{
diminuto_daemon_redirect(a2, 0, 0, &stdin);
diminuto_daemon_redirect(a2, 1, 1, &stdout);
diminuto_daemon_redirect(a2, 2, 1, &stderr);
}
diminuto_log_close();
v2 = diminuto_fd_count();
if ( v2 > 0 )
{
v3 = v2 - 1;
v4 = 0LL;
v5 = 0;
while ( 1 )
{
++v5;
if ( v3 == v4 )
break;
if ( v5 > 2 )
{
LODWORD(v2) = fileno(stdin);
if ( (_DWORD)v2 != v5 )
{
LODWORD(v2) = fileno(stdout);
if ( (_DWORD)v2 != v5 )
{
LODWORD(v2) = fileno(stderr);
if ( (_DWORD)v2 != v5 )
LODWORD(v2) = close(v5);
}
}
}
++v4;
}
}
if ( a1 )
LODWORD(v2) = diminuto_log_open(a1);
return v2;
}

canonical_decompiled_code:
int __fastcall func9(__int64 a1, const char *a2)
{
__int64 v2; // rax
__int64 v3; // r12
__int64 v4; // rbp
unsigned int v5; // ebx

if ( setsid() < 0 )
diminuto_log_serror("src/diminuto_daemon.c", 222LL, "diminuto_daemon: setsid");
func2(14);
func3(17);
func2(20);
func2(22);
func2(21);
func2(1);
func3(15);
umask(0);
if ( chdir("/") < 0 )
diminuto_log_serror("src/diminuto_daemon.c", 248LL, "diminuto_daemon: chdir");
if ( a2 )
{
func8(a2, 0, 0, &stdin);
func8(a2, 1, 1, &stdout);
func8(a2, 2, 1, &stderr);
}
diminuto_log_close();
v2 = diminuto_fd_count();
if ( v2 > 0 )
{
v3 = v2 - 1;
v4 = 0LL;
v5 = 0;
while ( 1 )
{
++v5;
if ( v3 == v4 )
break;
if ( v5 > 2 )
{
LODWORD(v2) = fileno(stdin);
if ( (_DWORD)v2 != v5 )
{
LODWORD(v2) = fileno(stdout);
if ( (_DWORD)v2 != v5 )
{
LODWORD(v2) = fileno(stderr);
if ( (_DWORD)v2 != v5 )
LODWORD(v2) = close(v5);
}
}
}
++v4;
}
}
if ( a1 )
LODWORD(v2) = diminuto_log_open(a1);
return v2;
}

original_code:
void diminuto_daemon_sanitize(const char * name, const char * path)
{
    long fds = 0;
    int fd = -1;
    if (setsid() < 0) {
        diminuto_log_serror("src/diminuto_daemon.c", 222, "diminuto_daemon: setsid");
    }
    diminuto_daemon_ignore(14);
    diminuto_daemon_default(17);
    diminuto_daemon_ignore(20);
    diminuto_daemon_ignore(22);
    diminuto_daemon_ignore(21);
    diminuto_daemon_ignore(1);
    diminuto_daemon_default(15);
    (void)umask(0);
    if (chdir("/") < 0) {
        diminuto_log_serror("src/diminuto_daemon.c", 248, "diminuto_daemon: chdir");
    }
    if (path != (const char *)0) {
        diminuto_daemon_redirect(path, 0, 00, &stdin, "r");
        diminuto_daemon_redirect(path, 1, 01, &stdout, "w");
        diminuto_daemon_redirect(path, 2, 01, &stderr, "w");
    }
    diminuto_log_close();
    fds = diminuto_fd_count();
    for (fd = 0; fd < fds; ++fd) {
        if (fd == 0) {
        } else if (fd == 1) {
        } else if (fd == 2) {
        } else if (fd == fileno(stdin)) {
        } else if (fd == fileno(stdout)) {
        } else if (fd == fileno(stderr)) {
        } else if (close(fd) < 0) {
        } else {
        }
    }
    if (name != (const char *)0) {
        diminuto_log_open(name);
    }
}

canonical_original_code:
void diminuto_daemon_sanitize(char *name, char *path)
{
    long fds = 0;
    int fd = -1;
    if (setsid() < 0) {
        diminuto_log_serror("src/diminuto_daemon.c", 222, "diminuto_daemon: setsid");
    }
    diminuto_daemon_ignore(14);
    diminuto_daemon_default(17);
    diminuto_daemon_ignore(20);
    diminuto_daemon_ignore(22);
    diminuto_daemon_ignore(21);
    diminuto_daemon_ignore(1);
    diminuto_daemon_default(15);
    (void)umask(0);
    if (chdir("/") < 0) {
        diminuto_log_serror("src/diminuto_daemon.c", 248, "diminuto_daemon: chdir");
    }
    if (path != (char *)0) {
        diminuto_daemon_redirect(path, 0, 00, &stdin, "r");
        diminuto_daemon_redirect(path, 1, 01, &stdout, "w");
        diminuto_daemon_redirect(path, 2, 01, &stderr, "w");
    }
    diminuto_log_close();
    fds = diminuto_fd_count();
    for (fd = 0; fd < fds; ++fd) {
        if (fd == 0) {
        } else if (fd == 1) {
        } else if (fd == 2) {
        } else if (fd == fileno(stdin)) {
        } else if (fd == fileno(stdout)) {
        } else if (fd == fileno(stderr)) {
        } else if (close(fd) < 0) {
        } else {
        }
    }
    if (name != (char *)0) {
        diminuto_log_open(name);
    }
}

variable_types:
name
char *

variable_types:
path
char *

variable_types: fds long

variable_types: fd int


decompiled_code:
__int64 __fastcall diminuto_daemon(__int64 a1)
{
int v1; // eax
int v3; // eax
int v4; // eax

v1 = diminuto_daemon_verify();
if ( v1 < 0 )
exit(1);
if ( !v1 )
{
diminuto_daemon_prepare();
v3 = diminuto_daemon_fork();
if ( v3 < 0 )
exit(1);
if ( v3 )
exit(0);
v4 = diminuto_daemon_refork();
if ( v4 < 0 )
exit(1);
if ( v4 )
exit(0);
diminuto_daemon_sanitize(a1, "/dev/null");
}
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func10(__int64 a1)
{
int v1; // eax
int v3; // eax
int v4; // eax

v1 = func5();
if ( v1 < 0 )
exit(1);
if ( !v1 )
{
func4();
v3 = func6();
if ( v3 < 0 )
exit(1);
if ( v3 )
exit(0);
v4 = func7();
if ( v4 < 0 )
exit(1);
if ( v4 )
exit(0);
func9(a1, "/dev/null");
}
return 0LL;
}

original_code:
int diminuto_daemon(const char * name)
{
    pid_t pid = -1;
    int rc = -1;
    if ((rc = diminuto_daemon_verify()) < 0) {
        _exit(1);
    } else if (rc) {
        return 0;
    } else {
    }
    diminuto_daemon_prepare();
    if ((pid = diminuto_daemon_fork()) < 0) {
        _exit(1);
    } else if (pid == 0) {
    } else {
        _exit(0);
    }
    if ((pid = diminuto_daemon_refork()) < 0) {
        _exit(1);
    } else if (pid == 0) {
    } else {
        _exit(0);
    }
    diminuto_daemon_sanitize(name, "/dev/null");
    return 0;
}

canonical_original_code:
int diminuto_daemon(char *name)
{
    int pid = -1;
    int rc = -1;
    if ((rc = diminuto_daemon_verify()) < 0) {
        _exit(1);
    } else if (rc) {
        return 0;
    } else {
    }
    diminuto_daemon_prepare();
    if ((pid = diminuto_daemon_fork()) < 0) {
        _exit(1);
    } else if (pid == 0) {
    } else {
        _exit(0);
    }
    if ((pid = diminuto_daemon_refork()) < 0) {
        _exit(1);
    } else if (pid == 0) {
    } else {
        _exit(0);
    }
    diminuto_daemon_sanitize(name, "/dev/null");
    return 0;
}


decompiled_code:
__int64 diminuto_service()
{
int v0; // eax
unsigned int v1; // ebx
int v3; // eax

v0 = diminuto_daemon_fork();
if ( v0 < 0 )
return (unsigned int)-1;
v1 = 1;
if ( !v0 )
{
v3 = diminuto_daemon_refork();
v1 = v3;
if ( v3 < 0 )
exit(1);
if ( v3 )
exit(0);
diminuto_log_close();
diminuto_log_open(0LL);
}
return v1;
}

canonical_decompiled_code:
__int64 func11()
{
int v0; // eax
unsigned int v1; // ebx
int v3; // eax

v0 = func6();
if ( v0 < 0 )
return (unsigned int)-1;
v1 = 1;
if ( !v0 )
{
v3 = func7();
v1 = v3;
if ( v3 < 0 )
exit(1);
if ( v3 )
exit(0);
diminuto_log_close();
diminuto_log_open(0LL);
}
return v1;
}

original_code:
int diminuto_service(void)
{
    pid_t pid = -1;
    if ((pid = diminuto_daemon_fork()) < 0) {
        return -1;
    } else if (pid == 0) {
    } else {
        return !0;
    }
    if ((pid = diminuto_daemon_refork()) < 0) {
        _exit(1);
    } else if (pid == 0) {
    } else {
        _exit(0);
    }
    diminuto_log_close();
    diminuto_log_open((char *)0);
    return 0;
}

canonical_original_code:
int diminuto_service()
{
    int pid = -1;
    if ((pid = diminuto_daemon_fork()) < 0) {
        return -1;
    } else if (pid == 0) {
    } else {
        return !0;
    }
    if ((pid = diminuto_daemon_refork()) < 0) {
        _exit(1);
    } else if (pid == 0) {
    } else {
        _exit(0);
    }
    diminuto_log_close();
    diminuto_log_open((char *)0);
    return 0;
}


decompiled_code:
__int64 __fastcall diminuto_system(__int64 a1, __int64 a2)
{
int v2; // eax
unsigned int v3; // edx
int v5; // eax

v2 = diminuto_daemon_fork();
if ( v2 < 0 )
return (unsigned int)-1;
v3 = 0;
if ( !v2 )
{
v5 = diminuto_daemon_refork(a1, a2, 0LL);
if ( v5 >= 0 )
{
if ( v5 )
exit(0);
diminuto_daemon_sanitize(0LL, 0LL);
execl("/bin/sh", "bin/sh", "-c", a1, 0LL);
diminuto_log_serror("src/diminuto_daemon.c", 475LL, "diminuto_system: execl");
exit(1);
}
exit(1);
}
return v3;
}

canonical_decompiled_code:
__int64 __fastcall func12(__int64 a1, __int64 a2)
{
int v2; // eax
unsigned int v3; // edx
int v5; // eax

v2 = func6();
if ( v2 < 0 )
return (unsigned int)-1;
v3 = 0;
if ( !v2 )
{
v5 = func7(a1, a2, 0LL);
if ( v5 >= 0 )
{
if ( v5 )
exit(0);
func9(0LL, 0LL);
execl("/bin/sh", "bin/sh", "-c", a1, 0LL);
diminuto_log_serror("src/diminuto_daemon.c", 475LL, "diminuto_system: execl");
exit(1);
}
exit(1);
}
return v3;
}

original_code:
int diminuto_system(const char * command)
{
    pid_t pid = -1;
    if ((pid = diminuto_daemon_fork()) < 0) {
        return -1;
    } else if (pid == 0) {
    } else {
        return 0;
    }
    if ((pid = diminuto_daemon_refork()) < 0) {
        _exit(1);
    } else if (pid == 0) {
    } else {
        _exit(0);
    }
    diminuto_daemon_sanitize((const char *)0, (const char *)0);
    execl("/bin/sh", "bin/sh", "-c", command, (char *)0);
    diminuto_log_serror("src/diminuto_daemon.c", 475, "diminuto_system: execl");
    _exit(1);
}

canonical_original_code:
int diminuto_system(char *command)
{
    int pid = -1;
    if ((pid = diminuto_daemon_fork()) < 0) {
        return -1;
    } else if (pid == 0) {
    } else {
        return 0;
    }
    if ((pid = diminuto_daemon_refork()) < 0) {
        _exit(1);
    } else if (pid == 0) {
    } else {
        _exit(0);
    }
    diminuto_daemon_sanitize((char *)0, (char *)0);
    execl("/bin/sh", "bin/sh", "-c", command, (char *)0);
    diminuto_log_serror("src/diminuto_daemon.c", 475, "diminuto_system: execl");
    _exit(1);
}

variable_types:
command
char *


decompiled_code:
__int64 diminuto_modulator_frequency()
{
return 10000LL;
}

canonical_decompiled_code:
__int64 func0()
{
return 10000LL;
}

original_code:
static inline diminuto_sticks_t diminuto_modulator_frequency(void)
{
    return (10000LL);
}

canonical_original_code:
static inline long diminuto_modulator_frequency()
{
    return (10000LL);
}

return_type: long


decompiled_code:
__int64 diminuto_frequency()
{
return 1000000000LL;
}

original_code:
static inline diminuto_sticks_t diminuto_frequency(void)
{
    return (1000000000LL);
}

canonical_original_code:
static inline long diminuto_frequency()
{
    return (1000000000LL);
}


decompiled_code:
__int64 __fastcall diminuto_condition_wait(__int64 a1)
{
return diminuto_condition_wait_until(a1, -1LL);
}

canonical_decompiled_code:
__int64 __fastcall func2(__int64 a1)
{
return diminuto_condition_wait_until(a1, -1LL);
}

original_code:
static inline int diminuto_condition_wait(diminuto_condition_t * cp)
{
    return diminuto_condition_wait_until(cp, DIMINUTO_CONDITION_INFINITY);
}

canonical_original_code:
static inline int diminuto_condition_wait(struct DiminutoCondition *cp)
{
    return diminuto_condition_wait_until(cp, DIMINUTO_CONDITION_INFINITY);
}

variable_types: struct DiminutoCondition { struct DiminutoMutex { 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; } mutex; union pthread_mutexattr_t { char __size[4]; int __align; } attribute; } mutex; union pthread_cond_t { struct __pthread_cond_s { union { unsigned long long __wseq; struct { unsigned int __low; unsigned int __high; } __wseq32; }; union { unsigned long long __g1_start; struct { unsigned int __low; unsigned int __high; } __g1_start32; }; unsigned int __g_refs[2]; unsigned int __g_size[2]; unsigned int __g1_orig_size; unsigned int __wrefs; unsigned int __g_signals[2]; } __data; char __size[48]; long long __align; } condition; } *

user_defined_types: struct DiminutoCondition { struct DiminutoMutex mutex; union pthread_cond_t condition; }

user_defined_types: struct DiminutoMutex { union pthread_mutex_t mutex; union pthread_mutexattr_t attribute; }

user_defined_types: union pthread_cond_t { struct __pthread_cond_s __data; char __size[48]; long long __align; }

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:
__int64 __fastcall diminuto_pin_unexport_ignore(unsigned int a1)
{
return diminuto_pin_port_generic(&DIMINUTO_PIN_ROOT_CLASS_GPIO_UNEXPORT, a1, 1LL);
}

canonical_decompiled_code:
__int64 __fastcall func6(unsigned int a1)
{
return diminuto_pin_port_generic(&DIMINUTO_PIN_ROOT_CLASS_GPIO_UNEXPORT, a1, 1LL);
}

original_code:
static inline int diminuto_pin_unexport_ignore(int pin)
{
    return diminuto_pin_port_generic(DIMINUTO_PIN_ROOT_CLASS_GPIO_UNEXPORT, pin, !0);
}

variable_types: pin int


decompiled_code:
__int64 __fastcall diminuto_modulator_flicker(unsigned __int8 a1, unsigned __int8 a2)
{
double v2; // xmm0_8

if ( a1 && a2 )
v2 = ((double)(a1 + a2) / 255.0 + (double)(int)abs32(a2 - a1) / 255.0) * 0.5 * 100.0;
else
v2 = 0.0;
return (unsigned int)(int)v2;
}

canonical_decompiled_code:
__int64 __fastcall func10(unsigned __int8 a1, unsigned __int8 a2)
{
double v2; // xmm0_8

if ( a1 && a2 )
v2 = ((double)(a1 + a2) / 255.0 + (double)(int)abs32(a2 - a1) / 255.0) * 0.5 * 100.0;
else
v2 = 0.0;
return (unsigned int)(int)v2;
}

original_code:
unsigned int diminuto_modulator_flicker(diminuto_modulator_cycle_t on, diminuto_modulator_cycle_t off)
{
    double score = 0.0;
    if (off == 0) {
    } else if (on == 0) {
    } else {
        double accum;
        accum = abs(off - on);
        accum /= 255.0;
        score = accum;
        accum = abs(off + on);
        accum /= 255.0;
        score += accum;
        score /= 2.0;
        score *= 100.0;
    }
    return (unsigned int)score;
}

canonical_original_code:
unsigned int diminuto_modulator_flicker(unsigned char on, unsigned char off)
{
    double score = 0.0;
    if (off == 0) {
    } else if (on == 0) {
    } else {
        double accum;
        accum = abs(off - on);
        accum /= 255.0;
        score = accum;
        accum = abs(off + on);
        accum /= 255.0;
        score += accum;
        score /= 2.0;
        score *= 100.0;
    }
    return (unsigned int)score;
}

variable_types:
on
unsigned char

variable_types:
off
unsigned char

variable_types: score double

variable_types: accum double

return_type: unsigned int


decompiled_code:
__int64 __fastcall diminuto_modulator_factor(unsigned __int8 *a1, unsigned __int8 *a2)
{
char *v4; // rdi
unsigned int v5; // ebx
unsigned __int8 v6; // dl
unsigned __int8 v7; // si
unsigned __int8 v8; // cl
__int16 v9; // ax
__int16 v10; // ax

v4 = (char *)&PRIME_0;
v5 = 0;
do
{
v6 = *v4;
v7 = *a1;
if ( (unsigned __int8)*v4 > *a1 )
break;
v8 = *a2;
if ( v6 > *a2 )
break;
LOBYTE(v9) = v7 / v6;
HIBYTE(v9) = v7 % v6;
if ( (v9 & 0xFF00) == 0 )
{
LOBYTE(v10) = v8 / v6;
HIBYTE(v10) = v8 % v6;
if ( (v10 & 0xFF00) == 0 )
{
*a1 = v7 / v6;
*a2 /= v6;
v5 = 1;
}
}
++v4;
}
while ( v4 != (char *)&PRIME_0 + 6 );
return v5;
}

canonical_decompiled_code:
__int64 __fastcall func11(unsigned __int8 *a1, unsigned __int8 *a2)
{
char *v4; // rdi
unsigned int v5; // ebx
unsigned __int8 v6; // dl
unsigned __int8 v7; // si
unsigned __int8 v8; // cl
__int16 v9; // ax
__int16 v10; // ax

v4 = (char *)&PRIME_0;
v5 = 0;
do
{
v6 = *v4;
v7 = *a1;
if ( (unsigned __int8)*v4 > *a1 )
break;
v8 = *a2;
if ( v6 > *a2 )
break;
LOBYTE(v9) = v7 / v6;
HIBYTE(v9) = v7 % v6;
if ( (v9 & 0xFF00) == 0 )
{
LOBYTE(v10) = v8 / v6;
HIBYTE(v10) = v8 % v6;
if ( (v10 & 0xFF00) == 0 )
{
*a1 = v7 / v6;
*a2 /= v6;
v5 = 1;
}
}
++v4;
}
while ( v4 != (char *)&PRIME_0 + 6 );
return v5;
}

original_code:
int diminuto_modulator_factor(diminuto_modulator_cycle_t * onp, diminuto_modulator_cycle_t * offp) {
    static const diminuto_modulator_cycle_t PRIME[] = { 2, 3, 5, 7, 11, 13, };
    int rc = 0;
    int ii = 0;
    for (ii = 0; ii < (sizeof(PRIME) / sizeof(PRIME[0])); ++ii) {
        if (PRIME[ii] > *onp) {
            break;
        } else if (PRIME[ii] > *offp) {
            break;
        } else if ((*onp % PRIME[ii]) > 0) {
            continue;
        } else if ((*offp % PRIME[ii]) > 0) {
            continue;
        } else {
            *onp /= PRIME[ii];
            *offp /= PRIME[ii];
            rc = !0;
        }
    }
    return rc;
}

canonical_original_code:
int diminuto_modulator_factor(unsigned char *onp, unsigned char *offp) {
    static unsigned char PRIME[] = { 2, 3, 5, 7, 11, 13, };
    int rc = 0;
    int ii = 0;
    for (ii = 0; ii < (sizeof(PRIME) / sizeof(PRIME[0])); ++ii) {
        if (PRIME[ii] > *onp) {
            break;
        } else if (PRIME[ii] > *offp) {
            break;
        } else if ((*onp % PRIME[ii]) > 0) {
            continue;
        } else if ((*offp % PRIME[ii]) > 0) {
            continue;
        } else {
            *onp /= PRIME[ii];
            *offp /= PRIME[ii];
            rc = !0;
        }
    }
    return rc;
}

variable_types:
onp
unsigned char *

variable_types:
offp
unsigned char *

variable_types:
PRIME
unsigned char []

variable_types: ii int


decompiled_code:
__int64 __fastcall diminuto_criticalsection_lock(pthread_mutex_t *a1)
{
unsigned int v1; // ebx

v1 = pthread_mutex_lock(a1);
if ( v1 )
{
*_errno_location() = v1;
diminuto_log_perror("src/diminuto_criticalsection.c", 23LL, "diminuto_criticalsection_lock: pthread_mutex_lock");
v1 = -1;
}
return v1;
}

canonical_decompiled_code:
__int64 __fastcall func0(pthread_mutex_t *a1)
{
unsigned int v1; // ebx

v1 = pthread_mutex_lock(a1);
if ( v1 )
{
*_errno_location() = v1;
diminuto_log_perror("src/diminuto_criticalsection.c", 23LL, "diminuto_criticalsection_lock: pthread_mutex_lock");
v1 = -1;
}
return v1;
}

original_code:
int diminuto_criticalsection_lock(pthread_mutex_t * mp)
{
    int rc = 0;
    if ((rc = pthread_mutex_lock(mp)) != 0) {
        (*__errno_location ()) = rc;
        diminuto_log_perror("src/diminuto_criticalsection.c", 23, "diminuto_criticalsection_lock: pthread_mutex_lock");
        rc = -1;
    }
    return rc;
}

canonical_original_code:
int diminuto_criticalsection_lock(union pthread_mutex_t *mp)
{
    int rc = 0;
    if ((rc = pthread_mutex_lock(mp)) != 0) {
        (*__errno_location ()) = rc;
        diminuto_log_perror("src/diminuto_criticalsection.c", 23, "diminuto_criticalsection_lock: pthread_mutex_lock");
        rc = -1;
    }
    return rc;
}

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: rc int


decompiled_code:
__int64 __fastcall diminuto_criticalsection_trylock(pthread_mutex_t *a1)
{
int v1; // eax
unsigned int v2; // ebx

v1 = pthread_mutex_trylock(a1);
if ( v1 == 16 )
{
*_errno_location() = 16;
v2 = -1;
}
else
{
v2 = v1;
if ( v1 )
{
*_errno_location() = v1;
diminuto_log_perror(
"src/diminuto_criticalsection.c",
39LL,
"diminuto_criticalsection_trylock: pthread_mutex_trylock");
v2 = -1;
}
}
return v2;
}

canonical_decompiled_code:
__int64 __fastcall func1(pthread_mutex_t *a1)
{
int v1; // eax
unsigned int v2; // ebx

v1 = pthread_mutex_trylock(a1);
if ( v1 == 16 )
{
*_errno_location() = 16;
v2 = -1;
}
else
{
v2 = v1;
if ( v1 )
{
*_errno_location() = v1;
diminuto_log_perror(
"src/diminuto_criticalsection.c",
39LL,
"diminuto_criticalsection_trylock: pthread_mutex_trylock");
v2 = -1;
}
}
return v2;
}

original_code:
int diminuto_criticalsection_trylock(pthread_mutex_t * mp)
{
    int rc = 0;
    if ((rc = pthread_mutex_trylock(mp)) == 16) {
        (*__errno_location ()) = rc;
        rc = -1;
    } else if (rc != 0) {
        (*__errno_location ()) = rc;
        diminuto_log_perror("src/diminuto_criticalsection.c", 39, "diminuto_criticalsection_trylock: pthread_mutex_trylock");
        rc = -1;
    } else {
    }
    return rc;
}

canonical_original_code:
int diminuto_criticalsection_trylock(union pthread_mutex_t *mp)
{
    int rc = 0;
    if ((rc = pthread_mutex_trylock(mp)) == 16) {
        (*__errno_location ()) = rc;
        rc = -1;
    } else if (rc != 0) {
        (*__errno_location ()) = rc;
        diminuto_log_perror("src/diminuto_criticalsection.c", 39, "diminuto_criticalsection_trylock: pthread_mutex_trylock");
        rc = -1;
    } else {
    }
    return rc;
}

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


decompiled_code:
int __fastcall diminuto_criticalsection_cleanup(pthread_mutex_t *a1)
{
int result; // eax

result = pthread_mutex_unlock(a1);
if ( result )
{
*_errno_location() = result;
result = diminuto_log_perror(
"src/diminuto_criticalsection.c",
55LL,
"diminuto_criticalsection_cleanup: pthread_mutex_unlock");
}
return result;
}

canonical_decompiled_code:
int __fastcall func2(pthread_mutex_t *a1)
{
int result; // eax

result = pthread_mutex_unlock(a1);
if ( result )
{
*_errno_location() = result;
result = diminuto_log_perror(
"src/diminuto_criticalsection.c",
55LL,
"diminuto_criticalsection_cleanup: pthread_mutex_unlock");
}
return result;
}

original_code:
void diminuto_criticalsection_cleanup(void * vp)
{
    int rc = 0;
    pthread_mutex_t * mutexp = (pthread_mutex_t *)vp;
    if ((rc = pthread_mutex_unlock(mutexp)) != 0) {
        (*__errno_location ()) = rc;
        diminuto_log_perror("src/diminuto_criticalsection.c", 55, "diminuto_criticalsection_cleanup: pthread_mutex_unlock");
    }
}

canonical_original_code:
void diminuto_criticalsection_cleanup(void *vp)
{
    int rc = 0;
    union pthread_mutex_t *mutexp = (pthread_mutex_t *)vp;
    if ((rc = pthread_mutex_unlock(mutexp)) != 0) {
        (*__errno_location ()) = rc;
        diminuto_log_perror("src/diminuto_criticalsection.c", 55, "diminuto_criticalsection_cleanup: pthread_mutex_unlock");
    }
}

variable_types:
vp
void *


decompiled_code:
int __fastcall diminuto_ipcl_compare(const char *a1, const char *a2)
{
if ( !a1 )
return 0x80000000;
if ( a2 )
return strncmp(a1, a2, 0x1000uLL);
return 0x7FFFFFFF;
}

canonical_decompiled_code:
int __fastcall func1(const char *a1, const char *a2)
{
if ( !a1 )
return 0x80000000;
if ( a2 )
return strncmp(a1, a2, 0x1000uLL);
return 0x7FFFFFFF;
}

original_code:
int diminuto_ipcl_compare(const char * path1p, const char * path2p)
{
    return (path1p == (const char *)0)
        ? (((int)1) << ((sizeof(int) * 8) - 1))
        : (path2p == (const char *)0)
            ? (~(((int)1) << ((sizeof(int) * 8) - 1)))
            : strncmp(path1p, path2p, sizeof(diminuto_path_t));
}

canonical_original_code:
int diminuto_ipcl_compare(char *path1p, char *path2p)
{
    return (path1p == (char *)0)
        ? (((int)1) << ((sizeof(int) * 8) - 1))
        : (path2p == (char *)0)
            ? (~(((int)1) << ((sizeof(int) * 8) - 1)))
            : strncmp(path1p, path2p, sizeof(diminuto_path_t));
}


decompiled_code:
__int64 __fastcall diminuto_ipcl_identify(__int64 a1, char *a2, size_t a3)
{
__int64 result; // rax

if ( *(_WORD *)a1 != 1 )
return 0xFFFFFFFFLL;
result = 0LL;
if ( a2 )
{
*a2 = 0;
strncpy(a2, (const char *)(a1 + 2), a3);
a2[a3 - 1] = 0;
result = 0LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func2(__int64 a1, char *a2, size_t a3)
{
__int64 result; // rax

if ( *(_WORD *)a1 != 1 )
return 0xFFFFFFFFLL;
result = 0LL;
if ( a2 )
{
*a2 = 0;
strncpy(a2, (const char *)(a1 + 2), a3);
a2[a3 - 1] = 0;
result = 0LL;
}
return result;
}

original_code:
int diminuto_ipcl_identify(struct sockaddr * sap, char * pathp, size_t size)
{
    int rc = 0;
    if (sap->sa_family != 1) {
        rc = -1;
    } else if (pathp == (char *)0) {
    } else {
        pathp[0] = '\0';
        (void)strncpy(pathp, ((struct sockaddr_un *)sap)->sun_path, size);
        pathp[size - 1] = '\0';
    }
    return rc;
}

canonical_original_code:
int diminuto_ipcl_identify(struct sockaddr *sap, char *pathp, unsigned long size)
{
    int rc = 0;
    if (sap->sa_family != 1) {
        rc = -1;
    } else if (pathp == (char *)0) {
    } else {
        pathp[0] = '\0';
        (void)strncpy(pathp, ((struct sockaddr_un *)sap)->sun_path, size);
        pathp[size - 1] = '\0';
    }
    return rc;
}

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

variable_types:
pathp
char *

variable_types:
size
unsigned long

user_defined_types: struct sockaddr_un { unsigned short sun_family; char sun_path[108]; }


decompiled_code:
char *__fastcall diminuto_ipcl_path(_BYTE *a1, char *a2, size_t a3)
{
char *result; // rax
int v5; // edx
size_t v6; // rax
char v7; // [rsp+1h] [rbp-129h]
__int64 v8[2]; // [rsp+2h] [rbp-128h] BYREF
char v9[280]; // [rsp+12h] [rbp-118h] BYREF

v8[0] = 0LL;
v8[1] = 0LL;
memset(v9, 0, 0xF0uLL);
v9[240] = 0;
if ( a3 )
{
if ( *a1 )
{
v5 = diminuto_fs_canonicalize(a1, v8, 257LL);
result = 0LL;
if ( v5 >= 0 )
{
v6 = strlen((const char *)v8);
if ( v6 <= 1 )
{
*_errno_location() = 22;
diminuto_log_perror("src/diminuto_ipcl.c", 114LL, a1);
result = 0LL;
}
else if ( *(&v7 + v6) == 47 )
{
*_errno_location() = 22;
diminuto_log_perror("src/diminuto_ipcl.c", 118LL, a1);
result = 0LL;
}
else if ( a3 <= v6 )
{
*_errno_location() = 36;
diminuto_log_perror("src/diminuto_ipcl.c", 122LL, a1);
result = 0LL;
}
else
{
*a2 = 0;
result = strncpy(a2, (const char *)v8, a3);
a2[a3 - 1] = 0;
}
}
}
else
{
*a2 = 0;
result = a2;
}
}
else
{
*_errno_location() = 36;
diminuto_log_perror("src/diminuto_ipcl.c", 104LL, a1);
result = 0LL;
}
return result;
}

canonical_decompiled_code:
char *__fastcall func3(_BYTE *a1, char *a2, size_t a3)
{
char *result; // rax
int v5; // edx
size_t v6; // rax
char v7; // [rsp+1h] [rbp-129h]
__int64 v8[2]; // [rsp+2h] [rbp-128h] BYREF
char v9[280]; // [rsp+12h] [rbp-118h] BYREF

v8[0] = 0LL;
v8[1] = 0LL;
memset(v9, 0, 0xF0uLL);
v9[240] = 0;
if ( a3 )
{
if ( *a1 )
{
v5 = diminuto_fs_canonicalize(a1, v8, 257LL);
result = 0LL;
if ( v5 >= 0 )
{
v6 = strlen((const char *)v8);
if ( v6 <= 1 )
{
*_errno_location() = 22;
diminuto_log_perror("src/diminuto_ipcl.c", 114LL, a1);
result = 0LL;
}
else if ( *(&v7 + v6) == 47 )
{
*_errno_location() = 22;
diminuto_log_perror("src/diminuto_ipcl.c", 118LL, a1);
result = 0LL;
}
else if ( a3 <= v6 )
{
*_errno_location() = 36;
diminuto_log_perror("src/diminuto_ipcl.c", 122LL, a1);
result = 0LL;
}
else
{
*a2 = 0;
result = strncpy(a2, (const char *)v8, a3);
a2[a3 - 1] = 0;
}
}
}
else
{
*a2 = 0;
result = a2;
}
}
else
{
*_errno_location() = 36;
diminuto_log_perror("src/diminuto_ipcl.c", 104LL, a1);
result = 0LL;
}
return result;
}

original_code:
char * diminuto_ipcl_path(const char * path, char * buffer, size_t size)
{
    char * result = (char *)0;
    diminuto_local_t canonical = { '\0', };
    size_t length = 0;
    if (size <= 0) {
        (*__errno_location ()) = 36;
        diminuto_log_perror("src/diminuto_ipcl.c", 104, path);
    } else if (path[0] == '\0') {
        buffer[0] = '\0';
        result = buffer;
    } else if (diminuto_fs_canonicalize(path, canonical, sizeof(canonical)) < 0) {
    } else if ((length = strlen(canonical)) < 2) {
        (*__errno_location ()) = 22;
        diminuto_log_perror("src/diminuto_ipcl.c", 114, path);
    } else if (canonical[length - 1] == '/') {
        (*__errno_location ()) = 22;
        diminuto_log_perror("src/diminuto_ipcl.c", 118, path);
    } else if (length >= size) {
        (*__errno_location ()) = 36;
        diminuto_log_perror("src/diminuto_ipcl.c", 122, path);
    } else {
        buffer[0] = '\0';
        (void)strncpy(buffer, canonical, size);
        buffer[size - 1] = '\0';
        result = buffer;
    }
    return result;
}

canonical_original_code:
char *diminuto_ipcl_path(char *path, char *buffer, unsigned long size)
{
    char *result = (char *)0;
    char canonical[-1] = { '\0', };
    unsigned long length = 0;
    if (size <= 0) {
        (*__errno_location ()) = 36;
        diminuto_log_perror("src/diminuto_ipcl.c", 104, path);
    } else if (path[0] == '\0') {
        buffer[0] = '\0';
        result = buffer;
    } else if (diminuto_fs_canonicalize(path, canonical, sizeof(canonical)) < 0) {
    } else if ((length = strlen(canonical)) < 2) {
        (*__errno_location ()) = 22;
        diminuto_log_perror("src/diminuto_ipcl.c", 114, path);
    } else if (canonical[length - 1] == '/') {
        (*__errno_location ()) = 22;
        diminuto_log_perror("src/diminuto_ipcl.c", 118, path);
    } else if (length >= size) {
        (*__errno_location ()) = 36;
        diminuto_log_perror("src/diminuto_ipcl.c", 122, path);
    } else {
        buffer[0] = '\0';
        (void)strncpy(buffer, canonical, size);
        buffer[size - 1] = '\0';
        result = buffer;
    }
    return result;
}

variable_types:
path
char *

variable_types:
buffer
char *

variable_types:
result
char *

variable_types:
canonical
char [-1]

variable_types:
length
unsigned long


decompiled_code:
__int64 __fastcall diminuto_ipcl_nearend(int fd, char *a2, size_t a3)
{
int v4; // ebx
socklen_t len; // [rsp+Ch] [rbp-8Ch] BYREF
struct sockaddr addr; // [rsp+10h] [rbp-88h] BYREF
int v8; // [rsp+78h] [rbp-20h]
__int16 v9; // [rsp+7Ch] [rbp-1Ch]

memset(&addr, 0, 0x68uLL);
v8 = 0;
v9 = 0;
len = 110;
v4 = getsockname(fd, &addr, &len);
if ( v4 < 0 )
diminuto_log_perror("src/diminuto_ipcl.c", 144LL, "diminuto_ipcl_nearend: getsockname");
else
diminuto_ipcl_identify((__int64)&addr, a2, a3);
return (unsigned int)v4;
}

canonical_decompiled_code:
__int64 __fastcall func5(int fd, char *a2, size_t a3)
{
int v4; // ebx
socklen_t len; // [rsp+Ch] [rbp-8Ch] BYREF
struct sockaddr addr; // [rsp+10h] [rbp-88h] BYREF
int v8; // [rsp+78h] [rbp-20h]
__int16 v9; // [rsp+7Ch] [rbp-1Ch]

memset(&addr, 0, 0x68uLL);
v8 = 0;
v9 = 0;
len = 110;
v4 = getsockname(fd, &addr, &len);
if ( v4 < 0 )
diminuto_log_perror("src/diminuto_ipcl.c", 144LL, "diminuto_ipcl_nearend: getsockname");
else
func2((__int64)&addr, a2, a3);
return (unsigned int)v4;
}

original_code:
int diminuto_ipcl_nearend(int fd, char * pathp, size_t psize)
{
    int rc = -1;
    struct sockaddr_un sa = { 0, };
    socklen_t length = sizeof(sa);
    if ((rc = getsockname(fd, (struct sockaddr *)&sa, &length)) < 0) {
        diminuto_log_perror("src/diminuto_ipcl.c", 144, "diminuto_ipcl_nearend: getsockname");
    } else {
        diminuto_ipcl_identify((struct sockaddr *)&sa, pathp, psize);
    }
    return rc;
}

canonical_original_code:
int diminuto_ipcl_nearend(int fd, char *pathp, unsigned long psize)
{
    int rc = -1;
    struct sockaddr_un sa = { 0, };
    unsigned int length = sizeof(sa);
    if ((rc = getsockname(fd, (struct sockaddr *)&sa, &length)) < 0) {
        diminuto_log_perror("src/diminuto_ipcl.c", 144, "diminuto_ipcl_nearend: getsockname");
    } else {
        diminuto_ipcl_identify((struct sockaddr *)&sa, pathp, psize);
    }
    return rc;
}

variable_types: fd int

variable_types:
psize
unsigned long

variable_types: struct sockaddr_un { unsigned short sun_family; char sun_path[108]; }

variable_types:
length
unsigned int

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


decompiled_code:
__int64 __fastcall diminuto_ipcl_farend(int fd, char *a2, size_t a3)
{
int v4; // ebx
socklen_t len; // [rsp+Ch] [rbp-8Ch] BYREF
struct sockaddr addr; // [rsp+10h] [rbp-88h] BYREF
int v8; // [rsp+78h] [rbp-20h]
__int16 v9; // [rsp+7Ch] [rbp-1Ch]

memset(&addr, 0, 0x68uLL);
v8 = 0;
v9 = 0;
len = 110;
v4 = getpeername(fd, &addr, &len);
if ( v4 < 0 )
diminuto_log_perror("src/diminuto_ipcl.c", 159LL, "diminuto_ipcl_farend: getpeername");
else
diminuto_ipcl_identify((__int64)&addr, a2, a3);
return (unsigned int)v4;
}

canonical_decompiled_code:
__int64 __fastcall func6(int fd, char *a2, size_t a3)
{
int v4; // ebx
socklen_t len; // [rsp+Ch] [rbp-8Ch] BYREF
struct sockaddr addr; // [rsp+10h] [rbp-88h] BYREF
int v8; // [rsp+78h] [rbp-20h]
__int16 v9; // [rsp+7Ch] [rbp-1Ch]

memset(&addr, 0, 0x68uLL);
v8 = 0;
v9 = 0;
len = 110;
v4 = getpeername(fd, &addr, &len);
if ( v4 < 0 )
diminuto_log_perror("src/diminuto_ipcl.c", 159LL, "diminuto_ipcl_farend: getpeername");
else
func2((__int64)&addr, a2, a3);
return (unsigned int)v4;
}

original_code:
int diminuto_ipcl_farend(int fd, char * pathp, size_t psize)
{
    int rc = -1;
    struct sockaddr_un sa = { 0 };
    socklen_t length = sizeof(sa);
    if ((rc = getpeername(fd, (struct sockaddr *)&sa, &length)) < 0) {
        diminuto_log_perror("src/diminuto_ipcl.c", 159, "diminuto_ipcl_farend: getpeername");
    } else {
        diminuto_ipcl_identify((struct sockaddr *)&sa, pathp, psize);
    }
    return rc;
}

canonical_original_code:
int diminuto_ipcl_farend(int fd, char *pathp, unsigned long psize)
{
    int rc = -1;
    struct sockaddr_un sa = { 0 };
    unsigned int length = sizeof(sa);
    if ((rc = getpeername(fd, (struct sockaddr *)&sa, &length)) < 0) {
        diminuto_log_perror("src/diminuto_ipcl.c", 159, "diminuto_ipcl_farend: getpeername");
    } else {
        diminuto_ipcl_identify((struct sockaddr *)&sa, pathp, psize);
    }
    return rc;
}


decompiled_code:
__int64 __fastcall diminuto_ipcl_source(int fd, const char *a2)
{
int v2; // ebx
_BYTE v4[104]; // [rsp+0h] [rbp-88h] BYREF
int v5; // [rsp+68h] [rbp-20h]
__int16 v6; // [rsp+6Ch] [rbp-1Ch]

v2 = fd;
memset(v4, 0, sizeof(v4));
v5 = 0;
v6 = 0;
if ( a2 )
{
if ( *a2 )
{
*(_WORD *)v4 = 1;
strncpy(&v4[2], a2, 0x6CuLL);
v2 = bind(fd, (const struct sockaddr *)v4, 0x6Eu);
if ( v2 < 0 )
diminuto_log_perror("src/diminuto_ipcl.c", 202LL, "diminuto_ipcl_source: bind");
}
}
else
{
*_errno_location() = 22;
diminuto_log_perror("src/diminuto_ipcl.c", &loc_BD, "diminuto_ipcl_source: NULL");
v2 = -1;
}
return (unsigned int)v2;
}

canonical_decompiled_code:
__int64 __fastcall func7(int fd, const char *a2)
{
int v2; // ebx
_BYTE v4[104]; // [rsp+0h] [rbp-88h] BYREF
int v5; // [rsp+68h] [rbp-20h]
__int16 v6; // [rsp+6Ch] [rbp-1Ch]

v2 = fd;
memset(v4, 0, sizeof(v4));
v5 = 0;
v6 = 0;
if ( a2 )
{
if ( *a2 )
{
*(_WORD *)v4 = 1;
strncpy(&v4[2], a2, 0x6CuLL);
v2 = bind(fd, (const struct sockaddr *)v4, 0x6Eu);
if ( v2 < 0 )
diminuto_log_perror("src/diminuto_ipcl.c", 202LL, "diminuto_ipcl_source: bind");
}
}
else
{
*_errno_location() = 22;
diminuto_log_perror("src/diminuto_ipcl.c", &loc_BD, "diminuto_ipcl_source: NULL");
v2 = -1;
}
return (unsigned int)v2;
}

original_code:
int diminuto_ipcl_source(int fd, const char * path)
{
    int rc = fd;
    struct sockaddr_un sa = { 0 };
    socklen_t length = sizeof(sa);
    if (path == (const char *)0) {
        (*__errno_location ()) = 22;
        diminuto_log_perror("src/diminuto_ipcl.c", 189, "diminuto_ipcl_source: NULL");
        rc = -1;
    } else if (path[0] == '\0') {
    } else {
        sa.sun_family = 1;
        (void)strncpy(sa.sun_path, path, sizeof(sa.sun_path));
        if ((rc = bind(fd, (struct sockaddr *)&sa, length)) < 0) {
            diminuto_log_perror("src/diminuto_ipcl.c", 202, "diminuto_ipcl_source: bind");
        }
    }
    return rc;
}

canonical_original_code:
int diminuto_ipcl_source(int fd, char *path)
{
    int rc = fd;
    struct sockaddr_un sa = { 0 };
    unsigned int length = sizeof(sa);
    if (path == (char *)0) {
        (*__errno_location ()) = 22;
        diminuto_log_perror("src/diminuto_ipcl.c", 189, "diminuto_ipcl_source: NULL");
        rc = -1;
    } else if (path[0] == '\0') {
    } else {
        sa.sun_family = 1;
        (void)strncpy(sa.sun_path, path, sizeof(sa.sun_path));
        if ((rc = bind(fd, (struct sockaddr *)&sa, length)) < 0) {
            diminuto_log_perror("src/diminuto_ipcl.c", 202, "diminuto_ipcl_source: bind");
        }
    }
    return rc;
}


decompiled_code:
__int64 __fastcall diminuto_ipcl_remove(const char *a1)
{
__int64 result; // rax

if ( a1 )
{
if ( unlink(a1) < 0 )
{
diminuto_log_perror("src/diminuto_ipcl.c", 228LL, "diminuto_ipcl_remove: unlink");
result = 0xFFFFFFFFLL;
}
else
{
result = 0LL;
}
}
else
{
*_errno_location() = 22;
diminuto_log_perror("src/diminuto_ipcl.c", 223LL, "diminuto_ipcl_remove: NULL");
result = 0xFFFFFFFFLL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func8(const char *a1)
{
__int64 result; // rax

if ( a1 )
{
if ( unlink(a1) < 0 )
{
diminuto_log_perror("src/diminuto_ipcl.c", 228LL, "diminuto_ipcl_remove: unlink");
result = 0xFFFFFFFFLL;
}
else
{
result = 0LL;
}
}
else
{
*_errno_location() = 22;
diminuto_log_perror("src/diminuto_ipcl.c", 223LL, "diminuto_ipcl_remove: NULL");
result = 0xFFFFFFFFLL;
}
return result;
}

original_code:
int diminuto_ipcl_remove(const char * path)
{
    int rc = 0;
    if (path == (const char *)0) {
        (*__errno_location ()) = 22;
        diminuto_log_perror("src/diminuto_ipcl.c", 223, "diminuto_ipcl_remove: NULL");
        rc = -1;
    } else if (unlink(path) < 0) {
        diminuto_log_perror("src/diminuto_ipcl.c", 228, "diminuto_ipcl_remove: unlink");
        rc = -1;
    } else {
    }
    return rc;
}

canonical_original_code:
int diminuto_ipcl_remove(char *path)
{
    int rc = 0;
    if (path == (char *)0) {
        (*__errno_location ()) = 22;
        diminuto_log_perror("src/diminuto_ipcl.c", 223, "diminuto_ipcl_remove: NULL");
        rc = -1;
    } else if (unlink(path) < 0) {
        diminuto_log_perror("src/diminuto_ipcl.c", 228, "diminuto_ipcl_remove: unlink");
        rc = -1;
    } else {
    }
    return rc;
}


decompiled_code:
__int64 __fastcall diminuto_ipcl_stream_provider_base(const char *a1, unsigned int a2, __int64 (__fastcall *a3)(_QWORD, __int64), __int64 a4)
{
int v4; // ebp
int v7; // eax
unsigned int v8; // ebx
int v9; // er12
int v10; // er12
int v11; // ebp

v4 = a2;
if ( a2 >= 0x81 )
v4 = 128;
v7 = socket(1, 1, 0);
v8 = v7;
if ( v7 < 0 )
{
diminuto_log_perror("src/diminuto_ipcl.c", 258LL, "diminuto_ipcl_stream_provider_base: socket");
}
else if ( a3 && (v9 = a3((unsigned int)v7, a4), v9 < 0) )
{
diminuto_log_perror("src/diminuto_ipcl.c", 260LL, "diminuto_ipcl_stream_provider_base: injector");
diminuto_ipcl_close(v8);
v8 = v9;
}
else
{
v10 = diminuto_ipcl_source(v8, a1);
if ( v10 < 0 )
{
diminuto_ipcl_close(v8);
v8 = v10;
}
else
{
v11 = listen(v8, v4);
if ( v11 < 0 )
{
diminuto_log_perror("src/diminuto_ipcl.c", 265LL, "diminuto_ipcl_stream_provider_base: listen");
diminuto_ipcl_close(v8);
v8 = v11;
}
}
}
return v8;
}

canonical_decompiled_code:
__int64 __fastcall func9(const char *a1, unsigned int a2, __int64 (__fastcall *a3)(_QWORD, __int64), __int64 a4)
{
int v4; // ebp
int v7; // eax
unsigned int v8; // ebx
int v9; // er12
int v10; // er12
int v11; // ebp

v4 = a2;
if ( a2 >= 0x81 )
v4 = 128;
v7 = socket(1, 1, 0);
v8 = v7;
if ( v7 < 0 )
{
diminuto_log_perror("src/diminuto_ipcl.c", 258LL, "diminuto_ipcl_stream_provider_base: socket");
}
else if ( a3 && (v9 = a3((unsigned int)v7, a4), v9 < 0) )
{
diminuto_log_perror("src/diminuto_ipcl.c", 260LL, "diminuto_ipcl_stream_provider_base: injector");
func0(v8);
v8 = v9;
}
else
{
v10 = func7(v8, a1);
if ( v10 < 0 )
{
func0(v8);
v8 = v10;
}
else
{
v11 = listen(v8, v4);
if ( v11 < 0 )
{
diminuto_log_perror("src/diminuto_ipcl.c", 265LL, "diminuto_ipcl_stream_provider_base: listen");
func0(v8);
v8 = v11;
}
}
}
return v8;
}

original_code:
int diminuto_ipcl_stream_provider_base(const char * path, int backlog, diminuto_ipc_injector_t * functionp, void * datap)
{
    int rc = -1;
    int fd = -1;
    if (backlog > 128) {
        backlog = 128;
    } else if (backlog < 0) {
        backlog = 128;
    } else {
    }
    if ((rc = fd = socket(1, SOCK_STREAM, 0)) < 0) {
        diminuto_log_perror("src/diminuto_ipcl.c", 258, "diminuto_ipcl_stream_provider_base: socket");
    } else if ((functionp != (diminuto_ipc_injector_t *)0) && ((rc = (*functionp)(fd, datap)) < 0)) {
        diminuto_log_perror("src/diminuto_ipcl.c", 260, "diminuto_ipcl_stream_provider_base: injector");
        diminuto_ipcl_close(fd);
    } else if ((rc = diminuto_ipcl_source(fd, path)) < 0) {
        diminuto_ipcl_close(fd);
    } else if ((rc = listen(fd, backlog)) < 0) {
        diminuto_log_perror("src/diminuto_ipcl.c", 265, "diminuto_ipcl_stream_provider_base: listen");
        diminuto_ipcl_close(fd);
    } else {
    }
    return (rc < 0) ? rc : fd;
}

canonical_original_code:
int diminuto_ipcl_stream_provider_base(char *path, int backlog, int (*functionp)(int fd, void *), void *datap)
{
    int rc = -1;
    int fd = -1;
    if (backlog > 128) {
        backlog = 128;
    } else if (backlog < 0) {
        backlog = 128;
    } else {
    }
    if ((rc = fd = socket(1, SOCK_STREAM, 0)) < 0) {
        diminuto_log_perror("src/diminuto_ipcl.c", 258, "diminuto_ipcl_stream_provider_base: socket");
    } else if ((functionp != (int (*)(int fd, void *))0) && ((rc = (*functionp)(fd, datap)) < 0)) {
        diminuto_log_perror("src/diminuto_ipcl.c", 260, "diminuto_ipcl_stream_provider_base: injector");
        diminuto_ipcl_close(fd);
    } else if ((rc = diminuto_ipcl_source(fd, path)) < 0) {
        diminuto_ipcl_close(fd);
    } else if ((rc = listen(fd, backlog)) < 0) {
        diminuto_log_perror("src/diminuto_ipcl.c", 265, "diminuto_ipcl_stream_provider_base: listen");
        diminuto_ipcl_close(fd);
    } else {
    }
    return (rc < 0) ? rc : fd;
}

variable_types: backlog int

variable_types:
functionp
int (*)(int fd, void *)

variable_types:
datap
void *


decompiled_code:
__int64 __fastcall diminuto_ipcl_stream_accept_generic(int fd, char *a2, size_t a3)
{
int v4; // ebx
socklen_t addr_len; // [rsp+Ch] [rbp-8Ch] BYREF
struct sockaddr addr; // [rsp+10h] [rbp-88h] BYREF
int v8; // [rsp+78h] [rbp-20h]
__int16 v9; // [rsp+7Ch] [rbp-1Ch]

memset(&addr, 0, 0x68uLL);
v8 = 0;
v9 = 0;
addr_len = 110;
v4 = accept(fd, &addr, &addr_len);
if ( v4 >= 0 )
{
diminuto_ipcl_identify((__int64)&addr, a2, a3);
}
else if ( *_errno_location() != 4 )
{
diminuto_log_perror("src/diminuto_ipcl.c", 285LL, "diminuto_ipcl_accept_generic: accept");
}
return (unsigned int)v4;
}

canonical_decompiled_code:
__int64 __fastcall func10(int fd, char *a2, size_t a3)
{
int v4; // ebx
socklen_t addr_len; // [rsp+Ch] [rbp-8Ch] BYREF
struct sockaddr addr; // [rsp+10h] [rbp-88h] BYREF
int v8; // [rsp+78h] [rbp-20h]
__int16 v9; // [rsp+7Ch] [rbp-1Ch]

memset(&addr, 0, 0x68uLL);
v8 = 0;
v9 = 0;
addr_len = 110;
v4 = accept(fd, &addr, &addr_len);
if ( v4 >= 0 )
{
func2((__int64)&addr, a2, a3);
}
else if ( *_errno_location() != 4 )
{
diminuto_log_perror("src/diminuto_ipcl.c", 285LL, "diminuto_ipcl_accept_generic: accept");
}
return (unsigned int)v4;
}

original_code:
int diminuto_ipcl_stream_accept_generic(int fd, char * pathp, size_t psize)
{
    int rc = -1;
    struct sockaddr_un sa = { 0 };
    socklen_t length = sizeof(sa);
    if ((rc = accept(fd, (struct sockaddr *)&sa, &length)) >= 0) {
        diminuto_ipcl_identify((struct sockaddr *)&sa, pathp, psize);
    } else if ((*__errno_location ()) == 4) {
    } else {
        diminuto_log_perror("src/diminuto_ipcl.c", 285, "diminuto_ipcl_accept_generic: accept");
    }
    return rc;
}

canonical_original_code:
int diminuto_ipcl_stream_accept_generic(int fd, char *pathp, unsigned long psize)
{
    int rc = -1;
    struct sockaddr_un sa = { 0 };
    unsigned int length = sizeof(sa);
    if ((rc = accept(fd, (struct sockaddr *)&sa, &length)) >= 0) {
        diminuto_ipcl_identify((struct sockaddr *)&sa, pathp, psize);
    } else if ((*__errno_location ()) == 4) {
    } else {
        diminuto_log_perror("src/diminuto_ipcl.c", 285, "diminuto_ipcl_accept_generic: accept");
    }
    return rc;
}

variable_types: rc int


decompiled_code:
__int64 __fastcall diminuto_ipcl_stream_consumer_base(char *src, const char *a2, __int64 (__fastcall *a3)(_QWORD, __int64), __int64 a4)
{
int v6; // eax
unsigned int v7; // ebx
int v8; // ebp
int v9; // ebp
int v10; // ebp
struct sockaddr v12[9]; // [rsp+0h] [rbp-98h] BYREF

v12[0].sa_family = 1;
strncpy(v12[0].sa_data, src, 0x6CuLL);
v6 = socket(1, 1, 0);
v7 = v6;
if ( v6 < 0 )
{
diminuto_log_perror("src/diminuto_ipcl.c", 302LL, "diminuto_ipcl_stream_consumer_base: socket");
}
else if ( a3 && (v8 = a3((unsigned int)v6, a4), v8 < 0) )
{
diminuto_log_perror("src/diminuto_ipcl.c", 304LL, "diminuto_ipcl_stream_consumer_base: injector");
diminuto_ipcl_close(v7);
v7 = v8;
}
else
{
v9 = diminuto_ipcl_source(v7, a2);
if ( v9 < 0 )
{
diminuto_ipcl_close(v7);
v7 = v9;
}
else
{
v10 = connect(v7, v12, 0x6Eu);
if ( v10 < 0 )
{
if ( *_errno_location() != 4 )
diminuto_log_perror("src/diminuto_ipcl.c", 313LL, "diminuto_ipcl_stream_consumer_base: connect");
diminuto_ipcl_close(v7);
v7 = v10;
}
}
}
return v7;
}

canonical_decompiled_code:
__int64 __fastcall func11(char *src, const char *a2, __int64 (__fastcall *a3)(_QWORD, __int64), __int64 a4)
{
int v6; // eax
unsigned int v7; // ebx
int v8; // ebp
int v9; // ebp
int v10; // ebp
struct sockaddr v12[9]; // [rsp+0h] [rbp-98h] BYREF

v12[0].sa_family = 1;
strncpy(v12[0].sa_data, src, 0x6CuLL);
v6 = socket(1, 1, 0);
v7 = v6;
if ( v6 < 0 )
{
diminuto_log_perror("src/diminuto_ipcl.c", 302LL, "diminuto_ipcl_stream_consumer_base: socket");
}
else if ( a3 && (v8 = a3((unsigned int)v6, a4), v8 < 0) )
{
diminuto_log_perror("src/diminuto_ipcl.c", 304LL, "diminuto_ipcl_stream_consumer_base: injector");
func0(v7);
v7 = v8;
}
else
{
v9 = func7(v7, a2);
if ( v9 < 0 )
{
func0(v7);
v7 = v9;
}
else
{
v10 = connect(v7, v12, 0x6Eu);
if ( v10 < 0 )
{
if ( *_errno_location() != 4 )
diminuto_log_perror("src/diminuto_ipcl.c", 313LL, "diminuto_ipcl_stream_consumer_base: connect");
func0(v7);
v7 = v10;
}
}
}
return v7;
}

original_code:
int diminuto_ipcl_stream_consumer_base(const char * path, const char * path0, diminuto_ipc_injector_t * functionp, void * datap)
{
    int rc = -1;
    int fd = -1;
    struct sockaddr_un sa = { 0 };
    socklen_t length = sizeof(sa);
    sa.sun_family = 1;
    (void)strncpy(sa.sun_path, path, sizeof(sa.sun_path));
    if ((rc = fd = socket(1, SOCK_STREAM, 0)) < 0) {
        diminuto_log_perror("src/diminuto_ipcl.c", 302, "diminuto_ipcl_stream_consumer_base: socket");
    } else if ((functionp != (diminuto_ipc_injector_t *)0) && ((rc = (*functionp)(fd, datap)) < 0)) {
        diminuto_log_perror("src/diminuto_ipcl.c", 304, "diminuto_ipcl_stream_consumer_base: injector");
        diminuto_ipcl_close(fd);
    } else if ((rc = diminuto_ipcl_source(fd, path0)) < 0) {
        diminuto_ipcl_close(fd);
    } else if ((rc = connect(fd, (struct sockaddr *)&sa, length)) >= 0) {
    } else if ((*__errno_location ()) == 4) {
        diminuto_ipcl_close(fd);
    } else {
        diminuto_log_perror("src/diminuto_ipcl.c", 313, "diminuto_ipcl_stream_consumer_base: connect");
        diminuto_ipcl_close(fd);
    }
    return (rc < 0) ? rc : fd;
}

canonical_original_code:
int diminuto_ipcl_stream_consumer_base(char *path, char *path0, int (*functionp)(int fd, void *), void *datap)
{
    int rc = -1;
    int fd = -1;
    struct sockaddr_un sa = { 0 };
    unsigned int length = sizeof(sa);
    sa.sun_family = 1;
    (void)strncpy(sa.sun_path, path, sizeof(sa.sun_path));
    if ((rc = fd = socket(1, SOCK_STREAM, 0)) < 0) {
        diminuto_log_perror("src/diminuto_ipcl.c", 302, "diminuto_ipcl_stream_consumer_base: socket");
    } else if ((functionp != (int (*)(int fd, void *))0) && ((rc = (*functionp)(fd, datap)) < 0)) {
        diminuto_log_perror("src/diminuto_ipcl.c", 304, "diminuto_ipcl_stream_consumer_base: injector");
        diminuto_ipcl_close(fd);
    } else if ((rc = diminuto_ipcl_source(fd, path0)) < 0) {
        diminuto_ipcl_close(fd);
    } else if ((rc = connect(fd, (struct sockaddr *)&sa, length)) >= 0) {
    } else if ((*__errno_location ()) == 4) {
        diminuto_ipcl_close(fd);
    } else {
        diminuto_log_perror("src/diminuto_ipcl.c", 313, "diminuto_ipcl_stream_consumer_base: connect");
        diminuto_ipcl_close(fd);
    }
    return (rc < 0) ? rc : fd;
}


decompiled_code:
__int64 __fastcall diminuto_ipcl_datagram_peer_base(const char *a1, __int64 (__fastcall *a2)(_QWORD, __int64), __int64 a3)
{
int v4; // eax
unsigned int v5; // ebx
int v6; // ebp
int v7; // ebp

v4 = socket(1, 2, 0);
v5 = v4;
if ( v4 < 0 )
{
diminuto_log_perror("src/diminuto_ipcl.c", 330LL, "diminuto_ipcl_datagram_peer_base: socket");
}
else if ( a2 && (v6 = a2((unsigned int)v4, a3), v6 < 0) )
{
diminuto_log_perror("src/diminuto_ipcl.c", 332LL, "diminuto_ipcl_datagram_peer_base: injector");
diminuto_ipcl_close(v5);
v5 = v6;
}
else
{
v7 = diminuto_ipcl_source(v5, a1);
if ( v7 < 0 )
{
diminuto_ipcl_close(v5);
v5 = v7;
}
}
return v5;
}

canonical_decompiled_code:
__int64 __fastcall func12(const char *a1, __int64 (__fastcall *a2)(_QWORD, __int64), __int64 a3)
{
int v4; // eax
unsigned int v5; // ebx
int v6; // ebp
int v7; // ebp

v4 = socket(1, 2, 0);
v5 = v4;
if ( v4 < 0 )
{
diminuto_log_perror("src/diminuto_ipcl.c", 330LL, "diminuto_ipcl_datagram_peer_base: socket");
}
else if ( a2 && (v6 = a2((unsigned int)v4, a3), v6 < 0) )
{
diminuto_log_perror("src/diminuto_ipcl.c", 332LL, "diminuto_ipcl_datagram_peer_base: injector");
func0(v5);
v5 = v6;
}
else
{
v7 = func7(v5, a1);
if ( v7 < 0 )
{
func0(v5);
v5 = v7;
}
}
return v5;
}

original_code:
int diminuto_ipcl_datagram_peer_base(const char * path, diminuto_ipc_injector_t * functionp, void * datap)
{
    int rc = -1;
    int fd = -1;
    if ((rc = fd = socket(1, SOCK_DGRAM, 0)) < 0) {
        diminuto_log_perror("src/diminuto_ipcl.c", 330, "diminuto_ipcl_datagram_peer_base: socket");
    } else if ((functionp != (diminuto_ipc_injector_t *)0) && ((rc = (*functionp)(fd, datap)) < 0)) {
        diminuto_log_perror("src/diminuto_ipcl.c", 332, "diminuto_ipcl_datagram_peer_base: injector");
        diminuto_ipcl_close(fd);
    } else if ((rc = diminuto_ipcl_source(fd, path)) < 0) {
        diminuto_ipcl_close(fd);
    } else {
    }
    return (rc < 0) ? rc : fd;
}

canonical_original_code:
int diminuto_ipcl_datagram_peer_base(char *path, int (*functionp)(int fd, void *), void *datap)
{
    int rc = -1;
    int fd = -1;
    if ((rc = fd = socket(1, SOCK_DGRAM, 0)) < 0) {
        diminuto_log_perror("src/diminuto_ipcl.c", 330, "diminuto_ipcl_datagram_peer_base: socket");
    } else if ((functionp != (int (*)(int fd, void *))0) && ((rc = (*functionp)(fd, datap)) < 0)) {
        diminuto_log_perror("src/diminuto_ipcl.c", 332, "diminuto_ipcl_datagram_peer_base: injector");
        diminuto_ipcl_close(fd);
    } else if ((rc = diminuto_ipcl_source(fd, path)) < 0) {
        diminuto_ipcl_close(fd);
    } else {
    }
    return (rc < 0) ? rc : fd;
}


decompiled_code:
ssize_t __fastcall diminuto_ipcl_datagram_receive_generic(int fd, void *a2, size_t a3, char *a4, size_t a5, int a6)
{
ssize_t v8; // rax
ssize_t v9; // rbx
int v10; // eax
socklen_t addr_len; // [rsp+Ch] [rbp-8Ch] BYREF
struct sockaddr addr; // [rsp+10h] [rbp-88h] BYREF
int v14; // [rsp+78h] [rbp-20h]
__int16 v15; // [rsp+7Ch] [rbp-1Ch]

memset(&addr, 0, 0x68uLL);
v14 = 0;
v15 = 0;
addr_len = 110;
v8 = recvfrom(fd, a2, a3, a6, &addr, &addr_len);
v9 = v8;
if ( v8 > 0 )
{
diminuto_ipcl_identify((__int64)&addr, a4, a5);
}
else if ( v8 )
{
v10 = *_errno_location();
if ( v10 != 11 && v10 != 4 )
diminuto_log_perror("src/diminuto_ipcl.c", 360LL, "diminuto_ipcl_datagram_receive_generic: recvfrom");
}
return v9;
}

canonical_decompiled_code:
ssize_t __fastcall func13(int fd, void *a2, size_t a3, char *a4, size_t a5, int a6)
{
ssize_t v8; // rax
ssize_t v9; // rbx
int v10; // eax
socklen_t addr_len; // [rsp+Ch] [rbp-8Ch] BYREF
struct sockaddr addr; // [rsp+10h] [rbp-88h] BYREF
int v14; // [rsp+78h] [rbp-20h]
__int16 v15; // [rsp+7Ch] [rbp-1Ch]

memset(&addr, 0, 0x68uLL);
v14 = 0;
v15 = 0;
addr_len = 110;
v8 = recvfrom(fd, a2, a3, a6, &addr, &addr_len);
v9 = v8;
if ( v8 > 0 )
{
func2((__int64)&addr, a4, a5);
}
else if ( v8 )
{
v10 = *_errno_location();
if ( v10 != 11 && v10 != 4 )
diminuto_log_perror("src/diminuto_ipcl.c", 360LL, "diminuto_ipcl_datagram_receive_generic: recvfrom");
}
return v9;
}

original_code:
ssize_t diminuto_ipcl_datagram_receive_generic(int fd, void * buffer, size_t size, char * pathp, size_t psize, int flags)
{
    ssize_t total = -1;
    struct sockaddr_un sa = { 0 };
    socklen_t length = sizeof(sa);
    if ((total = recvfrom(fd, buffer, size, flags, (struct sockaddr *)&sa, &length)) > 0) {
        diminuto_ipcl_identify((struct sockaddr *)&sa, pathp, psize);
    } else if (total == 0) {
    } else if ((*__errno_location ()) == 4) {
    } else if ((*__errno_location ()) == 11) {
    } else if ((*__errno_location ()) == 11) {
    } else {
        diminuto_log_perror("src/diminuto_ipcl.c", 360, "diminuto_ipcl_datagram_receive_generic: recvfrom");
    }
    return total;
}

canonical_original_code:
long diminuto_ipcl_datagram_receive_generic(int fd, void *buffer, unsigned long size, char *pathp, unsigned long psize, int flags)
{
    long total = -1;
    struct sockaddr_un sa = { 0 };
    unsigned int length = sizeof(sa);
    if ((total = recvfrom(fd, buffer, size, flags, (struct sockaddr *)&sa, &length)) > 0) {
        diminuto_ipcl_identify((struct sockaddr *)&sa, pathp, psize);
    } else if (total == 0) {
    } else if ((*__errno_location ()) == 4) {
    } else if ((*__errno_location ()) == 11) {
    } else if ((*__errno_location ()) == 11) {
    } else {
        diminuto_log_perror("src/diminuto_ipcl.c", 360, "diminuto_ipcl_datagram_receive_generic: recvfrom");
    }
    return total;
}

variable_types:
buffer
void *

variable_types: flags int

variable_types: total long


decompiled_code:
ssize_t __fastcall diminuto_ipcl_datagram_send_generic(int fd, void *buf, size_t n, struct sockaddr *addr, int flags)
{
struct sockaddr *v7; // rsi
socklen_t v9; // er9
ssize_t v10; // rbx
int v12; // eax
__int16 v13[52]; // [rsp+0h] [rbp-98h] BYREF
int v14; // [rsp+68h] [rbp-30h]
__int16 v15; // [rsp+6Ch] [rbp-2Ch]

v7 = addr;
memset(v13, 0, sizeof(v13));
v14 = 0;
v15 = 0;
v9 = 0;
if ( addr )
{
v13[0] = 1;
strncpy((char *)&v13[1], (const char *)addr, 0x6CuLL);
v9 = 110;
v7 = (struct sockaddr *)v13;
}
v10 = sendto(fd, buf, n, flags, v7, v9);
if ( v10 < 0 )
{
v12 = *_errno_location();
if ( v12 != 11 && v12 != 4 )
diminuto_log_perror("src/diminuto_ipcl.c", 391LL, "diminuto_ipcl_datagram_send_generic: sendto");
}
return v10;
}

canonical_decompiled_code:
ssize_t __fastcall func14(int fd, void *buf, size_t n, struct sockaddr *addr, int flags)
{
struct sockaddr *v7; // rsi
socklen_t v9; // er9
ssize_t v10; // rbx
int v12; // eax
__int16 v13[52]; // [rsp+0h] [rbp-98h] BYREF
int v14; // [rsp+68h] [rbp-30h]
__int16 v15; // [rsp+6Ch] [rbp-2Ch]

v7 = addr;
memset(v13, 0, sizeof(v13));
v14 = 0;
v15 = 0;
v9 = 0;
if ( addr )
{
v13[0] = 1;
strncpy((char *)&v13[1], (const char *)addr, 0x6CuLL);
v9 = 110;
v7 = (struct sockaddr *)v13;
}
v10 = sendto(fd, buf, n, flags, v7, v9);
if ( v10 < 0 )
{
v12 = *_errno_location();
if ( v12 != 11 && v12 != 4 )
diminuto_log_perror("src/diminuto_ipcl.c", 391LL, "diminuto_ipcl_datagram_send_generic: sendto");
}
return v10;
}

original_code:
ssize_t diminuto_ipcl_datagram_send_generic(int fd, const void * buffer, size_t size, const char * path, int flags)
{
    ssize_t total = -1;
    struct sockaddr_un sa = { 0, };
    struct sockaddr * sap = (struct sockaddr *)0;
    socklen_t length = 0;
    if (path != (const char *)0) {
        length = sizeof(sa);
        sa.sun_family = 1;
        (void)strncpy(sa.sun_path, path, sizeof(sa.sun_path));
        sap = (struct sockaddr *)&sa;
    }
    if ((total = sendto(fd, buffer, size, flags, sap, length)) > 0) {
    } else if (total == 0) {
    } else if ((*__errno_location ()) == 4) {
    } else if ((*__errno_location ()) == 11) {
    } else if ((*__errno_location ()) == 11) {
    } else {
        diminuto_log_perror("src/diminuto_ipcl.c", 391, "diminuto_ipcl_datagram_send_generic: sendto");
    }
    return total;
}

canonical_original_code:
long diminuto_ipcl_datagram_send_generic(int fd, void *buffer, unsigned long size, char *path, int flags)
{
    long total = -1;
    struct sockaddr_un sa = { 0, };
    struct sockaddr *sap = (struct sockaddr *)0;
    unsigned int length = 0;
    if (path != (char *)0) {
        length = sizeof(sa);
        sa.sun_family = 1;
        (void)strncpy(sa.sun_path, path, sizeof(sa.sun_path));
        sap = (struct sockaddr *)&sa;
    }
    if ((total = sendto(fd, buffer, size, flags, sap, length)) > 0) {
    } else if (total == 0) {
    } else if ((*__errno_location ()) == 4) {
    } else if ((*__errno_location ()) == 11) {
    } else if ((*__errno_location ()) == 11) {
    } else {
        diminuto_log_perror("src/diminuto_ipcl.c", 391, "diminuto_ipcl_datagram_send_generic: sendto");
    }
    return total;
}

variable_types:
size
unsigned long

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


decompiled_code:
__int64 __fastcall diminuto_ipcl_packet_provider_base(const char *a1, unsigned int a2, __int64 (__fastcall *a3)(_QWORD, __int64), __int64 a4)
{
int v4; // ebp
int v7; // eax
unsigned int v8; // ebx
int v9; // er12
int v10; // er12
int v11; // ebp

v4 = a2;
if ( a2 >= 0x81 )
v4 = 128;
v7 = socket(1, 5, 0);
v8 = v7;
if ( v7 < 0 )
{
diminuto_log_perror("src/diminuto_ipcl.c", 415LL, "diminuto_ipcl_packet_provider_base: socket");
}
else if ( a3 && (v9 = a3((unsigned int)v7, a4), v9 < 0) )
{
diminuto_log_perror("src/diminuto_ipcl.c", 417LL, "diminuto_ipcl_packet_provider_base: injector");
diminuto_ipcl_close(v8);
v8 = v9;
}
else
{
v10 = diminuto_ipcl_source(v8, a1);
if ( v10 < 0 )
{
diminuto_ipcl_close(v8);
v8 = v10;
}
else
{
v11 = listen(v8, v4);
if ( v11 < 0 )
{
diminuto_log_perror("src/diminuto_ipcl.c", 422LL, "diminuto_ipcl_packet_provider_base: listen");
diminuto_ipcl_close(v8);
v8 = v11;
}
}
}
return v8;
}

canonical_decompiled_code:
__int64 __fastcall func15(const char *a1, unsigned int a2, __int64 (__fastcall *a3)(_QWORD, __int64), __int64 a4)
{
int v4; // ebp
int v7; // eax
unsigned int v8; // ebx
int v9; // er12
int v10; // er12
int v11; // ebp

v4 = a2;
if ( a2 >= 0x81 )
v4 = 128;
v7 = socket(1, 5, 0);
v8 = v7;
if ( v7 < 0 )
{
diminuto_log_perror("src/diminuto_ipcl.c", 415LL, "diminuto_ipcl_packet_provider_base: socket");
}
else if ( a3 && (v9 = a3((unsigned int)v7, a4), v9 < 0) )
{
diminuto_log_perror("src/diminuto_ipcl.c", 417LL, "diminuto_ipcl_packet_provider_base: injector");
func0(v8);
v8 = v9;
}
else
{
v10 = func7(v8, a1);
if ( v10 < 0 )
{
func0(v8);
v8 = v10;
}
else
{
v11 = listen(v8, v4);
if ( v11 < 0 )
{
diminuto_log_perror("src/diminuto_ipcl.c", 422LL, "diminuto_ipcl_packet_provider_base: listen");
func0(v8);
v8 = v11;
}
}
}
return v8;
}

original_code:
int diminuto_ipcl_packet_provider_base(const char * path, int backlog, diminuto_ipc_injector_t * functionp, void * datap)
{
    int rc = -1;
    int fd = -1;
    if (backlog > 128) {
        backlog = 128;
    } else if (backlog < 0) {
        backlog = 128;
    } else {
    }
    if ((rc = fd = socket(1, SOCK_SEQPACKET, 0)) < 0) {
        diminuto_log_perror("src/diminuto_ipcl.c", 415, "diminuto_ipcl_packet_provider_base: socket");
    } else if ((functionp != (diminuto_ipc_injector_t *)0) && ((rc = (*functionp)(fd, datap)) < 0)) {
        diminuto_log_perror("src/diminuto_ipcl.c", 417, "diminuto_ipcl_packet_provider_base: injector");
        diminuto_ipcl_close(fd);
    } else if ((rc = diminuto_ipcl_source(fd, path)) < 0) {
        diminuto_ipcl_close(fd);
    } else if ((rc = listen(fd, backlog)) < 0) {
        diminuto_log_perror("src/diminuto_ipcl.c", 422, "diminuto_ipcl_packet_provider_base: listen");
        diminuto_ipcl_close(fd);
    } else {
    }
    return (rc < 0) ? rc : fd;
}

canonical_original_code:
int diminuto_ipcl_packet_provider_base(char *path, int backlog, int (*functionp)(int fd, void *), void *datap)
{
    int rc = -1;
    int fd = -1;
    if (backlog > 128) {
        backlog = 128;
    } else if (backlog < 0) {
        backlog = 128;
    } else {
    }
    if ((rc = fd = socket(1, SOCK_SEQPACKET, 0)) < 0) {
        diminuto_log_perror("src/diminuto_ipcl.c", 415, "diminuto_ipcl_packet_provider_base: socket");
    } else if ((functionp != (int (*)(int fd, void *))0) && ((rc = (*functionp)(fd, datap)) < 0)) {
        diminuto_log_perror("src/diminuto_ipcl.c", 417, "diminuto_ipcl_packet_provider_base: injector");
        diminuto_ipcl_close(fd);
    } else if ((rc = diminuto_ipcl_source(fd, path)) < 0) {
        diminuto_ipcl_close(fd);
    } else if ((rc = listen(fd, backlog)) < 0) {
        diminuto_log_perror("src/diminuto_ipcl.c", 422, "diminuto_ipcl_packet_provider_base: listen");
        diminuto_ipcl_close(fd);
    } else {
    }
    return (rc < 0) ? rc : fd;
}

variable_types:
path
char *


decompiled_code:
__int64 __fastcall diminuto_ipcl_packet_consumer_base(char *src, const char *a2, __int64 (__fastcall *a3)(_QWORD, __int64), __int64 a4)
{
int v6; // eax
unsigned int v7; // ebx
int v8; // ebp
int v9; // ebp
int v10; // ebp
struct sockaddr v12[9]; // [rsp+0h] [rbp-98h] BYREF

v12[0].sa_family = 1;
strncpy(v12[0].sa_data, src, 0x6CuLL);
v6 = socket(1, 5, 0);
v7 = v6;
if ( v6 < 0 )
{
diminuto_log_perror("src/diminuto_ipcl.c", 442LL, "diminuto_ipcl_packet_consumer_base: socket");
}
else if ( a3 && (v8 = a3((unsigned int)v6, a4), v8 < 0) )
{
diminuto_log_perror("src/diminuto_ipcl.c", 444LL, "diminuto_ipcl_packet_consumer_base: injector");
diminuto_ipcl_close(v7);
v7 = v8;
}
else
{
v9 = diminuto_ipcl_source(v7, a2);
if ( v9 < 0 )
{
diminuto_ipcl_close(v7);
v7 = v9;
}
else
{
v10 = connect(v7, v12, 0x6Eu);
if ( v10 < 0 )
{
if ( *_errno_location() != 4 )
diminuto_log_perror("src/diminuto_ipcl.c", 453LL, "diminuto_ipcl_stream_consumer_base: connect");
diminuto_ipcl_close(v7);
v7 = v10;
}
}
}
return v7;
}

canonical_decompiled_code:
__int64 __fastcall func16(char *src, const char *a2, __int64 (__fastcall *a3)(_QWORD, __int64), __int64 a4)
{
int v6; // eax
unsigned int v7; // ebx
int v8; // ebp
int v9; // ebp
int v10; // ebp
struct sockaddr v12[9]; // [rsp+0h] [rbp-98h] BYREF

v12[0].sa_family = 1;
strncpy(v12[0].sa_data, src, 0x6CuLL);
v6 = socket(1, 5, 0);
v7 = v6;
if ( v6 < 0 )
{
diminuto_log_perror("src/diminuto_ipcl.c", 442LL, "diminuto_ipcl_packet_consumer_base: socket");
}
else if ( a3 && (v8 = a3((unsigned int)v6, a4), v8 < 0) )
{
diminuto_log_perror("src/diminuto_ipcl.c", 444LL, "diminuto_ipcl_packet_consumer_base: injector");
func0(v7);
v7 = v8;
}
else
{
v9 = func7(v7, a2);
if ( v9 < 0 )
{
func0(v7);
v7 = v9;
}
else
{
v10 = connect(v7, v12, 0x6Eu);
if ( v10 < 0 )
{
if ( *_errno_location() != 4 )
diminuto_log_perror("src/diminuto_ipcl.c", 453LL, "diminuto_ipcl_stream_consumer_base: connect");
func0(v7);
v7 = v10;
}
}
}
return v7;
}

original_code:
int diminuto_ipcl_packet_consumer_base(const char * path, const char * path0, diminuto_ipc_injector_t * functionp, void * datap)
{
    int rc = -1;
    int fd = -1;
    struct sockaddr_un sa = { 0 };
    socklen_t length = sizeof(sa);
    sa.sun_family = 1;
    (void)strncpy(sa.sun_path, path, sizeof(sa.sun_path));
    if ((rc = fd = socket(1, SOCK_SEQPACKET, 0)) < 0) {
        diminuto_log_perror("src/diminuto_ipcl.c", 442, "diminuto_ipcl_packet_consumer_base: socket");
    } else if ((functionp != (diminuto_ipc_injector_t *)0) && ((rc = (*functionp)(fd, datap)) < 0)) {
        diminuto_log_perror("src/diminuto_ipcl.c", 444, "diminuto_ipcl_packet_consumer_base: injector");
        diminuto_ipcl_close(fd);
    } else if ((rc = diminuto_ipcl_source(fd, path0)) < 0) {
        diminuto_ipcl_close(fd);
    } else if ((rc = connect(fd, (struct sockaddr *)&sa, length)) >= 0) {
    } else if ((*__errno_location ()) == 4) {
        diminuto_ipcl_close(fd);
    } else {
        diminuto_log_perror("src/diminuto_ipcl.c", 453, "diminuto_ipcl_stream_consumer_base: connect");
        diminuto_ipcl_close(fd);
    }
    return (rc < 0) ? rc : fd;
}

canonical_original_code:
int diminuto_ipcl_packet_consumer_base(char *path, char *path0, int (*functionp)(int fd, void *), void *datap)
{
    int rc = -1;
    int fd = -1;
    struct sockaddr_un sa = { 0 };
    unsigned int length = sizeof(sa);
    sa.sun_family = 1;
    (void)strncpy(sa.sun_path, path, sizeof(sa.sun_path));
    if ((rc = fd = socket(1, SOCK_SEQPACKET, 0)) < 0) {
        diminuto_log_perror("src/diminuto_ipcl.c", 442, "diminuto_ipcl_packet_consumer_base: socket");
    } else if ((functionp != (int (*)(int fd, void *))0) && ((rc = (*functionp)(fd, datap)) < 0)) {
        diminuto_log_perror("src/diminuto_ipcl.c", 444, "diminuto_ipcl_packet_consumer_base: injector");
        diminuto_ipcl_close(fd);
    } else if ((rc = diminuto_ipcl_source(fd, path0)) < 0) {
        diminuto_ipcl_close(fd);
    } else if ((rc = connect(fd, (struct sockaddr *)&sa, length)) >= 0) {
    } else if ((*__errno_location ()) == 4) {
        diminuto_ipcl_close(fd);
    } else {
        diminuto_log_perror("src/diminuto_ipcl.c", 453, "diminuto_ipcl_stream_consumer_base: connect");
        diminuto_ipcl_close(fd);
    }
    return (rc < 0) ? rc : fd;
}


decompiled_code:
_BOOL8 __fastcall diminuto_store_ismissing(__int64 a1)
{
return a1 == 0;
}

canonical_decompiled_code:
_BOOL8 __fastcall func0(__int64 a1)
{
return a1 == 0;
}

original_code:
static inline int diminuto_store_ismissing(const diminuto_store_t * nodep)
{
    return (nodep == ((diminuto_store_t *)0));
}

canonical_original_code:
static inline int diminuto_store_ismissing(struct DiminutoStore *nodep)
{
    return (nodep == ((struct DiminutoStore *)0));
}

variable_types: struct DiminutoStore { struct DiminutoTree { struct DiminutoTree *parent; struct DiminutoTree *left; struct DiminutoTree *right; struct DiminutoTree **root; void *data; unsigned long color; unsigned long error; } tree; void *key; void *value; } *

user_defined_types: struct DiminutoStore { struct DiminutoTree tree; void *key; void *value; }


decompiled_code:
__int64 __fastcall diminuto_store_upcast(__int64 a1)
{
bool v1; // zf
__int64 result; // rax

v1 = !diminuto_store_ismissing(a1);
result = 0LL;
if ( v1 )
result = a1;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func1(__int64 a1)
{
bool v1; // zf
__int64 result; // rax

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

original_code:
static inline diminuto_tree_t * diminuto_store_upcast(const diminuto_store_t * pointer)
{
    return diminuto_store_ismissing(pointer) ? ((diminuto_tree_t *)0) : (diminuto_tree_t *)&(pointer->tree);
}

canonical_original_code:
static inline struct DiminutoTree *diminuto_store_upcast(struct DiminutoStore *pointer)
{
    return diminuto_store_ismissing(pointer) ? ((struct DiminutoTree *)0) : (struct DiminutoTree *)&(pointer->tree);
}

variable_types: struct DiminutoStore { struct DiminutoTree tree; void *key; void *value; } *

return_type: struct DiminutoTree { struct DiminutoTree *parent; struct DiminutoTree *left; struct DiminutoTree *right; struct DiminutoTree **root; void *data; unsigned long color; unsigned long error; } *


decompiled_code:
__int64 __fastcall diminuto_store_log(const void **a1)
{
__int64 v1; // rax

if ( !a1 )
return diminuto_log_emit("diminuto_store_t@%p[%zu]\n", 0LL, 0x40uLL);
diminuto_log_emit("diminuto_store_t@%p[%zu]: { key=%p value=%p }\n", a1, 0x40uLL, a1[6], a1[7]);
v1 = diminuto_store_upcast((__int64)a1);
return diminuto_tree_log(v1);
}

canonical_decompiled_code:
__int64 __fastcall func2(const void **a1)
{
__int64 v1; // rax

if ( !a1 )
return diminuto_log_emit("diminuto_store_t@%p[%zu]\n", 0LL, 0x40uLL);
diminuto_log_emit("diminuto_store_t@%p[%zu]: { key=%p value=%p }\n", a1, 0x40uLL, a1[6], a1[7]);
v1 = func1((__int64)a1);
return diminuto_tree_log(v1);
}

original_code:
void diminuto_store_log(diminuto_store_t * nodep)
{
    if (nodep) {
        diminuto_log_emit("diminuto_store_t@%p[%zu]: { key=%p value=%p }\n", nodep, sizeof(*nodep), nodep->key, nodep->value);
        diminuto_tree_log(diminuto_store_upcast(nodep));
    } else {
        diminuto_log_emit("diminuto_store_t@%p[%zu]\n", nodep, sizeof(*nodep));
    }
}

canonical_original_code:
void diminuto_store_log(struct DiminutoStore *nodep)
{
    if (nodep) {
        diminuto_log_emit("diminuto_store_t@%p[%zu]: { key=%p value=%p }\n", nodep, sizeof(*nodep), nodep->key, nodep->value);
        diminuto_tree_log(diminuto_store_upcast(nodep));
    } else {
        diminuto_log_emit("diminuto_store_t@%p[%zu]\n", nodep, sizeof(*nodep));
    }
}

user_defined_types: struct DiminutoTree { struct DiminutoTree *parent; struct DiminutoTree *left; struct DiminutoTree *right; struct DiminutoTree **root; void *data; unsigned long color; unsigned long error; }


decompiled_code:
_BOOL8 __fastcall diminuto_throttle_emptied(__int64 a1)
{
return (*(_BYTE *)(a1 + 48) & 0x30) == 16;
}

original_code:
static inline int diminuto_throttle_emptied(const diminuto_throttle_t * throttlep)
{
    return (throttlep->empty1 != 0) && (throttlep->empty2 == 0);
}

canonical_original_code:
static inline int diminuto_throttle_emptied(struct DiminutoThrottle *throttlep)
{
    return (throttlep->empty1 != 0) && (throttlep->empty2 == 0);
}

variable_types: struct DiminutoThrottle { unsigned long now; unsigned long then; unsigned long increment; unsigned long limit; unsigned long expected; unsigned long actual; unsigned long full0; unsigned long full1; unsigned long full2; unsigned long empty0; unsigned long empty1; unsigned long empty2; unsigned long alarmed1; unsigned long alarmed2; } *


decompiled_code:
_BOOL8 __fastcall diminuto_throttle_filled(__int64 a1)
{
return (*(_BYTE *)(a1 + 48) & 6) == 2;
}

original_code:
static inline int diminuto_throttle_filled(const diminuto_throttle_t * throttlep)
{
    return (throttlep->full1 != 0) && (throttlep->full2 == 0);
}

canonical_original_code:
static inline int diminuto_throttle_filled(struct DiminutoThrottle *throttlep)
{
    return (throttlep->full1 != 0) && (throttlep->full2 == 0);
}

user_defined_types: struct DiminutoThrottle { unsigned long now; unsigned long then; unsigned long increment; unsigned long limit; unsigned long expected; unsigned long actual; unsigned long full0; unsigned long full1; unsigned long full2; unsigned long empty0; unsigned long empty1; unsigned long empty2; unsigned long alarmed1; unsigned long alarmed2; }


decompiled_code:
__int64 __fastcall diminuto_throttle_interarrivaltime(unsigned __int64 a1, unsigned __int64 a2, unsigned __int64 a3)
{
unsigned __int64 v3; // rcx
__int64 result; // rax

v3 = a3;
if ( a2 > 1 )
v3 = a2 * a3;
result = v3;
if ( a1 > 1 )
{
if ( v3 % a1 )
result = v3 / a1 + 1;
else
result = v3 / a1;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func2(unsigned __int64 a1, unsigned __int64 a2, unsigned __int64 a3)
{
unsigned __int64 v3; // rcx
__int64 result; // rax

v3 = a3;
if ( a2 > 1 )
v3 = a2 * a3;
result = v3;
if ( a1 > 1 )
{
if ( v3 % a1 )
result = v3 / a1 + 1;
else
result = v3 / a1;
}
return result;
}

original_code:
diminuto_ticks_t diminuto_throttle_interarrivaltime(size_t numerator, size_t denominator, diminuto_ticks_t frequency)
{
    diminuto_ticks_t increment = 0;
    increment = frequency;
    if (denominator > 1) {
        increment *= denominator;
    }
    if (numerator <= 1) {
    } else if ((increment % numerator) > 0) {
        increment /= numerator;
        increment += 1;
    } else {
        increment /= numerator;
    }
    return increment;
}

canonical_original_code:
unsigned long diminuto_throttle_interarrivaltime(unsigned long numerator, unsigned long denominator, unsigned long frequency)
{
    unsigned long increment = 0;
    increment = frequency;
    if (denominator > 1) {
        increment *= denominator;
    }
    if (numerator <= 1) {
    } else if ((increment % numerator) > 0) {
        increment /= numerator;
        increment += 1;
    } else {
        increment /= numerator;
    }
    return increment;
}

variable_types:
numerator
unsigned long

variable_types:
denominator
unsigned long

variable_types:
frequency
unsigned long

variable_types:
increment
unsigned long

return_type: unsigned long


decompiled_code:
__int64 __fastcall diminuto_throttle_jittertolerance(__int64 a1, unsigned __int64 a2)
{
__int64 result; // rax

result = 0LL;
if ( a2 > 1 )
result = a1 * (a2 - 1);
return result;
}

canonical_decompiled_code:
__int64 __fastcall func3(__int64 a1, unsigned __int64 a2)
{
__int64 result; // rax

result = 0LL;
if ( a2 > 1 )
result = a1 * (a2 - 1);
return result;
}

original_code:
diminuto_ticks_t diminuto_throttle_jittertolerance(diminuto_ticks_t increment, size_t maximumburstsize)
{
    diminuto_ticks_t limit = 0;
    if (maximumburstsize > 1) {
        limit = maximumburstsize - 1;
        limit *= increment;
    }
    return limit;
}

canonical_original_code:
unsigned long diminuto_throttle_jittertolerance(unsigned long increment, unsigned long maximumburstsize)
{
    unsigned long limit = 0;
    if (maximumburstsize > 1) {
        limit = maximumburstsize - 1;
        limit *= increment;
    }
    return limit;
}

variable_types:
maximumburstsize
unsigned long

variable_types:
limit
unsigned long


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

result = a1;
*(_QWORD *)a1 = a2;
*(_QWORD *)(a1 + 8) = a2 - *(_QWORD *)(a1 + 16);
*(_QWORD *)(a1 + 32) = 0LL;
*(_QWORD *)(a1 + 40) = 0LL;
*(_BYTE *)(a1 + 48) = 56;
return result;
}

original_code:
diminuto_throttle_t * diminuto_throttle_reset(diminuto_throttle_t * throttlep, diminuto_ticks_t now)
{
    throttlep->now = now;
    throttlep->then = now - throttlep->increment;
    throttlep->expected = 0;
    throttlep->actual = 0;
    throttlep->full0 = throttlep->full1 = throttlep->full2 = 0;
    throttlep->empty0 = throttlep->empty1 = throttlep->empty2 = !0;
    throttlep->alarmed1 = throttlep->alarmed2 = 0;
    return throttlep;
}

canonical_original_code:
struct DiminutoThrottle *diminuto_throttle_reset(struct DiminutoThrottle *throttlep, unsigned long now)
{
    throttlep->now = now;
    throttlep->then = now - throttlep->increment;
    throttlep->expected = 0;
    throttlep->actual = 0;
    throttlep->full0 = throttlep->full1 = throttlep->full2 = 0;
    throttlep->empty0 = throttlep->empty1 = throttlep->empty2 = !0;
    throttlep->alarmed1 = throttlep->alarmed2 = 0;
    return throttlep;
}

variable_types:
throttlep
struct DiminutoThrottle *

variable_types:
now
unsigned long

return_type: struct DiminutoThrottle { unsigned long now; unsigned long then; unsigned long increment; unsigned long limit; unsigned long expected; unsigned long actual; unsigned long full0; unsigned long full1; unsigned long full2; unsigned long empty0; unsigned long empty1; unsigned long empty2; unsigned long alarmed1; unsigned long alarmed2; } *


decompiled_code:
__int64 __fastcall diminuto_throttle_init(__int64 a1, __int64 a2, __int64 a3, __int64 a4)
{
*(_QWORD *)(a1 + 16) = a2;
*(_QWORD *)(a1 + 24) = a3;
return diminuto_throttle_reset(a1, a4);
}

original_code:
diminuto_throttle_t * diminuto_throttle_init(diminuto_throttle_t * throttlep, diminuto_ticks_t increment, diminuto_ticks_t limit, diminuto_ticks_t now)
{
    throttlep->increment = increment;
    throttlep->limit = limit;
    return diminuto_throttle_reset(throttlep, now);
}

canonical_original_code:
struct DiminutoThrottle *diminuto_throttle_init(struct DiminutoThrottle *throttlep, unsigned long increment, unsigned long limit, unsigned long now)
{
    throttlep->increment = increment;
    throttlep->limit = limit;
    return diminuto_throttle_reset(throttlep, now);
}


decompiled_code:
unsigned __int64 __fastcall diminuto_throttle_request(__int64 a1, __int64 a2)
{
__int64 v2; // rax
unsigned __int64 v3; // rdx
unsigned __int64 result; // rax
unsigned __int64 v5; // rax
unsigned __int64 v6; // rcx

*(_QWORD *)a1 = a2;
v2 = *(_QWORD *)(a1 + 8);
v3 = *(_QWORD *)(a1 + 32);
if ( v3 > a2 - v2 )
{
v5 = v3 + v2 - a2;
*(_QWORD *)(a1 + 40) = v5;
v6 = *(_QWORD *)(a1 + 24);
if ( v5 > v6 )
{
*(_BYTE *)(a1 + 48) = (*(_BYTE *)(a1 + 48) | 1) & 0xF7;
result = v5 - v6;
}
else
{
*(_BYTE *)(a1 + 48) &= 0xF6u;
result = 0LL;
}
}
else
{
*(_QWORD *)(a1 + 40) = 0LL;
*(_BYTE *)(a1 + 48) = *(_BYTE *)(a1 + 48) & 0xFE | 8;
result = 0LL;
}
return result;
}

original_code:
diminuto_ticks_t diminuto_throttle_request(diminuto_throttle_t * throttlep, diminuto_ticks_t now)
{
    diminuto_ticks_t delay = 0;
    diminuto_ticks_t elapsed = 0;
    elapsed = (throttlep->now = now) - throttlep->then;
    if (throttlep->expected <= elapsed) {
        throttlep->actual = 0;
        throttlep->full0 = 0;
        throttlep->empty0 = !0;
        delay = 0;
    } else if ((throttlep->actual = throttlep->expected - elapsed) <= throttlep->limit) {
        throttlep->full0 = 0;
        throttlep->empty0 = 0;
        delay = 0;
    } else {
        throttlep->full0 = !0;
        throttlep->empty0 = 0;
        delay = throttlep->actual - throttlep->limit;
    }
    return delay;
}

canonical_original_code:
unsigned long diminuto_throttle_request(struct DiminutoThrottle *throttlep, unsigned long now)
{
    unsigned long delay = 0;
    unsigned long elapsed = 0;
    elapsed = (throttlep->now = now) - throttlep->then;
    if (throttlep->expected <= elapsed) {
        throttlep->actual = 0;
        throttlep->full0 = 0;
        throttlep->empty0 = !0;
        delay = 0;
    } else if ((throttlep->actual = throttlep->expected - elapsed) <= throttlep->limit) {
        throttlep->full0 = 0;
        throttlep->empty0 = 0;
        delay = 0;
    } else {
        throttlep->full0 = !0;
        throttlep->empty0 = 0;
        delay = throttlep->actual - throttlep->limit;
    }
    return delay;
}

variable_types:
delay
unsigned long

variable_types:
elapsed
unsigned long


original_code:
int diminuto_throttle_commitn(diminuto_throttle_t * throttlep, size_t events)
{
    throttlep->then = throttlep->now;
    throttlep->expected = throttlep->actual + (events * throttlep->increment);
    throttlep->full2 = throttlep->full1;
    throttlep->full1 = throttlep->full0;
    throttlep->empty2 = throttlep->empty1;
    throttlep->empty1 = throttlep->empty0;
    throttlep->alarmed2 = throttlep->alarmed1;
    if (diminuto_throttle_emptied(throttlep)) {
        throttlep->alarmed1 = 0;
    } else if (diminuto_throttle_filled(throttlep)) {
        throttlep->alarmed1 = !0;
    } else {
    }
    return throttlep->alarmed1;
}

canonical_original_code:
int diminuto_throttle_commitn(struct DiminutoThrottle *throttlep, unsigned long events)
{
    throttlep->then = throttlep->now;
    throttlep->expected = throttlep->actual + (events * throttlep->increment);
    throttlep->full2 = throttlep->full1;
    throttlep->full1 = throttlep->full0;
    throttlep->empty2 = throttlep->empty1;
    throttlep->empty1 = throttlep->empty0;
    throttlep->alarmed2 = throttlep->alarmed1;
    if (diminuto_throttle_emptied(throttlep)) {
        throttlep->alarmed1 = 0;
    } else if (diminuto_throttle_filled(throttlep)) {
        throttlep->alarmed1 = !0;
    } else {
    }
    return throttlep->alarmed1;
}

variable_types:
events
unsigned long


original_code:
void diminuto_throttle_log(const diminuto_throttle_t * throttlep)
{
    if (throttlep != (diminuto_throttle_t *)0) {
        diminuto_log_emit("diminuto_throttle_t@%p[%zu]: { iat=%llu i=%llu l=%llu x=%llu x1=%llu f=%d,%d,%d e=%d,%d,%d a=%d,%d }\n", throttlep, sizeof(*throttlep), (diminuto_llu_t)(throttlep->now - throttlep->then), (diminuto_llu_t)throttlep->increment, (diminuto_llu_t)throttlep->limit, (diminuto_llu_t)throttlep->expected, (diminuto_llu_t)throttlep->actual, throttlep->full0, throttlep->full1, throttlep->full2, throttlep->empty0, throttlep->empty1, throttlep->empty2, throttlep->alarmed1, throttlep->alarmed2);
    } else {
        diminuto_log_emit("diminuto_throttle_t@%p[%zu]\n", throttlep, sizeof(*throttlep));
    }
}

canonical_original_code:
void diminuto_throttle_log(struct DiminutoThrottle *throttlep)
{
    if (throttlep != (struct DiminutoThrottle *)0) {
        diminuto_log_emit("diminuto_throttle_t@%p[%zu]: { iat=%llu i=%llu l=%llu x=%llu x1=%llu f=%d,%d,%d e=%d,%d,%d a=%d,%d }\n", throttlep, sizeof(*throttlep), (diminuto_llu_t)(throttlep->now - throttlep->then), (unsigned long long)throttlep->increment, (unsigned long long)throttlep->limit, (unsigned long long)throttlep->expected, (unsigned long long)throttlep->actual, throttlep->full0, throttlep->full1, throttlep->full2, throttlep->empty0, throttlep->empty1, throttlep->empty2, throttlep->alarmed1, throttlep->alarmed2);
    } else {
        diminuto_log_emit("diminuto_throttle_t@%p[%zu]\n", throttlep, sizeof(*throttlep));
    }
}


decompiled_code:
int __fastcall diminuto_compare_strings(const char *a1, const char *a2)
{
return strcmp(a1, a2);
}

canonical_decompiled_code:
int __fastcall func0(const char *a1, const char *a2)
{
return strcmp(a1, a2);
}

original_code:
int diminuto_compare_strings(const void * thisp, const void * thatp)
{
    return strcmp(thisp, thatp);
}

canonical_original_code:
int diminuto_compare_strings(void *thisp, void *thatp)
{
    return strcmp(thisp, thatp);
}

variable_types:
thisp
void *

variable_types:
thatp
void *


decompiled_code:
__int64 __fastcall diminuto_compare_pointers(__int64 a1, __int64 a2)
{
return a1 - a2;
}

canonical_decompiled_code:
__int64 __fastcall func1(__int64 a1, __int64 a2)
{
return a1 - a2;
}

original_code:
int diminuto_compare_pointers(const void * thisp, const void * thatp)
{
    return ((intptr_t)thisp) - ((intptr_t)thatp);
}

canonical_original_code:
int diminuto_compare_pointers(void *thisp, void *thatp)
{
    return ((long)thisp) - ((long)thatp);
}