// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movb $0x1, %al
cmpl $0x24, (%rcx)
movb %al, -0x51(%rbp)
je 0x4fcf
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x1e, (%rax)
sete %al
movb %al, -0x51(%rbp)
movb -0x51(%rbp), %al
testb $0x1, %al
jne 0x4fdb
jmp 0x50e9
movq -0x10(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x6340
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x4ff6
jmp 0x5125
jmp 0x4ff8
movq -0x38(%rbp), %rax
cmpq -0x40(%rbp), %rax
jne 0x50c8
cmpq $0x0, -0x40(%rbp)
jne 0x5066
movq $0x1, -0x40(%rbp)
movq -0x40(%rbp), %rdi
shlq $0x3, %rdi
callq 0x1130
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x5062
movq 0x19fbd(%rip), %rax     # 0x1eff0
movq (%rax), %rdi
movq -0x40(%rbp), %r8
shlq $0x3, %r8
leaq 0x135c9(%rip), %rsi     # 0x1860e
leaq 0x1381c(%rip), %rdx     # 0x18868
movl $0x90, %ecx
movb $0x0, %al
callq 0x1100
movl $0x1, %edi
callq 0x1170
jmp 0x5064
jmp 0x50c6
movq -0x40(%rbp), %rax
shlq %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rsi
shlq $0x3, %rsi
callq 0x1150
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x50c2
movq 0x19f5d(%rip), %rax     # 0x1eff0
movq (%rax), %rdi
movq -0x40(%rbp), %r8
shlq $0x3, %r8
leaq 0x138f0(%rip), %rsi     # 0x18995
leaq 0x137bc(%rip), %rdx     # 0x18868
movl $0x90, %ecx
movb $0x0, %al
callq 0x1100
movl $0x1, %edi
callq 0x1170
jmp 0x50c4
jmp 0x50c6
jmp 0x50c8
movq -0x48(%rbp), %rdx
movq -0x30(%rbp), %rax
movq -0x38(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x4fac
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x18(%rax), %rcx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x20(%rax), %r8
callq 0xacc0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x517a
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x5156
movq -0x30(%rbp), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0xac30
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x512d
jmp 0x5158
movq -0x30(%rbp), %rdi
callq 0x1030
movq $0x0, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq $0x0, (%rax)
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)