// File: /workspace/github_c_makefile_star2_O3/sasairc[P]clangsay/src/libbenly/src/typestring.c
// Function: c_split
static
size_t c_split(STRING* self, char* const delim, char*** dest)
{
    size_t  y       = 0,
            len     = 0,
            idx     = 0;

    char*   tok     = NULL,
        *   tmp     = NULL;

    if (delim == NULL) {
        status = EARGISNULPTR; goto ERR;
    }
    if (self->empty(self)) {
        status = ESTRISEMPTY; goto ERR;
    }
    if ((idx = self->count(self, delim)) == 0)
        return 0;
    else
        idx++;

    if ((tmp = (char*)
                malloc(sizeof(char) * (self->size(self) + 1))) == NULL) {
#ifdef  LIBRARY_VERBOSE
        print_error();
/* LIBRARY_VERBOSE */
#endif
        status = EMEMORYALLOC; goto ERR;
    } else {
        memcpy(tmp, self->c_str(self), self->size(self));
        *(tmp + self->size(self)) = '\0';
    }
    if ((*dest = (char**)
                malloc(sizeof(char*) * idx)) == NULL) {
#ifdef  LIBRARY_VERBOSE
        print_error();
/* LIBRARY_VERBOSE */
#endif
        status = EMEMORYALLOC; goto ERR;
    }
    tok = mbstrtok(tmp, delim);
    while (tok != NULL) {
        len = strlen(tok);
        if ((*((*dest) + y) = (char*)
                    malloc(sizeof(char) * (len + 1))) == NULL) {
#ifdef  LIBRARY_VERBOSE
            print_error();
/* LIBRARY_VERBOSE */
#endif
            status = EMEMORYALLOC; goto ERR;
        } else {
            memcpy(*((*dest) + y), tok, len);
            *(*((*dest) + y) + len) = '\0';
        }
        tok = mbstrtok(NULL, delim);
        y++;
    }
    if (tmp != NULL) {
        free(tmp);
        tmp = NULL;
    }

    return idx;

ERR:
    if (tmp != NULL) {
        free(tmp);
        tmp = NULL;
    }
    if (dest != NULL &&
            *dest != NULL)
        release_char_arr(NULL, idx, *dest);

    return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
testq %rsi, %rsi
je 0x7a3a
movq %rsi, %r15
movq %rdi, %r13
callq *0xa0(%rdi)
testl %eax, %eax
je 0x7a7f
movl $0xfffffffc, %eax       # imm = 0xFFFFFFFC
jmp 0x7a3f
movl $0xfffffffb, %eax       # imm = 0xFFFFFFFB
xorl %ebx, %ebx
leaq 0x9830(%rip), %rcx      # 0x11278
movl %eax, (%rcx)
testq %r14, %r14
je 0x7a6a
movq (%r14), %rdx
testq %rdx, %rdx
je 0x7a6a
xorl %edi, %edi
movq %rbx, %rsi
callq 0x9b40
leaq 0x9810(%rip), %rax      # 0x11278
movl (%rax), %eax
movslq %eax, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %rdi
movq %r15, %rsi
callq *0x30(%r13)
testq %rax, %rax
je 0x7b77
movq %rax, %rbx
incq %rbx
movq %r13, %rdi
callq *0x18(%r13)
leaq 0x1(%rax), %rdi
callq 0x20e0
testq %rax, %rax
je 0x7b7e
movq %rax, %r12
movq %r13, %rdi
callq *0xc8(%r13)
movq %rax, %rbp
movq %r13, %rdi
callq *0x18(%r13)
movq %r12, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x2470
movq %r13, %rdi
callq *0x18(%r13)
movq %r12, (%rsp)
movb $0x0, (%r12,%rax)
leaq (,%rbx,8), %rdi
callq 0x20e0
movq %rax, (%r14)
testq %rax, %rax
je 0x7b88
movq (%rsp), %rdi
movq %r15, %rsi
callq 0x9c30
testq %rax, %rax
je 0x7b69
movq %rax, %r13
xorl %r12d, %r12d
movq %r13, %rdi
callq 0x21b0
movq %rax, %rbp
leaq 0x1(%rax), %rdi
callq 0x20e0
movq (%r14), %rcx
movq %rax, (%rcx,%r12)
testq %rax, %rax
je 0x7b88
movq (%r14), %rax
movq (%rax,%r12), %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x2470
movq (%r14), %rax
movq (%rax,%r12), %rax
movb $0x0, (%rax,%rbp)
xorl %edi, %edi
movq %r15, %rsi
callq 0x9c30
movq %rax, %r13
addq $0x8, %r12
testq %rax, %rax
jne 0x7b16
movq (%rsp), %rdi
callq 0x21a0
jmp 0x7a6d
xorl %ebx, %ebx
jmp 0x7a6d
movl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
jmp 0x7a41
leaq 0x96e9(%rip), %rax      # 0x11278
movl $0xfffffffd, (%rax)     # imm = 0xFFFFFFFD
movq (%rsp), %rdi
callq 0x21a0
movl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
jmp 0x7a4f