// File: /workspace/github_c_makefile_star2_O2/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 0x3621
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x37ee
movq 0x8(%rbx), %rdi
callq 0x38a4
movq 0x10(%rbx), %rdi
callq 0x3608
movl 0x18(%rbx), %eax
decl %eax
cmpl $0x5, %eax
ja 0x37b5
leaq 0x5e7c(%rip), %rcx      # 0x94c4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x62d3(%rip), %rdi      # 0x992b
callq 0x1070
leaq 0x62eb(%rip), %rdi      # 0x994f
callq 0x1070
movq 0xaaa8(%rip), %rdi      # 0xe118
callq 0x82ab
movl %eax, %ebp
movq 0xaa9a(%rip), %rdi      # 0xe118
callq 0x82e0
cmpl $0x1, %ebp
je 0x37bc
cmpl $0x8, %ebp
jne 0x37c5
leaq 0x61ff(%rip), %rbx      # 0x989b
jmp 0x37d7
leaq 0x6283(%rip), %rdi      # 0x992b
callq 0x1070
leaq 0x629b(%rip), %rdi      # 0x994f
callq 0x1070
leaq 0x6204(%rip), %rdi      # 0x98c4
jmp 0x37aa
leaq 0x625f(%rip), %rdi      # 0x992b
callq 0x1070
leaq 0x6083(%rip), %rdi      # 0x975b
callq 0x1070
leaq 0x6081(%rip), %rdi      # 0x9765
callq 0x1070
leaq 0x610f(%rip), %rdi      # 0x97ff
callq 0x1070
leaq 0x6109(%rip), %rdi      # 0x9805
callq 0x1070
leaq 0x606e(%rip), %rdi      # 0x9776
jmp 0x37aa
leaq 0x6217(%rip), %rdi      # 0x992b
callq 0x1070
leaq 0x603b(%rip), %rdi      # 0x975b
callq 0x1070
leaq 0x6039(%rip), %rdi      # 0x9765
callq 0x1070
leaq 0x60c7(%rip), %rdi      # 0x97ff
callq 0x1070
leaq 0x60c1(%rip), %rdi      # 0x9805
callq 0x1070
leaq 0x5ffa(%rip), %rdi      # 0x974a
jmp 0x37aa
leaq 0x61d2(%rip), %rdi      # 0x992b
callq 0x1070
leaq 0x61ea(%rip), %rdi      # 0x994f
callq 0x1070
leaq 0x6016(%rip), %rdi      # 0x9787
callq 0x1070
leaq 0x601b(%rip), %rdi      # 0x9798
callq 0x1070
leaq 0x60da(%rip), %rdi      # 0x9863
jmp 0x37aa
leaq 0x6199(%rip), %rdi      # 0x992b
callq 0x1070
leaq 0x61b1(%rip), %rdi      # 0x994f
callq 0x1070
leaq 0x60e4(%rip), %rdi      # 0x988e
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1070
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x5f83(%rip), %rbx      # 0x9746
jmp 0x37d7
leaq 0x5f02(%rip), %rdi      # 0x96ce
xorl %ebx, %ebx
movl %ebp, %esi
xorl %eax, %eax
callq 0x80a8
leaq 0x5e5b(%rip), %rdi      # 0x9639
movq %rbx, %rsi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x10a0