	.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_nr
_kvm_vm_ioctl_set_msix_nr:              ## @kvm_vm_ioctl_set_msix_nr
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	callq	_mutex_lock
	leaq	4(%r14), %rdi
	movl	4(%r15), %esi
	callq	_kvm_find_assigned_dev
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%rax, %r12
	cmpq	$0, (%rax)
	je	LBB0_5
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_3:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_4:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movslq	(%r15), %rdi
	movq	%rdi, (%r12)
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.6:
	movq	_KVM_MAX_MSIX_PER_DEV@GOTPCREL(%rip), %rax
	cmpq	%rdi, (%rax)
	jle	LBB0_2
## %bb.7:
	shll	$2, %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_kzalloc
	movq	%rax, 8(%r12)
	testq	%rax, %rax
	je	LBB0_10
## %bb.8:
	movl	(%r15), %edi
	shll	$2, %edi
	movl	(%rbx), %esi
	callq	_kzalloc
	movq	%rax, 16(%r12)
	xorl	%ebx, %ebx
	testq	%rax, %rax
	jne	LBB0_4
## %bb.9:
	movq	8(%r12), %rdi
	callq	_kfree
LBB0_10:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_KVM_MAX_MSIX_PER_DEV,8,3       ## @KVM_MAX_MSIX_PER_DEV
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_kvm_vm_ioctl_set_msix_nr
.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_nr
_kvm_vm_ioctl_set_msix_nr:              ; @kvm_vm_ioctl_set_msix_nr
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x1
	mov	x19, x0
	bl	_mutex_lock
	add	x0, x19, #4
	ldr	w1, [x20, #4]
	bl	_kvm_find_assigned_dev
	cbz	x0, LBB0_2
; %bb.1:
	mov	x21, x0
	ldr	x8, [x0]
	cbz	x8, LBB0_5
LBB0_2:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_3:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_4:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_5:
	ldr	w8, [x20]
	sxtw	x9, w8
	str	x9, [x21]
	cbz	w8, LBB0_2
; %bb.6:
Lloh2:
	adrp	x10, _KVM_MAX_MSIX_PER_DEV@GOTPAGE
Lloh3:
	ldr	x10, [x10, _KVM_MAX_MSIX_PER_DEV@GOTPAGEOFF]
Lloh4:
	ldr	x10, [x10]
	cmp	x10, x9
	b.le	LBB0_2
; %bb.7:
	lsl	w0, w8, #2
Lloh5:
	adrp	x22, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x22, [x22, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x22]
	bl	_kzalloc
	str	x0, [x21, #8]
	cbz	x0, LBB0_11
; %bb.8:
	ldr	w8, [x20]
	lsl	w0, w8, #2
	ldr	w1, [x22]
	bl	_kzalloc
	str	x0, [x21, #16]
	cbz	x0, LBB0_10
; %bb.9:
	mov	w20, #0
	b	LBB0_4
LBB0_10:
	ldr	x0, [x21, #8]
	bl	_kfree
LBB0_11:
Lloh7:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_KVM_MAX_MSIX_PER_DEV,8,3       ; @KVM_MAX_MSIX_PER_DEV
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_kvm_vm_ioctl_set_msix_nr
.subsections_via_symbols
