	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _iflib_irq_alloc
__iflib_irq_alloc:                      ## @_iflib_irq_alloc
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -80(%rbp)                  ## 8-byte Spill
	movq	%r8, -72(%rbp)                  ## 8-byte Spill
	movq	%rcx, %r15
	movl	%edx, %r12d
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	$0, -48(%rbp)
	movl	4(%rdi), %r14d
	movq	_RF_ACTIVE@GOTPCREL(%rip), %rax
	movq	_IFC_LEGACY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	andl	(%rdi), %ebx
	je	LBB0_2
## %bb.1:
	movq	_RF_SHAREABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
LBB0_2:
	orl	(%rax), %ebx
	xorl	%edi, %edi
	cmpl	$512, %r12d                     ## imm = 0x200
	setl	%dil
	callq	_MPASS
	movl	%r12d, -52(%rbp)
	movq	_SYS_RES_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-52(%rbp), %rdx
	movl	%r14d, %edi
	movl	%ebx, %ecx
	callq	_bus_alloc_resource_any
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r13
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%r13, 8(%rax)
	testq	%r15, %r15
	sete	%al
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	testq	%rbx, %rbx
	sete	%cl
	orb	%al, %cl
	movzbl	%cl, %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_KASSERT
	movq	_INTR_MPSAFE@GOTPCREL(%rip), %rax
	movq	_INTR_TYPE_NET@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	leaq	-48(%rbp), %rax
	movq	%rax, (%rsp)
	movl	%r14d, %edi
	movq	%r13, %rsi
	movq	%r15, %rcx
	movq	%rbx, %r8
	movq	-80(%rbp), %r9                  ## 8-byte Reload
	callq	_bus_setup_intr
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %ebx
	movq	16(%rbp), %rax
	testq	%rax, %rax
	leaq	L_.str.3(%rip), %rcx
	cmovneq	%rax, %rcx
	leaq	L_.str.2(%rip), %rsi
	movl	%r14d, %edi
	movl	%r12d, %edx
	movl	%ebx, %r8d
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_9
LBB0_3:
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edi
	movl	%r12d, %edx
	movq	16(%rbp), %rcx
	xorl	%eax, %eax
	callq	_device_printf
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_9
LBB0_6:
	movq	16(%rbp), %r8
	testq	%r8, %r8
	je	LBB0_8
## %bb.7:
	movq	-48(%rbp), %rdx
	leaq	L_.str.4(%rip), %rcx
	movl	%r14d, %edi
	movq	%r13, %rsi
	callq	_bus_describe_intr
LBB0_8:
	movq	-48(%rbp), %rax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	xorl	%ebx, %ebx
LBB0_9:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RF_ACTIVE,4,2                  ## @RF_ACTIVE
	.comm	_IFC_LEGACY,4,2                 ## @IFC_LEGACY
	.comm	_RF_SHAREABLE,4,2               ## @RF_SHAREABLE
	.comm	_SYS_RES_IRQ,4,2                ## @SYS_RES_IRQ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to allocate IRQ for rid %d, name %s.\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"filter and handler can't both be non-NULL"

	.comm	_INTR_MPSAFE,4,2                ## @INTR_MPSAFE
	.comm	_INTR_TYPE_NET,4,2              ## @INTR_TYPE_NET
L_.str.2:                               ## @.str.2
	.asciz	"failed to setup interrupt for rid %d, name %s: %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"unknown"

L_.str.4:                               ## @.str.4
	.asciz	"%s"

	.no_dead_strip	__iflib_irq_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _iflib_irq_alloc
__iflib_irq_alloc:                      ; @_iflib_irq_alloc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x19, x6
	mov	x23, x5
	mov	x24, x4
	mov	x25, x3
	mov	x20, x2
	mov	x21, x1
	str	xzr, [sp, #24]
Lloh0:
	adrp	x8, _RF_ACTIVE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RF_ACTIVE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldp	w9, w22, [x0]
Lloh3:
	adrp	x10, _IFC_LEGACY@GOTPAGE
Lloh4:
	ldr	x10, [x10, _IFC_LEGACY@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
Lloh6:
	adrp	x11, _RF_SHAREABLE@GOTPAGE
Lloh7:
	ldr	x11, [x11, _RF_SHAREABLE@GOTPAGEOFF]
Lloh8:
	ldr	w11, [x11]
	tst	w10, w9
	csel	w9, wzr, w11, eq
	orr	w26, w9, w8
	cmp	w2, #512
	cset	w0, lt
	bl	_MPASS
	str	w20, [sp, #20]
Lloh9:
	adrp	x8, _SYS_RES_IRQ@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SYS_RES_IRQ@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	add	x2, sp, #20
	mov	x0, x22
	mov	x3, x26
	bl	_bus_alloc_resource_any
	cbz	x0, LBB0_3
; %bb.1:
	mov	x26, x0
	str	x0, [x21, #8]
	cmp	x25, #0
	ccmp	x24, #0, #4, ne
	cset	w0, eq
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_KASSERT
Lloh14:
	adrp	x8, _INTR_MPSAFE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _INTR_MPSAFE@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
Lloh17:
	adrp	x9, _INTR_TYPE_NET@GOTPAGE
Lloh18:
	ldr	x9, [x9, _INTR_TYPE_NET@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	orr	w2, w9, w8
	add	x6, sp, #24
	mov	x0, x22
	mov	x1, x26
	mov	x3, x25
	mov	x4, x24
	mov	x5, x23
	bl	_bus_setup_intr
	cbz	w0, LBB0_4
; %bb.2:
	mov	x23, x0
Lloh20:
	adrp	x8, l_.str.3@PAGE
Lloh21:
	add	x8, x8, l_.str.3@PAGEOFF
	cmp	x19, #0
	csel	x3, x8, x19, eq
	str	x23, [sp]
Lloh22:
	adrp	x1, l_.str.2@PAGE
Lloh23:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x22
	mov	x2, x20
	bl	_device_printf
	b	LBB0_7
LBB0_3:
Lloh24:
	adrp	x1, l_.str@PAGE
Lloh25:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	mov	x2, x20
	mov	x3, x19
	bl	_device_printf
Lloh26:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh28:
	ldr	w23, [x8]
	b	LBB0_7
LBB0_4:
	cbz	x19, LBB0_6
; %bb.5:
	ldr	x2, [sp, #24]
Lloh29:
	adrp	x3, l_.str.4@PAGE
Lloh30:
	add	x3, x3, l_.str.4@PAGEOFF
	mov	x0, x22
	mov	x1, x26
	mov	x4, x19
	bl	_bus_describe_intr
LBB0_6:
	mov	w23, #0
	ldr	x8, [sp, #24]
	str	x8, [x21]
LBB0_7:
	mov	x0, x23
	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
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_RF_ACTIVE,4,2                  ; @RF_ACTIVE
	.comm	_IFC_LEGACY,4,2                 ; @IFC_LEGACY
	.comm	_RF_SHAREABLE,4,2               ; @RF_SHAREABLE
	.comm	_SYS_RES_IRQ,4,2                ; @SYS_RES_IRQ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to allocate IRQ for rid %d, name %s.\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"filter and handler can't both be non-NULL"

	.comm	_INTR_MPSAFE,4,2                ; @INTR_MPSAFE
	.comm	_INTR_TYPE_NET,4,2              ; @INTR_TYPE_NET
l_.str.2:                               ; @.str.2
	.asciz	"failed to setup interrupt for rid %d, name %s: %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"unknown"

l_.str.4:                               ; @.str.4
	.asciz	"%s"

	.no_dead_strip	__iflib_irq_alloc
.subsections_via_symbols
