decompiled_code:
__int64 __fastcall diminuto_fs_walk(char *name, __int64 (__fastcall *a2)(__int64, const char *, char *, unsigned __int64, struct stat *), __int64 a3)
{
__int64 v5[2]; // [rsp+0h] [rbp-2018h] BYREF
char v6[4080]; // [rsp+10h] [rbp-2008h] BYREF
char resolved[8]; // [rsp+1000h] [rbp-1018h] BYREF
__int64 v8; // [rsp+1008h] [rbp-1010h]
char v9[4080]; // [rsp+1010h] [rbp-1008h] BYREF

*(_QWORD *)resolved = 0LL;
v8 = 0LL;
memset(v9, 0, sizeof(v9));
v5[0] = 0LL;
v5[1] = 0LL;
memset(v6, 0, sizeof(v6));
if ( realpath(name, resolved) )
return diminuto_fs_walker_localalias(resolved, (char *)v5, 0LL, 0LL, a2, a3);
diminuto_log_perror("src/diminuto_fs.c", 261LL, name);
return 4294967294LL;
}

canonical_decompiled_code:
__int64 __fastcall func3(char *name, __int64 (__fastcall *a2)(__int64, const char *, char *, unsigned __int64, struct stat *), __int64 a3)
{
__int64 v5[2]; // [rsp+0h] [rbp-2018h] BYREF
char v6[4080]; // [rsp+10h] [rbp-2008h] BYREF
char resolved[8]; // [rsp+1000h] [rbp-1018h] BYREF
__int64 v8; // [rsp+1008h] [rbp-1010h]
char v9[4080]; // [rsp+1010h] [rbp-1008h] BYREF

*(_QWORD *)resolved = 0LL;
v8 = 0LL;
memset(v9, 0, sizeof(v9));
v5[0] = 0LL;
v5[1] = 0LL;
memset(v6, 0, sizeof(v6));
if ( realpath(name, resolved) )
return func2(resolved, (char *)v5, 0LL, 0LL, a2, a3);
diminuto_log_perror("src/diminuto_fs.c", 261LL, name);
return 4294967294LL;
}

original_code:
int diminuto_fs_walk(const char * root, diminuto_fs_walker_t * walkerp, void * statep)
{
    diminuto_path_t real = { '\0', };
    diminuto_path_t path = { '\0', };
    if (realpath(root, real) == (char *)0) {
        diminuto_log_perror("src/diminuto_fs.c", 261, root);
        return -2;
    }
    return diminuto_fs_walker(real, path, 0, 0, walkerp, statep);
}

canonical_original_code:
int diminuto_fs_walk(char *root, int (*walkerp)(void *statep, char *name, char *path, unsigned long depth, struct stat *statp), void *statep)
{
    char real[-1] = { '\0', };
    char path[-1] = { '\0', };
    if (realpath(root, real) == (char *)0) {
        diminuto_log_perror("src/diminuto_fs.c", 261, root);
        return -2;
    }
    return diminuto_fs_walker(real, path, 0, 0, walkerp, statep);
}

variable_types:
root
char *

variable_types: int (*)(void *statep, char *name, char *path, unsigned long depth, struct stat { unsigned long st_dev; unsigned long st_ino; unsigned long st_nlink; unsigned int st_mode; unsigned int st_uid; unsigned int st_gid; int __pad0; unsigned long st_rdev; long st_size; long st_blksize; long st_blocks; struct timespec { long tv_sec; long tv_nsec; } st_atim; struct timespec st_mtim; struct timespec st_ctim; long __glibc_reserved[3]; } *statp)

variable_types:
statep
void *

variable_types:
real
char [-1]

variable_types:
path
char [-1]


repo: coverclock/com-diag-diminuto

decompiled_code:
__int64 __fastcall diminuto_fs_mkdir_p(char *src, __mode_t mode, int a3)
{
size_t v4; // rax
char *v5; // rbx
size_t v6; // rbx
void *v7; // rsp
char *v8; // rax
void *v9; // rsp
char *v10; // rdi
char *v11; // rdi
char *v12; // rax
__int64 v13; // rcx
char v15[8]; // [rsp+0h] [rbp-40h] BYREF
char *save_ptr; // [rsp+8h] [rbp-38h] BYREF

save_ptr = 0LL;
v4 = strlen(src);
if ( v4 > 0xFFF )
{
*_errno_location() = 36;
LODWORD(v5) = -1;
}
else
{
LODWORD(v5) = 0;
if ( v4 )
{
v6 = v4 + 1;
if ( Debug )
diminuto_log_emit("diminuto_fs_mkdir_p: path=\"%s\"\n", src);
v7 = alloca(v6 + 8);
strncpy(v15, src, v6);
if ( !a3 )
{
v8 = strrchr(v15, 47);
if ( v15 == v8 || !v8 )
{
LODWORD(v5) = 0;
return (unsigned int)v5;
}
*v8 = 0;
}
if ( Debug )
diminuto_log_emit("diminuto_fs_mkdir_p: source=\"%s\"\n", v15);
v9 = alloca(v6 + 8);
v10 = v15;
if ( (unsigned int)v6 >= 8 )
{
v13 = (unsigned int)v6 >> 3;
memset(v15, 0, 8 * v13);
v10 = &v15[8 * v13];
}
if ( (v6 & 4) != 0 )
{
*(_DWORD *)v10 = 0;
v10 += 4;
}
if ( (v6 & 2) != 0 )
{
*(_WORD *)v10 = 0;
v10 += 2;
}
if ( (v6 & 1) != 0 )
*v10 = 0;
v11 = v15;
while ( 1 )
{
v12 = strtok_r(v11, SLASH_0, &save_ptr);
v5 = v12;
if ( !v12 )
break;
if ( Debug )
diminuto_log_emit("diminuto_fs_mkdir_p: token=\"%s\"\n", v12);
if ( v15 != v5 )
*(_WORD *)&v15[strlen(v15)] = *(_WORD *)SLASH_0;
strcat(v15, v5);
if ( Debug )
diminuto_log_emit("diminuto_fs_mkdir_p: sink=\"%s\"\n", v15);
LODWORD(v5) = mkdir(v15, mode);
v11 = 0LL;
if ( (_DWORD)v5 )
{
v11 = 0LL;
if ( *_errno_location() != 17 )
break;
}
}
}
}
return (unsigned int)v5;
}

canonical_decompiled_code:
__int64 __fastcall func4(char *src, __mode_t mode, int a3)
{
size_t v4; // rax
char *v5; // rbx
size_t v6; // rbx
void *v7; // rsp
char *v8; // rax
void *v9; // rsp
char *v10; // rdi
char *v11; // rdi
char *v12; // rax
__int64 v13; // rcx
char v15[8]; // [rsp+0h] [rbp-40h] BYREF
char *save_ptr; // [rsp+8h] [rbp-38h] BYREF

save_ptr = 0LL;
v4 = strlen(src);
if ( v4 > 0xFFF )
{
*_errno_location() = 36;
LODWORD(v5) = -1;
}
else
{
LODWORD(v5) = 0;
if ( v4 )
{
v6 = v4 + 1;
if ( Debug )
diminuto_log_emit("diminuto_fs_mkdir_p: path=\"%s\"\n", src);
v7 = alloca(v6 + 8);
strncpy(v15, src, v6);
if ( !a3 )
{
v8 = strrchr(v15, 47);
if ( v15 == v8 || !v8 )
{
LODWORD(v5) = 0;
return (unsigned int)v5;
}
*v8 = 0;
}
if ( Debug )
diminuto_log_emit("diminuto_fs_mkdir_p: source=\"%s\"\n", v15);
v9 = alloca(v6 + 8);
v10 = v15;
if ( (unsigned int)v6 >= 8 )
{
v13 = (unsigned int)v6 >> 3;
memset(v15, 0, 8 * v13);
v10 = &v15[8 * v13];
}
if ( (v6 & 4) != 0 )
{
*(_DWORD *)v10 = 0;
v10 += 4;
}
if ( (v6 & 2) != 0 )
{
*(_WORD *)v10 = 0;
v10 += 2;
}
if ( (v6 & 1) != 0 )
*v10 = 0;
v11 = v15;
while ( 1 )
{
v12 = strtok_r(v11, SLASH_0, &save_ptr);
v5 = v12;
if ( !v12 )
break;
if ( Debug )
diminuto_log_emit("diminuto_fs_mkdir_p: token=\"%s\"\n", v12);
if ( v15 != v5 )
*(_WORD *)&v15[strlen(v15)] = *(_WORD *)SLASH_0;
strcat(v15, v5);
if ( Debug )
diminuto_log_emit("diminuto_fs_mkdir_p: sink=\"%s\"\n", v15);
LODWORD(v5) = mkdir(v15, mode);
v11 = 0LL;
if ( (_DWORD)v5 )
{
v11 = 0LL;
if ( *_errno_location() != 17 )
break;
}
}
}
}
return (unsigned int)v5;
}

original_code:
int diminuto_fs_mkdir_p(const char * path, mode_t mode, int all)
{
    int rc = 0;
    size_t length = 0;
    char * source = (char *)0;
    char * sink = (char *)0;
    char * target = (char *)0;
    char * saveptr = (char *)0;
    char * token = (char *)0;
    static const char SLASH[] = "/";
    do {
        length = strlen(path);
        if (length >= sizeof(diminuto_path_t)) {
            rc = -1;
            (*__errno_location ()) = 36;
            break;
        } else if (length <= 0) {
            break;
        } else {
            length += 1;
        }
        if (Debug) { diminuto_log_emit("diminuto_fs_mkdir_p: path=\"%s\"\n", path); }
        source = (char *)__builtin_alloca (length);
        strncpy(source, path, length);
        if (all) {
        } else if ((token = strrchr(source, SLASH[0])) == (char *)0) {
            break;
        } else if (token == source) {
            break;
        } else {
            *token = '\0';
        }
        if (Debug) { diminuto_log_emit("diminuto_fs_mkdir_p: source=\"%s\"\n", source); }
        sink = (char *)__builtin_alloca (length);
        memset(sink, 0, length);
        target = source;
        while ((token = strtok_r(target, SLASH, &saveptr)) != (char *)0) {
            if (Debug) { diminuto_log_emit("diminuto_fs_mkdir_p: token=\"%s\"\n", token); }
            if (token != source) {
                strcat(sink, SLASH);
            }
            strcat(sink, token);
            if (Debug) { diminuto_log_emit("diminuto_fs_mkdir_p: sink=\"%s\"\n", sink); }
            rc = mkdir(sink, mode);
            if (rc == 0) {
            } else if ((*__errno_location ()) == 17) {
                rc = 0;
            } else {
                break;
            }
            target = (char *)0;
        }
    } while (0);
    return rc;
}

canonical_original_code:
int diminuto_fs_mkdir_p(char *path, unsigned int mode, int all)
{
    int rc = 0;
    unsigned long length = 0;
    char *source = (char *)0;
    char *sink = (char *)0;
    char *target = (char *)0;
    char *saveptr = (char *)0;
    char *token = (char *)0;
    static char SLASH[] = "/";
    do {
        length = strlen(path);
        if (length >= sizeof(diminuto_path_t)) {
            rc = -1;
            (*__errno_location ()) = 36;
            break;
        } else if (length <= 0) {
            break;
        } else {
            length += 1;
        }
        if (Debug) { diminuto_log_emit("diminuto_fs_mkdir_p: path=\"%s\"\n", path); }
        source = (char *)__builtin_alloca (length);
        strncpy(source, path, length);
        if (all) {
        } else if ((token = strrchr(source, SLASH[0])) == (char *)0) {
            break;
        } else if (token == source) {
            break;
        } else {
            *token = '\0';
        }
        if (Debug) { diminuto_log_emit("diminuto_fs_mkdir_p: source=\"%s\"\n", source); }
        sink = (char *)__builtin_alloca (length);
        memset(sink, 0, length);
        target = source;
        while ((token = strtok_r(target, SLASH, &saveptr)) != (char *)0) {
            if (Debug) { diminuto_log_emit("diminuto_fs_mkdir_p: token=\"%s\"\n", token); }
            if (token != source) {
                strcat(sink, SLASH);
            }
            strcat(sink, token);
            if (Debug) { diminuto_log_emit("diminuto_fs_mkdir_p: sink=\"%s\"\n", sink); }
            rc = mkdir(sink, mode);
            if (rc == 0) {
            } else if ((*__errno_location ()) == 17) {
                rc = 0;
            } else {
                break;
            }
            target = (char *)0;
        }
    } while (0);
    return rc;
}

variable_types:
path
char *

variable_types:
mode
unsigned int

variable_types: all int

variable_types: rc int

variable_types:
length
unsigned long

variable_types:
source
char *

variable_types:
sink
char *

variable_types:
target
char *

variable_types:
saveptr
char *

variable_types:
token
char *

variable_types:
SLASH
char []

return_type: int


decompiled_code:
__int64 __fastcall diminuto_fs_canonicalize(char *s, char *dest, unsigned __int64 a3)
{
char *v3; // rbx
size_t v4; // rax
size_t v5; // r12
size_t v6; // r14
char *v7; // rax
char *v8; // r13
size_t v9; // rax
unsigned __int64 v10; // r15
__int64 result; // rax
char *v12; // r12
size_t v14; // [rsp+8h] [rbp-2040h]
__int64 v15; // [rsp+8h] [rbp-2040h]
char resolved[8]; // [rsp+10h] [rbp-2038h] BYREF
__int64 v17; // [rsp+18h] [rbp-2030h]
char v18[4080]; // [rsp+20h] [rbp-2028h] BYREF
char desta[8]; // [rsp+1010h] [rbp-1038h] BYREF
__int64 v20; // [rsp+1018h] [rbp-1030h]
char v21[4080]; // [rsp+1020h] [rbp-1028h] BYREF

v3 = s;
*(_QWORD *)desta = 0LL;
v20 = 0LL;
memset(v21, 0, sizeof(v21));
*(_QWORD *)resolved = 0LL;
v17 = 0LL;
memset(v18, 0, sizeof(v18));
if ( Debug )
diminuto_log_emit("diminuto_fs_canonicalize: relative=\"%s\"\n", s);
v4 = strnlen(s, 0x1000uLL);
v5 = v4;
v6 = v4;
if ( v4 > 0xFFF )
{
*_errno_location() = 36;
diminuto_log_perror("src/diminuto_fs.c", 364LL, s);
return 0xFFFFFFFFLL;
}
if ( !v4 )
{
*_errno_location() = 22;
diminuto_log_perror("src/diminuto_fs.c", 369LL, s);
return 0xFFFFFFFFLL;
}
if ( !strcmp(s, "/") || !strcmp(s, "/.") || !strcmp(s, "/..") )
{
if ( !Debug )
{
v8 = (char *)&LC9;
v3 = (char *)&LC9;
v10 = 1LL;
v6 = 0LL;
v12 = (char *)&LC9;
goto LABEL_30;
}
v10 = 1LL;
v6 = 0LL;
v15 = 0LL;
v8 = (char *)&LC9;
v3 = (char *)&LC9;
goto LABEL_20;
}
v7 = strrchr(s, 47);
if ( !v7 )
{
v10 = v5 + 1;
if ( !Debug )
{
v8 = s;
v3 = ".";
goto LABEL_40;
}
v8 = s;
v15 = 1LL;
v3 = ".";
LABEL_20:
diminuto_log_emit("diminuto_fs_canonicalize: path=\"%s\"[%zu] file=\"%s\"[%zu]\n", v3, v15 - v6, v8, v6);
v12 = (char *)&LC9;
if ( v15 )
goto LABEL_40;
LABEL_42:
v6 = strlen(v12);
v10 += v6;
if ( Debug )
diminuto_log_emit("diminuto_fs_canonicalize: prefix=\"%s\"\n", v12);
goto LABEL_30;
}
v8 = v7 + 1;
v9 = strnlen(v7 + 1, 0x1000uLL);
v14 = v9;
if ( !v9 )
{
v8 = (char *)&LC9;
goto LABEL_38;
}
if ( !strcmp(v8, ".") )
{
v14 = 0LL;
v8 = (char *)&LC9;
goto LABEL_38;
}
if ( !strcmp(v8, "..") )
{
v14 = 0LL;
v8 = (char *)&LC9;
goto LABEL_38;
}
if ( v8 > s + 1 )
{
strncpy(desta, s, v8 - s);
v3 = desta;
LABEL_38:
v10 = v14 + 1;
if ( !Debug )
goto LABEL_39;
diminuto_log_emit("diminuto_fs_canonicalize: path=\"%s\"[%zu] file=\"%s\"[%zu]\n", v3, v5 - v14, v8, v14);
LABEL_40:
v12 = realpath(v3, resolved);
if ( !v12 )
{
diminuto_log_perror("src/diminuto_fs.c", 432LL, v3);
return 0xFFFFFFFFLL;
}
v18[4079] = 0;
goto LABEL_42;
}
v10 = v9 + 1;
if ( Debug )
{
diminuto_log_emit("diminuto_fs_canonicalize: path=\"%s\"[%zu] file=\"%s\"[%zu]\n", &LC9, -(__int64)v9, v8, v9);
v3 = (char *)&LC9;
v12 = (char *)&LC9;
goto LABEL_42;
}
v6 = 0LL;
v3 = (char *)&LC9;
LABEL_39:
if ( v6 )
goto LABEL_40;
v12 = (char *)&LC9;
LABEL_30:
if ( a3 <= v10 )
{
*_errno_location() = 36;
diminuto_log_perror("src/diminuto_fs.c", 447LL, v3);
result = 0xFFFFFFFFLL;
}
else
{
strcpy(dest, v12);
if ( v12[v6 - 1] != 47 )
*(_WORD *)&dest[strlen(dest)] = 47;
strcat(dest, v8);
result = (unsigned int)Debug;
if ( Debug )
{
diminuto_log_emit("diminuto_fs_canonicalize: absolute=\"%s\"\n", dest);
result = 0LL;
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func5(char *s, char *dest, unsigned __int64 a3)
{
char *v3; // rbx
size_t v4; // rax
size_t v5; // r12
size_t v6; // r14
char *v7; // rax
char *v8; // r13
size_t v9; // rax
unsigned __int64 v10; // r15
__int64 result; // rax
char *v12; // r12
size_t v14; // [rsp+8h] [rbp-2040h]
__int64 v15; // [rsp+8h] [rbp-2040h]
char resolved[8]; // [rsp+10h] [rbp-2038h] BYREF
__int64 v17; // [rsp+18h] [rbp-2030h]
char v18[4080]; // [rsp+20h] [rbp-2028h] BYREF
char desta[8]; // [rsp+1010h] [rbp-1038h] BYREF
__int64 v20; // [rsp+1018h] [rbp-1030h]
char v21[4080]; // [rsp+1020h] [rbp-1028h] BYREF

v3 = s;
*(_QWORD *)desta = 0LL;
v20 = 0LL;
memset(v21, 0, sizeof(v21));
*(_QWORD *)resolved = 0LL;
v17 = 0LL;
memset(v18, 0, sizeof(v18));
if ( Debug )
diminuto_log_emit("diminuto_fs_canonicalize: relative=\"%s\"\n", s);
v4 = strnlen(s, 0x1000uLL);
v5 = v4;
v6 = v4;
if ( v4 > 0xFFF )
{
*_errno_location() = 36;
diminuto_log_perror("src/diminuto_fs.c", 364LL, s);
return 0xFFFFFFFFLL;
}
if ( !v4 )
{
*_errno_location() = 22;
diminuto_log_perror("src/diminuto_fs.c", 369LL, s);
return 0xFFFFFFFFLL;
}
if ( !strcmp(s, "/") || !strcmp(s, "/.") || !strcmp(s, "/..") )
{
if ( !Debug )
{
v8 = (char *)&LC9;
v3 = (char *)&LC9;
v10 = 1LL;
v6 = 0LL;
v12 = (char *)&LC9;
goto LABEL_30;
}
v10 = 1LL;
v6 = 0LL;
v15 = 0LL;
v8 = (char *)&LC9;
v3 = (char *)&LC9;
goto LABEL_20;
}
v7 = strrchr(s, 47);
if ( !v7 )
{
v10 = v5 + 1;
if ( !Debug )
{
v8 = s;
v3 = ".";
goto LABEL_40;
}
v8 = s;
v15 = 1LL;
v3 = ".";
LABEL_20:
diminuto_log_emit("diminuto_fs_canonicalize: path=\"%s\"[%zu] file=\"%s\"[%zu]\n", v3, v15 - v6, v8, v6);
v12 = (char *)&LC9;
if ( v15 )
goto LABEL_40;
LABEL_42:
v6 = strlen(v12);
v10 += v6;
if ( Debug )
diminuto_log_emit("diminuto_fs_canonicalize: prefix=\"%s\"\n", v12);
goto LABEL_30;
}
v8 = v7 + 1;
v9 = strnlen(v7 + 1, 0x1000uLL);
v14 = v9;
if ( !v9 )
{
v8 = (char *)&LC9;
goto LABEL_38;
}
if ( !strcmp(v8, ".") )
{
v14 = 0LL;
v8 = (char *)&LC9;
goto LABEL_38;
}
if ( !strcmp(v8, "..") )
{
v14 = 0LL;
v8 = (char *)&LC9;
goto LABEL_38;
}
if ( v8 > s + 1 )
{
strncpy(desta, s, v8 - s);
v3 = desta;
LABEL_38:
v10 = v14 + 1;
if ( !Debug )
goto LABEL_39;
diminuto_log_emit("diminuto_fs_canonicalize: path=\"%s\"[%zu] file=\"%s\"[%zu]\n", v3, v5 - v14, v8, v14);
LABEL_40:
v12 = realpath(v3, resolved);
if ( !v12 )
{
diminuto_log_perror("src/diminuto_fs.c", 432LL, v3);
return 0xFFFFFFFFLL;
}
v18[4079] = 0;
goto LABEL_42;
}
v10 = v9 + 1;
if ( Debug )
{
diminuto_log_emit("diminuto_fs_canonicalize: path=\"%s\"[%zu] file=\"%s\"[%zu]\n", &LC9, -(__int64)v9, v8, v9);
v3 = (char *)&LC9;
v12 = (char *)&LC9;
goto LABEL_42;
}
v6 = 0LL;
v3 = (char *)&LC9;
LABEL_39:
if ( v6 )
goto LABEL_40;
v12 = (char *)&LC9;
LABEL_30:
if ( a3 <= v10 )
{
*_errno_location() = 36;
diminuto_log_perror("src/diminuto_fs.c", 447LL, v3);
result = 0xFFFFFFFFLL;
}
else
{
strcpy(dest, v12);
if ( v12[v6 - 1] != 47 )
*(_WORD *)&dest[strlen(dest)] = 47;
strcat(dest, v8);
result = (unsigned int)Debug;
if ( Debug )
{
diminuto_log_emit("diminuto_fs_canonicalize: absolute=\"%s\"\n", dest);
result = 0LL;
}
}
return result;
}

original_code:
int diminuto_fs_canonicalize(const char * path, char * buffer, size_t size)
{
    int rc = -1;
    const char * file = (char *)0;
    char * prefix = (char *)0;
    diminuto_path_t relativepath = { '\0', };
    diminuto_path_t absolutepath = { '\0', };
    size_t length = 1;
    size_t plength = 0;
    size_t flength = 0;
    size_t xlength = 0;
    do {
        if (Debug) { diminuto_log_emit("diminuto_fs_canonicalize: relative=\"%s\"\n", path); }
        if ((plength = strnlen(path, sizeof(relativepath))) >= sizeof(relativepath)) {
            (*__errno_location ()) = 36;
            diminuto_log_perror("src/diminuto_fs.c", 364, path);
            break;
        } else if (plength == 0) {
            (*__errno_location ()) = 22;
            diminuto_log_perror("src/diminuto_fs.c", 369, path);
            break;
        } else if (strcmp(path, "/") == 0) {
            path = "";
            plength = 0;
            file = "";
            flength = 0;
        } else if (strcmp(path, "/.") == 0) {
            path = "";
            plength = 0;
            file = "";
            flength = 0;
        } else if (strcmp(path, "/..") == 0) {
            path = "";
            plength = 0;
            file = "";
            flength = 0;
        } else if ((file = strrchr(path, '/')) == (const char *)0) {
            file = path;
            flength = plength;
            path = ".";
            plength = 1;
        } else if ((flength = strnlen(++file, sizeof(relativepath))) == 0) {
            file = "";
            flength = 0;
        } else if (strcmp(file, ".") == 0) {
            file = "";
            flength = 0;
        } else if (strcmp(file, "..") == 0) {
            file = "";
            flength = 0;
        } else if (file <= (path + 1)) {
            path = "";
            plength = 0;
        } else {
            strncpy(relativepath, path, file - path);
            path = relativepath;
        }
        length += flength;
        if (Debug) { diminuto_log_emit("diminuto_fs_canonicalize: path=\"%s\"[%zu] file=\"%s\"[%zu]\n", path, plength - flength, file, flength); }
        if (plength == 0) {
            prefix = "";
        } else if ((prefix = realpath(path, absolutepath)) == (char *)0) {
            diminuto_log_perror("src/diminuto_fs.c", 432, path);
            break;
        } else {
            absolutepath[sizeof(absolutepath) - 1] = '\0';
        }
        length += (xlength = strlen(prefix));
        if (Debug) { diminuto_log_emit("diminuto_fs_canonicalize: prefix=\"%s\"\n", prefix); }
        if (length >= size) {
            (*__errno_location ()) = 36;
            diminuto_log_perror("src/diminuto_fs.c", 447, path);
            break;
        }
        strcpy(buffer, prefix);
        if (prefix[xlength - 1] != '/') {
            strcat(buffer, "/");
        }
        strcat(buffer, file);
        if (Debug) { diminuto_log_emit("diminuto_fs_canonicalize: absolute=\"%s\"\n", buffer); }
        rc = 0;
    } while (0);
    return rc;
}

canonical_original_code:
int diminuto_fs_canonicalize(char *path, char *buffer, unsigned long size)
{
    int rc = -1;
    char *file = (char *)0;
    char *prefix = (char *)0;
    char relativepath[-1] = { '\0', };
    char absolutepath[-1] = { '\0', };
    unsigned long length = 1;
    unsigned long plength = 0;
    unsigned long flength = 0;
    unsigned long xlength = 0;
    do {
        if (Debug) { diminuto_log_emit("diminuto_fs_canonicalize: relative=\"%s\"\n", path); }
        if ((plength = strnlen(path, sizeof(relativepath))) >= sizeof(relativepath)) {
            (*__errno_location ()) = 36;
            diminuto_log_perror("src/diminuto_fs.c", 364, path);
            break;
        } else if (plength == 0) {
            (*__errno_location ()) = 22;
            diminuto_log_perror("src/diminuto_fs.c", 369, path);
            break;
        } else if (strcmp(path, "/") == 0) {
            path = "";
            plength = 0;
            file = "";
            flength = 0;
        } else if (strcmp(path, "/.") == 0) {
            path = "";
            plength = 0;
            file = "";
            flength = 0;
        } else if (strcmp(path, "/..") == 0) {
            path = "";
            plength = 0;
            file = "";
            flength = 0;
        } else if ((file = strrchr(path, '/')) == (char *)0) {
            file = path;
            flength = plength;
            path = ".";
            plength = 1;
        } else if ((flength = strnlen(++file, sizeof(relativepath))) == 0) {
            file = "";
            flength = 0;
        } else if (strcmp(file, ".") == 0) {
            file = "";
            flength = 0;
        } else if (strcmp(file, "..") == 0) {
            file = "";
            flength = 0;
        } else if (file <= (path + 1)) {
            path = "";
            plength = 0;
        } else {
            strncpy(relativepath, path, file - path);
            path = relativepath;
        }
        length += flength;
        if (Debug) { diminuto_log_emit("diminuto_fs_canonicalize: path=\"%s\"[%zu] file=\"%s\"[%zu]\n", path, plength - flength, file, flength); }
        if (plength == 0) {
            prefix = "";
        } else if ((prefix = realpath(path, absolutepath)) == (char *)0) {
            diminuto_log_perror("src/diminuto_fs.c", 432, path);
            break;
        } else {
            absolutepath[sizeof(absolutepath) - 1] = '\0';
        }
        length += (xlength = strlen(prefix));
        if (Debug) { diminuto_log_emit("diminuto_fs_canonicalize: prefix=\"%s\"\n", prefix); }
        if (length >= size) {
            (*__errno_location ()) = 36;
            diminuto_log_perror("src/diminuto_fs.c", 447, path);
            break;
        }
        strcpy(buffer, prefix);
        if (prefix[xlength - 1] != '/') {
            strcat(buffer, "/");
        }
        strcat(buffer, file);
        if (Debug) { diminuto_log_emit("diminuto_fs_canonicalize: absolute=\"%s\"\n", buffer); }
        rc = 0;
    } while (0);
    return rc;
}

variable_types:
buffer
char *

variable_types:
size
unsigned long

variable_types:
file
char *

variable_types:
prefix
char *

variable_types:
relativepath
char [-1]

variable_types:
absolutepath
char [-1]

variable_types:
plength
unsigned long

variable_types:
flength
unsigned long

variable_types:
xlength
unsigned long


decompiled_code:
__int64 __fastcall diminuto_fs_type(char *file)
{
int v1; // edx
__int64 result; // rax
struct stat v3; // [rsp+0h] [rbp-98h] BYREF

memset(&v3, 0, sizeof(v3));
v1 = stat(file, &v3);
result = 45LL;
if ( v1 >= 0 )
result = diminuto_fs_mode2type(v3.st_mode);
return result;
}

canonical_decompiled_code:
__int64 __fastcall func6(char *file)
{
int v1; // edx
__int64 result; // rax
struct stat v3; // [rsp+0h] [rbp-98h] BYREF

memset(&v3, 0, sizeof(v3));
v1 = stat(file, &v3);
result = 45LL;
if ( v1 >= 0 )
result = func1(v3.st_mode);
return result;
}

original_code:
diminuto_fs_type_t diminuto_fs_type(const char * path)
{
    struct stat status = { 0, };
    diminuto_fs_type_t type = DIMINUTO_FS_TYPE_NONE;
    if (stat(path, &status) < 0) {
    } else {
        type = diminuto_fs_mode2type(status.st_mode);
    }
    return type;
}

canonical_original_code:
enum DiminutoFsType diminuto_fs_type(char *path)
{
    struct stat status = { 0, };
    enum DiminutoFsType type = DIMINUTO_FS_TYPE_NONE;
    if (stat(path, &status) < 0) {
    } else {
        type = diminuto_fs_mode2type(status.st_mode);
    }
    return type;
}

variable_types:
path
char *

variable_types: struct stat { unsigned long st_dev; unsigned long st_ino; unsigned long st_nlink; unsigned int st_mode; unsigned int st_uid; unsigned int st_gid; int __pad0; unsigned long st_rdev; long st_size; long st_blksize; long st_blocks; struct timespec { long tv_sec; long tv_nsec; } st_atim; struct timespec st_mtim; struct timespec st_ctim; long __glibc_reserved[3]; }

variable_types: enum DiminutoFsType { DIMINUTO_FS_TYPE_NONE=expr, DIMINUTO_FS_TYPE_UNKNOWN=expr, DIMINUTO_FS_TYPE_TTY=expr, DIMINUTO_FS_TYPE_SOCKET=expr, DIMINUTO_FS_TYPE_SYMLINK=expr, DIMINUTO_FS_TYPE_FILE=expr, DIMINUTO_FS_TYPE_BLOCKDEV=expr, DIMINUTO_FS_TYPE_DIRECTORY=expr, DIMINUTO_FS_TYPE_CHARACTERDEV=expr, DIMINUTO_FS_TYPE_FIFO=expr, DIMINUTO_FS_TYPE_0=expr, DIMINUTO_FS_TYPE_1=expr, DIMINUTO_FS_TYPE_2=expr, DIMINUTO_FS_TYPE_3=expr, DIMINUTO_FS_TYPE_4=expr, DIMINUTO_FS_TYPE_5=expr, DIMINUTO_FS_TYPE_6=expr, DIMINUTO_FS_TYPE_7=expr, DIMINUTO_FS_TYPE_8=expr, DIMINUTO_FS_TYPE_9=expr, DIMINUTO_FS_TYPE_A=expr, DIMINUTO_FS_TYPE_B=expr, DIMINUTO_FS_TYPE_C=expr, DIMINUTO_FS_TYPE_D=expr, DIMINUTO_FS_TYPE_E=expr, DIMINUTO_FS_TYPE_F=expr }

user_defined_types: struct stat { unsigned long st_dev; unsigned long st_ino; unsigned long st_nlink; unsigned int st_mode; unsigned int st_uid; unsigned int st_gid; int __pad0; unsigned long st_rdev; long st_size; long st_blksize; long st_blocks; struct timespec st_atim; struct timespec st_mtim; struct timespec st_ctim; long __glibc_reserved[3]; }


foo

decompiled_code:
void *__fastcall foo(__int64 a1)
{
void *result; // rax

result = &diminuto_log_mask;
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
result = &diminuto_log_mask;
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
result = &diminuto_log_mask;
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
result = &diminuto_log_mask;
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
result = &diminuto_log_mask;
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
result = &diminuto_log_mask;
if ( (diminuto_log_mask & 2) != 0 )
result = (void *)diminuto_log_log();
}
}
}
}
}
if ( *(_WORD *)(a1 + 14) != 88 )
{
__errno_location();
diminuto_unittest_error();
if ( (diminuto_log_mask & 0x10) != 0 )
diminuto_log_log();
diminuto_stacktrace();
diminuto_unittest_flush();
result = (void *)diminuto_core_fatal();
}
return result;
}

canonical_decompiled_code:
void *__fastcall func7(__int64 a1)
{
void *result; // rax

result = &diminuto_log_mask;
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
result = &diminuto_log_mask;
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
result = &diminuto_log_mask;
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
result = &diminuto_log_mask;
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
result = &diminuto_log_mask;
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
result = &diminuto_log_mask;
if ( (diminuto_log_mask & 2) != 0 )
result = (void *)diminuto_log_log();
}
}
}
}
}
if ( *(_WORD *)(a1 + 14) != 88 )
{
__errno_location();
diminuto_unittest_error();
if ( (diminuto_log_mask & 0x10) != 0 )
diminuto_log_log();
diminuto_stacktrace();
diminuto_unittest_flush();
result = (void *)diminuto_core_fatal();
}
return result;
}

original_code:
static void foo(array_t * pointer) {
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "39" ": " "CHECKPOINT: " "foo(pointer)\n") : ((void)0));;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "40" ": " "CHECKPOINT: " "pointer=%p\n", (void *)pointer) : ((void)0));;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "41" ": " "CHECKPOINT: " "sizeof=%zu\n", sizeof(*pointer)) : ((void)0));;
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(sizeof(*pointer) == 16); if (!diminuto_unittest_condition) { int diminuto_unittest_errno; int diminuto_unittest_number; int diminuto_unittest_count; diminuto_unittest_errno = (*__errno_location ()); diminuto_unittest_number = diminuto_unittest_tests; diminuto_unittest_count = diminuto_unittest_error(); ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "tst/unittest-arraytype.c" "@" "42" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "sizeof(*pointer) == 16") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "43" ": " "CHECKPOINT: " "zeroth=%zu\n", sizeof((*pointer)[0])) : ((void)0));;
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(sizeof((*pointer)[0]) == 2); if (!diminuto_unittest_condition) { int diminuto_unittest_errno; int diminuto_unittest_number; int diminuto_unittest_count; diminuto_unittest_errno = (*__errno_location ()); diminuto_unittest_number = diminuto_unittest_tests; diminuto_unittest_count = diminuto_unittest_error(); ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "tst/unittest-arraytype.c" "@" "44" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "sizeof((*pointer)[0]) == 2") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "45" ": " "CHECKPOINT: " "countof=%zu\n", sizeof(*pointer) / sizeof((*pointer)[0])) : ((void)0));;
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!((sizeof(*pointer) / sizeof((*pointer)[0])) == 8); if (!diminuto_unittest_condition) { int diminuto_unittest_errno; int diminuto_unittest_number; int diminuto_unittest_count; diminuto_unittest_errno = (*__errno_location ()); diminuto_unittest_number = diminuto_unittest_tests; diminuto_unittest_count = diminuto_unittest_error(); ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "tst/unittest-arraytype.c" "@" "46" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "(sizeof(*pointer) / sizeof((*pointer)[0])) == 8") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "47" ": " "CHECKPOINT: " "eighth=%u\n", (*pointer)[7]) : ((void)0));;
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!((*pointer)[7] == 88); if (!diminuto_unittest_condition) { int diminuto_unittest_errno; int diminuto_unittest_number; int diminuto_unittest_count; diminuto_unittest_errno = (*__errno_location ()); diminuto_unittest_number = diminuto_unittest_tests; diminuto_unittest_count = diminuto_unittest_error(); ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "tst/unittest-arraytype.c" "@" "48" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "(*pointer)[7] == 88") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
}

canonical_original_code:
static void foo(unsigned short (*pointer)[-1]) {
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "39" ": " "CHECKPOINT: " "foo(pointer)\n") : ((void)0));;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "40" ": " "CHECKPOINT: " "pointer=%p\n", (void *)pointer) : ((void)0));;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "41" ": " "CHECKPOINT: " "sizeof=%zu\n", sizeof(*pointer)) : ((void)0));;
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(sizeof(*pointer) == 16); if (!diminuto_unittest_condition) { int diminuto_unittest_errno; int diminuto_unittest_number; int diminuto_unittest_count; diminuto_unittest_errno = (*__errno_location ()); diminuto_unittest_number = diminuto_unittest_tests; diminuto_unittest_count = diminuto_unittest_error(); ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "tst/unittest-arraytype.c" "@" "42" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "sizeof(*pointer) == 16") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "43" ": " "CHECKPOINT: " "zeroth=%zu\n", sizeof((*pointer)[0])) : ((void)0));;
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(sizeof((*pointer)[0]) == 2); if (!diminuto_unittest_condition) { int diminuto_unittest_errno; int diminuto_unittest_number; int diminuto_unittest_count; diminuto_unittest_errno = (*__errno_location ()); diminuto_unittest_number = diminuto_unittest_tests; diminuto_unittest_count = diminuto_unittest_error(); ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "tst/unittest-arraytype.c" "@" "44" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "sizeof((*pointer)[0]) == 2") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "45" ": " "CHECKPOINT: " "countof=%zu\n", sizeof(*pointer) / sizeof((*pointer)[0])) : ((void)0));;
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!((sizeof(*pointer) / sizeof((*pointer)[0])) == 8); if (!diminuto_unittest_condition) { int diminuto_unittest_errno; int diminuto_unittest_number; int diminuto_unittest_count; diminuto_unittest_errno = (*__errno_location ()); diminuto_unittest_number = diminuto_unittest_tests; diminuto_unittest_count = diminuto_unittest_error(); ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "tst/unittest-arraytype.c" "@" "46" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "(sizeof(*pointer) / sizeof((*pointer)[0])) == 8") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "47" ": " "CHECKPOINT: " "eighth=%u\n", (*pointer)[7]) : ((void)0));;
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!((*pointer)[7] == 88); if (!diminuto_unittest_condition) { int diminuto_unittest_errno; int diminuto_unittest_number; int diminuto_unittest_count; diminuto_unittest_errno = (*__errno_location ()); diminuto_unittest_number = diminuto_unittest_tests; diminuto_unittest_count = diminuto_unittest_error(); ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "tst/unittest-arraytype.c" "@" "48" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "(*pointer)[7] == 88") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
}

variable_types:
pointer
unsigned short (*)[-1]

return_type: void


bar

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

if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
diminuto_log_log();
}
}
}
result = a1;
if ( *(_WORD *)(a1 + 14) != 88 )
{
__errno_location();
diminuto_unittest_error();
if ( (diminuto_log_mask & 0x10) != 0 )
diminuto_log_log();
diminuto_stacktrace();
diminuto_unittest_flush();
result = diminuto_core_fatal();
}
return result;
}

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

if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
diminuto_log_log();
}
}
}
result = a1;
if ( *(_WORD *)(a1 + 14) != 88 )
{
__errno_location();
diminuto_unittest_error();
if ( (diminuto_log_mask & 0x10) != 0 )
diminuto_log_log();
diminuto_stacktrace();
diminuto_unittest_flush();
result = diminuto_core_fatal();
}
return result;
}

original_code:
static void bar(array_t variable) {
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "56" ": " "CHECKPOINT: " "bar(variable)\n") : ((void)0));;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "57" ": " "CHECKPOINT: " "variable=%p\n", (void *)variable) : ((void)0));;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "65" ": " "CHECKPOINT: " "variable=%p\n", (void *)&variable) : ((void)0));;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "66" ": " "CHECKPOINT: " "eighth=%u\n", variable[7]) : ((void)0));;
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(variable[7] == 88); if (!diminuto_unittest_condition) { int diminuto_unittest_errno; int diminuto_unittest_number; int diminuto_unittest_count; diminuto_unittest_errno = (*__errno_location ()); diminuto_unittest_number = diminuto_unittest_tests; diminuto_unittest_count = diminuto_unittest_error(); ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "tst/unittest-arraytype.c" "@" "67" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "variable[7] == 88") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
}

canonical_original_code:
static void bar(unsigned short variable[-1]) {
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "56" ": " "CHECKPOINT: " "bar(variable)\n") : ((void)0));;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "57" ": " "CHECKPOINT: " "variable=%p\n", (void *)variable) : ((void)0));;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "65" ": " "CHECKPOINT: " "variable=%p\n", (void *)&variable) : ((void)0));;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "66" ": " "CHECKPOINT: " "eighth=%u\n", variable[7]) : ((void)0));;
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(variable[7] == 88); if (!diminuto_unittest_condition) { int diminuto_unittest_errno; int diminuto_unittest_number; int diminuto_unittest_count; diminuto_unittest_errno = (*__errno_location ()); diminuto_unittest_number = diminuto_unittest_tests; diminuto_unittest_count = diminuto_unittest_error(); ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "tst/unittest-arraytype.c" "@" "67" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "variable[7] == 88") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
}

variable_types:
variable
unsigned short [-1]


main

canonical_name: main

decompiled_code:
int __cdecl __noreturn main(int argc, const char **argv, const char **envp)
{
int v3; // ebx
int v4; // edi
__int16 v5[20]; // [rsp+0h] [rbp-28h] BYREF

v5[0] = 11;
v5[1] = 22;
v5[2] = 33;
v5[3] = 44;
v5[4] = 55;
v5[5] = 66;
v5[6] = 77;
v5[7] = 88;
diminuto_unittest_setlogmask();
if ( (diminuto_log_mask & 4) != 0 )
diminuto_log_log();
diminuto_unittest_test();
if ( (diminuto_log_mask & 4) != 0 )
diminuto_log_log();
diminuto_unittest_flush();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) == 0 )
goto LABEL_7;
diminuto_log_log();
}
}
}
}
}
}
}
}
}
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
diminuto_log_log();
}
}
}
}
}
}
}
}
}
LABEL_7:
foo((__int64)v5);
bar((__int64)v5);
if ( (diminuto_log_mask & 4) != 0 )
diminuto_log_log();
diminuto_unittest_flush();
v3 = diminuto_unittest_errors;
if ( (diminuto_log_mask & 4) != 0 )
diminuto_log_log();
diminuto_unittest_flush();
v4 = 255;
if ( v3 <= 255 )
v4 = v3;
exit(v4);
}

canonical_decompiled_code:
int __cdecl __noreturn main(int argc, const char **argv, const char **envp)
{
int v3; // ebx
int v4; // edi
__int16 v5[20]; // [rsp+0h] [rbp-28h] BYREF

v5[0] = 11;
v5[1] = 22;
v5[2] = 33;
v5[3] = 44;
v5[4] = 55;
v5[5] = 66;
v5[6] = 77;
v5[7] = 88;
diminuto_unittest_setlogmask();
if ( (diminuto_log_mask & 4) != 0 )
diminuto_log_log();
diminuto_unittest_test();
if ( (diminuto_log_mask & 4) != 0 )
diminuto_log_log();
diminuto_unittest_flush();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) == 0 )
goto LABEL_7;
diminuto_log_log();
}
}
}
}
}
}
}
}
}
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
diminuto_log_log();
}
}
}
}
}
}
}
}
}
LABEL_7:
func7((__int64)v5);
func8((__int64)v5);
if ( (diminuto_log_mask & 4) != 0 )
diminuto_log_log();
diminuto_unittest_flush();
v3 = diminuto_unittest_errors;
if ( (diminuto_log_mask & 4) != 0 )
diminuto_log_log();
diminuto_unittest_flush();
v4 = 255;
if ( v3 <= 255 )
v4 = v3;
exit(v4);
}

original_code:
int main() {
    array_t variable = { 11, 22, 33, 44, 55, 66, 77, 88, };
    array_t * pointer = &variable;
    do { diminuto_unittest_setlogmask(); ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_NOTICE)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_NOTICE, "tst/unittest-arraytype.c" "@" "74" ": " "SETLOGMASK: logmask=0x%x\n", diminuto_log_mask) : ((void)0)); } while (0);
    do { int diminuto_unittest_local = 0; do { int diminuto_unittest_number = 0; diminuto_unittest_number = diminuto_unittest_test(); diminuto_unittest_local = diminuto_unittest_errors; ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_NOTICE)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_NOTICE, "tst/unittest-arraytype.c" "@" "76" ": " "TEST: %d tests=%d " "\n", (0), diminuto_unittest_number) : ((void)0)); diminuto_unittest_flush(); } while (0); do {;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "78" ": " "CHECKPOINT: " "array_t\n") : ((void)0));;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "79" ": " "CHECKPOINT: " "widthof=%zu\n", sizeof(array_t) * 8) : ((void)0));;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "80" ": " "CHECKPOINT: " "sizeof=%zu\n", sizeof(array_t)) : ((void)0));;
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(sizeof(array_t) == 16); if (!diminuto_unittest_condition) { int diminuto_unittest_errno; int diminuto_unittest_number; int diminuto_unittest_count; diminuto_unittest_errno = (*__errno_location ()); diminuto_unittest_number = diminuto_unittest_tests; diminuto_unittest_count = diminuto_unittest_error(); ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "tst/unittest-arraytype.c" "@" "81" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "sizeof(array_t) == 16") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "82" ": " "CHECKPOINT: " "variable\n") : ((void)0));;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "83" ": " "CHECKPOINT: " "variable=%p\n", (void *)variable) : ((void)0));;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "84" ": " "CHECKPOINT: " "widthof=%zu\n", sizeof(variable) * 8) : ((void)0));;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "85" ": " "CHECKPOINT: " "sizeof=%zu\n", sizeof(variable)) : ((void)0));;
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(sizeof(variable) == 16); if (!diminuto_unittest_condition) { int diminuto_unittest_errno; int diminuto_unittest_number; int diminuto_unittest_count; diminuto_unittest_errno = (*__errno_location ()); diminuto_unittest_number = diminuto_unittest_tests; diminuto_unittest_count = diminuto_unittest_error(); ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "tst/unittest-arraytype.c" "@" "86" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "sizeof(variable) == 16") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "87" ": " "CHECKPOINT: " "zeroth=%zu\n", sizeof(variable[0])) : ((void)0));;
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(sizeof(variable[0]) == 2); if (!diminuto_unittest_condition) { int diminuto_unittest_errno; int diminuto_unittest_number; int diminuto_unittest_count; diminuto_unittest_errno = (*__errno_location ()); diminuto_unittest_number = diminuto_unittest_tests; diminuto_unittest_count = diminuto_unittest_error(); ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "tst/unittest-arraytype.c" "@" "88" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "sizeof(variable[0]) == 2") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "89" ": " "CHECKPOINT: " "countof=%zu\n", sizeof(variable) / sizeof(variable[0])) : ((void)0));;
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!((sizeof(variable) / sizeof(variable[0])) == 8); if (!diminuto_unittest_condition) { int diminuto_unittest_errno; int diminuto_unittest_number; int diminuto_unittest_count; diminuto_unittest_errno = (*__errno_location ()); diminuto_unittest_number = diminuto_unittest_tests; diminuto_unittest_count = diminuto_unittest_error(); ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "tst/unittest-arraytype.c" "@" "90" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "(sizeof(variable) / sizeof(variable[0])) == 8") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "91" ": " "CHECKPOINT: " "eighth=%u\n", variable[7]) : ((void)0));;
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(variable[7] == 88); if (!diminuto_unittest_condition) { int diminuto_unittest_errno; int diminuto_unittest_number; int diminuto_unittest_count; diminuto_unittest_errno = (*__errno_location ()); diminuto_unittest_number = diminuto_unittest_tests; diminuto_unittest_count = diminuto_unittest_error(); ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "tst/unittest-arraytype.c" "@" "92" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "variable[7] == 88") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "93" ": " "CHECKPOINT: " "&variable=%p\n", (void *)&variable) : ((void)0));;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "94" ": " "CHECKPOINT: " "sizeof=%zu\n", sizeof(&variable)) : ((void)0));;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "95" ": " "CHECKPOINT: " "widthof=%zu\n", sizeof(*pointer) * 8) : ((void)0));;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "96" ": " "CHECKPOINT: " "pointer\n") : ((void)0));;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "97" ": " "CHECKPOINT: " "pointer=%p\n", (void *)pointer) : ((void)0));;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "98" ": " "CHECKPOINT: " "sizeof=%zu\n", sizeof(pointer)) : ((void)0));;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "99" ": " "CHECKPOINT: " "sizeof=%zu\n", sizeof(*pointer)) : ((void)0));;
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(sizeof(*pointer) == 16); if (!diminuto_unittest_condition) { int diminuto_unittest_errno; int diminuto_unittest_number; int diminuto_unittest_count; diminuto_unittest_errno = (*__errno_location ()); diminuto_unittest_number = diminuto_unittest_tests; diminuto_unittest_count = diminuto_unittest_error(); ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "tst/unittest-arraytype.c" "@" "100" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "sizeof(*pointer) == 16") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "101" ": " "CHECKPOINT: " "zeroth=%zu\n", sizeof((*pointer)[0])) : ((void)0));;
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(sizeof((*pointer)[0]) == 2); if (!diminuto_unittest_condition) { int diminuto_unittest_errno; int diminuto_unittest_number; int diminuto_unittest_count; diminuto_unittest_errno = (*__errno_location ()); diminuto_unittest_number = diminuto_unittest_tests; diminuto_unittest_count = diminuto_unittest_error(); ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "tst/unittest-arraytype.c" "@" "102" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "sizeof((*pointer)[0]) == 2") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "103" ": " "CHECKPOINT: " "countof=%zu\n", sizeof(*pointer) / sizeof((*pointer)[0])) : ((void)0));;
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!((sizeof(*pointer) / sizeof((*pointer)[0])) == 8); if (!diminuto_unittest_condition) { int diminuto_unittest_errno; int diminuto_unittest_number; int diminuto_unittest_count; diminuto_unittest_errno = (*__errno_location ()); diminuto_unittest_number = diminuto_unittest_tests; diminuto_unittest_count = diminuto_unittest_error(); ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "tst/unittest-arraytype.c" "@" "104" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "(sizeof(*pointer) / sizeof((*pointer)[0])) == 8") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "105" ": " "CHECKPOINT: " "eighth=%u\n", (*pointer)[7]) : ((void)0));;
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!((*pointer)[7] == 88); if (!diminuto_unittest_condition) { int diminuto_unittest_errno; int diminuto_unittest_number; int diminuto_unittest_count; diminuto_unittest_errno = (*__errno_location ()); diminuto_unittest_number = diminuto_unittest_tests; diminuto_unittest_count = diminuto_unittest_error(); ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "tst/unittest-arraytype.c" "@" "106" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "(*pointer)[7] == 88") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    foo(&variable);
    bar(variable);
    } while (0); do { int diminuto_unittest_number; int diminuto_unittest_count; int diminuto_unittest_added; diminuto_unittest_number = diminuto_unittest_tests; diminuto_unittest_count = diminuto_unittest_errors; diminuto_unittest_added = diminuto_unittest_count - diminuto_unittest_local; ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_NOTICE)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_NOTICE, "tst/unittest-arraytype.c" "@" "110" ": " "STATUS: tests=%d errors=%d %s " "\n", diminuto_unittest_number, diminuto_unittest_count, (diminuto_unittest_added == 0) ? "SUCCESS." : "FAILURE!") : ((void)0)); diminuto_unittest_flush(); } while (0); } while (0);;
    do { int diminuto_unittest_number; int diminuto_unittest_count; diminuto_unittest_number = diminuto_unittest_tests; diminuto_unittest_count = diminuto_unittest_errors; ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_NOTICE)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_NOTICE, "tst/unittest-arraytype.c" "@" "112" ": " "EXIT: tests=%d errors=%d %s " "\n", diminuto_unittest_number, diminuto_unittest_count, (diminuto_unittest_count == 0) ? "SUCCESS." : "FAILURE!") : ((void)0)); diminuto_unittest_flush(); exit(diminuto_unittest_count > DIMINUTO_UNITTEST_MAXIMUM ? DIMINUTO_UNITTEST_MAXIMUM : diminuto_unittest_count); } while (0);
}

canonical_original_code:
int main() {
    unsigned short variable[-1] = { 11, 22, 33, 44, 55, 66, 77, 88, };
    unsigned short (*pointer)[-1] = &variable;
    do { diminuto_unittest_setlogmask(); ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_NOTICE)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_NOTICE, "tst/unittest-arraytype.c" "@" "74" ": " "SETLOGMASK: logmask=0x%x\n", diminuto_log_mask) : ((void)0)); } while (0);
    do { int diminuto_unittest_local = 0; do { int diminuto_unittest_number = 0; diminuto_unittest_number = diminuto_unittest_test(); diminuto_unittest_local = diminuto_unittest_errors; ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_NOTICE)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_NOTICE, "tst/unittest-arraytype.c" "@" "76" ": " "TEST: %d tests=%d " "\n", (0), diminuto_unittest_number) : ((void)0)); diminuto_unittest_flush(); } while (0); do {;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "78" ": " "CHECKPOINT: " "array_t\n") : ((void)0));;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "79" ": " "CHECKPOINT: " "widthof=%zu\n", sizeof(array_t) * 8) : ((void)0));;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "80" ": " "CHECKPOINT: " "sizeof=%zu\n", sizeof(array_t)) : ((void)0));;
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(sizeof(array_t) == 16); if (!diminuto_unittest_condition) { int diminuto_unittest_errno; int diminuto_unittest_number; int diminuto_unittest_count; diminuto_unittest_errno = (*__errno_location ()); diminuto_unittest_number = diminuto_unittest_tests; diminuto_unittest_count = diminuto_unittest_error(); ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "tst/unittest-arraytype.c" "@" "81" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "sizeof(array_t) == 16") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "82" ": " "CHECKPOINT: " "variable\n") : ((void)0));;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "83" ": " "CHECKPOINT: " "variable=%p\n", (void *)variable) : ((void)0));;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "84" ": " "CHECKPOINT: " "widthof=%zu\n", sizeof(variable) * 8) : ((void)0));;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "85" ": " "CHECKPOINT: " "sizeof=%zu\n", sizeof(variable)) : ((void)0));;
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(sizeof(variable) == 16); if (!diminuto_unittest_condition) { int diminuto_unittest_errno; int diminuto_unittest_number; int diminuto_unittest_count; diminuto_unittest_errno = (*__errno_location ()); diminuto_unittest_number = diminuto_unittest_tests; diminuto_unittest_count = diminuto_unittest_error(); ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "tst/unittest-arraytype.c" "@" "86" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "sizeof(variable) == 16") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "87" ": " "CHECKPOINT: " "zeroth=%zu\n", sizeof(variable[0])) : ((void)0));;
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(sizeof(variable[0]) == 2); if (!diminuto_unittest_condition) { int diminuto_unittest_errno; int diminuto_unittest_number; int diminuto_unittest_count; diminuto_unittest_errno = (*__errno_location ()); diminuto_unittest_number = diminuto_unittest_tests; diminuto_unittest_count = diminuto_unittest_error(); ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "tst/unittest-arraytype.c" "@" "88" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "sizeof(variable[0]) == 2") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "89" ": " "CHECKPOINT: " "countof=%zu\n", sizeof(variable) / sizeof(variable[0])) : ((void)0));;
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!((sizeof(variable) / sizeof(variable[0])) == 8); if (!diminuto_unittest_condition) { int diminuto_unittest_errno; int diminuto_unittest_number; int diminuto_unittest_count; diminuto_unittest_errno = (*__errno_location ()); diminuto_unittest_number = diminuto_unittest_tests; diminuto_unittest_count = diminuto_unittest_error(); ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "tst/unittest-arraytype.c" "@" "90" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "(sizeof(variable) / sizeof(variable[0])) == 8") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "91" ": " "CHECKPOINT: " "eighth=%u\n", variable[7]) : ((void)0));;
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(variable[7] == 88); if (!diminuto_unittest_condition) { int diminuto_unittest_errno; int diminuto_unittest_number; int diminuto_unittest_count; diminuto_unittest_errno = (*__errno_location ()); diminuto_unittest_number = diminuto_unittest_tests; diminuto_unittest_count = diminuto_unittest_error(); ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "tst/unittest-arraytype.c" "@" "92" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "variable[7] == 88") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "93" ": " "CHECKPOINT: " "&variable=%p\n", (void *)&variable) : ((void)0));;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "94" ": " "CHECKPOINT: " "sizeof=%zu\n", sizeof(&variable)) : ((void)0));;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "95" ": " "CHECKPOINT: " "widthof=%zu\n", sizeof(*pointer) * 8) : ((void)0));;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "96" ": " "CHECKPOINT: " "pointer\n") : ((void)0));;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "97" ": " "CHECKPOINT: " "pointer=%p\n", (void *)pointer) : ((void)0));;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "98" ": " "CHECKPOINT: " "sizeof=%zu\n", sizeof(pointer)) : ((void)0));;
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "99" ": " "CHECKPOINT: " "sizeof=%zu\n", sizeof(*pointer)) : ((void)0));;
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(sizeof(*pointer) == 16); if (!diminuto_unittest_condition) { int diminuto_unittest_errno; int diminuto_unittest_number; int diminuto_unittest_count; diminuto_unittest_errno = (*__errno_location ()); diminuto_unittest_number = diminuto_unittest_tests; diminuto_unittest_count = diminuto_unittest_error(); ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "tst/unittest-arraytype.c" "@" "100" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "sizeof(*pointer) == 16") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "101" ": " "CHECKPOINT: " "zeroth=%zu\n", sizeof((*pointer)[0])) : ((void)0));;
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(sizeof((*pointer)[0]) == 2); if (!diminuto_unittest_condition) { int diminuto_unittest_errno; int diminuto_unittest_number; int diminuto_unittest_count; diminuto_unittest_errno = (*__errno_location ()); diminuto_unittest_number = diminuto_unittest_tests; diminuto_unittest_count = diminuto_unittest_error(); ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "tst/unittest-arraytype.c" "@" "102" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "sizeof((*pointer)[0]) == 2") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "103" ": " "CHECKPOINT: " "countof=%zu\n", sizeof(*pointer) / sizeof((*pointer)[0])) : ((void)0));;
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!((sizeof(*pointer) / sizeof((*pointer)[0])) == 8); if (!diminuto_unittest_condition) { int diminuto_unittest_errno; int diminuto_unittest_number; int diminuto_unittest_count; diminuto_unittest_errno = (*__errno_location ()); diminuto_unittest_number = diminuto_unittest_tests; diminuto_unittest_count = diminuto_unittest_error(); ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "tst/unittest-arraytype.c" "@" "104" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "(sizeof(*pointer) / sizeof((*pointer)[0])) == 8") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-arraytype.c" "@" "105" ": " "CHECKPOINT: " "eighth=%u\n", (*pointer)[7]) : ((void)0));;
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!((*pointer)[7] == 88); if (!diminuto_unittest_condition) { int diminuto_unittest_errno; int diminuto_unittest_number; int diminuto_unittest_count; diminuto_unittest_errno = (*__errno_location ()); diminuto_unittest_number = diminuto_unittest_tests; diminuto_unittest_count = diminuto_unittest_error(); ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_ERROR)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_ERROR, "tst/unittest-arraytype.c" "@" "106" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "(*pointer)[7] == 88") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    foo(&variable);
    bar(variable);
    } while (0); do { int diminuto_unittest_number; int diminuto_unittest_count; int diminuto_unittest_added; diminuto_unittest_number = diminuto_unittest_tests; diminuto_unittest_count = diminuto_unittest_errors; diminuto_unittest_added = diminuto_unittest_count - diminuto_unittest_local; ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_NOTICE)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_NOTICE, "tst/unittest-arraytype.c" "@" "110" ": " "STATUS: tests=%d errors=%d %s " "\n", diminuto_unittest_number, diminuto_unittest_count, (diminuto_unittest_added == 0) ? "SUCCESS." : "FAILURE!") : ((void)0)); diminuto_unittest_flush(); } while (0); } while (0);;
    do { int diminuto_unittest_number; int diminuto_unittest_count; diminuto_unittest_number = diminuto_unittest_tests; diminuto_unittest_count = diminuto_unittest_errors; ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_NOTICE)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_NOTICE, "tst/unittest-arraytype.c" "@" "112" ": " "EXIT: tests=%d errors=%d %s " "\n", diminuto_unittest_number, diminuto_unittest_count, (diminuto_unittest_count == 0) ? "SUCCESS." : "FAILURE!") : ((void)0)); diminuto_unittest_flush(); exit(diminuto_unittest_count > DIMINUTO_UNITTEST_MAXIMUM ? DIMINUTO_UNITTEST_MAXIMUM : diminuto_unittest_count); } while (0);
}


decompiled_code:
char *__fastcall diminuto_pin_debug(char *a1)
{
char *result; // rax

result = root;
if ( !a1 )
a1 = "/sys";
root = a1;
return result;
}

canonical_decompiled_code:
char *__fastcall func0(char *a1)
{
char *result; // rax

result = root;
if ( !a1 )
a1 = "/sys";
root = a1;
return result;
}

original_code:
const char * diminuto_pin_debug(const char * tmp)
{
    const char * prior;
    prior = root;
    root = (tmp != (const char *)0) ? tmp : ROOT;
    return prior;
}

canonical_original_code:
char *diminuto_pin_debug(char *tmp)
{
    char *prior;
    prior = root;
    root = (tmp != (char *)0) ? tmp : ROOT;
    return prior;
}

variable_types:
tmp
char *

variable_types:
prior
char *

return_type: char *


decompiled_code:
__int64 __fastcall diminuto_pin_configure(char *a1, int a2, const char *a3)
{
return diminuto_pin_configure_generic(a1, a2, a3, 0, diminuto_pin_tries);
}

canonical_decompiled_code:
__int64 __fastcall func2(char *a1, int a2, const char *a3)
{
return func1(a1, a2, a3, 0, diminuto_pin_tries);
}

original_code:
static inline int diminuto_pin_configure(const char * format, int pin, const char * string)
{
    return diminuto_pin_configure_generic(format, pin, string, 0, diminuto_pin_tries, diminuto_pin_delay);
}

canonical_original_code:
static inline int diminuto_pin_configure(char *format, int pin, char *string)
{
    return diminuto_pin_configure_generic(format, pin, string, 0, diminuto_pin_tries, diminuto_pin_delay);
}

variable_types:
format
char *

variable_types: pin int

variable_types:
string
char *


decompiled_code:
__int64 __fastcall diminuto_pin_direction(int a1, int a2)
{
const char *v2; // rdx

v2 = "out\n";
if ( !a2 )
v2 = "in\n";
return diminuto_pin_configure("%s/class/gpio/gpio%u/direction", a1, v2);
}

canonical_decompiled_code:
__int64 __fastcall func3(int a1, int a2)
{
const char *v2; // rdx

v2 = "out\n";
if ( !a2 )
v2 = "in\n";
return func2("%s/class/gpio/gpio%u/direction", a1, v2);
}

original_code:
static inline int diminuto_pin_direction(int pin, int output)
{
    return diminuto_pin_configure(DIMINUTO_PIN_ROOT_CLASS_GPIO_PIN_DIRECTION, pin, output ? "out\n" : "in\n");
}

variable_types: output int


decompiled_code:
__int64 __fastcall diminuto_pin_port_generic(char *format, unsigned int a2, int a3)
{
char v5[72]; // [rsp+0h] [rbp-48h] BYREF

snprintf(v5, 0x16uLL, "%d\n", a2);
return diminuto_pin_configure_generic(format, a2, v5, a3, 1);
}

canonical_decompiled_code:
__int64 __fastcall func4(char *format, unsigned int a2, int a3)
{
char v5[72]; // [rsp+0h] [rbp-48h] BYREF

snprintf(v5, 0x16uLL, "%d\n", a2);
return func1(format, a2, v5, a3, 1);
}

original_code:
int diminuto_pin_port_generic(const char * format, int pin, int ignore)
{
    char buffer[sizeof("-9223372036854775807\n")];
    snprintf(buffer, sizeof(buffer), "%d\n", pin);
    return diminuto_pin_configure_generic(format, pin, buffer, ignore, 1, 0);
}

canonical_original_code:
int diminuto_pin_port_generic(char *format, int pin, int ignore)
{
    char buffer[-1];
    snprintf(buffer, sizeof(buffer), "%d\n", pin);
    return diminuto_pin_configure_generic(format, pin, buffer, ignore, 1, 0);
}

variable_types: ignore int

variable_types:
buffer
char [-1]


decompiled_code:
__int64 __fastcall diminuto_pin_export(unsigned int a1)
{
return diminuto_pin_port("%s/class/gpio/export", a1);
}

canonical_decompiled_code:
__int64 __fastcall func6(unsigned int a1)
{
return func5("%s/class/gpio/export", a1);
}

original_code:
static inline int diminuto_pin_export(int pin)
{
    return diminuto_pin_port(DIMINUTO_PIN_ROOT_CLASS_GPIO_EXPORT, pin);
}


decompiled_code:
__int64 __fastcall diminuto_pin_unexport(unsigned int a1)
{
return diminuto_pin_port_generic("%s/class/gpio/unexport", a1, 0);
}

canonical_decompiled_code:
__int64 __fastcall func7(unsigned int a1)
{
return func4("%s/class/gpio/unexport", a1, 0);
}

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


decompiled_code:
__int64 __fastcall diminuto_pin_edge(int a1, int a2)
{
const char *v2; // rdx

v2 = "rising\n";
if ( a2 != 1 )
{
v2 = "both\n";
if ( a2 != 3 )
{
v2 = "falling\n";
if ( !a2 )
v2 = "none\n";
}
}
return diminuto_pin_configure("%s/class/gpio/gpio%u/edge", a1, v2);
}

canonical_decompiled_code:
__int64 __fastcall func8(int a1, int a2)
{
const char *v2; // rdx

v2 = "rising\n";
if ( a2 != 1 )
{
v2 = "both\n";
if ( a2 != 3 )
{
v2 = "falling\n";
if ( !a2 )
v2 = "none\n";
}
}
return func2("%s/class/gpio/gpio%u/edge", a1, v2);
}

original_code:
int diminuto_pin_edge(int pin, diminuto_pin_edge_t edge)
{
    const char * string = (const char *)0;
    switch (edge) {
    case DIMINUTO_PIN_EDGE_NONE: string = "none\n"; break;
    case DIMINUTO_PIN_EDGE_RISING: string = "rising\n"; break;
    default:
    case DIMINUTO_PIN_EDGE_FALLING: string = "falling\n"; break;
    case DIMINUTO_PIN_EDGE_BOTH: string = "both\n"; break;
    }
    return diminuto_pin_configure(DIMINUTO_PIN_ROOT_CLASS_GPIO_PIN_EDGE, pin, string);
}

canonical_original_code:
int diminuto_pin_edge(int pin, enum DiminutoPinEdge edge)
{
    char *string = (const char *)0;
    switch (edge) {
    case DIMINUTO_PIN_EDGE_NONE: string = "none\n"; break;
    case DIMINUTO_PIN_EDGE_RISING: string = "rising\n"; break;
    default:
    case DIMINUTO_PIN_EDGE_FALLING: string = "falling\n"; break;
    case DIMINUTO_PIN_EDGE_BOTH: string = "both\n"; break;
    }
    return diminuto_pin_configure(DIMINUTO_PIN_ROOT_CLASS_GPIO_PIN_EDGE, pin, string);
}

variable_types: enum DiminutoPinEdge { DIMINUTO_PIN_EDGE_NONE=0, DIMINUTO_PIN_EDGE_RISING=1, DIMINUTO_PIN_EDGE_FALLING=2, DIMINUTO_PIN_EDGE_BOTH=3 }


original_code:
static inline uint8_t diminuto_hamming84_dat2sym(uint8_t nib) {
    return (
        (((nib & H84_D1_BIT) >> H84_D1_OFF) << H84_S1_OFF) |
        (((nib & H84_D2_BIT) >> H84_D2_OFF) << H84_S2_OFF) |
        (((nib & H84_D3_BIT) >> H84_D3_OFF) << H84_S3_OFF) |
        (((nib & H84_D4_BIT) >> H84_D4_OFF) << H84_S4_OFF)
    );
}

canonical_original_code:
static inline unsigned char diminuto_hamming84_dat2sym(unsigned char nib) {
    return (
        (((nib & H84_D1_BIT) >> H84_D1_OFF) << H84_S1_OFF) |
        (((nib & H84_D2_BIT) >> H84_D2_OFF) << H84_S2_OFF) |
        (((nib & H84_D3_BIT) >> H84_D3_OFF) << H84_S3_OFF) |
        (((nib & H84_D4_BIT) >> H84_D4_OFF) << H84_S4_OFF)
    );
}

variable_types:
nib
unsigned char

return_type: unsigned char


original_code:
static inline uint8_t diminuto_hamming84_sym2dat(uint8_t sym) {
    return (
        (((sym & H84_S1_BIT) >> H84_S1_OFF) << H84_D1_OFF) |
        (((sym & H84_S2_BIT) >> H84_S2_OFF) << H84_D2_OFF) |
        (((sym & H84_S3_BIT) >> H84_S3_OFF) << H84_D3_OFF) |
        (((sym & H84_S4_BIT) >> H84_S4_OFF) << H84_D4_OFF)
    );
}

canonical_original_code:
static inline unsigned char diminuto_hamming84_sym2dat(unsigned char sym) {
    return (
        (((sym & H84_S1_BIT) >> H84_S1_OFF) << H84_D1_OFF) |
        (((sym & H84_S2_BIT) >> H84_S2_OFF) << H84_D2_OFF) |
        (((sym & H84_S3_BIT) >> H84_S3_OFF) << H84_D3_OFF) |
        (((sym & H84_S4_BIT) >> H84_S4_OFF) << H84_D4_OFF)
    );
}

variable_types:
sym
unsigned char


decompiled_code:
__int64 __fastcall diminuto_hamming84_sym2par1(unsigned __int8 a1)
{
return (((int)a1 >> 1) ^ ((int)a1 >> 3) ^ (unsigned int)((int)a1 >> 5)) << 7;
}

canonical_decompiled_code:
__int64 __fastcall func2(unsigned __int8 a1)
{
return (((int)a1 >> 1) ^ ((int)a1 >> 3) ^ (unsigned int)((int)a1 >> 5)) << 7;
}

original_code:
static inline uint8_t diminuto_hamming84_sym2par1(uint8_t sym) {
    return (
        ((sym & H84_S1_BIT) >> H84_S1_OFF) ^
        ((sym & H84_S2_BIT) >> H84_S2_OFF) ^
        ((sym & H84_S4_BIT) >> H84_S4_OFF)
    ) << H84_P1_OFF;
}

canonical_original_code:
static inline unsigned char diminuto_hamming84_sym2par1(unsigned char sym) {
    return (
        ((sym & H84_S1_BIT) >> H84_S1_OFF) ^
        ((sym & H84_S2_BIT) >> H84_S2_OFF) ^
        ((sym & H84_S4_BIT) >> H84_S4_OFF)
    ) << H84_P1_OFF;
}


decompiled_code:
__int64 __fastcall diminuto_hamming84_sym2par2(unsigned __int8 a1)
{
return ((((int)a1 >> 1) ^ ((int)a1 >> 2) ^ ((int)a1 >> 5)) << 6) & 0x40;
}

original_code:
static inline uint8_t diminuto_hamming84_sym2par2(uint8_t sym) {
    return (
        ((sym & H84_S1_BIT) >> H84_S1_OFF) ^
        ((sym & H84_S3_BIT) >> H84_S3_OFF) ^
        ((sym & H84_S4_BIT) >> H84_S4_OFF)
    ) << H84_P2_OFF;
}

canonical_original_code:
static inline unsigned char diminuto_hamming84_sym2par2(unsigned char sym) {
    return (
        ((sym & H84_S1_BIT) >> H84_S1_OFF) ^
        ((sym & H84_S3_BIT) >> H84_S3_OFF) ^
        ((sym & H84_S4_BIT) >> H84_S4_OFF)
    ) << H84_P2_OFF;
}


decompiled_code:
__int64 __fastcall diminuto_hamming84_sym2par3(unsigned __int8 a1)
{
return (16 * (((int)a1 >> 1) ^ ((int)a1 >> 2) ^ ((int)a1 >> 3))) & 0x10;
}

original_code:
static inline uint8_t diminuto_hamming84_sym2par3(uint8_t sym) {
    return (
        ((sym & H84_S2_BIT) >> H84_S2_OFF) ^
        ((sym & H84_S3_BIT) >> H84_S3_OFF) ^
        ((sym & H84_S4_BIT) >> H84_S4_OFF)
    ) << H84_P3_OFF;
}

canonical_original_code:
static inline unsigned char diminuto_hamming84_sym2par3(unsigned char sym) {
    return (
        ((sym & H84_S2_BIT) >> H84_S2_OFF) ^
        ((sym & H84_S3_BIT) >> H84_S3_OFF) ^
        ((sym & H84_S4_BIT) >> H84_S4_OFF)
    ) << H84_P3_OFF;
}


decompiled_code:
__int64 __fastcall diminuto_hamming84_sym2par4(int a1)
{
int v1; // edx
int v2; // eax

v1 = (unsigned __int8)a1;
v2 = (((int)(unsigned __int8)a1 >> 3) ^ ((int)(unsigned __int8)a1 >> 4)) & 1;
LOBYTE(a1) = (unsigned __int8)a1 >> 7;
return ((unsigned __int8)(v1 >> 6) ^ (unsigned __int8)(v1 >> 5)) & 1 ^ (v1 >> 1) & 1 ^ (v1 >> 2) & 1 ^ a1 ^ (unsigned int)v2;
}

canonical_decompiled_code:
__int64 __fastcall func5(int a1)
{
int v1; // edx
int v2; // eax

v1 = (unsigned __int8)a1;
v2 = (((int)(unsigned __int8)a1 >> 3) ^ ((int)(unsigned __int8)a1 >> 4)) & 1;
LOBYTE(a1) = (unsigned __int8)a1 >> 7;
return ((unsigned __int8)(v1 >> 6) ^ (unsigned __int8)(v1 >> 5)) & 1 ^ (v1 >> 1) & 1 ^ (v1 >> 2) & 1 ^ a1 ^ (unsigned int)v2;
}

canonical_original_code:
static inline unsigned char diminuto_hamming84_sym2par4(unsigned char sym) {
    return (
        ((sym & H84_P1_BIT) >> H84_P1_OFF) ^
        ((sym & H84_P2_BIT) >> H84_P2_OFF) ^
        ((sym & H84_S1_BIT) >> H84_S1_OFF) ^
        ((sym & H84_P3_BIT) >> H84_P3_OFF) ^
        ((sym & H84_S2_BIT) >> H84_S2_OFF) ^
        ((sym & H84_S3_BIT) >> H84_S3_OFF) ^
        ((sym & H84_S4_BIT) >> H84_S4_OFF)
    ) << H84_P4_OFF;
}


original_code:
static inline int diminuto_hamming84_sym_is_valid(uint8_t sym) {
    switch (sym) {
    case 0x00:
    case 0xd2:
    case 0x55:
    case 0x87:
    case 0x99:
    case 0x4b:
    case 0xcc:
    case 0x1e:
    case 0xe1:
    case 0x33:
    case 0xb4:
    case 0x66:
    case 0x78:
    case 0xaa:
    case 0x2d:
    case 0xff:
        return !0;
    default:
        return 0;
    }
}

canonical_original_code:
static inline int diminuto_hamming84_sym_is_valid(unsigned char sym) {
    switch (sym) {
    case 0x00:
    case 0xd2:
    case 0x55:
    case 0x87:
    case 0x99:
    case 0x4b:
    case 0xcc:
    case 0x1e:
    case 0xe1:
    case 0x33:
    case 0xb4:
    case 0x66:
    case 0x78:
    case 0xaa:
    case 0x2d:
    case 0xff:
        return !0;
    default:
        return 0;
    }
}


decompiled_code:
__int64 __fastcall diminuto_hamming84_sym2off(int a1)
{
unsigned int v1; // ebx
int v2; // er12

v1 = diminuto_hamming84_sym2par1(a1);
v2 = diminuto_hamming84_sym2par2(a1);
return 8
- (((a1 ^ v1) >> 7) | (((unsigned int)diminuto_hamming84_sym2par3(a1) ^ a1 & 0x10) >> 2) & 0x3C | ((v2 ^ a1 & 0x40u) >> 5) & 6);
}

original_code:
static inline uint8_t diminuto_hamming84_sym2off(uint8_t sym) {
    return (8 - (
        (((diminuto_hamming84_sym2par1(sym) ^ (sym & H84_P1_BIT)) >> H84_P1_OFF) << H84_O1_OFF) |
        (((diminuto_hamming84_sym2par2(sym) ^ (sym & H84_P2_BIT)) >> H84_P2_OFF) << H84_O2_OFF) |
        (((diminuto_hamming84_sym2par3(sym) ^ (sym & H84_P3_BIT)) >> H84_P3_OFF) << H84_O3_OFF)
    ));
}

canonical_original_code:
static inline unsigned char diminuto_hamming84_sym2off(unsigned char sym) {
    return (8 - (
        (((diminuto_hamming84_sym2par1(sym) ^ (sym & H84_P1_BIT)) >> H84_P1_OFF) << H84_O1_OFF) |
        (((diminuto_hamming84_sym2par2(sym) ^ (sym & H84_P2_BIT)) >> H84_P2_OFF) << H84_O2_OFF) |
        (((diminuto_hamming84_sym2par3(sym) ^ (sym & H84_P3_BIT)) >> H84_P3_OFF) << H84_O3_OFF)
    ));
}


decompiled_code:
__int64 __fastcall diminuto_hamming84_nib2sym(unsigned __int8 a1)
{
int v1; // ebx
int v2; // ebp
int v3; // ebp
int v4; // ebx

v1 = diminuto_hamming84_dat2sym(a1);
v2 = diminuto_hamming84_sym2par1(v1);
v3 = diminuto_hamming84_sym2par2(v1) | v2;
v4 = v3 | diminuto_hamming84_sym2par3(v1) | v1;
return v4 | (unsigned int)diminuto_hamming84_sym2par4((unsigned __int8)v4);
}

canonical_decompiled_code:
__int64 __fastcall func8(unsigned __int8 a1)
{
int v1; // ebx
int v2; // ebp
int v3; // ebp
int v4; // ebx

v1 = func0(a1);
v2 = func2(v1);
v3 = func3(v1) | v2;
v4 = v3 | func4(v1) | v1;
return v4 | (unsigned int)func5((unsigned __int8)v4);
}

original_code:
uint8_t diminuto_hamming84_nib2sym(uint8_t nib) {
    uint8_t sym;
    sym = diminuto_hamming84_dat2sym(nib);
    sym |= diminuto_hamming84_sym2par1(sym) | diminuto_hamming84_sym2par2(sym) | diminuto_hamming84_sym2par3(sym);
    return sym | diminuto_hamming84_sym2par4(sym);
}

canonical_original_code:
unsigned char diminuto_hamming84_nib2sym(unsigned char nib) {
    unsigned char sym;
    sym = diminuto_hamming84_dat2sym(nib);
    sym |= diminuto_hamming84_sym2par1(sym) | diminuto_hamming84_sym2par2(sym) | diminuto_hamming84_sym2par3(sym);
    return sym | diminuto_hamming84_sym2par4(sym);
}


decompiled_code:
__int64 __fastcall diminuto_hamming84_sym2nib(unsigned __int8 a1, _BYTE *a2)
{
unsigned __int8 v2; // bp
__int64 result; // rax

if ( diminuto_hamming84_sym_is_valid(a1) )
{
*a2 = 0;
result = diminuto_hamming84_sym2dat(a1);
}
else
{
v2 = a1 ^ (1 << diminuto_hamming84_sym2off(a1));
if ( diminuto_hamming84_sym_is_valid(v2) )
{
*a2 = 1;
result = diminuto_hamming84_sym2dat(v2);
}
else if ( diminuto_hamming84_sym_is_valid(a1 ^ 1u) )
{
*a2 = 1;
result = diminuto_hamming84_sym2dat(a1 ^ 1u);
}
else
{
*a2 = 2;
result = 0LL;
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func9(unsigned __int8 a1, _BYTE *a2)
{
unsigned __int8 v2; // bp
__int64 result; // rax

if ( func6(a1) )
{
*a2 = 0;
result = func1(a1);
}
else
{
v2 = a1 ^ (1 << func7(a1));
if ( func6(v2) )
{
*a2 = 1;
result = func1(v2);
}
else if ( func6(a1 ^ 1u) )
{
*a2 = 1;
result = func1(a1 ^ 1u);
}
else
{
*a2 = 2;
result = 0LL;
}
}
return result;
}

original_code:
uint8_t diminuto_hamming84_sym2nib(uint8_t sym, uint8_t * errorsp) {
    uint8_t fix;
    if (diminuto_hamming84_sym_is_valid(sym)) {
        *errorsp = 0;
        return diminuto_hamming84_sym2dat(sym);
    }
    fix = sym ^ (1 << diminuto_hamming84_sym2off(sym));
    if (diminuto_hamming84_sym_is_valid(fix)) {
        *errorsp = 1;
        return diminuto_hamming84_sym2dat(fix);
    }
    fix = sym ^ H84_P4_BIT;
    if (diminuto_hamming84_sym_is_valid(fix)) {
        *errorsp = 1;
        return diminuto_hamming84_sym2dat(fix);
    }
    *errorsp = 2;
    return 0;
}

canonical_original_code:
unsigned char diminuto_hamming84_sym2nib(unsigned char sym, unsigned char *errorsp) {
    unsigned char fix;
    if (diminuto_hamming84_sym_is_valid(sym)) {
        *errorsp = 0;
        return diminuto_hamming84_sym2dat(sym);
    }
    fix = sym ^ (1 << diminuto_hamming84_sym2off(sym));
    if (diminuto_hamming84_sym_is_valid(fix)) {
        *errorsp = 1;
        return diminuto_hamming84_sym2dat(fix);
    }
    fix = sym ^ H84_P4_BIT;
    if (diminuto_hamming84_sym_is_valid(fix)) {
        *errorsp = 1;
        return diminuto_hamming84_sym2dat(fix);
    }
    *errorsp = 2;
    return 0;
}

variable_types:
errorsp
unsigned char *

variable_types:
fix
unsigned char


decompiled_code:
__int64 __fastcall diminuto_uninterruptiblesection_block(__int64 a1, __int64 a2, __sigset_t *a3)
{
int v4; // eax
__int64 v5; // rbp
int v6; // ebx
sigset_t v8; // [rsp+0h] [rbp-B8h] BYREF

v4 = sigemptyset(&v8);
if ( v4 < 0 )
{
v6 = v4;
diminuto_log_perror(
"src/diminuto_uninterruptiblesection.c",
24LL,
"diminuto_uninterruptiblesection_block: sigemptyset");
}
else
{
v5 = 0LL;
if ( a2 )
{
while ( 1 )
{
v6 = sigaddset(&v8, *(_DWORD *)(a1 + 4 * v5));
if ( v6 < 0 )
break;
if ( a2 == ++v5 )
goto LABEL_5;
}
diminuto_log_perror(
"src/diminuto_uninterruptiblesection.c",
32LL,
"diminuto_uninterruptiblesection_block: sigaddset");
}
else
{
LABEL_5:
v6 = pthread_sigmask(0, &v8, a3);
if ( v6 )
{
*_errno_location() = v6;
diminuto_log_perror(
"src/diminuto_uninterruptiblesection.c",
35LL,
"diminuto_uninterruptiblesection_block: pthread_sigmask");
v6 = -1;
}
}
}
return (unsigned int)v6;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, __int64 a2, __sigset_t *a3)
{
int v4; // eax
__int64 v5; // rbp
int v6; // ebx
sigset_t v8; // [rsp+0h] [rbp-B8h] BYREF

v4 = sigemptyset(&v8);
if ( v4 < 0 )
{
v6 = v4;
diminuto_log_perror(
"src/diminuto_uninterruptiblesection.c",
24LL,
"diminuto_uninterruptiblesection_block: sigemptyset");
}
else
{
v5 = 0LL;
if ( a2 )
{
while ( 1 )
{
v6 = sigaddset(&v8, *(_DWORD *)(a1 + 4 * v5));
if ( v6 < 0 )
break;
if ( a2 == ++v5 )
goto LABEL_5;
}
diminuto_log_perror(
"src/diminuto_uninterruptiblesection.c",
32LL,
"diminuto_uninterruptiblesection_block: sigaddset");
}
else
{
LABEL_5:
v6 = pthread_sigmask(0, &v8, a3);
if ( v6 )
{
*_errno_location() = v6;
diminuto_log_perror(
"src/diminuto_uninterruptiblesection.c",
35LL,
"diminuto_uninterruptiblesection_block: pthread_sigmask");
v6 = -1;
}
}
}
return (unsigned int)v6;
}

original_code:
int diminuto_uninterruptiblesection_block(const int signals[], size_t count, sigset_t * sp)
{
    int rc = 0;
    int ii = 0;
    sigset_t set;
    if ((rc = sigemptyset(&set)) < 0) {
        diminuto_log_perror("src/diminuto_uninterruptiblesection.c", 24, "diminuto_uninterruptiblesection_block: sigemptyset");
    } else {
        for (ii = 0; ii < count; ++ii) {
            if ((rc = sigaddset(&set, signals[ii])) < 0) {
                break;
            }
        }
        if (rc < 0) {
            diminuto_log_perror("src/diminuto_uninterruptiblesection.c", 32, "diminuto_uninterruptiblesection_block: sigaddset");
        } else if ((rc = pthread_sigmask(0, &set, sp)) != 0) {
            (*__errno_location ()) = rc;
            diminuto_log_perror("src/diminuto_uninterruptiblesection.c", 35, "diminuto_uninterruptiblesection_block: pthread_sigmask");
            rc = -1;
        } else {
        }
    }
    return rc;
}

canonical_original_code:
int diminuto_uninterruptiblesection_block(int signals[], unsigned long count, struct __sigset_t *sp)
{
    int rc = 0;
    int ii = 0;
    struct __sigset_t set;
    if ((rc = sigemptyset(&set)) < 0) {
        diminuto_log_perror("src/diminuto_uninterruptiblesection.c", 24, "diminuto_uninterruptiblesection_block: sigemptyset");
    } else {
        for (ii = 0; ii < count; ++ii) {
            if ((rc = sigaddset(&set, signals[ii])) < 0) {
                break;
            }
        }
        if (rc < 0) {
            diminuto_log_perror("src/diminuto_uninterruptiblesection.c", 32, "diminuto_uninterruptiblesection_block: sigaddset");
        } else if ((rc = pthread_sigmask(0, &set, sp)) != 0) {
            (*__errno_location ()) = rc;
            diminuto_log_perror("src/diminuto_uninterruptiblesection.c", 35, "diminuto_uninterruptiblesection_block: pthread_sigmask");
            rc = -1;
        } else {
        }
    }
    return rc;
}

variable_types:
signals
int []

variable_types:
count
unsigned long

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

variable_types: rc int

variable_types: ii int


decompiled_code:
int __fastcall diminuto_uninterruptiblesection_cleanup(__sigset_t *newmask)
{
int result; // eax

result = pthread_sigmask(2, newmask, 0LL);
if ( result )
{
*_errno_location() = result;
result = diminuto_log_perror(
"src/diminuto_uninterruptiblesection.c",
52LL,
"diminuto_uninterruptiblesection_cleanup: pthread_sigmask");
}
return result;
}

canonical_decompiled_code:
int __fastcall func1(__sigset_t *newmask)
{
int result; // eax

result = pthread_sigmask(2, newmask, 0LL);
if ( result )
{
*_errno_location() = result;
result = diminuto_log_perror(
"src/diminuto_uninterruptiblesection.c",
52LL,
"diminuto_uninterruptiblesection_cleanup: pthread_sigmask");
}
return result;
}

original_code:
void diminuto_uninterruptiblesection_cleanup(void * vp)
{
    sigset_t * sp = (sigset_t *)vp;
    int rc = 0;
    if ((rc = pthread_sigmask(2, sp, (sigset_t *)0)) != 0) {
        (*__errno_location ()) = rc;
        diminuto_log_perror("src/diminuto_uninterruptiblesection.c", 52, "diminuto_uninterruptiblesection_cleanup: pthread_sigmask");
    }
}

canonical_original_code:
void diminuto_uninterruptiblesection_cleanup(void *vp)
{
    struct __sigset_t *sp = (sigset_t *)vp;
    int rc = 0;
    if ((rc = pthread_sigmask(2, sp, (struct __sigset_t *)0)) != 0) {
        (*__errno_location ()) = rc;
        diminuto_log_perror("src/diminuto_uninterruptiblesection.c", 52, "diminuto_uninterruptiblesection_cleanup: pthread_sigmask");
    }
}

variable_types:
vp
void *

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


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

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

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

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

original_code: diminuto_string_strdup_func_t * diminuto_string_strdup_set(diminuto_string_strdup_func_t * now) { static pthread_mutex_t mutex = { { 0, 0, 0, 0, 0, 0, 0, { 0, 0 } } }; diminuto_string_strdup_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_strdup_func_p; diminuto_string_strdup_func_p = (now != (diminuto_string_strdup_func_t *)0) ? now : &strdup; } 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_strdup_set(char *(*now)(char *s)))(char *s) { static union pthread_mutex_t mutex = { { 0, 0, 0, 0, 0, 0, 0, { 0, 0 } } }; char *(*was)(char *s); 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_strdup_func_p; diminuto_string_strdup_func_p = (now != (char *(*)(char *s))0) ? now : &strdup; } 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)

variable_types:
was
char *(*)(char *s)

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

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

return_type: char *(*)(char *s)

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