	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_aes_ctr_transfer
_mtk_aes_ctr_transfer:                  ## @mtk_aes_ctr_transfer
	.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
	movq	%rsi, %rbx
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	16(%rsi), %r15
	movq	%r15, %rdi
	callq	_mtk_aes_ctr_ctx_cast
	movq	%rax, %r12
	movl	8(%rbx), %edi
	callq	_ablkcipher_request_cast
	movq	(%r12), %rcx
	addq	(%rbx), %rcx
	movq	%rcx, (%r12)
	movq	(%rax), %r14
	subq	%rcx, %r14
	jle	LBB0_6
## %bb.1:
	movq	%rax, %r13
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
	movq	_AES_BLOCK_SIZE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_DIV_ROUND_UP
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	8(%r12), %rax
	movl	12(%rax), %edi
	callq	_be32_to_cpu
	movl	(%rbx), %ecx
	imull	%eax, %ecx
	negl	%ecx
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	movslq	%ecx, %rdx
	movl	$-1, %ecx
	cmovgl	%eax, %ecx
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	cmovgq	%r14, %rdx
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movl	$0, %ebx
	setle	%bl
	movl	20(%r12), %edi
	movl	12(%r13), %esi
	movq	(%r12), %rdx
	callq	_scatterwalk_ffwd
	movl	8(%r13), %esi
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	cmpl	%esi, 12(%r13)
	je	LBB0_3
## %bb.2:
	movl	16(%r12), %edi
	movq	(%r12), %rdx
	callq	_scatterwalk_ffwd
LBB0_3:
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	(%r15), %rdi
	addq	8(%r15), %rdi
	movq	8(%r12), %rsi
	movq	_AES_BLOCK_SIZE@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	callq	_mtk_aes_write_state_le
	movl	%ebx, %edi
	callq	_unlikely
	testq	%rax, %rax
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	je	LBB0_5
## %bb.4:
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	callq	_cpu_to_be32
	movq	8(%r12), %rdi
	movl	%eax, 12(%rdi)
	movl	(%r13), %esi
	callq	_crypto_inc
LBB0_5:
	movq	%r14, %rdi
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	-80(%rbp), %r8                  ## 8-byte Reload
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mtk_aes_dma                    ## TAILCALL
LBB0_6:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mtk_aes_transfer_complete      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_AES_BLOCK_SIZE,4,2             ## @AES_BLOCK_SIZE
	.no_dead_strip	_mtk_aes_ctr_transfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_aes_ctr_transfer
_mtk_aes_ctr_transfer:                  ; @mtk_aes_ctr_transfer
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x1
	mov	x20, x0
	ldr	x22, [x1, #16]
	mov	x0, x22
	bl	_mtk_aes_ctr_ctx_cast
	mov	x21, x0
	ldr	w0, [x19, #8]
	bl	_ablkcipher_request_cast
	ldr	x8, [x19]
	ldr	x9, [x21]
	ldr	x10, [x0]
	add	x8, x9, x8
	subs	x23, x10, x8
	str	x8, [x21]
	b.le	LBB0_6
; %bb.1:
	mov	x27, x0
Lloh0:
	adrp	x28, _AES_BLOCK_SIZE@GOTPAGE
Lloh1:
	ldr	x28, [x28, _AES_BLOCK_SIZE@GOTPAGEOFF]
	ldr	w1, [x28]
	mov	x0, x23
	bl	_DIV_ROUND_UP
	mov	x24, x0
	ldr	x8, [x21, #8]
	ldr	w0, [x8, #12]
	bl	_be32_to_cpu
	cmp	w24, #1
	cset	w26, lt
	ldr	w8, [x28]
	mneg	w8, w0, w8
	sxtw	x8, w8
	cmp	w24, #0
	csinv	w25, w0, wzr, gt
	csel	x23, x23, x8, gt
	ldr	w0, [x21, #20]
	ldr	w1, [x27, #12]
	ldr	x2, [x21]
	bl	_scatterwalk_ffwd
	mov	x24, x0
	ldp	w1, w8, [x27, #8]
	mov	x27, x0
	cmp	w8, w1
	b.eq	LBB0_3
; %bb.2:
	ldr	w0, [x21, #16]
	ldr	x2, [x21]
	bl	_scatterwalk_ffwd
	mov	x27, x0
LBB0_3:
	ldp	x9, x8, [x22]
	add	x0, x9, x8
	ldr	x1, [x21, #8]
	ldr	w2, [x28]
	bl	_mtk_aes_write_state_le
	mov	x0, x26
	bl	_unlikely
	cbz	x0, LBB0_5
; %bb.4:
	mov	x0, x25
	bl	_cpu_to_be32
	ldr	x8, [x21, #8]
	str	w0, [x8, #12]
	ldr	w1, [x28]
	mov	x0, x8
	bl	_crypto_inc
LBB0_5:
	mov	x0, x20
	mov	x1, x19
	mov	x2, x24
	mov	x3, x27
	mov	x4, x23
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_mtk_aes_dma
LBB0_6:
	mov	x0, x20
	mov	x1, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_mtk_aes_transfer_complete
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_AES_BLOCK_SIZE,4,2             ; @AES_BLOCK_SIZE
	.no_dead_strip	_mtk_aes_ctr_transfer
.subsections_via_symbols
