	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function msi_setup_entry
_msi_setup_entry:                       ## @msi_setup_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	%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	%esi, %r12d
	movq	%rdi, %r15
	testq	%rdx, %rdx
	je	LBB0_1
## %bb.2:
	movl	%r12d, %edi
	movq	%rdx, %rsi
	callq	_irq_create_affinity_masks
	movq	%rax, %r14
	jmp	LBB0_3
LBB0_1:
	xorl	%r14d, %r14d
LBB0_3:
	leaq	12(%r15), %rdi
	movl	%r12d, %esi
	movq	%r14, %rdx
	callq	_alloc_msi_entry
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_9
## %bb.4:
	movq	_PCI_MSI_FLAGS@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r15), %rsi
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	callq	_pci_read_config_word
	movq	$0, 56(%rbx)
	movl	-44(%rbp), %eax
	movq	_PCI_MSI_FLAGS_64BIT@GOTPCREL(%rip), %r13
	xorl	%ecx, %ecx
	movl	(%r13), %edx
	andl	%eax, %edx
	setne	%cl
	movl	%ecx, 16(%rbx)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 40(%rbx)
	movq	_PCI_MSI_FLAGS_MASKBIT@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	setne	%dl
	movl	%edx, 20(%rbx)
	movl	8(%r15), %ecx
	movl	%ecx, 32(%rbx)
	movq	_PCI_MSI_FLAGS_QMASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	sarl	%eax
	movl	%eax, 24(%rbx)
	movl	%r12d, %edi
	callq	___roundup_pow_of_two
	movl	%eax, %edi
	callq	_ilog2
	movl	%eax, 28(%rbx)
	movl	(%r13), %eax
	andl	-44(%rbp), %eax
	jne	LBB0_5
## %bb.6:
	movq	_PCI_MSI_MASK_32@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_5:
	movq	_PCI_MSI_MASK_64@GOTPCREL(%rip), %rax
LBB0_7:
	movq	(%rax), %rsi
	addq	(%r15), %rsi
	movq	%rsi, 8(%rbx)
	cmpl	$0, 20(%rbx)
	je	LBB0_9
## %bb.8:
	movq	%r15, %rdi
	movq	%rbx, %rdx
	callq	_pci_read_config_dword
LBB0_9:
	movq	%r14, %rdi
	callq	_kfree
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_MSI_FLAGS,8,3              ## @PCI_MSI_FLAGS
	.comm	_PCI_MSI_FLAGS_64BIT,4,2        ## @PCI_MSI_FLAGS_64BIT
	.comm	_PCI_MSI_FLAGS_MASKBIT,4,2      ## @PCI_MSI_FLAGS_MASKBIT
	.comm	_PCI_MSI_FLAGS_QMASK,4,2        ## @PCI_MSI_FLAGS_QMASK
	.comm	_PCI_MSI_MASK_64,8,3            ## @PCI_MSI_MASK_64
	.comm	_PCI_MSI_MASK_32,8,3            ## @PCI_MSI_MASK_32
	.no_dead_strip	_msi_setup_entry
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function msi_setup_entry
_msi_setup_entry:                       ; @msi_setup_entry
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x22, x1
	mov	x19, x0
	cbz	x2, LBB0_2
; %bb.1:
	mov	x0, x22
	mov	x1, x2
	bl	_irq_create_affinity_masks
	mov	x20, x0
	b	LBB0_3
LBB0_2:
	mov	x20, #0
LBB0_3:
	add	x0, x19, #12
	mov	x1, x22
	mov	x2, x20
	bl	_alloc_msi_entry
	mov	x21, x0
	cbz	x0, LBB0_6
; %bb.4:
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _PCI_MSI_FLAGS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PCI_MSI_FLAGS@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x1, x9, x8
	add	x2, sp, #12
	mov	x0, x19
	bl	_pci_read_config_word
	str	xzr, [x21, #56]
	ldr	w8, [sp, #12]
Lloh3:
	adrp	x23, _PCI_MSI_FLAGS_64BIT@GOTPAGE
Lloh4:
	ldr	x23, [x23, _PCI_MSI_FLAGS_64BIT@GOTPAGEOFF]
	ldr	w9, [x23]
	tst	w9, w8
	cset	w9, ne
	stp	xzr, xzr, [x21, #40]
Lloh5:
	adrp	x10, _PCI_MSI_FLAGS_MASKBIT@GOTPAGE
Lloh6:
	ldr	x10, [x10, _PCI_MSI_FLAGS_MASKBIT@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
	tst	w10, w8
	cset	w10, ne
	stp	w9, w10, [x21, #16]
	ldr	w9, [x19, #8]
	str	w9, [x21, #32]
Lloh8:
	adrp	x9, _PCI_MSI_FLAGS_QMASK@GOTPAGE
Lloh9:
	ldr	x9, [x9, _PCI_MSI_FLAGS_QMASK@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	and	w8, w9, w8
	asr	w8, w8, #1
	str	w8, [x21, #24]
	mov	x0, x22
	bl	___roundup_pow_of_two
	bl	_ilog2
	str	w0, [x21, #28]
	ldr	w8, [sp, #12]
	ldr	w9, [x23]
	ldr	x10, [x19]
Lloh11:
	adrp	x11, _PCI_MSI_MASK_32@GOTPAGE
Lloh12:
	ldr	x11, [x11, _PCI_MSI_MASK_32@GOTPAGEOFF]
Lloh13:
	adrp	x12, _PCI_MSI_MASK_64@GOTPAGE
Lloh14:
	ldr	x12, [x12, _PCI_MSI_MASK_64@GOTPAGEOFF]
	tst	w9, w8
	csel	x8, x11, x12, eq
	ldr	x8, [x8]
	add	x1, x8, x10
	str	x1, [x21, #8]
	ldr	w8, [x21, #20]
	cbz	w8, LBB0_6
; %bb.5:
	mov	x0, x19
	mov	x2, x21
	bl	_pci_read_config_dword
LBB0_6:
	mov	x0, x20
	bl	_kfree
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_MSI_FLAGS,8,3              ; @PCI_MSI_FLAGS
	.comm	_PCI_MSI_FLAGS_64BIT,4,2        ; @PCI_MSI_FLAGS_64BIT
	.comm	_PCI_MSI_FLAGS_MASKBIT,4,2      ; @PCI_MSI_FLAGS_MASKBIT
	.comm	_PCI_MSI_FLAGS_QMASK,4,2        ; @PCI_MSI_FLAGS_QMASK
	.comm	_PCI_MSI_MASK_64,8,3            ; @PCI_MSI_MASK_64
	.comm	_PCI_MSI_MASK_32,8,3            ; @PCI_MSI_MASK_32
	.no_dead_strip	_msi_setup_entry
.subsections_via_symbols
