	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function audio_read_packet
_audio_read_packet:                     ## @audio_read_packet
	.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	%rsi, %rbx
	movq	(%rdi), %r12
	movl	20(%r12), %esi
	movq	%rbx, %rdi
	callq	_av_new_packet
                                        ## kill: def $eax killed $eax def $rax
	testl	%eax, %eax
	js	LBB0_17
## %bb.1:
	movl	16(%r12), %edi
	movq	8(%rbx), %rsi
	movl	(%rbx), %edx
	callq	_read
	movl	%eax, %r14d
	testl	%eax, %eax
	jle	LBB0_2
## %bb.4:
	movl	%r14d, (%rbx)
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_av_gettime
	movl	%eax, %r15d
	movl	16(%r12), %edi
	movq	_SNDCTL_DSP_GETISPACE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	callq	_ioctl
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:
	movl	-48(%rbp), %r13d
LBB0_6:
	addl	%r14d, %r13d
	movslq	%r13d, %rax
	imulq	$1000000, %rax, %rax            ## imm = 0xF4240
	movslq	(%r12), %rsi
	movslq	4(%r12), %rcx
	imulq	%rcx, %rsi
	movq	%rax, %rdx
	orq	%rsi, %rdx
	shrq	$32, %rdx
	je	LBB0_7
## %bb.8:
	cqto
	idivq	%rsi
	jmp	LBB0_9
LBB0_2:
	movq	%rbx, %rdi
	callq	_av_packet_unref
	movl	$0, (%rbx)
	testl	%r14d, %r14d
	js	LBB0_18
## %bb.3:
	movq	_AVERROR_EOF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_17
LBB0_7:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%esi
                                        ## kill: def $eax killed $eax def $rax
LBB0_9:
	subl	%eax, %r15d
	movl	%r15d, 4(%rbx)
	xorl	%eax, %eax
	cmpq	$0, 8(%r12)
	je	LBB0_17
## %bb.10:
	cmpl	$2, %ecx
	jne	LBB0_17
## %bb.11:
	movq	8(%rbx), %rcx
	decl	%r14d
	movl	%r14d, %edx
	shrl	$2, %edx
	leal	1(%rdx), %esi
	cmpl	$12, %r14d
	jb	LBB0_14
## %bb.12:
	movl	%esi, %edi
	andl	$-4, %edi
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	notw	(%rcx)
	notw	4(%rcx)
	notw	8(%rcx)
	notw	12(%rcx)
	addq	$16, %rcx
	addl	$-4, %edi
	jne	LBB0_13
LBB0_14:
	testb	$3, %sil
	je	LBB0_17
## %bb.15:
	incb	%dl
	movzbl	%dl, %edx
	andl	$3, %edx
	xorl	%eax, %eax
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	notw	(%rcx,%rsi,4)
	incq	%rsi
	cmpl	%esi, %edx
	jne	LBB0_16
LBB0_17:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_errno,4,2                      ## @errno
	.comm	_AVERROR_EOF,4,2                ## @AVERROR_EOF
	.comm	_SNDCTL_DSP_GETISPACE,4,2       ## @SNDCTL_DSP_GETISPACE
	.no_dead_strip	_audio_read_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function audio_read_packet
_audio_read_packet:                     ; @audio_read_packet
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x1
	ldr	x22, [x0]
	ldr	w1, [x22, #20]
	mov	x0, x20
	bl	_av_new_packet
	tbnz	w0, #31, LBB0_13
; %bb.1:
	ldr	w0, [x22, #16]
	ldr	x1, [x20, #8]
	ldr	w2, [x20]
	bl	_read
	mov	x19, x0
	cmp	w0, #0
	b.le	LBB0_6
; %bb.2:
	str	w19, [x20]
	bl	_av_gettime
	mov	x21, x0
	ldr	w0, [x22, #16]
Lloh0:
	adrp	x8, _SNDCTL_DSP_GETISPACE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SNDCTL_DSP_GETISPACE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #8
	bl	_ioctl
	mov	x8, x0
	mov	w0, #0
	ldr	w9, [sp, #8]
	cmp	x8, #0
	csel	w8, w9, wzr, eq
	add	w8, w8, w19
	mov	w9, #16960
	movk	w9, #15, lsl #16
	smull	x9, w8, w9
	ldpsw	x10, x8, [x22]
	mul	x10, x8, x10
	sdiv	x9, x9, x10
	sub	w9, w21, w9
	str	w9, [x20, #4]
	ldr	x9, [x22, #8]
	cbz	x9, LBB0_13
; %bb.3:
	cmp	w8, #2
	b.ne	LBB0_13
; %bb.4:
	ldr	x12, [x20, #8]
	sub	w8, w19, #1
	cmp	w8, #12
	b.hs	LBB0_8
; %bb.5:
	mov	w8, #0
	mov	x9, x12
	b	LBB0_11
LBB0_6:
	mov	x0, x20
	bl	_av_packet_unref
	str	wzr, [x20]
	tbnz	w19, #31, LBB0_14
; %bb.7:
Lloh3:
	adrp	x8, _AVERROR_EOF@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AVERROR_EOF@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	b	LBB0_13
LBB0_8:
	lsr	w8, w8, #2
	add	w10, w8, #1
	and	x11, x10, #0x7ffffffc
	add	x9, x12, x11, lsl #2
	lsl	w8, w11, #2
	add	x12, x12, #8
	mov	x13, x11
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldurh	w14, [x12, #-8]
	ldurh	w15, [x12, #-4]
	ldrh	w16, [x12]
	ldrh	w17, [x12, #4]
	mvn	w14, w14
	mvn	w15, w15
	mvn	w16, w16
	mvn	w17, w17
	sturh	w14, [x12, #-8]
	sturh	w15, [x12, #-4]
	strh	w16, [x12]
	strh	w17, [x12, #4]
	add	x12, x12, #16
	subs	x13, x13, #4
	b.ne	LBB0_9
; %bb.10:
	cmp	x11, x10
	b.eq	LBB0_12
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldrh	w10, [x9]
	mvn	w10, w10
	strh	w10, [x9], #4
	add	w8, w8, #4
	cmp	w8, w19
	b.lt	LBB0_11
LBB0_12:
	mov	w0, #0
LBB0_13:
	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
	add	sp, sp, #64
	ret
LBB0_14:
Lloh6:
	adrp	x8, _errno@GOTPAGE
Lloh7:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	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
	add	sp, sp, #64
	b	_AVERROR
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_errno,4,2                      ; @errno
	.comm	_AVERROR_EOF,4,2                ; @AVERROR_EOF
	.comm	_SNDCTL_DSP_GETISPACE,4,2       ; @SNDCTL_DSP_GETISPACE
	.no_dead_strip	_audio_read_packet
.subsections_via_symbols
