	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kvm_emulate_pio_string         ## -- Begin function kvm_emulate_pio_string
	.p2align	4, 0x90
_kvm_emulate_pio_string:                ## @kvm_emulate_pio_string
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -48(%rbp)                 ## 4-byte Spill
	movq	%rcx, %r15
	movl	%edx, %r12d
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movl	24(%rbp), %eax
	xorl	%edi, %edi
	testl	%esi, %esi
	sete	%dil
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	jne	LBB0_1
## %bb.2:
	movq	_KVM_EXIT_IO_OUT@GOTPCREL(%rip), %r13
	jmp	LBB0_3
LBB0_1:
	movq	_KVM_EXIT_IO_IN@GOTPCREL(%rip), %r13
LBB0_3:
	movl	%eax, %esi
	movl	%r12d, %edx
	movq	%r15, %rcx
	callq	_trace_kvm_pio
	movq	_KVM_EXIT_IO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	48(%rbx), %rcx
	movl	%eax, 24(%rcx)
	movl	(%r13), %eax
	movl	%eax, 20(%rcx)
	movl	%r12d, (%rbx)
	movl	%r12d, (%rcx)
	movq	_KVM_PIO_PAGE_OFFSET@GOTPCREL(%rip), %rax
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r13d
	movl	(%rax), %eax
	imull	%r13d, %eax
	movl	%eax, 4(%rcx)
	movq	%r15, 16(%rbx)
	movq	%r15, 8(%rbx)
	movq	%r15, 8(%rcx)
	movl	24(%rbp), %eax
	movl	%eax, 24(%rbx)
	movl	%eax, 16(%rcx)
	movl	%r14d, 28(%rbx)
	movl	$1, 32(%rbx)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 36(%rbx)
	movl	16(%rbp), %ecx
	movl	%ecx, 40(%rbx)
	testq	%r15, %r15
	je	LBB0_4
## %bb.5:
	movl	-48(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %edi
	callq	_offset_in_page
                                        ## kill: def $eax killed $eax def $rax
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_10
## %bb.6:
	addl	%r12d, %eax
	movslq	%r12d, %rcx
	cmpq	%rcx, %rax
	jb	LBB0_7
## %bb.8:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%r12d
	movl	%eax, %esi
	jmp	LBB0_9
LBB0_4:
	movq	_kvm_x86_ops@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rbx, %rdi
	callq	*(%rax)
	movl	$1, %eax
	jmp	LBB0_20
LBB0_10:
	subl	%eax, %r13d
	movslq	%r12d, %rax
	cmpq	%rax, %r13
	jb	LBB0_11
## %bb.12:
	movl	%r13d, %eax
	xorl	%edx, %edx
	divl	%r12d
	movl	%eax, %esi
	jmp	LBB0_13
LBB0_7:
	xorl	%esi, %esi
LBB0_9:
	movq	%r15, %rdi
	callq	_min
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_pr_unimpl
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_kvm_inject_gp
	movl	$1, %eax
	jmp	LBB0_20
LBB0_11:
	xorl	%esi, %esi
LBB0_13:
	movq	%r15, %rdi
	callq	_min
	testl	%eax, %eax
	movl	$1, %ecx
	cmovnel	%eax, %ecx
	movq	48(%rbx), %rax
	movq	%rcx, 8(%rax)
	movq	%rcx, 16(%rbx)
	cmpq	%rcx, 8(%rbx)
	jne	LBB0_15
## %bb.14:
	movq	_kvm_x86_ops@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rbx, %rdi
	callq	*(%rax)
LBB0_15:
	movl	%r14d, 44(%rbx)
	xorl	%eax, %eax
	cmpl	$0, 28(%rbx)
	jne	LBB0_20
## %bb.16:
	movq	%rbx, %rdi
	callq	_pio_copy_data
	movl	%eax, %ecx
	movq	_X86EMUL_PROPAGATE_FAULT@GOTPCREL(%rip), %rdx
	movl	$1, %eax
	cmpl	(%rdx), %ecx
	je	LBB0_20
## %bb.17:
	movl	%ecx, %eax
	testl	%ecx, %ecx
	jne	LBB0_20
## %bb.18:
	movq	%rbx, %rdi
	callq	_pio_string_write
	movl	%eax, %ecx
	movl	$0, %eax
	testl	%ecx, %ecx
	jne	LBB0_20
## %bb.19:
	movq	%rbx, %rdi
	callq	_complete_pio
	xorl	%eax, %eax
	cmpq	$0, 8(%rbx)
	sete	%al
LBB0_20:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_KVM_EXIT_IO,4,2                ## @KVM_EXIT_IO
	.comm	_KVM_EXIT_IO_IN,4,2             ## @KVM_EXIT_IO_IN
	.comm	_KVM_EXIT_IO_OUT,4,2            ## @KVM_EXIT_IO_OUT
	.comm	_KVM_PIO_PAGE_OFFSET,4,2        ## @KVM_PIO_PAGE_OFFSET
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_kvm_x86_ops,8,3                ## @kvm_x86_ops
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"guest string pio down\n"

	.comm	_X86EMUL_PROPAGATE_FAULT,4,2    ## @X86EMUL_PROPAGATE_FAULT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kvm_emulate_pio_string         ; -- Begin function kvm_emulate_pio_string
	.p2align	2
_kvm_emulate_pio_string:                ; @kvm_emulate_pio_string
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x24, x7
	mov	x25, x6
	mov	x20, x5
	mov	x23, x4
	mov	x21, x3
	mov	x22, x2
	mov	x26, x1
	mov	x19, x0
	cmp	w1, #0
	cset	w0, eq
Lloh0:
	adrp	x8, _KVM_EXIT_IO_IN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _KVM_EXIT_IO_IN@GOTPAGEOFF]
Lloh2:
	adrp	x9, _KVM_EXIT_IO_OUT@GOTPAGE
Lloh3:
	ldr	x9, [x9, _KVM_EXIT_IO_OUT@GOTPAGEOFF]
	csel	x27, x9, x8, eq
	mov	x1, x7
	bl	_trace_kvm_pio
Lloh4:
	adrp	x8, _KVM_EXIT_IO@GOTPAGE
Lloh5:
	ldr	x8, [x8, _KVM_EXIT_IO@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	ldr	x9, [x19, #48]
	str	w8, [x9, #24]
	ldr	w8, [x27]
	str	w22, [x19]
Lloh7:
	adrp	x10, _KVM_PIO_PAGE_OFFSET@GOTPAGE
Lloh8:
	ldr	x10, [x10, _KVM_PIO_PAGE_OFFSET@GOTPAGEOFF]
	str	w22, [x9]
Lloh9:
	ldr	w10, [x10]
Lloh10:
	adrp	x11, _PAGE_SIZE@GOTPAGE
Lloh11:
	ldr	x11, [x11, _PAGE_SIZE@GOTPAGEOFF]
Lloh12:
	ldr	w27, [x11]
	mul	w10, w27, w10
	str	w10, [x9, #4]
	stp	x21, x21, [x19, #8]
	str	x21, [x9, #8]
	stp	w24, w8, [x9, #16]
	stp	w24, w26, [x19, #24]
	mov	w8, #1
	stp	w8, w23, [x19, #32]
	str	w25, [x19, #40]
	cbz	x21, LBB0_3
; %bb.1:
	mov	x0, x20
	bl	_offset_in_page
	cbz	w23, LBB0_4
; %bb.2:
	add	w8, w0, w22
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
	sxtw	x9, w22
	udiv	x1, x8, x9
	mov	x0, x21
	bl	_min
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_pr_unimpl
	mov	x0, x19
	mov	w1, #0
	bl	_kvm_inject_gp
	mov	w0, #1
	b	LBB0_11
LBB0_3:
Lloh15:
	adrp	x8, _kvm_x86_ops@GOTPAGE
Lloh16:
	ldr	x8, [x8, _kvm_x86_ops@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
	mov	w0, #1
	b	LBB0_11
LBB0_4:
	sub	w8, w27, w0
	sxtw	x9, w22
	udiv	x1, x8, x9
	mov	x0, x21
	bl	_min
	cmp	w0, #0
	csinc	w8, w0, wzr, ne
	ldr	x9, [x19, #48]
	str	x8, [x9, #8]
	str	x8, [x19, #16]
	ldr	x9, [x19, #8]
	cmp	x9, x8
	b.ne	LBB0_6
; %bb.5:
Lloh18:
	adrp	x8, _kvm_x86_ops@GOTPAGE
Lloh19:
	ldr	x8, [x8, _kvm_x86_ops@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
LBB0_6:
	str	w20, [x19, #44]
	ldr	w8, [x19, #28]
	cbz	w8, LBB0_8
LBB0_7:
	mov	w0, #0
	b	LBB0_11
LBB0_8:
	mov	x0, x19
	bl	_pio_copy_data
Lloh21:
	adrp	x8, _X86EMUL_PROPAGATE_FAULT@GOTPAGE
Lloh22:
	ldr	x8, [x8, _X86EMUL_PROPAGATE_FAULT@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_10
; %bb.9:
	mov	w0, #1
	b	LBB0_11
LBB0_10:
	cbz	w0, LBB0_12
LBB0_11:
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_12:
	mov	x0, x19
	bl	_pio_string_write
	cbnz	w0, LBB0_7
; %bb.13:
	mov	x0, x19
	bl	_complete_pio
	ldr	x8, [x19, #8]
	cmp	x8, #0
	cset	w0, eq
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_KVM_EXIT_IO,4,2                ; @KVM_EXIT_IO
	.comm	_KVM_EXIT_IO_IN,4,2             ; @KVM_EXIT_IO_IN
	.comm	_KVM_EXIT_IO_OUT,4,2            ; @KVM_EXIT_IO_OUT
	.comm	_KVM_PIO_PAGE_OFFSET,4,2        ; @KVM_PIO_PAGE_OFFSET
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_kvm_x86_ops,8,3                ; @kvm_x86_ops
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"guest string pio down\n"

	.comm	_X86EMUL_PROPAGATE_FAULT,4,2    ; @X86EMUL_PROPAGATE_FAULT
.subsections_via_symbols
