// File: /workspace/github_c_makefile_star2_O2/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_print
void ns_print(ns_msg_t *msg)
{
	int i, rrcount;
	ns_qr_t *qr;
	ns_rr_t *rr;
	ns_flags_t flags;

	logv("<<< MSG START >>>\n");
	logv("ID: 0x%x, FLAGS: 0x%x, QDCOUNT: 0x%x, ANCOUNT: 0x%x, NSCOUNT: 0x%x, ARCOUNT: 0x%x\n",
		(int)(msg->id & 0xffff),
		(int)(msg->flags & 0xffff),
		(int)(msg->qdcount & 0xffff),
		(int)(msg->ancount & 0xffff),
		(int)(msg->nscount & 0xffff),
		(int)(msg->arcount & 0xffff));
	flags = ns_get_flags(msg);
	logv("FLAGS:%s%s%s%s%s opcode=%d rcode=%d\n",
		flags.qr ? " qr" : "",
		flags.aa ? " aa" : "",
		flags.tc ? " tc" : "",
		flags.rd ? " rd" : "",
		flags.ra ? " ra" : "",
		flags.opcode,
		flags.rcode);

	for (i = 0; i < msg->qdcount; i++) {
		qr = msg->qrs + i;
		logv("QNAME: %s, QTYPE: 0x%x (%s), QCLASS: 0x%x (%s)\n",
			qr->qname,
			(int)(qr->qtype & 0xffff),
			ns_typename(qr->qtype),
			(int)(qr->qclass & 0xffff),
			ns_classname(qr->qclass));
	}

	for (i = 0, rrcount = ns_rrcount(msg);
		i < rrcount; i++) {
		rr = msg->rrs + i;
		if (rr->type == NS_QTYPE_OPT) {
			logv("NAME: %s, TYPE: 0x%x (%s), PAYLOAD: 0x%x, RCODE: 0x%x, VERSION: 0x%x, Z: 0x%x, RDLEN: 0x%x\n",
				rr->name,
				(int)(rr->type & 0xffff),
				ns_typename(rr->type),
				(int)(rr->cls & 0xffff),
				(int)((rr->ttl >> 24) & 0xff),
				(int)((rr->ttl >> 16) & 0xff),
				(int)(rr->ttl & 0xffff),
				(int)(rr->rdlength & 0xffff));
		}
		else {
			logv("NAME: %s, TYPE: 0x%x (%s), CLASS: 0x%x (%s), TTL: 0x%x, RDLEN: 0x%x\n",
				rr->name,
				(int)(rr->type & 0xffff),
				ns_typename(rr->type),
				(int)(rr->cls & 0xffff),
				ns_classname(rr->cls),
				rr->ttl,
				(int)(rr->rdlength & 0xffff));
		}
		ns_print_rdata(rr);
	}
	logv("<<< MSG END >>>\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, %r13
xorl %eax, %eax
callq 0x165f5
cmpl $0x8, (%rax)
jl 0x1aa7a
leaq 0x81a7(%rip), %rsi      # 0x22c04
leaq 0x82bf(%rip), %rdx      # 0x22d23
leaq 0x82c1(%rip), %r8       # 0x22d2c
pushq $0x8
popq %rdi
movl $0x792, %ecx            # imm = 0x792
xorl %eax, %eax
callq 0x1662e
xorl %eax, %eax
callq 0x165f5
cmpl $0x8, (%rax)
jl 0x1aad9
movzwl (%r13), %r9d
movzwl 0x2(%r13), %r10d
movzwl 0x4(%r13), %r11d
movzwl 0x6(%r13), %ebx
movzwl 0x8(%r13), %r14d
movzwl 0xa(%r13), %r15d
subq $0x8, %rsp
leaq 0x8155(%rip), %rsi      # 0x22c04
leaq 0x826d(%rip), %rdx      # 0x22d23
leaq 0x8282(%rip), %r8       # 0x22d3f
pushq $0x8
popq %rdi
movl $0x799, %ecx            # imm = 0x799
xorl %eax, %eax
pushq %r15
pushq %r14
pushq %rbx
pushq %r11
pushq %r10
callq 0x1662e
addq $0x30, %rsp
movq %r13, %rdi
callq 0x181ec
movl %eax, %ebp
xorl %eax, %eax
callq 0x165f5
cmpl $0x8, (%rax)
jl 0x1ab8a
movzwl %bp, %r11d
testb $0x1, %r11b
leaq 0x72fc(%rip), %rax      # 0x21dfe
leaq 0x82ae(%rip), %r9       # 0x22db7
cmoveq %rax, %r9
testb $0x20, %r11b
leaq 0x82a3(%rip), %r10      # 0x22dbb
cmoveq %rax, %r10
testb $0x40, %r11b
leaq 0x8298(%rip), %rbx      # 0x22dbf
cmoveq %rax, %rbx
testb %bpl, %bpl
leaq 0x828e(%rip), %r14      # 0x22dc3
cmovnsq %rax, %r14
btl $0x8, %r11d
leaq 0x8282(%rip), %r15      # 0x22dc7
cmovaeq %rax, %r15
movl %r11d, %r12d
shrl %r12d
andl $0xf, %r12d
shrl $0xc, %r11d
leaq 0x80a6(%rip), %rsi      # 0x22c04
leaq 0x81be(%rip), %rdx      # 0x22d23
leaq 0x8226(%rip), %r8       # 0x22d92
pushq $0x8
popq %rdi
movl $0x7a2, %ecx            # imm = 0x7A2
xorl %eax, %eax
pushq %r11
pushq %r12
pushq %r15
pushq %r14
pushq %rbx
pushq %r10
callq 0x1662e
addq $0x30, %rsp
pushq $0xa
popq %rbx
xorl %ebp, %ebp
movq %r13, 0x8(%rsp)
movzwl 0x4(%r13), %eax
cmpq %rax, %rbp
jae 0x1ac18
movq 0x10(%r13), %r12
xorl %eax, %eax
callq 0x165f5
cmpl $0x8, (%rax)
jl 0x1ac0c
movq -0xa(%r12,%rbx), %r13
movzwl -0x2(%r12,%rbx), %r14d
movl %r14d, %edi
callq 0x18a25
movq %rax, %r15
movzwl (%r12,%rbx), %r12d
movl %r12d, %edi
callq 0x18b5a
movq %rax, %r10
pushq $0x8
popq %rdi
leaq 0x8026(%rip), %rsi      # 0x22c04
leaq 0x813e(%rip), %rdx      # 0x22d23
movl $0x7ab, %ecx            # imm = 0x7AB
leaq 0x81da(%rip), %r8       # 0x22dcb
movq %r13, %r9
movq 0x8(%rsp), %r13
xorl %eax, %eax
pushq %r10
pushq %r12
pushq %r15
pushq %r14
callq 0x1662e
addq $0x20, %rsp
incq %rbp
addq $0x10, %rbx
jmp 0x1ab94
movzwl 0x6(%r13), %eax
movzwl 0x8(%r13), %ecx
addq %rax, %rcx
movzwl 0xa(%r13), %ebp
addq %rcx, %rbp
xorl %r15d, %r15d
movq %rbp, 0x10(%rsp)
cmpq %rbp, %r15
je 0x1b2b2
movq 0x18(%r13), %rax
movq %r15, %rcx
shlq $0x5, %rcx
leaq (%rax,%rcx), %rbx
movzwl 0x8(%rax,%rcx), %r14d
xorl %eax, %eax
callq 0x165f5
movl (%rax), %eax
cmpw $0x29, %r14w
movq %r15, 0x20(%rsp)
jne 0x1acf4
cmpl $0x8, %eax
jl 0x1ad64
movq (%rbx), %r12
movzwl 0x8(%rbx), %r13d
movl %r13d, %edi
callq 0x18a25
movq %rax, 0x18(%rsp)
movzwl 0xa(%rbx), %r11d
movl 0xc(%rbx), %eax
movl %eax, %ecx
movzwl %ax, %r14d
movl %eax, %r15d
shrl $0x18, %r15d
shrl $0x10, %ecx
movzbl %cl, %ebp
movzwl 0x10(%rbx), %r10d
subq $0x8, %rsp
pushq $0x8
popq %rdi
leaq 0x7f4c(%rip), %rsi      # 0x22c04
leaq 0x8064(%rip), %rdx      # 0x22d23
movl $0x7ba, %ecx            # imm = 0x7BA
leaq 0x8130(%rip), %r8       # 0x22dfb
movq %r12, %r9
xorl %eax, %eax
pushq %r10
pushq %r14
pushq %rbp
movq 0x30(%rsp), %rbp
pushq %r15
pushq %r11
pushq 0x48(%rsp)
pushq %r13
movq 0x48(%rsp), %r13
callq 0x1662e
addq $0x40, %rsp
jmp 0x1ad64
cmpl $0x8, %eax
jl 0x1ad64
movq (%rbx), %r12
movzwl 0x8(%rbx), %r13d
movl %r13d, %edi
callq 0x18a25
movq %rax, %r14
movzwl 0xa(%rbx), %r15d
movl %r15d, %edi
callq 0x18b5a
movq %rax, %r10
movl 0xc(%rbx), %r11d
movzwl 0x10(%rbx), %ebp
pushq $0x8
popq %rdi
leaq 0x7ed6(%rip), %rsi      # 0x22c04
leaq 0x7fee(%rip), %rdx      # 0x22d23
movl $0x7c4, %ecx            # imm = 0x7C4
leaq 0x8116(%rip), %r8       # 0x22e57
movq %r12, %r9
xorl %eax, %eax
pushq %rbp
movq 0x18(%rsp), %rbp
pushq %r11
pushq %r10
pushq %r15
pushq %r14
pushq %r13
movq 0x38(%rsp), %r13
callq 0x1662e
addq $0x30, %rsp
movzwl 0x8(%rbx), %eax
leal -0x1(%rax), %ecx
cmpl $0x1b, %ecx
ja 0x1adc9
leaq 0x7e1d(%rip), %rdx      # 0x22b94
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
xorl %eax, %eax
callq 0x165f5
cmpl $0x8, (%rax)
jl 0x1b25d
movq 0x18(%rbx), %rsi
pushq $0x2
popq %rdi
leaq 0x40(%rsp), %rdx
pushq $0x2e
popq %rcx
callq 0x33c0
pushq $0x8
popq %rdi
leaq 0x7e56(%rip), %rsi      # 0x22c04
leaq 0x83c0(%rip), %rdx      # 0x23175
movl $0x748, %ecx            # imm = 0x748
leaq 0x83c5(%rip), %r8       # 0x23186
movq %rax, %r9
jmp 0x1b256
cmpl $0x29, %eax
jne 0x1af4a
movq 0x18(%rbx), %rbx
testq %rbx, %rbx
je 0x1b25d
xorl %eax, %eax
callq 0x165f5
cmpl $0x8, (%rax)
jl 0x1ae13
movl 0x8(%rbx), %r9d
pushq $0x8
popq %rdi
leaq 0x7e0b(%rip), %rsi      # 0x22c04
leaq 0x8313(%rip), %rdx      # 0x23113
movl $0x71e, %ecx            # imm = 0x71E
leaq 0x831b(%rip), %r8       # 0x23127
xorl %eax, %eax
callq 0x1662e
pushq $0x8
popq %r14
xorl %r15d, %r15d
movslq 0x8(%rbx), %rax
cmpq %rax, %r15
jge 0x1b25d
movq (%rbx), %r12
xorl %eax, %eax
callq 0x165f5
cmpl $0x8, (%rax)
jl 0x1ae6e
movzwl -0x8(%r12,%r14), %r9d
movzwl -0x6(%r12,%r14), %r10d
subq $0x8, %rsp
pushq $0x8
popq %rdi
leaq 0x7db4(%rip), %rsi      # 0x22c04
leaq 0x82bc(%rip), %rdx      # 0x23113
movl $0x724, %ecx            # imm = 0x724
leaq 0x82d4(%rip), %r8       # 0x23137
xorl %eax, %eax
pushq %r10
callq 0x1662e
popq %rax
popq %rcx
movq (%r12,%r14), %rsi
testq %rsi, %rsi
je 0x1af3e
cmpw $0x8, -0x8(%r12,%r14)
jne 0x1af23
movzwl -0x6(%r12,%r14), %edx
leaq 0x2c(%rsp), %rdi
callq 0x1a951
testq %rax, %rax
je 0x1af23
xorps %xmm0, %xmm0
movups %xmm0, 0x5e(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movzwl 0x2c(%rsp), %eax
pushq $0x2
popq %rdi
cmpl $0x1, %eax
je 0x1aec8
cmpl $0x2, %eax
jne 0x1aeda
pushq $0xa
popq %rdi
leaq 0x30(%rsp), %rsi
leaq 0x40(%rsp), %rdx
pushq $0x2e
popq %rcx
callq 0x33c0
xorl %eax, %eax
callq 0x165f5
cmpl $0x8, (%rax)
jl 0x1af3e
movzbl 0x2e(%rsp), %r10d
movzbl 0x2f(%rsp), %r11d
pushq $0x8
popq %rdi
leaq 0x7d08(%rip), %rsi      # 0x22c04
leaq 0x8210(%rip), %rdx      # 0x23113
movl $0x737, %ecx            # imm = 0x737
leaq 0x8252(%rip), %r8       # 0x23161
leaq 0x40(%rsp), %r9
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x1662e
popq %rax
popq %rcx
jmp 0x1af3e
xorl %eax, %eax
callq 0x165f5
cmpl $0x7, (%rax)
jl 0x1af3e
movq (%r12,%r14), %rdi
movzwl -0x6(%r12,%r14), %esi
callq 0x1bfda
incq %r15
addq $0x10, %r14
jmp 0x1ae1a
cmpq $0x0, 0x18(%rbx)
je 0x1b25d
xorl %eax, %eax
callq 0x165f5
cmpl $0x7, (%rax)
jl 0x1b25d
movq 0x18(%rbx), %rdi
movzwl 0x10(%rbx), %esi
callq 0x1bfda
jmp 0x1b25d
movq 0x18(%rbx), %rbx
testq %rbx, %rbx
je 0x1b25d
xorl %eax, %eax
callq 0x165f5
cmpl $0x8, (%rax)
jl 0x1b25d
movq (%rbx), %r9
subq $0x8, %rsp
pushq $0x8
popq %rdi
leaq 0x7c5f(%rip), %rsi      # 0x22c04
leaq 0x8070(%rip), %rdx      # 0x2301c
movl $0x6b7, %ecx            # imm = 0x6B7
leaq 0x8079(%rip), %r8       # 0x23031
jmp 0x1b18c
movq 0x18(%rbx), %rbx
testq %rbx, %rbx
je 0x1b25d
xorl %eax, %eax
callq 0x165f5
cmpl $0x8, (%rax)
jl 0x1b25d
movq (%rbx), %r9
movl 0x10(%rbx), %r10d
movl 0x14(%rbx), %r11d
movl 0x18(%rbx), %r14d
movl 0x1c(%rbx), %r15d
movl 0x20(%rbx), %r12d
pushq $0x8
popq %rdi
leaq 0x7c09(%rip), %rsi      # 0x22c04
leaq 0x80a1(%rip), %rdx      # 0x230a3
movl $0x6dd, %ecx            # imm = 0x6DD
leaq 0x80a8(%rip), %r8       # 0x230b6
xorl %eax, %eax
pushq %r12
pushq %r15
pushq %r14
pushq %r11
pushq %r10
pushq 0x8(%rbx)
callq 0x1662e
addq $0x30, %rsp
jmp 0x1b25d
xorl %eax, %eax
callq 0x165f5
cmpl $0x8, (%rax)
jl 0x1b25d
movq 0x18(%rbx), %r9
pushq $0x8
popq %rdi
leaq 0x7bbb(%rip), %rsi      # 0x22c04
leaq 0x7f70(%rip), %rdx      # 0x22fc0
movl $0x762, %ecx            # imm = 0x762
jmp 0x1b220
xorl %eax, %eax
callq 0x165f5
cmpl $0x8, (%rax)
jl 0x1b25d
movq 0x18(%rbx), %r9
pushq $0x8
popq %rdi
leaq 0x7b8c(%rip), %rsi      # 0x22c04
leaq 0x7f41(%rip), %rdx      # 0x22fc0
movl $0x76b, %ecx            # imm = 0x76B
leaq 0x7f76(%rip), %r8       # 0x23001
jmp 0x1b256
xorl %eax, %eax
callq 0x165f5
cmpl $0x8, (%rax)
jl 0x1b25d
movq 0x18(%rbx), %r9
pushq $0x8
popq %rdi
leaq 0x7b56(%rip), %rsi      # 0x22c04
leaq 0x7f0b(%rip), %rdx      # 0x22fc0
movl $0x768, %ecx            # imm = 0x768
leaq 0x7f33(%rip), %r8       # 0x22ff4
jmp 0x1b256
xorl %eax, %eax
callq 0x165f5
cmpl $0x8, (%rax)
jl 0x1b25d
movq 0x18(%rbx), %r9
pushq $0x8
popq %rdi
leaq 0x7b20(%rip), %rsi      # 0x22c04
leaq 0x7ed5(%rip), %rdx      # 0x22fc0
movl $0x765, %ecx            # imm = 0x765
leaq 0x7ef0(%rip), %r8       # 0x22fe7
jmp 0x1b256
movq 0x18(%rbx), %rsi
pushq $0xa
popq %rdi
leaq 0x13c66(%rip), %rdx     # 0x2ed70
pushq $0x2e
popq %rcx
callq 0x33c0
xorl %eax, %eax
callq 0x165f5
cmpl $0x8, (%rax)
jl 0x1b25d
pushq $0x8
popq %rdi
leaq 0x7ad8(%rip), %rsi      # 0x22c04
leaq 0x805d(%rip), %rdx      # 0x23190
movl $0x74f, %ecx            # imm = 0x74F
leaq 0x8065(%rip), %r8       # 0x231a4
leaq 0x13c2a(%rip), %r9      # 0x2ed70
jmp 0x1b256
movq 0x18(%rbx), %rbx
testq %rbx, %rbx
je 0x1b25d
xorl %eax, %eax
callq 0x165f5
cmpl $0x8, (%rax)
jl 0x1b25d
movq (%rbx), %r9
subq $0x8, %rsp
pushq $0x8
popq %rdi
leaq 0x7a8b(%rip), %rsi      # 0x22c04
leaq 0x7ec2(%rip), %rdx      # 0x23042
movl $0x6c2, %ecx            # imm = 0x6C2
leaq 0x7ecb(%rip), %r8       # 0x23057
xorl %eax, %eax
pushq 0x8(%rbx)
callq 0x1662e
jmp 0x1b2ae
xorl %eax, %eax
callq 0x165f5
cmpl $0x8, (%rax)
jl 0x1b25d
movq 0x18(%rbx), %r9
pushq $0x8
popq %rdi
leaq 0x7a4b(%rip), %rsi      # 0x22c04
leaq 0x7e00(%rip), %rdx      # 0x22fc0
movl $0x75f, %ecx            # imm = 0x75F
jmp 0x1b220
xorl %eax, %eax
callq 0x165f5
cmpl $0x8, (%rax)
jl 0x1b25d
movq 0x18(%rbx), %r9
pushq $0x8
popq %rdi
leaq 0x7a1f(%rip), %rsi      # 0x22c04
leaq 0x7dd4(%rip), %rdx      # 0x22fc0
movl $0x759, %ecx            # imm = 0x759
leaq 0x7dd7(%rip), %r8       # 0x22fcf
jmp 0x1b256
xorl %eax, %eax
callq 0x165f5
cmpl $0x8, (%rax)
jl 0x1b25d
movq 0x18(%rbx), %r9
pushq $0x8
popq %rdi
leaq 0x79f0(%rip), %rsi      # 0x22c04
leaq 0x7da5(%rip), %rdx      # 0x22fc0
movl $0x75c, %ecx            # imm = 0x75C
leaq 0x7db3(%rip), %r8       # 0x22fda
jmp 0x1b256
xorl %eax, %eax
callq 0x165f5
cmpl $0x8, (%rax)
jl 0x1b25d
movq 0x18(%rbx), %r9
pushq $0x8
popq %rdi
leaq 0x79c1(%rip), %rsi      # 0x22c04
leaq 0x7d76(%rip), %rdx      # 0x22fc0
movl $0x76e, %ecx            # imm = 0x76E
leaq 0x7db8(%rip), %r8       # 0x2300e
xorl %eax, %eax
callq 0x1662e
movq 0x20(%rsp), %r15
incq %r15
jmp 0x1ac35
movq 0x18(%rbx), %rbx
testq %rbx, %rbx
je 0x1b25d
xorl %eax, %eax
callq 0x165f5
cmpl $0x8, (%rax)
jl 0x1b25d
movzwl (%rbx), %r9d
subq $0x8, %rsp
pushq $0x8
popq %rdi
leaq 0x7973(%rip), %rsi      # 0x22c04
leaq 0x7dd9(%rip), %rdx      # 0x23071
movl $0x6cd, %ecx            # imm = 0x6CD
leaq 0x7ddf(%rip), %r8       # 0x23083
xorl %eax, %eax
pushq 0x8(%rbx)
callq 0x1662e
popq %rax
popq %rcx
jmp 0x1b25d
xorl %eax, %eax
callq 0x165f5
cmpl $0x8, (%rax)
jl 0x1b2e2
leaq 0x793f(%rip), %rsi      # 0x22c04
leaq 0x7a57(%rip), %rdx      # 0x22d23
leaq 0x7bc9(%rip), %r8       # 0x22e9c
pushq $0x8
popq %rdi
movl $0x7c8, %ecx            # imm = 0x7C8
xorl %eax, %eax
callq 0x1662e
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq