// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0xc8(%rax), %rax
movq -0x10(%rbp), %rdi
callq *%rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0xa0(%rax), %rax
movq -0x10(%rbp), %rdi
callq *%rax
cmpl $0x0, %eax
jne 0xb74e
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x10(%rbp), %rdi
callq *%rax
cmpq $0x0, %rax
jne 0xb760
leaq 0xbaf3(%rip), %rax      # 0x17248
movl $0xfffffffc, (%rax)     # imm = 0xFFFFFFFC
jmp 0xb906
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x10(%rbp), %rdi
callq *%rax
movq %rax, %rdi
shlq $0x3, %rdi
callq 0x20e0
movq -0x18(%rbp), %rcx
movq %rax, (%rcx)
cmpq $0x0, %rax
jne 0xb799
leaq 0xbaba(%rip), %rax      # 0x17248
movl $0xfffffffd, (%rax)     # imm = 0xFFFFFFFD
jmp 0xb906
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x10(%rbp), %rdi
callq *%rax
movq %rax, %rcx
movq -0x38(%rbp), %rax
cmpq %rcx, %rax
jae 0xb7e4
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x28(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0xb7a1
jmp 0xb7e6
xorl %edi, %edi
leaq 0x6d2d(%rip), %rsi      # 0x1251c
callq 0x23d0
movq $0x0, -0x28(%rbp)
movq -0x30(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x39(%rbp)
je 0xb833
movq -0x28(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x10(%rbp), %rdi
callq *%rax
movq %rax, %rcx
movq -0x48(%rbp), %rax
cmpq %rcx, %rax
setb %al
movb %al, -0x39(%rbp)
movb -0x39(%rbp), %al
testb $0x1, %al
jne 0xb83f
jmp 0xb8fd
movq -0x30(%rbp), %rax
movq %rax, -0x50(%rbp)
callq 0x21b0
movq -0x50(%rbp), %rdi
movq %rax, %rsi
callq 0x22e0
movl %eax, -0x1c(%rbp)
cmpl $0x0, %eax
jge 0xb872
leaq 0xb9e1(%rip), %rax      # 0x17248
movl $0xfffffffe, (%rax)     # imm = 0xFFFFFFFE
jmp 0xb906
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x0, %rdi
callq 0x20e0
movq -0x18(%rbp), %rcx
movq (%rcx), %rcx
movq -0x28(%rbp), %rdx
movq %rax, (%rcx,%rdx,8)
cmpq $0x0, %rax
jne 0xb8a8
leaq 0xb9a8(%rip), %rax      # 0x17248
movl $0xfffffffd, (%rax)     # imm = 0xFFFFFFFD
jmp 0xb906
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x30(%rbp), %rsi
movslq -0x1c(%rbp), %rdx
callq 0x2410
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1c(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movl -0x1c(%rbp), %ecx
movq -0x30(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0xb7fc
movl $0x0, -0x4(%rbp)
jmp 0xb95b
leaq 0xb93b(%rip), %rax      # 0x17248
movl (%rax), %eax
movl %eax, -0x54(%rbp)
subl $-0x4, %eax
je 0xb926
jmp 0xb919
movl -0x54(%rbp), %eax
addl $0x3, %eax
subl $0x2, %eax
jb 0xb928
jmp 0xb94f
jmp 0xb94f
cmpq $0x0, -0x18(%rbp)
jne 0xb939
movq -0x18(%rbp), %rax
cmpq $0x0, (%rax)
je 0xb94d
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0xf050
jmp 0xb94f
leaq 0xb8f2(%rip), %rax      # 0x17248
movl (%rax), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)