	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_aes_xmit
_mtk_aes_xmit:                          ## @mtk_aes_xmit
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %rax
	movq	(%rsi), %rcx
	movq	(%rax,%rcx,8), %r12
	movq	48(%rsi), %r15
	movq	32(%rsi), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	40(%rsi), %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	24(%rsi), %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	32(%r12), %r14
	movl	(%r15), %edi
	callq	_MTK_DESC_BUF_LEN
	movl	%eax, (%r14)
	movq	%r15, %rdi
	callq	_sg_dma_address
	movl	%eax, %edi
	callq	_cpu_to_le32
	movq	%rax, 8(%r14)
	movq	_MTK_DESC_FIRST@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	16(%rbx), %rax
	movl	12(%rax), %edi
	callq	_MTK_DESC_CT_LEN
	orl	%r13d, %eax
	orl	%eax, (%r14)
	movq	16(%rbx), %rax
	movl	8(%rax), %edi
	callq	_cpu_to_le32
	movq	%rax, 32(%r14)
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	16(%rbx), %rax
	movl	4(%rax), %ecx
	movl	%ecx, 24(%r14)
	movl	(%rax), %edi
	callq	_cpu_to_le32
	movq	%rax, 16(%r14)
	movq	24(%r12), %rax
	movq	32(%r12), %rcx
	addq	$40, %rcx
	movq	_MTK_DESC_NUM@GOTPCREL(%rip), %r13
	movslq	(%r13), %rdx
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rax,%rdx,8), %rdx
	cmpq	%rdx, %rcx
	cmoveq	%rax, %rcx
	movq	%rcx, 32(%r12)
	movq	%r15, %rdi
	callq	_sg_next
	cmpl	$1, -56(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_3
## %bb.1:
	movq	%rax, %r15
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leal	-1(%rax), %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	32(%r12), %r14
	movl	(%r15), %edi
	callq	_MTK_DESC_BUF_LEN
	movl	%eax, (%r14)
	movq	%r15, %rdi
	callq	_sg_dma_address
	movl	%eax, %edi
	callq	_cpu_to_le32
	movq	%rax, 8(%r14)
	movq	24(%r12), %rax
	movq	32(%r12), %rcx
	movslq	(%r13), %rdx
	addq	$40, %rcx
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rax,%rdx,8), %rdx
	cmpq	%rdx, %rcx
	cmoveq	%rax, %rcx
	movq	%rcx, 32(%r12)
	movq	%r15, %rdi
	callq	_sg_next
	movq	%rax, %r15
	decl	%ebx
	jne	LBB0_2
LBB0_3:
	movq	_MTK_DESC_LAST@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r14)
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	testl	%r15d, %r15d
	jle	LBB0_4
## %bb.5:
	movq	16(%r12), %r14
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movl	(%rbx), %edi
	callq	_MTK_DESC_BUF_LEN
	movl	%eax, (%r14)
	movq	%rbx, %rdi
	callq	_sg_dma_address
	movl	%eax, %edi
	callq	_cpu_to_le32
	movq	%rax, 8(%r14)
	movq	_MTK_DESC_FIRST@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r14)
	movq	8(%r12), %rax
	movq	16(%r12), %rcx
	addq	$40, %rcx
	movslq	(%r13), %rdx
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rax,%rdx,8), %rdx
	cmpq	%rdx, %rcx
	cmoveq	%rax, %rcx
	movq	%rcx, 16(%r12)
	movq	%rbx, %rdi
	callq	_sg_next
	cmpl	$1, %r15d
	je	LBB0_8
## %bb.6:
	movq	%rax, %rbx
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leal	-1(%rax), %r15d
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r12), %r14
	movl	(%rbx), %edi
	callq	_MTK_DESC_BUF_LEN
	movl	%eax, (%r14)
	movq	%rbx, %rdi
	callq	_sg_dma_address
	movl	%eax, %edi
	callq	_cpu_to_le32
	movq	%rax, 8(%r14)
	movslq	(%r13), %rax
	movq	8(%r12), %rcx
	movq	16(%r12), %rdx
	addq	$40, %rdx
	leaq	(%rax,%rax,4), %rax
	leaq	(%rcx,%rax,8), %rax
	cmpq	%rax, %rdx
	cmoveq	%rcx, %rdx
	movq	%rdx, 16(%r12)
	movq	%rbx, %rdi
	callq	_sg_next
	movq	%rax, %rbx
	decl	%r15d
	jne	LBB0_7
	jmp	LBB0_8
LBB0_4:
	xorl	%r14d, %r14d
LBB0_8:
	movl	(%r14), %eax
	movq	_MTK_DESC_LAST@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, (%r14)
	movq	%r14, (%r12)
	movq	_AES_FLAGS_GCM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	testl	%ecx, 8(%r12)
	je	LBB0_10
## %bb.9:
	movq	_AES_BLOCK_SIZE@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	movl	%eax, (%r14)
LBB0_10:
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_wmb
	movq	(%r12), %rdi
	callq	_RDR_PREP_COUNT
	movl	%eax, %r14d
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_MTK_DESC_CNT
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_mtk_aes_write
	movq	(%r12), %rdi
	callq	_CDR_PREP_COUNT
	movl	%eax, %r14d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_MTK_DESC_CNT
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_mtk_aes_write
	movq	_EINPROGRESS@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MTK_DESC_FIRST,4,2             ## @MTK_DESC_FIRST
	.comm	_MTK_DESC_NUM,4,2               ## @MTK_DESC_NUM
	.comm	_MTK_DESC_LAST,4,2              ## @MTK_DESC_LAST
	.comm	_AES_FLAGS_GCM,4,2              ## @AES_FLAGS_GCM
	.comm	_AES_BLOCK_SIZE,8,3             ## @AES_BLOCK_SIZE
	.comm	_EINPROGRESS,4,2                ## @EINPROGRESS
	.no_dead_strip	_mtk_aes_xmit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_aes_xmit
_mtk_aes_xmit:                          ; @mtk_aes_xmit
	.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, x1
	mov	x19, x0
	ldr	x8, [x0]
	ldr	x9, [x1]
	ldr	x25, [x8, x9, lsl #3]
	ldr	x24, [x1, #48]
	ldr	x23, [x1, #32]
	ldr	w27, [x1, #40]
	ldr	w22, [x1, #24]
	ldr	x28, [x25, #32]
	ldr	w0, [x24]
	bl	_MTK_DESC_BUF_LEN
	str	w0, [x28]
	mov	x0, x24
	bl	_sg_dma_address
	bl	_cpu_to_le32
	str	x0, [x28, #8]
Lloh0:
	adrp	x8, _MTK_DESC_FIRST@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MTK_DESC_FIRST@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
	ldr	x8, [x20, #16]
	ldr	w0, [x8, #12]
	bl	_MTK_DESC_CT_LEN
	orr	w8, w0, w21
	ldr	w9, [x28]
	orr	w8, w8, w9
	str	w8, [x28]
	ldr	x8, [x20, #16]
	ldr	w0, [x8, #8]
	bl	_cpu_to_le32
	str	x0, [x28, #32]
	ldr	x8, [x20, #16]
	ldp	w0, w9, [x8]
	str	w9, [x28, #24]
	bl	_cpu_to_le32
	str	x0, [x28, #16]
	ldp	x9, x8, [x25, #24]
	add	x8, x8, #40
Lloh3:
	adrp	x26, _MTK_DESC_NUM@GOTPAGE
Lloh4:
	ldr	x26, [x26, _MTK_DESC_NUM@GOTPAGEOFF]
	ldrsw	x10, [x26]
	mov	w11, #40
	madd	x10, x10, x11, x9
	cmp	x8, x10
	csel	x8, x9, x8, eq
	str	x8, [x25, #32]
	mov	x0, x24
	bl	_sg_next
	str	w27, [sp, #12]                  ; 4-byte Folded Spill
	subs	w27, w27, #1
	b.eq	LBB0_3
; %bb.1:
	mov	x24, x0
	mov	w21, #40
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x28, [x25, #32]
	ldr	w0, [x24]
	bl	_MTK_DESC_BUF_LEN
	str	w0, [x28]
	mov	x0, x24
	bl	_sg_dma_address
	bl	_cpu_to_le32
	str	x0, [x28, #8]
	ldp	x9, x8, [x25, #24]
	ldrsw	x10, [x26]
	add	x8, x8, #40
	madd	x10, x10, x21, x9
	cmp	x8, x10
	csel	x8, x9, x8, eq
	str	x8, [x25, #32]
	mov	x0, x24
	bl	_sg_next
	mov	x24, x0
	subs	w27, w27, #1
	b.ne	LBB0_2
LBB0_3:
Lloh5:
	adrp	x24, _MTK_DESC_LAST@GOTPAGE
Lloh6:
	ldr	x24, [x24, _MTK_DESC_LAST@GOTPAGEOFF]
	ldr	w8, [x24]
	ldr	w9, [x28]
	orr	w8, w9, w8
	str	w8, [x28]
	cmp	w22, #1
	b.lt	LBB0_7
; %bb.4:
	ldr	x28, [x25, #16]
	ldr	w0, [x23]
	bl	_MTK_DESC_BUF_LEN
	str	w0, [x28]
	mov	x0, x23
	bl	_sg_dma_address
	bl	_cpu_to_le32
	str	x0, [x28, #8]
Lloh7:
	adrp	x8, _MTK_DESC_FIRST@GOTPAGE
Lloh8:
	ldr	x8, [x8, _MTK_DESC_FIRST@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	ldr	w9, [x28]
	orr	w8, w9, w8
	str	w8, [x28]
	ldp	x9, x8, [x25, #8]
	add	x8, x8, #40
	ldrsw	x10, [x26]
	mov	w11, #40
	madd	x10, x10, x11, x9
	cmp	x8, x10
	csel	x8, x9, x8, eq
	str	x8, [x25, #16]
	mov	x0, x23
	bl	_sg_next
	subs	w27, w22, #1
	b.eq	LBB0_8
; %bb.5:
	mov	x23, x0
	mov	w21, #40
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x28, [x25, #16]
	ldr	w0, [x23]
	bl	_MTK_DESC_BUF_LEN
	str	w0, [x28]
	mov	x0, x23
	bl	_sg_dma_address
	bl	_cpu_to_le32
	str	x0, [x28, #8]
	ldrsw	x8, [x26]
	ldp	x10, x9, [x25, #8]
	add	x9, x9, #40
	madd	x8, x8, x21, x10
	cmp	x9, x8
	csel	x8, x10, x9, eq
	str	x8, [x25, #16]
	mov	x0, x23
	bl	_sg_next
	mov	x23, x0
	subs	w27, w27, #1
	b.ne	LBB0_6
	b	LBB0_8
LBB0_7:
	mov	x28, #0
LBB0_8:
	ldr	w8, [x24]
	ldr	w9, [x28]
	orr	w8, w9, w8
	str	w8, [x28]
	str	x28, [x25]
	ldr	w9, [x20, #8]
Lloh10:
	adrp	x10, _AES_FLAGS_GCM@GOTPAGE
Lloh11:
	ldr	x10, [x10, _AES_FLAGS_GCM@GOTPAGEOFF]
Lloh12:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_10
; %bb.9:
Lloh13:
	adrp	x9, _AES_BLOCK_SIZE@GOTPAGE
Lloh14:
	ldr	x9, [x9, _AES_BLOCK_SIZE@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	add	w8, w8, w9
	str	w8, [x28]
LBB0_10:
	bl	_wmb
	ldr	x0, [x20]
	bl	_RDR_PREP_COUNT
	mov	x23, x0
	mov	x0, x22
	bl	_MTK_DESC_CNT
	mov	x2, x0
	mov	x0, x19
	mov	x1, x23
	bl	_mtk_aes_write
	ldr	x0, [x20]
	bl	_CDR_PREP_COUNT
	mov	x20, x0
	ldr	w0, [sp, #12]                   ; 4-byte Folded Reload
	bl	_MTK_DESC_CNT
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	bl	_mtk_aes_write
Lloh16:
	adrp	x8, _EINPROGRESS@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINPROGRESS@GOTPAGEOFF]
Lloh18:
	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
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_MTK_DESC_FIRST,4,2             ; @MTK_DESC_FIRST
	.comm	_MTK_DESC_NUM,4,2               ; @MTK_DESC_NUM
	.comm	_MTK_DESC_LAST,4,2              ; @MTK_DESC_LAST
	.comm	_AES_FLAGS_GCM,4,2              ; @AES_FLAGS_GCM
	.comm	_AES_BLOCK_SIZE,8,3             ; @AES_BLOCK_SIZE
	.comm	_EINPROGRESS,4,2                ; @EINPROGRESS
	.no_dead_strip	_mtk_aes_xmit
.subsections_via_symbols
