	.file	"extr_bn_mont.c_BN_MONT_CTX_set_locked.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	BN_MONT_CTX_set_locked
	.type	BN_MONT_CTX_set_locked, @function
BN_MONT_CTX_set_locked:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rdx
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rcx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdi
	mov	rdi, rsi
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	call	CRYPTO_THREAD_read_lock@PLT
	mov	r12, QWORD PTR [rbx]
	mov	rdi, rbp
	call	CRYPTO_THREAD_unlock@PLT
	test	r12, r12
	je	.L10
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rax, r12
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	xor	eax, eax
	call	BN_MONT_CTX_new@PLT
	mov	r15, rax
	test	rax, rax
	je	.L1
	mov	rdx, r13
	mov	rsi, r14
	mov	rdi, rax
	call	BN_MONT_CTX_set@PLT
	test	eax, eax
	je	.L11
	mov	rdi, rbp
	call	CRYPTO_THREAD_write_lock@PLT
	cmp	QWORD PTR [rbx], 0
	je	.L4
	mov	rdi, r15
	call	BN_MONT_CTX_free@PLT
	mov	r12, QWORD PTR [rbx]
.L5:
	mov	rdi, rbp
	call	CRYPTO_THREAD_unlock@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L4:
	mov	QWORD PTR [rbx], r15
	mov	r12, r15
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L11:
	mov	rdi, r15
	call	BN_MONT_CTX_free@PLT
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	BN_MONT_CTX_set_locked, .-BN_MONT_CTX_set_locked
	.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_bn_mont.c_BN_MONT_CTX_set_locked.c"
	.text
	.align	2
	.global	BN_MONT_CTX_set_locked
	.syntax unified
	.arm
	.fpu softvfp
	.type	BN_MONT_CTX_set_locked, %function
BN_MONT_CTX_set_locked:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r5, r0
	mov	r4, r1
	mov	r0, r1
	mov	r6, r2
	mov	r7, r3
	bl	CRYPTO_THREAD_read_lock
	ldr	r8, [r5]
	mov	r0, r4
	bl	CRYPTO_THREAD_unlock
	cmp	r8, #0
	beq	.L10
.L1:
	mov	r0, r8
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L10:
	bl	BN_MONT_CTX_new
	subs	r9, r0, #0
	beq	.L1
	mov	r2, r7
	mov	r1, r6
	bl	BN_MONT_CTX_set
	cmp	r0, #0
	beq	.L11
	mov	r0, r4
	bl	CRYPTO_THREAD_write_lock
	ldr	r3, [r5]
	cmp	r3, #0
	moveq	r8, r9
	streq	r9, [r5]
	beq	.L5
	mov	r0, r9
	bl	BN_MONT_CTX_free
	ldr	r8, [r5]
.L5:
	mov	r0, r4
	bl	CRYPTO_THREAD_unlock
	mov	r0, r8
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L11:
	mov	r0, r9
	bl	BN_MONT_CTX_free
	b	.L1
	.size	BN_MONT_CTX_set_locked, .-BN_MONT_CTX_set_locked
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
