	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_crtc_add_crc_entry         ## -- Begin function drm_crtc_add_crc_entry
	.p2align	4, 0x90
_drm_crtc_add_crc_entry:                ## @drm_crtc_add_crc_entry
	.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, %r12
	movl	%edx, %r15d
	movl	%esi, %r13d
	movq	%rdi, %rbx
	leaq	20(%rdi), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	cmpq	$0, 24(%rbx)
	je	LBB0_1
## %bb.2:
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %r12d
	movl	4(%rbx), %esi
	movq	_DRM_CRC_ENTRIES_NR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r12d, %edi
	callq	_CIRC_SPACE
	testl	%eax, %eax
	jle	LBB0_3
## %bb.7:
	movslq	%r12d, %rax
	movq	24(%rbx), %rcx
	leaq	(%rax,%rax,2), %rax
	movl	%r15d, 8(%rcx,%rax,4)
	movl	%r13d, (%rcx,%rax,4)
	leaq	(%rcx,%rax,4), %rdi
	addq	$4, %rdi
	movl	12(%rbx), %edx
	shll	$2, %edx
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_memcpy
	incl	%r12d
	movq	_DRM_CRC_ENTRIES_NR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	decl	%eax
	andl	%r12d, %eax
	movl	%eax, (%rbx)
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	addq	$16, %rbx
	movq	%rbx, %rdi
	callq	_wake_up_interruptible
	xorl	%eax, %eax
	jmp	LBB0_8
LBB0_1:
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_6
LBB0_3:
	movl	8(%rbx), %r15d
	movl	$1, 8(%rbx)
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	testl	%r15d, %r15d
	jne	LBB0_5
## %bb.4:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
LBB0_5:
	movq	_ENOBUFS@GOTPCREL(%rip), %rcx
LBB0_6:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_DRM_CRC_ENTRIES_NR,4,2         ## @DRM_CRC_ENTRIES_NR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Overflow of CRC buffer, userspace reads too slow.\n"

	.comm	_ENOBUFS,4,2                    ## @ENOBUFS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_crtc_add_crc_entry         ; -- Begin function drm_crtc_add_crc_entry
	.p2align	2
_drm_crtc_add_crc_entry:                ; @drm_crtc_add_crc_entry
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x21, x3
	mov	x23, x2
	mov	x22, x1
	mov	x20, x0
	add	x19, x0, #20
	mov	x0, x19
	bl	_spin_lock_irqsave
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_3
; %bb.1:
	ldp	w24, w1, [x20]
Lloh0:
	adrp	x25, _DRM_CRC_ENTRIES_NR@GOTPAGE
Lloh1:
	ldr	x25, [x25, _DRM_CRC_ENTRIES_NR@GOTPAGEOFF]
	ldr	w2, [x25]
	mov	x0, x24
	bl	_CIRC_SPACE
	cmp	w0, #0
	b.le	LBB0_4
; %bb.2:
	sxtw	x24, w24
	ldr	x8, [x20, #24]
	mov	w9, #12
	madd	x8, x24, x9, x8
	str	w23, [x8, #8]
	str	w22, [x8]
	add	x0, x8, #4
	ldr	w8, [x20, #12]
	lsl	w2, w8, #2
	mov	x1, x21
	bl	_memcpy
	add	w8, w24, #1
	ldr	w9, [x25]
	sub	w9, w9, #1
	and	w8, w9, w8
	str	w8, [x20]
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	add	x0, x20, #16
	bl	_wake_up_interruptible
	mov	w0, #0
	b	LBB0_8
LBB0_3:
	mov	x0, x19
	bl	_spin_unlock_irqrestore
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_7
LBB0_4:
	ldr	w21, [x20, #8]
	mov	w8, #1
	str	w8, [x20, #8]
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	cbnz	w21, LBB0_6
; %bb.5:
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
LBB0_6:
Lloh6:
	adrp	x8, _ENOBUFS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOBUFS@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_DRM_CRC_ENTRIES_NR,4,2         ; @DRM_CRC_ENTRIES_NR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Overflow of CRC buffer, userspace reads too slow.\n"

	.comm	_ENOBUFS,4,2                    ; @ENOBUFS
.subsections_via_symbols
