	.file	"extr_aes-neonbs-glue.c_ctr_encrypt.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ctr_encrypt, @function
ctr_encrypt:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	.cfi_offset 15, -24
	mov	r15, rdi
	push	r14
	push	r13
	push	r12
	push	rbx
	sub	rsp, 56
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	call	crypto_skcipher_reqtfm@PLT
	mov	rdi, rax
	call	crypto_skcipher_ctx@PLT
	mov	rcx, rsp
	mov	r12, rax
	movsx	rax, DWORD PTR AES_BLOCK_SIZE[rip]
	lea	rax, 15[0+rax*4]
	mov	rdx, rax
	and	rax, -4096
	sub	rcx, rax
	and	rdx, -16
	mov	rax, rcx
	cmp	rsp, rax
	je	.L3
.L24:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L24
.L3:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L25
.L4:
	lea	r13, -96[rbp]
	mov	rsi, r15
	xor	edx, edx
	mov	r14, rsp
	mov	rdi, r13
	call	skcipher_walk_virt@PLT
	mov	esi, DWORD PTR -96[rbp]
	test	esi, esi
	jle	.L1
	.p2align 4,,10
	.p2align 3
.L8:
	mov	ecx, DWORD PTR AES_BLOCK_SIZE[rip]
	mov	eax, esi
	mov	edi, DWORD PTR -92[rbp]
	cdq
	idiv	ecx
	mov	r15d, eax
	mov	ebx, eax
	mov	eax, edi
	cdq
	idiv	ecx
	test	edx, edx
	je	.L26
	cmp	edi, esi
	jle	.L27
.L10:
	mov	eax, DWORD PTR -88[rbp]
	mov	edi, r15d
	cdq
	idiv	ecx
	mov	esi, eax
	call	round_down@PLT
	mov	ebx, eax
.L22:
	xor	eax, eax
	call	kernel_neon_begin@PLT
	sub	rsp, 8
	mov	r9d, DWORD PTR -64[rbp]
	mov	r8d, ebx
	mov	edx, DWORD PTR 4[r12]
	mov	ecx, DWORD PTR [r12]
	push	0
	mov	rsi, QWORD PTR -80[rbp]
	mov	rdi, QWORD PTR -72[rbp]
	call	aesbs_ctr_encrypt@PLT
	xor	eax, eax
	call	kernel_neon_end@PLT
	imul	ebx, DWORD PTR AES_BLOCK_SIZE[rip]
	pop	rsi
	mov	esi, DWORD PTR -96[rbp]
	pop	rdi
	mov	rdi, r13
	sub	esi, ebx
	call	skcipher_walk_done@PLT
	mov	esi, DWORD PTR -96[rbp]
	test	esi, esi
	jg	.L8
.L1:
	mov	rcx, QWORD PTR -56[rbp]
	xor	rcx, QWORD PTR fs:40
	jne	.L28
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L26:
	.cfi_restore_state
	cmp	edi, esi
	jle	.L22
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L27:
	xor	eax, eax
	call	kernel_neon_begin@PLT
	sub	rsp, 8
	mov	r9d, DWORD PTR -64[rbp]
	mov	r8d, r15d
	mov	edx, DWORD PTR 4[r12]
	mov	ecx, DWORD PTR [r12]
	push	r14
	mov	rsi, QWORD PTR -80[rbp]
	mov	rdi, QWORD PTR -72[rbp]
	call	aesbs_ctr_encrypt@PLT
	xor	eax, eax
	call	kernel_neon_end@PLT
	mov	eax, DWORD PTR -92[rbp]
	mov	esi, DWORD PTR AES_BLOCK_SIZE[rip]
	mov	rdi, QWORD PTR -72[rbp]
	cdq
	imul	r15d, esi
	idiv	esi
	mov	rsi, QWORD PTR -80[rbp]
	sal	r15, 2
	add	rsi, r15
	add	rdi, r15
	mov	ecx, edx
	mov	rdx, r14
	call	crypto_xor_cpy@PLT
	xor	esi, esi
	mov	rdi, r13
	call	skcipher_walk_done@PLT
	pop	rdx
	pop	rcx
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L25:
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L4
.L28:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	ctr_encrypt, .-ctr_encrypt
	.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_aes-neonbs-glue.c_ctr_encrypt.c"
	.text
	.global	__aeabi_idiv
	.global	__aeabi_idivmod
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ctr_encrypt, %function
ctr_encrypt:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #60
	ldr	r3, .L19
	mov	r4, r0
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	bl	crypto_skcipher_reqtfm
	bl	crypto_skcipher_ctx
	ldr	r6, .L19+4
	mov	r7, r0
	ldr	r3, [r6]
	mov	r1, r4
	lsl	r3, r3, #2
	add	r3, r3, #7
	bic	r3, r3, #7
	sub	sp, sp, r3
	mov	r2, #0
	sub	r0, fp, #64
	bl	skcipher_walk_virt
	ldr	r5, [fp, #-64]
	add	r3, sp, #16
	cmp	r5, #0
	str	r3, [fp, #-72]
	bgt	.L5
	b	.L1
.L3:
	cmp	r9, r5
	ble	.L17
.L7:
	mov	r1, r10
	ldr	r0, [fp, #-56]
	bl	__aeabi_idiv
	mov	r1, r0
	mov	r0, r4
	bl	round_down
	mov	r4, r0
	bl	kernel_neon_begin
	mov	r0, #0
	ldr	r1, [fp, #-44]
	ldr	r3, [r7]
	ldr	r2, [r7, #4]
	str	r0, [sp, #8]
	str	r1, [sp, #4]
	ldr	r0, [fp, #-48]
	ldr	r1, [fp, #-52]
	str	r4, [sp]
	bl	aesbs_ctr_encrypt
	bl	kernel_neon_end
.L6:
	ldr	r0, [r6]
	ldr	r1, [fp, #-64]
	mul	r4, r0, r4
	sub	r0, fp, #64
	sub	r1, r1, r4
	bl	skcipher_walk_done
	ldr	r5, [fp, #-64]
	cmp	r5, #0
	ble	.L1
.L5:
	ldr	r10, [r6]
	mov	r0, r5
	mov	r1, r10
	bl	__aeabi_idiv
	ldr	r9, [fp, #-60]
	mov	r4, r0
	mov	r1, r10
	mov	r0, r9
	bl	__aeabi_idivmod
	subs	r8, r1, #0
	bne	.L3
	cmp	r9, r5
	bgt	.L7
	bl	kernel_neon_begin
	ldr	r0, [fp, #-44]
	ldr	r3, [r7]
	ldr	r2, [r7, #4]
	ldr	r1, [fp, #-52]
	str	r0, [sp, #4]
	str	r8, [sp, #8]
	ldr	r0, [fp, #-48]
	str	r4, [sp]
	bl	aesbs_ctr_encrypt
	bl	kernel_neon_end
	b	.L6
.L17:
	bl	kernel_neon_begin
	ldr	r1, [fp, #-44]
	ldr	r5, [fp, #-72]
	ldr	r3, [r7]
	ldr	r2, [r7, #4]
	ldr	r0, [fp, #-48]
	str	r4, [sp]
	str	r1, [sp, #4]
	str	r5, [sp, #8]
	ldr	r1, [fp, #-52]
	bl	aesbs_ctr_encrypt
	bl	kernel_neon_end
	ldr	r1, [r6]
	ldr	r0, [fp, #-60]
	mul	r4, r1, r4
	bl	__aeabi_idivmod
	ldr	r0, [fp, #-48]
	mov	r3, r1
	ldr	r1, [fp, #-52]
	lsl	r4, r4, #2
	add	r1, r1, r4
	mov	r2, r5
	add	r0, r0, r4
	bl	crypto_xor_cpy
	mov	r1, #0
	sub	r0, fp, #64
	bl	skcipher_walk_done
.L1:
	ldr	r3, .L19
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L18
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L18:
	bl	__stack_chk_fail
.L20:
	.align	2
.L19:
	.word	.LC0
	.word	AES_BLOCK_SIZE
	.size	ctr_encrypt, .-ctr_encrypt
	.comm	AES_BLOCK_SIZE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
