// File: /workspace/github_c_makefile_star2_O1/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: to_char_arr
static
int to_char_arr(STRING* self, char*** dest)
{
    int     ch      = 0;

    size_t  y       = 0;

    char*   p       = self->c_str(self);

    if (self->empty(self) ||
            self->mblen(self) == 0) {
        status = ESTRISEMPTY; goto ERR;
    }
    if ((*dest = (char**)
                malloc(sizeof(char*) * self->mblen(self))) == NULL) {
#ifdef  LIBRARY_VERBOSE
        print_error();
/* LIBRARY_VERBOSE */
#endif
        status = EMEMORYALLOC; goto ERR;
    } else {
        y = 0;
        while (y < self->mblen(self)) {
            *((*dest) + y) = NULL;
            y++;
        }
    }

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

    return 0;

ERR:
    switch (status) {
        case    ESTRISEMPTY:
            break;
        case    EINVALIDCHAR:
        case    EMEMORYALLOC:
            if (dest != NULL ||
                    *dest != NULL)
                release_char_arr(self, 0, *dest);
            break;
    }

    return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq *0xc8(%rdi)
movq %rax, %r15
movq %rbx, %rdi
callq *0xa0(%rbx)
movl $0xfffffffc, %ebp       # imm = 0xFFFFFFFC
testl %eax, %eax
je 0x7d48
leaq 0x9555(%rip), %r15      # 0x11270
movl %ebp, (%r15)
addl $0x3, %ebp
cmpl $0x1, %ebp
ja 0x7d33
movq (%r14), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x9ca5
movl (%r15), %r12d
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq *0x20(%rbx)
testq %rax, %rax
je 0x7d14
movq %rbx, %rdi
callq *0x20(%rbx)
leaq (,%rax,8), %rdi
callq 0x20e0
movq %rax, (%r14)
movl $0xfffffffd, %ebp       # imm = 0xFFFFFFFD
testq %rax, %rax
je 0x7d14
movq %rbx, %rdi
callq *0x20(%rbx)
testq %rax, %rax
je 0x7d9a
xorl %r12d, %r12d
movq (%r14), %rax
movq $0x0, (%rax,%r12,8)
incq %r12
movq %rbx, %rdi
callq *0x20(%rbx)
cmpq %rax, %r12
jb 0x7d81
leaq 0x461f(%rip), %rsi      # 0xc3c0
xorl %r12d, %r12d
xorl %edi, %edi
callq 0x2420
cmpb $0x0, (%r15)
je 0x7d36
xorl %r12d, %r12d
movq %rbx, %rdi
callq *0x20(%rbx)
cmpq %rax, %r12
jae 0x7e1e
callq 0x21d0
movq %r15, %rdi
movq %rax, %rsi
callq 0x2310
testl %eax, %eax
js 0x7e26
movl %eax, %r13d
leal 0x1(%r13), %edi
callq 0x20e0
movq (%r14), %rcx
movq %rax, (%rcx,%r12,8)
testq %rax, %rax
je 0x7d14
movq (%r14), %rax
movq (%rax,%r12,8), %rdi
movl %r13d, %r13d
movq %r15, %rsi
movq %r13, %rdx
callq 0x2460
movq (%r14), %rax
movq (%rax,%r12,8), %rax
movb $0x0, (%rax,%r13)
incq %r12
cmpb $0x0, (%r15,%r13)
leaq (%r15,%r13), %r15
jne 0x7db4
xorl %r12d, %r12d
jmp 0x7d36
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
jmp 0x7d14