	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r13d
	movl	%r8d, %r14d
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rbx
	movq	_CRYPTO_TFM_REQ_MAY_SLEEP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 40(%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:
	movl	48(%rbp), %r15d
	movl	32(%rbp), %ecx
	movl	%ecx, -72(%rbp)                 ## 4-byte Spill
	movl	24(%rbp), %ecx
	movl	%ecx, -80(%rbp)                 ## 4-byte Spill
	movl	16(%rbp), %r12d
	movl	(%rax), %eax
	movl	%eax, -76(%rbp)                 ## 4-byte Spill
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_dev_get_drvdata
	movq	%rax, %rdi
	callq	_has_ftr_sec1
	testl	%eax, %eax
	jne	LBB0_4
## %bb.5:
	movq	_TALITOS2_MAX_DATA_LEN@GOTPCREL(%rip), %rdx
	jmp	LBB0_6
LBB0_4:
	movq	_TALITOS1_MAX_DATA_LEN@GOTPCREL(%rip), %rdx
LBB0_6:
	leal	(%r12,%r13), %ecx
	cmpl	(%rdx), %ecx
	jbe	LBB0_9
## %bb.7:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_8
LBB0_9:
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	addl	%r14d, %r13d
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	testq	%r14, %r14
	je	LBB0_11
## %bb.10:
	cmpq	%rbx, %r14
	je	LBB0_11
## %bb.14:
	testl	%r15d, %r15d
	movl	$0, %r14d
	cmovel	%r12d, %r14d
	addl	%r13d, %r14d
	movq	%rbx, %rdi
	movl	%r15d, %ebx
	movl	%r14d, %esi
	callq	_sg_nents_for_len
                                        ## kill: def $eax killed $eax def $rax
	testl	%eax, %eax
	js	LBB0_12
## %bb.15:
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	testl	%ebx, %ebx
	movl	%ebx, %eax
	movl	%r12d, %ebx
	cmovel	%eax, %ebx
	addl	%r13d, %ebx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	callq	_sg_nents_for_len
	testl	%eax, %eax
	js	LBB0_16
## %bb.17:
	movl	%eax, %esi
	xorl	%ecx, %ecx
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpl	$1, %eax
	cmovel	%ecx, %eax
	cmpl	$1, %esi
	cmovel	%ecx, %esi
	movl	%r14d, %r13d
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_18
LBB0_11:
	addl	%r12d, %r13d
	movq	%rbx, %rdi
	movl	%r13d, %esi
	callq	_sg_nents_for_len
                                        ## kill: def $eax killed $eax def $rax
	testl	%eax, %eax
	js	LBB0_12
## %bb.13:
	xorl	%ebx, %ebx
	cmpl	$1, %eax
	cmovel	%ebx, %eax
	testq	%r14, %r14
	movl	$0, %esi
	cmovnel	%eax, %esi
LBB0_18:
	testl	%r15d, %r15d
	movl	-68(%rbp), %edx                 ## 4-byte Reload
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_22
## %bb.19:
	testl	%eax, %eax
	jne	LBB0_22
## %bb.20:
	testl	%esi, %esi
	jne	LBB0_22
## %bb.21:
	xorl	%r13d, %r13d
	movl	$48, %eax
	jmp	LBB0_26
LBB0_12:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_8
LBB0_22:
	testl	%edx, %edx
	je	LBB0_24
## %bb.23:
	testl	%eax, %eax
	cmovel	%eax, %r13d
	testl	%esi, %esi
	cmovel	%esi, %ebx
	addl	%r13d, %ebx
	jmp	LBB0_25
LBB0_16:
	leaq	L_.str.2(%rip), %rsi
LBB0_8:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_28:
	xorl	%edi, %edi
	subl	(%rax), %edi
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_24:
	leal	(%rax,%rsi), %ecx
	leal	8(,%rcx,4), %ebx
LBB0_25:
	movl	%ebx, %r13d
	addl	%r12d, %r13d
	leal	(%rbx,%r12), %eax
	addl	$48, %eax
LBB0_26:
	movl	-72(%rbp), %ecx                 ## 4-byte Reload
	testl	%ecx, %ecx
	cmovel	%ecx, %r12d
	leal	(%rax,%r12), %ecx
	testl	%edx, %edx
	leal	4(%rax,%r12), %ebx
	cmovel	%ecx, %ebx
	testq	%r14, %r14
	cmovnel	%ecx, %ebx
	movl	-80(%rbp), %r12d                ## 4-byte Reload
	addl	%r12d, %ebx
	movq	_GFP_DMA@GOTPCREL(%rip), %rax
	movl	-76(%rbp), %esi                 ## 4-byte Reload
	orl	(%rax), %esi
	movl	%ebx, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_27
## %bb.29:
	movq	%rax, %r14
	testl	%r12d, %r12d
	je	LBB0_30
## %bb.31:
	movslq	%ebx, %rax
	leaq	(%r14,%rax,4), %rdi
	movl	%r12d, %eax
	shlq	$2, %rax
	subq	%rax, %rdi
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	movl	%r12d, %edx
	callq	_memcpy
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movq	%rax, %rsi
	movl	%r12d, %edx
	callq	_dma_map_single
	movq	%rax, %rbx
	jmp	LBB0_32
LBB0_27:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_28
LBB0_30:
	xorl	%ebx, %ebx
	movq	-48(%rbp), %r15                 ## 8-byte Reload
LBB0_32:
	movq	%r14, %rdi
	addq	$40, %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	%eax, (%r14)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	%eax, 4(%r14)
	movq	%rbx, 32(%r14)
	movl	%r13d, 8(%r14)
	testl	%r13d, %r13d
	je	LBB0_34
## %bb.33:
	movq	16(%r14), %rsi
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	movl	%r13d, %edx
	callq	_dma_map_single
	movq	%rax, 24(%r14)
LBB0_34:
	movq	%r14, %rax
	addq	$56, %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	_TALITOS1_MAX_DATA_LEN,4,2      ## @TALITOS1_MAX_DATA_LEN
	.comm	_TALITOS2_MAX_DATA_LEN,4,2      ## @TALITOS2_MAX_DATA_LEN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"length exceeds h/w max limit\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"Invalid number of src SG.\n"

L_.str.2:                               ## @.str.2
	.asciz	"Invalid number of dst SG.\n"

	.comm	_GFP_DMA,4,2                    ## @GFP_DMA
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.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	x20, x7
	mov	x22, x6
	mov	x25, x5
	mov	x27, x4
	mov	x21, x3
	mov	x23, x2
	mov	x26, x1
	mov	x19, x0
	ldr	w28, [x29, #24]
	ldr	w8, [x29, #16]
	str	w8, [sp, #8]                    ; 4-byte Folded Spill
	ldr	w8, [x29, #20]
Lloh0:
	adrp	x9, _CRYPTO_TFM_REQ_MAY_SLEEP@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CRYPTO_TFM_REQ_MAY_SLEEP@GOTPAGEOFF]
Lloh2:
	adrp	x10, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x10, [x10, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
Lloh5:
	adrp	x11, _GFP_ATOMIC@GOTPAGE
Lloh6:
	ldr	x11, [x11, _GFP_ATOMIC@GOTPAGEOFF]
	tst	w9, w8
	csel	x8, x11, x10, eq
	ldr	w8, [x8]
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
	bl	_dev_get_drvdata
	bl	_has_ftr_sec1
Lloh7:
	adrp	x8, _TALITOS1_MAX_DATA_LEN@GOTPAGE
Lloh8:
	ldr	x8, [x8, _TALITOS1_MAX_DATA_LEN@GOTPAGEOFF]
Lloh9:
	adrp	x9, _TALITOS2_MAX_DATA_LEN@GOTPAGE
Lloh10:
	ldr	x9, [x9, _TALITOS2_MAX_DATA_LEN@GOTPAGEOFF]
	cmp	w0, #0
	csel	x8, x9, x8, eq
	ldr	w8, [x8]
	add	w9, w22, w25
	cmp	w9, w8
	b.ls	LBB0_2
; %bb.1:
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_23
LBB0_2:
	mov	x24, x0
	str	x21, [sp]                       ; 8-byte Folded Spill
	add	w21, w25, w27
	cbz	x23, LBB0_7
; %bb.3:
	cmp	x23, x26
	b.eq	LBB0_7
; %bb.4:
	cmp	w28, #0
	csel	w8, w22, wzr, eq
	add	w25, w8, w21
	mov	x0, x26
	mov	x1, x25
	bl	_sg_nents_for_len
	tbnz	w0, #31, LBB0_12
; %bb.5:
	mov	x27, x0
	cmp	w28, #0
	csel	w8, wzr, w22, eq
	add	w26, w8, w21
	mov	x0, x23
	mov	x1, x26
	bl	_sg_nents_for_len
	tbnz	w0, #31, LBB0_22
; %bb.6:
	cmp	w27, #1
	csel	w27, wzr, w27, eq
	cmp	w0, #1
	csel	w10, wzr, w0, eq
	ldr	x21, [sp]                       ; 8-byte Folded Reload
	cbnz	w28, LBB0_9
	b	LBB0_13
LBB0_7:
	add	w25, w21, w22
	mov	x0, x26
	mov	x1, x25
	bl	_sg_nents_for_len
	tbnz	w0, #31, LBB0_12
; %bb.8:
	mov	w26, #0
	cmp	w0, #1
	csel	w27, wzr, w0, eq
	cmp	x23, #0
	csel	w10, w27, wzr, ne
	ldr	x21, [sp]                       ; 8-byte Folded Reload
	cbz	w28, LBB0_13
LBB0_9:
	cbnz	w27, LBB0_13
; %bb.10:
	cbnz	w10, LBB0_13
; %bb.11:
	mov	x28, x10
	mov	w25, #0
	mov	w8, #48
	b	LBB0_14
LBB0_12:
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_23
LBB0_13:
	add	w8, w27, w10
	lsl	w8, w8, #2
	add	w8, w8, #8
	cmp	w27, #0
	csel	w9, w25, wzr, ne
	mov	x28, x10
	cmp	w10, #0
	csel	w10, w26, wzr, ne
	add	w9, w9, w10
	cmp	w24, #0
	csel	w8, w8, w9, eq
	add	w25, w8, w22
	add	w8, w25, #48
LBB0_14:
	ldr	w9, [sp, #8]                    ; 4-byte Folded Reload
	cmp	w9, #0
	csel	w9, wzr, w22, eq
	cmp	w24, #0
	ccmp	x23, #0, #0, ne
	add	w8, w8, w9
	add	w9, w8, #4
	csel	w8, w8, w9, ne
	add	w23, w8, w20
Lloh15:
	adrp	x8, _GFP_DMA@GOTPAGE
Lloh16:
	ldr	x8, [x8, _GFP_DMA@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]                   ; 4-byte Folded Reload
	orr	w1, w8, w9
	mov	x0, x23
	bl	_kmalloc
	cbz	x0, LBB0_17
; %bb.15:
	mov	x22, x0
	cbz	w20, LBB0_18
; %bb.16:
	add	x8, x22, w23, sxtw #2
	sub	x0, x8, w20, uxtw #2
	mov	x1, x21
	mov	x2, x20
	bl	_memcpy
	mov	x1, x0
Lloh18:
	adrp	x8, _DMA_TO_DEVICE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh20:
	ldr	w3, [x8]
	mov	x0, x19
	mov	x2, x20
	bl	_dma_map_single
	mov	x20, x0
	b	LBB0_19
LBB0_17:
Lloh21:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_24
LBB0_18:
	mov	x20, #0
LBB0_19:
	add	x0, x22, #40
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	stp	w27, w28, [x22]
	str	x20, [x22, #32]
	str	w25, [x22, #8]
	cbz	w25, LBB0_21
; %bb.20:
	ldr	x1, [x22, #16]
Lloh23:
	adrp	x8, _DMA_BIDIRECTIONAL@GOTPAGE
Lloh24:
	ldr	x8, [x8, _DMA_BIDIRECTIONAL@GOTPAGEOFF]
Lloh25:
	ldr	w3, [x8]
	mov	x0, x19
	mov	x2, x25
	bl	_dma_map_single
	str	x0, [x22, #24]
LBB0_21:
	mov	x0, x22
	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
LBB0_22:
Lloh26:
	adrp	x1, l_.str.2@PAGE
Lloh27:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_23:
	mov	x0, x19
	bl	_dev_err
Lloh28:
	adrp	x8, _EINVAL@GOTPAGE
Lloh29:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_24:
	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
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.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	_TALITOS1_MAX_DATA_LEN,4,2      ; @TALITOS1_MAX_DATA_LEN
	.comm	_TALITOS2_MAX_DATA_LEN,4,2      ; @TALITOS2_MAX_DATA_LEN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"length exceeds h/w max limit\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"Invalid number of src SG.\n"

l_.str.2:                               ; @.str.2
	.asciz	"Invalid number of dst SG.\n"

	.comm	_GFP_DMA,4,2                    ; @GFP_DMA
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.comm	_DMA_BIDIRECTIONAL,4,2          ; @DMA_BIDIRECTIONAL
	.no_dead_strip	_talitos_edesc_alloc
.subsections_via_symbols
