	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vga_switcheroo_runtime_suspend
_vga_switcheroo_runtime_suspend:        ## @vga_switcheroo_runtime_suspend
	.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	%rdi, %rbx
	callq	_to_pci_dev
	movq	%rax, %r14
	movq	(%rbx), %rax
	movq	(%rax), %rax
	movq	%rbx, %rdi
	callq	*(%rax)
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_4
## %bb.1:
	movq	_vgasr_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	_vgasr_priv@GOTPCREL(%rip), %r15
	movq	8(%r15), %rax
	cmpq	$0, (%rax)
	je	LBB0_3
## %bb.2:
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	8(%r15), %rax
	movq	_VGA_SWITCHEROO_IGD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	callq	*(%rax)
	movq	%r15, %rdi
	callq	_mutex_unlock
LBB0_3:
	movl	(%r14), %edi
	movq	_PCI_D3cold@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_pci_bus_set_current_state
	movq	_VGA_SWITCHEROO_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_vga_switcheroo_power_switch
	movq	_vgasr_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
LBB0_4:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_vgasr_mutex,4,2                ## @vgasr_mutex
	.comm	_vgasr_priv,16,3                ## @vgasr_priv
	.comm	_VGA_SWITCHEROO_IGD,4,2         ## @VGA_SWITCHEROO_IGD
	.comm	_PCI_D3cold,4,2                 ## @PCI_D3cold
	.comm	_VGA_SWITCHEROO_OFF,4,2         ## @VGA_SWITCHEROO_OFF
	.no_dead_strip	_vga_switcheroo_runtime_suspend
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vga_switcheroo_runtime_suspend
_vga_switcheroo_runtime_suspend:        ; @vga_switcheroo_runtime_suspend
	.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
	mov	x19, x0
	bl	_to_pci_dev
	mov	x20, x0
	ldr	x8, [x19]
	ldr	x8, [x8]
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
	mov	x19, x0
	cbnz	w0, LBB0_4
; %bb.1:
Lloh0:
	adrp	x0, _vgasr_mutex@GOTPAGE
Lloh1:
	ldr	x0, [x0, _vgasr_mutex@GOTPAGEOFF]
	bl	_mutex_lock
Lloh2:
	adrp	x21, _vgasr_priv@GOTPAGE
Lloh3:
	ldr	x21, [x21, _vgasr_priv@GOTPAGEOFF]
	ldr	x8, [x21, #8]
	ldr	x8, [x8]
	cbz	x8, LBB0_3
; %bb.2:
	mov	x0, x21
	bl	_mutex_lock
	ldr	x8, [x21, #8]
	ldr	x8, [x8]
Lloh4:
	adrp	x9, _VGA_SWITCHEROO_IGD@GOTPAGE
Lloh5:
	ldr	x9, [x9, _VGA_SWITCHEROO_IGD@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x9]
	blr	x8
	mov	x0, x21
	bl	_mutex_unlock
LBB0_3:
	ldr	w0, [x20]
Lloh7:
	adrp	x8, _PCI_D3cold@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PCI_D3cold@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	bl	_pci_bus_set_current_state
Lloh10:
	adrp	x8, _VGA_SWITCHEROO_OFF@GOTPAGE
Lloh11:
	ldr	x8, [x8, _VGA_SWITCHEROO_OFF@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_vga_switcheroo_power_switch
Lloh13:
	adrp	x0, _vgasr_mutex@GOTPAGE
Lloh14:
	ldr	x0, [x0, _vgasr_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
LBB0_4:
	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	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_vgasr_mutex,4,2                ; @vgasr_mutex
	.comm	_vgasr_priv,16,3                ; @vgasr_priv
	.comm	_VGA_SWITCHEROO_IGD,4,2         ; @VGA_SWITCHEROO_IGD
	.comm	_PCI_D3cold,4,2                 ; @PCI_D3cold
	.comm	_VGA_SWITCHEROO_OFF,4,2         ; @VGA_SWITCHEROO_OFF
	.no_dead_strip	_vga_switcheroo_runtime_suspend
.subsections_via_symbols
