	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_BN_MONT_CTX_set                ## -- Begin function BN_MONT_CTX_set
	.p2align	4, 0x90
_BN_MONT_CTX_set:                       ## @BN_MONT_CTX_set
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r13
	movq	%rdi, %rbx
	leaq	-72(%rbp), %r15
	movq	%r15, %rdi
	callq	_BN_init
	leaq	8(%rbx), %r12
	leaq	4(%rbx), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	%r13, %rsi
	callq	_BN_copy
	movq	%r13, %rdi
	callq	_BN_num_bits
	movl	%eax, (%rbx)
	movq	%r12, %rdi
	callq	_BN_zero
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_BN_set_bit
	movq	%r15, %rdi
	movq	%r12, %rsi
	movq	%r13, %rdx
	movq	%r14, %rcx
	callq	_BN_mod_inverse
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movl	(%rbx), %edx
	leaq	-72(%rbp), %r15
	movq	%r15, %rdi
	movq	%r15, %rsi
	callq	_BN_lshift
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_BN_sub_word
	leaq	32(%rbx), %rdi
	xorl	%esi, %esi
	movq	%r15, %rdx
	movq	%r13, %rcx
	movq	%r14, %r8
	callq	_BN_div
	movq	%r15, %rdi
	callq	_BN_free
	movq	%r12, %rdi
	callq	_BN_zero
	movl	(%rbx), %esi
	addl	%esi, %esi
	movq	%r12, %rdi
	callq	_BN_set_bit
	movq	%r12, %rdi
	movq	%r12, %rsi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movq	%r14, %rcx
	callq	_BN_mod
	movl	$1, %eax
	jmp	LBB0_3
LBB0_1:
	xorl	%eax, %eax
LBB0_3:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BN_BITS2,4,2                   ## @BN_BITS2
	.comm	_BN_MASK2,4,2                   ## @BN_MASK2
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_BN_MONT_CTX_set                ; -- Begin function BN_MONT_CTX_set
	.p2align	2
_BN_MONT_CTX_set:                       ; @BN_MONT_CTX_set
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x2
	mov	x23, x1
	mov	x22, x0
	add	x0, sp, #8
	bl	_BN_init
	add	x20, x22, #8
	add	x21, x22, #4
	mov	x0, x21
	mov	x1, x23
	bl	_BN_copy
	mov	x0, x23
	bl	_BN_num_bits
	str	w0, [x22]
	mov	x0, x20
	bl	_BN_zero
	ldr	w1, [x22]
	mov	x0, x20
	bl	_BN_set_bit
	add	x0, sp, #8
	mov	x1, x20
	mov	x2, x23
	mov	x3, x19
	bl	_BN_mod_inverse
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w2, [x22]
	add	x0, sp, #8
	add	x1, sp, #8
	bl	_BN_lshift
	mov	w24, #1
	add	x0, sp, #8
	mov	w1, #1
	bl	_BN_sub_word
	add	x0, x22, #32
	add	x2, sp, #8
	mov	x1, #0
	mov	x3, x23
	mov	x4, x19
	bl	_BN_div
	add	x0, sp, #8
	bl	_BN_free
	mov	x0, x20
	bl	_BN_zero
	ldr	w8, [x22]
	lsl	w1, w8, #1
	mov	x0, x20
	bl	_BN_set_bit
	mov	x0, x20
	mov	x1, x20
	mov	x2, x21
	mov	x3, x19
	bl	_BN_mod
	b	LBB0_3
LBB0_2:
	mov	w24, #0
LBB0_3:
	mov	x0, x24
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.cfi_endproc
                                        ; -- End function
	.comm	_BN_BITS2,4,2                   ; @BN_BITS2
	.comm	_BN_MASK2,4,2                   ; @BN_MASK2
.subsections_via_symbols
