	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dvb_ringbuffer_pkt_next        ## -- Begin function dvb_ringbuffer_pkt_next
	.p2align	4, 0x90
_dvb_ringbuffer_pkt_next:               ## @dvb_ringbuffer_pkt_next
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	cmpq	$-1, %rsi
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_1
## %bb.2:
	movq	8(%r15), %rbx
	movq	16(%r15), %rcx
	movl	(%rbx,%rsi,4), %edi
	shll	$8, %edi
	leaq	1(%rsi), %rax
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_3
## %bb.4:
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_5
LBB0_1:
	movq	(%r15), %rdx
	movq	16(%r15), %rcx
	movq	%rdx, %r12
	jmp	LBB0_9
LBB0_3:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $edx killed $edx def $rdx
LBB0_5:
	orl	(%rbx,%rdx,4), %edi
	movq	_DVB_RINGBUFFER_PKTHDRSIZE@GOTPCREL(%rip), %rax
	addq	(%rax), %rsi
	movslq	%edi, %rax
	addq	%rax, %rsi
	movq	%rsi, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_6
## %bb.7:
	movq	%rsi, %rax
	xorl	%edx, %edx
	divq	%rcx
	movq	%rdx, %r12
	jmp	LBB0_8
LBB0_6:
	movl	%esi, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%edx, %r12d
LBB0_8:
	movq	(%r15), %rdx
LBB0_9:
	movq	%r12, %rax
	subq	%rdx, %rax
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_10
## %bb.11:
	xorl	%edx, %edx
	divq	%rcx
	movq	%rdx, %r14
	jmp	LBB0_12
LBB0_10:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
	movl	%edx, %r14d
LBB0_12:
	movq	%r15, %rdi
	callq	_dvb_ringbuffer_avail
	subl	%r14d, %eax
	cltq
	movq	_DVB_RINGBUFFER_PKTHDRSIZE@GOTPCREL(%rip), %r13
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_24:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	%rcx, %rax
	xorl	%edx, %edx
	divq	%rsi
	movq	%rdx, %r12
LBB0_25:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	%r15, %rdi
	callq	_dvb_ringbuffer_avail
	subl	%r14d, %eax
	cltq
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rcx
	cmpq	%rax, %rcx
	jae	LBB0_26
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	8(%r15), %rdi
	movq	16(%r15), %rsi
	movl	(%rdi,%r12,4), %ebx
	shll	$8, %ebx
	leaq	1(%r12), %rax
	movq	%rax, %rdx
	orq	%rsi, %rdx
	shrq	$32, %rdx
	je	LBB0_15
## %bb.16:                              ##   in Loop: Header=BB0_13 Depth=1
	xorl	%edx, %edx
	divq	%rsi
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_13 Depth=1
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%esi
                                        ## kill: def $edx killed $edx def $rdx
LBB0_17:                                ##   in Loop: Header=BB0_13 Depth=1
	orl	(%rdi,%rdx,4), %ebx
	leaq	2(%r12), %rax
	movq	%rax, %rdx
	orq	%rsi, %rdx
	shrq	$32, %rdx
	je	LBB0_18
## %bb.19:                              ##   in Loop: Header=BB0_13 Depth=1
	xorl	%edx, %edx
	divq	%rsi
	jmp	LBB0_20
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_13 Depth=1
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%esi
                                        ## kill: def $edx killed $edx def $rdx
LBB0_20:                                ##   in Loop: Header=BB0_13 Depth=1
	movslq	%ebx, %rax
	movl	(%rdi,%rdx,4), %edx
	movq	_PKT_READY@GOTPCREL(%rip), %rdi
	cmpl	(%rdi), %edx
	je	LBB0_21
## %bb.22:                              ##   in Loop: Header=BB0_13 Depth=1
	addq	%rax, %rcx
	movslq	%r14d, %r14
	addq	%rcx, %r14
	addq	%r12, %rcx
	movq	%rcx, %rax
	orq	%rsi, %rax
	shrq	$32, %rax
	jne	LBB0_24
## %bb.23:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	%ecx, %eax
	xorl	%edx, %edx
	divl	%esi
	movl	%edx, %r12d
	jmp	LBB0_25
LBB0_26:
	movq	$-1, %r12
	jmp	LBB0_27
LBB0_21:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
LBB0_27:
	movq	%r12, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DVB_RINGBUFFER_PKTHDRSIZE,8,3  ## @DVB_RINGBUFFER_PKTHDRSIZE
	.comm	_PKT_READY,4,2                  ## @PKT_READY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dvb_ringbuffer_pkt_next        ; -- Begin function dvb_ringbuffer_pkt_next
	.p2align	2
_dvb_ringbuffer_pkt_next:               ; @dvb_ringbuffer_pkt_next
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x2
	mov	x20, x0
Lloh0:
	adrp	x22, _DVB_RINGBUFFER_PKTHDRSIZE@GOTPAGE
Lloh1:
	ldr	x22, [x22, _DVB_RINGBUFFER_PKTHDRSIZE@GOTPAGEOFF]
	cmn	x1, #1
	b.eq	LBB0_2
; %bb.1:
	ldp	x8, x10, [x20]
	ldr	w11, [x10, x1, lsl #2]
	add	x12, x1, #1
	ldr	x9, [x20, #16]
	udiv	x13, x12, x9
	msub	x12, x13, x9, x12
	ldr	w10, [x10, x12, lsl #2]
	orr	w10, w10, w11, lsl #8
	ldr	x11, [x22]
	add	x11, x11, x1
	add	x10, x11, w10, sxtw
	udiv	x11, x10, x9
	msub	x21, x11, x9, x10
	b	LBB0_3
LBB0_2:
	ldr	x8, [x20]
	ldr	x9, [x20, #16]
	mov	x21, x8
LBB0_3:
	sub	x8, x21, x8
	udiv	x10, x8, x9
	msub	x23, x10, x9, x8
	mov	x0, x20
	bl	_dvb_ringbuffer_avail
	sub	w9, w0, w23
	ldr	x8, [x22]
	cmp	x8, w9, sxtw
	b.hs	LBB0_7
; %bb.4:
Lloh2:
	adrp	x24, _PKT_READY@GOTPAGE
Lloh3:
	ldr	x24, [x24, _PKT_READY@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldp	x11, x9, [x20, #8]
	ldr	w10, [x11, x21, lsl #2]
	add	x12, x21, #1
	udiv	x13, x12, x9
	msub	x12, x13, x9, x12
	ldr	w12, [x11, x12, lsl #2]
	orr	w10, w12, w10, lsl #8
	sxtw	x10, w10
	add	x12, x21, #2
	udiv	x13, x12, x9
	msub	x12, x13, x9, x12
	ldr	w11, [x11, x12, lsl #2]
	ldr	w12, [x24]
	cmp	w11, w12
	b.eq	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x8, x8, x10
	add	x10, x8, x21
	add	x23, x8, w23, sxtw
	udiv	x8, x10, x9
	msub	x21, x8, x9, x10
	mov	x0, x20
	bl	_dvb_ringbuffer_avail
	sub	w9, w0, w23
	ldr	x8, [x22]
	cmp	x8, w9, sxtw
	b.lo	LBB0_5
LBB0_7:
	mov	x21, #-1
	b	LBB0_9
LBB0_8:
	str	x10, [x19]
LBB0_9:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_DVB_RINGBUFFER_PKTHDRSIZE,8,3  ; @DVB_RINGBUFFER_PKTHDRSIZE
	.comm	_PKT_READY,4,2                  ; @PKT_READY
.subsections_via_symbols
