// File: 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:
subq $0x138, %rsp            # imm = 0x138
movq %rdi, 0x60(%rsp)
movq %rdi, %rax
movq %rax, 0x58(%rsp)
movq %rdi, 0x130(%rsp)
movq %rsi, 0x128(%rsp)
movq %rdx, 0x120(%rsp)
movq %rcx, 0x118(%rsp)
movq 0x128(%rsp), %rdi
movb $0x0, 0x117(%rsp)
movq 0x120(%rsp), %rsi
movq 0x118(%rsp), %rdx
callq 0x3f70
cltq
movq %rax, 0x68(%rsp)
leaq 0x116(%rsp), %rdi
movq %rdi, 0x70(%rsp)
callq 0x4010
movq 0x60(%rsp), %rdi
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
callq 0x4020
jmp 0x2e38
leaq 0x116(%rsp), %rdi
callq 0x40a0
movq 0x120(%rsp), %rdi
callq 0x3750
incq %rax
movq %rax, 0x48(%rsp)
leaq 0xe7(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0x33b0
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
leaq 0xe8(%rsp), %rdi
callq 0x40b0
jmp 0x2e85
leaq 0xe7(%rsp), %rdi
callq 0x3440
leaq 0xa8(%rsp), %rdi
callq 0x4130
movl $0x1, 0xa4(%rsp)
movl 0xa4(%rsp), %eax
movl %eax, 0x44(%rsp)
movq 0x120(%rsp), %rdi
callq 0x3750
movq %rax, %rcx
movl 0x44(%rsp), %eax
cmpl %ecx, %eax
jg 0x3014
movq 0x60(%rsp), %rdi
movl $0x0, 0x98(%rsp)
movl 0xa4(%rsp), %eax
movl %eax, 0x9c(%rsp)
movl 0xa4(%rsp), %eax
movl %eax, 0xa0(%rsp)
movslq 0xa4(%rsp), %rsi
callq 0x4140
movl 0xa0(%rsp), %ecx
movl %ecx, 0x8(%rax)
movq 0x98(%rsp), %rcx
movq %rcx, (%rax)
movslq 0xa4(%rsp), %rsi
movl %esi, %eax
movl %eax, 0x30(%rsp)
leaq 0xe8(%rsp), %rdi
callq 0x4160
movl 0x30(%rsp), %ecx
movl %ecx, (%rax)
movl 0xa4(%rsp), %eax
movl %eax, 0x34(%rsp)
movq 0x120(%rsp), %rdi
decl %eax
movslq %eax, %rsi
callq 0x41b0
movq %rax, %rsi
leaq 0xa8(%rsp), %rdi
callq 0x4180
movq %rax, 0x38(%rsp)
jmp 0x2f74
movq 0x38(%rsp), %rax
movl 0x34(%rsp), %ecx
movl %ecx, (%rax)
movl 0xa4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa4(%rsp)
jmp 0x2eaa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x108(%rsp)
movl %eax, 0x104(%rsp)
leaq 0x116(%rsp), %rdi
callq 0x40a0
jmp 0x32e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x108(%rsp)
movl %eax, 0x104(%rsp)
leaq 0xe7(%rsp), %rdi
callq 0x3440
jmp 0x32d6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x108(%rsp)
movl %eax, 0x104(%rsp)
leaq 0xa8(%rsp), %rdi
callq 0x41f0
leaq 0xe8(%rsp), %rdi
callq 0x35d0
jmp 0x32d6
movq 0x120(%rsp), %rdi
callq 0x3750
movq 0x60(%rsp), %rdi
addq $0x1, %rax
movl %eax, 0x94(%rsp)
movl $0x0, 0x88(%rsp)
movl $0x0, 0x8c(%rsp)
movl $0x0, 0x90(%rsp)
movl 0x94(%rsp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x94(%rsp)
movslq %eax, %rsi
callq 0x4140
movq 0x88(%rsp), %rcx
movq %rcx, (%rax)
movl 0x90(%rsp), %ecx
movl %ecx, 0x8(%rax)
movl $0x0, 0x84(%rsp)
movl 0x84(%rsp), %eax
movl %eax, 0x2c(%rsp)
movq 0x118(%rsp), %rdi
callq 0x32f0
movq %rax, %rcx
movl 0x2c(%rsp), %eax
cmpl %ecx, %eax
jge 0x3293
movl $0x0, 0x80(%rsp)
movl 0x80(%rsp), %eax
movl %eax, 0x28(%rsp)
movq 0x118(%rsp), %rdi
movslq 0x84(%rsp), %rsi
callq 0x41d0
movq %rax, %rdi
callq 0x3750
movq %rax, %rcx
movl 0x28(%rsp), %eax
cmpl %ecx, %eax
jge 0x3261
movq 0x118(%rsp), %rdi
movslq 0x84(%rsp), %rsi
callq 0x41d0
movq %rax, %rdi
movslq 0x80(%rsp), %rsi
callq 0x41b0
movq %rax, %rsi
leaq 0xa8(%rsp), %rdi
callq 0x4180
movq %rax, 0x20(%rsp)
jmp 0x3132
movq 0x60(%rsp), %rdi
movq 0x20(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x7c(%rsp)
movslq 0x7c(%rsp), %rsi
callq 0x4140
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movl 0x94(%rsp), %eax
movl %eax, 0x8(%rsp)
movslq 0x7c(%rsp), %rsi
leaq 0xe8(%rsp), %rdi
callq 0x4160
movq 0x60(%rsp), %rdi
movslq (%rax), %rsi
callq 0x4140
movl 0x8(%rsp), %ecx
movq 0x60(%rsp), %rdi
movl %ecx, 0x8(%rax)
movl 0x94(%rsp), %eax
movl %eax, 0xc(%rsp)
movslq 0x7c(%rsp), %rsi
callq 0x4140
movl 0xc(%rsp), %ecx
movq 0x60(%rsp), %rdi
movl %ecx, 0x4(%rax)
movl 0x7c(%rsp), %eax
movl %eax, 0x10(%rsp)
movslq 0x94(%rsp), %rsi
callq 0x4140
movl 0x10(%rsp), %ecx
movl %ecx, (%rax)
movslq 0x7c(%rsp), %rsi
leaq 0xe8(%rsp), %rdi
callq 0x4160
movq 0x60(%rsp), %rdi
movl (%rax), %eax
movl %eax, 0x14(%rsp)
movslq 0x94(%rsp), %rsi
callq 0x4140
movl 0x14(%rsp), %ecx
movq 0x60(%rsp), %rdi
movl %ecx, 0x4(%rax)
movl 0x7c(%rsp), %eax
movl %eax, 0x18(%rsp)
movslq 0x94(%rsp), %rsi
callq 0x4140
movl 0x18(%rsp), %ecx
movl %ecx, 0x8(%rax)
movl 0x94(%rsp), %eax
movl %eax, 0x1c(%rsp)
movslq 0x7c(%rsp), %rsi
leaq 0xe8(%rsp), %rdi
callq 0x4160
movl 0x1c(%rsp), %ecx
movl %ecx, (%rax)
movl 0x94(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x94(%rsp)
movl 0x80(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x80(%rsp)
jmp 0x30bf
movq 0x60(%rsp), %rdi
movl 0x94(%rsp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x4140
imull $-0x1, (%rax), %ecx
movl %ecx, (%rax)
movl 0x84(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x84(%rsp)
jmp 0x308d
movb $0x1, 0x117(%rsp)
leaq 0xa8(%rsp), %rdi
callq 0x41f0
leaq 0xe8(%rsp), %rdi
callq 0x35d0
testb $0x1, 0x117(%rsp)
jne 0x32c9
movq 0x60(%rsp), %rdi
callq 0x3690
movq 0x58(%rsp), %rax
addq $0x138, %rsp            # imm = 0x138
retq
movq 0x60(%rsp), %rdi
callq 0x3690
movq 0x108(%rsp), %rdi
callq 0x2200
nopl (%rax)