// File: /workspace/github_c_makefile_star2_O3/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 0xe81f
movq %rdx, %rbx
movq %rdi, %r15
leaq 0x137d0(%rip), %rsi     # 0x2188c
movq %rdx, %rdi
callq 0x20e0
testl %eax, %eax
jne 0xe132
movq 0x19f01(%rip), %r14     # 0x27fd0
leaq 0x13df7(%rip), %rsi     # 0x21ecd
movl $0x3, %edx
movq %r14, %rdi
callq 0x2230
leaq 0x1a10e(%rip), %rax     # 0x281f8
movl (%rax), %esi
movq %r14, %rdi
callq 0x2330
movq %rax, %r14
leaq 0x13bf3(%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), %edx
cmpl $0x2, %edx
je 0xe2cc
cmpl $0x1, %edx
jne 0xe7b2
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 0xb00c
movq %r14, %rdi
movl %r15d, %esi
movq %r12, %rdx
callq 0x1e0d6
movq -0xd8(%rbp), %rdi
cmpq %r13, %rdi
je 0xe1ab
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x21e0
leaq 0x1a0fe(%rip), %rdi     # 0x282b0
movq %rbx, %rsi
callq 0x1e4be
movq (%rax), %rdi
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x28(%rax), %rax
movq (%rax), %rsi
callq 0x1e43e
cmpl $0x0, (%rax)
je 0xe5eb
leaq 0x136a9(%rip), %rsi     # 0x2188c
movq %rbx, %rdi
callq 0x20e0
testl %eax, %eax
je 0xe5eb
movq 0x19dd6(%rip), %rdi     # 0x27fd0
leaq 0x13c6c(%rip), %rsi     # 0x21e6d
movl $0x8, %edx
callq 0x2230
leaq 0x1a09e(%rip), %rdi     # 0x282b0
movq %rbx, %rsi
callq 0x1e4be
movq (%rax), %r14
leaq -0x48(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x13a8c(%rip), %rsi     # 0x21cb8
leaq 0x13a86(%rip), %rdx     # 0x21cb9
leaq -0x58(%rbp), %rdi
callq 0xb0aa
leaq -0x58(%rbp), %rsi
movq %r14, %rdi
callq 0x1e3be
movl (%rax), %r14d
leaq 0x1a05e(%rip), %rdi     # 0x282b0
movq %rbx, %rsi
callq 0x1e4be
movq (%rax), %rdi
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x28(%rax), %rax
movq (%rax), %rsi
callq 0x1e43e
addl $0x4, %r14d
subl (%rax), %r14d
movq 0x19d4f(%rip), %rdi     # 0x27fd0
movl %r14d, %esi
callq 0x2330
movq %rax, %r14
leaq 0x13f8e(%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 0xe79d
movq 0x10(%rax), %rax
cmpl $0x3, 0x20(%rax)
jne 0xe831
movq 0x28(%rcx), %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 0xb00c
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, %r14d
cmpl $0x3, 0x20(%rdx)
jne 0xe33b
movq %rdx, %rcx
incl %r14d
movq 0x28(%rcx), %rcx
movq 0x10(%rcx), %rcx
cmpl $0x3, 0x20(%rcx)
je 0xe32a
movq %rbx, -0x38(%rbp)
cmpl %eax, %r14d
jg 0xe83a
xorl %ebx, %ebx
movq %rdx, %r12
movq 0x28(%rdx), %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 0xb00c
movq %r15, %rdi
movl %r13d, %esi
leaq -0x98(%rbp), %rdx
xorl %ecx, %ecx
callq 0x10531
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0xe3b6
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x21e0
cmpl $0x3, 0x20(%r12)
jne 0xe3c7
movq 0x28(%r12), %rax
movq 0x10(%rax), %r12
movq -0x38(%rbp), %rdi
leaq 0x134ba(%rip), %rsi     # 0x2188c
callq 0x20e0
testl %eax, %eax
je 0xe4c3
movl $0x8, %edx
movq 0x19be5(%rip), %rdi     # 0x27fd0
leaq 0x13a7b(%rip), %rsi     # 0x21e6d
callq 0x2230
leaq 0x19eb2(%rip), %rdi     # 0x282b0
movq -0x38(%rbp), %rsi
callq 0x1e4be
movq (%rax), %r15
leaq -0x68(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq -0x78(%rbp), %r13
movq %r13, %rdi
leaq 0x13898(%rip), %rsi     # 0x21cb8
leaq 0x13892(%rip), %rdx     # 0x21cb9
callq 0xb0aa
movq %r15, %rdi
movq %r13, %rsi
callq 0x1e3be
movl (%rax), %r15d
leaq 0x19e6f(%rip), %rdi     # 0x282b0
movq -0x38(%rbp), %rsi
callq 0x1e4be
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 0x1e43e
subl (%rax), %r15d
leal (%rbx,%r15), %esi
addl $0x4, %esi
movq 0x19b55(%rip), %rdi     # 0x27fd0
callq 0x2330
movq %rax, %r15
movl $0x5, %edx
movq %rax, %rdi
leaq 0x13d8f(%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 0xe5a1
movl $0x8, %edx
movq 0x19b01(%rip), %rdi     # 0x27fd0
leaq 0x13997(%rip), %rsi     # 0x21e6d
callq 0x2230
leaq 0x19dce(%rip), %rdi     # 0x282b0
movq -0x38(%rbp), %rsi
callq 0x1e4be
movq (%rax), %r15
leaq -0x68(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq -0x78(%rbp), %r13
movq %r13, %rdi
leaq 0x137b4(%rip), %rsi     # 0x21cb8
leaq 0x137ae(%rip), %rdx     # 0x21cb9
callq 0xb0aa
movq %r15, %rdi
movq %r13, %rsi
callq 0x1e3be
movl (%rax), %r15d
leaq 0x19d8b(%rip), %rdi     # 0x282b0
movq -0x38(%rbp), %rsi
callq 0x1e4be
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 0x1e43e
subl (%rax), %r15d
addl %ebx, %r15d
movq 0x19a75(%rip), %rdi     # 0x27fd0
movl %r15d, %esi
callq 0x2330
movq %rax, %r15
movl $0x5, %edx
movq %rax, %rdi
leaq 0x13854(%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 0xe5ba
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x21e0
addl $0x4, %ebx
decl %r14d
movq %r12, %rdx
jne 0xe34a
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0xe5e2
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x21e0
movq -0x38(%rbp), %rbx
jmp 0xe7b2
leaq -0x48(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x13292(%rip), %rsi     # 0x2188c
leaq 0x1328d(%rip), %rdx     # 0x2188e
leaq -0x58(%rbp), %rdi
callq 0xb0aa
movq %rbx, %r14
leaq 0x19c9c(%rip), %rdi     # 0x282b0
leaq -0x58(%rbp), %rsi
callq 0xae5e
movq (%rax), %rdi
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x28(%rax), %rax
movq (%rax), %rsi
callq 0x1e43e
movl (%rax), %ebx
movq -0x58(%rbp), %rdi
cmpq %r15, %rdi
je 0xe64d
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x21e0
testl %ebx, %ebx
je 0xe876
movq 0x19974(%rip), %rdi     # 0x27fd0
leaq 0x1380a(%rip), %rsi     # 0x21e6d
movl $0x8, %edx
callq 0x2230
leaq -0x58(%rbp), %rdi
movq %r15, (%rdi)
leaq 0x13211(%rip), %rsi     # 0x2188c
leaq 0x1320c(%rip), %rdx     # 0x2188e
callq 0xb0aa
movq %r14, %rbx
leaq 0x19c1f(%rip), %rdi     # 0x282b0
leaq -0x58(%rbp), %rsi
callq 0xae5e
movq (%rax), %r14
leaq -0x68(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x1360b(%rip), %rsi     # 0x21cb8
leaq 0x13605(%rip), %rdx     # 0x21cb9
leaq -0x78(%rbp), %rdi
callq 0xb0aa
leaq -0x78(%rbp), %rsi
movq %r14, %rdi
callq 0x1e3be
movl (%rax), %r14d
leaq -0xa8(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x131ae(%rip), %rsi     # 0x2188c
leaq 0x131a9(%rip), %rdx     # 0x2188e
leaq -0xb8(%rbp), %rdi
callq 0xb0aa
leaq 0x19bb8(%rip), %rdi     # 0x282b0
leaq -0xb8(%rbp), %rsi
callq 0xae5e
movq (%rax), %rdi
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x28(%rax), %rax
movq (%rax), %rsi
callq 0x1e43e
subl (%rax), %r14d
movq 0x198a9(%rip), %rdi     # 0x27fd0
movl %r14d, %esi
callq 0x2330
movq %rax, %r14
leaq 0x13690(%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 0xe788
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x21e0
movq -0x78(%rbp), %rdi
cmpq %r12, %rdi
je 0xe79d
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x21e0
movq -0x58(%rbp), %rdi
cmpq %r15, %rdi
je 0xe7b2
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x21e0
leaq 0x130d3(%rip), %rsi     # 0x2188c
movq %rbx, %rdi
callq 0x20e0
testl %eax, %eax
jne 0xe81f
movq 0x19804(%rip), %rbx     # 0x27fd0
leaq 0x136f8(%rip), %rsi     # 0x21ecb
movl $0x5, %edx
movq %rbx, %rdi
callq 0x2230
leaq 0x19a11(%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 0x19a47(%rip), %rax     # 0x28288
movq (%rax), %rdi
movq 0x1975d(%rip), %rax     # 0x27fa8
movq (%rax), %rdx
leaq 0x13294(%rip), %rsi     # 0x21ae9
callq 0x2220
movq 0x1976f(%rip), %rdi     # 0x27fd0
leaq 0x133f8(%rip), %rsi     # 0x21c60
callq 0x21b0
movq -0x30(%rbp), %rdi
callq 0x2754
movq -0x30(%rbp), %rdi
callq 0x27a9
jmp 0xe88e
jmp 0xe883
movq %rax, %rbx
jmp 0xe8df
jmp 0xe8bc
jmp 0xe8bc
jmp 0xe88e
movq %rax, %rbx
jmp 0xe95e
jmp 0xe924
movq %rax, %rbx
movq -0xd8(%rbp), %rdi
cmpq %r13, %rdi
je 0xe95e
movq -0xc8(%rbp), %rsi
jmp 0xe956
jmp 0xe8bc
movq %rax, %rbx
jmp 0xe8f4
movq %rax, %rbx
movq -0xb8(%rbp), %rdi
cmpq %r13, %rdi
je 0xe8df
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x21e0
movq -0x78(%rbp), %rdi
cmpq %r12, %rdi
je 0xe8f4
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x21e0
movq -0x58(%rbp), %rdi
cmpq %r15, %rdi
jne 0xe952
jmp 0xe95e
jmp 0xe924
jmp 0xe924
movq %rax, %rbx
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0xe945
movq -0x88(%rbp), %rsi
jmp 0xe93d
jmp 0xe929
movq %rax, %rbx
jmp 0xe945
movq %rax, %rbx
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0xe945
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x21e0
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0xe95e
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x21e0
movq %rbx, %rdi
callq 0x2360