// File: acliusBackHome[P]kamaya/dist/IR.cpp
// Function: IR::allocEmit(unsigned long const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned long const&, unsigned long const&)
size_t IR::allocEmit(const size_t &scope, const string &symbol,
                     const size_t &size, const size_t &node_id) {
  // 变量内存分配, 返回地址
  const string key = formKey(scope, symbol);
  if (allocMap.find(key) != allocMap.end()) {
    throw ParseException(ExceptionCode::EX_UNKNOWN, "bad alloc for same var");
    return (size_t)-1;
  }
  allocMap[key] = Alloc{offset, size};
  if (size != (size_t)-1) {
    gen("alloc", to_string(offset), to_string(size), key, node_id);
  } else {
    gen("alloc", to_string(offset), "BadWide", key, node_id);
  }
  size_t ret = offset;
  addOffset(size);
  return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0x198(%rbp)
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
leaq -0x48(%rbp), %rdi
movq %rdi, -0x190(%rbp)
callq 0x87bd0
movq -0x198(%rbp), %rdi
movq -0x190(%rbp), %rsi
addq $0xe0, %rdi
callq 0x87d20
movq %rax, -0x188(%rbp)
jmp 0x87125
movq -0x198(%rbp), %rdi
movq -0x188(%rbp), %rax
movq %rax, -0x50(%rbp)
addq $0xe0, %rdi
callq 0x87d50
movq %rax, -0x68(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x87cf0
testb $0x1, %al
jne 0x8715d
jmp 0x87240
movb $0x1, -0x8a(%rbp)
movl $0x28, %edi
callq 0x41c0
movq %rax, -0x1a8(%rbp)
leaq -0x89(%rbp), %rdi
movq %rdi, -0x1a0(%rbp)
callq 0x45f0
movq -0x1a0(%rbp), %rdx
leaq 0xa9f4(%rip), %rsi      # 0x91b8a
leaq -0x88(%rbp), %rdi
callq 0x4450
jmp 0x871a4
movq -0x1a8(%rbp), %rdi
xorl %esi, %esi
leaq -0x88(%rbp), %rdx
callq 0x73a90
jmp 0x871bb
movq -0x1a8(%rbp), %rdi
movb $0x0, -0x8a(%rbp)
leaq 0x3eb80(%rip), %rsi     # 0xc5d50
leaq -0x71347(%rip), %rdx    # 0x15e90
callq 0x45b0
jmp 0x8757a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x87568
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x87218
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x4688
leaq -0x89(%rbp), %rdi
callq 0x4380
testb $0x1, -0x8a(%rbp)
jne 0x8722f
jmp 0x8723b
movq -0x1a8(%rbp), %rdi
callq 0x4280
jmp 0x87568
movq -0x198(%rbp), %rdi
movq (%rdi), %rax
movq %rax, -0xa0(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x98(%rbp)
addq $0xe0, %rdi
leaq -0x48(%rbp), %rsi
callq 0x87d80
movq %rax, -0x1b0(%rbp)
jmp 0x87278
movq -0x1b0(%rbp), %rax
movq -0xa0(%rbp), %rcx
movq %rcx, (%rax)
movq -0x98(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
cmpq $-0x1, (%rax)
je 0x873cc
leaq -0xc1(%rbp), %rdi
movq %rdi, -0x1b8(%rbp)
callq 0x45f0
movq -0x1b8(%rbp), %rdx
leaq 0x6bf7(%rip), %rsi      # 0x8deba
leaq -0xc0(%rbp), %rdi
callq 0x4450
jmp 0x872d1
movq -0x198(%rbp), %rax
movq (%rax), %rsi
leaq -0xe8(%rbp), %rdi
callq 0x15db0
jmp 0x872e9
movq -0x20(%rbp), %rax
movq (%rax), %rsi
leaq -0x108(%rbp), %rdi
callq 0x15db0
jmp 0x872fe
movq -0x198(%rbp), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %r9
leaq -0xc0(%rbp), %rsi
leaq -0xe8(%rbp), %rdx
leaq -0x108(%rbp), %rcx
leaq -0x48(%rbp), %r8
callq 0x84430
jmp 0x8732c
leaq -0x108(%rbp), %rdi
callq 0x4688
leaq -0xe8(%rbp), %rdi
callq 0x4688
leaq -0xc0(%rbp), %rdi
callq 0x4688
leaq -0xc1(%rbp), %rdi
callq 0x4380
jmp 0x87522
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x873bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x873af
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x873a3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x4688
leaq -0xe8(%rbp), %rdi
callq 0x4688
leaq -0xc0(%rbp), %rdi
callq 0x4688
leaq -0xc1(%rbp), %rdi
callq 0x4380
jmp 0x87568
leaq -0x129(%rbp), %rdi
movq %rdi, -0x1c0(%rbp)
callq 0x45f0
movq -0x1c0(%rbp), %rdx
leaq 0x6acd(%rip), %rsi      # 0x8deba
leaq -0x128(%rbp), %rdi
callq 0x4450
jmp 0x873fb
movq -0x198(%rbp), %rax
movq (%rax), %rsi
leaq -0x150(%rbp), %rdi
callq 0x15db0
jmp 0x87413
leaq -0x171(%rbp), %rdi
movq %rdi, -0x1c8(%rbp)
callq 0x45f0
movq -0x1c8(%rbp), %rdx
leaq 0xa40b(%rip), %rsi      # 0x9183f
leaq -0x170(%rbp), %rdi
callq 0x4450
jmp 0x87442
movq -0x198(%rbp), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %r9
leaq -0x128(%rbp), %rsi
leaq -0x150(%rbp), %rdx
leaq -0x170(%rbp), %rcx
leaq -0x48(%rbp), %r8
callq 0x84430
jmp 0x87470
leaq -0x170(%rbp), %rdi
callq 0x4688
leaq -0x171(%rbp), %rdi
callq 0x4380
leaq -0x150(%rbp), %rdi
callq 0x4688
leaq -0x128(%rbp), %rdi
callq 0x4688
leaq -0x129(%rbp), %rdi
callq 0x4380
jmp 0x87522
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x87514
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x87508
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x874f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x170(%rbp), %rdi
callq 0x4688
leaq -0x171(%rbp), %rdi
callq 0x4380
leaq -0x150(%rbp), %rdi
callq 0x4688
leaq -0x128(%rbp), %rdi
callq 0x4688
leaq -0x129(%rbp), %rdi
callq 0x4380
jmp 0x87568
movq -0x198(%rbp), %rdi
movq (%rdi), %rax
movq %rax, -0x180(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rsi
callq 0x193f0
jmp 0x87541
movq -0x180(%rbp), %rax
movq %rax, -0x1d0(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x4688
movq -0x1d0(%rbp), %rax
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
leaq -0x48(%rbp), %rdi
callq 0x4688
movq -0x58(%rbp), %rdi
callq 0x45e0
nopw (%rax,%rax)