	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function chi_to_channel
_chi_to_channel:                        ## @chi_to_channel
	.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	%rsi, %rsi
	je	LBB0_2
## %bb.1:
	movl	$0, (%rsi)
LBB0_2:
	movslq	(%rdi), %r10
	movl	$255, %eax
	testq	%r10, %r10
	je	LBB0_89
## %bb.3:
	movl	%r10d, %r12d
	movl	4(%rdi), %r9d
	testb	$32, %r9b
	jne	LBB0_14
## %bb.4:
	movl	$1, %ecx
	cmpl	$2, %r10d
	jl	LBB0_10
## %bb.5:
	testb	$-128, %r9b
	jne	LBB0_10
## %bb.6:
	movl	$2, %eax
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%rax, %r12
	je	LBB0_11
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	leaq	1(%rax), %rcx
	testb	$-128, (%rdi,%rax,4)
	movq	%rcx, %rax
	je	LBB0_7
## %bb.9:
	decl	%ecx
LBB0_10:
	movl	$254, %eax
	cmpl	%r12d, %ecx
	jne	LBB0_89
LBB0_11:
	movl	$254, %eax
	testb	$-128, (%rdi,%r12,4)
	je	LBB0_89
## %bb.12:
	movl	%r9d, %ecx
	orl	$152, %ecx
	addl	$-152, %ecx
	cmpl	$4, %ecx
	ja	LBB0_89
## %bb.13:
	shll	$3, %r9d
	andl	$64, %r9d
	xorl	%eax, %eax
	leaq	LJTI0_0(%rip), %rdx
	movslq	(%rdx,%rcx,4), %rcx
	addq	%rdx, %rcx
	jmpq	*%rcx
LBB0_81:
	testq	%rsi, %rsi
	je	LBB0_83
## %bb.82:
	movl	$2, (%rsi)
LBB0_83:
	orl	$1, %r9d
	movl	%r9d, %eax
	jmp	LBB0_89
LBB0_14:
	cmpl	$1, %r12d
	jne	LBB0_16
## %bb.15:
	movl	$253, %eax
	cmpl	$172, %r9d
	je	LBB0_89
LBB0_16:
	movl	$1, %ebx
	cmpl	$2, %r12d
	jl	LBB0_22
## %bb.17:
	movl	$1, %ebx
	testb	$-128, %r9b
	jne	LBB0_22
## %bb.18:
	movl	$2, %eax
	subq	%r12, %rax
	movl	$1, %ecx
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	leaq	(%rax,%rcx), %rdx
	cmpq	$1, %rdx
	je	LBB0_20
## %bb.21:                              ##   in Loop: Header=BB0_19 Depth=1
	leaq	1(%rcx), %rbx
	testb	$-128, 4(%rdi,%rcx,4)
	movq	%rbx, %rcx
	je	LBB0_19
LBB0_22:
	movl	$254, %eax
	cmpl	%r12d, %ebx
	je	LBB0_89
## %bb.23:
	movl	%ebx, %ecx
	testb	$-128, (%rdi,%rcx,4)
	je	LBB0_89
## %bb.24:
	movl	%r9d, %edx
	andl	$-201, %edx
	cmpl	$33, %edx
	jne	LBB0_89
## %bb.25:
	testb	$64, %r9b
	je	LBB0_32
## %bb.26:
	incl	%ebx
	cmpl	%ebx, %r12d
	cmovgl	%r12d, %ebx
	.p2align	4, 0x90
LBB0_27:                                ## =>This Inner Loop Header: Depth=1
	leal	1(%rcx), %edx
	cmpl	%edx, %r10d
	jle	LBB0_30
## %bb.28:                              ##   in Loop: Header=BB0_27 Depth=1
	leaq	1(%rcx), %rdx
	testb	$-128, 4(%rdi,%rcx,4)
	movq	%rdx, %rcx
	je	LBB0_27
## %bb.29:
	movl	%edx, %ebx
LBB0_30:
	cmpl	%r12d, %ebx
	je	LBB0_89
## %bb.31:
	movl	%ebx, %ecx
	testb	$-128, (%rdi,%rcx,4)
	je	LBB0_89
LBB0_32:
	incl	%ebx
	movl	%ebx, %ecx
	cmpl	%ebx, %r12d
	jle	LBB0_36
## %bb.33:
	movslq	%ebx, %rcx
	leaq	(%rdi,%rcx,4), %rdx
	movl	%ebx, %ecx
LBB0_34:                                ## =>This Inner Loop Header: Depth=1
	testb	$-128, (%rdx)
	jne	LBB0_36
## %bb.35:                              ##   in Loop: Header=BB0_34 Depth=1
	incl	%ecx
	addq	$4, %rdx
	cmpl	%ecx, %r12d
	jne	LBB0_34
	jmp	LBB0_89
LBB0_20:
	movl	$254, %eax
	jmp	LBB0_89
LBB0_36:
	cmpl	%r12d, %ecx
	je	LBB0_89
## %bb.37:
	movslq	%ecx, %r15
	testb	$-128, (%rdi,%r15,4)
	je	LBB0_89
## %bb.38:
	movslq	%ebx, %r14
	movl	(%rdi,%r14,4), %r8d
	movl	%r8d, %edx
	andl	$-209, %edx
	cmpl	$3, %edx
	jne	LBB0_89
## %bb.39:
	testb	$16, %r8b
	jne	LBB0_40
## %bb.67:
	leal	1(%rcx), %edx
	movl	4(%rdi,%r15,4), %r10d
	movl	%r10d, %r8d
	andl	$63, %r8d
	testq	%rsi, %rsi
	je	LBB0_73
## %bb.68:
	movl	%r12d, %ebx
	subl	%edx, %ebx
	cmpl	$30, %ebx
	jg	LBB0_89
## %bb.69:
	xorl	%r11d, %r11d
	cmpl	%ecx, %r12d
	jle	LBB0_76
## %bb.70:
	leaq	(%rdi,%r15,4), %rdi
	addq	$4, %rdi
	subl	%ecx, %r12d
	xorl	%ebx, %ebx
	xorl	%r11d, %r11d
LBB0_71:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rdi,%rbx,4), %ecx
	andl	$127, %ecx
	cmpl	$31, %ecx
	ja	LBB0_89
## %bb.72:                              ##   in Loop: Header=BB0_71 Depth=1
	movl	$1, %edx
                                        ## kill: def $cl killed $cl killed $rcx
	shlq	%cl, %rdx
	orl	%edx, %r11d
	incq	%rbx
	cmpl	%ebx, %r12d
	jne	LBB0_71
	jmp	LBB0_76
LBB0_84:
	testq	%rsi, %rsi
	je	LBB0_86
## %bb.85:
	movl	$4, (%rsi)
LBB0_86:
	orl	$2, %r9d
	movl	%r9d, %eax
	jmp	LBB0_89
LBB0_87:
	movl	$255, %eax
	jmp	LBB0_89
LBB0_88:
	movl	$253, %eax
LBB0_89:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_40:
	movl	%r10d, %edx
	subl	%ebx, %edx
	xorl	%r11d, %r11d
	movl	$0, %ecx
	cmpl	$4, %edx
	je	LBB0_43
## %bb.41:
	cmpl	$3, %edx
	jne	LBB0_89
## %bb.42:
	movl	$1, %ecx
LBB0_43:
	movl	$0, %r8d
	cmpl	%ebx, %r10d
	jle	LBB0_66
## %bb.44:
	leaq	1(%r14), %rdx
	movl	4(%rdi,%r14,4), %r11d
	testl	%r11d, %r11d
	je	LBB0_45
## %bb.46:
	movl	$-1, %r8d
LBB0_47:                                ## =>This Inner Loop Header: Depth=1
	incl	%r8d
	btl	%r8d, %r11d
	jae	LBB0_47
	jmp	LBB0_48
LBB0_73:
	cmpl	%edx, %r12d
	jne	LBB0_89
## %bb.74:
	cmpl	$31, %r8d
	ja	LBB0_89
## %bb.75:
	movl	$1, %r11d
	movl	%r8d, %ecx
	shlq	%cl, %r11
LBB0_76:
	testb	$64, %r10b
	jne	LBB0_89
	jmp	LBB0_77
LBB0_45:
	movl	$8, %r8d
	xorl	%r11d, %r11d
LBB0_48:
	cmpq	%r10, %rdx
	jge	LBB0_66
## %bb.49:
	leaq	2(%r14), %rdx
	shll	$8, %r11d
	movl	8(%rdi,%r14,4), %ebx
	testl	%ebx, %ebx
	je	LBB0_50
## %bb.51:
	movl	$-1, %r8d
LBB0_52:                                ## =>This Inner Loop Header: Depth=1
	incl	%r8d
	btl	%r8d, %ebx
	jae	LBB0_52
## %bb.53:
	orl	%ebx, %r11d
	jmp	LBB0_54
LBB0_50:
	addl	$8, %r8d
LBB0_54:
	cmpq	%r10, %rdx
	jge	LBB0_66
## %bb.55:
	leaq	3(%r14), %rdx
	shll	$8, %r11d
	movl	12(%rdi,%r14,4), %ebx
	testl	%ebx, %ebx
	je	LBB0_56
## %bb.57:
	movl	$-1, %r8d
LBB0_58:                                ## =>This Inner Loop Header: Depth=1
	incl	%r8d
	btl	%r8d, %ebx
	jae	LBB0_58
## %bb.59:
	orl	%ebx, %r11d
	jmp	LBB0_60
LBB0_56:
	addl	$8, %r8d
LBB0_60:
	cmpq	%r10, %rdx
	jge	LBB0_66
## %bb.61:
	shll	$8, %r11d
	movl	16(%rdi,%r14,4), %edx
	testl	%edx, %edx
	je	LBB0_62
## %bb.63:
	movl	$-1, %r8d
LBB0_64:                                ## =>This Inner Loop Header: Depth=1
	incl	%r8d
	btl	%r8d, %edx
	jae	LBB0_64
## %bb.65:
	orl	%edx, %r11d
	jmp	LBB0_66
LBB0_62:
	addl	$8, %r8d
LBB0_66:
	addl	%ecx, %r8d
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %r11d
LBB0_77:
	testq	%rsi, %rsi
	je	LBB0_79
## %bb.78:
	movl	%r11d, (%rsi)
	jmp	LBB0_80
LBB0_79:
	movl	$1, %edx
	movl	%r8d, %ecx
	shlq	%cl, %rdx
	cmpl	%edx, %r11d
	jne	LBB0_89
LBB0_80:
	shll	$3, %r9d
	andl	$64, %r9d
	orl	%r9d, %r8d
	movl	%r8d, %eax
	jmp	LBB0_89
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_89, LBB0_89-LJTI0_0
.set L0_0_set_81, LBB0_81-LJTI0_0
.set L0_0_set_84, LBB0_84-LJTI0_0
.set L0_0_set_87, LBB0_87-LJTI0_0
.set L0_0_set_88, LBB0_88-LJTI0_0
LJTI0_0:
	.long	L0_0_set_89
	.long	L0_0_set_81
	.long	L0_0_set_84
	.long	L0_0_set_87
	.long	L0_0_set_88
	.end_data_region
                                        ## -- End function
	.no_dead_strip	_chi_to_channel
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function chi_to_channel
_chi_to_channel:                        ; @chi_to_channel
	.cfi_startproc
; %bb.0:
	cbz	x1, LBB0_2
; %bb.1:
	str	wzr, [x1]
LBB0_2:
	ldrsw	x10, [x0]
	cbz	w10, LBB0_20
; %bb.3:
	and	x11, x10, #0xffffffff
	ldr	w9, [x0, #4]
	tbnz	w9, #5, LBB0_10
; %bb.4:
	cmp	w10, #2
	b.lt	LBB0_13
; %bb.5:
	tbnz	w9, #7, LBB0_13
; %bb.6:
	mov	w8, #2
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	cmp	x11, x8
	b.eq	LBB0_14
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w10, [x0, x8, lsl #2]
	add	x8, x8, #1
	tbz	w10, #7, LBB0_7
; %bb.9:
	sub	w8, w8, #1
	cmp	w8, w11
	b.eq	LBB0_14
	b	LBB0_28
LBB0_10:
	cmp	w11, #1
	b.ne	LBB0_21
; %bb.11:
	cmp	w9, #172
	b.ne	LBB0_21
LBB0_12:
	mov	w0, #253
	ret
LBB0_13:
	mov	w8, #1
	cmp	w8, w11
	b.ne	LBB0_28
LBB0_14:
	ldr	w8, [x0, x11, lsl #2]
	tbz	w8, #7, LBB0_28
; %bb.15:
	mov	w8, #152
	orr	w8, w9, w8
	sub	w10, w8, #152
	cmp	w10, #4
	b.hi	LBB0_28
; %bb.16:
	mov	w8, #0
	lsl	w9, w9, #3
	and	w9, w9, #0x40
Lloh0:
	adrp	x11, lJTI0_0@PAGE
Lloh1:
	add	x11, x11, lJTI0_0@PAGEOFF
	adr	x12, LBB0_12
	ldrb	w13, [x11, x10]
	add	x12, x12, x13, lsl #2
	br	x12
LBB0_17:
	cbz	x1, LBB0_19
; %bb.18:
	mov	w8, #2
	str	w8, [x1]
LBB0_19:
	orr	w0, w9, #0x1
	ret
LBB0_20:
	mov	w0, #255
	ret
LBB0_21:
	cmp	w11, #2
	b.lt	LBB0_27
; %bb.22:
	tbnz	w9, #7, LBB0_27
; %bb.23:
	mov	w8, #2
LBB0_24:                                ; =>This Inner Loop Header: Depth=1
	cmp	x11, x8
	b.eq	LBB0_28
; %bb.25:                               ;   in Loop: Header=BB0_24 Depth=1
	ldr	w12, [x0, x8, lsl #2]
	add	x8, x8, #1
	tbz	w12, #7, LBB0_24
; %bb.26:
	sub	x12, x8, #1
	cmp	w12, w11
	b.ne	LBB0_30
	b	LBB0_28
LBB0_27:
	mov	w12, #1
	cmp	w12, w11
	b.ne	LBB0_30
LBB0_28:
	mov	w8, #254
LBB0_29:
	mov	x0, x8
	ret
LBB0_30:
	ldr	w13, [x0, w12, uxtw #2]
	mov	w8, #254
	tbz	w13, #7, LBB0_29
; %bb.31:
	mov	w13, #-201
	and	w13, w9, w13
	cmp	w13, #33
	b.ne	LBB0_29
; %bb.32:
	tbz	w9, #6, LBB0_39
; %bb.33:
	mov	w8, w12
	add	w13, w12, #1
	cmp	w11, w13
	csinc	w12, w11, w12, gt
	add	x13, x0, #4
LBB0_34:                                ; =>This Inner Loop Header: Depth=1
	add	w14, w8, #1
	cmp	w10, w14
	b.le	LBB0_37
; %bb.35:                               ;   in Loop: Header=BB0_34 Depth=1
	ldr	w14, [x13, x8, lsl #2]
	add	x8, x8, #1
	tbz	w14, #7, LBB0_34
; %bb.36:
	mov	x12, x8
LBB0_37:
	cmp	w12, w11
	b.eq	LBB0_28
; %bb.38:
	ldr	w8, [x0, w12, uxtw #2]
	tbz	w8, #7, LBB0_28
LBB0_39:
	add	w12, w12, #1
	mov	x13, x12
	cmp	w11, w12
	b.le	LBB0_43
; %bb.40:
	add	x14, x0, w12, sxtw #2
	mov	x13, x12
LBB0_41:                                ; =>This Inner Loop Header: Depth=1
	ldrb	w8, [x14]
	tbnz	w8, #7, LBB0_43
; %bb.42:                               ;   in Loop: Header=BB0_41 Depth=1
	add	w13, w13, #1
	add	x14, x14, #4
	mov	w8, #254
	cmp	w11, w13
	b.ne	LBB0_41
	b	LBB0_29
LBB0_43:
	cmp	w13, w11
	b.eq	LBB0_28
; %bb.44:
	ldr	w8, [x0, w13, sxtw #2]
	tbz	w8, #7, LBB0_28
; %bb.45:
	ldr	w8, [x0, w12, sxtw #2]
	mov	w14, #-209
	and	w14, w8, w14
	cmp	w14, #3
	b.ne	LBB0_28
; %bb.46:
	tbnz	w8, #4, LBB0_56
; %bb.47:
	sxtw	x14, w13
	add	x15, x14, #1
	ldr	w12, [x0, x15, lsl #2]
	and	x10, x12, #0x3f
	cbz	x1, LBB0_59
; %bb.48:
	sub	w8, w11, w15
	cmp	w8, #30
	b.gt	LBB0_28
; %bb.49:
	cmp	w11, w13
	b.le	LBB0_68
; %bb.50:
	mov	w8, #0
	add	x14, x0, x14, lsl #2
	add	x14, x14, #4
	sub	w11, w11, w13
	mov	w13, #1
LBB0_51:                                ; =>This Inner Loop Header: Depth=1
	ldr	w15, [x14]
	and	x15, x15, #0x7f
	cmp	w15, #31
	b.hi	LBB0_28
; %bb.52:                               ;   in Loop: Header=BB0_51 Depth=1
	lsl	x15, x13, x15
	orr	w8, w8, w15
	add	x14, x14, #4
	subs	w11, w11, #1
	b.ne	LBB0_51
	b	LBB0_69
LBB0_53:
	cbz	x1, LBB0_55
; %bb.54:
	mov	w8, #4
	str	w8, [x1]
LBB0_55:
	orr	w0, w9, #0x2
	ret
LBB0_56:
	sub	w8, w10, w12
	cmp	w8, #4
	b.eq	LBB0_62
; %bb.57:
	cmp	w8, #3
	b.ne	LBB0_28
; %bb.58:
	mov	w8, #1
	b	LBB0_63
LBB0_59:
	mov	w8, #254
	cmp	w11, w15
	b.ne	LBB0_29
; %bb.60:
	cmp	w10, #31
	b.hi	LBB0_29
; %bb.61:
	mov	w8, #1
	lsl	x8, x8, x10
	b	LBB0_69
LBB0_62:
	mov	w8, #0
LBB0_63:
	cmp	w10, w12
	b.le	LBB0_67
; %bb.64:
	sxtw	x13, w12
	add	x14, x13, #1
	ldr	w11, [x0, x14, lsl #2]
	cbz	w11, LBB0_70
; %bb.65:
	mov	w12, #-1
LBB0_66:                                ; =>This Inner Loop Header: Depth=1
	add	w12, w12, #1
	lsr	w15, w11, w12
	tbz	w15, #0, LBB0_66
	b	LBB0_71
LBB0_67:
	mov	w11, #0
	mov	w12, #0
	b	LBB0_89
LBB0_68:
	mov	w8, #0
LBB0_69:
	tbz	w12, #6, LBB0_90
	b	LBB0_28
LBB0_70:
	mov	w12, #8
LBB0_71:
	cmp	x14, x10
	b.ge	LBB0_89
; %bb.72:
	add	x14, x13, #2
	lsl	w11, w11, #8
	ldr	w15, [x0, x14, lsl #2]
	cbz	w15, LBB0_76
; %bb.73:
	mov	w12, #-1
LBB0_74:                                ; =>This Inner Loop Header: Depth=1
	add	w12, w12, #1
	lsr	w16, w15, w12
	tbz	w16, #0, LBB0_74
; %bb.75:
	orr	w11, w15, w11
	b	LBB0_77
LBB0_76:
	add	w12, w12, #8
LBB0_77:
	cmp	x14, x10
	b.ge	LBB0_89
; %bb.78:
	add	x14, x13, #3
	lsl	w11, w11, #8
	ldr	w15, [x0, x14, lsl #2]
	cbz	w15, LBB0_82
; %bb.79:
	mov	w12, #-1
LBB0_80:                                ; =>This Inner Loop Header: Depth=1
	add	w12, w12, #1
	lsr	w16, w15, w12
	tbz	w16, #0, LBB0_80
; %bb.81:
	orr	w11, w15, w11
	b	LBB0_83
LBB0_82:
	add	w12, w12, #8
LBB0_83:
	cmp	x14, x10
	b.ge	LBB0_89
; %bb.84:
	lsl	w11, w11, #8
	add	x10, x0, x13, lsl #2
	ldr	w10, [x10, #16]
	cbz	w10, LBB0_88
; %bb.85:
	mov	w12, #-1
LBB0_86:                                ; =>This Inner Loop Header: Depth=1
	add	w12, w12, #1
	lsr	w13, w10, w12
	tbz	w13, #0, LBB0_86
; %bb.87:
	orr	w11, w10, w11
	b	LBB0_89
LBB0_88:
	add	w12, w12, #8
LBB0_89:
	add	w10, w12, w8
	lsl	w8, w11, w8
LBB0_90:
	cbz	x1, LBB0_92
; %bb.91:
	str	w8, [x1]
	b	LBB0_93
LBB0_92:
	mov	w11, #1
	lsl	x11, x11, x10
	cmp	w8, w11
	b.ne	LBB0_28
LBB0_93:
	lsl	w8, w9, #3
	and	w8, w8, #0x40
	orr	w0, w10, w8
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_29-LBB0_12)>>2
	.byte	(LBB0_17-LBB0_12)>>2
	.byte	(LBB0_53-LBB0_12)>>2
	.byte	(LBB0_20-LBB0_12)>>2
	.byte	(LBB0_12-LBB0_12)>>2
                                        ; -- End function
	.no_dead_strip	_chi_to_channel
.subsections_via_symbols
