// File: /workspace/github_c_makefile_star2_O0/aremmell[P]libsir/tests/tests.c
// Function: sirtest_squelchspam
bool sirtest_squelchspam(void) {
    INIT(si, SIRL_ALL, 0, 0, 0);
    bool pass = si_init;

    static const size_t alternate  = 50;
    static const size_t sequence[] = {
        1000, /* non-repeating messages. */
        1000, /* repeating messages. */
        1000, /* alternating repeating and non-repeating messages. */
        100   /* repeating messages, but on different levels. */
    };

    sir_time timer;
    sir_timer_start(&timer);

    TEST_MSG(SIR_BLUE("%zu non-repeating messages..."), sequence[0]);

    for (size_t n = 0, ascii_idx = 33; n < sequence[0]; n++, ascii_idx++) {
        _sir_eqland(pass, sir_debug("%c%c a non-repeating message", (char)ascii_idx,
            (char)ascii_idx + 1));

        if (ascii_idx == 125)
            ascii_idx = 33;
    }

    TEST_MSG(SIR_BLUE("%zu repeating messages..."), sequence[1]);

    for (size_t n = 0; n < sequence[1]; n++) {
        bool ret = sir_debug("a repeating message");

        if (n >= SIR_SQUELCH_THRESHOLD - 1)
            _sir_eqland(pass, !ret);
        else
            _sir_eqland(pass, ret);
    }

    TEST_MSG(SIR_BLUE("%zu alternating repeating and non-repeating messages..."),
        sequence[2]);

    bool repeating   = false;
    size_t counter   = 0;
    size_t repeat_id = 0;
    for (size_t n = 0, ascii_idx = 33; n < sequence[2]; n++, counter++, ascii_idx++) {
        if (!repeating) {
            _sir_eqland(pass, sir_debug("%c%c a non-repeating message", (char)ascii_idx,
                (char)ascii_idx + 1));
        } else {
            bool ret = sir_debug("%zu a repeating message", repeat_id);

            if (counter - 1 >= SIR_SQUELCH_THRESHOLD - 1)
                _sir_eqland(pass, !ret);
            else
                _sir_eqland(pass, ret);
        }

        if (counter == alternate) {
            repeating = !repeating;
            counter = 0;
            repeat_id++;
        }

        if (ascii_idx == 125)
            ascii_idx = 33;
    }

    TEST_MSG(SIR_BLUE("%zu repeating messages, but on different levels..."), sequence[3]);

    for (size_t n = 0; n < sequence[3]; n++) {
        if (n % 2 == 0)
            _sir_eqland(pass, sir_debug("a repeating message"));
        else
            _sir_eqland(pass, sir_info("a repeating message"));
    }

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

// Assembly:
subq $0x188, %rsp            # imm = 0x188
leaq 0x80(%rsp), %rdi
xorl %esi, %esi
movl $0x108, %edx            # imm = 0x108
callq 0x4210
movl $0x100000, 0x84(%rsp) # imm = 0x100000
movw $0xff, 0x80(%rsp)
movl $0x100000, 0x8c(%rsp) # imm = 0x100000
movw $0x0, 0x88(%rsp)
leaq 0xfd5b(%rip), %rdi      # 0x1d2c7
xorl %esi, %esi
leaq 0x1252f(%rip), %rdx     # 0x1faa4
leaq 0xffb1(%rip), %rcx      # 0x1d52d
movl $0x719, %r8d            # imm = 0x719
callq 0x5ce0
testb $0x1, %al
jne 0xd58d
jmp 0xd5b0
leaq 0x80(%rsp), %rdi
addq $0xe8, %rdi
movl $0x20, %ecx
leaq 0xfd1f(%rip), %rdx      # 0x1d2c7
movq %rcx, %rsi
callq 0x14f50
movb $0x0, 0x7f(%rsp)
leaq 0x80(%rsp), %rdi
callq 0xf560
andb $0x1, %al
movb %al, 0x7f(%rsp)
movb 0x7f(%rsp), %al
andb $0x1, %al
movb %al, 0x7e(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x5b20
movq 0x13aad(%rip), %rsi     # 0x21090
leaq 0x124ce(%rip), %rdi     # 0x1fab8
movb $0x0, %al
callq 0x4180
movq $0x0, 0x60(%rsp)
movq $0x21, 0x58(%rsp)
movq 0x60(%rsp), %rax
cmpq 0x13a81(%rip), %rax     # 0x21090
jae 0xd687
movq 0x58(%rsp), %rax
movsbl %al, %esi
movq 0x58(%rsp), %rax
movsbl %al, %edx
addl $0x1, %edx
leaq 0x124c1(%rip), %rdi     # 0x1faec
movb $0x0, %al
callq 0xf5f0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0x17(%rsp)
jne 0xd641
jmp 0xd649
movb 0x7e(%rsp), %al
movb %al, 0x17(%rsp)
movb 0x17(%rsp), %al
andb $0x1, %al
movb %al, 0x7e(%rsp)
cmpq $0x7d, 0x58(%rsp)
jne 0xd664
movq $0x21, 0x58(%rsp)
jmp 0xd666
movq 0x60(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x60(%rsp)
movq 0x58(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x58(%rsp)
jmp 0xd603
movq 0x13a0a(%rip), %rsi     # 0x21098
leaq 0x12474(%rip), %rdi     # 0x1fb09
movb $0x0, %al
callq 0x4180
movq $0x0, 0x50(%rsp)
movq 0x50(%rsp), %rax
cmpq 0x139e7(%rip), %rax     # 0x21098
jae 0xd721
leaq 0x124d1(%rip), %rdi     # 0x1fb8b
movb $0x0, %al
callq 0xf5f0
andb $0x1, %al
movb %al, 0x4f(%rsp)
cmpq $0x4, 0x50(%rsp)
jb 0xd6f0
xorl %eax, %eax
testb $0x1, 0x4f(%rsp)
movb %al, 0x16(%rsp)
jne 0xd6e4
movb 0x7e(%rsp), %al
movb %al, 0x16(%rsp)
movb 0x16(%rsp), %al
andb $0x1, %al
movb %al, 0x7e(%rsp)
jmp 0xd70f
xorl %eax, %eax
testb $0x1, 0x4f(%rsp)
movb %al, 0x15(%rsp)
je 0xd705
movb 0x7e(%rsp), %al
movb %al, 0x15(%rsp)
movb 0x15(%rsp), %al
andb $0x1, %al
movb %al, 0x7e(%rsp)
jmp 0xd711
movq 0x50(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x50(%rsp)
jmp 0xd6a5
movq 0x13978(%rip), %rsi     # 0x210a0
leaq 0x1240a(%rip), %rdi     # 0x1fb39
movb $0x0, %al
callq 0x4180
movb $0x0, 0x4e(%rsp)
movq $0x0, 0x40(%rsp)
movq $0x0, 0x38(%rsp)
movq $0x0, 0x30(%rsp)
movq $0x21, 0x28(%rsp)
movq 0x30(%rsp), %rax
cmpq 0x13935(%rip), %rax     # 0x210a0
jae 0xd893
testb $0x1, 0x4e(%rsp)
jne 0xd7bc
movq 0x28(%rsp), %rax
movsbl %al, %esi
movq 0x28(%rsp), %rax
movsbl %al, %edx
addl $0x1, %edx
leaq 0x1235a(%rip), %rdi     # 0x1faec
movb $0x0, %al
callq 0xf5f0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0x14(%rsp)
jne 0xd7a8
jmp 0xd7b0
movb 0x7e(%rsp), %al
movb %al, 0x14(%rsp)
movb 0x14(%rsp), %al
andb $0x1, %al
movb %al, 0x7e(%rsp)
jmp 0xd826
movq 0x38(%rsp), %rsi
leaq 0x123bf(%rip), %rdi     # 0x1fb87
movb $0x0, %al
callq 0xf5f0
andb $0x1, %al
movb %al, 0x27(%rsp)
movq 0x40(%rsp), %rax
subq $0x1, %rax
cmpq $0x4, %rax
jb 0xd805
xorl %eax, %eax
testb $0x1, 0x27(%rsp)
movb %al, 0x13(%rsp)
jne 0xd7f9
movb 0x7e(%rsp), %al
movb %al, 0x13(%rsp)
movb 0x13(%rsp), %al
andb $0x1, %al
movb %al, 0x7e(%rsp)
jmp 0xd824
xorl %eax, %eax
testb $0x1, 0x27(%rsp)
movb %al, 0x12(%rsp)
je 0xd81a
movb 0x7e(%rsp), %al
movb %al, 0x12(%rsp)
movb 0x12(%rsp), %al
andb $0x1, %al
movb %al, 0x7e(%rsp)
jmp 0xd826
cmpq $0x32, 0x40(%rsp)
jne 0xd851
movb 0x4e(%rsp), %al
xorb $-0x1, %al
andb $0x1, %al
movb %al, 0x4e(%rsp)
movq $0x0, 0x40(%rsp)
movq 0x38(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x38(%rsp)
cmpq $0x7d, 0x28(%rsp)
jne 0xd862
movq $0x21, 0x28(%rsp)
jmp 0xd864
movq 0x30(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x30(%rsp)
movq 0x40(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x40(%rsp)
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0xd75f
movq 0x1380e(%rip), %rsi     # 0x210a8
leaq 0x122fe(%rip), %rdi     # 0x1fb9f
movb $0x0, %al
callq 0x4180
movq $0x0, 0x18(%rsp)
movq 0x18(%rsp), %rax
cmpq 0x137eb(%rip), %rax     # 0x210a8
jae 0xd947
movq 0x18(%rsp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
jne 0xd903
leaq 0x122b2(%rip), %rdi     # 0x1fb8b
movb $0x0, %al
callq 0xf5f0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0x11(%rsp)
jne 0xd8ef
jmp 0xd8f7
movb 0x7e(%rsp), %al
movb %al, 0x11(%rsp)
movb 0x11(%rsp), %al
andb $0x1, %al
movb %al, 0x7e(%rsp)
jmp 0xd932
leaq 0x12281(%rip), %rdi     # 0x1fb8b
movb $0x0, %al
callq 0xf770
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0x10(%rsp)
jne 0xd920
jmp 0xd928
movb 0x7e(%rsp), %al
movb %al, 0x10(%rsp)
movb 0x10(%rsp), %al
andb $0x1, %al
movb %al, 0x7e(%rsp)
jmp 0xd934
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0xd8b1
callq 0xf580
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0xf(%rsp)
jne 0xd95b
jmp 0xd963
movb 0x7e(%rsp), %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
andb $0x1, %al
movb %al, 0x7e(%rsp)
movb 0x7e(%rsp), %al
xorl %esi, %esi
andb $0x1, %al
movzbl %al, %edi
callq 0x4da0
andb $0x1, %al
addq $0x188, %rsp            # imm = 0x188
retq
nopw (%rax,%rax)