	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function api_cmd_create_cell
_api_cmd_create_cell:                   ## @api_cmd_create_cell
	.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	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%rdx, %rbx
	movl	%esi, %r13d
	movq	%rdi, %r12
	movq	32(%rdi), %rax
	movq	(%rax), %r14
	movl	4(%rdi), %esi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-48(%rbp), %rdx
	movq	%r14, %rdi
	callq	_dma_alloc_coherent
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	movq	$0, 8(%rax)
	movq	24(%r12), %rax
	movslq	%r13d, %rcx
	shlq	$4, %rcx
	movq	%r15, 8(%rax,%rcx)
	movq	-48(%rbp), %rdx
	movq	%rdx, (%rax,%rcx)
	movq	-48(%rbp), %rdi
	testq	%rbx, %rbx
	je	LBB0_3
## %bb.4:
	callq	_cpu_to_be64
	movl	%eax, (%rbx)
	cmpl	$128, (%r12)
	jne	LBB0_9
LBB0_6:
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	%r13d, %edx
	callq	_alloc_cmd_buf
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	jmp	LBB0_10
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_3:
	movq	%rdi, 16(%r12)
	movq	%r15, 8(%r12)
	cmpl	$128, (%r12)
	je	LBB0_6
LBB0_9:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_10:
	movl	4(%r12), %esi
	movq	-48(%rbp), %rcx
	movq	%r14, %rdi
	movq	%r15, %rdx
	callq	_dma_free_coherent
	jmp	LBB0_11
LBB0_8:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%r15, (%rax)
	xorl	%ebx, %ebx
LBB0_11:
	movl	%ebx, %eax
	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
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to allocate dma API CMD cell\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"Failed to allocate cmd buffer\n"

L_.str.2:                               ## @.str.2
	.asciz	"Unsupported API CMD chain type\n"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function api_cmd_create_cell
_api_cmd_create_cell:                   ; @api_cmd_create_cell
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x22, x3
	mov	x24, x2
	mov	x23, x1
	mov	x20, x0
	ldr	x8, [x0, #32]
	ldr	x19, [x8]
	ldr	w1, [x0, #4]
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	add	x2, sp, #8
	mov	x0, x19
	bl	_dma_alloc_coherent
	cbz	x0, LBB0_3
; %bb.1:
	mov	x21, x0
	str	xzr, [x0, #8]
	ldr	x8, [x20, #24]
	add	x8, x8, w23, sxtw #4
	str	x0, [x8, #8]
	ldr	x9, [sp, #8]
	str	x9, [x8]
	ldr	x0, [sp, #8]
	cbz	x24, LBB0_4
; %bb.2:
	bl	_cpu_to_be64
	str	w0, [x24]
	b	LBB0_5
LBB0_3:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_11
LBB0_4:
	stp	x21, x0, [x20, #8]
LBB0_5:
	ldr	w8, [x20]
	cmp	w8, #128
	b.ne	LBB0_8
; %bb.6:
	mov	x0, x20
	mov	x1, x21
	mov	x2, x23
	bl	_alloc_cmd_buf
	mov	x23, x0
	cbz	w0, LBB0_10
; %bb.7:
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	b	LBB0_9
LBB0_8:
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_9:
	ldr	w1, [x20, #4]
	ldr	x3, [sp, #8]
	mov	x0, x19
	mov	x2, x21
	bl	_dma_free_coherent
	b	LBB0_11
LBB0_10:
	str	x21, [x22]
LBB0_11:
	mov	x0, x23
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to allocate dma API CMD cell\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"Failed to allocate cmd buffer\n"

l_.str.2:                               ; @.str.2
	.asciz	"Unsupported API CMD chain type\n"

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