// File: jliesch[P]ofxget/ofxget.cc
// Function: ofxget::GetMissingRequestVars(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>> const&)
vector<string> GetMissingRequestVars(const string& request_template,
                                     const VarsMap& vars) {
  vector<string> missing;
  for (std::size_t i = 0; i < request_template.size(); i++) {
    if (request_template[i] == '$') {
      std::size_t j;
      for (j = i + 1; j < request_template.size(); j++) {
        if (!isupper(request_template[j])) {
          break;
        }
      }
      string var = request_template.substr(i + 1, j - i - 1);
      VarsMap::const_iterator it = vars.find(var);
      if (it == vars.end() || it->second.empty()) {
        missing.push_back(var);
      }
    }
  }
  return missing;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x80(%rbp)
movq %rdi, %rax
movq %rax, -0x78(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
callq 0xb5f0
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x10(%rbp), %rdi
callq 0x7290
movq %rax, %rcx
movq -0x88(%rbp), %rax
cmpq %rcx, %rax
jae 0xaa64
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x7a60
movsbl (%rax), %eax
cmpl $0x24, %eax
jne 0xaa51
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x10(%rbp), %rdi
callq 0x7290
movq %rax, %rcx
movq -0x90(%rbp), %rax
cmpq %rcx, %rax
jae 0xa97e
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x7a60
movsbl (%rax), %edi
callq 0x78c0
cmpl $0x0, %eax
jne 0xa96e
jmp 0xa97e
jmp 0xa970
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0xa92f
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rcx
movq %rcx, %rdx
incq %rdx
movq -0x30(%rbp), %rax
notq %rcx
addq %rax, %rcx
leaq -0x50(%rbp), %rdi
callq 0x7940
jmp 0xa9a1
movq -0x18(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0xb610
movq %rax, -0x98(%rbp)
jmp 0xa9b7
movq -0x98(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rdi
callq 0xb670
movq %rax, -0x70(%rbp)
leaq -0x68(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0xb640
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x99(%rbp)
jne 0xaa06
leaq -0x68(%rbp), %rdi
callq 0xb530
movq %rax, %rdi
addq $0x20, %rdi
callq 0x7250
movb %al, -0x99(%rbp)
movb -0x99(%rbp), %al
testb $0x1, %al
jne 0xaa12
jmp 0xaa48
movq -0x80(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0xb6a0
jmp 0xaa21
jmp 0xaa48
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xaa84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x7b88
jmp 0xaa84
leaq -0x50(%rbp), %rdi
callq 0x7b88
jmp 0xaa53
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0xa8e3
movb $0x1, -0x19(%rbp)
testb $0x1, -0x19(%rbp)
jne 0xaa77
movq -0x80(%rbp), %rdi
callq 0xb3a0
movq -0x78(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
movq -0x80(%rbp), %rdi
callq 0xb3a0
movq -0x58(%rbp), %rdi
callq 0x7600
nopw %cs:(%rax,%rax)