	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function radeon_switcheroo_set_state
_radeon_switcheroo_set_state:           ## @radeon_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %ebx
	callq	_pci_get_drvdata
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_radeon_is_px
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_VGA_SWITCHEROO_OFF@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	je	LBB0_4
LBB0_2:
	movq	_VGA_SWITCHEROO_ON@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_3
## %bb.5:
	leaq	L_.str(%rip), %rdi
	callq	_pr_info
	movq	_DRM_SWITCH_POWER_CHANGING@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r14)
	movq	%r14, %rdi
	movl	$1, %esi
	movl	$1, %edx
	callq	_radeon_resume_kms
	movq	_DRM_SWITCH_POWER_ON@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r14)
	movq	%r14, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_drm_kms_helper_poll_enable     ## TAILCALL
LBB0_3:
	leaq	L_.str.1(%rip), %rdi
	callq	_pr_info
	movq	%r14, %rdi
	callq	_drm_kms_helper_poll_disable
	movq	_DRM_SWITCH_POWER_CHANGING@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r14)
	movq	%r14, %rdi
	movl	$1, %esi
	movl	$1, %edx
	xorl	%ecx, %ecx
	callq	_radeon_suspend_kms
	movq	_DRM_SWITCH_POWER_OFF@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r14)
LBB0_4:
	popq	%rbx
	popq	%r14
	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	"radeon: switched 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	"radeon: switched off\n"

	.comm	_DRM_SWITCH_POWER_OFF,8,3       ## @DRM_SWITCH_POWER_OFF
	.no_dead_strip	_radeon_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 radeon_switcheroo_set_state
_radeon_switcheroo_set_state:           ; @radeon_switcheroo_set_state
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x1
	bl	_pci_get_drvdata
	mov	x19, x0
	bl	_radeon_is_px
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _VGA_SWITCHEROO_OFF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VGA_SWITCHEROO_OFF@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w20
	b.eq	LBB0_5
LBB0_2:
Lloh3:
	adrp	x8, _VGA_SWITCHEROO_ON@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VGA_SWITCHEROO_ON@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, w20
	b.ne	LBB0_4
; %bb.3:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_info
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, x19
	mov	w1, #1
	mov	w2, #1
	bl	_radeon_resume_kms
Lloh11:
	adrp	x8, _DRM_SWITCH_POWER_ON@GOTPAGE
Lloh12:
	ldr	x8, [x8, _DRM_SWITCH_POWER_ON@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	str	x8, [x19]
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_drm_kms_helper_poll_enable
LBB0_4:
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_info
	mov	x0, x19
	bl	_drm_kms_helper_poll_disable
Lloh16:
	adrp	x8, _DRM_SWITCH_POWER_CHANGING@GOTPAGE
Lloh17:
	ldr	x8, [x8, _DRM_SWITCH_POWER_CHANGING@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	str	x8, [x19]
	mov	x0, x19
	mov	w1, #1
	mov	w2, #1
	mov	w3, #0
	bl	_radeon_suspend_kms
Lloh19:
	adrp	x8, _DRM_SWITCH_POWER_OFF@GOTPAGE
Lloh20:
	ldr	x8, [x8, _DRM_SWITCH_POWER_OFF@GOTPAGEOFF]
Lloh21:
	ldr	x8, [x8]
	str	x8, [x19]
LBB0_5:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.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	"radeon: switched 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	"radeon: switched off\n"

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