	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mpi_powm                       ## -- Begin function mpi_powm
	.p2align	4, 0x90
_mpi_powm:                              ## @mpi_powm
	.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	$184, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %rbx
	movslq	(%rdx), %rax
	movl	(%rcx), %r15d
	movq	8(%rdi), %r12
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	movq	%rsi, -104(%rbp)                ## 8-byte Spill
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	movl	4(%rbx), %eax
	movl	%eax, -192(%rbp)                ## 4-byte Spill
	movq	8(%rdx), %rax
	movq	%rax, -144(%rbp)                ## 8-byte Spill
	movl	%r15d, %edi
	callq	_mpi_alloc_limb_space
	testq	%rax, %rax
	je	LBB0_75
## %bb.2:
	movq	%rax, %r13
	movslq	%r15d, %rcx
	movq	8(%rbx), %rax
	movq	%rcx, -168(%rbp)                ## 8-byte Spill
	movl	-4(%rax,%rcx,4), %esi
	callq	_count_leading_zeros
	movq	8(%rbx), %rsi
	movq	%r13, %rdi
	movl	%r15d, %edx
	callq	_MPN_COPY
	movq	-104(%rbp), %rcx                ## 8-byte Reload
	movl	(%rcx), %ebx
	movl	4(%rcx), %eax
	movl	%eax, -188(%rbp)                ## 4-byte Spill
	movq	%r15, %rax
	movq	%r15, -128(%rbp)                ## 8-byte Spill
	cmpl	%r15d, %ebx
	movq	%r13, -112(%rbp)                ## 8-byte Spill
	jle	LBB0_9
## %bb.3:
	leal	1(%rbx), %edi
	callq	_mpi_alloc_limb_space
	testq	%rax, %rax
	je	LBB0_22
## %bb.4:
	movq	-104(%rbp), %rdx                ## 8-byte Reload
	movq	8(%rdx), %rsi
	movq	%rax, %rdi
	movq	%rax, %r15
	movl	%ebx, %edx
	callq	_MPN_COPY
	movq	-168(%rbp), %rax                ## 8-byte Reload
	leaq	(%r15,%rax,4), %rdi
	xorl	%esi, %esi
	movq	%r15, %rdx
	movl	%ebx, %ecx
	movq	%r13, %r8
	movq	-128(%rbp), %rbx                ## 8-byte Reload
	movl	%ebx, %r9d
	callq	_mpihelp_divrem
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_MPN_NORMALIZE
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	%r15, %rsi
                                        ## kill: def $ebx killed $ebx killed $rbx def $rbx
	movq	%rsi, %rax
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	testl	%ebx, %ebx
	jne	LBB0_10
LBB0_5:
	movq	$0, (%rcx)
	xorl	%r12d, %r12d
	xorl	%r13d, %r13d
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_67
LBB0_6:
	movl	$1, (%r12)
	movl	$1, %eax
	cmpl	$1, %r15d
	jne	LBB0_8
## %bb.7:
	movq	8(%rbx), %rcx
	xorl	%eax, %eax
	cmpl	$1, (%rcx)
	setne	%al
LBB0_8:
	movl	%eax, (%rdi)
	movl	$0, 4(%rdi)
	xorl	%r14d, %r14d
	jmp	LBB0_75
LBB0_9:
	movq	8(%rcx), %rsi
	xorl	%eax, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	testl	%ebx, %ebx
	je	LBB0_5
LBB0_10:
	movq	-128(%rbp), %rax                ## 8-byte Reload
	leal	(%rax,%rax), %r15d
	cmpl	%r15d, 16(%rcx)
	movq	%rbx, -184(%rbp)                ## 8-byte Spill
	jge	LBB0_16
## %bb.11:
	cmpq	-144(%rbp), %r12                ## 8-byte Folded Reload
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	je	LBB0_23
## %bb.12:
	cmpq	%r13, %r12
	je	LBB0_23
## %bb.13:
	cmpq	%rsi, %r12
	je	LBB0_23
## %bb.14:
	movq	%rcx, %rbx
	movq	%rcx, %rdi
	movl	%r15d, %esi
	callq	_mpi_resize
	testq	%rax, %rax
	js	LBB0_58
## %bb.15:
	movq	8(%rbx), %r12
	movb	$1, %al
	movq	%rax, -160(%rbp)                ## 8-byte Spill
	xorl	%ebx, %ebx
	jmp	LBB0_29
LBB0_16:
	cmpq	%rsi, %r12
	jne	LBB0_19
## %bb.17:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_BUG_ON
	movl	%ebx, %edi
	callq	_mpi_alloc_limb_space
	testq	%rax, %rax
	je	LBB0_22
## %bb.18:
	movq	%rax, %rdi
	movq	%r12, %rsi
	movq	%rax, %r13
	movl	%ebx, %edx
	callq	_MPN_COPY
	movq	%r13, %rsi
	movq	%r13, %rax
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movq	-112(%rbp), %r13                ## 8-byte Reload
LBB0_19:
	cmpq	-144(%rbp), %r12                ## 8-byte Folded Reload
	je	LBB0_25
## %bb.20:
	xorl	%ebx, %ebx
	cmpq	%r13, %r12
	je	LBB0_27
LBB0_21:
	movb	$1, %al
	movq	%rax, -160(%rbp)                ## 8-byte Spill
	jmp	LBB0_30
LBB0_22:
	xorl	%r12d, %r12d
	xorl	%r13d, %r13d
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	jmp	LBB0_67
LBB0_23:
	movl	%r15d, %edi
	callq	_mpi_alloc_limb_space
	xorl	%ebx, %ebx
	testq	%rax, %rax
	je	LBB0_60
## %bb.24:
	movq	%rax, %r12
	xorl	%eax, %eax
	movq	%rax, -160(%rbp)                ## 8-byte Spill
	jmp	LBB0_29
LBB0_25:
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_mpi_alloc_limb_space
	testq	%rax, %rax
	je	LBB0_58
## %bb.26:
	movq	%rax, %rbx
	movq	%rax, %rdi
	movq	%r12, %rsi
	movq	-96(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_MPN_COPY
	movq	%rbx, -144(%rbp)                ## 8-byte Spill
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	cmpq	%r13, %r12
	jne	LBB0_21
LBB0_27:
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	%r15, -176(%rbp)                ## 8-byte Spill
	movq	%r12, %rdi
	callq	_BUG_ON
	movq	-128(%rbp), %r15                ## 8-byte Reload
	movl	%r15d, %edi
	callq	_mpi_alloc_limb_space
	testq	%rax, %rax
	je	LBB0_76
## %bb.28:
	movq	%rax, %rdi
	movb	$1, %al
	movq	%rax, -160(%rbp)                ## 8-byte Spill
	movq	%rdi, -112(%rbp)                ## 8-byte Spill
	movq	%r12, %rsi
	movl	%r15d, %edx
	callq	_MPN_COPY
	movq	-176(%rbp), %r15                ## 8-byte Reload
LBB0_29:
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
LBB0_30:
	movq	%r12, %rdi
	movq	%rsi, %r13
	movq	-184(%rbp), %rdx                ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_MPN_COPY
	leal	2(%r15), %edi
	callq	_mpi_alloc_limb_space
	movq	%rax, -120(%rbp)                ## 8-byte Spill
	testq	%rax, %rax
	movq	%r15, -176(%rbp)                ## 8-byte Spill
	je	LBB0_32
## %bb.31:
	xorl	%eax, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	-120(%rbp), %r13                ## 8-byte Reload
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_64
LBB0_32:
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, -136(%rbp)                ## 8-byte Spill
	movl	%r14d, -76(%rbp)                ## 4-byte Spill
	leaq	-152(%rbp), %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movq	-144(%rbp), %rax                ## 8-byte Reload
	testb	$1, (%rax)
	movl	$0, %ecx
	je	LBB0_34
## %bb.33:
	movq	-104(%rbp), %rcx                ## 8-byte Reload
	cmpl	$0, 4(%rcx)
	setne	%cl
LBB0_34:
	movq	%rcx, -208(%rbp)                ## 8-byte Spill
	movq	-96(%rbp), %rbx                 ## 8-byte Reload
	movl	-4(%rax,%rbx,4), %esi
	decq	%rbx
	callq	_count_leading_zeros
	movl	%ebx, %eax
	movq	%rax, -200(%rbp)                ## 8-byte Spill
	xorl	%eax, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	-184(%rbp), %rbx                ## 8-byte Reload
                                        ## kill: def $ebx killed $ebx killed $rbx def $rbx
	xorl	%eax, %eax
	xorl	%r13d, %r13d
                                        ## implicit-def: $edx
	movq	-128(%rbp), %r9                 ## 8-byte Reload
                                        ## implicit-def: $r15d
LBB0_35:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_41 Depth 2
	testl	%r15d, %r15d
	movl	%eax, -96(%rbp)                 ## 4-byte Spill
	jne	LBB0_41
## %bb.36:                              ##   in Loop: Header=BB0_35 Depth=1
	movq	%r12, %rsi
LBB0_37:                                ##   in Loop: Header=BB0_35 Depth=1
	movq	-200(%rbp), %rcx                ## 8-byte Reload
	testl	%ecx, %ecx
	jle	LBB0_77
## %bb.38:                              ##   in Loop: Header=BB0_35 Depth=1
	movq	-144(%rbp), %rax                ## 8-byte Reload
	movl	-4(%rax,%rcx,4), %edx
	decq	%rcx
	movq	%rcx, -200(%rbp)                ## 8-byte Spill
	movq	_BITS_PER_MPI_LIMB@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	%rsi, %r12
	movl	-96(%rbp), %eax                 ## 4-byte Reload
	jmp	LBB0_35
	.p2align	4, 0x90
LBB0_39:                                ##   in Loop: Header=BB0_41 Depth=2
	movq	%r13, %rsi
	movq	%r14, %r13
LBB0_40:                                ##   in Loop: Header=BB0_41 Depth=2
	addl	%edx, %edx
	movq	%rsi, %r12
	decl	%r15d
	je	LBB0_37
LBB0_41:                                ##   Parent Loop BB0_35 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%edx, -104(%rbp)                ## 4-byte Spill
	movq	_KARATSUBA_THRESHOLD@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jge	LBB0_43
## %bb.42:                              ##   in Loop: Header=BB0_41 Depth=2
	movq	%r13, %rdi
	movq	%r12, %r14
	movq	%r12, %rsi
	movl	%ebx, %edx
	movq	%r9, %r12
	callq	_mpih_sqr_n_basecase
	movq	%r12, %r9
	movl	-96(%rbp), %eax                 ## 4-byte Reload
	jmp	LBB0_49
	.p2align	4, 0x90
LBB0_43:                                ##   in Loop: Header=BB0_41 Depth=2
	movl	%r15d, -80(%rbp)                ## 4-byte Spill
	leal	(%rbx,%rbx), %r15d
	cmpq	$0, -64(%rbp)                   ## 8-byte Folded Reload
	movl	-96(%rbp), %eax                 ## 4-byte Reload
	je	LBB0_46
## %bb.44:                              ##   in Loop: Header=BB0_41 Depth=2
	cmpl	%r15d, %eax
	jge	LBB0_47
## %bb.45:                              ##   in Loop: Header=BB0_41 Depth=2
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_mpi_free_limb_space
LBB0_46:                                ##   in Loop: Header=BB0_41 Depth=2
	movl	%r15d, %edi
	callq	_mpi_alloc_limb_space
	testq	%rax, %rax
	jne	LBB0_48
	jmp	LBB0_59
LBB0_47:                                ##   in Loop: Header=BB0_41 Depth=2
	movl	%eax, %r15d
	movq	-64(%rbp), %rax                 ## 8-byte Reload
LBB0_48:                                ##   in Loop: Header=BB0_41 Depth=2
	movq	%r13, %rdi
	movq	%r12, %r14
	movq	%r12, %rsi
	movl	%ebx, %edx
	movq	%rax, %rcx
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	callq	_mpih_sqr_n
	movl	%r15d, %eax
	movq	-128(%rbp), %r9                 ## 8-byte Reload
	movl	-80(%rbp), %r15d                ## 4-byte Reload
LBB0_49:                                ##   in Loop: Header=BB0_41 Depth=2
	addl	%ebx, %ebx
	cmpl	%r9d, %ebx
	movl	%eax, -96(%rbp)                 ## 4-byte Spill
	jle	LBB0_51
## %bb.50:                              ##   in Loop: Header=BB0_41 Depth=2
	movq	-168(%rbp), %rax                ## 8-byte Reload
	leaq	(,%rax,4), %rdi
	addq	%r13, %rdi
	xorl	%esi, %esi
	movq	%r13, %rdx
	movl	%ebx, %ecx
	movq	-112(%rbp), %r8                 ## 8-byte Reload
	movq	%r9, %rbx
	callq	_mpihelp_divrem
	movq	%rbx, %r9
LBB0_51:                                ##   in Loop: Header=BB0_41 Depth=2
	movl	-104(%rbp), %edx                ## 4-byte Reload
	testl	%edx, %edx
	jns	LBB0_39
## %bb.52:                              ##   in Loop: Header=BB0_41 Depth=2
	movl	%r15d, -80(%rbp)                ## 4-byte Spill
	movq	%r13, -88(%rbp)                 ## 8-byte Spill
	movq	-184(%rbp), %r12                ## 8-byte Reload
	movq	_KARATSUBA_THRESHOLD@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jge	LBB0_54
## %bb.53:                              ##   in Loop: Header=BB0_41 Depth=2
	movq	%r9, %r13
	movq	%r14, %rdi
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	movl	%ebx, %edx
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movl	%r12d, %r8d
	leaq	-212(%rbp), %r9
	callq	_mpihelp_mul
	testq	%rax, %rax
	jns	LBB0_55
	jmp	LBB0_61
LBB0_54:                                ##   in Loop: Header=BB0_41 Depth=2
	movq	%r9, %r13
	movq	%r14, %rdi
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	movl	%ebx, %edx
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movl	%r12d, %r8d
	leaq	-152(%rbp), %r9
	callq	_mpihelp_mul_karatsuba_case
	testq	%rax, %rax
	js	LBB0_62
LBB0_55:                                ##   in Loop: Header=BB0_41 Depth=2
	addl	%r12d, %ebx
	movq	%r13, %r9
	cmpl	%r9d, %ebx
	jle	LBB0_57
## %bb.56:                              ##   in Loop: Header=BB0_41 Depth=2
	movq	-168(%rbp), %rax                ## 8-byte Reload
	leaq	(%r14,%rax,4), %rdi
	xorl	%esi, %esi
	movq	%r14, %rdx
	movl	%ebx, %ecx
	movq	-112(%rbp), %r8                 ## 8-byte Reload
	movq	%r9, %rbx
	callq	_mpihelp_divrem
	movq	%rbx, %r9
LBB0_57:                                ##   in Loop: Header=BB0_41 Depth=2
	movq	%r14, %rsi
	movq	-88(%rbp), %r13                 ## 8-byte Reload
	movl	-80(%rbp), %r15d                ## 4-byte Reload
	movl	-104(%rbp), %edx                ## 4-byte Reload
	jmp	LBB0_40
LBB0_58:
	xorl	%r12d, %r12d
	xorl	%r13d, %r13d
	xorl	%ebx, %ebx
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_67
LBB0_59:
	xorl	%eax, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_63
LBB0_60:
	xorl	%r12d, %r12d
	xorl	%r13d, %r13d
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	xorl	%ebx, %ebx
	jmp	LBB0_67
LBB0_61:
	movl	-76(%rbp), %r14d                ## 4-byte Reload
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	-136(%rbp), %rbx                ## 8-byte Reload
	movq	-120(%rbp), %r13                ## 8-byte Reload
	jmp	LBB0_65
LBB0_62:
	movq	-88(%rbp), %r12                 ## 8-byte Reload
LBB0_63:
	movl	-76(%rbp), %r14d                ## 4-byte Reload
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	-136(%rbp), %rbx                ## 8-byte Reload
	movq	-120(%rbp), %r13                ## 8-byte Reload
LBB0_64:
	movq	%r12, -88(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %r15                 ## 8-byte Reload
LBB0_65:
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	cmpb	$0, -160(%rbp)                  ## 1-byte Folded Reload
	jne	LBB0_67
LBB0_66:
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	movq	-176(%rbp), %rdx                ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_mpi_assign_limb_space
LBB0_67:
	movq	-112(%rbp), %rdi                ## 8-byte Reload
	callq	_mpi_free_limb_space
	testq	%r15, %r15
	je	LBB0_69
LBB0_68:
	movq	%r15, %rdi
	callq	_mpi_free_limb_space
LBB0_69:
	testq	%rbx, %rbx
	je	LBB0_71
## %bb.70:
	movq	%rbx, %rdi
	callq	_mpi_free_limb_space
LBB0_71:
	testq	%r13, %r13
	je	LBB0_73
## %bb.72:
	movq	%r13, %rdi
	callq	_mpi_free_limb_space
LBB0_73:
	testq	%r12, %r12
	je	LBB0_75
## %bb.74:
	movq	%r12, %rdi
	callq	_mpi_free_limb_space
LBB0_75:
	movl	%r14d, %eax
	addq	$184, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_76:
	xorl	%r12d, %r12d
	xorl	%r13d, %r13d
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	testq	%r15, %r15
	jne	LBB0_68
	jmp	LBB0_69
LBB0_77:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	8(%r14), %rdi
	movl	%ebx, %edx
	movq	%r9, %r15
	callq	_MPN_COPY
	movq	%rbx, %rcx
	movq	%r14, %rax
	movq	8(%r14), %rbx
	cmpl	%r15d, %ecx
	movq	%r15, %r14
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	-120(%rbp), %r13                ## 8-byte Reload
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	jl	LBB0_79
## %bb.78:
	movq	-168(%rbp), %rax                ## 8-byte Reload
	leaq	(%rbx,%rax,4), %rdi
	xorl	%esi, %esi
	movq	%rbx, %rdx
                                        ## kill: def $ecx killed $ecx killed $rcx
	movq	-112(%rbp), %r8                 ## 8-byte Reload
	movl	%r14d, %r9d
	callq	_mpihelp_divrem
	movl	%r14d, %ecx
LBB0_79:
	movq	%rbx, %rdi
	movl	%ecx, %esi
	movq	%rbx, %r14
	movq	%rcx, %rbx
	callq	_MPN_NORMALIZE
	leaq	-152(%rbp), %rdi
	callq	_mpihelp_release_karatsuba_ctx
	movq	%rbx, %r8
	testl	%r8d, %r8d
	setne	%al
	testb	%al, -208(%rbp)                 ## 1-byte Folded Reload
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	je	LBB0_81
## %bb.80:
	movq	%r14, %rbx
	movq	%r14, %rdi
	movq	-112(%rbp), %rsi                ## 8-byte Reload
	movq	-128(%rbp), %r14                ## 8-byte Reload
	movl	%r14d, %edx
	movq	%rbx, %rcx
                                        ## kill: def $r8d killed $r8d killed $r8
	callq	_mpihelp_sub
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_MPN_NORMALIZE
	movl	-192(%rbp), %eax                ## 4-byte Reload
	jmp	LBB0_82
LBB0_81:
	movl	%r8d, %r14d
	movl	-188(%rbp), %eax                ## 4-byte Reload
LBB0_82:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r14d, (%rdi)
	movl	%eax, 4(%rdi)
	xorl	%r14d, %r14d
	movq	-136(%rbp), %rbx                ## 8-byte Reload
	cmpb	$0, -160(%rbp)                  ## 1-byte Folded Reload
	je	LBB0_66
	jmp	LBB0_67
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_BITS_PER_MPI_LIMB,4,2          ## @BITS_PER_MPI_LIMB
	.comm	_KARATSUBA_THRESHOLD,4,2        ## @KARATSUBA_THRESHOLD
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mpi_powm                       ; -- Begin function mpi_powm
	.p2align	2
_mpi_powm:                              ; @mpi_powm
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #224
	.cfi_def_cfa_offset 224
	stp	x28, x27, [sp, #128]            ; 16-byte Folded Spill
	stp	x26, x25, [sp, #144]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #160]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #176]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #192]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #208]            ; 16-byte Folded Spill
	add	x29, sp, #208
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x3
	mov	x22, x0
	ldr	w25, [x2]
	ldr	w23, [x3]
	ldr	x27, [x0, #8]
	cbz	w25, LBB0_6
; %bb.1:
	mov	x26, x1
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w20, w8
	ldr	w28, [x19, #4]
	ldr	x24, [x2, #8]
	mov	x0, x23
	bl	_mpi_alloc_limb_space
	cbz	x0, LBB0_71
; %bb.2:
	mov	x21, x0
	str	w28, [sp, #72]                  ; 4-byte Folded Spill
	str	x24, [sp, #80]                  ; 8-byte Folded Spill
	sxtw	x8, w23
	str	x8, [sp, #104]                  ; 8-byte Folded Spill
	ldr	x8, [x19, #8]
	sub	w9, w23, #1
	ldr	w1, [x8, w9, sxtw #2]
	bl	_count_leading_zeros
	ldr	x1, [x19, #8]
	mov	x0, x21
	mov	x2, x23
	bl	_MPN_COPY
	ldp	w28, w19, [x26]
	cmp	w28, w23
	b.le	LBB0_9
; %bb.3:
	add	w0, w28, #1
	bl	_mpi_alloc_limb_space
	cbz	x0, LBB0_22
; %bb.4:
	str	w19, [sp, #68]                  ; 4-byte Folded Spill
	ldr	x1, [x26, #8]
	mov	x19, x0
	mov	x2, x28
	bl	_MPN_COPY
	ldr	x8, [sp, #104]                  ; 8-byte Folded Reload
	add	x0, x19, x8, lsl #2
	mov	w1, #0
	mov	x2, x19
	mov	x3, x28
	mov	x4, x21
	mov	x5, x23
	bl	_mpihelp_divrem
	mov	x0, x19
	mov	x1, x23
	bl	_MPN_NORMALIZE
	mov	x1, x19
	mov	x28, x23
	cbnz	w28, LBB0_10
LBB0_5:
	mov	x25, #0
	mov	x28, #0
	mov	x23, #0
	mov	w20, #0
	str	xzr, [x22]
	b	LBB0_63
LBB0_6:
	mov	w8, #1
	str	w8, [x27]
	cmp	w23, #1
	b.ne	LBB0_8
; %bb.7:
	ldr	x8, [x19, #8]
	ldr	w8, [x8]
	cmp	w8, #1
	cset	w8, ne
LBB0_8:
	mov	w20, #0
	stp	w8, wzr, [x22]
	b	LBB0_71
LBB0_9:
	str	w19, [sp, #68]                  ; 4-byte Folded Spill
	mov	x19, #0
	ldr	x1, [x26, #8]
	cbz	w28, LBB0_5
LBB0_10:
	lsl	w9, w23, #1
	ldr	w8, [x22, #16]
	str	w9, [sp, #76]                   ; 4-byte Folded Spill
	cmp	w8, w9
	b.ge	LBB0_16
; %bb.11:
	ldr	x8, [sp, #80]                   ; 8-byte Folded Reload
	cmp	x27, x8
	b.eq	LBB0_23
; %bb.12:
	cmp	x27, x21
	b.eq	LBB0_23
; %bb.13:
	cmp	x27, x1
	b.eq	LBB0_23
; %bb.14:
	mov	x24, x1
	mov	x0, x22
	ldr	w1, [sp, #76]                   ; 4-byte Folded Reload
	bl	_mpi_resize
	tbnz	x0, #63, LBB0_56
; %bb.15:
	str	xzr, [sp, #48]                  ; 8-byte Folded Spill
	ldr	x27, [x22, #8]
	b	LBB0_29
LBB0_16:
	cmp	x27, x1
	b.ne	LBB0_19
; %bb.17:
	mov	x0, x19
	bl	_BUG_ON
	mov	x0, x28
	bl	_mpi_alloc_limb_space
	cbz	x0, LBB0_22
; %bb.18:
	mov	x1, x27
	mov	x19, x0
	mov	x2, x28
	bl	_MPN_COPY
	mov	x1, x19
LBB0_19:
	ldr	x8, [sp, #80]                   ; 8-byte Folded Reload
	cmp	x27, x8
	b.eq	LBB0_25
; %bb.20:
	str	xzr, [sp, #48]                  ; 8-byte Folded Spill
	cmp	x27, x21
	b.eq	LBB0_27
LBB0_21:
	mov	w8, #1
	str	w8, [sp, #44]                   ; 4-byte Folded Spill
	b	LBB0_31
LBB0_22:
	mov	x25, #0
	mov	x28, #0
	mov	x23, #0
	mov	x19, #0
	b	LBB0_63
LBB0_23:
	mov	x24, x1
	ldr	w0, [sp, #76]                   ; 4-byte Folded Reload
	bl	_mpi_alloc_limb_space
	mov	x8, #0
	cbz	x0, LBB0_57
; %bb.24:
	mov	x27, x0
	str	x8, [sp, #48]                   ; 8-byte Folded Spill
	str	wzr, [sp, #44]                  ; 4-byte Folded Spill
	b	LBB0_30
LBB0_25:
	str	x1, [sp, #88]                   ; 8-byte Folded Spill
	mov	x0, x25
	bl	_mpi_alloc_limb_space
	cbz	x0, LBB0_56
; %bb.26:
	mov	x24, x0
	mov	x1, x27
	mov	x2, x25
	bl	_MPN_COPY
	str	x24, [sp, #80]                  ; 8-byte Folded Spill
	str	x24, [sp, #48]                  ; 8-byte Folded Spill
	ldr	x1, [sp, #88]                   ; 8-byte Folded Reload
	cmp	x27, x21
	b.ne	LBB0_21
LBB0_27:
	mov	x24, x1
	mov	x0, x27
	bl	_BUG_ON
	mov	x0, x23
	bl	_mpi_alloc_limb_space
	cbz	x0, LBB0_72
; %bb.28:
	mov	x21, x0
	mov	x1, x27
	mov	x2, x23
	bl	_MPN_COPY
LBB0_29:
	mov	w8, #1
	str	w8, [sp, #44]                   ; 4-byte Folded Spill
LBB0_30:
	mov	x1, x24
LBB0_31:
	mov	x0, x27
	mov	x24, x1
	mov	x2, x28
	bl	_MPN_COPY
	ldr	w8, [sp, #76]                   ; 4-byte Folded Reload
	add	w0, w8, #2
	bl	_mpi_alloc_limb_space
	str	x0, [sp, #32]                   ; 8-byte Folded Spill
	cbz	x0, LBB0_33
; %bb.32:
	mov	x25, #0
	b	LBB0_61
LBB0_33:
	stp	x24, x21, [sp, #88]             ; 16-byte Folded Spill
	str	x22, [sp, #24]                  ; 8-byte Folded Spill
	str	w20, [sp, #12]                  ; 4-byte Folded Spill
	sub	x0, x29, #88
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	mov	w10, #0
	ldr	x9, [sp, #80]                   ; 8-byte Folded Reload
	ldrb	w8, [x9]
	tbz	w8, #0, LBB0_35
; %bb.34:
	ldr	w8, [x26, #4]
	cmp	w8, #0
	cset	w10, ne
LBB0_35:
	str	w10, [sp, #8]                   ; 4-byte Folded Spill
	sub	w8, w25, #1
	str	x8, [sp, #56]                   ; 8-byte Folded Spill
	ldr	w1, [x9, w8, sxtw #2]
	bl	_count_leading_zeros
	mov	x25, #0
	mov	w21, #0
	mov	x26, #0
                                        ; implicit-def: $w22
                                        ; implicit-def: $w20
	mov	x24, x28
	str	x19, [sp, #16]                  ; 8-byte Folded Spill
	cbnz	w22, LBB0_41
LBB0_36:
	mov	x1, x27
	mov	x19, x24
LBB0_37:
	ldr	x9, [sp, #56]                   ; 8-byte Folded Reload
	cmp	w9, #1
	b.lt	LBB0_73
; %bb.38:
	sub	x9, x9, #1
	ldr	x8, [sp, #80]                   ; 8-byte Folded Reload
	str	x9, [sp, #56]                   ; 8-byte Folded Spill
	ldr	w20, [x8, x9, lsl #2]
Lloh3:
	adrp	x8, _BITS_PER_MPI_LIMB@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BITS_PER_MPI_LIMB@GOTPAGEOFF]
Lloh5:
	ldr	w22, [x8]
	mov	x27, x1
	mov	x24, x19
	cbnz	w22, LBB0_41
	b	LBB0_36
LBB0_39:                                ;   in Loop: Header=BB0_41 Depth=1
	mov	x1, x26
	mov	x26, x27
LBB0_40:                                ;   in Loop: Header=BB0_41 Depth=1
	lsl	w20, w20, #1
	mov	x24, x19
	mov	x27, x1
	subs	w22, w22, #1
	b.eq	LBB0_37
LBB0_41:                                ; =>This Inner Loop Header: Depth=1
Lloh6:
	adrp	x8, _KARATSUBA_THRESHOLD@GOTPAGE
Lloh7:
	ldr	x8, [x8, _KARATSUBA_THRESHOLD@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	lsl	w19, w24, #1
	cmp	w24, w8
	b.ge	LBB0_47
; %bb.42:                               ;   in Loop: Header=BB0_41 Depth=1
	mov	x0, x26
	mov	x1, x27
	mov	x2, x24
	bl	_mpih_sqr_n_basecase
	cmp	w19, w23
	b.le	LBB0_44
LBB0_43:                                ;   in Loop: Header=BB0_41 Depth=1
	ldp	x4, x8, [sp, #96]               ; 16-byte Folded Reload
	add	x0, x26, x8, lsl #2
	mov	w1, #0
	mov	x2, x26
	mov	x3, x19
	mov	x5, x23
	bl	_mpihelp_divrem
	mov	x19, x23
LBB0_44:                                ;   in Loop: Header=BB0_41 Depth=1
	tbz	w20, #31, LBB0_39
; %bb.45:                               ;   in Loop: Header=BB0_41 Depth=1
Lloh9:
	adrp	x8, _KARATSUBA_THRESHOLD@GOTPAGE
Lloh10:
	ldr	x8, [x8, _KARATSUBA_THRESHOLD@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w28, w8
	b.ge	LBB0_52
; %bb.46:                               ;   in Loop: Header=BB0_41 Depth=1
	sub	x5, x29, #92
	mov	x0, x27
	mov	x1, x26
	mov	x2, x19
	ldr	x3, [sp, #88]                   ; 8-byte Folded Reload
	mov	x4, x28
	bl	_mpihelp_mul
	tbz	x0, #63, LBB0_53
	b	LBB0_58
LBB0_47:                                ;   in Loop: Header=BB0_41 Depth=1
	cbz	x25, LBB0_50
; %bb.48:                               ;   in Loop: Header=BB0_41 Depth=1
	cmp	w21, w19
	b.ge	LBB0_51
; %bb.49:                               ;   in Loop: Header=BB0_41 Depth=1
	mov	x0, x25
	bl	_mpi_free_limb_space
LBB0_50:                                ;   in Loop: Header=BB0_41 Depth=1
	mov	x0, x19
	bl	_mpi_alloc_limb_space
	mov	x25, x0
	mov	x21, x19
	cbz	x0, LBB0_60
LBB0_51:                                ;   in Loop: Header=BB0_41 Depth=1
	mov	x0, x26
	mov	x1, x27
	mov	x2, x24
	mov	x3, x25
	bl	_mpih_sqr_n
	cmp	w19, w23
	b.gt	LBB0_43
	b	LBB0_44
LBB0_52:                                ;   in Loop: Header=BB0_41 Depth=1
	sub	x5, x29, #88
	mov	x0, x27
	mov	x1, x26
	mov	x2, x19
	ldr	x3, [sp, #88]                   ; 8-byte Folded Reload
	mov	x4, x28
	bl	_mpihelp_mul_karatsuba_case
	tbnz	x0, #63, LBB0_59
LBB0_53:                                ;   in Loop: Header=BB0_41 Depth=1
	add	w19, w19, w28
	cmp	w19, w23
	b.le	LBB0_55
; %bb.54:                               ;   in Loop: Header=BB0_41 Depth=1
	ldp	x4, x8, [sp, #96]               ; 16-byte Folded Reload
	add	x0, x27, x8, lsl #2
	mov	w1, #0
	mov	x2, x27
	mov	x3, x19
	mov	x5, x23
	bl	_mpihelp_divrem
	mov	x1, x27
	mov	x19, x23
	b	LBB0_40
LBB0_55:                                ;   in Loop: Header=BB0_41 Depth=1
	mov	x1, x27
	b	LBB0_40
LBB0_56:
	mov	x25, #0
	mov	x28, #0
	mov	x23, #0
	b	LBB0_63
LBB0_57:
	mov	x25, x8
	mov	x28, x8
	mov	x23, x8
	b	LBB0_63
LBB0_58:
	ldr	w20, [sp, #12]                  ; 4-byte Folded Reload
	ldr	x21, [sp, #96]                  ; 8-byte Folded Reload
	ldp	x19, x22, [sp, #16]             ; 16-byte Folded Reload
	ldr	x23, [sp, #48]                  ; 8-byte Folded Reload
	ldr	x28, [sp, #32]                  ; 8-byte Folded Reload
	ldr	w8, [sp, #44]                   ; 4-byte Folded Reload
	tbz	w8, #0, LBB0_62
	b	LBB0_63
LBB0_59:
	mov	x27, x26
LBB0_60:
	ldr	w20, [sp, #12]                  ; 4-byte Folded Reload
	ldr	x21, [sp, #96]                  ; 8-byte Folded Reload
	ldp	x19, x22, [sp, #16]             ; 16-byte Folded Reload
LBB0_61:
	ldr	x23, [sp, #48]                  ; 8-byte Folded Reload
	ldr	x28, [sp, #32]                  ; 8-byte Folded Reload
	ldr	w8, [sp, #44]                   ; 4-byte Folded Reload
	mov	x26, x27
	tbnz	w8, #0, LBB0_63
LBB0_62:
	mov	x0, x22
	mov	x1, x26
	ldr	w2, [sp, #76]                   ; 4-byte Folded Reload
	bl	_mpi_assign_limb_space
LBB0_63:
	mov	x0, x21
	bl	_mpi_free_limb_space
	cbz	x19, LBB0_65
LBB0_64:
	mov	x0, x19
	bl	_mpi_free_limb_space
LBB0_65:
	cbz	x23, LBB0_67
; %bb.66:
	mov	x0, x23
	bl	_mpi_free_limb_space
LBB0_67:
	cbz	x28, LBB0_69
; %bb.68:
	mov	x0, x28
	bl	_mpi_free_limb_space
LBB0_69:
	cbz	x25, LBB0_71
; %bb.70:
	mov	x0, x25
	bl	_mpi_free_limb_space
LBB0_71:
	mov	x0, x20
	ldp	x29, x30, [sp, #208]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #192]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #176]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #160]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #144]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #128]            ; 16-byte Folded Reload
	add	sp, sp, #224
	ret
LBB0_72:
	mov	x25, #0
	mov	x28, #0
	ldr	x23, [sp, #48]                  ; 8-byte Folded Reload
	cbnz	x19, LBB0_64
	b	LBB0_65
LBB0_73:
	ldr	x22, [sp, #24]                  ; 8-byte Folded Reload
	ldr	x0, [x22, #8]
	mov	x2, x19
	bl	_MPN_COPY
	ldr	x26, [x22, #8]
	cmp	w19, w23
	ldr	x21, [sp, #96]                  ; 8-byte Folded Reload
	ldr	w24, [sp, #72]                  ; 4-byte Folded Reload
	ldr	x28, [sp, #32]                  ; 8-byte Folded Reload
	b.lt	LBB0_75
; %bb.74:
	ldr	x8, [sp, #104]                  ; 8-byte Folded Reload
	add	x0, x26, x8, lsl #2
	mov	w1, #0
	mov	x2, x26
	mov	x3, x19
	mov	x4, x21
	mov	x5, x23
	bl	_mpihelp_divrem
	mov	x19, x23
LBB0_75:
	mov	x0, x26
	mov	x1, x19
	bl	_MPN_NORMALIZE
	sub	x0, x29, #88
	bl	_mpihelp_release_karatsuba_ctx
	cmp	w19, #0
	cset	w8, ne
	ldr	w9, [sp, #8]                    ; 4-byte Folded Reload
	and	w8, w9, w8
	tbz	w8, #0, LBB0_77
; %bb.76:
	mov	x0, x26
	mov	x1, x21
	mov	x2, x23
	mov	x3, x26
	mov	x4, x19
	bl	_mpihelp_sub
	mov	x0, x26
	mov	x1, x23
	bl	_MPN_NORMALIZE
	b	LBB0_78
LBB0_77:
	mov	x23, x19
	ldr	w24, [sp, #68]                  ; 4-byte Folded Reload
LBB0_78:
	ldr	w8, [sp, #44]                   ; 4-byte Folded Reload
	mov	w20, #0
	stp	w23, w24, [x22]
	ldr	x19, [sp, #16]                  ; 8-byte Folded Reload
	ldr	x23, [sp, #48]                  ; 8-byte Folded Reload
	tbz	w8, #0, LBB0_62
	b	LBB0_63
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_BITS_PER_MPI_LIMB,4,2          ; @BITS_PER_MPI_LIMB
	.comm	_KARATSUBA_THRESHOLD,4,2        ; @KARATSUBA_THRESHOLD
.subsections_via_symbols
