	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pack_utf8
_pack_utf8:                             ## @pack_utf8
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r12
	movl	%edx, %r14d
	movq	%rdi, %r15
	movl	%esi, %edi
	callq	_mrb_fixnum
	cmpl	$127, %eax
	jg	LBB0_2
## %bb.1:
	movb	%al, -36(%rbp)
	movl	$1, %ebx
	jmp	LBB0_9
LBB0_2:
	cmpl	$2047, %eax                     ## imm = 0x7FF
	ja	LBB0_4
## %bb.3:
	movq	%rax, %rcx
	shrq	$6, %rcx
	orb	$-64, %cl
	movb	%cl, -36(%rbp)
	andb	$63, %al
	orb	$-128, %al
	movb	%al, -35(%rbp)
	movl	$2, %ebx
	jmp	LBB0_9
LBB0_4:
	cmpl	$65535, %eax                    ## imm = 0xFFFF
	ja	LBB0_6
## %bb.5:
	movq	%rax, %rcx
	shrq	$12, %rcx
	orb	$-32, %cl
	movb	%cl, -36(%rbp)
	movq	%rax, %rcx
	shrq	$6, %rcx
	andb	$63, %cl
	orb	$-128, %cl
	movb	%cl, -35(%rbp)
	andb	$63, %al
	orb	$-128, %al
	movb	%al, -34(%rbp)
	movl	$3, %ebx
	jmp	LBB0_9
LBB0_6:
	cmpl	$2097151, %eax                  ## imm = 0x1FFFFF
	ja	LBB0_8
## %bb.7:
	movq	%rax, %rcx
	shrq	$18, %rcx
	orb	$-16, %cl
	movb	%cl, -36(%rbp)
	movq	%rax, %rcx
	shrq	$12, %rcx
	andb	$63, %cl
	orb	$-128, %cl
	movb	%cl, -35(%rbp)
	movq	%rax, %rcx
	shrq	$6, %rcx
	andb	$63, %cl
	orb	$-128, %cl
	movb	%cl, -34(%rbp)
	andb	$63, %al
	orb	$-128, %al
	movb	%al, -33(%rbp)
	movl	$4, %ebx
	jmp	LBB0_9
LBB0_8:
	movq	_E_RANGE_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r15, %rdi
	callq	_mrb_raise
	xorl	%ebx, %ebx
LBB0_9:
	movl	%ebx, %edx
	addq	%r12, %rdx
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_str_len_ensure
	movl	%eax, %edi
	callq	_RSTRING_PTR
	addq	%rax, %r12
	leaq	-36(%rbp), %rsi
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_memcpy
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_E_RANGE_ERROR,4,2              ## @E_RANGE_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pack(U): value out of range"

	.no_dead_strip	_pack_utf8
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pack_utf8
_pack_utf8:                             ; @pack_utf8
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x3
	mov	x20, x2
	mov	x21, x0
	mov	x0, x1
	bl	_mrb_fixnum
	cmp	w0, #127
	b.gt	LBB0_2
; %bb.1:
	strb	w0, [sp, #12]
	mov	w22, #1
	b	LBB0_9
LBB0_2:
	cmp	w0, #2047
	b.hi	LBB0_4
; %bb.3:
	ubfx	x8, x0, #6, #26
	orr	w8, w8, #0xc0
	strb	w8, [sp, #12]
	mov	w8, #128
	bfxil	w8, w0, #0, #6
	strb	w8, [sp, #13]
	mov	w22, #2
	b	LBB0_9
LBB0_4:
	lsr	w8, w0, #16
	cbnz	w8, LBB0_6
; %bb.5:
	ubfx	x8, x0, #12, #20
	orr	w8, w8, #0xe0
	strb	w8, [sp, #12]
	mov	w8, #128
	mov	w9, #128
	bfxil	w9, w0, #6, #6
	strb	w9, [sp, #13]
	bfxil	w8, w0, #0, #6
	strb	w8, [sp, #14]
	mov	w22, #3
	b	LBB0_9
LBB0_6:
	lsr	w8, w0, #21
	cbnz	w8, LBB0_8
; %bb.7:
	ubfx	x8, x0, #18, #14
	orr	w8, w8, #0xf0
	strb	w8, [sp, #12]
	mov	w8, #128
	mov	w9, #128
	bfxil	w9, w0, #12, #6
	strb	w9, [sp, #13]
	mov	w9, #128
	bfxil	w9, w0, #6, #6
	strb	w9, [sp, #14]
	bfxil	w8, w0, #0, #6
	strb	w8, [sp, #15]
	mov	w22, #4
	b	LBB0_9
LBB0_8:
Lloh0:
	adrp	x8, _E_RANGE_ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _E_RANGE_ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x21
	bl	_mrb_raise
	mov	w22, #0
LBB0_9:
	add	x2, x19, w22, uxtw
	mov	x0, x21
	mov	x1, x20
	bl	_str_len_ensure
	bl	_RSTRING_PTR
	add	x0, x0, x19
	add	x1, sp, #12
	mov	x2, x22
	bl	_memcpy
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_E_RANGE_ERROR,4,2              ; @E_RANGE_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pack(U): value out of range"

	.no_dead_strip	_pack_utf8
.subsections_via_symbols
