// File: /workspace/github_c_makefile_star2_O2/masyagin1998[P]GCI/src/bytecode-generator/bytecode-generator.c
// Function: multiplicative_expr_ast_bytecode_generate
static enum BYTECODE_GENERATOR_CODES multiplicative_expr_ast_bytecode_generate(bytecode_generator_type_t bc_gen, const struct MULTIPLICATIVE_EXPR_AST*ast)
{
    size_t i;

    enum BYTECODE_GENERATOR_CODES r = left_unary_expr_ast_bytecode_generate(bc_gen, ast->lues[0]);
    if (r != BYTECODE_GENERATOR_OK) {
        return r;
    }
    for (i = 1; i < ast->lues_len; i++) {
        r = left_unary_expr_ast_bytecode_generate(bc_gen, ast->lues[i]);
        if (r != BYTECODE_GENERATOR_OK) {
            return r;
        }
        switch (ast->ops[i - 1]) {
        case AST_MULTIPLICATIVE_OP_MUL:
            PUSH_BACK(bc_gen->bc->op_codes, BC_OP_MULTIPLICATIVE_MUL);
            break;
        case AST_MULTIPLICATIVE_OP_DIV:
            PUSH_BACK(bc_gen->bc->op_codes, BC_OP_MULTIPLICATIVE_DIV);
            break;
        case AST_MULTIPLICATIVE_OP_MOD:
            PUSH_BACK(bc_gen->bc->op_codes, BC_OP_MULTIPLICATIVE_MOD);
            break;
        default:
            fprintf(stderr, "Invalid AST_MULTIPLICATIVE_OP type: %d\n", ast->ops[i - 1]);
            exit(EXIT_FAILURE);
            break;
        }
    }

    return BYTECODE_GENERATOR_OK;    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %rax
movq (%rax), %rsi
callq 0xab53
testl %eax, %eax
je 0xa8ac
movl %eax, %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x1
popq %r13
pushq $0x8
popq %r12
xorl %r15d, %r15d
cmpq 0x10(%rbx), %r13
jae 0xa89a
movq (%rbx), %rax
movq (%rax,%r13,8), %rsi
movq %r14, %rdi
callq 0xab53
testl %eax, %eax
jne 0xa897
movq 0x8(%rbx), %rax
movl -0x4(%rax,%r13,4), %edx
cmpl $0x2, %edx
je 0xa978
cmpl $0x1, %edx
je 0xa939
testl %edx, %edx
jne 0xaa5a
movq 0x8(%r14), %rbp
movq 0x8(%rbp), %rsi
cmpq 0x10(%rbp), %rsi
jne 0xa9c3
testq %rsi, %rsi
je 0xaa23
leaq (%rsi,%rsi), %rax
movq %rax, 0x10(%rbp)
movq (%rbp), %rdi
shlq $0x4, %rsi
callq 0x1160
movq 0x8(%r14), %rbp
movq %rax, (%rbp)
testq %rax, %rax
je 0xaabb
movq 0x8(%rbp), %rsi
jmp 0xaa42
movq 0x8(%r14), %rbp
movq 0x8(%rbp), %rsi
cmpq 0x10(%rbp), %rsi
jne 0xa9b7
testq %rsi, %rsi
je 0xa9c9
leaq (%rsi,%rsi), %rax
movq %rax, 0x10(%rbp)
movq (%rbp), %rdi
shlq $0x4, %rsi
callq 0x1160
movq 0x8(%r14), %rbp
movq %rax, (%rbp)
testq %rax, %rax
je 0xaa77
movq 0x8(%rbp), %rsi
jmp 0xa9e8
movq 0x8(%r14), %rbp
movq 0x8(%rbp), %rsi
cmpq 0x10(%rbp), %rsi
jne 0xa9bd
testq %rsi, %rsi
je 0xa9f6
leaq (%rsi,%rsi), %rax
movq %rax, 0x10(%rbp)
movq (%rbp), %rdi
shlq $0x4, %rsi
callq 0x1160
movq 0x8(%r14), %rbp
movq %rax, (%rbp)
testq %rax, %rax
je 0xaa99
movq 0x8(%rbp), %rsi
jmp 0xaa15
movq (%rbp), %rax
jmp 0xa9e8
movq (%rbp), %rax
jmp 0xaa15
movq (%rbp), %rax
jmp 0xaa42
movq $0x1, 0x10(%rbp)
movq %r12, %rdi
callq 0x1130
movq %rax, (%rbp)
testq %rax, %rax
je 0xaadd
xorl %esi, %esi
addq $0x8, %rbp
movq $0x17, (%rax,%rsi,8)
jmp 0xaa4e
movq $0x1, 0x10(%rbp)
movq %r12, %rdi
callq 0x1130
movq %rax, (%rbp)
testq %rax, %rax
je 0xab00
xorl %esi, %esi
addq $0x8, %rbp
movq $0x18, (%rax,%rsi,8)
jmp 0xaa4e
movq $0x1, 0x10(%rbp)
movq %r12, %rdi
callq 0x1130
movq %rax, (%rbp)
testq %rax, %rax
je 0xab23
xorl %esi, %esi
addq $0x8, %rbp
movq $0x16, (%rax,%rsi,8)
incq (%rbp)
incq %r13
jmp 0xa8b7
movq 0xb58f(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
leaq 0x4d66(%rip), %rsi      # 0xf7d1
xorl %eax, %eax
callq 0x1100
jmp 0xab4b
movq 0xb572(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
movq 0x10(%rbp), %r8
shlq $0x3, %r8
leaq 0x3e61(%rip), %rsi      # 0xe8f1
leaq 0x4881(%rip), %rdx      # 0xf318
jmp 0xaaf9
movq 0xb550(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
movq 0x10(%rbp), %r8
shlq $0x3, %r8
leaq 0x3e3f(%rip), %rsi      # 0xe8f1
leaq 0x485f(%rip), %rdx      # 0xf318
jmp 0xab1c
movq 0xb52e(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
movq 0x10(%rbp), %r8
shlq $0x3, %r8
leaq 0x3e1d(%rip), %rsi      # 0xe8f1
leaq 0x483d(%rip), %rdx      # 0xf318
jmp 0xab3f
movq 0xb50c(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
leaq 0x3ad0(%rip), %rsi      # 0xe5be
leaq 0x4823(%rip), %rdx      # 0xf318
pushq $0x8
popq %r8
movl $0x15c, %ecx            # imm = 0x15C
jmp 0xab44
movq 0xb4e9(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
leaq 0x3aad(%rip), %rsi      # 0xe5be
leaq 0x4800(%rip), %rdx      # 0xf318
pushq $0x8
popq %r8
movl $0x15f, %ecx            # imm = 0x15F
jmp 0xab44
movq 0xb4c6(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
leaq 0x3a8a(%rip), %rsi      # 0xe5be
leaq 0x47dd(%rip), %rdx      # 0xf318
pushq $0x8
popq %r8
movl $0x159, %ecx            # imm = 0x159
xorl %eax, %eax
callq 0x1100
pushq $0x1
popq %rdi
callq 0x1180