	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cpcht_alloc_msix
_cpcht_alloc_msix:                      ## @cpcht_alloc_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	callq	_device_get_softc
	movq	_cpcht_msipic@GOTPCREL(%rip), %r15
	cmpq	$0, (%r15)
	je	LBB0_12
## %bb.1:
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_mtx_lock
	movq	8(%rbx), %rax
	movq	_IRQ_NONE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	$11, %esi
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%rcx, -24(%rax,%rsi,8)
	je	LBB0_3
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpq	%rcx, -16(%rax,%rsi,8)
	je	LBB0_4
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpq	%rcx, -8(%rax,%rsi,8)
	je	LBB0_5
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpq	%rcx, (%rax,%rsi,8)
	je	LBB0_6
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	addq	$4, %rsi
	cmpq	$127, %rsi
	jne	LBB0_2
## %bb.11:
	movq	%rbx, %rdi
	callq	_mtx_unlock
LBB0_12:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_13
LBB0_3:
	addq	$-3, %rsi
	jmp	LBB0_6
LBB0_4:
	addq	$-2, %rsi
	jmp	LBB0_6
LBB0_5:
	decq	%rsi
LBB0_6:
	movl	%esi, %ecx
	movq	_IRQ_MSI@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	%rdx, (%rax,%rcx,8)
	movq	(%r15), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_MAP_IRQ
	movl	%eax, (%r14)
	movq	%rbx, %rdi
	callq	_mtx_unlock
	xorl	%eax, %eax
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_cpcht_msipic,8,3               ## @cpcht_msipic
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_IRQ_NONE,8,3                   ## @IRQ_NONE
	.comm	_IRQ_MSI,8,3                    ## @IRQ_MSI
	.no_dead_strip	_cpcht_alloc_msix
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cpcht_alloc_msix
_cpcht_alloc_msix:                      ; @cpcht_alloc_msix
	.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	x19, x2
	bl	_device_get_softc
Lloh0:
	adrp	x21, _cpcht_msipic@GOTPAGE
Lloh1:
	ldr	x21, [x21, _cpcht_msipic@GOTPAGEOFF]
	ldr	x8, [x21]
	cbz	x8, LBB0_5
; %bb.1:
	mov	x20, x0
	bl	_mtx_lock
	ldr	x8, [x20, #8]
Lloh2:
	adrp	x9, _IRQ_NONE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _IRQ_NONE@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	mov	w1, #8
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x8, x1, lsl #3]
	cmp	x10, x9
	b.eq	LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x1, x1, #1
	cmp	x1, #124
	b.ne	LBB0_2
; %bb.4:
	mov	x0, x20
	bl	_mtx_unlock
LBB0_5:
Lloh5:
	adrp	x8, _ENXIO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	b	LBB0_7
LBB0_6:
Lloh8:
	adrp	x9, _IRQ_MSI@GOTPAGE
Lloh9:
	ldr	x9, [x9, _IRQ_MSI@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	str	x9, [x8, x1, lsl #3]
	ldr	x0, [x21]
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_MAP_IRQ
	str	w0, [x19]
	mov	x0, x20
	bl	_mtx_unlock
	mov	w0, #0
LBB0_7:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_cpcht_msipic,8,3               ; @cpcht_msipic
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_IRQ_NONE,8,3                   ; @IRQ_NONE
	.comm	_IRQ_MSI,8,3                    ; @IRQ_MSI
	.no_dead_strip	_cpcht_alloc_msix
.subsections_via_symbols
