	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function edma_alloc_slot
_edma_alloc_slot:                       ## @edma_alloc_slot
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	testl	%esi, %esi
	js	LBB0_1
## %bb.2:
	movl	%esi, %edi
	callq	_EDMA_CHAN_SLOT
	movl	%eax, %ebx
	movq	16(%r14), %rax
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	cmpl	(%r14), %ebx
	jge	LBB0_5
## %bb.4:
	movq	_EDMA_SLOT_ANY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
LBB0_5:
	testl	%ebx, %ebx
	js	LBB0_6
## %bb.11:
	cmpl	4(%r14), %ebx
	jge	LBB0_12
## %bb.13:
	movl	12(%r14), %esi
	movl	%ebx, %edi
	callq	_test_and_set_bit
	testq	%rax, %rax
	je	LBB0_16
## %bb.14:
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	jmp	LBB0_10
LBB0_1:
	movq	16(%r14), %rax
LBB0_6:
	xorl	%ebx, %ebx
	testq	%rax, %rax
	jne	LBB0_8
## %bb.7:
	movl	(%r14), %ebx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	4(%r14), %esi
	movl	12(%r14), %edi
	movl	%ebx, %edx
	callq	_find_next_zero_bit
	cmpl	4(%r14), %eax
	je	LBB0_9
## %bb.15:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	%eax, %ebx
	movl	12(%r14), %esi
	movl	%eax, %edi
	callq	_test_and_set_bit
	testq	%rax, %rax
	jne	LBB0_8
LBB0_16:
	movq	_dummy_paramset@GOTPCREL(%rip), %rdx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_edma_write_slot
	movl	8(%r14), %edi
	movl	%ebx, %esi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_EDMA_CTLR_CHAN                 ## TAILCALL
LBB0_9:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	jmp	LBB0_10
LBB0_12:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_10:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EDMA_SLOT_ANY,4,2              ## @EDMA_SLOT_ANY
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_dummy_paramset,4,2             ## @dummy_paramset
	.no_dead_strip	_edma_alloc_slot
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function edma_alloc_slot
_edma_alloc_slot:                       ; @edma_alloc_slot
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	tbnz	w1, #31, LBB0_7
; %bb.1:
	mov	x0, x1
	bl	_EDMA_CHAN_SLOT
	mov	x20, x0
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_3
; %bb.2:
	ldr	w9, [x19]
Lloh0:
	adrp	x10, _EDMA_SLOT_ANY@GOTPAGE
Lloh1:
	ldr	x10, [x10, _EDMA_SLOT_ANY@GOTPAGEOFF]
Lloh2:
	ldr	w10, [x10]
	cmp	w20, w9
	csel	w20, w10, w20, lt
LBB0_3:
	tbnz	w20, #31, LBB0_8
; %bb.4:
	ldr	w8, [x19, #4]
	cmp	w20, w8
	b.ge	LBB0_15
; %bb.5:
	ldr	w1, [x19, #12]
	mov	x0, x20
	bl	_test_and_set_bit
	cbz	x0, LBB0_13
; %bb.6:
Lloh3:
	adrp	x8, _EBUSY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_16
LBB0_7:
	ldr	x8, [x19, #16]
LBB0_8:
	cbz	x8, LBB0_10
; %bb.9:
	mov	w20, #0
	b	LBB0_11
LBB0_10:
	ldr	w20, [x19]
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19, #12]
	ldr	w1, [x19, #4]
	mov	x2, x20
	bl	_find_next_zero_bit
	ldr	w8, [x19, #4]
	cmp	w0, w8
	b.eq	LBB0_14
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x20, x0
	ldr	w1, [x19, #12]
	bl	_test_and_set_bit
	cbnz	x0, LBB0_11
LBB0_13:
Lloh5:
	adrp	x2, _dummy_paramset@GOTPAGE
Lloh6:
	ldr	x2, [x2, _dummy_paramset@GOTPAGEOFF]
	mov	x0, x19
	mov	x1, x20
	bl	_edma_write_slot
	ldr	w0, [x19, #8]
	mov	x1, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_EDMA_CTLR_CHAN
LBB0_14:
Lloh7:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_16
LBB0_15:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_16:
	ldr	w8, [x8]
	neg	w0, w8
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_EDMA_SLOT_ANY,4,2              ; @EDMA_SLOT_ANY
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_dummy_paramset,4,2             ; @dummy_paramset
	.no_dead_strip	_edma_alloc_slot
.subsections_via_symbols
