	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mp_int_invmod                  ## -- Begin function mp_int_invmod
	.p2align	4, 0x90
_mp_int_invmod:                         ## @mp_int_invmod
	.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	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r13
	testq	%rdi, %rdi
	setne	%al
	testq	%rsi, %rsi
	setne	%cl
	andb	%al, %cl
	testq	%rdx, %rdx
	setne	%al
	andb	%cl, %al
	movzbl	%al, %edi
	callq	_assert
	movq	%r13, %rdi
	callq	_CMPZ
	movq	_MP_RANGE@GOTPCREL(%rip), %rbx
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	movq	%r15, %rdi
	callq	_CMPZ
	testq	%rax, %rax
	jle	LBB0_8
## %bb.2:
	movl	$2, %edi
	callq	_DECLARE_TEMP
	xorl	%edi, %edi
	callq	_TEMP
	movl	%eax, %r12d
	movl	$1, %edi
	callq	_TEMP
	movq	%r13, %rdi
	movq	%r15, %rsi
	movl	%r12d, %edx
	movl	%eax, %ecx
	xorl	%r8d, %r8d
	callq	_mp_int_egcd
	movl	%eax, %edi
	callq	_REQUIRE
	xorl	%edi, %edi
	callq	_TEMP
	movl	%eax, %edi
	movl	$1, %esi
	callq	_mp_int_compare_value
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_MP_UNDEF@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_REQUIRE
LBB0_4:
	movl	$1, %edi
	callq	_TEMP
	movl	%eax, %r12d
	movl	$1, %edi
	callq	_TEMP
	movl	%r12d, %edi
	movq	%r15, %rsi
	movl	%eax, %edx
	callq	_mp_int_mod
	movl	%eax, %edi
	callq	_REQUIRE
	movq	%r13, %rdi
	callq	_MP_SIGN
	movq	%rax, %r12
	movq	_MP_NEG@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movl	$1, %edi
	callq	_TEMP
	cmpq	%rbx, %r12
	jne	LBB0_6
## %bb.5:
	movq	%r15, %rdi
	movl	%eax, %esi
	movq	%r14, %rdx
	callq	_mp_int_sub
	jmp	LBB0_7
LBB0_6:
	movl	%eax, %edi
	movq	%r14, %rsi
	callq	_mp_int_copy
LBB0_7:
	movl	%eax, %edi
	callq	_REQUIRE
	xorl	%eax, %eax
	callq	_CLEANUP_TEMP
	movq	_MP_OK@GOTPCREL(%rip), %rbx
LBB0_8:
	movl	(%rbx), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MP_RANGE,4,2                   ## @MP_RANGE
	.comm	_MP_UNDEF,4,2                   ## @MP_UNDEF
	.comm	_MP_NEG,8,3                     ## @MP_NEG
	.comm	_MP_OK,4,2                      ## @MP_OK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mp_int_invmod                  ; -- Begin function mp_int_invmod
	.p2align	2
_mp_int_invmod:                         ; @mp_int_invmod
	.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	x19, x2
	mov	x20, x1
	mov	x21, x0
	cmp	x0, #0
	ccmp	x1, #0, #4, ne
	ccmp	x2, #0, #4, ne
	cset	w0, ne
	bl	_assert
	mov	x0, x21
	bl	_CMPZ
	cbz	x0, LBB0_6
; %bb.1:
	mov	x0, x20
	bl	_CMPZ
	cmp	x0, #1
	b.lt	LBB0_6
; %bb.2:
	mov	w0, #2
	bl	_DECLARE_TEMP
	mov	w0, #0
	bl	_TEMP
	mov	x22, x0
	mov	w0, #1
	bl	_TEMP
	mov	x3, x0
	mov	x0, x21
	mov	x1, x20
	mov	x2, x22
	mov	x4, #0
	bl	_mp_int_egcd
	bl	_REQUIRE
	mov	w0, #0
	bl	_TEMP
	mov	w1, #1
	bl	_mp_int_compare_value
	cbz	x0, LBB0_4
; %bb.3:
Lloh0:
	adrp	x8, _MP_UNDEF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MP_UNDEF@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_REQUIRE
LBB0_4:
	mov	w0, #1
	bl	_TEMP
	mov	x22, x0
	mov	w0, #1
	bl	_TEMP
	mov	x2, x0
	mov	x0, x22
	mov	x1, x20
	bl	_mp_int_mod
	bl	_REQUIRE
	mov	x0, x21
	bl	_MP_SIGN
	mov	x21, x0
Lloh3:
	adrp	x8, _MP_NEG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MP_NEG@GOTPAGEOFF]
Lloh5:
	ldr	x22, [x8]
	mov	w0, #1
	bl	_TEMP
	mov	x1, x0
	cmp	x21, x22
	b.ne	LBB0_7
; %bb.5:
	mov	x0, x20
	mov	x2, x19
	bl	_mp_int_sub
	b	LBB0_8
LBB0_6:
Lloh6:
	adrp	x8, _MP_RANGE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MP_RANGE@GOTPAGEOFF]
	b	LBB0_9
LBB0_7:
	mov	x0, x1
	mov	x1, x19
	bl	_mp_int_copy
LBB0_8:
	bl	_REQUIRE
	bl	_CLEANUP_TEMP
Lloh8:
	adrp	x8, _MP_OK@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MP_OK@GOTPAGEOFF]
LBB0_9:
	ldr	w0, [x8]
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_MP_RANGE,4,2                   ; @MP_RANGE
	.comm	_MP_UNDEF,4,2                   ; @MP_UNDEF
	.comm	_MP_NEG,8,3                     ; @MP_NEG
	.comm	_MP_OK,4,2                      ; @MP_OK
.subsections_via_symbols
