	.file	"extr_mtk-aes.c_mtk_aes_ctr_transfer.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	mtk_aes_ctr_transfer, @function
mtk_aes_ctr_transfer:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	r14, QWORD PTR 16[rsi]
	mov	QWORD PTR 8[rsp], rdi
	mov	rdi, r14
	call	mtk_aes_ctr_ctx_cast@PLT
	mov	edi, DWORD PTR 8[rbp]
	mov	r13, rax
	call	ablkcipher_request_cast@PLT
	mov	r9, rax
	mov	rax, QWORD PTR 0[rbp]
	add	rax, QWORD PTR 0[r13]
	mov	rbx, QWORD PTR [r9]
	mov	QWORD PTR 0[r13], rax
	cmp	rax, rbx
	jge	.L13
	sub	rbx, rax
	mov	esi, DWORD PTR AES_BLOCK_SIZE[rip]
	mov	QWORD PTR 24[rsp], r9
	mov	rdi, rbx
	call	DIV_ROUND_UP@PLT
	mov	r15d, eax
	mov	rax, QWORD PTR 8[r13]
	mov	edi, DWORD PTR 12[rax]
	call	be32_to_cpu@PLT
	mov	DWORD PTR 16[rsp], 0
	mov	r9, QWORD PTR 24[rsp]
	mov	r12d, eax
	lea	eax, -1[rax+r15]
	cmp	r12d, eax
	jle	.L3
	neg	r12d
	imul	r12d, DWORD PTR AES_BLOCK_SIZE[rip]
	mov	DWORD PTR 16[rsp], 1
	movsx	rbx, r12d
	mov	r12d, -1
.L3:
	mov	esi, DWORD PTR 12[r9]
	mov	edi, DWORD PTR 20[r13]
	mov	QWORD PTR 24[rsp], r9
	mov	rdx, QWORD PTR 0[r13]
	call	scatterwalk_ffwd@PLT
	mov	r9, QWORD PTR 24[rsp]
	mov	r15, rax
	mov	rcx, rax
	mov	esi, DWORD PTR 8[r9]
	cmp	DWORD PTR 12[r9], esi
	jne	.L14
.L4:
	mov	rsi, QWORD PTR 8[r13]
	mov	edx, DWORD PTR AES_BLOCK_SIZE[rip]
	mov	QWORD PTR 24[rsp], rcx
	mov	rdi, QWORD PTR [r14]
	add	rdi, QWORD PTR 8[r14]
	call	mtk_aes_write_state_le@PLT
	mov	edi, DWORD PTR 16[rsp]
	call	unlikely@PLT
	mov	rcx, QWORD PTR 24[rsp]
	test	rax, rax
	jne	.L15
.L5:
	mov	rdi, QWORD PTR 8[rsp]
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	r8, rbx
	mov	rdx, r15
	pop	rbx
	.cfi_def_cfa_offset 48
	mov	rsi, rbp
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	jmp	mtk_aes_dma@PLT
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	mov	edi, DWORD PTR 16[r13]
	mov	rdx, QWORD PTR 0[r13]
	call	scatterwalk_ffwd@PLT
	mov	rcx, rax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L15:
	mov	r14, QWORD PTR 8[r13]
	mov	edi, r12d
	mov	QWORD PTR 16[rsp], rcx
	call	cpu_to_be32@PLT
	mov	rdi, QWORD PTR 8[r13]
	mov	esi, DWORD PTR AES_BLOCK_SIZE[rip]
	mov	DWORD PTR 12[r14], eax
	call	crypto_inc@PLT
	mov	rcx, QWORD PTR 16[rsp]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L13:
	mov	rdi, QWORD PTR 8[rsp]
	add	rsp, 40
	.cfi_def_cfa_offset 56
	mov	rsi, rbp
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	jmp	mtk_aes_transfer_complete@PLT
	.cfi_endproc
.LFE0:
	.size	mtk_aes_ctr_transfer, .-mtk_aes_ctr_transfer
	.comm	AES_BLOCK_SIZE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_mtk-aes.c_mtk_aes_ctr_transfer.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	mtk_aes_ctr_transfer, %function
mtk_aes_ctr_transfer:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r8, [r1, #8]
	sub	sp, sp, #20
	str	r0, [sp, #8]
	mov	r0, r8
	mov	r4, r1
	bl	mtk_aes_ctr_ctx_cast
	mov	r7, r0
	ldr	r0, [r4, #4]
	bl	ablkcipher_request_cast
	ldr	r2, [r7]
	ldr	r1, [r4]
	ldr	r5, [r0]
	add	r2, r2, r1
	cmp	r2, r5
	str	r2, [r7]
	bge	.L13
	ldr	r10, .L16
	sub	r5, r5, r2
	mov	r9, r0
	ldr	r1, [r10]
	mov	r0, r5
	bl	DIV_ROUND_UP
	ldr	r2, [r7, #4]
	mov	fp, r0
	ldr	r0, [r2, #12]
	bl	be32_to_cpu
	mov	r6, r0
	add	fp, fp, r0
	sub	fp, fp, #1
	cmp	r0, fp
	ldrgt	r0, [r10]
	rsbgt	r5, r6, #0
	mulgt	r5, r0, r5
	ldr	r1, [r9, #8]
	ldr	r2, [r7]
	ldr	r0, [r7, #12]
	movgt	fp, #1
	mvngt	r6, #0
	movle	fp, #0
	bl	scatterwalk_ffwd
	ldmib	r9, {r1, r2}
	cmp	r2, r1
	mov	r9, r0
	moveq	r3, r0
	bne	.L14
.L4:
	ldr	r1, [r8]
	ldr	r0, [r8, #4]
	ldr	r2, [r10]
	add	r0, r0, r1
	ldr	r1, [r7, #4]
	str	r3, [sp, #12]
	bl	mtk_aes_write_state_le
	mov	r0, fp
	bl	unlikely
	cmp	r0, #0
	ldr	r3, [sp, #12]
	bne	.L15
.L5:
	mov	r2, r9
	mov	r1, r4
	ldr	r0, [sp, #8]
	str	r5, [sp]
	bl	mtk_aes_dma
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L14:
	ldr	r2, [r7]
	ldr	r0, [r7, #8]
	bl	scatterwalk_ffwd
	mov	r3, r0
	b	.L4
.L15:
	mov	r0, r6
	ldr	r6, [r7, #4]
	bl	cpu_to_be32
	ldr	r1, [r10]
	str	r0, [r6, #12]
	ldr	r0, [r7, #4]
	bl	crypto_inc
	ldr	r3, [sp, #12]
	b	.L5
.L13:
	mov	r1, r4
	ldr	r0, [sp, #8]
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	mtk_aes_transfer_complete
.L17:
	.align	2
.L16:
	.word	AES_BLOCK_SIZE
	.size	mtk_aes_ctr_transfer, .-mtk_aes_ctr_transfer
	.comm	AES_BLOCK_SIZE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
