// File: /workspace/github_c_makefile_star2_O0/wahern[P]cqueues/src/lib/dns.c
// Function: dns_rr_i_skip
static unsigned short dns_rr_i_skip(unsigned short rp, struct dns_rr_i *i, struct dns_packet *P) {
	struct dns_rr r0, r1, rr;
	int error;

	if ((error = dns_rr_parse(&r0, rp, P)))
		return P->end;

	r0.section = dns_rr_section(rp, P);

	rp = (i->sort == &dns_rr_i_packet)? dns_rr_skip(rp, P) : 12;

	for (; rp < P->end; rp = dns_rr_skip(rp, P)) {
		if ((error = dns_rr_parse(&rr, rp, P)))
			continue;

		rr.section = dns_rr_section(rp, P);

		if (!dns_rr_i_match(&rr, i, P))
			continue;

		if (i->sort(&rr, &r0, i, P) <= 0)
			continue;

		r1 = rr;

		goto lower;
	}

	return P->end;
lower:
	if (i->sort == &dns_rr_i_packet)
		return dns_rr_offset(&r1);

	while ((rp = dns_rr_skip(rp, P)) < P->end) {
		if ((error = dns_rr_parse(&rr, rp, P)))
			continue;

		rr.section = dns_rr_section(rp, P);

		if (!dns_rr_i_match(&rr, i, P))
			continue;

		if (i->sort(&rr, &r0, i, P) <= 0)
			continue;

		if (i->sort(&rr, &r1, i, P) >= 0)
			continue;

		r1 = rr;
	}

	return dns_rr_offset(&r1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movw %di, %ax
movw %ax, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movw -0x4(%rbp), %ax
movq -0x18(%rbp), %rdx
leaq -0x30(%rbp), %rdi
movzwl %ax, %esi
callq 0xf790
movl %eax, -0x64(%rbp)
cmpl $0x0, %eax
je 0x35634
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movw %ax, -0x2(%rbp)
jmp 0x3584d
movw -0x4(%rbp), %ax
movq -0x18(%rbp), %rsi
movzwl %ax, %edi
callq 0x35470
movl %eax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x2692e(%rip), %rcx     # 0x5bf80
cmpq %rcx, 0x28(%rax)
jne 0x35670
movw -0x4(%rbp), %ax
movq -0x18(%rbp), %rsi
movzwl %ax, %edi
callq 0xf320
movzwl %ax, %eax
movl %eax, -0x68(%rbp)
jmp 0x3567a
movl $0xc, %eax
movl %eax, -0x68(%rbp)
jmp 0x3567a
movl -0x68(%rbp), %eax
movw %ax, -0x4(%rbp)
movzwl -0x4(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jae 0x35732
movw -0x4(%rbp), %ax
movq -0x18(%rbp), %rdx
leaq -0x60(%rbp), %rdi
movzwl %ax, %esi
callq 0xf790
movl %eax, -0x64(%rbp)
cmpl $0x0, %eax
je 0x356b1
jmp 0x35719
movw -0x4(%rbp), %ax
movq -0x18(%rbp), %rsi
movzwl %ax, %edi
callq 0x35470
movl %eax, -0x60(%rbp)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x60(%rbp), %rdi
callq 0x432e0
testb $0x1, %al
jne 0x356db
jmp 0x35719
movq -0x10(%rbp), %rax
movq 0x28(%rax), %r8
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
leaq -0x60(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movb $0x0, %al
callq *%r8
cmpl $0x0, %eax
jg 0x356ff
jmp 0x35719
movq -0x60(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x35743
movw -0x4(%rbp), %ax
movq -0x18(%rbp), %rsi
movzwl %ax, %edi
callq 0xf320
movw %ax, -0x4(%rbp)
jmp 0x35681
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movw %ax, -0x2(%rbp)
jmp 0x3584d
movq -0x10(%rbp), %rax
movq 0x26832(%rip), %rcx     # 0x5bf80
cmpq %rcx, 0x28(%rax)
jne 0x35766
leaq -0x48(%rbp), %rdi
callq 0x43480
movw %ax, -0x2(%rbp)
jmp 0x3584d
jmp 0x35768
movw -0x4(%rbp), %ax
movq -0x18(%rbp), %rsi
movzwl %ax, %edi
callq 0xf320
movw %ax, -0x4(%rbp)
movzwl %ax, %eax
movq -0x18(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jae 0x35840
movw -0x4(%rbp), %ax
movq -0x18(%rbp), %rdx
leaq -0x60(%rbp), %rdi
movzwl %ax, %esi
callq 0xf790
movl %eax, -0x64(%rbp)
cmpl $0x0, %eax
je 0x357ab
jmp 0x35768
movw -0x4(%rbp), %ax
movq -0x18(%rbp), %rsi
movzwl %ax, %edi
callq 0x35470
movl %eax, -0x60(%rbp)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x60(%rbp), %rdi
callq 0x432e0
testb $0x1, %al
jne 0x357d5
jmp 0x35768
movq -0x10(%rbp), %rax
movq 0x28(%rax), %r8
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
leaq -0x60(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movb $0x0, %al
callq *%r8
cmpl $0x0, %eax
jg 0x357fc
jmp 0x35768
movq -0x10(%rbp), %rax
movq 0x28(%rax), %r8
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
leaq -0x60(%rbp), %rdi
leaq -0x48(%rbp), %rsi
movb $0x0, %al
callq *%r8
cmpl $0x0, %eax
jl 0x35823
jmp 0x35768
movq -0x60(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x35768
leaq -0x48(%rbp), %rdi
callq 0x43480
movw %ax, -0x2(%rbp)
movw -0x2(%rbp), %ax
addq $0x70, %rsp
popq %rbp
retq
nopw (%rax,%rax)