	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function valleyview_setup_pctx
_valleyview_setup_pctx:                 ## @valleyview_setup_pctx
	.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, %r14
	movq	_VLV_PCBR@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	callq	_I915_READ
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	andl	$-4096, %eax                    ## imm = 0xF000
	subl	8(%r14), %eax
	movq	_I915_GTT_OFFSET_NONE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	movl	$24576, %ecx                    ## imm = 0x6000
	callq	_i915_gem_object_create_stolen_for_preallocated
	movq	%rax, %rbx
	jmp	LBB0_5
LBB0_2:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_DRIVER
	movq	%r14, %rdi
	movl	$24576, %esi                    ## imm = 0x6000
	callq	_i915_gem_object_create_stolen
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %rbx
	movq	_u64@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	8(%r14), %esi
	movq	(%rbx), %rax
	movl	(%rax), %edx
	movq	_U32_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_range_overflows_t
	movl	%eax, %edi
	callq	_GEM_BUG_ON
	movq	(%rbx), %rax
	movl	(%rax), %esi
	addl	8(%r14), %esi
	movl	(%r15), %edi
	callq	_I915_WRITE
	jmp	LBB0_5
LBB0_3:
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_DEBUG
	xorl	%ebx, %ebx
LBB0_5:
	movl	(%r15), %edi
	callq	_I915_READ
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_DRIVER
	movq	%rbx, (%r14)
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VLV_PCBR,4,2                   ## @VLV_PCBR
	.comm	_I915_GTT_OFFSET_NONE,4,2       ## @I915_GTT_OFFSET_NONE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"BIOS didn't set up PCBR, fixing up\n"

L_.str.1:                               ## @.str.1
	.asciz	"not enough stolen space for PCTX, disabling\n"

	.comm	_u64,4,2                        ## @u64
	.comm	_U32_MAX,4,2                    ## @U32_MAX
L_.str.2:                               ## @.str.2
	.asciz	"PCBR: 0x%08x\n"

	.no_dead_strip	_valleyview_setup_pctx
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function valleyview_setup_pctx
_valleyview_setup_pctx:                 ; @valleyview_setup_pctx
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
Lloh0:
	adrp	x21, _VLV_PCBR@GOTPAGE
Lloh1:
	ldr	x21, [x21, _VLV_PCBR@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_I915_READ
	cbz	w0, LBB0_2
; %bb.1:
	and	w8, w0, #0xfffff000
	ldr	w9, [x19, #8]
	sub	w1, w8, w9
Lloh2:
	adrp	x8, _I915_GTT_OFFSET_NONE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _I915_GTT_OFFSET_NONE@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w3, #24576
	bl	_i915_gem_object_create_stolen_for_preallocated
	mov	x20, x0
	b	LBB0_5
LBB0_2:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG_DRIVER
	mov	x0, x19
	mov	w1, #24576
	bl	_i915_gem_object_create_stolen
	mov	x20, x0
	cbz	x0, LBB0_4
; %bb.3:
Lloh7:
	adrp	x8, _u64@GOTPAGE
Lloh8:
	ldr	x8, [x8, _u64@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	ldr	w1, [x19, #8]
	ldr	x8, [x20]
	ldr	w2, [x8]
Lloh10:
	adrp	x8, _U32_MAX@GOTPAGE
Lloh11:
	ldr	x8, [x8, _U32_MAX@GOTPAGEOFF]
Lloh12:
	ldr	w3, [x8]
	bl	_range_overflows_t
	bl	_GEM_BUG_ON
	ldr	w8, [x19, #8]
	ldr	x9, [x20]
	ldr	w9, [x9]
	add	w1, w9, w8
	ldr	w0, [x21]
	bl	_I915_WRITE
	b	LBB0_5
LBB0_4:
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_DEBUG
LBB0_5:
	ldr	w0, [x21]
	bl	_I915_READ
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh15:
	adrp	x0, l_.str.2@PAGE
Lloh16:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_DEBUG_DRIVER
	str	x20, [x19]
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_VLV_PCBR,4,2                   ; @VLV_PCBR
	.comm	_I915_GTT_OFFSET_NONE,4,2       ; @I915_GTT_OFFSET_NONE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"BIOS didn't set up PCBR, fixing up\n"

l_.str.1:                               ; @.str.1
	.asciz	"not enough stolen space for PCTX, disabling\n"

	.comm	_u64,4,2                        ; @u64
	.comm	_U32_MAX,4,2                    ; @U32_MAX
l_.str.2:                               ; @.str.2
	.asciz	"PCBR: 0x%08x\n"

	.no_dead_strip	_valleyview_setup_pctx
.subsections_via_symbols
