	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_scif_reserve_dma_chan          ## -- Begin function scif_reserve_dma_chan
	.p2align	4, 0x90
_scif_reserve_dma_chan:                 ## @scif_reserve_dma_chan
	.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, %rbx
	movq	_scif_info@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	testq	%rax, %rax
	je	LBB0_4
LBB0_5:
	movq	_scif_dev@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_1:
	movq	16(%rbx), %rdi
	callq	_scifdev_self
	movq	%rax, %rcx
	xorl	%eax, %eax
	testq	%rcx, %rcx
	jne	LBB0_12
## %bb.2:
	movq	(%r14), %rax
	testq	%rax, %rax
	jne	LBB0_5
LBB0_4:
	leaq	16(%rbx), %rax
LBB0_6:
	movq	(%rax), %rcx
	movq	8(%rcx), %rax
	movslq	(%rax), %rsi
	testq	%rsi, %rsi
	je	LBB0_7
## %bb.8:
	movq	8(%rax), %rdx
	movq	(%rcx), %rax
	movq	(%rdx,%rax,8), %r14
	incq	%rax
	movq	%rax, %rdx
	orq	%rsi, %rdx
	shrq	$32, %rdx
	je	LBB0_9
## %bb.10:
	xorl	%edx, %edx
	divq	%rsi
	jmp	LBB0_11
LBB0_7:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_12
LBB0_9:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%esi
                                        ## kill: def $edx killed $edx def $rdx
LBB0_11:
	movq	%rdx, (%rcx)
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	%r14, 8(%rbx)
	movq	%rbx, %rdi
	callq	_mutex_unlock
	xorl	%eax, %eax
LBB0_12:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_scif_info,8,3                  ## @scif_info
	.comm	_scif_dev,8,3                   ## @scif_dev
	.comm	_ENODEV,4,2                     ## @ENODEV
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_scif_reserve_dma_chan          ; -- Begin function scif_reserve_dma_chan
	.p2align	2
_scif_reserve_dma_chan:                 ; @scif_reserve_dma_chan
	.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
Lloh0:
	adrp	x20, _scif_info@GOTPAGE
Lloh1:
	ldr	x20, [x20, _scif_info@GOTPAGEOFF]
	ldr	x8, [x20]
	cbz	x8, LBB0_3
LBB0_1:
Lloh2:
	adrp	x9, _scif_dev@GOTPAGE
Lloh3:
	ldr	x9, [x9, _scif_dev@GOTPAGEOFF]
	add	x10, x19, #16
	cmp	x8, #0
	csel	x8, x10, x9, eq
	ldr	x8, [x8]
	ldr	x10, [x8, #8]
	ldrsw	x9, [x10]
	cbz	w9, LBB0_5
; %bb.2:
	ldr	x10, [x10, #8]
	ldr	x11, [x8]
	ldr	x20, [x10, x11, lsl #3]
	add	x10, x11, #1
	udiv	x11, x10, x9
	msub	x9, x11, x9, x10
	str	x9, [x8]
	mov	x0, x19
	bl	_mutex_lock
	str	x20, [x19, #8]
	mov	x0, x19
	bl	_mutex_unlock
	b	LBB0_4
LBB0_3:
	ldr	x0, [x19, #16]
	bl	_scifdev_self
	cbz	x0, LBB0_7
LBB0_4:
	mov	w0, #0
	b	LBB0_6
LBB0_5:
Lloh4:
	adrp	x8, _ENODEV@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_7:
	ldr	x8, [x20]
	b	LBB0_1
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_scif_info,8,3                  ; @scif_info
	.comm	_scif_dev,8,3                   ; @scif_dev
	.comm	_ENODEV,4,2                     ; @ENODEV
.subsections_via_symbols
