// File: /workspace/github_cpp_makefile_star2_O1/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 %rcx, 0x18(%rsp)
movq %rdx, %r15
movq 0x8(%rdx), %rsi
subq (%rdx), %rsi
shrq $0x5, %rsi
addl $0x2, %esi
movq (%rcx), %rax
movq 0x8(%rcx), %rdx
movabsq $-0x5555555555555555, %rbx # imm = 0xAAAAAAAAAAAAAAAB
cmpq %rdx, %rax
je 0x2cc3
subq %rax, %rdx
addq $-0x18, %rdx
mulxq %rbx, %rcx, %rcx
vpbroadcastq %rcx, %zmm1
shrq $0x4, %rcx
addq $0x8, %rcx
andq $-0x8, %rcx
vmovd %esi, %xmm0
vpsrlq $0x4, %zmm1, %zmm1
xorl %edx, %edx
vpmovsxbq 0x246b(%rip), %zmm2 # 0x50a0
vpmovzxbd 0x246a(%rip), %ymm3 # 0x50a8
vpcmpeqd %ymm4, %ymm4, %ymm4
vpbroadcastq %rdx, %zmm5
vporq %zmm2, %zmm5, %zmm5
vpcmpleuq %zmm1, %zmm5, %k1
kmovq %k1, %k2
vpxor %xmm5, %xmm5, %xmm5
vpgatherdq 0x8(%rax,%ymm3), %zmm5 {%k2}
kmovq %k1, %k2
vpxor %xmm6, %xmm6, %xmm6
vpgatherdq (%rax,%ymm3), %zmm6 {%k2}
vpsubq %zmm6, %zmm5, %zmm5
vpsrlq $0x5, %zmm5, %zmm5
vpmovqd %zmm5, %ymm6
vmovdqa %ymm0, %ymm5
vpaddd %ymm6, %ymm0, %ymm0
vpsubd %ymm4, %ymm0, %ymm0
addq $0x8, %rdx
addq $0xc0, %rax
cmpq %rdx, %rcx
jne 0x2c42
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 %rdi, 0x8(%rsp)
vzeroupper
callq 0x330e
movq 0x8(%r15), %rsi
subq (%r15), %rsi
sarq $0x5, %rsi
incq %rsi
leaq 0x20(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0x2fa8
leaq 0x70(%rsp), %rax
movq %rax, -0x30(%rax)
movq $0x1, -0x28(%rax)
vpxor %xmm0, %xmm0, %xmm0
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
movq 0x8(%rsp), %r9
jle 0x2da4
movl $0x1, %r13d
movl $0x5, %ebx
xorl %r14d, %r14d
leaq 0x40(%rsp), %r12
movq (%r9), %rax
movl $0x0, -0x8(%rax,%rbx,4)
movl %r13d, -0x4(%rax,%rbx,4)
movl %r13d, (%rax,%rbx,4)
movq 0x20(%rsp), %rax
movl %r13d, (%rax,%r13,4)
addq %r14, %rsi
movq %r12, %rdi
callq 0x33e8
movl %r13d, (%rax)
leaq 0x1(%r13), %rax
movq (%r15), %rsi
movq 0x8(%r15), %rbp
subq %rsi, %rbp
shrq $0x5, %rbp
movslq %ebp, %rcx
addq $0x3, %rbx
addq $0x20, %r14
cmpq %rcx, %r13
movq %rax, %r13
movq 0x8(%rsp), %r9
jl 0x2d45
movabsq $-0x5555555555555555, %rbx # imm = 0xAAAAAAAAAAAAAAAB
incl %ebp
movq 0x18(%rsp), %r8
movq (%r8), %rax
movq 0x8(%r8), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
imull $0xaaaaaaab, %ecx, %ecx # imm = 0xAAAAAAAB
testl %ecx, %ecx
jle 0x2f04
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
xorl %r11d, %r11d
movl %ebp, %r10d
movslq %ebp, %rbp
movq (%r9), %rcx
leaq (%rbp,%rbp,2), %rsi
movl %r11d, %edi
negl %edi
movl %edi, (%rcx,%rsi,4)
incl %edx
movl %edx, 0x4(%rcx,%rsi,4)
leaq (,%r11,8), %rdx
leaq (%rdx,%rdx,2), %rdx
movq 0x8(%rax,%rdx), %rdi
subq (%rax,%rdx), %rdi
shrq $0x5, %rdi
addl %r10d, %edi
movl %edi, 0x8(%rcx,%rsi,4)
incl %ebp
movq (%r8), %rax
movq (%rax,%rdx), %rsi
movq 0x8(%rax,%rdx), %rax
subq %rsi, %rax
shrq $0x5, %rax
testl %eax, %eax
jle 0x2edb
movl %r10d, 0x14(%rsp)
movslq %ebp, %rax
movl %eax, %r12d
leaq (%rax,%rax,2), %rax
leaq 0x8(,%rax,4), %rbx
movq %r11, 0x38(%rsp)
leaq (%r11,%r11,2), %r15
xorl %r14d, %r14d
xorl %r13d, %r13d
addq %r14, %rsi
leaq 0x40(%rsp), %rdi
callq 0x33e8
movslq (%rax), %rax
leaq (%rax,%rax,2), %rcx
movq 0x8(%rsp), %r9
movq (%r9), %rdx
incl (%rdx,%rcx,4)
movq 0x20(%rsp), %rsi
movslq (%rsi,%rax,4), %rdi
leaq (%rdi,%rdi,2), %rdi
leal (%r12,%r13), %r8d
movl %r8d, 0x8(%rdx,%rdi,4)
movl %r8d, 0x4(%rdx,%rcx,4)
movl %eax, -0x8(%rdx,%rbx)
movl (%rsi,%rax,4), %ecx
movl %ecx, -0x4(%rdx,%rbx)
movl %eax, (%rdx,%rbx)
movl %r8d, (%rsi,%rax,4)
incq %r13
movq 0x18(%rsp), %r8
movq (%r8), %rax
movq (%rax,%r15,8), %rsi
movq 0x8(%rax,%r15,8), %rax
subq %rsi, %rax
shrq $0x5, %rax
cltq
addq $0x20, %r14
addq $0xc, %rbx
cmpq %rax, %r13
jl 0x2e4e
addl %r13d, %ebp
movabsq $-0x5555555555555555, %rbx # imm = 0xAAAAAAAAAAAAAAAB
movl 0x14(%rsp), %r10d
movq 0x38(%rsp), %r11
incq %r11
movq (%r8), %rax
movq 0x8(%r8), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
imulq %rbx, %rcx
movslq %ecx, %rsi
movl %r10d, %edx
cmpq %rsi, %r11
jl 0x2dcf
incl %r10d
jmp 0x2f0a
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
negl %ecx
movslq %ebp, %rax
movq (%r9), %rdx
leaq (%rax,%rax,2), %rax
movl %ecx, (%rdx,%rax,4)
movl %r10d, 0x4(%rdx,%rax,4)
movl $0xffffffff, 0x8(%rdx,%rax,4) # imm = 0xFFFFFFFF
leaq 0x40(%rsp), %rdi
callq 0x384c
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x2f47
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2110
movq 0x8(%rsp), %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x2f86
jmp 0x2f62
movq %rax, %r14
leaq 0x40(%rsp), %rdi
callq 0x384c
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x2f86
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2110
movq 0x8(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x2f9f
movq 0x10(%rax), %rsi
subq %rdi, %rsi
callq 0x2110
movq %r14, %rdi
callq 0x21d0
nop