	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_disable_sagv             ## -- Begin function intel_disable_sagv
	.p2align	4, 0x90
_intel_disable_sagv:                    ## @intel_disable_sagv
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_intel_has_sagv
	xorl	%r14d, %r14d
	testl	%eax, %eax
	je	LBB0_9
## %bb.1:
	movq	(%rbx), %rax
	movq	_I915_SAGV_DISABLED@GOTPCREL(%rip), %r12
	cmpq	(%r12), %rax
	je	LBB0_9
## %bb.2:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG_KMS
	movq	_GEN9_PCODE_SAGV_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_GEN9_SAGV_DISABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_GEN9_SAGV_IS_DISABLED@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	movl	%ecx, %r8d
	movl	$1, %r9d
	callq	_skl_pcode_request
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_IS_SKYLAKE
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r15d, %eax
	jne	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_DEBUG_DRIVER
	movq	_I915_SAGV_NOT_CONTROLLED@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	jmp	LBB0_8
LBB0_5:
	testl	%r15d, %r15d
	js	LBB0_6
## %bb.7:
	movq	(%r12), %rax
LBB0_8:
	movq	%rax, (%rbx)
	jmp	LBB0_9
LBB0_6:
	leaq	L_.str.2(%rip), %rdi
	movl	%r15d, %esi
	callq	_DRM_ERROR
	movl	%r15d, %r14d
LBB0_9:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_I915_SAGV_DISABLED,8,3         ## @I915_SAGV_DISABLED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Disabling SAGV\n"

	.comm	_GEN9_PCODE_SAGV_CONTROL,4,2    ## @GEN9_PCODE_SAGV_CONTROL
	.comm	_GEN9_SAGV_DISABLE,4,2          ## @GEN9_SAGV_DISABLE
	.comm	_GEN9_SAGV_IS_DISABLED,4,2      ## @GEN9_SAGV_IS_DISABLED
	.comm	_ENXIO,4,2                      ## @ENXIO
L_.str.1:                               ## @.str.1
	.asciz	"No SAGV found on system, ignoring\n"

	.comm	_I915_SAGV_NOT_CONTROLLED,8,3   ## @I915_SAGV_NOT_CONTROLLED
L_.str.2:                               ## @.str.2
	.asciz	"Failed to disable SAGV (%d)\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_disable_sagv             ; -- Begin function intel_disable_sagv
	.p2align	2
_intel_disable_sagv:                    ; @intel_disable_sagv
	.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	_intel_has_sagv
	cbz	w0, LBB0_2
; %bb.1:
	ldr	x8, [x19]
Lloh0:
	adrp	x21, _I915_SAGV_DISABLED@GOTPAGE
Lloh1:
	ldr	x21, [x21, _I915_SAGV_DISABLED@GOTPAGEOFF]
	ldr	x9, [x21]
	cmp	x8, x9
	b.ne	LBB0_3
LBB0_2:
	mov	w20, #0
	b	LBB0_10
LBB0_3:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG_KMS
Lloh4:
	adrp	x8, _GEN9_PCODE_SAGV_CONTROL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _GEN9_PCODE_SAGV_CONTROL@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
Lloh7:
	adrp	x8, _GEN9_SAGV_DISABLE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _GEN9_SAGV_DISABLE@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
Lloh10:
	adrp	x8, _GEN9_SAGV_IS_DISABLED@GOTPAGE
Lloh11:
	ldr	x8, [x8, _GEN9_SAGV_IS_DISABLED@GOTPAGEOFF]
Lloh12:
	ldr	w3, [x8]
	mov	x0, x19
	mov	x4, x3
	mov	w5, #1
	bl	_skl_pcode_request
	mov	x20, x0
	mov	x0, x19
	bl	_IS_SKYLAKE
	cbz	x0, LBB0_6
; %bb.4:
Lloh13:
	adrp	x8, _ENXIO@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	cmn	w20, w8
	b.ne	LBB0_6
; %bb.5:
Lloh16:
	adrp	x0, l_.str.1@PAGE
Lloh17:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_DEBUG_DRIVER
	mov	w20, #0
Lloh18:
	adrp	x8, _I915_SAGV_NOT_CONTROLLED@GOTPAGE
Lloh19:
	ldr	x8, [x8, _I915_SAGV_NOT_CONTROLLED@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
	b	LBB0_8
LBB0_6:
	tbnz	w20, #31, LBB0_9
; %bb.7:
	mov	w20, #0
	ldr	x8, [x21]
LBB0_8:
	str	x8, [x19]
	b	LBB0_10
LBB0_9:
Lloh21:
	adrp	x0, l_.str.2@PAGE
Lloh22:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x20
	bl	_DRM_ERROR
LBB0_10:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_I915_SAGV_DISABLED,8,3         ; @I915_SAGV_DISABLED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Disabling SAGV\n"

	.comm	_GEN9_PCODE_SAGV_CONTROL,4,2    ; @GEN9_PCODE_SAGV_CONTROL
	.comm	_GEN9_SAGV_DISABLE,4,2          ; @GEN9_SAGV_DISABLE
	.comm	_GEN9_SAGV_IS_DISABLED,4,2      ; @GEN9_SAGV_IS_DISABLED
	.comm	_ENXIO,4,2                      ; @ENXIO
l_.str.1:                               ; @.str.1
	.asciz	"No SAGV found on system, ignoring\n"

	.comm	_I915_SAGV_NOT_CONTROLLED,8,3   ; @I915_SAGV_NOT_CONTROLLED
l_.str.2:                               ; @.str.2
	.asciz	"Failed to disable SAGV (%d)\n"

.subsections_via_symbols
