// File: /workspace/github_cpp_makefile_star2_O3/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 0x45da
movq %rdi, %rbx
movq $0x0, 0x60(%rsp)
movl 0x10(%rdi), %eax
cmpl $0x3, %eax
je 0x4352
cmpl $0x2, %eax
jne 0x45c3
movq 0x28(%rbx), %r14
movq %r14, 0x60(%rsp)
movq 0xeda8(%rip), %r15      # 0x12ff0
leaq 0x9090(%rip), %rsi      # 0xd2df
movl $0x8, %edx
movq %r15, %rdi
callq 0x3260
movq %r15, %rdi
movq %r14, %rsi
callq 0x3180
movq %rax, %r15
leaq 0x943f(%rip), %rsi      # 0xd6b0
movl $0x1, %edx
movq %rax, %rdi
callq 0x3260
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rdx
movq %r15, %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 0x50(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x901f(%rip), %rsi      # 0xd2e8
leaq 0x901c(%rip), %rdx      # 0xd2ec
leaq 0x40(%rsp), %rdi
callq 0x7944
movl 0xf1a3(%rip), %r14d     # 0x13484
leal 0x1(%r14), %eax
movl %eax, 0xf199(%rip)      # 0x13484
movl %r14d, %ebp
negl %ebp
cmovsl %r14d, %ebp
movl $0x1, %r15d
cmpl $0xa, %ebp
jb 0x448a
movl $0x4, %r15d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x4481
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x4487
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x448a
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r15d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x4310
addl $-0x3, %r15d
jmp 0x448a
movq 0x28(%rbx), %r14
movq %r14, 0x60(%rsp)
movq 0xec8e(%rip), %r15      # 0x12ff0
leaq 0x8f84(%rip), %rsi      # 0xd2ed
movl $0x8, %edx
movq %r15, %rdi
callq 0x3260
movq %r15, %rdi
movq %r14, %rsi
callq 0x3180
movq %rax, %r15
leaq 0x9325(%rip), %rsi      # 0xd6b0
movl $0x1, %edx
movq %rax, %rdi
callq 0x3260
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rdx
movq %r15, %rdi
callq 0x3260
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %esi
movq %r15, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3150
cmpl $0x0, 0x28(%r14)
jne 0x45c3
cmpl $0x4, (%r14)
jne 0x45c3
leaq 0x50(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x8efe(%rip), %rsi      # 0xd2f6
leaq 0x8efb(%rip), %rdx      # 0xd2fa
leaq 0x40(%rsp), %rdi
callq 0x7944
movl 0xf074(%rip), %r14d     # 0x13484
leal 0x1(%r14), %eax
movl %eax, 0xf06a(%rip)      # 0x13484
movl %r14d, %ebp
negl %ebp
cmovsl %r14d, %ebp
movl $0x1, %r15d
cmpl $0xa, %ebp
jb 0x45f2
movl $0x4, %r15d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x45e9
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x45ef
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x45f2
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r15d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x443f
addl $-0x3, %r15d
jmp 0x45f2
addl $-0x2, %r15d
jmp 0x448a
decl %r15d
shrl $0x1f, %r14d
leal (%r15,%r14), %esi
leaq 0x30(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x20(%rsp), %rdi
movl $0x2d, %edx
callq 0x3270
addq 0x20(%rsp), %r14
movq %r14, %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0x7840
movq 0x40(%rsp), %rcx
movq 0x48(%rsp), %r8
movq 0x28(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %r12, %rcx
je 0x44de
movq 0x50(%rsp), %rdi
movq 0x20(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x44fc
movl $0xf, %edi
cmpq %r13, %rsi
je 0x44f7
movq 0x30(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x4508
leaq 0x40(%rsp), %rdi
callq 0x30c0
jmp 0x4516
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3250
leaq 0x10(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x4539
movq %rsi, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x453f
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0xecdd(%rip), %rdi      # 0x13240
leaq 0x60(%rsp), %rsi
callq 0x76f8
movq %rsp, %r14
movq %rax, %rdi
movq %r14, %rsi
callq 0x32b0
movq (%r14), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x4595
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x45ac
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x45c3
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0x18(%rbx), %rbx
testq %rbx, %rbx
je 0x45da
movq %rbx, %rdi
callq 0x4200
movq 0x20(%rbx), %rbx
jmp 0x45c7
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addl $-0x2, %r15d
jmp 0x45f2
decl %r15d
shrl $0x1f, %r14d
leal (%r15,%r14), %esi
leaq 0x30(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x20(%rsp), %rdi
movl $0x2d, %edx
callq 0x3270
addq 0x20(%rsp), %r14
movq %r14, %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0x7840
movq 0x40(%rsp), %rcx
movq 0x48(%rsp), %r8
movq 0x28(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %r12, %rcx
je 0x4646
movq 0x50(%rsp), %rdi
movq 0x20(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x4664
movl $0xf, %edi
cmpq %r13, %rsi
je 0x465f
movq 0x30(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x4670
leaq 0x40(%rsp), %rdi
callq 0x30c0
jmp 0x467e
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3250
leaq 0x10(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x46a1
movq %rsi, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x46a7
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0xeb75(%rip), %rdi      # 0x13240
leaq 0x60(%rsp), %rsi
callq 0x76f8
jmp 0x456d
jmp 0x46e2
jmp 0x4702
jmp 0x471e
jmp 0x473a
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4705
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3200
jmp 0x4705
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x4721
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3200
jmp 0x4721
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x473d
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3200
jmp 0x473d
movq %rax, %rbx
movq %rbx, %rdi
callq 0x33d0