LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movw %si, %ax
movq %rdi, -0x10(%rbp)
movw %ax, -0x12(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x295a8
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x295a6
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movzwl (%rax), %eax
movzwl -0x12(%rbp), %ecx
cmpl %ecx, %eax
je 0x29538
jmp 0x29598
movq -0x28(%rbp), %rdi
callq 0x295c0
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movslq -0x2c(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rsi
movslq -0x2c(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rsi
addq $0x10, %rsi
movq -0x20(%rbp), %rax
movl 0x8(%rax), %eax
subl -0x2c(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rdx
shlq $0x4, %rdx
callq 0x35b0
movq -0x20(%rbp), %rax
movl 0x8(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x8(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x295af
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x29501
jmp 0x295a8
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
addl $0x1, %eax
movslq %eax, %rsi
shlq $0x4, %rsi
callq 0x35c0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x29631
movq $0x0, -0x8(%rbp)
jmp 0x29685
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq 0x8(%rcx), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
movq -0x28(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x3200
movl -0x14(%rbp), %eax
movw %ax, %cx
movq -0x28(%rbp), %rax
movw %cx, (%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/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
movq %rsp, %rbp
subq $0x30, %rsp
movw %dx, %ax
movw %si, %dx
movq %rdi, -0x10(%rbp)
movw %dx, -0x12(%rbp)
movw %ax, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x296ff
movl $0x10, %edi
callq 0x34d0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x296e3
movq $0x0, -0x8(%rbp)
jmp 0x297a9
movq -0x28(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x3200
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rdi
movzwl -0x12(%rbp), %esi
callq 0x29440
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x2973b
movq -0x28(%rbp), %rdi
movzwl -0x12(%rbp), %esi
callq 0x295f0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x29739
movq $0x0, -0x8(%rbp)
jmp 0x297a9
jmp 0x2973b
movq -0x30(%rbp), %rdi
callq 0x295c0
movw -0x12(%rbp), %cx
movq -0x30(%rbp), %rax
movw %cx, (%rax)
movw -0x14(%rbp), %cx
movq -0x30(%rbp), %rax
movw %cx, 0x2(%rax)
movzwl -0x14(%rbp), %eax
movl %eax, %edi
callq 0x34d0
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x29786
movq $0x0, -0x8(%rbp)
jmp 0x297a9
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x30(%rbp), %rax
movzwl 0x2(%rax), %eax
movl %eax, %edx
callq 0x32d0
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_set_ecs
int ns_set_ecs(ns_opt_t *opt, struct sockaddr *addr, int srcprefix, int scopeprefix)
{
	if (addr->sa_family == AF_INET) {
		return ns_set_ecs4(opt, (struct sockaddr_in*)addr, srcprefix, scopeprefix);
	}
	else if (addr->sa_family == AF_INET6) {
		return ns_set_ecs6(opt, (struct sockaddr_in6*)addr, srcprefix, scopeprefix);
	}
	else {
		loge("No support family %d\n", addr->sa_family);
		return -1;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movzwl (%rax), %eax
cmpl $0x2, %eax
jne 0x29a4a
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
callq 0x29ac0
movl %eax, -0x4(%rbp)
jmp 0x29ab3
movq -0x18(%rbp), %rax
movzwl (%rax), %eax
cmpl $0xa, %eax
jne 0x29a6e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
callq 0x29c60
movl %eax, -0x4(%rbp)
jmp 0x29ab3
jmp 0x29a70
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x29aaa
movq -0x18(%rbp), %rax
movzwl (%rax), %r9d
movl $0x3, %edi
leaq 0xe984(%rip), %rsi      # 0x38414
leaq 0xea7b(%rip), %rdx      # 0x38512
movl $0x51f, %ecx            # imm = 0x51F
leaq 0xea7a(%rip), %r8       # 0x3851d
movb $0x0, %al
callq 0x243b0
jmp 0x29aac
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x29e63
movl $0x10, %edi
callq 0x34d0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x29e47
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x29eb6
movq -0x28(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x3200
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rdi
movl $0x8, %esi
callq 0x29440
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x29ea0
movq -0x28(%rbp), %rdi
movl $0x8, %esi
callq 0x295f0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x29e9e
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x29eb6
jmp 0x29ea0
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
callq 0x29a10
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x2a3c6
movq -0x20(%rbp), %rdi
callq 0x3180
cmpq $0x0, %rax
jbe 0x2a3c6
cmpq $0x0, -0x10(%rbp)
je 0x2a3b0
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x2a3b0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x2bfa0
movl %eax, -0x4(%rbp)
jmp 0x2a3eb
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x2c0b0
movl %eax, -0x4(%rbp)
jmp 0x2a3eb
movq -0x18(%rbp), %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x2dc90
cmpl $0x1, %eax
je 0x2a3e4
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2a3eb
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_write_rdata
static int ns_write_rdata(serialize_ctx *ctx, stream_t *s, ns_rr_t *rr)
{
	switch (rr->type) {
	case NS_TYPE_HINFO:
		return ns_rdata_write_hinfo(ctx, s, rr);
	case NS_TYPE_CNAME:
	case NS_TYPE_MB:
	case NS_TYPE_MD:
	case NS_TYPE_MF:
	case NS_TYPE_MG:
	case NS_TYPE_MR:
	case NS_TYPE_NS:
	case NS_TYPE_PTR:
		return ns_rdata_write_domainname(ctx, s, rr);
	case NS_TYPE_MINFO:
		return ns_rdata_write_minfo(ctx, s, rr);
	case NS_TYPE_MX:
		return ns_rdata_write_mx(ctx, s, rr);
	case NS_TYPE_SOA:
		return ns_rdata_write_soa(ctx, s, rr);
	case NS_TYPE_OPT:
		return ns_rdata_write_opts(ctx, s, rr);
	case NS_TYPE_NULL:
	default:
		return ns_rdata_write_any(ctx, s, rr);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rax
movzwl 0x8(%rax), %eax
addl $-0x2, %eax
movl %eax, %ecx
movq %rcx, -0x28(%rbp)
subl $0x27, %eax
ja 0x2a4cb
movq -0x28(%rbp), %rax
leaq 0xde97(%rip), %rcx      # 0x382d0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x2c4f0
movl %eax, -0x4(%rbp)
jmp 0x2a4df
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x2c570
movl %eax, -0x4(%rbp)
jmp 0x2a4df
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x2c5c0
movl %eax, -0x4(%rbp)
jmp 0x2a4df
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x2c640
movl %eax, -0x4(%rbp)
jmp 0x2a4df
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x2c6c0
movl %eax, -0x4(%rbp)
jmp 0x2a4df
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x2c800
movl %eax, -0x4(%rbp)
jmp 0x2a4df
jmp 0x2a4cb
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x2c8f0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_rdata_clone_hinfo
static ns_hinfo_t* ns_rdata_clone_hinfo(const ns_rr_t* rr)
{
	ns_hinfo_t* old = rr->rdata;
	ns_hinfo_t* hinfo = (ns_hinfo_t*)malloc(sizeof(ns_hinfo_t));
	if (hinfo) {
		hinfo->cpu = old->cpu ? strdup(old->cpu) : NULL;
		hinfo->os = old->os ? strdup(old->os) : NULL;
	}
	return hinfo;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbp)
movl $0x10, %edi
callq 0x34d0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x2af5e
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x2af19
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x3620
movq %rax, -0x20(%rbp)
jmp 0x2af21
xorl %eax, %eax
movq %rax, -0x20(%rbp)
jmp 0x2af21
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x2af4a
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3620
movq %rax, -0x28(%rbp)
jmp 0x2af52
xorl %eax, %eax
movq %rax, -0x28(%rbp)
jmp 0x2af52
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_rdata_clone_minfo
static ns_minfo_t* ns_rdata_clone_minfo(const ns_rr_t* rr)
{
	ns_minfo_t* old = rr->rdata;
	ns_minfo_t* minfo = (ns_minfo_t*)malloc(sizeof(ns_minfo_t));
	if (minfo) {
		minfo->rmailbx = old->rmailbx ? strdup(old->rmailbx) : NULL;
		minfo->emailbx = old->emailbx ? strdup(old->emailbx) : NULL;
	}
	return minfo;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbp)
movl $0x10, %edi
callq 0x34d0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x2b03e
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x2aff9
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x3620
movq %rax, -0x20(%rbp)
jmp 0x2b001
xorl %eax, %eax
movq %rax, -0x20(%rbp)
jmp 0x2b001
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x2b02a
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3620
movq %rax, -0x28(%rbp)
jmp 0x2b032
xorl %eax, %eax
movq %rax, -0x28(%rbp)
jmp 0x2b032
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_rdata_clone_mx
static ns_mx_t* ns_rdata_clone_mx(const ns_rr_t* rr)
{
	ns_mx_t* old = rr->rdata;
	ns_mx_t* mx = (ns_mx_t*)malloc(sizeof(ns_mx_t));
	if (mx) {
		mx->preference = old->preference;
		mx->exchange = old->exchange ? strdup(old->exchange) : NULL;
	}
	return mx;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbp)
movl $0x10, %edi
callq 0x34d0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x2b0bd
movq -0x10(%rbp), %rax
movw (%rax), %cx
movq -0x18(%rbp), %rax
movw %cx, (%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x2b0a9
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3620
movq %rax, -0x20(%rbp)
jmp 0x2b0b1
xorl %eax, %eax
movq %rax, -0x20(%rbp)
jmp 0x2b0b1
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_rdata_clone_soa
static ns_soa_t* ns_rdata_clone_soa(const ns_rr_t* rr)
{
	ns_soa_t* old = rr->rdata;
	ns_soa_t* soa = (ns_soa_t*)malloc(sizeof(ns_soa_t));
	if (soa) {
		memcpy(soa, old, sizeof(ns_soa_t));
		soa->mname = old->mname ? strdup(old->mname) : NULL;
		soa->rname = old->rname ? strdup(old->rname) : NULL;
	}
	return soa;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbp)
movl $0x28, %edi
callq 0x34d0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x2b170
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x28, %edx
callq 0x32d0
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x2b12b
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x3620
movq %rax, -0x20(%rbp)
jmp 0x2b133
xorl %eax, %eax
movq %rax, -0x20(%rbp)
jmp 0x2b133
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x2b15c
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3620
movq %rax, -0x28(%rbp)
jmp 0x2b164
xorl %eax, %eax
movq %rax, -0x28(%rbp)
jmp 0x2b164
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_rdata_clone_any
static void* ns_rdata_clone_any(const ns_rr_t* rr)
{
	char* data = (char*)malloc(rr->rdlength);
	if (data) {
		memcpy(data, rr->rdata, rr->rdlength);
	}
	return data;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movzwl 0x10(%rax), %eax
movl %eax, %edi
callq 0x34d0
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x2b3b1
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x8(%rbp), %rax
movzwl 0x10(%rax), %eax
movl %eax, %edx
callq 0x32d0
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_rdata_free_hinfo
static void ns_rdata_free_hinfo(ns_rr_t *rr)
{
    ns_hinfo_t *hinfo = rr->rdata;
    if (hinfo) {
        free(hinfo->cpu);
        free(hinfo->os);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x2b3f8
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x3460
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3460
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_rdata_free_minfo
static void ns_rdata_free_minfo(ns_rr_t *rr)
{
    ns_minfo_t *minfo = rr->rdata;
    if (minfo) {
        free(minfo->rmailbx);
        free(minfo->emailbx);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x2b448
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x3460
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3460
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_rdata_read_hinfo
static int ns_rdata_read_hinfo(ns_rr_t *rr, stream_t *s)
{
    stream_t cpu = STREAM_INIT();
    stream_t os = STREAM_INIT();
    int rc = -1;
    if (ns_read_cstring(&cpu, s) >= 0 &&
        ns_read_cstring(&os, s) >= 0) {
        ns_hinfo_t *hinfo = malloc(sizeof(ns_hinfo_t));
        if (hinfo) {
            hinfo->cpu = cpu.array;
            hinfo->os = os.array;
            rr->rdata = hinfo;
            rc = 0;
        }
    }
    return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x28(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x3200
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x3200
movl $0xffffffff, -0x44(%rbp) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x2bc30
cmpl $0x0, %eax
jl 0x2b57c
movq -0x10(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x2bc30
cmpl $0x0, %eax
jl 0x2b57c
movl $0x10, %edi
callq 0x34d0
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0x2b57a
movq -0x28(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x50(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movl $0x0, -0x44(%rbp)
jmp 0x2b57c
movl -0x44(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_rdata_read_domainname
static int ns_rdata_read_domainname(ns_rr_t *rr, stream_t *s)
{
    stream_t name = STREAM_INIT();
    if (ns_read_domainname(&name, s) < 0) {
        return -1;
    }
    rr->rdata = name.array;
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x3200
movq -0x18(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x28a70
cmpl $0x0, %eax
jge 0x2b5cb
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2b5de
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_rdata_read_minfo
static int ns_rdata_read_minfo(ns_rr_t *rr, stream_t *s)
{
    stream_t rmailbx = STREAM_INIT();
    stream_t emailbx = STREAM_INIT();
    int rc = -1;
    if (ns_read_domainname(&rmailbx, s) >= 0 &&
        ns_read_domainname(&emailbx, s) >= 0) {
        ns_minfo_t *minfo = malloc(sizeof(ns_minfo_t));
        if (minfo) {
            minfo->rmailbx = rmailbx.array;
            minfo->emailbx = emailbx.array;
            rr->rdata = minfo;
            rc = 0;
        }
    }
    return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x28(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x3200
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x3200
movl $0xffffffff, -0x44(%rbp) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x28a70
cmpl $0x0, %eax
jl 0x2b68c
movq -0x10(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x28a70
cmpl $0x0, %eax
jl 0x2b68c
movl $0x10, %edi
callq 0x34d0
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0x2b68a
movq -0x28(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x50(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movl $0x0, -0x44(%rbp)
jmp 0x2b68c
movl -0x44(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_rdata_read_mx
static int ns_rdata_read_mx(ns_rr_t *rr, stream_t *s)
{
    stream_t exchange = STREAM_INIT();
    int preference, rc = -1;
    if (stream_rsize(s) < 2)
        return -1;
    preference = stream_readi16(s);
    if (ns_read_domainname(&exchange, s) >= 0) {
        ns_mx_t *mx = malloc(sizeof(ns_mx_t));
        if (mx) {
            mx->exchange = exchange.array;
            mx->preference = (uint16_t)preference;
            rr->rdata = mx;
            rc = 0;
        }
    }
    return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x3200
movl $0xffffffff, -0x38(%rbp) # imm = 0xFFFFFFFF
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x18(%rbp), %rcx
subl 0xc(%rcx), %eax
cmpl $0x2, %eax
jge 0x2b6e3
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2b74f
movq -0x18(%rbp), %rdi
movl $0x2, %esi
callq 0x2e340
movl %eax, -0x34(%rbp)
movq -0x18(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x28a70
cmpl $0x0, %eax
jl 0x2b749
movl $0x10, %edi
callq 0x34d0
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x2b747
movq -0x30(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x8(%rax)
movl -0x34(%rbp), %eax
movw %ax, %cx
movq -0x40(%rbp), %rax
movw %cx, (%rax)
movq -0x40(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movl $0x0, -0x38(%rbp)
jmp 0x2b749
movl -0x38(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_rdata_read_soa
static int ns_rdata_read_soa(ns_rr_t *rr, stream_t *s)
{
    stream_t mname = STREAM_INIT();
    stream_t rname = STREAM_INIT();
    int rc = -1;
    if (ns_read_domainname(&mname, s) >= 0 &&
        ns_read_domainname(&rname, s) >= 0) {
        if (stream_rsize(s) >= 20) {
            ns_soa_t *soa = malloc(sizeof(ns_soa_t));
            if (soa) {
                soa->mname = mname.array;
                soa->rname = rname.array;
                soa->serial = (uint32_t)stream_readi32(s);
                soa->refresh = (uint32_t)stream_readi32(s);
                soa->retry = (uint32_t)stream_readi32(s);
                soa->expire = (uint32_t)stream_readi32(s);
                soa->minimum = (uint32_t)stream_readi32(s);
                rr->rdata = soa;
                rc = 0;
            }
        }

    }
    return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x28(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x3200
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x3200
movl $0xffffffff, -0x44(%rbp) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x28a70
cmpl $0x0, %eax
jl 0x2b894
movq -0x10(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x28a70
cmpl $0x0, %eax
jl 0x2b894
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x10(%rbp), %rcx
subl 0xc(%rcx), %eax
cmpl $0x14, %eax
jl 0x2b892
movl $0x28, %edi
callq 0x34d0
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0x2b890
movq -0x28(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rdi
movl $0x4, %esi
callq 0x2e340
movl %eax, %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rdi
movl $0x4, %esi
callq 0x2e340
movl %eax, %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x10(%rbp), %rdi
movl $0x4, %esi
callq 0x2e340
movl %eax, %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x10(%rbp), %rdi
movl $0x4, %esi
callq 0x2e340
movl %eax, %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x1c(%rax)
movq -0x10(%rbp), %rdi
movl $0x4, %esi
callq 0x2e340
movl %eax, %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x50(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movl $0x0, -0x44(%rbp)
jmp 0x2b892
jmp 0x2b894
movl -0x44(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_rdata_read_any
static int ns_rdata_read_any(ns_rr_t *rr, stream_t *s)
{
    char *any;
    if (stream_rsize(s) < rr->rdlength)
        return -1;
	any = malloc(rr->rdlength);
    if (any) {
		if (stream_read(s, any, rr->rdlength) == rr->rdlength) {
			rr->rdata = any;
			return 0;
		}
		else {
			free(any);
		}
    }
    return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x18(%rbp), %rcx
subl 0xc(%rcx), %eax
movq -0x10(%rbp), %rcx
movzwl 0x10(%rcx), %ecx
cmpl %ecx, %eax
jge 0x2bbc3
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2bc25
movq -0x10(%rbp), %rax
movzwl 0x10(%rax), %eax
movl %eax, %edi
callq 0x34d0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x2bc1e
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rax
movzwl 0x10(%rax), %edx
callq 0x2dc20
movq -0x10(%rbp), %rcx
movzwl 0x10(%rcx), %ecx
cmpl %ecx, %eax
jne 0x2bc13
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x2bc25
movq -0x20(%rbp), %rdi
callq 0x3460
jmp 0x2bc1e
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_rdata_read_edns_optinfo
static opt_rdata_into ns_rdata_read_edns_optinfo(ns_rr_t *rr, stream_t *s)
{
    opt_rdata_into info = { 0 };
    int count = 0, size = 0;
    stream_t ns = STREAM_INIT();
    ns.array = s->array + s->pos;
    ns.cap = stream_rsize(s);
    ns.size = rr->rdlength;
    ns.pos = 0;
    while(stream_rsize(&ns) > 0) {
        int code, length;
        if (stream_rsize(&ns) < 4) {
            count = -1;
            break;
        }
        code = stream_readi16(&ns);
        length = stream_readi16(&ns);
        if (stream_rsize(&ns) < length) {
            count = -1;
            break;
        }
        stream_seek(&ns, length, SEEK_CUR);
        count++;
        size += length;
    }
    info.count = count;
    info.size = size;
    return info;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
leaq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x3200
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
leaq -0x38(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x3200
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movslq 0xc(%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x18(%rbp), %rcx
subl 0xc(%rcx), %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movzwl 0x10(%rax), %eax
movl %eax, -0x30(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x30(%rbp), %eax
subl -0x2c(%rbp), %eax
cmpl $0x0, %eax
jle 0x2bf31
movl -0x30(%rbp), %eax
subl -0x2c(%rbp), %eax
cmpl $0x4, %eax
jge 0x2bed6
movl $0xffffffff, -0x1c(%rbp) # imm = 0xFFFFFFFF
jmp 0x2bf31
leaq -0x38(%rbp), %rdi
movl $0x2, %esi
callq 0x2e340
movl %eax, -0x3c(%rbp)
leaq -0x38(%rbp), %rdi
movl $0x2, %esi
callq 0x2e340
movl %eax, -0x40(%rbp)
movl -0x30(%rbp), %eax
subl -0x2c(%rbp), %eax
cmpl -0x40(%rbp), %eax
jge 0x2bf0c
movl $0xffffffff, -0x1c(%rbp) # imm = 0xFFFFFFFF
jmp 0x2bf31
movl -0x40(%rbp), %esi
leaq -0x38(%rbp), %rdi
movl $0x1, %edx
callq 0x2d6a0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movl -0x40(%rbp), %eax
addl -0x20(%rbp), %eax
movl %eax, -0x20(%rbp)
jmp 0x2beb7
movl -0x1c(%rbp), %eax
movl %eax, -0x8(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x4(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x2bf97
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2bf50
movq -0x18(%rbp), %rdi
callq 0x3460
jmp 0x2bf68
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_write_domainname_comp
static int ns_write_domainname_comp(serialize_ctx *ctx, stream_t *s, char *name)
{
	int offset;
	label_t *seq;

	seq = get_label_seq(ctx, name);
	if (seq == NULL)
		return -1;

	while (seq) {
		if (seq->offset > 0) {
			offset = seq->offset | 0xc000;
			if (stream_writei16(s, offset) != 2)
				return -1;
			break;
		}
		else {
			seq->offset = s->pos - ctx->startpos;
			if (stream_writei8(s, seq->label.len) != 1)
				return -1;
			if (stream_write(s, seq->label.s, seq->label.len) != seq->label.len)
				return -1;
		}
		seq = seq->parent;
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x2c180
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x2bfd8
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c09a
jmp 0x2bfda
cmpq $0x0, -0x30(%rbp)
je 0x2c093
movq -0x30(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jle 0x2c01f
movq -0x30(%rbp), %rax
movl 0x10(%rax), %eax
orl $0xc000, %eax           # imm = 0xC000
movl %eax, -0x24(%rbp)
movq -0x18(%rbp), %rdi
movl -0x24(%rbp), %esi
movl $0x2, %edx
callq 0x2dc90
cmpl $0x2, %eax
je 0x2c01d
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c09a
jmp 0x2c093
movq -0x18(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0x10(%rbp), %rax
subl 0x4(%rax), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rax
movl 0x8(%rax), %esi
movl $0x1, %edx
callq 0x2dc90
cmpl $0x1, %eax
je 0x2c057
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c09a
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rax
movq (%rax), %rsi
movq -0x30(%rbp), %rax
movl 0x8(%rax), %edx
callq 0x2d9e0
movq -0x30(%rbp), %rcx
cmpl 0x8(%rcx), %eax
je 0x2c080
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c09a
jmp 0x2c082
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x2bfda
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movl $0x2e, %esi
callq 0x2c480
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jle 0x2c148
movq -0x18(%rbp), %rdi
movl -0x24(%rbp), %esi
movl $0x1, %edx
callq 0x2dc90
cmpl $0x1, %eax
je 0x2c0fa
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c16d
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x24(%rbp), %edx
callq 0x2d9e0
cmpl -0x24(%rbp), %eax
je 0x2c118
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c16d
movl -0x24(%rbp), %ecx
movq -0x20(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movl $0x2e, %esi
callq 0x2c480
movl %eax, -0x24(%rbp)
jmp 0x2c0d5
movq -0x18(%rbp), %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x2dc90
cmpl $0x1, %eax
je 0x2c166
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c16d
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: get_label_seq
static label_t *get_label_seq(serialize_ctx *ctx, char *name)
{
	str_t labels[NS_MAX_LABEL_COUNT];
	int label_num, i;
	label_t *root = &ctx->rlabel, *lbl = NULL;

	label_num = name_split(labels, NS_MAX_LABEL_COUNT, name);
	if (label_num == -1)
		return NULL;

	for (i = label_num - 1; i >= 0; i--) {
		lbl = find_childlabel(root, labels + i);
		if (lbl == NULL) {
			lbl = new_child(root, labels + i);
			if (lbl == NULL)
				return NULL;
		}

		root = lbl;
	}

	return lbl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2040, %rsp           # imm = 0x2040
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x2030(%rbp)
movq $0x0, -0x2038(%rbp)
leaq -0x2020(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl $0x200, %esi            # imm = 0x200
callq 0x2c2b0
movl %eax, -0x2024(%rbp)
cmpl $-0x1, -0x2024(%rbp)
jne 0x2c1de
movq $0x0, -0x8(%rbp)
jmp 0x2c297
movl -0x2024(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x2028(%rbp)
cmpl $0x0, -0x2028(%rbp)
jl 0x2c28c
movq -0x2030(%rbp), %rdi
leaq -0x2020(%rbp), %rsi
movslq -0x2028(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rsi
callq 0x2c370
movq %rax, -0x2038(%rbp)
cmpq $0x0, -0x2038(%rbp)
jne 0x2c26a
movq -0x2030(%rbp), %rdi
leaq -0x2020(%rbp), %rsi
movslq -0x2028(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rsi
callq 0x2c3d0
movq %rax, -0x2038(%rbp)
cmpq $0x0, -0x2038(%rbp)
jne 0x2c268
movq $0x0, -0x8(%rbp)
jmp 0x2c297
jmp 0x2c26a
movq -0x2038(%rbp), %rax
movq %rax, -0x2030(%rbp)
movl -0x2028(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x2028(%rbp)
jmp 0x2c1ed
movq -0x2038(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x2040, %rsp           # imm = 0x2040
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: name_split
static int name_split(str_t *labels, int size, char *name)
{
	int i, num = 0;
	i = indexof_char(name, '.');
	while (i > 0) {
		if (num >= size)
			return -1;
		labels[num].s = name;
		labels[num].len = i;
		num++;
		name += i;
		name++; /* skip '.' */
		i = indexof_char(name, '.');
	}
	return num;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x0, -0x28(%rbp)
movq -0x20(%rbp), %rdi
movl $0x2e, %esi
callq 0x2c480
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jle 0x2c356
movl -0x28(%rbp), %eax
cmpl -0x14(%rbp), %eax
jl 0x2c2f2
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c35c
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movslq -0x28(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
movslq -0x28(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %ecx
movq -0x20(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movl $0x2e, %esi
callq 0x2c480
movl %eax, -0x24(%rbp)
jmp 0x2c2db
movl -0x28(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: find_childlabel
static label_t *find_childlabel(label_t *root, str_t *s)
{
	label_t *lbl = root->childs;
	while (lbl) {
		if (strcmp(s->s, lbl->label.s) == 0)
			break;
		lbl = lbl->next;
	}
	return lbl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x2c3bb
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0x3500
cmpl $0x0, %eax
jne 0x2c3ad
jmp 0x2c3bb
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x2c38c
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: new_child
static label_t *new_child(label_t *root, str_t *s)
{
	label_t *lbl;
	lbl = malloc(sizeof(label_t));
	if (lbl == NULL) {
		return NULL;
	}
	memset(lbl, 0, sizeof(label_t));
	lbl->label = *s;
	lbl->parent = root;

	if (root->childs == NULL) {
		root->childs = lbl;
	}
	else {
		lbl->next = root->childs;
		root->childs = lbl;
	}
	return lbl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x30, %edi
callq 0x34d0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x2c3ff
movq $0x0, -0x8(%rbp)
jmp 0x2c46e
movq -0x20(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x3200
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x2c44a
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
jmp 0x2c466
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: indexof_char
static int indexof_char(char *s, int ch)
{
    int i = 0;
    while (*s && (*s) != ch) {
        s++;
        i++;
    }
    if (*s)
        return i;
    else
        return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x19(%rbp)
je 0x2c4b3
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl -0x14(%rbp), %eax
setne %al
movb %al, -0x19(%rbp)
movb -0x19(%rbp), %al
testb $0x1, %al
jne 0x2c4bc
jmp 0x2c4d3
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x2c492
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0x2c4e4
movl -0x18(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x2c4eb
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_rdata_write_hinfo
static int ns_rdata_write_hinfo(serialize_ctx *ctx, stream_t *s, ns_rr_t *rr)
{
	ns_hinfo_t *hinfo = rr->rdata;
	if (hinfo) {
		if (ns_write_cstring(ctx, s, hinfo->cpu) != 0)
			return -1;
		if (ns_write_cstring(ctx, s, hinfo->os) != 0)
			return -1;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x2c55e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rax
movq (%rax), %rdx
callq 0x2c950
cmpl $0x0, %eax
je 0x2c539
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c565
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdx
callq 0x2c950
cmpl $0x0, %eax
je 0x2c55c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c565
jmp 0x2c55e
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_rdata_write_minfo
static int ns_rdata_write_minfo(serialize_ctx *ctx, stream_t *s, ns_rr_t *rr)
{
	ns_minfo_t *minfo = rr->rdata;

	if (minfo) {
		if (ns_write_domainname(ctx, s, minfo->rmailbx) != 0)
			return -1;
		if (ns_write_domainname(ctx, s, minfo->emailbx) != 0)
			return -1;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x2c62e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rax
movq (%rax), %rdx
callq 0x2a360
cmpl $0x0, %eax
je 0x2c609
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c635
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdx
callq 0x2a360
cmpl $0x0, %eax
je 0x2c62c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c635
jmp 0x2c62e
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_rdata_write_mx
static int ns_rdata_write_mx(serialize_ctx *ctx, stream_t *s, ns_rr_t *rr)
{
	ns_mx_t *mx = rr->rdata;

	if (mx) {
		if (stream_writei16(s, mx->preference) != 2)
			return -1;
		if (ns_write_domainname(ctx, s, mx->exchange) != 0)
			return -1;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x2c6af
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movzwl (%rax), %esi
movl $0x2, %edx
callq 0x2dc90
cmpl $0x2, %eax
je 0x2c68a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c6b6
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdx
callq 0x2a360
cmpl $0x0, %eax
je 0x2c6ad
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c6b6
jmp 0x2c6af
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_rdata_write_soa
static int ns_rdata_write_soa(serialize_ctx *ctx, stream_t *s, ns_rr_t *rr)
{
	ns_soa_t *soa = rr->rdata;

	if (soa) {
		if (ns_write_domainname(ctx, s, soa->mname) != 0)
			return -1;
		if (ns_write_domainname(ctx, s, soa->rname) != 0)
			return -1;
		if (stream_writei32(s, soa->serial) != 4)
			return -1;
		if (stream_writei32(s, soa->refresh) != 4)
			return -1;
		if (stream_writei32(s, soa->retry) != 4)
			return -1;
		if (stream_writei32(s, soa->expire) != 4)
			return -1;
		if (stream_writei32(s, soa->minimum) != 4)
			return -1;
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x2c7ea
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rax
movq (%rax), %rdx
callq 0x2a360
cmpl $0x0, %eax
je 0x2c710
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c7f1
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdx
callq 0x2a360
cmpl $0x0, %eax
je 0x2c736
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c7f1
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movl 0x10(%rax), %esi
movl $0x4, %edx
callq 0x2dc90
cmpl $0x4, %eax
je 0x2c75c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c7f1
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movl 0x14(%rax), %esi
movl $0x4, %edx
callq 0x2dc90
cmpl $0x4, %eax
je 0x2c77f
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c7f1
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movl 0x18(%rax), %esi
movl $0x4, %edx
callq 0x2dc90
cmpl $0x4, %eax
je 0x2c7a2
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c7f1
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movl 0x1c(%rax), %esi
movl $0x4, %edx
callq 0x2dc90
cmpl $0x4, %eax
je 0x2c7c5
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c7f1
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movl 0x20(%rax), %esi
movl $0x4, %edx
callq 0x2dc90
cmpl $0x4, %eax
je 0x2c7e8
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c7f1
jmp 0x2c7ea
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_rdata_write_opts
static int ns_rdata_write_opts(serialize_ctx *ctx, stream_t *s, ns_rr_t *rr)
{
	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 (stream_writei16(s, opt->code) != 2)
				return -1;
			if (stream_writei16(s, opt->length) != 2)
				return -1;
			if (stream_write(s, opt->data, opt->length) != opt->length)
				return -1;
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x2c8df
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x2c8dd
movq -0x28(%rbp), %rax
movq (%rax), %rax
movslq -0x34(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rax
movzwl (%rax), %esi
movl $0x2, %edx
callq 0x2dc90
cmpl $0x2, %eax
je 0x2c87b
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c8e6
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rax
movzwl 0x2(%rax), %esi
movl $0x2, %edx
callq 0x2dc90
cmpl $0x2, %eax
je 0x2c89f
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c8e6
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x30(%rbp), %rax
movzwl 0x2(%rax), %edx
callq 0x2d9e0
movq -0x30(%rbp), %rcx
movzwl 0x2(%rcx), %ecx
cmpl %ecx, %eax
je 0x2c8cd
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c8e6
jmp 0x2c8cf
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x2c832
jmp 0x2c8df
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop