// File: /workspace/github_c_makefile_star2_O0/chgzm[P]minic/parser.c
// Function: create_multiplicative_expr_node
static MultiPlicativeExprNode* create_multiplicative_expr_node(const Vector* vec, int* index) {
    MultiPlicativeExprNode* multiplicative_expr_node = calloc(1, sizeof(MultiPlicativeExprNode));

    multiplicative_expr_node->operator_type  = OP_NONE;
    multiplicative_expr_node->cast_expr_node = create_cast_expr_node(vec, index);
    if (multiplicative_expr_node->cast_expr_node == NULL) {
        error("Failed to create cast-expression node.\n");
        return NULL;
    }

    MultiPlicativeExprNode* current = multiplicative_expr_node;
    const Token* token = vec->elements[*index];
    while (token->type == TK_ASTER || token->type == TK_SLASH || token->type == TK_PER) {
        ++(*index);

        MultiPlicativeExprNode* p_multiplicative_expr_node = malloc(sizeof(MultiPlicativeExprNode));
        p_multiplicative_expr_node->multiplicative_expr_node = current;
        p_multiplicative_expr_node->cast_expr_node           = create_cast_expr_node(vec, index);
        if (p_multiplicative_expr_node->cast_expr_node == NULL) {
            error("Failed to create cast-expression node.\n");
            return NULL;
        }

        if      (token->type == TK_ASTER) { p_multiplicative_expr_node->operator_type = OP_MUL; }
        else if (token->type == TK_SLASH) { p_multiplicative_expr_node->operator_type = OP_DIV; }
        else if (token->type == TK_PER)   { p_multiplicative_expr_node->operator_type = OP_MOD; }

        token = vec->elements[*index];
        current = p_multiplicative_expr_node;
    }

    return current;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x1, %edi
movl $0x18, %esi
callq 0x10b0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl $0x0, (%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x9c30
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x9afb
leaq 0x6912(%rip), %rdi      # 0x103f9
movb $0x0, %al
callq 0xe4e0
movq $0x0, -0x8(%rbp)
jmp 0x9c1a
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rcx
movb $0x1, %al
cmpl $0x1a, (%rcx)
movb %al, -0x39(%rbp)
je 0x9b42
movq -0x30(%rbp), %rcx
movb $0x1, %al
cmpl $0x1b, (%rcx)
movb %al, -0x39(%rbp)
je 0x9b42
movq -0x30(%rbp), %rax
cmpl $0x1d, (%rax)
sete %al
movb %al, -0x39(%rbp)
movb -0x39(%rbp), %al
testb $0x1, %al
jne 0x9b4e
jmp 0x9c12
movq -0x18(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movl $0x18, %edi
callq 0x10f0
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x9c30
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x9bae
leaq 0x685c(%rip), %rdi      # 0x103f9
movb $0x0, %al
callq 0xe4e0
movq $0x0, -0x8(%rbp)
jmp 0x9c1a
movq -0x30(%rbp), %rax
cmpl $0x1a, (%rax)
jne 0x9bc3
movq -0x38(%rbp), %rax
movl $0xd, (%rax)
jmp 0x9bef
movq -0x30(%rbp), %rax
cmpl $0x1b, (%rax)
jne 0x9bd8
movq -0x38(%rbp), %rax
movl $0xe, (%rax)
jmp 0x9bed
movq -0x30(%rbp), %rax
cmpl $0x1d, (%rax)
jne 0x9beb
movq -0x38(%rbp), %rax
movl $0xf, (%rax)
jmp 0x9bed
jmp 0x9bef
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x9b19
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)