// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_set_ecs
int ns_set_ecs(ns_opt_t *opt, struct sockaddr *addr, int srcprefix, int scopeprefix)
{
	if (addr->sa_family == AF_INET) {
		return ns_set_ecs4(opt, (struct sockaddr_in*)addr, srcprefix, scopeprefix);
	}
	else if (addr->sa_family == AF_INET6) {
		return ns_set_ecs6(opt, (struct sockaddr_in6*)addr, srcprefix, scopeprefix);
	}
	else {
		loge("No support family %d\n", addr->sa_family);
		return -1;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edx, %r14d
movq %rsi, %r13
movq %rdi, %r15
movzwl (%rsi), %eax
cmpl $0xa, %eax
je 0x1b3b5
cmpl $0x2, %eax
jne 0x1b4b2
movl %ecx, 0x4(%rsp)
movl 0x4(%r13), %eax
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
leal 0x7(%r14), %ecx
testl %r14d, %r14d
cmovnsl %r14d, %ecx
movl %ecx, %edx
sarl $0x3, %edx
andl $-0x8, %ecx
xorl %esi, %esi
movl %r14d, %ebp
subl %ecx, %ebp
setne %sil
addl %edx, %esi
cmpl $0x4, %esi
movl $0x4, %r12d
cmovll %esi, %r12d
movl %eax, 0x20(%rsp)
movq 0x8(%r15), %rdi
leal 0x4(%r12), %ebx
movslq %ebx, %rsi
callq 0x35b0
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x1b4f3
testl %ebp, %ebp
je 0x1b394
movb $0x8, %cl
subb %bpl, %cl
movl $0xff, %edx
shll %cl, %edx
movslq %r12d, %rcx
leaq 0x20(%rsp), %rsi
andb %dl, -0x1(%rcx,%rsi)
movw %bx, 0x2(%r15)
movq %rax, 0x8(%r15)
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
movzwl %bx, %eax
movl %eax, 0x10(%rdi)
movl $0x1, %esi
jmp 0x1b44d
movl %ecx, 0x4(%rsp)
xorps %xmm0, %xmm0
leal 0x7(%r14), %eax
testl %r14d, %r14d
cmovnsl %r14d, %eax
movl %eax, %ecx
sarl $0x3, %ecx
andl $-0x8, %eax
xorl %edx, %edx
movl %r14d, %ebx
subl %eax, %ebx
setne %dl
addl %ecx, %edx
cmpl $0x10, %edx
movl $0x10, %r12d
cmovll %edx, %r12d
movups %xmm0, 0x10(%rsp)
movq 0x8(%r15), %rdi
leal 0x4(%r12), %ebp
movslq %ebp, %rsi
callq 0x35b0
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x1b4f3
movups 0x8(%r13), %xmm0
movaps %xmm0, 0x20(%rsp)
testl %ebx, %ebx
je 0x1b431
movb $0x8, %cl
subb %bl, %cl
movl $0xff, %edx
shll %cl, %edx
movslq %r12d, %rcx
leaq 0x20(%rsp), %rsi
andb %dl, -0x1(%rcx,%rsi)
movw %bp, 0x2(%r15)
movq %rax, 0x8(%r15)
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
movzwl %bp, %eax
movl %eax, 0x10(%rdi)
movl $0x2, %esi
movl $0x2, %edx
callq 0x1d115
cmpl $0x2, %eax
jne 0x1b4ee
leaq 0x8(%rsp), %rdi
movl %r14d, %esi
movl $0x1, %edx
callq 0x1d115
cmpl $0x1, %eax
jne 0x1b4ee
leaq 0x8(%rsp), %rdi
movl 0x4(%rsp), %esi
movl $0x1, %edx
callq 0x1d115
cmpl $0x1, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
jne 0x1b4f3
leaq 0x8(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movl %r12d, %edx
callq 0x1cf7d
xorl %ecx, %ecx
cmpl %r12d, %eax
setne %cl
negl %ecx
jmp 0x1b4f3
xorl %eax, %eax
callq 0x176e5
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl $0x3, (%rax)
jl 0x1b4f3
movzwl (%r13), %r9d
leaq 0x9715(%rip), %rsi      # 0x24be4
leaq 0x980c(%rip), %rdx      # 0x24ce2
leaq 0x9810(%rip), %r8       # 0x24ced
movl $0x3, %edi
movl $0x51f, %ecx            # imm = 0x51F
xorl %eax, %eax
callq 0x1771e
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl %ecx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq