// File: /workspace/github_c_makefile_star2_O3/masyagin1998[P]GCI/src/parser/parser.c
// Function: body_ast_read
static enum PARSER_CODES body_ast_read(struct PARSER*parser, struct BODY_AST**body)
{
    enum PARSER_CODES r;
    struct STMT_AST**stmts = NULL;
    size_t stmts_len = 0;
    size_t stmts_cap = 0;

    if ((parser->tok)->token_type != TOKEN_TYPE_LBRACE) {
        r = PARSER_INVALID_TOKEN;
        set_parser_error(parser, 1, TOKEN_TYPE_LBRACE);
        goto err0;
    }
    token_free((parser->tok));
    lexer_next_token(parser->lexer, &(parser->tok));

    while ((parser->tok)->token_type != TOKEN_TYPE_RBRACE) {
        struct STMT_AST*stmt;
        r = stmt_ast_read(parser, &stmt);
        if (r != PARSER_OK) {
            goto err1;
        }
        PUSH_BACK(stmts, stmt);
    }

    if ((parser->tok)->token_type != TOKEN_TYPE_RBRACE) {
        r = PARSER_INVALID_TOKEN;
        set_parser_error(parser, 1, TOKEN_TYPE_RBRACE);
        goto err1;
    }    
    token_free((parser->tok));
    lexer_next_token(parser->lexer, &(parser->tok));

    (*body) = create_body_ast(stmts, stmts_len,
                              (parser->tok)->frag.starting.line,
                              (parser->tok)->frag.starting.pos);

    return PARSER_OK;

 err1:
    if (stmts != NULL) {
        size_t i;
        for (i = 0; i < stmts_len; i++) {
            stmt_ast_free(stmts[i]);
        }
        SAFE_FREE(stmts);
    }
 err0:
    (*body) = NULL;
    return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r13
movq %rdi, %r12
movq 0x8(%rdi), %rdi
cmpl $0x20, (%rdi)
jne 0x63aa
movq %r13, 0x8(%rsp)
leaq 0x8(%r12), %r13
callq 0x53ac
movq (%r12), %rdi
movq %r13, %rsi
callq 0x45d6
xorl %ebp, %ebp
xorl %r15d, %r15d
xorl %r14d, %r14d
movq (%r13), %rdi
movl (%rdi), %eax
leal -0x1(%rax), %ecx
cmpl $0xb, %ecx
ja 0x643d
leaq 0x9a6e(%rip), %rdx      # 0xf794
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
callq 0x53ac
movq (%r12), %rdi
movq %r13, %rsi
callq 0x45d6
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
callq 0x5c5f
testl %eax, %eax
jne 0x65e3
movq (%r13), %rdi
cmpl $0x15, (%rdi)
jne 0x64d2
callq 0x53ac
movq (%r12), %rdi
movq %r13, %rsi
callq 0x45d6
movq %r12, %rdi
leaq 0x18(%rsp), %rsi
callq 0x6917
testl %eax, %eax
jne 0x6513
movq (%r13), %rdi
cmpl $0x23, (%rdi)
jne 0x6543
callq 0x53ac
movq (%r12), %rdi
movq %r13, %rsi
callq 0x45d6
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x8(%r12), %rax
movq 0x18(%rax), %rdx
movq 0x20(%rax), %rcx
callq 0x85db
movq %rax, %rdi
xorl %esi, %esi
jmp 0x62ad
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
callq 0x6c51
testl %eax, %eax
jne 0x63cb
movq 0x10(%rsp), %rdi
movl $0x3, %esi
jmp 0x62ad
callq 0x53ac
movq (%r12), %rdi
movq %r13, %rsi
callq 0x45d6
movq 0x8(%r12), %rdi
cmpl $0x23, (%rdi)
jne 0x6258
xorl %ebx, %ebx
jmp 0x627f
callq 0x53ac
movq (%r12), %rdi
movq %r13, %rsi
callq 0x45d6
movq 0x8(%r12), %rdi
cmpl $0x1b, (%rdi)
jne 0x64c0
callq 0x53ac
movq (%r12), %rdi
movq %r13, %rsi
callq 0x45d6
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
callq 0x6fc5
testl %eax, %eax
jne 0x63cb
movq (%r13), %rdi
cmpl $0x1c, (%rdi)
jne 0x6517
callq 0x53ac
movq (%r12), %rdi
movq %r13, %rsi
callq 0x45d6
movq %r12, %rdi
leaq 0x18(%rsp), %rsi
callq 0x5cc9
testl %eax, %eax
jne 0x6532
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq (%r13), %rax
movq 0x18(%rax), %rdx
movq 0x20(%rax), %rcx
callq 0x8c19
movq %rax, %rdi
movl $0x4, %esi
jmp 0x62ad
movq %rbp, 0x20(%rsp)
movq %r15, %rbp
movq %r14, %r15
movq 0x18(%rdi), %rbx
movq 0x20(%rdi), %r14
callq 0x53ac
movq (%r12), %rdi
movq %r13, %rsi
callq 0x45d6
movq 0x8(%r12), %rdi
cmpl $0x23, (%rdi)
jne 0x63d2
callq 0x53ac
movq (%r12), %rdi
movq %r13, %rsi
callq 0x45d6
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8dc0
movq %rax, %rdi
movl $0x6, %esi
jmp 0x5f64
movq %rbp, 0x20(%rsp)
movq %r15, %rbp
movq %r14, %r15
movq 0x18(%rdi), %rbx
movq 0x20(%rdi), %r14
callq 0x53ac
movq (%r12), %rdi
movq %r13, %rsi
callq 0x45d6
movq 0x8(%r12), %rdi
cmpl $0x23, (%rdi)
jne 0x63d2
callq 0x53ac
movq (%r12), %rdi
movq %r13, %rsi
callq 0x45d6
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8d5e
movq %rax, %rdi
movl $0x5, %esi
callq 0x83c7
movq %rax, %rbx
movq %r15, %r14
movq %rbp, %r15
jmp 0x61d3
movq %rbp, 0x20(%rsp)
movq 0x18(%rdi), %rbx
movq 0x20(%rdi), %rbp
callq 0x53ac
movq (%r12), %rdi
movq %r13, %rsi
callq 0x45d6
movq 0x8(%r12), %rdi
cmpl $0x1b, (%rdi)
jne 0x63f5
movq %rbx, 0x30(%rsp)
callq 0x53ac
movq (%r12), %rdi
movq %r13, %rsi
callq 0x45d6
movq %r12, %rdi
leaq 0x18(%rsp), %rsi
callq 0x5c5f
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x642e
movq %r14, 0x28(%rsp)
movq 0x18(%rsp), %r14
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
movq %r14, %rdx
callq 0x6771
testl %eax, %eax
jne 0x650c
movq $0x0, 0x18(%rsp)
movq (%r13), %rdi
cmpl $0x22, (%rdi)
jne 0x6572
callq 0x53ac
movq (%r12), %rdi
movq %r13, %rsi
callq 0x45d6
movq %r12, %rdi
leaq 0x18(%rsp), %rsi
callq 0x5c5f
testl %eax, %eax
jne 0x6590
movq (%r13), %rdi
cmpl $0x1c, (%rdi)
jne 0x6410
callq 0x53ac
movq (%r12), %rdi
movq %r13, %rsi
callq 0x45d6
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq %rbp, %rcx
callq 0x8e22
movq 0x8(%r12), %rdi
cmpl $0x23, (%rdi)
jne 0x641a
movq %rax, %r14
callq 0x53ac
movq (%r12), %rdi
movq %r13, %rsi
callq 0x45d6
movq %r14, %rdi
movl $0x7, %esi
callq 0x83c7
movq %rax, %rbx
movq 0x20(%rsp), %rbp
movq 0x28(%rsp), %r14
jmp 0x62b5
movq %rbp, 0x20(%rsp)
movq 0x18(%rdi), %rbp
movq 0x20(%rdi), %rbx
callq 0x53ac
movq (%r12), %rdi
movq %r13, %rsi
callq 0x45d6
movq 0x8(%r12), %rdi
cmpl $0x1b, (%rdi)
jne 0x63f5
movq %rbx, 0x28(%rsp)
callq 0x53ac
movq (%r12), %rdi
movq %r13, %rsi
callq 0x45d6
movq %r12, %rdi
leaq 0x18(%rsp), %rsi
callq 0x5c5f
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x642e
movq %rbp, 0x30(%rsp)
movq %r15, %rbp
movq %r14, %r15
movq 0x18(%rsp), %r14
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
movq %r14, %rdx
callq 0x6771
testl %eax, %eax
jne 0x6502
movq $0x0, 0x18(%rsp)
movq (%r13), %rdi
cmpl $0x22, (%rdi)
jne 0x6579
movq %r15, %r14
callq 0x53ac
movq (%r12), %rdi
movq %r13, %rsi
callq 0x45d6
movq %r12, %rdi
leaq 0x18(%rsp), %rsi
callq 0x5c5f
testl %eax, %eax
movq %rbp, %r15
jne 0x6590
movq (%r13), %rdi
cmpl $0x1c, (%rdi)
jne 0x6410
callq 0x53ac
movq (%r12), %rdi
movq %r13, %rsi
callq 0x45d6
movq 0x8(%r12), %rdi
cmpl $0x23, (%rdi)
jne 0x641a
callq 0x53ac
movq (%r12), %rdi
movq %r13, %rsi
callq 0x45d6
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0x28(%rsp), %rcx
callq 0x8f33
movq %rax, %rdi
movl $0x8, %esi
callq 0x83c7
movq %rax, %rbx
movq 0x20(%rsp), %rbp
jmp 0x62b5
movq %r14, 0x28(%rsp)
leaq 0x58(%rdi), %rax
movq 0x18(%rdi), %rsi
movq 0x20(%rdi), %rdx
movq %rax, %rdi
callq 0xa96f
movq %rax, %r14
movq 0x8(%r12), %rdi
callq 0x53ac
movq (%r12), %rdi
movq %r13, %rsi
callq 0x45d6
movq 0x8(%r12), %rax
cmpl $0x1b, (%rax)
jne 0x630c
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
movq %r14, %rdx
callq 0x6681
testl %eax, %eax
jne 0x64b6
movq 0x10(%rsp), %rdi
movq (%r13), %rax
movq 0x18(%rax), %rsi
movq 0x20(%rax), %rdx
callq 0x88be
movq %rax, %rdi
movl $0x2, %esi
jmp 0x637a
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
callq 0x6917
testl %eax, %eax
jne 0x63cb
movq (%r13), %rdi
cmpl $0x23, (%rdi)
jne 0x662c
movq 0x10(%rsp), %rbx
callq 0x53ac
movq (%r12), %rdi
movq %r13, %rsi
callq 0x45d6
movq 0x8(%r12), %rax
movq 0x18(%rax), %rsi
movq 0x20(%rax), %rdx
movq %rbx, %rdi
callq 0x9044
movq %rax, %rdi
movl $0x9, %esi
callq 0x83c7
movq %rax, %rbx
cmpq %r14, %r15
jne 0x62ff
testq %r15, %r15
je 0x62e3
movq %r15, %r14
shlq $0x4, %r14
movq %rbp, %rdi
movq %r14, %rsi
callq 0x1160
testq %rax, %rax
je 0x6674
movq %rax, %rbp
leaq (%r15,%r15), %r14
jmp 0x62ff
movl $0x8, %edi
callq 0x1130
testq %rax, %rax
je 0x667c
movq %rax, %rbp
movl $0x1, %r14d
movq %rbx, (%rbp,%r15,8)
incq %r15
jmp 0x5d0d
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
movq %r14, %rdx
callq 0x6771
testl %eax, %eax
jne 0x64b6
movq (%r13), %rdi
cmpl $0x15, (%rdi)
jne 0x65bd
callq 0x53ac
movq (%r12), %rdi
movq %r13, %rsi
callq 0x45d6
movq %r12, %rdi
leaq 0x18(%rsp), %rsi
callq 0x6917
testl %eax, %eax
jne 0x665b
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq (%r13), %rax
movq 0x18(%rax), %rdx
movq 0x20(%rax), %rcx
callq 0x875e
movq %rax, %rdi
movl $0x1, %esi
callq 0x83c7
movq %rax, %rbx
movq (%r13), %rdi
cmpl $0x23, (%rdi)
movq 0x28(%rsp), %r14
jne 0x64e8
callq 0x53ac
movq (%r12), %rdi
movq %r13, %rsi
callq 0x45d6
jmp 0x62b5
xorl %r14d, %r14d
movl $0x1, %esi
movq %r12, %rdi
movl $0x20, %edx
xorl %eax, %eax
callq 0x5b97
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x6617
movl %eax, %ebx
jmp 0x65e8
movl $0x1, %esi
movq %r12, %rdi
movl $0x23, %edx
xorl %eax, %eax
callq 0x5b97
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq 0x8(%rsp), %r13
movq %rbp, %r15
jmp 0x6433
movl $0x1, %esi
movq %r12, %rdi
movl $0x1b, %edx
xorl %eax, %eax
callq 0x5b97
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x642e
movl $0x1c, %edx
jmp 0x6581
movl $0x1, %esi
movq %r12, %rdi
movl $0x23, %edx
xorl %eax, %eax
callq 0x5b97
movq 0x8(%rsp), %r13
movq 0x20(%rsp), %rbp
jmp 0x65ed
cmpl $0x21, %eax
jne 0x647a
callq 0x53ac
movq (%r12), %rdi
movq %r13, %rsi
callq 0x45d6
movq 0x8(%r12), %rax
movq 0x18(%rax), %rdx
movq 0x20(%rax), %rcx
movq %rbp, %rdi
movq %r15, %rsi
callq 0x8245
movq %rax, %r14
xorl %ebx, %ebx
movq 0x8(%rsp), %r13
jmp 0x6617
subq $0x8, %rsp
movl $0x9, %esi
movq %r12, %rdi
movl $0x1, %edx
movl $0xc, %ecx
movl $0x2, %r8d
movl $0x4, %r9d
xorl %eax, %eax
pushq $0xb
pushq $0x8
pushq $0x7
pushq $0x6
pushq $0x5
callq 0x5b97
addq $0x30, %rsp
jmp 0x65e3
movl %eax, %ebx
movq %r14, %rdi
jmp 0x656b
movl $0x1, %esi
movq %r12, %rdi
movl $0x1b, %edx
jmp 0x65dc
movl $0x1, %esi
movq %r12, %rdi
movl $0x15, %edx
xorl %eax, %eax
callq 0x5b97
jmp 0x6561
movq %rbx, %rdi
callq 0x8335
movl $0x1, %esi
movq %r12, %rdi
movl $0x23, %edx
jmp 0x65dc
movl %eax, %ebx
movq %rbp, %r15
jmp 0x65a4
movl %eax, %ebx
jmp 0x65a4
movl %eax, %ebx
jmp 0x6566
movl $0x1, %esi
movq %r12, %rdi
movl $0x1c, %edx
xorl %eax, %eax
callq 0x5b97
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x6534
movl %eax, %ebx
movq 0x10(%rsp), %rdi
callq 0x8bdc
jmp 0x65e8
movl $0x1, %esi
movq %r12, %rdi
movl $0x23, %edx
xorl %eax, %eax
callq 0x5b97
movq 0x18(%rsp), %rdi
callq 0x871f
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq 0x10(%rsp), %rdi
callq 0x809d
jmp 0x65e8
movl $0x22, %edx
jmp 0x6581
movl $0x22, %edx
movq %rbp, %r15
movl $0x1, %esi
movq %r12, %rdi
xorl %eax, %eax
callq 0x5b97
movq 0x10(%rsp), %rdi
callq 0x8877
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq 0x18(%rsp), %r14
testq %r14, %r14
movq 0x8(%rsp), %r13
movq 0x20(%rsp), %rbp
je 0x65ed
movq %r14, %rdi
callq 0x809d
jmp 0x65ed
movq %r14, %rdi
callq 0x809d
movq 0x10(%rsp), %rdi
callq 0x8877
movl $0x1, %esi
movq %r12, %rdi
movl $0x15, %edx
xorl %eax, %eax
callq 0x5b97
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq 0x8(%rsp), %r13
testq %rbp, %rbp
je 0x6614
testq %r15, %r15
je 0x660c
xorl %r14d, %r14d
movq (%rbp,%r14,8), %rdi
callq 0x8335
incq %r14
cmpq %r14, %r15
jne 0x65fa
movq %rbp, %rdi
callq 0x1030
xorl %r14d, %r14d
movq %r14, (%r13)
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %esi
movq %r12, %rdi
movl $0x23, %edx
xorl %eax, %eax
callq 0x5b97
movq 0x10(%rsp), %rdi
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rdi, %rdi
movq 0x8(%rsp), %r13
je 0x65ed
callq 0x871f
jmp 0x65ed
movl %eax, %ebx
movq %r14, %rdi
callq 0x809d
movq 0x10(%rsp), %rdi
callq 0x8877
jmp 0x65e8
movq %r14, %rdi
callq 0x172a
callq 0x175a