// File: /workspace/github_c_makefile_star2_O1/chgzm[P]minic/generator.c
// Function: process_assign_expr
static void process_assign_expr(const AssignExprNode* node) {
    // <conditional-expression>
    if (node->conditional_expr_node != NULL) {
        process_conditional_expr(node->conditional_expr_node);
    }
    // <unary-expression> <assignment-operator> <assignment-expression>
    else {
        process_unary_expr_left(node->unary_expr_node);
        process_assign_expr(node->assign_expr_node);

        switch (node->assign_operator) {
        case OP_ASSIGN: {
            printf("  pop rdi\n");
            printf("  pop rax\n");

            const int size = intstack_top(size_stack); 
            intstack_pop(size_stack);
            printf("  mov [rax], %s\n", get_reg("di", size));

            break;
        }
        case OP_MUL_EQ: {
            printf("  pop rdi\n");
            printf("  pop rax\n");
            printf("  mov rsi, [rax]\n");
            printf("  imul rdi, rsi\n");
            printf("  mov [rax], rdi\n");

            break;
        }
        case OP_DIV_EQ: {
            printf("  pop rdi\n");
            printf("  pop rsi\n");
            printf("  mov rax, [rsi]\n");
            printf("  cqo\n");
            printf("  idiv rdi\n");
            printf("  mov [rsi], rax\n");

            break;
        }
        case OP_MOD_EQ: {
            printf("  pop rdi\n");
            printf("  pop rsi\n");
            printf("  mov rax, [rsi]\n");
            printf("  cqo\n");
            printf("  idiv rdi\n");
            printf("  mov [rsi], rdx\n");

            break;
        }
        case OP_ADD_EQ: {
            printf("  pop rdi\n");
            printf("  pop rax\n");
            printf("  add [rax], rdi\n");

            break;
        }
        case OP_SUB_EQ: {
            printf("  pop rdi\n");
            printf("  pop rax\n");
            printf("  sub [rax], rdi\n");

            break;
        }
        case OP_AND_EQ:
        case OP_XOR_EQ:
        case OP_OR_EQ: {
            // @todo
            break;
        }
        default: {
            break;
        }
        }
    }
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x351a
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x36e7
movq 0x8(%rbx), %rdi
callq 0x379d
movq 0x10(%rbx), %rdi
callq 0x3501
movl 0x18(%rbx), %eax
decl %eax
cmpl $0x5, %eax
ja 0x36ae
leaq 0x6f83(%rip), %rcx      # 0xa4c4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x73da(%rip), %rdi      # 0xa92b
callq 0x1070
leaq 0x73f2(%rip), %rdi      # 0xa94f
callq 0x1070
movq 0xbbaf(%rip), %rdi      # 0xf118
callq 0x8c79
movl %eax, %ebp
movq 0xbba1(%rip), %rdi      # 0xf118
callq 0x8c8f
cmpl $0x1, %ebp
je 0x36b5
cmpl $0x8, %ebp
jne 0x36be
leaq 0x7306(%rip), %rbx      # 0xa89b
jmp 0x36d0
leaq 0x738a(%rip), %rdi      # 0xa92b
callq 0x1070
leaq 0x73a2(%rip), %rdi      # 0xa94f
callq 0x1070
leaq 0x730b(%rip), %rdi      # 0xa8c4
jmp 0x36a3
leaq 0x7366(%rip), %rdi      # 0xa92b
callq 0x1070
leaq 0x718a(%rip), %rdi      # 0xa75b
callq 0x1070
leaq 0x7188(%rip), %rdi      # 0xa765
callq 0x1070
leaq 0x7216(%rip), %rdi      # 0xa7ff
callq 0x1070
leaq 0x7210(%rip), %rdi      # 0xa805
callq 0x1070
leaq 0x7175(%rip), %rdi      # 0xa776
jmp 0x36a3
leaq 0x731e(%rip), %rdi      # 0xa92b
callq 0x1070
leaq 0x7142(%rip), %rdi      # 0xa75b
callq 0x1070
leaq 0x7140(%rip), %rdi      # 0xa765
callq 0x1070
leaq 0x71ce(%rip), %rdi      # 0xa7ff
callq 0x1070
leaq 0x71c8(%rip), %rdi      # 0xa805
callq 0x1070
leaq 0x7101(%rip), %rdi      # 0xa74a
jmp 0x36a3
leaq 0x72d9(%rip), %rdi      # 0xa92b
callq 0x1070
leaq 0x72f1(%rip), %rdi      # 0xa94f
callq 0x1070
leaq 0x711d(%rip), %rdi      # 0xa787
callq 0x1070
leaq 0x7122(%rip), %rdi      # 0xa798
callq 0x1070
leaq 0x71e1(%rip), %rdi      # 0xa863
jmp 0x36a3
leaq 0x72a0(%rip), %rdi      # 0xa92b
callq 0x1070
leaq 0x72b8(%rip), %rdi      # 0xa94f
callq 0x1070
leaq 0x71eb(%rip), %rdi      # 0xa88e
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1070
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x708a(%rip), %rbx      # 0xa746
jmp 0x36d0
leaq 0x7009(%rip), %rdi      # 0xa6ce
xorl %ebx, %ebx
movl %ebp, %esi
xorl %eax, %eax
callq 0x8a7c
leaq 0x6f62(%rip), %rdi      # 0xa639
movq %rbx, %rsi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x10a0