// File: /workspace/github_cpp_makefile_star2_O1/ricbit[P]dlx/cover_shortcut.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;
    nodes[current++] = { 0, 0, 0 };
    for (int i = 0; i < int(options.size()); i++) {
      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 - 1].top *= -1;
    }
    return nodes;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rcx, (%rsp)
movq %rdx, %r15
movq %rdi, %rbp
movq 0x8(%rdx), %rsi
subq (%rdx), %rsi
shrq $0x5, %rsi
addl $0x2, %esi
movq (%rcx), %rax
movq 0x8(%rcx), %rdx
cmpq %rdx, %rax
je 0x2b71
subq %rax, %rdx
addq $-0x18, %rdx
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
mulxq %rcx, %rcx, %rcx
vpbroadcastq %rcx, %zmm0
shrq $0x4, %rcx
addq $0x8, %rcx
andq $-0x8, %rcx
vmovd %esi, %xmm4
vpsrlq $0x4, %zmm0, %zmm0
xorl %edx, %edx
vpmovsxbq 0x2675(%rip), %zmm1 # 0x5160
vpmovzxbd 0x2674(%rip), %ymm3 # 0x5168
vmovdqa %ymm4, %ymm2
vpbroadcastq %rdx, %zmm4
vporq %zmm1, %zmm4, %zmm4
vpcmpleuq %zmm0, %zmm4, %k1
vpxor %xmm4, %xmm4, %xmm4
kmovq %k1, %k2
vpgatherdq 0x8(%rax,%ymm3), %zmm4 {%k2}
vpxor %xmm5, %xmm5, %xmm5
kmovq %k1, %k2
vpgatherdq (%rax,%ymm3), %zmm5 {%k2}
vpsubq %zmm5, %zmm4, %zmm4
vpsrlq $0x5, %zmm4, %zmm4
vpmovqd %zmm4, %ymm4
vpaddd %ymm4, %ymm2, %ymm4
addq $0x8, %rdx
addq $0xc0, %rax
cmpq %rdx, %rcx
jne 0x2af4
vmovdqa32 %ymm4, %ymm2 {%k1}
vextracti128 $0x1, %ymm2, %xmm0
vphaddd %xmm2, %xmm0, %xmm0
vphaddd %xmm0, %xmm0, %xmm0
vphaddd %xmm0, %xmm0, %xmm0
vmovd %xmm0, %esi
movslq %esi, %rsi
leaq 0x30(%rsp), %rdx
movq %rbp, %rdi
vzeroupper
callq 0x311c
movq 0x8(%r15), %rsi
subq (%r15), %rsi
sarq $0x5, %rsi
incq %rsi
leaq 0x8(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x31d0
leaq 0x60(%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), %rax
subq %rsi, %rax
movq %rax, %rdi
shrq $0x5, %rdi
testl %edi, %edi
jle 0x2c43
movl $0x1, %r13d
movl $0x5, %ebx
xorl %r14d, %r14d
leaq 0x30(%rsp), %r12
movq (%rbp), %rax
movl $0x0, -0x8(%rax,%rbx,4)
movl %r13d, -0x4(%rax,%rbx,4)
movl %r13d, (%rax,%rbx,4)
movq 0x8(%rsp), %rax
movl %r13d, (%rax,%r13,4)
addq %r14, %rsi
movq %r12, %rdi
callq 0x329e
movl %r13d, (%rax)
leaq 0x1(%r13), %rcx
movq (%r15), %rsi
movq 0x8(%r15), %rax
subq %rsi, %rax
movq %rax, %rdi
shrq $0x5, %rdi
movslq %edi, %rdx
addq $0x3, %rbx
addq $0x20, %r14
cmpq %rdx, %r13
movq %rcx, %r13
jl 0x2bef
shlq $0x1b, %rax
movabsq $0x100000000, %rcx      # imm = 0x100000000
addq %rax, %rcx
sarq $0x20, %rcx
movq (%rbp), %rax
leaq (%rcx,%rcx,2), %rcx
movq $0x0, (%rax,%rcx,4)
movl $0x0, 0x8(%rax,%rcx,4)
movq (%rsp), %rdx
movq 0x8(%rdx), %rax
subq (%rdx), %rax
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
testl %eax, %eax
jle 0x2d86
addl $0x2, %edi
xorl %r8d, %r8d
movq %rbp, %r15
leaq (%r8,%r8,2), %rbp
movq (%rdx), %rax
movq (%rax,%rbp,8), %rsi
movq 0x8(%rax,%rbp,8), %rax
subq %rsi, %rax
shrq $0x5, %rax
testl %eax, %eax
jle 0x2d56
movq %r8, 0x20(%rsp)
movq %rdi, 0x28(%rsp)
movslq %edi, %rax
movl %eax, %ebx
leaq (%rax,%rax,2), %rax
leaq 0x8(,%rax,4), %r12
xorl %r13d, %r13d
xorl %r14d, %r14d
addq %r13, %rsi
leaq 0x30(%rsp), %rdi
callq 0x329e
movslq (%rax), %rax
leaq (%rax,%rax,2), %rcx
movq (%r15), %rdx
incl (%rdx,%rcx,4)
movq 0x8(%rsp), %rsi
movslq (%rsi,%rax,4), %rdi
leaq (%rdi,%rdi,2), %rdi
leal (%rbx,%r14), %r8d
movl %r8d, 0x8(%rdx,%rdi,4)
movl %r8d, 0x4(%rdx,%rcx,4)
movl %eax, -0x8(%rdx,%r12)
movl (%rsi,%rax,4), %ecx
movl %ecx, -0x4(%rdx,%r12)
movl %eax, (%rdx,%r12)
movl %r8d, (%rsi,%rax,4)
incq %r14
movq (%rsp), %rdx
movq (%rdx), %rax
movq (%rax,%rbp,8), %rsi
movq 0x8(%rax,%rbp,8), %rax
subq %rsi, %rax
shrq $0x5, %rax
cltq
addq $0xc, %r12
addq $0x20, %r13
cmpq %rax, %r14
jl 0x2cd6
movq 0x28(%rsp), %rdi
addl %r14d, %edi
movq 0x20(%rsp), %r8
movq %r15, %rbp
movq (%r15), %rax
movslq %edi, %rcx
leaq (%rcx,%rcx,2), %rcx
negl -0xc(%rax,%rcx,4)
incq %r8
movq 0x8(%rdx), %rax
subq (%rdx), %rax
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
cltq
cmpq %rax, %r8
jl 0x2c93
leaq 0x30(%rsp), %rdi
callq 0x3792
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x2da7
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x2110
movq %rbp, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x2dea
movq %rbp, %r15
jmp 0x2dc3
movq %rax, %r14
leaq 0x30(%rsp), %rdi
callq 0x3792
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
movq %r15, %rbp
je 0x2dea
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x2110
movq (%rbp), %rdi
testq %rdi, %rdi
je 0x2dff
movq 0x10(%rbp), %rsi
subq %rdi, %rsi
callq 0x2110
movq %r14, %rdi
callq 0x21c0
nop