// File: /workspace/github_c_makefile_star2_O1/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, %r14
movq %rdi, %r15
movq (%rsi), %rax
movq (%rax), %rsi
callq 0xcb57
testl %eax, %eax
jne 0xcb25
xorl %eax, %eax
cmpq $0x2, 0x10(%r14)
jb 0xcb25
leaq 0x8(%r15), %r12
movl $0x1, %r13d
movq (%r14), %rax
movq (%rax,%r13,8), %rsi
movq %r15, %rdi
callq 0xcb57
testl %eax, %eax
jne 0xcb25
movq 0x8(%r14), %rax
movl -0x4(%rax,%r13,4), %edi
cmpl $0x2, %edi
je 0xca71
cmpl $0x1, %edi
je 0xca2c
testl %edi, %edi
jne 0xcb34
movq (%r12), %rbx
movq 0x10(%rbx), %rsi
movl $0x16, %ebp
cmpq %rsi, 0x8(%rbx)
jne 0xcb03
testq %rsi, %rsi
je 0xcae9
leaq (%rsi,%rsi), %rax
movq %rax, 0x10(%rbx)
movq (%rbx), %rdi
shlq $0x4, %rsi
callq 0x1160
movq (%r12), %rdi
movq %rax, (%rdi)
testq %rax, %rax
jne 0xcb03
jmp 0xcb39
movq (%r12), %rbx
movq 0x10(%rbx), %rsi
movl $0x17, %ebp
cmpq %rsi, 0x8(%rbx)
jne 0xcb03
testq %rsi, %rsi
je 0xcaae
leaq (%rsi,%rsi), %rax
movq %rax, 0x10(%rbx)
movq (%rbx), %rdi
shlq $0x4, %rsi
callq 0x1160
movq (%r12), %rdi
movq %rax, (%rdi)
testq %rax, %rax
jne 0xcb03
jmp 0xcb3e
movq (%r12), %rbx
movq 0x10(%rbx), %rsi
movl $0x18, %ebp
cmpq %rsi, 0x8(%rbx)
jne 0xcb03
testq %rsi, %rsi
je 0xcacd
leaq (%rsi,%rsi), %rax
movq %rax, 0x10(%rbx)
movq (%rbx), %rdi
shlq $0x4, %rsi
callq 0x1160
movq (%r12), %rdi
movq %rax, (%rdi)
testq %rax, %rax
jne 0xcb03
jmp 0xcb43
movq $0x1, 0x10(%rbx)
movl $0x8, %edi
callq 0x1130
movq %rax, (%rbx)
testq %rax, %rax
jne 0xcb03
jmp 0xcb52
movq $0x1, 0x10(%rbx)
movl $0x8, %edi
callq 0x1130
movq %rax, (%rbx)
testq %rax, %rax
jne 0xcb03
jmp 0xcb48
movq $0x1, 0x10(%rbx)
movl $0x8, %edi
callq 0x1130
movq %rax, (%rbx)
testq %rax, %rax
je 0xcb4d
movq (%r12), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rdx
movq %rbp, (%rcx,%rdx,8)
incq 0x8(%rax)
incq %r13
cmpq 0x10(%r14), %r13
jb 0xc9ad
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x33d4
callq 0x336b
callq 0x3302
callq 0x3299
callq 0x32d1
callq 0x33a3
callq 0x333a