// File: Eronana[P]strawberry/src/ast_codegen.cpp
// Function: AST_AssignmentExpression::codeGen(Symbol*)
DEF_AST_METHOD(AssignmentExpression,AST_CODEGEN)
{
    bool isIdentifier=is_identifier(expr);
    if(isIdentifier&&GET_LITERAL(assignOptr).type==TOKEN_ASSIGN)
    {
        CODEGEN(assignExpr);
        storeVariant(symbol,expr);
        return;
    }
    CODEGEN(assignExpr);
    CODEGEN(expr);
    if(GET_LITERAL(assignOptr).type!=TOKEN_ASSIGN)PRINTF("swap\n");
    switch(GET_LITERAL(assignOptr).type)
    {
        case TOKEN_ASSIGN:
            PRINTF("pop\n");
            break;
        case TOKEN_MUL_ASSIGN:
            PRINTF("mul\n");
            break;
        case TOKEN_DIV_ASSIGN:
            PRINTF("div\n");
            break;
        case TOKEN_MOD_ASSIGN:
            PRINTF("mod\n");
            break;
        case TOKEN_ADD_ASSIGN:
            PRINTF("add\n");
            break;
        case TOKEN_SUB_ASSIGN:
            PRINTF("sub\n");
            break;
        case TOKEN_LEFT_SHIFT_ASSIGN:
            PRINTF("shl\n");
            break;
        case TOKEN_RIGHT_SHIFT_ASSIGN:
            PRINTF("shr\n");
            break;
        case TOKEN_BITWISE_AND_ASSIGN:
            PRINTF("and\n");
            break;
        case TOKEN_BITWISE_XOR_ASSIGN:
            PRINTF("xor\n");
            break;
        case TOKEN_BITWISE_OR_ASSIGN:
            PRINTF("or\n");
            break;
        default:
            break;
    }
    if(isIdentifier)storeVariant(symbol,expr);
    else PRINTF("object_reset\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
addq $0x8, %rdi
callq 0x52300
andb $0x1, %al
movb %al, -0x11(%rbp)
testb $0x1, -0x11(%rbp)
je 0x53d4f
movq -0x20(%rbp), %rdi
addq $0x10, %rdi
callq 0xabd0
cmpl $0x20, 0x8(%rax)
jne 0x53d4f
movq -0x20(%rbp), %rdi
addq $0x18, %rdi
callq 0x8f60
movq %rax, %rdi
movq -0x10(%rbp), %rsi
movq (%rdi), %rax
callq *0x18(%rax)
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rdi
addq $0x8, %rsi
callq 0x55530
jmp 0x5400d
movq -0x20(%rbp), %rdi
addq $0x18, %rdi
callq 0x8f60
movq %rax, %rdi
movq -0x10(%rbp), %rsi
movq (%rdi), %rax
callq *0x18(%rax)
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
callq 0x8f60
movq %rax, %rdi
movq -0x10(%rbp), %rsi
movq (%rdi), %rax
callq *0x18(%rax)
movq -0x20(%rbp), %rdi
addq $0x10, %rdi
callq 0xabd0
cmpl $0x20, 0x8(%rax)
je 0x53dbd
movl 0x36e74(%rip), %eax     # 0x8ac10
addl $0x1, %eax
movl %eax, 0x36e6b(%rip)     # 0x8ac10
leaq 0x36b3c(%rip), %rax     # 0x8a8e8
movq (%rax), %rdi
leaq 0x5a6f(%rip), %rsi      # 0x59825
movb $0x0, %al
callq 0x74c0
movq -0x20(%rbp), %rdi
addq $0x10, %rdi
callq 0xabd0
movl 0x8(%rax), %eax
addl $-0x3, %eax
movl %eax, %ecx
movq %rcx, -0x28(%rbp)
subl $0x22, %eax
ja 0x53fcb
movq -0x28(%rbp), %rax
leaq 0x58ea(%rip), %rcx      # 0x596d4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x36e17(%rip), %eax     # 0x8ac10
addl $0x1, %eax
movl %eax, 0x36e0e(%rip)     # 0x8ac10
leaq 0x36adf(%rip), %rax     # 0x8a8e8
movq (%rax), %rdi
leaq 0x59c4(%rip), %rsi      # 0x597d7
movb $0x0, %al
callq 0x74c0
jmp 0x53fcd
movl 0x36deb(%rip), %eax     # 0x8ac10
addl $0x1, %eax
movl %eax, 0x36de2(%rip)     # 0x8ac10
leaq 0x36ab3(%rip), %rax     # 0x8a8e8
movq (%rax), %rdi
leaq 0x5a4d(%rip), %rsi      # 0x5988c
movb $0x0, %al
callq 0x74c0
jmp 0x53fcd
movl 0x36dbf(%rip), %eax     # 0x8ac10
addl $0x1, %eax
movl %eax, 0x36db6(%rip)     # 0x8ac10
leaq 0x36a87(%rip), %rax     # 0x8a8e8
movq (%rax), %rdi
leaq 0x5a26(%rip), %rsi      # 0x59891
movb $0x0, %al
callq 0x74c0
jmp 0x53fcd
movl 0x36d93(%rip), %eax     # 0x8ac10
addl $0x1, %eax
movl %eax, 0x36d8a(%rip)     # 0x8ac10
leaq 0x36a5b(%rip), %rax     # 0x8a8e8
movq (%rax), %rdi
leaq 0x59ff(%rip), %rsi      # 0x59896
movb $0x0, %al
callq 0x74c0
jmp 0x53fcd
movl 0x36d67(%rip), %eax     # 0x8ac10
addl $0x1, %eax
movl %eax, 0x36d5e(%rip)     # 0x8ac10
leaq 0x36a2f(%rip), %rax     # 0x8a8e8
movq (%rax), %rdi
leaq 0x59d8(%rip), %rsi      # 0x5989b
movb $0x0, %al
callq 0x74c0
jmp 0x53fcd
movl 0x36d3b(%rip), %eax     # 0x8ac10
addl $0x1, %eax
movl %eax, 0x36d32(%rip)     # 0x8ac10
leaq 0x36a03(%rip), %rax     # 0x8a8e8
movq (%rax), %rdi
leaq 0x59b1(%rip), %rsi      # 0x598a0
movb $0x0, %al
callq 0x74c0
jmp 0x53fcd
movl 0x36d0f(%rip), %eax     # 0x8ac10
addl $0x1, %eax
movl %eax, 0x36d06(%rip)     # 0x8ac10
leaq 0x369d7(%rip), %rax     # 0x8a8e8
movq (%rax), %rdi
leaq 0x599a(%rip), %rsi      # 0x598b5
movb $0x0, %al
callq 0x74c0
jmp 0x53fcd
movl 0x36ce3(%rip), %eax     # 0x8ac10
addl $0x1, %eax
movl %eax, 0x36cda(%rip)     # 0x8ac10
leaq 0x369ab(%rip), %rax     # 0x8a8e8
movq (%rax), %rdi
leaq 0x5973(%rip), %rsi      # 0x598ba
movb $0x0, %al
callq 0x74c0
jmp 0x53fcd
movl 0x36cba(%rip), %eax     # 0x8ac10
addl $0x1, %eax
movl %eax, 0x36cb1(%rip)     # 0x8ac10
leaq 0x36982(%rip), %rax     # 0x8a8e8
movq (%rax), %rdi
leaq 0x5936(%rip), %rsi      # 0x598a6
movb $0x0, %al
callq 0x74c0
jmp 0x53fcd
movl 0x36c91(%rip), %eax     # 0x8ac10
addl $0x1, %eax
movl %eax, 0x36c88(%rip)     # 0x8ac10
leaq 0x36959(%rip), %rax     # 0x8a8e8
movq (%rax), %rdi
leaq 0x5912(%rip), %rsi      # 0x598ab
movb $0x0, %al
callq 0x74c0
jmp 0x53fcd
movl 0x36c68(%rip), %eax     # 0x8ac10
addl $0x1, %eax
movl %eax, 0x36c5f(%rip)     # 0x8ac10
leaq 0x36930(%rip), %rax     # 0x8a8e8
movq (%rax), %rdi
leaq 0x58ef(%rip), %rsi      # 0x598b1
movb $0x0, %al
callq 0x74c0
jmp 0x53fcd
jmp 0x53fcd
testb $0x1, -0x11(%rbp)
je 0x53fe6
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rdi
addq $0x8, %rsi
callq 0x55530
jmp 0x5400d
movl 0x36c24(%rip), %eax     # 0x8ac10
addl $0x1, %eax
movl %eax, 0x36c1b(%rip)     # 0x8ac10
leaq 0x368ec(%rip), %rax     # 0x8a8e8
movq (%rax), %rdi
leaq 0x583b(%rip), %rsi      # 0x59841
movb $0x0, %al
callq 0x74c0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)