	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_gvt_ggtt_gmadr_h2g       ## -- Begin function intel_gvt_ggtt_gmadr_h2g
	.p2align	4, 0x90
_intel_gvt_ggtt_gmadr_h2g:              ## @intel_gvt_ggtt_gmadr_h2g
	.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	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	callq	_gvt_gmadr_is_valid
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdx
	callq	_WARN
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_EACCES@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_6
LBB0_2:
	movl	(%rbx), %edi
	movq	%r15, %rsi
	callq	_gvt_gmadr_is_aperture
	movq	%rbx, %rdi
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	callq	_vgpu_aperture_gmadr_base
	movq	%rax, %r12
	movl	(%rbx), %edi
	callq	_gvt_aperture_gmadr_base
	jmp	LBB0_5
LBB0_4:
	callq	_vgpu_hidden_gmadr_base
	movq	%rax, %r12
	movl	(%rbx), %edi
	callq	_gvt_hidden_gmadr_base
LBB0_5:
	addq	%r15, %r12
	subq	%rax, %r12
	movq	%r12, (%r14)
	xorl	%eax, %eax
LBB0_6:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid host gmadr %llx\n"

	.comm	_EACCES,4,2                     ## @EACCES
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_gvt_ggtt_gmadr_h2g       ; -- Begin function intel_gvt_ggtt_gmadr_h2g
	.p2align	2
_intel_gvt_ggtt_gmadr_h2g:              ; @intel_gvt_ggtt_gmadr_h2g
	.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, x2
	mov	x20, x1
	mov	x21, x0
	ldr	w0, [x0]
	bl	_gvt_gmadr_is_valid
	cmp	w0, #0
	cset	w0, eq
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_WARN
	cbz	x0, LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _EACCES@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EACCES@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_6
LBB0_2:
	ldr	w0, [x21]
	mov	x1, x20
	bl	_gvt_gmadr_is_aperture
	cbz	x0, LBB0_4
; %bb.3:
	mov	x0, x21
	bl	_vgpu_aperture_gmadr_base
	mov	x22, x0
	ldr	w0, [x21]
	bl	_gvt_aperture_gmadr_base
	b	LBB0_5
LBB0_4:
	mov	x0, x21
	bl	_vgpu_hidden_gmadr_base
	mov	x22, x0
	ldr	w0, [x21]
	bl	_gvt_hidden_gmadr_base
LBB0_5:
	mov	x8, x0
	mov	w0, #0
	add	x9, x22, x20
	sub	x8, x9, x8
	str	x8, [x19]
LBB0_6:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid host gmadr %llx\n"

	.comm	_EACCES,4,2                     ; @EACCES
.subsections_via_symbols
