	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fxt1_quantize_HI
_fxt1_quantize_HI:                      ## @fxt1_quantize_HI
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r15d
	movq	%rdx, %r13
	movq	%rsi, -88(%rbp)                 ## 8-byte Spill
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_MAX_COMP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	leaq	(,%rax,4), %r12
	movq	%r12, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, -64(%rbp)                 ## 8-byte Spill
	testl	%r15d, %r15d
	jle	LBB0_1
## %bb.2:
	movl	%r15d, %r8d
	leaq	8(%r13), %rcx
	movl	$2000, %edx                     ## imm = 0x7D0
	movl	$-1, %esi
	xorl	%edi, %edi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	-4(%rcx), %ebx
	addl	-8(%rcx), %ebx
	addl	(%rcx), %ebx
	cmpl	%ebx, %edx
	cmovgel	%ebx, %edx
	cmovgl	%edi, %eax
	cmpl	%ebx, %esi
	cmovlel	%ebx, %esi
	cmovll	%edi, %r14d
	incq	%rdi
	addq	%r12, %rcx
	cmpq	%rdi, %r8
	jne	LBB0_3
	jmp	LBB0_4
LBB0_1:
	xorl	%eax, %eax
	xorl	%r14d, %r14d
LBB0_4:
	movslq	%r14d, %r8
	movq	%r8, %r10
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	imulq	%rcx, %r10
	movl	(%r13,%r10,4), %edx
	movl	4(%r13,%r10,4), %edi
	shll	$2, %edx
	andl	$4064, %edx                     ## imm = 0xFE0
	shrl	$3, %edi
	orl	%edx, %edi
	movl	8(%r13,%r10,4), %ebx
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movslq	%eax, %r9
	movq	%r9, %rdx
	imulq	%rcx, %rdx
	shll	$10, %edi
	shll	$2, %ebx
	andl	$4194272, %ebx                  ## imm = 0x3FFFE0
	movl	(%r13,%rdx,4), %ecx
	movl	4(%r13,%rdx,4), %esi
	shrl	$3, %ecx
	orl	%ebx, %ecx
	orl	%edi, %ecx
	shll	$10, %ecx
	shll	$2, %esi
	andl	$-32, %esi
	movl	8(%r13,%rdx,4), %edi
	sarl	$3, %edi
	orl	%esi, %edi
	orl	%ecx, %edi
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movl	%edi, 12(%rcx)
	movl	$0, 8(%rcx)
	movq	$0, (%rcx)
	cmpl	%r8d, %r9d
	je	LBB0_6
## %bb.5:
	leaq	(,%r10,4), %r8
	addq	%r13, %r8
	leaq	(%r13,%rdx,4), %rcx
	xorps	%xmm0, %xmm0
	movl	$6, %edi
	movl	$3, %esi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	callq	_MAKEIVEC
LBB0_6:
	movq	_N_TEXELS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_13
## %bb.7:
	movq	%rax, %r13
	incq	%r13
	leal	(%rax,%rax,2), %r12d
	addl	$-3, %r12d
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_8 Depth=1
	sarl	$3, %r15d
	movl	%r12d, %ecx
	andb	$7, %cl
	movl	$7, %eax
	shll	%cl, %eax
	movslq	%r15d, %rcx
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	orl	%eax, (%rdx,%rcx,4)
LBB0_12:                                ##   in Loop: Header=BB0_8 Depth=1
	decq	%r13
	addl	$-3, %r12d
	cmpq	$1, %r13
	jbe	LBB0_13
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	leal	-2(%r13), %eax
	leal	7(%r12), %r15d
	testl	%r12d, %r12d
	cmovnsl	%r12d, %r15d
	imulq	-80(%rbp), %rax                 ## 8-byte Folded Reload
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rax,4), %rbx
	movq	%rbx, %rdi
	callq	_ISTBLACK
	testl	%eax, %eax
	jne	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	cmpl	%r14d, -52(%rbp)                ## 4-byte Folded Reload
	je	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	xorps	%xmm0, %xmm0
	movl	$7, %edi
	movl	$6, %esi
	movl	$3, %edx
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	%rbx, %r8
	callq	_CALCCDOT
	jmp	LBB0_11
LBB0_13:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_15
## %bb.14:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_N_TEXELS,4,2                   ## @N_TEXELS
	.comm	_MAX_COMP,4,2                   ## @MAX_COMP
	.comm	_BCOMP,8,3                      ## @BCOMP
	.comm	_GCOMP,8,3                      ## @GCOMP
	.comm	_RCOMP,8,3                      ## @RCOMP
	.no_dead_strip	_fxt1_quantize_HI
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fxt1_quantize_HI
_fxt1_quantize_HI:                      ; @fxt1_quantize_HI
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #16
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x8, _MAX_COMP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAX_COMP@GOTPAGEOFF]
Lloh5:
	ldr	w23, [x8]
	lsl	x8, x23, #2
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x10, x8, #15
	and	x10, x10, #0x7fffffff0
	sub	x9, x9, x10
	stur	x9, [x29, #-96]                 ; 8-byte Folded Spill
	mov	sp, x9
	cmp	w3, #1
	b.lt	LBB0_3
; %bb.1:
	mov	x9, #0
	mov	w25, #0
	mov	w24, #0
	add	x10, x2, #8
	mov	w11, #2000
	mov	w12, #-1
	mov	w13, w3
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldp	w14, w15, [x10, #-8]
	ldr	w16, [x10]
	add	w14, w15, w14
	add	w14, w16, w14
	cmp	w11, w14
	csel	w11, w11, w14, lt
	csel	w24, w9, w24, gt
	cmp	w12, w14
	csel	w12, w12, w14, gt
	csel	w25, w9, w25, lt
	add	x9, x9, #1
	add	x10, x10, x8
	cmp	x13, x9
	b.ne	LBB0_2
	b	LBB0_4
LBB0_3:
	mov	w24, #0
	mov	w25, #0
LBB0_4:
	sxtw	x8, w25
	mul	x8, x8, x23
	add	x4, x2, x8, lsl #2
	ldp	w8, w9, [x4]
	lsl	w8, w8, #2
	and	w8, w8, #0xfe0
	orr	w8, w8, w9, lsr #3
	ldr	w9, [x4, #8]
	sxtw	x10, w24
	mul	x10, x10, x23
	add	x3, x2, x10, lsl #2
	lsl	w9, w9, #2
	and	w9, w9, #0x3fffe0
	orr	w8, w9, w8, lsl #10
	ldp	w9, w10, [x3]
	orr	w8, w8, w9, lsr #3
	lsl	w9, w10, #2
	and	w9, w9, #0xffffffe0
	orr	w8, w9, w8, lsl #10
	ldr	w9, [x3, #8]
	orr	w8, w8, w9, asr #3
	stp	wzr, w8, [x20, #8]
	str	xzr, [x20]
	cmp	w24, w25
	b.eq	LBB0_6
; %bb.5:
	movi	d0, #0000000000000000
	mov	w0, #6
	mov	w1, #3
	ldur	x2, [x29, #-96]                 ; 8-byte Folded Reload
	bl	_MAKEIVEC
LBB0_6:
Lloh8:
	adrp	x8, _N_TEXELS@GOTPAGE
Lloh9:
	ldr	x8, [x8, _N_TEXELS@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.7:
	add	x26, x8, #1
	add	w8, w8, w8, lsl #1
	sub	w27, w8, #3
	mov	w28, #7
	b	LBB0_10
LBB0_8:                                 ;   in Loop: Header=BB0_10 Depth=1
	sbfx	x8, x21, #3, #29
	and	w9, w27, #0x7
	lsl	w9, w28, w9
	lsl	x8, x8, #2
	ldr	w10, [x20, x8]
	orr	w9, w10, w9
	str	w9, [x20, x8]
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	sub	x26, x26, #1
	sub	w27, w27, #3
	cmp	x26, #1
	b.ls	LBB0_13
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	sub	w8, w26, #2
	add	w9, w27, #7
	cmp	w27, #0
	csel	w21, w9, w27, lt
	mul	x8, x8, x23
	add	x22, x19, x8, lsl #2
	mov	x0, x22
	bl	_ISTBLACK
	cbnz	w0, LBB0_8
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	cmp	w24, w25
	b.eq	LBB0_9
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=1
	movi	d0, #0000000000000000
	mov	w0, #7
	mov	w1, #6
	mov	w2, #3
	ldur	x3, [x29, #-96]                 ; 8-byte Folded Reload
	mov	x4, x22
	bl	_CALCCDOT
	b	LBB0_8
LBB0_13:
	ldur	x8, [x29, #-88]
Lloh11:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh12:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.14:
	sub	sp, x29, #80
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_15:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_N_TEXELS,4,2                   ; @N_TEXELS
	.comm	_MAX_COMP,4,2                   ; @MAX_COMP
	.comm	_BCOMP,8,3                      ; @BCOMP
	.comm	_GCOMP,8,3                      ; @GCOMP
	.comm	_RCOMP,8,3                      ; @RCOMP
	.no_dead_strip	_fxt1_quantize_HI
.subsections_via_symbols
