// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %r8, -0x38(%rbp)
movq %rcx, %r14
movq %rdx, %rcx
movq %rsi, %rdx
movq %rdi, %rbx
leaq -0xb8(%rbp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x34188
leaq 0xe0(%rbx), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0x34732
leaq 0xe8(%rbx), %rcx
cmpq %rcx, %rax
jne 0x33e7f
movq (%rbx), %r13
movq (%r14), %r15
leaq -0xb8(%rbp), %rsi
movq %r12, %rdi
callq 0x3423a
movq %r13, (%rax)
movq %r15, 0x8(%rax)
cmpq $-0x1, (%r14)
je 0x33dd8
leaq 0x5159(%rip), %rsi      # 0x38ee2
leaq -0x58(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x4130
movq (%rbx), %rsi
leaq -0x78(%rbp), %rdi
callq 0xc865
movq (%r14), %rsi
leaq -0x98(%rbp), %rdi
callq 0xc865
movq -0x38(%rbp), %rax
movq (%rax), %r9
leaq -0x58(%rbp), %rsi
leaq -0x78(%rbp), %rdx
leaq -0x98(%rbp), %rcx
leaq -0xb8(%rbp), %r8
movq %rbx, %rdi
callq 0x32694
jmp 0x33e34
leaq 0x5103(%rip), %rsi      # 0x38ee2
leaq -0x58(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x4130
movq (%rbx), %rsi
leaq -0x78(%rbp), %rdi
callq 0xc865
leaq 0x893c(%rip), %rsi      # 0x3c73b
leaq -0x98(%rbp), %rdi
leaq -0x2a(%rbp), %rdx
callq 0x4130
movq -0x38(%rbp), %rax
movq (%rax), %r9
leaq -0x58(%rbp), %rsi
leaq -0x78(%rbp), %rdx
leaq -0x98(%rbp), %rcx
leaq -0xb8(%rbp), %r8
movq %rbx, %rdi
callq 0x32694
leaq -0x98(%rbp), %rdi
callq 0x4598
leaq -0x78(%rbp), %rdi
callq 0x4598
leaq -0x58(%rbp), %rdi
callq 0x4598
movq (%rbx), %r15
movq (%r14), %rax
addq %r15, %rax
movq %rax, (%rbx)
leaq -0xb8(%rbp), %rdi
callq 0x4598
movq %r15, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x28
popq %rdi
callq 0x4180
movq %rax, %r14
leaq 0x8b8d(%rip), %rsi      # 0x3ca1e
leaq -0x58(%rbp), %rdi
leaq -0x78(%rbp), %rdx
callq 0x4130
movb $0x1, %r15b
leaq -0x58(%rbp), %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x2b53c
xorl %r15d, %r15d
leaq 0x1eeb7(%rip), %rsi     # 0x52d70
leaq -0x27618(%rip), %rdx    # 0xc8a8
movq %r14, %rdi
callq 0x44e0
jmp 0x33ef0
jmp 0x33f01
jmp 0x33f0f
jmp 0x33f21
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x4598
testb %r15b, %r15b
jne 0x33ee6
jmp 0x33f24
movq %rax, %rbx
movq %r14, %rdi
callq 0x4220
jmp 0x33f24
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
callq 0x4598
jmp 0x33f04
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x4598
jmp 0x33f12
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x4598
jmp 0x33f24
jmp 0x33f21
jmp 0x33f21
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
callq 0x4598
movq %rbx, %rdi
callq 0x4500