	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xgene_dma_create_ring_one
_xgene_dma_create_ring_one:             ## @xgene_dma_create_ring_one
	.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
	movl	%edx, %r15d
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	8(%rdi), %rax
	movq	%rax, 40(%rsi)
	movl	%edx, (%rsi)
	movslq	(%rax), %rcx
	leal	1(%rcx), %edx
	movl	%edx, (%rax)
	movq	%rcx, 32(%rsi)
	movl	16(%rsi), %esi
	movl	20(%rbx), %edi
	callq	_XGENE_DMA_RING_ID_GET
	movl	%eax, 24(%rbx)
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_xgene_dma_get_ring_size
	testl	%eax, %eax
	jle	LBB0_4
## %bb.1:
	movl	%eax, 4(%rbx)
	movl	(%r14), %edi
	leaq	12(%rbx), %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%eax, %esi
	callq	_dma_alloc_coherent
	movl	%eax, 8(%rbx)
	testl	%eax, %eax
	je	LBB0_2
## %bb.3:
	movq	%rbx, %rdi
	callq	_xgene_dma_set_ring_cmd
	movq	%rbx, %rdi
	callq	_xgene_dma_setup_ring
	xorl	%eax, %eax
	jmp	LBB0_4
LBB0_2:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_chan_err
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to allocate ring desc\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_xgene_dma_create_ring_one
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xgene_dma_create_ring_one
_xgene_dma_create_ring_one:             ; @xgene_dma_create_ring_one
	.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	x21, x2
	mov	x19, x1
	mov	x20, x0
	ldr	x8, [x0, #8]
	str	w2, [x1]
	ldrsw	x9, [x8]
	add	w10, w9, #1
	str	w10, [x8]
	stp	x9, x8, [x1, #32]
	ldp	w1, w0, [x1, #16]
	bl	_XGENE_DMA_RING_ID_GET
	str	w0, [x19, #24]
	mov	x0, x20
	mov	x1, x21
	bl	_xgene_dma_get_ring_size
	mov	x1, x0
	cmp	w0, #1
	b.lt	LBB0_4
; %bb.1:
	str	w1, [x19, #4]
	ldr	w0, [x20]
	add	x2, x19, #12
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	bl	_dma_alloc_coherent
	str	w0, [x19, #8]
	cbz	w0, LBB0_3
; %bb.2:
	mov	x0, x19
	bl	_xgene_dma_set_ring_cmd
	mov	x0, x19
	bl	_xgene_dma_setup_ring
	mov	w1, #0
	b	LBB0_4
LBB0_3:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_chan_err
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w1, w8
LBB0_4:
	mov	x0, x1
	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	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to allocate ring desc\n"

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