	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alloc_sdma
_alloc_sdma:                            ## @alloc_sdma
	.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	24(%rdi), %rdi
	movq	_SDMA_DESCQ_SZ@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	8(%rbx), %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	movq	%r14, %rdx
	callq	_dma_alloc_coherent
	movq	%rax, 16(%rbx)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movl	(%r12), %eax
	sarl	$2, %eax
	movl	%eax, (%rbx)
	movq	24(%rbx), %rdi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	64(%rbx), %rdx
	movl	(%r15), %ecx
	callq	_dma_alloc_coherent
	movq	%rax, 56(%rbx)
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	$0, (%rax)
	leaq	40(%rbx), %rdi
	callq	_init_timer
	movq	_vl15_watchdog_timeout@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%rbx)
	movq	%rbx, 40(%rbx)
	addq	$32, %rbx
	xorl	%r15d, %r15d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_atomic_set
	jmp	LBB0_5
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_ipath_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_5
LBB0_3:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_ipath_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	movq	24(%rbx), %rdi
	movl	(%r12), %esi
	movq	8(%rbx), %rcx
	movq	16(%rbx), %rdx
	callq	_dma_free_coherent
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%r14)
LBB0_5:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SDMA_DESCQ_SZ,4,2              ## @SDMA_DESCQ_SZ
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to allocate SendDMA descriptor FIFO memory\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"failed to allocate SendDMA head memory\n"

	.comm	_vl15_watchdog_timeout,4,2      ## @vl15_watchdog_timeout
	.no_dead_strip	_alloc_sdma
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alloc_sdma
_alloc_sdma:                            ; @alloc_sdma
	.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	x22, _SDMA_DESCQ_SZ@GOTPAGE
Lloh1:
	ldr	x22, [x22, _SDMA_DESCQ_SZ@GOTPAGEOFF]
	ldr	x0, [x0, #24]
	ldr	w1, [x22]
	add	x20, x19, #8
Lloh2:
	adrp	x21, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x21, [x21, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w3, [x21]
	mov	x2, x20
	bl	_dma_alloc_coherent
	str	x0, [x19, #16]
	cbz	x0, LBB0_3
; %bb.1:
	ldr	w8, [x22]
	asr	w8, w8, #2
	str	w8, [x19]
	ldr	x0, [x19, #24]
Lloh4:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	add	x2, x19, #64
	ldr	w3, [x21]
	bl	_dma_alloc_coherent
	str	x0, [x19, #56]
	cbz	x0, LBB0_4
; %bb.2:
	str	xzr, [x0]
	add	x0, x19, #40
	bl	_init_timer
Lloh7:
	adrp	x8, _vl15_watchdog_timeout@GOTPAGE
Lloh8:
	ldr	x8, [x8, _vl15_watchdog_timeout@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	str	w8, [x19, #48]
	str	x19, [x19, #40]
	add	x0, x19, #32
	mov	w1, #0
	bl	_atomic_set
	mov	w21, #0
	b	LBB0_5
LBB0_3:
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_ipath_dev_err
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_5
LBB0_4:
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_ipath_dev_err
Lloh17:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w21, w8
	ldp	x2, x0, [x19, #16]
	ldr	w1, [x22]
	ldr	x3, [x19, #8]
	bl	_dma_free_coherent
	stp	xzr, xzr, [x20]
LBB0_5:
	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 AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_SDMA_DESCQ_SZ,4,2              ; @SDMA_DESCQ_SZ
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to allocate SendDMA descriptor FIFO memory\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"failed to allocate SendDMA head memory\n"

	.comm	_vl15_watchdog_timeout,4,2      ; @vl15_watchdog_timeout
	.no_dead_strip	_alloc_sdma
.subsections_via_symbols
