// File: jstaursky[P]hutch/src/Sleigh/slgh_compile.cc
// Function: SleighCompile::newSpace(SpaceQuality*)
void SleighCompile::newSpace(SpaceQuality *qual)

{
  if (qual->size == 0) {
    reportError("Space definition missing size attribute",true);
    delete qual;
    return;
  }

  int4 delay = (qual->type == SpaceQuality::registertype) ? 0 : 1;
  AddrSpace *spc = new AddrSpace(this,this,IPTR_PROCESSOR,qual->name,qual->size,qual->wordsize,numSpaces(),AddrSpace::hasphysical,delay);
  insertSpace(spc);
  if (qual->isdefault) {
    if (getDefaultSpace() != (AddrSpace *)0)
      reportError("Multiple default spaces",true);
    else {
      setDefaultSpace(spc->getIndex());	// Make the flagged space the default
      pcode.setDefaultSpace(spc);
    }
  }
  delete qual;
  addSymbol( new SpaceSymbol(spc) );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x24(%rax)
jne 0x63fec
leaq -0x31(%rbp), %rdi
movq %rdi, -0x88(%rbp)
callq 0x118c0
movq -0x88(%rbp), %rdx
leaq 0x75742(%rip), %rsi     # 0xd9699
leaq -0x30(%rbp), %rdi
callq 0x14430
jmp 0x63f62
movq -0x80(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x1, %edx
callq 0x603b0
jmp 0x63f76
leaq -0x30(%rbp), %rdi
callq 0x11300
leaq -0x31(%rbp), %rdi
callq 0x114d0
movq -0x10(%rbp), %rax
movq %rax, -0x90(%rbp)
cmpq $0x0, %rax
je 0x63fb6
movq -0x90(%rbp), %rdi
callq 0x6be50
movq -0x90(%rbp), %rdi
movl $0x30, %esi
callq 0x11450
jmp 0x641f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x63fde
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x11300
leaq -0x31(%rbp), %rdi
callq 0x114d0
jmp 0x64216
movq -0x10(%rbp), %rax
movl 0x20(%rax), %eax
subl $0x1, %eax
setne %al
movzbl %al, %eax
movl %eax, -0x48(%rbp)
movl $0x70, %edi
callq 0x11440
movq -0x80(%rbp), %rdi
movq %rax, -0xb0(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xa8(%rbp)
movl 0x24(%rax), %ecx
movl %ecx, -0x9c(%rbp)
movl 0x28(%rax), %eax
movl %eax, -0x98(%rbp)
callq 0x481b0
movl %eax, -0x94(%rbp)
jmp 0x6403e
movl -0x9c(%rbp), %r9d
movq -0xa8(%rbp), %r8
movq -0x80(%rbp), %rdx
movq -0xb0(%rbp), %rdi
movl -0x98(%rbp), %ecx
movl -0x94(%rbp), %esi
movl -0x48(%rbp), %r10d
movq %rsp, %rax
movl %r10d, 0x18(%rax)
movl %esi, 0x8(%rax)
movl %ecx, (%rax)
movl $0x100, 0x10(%rax)      # imm = 0x100
movl $0x1, %ecx
movq %rdx, %rsi
callq 0xbdca0
jmp 0x64089
movq -0x80(%rbp), %rdi
movq -0xb0(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rsi
callq 0xc3c10
movq -0x10(%rbp), %rax
testb $0x1, 0x2c(%rax)
je 0x64190
movq -0x80(%rbp), %rdi
callq 0x14970
cmpq $0x0, %rax
je 0x64166
leaq -0x71(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x118c0
movq -0xb8(%rbp), %rdx
leaq 0x755e1(%rip), %rsi     # 0xd96c1
leaq -0x70(%rbp), %rdi
callq 0x14430
jmp 0x640eb
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rsi
movl $0x1, %edx
callq 0x603b0
jmp 0x640ff
leaq -0x70(%rbp), %rdi
callq 0x11300
leaq -0x71(%rbp), %rdi
callq 0x114d0
jmp 0x6418e
movq -0xb0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x70, %esi
callq 0x11450
jmp 0x64216
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x64158
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x11300
leaq -0x71(%rbp), %rdi
callq 0x114d0
jmp 0x64216
movq -0x50(%rbp), %rdi
callq 0x158c0
movq -0x80(%rbp), %rdi
movl %eax, %esi
callq 0xc4550
movq -0x80(%rbp), %rdi
addq $0x1e0, %rdi            # imm = 0x1E0
movq -0x50(%rbp), %rsi
callq 0x48110
jmp 0x64190
movq -0x10(%rbp), %rax
movq %rax, -0xc0(%rbp)
cmpq $0x0, %rax
je 0x641be
movq -0xc0(%rbp), %rdi
callq 0x6be50
movq -0xc0(%rbp), %rdi
movl $0x30, %esi
callq 0x11450
movl $0x38, %edi
callq 0x11440
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xc8(%rbp)
movq -0x50(%rbp), %rsi
callq 0x48250
jmp 0x641e0
movq -0xc8(%rbp), %rsi
movq -0x80(%rbp), %rdi
callq 0x60f90
addq $0xf0, %rsp
popq %rbp
retq
movq -0xc8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x38, %esi
callq 0x11450
movq -0x40(%rbp), %rdi
callq 0x118b0
nop