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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x108(%rbp)
movq %rdi, %rax
movq %rax, -0x110(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
movq -0x10(%rbp), %rdx
movq (%rdx), %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rcx
leaq 0x1(%rax,%rcx), %rsi
addq $0x50, %rdx
callq 0x2570
movq -0x108(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
movl $0x40, %ecx
callq 0x2990
jmp 0x2ef4
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x2fbc
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movq -0x38(%rbp), %rsi
callq 0x5a00
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
callq 0x5bc0
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rdi
callq 0x5bf0
movq %rax, -0x50(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x5c20
testb $0x1, %al
jne 0x2f4f
jmp 0x2fa9
leaq -0x48(%rbp), %rdi
callq 0x5c50
movq -0x108(%rbp), %rdi
movups (%rax), %xmm0
movaps %xmm0, -0x60(%rbp)
movq -0x38(%rbp), %rsi
incq %rsi
movq -0x58(%rbp), %rdx
incq %rdx
movsbl -0x60(%rbp), %ecx
callq 0x2990
jmp 0x2f7f
jmp 0x2f81
leaq -0x48(%rbp), %rdi
callq 0x5cc0
jmp 0x2f3c
movq -0x108(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x5aa0
jmp 0x325a
jmp 0x2fab
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x2efc
movq -0x108(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
incq %rdx
xorl %eax, %eax
movl %eax, %esi
movl $0x40, %ecx
callq 0x2990
jmp 0x2fdd
movq $0x0, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x309c
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 0x3038
jmp 0x3089
leaq -0x78(%rbp), %rdi
callq 0x5c50
movq -0x108(%rbp), %rdi
movups (%rax), %xmm0
movaps %xmm0, -0x90(%rbp)
movq -0x68(%rbp), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
leaq 0x1(%rax,%rcx), %rsi
movq -0x88(%rbp), %rax
leaq 0x1(%rax,%rcx), %rdx
movsbl -0x90(%rbp), %ecx
callq 0x2990
jmp 0x307c
jmp 0x307e
leaq -0x78(%rbp), %rdi
callq 0x5cc0
jmp 0x3025
jmp 0x308b
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
jmp 0x2fe5
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 0x30ea
jmp 0x3162
leaq -0xa0(%rbp), %rdi
callq 0x5ba0
movq -0x108(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0xb0(%rbp)
addq $0x20, %rdi
movq -0xb0(%rbp), %rax
incq %rax
movq %rax, -0xb8(%rbp)
leaq -0xb8(%rbp), %rsi
callq 0x59b0
movb %dl, -0x119(%rbp)
movq %rax, -0x118(%rbp)
jmp 0x3137
movb -0x119(%rbp), %al
movq -0x118(%rbp), %rcx
movq %rcx, -0xc8(%rbp)
movb %al, -0xc0(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x5dc0
jmp 0x30d1
movq -0x18(%rbp), %rax
addq $0x20, %rax
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rdi
callq 0x5b10
movq %rax, -0xd8(%rbp)
movq -0xd0(%rbp), %rdi
callq 0x5b40
movq %rax, -0xe0(%rbp)
leaq -0xd8(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x5b70
testb $0x1, %al
jne 0x31b3
jmp 0x3234
leaq -0xd8(%rbp), %rdi
callq 0x5ba0
movq -0x108(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0xe8(%rbp)
addq $0x20, %rdi
movq -0xe8(%rbp), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
leaq 0x1(%rax,%rcx), %rax
movq %rax, -0xf0(%rbp)
leaq -0xf0(%rbp), %rsi
callq 0x59b0
movb %dl, -0x129(%rbp)
movq %rax, -0x128(%rbp)
jmp 0x3209
movb -0x129(%rbp), %al
movq -0x128(%rbp), %rcx
movq %rcx, -0x100(%rbp)
movb %al, -0xf8(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x5dc0
jmp 0x3197
movb $0x1, -0x19(%rbp)
testb $0x1, -0x19(%rbp)
jne 0x324a
movq -0x108(%rbp), %rdi
callq 0x5aa0
movq -0x110(%rbp), %rax
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x2380
nopw %cs:(%rax,%rax)