	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_packet_openmpt
_read_packet_openmpt:                   ## @read_packet_openmpt
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	(%rdi), %rbx
	movq	_AUDIO_PKT_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rbx), %eax
	leal	(,%rax,4), %ecx
	testl	%eax, %eax
	movl	$4, %edi
	cmovnel	%ecx, %edi
	movl	%esi, %eax
	cltd
	idivl	%edi
	movl	%eax, %r14d
	movq	%r15, %rdi
	callq	_av_new_packet
	testl	%eax, %eax
	js	LBB0_11
## %bb.1:
	movl	(%rbx), %ecx
	cmpl	$4, %ecx
	je	LBB0_5
## %bb.2:
	cmpl	$2, %ecx
	je	LBB0_7
## %bb.3:
	cmpl	$1, %ecx
	jne	LBB0_6
## %bb.4:
	movl	4(%rbx), %esi
	movl	8(%rbx), %edi
	movq	8(%r15), %rcx
	movl	%r14d, %edx
	callq	_openmpt_module_read_float_mono
	testl	%eax, %eax
	jg	LBB0_10
	jmp	LBB0_9
LBB0_5:
	movl	4(%rbx), %esi
	movl	8(%rbx), %edi
	movq	8(%r15), %rcx
	movl	%r14d, %edx
	callq	_openmpt_module_read_interleaved_float_quad
	testl	%eax, %eax
	jle	LBB0_9
LBB0_10:
	imull	(%rbx), %eax
	shll	$2, %eax
	movl	%eax, (%r15)
	xorl	%eax, %eax
	jmp	LBB0_11
LBB0_7:
	movl	4(%rbx), %esi
	movl	8(%rbx), %edi
	movq	8(%r15), %rcx
	movl	%r14d, %edx
	callq	_openmpt_module_read_interleaved_float_stereo
	testl	%eax, %eax
	jg	LBB0_10
LBB0_9:
	movl	$0, (%r15)
	movq	_AVERROR_EOF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_11:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r12, %rdi
	callq	_av_log
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_AUDIO_PKT_SIZE,4,2             ## @AUDIO_PKT_SIZE
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unsupported number of channels: %d"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_AVERROR_EOF,4,2                ## @AVERROR_EOF
	.no_dead_strip	_read_packet_openmpt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_packet_openmpt
_read_packet_openmpt:                   ; @read_packet_openmpt
	.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, x1
	mov	x20, x0
	ldr	x22, [x0]
Lloh0:
	adrp	x8, _AUDIO_PKT_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AUDIO_PKT_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
	ldr	w8, [x22]
	lsl	w9, w8, #2
	mov	w10, #4
	cmp	w8, #0
	csel	w23, w10, w9, eq
	mov	x0, x1
	mov	x1, x21
	bl	_av_new_packet
	tbnz	w0, #31, LBB0_10
; %bb.1:
	ldr	w3, [x22]
	sdiv	w2, w21, w23
	cmp	w3, #4
	b.eq	LBB0_5
; %bb.2:
	cmp	w3, #2
	b.eq	LBB0_6
; %bb.3:
	cmp	w3, #1
	b.ne	LBB0_11
; %bb.4:
	ldp	w1, w0, [x22, #4]
	ldr	x3, [x19, #8]
	bl	_openmpt_module_read_float_mono
	b	LBB0_7
LBB0_5:
	ldp	w1, w0, [x22, #4]
	ldr	x3, [x19, #8]
	bl	_openmpt_module_read_interleaved_float_quad
	b	LBB0_7
LBB0_6:
	ldp	w1, w0, [x22, #4]
	ldr	x3, [x19, #8]
	bl	_openmpt_module_read_interleaved_float_stereo
LBB0_7:
	mov	x8, x0
	cmp	w0, #0
	b.le	LBB0_9
; %bb.8:
	mov	w0, #0
	ldr	w9, [x22]
	mul	w8, w8, w9
	lsl	w8, w8, #2
	str	w8, [x19]
	b	LBB0_10
LBB0_9:
	str	wzr, [x19]
Lloh3:
	adrp	x8, _AVERROR_EOF@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AVERROR_EOF@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
LBB0_10:
	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
LBB0_11:
Lloh6:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x2, l_.str@PAGE
Lloh10:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	bl	_av_log
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh13:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_AVERROR
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_AUDIO_PKT_SIZE,4,2             ; @AUDIO_PKT_SIZE
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unsupported number of channels: %d"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_AVERROR_EOF,4,2                ; @AVERROR_EOF
	.no_dead_strip	_read_packet_openmpt
.subsections_via_symbols
