	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_fb_xrgb8888_to_gray8       ## -- Begin function drm_fb_xrgb8888_to_gray8
	.p2align	4, 0x90
_drm_fb_xrgb8888_to_gray8:              ## @drm_fb_xrgb8888_to_gray8
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r13
	movl	(%rcx), %r14d
	subl	4(%rcx), %r14d
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	8(%rdx), %rax
	movq	(%rax), %rax
	movq	_DRM_FORMAT_XRGB8888@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	setne	%dil
	callq	_WARN_ON
	testq	%rax, %rax
	je	LBB0_1
LBB0_9:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	shll	$2, %r14d
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_9
## %bb.2:
	movq	%rax, %r12
	movl	8(%r13), %r15d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	incl	%r15d
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
	cmpl	12(%r13), %r15d
	jae	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movl	(%rax), %eax
	imull	%r15d, %eax
	addq	-48(%rbp), %rax                 ## 8-byte Folded Reload
	movslq	4(%r13), %rcx
	leaq	(%rax,%rcx,4), %rsi
	movq	%r12, %rdi
	movl	%r14d, %edx
	callq	_memcpy
	movl	4(%r13), %eax
	cmpl	(%r13), %eax
	jae	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %rcx
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%rcx), %edx
	movzbl	%dh, %esi
	movzbl	%dl, %edi
	shrl	$16, %edx
	movzbl	%dl, %edx
	leal	(%rdx,%rdx,2), %edx
	leal	(%rsi,%rsi,2), %esi
	leal	(%rdi,%rsi,2), %esi
	addl	%edx, %esi
	imull	$52429, %esi, %edx              ## imm = 0xCCCD
	shrl	$19, %edx
	movl	%edx, (%rbx)
	addq	$4, %rbx
	addq	$4, %rcx
	incl	%eax
	cmpl	(%r13), %eax
	jb	LBB0_6
	jmp	LBB0_7
LBB0_8:
	movq	%r12, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_kfree                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_DRM_FORMAT_XRGB8888,8,3        ## @DRM_FORMAT_XRGB8888
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_fb_xrgb8888_to_gray8       ; -- Begin function drm_fb_xrgb8888_to_gray8
	.p2align	2
_drm_fb_xrgb8888_to_gray8:              ; @drm_fb_xrgb8888_to_gray8
	.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
	mov	x19, x3
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
	ldp	w23, w24, [x3]
	ldr	x8, [x2, #8]
	ldr	x8, [x8]
Lloh0:
	adrp	x9, _DRM_FORMAT_XRGB8888@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DRM_FORMAT_XRGB8888@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, ne
	bl	_WARN_ON
	cbz	x0, LBB0_2
LBB0_1:
	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_2:
	sub	w8, w23, w24
	lsl	w23, w8, #2
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_kmalloc
	cbz	x0, LBB0_1
; %bb.3:
	mov	x24, x0
	ldp	w25, w8, [x19, #8]
	cmp	w25, w8
	b.hs	LBB0_9
; %bb.4:
	mov	w26, #6
	mov	w27, #52429
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	w25, w25, #1
	ldr	w8, [x19, #12]
	cmp	w25, w8
	b.hs	LBB0_9
LBB0_6:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
	ldr	x8, [x20]
	ldr	w8, [x8]
	mul	w8, w8, w25
	add	x8, x21, x8
	ldrsw	x9, [x19, #4]
	add	x1, x8, x9, lsl #2
	mov	x0, x24
	mov	x2, x23
	bl	_memcpy
	ldp	w9, w8, [x19]
	cmp	w8, w9
	b.hs	LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x9, x24
LBB0_8:                                 ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w10, [x9], #4
	lsr	w11, w10, #16
	ubfx	w12, w10, #16, #8
	ubfx	w13, w10, #8, #8
	add	w11, w12, w11, uxtb #1
	mul	w12, w13, w26
	add	w10, w12, w10, uxtb
	add	w10, w10, w11
	mul	w10, w10, w27
	lsr	w10, w10, #19
	str	w10, [x22], #4
	add	w8, w8, #1
	ldr	w10, [x19]
	cmp	w8, w10
	b.lo	LBB0_8
	b	LBB0_5
LBB0_9:
	mov	x0, x24
	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
	b	_kfree
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_DRM_FORMAT_XRGB8888,8,3        ; @DRM_FORMAT_XRGB8888
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
.subsections_via_symbols
