// File: /workspace/github_c_makefile_star2_O1/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, %r15
movq %rdi, %r14
movq 0x8(%rdi), %rdi
cmpl $0x20, (%rdi)
jne 0x6786
movq %r15, 0x20(%rsp)
leaq 0x8(%r14), %r15
callq 0x53b0
movq (%r14), %rdi
movq %r15, %rsi
callq 0x45b5
movq $0x0, 0x18(%rsp)
xorl %r12d, %r12d
movq $0x0, 0x28(%rsp)
movq %r15, 0x30(%rsp)
movq (%r15), %rdi
movl (%rdi), %eax
leal -0x1(%rax), %ecx
cmpl $0xb, %ecx
ja 0x617b
leaq 0x9a02(%rip), %rdx      # 0xf794
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
callq 0x53b0
movq (%r14), %rdi
movq %r15, %rsi
callq 0x45b5
movq %r14, %rdi
movq %rsp, %rsi
callq 0x5cbc
testl %eax, %eax
je 0x634f
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x641c
movq 0x18(%rdi), %rbp
movq 0x20(%rdi), %rbx
callq 0x53b0
movq (%r14), %rdi
movq %r15, %rsi
callq 0x45b5
movq 0x8(%r14), %rdi
cmpl $0x1b, (%rdi)
jne 0x61c5
movq %rbx, 0x10(%rsp)
callq 0x53b0
movq (%r14), %rdi
movq %r15, %rsi
callq 0x45b5
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
callq 0x5cbc
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x61de
movq 0x8(%rsp), %rdx
movq %r14, %rdi
movq %rsp, %rsi
callq 0x692f
movl %eax, %ebx
testl %eax, %eax
jne 0x663f
movq $0x0, 0x8(%rsp)
movq (%r15), %rdi
movl $0x22, %edx
cmpl $0x22, (%rdi)
jne 0x6622
callq 0x53b0
movq (%r14), %rdi
movq %r15, %rsi
callq 0x45b5
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
callq 0x5cbc
testl %eax, %eax
jne 0x6631
movq (%r15), %rdi
movl $0x1c, %edx
cmpl $0x1c, (%rdi)
jne 0x6622
callq 0x53b0
movq (%r14), %rdi
movq %r15, %rsi
callq 0x45b5
movq 0x8(%r14), %rdi
cmpl $0x23, (%rdi)
jne 0x6741
callq 0x53b0
movq (%r14), %rdi
movq %r15, %rsi
callq 0x45b5
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %rbp, %rdx
movq 0x10(%rsp), %rcx
callq 0x92d1
movq %rax, %rdi
xorl %ebx, %ebx
jmp 0x61e0
movq 0x18(%rdi), %rbx
movq 0x20(%rdi), %rbp
callq 0x53b0
movq (%r14), %rdi
movq %r15, %rsi
callq 0x45b5
movq 0x8(%r14), %rdi
cmpl $0x1b, (%rdi)
jne 0x61f2
callq 0x53b0
movq (%r14), %rdi
movq %r15, %rsi
callq 0x45b5
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
callq 0x5cbc
testl %eax, %eax
jne 0x6206
movq %r12, 0x10(%rsp)
movq %r13, %r12
movq 0x8(%rsp), %rdx
movq %r14, %rdi
movq %rsp, %rsi
callq 0x692f
movl %eax, %r13d
testl %eax, %eax
jne 0x6675
movq $0x0, 0x8(%rsp)
movq (%r15), %rdi
movl $0x22, %edx
cmpl $0x22, (%rdi)
jne 0x6657
movq %r12, %r13
callq 0x53b0
movq (%r14), %rdi
movq %r15, %rsi
callq 0x45b5
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
callq 0x5cbc
testl %eax, %eax
jne 0x6666
movq (%r15), %rdi
movl $0x1c, %edx
cmpl $0x1c, (%rdi)
jne 0x6657
callq 0x53b0
movq (%r14), %rdi
movq %r15, %rsi
callq 0x45b5
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %rbx, %rdx
movq %rbp, %rcx
callq 0x91c0
movq 0x8(%r14), %rdi
cmpl $0x23, (%rdi)
jne 0x6761
movq %rax, %rbx
callq 0x53b0
movq (%r14), %rdi
movq %r15, %rsi
callq 0x45b5
xorl %ebp, %ebp
jmp 0x668c
movq %r14, %rdi
movq %rsp, %rsi
callq 0x6ebf
movl %eax, %ebx
testl %eax, %eax
jne 0x6539
movq (%rsp), %rdi
movl $0x3, %esi
jmp 0x6531
callq 0x53b0
movq (%r14), %rdi
movq %r15, %rsi
callq 0x45b5
movq 0x8(%r14), %rdi
cmpl $0x1b, (%rdi)
jne 0x6230
callq 0x53b0
movq (%r14), %rdi
movq %r15, %rsi
callq 0x45b5
movq %r14, %rdi
movq %rsp, %rsi
callq 0x723e
testl %eax, %eax
je 0x642d
movl %eax, %ebx
jmp 0x6526
movq %r12, %rax
movq %r13, %r12
movq %rax, 0x10(%rsp)
movq 0x18(%rdi), %rbx
movq 0x20(%rdi), %rbp
callq 0x53b0
movq (%r14), %rdi
movq %r15, %rsi
callq 0x45b5
movq 0x8(%r14), %rdi
movl (%rdi), %r13d
cmpl $0x23, %r13d
jne 0x624e
callq 0x53b0
movq (%r14), %rdi
movq %r15, %rsi
callq 0x45b5
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x90fc
xorl %ebx, %ebx
jmp 0x6269
leaq 0x58(%rdi), %rax
movq 0x18(%rdi), %rsi
movq 0x20(%rdi), %rdx
movq %rax, %rdi
callq 0xad3f
movq %rax, %rbx
movq 0x8(%r14), %rdi
callq 0x53b0
movq (%r14), %rdi
movq %r15, %rsi
callq 0x45b5
movq 0x8(%r14), %rax
cmpl $0x1b, (%rax)
jne 0x6280
movq %r14, %rdi
movq %rsp, %rsi
movq %rbx, %rdx
callq 0x683c
movl %eax, %ebp
testl %eax, %eax
je 0x6483
movq %rbx, %rdi
callq 0x841c
jmp 0x64a7
callq 0x53b0
movq (%r14), %rdi
movq %r15, %rsi
callq 0x45b5
movq 0x8(%r14), %rax
cmpl $0x23, (%rax)
jne 0x62ac
movq $0x0, (%rsp)
jmp 0x62c2
movq %r12, %rax
movq %r13, %r12
movq %rax, 0x10(%rsp)
movq 0x18(%rdi), %rbx
movq 0x20(%rdi), %rbp
callq 0x53b0
movq (%r14), %rdi
movq %r15, %rsi
callq 0x45b5
movq 0x8(%r14), %rdi
movl (%rdi), %r13d
cmpl $0x23, %r13d
jne 0x62fd
callq 0x53b0
movq (%r14), %rdi
movq %r15, %rsi
callq 0x45b5
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x915e
xorl %ebx, %ebx
jmp 0x6318
cmpl $0x21, %eax
je 0x67ff
subq $0x8, %rsp
movl $0x9, %esi
movq %r14, %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 0x5bec
addq $0x30, %rsp
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x6541
movl $0x1, %esi
movq %r14, %rdi
movl $0x1b, %edx
xorl %eax, %eax
callq 0x5bec
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
xorl %edi, %edi
testl %ebx, %ebx
jne 0x6539
movl $0x8, %esi
jmp 0x6531
movl $0x1, %esi
movq %r14, %rdi
movl $0x1b, %edx
xorl %eax, %eax
callq 0x5bec
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorl %ebx, %ebx
testl %ebp, %ebp
jne 0x6221
movq %rbx, %rdi
movl $0x7, %esi
callq 0x8756
movq %rax, %r13
testl %ebp, %ebp
movl %ebp, %ebx
jne 0x6541
jmp 0x6348
movl $0x1, %esi
movq %r14, %rdi
movl $0x1b, %edx
xorl %eax, %eax
callq 0x5bec
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x6526
movl $0x1, %esi
movq %r14, %rdi
movl $0x23, %edx
xorl %eax, %eax
callq 0x5bec
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
xorl %eax, %eax
cmpl $0x23, %r13d
jne 0x632e
movq %rax, %rdi
movl $0x5, %esi
jmp 0x6326
movq %r14, %rdi
movq %rsp, %rsi
movq %rbx, %rdx
callq 0x692f
testl %eax, %eax
je 0x64bb
movl %eax, %ebp
movq %rbx, %rdi
callq 0x841c
movl $0x3, %eax
xorl %ebx, %ebx
jmp 0x66e8
movq %r14, %rdi
movq %rsp, %rsi
callq 0x6b48
testl %eax, %eax
je 0x62c2
movl %eax, %ebx
jmp 0x63e6
movq (%r15), %rdi
cmpl $0x23, (%rdi)
jne 0x63bf
callq 0x53b0
movq (%r14), %rdi
movq %r15, %rsi
callq 0x45b5
movq (%rsp), %rdi
movq 0x8(%r14), %rax
movq 0x18(%rax), %rsi
movq 0x20(%rax), %rdx
callq 0x93e2
movq %rax, %rdi
xorl %ebx, %ebx
jmp 0x63e8
movl $0x1, %esi
movq %r14, %rdi
movl $0x23, %edx
xorl %eax, %eax
callq 0x5bec
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
xorl %eax, %eax
cmpl $0x23, %r13d
jne 0x632e
movq %rax, %rdi
movl $0x6, %esi
callq 0x8756
movq %rax, %r12
cmpl $0x23, %r13d
movq 0x10(%rsp), %rax
movq 0x30(%rsp), %r15
movq %r12, %r13
movq %rax, %r12
jne 0x6541
xorl %ebx, %ebx
jmp 0x6544
movq (%r15), %rdi
cmpl $0x15, (%rdi)
jne 0x63fa
callq 0x53b0
movq (%r14), %rdi
movq %r15, %rsi
callq 0x45b5
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
callq 0x6b48
movl %eax, %ebx
testl %eax, %eax
jne 0x6413
movq (%r15), %rdi
cmpl $0x23, (%rdi)
jne 0x6696
callq 0x53b0
movq (%r14), %rdi
movq %r15, %rsi
callq 0x45b5
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x8(%r14), %rax
movq 0x18(%rax), %rdx
movq 0x20(%rax), %rcx
callq 0x896a
movq %rax, %rdi
xorl %ebx, %ebx
jmp 0x641e
movl $0x1, %esi
movq %r14, %rdi
movl $0x23, %edx
xorl %eax, %eax
callq 0x5bec
movq (%rsp), %rdi
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rdi, %rdi
je 0x63e6
callq 0x8aae
xorl %edi, %edi
testl %ebx, %ebx
jne 0x6539
movl $0x9, %esi
jmp 0x6531
movl $0x1, %esi
movq %r14, %rdi
movl $0x15, %edx
xorl %eax, %eax
callq 0x5bec
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq (%rsp), %rdi
callq 0x841c
xorl %edi, %edi
testl %ebx, %ebx
jne 0x6539
xorl %esi, %esi
jmp 0x6531
movq (%r15), %rdi
cmpl $0x1c, (%rdi)
jne 0x6504
callq 0x53b0
movq (%r14), %rdi
movq %r15, %rsi
callq 0x45b5
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
callq 0x5d26
movl %eax, %ebx
testl %eax, %eax
jne 0x651d
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq (%r15), %rax
movq 0x18(%rax), %rdx
movq 0x20(%rax), %rcx
callq 0x8fb7
movq %rax, %rdi
xorl %ebx, %ebx
jmp 0x6528
movq (%rsp), %rdi
movq (%r15), %rax
movq 0x18(%rax), %rsi
movq 0x20(%rax), %rdx
callq 0x8c55
movq %rax, %rdi
movl $0x2, %esi
callq 0x8756
movq %rax, %r13
movl $0x3, %eax
movl %ebp, %ebx
testl %ebp, %ebp
jne 0x6733
jmp 0x66ee
movq (%r15), %rdi
cmpl $0x15, (%rdi)
jne 0x65ec
callq 0x53b0
movq (%r14), %rdi
movq %r15, %rsi
callq 0x45b5
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
callq 0x6b48
testl %eax, %eax
je 0x66b9
movl %eax, %ebp
movq %rbx, %rdi
callq 0x841c
movq (%rsp), %rdi
callq 0x8c06
jmp 0x62a0
movl $0x1, %esi
movq %r14, %rdi
movl $0x1c, %edx
xorl %eax, %eax
callq 0x5bec
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq (%rsp), %rdi
callq 0x8f73
xorl %edi, %edi
testl %ebx, %ebx
jne 0x6539
movl $0x4, %esi
callq 0x8756
movq %rax, %r13
testl %ebx, %ebx
je 0x6348
xorl %r13d, %r13d
movl $0x5, %eax
testl %ebx, %ebx
jne 0x65df
movq 0x28(%rsp), %rax
cmpq %rax, %r12
jne 0x65d1
testq %rax, %rax
je 0x65af
movl %ebx, 0x10(%rsp)
movq %r14, %rbp
movq %r15, %r14
movq %r12, %r15
movq %r13, %r12
movq %rax, %rbx
shlq $0x4, %rbx
movq 0x18(%rsp), %rdi
movq %rbx, %rsi
movq %rax, %r13
callq 0x1160
testq %rax, %rax
je 0x682f
addq %r13, %r13
movq %r13, 0x28(%rsp)
movq %r12, %r13
movq %r15, %r12
movq %r14, %r15
movq %rbp, %r14
movq %rax, 0x18(%rsp)
movl 0x10(%rsp), %ebx
jmp 0x65d1
movl $0x8, %edi
callq 0x1130
movq %rax, 0x18(%rsp)
testq %rax, %rax
je 0x6837
movl $0x1, %eax
movq %rax, 0x28(%rsp)
movq 0x18(%rsp), %rax
movq %r13, (%rax,%r12,8)
incq %r12
xorl %eax, %eax
testl %eax, %eax
je 0x5d7a
jmp 0x67a3
movq %rbx, %rdi
callq 0x841c
movq (%rsp), %rdi
callq 0x8c06
xorl %ebx, %ebx
movl $0x1, %esi
movq %r14, %rdi
movl $0x15, %edx
xorl %eax, %eax
callq 0x5bec
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl $0x3, %eax
jmp 0x66e8
movl $0x1, %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x5bec
movq (%rsp), %rdi
callq 0x8c06
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x61de
callq 0x841c
jmp 0x61de
movl $0x1, %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x5bec
movq (%rsp), %rdi
callq 0x8c06
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x6684
callq 0x841c
xorl %ebx, %ebx
movl %r13d, %ebp
movq %r12, %r13
movq 0x10(%rsp), %r12
jmp 0x620d
movl $0x1, %esi
movq %r14, %rdi
movl $0x23, %edx
xorl %eax, %eax
callq 0x5bec
movq 0x8(%rsp), %rdi
callq 0x8aae
jmp 0x640e
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq (%r15), %rax
movq 0x18(%rax), %rdx
movq 0x20(%rax), %rcx
callq 0x8aed
movq %rax, %rdi
movl $0x1, %esi
callq 0x8756
movq %rax, %r13
xorl %eax, %eax
movb $0x1, %bl
xorl %ebp, %ebp
testb %bl, %bl
movl %ebp, %ebx
je 0x6733
movq (%r15), %rdi
cmpl $0x23, (%rdi)
jne 0x670d
callq 0x53b0
movq (%r14), %rdi
movq %r15, %rsi
callq 0x45b5
movl $0x2, %eax
jmp 0x6733
movq %r13, %rdi
callq 0x86c4
movl $0x1, %esi
movq %r14, %rdi
movl $0x23, %edx
xorl %eax, %eax
callq 0x5bec
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl $0x3, %eax
cmpl $0x3, %eax
jne 0x6348
jmp 0x6541
movl $0x1, %esi
movq %r14, %rdi
movl $0x23, %edx
xorl %eax, %eax
callq 0x5bec
xorl %edi, %edi
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x61e0
movl $0x1, %esi
movq %r14, %rdi
movl $0x23, %edx
xorl %eax, %eax
callq 0x5bec
xorl %ebx, %ebx
movq 0x10(%rsp), %r12
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x620d
xorl %ebx, %ebx
movl $0x1, %esi
movq %r14, %rdi
movl $0x20, %edx
xorl %eax, %eax
callq 0x5bec
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x67eb
cmpl $0x5, %eax
jne 0x67e2
movl %ebx, %ebp
cmpq $0x0, 0x18(%rsp)
je 0x67e4
testq %r12, %r12
movq 0x20(%rsp), %r15
je 0x67d4
xorl %ebx, %ebx
movq 0x18(%rsp), %rax
movq (%rax,%rbx,8), %rdi
callq 0x86c4
incq %rbx
cmpq %rbx, %r12
jne 0x67be
movq 0x18(%rsp), %rdi
callq 0x1030
xorl %ebx, %ebx
jmp 0x67eb
jmp 0x67f0
xorl %ebx, %ebx
movq 0x20(%rsp), %r15
movq %rbx, (%r15)
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x53b0
movq (%r14), %rdi
movq %r15, %rsi
callq 0x45b5
movq 0x8(%r14), %rax
movq 0x18(%rax), %rdx
movq 0x20(%rax), %rcx
movq 0x18(%rsp), %rdi
movq %r12, %rsi
callq 0x85d4
movq %rax, %rbx
xorl %ebp, %ebp
jmp 0x67e6
movq %rbx, %rdi
callq 0x170c
callq 0x173c