LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/channel_tcp.c
// Function: fdset
static sock_t fdset(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;
	sock_t maxfd = 0, fd;
	dllist_foreach(&c->reqs, cur, nxt, tcpreq_t, req, entry) {
		if (!req->is_closing) {
			fd = req_fdset(ctx, req, readset, writeset, errorset);
			maxfd = MAX(maxfd, fd);
		}
	}
	return maxfd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x44(%rbp)
movq -0x28(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
xorl %eax, %eax
movq %rax, %rcx
addq $0x30, %rcx
subq %rcx, %rax
addq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
movq -0x28(%rbp), %rcx
addq $0x58, %rcx
cmpq %rcx, %rax
sete %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x161dc
jmp 0x1624c
movq -0x40(%rbp), %rax
cmpl $0x0, 0x58(%rax)
jne 0x1621e
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
callq 0x17bf0
movl %eax, -0x48(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x48(%rbp), %eax
jge 0x16212
movl -0x48(%rbp), %eax
movl %eax, -0x4c(%rbp)
jmp 0x16218
movl -0x44(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movl %eax, -0x44(%rbp)
jmp 0x16220
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
xorl %eax, %eax
movq %rax, %rcx
addq $0x30, %rcx
subq %rcx, %rax
addq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x161c2
movl -0x44(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/channel_tcp.c
// Function: destroy
static void destroy(channel_t* ctx)
{
	channel_tcp_t* c = (channel_tcp_t*)ctx;
	dlitem_t* cur, * nxt;
	tcpreq_t* req;
	dllist_foreach(&c->reqs, cur, nxt,
		tcpreq_t, req, entry) {
		dllist_remove(&req->entry);
		if (req->callback)
			req->callback(ctx, -1, NULL, FALSE, FALSE, req->cb_state);
		req_destroy(req);
	}
	free(ctx);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
xorl %eax, %eax
movq %rax, %rcx
addq $0x30, %rcx
subq %rcx, %rax
addq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
addq $0x58, %rcx
cmpq %rcx, %rax
sete %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x1657c
jmp 0x1660a
jmp 0x1657e
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rcx
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rcx
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x165d5
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rcx
movq 0x28(%rcx), %r9
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
movl %ecx, %edx
xorl %r8d, %r8d
movl %r8d, %ecx
callq *%rax
movq -0x28(%rbp), %rdi
callq 0x15bd0
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
xorl %eax, %eax
movq %rax, %rcx
addq $0x30, %rcx
subq %rcx, %rax
addq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x1655f
movq -0x8(%rbp), %rdi
callq 0x3460
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/channel_tcp.c
// Function: proxy_handshake
static int proxy_handshake(channel_tcp_t *ctx, tcpreq_t *req, reqconn_t *conn)
{
	const proxy_t *proxy = ctx->proxies + conn->proxy_index;

	switch (proxy->proxy_type) {
		case SOCKS5_PROXY:
			return socks5_handshake(ctx, req, conn);
		case HTTP_PROXY:
			return hp_handshake(ctx, req, conn);
		default:
			loge("unsupport proxy type");
			return -1;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rcx
movslq 0x6c(%rcx), %rcx
imulq $0xf8, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
testl %eax, %eax
je 0x16b6b
jmp 0x16b61
movl -0x2c(%rbp), %eax
subl $0x1, %eax
je 0x16b81
jmp 0x16b97
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x16be0
movl %eax, -0x4(%rbp)
jmp 0x16bd4
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x17230
movl %eax, -0x4(%rbp)
jmp 0x16bd4
jmp 0x16b99
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x16bcb
movl $0x3, %edi
leaq 0x1fc7f(%rip), %rsi     # 0x36830
leaq 0x20bdb(%rip), %rdx     # 0x37793
movl $0x2d6, %ecx            # imm = 0x2D6
leaq 0x1fd76(%rip), %r8      # 0x3693a
movb $0x0, %al
callq 0x243b0
jmp 0x16bcd
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/channel_tcp.c
// Function: req_recv
static int req_recv(tcpreq_t* req, reqconn_t *conn)
{
	stream_t* s = &conn->conn.rs;
	char* buffer;
	int buflen, nread;

	if (stream_set_cap(s, NS_PAYLOAD_SIZE + 2)) {
		return -1;
	}

	buffer = s->array + s->size;
	buflen = s->cap - s->size;

	nread = tcp_recv(conn->conn.sock, buffer, buflen);

	if (nread == -1)
		return -1;

	if (nread == 0)
		return 0;

	s->size += nread;

	logv("recv %d bytes - %s\n",
			nread, get_sockaddrname(req->ctx->upstreams + conn->upstream));

	if (parse_recv(req, conn)) {
		return -1;
	}

	return nread;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movl $0x402, %esi            # imm = 0x402
callq 0x2d900
cmpl $0x0, %eax
je 0x186ab
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x187a1
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movslq 0x8(%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movl 0x10(%rax), %eax
movq -0x20(%rbp), %rcx
subl 0x8(%rcx), %eax
movl %eax, -0x2c(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %edi
movq -0x28(%rbp), %rsi
movl -0x2c(%rbp), %edx
callq 0x26730
movl %eax, -0x30(%rbp)
cmpl $-0x1, -0x30(%rbp)
jne 0x186f9
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x187a1
cmpl $0x0, -0x30(%rbp)
jne 0x1870b
movl $0x0, -0x4(%rbp)
jmp 0x187a1
movl -0x30(%rbp), %ecx
movq -0x20(%rbp), %rax
addl 0x8(%rax), %ecx
movl %ecx, 0x8(%rax)
movb $0x0, %al
callq 0x242d0
cmpl $0x8, (%rax)
jl 0x1877e
movl -0x30(%rbp), %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rdi
addq $0x70, %rdi
movq -0x18(%rbp), %rax
movslq 0x90(%rax), %rax
imulq $0x88, %rax, %rax
addq %rax, %rdi
callq 0x17bd0
movl -0x34(%rbp), %r9d
movl $0x8, %edi
leaq 0x1e0d0(%rip), %rsi     # 0x36830
leaq 0x1e3f8(%rip), %rdx     # 0x36b5f
movl $0x11b, %ecx            # imm = 0x11B
leaq 0x1e3f5(%rip), %r8      # 0x36b68
movq %rax, (%rsp)
movb $0x0, %al
callq 0x243b0
jmp 0x18780
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x187b0
cmpl $0x0, %eax
je 0x1879b
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x187a1
movl -0x30(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/channel_tcp.c
// Function: parse_recv
static int parse_recv(tcpreq_t* req, reqconn_t *conn)
{
	stream_t* s = &conn->conn.rs;
	int msglen, left;

	while ((left = stream_rsize(s)) >= 2) {
		msglen = stream_geti(s, s->pos, 2);
		if (msglen > NS_PAYLOAD_SIZE) {
			loge("too large dns-message (msglen=0x%.4x)\n", msglen);
			return -1;
		}
		else if (left >= (msglen + 2)) {
			if (parse_result(req, s->array + s->pos + 2, msglen, conn)) {
				return -1;
			}
			else {
				s->pos += (msglen + 2);
			}
		}
		else {
			break;
		}
	}

	if (s->pos > 0) {
		if (stream_quake(s)) {
			loge("stream_quake() failed\n");
			return -1;
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x20(%rbp), %rcx
subl 0xc(%rcx), %eax
movl %eax, -0x28(%rbp)
cmpl $0x2, %eax
jl 0x188a9
movq -0x20(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0xc(%rax), %esi
movl $0x2, %edx
callq 0x2dee0
movl %eax, -0x24(%rbp)
cmpl $0x400, -0x24(%rbp)     # imm = 0x400
jle 0x1884d
jmp 0x18809
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x1883f
movl -0x24(%rbp), %r9d
movl $0x3, %edi
leaq 0x1e00b(%rip), %rsi     # 0x36830
leaq 0x1e350(%rip), %rdx     # 0x36b7c
movl $0xe9, %ecx
leaq 0x1e34f(%rip), %r8      # 0x36b87
movb $0x0, %al
callq 0x243b0
jmp 0x18841
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x18909
movl -0x28(%rbp), %eax
movl -0x24(%rbp), %ecx
addl $0x2, %ecx
cmpl %ecx, %eax
jl 0x188a0
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rsi
movq -0x20(%rbp), %rax
movslq 0xc(%rax), %rax
addq %rax, %rsi
addq $0x2, %rsi
movl -0x24(%rbp), %edx
movq -0x18(%rbp), %rcx
callq 0x18920
cmpl $0x0, %eax
je 0x1888e
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x18909
movl -0x24(%rbp), %ecx
addl $0x2, %ecx
movq -0x20(%rbp), %rax
addl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
jmp 0x188a2
jmp 0x188a9
jmp 0x188a4
jmp 0x187cc
movq -0x20(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jle 0x18902
movq -0x20(%rbp), %rdi
callq 0x2d870
cmpl $0x0, %eax
je 0x18900
jmp 0x188c3
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x188f5
movl $0x3, %edi
leaq 0x1df55(%rip), %rsi     # 0x36830
leaq 0x1e29a(%rip), %rdx     # 0x36b7c
movl $0xfb, %ecx
leaq 0x1e2c0(%rip), %r8      # 0x36bae
movb $0x0, %al
callq 0x243b0
jmp 0x188f7
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x18909
jmp 0x18902
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/channel_tcp.c
// Function: req_close
static void req_close(tcpreq_t* req)
{
	dlitem_t *cur, *nxt;
	reqconn_t *conn;
	dllist_foreach(&req->conns, cur, nxt,
		reqconn_t, conn, conn.entry) {
		conn->conn.status = cs_closing;
		if (conn->conn.sock) {
			shutdown(conn->conn.sock, SHUT_RDWR);
		}
	}
	req->is_closing = TRUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
xorl %eax, %eax
movq %rax, %rcx
addq $0x40, %rcx
subq %rcx, %rax
addq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
addq $0x48, %rcx
cmpq %rcx, %rax
sete %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x18bd1
jmp 0x18c20
movq -0x20(%rbp), %rax
movl $0x3, 0x38(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x18bf5
movq -0x20(%rbp), %rax
movl (%rax), %edi
movl $0x2, %esi
callq 0x34e0
jmp 0x18bf7
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
xorl %eax, %eax
movq %rax, %rcx
addq $0x40, %rcx
subq %rcx, %rax
addq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x18bb7
movq -0x8(%rbp), %rax
movl $0x1, 0x58(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
callq 0x18dc0
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x18c93
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x18daa
jmp 0x18c95
movq -0x40(%rbp), %rcx
addq $0x58, %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x40(%rbp), %rax
movq 0x60(%rax), %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x48(%rbp), %rcx
addq $0x30, %rcx
movq -0x40(%rbp), %rax
movq 0x60(%rax), %rax
movq %rcx, (%rax)
movq -0x48(%rbp), %rcx
addq $0x30, %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x40(%rbp), %rdi
addq $0x68, %rdi
movq -0x48(%rbp), %rsi
addq $0x40, %rsi
callq 0x3790
movq -0x40(%rbp), %rax
movl 0x78(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x78(%rax)
movq -0x48(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x18f00
cmpl $0x0, %eax
je 0x18da3
jmp 0x18d12
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x18d44
movl $0x3, %edi
leaq 0x1dec9(%rip), %rsi     # 0x36bf3
leaq 0x1ded4(%rip), %rdx     # 0x36c05
movl $0x166, %ecx            # imm = 0x166
leaq 0x1deda(%rip), %r8      # 0x36c17
movb $0x0, %al
callq 0x243b0
jmp 0x18d46
jmp 0x18d48
movq -0x48(%rbp), %rax
movq 0x30(%rax), %rcx
movq -0x48(%rbp), %rax
movq 0x38(%rax), %rax
movq %rcx, (%rax)
movq -0x48(%rbp), %rax
movq 0x38(%rax), %rcx
movq -0x48(%rbp), %rax
movq 0x30(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x40(%rbp), %rdi
addq $0x68, %rdi
movq -0x48(%rbp), %rsi
addq $0x40, %rsi
callq 0x3b90
movq -0x40(%rbp), %rax
movl 0x78(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x78(%rax)
movq -0x48(%rbp), %rdi
callq 0x19260
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x18daa
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/channel_udp.c
// Function: req_new
static udpreq_t* req_new(
	channel_udp_t* ctx,
	const ns_msg_t* msg,
	channel_query_cb callback, void* state)
{
	udpreq_t* req;

	req = (udpreq_t*)malloc(sizeof(udpreq_t));
	if (!req) {
		loge("alloc\n");
		return NULL;
	}

	memset(req, 0, sizeof(udpreq_t));

	req->req_id = new_req_id(ctx);
	req->id = msg->id;
	req->flags = msg->flags;
	req->qr = msg->qrs[0];
	req->qr.qname = strdup(msg->qrs[0].qname);
	req->callback = callback;
	req->cb_state = state;
	req->rbn.key = &req->req_id;
	req->ctx = ctx;

	update_expire(req);

	return req;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl $0x70, %edi
callq 0x34d0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x18e30
jmp 0x18def
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x18e21
movl $0x3, %edi
leaq 0x1ddec(%rip), %rsi     # 0x36bf3
leaq 0x1d467(%rip), %rdx     # 0x36275
movl $0x44, %ecx
leaq 0x1e07d(%rip), %r8      # 0x36e97
movb $0x0, %al
callq 0x243b0
jmp 0x18e23
movq $0x0, -0x8(%rbp)
jmp 0x18ee9
movq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x70, %edx
callq 0x3200
movq -0x10(%rbp), %rdi
callq 0x19d10
movw %ax, %cx
movq -0x30(%rbp), %rax
movw %cx, (%rax)
movq -0x18(%rbp), %rax
movw (%rax), %cx
movq -0x30(%rbp), %rax
movw %cx, 0x2(%rax)
movq -0x18(%rbp), %rax
movw 0x2(%rax), %cx
movq -0x30(%rbp), %rax
movw %cx, 0x4(%rax)
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq (%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rdi
callq 0x3620
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x30(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x10(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x68(%rax)
movq -0x30(%rbp), %rdi
callq 0x19d70
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/channel_udp.c
// Function: fdset
static sock_t fdset(channel_t* ctx,
	fd_set* readset, fd_set* writeset, fd_set* errorset)
{
	channel_udp_t* c = (channel_udp_t*)ctx;
	sock_t maxfd = 0;
	int i;
	for (i = 0; i < c->upstream_num; i++) {
		FD_SET(c->upstreams[i].sock, readset);
		FD_SET(c->upstreams[i].sock, errorset);
		maxfd = MAX(maxfd, c->upstreams[i].sock);
	}
	return maxfd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x500(%rcx), %eax
jge 0x19ad0
movq -0x28(%rbp), %rax
addq $0x80, %rax
movslq -0x30(%rbp), %rcx
imulq $0x90, %rcx, %rcx
addq %rcx, %rax
movl 0x88(%rax), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movl %edx, %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rax
addq $0x80, %rax
movslq -0x30(%rbp), %rcx
imulq $0x90, %rcx, %rcx
addq %rcx, %rax
movl 0x88(%rax), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movq -0x50(%rbp), %rdx
movl %eax, %ecx
movq -0x48(%rbp), %rax
movslq %ecx, %rcx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movq -0x28(%rbp), %rax
addq $0x80, %rax
movslq -0x30(%rbp), %rcx
imulq $0x90, %rcx, %rcx
addq %rcx, %rax
movl 0x88(%rax), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movl %edx, %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
addq $0x80, %rax
movslq -0x30(%rbp), %rcx
imulq $0x90, %rcx, %rcx
addq %rcx, %rax
movl 0x88(%rax), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movq -0x40(%rbp), %rdx
movl %eax, %ecx
movq -0x38(%rbp), %rax
movslq %ecx, %rcx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movl -0x2c(%rbp), %eax
movq -0x28(%rbp), %rcx
addq $0x80, %rcx
movslq -0x30(%rbp), %rdx
imulq $0x90, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x88(%rcx), %eax
jge 0x19ab6
movq -0x28(%rbp), %rax
addq $0x80, %rax
movslq -0x30(%rbp), %rcx
imulq $0x90, %rcx, %rcx
addq %rcx, %rax
movl 0x88(%rax), %eax
movl %eax, -0x54(%rbp)
jmp 0x19abc
movl -0x2c(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x1996a
movl -0x2c(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/channel_udp.c
// Function: step
static int step(channel_t* ctx,
	fd_set* readset, fd_set* writeset, fd_set* errorset)
{
	channel_udp_t* c = (channel_udp_t*)ctx;
	int i,r;
	for (i = 0; i < c->upstream_num; i++) {
		r = upstream_step(ctx, readset, writeset, errorset, i);
		if (r) {
			return r;
		}
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %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)
movl -0x34(%rbp), %eax
movq -0x30(%rbp), %rcx
cmpl 0x500(%rcx), %eax
jge 0x19b4d
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movl -0x34(%rbp), %r8d
callq 0x19db0
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x38(%rbp)
je 0x19b40
movl -0x38(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x19b54
jmp 0x19b42
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x19b07
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/channel_udp.c
// Function: destroy
static void destroy(channel_t* ctx)
{
	channel_udp_t* c = (channel_udp_t*)ctx;
	dlitem_t* cur, * nxt;
	udpreq_t* req;
	dllist_foreach(&c->reqs, cur, nxt,
		udpreq_t, req, entry) {
		dllist_remove(&req->entry);
		if (req->callback) {
			req->callback(ctx, -1, NULL, FALSE, FALSE, req->cb_state);
			req->callback = NULL;
		}
		req_destroy(req);
	}
	if (c->upstream_num > 0) {
		int i;
		for (i = 0; i < c->upstream_num; i++) {
			close(c->upstreams[i].sock);
		}
	}
	free(ctx);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
xorl %eax, %eax
movq %rax, %rcx
addq $0x30, %rcx
subq %rcx, %rax
addq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
addq $0x58, %rcx
cmpq %rcx, %rax
sete %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x19c0c
jmp 0x19ca6
jmp 0x19c0e
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rcx
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rcx
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x19c71
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rcx
movq 0x28(%rcx), %r9
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
movl %ecx, %edx
xorl %r8d, %r8d
movl %r8d, %ecx
callq *%rax
movq -0x28(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x28(%rbp), %rdi
callq 0x19260
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
xorl %eax, %eax
movq %rax, %rcx
addq $0x30, %rcx
subq %rcx, %rax
addq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x19bef
movq -0x10(%rbp), %rax
cmpl $0x0, 0x500(%rax)
jle 0x19cf9
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x500(%rcx), %eax
jge 0x19cf7
movq -0x10(%rbp), %rax
addq $0x80, %rax
movslq -0x2c(%rbp), %rcx
imulq $0x90, %rcx, %rcx
addq %rcx, %rax
movl 0x88(%rax), %edi
callq 0x3680
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x19cba
jmp 0x19cf9
movq -0x8(%rbp), %rdi
callq 0x3460
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/channel_udp.c
// Function: new_req_id
static uint16_t new_req_id(channel_udp_t* ctx)
{
	uint16_t newid;

	do {
		newid = (uint16_t)(rand() % 0x7FFF);
	} while (newid == 0 || rbtree_lookup(&ctx->reqdic, &newid));

	return newid;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
callq 0x3100
movl $0x7fff, %ecx           # imm = 0x7FFF
cltd
idivl %ecx
movw %dx, %ax
movw %ax, -0xa(%rbp)
movzwl -0xa(%rbp), %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0xb(%rbp)
je 0x19d59
movq -0x8(%rbp), %rdi
addq $0x68, %rdi
leaq -0xa(%rbp), %rsi
callq 0x3b10
cmpq $0x0, %rax
setne %al
movb %al, -0xb(%rbp)
movb -0xb(%rbp), %al
testb $0x1, %al
jne 0x19d1c
movw -0xa(%rbp), %ax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/channel_udp.c
// Function: check_expire
static int check_expire(channel_udp_t* c)
{
	dlitem_t* cur, * nxt;
	udpreq_t* req;
	time_t now = time(NULL);

	dllist_foreach(&c->reqs, cur, nxt,
		udpreq_t, req, entry) {
		if (is_expired(req, now)) {

			dllist_remove(&req->entry);
			rbtree_remove(&c->reqdic, &req->rbn);
			c->req_count--;

			loge("timeout - %s\n", qr_key(&req->qr));

			if (req->callback) {
				req->callback((channel_t*)c, -1, NULL, FALSE, FALSE, req->cb_state);
				req->callback = NULL;
			}

			req_destroy(req);
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
xorl %eax, %eax
movl %eax, %edi
callq 0x3330
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
xorl %eax, %eax
movq %rax, %rcx
addq $0x30, %rcx
subq %rcx, %rax
addq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
addq $0x58, %rcx
cmpq %rcx, %rax
sete %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x1a3a1
jmp 0x1a4b9
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x1a520
cmpl $0x0, %eax
je 0x1a48b
jmp 0x1a3b9
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rcx
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rcx
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rdi
addq $0x68, %rdi
movq -0x20(%rbp), %rsi
addq $0x40, %rsi
callq 0x3b90
movq -0x8(%rbp), %rax
movl 0x78(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x78(%rax)
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x1a444
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
callq 0x27950
movq %rax, %r9
movl $0x3, %edi
leaq 0x1c7c9(%rip), %rsi     # 0x36bf3
leaq 0x1bb18(%rip), %rdx     # 0x35f49
movl $0x100, %ecx            # imm = 0x100
leaq 0x1bb1f(%rip), %r8      # 0x35f5c
movb $0x0, %al
callq 0x243b0
jmp 0x1a446
movq -0x20(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x1a482
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rcx
movq 0x28(%rcx), %r9
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
movl %ecx, %edx
xorl %r8d, %r8d
movl %r8d, %ecx
callq *%rax
movq -0x20(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x20(%rbp), %rdi
callq 0x19260
jmp 0x1a48d
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
xorl %eax, %eax
movq %rax, %rcx
addq $0x30, %rcx
subq %rcx, %rax
addq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x1a384
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/channel_hosts.c
// Function: hosts_item_new
static hosts_item_t *hosts_item_new(const char *key, const void *ip, int family)
{
	hosts_item_t *item;

	item = (hosts_item_t*)malloc(sizeof(hosts_item_t));
	if (!item) {
		loge("alloc\n");
		return NULL;
	}

	memset(item, 0, sizeof(hosts_item_t));

	item->domain = strdup(key);
	item->node.key = item->domain;

	if (ip && family) {
		item->iplist = ipnode_new(ip, family);
		if (!item->iplist) {
			free(item->domain);
			free(item);
			return NULL;
		}
	}

	return item;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl $0x38, %edi
callq 0x34d0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x1a80b
jmp 0x1a7ca
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x1a7fc
movl $0x3, %edi
leaq 0x1c518(%rip), %rsi     # 0x36cfa
leaq 0x1c57e(%rip), %rdx     # 0x36d67
movl $0x4a, %ecx
leaq 0x1c6a2(%rip), %r8      # 0x36e97
movb $0x0, %al
callq 0x243b0
jmp 0x1a7fe
movq $0x0, -0x8(%rbp)
jmp 0x1a895
movq -0x28(%rbp), %rdi
xorl %esi, %esi
movl $0x38, %edx
callq 0x3200
movq -0x10(%rbp), %rdi
callq 0x3620
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movq (%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
cmpq $0x0, -0x18(%rbp)
je 0x1a88d
cmpl $0x0, -0x1c(%rbp)
je 0x1a88d
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x1a8a0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x1a88b
movq -0x28(%rbp), %rax
movq (%rax), %rdi
callq 0x3460
movq -0x28(%rbp), %rdi
callq 0x3460
movq $0x0, -0x8(%rbp)
jmp 0x1a895
jmp 0x1a88d
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/channel_hosts.c
// Function: ipnode_new
static ipnode_t *ipnode_new(const void *ip, int family)
{
	ipnode_t *ipnode;

	ipnode = (ipnode_t*)malloc(sizeof(ipnode_t));
	if (!ipnode) {
		loge("alloc\n");
		return NULL;
	}

	memset(ipnode, 0, sizeof(ipnode_t));

	ipnode->family = family;

	if (family == AF_INET) {
		memcpy(&ipnode->ip4, ip, sizeof(struct in_addr));
	}
	else if (family == AF_INET6) {
		memcpy(&ipnode->ip6, ip, sizeof(struct in6_addr));
	}
	else if (family != 0) {
		loge("unknown \"family\" %d\n", family);
		free(ipnode);
		return NULL;
	}

	return ipnode;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl $0x20, %edi
callq 0x34d0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x1a907
jmp 0x1a8c6
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x1a8f8
movl $0x3, %edi
leaq 0x1c41c(%rip), %rsi     # 0x36cfa
leaq 0x1c491(%rip), %rdx     # 0x36d76
movl $0x2d, %ecx
leaq 0x1c5a6(%rip), %r8      # 0x36e97
movb $0x0, %al
callq 0x243b0
jmp 0x1a8fa
movq $0x0, -0x8(%rbp)
jmp 0x1a9b3
movq -0x20(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x3200
movl -0x14(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
cmpl $0x2, -0x14(%rbp)
jne 0x1a935
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
movl %ecx, 0x4(%rax)
jmp 0x1a9ab
cmpl $0xa, -0x14(%rbp)
jne 0x1a954
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, 0x4(%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0xc(%rax)
jmp 0x1a9a9
cmpl $0x0, -0x14(%rbp)
je 0x1a9a7
jmp 0x1a95c
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x1a992
movl -0x14(%rbp), %r9d
movl $0x3, %edi
leaq 0x1c382(%rip), %rsi     # 0x36cfa
leaq 0x1c3f7(%rip), %rdx     # 0x36d76
movl $0x3c, %ecx
leaq 0x1c3f6(%rip), %r8      # 0x36d81
movb $0x0, %al
callq 0x243b0
jmp 0x1a994
movq -0x20(%rbp), %rdi
callq 0x3460
movq $0x0, -0x8(%rbp)
jmp 0x1a9b3
jmp 0x1a9a9
jmp 0x1a9ab
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/channel_hosts.c
// Function: destroy
static void destroy(channel_t *ctx)
{
	hosts_t *c = (hosts_t*)ctx;
	rbtree_clear(&c->dic, hosts_item_rbfree, NULL);
	rbtree_init(&c->dic, rbkeycmp);
	free(ctx);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
addq $0x58, %rdi
leaq 0x9d(%rip), %rsi        # 0x1b130
xorl %eax, %eax
movl %eax, %edx
callq 0x45a0
movq -0x10(%rbp), %rax
movq $0x0, 0x58(%rax)
movq -0x10(%rbp), %rax
leaq -0x533(%rip), %rcx      # 0x1ab80
movq %rcx, 0x60(%rax)
movq -0x8(%rbp), %rdi
callq 0x3460
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/channel_hosts.c
// Function: parse_args_callback
static int parse_args_callback(char *name, char *value, void *state)
{
	channel_t *ctx = state;

	if (strcmp(name, "hosts") == 0) {
		if (hosts_parse_files(ctx, value)) {
			return -1;
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x1aadd(%rip), %rsi     # 0x35bd4
callq 0x3500
cmpl $0x0, %eax
jne 0x1b11e
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1b1d0
cmpl $0x0, %eax
je 0x1b11c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1b125
jmp 0x1b11e
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/channel_hosts.c
// Function: hosts_item_destroy
static void hosts_item_destroy(hosts_item_t *item)
{
	ipnode_t *curr, *next;

	if (item) {
		for (curr = item->iplist; curr; curr = next) {
			next = curr->next;
			free(curr);
		}
		free(item->domain);
		free(item);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x1b1ca
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x1b1b5
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3460
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x1b18f
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x3460
movq -0x8(%rbp), %rdi
callq 0x3460
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/channel_hosts.c
// Function: hosts_parse_files
static int hosts_parse_files(channel_t *ctx, const char *filenames)
{
	char *s, *p, *saveptr = NULL;

	s = strdup(filenames);

	for (p = strtok_r(s, ",", &saveptr);
		p && *p;
		p = strtok_r(NULL, ",", &saveptr)) {

		if (hosts_parse_file(ctx, p)) {
			free(s);
			return -1;
		}
	}

	free(s);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3620
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
leaq 0x1ac6e(%rip), %rsi     # 0x35e6e
leaq -0x30(%rbp), %rdx
callq 0x3610
movq %rax, -0x28(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x28(%rbp)
movb %al, -0x31(%rbp)
je 0x1b229
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x1b232
jmp 0x1b272
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x1b290
cmpl $0x0, %eax
je 0x1b256
movq -0x20(%rbp), %rdi
callq 0x3460
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1b282
jmp 0x1b258
xorl %eax, %eax
movl %eax, %edi
leaq 0x1ac0b(%rip), %rsi     # 0x35e6e
leaq -0x30(%rbp), %rdx
callq 0x3610
movq %rax, -0x28(%rbp)
jmp 0x1b20d
movq -0x20(%rbp), %rdi
callq 0x3460
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/channel_hosts.c
// Function: strspace
static char *strspace(char *s)
{
	while (*s) {
		if (*s == ' ' || *s == '\t') {
			return s;
		}
		++s;
	}

	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0x1b731
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
je 0x1b719
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x9, %eax
jne 0x1b723
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1b739
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x1b6f8
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/chnroute.c
// Function: chnroute_test4
int chnroute_test4(chnroute_ctx ctx, struct in_addr* ip)
{
	net_list_t* netlist = ctx;
	int l = 0, r;
	int m, cmp;
	net_mask_t ip_net;
	net_mask_t* find;

	if (netlist == NULL || ip == NULL || netlist->entries == 0)
		return FALSE;

	r = netlist->entries - 1;

	ip_net.net = ntohl(ip->s_addr);
	while (l != r) {
		m = (l + r) / 2;
		cmp = cmp_net_mask(&ip_net, &netlist->nets[m]);
		if (cmp < 0) {
			if (r != m)
				r = m;
			else
				break;
		}
		else {
			if (l != m)
				l = m;
			else
				break;
		}
	}
	find = &netlist->nets[l];
	if ((ip_net.net & find->mask) != find->net) {
		return FALSE;
	}
	return TRUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x1b776
cmpq $0x0, -0x18(%rbp)
je 0x1b776
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x1b782
movl $0x0, -0x4(%rbp)
jmp 0x1b83d
movq -0x20(%rbp), %rax
movl (%rax), %eax
subl $0x1, %eax
movl %eax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %edi
callq 0x3490
movl %eax, -0x38(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x28(%rbp), %eax
je 0x1b804
movl -0x24(%rbp), %eax
addl -0x28(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
movslq -0x2c(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
leaq -0x38(%rbp), %rdi
callq 0x1b850
movl %eax, -0x30(%rbp)
cmpl $0x0, -0x30(%rbp)
jge 0x1b7ee
movl -0x28(%rbp), %eax
cmpl -0x2c(%rbp), %eax
je 0x1b7ea
movl -0x2c(%rbp), %eax
movl %eax, -0x28(%rbp)
jmp 0x1b7ec
jmp 0x1b804
jmp 0x1b802
movl -0x24(%rbp), %eax
cmpl -0x2c(%rbp), %eax
je 0x1b7fe
movl -0x2c(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0x1b800
jmp 0x1b804
jmp 0x1b802
jmp 0x1b79c
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movl -0x38(%rbp), %eax
movq -0x40(%rbp), %rcx
andl 0x4(%rcx), %eax
movq -0x40(%rbp), %rcx
cmpl (%rcx), %eax
je 0x1b836
movl $0x0, -0x4(%rbp)
jmp 0x1b83d
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/chnroute.c
// Function: cmp_net_mask
static int cmp_net_mask(const void* a, const void* b)
{
	uint32_t x, y;
	x = ((net_mask_t*)a)->net;
	y = ((net_mask_t*)b)->net;
	if (x < y) return -1;
	else if (x > y) return 1;
	else return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x20(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jae 0x1b87f
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1b897
movl -0x1c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jbe 0x1b890
movl $0x1, -0x4(%rbp)
jmp 0x1b897
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/chnroute.c
// Function: chnroute_test6
int chnroute_test6(chnroute_ctx ctx, struct in6_addr* ip)
{
	net_list_t* netlist = ctx;
	int l = 0, r;
	int m, cmp;
	int i;
	net_mask6_t ip_net;
	net_mask6_t* find;

	if (netlist == NULL || ip == NULL || netlist->entries6 == 0)
		return FALSE;

	r = netlist->entries6 - 1;

	memcpy(ip_net.net, ip->s6_addr, 16);
	for (i = 0; i < 4; i++) {
		ip_net.net[i] = ntohl(ip_net.net[i]);
	}
	while (l != r) {
		m = (l + r) / 2;
		cmp = cmp_net_mask6(&ip_net, &netlist->nets6[m]);
		if (cmp < 0) {
			if (r != m)
				r = m;
			else
				break;
		}
		else {
			if (l != m)
				l = m;
			else
				break;
		}
	}
	find = &netlist->nets6[l];
	for (i = 0; i < 4; i++) {
		if ((ip_net.net[i] & find->mask[i]) != find->net[i]) {
			return FALSE;
		}
	}
	return TRUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x1b8d7
cmpq $0x0, -0x18(%rbp)
je 0x1b8d7
movq -0x20(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x1b8e3
movl $0x0, -0x4(%rbp)
jmp 0x1b9fe
movq -0x20(%rbp), %rax
movl 0x10(%rax), %eax
subl $0x1, %eax
movl %eax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x54(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x4c(%rbp)
movl $0x0, -0x34(%rbp)
cmpl $0x4, -0x34(%rbp)
jge 0x1b932
movslq -0x34(%rbp), %rax
movl -0x54(%rbp,%rax,4), %edi
callq 0x3490
movl %eax, %ecx
movslq -0x34(%rbp), %rax
movl %ecx, -0x54(%rbp,%rax,4)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x1b90a
jmp 0x1b934
movl -0x24(%rbp), %eax
cmpl -0x28(%rbp), %eax
je 0x1b99c
movl -0x24(%rbp), %eax
addl -0x28(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rsi
movslq -0x2c(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rsi
leaq -0x54(%rbp), %rdi
callq 0x1ba10
movl %eax, -0x30(%rbp)
cmpl $0x0, -0x30(%rbp)
jge 0x1b986
movl -0x28(%rbp), %eax
cmpl -0x2c(%rbp), %eax
je 0x1b982
movl -0x2c(%rbp), %eax
movl %eax, -0x28(%rbp)
jmp 0x1b984
jmp 0x1b99c
jmp 0x1b99a
movl -0x24(%rbp), %eax
cmpl -0x2c(%rbp), %eax
je 0x1b996
movl -0x2c(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0x1b998
jmp 0x1b99c
jmp 0x1b99a
jmp 0x1b934
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x24(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movl $0x0, -0x34(%rbp)
cmpl $0x4, -0x34(%rbp)
jge 0x1b9f7
movslq -0x34(%rbp), %rax
movl -0x54(%rbp,%rax,4), %eax
movq -0x60(%rbp), %rcx
movslq -0x34(%rbp), %rdx
andl 0x10(%rcx,%rdx,4), %eax
movq -0x60(%rbp), %rcx
movslq -0x34(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
je 0x1b9ea
movl $0x0, -0x4(%rbp)
jmp 0x1b9fe
jmp 0x1b9ec
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x1b9ba
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/chnroute.c
// Function: cmp_net_mask6
static int cmp_net_mask6(const void* a, const void* b)
{
	const net_mask6_t* x = a;
	const net_mask6_t* y = b;
	int i;
	for (i = 0; i < 4; i++) {
		if (x->net[i] < y->net[i]) return -1;
		else if (x->net[i] > y->net[i]) return 1;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
cmpl $0x4, -0x2c(%rbp)
jge 0x1ba8a
movq -0x20(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x28(%rbp), %rcx
movslq -0x2c(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jae 0x1ba5a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1ba91
movq -0x20(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x28(%rbp), %rcx
movslq -0x2c(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jbe 0x1ba7b
movl $0x1, -0x4(%rbp)
jmp 0x1ba91
jmp 0x1ba7d
jmp 0x1ba7f
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x1ba33
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/chnroute.c
// Function: chnroute_test
int chnroute_test(chnroute_ctx ctx, struct sockaddr* addr)
{
	if (ctx == NULL || addr == NULL) {
		return FALSE;
	}
	if (addr->sa_family == AF_INET) {
		return chnroute_test4(ctx, &((struct sockaddr_in*)addr)->sin_addr);
	}
	else if (addr->sa_family == AF_INET6) {
		return chnroute_test6(ctx, &((struct sockaddr_in6*)addr)->sin6_addr);
	}
	else {
		return FALSE;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x1babe
cmpq $0x0, -0x18(%rbp)
jne 0x1bac7
movl $0x0, -0x4(%rbp)
jmp 0x1bb12
movq -0x18(%rbp), %rax
movzwl (%rax), %eax
cmpl $0x2, %eax
jne 0x1bae9
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x4, %rsi
callq 0x1b740
movl %eax, -0x4(%rbp)
jmp 0x1bb12
movq -0x18(%rbp), %rax
movzwl (%rax), %eax
cmpl $0xa, %eax
jne 0x1bb0b
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x8, %rsi
callq 0x1b8a0
movl %eax, -0x4(%rbp)
jmp 0x1bb12
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/chnroute.c
// Function: chnroute_parse
int chnroute_parse(chnroute_ctx ctx, const char* filename)
{
	char* s, * p, *saveptr = NULL;
	int r;
	chnroute_list_t list;

	memset(&list, 0, sizeof(chnroute_list_t));

	dllist_init(&list.items);

	s = strdup(filename);

	for (p = strtok_r(s, ",", &saveptr);
		p && *p;
		p = strtok_r(NULL, ",", &saveptr)) {

		if (parse_chnroute_file(&list, p)) {
			free_chnroute_list(&list.items);
			free(s);
			return -1;
		}
	}

	free(s);

	r = feedback_net_list(ctx, &list);

	free_chnroute_list(&list.items);

	return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x30(%rbp)
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x3200
leaq -0x50(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3620
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
leaq 0x1a2fe(%rip), %rsi     # 0x35e6e
leaq -0x30(%rbp), %rdx
callq 0x3610
movq %rax, -0x28(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x28(%rbp)
movb %al, -0x51(%rbp)
je 0x1bb99
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x51(%rbp)
movb -0x51(%rbp), %al
testb $0x1, %al
jne 0x1bba2
jmp 0x1bbeb
movq -0x28(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x1bc20
cmpl $0x0, %eax
je 0x1bbcf
leaq -0x50(%rbp), %rdi
callq 0x1bfb0
movq -0x20(%rbp), %rdi
callq 0x3460
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1bc13
jmp 0x1bbd1
xorl %eax, %eax
movl %eax, %edi
leaq 0x1a292(%rip), %rsi     # 0x35e6e
leaq -0x30(%rbp), %rdx
callq 0x3610
movq %rax, -0x28(%rbp)
jmp 0x1bb7d
movq -0x20(%rbp), %rdi
callq 0x3460
movq -0x10(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x1c020
movl %eax, -0x34(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x1bfb0
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/chnroute.c
// Function: chnroute_create
chnroute_ctx chnroute_create()
{
	net_list_t* netlist = (net_list_t*)malloc(sizeof(net_list_t));
	if (!netlist)
		return NULL;
	memset(netlist, 0, sizeof(net_list_t));
	return netlist;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x20, %edi
callq 0x34d0
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x1c277
movq $0x0, -0x8(%rbp)
jmp 0x1c28f
movq -0x10(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x3200
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/chnroute.c
// Function: chnroute_free
void chnroute_free(chnroute_ctx ctx)
{
	if (ctx) {
		net_list_t* netlist = ctx;
		free(netlist->nets);
		free(netlist->nets6);
		free(netlist);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x1c2de
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3460
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x3460
movq -0x10(%rbp), %rdi
callq 0x3460
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/chnroute.c
// Function: parse_netmask
static int parse_netmask(net_mask_t* netmask, char* line)
{
	char* sp_pos;
	struct in_addr ip;
	sp_pos = strchr(line, '/');
	if (sp_pos) {
		*sp_pos = 0;
		netmask->mask = UINT32_MAX ^ (((uint32_t)1 << (32 - atoi(sp_pos + 1))) - 1);
	}
	else {
		netmask->mask = UINT32_MAX;
	}
	if (inet_pton(AF_INET, line, &ip) == 0) {
		if (sp_pos)* sp_pos = '/';
		loge("invalid addr: %s, errno=%d, %s\n",
			line, errno, strerror(errno));
		return -1;
	}
	netmask->net = ntohl(ip.s_addr);
	if (sp_pos)* sp_pos = '/';
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movl $0x2f, %esi
callq 0x3160
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x1c54f
movq -0x20(%rbp), %rax
movb $0x0, (%rax)
movq -0x20(%rbp), %rdi
addq $0x1, %rdi
callq 0x3580
movl $0x20, %ecx
subl %eax, %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, %ecx
subl $0x1, %ecx
xorl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
jmp 0x1c55a
movq -0x10(%rbp), %rax
movl $0xffffffff, 0x4(%rax)  # imm = 0xFFFFFFFF
movq -0x18(%rbp), %rsi
movl $0x2, %edi
leaq -0x24(%rbp), %rdx
callq 0x3640
cmpl $0x0, %eax
jne 0x1c5ed
cmpq $0x0, -0x20(%rbp)
je 0x1c57f
movq -0x20(%rbp), %rax
movb $0x2f, (%rax)
jmp 0x1c581
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x1c5e2
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
callq 0x3040
movl (%rax), %eax
movl %eax, -0x28(%rbp)
callq 0x3040
movl (%rax), %edi
callq 0x3150
movq -0x30(%rbp), %r9
movl -0x28(%rbp), %r10d
movl $0x3, %edi
leaq 0x1a89b(%rip), %rsi     # 0x36e5a
leaq 0x1a920(%rip), %rdx     # 0x36ee6
movl $0xc6, %ecx
leaq 0x1a922(%rip), %r8      # 0x36ef4
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x243b0
jmp 0x1c5e4
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1c612
movl -0x24(%rbp), %edi
callq 0x3490
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
cmpq $0x0, -0x20(%rbp)
je 0x1c60b
movq -0x20(%rbp), %rax
movb $0x2f, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)