	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function st7586_xrgb8888_to_gray332
_st7586_xrgb8888_to_gray332:            ## @st7586_xrgb8888_to_gray332
	.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
	movq	%rcx, %r15
	movq	(%rcx), %rcx
	movq	16(%r15), %rax
	subq	8(%r15), %rcx
	subq	24(%r15), %rax
	movq	%rdx, %r12
	movq	%rsi, %r13
	movq	%rdi, %rbx
	imulq	%rcx, %rax
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%rax, %rdi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	movq	%rax, %r14
	movq	%rax, %rdi
	movq	%r13, %rsi
	movq	%r12, %rdx
	movq	%r15, %rcx
	callq	_drm_fb_xrgb8888_to_gray8
	movl	24(%r15), %r11d
	movq	16(%r15), %r10
	cmpq	%r11, %r10
	jbe	LBB0_7
## %bb.2:
	movq	(%r15), %r12
	movq	8(%r15), %r8
	movl	%r8d, %r9d
	movq	_st7586_lookup@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	addl	$3, %r8d
	movq	%r14, %rdi
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	incl	%r11d
	cmpq	%r11, %r10
	jbe	LBB0_7
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
	cmpq	%r9, %r12
	jbe	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%r8d, %ecx
	.p2align	4, 0x90
LBB0_5:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%rdi), %eax
	movl	4(%rdi), %edx
	sarl	$6, %eax
	cltq
	movl	(%rsi,%rax,4), %eax
	shll	$5, %eax
	sarl	$6, %edx
	movslq	%edx, %rdx
	movl	(%rsi,%rdx,4), %edx
	shll	$2, %edx
	orl	%eax, %edx
	movl	8(%rdi), %eax
	addq	$12, %rdi
	sarl	$6, %eax
	cltq
	movl	(%rsi,%rax,4), %eax
	sarl	%eax
	orl	%edx, %eax
	movl	%eax, (%rbx)
	addq	$4, %rbx
	movl	%ecx, %eax
	addl	$3, %ecx
	cmpq	%rax, %r12
	ja	LBB0_5
	jmp	LBB0_6
LBB0_7:
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_kfree                          ## TAILCALL
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_st7586_lookup,8,3              ## @st7586_lookup
	.no_dead_strip	_st7586_xrgb8888_to_gray332
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function st7586_xrgb8888_to_gray332
_st7586_xrgb8888_to_gray332:            ; @st7586_xrgb8888_to_gray332
	.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	x21, x3
	mov	x22, x2
	mov	x23, x1
	mov	x19, x0
	ldp	x8, x9, [x3]
	sub	x8, x8, x9
	ldp	x9, x10, [x3, #16]
	sub	x9, x9, x10
	mul	x0, x9, x8
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_kmalloc
	cbz	x0, LBB0_9
; %bb.1:
	mov	x20, x0
	mov	x1, x23
	mov	x2, x22
	mov	x3, x21
	bl	_drm_fb_xrgb8888_to_gray8
	ldr	w13, [x21, #24]
	ldr	x8, [x21, #16]
	cmp	x8, x13
	b.ls	LBB0_8
; %bb.2:
	ldp	x9, x12, [x21]
	and	x10, x12, #0xffffffff
Lloh3:
	adrp	x11, _st7586_lookup@GOTPAGE
Lloh4:
	ldr	x11, [x11, _st7586_lookup@GOTPAGEOFF]
Lloh5:
	ldr	x11, [x11]
	add	w12, w12, #3
	mov	x14, x20
                                        ; kill: def $w13 killed $w13 killed $x13 def $x13
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w13, w13, #1
	cmp	x8, x13
	b.ls	LBB0_8
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
	cmp	x9, x10
	b.ls	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x15, x12
LBB0_6:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldp	w16, w17, [x14]
	asr	w16, w16, #6
	ldr	w16, [x11, w16, sxtw #2]
	asr	w17, w17, #6
	ldr	w17, [x11, w17, sxtw #2]
	lsl	w17, w17, #2
	orr	w17, w17, w16, lsl #5
	add	x16, x14, #12
	ldr	w14, [x14, #8]
	asr	w14, w14, #6
	ldr	w14, [x11, w14, sxtw #2]
	orr	w14, w17, w14, asr #1
	str	w14, [x19], #4
	cmp	x9, w15, uxtw
	add	w15, w15, #3
	mov	x14, x16
	b.hi	LBB0_6
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x14, x16
	b	LBB0_3
LBB0_8:
	mov	x0, x20
	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
	b	_kfree
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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_st7586_lookup,8,3              ; @st7586_lookup
	.no_dead_strip	_st7586_xrgb8888_to_gray332
.subsections_via_symbols
