	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cpcht_alloc_msi
_cpcht_alloc_msi:                       ## @cpcht_alloc_msi
	.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
	movq	%r8, %r14
	movl	%edx, %r15d
	callq	_device_get_softc
	movq	_cpcht_msipic@GOTPCREL(%rip), %r13
	cmpq	$0, (%r13)
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_mtx_lock
	cmpl	$115, %r15d
	jg	LBB0_3
## %bb.4:
	movl	$124, %ecx
	subl	%r15d, %ecx
	movq	_IRQ_NONE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movl	%r15d, %esi
	movl	$8, %eax
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
	movl	$0, %edi
	testl	%r15d, %r15d
	jle	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movslq	%eax, %rbx
	shlq	$3, %rbx
	addq	8(%r12), %rbx
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_7:                                 ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpq	%rdx, (%rbx,%rdi,8)
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=2
	incq	%rdi
	cmpq	%rdi, %rsi
	jne	LBB0_7
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	cmpl	%r15d, %edi
	je	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=1
	addl	%edi, %eax
	incl	%eax
	cmpl	%ecx, %eax
	jl	LBB0_5
	jmp	LBB0_11
LBB0_3:
	xorl	%edi, %edi
	movl	$8, %eax
LBB0_11:
	cmpl	%r15d, %edi
	jne	LBB0_17
LBB0_12:
	testl	%r15d, %r15d
	movq	%r12, %rdi
	jle	LBB0_15
## %bb.13:
	movq	%r14, %rdx
	movq	%r13, %rbx
	cltq
	movl	%r15d, %ecx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	leaq	(,%rax,8), %rcx
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movl	%eax, %r12d
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	%rdi, %r15
	movq	(%rbx), %rdi
	leal	(%r12,%r14), %esi
	movq	%rdx, %r13
	callq	_MAP_IRQ
	movq	%r15, %rdi
	movq	%r13, %rdx
	movl	%eax, (%r13,%r14,4)
	movq	_IRQ_MSI@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	8(%r15), %rcx
	addq	-48(%rbp), %rcx                 ## 8-byte Folded Reload
	movq	%rax, (%rcx,%r14,8)
	incq	%r14
	cmpq	%r14, -56(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_14
LBB0_15:
	callq	_mtx_unlock
	xorl	%eax, %eax
	jmp	LBB0_16
LBB0_17:
	movq	%r12, %rdi
	callq	_mtx_unlock
LBB0_1:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_16:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	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_msi
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cpcht_alloc_msi
_cpcht_alloc_msi:                       ; @cpcht_alloc_msi
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x4
	mov	x22, x2
	bl	_device_get_softc
Lloh0:
	adrp	x23, _cpcht_msipic@GOTPAGE
Lloh1:
	ldr	x23, [x23, _cpcht_msipic@GOTPAGEOFF]
	ldr	x8, [x23]
	cbz	x8, LBB0_17
; %bb.1:
	mov	x20, x0
	bl	_mtx_lock
	cmp	w22, #115
	b.gt	LBB0_10
; %bb.2:
	mov	w8, #124
	sub	w8, w8, w22
Lloh2:
	adrp	x9, _IRQ_NONE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _IRQ_NONE@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	mov	w10, w22
	mov	w21, #8
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	cmp	w22, #1
	b.lt	LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x11, #0
	ldr	x12, [x20, #8]
	add	x12, x12, w21, sxtw #3
LBB0_5:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x13, [x12, x11, lsl #3]
	cmp	x13, x9
	b.ne	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
	add	x11, x11, #1
	cmp	x10, x11
	b.ne	LBB0_5
	b	LBB0_12
LBB0_7:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	w11, #0
LBB0_8:                                 ;   in Loop: Header=BB0_3 Depth=1
	cmp	w11, w22
	b.eq	LBB0_12
; %bb.9:                                ;   in Loop: Header=BB0_3 Depth=1
	add	w12, w11, w21
	add	w21, w12, #1
	cmp	w21, w8
	b.lt	LBB0_3
	b	LBB0_11
LBB0_10:
	mov	w11, #0
	mov	w21, #8
LBB0_11:
	cmp	w11, w22
	b.ne	LBB0_16
LBB0_12:
	cmp	w22, #1
	b.lt	LBB0_15
; %bb.13:
	sbfiz	x24, x21, #3, #32
Lloh5:
	adrp	x25, _IRQ_MSI@GOTPAGE
Lloh6:
	ldr	x25, [x25, _IRQ_MSI@GOTPAGEOFF]
	mov	w22, w22
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x23]
	mov	x1, x21
	bl	_MAP_IRQ
	str	w0, [x19], #4
	ldr	x8, [x25]
	ldr	x9, [x20, #8]
	str	x8, [x9, x24]
	add	x24, x24, #8
	add	w21, w21, #1
	subs	x22, x22, #1
	b.ne	LBB0_14
LBB0_15:
	mov	x0, x20
	bl	_mtx_unlock
	mov	w0, #0
	b	LBB0_18
LBB0_16:
	mov	x0, x20
	bl	_mtx_unlock
LBB0_17:
Lloh7:
	adrp	x8, _ENXIO@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
LBB0_18:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.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_msi
.subsections_via_symbols
