	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vmballoon_reset
_vmballoon_reset:                       ## @vmballoon_reset
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	leaq	8(%rdi), %r14
	movq	%r14, %rdi
	callq	_down_write
	movq	%rbx, %rdi
	callq	_vmballoon_vmci_cleanup
	movq	%rbx, %rdi
	callq	_vmballoon_pop
	movq	_VMW_BALLOON_CAPABILITIES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_vmballoon_send_start
	testl	%eax, %eax
	je	LBB0_1
LBB0_10:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_up_write                       ## TAILCALL
LBB0_1:
	movl	(%rbx), %eax
	movq	_VMW_BALLOON_BATCHED_CMDS@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_4
## %bb.2:
	movq	%rbx, %rdi
	callq	_vmballoon_init_batching
	testq	%rax, %rax
	je	LBB0_6
## %bb.3:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_vmballoon_send_start
	jmp	LBB0_10
LBB0_4:
	movq	_VMW_BALLOON_BASIC_CMDS@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_6
## %bb.5:
	movq	%rbx, %rdi
	callq	_vmballoon_deinit_batching
LBB0_6:
	movq	_VMW_BALLOON_STAT_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_vmballoon_stats_gen_inc
	movl	$0, 4(%rbx)
	movq	%rbx, %rdi
	callq	_vmballoon_vmci_init
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
LBB0_8:
	movq	%rbx, %rdi
	callq	_vmballoon_send_guest_id
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	leaq	L_.str.1(%rip), %rdi
	callq	_pr_err
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_VMW_BALLOON_CAPABILITIES,4,2   ## @VMW_BALLOON_CAPABILITIES
	.comm	_VMW_BALLOON_BATCHED_CMDS,4,2   ## @VMW_BALLOON_BATCHED_CMDS
	.comm	_VMW_BALLOON_BASIC_CMDS,4,2     ## @VMW_BALLOON_BASIC_CMDS
	.comm	_VMW_BALLOON_STAT_RESET,4,2     ## @VMW_BALLOON_STAT_RESET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to initialize vmci doorbell\n"

L_.str.1:                               ## @.str.1
	.asciz	"failed to send guest ID to the host\n"

	.no_dead_strip	_vmballoon_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vmballoon_reset
_vmballoon_reset:                       ; @vmballoon_reset
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x0
	add	x19, x0, #8
	mov	x0, x19
	bl	_down_write
	mov	x0, x20
	bl	_vmballoon_vmci_cleanup
	mov	x0, x20
	bl	_vmballoon_pop
Lloh0:
	adrp	x8, _VMW_BALLOON_CAPABILITIES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VMW_BALLOON_CAPABILITIES@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_vmballoon_send_start
	cbz	w0, LBB0_2
LBB0_1:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_up_write
LBB0_2:
	ldr	w8, [x20]
Lloh3:
	adrp	x9, _VMW_BALLOON_BATCHED_CMDS@GOTPAGE
Lloh4:
	ldr	x9, [x9, _VMW_BALLOON_BATCHED_CMDS@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.3:
	mov	x0, x20
	bl	_vmballoon_init_batching
	cbz	x0, LBB0_7
; %bb.4:
	mov	x0, x20
	mov	w1, #0
	bl	_vmballoon_send_start
	b	LBB0_1
LBB0_5:
Lloh6:
	adrp	x9, _VMW_BALLOON_BASIC_CMDS@GOTPAGE
Lloh7:
	ldr	x9, [x9, _VMW_BALLOON_BASIC_CMDS@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.6:
	mov	x0, x20
	bl	_vmballoon_deinit_batching
LBB0_7:
Lloh9:
	adrp	x8, _VMW_BALLOON_STAT_RESET@GOTPAGE
Lloh10:
	ldr	x8, [x8, _VMW_BALLOON_STAT_RESET@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_vmballoon_stats_gen_inc
	str	wzr, [x20, #4]
	mov	x0, x20
	bl	_vmballoon_vmci_init
	cbz	w0, LBB0_9
; %bb.8:
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
LBB0_9:
	mov	x0, x20
	bl	_vmballoon_send_guest_id
	cbz	x0, LBB0_1
; %bb.10:
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_err
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_VMW_BALLOON_CAPABILITIES,4,2   ; @VMW_BALLOON_CAPABILITIES
	.comm	_VMW_BALLOON_BATCHED_CMDS,4,2   ; @VMW_BALLOON_BATCHED_CMDS
	.comm	_VMW_BALLOON_BASIC_CMDS,4,2     ; @VMW_BALLOON_BASIC_CMDS
	.comm	_VMW_BALLOON_STAT_RESET,4,2     ; @VMW_BALLOON_STAT_RESET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to initialize vmci doorbell\n"

l_.str.1:                               ; @.str.1
	.asciz	"failed to send guest ID to the host\n"

	.no_dead_strip	_vmballoon_reset
.subsections_via_symbols
