	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_write_utf8                     ## -- Begin function write_utf8
	.p2align	4, 0x90
_write_utf8:                            ## @write_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	cmpl	$127, %esi
	jle	LBB0_4
## %bb.1:
	cmpl	$2047, %ebx                     ## imm = 0x7FF
	ja	LBB0_5
## %bb.2:
	movl	%ebx, %esi
	shrl	$6, %esi
	orl	$192, %esi
	jmp	LBB0_3
LBB0_5:
	cmpl	$65535, %ebx                    ## imm = 0xFFFF
	ja	LBB0_8
## %bb.6:
	movl	%ebx, %esi
	shrl	$12, %esi
	orl	$224, %esi
	jmp	LBB0_7
LBB0_8:
	cmpl	$2097151, %ebx                  ## imm = 0x1FFFFF
	ja	LBB0_10
## %bb.9:
	movl	%ebx, %esi
	shrl	$18, %esi
	orl	$240, %esi
	movq	%r14, %rdi
	callq	_buf_write
	movl	%ebx, %esi
	shrl	$12, %esi
	andl	$63, %esi
	orl	$128, %esi
LBB0_7:
	movq	%r14, %rdi
	callq	_buf_write
	movl	%ebx, %esi
	shrl	$6, %esi
	andl	$63, %esi
	orl	$128, %esi
LBB0_3:
	movq	%r14, %rdi
	callq	_buf_write
	andl	$63, %ebx
	orl	$128, %ebx
LBB0_4:
	movq	%r14, %rdi
	movl	%ebx, %esi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_buf_write                      ## TAILCALL
LBB0_10:
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_error                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid UCS character: \\U%08x"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_write_utf8                     ; -- Begin function write_utf8
	.p2align	2
_write_utf8:                            ; @write_utf8
	.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, x1
	mov	x20, x0
	cmp	w1, #127
	b.gt	LBB0_2
; %bb.1:
	mov	x0, x20
	mov	x1, x19
	b	LBB0_9
LBB0_2:
	cmp	w19, #2047
	b.hi	LBB0_4
; %bb.3:
	lsr	w8, w19, #6
	orr	w1, w8, #0xc0
	mov	x0, x20
	bl	_buf_write
	mov	w1, #128
	bfxil	w1, w19, #0, #6
	mov	x0, x20
	b	LBB0_9
LBB0_4:
	lsr	w8, w19, #16
	cbnz	w8, LBB0_6
; %bb.5:
	lsr	w8, w19, #12
	orr	w1, w8, #0xe0
	mov	x0, x20
	bl	_buf_write
	mov	w21, #128
	b	LBB0_8
LBB0_6:
	lsr	w8, w19, #21
	cbnz	w8, LBB0_10
; %bb.7:
	lsr	w8, w19, #18
	orr	w1, w8, #0xf0
	mov	x0, x20
	bl	_buf_write
	mov	w21, #128
	mov	w1, #128
	bfxil	w1, w19, #12, #6
	mov	x0, x20
	bl	_buf_write
LBB0_8:
	mov	w1, #128
	bfxil	w1, w19, #6, #6
	mov	x0, x20
	bl	_buf_write
	bfxil	w21, w19, #0, #6
	mov	x0, x20
	mov	x1, x21
LBB0_9:
	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
	b	_buf_write
LBB0_10:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	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
	b	_error
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid UCS character: \\U%08x"

.subsections_via_symbols
