// File: /workspace/github_c_makefile_star2_O1/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, %r15
movq %r8, %r12
movq %rcx, (%rsp)
movq %rsi, %rbp
movq %rdi, %r13
movl $0x70, %edi
callq 0x34b0
testq %rax, %rax
je 0x10b84
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x60(%rax)
movups %xmm0, 0x50(%rax)
movups %xmm0, 0x40(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq %r13, 0x8(%rsp)
leaq 0x68(%r13), %rbx
leaq 0x30(%rsp), %r13
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, 0x30(%rsp)
testw %cx, %cx
je 0x10ae4
movq %rbx, %rdi
movq %r13, %rsi
callq 0x390c
testq %rax, %rax
jne 0x10ae4
movzwl 0x30(%rsp), %eax
movw %ax, (%r14)
movzwl (%rbp), %eax
movw %ax, 0x2(%r14)
movzwl 0x2(%rbp), %eax
movw %ax, 0x4(%r14)
movq 0x10(%rbp), %rax
movups (%rax), %xmm0
movups %xmm0, 0x8(%r14)
movq (%rax), %rdi
callq 0x3610
movq %rax, 0x8(%r14)
movq %r12, 0x20(%r14)
movq %r15, 0x28(%r14)
movq %r14, 0x40(%r14)
movq 0x8(%rsp), %r13
movq %r13, 0x68(%r14)
xorl %edi, %edi
callq 0x3310
movslq 0x508(%r13), %rcx
addq %rax, %rcx
movq %rcx, 0x18(%r14)
jmp 0x10bbc
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x17d59
cmpl $0x3, (%rax)
jl 0x10bbc
leaq 0x12a65(%rip), %rsi     # 0x235ff
leaq 0x120fe(%rip), %rdx     # 0x22c9f
leaq 0x12cfb(%rip), %r8      # 0x238a3
xorl %r14d, %r14d
movl $0x3, %edi
movl $0x44, %ecx
xorl %eax, %eax
callq 0x17d92
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %r14, %r14
je 0x10edb
leaq 0x58(%r13), %rax
leaq 0x30(%r14), %rcx
movq %rax, 0x30(%r14)
movq 0x60(%r13), %rax
movq %rax, 0x38(%r14)
movq %rcx, (%rax)
movq %rcx, 0x60(%r13)
leaq 0x68(%r13), %r12
leaq 0x40(%r14), %rsi
movq %r12, %rdi
movq %rsi, 0x50(%rsp)
callq 0x379c
incl 0x78(%r13)
movq 0x68(%r14), %r15
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
callq 0x19b12
movzwl (%r14), %eax
movw %ax, (%rbx)
movzwl 0x4(%r14), %eax
movw %ax, 0x2(%rbx)
movw $0x1, 0x4(%rbx)
leaq 0x8(%r14), %rdi
movl $0x1, %esi
callq 0x19b6a
movq %rax, 0x10(%rbx)
cmpq $0x0, (%rsp)
je 0x10ccc
leaq 0x30(%rsp), %rdi
movl $0x29, %esi
callq 0x1b531
testq %rax, %rax
jne 0x10c76
leaq 0x30(%rsp), %rdi
callq 0x1b653
testq %rax, %rax
je 0x10e38
movw $0x400, 0xa(%rax)       # imm = 0x400
movq (%rsp), %rsi
movl 0x90(%rsi), %edx
addq $0x10, %rsi
movq %rax, %rdi
xorl %ecx, %ecx
callq 0x1bd22
testl %eax, %eax
je 0x10ccc
xorl %eax, %eax
callq 0x17d59
cmpl $0x3, (%rax)
jl 0x10e6a
leaq 0x12950(%rip), %rsi     # 0x235ff
leaq 0x12963(%rip), %rdx     # 0x23619
leaq 0x12192(%rip), %r8      # 0x22e4f
movl $0x3, %edi
movl $0x95, %ecx
jmp 0x10e63
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
xorl %edx, %edx
callq 0x1bdbb
testl %eax, %eax
jle 0x10dfa
leaq 0x30(%rsp), %rdi
callq 0x1a1dd
cmpl $0x0, 0x500(%r15)
jle 0x10dbc
movq %r12, (%rsp)
movq %r13, 0x8(%rsp)
leaq 0x108(%r15), %r12
xorl %r13d, %r13d
xorl %ebp, %ebp
movl $0x0, 0x1c(%rsp)
leaq -0x88(%r12), %rbx
movl -0x8(%r12), %ecx
movl (%r12), %edi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0x19623
cmpl 0x18(%rsp), %eax
jne 0x10d42
incl %ebp
jmp 0x10d7f
xorl %eax, %eax
callq 0x17d59
cmpl $0x4, (%rax)
jl 0x10d7f
movq %rbx, %rdi
callq 0x184d9
movl $0x4, %edi
leaq 0x1289d(%rip), %rsi     # 0x235ff
leaq 0x128b0(%rip), %rdx     # 0x23619
movl $0xac, %ecx
leaq 0x1291c(%rip), %r8      # 0x23691
movq %rax, %r9
xorl %eax, %eax
callq 0x17d92
incq %r13
movslq 0x500(%r15), %rax
addq $0x90, %r12
cmpq %rax, %r13
jl 0x10d12
testl %ebp, %ebp
movq 0x8(%rsp), %r13
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq (%rsp), %r12
je 0x10dbc
leaq 0x10(%rsp), %rdi
callq 0x1d5f9
xorl %ebp, %ebp
jmp 0x10edb
xorl %eax, %eax
callq 0x17d59
cmpl $0x3, (%rax)
jl 0x10dee
leaq 0x12830(%rip), %rsi     # 0x235ff
leaq 0x12843(%rip), %rdx     # 0x23619
leaq 0x128cb(%rip), %r8      # 0x236a8
movl $0x3, %edi
movl $0xb4, %ecx
xorl %eax, %eax
callq 0x17d92
leaq 0x10(%rsp), %rdi
callq 0x1d5f9
jmp 0x10e74
xorl %eax, %eax
callq 0x17d59
cmpl $0x3, (%rax)
jl 0x10e2c
leaq 0x127f2(%rip), %rsi     # 0x235ff
leaq 0x12805(%rip), %rdx     # 0x23619
leaq 0x11971(%rip), %r8      # 0x2278c
movl $0x3, %edi
movl $0x9c, %ecx
xorl %eax, %eax
callq 0x17d92
leaq 0x10(%rsp), %rdi
callq 0x1d5f9
jmp 0x10e6a
xorl %eax, %eax
callq 0x17d59
cmpl $0x3, (%rax)
jl 0x10e6a
leaq 0x127b4(%rip), %rsi     # 0x235ff
leaq 0x127c7(%rip), %rdx     # 0x23619
leaq 0x11fd1(%rip), %r8      # 0x22e2a
movl $0x3, %edi
movl $0x8c, %ecx
xorl %eax, %eax
callq 0x17d92
leaq 0x30(%rsp), %rdi
callq 0x1a1dd
xorl %eax, %eax
callq 0x17d59
cmpl $0x3, (%rax)
jl 0x10ea6
leaq 0x12778(%rip), %rsi     # 0x235ff
leaq 0x12783(%rip), %rdx     # 0x23611
leaq 0x1278e(%rip), %r8      # 0x23623
movl $0x3, %edi
movl $0x166, %ecx            # imm = 0x166
xorl %eax, %eax
callq 0x17d92
movq 0x30(%r14), %rax
movq 0x38(%r14), %rcx
movq %rax, (%rcx)
movq 0x30(%r14), %rax
movq %rcx, 0x8(%rax)
movq %r12, %rdi
movq 0x50(%rsp), %rsi
callq 0x3946
decl 0x78(%r13)
movq 0x8(%r14), %rdi
callq 0x3450
movq %r14, %rdi
callq 0x3450
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq