// File: /workspace/github_cpp_makefile_star2_O2/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)
movb 0x20(%rsi), %al
movb %al, 0x20(%rdi)
movb 0x21(%rsi), %al
movb %al, 0x21(%rdi)
addq $0x8, %rsi
movq %r12, %rdi
callq 0x50190
cmpb $0x0, 0x21(%r15)
je 0x6764b
movq (%r14), %rdi
movq (%rdi), %rax
callq *0x60(%rax)
testb %al, %al
je 0x676e2
movb 0x20(%r14), %al
jmp 0x67653
movb 0x20(%r14), %al
testb %al, %al
je 0x67671
pushq $-0x1
popq %rbp
testb $0x1, %al
je 0x676ae
movq (%r15), %rdi
movq (%rdi), %rax
callq *0x60(%rax)
testb %al, %al
je 0x6777b
movb $0x1, 0x20(%rbx)
jmp 0x676ae
movq 0x8(%r15), %rax
movq 0x10(%r15), %rcx
xorl %ebp, %ebp
cmpq %rcx, %rax
je 0x6768c
movq (%rax), %rdx
addl 0x20(%rdx), %ebp
addq $0x8, %rax
jmp 0x6767b
movq 0x8(%r14), %r13
cmpq 0x10(%r14), %r13
je 0x676a7
movq %r12, %rdi
movq %r13, %rsi
callq 0x50ab0
addq $0x8, %r13
jmp 0x67690
movb 0x21(%r14), %al
movb %al, 0x21(%rbx)
cmpb $0x1, 0x21(%rbx)
jne 0x676ba
cmpb $0x1, 0x20(%rbx)
je 0x67730
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
pushq $0x20
popq %rdi
callq 0x4e180
movq %rax, %r15
leaq 0x1ffd5(%rip), %rsi     # 0x876c9
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x515e0
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x4ddf0
xorl %ebp, %ebp
movq 0x4776c(%rip), %rsi     # 0xaee88
movq 0x47515(%rip), %rdx     # 0xaec38
movq %r15, %rdi
callq 0x51630
jmp 0x677c4
pushq $0x20
popq %rdi
callq 0x4e180
movq %rax, %r15
leaq 0x1ffa4(%rip), %rsi     # 0x876e6
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x515e0
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x4ddf0
xorl %ebp, %ebp
movq 0x4771e(%rip), %rsi     # 0xaee88
movq 0x474c7(%rip), %rdx     # 0xaec38
movq %r15, %rdi
callq 0x51630
jmp 0x677c4
pushq $0x20
popq %rdi
callq 0x4e180
movq %rax, %r15
leaq 0x1ff3c(%rip), %rsi     # 0x876c9
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x515e0
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x4ddf0
xorl %ebp, %ebp
movq 0x476d3(%rip), %rsi     # 0xaee88
movq 0x4747c(%rip), %rdx     # 0xaec38
movq %r15, %rdi
callq 0x51630
jmp 0x677cc
jmp 0x677e0
jmp 0x677cc
jmp 0x677e0
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x4e020
testb %bpl, %bpl
jne 0x677e3
jmp 0x677f2
movq %rax, %r14
movq %r15, %rdi
callq 0x4ea60
jmp 0x677f2
jmp 0x677ef
movq %rax, %r14
movq %rbx, %rdi
callq 0x4e060
movq %r14, %rdi
callq 0x518c0