	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_fb_helper_restore_fbdev_mode_unlocked ## -- Begin function drm_fb_helper_restore_fbdev_mode_unlocked
	.p2align	4, 0x90
_drm_fb_helper_restore_fbdev_mode_unlocked: ## @drm_fb_helper_restore_fbdev_mode_unlocked
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	movq	_drm_fbdev_emulation@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_2
## %bb.3:
	movq	%rdi, %r14
	movl	12(%rdi), %edi
	callq	_READ_ONCE
	xorl	%ebx, %ebx
	testq	%rax, %rax
	jne	LBB0_7
## %bb.4:
	leaq	4(%r14), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	leaq	8(%r14), %rdi
	callq	_drm_client_modeset_commit_force
	movl	%eax, %ebx
	cmpl	$0, (%r14)
	je	LBB0_6
## %bb.5:
	movl	$0, (%r14)
	movq	%r15, %rdi
	callq	_mutex_unlock
	movq	%r14, %rdi
	callq	_drm_fb_helper_hotplug_event
	jmp	LBB0_7
LBB0_2:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	%r15, %rdi
	callq	_mutex_unlock
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_drm_fbdev_emulation,4,2        ## @drm_fbdev_emulation
	.comm	_ENODEV,4,2                     ## @ENODEV
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_fb_helper_restore_fbdev_mode_unlocked ; -- Begin function drm_fb_helper_restore_fbdev_mode_unlocked
	.p2align	2
_drm_fb_helper_restore_fbdev_mode_unlocked: ; @drm_fb_helper_restore_fbdev_mode_unlocked
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	cbz	x0, LBB0_4
; %bb.1:
Lloh0:
	adrp	x8, _drm_fbdev_emulation@GOTPAGE
Lloh1:
	ldr	x8, [x8, _drm_fbdev_emulation@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cbz	w8, LBB0_4
; %bb.2:
	mov	x19, x0
	ldr	w0, [x0, #12]
	bl	_READ_ONCE
	cbz	x0, LBB0_6
; %bb.3:
	mov	w20, #0
	b	LBB0_5
LBB0_4:
Lloh3:
	adrp	x8, _ENODEV@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_5:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_6:
	add	x21, x19, #4
	mov	x0, x21
	bl	_mutex_lock
	add	x0, x19, #8
	bl	_drm_client_modeset_commit_force
	mov	x20, x0
	ldr	w8, [x19]
	cbz	w8, LBB0_8
; %bb.7:
	str	wzr, [x19]
	mov	x0, x21
	bl	_mutex_unlock
	mov	x0, x19
	bl	_drm_fb_helper_hotplug_event
	b	LBB0_5
LBB0_8:
	mov	x0, x21
	bl	_mutex_unlock
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_drm_fbdev_emulation,4,2        ; @drm_fbdev_emulation
	.comm	_ENODEV,4,2                     ; @ENODEV
.subsections_via_symbols
