	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function jz4780_dma_desc_alloc
_jz4780_dma_desc_alloc:                 ## @jz4780_dma_desc_alloc
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_JZ_DMA_MAX_DESC@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jb	LBB0_7
## %bb.2:
	movl	%edx, %r14d
	movl	%esi, %r15d
	movq	%rdi, %r12
	movq	_GFP_NOWAIT@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movl	$16, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.3:
	movq	%rax, %rbx
	movl	(%r12), %edi
	movl	(%r13), %esi
	movq	%rax, %rdx
	addq	$12, %rdx
	callq	_dma_pool_alloc
	movl	%eax, 8(%rbx)
	testl	%eax, %eax
	je	LBB0_6
## %bb.4:
	movl	%r15d, (%rbx)
	movl	%r14d, 4(%rbx)
	jmp	LBB0_8
LBB0_6:
	movq	%rbx, %rdi
	callq	_kfree
LBB0_7:
	xorl	%ebx, %ebx
LBB0_8:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_JZ_DMA_MAX_DESC,4,2            ## @JZ_DMA_MAX_DESC
	.comm	_GFP_NOWAIT,4,2                 ## @GFP_NOWAIT
	.no_dead_strip	_jz4780_dma_desc_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function jz4780_dma_desc_alloc
_jz4780_dma_desc_alloc:                 ; @jz4780_dma_desc_alloc
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
Lloh0:
	adrp	x8, _JZ_DMA_MAX_DESC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _JZ_DMA_MAX_DESC@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.lo	LBB0_5
; %bb.1:
	mov	x19, x2
	mov	x20, x1
	mov	x22, x0
Lloh3:
	adrp	x23, _GFP_NOWAIT@GOTPAGE
Lloh4:
	ldr	x23, [x23, _GFP_NOWAIT@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	w0, #16
	bl	_kzalloc
	mov	x21, x0
	cbz	x0, LBB0_6
; %bb.2:
	ldr	w0, [x22]
	ldr	w1, [x23]
	add	x2, x21, #12
	bl	_dma_pool_alloc
	str	w0, [x21, #8]
	cbz	w0, LBB0_4
; %bb.3:
	stp	w20, w19, [x21]
	b	LBB0_6
LBB0_4:
	mov	x0, x21
	bl	_kfree
LBB0_5:
	mov	x21, #0
LBB0_6:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_JZ_DMA_MAX_DESC,4,2            ; @JZ_DMA_MAX_DESC
	.comm	_GFP_NOWAIT,4,2                 ; @GFP_NOWAIT
	.no_dead_strip	_jz4780_dma_desc_alloc
.subsections_via_symbols
