	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kvm_vm_ioctl_set_msix_entry
_kvm_vm_ioctl_set_msix_entry:           ## @kvm_vm_ioctl_set_msix_entry
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	callq	_mutex_lock
	leaq	4(%r14), %rdi
	movl	16(%rbx), %esi
	callq	_kvm_find_assigned_dev
	testq	%rax, %rax
	je	LBB0_11
## %bb.1:
	movl	(%rax), %ecx
	xorl	%r15d, %r15d
	movl	$0, %edx
	testl	%ecx, %ecx
	jle	LBB0_7
## %bb.2:
	movq	16(%rax), %rsi
	addq	$8, %rsi
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, -8(%rsi)
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	(%rsi), %rdi
	cmpq	(%rbx), %rdi
	je	LBB0_6
## %bb.12:                              ##   in Loop: Header=BB0_3 Depth=1
	incq	%rdx
	addq	$16, %rsi
	cmpq	%rdx, %rcx
	jne	LBB0_3
	jmp	LBB0_8
LBB0_11:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_4:
	movq	(%rbx), %rdi
LBB0_6:
	movq	%rdi, (%rsi)
	movq	8(%rbx), %rbx
	movq	%rbx, -8(%rsi)
	movq	8(%rax), %rax
	movq	%rdi, (%rax,%rdx,8)
LBB0_7:
	cmpl	%ecx, %edx
	jne	LBB0_10
LBB0_8:
	movq	_ENOSPC@GOTPCREL(%rip), %rax
LBB0_9:
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_10:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENOSPC,4,2                     ## @ENOSPC
	.no_dead_strip	_kvm_vm_ioctl_set_msix_entry
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kvm_vm_ioctl_set_msix_entry
_kvm_vm_ioctl_set_msix_entry:           ; @kvm_vm_ioctl_set_msix_entry
	.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, x1
	mov	x19, x0
	bl	_mutex_lock
	add	x0, x19, #4
	ldr	w1, [x20, #16]
	bl	_kvm_find_assigned_dev
	cbz	x0, LBB0_6
; %bb.1:
	ldr	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.2:
	mov	x9, #0
	ldr	x10, [x0, #16]
	add	x10, x10, #8
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldur	x11, [x10, #-8]
	cbz	x11, LBB0_9
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x11, [x10]
	ldr	x12, [x20]
	cmp	x11, x12
	b.eq	LBB0_10
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x9, x9, #1
	add	x10, x10, #16
	cmp	x8, x9
	b.ne	LBB0_3
	b	LBB0_11
LBB0_6:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_12
LBB0_7:
	mov	w9, #0
	cmp	w9, w8
	b.eq	LBB0_11
LBB0_8:
	mov	w20, #0
	b	LBB0_13
LBB0_9:
	ldr	x11, [x20]
LBB0_10:
	str	x11, [x10]
	ldr	x12, [x20, #8]
	stur	x12, [x10, #-8]
	ldr	x10, [x0, #8]
	str	x11, [x10, x9, lsl #3]
	cmp	w9, w8
	b.ne	LBB0_8
LBB0_11:
Lloh2:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_13:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENOSPC,4,2                     ; @ENOSPC
	.no_dead_strip	_kvm_vm_ioctl_set_msix_entry
.subsections_via_symbols
