	.file	"extr_aes.c_aes_encrypt_final.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	aes_encrypt_final, @function
aes_encrypt_final:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	cmp	QWORD PTR [rdi], 0
	setne	dil
	movzx	edi, dil
	call	ASSERT@PLT
	mov	rax, QWORD PTR [r12]
	cmp	rax, QWORD PTR CRYPTO_DATA_RAW[rip]
	je	.L2
	cmp	rax, QWORD PTR CRYPTO_DATA_UIO[rip]
	je	.L2
	mov	eax, DWORD PTR CRYPTO_ARGUMENTS_BAD[rip]
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	rdi, QWORD PTR 0[rbp]
	mov	eax, DWORD PTR [rdi]
	test	DWORD PTR CTR_MODE[rip], eax
	jne	.L13
	test	DWORD PTR CCM_MODE[rip], eax
	jne	.L14
	mov	edx, DWORD PTR GCM_MODE[rip]
	or	edx, DWORD PTR GMAC_MODE[rip]
	test	edx, eax
	jne	.L15
	cmp	QWORD PTR 8[rdi], 0
	mov	eax, DWORD PTR CRYPTO_DATA_LEN_RANGE[rip]
	jg	.L1
	mov	QWORD PTR 16[r12], 0
.L6:
	mov	rdi, rbp
	call	aes_free_context@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	eax, DWORD PTR CRYPTO_SUCCESS[rip]
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	cmp	QWORD PTR 8[rdi], 0
	jle	.L6
	mov	edx, DWORD PTR aes_encrypt_block[rip]
	mov	rsi, r12
	call	ctr_mode_final@PLT
	cmp	DWORD PTR CRYPTO_SUCCESS[rip], eax
	jne	.L1
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L15:
	mov	r9d, DWORD PTR aes_xor_block[rip]
	mov	r8d, DWORD PTR aes_copy_block[rip]
	mov	rsi, r12
	mov	ecx, DWORD PTR aes_encrypt_block[rip]
	mov	edx, DWORD PTR AES_BLOCK_LEN[rip]
	mov	rbx, QWORD PTR 8[r12]
	call	gcm_encrypt_final@PLT
	cmp	DWORD PTR CRYPTO_SUCCESS[rip], eax
	jne	.L1
	mov	rax, QWORD PTR 8[r12]
	mov	QWORD PTR 8[r12], rbx
	sub	rax, rbx
	mov	QWORD PTR 16[r12], rax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L14:
	mov	r8d, DWORD PTR aes_xor_block[rip]
	mov	ecx, DWORD PTR aes_encrypt_block[rip]
	mov	rsi, r12
	mov	edx, DWORD PTR AES_BLOCK_LEN[rip]
	call	ccm_encrypt_final@PLT
	cmp	DWORD PTR CRYPTO_SUCCESS[rip], eax
	jne	.L1
	jmp	.L6
	.cfi_endproc
.LFE0:
	.size	aes_encrypt_final, .-aes_encrypt_final
	.comm	aes_xor_block,4,4
	.comm	aes_encrypt_block,4,4
	.comm	aes_copy_block,4,4
	.comm	GMAC_MODE,4,4
	.comm	GCM_MODE,4,4
	.comm	CTR_MODE,4,4
	.comm	CRYPTO_SUCCESS,4,4
	.comm	CRYPTO_DATA_UIO,8,8
	.comm	CRYPTO_DATA_RAW,8,8
	.comm	CRYPTO_DATA_LEN_RANGE,4,4
	.comm	CRYPTO_ARGUMENTS_BAD,4,4
	.comm	CCM_MODE,4,4
	.comm	AES_BLOCK_LEN,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.c_aes_encrypt_final.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	aes_encrypt_final, %function
aes_encrypt_final:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	mov	r5, r1
	mov	r4, r0
	ldr	r0, [r0]
	sub	sp, sp, #12
	subs	r0, r0, #0
	movne	r0, #1
	bl	ASSERT
	ldr	r2, .L17
	ldr	r3, [r5]
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L2
	ldr	r2, .L17+4
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L2
	ldr	r3, .L17+8
	ldr	r0, [r3]
.L1:
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L2:
	ldr	r0, [r4]
	ldr	r2, .L17+12
	ldr	r3, [r0]
	ldr	r2, [r2]
	tst	r3, r2
	bne	.L13
	ldr	r2, .L17+16
	ldr	r2, [r2]
	tst	r3, r2
	bne	.L14
	ldr	r2, .L17+20
	ldr	r1, .L17+24
	ldr	r2, [r2]
	ldr	r1, [r1]
	orr	r2, r2, r1
	ands	r3, r2, r3
	bne	.L15
	ldr	r2, [r0, #4]
	cmp	r2, #0
	bgt	.L16
	ldr	r6, .L17+28
	str	r3, [r5, #8]
	b	.L6
.L13:
	ldr	r3, [r0, #4]
	cmp	r3, #0
	bgt	.L5
	ldr	r6, .L17+28
.L6:
	mov	r0, r4
	bl	aes_free_context
	ldr	r0, [r6]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L5:
	ldr	r3, .L17+32
	mov	r1, r5
	ldr	r2, [r3]
	bl	ctr_mode_final
	ldr	r6, .L17+28
	ldr	r3, [r6]
	cmp	r3, r0
	bne	.L1
	b	.L6
.L15:
	ldr	r2, .L17+36
	ldr	r3, .L17+40
	ldr	ip, [r2]
	ldr	r1, [r3]
	ldr	r2, .L17+44
	stm	sp, {r1, ip}
	ldr	r3, .L17+32
	mov	r1, r5
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r7, [r5, #4]
	bl	gcm_encrypt_final
	ldr	r6, .L17+28
	ldr	r3, [r6]
	cmp	r3, r0
	bne	.L1
	ldr	r3, [r5, #4]
	str	r7, [r5, #4]
	sub	r3, r3, r7
	str	r3, [r5, #8]
	b	.L6
.L14:
	ldr	r2, .L17+36
	ldr	r3, .L17+32
	ldr	ip, [r2]
	ldr	r2, .L17+44
	str	ip, [sp]
	ldr	r3, [r3]
	mov	r1, r5
	ldr	r2, [r2]
	bl	ccm_encrypt_final
	ldr	r6, .L17+28
	ldr	r3, [r6]
	cmp	r3, r0
	bne	.L1
	b	.L6
.L16:
	ldr	r3, .L17+48
	ldr	r0, [r3]
	b	.L1
.L18:
	.align	2
.L17:
	.word	CRYPTO_DATA_RAW
	.word	CRYPTO_DATA_UIO
	.word	CRYPTO_ARGUMENTS_BAD
	.word	CTR_MODE
	.word	CCM_MODE
	.word	GCM_MODE
	.word	GMAC_MODE
	.word	CRYPTO_SUCCESS
	.word	aes_encrypt_block
	.word	aes_xor_block
	.word	aes_copy_block
	.word	AES_BLOCK_LEN
	.word	CRYPTO_DATA_LEN_RANGE
	.size	aes_encrypt_final, .-aes_encrypt_final
	.comm	aes_xor_block,4,4
	.comm	aes_encrypt_block,4,4
	.comm	aes_copy_block,4,4
	.comm	GMAC_MODE,4,4
	.comm	GCM_MODE,4,4
	.comm	CTR_MODE,4,4
	.comm	CRYPTO_SUCCESS,4,4
	.comm	CRYPTO_DATA_UIO,4,4
	.comm	CRYPTO_DATA_RAW,4,4
	.comm	CRYPTO_DATA_LEN_RANGE,4,4
	.comm	CRYPTO_ARGUMENTS_BAD,4,4
	.comm	CCM_MODE,4,4
	.comm	AES_BLOCK_LEN,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
