	.file	"extr_e_chacha20_poly1305.c_chacha20_poly1305_cipher.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	chacha20_poly1305_cipher, @function
chacha20_poly1305_cipher:
.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, rsi
	push	r14
	push	r13
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	mov	r13, rdi
	push	r12
	push	rbx
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	rbx, rdx
	sub	rsp, 72
	mov	QWORD PTR -72[rbp], rcx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	call	aead_data@PLT
	mov	ecx, DWORD PTR 8[rax]
	mov	r14, QWORD PTR [rax]
	mov	r12, rax
	test	ecx, ecx
	jne	.L3
	cmp	QWORD PTR NO_TLS_PAYLOAD_LENGTH[rip], r14
	je	.L4
	test	r15, r15
	jne	.L53
.L4:
	mov	r8, QWORD PTR 56[r12]
	mov	rsi, QWORD PTR zero[rip]
	mov	DWORD PTR [r8], 0
	mov	ecx, DWORD PTR 76[r12]
	mov	edx, DWORD PTR CHACHA_BLK_SIZE[rip]
	mov	edi, DWORD PTR 72[r12]
	call	ChaCha20_ctr32@PLT
	mov	esi, DWORD PTR 72[r12]
	mov	rdi, r12
	mov	DWORD PTR -80[rbp], esi
	call	POLY1305_ctx@PLT
	mov	esi, DWORD PTR -80[rbp]
	mov	edi, eax
	call	Poly1305_Init@PLT
	mov	rax, QWORD PTR 56[r12]
	cmp	QWORD PTR NO_TLS_PAYLOAD_LENGTH[rip], r14
	mov	DWORD PTR [rax], 1
	mov	QWORD PTR 64[r12], 0
	mov	QWORD PTR 48[r12], 0
	mov	DWORD PTR 8[r12], 1
	jne	.L54
.L3:
	test	rbx, rbx
	je	.L29
	test	r15, r15
	je	.L55
	mov	edx, DWORD PTR 24[r12]
	test	edx, edx
	je	.L9
	mov	rcx, QWORD PTR POLY1305_BLOCK_SIZE[rip]
	movsx	rax, DWORD PTR 48[r12]
	xor	edx, edx
	div	rcx
	test	rdx, rdx
	jne	.L56
.L10:
	mov	DWORD PTR 24[r12], 0
.L9:
	mov	rax, QWORD PTR NO_TLS_PAYLOAD_LENGTH[rip]
	mov	QWORD PTR [r12], rax
	cmp	rax, r14
	je	.L30
	mov	rax, QWORD PTR POLY1305_BLOCK_SIZE[rip]
	add	rax, r14
	cmp	rax, QWORD PTR -72[rbp]
	jne	.L57
.L11:
	cmp	QWORD PTR 0[r13], 0
	je	.L12
	mov	rcx, r14
	mov	rdx, rbx
	mov	rsi, r15
	mov	rdi, r13
	call	chacha_cipher@PLT
	mov	rdi, r12
	call	POLY1305_ctx@PLT
	mov	rdx, r14
	mov	rsi, r15
	mov	edi, eax
	call	Poly1305_Update@PLT
	add	DWORD PTR 52[r12], r14d
	cmp	r14, QWORD PTR -72[rbp]
	jne	.L58
.L14:
	mov	eax, DWORD PTR -72[rbp]
.L1:
	mov	rbx, QWORD PTR -56[rbp]
	xor	rbx, QWORD PTR fs:40
	jne	.L59
	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
.L12:
	.cfi_restore_state
	mov	rdi, r12
	call	POLY1305_ctx@PLT
	mov	rdx, r14
	mov	rsi, rbx
	mov	edi, eax
	call	Poly1305_Update@PLT
	mov	rcx, r14
	mov	rdx, rbx
	mov	rsi, r15
	mov	rdi, r13
	call	chacha_cipher@PLT
	add	DWORD PTR 52[r12], r14d
	cmp	r14, QWORD PTR -72[rbp]
	je	.L14
.L58:
	mov	BYTE PTR -89[rbp], 1
	add	rbx, r14
	add	r15, r14
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L29:
	mov	BYTE PTR -89[rbp], 0
.L7:
	mov	r8, QWORD PTR POLY1305_BLOCK_SIZE[rip]
	mov	rcx, rsp
	mov	QWORD PTR -88[rbp], rsp
	lea	rax, 15[r8]
	mov	rdx, rax
	and	rax, -4096
	sub	rcx, rax
	and	rdx, -16
	mov	rax, rcx
	cmp	rsp, rax
	je	.L16
.L60:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L60
.L16:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	je	.L17
	or	QWORD PTR -8[rsp+rdx], 0
.L17:
	mov	eax, DWORD PTR 24[r12]
	mov	QWORD PTR -104[rbp], rsp
	test	eax, eax
	je	.L18
	movsx	rax, DWORD PTR 48[r12]
	xor	edx, edx
	div	r8
	test	rdx, rdx
	jne	.L61
.L19:
	mov	DWORD PTR 24[r12], 0
.L18:
	movsx	rax, DWORD PTR 52[r12]
	xor	edx, edx
	div	r8
	test	rdx, rdx
	jne	.L62
.L20:
	mov	rdi, r12
	mov	QWORD PTR -80[rbp], r8
	call	POLY1305_ctx@PLT
	mov	r8, QWORD PTR -80[rbp]
	lea	rsi, 48[r12]
	mov	edi, eax
	mov	rdx, r8
	call	Poly1305_Update@PLT
	cmp	QWORD PTR 0[r13], 0
	mov	rsi, QWORD PTR -104[rbp]
	je	.L21
	mov	rsi, QWORD PTR 32[r12]
.L21:
	mov	rdi, r12
	mov	QWORD PTR -80[rbp], rsi
	call	POLY1305_ctx@PLT
	mov	rsi, QWORD PTR -80[rbp]
	mov	edi, eax
	call	Poly1305_Final@PLT
	cmp	BYTE PTR -89[rbp], 0
	mov	DWORD PTR 8[r12], 0
	je	.L22
	cmp	QWORD PTR 0[r13], 0
	mov	rdx, QWORD PTR POLY1305_BLOCK_SIZE[rip]
	je	.L23
	mov	rsi, QWORD PTR 32[r12]
	mov	rdi, r15
	call	memcpy@PLT
.L24:
	mov	rsp, QWORD PTR -88[rbp]
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L30:
	mov	r14, QWORD PTR -72[rbp]
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L54:
	mov	rdx, QWORD PTR EVP_AEAD_TLS1_AAD_LEN[rip]
	mov	rsi, QWORD PTR 16[r12]
	mov	rdi, r12
	mov	QWORD PTR -88[rbp], rdx
	mov	QWORD PTR -80[rbp], rsi
	call	POLY1305_ctx@PLT
	mov	rdx, QWORD PTR -88[rbp]
	mov	rsi, QWORD PTR -80[rbp]
	mov	edi, eax
	call	Poly1305_Update@PLT
	mov	rax, QWORD PTR EVP_AEAD_TLS1_AAD_LEN[rip]
	mov	DWORD PTR 24[r12], 1
	mov	DWORD PTR 48[r12], eax
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L53:
	mov	rcx, QWORD PTR -72[rbp]
	mov	rdx, rbx
	mov	rsi, r15
	mov	rdi, r13
	call	chacha20_poly1305_tls_cipher@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L56:
	mov	rsi, QWORD PTR zero[rip]
	sub	rcx, rdx
	mov	rdi, r12
	mov	QWORD PTR -88[rbp], rcx
	mov	QWORD PTR -80[rbp], rsi
	call	POLY1305_ctx@PLT
	mov	rdx, QWORD PTR -88[rbp]
	mov	rsi, QWORD PTR -80[rbp]
	mov	edi, eax
	call	Poly1305_Update@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L22:
	cmp	QWORD PTR 0[r13], 0
	jne	.L24
	mov	rdx, QWORD PTR 40[r12]
	mov	rsi, QWORD PTR 32[r12]
	mov	rdi, QWORD PTR -104[rbp]
	call	CRYPTO_memcmp@PLT
	test	rax, rax
	je	.L24
.L26:
	mov	eax, -1
	mov	rsp, QWORD PTR -88[rbp]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L62:
	mov	rsi, QWORD PTR zero[rip]
	sub	r8, rdx
	mov	rdi, r12
	mov	QWORD PTR -112[rbp], r8
	mov	QWORD PTR -80[rbp], rsi
	call	POLY1305_ctx@PLT
	mov	rdx, QWORD PTR -112[rbp]
	mov	rsi, QWORD PTR -80[rbp]
	mov	edi, eax
	call	Poly1305_Update@PLT
	mov	r8, QWORD PTR POLY1305_BLOCK_SIZE[rip]
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L23:
	mov	rdi, QWORD PTR -104[rbp]
	mov	rsi, rbx
	call	CRYPTO_memcmp@PLT
	test	rax, rax
	je	.L24
	mov	rdi, r15
	mov	rdx, r14
	xor	esi, esi
	sub	rdi, r14
	call	memset@PLT
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L61:
	mov	rsi, QWORD PTR zero[rip]
	sub	r8, rdx
	mov	rdi, r12
	mov	QWORD PTR -112[rbp], r8
	mov	QWORD PTR -80[rbp], rsi
	call	POLY1305_ctx@PLT
	mov	rdx, QWORD PTR -112[rbp]
	mov	rsi, QWORD PTR -80[rbp]
	mov	edi, eax
	call	Poly1305_Update@PLT
	mov	r8, QWORD PTR POLY1305_BLOCK_SIZE[rip]
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L55:
	mov	rdi, r12
	call	POLY1305_ctx@PLT
	mov	r15, QWORD PTR -72[rbp]
	mov	rsi, rbx
	mov	edi, eax
	mov	rdx, r15
	call	Poly1305_Update@PLT
	add	DWORD PTR 48[r12], r15d
	mov	eax, r15d
	mov	DWORD PTR 24[r12], 1
	jmp	.L1
.L57:
	mov	eax, -1
	jmp	.L1
.L59:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	chacha20_poly1305_cipher, .-chacha20_poly1305_cipher
	.comm	zero,8,8
	.comm	POLY1305_BLOCK_SIZE,8,8
	.comm	NO_TLS_PAYLOAD_LENGTH,8,8
	.comm	EVP_AEAD_TLS1_AAD_LEN,8,8
	.comm	CHACHA_BLK_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_e_chacha20_poly1305.c_chacha20_poly1305_cipher.c"
	.text
	.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	chacha20_poly1305_cipher, %function
chacha20_poly1305_cipher:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #36
	str	r3, [fp, #-48]
	ldr	r3, .L57
	mov	r5, r1
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	mov	r7, r2
	mov	r8, r0
	bl	aead_data
	ldr	r3, [r0, #4]
	mov	r4, r0
	cmp	r3, #0
	ldr	r6, [r0]
	bne	.L3
	ldr	r10, .L57+4
	ldr	r9, [r10]
	cmp	r9, r6
	cmpne	r5, #0
	movne	r9, #1
	moveq	r9, #0
	bne	.L47
	ldr	ip, [r0, #32]
	ldr	r2, .L57+8
	ldr	r1, .L57+12
	str	r9, [ip]
	ldr	r3, [r0, #44]
	ldr	r2, [r2]
	ldr	r1, [r1]
	ldr	r0, [r0, #40]
	str	ip, [sp]
	bl	ChaCha20_ctr32
	mov	r0, r4
	bl	POLY1305_ctx
	ldr	r1, [r4, #40]
	bl	Poly1305_Init
	ldr	r2, [r10]
	mov	r10, #1
	ldr	r3, [r4, #32]
	cmp	r2, r6
	str	r10, [r3]
	str	r10, [r4, #4]
	str	r9, [r4, #36]
	str	r9, [r4, #28]
	str	r9, [r4, #24]
	bne	.L48
.L3:
	cmp	r7, #0
	beq	.L26
	cmp	r5, #0
	beq	.L49
	ldr	r3, [r4, #12]
	cmp	r3, #0
	beq	.L9
	ldr	r9, .L57+16
	ldr	r0, [r4, #24]
	ldr	r1, [r9]
	bl	__aeabi_uidivmod
	subs	r10, r1, #0
	bne	.L50
.L10:
	mov	r3, #0
	str	r3, [r4, #12]
.L9:
	ldr	r3, .L57+4
	ldr	r3, [r3]
	cmp	r3, r6
	str	r3, [r4]
	beq	.L27
	ldr	r3, .L57+16
	ldr	r2, [fp, #-48]
	ldr	r3, [r3]
	add	r3, r6, r3
	cmp	r3, r2
	bne	.L51
.L11:
	ldr	r3, [r8]
	cmp	r3, #0
	beq	.L12
	mov	r3, r6
	mov	r2, r7
	mov	r1, r5
	mov	r0, r8
	bl	chacha_cipher
	mov	r0, r4
	bl	POLY1305_ctx
	mov	r2, r6
	mov	r1, r5
	bl	Poly1305_Update
	ldr	r3, [r4, #28]
	add	r3, r3, r6
	str	r3, [r4, #28]
	ldr	r3, [fp, #-48]
	cmp	r6, r3
	bne	.L52
.L14:
	ldr	r0, [fp, #-48]
.L1:
	ldr	r3, .L57
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L53
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L12:
	mov	r0, r4
	bl	POLY1305_ctx
	mov	r2, r6
	mov	r1, r7
	bl	Poly1305_Update
	mov	r3, r6
	mov	r2, r7
	mov	r1, r5
	mov	r0, r8
	bl	chacha_cipher
	ldr	r3, [r4, #28]
	add	r3, r3, r6
	str	r3, [r4, #28]
	ldr	r3, [fp, #-48]
	cmp	r6, r3
	beq	.L14
.L52:
	mov	r3, #1
	add	r7, r7, r6
	add	r5, r5, r6
	str	r3, [fp, #-52]
	b	.L7
.L26:
	str	r7, [fp, #-52]
.L7:
	ldr	r9, .L57+16
	ldr	r1, [r4, #12]
	ldr	r2, [r9]
	mov	r10, sp
	add	r3, r2, #7
	bic	r3, r3, #7
	sub	sp, sp, r3
	add	r3, sp, #8
	cmp	r1, #0
	str	r3, [fp, #-56]
	beq	.L15
	mov	r1, r2
	ldr	r0, [r4, #24]
	str	r2, [fp, #-60]
	bl	__aeabi_uidivmod
	cmp	r1, #0
	ldr	r2, [fp, #-60]
	bne	.L54
.L16:
	mov	r3, #0
	str	r3, [r4, #12]
.L15:
	mov	r1, r2
	ldr	r0, [r4, #28]
	bl	__aeabi_uidivmod
	cmp	r1, #0
	bne	.L55
.L17:
	mov	r0, r4
	bl	POLY1305_ctx
	add	r1, r4, #24
	ldr	r2, [r9]
	bl	Poly1305_Update
	mov	r0, r4
	bl	POLY1305_ctx
	ldr	r3, [r8]
	cmp	r3, #0
	ldrne	r1, [r4, #16]
	ldreq	r1, [fp, #-56]
	bl	Poly1305_Final
	mov	r3, #0
	ldr	r2, [fp, #-52]
	str	r3, [r4, #4]
	cmp	r2, r3
	beq	.L19
	ldr	r8, [r8]
	ldr	r2, [r9]
	cmp	r8, r3
	beq	.L20
	mov	r0, r5
	ldr	r1, [r4, #16]
	bl	memcpy
	b	.L21
.L19:
	ldr	r3, [r8]
	cmp	r3, #0
	beq	.L56
.L21:
	mov	sp, r10
	b	.L14
.L27:
	ldr	r6, [fp, #-48]
	b	.L11
.L48:
	ldr	r9, .L57+20
	mov	r0, r4
	bl	POLY1305_ctx
	ldr	r2, [r9]
	ldr	r1, [r4, #8]
	bl	Poly1305_Update
	ldr	r3, [r9]
	str	r10, [r4, #12]
	str	r3, [r4, #24]
	b	.L3
.L47:
	mov	r2, r7
	mov	r1, r5
	mov	r0, r8
	ldr	r3, [fp, #-48]
	bl	chacha20_poly1305_tls_cipher
	b	.L1
.L50:
	mov	r0, r4
	bl	POLY1305_ctx
	ldr	r2, [r9]
	ldr	r3, .L57+12
	sub	r2, r2, r10
	ldr	r1, [r3]
	bl	Poly1305_Update
	b	.L10
.L55:
	mov	r0, r4
	str	r1, [fp, #-60]
	bl	POLY1305_ctx
	ldr	r1, [fp, #-60]
	ldr	r2, [r9]
	ldr	r3, .L57+12
	sub	r2, r2, r1
	ldr	r1, [r3]
	bl	Poly1305_Update
	b	.L17
.L20:
	mov	r1, r7
	ldr	r0, [fp, #-56]
	bl	CRYPTO_memcmp
	cmp	r0, #0
	beq	.L21
	mov	r1, r8
	mov	r2, r6
	sub	r0, r5, r6
	bl	memset
.L23:
	mvn	r0, #0
	mov	sp, r10
	b	.L1
.L54:
	mov	r0, r4
	str	r1, [fp, #-60]
	bl	POLY1305_ctx
	ldr	r1, [fp, #-60]
	ldr	r2, [r9]
	ldr	r3, .L57+12
	sub	r2, r2, r1
	ldr	r1, [r3]
	bl	Poly1305_Update
	ldr	r2, [r9]
	b	.L16
.L56:
	ldr	r0, [fp, #-56]
	ldr	r2, [r4, #20]
	ldr	r1, [r4, #16]
	bl	CRYPTO_memcmp
	cmp	r0, #0
	beq	.L21
	b	.L23
.L49:
	mov	r0, r4
	bl	POLY1305_ctx
	ldr	r5, [fp, #-48]
	mov	r1, r7
	mov	r2, r5
	bl	Poly1305_Update
	mov	r2, #1
	ldr	r3, [r4, #24]
	mov	r0, r5
	add	r3, r3, r5
	str	r3, [r4, #24]
	str	r2, [r4, #12]
	b	.L1
.L51:
	mvn	r0, #0
	b	.L1
.L53:
	bl	__stack_chk_fail
.L58:
	.align	2
.L57:
	.word	.LC0
	.word	NO_TLS_PAYLOAD_LENGTH
	.word	CHACHA_BLK_SIZE
	.word	zero
	.word	POLY1305_BLOCK_SIZE
	.word	EVP_AEAD_TLS1_AAD_LEN
	.size	chacha20_poly1305_cipher, .-chacha20_poly1305_cipher
	.comm	zero,4,4
	.comm	POLY1305_BLOCK_SIZE,4,4
	.comm	NO_TLS_PAYLOAD_LENGTH,4,4
	.comm	EVP_AEAD_TLS1_AAD_LEN,4,4
	.comm	CHACHA_BLK_SIZE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
