	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sdma_transfer_init
_sdma_transfer_init:                    ## @sdma_transfer_init
	.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
	movl	%edx, %r12d
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	_GFP_NOWAIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$48, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	movq	%rax, %rbx
	movq	_DMA_IN_PROGRESS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r14)
	movl	%r15d, (%r14)
	movq	$0, 8(%r14)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 32(%rbx)
	movups	%xmm0, 16(%rbx)
	movq	%r14, 8(%rbx)
	movl	%r12d, (%rbx)
	movq	%rbx, %rdi
	callq	_sdma_alloc_bd
	testq	%rax, %rax
	jne	LBB0_5
## %bb.2:
	movq	_DMA_MEM_TO_MEM@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	jne	LBB0_4
## %bb.3:
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$1, %edx
	xorl	%ecx, %ecx
	callq	_sdma_config_ownership
LBB0_4:
	movq	%r14, %rdi
	callq	_sdma_load_context
	testq	%rax, %rax
	je	LBB0_7
LBB0_5:
	movq	%rbx, %rdi
	callq	_kfree
LBB0_6:
	xorl	%ebx, %ebx
LBB0_7:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_NOWAIT,4,2                 ## @GFP_NOWAIT
	.comm	_DMA_IN_PROGRESS,4,2            ## @DMA_IN_PROGRESS
	.comm	_DMA_MEM_TO_MEM,4,2             ## @DMA_MEM_TO_MEM
	.no_dead_strip	_sdma_transfer_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sdma_transfer_init
_sdma_transfer_init:                    ; @sdma_transfer_init
	.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	x22, x2
	mov	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _GFP_NOWAIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_NOWAIT@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #48
	bl	_kzalloc
	mov	x19, x0
	cbz	x0, LBB0_6
; %bb.1:
Lloh3:
	adrp	x8, _DMA_IN_PROGRESS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DMA_IN_PROGRESS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x20, #16]
	str	w21, [x20]
	str	xzr, [x20, #8]
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [x19, #16]
	str	x20, [x19, #8]
	str	w22, [x19]
	mov	x0, x19
	bl	_sdma_alloc_bd
	cbnz	x0, LBB0_5
; %bb.2:
Lloh6:
	adrp	x8, _DMA_MEM_TO_MEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DMA_MEM_TO_MEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_4
; %bb.3:
	mov	x0, x20
	mov	w1, #0
	mov	w2, #1
	mov	w3, #0
	bl	_sdma_config_ownership
LBB0_4:
	mov	x0, x20
	bl	_sdma_load_context
	cbz	x0, LBB0_6
LBB0_5:
	mov	x0, x19
	bl	_kfree
	mov	x19, #0
LBB0_6:
	mov	x0, x19
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_NOWAIT,4,2                 ; @GFP_NOWAIT
	.comm	_DMA_IN_PROGRESS,4,2            ; @DMA_IN_PROGRESS
	.comm	_DMA_MEM_TO_MEM,4,2             ; @DMA_MEM_TO_MEM
	.no_dead_strip	_sdma_transfer_init
.subsections_via_symbols
