// File: /workspace/github_c_makefile_star2_O3/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 0x3660
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x382d
movq 0x8(%rbx), %rdi
callq 0x38e3
movq 0x10(%rbx), %rdi
callq 0x3647
movl 0x18(%rbx), %eax
decl %eax
cmpl $0x5, %eax
ja 0x37f4
leaq 0x5e3d(%rip), %rcx      # 0x94c4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x6294(%rip), %rdi      # 0x992b
callq 0x1070
leaq 0x62ac(%rip), %rdi      # 0x994f
callq 0x1070
movq 0xaa69(%rip), %rdi      # 0xe118
callq 0x88ad
movl %eax, %ebp
movq 0xaa5b(%rip), %rdi      # 0xe118
callq 0x88c3
cmpl $0x1, %ebp
je 0x37fb
cmpl $0x8, %ebp
jne 0x3804
leaq 0x61c0(%rip), %rbx      # 0x989b
jmp 0x3816
leaq 0x6244(%rip), %rdi      # 0x992b
callq 0x1070
leaq 0x625c(%rip), %rdi      # 0x994f
callq 0x1070
leaq 0x61c5(%rip), %rdi      # 0x98c4
jmp 0x37e9
leaq 0x6220(%rip), %rdi      # 0x992b
callq 0x1070
leaq 0x6044(%rip), %rdi      # 0x975b
callq 0x1070
leaq 0x6042(%rip), %rdi      # 0x9765
callq 0x1070
leaq 0x60d0(%rip), %rdi      # 0x97ff
callq 0x1070
leaq 0x60ca(%rip), %rdi      # 0x9805
callq 0x1070
leaq 0x602f(%rip), %rdi      # 0x9776
jmp 0x37e9
leaq 0x61d8(%rip), %rdi      # 0x992b
callq 0x1070
leaq 0x5ffc(%rip), %rdi      # 0x975b
callq 0x1070
leaq 0x5ffa(%rip), %rdi      # 0x9765
callq 0x1070
leaq 0x6088(%rip), %rdi      # 0x97ff
callq 0x1070
leaq 0x6082(%rip), %rdi      # 0x9805
callq 0x1070
leaq 0x5fbb(%rip), %rdi      # 0x974a
jmp 0x37e9
leaq 0x6193(%rip), %rdi      # 0x992b
callq 0x1070
leaq 0x61ab(%rip), %rdi      # 0x994f
callq 0x1070
leaq 0x5fd7(%rip), %rdi      # 0x9787
callq 0x1070
leaq 0x5fdc(%rip), %rdi      # 0x9798
callq 0x1070
leaq 0x609b(%rip), %rdi      # 0x9863
jmp 0x37e9
leaq 0x615a(%rip), %rdi      # 0x992b
callq 0x1070
leaq 0x6172(%rip), %rdi      # 0x994f
callq 0x1070
leaq 0x60a5(%rip), %rdi      # 0x988e
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1070
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x5f44(%rip), %rbx      # 0x9746
jmp 0x3816
leaq 0x5ec3(%rip), %rdi      # 0x96ce
xorl %ebx, %ebx
movl %ebp, %esi
xorl %eax, %eax
callq 0x86ac
leaq 0x5e1c(%rip), %rdi      # 0x9639
movq %rbx, %rsi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x10a0