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

    char str[] = "Kneel  \f \n  before  \t \r \v  Zod!?";

    TEST_MSG_0(SIR_WHITEB("--- valid string utility usage ---"));

    _sir_eqland(pass, _sir_strsqueeze(str) && 0 == strncmp(str, "Kneel before Zod!?", 18));
    TEST_MSG("_sir_strsqueeze:            '%s'", str);

    _sir_eqland(pass, _sir_strremove(str, "!") && 0 == strncmp(str, "Kneel before Zod?", 17));
    TEST_MSG("_sir_strremove(\"!\"):        '%s'", str);

    _sir_eqland(pass, _sir_strreplace(str, '?', '.') && 0 == strncmp(str, "Kneel before Zod.", 17));
    TEST_MSG("_sir_strreplace(\"?\", \".\"):  '%s'", str);

    _sir_eqland(pass, 1 == _sir_strcreplace(str, '.', '!', 1) && 0 == strncmp(str, "Kneel before Zod!", 17));
    TEST_MSG("_sir_strcreplace(\".\", \"!\"): '%s'", str);

    _sir_eqland(pass, _sir_strredact(str, "e", '*') && 0 == strncmp(str, "Kn**l b*for* Zod!", 17));
    TEST_MSG("_sir_strredact(\"e\", \"*\"):   '%s'", str);

    _sir_eqland(pass, _sir_strredact(str, "X", 'Y') && 0 == strncmp(str, "Kn**l b*for* Zod!", 17));
    TEST_MSG("_sir_strredact(\"X\", \"Y\"):   '%s'", str);

    PASSFAIL_MSG(pass, "\t--- valid string utility usage: %s ---" SIR_EOL SIR_EOL, PRN_PASS(pass));

    TEST_MSG_0(SIR_WHITEB("--- invalid string utility usage - NULL pointer ---"));

    TEST_MSG_0("_sir_strsqueeze:  NULL pointer");
    _sir_eqland(pass, !_sir_strsqueeze(NULL));

    TEST_MSG_0("_sir_strremove:   NULL pointer");
    _sir_eqland(pass, !_sir_strremove(NULL, "sub"));

    TEST_MSG_0("_sir_strreplace:  NULL pointer");
    _sir_eqland(pass, !_sir_strreplace(NULL, 'c', 'n'));

    TEST_MSG_0("_sir_strcreplace: NULL pointer");
    _sir_eqland(pass, !_sir_strcreplace(NULL, 'c', 'n', -1));

    TEST_MSG_0("_sir_strredact:   NULL pointer");
    _sir_eqland(pass, !_sir_strredact(NULL, "s", '*'));

    PASSFAIL_MSG(pass, "\t--- invalid string utility usage - NULL pointer: %s ---" SIR_EOL SIR_EOL, PRN_PASS(pass));

    TEST_MSG_0(SIR_WHITEB("--- invalid string utility usage - bad parameters ---"));

    TEST_MSG_0("_sir_strremove:   bad parameter \"sub\"");
    _sir_eqland(pass, _sir_strremove(str, NULL));

    TEST_MSG_0("_sir_strreplace:  bad parameter 'c'");
    _sir_eqland(pass, _sir_strreplace(str, 0, 'n'));

    TEST_MSG_0("_sir_strreplace:  bad parameter 'n'");
    _sir_eqland(pass, _sir_strreplace(str, 'c', 0));

    TEST_MSG_0("_sir_strcreplace: bad parameter 'c'");
    _sir_eqland(pass, !_sir_strcreplace(str, 0, 'n', -1));

    TEST_MSG_0("_sir_strcreplace: bad parameter 'n'");
    _sir_eqland(pass, !_sir_strcreplace(str, 'c', 0, -1));

    TEST_MSG_0("_sir_strcreplace: bad parameter 'max'");
    _sir_eqland(pass, !_sir_strcreplace(str, 'c', 'n', 0));

    TEST_MSG_0("_sir_strredact:   bad parameter \"sub\"");
    _sir_eqland(pass, _sir_strredact(str, NULL, '*'));

    TEST_MSG_0("_sir_strredact:   bad parameter 'c'");
    _sir_eqland(pass, _sir_strredact(str, "sub", 0));

    PASSFAIL_MSG(pass, "\t--- invalid string utility usage - bad parameters: %s ---" SIR_EOL, PRN_PASS(pass));

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

// Assembly:
subq $0x158, %rsp            # imm = 0x158
leaq 0x50(%rsp), %rdi
xorl %esi, %esi
movl $0x108, %edx            # imm = 0x108
callq 0x4210
movl $0x100000, 0x54(%rsp)   # imm = 0x100000
movw $0xff, 0x50(%rsp)
movl $0x100000, 0x5c(%rsp)   # imm = 0x100000
movw $0x0, 0x58(%rsp)
leaq 0xf34a(%rip), %rdi      # 0x1d2c7
xorl %esi, %esi
leaq 0x11efc(%rip), %rdx     # 0x1fe82
leaq 0xf5a0(%rip), %rcx      # 0x1d52d
movl $0x7e9, %r8d            # imm = 0x7E9
callq 0x5ce0
testb $0x1, %al
jne 0xdf9e
jmp 0xdfbe
leaq 0x50(%rsp), %rdi
addq $0xe8, %rdi
movl $0x20, %ecx
leaq 0xf311(%rip), %rdx      # 0x1d2c7
movq %rcx, %rsi
callq 0x14f50
movb $0x0, 0x4f(%rsp)
leaq 0x50(%rsp), %rdi
callq 0xf560
andb $0x1, %al
movb %al, 0x4f(%rsp)
movb 0x4f(%rsp), %al
andb $0x1, %al
movb %al, 0x4e(%rsp)
leaq 0x20(%rsp), %rdi
leaq 0x130e7(%rip), %rsi     # 0x210d0
movl $0x21, %edx
callq 0x4340
leaq 0x11e9c(%rip), %rdi     # 0x1fe96
movb $0x0, %al
callq 0x4180
leaq 0x20(%rsp), %rdi
callq 0x156f0
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, 0x1f(%rsp)
je 0xe046
leaq 0x20(%rsp), %rdi
leaq 0x11ea9(%rip), %rsi     # 0x1fecf
movl $0x12, %edx
callq 0x4090
movl %eax, %edx
xorl %eax, %eax
xorl %ecx, %ecx
cmpl %edx, %ecx
movb %al, 0x1f(%rsp)
jne 0xe046
movb 0x4e(%rsp), %al
movb %al, 0x1f(%rsp)
movb 0x1f(%rsp), %al
andb $0x1, %al
movb %al, 0x4e(%rsp)
leaq 0x20(%rsp), %rsi
leaq 0x11e86(%rip), %rdi     # 0x1fee2
movb $0x0, %al
callq 0x4180
leaq 0x20(%rsp), %rdi
leaq 0x145ad(%rip), %rsi     # 0x2261c
callq 0x155b0
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, 0x1e(%rsp)
je 0xe0af
leaq 0x20(%rsp), %rdi
leaq 0x11e76(%rip), %rsi     # 0x1ff05
movl $0x11, %edx
callq 0x4090
movl %eax, %edx
xorl %eax, %eax
xorl %ecx, %ecx
cmpl %edx, %ecx
movb %al, 0x1e(%rsp)
jne 0xe0af
movb 0x4e(%rsp), %al
movb %al, 0x1e(%rsp)
movb 0x1e(%rsp), %al
andb $0x1, %al
movb %al, 0x4e(%rsp)
leaq 0x20(%rsp), %rsi
leaq 0x11e52(%rip), %rdi     # 0x1ff17
movb $0x0, %al
callq 0x4180
leaq 0x20(%rsp), %rdi
movl $0x3f, %esi
movl $0x2e, %edx
callq 0x158d0
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, 0x1d(%rsp)
je 0xe11b
leaq 0x20(%rsp), %rdi
leaq 0x11e3f(%rip), %rsi     # 0x1ff3a
movl $0x11, %edx
callq 0x4090
movl %eax, %edx
xorl %eax, %eax
xorl %ecx, %ecx
cmpl %edx, %ecx
movb %al, 0x1d(%rsp)
jne 0xe11b
movb 0x4e(%rsp), %al
movb %al, 0x1d(%rsp)
movb 0x1d(%rsp), %al
andb $0x1, %al
movb %al, 0x4e(%rsp)
leaq 0x20(%rsp), %rsi
leaq 0x11e1b(%rip), %rdi     # 0x1ff4c
movb $0x0, %al
callq 0x4180
leaq 0x20(%rsp), %rdi
movl $0x2e, %esi
movl $0x21, %edx
movl $0x1, %ecx
callq 0x15970
movq %rax, %rdx
xorl %eax, %eax
movl $0x1, %ecx
cmpq %rdx, %rcx
movb %al, 0x1c(%rsp)
jne 0xe190
leaq 0x20(%rsp), %rdi
leaq 0x11dff(%rip), %rsi     # 0x1ff6f
movl $0x11, %edx
callq 0x4090
movl %eax, %edx
xorl %eax, %eax
xorl %ecx, %ecx
cmpl %edx, %ecx
movb %al, 0x1c(%rsp)
jne 0xe190
movb 0x4e(%rsp), %al
movb %al, 0x1c(%rsp)
movb 0x1c(%rsp), %al
andb $0x1, %al
movb %al, 0x4e(%rsp)
leaq 0x20(%rsp), %rsi
leaq 0x11ddb(%rip), %rdi     # 0x1ff81
movb $0x0, %al
callq 0x4180
leaq 0x20(%rsp), %rdi
leaq 0x144af(%rip), %rsi     # 0x22668
movl $0x2a, %edx
callq 0x157f0
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, 0x1b(%rsp)
je 0xe1fe
leaq 0x20(%rsp), %rdi
leaq 0x11dc6(%rip), %rsi     # 0x1ffa4
movl $0x11, %edx
callq 0x4090
movl %eax, %edx
xorl %eax, %eax
xorl %ecx, %ecx
cmpl %edx, %ecx
movb %al, 0x1b(%rsp)
jne 0xe1fe
movb 0x4e(%rsp), %al
movb %al, 0x1b(%rsp)
movb 0x1b(%rsp), %al
andb $0x1, %al
movb %al, 0x4e(%rsp)
leaq 0x20(%rsp), %rsi
leaq 0x11da2(%rip), %rdi     # 0x1ffb6
movb $0x0, %al
callq 0x4180
leaq 0x20(%rsp), %rdi
leaq 0x11db2(%rip), %rsi     # 0x1ffd9
movl $0x59, %edx
callq 0x157f0
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, 0x1a(%rsp)
je 0xe26c
leaq 0x20(%rsp), %rdi
leaq 0x11d58(%rip), %rsi     # 0x1ffa4
movl $0x11, %edx
callq 0x4090
movl %eax, %edx
xorl %eax, %eax
xorl %ecx, %ecx
cmpl %edx, %ecx
movb %al, 0x1a(%rsp)
jne 0xe26c
movb 0x4e(%rsp), %al
movb %al, 0x1a(%rsp)
movb 0x1a(%rsp), %al
andb $0x1, %al
movb %al, 0x4e(%rsp)
leaq 0x20(%rsp), %rsi
leaq 0x11d59(%rip), %rdi     # 0x1ffdb
movb $0x0, %al
callq 0x4180
movb 0x4e(%rsp), %cl
leaq 0x11da8(%rip), %rdi     # 0x2003c
leaq 0x11d63(%rip), %rax     # 0x1fffe
testb $0x1, %cl
cmovneq %rax, %rdi
movb 0x4e(%rsp), %cl
leaq 0xee22(%rip), %rsi      # 0x1d0cf
leaq 0xee02(%rip), %rax      # 0x1d0b6
testb $0x1, %cl
cmovneq %rax, %rsi
movb $0x0, %al
callq 0x4180
leaq 0x11db1(%rip), %rdi     # 0x2007a
movb $0x0, %al
callq 0x4180
leaq 0x11ded(%rip), %rdi     # 0x200c4
movb $0x0, %al
callq 0x4180
xorl %eax, %eax
movl %eax, %edi
callq 0x156f0
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, 0x19(%rsp)
jne 0xe2fe
movb 0x4e(%rsp), %al
movb %al, 0x19(%rsp)
movb 0x19(%rsp), %al
andb $0x1, %al
movb %al, 0x4e(%rsp)
leaq 0x11dd6(%rip), %rdi     # 0x200e5
movb $0x0, %al
callq 0x4180
xorl %eax, %eax
movl %eax, %edi
leaq 0x11de5(%rip), %rsi     # 0x20106
callq 0x155b0
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, 0x18(%rsp)
jne 0xe33d
movb 0x4e(%rsp), %al
movb %al, 0x18(%rsp)
movb 0x18(%rsp), %al
andb $0x1, %al
movb %al, 0x4e(%rsp)
leaq 0x11dbc(%rip), %rdi     # 0x2010a
movb $0x0, %al
callq 0x4180
xorl %eax, %eax
movl %eax, %edi
movl $0x63, %esi
movl $0x6e, %edx
callq 0x158d0
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, 0x17(%rsp)
jne 0xe37f
movb 0x4e(%rsp), %al
movb %al, 0x17(%rsp)
movb 0x17(%rsp), %al
andb $0x1, %al
movb %al, 0x4e(%rsp)
leaq 0x11d9b(%rip), %rdi     # 0x2012b
movb $0x0, %al
callq 0x4180
xorl %eax, %eax
movl %eax, %edi
movl $0x63, %esi
movl $0x6e, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x15970
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, 0x16(%rsp)
jne 0xe3c6
movb 0x4e(%rsp), %al
movb %al, 0x16(%rsp)
movb 0x16(%rsp), %al
andb $0x1, %al
movb %al, 0x4e(%rsp)
leaq 0x11d75(%rip), %rdi     # 0x2014c
movb $0x0, %al
callq 0x4180
xorl %eax, %eax
movl %eax, %edi
leaq 0xee40(%rip), %rsi      # 0x1d229
movl $0x2a, %edx
callq 0x157f0
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, 0x15(%rsp)
jne 0xe40a
movb 0x4e(%rsp), %al
movb %al, 0x15(%rsp)
movb 0x15(%rsp), %al
andb $0x1, %al
movb %al, 0x4e(%rsp)
movb 0x4e(%rsp), %cl
leaq 0x11d9d(%rip), %rdi     # 0x201bc
leaq 0x11d47(%rip), %rax     # 0x2016d
testb $0x1, %cl
cmovneq %rax, %rdi
movb 0x4e(%rsp), %cl
leaq 0xec97(%rip), %rsi      # 0x1d0cf
leaq 0xec77(%rip), %rax      # 0x1d0b6
testb $0x1, %cl
cmovneq %rax, %rsi
movb $0x0, %al
callq 0x4180
leaq 0x11db7(%rip), %rdi     # 0x2020b
movb $0x0, %al
callq 0x4180
leaq 0x11df5(%rip), %rdi     # 0x20257
movb $0x0, %al
callq 0x4180
leaq 0x20(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x155b0
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, 0x14(%rsp)
je 0xe48e
movb 0x4e(%rsp), %al
movb %al, 0x14(%rsp)
movb 0x14(%rsp), %al
andb $0x1, %al
movb %al, 0x4e(%rsp)
leaq 0x11de0(%rip), %rdi     # 0x2027f
movb $0x0, %al
callq 0x4180
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
movl $0x6e, %edx
callq 0x158d0
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, 0x13(%rsp)
je 0xe4ce
movb 0x4e(%rsp), %al
movb %al, 0x13(%rsp)
movb 0x13(%rsp), %al
andb $0x1, %al
movb %al, 0x4e(%rsp)
leaq 0x11dc6(%rip), %rdi     # 0x202a5
movb $0x0, %al
callq 0x4180
leaq 0x20(%rsp), %rdi
movl $0x63, %esi
xorl %edx, %edx
callq 0x158d0
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, 0x12(%rsp)
je 0xe50e
movb 0x4e(%rsp), %al
movb %al, 0x12(%rsp)
movb 0x12(%rsp), %al
andb $0x1, %al
movb %al, 0x4e(%rsp)
leaq 0x11dac(%rip), %rdi     # 0x202cb
movb $0x0, %al
callq 0x4180
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
movl $0x6e, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x15970
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, 0x11(%rsp)
jne 0xe553
movb 0x4e(%rsp), %al
movb %al, 0x11(%rsp)
movb 0x11(%rsp), %al
andb $0x1, %al
movb %al, 0x4e(%rsp)
leaq 0x11d8d(%rip), %rdi     # 0x202f1
movb $0x0, %al
callq 0x4180
leaq 0x20(%rsp), %rdi
movl $0x63, %esi
xorl %edx, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x15970
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, 0x10(%rsp)
jne 0xe598
movb 0x4e(%rsp), %al
movb %al, 0x10(%rsp)
movb 0x10(%rsp), %al
andb $0x1, %al
movb %al, 0x4e(%rsp)
leaq 0x11d6e(%rip), %rdi     # 0x20317
movb $0x0, %al
callq 0x4180
leaq 0x20(%rsp), %rdi
movl $0x63, %esi
movl $0x6e, %edx
xorl %ecx, %ecx
callq 0x15970
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, 0xf(%rsp)
jne 0xe5dd
movb 0x4e(%rsp), %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
andb $0x1, %al
movb %al, 0x4e(%rsp)
leaq 0x11d51(%rip), %rdi     # 0x2033f
movb $0x0, %al
callq 0x4180
leaq 0x20(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x2a, %edx
callq 0x157f0
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, 0xe(%rsp)
je 0xe61f
movb 0x4e(%rsp), %al
movb %al, 0xe(%rsp)
movb 0xe(%rsp), %al
andb $0x1, %al
movb %al, 0x4e(%rsp)
leaq 0x11d37(%rip), %rdi     # 0x20367
movb $0x0, %al
callq 0x4180
leaq 0x20(%rsp), %rdi
leaq 0x11ac3(%rip), %rsi     # 0x20106
xorl %edx, %edx
callq 0x157f0
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, 0xd(%rsp)
je 0xe661
movb 0x4e(%rsp), %al
movb %al, 0xd(%rsp)
movb 0xd(%rsp), %al
andb $0x1, %al
movb %al, 0x4e(%rsp)
movb 0x4e(%rsp), %cl
leaq 0x11d67(%rip), %rdi     # 0x203dd
leaq 0x11d10(%rip), %rax     # 0x2038d
testb $0x1, %cl
cmovneq %rax, %rdi
movb 0x4e(%rsp), %cl
leaq 0xea40(%rip), %rsi      # 0x1d0cf
leaq 0xea20(%rip), %rax      # 0x1d0b6
testb $0x1, %cl
cmovneq %rax, %rsi
movb $0x0, %al
callq 0x4180
callq 0xf580
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0xc(%rsp)
jne 0xe6b8
jmp 0xe6c0
movb 0x4e(%rsp), %al
movb %al, 0xc(%rsp)
movb 0xc(%rsp), %al
andb $0x1, %al
movb %al, 0x4e(%rsp)
movb 0x4e(%rsp), %al
xorl %esi, %esi
andb $0x1, %al
movzbl %al, %edi
callq 0x4da0
andb $0x1, %al
addq $0x158, %rsp            # imm = 0x158
retq
nopw %cs:(%rax,%rax)