LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: rstrip
static
size_t rstrip(STRING** self)
{
    size_t  n   = 0;

    char*   p   = NULL;

    if ((*self)->empty(*self)) {
        status = ESTRISEMPTY;
        return 0;
    }
    p = (*self)->c_str(*self) + (*self)->size(*self) - 1;
    while ((*self)->size(*self) > 0 &&
            (*p == '\t' || *p == '\n' || *p == '\v' ||
             *p == '\f' || *p == '\r' || *p == ' ')) {
        *p = '\0';
        p--;
        (*self)->length--;
        n++;
    }

    return n;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq *0xa0(%rdi)
testl %eax, %eax
je 0x84d7
leaq 0x8dab(%rip), %rax      # 0x11270
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
movq (%rbx), %rdi
callq *0xc8(%rdi)
movq %rax, %r14
movq (%rbx), %rdi
callq *0x18(%rdi)
movq %rax, %r15
movq (%rbx), %rdi
callq *0x18(%rdi)
testq %rax, %rax
je 0x84cb
addq %r14, %r15
decq %r15
xorl %r14d, %r14d
movzbl (%r15), %eax
leal -0x9(%rax), %ecx
cmpl $0x5, %ecx
jae 0x8527
movb $0x0, (%r15)
movq (%rbx), %rdi
decq 0x8(%rdi)
incq %r14
callq *0x18(%rdi)
decq %r15
testq %rax, %rax
jne 0x8500
jmp 0x84ce
cmpl $0x20, %eax
je 0x850c
jmp 0x84ce
// File: /workspace/github_c_makefile_star2_O1/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: rjust
static
int rjust(STRING** self, size_t s, char c)
{
    if ((*self)->empty(*self)) {
        status = ESTRISEMPTY; goto ERR;
    }
    if ((*self)->size(*self) >= s)
        return 0;

    if (c == '\0')
        c = ' ';
    if (reallocate_memory(self, s + 1) < 0) {
        status = EMEMORYALLOC; goto ERR;
    } else {
        memmove((*self)->c_str(*self) + s - (*self)->size(*self),
                (*self)->c_str(*self),
                (*self)->size(*self));
        memset((*self)->c_str(*self), c, s - (*self)->size(*self));
        *((*self)->c_str(*self) + s) = '\0';
        (*self)->length = s;
    }

    return 0;

ERR:
    return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %rdi
callq *0xa0(%rdi)
movl $0xfffffffc, %ebx       # imm = 0xFFFFFFFC
testl %eax, %eax
je 0x8561
leaq 0x8d16(%rip), %rax      # 0x11270
movl %ebx, (%rax)
jmp 0x8602
movq (%r15), %rdi
callq *0x18(%rdi)
xorl %ebx, %ebx
cmpq %r14, %rax
jae 0x8602
leaq 0x1(%r14), %rsi
movq %r15, %rdi
callq 0x9d01
testl %eax, %eax
js 0x8613
testb %bpl, %bpl
movzbl %bpl, %eax
movl $0x20, %ebp
cmovnel %eax, %ebp
movq (%r15), %rdi
callq *0xc8(%rdi)
leaq (%rax,%r14), %r12
movq (%r15), %rdi
callq *0x18(%rdi)
subq %rax, %r12
movq (%r15), %rdi
callq *0xc8(%rdi)
movq %rax, %r13
movq (%r15), %rdi
callq *0x18(%rdi)
movq %r12, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x2340
movq (%r15), %rdi
callq *0xc8(%rdi)
movq %rax, %r12
movq (%r15), %rdi
callq *0x18(%rdi)
movq %r14, %rdx
subq %rax, %rdx
movq %r12, %rdi
movl %ebp, %esi
callq 0x2050
movq (%r15), %rdi
callq *0xc8(%rdi)
movb $0x0, (%rax,%r14)
movq (%r15), %rax
movq %r14, 0x8(%rax)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xfffffffd, %ebx       # imm = 0xFFFFFFFD
jmp 0x8553
// File: /workspace/github_c_makefile_star2_O1/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: ljust
static
int ljust(STRING** self, size_t s, char c)
{
    if ((*self)->empty(*self)) {
        status = ESTRISEMPTY; goto ERR;
    }
    if ((*self)->size(*self) >= s)
        return 0;

    if (c == '\0')
        c = ' ';
    if (reallocate_memory(self, s + 1) < 0) {
        status = EMEMORYALLOC; goto ERR;
    } else {
        memset((*self)->c_str(*self) + (*self)->size(*self),
                c,
                s - (*self)->size(*self));
        *((*self)->c_str(*self) + s) = '\0';
        (*self)->length = s;
    }

    return 0;

ERR:
    return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %rdi
callq *0xa0(%rdi)
movl $0xfffffffc, %ebx       # imm = 0xFFFFFFFC
testl %eax, %eax
je 0x864a
leaq 0x8c2a(%rip), %rax      # 0x11270
movl %ebx, (%rax)
jmp 0x86b6
movq (%r15), %rdi
callq *0x18(%rdi)
xorl %ebx, %ebx
cmpq %r14, %rax
jae 0x86b6
leaq 0x1(%r14), %rsi
movq %r15, %rdi
callq 0x9d01
testl %eax, %eax
js 0x86c1
testb %bpl, %bpl
movzbl %bpl, %eax
movl $0x20, %ebp
cmovnel %eax, %ebp
movq (%r15), %rdi
callq *0xc8(%rdi)
movq %rax, %r12
movq (%r15), %rdi
callq *0x18(%rdi)
addq %rax, %r12
movq (%r15), %rdi
callq *0x18(%rdi)
movq %r14, %rdx
subq %rax, %rdx
movq %r12, %rdi
movl %ebp, %esi
callq 0x2050
movq (%r15), %rdi
callq *0xc8(%rdi)
movb $0x0, (%rax,%r14)
movq (%r15), %rax
movq %r14, 0x8(%rax)
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0xfffffffd, %ebx       # imm = 0xFFFFFFFD
jmp 0x863f
// File: /workspace/github_c_makefile_star2_O1/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: center
static
int center(STRING** self, size_t s, char c)
{
    size_t  s2  = 0;

    if ((*self)->empty(*self)) {
        status = ESTRISEMPTY; goto ERR;
    }
    if ((*self)->size(*self) >= s)
        return 0;

    if (c == '\0')
        c = ' ';
    s2 = (s - (*self)->size(*self)) >> 1;
    if (reallocate_memory(self, s + 1) < 0) {
        status = EMEMORYALLOC; goto ERR;
    } else {
        memmove((*self)->c_str(*self) + s2,
                (*self)->c_str(*self),
                (*self)->size(*self));
        memset((*self)->c_str(*self), c, s2);
        memset((*self)->c_str(*self) + (*self)->size(*self) + s2,
                c,
                s2 + (s - (*self)->size(*self)) % 2);
        *((*self)->c_str(*self) + s) = '\0';
        (*self)->length = s;
    }

    return 0;

ERR:
    return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %rdi
callq *0xa0(%rdi)
movl $0xfffffffc, %ebx       # imm = 0xFFFFFFFC
testl %eax, %eax
je 0x86fe
leaq 0x8b79(%rip), %rax      # 0x11270
movl %ebx, (%rax)
jmp 0x87d7
movq (%r15), %rdi
callq *0x18(%rdi)
xorl %ebx, %ebx
cmpq %r14, %rax
jae 0x87d7
movq (%r15), %rdi
callq *0x18(%rdi)
movq %rax, %r13
leaq 0x1(%r14), %rsi
movq %r15, %rdi
callq 0x9d01
testl %eax, %eax
js 0x87e8
movq %r14, %r12
subq %r13, %r12
shrq %r12
testb %bpl, %bpl
movzbl %bpl, %eax
movl $0x20, %ecx
cmovnel %eax, %ecx
movl %ecx, 0x4(%rsp)
movq (%r15), %rdi
callq *0xc8(%rdi)
leaq (%rax,%r12), %r13
movq (%r15), %rdi
callq *0xc8(%rdi)
movq %rax, %rbp
movq (%r15), %rdi
callq *0x18(%rdi)
movq %r13, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x2340
movq (%r15), %rdi
callq *0xc8(%rdi)
movq %rax, %rdi
movl 0x4(%rsp), %ebp
movl %ebp, %esi
movq %r12, %rdx
callq 0x2050
movq (%r15), %rdi
callq *0xc8(%rdi)
movq %rax, %r13
movq (%r15), %rdi
callq *0x18(%rdi)
addq %rax, %r13
addq %r12, %r13
movq (%r15), %rdi
callq *0x18(%rdi)
movl %r14d, %edx
subl %eax, %edx
andl $0x1, %edx
addq %r12, %rdx
movq %r13, %rdi
movl %ebp, %esi
callq 0x2050
movq (%r15), %rdi
callq *0xc8(%rdi)
movb $0x0, (%rax,%r14)
movq (%r15), %rax
movq %r14, 0x8(%rax)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xfffffffd, %ebx       # imm = 0xFFFFFFFD
jmp 0x86f0
// File: /workspace/github_c_makefile_star2_O1/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: mbrjust
static
int mbrjust(STRING** self, size_t s, char c)
{
    size_t  s2  = 0;

    if ((*self)->empty(*self)) {
        status = ESTRISEMPTY; goto ERR;
    }
    if (count_mb_witdh(*self, &s2) < 0)
        return (status = EINVALIDCHAR);
    if (s <= s2)
        return 0;
    else
        s2 = s - s2;

    if (reallocate_memory(self, s + s2 + 1) < 0) {
        status = EMEMORYALLOC; goto ERR;
    } else {
        memmove((*self)->c_str(*self) + s2,
                (*self)->c_str(*self),
                (*self)->size(*self));
        memset((*self)->c_str(*self), c, s2);
        (*self)->length += s2;
        *((*self)->c_str(*self) + (*self)->size(*self)) = '\0';
    }

    return 0;

ERR:
    return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r12
movq %rdi, %r14
movq $0x0, (%rsp)
movq (%rdi), %rdi
callq *0xa0(%rdi)
movl $0xfffffffc, %ebx       # imm = 0xFFFFFFFC
testl %eax, %eax
je 0x8839
leaq 0x8a4a(%rip), %rax      # 0x11270
movl %ebx, (%rax)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r14), %rdi
movq %rsp, %rsi
callq 0x9dec
testl %eax, %eax
js 0x88d3
xorl %ebx, %ebx
movq %r12, %r15
subq (%rsp), %r15
jbe 0x8828
movq %r15, (%rsp)
leaq (%r12,%r15), %rsi
incq %rsi
movq %r14, %rdi
callq 0x9d01
testl %eax, %eax
js 0x88ea
movq (%r14), %rdi
callq *0xc8(%rdi)
leaq (%rax,%r15), %r12
movq (%r14), %rdi
callq *0xc8(%rdi)
movq %rax, %r13
movq (%r14), %rdi
callq *0x18(%rdi)
movq %r12, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x2340
movq (%r14), %rdi
callq *0xc8(%rdi)
movzbl %bpl, %esi
movq %rax, %rdi
movq %r15, %rdx
callq 0x2050
movq (%r14), %rdi
addq %r15, 0x8(%rdi)
callq *0xc8(%rdi)
movq %rax, %r15
movq (%r14), %rdi
callq *0x18(%rdi)
movb $0x0, (%r15,%rax)
jmp 0x8828
leaq 0x8996(%rip), %rax      # 0x11270
movl $0xfffffffe, (%rax)     # imm = 0xFFFFFFFE
movl $0xfffffffe, %ebx       # imm = 0xFFFFFFFE
jmp 0x8828
movl $0xfffffffd, %ebx       # imm = 0xFFFFFFFD
jmp 0x881f
// File: /workspace/github_c_makefile_star2_O1/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: mbljust
static
int mbljust(STRING** self, size_t s, char c)
{
    size_t  s2  = 0;

    if ((*self)->empty(*self)) {
        status = ESTRISEMPTY; goto ERR;
    }
    if (count_mb_witdh(*self, &s2) < 0)
        return (status = EINVALIDCHAR);
    if (s <= s2)
        return 0;
    else
        s2 = s - s2;

    if (c == '\0')
        c = ' ';
    if (reallocate_memory(self, s + s2 + 1) < 0) {
        status = EMEMORYALLOC; goto ERR;
    } else {
        memset((*self)->c_str(*self) + (*self)->size(*self),
                c,
                s2);
        (*self)->length += s2;
        *((*self)->c_str(*self) + (*self)->size(*self)) = '\0';
    }

    return 0;

ERR:
    return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebp
movq %rsi, %r12
movq %rdi, %r14
movq $0x0, 0x8(%rsp)
movq (%rdi), %rdi
callq *0xa0(%rdi)
movl $0xfffffffc, %ebx       # imm = 0xFFFFFFFC
testl %eax, %eax
je 0x893b
leaq 0x8946(%rip), %rax      # 0x11270
movl %ebx, (%rax)
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq (%r14), %rdi
leaq 0x8(%rsp), %rsi
callq 0x9dec
testl %eax, %eax
js 0x89c1
xorl %ebx, %ebx
movq %r12, %r15
subq 0x8(%rsp), %r15
jbe 0x892c
movq %r15, 0x8(%rsp)
leaq (%r12,%r15), %rsi
incq %rsi
movq %r14, %rdi
callq 0x9d01
testl %eax, %eax
js 0x89d8
testb %bpl, %bpl
movzbl %bpl, %eax
movl $0x20, %ebp
cmovnel %eax, %ebp
movq (%r14), %rdi
callq *0xc8(%rdi)
movq %rax, %r12
movq (%r14), %rdi
callq *0x18(%rdi)
addq %rax, %r12
movq %r12, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x2050
movq (%r14), %rdi
addq %r15, 0x8(%rdi)
callq *0xc8(%rdi)
movq %rax, %r15
movq (%r14), %rdi
callq *0x18(%rdi)
movb $0x0, (%r15,%rax)
jmp 0x892c
leaq 0x88a8(%rip), %rax      # 0x11270
movl $0xfffffffe, (%rax)     # imm = 0xFFFFFFFE
movl $0xfffffffe, %ebx       # imm = 0xFFFFFFFE
jmp 0x892c
movl $0xfffffffd, %ebx       # imm = 0xFFFFFFFD
jmp 0x8923
// File: /workspace/github_c_makefile_star2_O1/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: mbcenter
static
int mbcenter(STRING** self, size_t s, char c)
{
    size_t  ps  = 0,
            s2  = 0;

    if ((*self)->empty(*self)) {
        status = ESTRISEMPTY; goto ERR;
    }
    if (count_mb_witdh(*self, &s2) < 0)
        return (status = EINVALIDCHAR);
    if (s <= s2)
        return 0;

    ps = s2;
    s2 = (s - s2) >> 1;
    if (c == '\0')
        c = ' ';
    if (reallocate_memory(self, s + (s - s2) + 1) < 0) {
        status = EMEMORYALLOC; goto ERR;
    } else {
        memmove((*self)->c_str(*self) + s2,
                (*self)->c_str(*self),
                (*self)->size(*self));
        memset((*self)->c_str(*self), c, s2);
        memset((*self)->c_str(*self) + (*self)->size(*self) + s2,
                c,
                s2 + (s - ps) % 2);
        (*self)->length = strlen((*self)->c_str(*self));
        *((*self)->c_str(*self) + (*self)->size(*self)) = '\0';
    }

    return 0;

ERR:
    return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
movq %rsi, %r13
movq %rdi, %r14
movq $0x0, 0x8(%rsp)
movq (%rdi), %rdi
callq *0xa0(%rdi)
movl $0xfffffffc, %ebx       # imm = 0xFFFFFFFC
testl %eax, %eax
je 0x8a2d
leaq 0x8856(%rip), %rax      # 0x11270
movl %ebx, (%rax)
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r14), %rdi
leaq 0x8(%rsp), %rsi
callq 0x9dec
testl %eax, %eax
js 0x8b29
xorl %ebx, %ebx
movq %r13, %r15
subq 0x8(%rsp), %r15
jbe 0x8a1c
movq %r15, %r12
shrq %r12
movq %r12, 0x8(%rsp)
leaq 0x1(,%r13,2), %rsi
subq %r12, %rsi
movq %r14, %rdi
callq 0x9d01
testl %eax, %eax
js 0x8b40
testb %bpl, %bpl
movzbl %bpl, %eax
movl $0x20, %ebp
cmovnel %eax, %ebp
movq (%r14), %rdi
callq *0xc8(%rdi)
addq %r12, %rax
movq %rax, 0x10(%rsp)
movq (%r14), %rdi
callq *0xc8(%rdi)
movq %rax, %r13
movq (%r14), %rdi
callq *0x18(%rdi)
movq 0x10(%rsp), %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x2340
movq (%r14), %rdi
callq *0xc8(%rdi)
movq %rax, %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0x2050
movq (%r14), %rdi
callq *0xc8(%rdi)
movq %rax, %r13
movq (%r14), %rdi
callq *0x18(%rdi)
addq %rax, %r13
addq %r12, %r13
andl $0x1, %r15d
addq %r12, %r15
movq %r13, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x2050
movq (%r14), %rdi
callq *0xc8(%rdi)
movq %rax, %rdi
callq 0x21b0
movq (%r14), %rdi
movq %rax, 0x8(%rdi)
callq *0xc8(%rdi)
movq %rax, %r15
movq (%r14), %rdi
callq *0x18(%rdi)
movb $0x0, (%r15,%rax)
jmp 0x8a1c
leaq 0x8740(%rip), %rax      # 0x11270
movl $0xfffffffe, (%rax)     # imm = 0xFFFFFFFE
movl $0xfffffffe, %ebx       # imm = 0xFFFFFFFE
jmp 0x8a1c
movl $0xfffffffd, %ebx       # imm = 0xFFFFFFFD
jmp 0x8a13
// File: /workspace/github_c_makefile_star2_O1/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: downcase
static
int downcase(STRING** self)
{
    char*   p   = NULL;

    if ((*self)->empty(*self))
        return (status = ESTRISEMPTY);

    p = (*self)->c_str(*self);
    while (*p != '\0') {
        if (isupper(*p))
            *p = tolower(*p);
        p++;
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq *0xa0(%rdi)
testl %eax, %eax
je 0x8b76
leaq 0x8707(%rip), %rax      # 0x11270
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
movl $0xfffffffc, %ebx       # imm = 0xFFFFFFFC
jmp 0x8bc1
movq (%rbx), %rdi
callq *0xc8(%rdi)
movb (%rax), %bpl
xorl %ebx, %ebx
testb %bpl, %bpl
je 0x8bc1
movq %rax, %r14
callq 0x21e0
movq %rax, %r15
incq %r14
movq (%r15), %rax
movsbq %bpl, %r12
testb $0x1, 0x1(%rax,%r12,2)
je 0x8bb6
callq 0x23c0
movq (%rax), %rax
movb (%rax,%r12,4), %al
movb %al, -0x1(%r14)
movb (%r14), %bpl
incq %r14
testb %bpl, %bpl
jne 0x8b97
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: swapcase
static
int swapcase(STRING** self)
{
    char*   p   = NULL;

    if ((*self)->empty(*self))
        return (status = ESTRISEMPTY);

    p = (*self)->c_str(*self);
    while (*p != '\0') {
        if (isupper(*p))
            *p = tolower(*p);
        else if (islower(*p))
            *p = toupper(*p);
        p++;
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq *0xa0(%rdi)
testl %eax, %eax
je 0x8bf8
leaq 0x8685(%rip), %rax      # 0x11270
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
movl $0xfffffffc, %ebx       # imm = 0xFFFFFFFC
jmp 0x8c53
movq (%rbx), %rdi
callq *0xc8(%rdi)
movb (%rax), %bpl
xorl %ebx, %ebx
testb %bpl, %bpl
je 0x8c53
movq %rax, %r14
callq 0x21e0
movq %rax, %r15
incq %r14
movq (%r15), %rax
movsbq %bpl, %r12
movzwl (%rax,%r12,2), %eax
btl $0x8, %eax
jb 0x8c38
btl $0x9, %eax
jae 0x8c48
callq 0x2170
jmp 0x8c3d
callq 0x23c0
movq (%rax), %rax
movb (%rax,%r12,4), %al
movb %al, -0x1(%r14)
movb (%r14), %bpl
incq %r14
testb %bpl, %bpl
jne 0x8c19
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: upcase
static
int upcase(STRING** self)
{
    char*   p   = NULL;

    if ((*self)->empty(*self))
        return (status = ESTRISEMPTY);

    p = (*self)->c_str(*self);
    while (*p != '\0') {
        if (islower(*p))
            *p = toupper(*p);
        p++;
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq *0xa0(%rdi)
testl %eax, %eax
je 0x8c8a
leaq 0x85f3(%rip), %rax      # 0x11270
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
movl $0xfffffffc, %ebx       # imm = 0xFFFFFFFC
jmp 0x8cd5
movq (%rbx), %rdi
callq *0xc8(%rdi)
movb (%rax), %bpl
xorl %ebx, %ebx
testb %bpl, %bpl
je 0x8cd5
movq %rax, %r14
callq 0x21e0
movq %rax, %r15
incq %r14
movq (%r15), %rax
movsbq %bpl, %r12
testb $0x2, 0x1(%rax,%r12,2)
je 0x8cca
callq 0x2170
movq (%rax), %rax
movb (%rax,%r12,4), %al
movb %al, -0x1(%r14)
movb (%r14), %bpl
incq %r14
testb %bpl, %bpl
jne 0x8cab
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: capitalize
static
int capitalize(STRING** self)
{
    char*   p               = NULL;

    int     (*f1)(int c)    = isascii,
            (*f2)(int c)    = toupper;

    if ((*self)->empty(*self))
        return (status = ESTRISEMPTY);

    p = (*self)->c_str(*self);
    while (*p != '\0') {
        if (f1(*p)) {
            *p = f2(*p);
            f1 = isascii;
            f2 = tolower;
        }
        p++;
    }

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq *0xa0(%rdi)
testl %eax, %eax
je 0x8d09
leaq 0x8574(%rip), %rax      # 0x11270
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
movl $0xfffffffc, %ebx       # imm = 0xFFFFFFFC
jmp 0x8d48
movq (%rbx), %rdi
callq *0xc8(%rdi)
movb (%rax), %cl
xorl %ebx, %ebx
testb %cl, %cl
je 0x8d48
movq %rax, %r14
incq %r14
movq 0x8271(%rip), %rax      # 0x10f98
movq 0x82a2(%rip), %r15      # 0x10fd0
testb %cl, %cl
js 0x8d3e
movzbl %cl, %edi
callq *%rax
movb %al, -0x1(%r14)
movq %r15, %rax
movb (%r14), %cl
incq %r14
testb %cl, %cl
jne 0x8d2e
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: include
static
int include(STRING* self, char* const str)
{
    size_t  pos     = 0,
            len     = 0;

    char*   p       = NULL;

    if (self->empty(self))
        return (status = ESTRISEMPTY);
    if (self->size(self) < (len = strlen(str)) ||
            !len)
        return (status = EOUTOFRANGE);

    p = self->c_str(self);
    while (*p != '\0' &&
            pos <= (self->size(self) - len)) {
        if (memcmp(p, str, len) == 0)
            return 1;
        pos++;
        p++;
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq *0xa0(%rdi)
movl $0xfffffffc, %r15d      # imm = 0xFFFFFFFC
testl %eax, %eax
jne 0x8ddd
movq %r14, %rdi
callq *0x18(%r14)
movq %rax, %r13
movq %rbx, %rdi
callq 0x21b0
movq %rax, %r12
decq %rax
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
cmpq %r13, %rax
jae 0x8ddd
movq %r14, %rdi
callq *0xc8(%r14)
cmpb $0x0, (%rax)
je 0x8df9
movq %rax, %r13
xorl %r15d, %r15d
xorl %ebp, %ebp
movq %r14, %rdi
callq *0x18(%r14)
subq %r12, %rax
cmpq %rax, %rbp
ja 0x8de7
movq %r13, %rdi
addq %rbp, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x22c0
testl %eax, %eax
je 0x8dfe
cmpb $0x0, 0x1(%r13,%rbp)
leaq 0x1(%rbp), %rbp
jne 0x8dab
jmp 0x8de7
leaq 0x848c(%rip), %rax      # 0x11270
movl %r15d, (%rax)
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r15d, %r15d
jmp 0x8de7
movl $0x1, %r15d
jmp 0x8de7
// File: /workspace/github_c_makefile_star2_O1/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: ts_index
static
int ts_index(STRING* self, char* const str, size_t pos, size_t* idx)
{
    size_t  len     = 0;

    char*   p       = NULL;

    if (self->empty(self))
        return (status = ESTRISEMPTY);
    if (str == NULL || idx == NULL)
        return (status = EARGISNULPTR);
    if (!is_in_range(self, pos) ||
            !is_in_range(self, pos + (len = strlen(str))))
        return (status = EOUTOFRANGE);

    p = self->c_str(self) + (*idx = pos);
    while (*p != '\0' &&
            *idx <= (self->size(self) - len)) {
        if (memcmp(p, str, len) == 0)
            return 0;
        (*idx)++;
        p++;
    }
    /* not found */
    *idx = 0;

    return (status = ESTRNOTFOUND);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r15
callq *0xa0(%rdi)
movl $0xfffffffc, %ebp       # imm = 0xFFFFFFFC
testl %eax, %eax
jne 0x8ed0
testq %r14, %r14
sete %al
testq %rbx, %rbx
sete %cl
orb %al, %cl
movl $0xfffffffb, %ebp       # imm = 0xFFFFFFFB
jne 0x8ed0
movq %r15, %rdi
callq *0x18(%r15)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpq %r12, %rax
jb 0x8ed0
movq %r14, %rdi
callq 0x21b0
movq %rax, %r13
addq %r12, %rax
movq %rax, (%rsp)
movq %r15, %rdi
callq *0x18(%r15)
cmpq (%rsp), %rax
jb 0x8ed0
movq %r15, %rdi
callq *0xc8(%r15)
movq %r12, (%rbx)
cmpb $0x0, (%rax,%r12)
je 0x8ec4
movq %rax, %rbp
addq %r12, %rbp
movq (%rbx), %r12
movq %r15, %rdi
callq *0x18(%r15)
subq %r13, %rax
cmpq %rax, %r12
ja 0x8ec4
movq %rbp, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x22c0
testl %eax, %eax
je 0x8eea
incq (%rbx)
cmpb $0x0, 0x1(%rbp)
leaq 0x1(%rbp), %rbp
jne 0x8e93
movq $0x0, (%rbx)
movl $0xfffffffa, %ebp       # imm = 0xFFFFFFFA
leaq 0x8399(%rip), %rax      # 0x11270
movl %ebp, (%rax)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
jmp 0x8ed9
// File: /workspace/github_c_makefile_star2_O1/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: ts_rindex
static
int ts_rindex(STRING* self, char* const str, size_t pos, size_t* idx)
{
    size_t  off     = 0,
            len     = 0;

    char*   p       = NULL;

    if (self->empty(self))
        return (status = ESTRISEMPTY);
    if (str == NULL || idx == NULL)
        return (status = EARGISNULPTR);
    if (!is_in_range(self, pos))
        return (status = EOUTOFRANGE);

    len = strlen(str);
    *idx = self->size(self) - pos - 1;
    p = self->c_str(self) + *idx;
    while (off < self->size(self)) {
        if (memcmp(p, str, len) == 0)
            return 0;
        off++;
        p--;
        (*idx)--;
    }
    /* not found */
    (*idx) = 0;

    return (status = ESTRNOTFOUND);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %rbp
movq %rsi, %r14
movq %rdi, %r15
callq *0xa0(%rdi)
movl $0xfffffffc, %r13d      # imm = 0xFFFFFFFC
testl %eax, %eax
jne 0x8fbb
testq %r14, %r14
sete %al
testq %rbx, %rbx
sete %cl
orb %al, %cl
movl $0xfffffffb, %r13d      # imm = 0xFFFFFFFB
jne 0x8fbb
movq %r15, %rdi
callq *0x18(%r15)
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
cmpq %rbp, %rax
jb 0x8fbb
movq %r14, %rdi
callq 0x21b0
movq %rax, (%rsp)
movq %r15, %rdi
callq *0x18(%r15)
notq %rbp
addq %rax, %rbp
movq %rbp, (%rbx)
movq %r15, %rdi
callq *0xc8(%r15)
movq %rax, %rbp
movq (%rbx), %r12
movq %r15, %rdi
callq *0x18(%r15)
testq %rax, %rax
je 0x8fae
addq %r12, %rbp
xorl %r13d, %r13d
xorl %r12d, %r12d
movq %rbp, %rdi
movq %r14, %rsi
movq (%rsp), %rdx
callq 0x22c0
testl %eax, %eax
je 0x8fc5
incq %r12
decq %rbp
decq (%rbx)
movq %r15, %rdi
callq *0x18(%r15)
cmpq %rax, %r12
jb 0x8f86
movq $0x0, (%rbx)
movl $0xfffffffa, %r13d      # imm = 0xFFFFFFFA
leaq 0x82ae(%rip), %rax      # 0x11270
movl %r13d, (%rax)
movl %r13d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: mbindex
static
int mbindex(STRING* self, char* const str, size_t pos, size_t* idx)
{
    int     ch      = 0;

    size_t  len     = 0;

    char*   p       = NULL;

    if (self->empty(self))
        return (status = ESTRISEMPTY);
    if (str == NULL || idx == NULL)
        return (status = EARGISNULPTR);
    if (!mb_is_in_range(self, pos))
        return (status = EOUTOFRANGE);

    len = strlen(str);
    p = self->c_str(self);
    setlocale(LC_CTYPE, T_STRING_LOCALE_VALUE);
    while (*p != '\0') {
        if ((ch = mblen(p, MB_CUR_MAX)) < 0) {
#ifdef  LIBRARY_VERBOSE
            print_error();
/* LIBRARY_VERBOSE */
#endif
            return (status = EINVALIDCHAR);
        }
        if (pos)
            pos--;
        else if (memcmp(p, str, len) == 0)
            return 0;
        p += ch;
        (*idx)++;
    }
    /* not found */
    *idx = 0;

    return (status = ESTRNOTFOUND);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %r13
callq *0xa0(%rdi)
movl $0xfffffffc, %ecx       # imm = 0xFFFFFFFC
testl %eax, %eax
jne 0x90b6
testq %r14, %r14
sete %al
testq %rbx, %rbx
sete %cl
orb %al, %cl
movl $0xfffffffb, %ecx       # imm = 0xFFFFFFFB
jne 0x90b6
movq %r13, %rdi
callq *0x20(%r13)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %r15, %rax
jb 0x90b6
movq %r14, %rdi
callq 0x21b0
movq %rax, %r12
movq %r13, %rdi
callq *0xc8(%r13)
movq %rax, %r13
leaq 0x3372(%rip), %rsi      # 0xc3c0
xorl %edi, %edi
callq 0x2420
cmpb $0x0, (%r13)
je 0x90a3
callq 0x21d0
movq %r13, %rdi
movq %rax, %rsi
callq 0x2310
testl %eax, %eax
js 0x90b1
movl %eax, %ebp
testq %r15, %r15
je 0x907c
decq %r15
jmp 0x9091
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x22c0
xorl %r15d, %r15d
testl %eax, %eax
je 0x90c2
movl %ebp, %eax
incq (%rbx)
cmpb $0x0, (%r13,%rax)
leaq (%r13,%rax), %r13
jne 0x905c
movq $0x0, (%rbx)
movl $0xfffffffa, %ecx       # imm = 0xFFFFFFFA
jmp 0x90b6
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
leaq 0x81b3(%rip), %rax      # 0x11270
movl %ecx, (%rax)
movl %ecx, %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: mbrindex
static
int mbrindex(STRING* self, char* const str, size_t pos, size_t* idx)
{
    int     ch      = 0;

    size_t  off     = 0,
            len     = 0;

    char*   p       = NULL;

    if (self->empty(self))
        return (status = ESTRISEMPTY);
    if (str == NULL || idx == NULL)
        return (status = EARGISNULPTR);
    if (!mb_is_in_range(self, pos))
        return (status = EOUTOFRANGE);

    len = strlen(str);
    *idx = self->mblen(self) - 1;
    p = self->c_str(self) + self->size(self) - 1;
    setlocale(LC_CTYPE, T_STRING_LOCALE_VALUE);
    while (off < self->size(self)) {
        while (mblen(p, MB_CUR_MAX) < 0 && p--)
            off++;
        if ((ch = mblen(p, MB_CUR_MAX)) < 0) {
#ifdef  LIBRARY_VERBOSE
            print_error();
/* LIBRARY_VERBOSE */
#endif
            return (status = EINVALIDCHAR);
        }
        if (pos)
            pos--;
        else if (memcmp(p, str, len) == 0)
            return 0;
        off++;
        p--;
        (*idx)--;
    }
    /* not found */
    *idx = 0;

    return (status = ESTRNOTFOUND);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r15
callq *0xa0(%rdi)
movl $0xfffffffc, %ecx       # imm = 0xFFFFFFFC
testl %eax, %eax
jne 0x91ec
testq %r14, %r14
sete %al
testq %rbx, %rbx
sete %cl
orb %al, %cl
movl $0xfffffffb, %ecx       # imm = 0xFFFFFFFB
jne 0x91ec
movq %r15, %rdi
callq *0x20(%r15)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %r12, %rax
jb 0x91ec
movq %r14, %rdi
callq 0x21b0
movq %rax, (%rsp)
movq %r15, %rdi
callq *0x20(%r15)
decq %rax
movq %rax, (%rbx)
movq %r15, %rdi
callq *0xc8(%r15)
movq %rax, %rbp
movq %r15, %rdi
callq *0x18(%r15)
movq %rax, %r13
leaq 0x325d(%rip), %rsi      # 0xc3c0
xorl %edi, %edi
callq 0x2420
movq %r15, %rdi
callq *0x18(%r15)
testq %rax, %rax
je 0x91d9
addq %r13, %rbp
xorl %r13d, %r13d
decq %rbp
callq 0x21d0
movq %rbp, %rdi
movq %rax, %rsi
callq 0x2310
incq %r13
testl %eax, %eax
js 0x917c
callq 0x21d0
movq %rbp, %rdi
movq %rax, %rsi
callq 0x2310
testl %eax, %eax
js 0x91e7
testq %r12, %r12
je 0x91b4
decq %r12
jmp 0x91ca
movq %rbp, %rdi
movq %r14, %rsi
movq (%rsp), %rdx
callq 0x22c0
xorl %r12d, %r12d
testl %eax, %eax
je 0x91f8
decq (%rbx)
movq %r15, %rdi
callq *0x18(%r15)
cmpq %rax, %r13
jb 0x917c
movq $0x0, (%rbx)
movl $0xfffffffa, %ecx       # imm = 0xFFFFFFFA
jmp 0x91ec
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
leaq 0x807d(%rip), %rax      # 0x11270
movl %ecx, (%rax)
movl %ecx, %r12d
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: slice
static
int slice(STRING** self, char* const str)
{
    size_t  pos     = 0,
            len     = 0;

    char*   p       = NULL;

    if ((*self)->empty(*self))
        return (status = ESTRISEMPTY);
    if ((*self)->size(*self) < (len = strlen(str)) ||
            !len)
        return (status = EOUTOFRANGE);

    p = (*self)->c_str(*self);
    while (*p != '\0' &&
            pos <= ((*self)->size(*self) - len)) {
        if (memcmp(p, str, len) == 0) {
            p = (*self)->c_str(*self);
            memmove(p + pos, p + pos + len, (*self)->size(*self) - len);
            memset(p + (*self)->size(*self) - len, '\0', len);
            (*self)->length -= len;
            break;
        }
        pos++;
        p++;
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdi), %rdi
callq *0xa0(%rdi)
testl %eax, %eax
je 0x9240
leaq 0x8041(%rip), %rax      # 0x11270
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
movl $0xfffffffc, %r12d      # imm = 0xFFFFFFFC
jmp 0x930f
movq (%rbx), %rdi
callq *0x18(%rdi)
movq %rax, %r12
movq %r15, %rdi
callq 0x21b0
movq %rax, %r14
decq %rax
cmpq %r12, %rax
jae 0x92a8
movq (%rbx), %rdi
callq *0xc8(%rdi)
cmpb $0x0, (%rax)
je 0x92bd
movq %rax, %rbp
xorl %r12d, %r12d
xorl %r13d, %r13d
movq (%rbx), %rdi
callq *0x18(%rdi)
subq %r14, %rax
cmpq %rax, %r13
ja 0x930f
movq %rbp, %rdi
addq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x22c0
testl %eax, %eax
je 0x92c2
cmpb $0x0, 0x1(%rbp,%r13)
leaq 0x1(%r13), %r13
jne 0x9273
jmp 0x930f
leaq 0x7fc1(%rip), %rax      # 0x11270
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
jmp 0x930f
xorl %r12d, %r12d
jmp 0x930f
movq (%rbx), %rdi
callq *0xc8(%rdi)
movq %rax, %r15
addq %rax, %r13
leaq (%r14,%r13), %r12
movq (%rbx), %rdi
callq *0x18(%rdi)
subq %r14, %rax
movq %r13, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x2340
movq (%rbx), %rdi
callq *0x18(%rdi)
addq %rax, %r15
subq %r14, %r15
xorl %r12d, %r12d
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x2050
movq (%rbx), %rax
subq %r14, 0x8(%rax)
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: delete_prefix
static
int delete_prefix(STRING** self, char* const str)
{
    size_t  len = 0;

    char*   p   = NULL;

    if ((*self)->empty(*self))
        return (status = ESTRISEMPTY);
    if ((*self)->size(*self) < (len = strlen(str)) ||
            !len)
        return 0;

    p = (*self)->c_str(*self);
    if (memcmp(p, str, len) == 0) {
        memmove(p, p + len, (*self)->size(*self) - len);
        memset(p + (*self)->size(*self) - len, '\0', len);
        (*self)->length -= len;
    } else {
        return 0;
    }

    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r12
movq %rdi, %rbx
movq (%rdi), %rdi
callq *0xa0(%rdi)
testl %eax, %eax
je 0x9350
leaq 0x7f2d(%rip), %rax      # 0x11270
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
movl $0xfffffffc, %ebp       # imm = 0xFFFFFFFC
jmp 0x93cc
movq (%rbx), %rdi
callq *0x18(%rdi)
movq %rax, %r15
movq %r12, %rdi
callq 0x21b0
movq %rax, %r14
decq %rax
xorl %ebp, %ebp
cmpq %r15, %rax
jae 0x93cc
movq (%rbx), %rdi
callq *0xc8(%rdi)
movq %rax, %r15
movq %rax, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x22c0
testl %eax, %eax
jne 0x93cc
leaq (%r15,%r14), %r12
movq (%rbx), %rdi
callq *0x18(%rdi)
subq %r14, %rax
movq %r15, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x2340
movq (%rbx), %rdi
callq *0x18(%rdi)
addq %rax, %r15
subq %r14, %r15
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x2050
movq (%rbx), %rax
subq %r14, 0x8(%rax)
movl $0x1, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: delete_suffix
static
int delete_suffix(STRING** self, char* const str)
{
    size_t  len = 0;

    char*   p   = NULL;

    if ((*self)->empty(*self))
        return (status = ESTRISEMPTY);
    if ((*self)->size(*self) < (len = strlen(str)) ||
            !len)
        return 0;

    p = (*self)->c_str(*self) + (*self)->size(*self) - len;
    if (memcmp(p, str, len) == 0) {
        memset(p, '\0', len);
        (*self)->length -= len;
    } else {
        return 0;
    }

    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rdi
callq *0xa0(%rdi)
testl %eax, %eax
je 0x9409
leaq 0x7e74(%rip), %rax      # 0x11270
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
movl $0xfffffffc, %ebp       # imm = 0xFFFFFFFC
jmp 0x946d
movq (%rbx), %rdi
callq *0x18(%rdi)
movq %rax, %r12
movq %r14, %rdi
callq 0x21b0
movq %rax, %r15
decq %rax
xorl %ebp, %ebp
cmpq %r12, %rax
jae 0x946d
movq (%rbx), %rdi
callq *0xc8(%rdi)
movq %rax, %r13
movq (%rbx), %rdi
callq *0x18(%rdi)
movq %rax, %r12
addq %r13, %r12
subq %r15, %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x22c0
testl %eax, %eax
jne 0x946d
movq %r12, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x2050
movq (%rbx), %rax
subq %r15, 0x8(%rax)
movl $0x1, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: to_i
static
int to_i(STRING* self, int base)
{
    if (self->empty(self))
        return (status = ESTRISEMPTY);

    if (base <= 0)
        base = 10;
    errno = 0;

    return (int)strtol(self->c_str(self), NULL, base);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
callq *0xa0(%rdi)
testl %eax, %eax
je 0x94a5
leaq 0x7dd8(%rip), %rax      # 0x11270
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
movl $0xfffffffc, %eax       # imm = 0xFFFFFFFC
jmp 0x94d2
testl %ebp, %ebp
movl $0xa, %r14d
cmovgl %ebp, %r14d
callq 0x2390
movl $0x0, (%rax)
movq %rbx, %rdi
callq *0xc8(%rbx)
movq %rax, %rdi
xorl %esi, %esi
movl %r14d, %edx
callq 0x22e0
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: to_l
static
long to_l(STRING* self, int base)
{
    if (self->empty(self))
        return (status = ESTRISEMPTY);

    if (base <= 0)
        base = 10;
    errno = 0;

    return strtol(self->c_str(self), NULL, base);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
callq *0xa0(%rdi)
testl %eax, %eax
je 0x9503
leaq 0x7d7f(%rip), %rax      # 0x11270
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
movq $-0x4, %rax
popq %rbx
popq %r14
popq %rbp
retq
testl %ebp, %ebp
movl $0xa, %r14d
cmovgl %ebp, %r14d
callq 0x2390
movl $0x0, (%rax)
movq %rbx, %rdi
callq *0xc8(%rbx)
movq %rax, %rdi
xorl %esi, %esi
movl %r14d, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0x22e0
// File: /workspace/github_c_makefile_star2_O1/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: reverse
static
int reverse(STRING** self)
{
    int     ch      = 0;

    size_t  pos     = 0;

    char*   p       = NULL,
        *   dest    = NULL;

    if ((*self)->empty(*self)) {
        status = ESTRISEMPTY; goto ERR;
    }
    if ((dest = (char*)
                malloc(sizeof(char) * (*self)->capacity(*self))) == NULL) {
#ifdef  LIBRARY_VERBOSE
        print_error();
/* LIBRARY_VERBOSE */
#endif
        status = EMEMORYALLOC; goto ERR;
    } else {
        memset(dest, '\0', (*self)->capacity(*self));
    }
    p = (*self)->c_str(*self);
    pos = (*self)->size(*self);
    setlocale(LC_CTYPE, T_STRING_LOCALE_VALUE);
    while (*p != '\0' && pos) {
        if ((ch = mblen(p, MB_CUR_MAX)) < 0) {
#ifdef  LIBRARY_VERBOSE
            print_error();
/* LIBRARY_VERBOSE */
#endif
            status = EINVALIDCHAR; goto ERR;
        } else {
            pos -= ch;
            memcpy(dest + pos, p, ch);
            p += ch;
        }
    }
    free((*self)->string);
    (*self)->string = dest;

    return 0;

ERR:
    if (dest != NULL) {
        free(dest);
        dest = NULL;
    }

    return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq (%rdi), %rdi
callq *0xa0(%rdi)
testl %eax, %eax
je 0x95bd
movl $0xfffffffc, %eax       # imm = 0xFFFFFFFC
xorl %ebx, %ebx
leaq 0x7cd7(%rip), %r14      # 0x11270
movl %eax, (%r14)
testq %rbx, %rbx
je 0x95a9
movq %rbx, %rdi
callq 0x21a0
movl (%r14), %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r14), %rdi
callq *0x28(%rdi)
movq %rax, %rdi
callq 0x20e0
testq %rax, %rax
je 0x9673
movq %rax, %rbx
movq (%r14), %rdi
callq *0x28(%rdi)
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x2050
movq (%r14), %rdi
callq *0xc8(%rdi)
movq %rax, %r15
movq (%r14), %rdi
callq *0x18(%rdi)
movq %rax, %r12
leaq 0x2db8(%rip), %rsi      # 0xc3c0
xorl %edi, %edi
callq 0x2420
cmpb $0x0, (%r15)
setne %al
testq %r12, %r12
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x965b
callq 0x21d0
movq %r15, %rdi
movq %rax, %rsi
callq 0x2310
testl %eax, %eax
js 0x967d
movl %eax, %r13d
subq %r13, %r12
leaq (%rbx,%r12), %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x2460
cmpb $0x0, (%r15,%r13)
je 0x965b
addq %r13, %r15
testq %r12, %r12
jne 0x9623
movq (%r14), %rax
movq 0x10(%rax), %rdi
callq 0x21a0
movq (%r14), %rax
movq %rbx, 0x10(%rax)
jmp 0x95ac
movl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
jmp 0x9590
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
jmp 0x9592
// File: /workspace/github_c_makefile_star2_O1/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: ascii_only
static
int ascii_only(STRING* self)
{
    char*   p   = NULL;

    if (self->empty(self))
        return (status = ESTRISEMPTY);

    p = self->c_str(self);
    while (*p != '\0') {
        if (!isascii(*p))
            return 0;
        p++;
    }

    return 1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq *0xa0(%rdi)
testl %eax, %eax
je 0x96a9
leaq 0x7bd4(%rip), %rax      # 0x11270
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
movl $0xfffffffc, %eax       # imm = 0xFFFFFFFC
popq %rbx
retq
movq %rbx, %rdi
callq *0xc8(%rbx)
movq %rax, %rcx
movb (%rax), %dl
movl $0x1, %eax
testb %dl, %dl
je 0x96a7
incq %rcx
testb %dl, %dl
js 0x96d2
movb (%rcx), %dl
incq %rcx
testb %dl, %dl
jne 0x96c3
jmp 0x96a7
xorl %eax, %eax
jmp 0x96a7
// File: /workspace/github_c_makefile_star2_O1/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: digit_only
static
int digit_only(STRING* self)
{
    char*   p   = NULL;

    if (self->empty(self))
        return (status = ESTRISEMPTY);

    p = self->c_str(self);
    while (*p != '\0') {
        if (!isdigit(*p))
            return 0;
        p++;
    }

    return 1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq *0xa0(%rdi)
testl %eax, %eax
je 0x9700
leaq 0x7b82(%rip), %rax      # 0x11270
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
movl $0xfffffffc, %ebx       # imm = 0xFFFFFFFC
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq %rbx, %rdi
callq *0xc8(%rbx)
movb (%rax), %bpl
movl $0x1, %ebx
testb %bpl, %bpl
je 0x96f9
movq %rax, %r14
callq 0x21e0
movq (%rax), %rax
incq %r14
movsbq %bpl, %rcx
testb $0x8, 0x1(%rax,%rcx,2)
je 0x973c
movb (%r14), %bpl
incq %r14
testb %bpl, %bpl
jne 0x9724
jmp 0x96f9
xorl %ebx, %ebx
jmp 0x96f9
// File: /workspace/github_c_makefile_star2_O1/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: each_line
static
int each_line(STRING* self, char* const delim, void (*fn)(STRING*))
{
    size_t      i   = 0,
                idx = 0;

    char*       dd  = "\n"; /* default delimiter */

    STRING**    s2  = NULL;

    if (fn == NULL)
        return (status = EARGISNULPTR);

    if (delim != NULL)
        dd = delim;

    status = 0;
    idx = self->split(self, dd, &s2);
    if (status < 0)
        return status;

    while (i < idx) {
        fn(s2[i]);
        free(s2[i]);
        i++;
    }
    free(s2);

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq $0x0, 0x8(%rsp)
testq %rdx, %rdx
je 0x97c5
movq %rdx, %rbx
testq %rsi, %rsi
leaq 0x2c5b(%rip), %rax      # 0xc3bf
cmovneq %rsi, %rax
leaq 0x7b01(%rip), %r15      # 0x11270
movl $0x0, (%r15)
leaq 0x8(%rsp), %rdx
movq %rax, %rsi
callq *0x100(%rdi)
movq %rax, %r14
movl (%r15), %eax
testl %eax, %eax
js 0x97d7
testq %r14, %r14
je 0x97b7
xorl %r15d, %r15d
movq 0x8(%rsp), %rax
movq (%rax,%r15,8), %rdi
callq *%rbx
movq 0x8(%rsp), %rax
movq (%rax,%r15,8), %rdi
callq 0x21a0
incq %r15
cmpq %r15, %r14
jne 0x9796
movq 0x8(%rsp), %rdi
callq 0x21a0
xorl %eax, %eax
jmp 0x97d7
leaq 0x7aa4(%rip), %rax      # 0x11270
movl $0xfffffffb, (%rax)     # imm = 0xFFFFFFFB
movl $0xfffffffb, %eax       # imm = 0xFFFFFFFB
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: each_byte
static
int each_byte(STRING* self, void (*fn)(char))
{
    char*   p   = NULL;

    if (self->empty(self))
        return (status = ESTRISEMPTY);
    if (fn == NULL)
        return (status = EARGISNULPTR);

    p = self->c_str(self);
    while (*p != '\0') {
        fn(*p);
        p++;
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq *0xa0(%rdi)
movl $0xfffffffc, %ebp       # imm = 0xFFFFFFFC
testl %eax, %eax
je 0x980a
leaq 0x7a6f(%rip), %rax      # 0x11270
movl %ebp, (%rax)
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
testq %rbx, %rbx
je 0x9838
movq %r14, %rdi
callq *0xc8(%r14)
movq %rax, %r14
movb (%rax), %al
xorl %ebp, %ebp
testb %al, %al
je 0x9803
incq %r14
movsbl %al, %edi
callq *%rbx
movb (%r14), %al
incq %r14
testb %al, %al
jne 0x9827
jmp 0x9803
movl $0xfffffffb, %ebp       # imm = 0xFFFFFFFB
jmp 0x97fa
// File: /workspace/github_c_makefile_star2_O1/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: each_char
static
int each_char(STRING* self, void (*fn)(char*))
{
    size_t  y   = 0,
            idx = 0;

    char**  arr = NULL;

    if (self->empty(self))
        return (status = ESTRISEMPTY);
    if (fn == NULL)
        return (status = EARGISNULPTR);

    if ((self)->to_char_arr(self, &arr) < 0)
        return status;

    idx = self->mblen(self);
    while (y < idx) {
        fn(arr[y]);
        free(arr[y]);
        y++;
    }
    free(arr);

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq $0x0, 0x8(%rsp)
callq *0xa0(%rdi)
testl %eax, %eax
je 0x987d
leaq 0x7a08(%rip), %rax      # 0x11270
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
movl $0xfffffffc, %eax       # imm = 0xFFFFFFFC
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
testq %rbx, %rbx
je 0x98d6
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq *0x110(%r14)
testl %eax, %eax
js 0x98ea
movq %r14, %rdi
callq *0x20(%r14)
testq %rax, %rax
je 0x98c8
movq %rax, %r14
xorl %r15d, %r15d
movq 0x8(%rsp), %rax
movq (%rax,%r15,8), %rdi
callq *%rbx
movq 0x8(%rsp), %rax
movq (%rax,%r15,8), %rdi
callq 0x21a0
incq %r15
cmpq %r15, %r14
jne 0x98a7
movq 0x8(%rsp), %rdi
callq 0x21a0
xorl %eax, %eax
jmp 0x9873
leaq 0x7993(%rip), %rax      # 0x11270
movl $0xfffffffb, (%rax)     # imm = 0xFFFFFFFB
movl $0xfffffffb, %eax       # imm = 0xFFFFFFFB
jmp 0x9873
leaq 0x797f(%rip), %rax      # 0x11270
movl (%rax), %eax
jmp 0x9873
// File: /workspace/github_c_makefile_star2_O1/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: each_codepoint
static
int each_codepoint(STRING* self, void (*fn)(uint32_t))
{
    int         ch  = 0;

    char*       p   = NULL;

    gunichar*   cp  = NULL;

    if (self->empty(self))
        return (status = ESTRISEMPTY);
    if (fn == NULL)
        return (status = EARGISNULPTR);

    p = self->c_str(self);
    setlocale(LC_CTYPE, T_STRING_LOCALE_VALUE);
    while (*p != '\0') {
        if ((ch = mblen(p, MB_CUR_MAX)) < 0) {
#ifdef  LIBRARY_VERBOSE
            print_error();
/* LIBRARY_VERBOSE */
#endif
            return (status = EINVALIDCHAR);
        }
        cp = g_utf8_to_ucs4_fast(p, sizeof(*p), NULL);
        fn(*cp);
        g_free(cp);
        p += ch;
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq *0xa0(%rdi)
movl $0xfffffffc, %r15d      # imm = 0xFFFFFFFC
testl %eax, %eax
je 0x992c
leaq 0x7953(%rip), %rax      # 0x11270
movl %r15d, (%rax)
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
testq %rbx, %rbx
je 0x999b
movq %r14, %rdi
callq *0xc8(%r14)
movq %rax, %r14
leaq 0x2a7b(%rip), %rsi      # 0xc3c0
xorl %r15d, %r15d
xorl %edi, %edi
callq 0x2420
cmpb $0x0, (%r14)
je 0x9920
callq 0x21d0
movq %r14, %rdi
movq %rax, %rsi
callq 0x2310
testl %eax, %eax
js 0x99a6
movl %eax, %ebp
xorl %r15d, %r15d
movl $0x1, %esi
movq %r14, %rdi
xorl %edx, %edx
callq 0x2320
movq %rax, %r12
movl (%rax), %edi
callq *%rbx
movq %r12, %rdi
callq 0x2030
movl %ebp, %eax
cmpb $0x0, (%r14,%rax)
leaq (%r14,%rax), %r14
jne 0x9955
jmp 0x9920
movl $0xfffffffb, %r15d      # imm = 0xFFFFFFFB
jmp 0x9916
movl $0xfffffffe, %r15d      # imm = 0xFFFFFFFE
jmp 0x9916
// File: /workspace/github_c_makefile_star2_O1/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: ts_crypt
static
char* ts_crypt(STRING* self, char* const salt)
{
    if (self->empty(self)) {
        status = ESTRISEMPTY;

        return NULL;
    }
    if (salt == NULL) {
        status = EARGISNULPTR;

        return NULL;
    }

    return crypt(self->c_str(self), salt);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq *0xa0(%rdi)
testl %eax, %eax
je 0x99dc
leaq 0x78a4(%rip), %rax      # 0x11270
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
testq %rbx, %rbx
je 0x99fd
movq %r14, %rdi
callq *0xc8(%r14)
movq %rax, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2190
leaq 0x786c(%rip), %rax      # 0x11270
movl $0xfffffffb, (%rax)     # imm = 0xFFFFFFFB
jmp 0x99d2