	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dma_chan_get
_dma_chan_get:                          ## @dma_chan_get
	.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	%rdi, %rbx
	movq	_ENODEV@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	callq	_dma_chan_to_owner
	movq	%rax, %r15
	cmpl	$0, (%rbx)
	je	LBB0_5
## %bb.1:
	movq	%r15, %rdi
	callq	___module_get
LBB0_2:
	movl	(%rbx), %eax
	leal	1(%rax), %ecx
	movl	%ecx, (%rbx)
	xorl	%r14d, %r14d
	testl	%eax, %eax
	jne	LBB0_10
## %bb.3:
	movq	8(%rbx), %rax
	movq	%rbx, %rdi
	callq	*(%rax)
	testl	%eax, %eax
	js	LBB0_4
## %bb.8:
	movq	_DMA_PRIVATE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	8(%rbx), %rax
	movl	8(%rax), %esi
	callq	_dma_has_cap
	testl	%eax, %eax
	jne	LBB0_10
## %bb.9:
	movq	%rbx, %rdi
	callq	_balance_ref_count
	jmp	LBB0_10
LBB0_5:
	movq	%r15, %rdi
	callq	_try_module_get
	testq	%rax, %rax
	jne	LBB0_2
## %bb.6:
	testl	%r14d, %r14d
	je	LBB0_2
## %bb.7:
	negl	%r14d
	jmp	LBB0_10
LBB0_4:
	movl	%eax, %r12d
	movl	$0, (%rbx)
	movq	%r15, %rdi
	callq	_module_put
	movl	%r12d, %r14d
LBB0_10:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_DMA_PRIVATE,4,2                ## @DMA_PRIVATE
	.no_dead_strip	_dma_chan_get
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dma_chan_get
_dma_chan_get:                          ; @dma_chan_get
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x19, x0
Lloh0:
	adrp	x8, _ENODEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
	bl	_dma_chan_to_owner
	mov	x20, x0
	ldr	w8, [x19]
	cbz	w8, LBB0_4
; %bb.1:
	mov	x0, x20
	bl	___module_get
LBB0_2:
	ldr	w8, [x19]
	add	w9, w8, #1
	str	w9, [x19]
	cbz	w8, LBB0_7
LBB0_3:
	mov	w21, #0
	b	LBB0_11
LBB0_4:
	mov	x0, x20
	bl	_try_module_get
	cbnz	x0, LBB0_2
; %bb.5:
	cbz	w21, LBB0_2
; %bb.6:
	neg	w21, w21
	b	LBB0_11
LBB0_7:
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
	tbnz	w0, #31, LBB0_10
; %bb.8:
Lloh3:
	adrp	x8, _DMA_PRIVATE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DMA_PRIVATE@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	ldr	x8, [x19, #8]
	ldr	w1, [x8, #8]
	bl	_dma_has_cap
	cbnz	w0, LBB0_3
; %bb.9:
	mov	x0, x19
	bl	_balance_ref_count
	b	LBB0_3
LBB0_10:
	mov	x21, x0
	str	wzr, [x19]
	mov	x0, x20
	bl	_module_put
LBB0_11:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_DMA_PRIVATE,4,2                ; @DMA_PRIVATE
	.no_dead_strip	_dma_chan_get
.subsections_via_symbols
