	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alloc_gm
_alloc_gm:                              ## @alloc_gm
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	8(%rdi), %r14
	movq	(%r14), %r15
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	testl	%esi, %esi
	je	LBB0_2
## %bb.1:
	leaq	4(%r12), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	callq	_vgpu_hidden_sz
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	%r14, %rdi
	callq	_gvt_hidden_gmadr_base
	movq	_I915_GTT_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_ALIGN
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%r14, %rdi
	callq	_gvt_hidden_gmadr_end
	movq	_PIN_HIGH@GOTPCREL(%rip), %r14
	jmp	LBB0_3
LBB0_2:
	movq	%r12, %rdi
	callq	_vgpu_aperture_sz
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	%r14, %rdi
	callq	_gvt_aperture_gmadr_base
	movq	_I915_GTT_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_ALIGN
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%r14, %rdi
	callq	_gvt_aperture_gmadr_end
	movq	_PIN_MAPPABLE@GOTPCREL(%rip), %r14
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
LBB0_3:
	movq	_I915_GTT_PAGE_SIZE@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movl	%eax, %edi
	callq	_ALIGN
	movl	%eax, %r13d
	movl	(%r14), %ebx
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	%r15, %rdi
	callq	_mmio_hw_access_pre
	leaq	4(%r15), %rdi
	movl	(%r12), %ecx
	movq	_I915_COLOR_UNEVICTABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movl	-44(%rbp), %r9d                 ## 4-byte Reload
	pushq	%rbx
	pushq	%r13
	callq	_i915_gem_gtt_insert
	addq	$16, %rsp
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_mmio_hw_access_post
	movq	%r15, %rdi
	callq	_mutex_unlock
	testl	%ebx, %ebx
	je	LBB0_5
## %bb.4:
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.1(%rip), %rsi
	cmoveq	%rax, %rsi
	leaq	L_.str(%rip), %rdi
	callq	_gvt_err
LBB0_5:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_I915_GTT_PAGE_SIZE,4,2         ## @I915_GTT_PAGE_SIZE
	.comm	_PIN_HIGH,4,2                   ## @PIN_HIGH
	.comm	_PIN_MAPPABLE,4,2               ## @PIN_MAPPABLE
	.comm	_I915_COLOR_UNEVICTABLE,4,2     ## @I915_COLOR_UNEVICTABLE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fail to alloc %s gm space from host\n"

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

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

	.no_dead_strip	_alloc_gm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alloc_gm
_alloc_gm:                              ; @alloc_gm
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x1
	mov	x25, x0
	ldr	x24, [x0, #8]
	ldr	x20, [x24]
Lloh0:
	adrp	x26, _I915_GTT_PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x26, [x26, _I915_GTT_PAGE_SIZE@GOTPAGEOFF]
	cbz	w1, LBB0_2
; %bb.1:
	add	x22, x25, #4
	mov	x0, x25
	bl	_vgpu_hidden_sz
	mov	x21, x0
	mov	x0, x24
	bl	_gvt_hidden_gmadr_base
	ldr	w1, [x26]
	bl	_ALIGN
	mov	x23, x0
	mov	x0, x24
	bl	_gvt_hidden_gmadr_end
Lloh2:
	adrp	x27, _PIN_HIGH@GOTPAGE
Lloh3:
	ldr	x27, [x27, _PIN_HIGH@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:
	mov	x0, x25
	bl	_vgpu_aperture_sz
	mov	x21, x0
	mov	x0, x24
	bl	_gvt_aperture_gmadr_base
	ldr	w1, [x26]
	bl	_ALIGN
	mov	x23, x0
	mov	x0, x24
	bl	_gvt_aperture_gmadr_end
Lloh4:
	adrp	x27, _PIN_MAPPABLE@GOTPAGE
Lloh5:
	ldr	x27, [x27, _PIN_MAPPABLE@GOTPAGEOFF]
	mov	x22, x25
LBB0_3:
	ldr	w1, [x26]
	bl	_ALIGN
	mov	x24, x0
	ldr	w25, [x27]
	mov	x0, x20
	bl	_mutex_lock
	mov	x0, x20
	bl	_mmio_hw_access_pre
	add	x0, x20, #4
	ldr	w3, [x26]
Lloh6:
	adrp	x8, _I915_COLOR_UNEVICTABLE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _I915_COLOR_UNEVICTABLE@GOTPAGEOFF]
Lloh8:
	ldr	w4, [x8]
	mov	x1, x22
	mov	x2, x21
	mov	x5, x23
	mov	x6, x24
	mov	x7, x25
	bl	_i915_gem_gtt_insert
	mov	x21, x0
	mov	x0, x20
	bl	_mmio_hw_access_post
	mov	x0, x20
	bl	_mutex_unlock
	cbz	w21, LBB0_5
; %bb.4:
Lloh9:
	adrp	x8, l_.str.1@PAGE
Lloh10:
	add	x8, x8, l_.str.1@PAGEOFF
Lloh11:
	adrp	x9, l_.str.2@PAGE
Lloh12:
	add	x9, x9, l_.str.2@PAGEOFF
	cmp	w19, #0
	csel	x1, x9, x8, eq
Lloh13:
	adrp	x0, l_.str@PAGE
Lloh14:
	add	x0, x0, l_.str@PAGEOFF
	bl	_gvt_err
LBB0_5:
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_I915_GTT_PAGE_SIZE,4,2         ; @I915_GTT_PAGE_SIZE
	.comm	_PIN_HIGH,4,2                   ; @PIN_HIGH
	.comm	_PIN_MAPPABLE,4,2               ; @PIN_MAPPABLE
	.comm	_I915_COLOR_UNEVICTABLE,4,2     ; @I915_COLOR_UNEVICTABLE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fail to alloc %s gm space from host\n"

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

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

	.no_dead_strip	_alloc_gm
.subsections_via_symbols
