// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/channel_tcp.c
// Function: step
static int step(channel_t* ctx,
	fd_set* readset, fd_set* writeset, fd_set* errorset)
{
	channel_tcp_t *c = (channel_tcp_t*)ctx;
	dlitem_t *cur, *nxt;
	tcpreq_t *req;
	time_t now;
	now = time(NULL);
	dllist_foreach(&c->reqs, cur, nxt, tcpreq_t, req, entry) {
		if (req->is_closing) {
			if (req->callback) {
				req->callback((channel_t*)c, -1, NULL, FALSE, FALSE, req->cb_state);
				req->callback = NULL;
			}
			dllist_init_remove(&req->entry);
			c->req_count--;
			req_destroy(req);
		}
		else {
			int r = req_step(ctx, req, now, readset, writeset, errorset);
			if (r != 0 || is_expired(req, now)) {
				if (r == 0)
					loge("request timeout - %s\n", req->qr.qname);
				if (req->callback) {
					req->callback((channel_t*)c, -1, NULL, FALSE, FALSE, req->cb_state);
					req->callback = NULL;
				}
				dllist_init_remove(&req->entry);
				c->req_count--;
				req_destroy(req);
			}
		}
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rcx, %r15
movq %rdx, 0x38(%rsp)
movq %rsi, 0x60(%rsp)
movq %rdi, %rbx
xorl %edi, %edi
callq 0x3310
movq %rax, 0x68(%rsp)
leaq 0x58(%rbx), %r14
movq 0x58(%rbx), %r13
cmpq %r14, %r13
je 0xf989
leaq 0x70(%rbx), %rax
movq %rax, 0x80(%rsp)
movq %r15, 0x10(%rsp)
movq %rbx, 0x30(%rsp)
movq %r14, 0x70(%rsp)
movq (%r13), %rbp
cmpl $0x0, 0x28(%r13)
je 0xf2f1
movq -0x10(%r13), %rax
movq %rbp, %rcx
testq %rax, %rax
je 0xf2e1
movq -0x8(%r13), %r9
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq *%rax
movq $0x0, -0x10(%r13)
movq (%r13), %rcx
movq 0x8(%r13), %rax
movq %rcx, (%rax)
movq (%r13), %rcx
jmp 0xf91a
leaq 0x18(%r13), %rax
movq 0x18(%r13), %r12
movq %rax, 0x40(%rsp)
cmpq %rax, %r12
je 0xf8e9
movq %rbp, 0x78(%rsp)
movq %r13, 0x20(%rsp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, %ebp
movq %r12, %r14
movq (%r12), %r12
leaq -0x40(%r14), %r13
movl -0x8(%r14), %edx
leal -0x3(%rdx), %eax
cmpl $0x2, %eax
jb 0xf4c6
movl (%r13), %edi
leal 0x3f(%rdi), %eax
testl %edi, %edi
cmovnsl %edi, %eax
movl %eax, %ecx
sarl $0x6, %ecx
movslq %ecx, %rsi
movq (%r15,%rsi,8), %r9
andl $-0x40, %eax
movl %edi, %ecx
subl %eax, %ecx
movl $0x1, %r8d
shlq %cl, %r8
btq %rcx, %r9
jae 0xf3da
callq 0x17e19
movl %eax, %ebx
xorl %eax, %eax
callq 0x176e5
cmpl $0x3, (%rax)
jl 0xf4c6
movl %ebx, %edi
callq 0x3140
movq %rax, %r15
movslq 0x50(%r14), %rax
movq %rax, %rcx
shlq $0x7, %rcx
leaq (%rcx,%rax,8), %rdi
addq 0x80(%rsp), %rdi
callq 0x17e75
movq %rax, 0x8(%rsp)
movq %r15, (%rsp)
movq 0x10(%rsp), %r15
movl $0x3, %edi
leaq 0x13e94(%rip), %rsi     # 0x2324c
leaq 0x14194(%rip), %rdx     # 0x23553
movl $0x327, %ecx            # imm = 0x327
leaq 0x14191(%rip), %r8      # 0x2355c
movl %ebx, %r9d
xorl %eax, %eax
callq 0x1771e
jmp 0xf4c6
movl %edx, %eax
andl $-0x5, %eax
cmpl $0x9, %eax
je 0xf3f1
movl 0x28(%r14), %ecx
movl %edx, %eax
xorl $0x2, %eax
orl %ecx, %eax
jne 0xf44a
movl -0x18(%r14), %eax
cmpl -0x14(%r14), %eax
jle 0xf41f
movq 0x38(%rsp), %rax
testq %r8, (%rax,%rsi,8)
je 0xf509
leaq -0x20(%r14), %rsi
callq 0x18d8e
movl %eax, %ecx
sarl $0x1f, %eax
andl %ecx, %eax
jmp 0xf4c2
movq 0x60(%rsp), %rax
testq %r8, (%rax,%rsi,8)
je 0xf509
leaq -0x38(%r14), %rbx
movq %rbx, %rdi
movl $0x402, %esi            # imm = 0x402
callq 0x1cf07
testl %eax, %eax
je 0xf492
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0xf4bb
xorl %eax, %eax
cmpl $0xc, %edx
ja 0xf4f9
movl $0x1940, %r9d           # imm = 0x1940
btl %edx, %r9d
jb 0xf478
movl $0x4a0, %r9d            # imm = 0x4A0
btl %edx, %r9d
jae 0xf50d
movq 0x38(%rsp), %rcx
jmp 0xf47d
movq 0x60(%rsp), %rcx
testq %r8, (%rcx,%rsi,8)
je 0xf4f9
movq 0x30(%rsp), %rdi
movq %r13, %rsi
callq 0xfa1c
jmp 0xf4c2
movq %rbx, 0x58(%rsp)
movslq -0x30(%r14), %rsi
movl -0x28(%r14), %edx
subl %esi, %edx
addq -0x38(%r14), %rsi
movl -0x40(%r14), %edi
callq 0x18ebc
movl %eax, %ebx
incl %eax
cmpl $0x2, %eax
jae 0xf53d
movl %ebx, %eax
sarl $0x1f, %eax
andl %ebx, %eax
testl %eax, %eax
je 0xf509
movq (%r14), %rax
movq 0x8(%r14), %rcx
movq %rax, (%rcx)
movq %rcx, 0x8(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movq %r13, %rdi
callq 0x19218
addq $0x30, %r14
movq %r14, %rdi
callq 0x1cdc9
movq %r13, %rdi
callq 0x3450
movl %ebp, %eax
cmpq 0x40(%rsp), %r12
jne 0xf316
jmp 0xf8d1
xorl %eax, %eax
jmp 0xf4f9
cmpl $0x1, %edx
jne 0xf4f9
movq 0x38(%rsp), %rdx
testq %r8, (%rdx,%rsi,8)
je 0xf4f9
movl $0x2, -0x8(%r14)
testl %ecx, %ecx
jne 0xf483
movl -0x18(%r14), %ecx
cmpl -0x14(%r14), %ecx
jg 0xf40a
jmp 0xf4f9
addl %ebx, -0x30(%r14)
xorl %eax, %eax
callq 0x176e5
cmpl $0x8, (%rax)
jl 0xf59f
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x50(%r14), %rcx
movq %rcx, %rdx
shlq $0x7, %rdx
leaq (%rdx,%rcx,8), %rcx
leaq (%rax,%rcx), %rdi
addq $0x70, %rdi
callq 0x17e75
movq %rax, (%rsp)
movl $0x8, %edi
leaq 0x13cca(%rip), %rsi     # 0x2324c
leaq 0x13ff2(%rip), %rdx     # 0x2357b
movl $0x11b, %ecx            # imm = 0x11B
leaq 0x13fef(%rip), %r8      # 0x23584
movl %ebx, %r9d
xorl %eax, %eax
callq 0x1771e
movl %ebx, 0x2c(%rsp)
movl -0x30(%r14), %r15d
movl -0x2c(%r14), %ebx
subl %ebx, %r15d
cmpl $0x2, %r15d
jl 0xf7a2
movq 0x58(%rsp), %rdi
movl %ebx, %esi
movl $0x2, %edx
callq 0x1d262
movl %eax, %ebx
cmpl $0x401, %eax            # imm = 0x401
jge 0xf760
movl %ebx, 0x4c(%rsp)
addl $0x2, %ebx
cmpl %ebx, %r15d
jl 0xf79e
movq -0x38(%r14), %rax
movq %rax, 0x18(%rsp)
movslq -0x2c(%r14), %r15
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x50(%rsp)
movl $0x20, %edi
callq 0x34b0
testq %rax, %rax
je 0xf80a
movl %ebx, 0x48(%rsp)
movq %rax, %rdi
movq %rax, %rbx
callq 0x19496
testl %eax, %eax
jne 0xf83e
movq 0x18(%rsp), %rax
leaq (%rax,%r15), %rsi
addq $0x2, %rsi
movq %rbx, 0x18(%rsp)
movq %rbx, %rdi
movl 0x4c(%rsp), %edx
callq 0x1a0ca
movl %eax, %r15d
xorl %eax, %eax
callq 0x176e5
movl (%rax), %eax
testl %r15d, %r15d
jne 0xf887
cmpl $0x7, %eax
movl 0x48(%rsp), %ebx
jl 0xf6d7
movq 0x18(%rsp), %rax
cmpw $0x0, 0x4(%rax)
je 0xf686
movq 0x10(%rax), %rdi
testq %rdi, %rdi
je 0xf686
callq 0x19ba4
movq %rax, %r15
jmp 0xf689
xorl %r15d, %r15d
movslq 0x50(%r14), %rax
movq %rax, %rcx
shlq $0x7, %rcx
leaq (%rcx,%rax,8), %rax
movq 0x50(%rsp), %rcx
leaq (%rcx,%rax), %rdi
addq $0x70, %rdi
callq 0x17e75
movq %rax, (%rsp)
movl $0x7, %edi
leaq 0x13b92(%rip), %rsi     # 0x2324c
leaq 0x13f20(%rip), %rdx     # 0x235e1
movl $0xd5, %ecx
leaq 0x13f21(%rip), %r8      # 0x235ee
movq %r15, %r9
xorl %eax, %eax
callq 0x1771e
movq 0x20(%rsp), %r15
movq -0x10(%r15), %rax
testq %rax, %rax
je 0xf707
movq -0x8(%r15), %r9
movq 0x50(%rsp), %rdi
xorl %esi, %esi
movq 0x18(%rsp), %rdx
xorl %ecx, %ecx
movl $0x1, %r8d
callq *%rax
movq $0x0, -0x10(%r15)
movq 0x40(%rsp), %rax
movq (%rax), %r15
cmpq %rax, %r15
je 0xf739
movq %r15, %rax
movq (%r15), %r15
movl $0x3, -0x8(%rax)
movl -0x40(%rax), %edi
testl %edi, %edi
je 0xf732
movl $0x2, %esi
callq 0x34c0
cmpq 0x40(%rsp), %r15
jne 0xf714
movq 0x20(%rsp), %rax
movl $0x1, 0x28(%rax)
addl -0x2c(%r14), %ebx
movl %ebx, -0x2c(%r14)
movl -0x30(%r14), %r15d
subl %ebx, %r15d
cmpl $0x1, %r15d
jg 0xf5b8
jmp 0xf7a2
xorl %eax, %eax
callq 0x176e5
cmpl $0x3, (%rax)
jl 0xf878
movl $0x3, %edi
leaq 0x13ad0(%rip), %rsi     # 0x2324c
leaq 0x13e15(%rip), %rdx     # 0x23598
movl $0xe9, %ecx
leaq 0x13e14(%rip), %r8      # 0x235a3
movl %ebx, %r9d
xorl %eax, %eax
callq 0x1771e
jmp 0xf878
movl -0x2c(%r14), %ebx
testl %ebx, %ebx
jle 0xf7fc
movq 0x58(%rsp), %rdi
callq 0x1cecd
testl %eax, %eax
movq 0x10(%rsp), %r15
movl 0x2c(%rsp), %ebx
je 0xf4bb
xorl %eax, %eax
callq 0x176e5
cmpl $0x3, (%rax)
jl 0xf443
movl $0x3, %edi
leaq 0x13a6f(%rip), %rsi     # 0x2324c
leaq 0x13db4(%rip), %rdx     # 0x23598
movl $0xfb, %ecx
leaq 0x13dda(%rip), %r8      # 0x235ca
xorl %eax, %eax
callq 0x1771e
jmp 0xf443
movq 0x10(%rsp), %r15
movl 0x2c(%rsp), %ebx
jmp 0xf4bb
xorl %eax, %eax
callq 0x176e5
cmpl $0x3, (%rax)
jl 0xf878
movl $0x3, %edi
leaq 0x13a2a(%rip), %rsi     # 0x2324c
leaq 0x13db8(%rip), %rdx     # 0x235e1
movl $0xc3, %ecx
leaq 0x1407e(%rip), %r8      # 0x238b3
xorl %eax, %eax
callq 0x1771e
jmp 0xf878
xorl %eax, %eax
callq 0x176e5
cmpl $0x3, (%rax)
jl 0xf870
movl $0x3, %edi
leaq 0x139f6(%rip), %rsi     # 0x2324c
leaq 0x13d84(%rip), %rdx     # 0x235e1
movl $0xc8, %ecx
leaq 0x12d43(%rip), %r8      # 0x225ac
xorl %eax, %eax
callq 0x1771e
movq %rbx, %rdi
callq 0x3450
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq 0x10(%rsp), %r15
jmp 0xf4bb
cmpl $0x3, %eax
movq 0x10(%rsp), %r15
jl 0xf8b7
movl $0x3, %edi
leaq 0x139af(%rip), %rsi     # 0x2324c
leaq 0x13d3d(%rip), %rdx     # 0x235e1
movl $0xce, %ecx
leaq 0x136e1(%rip), %r8      # 0x22f91
xorl %eax, %eax
callq 0x1771e
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0x19ae0
movq %rbx, %rdi
callq 0x3450
jmp 0xf443
testl %eax, %eax
movq 0x30(%rsp), %rbx
movq 0x70(%rsp), %r14
movq 0x20(%rsp), %r13
movq 0x78(%rsp), %rbp
je 0xf943
movq -0x10(%r13), %rax
testq %rax, %rax
je 0xf90f
movq -0x8(%r13), %r9
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq *%rax
movq $0x0, -0x10(%r13)
movq (%r13), %rcx
movq 0x8(%r13), %rax
movq %rcx, (%rax)
movq %rax, 0x8(%rcx)
xorps %xmm0, %xmm0
movups %xmm0, (%r13)
addq $-0x30, %r13
decl 0x68(%rbx)
movq %r13, %rdi
callq 0xed23
movq %rbp, %r13
cmpq %r14, %rbp
jne 0xf2a9
jmp 0xf989
movq 0x68(%rsp), %rax
cmpq %rax, -0x18(%r13)
jg 0xf935
xorl %eax, %eax
callq 0x176e5
cmpl $0x3, (%rax)
jl 0xf8e9
movq -0x28(%r13), %r9
movl $0x3, %edi
leaq 0x138e2(%rip), %rsi     # 0x2324c
leaq 0x13d79(%rip), %rdx     # 0x236ea
movl $0x37b, %ecx            # imm = 0x37B
leaq 0x147e2(%rip), %r8      # 0x2415f
xorl %eax, %eax
callq 0x1771e
jmp 0xf8e9
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq