// File: /workspace/github_cpp_makefile_star2_O1/SunriseFox[P]very-simple-c-compiler/./src/asm.cpp
// Function: storeVar(TreeNode*)
void storeVar(TreeNode* node) {
    if (node == nullptr) return;

    Symbol* ownSymbol = nullptr;

    if (node->nodeType == TreeNode::NODE_DECLARATION) {
        ownSymbol = static_cast<DeclarationNode*>(node)->symbol;
        cerr << "get dec " << ownSymbol << " " << ownSymbol->value << endl;
        varDeclare[ownSymbol] = string("temp") + to_string(tempVarCount++);
    } else if (node->nodeType == TreeNode::NODE_EXPRESSION) {
        ownSymbol = static_cast<ExprNode*>(node)->symbol;
        cerr << "get exp " << ownSymbol << " " << ownSymbol->value << endl;
        if (ownSymbol->symbolType == Symbol::SYMBOL_CONSTANT
                && ownSymbol->type == Symbol::VALUE_STRING) {
            varDeclare[ownSymbol] = string(".str") + to_string(tempVarCount++);
        }
    }

    auto children = node -> child;
    while (children) {
        storeVar(children);
        children = children -> sibling;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
testq %rdi, %rdi
je 0x4619
movq %rdi, %rbx
movq $0x0, (%rsp)
movl 0x10(%rdi), %eax
cmpl $0x3, %eax
je 0x4388
cmpl $0x2, %eax
jne 0x4602
movq 0x28(%rbx), %rax
movq %rax, (%rsp)
movq 0xed77(%rip), %r14      # 0x12ff0
leaq 0x905f(%rip), %rsi      # 0xd2df
movl $0x8, %edx
movq %r14, %rdi
callq 0x3260
movq (%rsp), %rsi
movq %r14, %rdi
callq 0x3180
movq %rax, %r14
leaq 0x940d(%rip), %rsi      # 0xd6b0
movl $0x1, %edx
movq %rax, %rdi
callq 0x3260
movq (%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq %r14, %rdi
callq 0x3260
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3150
leaq 0x58(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x8fe9(%rip), %rsi      # 0xd2e8
leaq 0x8fe6(%rip), %rdx      # 0xd2ec
leaq 0x48(%rsp), %rdi
callq 0x7948
movl 0xf16d(%rip), %r14d     # 0x13484
leal 0x1(%r14), %eax
movl %eax, 0xf163(%rip)      # 0x13484
movl %r14d, %ebp
negl %ebp
cmovsl %r14d, %ebp
movl $0x1, %r15d
cmpl $0xa, %ebp
jb 0x44c6
movl $0x4, %r15d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x44bd
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x44c3
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x44c6
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r15d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x4346
addl $-0x3, %r15d
jmp 0x44c6
movq 0x28(%rbx), %rax
movq %rax, (%rsp)
movq 0xec59(%rip), %r14      # 0x12ff0
leaq 0x8f4f(%rip), %rsi      # 0xd2ed
movl $0x8, %edx
movq %r14, %rdi
callq 0x3260
movq (%rsp), %rsi
movq %r14, %rdi
callq 0x3180
movq %rax, %r14
leaq 0x92ef(%rip), %rsi      # 0xd6b0
movl $0x1, %edx
movq %rax, %rdi
callq 0x3260
movq (%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq %r14, %rdi
callq 0x3260
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3150
movq (%rsp), %rax
cmpl $0x0, 0x28(%rax)
jne 0x4602
cmpl $0x4, (%rax)
jne 0x4602
leaq 0x58(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x8ec2(%rip), %rsi      # 0xd2f6
leaq 0x8ebf(%rip), %rdx      # 0xd2fa
leaq 0x48(%rsp), %rdi
callq 0x7948
movl 0xf038(%rip), %r14d     # 0x13484
leal 0x1(%r14), %eax
movl %eax, 0xf02e(%rip)      # 0x13484
movl %r14d, %ebp
negl %ebp
cmovsl %r14d, %ebp
movl $0x1, %r15d
cmpl $0xa, %ebp
jb 0x4631
movl $0x4, %r15d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x4628
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x462e
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x4631
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r15d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x447b
addl $-0x3, %r15d
jmp 0x4631
addl $-0x2, %r15d
jmp 0x44c6
decl %r15d
shrl $0x1f, %r14d
leal (%r15,%r14), %esi
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x28(%rsp), %rdi
movl $0x2d, %edx
callq 0x3270
addq 0x28(%rsp), %r14
movq %r14, %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0x784a
movq 0x48(%rsp), %rcx
movq 0x50(%rsp), %r8
movq 0x30(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r12, %rcx
je 0x451a
movq 0x58(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x4535
movl $0xf, %esi
cmpq %r13, 0x28(%rsp)
je 0x4530
movq 0x38(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x4546
movq 0x28(%rsp), %rsi
leaq 0x48(%rsp), %rdi
callq 0x30c0
jmp 0x4554
leaq 0x28(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3250
leaq 0x18(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x4578
movq %rsi, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x457e
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0xec9e(%rip), %rdi      # 0x13240
movq %rsp, %rsi
callq 0x7706
leaq 0x8(%rsp), %r14
movq %rax, %rdi
movq %r14, %rsi
callq 0x32b0
movq (%r14), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x45d4
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x45eb
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x4602
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0x18(%rbx), %rbx
testq %rbx, %rbx
je 0x4619
movq %rbx, %rdi
callq 0x4233
movq 0x20(%rbx), %rbx
jmp 0x4606
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addl $-0x2, %r15d
jmp 0x4631
decl %r15d
shrl $0x1f, %r14d
leal (%r15,%r14), %esi
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x28(%rsp), %rdi
movl $0x2d, %edx
callq 0x3270
addq 0x28(%rsp), %r14
movq %r14, %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0x784a
movq 0x48(%rsp), %rcx
movq 0x50(%rsp), %r8
movq 0x30(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r12, %rcx
je 0x4685
movq 0x58(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x46a0
movl $0xf, %esi
cmpq %r13, 0x28(%rsp)
je 0x469b
movq 0x38(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x46b1
movq 0x28(%rsp), %rsi
leaq 0x48(%rsp), %rdi
callq 0x30c0
jmp 0x46bf
leaq 0x28(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3250
leaq 0x18(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x46e3
movq %rsi, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x46e9
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0xeb33(%rip), %rdi      # 0x13240
movq %rsp, %rsi
callq 0x7706
jmp 0x45aa
jmp 0x4722
jmp 0x4742
jmp 0x475e
jmp 0x477a
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4745
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3200
jmp 0x4745
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x4761
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3200
jmp 0x4761
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x477d
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3200
jmp 0x477d
movq %rax, %rbx
movq %rbx, %rdi
callq 0x33d0