// File: datourat[P]IP-label-for-graph-reachability/Graph.cpp
// Function: Graph::VectorUnion(std::vector<int, std::allocator<int>>&, std::vector<int, std::allocator<int>> const&)
void Graph::VectorUnion(vector<int>& v1, const vector<int>& v2){
        unsigned int v1size=v1.size(), v2size=v2.size();

        if(v1[v1size-1] < v2[0]){
                if(v1size==KEYNUM)
                        return ;
                else{
                        if(v2.begin()+KEYNUM-v1size < v2.end())
                                v1.insert(v1.end(), v2.begin(), v2.begin()+KEYNUM-v1size);
                        else
                                v1.insert(v1.end(), v2.begin(), v2.end());
                        return ;
                }
        }

        if(v1size==1){
                int i=0;
                for(; i<v2size; i++){
                        if(v2[i] >= v1[0]){
                                break;
                        }
                }
                if(i<KEYNUM)
                        v1.insert(v1.begin(), v2.begin(), v2.begin()+i);
                else{
                        v1=v2;
                        return ;
                }
                while(i<v2size && v2[i]==v1[0]){
                        i++;
                }
                if(v2size==KEYNUM&&i<v2size)
                        v1.insert(v1.end(), v2.begin()+i, v2.begin()+KEYNUM-1);
                else
                        v1.insert(v1.end(), v2.begin()+i, v2.end());
                return ;
        }


        int k=0;
        unsigned int i=0, j=0;
        static vector<int> v(KEYNUM);
        v.clear();

        while(k<KEYNUM && i<v1size && j<v2size){
                if(v1[i]==v2[j]){
                        v.push_back(v1[i]);
                        k++;
                        i++;
                        j++;
                }else if(v1[i]<v2[j]){
                        v.push_back(v1[i]);
                        k++;
                        i++;
                }else{
                        v.push_back(v2[j]);
                        k++;
                        j++;
                }
        }

        if(k>=KEYNUM){
                v1=v;
                return;
        }

        if(i!=v1size){
                if(v1.end() < v1.begin()+i+KEYNUM-v.size())
                        v.insert(v.end(), v1.begin()+i, v1.end());
                else
                        v.insert(v.end(), v1.begin()+i, v1.begin()+i+KEYNUM-v.size());
//              for(; k<KEYNUM && i<v1size; i++, k++){
//                      v.push_back(v1[i]);
//              }
        }
        if(j!=v2size){
                if(v2.end() < v2.begin()+j+KEYNUM-v.size())
                        v.insert(v.end(), v2.begin()+j, v2.end());
                else
                        v.insert(v.end(), v2.begin()+j, v2.begin()+j+KEYNUM-v.size());
//              for(; k<KEYNUM && j<v2size; j++, k++){
//                      v.push_back(v2[j]);
//              }
        }

        v1=v;
}

// Assembly:
subq $0x318, %rsp            # imm = 0x318
movq %rdi, 0x310(%rsp)
movq %rsi, 0x308(%rsp)
movq %rdx, 0x300(%rsp)
movq 0x310(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x308(%rsp), %rdi
callq 0x4c10
movl %eax, 0x2fc(%rsp)
movq 0x300(%rsp), %rdi
callq 0x4c10
movl %eax, 0x2f8(%rsp)
movq 0x308(%rsp), %rdi
movl 0x2fc(%rsp), %eax
subl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
callq 0x12960
movl (%rax), %eax
movl %eax, 0x6c(%rsp)
movq 0x300(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x13300
movq %rax, %rcx
movl 0x6c(%rsp), %eax
cmpl (%rcx), %eax
jge 0xbf5e
movq 0x60(%rsp), %rcx
movl 0x2fc(%rsp), %eax
cmpl (%rcx), %eax
jne 0xbd7a
jmp 0xca73
movq 0x300(%rsp), %rdi
callq 0x139a0
movq %rax, %rcx
movq 0x60(%rsp), %rax
movq %rcx, 0x2e0(%rsp)
movslq (%rax), %rsi
leaq 0x2e0(%rsp), %rdi
callq 0x139d0
movq %rax, 0x2e8(%rsp)
movl 0x2fc(%rsp), %eax
movl %eax, %esi
leaq 0x2e8(%rsp), %rdi
callq 0x13a10
movq %rax, 0x2f0(%rsp)
movq 0x300(%rsp), %rdi
callq 0x13a60
movq %rax, 0x2d8(%rsp)
leaq 0x2f0(%rsp), %rdi
leaq 0x2d8(%rsp), %rsi
callq 0x13960
testb $0x1, %al
jne 0xbe00
jmp 0xbece
movq 0x308(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x308(%rsp), %rdi
callq 0x122e0
movq %rax, 0x2c8(%rsp)
leaq 0x2d0(%rsp), %rdi
leaq 0x2c8(%rsp), %rsi
callq 0x13b50
movq 0x300(%rsp), %rdi
callq 0x139a0
movq %rax, 0x2c0(%rsp)
movq 0x300(%rsp), %rdi
callq 0x139a0
movq %rax, %rcx
movq 0x60(%rsp), %rax
movq %rcx, 0x2a8(%rsp)
movslq (%rax), %rsi
leaq 0x2a8(%rsp), %rdi
callq 0x139d0
movq %rax, 0x2b0(%rsp)
movl 0x2fc(%rsp), %eax
movl %eax, %esi
leaq 0x2b0(%rsp), %rdi
callq 0x13a10
movq 0x58(%rsp), %rdi
movq %rax, 0x2b8(%rsp)
movq 0x2d0(%rsp), %rsi
movq 0x2c0(%rsp), %rdx
movq 0x2b8(%rsp), %rcx
callq 0x13a90
movq %rax, 0x2a0(%rsp)
jmp 0xbf59
movq 0x308(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x308(%rsp), %rdi
callq 0x122e0
movq %rax, 0x290(%rsp)
leaq 0x298(%rsp), %rdi
leaq 0x290(%rsp), %rsi
callq 0x13b50
movq 0x300(%rsp), %rdi
callq 0x139a0
movq %rax, 0x288(%rsp)
movq 0x300(%rsp), %rdi
callq 0x13a60
movq 0x50(%rsp), %rdi
movq %rax, 0x280(%rsp)
movq 0x298(%rsp), %rsi
movq 0x288(%rsp), %rdx
movq 0x280(%rsp), %rcx
callq 0x13a90
movq %rax, 0x278(%rsp)
jmp 0xca73
cmpl $0x1, 0x2fc(%rsp)
jne 0xc2da
movl $0x0, 0x274(%rsp)
movl 0x274(%rsp), %eax
cmpl 0x2f8(%rsp), %eax
jae 0xbfd5
movq 0x300(%rsp), %rdi
movslq 0x274(%rsp), %rsi
callq 0x13300
movl (%rax), %eax
movl %eax, 0x4c(%rsp)
movq 0x308(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x12960
movq %rax, %rcx
movl 0x4c(%rsp), %eax
cmpl (%rcx), %eax
jl 0xbfc0
jmp 0xbfd5
jmp 0xbfc2
movl 0x274(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x274(%rsp)
jmp 0xbf77
movq 0x60(%rsp), %rcx
movl 0x274(%rsp), %eax
cmpl (%rcx), %eax
jge 0xc093
movq 0x308(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x308(%rsp), %rdi
callq 0x12270
movq %rax, 0x260(%rsp)
leaq 0x268(%rsp), %rdi
leaq 0x260(%rsp), %rsi
callq 0x13b50
movq 0x300(%rsp), %rdi
callq 0x139a0
movq %rax, 0x258(%rsp)
movq 0x300(%rsp), %rdi
callq 0x139a0
movq %rax, 0x248(%rsp)
movslq 0x274(%rsp), %rsi
leaq 0x248(%rsp), %rdi
callq 0x139d0
movq 0x40(%rsp), %rdi
movq %rax, 0x250(%rsp)
movq 0x268(%rsp), %rsi
movq 0x258(%rsp), %rdx
movq 0x250(%rsp), %rcx
callq 0x13a90
movq %rax, 0x240(%rsp)
jmp 0xc0ad
movq 0x300(%rsp), %rsi
movq 0x308(%rsp), %rdi
callq 0x11fb0
jmp 0xca73
jmp 0xc0af
movl 0x274(%rsp), %ecx
xorl %eax, %eax
cmpl 0x2f8(%rsp), %ecx
movb %al, 0x3f(%rsp)
jae 0xc101
movq 0x300(%rsp), %rdi
movslq 0x274(%rsp), %rsi
callq 0x13300
movl (%rax), %eax
movl %eax, 0x38(%rsp)
movq 0x308(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x12960
movq %rax, %rcx
movl 0x38(%rsp), %eax
cmpl (%rcx), %eax
sete %al
movb %al, 0x3f(%rsp)
movb 0x3f(%rsp), %al
testb $0x1, %al
jne 0xc10b
jmp 0xc11e
movl 0x274(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x274(%rsp)
jmp 0xc0af
movq 0x60(%rsp), %rcx
movl 0x2f8(%rsp), %eax
cmpl (%rcx), %eax
jne 0xc22d
movl 0x274(%rsp), %eax
cmpl 0x2f8(%rsp), %eax
jae 0xc22d
movq 0x308(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x308(%rsp), %rdi
callq 0x122e0
movq %rax, 0x230(%rsp)
leaq 0x238(%rsp), %rdi
leaq 0x230(%rsp), %rsi
callq 0x13b50
movq 0x300(%rsp), %rdi
callq 0x139a0
movq %rax, 0x220(%rsp)
movslq 0x274(%rsp), %rsi
leaq 0x220(%rsp), %rdi
callq 0x139d0
movq %rax, 0x228(%rsp)
movq 0x300(%rsp), %rdi
callq 0x139a0
movq %rax, %rcx
movq 0x60(%rsp), %rax
movq %rcx, 0x208(%rsp)
movslq (%rax), %rsi
leaq 0x208(%rsp), %rdi
callq 0x139d0
movq %rax, 0x210(%rsp)
leaq 0x210(%rsp), %rdi
movl $0x1, %esi
callq 0x13a10
movq 0x30(%rsp), %rdi
movq %rax, 0x218(%rsp)
movq 0x238(%rsp), %rsi
movq 0x228(%rsp), %rdx
movq 0x218(%rsp), %rcx
callq 0x13a90
movq %rax, 0x200(%rsp)
jmp 0xc2d5
movq 0x308(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x308(%rsp), %rdi
callq 0x122e0
movq %rax, 0x1f0(%rsp)
leaq 0x1f8(%rsp), %rdi
leaq 0x1f0(%rsp), %rsi
callq 0x13b50
movq 0x300(%rsp), %rdi
callq 0x139a0
movq %rax, 0x1e0(%rsp)
movslq 0x274(%rsp), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x139d0
movq %rax, 0x1e8(%rsp)
movq 0x300(%rsp), %rdi
callq 0x13a60
movq 0x28(%rsp), %rdi
movq %rax, 0x1d8(%rsp)
movq 0x1f8(%rsp), %rsi
movq 0x1e8(%rsp), %rdx
movq 0x1d8(%rsp), %rcx
callq 0x13a90
movq %rax, 0x1d0(%rsp)
jmp 0xca73
movl $0x0, 0x1cc(%rsp)
movl $0x0, 0x1c8(%rsp)
movl $0x0, 0x1c4(%rsp)
cmpb $0x0, 0x29016(%rip)     # 0x35318
jne 0xc37f
leaq 0x2900d(%rip), %rdi     # 0x35318
callq 0x3500
cmpl $0x0, %eax
je 0xc37f
movq 0x60(%rsp), %rax
movslq (%rax), %rax
movq %rax, 0x18(%rsp)
leaq 0x1c3(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x12990
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
leaq 0x28fbb(%rip), %rdi     # 0x35300
callq 0x129a0
jmp 0xc34c
leaq 0x1c3(%rsp), %rdi
callq 0x12a20
leaq 0x5240(%rip), %rdi      # 0x115a0
leaq 0x28f99(%rip), %rsi     # 0x35300
leaq 0x28f62(%rip), %rdx     # 0x352d0
callq 0x3260
leaq 0x28f9e(%rip), %rdi     # 0x35318
callq 0x31e0
leaq 0x28f7a(%rip), %rdi     # 0x35300
callq 0x11be0
movq 0x60(%rsp), %rdx
movl 0x1cc(%rsp), %ecx
xorl %eax, %eax
cmpl (%rdx), %ecx
movb %al, 0x17(%rsp)
jge 0xc3cc
movl 0x1c8(%rsp), %ecx
xorl %eax, %eax
cmpl 0x2fc(%rsp), %ecx
movb %al, 0x17(%rsp)
jae 0xc3cc
movl 0x1c4(%rsp), %eax
cmpl 0x2f8(%rsp), %eax
setb %al
movb %al, 0x17(%rsp)
movb 0x17(%rsp), %al
testb $0x1, %al
jne 0xc3d9
jmp 0xc57d
movq 0x308(%rsp), %rdi
movl 0x1c8(%rsp), %eax
movl %eax, %esi
callq 0x12960
movl (%rax), %eax
movl %eax, 0x10(%rsp)
movq 0x300(%rsp), %rdi
movl 0x1c4(%rsp), %eax
movl %eax, %esi
callq 0x13300
movq %rax, %rcx
movl 0x10(%rsp), %eax
cmpl (%rcx), %eax
jne 0xc4a9
movq 0x308(%rsp), %rdi
movl 0x1c8(%rsp), %eax
movl %eax, %esi
callq 0x12960
movq %rax, %rsi
leaq 0x28ec6(%rip), %rdi     # 0x35300
callq 0x12660
movl 0x1cc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1cc(%rsp)
movl 0x1c8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c8(%rsp)
movl 0x1c4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c4(%rsp)
jmp 0xc578
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
leaq 0x1c3(%rsp), %rdi
callq 0x12a20
leaq 0x28e79(%rip), %rdi     # 0x35318
callq 0x31d0
jmp 0xca7b
movq 0x308(%rsp), %rdi
movl 0x1c8(%rsp), %eax
movl %eax, %esi
callq 0x12960
movl (%rax), %eax
movl %eax, 0xc(%rsp)
movq 0x300(%rsp), %rdi
movl 0x1c4(%rsp), %eax
movl %eax, %esi
callq 0x13300
movq %rax, %rcx
movl 0xc(%rsp), %eax
cmpl (%rcx), %eax
jge 0xc52f
movq 0x308(%rsp), %rdi
movl 0x1c8(%rsp), %eax
movl %eax, %esi
callq 0x12960
movq %rax, %rsi
leaq 0x28dfa(%rip), %rdi     # 0x35300
callq 0x12660
movl 0x1cc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1cc(%rsp)
movl 0x1c8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c8(%rsp)
jmp 0xc576
movq 0x300(%rsp), %rdi
movl 0x1c4(%rsp), %eax
movl %eax, %esi
callq 0x13300
movq %rax, %rsi
leaq 0x28db1(%rip), %rdi     # 0x35300
callq 0x12660
movl 0x1cc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1cc(%rsp)
movl 0x1c4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c4(%rsp)
jmp 0xc578
jmp 0xc38b
movq 0x60(%rsp), %rcx
movl 0x1cc(%rsp), %eax
cmpl (%rcx), %eax
jl 0xc5a6
movq 0x308(%rsp), %rdi
leaq 0x28d64(%rip), %rsi     # 0x35300
callq 0x11fb0
jmp 0xca73
movl 0x1c8(%rsp), %eax
cmpl 0x2fc(%rsp), %eax
je 0xc807
movq 0x308(%rsp), %rdi
callq 0x122e0
movq %rax, 0x1a8(%rsp)
movq 0x308(%rsp), %rdi
callq 0x12270
movq %rax, 0x188(%rsp)
movl 0x1c8(%rsp), %eax
movl %eax, %esi
leaq 0x188(%rsp), %rdi
callq 0x13bd0
movq %rax, %rcx
movq 0x60(%rsp), %rax
movq %rcx, 0x190(%rsp)
movslq (%rax), %rsi
leaq 0x190(%rsp), %rdi
callq 0x13bd0
movq %rax, 0x198(%rsp)
leaq 0x28cd7(%rip), %rdi     # 0x35300
callq 0x4c10
movq %rax, %rsi
leaq 0x198(%rsp), %rdi
callq 0x13c10
movq %rax, 0x1a0(%rsp)
leaq 0x1a8(%rsp), %rdi
leaq 0x1a0(%rsp), %rsi
callq 0x13b90
testb $0x1, %al
jne 0xc664
jmp 0xc706
leaq 0x28c95(%rip), %rdi     # 0x35300
callq 0x122e0
movq %rax, 0x178(%rsp)
leaq 0x180(%rsp), %rdi
leaq 0x178(%rsp), %rsi
callq 0x13b50
movq 0x308(%rsp), %rdi
callq 0x12270
movq %rax, 0x168(%rsp)
movl 0x1c8(%rsp), %eax
movl %eax, %esi
leaq 0x168(%rsp), %rdi
callq 0x13bd0
movq %rax, 0x170(%rsp)
movq 0x308(%rsp), %rdi
callq 0x122e0
movq %rax, 0x160(%rsp)
movq 0x180(%rsp), %rsi
movq 0x170(%rsp), %rdx
movq 0x160(%rsp), %rcx
leaq 0x28c0c(%rip), %rdi     # 0x35300
callq 0x13c60
movq %rax, 0x158(%rsp)
jmp 0xc805
leaq 0x28bf3(%rip), %rdi     # 0x35300
callq 0x122e0
movq %rax, 0x148(%rsp)
leaq 0x150(%rsp), %rdi
leaq 0x148(%rsp), %rsi
callq 0x13b50
movq 0x308(%rsp), %rdi
callq 0x12270
movq %rax, 0x138(%rsp)
movl 0x1c8(%rsp), %eax
movl %eax, %esi
leaq 0x138(%rsp), %rdi
callq 0x13bd0
movq %rax, 0x140(%rsp)
movq 0x308(%rsp), %rdi
callq 0x12270
movq %rax, 0x118(%rsp)
movl 0x1c8(%rsp), %eax
movl %eax, %esi
leaq 0x118(%rsp), %rdi
callq 0x13bd0
movq %rax, %rcx
movq 0x60(%rsp), %rax
movq %rcx, 0x120(%rsp)
movslq (%rax), %rsi
leaq 0x120(%rsp), %rdi
callq 0x13bd0
movq %rax, 0x128(%rsp)
leaq 0x28b44(%rip), %rdi     # 0x35300
callq 0x4c10
movq %rax, %rsi
leaq 0x128(%rsp), %rdi
callq 0x13c10
movq %rax, 0x130(%rsp)
movq 0x150(%rsp), %rsi
movq 0x140(%rsp), %rdx
movq 0x130(%rsp), %rcx
leaq 0x28b08(%rip), %rdi     # 0x35300
callq 0x13c60
movq %rax, 0x110(%rsp)
jmp 0xc807
movl 0x1c4(%rsp), %eax
cmpl 0x2f8(%rsp), %eax
je 0xca5f
movq 0x300(%rsp), %rdi
callq 0x13a60
movq %rax, 0x108(%rsp)
movq 0x300(%rsp), %rdi
callq 0x139a0
movq %rax, 0xe8(%rsp)
movl 0x1c4(%rsp), %eax
movl %eax, %esi
leaq 0xe8(%rsp), %rdi
callq 0x139d0
movq %rax, %rcx
movq 0x60(%rsp), %rax
movq %rcx, 0xf0(%rsp)
movslq (%rax), %rsi
leaq 0xf0(%rsp), %rdi
callq 0x139d0
movq %rax, 0xf8(%rsp)
leaq 0x28a76(%rip), %rdi     # 0x35300
callq 0x4c10
movq %rax, %rsi
leaq 0xf8(%rsp), %rdi
callq 0x13a10
movq %rax, 0x100(%rsp)
leaq 0x108(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0x13960
testb $0x1, %al
jne 0xc8c5
jmp 0xc967
leaq 0x28a34(%rip), %rdi     # 0x35300
callq 0x122e0
movq %rax, 0xd8(%rsp)
leaq 0xe0(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x13b50
movq 0x300(%rsp), %rdi
callq 0x139a0
movq %rax, 0xc8(%rsp)
movl 0x1c4(%rsp), %eax
movl %eax, %esi
leaq 0xc8(%rsp), %rdi
callq 0x139d0
movq %rax, 0xd0(%rsp)
movq 0x300(%rsp), %rdi
callq 0x13a60
movq %rax, 0xc0(%rsp)
movq 0xe0(%rsp), %rsi
movq 0xd0(%rsp), %rdx
movq 0xc0(%rsp), %rcx
leaq 0x289ab(%rip), %rdi     # 0x35300
callq 0x13a90
movq %rax, 0xb8(%rsp)
jmp 0xca5d
leaq 0x28992(%rip), %rdi     # 0x35300
callq 0x122e0
movq %rax, 0xa8(%rsp)
leaq 0xb0(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x13b50
movq 0x300(%rsp), %rdi
callq 0x139a0
movq %rax, 0x98(%rsp)
movl 0x1c4(%rsp), %eax
movl %eax, %esi
leaq 0x98(%rsp), %rdi
callq 0x139d0
movq %rax, 0xa0(%rsp)
movq 0x300(%rsp), %rdi
callq 0x139a0
movq %rax, 0x78(%rsp)
movl 0x1c4(%rsp), %eax
movl %eax, %esi
leaq 0x78(%rsp), %rdi
callq 0x139d0
movq %rax, %rcx
movq 0x60(%rsp), %rax
movq %rcx, 0x80(%rsp)
movslq (%rax), %rsi
leaq 0x80(%rsp), %rdi
callq 0x139d0
movq %rax, 0x88(%rsp)
leaq 0x288e9(%rip), %rdi     # 0x35300
callq 0x4c10
movq %rax, %rsi
leaq 0x88(%rsp), %rdi
callq 0x13a10
movq %rax, 0x90(%rsp)
movq 0xb0(%rsp), %rsi
movq 0xa0(%rsp), %rdx
movq 0x90(%rsp), %rcx
leaq 0x288ad(%rip), %rdi     # 0x35300
callq 0x13a90
movq %rax, 0x70(%rsp)
jmp 0xca5f
movq 0x308(%rsp), %rdi
leaq 0x28892(%rip), %rsi     # 0x35300
callq 0x11fb0
addq $0x318, %rsp            # imm = 0x318
retq
movq 0x1b8(%rsp), %rdi
callq 0x34e0
nopl (%rax,%rax)