	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function talitos_edesc_alloc
_talitos_edesc_alloc:                   ## @talitos_edesc_alloc
	.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
	movl	%r8d, %r12d
	movl	%ecx, %r15d
	movq	%rdx, %rbx
	movq	%rsi, %r13
	movl	$0, -48(%rbp)
	movq	_CRYPTO_TFM_REQ_MAY_SLEEP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 16(%rbp)
	jne	LBB0_1
## %bb.2:
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
LBB0_3:
	addl	%r12d, %r15d
	movq	_TALITOS_MAX_DATA_LEN@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r15d
	jbe	LBB0_4
## %bb.13:
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_4:
	movl	%r9d, -52(%rbp)                 ## 4-byte Spill
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	leaq	-56(%rbp), %rdx
	movq	%r13, %rdi
	movl	%r15d, %esi
	callq	_sg_count
	movq	%rbx, %rdi
	movl	%eax, %r14d
	xorl	%ebx, %ebx
	cmpl	$1, %eax
	cmovel	%ebx, %r14d
	movl	%r14d, %ecx
	cmpq	%r13, %rdi
	je	LBB0_6
## %bb.5:
	leaq	-48(%rbp), %rdx
	movl	%r15d, %esi
	callq	_sg_count
	cmpl	$1, %eax
	cmovnel	%eax, %ebx
	movl	%ebx, %ecx
LBB0_6:
	movl	%r14d, %eax
	orl	%ecx, %eax
	je	LBB0_8
## %bb.7:
	movq	%rcx, %r13
	leal	(%rcx,%r14), %eax
	leal	(%r12,%rax,4), %r15d
	addl	$8, %r15d
	leal	(%r12,%rax,4), %edi
	addl	$48, %edi
	jmp	LBB0_9
LBB0_8:
	movq	%rcx, %r13
	addl	$40, %r12d
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	movl	$40, %edi
	cmovnel	%r12d, %edi
	xorl	%r15d, %r15d
LBB0_9:
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movq	_GFP_DMA@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_10
## %bb.11:
	movq	%rax, %rbx
	movl	%r14d, (%rax)
	movl	%r13d, 4(%rax)
	movl	-56(%rbp), %eax
	movl	%eax, 8(%rbx)
	movl	-48(%rbp), %eax
	movl	%eax, 12(%rbx)
	movl	%r15d, 16(%rbx)
	movq	24(%rbx), %rsi
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %edx
	callq	_dma_map_single
	movl	%eax, 32(%rbx)
	jmp	LBB0_12
LBB0_10:
	leaq	L_.str.1(%rip), %rsi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	callq	_ERR_PTR
	movq	%rax, %rbx
LBB0_12:
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CRYPTO_TFM_REQ_MAY_SLEEP,4,2   ## @CRYPTO_TFM_REQ_MAY_SLEEP
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_GFP_ATOMIC,4,2                 ## @GFP_ATOMIC
	.comm	_TALITOS_MAX_DATA_LEN,4,2       ## @TALITOS_MAX_DATA_LEN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"length exceeds h/w max limit\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_DMA,4,2                    ## @GFP_DMA
L_.str.1:                               ## @.str.1
	.asciz	"could not allocate edescriptor\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_DMA_BIDIRECTIONAL,4,2          ## @DMA_BIDIRECTIONAL
	.no_dead_strip	_talitos_edesc_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function talitos_edesc_alloc
_talitos_edesc_alloc:                   ; @talitos_edesc_alloc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	str	wzr, [sp, #8]
Lloh0:
	adrp	x8, _CRYPTO_TFM_REQ_MAY_SLEEP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CRYPTO_TFM_REQ_MAY_SLEEP@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x9, [x9, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	adrp	x10, _GFP_ATOMIC@GOTPAGE
Lloh6:
	ldr	x10, [x10, _GFP_ATOMIC@GOTPAGEOFF]
	tst	w8, w6
	csel	x8, x10, x9, eq
Lloh7:
	adrp	x9, _TALITOS_MAX_DATA_LEN@GOTPAGE
Lloh8:
	ldr	x9, [x9, _TALITOS_MAX_DATA_LEN@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	add	w24, w4, w3
	cmp	w24, w9
	b.ls	LBB0_2
; %bb.1:
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
	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
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_ERR_PTR
LBB0_2:
	mov	x21, x5
	mov	x20, x4
	mov	x22, x2
	mov	x23, x1
	ldr	w25, [x8]
	add	x2, sp, #12
	mov	x0, x1
	mov	x1, x24
	bl	_sg_count
	cmp	w0, #1
	csel	w26, wzr, w0, eq
	mov	x27, x26
	cmp	x22, x23
	b.eq	LBB0_4
; %bb.3:
	add	x2, sp, #8
	mov	x0, x22
	mov	x1, x24
	bl	_sg_count
	cmp	w0, #1
	csel	w27, wzr, w0, eq
LBB0_4:
	orr	w8, w26, w27
	add	w9, w20, #40
	mov	w10, #40
	cmp	w21, #0
	csel	w9, w10, w9, eq
	add	w10, w27, w26
	add	w10, w20, w10, lsl #2
	add	w11, w10, #8
	add	w10, w10, #48
	cmp	w8, #0
	csel	w0, w9, w10, eq
	csel	w21, wzr, w11, eq
Lloh15:
	adrp	x8, _GFP_DMA@GOTPAGE
Lloh16:
	ldr	x8, [x8, _GFP_DMA@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	orr	w1, w8, w25
	bl	_kmalloc
	cbz	x0, LBB0_6
; %bb.5:
	mov	x20, x0
	stp	w26, w27, [x0]
	ldp	w9, w8, [sp, #8]
	stp	w8, w9, [x0, #8]
	str	w21, [x0, #16]
	ldr	x1, [x0, #24]
Lloh18:
	adrp	x8, _DMA_BIDIRECTIONAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _DMA_BIDIRECTIONAL@GOTPAGEOFF]
Lloh20:
	ldr	w3, [x8]
	mov	x0, x19
	mov	x2, x21
	bl	_dma_map_single
	str	w0, [x20, #32]
	b	LBB0_7
LBB0_6:
Lloh21:
	adrp	x1, l_.str.1@PAGE
Lloh22:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh23:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	neg	w0, w8
	bl	_ERR_PTR
	mov	x20, x0
LBB0_7:
	mov	x0, x20
	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
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_CRYPTO_TFM_REQ_MAY_SLEEP,4,2   ; @CRYPTO_TFM_REQ_MAY_SLEEP
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_GFP_ATOMIC,4,2                 ; @GFP_ATOMIC
	.comm	_TALITOS_MAX_DATA_LEN,4,2       ; @TALITOS_MAX_DATA_LEN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"length exceeds h/w max limit\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_DMA,4,2                    ; @GFP_DMA
l_.str.1:                               ; @.str.1
	.asciz	"could not allocate edescriptor\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_DMA_BIDIRECTIONAL,4,2          ; @DMA_BIDIRECTIONAL
	.no_dead_strip	_talitos_edesc_alloc
.subsections_via_symbols
