// File: kage08[P]RegexLibrary/Resource.cpp
// Function: concat(NFA&, NFA&)
NFA concat(NFA& A, NFA& B){
  NFA C(A.noStates+B.noStates,A.alphabet);
  for(uLong i=0;i<A.noStates;i++){
    for(auto pb: A.Trans[i])
      C.addTransition(i,pb.second,pb.first);
  }
  for(uLong i=0;i<B.noStates;i++){
    for(auto pb: B.Trans[i])
      C.addTransition(i+A.noStates,pb.second+A.noStates,pb.first);
  }
  for(uLong f:A.acceptStates)
    C.addTransition(f,A.noStates,'@');
  for(uLong f: B.acceptStates)
    C.acceptStates.insert(f+A.noStates);

  return C;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0xf8(%rbp)
movq %rdi, %rax
movq %rax, -0xf0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rsi
movq -0x18(%rbp), %rax
addq (%rax), %rsi
movq -0x10(%rbp), %rdx
addq $0x50, %rdx
callq 0x2570
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x3489
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movq -0x28(%rbp), %rsi
callq 0x5a00
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x5bc0
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
callq 0x5bf0
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x5c20
testb $0x1, %al
jne 0x3422
jmp 0x3476
leaq -0x38(%rbp), %rdi
callq 0x5c50
movq -0xf8(%rbp), %rdi
movups (%rax), %xmm0
movaps %xmm0, -0x50(%rbp)
movq -0x28(%rbp), %rsi
movq -0x48(%rbp), %rdx
movsbl -0x50(%rbp), %ecx
callq 0x2990
jmp 0x344c
jmp 0x344e
leaq -0x38(%rbp), %rdi
callq 0x5cc0
jmp 0x340f
movq -0xf8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
callq 0x5aa0
jmp 0x36cc
jmp 0x3478
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x33cf
movq $0x0, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x3544
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
movq -0x68(%rbp), %rsi
callq 0x5a00
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
callq 0x5bc0
movq %rax, -0x78(%rbp)
movq -0x70(%rbp), %rdi
callq 0x5bf0
movq %rax, -0x80(%rbp)
leaq -0x78(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x5c20
testb $0x1, %al
jne 0x34e4
jmp 0x3531
leaq -0x78(%rbp), %rdi
callq 0x5c50
movq -0xf8(%rbp), %rdi
movups (%rax), %xmm0
movaps %xmm0, -0x90(%rbp)
movq -0x68(%rbp), %rsi
movq -0x10(%rbp), %rax
movq (%rax), %rax
addq %rax, %rsi
movq -0x88(%rbp), %rdx
addq %rax, %rdx
movsbl -0x90(%rbp), %ecx
callq 0x2990
jmp 0x3524
jmp 0x3526
leaq -0x78(%rbp), %rdi
callq 0x5cc0
jmp 0x34d1
jmp 0x3533
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
jmp 0x3491
movq -0x10(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rdi
callq 0x5b10
movq %rax, -0xa0(%rbp)
movq -0x98(%rbp), %rdi
callq 0x5b40
movq %rax, -0xa8(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x5b70
testb $0x1, %al
jne 0x3592
jmp 0x35d9
leaq -0xa0(%rbp), %rdi
callq 0x5ba0
movq -0xf8(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rsi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
movl $0x40, %ecx
callq 0x2990
jmp 0x35c9
jmp 0x35cb
leaq -0xa0(%rbp), %rdi
callq 0x5dc0
jmp 0x3579
movq -0x18(%rbp), %rax
addq $0x20, %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rdi
callq 0x5b10
movq %rax, -0xc0(%rbp)
movq -0xb8(%rbp), %rdi
callq 0x5b40
movq %rax, -0xc8(%rbp)
leaq -0xc0(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x5b70
testb $0x1, %al
jne 0x3627
jmp 0x36a6
leaq -0xc0(%rbp), %rdi
callq 0x5ba0
movq -0xf8(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0xd0(%rbp)
addq $0x20, %rdi
movq -0xd0(%rbp), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
addq %rcx, %rax
movq %rax, -0xd8(%rbp)
leaq -0xd8(%rbp), %rsi
callq 0x59b0
movb %dl, -0x101(%rbp)
movq %rax, -0x100(%rbp)
jmp 0x367b
movb -0x101(%rbp), %al
movq -0x100(%rbp), %rcx
movq %rcx, -0xe8(%rbp)
movb %al, -0xe0(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x5dc0
jmp 0x360e
movb $0x1, -0x19(%rbp)
testb $0x1, -0x19(%rbp)
jne 0x36bc
movq -0xf8(%rbp), %rdi
callq 0x5aa0
movq -0xf0(%rbp), %rax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x2380
nopw %cs:(%rax,%rax)