// File: /workspace/github_c_makefile_star2_O2/GangZhuo[P]dohclient/src/main.c
// Function: server_recv_msg
static int server_recv_msg(const char *data, int datalen,
	int listen,
	void *from, int fromlen, int fromtcp)
{
	req_t* req;

#if DOHCLIENT_CACHE_API
	if (conf.cache_api) {
		int r;

		r = cache_api_try_parse(cache, data, datalen, &listens[listen],
				from, fromlen, fromtcp);
		if (r == 0) {
			return 0;
		}
		else if (r == -1) {
			return -1;
		}
	}
#endif

	req = req_add_new(data, datalen, listen, from, fromlen, fromtcp);
	if (!req) {
		return -1;
	}

	if (hosts) {
		return hosts->query(hosts, req->msg, hosts_cb, req);
	}
	else {
		return cache->query(cache, req->msg, cache_cb, req);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %ebp
movq %rcx, %r14
callq 0x12ff4
testq %rax, %rax
je 0x1e47d
movq %rax, %rbx
xorl %eax, %eax
callq 0x165f5
cmpl $0x8, (%rax)
jl 0x1e374
xorl %eax, %eax
callq 0x165f5
cmpl $0x7, (%rax)
jl 0x1e374
movq %rbx, %rdi
callq 0x13229
movq 0x8(%rbx), %r15
testq %r15, %r15
je 0x1e445
movzwl 0x4(%r15), %eax
testw %ax, %ax
je 0x1e445
movq 0x10(%r15), %rcx
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x1e445
cmpb $0x0, (%rcx)
je 0x1e445
cmpw $0x1, %ax
je 0x1e3de
xorl %eax, %eax
callq 0x165f5
cmpl $0x4, (%rax)
jl 0x1e3de
leaq 0x5001(%rip), %rsi      # 0x233c2
leaq 0x5e9b(%rip), %rdx      # 0x24263
leaq 0x5e9e(%rip), %r8       # 0x2426d
pushq $0x4
popq %rdi
movl $0xc1, %ecx
xorl %eax, %eax
callq 0x1662e
movq %r15, %rdi
callq 0x181ec
testb $0x5f, %al
jne 0x1e475
movq 0x10(%r15), %rax
movzwl 0x8(%rax), %ecx
cmpl $0x1c, %ecx
je 0x1e400
cmpl $0x1, %ecx
jne 0x1e475
cmpw $0x1, 0xa(%rax)
jne 0x1e475
movq %rbx, %rdi
callq 0x1e808
movq %rax, %r15
xorl %eax, %eax
callq 0x165f5
cmpl $0x6, (%rax)
jl 0x1e4da
xorl %eax, %eax
callq 0x165f5
cmpl $0x6, (%rax)
jl 0x1e4da
cmpl $0x0, 0x24(%rbx)
movq 0x18(%rbx), %rdi
je 0x1e48f
movl (%rdi), %edi
callq 0x16e1e
jmp 0x1e494
xorl %eax, %eax
callq 0x165f5
cmpl $0x3, (%rax)
jl 0x1e475
leaq 0x4f6a(%rip), %rsi      # 0x233c2
leaq 0x5e04(%rip), %rdx      # 0x24263
leaq 0x2d6d(%rip), %r8       # 0x211d3
pushq $0x3
popq %rdi
movl $0xbd, %ecx
xorl %eax, %eax
callq 0x1662e
movq %rbx, %rdi
callq 0x131f0
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x16d82
movq %rax, %r10
cmpl $0x0, 0x24(%rbx)
leaq 0x2145(%rip), %rax      # 0x205e7
leaq 0x2142(%rip), %r11      # 0x205eb
cmoveq %rax, %r11
leaq 0x4f0e(%rip), %rsi      # 0x233c2
leaq 0x5d68(%rip), %rdx      # 0x24223
leaq 0x5d6d(%rip), %r8       # 0x2422f
pushq $0x6
popq %rdi
movl $0x130, %ecx            # imm = 0x130
movq %r15, %r9
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x1662e
popq %rax
popq %rcx
leaq 0x1021f(%rip), %rdi     # 0x2e700
movq %r15, %rsi
callq 0x38ef
testq %rax, %rax
je 0x1e5cd
movq %rax, %rcx
addq $0x28, %rcx
leaq 0x78(%rbx), %rdx
movq %rcx, 0x78(%rbx)
movq 0x30(%rax), %rcx
movq %rcx, 0x80(%rbx)
movq %rdx, (%rcx)
movq %rdx, 0x30(%rax)
testl %ebp, %ebp
je 0x1e532
leaq 0x70(%r14), %rax
leaq 0x68(%rbx), %rcx
movq %rax, 0x68(%rbx)
movq 0x78(%r14), %rax
movq %rax, 0x70(%rbx)
movq %rcx, (%rax)
movq %rcx, 0x78(%r14)
movq %rbx, %rax
addq $0x58, %rax
leaq 0x101b0(%rip), %rcx     # 0x2e6f0
movq %rcx, 0x58(%rbx)
movq 0x101ad(%rip), %rcx     # 0x2e6f8
movq %rcx, 0x60(%rbx)
movq %rax, (%rcx)
movq %rax, 0x1019f(%rip)     # 0x2e6f8
xorl %edi, %edi
callq 0x3320
movslq 0x10161(%rip), %rcx     # 0x2e6c8
addq %rax, %rcx
movq %rcx, 0x28(%rbx)
xorl %eax, %eax
callq 0x165f5
cmpl $0x7, (%rax)
jl 0x1e5a9
movl (%rbx), %r9d
subq $0x8, %rsp
leaq 0x4e3a(%rip), %rsi      # 0x233c2
leaq 0x5c94(%rip), %rdx      # 0x24223
leaq 0x5cb1(%rip), %r8       # 0x24247
pushq $0x7
popq %rdi
movl $0x146, %ecx            # imm = 0x146
xorl %eax, %eax
pushq %r15
callq 0x1662e
popq %rax
popq %rcx
movq 0x10fd8(%rip), %rdi     # 0x2f588
testq %rdi, %rdi
je 0x1e67d
movq 0x40(%rdi), %rax
movq 0x8(%rbx), %rsi
leaq 0x110(%rip), %rdx       # 0x1e6d8
jmp 0x1e693
pushq $0x1
popq %rdi
pushq $0x48
popq %rsi
callq 0x3250
testq %rax, %rax
je 0x1e6a6
movq %rax, %r12
leaq 0x38(%rax), %r13
movq %r13, 0x38(%rax)
movq %r13, 0x40(%rax)
movq %r15, %rdi
callq 0x3620
movq %rax, (%r12)
xorl %eax, %eax
callq 0x181bb
movq %rax, 0x8(%r12)
movq (%r12), %rax
movq %r12, %rsi
addq $0x10, %rsi
movq %rax, 0x10(%r12)
leaq 0x100e1(%rip), %rdi     # 0x2e700
callq 0x378c
leaq 0x78(%rbx), %rax
movq %r13, 0x78(%rbx)
movq 0x40(%r12), %rcx
movq %rcx, 0x80(%rbx)
movq %rax, (%rcx)
movq %rax, 0x40(%r12)
xorl %eax, %eax
callq 0x165f5
cmpl $0x7, (%rax)
jl 0x1e513
movq (%r12), %r9
leaq 0x4d67(%rip), %rsi      # 0x233c2
leaq 0x5c1c(%rip), %rdx      # 0x2427e
leaq 0x5c20(%rip), %r8       # 0x24289
pushq $0x7
popq %rdi
movl $0xee, %ecx
xorl %eax, %eax
callq 0x1662e
jmp 0x1e513
movq 0x10f0c(%rip), %rdi     # 0x2f590
movq 0x40(%rdi), %rax
movq 0x8(%rbx), %rsi
leaq 0x84(%rip), %rdx        # 0x1e717
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
xorl %eax, %eax
callq 0x165f5
cmpl $0x3, (%rax)
jl 0x1e475
leaq 0x4d05(%rip), %rsi      # 0x233c2
leaq 0x5bba(%rip), %rdx      # 0x2427e
leaq 0x31e8(%rip), %r8       # 0x218b3
pushq $0x3
popq %rdi
movl $0xe4, %ecx
jmp 0x1e46e