// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/channel_udp.c
// Function: channel_udp_query
int channel_udp_query(channel_t* ctx,
	const ns_msg_t* msg,
	int use_proxy, subnet_t* subnet,
	channel_query_cb callback, void* state)
{
	channel_udp_t* c = (channel_udp_t*)ctx;
	udpreq_t* req;

	req = req_new(c, msg, callback, state);
	if (!req)
		return -1;

	dllist_add(&c->reqs, &req->entry);
	rbtree_insert(&c->reqdic, &req->rbn);
	c->req_count++;

	if (udp_query(req, subnet)) {
		loge("udp_query() error\n");
		dllist_remove(&req->entry);
		rbtree_remove(&c->reqdic, &req->rbn);
		c->req_count--;
		req_destroy(req);
		return -1;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r9, %r12
movq %r8, %rbp
movq %rcx, 0x8(%rsp)
movq %rsi, %r13
movq %rdi, %r14
movl $0x1, %edi
movl $0x70, %esi
callq 0x3240
testq %rax, %rax
je 0x10774
movq %rax, %rbx
movq %r14, 0x30(%rsp)
leaq 0x68(%r14), %r15
leaq 0x38(%rsp), %r14
callq 0x30f0
cltq
imulq $-0x7ffefffd, %rax, %rcx # imm = 0x80010003
shrq $0x20, %rcx
addl %eax, %ecx
movl %ecx, %edx
shrl $0x1f, %edx
sarl $0xe, %ecx
addl %edx, %ecx
movl %ecx, %edx
shll $0xf, %edx
subl %edx, %ecx
addl %eax, %ecx
movw %cx, 0x38(%rsp)
testw %cx, %cx
je 0x105d0
movq %r15, %rdi
movq %r14, %rsi
callq 0x39f8
testq %rax, %rax
jne 0x105d0
leaq 0x38(%rsp), %r14
movzwl (%r14), %eax
movw %ax, (%rbx)
movl (%r13), %eax
movl %eax, 0x2(%rbx)
leaq 0x8(%rbx), %rax
movq %rax, (%rsp)
movq 0x10(%r13), %rax
movups (%rax), %xmm0
movups %xmm0, 0x8(%rbx)
movq (%rax), %rdi
callq 0x3610
movq %rax, 0x8(%rbx)
movq %rbp, 0x20(%rbx)
movq %r12, 0x28(%rbx)
leaq 0x40(%rbx), %r13
movq %rbx, 0x40(%rbx)
movq 0x30(%rsp), %r12
movq %r12, 0x68(%rbx)
xorl %edi, %edi
callq 0x3310
movslq 0x508(%r12), %rcx
addq %rax, %rcx
movq %rcx, 0x18(%rbx)
leaq 0x58(%r12), %rax
movq %rbx, %rcx
addq $0x30, %rcx
movq %rax, 0x30(%rbx)
movq 0x60(%r12), %rax
movq %rax, 0x38(%rbx)
movq %rcx, (%rax)
movq %rcx, 0x60(%r12)
movq %r15, %rdi
movq %r13, %rsi
callq 0x379c
incl 0x78(%r12)
movq 0x68(%rbx), %r12
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq %r14, %rdi
callq 0x19496
movzwl (%rbx), %eax
movw %ax, (%r14)
movzwl 0x4(%rbx), %eax
movw %ax, 0x2(%r14)
movw $0x1, 0x4(%r14)
movq (%rsp), %rdi
movl $0x1, %esi
callq 0x194ee
movq %rax, 0x10(%r14)
movq 0x8(%rsp), %r14
testq %r14, %r14
je 0x107b4
leaq 0x38(%rsp), %rdi
movl $0x29, %esi
callq 0x1ad6f
testq %rax, %rax
jne 0x1071e
leaq 0x38(%rsp), %rdi
callq 0x1ae8f
testq %rax, %rax
je 0x1091b
movw $0x400, 0xa(%rax)       # imm = 0x400
movl 0x90(%r14), %edx
addq $0x10, %r14
movq %rax, %rdi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x1b504
testl %eax, %eax
je 0x107b4
xorl %eax, %eax
callq 0x176e5
cmpl $0x3, (%rax)
jl 0x1094d
leaq 0x12eb8(%rip), %rsi     # 0x2360f
leaq 0x12ecb(%rip), %rdx     # 0x23629
leaq 0x126f2(%rip), %r8      # 0x22e57
movl $0x3, %edi
movl $0x95, %ecx
jmp 0x10946
xorl %eax, %eax
callq 0x176e5
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x3, (%rax)
jl 0x109c1
leaq 0x12e7f(%rip), %rsi     # 0x2360f
leaq 0x12510(%rip), %rdx     # 0x22ca7
leaq 0x13115(%rip), %r8      # 0x238b3
movl $0x3, %edi
movl $0x44, %ecx
xorl %eax, %eax
callq 0x1771e
jmp 0x109c1
leaq 0x10(%rsp), %rdi
leaq 0x38(%rsp), %rsi
xorl %edx, %edx
callq 0x1b58c
testl %eax, %eax
jle 0x108dd
leaq 0x38(%rsp), %rdi
callq 0x19ae0
cmpl $0x0, 0x500(%r12)
jle 0x1089f
movq %rbx, (%rsp)
movq %r13, 0x8(%rsp)
movq %r12, %rbx
leaq 0x108(%r12), %rbp
xorl %r12d, %r12d
xorl %r13d, %r13d
movl $0x0, 0x1c(%rsp)
leaq -0x88(%rbp), %r14
movl -0x8(%rbp), %ecx
movl (%rbp), %edi
leaq 0x10(%rsp), %rsi
movq %r14, %rdx
callq 0x18faf
cmpl 0x18(%rsp), %eax
jne 0x1082d
incl %r13d
jmp 0x1086a
xorl %eax, %eax
callq 0x176e5
cmpl $0x4, (%rax)
jl 0x1086a
movq %r14, %rdi
callq 0x17e75
movl $0x4, %edi
leaq 0x12dc2(%rip), %rsi     # 0x2360f
leaq 0x12dd5(%rip), %rdx     # 0x23629
movl $0xac, %ecx
leaq 0x12e41(%rip), %r8      # 0x236a1
movq %rax, %r9
xorl %eax, %eax
callq 0x1771e
incq %r12
movslq 0x500(%rbx), %rax
addq $0x90, %rbp
cmpq %rax, %r12
jl 0x10800
testl %r13d, %r13d
movq 0x8(%rsp), %r13
movq (%rsp), %rbx
je 0x1089f
leaq 0x10(%rsp), %rdi
callq 0x1cdc9
xorl %ebx, %ebx
jmp 0x109c1
xorl %eax, %eax
callq 0x176e5
cmpl $0x3, (%rax)
jl 0x108d1
leaq 0x12d5d(%rip), %rsi     # 0x2360f
leaq 0x12d70(%rip), %rdx     # 0x23629
leaq 0x12df8(%rip), %r8      # 0x236b8
movl $0x3, %edi
movl $0xb4, %ecx
xorl %eax, %eax
callq 0x1771e
leaq 0x10(%rsp), %rdi
callq 0x1cdc9
jmp 0x10957
xorl %eax, %eax
callq 0x176e5
cmpl $0x3, (%rax)
jl 0x1090f
leaq 0x12d1f(%rip), %rsi     # 0x2360f
leaq 0x12d32(%rip), %rdx     # 0x23629
leaq 0x11e6e(%rip), %r8      # 0x2276c
movl $0x3, %edi
movl $0x9c, %ecx
xorl %eax, %eax
callq 0x1771e
leaq 0x10(%rsp), %rdi
callq 0x1cdc9
jmp 0x1094d
xorl %eax, %eax
callq 0x176e5
cmpl $0x3, (%rax)
jl 0x1094d
leaq 0x12ce1(%rip), %rsi     # 0x2360f
leaq 0x12cf4(%rip), %rdx     # 0x23629
leaq 0x124f6(%rip), %r8      # 0x22e32
movl $0x3, %edi
movl $0x8c, %ecx
xorl %eax, %eax
callq 0x1771e
leaq 0x38(%rsp), %rdi
callq 0x19ae0
xorl %eax, %eax
callq 0x176e5
cmpl $0x3, (%rax)
jl 0x10989
leaq 0x12ca5(%rip), %rsi     # 0x2360f
leaq 0x12cb0(%rip), %rdx     # 0x23621
leaq 0x12cbb(%rip), %r8      # 0x23633
movl $0x3, %edi
movl $0x166, %ecx            # imm = 0x166
xorl %eax, %eax
callq 0x1771e
movq 0x30(%rbx), %rax
movq 0x38(%rbx), %rcx
movq %rax, (%rcx)
movq %rcx, 0x8(%rax)
movq %r15, %rdi
movq %r13, %rsi
callq 0x3a34
movq 0x30(%rsp), %rax
decl 0x78(%rax)
movq 0x8(%rbx), %rdi
callq 0x3450
movq %rbx, %rdi
callq 0x3450
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq