// File: /workspace/github_cpp_makefile_star2_O3/ricbit[P]dlx/cover_original.cc
// Function: ExactCover::build_nodes(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&, std::vector<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>, std::allocator<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>> const&)
vector<Node> build_nodes(
      const vector<string>& items,
      const vector<vector<string>>& options) {
    vector<Node> nodes(count_nodes(items, options));
    vector<int> last(items.size() + 1);
    unordered_map<string, int> name;
    for (int i = 1; i <= int(items.size()); i++) {
      nodes[i] = {0, i, i};
      last[i] = i;
      name[items[i - 1]] = i;
    }
    int current = items.size() + 1;
    int lastspacer = -2;
    int spacer = current;
    for (int i = 0; i < int(options.size()); i++) {
      spacer = current;
      nodes[spacer].top = -i;
      nodes[spacer].ulink = lastspacer + 1;
      nodes[spacer].dlink = spacer + options[i].size();
      lastspacer = spacer;
      current++;
      for (int j = 0; j < int(options[i].size()); j++) {
        int item = name[options[i][j]];
        nodes[item].top++;
        nodes[last[item]].dlink = current;
        nodes[item].ulink = current;
        nodes[current].top = item;
        nodes[current].ulink = last[item];
        nodes[current].dlink = item;
        last[item] = current;
        current++;
      }
    }
    nodes[current].top = -int(options.size());
    nodes[current].ulink = lastspacer + 1;
    nodes[current].dlink = -1;
    return nodes;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq 0x8(%rdx), %rsi
movq %rdx, %r15
movq (%rcx), %rax
movabsq $-0x5555555555555555, %r14 # imm = 0xAAAAAAAAAAAAAAAB
movq %rdi, %rbx
movq %rcx, 0x10(%rsp)
subq (%rdx), %rsi
movq 0x8(%rcx), %rdx
shrq $0x5, %rsi
addl $0x2, %esi
cmpq %rdx, %rax
je 0x2ccc
subq %rax, %rdx
vpmovsxbq 0x248a(%rip), %zmm2 # 0x50a0
vpmovzxbd 0x2489(%rip), %ymm3 # 0x50a8
vmovd %esi, %xmm0
vpcmpeqd %ymm4, %ymm4, %ymm4
addq $-0x18, %rdx
mulxq %r14, %rcx, %rcx
xorl %edx, %edx
vpbroadcastq %rcx, %zmm1
shrq $0x4, %rcx
addq $0x8, %rcx
vpsrlq $0x4, %zmm1, %zmm1
andq $-0x8, %rcx
vpbroadcastq %rdx, %zmm5
vpxor %xmm6, %xmm6, %xmm6
addq $0x8, %rdx
vporq %zmm2, %zmm5, %zmm5
vpcmpleuq %zmm1, %zmm5, %k1
vpxor %xmm5, %xmm5, %xmm5
kmovq %k1, %k2
vpgatherdq 0x8(%rax,%ymm3), %zmm5 {%k2}
kmovq %k1, %k2
vpgatherdq (%rax,%ymm3), %zmm6 {%k2}
addq $0xc0, %rax
vpsubq %zmm6, %zmm5, %zmm5
vpsrlq $0x5, %zmm5, %zmm5
vpmovqd %zmm5, %ymm6
vmovdqa %ymm0, %ymm5
vpaddd %ymm6, %ymm0, %ymm0
vpsubd %ymm4, %ymm0, %ymm0
cmpq %rdx, %rcx
jne 0x2c4b
vmovdqa32 %ymm0, %ymm5 {%k1}
vextracti128 $0x1, %ymm5, %xmm0
vphaddd %xmm5, %xmm0, %xmm0
vphaddd %xmm0, %xmm0, %xmm0
vphaddd %xmm0, %xmm0, %xmm0
vmovd %xmm0, %esi
movslq %esi, %rsi
leaq 0x40(%rsp), %rdx
movq %rbx, %rdi
vzeroupper
callq 0x331e
movq 0x8(%r15), %rsi
subq (%r15), %rsi
sarq $0x5, %rsi
incq %rsi
leaq 0x18(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0x2fa6
leaq 0x70(%rsp), %rax
vpxor %xmm0, %xmm0, %xmm0
movq %rbx, 0x8(%rsp)
movq %rax, -0x30(%rax)
movq $0x1, -0x28(%rax)
vmovdqu %xmm0, -0x20(%rax)
movl $0x3f800000, -0x10(%rax) # imm = 0x3F800000
vmovdqu %xmm0, -0x8(%rax)
movq (%r15), %rsi
movq 0x8(%r15), %rbp
subq %rsi, %rbp
shrq $0x5, %rbp
testl %ebp, %ebp
jle 0x2db0
movl $0x1, %r13d
movl $0x5, %ebx
leaq 0x40(%rsp), %r12
xorl %r14d, %r14d
movq 0x8(%rsp), %rax
addq %r14, %rsi
movq (%rax), %rax
movl $0x0, -0x8(%rax,%rbx,4)
movl %r13d, -0x4(%rax,%rbx,4)
movl %r13d, (%rax,%rbx,4)
movq 0x18(%rsp), %rax
movl %r13d, (%rax,%r13,4)
movq %r12, %rdi
callq 0x340a
movl %r13d, (%rax)
leaq 0x1(%r13), %rax
addq $0x3, %rbx
addq $0x20, %r14
movq (%r15), %rsi
movq 0x8(%r15), %rbp
subq %rsi, %rbp
shrq $0x5, %rbp
movslq %ebp, %rcx
cmpq %rcx, %r13
movq %rax, %r13
jl 0x2d4c
movq 0x8(%rsp), %rbx
movabsq $-0x5555555555555555, %r14 # imm = 0xAAAAAAAAAAAAAAAB
movq 0x10(%rsp), %rax
incl %ebp
movq (%rax), %rcx
movq 0x8(%rax), %rdx
movq %rdx, %rax
subq %rcx, %rax
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %esi # imm = 0xAAAAAAAB
movq (%rbx), %rax
testl %esi, %esi
jle 0x2f07
movl $0xfffffffe, %edi       # imm = 0xFFFFFFFE
xorl %r11d, %r11d
movl %ebp, %r10d
movslq %ebp, %rbp
movl %r11d, %esi
negl %esi
incl %edi
leaq (%r11,%r11,2), %r12
leaq (%rbp,%rbp,2), %r8
incl %ebp
movl %esi, (%rax,%r8,4)
movl %edi, 0x4(%rax,%r8,4)
movq (%rcx,%r12,8), %rsi
movq 0x8(%rcx,%r12,8), %rdi
subq %rsi, %rdi
shrq $0x5, %rdi
leal (%r10,%rdi), %r9d
movl %r9d, 0x8(%rax,%r8,4)
testl %edi, %edi
jle 0x2edd
movslq %ebp, %rax
movq %r11, 0x30(%rsp)
movq %r10, 0x38(%rsp)
xorl %r15d, %r15d
xorl %r14d, %r14d
leaq (%rax,%rax,2), %rcx
movl %eax, %r13d
leaq 0x8(,%rcx,4), %rbx
addq %r15, %rsi
leaq 0x40(%rsp), %rdi
callq 0x340a
movq 0x8(%rsp), %rsi
movslq (%rax), %rcx
leal (%r13,%r14), %r8d
incq %r14
addq $0x20, %r15
movq (%rsi), %rax
leaq (%rcx,%rcx,2), %rdx
incl (%rax,%rdx,4)
movq 0x18(%rsp), %rsi
movslq (%rsi,%rcx,4), %rdi
leaq (%rdi,%rdi,2), %rdi
movl %r8d, 0x8(%rax,%rdi,4)
movl %r8d, 0x4(%rax,%rdx,4)
movl %ecx, -0x8(%rax,%rbx)
movl (%rsi,%rcx,4), %edx
movl %edx, -0x4(%rax,%rbx)
movq 0x10(%rsp), %rdx
movl %ecx, (%rax,%rbx)
movl %r8d, (%rsi,%rcx,4)
addq $0xc, %rbx
movq (%rdx), %rcx
movq (%rcx,%r12,8), %rsi
movq 0x8(%rcx,%r12,8), %rdx
subq %rsi, %rdx
shrq $0x5, %rdx
movslq %edx, %rdx
cmpq %rdx, %r14
jl 0x2e45
movq 0x10(%rsp), %rdx
movq 0x38(%rsp), %r10
movq 0x30(%rsp), %r11
addl %r14d, %ebp
movabsq $-0x5555555555555555, %r14 # imm = 0xAAAAAAAAAAAAAAAB
movq 0x8(%rdx), %rdx
movq %rdx, %rsi
subq %rcx, %rsi
incq %r11
movl %r10d, %edi
sarq $0x3, %rsi
imulq %r14, %rsi
movslq %esi, %r8
cmpq %r8, %r11
jl 0x2de1
movq 0x8(%rsp), %rbx
incl %r10d
jmp 0x2f0d
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
movslq %ebp, %rcx
leaq 0x40(%rsp), %rdi
negl %esi
leaq (%rcx,%rcx,2), %rcx
movl %esi, (%rax,%rcx,4)
movl %r10d, 0x4(%rax,%rcx,4)
movl $0xffffffff, 0x8(%rax,%rcx,4) # imm = 0xFFFFFFFF
callq 0x3864
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x2f47
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x2110
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x2f89
jmp 0x2f60
leaq 0x40(%rsp), %rdi
movq %rax, %r14
callq 0x3864
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rbx
testq %rdi, %rdi
je 0x2f89
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x2110
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x2f9d
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x2110
movq %r14, %rdi
callq 0x21d0
nop