// File: /workspace/github_c_makefile_star2_O0/wahern[P]cqueues/src/lib/dns.c
// Function: dns_resconf_pton
int dns_resconf_pton(struct sockaddr_storage *ss, const char *src) {
	struct { char buf[128], *p; } addr = { "", addr.buf };
	unsigned short port = 0;
	int ch, af = AF_INET, error;

	while ((ch = *src++)) {
		switch (ch) {
		case ' ':
			/* FALL THROUGH */
		case '\t':
			break;
		case '[':
			break;
		case ']':
			while ((ch = *src++)) {
				if (dns_isdigit(ch)) {
					port *= 10;
					port += ch - '0';
				}
			}

			goto inet;
		case ':':
			af = AF_INET6;

			/* FALL THROUGH */
		default:
			if (addr.p < endof(addr.buf) - 1)
				*addr.p++ = ch;

			break;
		} /* switch() */
	} /* while() */
inet:

	if ((error = dns_pton(af, addr.buf, dns_sa_addr(af, ss, NULL))))
		return error;

	port = (!port)? 53 : port;
	*dns_sa_port(af, ss) = htons(port);
	dns_sa_family(ss) = af;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
leaq -0xa0(%rbp), %rdi
leaq 0x10a87(%rip), %rsi     # 0x4a8d8
movl $0x80, %edx
callq 0xfb40
leaq -0xa0(%rbp), %rax
movq %rax, -0x20(%rbp)
movw $0x0, -0xa2(%rbp)
movl $0x2, -0xac(%rbp)
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movsbl (%rax), %eax
movl %eax, -0xa8(%rbp)
cmpl $0x0, %eax
je 0x39f95
movl -0xa8(%rbp), %eax
movl %eax, -0xb4(%rbp)
subl $0x9, %eax
je 0x39ee5
jmp 0x39ead
movl -0xb4(%rbp), %eax
subl $0x20, %eax
je 0x39ee5
jmp 0x39eba
movl -0xb4(%rbp), %eax
subl $0x3a, %eax
je 0x39f50
jmp 0x39ecb
movl -0xb4(%rbp), %eax
subl $0x5b, %eax
je 0x39eea
jmp 0x39ed8
movl -0xb4(%rbp), %eax
subl $0x5d, %eax
je 0x39eef
jmp 0x39f5a
jmp 0x39f90
jmp 0x39f90
jmp 0x39ef1
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movsbl (%rax), %eax
movl %eax, -0xa8(%rbp)
cmpl $0x0, %eax
je 0x39f4e
movl -0xa8(%rbp), %eax
movzbl %al, %edi
callq 0x3a070
testb $0x1, %al
jne 0x39f22
jmp 0x39f4c
movzwl -0xa2(%rbp), %eax
imull $0xa, %eax, %eax
movw %ax, -0xa2(%rbp)
movl -0xa8(%rbp), %ecx
subl $0x30, %ecx
movzwl -0xa2(%rbp), %eax
addl %ecx, %eax
movw %ax, -0xa2(%rbp)
jmp 0x39ef1
jmp 0x39f97
movl $0xa, -0xac(%rbp)
movq -0x20(%rbp), %rax
leaq -0xa0(%rbp), %rcx
addq $0x80, %rcx
addq $-0x1, %rcx
cmpq %rcx, %rax
jae 0x39f8e
movl -0xa8(%rbp), %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, (%rax)
jmp 0x39f90
jmp 0x39e79
jmp 0x39f97
movl -0xac(%rbp), %eax
movl %eax, -0xc4(%rbp)
leaq -0xa0(%rbp), %rax
movq %rax, -0xc0(%rbp)
movl -0xac(%rbp), %edi
movq -0x10(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x3a110
movl -0xc4(%rbp), %edi
movq -0xc0(%rbp), %rsi
movq %rax, %rdx
callq 0x3a0b0
movl %eax, -0xb0(%rbp)
cmpl $0x0, %eax
je 0x39fef
movl -0xb0(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x3a063
cmpw $0x0, -0xa2(%rbp)
jne 0x3a006
movl $0x35, %eax
movl %eax, -0xc8(%rbp)
jmp 0x3a013
movzwl -0xa2(%rbp), %eax
movl %eax, -0xc8(%rbp)
movl -0xc8(%rbp), %eax
movw %ax, -0xa2(%rbp)
movzwl -0xa2(%rbp), %edi
callq 0xf0e0
movw %ax, -0xca(%rbp)
movl -0xac(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x3a1b0
movw -0xca(%rbp), %cx
movw %cx, (%rax)
movl -0xac(%rbp), %eax
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xd0, %rsp
popq %rbp
retq
nop