	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function virtio_pmem_flush
_virtio_pmem_flush:                     ## @virtio_pmem_flush
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	(%rdi), %r13
	movq	8(%r13), %r15
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_might_sleep
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$28, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movl	$0, (%rax)
	leaq	12(%rax), %rdi
	callq	_init_waitqueue_head
	leaq	16(%r12), %rdi
	callq	_init_waitqueue_head
	leaq	20(%r12), %rbx
	movq	%rbx, %rdi
	callq	_INIT_LIST_HEAD
	movq	_VIRTIO_PMEM_REQ_TYPE_FLUSH@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cpu_to_le32
	leaq	24(%r12), %rsi
	movl	%eax, 24(%r12)
	leaq	-96(%rbp), %r14
	movq	%r14, %rdi
	movl	$4, %edx
	callq	_sg_init_one
	movq	%r14, -64(%rbp)
	movq	%r12, %rsi
	addq	$8, %rsi
	leaq	-88(%rbp), %r14
	movq	%r14, %rdi
	movl	$4, %edx
	callq	_sg_init_one
	movq	%r14, -56(%rbp)
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	movl	4(%r15), %edi
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	leaq	-64(%rbp), %rsi
	movl	$1, %edx
	movl	$1, %ecx
	movq	%r12, %r8
	callq	_virtqueue_add_sgs
	movl	%eax, %r14d
	movq	_ENOSPC@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	jne	LBB0_6
## %bb.3:
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	leaq	8(%r15), %r13
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str(%rip), %rsi
	movq	%rcx, %rbx
	callq	_dev_info
	movl	$0, 4(%r12)
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	callq	_list_add_tail
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	movl	4(%r12), %esi
	movl	16(%r12), %edi
	callq	_wait_event
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	movl	4(%r15), %edi
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	leaq	-64(%rbp), %rsi
	movl	$1, %edx
	movl	$1, %ecx
	movq	%r12, %r8
	callq	_virtqueue_add_sgs
	movq	%rbx, %rcx
	movl	%eax, %r14d
	movl	(%rbx), %eax
	addl	%r14d, %eax
	je	LBB0_4
## %bb.5:
	movq	-72(%rbp), %r13                 ## 8-byte Reload
LBB0_6:
	movl	4(%r15), %edi
	callq	_virtqueue_kick
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	testl	%r14d, %r14d
	jne	LBB0_8
## %bb.7:
	testl	%ebx, %ebx
	je	LBB0_8
## %bb.9:
	movl	(%r12), %esi
	movl	12(%r12), %edi
	callq	_wait_event
	movl	8(%r12), %edi
	callq	_le32_to_cpu
	movl	%eax, %r14d
	jmp	LBB0_10
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	jmp	LBB0_11
LBB0_8:
	leaq	L_.str.1(%rip), %rsi
	movq	%r13, %rdi
	callq	_dev_info
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_10:
	movq	%r12, %rdi
	callq	_kfree
LBB0_11:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_13
## %bb.12:
	movl	%r14d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_VIRTIO_PMEM_REQ_TYPE_FLUSH,4,2 ## @VIRTIO_PMEM_REQ_TYPE_FLUSH
	.comm	_GFP_ATOMIC,4,2                 ## @GFP_ATOMIC
	.comm	_ENOSPC,4,2                     ## @ENOSPC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to send command to virtio pmem device, no free slots in the virtqueue\n"

L_.str.1:                               ## @.str.1
	.asciz	"failed to send command to virtio pmem device\n"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_virtio_pmem_flush
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function virtio_pmem_flush
_virtio_pmem_flush:                     ; @virtio_pmem_flush
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	ldr	x20, [x0]
	ldr	x21, [x20, #8]
	bl	_might_sleep
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	w0, #28
	bl	_kmalloc
	cbz	x0, LBB0_7
; %bb.1:
	mov	x19, x0
	mov	x23, x0
	str	wzr, [x23], #8
	add	x0, x0, #12
	bl	_init_waitqueue_head
	add	x0, x19, #16
	bl	_init_waitqueue_head
	add	x22, x19, #20
	mov	x0, x22
	bl	_INIT_LIST_HEAD
Lloh6:
	adrp	x8, _VIRTIO_PMEM_REQ_TYPE_FLUSH@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VIRTIO_PMEM_REQ_TYPE_FLUSH@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	bl	_cpu_to_le32
	mov	x1, x19
	str	w0, [x1, #24]!
	add	x24, sp, #16
	add	x0, sp, #16
	mov	w2, #4
	bl	_sg_init_one
	str	x24, [sp, #24]
	add	x24, sp, #8
	add	x0, sp, #8
	mov	x1, x23
	mov	w2, #4
	bl	_sg_init_one
	str	x24, [sp, #32]
	mov	x0, x21
	bl	_spin_lock_irqsave
	ldr	w0, [x21, #4]
Lloh9:
	adrp	x26, _GFP_ATOMIC@GOTPAGE
Lloh10:
	ldr	x26, [x26, _GFP_ATOMIC@GOTPAGEOFF]
	ldr	w5, [x26]
	add	x1, sp, #24
	mov	w2, #1
	mov	w3, #1
	mov	x4, x19
	bl	_virtqueue_add_sgs
	mov	x25, x0
Lloh11:
	adrp	x27, _ENOSPC@GOTPAGE
Lloh12:
	ldr	x27, [x27, _ENOSPC@GOTPAGEOFF]
	ldr	w8, [x27]
	cmn	w0, w8
	b.ne	LBB0_5
; %bb.2:
	add	x23, x21, #8
Lloh13:
	adrp	x24, l_.str@PAGE
Lloh14:
	add	x24, x24, l_.str@PAGEOFF
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x24
	bl	_dev_info
	str	wzr, [x19, #4]
	mov	x0, x22
	mov	x1, x23
	bl	_list_add_tail
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	ldr	w0, [x19, #16]
	ldr	w1, [x19, #4]
	bl	_wait_event
	mov	x0, x21
	bl	_spin_lock_irqsave
	ldr	w0, [x21, #4]
	ldr	w5, [x26]
	add	x1, sp, #24
	mov	w2, #1
	mov	w3, #1
	mov	x4, x19
	bl	_virtqueue_add_sgs
	ldr	w8, [x27]
	cmn	w0, w8
	b.eq	LBB0_3
; %bb.4:
	mov	x25, x0
LBB0_5:
	ldr	w0, [x21, #4]
	bl	_virtqueue_kick
	mov	x22, x0
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	cmp	w25, #0
	ccmp	w22, #0, #4, eq
	b.ne	LBB0_8
; %bb.6:
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_dev_info
Lloh17:
	adrp	x8, _EIO@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_9
LBB0_7:
Lloh20:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_10
LBB0_8:
	ldr	w0, [x19, #12]
	ldr	w1, [x19]
	bl	_wait_event
	ldr	w0, [x19, #8]
	bl	_le32_to_cpu
	mov	x20, x0
LBB0_9:
	mov	x0, x19
	bl	_kfree
LBB0_10:
	ldr	x8, [sp, #40]
Lloh23:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh24:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.11:
	mov	x0, x20
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_VIRTIO_PMEM_REQ_TYPE_FLUSH,4,2 ; @VIRTIO_PMEM_REQ_TYPE_FLUSH
	.comm	_GFP_ATOMIC,4,2                 ; @GFP_ATOMIC
	.comm	_ENOSPC,4,2                     ; @ENOSPC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to send command to virtio pmem device, no free slots in the virtqueue\n"

l_.str.1:                               ; @.str.1
	.asciz	"failed to send command to virtio pmem device\n"

	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_virtio_pmem_flush
.subsections_via_symbols
