	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function prepare_bam_async_desc
_prepare_bam_async_desc:                ## @prepare_bam_async_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r13
	movq	%rsi, %r12
	movq	%rdi, %r14
	movq	32(%rdi), %rbx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$32, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %r15
	cmpq	%r12, 8(%r14)
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_4
## %bb.5:
	movq	64(%rbx), %rdx
	cmpq	%r12, 24(%r14)
	je	LBB0_6
## %bb.7:
	leaq	32(%rbx), %rcx
	movq	32(%rbx), %rax
	leaq	(%rdx,%rax,4), %r13
	leaq	40(%rbx), %rdi
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rdx
	movq	_DMA_DEV_TO_MEM@GOTPCREL(%rip), %rsi
	jmp	LBB0_8
LBB0_4:
	movq	(%rbx), %rax
	leaq	(,%rax,4), %r13
	addq	72(%rbx), %r13
	leaq	8(%rbx), %rdi
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rdx
	movq	_DMA_MEM_TO_DEV@GOTPCREL(%rip), %rsi
	movq	%rbx, %rcx
	jmp	LBB0_8
LBB0_6:
	leaq	16(%rbx), %rcx
	movq	16(%rbx), %rax
	leaq	(%rdx,%rax,4), %r13
	leaq	24(%rbx), %rdi
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rdx
	movq	_DMA_MEM_TO_DEV@GOTPCREL(%rip), %rsi
LBB0_8:
	movl	(%rdi), %r12d
	movq	%r12, (%rcx)
                                        ## kill: def $r12d killed $r12d killed $r12 def $r12
	subl	%eax, %r12d
	movl	(%rsi), %ebx
	movq	(%rdx), %rax
	movq	%rax, 16(%r15)
	leaq	-4(,%r12,4), %rdi
	addq	%r13, %rdi
	callq	_sg_mark_end
	movl	16(%r14), %edi
	movq	16(%r15), %rcx
	movq	%r13, %rsi
	movl	%r12d, %edx
	callq	_dma_map_sg
	testl	%eax, %eax
	je	LBB0_9
## %bb.10:
	movl	%r12d, (%r15)
	movq	%r13, 24(%r15)
	movl	%ebx, %ecx
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movq	%r13, %rsi
	movl	%r12d, %edx
	movq	-56(%rbp), %r8                  ## 8-byte Reload
	callq	_dmaengine_prep_slave_sg
	testq	%rax, %rax
	je	LBB0_11
## %bb.12:
	movq	%rax, 8(%r15)
	xorl	%ecx, %ecx
	cmpq	%rbx, 8(%r14)
	sete	%cl
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movq	%rax, 48(%rdx,%rcx,8)
	addq	$4, %r15
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_list_add_tail
	xorl	%eax, %eax
	jmp	LBB0_13
LBB0_9:
	movl	16(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	%r15, %rdi
	callq	_kfree
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_11:
	movl	16(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	movl	16(%r14), %edi
	movq	16(%r15), %rcx
	movq	%r13, %rsi
	movl	%r12d, %edx
	callq	_dma_unmap_sg
	movq	%r15, %rdi
	callq	_kfree
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_13:
	addq	$24, %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_MEM_TO_DEV,4,2             ## @DMA_MEM_TO_DEV
	.comm	_DMA_TO_DEVICE,8,3              ## @DMA_TO_DEVICE
	.comm	_DMA_DEV_TO_MEM,4,2             ## @DMA_DEV_TO_MEM
	.comm	_DMA_FROM_DEVICE,8,3            ## @DMA_FROM_DEVICE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failure in mapping desc\n"

L_.str.1:                               ## @.str.1
	.asciz	"failure in prep desc\n"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function prepare_bam_async_desc
_prepare_bam_async_desc:                ; @prepare_bam_async_desc
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x22, x2
	mov	x21, x1
	mov	x20, x0
	ldr	x26, [x0, #32]
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #32
	bl	_kzalloc
	cbz	x0, LBB0_10
; %bb.1:
	mov	x19, x0
	ldr	x8, [x20, #8]
	cmp	x8, x21
	b.eq	LBB0_4
; %bb.2:
	ldr	x8, [x20, #24]
	ldr	x10, [x26, #64]
	mov	x9, x26
	cmp	x8, x21
	b.eq	LBB0_5
; %bb.3:
	ldr	x8, [x9, #32]!
	add	x23, x10, x8, lsl #2
	add	x11, x9, #8
Lloh3:
	adrp	x10, _DMA_FROM_DEVICE@GOTPAGE
Lloh4:
	ldr	x10, [x10, _DMA_FROM_DEVICE@GOTPAGEOFF]
Lloh5:
	adrp	x12, _DMA_DEV_TO_MEM@GOTPAGE
Lloh6:
	ldr	x12, [x12, _DMA_DEV_TO_MEM@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:
	ldr	x9, [x26, #72]
	ldr	x8, [x26]
	add	x23, x9, x8, lsl #2
	add	x11, x26, #8
Lloh7:
	adrp	x10, _DMA_TO_DEVICE@GOTPAGE
Lloh8:
	ldr	x10, [x10, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh9:
	adrp	x12, _DMA_MEM_TO_DEV@GOTPAGE
Lloh10:
	ldr	x12, [x12, _DMA_MEM_TO_DEV@GOTPAGEOFF]
	mov	x9, x26
	b	LBB0_6
LBB0_5:
	ldr	x8, [x9, #16]!
	add	x23, x10, x8, lsl #2
	add	x11, x9, #8
Lloh11:
	adrp	x10, _DMA_TO_DEVICE@GOTPAGE
Lloh12:
	ldr	x10, [x10, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh13:
	adrp	x12, _DMA_MEM_TO_DEV@GOTPAGE
Lloh14:
	ldr	x12, [x12, _DMA_MEM_TO_DEV@GOTPAGEOFF]
LBB0_6:
	ldr	w11, [x11]
	sub	w24, w11, w8
	str	x11, [x9]
	ldr	w25, [x12]
	ldr	x8, [x10]
	str	x8, [x19, #16]
	add	x8, x23, w24, uxtw #2
	sub	x0, x8, #4
	bl	_sg_mark_end
	ldr	w0, [x20, #16]
	ldr	x3, [x19, #16]
	mov	x1, x23
	mov	x2, x24
	bl	_dma_map_sg
	cbz	w0, LBB0_9
; %bb.7:
	str	w24, [x19]
	str	x23, [x19, #24]
	mov	x0, x21
	mov	x1, x23
	mov	x2, x24
	mov	x3, x25
	mov	x4, x22
	bl	_dmaengine_prep_slave_sg
	cbz	x0, LBB0_11
; %bb.8:
	str	x0, [x19, #8]
	ldr	x8, [x20, #8]
	mov	w9, #48
	mov	w10, #56
	cmp	x8, x21
	csel	x8, x10, x9, eq
	str	x0, [x26, x8]
	add	x0, x19, #4
	mov	x1, x20
	bl	_list_add_tail
	mov	w0, #0
	b	LBB0_13
LBB0_9:
	ldr	w0, [x20, #16]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	mov	x0, x19
	bl	_kfree
LBB0_10:
Lloh17:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_12
LBB0_11:
	ldr	w0, [x20, #16]
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	ldr	w0, [x20, #16]
	ldr	x3, [x19, #16]
	mov	x1, x23
	mov	x2, x24
	bl	_dma_unmap_sg
	mov	x0, x19
	bl	_kfree
Lloh21:
	adrp	x8, _EINVAL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_13:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_DMA_MEM_TO_DEV,4,2             ; @DMA_MEM_TO_DEV
	.comm	_DMA_TO_DEVICE,8,3              ; @DMA_TO_DEVICE
	.comm	_DMA_DEV_TO_MEM,4,2             ; @DMA_DEV_TO_MEM
	.comm	_DMA_FROM_DEVICE,8,3            ; @DMA_FROM_DEVICE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failure in mapping desc\n"

l_.str.1:                               ; @.str.1
	.asciz	"failure in prep desc\n"

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