// File: /workspace/github_c_makefile_star2_O2/masyagin1998[P]GCI/src/parser/parser.c
// Function: logical_and_expr_ast_read
static enum PARSER_CODES logical_and_expr_ast_read(struct PARSER*parser, struct LOGICAL_AND_EXPR_AST**logical_and_expr)
{
    enum PARSER_CODES r;

    struct EQ_EXPR_AST**eq_exprs = NULL;
    size_t eq_exprs_len = 0;
    size_t eq_exprs_cap = 0;
    
    struct EQ_EXPR_AST*eq_expr;


    r = eq_expr_ast_read(parser, &eq_expr);
    if (r != PARSER_OK) {
        goto err0;
    }

    PUSH_BACK(eq_exprs, eq_expr);

    while ((parser->tok)->token_type == TOKEN_TYPE_AND) {
        token_free((parser->tok));
        lexer_next_token(parser->lexer, &(parser->tok));

        r = eq_expr_ast_read(parser, &eq_expr);
        if (r != PARSER_OK) {
            goto err1;
        }

        PUSH_BACK(eq_exprs, eq_expr);
    }

    (*logical_and_expr) = create_logical_and_expr_ast(eq_exprs, eq_exprs_len,
                                                      (parser->tok)->frag.starting.line,
                                                      (parser->tok)->frag.starting.pos);

    return PARSER_OK;

 err1:
    {
        size_t i;
        for (i = 0; i < eq_exprs_len; i++) {
            eq_expr_ast_free(eq_exprs[i]);
        }
        SAFE_FREE(eq_exprs);
    }
 err0:
    (*logical_and_expr) = NULL;
    return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %r15
leaq 0x8(%rsp), %rsi
callq 0x498b
testl %eax, %eax
je 0x4817
movl %eax, %ebx
xorl %eax, %eax
jmp 0x4902
movq %r14, 0x10(%rsp)
pushq $0x8
popq %rdi
callq 0x1130
testq %rax, %rax
je 0x495b
movq %rax, %r14
leaq 0x8(%rsp), %rax
movq (%rax), %rax
movq %rax, (%r14)
leaq 0x8(%r15), %rbp
pushq $0x1
popq %r13
movq %r13, %r12
movq (%rbp), %rdi
cmpl $0xe, (%rdi)
jne 0x48c4
callq 0x297c
movq (%r15), %rdi
movq %rbp, %rsi
callq 0x1c9f
movq %r15, %rdi
leaq 0x8(%rsp), %rsi
callq 0x498b
testl %eax, %eax
jne 0x48db
cmpq %r13, %r12
jne 0x48b6
testq %r12, %r12
je 0x489e
movq %r12, %rbx
shlq $0x4, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1160
testq %rax, %rax
je 0x4916
movq %rax, %r14
leaq (%r12,%r12), %r13
jmp 0x48b6
pushq $0x8
popq %rdi
callq 0x1130
testq %rax, %rax
je 0x4938
movq %rax, %r14
pushq $0x1
popq %r13
movq 0x8(%rsp), %rax
movq %rax, (%r14,%r12,8)
incq %r12
jmp 0x4846
movq 0x18(%rdi), %rdx
movq 0x20(%rdi), %rcx
movq %r14, %rdi
movq %r12, %rsi
callq 0x7477
xorl %ebx, %ebx
jmp 0x48fd
movl %eax, %ebx
xorl %r15d, %r15d
cmpq %r15, %r12
je 0x48f3
movq (%r14,%r15,8), %rdi
callq 0x7603
incq %r15
jmp 0x48e0
movq %r14, %rdi
callq 0x1030
xorl %eax, %eax
movq 0x10(%rsp), %r14
movq %rax, (%r14)
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x116d3(%rip), %rax     # 0x15ff0
movq (%rax), %rdi
leaq 0x9fca(%rip), %rsi      # 0xe8f1
leaq 0x9e96(%rip), %rdx      # 0xe7c4
movl $0x351, %ecx            # imm = 0x351
movq %rbx, %r8
jmp 0x497c
movq 0x116b1(%rip), %rax     # 0x15ff0
movq (%rax), %rdi
leaq 0x9c75(%rip), %rsi      # 0xe5be
leaq 0x9e74(%rip), %rdx      # 0xe7c4
pushq $0x8
popq %r8
movl $0x351, %ecx            # imm = 0x351
jmp 0x497c
movq 0x1168e(%rip), %rax     # 0x15ff0
movq (%rax), %rdi
leaq 0x9c52(%rip), %rsi      # 0xe5be
leaq 0x9e51(%rip), %rdx      # 0xe7c4
pushq $0x8
popq %r8
movl $0x346, %ecx            # imm = 0x346
xorl %eax, %eax
callq 0x1100
pushq $0x1
popq %rdi
callq 0x1180