// File: /workspace/github_c_makefile_star2_O1/zyearn[P]SmallC/codegen.cpp
// Function: genDec(treeNode*, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void genDec(treeNode* node, int type, string scope)
{
    switch(type)
    {
        case 1://´ËÇé¿öÃ»ÓÐ¸³Öµ£¬²»¿¼ÂÇ
        break;
        case 2:
        {   
            if(scope == "_G")
                cout << "_G_" << globalNumber << ":" << endl;
            //¶Ô±äÁ¿¸³Öµ
            if ( node->child[0]->type==1)
            {
                genInit(node->child[2],node->child[2]->type,scope);
                if((*FT[scope])[node->child[0]->child[0]->data] != 0 && scope != "_G")
                    cout << "sw $t0, " << 4 + (*FT[scope])["#"] - (*FT[scope])[node->child[0]->child[0]->data] << "($s0)" << endl;
                else if((*FT["_G"])[node->child[0]->child[0]->data] != 0 )  
                    cout << "sw $t0, " << (*FT["_G"])["#"] - (*FT["_G"])[node->child[0]->child[0]->data] << "($s2)" << endl;
                else
                {
                    freopen(outputFile.c_str(), "w", stdout);
                    cout << "Error.";
                    fprintf(stderr, "\nCompile fail!\n");
                    fprintf(stderr, "error occurs, %s is not defined\n",  (node->child[0]->child[0]->data).c_str() );
                    exit(0);
                }
            }
            //¶ÔÊý×é¸³Öµ
            else if(node->child[0]->type==2)
            {
                if(node->child[2]->childnum != 3)
                {
                    freopen(outputFile.c_str(), "w", stdout);
                    cout << "Error.";
                    fprintf(stderr, "\nCompile fail!\n");
                    fprintf(stderr, "error occurs, %s wrong array initialization\n",(node->child[0]->child[0]->child[0]->data).c_str() );
                    exit(0);
                }
                //cout << "sw $t0, " << 4 + (*FT[scope])["#"] - (*FT[scope])[node->child[0]->data] << "($s0)" << endl;
                string num = node->child[0]->child[2]->data;
                int n = atoi(num.c_str());
                int size = 1;
                treeNode *tmp = node->child[2]->child[1];
                while(tmp->childnum == 3)
                {
                    size++;
                    tmp = tmp->child[2];
                }
                if(size > n)
                {
                    freopen(outputFile.c_str(), "w", stdout);
                    cout << "Error.";
                    fprintf(stderr, "\nCompile fail!\n");
                    fprintf(stderr, "error occurs, %s argument is too large\n",( node->child[0]->child[0]->child[0]->data ).c_str() );
                    exit(0);
                }
                tmp = node->child[2]->child[1];
                for(int i=0; i<size; i++)
                {
                    genExp(tmp->child[0],tmp->child[0]->type, scope);
                    //if(i == 0)
                    //  cout << tmp->child[0]->child[0]->data << endl;
                    if(tmp->childnum == 3)
                        tmp = tmp->child[2];
                    if(scope != "_G")
                        cout << "sw $t0, " << 4 + (*FT[scope])["#"]-(*FT[scope])[node->child[0]->child[0]->child[0]->data]+i*4 << "($s0)" << endl;
                    else
                        cout << "sw $t0, " << (*FT[scope])["#"]-(*FT[scope])[node->child[0]->child[0]->child[0]->data]+i*4 << "($s2)" << endl;
                }
            }
            if(scope == "_G")
                cout << "j _G_" << ++globalNumber << endl;
            break;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
cmpl $0x2, %esi
jne 0xe9f2
movq %rdx, %rbx
movq %rdi, %r15
leaq 0x135fb(%rip), %rsi     # 0x2188c
movq %rdx, %rdi
callq 0x20e0
testl %eax, %eax
jne 0xe307
movq 0x19d2c(%rip), %r14     # 0x27fd0
leaq 0x13c22(%rip), %rsi     # 0x21ecd
movl $0x3, %edx
movq %r14, %rdi
callq 0x2230
leaq 0x19f39(%rip), %rax     # 0x281f8
movl (%rax), %esi
movq %r14, %rdi
callq 0x2330
movq %rax, %r14
leaq 0x13a1e(%rip), %rsi     # 0x21cf1
movl $0x1, %edx
movq %rax, %rdi
callq 0x2230
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2150
movq 0x28(%r15), %rax
addq $0x28, %r15
movq %r15, -0x30(%rbp)
movq (%rax), %rcx
movl 0x24(%rcx), %ecx
cmpl $0x2, %ecx
je 0xe4a1
cmpl $0x1, %ecx
jne 0xe985
movq 0x10(%rax), %r14
movl 0x24(%r14), %r15d
leaq -0xc8(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq -0xd8(%rbp), %r12
movq %r12, %rdi
callq 0xb1ca
movq %r14, %rdi
movl %r15d, %esi
movq %r12, %rdx
callq 0x1e3cc
movq -0xd8(%rbp), %rdi
cmpq %r13, %rdi
je 0xe380
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x21e0
leaq 0x19f29(%rip), %rdi     # 0x282b0
movq %rbx, %rsi
callq 0x1e7b4
movq (%rax), %rdi
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x28(%rax), %rax
movq (%rax), %rsi
callq 0x1e734
cmpl $0x0, (%rax)
je 0xe7be
leaq 0x134d4(%rip), %rsi     # 0x2188c
movq %rbx, %rdi
callq 0x20e0
testl %eax, %eax
je 0xe7be
movq 0x19c01(%rip), %rdi     # 0x27fd0
leaq 0x13a97(%rip), %rsi     # 0x21e6d
movl $0x8, %edx
callq 0x2230
leaq 0x19ec9(%rip), %rdi     # 0x282b0
movq %rbx, %rsi
callq 0x1e7b4
movq (%rax), %r14
leaq -0x48(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x138b7(%rip), %rsi     # 0x21cb8
leaq 0x138b1(%rip), %rdx     # 0x21cb9
leaq -0x58(%rbp), %rdi
callq 0xb264
leaq -0x58(%rbp), %rsi
movq %r14, %rdi
callq 0x1e6b4
movl (%rax), %r14d
leaq 0x19e89(%rip), %rdi     # 0x282b0
movq %rbx, %rsi
callq 0x1e7b4
movq (%rax), %rdi
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x28(%rax), %rax
movq (%rax), %rsi
callq 0x1e734
addl $0x4, %r14d
subl (%rax), %r14d
movq 0x19b7a(%rip), %rdi     # 0x27fd0
movl %r14d, %esi
callq 0x2330
movq %rax, %r14
leaq 0x13db9(%rip), %rsi     # 0x22221
movl $0x5, %edx
movq %rax, %rdi
callq 0x2230
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2150
jmp 0xe970
movq 0x10(%rax), %rcx
cmpl $0x3, 0x20(%rcx)
jne 0xea04
movq (%rax), %rax
movq 0x28(%rax), %rax
movq 0x10(%rax), %rax
leaq -0x48(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x58(%rbp), %r14
movq %r14, %rdi
callq 0xb1ca
movq (%r14), %rdi
callq 0x22f0
movq -0x30(%rbp), %rcx
movq (%rcx), %rcx
movq 0x10(%rcx), %rcx
movq 0x28(%rcx), %rcx
movq 0x8(%rcx), %rdx
movl $0x1, %r12d
cmpl $0x3, 0x20(%rdx)
jne 0xe50c
incl %r12d
movq 0x28(%rdx), %rdx
movq 0x10(%rdx), %rdx
jmp 0xe4f9
movq %rbx, -0x38(%rbp)
cmpl %eax, %r12d
jg 0xea0d
movq 0x8(%rcx), %rax
xorl %ebx, %ebx
movq %rax, %r14
movq 0x28(%rax), %rax
movq (%rax), %r15
movl 0x24(%r15), %r13d
leaq -0x88(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x98(%rbp), %rdi
callq 0xb1ca
movq %r15, %rdi
movl %r13d, %esi
leaq -0x98(%rbp), %rdx
xorl %ecx, %ecx
callq 0x106e9
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0xe58b
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x21e0
cmpl $0x3, 0x20(%r14)
jne 0xe59a
movq 0x28(%r14), %rax
movq 0x10(%rax), %r14
movq -0x38(%rbp), %rdi
leaq 0x132e7(%rip), %rsi     # 0x2188c
callq 0x20e0
testl %eax, %eax
je 0xe696
movl $0x8, %edx
movq 0x19a12(%rip), %rdi     # 0x27fd0
leaq 0x138a8(%rip), %rsi     # 0x21e6d
callq 0x2230
leaq 0x19cdf(%rip), %rdi     # 0x282b0
movq -0x38(%rbp), %rsi
callq 0x1e7b4
movq (%rax), %r15
leaq -0x68(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq -0x78(%rbp), %r13
movq %r13, %rdi
leaq 0x136c5(%rip), %rsi     # 0x21cb8
leaq 0x136bf(%rip), %rdx     # 0x21cb9
callq 0xb264
movq %r15, %rdi
movq %r13, %rsi
callq 0x1e6b4
movl (%rax), %r15d
leaq 0x19c9c(%rip), %rdi     # 0x282b0
movq -0x38(%rbp), %rsi
callq 0x1e7b4
movq (%rax), %rdi
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
movq 0x28(%rax), %rax
movq (%rax), %rsi
callq 0x1e734
subl (%rax), %r15d
leal (%rbx,%r15), %esi
addl $0x4, %esi
movq 0x19982(%rip), %rdi     # 0x27fd0
callq 0x2330
movq %rax, %r15
movl $0x5, %edx
movq %rax, %rdi
leaq 0x13bbc(%rip), %rsi     # 0x22221
callq 0x2230
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2150
jmp 0xe774
movl $0x8, %edx
movq 0x1992e(%rip), %rdi     # 0x27fd0
leaq 0x137c4(%rip), %rsi     # 0x21e6d
callq 0x2230
leaq 0x19bfb(%rip), %rdi     # 0x282b0
movq -0x38(%rbp), %rsi
callq 0x1e7b4
movq (%rax), %r15
leaq -0x68(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq -0x78(%rbp), %r13
movq %r13, %rdi
leaq 0x135e1(%rip), %rsi     # 0x21cb8
leaq 0x135db(%rip), %rdx     # 0x21cb9
callq 0xb264
movq %r15, %rdi
movq %r13, %rsi
callq 0x1e6b4
movl (%rax), %r15d
leaq 0x19bb8(%rip), %rdi     # 0x282b0
movq -0x38(%rbp), %rsi
callq 0x1e7b4
movq (%rax), %rdi
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
movq 0x28(%rax), %rax
movq (%rax), %rsi
callq 0x1e734
subl (%rax), %r15d
addl %ebx, %r15d
movq 0x198a2(%rip), %rdi     # 0x27fd0
movl %r15d, %esi
callq 0x2330
movq %rax, %r15
movl $0x5, %edx
movq %rax, %rdi
leaq 0x13681(%rip), %rsi     # 0x21dc9
callq 0x2230
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2150
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0xe78d
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x21e0
addl $0x4, %ebx
decl %r12d
movq %r14, %rax
jne 0xe51f
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0xe7b5
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x21e0
movq -0x38(%rbp), %rbx
jmp 0xe985
leaq -0x48(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x130bf(%rip), %rsi     # 0x2188c
leaq 0x130ba(%rip), %rdx     # 0x2188e
leaq -0x58(%rbp), %rdi
callq 0xb264
movq %rbx, %r14
leaq 0x19ac9(%rip), %rdi     # 0x282b0
leaq -0x58(%rbp), %rsi
callq 0xb01a
movq (%rax), %rdi
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x28(%rax), %rax
movq (%rax), %rsi
callq 0x1e734
movl (%rax), %ebx
movq -0x58(%rbp), %rdi
cmpq %r15, %rdi
je 0xe820
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x21e0
testl %ebx, %ebx
je 0xea49
movq 0x197a1(%rip), %rdi     # 0x27fd0
leaq 0x13637(%rip), %rsi     # 0x21e6d
movl $0x8, %edx
callq 0x2230
leaq -0x58(%rbp), %rdi
movq %r15, (%rdi)
leaq 0x1303e(%rip), %rsi     # 0x2188c
leaq 0x13039(%rip), %rdx     # 0x2188e
callq 0xb264
movq %r14, %rbx
leaq 0x19a4c(%rip), %rdi     # 0x282b0
leaq -0x58(%rbp), %rsi
callq 0xb01a
movq (%rax), %r14
leaq -0x68(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x13438(%rip), %rsi     # 0x21cb8
leaq 0x13432(%rip), %rdx     # 0x21cb9
leaq -0x78(%rbp), %rdi
callq 0xb264
leaq -0x78(%rbp), %rsi
movq %r14, %rdi
callq 0x1e6b4
movl (%rax), %r14d
leaq -0xa8(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x12fdb(%rip), %rsi     # 0x2188c
leaq 0x12fd6(%rip), %rdx     # 0x2188e
leaq -0xb8(%rbp), %rdi
callq 0xb264
leaq 0x199e5(%rip), %rdi     # 0x282b0
leaq -0xb8(%rbp), %rsi
callq 0xb01a
movq (%rax), %rdi
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x28(%rax), %rax
movq (%rax), %rsi
callq 0x1e734
subl (%rax), %r14d
movq 0x196d6(%rip), %rdi     # 0x27fd0
movl %r14d, %esi
callq 0x2330
movq %rax, %r14
leaq 0x134bd(%rip), %rsi     # 0x21dc9
movl $0x5, %edx
movq %rax, %rdi
callq 0x2230
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2150
movq -0xb8(%rbp), %rdi
cmpq %r13, %rdi
je 0xe95b
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x21e0
movq -0x78(%rbp), %rdi
cmpq %r12, %rdi
je 0xe970
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x21e0
movq -0x58(%rbp), %rdi
cmpq %r15, %rdi
je 0xe985
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x21e0
leaq 0x12f00(%rip), %rsi     # 0x2188c
movq %rbx, %rdi
callq 0x20e0
testl %eax, %eax
jne 0xe9f2
movq 0x19631(%rip), %rbx     # 0x27fd0
leaq 0x13525(%rip), %rsi     # 0x21ecb
movl $0x5, %edx
movq %rbx, %rdi
callq 0x2230
leaq 0x1983e(%rip), %rax     # 0x281f8
movl (%rax), %esi
incl %esi
movl %esi, (%rax)
movq %rbx, %rdi
callq 0x2330
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2150
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x26cc
leaq 0x19874(%rip), %rax     # 0x28288
movq (%rax), %rdi
movq 0x1958a(%rip), %rax     # 0x27fa8
movq (%rax), %rdx
leaq 0x130c1(%rip), %rsi     # 0x21ae9
callq 0x2220
movq 0x1959c(%rip), %rdi     # 0x27fd0
leaq 0x13225(%rip), %rsi     # 0x21c60
callq 0x21b0
movq -0x30(%rbp), %rdi
callq 0x2754
movq -0x30(%rbp), %rdi
callq 0x27a9
jmp 0xea61
jmp 0xea56
movq %rax, %rbx
jmp 0xeab2
jmp 0xea8f
jmp 0xea8f
jmp 0xea61
movq %rax, %rbx
jmp 0xeb31
jmp 0xeaf7
movq %rax, %rbx
movq -0xd8(%rbp), %rdi
cmpq %r13, %rdi
je 0xeb31
movq -0xc8(%rbp), %rsi
jmp 0xeb29
jmp 0xea8f
movq %rax, %rbx
jmp 0xeac7
movq %rax, %rbx
movq -0xb8(%rbp), %rdi
cmpq %r13, %rdi
je 0xeab2
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x21e0
movq -0x78(%rbp), %rdi
cmpq %r12, %rdi
je 0xeac7
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x21e0
movq -0x58(%rbp), %rdi
cmpq %r15, %rdi
jne 0xeb25
jmp 0xeb31
jmp 0xeaf7
jmp 0xeaf7
movq %rax, %rbx
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0xeb18
movq -0x88(%rbp), %rsi
jmp 0xeb10
jmp 0xeafc
movq %rax, %rbx
jmp 0xeb18
movq %rax, %rbx
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0xeb18
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x21e0
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0xeb31
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x21e0
movq %rbx, %rdi
callq 0x2360