// File: davidgfnet[P]tadns/tadns.cc
// Function: DNSResolver::resolve(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, dns_record_type, void (*)(dns_cb_data*), void*, unsigned int)
void DNSResolver::resolve(std::string name, enum dns_record_type qtype,
                          dns_callback_t callback, void *ctx, unsigned options) {
    std::transform(name.begin(), name.end(), name.begin(), ::tolower);

    if (options & DNS_OPT_RECURSIVE_SOLVE) {
		struct cache_entry *dentry = find_cached_query(qtype, name);
		if (dentry) {
		    call_user(this, name, qtype, dentry, callback, ctx, DNS_OK);
		} else {
	        Query * oq = createQuery(0, ctx, name, qtype, callback);
    	    this->queue(0, name, oq, qtype, NULL);
		}
    } else {
        this->resolveInt(0, ctx, name, qtype, callback);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rsi, -0x128(%rbp)
movq %rdi, %rax
movq -0x128(%rbp), %rdi
movq %rdi, -0x118(%rbp)
movq %rax, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x120(%rbp)
callq 0x32f0
movq -0x118(%rbp), %rdi
movq %rax, -0x38(%rbp)
callq 0x31d0
movq -0x118(%rbp), %rdi
movq %rax, -0x40(%rbp)
callq 0x32f0
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq 0x1d0f7(%rip), %rcx     # 0x25fd8
callq 0xadb0
movq %rax, -0x50(%rbp)
movl -0x2c(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x90eb
movq -0x118(%rbp), %rsi
movl -0x14(%rbp), %eax
movl %eax, -0x13c(%rbp)
leaq -0x78(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x3160
movq -0x120(%rbp), %rdi
movl -0x13c(%rbp), %esi
movq -0x138(%rbp), %rdx
callq 0x62a0
movq %rax, -0x130(%rbp)
jmp 0x8f3b
leaq -0x78(%rbp), %rdi
callq 0x3200
movq -0x130(%rbp), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0x8ff0
movq -0x118(%rbp), %rsi
leaq -0xa8(%rbp), %rdi
movq %rdi, -0x148(%rbp)
callq 0x3160
movq -0x120(%rbp), %rdi
movq -0x148(%rbp), %rsi
movzwl -0x14(%rbp), %edx
movq -0x58(%rbp), %rcx
movq -0x20(%rbp), %r8
movq -0x28(%rbp), %r9
movq %rsp, %rax
movl $0x0, (%rax)
callq 0x7190
jmp 0x8fa2
leaq -0xa8(%rbp), %rdi
callq 0x3200
jmp 0x90e9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x3200
jmp 0x916a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x3200
jmp 0x916a
movq -0x118(%rbp), %rsi
movq -0x28(%rbp), %rax
movq %rax, -0x160(%rbp)
leaq -0xd0(%rbp), %rdi
movq %rdi, -0x158(%rbp)
callq 0x3160
movq -0x120(%rbp), %rdi
movq -0x160(%rbp), %rdx
movq -0x158(%rbp), %rcx
movl -0x14(%rbp), %r8d
movq -0x20(%rbp), %r9
xorl %esi, %esi
callq 0x8d20
movq %rax, -0x150(%rbp)
jmp 0x9042
leaq -0xd0(%rbp), %rdi
callq 0x3200
movq -0x150(%rbp), %rax
movq -0x118(%rbp), %rsi
movq %rax, -0xb0(%rbp)
leaq -0xf0(%rbp), %rdi
movq %rdi, -0x168(%rbp)
callq 0x3160
movq -0x120(%rbp), %rdi
movq -0x168(%rbp), %rdx
movq -0xb0(%rbp), %rcx
movl -0x14(%rbp), %r8d
xorl %esi, %esi
movl %esi, %r9d
callq 0x8900
jmp 0x909b
leaq -0xf0(%rbp), %rdi
callq 0x3200
jmp 0x90e9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x3200
jmp 0x916a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x3200
jmp 0x916a
jmp 0x9161
movq -0x118(%rbp), %rsi
movq -0x28(%rbp), %rax
movq %rax, -0x178(%rbp)
leaq -0x110(%rbp), %rdi
movq %rdi, -0x170(%rbp)
callq 0x3160
movq -0x120(%rbp), %rdi
movq -0x178(%rbp), %rdx
movq -0x170(%rbp), %rcx
movl -0x14(%rbp), %r8d
movq -0x20(%rbp), %r9
xorl %esi, %esi
callq 0x7260
jmp 0x9136
leaq -0x110(%rbp), %rdi
callq 0x3200
jmp 0x9161
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x3200
jmp 0x916a
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
movq -0x80(%rbp), %rdi
callq 0x3530
nopw %cs:(%rax,%rax)