// File: /workspace/github_c_makefile_star2_O2/wahern[P]cqueues/src/lib/dns.c
// Function: dns_rr_grep
unsigned dns_rr_grep(struct dns_rr *rr, unsigned lim, struct dns_rr_i *i, struct dns_packet *P, int *error_) {
	unsigned count	= 0;
	int error;

	switch (i->state.exec) {
	case 0:
		if (!i->sort)
			i->sort	= &dns_rr_i_packet;

		i->state.next	= dns_rr_i_start(i, P);
		i->state.exec++;

		/* FALL THROUGH */
	case 1:
		while (count < lim && i->state.next < P->end) {
			if ((error = dns_rr_parse(rr, i->state.next, P)))
				goto error;

			rr->section	= dns_rr_section(i->state.next, P);

			rr++;
			count++;
			i->state.count++;

			i->state.next	= dns_rr_i_skip(i->state.next, i, P);
		} /* while() */

		break;
	} /* switch() */

	return count;
error:
	*error_	= error;

	return count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %r8, 0x70(%rsp)
movq %rcx, %r14
movq %rdx, %r15
movl %esi, 0xc(%rsp)
movq %rdi, %r12
movl 0x3c(%rdx), %eax
cmpl $0x1, %eax
je 0x23ad8
xorl %r13d, %r13d
testl %eax, %eax
jne 0x23d05
cmpq $0x0, 0x28(%r15)
jne 0x2399b
movq 0x215f1(%rip), %rax     # 0x44f88
movq %rax, 0x28(%r15)
movl (%r15), %eax
testb $0x1, %al
je 0x239ac
movzwl 0x20(%r14), %ebx
testw %bx, %bx
jne 0x239da
testb $0x2, %al
je 0x239ba
movzwl 0x24(%r14), %ebx
testw %bx, %bx
jne 0x239da
testb $0x4, %al
je 0x239c8
movzwl 0x28(%r14), %ebx
testw %bx, %bx
jne 0x239da
testb $0x8, %al
je 0x239d6
movzwl 0x2c(%r14), %ebx
testw %bx, %bx
jne 0x239da
movw $0xc, %bx
leaq 0x10(%rsp), %r13
movzwl %bx, %ebp
movq 0x50(%r14), %rax
cmpq %rbp, %rax
jbe 0x23acf
movq %r13, %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0xf750
testl %eax, %eax
jne 0x23a20
movl %ebp, %edi
movq %r14, %rsi
callq 0x251e8
movl %eax, 0x10(%rsp)
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x2df10
testb %al, %al
jne 0x23a2e
movl %ebp, %edi
movq %r14, %rsi
callq 0xf2f0
movl %eax, %ebx
jmp 0x239df
movq 0x20(%rsp), %rax
movq %rax, 0x40(%rsp)
movups 0x10(%rsp), %xmm0
movaps %xmm0, 0x30(%rsp)
movq 0x28(%r15), %rax
cmpq 0x2153b(%rip), %rax     # 0x44f88
je 0x23aca
leaq 0x10(%rsp), %r13
leaq 0x30(%rsp), %rbp
movzwl %bx, %edi
movq %r14, %rsi
callq 0xf2f0
movzwl %ax, %ebx
cmpq %rbx, 0x50(%r14)
jbe 0x23aca
movq %r13, %rdi
movl %ebx, %esi
movq %r14, %rdx
callq 0xf750
testl %eax, %eax
jne 0x23a59
movl %ebx, %edi
movq %r14, %rsi
callq 0x251e8
movl %eax, 0x10(%rsp)
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x2df10
testb %al, %al
je 0x23a59
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq *0x28(%r15)
testl %eax, %eax
jns 0x23a59
movq 0x20(%rsp), %rax
movq %rax, 0x40(%rsp)
movups 0x10(%rsp), %xmm0
movaps %xmm0, 0x30(%rsp)
jmp 0x23a59
movzwl 0x34(%rsp), %eax
movw %ax, 0x38(%r15)
incl 0x3c(%r15)
leaq 0x58(%rsp), %rbx
xorl %r13d, %r13d
movq %r15, 0x50(%rsp)
cmpl 0xc(%rsp), %r13d
je 0x23cf7
movzwl 0x38(%r15), %eax
cmpq %rax, 0x50(%r14)
jbe 0x23d05
movzwl %ax, %esi
movq %r12, %rdi
movq %r14, %rdx
callq 0xf750
testl %eax, %eax
jne 0x23cfe
movl %r13d, 0x8(%rsp)
movq %rbx, %r13
movzwl 0x38(%r15), %ebx
movzwl %bx, %ebp
movl %ebp, %edi
movq %r14, %rsi
callq 0x251e8
movl %eax, (%r12)
incw 0x3a(%r15)
leaq 0x30(%rsp), %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0xf750
testl %eax, %eax
je 0x23b5d
movzwl 0x50(%r14), %eax
movq %r13, %rbx
movl 0x8(%rsp), %r13d
jmp 0x23ccc
movl %ebp, %edi
movq %r14, %rsi
callq 0x251e8
movl %eax, 0x30(%rsp)
movw $0xc, %bp
movq 0x21412(%rip), %rax     # 0x44f88
cmpq %rax, 0x28(%r15)
jne 0x23b89
movzwl %bx, %edi
movq %r14, %rsi
callq 0xf2f0
movl %eax, %ebp
movzwl %bp, %ebx
movq 0x50(%r14), %rax
cmpq %rbx, %rax
jbe 0x23cbf
movq %r12, 0x28(%rsp)
movq %r13, %r12
movq %r13, %rdi
movl %ebx, %esi
movq %r14, %rdx
callq 0xf750
testl %eax, %eax
jne 0x23cdd
movl %ebx, %edi
movq %r14, %rsi
callq 0x251e8
movl %eax, 0x58(%rsp)
movq %r12, %rdi
movq 0x50(%rsp), %r15
movq %r15, %rsi
movq %r14, %rdx
callq 0x2df10
testb %al, %al
je 0x23cdd
movq %r12, %rbx
movq %r12, %rdi
leaq 0x30(%rsp), %rsi
movq %r15, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq *0x28(%r15)
testl %eax, %eax
movq 0x28(%rsp), %r12
jle 0x23cf0
movq 0x68(%rsp), %rax
movq %rax, 0x20(%rsp)
movups 0x58(%rsp), %xmm0
movaps %xmm0, 0x10(%rsp)
movq 0x2136a(%rip), %rax     # 0x44f88
cmpq %rax, 0x28(%r15)
movl 0x8(%rsp), %r13d
je 0x23ce9
movzwl %bp, %edi
movq %r14, %rsi
callq 0xf2f0
movzwl %ax, %ebp
cmpq %rbp, 0x50(%r14)
jbe 0x23ce9
movq %rbx, %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0xf750
testl %eax, %eax
jne 0x23c2d
movl %ebp, %edi
movq %r14, %rsi
callq 0x251e8
movl %eax, 0x58(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x2df10
testb %al, %al
je 0x23c2d
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
movq %r15, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq *0x28(%r15)
testl %eax, %eax
jle 0x23c2d
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
movq %r15, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq *0x28(%r15)
testl %eax, %eax
jns 0x23c2d
movq 0x68(%rsp), %rax
movq %rax, 0x20(%rsp)
movups 0x58(%rsp), %xmm0
movaps %xmm0, 0x10(%rsp)
jmp 0x23c2d
movq %r13, %rbx
movl 0x8(%rsp), %r13d
movq 0x50(%rsp), %r15
addq $0x18, %r12
incl %r13d
movw %ax, 0x38(%r15)
jmp 0x23ae5
movl %ebp, %ebx
movq 0x28(%rsp), %r12
jmp 0x23b7c
movzwl 0x14(%rsp), %eax
jmp 0x23ccc
movl %ebp, %ebx
jmp 0x23b7c
movl 0xc(%rsp), %r13d
jmp 0x23d05
movq 0x70(%rsp), %rcx
movl %eax, (%rcx)
movl %r13d, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq