	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function prep_adm_dma_desc
_prep_adm_dma_desc:                     ## @prep_adm_dma_desc
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r15d
	movl	%r8d, %r12d
	movq	%rcx, %r14
	movl	%edx, %ebx
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r13
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$24, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movl	%r15d, -52(%rbp)                ## 4-byte Spill
	movq	%rax, %r15
	addq	$20, %r15
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	%r12d, %edx
	movq	%rax, %r14
	callq	_sg_init_one
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	movq	_DMA_DEV_TO_MEM@GOTPCREL(%rip), %rax
	cmoveq	_DMA_MEM_TO_DEV@GOTPCREL(%rip), %rax
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rcx
	cmoveq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rcx
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	(%rcx), %ecx
	movq	%r14, %r12
	movl	%ecx, 16(%r14)
	movl	4(%r13), %edi
	movq	%r15, %rsi
	movl	$1, %edx
	callq	_dma_map_sg
	testl	%eax, %eax
	je	LBB0_3
## %bb.5:
	leaq	-88(%rbp), %rdi
	xorl	%esi, %esi
	movl	$32, %edx
	callq	_memset
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, -88(%rbp)
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_7
## %bb.6:
	movl	$16, -84(%rbp)
	movslq	%ebx, %rax
	addq	16(%r13), %rax
	movq	%rax, -64(%rbp)
	leaq	24(%r13), %rax
	jmp	LBB0_8
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_14
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_7:
	movl	$16, -80(%rbp)
	movslq	%ebx, %rax
	addq	16(%r13), %rax
	movq	%rax, -72(%rbp)
	leaq	12(%r13), %rax
LBB0_8:
	movl	(%rax), %eax
	movl	%eax, -76(%rbp)
	movl	8(%r13), %edi
	leaq	-88(%rbp), %rsi
	callq	_dmaengine_slave_config
	testl	%eax, %eax
	je	LBB0_11
## %bb.9:
	movl	%eax, %ebx
	movl	4(%r13), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_10
LBB0_11:
	movl	8(%r13), %edi
	xorl	%ebx, %ebx
	movq	%r15, %rsi
	movl	$1, %edx
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	xorl	%r8d, %r8d
	callq	_dmaengine_prep_slave_sg
	testq	%rax, %rax
	je	LBB0_12
## %bb.13:
	movq	%rax, 8(%r12)
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_list_add_tail
	jmp	LBB0_14
LBB0_12:
	movl	4(%r13), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_10:
	movq	%r12, %rdi
	callq	_kfree
LBB0_14:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_DMA_DEV_TO_MEM,4,2             ## @DMA_DEV_TO_MEM
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.comm	_DMA_MEM_TO_DEV,4,2             ## @DMA_MEM_TO_DEV
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to configure dma channel\n"

L_.str.1:                               ## @.str.1
	.asciz	"failed to prepare desc\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_prep_adm_dma_desc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function prep_adm_dma_desc
_prep_adm_dma_desc:                     ; @prep_adm_dma_desc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x24, x5
	mov	x22, x4
	mov	x26, x3
	mov	x23, x2
	mov	x25, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #24
	bl	_kzalloc
	cbz	x0, LBB0_4
; %bb.1:
	mov	x19, x0
	add	x21, x0, #20
	mov	x0, x21
	mov	x1, x26
	mov	x2, x22
	bl	_sg_init_one
Lloh3:
	adrp	x8, _DMA_MEM_TO_DEV@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DMA_MEM_TO_DEV@GOTPAGEOFF]
Lloh5:
	adrp	x9, _DMA_DEV_TO_MEM@GOTPAGE
Lloh6:
	ldr	x9, [x9, _DMA_DEV_TO_MEM@GOTPAGEOFF]
	cmp	w25, #0
	csel	x8, x8, x9, eq
	ldr	w22, [x8]
Lloh7:
	adrp	x8, _DMA_TO_DEVICE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh9:
	adrp	x9, _DMA_FROM_DEVICE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _DMA_FROM_DEVICE@GOTPAGEOFF]
	csel	x8, x8, x9, eq
	ldr	w3, [x8]
	str	w3, [x19, #16]
	ldr	w0, [x20, #4]
	mov	x1, x21
	mov	w2, #1
	bl	_dma_map_sg
	cbz	w0, LBB0_5
; %bb.2:
	mov	x0, sp
	mov	w1, #0
	mov	w2, #32
	bl	_memset
	str	w24, [sp]
	mov	w8, #16
	cbz	w25, LBB0_6
; %bb.3:
	str	w8, [sp, #4]
	ldr	x8, [x20, #16]
	add	x8, x8, w23, sxtw
	str	x8, [sp, #24]
	add	x8, x20, #24
	b	LBB0_7
LBB0_4:
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_14
LBB0_5:
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_12
LBB0_6:
	str	w8, [sp, #8]
	ldr	x8, [x20, #16]
	add	x8, x8, w23, sxtw
	str	x8, [sp, #16]
	add	x8, x20, #12
LBB0_7:
	ldr	w8, [x8]
	str	w8, [sp, #12]
	ldr	w0, [x20, #8]
	mov	x1, sp
	bl	_dmaengine_slave_config
	cbz	w0, LBB0_9
; %bb.8:
	mov	x23, x0
	ldr	w0, [x20, #4]
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_13
LBB0_9:
	ldr	w0, [x20, #8]
	mov	x1, x21
	mov	w2, #1
	mov	x3, x22
	mov	w4, #0
	bl	_dmaengine_prep_slave_sg
	cbz	x0, LBB0_11
; %bb.10:
	str	x0, [x19, #8]
	mov	x0, x19
	mov	x1, x20
	bl	_list_add_tail
	mov	w23, #0
	b	LBB0_14
LBB0_11:
	ldr	w0, [x20, #4]
Lloh18:
	adrp	x1, l_.str.1@PAGE
Lloh19:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_13:
	mov	x0, x19
	bl	_kfree
LBB0_14:
	mov	x0, x23
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_DMA_DEV_TO_MEM,4,2             ; @DMA_DEV_TO_MEM
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.comm	_DMA_MEM_TO_DEV,4,2             ; @DMA_MEM_TO_DEV
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to configure dma channel\n"

l_.str.1:                               ; @.str.1
	.asciz	"failed to prepare desc\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_prep_adm_dma_desc
.subsections_via_symbols
