// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/channel_hosts.c
// Function: hosts_create
int hosts_create(
	channel_t **pctx,
	const char *name,
	const char *args,
	const config_t *conf,
	const proxy_t *proxies,
	const int proxy_num,
	const chnroute_ctx chnr,
	const chnroute_ctx blacklist,
	void *data)
{
	hosts_t *ctx;

	ctx = (hosts_t*)malloc(sizeof(hosts_t));
	if (!ctx) {
		loge("alloc\n");
		return CHANNEL_ALLOC;
	}

	memset(ctx, 0, sizeof(hosts_t));

	rbtree_init(&ctx->dic, rbkeycmp);

	ctx->name = name;
	ctx->conf = conf;
	ctx->proxies = proxies;
	ctx->proxy_num = proxy_num;
	ctx->chnr = chnr;
	ctx->blacklist = blacklist;
	ctx->data = data;

	ctx->fdset = fdset;
	ctx->step = step;
	ctx->query = query;
	ctx->destroy = destroy;

	if (args) {
		if (parse_querystring(args, parse_args_callback, ctx)) {
			loge("invalid args: %s\n", args);
			return CHANNEL_WRONG_ARG;
		}
	}

	*pctx = (channel_t*)ctx;

	return CHANNEL_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movl %r9d, -0x34(%rbp)
movl $0x68, %edi
callq 0x34d0
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x1aa43
jmp 0x1aa03
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x1aa35
movl $0x3, %edi
leaq 0x1c2df(%rip), %rsi     # 0x36cfa
leaq 0x1c338(%rip), %rdx     # 0x36d5a
movl $0x1b5, %ecx            # imm = 0x1B5
leaq 0x1c469(%rip), %r8      # 0x36e97
movb $0x0, %al
callq 0x243b0
jmp 0x1aa37
movl $0x3, -0x4(%rbp)
jmp 0x1ab72
movq -0x40(%rbp), %rdi
xorl %esi, %esi
movl $0x68, %edx
callq 0x3200
movq -0x40(%rbp), %rax
movq $0x0, 0x58(%rax)
movq -0x40(%rbp), %rax
leaq 0x116(%rip), %rcx       # 0x1ab80
movq %rcx, 0x60(%rax)
movq -0x18(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0x34(%rbp), %ecx
movq -0x40(%rbp), %rax
movl %ecx, 0x18(%rax)
movq 0x10(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x20(%rax)
movq 0x18(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x28(%rax)
movq 0x20(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x40(%rbp), %rax
leaq 0xf6(%rip), %rcx        # 0x1abc0
movq %rcx, 0x30(%rax)
movq -0x40(%rbp), %rax
leaq 0x107(%rip), %rcx       # 0x1abe0
movq %rcx, 0x38(%rax)
movq -0x40(%rbp), %rax
leaq 0x118(%rip), %rcx       # 0x1ac00
movq %rcx, 0x40(%rax)
movq -0x40(%rbp), %rax
leaq 0x579(%rip), %rcx       # 0x1b070
movq %rcx, 0x48(%rax)
cmpq $0x0, -0x20(%rbp)
je 0x1ab60
movq -0x20(%rbp), %rdi
movq -0x40(%rbp), %rdx
leaq 0x5bf(%rip), %rsi       # 0x1b0d0
callq 0x2f540
cmpl $0x0, %eax
je 0x1ab5e
jmp 0x1ab1d
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x1ab53
movq -0x20(%rbp), %r9
movl $0x3, %edi
leaq 0x1c1c1(%rip), %rsi     # 0x36cfa
leaq 0x1c21a(%rip), %rdx     # 0x36d5a
movl $0x1cc, %ecx            # imm = 0x1CC
leaq 0x1b367(%rip), %r8      # 0x35eb3
movb $0x0, %al
callq 0x243b0
jmp 0x1ab55
movl $0x2, -0x4(%rbp)
jmp 0x1ab72
jmp 0x1ab60
movq -0x40(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)