	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_br_rsa_i31_public              ## -- Begin function br_rsa_i31_public
	.p2align	4, 0x90
_br_rsa_i31_public:                     ## @br_rsa_i31_public
	.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, %r13
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_TLEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	incl	%eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r12
	movq	8(%r13), %rax
	xorl	%ebx, %ebx
	testq	%rax, %rax
	je	LBB0_10
## %bb.1:
	movq	(%r13), %rsi
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpb	$0, (%rsi)
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	incq	%rsi
	decq	%rax
	jne	LBB0_2
	jmp	LBB0_10
LBB0_4:
	cmpq	%rax, %r15
	jne	LBB0_10
## %bb.5:
	movq	_BR_MAX_RSA_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	sarl	$3, %ecx
	movslq	%ecx, %rcx
	cmpq	%rcx, %rax
	ja	LBB0_10
## %bb.6:
	leaq	(,%r15,8), %rax
	testq	%rax, %rax
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	jle	LBB0_7
## %bb.8:
	cmpq	$31, %rax
	movl	$31, %ecx
	cmovlq	%rax, %rcx
	negq	%rcx
	addq	%rax, %rcx
	addq	$30, %rcx
	movabsq	$595056260442243601, %rdx       ## imm = 0x842108421084211
	movq	%rcx, %rax
	mulq	%rdx
	subq	%rdx, %rcx
	shrq	%rcx
	addq	%rdx, %rcx
	shrq	$4, %rcx
	addq	$2, %rcx
	jmp	LBB0_9
LBB0_7:
	movl	$1, %ecx
LBB0_9:
	movl	%ecx, %r14d
	andl	$1, %r14d
	addq	%rcx, %r14
	leaq	(%r12,%r14,4), %rbx
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	leaq	(%r12,%r14,8), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	movq	%r15, %rdx
	callq	_br_i31_decode
	movl	4(%r12), %edi
	callq	_br_i31_ninv31
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	%rbx, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movq	%r15, %rdx
	movq	%r12, %rcx
	callq	_br_i31_decode_mod
	movl	%eax, %ebx
	movl	-52(%rbp), %r8d                 ## 4-byte Reload
	andl	%r8d, %ebx
	andl	$1, %ebx
	movl	16(%r13), %edx
	movl	20(%r13), %esi
	movq	_TLEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r14d, %r14d
	subl	%r14d, %eax
	subq	$8, %rsp
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movq	%r12, %rcx
	movq	-80(%rbp), %r9                  ## 8-byte Reload
	pushq	%rax
	callq	_br_i31_modpow_opt
	addq	$16, %rsp
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	_br_i31_encode
LBB0_10:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_12
## %bb.11:
	movl	%ebx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_TLEN,4,2                       ## @TLEN
	.comm	_BR_MAX_RSA_SIZE,4,2            ## @BR_MAX_RSA_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_br_rsa_i31_public              ; -- Begin function br_rsa_i31_public
	.p2align	2
_br_rsa_i31_public:                     ; @br_rsa_i31_public
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #16
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x27, _TLEN@GOTPAGE
Lloh4:
	ldr	x27, [x27, _TLEN@GOTPAGEOFF]
	ldr	w8, [x27]
	add	w8, w8, #1
	lsl	x8, x8, #2
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x22, x9, x8
	mov	sp, x22
	ldr	x8, [x2, #8]
	cbz	x8, LBB0_4
; %bb.1:
	ldr	x1, [x21]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldrb	w9, [x1]
	cbnz	w9, LBB0_7
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x1, x1, #1
	subs	x8, x8, #1
	b.ne	LBB0_2
LBB0_4:
	mov	w23, #0
LBB0_5:
	ldur	x8, [x29, #-88]
Lloh7:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh8:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_13
; %bb.6:
	mov	x0, x23
	sub	sp, x29, #80
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_7:
	mov	w23, #0
	cmp	x19, x8
	b.ne	LBB0_5
; %bb.8:
Lloh10:
	adrp	x9, _BR_MAX_RSA_SIZE@GOTPAGE
Lloh11:
	ldr	x9, [x9, _BR_MAX_RSA_SIZE@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	sbfx	x9, x9, #3, #29
	cmp	x8, x9
	b.hi	LBB0_5
; %bb.9:
	lsl	x8, x19, #3
	cmp	x8, #1
	b.lt	LBB0_11
; %bb.10:
	mov	w9, #31
	cmp	x8, #31
	csel	x9, x8, x9, lt
	sub	x8, x8, x9
	add	x8, x8, #30
	mov	x9, #16913
	movk	x9, #8456, lsl #16
	movk	x9, #4228, lsl #32
	movk	x9, #2114, lsl #48
	umulh	x9, x8, x9
	sub	x8, x8, x9
	add	x8, x9, x8, lsr #1
	lsr	x8, x8, #4
	add	x8, x8, #2
	b	LBB0_12
LBB0_11:
	mov	w8, #1
LBB0_12:
	and	x9, x8, #0x1
	add	x28, x9, x8
	add	x24, x22, x28, lsl #2
	add	x25, x22, x28, lsl #3
	mov	x0, x22
	mov	x2, x19
	bl	_br_i31_decode
	ldr	w0, [x22, #4]
	bl	_br_i31_ninv31
	mov	x26, x0
	mov	x0, x24
	mov	x1, x20
	mov	x2, x19
	mov	x3, x22
	bl	_br_i31_decode_mod
	and	w8, w26, w0
	and	w23, w8, #0x1
	ldp	w2, w1, [x21, #16]
	ldr	w8, [x27]
	sub	w6, w8, w28, lsl #1
	mov	x0, x24
	mov	x3, x22
	mov	x4, x26
	mov	x5, x25
	bl	_br_i31_modpow_opt
	mov	x0, x20
	mov	x1, x19
	mov	x2, x24
	bl	_br_i31_encode
	b	LBB0_5
LBB0_13:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_TLEN,4,2                       ; @TLEN
	.comm	_BR_MAX_RSA_SIZE,4,2            ; @BR_MAX_RSA_SIZE
.subsections_via_symbols
