// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_rdata_print_edns
static void ns_rdata_print_edns(ns_rr_t *rr)
{
	ns_optlist_t *opts = rr->rdata;
	ns_opt_t *opt;
	int i;

	if (opts != NULL) {
		logv("OPTCOUNT: 0x%x\n", opts->optcount);
		for (i = 0; i < opts->optcount; i++) {
			opt = opts->opts + i;

			logv("OPT-CODE: 0x%x, OPT-LEN: 0x%x, OPT-DATA:\n",
				(int)(opt->code & 0xffff),
				(int)(opt->length & 0xffff));
			if (opt->data != NULL) {
				if (opt->code == NS_OPTCODE_ECS) {
					ns_ecs_t ecs;
					if (ns_parse_ect(&ecs, opt->data, opt->length)) {
						char ipname[INET6_ADDRSTRLEN] = { 0 };
						if (ecs.family == ADDR_FAMILY_NUM_IP) {
							inet_ntop(AF_INET, &ecs.subnet, ipname, INET6_ADDRSTRLEN);
						}
						else if (ecs.family == ADDR_FAMILY_NUM_IP6) {
							inet_ntop(AF_INET6, &ecs.subnet, ipname, INET6_ADDRSTRLEN);
						}
						else {
							/*invalid ecs*/
							ipname[0] = '\0';
						}
						logv("ECS %s/%d SCOPE %d\n",
							ipname,
							ecs.src_prefix_len,
							ecs.scope_prefix_len);
					}
					else {
						bprint(opt->data, opt->length);
					}
				}
				else {
					bprint(opt->data, opt->length);
				}
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x2ce36
jmp 0x2cc25
movb $0x0, %al
callq 0x242d0
cmpl $0x8, (%rax)
jl 0x2cc5f
movq -0x10(%rbp), %rax
movl 0x8(%rax), %r9d
movl $0x8, %edi
leaq 0xb7cf(%rip), %rsi      # 0x38414
leaq 0xbcd7(%rip), %rdx      # 0x38923
movl $0x71e, %ecx            # imm = 0x71E
leaq 0xbcdf(%rip), %r8       # 0x38937
movb $0x0, %al
callq 0x243b0
jmp 0x2cc61
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x2ce34
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x1c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movb $0x0, %al
callq 0x242d0
cmpl $0x8, (%rax)
jl 0x2ccdf
movq -0x18(%rbp), %rax
movzwl (%rax), %r9d
andl $0xffff, %r9d           # imm = 0xFFFF
movq -0x18(%rbp), %rax
movzwl 0x2(%rax), %eax
andl $0xffff, %eax           # imm = 0xFFFF
movl $0x8, %edi
leaq 0xb752(%rip), %rsi      # 0x38414
leaq 0xbc5a(%rip), %rdx      # 0x38923
movl $0x724, %ecx            # imm = 0x724
leaq 0xbc72(%rip), %r8       # 0x38947
movl %eax, (%rsp)
movb $0x0, %al
callq 0x243b0
jmp 0x2cce1
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x2ce24
movq -0x18(%rbp), %rax
movzwl (%rax), %eax
cmpl $0x8, %eax
jne 0x2cdfb
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x18(%rbp), %rax
movzwl 0x2(%rax), %edx
leaq -0x30(%rbp), %rdi
callq 0x2a4f0
cmpq $0x0, %rax
je 0x2cdd2
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
movl $0x2e, %edx
callq 0x3200
movzwl -0x30(%rbp), %eax
cmpl $0x1, %eax
jne 0x2cd59
leaq -0x30(%rbp), %rsi
addq $0x4, %rsi
leaq -0x60(%rbp), %rdx
movl $0x2, %edi
movl $0x2e, %ecx
callq 0x33c0
jmp 0x2cd85
movzwl -0x30(%rbp), %eax
cmpl $0x2, %eax
jne 0x2cd7f
leaq -0x30(%rbp), %rsi
addq $0x4, %rsi
leaq -0x60(%rbp), %rdx
movl $0xa, %edi
movl $0x2e, %ecx
callq 0x33c0
jmp 0x2cd83
movb $0x0, -0x60(%rbp)
jmp 0x2cd85
jmp 0x2cd87
movb $0x0, %al
callq 0x242d0
cmpl $0x8, (%rax)
jl 0x2cdce
leaq -0x60(%rbp), %r9
movzbl -0x2e(%rbp), %r10d
movzbl -0x2d(%rbp), %eax
movl $0x8, %edi
leaq 0xb668(%rip), %rsi      # 0x38414
leaq 0xbb70(%rip), %rdx      # 0x38923
movl $0x737, %ecx            # imm = 0x737
leaq 0xbbb2(%rip), %r8       # 0x38971
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0x243b0
jmp 0x2cdd0
jmp 0x2cdf9
jmp 0x2cdd4
movb $0x0, %al
callq 0x242d0
cmpl $0x7, (%rax)
jl 0x2cdf5
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rax
movzwl 0x2(%rax), %esi
callq 0x2e3d0
jmp 0x2cdf7
jmp 0x2cdf9
jmp 0x2ce22
jmp 0x2cdfd
movb $0x0, %al
callq 0x242d0
cmpl $0x7, (%rax)
jl 0x2ce1e
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rax
movzwl 0x2(%rax), %esi
callq 0x2e3d0
jmp 0x2ce20
jmp 0x2ce22
jmp 0x2ce24
jmp 0x2ce26
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2cc68
jmp 0x2ce36
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)