// File: /workspace/github_c_makefile_star2_O1/masyagin1998[P]GCI/src/bytecode-generator/bytecode-generator.c
// Function: body_ast_bytecode_generate
static enum BYTECODE_GENERATOR_CODES body_ast_bytecode_generate(bytecode_generator_type_t bc_gen, const struct BODY_AST*ast, int*loop_start_idx,
                                                                int**loop_exit_idxs, size_t*loop_exit_idxs_len, size_t*loop_exit_idxs_cap)
{    
    size_t i;

    bc_gen->scope_depth++;

    for (i = 0; i < ast->stmts_len; i++) {
        enum BYTECODE_GENERATOR_CODES r = stmt_ast_bytecode_generate(bc_gen, ast->stmts[i], loop_start_idx,
                                                                     loop_exit_idxs, loop_exit_idxs_len, loop_exit_idxs_cap);
        if (r != BYTECODE_GENERATOR_OK) {
            return r;
        }
    }

    bc_gen->scope_depth--;

    while ((bc_gen->locals_len > 0) &&
           (bc_gen->locals[bc_gen->locals_len - 1].depth >
            bc_gen->scope_depth)) {
        PUSH_BACK(bc_gen->bc->op_codes, BC_OP_POP);
        bc_gen->locals_len--;
    }

    return BYTECODE_GENERATOR_OK;    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %r9, 0x8(%rsp)
movq %r8, 0x28(%rsp)
movq %rcx, 0x10(%rsp)
movq %rdi, %rbx
incq 0x28(%rdi)
movq %rdx, 0x30(%rsp)
cmpq $0x0, 0x8(%rsi)
je 0xb7a0
movq %rsi, %r14
leaq 0x20(%rbx), %rax
movq %rax, 0x68(%rsp)
leaq 0x5267(%rip), %r13      # 0x1021c
xorl %r12d, %r12d
movq (%r14), %rax
movq (%rax,%r12,8), %rcx
movl 0x8(%rcx), %edi
cmpq $0x9, %rdi
ja 0xb85b
movslq (%r13,%rdi,4), %rdx
addq %r13, %rdx
xorl %eax, %eax
jmpq *%rdx
movq (%rcx), %r15
movq 0x8(%r15), %rsi
movq %rbx, %rdi
callq 0xbd1e
testl %eax, %eax
jne 0xb711
movq (%r15), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0xc1b6
cmpl $-0x1, %eax
je 0xb25f
movq 0x10(%rbx), %rcx
movl %eax, %eax
leaq (%rax,%rax,4), %rax
movq 0x20(%rcx,%rax,8), %rax
cmpq 0x28(%rbx), %rax
jne 0xb25f
movups 0x10(%r15), %xmm0
movups %xmm0, 0x40(%rbx)
movl $0xfffffffe, 0x58(%rbx) # imm = 0xFFFFFFFE
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
jmp 0xb70a
movq (%rcx), %r13
movq (%r13), %rsi
movq %rbx, %rdi
callq 0xc1f9
testl %eax, %eax
jne 0xb70a
movl $0x1c, %esi
movq %rbx, %rdi
callq 0xd531
movl %eax, 0x3c(%rsp)
movq 0x8(%rbx), %r15
movq 0x10(%r15), %rsi
cmpq %rsi, 0x8(%r15)
jne 0xb373
testq %rsi, %rsi
je 0xb355
leaq (%rsi,%rsi), %rax
movq %rax, 0x10(%r15)
movq (%r15), %rdi
shlq $0x4, %rsi
callq 0x1160
movq 0x8(%rbx), %rdi
movq %rax, (%rdi)
testq %rax, %rax
jne 0xb373
jmp 0xb883
movq (%rcx), %rax
movq (%rax), %rsi
testq %rsi, %rsi
je 0xb0c0
movq %rbx, %rdi
callq 0xbd1e
testl %eax, %eax
jne 0xb711
movq 0x8(%rbx), %r15
movq 0x10(%r15), %rsi
cmpq %rsi, 0x8(%r15)
jne 0xb337
testq %rsi, %rsi
je 0xb319
leaq (%rsi,%rsi), %rax
movq %rax, 0x10(%r15)
movq (%r15), %rdi
shlq $0x4, %rsi
callq 0x1160
movq 0x8(%rbx), %rdi
movq %rax, (%rdi)
testq %rax, %rax
jne 0xb337
jmp 0xb86a
movq (%rcx), %r15
movq 0x8(%r15), %rsi
movq %rbx, %rdi
callq 0xbd1e
testl %eax, %eax
jne 0xb711
movq (%r15), %rsi
movq %rbx, %rdi
movl $0x1, %edx
callq 0xcfba
jmp 0xb711
cmpq $0x0, 0x10(%rsp)
je 0xb229
movl $0x1d, %esi
movq %rbx, %rdi
callq 0xd531
movl %eax, %r13d
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0x28(%rsp), %rax
cmpq %rsi, (%rax)
jne 0xb2fa
testq %rsi, %rsi
je 0xb2d3
leaq (%rsi,%rsi), %rax
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
movq 0x10(%rsp), %r15
movq (%r15), %rdi
shlq $0x3, %rsi
callq 0x1160
movq %rax, (%r15)
testq %rax, %rax
jne 0xb2fa
jmp 0xb860
movq (%rcx), %r13
xorl %eax, %eax
movq %rax, 0x40(%rsp)
movq %rax, 0x70(%rsp)
movq %rax, 0x18(%rsp)
movq 0x8(%rbx), %rax
movl 0x8(%rax), %eax
movl %eax, 0x24(%rsp)
movq (%r13), %rsi
movq %rbx, %rdi
callq 0xc1f9
testl %eax, %eax
jne 0xb70a
movq 0x18(%rsp), %rsi
cmpq %rsi, 0x70(%rsp)
jne 0xb43c
testq %rsi, %rsi
je 0xb41b
leaq (%rsi,%rsi), %rax
movq %rax, 0x18(%rsp)
movq 0x40(%rsp), %rdi
shlq $0x3, %rsi
callq 0x1160
movq %rax, 0x40(%rsp)
testq %rax, %rax
jne 0xb43c
jmp 0xb874
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0xb244
movslq (%rax), %rsi
movq %rbx, %rdi
callq 0xd626
jmp 0xb34e
movq (%rcx), %rax
movups (%rax), %xmm0
movups %xmm0, 0x40(%rbx)
movl $0xfffffffd, 0x58(%rbx) # imm = 0xFFFFFFFD
movl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
jmp 0xb711
movq (%rcx), %rax
movups (%rax), %xmm0
movups %xmm0, 0x40(%rbx)
movl $0xfffffffc, 0x58(%rbx) # imm = 0xFFFFFFFC
movl $0xfffffffc, %eax       # imm = 0xFFFFFFFC
jmp 0xb711
movq 0x28(%rbx), %r15
movl $0x20, %edx
leaq 0x70(%rsp), %rdi
movq %r13, %rsi
callq 0x1040
movq %r15, 0x60(%rsp)
movups 0x70(%rsp), %xmm0
movups 0x80(%rsp), %xmm1
movaps %xmm0, 0x40(%rsp)
movaps %xmm1, 0x50(%rsp)
movq 0x20(%rbx), %rax
cmpq %rax, 0x18(%rbx)
jne 0xb581
testq %rax, %rax
je 0xb562
leaq (%rax,%rax), %rcx
movq %rcx, 0x20(%rbx)
movq 0x10(%rbx), %rdi
shlq $0x4, %rax
leaq (%rax,%rax,4), %rsi
callq 0x1160
movq %rax, 0x10(%rbx)
testq %rax, %rax
jne 0xb581
jmp 0xb88d
movq 0x8(%rsp), %rax
movq $0x1, (%rax)
movl $0x4, %edi
callq 0x1130
movq 0x10(%rsp), %rcx
movq %rax, (%rcx)
testq %rax, %rax
je 0xb86f
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq 0x28(%rsp), %rdx
movq (%rdx), %rcx
movl %r13d, (%rax,%rcx,4)
incq %rcx
movq %rcx, (%rdx)
jmp 0xb708
movq $0x1, 0x10(%r15)
movl $0x8, %edi
callq 0x1130
movq %rax, (%r15)
testq %rax, %rax
je 0xb888
movq 0x8(%rbx), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rdx
movq $0x1e, (%rcx,%rdx,8)
incq 0x8(%rax)
xorl %eax, %eax
jmp 0xb711
movq $0x1, 0x10(%r15)
movl $0x8, %edi
callq 0x1130
movq %rax, (%r15)
testq %rax, %rax
je 0xb8ab
movq 0x8(%rbx), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rdx
movq $0x0, (%rcx,%rdx,8)
incq 0x8(%rax)
movq 0x8(%r13), %rsi
movq %rbx, %rdi
movq 0x30(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq 0x28(%rsp), %r8
movq 0x8(%rsp), %r9
callq 0xaf6b
testl %eax, %eax
jne 0xb70a
movl $0x1d, %esi
movq %rbx, %rdi
callq 0xd531
movl %eax, 0x38(%rsp)
movslq 0x3c(%rsp), %rax
movq 0x8(%rbx), %r15
movl %eax, %ecx
notl %ecx
addl 0x8(%r15), %ecx
movslq %ecx, %rcx
movq (%r15), %rdi
movq %rcx, (%rdi,%rax,8)
movq 0x10(%r15), %rsi
cmpq %rsi, 0x8(%r15)
jne 0xb6ae
testq %rsi, %rsi
je 0xb690
leaq (%rsi,%rsi), %rax
movq %rax, 0x10(%r15)
shlq $0x4, %rsi
callq 0x1160
movq 0x8(%rbx), %rdi
movq %rax, (%rdi)
testq %rax, %rax
jne 0xb6ae
jmp 0xb8c4
movq $0x1, 0x18(%rsp)
movl $0x4, %edi
callq 0x1130
movq %rax, 0x40(%rsp)
testq %rax, %rax
je 0xb8a6
movl $0x1c, %esi
movq %rbx, %rdi
callq 0xd531
movq 0x40(%rsp), %rcx
movq 0x70(%rsp), %rdx
movl %eax, (%rcx,%rdx,4)
incq %rdx
movq %rdx, 0x70(%rsp)
movq 0x8(%rbx), %r15
movq 0x10(%r15), %rsi
cmpq %rsi, 0x8(%r15)
jne 0xb4b4
testq %rsi, %rsi
je 0xb496
leaq (%rsi,%rsi), %rax
movq %rax, 0x10(%r15)
movq (%r15), %rdi
shlq $0x4, %rsi
callq 0x1160
movq 0x8(%rbx), %rdi
movq %rax, (%rdi)
testq %rax, %rax
jne 0xb4b4
jmp 0xb87e
movq $0x1, 0x10(%r15)
movl $0x8, %edi
callq 0x1130
movq %rax, (%r15)
testq %rax, %rax
je 0xb8a1
movq 0x8(%rbx), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rdx
movq $0x0, (%rcx,%rdx,8)
incq 0x8(%rax)
movq 0x8(%r13), %rsi
movq %rbx, %rdi
leaq 0x24(%rsp), %rdx
leaq 0x40(%rsp), %rcx
leaq 0x70(%rsp), %r8
leaq 0x18(%rsp), %r9
callq 0xaf6b
testl %eax, %eax
jne 0xb70a
movslq 0x24(%rsp), %rsi
movq %rbx, %rdi
callq 0xd626
movq 0x40(%rsp), %rax
movslq (%rax), %rax
movq 0x8(%rbx), %r15
movl %eax, %ecx
notl %ecx
addl 0x8(%r15), %ecx
movslq %ecx, %rcx
movq (%r15), %rdi
movq %rcx, (%rdi,%rax,8)
movq 0x10(%r15), %rsi
cmpq %rsi, 0x8(%r15)
leaq 0x4cef(%rip), %r13      # 0x1021c
jne 0xb749
testq %rsi, %rsi
je 0xb72b
leaq (%rsi,%rsi), %rax
movq %rax, 0x10(%r15)
shlq $0x4, %rsi
callq 0x1160
movq 0x8(%rbx), %rdi
movq %rax, (%rdi)
testq %rax, %rax
jne 0xb749
jmp 0xb8bf
movq $0x1, 0x20(%rbx)
movl $0x28, %edi
callq 0x1130
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0xb8ba
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %rcx
leaq (%rcx,%rcx,4), %rcx
movq 0x60(%rsp), %rdx
movq %rdx, 0x20(%rax,%rcx,8)
movaps 0x40(%rsp), %xmm0
movaps 0x50(%rsp), %xmm1
movups %xmm1, 0x10(%rax,%rcx,8)
movups %xmm0, (%rax,%rcx,8)
movq 0x8(%rbx), %r15
movq 0x18(%rbx), %r13
leaq 0x1(%r13), %rax
movq %rax, 0x18(%rbx)
movq 0x10(%r15), %rsi
cmpq %rsi, 0x8(%r15)
jne 0xb60c
testq %rsi, %rsi
je 0xb5ee
leaq (%rsi,%rsi), %rax
movq %rax, 0x10(%r15)
movq (%r15), %rdi
shlq $0x4, %rsi
callq 0x1160
movq 0x8(%rbx), %rdi
movq %rax, (%rdi)
testq %rax, %rax
jne 0xb60c
jmp 0xb897
movq $0x1, 0x10(%r15)
movl $0x8, %edi
callq 0x1130
movq %rax, (%r15)
testq %rax, %rax
je 0xb8b5
movq 0x8(%rbx), %r15
movq (%r15), %rdi
movq 0x8(%r15), %rax
movq $0x4, (%rdi,%rax,8)
movq 0x8(%r15), %rax
movq 0x10(%r15), %rsi
incq %rax
movq %rax, 0x8(%r15)
cmpq %rsi, %rax
jne 0xb678
testq %rsi, %rsi
je 0xb65a
leaq (%rsi,%rsi), %rax
movq %rax, 0x10(%r15)
shlq $0x4, %rsi
callq 0x1160
movq 0x8(%rbx), %rdi
movq %rax, (%rdi)
testq %rax, %rax
jne 0xb678
jmp 0xb89c
movq $0x1, 0x10(%r15)
movl $0x8, %edi
callq 0x1130
movq %rax, (%r15)
testq %rax, %rax
je 0xb8b0
movslq %r13d, %rax
movq 0x8(%rbx), %rcx
movq (%rcx), %rdx
movq 0x8(%rcx), %rsi
movq %rax, (%rdx,%rsi,8)
incq 0x8(%rcx)
jmp 0xb708
movq $0x1, 0x10(%r15)
movl $0x8, %edi
callq 0x1130
movq %rax, (%r15)
testq %rax, %rax
je 0xb8ce
movq 0x8(%rbx), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rdx
movq $0x0, (%rcx,%rdx,8)
incq 0x8(%rax)
movq 0x10(%r13), %rsi
testq %rsi, %rsi
je 0xb6ee
movq %rbx, %rdi
movq 0x30(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq 0x28(%rsp), %r8
movq 0x8(%rsp), %r9
callq 0xaf6b
testl %eax, %eax
jne 0xb70a
movslq 0x38(%rsp), %rax
movq 0x8(%rbx), %rcx
movl %eax, %edx
notl %edx
addl 0x8(%rcx), %edx
movslq %edx, %rdx
movq (%rcx), %rcx
movq %rdx, (%rcx,%rax,8)
xorl %eax, %eax
leaq 0x4b0b(%rip), %r13      # 0x1021c
testl %eax, %eax
cmovnel %eax, %ebp
jne 0xb83d
incq %r12
cmpq 0x8(%r14), %r12
jb 0xafb8
jmp 0xb7a0
movq $0x1, 0x10(%r15)
movl $0x8, %edi
callq 0x1130
movq %rax, (%r15)
testq %rax, %rax
je 0xb8c9
movq 0x8(%rbx), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rdx
movq $0x0, (%rcx,%rdx,8)
incq 0x8(%rax)
cmpq $0x2, 0x70(%rsp)
jb 0xb791
movl $0x1, %edx
movq 0x40(%rsp), %rsi
movslq (%rsi,%rdx,4), %rdi
movl %edi, %r8d
notl %r8d
addl 0x8(%rax), %r8d
movslq %r8d, %r8
movq %r8, (%rcx,%rdi,8)
incq %rdx
cmpq 0x70(%rsp), %rdx
jb 0xb772
movq 0x40(%rsp), %rdi
callq 0x1030
jmp 0xb34e
decq 0x28(%rbx)
movq 0x18(%rbx), %rax
xorl %ebp, %ebp
testq %rax, %rax
je 0xb83d
movq 0x10(%rbx), %rcx
leaq (%rax,%rax,4), %rax
movq -0x8(%rcx,%rax,8), %rax
cmpq 0x28(%rbx), %rax
jbe 0xb83d
movq 0x8(%rbx), %r14
movq 0x10(%r14), %rsi
cmpq %rsi, 0x8(%r14)
jne 0xb815
testq %rsi, %rsi
je 0xb7fb
leaq (%rsi,%rsi), %rax
movq %rax, 0x10(%r14)
movq (%r14), %rdi
shlq $0x4, %rsi
callq 0x1160
movq 0x8(%rbx), %rdi
movq %rax, (%rdi)
testq %rax, %rax
jne 0xb815
jmp 0xb851
movq $0x1, 0x10(%r14)
movl $0x8, %edi
callq 0x1130
movq %rax, (%r14)
testq %rax, %rax
je 0xb856
movq 0x8(%rbx), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rdx
movq $0x0, (%rcx,%rdx,8)
incq 0x8(%rax)
movq 0x18(%rbx), %rax
decq %rax
movq %rax, 0x18(%rbx)
jne 0xb7b3
movl %ebp, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2a19
callq 0x2a51
callq 0x29f6
movq 0x8(%rsp), %rdi
callq 0x264b
callq 0x25e2
callq 0x2682
leaq 0x18(%rsp), %rdi
callq 0x26b3
callq 0x26ea
callq 0x27ed
callq 0x261a
movq 0x68(%rsp), %rdi
callq 0x28bf
callq 0x28f3
callq 0x292b
callq 0x278b
callq 0x27bc
callq 0x288e
callq 0x2963
callq 0x2994
callq 0x29c5
callq 0x2722
callq 0x2825
callq 0x275a
callq 0x285d