	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dma_set_fragment
_dma_set_fragment:                      ## @dma_set_fragment
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	testl	%edx, %edx
	je	LBB0_1
## %bb.3:
	cmpl	$0, (%rsi)
	jne	LBB0_5
## %bb.4:
	cmpl	$0, 4(%rsi)
	jne	LBB0_5
## %bb.6:
	movzwl	%dx, %eax
	shrl	$16, %edx
	andl	$32767, %edx                    ## imm = 0x7FFF
	movq	_MAX_SUB_BUFFERS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	xorl	%r8d, %r8d
	cmpl	%ecx, %edx
	setl	%r8b
	addl	%edx, %r8d
	testl	%edx, %edx
	cmovel	%ecx, %r8d
	leal	-18(%rax), %ecx
	cmpl	$-15, %ecx
	jbe	LBB0_5
## %bb.7:
	cmpl	$1, %r8d
	jg	LBB0_8
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_1:
	movq	_EIO@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	popq	%rbp
	retq
LBB0_8:
	movq	_audio_devs@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movslq	%edi, %rdx
	movq	(%rcx,%rdx,8), %rdx
	movl	(%rdx), %ecx
	cmpl	%ecx, %eax
	movl	%eax, %edi
	cmovll	%ecx, %edi
	testl	%ecx, %ecx
	cmovlel	%eax, %edi
	movl	4(%rdx), %ecx
	cmpl	%ecx, %edi
	movl	%edi, %eax
	cmovgl	%ecx, %eax
	testl	%ecx, %ecx
	cmovlel	%edi, %eax
	movl	$1, %edi
	movl	%eax, %ecx
	shll	%cl, %edi
	movl	%edi, 4(%rsi)
	movl	%r8d, 8(%rsi)
	movl	12(%rsi), %ecx
	cmpl	%ecx, %edi
	jle	LBB0_10
## %bb.9:
	movl	%ecx, 4(%rsi)
	jmp	LBB0_11
LBB0_10:
	jne	LBB0_13
LBB0_11:
	movq	_DMA_AUTOMODE@GOTPCREL(%rip), %rdi
	movl	(%rdi), %edi
	testl	%edi, 8(%rdx)
	je	LBB0_13
## %bb.12:
	movl	%ecx, %edx
	shrl	$31, %edx
	addl	%ecx, %edx
	sarl	%edx
	movl	%edx, 4(%rsi)
LBB0_13:
	movl	$1, (%rsi)
	shll	$16, %r8d
	addl	$-65536, %r8d                   ## imm = 0xFFFF0000
	orl	%r8d, %eax
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EIO,4,2                        ## @EIO
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MAX_SUB_BUFFERS,4,2            ## @MAX_SUB_BUFFERS
	.comm	_audio_devs,8,3                 ## @audio_devs
	.comm	_DMA_AUTOMODE,4,2               ## @DMA_AUTOMODE
	.comm	_OS_DMA_MINBITS,4,2             ## @OS_DMA_MINBITS
	.no_dead_strip	_dma_set_fragment
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dma_set_fragment
_dma_set_fragment:                      ; @dma_set_fragment
	.cfi_startproc
; %bb.0:
	cbz	w2, LBB0_6
; %bb.1:
	ldr	w8, [x1]
	cbnz	w8, LBB0_5
; %bb.2:
	ldr	w8, [x1, #4]
	cbnz	w8, LBB0_5
; %bb.3:
Lloh0:
	adrp	x8, _MAX_SUB_BUFFERS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_SUB_BUFFERS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	mov	w9, #32767
	ands	w10, w9, w2, lsr #16
	cmp	w10, w8
	cinc	w10, w10, lt
	tst	w9, w2, lsr #16
	and	w9, w2, #0xffff
	csel	w8, w8, w10, eq
	sub	w10, w9, #18
	cmn	w10, #15
	b.ls	LBB0_5
; %bb.4:
	cmp	w8, #1
	b.gt	LBB0_8
LBB0_5:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh5:
	adrp	x8, _EIO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w0, w8
	ret
LBB0_8:
Lloh7:
	adrp	x10, _audio_devs@GOTPAGE
Lloh8:
	ldr	x10, [x10, _audio_devs@GOTPAGEOFF]
Lloh9:
	ldr	x10, [x10]
	ldr	x10, [x10, w0, sxtw #3]
	ldp	w11, w12, [x10]
	cmp	w9, w11
	ccmp	w11, #0, #4, lt
	csel	w9, w11, w9, gt
	cmp	w9, w12
	ccmp	w12, #0, #4, gt
	csel	w9, w12, w9, gt
	mov	w11, #1
	lsl	w12, w11, w9
	stp	w12, w8, [x1, #4]
	ldr	w11, [x1, #12]
	cmp	w12, w11
	b.le	LBB0_10
; %bb.9:
	str	w11, [x1, #4]
	b	LBB0_11
LBB0_10:
	b.ne	LBB0_13
LBB0_11:
	ldr	w10, [x10, #8]
Lloh10:
	adrp	x12, _DMA_AUTOMODE@GOTPAGE
Lloh11:
	ldr	x12, [x12, _DMA_AUTOMODE@GOTPAGEOFF]
Lloh12:
	ldr	w12, [x12]
	tst	w12, w10
	b.eq	LBB0_13
; %bb.12:
	cmp	w11, #0
	cinc	w10, w11, lt
	asr	w10, w10, #1
	str	w10, [x1, #4]
LBB0_13:
	mov	w10, #1
	str	w10, [x1]
	lsl	w8, w8, #16
	sub	w8, w8, #16, lsl #12            ; =65536
	orr	w0, w9, w8
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_EIO,4,2                        ; @EIO
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MAX_SUB_BUFFERS,4,2            ; @MAX_SUB_BUFFERS
	.comm	_audio_devs,8,3                 ; @audio_devs
	.comm	_DMA_AUTOMODE,4,2               ; @DMA_AUTOMODE
	.comm	_OS_DMA_MINBITS,4,2             ; @OS_DMA_MINBITS
	.no_dead_strip	_dma_set_fragment
.subsections_via_symbols
