	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gmc_v10_0_get_vbios_fb_size
_gmc_v10_0_get_vbios_fb_size:           ## @gmc_v10_0_get_vbios_fb_size
	.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, %r12
	movq	_DCE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	movq	_mmD1VGA_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_RREG32_SOC15
	movq	_D1VGA_CONTROL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_D1VGA_MODE_ENABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %edi
	callq	_REG_GET_FIELD
	movl	%eax, %ecx
	movl	$9437184, %eax                  ## imm = 0x900000
	testl	%ecx, %ecx
	jne	LBB0_2
## %bb.1:
	movl	(%rbx), %edi
	movq	_mmHUBP0_DCSURF_PRI_VIEWPORT_DIMENSION@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_RREG32_SOC15
	movl	%eax, %r14d
	movl	(%rbx), %edi
	movq	_mmHUBPREQ0_DCSURF_SURFACE_PITCH@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_RREG32_SOC15
	movl	%eax, %r15d
	movq	_HUBP0_DCSURF_PRI_VIEWPORT_DIMENSION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_PRI_VIEWPORT_HEIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r14d, %edi
	callq	_REG_GET_FIELD
	movl	%eax, %ebx
	movq	_HUBPREQ0_DCSURF_SURFACE_PITCH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_PITCH@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r15d, %edi
	callq	_REG_GET_FIELD
	imull	%ebx, %eax
	shll	$2, %eax
LBB0_2:
	movl	(%r12), %ecx
	subl	%eax, %ecx
	cmpl	$8388607, %ecx                  ## imm = 0x7FFFFF
	ja	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	xorl	%eax, %eax
LBB0_4:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DCE,4,2                        ## @DCE
	.comm	_mmD1VGA_CONTROL,4,2            ## @mmD1VGA_CONTROL
	.comm	_D1VGA_CONTROL,4,2              ## @D1VGA_CONTROL
	.comm	_D1VGA_MODE_ENABLE,4,2          ## @D1VGA_MODE_ENABLE
	.comm	_mmHUBP0_DCSURF_PRI_VIEWPORT_DIMENSION,4,2 ## @mmHUBP0_DCSURF_PRI_VIEWPORT_DIMENSION
	.comm	_mmHUBPREQ0_DCSURF_SURFACE_PITCH,4,2 ## @mmHUBPREQ0_DCSURF_SURFACE_PITCH
	.comm	_HUBP0_DCSURF_PRI_VIEWPORT_DIMENSION,4,2 ## @HUBP0_DCSURF_PRI_VIEWPORT_DIMENSION
	.comm	_PRI_VIEWPORT_HEIGHT,4,2        ## @PRI_VIEWPORT_HEIGHT
	.comm	_HUBPREQ0_DCSURF_SURFACE_PITCH,4,2 ## @HUBPREQ0_DCSURF_SURFACE_PITCH
	.comm	_PITCH,4,2                      ## @PITCH
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Warning: pre-OS buffer uses most of vram, \t\t\t\tbe aware of gart table overwrite\n"

	.no_dead_strip	_gmc_v10_0_get_vbios_fb_size
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gmc_v10_0_get_vbios_fb_size
_gmc_v10_0_get_vbios_fb_size:           ; @gmc_v10_0_get_vbios_fb_size
	.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
Lloh0:
	adrp	x21, _DCE@GOTPAGE
Lloh1:
	ldr	x21, [x21, _DCE@GOTPAGEOFF]
	ldr	w0, [x21]
Lloh2:
	adrp	x8, _mmD1VGA_CONTROL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _mmD1VGA_CONTROL@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_RREG32_SOC15
Lloh5:
	adrp	x8, _D1VGA_CONTROL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _D1VGA_CONTROL@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
Lloh8:
	adrp	x8, _D1VGA_MODE_ENABLE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _D1VGA_MODE_ENABLE@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	bl	_REG_GET_FIELD
	cbz	w0, LBB0_2
; %bb.1:
	mov	w0, #9437184
	b	LBB0_3
LBB0_2:
	ldr	w0, [x21]
Lloh11:
	adrp	x8, _mmHUBP0_DCSURF_PRI_VIEWPORT_DIMENSION@GOTPAGE
Lloh12:
	ldr	x8, [x8, _mmHUBP0_DCSURF_PRI_VIEWPORT_DIMENSION@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_RREG32_SOC15
	mov	x20, x0
	ldr	w0, [x21]
Lloh14:
	adrp	x8, _mmHUBPREQ0_DCSURF_SURFACE_PITCH@GOTPAGE
Lloh15:
	ldr	x8, [x8, _mmHUBPREQ0_DCSURF_SURFACE_PITCH@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_RREG32_SOC15
	mov	x21, x0
Lloh17:
	adrp	x8, _HUBP0_DCSURF_PRI_VIEWPORT_DIMENSION@GOTPAGE
Lloh18:
	ldr	x8, [x8, _HUBP0_DCSURF_PRI_VIEWPORT_DIMENSION@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
Lloh20:
	adrp	x8, _PRI_VIEWPORT_HEIGHT@GOTPAGE
Lloh21:
	ldr	x8, [x8, _PRI_VIEWPORT_HEIGHT@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_REG_GET_FIELD
	mov	x20, x0
Lloh23:
	adrp	x8, _HUBPREQ0_DCSURF_SURFACE_PITCH@GOTPAGE
Lloh24:
	ldr	x8, [x8, _HUBPREQ0_DCSURF_SURFACE_PITCH@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
Lloh26:
	adrp	x8, _PITCH@GOTPAGE
Lloh27:
	ldr	x8, [x8, _PITCH@GOTPAGEOFF]
Lloh28:
	ldr	w2, [x8]
	mov	x0, x21
	bl	_REG_GET_FIELD
	mul	w8, w20, w0
	lsl	w0, w8, #2
LBB0_3:
	ldr	w8, [x19]
	sub	w8, w8, w0
	lsr	w8, w8, #23
	cbnz	w8, LBB0_5
; %bb.4:
Lloh29:
	adrp	x0, l_.str@PAGE
Lloh30:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	mov	w0, #0
LBB0_5:
	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	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_DCE,4,2                        ; @DCE
	.comm	_mmD1VGA_CONTROL,4,2            ; @mmD1VGA_CONTROL
	.comm	_D1VGA_CONTROL,4,2              ; @D1VGA_CONTROL
	.comm	_D1VGA_MODE_ENABLE,4,2          ; @D1VGA_MODE_ENABLE
	.comm	_mmHUBP0_DCSURF_PRI_VIEWPORT_DIMENSION,4,2 ; @mmHUBP0_DCSURF_PRI_VIEWPORT_DIMENSION
	.comm	_mmHUBPREQ0_DCSURF_SURFACE_PITCH,4,2 ; @mmHUBPREQ0_DCSURF_SURFACE_PITCH
	.comm	_HUBP0_DCSURF_PRI_VIEWPORT_DIMENSION,4,2 ; @HUBP0_DCSURF_PRI_VIEWPORT_DIMENSION
	.comm	_PRI_VIEWPORT_HEIGHT,4,2        ; @PRI_VIEWPORT_HEIGHT
	.comm	_HUBPREQ0_DCSURF_SURFACE_PITCH,4,2 ; @HUBPREQ0_DCSURF_SURFACE_PITCH
	.comm	_PITCH,4,2                      ; @PITCH
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Warning: pre-OS buffer uses most of vram, \t\t\t\tbe aware of gart table overwrite\n"

	.no_dead_strip	_gmc_v10_0_get_vbios_fb_size
.subsections_via_symbols
