	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_utf32toutf8                    ## -- Begin function utf32toutf8
	.p2align	4, 0x90
_utf32toutf8:                           ## @utf32toutf8
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.3:
	movq	%rdi, %r14
	callq	_utf32len
	movl	%eax, %r15d
	leal	1(%r15), %esi
	movl	$4, %edi
	callq	_calloc
	testq	%rax, %rax
	je	LBB0_19
## %bb.4:
	movq	%rax, %r12
	xorl	%edx, %edx
	testl	%r15d, %r15d
	jle	LBB0_17
## %bb.5:
	movl	%r15d, %r8d
	xorl	%edi, %edi
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	movl	$2, %ebx
	movl	$192, %r9d
	movl	$6, %r10d
	movl	%esi, %eax
LBB0_14:                                ##   in Loop: Header=BB0_6 Depth=1
	andl	$63, %eax
	orl	$128, %eax
	movl	%eax, 4(%r12,%rdx,4)
	movl	%r10d, %ecx
	shrl	%cl, %esi
	orl	%r9d, %esi
LBB0_15:                                ##   in Loop: Header=BB0_6 Depth=1
	movl	%esi, (%r12,%rdx,4)
	addl	%ebx, %edx
	incq	%rdi
	cmpq	%rdi, %r8
	je	LBB0_16
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14,%rdi,4), %esi
	movl	$1, %ebx
	movslq	%edx, %rdx
	cmpl	$128, %esi
	jl	LBB0_15
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	cmpl	$2048, %esi                     ## imm = 0x800
	jb	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	cmpl	$65536, %esi                    ## imm = 0x10000
	jae	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=1
	movl	$3, %ebx
	movl	$224, %r9d
	movl	$12, %r10d
	movl	$6, %ecx
	movl	%esi, %eax
	jmp	LBB0_13
LBB0_11:                                ##   in Loop: Header=BB0_6 Depth=1
	cmpl	$2097151, %esi                  ## imm = 0x1FFFFF
	ja	LBB0_20
## %bb.12:                              ##   in Loop: Header=BB0_6 Depth=1
	movl	%esi, %eax
	andl	$63, %eax
	orl	$128, %eax
	movl	%eax, 12(%r12,%rdx,4)
	movl	%esi, %eax
	shrl	$6, %eax
	movl	$4, %ebx
	movl	$240, %r9d
	movl	$18, %r10d
	movl	$12, %ecx
LBB0_13:                                ##   in Loop: Header=BB0_6 Depth=1
	andl	$63, %eax
	orl	$128, %eax
	movl	%eax, 8(%r12,%rdx,4)
	movl	%esi, %eax
                                        ## kill: def $cl killed $cl killed $ecx
	shrl	%cl, %eax
	jmp	LBB0_14
LBB0_1:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_2
LBB0_19:
	leaq	L_.str.1(%rip), %rdi
LBB0_2:
	callq	_eprintf
	xorl	%r12d, %r12d
	jmp	LBB0_18
LBB0_16:
	movslq	%edx, %rdx
LBB0_17:
	movl	$0, (%r12,%rdx,4)
LBB0_18:
	movq	%r12, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	leaq	L_.str.2(%rip), %rdi
	callq	_eprintf
	movq	%r12, %rdi
	callq	_free
	xorl	%r12d, %r12d
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ERROR input is null\n"

L_.str.1:                               ## @.str.1
	.asciz	"ERROR: out of memory\n"

L_.str.2:                               ## @.str.2
	.asciz	"ERROR in toutf8. Seems like input is invalid\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_utf32toutf8                    ; -- Begin function utf32toutf8
	.p2align	2
_utf32toutf8:                           ; @utf32toutf8
	.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
	cbz	x0, LBB0_15
; %bb.1:
	mov	x20, x0
	bl	_utf32len
	mov	x21, x0
	add	w1, w0, #1
	mov	w0, #4
	bl	_calloc
	mov	x19, x0
	cbz	x0, LBB0_16
; %bb.2:
	cmp	w21, #1
	b.lt	LBB0_18
; %bb.3:
	mov	w8, #0
	mov	w9, w21
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	w12, #1
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	str	w10, [x19, w8, sxtw #2]
	add	w8, w8, w12
	add	x20, x20, #4
	subs	x9, x9, #1
	b.eq	LBB0_17
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x20]
	cmp	w10, #128
	b.lt	LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x11, x19, w8, sxtw #2
	cmp	w10, #2048
	b.hs	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	w12, #2
	mov	w13, #192
	mov	w14, #6
	mov	x15, x10
	b	LBB0_14
LBB0_9:                                 ;   in Loop: Header=BB0_6 Depth=1
	cmp	w10, #16, lsl #12               ; =65536
	b.hs	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	w12, #3
	mov	w13, #224
	mov	w14, #12
	mov	w16, #6
	mov	x15, x10
	b	LBB0_13
LBB0_11:                                ;   in Loop: Header=BB0_6 Depth=1
	lsr	w12, w10, #21
	cbnz	w12, LBB0_21
; %bb.12:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	w12, #128
	bfxil	w12, w10, #0, #6
	lsr	w15, w10, #6
	str	w12, [x11, #12]
	mov	w12, #4
	mov	w13, #240
	mov	w14, #18
	mov	w16, #12
LBB0_13:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	w17, #128
	bfxil	w17, w15, #0, #6
	str	w17, [x11, #8]
	lsr	w15, w10, w16
LBB0_14:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	w16, #128
	bfxil	w16, w15, #0, #6
	str	w16, [x11, #4]
	lsr	w10, w10, w14
	orr	w10, w10, w13
	b	LBB0_5
LBB0_15:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_eprintf
	mov	x19, #0
	b	LBB0_20
LBB0_16:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_eprintf
	b	LBB0_20
LBB0_17:
	sxtw	x8, w8
	b	LBB0_19
LBB0_18:
	mov	x8, #0
LBB0_19:
	str	wzr, [x19, x8, lsl #2]
LBB0_20:
	mov	x0, 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
	ret
LBB0_21:
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_eprintf
	mov	x0, x19
	bl	_free
	mov	x19, #0
	b	LBB0_20
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ERROR input is null\n"

l_.str.1:                               ; @.str.1
	.asciz	"ERROR: out of memory\n"

l_.str.2:                               ; @.str.2
	.asciz	"ERROR in toutf8. Seems like input is invalid\n"

.subsections_via_symbols
