// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_write_rdata
static int ns_write_rdata(serialize_ctx *ctx, stream_t *s, ns_rr_t *rr)
{
	switch (rr->type) {
	case NS_TYPE_HINFO:
		return ns_rdata_write_hinfo(ctx, s, rr);
	case NS_TYPE_CNAME:
	case NS_TYPE_MB:
	case NS_TYPE_MD:
	case NS_TYPE_MF:
	case NS_TYPE_MG:
	case NS_TYPE_MR:
	case NS_TYPE_NS:
	case NS_TYPE_PTR:
		return ns_rdata_write_domainname(ctx, s, rr);
	case NS_TYPE_MINFO:
		return ns_rdata_write_minfo(ctx, s, rr);
	case NS_TYPE_MX:
		return ns_rdata_write_mx(ctx, s, rr);
	case NS_TYPE_SOA:
		return ns_rdata_write_soa(ctx, s, rr);
	case NS_TYPE_OPT:
		return ns_rdata_write_opts(ctx, s, rr);
	case NS_TYPE_NULL:
	default:
		return ns_rdata_write_any(ctx, s, rr);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %rbx
movzwl 0x8(%rdx), %ecx
leal -0x2(%rcx), %eax
cmpl $0xd, %eax
ja 0x1ba73
movq %rdi, %r14
leaq 0x90ef(%rip), %rcx      # 0x24b3c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x18(%r15), %rdx
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1b81a
cmpl $0x29, %ecx
jne 0x1bb14
movq 0x18(%r15), %r14
xorl %ebp, %ebp
testq %r14, %r14
je 0x1bc94
cmpl $0x0, 0x8(%r14)
jle 0x1bc94
xorl %r15d, %r15d
xorl %r12d, %r12d
movq (%r14), %r13
movzwl (%r13,%r15), %esi
movq %rbx, %rdi
movl $0x2, %edx
callq 0x1d115
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x2, %eax
jne 0x1bc94
movzwl 0x2(%r13,%r15), %esi
movq %rbx, %rdi
movl $0x2, %edx
callq 0x1d115
cmpl $0x2, %eax
jne 0x1bc94
movq 0x8(%r13,%r15), %rsi
movzwl 0x2(%r13,%r15), %edx
movq %rbx, %rdi
callq 0x1cf7d
movzwl 0x2(%r13,%r15), %ecx
cmpl %ecx, %eax
jne 0x1bc94
incq %r12
movslq 0x8(%r14), %rax
addq $0x10, %r15
xorl %ebp, %ebp
cmpq %rax, %r12
jl 0x1ba9c
jmp 0x1bc94
movq 0x18(%r15), %rsi
testq %rsi, %rsi
je 0x1bc92
movzwl 0x10(%r15), %edx
movq %rbx, %rdi
callq 0x1cf7d
movzwl 0x10(%r15), %ecx
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl %ecx, %eax
je 0x1bc92
jmp 0x1bc94
movq 0x18(%r15), %r14
testq %r14, %r14
je 0x1bc92
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x1c8b4
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x1bc94
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x1c8b4
jmp 0x1bc8e
movq 0x18(%r15), %r15
testq %r15, %r15
je 0x1bc92
movzwl (%r15), %esi
movq %rbx, %rdi
movl $0x2, %edx
callq 0x1d115
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x2, %eax
je 0x1bc7f
jmp 0x1bc94
movq 0x18(%r15), %r15
testq %r15, %r15
je 0x1bc92
movq (%r15), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1b81a
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x1bc94
movq 0x8(%r15), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1b81a
testl %eax, %eax
jne 0x1bc94
movl 0x10(%r15), %esi
movq %rbx, %rdi
movl $0x4, %edx
callq 0x1d115
cmpl $0x4, %eax
jne 0x1bc94
movl 0x14(%r15), %esi
movq %rbx, %rdi
movl $0x4, %edx
callq 0x1d115
cmpl $0x4, %eax
jne 0x1bc94
movl 0x18(%r15), %esi
movq %rbx, %rdi
movl $0x4, %edx
callq 0x1d115
cmpl $0x4, %eax
jne 0x1bc94
movl 0x1c(%r15), %esi
movq %rbx, %rdi
movl $0x4, %edx
callq 0x1d115
cmpl $0x4, %eax
jne 0x1bc94
movl 0x20(%r15), %esi
movq %rbx, %rdi
movl $0x4, %edx
callq 0x1d115
cmpl $0x4, %eax
je 0x1bc92
jmp 0x1bc94
movq 0x18(%r15), %r15
testq %r15, %r15
je 0x1bc92
movq (%r15), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1b81a
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x1bc94
movq 0x8(%r15), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1b81a
testl %eax, %eax
jne 0x1bc94
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq