// File: /workspace/github_c_makefile_star2_O0/wahern[P]cqueues/src/lib/dns.c
// Function: dns_res_nameserv_cmp
static int dns_res_nameserv_cmp(struct dns_rr *a, struct dns_rr *b, struct dns_rr_i *i, struct dns_packet *P) {
	_Bool glued[2] = { 0 };
	struct dns_rr x = { 0 }, y = { 0 };
	struct dns_ns ns;
	int cmp, error;

	if (!(error = dns_ns_parse(&ns, a, P)))
		glued[0] = !!dns_rr_grep(&x, 1, dns_rr_i_new(P, .section = (DNS_S_ALL & ~DNS_S_QD), .name = ns.host, .type = DNS_T_A), P, &error);

	if (!(error = dns_ns_parse(&ns, b, P)))
		glued[1] = !!dns_rr_grep(&y, 1, dns_rr_i_new(P, .section = (DNS_S_ALL & ~DNS_S_QD), .name = ns.host, .type = DNS_T_A), P, &error);

	if ((cmp = glued[1] - glued[0])) {
		return cmp;
	} else if ((cmp = (dns_rr_offset(&y) < i->args[0]) - (dns_rr_offset(&x) < i->args[0]))) {
		return cmp;
	} else {
		return dns_rr_i_shuffle(a, b, i, P);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x220, %rsp            # imm = 0x220
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
leaq -0x2a(%rbp), %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0xf7d0
leaq -0x44(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0xf7d0
leaq -0x5c(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0xf7d0
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq -0x15c(%rbp), %rdi
callq 0x108a0
movl %eax, -0x164(%rbp)
cmpl $0x0, %eax
jne 0x44cea
leaq -0x1c0(%rbp), %rdi
xorl %esi, %esi
movl $0x58, %edx
callq 0xf7d0
movl $0xe, -0x1c0(%rbp)
leaq -0x15c(%rbp), %rax
movq %rax, -0x1b8(%rbp)
movl $0x1, -0x1b0(%rbp)
movq -0x28(%rbp), %rsi
leaq -0x1c0(%rbp), %rdi
callq 0x10750
movq %rax, %rdx
movq -0x28(%rbp), %rcx
leaq -0x44(%rbp), %rdi
movl $0x1, %esi
leaq -0x164(%rbp), %r8
callq 0xfe80
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movb %al, -0x2a(%rbp)
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq -0x15c(%rbp), %rdi
callq 0x108a0
movl %eax, -0x164(%rbp)
cmpl $0x0, %eax
jne 0x44d79
leaq -0x218(%rbp), %rdi
xorl %esi, %esi
movl $0x58, %edx
callq 0xf7d0
movl $0xe, -0x218(%rbp)
leaq -0x15c(%rbp), %rax
movq %rax, -0x210(%rbp)
movl $0x1, -0x208(%rbp)
movq -0x28(%rbp), %rsi
leaq -0x218(%rbp), %rdi
callq 0x10750
movq %rax, %rdx
movq -0x28(%rbp), %rcx
leaq -0x5c(%rbp), %rdi
movl $0x1, %esi
leaq -0x164(%rbp), %r8
callq 0xfe80
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movb -0x2a(%rbp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
subl %ecx, %eax
movl %eax, -0x160(%rbp)
cmpl $0x0, %eax
je 0x44da2
movl -0x160(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x44e18
leaq -0x5c(%rbp), %rdi
callq 0x43480
movzwl %ax, %eax
movq -0x20(%rbp), %rcx
cmpl 0x30(%rcx), %eax
setb %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x21c(%rbp)
leaq -0x44(%rbp), %rdi
callq 0x43480
movw %ax, %cx
movl -0x21c(%rbp), %eax
movzwl %cx, %ecx
movq -0x20(%rbp), %rdx
cmpl 0x30(%rdx), %ecx
setb %cl
andb $0x1, %cl
movzbl %cl, %ecx
subl %ecx, %eax
movl %eax, -0x160(%rbp)
cmpl $0x0, %eax
je 0x44e00
movl -0x160(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x44e18
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x109a0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x220, %rsp            # imm = 0x220
popq %rbp
retq
nopw %cs:(%rax,%rax)