LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_typename
const char *ns_typename(uint16_t type)
{
	static char num[20] = {0};
    switch (type) {
        case NS_QTYPE_A		: return "A";
        case NS_QTYPE_NS	: return "NS";
        case NS_QTYPE_MD	: return "MD";	
        case NS_QTYPE_MF	: return "MF";	
        case NS_QTYPE_CNAME	: return "CNAME";
        case NS_QTYPE_SOA	: return "SOA";
        case NS_QTYPE_MB	: return "MB";	
        case NS_QTYPE_MG	: return "MG";	
        case NS_QTYPE_MR	: return "MR";	
        case NS_QTYPE_NULL	: return "NULL";
        case NS_QTYPE_WKS	: return "WKS";
        case NS_QTYPE_PTR	: return "PTR";
        case NS_QTYPE_HINFO	: return "HINFO";
        case NS_QTYPE_MINFO	: return "MINFO";
        case NS_QTYPE_MX	: return "MX";	
        case NS_QTYPE_TXT	: return "TXT";
        case NS_QTYPE_AAAA	: return "AAAA";
        case NS_QTYPE_OPT	: return "OPT";
        case NS_QTYPE_AXFR	: return "AXFR";
        case NS_QTYPE_MAILB	: return "MAILB";
        case NS_QTYPE_MAILA	: return "MAILA";
        case NS_QTYPE_ANY	: return "ANY";
        default:
			snprintf(num, sizeof(num) - 1, "QTYPE(%d)", (int)type);
			return num;
    }

}

// Assembly:
pushq %rbx
leal -0x1(%rdi), %eax
cmpl $0x28, %eax
ja 0x19c72
leaq 0xade3(%rip), %rcx      # 0x24a40
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x9163(%rip), %rbx      # 0x22dd0
jmp 0x19d7f
leal -0xfc(%rdi), %eax
cmpl $0x3, %eax
ja 0x19c99
leaq 0xae60(%rip), %rcx      # 0x24ae4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xb236(%rip), %rbx      # 0x24eca
jmp 0x19d7f
movzwl %di, %ecx
leaq 0x13c4d(%rip), %rbx     # 0x2d8f0
leaq 0xb235(%rip), %rdx      # 0x24edf
movl $0x13, %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3590
jmp 0x19d7f
leaq 0xb201(%rip), %rbx      # 0x24ec6
jmp 0x19d7f
leaq 0xb1c2(%rip), %rbx      # 0x24e93
jmp 0x19d7f
leaq 0xb1bc(%rip), %rbx      # 0x24e99
jmp 0x19d7f
leaq 0xb1d0(%rip), %rbx      # 0x24eb9
jmp 0x19d7f
leaq 0xb1b6(%rip), %rbx      # 0x24eab
jmp 0x19d7f
leaq 0xb18c(%rip), %rbx      # 0x24e8d
jmp 0x19d7f
leaq 0xb186(%rip), %rbx      # 0x24e90
jmp 0x19d7f
leaq 0xb18a(%rip), %rbx      # 0x24e9d
jmp 0x19d7f
leaq 0x80b4(%rip), %rbx      # 0x21dd0
jmp 0x19d7f
leaq 0xb17b(%rip), %rbx      # 0x24ea0
jmp 0x19d7f
leaq 0x909f(%rip), %rbx      # 0x22dcd
jmp 0x19d7f
leaq 0xb16c(%rip), %rbx      # 0x24ea3
jmp 0x19d7f
leaq 0xb16f(%rip), %rbx      # 0x24eaf
jmp 0x19d7f
leaq 0xb15d(%rip), %rbx      # 0x24ea6
jmp 0x19d7f
leaq 0xb161(%rip), %rbx      # 0x24eb3
jmp 0x19d7f
leaq 0xb167(%rip), %rbx      # 0x24ec2
jmp 0x19d7f
leaq 0xb15b(%rip), %rbx      # 0x24ebf
jmp 0x19d7f
leaq 0xb168(%rip), %rbx      # 0x24ed5
jmp 0x19d7f
leaq 0xb165(%rip), %rbx      # 0x24edb
jmp 0x19d7f
leaq 0xb150(%rip), %rbx      # 0x24ecf
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_classname
const char *ns_classname(uint16_t cls)
{
	static char num[20] = {0};
    switch (cls) {
        case NS_QCLASS_IN: return "IN";
        case NS_QCLASS_CS: return "CS";
        case NS_QCLASS_CH: return "CH";
        case NS_QCLASS_HS: return "HS";
        case NS_QCLASS_ANY:return "ANY";
        default:
			snprintf(num, sizeof(num) - 1, "QCLASS(%d)", (int)cls);
			return num;
    }
}

// Assembly:
pushq %rbx
leal -0x1(%rdi), %eax
cmpl $0x3, %eax
ja 0x19da6
leaq 0xad60(%rip), %rcx      # 0x24af4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xb145(%rip), %rbx      # 0x24ee9
jmp 0x19df2
cmpl $0xff, %edi
jne 0x19db7
leaq 0xb126(%rip), %rbx      # 0x24edb
jmp 0x19df2
movzwl %di, %ecx
leaq 0x13b4f(%rip), %rbx     # 0x2d910
leaq 0xb127(%rip), %rdx      # 0x24eef
movl $0x13, %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3590
jmp 0x19df2
leaq 0x805c(%rip), %rbx      # 0x21e3c
jmp 0x19df2
leaq 0xb103(%rip), %rbx      # 0x24eec
jmp 0x19df2
leaq 0x9002(%rip), %rbx      # 0x22df4
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_find_rr
ns_rr_t *ns_find_rr(ns_msg_t *msg, int type)
{
	int i, rrcount;
	ns_rr_t *rr;

	rrcount = ns_rrcount(msg);
	for (i = rrcount - 1; i >= 0; i--) {
		rr = msg->rrs + i;
		if (rr->type == type) {
			return rr;
		}
	}

	return NULL;
}

// Assembly:
movzwl 0x6(%rdi), %eax
movzwl 0x8(%rdi), %edx
addq %rax, %rdx
movzwl 0xa(%rdi), %ecx
addq %rdx, %rcx
xorl %eax, %eax
testq %rcx, %rcx
jle 0x1ada7
decq %rcx
movq 0x18(%rdi), %rdx
movq %rcx, %r8
shlq $0x5, %r8
movzwl 0x8(%rdx,%r8), %r9d
cmpl %esi, %r9d
jne 0x1ad83
addq %r8, %rdx
movq %rdx, %rax
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_remove_rr
int ns_remove_rr(ns_msg_t* msg, ns_rr_t *rr)
{
	int i, rrcount;
	ns_rr_t* p;

	rrcount = ns_rrcount(msg);
	for (i = rrcount - 1; i >= 0; i--) {
		p = msg->rrs + i;
		if (p == rr) {
			ns_rdata_free_opts(rr);
			free(rr->rdata);
			memmove(msg->rrs + i, msg->rrs + i + 1,
				(rrcount - i - 1) * sizeof(ns_rr_t));
			msg->arcount--;
			return 0;
		}
	}

	return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movzwl 0x6(%rdi), %eax
movzwl 0x8(%rdi), %ecx
addl %eax, %ecx
movzwl 0xa(%rdi), %r12d
addl %ecx, %r12d
leaq 0x1(%r12), %rax
shll $0x5, %r12d
movq $-0x20, %r15
decq %rax
jle 0x1ae23
addq $0x20, %r15
addq $-0x20, %r12
movq 0x18(%rbx), %rcx
addq %r12, %rcx
cmpq %r14, %rcx
jne 0x1add8
movq 0x18(%r14), %rdi
callq 0x1ae34
movq 0x18(%r14), %rdi
callq 0x3450
movq 0x18(%rbx), %rax
leaq (%rax,%r12), %rdi
leaq (%rax,%r12), %rsi
addq $0x20, %rsi
movq %r15, %rdx
callq 0x35a0
decw 0xa(%rbx)
xorl %eax, %eax
jmp 0x1ae28
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_rdata_free_opts
static void ns_rdata_free_opts(ns_rr_t *rr)
{
	ns_optlist_t *opts = rr->rdata;
    ns_opt_t *opt;
    
	if (opts != NULL && opts->opts != NULL) {
        int i;
        for (i = 0; i < opts->optcount; i++) {
            opt = opts->opts + i;
            ns_free_opt(opt);
        }
        free(opts->opts);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x1ae89
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x1ae89
movl 0x8(%rbx), %eax
testl %eax, %eax
jle 0x1ae7f
movl $0x8, %r14d
xorl %r15d, %r15d
movq (%rbx), %rcx
testq %rcx, %rcx
je 0x1ae6d
movq (%rcx,%r14), %rdi
callq 0x3450
movl 0x8(%rbx), %eax
incq %r15
movslq %eax, %rcx
addq $0x10, %r14
cmpq %rcx, %r15
jl 0x1ae59
movq (%rbx), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x3450
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_add_optrr
ns_rr_t *ns_add_optrr(ns_msg_t *msg)
{
    ns_rr_t *rr, *rrs;

    rrs = realloc(msg->rrs, ((int)ns_rrcount(msg) + 1) * sizeof(ns_rr_t));
    if (rrs == NULL) {
        loge("alloc\n");
        return NULL;
    }
    msg->rrs = rrs;
    rr = msg->rrs + ns_rrcount(msg);
    msg->arcount++;
    memset(rr, 0, sizeof(ns_rr_t));
    rr->type = NS_TYPE_OPT;
    rr->cls = NS_PAYLOAD_SIZE;
    rr->ttl = (NS_EDNS_VERSION << 16) & 0xFF0000;
    return rr;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movzwl 0x6(%rbx), %eax
movzwl 0x8(%rbx), %ecx
addl %eax, %ecx
movzwl 0xa(%rbx), %esi
addl %ecx, %esi
shll $0x5, %esi
addq $0x20, %rsi
callq 0x35b0
testq %rax, %rax
je 0x1aefc
movq %rax, 0x18(%rbx)
movzwl 0x6(%rbx), %ecx
movzwl 0x8(%rbx), %edx
movzwl 0xa(%rbx), %esi
shll $0x5, %ecx
shll $0x5, %edx
addq %rcx, %rdx
addq %rax, %rdx
movl %esi, %eax
shll $0x5, %eax
leaq (%rdx,%rax), %r14
incl %esi
movw %si, 0xa(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rax,%rdx)
movups %xmm0, 0x10(%rax,%rdx)
movl $0x4000029, 0x8(%rax,%rdx) # imm = 0x4000029
jmp 0x1af34
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x176e5
cmpl $0x3, (%rax)
jl 0x1af34
leaq 0x9cd2(%rip), %rsi      # 0x24be4
leaq 0x9d89(%rip), %rdx      # 0x24ca2
leaq 0x8993(%rip), %r8       # 0x238b3
xorl %r14d, %r14d
movl $0x3, %edi
movl $0x416, %ecx            # imm = 0x416
xorl %eax, %eax
callq 0x1771e
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_remove_optrr
int ns_remove_optrr(ns_msg_t *msg)
{
    int i, rrcount;
    ns_rr_t *rr;

    rrcount = ns_rrcount(msg);
    for (i = rrcount - 1; i >= 0; i--) {
        rr = msg->rrs + i;
        if (rr->type == NS_TYPE_OPT) {
            break;
        }
    }
    if (i >= 0) {
        ns_rdata_free_opts(rr);
        free(rr->rdata);
        memmove(msg->rrs + i, msg->rrs + i + 1,
                (rrcount - i - 1) * sizeof(ns_rr_t));
        msg->arcount--;
        return 0;
    }
    return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movzwl 0x6(%rdi), %eax
movzwl 0x8(%rdi), %ecx
addl %eax, %ecx
movzwl 0xa(%rdi), %eax
addl %ecx, %eax
movl %eax, %ecx
shll $0x5, %ecx
movl $0x20, %edx
movq %rax, %r15
leaq (%rcx,%rdx), %rsi
cmpq $0x20, %rsi
je 0x1afcf
decq %r15
movq 0x18(%rbx), %r12
leaq (%r12,%rcx), %rsi
leaq -0x20(%rdx), %r14
cmpw $0x29, -0x38(%rdx,%rsi)
movq %r14, %rdx
jne 0x1af67
shll $0x5, %eax
addq %rax, %r12
movq -0x8(%r14,%r12), %rdi
callq 0x1ae34
movq -0x8(%r14,%r12), %rdi
callq 0x3450
movq 0x18(%rbx), %rax
movl %r15d, %ecx
shlq $0x5, %rcx
leaq (%rax,%rcx), %rdi
leaq (%rax,%rcx), %rsi
addq $0x20, %rsi
negq %r14
movq %r14, %rdx
callq 0x35a0
decw 0xa(%rbx)
xorl %eax, %eax
jmp 0x1afd4
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_optrr_find_opt
ns_opt_t *ns_optrr_find_opt(ns_rr_t *rr, uint16_t code)
{
	ns_optlist_t *opts = rr->rdata;
    ns_opt_t *opt;
    int i;
    if (opts != NULL) {
        for (i = 0; i < opts->optcount; i++) {
            opt = opts->opts + i;
            if (opt->code == code) {
                return opt;
            }
        }
    }
    return NULL;
}

// Assembly:
movq 0x18(%rdi), %rax
testq %rax, %rax
je 0x1b003
movslq 0x8(%rax), %rcx
testq %rcx, %rcx
jle 0x1b003
movq (%rax), %rax
cmpw %si, (%rax)
je 0x1b005
addq $0x10, %rax
decq %rcx
jne 0x1aff5
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_optrr_remove_opt
int ns_optrr_remove_opt(ns_rr_t *rr, uint16_t code)
{
	ns_optlist_t *opts = rr->rdata;
    ns_opt_t *opt;
    int i;
    if (opts != NULL) {
        for (i = 0; i < opts->optcount; i++) {
            opt = opts->opts + i;
			if (opt->code != code)
				continue;
			ns_free_opt(opt);
			memmove(opts->opts + i, opts->opts + i + 1,
				(opts->optcount - i - 1) * sizeof(ns_opt_t));
			opts->optcount--;
			return 0;
		}
    }
    return -1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq 0x18(%rdi), %rbx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %rbx, %rbx
je 0x1b073
movslq 0x8(%rbx), %rcx
testq %rcx, %rcx
jle 0x1b073
movq (%rbx), %rdx
shlq $0x4, %rcx
movl $0x1, %ebp
xorl %r14d, %r14d
cmpw %si, (%rdx,%r14)
je 0x1b044
incl %ebp
addq $0x10, %r14
cmpq %r14, %rcx
jne 0x1b030
jmp 0x1b073
movq 0x8(%rdx,%r14), %rdi
callq 0x3450
movq (%rbx), %rax
leaq (%rax,%r14), %rdi
leaq (%rax,%r14), %rsi
addq $0x10, %rsi
movl 0x8(%rbx), %eax
subl %ebp, %eax
movslq %eax, %rdx
shlq $0x4, %rdx
callq 0x35a0
decl 0x8(%rbx)
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_optrr_new_opt
ns_opt_t *ns_optrr_new_opt(ns_optlist_t *opts, int optcode)
{
	ns_opt_t *newlist, * opt;

	newlist = realloc(opts->opts, (opts->optcount + 1) * sizeof(ns_opt_t));
	if (newlist == NULL)
		return NULL;
	opts->opts = newlist;
	opt = newlist + opts->optcount;
	opts->optcount++;
	memset(opt, 0, sizeof(ns_opt_t));
	opt->code = optcode;

	return opt;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movq (%rdi), %rdi
movslq 0x8(%r14), %rsi
shlq $0x4, %rsi
addq $0x10, %rsi
callq 0x35b0
testq %rax, %rax
je 0x1b0c2
movq %rax, (%r14)
movslq 0x8(%r14), %rcx
leal 0x1(%rcx), %edx
movq %rcx, %rsi
shlq $0x4, %rsi
movq %rax, %rcx
addq %rsi, %rcx
movl %edx, 0x8(%r14)
xorps %xmm0, %xmm0
movups %xmm0, (%rax,%rsi)
movw %bx, (%rax,%rsi)
jmp 0x1b0c4
xorl %ecx, %ecx
movq %rcx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_optrr_set_opt
ns_opt_t* ns_optrr_set_opt(ns_rr_t* rr, uint16_t code, uint16_t len, const char *data)
{
	ns_optlist_t* opts = rr->rdata;
	ns_opt_t* opt;

	if (opts == NULL) {
		opts = malloc(sizeof(ns_optlist_t));
		if (opts == NULL)
			return NULL;
		memset(opts, 0, sizeof(ns_optlist_t));
		rr->rdata = opts;
	}

	opt = ns_optrr_find_opt(rr, code);

	if (opt == NULL) {
		opt = ns_optrr_new_opt(opts, code);
		if (opt == NULL)
			return NULL;
	}

	ns_free_opt(opt);

	opt->code = code;
	opt->length = len;
	opt->data = malloc(len);

	if (opt->data == NULL)
		return NULL;

	memcpy(opt->data, data, opt->length);

	return opt;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %r15
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
jne 0x1b105
movl $0x1, %edi
movl $0x10, %esi
callq 0x3240
testq %rax, %rax
je 0x1b168
movq %rax, %rdi
movq %rax, 0x18(%r15)
movslq 0x8(%rdi), %rax
testq %rax, %rax
jle 0x1b120
movq (%rdi), %r15
cmpw %r14w, (%r15)
je 0x1b131
addq $0x10, %r15
decq %rax
jne 0x1b111
movzwl %r14w, %esi
callq 0x1b078
movq %rax, %r15
testq %rax, %rax
je 0x1b168
movq 0x8(%r15), %rdi
callq 0x3450
movw %r14w, (%r15)
movw %bp, 0x2(%r15)
movzwl %bp, %r14d
movq %r14, %rdi
callq 0x34b0
movq %rax, 0x8(%r15)
testq %rax, %rax
je 0x1b168
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x32b0
jmp 0x1b16b
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_ecs_parse_subnet
int ns_ecs_parse_subnet(struct sockaddr *addr /*out*/, int *pmask /*out*/, const char *str /*in*/)
{
	char buf[INET6_ADDRSTRLEN], *sp_pos;
	int mask = -1;
	int is_ipv6;

	strncpy(buf, str, INET6_ADDRSTRLEN);
	buf[INET6_ADDRSTRLEN - 1] = '\0';

	sp_pos = strrchr(buf, '/');
	if (sp_pos) {
		*sp_pos = 0;
		mask = atoi(sp_pos + 1);
	}

	is_ipv6 = buf[0] =='[' || strchr(buf, ':');

	if (is_ipv6) {
		struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)addr;
		struct in6_addr *ip = &(addr6->sin6_addr);
		if (inet_pton(AF_INET6, buf, ip) != 1) {
			loge("invalid addr %s: errno=%d, %s\n",
				str, errno, strerror(errno));
			return -1;
		}
		addr6->sin6_family = AF_INET6;
		if (mask == -1) mask = 128;
	}
	else {
		struct sockaddr_in *addr4 = (struct sockaddr_in *)addr;
		struct in_addr *ip = &(addr4->sin_addr);
		if (inet_pton(AF_INET, buf, ip) != 1) {
			loge("invalid addr %s: errno=%d, %s\n",
				str, errno, strerror(errno));
			return -1;
		}
		addr4->sin_family = AF_INET;
		if (mask == -1) mask = 32;
	}

	*pmask = mask;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rsp, %r12
movl $0x2e, %edx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x31d0
movb $0x0, 0x2d(%r12)
movq %r12, %rdi
movl $0x2f, %esi
callq 0x33f0
testq %rax, %rax
je 0x1b1cb
movb $0x0, (%rax)
incq %rax
movq %rax, %rdi
callq 0x3570
movl %eax, %ebp
jmp 0x1b1d0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpb $0x5b, (%rsp)
je 0x1b1ec
movq %rsp, %rdi
movl $0x3a, %esi
callq 0x3150
testq %rax, %rax
je 0x1b280
leaq 0x8(%r15), %rdx
movq %rsp, %rsi
movl $0xa, %edi
callq 0x3630
cmpl $0x1, %eax
jne 0x1b21c
movl $0x80, %eax
movw $0xa, %cx
movw %cx, (%r15)
cmpl $-0x1, %ebp
cmovnel %ebp, %eax
movl %eax, (%r14)
xorl %ebp, %ebp
jmp 0x1b271
xorl %eax, %eax
callq 0x176e5
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x3, (%rax)
jl 0x1b271
callq 0x3040
movl (%rax), %r14d
movl %r14d, %edi
callq 0x3140
movq %rax, %r10
leaq 0x999d(%rip), %rsi      # 0x24be4
leaq 0x9a61(%rip), %rdx      # 0x24caf
leaq 0x9a6e(%rip), %r8       # 0x24cc3
movl $0x3, %edi
movl $0x4a7, %ecx            # imm = 0x4A7
movq %rbx, %r9
xorl %eax, %eax
pushq %r10
pushq %r14
callq 0x1771e
addq $0x10, %rsp
movl %ebp, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4(%r15), %rdx
movq %rsp, %rsi
movl $0x2, %edi
callq 0x3630
cmpl $0x1, %eax
jne 0x1b2a4
movl $0x20, %eax
movw $0x2, %cx
jmp 0x1b20b
xorl %eax, %eax
callq 0x176e5
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x3, (%rax)
jl 0x1b271
callq 0x3040
movl (%rax), %r14d
movl %r14d, %edi
callq 0x3140
movq %rax, %r10
leaq 0x9915(%rip), %rsi      # 0x24be4
leaq 0x99d9(%rip), %rdx      # 0x24caf
leaq 0x99e6(%rip), %r8       # 0x24cc3
movl $0x3, %edi
movl $0x4b2, %ecx            # imm = 0x4B2
jmp 0x1b25f
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_optrr_set_ecs
int ns_optrr_set_ecs(ns_rr_t *rr, struct sockaddr *addr, int srcprefix, int scopeprefix)
{
	ns_optlist_t *opts = rr->rdata;
	ns_opt_t *opt;

	if (opts == NULL) {
		opts = malloc(sizeof(ns_optlist_t));
        if (opts == NULL)
            return -1;
		memset(opts, 0, sizeof(ns_optlist_t));
		rr->rdata = opts;
    }

	opt = ns_optrr_find_ecs(rr);

	if (opt == NULL) {
		opt = ns_optrr_new_opt(opts, NS_OPTCODE_ECS);
		if (opt == NULL)
			return -1;
	}
    
    return ns_set_ecs(opt, addr, srcprefix, scopeprefix);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
jne 0x1b539
movl $0x1, %edi
movl $0x10, %esi
callq 0x3240
testq %rax, %rax
je 0x1b57c
movq %rax, %rdi
movq %rax, 0x18(%r15)
movslq 0x8(%rdi), %rcx
testq %rcx, %rcx
jle 0x1b554
movq (%rdi), %rax
cmpw $0x8, (%rax)
je 0x1b563
addq $0x10, %rax
decq %rcx
jne 0x1b545
movl $0x8, %esi
callq 0x1b078
testq %rax, %rax
je 0x1b57c
movq %rax, %rdi
movq %r14, %rsi
movl %ebp, %edx
movl %ebx, %ecx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1b2ec
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_write_domainname
static int ns_write_domainname(serialize_ctx *ctx, stream_t *s, char *name)
{
	if (name != NULL && strlen(name) > 0) {
		if (ctx && ctx->compression) {
			return ns_write_domainname_comp(ctx, s, name);
		}
		else {
			return ns_write_domainname_nocomp(ctx, s, name);
		}
	}
	else {

		if (stream_writei8(s, 0) != 1)
			return -1;

		return 0;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2018, %rsp           # imm = 0x2018
testq %rdx, %rdx
je 0x1b864
movb (%rdx), %cl
testb %cl, %cl
je 0x1b864
testq %rdi, %rdi
je 0x1b892
cmpl $0x0, (%rdi)
je 0x1b892
movq %rdi, (%rsp)
movq %rsi, 0x8(%rsp)
xorl %eax, %eax
testb %cl, %cl
je 0x1b9f4
movzbl %cl, %ecx
cmpl $0x2e, %ecx
je 0x1b8ae
movb 0x1(%rdx,%rax), %cl
incq %rax
jmp 0x1b84b
movq %rsi, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x1d115
xorl %ebp, %ebp
cmpl $0x1, %eax
setne %bpl
negl %ebp
movl %ebp, %eax
addq $0x2018, %rsp           # imm = 0x2018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %rdi
movq %rdx, %rsi
addq $0x2018, %rsp           # imm = 0x2018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1c814
testl %eax, %eax
je 0x1b9f4
xorl %r12d, %r12d
cmpq $0x200, %r12            # imm = 0x200
je 0x1b9f4
movq %r12, %rcx
shlq $0x4, %rcx
movq %rdx, 0x10(%rsp,%rcx)
movl %eax, 0x18(%rsp,%rcx)
incq %r12
movl %eax, %eax
addq %rax, %rdx
incq %rdx
xorl %eax, %eax
movzbl (%rdx,%rax), %ecx
testl %ecx, %ecx
je 0x1b8f9
cmpl $0x2e, %ecx
je 0x1b8f5
incq %rax
jmp 0x1b8e3
testl %eax, %eax
jne 0x1b8b9
testl %r12d, %r12d
jle 0x1b9f4
movq (%rsp), %rax
leaq 0x8(%rax), %rbx
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
leaq -0x1(%r12), %rbp
movq %rbp, %rax
shlq $0x4, %rax
leaq (%rsp,%rax), %r14
addq $0x10, %r14
movq 0x20(%rbx), %r13
testq %r13, %r13
je 0x1b94a
movq (%r14), %r15
movq (%r13), %rsi
movq %r15, %rdi
callq 0x34e0
testl %eax, %eax
je 0x1b989
movq 0x28(%r13), %r13
testq %r13, %r13
jne 0x1b931
movl $0x30, %edi
callq 0x34b0
testq %rax, %rax
je 0x1b9f4
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups (%r14), %xmm0
movups %xmm0, (%rax)
movq %rbx, 0x18(%rax)
movq 0x20(%rbx), %rcx
testq %rcx, %rcx
je 0x1b980
movq %rcx, 0x28(%rax)
movq %rax, 0x20(%rbx)
movq %rax, %rbx
jmp 0x1b98c
movq %r13, %rbx
cmpq $0x1, %r12
movq %rbp, %r12
jg 0x1b911
movq 0x8(%rsp), %r14
movq (%rsp), %r15
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl 0x10(%rbx), %esi
testl %esi, %esi
jg 0x1b9fe
movl 0xc(%r14), %eax
subl 0x4(%r15), %eax
movl %eax, 0x10(%rbx)
movl 0x8(%rbx), %esi
movq %r14, %rdi
movl $0x1, %edx
callq 0x1d115
cmpl $0x1, %eax
jne 0x1b87e
movq (%rbx), %rsi
movl 0x8(%rbx), %edx
movq %r14, %rdi
callq 0x1cf7d
cmpl 0x8(%rbx), %eax
jne 0x1b87e
movq 0x18(%rbx), %rbx
testq %rbx, %rbx
jne 0x1b9a7
jmp 0x1ba1f
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x1b87e
orl $0xc000, %esi           # imm = 0xC000
movq %r14, %rdi
movl $0x2, %edx
callq 0x1d115
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x2, %eax
jne 0x1b87e
xorl %ebp, %ebp
jmp 0x1b87e
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_parse_ect
ns_ecs_t* ns_parse_ect(ns_ecs_t *ecs, char *data, int len)
{
	int addrlen, i;
	stream_t ns = STREAM_INIT();
	ns.array = data;
	ns.cap = len;
	ns.size = len;
	ns.pos = 0;

#define check_size(n) \
        if (stream_rsize(&ns) < (n)) { \
            return NULL; \
        }

	memset(ecs, 0, sizeof(ns_ecs_t));

	check_size(2);
	ecs->family = stream_readi16(&ns);
	check_size(2);
	ecs->src_prefix_len = stream_readi8(&ns);
	ecs->scope_prefix_len = stream_readi8(&ns);

	addrlen = ecs->src_prefix_len / 8;
	if (ecs->src_prefix_len % 8)
		addrlen++;

	if (ecs->family == ADDR_FAMILY_NUM_IP) {
		if (addrlen > 4) {
			/* invalid src_prefix_len */
			return NULL;
		}
	}
	else if (ecs->family == ADDR_FAMILY_NUM_IP6) {
		if (addrlen > 16) {
			/* invalid src_prefix_len */
			return NULL;
		}
	}
	else {
		/* invalid family */
		return NULL;
	}

	check_size(addrlen);

	for (i = 0; i < addrlen; i++) {
		((uint8_t *)(&ecs->subnet))[i] = stream_readi8(&ns);
	}

#undef check_size

	return ecs;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq $0x0, 0x10(%rsp)
movq %rsi, (%rsp)
movl %edx, 0x10(%rsp)
movl %edx, 0x8(%rsp)
xorl %eax, %eax
movl %eax, 0xc(%rsp)
movl %eax, 0x10(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
cmpl $0x2, %edx
jl 0x1bd56
movq %rdi, %rbx
movq %rsp, %r14
movq %r14, %rdi
movl $0x2, %esi
callq 0x1d588
movw %ax, (%rbx)
movl 0x8(%r14), %eax
subl 0xc(%r14), %eax
cmpl $0x2, %eax
jl 0x1bd56
movq %rsp, %r14
movq %r14, %rdi
movl $0x1, %esi
callq 0x1d588
movb %al, 0x2(%rbx)
movq %r14, %rdi
movl $0x1, %esi
callq 0x1d588
movb %al, 0x3(%rbx)
movzbl 0x2(%rbx), %ecx
movl %ecx, %eax
shrl $0x3, %eax
andl $0x7, %ecx
cmpl $0x1, %ecx
sbbl $-0x1, %eax
movzwl (%rbx), %ecx
cmpl $0x2, %ecx
je 0x1bd45
cmpl $0x1, %ecx
jne 0x1bd56
cmpl $0x4, %eax
jbe 0x1bd4a
jmp 0x1bd56
cmpl $0x10, %eax
ja 0x1bd56
movl 0x8(%rsp), %ecx
subl 0xc(%rsp), %ecx
cmpl %eax, %ecx
jge 0x1bd67
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
testl %eax, %eax
je 0x1bd58
movl %eax, %r15d
xorl %r12d, %r12d
movq %rsp, %r14
movq %r14, %rdi
movl $0x1, %esi
callq 0x1d588
movb %al, 0x4(%rbx,%r12)
incq %r12
cmpq %r12, %r15
jne 0x1bd74
jmp 0x1bd58
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_read_cstring
static int ns_read_cstring(stream_t *dst, stream_t *s)
{
	int spos = s->pos, dpos = dst->pos, len;

#define do_return(r) \
	s->pos = spos; \
	dst->pos = dpos; \
	return (r);

#define check_len(n) \
	if (stream_rsize(s) < (n)) { \
		loge("truncated stream\n"); \
		do_return(-1); \
	}

	check_len(1);
	len = stream_readi8(s);

	check_len(len);
	if (stream_writess(dst, s, len) != len) {
		loge("write stream\n");
		do_return(-1);
	}

	if (stream_writei8(dst, 0) != 1) {
		loge("write stream\n");
		do_return(-1);
	}

	stream_seek(dst, -1, SEEK_CUR);


#undef check_len
#undef do_return

	return dst->pos - dpos;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl 0xc(%rsi), %r12d
movl 0xc(%rdi), %r15d
cmpl %r12d, 0x8(%rsi)
jle 0x1c6f8
movq %r14, %rdi
movl $0x1, %esi
callq 0x1d588
movl %eax, %ebp
movl 0x8(%r14), %eax
subl 0xc(%r14), %eax
cmpl %ebp, %eax
jge 0x1c740
xorl %eax, %eax
callq 0x176e5
cmpl $0x3, (%rax)
jl 0x1c72a
leaq 0x8506(%rip), %rsi      # 0x24be4
leaq 0x88ab(%rip), %rdx      # 0x24f90
leaq 0x8561(%rip), %r8       # 0x24c4d
movl $0x3, %edi
movl $0x251, %ecx            # imm = 0x251
jmp 0x1c723
xorl %eax, %eax
callq 0x176e5
cmpl $0x3, (%rax)
jl 0x1c72a
leaq 0x84d9(%rip), %rsi      # 0x24be4
leaq 0x887e(%rip), %rdx      # 0x24f90
leaq 0x8534(%rip), %r8       # 0x24c4d
movl $0x3, %edi
movl $0x24e, %ecx            # imm = 0x24E
xorl %eax, %eax
callq 0x1771e
movl %r12d, 0xc(%r14)
movl %r15d, 0xc(%rbx)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x1d05f
cmpl %ebp, %eax
jne 0x1c77f
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x1d115
cmpl $0x1, %eax
jne 0x1c7af
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x1, %edx
callq 0x1cde9
movl 0xc(%rbx), %eax
subl %r15d, %eax
jmp 0x1c737
xorl %eax, %eax
callq 0x176e5
cmpl $0x3, (%rax)
jl 0x1c72a
leaq 0x8452(%rip), %rsi      # 0x24be4
leaq 0x87f7(%rip), %rdx      # 0x24f90
leaq 0x87e2(%rip), %r8       # 0x24f82
movl $0x3, %edi
movl $0x253, %ecx            # imm = 0x253
jmp 0x1c723
xorl %eax, %eax
callq 0x176e5
cmpl $0x3, (%rax)
jl 0x1c72a
leaq 0x841e(%rip), %rsi      # 0x24be4
leaq 0x87c3(%rip), %rdx      # 0x24f90
leaq 0x87ae(%rip), %r8       # 0x24f82
movl $0x3, %edi
movl $0x258, %ecx            # imm = 0x258
jmp 0x1c723
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/ns_msg.c
// Function: free_label_childs
static void free_label_childs(label_t *label)
{
	label_t *child = label->childs, *tmp;
	while (child) {
		tmp = child;
		child = child->next;
		free_label_childs(tmp);
		free(tmp);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x20(%rdi), %rbx
testq %rbx, %rbx
je 0x1c80c
movq 0x28(%rbx), %r14
movq %rbx, %rdi
callq 0x1c7e3
movq %rbx, %rdi
callq 0x3450
movq %r14, %rbx
testq %r14, %r14
jne 0x1c7f0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_write_domainname_nocomp
static int ns_write_domainname_nocomp(serialize_ctx *ctx, stream_t *s, char *name)
{
	int i;

	i = indexof_char(name, '.');
	while (i > 0) {
		if (stream_writei8(s, i) != 1)
			return -1;
		if (stream_write(s, name, i) != i)
			return -1;
		name += i;
		name++; /* skip '.' */
		i = indexof_char(name, '.');
	}

	if (stream_writei8(s, 0) != 1)
		return -1;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
xorl %r15d, %r15d
movzbl (%r14,%r15), %eax
testl %eax, %eax
je 0x1c88d
cmpl $0x2e, %eax
je 0x1c837
incq %r15
jmp 0x1c824
testl %r15d, %r15d
je 0x1c88d
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %rbx, %rdi
movl %r15d, %esi
movl $0x1, %edx
callq 0x1d115
cmpl $0x1, %eax
jne 0x1c8a7
movq %rbx, %rdi
movq %r14, %rsi
movl %r15d, %edx
callq 0x1cf7d
cmpl %r15d, %eax
jne 0x1c8a7
movl %r15d, %eax
addq %rax, %r14
incq %r14
xorl %r15d, %r15d
movzbl (%r14,%r15), %eax
testl %eax, %eax
je 0x1c88d
cmpl $0x2e, %eax
je 0x1c888
incq %r15
jmp 0x1c875
testl %r15d, %r15d
jne 0x1c841
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x1d115
xorl %ebp, %ebp
cmpl $0x1, %eax
setne %bpl
negl %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/sha1.c
// Function: sha1_hashBlock
void sha1_hashBlock(sha1nfo *s) {
	uint8_t i;
	uint32_t a,b,c,d,e,t;

	a=s->state[0];
	b=s->state[1];
	c=s->state[2];
	d=s->state[3];
	e=s->state[4];
	for (i=0; i<80; i++) {
		if (i>=16) {
			t = s->buffer[(i+13)&15] ^ s->buffer[(i+8)&15] ^ s->buffer[(i+2)&15] ^ s->buffer[i&15];
			s->buffer[i&15] = sha1_rol32(t,1);
		}
		if (i<20) {
			t = (d ^ (b & (c ^ d))) + SHA1_K0;
		} else if (i<40) {
			t = (b ^ c ^ d) + SHA1_K20;
		} else if (i<60) {
			t = ((b & c) | (d & (b | c))) + SHA1_K40;
		} else {
			t = (b ^ c ^ d) + SHA1_K60;
		}
		t+=sha1_rol32(a,5) + e + s->buffer[i&15];
		e=d;
		d=c;
		c=sha1_rol32(b,30);
		b=a;
		a=t;
	}
	s->state[0] += a;
	s->state[1] += b;
	s->state[2] += c;
	s->state[3] += d;
	s->state[4] += e;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl 0x40(%rdi), %r8d
movl 0x44(%rdi), %esi
movl 0x48(%rdi), %edx
movl 0x4c(%rdi), %ecx
movl 0x50(%rdi), %r14d
xorl %r11d, %r11d
movl %r14d, -0x4(%rsp)
movl %ecx, %r15d
movl %edx, %r13d
movl %esi, %ebp
movl %r8d, %r12d
movl %r12d, %eax
movl %ebp, %ebx
movl %r13d, %r10d
movl %r15d, %r9d
movq %r11, %r15
cmpl $0x10, %r11d
jb 0x1c9bc
leal 0xd(%r11), %r12d
andl $0xf, %r12d
movl %r11d, %r15d
andl $0xf, %r15d
movl %r15d, %r13d
xorl $0x8, %r13d
movl (%rdi,%r13,4), %ebp
xorl (%rdi,%r12,4), %ebp
leal 0x2(%r11), %r12d
andl $0xf, %r12d
xorl (%rdi,%r12,4), %ebp
xorl (%rdi,%r15,4), %ebp
roll %ebp
movl %ebp, (%rdi,%r15,4)
cmpl $0x13, %r11d
ja 0x1c9fe
movl %r9d, %r12d
xorl %r10d, %r12d
andl %ebx, %r12d
xorl %r9d, %r12d
addl $0x5a827999, %r12d      # imm = 0x5A827999
movl %eax, %ebp
roll $0x5, %ebp
addl %ebp, %r14d
addl %r12d, %r14d
movl %r14d, %r12d
addl (%rdi,%r15,4), %r12d
roll $0x1e, %ebx
incq %r11
movl %r9d, %r14d
movl %r10d, %r15d
movl %ebx, %r13d
movl %eax, %ebp
cmpl $0x50, %r11d
jne 0x1c96e
jmp 0x1ca48
cmpl $0x27, %r11d
ja 0x1ca16
movl %r9d, %r12d
xorl %r10d, %r12d
xorl %ebx, %r12d
addl $0x6ed9eba1, %r12d      # imm = 0x6ED9EBA1
jmp 0x1c9cf
cmpl $0x3b, %r11d
ja 0x1ca36
movl %r10d, %ebp
andl %ebx, %ebp
movl %r10d, %r12d
orl %ebx, %r12d
andl %r9d, %r12d
orl %ebp, %r12d
addl $0x8f1bbcdc, %r12d      # imm = 0x8F1BBCDC
jmp 0x1c9cf
movl %r9d, %r12d
xorl %r10d, %r12d
xorl %ebx, %r12d
addl $0xca62c1d6, %r12d      # imm = 0xCA62C1D6
jmp 0x1c9cf
addl %r8d, %r12d
movl %r12d, 0x40(%rdi)
addl %esi, %eax
movl %eax, 0x44(%rdi)
addl %edx, %ebx
movl %ebx, 0x48(%rdi)
addl %ecx, %r10d
movl %r10d, 0x4c(%rdi)
addl -0x4(%rsp), %r9d
movl %r9d, 0x50(%rdi)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/sha1.c
// Function: sha1_addUncounted
void sha1_addUncounted(sha1nfo *s, uint8_t data) {
	uint8_t * const b = (uint8_t*) s->buffer;
	if (big_endian)
		b[s->bufferOffset] = data;
	else
		b[s->bufferOffset ^ 3] = data;
	s->bufferOffset++;
	if (s->bufferOffset == BLOCK_LENGTH) {
		sha1_hashBlock(s);
		s->bufferOffset = 0;
	}
}

// Assembly:
movl 0x58(%rdi), %eax
movl %eax, %ecx
xorb $0x3, %cl
movzbl %cl, %ecx
cmpb $0x0, 0x1130a(%rip)     # 0x2dd90
cmovel %eax, %ecx
movzbl %cl, %eax
movb %sil, (%rdi,%rax)
movb 0x58(%rdi), %al
incb %al
movb %al, 0x58(%rdi)
cmpb $0x40, %al
jne 0x1caaa
pushq %rbx
movq %rdi, %rbx
callq 0x1c940
movb $0x0, 0x58(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/sha1.c
// Function: sha1_pad
void sha1_pad(sha1nfo *s) {
	// Implement SHA-1 padding (fips180-2 Â§5.1.1)

	// Pad with 0x80 followed by 0x00 until the end of the block
	sha1_addUncounted(s, 0x80);
	while (s->bufferOffset != 56) sha1_addUncounted(s, 0x00);

	// Append length in the last 8 bytes
	sha1_addUncounted(s, 0); // We're only using 32 bit lengths
	sha1_addUncounted(s, 0); // But SHA-1 supports 64 bit lengths
	sha1_addUncounted(s, 0); // So zero pad the top bits
	sha1_addUncounted(s, s->byteCount >> 29); // Shifting to multiply by 8
	sha1_addUncounted(s, s->byteCount >> 21); // as SHA-1 supports bitstreams as well as
	sha1_addUncounted(s, s->byteCount >> 13); // byte.
	sha1_addUncounted(s, s->byteCount >> 5);
	sha1_addUncounted(s, s->byteCount << 3);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x80, %esi
callq 0x1ca74
cmpb $0x38, 0x58(%rbx)
je 0x1cb0e
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x1cafc
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1ca74
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1ca74
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1ca74
movl 0x54(%rbx), %esi
shrl $0x1d, %esi
movq %rbx, %rdi
callq 0x1ca74
movl 0x54(%rbx), %esi
shrl $0x15, %esi
movl $0xff, %ebp
andl %ebp, %esi
movq %rbx, %rdi
callq 0x1ca74
movl 0x54(%rbx), %esi
shrl $0xd, %esi
andl %ebp, %esi
movq %rbx, %rdi
callq 0x1ca74
movl 0x54(%rbx), %esi
shrl $0x5, %esi
andl %ebp, %esi
movq %rbx, %rdi
callq 0x1ca74
movb 0x54(%rbx), %al
shlb $0x3, %al
movzbl %al, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1ca74
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/sha1.c
// Function: sha1_initHmac
void sha1_initHmac(sha1nfo *s, const uint8_t* key, int keyLength) {
	uint8_t i;
	memset(s->keyBuffer, 0, BLOCK_LENGTH);
	if (keyLength > BLOCK_LENGTH) {
		// Hash long keys
		sha1_init(s);
		for (;keyLength--;) sha1_writebyte(s, *key++);
		memcpy(s->keyBuffer, sha1_result(s), HASH_LENGTH);
	} else {
		// Block length keys are used as is
		memcpy(s->keyBuffer, key, keyLength);
	}
	// Start inner hash
	sha1_init(s);
	for (i=0; i<BLOCK_LENGTH; i++) {
		sha1_writebyte(s, s->keyBuffer[i] ^ HMAC_IPAD);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x59(%rdi), %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x89(%rdi)
movups %xmm0, 0x79(%rdi)
movups %xmm0, 0x69(%rdi)
movups %xmm0, 0x59(%rdi)
cmpl $0x41, %edx
jl 0x1cc60
cmpb $0x0, 0x111a3(%rip)     # 0x2dd90
jne 0x1cbf6
movb $0x1, 0x1119a(%rip)     # 0x2dd90
leaq 0x40(%rbx), %r12
movaps 0x858f(%rip), %xmm0     # 0x25190
movups %xmm0, 0x40(%rbx)
movl $0xc3d2e1f0, %eax       # imm = 0xC3D2E1F0
movq %rax, 0x50(%rbx)
movb $0x0, 0x58(%rbx)
movl %edx, %r13d
xorl %ebp, %ebp
movzbl (%r15,%rbp), %esi
incl 0x54(%rbx)
movq %rbx, %rdi
callq 0x1ca74
incq %rbp
cmpl %ebp, %r13d
jne 0x1cc17
movq %rbx, %rdi
callq 0x1caf1
xorl %eax, %eax
movl (%r12,%rax,4), %ecx
bswapl %ecx
movl %ecx, (%r12,%rax,4)
incq %rax
cmpq $0x5, %rax
jne 0x1cc39
movl 0x10(%r12), %eax
movl %eax, 0x10(%r14)
movups (%r12), %xmm0
movups %xmm0, (%r14)
jmp 0x1cc7e
movslq %edx, %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x32b0
cmpb $0x0, 0x1111b(%rip)     # 0x2dd90
jne 0x1cc7e
movb $0x1, 0x11112(%rip)     # 0x2dd90
movaps 0x850b(%rip), %xmm0     # 0x25190
movups %xmm0, 0x40(%rbx)
movl $0xc3d2e1f0, %eax       # imm = 0xC3D2E1F0
movq %rax, 0x50(%rbx)
movb $0x0, 0x58(%rbx)
movl $0x59, %r14d
movzbl (%rbx,%r14), %esi
incl 0x54(%rbx)
xorl $0x36, %esi
movq %rbx, %rdi
callq 0x1ca74
incq %r14
cmpq $0x99, %r14
jne 0x1cc9c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/sha1.c
// Function: sha1_resultHmac
uint8_t* sha1_resultHmac(sha1nfo *s) {
	uint8_t i;
	// Complete inner hash
	memcpy(s->innerHash,sha1_result(s),HASH_LENGTH);
	// Calculate outer hash
	sha1_init(s);
	for (i=0; i<BLOCK_LENGTH; i++) sha1_writebyte(s, s->keyBuffer[i] ^ HMAC_OPAD);
	for (i=0; i<HASH_LENGTH; i++) sha1_writebyte(s, s->innerHash[i]);
	return sha1_result(s);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x99(%rdi), %r15
callq 0x1caf1
leaq 0x40(%rbx), %r14
cmpb $0x1, 0x110a7(%rip)     # 0x2dd90
jne 0x1cd12
xorl %eax, %eax
movl (%r14,%rax,4), %ecx
bswapl %ecx
movl %ecx, (%r14,%rax,4)
incq %rax
cmpq $0x5, %rax
jne 0x1cced
movl 0x10(%r14), %eax
movl %eax, 0x10(%r15)
movups (%r14), %xmm0
movups %xmm0, (%r15)
jmp 0x1cd29
movl 0x10(%r14), %eax
movl %eax, 0x10(%r15)
movups (%r14), %xmm0
movups %xmm0, (%r15)
movb $0x1, 0x11067(%rip)     # 0x2dd90
movaps 0x8460(%rip), %xmm0     # 0x25190
movups %xmm0, 0x40(%rbx)
movl $0xc3d2e1f0, %eax       # imm = 0xC3D2E1F0
movq %rax, 0x50(%rbx)
movb $0x0, 0x58(%rbx)
movl $0x59, %r15d
movzbl (%rbx,%r15), %esi
incl 0x54(%rbx)
xorl $0x5c, %esi
movq %rbx, %rdi
callq 0x1ca74
incq %r15
cmpq $0x99, %r15
jne 0x1cd47
movl $0x99, %r15d
movzbl (%rbx,%r15), %esi
incl 0x54(%rbx)
movq %rbx, %rdi
callq 0x1ca74
incq %r15
cmpq $0xad, %r15
jne 0x1cd6c
movq %rbx, %rdi
callq 0x1caf1
cmpb $0x1, 0x10ff9(%rip)     # 0x2dd90
jne 0x1cdae
xorl %eax, %eax
movl 0x40(%rbx,%rax,4), %ecx
bswapl %ecx
movl %ecx, 0x40(%rbx,%rax,4)
incq %rax
cmpq $0x5, %rax
jne 0x1cd9b
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/main.c
// Function: peer_close
static void peer_close(peer_t* peer)
{
	dlitem_t* cur, * nxt;
	req_t* req;
	dllist_remove(&peer->conn.entry);
	dllist_foreach(&peer->reqs, cur, nxt,
		req_t, req, entry_peer) {
		req_remove(req);
	}
#if DOHCLIENT_CACHE_API
	if (peer->hsctx)
		hsctx_free(peer->hsctx);
#endif
	peer_destroy(peer);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x40(%rdi), %rax
movq 0x48(%rdi), %rcx
movq %rax, (%rcx)
movq %rcx, 0x8(%rax)
leaq 0x70(%rdi), %r14
movq 0x70(%rdi), %rdi
cmpq %r14, %rdi
je 0x1fabf
movq (%rdi), %r15
addq $-0x68, %rdi
callq 0x2044b
movq %r15, %rdi
cmpq %r14, %r15
jne 0x1faab
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x19391
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/main.c
// Function: req_check_expire
static void req_check_expire(time_t now)
{
	dlitem_t* cur, * nxt;
	req_t* req;
	dllist_foreach(&reqs, cur, nxt, req_t, req, entry) {
		if (req->expire > 0 && req->expire <= now) {
			loge("request timeout (id:%d) - %s %s %s\n",
				req->id,
				ns_typename(req->msg->qrs[0].qtype),
				ns_classname(req->msg->qrs[0].qclass),
				req->msg->qrs[0].qname);
			req_remove(req);
		}
		else {
			break;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0xdc02(%rip), %r14      # 0x2d6e0
leaq 0xdbfb(%rip), %r12      # 0x2d6e0
cmpq %r12, %r14
je 0x1fb9a
movq %rdi, %rbx
movq -0x30(%r14), %rax
testq %rax, %rax
jle 0x1fb9a
cmpq %rbx, %rax
jg 0x1fb9a
movq (%r14), %r13
xorl %eax, %eax
callq 0x176e5
cmpl $0x3, (%rax)
jl 0x1fb82
movl -0x58(%r14), %ebp
movq -0x50(%r14), %rax
movq 0x10(%rax), %rax
movzwl 0x8(%rax), %edi
callq 0x19c4d
movq %rax, %r15
movq -0x50(%r14), %rax
movq 0x10(%rax), %rax
movzwl 0xa(%rax), %edi
callq 0x19d84
movq %rax, %r10
movq -0x50(%r14), %rax
movq 0x10(%rax), %r11
subq $0x8, %rsp
movl $0x3, %edi
leaq 0x587a(%rip), %rsi      # 0x253d4
leaq 0x683d(%rip), %rdx      # 0x2639e
movl $0x1a4, %ecx            # imm = 0x1A4
leaq 0x6842(%rip), %r8       # 0x263af
movl %ebp, %r9d
xorl %eax, %eax
pushq (%r11)
pushq %r10
pushq %r15
callq 0x1771e
addq $0x20, %rsp
addq $-0x58, %r14
movq %r14, %rdi
callq 0x2044b
movq %r13, %r14
cmpq %r12, %r13
jne 0x1faf1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/main.c
// Function: cache_cb
static int cache_cb(channel_t* ctx,
	int status,
	ns_msg_t* result,
	int fromcache,
	int trust,
	void* state)
{
	req_t* req = state;

	if (status || !result || result->qdcount < 1) {
		chooser_t chooser[1] = {0};
		channel_t* channel;
		int n = 0, r;
		while ((channel = choose_channel(chooser)) != NULL) {
			r = channel->query(channel, req->msg, query_cb, req);
			if (r == 0) {
				n++;
			}
		}
		if (n > 0)
			return 0;
	}
	return _query_cb(ctx, status, result, fromcache, trust, state);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r13
movq %rdx, %r14
movl %esi, %r15d
testl %esi, %esi
setne %al
testq %rdx, %rdx
sete %dl
orb %al, %dl
jne 0x1ffe5
cmpw $0x0, 0x4(%r14)
jne 0x20088
movq %rdi, 0x10(%rsp)
movl %ecx, 0x8(%rsp)
movl %r8d, 0xc(%rsp)
xorl %ebp, %ebp
leaq 0x55f(%rip), %rbx       # 0x2055b
xorl %r12d, %r12d
movl 0xd6ab(%rip), %eax      # 0x2d6b0
cmpl $0x2, %eax
je 0x20019
cmpl $0x1, %eax
jne 0x2002d
cmpl 0xe573(%rip), %ebp      # 0x2e588
jl 0x2004a
jmp 0x20075
testl %ebp, %ebp
jne 0x20075
movl 0xd6dd(%rip), %eax      # 0x2d700
incl %eax
movl %eax, 0xd6d5(%rip)      # 0x2d700
jmp 0x20041
testl %ebp, %ebp
jne 0x20075
xorl %ebp, %ebp
cmpl $0x2, 0xe54e(%rip)      # 0x2e588
jl 0x2004a
callq 0x30f0
cltd
idivl 0xe540(%rip)            # 0x2e588
movl %edx, %ebp
movq 0xe53f(%rip), %rax      # 0x2e590
movslq %ebp, %rcx
movq (%rax,%rcx,8), %rdi
testq %rdi, %rdi
je 0x20075
incl %ebp
movq 0x8(%r13), %rsi
movq %rbx, %rdx
movq %r13, %rcx
callq *0x40(%rdi)
cmpl $0x1, %eax
adcl $0x0, %r12d
jmp 0x1ffff
testl %r12d, %r12d
movl 0xc(%rsp), %r8d
movl 0x8(%rsp), %ecx
movq 0x10(%rsp), %rdi
jne 0x20093
movl %r15d, %esi
movq %r14, %rdx
callq 0x200a9
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/main.c
// Function: req_remove
static void req_remove(req_t* req)
{
	peer_t* peer;
	const char* key;
	if (req->fromtcp) {
		peer = req->from;
		dllist_remove(&req->entry_peer);
	}
	dllist_remove(&req->entry);
	key = req_key(req);
	reqdic_remove(req, key);
	logd("request removed (id:%d) - %s\n",
		req->id,
		key);
	req_destroy(req);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
cmpl $0x0, 0x24(%rdi)
je 0x2046c
movq 0x68(%rbx), %rax
movq 0x70(%rbx), %rcx
movq %rax, (%rcx)
movq %rcx, 0x8(%rax)
movq 0x58(%rbx), %rax
movq 0x60(%rbx), %rcx
movq %rax, (%rcx)
movq %rcx, 0x8(%rax)
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x2049e
cmpw $0x0, 0x4(%rax)
je 0x2049e
movq 0x10(%rax), %rdi
testq %rdi, %rdi
je 0x2049e
callq 0x19ba4
movq %rax, %r14
jmp 0x204a1
xorl %r14d, %r14d
movq 0x78(%rbx), %rax
movq 0x80(%rbx), %rsi
movq %rax, (%rsi)
movq %rsi, 0x8(%rax)
cmpq %rsi, %rax
jne 0x20511
leaq -0x38(%rsi), %r15
addq $-0x28, %rsi
leaq 0xd229(%rip), %rdi      # 0x2d6f0
callq 0x3a34
xorl %eax, %eax
callq 0x176e5
cmpl $0x7, (%rax)
jl 0x20501
movq (%r15), %r9
leaq 0x4ef2(%rip), %rsi      # 0x253d4
leaq 0x5e38(%rip), %rdx      # 0x26321
leaq 0x5e3f(%rip), %r8       # 0x2632f
movl $0x7, %edi
movl $0xfe, %ecx
xorl %eax, %eax
callq 0x1771e
movq (%r15), %rdi
callq 0x3450
movq %r15, %rdi
callq 0x3450
xorl %eax, %eax
callq 0x176e5
cmpl $0x7, (%rax)
jl 0x2054a
movl (%rbx), %r9d
movq %r14, (%rsp)
leaq 0x4ea9(%rip), %rsi      # 0x253d4
leaq 0x5dc6(%rip), %rdx      # 0x262f8
leaq 0x5dca(%rip), %r8       # 0x26303
movl $0x7, %edi
movl $0x158, %ecx            # imm = 0x158
xorl %eax, %eax
callq 0x1771e
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x13e1d
// File: /workspace/github_c_makefile_star2_O3/salextpuru[P]speccy-toochain/src/unsorted0/speclist.c
// Function: xlatline
void xlatline(int linelen)
{
int f;

for(f=0;f<linelen-1;f++)
  {
  if((linebuf[0]!=234)&&(linebuf[f]==14))
    f+=5;  /* avoid inline FP numbers - but ok for REMs */
  else
    printf("%s",charset[linebuf[f]]);
  }
printf("\n");
}

// Assembly:
cmpl $0x2, %edi
jl 0x32ab
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edi, %ebx
decl %ebx
movb 0x3626(%rip), %al       # 0x6880
leaq 0x361f(%rip), %r15      # 0x6880
leaq 0x2e08(%rip), %r12      # 0x6070
leaq 0x10dd(%rip), %r14      # 0x434c
xorl %ebp, %ebp
movslq %ebp, %rcx
movb (%rcx,%r15), %cl
cmpb $-0x16, %al
je 0x3286
cmpb $0xe, %cl
jne 0x3286
addl $0x5, %ebp
jmp 0x329d
movzbl %cl, %eax
movq (%r12,%rax,8), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x3030
movb 0x35e3(%rip), %al       # 0x6880
incl %ebp
cmpl %ebx, %ebp
jl 0x3271
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
movl $0xa, %edi
jmp 0x3070
// File: /workspace/github_c_makefile_star2_O3/salextpuru[P]speccy-toochain/src/unsorted0/speclist.c
// Function: thrashfile
void thrashfile(FILE *in)
{
int linelen,linenum,total;

total=progtotal;

getline_1(in,&linenum,&linelen,&total);
while(total>3)
  {
  printf("%4d",linenum);
  xlatline(linelen);
  getline_1(in,&linenum,&linelen,&total);
  }
printf("%4d",linenum);
xlatline(linelen);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl 0xb5b5(%rip), %eax      # 0xe880
leaq 0xc(%rsp), %r14
movl %eax, (%r14)
leaq 0x4(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %r14, %rcx
callq 0x31bc
cmpl $0x4, (%r14)
jl 0x3330
leaq 0x105d(%rip), %r14      # 0x434f
leaq 0x4(%rsp), %r15
leaq 0x8(%rsp), %r12
leaq 0xc(%rsp), %r13
movl 0x4(%rsp), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x3030
movl 0x8(%rsp), %edi
callq 0x3243
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x31bc
cmpl $0x3, 0xc(%rsp)
jg 0x3301
movl 0x4(%rsp), %esi
leaq 0x1014(%rip), %rdi      # 0x434f
xorl %eax, %eax
callq 0x3030
movl 0x8(%rsp), %edi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x3243
// File: /workspace/github_c_makefile_star2_O3/salextpuru[P]speccy-toochain/src/unsorted0/speclist.c
// Function: main
int main(int argc,char *argv[])
{
FILE *in;

if(argc!=3)
  {
  printf("Speclist - PD by RJM for improbabledesigns.\n\n");
  printf("Lists ZX Spectrum raw basic program files to stdout.\n\n");
  printf("Usage:  speclist infile prog_offset >outfile.txt\n");
  exit(1);
  }

if((in=fopen(argv[1],"rb"))==NULL)
  fprintf(stderr,"Error: couldn't open file '%s'\n",argv[1]),exit(1);

progtotal=atoi(argv[2]);
thrashfile(in);      /* process it */
fclose(in);

exit(0);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x3, %edi
jne 0x3397
movq %rsi, %rbx
movq 0x8(%rsi), %rdi
leaq 0xfe4(%rip), %rsi       # 0x4353
callq 0x3050
testq %rax, %rax
jne 0x33c5
movq 0x2c60(%rip), %rax      # 0x5fe0
movq (%rax), %rdi
movq 0x8(%rbx), %rdx
leaq 0xfc8(%rip), %rsi       # 0x4356
xorl %eax, %eax
callq 0x3080
jmp 0x33bb
leaq 0xfd8(%rip), %rdi       # 0x4376
callq 0x3090
leaq 0xff9(%rip), %rdi       # 0x43a3
callq 0x3090
leaq 0x1023(%rip), %rdi      # 0x43d9
callq 0x3090
movl $0x1, %edi
callq 0x3060
movq %rax, %r14
movq 0x10(%rbx), %rdi
callq 0x30a0
movl %eax, 0xb4a9(%rip)      # 0xe880
movq %r14, %rdi
callq 0x32b5
movq %r14, %rdi
callq 0x3040
xorl %edi, %edi
callq 0x3060
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/deps/jemalloc/src/ctl.c
// Function: ctl_init
static bool
ctl_init(void)
{
	bool ret;

	malloc_mutex_lock(&ctl_mtx);
	if (ctl_initialized == false) {
		/*
		 * Allocate space for one extra arena stats element, which
		 * contains summed stats across all arenas.
		 */
		assert(narenas_auto == narenas_total_get());
		ctl_stats.narenas = narenas_auto;
		ctl_stats.arenas = (ctl_arena_stats_t *)base_alloc(
		    (ctl_stats.narenas + 1) * sizeof(ctl_arena_stats_t));
		if (ctl_stats.arenas == NULL) {
			ret = true;
			goto label_return;
		}
		memset(ctl_stats.arenas, 0, (ctl_stats.narenas + 1) *
		    sizeof(ctl_arena_stats_t));

		/*
		 * Initialize all stats structures, regardless of whether they
		 * ever get used.  Lazy initialization would allow errors to
		 * cause inconsistent state to be viewable by the application.
		 */
		if (config_stats) {
			unsigned i;
			for (i = 0; i <= ctl_stats.narenas; i++) {
				if (ctl_arena_init(&ctl_stats.arenas[i])) {
					ret = true;
					goto label_return;
				}
			}
		}
		ctl_stats.arenas[ctl_stats.narenas].initialized = true;

		ctl_epoch = 0;
		ctl_refresh();
		ctl_initialized = true;
	}

	ret = false;
label_return:
	malloc_mutex_unlock(&ctl_mtx);
	return (ret);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
leaq 0x59943(%rip), %rdi     # 0xdf980
callq 0x1faa0
cmpb $0x0, 0x5992f(%rip)     # 0xdf978
jne 0x860e3
leaq 0x58b2a(%rip), %rax     # 0xdeb80
movl (%rax), %eax
movl %eax, 0x59992(%rip)     # 0xdf9f0
incl %eax
imulq $0x870, %rax, %rdi      # imm = 0x870
callq 0x85494
movq %rax, 0x59985(%rip)     # 0xdf9f8
movb $0x1, %bl
testq %rax, %rax
je 0x860e5
movl 0x59970(%rip), %ecx     # 0xdf9f0
incl %ecx
imulq $0x870, %rcx, %rdx      # imm = 0x870
xorl %ebp, %ebp
movq %rax, %rdi
xorl %esi, %esi
callq 0x1f110
movl %ebp, %eax
imulq $0x870, %rax, %rdi      # imm = 0x870
addq 0x59953(%rip), %rdi     # 0xdf9f8
callq 0x86466
testb %al, %al
jne 0x860e5
incl %ebp
movl 0x5993a(%rip), %eax     # 0xdf9f0
cmpl %eax, %ebp
jbe 0x86095
movq 0x59937(%rip), %rcx     # 0xdf9f8
imulq $0x870, %rax, %rax      # imm = 0x870
movb $0x1, %bl
movb %bl, (%rcx,%rax)
movq $0x0, 0x59928(%rip) # 0xdfa00
callq 0x864a4
movb %bl, 0x59895(%rip)      # 0xdf978
xorl %ebx, %ebx
leaq 0x59894(%rip), %rdi     # 0xdf980
callq 0x1fbb0
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq