// File: /workspace/github_c_makefile_star2_O0/esheldon[P]xshear/src/config.c
// Function: copy_array
static size_t copy_array(struct cfg_field *self,
                         const struct cfg_string *str,
                         size_t current,
                         enum cfg_status *status)
{
    // skip past the opening brace
    current++;

    CFG_FIELD_ELTYPE(self) = CFG_ELTYPE_UNKNOWN;
    while (1) {
        current = find_nonwhite(str, current, status);
        if (*status) { // EOF
            goto _copy_array_bail;
        }
        if (str->data[current] == CFG_ARRAY_SEP) {
            // this is the separator between elements of array, skip
            current++;
            continue;
        }
        if (str->data[current] == CFG_ARRAY_END) {
            break;
        }

        if (str->data[current] == '#') {
            // found a comment, skip to next EOL
            current = find_char(str, current, '\n', status);
            if (*status) { // EOF
                goto _copy_array_bail;
            }
            continue;
        }
        if (str->data[current] == CFG_QUOTE) {
            current = copy_quoted_string(self, str, current, status);
            if (*status) {
                goto _copy_array_bail;
            }

            CFG_FIELD_ELTYPE(self) = CFG_ELTYPE_QUOTED_STRING;
            // skip ending quote
            current ++;
        } else {
            current = copy_bare_array_token(self, str, current, status);
        }
    }

_copy_array_bail:
    if (CFG_ELTYPE_QUOTED_STRING != CFG_FIELD_ELTYPE(self)) {
        // no quoted strings were found, use bare
        CFG_FIELD_ELTYPE(self)=CFG_ELTYPE_BARE;
    }
    return current;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl $0x2, 0xc(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x9170
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x97c2
jmp 0x98b0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2c, %eax
jne 0x97e5
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x979f
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x5d, %eax
jne 0x97ff
jmp 0x98ae
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x23, %eax
jne 0x983e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rcx
movl $0xa, %edx
callq 0x95e0
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x9839
jmp 0x98b0
jmp 0x979f
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x22, %eax
jne 0x9890
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x98e0
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x9877
jmp 0x98b0
movq -0x8(%rbp), %rax
movl $0x1, 0xc(%rax)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x98a9
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x9a50
movq %rax, -0x18(%rbp)
jmp 0x979f
jmp 0x98b0
movq -0x8(%rbp), %rcx
movl $0x1, %eax
cmpl 0xc(%rcx), %eax
je 0x98c9
movq -0x8(%rbp), %rax
movl $0x0, 0xc(%rax)
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)