	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function encode_string
_encode_string:                         ## @encode_string
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdx, %rdx
	je	LBB0_1
## %bb.2:
	movl	%ecx, %r15d
	movq	%rdx, %r12
	movq	%rdi, %rbx
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	leal	(,%r15,8), %r14d
	movl	%r14d, %edi
	callq	_get_encode_size
	movl	%eax, %r13d
	xorl	%eax, %eax
	cmpl	$255, %r13d
	jg	LBB0_11
## %bb.3:
	movb	%r13b, (%rbx)
	testl	%r13d, %r13d
	jle	LBB0_9
## %bb.4:
	movl	%r13d, %eax
	leaq	-1(%rax), %rcx
	movq	%rax, %rdx
	andq	$3, %rdx
	je	LBB0_6
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movb	%r14b, (%rbx,%rax)
	sarl	$8, %r14d
	decq	%rax
	decq	%rdx
	jne	LBB0_5
LBB0_6:
	cmpq	$3, %rcx
	jb	LBB0_9
## %bb.7:
	incq	%rax
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r14d, %ecx
	bswapl	%ecx
	movl	%ecx, -4(%rbx,%rax)
	sarl	$31, %r14d
	addq	$-4, %rax
	cmpq	$1, %rax
	ja	LBB0_8
LBB0_9:
	movslq	%r13d, %rax
	leaq	(%rbx,%rax), %rdi
	incq	%rdi
	movq	%r12, %rsi
	movl	%r15d, %edx
	callq	_memcpy
	leal	(%r15,%r13), %eax
	incl	%eax
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	jmp	LBB0_10
LBB0_1:
	xorl	%eax, %eax
LBB0_10:
	movl	%eax, (%rsi)
	movl	$1, %eax
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_encode_string
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function encode_string
_encode_string:                         ; @encode_string
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x1
	cbz	x2, LBB0_3
; %bb.1:
	mov	x20, x3
	mov	x21, x2
	mov	x22, x0
	lsl	w24, w3, #3
	mov	x0, x24
	bl	_get_encode_size
	cmp	w0, #255
	b.le	LBB0_4
; %bb.2:
	mov	w0, #0
	b	LBB0_9
LBB0_3:
	mov	w8, #0
	b	LBB0_8
LBB0_4:
	mov	x23, x0
	strb	w0, [x22]
	cmp	w0, #1
	b.lt	LBB0_7
; %bb.5:
	mov	w8, w23
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	strb	w24, [x22, x8]
	asr	w24, w24, #8
	subs	x8, x8, #1
	b.hi	LBB0_6
LBB0_7:
	add	x8, x22, w23, sxtw
	add	x0, x8, #1
	mov	x1, x21
	mov	x2, x20
	bl	_memcpy
	add	w8, w20, w23
	add	w8, w8, #1
LBB0_8:
	str	w8, [x19]
	mov	w0, #1
LBB0_9:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_encode_string
.subsections_via_symbols
