// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/tests/tests.c
// Function: sirtest_perf
bool sirtest_perf(void) {
    static const char* logbasename = "libsir-perf";
    static const char* logext      = "";

#if !defined(DUMA)
# if !defined(SIR_PERF_PROFILE)
#  if !defined(__WIN__)
    static const size_t perflines = 1000000;
#  else
    static const size_t perflines = 100000;
#  endif
# else
    static const size_t perflines = 4000000;
# endif
#else /* DUMA */
    static const size_t perflines = 100000;
#endif

    INIT_N(si, SIRL_ALL, SIRO_NOMSEC | SIRO_NOHOST, 0, 0, "perf");
    bool pass = si_init;

    if (pass) {
        double stdioelapsed  = 0.0;
        double fileelapsed   = 0.0;
#if !defined(SIR_PERF_PROFILE)
        double printfelapsed = 0.0;

        TEST_MSG(SIR_BLUE("%zu lines printf..."), perflines);

        sir_time printftimer = {0};
        sir_timer_start(&printftimer);

        for (size_t n = 0; n < perflines; n++)
            (void)printf(SIR_WHITE("%.2f: lorem ipsum foo bar %s: %zu") SIR_EOL,
                sir_timer_elapsed(&printftimer), "baz", 1234 + n);

        printfelapsed = sir_timer_elapsed(&printftimer);
#endif

        TEST_MSG(SIR_BLUE("%zu lines libsir (stdout)..."), perflines);

        sir_time stdiotimer = {0};
        sir_timer_start(&stdiotimer);

        for (size_t n = 0; n < perflines; n++)
            (void)sir_debug("%.2f: lorem ipsum foo bar %s: %zu",
                sir_timer_elapsed(&stdiotimer), "baz", 1234 + n);

        stdioelapsed = sir_timer_elapsed(&stdiotimer);

        _sir_eqland(pass, sir_cleanup());

        INIT(si2, 0, 0, 0, 0);
        _sir_eqland(pass, si2_init);

        char logfilename[SIR_MAXPATH] = {0};
        (void)snprintf(logfilename, SIR_MAXPATH, MAKE_LOG_NAME("%s%s"), logbasename, logext);

        sirfileid logid = sir_addfile(logfilename, SIRL_ALL, SIRO_NOMSEC | SIRO_NONAME);
        _sir_eqland(pass, 0 != logid);

        if (pass) {
            TEST_MSG(SIR_BLUE("%zu lines libsir (file)..."), perflines);

            sir_time filetimer = {0};
            sir_timer_start(&filetimer);

            for (size_t n = 0; n < perflines; n++)
                (void)sir_debug("lorem ipsum foo bar %s: %zu", "baz", 1234 + n);

            fileelapsed = sir_timer_elapsed(&filetimer);

            _sir_eqland(pass, sir_remfile(logid));
        }

        if (pass) {
#if !defined(SIR_PERF_PROFILE)
            TEST_MSG(SIR_WHITEB("printf: ") SIR_CYAN("%zu lines in %.3fsec (%.1f lines/sec)"),
                perflines, printfelapsed / 1e3, (double)perflines / (printfelapsed / 1e3));
#endif
            TEST_MSG(SIR_WHITEB("libsir (stdout): ")
                   SIR_CYAN("%zu lines in %.3fsec (%.1f lines/sec)"), perflines,
                    stdioelapsed / 1e3, (double)perflines / (stdioelapsed / 1e3));

            TEST_MSG(SIR_WHITEB("libsir (file): ")
                   SIR_CYAN("%zu lines in %.3fsec (%.1f lines/sec)"), perflines,
                    fileelapsed / 1e3, (double)perflines / (fileelapsed / 1e3));

            TEST_MSG(SIR_WHITEB("timer resolution: ") SIR_CYAN("~%ldnsec"), sir_timer_getres());
        }
    }

    unsigned deleted = 0U;
    (void)enumfiles(SIR_TESTLOGDIR, logbasename, !cl_cfg.leave_logs, &deleted);

    if (deleted > 0U)
        TEST_MSG(SIR_DGRAY("deleted %u log file(s)"), deleted);

    _sir_eqland(pass, sir_cleanup());
    return PRINT_RESULT_RETURN(pass);
}

// Assembly:
subq $0x1298, %rsp           # imm = 0x1298
leaq 0x1190(%rsp), %rdi
xorl %esi, %esi
movl $0x108, %edx            # imm = 0x108
callq 0x4210
movl $0x600, 0x1194(%rsp) # imm = 0x600
movw $0xff, 0x1190(%rsp)
movl $0x100000, 0x119c(%rsp) # imm = 0x100000
movw $0x0, 0x1198(%rsp)
leaq 0x121a8(%rip), %rdi     # 0x1d2f4
xorl %esi, %esi
leaq 0x13f95(%rip), %rdx     # 0x1f0ea
leaq 0x123d1(%rip), %rcx     # 0x1d52d
movl $0x499, %r8d            # imm = 0x499
callq 0x5ce0
testb $0x1, %al
jne 0xb16d
jmp 0xb190
leaq 0x1190(%rsp), %rdi
addq $0xe8, %rdi
movl $0x20, %ecx
leaq 0x1216c(%rip), %rdx     # 0x1d2f4
movq %rcx, %rsi
callq 0x14f50
movb $0x0, 0x118f(%rsp)
leaq 0x1190(%rsp), %rdi
callq 0xf560
andb $0x1, %al
movb %al, 0x118f(%rsp)
movb 0x118f(%rsp), %al
andb $0x1, %al
movb %al, 0x118e(%rsp)
testb $0x1, 0x118e(%rsp)
je 0xb67b
xorps %xmm0, %xmm0
movsd %xmm0, 0x1180(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x1178(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x1170(%rsp)
leaq 0x13f00(%rip), %rdi     # 0x1f0f7
movl $0xf4240, %esi          # imm = 0xF4240
movb $0x0, %al
callq 0x4180
leaq 0x1160(%rsp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x4210
leaq 0x1160(%rsp), %rdi
callq 0x5b20
movq $0x0, 0x1158(%rsp)
cmpq $0xf4240, 0x1158(%rsp) # imm = 0xF4240
jae 0xb285
leaq 0x1160(%rsp), %rdi
callq 0x5b50
movq 0x1158(%rsp), %rdx
addq $0x4d2, %rdx            # imm = 0x4D2
leaq 0x13ec0(%rip), %rdi     # 0x1f121
leaq 0x146a8(%rip), %rsi     # 0x1f910
movb $0x1, %al
callq 0x4180
movq 0x1158(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x1158(%rsp)
jmp 0xb230
leaq 0x1160(%rsp), %rdi
callq 0x5b50
movsd %xmm0, 0x1170(%rsp)
leaq 0x13eb6(%rip), %rdi     # 0x1f158
movl $0xf4240, %esi          # imm = 0xF4240
movb $0x0, %al
callq 0x4180
leaq 0x1148(%rsp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x4210
leaq 0x1148(%rsp), %rdi
callq 0x5b20
movq $0x0, 0x1140(%rsp)
cmpq $0xf4240, 0x1140(%rsp) # imm = 0xF4240
jae 0xb330
leaq 0x1148(%rsp), %rdi
callq 0x5b50
movq 0x1140(%rsp), %rdx
addq $0x4d2, %rdx            # imm = 0x4D2
leaq 0x13e7f(%rip), %rdi     # 0x1f18b
leaq 0x145fd(%rip), %rsi     # 0x1f910
movb $0x1, %al
callq 0xf5f0
movq 0x1140(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x1140(%rsp)
jmp 0xb2db
leaq 0x1148(%rsp), %rdi
callq 0x5b50
movsd %xmm0, 0x1180(%rsp)
callq 0xf580
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0xb(%rsp)
jne 0xb35a
jmp 0xb365
movb 0x118e(%rsp), %al
movb %al, 0xb(%rsp)
movb 0xb(%rsp), %al
andb $0x1, %al
movb %al, 0x118e(%rsp)
leaq 0x1038(%rsp), %rdi
xorl %esi, %esi
movl $0x108, %edx            # imm = 0x108
callq 0x4210
movl $0x100000, 0x103c(%rsp) # imm = 0x100000
movw $0x0, 0x1038(%rsp)
movl $0x100000, 0x1044(%rsp) # imm = 0x100000
movw $0x0, 0x1040(%rsp)
leaq 0x11f10(%rip), %rdi     # 0x1d2c7
xorl %esi, %esi
leaq 0x13d2a(%rip), %rdx     # 0x1f0ea
leaq 0x12166(%rip), %rcx     # 0x1d52d
movl $0x4bb, %r8d            # imm = 0x4BB
callq 0x5ce0
testb $0x1, %al
jne 0xb3d8
jmp 0xb3fb
leaq 0x1038(%rsp), %rdi
addq $0xe8, %rdi
movl $0x20, %ecx
leaq 0x11ed4(%rip), %rdx     # 0x1d2c7
movq %rcx, %rsi
callq 0x14f50
movb $0x0, 0x1037(%rsp)
leaq 0x1038(%rsp), %rdi
callq 0xf560
andb $0x1, %al
movb %al, 0x1037(%rsp)
xorl %eax, %eax
testb $0x1, 0x1037(%rsp)
movb %al, 0xa(%rsp)
je 0xb434
movb 0x118e(%rsp), %al
movb %al, 0xa(%rsp)
movb 0xa(%rsp), %al
andb $0x1, %al
movb %al, 0x118e(%rsp)
leaq 0x30(%rsp), %rdi
xorl %esi, %esi
movl $0x1000, %edx           # imm = 0x1000
callq 0x4210
leaq 0x30(%rsp), %rdi
movq 0x1d26a(%rip), %rcx     # 0x286c8
movq 0x1d26b(%rip), %r8      # 0x286d0
movl $0x1000, %esi           # imm = 0x1000
leaq 0x13d3c(%rip), %rdx     # 0x1f1ad
movb $0x0, %al
callq 0x41b0
leaq 0x30(%rsp), %rdi
movl $0xff, %esi
movl $0x1200, %edx           # imm = 0x1200
callq 0xfee0
movl %eax, 0x2c(%rsp)
xorl %eax, %eax
xorl %ecx, %ecx
cmpl 0x2c(%rsp), %ecx
movb %al, 0x9(%rsp)
je 0xb4a9
movb 0x118e(%rsp), %al
movb %al, 0x9(%rsp)
movb 0x9(%rsp), %al
andb $0x1, %al
movb %al, 0x118e(%rsp)
testb $0x1, 0x118e(%rsp)
je 0xb57a
leaq 0x13cee(%rip), %rdi     # 0x1f1b9
movl $0xf4240, %esi          # imm = 0xF4240
movb $0x0, %al
callq 0x4180
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x4210
leaq 0x18(%rsp), %rdi
callq 0x5b20
movq $0x0, 0x10(%rsp)
cmpq $0xf4240, 0x10(%rsp)    # imm = 0xF4240
jae 0xb537
movq 0x10(%rsp), %rdx
addq $0x4d2, %rdx            # imm = 0x4D2
leaq 0x13c78(%rip), %rdi     # 0x1f191
leaq 0x143f0(%rip), %rsi     # 0x1f910
movb $0x0, %al
callq 0xf5f0
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0xb4fb
leaq 0x18(%rsp), %rdi
callq 0x5b50
movsd %xmm0, 0x1178(%rsp)
movl 0x2c(%rsp), %edi
callq 0xff10
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0x8(%rsp)
jne 0xb562
jmp 0xb56d
movb 0x118e(%rsp), %al
movb %al, 0x8(%rsp)
movb 0x8(%rsp), %al
andb $0x1, %al
movb %al, 0x118e(%rsp)
testb $0x1, 0x118e(%rsp)
je 0xb679
movsd 0x1170(%rsp), %xmm0
movsd 0x11a6f(%rip), %xmm1    # 0x1d008
divsd %xmm1, %xmm0
movsd 0x1170(%rsp), %xmm2
movsd 0x11a5a(%rip), %xmm1    # 0x1d008
divsd %xmm1, %xmm2
movsd 0x11efe(%rip), %xmm1    # 0x1d4b8
divsd %xmm2, %xmm1
leaq 0x13c25(%rip), %rdi     # 0x1f1ea
movl $0xf4240, %esi          # imm = 0xF4240
movb $0x2, %al
callq 0x4180
movsd 0x1180(%rsp), %xmm0
movsd 0x11a26(%rip), %xmm1    # 0x1d008
divsd %xmm1, %xmm0
movsd 0x1180(%rsp), %xmm2
movsd 0x11a11(%rip), %xmm1    # 0x1d008
divsd %xmm1, %xmm2
movsd 0x11eb5(%rip), %xmm1    # 0x1d4b8
divsd %xmm2, %xmm1
leaq 0x13c34(%rip), %rdi     # 0x1f242
movl $0xf4240, %esi          # imm = 0xF4240
movb $0x2, %al
callq 0x4180
movsd 0x1178(%rsp), %xmm0
movsd 0x119dd(%rip), %xmm1    # 0x1d008
divsd %xmm1, %xmm0
movsd 0x1178(%rsp), %xmm2
movsd 0x119c8(%rip), %xmm1    # 0x1d008
divsd %xmm1, %xmm2
movsd 0x11e6c(%rip), %xmm1    # 0x1d4b8
divsd %xmm2, %xmm1
leaq 0x13c4c(%rip), %rdi     # 0x1f2a3
movl $0xf4240, %esi          # imm = 0xF4240
movb $0x2, %al
callq 0x4180
callq 0x53a0
movq %rax, %rsi
leaq 0x13c90(%rip), %rdi     # 0x1f302
movb $0x0, %al
callq 0x4180
jmp 0xb67b
movl $0x0, 0xc(%rsp)
movq 0x1d03e(%rip), %rsi     # 0x286c8
movb 0x1d328(%rip), %al      # 0x289b8
xorb $-0x1, %al
movzbl %al, %edx
andl $0x1, %edx
leaq 0x13ca8(%rip), %rdi     # 0x1f347
leaq 0xc(%rsp), %rcx
callq 0x5660
cmpl $0x0, 0xc(%rsp)
jbe 0xb6c2
movl 0xc(%rsp), %esi
leaq 0x13c94(%rip), %rdi     # 0x1f34f
movb $0x0, %al
callq 0x4180
callq 0xf580
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0x7(%rsp)
jne 0xb6d6
jmp 0xb6e1
movb 0x118e(%rsp), %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
andb $0x1, %al
movb %al, 0x118e(%rsp)
movb 0x118e(%rsp), %al
xorl %esi, %esi
andb $0x1, %al
movzbl %al, %edi
callq 0x4da0
andb $0x1, %al
addq $0x1298, %rsp           # imm = 0x1298
retq
nopl (%rax,%rax)