	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function demunge_buf
LCPI0_0:
	.short	255                             ## 0xff
	.short	255                             ## 0xff
	.short	255                             ## 0xff
	.short	255                             ## 0xff
	.short	255                             ## 0xff
	.short	255                             ## 0xff
	.short	255                             ## 0xff
	.short	255                             ## 0xff
LCPI0_1:
	.byte	1                               ## 0x1
	.byte	3                               ## 0x3
	.byte	5                               ## 0x5
	.byte	7                               ## 0x7
	.byte	9                               ## 0x9
	.byte	11                              ## 0xb
	.byte	13                              ## 0xd
	.byte	15                              ## 0xf
	.space	1
	.space	1
	.space	1
	.space	1
	.space	1
	.space	1
	.space	1
	.space	1
LCPI0_2:
	.space	16,128
LCPI0_3:
	.byte	0                               ## 0x0
	.byte	2                               ## 0x2
	.byte	4                               ## 0x4
	.byte	6                               ## 0x6
	.byte	8                               ## 0x8
	.byte	10                              ## 0xa
	.byte	12                              ## 0xc
	.byte	14                              ## 0xe
	.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
_demunge_buf:                           ## @demunge_buf
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movq	%rsi, %rax
	testl	%edx, %edx
	je	LBB0_21
## %bb.1:
	movl	%edx, %r8d
	leaq	-2(%r8), %rcx
	cmpq	$14, %rcx
	jb	LBB0_2
## %bb.3:
	movq	%rcx, %r10
	shrq	%r10
	movl	%r8d, %edx
	andl	$-2, %edx
	addq	%rdi, %rdx
	cmpq	%rax, %rdx
	jbe	LBB0_5
## %bb.4:
	leaq	(%r10,%rax), %rdx
	incq	%rdx
	cmpq	%rdi, %rdx
	jbe	LBB0_5
LBB0_2:
	xorl	%r11d, %r11d
	movq	%rdi, %r9
LBB0_19:
	addq	%r8, %rdi
	addq	%rax, %r11
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	movzbl	(%r9,%rsi,2), %edx
	movb	%dl, (%r11,%rsi)
	movzbl	1(%r9,%rsi,2), %ecx
	shlb	$7, %cl
	orb	%dl, %cl
	movb	%cl, (%r11,%rsi)
	leaq	(%r9,%rsi,2), %rcx
	addq	$2, %rcx
	incq	%rsi
	cmpq	%rdi, %rcx
	jne	LBB0_20
LBB0_21:
	popq	%rbp
	retq
LBB0_5:
	incq	%r10
	cmpq	$30, %rcx
	jae	LBB0_10
## %bb.6:
	xorl	%r11d, %r11d
	jmp	LBB0_7
LBB0_10:
	movq	%r10, %r11
	andq	$-16, %r11
	leaq	-16(%r11), %rcx
	movq	%rcx, %r9
	shrq	$4, %r9
	incq	%r9
	testq	%rcx, %rcx
	je	LBB0_11
## %bb.12:
	movq	%r9, %rsi
	andq	$-2, %rsi
	xorl	%ecx, %ecx
	movdqa	LCPI0_0(%rip), %xmm0            ## xmm0 = [255,255,255,255,255,255,255,255]
	movdqa	LCPI0_1(%rip), %xmm1            ## xmm1 = <1,3,5,7,9,11,13,15,u,u,u,u,u,u,u,u>
	movdqa	LCPI0_2(%rip), %xmm2            ## xmm2 = [128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128]
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movdqu	(%rdi,%rcx,2), %xmm3
	movdqu	16(%rdi,%rcx,2), %xmm4
	movdqa	%xmm4, %xmm5
	pand	%xmm0, %xmm5
	movdqa	%xmm3, %xmm6
	pand	%xmm0, %xmm6
	packuswb	%xmm5, %xmm6
	pshufb	%xmm1, %xmm4
	pshufb	%xmm1, %xmm3
	punpcklqdq	%xmm4, %xmm3            ## xmm3 = xmm3[0],xmm4[0]
	psllw	$7, %xmm3
	pand	%xmm2, %xmm3
	por	%xmm6, %xmm3
	movdqu	%xmm3, (%rax,%rcx)
	movdqu	32(%rdi,%rcx,2), %xmm3
	movdqu	48(%rdi,%rcx,2), %xmm4
	movdqa	%xmm4, %xmm5
	pand	%xmm0, %xmm5
	movdqa	%xmm3, %xmm6
	pand	%xmm0, %xmm6
	packuswb	%xmm5, %xmm6
	pshufb	%xmm1, %xmm4
	pshufb	%xmm1, %xmm3
	punpcklqdq	%xmm4, %xmm3            ## xmm3 = xmm3[0],xmm4[0]
	psllw	$7, %xmm3
	pand	%xmm2, %xmm3
	por	%xmm6, %xmm3
	movdqu	%xmm3, 16(%rax,%rcx)
	addq	$32, %rcx
	addq	$-2, %rsi
	jne	LBB0_13
## %bb.14:
	testb	$1, %r9b
	je	LBB0_16
LBB0_15:
	movdqu	(%rdi,%rcx,2), %xmm0
	movdqu	16(%rdi,%rcx,2), %xmm1
	movdqa	LCPI0_0(%rip), %xmm2            ## xmm2 = [255,255,255,255,255,255,255,255]
	movdqa	%xmm1, %xmm3
	pand	%xmm2, %xmm3
	pand	%xmm0, %xmm2
	packuswb	%xmm3, %xmm2
	movdqa	LCPI0_1(%rip), %xmm3            ## xmm3 = <1,3,5,7,9,11,13,15,u,u,u,u,u,u,u,u>
	pshufb	%xmm3, %xmm1
	pshufb	%xmm3, %xmm0
	punpcklqdq	%xmm1, %xmm0            ## xmm0 = xmm0[0],xmm1[0]
	psllw	$7, %xmm0
	pand	LCPI0_2(%rip), %xmm0
	por	%xmm2, %xmm0
	movdqu	%xmm0, (%rax,%rcx)
LBB0_16:
	cmpq	%r11, %r10
	je	LBB0_21
## %bb.17:
	testb	$8, %r10b
	jne	LBB0_7
## %bb.18:
	leaq	(%rdi,%r11,2), %r9
	jmp	LBB0_19
LBB0_7:
	movq	%r11, %rsi
	movq	%r10, %r11
	andq	$-8, %r11
	leaq	(%rdi,%r11,2), %r9
	movdqa	LCPI0_3(%rip), %xmm0            ## xmm0 = <0,2,4,6,8,10,12,14,u,u,u,u,u,u,u,u>
	movdqa	LCPI0_1(%rip), %xmm1            ## xmm1 = <1,3,5,7,9,11,13,15,u,u,u,u,u,u,u,u>
	movdqa	LCPI0_2(%rip), %xmm2            ## xmm2 = [128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128]
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	(%rdi,%rsi,2), %xmm3
	movdqa	%xmm3, %xmm4
	pshufb	%xmm0, %xmm4
	pshufb	%xmm1, %xmm3
	psllw	$7, %xmm3
	pand	%xmm2, %xmm3
	por	%xmm4, %xmm3
	movq	%xmm3, (%rax,%rsi)
	addq	$8, %rsi
	cmpq	%rsi, %r11
	jne	LBB0_8
## %bb.9:
	cmpq	%r11, %r10
	jne	LBB0_19
	jmp	LBB0_21
LBB0_11:
	xorl	%ecx, %ecx
	testb	$1, %r9b
	jne	LBB0_15
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_demunge_buf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function demunge_buf
_demunge_buf:                           ; @demunge_buf
	.cfi_startproc
; %bb.0:
	cbz	w2, LBB0_7
; %bb.1:
	mov	w8, w2
	sub	x9, x8, #2
	cmp	x9, #14
	b.lo	LBB0_4
; %bb.2:
	and	x10, x8, #0xfffffffe
	add	x10, x0, x10
	cmp	x10, x1
	b.ls	LBB0_8
; %bb.3:
	add	x10, x1, x9, lsr #1
	add	x10, x10, #1
	cmp	x10, x0
	b.ls	LBB0_8
LBB0_4:
	mov	x9, #0
	mov	x11, x0
LBB0_5:
	add	x8, x0, x8
	add	x9, x1, x9
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldrb	w10, [x11]
	strb	w10, [x9]
	ldrb	w12, [x11, #1]
	orr	w10, w10, w12, lsl #7
	strb	w10, [x9], #1
	add	x11, x11, #2
	cmp	x11, x8
	b.ne	LBB0_6
LBB0_7:
	mov	x0, x1
	ret
LBB0_8:
	lsr	x10, x9, #1
	add	x10, x10, #1
	cmp	x9, #62
	b.hs	LBB0_10
; %bb.9:
	mov	x9, #0
	b	LBB0_14
LBB0_10:
	and	x9, x10, #0xffffffffffffffe0
	add	x11, x1, #16
	add	x12, x0, #32
	mov	x13, x9
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	sub	x14, x12, #32
	ld2.16b	{ v0, v1 }, [x14]
	ld2.16b	{ v2, v3 }, [x12]
	shl.16b	v4, v1, #7
	shl.16b	v5, v3, #7
	orr.16b	v0, v4, v0
	orr.16b	v1, v5, v2
	stp	q0, q1, [x11, #-16]
	add	x11, x11, #32
	add	x12, x12, #64
	subs	x13, x13, #32
	b.ne	LBB0_11
; %bb.12:
	cmp	x10, x9
	b.eq	LBB0_7
; %bb.13:
	tst	x10, #0x18
	b.eq	LBB0_17
LBB0_14:
	mov	x14, x9
	and	x9, x10, #0xfffffffffffffff8
	add	x11, x0, x9, lsl #1
	add	x12, x1, x14
	add	x13, x0, x14, lsl #1
	sub	x14, x14, x9
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ld2.8b	{ v0, v1 }, [x13], #16
	shl.8b	v2, v1, #7
	orr.8b	v0, v2, v0
	str	d0, [x12], #8
	adds	x14, x14, #8
	b.ne	LBB0_15
; %bb.16:
	cmp	x10, x9
	b.ne	LBB0_5
	b	LBB0_7
LBB0_17:
	add	x11, x0, x9, lsl #1
	b	LBB0_5
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_demunge_buf
.subsections_via_symbols
