	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function g4x_get_stolen_reserved
_g4x_get_stolen_reserved:               ## @g4x_get_stolen_reserved
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r12
	callq	_IS_GM45
	testq	%rax, %rax
	jne	LBB0_1
## %bb.2:
	movq	_ELK_STOLEN_RESERVED@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_CTG_STOLEN_RESERVED@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %edi
	callq	_I915_READ
	movl	%eax, %ebx
	movl	(%r12), %r13d
	movq	%r12, %rdi
	callq	_IS_GM45
	testq	%rax, %rax
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.1(%rip), %rsi
	cmoveq	%rax, %rsi
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %edx
	callq	_DRM_DEBUG_DRIVER
	movq	_G4X_STOLEN_RESERVED_ENABLE@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_6
## %bb.4:
	movq	%r12, %rdi
	movl	$5, %esi
	callq	_IS_GEN
	leaq	L_.str.3(%rip), %rsi
	movl	%eax, %edi
	movl	%ebx, %edx
	callq	_WARN
	movq	_G4X_STOLEN_RESERVED_ADDR2_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%ebx, %eax
	je	LBB0_6
## %bb.5:
	shll	$16, %eax
	movl	%eax, (%r15)
	movq	_G4X_STOLEN_RESERVED_ADDR1_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %ebx
	incl	%r13d
	xorl	%edi, %edi
	cmpl	%eax, %ebx
	setl	%dil
	callq	_WARN_ON
	subl	(%r15), %r13d
	movl	%r13d, (%r14)
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CTG_STOLEN_RESERVED,4,2        ## @CTG_STOLEN_RESERVED
	.comm	_ELK_STOLEN_RESERVED,4,2        ## @ELK_STOLEN_RESERVED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s_STOLEN_RESERVED = %08x\n"

L_.str.1:                               ## @.str.1
	.asciz	"CTG"

L_.str.2:                               ## @.str.2
	.asciz	"ELK"

	.comm	_G4X_STOLEN_RESERVED_ENABLE,4,2 ## @G4X_STOLEN_RESERVED_ENABLE
L_.str.3:                               ## @.str.3
	.asciz	"ILK stolen reserved found? 0x%08x\n"

	.comm	_G4X_STOLEN_RESERVED_ADDR2_MASK,4,2 ## @G4X_STOLEN_RESERVED_ADDR2_MASK
	.comm	_G4X_STOLEN_RESERVED_ADDR1_MASK,4,2 ## @G4X_STOLEN_RESERVED_ADDR1_MASK
	.no_dead_strip	_g4x_get_stolen_reserved
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function g4x_get_stolen_reserved
_g4x_get_stolen_reserved:               ; @g4x_get_stolen_reserved
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x2
	mov	x20, x1
	mov	x22, x0
	bl	_IS_GM45
Lloh0:
	adrp	x8, _CTG_STOLEN_RESERVED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CTG_STOLEN_RESERVED@GOTPAGEOFF]
Lloh2:
	adrp	x9, _ELK_STOLEN_RESERVED@GOTPAGE
Lloh3:
	ldr	x9, [x9, _ELK_STOLEN_RESERVED@GOTPAGEOFF]
	cmp	x0, #0
	csel	x8, x9, x8, eq
	ldr	w0, [x8]
	bl	_I915_READ
	mov	x21, x0
	ldr	w23, [x22]
	mov	x0, x22
	bl	_IS_GM45
Lloh4:
	adrp	x8, l_.str.1@PAGE
Lloh5:
	add	x8, x8, l_.str.1@PAGEOFF
Lloh6:
	adrp	x9, l_.str.2@PAGE
Lloh7:
	add	x9, x9, l_.str.2@PAGEOFF
	cmp	x0, #0
	csel	x1, x9, x8, eq
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x21
	bl	_DRM_DEBUG_DRIVER
Lloh10:
	adrp	x8, _G4X_STOLEN_RESERVED_ENABLE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _G4X_STOLEN_RESERVED_ENABLE@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_3
; %bb.1:
	mov	x0, x22
	mov	w1, #5
	bl	_IS_GEN
Lloh13:
	adrp	x1, l_.str.3@PAGE
Lloh14:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x2, x21
	bl	_WARN
Lloh15:
	adrp	x8, _G4X_STOLEN_RESERVED_ADDR2_MASK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _G4X_STOLEN_RESERVED_ADDR2_MASK@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	ands	w8, w8, w21
	b.eq	LBB0_3
; %bb.2:
	add	w22, w23, #1
	lsl	w8, w8, #16
	str	w8, [x20]
Lloh18:
	adrp	x9, _G4X_STOLEN_RESERVED_ADDR1_MASK@GOTPAGE
Lloh19:
	ldr	x9, [x9, _G4X_STOLEN_RESERVED_ADDR1_MASK@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	and	w9, w9, w21
	cmp	w9, w8
	cset	w0, lt
	bl	_WARN_ON
	ldr	w8, [x20]
	sub	w8, w22, w8
	str	w8, [x19]
LBB0_3:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_CTG_STOLEN_RESERVED,4,2        ; @CTG_STOLEN_RESERVED
	.comm	_ELK_STOLEN_RESERVED,4,2        ; @ELK_STOLEN_RESERVED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s_STOLEN_RESERVED = %08x\n"

l_.str.1:                               ; @.str.1
	.asciz	"CTG"

l_.str.2:                               ; @.str.2
	.asciz	"ELK"

	.comm	_G4X_STOLEN_RESERVED_ENABLE,4,2 ; @G4X_STOLEN_RESERVED_ENABLE
l_.str.3:                               ; @.str.3
	.asciz	"ILK stolen reserved found? 0x%08x\n"

	.comm	_G4X_STOLEN_RESERVED_ADDR2_MASK,4,2 ; @G4X_STOLEN_RESERVED_ADDR2_MASK
	.comm	_G4X_STOLEN_RESERVED_ADDR1_MASK,4,2 ; @G4X_STOLEN_RESERVED_ADDR1_MASK
	.no_dead_strip	_g4x_get_stolen_reserved
.subsections_via_symbols
