// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/channel_chndoh.c
// Function: fdset
static sock_t fdset(channel_t* ctx,
	fd_set* readset, fd_set* writeset, fd_set* errorset)
{
	channel_chndoh_t* c = (channel_chndoh_t*)ctx;
	sock_t maxfd = 0, fd;

	if (c->chndoh.channel == CH_DOH) {
		if (c->chndoh.http) {
			fd = http_fdset(c->chndoh.http, readset, writeset, errorset);
			if (fd < 0) return -1;
			maxfd = MAX(maxfd, fd);
		}
	}
	else if (c->chndoh.chctx) {
		fd = c->chndoh.chctx->fdset(c->chndoh.chctx, readset, writeset, errorset);
		if (fd < 0) return -1;
		maxfd = MAX(maxfd, fd);
	}

	if (c->frndoh.channel == CH_DOH) {
		if (c->frndoh.http) {
			fd = http_fdset(c->frndoh.http, readset, writeset, errorset);
			if (fd < 0) return -1;
			maxfd = MAX(maxfd, fd);
		}
	}
	else if (c->frndoh.chctx) {
		fd = c->frndoh.chctx->fdset(c->frndoh.chctx, readset, writeset, errorset);
		if (fd < 0) return -1;
		maxfd = MAX(maxfd, fd);
	}

	return maxfd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x1, 0x630(%rax)
jne 0xef71
movq -0x30(%rbp), %rax
cmpq $0x0, 0x638(%rax)
je 0xef6f
movq -0x30(%rbp), %rax
movq 0x638(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x1fe40
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x38(%rbp)
jge 0xef53
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xf0b0
movl -0x34(%rbp), %eax
cmpl -0x38(%rbp), %eax
jge 0xef63
movl -0x38(%rbp), %eax
movl %eax, -0x3c(%rbp)
jmp 0xef69
movl -0x34(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x34(%rbp)
jmp 0xefda
movq -0x30(%rbp), %rax
cmpq $0x0, 0x638(%rax)
je 0xefd8
movq -0x30(%rbp), %rax
movq 0x638(%rax), %rax
movq 0x30(%rax), %rax
movq -0x30(%rbp), %rcx
movq 0x638(%rcx), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq *%rax
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x38(%rbp)
jge 0xefbc
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xf0b0
movl -0x34(%rbp), %eax
cmpl -0x38(%rbp), %eax
jge 0xefcc
movl -0x38(%rbp), %eax
movl %eax, -0x40(%rbp)
jmp 0xefd2
movl -0x34(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x34(%rbp)
jmp 0xefda
movq -0x30(%rbp), %rax
cmpl $0x1, 0xc00(%rax)
jne 0xf044
movq -0x30(%rbp), %rax
cmpq $0x0, 0xc08(%rax)
je 0xf042
movq -0x30(%rbp), %rax
movq 0xc08(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x1fe40
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x38(%rbp)
jge 0xf026
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xf0b0
movl -0x34(%rbp), %eax
cmpl -0x38(%rbp), %eax
jge 0xf036
movl -0x38(%rbp), %eax
movl %eax, -0x44(%rbp)
jmp 0xf03c
movl -0x34(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movl %eax, -0x34(%rbp)
jmp 0xf0aa
movq -0x30(%rbp), %rax
cmpq $0x0, 0xc08(%rax)
je 0xf0a8
movq -0x30(%rbp), %rax
movq 0xc08(%rax), %rax
movq 0x30(%rax), %rax
movq -0x30(%rbp), %rcx
movq 0xc08(%rcx), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq *%rax
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x38(%rbp)
jge 0xf08c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xf0b0
movl -0x34(%rbp), %eax
cmpl -0x38(%rbp), %eax
jge 0xf09c
movl -0x38(%rbp), %eax
movl %eax, -0x48(%rbp)
jmp 0xf0a2
movl -0x34(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
movl %eax, -0x34(%rbp)
jmp 0xf0aa
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)