	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_br_i31_encode                  ## -- Begin function br_i31_encode
	.p2align	4, 0x90
_br_i31_encode:                         ## @br_i31_encode
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movl	(%rdx), %eax
	addl	$31, %eax
	cmpl	$31, %eax
	ja	LBB0_1
## %bb.17:
	xorl	%esi, %esi
	movq	%r15, %rdx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_memset                         ## TAILCALL
LBB0_1:
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	testq	%r15, %r15
	je	LBB0_16
## %bb.2:
	sarl	$5, %eax
	cltq
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	addq	%r15, %rdi
	movl	$1, %ebx
	xorl	%r13d, %r13d
	xorl	%edx, %edx
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	$31, %r13d
LBB0_15:                                ##   in Loop: Header=BB0_3 Depth=1
	incq	%rbx
	movl	%r14d, %edx
	testq	%r15, %r15
	je	LBB0_16
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	$0, %r14d
	cmpq	-56(%rbp), %rbx                 ## 8-byte Folded Reload
	ja	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax,%rbx,4), %r14d
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	testl	%r13d, %r13d
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%r14d, %eax
	movl	%r13d, %ecx
	shll	%cl, %eax
	orl	%edx, %eax
	cmpq	$3, %r15
	jbe	LBB0_8
## %bb.14:                              ##   in Loop: Header=BB0_3 Depth=1
	movl	%r13d, %ecx
	negb	%cl
	sarl	%cl, %r14d
	decl	%r13d
	addq	$-4, %rdi
	addq	$-4, %r15
	movq	%rdi, %r12
	movl	%eax, %esi
	callq	_br_enc32be
	movq	%r12, %rdi
	jmp	LBB0_15
LBB0_8:
	cmpq	$1, %r15
	je	LBB0_13
## %bb.9:
	cmpq	$2, %r15
	je	LBB0_12
## %bb.10:
	cmpq	$3, %r15
	jne	LBB0_16
## %bb.11:
	movl	%eax, %ecx
	shrl	$16, %ecx
	movb	%cl, -3(%rdi)
LBB0_12:
	movb	%ah, -2(%rdi)
LBB0_13:
	movb	%al, -1(%rdi)
LBB0_16:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_br_i31_encode                  ; -- Begin function br_i31_encode
	.p2align	2
_br_i31_encode:                         ; @br_i31_encode
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x1
	ldr	w8, [x2]
	add	w9, w8, #31
	cmp	w9, #31
	b.hi	LBB0_2
; %bb.1:
	mov	w1, #0
	mov	x2, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_memset
LBB0_2:
	cbz	x19, LBB0_17
; %bb.3:
	mov	x21, x2
	mov	w22, #0
	mov	w8, #0
	sbfx	x23, x9, #5, #27
	add	x20, x0, x19
	mov	w24, #1
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	w22, #31
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x24, x24, #1
	mov	x8, x25
	cbz	x19, LBB0_17
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	cmp	x24, x23
	b.ls	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	w25, #0
	cbnz	w22, LBB0_9
	b	LBB0_4
LBB0_8:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w25, [x21, x24, lsl #2]
	cbz	w22, LBB0_4
LBB0_9:                                 ;   in Loop: Header=BB0_6 Depth=1
	lsl	w9, w25, w22
	orr	w1, w9, w8
	cmp	x19, #3
	b.ls	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	neg	w8, w22
	asr	w25, w25, w8
	sub	w22, w22, #1
	sub	x20, x20, #4
	sub	x19, x19, #4
	mov	x0, x20
	bl	_br_enc32be
	b	LBB0_5
LBB0_11:
	cmp	x19, #1
	b.eq	LBB0_16
; %bb.12:
	cmp	x19, #2
	b.eq	LBB0_15
; %bb.13:
	cmp	x19, #3
	b.ne	LBB0_17
; %bb.14:
	lsr	w8, w1, #16
	sturb	w8, [x20, #-3]
LBB0_15:
	lsr	w8, w1, #8
	sturb	w8, [x20, #-2]
LBB0_16:
	sturb	w1, [x20, #-1]
LBB0_17:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
