	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ppt_setup_msix                 ## -- Begin function ppt_setup_msix
	.p2align	4, 0x90
_ppt_setup_msix:                        ## @ppt_setup_msix
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r14d
	movq	%rdi, %rbx
	movl	%edx, %edi
	movl	%ecx, %esi
	movl	%r8d, %edx
	callq	_ppt_find
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r13
	cmpq	%rbx, 64(%rax)
	je	LBB0_4
## %bb.3:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_22
LBB0_1:
	movq	_ENOENT@GOTPCREL(%rip), %rax
	jmp	LBB0_22
LBB0_4:
	movl	56(%r13), %edi
	callq	_device_get_ivars
	testq	%rax, %rax
	je	LBB0_21
## %bb.5:
	cmpl	$0, (%r13)
	je	LBB0_6
LBB0_17:
	movl	32(%rbp), %r15d
	movq	_PCIM_MSIX_VCTRL_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %r15d
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_ppt_teardown_msix_intr
	xorl	%ebx, %ebx
	testl	%r15d, %r15d
	jne	LBB0_23
## %bb.18:
	movq	24(%r13), %rax
	movslq	%r14d, %r15
	movq	$0, (%rax,%r15,8)
	addl	4(%r13), %r14d
	movl	%r14d, -44(%rbp)
	movl	56(%r13), %edi
	movq	_SYS_RES_IRQ@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	_RF_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-44(%rbp), %rdx
	callq	_bus_alloc_resource_any
	movq	16(%r13), %rcx
	movq	%rax, (%rcx,%r15,8)
	movq	16(%r13), %rax
	cmpq	$0, (%rax,%r15,8)
	je	LBB0_21
## %bb.19:
	movq	24(%rbp), %rcx
	movq	16(%rbp), %rdx
	movq	32(%r13), %rsi
	leaq	(%r15,%r15,2), %rdi
	leaq	(%rsi,%rdi,8), %r9
	movq	%r13, 16(%rsi,%rdi,8)
	movq	%rdx, 8(%rsi,%rdi,8)
	movq	%rcx, (%rsi,%rdi,8)
	movl	56(%r13), %edi
	movq	(%rax,%r15,8), %rsi
	movq	_INTR_TYPE_NET@GOTPCREL(%rip), %rax
	movq	_INTR_MPSAFE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	_pptintr@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	(,%r15,8), %rax
	addq	24(%r13), %rax
	movq	%rax, (%rsp)
	xorl	%ebx, %ebx
	xorl	%r8d, %r8d
	callq	_bus_setup_intr
	testl	%eax, %eax
	je	LBB0_23
## %bb.20:
	movl	56(%r13), %edi
	movl	(%r14), %esi
	movl	-44(%rbp), %edx
	movq	16(%r13), %rax
	movq	(%rax,%r15,8), %rcx
	callq	_bus_release_resource
	movq	24(%r13), %rax
	movq	$0, (%rax,%r15,8)
	movq	16(%r13), %rax
	movq	$0, (%rax,%r15,8)
LBB0_21:
	movq	_ENXIO@GOTPCREL(%rip), %rax
LBB0_22:
	movl	(%rax), %ebx
LBB0_23:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	%rax, %r12
	movl	56(%r13), %edi
	callq	_pci_msix_count
	testl	%eax, %eax
	jle	LBB0_7
## %bb.8:
	movl	%eax, %r15d
	movl	$1, 4(%r13)
	movl	%eax, (%r13)
	movl	%eax, %ebx
	shlq	$3, %rbx
	leaq	(%rbx,%rbx,2), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_M_PPTMSIX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_M_WAITOK@GOTPCREL(%rip), %rax
	movq	_M_ZERO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_malloc
	movq	%rax, 16(%r13)
	movq	_M_PPTMSIX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_M_ZERO@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_M_WAITOK@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_malloc
	movq	%rax, 24(%r13)
	movq	_M_PPTMSIX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_M_ZERO@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_M_WAITOK@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_malloc
	movq	%rax, 32(%r13)
	movl	(%r12), %eax
	movl	%eax, -44(%rbp)
	movl	56(%r13), %edi
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_RF_ACTIVE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ecx
	leaq	-44(%rbp), %rdx
	callq	_bus_alloc_resource_any
	movq	%rax, 48(%r13)
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:
	movl	-44(%rbp), %eax
	movl	%eax, 8(%r13)
	movl	4(%r12), %eax
	cmpl	%eax, (%r12)
	je	LBB0_13
## %bb.11:
	movl	%eax, -44(%rbp)
	movl	56(%r13), %edi
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rbx), %ecx
	leaq	-44(%rbp), %rdx
	callq	_bus_alloc_resource_any
	movq	%rax, 40(%r13)
	testq	%rax, %rax
	je	LBB0_9
## %bb.12:
	movl	-44(%rbp), %eax
	movl	%eax, 12(%r13)
LBB0_13:
	movl	%r15d, -48(%rbp)
	movl	56(%r13), %edi
	leaq	-48(%rbp), %rsi
	callq	_pci_alloc_msix
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_15
## %bb.14:
	cmpl	%r15d, -48(%rbp)
	je	LBB0_17
LBB0_15:
	movq	%r13, %rdi
	callq	_ppt_teardown_msix
	testl	%ebx, %ebx
	jne	LBB0_23
## %bb.16:
	movq	_ENOSPC@GOTPCREL(%rip), %rax
	jmp	LBB0_22
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_22
LBB0_9:
	movq	%r13, %rdi
	callq	_ppt_teardown_msix
	movq	_ENOSPC@GOTPCREL(%rip), %rax
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_M_PPTMSIX,4,2                  ## @M_PPTMSIX
	.comm	_M_WAITOK,4,2                   ## @M_WAITOK
	.comm	_M_ZERO,4,2                     ## @M_ZERO
	.comm	_SYS_RES_MEMORY,4,2             ## @SYS_RES_MEMORY
	.comm	_RF_ACTIVE,4,2                  ## @RF_ACTIVE
	.comm	_ENOSPC,4,2                     ## @ENOSPC
	.comm	_PCIM_MSIX_VCTRL_MASK,4,2       ## @PCIM_MSIX_VCTRL_MASK
	.comm	_SYS_RES_IRQ,4,2                ## @SYS_RES_IRQ
	.comm	_INTR_TYPE_NET,4,2              ## @INTR_TYPE_NET
	.comm	_INTR_MPSAFE,4,2                ## @INTR_MPSAFE
	.comm	_pptintr,4,2                    ## @pptintr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ppt_setup_msix                 ; -- Begin function ppt_setup_msix
	.p2align	2
_ppt_setup_msix:                        ; @ppt_setup_msix
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x20, x7
	mov	x21, x6
	mov	x22, x5
	mov	x1, x3
	mov	x23, x0
	mov	x0, x2
	mov	x2, x4
	bl	_ppt_find
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0, #64]
	cmp	x8, x23
	b.eq	LBB0_4
; %bb.2:
Lloh0:
	adrp	x8, _EBUSY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_20
LBB0_3:
Lloh2:
	adrp	x8, _ENOENT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
	b	LBB0_20
LBB0_4:
	ldr	w0, [x19, #56]
	bl	_device_get_ivars
	cbz	x0, LBB0_19
; %bb.5:
	ldr	w8, [x19]
	cbz	w8, LBB0_8
LBB0_6:
	ldr	w8, [x29, #16]
Lloh4:
	adrp	x9, _PCIM_MSIX_VCTRL_MASK@GOTPAGE
Lloh5:
	ldr	x9, [x9, _PCIM_MSIX_VCTRL_MASK@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	and	w23, w9, w8
	mov	x0, x19
	mov	x1, x22
	bl	_ppt_teardown_msix_intr
	cbz	w23, LBB0_16
; %bb.7:
	mov	w0, #0
	b	LBB0_21
LBB0_8:
	mov	x24, x0
	ldr	w0, [x19, #56]
	bl	_pci_msix_count
	cmp	w0, #0
	b.le	LBB0_22
; %bb.9:
	mov	x23, x0
	mov	w8, #1
	stp	w0, w8, [x19]
	mov	w8, w0
	lsl	x25, x8, #3
	add	x8, x8, w0, uxtw #1
	lsl	x8, x8, #3
	str	x8, [sp]                        ; 8-byte Folded Spill
Lloh7:
	adrp	x27, _M_PPTMSIX@GOTPAGE
Lloh8:
	ldr	x27, [x27, _M_PPTMSIX@GOTPAGEOFF]
Lloh9:
	adrp	x28, _M_WAITOK@GOTPAGE
Lloh10:
	ldr	x28, [x28, _M_WAITOK@GOTPAGEOFF]
	ldr	w1, [x27]
	ldr	w8, [x28]
Lloh11:
	adrp	x26, _M_ZERO@GOTPAGE
Lloh12:
	ldr	x26, [x26, _M_ZERO@GOTPAGEOFF]
	ldr	w9, [x26]
	orr	w2, w9, w8
	mov	x0, x25
	bl	_malloc
	str	x0, [x19, #16]
	ldr	w1, [x27]
	ldr	w8, [x28]
	ldr	w9, [x26]
	orr	w2, w9, w8
	mov	x0, x25
	bl	_malloc
	str	x0, [x19, #24]
	ldr	w1, [x27]
	ldr	w8, [x28]
	ldr	w9, [x26]
	orr	w2, w9, w8
	ldr	x0, [sp]                        ; 8-byte Folded Reload
	bl	_malloc
	str	x0, [x19, #32]
	ldr	w8, [x24]
	str	w8, [sp, #8]
	ldr	w0, [x19, #56]
Lloh13:
	adrp	x25, _SYS_RES_MEMORY@GOTPAGE
Lloh14:
	ldr	x25, [x25, _SYS_RES_MEMORY@GOTPAGEOFF]
	ldr	w1, [x25]
Lloh15:
	adrp	x26, _RF_ACTIVE@GOTPAGE
Lloh16:
	ldr	x26, [x26, _RF_ACTIVE@GOTPAGEOFF]
	ldr	w3, [x26]
	add	x2, sp, #8
	bl	_bus_alloc_resource_any
	str	x0, [x19, #48]
	cbz	x0, LBB0_23
; %bb.10:
	ldr	w8, [sp, #8]
	str	w8, [x19, #8]
	ldp	w9, w8, [x24]
	cmp	w9, w8
	b.eq	LBB0_13
; %bb.11:
	str	w8, [sp, #8]
	ldr	w0, [x19, #56]
	ldr	w1, [x25]
	ldr	w3, [x26]
	add	x2, sp, #8
	bl	_bus_alloc_resource_any
	str	x0, [x19, #40]
	cbz	x0, LBB0_23
; %bb.12:
	ldr	w8, [sp, #8]
	str	w8, [x19, #12]
LBB0_13:
	str	w23, [sp, #12]
	ldr	w0, [x19, #56]
	add	x1, sp, #12
	bl	_pci_alloc_msix
	mov	x24, x0
	cbnz	w0, LBB0_15
; %bb.14:
	ldr	w8, [sp, #12]
	cmp	w8, w23
	b.eq	LBB0_6
LBB0_15:
	mov	x0, x19
	bl	_ppt_teardown_msix
Lloh17:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	cmp	w24, #0
	csel	w0, w8, w24, eq
	b	LBB0_21
LBB0_16:
	ldr	x8, [x19, #24]
	sbfiz	x24, x22, #3, #32
	str	xzr, [x8, x24]
	ldr	w8, [x19, #4]
	add	w8, w8, w22
	str	w8, [sp, #8]
	ldr	w0, [x19, #56]
Lloh20:
	adrp	x23, _SYS_RES_IRQ@GOTPAGE
Lloh21:
	ldr	x23, [x23, _SYS_RES_IRQ@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh22:
	adrp	x8, _RF_ACTIVE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _RF_ACTIVE@GOTPAGEOFF]
Lloh24:
	ldr	w3, [x8]
	add	x2, sp, #8
	bl	_bus_alloc_resource_any
	ldr	x8, [x19, #16]
	str	x0, [x8, x24]
	ldr	x8, [x19, #16]
	ldr	x9, [x8, x24]
	cbz	x9, LBB0_19
; %bb.17:
	sxtw	x9, w22
	mov	w10, #24
	ldp	x12, x11, [x19, #24]
	madd	x5, x9, x10, x11
	stp	x21, x19, [x5, #8]
	str	x20, [x5]
	lsl	x20, x9, #3
	ldr	x1, [x8, x20]
	ldr	w0, [x19, #56]
Lloh25:
	adrp	x8, _INTR_TYPE_NET@GOTPAGE
Lloh26:
	ldr	x8, [x8, _INTR_TYPE_NET@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
Lloh28:
	adrp	x9, _INTR_MPSAFE@GOTPAGE
Lloh29:
	ldr	x9, [x9, _INTR_MPSAFE@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	orr	w2, w9, w8
Lloh31:
	adrp	x8, _pptintr@GOTPAGE
Lloh32:
	ldr	x8, [x8, _pptintr@GOTPAGEOFF]
Lloh33:
	ldr	w3, [x8]
	add	x6, x12, x20
	mov	x4, #0
	bl	_bus_setup_intr
	cbz	w0, LBB0_21
; %bb.18:
	ldr	w0, [x19, #56]
	ldr	w1, [x23]
	ldr	w2, [sp, #8]
	ldr	x8, [x19, #16]
	ldr	x3, [x8, x20]
	bl	_bus_release_resource
	ldr	x8, [x19, #24]
	str	xzr, [x8, x20]
	ldr	x8, [x19, #16]
	str	xzr, [x8, x20]
LBB0_19:
Lloh34:
	adrp	x8, _ENXIO@GOTPAGE
Lloh35:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
LBB0_20:
	ldr	w0, [x8]
LBB0_21:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_22:
Lloh36:
	adrp	x8, _EINVAL@GOTPAGE
Lloh37:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_20
LBB0_23:
	mov	x0, x19
	bl	_ppt_teardown_msix
Lloh38:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh39:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
	b	LBB0_20
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_M_PPTMSIX,4,2                  ; @M_PPTMSIX
	.comm	_M_WAITOK,4,2                   ; @M_WAITOK
	.comm	_M_ZERO,4,2                     ; @M_ZERO
	.comm	_SYS_RES_MEMORY,4,2             ; @SYS_RES_MEMORY
	.comm	_RF_ACTIVE,4,2                  ; @RF_ACTIVE
	.comm	_ENOSPC,4,2                     ; @ENOSPC
	.comm	_PCIM_MSIX_VCTRL_MASK,4,2       ; @PCIM_MSIX_VCTRL_MASK
	.comm	_SYS_RES_IRQ,4,2                ; @SYS_RES_IRQ
	.comm	_INTR_TYPE_NET,4,2              ; @INTR_TYPE_NET
	.comm	_INTR_MPSAFE,4,2                ; @INTR_MPSAFE
	.comm	_pptintr,4,2                    ; @pptintr
.subsections_via_symbols
