LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: concat
static
int concat(STRING** self, STRING* opp, ...)
{
    STRING* p   = NULL;

    va_list list;

    va_start(list, opp);
    p = opp;
    while (p != NULL) {
        if ((*self)->append(self, p->c_str(p)) < 0)
            goto ERR;
        p = va_arg(list, STRING*);
    }
    va_end(list);

    return 0;

ERR:
    va_end(list);

    return status;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %rdi
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x74d6
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rdi, 0x10(%rsp)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rsp)
testq %rsi, %rsi
je 0x7544
movq (%rbx), %rax
movq 0x68(%rax), %r14
movq %rsi, %rdi
callq *0xc8(%rsi)
movq %rbx, %rdi
movq %rax, %rsi
callq *%r14
testl %eax, %eax
js 0x7548
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0x7531
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0x753f
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq (%rax), %rsi
jmp 0x74f6
xorl %eax, %eax
jmp 0x7551
leaq 0x9d29(%rip), %rax      # 0x11278
movl (%rax), %eax
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: c_concat
static
int c_concat(STRING** self, char* const s, ...)
{
    char*   p   = NULL;

    va_list list;

    va_start(list, s);
    p = s;
    while (p != NULL) {
        if ((*self)->append(self, p) < 0)
            goto ERR;
        p = va_arg(list, char* const);
    }
    va_end(list);

    return 0;

ERR:
    va_end(list);

    return status;
}

// Assembly:
pushq %rbx
subq $0xd0, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %rdi
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x75b7
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rdi, 0x10(%rsp)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rsp)
testq %rsi, %rsi
je 0x7615
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x68(%rax)
testl %eax, %eax
js 0x7619
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0x7602
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0x7610
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq (%rax), %rsi
jmp 0x75d7
xorl %eax, %eax
jmp 0x7622
leaq 0x9c58(%rip), %rax      # 0x11278
movl (%rax), %eax
addq $0xd0, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: chomp
static
size_t chomp(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 == '\r' || *p == '\n')) {
        *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 0x7652
leaq 0x9c31(%rip), %rax      # 0x11278
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
xorl %r14d, %r14d
jmp 0x769c
movq (%rbx), %rdi
callq *0xc8(%rdi)
movq %rax, %r14
movq (%rbx), %rdi
callq *0x18(%rdi)
movq (%rbx), %rdi
leaq (%rax,%r14), %r15
decq %r15
xorl %r14d, %r14d
callq *0x18(%rdi)
testq %rax, %rax
je 0x7699
movzbl (%r15,%r14), %eax
cmpl $0xd, %eax
je 0x7688
cmpl $0xa, %eax
jne 0x7699
movb $0x0, (%r15,%r14)
movq (%rbx), %rdi
decq 0x8(%rdi)
decq %r14
jmp 0x7671
negq %r14
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: lstrip
static
size_t lstrip(STRING** self)
{
    size_t  n   = 0;

    char*   p   = NULL;

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

    return n;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
callq *0xa0(%rdi)
testl %eax, %eax
je 0x76cf
leaq 0x9bb4(%rip), %rax      # 0x11278
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
xorl %r14d, %r14d
jmp 0x7748
movq (%rbx), %rdi
callq *0xc8(%rdi)
xorl %r14d, %r14d
movabsq $0x100003e00, %rcx      # imm = 0x100003E00
movzbl (%rax), %edx
cmpq $0x20, %rdx
ja 0x76fc
btq %rdx, %rcx
jae 0x76fc
incq %rax
incq %r14
jmp 0x76e5
movq (%rbx), %rdi
callq *0xc8(%rdi)
testq %r14, %r14
je 0x76ca
movq %rax, %r15
leaq (%rax,%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)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
callq *0xa0(%rdi)
testl %eax, %eax
je 0x7781
leaq 0x9b02(%rip), %rax      # 0x11278
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
xorl %r14d, %r14d
jmp 0x77d7
movq (%rbx), %rdi
callq *0xc8(%rdi)
movq %rax, %r14
movq (%rbx), %rdi
callq *0x18(%rdi)
movq (%rbx), %rdi
leaq (%rax,%r14), %r15
decq %r15
xorl %r14d, %r14d
movabsq $0x100003e00, %r12      # imm = 0x100003E00
callq *0x18(%rdi)
testq %rax, %rax
je 0x77d4
movzbl (%r15,%r14), %eax
cmpq $0x20, %rax
ja 0x77d4
btq %rax, %r12
jae 0x77d4
movb $0x0, (%r15,%r14)
movq (%rbx), %rdi
decq 0x8(%rdi)
decq %r14
jmp 0x77aa
negq %r14
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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)
testl %eax, %eax
je 0x7817
pushq $-0x4
popq %rbx
leaq 0x9a68(%rip), %rax      # 0x11278
movl %ebx, (%rax)
jmp 0x78b6
movq (%r15), %rdi
callq *0x18(%rdi)
xorl %ebx, %ebx
cmpq %r14, %rax
jae 0x78b6
leaq 0x1(%r14), %rsi
movq %r15, %rdi
callq 0x8db8
testl %eax, %eax
js 0x78c7
testb %bpl, %bpl
movzbl %bpl, %eax
pushq $0x20
popq %rbp
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
pushq $-0x3
jmp 0x7808
// File: /workspace/github_c_makefile_star2_O2/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)
testl %eax, %eax
je 0x78f9
pushq $-0x4
popq %rbx
leaq 0x9983(%rip), %rax      # 0x11278
movl %ebx, (%rax)
jmp 0x7963
movq (%r15), %rdi
callq *0x18(%rdi)
xorl %ebx, %ebx
cmpq %r14, %rax
jae 0x7963
leaq 0x1(%r14), %rsi
movq %r15, %rdi
callq 0x8db8
testl %eax, %eax
js 0x796e
testb %bpl, %bpl
movzbl %bpl, %eax
pushq $0x20
popq %rbp
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
pushq $-0x3
jmp 0x78ed
// File: /workspace/github_c_makefile_star2_O2/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)
testl %eax, %eax
je 0x79a6
pushq $-0x4
popq %rbx
leaq 0x98d9(%rip), %rax      # 0x11278
movl %ebx, (%rax)
jmp 0x7a7d
movq (%r15), %rdi
callq *0x18(%rdi)
xorl %ebx, %ebx
cmpq %r14, %rax
jae 0x7a7d
movq (%r15), %rdi
callq *0x18(%rdi)
movq %rax, %r13
leaq 0x1(%r14), %rsi
movq %r15, %rdi
callq 0x8db8
testl %eax, %eax
js 0x7a8e
movq %r14, %r12
subq %r13, %r12
shrq %r12
testb %bpl, %bpl
movzbl %bpl, %eax
pushq $0x20
popq %rcx
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
pushq $-0x3
jmp 0x7997
// File: /workspace/github_c_makefile_star2_O2/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
andq $0x0, (%rsp)
movq (%rdi), %rdi
callq *0xa0(%rdi)
testl %eax, %eax
je 0x7ad7
pushq $-0x4
popq %rbx
leaq 0x97b4(%rip), %rax      # 0x11278
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 0x8e7e
testl %eax, %eax
js 0x7b6d
xorl %ebx, %ebx
movq %r12, %r15
subq (%rsp), %r15
jbe 0x7ac6
leaq (%r12,%r15), %rsi
incq %rsi
movq %r14, %rdi
callq 0x8db8
testl %eax, %eax
js 0x7b82
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 0x7ac6
leaq 0x9704(%rip), %rax      # 0x11278
movl $0xfffffffe, (%rax)     # imm = 0xFFFFFFFE
pushq $-0x2
popq %rbx
jmp 0x7ac6
pushq $-0x3
jmp 0x7abc
// File: /workspace/github_c_makefile_star2_O2/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
andq $0x0, 0x8(%rsp)
movq (%rdi), %rdi
callq *0xa0(%rdi)
testl %eax, %eax
je 0x7bcb
pushq $-0x4
popq %rbx
leaq 0x96be(%rip), %rax      # 0x11278
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 0x8e7e
testl %eax, %eax
js 0x7c4a
xorl %ebx, %ebx
movq %r12, %r15
subq 0x8(%rsp), %r15
jbe 0x7bbc
leaq (%r12,%r15), %rsi
incq %rsi
movq %r14, %rdi
callq 0x8db8
testl %eax, %eax
js 0x7c5f
testb %bpl, %bpl
movzbl %bpl, %eax
pushq $0x20
popq %rbp
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 0x7bbc
leaq 0x9627(%rip), %rax      # 0x11278
movl $0xfffffffe, (%rax)     # imm = 0xFFFFFFFE
pushq $-0x2
popq %rbx
jmp 0x7bbc
pushq $-0x3
jmp 0x7bb2
// File: /workspace/github_c_makefile_star2_O2/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
andq $0x0, 0x8(%rsp)
movq (%rdi), %rdi
callq *0xa0(%rdi)
testl %eax, %eax
je 0x7cac
pushq $-0x4
popq %rbx
leaq 0x95df(%rip), %rax      # 0x11278
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 0x8e7e
testl %eax, %eax
js 0x7da1
xorl %ebx, %ebx
movq %r13, %r15
subq 0x8(%rsp), %r15
jbe 0x7c9b
movq %r15, %r12
shrq %r12
leaq 0x1(,%r13,2), %rsi
subq %r12, %rsi
movq %r14, %rdi
callq 0x8db8
testl %eax, %eax
js 0x7db6
testb %bpl, %bpl
movzbl %bpl, %eax
pushq $0x20
popq %rbp
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 0x7c9b
leaq 0x94d0(%rip), %rax      # 0x11278
movl $0xfffffffe, (%rax)     # imm = 0xFFFFFFFE
pushq $-0x2
popq %rbx
jmp 0x7c9b
pushq $-0x3
jmp 0x7c91
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
callq *0xa0(%rdi)
testl %eax, %eax
je 0x7de3
leaq 0x94a0(%rip), %rax      # 0x11278
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
pushq $-0x4
popq %rax
jmp 0x7e1d
movq (%rbx), %rdi
callq *0xc8(%rdi)
movq %rax, %rbx
movsbq (%rbx), %r14
testq %r14, %r14
je 0x7e1b
callq 0x21e0
movq (%rax), %rax
testb $0x1, 0x1(%rax,%r14,2)
je 0x7e16
callq 0x23c0
movq (%rax), %rax
movb (%rax,%r14,4), %al
movb %al, (%rbx)
incq %rbx
jmp 0x7def
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
callq *0xa0(%rdi)
testl %eax, %eax
je 0x7e4b
leaq 0x9438(%rip), %rax      # 0x11278
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
pushq $-0x4
popq %rax
jmp 0x7e95
movq (%rbx), %rdi
callq *0xc8(%rdi)
movq %rax, %rbx
movsbq (%rbx), %r14
testq %r14, %r14
je 0x7e93
callq 0x21e0
movq (%rax), %rax
movzwl (%rax,%r14,2), %eax
btl $0x8, %eax
jb 0x7e80
btl $0x9, %eax
jae 0x7e8e
callq 0x2170
jmp 0x7e85
callq 0x23c0
movq (%rax), %rax
movb (%rax,%r14,4), %al
movb %al, (%rbx)
incq %rbx
jmp 0x7e57
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
callq *0xa0(%rdi)
testl %eax, %eax
je 0x7ec3
leaq 0x93c0(%rip), %rax      # 0x11278
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
pushq $-0x4
popq %rax
jmp 0x7efd
movq (%rbx), %rdi
callq *0xc8(%rdi)
movq %rax, %rbx
movsbq (%rbx), %r14
testq %r14, %r14
je 0x7efb
callq 0x21e0
movq (%rax), %rax
testb $0x2, 0x1(%rax,%r14,2)
je 0x7ef6
callq 0x2170
movq (%rax), %rax
movb (%rax,%r14,4), %al
movb %al, (%rbx)
incq %rbx
jmp 0x7ecf
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
callq *0xa0(%rdi)
testl %eax, %eax
je 0x7f2b
leaq 0x9358(%rip), %rax      # 0x11278
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
pushq $-0x4
popq %rax
jmp 0x7f5f
movq (%rbx), %rdi
callq *0xc8(%rdi)
movq %rax, %rbx
movq 0x905a(%rip), %rax      # 0x10f98
movq 0x908b(%rip), %r14      # 0x10fd0
movzbl (%rbx), %edi
testl %edi, %edi
je 0x7f5d
testb %dil, %dil
js 0x7f58
callq *%rax
movb %al, (%rbx)
movq %r14, %rax
incq %rbx
jmp 0x7f45
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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)
testl %eax, %eax
je 0x7f86
pushq $-0x4
jmp 0x7fe8
movq %r14, %rdi
callq *0x18(%r14)
movq %rax, %r15
movq %rbx, %rdi
callq 0x21b0
movq %rax, %r12
decq %rax
cmpq %r15, %rax
jae 0x7fe6
movq %r14, %rdi
callq *0xc8(%r14)
movq %rax, %r13
xorl %r15d, %r15d
xorl %ebp, %ebp
cmpb $0x0, (%r13,%rbp)
je 0x7ff4
movq %r14, %rdi
callq *0x18(%r14)
subq %r12, %rax
cmpq %rax, %rbp
ja 0x7ff4
movq %r13, %rdi
addq %rbp, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x22c0
testl %eax, %eax
je 0x8006
incq %rbp
jmp 0x7fb5
pushq $-0x1
popq %r15
leaq 0x9287(%rip), %rax      # 0x11278
movl %r15d, (%rax)
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x1
popq %rax
movl %eax, %r15d
jmp 0x7ff4
// File: /workspace/github_c_makefile_star2_O2/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)
testl %eax, %eax
je 0x8033
pushq $-0x4
jmp 0x8045
testq %r14, %r14
sete %al
testq %rbx, %rbx
sete %cl
orb %al, %cl
je 0x8060
pushq $-0x5
popq %rbp
leaq 0x922b(%rip), %rax      # 0x11278
movl %ebp, (%rax)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
callq *0x18(%r15)
pushq $-0x1
popq %rbp
cmpq %r12, %rax
jb 0x8046
movq %r14, %rdi
callq 0x21b0
movq %rax, %r13
addq %r12, %rax
movq %rax, (%rsp)
movq %r15, %rdi
callq *0x18(%r15)
cmpq (%rsp), %rax
jb 0x8046
movq %r15, %rdi
callq *0xc8(%r15)
movq %rax, %rbp
movq %r12, (%rbx)
addq %r12, %rbp
cmpb $0x0, (%rbp)
je 0x80d6
movq %r15, %rdi
callq *0x18(%r15)
subq %r13, %rax
cmpq %rax, %r12
ja 0x80d6
movq %rbp, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x22c0
testl %eax, %eax
je 0x80e1
movq (%rbx), %r12
incq %r12
movq %r12, (%rbx)
incq %rbp
jmp 0x80a1
andq $0x0, (%rbx)
pushq $-0x6
jmp 0x8045
xorl %ebp, %ebp
jmp 0x804f
// File: /workspace/github_c_makefile_star2_O2/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, %r13
movq %rsi, %r14
movq %rdi, %r15
callq *0xa0(%rdi)
testl %eax, %eax
je 0x8110
pushq $-0x4
jmp 0x8190
testq %r14, %r14
sete %al
testq %rbx, %rbx
sete %cl
orb %al, %cl
je 0x8124
pushq $-0x5
jmp 0x8190
movq %r15, %rdi
callq *0x18(%r15)
cmpq %r13, %rax
jae 0x8134
pushq $-0x1
jmp 0x8190
movq %r14, %rdi
callq 0x21b0
movq %rax, %r12
movq %r15, %rdi
callq *0x18(%r15)
notq %r13
addq %rax, %r13
movq %r13, (%rbx)
movq %r15, %rdi
callq *0xc8(%r15)
movq %rax, %r13
addq (%rbx), %r13
xorl %ebp, %ebp
movq %r15, %rdi
callq *0x18(%r15)
cmpq %rax, %rbp
jae 0x818a
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x22c0
testl %eax, %eax
je 0x81a9
incq %rbp
decq %r13
decq (%rbx)
jmp 0x8161
andq $0x0, (%rbx)
pushq $-0x6
popq %rax
leaq 0x90e0(%rip), %rcx      # 0x11278
movl %eax, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0x819a
// File: /workspace/github_c_makefile_star2_O2/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)
testl %eax, %eax
je 0x81d5
pushq $-0x4
jmp 0x8274
testq %r14, %r14
sete %al
testq %rbx, %rbx
sete %cl
orb %al, %cl
je 0x81ec
pushq $-0x5
jmp 0x8274
movq %r13, %rdi
callq *0x20(%r13)
cmpq %r15, %rax
jae 0x81fc
pushq $-0x1
jmp 0x8274
movq %r14, %rdi
callq 0x21b0
movq %rax, (%rsp)
movq %r13, %rdi
callq *0xc8(%r13)
movq %rax, %r13
leaq 0x3176(%rip), %rsi      # 0xb392
xorl %edi, %edi
callq 0x2430
pushq $-0x2
popq %r12
cmpb $0x0, (%r13)
je 0x826e
callq 0x21d0
movq %r13, %rdi
movq %rax, %rsi
callq 0x2310
testl %eax, %eax
js 0x8276
movl %eax, %ebp
testq %r15, %r15
je 0x824e
decq %r15
jmp 0x8264
movq %r13, %rdi
movq %r14, %rsi
movq (%rsp), %rdx
callq 0x22c0
xorl %r15d, %r15d
testl %eax, %eax
je 0x8283
movl %ebp, %eax
addq %rax, %r13
incq (%rbx)
jmp 0x8227
andq $0x0, (%rbx)
pushq $-0x6
popq %r12
leaq 0x8ffb(%rip), %rax      # 0x11278
movl %r12d, (%rax)
movl %r12d, %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_O2/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
subq $0x18, %rsp
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r15
callq *0xa0(%rdi)
testl %eax, %eax
je 0x82c0
pushq $-0x4
jmp 0x83a0
testq %r14, %r14
sete %al
testq %rbx, %rbx
sete %cl
orb %al, %cl
je 0x82d7
pushq $-0x5
jmp 0x83a0
movq %r15, %rdi
callq *0x20(%r15)
cmpq %r12, %rax
jae 0x82ea
pushq $-0x1
jmp 0x83a0
movq %r14, 0x10(%rsp)
movq %r14, %rdi
callq 0x21b0
movq %rax, 0x8(%rsp)
movq %r15, %rdi
callq *0x20(%r15)
decq %rax
movq %rax, (%rbx)
movq %r15, %rdi
callq *0xc8(%r15)
movq %rax, %r13
movq %r15, %rdi
callq *0x18(%r15)
movq %rax, %rbp
addq %r13, %rbp
leaq 0x3068(%rip), %rsi      # 0xb392
xorl %r14d, %r14d
xorl %edi, %edi
callq 0x2430
pushq $-0x2
popq %r13
movq %r15, %rdi
callq *0x18(%r15)
cmpq %rax, %r14
jae 0x839a
decq %rbp
callq 0x21d0
movq %rbp, %rdi
movq %rax, %rsi
callq 0x2310
incq %r14
testl %eax, %eax
js 0x8344
callq 0x21d0
movq %rbp, %rdi
movq %rax, %rsi
callq 0x2310
testl %eax, %eax
js 0x83a2
testq %r12, %r12
je 0x837c
decq %r12
jmp 0x8395
movq %rbp, %rdi
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdx
callq 0x22c0
xorl %r12d, %r12d
testl %eax, %eax
je 0x83af
decq (%rbx)
jmp 0x8338
andq $0x0, (%rbx)
pushq $-0x6
popq %r13
leaq 0x8ecf(%rip), %rax      # 0x11278
movl %r13d, (%rax)
movl %r13d, %r12d
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x83f0
leaq 0x8e92(%rip), %rax      # 0x11278
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
pushq $-0x4
jmp 0x845a
movq (%rbx), %rdi
callq *0x18(%rdi)
movq %rax, %r12
movq %r15, %rdi
callq 0x21b0
movq %rax, %r14
decq %rax
cmpq %r12, %rax
jae 0x844e
movq (%rbx), %rdi
callq *0xc8(%rdi)
movq %rax, %rbp
xorl %r12d, %r12d
xorl %r13d, %r13d
cmpb $0x0, (%rbp,%r13)
je 0x845c
movq (%rbx), %rdi
callq *0x18(%rdi)
subq %r14, %rax
cmpq %rax, %r13
ja 0x845c
movq %rbp, %rdi
addq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x22c0
testl %eax, %eax
je 0x846e
incq %r13
jmp 0x841e
leaq 0x8e23(%rip), %rax      # 0x11278
orl $-0x1, (%rax)
pushq $-0x1
popq %r12
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
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)
jmp 0x845c
// File: /workspace/github_c_makefile_star2_O2/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 0x84ea
leaq 0x8d99(%rip), %rax      # 0x11278
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
pushq $-0x4
popq %rbp
jmp 0x8526
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 0x8526
movq (%rbx), %rdi
callq *0xc8(%rdi)
movq %rax, %r15
movq %rax, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x22c0
testl %eax, %eax
je 0x8531
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
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)
pushq $0x1
jmp 0x84e7
// File: /workspace/github_c_makefile_star2_O2/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 0x85a3
leaq 0x8ce0(%rip), %rax      # 0x11278
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
pushq $-0x4
popq %rbp
jmp 0x85ee
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 0x85ee
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
je 0x85ff
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x2050
movq (%rbx), %rax
subq %r15, 0x8(%rax)
pushq $0x1
jmp 0x85a0
// File: /workspace/github_c_makefile_star2_O2/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 0x863c
leaq 0x8c47(%rip), %rax      # 0x11278
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
pushq $-0x4
popq %rax
jmp 0x8664
testl %ebp, %ebp
pushq $0xa
popq %r14
cmovgl %ebp, %r14d
callq 0x2390
andl $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_O2/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 0x8691
leaq 0x8bf5(%rip), %rax      # 0x11278
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
pushq $-0x4
popq %rax
popq %rbx
popq %r14
popq %rbp
retq
testl %ebp, %ebp
pushq $0xa
popq %r14
cmovgl %ebp, %r14d
callq 0x2390
andl $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_O2/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 0x873b
pushq $-0x4
popq %rbp
xorl %ebx, %ebx
leaq 0x8b58(%rip), %rax      # 0x11278
movl %ebp, (%rax)
movq %rbx, %rdi
callq 0x21a0
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 0x87c7
movq %rax, %rbx
movq (%r14), %rdi
callq *0x28(%rdi)
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 0x2c12(%rip), %rsi      # 0xb392
xorl %edi, %edi
callq 0x2430
pushq $-0x2
popq %rbp
cmpb $0x0, (%r15)
je 0x87ce
testq %r12, %r12
je 0x87ce
callq 0x21d0
movq %r15, %rdi
movq %rax, %rsi
callq 0x2310
testl %eax, %eax
js 0x8719
movl %eax, %r13d
subq %r13, %r12
leaq (%rbx,%r12), %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x2470
addq %r13, %r15
jmp 0x878a
pushq $-0x3
jmp 0x8716
movq (%r14), %rax
movq 0x10(%rax), %rdi
callq 0x21a0
movq (%r14), %rax
movq %rbx, 0x10(%rax)
xorl %ebp, %ebp
jmp 0x872a
// File: /workspace/github_c_makefile_star2_O2/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 0x8808
leaq 0x8a7b(%rip), %rax      # 0x11278
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
pushq $-0x4
popq %rax
jmp 0x8826
movq %rbx, %rdi
callq *0xc8(%rbx)
movq %rax, %rcx
pushq $0x1
popq %rax
movb (%rcx), %dl
testb %dl, %dl
je 0x8826
incq %rcx
testb %dl, %dl
jns 0x8817
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq *0xa0(%rdi)
testl %eax, %eax
je 0x884c
leaq 0x8a37(%rip), %rax      # 0x11278
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
pushq $-0x4
popq %rbx
jmp 0x8879
movq %rbx, %rdi
callq *0xc8(%rbx)
movq %rax, %r14
pushq $0x1
popq %rbx
movsbq (%r14), %r15
testq %r15, %r15
je 0x8879
callq 0x21e0
movq (%rax), %rax
incq %r14
testb $0x8, 0x1(%rax,%r15,2)
jne 0x885b
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
andq $0x0, 0x8(%rsp)
testq %rdx, %rdx
je 0x88f8
movq %rdx, %rbx
testq %rsi, %rsi
leaq 0x2aef(%rip), %rax      # 0xb391
cmovneq %rsi, %rax
leaq 0x89cb(%rip), %r15      # 0x11278
andl $0x0, (%r15)
leaq 0x8(%rsp), %rdx
movq %rax, %rsi
callq *0x100(%rdi)
movq %rax, %r14
movl (%r15), %eax
testl %eax, %eax
js 0x8908
xorl %r15d, %r15d
movq 0x8(%rsp), %rdi
cmpq %r15, %r14
je 0x88ef
movq (%rdi,%r15,8), %rdi
callq *%rbx
movq 0x8(%rsp), %rax
movq (%rax,%r15,8), %rdi
callq 0x21a0
incq %r15
jmp 0x88cc
callq 0x21a0
xorl %eax, %eax
jmp 0x8908
leaq 0x8979(%rip), %rax      # 0x11278
movl $0xfffffffb, (%rax)     # imm = 0xFFFFFFFB
pushq $-0x5
popq %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq *0xa0(%rdi)
testl %eax, %eax
je 0x8934
pushq $-0x4
popq %rax
leaq 0x8948(%rip), %rcx      # 0x11278
movl %eax, (%rcx)
jmp 0x8959
testq %rbx, %rbx
je 0x8961
movq %r14, %rdi
callq *0xc8(%r14)
movq %rax, %r14
movb (%r14), %al
testb %al, %al
je 0x8957
movsbl %al, %edi
callq *%rbx
incq %r14
jmp 0x8946
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
pushq $-0x5
jmp 0x8928
// File: /workspace/github_c_makefile_star2_O2/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
andq $0x0, 0x8(%rsp)
callq *0xa0(%rdi)
testl %eax, %eax
je 0x899e
leaq 0x88ed(%rip), %rax      # 0x11278
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
pushq $-0x4
popq %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
testq %rbx, %rbx
je 0x89ef
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq *0x110(%r14)
testl %eax, %eax
js 0x8a00
movq %r14, %rdi
callq *0x20(%r14)
movq %rax, %r14
xorl %r15d, %r15d
movq 0x8(%rsp), %rdi
cmpq %r15, %r14
je 0x89e6
movq (%rdi,%r15,8), %rdi
callq *%rbx
movq 0x8(%rsp), %rax
movq (%rax,%r15,8), %rdi
callq 0x21a0
incq %r15
jmp 0x89c3
callq 0x21a0
xorl %eax, %eax
jmp 0x8994
leaq 0x8882(%rip), %rax      # 0x11278
movl $0xfffffffb, (%rax)     # imm = 0xFFFFFFFB
pushq $-0x5
jmp 0x8993
leaq 0x8871(%rip), %rax      # 0x11278
movl (%rax), %eax
jmp 0x8994