main

canonical_name: main

decompiled_code:
int __cdecl __noreturn main(int argc, const char **argv, const char **envp)
{
unsigned int v3; // ebp
const char *v4; // rsi
__int64 v5; // rax
__int64 v6; // rax
int v7; // ebp
int v8; // edi

diminuto_unittest_setlogmask();
if ( (diminuto_log_mask & 4) != 0 )
diminuto_log_log();
v3 = 10000;
if ( argc > 1 )
v3 = strtol(argv[1], 0LL, 0);
diminuto_unittest_test();
if ( (diminuto_log_mask & 4) != 0 )
diminuto_log_log();
diminuto_unittest_flush();
if ( !diminuto_buffer_prealloc() )
{
__errno_location();
diminuto_unittest_error();
if ( (diminuto_log_mask & 0x10) != 0 )
diminuto_log_log();
diminuto_stacktrace();
diminuto_unittest_flush();
diminuto_core_fatal();
}
if ( !diminuto_buffer_prealloc() )
{
__errno_location();
diminuto_unittest_error();
if ( (diminuto_log_mask & 0x10) != 0 )
diminuto_log_log();
diminuto_stacktrace();
diminuto_unittest_flush();
diminuto_core_fatal();
}
if ( !diminuto_buffer_prealloc() )
{
__errno_location();
diminuto_unittest_error();
if ( (diminuto_log_mask & 0x10) != 0 )
diminuto_log_log();
diminuto_stacktrace();
diminuto_unittest_flush();
diminuto_core_fatal();
}
if ( !diminuto_buffer_prealloc() )
{
__errno_location();
diminuto_unittest_error();
if ( (diminuto_log_mask & 0x10) != 0 )
diminuto_log_log();
diminuto_stacktrace();
diminuto_unittest_flush();
diminuto_core_fatal();
}
if ( !diminuto_buffer_prealloc() )
{
__errno_location();
diminuto_unittest_error();
if ( (diminuto_log_mask & 0x10) != 0 )
diminuto_log_log();
diminuto_stacktrace();
diminuto_unittest_flush();
diminuto_core_fatal();
}
if ( !diminuto_buffer_prealloc() )
{
__errno_location();
diminuto_unittest_error();
if ( (diminuto_log_mask & 0x10) != 0 )
diminuto_log_log();
diminuto_stacktrace();
diminuto_unittest_flush();
diminuto_core_fatal();
}
if ( !diminuto_buffer_prealloc() )
{
__errno_location();
diminuto_unittest_error();
if ( (diminuto_log_mask & 0x10) != 0 )
diminuto_log_log();
diminuto_stacktrace();
diminuto_unittest_flush();
diminuto_core_fatal();
}
if ( !diminuto_buffer_prealloc() )
{
__errno_location();
diminuto_unittest_error();
if ( (diminuto_log_mask & 0x10) != 0 )
diminuto_log_log();
diminuto_stacktrace();
diminuto_unittest_flush();
diminuto_core_fatal();
}
if ( !diminuto_buffer_prealloc() )
{
__errno_location();
diminuto_unittest_error();
if ( (diminuto_log_mask & 0x10) != 0 )
diminuto_log_log();
diminuto_stacktrace();
diminuto_unittest_flush();
diminuto_core_fatal();
}
v4 = (const char *)4096;
if ( !diminuto_buffer_prealloc() )
{
__errno_location();
diminuto_unittest_error();
if ( (diminuto_log_mask & 0x10) != 0 )
{
v4 = "tst/unittest-buffer-perf.c@84: ASSERT: tests=%d errors=%d errno=%d !(%s)!\n";
diminuto_log_log();
}
diminuto_stacktrace();
diminuto_unittest_flush();
diminuto_core_fatal();
}
if ( (unsigned int)diminuto_buffer_nomalloc() )
{
__errno_location();
diminuto_unittest_error();
if ( (diminuto_log_mask & 0x10) != 0 )
{
v4 = "tst/unittest-buffer-perf.c@85: ASSERT: tests=%d errors=%d errno=%d !(%s)!\n";
diminuto_log_log();
}
diminuto_stacktrace();
diminuto_unittest_flush();
diminuto_core_fatal();
}
if ( (diminuto_log_mask & 2) != 0 )
{
v4 = "tst/unittest-buffer-perf.c@87: CHECKPOINT: malloc %d %d\n";
diminuto_log_log();
}
v5 = run(v3, v4);
report(v5);
if ( (void *(**)(size_t))diminuto_heap_malloc_set() != &malloc )
{
__errno_location();
diminuto_unittest_error();
if ( (diminuto_log_mask & 0x10) != 0 )
{
v4 = "tst/unittest-buffer-perf.c@91: ASSERT: tests=%d errors=%d errno=%d !(%s)!\n";
diminuto_log_log();
}
diminuto_stacktrace();
diminuto_unittest_flush();
diminuto_core_fatal();
}
if ( (void (**)(void *))diminuto_heap_free_set() != &free )
{
__errno_location();
diminuto_unittest_error();
if ( (diminuto_log_mask & 0x10) != 0 )
{
v4 = "tst/unittest-buffer-perf.c@92: ASSERT: tests=%d errors=%d errno=%d !(%s)!\n";
diminuto_log_log();
}
diminuto_stacktrace();
diminuto_unittest_flush();
diminuto_core_fatal();
}
if ( (diminuto_log_mask & 2) != 0 )
{
v4 = "tst/unittest-buffer-perf.c@94: CHECKPOINT: diminuto_buffer_malloc %d %d\n";
diminuto_log_log();
}
v6 = run(v3, v4);
report(v6);
diminuto_heap_malloc_set();
diminuto_heap_free_set();
diminuto_buffer_fini();
if ( !(unsigned int)diminuto_buffer_nomalloc() )
{
__errno_location();
diminuto_unittest_error();
if ( (diminuto_log_mask & 0x10) != 0 )
diminuto_log_log();
diminuto_stacktrace();
diminuto_unittest_flush();
diminuto_core_fatal();
}
if ( (diminuto_log_mask & 4) != 0 )
diminuto_log_log();
diminuto_unittest_flush();
v7 = diminuto_unittest_errors;
if ( (diminuto_log_mask & 4) != 0 )
diminuto_log_log();
diminuto_unittest_flush();
v8 = 255;
if ( v7 <= 255 )
v8 = v7;
exit(v8);
}

canonical_decompiled_code:
int __cdecl __noreturn main(int argc, const char **argv, const char **envp)
{
unsigned int v3; // ebp
const char *v4; // rsi
__int64 v5; // rax
__int64 v6; // rax
int v7; // ebp
int v8; // edi

diminuto_unittest_setlogmask();
if ( (diminuto_log_mask & 4) != 0 )
diminuto_log_log();
v3 = 10000;
if ( argc > 1 )
v3 = strtol(argv[1], 0LL, 0);
diminuto_unittest_test();
if ( (diminuto_log_mask & 4) != 0 )
diminuto_log_log();
diminuto_unittest_flush();
if ( !diminuto_buffer_prealloc() )
{
__errno_location();
diminuto_unittest_error();
if ( (diminuto_log_mask & 0x10) != 0 )
diminuto_log_log();
diminuto_stacktrace();
diminuto_unittest_flush();
diminuto_core_fatal();
}
if ( !diminuto_buffer_prealloc() )
{
__errno_location();
diminuto_unittest_error();
if ( (diminuto_log_mask & 0x10) != 0 )
diminuto_log_log();
diminuto_stacktrace();
diminuto_unittest_flush();
diminuto_core_fatal();
}
if ( !diminuto_buffer_prealloc() )
{
__errno_location();
diminuto_unittest_error();
if ( (diminuto_log_mask & 0x10) != 0 )
diminuto_log_log();
diminuto_stacktrace();
diminuto_unittest_flush();
diminuto_core_fatal();
}
if ( !diminuto_buffer_prealloc() )
{
__errno_location();
diminuto_unittest_error();
if ( (diminuto_log_mask & 0x10) != 0 )
diminuto_log_log();
diminuto_stacktrace();
diminuto_unittest_flush();
diminuto_core_fatal();
}
if ( !diminuto_buffer_prealloc() )
{
__errno_location();
diminuto_unittest_error();
if ( (diminuto_log_mask & 0x10) != 0 )
diminuto_log_log();
diminuto_stacktrace();
diminuto_unittest_flush();
diminuto_core_fatal();
}
if ( !diminuto_buffer_prealloc() )
{
__errno_location();
diminuto_unittest_error();
if ( (diminuto_log_mask & 0x10) != 0 )
diminuto_log_log();
diminuto_stacktrace();
diminuto_unittest_flush();
diminuto_core_fatal();
}
if ( !diminuto_buffer_prealloc() )
{
__errno_location();
diminuto_unittest_error();
if ( (diminuto_log_mask & 0x10) != 0 )
diminuto_log_log();
diminuto_stacktrace();
diminuto_unittest_flush();
diminuto_core_fatal();
}
if ( !diminuto_buffer_prealloc() )
{
__errno_location();
diminuto_unittest_error();
if ( (diminuto_log_mask & 0x10) != 0 )
diminuto_log_log();
diminuto_stacktrace();
diminuto_unittest_flush();
diminuto_core_fatal();
}
if ( !diminuto_buffer_prealloc() )
{
__errno_location();
diminuto_unittest_error();
if ( (diminuto_log_mask & 0x10) != 0 )
diminuto_log_log();
diminuto_stacktrace();
diminuto_unittest_flush();
diminuto_core_fatal();
}
v4 = (const char *)4096;
if ( !diminuto_buffer_prealloc() )
{
__errno_location();
diminuto_unittest_error();
if ( (diminuto_log_mask & 0x10) != 0 )
{
v4 = "tst/unittest-buffer-perf.c@84: ASSERT: tests=%d errors=%d errno=%d !(%s)!\n";
diminuto_log_log();
}
diminuto_stacktrace();
diminuto_unittest_flush();
diminuto_core_fatal();
}
if ( (unsigned int)diminuto_buffer_nomalloc() )
{
__errno_location();
diminuto_unittest_error();
if ( (diminuto_log_mask & 0x10) != 0 )
{
v4 = "tst/unittest-buffer-perf.c@85: ASSERT: tests=%d errors=%d errno=%d !(%s)!\n";
diminuto_log_log();
}
diminuto_stacktrace();
diminuto_unittest_flush();
diminuto_core_fatal();
}
if ( (diminuto_log_mask & 2) != 0 )
{
v4 = "tst/unittest-buffer-perf.c@87: CHECKPOINT: malloc %d %d\n";
diminuto_log_log();
}
v5 = func7(v3, v4);
func8(v5);
if ( (void *(**)(size_t))diminuto_heap_malloc_set() != &malloc )
{
__errno_location();
diminuto_unittest_error();
if ( (diminuto_log_mask & 0x10) != 0 )
{
v4 = "tst/unittest-buffer-perf.c@91: ASSERT: tests=%d errors=%d errno=%d !(%s)!\n";
diminuto_log_log();
}
diminuto_stacktrace();
diminuto_unittest_flush();
diminuto_core_fatal();
}
if ( (void (**)(void *))diminuto_heap_free_set() != &free )
{
__errno_location();
diminuto_unittest_error();
if ( (diminuto_log_mask & 0x10) != 0 )
{
v4 = "tst/unittest-buffer-perf.c@92: ASSERT: tests=%d errors=%d errno=%d !(%s)!\n";
diminuto_log_log();
}
diminuto_stacktrace();
diminuto_unittest_flush();
diminuto_core_fatal();
}
if ( (diminuto_log_mask & 2) != 0 )
{
v4 = "tst/unittest-buffer-perf.c@94: CHECKPOINT: diminuto_buffer_malloc %d %d\n";
diminuto_log_log();
}
v6 = func7(v3, v4);
func8(v6);
diminuto_heap_malloc_set();
diminuto_heap_free_set();
diminuto_buffer_fini();
if ( !(unsigned int)diminuto_buffer_nomalloc() )
{
__errno_location();
diminuto_unittest_error();
if ( (diminuto_log_mask & 0x10) != 0 )
diminuto_log_log();
diminuto_stacktrace();
diminuto_unittest_flush();
diminuto_core_fatal();
}
if ( (diminuto_log_mask & 4) != 0 )
diminuto_log_log();
diminuto_unittest_flush();
v7 = diminuto_unittest_errors;
if ( (diminuto_log_mask & 4) != 0 )
diminuto_log_log();
diminuto_unittest_flush();
v8 = 255;
if ( v7 <= 255 )
v8 = v7;
exit(v8);
}

original_code:
int main(int argc, char * argv[])
{
    int limit = 10000;
    diminuto_ticks_t ticks;
    do { diminuto_unittest_setlogmask(); ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_NOTICE)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_NOTICE, "tst/unittest-buffer-perf.c" "@" "67" ": " "SETLOGMASK: logmask=0x%x\n", diminuto_log_mask) : ((void)0)); } while (0);
    if (argc > 1) {
        limit = strtol(argv[1], (char **)0, 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-buffer-perf.c" "@" "73" ": " "TEST: %d tests=%d " "\n", (0), diminuto_unittest_number) : ((void)0)); diminuto_unittest_flush(); } while (0); do {;
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(diminuto_buffer_prealloc(COUNT, 1 << 3) > 0); 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-buffer-perf.c" "@" "75" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "diminuto_buffer_prealloc(COUNT, 1 << 3) > 0") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(diminuto_buffer_prealloc(COUNT, 1 << 4) > 0); 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-buffer-perf.c" "@" "76" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "diminuto_buffer_prealloc(COUNT, 1 << 4) > 0") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(diminuto_buffer_prealloc(COUNT, 1 << 5) > 0); 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-buffer-perf.c" "@" "77" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "diminuto_buffer_prealloc(COUNT, 1 << 5) > 0") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(diminuto_buffer_prealloc(COUNT, 1 << 6) > 0); 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-buffer-perf.c" "@" "78" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "diminuto_buffer_prealloc(COUNT, 1 << 6) > 0") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(diminuto_buffer_prealloc(COUNT, 1 << 7) > 0); 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-buffer-perf.c" "@" "79" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "diminuto_buffer_prealloc(COUNT, 1 << 7) > 0") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(diminuto_buffer_prealloc(COUNT, 1 << 8) > 0); 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-buffer-perf.c" "@" "80" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "diminuto_buffer_prealloc(COUNT, 1 << 8) > 0") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(diminuto_buffer_prealloc(COUNT, 1 << 9) > 0); 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-buffer-perf.c" "@" "81" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "diminuto_buffer_prealloc(COUNT, 1 << 9) > 0") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(diminuto_buffer_prealloc(COUNT, 1 << 10) > 0); 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-buffer-perf.c" "@" "82" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "diminuto_buffer_prealloc(COUNT, 1 << 10) > 0") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(diminuto_buffer_prealloc(COUNT, 1 << 11) > 0); 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-buffer-perf.c" "@" "83" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "diminuto_buffer_prealloc(COUNT, 1 << 11) > 0") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(diminuto_buffer_prealloc(COUNT, 1 << 12) > 0); 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-buffer-perf.c" "@" "84" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "diminuto_buffer_prealloc(COUNT, 1 << 12) > 0") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(!diminuto_buffer_nomalloc(!0)); 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-buffer-perf.c" "@" "85" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "!diminuto_buffer_nomalloc(!0)") : ((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-buffer-perf.c" "@" "87" ": " "CHECKPOINT: " "malloc %d %d\n", COUNT, limit) : ((void)0));;
    ticks = run(limit);
    report(ticks);
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(diminuto_heap_malloc_set(diminuto_buffer_malloc) == malloc); 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-buffer-perf.c" "@" "91" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "diminuto_heap_malloc_set(diminuto_buffer_malloc) == malloc") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(diminuto_heap_free_set(diminuto_buffer_free) == free); 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-buffer-perf.c" "@" "92" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "diminuto_heap_free_set(diminuto_buffer_free) == free") : ((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-buffer-perf.c" "@" "94" ": " "CHECKPOINT: " "diminuto_buffer_malloc %d %d\n", COUNT, limit) : ((void)0));;
    ticks = run(limit);
    report(ticks);
    diminuto_heap_malloc_set((diminuto_heap_malloc_func_t *)0);
    diminuto_heap_free_set((diminuto_heap_free_func_t *)0);
    diminuto_buffer_fini();
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(diminuto_buffer_nomalloc(0)); 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-buffer-perf.c" "@" "102" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "diminuto_buffer_nomalloc(0)") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    } 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-buffer-perf.c" "@" "104" ": " "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-buffer-perf.c" "@" "106" ": " "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(int argc, char *argv[])
{
    int limit = 10000;
    unsigned long ticks;
    do { diminuto_unittest_setlogmask(); ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_NOTICE)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_NOTICE, "tst/unittest-buffer-perf.c" "@" "67" ": " "SETLOGMASK: logmask=0x%x\n", diminuto_log_mask) : ((void)0)); } while (0);
    if (argc > 1) {
        limit = strtol(argv[1], (char **)0, 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-buffer-perf.c" "@" "73" ": " "TEST: %d tests=%d " "\n", (0), diminuto_unittest_number) : ((void)0)); diminuto_unittest_flush(); } while (0); do {;
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(diminuto_buffer_prealloc(COUNT, 1 << 3) > 0); 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-buffer-perf.c" "@" "75" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "diminuto_buffer_prealloc(COUNT, 1 << 3) > 0") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(diminuto_buffer_prealloc(COUNT, 1 << 4) > 0); 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-buffer-perf.c" "@" "76" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "diminuto_buffer_prealloc(COUNT, 1 << 4) > 0") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(diminuto_buffer_prealloc(COUNT, 1 << 5) > 0); 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-buffer-perf.c" "@" "77" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "diminuto_buffer_prealloc(COUNT, 1 << 5) > 0") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(diminuto_buffer_prealloc(COUNT, 1 << 6) > 0); 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-buffer-perf.c" "@" "78" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "diminuto_buffer_prealloc(COUNT, 1 << 6) > 0") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(diminuto_buffer_prealloc(COUNT, 1 << 7) > 0); 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-buffer-perf.c" "@" "79" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "diminuto_buffer_prealloc(COUNT, 1 << 7) > 0") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(diminuto_buffer_prealloc(COUNT, 1 << 8) > 0); 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-buffer-perf.c" "@" "80" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "diminuto_buffer_prealloc(COUNT, 1 << 8) > 0") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(diminuto_buffer_prealloc(COUNT, 1 << 9) > 0); 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-buffer-perf.c" "@" "81" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "diminuto_buffer_prealloc(COUNT, 1 << 9) > 0") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(diminuto_buffer_prealloc(COUNT, 1 << 10) > 0); 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-buffer-perf.c" "@" "82" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "diminuto_buffer_prealloc(COUNT, 1 << 10) > 0") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(diminuto_buffer_prealloc(COUNT, 1 << 11) > 0); 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-buffer-perf.c" "@" "83" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "diminuto_buffer_prealloc(COUNT, 1 << 11) > 0") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(diminuto_buffer_prealloc(COUNT, 1 << 12) > 0); 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-buffer-perf.c" "@" "84" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "diminuto_buffer_prealloc(COUNT, 1 << 12) > 0") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(!diminuto_buffer_nomalloc(!0)); 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-buffer-perf.c" "@" "85" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "!diminuto_buffer_nomalloc(!0)") : ((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-buffer-perf.c" "@" "87" ": " "CHECKPOINT: " "malloc %d %d\n", COUNT, limit) : ((void)0));;
    ticks = run(limit);
    report(ticks);
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(diminuto_heap_malloc_set(diminuto_buffer_malloc) == malloc); 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-buffer-perf.c" "@" "91" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "diminuto_heap_malloc_set(diminuto_buffer_malloc) == malloc") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(diminuto_heap_free_set(diminuto_buffer_free) == free); 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-buffer-perf.c" "@" "92" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "diminuto_heap_free_set(diminuto_buffer_free) == free") : ((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-buffer-perf.c" "@" "94" ": " "CHECKPOINT: " "diminuto_buffer_malloc %d %d\n", COUNT, limit) : ((void)0));;
    ticks = run(limit);
    report(ticks);
    diminuto_heap_malloc_set((void *(*)(unsigned long size))0);
    diminuto_heap_free_set((void (*)(void *ptr))0);
    diminuto_buffer_fini();
    do { int diminuto_unittest_condition; diminuto_unittest_condition = !!(diminuto_buffer_nomalloc(0)); 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-buffer-perf.c" "@" "102" ": " "ASSERT: tests=%d errors=%d errno=%d !(%s)!\n", diminuto_unittest_number, diminuto_unittest_count, diminuto_unittest_errno, "diminuto_buffer_nomalloc(0)") : ((void)0)); diminuto_stacktrace(); diminuto_unittest_flush(); diminuto_core_fatal(); } } while (0);
    } 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-buffer-perf.c" "@" "104" ": " "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-buffer-perf.c" "@" "106" ": " "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);
}

variable_types: argc int

variable_types:
argv
char *[]

variable_types:
ticks
unsigned long


report

repo: coverclock/com-diag-diminuto

decompiled_code:
unsigned __int64 report()
{
unsigned __int64 result; // rax
unsigned int v1; // [rsp+14h] [rbp-14h]

diminuto_time_duration();
result = (unsigned __int64)&diminuto_log_mask;
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
result = v1;
}
return result;
}

canonical_decompiled_code:
unsigned __int64 func8()
{
unsigned __int64 result; // rax
unsigned int v1; // [rsp+14h] [rbp-14h]

diminuto_time_duration();
result = (unsigned __int64)&diminuto_log_mask;
if ( (diminuto_log_mask & 2) != 0 )
{
diminuto_log_log();
result = v1;
}
return result;
}

original_code:
static void report(diminuto_ticks_t ticks)
{
    int day, hour, minute, second;
    diminuto_ticks_t fraction;
    diminuto_time_duration(ticks, &day, &hour, &minute, &second, &fraction);
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-buffer-perf.c" "@" "59" ": " "CHECKPOINT: " "elapsed %lluticks %d/%2.2d:%2.2d:%2.2d.%9.9llu\n", (long long unsigned int)ticks, day, hour, minute, second, (long long unsigned int)fraction) : ((void)0));;
}

canonical_original_code:
static void report(unsigned long ticks)
{
    int day; int hour; int minute; int second;
    unsigned long fraction;
    diminuto_time_duration(ticks, &day, &hour, &minute, &second, &fraction);
    ((((diminuto_log_mask) & (DIMINUTO_LOG_MASK_INFORMATION)) != 0) ? diminuto_log_log(DIMINUTO_LOG_PRIORITY_INFORMATION, "tst/unittest-buffer-perf.c" "@" "59" ": " "CHECKPOINT: " "elapsed %lluticks %d/%2.2d:%2.2d:%2.2d.%9.9llu\n", (unsigned long long)ticks, day, hour, minute, second, (unsigned long long)fraction) : ((void)0));;
}

variable_types: day int

variable_types: hour int

variable_types: minute int

variable_types: second int

variable_types:
fraction
unsigned long

return_type: void


decompiled_code:
__int64 diminuto_core_enable()
{
__int64 result; // rax
struct rlimit vars0; // [rsp+0h] [rbp+0h] BYREF

if ( getrlimit(RLIMIT_CORE, &vars0) < 0 )
{
diminuto_log_perror("src/diminuto_core.c", 32LL, "diminuto_core_enable: getrlimit");
result = 0xFFFFFFFFLL;
}
else
{
vars0.rlim_cur = vars0.rlim_max;
if ( setrlimit(RLIMIT_CORE, &vars0) < 0 )
{
diminuto_log_perror("src/diminuto_core.c", 39LL, "diminuto_core_enable: setrlimit");
result = 0xFFFFFFFFLL;
}
else
{
result = 0LL;
}
}
return result;
}

canonical_decompiled_code:
__int64 func0()
{
__int64 result; // rax
struct rlimit vars0; // [rsp+0h] [rbp+0h] BYREF

if ( getrlimit(RLIMIT_CORE, &vars0) < 0 )
{
diminuto_log_perror("src/diminuto_core.c", 32LL, "diminuto_core_enable: getrlimit");
result = 0xFFFFFFFFLL;
}
else
{
vars0.rlim_cur = vars0.rlim_max;
if ( setrlimit(RLIMIT_CORE, &vars0) < 0 )
{
diminuto_log_perror("src/diminuto_core.c", 39LL, "diminuto_core_enable: setrlimit");
result = 0xFFFFFFFFLL;
}
else
{
result = 0LL;
}
}
return result;
}

original_code:
int diminuto_core_enable(void)
{
    int rc = -1;
    struct rlimit limit;
    do {
        if (getrlimit(RLIMIT_CORE, &limit) < 0) {
            diminuto_log_perror("src/diminuto_core.c", 32, "diminuto_core_enable: getrlimit");
            break;
        }
        limit.rlim_cur = limit.rlim_max;
        if (setrlimit(RLIMIT_CORE, &limit) < 0) {
            diminuto_log_perror("src/diminuto_core.c", 39, "diminuto_core_enable: setrlimit");
            break;
        }
        rc = 0;
    } while (0);
    return rc;
}

canonical_original_code:
int diminuto_core_enable()
{
    int rc = -1;
    struct rlimit limit;
    do {
        if (getrlimit(RLIMIT_CORE, &limit) < 0) {
            diminuto_log_perror("src/diminuto_core.c", 32, "diminuto_core_enable: getrlimit");
            break;
        }
        limit.rlim_cur = limit.rlim_max;
        if (setrlimit(RLIMIT_CORE, &limit) < 0) {
            diminuto_log_perror("src/diminuto_core.c", 39, "diminuto_core_enable: setrlimit");
            break;
        }
        rc = 0;
    } while (0);
    return rc;
}

variable_types: rc int

variable_types: struct rlimit { unsigned long rlim_cur; unsigned long rlim_max; }

return_type: int


decompiled_code:
void __noreturn diminuto_core_fatal()
{
abort();
}

canonical_decompiled_code:
void __noreturn func1()
{
abort();
}

original_code:
void diminuto_core_fatal(void)
{
    abort();
    diminuto_log_perror("src/diminuto_core.c", 54, "diminuto_core_fatal: abort");
    kill(0, 6);
    diminuto_log_perror("src/diminuto_core.c", 57, "diminuto_core_fatal: kill(SIGABRT)");
    kill(0, 9);
    diminuto_log_perror("src/diminuto_core.c", 60, "diminuto_core_fatal: kill(SIGKILL)");
    kill(0, 11);
    diminuto_log_perror("src/diminuto_core.c", 63, "diminuto_core_fatal: kill(SIGSEGV)");
    *((volatile int *)0) = 0;
    (*__errno_location ()) = 22;
    diminuto_log_perror("src/diminuto_core.c", 76, "diminuto_core_fatal: *NULL");
    _exit(255);
    diminuto_log_perror("src/diminuto_core.c", 79, "diminuto_core_fatal: _exit(255)");
    while (!0) { diminuto_yield(); }
}

canonical_original_code:
void diminuto_core_fatal()
{
    abort();
    diminuto_log_perror("src/diminuto_core.c", 54, "diminuto_core_fatal: abort");
    kill(0, 6);
    diminuto_log_perror("src/diminuto_core.c", 57, "diminuto_core_fatal: kill(SIGABRT)");
    kill(0, 9);
    diminuto_log_perror("src/diminuto_core.c", 60, "diminuto_core_fatal: kill(SIGKILL)");
    kill(0, 11);
    diminuto_log_perror("src/diminuto_core.c", 63, "diminuto_core_fatal: kill(SIGSEGV)");
    *((int *)0) = 0;
    (*__errno_location ()) = 22;
    diminuto_log_perror("src/diminuto_core.c", 76, "diminuto_core_fatal: *NULL");
    _exit(255);
    diminuto_log_perror("src/diminuto_core.c", 79, "diminuto_core_fatal: _exit(255)");
    while (!0) { diminuto_yield(); }
}


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

return_type: long


decompiled_code:
__int64 __fastcall diminuto_frequency_ticks2units(__int64 a1, __int64 a2)
{
__int64 v2; // rax
__int64 v3; // r8

v2 = diminuto_frequency();
v3 = a1;
if ( v2 < a2 )
return a2 / v2 * a1;
if ( v2 <= a2 )
return v3;
return a1 / (v2 / a2);
}

original_code:
static inline diminuto_sticks_t diminuto_frequency_ticks2units(diminuto_sticks_t ticks, diminuto_sticks_t hertz)
{
    return
        (hertz > diminuto_frequency()) ?
            (ticks * (hertz / diminuto_frequency())) :
        (hertz < diminuto_frequency()) ?
            (ticks / (diminuto_frequency() / hertz)) :
        ticks;
}

canonical_original_code:
static inline long diminuto_frequency_ticks2units(long ticks, long hertz)
{
    return
        (hertz > diminuto_frequency()) ?
            (ticks * (hertz / diminuto_frequency())) :
        (hertz < diminuto_frequency()) ?
            (ticks / (diminuto_frequency() / hertz)) :
        ticks;
}

variable_types: ticks long

variable_types: hertz long


decompiled_code:
__int64 __fastcall diminuto_frequency_units2ticks(__int64 a1, __int64 a2)
{
__int64 v2; // rax

v2 = diminuto_frequency();
if ( v2 < a2 )
{
a1 /= a2 / v2;
return a1;
}
if ( v2 <= a2 )
return a1;
return v2 / a2 * a1;
}

canonical_decompiled_code:
__int64 __fastcall func2(__int64 a1, __int64 a2)
{
__int64 v2; // rax

v2 = func0();
if ( v2 < a2 )
{
a1 /= a2 / v2;
return a1;
}
if ( v2 <= a2 )
return a1;
return v2 / a2 * a1;
}

original_code:
static inline diminuto_sticks_t diminuto_frequency_units2ticks(diminuto_sticks_t units, diminuto_sticks_t hertz)
{
    return
        (hertz > diminuto_frequency()) ?
            (units / (hertz / diminuto_frequency())) :
        (hertz < diminuto_frequency()) ?
            (units * (diminuto_frequency() / hertz)) :
        units;
}

canonical_original_code:
static inline long diminuto_frequency_units2ticks(long units, long hertz)
{
    return
        (hertz > diminuto_frequency()) ?
            (units / (hertz / diminuto_frequency())) :
        (hertz < diminuto_frequency()) ?
            (units * (diminuto_frequency() / hertz)) :
        units;
}

variable_types: units long


decompiled_code:
__int64 __fastcall diminuto_frequency_ticks2wholeseconds(__int64 a1)
{
return diminuto_frequency_ticks2units(a1, 1LL);
}

canonical_decompiled_code:
__int64 __fastcall func3(__int64 a1)
{
return func1(a1, 1LL);
}

original_code:
static inline diminuto_sticks_t diminuto_frequency_ticks2wholeseconds(diminuto_sticks_t ticks)
{
    return diminuto_frequency_ticks2units(ticks, 1);
}

canonical_original_code:
static inline long diminuto_frequency_ticks2wholeseconds(long ticks)
{
    return diminuto_frequency_ticks2units(ticks, 1);
}


decompiled_code:
__int64 __fastcall diminuto_frequency_ticks2fractionalseconds(__int64 a1, __int64 a2)
{
__int64 v2; // rax

v2 = diminuto_frequency();
return diminuto_frequency_ticks2units(a1 % v2, a2);
}

canonical_decompiled_code:
__int64 __fastcall func4(__int64 a1, __int64 a2)
{
__int64 v2; // rax

v2 = func0();
return func1(a1 % v2, a2);
}

original_code:
static inline diminuto_sticks_t diminuto_frequency_ticks2fractionalseconds(diminuto_sticks_t ticks, diminuto_sticks_t hertz)
{
    return diminuto_frequency_ticks2units(ticks % diminuto_frequency(), hertz);
}

canonical_original_code:
static inline long diminuto_frequency_ticks2fractionalseconds(long ticks, long hertz)
{
    return diminuto_frequency_ticks2units(ticks % diminuto_frequency(), hertz);
}


decompiled_code:
__int64 __fastcall diminuto_frequency_seconds2ticks(__int64 a1)
{
__int64 v1; // r9
__int64 v2; // r10
__int64 v3; // rax
__int64 v4; // r8

diminuto_frequency_units2ticks(a1, 1LL);
v3 = diminuto_frequency_units2ticks(v1, v2);
return v4 + v3;
}

original_code:
static inline diminuto_sticks_t diminuto_frequency_seconds2ticks(diminuto_sticks_t whole, diminuto_sticks_t fraction, diminuto_sticks_t hertz)
{
    return diminuto_frequency_units2ticks(whole, 1) + diminuto_frequency_units2ticks(fraction, hertz);
}

canonical_original_code:
static inline long diminuto_frequency_seconds2ticks(long whole, long fraction, long hertz)
{
    return diminuto_frequency_units2ticks(whole, 1) + diminuto_frequency_units2ticks(fraction, hertz);
}

variable_types: whole long

variable_types: fraction long


decompiled_code:
__int64 __fastcall diminuto_delay(__int64 a1, int a2)
{
__int64 v2; // r13
__m128i v4; // [rsp+0h] [rbp-48h] BYREF
struct timespec remaining; // [rsp+10h] [rbp-38h] BYREF

v4.m128i_i64[0] = diminuto_frequency_ticks2wholeseconds(a1);
v2 = diminuto_frequency(a1);
v4.m128i_i64[1] = diminuto_frequency_ticks2fractionalseconds(a1, v2);
for ( remaining = (struct timespec)_mm_loadu_si128(&v4); ; v4 = _mm_loadu_si128((const __m128i *)&remaining) )
{
if ( nanosleep((const struct timespec *)&v4, &remaining) >= 0 )
return diminuto_frequency_seconds2ticks(0LL);
if ( *_errno_location() != 4 )
{
diminuto_log_perror("src/diminuto_delay.c", 37LL, "diminuto_delay: nanosleep");
return diminuto_frequency_seconds2ticks(remaining.tv_sec);
}
if ( a2 )
break;
}
return diminuto_frequency_seconds2ticks(remaining.tv_sec);
}

canonical_decompiled_code:
__int64 __fastcall func6(__int64 a1, int a2)
{
__int64 v2; // r13
__m128i v4; // [rsp+0h] [rbp-48h] BYREF
struct timespec remaining; // [rsp+10h] [rbp-38h] BYREF

v4.m128i_i64[0] = func3(a1);
v2 = func0(a1);
v4.m128i_i64[1] = func4(a1, v2);
for ( remaining = (struct timespec)_mm_loadu_si128(&v4); ; v4 = _mm_loadu_si128((const __m128i *)&remaining) )
{
if ( nanosleep((const struct timespec *)&v4, &remaining) >= 0 )
return func5(0LL);
if ( *_errno_location() != 4 )
{
diminuto_log_perror("src/diminuto_delay.c", 37LL, "diminuto_delay: nanosleep");
return func5(remaining.tv_sec);
}
if ( a2 )
break;
}
return func5(remaining.tv_sec);
}

original_code:
diminuto_ticks_t diminuto_delay(diminuto_ticks_t ticks, int interruptible)
{
    struct timespec delay;
    struct timespec remaining;
    struct timespec result;
    delay.tv_sec = diminuto_frequency_ticks2wholeseconds(ticks);
    delay.tv_nsec = diminuto_frequency_ticks2fractionalseconds(ticks, diminuto_delay_frequency());
    remaining = delay;
    result.tv_sec = 0;
    result.tv_nsec = 0;
    while (nanosleep(&delay, &remaining) < 0) {
        if ((*__errno_location ()) != 4) {
            diminuto_log_perror("src/diminuto_delay.c", 37, "diminuto_delay: nanosleep");
            result = remaining;
            break;
        } else if (interruptible) {
            result = remaining;
            break;
        } else {
            delay = remaining;
        }
    }
    ticks = diminuto_frequency_seconds2ticks(result.tv_sec, result.tv_nsec, diminuto_delay_frequency());
    return ticks;
}

canonical_original_code:
unsigned long diminuto_delay(unsigned long ticks, int interruptible)
{
    struct timespec delay;
    struct timespec remaining;
    struct timespec result;
    delay.tv_sec = diminuto_frequency_ticks2wholeseconds(ticks);
    delay.tv_nsec = diminuto_frequency_ticks2fractionalseconds(ticks, diminuto_delay_frequency());
    remaining = delay;
    result.tv_sec = 0;
    result.tv_nsec = 0;
    while (nanosleep(&delay, &remaining) < 0) {
        if ((*__errno_location ()) != 4) {
            diminuto_log_perror("src/diminuto_delay.c", 37, "diminuto_delay: nanosleep");
            result = remaining;
            break;
        } else if (interruptible) {
            result = remaining;
            break;
        } else {
            delay = remaining;
        }
    }
    ticks = diminuto_frequency_seconds2ticks(result.tv_sec, result.tv_nsec, diminuto_delay_frequency());
    return ticks;
}

variable_types: interruptible int

variable_types: struct timespec { long tv_sec; long tv_nsec; }

return_type: unsigned long


decompiled_code:
int diminuto_yield()
{
int result; // eax
int v1; // [rsp+Ch] [rbp-Ch]

result = sched_yield();
if ( result < 0 )
{
v1 = result;
diminuto_log_perror("src/diminuto_delay.c", 59LL, "diminuto_yield: sched_yield");
result = v1;
}
return result;
}

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

result = sched_yield();
if ( result < 0 )
{
v1 = result;
diminuto_log_perror("src/diminuto_delay.c", 59LL, "diminuto_yield: sched_yield");
result = v1;
}
return result;
}

original_code:
int diminuto_yield(void)
{
    int rc;
    rc = sched_yield();
    if (rc < 0) {
        diminuto_log_perror("src/diminuto_delay.c", 59, "diminuto_yield: sched_yield");
    }
    return rc;
}

canonical_original_code:
int diminuto_yield()
{
    int rc;
    rc = sched_yield();
    if (rc < 0) {
        diminuto_log_perror("src/diminuto_delay.c", 59, "diminuto_yield: sched_yield");
    }
    return rc;
}


decompiled_code:
__int64 diminuto_pause()
{
int v0; // er12
int *v1; // rax
unsigned int v2; // er12

v0 = pause();
v1 = _errno_location();
if ( v0 >= 0 )
{
*v1 = 22;
v2 = -1;
diminuto_log_perror("src/diminuto_delay.c", 73LL, "diminuto_pause: pause");
return v2;
}
if ( *v1 == 4 )
return 0;
diminuto_log_perror("src/diminuto_delay.c", 77LL, "diminuto_pause: pause");
return (unsigned int)v0;
}

canonical_decompiled_code:
__int64 func8()
{
int v0; // er12
int *v1; // rax
unsigned int v2; // er12

v0 = pause();
v1 = _errno_location();
if ( v0 >= 0 )
{
*v1 = 22;
v2 = -1;
diminuto_log_perror("src/diminuto_delay.c", 73LL, "diminuto_pause: pause");
return v2;
}
if ( *v1 == 4 )
return 0;
diminuto_log_perror("src/diminuto_delay.c", 77LL, "diminuto_pause: pause");
return (unsigned int)v0;
}

original_code:
int diminuto_pause(void)
{
    int rc;
    rc = pause();
    if (rc >= 0) {
        rc = -1;
        (*__errno_location ()) = 22;
        diminuto_log_perror("src/diminuto_delay.c", 73, "diminuto_pause: pause");
    } else if ((*__errno_location ()) == 4) {
        rc = 0;
    } else {
        diminuto_log_perror("src/diminuto_delay.c", 77, "diminuto_pause: pause");
    }
    return rc;
}

canonical_original_code:
int diminuto_pause()
{
    int rc;
    rc = pause();
    if (rc >= 0) {
        rc = -1;
        (*__errno_location ()) = 22;
        diminuto_log_perror("src/diminuto_delay.c", 73, "diminuto_pause: pause");
    } else if ((*__errno_location ()) == 4) {
        rc = 0;
    } else {
        diminuto_log_perror("src/diminuto_delay.c", 77, "diminuto_pause: pause");
    }
    return rc;
}


decompiled_code:
char *__fastcall diminuto_path_scan(char *src, const char *a2)
{
size_t v2; // rax
void *v3; // rsp
char *i; // rdi
char *v5; // rcx
char v7; // [rsp-Eh] [rbp-10C8h] BYREF
char *v8; // [rsp-6h] [rbp-10C0h] BYREF
struct stat v9; // [rsp+2h] [rbp-10B8h] BYREF
char v10[4136]; // [rsp+92h] [rbp-1028h] BYREF

if ( !src )
return 0LL;
if ( a2 )
{
v2 = strlen(src);
v3 = alloca(v2 + 9);
for ( i = strncpy(&v7, src, v2 + 1); ; i = 0LL )
{
v5 = strtok_r(i, ":", &v8);
if ( !v5 || (unsigned int)snprintf(v10, 0x1000uLL, "%s/%s", v5, a2) > 0xFFF )
break;
if ( !stat(v10, &v9) )
return strdup(v10);
}
}
return 0LL;
}

canonical_decompiled_code:
char *__fastcall func0(char *src, const char *a2)
{
size_t v2; // rax
void *v3; // rsp
char *i; // rdi
char *v5; // rcx
char v7; // [rsp-Eh] [rbp-10C8h] BYREF
char *v8; // [rsp-6h] [rbp-10C0h] BYREF
struct stat v9; // [rsp+2h] [rbp-10B8h] BYREF
char v10[4136]; // [rsp+92h] [rbp-1028h] BYREF

if ( !src )
return 0LL;
if ( a2 )
{
v2 = strlen(src);
v3 = alloca(v2 + 9);
for ( i = strncpy(&v7, src, v2 + 1); ; i = 0LL )
{
v5 = strtok_r(i, ":", &v8);
if ( !v5 || (unsigned int)snprintf(v10, 0x1000uLL, "%s/%s", v5, a2) > 0xFFF )
break;
if ( !stat(v10, &v9) )
return strdup(v10);
}
}
return 0LL;
}

original_code:
char * diminuto_path_scan(const char * string, const char * file)
{
    size_t length = 0;
    char * path = (char *)0;
    char * list = (char *)0;
    char * prefix;
    char * here;
    char * context;
    int size = 0;
    struct stat status;
    do {
        if (string == (const char *)0) {
            break;
        }
        if (file == (const char *)0) {
            break;
        }
        length = strlen(string) + 1;
        list = (char *)__builtin_alloca (length);
        strncpy(list, string, length);
        here = list;
        while ((prefix = strtok_r(here, ":", &context)) != (char *)0) {
            diminuto_path_t candidate;
            size = snprintf(candidate, sizeof(candidate), "%s/%s", prefix, file);
            if (size >= sizeof(candidate)) {
                break;
            }
            if (stat(candidate, &status) == 0) {
                path = strdup(candidate);
                break;
            }
            here = (char *)0;
        }
    } while (0);
    return path;
}

canonical_original_code:
char *diminuto_path_scan(char *string, char *file)
{
    unsigned long length = 0;
    char *path = (char *)0;
    char *list = (char *)0;
    char *prefix;
    char *here;
    char *context;
    int size = 0;
    struct stat status;
    do {
        if (string == (char *)0) {
            break;
        }
        if (file == (char *)0) {
            break;
        }
        length = strlen(string) + 1;
        list = (char *)__builtin_alloca (length);
        strncpy(list, string, length);
        here = list;
        while ((prefix = strtok_r(here, ":", &context)) != (char *)0) {
            char candidate[-1];
            size = snprintf(candidate, sizeof(candidate), "%s/%s", prefix, file);
            if (size >= sizeof(candidate)) {
                break;
            }
            if (stat(candidate, &status) == 0) {
                path = strdup(candidate);
                break;
            }
            here = (char *)0;
        }
    } while (0);
    return path;
}

variable_types:
string
char *

variable_types:
file
char *

variable_types:
length
unsigned long

variable_types:
path
char *

variable_types:
list
char *

variable_types:
prefix
char *

variable_types:
here
char *

variable_types:
context
char *

variable_types: size int

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

variable_types:
candidate
char [-1]

return_type: char *

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


decompiled_code:
char *__fastcall diminuto_path_find(const char *a1, const char *a2)
{
char *v2; // rax

if ( !a1 )
return 0LL;
v2 = getenv(a1);
return diminuto_path_scan(v2, a2);
}

canonical_decompiled_code:
char *__fastcall func1(const char *a1, const char *a2)
{
char *v2; // rax

if ( !a1 )
return 0LL;
v2 = getenv(a1);
return func0(v2, a2);
}

original_code:
char * diminuto_path_find(const char * keyword, const char * file)
{
    char * path = (char *)0;
    const char * value;
    do {
        if (keyword == (const char *)0) {
            break;
        }
        value = getenv(keyword);
        path = diminuto_path_scan(value, file);
    } while (0);
    return path;
}

canonical_original_code:
char *diminuto_path_find(char *keyword, char *file)
{
    char *path = (char *)0;
    char *value;
    do {
        if (keyword == (char *)0) {
            break;
        }
        value = getenv(keyword);
        path = diminuto_path_scan(value, file);
    } while (0);
    return path;
}

variable_types:
keyword
char *

variable_types:
value
char *


decompiled_code:
__int64 diminuto_littleendian()
{
return 1LL;
}

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

original_code:
static inline int diminuto_littleendian(void) {
    static const diminuto_endianess_t endianess = { !0 };
    return endianess.bytes[0];
}

canonical_original_code:
static inline int diminuto_littleendian() {
    static union DiminutoEndianess endianess = { !0 };
    return endianess.bytes[0];
}

variable_types: union DiminutoEndianess { int word; char bytes[-1]; }


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

v0 = socket(10, 3, 58);
if ( v0 >= 0 )
return (unsigned int)v0;
if ( *_errno_location() == 1 )
diminuto_log_perror("src/diminuto_ping6.c", 36LL, "diminuto_ping6_datagram_peer: socket: must be root");
else
diminuto_log_perror("src/diminuto_ping6.c", 38LL, "diminuto_ping6_datagram_peer: socket");
return (unsigned int)v0;
}

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

v0 = socket(10, 3, 58);
if ( v0 >= 0 )
return (unsigned int)v0;
if ( *_errno_location() == 1 )
diminuto_log_perror("src/diminuto_ping6.c", 36LL, "diminuto_ping6_datagram_peer: socket: must be root");
else
diminuto_log_perror("src/diminuto_ping6.c", 38LL, "diminuto_ping6_datagram_peer: socket");
return (unsigned int)v0;
}

original_code:
int diminuto_ping6_datagram_peer(void)
{
    int fd;
    if ((fd = socket(10, SOCK_RAW, IPPROTO_ICMPV6)) >= 0) {
    } else if ((*__errno_location ()) == 1) {
        diminuto_log_perror("src/diminuto_ping6.c", 36, "diminuto_ping6_datagram_peer: socket: must be root");
    } else {
        diminuto_log_perror("src/diminuto_ping6.c", 38, "diminuto_ping6_datagram_peer: socket");
    }
    return fd;
}

canonical_original_code:
int diminuto_ping6_datagram_peer()
{
    int fd;
    if ((fd = socket(10, SOCK_RAW, IPPROTO_ICMPV6)) >= 0) {
    } else if ((*__errno_location ()) == 1) {
        diminuto_log_perror("src/diminuto_ping6.c", 36, "diminuto_ping6_datagram_peer: socket: must be root");
    } else {
        diminuto_log_perror("src/diminuto_ping6.c", 38, "diminuto_ping6_datagram_peer: socket");
    }
    return fd;
}

variable_types: fd int


decompiled_code:
__int64 __fastcall diminuto_ping6_datagram_receive(int a1, __int64 a2, _BYTE *a3, _BYTE *a4, _WORD *a5, _WORD *a6, _QWORD *a7)
{
ssize_t v10; // rax
__int64 v11; // r12
int v13; // eax
char v14; // al
__int64 v15; // rax
socklen_t addr_len; // [rsp+14h] [rbp-9Ch] BYREF
struct sockaddr addr; // [rsp+18h] [rbp-98h] BYREF
__int64 v19; // [rsp+28h] [rbp-88h]
int v20; // [rsp+30h] [rbp-80h]
__int128 buf[7]; // [rsp+38h] [rbp-78h] BYREF

v19 = 0LL;
v20 = 0;
addr_len = 28;
buf[0] = 0LL;
buf[1] = 0LL;
buf[2] = 0LL;
buf[3] = 0LL;
addr = 0LL;
v10 = recvfrom(a1, buf, 0x40uLL, 0, &addr, &addr_len);
v11 = v10;
if ( v10 > 0 )
{
diminuto_ipc6_identify(&addr, a2, 0LL);
if ( v11 <= 7 )
return 0LL;
v14 = buf[0];
if ( a3 )
*a3 = buf[0];
if ( a4 )
*a4 = BYTE1(buf[0]);
if ( v14 != -127 )
return 0LL;
if ( a5 )
*a5 = WORD2(buf[0]);
if ( a6 )
*a6 = WORD3(buf[0]);
if ( v11 <= 63 )
v11 = 0LL;
if ( a7 )
{
v15 = diminuto_time_clock(&addr, a2);
*a7 = v15 - *((_QWORD *)&buf[0] + 1);
}
}
else
{
if ( !v10 )
return 0LL;
v13 = *_errno_location();
if ( v13 != 4 && v13 != 11 )
diminuto_log_perror("src/diminuto_ping6.c", 131LL, "diminuto_ping6_datagram_recv: recvfrom");
}
return v11;
}

canonical_decompiled_code:
__int64 __fastcall func4(int a1, __int64 a2, _BYTE *a3, _BYTE *a4, _WORD *a5, _WORD *a6, _QWORD *a7)
{
ssize_t v10; // rax
__int64 v11; // r12
int v13; // eax
char v14; // al
__int64 v15; // rax
socklen_t addr_len; // [rsp+14h] [rbp-9Ch] BYREF
struct sockaddr addr; // [rsp+18h] [rbp-98h] BYREF
__int64 v19; // [rsp+28h] [rbp-88h]
int v20; // [rsp+30h] [rbp-80h]
__int128 buf[7]; // [rsp+38h] [rbp-78h] BYREF

v19 = 0LL;
v20 = 0;
addr_len = 28;
buf[0] = 0LL;
buf[1] = 0LL;
buf[2] = 0LL;
buf[3] = 0LL;
addr = 0LL;
v10 = recvfrom(a1, buf, 0x40uLL, 0, &addr, &addr_len);
v11 = v10;
if ( v10 > 0 )
{
diminuto_ipc6_identify(&addr, a2, 0LL);
if ( v11 <= 7 )
return 0LL;
v14 = buf[0];
if ( a3 )
*a3 = buf[0];
if ( a4 )
*a4 = BYTE1(buf[0]);
if ( v14 != -127 )
return 0LL;
if ( a5 )
*a5 = WORD2(buf[0]);
if ( a6 )
*a6 = WORD3(buf[0]);
if ( v11 <= 63 )
v11 = 0LL;
if ( a7 )
{
v15 = diminuto_time_clock(&addr, a2);
*a7 = v15 - *((_QWORD *)&buf[0] + 1);
}
}
else
{
if ( !v10 )
return 0LL;
v13 = *_errno_location();
if ( v13 != 4 && v13 != 11 )
diminuto_log_perror("src/diminuto_ping6.c", 131LL, "diminuto_ping6_datagram_recv: recvfrom");
}
return v11;
}

original_code:
ssize_t diminuto_ping6_datagram_receive(int fd, diminuto_ipv6_t * addressp, uint8_t * typep, uint8_t * codep, uint16_t * idp, uint16_t * seqp, diminuto_ticks_t * elapsedp)
{
    ssize_t total;
    icmp6_datagram_t buffer = { 0 };
    struct sockaddr_in6 sa = { 0 };
    socklen_t length = sizeof(sa);
    struct icmp6_hdr * icmpp;
    diminuto_ticks_t now;
    diminuto_ticks_t then;
    if ((total = recvfrom(fd, &buffer, sizeof(buffer), 0, (struct sockaddr *)&sa, &length)) > 0) {
        diminuto_ipc6_identify((struct sockaddr *)&sa, addressp, (diminuto_port_t *)0);
        if (total < sizeof(struct icmp6_hdr)) {
            total = 0;
        } else {
            icmpp = (struct icmp6_hdr *)(&buffer);
            if (typep != (uint8_t *)0) {
                *typep = icmpp->icmp6_type;
            }
            if (codep != (uint8_t *)0) {
                *codep = icmpp->icmp6_code;
            }
            if (icmpp->icmp6_type != 129) {
                total = 0;
            } else {
                if (idp != (uint16_t *)0) {
                    *idp = icmpp->icmp6_dataun.icmp6_un_data16[0];
                }
                if (seqp != (uint16_t *)0) {
                    *seqp = icmpp->icmp6_dataun.icmp6_un_data16[1];
                }
                if (total < sizeof(buffer)) {
                    total = 0;
                }
                if (elapsedp != (diminuto_ticks_t *)0) {
                    now = diminuto_time_clock();
                    memcpy(&then, &buffer.payload[sizeof(buffer.header)], sizeof(diminuto_ticks_t));
                    *elapsedp = now - then;
                }
            }
        }
    } else if (total == 0) {
    } else if (((*__errno_location ()) != 4) && ((*__errno_location ()) != 11) && ((*__errno_location ()) != 11)) {
        diminuto_log_perror("src/diminuto_ping6.c", 131, "diminuto_ping6_datagram_recv: recvfrom");
    } else {
    }
    return total;
}

canonical_original_code:
long diminuto_ping6_datagram_receive(int fd, struct diminuto_ipv6_t *addressp, unsigned char *typep, unsigned char *codep, unsigned short *idp, unsigned short *seqp, unsigned long *elapsedp)
{
    long total;
    union icmp6_datagram_t buffer = { 0 };
    struct sockaddr_in6 sa = { 0 };
    unsigned int length = sizeof(sa);
    struct icmp6_hdr *icmpp;
    unsigned long now;
    unsigned long then;
    if ((total = recvfrom(fd, &buffer, sizeof(buffer), 0, (struct sockaddr *)&sa, &length)) > 0) {
        diminuto_ipc6_identify((struct sockaddr *)&sa, addressp, (unsigned short *)0);
        if (total < sizeof(struct icmp6_hdr)) {
            total = 0;
        } else {
            icmpp = (struct icmp6_hdr *)(&buffer);
            if (typep != (unsigned char *)0) {
                *typep = icmpp->icmp6_type;
            }
            if (codep != (unsigned char *)0) {
                *codep = icmpp->icmp6_code;
            }
            if (icmpp->icmp6_type != 129) {
                total = 0;
            } else {
                if (idp != (unsigned short *)0) {
                    *idp = icmpp->icmp6_dataun.icmp6_un_data16[0];
                }
                if (seqp != (unsigned short *)0) {
                    *seqp = icmpp->icmp6_dataun.icmp6_un_data16[1];
                }
                if (total < sizeof(buffer)) {
                    total = 0;
                }
                if (elapsedp != (unsigned long *)0) {
                    now = diminuto_time_clock();
                    memcpy(&then, &buffer.payload[sizeof(buffer.header)], sizeof(diminuto_ticks_t));
                    *elapsedp = now - then;
                }
            }
        }
    } else if (total == 0) {
    } else if (((*__errno_location ()) != 4) && ((*__errno_location ()) != 11) && ((*__errno_location ()) != 11)) {
        diminuto_log_perror("src/diminuto_ping6.c", 131, "diminuto_ping6_datagram_recv: recvfrom");
    } else {
    }
    return total;
}

variable_types: struct diminuto_ipv6_t { unsigned short u16[-1]; } *

variable_types:
typep
unsigned char *

variable_types:
codep
unsigned char *

variable_types:
idp
unsigned short *

variable_types:
seqp
unsigned short *

variable_types:
elapsedp
unsigned long *

variable_types: total long

variable_types: union icmp6_datagram_t { struct icmp6_hdr { unsigned char icmp6_type; unsigned char icmp6_code; unsigned short icmp6_cksum; union { unsigned int icmp6_un_data32[1]; unsigned short icmp6_un_data16[2]; unsigned char icmp6_un_data8[4]; } icmp6_dataun; } header; char payload[-1]; }

variable_types: struct sockaddr_in6 { unsigned short sin6_family; unsigned short sin6_port; unsigned int sin6_flowinfo; struct in6_addr { union { unsigned char __u6_addr8[16]; unsigned short __u6_addr16[8]; unsigned int __u6_addr32[4]; } __in6_u; } sin6_addr; unsigned int sin6_scope_id; }

variable_types:
length
unsigned int

variable_types: struct icmp6_hdr { unsigned char icmp6_type; unsigned char icmp6_code; unsigned short icmp6_cksum; union { unsigned int icmp6_un_data32[1]; unsigned short icmp6_un_data16[2]; unsigned char icmp6_un_data8[4]; } icmp6_dataun; } *

variable_types:
now
unsigned long

variable_types:
then
unsigned long

user_defined_types: union icmp6_datagram_t { struct icmp6_hdr header; char payload[-1]; }

user_defined_types: struct sockaddr_in6 { unsigned short sin6_family; unsigned short sin6_port; unsigned int sin6_flowinfo; struct in6_addr sin6_addr; unsigned int sin6_scope_id; }

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


decompiled_code:
__int64 __fastcall diminuto_stacktrace_fd(void **array, unsigned __int64 a2, int a3)
{
int v4; // eax
unsigned int v5; // er12

v4 = backtrace(array, a2);
v5 = v4;
if ( v4 < 0 )
{
if ( v4 < a2 )
goto LABEL_4;
goto LABEL_3;
}
if ( v4 >= a2 )
{
LABEL_3:
*_errno_location() = 7;
LABEL_4:
diminuto_log_perror("src/diminuto_stacktrace.c", 113LL, "diminuto_stacktace_fd: backtrace");
}
backtrace_symbols_fd(array, v5, a3);
return v5;
}

canonical_decompiled_code:
__int64 __fastcall func0(void **array, unsigned __int64 a2, int a3)
{
int v4; // eax
unsigned int v5; // er12

v4 = backtrace(array, a2);
v5 = v4;
if ( v4 < 0 )
{
if ( v4 < a2 )
goto LABEL_4;
goto LABEL_3;
}
if ( v4 >= a2 )
{
LABEL_3:
*_errno_location() = 7;
LABEL_4:
diminuto_log_perror("src/diminuto_stacktrace.c", 113LL, "diminuto_stacktace_fd: backtrace");
}
backtrace_symbols_fd(array, v5, a3);
return v5;
}

original_code:
int diminuto_stacktrace_fd(void ** buffer, size_t size, int fd)
{
    int rc = 0;
    rc = backtrace(buffer, size);
    if ((0 <= rc) && (rc < size)) {
    } else {
        if (rc >= size) { (*__errno_location ()) = 7; }
        diminuto_log_perror("src/diminuto_stacktrace.c", 113, "diminuto_stacktace_fd: backtrace");
    }
    backtrace_symbols_fd(buffer, rc, fd);
    return rc;
}

canonical_original_code:
int diminuto_stacktrace_fd(void **buffer, unsigned long size, int fd)
{
    int rc = 0;
    rc = backtrace(buffer, size);
    if ((0 <= rc) && (rc < size)) {
    } else {
        if (rc >= size) { (*__errno_location ()) = 7; }
        diminuto_log_perror("src/diminuto_stacktrace.c", 113, "diminuto_stacktace_fd: backtrace");
    }
    backtrace_symbols_fd(buffer, rc, fd);
    return rc;
}

variable_types:
buffer
void **

variable_types:
size
unsigned long

variable_types: rc int


decompiled_code:
__int64 diminuto_stacktrace()
{
void *v1; // [rsp+0h] [rbp-408h] BYREF

return diminuto_stacktrace_fd(&v1, 0x80uLL, 2);
}

canonical_decompiled_code:
__int64 func1()
{
void *v1; // [rsp+0h] [rbp-408h] BYREF

return func0(&v1, 0x80uLL, 2);
}

original_code:
int diminuto_stacktrace()
{
    void * buffer[DIMINUTO_STACKTRACE_SIZE];
    return diminuto_stacktrace_fd(buffer, (sizeof(buffer) / sizeof(buffer[0])), 2);
}

canonical_original_code:
int diminuto_stacktrace()
{
    void *buffer[-1];
    return diminuto_stacktrace_fd(buffer, (sizeof(buffer) / sizeof(buffer[0])), 2);
}

variable_types:
buffer
void *[-1]


decompiled_code:
__int64 __fastcall diminuto_command_length(int a1, __int64 a2)
{
__int64 v2; // r12
size_t v3; // rbp
__int64 v4; // rbx
size_t v5; // rbp
const char *v6; // rdi

if ( a1 <= 0 )
return 1LL;
v2 = a1;
v3 = 0LL;
v4 = 0LL;
do
{
v6 = *(const char **)(a2 + 8 * v4);
if ( !v6 )
break;
v5 = v3 - ((v4++ == 0) - 1LL);
v3 = strlen(v6) + v5;
}
while ( v4 != v2 );
return v3 + 1;
}

canonical_decompiled_code:
__int64 __fastcall func0(int a1, __int64 a2)
{
__int64 v2; // r12
size_t v3; // rbp
__int64 v4; // rbx
size_t v5; // rbp
const char *v6; // rdi

if ( a1 <= 0 )
return 1LL;
v2 = a1;
v3 = 0LL;
v4 = 0LL;
do
{
v6 = *(const char **)(a2 + 8 * v4);
if ( !v6 )
break;
v5 = v3 - ((v4++ == 0) - 1LL);
v3 = strlen(v6) + v5;
}
while ( v4 != v2 );
return v3 + 1;
}

original_code:
size_t diminuto_command_length(int argc, const char * argv[])
{
    size_t total = 0;
    int index = 0;
    for (index = 0; index < argc; ++index) {
        if (argv[index] == (const char *)0) {
            break;
        }
        if (index > 0) {
            total += 1;
        }
        total += strlen(argv[index]);
    }
    total += 1;
    return total;
}

canonical_original_code:
unsigned long diminuto_command_length(int argc, char *argv[])
{
    unsigned long total = 0;
    int index = 0;
    for (index = 0; index < argc; ++index) {
        if (argv[index] == (char *)0) {
            break;
        }
        if (index > 0) {
            total += 1;
        }
        total += strlen(argv[index]);
    }
    total += 1;
    return total;
}

variable_types: argc int

variable_types:
argv
char *[]

variable_types:
total
unsigned long

variable_types: index int


original_code:
size_t diminuto_command_line(int argc, const char * argv[], void * buffer, size_t size)
{
    size_t total = 0;
    size_t length = 0;
    size_t limit = 0;
    int index = 0;
    char * here = (char *)0;
    here = (char *)buffer;
    limit = size;
    if (limit > 0) {
        limit -= 1;
        for (index = 0; index < argc; ++index) {
            if (argv[index] == (const char *)0) {
                break;
            }
            if (index <= 0) {
            } else if (1 > limit) {
                break;
            } else {
                *(here++) = ' ';
                limit -= 1;
                total += 1;
            }
            length = strlen(argv[index]);
            if (length > limit) {
                break;
            }
            strncpy(here, argv[index], length);
            here += length;
            limit -= length;
            total += length;
        }
        *here = '\0';
        total += 1;
    }
    return total;
}

canonical_original_code:
unsigned long diminuto_command_line(int argc, char *argv[], void *buffer, unsigned long size)
{
    unsigned long total = 0;
    unsigned long length = 0;
    unsigned long limit = 0;
    int index = 0;
    char *here = (char *)0;
    here = (char *)buffer;
    limit = size;
    if (limit > 0) {
        limit -= 1;
        for (index = 0; index < argc; ++index) {
            if (argv[index] == (char *)0) {
                break;
            }
            if (index <= 0) {
            } else if (1 > limit) {
                break;
            } else {
                *(here++) = ' ';
                limit -= 1;
                total += 1;
            }
            length = strlen(argv[index]);
            if (length > limit) {
                break;
            }
            strncpy(here, argv[index], length);
            here += length;
            limit -= length;
            total += length;
        }
        *here = '\0';
        total += 1;
    }
    return total;
}

variable_types:
buffer
void *

variable_types:
length
unsigned long

variable_types:
limit
unsigned long

variable_types:
here
char *


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


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

variable_types: ticks long


decompiled_code:
__int64 __fastcall diminuto_condition_wait_until(pthread_mutex_t *mutex, __int64 a2)
{
pthread_mutex_t *v2; // r9
pthread_cond_t *v3; // r10
int v4; // eax
unsigned int v5; // er12
struct timespec v7; // [rsp+0h] [rbp-18h] BYREF

v7 = 0LL;
if ( a2 != -1 )
{
v7.tv_sec = diminuto_frequency_ticks2wholeseconds(a2);
v7.tv_nsec = diminuto_frequency_ticks2fractionalseconds_constprop_0(a2);
v4 = pthread_cond_timedwait(v3, v2, &v7);
v5 = v4;
if ( v4 && v4 != 110 )
{
*_errno_location() = v4;
diminuto_log_perror("src/diminuto_condition.c", 90LL, "diminuto_condition_wait_until: pthread_cond_timedwait");
return v5;
}
return v5;
}
v5 = pthread_cond_wait((pthread_cond_t *)(&mutex[1].__align + 1), mutex);
if ( !v5 )
return v5;
*_errno_location() = v5;
diminuto_log_perror("src/diminuto_condition.c", 79LL, "diminuto_condition_wait_until: pthread_cond_wait");
return v5;
}

canonical_decompiled_code:
__int64 __fastcall func4(pthread_mutex_t *mutex, __int64 a2)
{
pthread_mutex_t *v2; // r9
pthread_cond_t *v3; // r10
int v4; // eax
unsigned int v5; // er12
struct timespec v7; // [rsp+0h] [rbp-18h] BYREF

v7 = 0LL;
if ( a2 != -1 )
{
v7.tv_sec = func2(a2);
v7.tv_nsec = func3(a2);
v4 = pthread_cond_timedwait(v3, v2, &v7);
v5 = v4;
if ( v4 && v4 != 110 )
{
*_errno_location() = v4;
diminuto_log_perror("src/diminuto_condition.c", 90LL, "diminuto_condition_wait_until: pthread_cond_timedwait");
return v5;
}
return v5;
}
v5 = pthread_cond_wait((pthread_cond_t *)(&mutex[1].__align + 1), mutex);
if ( !v5 )
return v5;
*_errno_location() = v5;
diminuto_log_perror("src/diminuto_condition.c", 79LL, "diminuto_condition_wait_until: pthread_cond_wait");
return v5;
}

original_code:
int diminuto_condition_wait_until(diminuto_condition_t * cp, diminuto_ticks_t clocktime)
{
    int rc = DIMINUTO_CONDITION_ERROR;
    struct timespec later = { 0, };
    if (clocktime == DIMINUTO_CONDITION_INFINITY) {
        if ((rc = pthread_cond_wait(&(cp->condition), &(cp->mutex.mutex))) != 0) {
            (*__errno_location ()) = rc;
            diminuto_log_perror("src/diminuto_condition.c", 79, "diminuto_condition_wait_until: pthread_cond_wait");
        }
    } else {
        later.tv_sec = diminuto_frequency_ticks2wholeseconds(clocktime);
        later.tv_nsec = diminuto_frequency_ticks2fractionalseconds(clocktime, 1000000000LL);
        if ((rc = pthread_cond_timedwait(&(cp->condition), &(cp->mutex.mutex), &later)) == 0) {
        } else if (rc == DIMINUTO_CONDITION_TIMEDOUT) {
        } else {
            (*__errno_location ()) = rc;
            diminuto_log_perror("src/diminuto_condition.c", 90, "diminuto_condition_wait_until: pthread_cond_timedwait");
        }
    }
    return rc;
}

canonical_original_code:
int diminuto_condition_wait_until(struct DiminutoCondition *cp, unsigned long clocktime)
{
    int rc = DIMINUTO_CONDITION_ERROR;
    struct timespec later = { 0, };
    if (clocktime == DIMINUTO_CONDITION_INFINITY) {
        if ((rc = pthread_cond_wait(&(cp->condition), &(cp->mutex.mutex))) != 0) {
            (*__errno_location ()) = rc;
            diminuto_log_perror("src/diminuto_condition.c", 79, "diminuto_condition_wait_until: pthread_cond_wait");
        }
    } else {
        later.tv_sec = diminuto_frequency_ticks2wholeseconds(clocktime);
        later.tv_nsec = diminuto_frequency_ticks2fractionalseconds(clocktime, 1000000000LL);
        if ((rc = pthread_cond_timedwait(&(cp->condition), &(cp->mutex.mutex), &later)) == 0) {
        } else if (rc == DIMINUTO_CONDITION_TIMEDOUT) {
        } else {
            (*__errno_location ()) = rc;
            diminuto_log_perror("src/diminuto_condition.c", 90, "diminuto_condition_wait_until: pthread_cond_timedwait");
        }
    }
    return rc;
}

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

variable_types:
clocktime
unsigned long

variable_types: struct timespec { long tv_sec; long tv_nsec; }

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

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

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

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

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


decompiled_code:
__int64 __fastcall diminuto_condition_signal(pthread_cond_t *a1)
{
unsigned int v1; // er12

v1 = pthread_cond_broadcast(a1 + 1);
if ( v1 )
{
*_errno_location() = v1;
diminuto_log_perror("src/diminuto_condition.c", 103LL, "diminuto_condition_signal: pthread_cond_broadcast");
}
else
{
diminuto_thread_yield();
}
return v1;
}

canonical_decompiled_code:
__int64 __fastcall func5(pthread_cond_t *a1)
{
unsigned int v1; // er12

v1 = pthread_cond_broadcast(a1 + 1);
if ( v1 )
{
*_errno_location() = v1;
diminuto_log_perror("src/diminuto_condition.c", 103LL, "diminuto_condition_signal: pthread_cond_broadcast");
}
else
{
diminuto_thread_yield();
}
return v1;
}

original_code:
int diminuto_condition_signal(diminuto_condition_t * cp)
{
    int rc = DIMINUTO_CONDITION_ERROR;
    if ((rc = pthread_cond_broadcast(&(cp->condition))) != 0) {
        (*__errno_location ()) = rc;
        diminuto_log_perror("src/diminuto_condition.c", 103, "diminuto_condition_signal: pthread_cond_broadcast");
    } else {
        diminuto_thread_yield();
    }
    return rc;
}

canonical_original_code:
int diminuto_condition_signal(struct DiminutoCondition *cp)
{
    int rc = DIMINUTO_CONDITION_ERROR;
    if ((rc = pthread_cond_broadcast(&(cp->condition))) != 0) {
        (*__errno_location ()) = rc;
        diminuto_log_perror("src/diminuto_condition.c", 103, "diminuto_condition_signal: pthread_cond_broadcast");
    } else {
        diminuto_thread_yield();
    }
    return rc;
}

user_defined_types: union pthread_mutexattr_t { char __size[4]; int __align; }

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

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


decompiled_code:
__int64 __fastcall diminuto_ring_producer_request(unsigned int *a1, int a2)
{
unsigned int v2; // ecx
unsigned int v3; // eax
unsigned int v4; // er8

v2 = *a1;
v3 = a2 + a1[1];
if ( v3 > *a1 )
return (unsigned int)-1;
v4 = a1[2];
a1[1] = v3;
a1[2] = (v4 + a2) % v2;
return v4;
}

canonical_decompiled_code:
__int64 __fastcall func0(unsigned int *a1, int a2)
{
unsigned int v2; // ecx
unsigned int v3; // eax
unsigned int v4; // er8

v2 = *a1;
v3 = a2 + a1[1];
if ( v3 > *a1 )
return (unsigned int)-1;
v4 = a1[2];
a1[1] = v3;
a1[2] = (v4 + a2) % v2;
return v4;
}

original_code:
int diminuto_ring_producer_request(diminuto_ring_t * rp, unsigned int request)
{
    int result = -1;
    if ((rp->measure + request) <= rp->capacity) {
        rp->measure += request;
        result = rp->producer;
        rp->producer = (rp->producer + request) % rp->capacity;
    }
    return result;
}

canonical_original_code:
int diminuto_ring_producer_request(struct DiminutoRing *rp, unsigned int request)
{
    int result = -1;
    if ((rp->measure + request) <= rp->capacity) {
        rp->measure += request;
        result = rp->producer;
        rp->producer = (rp->producer + request) % rp->capacity;
    }
    return result;
}

variable_types: struct DiminutoRing { unsigned int capacity; unsigned int measure; unsigned int producer; unsigned int consumer; } *

variable_types:
request
unsigned int

variable_types: result int


decompiled_code:
__int64 __fastcall diminuto_ring_producer_revoke(unsigned int *a1, unsigned int a2)
{
unsigned int v2; // eax
unsigned int v3; // ecx
unsigned int v4; // er8

v2 = a1[1];
if ( v2 < a2 )
return (unsigned int)-1;
v3 = *a1;
v4 = a2;
a1[1] = v2 - a2;
a1[2] = (v3 + a1[2] - a2) % v3;
return v4;
}

canonical_decompiled_code:
__int64 __fastcall func1(unsigned int *a1, unsigned int a2)
{
unsigned int v2; // eax
unsigned int v3; // ecx
unsigned int v4; // er8

v2 = a1[1];
if ( v2 < a2 )
return (unsigned int)-1;
v3 = *a1;
v4 = a2;
a1[1] = v2 - a2;
a1[2] = (v3 + a1[2] - a2) % v3;
return v4;
}

original_code:
int diminuto_ring_producer_revoke(diminuto_ring_t * rp, unsigned int request)
{
    int result = -1;
    if (rp->measure >= request) {
        rp->measure -= request;
        result = request;
        rp->producer = (rp->producer + rp->capacity - request) % rp->capacity;
    }
    return result;
}

canonical_original_code:
int diminuto_ring_producer_revoke(struct DiminutoRing *rp, unsigned int request)
{
    int result = -1;
    if (rp->measure >= request) {
        rp->measure -= request;
        result = request;
        rp->producer = (rp->producer + rp->capacity - request) % rp->capacity;
    }
    return result;
}

user_defined_types: struct DiminutoRing { unsigned int capacity; unsigned int measure; unsigned int producer; unsigned int consumer; }


decompiled_code:
__int64 __fastcall diminuto_ring_consumer_request(_DWORD *a1, unsigned int a2)
{
unsigned int v2; // eax
unsigned int v3; // er8

v2 = a1[1];
if ( v2 < a2 )
return (unsigned int)-1;
v3 = a1[3];
a1[1] = v2 - a2;
a1[3] = (v3 + a2) % *a1;
return v3;
}

canonical_decompiled_code:
__int64 __fastcall func2(_DWORD *a1, unsigned int a2)
{
unsigned int v2; // eax
unsigned int v3; // er8

v2 = a1[1];
if ( v2 < a2 )
return (unsigned int)-1;
v3 = a1[3];
a1[1] = v2 - a2;
a1[3] = (v3 + a2) % *a1;
return v3;
}

original_code:
int diminuto_ring_consumer_request(diminuto_ring_t * rp, unsigned int request)
{
    int result = -1;
    if (rp->measure >= request) {
        rp->measure -= request;
        result = rp->consumer;
        rp->consumer = (rp->consumer + request) % rp->capacity;
    }
    return result;
}

canonical_original_code:
int diminuto_ring_consumer_request(struct DiminutoRing *rp, unsigned int request)
{
    int result = -1;
    if (rp->measure >= request) {
        rp->measure -= request;
        result = rp->consumer;
        rp->consumer = (rp->consumer + request) % rp->capacity;
    }
    return result;
}


decompiled_code:
__int64 __fastcall diminuto_ring_consumer_revoke(unsigned int *a1, unsigned int a2)
{
unsigned int v2; // ecx
unsigned int v3; // eax
__int64 result; // rax

v2 = *a1;
v3 = a2 + a1[1];
if ( v3 > *a1 )
return 0xFFFFFFFFLL;
a1[1] = v3;
result = a2;
a1[3] = (v2 + a1[3] - a2) % v2;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func3(unsigned int *a1, unsigned int a2)
{
unsigned int v2; // ecx
unsigned int v3; // eax
__int64 result; // rax

v2 = *a1;
v3 = a2 + a1[1];
if ( v3 > *a1 )
return 0xFFFFFFFFLL;
a1[1] = v3;
result = a2;
a1[3] = (v2 + a1[3] - a2) % v2;
return result;
}

original_code:
int diminuto_ring_consumer_revoke(diminuto_ring_t * rp, unsigned int request)
{
    int result = -1;
    if ((rp->measure + request) <= rp->capacity) {
        rp->measure += request;
        rp->consumer = (rp->consumer + rp->capacity - request) % rp->capacity;
        result = request;
    }
    return result;
}

canonical_original_code:
int diminuto_ring_consumer_revoke(struct DiminutoRing *rp, unsigned int request)
{
    int result = -1;
    if ((rp->measure + request) <= rp->capacity) {
        rp->measure += request;
        rp->consumer = (rp->consumer + rp->capacity - request) % rp->capacity;
        result = request;
    }
    return result;
}


decompiled_code:
__int64 __fastcall diminuto_memory_alignment(__int64 a1, __int64 a2)
{
return -a2 & (a2 + a1 - 1);
}

original_code:
static inline size_t diminuto_memory_alignment(size_t size, size_t alignment)
{
    --alignment;
    return (size + alignment) & (~alignment);
}

canonical_original_code:
static inline unsigned long diminuto_memory_alignment(unsigned long size, unsigned long alignment)
{
    --alignment;
    return (size + alignment) & (~alignment);
}

variable_types:
size
unsigned long

variable_types:
alignment
unsigned long


decompiled_code:
__int64 __fastcall diminuto_memory_pagesize(int *a1)
{
__int64 result; // rax
int v2; // edx
bool v3; // zf
bool v4; // sf

result = sysconf(30);
v2 = 67;
if ( result <= 0 )
{
result = getpagesize();
v3 = (int)result == 0LL;
v4 = (__int64)(int)result < 0;
if ( (int)result <= 0 )
result = 4096LL;
v2 = 2 * (v4 || v3) + 71;
}
if ( a1 )
*a1 = v2;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func1(int *a1)
{
__int64 result; // rax
int v2; // edx
bool v3; // zf
bool v4; // sf

result = sysconf(30);
v2 = 67;
if ( result <= 0 )
{
result = getpagesize();
v3 = (int)result == 0LL;
v4 = (__int64)(int)result < 0;
if ( (int)result <= 0 )
result = 4096LL;
v2 = 2 * (v4 || v3) + 71;
}
if ( a1 )
*a1 = v2;
return result;
}

original_code:
size_t diminuto_memory_pagesize(diminuto_memory_pagesize_method_t * methodp)
{
    ssize_t pagesize = 0;
    diminuto_memory_pagesize_method_t method = DIMINUTO_MEMORY_PAGESIZE_METHOD_UNKNOWN;
    do {
        if ((pagesize = sysconf(_SC_PAGESIZE)) > 0) {
            method = DIMINUTO_MEMORY_PAGESIZE_METHOD_SYSCONF_PAGESIZE;
            break;
        }
        if ((pagesize = getpagesize()) > 0) {
            method = DIMINUTO_MEMORY_PAGESIZE_METHOD_GETPAGESIZE;
            break;
        }
        pagesize = DIMINUTO_MEMORY_PAGESIZE_BYTES;
        method = DIMINUTO_MEMORY_PAGESIZE_METHOD_IMPLICIT;
    } while (0);
    if (methodp != (diminuto_memory_pagesize_method_t *)0) {
        *methodp = method;
    }
    return pagesize;
}

canonical_original_code:
unsigned long diminuto_memory_pagesize(enum DiminutoMemoryPagesizeMethod *methodp)
{
    long pagesize = 0;
    enum DiminutoMemoryPagesizeMethod method = DIMINUTO_MEMORY_PAGESIZE_METHOD_UNKNOWN;
    do {
        if ((pagesize = sysconf(_SC_PAGESIZE)) > 0) {
            method = DIMINUTO_MEMORY_PAGESIZE_METHOD_SYSCONF_PAGESIZE;
            break;
        }
        if ((pagesize = getpagesize()) > 0) {
            method = DIMINUTO_MEMORY_PAGESIZE_METHOD_GETPAGESIZE;
            break;
        }
        pagesize = DIMINUTO_MEMORY_PAGESIZE_BYTES;
        method = DIMINUTO_MEMORY_PAGESIZE_METHOD_IMPLICIT;
    } while (0);
    if (methodp != (enum DiminutoMemoryPagesizeMethod *)0) {
        *methodp = method;
    }
    return pagesize;
}

variable_types: enum DiminutoMemoryPagesizeMethod { DIMINUTO_MEMORY_PAGESIZE_METHOD_IMPLICIT=expr, DIMINUTO_MEMORY_PAGESIZE_METHOD_EXPLICIT=expr, DIMINUTO_MEMORY_PAGESIZE_METHOD_SYSCONF_PAGESIZE=expr, DIMINUTO_MEMORY_PAGESIZE_METHOD_GETPAGESIZE=expr, DIMINUTO_MEMORY_PAGESIZE_METHOD_UNKNOWN=expr } *

variable_types: pagesize long


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

result = 1LL;
if ( a1 > 1 )
{
do
result *= 2LL;
while ( result && a1 > result );
}
return result;
}

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

result = 1LL;
if ( a1 > 1 )
{
do
result *= 2LL;
while ( result && a1 > result );
}
return result;
}

original_code:
size_t diminuto_memory_power(size_t alignment)
{
    size_t power = 1;
    while ((0 < power) && (power < alignment)) {
        power <<= 1;
    }
    return power;
}

canonical_original_code:
unsigned long diminuto_memory_power(unsigned long alignment)
{
    unsigned long power = 1;
    while ((0 < power) && (power < alignment)) {
        power <<= 1;
    }
    return power;
}

variable_types:
power
unsigned long


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

result = 0LL;
if ( a1 )
{
do
{
LODWORD(result) = (a1 & 1) + result;
a1 >>= 1;
}
while ( a1 );
result = (_DWORD)result == 1;
}
return result;
}

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

result = 0LL;
if ( a1 )
{
do
{
LODWORD(result) = (a1 & 1) + result;
a1 >>= 1;
}
while ( a1 );
result = (_DWORD)result == 1;
}
return result;
}

original_code:
int diminuto_memory_is_power(size_t value)
{
    int bits = 0;
    while (value > 0) {
        if ((value & 1) != 0) {
            ++bits;
        }
        value >>= 1;
    }
    return (bits == 1);
}

canonical_original_code:
int diminuto_memory_is_power(unsigned long value)
{
    int bits = 0;
    while (value > 0) {
        if ((value & 1) != 0) {
            ++bits;
        }
        value >>= 1;
    }
    return (bits == 1);
}

variable_types:
value
unsigned long

variable_types: bits int


decompiled_code:
void *__fastcall diminuto_memory_aligned(__int64 a1)
{
__int64 v1; // rax
__int64 v2; // r9
__int64 v3; // rax
size_t v4; // r8
int v5; // eax
int v6; // ebx
int *v7; // r8
void *result; // rax
void *memptr; // [rsp+8h] [rbp-10h] BYREF

v1 = diminuto_memory_alignment(a1, 8LL);
v3 = diminuto_memory_alignment(v2, v1);
v5 = posix_memalign(&memptr, v4, v3);
if ( v5 )
{
v6 = v5;
v7 = _errno_location();
if ( v6 <= 0 )
v6 = -v6;
*v7 = v6;
goto LABEL_5;
}
result = memptr;
if ( !memptr )
{
*_errno_location() = 14;
LABEL_5:
diminuto_log_perror("src/diminuto_memory.c", 185LL, "diminuto_memory_aligned: posix_memalign");
result = 0LL;
}
return result;
}

canonical_decompiled_code:
void *__fastcall func5(__int64 a1)
{
__int64 v1; // rax
__int64 v2; // r9
__int64 v3; // rax
size_t v4; // r8
int v5; // eax
int v6; // ebx
int *v7; // r8
void *result; // rax
void *memptr; // [rsp+8h] [rbp-10h] BYREF

v1 = func0(a1, 8LL);
v3 = func0(v2, v1);
v5 = posix_memalign(&memptr, v4, v3);
if ( v5 )
{
v6 = v5;
v7 = _errno_location();
if ( v6 <= 0 )
v6 = -v6;
*v7 = v6;
goto LABEL_5;
}
result = memptr;
if ( !memptr )
{
*_errno_location() = 14;
LABEL_5:
diminuto_log_perror("src/diminuto_memory.c", 185LL, "diminuto_memory_aligned: posix_memalign");
result = 0LL;
}
return result;
}

original_code:
void * diminuto_memory_aligned(size_t alignment, size_t size)
{
    void * pointer = (void *)0;
    int rc = -1;
    alignment = diminuto_memory_alignment(alignment, sizeof(void *));
    size = diminuto_memory_alignment(size, alignment);
    rc = posix_memalign(&pointer, alignment, size);
    if (rc > 0) {
        pointer = (void *)0;
        (*__errno_location ()) = rc;
    } else if (rc < 0) {
        pointer = (void *)0;
        (*__errno_location ()) = -rc;
    } else if (pointer == (void *)0) {
        (*__errno_location ()) = 14;
    } else {
    }
    if (pointer == (void *)0) {
        diminuto_log_perror("src/diminuto_memory.c", 185, "diminuto_memory_aligned: posix_memalign");
    }
    return pointer;
}

canonical_original_code:
void *diminuto_memory_aligned(unsigned long alignment, unsigned long size)
{
    void *pointer = (void *)0;
    int rc = -1;
    alignment = diminuto_memory_alignment(alignment, sizeof(void *));
    size = diminuto_memory_alignment(size, alignment);
    rc = posix_memalign(&pointer, alignment, size);
    if (rc > 0) {
        pointer = (void *)0;
        (*__errno_location ()) = rc;
    } else if (rc < 0) {
        pointer = (void *)0;
        (*__errno_location ()) = -rc;
    } else if (pointer == (void *)0) {
        (*__errno_location ()) = 14;
    } else {
    }
    if (pointer == (void *)0) {
        diminuto_log_perror("src/diminuto_memory.c", 185, "diminuto_memory_aligned: posix_memalign");
    }
    return pointer;
}

variable_types:
pointer
void *

variable_types: rc int

return_type: void *


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

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

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

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

variable_types: signum int

variable_types: mysignaled int

variable_types: MAXIMUM int