	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function balloon_up
_balloon_up:                            ## @balloon_up
	.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	_dm_device@GOTPCREL(%rip), %rbx
	movl	12(%rbx), %r13d
	movq	_PAGES_IN_2M@GOTPCREL(%rip), %r14
	movl	%r13d, %eax
	xorl	%edx, %edx
	divl	(%r14)
	xorl	%edi, %edi
	testl	%edx, %edx
	setne	%dil
	callq	_WARN_ON_ONCE
	xorl	%eax, %eax
	callq	_si_mem_available
	movq	%rax, %r15
	xorl	%eax, %eax
	callq	_compute_balloon_floor
	movq	%rax, %r12
	movq	%r15, %rax
	subq	%r13, %rax
	jge	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_4
LBB0_2:
	movq	%r13, %rcx
	cmpq	%r12, %rax
	jae	LBB0_5
## %bb.3:
	leaq	L_.str.2(%rip), %rsi
LBB0_4:
	leaq	L_.str(%rip), %rdi
	callq	_pr_warn
	xorl	%ecx, %ecx
	subq	%r12, %r15
	cmovaeq	%r15, %rcx
	movl	%ecx, %eax
	xorl	%edx, %edx
	divl	(%r14)
	subl	%edx, %ecx
LBB0_5:
	movl	$512, -52(%rbp)                 ## 4-byte Folded Spill
                                        ## imm = 0x200
	movb	$1, %al
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_trans_id@GOTPCREL(%rip), %r13
	movq	_EAGAIN@GOTPCREL(%rip), %r15
	movq	%rcx, %r14
LBB0_6:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
                                        ##       Child Loop BB0_12 Depth 3
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_7:                                 ##   Parent Loop BB0_6 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_12 Depth 3
	subl	%eax, %r14d
	movq	_balloon_up_send_buffer@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_memset
	movq	(%r12), %r12
	movq	_DM_BALLOON_RESPONSE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%r12)
	movl	$32, 16(%r12)
	movl	$1, (%r12)
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movq	%r12, %rdx
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	callq	_alloc_balloon_pages
	testl	%eax, %eax
	sete	%cl
	testb	%cl, -48(%rbp)                  ## 1-byte Folded Reload
	jne	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=2
	testl	%eax, %eax
	sete	%cl
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	cmpl	%r14d, %eax
	sete	%al
	orb	%cl, %al
	movb	%al, -41(%rbp)                  ## 1-byte Spill
	cmpb	$1, %al
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=2
	movl	12(%rbx), %edx
	leaq	L_.str.3(%rip), %rdi
	movl	%r14d, %esi
	callq	_pr_debug
	movl	$0, (%r12)
	movq	_DM_INITIALIZED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
LBB0_11:                                ##   in Loop: Header=BB0_7 Depth=2
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_12 Depth=3
	movq	%rbx, %rdi
	callq	_post_status
	movl	(%r15), %eax
	addl	%r14d, %eax
	jne	LBB0_15
LBB0_12:                                ##   Parent Loop BB0_6 Depth=1
                                        ##     Parent Loop BB0_7 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	%r13, %rdi
	callq	_atomic_inc_return
	movl	%eax, 20(%r12)
	movq	(%rbx), %rax
	movl	(%rax), %edi
	movl	16(%r12), %edx
	movq	_VM_PKT_DATA_INBAND@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r12, %rsi
	xorl	%ecx, %ecx
	xorl	%r9d, %r9d
	callq	_vmbus_sendpacket
	movl	%eax, %r14d
	movl	(%r15), %eax
	addl	%r14d, %eax
	jne	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=3
	movl	$20, %edi
	callq	_msleep
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_7 Depth=2
	testl	%r14d, %r14d
	jne	LBB0_16
## %bb.19:                              ##   in Loop: Header=BB0_7 Depth=2
	cmpb	$0, -41(%rbp)                   ## 1-byte Folded Reload
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movl	-56(%rbp), %eax                 ## 4-byte Reload
	je	LBB0_7
	jmp	LBB0_20
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	movl	$1, -52(%rbp)                   ## 4-byte Folded Spill
	movl	$0, -48(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_6
LBB0_16:
	leaq	L_.str.4(%rip), %rdi
	callq	_pr_err
	cmpl	$0, 4(%r12)
	jle	LBB0_20
## %bb.17:
	xorl	%r15d, %r15d
	movq	_dm_device@GOTPCREL(%rip), %r14
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rsi
	addq	%r15, %rsi
	movq	%r14, %rdi
	callq	_free_balloon_pages
	incq	%rbx
	movslq	4(%r12), %rax
	addq	$4, %r15
	cmpq	%rax, %rbx
	jl	LBB0_18
LBB0_20:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_dm_device,16,3                 ## @dm_device
	.comm	_PAGES_IN_2M,4,2                ## @PAGES_IN_2M
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Balloon request will be partially fulfilled. %s\n"

L_.str.1:                               ## @.str.1
	.asciz	"Not enough memory."

L_.str.2:                               ## @.str.2
	.asciz	"Balloon floor reached."

	.comm	_balloon_up_send_buffer,8,3     ## @balloon_up_send_buffer
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_DM_BALLOON_RESPONSE,4,2        ## @DM_BALLOON_RESPONSE
L_.str.3:                               ## @.str.3
	.asciz	"Ballooned %u out of %u requested pages.\n"

	.comm	_DM_INITIALIZED,4,2             ## @DM_INITIALIZED
	.comm	_trans_id,4,2                   ## @trans_id
	.comm	_VM_PKT_DATA_INBAND,4,2         ## @VM_PKT_DATA_INBAND
	.comm	_EAGAIN,4,2                     ## @EAGAIN
L_.str.4:                               ## @.str.4
	.asciz	"Balloon response failed\n"

	.no_dead_strip	_balloon_up
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function balloon_up
_balloon_up:                            ; @balloon_up
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
Lloh0:
	adrp	x19, _dm_device@GOTPAGE
Lloh1:
	ldr	x19, [x19, _dm_device@GOTPAGEOFF]
Lloh2:
	adrp	x23, _PAGES_IN_2M@GOTPAGE
Lloh3:
	ldr	x23, [x23, _PAGES_IN_2M@GOTPAGEOFF]
	ldr	w20, [x19, #12]
	ldr	w8, [x23]
	udiv	w9, w20, w8
	msub	w8, w9, w8, w20
	cmp	w8, #0
	cset	w0, ne
	bl	_WARN_ON_ONCE
	bl	_si_mem_available
	mov	x21, x0
	bl	_compute_balloon_floor
	mov	x22, x0
	subs	x8, x21, x20
	b.ge	LBB0_2
; %bb.1:
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_4
LBB0_2:
	cmp	x8, x22
	b.hs	LBB0_5
; %bb.3:
Lloh6:
	adrp	x1, l_.str.2@PAGE
Lloh7:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_4:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_warn
	subs	x8, x21, x22
	csel	x8, xzr, x8, lo
	ldr	w9, [x23]
	udiv	w8, w8, w9
	mul	w20, w8, w9
LBB0_5:
	mov	w8, #512
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
	mov	w22, #1
Lloh10:
	adrp	x23, _trans_id@GOTPAGE
Lloh11:
	ldr	x23, [x23, _trans_id@GOTPAGEOFF]
Lloh12:
	adrp	x28, _VM_PKT_DATA_INBAND@GOTPAGE
Lloh13:
	ldr	x28, [x28, _VM_PKT_DATA_INBAND@GOTPAGEOFF]
Lloh14:
	adrp	x27, _EAGAIN@GOTPAGE
Lloh15:
	ldr	x27, [x27, _EAGAIN@GOTPAGEOFF]
LBB0_6:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
                                        ;       Child Loop BB0_11 Depth 3
	mov	w25, #0
LBB0_7:                                 ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_11 Depth 3
Lloh16:
	adrp	x21, _balloon_up_send_buffer@GOTPAGE
Lloh17:
	ldr	x21, [x21, _balloon_up_send_buffer@GOTPAGEOFF]
	ldr	x0, [x21]
Lloh18:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_memset
	ldr	x24, [x21]
Lloh21:
	adrp	x8, _DM_BALLOON_RESPONSE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _DM_BALLOON_RESPONSE@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	str	w8, [x24, #24]
	mov	w8, #32
	str	w8, [x24, #16]
	mov	w8, #1
	str	w8, [x24]
	sub	w20, w20, w25
	mov	x0, x19
	mov	x1, x20
	mov	x2, x24
	ldr	w3, [sp, #12]                   ; 4-byte Folded Reload
	bl	_alloc_balloon_pages
	cmp	w0, #0
	cset	w8, eq
	and	w8, w22, w8
	tbnz	w8, #0, LBB0_15
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	mov	x25, x0
	cmp	w0, #0
	ccmp	w0, w20, #4, ne
	cset	w21, eq
	b.ne	LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=2
	ldr	w2, [x19, #12]
Lloh24:
	adrp	x0, l_.str.3@PAGE
Lloh25:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x20
	bl	_pr_debug
	str	wzr, [x24]
Lloh26:
	adrp	x8, _DM_INITIALIZED@GOTPAGE
Lloh27:
	ldr	x8, [x8, _DM_INITIALIZED@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	str	w8, [x19, #8]
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=3
	mov	x0, x19
	bl	_post_status
	ldr	w8, [x27]
	cmn	w26, w8
	b.ne	LBB0_13
LBB0_11:                                ;   Parent Loop BB0_6 Depth=1
                                        ;     Parent Loop BB0_7 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	mov	x0, x23
	bl	_atomic_inc_return
	str	w0, [x24, #20]
	ldr	x8, [x19]
	ldr	w0, [x8]
	ldr	w2, [x24, #16]
	ldr	w4, [x28]
	mov	x1, x24
	mov	x3, #0
	mov	w5, #0
	bl	_vmbus_sendpacket
	mov	x26, x0
	ldr	w8, [x27]
	cmn	w0, w8
	b.ne	LBB0_10
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=3
	mov	w0, #20
	bl	_msleep
	b	LBB0_10
LBB0_13:                                ;   in Loop: Header=BB0_7 Depth=2
	cbnz	w26, LBB0_16
; %bb.14:                               ;   in Loop: Header=BB0_7 Depth=2
	cbz	w21, LBB0_7
	b	LBB0_19
LBB0_15:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	w22, #0
	mov	w8, #1
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
	b	LBB0_6
LBB0_16:
Lloh29:
	adrp	x0, l_.str.4@PAGE
Lloh30:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_pr_err
	ldr	w8, [x24, #4]
	cmp	w8, #1
	b.lt	LBB0_19
; %bb.17:
	mov	x20, #0
	mov	x21, #0
Lloh31:
	adrp	x19, _dm_device@GOTPAGE
Lloh32:
	ldr	x19, [x19, _dm_device@GOTPAGEOFF]
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x24, #8]
	add	x1, x8, x20
	mov	x0, x19
	bl	_free_balloon_pages
	add	x21, x21, #1
	ldrsw	x8, [x24, #4]
	add	x20, x20, #4
	cmp	x21, x8
	b.lt	LBB0_18
LBB0_19:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_dm_device,16,3                 ; @dm_device
	.comm	_PAGES_IN_2M,4,2                ; @PAGES_IN_2M
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Balloon request will be partially fulfilled. %s\n"

l_.str.1:                               ; @.str.1
	.asciz	"Not enough memory."

l_.str.2:                               ; @.str.2
	.asciz	"Balloon floor reached."

	.comm	_balloon_up_send_buffer,8,3     ; @balloon_up_send_buffer
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_DM_BALLOON_RESPONSE,4,2        ; @DM_BALLOON_RESPONSE
l_.str.3:                               ; @.str.3
	.asciz	"Ballooned %u out of %u requested pages.\n"

	.comm	_DM_INITIALIZED,4,2             ; @DM_INITIALIZED
	.comm	_trans_id,4,2                   ; @trans_id
	.comm	_VM_PKT_DATA_INBAND,4,2         ; @VM_PKT_DATA_INBAND
	.comm	_EAGAIN,4,2                     ; @EAGAIN
l_.str.4:                               ; @.str.4
	.asciz	"Balloon response failed\n"

	.no_dead_strip	_balloon_up
.subsections_via_symbols
