// File: jstaursky[P]hutch/src/Sleigh/globalcontext.cc
// Function: ContextInternal::registerVariable(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, int)
void ContextInternal::registerVariable(const string &nm,int4 sbit,int4 ebit)

{
  if (!database.empty())
    throw LowlevelError("Cannot register new context variables after database is initialized");

  ContextBitRange bitrange(sbit,ebit);
  int4 sz = sbit/(8*sizeof(uintm)) + 1;
  if ((ebit/(8*sizeof(uintm)) + 1) != sz)
    throw LowlevelError("Context variable does not fit in one word");
  if (sz > size) {
    size = sz;
    database.defaultValue().reset(size);
  }
  variables[nm] = bitrange;
}

// Assembly:
subq $0xb8, %rsp
movq %rdi, 0xb0(%rsp)
movq %rsi, 0xa8(%rsp)
movl %edx, 0xa4(%rsp)
movl %ecx, 0xa0(%rsp)
movq 0xb0(%rsp), %rdi
movq %rdi, 0x20(%rsp)
addq $0x40, %rdi
callq 0xe2b40
testb $0x1, %al
jne 0xec204
movb $0x1, 0x6b(%rsp)
movl $0x20, %edi
callq 0xd2b40
movq %rax, 0x10(%rsp)
leaq 0x7f(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0xe0c80
movq 0x18(%rsp), %rdx
leaq 0x9b0c8(%rip), %rsi     # 0x18723a
leaq 0x80(%rsp), %rdi
callq 0xe00a0
jmp 0xec181
movq 0x10(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0xd1ae0
jmp 0xec195
movq 0x10(%rsp), %rdi
movb $0x0, 0x6b(%rsp)
movq 0xdbcea(%rip), %rsi     # 0x1c7e90
movq 0xdba23(%rip), %rdx     # 0x1c7bd0
callq 0xe01f0
jmp 0xec372
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
jmp 0xec1e2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
leaq 0x80(%rsp), %rdi
callq 0xd4550
leaq 0x7f(%rsp), %rdi
callq 0xd8ec0
testb $0x1, 0x6b(%rsp)
jne 0xec1f5
jmp 0xec1ff
movq 0x10(%rsp), %rdi
callq 0xd5400
jmp 0xec368
movl 0xa4(%rsp), %esi
movl 0xa0(%rsp), %edx
leaq 0x54(%rsp), %rdi
callq 0xe0560
movslq 0xa4(%rsp), %rax
shrq $0x5, %rax
addq $0x1, %rax
movl %eax, 0x50(%rsp)
movslq 0xa0(%rsp), %rax
shrq $0x5, %rax
addq $0x1, %rax
movslq 0x50(%rsp), %rcx
cmpq %rcx, %rax
je 0xec2ff
movb $0x1, 0x2e(%rsp)
movl $0x20, %edi
callq 0xd2b40
movq %rax, (%rsp)
leaq 0x2f(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0xe0c80
movq 0x8(%rsp), %rdx
leaq 0x9b002(%rip), %rsi     # 0x18727e
leaq 0x30(%rsp), %rdi
callq 0xe00a0
jmp 0xec288
movq (%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0xd1ae0
jmp 0xec298
movq (%rsp), %rdi
movb $0x0, 0x2e(%rsp)
movq 0xdbbe8(%rip), %rsi     # 0x1c7e90
movq 0xdb921(%rip), %rdx     # 0x1c7bd0
callq 0xe01f0
jmp 0xec372
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
jmp 0xec2e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
leaq 0x30(%rsp), %rdi
callq 0xd4550
leaq 0x2f(%rsp), %rdi
callq 0xd8ec0
testb $0x1, 0x2e(%rsp)
jne 0xec2f4
jmp 0xec2fd
movq (%rsp), %rdi
callq 0xd5400
jmp 0xec368
movq 0x20(%rsp), %rcx
movl 0x50(%rsp), %eax
cmpl 0x8(%rcx), %eax
jle 0xec332
movq 0x20(%rsp), %rdi
movl 0x50(%rsp), %eax
movl %eax, 0x8(%rdi)
addq $0x40, %rdi
callq 0xcece0
movq %rax, %rdi
movq 0x20(%rsp), %rax
movl 0x8(%rax), %esi
callq 0xcef30
movq 0x20(%rsp), %rdi
addq $0x10, %rdi
movq 0xa8(%rsp), %rsi
callq 0xe1730
movq 0x54(%rsp), %rcx
movq %rcx, (%rax)
movq 0x5c(%rsp), %rcx
movq %rcx, 0x8(%rax)
movl 0x64(%rsp), %ecx
movl %ecx, 0x10(%rax)
addq $0xb8, %rsp
retq
movq 0x70(%rsp), %rdi
callq 0xe0be0
nopw %cs:(%rax,%rax)