	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ec_guess_cofactor
_ec_guess_cofactor:                     ## @ec_guess_cofactor
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movl	(%rdi), %edi
	callq	_BN_num_bits
	movl	%eax, %ebx
	movl	16(%r13), %edi
	callq	_BN_num_bits
                                        ## kill: def $eax killed $eax def $rax
	movl	%eax, %ecx
	incl	%ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	incl	%eax
	sarl	%eax
	addl	$3, %eax
	cmpl	%eax, %ebx
	jle	LBB0_1
## %bb.2:
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_BN_CTX_new
	testq	%rax, %rax
	je	LBB0_13
## %bb.3:
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_BN_CTX_start
	movq	%r14, %rdi
	callq	_BN_CTX_get
	xorl	%r15d, %r15d
	testq	%rax, %rax
	je	LBB0_12
## %bb.4:
	movq	%rax, %r12
	movq	24(%r13), %rax
	movq	(%rax), %rax
	movq	_NID_X9_62_characteristic_two_field@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.5:
	movq	%r12, %rdi
	callq	_BN_zero
	movl	16(%r13), %edi
	callq	_BN_num_bits
                                        ## kill: def $eax killed $eax def $rax
	leal	-1(%rax), %esi
	movq	%r12, %rdi
	callq	_BN_set_bit
	testl	%eax, %eax
	jne	LBB0_8
	jmp	LBB0_12
LBB0_1:
	movq	8(%r13), %rdi
	callq	_BN_zero
	movl	$1, %r15d
	jmp	LBB0_13
LBB0_6:
	movl	16(%r13), %esi
	movq	%r12, %rdi
	callq	_BN_copy
	testl	%eax, %eax
	je	LBB0_12
LBB0_8:
	movq	8(%r13), %rdi
	movl	(%r13), %esi
	callq	_BN_rshift1
	testl	%eax, %eax
	je	LBB0_12
## %bb.9:
	movq	8(%r13), %rdi
	movq	%rdi, %rsi
	movq	%r12, %rdx
	callq	_BN_add
	testl	%eax, %eax
	je	LBB0_12
## %bb.10:
	movq	8(%r13), %rbx
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_BN_value_one
	movq	%rbx, %rdi
	movq	%rbx, %rsi
	movq	%rax, %rdx
	callq	_BN_add
	testl	%eax, %eax
	je	LBB0_12
## %bb.11:
	movq	8(%r13), %rdi
	movl	(%r13), %ecx
	xorl	%esi, %esi
	movq	%rdi, %rdx
	movq	%r14, %r8
	callq	_BN_div
	xorl	%r15d, %r15d
	testl	%eax, %eax
	setne	%r15b
LBB0_12:
	movq	%r14, %rdi
	callq	_BN_CTX_end
	movq	%r14, %rdi
	callq	_BN_CTX_free
LBB0_13:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NID_X9_62_characteristic_two_field,8,3 ## @NID_X9_62_characteristic_two_field
	.no_dead_strip	_ec_guess_cofactor
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ec_guess_cofactor
_ec_guess_cofactor:                     ; @ec_guess_cofactor
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x0
	ldr	w0, [x0]
	bl	_BN_num_bits
	mov	x19, x0
	ldr	w0, [x20, #16]
	bl	_BN_num_bits
	add	w8, w0, #1
	add	w9, w0, #2
	cmp	w8, #0
	csinc	w8, w9, w0, lt
	asr	w8, w8, #1
	add	w8, w8, #3
	cmp	w19, w8
	b.le	LBB0_5
; %bb.1:
	bl	_BN_CTX_new
	cbz	x0, LBB0_6
; %bb.2:
	mov	x19, x0
	bl	_BN_CTX_start
	mov	x0, x19
	bl	_BN_CTX_get
	cbz	x0, LBB0_12
; %bb.3:
	mov	x21, x0
	ldr	x8, [x20, #24]
	ldr	x8, [x8]
Lloh0:
	adrp	x9, _NID_X9_62_characteristic_two_field@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NID_X9_62_characteristic_two_field@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.4:
	mov	x0, x21
	bl	_BN_zero
	ldr	w0, [x20, #16]
	bl	_BN_num_bits
	sub	w1, w0, #1
	mov	x0, x21
	bl	_BN_set_bit
	cbnz	w0, LBB0_8
	b	LBB0_12
LBB0_5:
	ldr	x0, [x20, #8]
	bl	_BN_zero
	mov	w20, #1
	b	LBB0_14
LBB0_6:
	mov	w20, #0
	b	LBB0_14
LBB0_7:
	ldr	w1, [x20, #16]
	mov	x0, x21
	bl	_BN_copy
	cbz	w0, LBB0_12
LBB0_8:
	ldr	x0, [x20, #8]
	ldr	w1, [x20]
	bl	_BN_rshift1
	cbz	w0, LBB0_12
; %bb.9:
	ldr	x0, [x20, #8]
	mov	x1, x0
	mov	x2, x21
	bl	_BN_add
	cbz	w0, LBB0_12
; %bb.10:
	ldr	x21, [x20, #8]
	bl	_BN_value_one
	mov	x2, x0
	mov	x0, x21
	mov	x1, x21
	bl	_BN_add
	cbz	w0, LBB0_12
; %bb.11:
	ldr	x0, [x20, #8]
	ldr	w3, [x20]
	mov	x1, #0
	mov	x2, x0
	mov	x4, x19
	bl	_BN_div
	cmp	w0, #0
	cset	w20, ne
	b	LBB0_13
LBB0_12:
	mov	w20, #0
LBB0_13:
	mov	x0, x19
	bl	_BN_CTX_end
	mov	x0, x19
	bl	_BN_CTX_free
LBB0_14:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_NID_X9_62_characteristic_two_field,8,3 ; @NID_X9_62_characteristic_two_field
	.no_dead_strip	_ec_guess_cofactor
.subsections_via_symbols
