// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x80, %rsp
movq %rdi, -0x28(%rbp)
movb $0x0, %al
callq 0x242d0
cmpl $0x8, (%rax)
jl 0x2a6d8
movl $0x8, %edi
leaq 0xdd56(%rip), %rsi      # 0x38414
leaq 0xde6e(%rip), %rdx      # 0x38533
movl $0x792, %ecx            # imm = 0x792
leaq 0xde6b(%rip), %r8       # 0x3853c
movb $0x0, %al
callq 0x243b0
jmp 0x2a6da
jmp 0x2a6dc
movb $0x0, %al
callq 0x242d0
cmpl $0x8, (%rax)
jl 0x2a782
movq -0x28(%rbp), %rax
movzwl (%rax), %r9d
andl $0xffff, %r9d           # imm = 0xFFFF
movq -0x28(%rbp), %rax
movzwl 0x2(%rax), %r14d
andl $0xffff, %r14d          # imm = 0xFFFF
movq -0x28(%rbp), %rax
movzwl 0x4(%rax), %ebx
andl $0xffff, %ebx           # imm = 0xFFFF
movq -0x28(%rbp), %rax
movzwl 0x6(%rax), %r11d
andl $0xffff, %r11d          # imm = 0xFFFF
movq -0x28(%rbp), %rax
movzwl 0x8(%rax), %r10d
andl $0xffff, %r10d          # imm = 0xFFFF
movq -0x28(%rbp), %rax
movzwl 0xa(%rax), %eax
andl $0xffff, %eax           # imm = 0xFFFF
movl $0x8, %edi
leaq 0xdcc2(%rip), %rsi      # 0x38414
leaq 0xddda(%rip), %rdx      # 0x38533
movl $0x799, %ecx            # imm = 0x799
leaq 0xddea(%rip), %r8       # 0x3854f
movl %r14d, (%rsp)
movl %ebx, 0x8(%rsp)
movl %r11d, 0x10(%rsp)
movl %r10d, 0x18(%rsp)
movl %eax, 0x20(%rsp)
movb $0x0, %al
callq 0x243b0
jmp 0x2a784
movq -0x28(%rbp), %rdi
callq 0x26e80
movw %ax, -0x44(%rbp)
movw -0x44(%rbp), %ax
movw %ax, -0x42(%rbp)
movb $0x0, %al
callq 0x242d0
cmpl $0x8, (%rax)
jl 0x2a8b5
movw -0x42(%rbp), %ax
andw $0x1, %ax
movzbl %al, %ecx
leaq 0xcd2b(%rip), %r9       # 0x374e6
leaq 0xde05(%rip), %rax      # 0x385c7
cmpl $0x0, %ecx
cmovneq %rax, %r9
movw -0x42(%rbp), %ax
shrw $0x5, %ax
andw $0x1, %ax
movzbl %al, %ecx
leaq 0xcd07(%rip), %r15      # 0x374e6
leaq 0xdde5(%rip), %rax      # 0x385cb
cmpl $0x0, %ecx
cmovneq %rax, %r15
movw -0x42(%rbp), %ax
shrw $0x6, %ax
andw $0x1, %ax
movzbl %al, %ecx
leaq 0xcce3(%rip), %r14      # 0x374e6
leaq 0xddc5(%rip), %rax      # 0x385cf
cmpl $0x0, %ecx
cmovneq %rax, %r14
movw -0x42(%rbp), %ax
shrw $0x7, %ax
andw $0x1, %ax
movzbl %al, %ecx
leaq 0xccbf(%rip), %rbx      # 0x374e6
leaq 0xdda5(%rip), %rax      # 0x385d3
cmpl $0x0, %ecx
cmovneq %rax, %rbx
movw -0x42(%rbp), %ax
shrw $0x8, %ax
andw $0x1, %ax
movzbl %al, %ecx
leaq 0xcc9b(%rip), %r11      # 0x374e6
leaq 0xdd85(%rip), %rax      # 0x385d7
cmpl $0x0, %ecx
cmovneq %rax, %r11
movw -0x42(%rbp), %ax
shrw %ax
andw $0xf, %ax
movzbl %al, %r10d
movw -0x42(%rbp), %ax
shrw $0xc, %ax
movzbl %al, %eax
movl $0x8, %edi
leaq 0xdb95(%rip), %rsi      # 0x38414
leaq 0xdcad(%rip), %rdx      # 0x38533
movl $0x7a2, %ecx            # imm = 0x7A2
leaq 0xdd10(%rip), %r8       # 0x385a2
movq %r15, (%rsp)
movq %r14, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
movq %r11, 0x18(%rsp)
movl %r10d, 0x20(%rsp)
movl %eax, 0x28(%rsp)
movb $0x0, %al
callq 0x243b0
jmp 0x2a8b7
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x28(%rbp), %rcx
movzwl 0x4(%rcx), %ecx
cmpl %ecx, %eax
jge 0x2a995
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movb $0x0, %al
callq 0x242d0
cmpl $0x8, (%rax)
jl 0x2a983
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x38(%rbp), %rax
movzwl 0x8(%rax), %ebx
andl $0xffff, %ebx           # imm = 0xFFFF
movq -0x38(%rbp), %rax
movzwl 0x8(%rax), %edi
callq 0x27a50
movq %rax, -0x50(%rbp)
movq -0x38(%rbp), %rax
movzwl 0xa(%rax), %eax
andl $0xffff, %eax           # imm = 0xFFFF
movl %eax, -0x48(%rbp)
movq -0x38(%rbp), %rax
movzwl 0xa(%rax), %edi
callq 0x27d20
movq -0x58(%rbp), %r9
movq -0x50(%rbp), %r11
movl -0x48(%rbp), %r10d
movl $0x8, %edi
leaq 0xdabd(%rip), %rsi      # 0x38414
leaq 0xdbd5(%rip), %rdx      # 0x38533
movl $0x7ab, %ecx            # imm = 0x7AB
leaq 0xdc71(%rip), %r8       # 0x385db
movl %ebx, (%rsp)
movq %r11, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movb $0x0, %al
callq 0x243b0
jmp 0x2a985
jmp 0x2a987
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x2a8be
movl $0x0, -0x2c(%rbp)
movq -0x28(%rbp), %rax
movzwl 0x6(%rax), %eax
movq -0x28(%rbp), %rcx
movzwl 0x8(%rcx), %ecx
addl %ecx, %eax
movq -0x28(%rbp), %rcx
movzwl 0xa(%rcx), %ecx
addl %ecx, %eax
movl %eax, -0x30(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x2ab9c
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movzwl 0x8(%rax), %eax
cmpl $0x29, %eax
jne 0x2aacc
jmp 0x2a9f1
movb $0x0, %al
callq 0x242d0
cmpl $0x8, (%rax)
jl 0x2aac5
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x40(%rbp), %rax
movzwl 0x8(%rax), %r12d
andl $0xffff, %r12d          # imm = 0xFFFF
movq -0x40(%rbp), %rax
movzwl 0x8(%rax), %edi
callq 0x27a50
movq -0x60(%rbp), %r9
movq %rax, %r15
movq -0x40(%rbp), %rax
movzwl 0xa(%rax), %r14d
andl $0xffff, %r14d          # imm = 0xFFFF
movq -0x40(%rbp), %rax
movl 0xc(%rax), %ebx
shrl $0x18, %ebx
andl $0xff, %ebx
movq -0x40(%rbp), %rax
movl 0xc(%rax), %r11d
shrl $0x10, %r11d
andl $0xff, %r11d
movq -0x40(%rbp), %rax
movl 0xc(%rax), %r10d
andl $0xffff, %r10d          # imm = 0xFFFF
movq -0x40(%rbp), %rax
movzwl 0x10(%rax), %eax
andl $0xffff, %eax           # imm = 0xFFFF
movl $0x8, %edi
leaq 0xd989(%rip), %rsi      # 0x38414
leaq 0xdaa1(%rip), %rdx      # 0x38533
movl $0x7ba, %ecx            # imm = 0x7BA
leaq 0xdb6d(%rip), %r8       # 0x3860b
movl %r12d, (%rsp)
movq %r15, 0x8(%rsp)
movl %r14d, 0x10(%rsp)
movl %ebx, 0x18(%rsp)
movl %r11d, 0x20(%rsp)
movl %r10d, 0x28(%rsp)
movl %eax, 0x30(%rsp)
movb $0x0, %al
callq 0x243b0
jmp 0x2aac7
jmp 0x2ab85
jmp 0x2aace
movb $0x0, %al
callq 0x242d0
cmpl $0x8, (%rax)
jl 0x2ab81
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x40(%rbp), %rax
movzwl 0x8(%rax), %r15d
andl $0xffff, %r15d          # imm = 0xFFFF
movq -0x40(%rbp), %rax
movzwl 0x8(%rax), %edi
callq 0x27a50
movq %rax, %r14
movq -0x40(%rbp), %rax
movzwl 0xa(%rax), %ebx
andl $0xffff, %ebx           # imm = 0xFFFF
movq -0x40(%rbp), %rax
movzwl 0xa(%rax), %edi
callq 0x27d20
movq -0x68(%rbp), %r9
movq %rax, %r11
movq -0x40(%rbp), %rax
movl 0xc(%rax), %r10d
movq -0x40(%rbp), %rax
movzwl 0x10(%rax), %eax
andl $0xffff, %eax           # imm = 0xFFFF
movl $0x8, %edi
leaq 0xd8c8(%rip), %rsi      # 0x38414
leaq 0xd9e0(%rip), %rdx      # 0x38533
movl $0x7c4, %ecx            # imm = 0x7C4
leaq 0xdb08(%rip), %r8       # 0x38667
movl %r15d, (%rsp)
movq %r14, 0x8(%rsp)
movl %ebx, 0x10(%rsp)
movq %r11, 0x18(%rsp)
movl %r10d, 0x20(%rsp)
movl %eax, 0x28(%rsp)
movb $0x0, %al
callq 0x243b0
jmp 0x2ab83
jmp 0x2ab85
movq -0x40(%rbp), %rdi
callq 0x2abf0
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x2a9bb
jmp 0x2ab9e
movb $0x0, %al
callq 0x242d0
cmpl $0x8, (%rax)
jl 0x2abd0
movl $0x8, %edi
leaq 0xd85e(%rip), %rsi      # 0x38414
leaq 0xd976(%rip), %rdx      # 0x38533
movl $0x7c8, %ecx            # imm = 0x7C8
leaq 0xdae3(%rip), %r8       # 0x386ac
movb $0x0, %al
callq 0x243b0
jmp 0x2abd2
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)