LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/channel_cache.c
// Function: cache_item_new
static cache_item_t* cache_item_new(const ns_msg_t* msg, const char *key)
{
	cache_item_t* item;

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

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

	item->msg = ns_msg_clone(msg);
	if (!item->msg) {
		loge("ns_msg_clone() error\n");
		return NULL;
	}

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

	return item;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x48, %edi
callq 0x34d0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0xdea8
jmp 0xde67
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0xde99
movl $0x3, %edi
leaq 0x27d73(%rip), %rsi     # 0x35bf2
leaq 0x280ae(%rip), %rdx     # 0x35f34
movl $0x27, %ecx
leaq 0x29005(%rip), %r8      # 0x36e97
movb $0x0, %al
callq 0x243b0
jmp 0xde9b
movq $0x0, -0x8(%rbp)
jmp 0xdf32
movq -0x20(%rbp), %rdi
xorl %esi, %esi
movl $0x48, %edx
callq 0x3200
movq -0x10(%rbp), %rdi
callq 0x27660
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x38(%rax)
jne 0xdf17
jmp 0xded9
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0xdf0b
movl $0x3, %edi
leaq 0x27d01(%rip), %rsi     # 0x35bf2
leaq 0x2803c(%rip), %rdx     # 0x35f34
movl $0x2f, %ecx
leaq 0x27da8(%rip), %r8      # 0x35cac
movb $0x0, %al
callq 0x243b0
jmp 0xdf0d
movq $0x0, -0x8(%rbp)
jmp 0xdf32
movq -0x18(%rbp), %rdi
callq 0x3620
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
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_cache.c
// Function: cache_check_expire
static void cache_check_expire(cache_t* c)
{
	dlitem_t* cur, * nxt;
	cache_item_t* item;
	time_t now = time(NULL);

	dllist_foreach(&c->items, cur, nxt,
		cache_item_t, item, entry) {

		if (item->expire <= now) {
			logi("cache timeout - %s\n", item->node.key);
			dllist_remove(&item->entry);
			rbtree_remove(&c->dic, &item->node);
			cache_item_destroy(item);
		}
		else {
			break;
		}
	}
}

// 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 $0x28, %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 0xdfa1
jmp 0xe065
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
cmpq -0x28(%rbp), %rax
jg 0xe035
jmp 0xdfb5
movb $0x0, %al
callq 0x242d0
cmpl $0x6, (%rax)
jl 0xdfee
movq -0x20(%rbp), %rax
movq (%rax), %r9
movl $0x6, %edi
leaq 0x27c1e(%rip), %rsi     # 0x35bf2
leaq 0x27f68(%rip), %rdx     # 0x35f43
movl $0x5e, %ecx
leaq 0x27f6f(%rip), %r8      # 0x35f56
movb $0x0, %al
callq 0x243b0
jmp 0xdff0
jmp 0xdff2
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rcx
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rcx
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rdi
addq $0x68, %rdi
movq -0x20(%rbp), %rsi
callq 0x3b90
movq -0x20(%rbp), %rdi
callq 0xc1f0
jmp 0xe037
jmp 0xe065
jmp 0xe039
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 $0x28, %rcx
subq %rcx, %rax
addq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0xdf84
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/channel_chndoh.c
// Function: check_ctx
static int check_ctx(channel_chndoh_t *ctx)
{
	if (ctx->chndoh.channel != CH_NONE) {
		if (check_doh_server(&ctx->chndoh))
			return -1;
	}
	if (ctx->frndoh.channel != CH_NONE) {
		if (check_doh_server(&ctx->frndoh))
			return -1;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x630(%rax)
je 0xee69
movq -0x10(%rbp), %rdi
addq $0x80, %rdi
callq 0xfa20
cmpl $0x0, %eax
je 0xee67
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xee9d
jmp 0xee69
movq -0x10(%rbp), %rax
cmpl $0x0, 0xc00(%rax)
je 0xee96
movq -0x10(%rbp), %rdi
addq $0x650, %rdi            # imm = 0x650
callq 0xfa20
cmpl $0x0, %eax
je 0xee94
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xee9d
jmp 0xee96
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/channel_chndoh.c
// Function: query
static int query(channel_t* ctx,
	const ns_msg_t* msg,
	channel_query_cb callback, void* state)
{
	channel_chndoh_t* c = (channel_chndoh_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 %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)
movq -0x30(%rbp), %rax
cmpl $0x7530, 0x78(%rax)     # imm = 0x7530
jle 0xf31f
jmp 0xf2df
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0xf311
movl $0x3, %edi
leaq 0x26c87(%rip), %rsi     # 0x35f7e
leaq 0x26fb3(%rip), %rdx     # 0x362b1
movl $0x3fa, %ecx            # imm = 0x3FA
leaq 0x272c2(%rip), %r8      # 0x365cc
movb $0x0, %al
callq 0x243b0
jmp 0xf313
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xf45e
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0xfeb0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0xf34b
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xf45e
jmp 0xf34d
movq -0x30(%rbp), %rcx
addq $0x58, %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x30(%rbp), %rax
movq 0x60(%rax), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x38(%rbp), %rcx
addq $0x28, %rcx
movq -0x30(%rbp), %rax
movq 0x60(%rax), %rax
movq %rcx, (%rax)
movq -0x38(%rbp), %rcx
addq $0x28, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x30(%rbp), %rdi
addq $0x68, %rdi
movq -0x38(%rbp), %rsi
addq $0x38, %rsi
callq 0x3790
movq -0x30(%rbp), %rax
movl 0x78(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x78(%rax)
movq -0x38(%rbp), %rdi
callq 0x102a0
cmpl $0x0, %eax
je 0xf457
jmp 0xf3c6
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0xf3f8
movl $0x3, %edi
leaq 0x26ba0(%rip), %rsi     # 0x35f7e
leaq 0x26ecc(%rip), %rdx     # 0x362b1
movl $0x407, %ecx            # imm = 0x407
leaq 0x26e6f(%rip), %r8      # 0x36260
movb $0x0, %al
callq 0x243b0
jmp 0xf3fa
jmp 0xf3fc
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rcx
movq -0x38(%rbp), %rax
movq 0x30(%rax), %rax
movq %rcx, (%rax)
movq -0x38(%rbp), %rax
movq 0x30(%rax), %rcx
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rdi
addq $0x68, %rdi
movq -0x38(%rbp), %rsi
addq $0x38, %rsi
callq 0x3b90
movq -0x30(%rbp), %rax
movl 0x78(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x78(%rax)
movq -0x38(%rbp), %rdi
callq 0x10410
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xf45e
movl $0x0, -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_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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
movq -0x10(%rbp), %rsi
addq $0x90, %rsi
movq -0x18(%rbp), %rdx
callq 0x297c0
cmpl $0x0, %eax
je 0xf9e4
jmp 0xf9a3
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0xf9d9
movq -0x18(%rbp), %r9
movl $0x3, %edi
leaq 0x265bf(%rip), %rsi     # 0x35f7e
leaq 0x28b20(%rip), %rdx     # 0x384e6
movl $0x41d, %ecx            # imm = 0x41D
leaq 0x26811(%rip), %r8      # 0x361e3
movb $0x0, %al
callq 0x243b0
jmp 0xf9db
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xfa16
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3460
movq -0x18(%rbp), %rdi
callq 0x3620
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movl $0x1, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl $0x88, %edi
callq 0x34d0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0xff20
jmp 0xfedf
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0xff11
movl $0x3, %edi
leaq 0x26087(%rip), %rsi     # 0x35f7e
leaq 0x26375(%rip), %rdx     # 0x36273
movl $0x78, %ecx
leaq 0x26f8d(%rip), %r8      # 0x36e97
movb $0x0, %al
callq 0x243b0
jmp 0xff13
movq $0x0, -0x8(%rbp)
jmp 0xffe5
movq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x88, %edx
callq 0x3200
movq -0x10(%rbp), %rdi
callq 0x104a0
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, 0x18(%rax)
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x30(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x60(%rax)
movb $0x0, %al
callq 0x26e40
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x80(%rax)
movq -0x30(%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_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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0xc00(%rax)
je 0x10338
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x650, %rsi            # imm = 0x650
callq 0x10550
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x1032b
jmp 0x102eb
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x1031d
movl $0x3, %edi
leaq 0x25c7b(%rip), %rsi     # 0x35f7e
leaq 0x25fa3(%rip), %rdx     # 0x362ad
movl $0x3db, %ecx            # imm = 0x3DB
leaq 0x25fa1(%rip), %r8      # 0x362b7
movb $0x0, %al
callq 0x243b0
jmp 0x1031f
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x103fd
movq -0x10(%rbp), %rax
movl 0x74(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x74(%rax)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x630(%rax)
je 0x103ae
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x80, %rsi
callq 0x10550
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x103a1
jmp 0x10364
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x10396
movl $0x3, %edi
leaq 0x25c02(%rip), %rsi     # 0x35f7e
leaq 0x25f2a(%rip), %rdx     # 0x362ad
movl $0x3e4, %ecx            # imm = 0x3E4
leaq 0x25f28(%rip), %r8      # 0x362b7
movb $0x0, %al
callq 0x243b0
jmp 0x10398
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x103fd
movq -0x10(%rbp), %rax
movl 0x74(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x74(%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x74(%rax)
jne 0x103f7
jmp 0x103ba
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x103ec
movl $0x3, %edi
leaq 0x25bac(%rip), %rsi     # 0x35f7e
leaq 0x25ed4(%rip), %rdx     # 0x362ad
movl $0x3eb, %ecx            # imm = 0x3EB
leaq 0x25eea(%rip), %r8      # 0x362cf
movb $0x0, %al
callq 0x243b0
jmp 0x103ee
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x103fd
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x70(%rcx), %eax
jge 0x10469
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x1045c
movq -0x18(%rbp), %rdi
callq 0x27870
movq -0x18(%rbp), %rdi
callq 0x3460
jmp 0x1045e
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x10423
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rdi
callq 0x3460
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3460
movq -0x8(%rbp), %rdi
callq 0x3460
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/channel_chndoh.c
// Function: new_req_id
static uint16_t new_req_id(channel_chndoh_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 0x104e9
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 0x104ac
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_chndoh.c
// Function: doh_emit_query
static int doh_emit_query(channel_req_t* rq, doh_server_t *doh)
{
	channel_chndoh_t* c = rq->ctx;
	subnet_t* subnet = NULL;
	int r;
	ns_msg_t msg;

	if (doh->ecs) {
		if (rq->qr.qtype == NS_QTYPE_A) {
			if (doh->net.is_set) {
				subnet = &doh->net;
			}
		}
		else if (rq->qr.qtype == NS_QTYPE_AAAA) {
			if (doh->net6.is_set) {
				subnet = &doh->net6;
			}
		}
	}

	init_ns_msg(&msg);

	r = build_request_nsmsg(&msg, rq);
	if (r) {
		loge("build_request_nsmsg() error\n");
		return -1;
	}

	if (doh->query) {
		r = doh->query(doh->chctx, &msg, doh->use_proxy, subnet, query_cb, rq);
	}
	else {
		r = doh_channel_query(rq, doh, &msg, doh->use_proxy, subnet);
	}

	ns_msg_free(&msg);

	return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x478(%rax)
je 0x105d9
movq -0x10(%rbp), %rax
movzwl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x105ab
movq -0x18(%rbp), %rax
cmpl $0x0, 0x480(%rax)
je 0x105a9
movq -0x18(%rbp), %rax
addq $0x480, %rax            # imm = 0x480
movq %rax, -0x28(%rbp)
jmp 0x105d7
movq -0x10(%rbp), %rax
movzwl 0x10(%rax), %eax
cmpl $0x1c, %eax
jne 0x105d5
movq -0x18(%rbp), %rax
cmpl $0x0, 0x518(%rax)
je 0x105d3
movq -0x18(%rbp), %rax
addq $0x518, %rax            # imm = 0x518
movq %rax, -0x28(%rbp)
jmp 0x105d5
jmp 0x105d7
jmp 0x105d9
leaq -0x50(%rbp), %rdi
callq 0x270f0
movq -0x10(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x106c0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x10637
jmp 0x105fa
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x1062c
movl $0x3, %edi
leaq 0x2596c(%rip), %rsi     # 0x35f7e
leaq 0x25cc5(%rip), %rdx     # 0x362de
movl $0x3c3, %ecx            # imm = 0x3C3
leaq 0x25cc8(%rip), %r8      # 0x362ed
movb $0x0, %al
callq 0x243b0
jmp 0x1062e
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x106b0
movq -0x18(%rbp), %rax
cmpq $0x0, 0x5c0(%rax)
je 0x1067f
movq -0x18(%rbp), %rax
movq 0x5c0(%rax), %rax
movq -0x18(%rbp), %rcx
movq 0x5b8(%rcx), %rdi
movq -0x18(%rbp), %rcx
movl 0x474(%rcx), %edx
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %r9
leaq -0x50(%rbp), %rsi
leaq 0xb8(%rip), %r8         # 0x10730
callq *%rax
movl %eax, -0x2c(%rbp)
jmp 0x106a1
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x18(%rbp), %rax
movl 0x474(%rax), %ecx
movq -0x28(%rbp), %r8
leaq -0x50(%rbp), %rdx
callq 0x10c10
movl %eax, -0x2c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x27870
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/channel_chndoh.c
// Function: build_request_nsmsg
static int build_request_nsmsg(ns_msg_t* msg, channel_req_t* req)
{
	init_ns_msg(msg);

	msg->id = 0;
	msg->flags = req->flags;
	msg->qdcount = 1;
	msg->qrs = ns_qr_clone(&req->qr, 1);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x270f0
movq -0x8(%rbp), %rax
movw $0x0, (%rax)
movq -0x10(%rbp), %rax
movw 0x4(%rax), %cx
movq -0x8(%rbp), %rax
movw %cx, 0x2(%rax)
movq -0x8(%rbp), %rax
movw $0x1, 0x4(%rax)
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0x271c0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/channel_chndoh.c
// Function: is_best
static int is_best(channel_chndoh_t* c, ns_msg_t* msg)
{
	int flags, have_ip, chn_doh, chn_ip, black;

	flags = get_nsmsg_flags(c, msg);

	black = flags & FLG_BLACKLIST;                /* In blacklist? */
	have_ip = flags & (FLG_A | FLG_AAAA);         /* Have IP? */
	chn_doh = msg->id == 0;                       /* From China DoH? */
	chn_ip = flags & (FLG_A_CHN | FLG_AAAA_CHN);  /* Result is China? */

	if (black) {
		return FALSE;
	}

	if (have_ip && chn_doh && chn_ip) {
		return TRUE;
	}

	return FALSE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x11120
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
andl $0x1000, %eax           # imm = 0x1000
movl %eax, -0x2c(%rbp)
movl -0x1c(%rbp), %eax
andl $0x12, %eax
movl %eax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movzwl (%rax), %eax
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x24(%rbp)
movl -0x1c(%rbp), %eax
andl $0x24, %eax
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x10ee1
movl $0x0, -0x4(%rbp)
jmp 0x10f03
cmpl $0x0, -0x20(%rbp)
je 0x10efc
cmpl $0x0, -0x24(%rbp)
je 0x10efc
cmpl $0x0, -0x28(%rbp)
je 0x10efc
movl $0x1, -0x4(%rbp)
jmp 0x10f03
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/channel_chndoh.c
// Function: detach_result
static void detach_result(channel_req_t* rq, ns_msg_t* result)
{
	ns_msg_t* msg;
	int i;
	for (i = 0; i < rq->result_num; i++) {
		msg = rq->results[i];
		if (msg == result) {
			rq->results[i] = NULL;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x70(%rcx), %eax
jge 0x1111e
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x10(%rbp), %rax
jne 0x11111
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
jmp 0x11113
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x110d3
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
movzwl 0x6(%rax), %eax
movq -0x10(%rbp), %rcx
movzwl 0x8(%rcx), %ecx
addl %ecx, %eax
movl %eax, -0x18(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x1119b
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x14(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x11210
orl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1115a
movq -0x10(%rbp), %rax
movzwl 0x6(%rax), %eax
movq -0x10(%rbp), %rcx
movzwl 0x8(%rcx), %ecx
addl %ecx, %eax
movq -0x10(%rbp), %rcx
movzwl 0xa(%rcx), %ecx
addl %ecx, %eax
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x111fb
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x14(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x11210
orl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x111ba
movl -0x1c(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %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)
movq -0x28(%rbp), %rax
movq 0x118(%rax), %rax
movq %rax, -0x30(%rbp)
xorl %eax, %eax
movl %eax, %edi
callq 0x3330
movq %rax, %rcx
movq -0x30(%rbp), %rax
cmpq %rcx, %rax
jge 0x12bdd
movq -0x28(%rbp), %rdi
callq 0x12ff0
movq -0x28(%rbp), %rax
movq 0x80(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x1ff20
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_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 %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)
movq -0x30(%rbp), %rax
cmpl $0x7530, 0x78(%rax)     # imm = 0x7530
jle 0x12c7f
jmp 0x12c3f
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x12c71
movl $0x3, %edi
leaq 0x239ac(%rip), %rsi     # 0x36603
leaq 0x23653(%rip), %rdx     # 0x362b1
movl $0x34e, %ecx            # imm = 0x34E
leaq 0x23962(%rip), %r8      # 0x365cc
movb $0x0, %al
callq 0x243b0
jmp 0x12c73
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x12dbe
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x13230
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x12cab
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x12dbe
jmp 0x12cad
movq -0x30(%rbp), %rcx
addq $0x58, %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x30(%rbp), %rax
movq 0x60(%rax), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x38(%rbp), %rcx
addq $0x28, %rcx
movq -0x30(%rbp), %rax
movq 0x60(%rax), %rax
movq %rcx, (%rax)
movq -0x38(%rbp), %rcx
addq $0x28, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x30(%rbp), %rdi
addq $0x68, %rdi
movq -0x38(%rbp), %rsi
addq $0x38, %rsi
callq 0x3790
movq -0x30(%rbp), %rax
movl 0x78(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x78(%rax)
movq -0x38(%rbp), %rdi
callq 0x13620
cmpl $0x0, %eax
je 0x12db7
jmp 0x12d26
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x12d58
movl $0x3, %edi
leaq 0x238c5(%rip), %rsi     # 0x36603
leaq 0x2356c(%rip), %rdx     # 0x362b1
movl $0x35b, %ecx            # imm = 0x35B
leaq 0x2350f(%rip), %r8      # 0x36260
movb $0x0, %al
callq 0x243b0
jmp 0x12d5a
jmp 0x12d5c
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rcx
movq -0x38(%rbp), %rax
movq 0x30(%rax), %rax
movq %rcx, (%rax)
movq -0x38(%rbp), %rax
movq 0x30(%rax), %rcx
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rdi
addq $0x68, %rdi
movq -0x38(%rbp), %rsi
addq $0x38, %rsi
callq 0x3b90
movq -0x30(%rbp), %rax
movl 0x78(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x78(%rax)
movq -0x38(%rbp), %rdi
callq 0x13910
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x12dbe
movl $0x0, -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_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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rdi
callq 0x1fdc0
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 $0x28, %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 0x12e3c
jmp 0x12eca
jmp 0x12e3e
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rcx
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rcx
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x12e95
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rcx
movq 0x20(%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 0x13910
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 $0x28, %rcx
subq %rcx, %rax
addq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x12e1f
movq -0x10(%rbp), %rax
movq 0x120(%rax), %rdi
callq 0x3460
movq -0x10(%rbp), %rax
movq 0x128(%rax), %rdi
callq 0x3460
movq -0x10(%rbp), %rax
movq 0x148(%rax), %rdi
callq 0x3460
movq -0x10(%rbp), %rax
movq 0x1e0(%rax), %rdi
callq 0x3460
movq -0x10(%rbp), %rax
movq 0x278(%rax), %rdi
callq 0x3460
movq -0x10(%rbp), %rax
movq 0x310(%rax), %rdi
callq 0x3460
movq -0x10(%rbp), %rdi
callq 0x3460
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl $0x80, %edi
callq 0x34d0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x132a0
jmp 0x1325f
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x13291
movl $0x3, %edi
leaq 0x2338c(%rip), %rsi     # 0x36603
leaq 0x22ff5(%rip), %rdx     # 0x36273
movl $0x54, %ecx
leaq 0x23c0d(%rip), %r8      # 0x36e97
movb $0x0, %al
callq 0x243b0
jmp 0x13293
movq $0x0, -0x8(%rbp)
jmp 0x13350
movq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x80, %edx
callq 0x3200
movq -0x10(%rbp), %rdi
callq 0x139a0
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, 0x18(%rax)
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x30(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/channel_doh.c
// Function: new_req_id
static uint16_t new_req_id(channel_doh_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 0x139e9
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 0x139ac
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_doh.c
// Function: doh_http_query
static int doh_http_query(channel_req_t* rq, subnet_t* subnet)
{
	channel_doh_t* c = rq->ctx;
	http_request_t* req;
	int r;

	req = doh_build_post_request(rq, subnet);
	if (!req) {
		loge("doh_build_post_request() error\n");
		return -1;
	}

	req = c->post
		? doh_build_post_request(rq, subnet)
		: doh_build_get_request(rq, subnet);
	if (!req) {
		loge("%s error\n",
			c->post
			? "doh_build_post_request()"
			: "doh_build_get_request()");
		return -1;
	}

	r = http_send(c->http, &c->http_addr, c->use_proxy, req, c->timeout, http_cb, rq);
	if (r) {
		loge("http_send() error\n");
		free(http_request_get_data(req, NULL));
		http_request_destroy(req);
		return -1;
	}

	return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x13c20
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x13ac6
jmp 0x13a86
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x13ab8
movl $0x3, %edi
leaq 0x22b65(%rip), %rsi     # 0x36603
leaq 0x22c66(%rip), %rdx     # 0x3670b
movl $0x2f2, %ecx            # imm = 0x2F2
leaq 0x22c69(%rip), %r8      # 0x3671a
movb $0x0, %al
callq 0x243b0
jmp 0x13aba
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x13c16
movq -0x20(%rbp), %rax
cmpl $0x0, 0x88(%rax)
je 0x13ae6
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x13c20
movq %rax, -0x38(%rbp)
jmp 0x13af7
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x140c0
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x13b67
jmp 0x13b08
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x13b59
movq -0x20(%rbp), %rax
movl 0x88(%rax), %ecx
leaq 0x22965(%rip), %r9      # 0x3648a
leaq 0x22945(%rip), %rax     # 0x36471
cmpl $0x0, %ecx
cmovneq %rax, %r9
movl $0x3, %edi
leaq 0x22ac4(%rip), %rsi     # 0x36603
leaq 0x22bc5(%rip), %rdx     # 0x3670b
movl $0x2fd, %ecx            # imm = 0x2FD
leaq 0x22915(%rip), %r8      # 0x36467
movb $0x0, %al
callq 0x243b0
jmp 0x13b5b
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x13c16
movq -0x20(%rbp), %rax
movq 0x80(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x90, %rsi
movq -0x20(%rbp), %rax
movl 0x134(%rax), %edx
movq -0x28(%rbp), %rcx
movq -0x20(%rbp), %rax
movl 0x13c(%rax), %r8d
movq -0x10(%rbp), %rax
leaq 0x9bf(%rip), %r9        # 0x14560
movq %rax, (%rsp)
callq 0x20000
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x13c10
jmp 0x13bb5
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x13be7
movl $0x3, %edi
leaq 0x22a36(%rip), %rsi     # 0x36603
leaq 0x22b37(%rip), %rdx     # 0x3670b
movl $0x303, %ecx            # imm = 0x303
leaq 0x228c2(%rip), %r8      # 0x364a2
movb $0x0, %al
callq 0x243b0
jmp 0x13be9
movq -0x28(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1ea10
movq %rax, %rdi
callq 0x3460
movq -0x28(%rbp), %rdi
callq 0x1e4b0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x13c16
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/channel_doh.c
// Function: build_request_nsmsg
static int build_request_nsmsg(ns_msg_t* msg, channel_req_t* req)
{
	init_ns_msg(msg);

	msg->id = req->req_id;
	msg->flags = req->flags;
	msg->qdcount = 1;
	msg->qrs = ns_qr_clone(&req->qr, 1);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x270f0
movq -0x10(%rbp), %rax
movw (%rax), %cx
movq -0x8(%rbp), %rax
movw %cx, (%rax)
movq -0x10(%rbp), %rax
movw 0x4(%rax), %cx
movq -0x8(%rbp), %rax
movw %cx, 0x2(%rax)
movq -0x8(%rbp), %rax
movw $0x1, 0x4(%rax)
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0x271c0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/channel_doh.c
// Function: choose_best_nsmsg
static ns_msg_t* choose_best_nsmsg(channel_req_t* rq)
{
	channel_doh_t* c = rq->ctx;
	ns_msg_t* best = NULL;

	if (rq->result_num == 0) {
		best = NULL;
	}
	else if (rq->result_num == 1) {
		best = rq->results[0];
	}
	else if (!c->chnr) {
		best = rq->results[0];
	}
	else {
		int i, flags;
		ns_msg_t* msg;
		int have_ip, chn_ecs, chn_ip, black;

		for (i = 0; i < rq->result_num; i++) {
			msg = rq->results[i];
			flags = get_nsmsg_flags(c, msg);

			black = flags & FLG_BLACKLIST;                /* In blacklist? */
			have_ip = flags & (FLG_A | FLG_AAAA);         /* Have IP? */
			chn_ecs = flags & FLG_ECS_CHN;                /* ECS is China? */
			chn_ip = flags & (FLG_A_CHN | FLG_AAAA_CHN);  /* Result is China? */

			if (black) {
				continue;
			}

			if (have_ip && chn_ecs && chn_ip) {
				best = msg;
				break;
			}
			else if (!chn_ecs) {
				best = msg;
			}
		}

		if (!best) {
			/* The last one result is preferred */
			best = rq->results[rq->result_num - 1];
		}
	}

	if (loglevel > LOG_DEBUG) {
		print_all_answers(rq, best);
	}

	return best;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x70(%rax)
jne 0x149f7
movq $0x0, -0x18(%rbp)
jmp 0x14b05
movq -0x8(%rbp), %rax
cmpl $0x1, 0x70(%rax)
jne 0x14a15
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x14b03
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x14a34
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x14b01
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x70(%rcx), %eax
jge 0x14adb
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x14b90
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
andl $0x1000, %eax           # imm = 0x1000
movl %eax, -0x38(%rbp)
movl -0x20(%rbp), %eax
andl $0x12, %eax
movl %eax, -0x2c(%rbp)
movl -0x20(%rbp), %eax
andl $0x400, %eax            # imm = 0x400
movl %eax, -0x30(%rbp)
movl -0x20(%rbp), %eax
andl $0x24, %eax
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x38(%rbp)
je 0x14a9f
jmp 0x14acd
cmpl $0x0, -0x2c(%rbp)
je 0x14abb
cmpl $0x0, -0x30(%rbp)
je 0x14abb
cmpl $0x0, -0x34(%rbp)
je 0x14abb
movq -0x28(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x14adb
cmpl $0x0, -0x30(%rbp)
jne 0x14ac9
movq -0x28(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x14acb
jmp 0x14acd
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x14a3b
cmpq $0x0, -0x18(%rbp)
jne 0x14aff
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
movq -0x8(%rbp), %rcx
movl 0x70(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
jmp 0x14b01
jmp 0x14b03
jmp 0x14b05
movb $0x0, %al
callq 0x242d0
cmpl $0x7, (%rax)
jle 0x14b1e
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x14c70
movq -0x18(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movzwl 0x6(%rax), %eax
movq -0x10(%rbp), %rcx
movzwl 0x8(%rcx), %ecx
addl %ecx, %eax
movl %eax, -0x18(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x14c03
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x14(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x14f10
orl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x14bc3
movq -0x10(%rbp), %rax
movzwl 0x6(%rax), %eax
movq -0x10(%rbp), %rcx
movzwl 0x8(%rcx), %ecx
addl %ecx, %eax
movq -0x10(%rbp), %rcx
movzwl 0xa(%rcx), %ecx
addl %ecx, %eax
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x14c62
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x14(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x14f10
orl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x14c22
movl -0x1c(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movl %r9d, -0x34(%rbp)
movl $0x58, %edi
callq 0x34d0
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x151c3
jmp 0x15183
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x151b5
movl $0x3, %edi
leaq 0x2160f(%rip), %rsi     # 0x367aa
leaq 0x21619(%rip), %rdx     # 0x367bb
movl $0x6b, %ecx
leaq 0x21ce9(%rip), %r8      # 0x36e97
movb $0x0, %al
callq 0x243b0
jmp 0x151b7
movl $0x3, -0x4(%rbp)
jmp 0x15272
movq -0x40(%rbp), %rdi
xorl %esi, %esi
movl $0x58, %edx
callq 0x3200
movq -0x18(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0x34(%rbp), %ecx
movq -0x40(%rbp), %rax
movl %ecx, 0x18(%rax)
movq 0x10(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x20(%rax)
movq 0x18(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x28(%rax)
movq 0x20(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x40(%rbp), %rax
leaq 0x51(%rip), %rcx        # 0x15280
movq %rcx, 0x30(%rax)
movq -0x40(%rbp), %rax
leaq 0x62(%rip), %rcx        # 0x152a0
movq %rcx, 0x38(%rax)
movq -0x40(%rbp), %rax
leaq 0x73(%rip), %rcx        # 0x152c0
movq %rcx, 0x40(%rax)
movq -0x40(%rbp), %rax
leaq 0x394(%rip), %rcx       # 0x155f0
movq %rcx, 0x48(%rax)
movq -0x40(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/channel_tcp.c
// Function: req_new
static tcpreq_t* req_new(
	channel_tcp_t* ctx,
	const ns_msg_t* msg,
	channel_query_cb callback,
	void* state)
{
	tcpreq_t* req;

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

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

	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->ctx = ctx;

	dllist_init(&req->conns);

	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 $0x60, %edi
callq 0x34d0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x15890
jmp 0x1584f
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x15881
movl $0x3, %edi
leaq 0x20fc9(%rip), %rsi     # 0x36830
leaq 0x20a07(%rip), %rdx     # 0x36275
movl $0x8b, %ecx
leaq 0x2161d(%rip), %r8      # 0x36e97
movb $0x0, %al
callq 0x243b0
jmp 0x15883
movq $0x0, -0x8(%rbp)
jmp 0x15949
movq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x60, %edx
callq 0x3200
movq -0x18(%rbp), %rax
movw (%rax), %cx
movq -0x30(%rbp), %rax
movw %cx, (%rax)
movq -0x18(%rbp), %rax
movw 0x2(%rax), %cx
movq -0x30(%rbp), %rax
movw %cx, 0x2(%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 -0x10(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x30(%rbp), %rcx
addq $0x48, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x30(%rbp), %rcx
addq $0x48, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x30(%rbp), %rdi
callq 0x16620
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_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 %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 0x15c21
jmp 0x15c99
jmp 0x15c23
jmp 0x15c25
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rcx
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rcx
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x48(%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x40(%rax)
movq -0x20(%rbp), %rdi
callq 0x16ae0
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 0x15c07
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3460
movq -0x8(%rbp), %rdi
callq 0x3460
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)