// File: ahupp[P]mural/mural_server.cpp
// Function: handle_one_query(std::vector<TagInfo, std::allocator<TagInfo>> const&)
void handle_one_query(const vector<TagInfo>& tags) {

  string query;
  getline(cin, query);
  if (!query.length()) {
    cout << "DONE" << endl;
    return;
  }

  Timer t;
  vector<TagInfo> matches = find_best_fuzzy_matches(tags, query, 32);

  for (size_t i = 0; i < matches.size(); ++i) {
    const TagInfo& match = matches[i];
    cout << "MATCH\t"
         << match.symbol << "\t"
         << match.file << "\t"
         << match.row << endl;;
  }
  cout << "DONE " << t.elapsedMS() << "ms "
       << "#match: " << matches.size() << endl;
}

// Assembly:
subq $0xe8, %rsp
movq %rdi, 0xe0(%rsp)
leaq 0xc0(%rsp), %rdi
movq %rdi, 0x70(%rsp)
callq 0x3350
movq 0x70(%rsp), %rsi
movq 0xa94b(%rip), %rdi      # 0xdfd8
callq 0x3070
jmp 0x3694
leaq 0xc0(%rsp), %rdi
callq 0x3390
cmpq $0x0, %rax
jne 0x36fd
movq 0xa91a(%rip), %rdi      # 0xdfc8
leaq 0x694f(%rip), %rsi      # 0xa004
callq 0x3230
movq %rax, 0x68(%rsp)
jmp 0x36c1
movq 0x68(%rsp), %rdi
movq 0xa8eb(%rip), %rsi      # 0xdfb8
callq 0x3280
jmp 0x36d4
movl $0x1, 0xb0(%rsp)
jmp 0x3926
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
jmp 0x393b
leaq 0xa0(%rsp), %rdi
callq 0x3da0
jmp 0x370c
movq 0xe0(%rsp), %rsi
leaq 0x88(%rsp), %rdi
leaq 0xc0(%rsp), %rdx
movl $0x20, %ecx
callq 0x4890
jmp 0x3730
movq $0x0, 0x80(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x60(%rsp)
leaq 0x88(%rsp), %rdi
callq 0x3dc0
movq %rax, %rcx
movq 0x60(%rsp), %rax
cmpq %rcx, %rax
jae 0x3868
movq 0x80(%rsp), %rsi
leaq 0x88(%rsp), %rdi
callq 0x3de0
movq %rax, 0x78(%rsp)
movq 0xa840(%rip), %rdi      # 0xdfc8
leaq 0x687a(%rip), %rsi      # 0xa009
callq 0x3230
movq %rax, 0x58(%rsp)
jmp 0x379b
movq 0x58(%rsp), %rdi
movq 0x78(%rsp), %rsi
callq 0x3210
movq %rax, 0x50(%rsp)
jmp 0x37b1
movq 0x50(%rsp), %rdi
leaq 0x6851(%rip), %rsi      # 0xa00e
callq 0x3230
movq %rax, 0x48(%rsp)
jmp 0x37c9
movq 0x48(%rsp), %rdi
movq 0x78(%rsp), %rsi
addq $0x40, %rsi
callq 0x3210
movq %rax, 0x40(%rsp)
jmp 0x37e3
movq 0x40(%rsp), %rdi
leaq 0x681f(%rip), %rsi      # 0xa00e
callq 0x3230
movq %rax, 0x38(%rsp)
jmp 0x37fb
movq 0x38(%rsp), %rdi
movq 0x78(%rsp), %rax
movl 0x60(%rax), %esi
callq 0x33e0
movq %rax, 0x30(%rsp)
jmp 0x3814
movq 0x30(%rsp), %rdi
movq 0xa798(%rip), %rsi      # 0xdfb8
callq 0x3280
jmp 0x3827
jmp 0x3829
movq 0x80(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x80(%rsp)
jmp 0x373c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
leaq 0x88(%rsp), %rdi
callq 0x3e60
jmp 0x393b
movq 0xa759(%rip), %rdi      # 0xdfc8
leaq 0x679a(%rip), %rsi      # 0xa010
callq 0x3230
movq %rax, 0x28(%rsp)
jmp 0x3882
leaq 0xa0(%rsp), %rdi
callq 0x3e00
movq %rax, 0x20(%rsp)
jmp 0x3896
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdi
callq 0x3430
movq %rax, 0x18(%rsp)
jmp 0x38ac
movq 0x18(%rsp), %rdi
leaq 0x675e(%rip), %rsi      # 0xa016
callq 0x3230
movq %rax, 0x10(%rsp)
jmp 0x38c4
movq 0x10(%rsp), %rdi
leaq 0x674a(%rip), %rsi      # 0xa01a
callq 0x3230
movq %rax, 0x8(%rsp)
jmp 0x38dc
leaq 0x88(%rsp), %rdi
callq 0x3dc0
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x3080
movq %rax, (%rsp)
jmp 0x38fc
movq (%rsp), %rdi
movq 0xa6b1(%rip), %rsi      # 0xdfb8
callq 0x3280
jmp 0x390e
leaq 0x88(%rsp), %rdi
callq 0x3e60
movl $0x0, 0xb0(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0x3170
addq $0xe8, %rsp
retq
leaq 0xc0(%rsp), %rdi
callq 0x3170
movq 0xb8(%rsp), %rdi
callq 0x33f0
nopw %cs:(%rax,%rax)