	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_fb_helper_setcmap          ## -- Begin function drm_fb_helper_setcmap
	.p2align	4, 0x90
_drm_fb_helper_setcmap:                 ## @drm_fb_helper_setcmap
	.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	_oops_in_progress@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_2:
	movq	%rsi, %rbx
	movq	%rdi, %r13
	movq	8(%rsi), %r12
	movq	8(%r12), %r14
	movq	%r12, %rdi
	callq	_mutex_lock
	movq	%r14, %rdi
	callq	_drm_master_internal_acquire
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	leaq	4(%r12), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	(%rbx), %rax
	movq	_FB_VISUAL_TRUECOLOR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.5:
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_setcmap_pseudo_palette
	jmp	LBB0_9
LBB0_3:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_6:
	movq	8(%r12), %rdi
	callq	_drm_drv_uses_atomic_modeset
	movq	%r13, %rdi
	movq	%rbx, %rsi
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	callq	_setcmap_atomic
	jmp	LBB0_9
LBB0_8:
	callq	_setcmap_legacy
LBB0_9:
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_mutex_unlock
	movq	%r14, %rdi
	callq	_drm_master_internal_release
LBB0_10:
	movq	%r12, %rdi
	callq	_mutex_unlock
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_oops_in_progress,8,3           ## @oops_in_progress
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_FB_VISUAL_TRUECOLOR,8,3        ## @FB_VISUAL_TRUECOLOR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_fb_helper_setcmap          ; -- Begin function drm_fb_helper_setcmap
	.p2align	2
_drm_fb_helper_setcmap:                 ; @drm_fb_helper_setcmap
	.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
Lloh0:
	adrp	x8, _oops_in_progress@GOTPAGE
Lloh1:
	ldr	x8, [x8, _oops_in_progress@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _EBUSY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_11
LBB0_2:
	mov	x21, x1
	mov	x23, x0
	ldr	x19, [x1, #8]
	ldr	x20, [x19, #8]
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x20
	bl	_drm_master_internal_acquire
	cbz	w0, LBB0_5
; %bb.3:
	add	x22, x19, #4
	mov	x0, x22
	bl	_mutex_lock
	ldr	x8, [x21]
Lloh6:
	adrp	x9, _FB_VISUAL_TRUECOLOR@GOTPAGE
Lloh7:
	ldr	x9, [x9, _FB_VISUAL_TRUECOLOR@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.4:
	mov	x0, x23
	mov	x1, x21
	bl	_setcmap_pseudo_palette
	b	LBB0_9
LBB0_5:
Lloh9:
	adrp	x8, _EBUSY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_10
LBB0_6:
	ldr	x0, [x19, #8]
	bl	_drm_drv_uses_atomic_modeset
	cbz	x0, LBB0_8
; %bb.7:
	mov	x0, x23
	mov	x1, x21
	bl	_setcmap_atomic
	b	LBB0_9
LBB0_8:
	mov	x0, x23
	mov	x1, x21
	bl	_setcmap_legacy
LBB0_9:
	mov	x21, x0
	mov	x0, x22
	bl	_mutex_unlock
	mov	x0, x20
	bl	_drm_master_internal_release
LBB0_10:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_11:
	mov	x0, x21
	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
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_oops_in_progress,8,3           ; @oops_in_progress
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_FB_VISUAL_TRUECOLOR,8,3        ; @FB_VISUAL_TRUECOLOR
.subsections_via_symbols
