	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function shdma_setup_slave
_shdma_setup_slave:                     ## @shdma_setup_slave
	.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
	movl	%esi, %r14d
	movq	%rdi, %r12
	movl	24(%rdi), %edi
	callq	_to_shdma_dev
	movq	(%rax), %r13
	movq	16(%r12), %rax
	cmpq	$0, (%rax)
	je	LBB0_4
## %bb.1:
	movl	(%r12), %r15d
	movq	%r12, %rdi
	movl	%r15d, %esi
	movl	%r14d, %edx
	movl	$1, %ecx
	callq	*(%r13)
	testl	%eax, %eax
	js	LBB0_2
## %bb.3:
	movl	4(%r12), %edi
	testl	%edi, %edi
	jns	LBB0_6
	jmp	LBB0_7
LBB0_4:
	movl	4(%r12), %edi
	movl	%edi, %r15d
	testl	%edi, %edi
	js	LBB0_7
LBB0_6:
	movq	_slave_num@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edi
	jge	LBB0_7
## %bb.9:
	movq	_shdma_slave_used@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_test_and_set_bit
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_8:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_14
LBB0_2:
	movl	%eax, %ebx
	jmp	LBB0_14
LBB0_11:
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	movl	%r15d, %esi
	movl	%r14d, %edx
	xorl	%ecx, %ecx
	callq	*(%r13)
	movl	4(%r12), %edi
	testl	%eax, %eax
	js	LBB0_12
## %bb.13:
	movl	%edi, 8(%r12)
	jmp	LBB0_14
LBB0_12:
	movl	%eax, %r14d
	movq	_shdma_slave_used@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_clear_bit
	movl	%r14d, %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_slave_num,4,2                  ## @slave_num
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_shdma_slave_used,4,2           ## @shdma_slave_used
	.comm	_EBUSY,4,2                      ## @EBUSY
	.no_dead_strip	_shdma_setup_slave
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function shdma_setup_slave
_shdma_setup_slave:                     ; @shdma_setup_slave
	.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	x20, x1
	mov	x19, x0
	ldr	w0, [x0, #24]
	bl	_to_shdma_dev
	ldr	x23, [x0]
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
	cbz	x8, LBB0_3
; %bb.1:
	ldr	w21, [x19]
	ldr	x8, [x23]
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	mov	w3, #1
	blr	x8
	tbnz	w0, #31, LBB0_9
; %bb.2:
	ldr	w0, [x19, #4]
	tbz	w0, #31, LBB0_4
	b	LBB0_7
LBB0_3:
	ldr	w0, [x19, #4]
	mov	x21, x0
	tbnz	w0, #31, LBB0_7
LBB0_4:
Lloh0:
	adrp	x8, _slave_num@GOTPAGE
Lloh1:
	ldr	x8, [x8, _slave_num@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ge	LBB0_7
; %bb.5:
Lloh3:
	adrp	x24, _shdma_slave_used@GOTPAGE
Lloh4:
	ldr	x24, [x24, _shdma_slave_used@GOTPAGEOFF]
	ldr	w1, [x24]
	bl	_test_and_set_bit
	cbz	x0, LBB0_10
; %bb.6:
Lloh5:
	adrp	x8, _EBUSY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_13
LBB0_9:
	mov	x22, x0
	b	LBB0_13
LBB0_10:
	ldr	x8, [x23]
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	mov	w3, #0
	blr	x8
	mov	x22, x0
	ldr	w0, [x19, #4]
	tbnz	w22, #31, LBB0_12
; %bb.11:
	mov	w22, #0
	str	w0, [x19, #8]
	b	LBB0_13
LBB0_12:
	ldr	w1, [x24]
	bl	_clear_bit
LBB0_13:
	mov	x0, x22
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_slave_num,4,2                  ; @slave_num
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_shdma_slave_used,4,2           ; @shdma_slave_used
	.comm	_EBUSY,4,2                      ; @EBUSY
	.no_dead_strip	_shdma_setup_slave
.subsections_via_symbols
