main

canonical_name: main

decompiled_code:
int __cdecl __noreturn main(int argc, const char **argv, const char **envp)
{
int v3; // ebp
int v4; // edi
__int64 v5[9]; // [rsp+0h] [rbp-48h] BYREF

v5[0] = 0x2C00210016000BLL;
v5[1] = 0x58004D00420037LL;
diminuto_unittest_setlogmask();
if ( (diminuto_log_mask & 4) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@74: SETLOGMASK: logmask=0x%x\n";
diminuto_log_log();
}
diminuto_unittest_test();
if ( (diminuto_log_mask & 4) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@76: TEST: %d tests=%d \n";
diminuto_log_log();
}
diminuto_unittest_flush();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@78: CHECKPOINT: array_t\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@79: CHECKPOINT: widthof=%zu\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@80: CHECKPOINT: sizeof=%zu\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@82: CHECKPOINT: variable\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@83: CHECKPOINT: variable=%p\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@84: CHECKPOINT: widthof=%zu\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@85: CHECKPOINT: sizeof=%zu\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@87: CHECKPOINT: zeroth=%zu\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@89: CHECKPOINT: countof=%zu\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@91: CHECKPOINT: eighth=%u\n";
diminuto_log_log();
}
}
}
}
}
}
}
}
}
}
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@93: CHECKPOINT: &variable=%p\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@94: CHECKPOINT: sizeof=%zu\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@95: CHECKPOINT: widthof=%zu\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@96: CHECKPOINT: pointer\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@97: CHECKPOINT: pointer=%p\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@98: CHECKPOINT: sizeof=%zu\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@99: CHECKPOINT: sizeof=%zu\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@101: CHECKPOINT: zeroth=%zu\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@103: CHECKPOINT: countof=%zu\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@105: CHECKPOINT: eighth=%u\n";
diminuto_log_log();
}
}
}
}
}
}
}
}
}
}
foo(v5, argv);
bar(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; // ebp
int v4; // edi
__int64 v5[9]; // [rsp+0h] [rbp-48h] BYREF

v5[0] = 0x2C00210016000BLL;
v5[1] = 0x58004D00420037LL;
diminuto_unittest_setlogmask();
if ( (diminuto_log_mask & 4) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@74: SETLOGMASK: logmask=0x%x\n";
diminuto_log_log();
}
diminuto_unittest_test();
if ( (diminuto_log_mask & 4) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@76: TEST: %d tests=%d \n";
diminuto_log_log();
}
diminuto_unittest_flush();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@78: CHECKPOINT: array_t\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@79: CHECKPOINT: widthof=%zu\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@80: CHECKPOINT: sizeof=%zu\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@82: CHECKPOINT: variable\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@83: CHECKPOINT: variable=%p\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@84: CHECKPOINT: widthof=%zu\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@85: CHECKPOINT: sizeof=%zu\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@87: CHECKPOINT: zeroth=%zu\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@89: CHECKPOINT: countof=%zu\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@91: CHECKPOINT: eighth=%u\n";
diminuto_log_log();
}
}
}
}
}
}
}
}
}
}
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@93: CHECKPOINT: &variable=%p\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@94: CHECKPOINT: sizeof=%zu\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@95: CHECKPOINT: widthof=%zu\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@96: CHECKPOINT: pointer\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@97: CHECKPOINT: pointer=%p\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@98: CHECKPOINT: sizeof=%zu\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@99: CHECKPOINT: sizeof=%zu\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@101: CHECKPOINT: zeroth=%zu\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@103: CHECKPOINT: countof=%zu\n";
diminuto_log_log();
if ( (diminuto_log_mask & 2) != 0 )
{
argv = (const char **)"tst/unittest-arraytype.c@105: CHECKPOINT: eighth=%u\n";
diminuto_log_log();
}
}
}
}
}
}
}
}
}
}
func7(v5, argv);
func8(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);
}


repo: coverclock/com-diag-diminuto

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 *

return_type: int


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_unexport(unsigned int a1)
{
return diminuto_pin_port_generic("%s/class/gpio/unexport", a1, 0);
}

canonical_decompiled_code:
__int64 __fastcall func5(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:
// attributes: thunk
__int64 __fastcall diminuto_pin_export(unsigned int a1)
{
return diminuto_pin_port_constprop_0(a1);
}

canonical_decompiled_code:
__int64 __fastcall func7(unsigned int a1)
{
return func6(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_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

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

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

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

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(unsigned __int8 a1)
{
unsigned __int8 v1; // r9
unsigned __int8 v2; // r9
int v3; // eax
int v4; // er8
int v5; // ecx

diminuto_hamming84_sym2par1(a1);
diminuto_hamming84_sym2par2(v1);
v3 = diminuto_hamming84_sym2par3(v2);
return 8 - (v5 | ((v3 ^ a1 & 0x10u) >> 2) & 0x3C | ((v4 ^ a1 & 0x40u) >> 5) & 6);
}

canonical_decompiled_code:
__int64 __fastcall func7(unsigned __int8 a1)
{
unsigned __int8 v1; // r9
unsigned __int8 v2; // r9
int v3; // eax
int v4; // er8
int v5; // ecx

func2(a1);
func3(v1);
v3 = func4(v2);
return 8 - (v5 | ((v3 ^ a1 & 0x10u) >> 2) & 0x3C | ((v4 ^ 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)
{
unsigned __int8 v1; // al
int v2; // esi
unsigned __int8 v3; // r8
unsigned __int8 v4; // r8
int v5; // eax
int v6; // ecx

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

canonical_decompiled_code:
__int64 __fastcall func8(unsigned __int8 a1)
{
unsigned __int8 v1; // al
int v2; // esi
unsigned __int8 v3; // r8
unsigned __int8 v4; // r8
int v5; // eax
int v6; // ecx

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

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)
{
char v2; // al
char v3; // r10
unsigned __int8 v4; // di
char v5; // r10
_BYTE *v6; // r11
__int64 result; // rax

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

canonical_decompiled_code:
__int64 __fastcall func9(unsigned __int8 a1, _BYTE *a2)
{
char v2; // al
char v3; // r10
unsigned __int8 v4; // di
char v5; // r10
_BYTE *v6; // r11
__int64 result; // rax

if ( func6(a1) )
{
*a2 = 0;
result = func1(a1);
}
else
{
v2 = func7(a1);
v4 = v3 ^ (1 << v2);
if ( func6(v4) || (v4 = v5 ^ 1, func6(v5 ^ 1u)) )
{
*v6 = 1;
result = func1(v4);
}
else
{
*v6 = 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; // r14
int v6; // er12
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 ( ++v5 == a2 )
goto LABEL_8;
}
diminuto_log_perror(
"src/diminuto_uninterruptiblesection.c",
32LL,
"diminuto_uninterruptiblesection_block: sigaddset");
}
else
{
LABEL_8:
v6 = pthread_sigmask(0, &v8, a3);
if ( v6 )
{
*_errno_location() = v6;
v6 = -1;
diminuto_log_perror(
"src/diminuto_uninterruptiblesection.c",
35LL,
"diminuto_uninterruptiblesection_block: pthread_sigmask");
}
}
}
return (unsigned int)v6;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, __int64 a2, __sigset_t *a3)
{
int v4; // eax
__int64 v5; // r14
int v6; // er12
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 ( ++v5 == a2 )
goto LABEL_8;
}
diminuto_log_perror(
"src/diminuto_uninterruptiblesection.c",
32LL,
"diminuto_uninterruptiblesection_block: sigaddset");
}
else
{
LABEL_8:
v6 = pthread_sigmask(0, &v8, a3);
if ( v6 )
{
*_errno_location() = v6;
v6 = -1;
diminuto_log_perror(
"src/diminuto_uninterruptiblesection.c",
35LL,
"diminuto_uninterruptiblesection_block: pthread_sigmask");
}
}
}
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 *

return_type: 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; // r12
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; // r12
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; }


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

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

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

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

original_code: diminuto_string_strndup_func_t * diminuto_string_strndup_set(diminuto_string_strndup_func_t * now) { static pthread_mutex_t mutex = { { 0, 0, 0, 0, 0, 0, 0, { 0, 0 } } }; diminuto_string_strndup_func_t * was; do { pthread_mutex_t * _diminuto_criticalsection_mp; _diminuto_criticalsection_mp = (&mutex); if (diminuto_criticalsection_lock(_diminuto_criticalsection_mp) == 0) { do { __pthread_unwind_buf_t __cancel_buf; void (*__cancel_routine) (void *) = (diminuto_criticalsection_cleanup); void *__cancel_arg = (_diminuto_criticalsection_mp); int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) __cancel_buf.__cancel_jmp_buf, 0); if (__builtin_expect ((__not_first_call), 0)) { __cancel_routine (__cancel_arg); __pthread_unwind_next (&__cancel_buf); } __pthread_register_cancel (&__cancel_buf); do {; do { ((void)0); was = diminuto_string_strndup_func_p; diminuto_string_strndup_func_p = (now != (diminuto_string_strndup_func_t *)0) ? now : &strndup; } while (0); do { } while (0); } while (0); __pthread_unregister_cancel (&__cancel_buf); if (!0) __cancel_routine (__cancel_arg); } while (0); } } while (0); return was; }

canonical_original_code: char *(*diminuto_string_strndup_set(char *(*now)(char *s, unsigned long n)))(char *s, unsigned long n) { static union pthread_mutex_t mutex = { { 0, 0, 0, 0, 0, 0, 0, { 0, 0 } } }; char *(*was)(char *s, unsigned long n); do { union pthread_mutex_t *_diminuto_criticalsection_mp; _diminuto_criticalsection_mp = (&mutex); if (diminuto_criticalsection_lock(_diminuto_criticalsection_mp) == 0) { do { struct __pthread_unwind_buf_t __cancel_buf; void (*__cancel_routine)(void *) = (diminuto_criticalsection_cleanup); void *__cancel_arg = (_diminuto_criticalsection_mp); int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) __cancel_buf.__cancel_jmp_buf, 0); if (__builtin_expect ((__not_first_call), 0)) { __cancel_routine (__cancel_arg); __pthread_unwind_next (&__cancel_buf); } __pthread_register_cancel (&__cancel_buf); do {; do { ((void)0); was = diminuto_string_strndup_func_p; diminuto_string_strndup_func_p = (now != (char *(*)(char *s, unsigned long n))0) ? now : &strndup; } while (0); do { } while (0); } while (0); __pthread_unregister_cancel (&__cancel_buf); if (!0) __cancel_routine (__cancel_arg); } while (0); } } while (0); return was; }

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

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

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

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

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


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

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

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

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

variable_types:
s
char *


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

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

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

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

variable_types:
n
unsigned long


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

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

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

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

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

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

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

variable_types: tested int


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

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

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

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

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

variable_types: signum int

variable_types:
handler
void (*)(int)

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

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

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


decompiled_code:
int diminuto_daemon_prepare()
{
int result; // eax

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

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

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

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

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


decompiled_code:
__int64 diminuto_daemon_verify()
{
__pid_t v1; // eax

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

canonical_decompiled_code:
__int64 func5()
{
__pid_t v1; // eax

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

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

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

variable_types: rc int

variable_types: pid int


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

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

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

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

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

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

variable_types: status int


decompiled_code:
__pid_t diminuto_daemon_refork()
{
__pid_t result; // eax
__pid_t v1; // [rsp+0h] [rbp-Ch]

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

canonical_decompiled_code:
__pid_t func7()
{
__pid_t result; // eax
__pid_t v1; // [rsp+0h] [rbp-Ch]

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

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

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


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

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

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

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

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

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

variable_types:
name
char *

variable_types:
path
char *

variable_types: fds long

variable_types: fd int


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

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

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

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

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

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


decompiled_code:
__int64 diminuto_service()
{
int v0; // eax
bool v1; // zf
__int64 result; // rax
__pid_t v3; // eax

v0 = diminuto_daemon_fork();
v1 = v0 == 0;
if ( v0 < 0 )
return 0xFFFFFFFFLL;
result = 1LL;
if ( v1 )
{
v3 = diminuto_daemon_refork();
if ( v3 < 0 )
exit(1);
if ( v3 )
exit(0);
diminuto_log_close();
diminuto_log_open(0LL);
result = 0LL;
}
return result;
}

canonical_decompiled_code:
__int64 func11()
{
int v0; // eax
bool v1; // zf
__int64 result; // rax
__pid_t v3; // eax

v0 = func6();
v1 = v0 == 0;
if ( v0 < 0 )
return 0xFFFFFFFFLL;
result = 1LL;
if ( v1 )
{
v3 = func7();
if ( v3 < 0 )
exit(1);
if ( v3 )
exit(0);
diminuto_log_close();
diminuto_log_open(0LL);
result = 0LL;
}
return result;
}

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

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


decompiled_code:
__int64 __fastcall diminuto_system(__int64 a1)
{
int v1; // eax
bool v2; // zf
__int64 result; // rax
__pid_t v4; // eax

v1 = diminuto_daemon_fork();
v2 = v1 == 0;
if ( v1 < 0 )
return 0xFFFFFFFFLL;
result = 0LL;
if ( v2 )
{
v4 = diminuto_daemon_refork();
if ( v4 >= 0 )
{
if ( v4 )
exit(0);
diminuto_daemon_sanitize(0LL, 0LL);
execl("/bin/sh", "bin/sh", "-c", a1, 0LL);
diminuto_log_serror("src/diminuto_daemon.c", 475LL, "diminuto_system: execl");
}
exit(1);
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func12(__int64 a1)
{
int v1; // eax
bool v2; // zf
__int64 result; // rax
__pid_t v4; // eax

v1 = func6();
v2 = v1 == 0;
if ( v1 < 0 )
return 0xFFFFFFFFLL;
result = 0LL;
if ( v2 )
{
v4 = func7();
if ( v4 >= 0 )
{
if ( v4 )
exit(0);
func9(0LL, 0LL);
execl("/bin/sh", "bin/sh", "-c", a1, 0LL);
diminuto_log_serror("src/diminuto_daemon.c", 475LL, "diminuto_system: execl");
}
exit(1);
}
return result;
}

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

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

variable_types:
command
char *


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

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

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

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

return_type: long


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

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

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


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

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

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

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

variable_types: struct DiminutoCondition { struct DiminutoMutex { union pthread_mutex_t { struct __pthread_mutex_s { int __lock; unsigned int __count; int __owner; unsigned int __nusers; int __kind; short __spins; short __elision; struct __pthread_internal_list { struct __pthread_internal_list *__prev; struct __pthread_internal_list *__next; } __list; } __data; char __size[40]; long __align; } mutex; union pthread_mutexattr_t { char __size[4]; int __align; } attribute; } mutex; union pthread_cond_t { struct __pthread_cond_s { union { unsigned long long __wseq; struct { unsigned int __low; unsigned int __high; } __wseq32; }; union { unsigned long long __g1_start; struct { unsigned int __low; unsigned int __high; } __g1_start32; }; unsigned int __g_refs[2]; unsigned int __g_size[2]; unsigned int __g1_orig_size; unsigned int __wrefs; unsigned int __g_signals[2]; } __data; char __size[48]; long long __align; } condition; } *

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

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

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


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

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

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

variable_types: pin int


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

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

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

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

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

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

variable_types:
on
unsigned char

variable_types:
off
unsigned char

variable_types: score double

variable_types: accum double

return_type: unsigned int


decompiled_code:
__int64 __fastcall diminuto_modulator_factor(_BYTE *a1, unsigned __int8 *a2)
{
unsigned __int8 v3; // cl
unsigned int v5; // er11
unsigned __int16 v6; // ax
unsigned __int8 *v7; // rdi
unsigned __int8 v8; // si
__int16 v9; // ax
__int16 v10; // t2
char v11; // dl
__int16 v12; // ax

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

canonical_decompiled_code:
__int64 __fastcall func11(_BYTE *a1, unsigned __int8 *a2)
{
unsigned __int8 v3; // cl
unsigned int v5; // er11
unsigned __int16 v6; // ax
unsigned __int8 *v7; // rdi
unsigned __int8 v8; // si
__int16 v9; // ax
__int16 v10; // t2
char v11; // dl
__int16 v12; // ax

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

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

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

variable_types:
onp
unsigned char *

variable_types:
offp
unsigned char *

variable_types:
PRIME
unsigned char []

variable_types: ii int


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

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

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

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

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

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

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

variable_types: rc int