// File: /workspace/github_c_makefile_star2_O1/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 0x17d59
cmpl $0x8, (%rax)
jl 0x1c696
leaq 0x855d(%rip), %rsi      # 0x24bd4
leaq 0x8675(%rip), %rdx      # 0x24cf3
leaq 0x8677(%rip), %r8       # 0x24cfc
movl $0x8, %edi
movl $0x792, %ecx            # imm = 0x792
xorl %eax, %eax
callq 0x17d92
xorl %eax, %eax
callq 0x17d59
cmpl $0x8, (%rax)
jl 0x1c6fc
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 0x8504(%rip), %rsi      # 0x24bd4
leaq 0x861c(%rip), %rdx      # 0x24cf3
leaq 0x8631(%rip), %r8       # 0x24d0f
movl $0x8, %edi
movl $0x799, %ecx            # imm = 0x799
xorl %eax, %eax
pushq %r15
pushq %r14
pushq %rbx
pushq %r11
pushq %r10
callq 0x17d92
addq $0x30, %rsp
movq %r12, 0x10(%rsp)
movq %r12, %rdi
callq 0x19a68
movl %eax, %ebp
xorl %eax, %eax
callq 0x17d59
cmpl $0x8, (%rax)
jl 0x1c7b4
movzwl %bp, %r11d
testb $0x1, %r11b
leaq 0x76c8(%rip), %rax      # 0x23df2
leaq 0x8656(%rip), %r9       # 0x24d87
cmoveq %rax, %r9
testb $0x20, %r11b
leaq 0x864b(%rip), %r10      # 0x24d8b
cmoveq %rax, %r10
testb $0x40, %r11b
leaq 0x8640(%rip), %rbx      # 0x24d8f
cmoveq %rax, %rbx
testb %bpl, %bpl
leaq 0x8636(%rip), %r14      # 0x24d93
cmovnsq %rax, %r14
btl $0x8, %r11d
leaq 0x862a(%rip), %r15      # 0x24d97
cmovaeq %rax, %r15
movl %r11d, %r12d
shrl %r12d
andl $0xf, %r12d
shrl $0xc, %r11d
leaq 0x844e(%rip), %rsi      # 0x24bd4
leaq 0x8566(%rip), %rdx      # 0x24cf3
leaq 0x85ce(%rip), %r8       # 0x24d62
movl $0x8, %edi
movl $0x7a2, %ecx            # imm = 0x7A2
xorl %eax, %eax
pushq %r11
pushq %r12
pushq %r15
pushq %r14
pushq %rbx
pushq %r10
callq 0x17d92
addq $0x30, %rsp
movq 0x10(%rsp), %rbp
cmpw $0x0, 0x4(%rbp)
je 0x1c84a
movl $0xa, %ebx
xorl %r12d, %r12d
movq 0x10(%rbp), %r15
xorl %eax, %eax
callq 0x17d59
cmpl $0x8, (%rax)
jl 0x1c83a
movq -0xa(%r15,%rbx), %r13
movzwl -0x2(%r15,%rbx), %ebp
movl %ebp, %edi
callq 0x1a346
movq %rax, %r14
movzwl (%r15,%rbx), %r15d
movl %r15d, %edi
callq 0x1a47d
movq %rax, %r10
movl $0x8, %edi
leaq 0x83c7(%rip), %rsi      # 0x24bd4
leaq 0x84df(%rip), %rdx      # 0x24cf3
movl $0x7ab, %ecx            # imm = 0x7AB
leaq 0x857b(%rip), %r8       # 0x24d9b
movq %r13, %r9
xorl %eax, %eax
pushq %r10
pushq %r15
pushq %r14
pushq %rbp
movq 0x30(%rsp), %rbp
callq 0x17d92
addq $0x20, %rsp
incq %r12
movzwl 0x4(%rbp), %eax
addq $0x10, %rbx
cmpq %rax, %r12
jb 0x1c7cc
movzwl 0x6(%rbp), %eax
movzwl 0x8(%rbp), %ecx
addl %eax, %ecx
movzwl 0xa(%rbp), %eax
addl %ecx, %eax
je 0x1cf20
movl %eax, %eax
movq %rax, 0x38(%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 0x17d59
movl (%rax), %eax
cmpw $0x29, %bp
jne 0x1c916
cmpl $0x8, %eax
jl 0x1c982
movq (%rbx), %r14
movzwl 0x8(%rbx), %r13d
movl %r13d, %edi
callq 0x1a346
movq %rax, 0x8(%rsp)
movzwl 0xa(%rbx), %eax
movq %rax, 0x30(%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 0x82f2(%rip), %rsi      # 0x24bd4
leaq 0x840a(%rip), %rdx      # 0x24cf3
movl $0x7ba, %ecx            # imm = 0x7BA
leaq 0x84d6(%rip), %r8       # 0x24dcb
movq %r14, %r9
xorl %eax, %eax
pushq %r11
pushq %r12
pushq %r10
pushq %rbp
pushq 0x58(%rsp)
pushq 0x38(%rsp)
pushq %r13
callq 0x17d92
addq $0x40, %rsp
jmp 0x1c982
cmpl $0x8, %eax
jl 0x1c982
movq (%rbx), %r14
movzwl 0x8(%rbx), %r13d
movl %r13d, %edi
callq 0x1a346
movq %rax, 0x8(%rsp)
movzwl 0xa(%rbx), %r12d
movl %r12d, %edi
callq 0x1a47d
movq %rax, %r10
movl 0xc(%rbx), %r11d
movzwl 0x10(%rbx), %ebp
movl $0x8, %edi
leaq 0x8280(%rip), %rsi      # 0x24bd4
leaq 0x8398(%rip), %rdx      # 0x24cf3
movl $0x7c4, %ecx            # imm = 0x7C4
leaq 0x84c0(%rip), %r8       # 0x24e27
movq %r14, %r9
xorl %eax, %eax
pushq %rbp
pushq %r11
pushq %r10
pushq %r12
pushq 0x28(%rsp)
pushq %r13
callq 0x17d92
addq $0x30, %rsp
movzwl 0x8(%rbx), %eax
leal -0x1(%rax), %ecx
cmpl $0x1b, %ecx
movq 0x10(%rsp), %rbp
ja 0x1c9f2
leaq 0x81ca(%rip), %rdx      # 0x24b64
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
xorl %eax, %eax
callq 0x17d59
cmpl $0x8, (%rax)
jl 0x1cec4
movq 0x18(%rbx), %rsi
movl $0x2, %edi
leaq 0x40(%rsp), %rdx
movl $0x2e, %ecx
callq 0x33b0
movl $0x8, %edi
leaq 0x81fd(%rip), %rsi      # 0x24bd4
leaq 0x8767(%rip), %rdx      # 0x25145
movl $0x748, %ecx            # imm = 0x748
leaq 0x876c(%rip), %r8       # 0x25156
movq %rax, %r9
jmp 0x1cebd
cmpl $0x29, %eax
jne 0x1cb95
movq 0x18(%rbx), %rbx
testq %rbx, %rbx
je 0x1cec4
xorl %eax, %eax
callq 0x17d59
cmpl $0x8, (%rax)
jl 0x1ca3e
movl 0x8(%rbx), %r9d
movl $0x8, %edi
leaq 0x81b0(%rip), %rsi      # 0x24bd4
leaq 0x86b8(%rip), %rdx      # 0x250e3
movl $0x71e, %ecx            # imm = 0x71E
leaq 0x86c0(%rip), %r8       # 0x250f7
xorl %eax, %eax
callq 0x17d92
cmpl $0x0, 0x8(%rbx)
jle 0x1cec4
movl $0x8, %r14d
xorl %r12d, %r12d
movq (%rbx), %r13
xorl %eax, %eax
callq 0x17d59
cmpl $0x8, (%rax)
jl 0x1ca9c
movzwl -0x8(%r13,%r14), %r9d
movzwl -0x6(%r13,%r14), %r10d
subq $0x8, %rsp
movl $0x8, %edi
leaq 0x8158(%rip), %rsi      # 0x24bd4
leaq 0x8660(%rip), %rdx      # 0x250e3
movl $0x724, %ecx            # imm = 0x724
leaq 0x8678(%rip), %r8       # 0x25107
xorl %eax, %eax
pushq %r10
callq 0x17d92
addq $0x10, %rsp
cmpq $0x0, (%r13,%r14)
je 0x1cb7c
cmpw $0x8, -0x8(%r13,%r14)
jne 0x1caf3
movq (%r13,%r14), %rsi
movzwl -0x6(%r13,%r14), %edx
leaq 0x1c(%rsp), %rdi
callq 0x1c564
testq %rax, %rax
je 0x1caf3
xorps %xmm0, %xmm0
movups %xmm0, 0x5e(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movzwl 0x1c(%rsp), %eax
cmpl $0x2, %eax
je 0x1cb11
cmpl $0x1, %eax
jne 0x1cb2c
movl $0x2, %edi
jmp 0x1cb16
xorl %eax, %eax
callq 0x17d59
cmpl $0x7, (%rax)
jl 0x1cb7c
movq (%r13,%r14), %rdi
movzwl -0x6(%r13,%r14), %esi
callq 0x1ddbd
jmp 0x1cb7c
movl $0xa, %edi
leaq 0x20(%rsp), %rsi
leaq 0x40(%rsp), %rdx
movl $0x2e, %ecx
callq 0x33b0
jmp 0x1cb31
movb $0x0, 0x40(%rsp)
xorl %eax, %eax
callq 0x17d59
cmpl $0x8, (%rax)
jl 0x1cb7c
movzbl 0x1e(%rsp), %r10d
movzbl 0x1f(%rsp), %r11d
movl $0x8, %edi
leaq 0x807f(%rip), %rsi      # 0x24bd4
leaq 0x8587(%rip), %rdx      # 0x250e3
movl $0x737, %ecx            # imm = 0x737
leaq 0x85c9(%rip), %r8       # 0x25131
leaq 0x40(%rsp), %r9
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x17d92
addq $0x10, %rsp
incq %r12
movslq 0x8(%rbx), %rax
addq $0x10, %r14
cmpq %rax, %r12
jl 0x1ca51
jmp 0x1cec4
cmpq $0x0, 0x18(%rbx)
je 0x1cec4
xorl %eax, %eax
callq 0x17d59
cmpl $0x7, (%rax)
jl 0x1cec4
movq 0x18(%rbx), %rdi
movzwl 0x10(%rbx), %esi
callq 0x1ddbd
jmp 0x1cec4
movq 0x18(%rbx), %rbx
testq %rbx, %rbx
je 0x1cec4
xorl %eax, %eax
callq 0x17d59
cmpl $0x8, (%rax)
jl 0x1cec4
movq (%rbx), %r9
subq $0x8, %rsp
movl $0x8, %edi
leaq 0x7fe2(%rip), %rsi      # 0x24bd4
leaq 0x83f3(%rip), %rdx      # 0x24fec
movl $0x6b7, %ecx            # imm = 0x6B7
leaq 0x83fc(%rip), %r8       # 0x25001
jmp 0x1cdeb
movq 0x18(%rbx), %rbx
testq %rbx, %rbx
je 0x1cec4
xorl %eax, %eax
callq 0x17d59
cmpl $0x8, (%rax)
jl 0x1cec4
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 0x7f8a(%rip), %rsi      # 0x24bd4
leaq 0x8422(%rip), %rdx      # 0x25073
movl $0x6dd, %ecx            # imm = 0x6DD
leaq 0x8429(%rip), %r8       # 0x25086
xorl %eax, %eax
pushq %r13
pushq %r12
pushq %r14
pushq %r11
pushq %r10
pushq 0x8(%rbx)
callq 0x17d92
addq $0x30, %rsp
jmp 0x1cec4
xorl %eax, %eax
callq 0x17d59
cmpl $0x8, (%rax)
jl 0x1cec4
movq 0x18(%rbx), %r9
movl $0x8, %edi
leaq 0x7f3a(%rip), %rsi      # 0x24bd4
leaq 0x82ef(%rip), %rdx      # 0x24f90
movl $0x762, %ecx            # imm = 0x762
jmp 0x1ce85
xorl %eax, %eax
callq 0x17d59
cmpl $0x8, (%rax)
jl 0x1cec4
movq 0x18(%rbx), %r9
movl $0x8, %edi
leaq 0x7f09(%rip), %rsi      # 0x24bd4
leaq 0x82be(%rip), %rdx      # 0x24f90
movl $0x76b, %ecx            # imm = 0x76B
leaq 0x82f3(%rip), %r8       # 0x24fd1
jmp 0x1cebd
xorl %eax, %eax
callq 0x17d59
cmpl $0x8, (%rax)
jl 0x1cec4
movq 0x18(%rbx), %r9
movl $0x8, %edi
leaq 0x7ed1(%rip), %rsi      # 0x24bd4
leaq 0x8286(%rip), %rdx      # 0x24f90
movl $0x768, %ecx            # imm = 0x768
leaq 0x82ae(%rip), %r8       # 0x24fc4
jmp 0x1cebd
xorl %eax, %eax
callq 0x17d59
cmpl $0x8, (%rax)
jl 0x1cec4
movq 0x18(%rbx), %r9
movl $0x8, %edi
leaq 0x7e99(%rip), %rsi      # 0x24bd4
leaq 0x824e(%rip), %rdx      # 0x24f90
movl $0x765, %ecx            # imm = 0x765
leaq 0x8269(%rip), %r8       # 0x24fb7
jmp 0x1cebd
movq 0x18(%rbx), %rsi
movl $0xa, %edi
leaq 0x10ffd(%rip), %rdx     # 0x2dd60
movl $0x2e, %ecx
callq 0x33b0
xorl %eax, %eax
callq 0x17d59
cmpl $0x8, (%rax)
jl 0x1cec4
movl $0x8, %edi
leaq 0x7e4b(%rip), %rsi      # 0x24bd4
leaq 0x83d0(%rip), %rdx      # 0x25160
movl $0x74f, %ecx            # imm = 0x74F
leaq 0x83d8(%rip), %r8       # 0x25174
leaq 0x10fbd(%rip), %r9      # 0x2dd60
jmp 0x1cebd
movq 0x18(%rbx), %rbx
testq %rbx, %rbx
je 0x1cec4
xorl %eax, %eax
callq 0x17d59
cmpl $0x8, (%rax)
jl 0x1cec4
movq (%rbx), %r9
subq $0x8, %rsp
movl $0x8, %edi
leaq 0x7dfc(%rip), %rsi      # 0x24bd4
leaq 0x8233(%rip), %rdx      # 0x25012
movl $0x6c2, %ecx            # imm = 0x6C2
leaq 0x823c(%rip), %r8       # 0x25027
xorl %eax, %eax
pushq 0x8(%rbx)
callq 0x17d92
jmp 0x1cf1a
xorl %eax, %eax
callq 0x17d59
cmpl $0x8, (%rax)
jl 0x1cec4
movq 0x18(%rbx), %r9
movl $0x8, %edi
leaq 0x7dba(%rip), %rsi      # 0x24bd4
leaq 0x816f(%rip), %rdx      # 0x24f90
movl $0x75f, %ecx            # imm = 0x75F
jmp 0x1ce85
xorl %eax, %eax
callq 0x17d59
cmpl $0x8, (%rax)
jl 0x1cec4
movq 0x18(%rbx), %r9
movl $0x8, %edi
leaq 0x7d8c(%rip), %rsi      # 0x24bd4
leaq 0x8141(%rip), %rdx      # 0x24f90
movl $0x759, %ecx            # imm = 0x759
leaq 0x8144(%rip), %r8       # 0x24f9f
jmp 0x1cebd
xorl %eax, %eax
callq 0x17d59
cmpl $0x8, (%rax)
jl 0x1cec4
movq 0x18(%rbx), %r9
movl $0x8, %edi
leaq 0x7d5b(%rip), %rsi      # 0x24bd4
leaq 0x8110(%rip), %rdx      # 0x24f90
movl $0x75c, %ecx            # imm = 0x75C
leaq 0x811e(%rip), %r8       # 0x24faa
jmp 0x1cebd
xorl %eax, %eax
callq 0x17d59
cmpl $0x8, (%rax)
jl 0x1cec4
movq 0x18(%rbx), %r9
movl $0x8, %edi
leaq 0x7d2a(%rip), %rsi      # 0x24bd4
leaq 0x80df(%rip), %rdx      # 0x24f90
movl $0x76e, %ecx            # imm = 0x76E
leaq 0x8121(%rip), %r8       # 0x24fde
xorl %eax, %eax
callq 0x17d92
incq %r15
cmpq 0x38(%rsp), %r15
jne 0x1c86a
jmp 0x1cf20
movq 0x18(%rbx), %rbx
testq %rbx, %rbx
je 0x1cec4
xorl %eax, %eax
callq 0x17d59
cmpl $0x8, (%rax)
jl 0x1cec4
movzwl (%rbx), %r9d
subq $0x8, %rsp
movl $0x8, %edi
leaq 0x7cd7(%rip), %rsi      # 0x24bd4
leaq 0x813d(%rip), %rdx      # 0x25041
movl $0x6cd, %ecx            # imm = 0x6CD
leaq 0x8143(%rip), %r8       # 0x25053
xorl %eax, %eax
pushq 0x8(%rbx)
callq 0x17d92
addq $0x10, %rsp
jmp 0x1cec4
xorl %eax, %eax
callq 0x17d59
cmpl $0x8, (%rax)
jl 0x1cf52
leaq 0x7ca1(%rip), %rsi      # 0x24bd4
leaq 0x7db9(%rip), %rdx      # 0x24cf3
leaq 0x7f2b(%rip), %r8       # 0x24e6c
movl $0x8, %edi
movl $0x7c8, %ecx            # imm = 0x7C8
xorl %eax, %eax
callq 0x17d92
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq