// File: /workspace/github_cpp_makefile_star2_O2/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 $0x68, %rsp
movq %rdi, %rbx
movq %rsi, %rdi
movq %rcx, %r14
movq %rdx, %r15
movq %rdx, %rsi
movq %rcx, %rdx
callq 0x2eaa
movslq %eax, %rsi
leaq 0x30(%rsp), %rdx
movq %rbx, %rdi
movq %rbx, (%rsp)
callq 0x2eda
movq 0x8(%r15), %rsi
subq (%r15), %rsi
sarq $0x5, %rsi
incq %rsi
leaq 0x18(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x2b5c
leaq 0x60(%rsp), %rax
vxorps %xmm0, %xmm0, %xmm0
movq %rax, -0x30(%rax)
movq $0x1, -0x28(%rax)
vmovups %xmm0, -0x20(%rax)
movl $0x3f800000, -0x10(%rax) # imm = 0x3F800000
vmovups %xmm0, -0x8(%rax)
pushq $0x1
popq %rbx
pushq $0x5
popq %r13
leaq 0x30(%rsp), %r12
xorl %ebp, %ebp
movq (%r15), %rsi
movq 0x8(%r15), %rdi
subq %rsi, %rdi
shrq $0x5, %rdi
movslq %edi, %rax
cmpq %rax, %rbx
jg 0x29e2
movq (%rsp), %rax
addq %rbp, %rsi
movq (%rax), %rax
andl $0x0, -0x8(%rax,%r13,4)
movl %ebx, -0x4(%rax,%r13,4)
movl %ebx, (%rax,%r13,4)
movq 0x18(%rsp), %rax
movl %ebx, (%rax,%rbx,4)
movq %r12, %rdi
callq 0x3062
movl %ebx, (%rax)
incq %rbx
addq $0x20, %rbp
addq $0x3, %r13
jmp 0x2994
movq (%r14), %rcx
incl %edi
pushq $-0x2
popq %rax
xorl %r8d, %r8d
movl %eax, %esi
movq 0x8(%r14), %rax
subq %rcx, %rax
cqto
pushq $0x18
popq %r9
idivq %r9
incl %esi
movslq %edi, %r13
movslq %eax, %rdx
cmpq %rdx, %r8
jge 0x2aee
movq (%rsp), %rax
imulq $0xc, %r13, %r12
imulq $0x18, %r8, %rbp
movl %edi, %r9d
incl %r13d
movq %r8, 0x10(%rsp)
movq %r9, 0x8(%rsp)
xorl %ebx, %ebx
xorl %r15d, %r15d
movq (%rax), %rdx
movl %r8d, %eax
negl %eax
movl %eax, (%rdx,%r12)
movl %esi, 0x4(%rdx,%r12)
movq 0x8(%rcx,%rbp), %rax
movq (%rcx,%rbp), %rsi
movq %rax, %rdi
subq %rsi, %rdi
shrq $0x5, %rdi
addl %r9d, %edi
movl %edi, 0x8(%rdx,%r12)
addq $0x14, %r12
subq %rsi, %rax
shrq $0x5, %rax
cltq
cmpq %rax, %r15
jge 0x2ad7
addq %rbx, %rsi
leaq 0x30(%rsp), %rdi
callq 0x3062
movq (%rsp), %rcx
movslq (%rax), %rax
leal (%r13,%r15), %r8d
incq %r15
addq $0x20, %rbx
movq (%rcx), %rcx
imulq $0xc, %rax, %rdx
incl (%rcx,%rdx)
movq 0x18(%rsp), %rsi
movslq (%rsi,%rax,4), %rdi
imulq $0xc, %rdi, %rdi
movl %r8d, 0x8(%rcx,%rdi)
movl %r8d, 0x4(%rcx,%rdx)
movl %eax, -0x8(%rcx,%r12)
movl (%rsi,%rax,4), %edx
movl %edx, -0x4(%rcx,%r12)
movl %eax, (%rcx,%r12)
movl %r8d, (%rsi,%rax,4)
addq $0xc, %r12
movq (%r14), %rcx
movq (%rcx,%rbp), %rsi
movq 0x8(%rcx,%rbp), %rax
jmp 0x2a61
movq 0x10(%rsp), %r8
movq 0x8(%rsp), %rax
leal 0x1(%rax,%r15), %edi
incq %r8
jmp 0x29ed
movq (%rsp), %rbx
imulq $0xc, %r13, %rdx
negl %eax
leaq 0x30(%rsp), %rdi
movq (%rbx), %rcx
movl %eax, (%rcx,%rdx)
movl %esi, 0x4(%rcx,%rdx)
orl $-0x1, 0x8(%rcx,%rdx)
callq 0x3524
leaq 0x18(%rsp), %rdi
callq 0x35d0
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x2b4b
jmp 0x2b34
leaq 0x30(%rsp), %rdi
movq %rax, %r14
callq 0x3524
leaq 0x18(%rsp), %rdi
callq 0x35d0
movq (%rsp), %rdi
callq 0x2f60
movq %r14, %rdi
callq 0x2200