	.file	"extr_t_conf.c_BN_mod_exp_mont.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	BN_mod_exp_mont
	.type	BN_mod_exp_mont, @function
BN_mod_exp_mont:
.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
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	mov	r14, rsi
	push	r13
	.cfi_offset 13, -40
	mov	r13, rcx
	push	r12
	.cfi_offset 12, -48
	mov	r12, r8
	push	rbx
	.cfi_offset 3, -56
	mov	rbx, rdx
	sub	rsp, 120
	mov	QWORD PTR -80[rbp], rdi
	mov	QWORD PTR -72[rbp], r9
	mov	rcx, rsp
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	movsx	rax, DWORD PTR TABLE_SIZE[rip]
	lea	rax, 15[0+rax*8]
	mov	rdx, rax
	and	rax, -4096
	sub	rcx, rax
	and	rdx, -16
	mov	rax, rcx
	cmp	rsp, rax
	je	.L3
.L80:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L80
.L3:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L81
.L4:
	mov	rdi, r14
	mov	QWORD PTR -88[rbp], rsp
	call	bn_check_top@PLT
	mov	rdi, rbx
	call	bn_check_top@PLT
	mov	rdi, r13
	call	bn_check_top@PLT
	mov	rax, QWORD PTR 0[r13]
	mov	eax, DWORD PTR [rax]
	and	eax, 1
	mov	r15d, eax
	jne	.L82
.L1:
	mov	rax, QWORD PTR -56[rbp]
	xor	rax, QWORD PTR fs:40
	jne	.L83
	lea	rsp, -40[rbp]
	mov	eax, r15d
	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
.L82:
	.cfi_restore_state
	mov	rdi, rbx
	call	BN_num_bits@PLT
	mov	DWORD PTR -112[rbp], eax
	test	eax, eax
	je	.L84
	mov	rdi, r12
	call	BN_CTX_start@PLT
	mov	rdi, r12
	call	BN_CTX_get@PLT
	mov	rdi, r12
	mov	QWORD PTR -96[rbp], rax
	call	BN_CTX_get@PLT
	cmp	QWORD PTR -96[rbp], 0
	mov	QWORD PTR -120[rbp], rax
	je	.L77
	test	rax, rax
	je	.L77
	mov	rax, QWORD PTR -72[rbp]
	mov	QWORD PTR -104[rbp], rax
	test	rax, rax
	je	.L85
.L9:
	mov	rdi, QWORD PTR -88[rbp]
	call	BN_init@PLT
	mov	rsi, r13
	mov	rdi, r14
	call	BN_ucmp@PLT
	test	rax, rax
	js	.L11
	mov	rsi, r14
	mov	r14, QWORD PTR -88[rbp]
	mov	rcx, r12
	mov	rdx, r13
	mov	rdi, r14
	call	BN_mod@PLT
	test	eax, eax
	je	.L86
.L11:
	mov	rsi, r14
	mov	r13, QWORD PTR -104[rbp]
	mov	r14, QWORD PTR -88[rbp]
	mov	rcx, r12
	mov	rdx, r13
	mov	rdi, r14
	call	BN_to_montgomery@PLT
	lea	rsi, 8[r14]
	mov	QWORD PTR -128[rbp], rsi
	test	eax, eax
	je	.L13
	mov	edi, DWORD PTR -112[rbp]
	call	BN_window_bits_for_exponent_size@PLT
	mov	DWORD PTR -132[rbp], eax
	cmp	eax, 1
	jle	.L14
	mov	rdi, QWORD PTR -96[rbp]
	mov	r8, r12
	mov	rcx, r13
	mov	rdx, r14
	mov	rsi, r14
	mov	QWORD PTR -104[rbp], r13
	call	BN_mod_mul_montgomery@PLT
	test	eax, eax
	je	.L13
	mov	eax, DWORD PTR -132[rbp]
	lea	ecx, -1[rax]
	mov	eax, 1
	sal	eax, cl
	mov	DWORD PTR -108[rbp], eax
	cmp	eax, 1
	jle	.L14
	mov	r13, QWORD PTR -128[rbp]
	mov	DWORD PTR -136[rbp], r15d
	mov	r14, r13
	mov	r13, QWORD PTR -96[rbp]
	mov	QWORD PTR -96[rbp], rbx
	mov	rbx, QWORD PTR -104[rbp]
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L88:
	add	r15d, 1
	add	r14, 8
	cmp	DWORD PTR -108[rbp], r15d
	je	.L87
.L15:
	mov	rdi, r14
	call	BN_init@PLT
	lea	rsi, -8[r14]
	mov	r8, r12
	mov	rcx, rbx
	mov	rdx, r13
	mov	rdi, r14
	call	BN_mod_mul_montgomery@PLT
	test	eax, eax
	jne	.L88
	mov	r15d, DWORD PTR -136[rbp]
	.p2align 4,,10
	.p2align 3
.L13:
	mov	DWORD PTR -108[rbp], r15d
	xor	r15d, r15d
.L12:
	cmp	QWORD PTR -72[rbp], 0
	jne	.L33
	mov	rdi, QWORD PTR -104[rbp]
	call	BN_MONT_CTX_free@PLT
.L33:
	mov	rdi, r12
	call	BN_CTX_end@PLT
	mov	eax, DWORD PTR -108[rbp]
	mov	rsi, QWORD PTR -128[rbp]
	mov	rbx, QWORD PTR -88[rbp]
	sub	eax, 1
	lea	r12, [rsi+rax*8]
	.p2align 4,,10
	.p2align 3
.L34:
	mov	rdi, rbx
	add	rbx, 8
	call	BN_clear_free@PLT
	cmp	r12, rbx
	jne	.L34
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L81:
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L85:
	call	BN_MONT_CTX_new@PLT
	mov	QWORD PTR -104[rbp], rax
	test	rax, rax
	je	.L77
	mov	rdx, r12
	mov	rsi, r13
	mov	rdi, rax
	call	BN_MONT_CTX_set@PLT
	test	eax, eax
	jne	.L9
	mov	rdi, QWORD PTR -104[rbp]
	call	BN_MONT_CTX_free@PLT
	.p2align 4,,10
	.p2align 3
.L77:
	mov	rdi, r12
	xor	r15d, r15d
	call	BN_CTX_end@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L84:
	mov	rdi, QWORD PTR -80[rbp]
	call	BN_one@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L14:
	mov	rax, QWORD PTR -88[rbp]
	mov	DWORD PTR -108[rbp], r15d
	add	rax, 8
	mov	QWORD PTR -128[rbp], rax
.L16:
	xor	eax, eax
	call	BN_value_one@PLT
	mov	rdx, QWORD PTR -104[rbp]
	mov	rdi, QWORD PTR -120[rbp]
	mov	rcx, r12
	mov	rsi, rax
	call	BN_to_montgomery@PLT
	test	eax, eax
	je	.L43
	mov	eax, 1
	sub	eax, DWORD PTR -132[rbp]
	mov	r14d, DWORD PTR -112[rbp]
	mov	DWORD PTR -136[rbp], r15d
	mov	DWORD PTR -144[rbp], eax
	mov	DWORD PTR -140[rbp], r15d
	sub	r14d, 1
.L17:
	mov	esi, r14d
	mov	rdi, rbx
	call	BN_is_bit_set@PLT
	test	rax, rax
	jne	.L89
	mov	edx, DWORD PTR -136[rbp]
	test	edx, edx
	je	.L24
.L27:
	test	r14d, r14d
	jne	.L90
.L25:
	mov	rdx, QWORD PTR -104[rbp]
	mov	rsi, QWORD PTR -120[rbp]
	mov	rcx, r12
	xor	r15d, r15d
	mov	rdi, QWORD PTR -80[rbp]
	call	BN_from_montgomery@PLT
	test	eax, eax
	setne	r15b
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L86:
	mov	rax, QWORD PTR -88[rbp]
	add	rax, 8
	mov	QWORD PTR -128[rbp], rax
	jmp	.L13
.L24:
	mov	rsi, QWORD PTR -120[rbp]
	mov	rcx, QWORD PTR -104[rbp]
	mov	r8, r12
	mov	rdx, rsi
	mov	rdi, rsi
	call	BN_mod_mul_montgomery@PLT
	test	eax, eax
	jne	.L27
.L43:
	xor	r15d, r15d
	jmp	.L12
.L89:
	cmp	DWORD PTR -132[rbp], 1
	jle	.L22
	mov	r13d, r14d
	sub	r13d, 1
	js	.L22
	mov	eax, DWORD PTR -144[rbp]
	mov	QWORD PTR -152[rbp], r12
	xor	r15d, r15d
	add	eax, r14d
	mov	DWORD PTR -112[rbp], eax
	mov	eax, DWORD PTR -140[rbp]
	mov	DWORD PTR -96[rbp], eax
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L31:
	sub	r13d, 1
	cmp	r13d, -1
	je	.L29
.L23:
	mov	r12d, r14d
	mov	esi, r13d
	mov	rdi, rbx
	sub	r12d, r13d
	call	BN_is_bit_set@PLT
	test	rax, rax
	je	.L30
	mov	eax, DWORD PTR -96[rbp]
	mov	ecx, r12d
	sub	ecx, r15d
	mov	r15d, r12d
	sal	eax, cl
	or	eax, 1
	mov	DWORD PTR -96[rbp], eax
.L30:
	cmp	DWORD PTR -112[rbp], r13d
	jne	.L31
.L29:
	mov	eax, DWORD PTR -136[rbp]
	mov	DWORD PTR -112[rbp], r15d
	mov	r12, QWORD PTR -152[rbp]
	test	eax, eax
	je	.L91
.L21:
	mov	eax, DWORD PTR -96[rbp]
	mov	rsi, QWORD PTR -88[rbp]
	mov	r8, r12
	mov	rcx, QWORD PTR -104[rbp]
	sar	eax
	cdqe
	lea	rdx, [rsi+rax*8]
	mov	rsi, QWORD PTR -120[rbp]
	mov	rdi, rsi
	call	BN_mod_mul_montgomery@PLT
	test	eax, eax
	je	.L43
	mov	eax, DWORD PTR -112[rbp]
	add	eax, 1
	sub	r14d, eax
	js	.L25
	mov	DWORD PTR -136[rbp], 0
	jmp	.L17
.L87:
	mov	r15d, DWORD PTR -136[rbp]
	mov	rbx, QWORD PTR -96[rbp]
	jmp	.L16
.L90:
	sub	r14d, 1
	jmp	.L17
.L91:
	test	r15d, r15d
	js	.L21
.L20:
	mov	DWORD PTR -136[rbp], r14d
	mov	r15, QWORD PTR -120[rbp]
	mov	r14, r12
	xor	r13d, r13d
	mov	QWORD PTR -152[rbp], rbx
	mov	r12d, DWORD PTR -112[rbp]
	mov	rbx, QWORD PTR -104[rbp]
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L93:
	add	r13d, 1
	cmp	r13d, r12d
	jg	.L92
.L32:
	mov	r8, r14
	mov	rcx, rbx
	mov	rdx, r15
	mov	rsi, r15
	mov	rdi, r15
	call	BN_mod_mul_montgomery@PLT
	test	eax, eax
	jne	.L93
	mov	r12, r14
	xor	r15d, r15d
	jmp	.L12
.L92:
	mov	r12, r14
	mov	rbx, QWORD PTR -152[rbp]
	mov	r14d, DWORD PTR -136[rbp]
	jmp	.L21
.L22:
	mov	eax, DWORD PTR -136[rbp]
	test	eax, eax
	je	.L40
	mov	DWORD PTR -96[rbp], eax
	mov	DWORD PTR -112[rbp], 0
	jmp	.L21
.L40:
	mov	eax, DWORD PTR -140[rbp]
	mov	DWORD PTR -112[rbp], 0
	mov	DWORD PTR -96[rbp], eax
	jmp	.L20
.L83:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	BN_mod_exp_mont, .-BN_mod_exp_mont
	.comm	TABLE_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_t_conf.c_BN_mod_exp_mont.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	BN_mod_exp_mont
	.syntax unified
	.arm
	.fpu softvfp
	.type	BN_mod_exp_mont, %function
BN_mod_exp_mont:
	@ args = 8, pretend = 0, frame = 56
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #68
	mov	r7, r1
	mov	r1, r0
	mov	r6, r2
	mov	r5, r3
	ldr	r3, .L84
	str	r1, [fp, #-52]
	ldr	r3, [r3]
	mov	r0, r7
	lsl	r3, r3, #2
	add	r3, r3, #7
	bic	r3, r3, #7
	sub	sp, sp, r3
	ldr	r3, .L84+4
	ldr	r8, [fp, #4]
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	ldr	r3, [fp, #8]
	str	r3, [fp, #-48]
	bl	bn_check_top
	mov	r0, r6
	bl	bn_check_top
	mov	r0, r5
	bl	bn_check_top
	ldr	r3, [r5]
	ldr	r4, [r3]
	ands	r4, r4, #1
	bne	.L72
.L1:
	ldr	r3, .L84+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L73
	mov	r0, r4
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L72:
	mov	r0, r6
	bl	BN_num_bits
	subs	r3, r0, #0
	str	r3, [fp, #-60]
	beq	.L74
	mov	r0, r8
	bl	BN_CTX_start
	mov	r0, r8
	bl	BN_CTX_get
	mov	r10, r0
	mov	r0, r8
	bl	BN_CTX_get
	cmp	r0, #0
	cmpne	r10, #0
	str	r0, [fp, #-64]
	beq	.L6
	ldr	r3, [fp, #-48]
	add	r9, sp, #8
	cmp	r3, #0
	beq	.L75
	ldr	r3, [fp, #-48]
	str	r3, [fp, #-56]
.L5:
	mov	r0, r9
	bl	BN_init
	mov	r1, r5
	mov	r0, r7
	bl	BN_ucmp
	cmp	r0, #0
	blt	.L7
	mov	r1, r7
	mov	r2, r5
	mov	r3, r8
	mov	r0, r9
	bl	BN_mod
	cmp	r0, #0
	movne	r7, r9
	beq	.L9
.L7:
	ldr	r5, [fp, #-56]
	mov	r1, r7
	mov	r3, r8
	mov	r2, r5
	mov	r0, r9
	bl	BN_to_montgomery
	cmp	r0, #0
	beq	.L9
	ldr	r0, [fp, #-60]
	bl	BN_window_bits_for_exponent_size
	cmp	r0, #1
	mov	r7, r0
	str	r0, [fp, #-72]
	ble	.L10
	mov	r3, r5
	mov	r2, r9
	mov	r1, r9
	mov	r0, r10
	str	r8, [sp]
	str	r5, [fp, #-56]
	bl	BN_mod_mul_montgomery
	cmp	r0, #0
	beq	.L9
	mov	r2, #1
	sub	r3, r7, #1
	lsl	r2, r2, r3
	cmp	r2, #1
	str	r2, [fp, #-68]
	ble	.L10
	add	r5, r9, #4
	str	r9, [fp, #-76]
	str	r6, [fp, #-80]
	mov	r7, r4
	mov	r9, r2
	ldr	r6, [fp, #-56]
	b	.L11
.L77:
	add	r7, r7, #1
	cmp	r9, r7
	add	r5, r5, #4
	beq	.L76
.L11:
	mov	r0, r5
	bl	BN_init
	mov	r3, r6
	mov	r2, r10
	mov	r0, r5
	str	r8, [sp]
	sub	r1, r5, #4
	bl	BN_mod_mul_montgomery
	cmp	r0, #0
	bne	.L77
	ldr	r9, [fp, #-76]
.L9:
	str	r4, [fp, #-68]
.L70:
	mov	r4, #0
.L8:
	ldr	r3, [fp, #-48]
	cmp	r3, #0
	bne	.L29
	ldr	r0, [fp, #-56]
	bl	BN_MONT_CTX_free
.L29:
	mov	r5, r9
	mov	r0, r8
	bl	BN_CTX_end
	ldr	r3, [fp, #-68]
	add	r6, r9, r3, lsl #2
.L30:
	mov	r0, r5
	add	r5, r5, #4
	bl	BN_clear_free
	cmp	r6, r5
	bne	.L30
	b	.L1
.L75:
	bl	BN_MONT_CTX_new
	subs	r3, r0, #0
	str	r3, [fp, #-56]
	beq	.L6
	mov	r2, r8
	mov	r1, r5
	bl	BN_MONT_CTX_set
	subs	r3, r0, #0
	bne	.L5
	ldr	r0, [fp, #-56]
	str	r3, [fp, #-48]
	bl	BN_MONT_CTX_free
	mov	r0, r8
	bl	BN_CTX_end
	ldr	r3, [fp, #-48]
	mov	r4, r3
	b	.L1
.L6:
	mov	r0, r8
	bl	BN_CTX_end
	mov	r4, #0
	b	.L1
.L74:
	ldr	r0, [fp, #-52]
	bl	BN_one
	b	.L1
.L10:
	str	r4, [fp, #-68]
.L12:
	bl	BN_value_one
	ldr	r7, [fp, #-64]
	mov	r1, r0
	mov	r3, r8
	mov	r0, r7
	ldr	r2, [fp, #-56]
	bl	BN_to_montgomery
	cmp	r0, #0
	beq	.L70
	ldr	r3, [fp, #-60]
	str	r4, [fp, #-76]
	sub	r10, r3, #1
	ldr	r3, [fp, #-72]
	str	r9, [fp, #-60]
	rsb	r3, r3, #1
	str	r3, [fp, #-84]
	str	r4, [fp, #-80]
.L13:
	mov	r1, r10
	mov	r0, r6
	bl	BN_is_bit_set
	cmp	r0, #0
	bne	.L78
	ldr	r3, [fp, #-76]
	cmp	r3, #0
	beq	.L20
.L23:
	cmp	r10, #0
	bne	.L79
.L21:
	mov	r3, r8
	ldr	r1, [fp, #-64]
	ldr	r0, [fp, #-52]
	ldr	r2, [fp, #-56]
	ldr	r9, [fp, #-60]
	bl	BN_from_montgomery
	subs	r4, r0, #0
	movne	r4, #1
	b	.L8
.L78:
	ldr	r3, [fp, #-72]
	cmp	r3, #1
	ble	.L80
	subs	r9, r10, #1
	bmi	.L18
	ldr	r3, [fp, #-84]
	ldr	r4, [fp, #-80]
	add	r3, r3, r10
	str	r7, [fp, #-88]
	mov	r5, #0
	mov	r7, r6
	mov	r6, r4
	mov	r4, r3
	b	.L19
.L27:
	subs	r9, r9, #1
	bcc	.L25
.L19:
	mov	r1, r9
	mov	r0, r7
	bl	BN_is_bit_set
	sub	r1, r10, r9
	cmp	r0, #0
	subne	r3, r1, r5
	lslne	r3, r6, r3
	movne	r5, r1
	orrne	r6, r3, #1
	cmp	r9, r4
	bne	.L27
.L25:
	ldr	r3, [fp, #-76]
	mov	r4, r6
	cmp	r3, #0
	mov	r6, r7
	ldr	r7, [fp, #-88]
	beq	.L81
.L17:
	ldr	r3, [fp, #-60]
	asr	r2, r4, #1
	add	r2, r3, r2, lsl #2
	mov	r1, r7
	mov	r0, r7
	ldr	r3, [fp, #-56]
	str	r8, [sp]
	bl	BN_mod_mul_montgomery
	cmp	r0, #0
	beq	.L39
	add	r5, r5, #1
	subs	r10, r10, r5
	bmi	.L21
	mov	r3, #0
	str	r3, [fp, #-76]
	b	.L13
.L76:
	ldr	r9, [fp, #-76]
	ldr	r6, [fp, #-80]
	b	.L12
.L79:
	sub	r10, r10, #1
	b	.L13
.L20:
	mov	r2, r7
	mov	r1, r7
	mov	r0, r7
	ldr	r3, [fp, #-56]
	str	r8, [sp]
	bl	BN_mod_mul_montgomery
	cmp	r0, #0
	bne	.L23
	ldr	r9, [fp, #-60]
	ldr	r4, [fp, #-76]
	b	.L8
.L81:
	cmp	r5, #0
	blt	.L17
.L16:
	mov	r3, r6
	str	r4, [fp, #-76]
	mov	r6, r7
	mov	r9, #0
	mov	r7, r3
	ldr	r4, [fp, #-56]
	b	.L28
.L83:
	add	r9, r9, #1
	cmp	r9, r5
	bgt	.L82
.L28:
	mov	r3, r4
	mov	r2, r6
	mov	r1, r6
	mov	r0, r6
	str	r8, [sp]
	bl	BN_mod_mul_montgomery
	cmp	r0, #0
	bne	.L83
.L39:
	mov	r4, r0
	ldr	r9, [fp, #-60]
	b	.L8
.L82:
	mov	r3, r7
	ldr	r4, [fp, #-76]
	mov	r7, r6
	mov	r6, r3
	b	.L17
.L80:
	ldr	r3, [fp, #-76]
	cmp	r3, #0
	movne	r4, r3
	movne	r5, #0
	bne	.L17
.L36:
	ldr	r5, [fp, #-76]
	ldr	r4, [fp, #-80]
	b	.L16
.L18:
	ldr	r4, [fp, #-76]
	cmp	r4, #0
	movne	r5, #0
	bne	.L17
	b	.L36
.L73:
	bl	__stack_chk_fail
.L85:
	.align	2
.L84:
	.word	TABLE_SIZE
	.word	.LC0
	.size	BN_mod_exp_mont, .-BN_mod_exp_mont
	.comm	TABLE_SIZE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
