// File: jstaursky[P]hutch/src/Sleigh/slgh_compile.cc
// Function: SleighCompile::attachValues(std::vector<SleighSymbol*, std::allocator<SleighSymbol*>>*, std::vector<long, std::allocator<long>>*)
void SleighCompile::attachValues(vector<SleighSymbol *> *symlist,vector<intb> *numlist)

{
  SleighSymbol *dupsym = dedupSymbolList(symlist);
  if (dupsym != (SleighSymbol *)0)
    reportWarning("\"attach values\" list contains duplicate entries: "+dupsym->getName(),true);
  for(int4 i=0;i<symlist->size();++i) {
    ValueSymbol *sym = (ValueSymbol *)(*symlist)[i];
    if (sym == (ValueSymbol *)0) continue;
    PatternValue *patval = sym->getPatternValue();
    if (patval->maxValue() + 1 != numlist->size()) {
      reportError("Attach value " + sym->getName() + " is wrong size for list", true);
    }
    symtab.replaceSymbol(sym, new ValueMapSymbol(sym->getName(),patval,*numlist));
  }
  delete numlist;
  delete symlist;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
movq -0x10(%rbp), %rsi
callq 0x64970
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x64ae8
movq -0x20(%rbp), %rdi
callq 0x401a0
movq %rax, %rdx
leaq 0x74c74(%rip), %rsi     # 0xd970d
leaq -0x40(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
callq 0x147f0
movq -0xa8(%rbp), %rdi
movq -0xb0(%rbp), %rsi
movl $0x1, %edx
callq 0x62430
jmp 0x64ac3
leaq -0x40(%rbp), %rdi
callq 0x11300
jmp 0x64ae8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x11300
jmp 0x64d21
movl $0x0, -0x50(%rbp)
movslq -0x50(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x6c010
movq %rax, %rcx
movq -0xb8(%rbp), %rax
cmpq %rcx, %rax
jae 0x64cbc
movq -0x10(%rbp), %rdi
movslq -0x50(%rbp), %rsi
callq 0x6c030
movq (%rax), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
jne 0x64b36
jmp 0x64c8f
movq -0x58(%rbp), %rdi
movq (%rdi), %rax
callq *0x60(%rax)
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rdi
movq (%rdi), %rax
callq *0x58(%rax)
addq $0x1, %rax
movq %rax, -0xc0(%rbp)
movq -0x18(%rbp), %rdi
callq 0x6c050
movq %rax, %rcx
movq -0xc0(%rbp), %rax
cmpq %rcx, %rax
je 0x64c16
movq -0x58(%rbp), %rdi
callq 0x401a0
movq %rax, %rdx
leaq 0x74bb7(%rip), %rsi     # 0xd973f
leaq -0xa0(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x147f0
movq -0xc8(%rbp), %rsi
leaq 0x74ba4(%rip), %rdx     # 0xd974d
leaq -0x80(%rbp), %rdi
callq 0x6b540
jmp 0x64bb4
movq -0xa8(%rbp), %rdi
leaq -0x80(%rbp), %rsi
movl $0x1, %edx
callq 0x603b0
jmp 0x64bcb
leaq -0x80(%rbp), %rdi
callq 0x11300
leaq -0xa0(%rbp), %rdi
callq 0x11300
jmp 0x64c16
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x64c05
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x11300
leaq -0xa0(%rbp), %rdi
callq 0x11300
jmp 0x64d21
movq -0xa8(%rbp), %rax
addq $0x198, %rax            # imm = 0x198
movq %rax, -0xe8(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0xe0(%rbp)
movl $0x58, %edi
callq 0x11440
movq %rax, -0xd8(%rbp)
movq -0x58(%rbp), %rdi
callq 0x401a0
movq %rax, -0xd0(%rbp)
jmp 0x64c58
movq -0xd0(%rbp), %rsi
movq -0xd8(%rbp), %rdi
movq -0x60(%rbp), %rdx
movq -0x18(%rbp), %rcx
callq 0x6c070
jmp 0x64c75
movq -0xd8(%rbp), %rdx
movq -0xe0(%rbp), %rsi
movq -0xe8(%rbp), %rdi
callq 0xa2f40
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x64aef
movq -0xd8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
movl $0x58, %esi
callq 0x11450
jmp 0x64d21
movq -0x18(%rbp), %rax
movq %rax, -0xf0(%rbp)
cmpq $0x0, %rax
je 0x64cea
movq -0xf0(%rbp), %rdi
callq 0x6c110
movq -0xf0(%rbp), %rdi
movl $0x18, %esi
callq 0x11450
movq -0x10(%rbp), %rax
movq %rax, -0xf8(%rbp)
cmpq $0x0, %rax
je 0x64d18
movq -0xf8(%rbp), %rdi
callq 0x6c170
movq -0xf8(%rbp), %rdi
movl $0x18, %esi
callq 0x11450
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x118b0
nopw (%rax,%rax)