	.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	$40, %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), %rax
	movl	12(%rax), %r15d
	movl	$0, -56(%rbp)
	movl	$512, -52(%rbp)                 ## 4-byte Folded Spill
                                        ## imm = 0x200
	movb	$1, %al
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	xorl	%eax, %eax
	movq	_trans_id@GOTPCREL(%rip), %r13
	movq	_VM_PKT_DATA_INBAND@GOTPCREL(%rip), %r14
	movq	_EAGAIN@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
	subl	%eax, %r15d
	movq	_send_buffer@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_memset
	movq	_DM_BALLOON_RESPONSE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	movl	$32, 16(%rbx)
	movl	$1, (%rbx)
	movq	_dm_device@GOTPCREL(%rip), %rdi
	movl	%r15d, %esi
	movq	%rbx, %rdx
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	leaq	-56(%rbp), %r8
	callq	_alloc_balloon_pages
                                        ## kill: def $eax killed $eax def $rax
	movl	-56(%rbp), %edx
	testl	%edx, %edx
	setne	%cl
	testb	%cl, -48(%rbp)                  ## 1-byte Folded Reload
	jne	LBB0_2
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	testl	%edx, %edx
	setne	%cl
	movl	%r15d, -60(%rbp)                ## 4-byte Spill
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	cmpl	%r15d, %eax
	sete	%al
	orb	%cl, %al
	movb	%al, -41(%rbp)                  ## 1-byte Spill
	cmpb	$1, %al
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	$0, (%rbx)
	movq	_DM_INITIALIZED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_dm_device@GOTPCREL(%rip), %rcx
	movl	%eax, 8(%rcx)
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=2
	cmpl	%eax, %r15d
	jne	LBB0_8
LBB0_5:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r13, %rdi
	callq	_atomic_inc_return
	movl	%eax, 20(%rbx)
	movq	_dm_device@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	movl	16(%rbx), %edx
	movl	(%r14), %r8d
	movq	%rbx, %rsi
	xorl	%ecx, %ecx
	xorl	%r9d, %r9d
	callq	_vmbus_sendpacket
	movl	%eax, %r15d
	xorl	%eax, %eax
	subl	(%r12), %eax
	cmpl	%eax, %r15d
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=2
	movl	$20, %edi
	callq	_msleep
	xorl	%eax, %eax
	subl	(%r12), %eax
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_1 Depth=1
	testl	%r15d, %r15d
	jne	LBB0_9
## %bb.12:                              ##   in Loop: Header=BB0_1 Depth=1
	cmpb	$0, -41(%rbp)                   ## 1-byte Folded Reload
	movl	-60(%rbp), %r15d                ## 4-byte Reload
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	je	LBB0_1
	jmp	LBB0_13
LBB0_2:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	$1, -52(%rbp)                   ## 4-byte Folded Spill
	movl	$0, -48(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_1
LBB0_9:
	leaq	L_.str(%rip), %rdi
	callq	_pr_info
	cmpl	$0, 4(%rbx)
	jle	LBB0_13
## %bb.10:
	xorl	%r15d, %r15d
	movq	_dm_device@GOTPCREL(%rip), %r14
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%rbx), %rsi
	addq	%r15, %rsi
	movq	%r14, %rdi
	callq	_free_balloon_pages
	incq	%r12
	movslq	4(%rbx), %rax
	addq	$4, %r15
	cmpq	%rax, %r12
	jl	LBB0_11
LBB0_13:
	addq	$40, %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	_send_buffer,8,3                ## @send_buffer
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_DM_BALLOON_RESPONSE,4,2        ## @DM_BALLOON_RESPONSE
	.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
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.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
	mov	w21, #0
Lloh0:
	adrp	x19, _dm_device@GOTPAGE
Lloh1:
	ldr	x19, [x19, _dm_device@GOTPAGEOFF]
	ldr	w20, [x19, #12]
	mov	w8, #512
	stp	w8, wzr, [sp, #8]               ; 4-byte Folded Spill
	mov	w27, #1
Lloh2:
	adrp	x24, _trans_id@GOTPAGE
Lloh3:
	ldr	x24, [x24, _trans_id@GOTPAGEOFF]
Lloh4:
	adrp	x28, _VM_PKT_DATA_INBAND@GOTPAGE
Lloh5:
	ldr	x28, [x28, _VM_PKT_DATA_INBAND@GOTPAGEOFF]
Lloh6:
	adrp	x26, _EAGAIN@GOTPAGE
Lloh7:
	ldr	x26, [x26, _EAGAIN@GOTPAGEOFF]
LBB0_1:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
Lloh8:
	adrp	x8, _send_buffer@GOTPAGE
Lloh9:
	ldr	x8, [x8, _send_buffer@GOTPAGEOFF]
Lloh10:
	ldr	x23, [x8]
Lloh11:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	mov	x0, x23
	mov	w1, #0
	bl	_memset
Lloh14:
	adrp	x8, _DM_BALLOON_RESPONSE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _DM_BALLOON_RESPONSE@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	str	w8, [x23, #24]
	mov	w8, #32
	str	w8, [x23, #16]
	mov	w8, #1
	str	w8, [x23]
	sub	w20, w20, w21
	add	x4, sp, #12
	mov	x0, x19
	mov	x1, x20
	mov	x2, x23
	ldr	w3, [sp, #8]                    ; 4-byte Folded Reload
	bl	_alloc_balloon_pages
	mov	x21, x0
	ldr	w8, [sp, #12]
	cmp	w8, #0
	cset	w9, ne
	and	w9, w9, w27
	tbnz	w9, #0, LBB0_9
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	cmp	w8, #0
	ccmp	w21, w20, #4, eq
	cset	w22, eq
	b.ne	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	str	wzr, [x23]
Lloh17:
	adrp	x8, _DM_INITIALIZED@GOTPAGE
Lloh18:
	ldr	x8, [x8, _DM_INITIALIZED@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	str	w8, [x19, #8]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=2
	neg	w8, w8
	cmp	w25, w8
	b.ne	LBB0_7
LBB0_5:                                 ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x24
	bl	_atomic_inc_return
	str	w0, [x23, #20]
	ldr	x8, [x19]
	ldr	w0, [x8]
	ldr	w2, [x23, #16]
	ldr	w4, [x28]
	mov	x1, x23
	mov	x3, #0
	mov	w5, #0
	bl	_vmbus_sendpacket
	mov	x25, x0
	ldr	w8, [x26]
	cmn	w0, w8
	b.ne	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
	mov	w0, #20
	bl	_msleep
	ldr	w8, [x26]
	b	LBB0_4
LBB0_7:                                 ;   in Loop: Header=BB0_1 Depth=1
	cbnz	w25, LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_1 Depth=1
	cbz	w22, LBB0_1
	b	LBB0_13
LBB0_9:                                 ;   in Loop: Header=BB0_1 Depth=1
	mov	w27, #0
	mov	w8, #1
	str	w8, [sp, #8]                    ; 4-byte Folded Spill
	b	LBB0_1
LBB0_10:
Lloh20:
	adrp	x0, l_.str@PAGE
Lloh21:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_info
	ldr	w8, [x23, #4]
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.11:
	mov	x20, #0
	mov	x21, #0
Lloh22:
	adrp	x19, _dm_device@GOTPAGE
Lloh23:
	ldr	x19, [x19, _dm_device@GOTPAGEOFF]
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x23, #8]
	add	x1, x8, x20
	mov	x0, x19
	bl	_free_balloon_pages
	add	x21, x21, #1
	ldrsw	x8, [x23, #4]
	add	x20, x20, #4
	cmp	x21, x8
	b.lt	LBB0_12
LBB0_13:
	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	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_dm_device,16,3                 ; @dm_device
	.comm	_send_buffer,8,3                ; @send_buffer
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_DM_BALLOON_RESPONSE,4,2        ; @DM_BALLOON_RESPONSE
	.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
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Balloon response failed\n"

	.no_dead_strip	_balloon_up
.subsections_via_symbols
