LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/GangZhuo[P]dohclient/src/channel_cache.c
// Function: cache_create
int cache_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)
{
	cache_t* ctx;

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

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

	dllist_init(&ctx->items);
	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) {
		struct cb_querystring_state_t st[1] = {{
			.ctx = ctx, .override = FALSE,
		}};
		if (parse_querystring(args, cb_querystring, st)) {
			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
subq $0x28, %rsp
movl %r9d, %ebp
movq %r8, %r12
movq %rcx, %r13
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, 0x8(%rsp)
movl $0x78, %edi
callq 0x34b0
testq %rax, %rax
je 0x9a78
movq %rax, %r15
movq 0x70(%rsp), %rax
movq 0x68(%rsp), %rcx
movq 0x60(%rsp), %rdx
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%r15)
movups %xmm0, 0x60(%r15)
movups %xmm0, (%r15)
movups %xmm0, 0x10(%r15)
movups %xmm0, 0x20(%r15)
movups %xmm0, 0x30(%r15)
movups %xmm0, 0x40(%r15)
movq %r15, %rsi
addq $0x58, %rsi
movq %rsi, 0x58(%r15)
movq %rsi, 0x60(%r15)
movq $0x0, 0x68(%r15)
leaq 0x102(%rip), %rsi       # 0x9ac0
movq %rsi, 0x70(%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 0xe1(%rip), %rax        # 0x9ac5
movq %rax, 0x30(%r15)
leaq 0xd9(%rip), %rax        # 0x9ac8
movq %rax, 0x38(%r15)
leaq 0x18e(%rip), %rax       # 0x9b88
movq %rax, 0x40(%r15)
leaq 0x258(%rip), %rax       # 0x9c5d
movq %rax, 0x48(%r15)
testq %rbx, %rbx
je 0x9a6c
leaq 0x10(%rsp), %rdx
movq %r15, (%rdx)
movl $0x0, 0x8(%rdx)
leaq 0x285(%rip), %rsi       # 0x9ca9
movq %rbx, %rdi
callq 0x1e826
testl %eax, %eax
je 0x9a6c
xorl %eax, %eax
callq 0x17d59
cmpl $0x3, (%rax)
jl 0x9a65
leaq 0x18bd9(%rip), %rsi     # 0x2261c
leaq 0x18e86(%rip), %rdx     # 0x228d0
leaq 0x18e8c(%rip), %r8      # 0x228dd
movl $0x3, %edi
movl $0x2b3, %ecx            # imm = 0x2B3
movq %rbx, %r9
xorl %eax, %eax
callq 0x17d92
movl $0x2, %ebx
jmp 0x9aaf
movq 0x8(%rsp), %rax
movq %r15, (%rax)
xorl %ebx, %ebx
jmp 0x9aaf
xorl %eax, %eax
callq 0x17d59
movl $0x3, %ebx
cmpl $0x3, (%rax)
jl 0x9aaf
leaq 0x18b8c(%rip), %rsi     # 0x2261c
leaq 0x18e39(%rip), %rdx     # 0x228d0
leaq 0x19e05(%rip), %r8      # 0x238a3
movl $0x3, %edi
movl $0x298, %ecx            # imm = 0x298
xorl %eax, %eax
callq 0x17d92
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/GangZhuo[P]dohclient/src/channel_cache.c
// Function: step
static int step(channel_t* ctx,
	fd_set* readset, fd_set* writeset, fd_set* errorset)
{
	cache_t* c = (cache_t*)ctx;
	if (c->conf->cache_timeout != CACHE_TIMEOUT_NEVEL_EXPIRE) {
		cache_check_expire(c);
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x8(%rdi), %rax
cmpl $0x0, 0x8c(%rax)
je 0x9b77
movq %rdi, %rbx
xorl %edi, %edi
callq 0x3310
leaq 0x58(%rbx), %r15
movq 0x58(%rbx), %r12
cmpq %r15, %r12
je 0x9b77
movq %rax, %r14
addq $0x68, %rbx
cmpq %r14, 0x18(%r12)
jg 0x9b77
leaq -0x28(%r12), %rbp
movq (%r12), %r13
xorl %eax, %eax
callq 0x17d59
cmpl $0x6, (%rax)
jl 0x9b48
movq (%rbp), %r9
movl $0x6, %edi
leaq 0x18aee(%rip), %rsi     # 0x2261c
leaq 0x18e38(%rip), %rdx     # 0x2296d
movl $0x5e, %ecx
leaq 0x18e3f(%rip), %r8      # 0x22980
xorl %eax, %eax
callq 0x17d92
movq (%r12), %rax
movq 0x8(%r12), %rcx
movq %rax, (%rcx)
movq (%r12), %rax
movq %rcx, 0x8(%rax)
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x3946
movq %rbp, %rdi
callq 0x87db
movq %r13, %r12
cmpq %r15, %r13
jne 0x9b02
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/GangZhuo[P]dohclient/src/channel_cache.c
// Function: query
static int query(channel_t* ctx,
	const ns_msg_t* msg,
	channel_query_cb callback, void* state)
{
	cache_t* c = (cache_t*)ctx;
	const char* key;
	struct rbnode_t* rbn;
	cache_item_t* item;

	key = msg_key(msg);

	rbn = rbtree_lookup(&c->dic, key);
	if (!rbn) {
		goto error;
	}

	item = rbtree_container_of(rbn, cache_item_t, node);

	logi("hit cache: %s - %s\n", key, msg_answers(item->msg));

	if (callback)
		callback(ctx, 0, item->msg, TRUE, TRUE, state);

	return 0;

error:
	if (callback)
		callback(ctx, -1, NULL, TRUE, FALSE, state);

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r14
movq %rdx, %rbx
movq %rdi, %r15
testq %rsi, %rsi
je 0x9bbd
cmpw $0x0, 0x4(%rsi)
je 0x9bbd
movq 0x10(%rsi), %rdi
testq %rdi, %rdi
je 0x9bbd
callq 0x1a29d
movq %rax, %r12
jmp 0x9bc0
xorl %r12d, %r12d
leaq 0x68(%r15), %rdi
movq %r12, %rsi
callq 0x390c
testq %rax, %rax
je 0x9c31
movq %rax, %r13
xorl %eax, %eax
callq 0x17d59
cmpl $0x6, (%rax)
jl 0x9c16
movq 0x38(%r13), %rdi
callq 0x1a4f0
movq %rax, (%rsp)
leaq 0x18a28(%rip), %rsi     # 0x2261c
leaq 0x190e0(%rip), %rdx     # 0x22cdb
leaq 0x18d92(%rip), %r8      # 0x22994
movl $0x6, %edi
movl $0x99, %ecx
movq %r12, %r9
xorl %eax, %eax
callq 0x17d92
testq %rbx, %rbx
je 0x9c4d
movq 0x38(%r13), %rdx
movq %r15, %rdi
xorl %esi, %esi
movl $0x1, %ecx
movl $0x1, %r8d
jmp 0x9c48
testq %rbx, %rbx
je 0x9c4d
movq %r15, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
movl $0x1, %ecx
xorl %r8d, %r8d
movq %r14, %r9
callq *%rbx
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/GangZhuo[P]dohclient/src/channel_cache.c
// Function: destroy
static void destroy(channel_t* ctx)
{
	cache_t* c = (cache_t*)ctx;
	dlitem_t* cur, * nxt;
	cache_item_t* item;
	dllist_foreach(&c->items, cur, nxt,
		cache_item_t, item, entry) {
		dllist_remove(&item->entry);
		cache_item_destroy(item);
	}
	c->dic.root = NULL;
	free(ctx);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x58(%rdi), %r14
movq 0x58(%rdi), %rax
cmpq %r14, %rax
je 0x9c94
leaq -0x28(%rax), %rdi
movq (%rax), %r15
movq 0x8(%rax), %rcx
movq %r15, (%rcx)
movq (%rax), %rax
movq %rcx, 0x8(%rax)
callq 0x87db
movq %r15, %rax
cmpq %r14, %r15
jne 0x9c72
movq $0x0, 0x68(%rbx)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x3450
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x48, %edi
callq 0x34b0
testq %rax, %rax
je 0x9d3e
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq $0x0, 0x40(%rax)
movq %r15, %rdi
callq 0x1a070
movq %rax, 0x38(%rbx)
testq %rax, %rax
je 0x9d6f
movq %r14, %rdi
callq 0x3610
movq %rax, (%rbx)
jmp 0x9da5
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x17d59
cmpl $0x3, (%rax)
jl 0x9da5
leaq 0x188c9(%rip), %rsi     # 0x2261c
leaq 0x18c04(%rip), %rdx     # 0x2295e
leaq 0x19b42(%rip), %r8      # 0x238a3
xorl %ebx, %ebx
movl $0x3, %edi
movl $0x27, %ecx
jmp 0x9d9e
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x17d59
cmpl $0x3, (%rax)
jl 0x9da5
leaq 0x18898(%rip), %rsi     # 0x2261c
leaq 0x18bd3(%rip), %rdx     # 0x2295e
leaq 0x18944(%rip), %r8      # 0x226d6
xorl %ebx, %ebx
movl $0x3, %edi
movl $0x2f, %ecx
xorl %eax, %eax
callq 0x17d92
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/GangZhuo[P]dohclient/src/channel_chndoh.c
// Function: fdset
static sock_t fdset(channel_t* ctx,
	fd_set* readset, fd_set* writeset, fd_set* errorset)
{
	channel_chndoh_t* c = (channel_chndoh_t*)ctx;
	sock_t maxfd = 0, fd;

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

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

	return maxfd;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
cmpl $0x1, 0x630(%rdi)
movq 0x638(%rdi), %rdi
jne 0xa77a
testq %rdi, %rdi
je 0xa793
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x154d6
jmp 0xa78b
testq %rdi, %rdi
je 0xa793
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq *0x30(%rdi)
testl %eax, %eax
js 0xa7d7
movl %eax, %ebx
jmp 0xa795
xorl %ebx, %ebx
cmpl $0x1, 0xc00(%r13)
movq 0xc08(%r13), %rdi
jne 0xa7bb
testq %rdi, %rdi
je 0xa7dc
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x154d6
jmp 0xa7cc
testq %rdi, %rdi
je 0xa7dc
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq *0x30(%rdi)
testl %eax, %eax
js 0xa7d7
cmpl %eax, %ebx
cmovgl %ebx, %eax
jmp 0xa7de
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/GangZhuo[P]dohclient/src/channel_chndoh.c
// Function: step
static int step(channel_t* ctx,
	fd_set* readset, fd_set* writeset, fd_set* errorset)
{
	channel_chndoh_t* c = (channel_chndoh_t*)ctx;
	int r;

	if (is_auto_relolve(&c->chndoh)) {
		query_doh_addr(c, &c->chndoh);
	}

	if (is_auto_relolve(&c->frndoh)) {
		query_doh_addr(c, &c->frndoh);
	}

	if (c->chndoh.channel == CH_DOH) {
		if (c->chndoh.http) {
			http_step(c->chndoh.http, readset, writeset, errorset);
		}
	}
	else if (c->chndoh.chctx) {
		r = c->chndoh.chctx->step(c->chndoh.chctx, readset, writeset, errorset);
		if (r) return -1;
	}

	if (c->frndoh.channel == CH_DOH) {
		if (c->frndoh.http) {
			http_step(c->frndoh.http, readset, writeset, errorset);
		}
	}
	else if (c->frndoh.chctx) {
		r = c->frndoh.chctx->step(c->frndoh.chctx, readset, writeset, errorset);
		if (r) return -1;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
cmpl $0x1, 0x630(%rdi)
jne 0xa836
cmpl $0x0, 0x648(%r12)
je 0xa836
leaq 0x80(%r12), %r13
movq (%r13), %rbp
xorl %edi, %edi
callq 0x3310
cmpq %rax, %rbp
jge 0xa836
movq %r12, %rdi
movq %r13, %rsi
callq 0xaf4a
cmpl $0x1, 0xc00(%r12)
jne 0xa86f
cmpl $0x0, 0xc18(%r12)
je 0xa86f
leaq 0x650(%r12), %r13
movq (%r13), %rbp
xorl %edi, %edi
callq 0x3310
cmpq %rax, %rbp
jge 0xa86f
movq %r12, %rdi
movq %r13, %rsi
callq 0xaf4a
cmpl $0x1, 0x630(%r12)
movq 0x638(%r12), %rdi
jne 0xa897
testq %rdi, %rdi
je 0xa8b3
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x15549
jmp 0xa8b3
testq %rdi, %rdi
je 0xa8b3
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq *0x38(%rdi)
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0xa8f9
cmpl $0x1, 0xc00(%r12)
movq 0xc08(%r12), %rdi
jne 0xa8db
testq %rdi, %rdi
je 0xa8f7
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x15549
jmp 0xa8f7
testq %rdi, %rdi
je 0xa8f7
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq *0x38(%rdi)
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0xa8f9
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
cmpl $0x7531, 0x78(%rdi)     # imm = 0x7531
jl 0xa95a
xorl %eax, %eax
callq 0x17d59
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x3, (%rax)
jl 0xaa14
leaq 0x18072(%rip), %rsi     # 0x229a8
leaq 0x1839e(%rip), %rdx     # 0x22cdb
leaq 0x18686(%rip), %r8      # 0x22fca
movl $0x3, %edi
movl $0x3fa, %ecx            # imm = 0x3FA
xorl %eax, %eax
callq 0x17d92
jmp 0xaa14
movq %rdi, %r14
callq 0xb0d6
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0xaa14
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 0xb381
testl %eax, %eax
je 0xaa12
xorl %eax, %eax
callq 0x17d59
cmpl $0x3, (%rax)
jl 0xa9e6
leaq 0x17fe1(%rip), %rsi     # 0x229a8
leaq 0x1830d(%rip), %rdx     # 0x22cdb
leaq 0x182b5(%rip), %r8      # 0x22c8a
movl $0x3, %edi
movl $0x407, %ecx            # imm = 0x407
xorl %eax, %eax
callq 0x17d92
movq 0x28(%r15), %rax
movq 0x30(%r15), %rcx
movq %rax, (%rcx)
movq 0x28(%r15), %rax
movq %rcx, 0x8(%rax)
movq %r12, %rdi
movq %r13, %rsi
callq 0x3946
decl 0x78(%r14)
movq %r15, %rdi
callq 0xb481
jmp 0xaa14
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/GangZhuo[P]dohclient/src/channel_chndoh.c
// Function: destroy
static void destroy(channel_t* ctx)
{
	channel_chndoh_t* c = (channel_chndoh_t*)ctx;
	dlitem_t* cur, * nxt;
	channel_req_t* req;

	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->chndoh.name);
	free(c->chndoh.addrstr);
	free(c->chndoh.host);
	free(c->chndoh.path);
	free(c->chndoh.net.name);
	free(c->chndoh.net6.name);
	if (c->chndoh.channel == CH_DOH && c->chndoh.http) {
		http_destroy(c->chndoh.http);
		c->chndoh.http = NULL;
	}
	else if (c->chndoh.chctx) {
		c->chndoh.chctx->destroy(c->chndoh.chctx);
		c->chndoh.chctx = NULL;
	}

	free(c->frndoh.name);
	free(c->frndoh.addrstr);
	free(c->frndoh.host);
	free(c->frndoh.path);
	free(c->frndoh.net.name);
	free(c->frndoh.net6.name);
	if (c->frndoh.channel == CH_DOH && c->frndoh.http) {
		http_destroy(c->frndoh.http);
		c->frndoh.http = NULL;
	}
	else if (c->frndoh.chctx) {
		c->frndoh.chctx->destroy(c->frndoh.chctx);
		c->frndoh.chctx = NULL;
	}

	free(c);
}

// 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 0xaa7b
movq (%r14), %r12
movq 0x8(%r14), %rax
movq %r12, (%rax)
movq (%r14), %rcx
movq %rax, 0x8(%rcx)
movq -0x10(%r14), %rax
testq %rax, %rax
je 0xaa67
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 0xb481
movq %r12, %r14
cmpq %r15, %r12
jne 0xaa38
movq 0x4d0(%rbx), %rdi
callq 0x3450
movq 0x4d8(%rbx), %rdi
callq 0x3450
movq 0x4e0(%rbx), %rdi
callq 0x3450
movq 0x4e8(%rbx), %rdi
callq 0x3450
movq 0x508(%rbx), %rdi
callq 0x3450
movq 0x5a0(%rbx), %rdi
callq 0x3450
cmpl $0x1, 0x630(%rbx)
jne 0xaae6
movq 0x638(%rbx), %rdi
testq %rdi, %rdi
je 0xaae6
leaq 0x638(%rbx), %r14
callq 0x15440
jmp 0xaafc
movq 0x638(%rbx), %rdi
testq %rdi, %rdi
je 0xab03
leaq 0x638(%rbx), %r14
callq *0x48(%rdi)
movq $0x0, (%r14)
movq 0xaa0(%rbx), %rdi
callq 0x3450
movq 0xaa8(%rbx), %rdi
callq 0x3450
movq 0xab0(%rbx), %rdi
callq 0x3450
movq 0xab8(%rbx), %rdi
callq 0x3450
movq 0xad8(%rbx), %rdi
callq 0x3450
movq 0xb70(%rbx), %rdi
callq 0x3450
cmpl $0x1, 0xc00(%rbx)
jne 0xab6e
movq 0xc08(%rbx), %rdi
testq %rdi, %rdi
je 0xab6e
leaq 0xc08(%rbx), %r14
callq 0x15440
jmp 0xab84
movq 0xc08(%rbx), %rdi
testq %rdi, %rdi
je 0xab8b
leaq 0xc08(%rbx), %r14
callq *0x48(%rdi)
movq $0x0, (%r14)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3450
// File: /workspace/github_c_makefile_star2_O1/GangZhuo[P]dohclient/src/channel_chndoh.c
// Function: create_upstream_chctx
static int create_upstream_chctx(doh_server_t* doh, channel_chndoh_t* c)
{
	if (doh->channel == CH_UDP) {
		char args[2048];
		int n;
		n = snprintf(args, sizeof(args),
			"upstream=%s&proxy=%d&timeout=%d",
			doh->addrstr,
			doh->use_proxy,
			doh->timeout);
		if (n <= 0 || n >= sizeof(args))
			return -1;
		doh->query = channel_udp_query;
		return channel_udp_create(&doh->chctx,
			"udp", args,
			c->conf,
			c->proxies,
			c->proxy_num,
			c->chnr,
			c->blacklist,
			doh);
	}
	else if (doh->channel == CH_TCP) {
		char args[2048];
		int n;
		n = snprintf(args, sizeof(args),
			"upstream=%s&proxy=%d&timeout=%d",
			doh->addrstr,
			doh->use_proxy,
			doh->timeout);
		if (n <= 0 || n >= sizeof(args))
			return -1;
		doh->query = channel_tcp_query;
		return channel_tcp_create(&doh->chctx,
			"tcp", args,
			c->conf,
			c->proxies,
			c->proxy_num,
			c->chnr,
			c->blacklist,
			doh);
	}
	else if (doh->channel == CH_DOH) {
		doh->http = http_create(
			c->proxies,
			c->proxy_num,
			doh->keep_alive);
		if (!doh->http)
			return -1;
		return 0;
	}
	return -1;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x828, %rsp            # imm = 0x828
movq %rsi, %r14
movq %rdi, %rbx
movl 0x5b0(%rdi), %ecx
cmpl $0x1, %ecx
je 0xace9
cmpl $0x3, %ecx
je 0xac62
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $0x2, %ecx
jne 0xad0e
movq 0x458(%rbx), %rcx
movl 0x474(%rbx), %r8d
movl 0x47c(%rbx), %r9d
leaq 0x183f1(%rip), %rdx     # 0x22fe1
leaq 0x20(%rsp), %rdi
movl $0x800, %esi            # imm = 0x800
xorl %eax, %eax
callq 0x3590
movl %eax, %ecx
addl $0xfffff800, %ecx       # imm = 0xFFFFF800
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $0xfffff801, %ecx       # imm = 0xFFFFF801
jb 0xad0e
leaq 0x5e63(%rip), %rax      # 0x10a84
movq %rax, 0x5c0(%rbx)
movq 0x8(%r14), %rcx
movq 0x10(%r14), %r8
movl 0x18(%r14), %r9d
movups 0x20(%r14), %xmm0
movq %rbx, 0x10(%rsp)
addq $0x5b8, %rbx            # imm = 0x5B8
movups %xmm0, (%rsp)
leaq 0x179b7(%rip), %rsi     # 0x22607
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
callq 0x10eec
jmp 0xad0e
movq 0x458(%rbx), %rcx
movl 0x474(%rbx), %r8d
movl 0x47c(%rbx), %r9d
leaq 0x18363(%rip), %rdx     # 0x22fe1
leaq 0x20(%rsp), %rdi
movl $0x800, %esi            # imm = 0x800
xorl %eax, %eax
callq 0x3590
movl %eax, %ecx
addl $0xfffff800, %ecx       # imm = 0xFFFFF800
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $0xfffff801, %ecx       # imm = 0xFFFFF801
jb 0xad0e
leaq 0x3e1d(%rip), %rax      # 0xeac8
movq %rax, 0x5c0(%rbx)
movq 0x8(%r14), %rcx
movq 0x10(%r14), %r8
movl 0x18(%r14), %r9d
movups 0x20(%r14), %xmm0
movq %rbx, 0x10(%rsp)
addq $0x5b8, %rbx            # imm = 0x5B8
movups %xmm0, (%rsp)
leaq 0x17931(%rip), %rsi     # 0x2260b
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
callq 0xf269
jmp 0xad0e
movq 0x10(%r14), %rdi
movl 0x18(%r14), %esi
movl 0x470(%rbx), %edx
callq 0x1534b
movq %rax, %rcx
movq %rax, 0x5b8(%rbx)
xorl %eax, %eax
cmpq $0x1, %rcx
sbbl %eax, %eax
addq $0x828, %rsp            # imm = 0x828
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x1b97d
testl %eax, %eax
je 0xad76
xorl %eax, %eax
callq 0x17d59
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x3, (%rax)
jl 0xad94
leaq 0x17c56(%rip), %rsi     # 0x229a8
leaq 0x19f4d(%rip), %rdx     # 0x24ca6
leaq 0x17ead(%rip), %r8      # 0x22c0d
movl $0x3, %edi
movl $0x41d, %ecx            # imm = 0x41D
movq %rbx, %r9
xorl %eax, %eax
callq 0x17d92
jmp 0xad94
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_O1/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 0x19833(%rip), %rsi     # 0x245e0
movl $0x88, %edx
callq 0x33a0
testl %eax, %eax
je 0xae2f
cmpl $0x1, 0x5b0(%r14)
jne 0xadf7
movq 0x460(%r14), %rax
testq %rax, %rax
je 0xae68
cmpb $0x0, (%rax)
je 0xae68
movq 0x468(%r14), %rax
testq %rax, %rax
je 0xaf09
cmpb $0x0, (%rax)
je 0xaf09
cmpl $0x0, 0x47c(%r14)
jle 0xaea1
movl 0x470(%r14), %eax
testl %eax, %eax
js 0xaed7
xorl %ebx, %ebx
cmpl $0x1, %eax
jne 0xaf40
movl $0x4b0, 0x470(%r14) # imm = 0x4B0
jmp 0xaf40
xorl %eax, %eax
callq 0x17d59
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x3, (%rax)
jl 0xaf40
leaq 0x17b5d(%rip), %rsi     # 0x229a8
leaq 0x17dce(%rip), %rdx     # 0x22c20
leaq 0x17dd8(%rip), %r8      # 0x22c31
movl $0x3, %edi
movl $0x4d1, %ecx            # imm = 0x4D1
jmp 0xaf39
xorl %eax, %eax
callq 0x17d59
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x3, (%rax)
jl 0xaf40
leaq 0x17b24(%rip), %rsi     # 0x229a8
leaq 0x17d95(%rip), %rdx     # 0x22c20
leaq 0x17daa(%rip), %r8      # 0x22c3c
movl $0x3, %edi
movl $0x4d6, %ecx            # imm = 0x4D6
jmp 0xaf39
xorl %eax, %eax
callq 0x17d59
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x3, (%rax)
jl 0xaf40
leaq 0x17aeb(%rip), %rsi     # 0x229a8
leaq 0x17d5c(%rip), %rdx     # 0x22c20
leaq 0x17d87(%rip), %r8      # 0x22c52
movl $0x3, %edi
movl $0x4df, %ecx            # imm = 0x4DF
jmp 0xaf39
xorl %eax, %eax
callq 0x17d59
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x3, (%rax)
jl 0xaf40
leaq 0x17ab9(%rip), %rsi     # 0x229a8
leaq 0x17d2a(%rip), %rdx     # 0x22c20
leaq 0x17d68(%rip), %r8      # 0x22c65
movl $0x3, %edi
movl $0x4e3, %ecx            # imm = 0x4E3
jmp 0xaf39
xorl %eax, %eax
callq 0x17d59
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x3, (%rax)
jl 0xaf40
leaq 0x17a87(%rip), %rsi     # 0x229a8
leaq 0x17cf8(%rip), %rdx     # 0x22c20
leaq 0x17d18(%rip), %r8      # 0x22c47
movl $0x3, %edi
movl $0x4da, %ecx            # imm = 0x4DA
xorl %eax, %eax
callq 0x17d92
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x19b12
movw $0x0, (%r12)
movq %r12, %rdi
callq 0x19a68
orl $0x120, %eax            # imm = 0x120
leaq 0xe(%rsp), %rsi
movw %ax, (%rsi)
movq %r12, %rdi
callq 0x19ac1
movw $0x1, 0x4(%r12)
movl $0x10, %edi
callq 0x34b0
movq %rax, 0x10(%r12)
testq %rax, %rax
je 0xb0c8
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 0x1fc(%rip), %rdx       # 0xb202
leaq 0x10(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rcx
callq 0xb0d6
movq %rax, %r14
movq %r15, %rdi
callq 0x1a1dd
testq %r14, %r14
je 0xb0c8
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 0xb381
testl %eax, %eax
je 0xb0c8
xorl %eax, %eax
callq 0x17d59
cmpl $0x3, (%rax)
jl 0xb09f
leaq 0x17928(%rip), %rsi     # 0x229a8
leaq 0x17bf4(%rip), %rdx     # 0x22c7b
leaq 0x17bfc(%rip), %r8      # 0x22c8a
movl $0x3, %edi
movl $0x139, %ecx            # imm = 0x139
xorl %eax, %eax
callq 0x17d92
movq 0x28(%r14), %rax
movq 0x30(%r14), %rcx
movq %rax, (%rcx)
movq 0x28(%r14), %rax
movq %rcx, 0x8(%rax)
movq %r15, %rdi
movq %r12, %rsi
callq 0x3946
decl 0x78(%rbx)
movq %r14, %rdi
callq 0xb481
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 $0x88, %edi
callq 0x34b0
testq %rax, %rax
je 0xb1ba
movq %rax, %rbx
movq %r14, 0x10(%rsp)
movl $0x88, %edx
movq %rax, %rdi
xorl %esi, %esi
callq 0x31e0
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 0xb123
movq %rbp, %rdi
movq %r14, %rsi
callq 0x390c
testq %rax, %rax
jne 0xb123
movzwl 0xe(%rsp), %eax
movw %ax, (%rbx)
movzwl (%r13), %eax
movw %ax, 0x2(%rbx)
movzwl 0x2(%r13), %eax
movw %ax, 0x4(%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 0x19a24
movq %rax, 0x80(%rbx)
jmp 0xb1f0
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x17d59
cmpl $0x3, (%rax)
jl 0xb1f0
leaq 0x177d9(%rip), %rsi     # 0x229a8
leaq 0x17ac7(%rip), %rdx     # 0x22c9d
leaq 0x186c6(%rip), %r8      # 0x238a3
xorl %ebx, %ebx
movl $0x3, %edi
movl $0x78, %ecx
xorl %eax, %eax
callq 0x17d92
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_O1/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, %r14
movq 0x60(%rdi), %rbx
cmpl $0x0, 0xc00(%rbx)
je 0xb3e5
leaq 0x650(%rbx), %rsi
movq %r14, %rdi
callq 0xb4da
testl %eax, %eax
je 0xb3e1
xorl %eax, %eax
callq 0x17d59
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x3, (%rax)
jl 0xb477
leaq 0x175e4(%rip), %rsi     # 0x229a8
leaq 0x1790c(%rip), %rdx     # 0x22cd7
leaq 0x1790f(%rip), %r8      # 0x22ce1
movl $0x3, %edi
movl $0x3db, %ecx            # imm = 0x3DB
jmp 0xb470
incl 0x74(%r14)
cmpl $0x0, 0x630(%rbx)
je 0xb437
subq $-0x80, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0xb4da
testl %eax, %eax
je 0xb433
xorl %eax, %eax
callq 0x17d59
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x3, (%rax)
jl 0xb477
leaq 0x1758f(%rip), %rsi     # 0x229a8
leaq 0x178b7(%rip), %rdx     # 0x22cd7
leaq 0x178ba(%rip), %r8      # 0x22ce1
movl $0x3, %edi
movl $0x3e4, %ecx            # imm = 0x3E4
jmp 0xb470
incl 0x74(%r14)
xorl %ebx, %ebx
cmpl $0x0, 0x74(%r14)
jne 0xb477
xorl %eax, %eax
callq 0x17d59
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x3, (%rax)
jl 0xb477
leaq 0x17550(%rip), %rsi     # 0x229a8
leaq 0x17878(%rip), %rdx     # 0x22cd7
leaq 0x17893(%rip), %r8      # 0x22cf9
movl $0x3, %edi
movl $0x3eb, %ecx            # imm = 0x3EB
xorl %eax, %eax
callq 0x17d92
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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
cmpl $0x0, 0x70(%rdi)
jle 0xb4bb
xorl %r15d, %r15d
movq 0x68(%rbx), %rax
movq (%rax,%r15,8), %r14
testq %r14, %r14
je 0xb4af
movq %r14, %rdi
callq 0x1a1dd
movq %r14, %rdi
callq 0x3450
incq %r15
movslq 0x70(%rbx), %rax
cmpq %rax, %r15
jl 0xb492
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_O1/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, 0x4(%rsp)
movzwl 0x6(%rsi), %ecx
movzwl 0x8(%rsi), %eax
addl %ecx, %eax
je 0xc1aa
movl %eax, %r13d
shlq $0x5, %r13
xorl %r12d, %r12d
xorl %r15d, %r15d
xorl %ebp, %ebp
movq 0x18(%rbx), %rsi
addq %r15, %rsi
movq %r14, %rdi
leaq 0x4(%rsp), %rdx
callq 0xc204
orl %eax, %ebp
addq $0x20, %r15
incl %r12d
cmpq %r15, %r13
jne 0xc186
jmp 0xc1af
xorl %r12d, %r12d
xorl %ebp, %ebp
movzwl 0x6(%rbx), %eax
movzwl 0x8(%rbx), %ecx
addl %eax, %ecx
movzwl 0xa(%rbx), %eax
addl %ecx, %eax
cmpl %eax, %r12d
jae 0xc1f3
movl %r12d, %r15d
movl %eax, %r13d
movq %r15, %r12
shlq $0x5, %r12
movq 0x18(%rbx), %rsi
addq %r12, %rsi
movq %r14, %rdi
leaq 0x4(%rsp), %rdx
callq 0xc204
orl %eax, %ebp
incq %r15
addq $0x20, %r12
cmpq %r13, %r15
jb 0xc1d1
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_O1/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 0xcfc2
movq %r13, 0x10(%rsp)
xorl %edi, %edi
callq 0x3310
addq $0x3c, %rax
movq %rax, 0x118(%r12)
leaq 0x18(%rsp), %rbp
movq %rbp, %rdi
callq 0x19b12
movw $0x0, (%rbp)
movq %rbp, %rdi
callq 0x19a68
orl $0x120, %eax            # imm = 0x120
leaq 0xe(%rsp), %rsi
movw %ax, (%rsi)
movq %rbp, %rdi
callq 0x19ac1
movw $0x1, 0x4(%rbp)
movl $0x10, %edi
callq 0x34b0
movq %rax, 0x10(%rbp)
testq %rax, %rax
je 0xcfbd
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 0x483(%rip), %rdx       # 0xd376
leaq 0x18(%rsp), %rbx
movq %r12, %rdi
movq %rbx, %rsi
movq %r12, %rcx
callq 0xd245
movq %rax, %r13
movq %rbx, %rdi
callq 0x1a1dd
testq %r13, %r13
je 0xcfbd
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 0xd519
testl %eax, %eax
je 0xcfbd
xorl %eax, %eax
callq 0x17d59
cmpl $0x3, (%rax)
jl 0xcf92
leaq 0x1608e(%rip), %rsi     # 0x23001
leaq 0x16154(%rip), %rdx     # 0x230ce
leaq 0x15d09(%rip), %r8      # 0x22c8a
movl $0x3, %edi
movl $0xfe, %ecx
xorl %eax, %eax
callq 0x17d92
movq 0x28(%r13), %rax
movq 0x30(%r13), %rcx
movq %rax, (%rcx)
movq 0x28(%r13), %rax
movq %rcx, 0x8(%rax)
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x3946
decl 0x78(%r12)
movq %r13, %rdi
callq 0xd73d
movq 0x10(%rsp), %r13
movq 0x80(%r12), %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r13, %rcx
callq 0x15549
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_O1/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 0xd03b
xorl %eax, %eax
callq 0x17d59
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x3, (%rax)
jl 0xd0f5
leaq 0x15fea(%rip), %rsi     # 0x23001
leaq 0x15cbd(%rip), %rdx     # 0x22cdb
leaq 0x15fa5(%rip), %r8      # 0x22fca
movl $0x3, %edi
movl $0x34e, %ecx            # imm = 0x34E
xorl %eax, %eax
callq 0x17d92
jmp 0xd0f5
movq %rdi, %r14
callq 0xd245
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0xd0f5
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 0xd519
testl %eax, %eax
je 0xd0f3
xorl %eax, %eax
callq 0x17d59
cmpl $0x3, (%rax)
jl 0xd0c7
leaq 0x15f59(%rip), %rsi     # 0x23001
leaq 0x15c2c(%rip), %rdx     # 0x22cdb
leaq 0x15bd4(%rip), %r8      # 0x22c8a
movl $0x3, %edi
movl $0x35b, %ecx            # imm = 0x35B
xorl %eax, %eax
callq 0x17d92
movq 0x28(%r15), %rax
movq 0x30(%r15), %rcx
movq %rax, (%rcx)
movq 0x28(%r15), %rax
movq %rcx, 0x8(%rax)
movq %r12, %rdi
movq %r13, %rsi
callq 0x3946
decl 0x78(%r14)
movq %r15, %rdi
callq 0xd73d
jmp 0xd0f5
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x15440
leaq 0x58(%rbx), %r15
movq 0x58(%rbx), %r14
cmpq %r15, %r14
je 0xd168
movq (%r14), %r12
movq 0x8(%r14), %rax
movq %r12, (%rax)
movq (%r14), %rcx
movq %rax, 0x8(%rcx)
movq -0x10(%r14), %rax
testq %rax, %rax
je 0xd154
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 0xd73d
movq %r12, %r14
cmpq %r15, %r12
jne 0xd125
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_O1/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 $0x80, %edi
callq 0x34b0
testq %rax, %rax
je 0xd32e
movq %rax, %rbx
movq %r14, 0x10(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x70(%rax)
movups %xmm0, 0x60(%rax)
movups %xmm0, 0x50(%rax)
movups %xmm0, 0x40(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
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 0xd2a5
movq %rbp, %rdi
movq %r14, %rsi
callq 0x390c
testq %rax, %rax
jne 0xd2a5
movzwl 0xe(%rsp), %eax
movw %ax, (%rbx)
movzwl (%r13), %eax
movw %ax, 0x2(%rbx)
movzwl 0x2(%r13), %eax
movw %ax, 0x4(%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 0xd364
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x17d59
cmpl $0x3, (%rax)
jl 0xd364
leaq 0x15cbe(%rip), %rsi     # 0x23001
leaq 0x15953(%rip), %rdx     # 0x22c9d
leaq 0x16552(%rip), %r8      # 0x238a3
xorl %ebx, %ebx
movl $0x3, %edi
movl $0x54, %ecx
xorl %eax, %eax
callq 0x17d92
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_O1/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
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movzwl 0x6(%rsi), %ecx
movzwl 0x8(%rsi), %eax
addl %ecx, %eax
je 0xe5b5
movl %eax, %r12d
shlq $0x5, %r12
xorl %r13d, %r13d
xorl %r15d, %r15d
xorl %ebp, %ebp
movq 0x18(%rbx), %rsi
addq %r13, %rsi
movq %r14, %rdi
movl %r15d, %edx
callq 0xe60d
orl %eax, %ebp
incl %r15d
addq $0x20, %r13
cmpq %r13, %r12
jne 0xe593
jmp 0xe5ba
xorl %r15d, %r15d
xorl %ebp, %ebp
movzwl 0x6(%rbx), %eax
movzwl 0x8(%rbx), %ecx
addl %eax, %ecx
movzwl 0xa(%rbx), %eax
addl %ecx, %eax
cmpl %eax, %r15d
jae 0xe5fc
movl %r15d, %r15d
movl %eax, %r12d
movq %r15, %r13
shlq $0x5, %r13
movq 0x18(%rbx), %rsi
addq %r13, %rsi
movq %r14, %rdi
movl %r15d, %edx
callq 0xe60d
orl %eax, %ebp
incq %r15
addq $0x20, %r13
cmpq %r12, %r15
jb 0xe5dc
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_O1/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 $0x58, %edi
callq 0x34b0
testq %rax, %rax
je 0xe820
movq 0x40(%rsp), %rcx
movq 0x38(%rsp), %rdx
movq 0x30(%rsp), %rsi
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x40(%rax)
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        # 0xe862
movq %rcx, 0x30(%rax)
leaq 0x66(%rip), %rcx        # 0xe865
movq %rcx, 0x38(%rax)
leaq 0x5e(%rip), %rcx        # 0xe868
movq %rcx, 0x40(%rax)
leaq 0x2ab(%rip), %rcx       # 0xeac0
movq %rcx, 0x48(%rax)
movq %rax, (%rbx)
xorl %ebx, %ebx
jmp 0xe857
xorl %eax, %eax
callq 0x17d59
movl $0x3, %ebx
cmpl $0x3, (%rax)
jl 0xe857
leaq 0x14970(%rip), %rsi     # 0x231a8
leaq 0x1497a(%rip), %rdx     # 0x231b9
leaq 0x1505d(%rip), %r8      # 0x238a3
movl $0x3, %edi
movl $0x6b, %ecx
xorl %eax, %eax
callq 0x17d92
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xf24f
leaq -0x40(%r14), %r15
movq (%r14), %r13
movq 0x8(%r14), %rax
movq %r13, (%rax)
movq (%r14), %rcx
movq %rax, 0x8(%rcx)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movq %r15, %rdi
callq 0x19891
addq $0x30, %r14
movq %r14, %rdi
callq 0x1d5f9
movq %r15, %rdi
callq 0x3450
movq %r13, %r14
cmpq %r12, %r13
jne 0xf20f
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_O1/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 0xf73a
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 0xf723
movq 0x18(%r11), %r14
addq $0x18, %r11
xorl %ebp, %ebp
cmpq %r11, %r14
je 0xf71e
movq %r14, %r15
movq (%r14), %r14
movl -0x8(%r15), %ecx
movl %ecx, %r12d
andl $-0x5, %r12d
cmpl $0x9, %r12d
je 0xf655
cmpl $0x2, %ecx
jne 0xf69b
cmpl $0x0, 0x28(%r15)
jne 0xf69b
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 0xf629
cmpl $0xc, %ecx
ja 0xf629
btl %ecx, %r9d
jb 0xf6e8
btl %ecx, %r10d
jb 0xf6b5
cmpl $0x1, %ecx
jne 0xf629
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 0xf695
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 0xf695
cmpl %ebp, %eax
cmovlel %ebp, %eax
movq %rbx, %r11
cmpq %rdi, %rbx
jne 0xf611
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq