// File: /workspace/github_c_makefile_star2_O2/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 0x3a1d
movq %r13, 0x8(%rsp)
leaq 0x8(%r12), %r13
callq 0x297c
movq (%r12), %rdi
movq %r13, %rsi
callq 0x1c9f
movq $0x0, 0x28(%rsp)
pushq $-0x1
popq %rax
movl %eax, 0x4(%rsp)
xorl %r15d, %r15d
xorl %r14d, %r14d
movq (%r13), %rdi
movl (%rdi), %eax
leal -0x1(%rax), %ecx
cmpl $0xb, %ecx
ja 0x3ac4
leaq 0xb39c(%rip), %rdx      # 0xe794
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
callq 0x297c
movq (%r12), %rdi
movq %r13, %rsi
callq 0x1c9f
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
callq 0x332c
testl %eax, %eax
jne 0x3beb
movq (%r13), %rdi
cmpl $0x15, (%rdi)
jne 0x3b51
callq 0x297c
movq (%r12), %rdi
movq %r13, %rsi
callq 0x1c9f
movq %r12, %rdi
leaq 0x18(%rsp), %rsi
callq 0x3f90
testl %eax, %eax
jne 0x3bb2
movq (%r13), %rdi
cmpl $0x23, (%rdi)
jne 0x3b95
callq 0x297c
movq (%r12), %rdi
movq %r13, %rsi
callq 0x1c9f
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x8(%r12), %rax
movq 0x18(%rax), %rdx
movq 0x20(%rax), %rcx
callq 0x5db5
movq %rax, %rdi
xorl %esi, %esi
jmp 0x391c
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
callq 0x428e
testl %eax, %eax
jne 0x3be7
movq 0x10(%rsp), %rdi
pushq $0x3
jmp 0x391b
callq 0x297c
movq (%r12), %rdi
movq %r13, %rsi
callq 0x1c9f
movq 0x8(%r12), %rdi
cmpl $0x23, (%rdi)
jne 0x38c9
xorl %ebx, %ebx
jmp 0x38f0
callq 0x297c
movq (%r12), %rdi
movq %r13, %rsi
callq 0x1c9f
movq 0x8(%r12), %rdi
cmpl $0x1b, (%rdi)
jne 0x3b47
callq 0x297c
movq (%r12), %rdi
movq %r13, %rsi
callq 0x1c9f
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
callq 0x464d
testl %eax, %eax
jne 0x3be7
movq (%r13), %rdi
cmpl $0x1c, (%rdi)
jne 0x3b72
callq 0x297c
movq (%r12), %rdi
movq %r13, %rsi
callq 0x1c9f
movq %r12, %rdi
leaq 0x18(%rsp), %rsi
callq 0x338d
testl %eax, %eax
jne 0x3b85
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq (%r13), %rax
movq 0x18(%rax), %rdx
movq 0x20(%rax), %rcx
callq 0x6459
movq %rax, %rdi
pushq $0x4
jmp 0x391b
movq %r15, 0x20(%rsp)
movq 0x18(%rdi), %rbx
movq 0x20(%rdi), %rbp
callq 0x297c
movq (%r12), %rdi
movq %r13, %rsi
callq 0x1c9f
movq 0x8(%r12), %rdi
cmpl $0x23, (%rdi)
jne 0x3a3e
callq 0x297c
movq (%r12), %rdi
movq %r13, %rsi
callq 0x1c9f
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x6655
movq %rax, %rdi
pushq $0x6
jmp 0x361e
movq %r15, 0x20(%rsp)
movq 0x18(%rdi), %rbx
movq 0x20(%rdi), %rbp
callq 0x297c
movq (%r12), %rdi
movq %r13, %rsi
callq 0x1c9f
movq 0x8(%r12), %rdi
cmpl $0x23, (%rdi)
jne 0x3a3e
callq 0x297c
movq (%r12), %rdi
movq %r13, %rsi
callq 0x1c9f
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x65c9
movq %rax, %rdi
pushq $0x5
popq %rsi
callq 0x5bb5
movq %rax, %rbx
movq 0x20(%rsp), %r15
jmp 0x3924
movq %r14, 0x20(%rsp)
movq 0x18(%rdi), %rbp
movq 0x20(%rdi), %r14
callq 0x297c
movq (%r12), %rdi
movq %r13, %rsi
callq 0x1c9f
movq 0x8(%r12), %rdi
cmpl $0x1b, (%rdi)
jne 0x3a37
callq 0x297c
movq (%r12), %rdi
movq %r13, %rsi
callq 0x1c9f
movq %r12, %rdi
leaq 0x18(%rsp), %rsi
callq 0x332c
testl %eax, %eax
jne 0x3beb
movq 0x18(%rsp), %rbx
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0x3db4
testl %eax, %eax
jne 0x3a64
andq $0x0, 0x18(%rsp)
movq (%r13), %rdi
cmpl $0x22, (%rdi)
jne 0x3a6a
callq 0x297c
movq (%r12), %rdi
movq %r13, %rsi
callq 0x1c9f
movq %r12, %rdi
leaq 0x18(%rsp), %rsi
callq 0x332c
testl %eax, %eax
jne 0x3a7e
movq (%r13), %rdi
cmpl $0x1c, (%rdi)
jne 0x3a6e
callq 0x297c
movq (%r12), %rdi
movq %r13, %rsi
callq 0x1c9f
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq %rbp, %rdx
movq %r14, %rcx
callq 0x66e1
movq 0x8(%r12), %rdi
cmpl $0x23, (%rdi)
jne 0x3aaf
movq %rax, %rbx
callq 0x297c
movq (%r12), %rdi
movq %r13, %rsi
callq 0x1c9f
movq %rbx, %rdi
pushq $0x7
jmp 0x383e
movq %r14, 0x20(%rsp)
movq 0x18(%rdi), %rbx
movq 0x20(%rdi), %rbp
callq 0x297c
movq (%r12), %rdi
movq %r13, %rsi
callq 0x1c9f
movq 0x8(%r12), %rdi
cmpl $0x1b, (%rdi)
jne 0x3a37
callq 0x297c
movq (%r12), %rdi
movq %r13, %rsi
callq 0x1c9f
movq %r12, %rdi
leaq 0x18(%rsp), %rsi
callq 0x332c
testl %eax, %eax
jne 0x3beb
movq %rbx, 0x30(%rsp)
movq 0x18(%rsp), %rbx
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0x3db4
testl %eax, %eax
jne 0x3a64
andq $0x0, 0x18(%rsp)
movq (%r13), %rdi
cmpl $0x22, (%rdi)
jne 0x3a6a
callq 0x297c
movq (%r12), %rdi
movq %r13, %rsi
callq 0x1c9f
movq %r12, %rdi
leaq 0x18(%rsp), %rsi
callq 0x332c
testl %eax, %eax
jne 0x3a7e
movq (%r13), %rdi
cmpl $0x1c, (%rdi)
jne 0x3a6e
callq 0x297c
movq (%r12), %rdi
movq %r13, %rsi
callq 0x1c9f
movq 0x8(%r12), %rdi
cmpl $0x23, (%rdi)
jne 0x3aaf
callq 0x297c
movq (%r12), %rdi
movq %r13, %rsi
callq 0x1c9f
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq %rbp, %rcx
callq 0x67f4
movq %rax, %rdi
pushq $0x8
popq %rsi
callq 0x5bb5
movq %rax, %rbx
movq 0x20(%rsp), %r14
jmp 0x3924
movq %r14, 0x20(%rsp)
leaq 0x58(%rdi), %rax
movq 0x18(%rdi), %rsi
movq 0x20(%rdi), %rdx
movq %rax, %rdi
callq 0x843b
movq %rax, %rbx
movq 0x8(%r12), %rdi
callq 0x297c
movq (%r12), %rdi
movq %r13, %rsi
callq 0x1c9f
movq 0x8(%r12), %rax
cmpl $0x1b, (%rax)
jne 0x3981
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0x3cd3
testl %eax, %eax
jne 0x3b38
movq 0x10(%rsp), %rdi
movq (%r13), %rax
movq 0x18(%rax), %rsi
movq 0x20(%rax), %rdx
callq 0x60d1
movq %rax, %rdi
pushq $0x2
jmp 0x39ec
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
callq 0x3f90
testl %eax, %eax
jne 0x3be7
movq (%r13), %rdi
cmpl $0x23, (%rdi)
jne 0x3c37
movq 0x10(%rsp), %rbx
callq 0x297c
movq (%r12), %rdi
movq %r13, %rsi
callq 0x1c9f
movq 0x8(%r12), %rax
movq 0x18(%rax), %rsi
movq 0x20(%rax), %rdx
movq %rbx, %rdi
callq 0x6907
movq %rax, %rdi
pushq $0x9
popq %rsi
callq 0x5bb5
movq %rax, %rbx
cmpq %r14, %r15
jne 0x3970
testq %r15, %r15
je 0x3956
movq %r15, %rbp
shlq $0x4, %rbp
movq 0x28(%rsp), %rdi
movq %rbp, %rsi
callq 0x1160
movq %rax, 0x28(%rsp)
testq %rax, %rax
je 0x3c81
leaq (%r15,%r15), %r14
jmp 0x3970
pushq $0x8
popq %rdi
callq 0x1130
movq %rax, 0x28(%rsp)
testq %rax, %rax
je 0x3ca3
pushq $0x1
popq %r14
movq 0x28(%rsp), %rax
movq %rbx, (%rax,%r15,8)
incq %r15
jmp 0x33df
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0x3db4
testl %eax, %eax
jne 0x3b38
movq (%r13), %rdi
cmpl $0x15, (%rdi)
jne 0x3bc2
callq 0x297c
movq (%r12), %rdi
movq %r13, %rsi
callq 0x1c9f
movq %r12, %rdi
leaq 0x18(%rsp), %rsi
callq 0x3f90
testl %eax, %eax
jne 0x3c64
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq (%r13), %rax
movq 0x18(%rax), %rdx
movq 0x20(%rax), %rcx
callq 0x5f51
movq %rax, %rdi
pushq $0x1
popq %rsi
callq 0x5bb5
movq %rax, %rbx
movq (%r13), %rdi
cmpl $0x23, (%rdi)
movq 0x20(%rsp), %r14
jne 0x3b63
callq 0x297c
movq (%r12), %rdi
movq %r13, %rsi
callq 0x1c9f
jmp 0x3924
pushq $-0x1
popq %rbp
xorl %ebx, %ebx
pushq $0x1
popq %rsi
pushq $0x20
popq %rdx
movq %r12, %rdi
xorl %eax, %eax
callq 0x3273
jmp 0x3c22
pushq $0x1
popq %rsi
pushq $0x1b
jmp 0x3ab4
pushq $0x1
popq %rsi
pushq $0x23
popq %rdx
movq %r12, %rdi
xorl %eax, %eax
callq 0x3273
pushq $-0x1
popq %rax
movl %eax, 0x4(%rsp)
movq 0x8(%rsp), %r13
movq 0x20(%rsp), %r15
jmp 0x3bf0
movl %eax, 0x4(%rsp)
jmp 0x3a94
pushq $0x22
jmp 0x3a70
pushq $0x1c
popq %rdx
pushq $0x1
popq %rsi
movq %r12, %rdi
xorl %eax, %eax
callq 0x3273
movq 0x10(%rsp), %rdi
callq 0x6093
pushq $-0x1
popq %rax
movl %eax, 0x4(%rsp)
movq 0x18(%rsp), %rbx
testq %rbx, %rbx
movq 0x8(%rsp), %r13
je 0x3bf0
movq %rbx, %rdi
callq 0x588a
jmp 0x3bf0
pushq $0x1
popq %rsi
pushq $0x23
popq %rdx
movq %r12, %rdi
xorl %eax, %eax
callq 0x3273
jmp 0x3beb
cmpl $0x21, %eax
jne 0x3b03
callq 0x297c
movq (%r12), %rdi
movq %r13, %rsi
callq 0x1c9f
movq 0x8(%r12), %rax
movq 0x18(%rax), %rdx
movq 0x20(%rax), %rcx
movq 0x28(%rsp), %rdi
movq %r15, %rsi
callq 0x5a07
movq %rax, %rbx
xorl %ebp, %ebp
movq 0x8(%rsp), %r13
jmp 0x3c22
subq $0x8, %rsp
pushq $0x9
popq %rsi
pushq $0x1
popq %rdx
pushq $0xc
popq %rcx
pushq $0x2
popq %r8
pushq $0x4
popq %r9
movq %r12, %rdi
movl $0x0, %eax
pushq $0xb
pushq $0x8
pushq $0x7
pushq $0x6
pushq $0x5
callq 0x3273
addq $0x30, %rsp
jmp 0x3be4
movl %eax, %ebp
movq %rbx, %rdi
callq 0x588a
jmp 0x3c78
pushq $0x1
popq %rsi
pushq $0x1b
jmp 0x3bd9
pushq $0x1
popq %rsi
pushq $0x15
popq %rdx
movq %r12, %rdi
xorl %eax, %eax
callq 0x3273
jmp 0x3baf
movq %rbx, %rdi
callq 0x5b17
pushq $0x1
popq %rsi
pushq $0x23
jmp 0x3bd9
pushq $0x1
popq %rsi
pushq $0x1c
popq %rdx
movq %r12, %rdi
xorl %eax, %eax
callq 0x3273
pushq $-0x1
popq %rax
movl %eax, 0x4(%rsp)
movq 0x10(%rsp), %rdi
callq 0x6424
jmp 0x3beb
pushq $0x1
popq %rsi
pushq $0x23
popq %rdx
movq %r12, %rdi
xorl %eax, %eax
callq 0x3273
movq 0x18(%rsp), %rdi
callq 0x5ef7
pushq $-0x1
popq %rax
movl %eax, 0x4(%rsp)
movq 0x10(%rsp), %rdi
callq 0x588a
jmp 0x3beb
movq %rbx, %rdi
callq 0x588a
movq 0x10(%rsp), %rdi
callq 0x6093
pushq $0x1
popq %rsi
pushq $0x15
popq %rdx
movq %r12, %rdi
xorl %eax, %eax
callq 0x3273
pushq $-0x1
popq %rax
movl %eax, 0x4(%rsp)
movq 0x8(%rsp), %r13
cmpq $0x0, 0x28(%rsp)
je 0x3c1c
xorl %ebx, %ebx
cmpq %rbx, %r15
je 0x3c12
movq 0x28(%rsp), %rax
movq (%rax,%rbx,8), %rdi
callq 0x5b17
incq %rbx
jmp 0x3bfa
movq 0x28(%rsp), %rdi
callq 0x1030
xorl %ebx, %ebx
movl 0x4(%rsp), %ebp
movq %rbx, (%r13)
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x1
popq %rsi
pushq $0x23
popq %rdx
movq %r12, %rdi
xorl %eax, %eax
callq 0x3273
movq 0x10(%rsp), %rdi
pushq $-0x1
popq %rax
movl %eax, 0x4(%rsp)
testq %rdi, %rdi
movq 0x8(%rsp), %r13
je 0x3bf0
callq 0x5ef7
jmp 0x3bf0
movl %eax, %ebp
movq %rbx, %rdi
callq 0x588a
movq 0x10(%rsp), %rdi
callq 0x6093
movl %ebp, 0x4(%rsp)
jmp 0x3beb
movq 0x12368(%rip), %rax     # 0x15ff0
movq (%rax), %rdi
leaq 0xac5f(%rip), %rsi      # 0xe8f1
leaq 0xab2b(%rip), %rdx      # 0xe7c4
movl $0x6f1, %ecx            # imm = 0x6F1
movq %rbp, %r8
jmp 0x3cc4
movq 0x12346(%rip), %rax     # 0x15ff0
movq (%rax), %rdi
leaq 0xa90a(%rip), %rsi      # 0xe5be
leaq 0xab09(%rip), %rdx      # 0xe7c4
pushq $0x8
popq %r8
movl $0x6f1, %ecx            # imm = 0x6F1
xorl %eax, %eax
callq 0x1100
pushq $0x1
popq %rdi
callq 0x1180