	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function buffreplace
LCPI0_0:
	.byte	15                              ## 0xf
	.byte	14                              ## 0xe
	.byte	13                              ## 0xd
	.byte	12                              ## 0xc
	.byte	11                              ## 0xb
	.byte	10                              ## 0xa
	.byte	9                               ## 0x9
	.byte	8                               ## 0x8
	.byte	7                               ## 0x7
	.byte	6                               ## 0x6
	.byte	5                               ## 0x5
	.byte	4                               ## 0x4
	.byte	3                               ## 0x3
	.byte	2                               ## 0x2
	.byte	1                               ## 0x1
	.byte	0                               ## 0x0
LCPI0_1:
	.byte	7                               ## 0x7
	.byte	6                               ## 0x6
	.byte	5                               ## 0x5
	.byte	4                               ## 0x4
	.byte	3                               ## 0x3
	.byte	2                               ## 0x2
	.byte	1                               ## 0x1
	.byte	0                               ## 0x0
	.space	1
	.space	1
	.space	1
	.space	1
	.space	1
	.space	1
	.space	1
	.space	1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_buffreplace:                           ## @buffreplace
	.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
	movl	%edx, %ebx
	movl	%esi, %r14d
	movq	%rdi, %r12
	movl	(%rdi), %edi
	callq	_luaZ_bufflen
	movq	%rax, %r15
	movl	(%r12), %edi
	callq	_luaZ_buffer
	testq	%r15, %r15
	je	LBB0_64
## %bb.1:
	cmpq	$8, %r15
	jae	LBB0_2
LBB0_60:
	movq	%r15, %rdx
	jmp	LBB0_61
LBB0_2:
	movzbl	%r14b, %r8d
	cmpq	$16, %r15
	jae	LBB0_23
## %bb.3:
	xorl	%ecx, %ecx
	jmp	LBB0_4
LBB0_23:
	movq	%r15, %rcx
	andq	$-16, %rcx
	movd	%r8d, %xmm0
	pxor	%xmm1, %xmm1
	pshufb	%xmm1, %xmm0
	movq	%rcx, %r9
	negq	%r9
	leaq	(%r15,%rax), %rdi
	addq	$-16, %rdi
	xorl	%edx, %edx
	movdqa	LCPI0_0(%rip), %xmm1            ## xmm1 = [15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0]
	jmp	LBB0_24
	.p2align	4, 0x90
LBB0_56:                                ##   in Loop: Header=BB0_24 Depth=1
	addq	$-16, %rdx
	cmpq	%rdx, %r9
	je	LBB0_57
LBB0_24:                                ## =>This Inner Loop Header: Depth=1
	movdqu	(%rdi,%rdx), %xmm2
	pshufb	%xmm1, %xmm2
	pcmpeqb	%xmm0, %xmm2
	movd	%xmm2, %esi
	testb	$1, %sil
	je	LBB0_26
## %bb.25:                              ##   in Loop: Header=BB0_24 Depth=1
	movb	%bl, 15(%rdi,%rdx)
LBB0_26:                                ##   in Loop: Header=BB0_24 Depth=1
	pextrb	$1, %xmm2, %esi
	testb	$1, %sil
	je	LBB0_28
## %bb.27:                              ##   in Loop: Header=BB0_24 Depth=1
	movb	%bl, 14(%rdi,%rdx)
LBB0_28:                                ##   in Loop: Header=BB0_24 Depth=1
	pextrb	$2, %xmm2, %esi
	testb	$1, %sil
	je	LBB0_30
## %bb.29:                              ##   in Loop: Header=BB0_24 Depth=1
	movb	%bl, 13(%rdi,%rdx)
LBB0_30:                                ##   in Loop: Header=BB0_24 Depth=1
	pextrb	$3, %xmm2, %esi
	testb	$1, %sil
	je	LBB0_32
## %bb.31:                              ##   in Loop: Header=BB0_24 Depth=1
	movb	%bl, 12(%rdi,%rdx)
LBB0_32:                                ##   in Loop: Header=BB0_24 Depth=1
	pextrb	$4, %xmm2, %esi
	testb	$1, %sil
	je	LBB0_34
## %bb.33:                              ##   in Loop: Header=BB0_24 Depth=1
	movb	%bl, 11(%rdi,%rdx)
LBB0_34:                                ##   in Loop: Header=BB0_24 Depth=1
	pextrb	$5, %xmm2, %esi
	testb	$1, %sil
	je	LBB0_36
## %bb.35:                              ##   in Loop: Header=BB0_24 Depth=1
	movb	%bl, 10(%rdi,%rdx)
LBB0_36:                                ##   in Loop: Header=BB0_24 Depth=1
	pextrb	$6, %xmm2, %esi
	testb	$1, %sil
	je	LBB0_38
## %bb.37:                              ##   in Loop: Header=BB0_24 Depth=1
	movb	%bl, 9(%rdi,%rdx)
LBB0_38:                                ##   in Loop: Header=BB0_24 Depth=1
	pextrb	$7, %xmm2, %esi
	testb	$1, %sil
	je	LBB0_40
## %bb.39:                              ##   in Loop: Header=BB0_24 Depth=1
	movb	%bl, 8(%rdi,%rdx)
LBB0_40:                                ##   in Loop: Header=BB0_24 Depth=1
	pextrb	$8, %xmm2, %esi
	testb	$1, %sil
	je	LBB0_42
## %bb.41:                              ##   in Loop: Header=BB0_24 Depth=1
	movb	%bl, 7(%rdi,%rdx)
LBB0_42:                                ##   in Loop: Header=BB0_24 Depth=1
	pextrb	$9, %xmm2, %esi
	testb	$1, %sil
	je	LBB0_44
## %bb.43:                              ##   in Loop: Header=BB0_24 Depth=1
	movb	%bl, 6(%rdi,%rdx)
LBB0_44:                                ##   in Loop: Header=BB0_24 Depth=1
	pextrb	$10, %xmm2, %esi
	testb	$1, %sil
	je	LBB0_46
## %bb.45:                              ##   in Loop: Header=BB0_24 Depth=1
	movb	%bl, 5(%rdi,%rdx)
LBB0_46:                                ##   in Loop: Header=BB0_24 Depth=1
	pextrb	$11, %xmm2, %esi
	testb	$1, %sil
	je	LBB0_48
## %bb.47:                              ##   in Loop: Header=BB0_24 Depth=1
	movb	%bl, 4(%rdi,%rdx)
LBB0_48:                                ##   in Loop: Header=BB0_24 Depth=1
	pextrb	$12, %xmm2, %esi
	testb	$1, %sil
	je	LBB0_50
## %bb.49:                              ##   in Loop: Header=BB0_24 Depth=1
	movb	%bl, 3(%rdi,%rdx)
LBB0_50:                                ##   in Loop: Header=BB0_24 Depth=1
	pextrb	$13, %xmm2, %esi
	testb	$1, %sil
	je	LBB0_52
## %bb.51:                              ##   in Loop: Header=BB0_24 Depth=1
	movb	%bl, 2(%rdi,%rdx)
LBB0_52:                                ##   in Loop: Header=BB0_24 Depth=1
	pextrb	$14, %xmm2, %esi
	testb	$1, %sil
	je	LBB0_54
## %bb.53:                              ##   in Loop: Header=BB0_24 Depth=1
	movb	%bl, 1(%rdi,%rdx)
LBB0_54:                                ##   in Loop: Header=BB0_24 Depth=1
	pextrb	$15, %xmm2, %esi
	testb	$1, %sil
	je	LBB0_56
## %bb.55:                              ##   in Loop: Header=BB0_24 Depth=1
	movb	%bl, (%rdi,%rdx)
	jmp	LBB0_56
LBB0_57:
	cmpq	%rcx, %r15
	je	LBB0_64
## %bb.58:
	testb	$8, %r15b
	jne	LBB0_4
## %bb.59:
	andl	$15, %r15d
	jmp	LBB0_60
LBB0_4:
	movq	%r15, %r9
	andq	$-8, %r9
	movl	%r15d, %edx
	andl	$7, %edx
	movd	%r8d, %xmm0
	punpcklbw	%xmm0, %xmm0            ## xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
	pshuflw	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0,4,5,6,7]
	movq	%r9, %r8
	negq	%r8
	negq	%rcx
	leaq	(%r15,%rax), %rsi
	addq	$-8, %rsi
	movdqa	LCPI0_1(%rip), %xmm1            ## xmm1 = <7,6,5,4,3,2,1,0,u,u,u,u,u,u,u,u>
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_21:                                ##   in Loop: Header=BB0_5 Depth=1
	addq	$-8, %rcx
	cmpq	%rcx, %r8
	je	LBB0_22
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rsi,%rcx), %xmm2              ## xmm2 = mem[0],zero
	pshufb	%xmm1, %xmm2
	pcmpeqb	%xmm0, %xmm2
	movd	%xmm2, %edi
	testb	$1, %dil
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movb	%bl, 7(%rsi,%rcx)
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	pextrb	$1, %xmm2, %edi
	testb	$1, %dil
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movb	%bl, 6(%rsi,%rcx)
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	pextrb	$2, %xmm2, %edi
	testb	$1, %dil
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=1
	movb	%bl, 5(%rsi,%rcx)
LBB0_11:                                ##   in Loop: Header=BB0_5 Depth=1
	pextrb	$3, %xmm2, %edi
	testb	$1, %dil
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_5 Depth=1
	movb	%bl, 4(%rsi,%rcx)
LBB0_13:                                ##   in Loop: Header=BB0_5 Depth=1
	pextrb	$4, %xmm2, %edi
	testb	$1, %dil
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_5 Depth=1
	movb	%bl, 3(%rsi,%rcx)
LBB0_15:                                ##   in Loop: Header=BB0_5 Depth=1
	pextrb	$5, %xmm2, %edi
	testb	$1, %dil
	je	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_5 Depth=1
	movb	%bl, 2(%rsi,%rcx)
LBB0_17:                                ##   in Loop: Header=BB0_5 Depth=1
	pextrb	$6, %xmm2, %edi
	testb	$1, %dil
	je	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_5 Depth=1
	movb	%bl, 1(%rsi,%rcx)
LBB0_19:                                ##   in Loop: Header=BB0_5 Depth=1
	pextrb	$7, %xmm2, %edi
	testb	$1, %dil
	je	LBB0_21
## %bb.20:                              ##   in Loop: Header=BB0_5 Depth=1
	movb	%bl, (%rsi,%rcx)
	jmp	LBB0_21
LBB0_22:
	cmpq	%r9, %r15
	jne	LBB0_61
LBB0_64:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.p2align	4, 0x90
LBB0_63:                                ##   in Loop: Header=BB0_61 Depth=1
	movq	%rcx, %rdx
	testq	%rcx, %rcx
	je	LBB0_64
LBB0_61:                                ## =>This Inner Loop Header: Depth=1
	leaq	-1(%rdx), %rcx
	cmpb	%r14b, -1(%rax,%rdx)
	jne	LBB0_63
## %bb.62:                              ##   in Loop: Header=BB0_61 Depth=1
	movb	%bl, -1(%rax,%rdx)
	jmp	LBB0_63
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_buffreplace
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function buffreplace
_buffreplace:                           ; @buffreplace
	.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, x2
	mov	x20, x1
	mov	x22, x0
	ldr	w0, [x0]
	bl	_luaZ_bufflen
	mov	x21, x0
	ldr	w0, [x22]
	bl	_luaZ_buffer
	cbz	x21, LBB0_5
; %bb.1:
	sub	x8, x0, #1
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x21, x9
	cbz	x9, LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	sub	x9, x21, #1
	ldrb	w10, [x8, x21]
	cmp	w10, w20, uxtb
	b.ne	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	strb	w19, [x8, x21]
	b	LBB0_2
LBB0_5:
	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
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_buffreplace
.subsections_via_symbols
