	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_sdma_descq_cnt@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	movl	$256, %esi                      ## imm = 0x100
	cmovnel	%eax, %esi
	movq	%rdi, %rbx
	movl	%esi, (%rdi)
	movq	24(%rdi), %rax
	movq	(%rax), %rdi
	shll	$3, %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)
	movq	24(%rbx), %rdi
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	(%rdi), %rdi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	40(%rbx), %rdx
	movl	(%r15), %ecx
	callq	_dma_alloc_coherent
	movq	%rax, 32(%rbx)
	testq	%rax, %rax
	je	LBB0_3
## %bb.6:
	movq	$0, (%rax)
	xorl	%eax, %eax
	jmp	LBB0_5
LBB0_1:
	leaq	L_.str(%rip), %rsi
	callq	_qib_dev_err
	jmp	LBB0_4
LBB0_3:
	movq	24(%rbx), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_qib_dev_err
	movq	24(%rbx), %rax
	movq	(%rax), %rdi
	movl	(%rbx), %esi
	shll	$3, %esi
	movq	16(%rbx), %rdx
	movq	8(%rbx), %rcx
	callq	_dma_free_coherent
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%r14)
LBB0_4:
	movl	$0, (%rbx)
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_sdma_descq_cnt,4,2             ## @sdma_descq_cnt
	.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	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"failed to allocate SendDMA head memory\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.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	x8, _sdma_descq_cnt@GOTPAGE
Lloh1:
	ldr	x8, [x8, _sdma_descq_cnt@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	mov	w9, #256
	cmp	w8, #0
	csel	w8, w9, w8, eq
	str	w8, [x0]
	ldr	x9, [x0, #24]
	ldr	x0, [x9]
	lsl	w1, w8, #3
	add	x20, x19, #8
Lloh3:
	adrp	x21, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x21, [x21, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w3, [x21]
	mov	x2, x20
	bl	_dma_alloc_coherent
	mov	x8, x0
	str	x0, [x19, #16]
	ldr	x0, [x19, #24]
	cbz	x8, LBB0_3
; %bb.1:
	ldr	x0, [x0]
Lloh5:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	add	x2, x19, #40
	ldr	w3, [x21]
	bl	_dma_alloc_coherent
	str	x0, [x19, #32]
	cbz	x0, LBB0_4
; %bb.2:
	mov	x8, x0
	mov	w0, #0
	str	xzr, [x8]
	b	LBB0_6
LBB0_3:
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	bl	_qib_dev_err
	b	LBB0_5
LBB0_4:
	ldr	x0, [x19, #24]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_qib_dev_err
	ldp	x2, x8, [x19, #16]
	ldr	x0, [x8]
	ldr	w8, [x19]
	lsl	w1, w8, #3
	ldr	x3, [x19, #8]
	bl	_dma_free_coherent
	stp	xzr, xzr, [x20]
LBB0_5:
	str	wzr, [x19]
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	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	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_sdma_descq_cnt,4,2             ; @sdma_descq_cnt
	.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	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"failed to allocate SendDMA head memory\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_alloc_sdma
.subsections_via_symbols
