// File: /workspace/github_c_makefile_star2_O2/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 $0x68, %rsp
movq %r9, %rbp
movq %r8, %rbx
movq %rcx, %r15
movq %rsi, %r13
movq %rdi, %r14
pushq $0x1
popq %rdi
pushq $0x70
popq %rsi
callq 0x3250
movq %rax, 0x38(%rsp)
testq %rax, %rax
je 0xfea8
movq %r15, 0x8(%rsp)
movq %r14, 0x30(%rsp)
leaq 0x68(%r14), %r15
movl $0x7fff, %r14d          # imm = 0x7FFF
leaq 0x40(%rsp), %r12
callq 0x30f0
cltd
idivl %r14d
movw %dx, 0x40(%rsp)
testw %dx, %dx
je 0xfd1f
movq %r15, %rdi
movq %r12, %rsi
callq 0x38ef
testq %rax, %rax
jne 0xfd1f
leaq 0x40(%rsp), %r12
movzwl (%r12), %eax
movq 0x38(%rsp), %r14
movw %ax, (%r14)
movl (%r13), %eax
movl %eax, 0x2(%r14)
leaq 0x8(%r14), %rax
movq %rax, 0x60(%rsp)
movq 0x10(%r13), %rax
movups (%rax), %xmm0
movups %xmm0, 0x8(%r14)
movq (%rax), %rdi
callq 0x3620
movq %rax, 0x8(%r14)
movq %rbx, 0x20(%r14)
movq %rbp, 0x28(%r14)
leaq 0x40(%r14), %r13
movq %r14, 0x40(%r14)
movq 0x30(%rsp), %rbx
movq %rbx, 0x68(%r14)
xorl %edi, %edi
callq 0x3320
movslq 0x508(%rbx), %rcx
addq %rax, %rcx
movq %rcx, 0x18(%r14)
leaq 0x58(%rbx), %rax
movq %r14, %rcx
addq $0x30, %rcx
movq %rax, 0x30(%r14)
movq 0x60(%rbx), %rax
movq %rax, 0x38(%r14)
movq %rcx, (%rax)
movq %rcx, 0x60(%rbx)
movq %r15, %rdi
movq %r13, %rsi
callq 0x378c
incl 0x78(%rbx)
movq 0x68(%r14), %rbp
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
movq %r12, %rdi
callq 0x18296
movzwl (%r14), %eax
movw %ax, (%r12)
movzwl 0x4(%r14), %eax
movw %ax, 0x2(%r12)
movw $0x1, 0x4(%r12)
pushq $0x1
popq %rsi
movq 0x60(%rsp), %rdi
callq 0x182e8
movq %rax, 0x10(%r12)
movq 0x8(%rsp), %r12
testq %r12, %r12
je 0xfee2
leaq 0x40(%rsp), %rdi
pushq $0x29
popq %rsi
callq 0x19ad8
testq %rax, %rax
jne 0xfe53
leaq 0x40(%rsp), %rdi
callq 0x19bdc
testq %rax, %rax
je 0x10038
movw $0x400, 0xa(%rax)       # imm = 0x400
movl 0x90(%r12), %edx
addq $0x10, %r12
movq %rax, %rdi
movq %r12, %rsi
xorl %ecx, %ecx
callq 0x1a257
testl %eax, %eax
je 0xfee2
xorl %eax, %eax
callq 0x165f5
cmpl $0x3, (%rax)
jl 0x10068
leaq 0x11782(%rip), %rsi     # 0x2160f
leaq 0x11795(%rip), %rdx     # 0x21629
leaq 0x10fbc(%rip), %r8      # 0x20e57
pushq $0x3
popq %rdi
movl $0x95, %ecx
jmp 0x10061
xorl %eax, %eax
callq 0x165f5
pushq $-0x1
popq %rbx
cmpl $0x3, (%rax)
jl 0x100ca
leaq 0x1174d(%rip), %rsi     # 0x2160f
leaq 0x10dde(%rip), %rdx     # 0x20ca7
leaq 0x119e3(%rip), %r8      # 0x218b3
pushq $0x3
popq %rdi
pushq $0x44
popq %rcx
xorl %eax, %eax
callq 0x1662e
jmp 0x100ca
leaq 0x10(%rsp), %rdi
leaq 0x40(%rsp), %rsi
xorl %edx, %edx
callq 0x1a2cd
testl %eax, %eax
jle 0xffb1
movq %r13, 0x8(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x188ce
leaq 0x108(%rbp), %r12
xorl %r13d, %r13d
xorl %r14d, %r14d
movslq 0x500(%rbp), %rax
cmpq %rax, %r13
jge 0xff9b
andl $0x0, 0x1c(%rsp)
leaq -0x88(%r12), %rbx
movl -0x8(%r12), %ecx
movl (%r12), %edi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0x17deb
cmpl 0x18(%rsp), %eax
jne 0xff51
incl %r14d
jmp 0xff8c
xorl %eax, %eax
callq 0x165f5
cmpl $0x4, (%rax)
jl 0xff8c
movq %rbx, %rdi
callq 0x16d82
pushq $0x4
popq %rdi
leaq 0x116a0(%rip), %rsi     # 0x2160f
leaq 0x116b3(%rip), %rdx     # 0x21629
movl $0xac, %ecx
leaq 0x1171f(%rip), %r8      # 0x216a1
movq %rax, %r9
xorl %eax, %eax
callq 0x1662e
incq %r13
addq $0x90, %r12
jmp 0xff17
testl %r14d, %r14d
je 0xffed
leaq 0x10(%rsp), %rdi
callq 0x1b8a6
xorl %ebx, %ebx
jmp 0x100ca
xorl %eax, %eax
callq 0x165f5
cmpl $0x3, (%rax)
jl 0xffe1
leaq 0x1164b(%rip), %rsi     # 0x2160f
leaq 0x1165e(%rip), %rdx     # 0x21629
leaq 0x1079a(%rip), %r8      # 0x2076c
pushq $0x3
popq %rdi
movl $0x9c, %ecx
xorl %eax, %eax
callq 0x1662e
leaq 0x10(%rsp), %rdi
callq 0x1b8a6
jmp 0x10068
xorl %eax, %eax
callq 0x165f5
cmpl $0x3, (%rax)
jl 0x1001d
leaq 0x1160f(%rip), %rsi     # 0x2160f
leaq 0x11622(%rip), %rdx     # 0x21629
leaq 0x116aa(%rip), %r8      # 0x216b8
pushq $0x3
popq %rdi
movl $0xb4, %ecx
xorl %eax, %eax
callq 0x1662e
leaq 0x10(%rsp), %rdi
callq 0x1b8a6
movq 0x30(%rsp), %rbx
movq 0x38(%rsp), %r14
movq 0x8(%rsp), %r13
jmp 0x10072
xorl %eax, %eax
callq 0x165f5
cmpl $0x3, (%rax)
jl 0x10068
leaq 0x115c4(%rip), %rsi     # 0x2160f
leaq 0x115d7(%rip), %rdx     # 0x21629
leaq 0x10dd9(%rip), %r8      # 0x20e32
pushq $0x3
popq %rdi
movl $0x8c, %ecx
xorl %eax, %eax
callq 0x1662e
leaq 0x40(%rsp), %rdi
callq 0x188ce
xorl %eax, %eax
callq 0x165f5
cmpl $0x3, (%rax)
jl 0x100a2
leaq 0x1158a(%rip), %rsi     # 0x2160f
leaq 0x11595(%rip), %rdx     # 0x21621
leaq 0x115a0(%rip), %r8      # 0x21633
pushq $0x3
popq %rdi
movl $0x166, %ecx            # imm = 0x166
xorl %eax, %eax
callq 0x1662e
movq 0x30(%r14), %rax
movq 0x38(%r14), %rcx
movq %rax, (%rcx)
movq %rcx, 0x8(%rax)
movq %r15, %rdi
movq %r13, %rsi
callq 0x392c
decl 0x78(%rbx)
movq %r14, %rdi
callq 0x100db
pushq $-0x1
popq %rbx
movl %ebx, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq