// File: /workspace/github_cpp_makefile_star2_O1/jstaursky[P]hutch/src/Sleigh/slghpatexpress.cc
// Function: TokenPattern::doCat(TokenPattern const&) const
TokenPattern TokenPattern::doCat(const TokenPattern &tokpat) const

{				// Return Concatenation of -this- and -tokpat-
  TokenPattern res((Pattern *)0);
  int4 sa;

  res.leftellipsis = leftellipsis;
  res.rightellipsis = rightellipsis;
  res.toklist = toklist;
  if (rightellipsis||tokpat.leftellipsis) { // Check for interior ellipsis
    if (rightellipsis) {
      if (!tokpat.alwaysInstructionTrue())
	throw SleighError("Interior ellipsis in pattern");
    }
    if (tokpat.leftellipsis) {
      if (!alwaysInstructionTrue())
	throw SleighError("Interior ellipsis in pattern");
      res.leftellipsis = true;
    }
    sa = -1;
  }
  else {
    sa = 0;
    vector<Token *>::const_iterator iter;

    for(iter=toklist.begin();iter!=toklist.end();++iter)
      sa += (*iter)->getSize();
    for(iter=tokpat.toklist.begin();iter!=tokpat.toklist.end();++iter)
      res.toklist.push_back(*iter);
    res.rightellipsis = tokpat.rightellipsis;
  }
  if (res.rightellipsis && res.leftellipsis)
    throw SleighError("Double ellipsis in pattern");
  if (sa < 0)
    res.pattern = pattern->doAnd(tokpat.pattern,0);
  else
    res.pattern = pattern->doAnd(tokpat.pattern,sa);
  return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x8(%rdi), %r12
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
movw $0x0, 0x20(%rdi)
movb 0x20(%rsi), %al
movb %al, 0x20(%rdi)
movb 0x21(%rsi), %al
movb %al, 0x21(%rdi)
addq $0x8, %rsi
movq %r12, %rdi
callq 0x40f10
movb 0x21(%r15), %al
testb %al, %al
je 0x5c0e3
movq (%r14), %rdi
movq (%rdi), %rax
callq *0x60(%rax)
testb %al, %al
je 0x5c17d
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpb $0x1, 0x20(%r14)
jne 0x5c145
movq (%r15), %rdi
movq (%rdi), %rax
callq *0x60(%rax)
testb %al, %al
je 0x5c232
movb $0x1, 0x20(%rbx)
jmp 0x5c145
cmpb $0x1, 0x20(%r14)
jne 0x5c0f0
testb %al, %al
jne 0x5c0af
jmp 0x5c0c0
movq 0x8(%r15), %rax
movq 0x10(%r15), %rcx
xorl %ebp, %ebp
cmpq %rcx, %rax
je 0x5c10b
movq (%rax), %rdx
addl 0x20(%rdx), %ebp
addq $0x8, %rax
jmp 0x5c0fa
movq 0x8(%r14), %r13
cmpq 0x10(%r14), %r13
je 0x5c13e
movq 0x10(%rbx), %rsi
cmpq 0x18(%rbx), %rsi
je 0x5c12d
movq (%r13), %rax
movq %rax, (%rsi)
addq $0x8, 0x10(%rbx)
jmp 0x5c138
movq %r12, %rdi
movq %r13, %rdx
callq 0x409a0
addq $0x8, %r13
jmp 0x5c10f
movb 0x21(%r14), %al
movb %al, 0x21(%rbx)
cmpb $0x1, 0x21(%rbx)
jne 0x5c155
cmpb $0x1, 0x20(%rbx)
je 0x5c1d9
movq (%r15), %rdi
movq (%r14), %rsi
movq (%rdi), %rax
xorl %edx, %edx
testl %ebp, %ebp
cmovgl %ebp, %edx
callq *0x28(%rax)
movq %rax, (%rbx)
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x20, %edi
callq 0x3fb00
movq %rax, %r15
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x2454e(%rip), %rsi     # 0x806e9
leaq 0x24563(%rip), %rdx     # 0x80705
leaq 0x8(%rsp), %rdi
callq 0x3f8a0
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x3f890
xorl %ebp, %ebp
movq 0x46ccb(%rip), %rsi     # 0xa2e90
movq 0x46a6c(%rip), %rdx     # 0xa2c38
movq %r15, %rdi
callq 0x41d60
jmp 0x5c289
movl $0x20, %edi
callq 0x3fb00
movq %rax, %r15
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x2450f(%rip), %rsi     # 0x80706
leaq 0x24522(%rip), %rdx     # 0x80720
leaq 0x8(%rsp), %rdi
callq 0x3f8a0
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x3f890
xorl %ebp, %ebp
movq 0x46c6f(%rip), %rsi     # 0xa2e90
movq 0x46a10(%rip), %rdx     # 0xa2c38
movq %r15, %rdi
callq 0x41d60
jmp 0x5c289
movl $0x20, %edi
callq 0x3fb00
movq %rax, %r15
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x24499(%rip), %rsi     # 0x806e9
leaq 0x244ae(%rip), %rdx     # 0x80705
leaq 0x8(%rsp), %rdi
callq 0x3f8a0
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x3f890
xorl %ebp, %ebp
movq 0x46c16(%rip), %rsi     # 0xa2e90
movq 0x469b7(%rip), %rdx     # 0xa2c38
movq %r15, %rdi
callq 0x41d60
jmp 0x5c291
jmp 0x5c2ad
jmp 0x5c291
jmp 0x5c2ad
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x5c2b3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x40870
jmp 0x5c2b3
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x5c2c7
movq %r15, %rdi
callq 0x40080
jmp 0x5c2c7
jmp 0x5c2c4
movq %rax, %r14
movq %rbx, %rdi
callq 0x3fa70
movq %r14, %rdi
callq 0x41f00
nop