// File: /workspace/github_c_makefile_star2_O2/masyagin1998[P]GCI/src/parser/parser.c
// Function: variable_ast_read
static enum PARSER_CODES variable_ast_read(struct PARSER*parser, struct VARIABLE_AST**variable, struct IDENT_AST*ident)
{
    enum PARSER_CODES r;
    
    struct VARIABLE_PART_AST**parts = NULL;
    size_t parts_len = 0;
    size_t parts_cap = 0;

    while (((parser->tok)->token_type == TOKEN_TYPE_DOT) ||
           ((parser->tok)->token_type == TOKEN_TYPE_LBRACKET)) {
        struct VARIABLE_PART_AST*part;
        r = variable_part_ast_read(parser, &part);
        if (r != PARSER_OK) {
            goto err0;
        }

        PUSH_BACK(parts, part);
    }

    (*variable) = create_variable_ast(ident, parts, parts_len,
                                      (parser->tok)->frag.starting.line,
                                      (parser->tok)->frag.starting.pos);

    return PARSER_OK;

 err0:
    {
        size_t i;
        for (i = 0; i < parts_len; i++) {
            variable_part_ast_free(parts[i]);
        }
        SAFE_FREE(parts);
    }
    (*variable) = NULL;
    return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq %rdi, %r12
leaq 0x8(%rdi), %rbp
xorl %r14d, %r14d
xorl %r13d, %r13d
xorl %r15d, %r15d
movq (%rbp), %rdi
movl (%rdi), %eax
cmpl $0x1e, %eax
je 0x3e1c
cmpl $0x24, %eax
jne 0x3ec3
callq 0x297c
movq (%r12), %rdi
movq %rbp, %rsi
callq 0x1c9f
movq %r12, %rdi
movq %rsp, %rsi
callq 0x332c
testl %eax, %eax
jne 0x3f01
movq (%rsp), %rdi
xorl %esi, %esi
jmp 0x3e65
callq 0x297c
movq (%r12), %rdi
movq %rbp, %rsi
callq 0x1c9f
movq %r12, %rdi
movq %rsp, %rsi
callq 0x464d
testl %eax, %eax
jne 0x3ee4
movq (%rbp), %rdi
cmpl $0x1f, (%rdi)
jne 0x3ee8
callq 0x297c
movq (%r12), %rdi
movq %rbp, %rsi
callq 0x1c9f
movq (%rsp), %rdi
pushq $0x1
popq %rsi
callq 0x69ef
movq %rax, %rbx
cmpq %r15, %r13
jne 0x3eb7
testq %r13, %r13
je 0x3e9f
movq %r13, %r15
shlq $0x4, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x1160
testq %rax, %rax
je 0x3f3e
movq %rax, %r14
leaq (,%r13,2), %r15
jmp 0x3eb7
pushq $0x8
popq %rdi
callq 0x1130
testq %rax, %rax
je 0x3f60
movq %rax, %r14
pushq $0x1
popq %r15
movq %rbx, (%r14,%r13,8)
incq %r13
jmp 0x3ddc
movq 0x18(%rdi), %rcx
movq 0x20(%rdi), %r8
movq 0x10(%rsp), %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x6bb6
xorl %ebx, %ebx
movq 0x8(%rsp), %r12
jmp 0x3f29
movl %eax, %ebx
jmp 0x3f04
movq (%rsp), %rdi
callq 0x6424
pushq $0x1
popq %rsi
pushq $0x1f
popq %rdx
movq %r12, %rdi
xorl %eax, %eax
callq 0x3273
pushq $-0x1
popq %rbx
movq 0x8(%rsp), %r12
xorl %r15d, %r15d
cmpq %r15, %r13
je 0x3f1f
movq (%r14,%r15,8), %rdi
callq 0x6b6b
incq %r15
jmp 0x3f0c
movq %r14, %rdi
callq 0x1030
xorl %eax, %eax
movq %rax, (%r12)
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x120ab(%rip), %rax     # 0x15ff0
movq (%rax), %rdi
leaq 0xa9a2(%rip), %rsi      # 0xe8f1
leaq 0xa86e(%rip), %rdx      # 0xe7c4
movl $0x90, %ecx
movq %r15, %r8
jmp 0x3f81
movq 0x12089(%rip), %rax     # 0x15ff0
movq (%rax), %rdi
leaq 0xa64d(%rip), %rsi      # 0xe5be
leaq 0xa84c(%rip), %rdx      # 0xe7c4
pushq $0x8
popq %r8
movl $0x90, %ecx
xorl %eax, %eax
callq 0x1100
pushq $0x1
popq %rdi
callq 0x1180