// File: Eronana[P]strawberry/src/ast_codegen.cpp
// Function: AST_ObjectLiteral::codeGen(Symbol*)
DEF_AST_METHOD(ObjectLiteral,AST_CODEGEN)
{
    PRINTF("new_object\n");
    int this_bak=++this_count;
    for(auto &x:nodes)
    {
        auto property=(AST_NAME(PropertyNameAndValue)*)x.get();
        CODEGEN(property->assignExpr);
        if(this_bak!=this_count)
        {
            PRINTF("reset_this\n");
            this_bak=++this_count;
        }
        if(is_identifier(property->identifier))PRINTF("push \"%s\"\n",GET_LITERAL(property->identifier).raw.c_str());
        else PRINTF("push %s\n",GET_LITERAL(property->identifier).raw.c_str());
        PRINTF("object_set\n");
        PRINTF("pop\n");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movl 0x38592(%rip), %eax     # 0x8ac10
addl $0x1, %eax
movl %eax, 0x38589(%rip)     # 0x8ac10
leaq 0x3825a(%rip), %rax     # 0x8a8e8
movq (%rax), %rdi
leaq 0x711c(%rip), %rsi      # 0x597b4
movb $0x0, %al
callq 0x74c0
movq -0x48(%rbp), %rax
leaq 0x38232(%rip), %rcx     # 0x8a8dc
movl (%rcx), %ecx
addl $0x1, %ecx
leaq 0x38226(%rip), %rdx     # 0x8a8dc
movl %ecx, (%rdx)
movl %ecx, -0x14(%rbp)
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x1d7f0
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0x1d820
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1d850
testb $0x1, %al
jne 0x526f3
jmp 0x52883
leaq -0x28(%rbp), %rdi
callq 0x1d890
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
callq 0xabd0
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
addq $0x10, %rdi
callq 0x8f60
movq %rax, %rdi
movq -0x10(%rbp), %rsi
movq (%rdi), %rax
callq *0x18(%rax)
movl -0x14(%rbp), %eax
leaq 0x381ab(%rip), %rcx     # 0x8a8dc
cmpl (%rcx), %eax
je 0x52774
movl 0x384d5(%rip), %eax     # 0x8ac10
addl $0x1, %eax
movl %eax, 0x384cc(%rip)     # 0x8ac10
leaq 0x3819d(%rip), %rax     # 0x8a8e8
movq (%rax), %rdi
leaq 0x7047(%rip), %rsi      # 0x5979c
movb $0x0, %al
callq 0x74c0
leaq 0x38179(%rip), %rax     # 0x8a8dc
movl (%rax), %eax
addl $0x1, %eax
leaq 0x3816d(%rip), %rcx     # 0x8a8dc
movl %eax, (%rcx)
movl %eax, -0x14(%rbp)
movq -0x40(%rbp), %rdi
addq $0x8, %rdi
callq 0x52300
testb $0x1, %al
jne 0x52787
jmp 0x527d8
movl 0x38483(%rip), %eax     # 0x8ac10
addl $0x1, %eax
movl %eax, 0x3847a(%rip)     # 0x8ac10
leaq 0x3814b(%rip), %rax     # 0x8a8e8
movq (%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x40(%rbp), %rdi
addq $0x8, %rdi
callq 0xabd0
movq %rax, %rdi
addq $0x8, %rdi
addq $0x10, %rdi
callq 0x7120
movq -0x50(%rbp), %rdi
movq %rax, %rdx
leaq 0x6ff1(%rip), %rsi      # 0x597c0
movb $0x0, %al
callq 0x74c0
jmp 0x52827
movl 0x38432(%rip), %eax     # 0x8ac10
addl $0x1, %eax
movl %eax, 0x38429(%rip)     # 0x8ac10
leaq 0x380fa(%rip), %rax     # 0x8a8e8
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x40(%rbp), %rdi
addq $0x8, %rdi
callq 0xabd0
movq %rax, %rdi
addq $0x8, %rdi
addq $0x10, %rdi
callq 0x7120
movq -0x58(%rbp), %rdi
movq %rax, %rdx
leaq 0x6f68(%rip), %rsi      # 0x59788
movb $0x0, %al
callq 0x74c0
movl 0x383e3(%rip), %eax     # 0x8ac10
addl $0x1, %eax
movl %eax, 0x383da(%rip)     # 0x8ac10
leaq 0x380ab(%rip), %rax     # 0x8a8e8
movq (%rax), %rdi
leaq 0x6f84(%rip), %rsi      # 0x597cb
movb $0x0, %al
callq 0x74c0
movl 0x383bc(%rip), %eax     # 0x8ac10
addl $0x1, %eax
movl %eax, 0x383b3(%rip)     # 0x8ac10
leaq 0x38084(%rip), %rax     # 0x8a8e8
movq (%rax), %rdi
leaq 0x6f69(%rip), %rsi      # 0x597d7
movb $0x0, %al
callq 0x74c0
leaq -0x28(%rbp), %rdi
callq 0x1d8b0
jmp 0x526dd
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)