	.file	"extr_aes_xts.c_p8_aes_xts_crypt.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	p8_aes_xts_crypt, @function
p8_aes_xts_crypt:
.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
	push	r14
	push	r13
	push	r12
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	mov	r12, rdi
	push	rbx
	.cfi_offset 3, -56
	mov	ebx, esi
	sub	rsp, 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	r13, 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
.L25:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L25
.L3:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L26
.L4:
	xor	eax, eax
	mov	r15, rsp
	call	crypto_simd_usable@PLT
	test	eax, eax
	je	.L5
	mov	eax, DWORD PTR [r12]
	cdq
	idiv	DWORD PTR XTS_BLOCK_SIZE[rip]
	test	edx, edx
	jne	.L5
	lea	r14, -80[rbp]
	xor	edx, edx
	mov	rsi, r12
	mov	rdi, r14
	call	skcipher_walk_virt@PLT
	mov	r8d, eax
	test	eax, eax
	je	.L27
	.p2align 4,,10
	.p2align 3
.L1:
	mov	rax, QWORD PTR -56[rbp]
	xor	rax, QWORD PTR fs:40
	jne	.L28
	lea	rsp, -40[rbp]
	mov	eax, r8d
	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
.L5:
	.cfi_restore_state
	mov	rdi, r12
	call	skcipher_request_ctx@PLT
	mov	esi, DWORD PTR 12[r13]
	mov	r14, rax
	mov	eax, DWORD PTR [r12]
	mov	rdi, r14
	mov	DWORD PTR [r14], eax
	call	skcipher_request_set_tfm@PLT
	mov	rdi, r14
	test	ebx, ebx
	je	.L7
	call	crypto_skcipher_encrypt@PLT
	mov	r8d, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L7:
	call	crypto_skcipher_decrypt@PLT
	mov	r8d, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L27:
	mov	DWORD PTR -88[rbp], eax
	xor	eax, eax
	call	preempt_disable@PLT
	xor	eax, eax
	call	pagefault_disable@PLT
	xor	eax, eax
	call	enable_kernel_vsx@PLT
	mov	edi, DWORD PTR -68[rbp]
	lea	rdx, 8[r13]
	mov	rsi, r15
	call	aes_p8_encrypt@PLT
	xor	eax, eax
	call	disable_kernel_vsx@PLT
	xor	eax, eax
	call	pagefault_enable@PLT
	xor	eax, eax
	call	preempt_enable@PLT
	mov	r12d, DWORD PTR -80[rbp]
	mov	r8d, DWORD PTR -88[rbp]
	test	r12d, r12d
	je	.L1
	lea	rax, 4[r13]
	mov	QWORD PTR -88[rbp], rax
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L29:
	call	round_down@PLT
	mov	rcx, QWORD PTR -88[rbp]
	mov	esi, DWORD PTR -76[rbp]
	mov	r9, r15
	mov	edi, DWORD PTR -72[rbp]
	mov	edx, eax
	xor	r8d, r8d
	call	aes_p8_xts_encrypt@PLT
.L10:
	xor	eax, eax
	call	disable_kernel_vsx@PLT
	xor	eax, eax
	call	pagefault_enable@PLT
	xor	eax, eax
	call	preempt_enable@PLT
	mov	eax, r12d
	xor	edx, edx
	mov	rdi, r14
	div	DWORD PTR AES_BLOCK_SIZE[rip]
	mov	esi, edx
	call	skcipher_walk_done@PLT
	mov	r12d, DWORD PTR -80[rbp]
	mov	r8d, eax
	test	r12d, r12d
	je	.L1
.L11:
	xor	eax, eax
	call	preempt_disable@PLT
	xor	eax, eax
	call	pagefault_disable@PLT
	xor	eax, eax
	call	enable_kernel_vsx@PLT
	mov	esi, DWORD PTR AES_BLOCK_SIZE[rip]
	mov	edi, r12d
	test	ebx, ebx
	jne	.L29
	call	round_down@PLT
	mov	esi, DWORD PTR -76[rbp]
	mov	edi, DWORD PTR -72[rbp]
	mov	r9, r15
	mov	edx, eax
	xor	r8d, r8d
	mov	rcx, r13
	call	aes_p8_xts_decrypt@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L26:
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L4
.L28:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	p8_aes_xts_crypt, .-p8_aes_xts_crypt
	.comm	XTS_BLOCK_SIZE,4,4
	.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_xts.c_p8_aes_xts_crypt.c"
	.text
	.global	__aeabi_idivmod
	.global	__aeabi_uidivmod
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	p8_aes_xts_crypt, %function
p8_aes_xts_crypt:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #44
	ldr	r3, .L22
	mov	r5, r1
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	mov	r4, r0
	bl	crypto_skcipher_reqtfm
	bl	crypto_skcipher_ctx
	ldr	r6, .L22+4
	mov	r7, r0
	ldr	r3, [r6]
	lsl	r3, r3, #2
	add	r3, r3, #7
	bic	r3, r3, #7
	sub	sp, sp, r3
	bl	crypto_simd_usable
	cmp	r0, #0
	beq	.L2
	ldr	r3, .L22+8
	ldr	r0, [r4]
	ldr	r1, [r3]
	bl	__aeabi_idivmod
	subs	r2, r1, #0
	beq	.L3
.L2:
	mov	r0, r4
	bl	skcipher_request_ctx
	mov	r6, r0
	ldr	r3, [r4]
	ldr	r1, [r7, #12]
	str	r3, [r0]
	bl	skcipher_request_set_tfm
	cmp	r5, #0
	mov	r0, r6
	bne	.L19
	bl	crypto_skcipher_decrypt
	mov	r3, r0
.L1:
	ldr	r2, .L22
	ldr	r1, [r2]
	ldr	r2, [fp, #-40]
	eors	r1, r2, r1
	mov	r2, #0
	bne	.L20
	mov	r0, r3
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L3:
	mov	r1, r4
	sub	r0, fp, #56
	bl	skcipher_walk_virt
	subs	r3, r0, #0
	bne	.L1
	add	r8, sp, #8
	str	r3, [fp, #-64]
	bl	preempt_disable
	bl	pagefault_disable
	bl	enable_kernel_vsx
	mov	r1, r8
	add	r2, r7, #8
	ldr	r0, [fp, #-44]
	bl	aes_p8_encrypt
	bl	disable_kernel_vsx
	bl	pagefault_enable
	bl	preempt_enable
	ldr	r4, [fp, #-56]
	ldr	r3, [fp, #-64]
	cmp	r4, #0
	beq	.L1
	str	r3, [fp, #-68]
	add	r9, r7, #4
	b	.L8
.L21:
	bl	round_down
	ldr	r2, [fp, #-64]
	ldr	r3, [fp, #-68]
	mov	r1, r2
	str	r3, [sp]
	mov	r2, r0
	mov	r3, r9
	mov	r0, r10
	str	r8, [sp, #4]
	bl	aes_p8_xts_encrypt
.L7:
	bl	disable_kernel_vsx
	bl	pagefault_enable
	bl	preempt_enable
	mov	r0, r4
	ldr	r1, [r6]
	bl	__aeabi_uidivmod
	sub	r0, fp, #56
	bl	skcipher_walk_done
	ldr	r4, [fp, #-56]
	mov	r3, r0
	cmp	r4, #0
	beq	.L1
.L8:
	bl	preempt_disable
	bl	pagefault_disable
	bl	enable_kernel_vsx
	ldr	r2, [fp, #-52]
	cmp	r5, #0
	mov	r0, r4
	ldr	r1, [r6]
	ldr	r10, [fp, #-48]
	str	r2, [fp, #-64]
	bne	.L21
	bl	round_down
	ldr	r2, [fp, #-64]
	mov	r3, r7
	mov	r1, r2
	stm	sp, {r5, r8}
	mov	r2, r0
	mov	r0, r10
	bl	aes_p8_xts_decrypt
	b	.L7
.L19:
	bl	crypto_skcipher_encrypt
	mov	r3, r0
	b	.L1
.L20:
	bl	__stack_chk_fail
.L23:
	.align	2
.L22:
	.word	.LC0
	.word	AES_BLOCK_SIZE
	.word	XTS_BLOCK_SIZE
	.size	p8_aes_xts_crypt, .-p8_aes_xts_crypt
	.comm	XTS_BLOCK_SIZE,4,4
	.comm	AES_BLOCK_SIZE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
