	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_vgt_balloon              ## -- Begin function intel_vgt_balloon
	.p2align	4, 0x90
_intel_vgt_balloon:                     ## @intel_vgt_balloon
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %r14
	movq	16(%rdi), %r13
	movq	%r13, %rdi
	callq	_intel_vgpu_active
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	_avail_rs@GOTPCREL(%rip), %rax
	movl	12(%rax), %edi
	movq	%rax, %r15
	callq	_vgtif_reg
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_intel_uncore_read
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%rax, %r12
	movl	8(%r15), %edi
	callq	_vgtif_reg
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_intel_uncore_read
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	%rax, %r14
	movl	4(%r15), %edi
	movq	%r15, %rbx
	callq	_vgtif_reg
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_intel_uncore_read
	movq	%rax, %r15
	movl	(%rbx), %edi
	callq	_vgtif_reg
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_intel_uncore_read
	movq	%rax, %r13
	leaq	(%r14,%r12), %rbx
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_INFO
	shrq	$10, %r14
	leaq	L_.str.1(%rip), %rdi
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	%r12, %rsi
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	movq	%r14, %rdx
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_DRM_INFO
	movq	%r13, %rdx
	shrq	$10, %rdx
	leaq	L_.str.2(%rip), %rdi
	movq	%r15, %rsi
	xorl	%eax, %eax
	callq	_DRM_INFO
	movq	(%r12), %rdx
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	cmpq	%rdx, %rbx
	ja	LBB0_5
## %bb.3:
	cmpq	%rdx, %r15
	jb	LBB0_5
## %bb.4:
	addq	%r15, %r13
	cmpq	%r14, %r13
	ja	LBB0_5
## %bb.6:
	cmpq	%rdx, %r15
	jbe	LBB0_8
## %bb.7:
	movq	_bl_info@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	$8, %rsi
	movq	%r12, %rdi
	movq	%r15, %rcx
	callq	_vgt_balloon_space
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_18
LBB0_8:
	cmpq	%r14, %r13
	jae	LBB0_10
## %bb.9:
	movq	_bl_info@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	$12, %rsi
	movq	%r12, %rdi
	movq	%r13, %rdx
	movq	%r14, %rcx
	callq	_vgt_balloon_space
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_17
LBB0_10:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	testq	%rcx, %rcx
	je	LBB0_12
## %bb.11:
	movq	_bl_info@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_vgt_balloon_space
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
LBB0_12:
	movq	(%r12), %rcx
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	cmpq	%rcx, %rdx
	jae	LBB0_14
## %bb.13:
	movq	_bl_info@GOTPCREL(%rip), %r14
	movq	(%r14), %rsi
	addq	$4, %rsi
	movq	%r12, %rdi
	callq	_vgt_balloon_space
	testl	%eax, %eax
	je	LBB0_14
## %bb.15:
	movl	%eax, %ebx
	movq	(%r14), %rsi
	movq	%r12, %rdi
	callq	_vgt_deballoon_space
LBB0_16:
	movq	_bl_info@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	$12, %rsi
	movq	%r12, %rdi
	callq	_vgt_deballoon_space
LBB0_17:
	movq	_bl_info@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	$8, %rsi
	movq	%r12, %rdi
	callq	_vgt_deballoon_space
LBB0_18:
	leaq	L_.str.5(%rip), %rdi
	callq	_DRM_ERROR
	jmp	LBB0_19
LBB0_1:
	xorl	%ebx, %ebx
	jmp	LBB0_19
LBB0_5:
	leaq	L_.str.3(%rip), %rdi
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_19:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	leaq	L_.str.4(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DRM_INFO
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_avail_rs,16,2                  ## @avail_rs
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"VGT ballooning configuration:\n"

L_.str.1:                               ## @.str.1
	.asciz	"Mappable graphic memory: base 0x%lx size %ldKiB\n"

L_.str.2:                               ## @.str.2
	.asciz	"Unmappable graphic memory: base 0x%lx size %ldKiB\n"

L_.str.3:                               ## @.str.3
	.asciz	"Invalid ballooning configuration!\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_bl_info,8,3                    ## @bl_info
L_.str.4:                               ## @.str.4
	.asciz	"VGT balloon successfully\n"

L_.str.5:                               ## @.str.5
	.asciz	"VGT balloon fail\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_vgt_balloon              ; -- Begin function intel_vgt_balloon
	.p2align	2
_intel_vgt_balloon:                     ; @intel_vgt_balloon
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x19, x0
	ldp	x20, x22, [x0, #8]
	mov	x0, x22
	bl	_intel_vgpu_active
	cbz	w0, LBB0_3
; %bb.1:
Lloh0:
	adrp	x24, _avail_rs@GOTPAGE
Lloh1:
	ldr	x24, [x24, _avail_rs@GOTPAGEOFF]
	ldr	w0, [x24, #12]
	bl	_vgtif_reg
	mov	x1, x0
	mov	x0, x22
	bl	_intel_uncore_read
	mov	x21, x0
	ldr	w0, [x24, #8]
	bl	_vgtif_reg
	mov	x1, x0
	mov	x0, x22
	bl	_intel_uncore_read
	mov	x25, x0
	ldr	w0, [x24, #4]
	bl	_vgtif_reg
	mov	x1, x0
	mov	x0, x22
	bl	_intel_uncore_read
	mov	x23, x0
	ldr	w0, [x24]
	bl	_vgtif_reg
	mov	x1, x0
	mov	x0, x22
	bl	_intel_uncore_read
	mov	x26, x0
	add	x22, x25, x21
	add	x24, x0, x23
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_INFO
	lsr	x8, x25, #10
	stp	x21, x8, [sp]
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_INFO
	lsr	x8, x26, #10
	stp	x23, x8, [sp]
Lloh6:
	adrp	x0, l_.str.2@PAGE
Lloh7:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_INFO
	ldr	x2, [x19]
	cmp	x22, x2
	ccmp	x23, x2, #0, ls
	ccmp	x24, x20, #2, hs
	b.ls	LBB0_4
; %bb.2:
Lloh8:
	adrp	x0, l_.str.3@PAGE
Lloh9:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DRM_ERROR
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_16
LBB0_3:
	mov	w23, #0
	b	LBB0_16
LBB0_4:
Lloh13:
	adrp	x25, _bl_info@GOTPAGE
Lloh14:
	ldr	x25, [x25, _bl_info@GOTPAGEOFF]
	cmp	x23, x2
	b.ls	LBB0_6
; %bb.5:
	ldr	x8, [x25]
	add	x1, x8, #8
	mov	x0, x19
	mov	x3, x23
	bl	_vgt_balloon_space
	mov	x23, x0
	cbnz	w0, LBB0_15
LBB0_6:
	cmp	x24, x20
	b.hs	LBB0_8
; %bb.7:
	ldr	x8, [x25]
	add	x1, x8, #12
	mov	x0, x19
	mov	x2, x24
	mov	x3, x20
	bl	_vgt_balloon_space
	mov	x23, x0
	cbnz	w0, LBB0_14
LBB0_8:
	cbz	x21, LBB0_10
; %bb.9:
	ldr	x1, [x25]
	mov	x0, x19
	mov	x2, #0
	mov	x3, x21
	bl	_vgt_balloon_space
	mov	x23, x0
	cbnz	w0, LBB0_13
LBB0_10:
	ldr	x3, [x19]
	cmp	x22, x3
	b.hs	LBB0_17
; %bb.11:
	ldr	x8, [x25]
	add	x1, x8, #4
	mov	x0, x19
	mov	x2, x22
	bl	_vgt_balloon_space
	cbz	w0, LBB0_17
; %bb.12:
	mov	x23, x0
	ldr	x1, [x25]
	mov	x0, x19
	bl	_vgt_deballoon_space
LBB0_13:
	ldr	x8, [x25]
	add	x1, x8, #12
	mov	x0, x19
	bl	_vgt_deballoon_space
LBB0_14:
	ldr	x8, [x25]
	add	x1, x8, #8
	mov	x0, x19
	bl	_vgt_deballoon_space
LBB0_15:
Lloh15:
	adrp	x0, l_.str.5@PAGE
Lloh16:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_DRM_ERROR
LBB0_16:
	mov	x0, x23
	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
	add	sp, sp, #96
	ret
LBB0_17:
Lloh17:
	adrp	x0, l_.str.4@PAGE
Lloh18:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_DRM_INFO
	mov	w23, #0
	b	LBB0_16
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_avail_rs,16,2                  ; @avail_rs
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"VGT ballooning configuration:\n"

l_.str.1:                               ; @.str.1
	.asciz	"Mappable graphic memory: base 0x%lx size %ldKiB\n"

l_.str.2:                               ; @.str.2
	.asciz	"Unmappable graphic memory: base 0x%lx size %ldKiB\n"

l_.str.3:                               ; @.str.3
	.asciz	"Invalid ballooning configuration!\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_bl_info,8,3                    ; @bl_info
l_.str.4:                               ; @.str.4
	.asciz	"VGT balloon successfully\n"

l_.str.5:                               ; @.str.5
	.asciz	"VGT balloon fail\n"

.subsections_via_symbols
