LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/channel_chndoh.c
// Function: parse_subnet
static int parse_subnet(subnet_t* subnet, const char* s)
{
	if (ns_ecs_parse_subnet((struct sockaddr*)(&subnet->addr),
		&subnet->mask, s) != 0) {
		loge("Invalid subnet %s\n", s);
		return -1;
	}
	free(subnet->name);
	subnet->name = strdup(s);
	subnet->is_set = 1;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
addq $0x10, %rdi
leaq 0x90(%r14), %rsi
movq %rbx, %rdx
callq 0x1b179
testl %eax, %eax
je 0xa9b2
xorl %eax, %eax
callq 0x176e5
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x3, (%rax)
jl 0xa9d0
leaq 0x18022(%rip), %rsi     # 0x229b0
leaq 0x1a321(%rip), %rdx     # 0x24cb6
leaq 0x18279(%rip), %r8      # 0x22c15
movl $0x3, %edi
movl $0x41d, %ecx            # imm = 0x41D
movq %rbx, %r9
xorl %eax, %eax
callq 0x1771e
jmp 0xa9d0
movq 0x8(%r14), %rdi
callq 0x3450
movq %rbx, %rdi
callq 0x3610
movq %rax, 0x8(%r14)
movl $0x1, (%r14)
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/channel_chndoh.c
// Function: check_doh_server
static int check_doh_server(doh_server_t *doh)
{
	if (is_empty_sockaddr(doh->addr)) {
		loge("no \"addr\"\n");
		return -1;
	}
	if (doh->channel == CH_DOH) {
		if (!doh->host || !*doh->host) {
			loge("no \"host\"\n");
			return -1;
		}
		if (!doh->path || !*doh->path) {
			loge("no \"path\"\n");
			return -1;
		}
	}
	if (doh->timeout <= 0) {
		loge("invalid \"timeout\"\n");
		return -1;
	}
	if (doh->keep_alive < 0) {
		loge("invalid \"keep-alive\"\n");
		return -1;
	}

	/* Compatible with old configuration */
	if (doh->keep_alive == 1)
		doh->keep_alive = DEFAULT_HTTP_TIMEOUT;

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x8, %rdi
leaq 0x19c07(%rip), %rsi     # 0x245f0
movl $0x88, %edx
callq 0x33a0
testl %eax, %eax
je 0xaa6b
cmpl $0x1, 0x5b0(%r14)
jne 0xaa33
movq 0x460(%r14), %rax
testq %rax, %rax
je 0xaaa4
cmpb $0x0, (%rax)
je 0xaaa4
movq 0x468(%r14), %rax
testq %rax, %rax
je 0xab45
cmpb $0x0, (%rax)
je 0xab45
cmpl $0x0, 0x47c(%r14)
jle 0xaadd
movl 0x470(%r14), %eax
testl %eax, %eax
js 0xab13
xorl %ebx, %ebx
cmpl $0x1, %eax
jne 0xab7c
movl $0x4b0, 0x470(%r14) # imm = 0x4B0
jmp 0xab7c
xorl %eax, %eax
callq 0x176e5
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x3, (%rax)
jl 0xab7c
leaq 0x17f29(%rip), %rsi     # 0x229b0
leaq 0x1819a(%rip), %rdx     # 0x22c28
leaq 0x181a4(%rip), %r8      # 0x22c39
movl $0x3, %edi
movl $0x4d1, %ecx            # imm = 0x4D1
jmp 0xab75
xorl %eax, %eax
callq 0x176e5
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x3, (%rax)
jl 0xab7c
leaq 0x17ef0(%rip), %rsi     # 0x229b0
leaq 0x18161(%rip), %rdx     # 0x22c28
leaq 0x18176(%rip), %r8      # 0x22c44
movl $0x3, %edi
movl $0x4d6, %ecx            # imm = 0x4D6
jmp 0xab75
xorl %eax, %eax
callq 0x176e5
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x3, (%rax)
jl 0xab7c
leaq 0x17eb7(%rip), %rsi     # 0x229b0
leaq 0x18128(%rip), %rdx     # 0x22c28
leaq 0x18153(%rip), %r8      # 0x22c5a
movl $0x3, %edi
movl $0x4df, %ecx            # imm = 0x4DF
jmp 0xab75
xorl %eax, %eax
callq 0x176e5
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x3, (%rax)
jl 0xab7c
leaq 0x17e85(%rip), %rsi     # 0x229b0
leaq 0x180f6(%rip), %rdx     # 0x22c28
leaq 0x18134(%rip), %r8      # 0x22c6d
movl $0x3, %edi
movl $0x4e3, %ecx            # imm = 0x4E3
jmp 0xab75
xorl %eax, %eax
callq 0x176e5
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x3, (%rax)
jl 0xab7c
leaq 0x17e53(%rip), %rsi     # 0x229b0
leaq 0x180c4(%rip), %rdx     # 0x22c28
leaq 0x180e4(%rip), %r8      # 0x22c4f
movl $0x3, %edi
movl $0x4da, %ecx            # imm = 0x4DA
xorl %eax, %eax
callq 0x1771e
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/channel_chndoh.c
// Function: query_doh_addr
static void query_doh_addr(channel_chndoh_t* c, doh_server_t* doh)
{
	channel_req_t* req;
	ns_msg_t msg;
	ns_flags_t flags;

	doh->addr_expire = time(NULL) + 60;

	init_ns_msg(&msg);

	msg.id = 0;

	flags = ns_get_flags(&msg);
	flags.aa = 1;
	flags.ra = 1;
	ns_set_flags(&msg, &flags);

	msg.qdcount = 1;
	msg.qrs = (ns_qr_t*)malloc(sizeof(ns_qr_t));
	if (!msg.qrs) {
		return;
	}

	msg.qrs->qclass = NS_QCLASS_IN;
	msg.qrs->qtype = NS_QTYPE_A;
	msg.qrs->qname = (char*)malloc(strlen(doh->host) + 2);
	strcpy(msg.qrs->qname, doh->host);
	strcat(msg.qrs->qname, ".");

	req = myreq_new(c, &msg, query_doh_addr_cb, doh);

	ns_msg_free(&msg);

	if (!req) {
		return;
	}

	dllist_add(&c->reqs, &req->entry);
	rbtree_insert(&c->reqdic, &req->rbn);
	c->req_count++;

	if (doh_query(req)) {
		loge("doh_query() error\n");
		dllist_remove(&req->entry);
		rbtree_remove(&c->reqdic, &req->rbn);
		c->req_count--;
		myreq_destroy(req);
		return;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorl %edi, %edi
callq 0x3310
addq $0x3c, %rax
movq %rax, (%r14)
leaq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0x19496
movw $0x0, (%r12)
movq %r12, %rdi
callq 0x193ec
orl $0x120, %eax            # imm = 0x120
leaq 0xe(%rsp), %rsi
movw %ax, (%rsi)
movq %r12, %rdi
callq 0x19445
movw $0x1, 0x4(%r12)
movl $0x10, %edi
callq 0x34b0
movq %rax, 0x10(%r12)
testq %rax, %rax
je 0xad00
movq %rax, %r15
movl $0x10001, 0x8(%rax)     # imm = 0x10001
movq 0x460(%r14), %r12
movq %r12, %rdi
callq 0x3170
leaq 0x2(%rax), %rdi
callq 0x34b0
movq %rax, %r13
movq %rax, (%r15)
movq %rax, %rdi
movq %r12, %rsi
callq 0x3330
movq %r13, %rdi
callq 0x3170
movw $0x2e, (%r13,%rax)
leaq 0x1df(%rip), %rdx       # 0xae21
leaq 0x10(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rcx
callq 0xad0e
movq %rax, %r14
movq %r15, %rdi
callq 0x19ae0
testq %r14, %r14
je 0xad00
leaq 0x58(%rbx), %rax
leaq 0x28(%r14), %rcx
movq %rax, 0x28(%r14)
movq 0x60(%rbx), %rax
movq %rax, 0x30(%r14)
movq %rcx, (%rax)
movq %rcx, 0x60(%rbx)
leaq 0x68(%rbx), %r15
movq %r14, %r12
addq $0x38, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x379c
incl 0x78(%rbx)
movq %r14, %rdi
callq 0xafa0
testl %eax, %eax
je 0xad00
xorl %eax, %eax
callq 0x176e5
cmpl $0x3, (%rax)
jl 0xacdb
leaq 0x17cf4(%rip), %rsi     # 0x229b0
leaq 0x17fc0(%rip), %rdx     # 0x22c83
leaq 0x17fc8(%rip), %r8      # 0x22c92
movl $0x3, %edi
movl $0x139, %ecx            # imm = 0x139
xorl %eax, %eax
callq 0x1771e
movq 0x28(%r14), %rax
movq 0x30(%r14), %rcx
movq %rax, (%rcx)
movq %rcx, 0x8(%rax)
movq %r15, %rdi
movq %r12, %rsi
callq 0x3a34
decl 0x78(%rbx)
movq %r14, %rdi
callq 0xb0a7
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/channel_chndoh.c
// Function: myreq_new
static channel_req_t* myreq_new(
	channel_chndoh_t *ctx,
	const ns_msg_t* msg,
	channel_query_cb callback, void* cb_state)
{
	channel_req_t* req;

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

	memset(req, 0, sizeof(channel_req_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 = cb_state;
	req->rbn.key = &req->req_id;
	req->ctx = ctx;
	req->start_time = OS_GetTickCount();

	return req;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r15
movl $0x1, %edi
movl $0x88, %esi
callq 0x3240
movq %rax, %rbx
testq %rax, %rax
je 0xaddd
movq %r14, 0x10(%rsp)
leaq 0x68(%r15), %rbp
leaq 0xe(%rsp), %r14
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, 0xe(%rsp)
testw %cx, %cx
je 0xad51
movq %rbp, %rdi
movq %r14, %rsi
callq 0x39f8
testq %rax, %rax
jne 0xad51
movzwl 0xe(%rsp), %eax
movw %ax, (%rbx)
movl (%r13), %eax
movl %eax, 0x2(%rbx)
movq 0x10(%r13), %rax
movups (%rax), %xmm0
movups %xmm0, 0x8(%rbx)
movq (%rax), %rdi
callq 0x3610
movq %rax, 0x8(%rbx)
movq %r12, 0x18(%rbx)
movq 0x10(%rsp), %rax
movq %rax, 0x20(%rbx)
movq %rbx, 0x38(%rbx)
movq %r15, 0x60(%rbx)
xorl %eax, %eax
callq 0x193ab
movq %rax, 0x80(%rbx)
jmp 0xae0f
xorl %eax, %eax
callq 0x176e5
cmpl $0x3, (%rax)
jl 0xae0f
leaq 0x17bc0(%rip), %rsi     # 0x229b0
leaq 0x17eae(%rip), %rdx     # 0x22ca5
leaq 0x18ab5(%rip), %r8      # 0x238b3
movl $0x3, %edi
movl $0x78, %ecx
xorl %eax, %eax
callq 0x1771e
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/channel_chndoh.c
// Function: doh_query
static int doh_query(channel_req_t* rq)
{
	channel_chndoh_t* c = rq->ctx;
	int r = 0;

	if (c->frndoh.channel != CH_NONE) {
		r = doh_emit_query(rq, &c->frndoh);
		if (r) {
			loge("doh_emit_query() error\n");
			return -1;
		}
		rq->wait_num++;
	}

	if (c->chndoh.channel != CH_NONE) {
		r = doh_emit_query(rq, &c->chndoh);
		if (r) {
			loge("doh_emit_query() error\n");
			return -1;
		}
		rq->wait_num++;
	}

	if (rq->wait_num == 0) {
		loge("no DoH server\n");
		return -1;
	}

	return r;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x60(%rdi), %r14
cmpl $0x0, 0xc00(%r14)
je 0xb004
leaq 0x650(%r14), %rsi
movq %rbx, %rdi
callq 0xb103
testl %eax, %eax
je 0xb001
xorl %eax, %eax
callq 0x176e5
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x3, (%rax)
jl 0xb09d
leaq 0x179cc(%rip), %rsi     # 0x229b0
leaq 0x17cf4(%rip), %rdx     # 0x22cdf
leaq 0x17cf7(%rip), %r8      # 0x22ce9
movl $0x3, %edi
movl $0x3db, %ecx            # imm = 0x3DB
jmp 0xb096
incl 0x74(%rbx)
cmpl $0x0, 0x630(%r14)
je 0xb053
subq $-0x80, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0xb103
testl %eax, %eax
je 0xb058
xorl %eax, %eax
callq 0x176e5
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x3, (%rax)
jl 0xb09d
leaq 0x17977(%rip), %rsi     # 0x229b0
leaq 0x17c9f(%rip), %rdx     # 0x22cdf
leaq 0x17ca2(%rip), %r8      # 0x22ce9
movl $0x3, %edi
movl $0x3e4, %ecx            # imm = 0x3E4
jmp 0xb096
movl 0x74(%rbx), %eax
jmp 0xb060
movl 0x74(%rbx), %eax
incl %eax
movl %eax, 0x74(%rbx)
xorl %ebx, %ebx
testl %eax, %eax
jne 0xb09d
xorl %eax, %eax
callq 0x176e5
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x3, (%rax)
jl 0xb09d
leaq 0x17932(%rip), %rsi     # 0x229b0
leaq 0x17c5a(%rip), %rdx     # 0x22cdf
leaq 0x17c75(%rip), %r8      # 0x22d01
movl $0x3, %edi
movl $0x3eb, %ecx            # imm = 0x3EB
xorl %eax, %eax
callq 0x1771e
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/channel_chndoh.c
// Function: myreq_destroy
static void myreq_destroy(channel_req_t* req)
{
	int i;
	ns_msg_t* msg;
	for (i = 0; i < req->result_num; i++) {
		msg = req->results[i];
		if (msg) {
			ns_msg_free(msg);
			free(msg);
		}
	}
	free(req->results);
	free(req->qr.qname);
	free(req);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x70(%rdi), %eax
testl %eax, %eax
jle 0xb0e4
xorl %r15d, %r15d
movq 0x68(%rbx), %rcx
movq (%rcx,%r15,8), %r14
testq %r14, %r14
je 0xb0d9
movq %r14, %rdi
callq 0x19ae0
movq %r14, %rdi
callq 0x3450
movl 0x70(%rbx), %eax
incq %r15
movslq %eax, %rcx
cmpq %rcx, %r15
jl 0xb0b9
movq 0x68(%rbx), %rdi
callq 0x3450
movq 0x8(%rbx), %rdi
callq 0x3450
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x3450
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/channel_chndoh.c
// Function: get_nsmsg_flags
static int get_nsmsg_flags(channel_chndoh_t* ctx, ns_msg_t* msg)
{
	int i, rrcount, flags = 0, x = 0;
	ns_rr_t* rr;

	rrcount = msg->ancount + msg->nscount;
	for (i = 0; i < rrcount; i++) {
		rr = msg->rrs + i;
		flags |= get_rr_flags(ctx, rr, &x);
	}

	rrcount = ns_rrcount(msg);
	for (; i < rrcount; i++) {
		rr = msg->rrs + i;
		flags |= get_rr_flags(ctx, rr, &x);
	}

	return flags;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x0, (%rsp)
movzwl 0x6(%rsi), %eax
movzwl 0x8(%rsi), %edx
addl %eax, %edx
movl %edx, %r15d
je 0xbdd4
movl %edx, 0x4(%rsp)
movq %r15, %r13
shlq $0x5, %r13
xorl %r12d, %r12d
xorl %ebp, %ebp
movq 0x18(%rbx), %rsi
addq %r12, %rsi
movq %r14, %rdi
movq %rsp, %rdx
callq 0xbe1d
orl %eax, %ebp
addq $0x20, %r12
cmpq %r12, %r13
jne 0xbda7
movzwl 0x6(%rbx), %ecx
movzwl 0x8(%rbx), %eax
addl %ecx, %eax
movl 0x4(%rsp), %edx
jmp 0xbdd8
xorl %eax, %eax
xorl %ebp, %ebp
movzwl 0xa(%rbx), %ecx
addl %eax, %ecx
cmpl %ecx, %edx
jae 0xbe0c
movl %ecx, %r13d
movq %r15, %r12
shlq $0x5, %r12
movq 0x18(%rbx), %rsi
addq %r12, %rsi
movq %r14, %rdi
movq %rsp, %rdx
callq 0xbe1d
orl %eax, %ebp
incq %r15
addq $0x20, %r12
cmpq %r13, %r15
jb 0xbdec
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/channel_doh.c
// Function: step
static int step(channel_t* ctx,
	fd_set* readset, fd_set* writeset, fd_set* errorset)
{
	channel_doh_t* c = (channel_doh_t*)ctx;
	if (c->http_addr_expire < time(NULL)) {
		query_http_addr(c);
	}
	http_step(c->http, readset, writeset, errorset);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %r13
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq 0x118(%rdi), %rbx
xorl %edi, %edi
callq 0x3310
cmpq %rax, %rbx
jge 0xcbb9
movq %r13, 0x10(%rsp)
xorl %edi, %edi
callq 0x3310
addq $0x3c, %rax
movq %rax, 0x118(%r12)
leaq 0x18(%rsp), %rbp
movq %rbp, %rdi
callq 0x19496
movw $0x0, (%rbp)
movq %rbp, %rdi
callq 0x193ec
orl $0x120, %eax            # imm = 0x120
leaq 0xe(%rsp), %rsi
movw %ax, (%rsi)
movq %rbp, %rdi
callq 0x19445
movw $0x1, 0x4(%rbp)
movl $0x10, %edi
callq 0x34b0
movq %rax, 0x10(%rbp)
testq %rax, %rax
je 0xcbb4
movq %rax, %r13
movl $0x10001, 0x8(%rax)     # imm = 0x10001
movq 0x120(%r12), %rbp
movq %rbp, %rdi
callq 0x3170
leaq 0x2(%rax), %rdi
callq 0x34b0
movq %rax, %rbx
movq %rax, (%r13)
movq %rax, %rdi
movq %rbp, %rsi
callq 0x3330
movq %rbx, %rdi
callq 0x3170
movw $0x2e, (%rbx,%rax)
leaq 0x44d(%rip), %rdx       # 0xcf3b
leaq 0x18(%rsp), %rbx
movq %r12, %rdi
movq %rbx, %rsi
movq %r12, %rcx
callq 0xce36
movq %rax, %r13
movq %rbx, %rdi
callq 0x19ae0
testq %r13, %r13
je 0xcbb4
leaq 0x58(%r12), %rax
leaq 0x28(%r13), %rcx
movq %rax, 0x28(%r13)
movq 0x60(%r12), %rax
movq %rax, 0x30(%r13)
movq %rcx, (%rax)
movq %rcx, 0x60(%r12)
leaq 0x68(%r12), %rbx
movq %r13, %rbp
addq $0x38, %rbp
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x379c
incl 0x78(%r12)
movq %r13, %rdi
callq 0xd0de
testl %eax, %eax
je 0xcbb4
xorl %eax, %eax
callq 0x176e5
cmpl $0x3, (%rax)
jl 0xcb8d
leaq 0x1649b(%rip), %rsi     # 0x23009
leaq 0x16561(%rip), %rdx     # 0x230d6
leaq 0x16116(%rip), %r8      # 0x22c92
movl $0x3, %edi
movl $0xfe, %ecx
xorl %eax, %eax
callq 0x1771e
movq 0x28(%r13), %rax
movq 0x30(%r13), %rcx
movq %rax, (%rcx)
movq %rcx, 0x8(%rax)
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x3a34
decl 0x78(%r12)
movq %r13, %rdi
callq 0xd302
movq 0x10(%rsp), %r13
movq 0x80(%r12), %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r13, %rcx
callq 0x15018
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/channel_doh.c
// Function: query
static int query(channel_t* ctx,
	const ns_msg_t* msg,
	channel_query_cb callback, void* state)
{
	channel_doh_t* c = (channel_doh_t*)ctx;
	channel_req_t* req;

	if (c->req_count > MAX_QUEUE_SIZE) {
		loge("request queue is full\n");
		return -1;
	}

	req = myreq_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 (doh_query(req)) {
		loge("doh_query() error\n");
		dllist_remove(&req->entry);
		rbtree_remove(&c->reqdic, &req->rbn);
		c->req_count--;
		myreq_destroy(req);
		return -1;
	}

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
cmpl $0x7531, 0x78(%rdi)     # imm = 0x7531
jl 0xcc32
xorl %eax, %eax
callq 0x176e5
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x3, (%rax)
jl 0xcce8
leaq 0x163fb(%rip), %rsi     # 0x23009
leaq 0x160ce(%rip), %rdx     # 0x22ce3
leaq 0x163b6(%rip), %r8      # 0x22fd2
movl $0x3, %edi
movl $0x34e, %ecx            # imm = 0x34E
xorl %eax, %eax
callq 0x1771e
jmp 0xcce8
movq %rdi, %r14
callq 0xce36
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0xcce8
movq %rax, %r15
leaq 0x58(%r14), %rax
leaq 0x28(%r15), %rcx
movq %rax, 0x28(%r15)
movq 0x60(%r14), %rax
movq %rax, 0x30(%r15)
movq %rcx, (%rax)
movq %rcx, 0x60(%r14)
leaq 0x68(%r14), %r12
movq %r15, %r13
addq $0x38, %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x379c
incl 0x78(%r14)
movq %r15, %rdi
callq 0xd0de
testl %eax, %eax
je 0xcce6
xorl %eax, %eax
callq 0x176e5
cmpl $0x3, (%rax)
jl 0xccbe
leaq 0x1636a(%rip), %rsi     # 0x23009
leaq 0x1603d(%rip), %rdx     # 0x22ce3
leaq 0x15fe5(%rip), %r8      # 0x22c92
movl $0x3, %edi
movl $0x35b, %ecx            # imm = 0x35B
xorl %eax, %eax
callq 0x1771e
movq 0x28(%r15), %rax
movq 0x30(%r15), %rcx
movq %rax, (%rcx)
movq %rcx, 0x8(%rax)
movq %r12, %rdi
movq %r13, %rsi
callq 0x3a34
decl 0x78(%r14)
movq %r15, %rdi
callq 0xd302
jmp 0xcce8
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/channel_doh.c
// Function: destroy
static void destroy(channel_t* ctx)
{
	channel_doh_t* c = (channel_doh_t*)ctx;
	dlitem_t* cur, * nxt;
	channel_req_t* req;

	/* Destroy http first */
	http_destroy(c->http);

	dllist_foreach(&c->reqs, cur, nxt,
		channel_req_t, req, entry) {
		dllist_remove(&req->entry);
		if (req->callback)
			req->callback(ctx, -1, NULL, FALSE, FALSE, req->cb_state);
		myreq_destroy(req);
	}
	
	free(c->host);
	free(c->path);
	free(c->china_net.name);
	free(c->foreign_net.name);
	free(c->china_net6.name);
	free(c->foreign_net6.name);
	free(c);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x80(%rdi), %rdi
callq 0x14ea3
leaq 0x58(%rbx), %r15
movq 0x58(%rbx), %r14
cmpq %r15, %r14
je 0xcd59
movq (%r14), %r12
movq 0x8(%r14), %rax
movq %r12, (%rax)
movq %rax, 0x8(%r12)
movq -0x10(%r14), %rax
testq %rax, %rax
je 0xcd45
movq -0x8(%r14), %r9
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq *%rax
addq $-0x28, %r14
movq %r14, %rdi
callq 0xd302
movq %r12, %r14
cmpq %r15, %r12
jne 0xcd18
movq 0x120(%rbx), %rdi
callq 0x3450
movq 0x128(%rbx), %rdi
callq 0x3450
movq 0x148(%rbx), %rdi
callq 0x3450
movq 0x1e0(%rbx), %rdi
callq 0x3450
movq 0x278(%rbx), %rdi
callq 0x3450
movq 0x310(%rbx), %rdi
callq 0x3450
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3450
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/channel_doh.c
// Function: myreq_new
static channel_req_t* myreq_new(
	channel_doh_t *ctx,
	const ns_msg_t* msg,
	channel_query_cb callback, void* cb_state)
{
	channel_req_t* req;

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

	memset(req, 0, sizeof(channel_req_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 = cb_state;
	req->rbn.key = &req->req_id;
	req->ctx = ctx;

	return req;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r15
movl $0x1, %edi
movl $0x80, %esi
callq 0x3240
movq %rax, %rbx
testq %rax, %rax
je 0xcef7
movq %r14, 0x10(%rsp)
leaq 0x68(%r15), %rbp
leaq 0xe(%rsp), %r14
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, 0xe(%rsp)
testw %cx, %cx
je 0xce79
movq %rbp, %rdi
movq %r14, %rsi
callq 0x39f8
testq %rax, %rax
jne 0xce79
movzwl 0xe(%rsp), %eax
movw %ax, (%rbx)
movl (%r13), %eax
movl %eax, 0x2(%rbx)
movq 0x10(%r13), %rax
movups (%rax), %xmm0
movups %xmm0, 0x8(%rbx)
movq (%rax), %rdi
callq 0x3610
movq %rax, 0x8(%rbx)
movq %r12, 0x18(%rbx)
movq 0x10(%rsp), %rax
movq %rax, 0x20(%rbx)
movq %rbx, 0x38(%rbx)
movq %r15, 0x60(%rbx)
jmp 0xcf29
xorl %eax, %eax
callq 0x176e5
cmpl $0x3, (%rax)
jl 0xcf29
leaq 0x160ff(%rip), %rsi     # 0x23009
leaq 0x15d94(%rip), %rdx     # 0x22ca5
leaq 0x1699b(%rip), %r8      # 0x238b3
movl $0x3, %edi
movl $0x54, %ecx
xorl %eax, %eax
callq 0x1771e
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/channel_doh.c
// Function: get_nsmsg_flags
static int get_nsmsg_flags(channel_doh_t* ctx, ns_msg_t* msg)
{
	int i, rrcount, flags = 0;
	ns_rr_t* rr;

	rrcount = msg->ancount + msg->nscount;
	for (i = 0; i < rrcount; i++) {
		rr = msg->rrs + i;
		flags |= get_rr_flags(ctx, rr, i);
	}

	rrcount = ns_rrcount(msg);
	for (; i < rrcount; i++) {
		rr = msg->rrs + i;
		flags |= get_rr_flags(ctx, rr, i);
	}

	return flags;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movzwl 0x6(%rsi), %eax
movzwl 0x8(%rsi), %edx
addl %eax, %edx
movl %edx, %r15d
je 0xe1aa
movl %edx, 0xc(%rsp)
movq %r15, %r13
shlq $0x5, %r13
movq %r14, 0x10(%rsp)
xorl %r14d, %r14d
xorl %r12d, %r12d
xorl %ebp, %ebp
movq 0x18(%rbx), %rsi
addq %r14, %rsi
movq 0x10(%rsp), %rdi
movl %r12d, %edx
callq 0xe1f3
orl %eax, %ebp
incl %r12d
addq $0x20, %r14
cmpq %r14, %r13
jne 0xe173
movzwl 0x6(%rbx), %ecx
movzwl 0x8(%rbx), %eax
addl %ecx, %eax
movq 0x10(%rsp), %r14
movl 0xc(%rsp), %edx
jmp 0xe1ae
xorl %eax, %eax
xorl %ebp, %ebp
movzwl 0xa(%rbx), %ecx
addl %eax, %ecx
cmpl %ecx, %edx
jae 0xe1e2
movl %ecx, %r12d
movq %r15, %r13
shlq $0x5, %r13
movq 0x18(%rbx), %rsi
addq %r13, %rsi
movq %r14, %rdi
movl %r15d, %edx
callq 0xe1f3
orl %eax, %ebp
incq %r15
addq $0x20, %r13
cmpq %r12, %r15
jb 0xe1c2
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/channel_os.c
// Function: channel_os_create
int channel_os_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)
{
	channel_os_t* ctx;

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

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

	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;

	*pctx = (channel_t*)ctx;

	return CHANNEL_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r9d, %ebp
movq %r8, %r14
movq %rcx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movl $0x1, %edi
movl $0x58, %esi
callq 0x3240
testq %rax, %rax
je 0xe3f7
movq 0x40(%rsp), %rcx
movq 0x38(%rsp), %rdx
movq 0x30(%rsp), %rsi
movq %r12, (%rax)
movq %r15, 0x8(%rax)
movq %r14, 0x10(%rax)
movl %ebp, 0x18(%rax)
movq %rsi, 0x20(%rax)
movq %rdx, 0x28(%rax)
movq %rcx, 0x50(%rax)
leaq 0x6e(%rip), %rcx        # 0xe439
movq %rcx, 0x30(%rax)
leaq 0x66(%rip), %rcx        # 0xe43c
movq %rcx, 0x38(%rax)
leaq 0x5e(%rip), %rcx        # 0xe43f
movq %rcx, 0x40(%rax)
leaq 0x268(%rip), %rcx       # 0xe654
movq %rcx, 0x48(%rax)
movq %rax, (%rbx)
xorl %ebx, %ebx
jmp 0xe42e
xorl %eax, %eax
callq 0x176e5
movl $0x3, %ebx
cmpl $0x3, (%rax)
jl 0xe42e
leaq 0x14da1(%rip), %rsi     # 0x231b0
leaq 0x14dab(%rip), %rdx     # 0x231c1
leaq 0x15496(%rip), %r8      # 0x238b3
movl $0x3, %edi
movl $0x6b, %ecx
xorl %eax, %eax
callq 0x1771e
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/channel_tcp.c
// Function: req_destroy
static void req_destroy(tcpreq_t* req)
{
	dlitem_t *cur, *nxt;
	reqconn_t *conn;
	dllist_foreach(&req->conns, cur, nxt,
		reqconn_t, conn, conn.entry) {
		dllist_init_remove(&conn->conn.entry);
		reqconn_destroy(conn);
	}
	free(req->qr.qname);
	free(req);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x48(%rdi), %r12
movq 0x48(%rdi), %r14
cmpq %r12, %r14
je 0xed79
leaq -0x40(%r14), %r15
movq (%r14), %r13
movq 0x8(%r14), %rax
movq %r13, (%rax)
movq %rax, 0x8(%r13)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movq %r15, %rdi
callq 0x19218
addq $0x30, %r14
movq %r14, %rdi
callq 0x1cdc9
movq %r15, %rdi
callq 0x3450
movq %r13, %r14
cmpq %r12, %r13
jne 0xed3c
movq 0x8(%rbx), %rdi
callq 0x3450
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x3450
// File: /workspace/github_c_makefile_star2_O3/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:
movq 0x58(%rdi), %r11
addq $0x58, %rdi
cmpq %rdi, %r11
je 0xf24d
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r8
xorl %eax, %eax
movl $0x1940, %r9d           # imm = 0x1940
movl $0x4a0, %r10d           # imm = 0x4A0
movq (%r11), %rbx
cmpl $0x0, 0x28(%r11)
jne 0xf236
movq 0x18(%r11), %r14
addq $0x18, %r11
xorl %ebp, %ebp
cmpq %r11, %r14
je 0xf231
movq %r14, %r15
movq (%r14), %r14
movl -0x8(%r15), %ecx
movl %ecx, %r12d
andl $-0x5, %r12d
cmpl $0x9, %r12d
je 0xf168
cmpl $0x2, %ecx
jne 0xf1ae
cmpl $0x0, 0x28(%r15)
jne 0xf1ae
movl -0x40(%r15), %ecx
cmpl %ecx, %ebp
cmovlel %ecx, %ebp
leal 0x3f(%rcx), %r13d
testl %ecx, %ecx
cmovnsl %ecx, %r13d
movl %r13d, %r12d
andl $-0x40, %r12d
subl %r12d, %ecx
movl $0x1, %r12d
shlq %cl, %r12
movl -0x18(%r15), %ecx
sarl $0x6, %r13d
cmpl -0x14(%r15), %ecx
movq %rsi, %r15
cmovgq %rdx, %r15
movslq %r13d, %rcx
orq %r12, (%r15,%rcx,8)
orq %r12, (%r8,%rcx,8)
jmp 0xf13c
cmpl $0xc, %ecx
ja 0xf13c
btl %ecx, %r9d
jb 0xf1fb
btl %ecx, %r10d
jb 0xf1c8
cmpl $0x1, %ecx
jne 0xf13c
movl -0x40(%r15), %ecx
cmpl %ecx, %ebp
cmovlel %ecx, %ebp
leal 0x3f(%rcx), %r15d
testl %ecx, %ecx
cmovnsl %ecx, %r15d
movl %r15d, %r12d
andl $-0x40, %r12d
subl %r12d, %ecx
movl $0x1, %r12d
shlq %cl, %r12
sarl $0x6, %r15d
movslq %r15d, %rcx
orq %r12, (%rdx,%rcx,8)
jmp 0xf1a8
movl -0x40(%r15), %ecx
cmpl %ecx, %ebp
cmovlel %ecx, %ebp
leal 0x3f(%rcx), %r15d
testl %ecx, %ecx
cmovnsl %ecx, %r15d
movl %r15d, %r12d
andl $-0x40, %r12d
subl %r12d, %ecx
movl $0x1, %r12d
shlq %cl, %r12
sarl $0x6, %r15d
movslq %r15d, %rcx
orq %r12, (%rsi,%rcx,8)
jmp 0xf1a8
cmpl %ebp, %eax
cmovlel %ebp, %eax
movq %rbx, %r11
cmpq %rdi, %rbx
jne 0xf124
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x58(%rdi), %r15
movq 0x58(%rdi), %r14
cmpq %r15, %r14
je 0xfa09
movq (%r14), %r12
movq 0x8(%r14), %rax
movq %r12, (%rax)
movq %rax, 0x8(%r12)
movq -0x10(%r14), %rax
testq %rax, %rax
je 0xf9f5
movq -0x8(%r14), %r9
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq *%rax
addq $-0x30, %r14
movq %r14, %rdi
callq 0xed23
movq %r12, %r14
cmpq %r15, %r12
jne 0xf9c8
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3450
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x58(%rdi), %r15
movq 0x58(%rdi), %r14
cmpq %r15, %r14
je 0x1142d
movq (%r14), %r12
movq 0x8(%r14), %rax
movq %r12, (%rax)
movq %rax, 0x8(%r12)
movq -0x10(%r14), %rax
testq %rax, %rax
je 0x11410
movq -0x8(%r14), %r9
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq *%rax
movq $0x0, -0x10(%r14)
movq -0x28(%r14), %rdi
addq $-0x30, %r14
callq 0x3450
movq %r14, %rdi
callq 0x3450
movq %r12, %r14
cmpq %r15, %r12
jne 0x113db
cmpl $0x0, 0x500(%rbx)
jle 0x1145e
leaq 0x108(%rbx), %r14
xorl %r15d, %r15d
movl (%r14), %edi
callq 0x3670
incq %r15
movslq 0x500(%rbx), %rax
addq $0x90, %r14
cmpq %rax, %r15
jl 0x11440
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3450
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/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
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
movl $0x1, %edi
movl $0x20, %esi
callq 0x3240
testq %rax, %rax
je 0x11706
movq %rax, %rbx
movl %ebp, (%rax)
cmpl $0xa, %ebp
je 0x1173e
cmpl $0x2, %ebp
jne 0x11748
movl (%r14), %eax
movl %eax, 0x4(%rbx)
jmp 0x11787
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x176e5
cmpl $0x3, (%rax)
jl 0x11787
leaq 0x11ffb(%rip), %rsi     # 0x23716
leaq 0x12070(%rip), %rdx     # 0x23792
leaq 0x1218a(%rip), %r8      # 0x238b3
xorl %ebx, %ebx
movl $0x3, %edi
movl $0x2d, %ecx
xorl %eax, %eax
callq 0x1771e
jmp 0x11787
movups (%r14), %xmm0
movups %xmm0, 0x4(%rbx)
jmp 0x11787
xorl %eax, %eax
callq 0x176e5
cmpl $0x3, (%rax)
jl 0x1177d
leaq 0x11fbb(%rip), %rsi     # 0x23716
leaq 0x12030(%rip), %rdx     # 0x23792
leaq 0x12034(%rip), %r8      # 0x2379d
movl $0x3, %edi
movl $0x3c, %ecx
movl %ebp, %r9d
xorl %eax, %eax
callq 0x1771e
movq %rbx, %rdi
callq 0x3450
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %ebp
movq %r8, %r12
movq %rcx, %r13
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, (%rsp)
movl $0x1, %edi
movl $0x68, %esi
callq 0x3240
testq %rax, %rax
je 0x1188b
movq %rax, %r15
movq 0x50(%rsp), %rax
movq 0x48(%rsp), %rcx
movq 0x40(%rsp), %rdx
leaq 0xf5(%rip), %rsi        # 0x118d3
movq %rsi, 0x60(%r15)
movq %r14, (%r15)
movq %r13, 0x8(%r15)
movq %r12, 0x10(%r15)
movl %ebp, 0x18(%r15)
movq %rdx, 0x20(%r15)
movq %rcx, 0x28(%r15)
movq %rax, 0x50(%r15)
leaq 0xd4(%rip), %rax        # 0x118d8
movq %rax, 0x30(%r15)
leaq 0xcc(%rip), %rax        # 0x118db
movq %rax, 0x38(%r15)
leaq 0xc4(%rip), %rax        # 0x118de
movq %rax, 0x40(%r15)
leaq 0x303(%rip), %rax       # 0x11b28
movq %rax, 0x48(%r15)
testq %rbx, %rbx
je 0x11880
leaq 0x312(%rip), %rsi       # 0x11b47
movq %rbx, %rdi
movq %r15, %rdx
callq 0x1e02d
testl %eax, %eax
je 0x11880
xorl %eax, %eax
callq 0x176e5
movl $0x2, %ebp
cmpl $0x3, (%rax)
jl 0x118c2
leaq 0x11eba(%rip), %rsi     # 0x23716
leaq 0x11f13(%rip), %rdx     # 0x23776
leaq 0x11053(%rip), %r8      # 0x228bd
movl $0x3, %edi
movl $0x1cc, %ecx            # imm = 0x1CC
movq %rbx, %r9
xorl %eax, %eax
callq 0x1771e
jmp 0x118c2
movq (%rsp), %rax
movq %r15, (%rax)
xorl %ebp, %ebp
jmp 0x118c2
xorl %eax, %eax
callq 0x176e5
movl $0x3, %ebp
cmpl $0x3, (%rax)
jl 0x118c2
leaq 0x11e73(%rip), %rsi     # 0x23716
leaq 0x11ecc(%rip), %rdx     # 0x23776
leaq 0x12002(%rip), %r8      # 0x238b3
movl $0x3, %edi
movl $0x1b5, %ecx            # imm = 0x1B5
xorl %eax, %eax
callq 0x1771e
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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:
testq %rdi, %rdi
sete %cl
testq %rsi, %rsi
sete %dl
xorl %eax, %eax
orb %cl, %dl
jne 0x11fd3
movl (%rdi), %r8d
testl %r8d, %r8d
je 0x11fd3
xorl %r9d, %r9d
movl (%rsi), %ecx
bswapl %ecx
movq 0x8(%rdi), %rdx
decl %r8d
je 0x11fc5
leal (%r9,%r8), %esi
movl %esi, %eax
shrl $0x1f, %eax
addl %esi, %eax
sarl %eax
movslq %eax, %rsi
cmpl (%rdx,%rsi,8), %ecx
jae 0x11faf
movl %r9d, %esi
cmpl %eax, %r8d
movl %eax, %r8d
movl %r9d, %eax
jne 0x11fb7
jmp 0x11fc2
movl %r9d, %esi
cmpl %eax, %r9d
je 0x11fc2
movl %eax, %r9d
movl %r8d, %esi
cmpl %r8d, %eax
jne 0x11f8a
movslq %esi, %r9
andl 0x4(%rdx,%r9,8), %ecx
xorl %eax, %eax
cmpl (%rdx,%r9,8), %ecx
sete %al
retq
// File: /workspace/github_c_makefile_star2_O3/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:
testq %rdi, %rdi
sete %cl
testq %rsi, %rsi
sete %dl
xorl %eax, %eax
orb %cl, %dl
jne 0x120be
movl 0x10(%rdi), %edx
testl %edx, %edx
je 0x120be
movdqu (%rsi), %xmm0
movdqa %xmm0, -0x28(%rsp)
pxor %xmm1, %xmm1
movdqa %xmm0, %xmm2
punpckhbw %xmm1, %xmm2    # xmm2 = xmm2[8],xmm1[8],xmm2[9],xmm1[9],xmm2[10],xmm1[10],xmm2[11],xmm1[11],xmm2[12],xmm1[12],xmm2[13],xmm1[13],xmm2[14],xmm1[14],xmm2[15],xmm1[15]
pshuflw $0x1b, %xmm2, %xmm2     # xmm2 = xmm2[3,2,1,0,4,5,6,7]
pshufhw $0x1b, %xmm2, %xmm2     # xmm2 = xmm2[0,1,2,3,7,6,5,4]
punpcklbw %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3],xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
pshuflw $0x1b, %xmm0, %xmm0     # xmm0 = xmm0[3,2,1,0,4,5,6,7]
pshufhw $0x1b, %xmm0, %xmm0     # xmm0 = xmm0[0,1,2,3,7,6,5,4]
packuswb %xmm2, %xmm0
movdqa %xmm0, -0x28(%rsp)
xorl %eax, %eax
movq 0x18(%rdi), %rcx
decl %edx
je 0x12098
movl %eax, %esi
leal (%rsi,%rdx), %edi
movl %edi, %eax
shrl $0x1f, %eax
addl %edi, %eax
sarl %eax
movslq %eax, %rdi
shlq $0x5, %rdi
addq %rcx, %rdi
xorl %r8d, %r8d
movl -0x28(%rsp,%r8,4), %r9d
movl (%rdi,%r8,4), %r10d
cmpl %r10d, %r9d
jb 0x12087
ja 0x12081
leaq 0x1(%r8), %r9
cmpq $0x3, %r8
movq %r9, %r8
jne 0x12064
cmpl %eax, %esi
jne 0x1208f
jmp 0x12095
cmpl %eax, %edx
movl %eax, %edx
movl %esi, %eax
je 0x12095
movl %edx, %esi
cmpl %edx, %eax
jne 0x12049
movslq %esi, %rax
shlq $0x5, %rax
addq %rax, %rcx
xorl %eax, %eax
xorl %edx, %edx
movl 0x10(%rcx,%rdx,4), %esi
andl -0x28(%rsp,%rdx,4), %esi
cmpl (%rcx,%rdx,4), %esi
jne 0x120be
incq %rdx
cmpq $0x4, %rdx
jne 0x120a3
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/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:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x12109
movzwl (%rsi), %eax
cmpl $0xa, %eax
je 0x1210c
cmpl $0x2, %eax
jne 0x12109
addq $0x4, %rsi
jmp 0x11f60
xorl %eax, %eax
retq
addq $0x8, %rsi
jmp 0x11fe6
// File: /workspace/github_c_makefile_star2_O3/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:
testq %rdi, %rdi
je 0x1285f
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x3450
movq 0x18(%rbx), %rdi
callq 0x3450
movq %rbx, %rdi
popq %rbx
jmp 0x3450
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/config.c
// Function: conf_add_channel
static int conf_add_channel(config_t* conf, const char *channel)
{
	char** channels;
	int num = 0;
	char** p;

	p = conf->channels;
	while (p && *p) {
		num++;
		p++;
	}
	
	channels = (char**)realloc(conf->channels, sizeof(char*) * (num + 2));

	if (!channels) {
		loge("alloc\n");
		return -1;
	}

	conf->channels = channels;
	channels[num++] = strdup(channel);
	channels[num] = NULL;

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x70(%rdi), %rdi
xorl %eax, %eax
testq %rdi, %rdi
je 0x12b68
cmpq $0x0, (%rdi)
je 0x12b68
xorl %eax, %eax
cmpq $0x0, 0x8(%rdi,%rax,8)
leaq 0x1(%rax), %rax
jne 0x12b5c
movl %eax, %r12d
leaq 0x10(,%r12,8), %rsi
callq 0x35b0
testq %rax, %rax
je 0x12b9d
movq %rax, %r15
movq %rax, 0x70(%r14)
movq %rbx, %rdi
callq 0x3610
movq %rax, (%r15,%r12,8)
movq $0x0, 0x8(%r15,%r12,8)
xorl %ebx, %ebx
jmp 0x12bd4
xorl %eax, %eax
callq 0x176e5
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x3, (%rax)
jl 0x12bd4
leaq 0x10ec8(%rip), %rsi     # 0x23a7d
leaq 0x11068(%rip), %rdx     # 0x23c24
leaq 0x10cf0(%rip), %r8      # 0x238b3
movl $0x3, %edi
movl $0x1e, %ecx
xorl %eax, %eax
callq 0x1771e
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/config.c
// Function: conf_add_channel_args
static int conf_add_channel_args(config_t* conf, const char* args)
{
	char** channel_args;
	int num = 0;
	char** p;

	p = conf->channel_args;
	while (p && *p) {
		num++;
		p++;
	}

	channel_args = (char**)realloc(conf->channel_args, sizeof(char*) * (num + 2));

	if (!channel_args) {
		loge("alloc\n");
		return -1;
	}

	conf->channel_args = channel_args;
	channel_args[num++] = strdup(args);
	channel_args[num] = NULL;

	return 0;

}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x78(%rdi), %rdi
xorl %eax, %eax
testq %rdi, %rdi
je 0x12c0f
cmpq $0x0, (%rdi)
je 0x12c0f
xorl %eax, %eax
cmpq $0x0, 0x8(%rdi,%rax,8)
leaq 0x1(%rax), %rax
jne 0x12c03
movl %eax, %r12d
leaq 0x10(,%r12,8), %rsi
callq 0x35b0
testq %rax, %rax
je 0x12c44
movq %rax, %r15
movq %rax, 0x78(%r14)
movq %rbx, %rdi
callq 0x3610
movq %rax, (%r15,%r12,8)
movq $0x0, 0x8(%r15,%r12,8)
xorl %ebx, %ebx
jmp 0x12c7b
xorl %eax, %eax
callq 0x176e5
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x3, (%rax)
jl 0x12c7b
leaq 0x10e21(%rip), %rsi     # 0x23a7d
leaq 0x10fd2(%rip), %rdx     # 0x23c35
leaq 0x10c49(%rip), %r8      # 0x238b3
movl $0x3, %edi
movl $0x38, %ecx
xorl %eax, %eax
callq 0x1771e
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/config.c
// Function: conf_check
int conf_check(config_t* conf)
{
	int channel_num = 0;
	int channel_args_num = 0;
	char** p;

	if (conf->listen_addr == NULL) {
		conf->listen_addr = strdup(DEFAULT_LISTEN_ADDR);
	}
	if (conf->listen_port == NULL) {
		conf->listen_port = strdup(DEFAULT_LISTEN_PORT);
	}
	if (conf->timeout <= 0) {
		conf->timeout = DEFAULT_TIMEOUT;
	}
	if (conf->cache_timeout < 0) {
		conf->cache_timeout = CACHE_TIMEOUT_FOLLOWING_TTL;
	}
	if (conf->channel_choose_mode < 0) {
		conf->channel_choose_mode = CHOOSE_MODE_CONCUR;
	}
	if (conf->channels == NULL) {
		if (conf_add_channel(conf, DEFAULT_CHANNEL)) {
			return -1;
		}
	}
	if (conf->channel_args == NULL) {
		if (conf_add_channel_args(conf, DEFAULT_CHANNEL_ARGS)) {
			return -1;
		}
	}
	if (conf->wwwroot == NULL) {
		conf->wwwroot = strdup(DEFAULT_WWWROOT);
	}

	p = conf->channels;
	while (p && *p) {
		channel_num++;
		p++;
	}

	p = conf->channel_args;
	while (p && *p) {
		channel_args_num++;
		p++;
	}

	if (channel_num != channel_args_num) {
		loge("channel and channel_args are not match\n");
		return -1;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x0, (%rdi)
jne 0x12ca4
leaq 0x10d82(%rip), %rdi     # 0x23a1e
callq 0x3610
movq %rax, (%rbx)
cmpq $0x0, 0x8(%rbx)
jne 0x12cbb
leaq 0xfda5(%rip), %rdi      # 0x22a57
callq 0x3610
movq %rax, 0x8(%rbx)
cmpl $0x0, 0x88(%rbx)
jg 0x12cce
movl $0x5, 0x88(%rbx)
cmpl $0x0, 0x8c(%rbx)
jns 0x12ce1
movl $0x1, 0x8c(%rbx)
cmpl $0x0, 0x80(%rbx)
jns 0x12cf4
movl $0x1, 0x80(%rbx)
cmpq $0x0, 0x70(%rbx)
je 0x12da6
cmpq $0x0, 0x78(%rbx)
je 0x12dc3
cmpq $0x0, 0x50(%rbx)
jne 0x12d21
leaq 0x10d4d(%rip), %rdi     # 0x23a65
callq 0x3610
movq %rax, 0x50(%rbx)
movq 0x70(%rbx), %rdx
xorl %eax, %eax
movl $0x0, %ecx
testq %rdx, %rdx
je 0x12d4a
cmpq $0x0, (%rdx)
movl $0x0, %ecx
je 0x12d4a
xorl %ecx, %ecx
cmpq $0x0, 0x8(%rdx,%rcx,8)
leaq 0x1(%rcx), %rcx
jne 0x12d3e
movq 0x78(%rbx), %rdx
testq %rdx, %rdx
je 0x12d67
cmpq $0x0, (%rdx)
je 0x12d67
xorl %eax, %eax
cmpq $0x0, 0x8(%rdx,%rax,8)
leaq 0x1(%rax), %rax
jne 0x12d5b
xorl %ebp, %ebp
cmpl %eax, %ecx
je 0x12ddf
xorl %eax, %eax
callq 0x176e5
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x3, (%rax)
jl 0x12ddf
leaq 0x10cf8(%rip), %rsi     # 0x23a7d
leaq 0x10cfe(%rip), %rdx     # 0x23a8a
leaq 0x10d02(%rip), %r8      # 0x23a95
movl $0x3, %edi
movl $0xe4, %ecx
xorl %eax, %eax
callq 0x1771e
jmp 0x12ddf
leaq 0xf842(%rip), %rsi      # 0x225ef
movq %rbx, %rdi
callq 0x12b3b
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x12ddf
jmp 0x12cff
leaq 0x10c5c(%rip), %rsi     # 0x23a26
movq %rbx, %rdi
callq 0x12be2
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
je 0x12d0a
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/config.c
// Function: conf_free
void conf_free(config_t* conf)
{
	char** p;

	free(conf->listen_addr);
	conf->listen_addr = NULL;

	free(conf->listen_port);
	conf->listen_port = NULL;

	free(conf->pid_file);
	conf->pid_file = NULL;

	free(conf->log_file);
	conf->log_file = NULL;

	free(conf->launch_log);
	conf->launch_log = NULL;

	free(conf->config_file);
	conf->config_file = NULL;

	free(conf->chnroute);
	conf->chnroute = NULL;

	free(conf->blacklist);
	conf->blacklist = NULL;

	free(conf->hosts);
	conf->hosts = NULL;

	free(conf->proxy);
	conf->proxy = NULL;

	free(conf->wwwroot);
	conf->wwwroot = NULL;

	free(conf->cachedb);
	conf->cachedb = NULL;

	free(conf->cache_api);
	conf->cache_api = NULL;

	free(conf->cachedb_autosave);
	conf->cachedb_autosave = NULL;

	p = conf->channel_args;
	while (p && *p) {
		free(*p);
		p++;
	}

	p = conf->channels;
	while (p && *p) {
		free(*p);
		p++;
	}

	free(conf->channel_args);
	conf->channel_args = NULL;

	free(conf->channels);
	conf->channels = NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x3450
xorl %r14d, %r14d
movq %r14, (%rbx)
movq 0x8(%rbx), %rdi
callq 0x3450
movq %r14, 0x8(%rbx)
movq 0x10(%rbx), %rdi
callq 0x3450
movq %r14, 0x10(%rbx)
movq 0x18(%rbx), %rdi
callq 0x3450
movq %r14, 0x18(%rbx)
movq 0x20(%rbx), %rdi
callq 0x3450
movq %r14, 0x20(%rbx)
movq 0x28(%rbx), %rdi
callq 0x3450
movq %r14, 0x28(%rbx)
movq 0x38(%rbx), %rdi
callq 0x3450
movq %r14, 0x38(%rbx)
movq 0x40(%rbx), %rdi
callq 0x3450
movq %r14, 0x40(%rbx)
movq 0x48(%rbx), %rdi
callq 0x3450
movq %r14, 0x48(%rbx)
movq 0x30(%rbx), %rdi
callq 0x3450
movq %r14, 0x30(%rbx)
movq 0x50(%rbx), %rdi
callq 0x3450
movq %r14, 0x50(%rbx)
movq 0x58(%rbx), %rdi
callq 0x3450
movq %r14, 0x58(%rbx)
movq 0x68(%rbx), %rdi
callq 0x3450
movq %r14, 0x68(%rbx)
movq 0x60(%rbx), %rdi
callq 0x3450
movq %r14, 0x60(%rbx)
movq 0x78(%rbx), %r14
testq %r14, %r14
je 0x13bbc
movq (%r14), %rdi
testq %rdi, %rdi
je 0x13bbc
addq $0x8, %r14
callq 0x3450
movq (%r14), %rdi
addq $0x8, %r14
testq %rdi, %rdi
jne 0x13bab
movq 0x70(%rbx), %r14
testq %r14, %r14
je 0x13be2
movq (%r14), %rdi
testq %rdi, %rdi
je 0x13be2
addq $0x8, %r14
callq 0x3450
movq (%r14), %rdi
addq $0x8, %r14
testq %rdi, %rdi
jne 0x13bd1
movq 0x78(%rbx), %rdi
callq 0x3450
xorl %r14d, %r14d
movq %r14, 0x78(%rbx)
movq 0x70(%rbx), %rdi
callq 0x3450
movq %r14, 0x70(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/dns_request.c
// Function: req_destroy
void req_destroy(req_t* req)
{
	if (req) {
		if (req->fromlen > 0)
			free(req->from);
		if (req->msg) {
			ns_msg_free(req->msg);
			free(req->msg);
		}
		free(req);
	}
}

// Assembly:
testq %rdi, %rdi
je 0x13e55
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x20(%rdi)
jle 0x13e35
movq 0x18(%rbx), %rdi
callq 0x3450
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x13e4c
callq 0x19ae0
movq 0x8(%rbx), %rdi
callq 0x3450
movq %rbx, %rdi
popq %rbx
jmp 0x3450
retq