	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vga_switcheroo_process_delayed_switch ## -- Begin function vga_switcheroo_process_delayed_switch
	.p2align	4, 0x90
_vga_switcheroo_process_delayed_switch: ## @vga_switcheroo_process_delayed_switch
	.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
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	_vgasr_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	_vgasr_priv@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	je	LBB0_6
## %bb.1:
	movl	4(%r15), %esi
	leaq	L_.str(%rip), %rdi
	callq	_pr_info
	movl	4(%r15), %esi
	leaq	8(%r15), %rdi
	callq	_find_client_from_id
	testq	%rax, %rax
	je	LBB0_6
## %bb.2:
	movq	%rax, %r14
	xorl	%eax, %eax
	callq	_check_can_switch
	testl	%eax, %eax
	je	LBB0_6
## %bb.3:
	movq	%r14, %rdi
	callq	_vga_switchto_stage2
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	callq	_pr_err
LBB0_5:
	movl	$0, (%r15)
	xorl	%ebx, %ebx
LBB0_6:
	movq	_vgasr_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_vgasr_mutex,4,2                ## @vgasr_mutex
	.comm	_vgasr_priv,12,2                ## @vgasr_priv
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"processing delayed switch to %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"delayed switching failed stage 2 %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vga_switcheroo_process_delayed_switch ; -- Begin function vga_switcheroo_process_delayed_switch
	.p2align	2
_vga_switcheroo_process_delayed_switch: ; @vga_switcheroo_process_delayed_switch
	.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
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w19, w8
Lloh3:
	adrp	x0, _vgasr_mutex@GOTPAGE
Lloh4:
	ldr	x0, [x0, _vgasr_mutex@GOTPAGEOFF]
	bl	_mutex_lock
Lloh5:
	adrp	x21, _vgasr_priv@GOTPAGE
Lloh6:
	ldr	x21, [x21, _vgasr_priv@GOTPAGEOFF]
	ldr	w8, [x21]
	cbz	w8, LBB0_6
; %bb.1:
	ldr	w1, [x21, #4]
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_info
	ldr	w1, [x21, #4]
	add	x0, x21, #8
	bl	_find_client_from_id
	cbz	x0, LBB0_6
; %bb.2:
	mov	x20, x0
	bl	_check_can_switch
	cbz	w0, LBB0_6
; %bb.3:
	mov	x0, x20
	bl	_vga_switchto_stage2
	cbz	w0, LBB0_5
; %bb.4:
	mov	x1, x0
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_err
LBB0_5:
	mov	w19, #0
	str	wzr, [x21]
LBB0_6:
Lloh11:
	adrp	x0, _vgasr_mutex@GOTPAGE
Lloh12:
	ldr	x0, [x0, _vgasr_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
	mov	x0, x19
	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
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_vgasr_mutex,4,2                ; @vgasr_mutex
	.comm	_vgasr_priv,12,2                ; @vgasr_priv
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"processing delayed switch to %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"delayed switching failed stage 2 %d\n"

.subsections_via_symbols
