// File: /workspace/github_c_makefile_star2_O3/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, %r12
xorl %eax, %eax
callq 0x176e5
cmpl $0x8, (%rax)
jl 0x1bdd3
leaq 0x8e30(%rip), %rsi      # 0x24be4
leaq 0x8f48(%rip), %rdx      # 0x24d03
leaq 0x8f4a(%rip), %r8       # 0x24d0c
movl $0x8, %edi
movl $0x792, %ecx            # imm = 0x792
xorl %eax, %eax
callq 0x1771e
xorl %eax, %eax
callq 0x176e5
cmpl $0x8, (%rax)
jl 0x1be39
movzwl (%r12), %r9d
movzwl 0x2(%r12), %r10d
movzwl 0x4(%r12), %r11d
movzwl 0x6(%r12), %ebx
movzwl 0x8(%r12), %r14d
movzwl 0xa(%r12), %r15d
subq $0x8, %rsp
leaq 0x8dd7(%rip), %rsi      # 0x24be4
leaq 0x8eef(%rip), %rdx      # 0x24d03
leaq 0x8f04(%rip), %r8       # 0x24d1f
movl $0x8, %edi
movl $0x799, %ecx            # imm = 0x799
xorl %eax, %eax
pushq %r15
pushq %r14
pushq %rbx
pushq %r11
pushq %r10
callq 0x1771e
addq $0x30, %rsp
movq %r12, 0x10(%rsp)
movq %r12, %rdi
callq 0x193ec
movl %eax, %ebp
xorl %eax, %eax
callq 0x176e5
cmpl $0x8, (%rax)
jl 0x1bef1
movzwl %bp, %r11d
testb $0x1, %r11b
leaq 0x7f97(%rip), %rax      # 0x23dfe
leaq 0x8f29(%rip), %r9       # 0x24d97
cmoveq %rax, %r9
testb $0x20, %r11b
leaq 0x8f1e(%rip), %r10      # 0x24d9b
cmoveq %rax, %r10
testb $0x40, %r11b
leaq 0x8f13(%rip), %rbx      # 0x24d9f
cmoveq %rax, %rbx
testb %bpl, %bpl
leaq 0x8f09(%rip), %r14      # 0x24da3
cmovnsq %rax, %r14
btl $0x8, %r11d
leaq 0x8efd(%rip), %r15      # 0x24da7
cmovaeq %rax, %r15
movl %r11d, %r12d
shrl %r12d
andl $0xf, %r12d
shrl $0xc, %r11d
leaq 0x8d21(%rip), %rsi      # 0x24be4
leaq 0x8e39(%rip), %rdx      # 0x24d03
leaq 0x8ea1(%rip), %r8       # 0x24d72
movl $0x8, %edi
movl $0x7a2, %ecx            # imm = 0x7A2
xorl %eax, %eax
pushq %r11
pushq %r12
pushq %r15
pushq %r14
pushq %rbx
pushq %r10
callq 0x1771e
addq $0x30, %rsp
movq 0x10(%rsp), %rbp
cmpw $0x0, 0x4(%rbp)
je 0x1bf87
movl $0xa, %ebx
xorl %r12d, %r12d
movq 0x10(%rbp), %r15
xorl %eax, %eax
callq 0x176e5
cmpl $0x8, (%rax)
jl 0x1bf77
movq -0xa(%r15,%rbx), %r13
movzwl -0x2(%r15,%rbx), %ebp
movl %ebp, %edi
callq 0x19c4d
movq %rax, %r14
movzwl (%r15,%rbx), %r15d
movl %r15d, %edi
callq 0x19d84
movq %rax, %r10
movl $0x8, %edi
leaq 0x8c9a(%rip), %rsi      # 0x24be4
leaq 0x8db2(%rip), %rdx      # 0x24d03
movl $0x7ab, %ecx            # imm = 0x7AB
leaq 0x8e4e(%rip), %r8       # 0x24dab
movq %r13, %r9
xorl %eax, %eax
pushq %r10
pushq %r15
pushq %r14
pushq %rbp
movq 0x30(%rsp), %rbp
callq 0x1771e
addq $0x20, %rsp
incq %r12
movzwl 0x4(%rbp), %eax
addq $0x10, %rbx
cmpq %rax, %r12
jb 0x1bf09
movzwl 0x6(%rbp), %eax
movzwl 0x8(%rbp), %ecx
addl %eax, %ecx
movzwl 0xa(%rbp), %eax
addl %ecx, %eax
je 0x1c653
movl %eax, %eax
movq %rax, 0x20(%rsp)
xorl %r15d, %r15d
movq 0x18(%rbp), %rax
movq %r15, %rcx
shlq $0x5, %rcx
leaq (%rax,%rcx), %rbx
movzwl 0x8(%rax,%rcx), %ebp
xorl %eax, %eax
callq 0x176e5
movl (%rax), %eax
cmpw $0x29, %bp
jne 0x1c053
cmpl $0x8, %eax
jl 0x1c0bf
movq (%rbx), %r14
movzwl 0x8(%rbx), %r13d
movl %r13d, %edi
callq 0x19c4d
movq %rax, 0x8(%rsp)
movzwl 0xa(%rbx), %eax
movq %rax, 0x18(%rsp)
movl 0xc(%rbx), %eax
movl %eax, %ecx
movzwl %ax, %r12d
movl %eax, %ebp
shrl $0x18, %ebp
shrl $0x10, %ecx
movzbl %cl, %r10d
movzwl 0x10(%rbx), %r11d
subq $0x8, %rsp
movl $0x8, %edi
leaq 0x8bc5(%rip), %rsi      # 0x24be4
leaq 0x8cdd(%rip), %rdx      # 0x24d03
movl $0x7ba, %ecx            # imm = 0x7BA
leaq 0x8da9(%rip), %r8       # 0x24ddb
movq %r14, %r9
xorl %eax, %eax
pushq %r11
pushq %r12
pushq %r10
pushq %rbp
pushq 0x40(%rsp)
pushq 0x38(%rsp)
pushq %r13
callq 0x1771e
addq $0x40, %rsp
jmp 0x1c0bf
cmpl $0x8, %eax
jl 0x1c0bf
movq (%rbx), %r14
movzwl 0x8(%rbx), %r13d
movl %r13d, %edi
callq 0x19c4d
movq %rax, 0x8(%rsp)
movzwl 0xa(%rbx), %r12d
movl %r12d, %edi
callq 0x19d84
movq %rax, %r10
movl 0xc(%rbx), %r11d
movzwl 0x10(%rbx), %ebp
movl $0x8, %edi
leaq 0x8b53(%rip), %rsi      # 0x24be4
leaq 0x8c6b(%rip), %rdx      # 0x24d03
movl $0x7c4, %ecx            # imm = 0x7C4
leaq 0x8d93(%rip), %r8       # 0x24e37
movq %r14, %r9
xorl %eax, %eax
pushq %rbp
pushq %r11
pushq %r10
pushq %r12
pushq 0x28(%rsp)
pushq %r13
callq 0x1771e
addq $0x30, %rsp
movzwl 0x8(%rbx), %eax
leal -0x1(%rax), %ecx
cmpl $0x1b, %ecx
movq 0x10(%rsp), %rbp
ja 0x1c12f
leaq 0x8a9d(%rip), %rdx      # 0x24b74
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
xorl %eax, %eax
callq 0x176e5
cmpl $0x8, (%rax)
jl 0x1c5f7
movq 0x18(%rbx), %rsi
movl $0x2, %edi
leaq 0x40(%rsp), %rdx
movl $0x2e, %ecx
callq 0x33b0
movl $0x8, %edi
leaq 0x8ad0(%rip), %rsi      # 0x24be4
leaq 0x903a(%rip), %rdx      # 0x25155
movl $0x748, %ecx            # imm = 0x748
leaq 0x903f(%rip), %r8       # 0x25166
movq %rax, %r9
jmp 0x1c5f0
cmpl $0x29, %eax
jne 0x1c2c8
movq 0x18(%rbx), %rbx
testq %rbx, %rbx
je 0x1c5f7
xorl %eax, %eax
callq 0x176e5
cmpl $0x8, (%rax)
jl 0x1c17b
movl 0x8(%rbx), %r9d
movl $0x8, %edi
leaq 0x8a83(%rip), %rsi      # 0x24be4
leaq 0x8f8b(%rip), %rdx      # 0x250f3
movl $0x71e, %ecx            # imm = 0x71E
leaq 0x8f93(%rip), %r8       # 0x25107
xorl %eax, %eax
callq 0x1771e
cmpl $0x0, 0x8(%rbx)
jle 0x1c5f7
movl $0x8, %r14d
xorl %r12d, %r12d
movq (%rbx), %r13
xorl %eax, %eax
callq 0x176e5
cmpl $0x8, (%rax)
jl 0x1c1d9
movzwl -0x8(%r13,%r14), %r9d
movzwl -0x6(%r13,%r14), %r10d
subq $0x8, %rsp
movl $0x8, %edi
leaq 0x8a2b(%rip), %rsi      # 0x24be4
leaq 0x8f33(%rip), %rdx      # 0x250f3
movl $0x724, %ecx            # imm = 0x724
leaq 0x8f4b(%rip), %r8       # 0x25117
xorl %eax, %eax
pushq %r10
callq 0x1771e
addq $0x10, %rsp
movq (%r13,%r14), %rsi
testq %rsi, %rsi
je 0x1c2af
cmpw $0x8, -0x8(%r13,%r14)
jne 0x1c22d
movzwl -0x6(%r13,%r14), %edx
leaq 0x2c(%rsp), %rdi
callq 0x1bca5
testq %rax, %rax
je 0x1c22d
xorps %xmm0, %xmm0
movups %xmm0, 0x5e(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movzwl 0x2c(%rsp), %eax
cmpl $0x1, %eax
je 0x1c24b
cmpl $0x2, %eax
jne 0x1c264
movl $0xa, %edi
jmp 0x1c250
xorl %eax, %eax
callq 0x176e5
cmpl $0x7, (%rax)
jl 0x1c2af
movq (%r13,%r14), %rdi
movzwl -0x6(%r13,%r14), %esi
callq 0x1d5ca
jmp 0x1c2af
movl $0x2, %edi
leaq 0x30(%rsp), %rsi
leaq 0x40(%rsp), %rdx
movl $0x2e, %ecx
callq 0x33b0
xorl %eax, %eax
callq 0x176e5
cmpl $0x8, (%rax)
jl 0x1c2af
movzbl 0x2e(%rsp), %r10d
movzbl 0x2f(%rsp), %r11d
movl $0x8, %edi
leaq 0x895c(%rip), %rsi      # 0x24be4
leaq 0x8e64(%rip), %rdx      # 0x250f3
movl $0x737, %ecx            # imm = 0x737
leaq 0x8ea6(%rip), %r8       # 0x25141
leaq 0x40(%rsp), %r9
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x1771e
addq $0x10, %rsp
incq %r12
movslq 0x8(%rbx), %rax
addq $0x10, %r14
cmpq %rax, %r12
jl 0x1c18e
jmp 0x1c5f7
cmpq $0x0, 0x18(%rbx)
je 0x1c5f7
xorl %eax, %eax
callq 0x176e5
cmpl $0x7, (%rax)
jl 0x1c5f7
movq 0x18(%rbx), %rdi
movzwl 0x10(%rbx), %esi
callq 0x1d5ca
jmp 0x1c5f7
movq 0x18(%rbx), %rbx
testq %rbx, %rbx
je 0x1c5f7
xorl %eax, %eax
callq 0x176e5
cmpl $0x8, (%rax)
jl 0x1c5f7
movq (%rbx), %r9
subq $0x8, %rsp
movl $0x8, %edi
leaq 0x88bf(%rip), %rsi      # 0x24be4
leaq 0x8cd0(%rip), %rdx      # 0x24ffc
movl $0x6b7, %ecx            # imm = 0x6B7
leaq 0x8cd9(%rip), %r8       # 0x25011
jmp 0x1c51e
movq 0x18(%rbx), %rbx
testq %rbx, %rbx
je 0x1c5f7
xorl %eax, %eax
callq 0x176e5
cmpl $0x8, (%rax)
jl 0x1c5f7
movq (%rbx), %r9
movl 0x10(%rbx), %r10d
movl 0x14(%rbx), %r11d
movl 0x18(%rbx), %r14d
movl 0x1c(%rbx), %r12d
movl 0x20(%rbx), %r13d
movl $0x8, %edi
leaq 0x8867(%rip), %rsi      # 0x24be4
leaq 0x8cff(%rip), %rdx      # 0x25083
movl $0x6dd, %ecx            # imm = 0x6DD
leaq 0x8d06(%rip), %r8       # 0x25096
xorl %eax, %eax
pushq %r13
pushq %r12
pushq %r14
pushq %r11
pushq %r10
pushq 0x8(%rbx)
callq 0x1771e
addq $0x30, %rsp
jmp 0x1c5f7
xorl %eax, %eax
callq 0x176e5
cmpl $0x8, (%rax)
jl 0x1c5f7
movq 0x18(%rbx), %r9
movl $0x8, %edi
leaq 0x8817(%rip), %rsi      # 0x24be4
leaq 0x8bcc(%rip), %rdx      # 0x24fa0
movl $0x762, %ecx            # imm = 0x762
jmp 0x1c5b8
xorl %eax, %eax
callq 0x176e5
cmpl $0x8, (%rax)
jl 0x1c5f7
movq 0x18(%rbx), %r9
movl $0x8, %edi
leaq 0x87e6(%rip), %rsi      # 0x24be4
leaq 0x8b9b(%rip), %rdx      # 0x24fa0
movl $0x76b, %ecx            # imm = 0x76B
leaq 0x8bd0(%rip), %r8       # 0x24fe1
jmp 0x1c5f0
xorl %eax, %eax
callq 0x176e5
cmpl $0x8, (%rax)
jl 0x1c5f7
movq 0x18(%rbx), %r9
movl $0x8, %edi
leaq 0x87ae(%rip), %rsi      # 0x24be4
leaq 0x8b63(%rip), %rdx      # 0x24fa0
movl $0x768, %ecx            # imm = 0x768
leaq 0x8b8b(%rip), %r8       # 0x24fd4
jmp 0x1c5f0
xorl %eax, %eax
callq 0x176e5
cmpl $0x8, (%rax)
jl 0x1c5f7
movq 0x18(%rbx), %r9
movl $0x8, %edi
leaq 0x8776(%rip), %rsi      # 0x24be4
leaq 0x8b2b(%rip), %rdx      # 0x24fa0
movl $0x765, %ecx            # imm = 0x765
leaq 0x8b46(%rip), %r8       # 0x24fc7
jmp 0x1c5f0
movq 0x18(%rbx), %rsi
movl $0xa, %edi
leaq 0x118ca(%rip), %rdx     # 0x2dd60
movl $0x2e, %ecx
callq 0x33b0
xorl %eax, %eax
callq 0x176e5
cmpl $0x8, (%rax)
jl 0x1c5f7
movl $0x8, %edi
leaq 0x8728(%rip), %rsi      # 0x24be4
leaq 0x8cad(%rip), %rdx      # 0x25170
movl $0x74f, %ecx            # imm = 0x74F
leaq 0x8cb5(%rip), %r8       # 0x25184
leaq 0x1188a(%rip), %r9      # 0x2dd60
jmp 0x1c5f0
movq 0x18(%rbx), %rbx
testq %rbx, %rbx
je 0x1c5f7
xorl %eax, %eax
callq 0x176e5
cmpl $0x8, (%rax)
jl 0x1c5f7
movq (%rbx), %r9
subq $0x8, %rsp
movl $0x8, %edi
leaq 0x86d9(%rip), %rsi      # 0x24be4
leaq 0x8b10(%rip), %rdx      # 0x25022
movl $0x6c2, %ecx            # imm = 0x6C2
leaq 0x8b19(%rip), %r8       # 0x25037
xorl %eax, %eax
pushq 0x8(%rbx)
callq 0x1771e
jmp 0x1c64d
xorl %eax, %eax
callq 0x176e5
cmpl $0x8, (%rax)
jl 0x1c5f7
movq 0x18(%rbx), %r9
movl $0x8, %edi
leaq 0x8697(%rip), %rsi      # 0x24be4
leaq 0x8a4c(%rip), %rdx      # 0x24fa0
movl $0x75f, %ecx            # imm = 0x75F
jmp 0x1c5b8
xorl %eax, %eax
callq 0x176e5
cmpl $0x8, (%rax)
jl 0x1c5f7
movq 0x18(%rbx), %r9
movl $0x8, %edi
leaq 0x8669(%rip), %rsi      # 0x24be4
leaq 0x8a1e(%rip), %rdx      # 0x24fa0
movl $0x759, %ecx            # imm = 0x759
leaq 0x8a21(%rip), %r8       # 0x24faf
jmp 0x1c5f0
xorl %eax, %eax
callq 0x176e5
cmpl $0x8, (%rax)
jl 0x1c5f7
movq 0x18(%rbx), %r9
movl $0x8, %edi
leaq 0x8638(%rip), %rsi      # 0x24be4
leaq 0x89ed(%rip), %rdx      # 0x24fa0
movl $0x75c, %ecx            # imm = 0x75C
leaq 0x89fb(%rip), %r8       # 0x24fba
jmp 0x1c5f0
xorl %eax, %eax
callq 0x176e5
cmpl $0x8, (%rax)
jl 0x1c5f7
movq 0x18(%rbx), %r9
movl $0x8, %edi
leaq 0x8607(%rip), %rsi      # 0x24be4
leaq 0x89bc(%rip), %rdx      # 0x24fa0
movl $0x76e, %ecx            # imm = 0x76E
leaq 0x89fe(%rip), %r8       # 0x24fee
xorl %eax, %eax
callq 0x1771e
incq %r15
cmpq 0x20(%rsp), %r15
jne 0x1bfa7
jmp 0x1c653
movq 0x18(%rbx), %rbx
testq %rbx, %rbx
je 0x1c5f7
xorl %eax, %eax
callq 0x176e5
cmpl $0x8, (%rax)
jl 0x1c5f7
movzwl (%rbx), %r9d
subq $0x8, %rsp
movl $0x8, %edi
leaq 0x85b4(%rip), %rsi      # 0x24be4
leaq 0x8a1a(%rip), %rdx      # 0x25051
movl $0x6cd, %ecx            # imm = 0x6CD
leaq 0x8a20(%rip), %r8       # 0x25063
xorl %eax, %eax
pushq 0x8(%rbx)
callq 0x1771e
addq $0x10, %rsp
jmp 0x1c5f7
xorl %eax, %eax
callq 0x176e5
cmpl $0x8, (%rax)
jl 0x1c685
leaq 0x857e(%rip), %rsi      # 0x24be4
leaq 0x8696(%rip), %rdx      # 0x24d03
leaq 0x8808(%rip), %r8       # 0x24e7c
movl $0x8, %edi
movl $0x7c8, %ecx            # imm = 0x7C8
xorl %eax, %eax
callq 0x1771e
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq