// File: /workspace/github_c_makefile_star2_O0/wahern[P]cqueues/src/lib/dns.c
// Function: dns_resconf_dump
int dns_resconf_dump(struct dns_resolv_conf *resconf, FILE *fp) {
	unsigned i;
	int af;

	for (i = 0; i < lengthof(resconf->nameserver) && (af = resconf->nameserver[i].ss_family) != AF_UNSPEC; i++) {
		char addr[INET6_ADDRSTRLEN + 1]	= "[INVALID]";
		unsigned short port;

		dns_inet_ntop(af, dns_sa_addr(af, &resconf->nameserver[i], NULL), addr, sizeof addr);
		port = ntohs(*dns_sa_port(af, &resconf->nameserver[i]));

		if (port == 53)
			fprintf(fp, "nameserver %s\n", addr);
		else
			fprintf(fp, "nameserver [%s]:%hu\n", addr, port);
	}


	fprintf(fp, "search");

	for (i = 0; i < lengthof(resconf->search) && resconf->search[i][0]; i++)
		fprintf(fp, " %s", resconf->search[i]);

	fputc('\n', fp);


	fputs("; ", fp);
	dns_nssconf_dump(resconf, fp);

	fprintf(fp, "lookup");

	for (i = 0; i < lengthof(resconf->lookup) && resconf->lookup[i]; i++) {
		switch (resconf->lookup[i]) {
		case 'b':
			fprintf(fp, " bind"); break;
		case 'f':
			fprintf(fp, " file"); break;
		case 'c':
			fprintf(fp, " cache"); break;
		}
	}

	fputc('\n', fp);


	fprintf(fp, "options ndots:%u timeout:%u attempts:%u", resconf->options.ndots, resconf->options.timeout, resconf->options.attempts);

	if (resconf->options.edns0)
		fprintf(fp, " edns0");
	if (resconf->options.rotate)
		fprintf(fp, " rotate");
	if (resconf->options.recurse)
		fprintf(fp, " recurse");
	if (resconf->options.smart)
		fprintf(fp, " smart");

	switch (resconf->options.tcp) {
	case DNS_RESCONF_TCP_ENABLE:
		break;
	case DNS_RESCONF_TCP_ONLY:
		fprintf(fp, " tcp");
		break;
	case DNS_RESCONF_TCP_DISABLE:
		fprintf(fp, " tcp:disable");
		break;
	}

	fputc('\n', fp);


	if ((af = resconf->iface.ss_family) != AF_UNSPEC) {
		char addr[INET6_ADDRSTRLEN + 1]	= "[INVALID]";

		dns_inet_ntop(af, dns_sa_addr(af, &resconf->iface, NULL), addr, sizeof addr);

		fprintf(fp, "interface %s %hu\n", addr, ntohs(*dns_sa_port(af, &resconf->iface)));
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl %eax, %ecx
xorl %eax, %eax
cmpq $0x3, %rcx
movb %al, -0x91(%rbp)
jae 0x3bbdd
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
shlq $0x7, %rcx
addq %rcx, %rax
movzwl (%rax), %eax
movl %eax, -0x18(%rbp)
cmpl $0x0, %eax
setne %al
movb %al, -0x91(%rbp)
movb -0x91(%rbp), %al
testb $0x1, %al
jne 0x3bbec
jmp 0x3bca8
leaq -0x50(%rbp), %rdi
leaq 0xed69(%rip), %rsi      # 0x4a960
movl $0x2f, %edx
callq 0xfb40
movl -0x18(%rbp), %eax
movl %eax, -0x98(%rbp)
movl -0x18(%rbp), %edi
movq -0x8(%rbp), %rsi
movl -0x14(%rbp), %eax
shlq $0x7, %rax
addq %rax, %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x3a110
movl -0x98(%rbp), %edi
movq %rax, %rsi
leaq -0x50(%rbp), %rdx
movl $0x2f, %ecx
callq 0xfeb0
movl -0x18(%rbp), %edi
movq -0x8(%rbp), %rsi
movl -0x14(%rbp), %eax
shlq $0x7, %rax
addq %rax, %rsi
callq 0x3a1b0
movzwl (%rax), %edi
callq 0x10a80
movw %ax, -0x52(%rbp)
movzwl -0x52(%rbp), %eax
cmpl $0x35, %eax
jne 0x3bc7e
movq -0x10(%rbp), %rdi
leaq -0x50(%rbp), %rdx
leaq 0x1190f(%rip), %rsi     # 0x4d584
movb $0x0, %al
callq 0x10440
jmp 0x3bc98
movq -0x10(%rbp), %rdi
leaq -0x50(%rbp), %rdx
movzwl -0x52(%rbp), %ecx
leaq 0x11902(%rip), %rsi     # 0x4d593
movb $0x0, %al
callq 0x10440
jmp 0x3bc9a
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x3bbaa
movq -0x10(%rbp), %rdi
leaq 0xd98d(%rip), %rsi      # 0x49640
movb $0x0, %al
callq 0x10440
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl %eax, %ecx
xorl %eax, %eax
cmpq $0x4, %rcx
movb %al, -0x99(%rbp)
jae 0x3bcf7
movq -0x8(%rbp), %rax
addq $0x180, %rax            # imm = 0x180
movl -0x14(%rbp), %ecx
shlq $0x8, %rcx
addq %rcx, %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x99(%rbp)
movb -0x99(%rbp), %al
testb $0x1, %al
jne 0x3bd03
jmp 0x3bd35
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rdx
addq $0x180, %rdx            # imm = 0x180
movl -0x14(%rbp), %eax
shlq $0x8, %rax
addq %rax, %rdx
leaq 0xd3fd(%rip), %rsi      # 0x49120
movb $0x0, %al
callq 0x10440
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x3bcc1
movq -0x10(%rbp), %rsi
movl $0xa, %edi
callq 0x10140
movq -0x10(%rbp), %rsi
leaq 0x1185a(%rip), %rdi     # 0x4d5a8
callq 0xffb0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x10450
movq -0x10(%rbp), %rdi
leaq 0xd8e9(%rip), %rsi      # 0x49654
movb $0x0, %al
callq 0x10440
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl %eax, %ecx
xorl %eax, %eax
cmpq $0x24, %rcx
movb %al, -0x9a(%rbp)
jae 0x3bda7
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
movsbl 0x580(%rax,%rcx), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x9a(%rbp)
movb -0x9a(%rbp), %al
testb $0x1, %al
jne 0x3bdb6
jmp 0x3be36
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
movsbl 0x580(%rax,%rcx), %eax
movl %eax, -0xa0(%rbp)
subl $0x62, %eax
je 0x3bdec
jmp 0x3bdd2
movl -0xa0(%rbp), %eax
subl $0x63, %eax
je 0x3be14
jmp 0x3bddf
movl -0xa0(%rbp), %eax
subl $0x66, %eax
je 0x3be00
jmp 0x3be26
movq -0x10(%rbp), %rdi
leaq 0x117b4(%rip), %rsi     # 0x4d5ab
movb $0x0, %al
callq 0x10440
jmp 0x3be26
movq -0x10(%rbp), %rdi
leaq 0x117a6(%rip), %rsi     # 0x4d5b1
movb $0x0, %al
callq 0x10440
jmp 0x3be26
movq -0x10(%rbp), %rdi
leaq 0x11798(%rip), %rsi     # 0x4d5b7
movb $0x0, %al
callq 0x10440
jmp 0x3be28
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x3bd79
movq -0x10(%rbp), %rsi
movl $0xa, %edi
callq 0x10140
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x5b4(%rax), %edx
movq -0x8(%rbp), %rax
movl 0x5b8(%rax), %ecx
movq -0x8(%rbp), %rax
movl 0x5bc(%rax), %r8d
leaq 0x11750(%rip), %rsi     # 0x4d5be
movb $0x0, %al
callq 0x10440
movq -0x8(%rbp), %rax
testb $0x1, 0x5b0(%rax)
je 0x3be94
movq -0x10(%rbp), %rdi
leaq 0x11759(%rip), %rsi     # 0x4d5e6
movb $0x0, %al
callq 0x10440
movq -0x8(%rbp), %rax
testb $0x1, 0x5c0(%rax)
je 0x3beb3
movq -0x10(%rbp), %rdi
leaq 0x11741(%rip), %rsi     # 0x4d5ed
movb $0x0, %al
callq 0x10440
movq -0x8(%rbp), %rax
testb $0x1, 0x5c1(%rax)
je 0x3bed2
movq -0x10(%rbp), %rdi
leaq 0x1172a(%rip), %rsi     # 0x4d5f5
movb $0x0, %al
callq 0x10440
movq -0x8(%rbp), %rax
testb $0x1, 0x5c2(%rax)
je 0x3bef1
movq -0x10(%rbp), %rdi
leaq 0x11714(%rip), %rsi     # 0x4d5fe
movb $0x0, %al
callq 0x10440
movq -0x8(%rbp), %rax
movl 0x5c4(%rax), %eax
movl %eax, -0xa4(%rbp)
testl %eax, %eax
je 0x3bf21
jmp 0x3bf07
movl -0xa4(%rbp), %eax
subl $0x1, %eax
je 0x3bf23
jmp 0x3bf14
movl -0xa4(%rbp), %eax
subl $0x2, %eax
je 0x3bf37
jmp 0x3bf49
jmp 0x3bf49
movq -0x10(%rbp), %rdi
leaq 0x116d7(%rip), %rsi     # 0x4d605
movb $0x0, %al
callq 0x10440
jmp 0x3bf49
movq -0x10(%rbp), %rdi
leaq 0x116c8(%rip), %rsi     # 0x4d60a
movb $0x0, %al
callq 0x10440
movq -0x10(%rbp), %rsi
movl $0xa, %edi
callq 0x10140
movq -0x8(%rbp), %rax
movzwl 0x5c8(%rax), %eax
movl %eax, -0x18(%rbp)
cmpl $0x0, %eax
je 0x3c013
leaq -0x90(%rbp), %rdi
leaq 0xea14(%rip), %rsi      # 0x4a990
movl $0x2f, %edx
callq 0xfb40
movl -0x18(%rbp), %eax
movl %eax, -0xbc(%rbp)
movl -0x18(%rbp), %edi
movq -0x8(%rbp), %rsi
addq $0x5c8, %rsi            # imm = 0x5C8
xorl %eax, %eax
movl %eax, %edx
callq 0x3a110
movl -0xbc(%rbp), %edi
movq %rax, %rsi
leaq -0x90(%rbp), %rdx
movl $0x2f, %ecx
callq 0xfeb0
movq -0x10(%rbp), %rax
movq %rax, -0xb8(%rbp)
leaq -0x90(%rbp), %rax
movq %rax, -0xb0(%rbp)
movl -0x18(%rbp), %edi
movq -0x8(%rbp), %rsi
addq $0x5c8, %rsi            # imm = 0x5C8
callq 0x3a1b0
movzwl (%rax), %edi
callq 0x10a80
movq -0xb8(%rbp), %rdi
movq -0xb0(%rbp), %rdx
movzwl %ax, %ecx
leaq 0x1160b(%rip), %rsi     # 0x4d617
movb $0x0, %al
callq 0x10440
xorl %eax, %eax
addq $0xc0, %rsp
popq %rbp
retq
nop