// File: 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:
subq $0x148, %rsp            # imm = 0x148
movq %rdi, 0x78(%rsp)
movq %rdi, %rax
movq %rax, 0x70(%rsp)
movq %rdi, 0x140(%rsp)
movq %rsi, 0x138(%rsp)
movq %rdx, 0x130(%rsp)
movq %rcx, 0x128(%rsp)
movq 0x138(%rsp), %rdi
movb $0x0, 0x127(%rsp)
movq 0x130(%rsp), %rsi
movq 0x128(%rsp), %rdx
callq 0x46e0
cltq
movq %rax, 0x80(%rsp)
leaq 0x126(%rsp), %rdi
movq %rdi, 0x88(%rsp)
callq 0x4790
movq 0x78(%rsp), %rdi
movq 0x80(%rsp), %rsi
movq 0x88(%rsp), %rdx
callq 0x47a0
jmp 0x3254
leaq 0x126(%rsp), %rdi
callq 0x4820
movq 0x130(%rsp), %rdi
callq 0x3b70
incq %rax
movq %rax, 0x60(%rsp)
leaq 0xf7(%rsp), %rdi
movq %rdi, 0x68(%rsp)
callq 0x3830
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
leaq 0xf8(%rsp), %rdi
callq 0x3840
jmp 0x32a1
leaq 0xf7(%rsp), %rdi
callq 0x38c0
leaq 0xb8(%rsp), %rdi
callq 0x4830
movl $0x1, 0xb4(%rsp)
movl 0xb4(%rsp), %eax
movl %eax, 0x5c(%rsp)
movq 0x130(%rsp), %rdi
callq 0x3b70
movq %rax, %rcx
movl 0x5c(%rsp), %eax
cmpl %ecx, %eax
jg 0x3430
movq 0x78(%rsp), %rdi
movl $0x0, 0xa8(%rsp)
movl 0xb4(%rsp), %eax
movl %eax, 0xac(%rsp)
movl 0xb4(%rsp), %eax
movl %eax, 0xb0(%rsp)
movslq 0xb4(%rsp), %rsi
callq 0x4840
movl 0xb0(%rsp), %ecx
movl %ecx, 0x8(%rax)
movq 0xa8(%rsp), %rcx
movq %rcx, (%rax)
movslq 0xb4(%rsp), %rsi
movl %esi, %eax
movl %eax, 0x48(%rsp)
leaq 0xf8(%rsp), %rdi
callq 0x4860
movl 0x48(%rsp), %ecx
movl %ecx, (%rax)
movl 0xb4(%rsp), %eax
movl %eax, 0x4c(%rsp)
movq 0x130(%rsp), %rdi
decl %eax
movslq %eax, %rsi
callq 0x3d60
movq %rax, %rsi
leaq 0xb8(%rsp), %rdi
callq 0x4880
movq %rax, 0x50(%rsp)
jmp 0x3390
movq 0x50(%rsp), %rax
movl 0x4c(%rsp), %ecx
movl %ecx, (%rax)
movl 0xb4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xb4(%rsp)
jmp 0x32c6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x118(%rsp)
movl %eax, 0x114(%rsp)
leaq 0x126(%rsp), %rdi
callq 0x4820
jmp 0x37f5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x118(%rsp)
movl %eax, 0x114(%rsp)
leaq 0xf7(%rsp), %rdi
callq 0x38c0
jmp 0x37eb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x118(%rsp)
movl %eax, 0x114(%rsp)
leaq 0xb8(%rsp), %rdi
callq 0x48d0
leaq 0xf8(%rsp), %rdi
callq 0x3a50
jmp 0x37eb
movq 0x130(%rsp), %rdi
callq 0x3b70
addq $0x1, %rax
movl %eax, 0xa4(%rsp)
movl $0xfffffffe, 0xa0(%rsp) # imm = 0xFFFFFFFE
movl 0xa4(%rsp), %eax
movl %eax, 0x9c(%rsp)
movl $0x0, 0x98(%rsp)
movl 0x98(%rsp), %eax
movl %eax, 0x44(%rsp)
movq 0x128(%rsp), %rdi
callq 0x3810
movq %rax, %rcx
movl 0x44(%rsp), %eax
cmpl %ecx, %eax
jge 0x373b
movq 0x78(%rsp), %rdi
movl 0xa4(%rsp), %eax
movl %eax, 0x9c(%rsp)
xorl %eax, %eax
subl 0x98(%rsp), %eax
movl %eax, 0x30(%rsp)
movslq 0x9c(%rsp), %rsi
callq 0x4840
movl 0x30(%rsp), %ecx
movq 0x78(%rsp), %rdi
movl %ecx, (%rax)
movl 0xa0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
movslq 0x9c(%rsp), %rsi
callq 0x4840
movl 0x34(%rsp), %ecx
movl %ecx, 0x4(%rax)
movslq 0x9c(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x128(%rsp), %rdi
movslq 0x98(%rsp), %rsi
callq 0x48b0
movq %rax, %rdi
callq 0x3b70
movq 0x78(%rsp), %rdi
movq %rax, %rcx
movq 0x38(%rsp), %rax
addq %rcx, %rax
movl %eax, 0x40(%rsp)
movslq 0x9c(%rsp), %rsi
callq 0x4840
movl 0x40(%rsp), %ecx
movl %ecx, 0x8(%rax)
movl 0x9c(%rsp), %eax
movl %eax, 0xa0(%rsp)
movl 0xa4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa4(%rsp)
movl $0x0, 0x94(%rsp)
movl 0x94(%rsp), %eax
movl %eax, 0x2c(%rsp)
movq 0x128(%rsp), %rdi
movslq 0x98(%rsp), %rsi
callq 0x48b0
movq %rax, %rdi
callq 0x3b70
movq %rax, %rcx
movl 0x2c(%rsp), %eax
cmpl %ecx, %eax
jge 0x3723
movq 0x128(%rsp), %rdi
movslq 0x98(%rsp), %rsi
callq 0x48b0
movq %rax, %rdi
movslq 0x94(%rsp), %rsi
callq 0x3d60
movq %rax, %rsi
leaq 0xb8(%rsp), %rdi
callq 0x4880
movq %rax, 0x20(%rsp)
jmp 0x35dc
movq 0x78(%rsp), %rdi
movq 0x20(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x90(%rsp)
movslq 0x90(%rsp), %rsi
callq 0x4840
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movl 0xa4(%rsp), %eax
movl %eax, 0x8(%rsp)
movslq 0x90(%rsp), %rsi
leaq 0xf8(%rsp), %rdi
callq 0x4860
movq 0x78(%rsp), %rdi
movslq (%rax), %rsi
callq 0x4840
movl 0x8(%rsp), %ecx
movq 0x78(%rsp), %rdi
movl %ecx, 0x8(%rax)
movl 0xa4(%rsp), %eax
movl %eax, 0xc(%rsp)
movslq 0x90(%rsp), %rsi
callq 0x4840
movl 0xc(%rsp), %ecx
movq 0x78(%rsp), %rdi
movl %ecx, 0x4(%rax)
movl 0x90(%rsp), %eax
movl %eax, 0x10(%rsp)
movslq 0xa4(%rsp), %rsi
callq 0x4840
movl 0x10(%rsp), %ecx
movl %ecx, (%rax)
movslq 0x90(%rsp), %rsi
leaq 0xf8(%rsp), %rdi
callq 0x4860
movq 0x78(%rsp), %rdi
movl (%rax), %eax
movl %eax, 0x14(%rsp)
movslq 0xa4(%rsp), %rsi
callq 0x4840
movl 0x14(%rsp), %ecx
movq 0x78(%rsp), %rdi
movl %ecx, 0x4(%rax)
movl 0x90(%rsp), %eax
movl %eax, 0x18(%rsp)
movslq 0xa4(%rsp), %rsi
callq 0x4840
movl 0x18(%rsp), %ecx
movl %ecx, 0x8(%rax)
movl 0xa4(%rsp), %eax
movl %eax, 0x1c(%rsp)
movslq 0x90(%rsp), %rsi
leaq 0xf8(%rsp), %rdi
callq 0x4860
movl 0x1c(%rsp), %ecx
movl %ecx, (%rax)
movl 0xa4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa4(%rsp)
movl 0x94(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x94(%rsp)
jmp 0x3569
jmp 0x3725
movl 0x98(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x98(%rsp)
jmp 0x346c
movq 0x128(%rsp), %rdi
callq 0x3810
movq 0x78(%rsp), %rdi
movl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, (%rsp)
movslq 0xa4(%rsp), %rsi
callq 0x4840
movl (%rsp), %ecx
movq 0x78(%rsp), %rdi
movl %ecx, (%rax)
movl 0xa0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
movslq 0xa4(%rsp), %rsi
callq 0x4840
movl 0x4(%rsp), %ecx
movq 0x78(%rsp), %rdi
movl %ecx, 0x4(%rax)
movslq 0xa4(%rsp), %rsi
callq 0x4840
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movb $0x1, 0x127(%rsp)
leaq 0xb8(%rsp), %rdi
callq 0x48d0
leaq 0xf8(%rsp), %rdi
callq 0x3a50
testb $0x1, 0x127(%rsp)
jne 0x37de
movq 0x78(%rsp), %rdi
callq 0x3ab0
movq 0x70(%rsp), %rax
addq $0x148, %rsp            # imm = 0x148
retq
movq 0x78(%rsp), %rdi
callq 0x3ab0
movq 0x118(%rsp), %rdi
callq 0x22c0
nopw %cs:(%rax,%rax)
nopl (%rax)