// File: /workspace/github_cpp_makefile_star2_O3/sighingnow[P]compile-pascal/pl0_allocator.cpp
// Function: SimpleAllocator::addr(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::string SimpleAllocator::addr(std::string name) {
    int d = env.depth(name);
    LOC loc;
    env.find(name, true, loc);
    if (d == env.depth()) {
        if (loc.is_ref) {
            this->spill("ebx");
            out.emit("    mov ebx, dword [ebp" + loc.offset +"]");
            return "[ebx]";
        }
        else {
            return "[ebp" + loc.offset + "]";
        }
    }
    else {
        this->spill("ebx");
        out.emit("    mov ebx, dword [ebp-" + to_string(d*4) + "]");
        if (loc.is_ref) {
            out.emit("    mov ebx, dword [ebx" + loc.offset + "]");
        }
        return "[ebx" + loc.offset + "]";
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %rdi
movq %rdx, %rsi
callq 0x81b60
movl %eax, %r15d
leaq 0xe0(%rsp), %r13
movq %r13, %rdi
callq 0x81346
movq 0x8(%r14), %rdi
movq %r12, %rsi
movl $0x1, %edx
movq %r13, %rcx
callq 0x81692
movq 0x8(%r14), %rax
movq 0x20(%rax), %rcx
subq 0x18(%rax), %rcx
shrq $0x2, %rcx
decl %ecx
cmpl %ecx, %r15d
jne 0x80c76
cmpb $0x1, 0x120(%rsp)
jne 0x80d37
leaq 0xd0(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x125c6(%rip), %rsi     # 0x93199
leaq 0x125c2(%rip), %rdx     # 0x9319c
leaq 0xc0(%rsp), %rdi
callq 0x253d0
movq (%r14), %rax
leaq 0xc0(%rsp), %rsi
movq %r14, %rdi
callq *0x28(%rax)
movq 0xc0(%rsp), %rdi
cmpq %r15, %rdi
je 0x80c15
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x10(%r14), %r14
leaq 0x100(%rsp), %rdx
leaq 0x12187(%rip), %rsi     # 0x92daf
movq %rsp, %rdi
callq 0x16234
leaq 0x11ff1(%rip), %rsi     # 0x92c28
movq %rsp, %rdi
callq 0x5420
leaq 0x90(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x80db3
movq %rdx, 0x80(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x90(%rsp)
jmp 0x80dba
leaq 0xb0(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x1250f(%rip), %rsi     # 0x93199
leaq 0x1250b(%rip), %rdx     # 0x9319c
leaq 0xa0(%rsp), %rdi
callq 0x253d0
movq (%r14), %rax
leaq 0xa0(%rsp), %rsi
movq %r14, %rdi
callq *0x28(%rax)
movq 0xa0(%rsp), %rdi
cmpq %r12, %rdi
je 0x80ccc
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x5260
shll $0x2, %r15d
movl %r15d, %ebp
negl %ebp
cmovsl %r15d, %ebp
movl $0x1, %r13d
cmpl $0xa, %ebp
jb 0x80e44
movl $0x4, %r13d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x80e3b
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x80e41
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x80e44
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r13d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x80cf5
addl $-0x3, %r13d
jmp 0x80e44
leaq 0x100(%rsp), %rdx
leaq 0x1207c(%rip), %rsi     # 0x92dc2
movq %rsp, %rdi
callq 0x16234
leaq 0x11ed3(%rip), %rsi     # 0x92c28
movq %rsp, %rdi
callq 0x5420
leaq 0x10(%rbx), %rdx
movq %rdx, (%rbx)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0x80d7f
movq %rsi, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x80d85
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x810ac
jmp 0x810b9
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0x80(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %r14, %rdi
callq 0x81650
movq 0x80(%rsp), %rdi
cmpq %r15, %rdi
je 0x80dfe
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x5260
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x80e19
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5260
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x11fa0(%rip), %rsi     # 0x92dc7
leaq 0x11f9e(%rip), %rdx     # 0x92dcc
movq %rbx, %rdi
callq 0x253d0
jmp 0x810b9
addl $-0x2, %r13d
jmp 0x80e44
decl %r13d
movq 0x10(%r14), %r12
shrl $0x1f, %r15d
leal (%r15,%r13), %esi
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x20(%rsp), %rdi
movl $0x2d, %edx
callq 0x5300
movl %r15d, %edi
leaq 0x20(%rsp), %r15
addq (%r15), %rdi
movl %r13d, %esi
movl %ebp, %edx
callq 0x651be
leaq 0x11f49(%rip), %rcx     # 0x92dcd
movl $0x18, %r8d
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x52c0
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x80ebc
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x80ec3
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rsp, %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x11d44(%rip), %rsi     # 0x92c28
callq 0x5420
leaq 0x70(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x80f10
movq %rdx, 0x60(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x70(%rsp)
jmp 0x80f18
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
leaq 0x60(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %r12, %rdi
callq 0x81650
movq 0x60(%rsp), %rdi
cmpq %r13, %rdi
je 0x80f53
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x5260
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x80f69
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x80f85
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5260
cmpb $0x1, 0x120(%rsp)
jne 0x8103e
movq 0x10(%r14), %r14
leaq 0x100(%rsp), %rdx
leaq 0x11e40(%rip), %rsi     # 0x92de6
movq %rsp, %rdi
callq 0x16234
leaq 0x11c73(%rip), %rsi     # 0x92c28
movq %rsp, %rdi
callq 0x5420
leaq 0x50(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x80fe5
movq %rdx, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
jmp 0x80fed
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq 0x40(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %r14, %rdi
callq 0x81650
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x81028
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x5260
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x8103e
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5260
leaq 0x100(%rsp), %rdx
leaq 0x11dac(%rip), %rsi     # 0x92df9
movq %rsp, %rdi
callq 0x16234
leaq 0x11bcc(%rip), %rsi     # 0x92c28
movq %rsp, %rdi
callq 0x5420
leaq 0x10(%rbx), %rdx
movq %rdx, (%rbx)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0x81086
movq %rsi, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x8108c
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x810b9
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5260
leaq 0x110(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x810da
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x5260
leaq 0xf0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x810fb
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x5260
movq %rbx, %rax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x811a9
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x5260
jmp 0x811a9
jmp 0x811a6
jmp 0x81235
jmp 0x81235
movq %rax, %rbx
movq 0x80(%rsp), %rdi
cmpq %r15, %rdi
je 0x81168
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x5260
jmp 0x81168
jmp 0x81165
jmp 0x81235
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x811b6
jmp 0x81238
movq %rax, %rbx
movq 0xc0(%rsp), %rdi
cmpq %r15, %rdi
je 0x81238
movq 0xd0(%rsp), %rsi
jmp 0x81229
jmp 0x81235
jmp 0x81235
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x81238
movq 0x10(%rsp), %rsi
jmp 0x81229
jmp 0x81235
movq %rax, %rbx
movq 0x60(%rsp), %rdi
cmpq %r13, %rdi
je 0x811de
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x5260
jmp 0x811de
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x811f9
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5260
jmp 0x811f9
movq %rax, %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x81238
movq 0x30(%rsp), %rsi
jmp 0x81229
jmp 0x81235
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
cmpq %r12, %rdi
je 0x81238
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x5260
jmp 0x81238
jmp 0x81235
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0x814b4
movq %rbx, %rdi
callq 0x53d0
nop