// File: /workspace/github_cpp_makefile_star2_O3/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 0x40f20
cmpb $0x0, 0x21(%r15)
je 0x5be25
movq (%r14), %rdi
movq (%rdi), %rax
callq *0x60(%rax)
testb %al, %al
je 0x5beda
movb 0x20(%r14), %al
jmp 0x5be2d
movb 0x20(%r14), %al
testb %al, %al
je 0x5be4d
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testb $0x1, %al
je 0x5bea2
movq (%r15), %rdi
movq (%rdi), %rax
callq *0x60(%rax)
testb %al, %al
je 0x5bf8f
movb $0x1, 0x20(%rbx)
jmp 0x5bea2
movq 0x8(%r15), %rax
movq 0x10(%r15), %rcx
xorl %ebp, %ebp
cmpq %rcx, %rax
je 0x5be68
movq (%rax), %rdx
addl 0x20(%rdx), %ebp
addq $0x8, %rax
jmp 0x5be57
movq 0x8(%r14), %r13
cmpq 0x10(%r14), %r13
je 0x5be9b
movq 0x10(%rbx), %rsi
cmpq 0x18(%rbx), %rsi
je 0x5be8a
movq (%r13), %rax
movq %rax, (%rsi)
addq $0x8, 0x10(%rbx)
jmp 0x5be95
movq %r12, %rdi
movq %r13, %rdx
callq 0x409b0
addq $0x8, %r13
jmp 0x5be6c
movb 0x21(%r14), %al
movb %al, 0x21(%rbx)
cmpb $0x1, 0x21(%rbx)
jne 0x5beb2
cmpb $0x1, 0x20(%rbx)
je 0x5bf36
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 0x247f1(%rip), %rsi     # 0x806e9
leaq 0x24806(%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 0x46f6e(%rip), %rsi     # 0xa2e90
movq 0x46d0f(%rip), %rdx     # 0xa2c38
movq %r15, %rdi
callq 0x41d70
jmp 0x5bfe6
movl $0x20, %edi
callq 0x3fb00
movq %rax, %r15
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x247b2(%rip), %rsi     # 0x80706
leaq 0x247c5(%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 0x46f12(%rip), %rsi     # 0xa2e90
movq 0x46cb3(%rip), %rdx     # 0xa2c38
movq %r15, %rdi
callq 0x41d70
jmp 0x5bfe6
movl $0x20, %edi
callq 0x3fb00
movq %rax, %r15
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x2473c(%rip), %rsi     # 0x806e9
leaq 0x24751(%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 0x46eb9(%rip), %rsi     # 0xa2e90
movq 0x46c5a(%rip), %rdx     # 0xa2c38
movq %r15, %rdi
callq 0x41d70
jmp 0x5bfee
jmp 0x5c00f
jmp 0x5bfee
jmp 0x5c00f
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x5c008
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x40880
testb %bpl, %bpl
jne 0x5c012
jmp 0x5c021
movq %rax, %r14
movq %r15, %rdi
callq 0x40090
jmp 0x5c021
jmp 0x5c01e
movq %rax, %r14
movq %rbx, %rdi
callq 0x3fa70
movq %r14, %rdi
callq 0x41f10
nop