	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nouveau_switcheroo_set_state
_nouveau_switcheroo_set_state:          ## @nouveau_switcheroo_set_state
	.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
	movl	%esi, %ebx
	movq	%rdi, %r15
	callq	_pci_get_drvdata
	movq	%rax, %r14
	xorl	%eax, %eax
	callq	_nouveau_is_optimus
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	callq	_nouveau_is_v1_dsm
	testq	%rax, %rax
	je	LBB0_3
LBB0_2:
	movq	_VGA_SWITCHEROO_OFF@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	je	LBB0_7
LBB0_3:
	movq	_VGA_SWITCHEROO_ON@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_5
## %bb.4:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	movq	_DRM_SWITCH_POWER_CHANGING@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r14)
	movq	%r15, %rdi
	callq	_nouveau_pmops_resume
	movq	_DRM_SWITCH_POWER_ON@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_5:
	leaq	L_.str.1(%rip), %rdi
	callq	_pr_err
	movq	_DRM_SWITCH_POWER_CHANGING@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r14)
	xorl	%eax, %eax
	callq	_nouveau_switcheroo_optimus_dsm
	movq	%r15, %rdi
	callq	_nouveau_pmops_suspend
	movq	_DRM_SWITCH_POWER_OFF@GOTPCREL(%rip), %rax
LBB0_6:
	movq	(%rax), %rax
	movq	%rax, (%r14)
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VGA_SWITCHEROO_OFF,4,2         ## @VGA_SWITCHEROO_OFF
	.comm	_VGA_SWITCHEROO_ON,4,2          ## @VGA_SWITCHEROO_ON
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"VGA switcheroo: switched nouveau on\n"

	.comm	_DRM_SWITCH_POWER_CHANGING,8,3  ## @DRM_SWITCH_POWER_CHANGING
	.comm	_DRM_SWITCH_POWER_ON,8,3        ## @DRM_SWITCH_POWER_ON
L_.str.1:                               ## @.str.1
	.asciz	"VGA switcheroo: switched nouveau off\n"

	.comm	_DRM_SWITCH_POWER_OFF,8,3       ## @DRM_SWITCH_POWER_OFF
	.no_dead_strip	_nouveau_switcheroo_set_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nouveau_switcheroo_set_state
_nouveau_switcheroo_set_state:          ; @nouveau_switcheroo_set_state
	.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	x21, x1
	mov	x20, x0
	bl	_pci_get_drvdata
	mov	x19, x0
	bl	_nouveau_is_optimus
	cbnz	x0, LBB0_2
; %bb.1:
	bl	_nouveau_is_v1_dsm
	cbz	x0, LBB0_3
LBB0_2:
Lloh0:
	adrp	x8, _VGA_SWITCHEROO_OFF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VGA_SWITCHEROO_OFF@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w21
	b.eq	LBB0_7
LBB0_3:
Lloh3:
	adrp	x8, _VGA_SWITCHEROO_ON@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VGA_SWITCHEROO_ON@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_5
; %bb.4:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
Lloh8:
	adrp	x8, _DRM_SWITCH_POWER_CHANGING@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DRM_SWITCH_POWER_CHANGING@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	str	x8, [x19]
	mov	x0, x20
	bl	_nouveau_pmops_resume
Lloh11:
	adrp	x8, _DRM_SWITCH_POWER_ON@GOTPAGE
Lloh12:
	ldr	x8, [x8, _DRM_SWITCH_POWER_ON@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_err
Lloh15:
	adrp	x8, _DRM_SWITCH_POWER_CHANGING@GOTPAGE
Lloh16:
	ldr	x8, [x8, _DRM_SWITCH_POWER_CHANGING@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	str	x8, [x19]
	bl	_nouveau_switcheroo_optimus_dsm
	mov	x0, x20
	bl	_nouveau_pmops_suspend
Lloh18:
	adrp	x8, _DRM_SWITCH_POWER_OFF@GOTPAGE
Lloh19:
	ldr	x8, [x8, _DRM_SWITCH_POWER_OFF@GOTPAGEOFF]
LBB0_6:
	ldr	x8, [x8]
	str	x8, [x19]
LBB0_7:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_VGA_SWITCHEROO_OFF,4,2         ; @VGA_SWITCHEROO_OFF
	.comm	_VGA_SWITCHEROO_ON,4,2          ; @VGA_SWITCHEROO_ON
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"VGA switcheroo: switched nouveau on\n"

	.comm	_DRM_SWITCH_POWER_CHANGING,8,3  ; @DRM_SWITCH_POWER_CHANGING
	.comm	_DRM_SWITCH_POWER_ON,8,3        ; @DRM_SWITCH_POWER_ON
l_.str.1:                               ; @.str.1
	.asciz	"VGA switcheroo: switched nouveau off\n"

	.comm	_DRM_SWITCH_POWER_OFF,8,3       ; @DRM_SWITCH_POWER_OFF
	.no_dead_strip	_nouveau_switcheroo_set_state
.subsections_via_symbols
