	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dmar_alloc_irq
_dmar_alloc_irq:                        ## @dmar_alloc_irq
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r13
	movl	%edi, %r15d
	movq	(%rsi), %rbx
	movslq	%edx, %r12
	callq	_device_get_parent
	movl	%eax, %edi
	callq	_device_get_parent
	movl	%eax, %r14d
	leaq	(%r12,%r12,4), %rax
	movl	%r15d, %esi
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	leaq	(%rbx,%rax,8), %rbx
	movl	%r14d, %edi
	movq	%rbx, %rdx
	callq	_PCIB_ALLOC_MSIX
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %r12d
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	32(%rax,%rcx,8), %edx
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edi
	movl	%r12d, %ecx
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_13
LBB0_2:
	movq	%r13, -96(%rbp)                 ## 8-byte Spill
	movl	%r14d, -60(%rbp)                ## 4-byte Spill
	movq	_SYS_RES_IRQ@GOTPCREL(%rip), %rax
	movq	%rax, %r13
	movl	(%rax), %esi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	4(%rax,%rcx,8), %edx
	movl	(%rbx), %ecx
	movl	%r15d, %r14d
	movl	%r15d, %edi
	movl	$1, %r8d
	callq	_bus_set_resource
	testl	%eax, %eax
	movq	%rbx, -104(%rbp)                ## 8-byte Spill
	je	LBB0_4
## %bb.3:
	movl	%eax, %r12d
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	32(%rax,%rcx,8), %edx
	leaq	L_.str.1(%rip), %rsi
	movl	%r14d, %edi
	movl	%r12d, %ecx
	xorl	%eax, %eax
	callq	_device_printf
	movl	-60(%rbp), %r15d                ## 4-byte Reload
	jmp	LBB0_12
LBB0_4:
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	leaq	(%r15,%r12,8), %rdx
	addq	$4, %rdx
	movl	(%r13), %esi
	movq	_RF_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%r14d, %edi
	movq	%rdx, -88(%rbp)                 ## 8-byte Spill
	callq	_bus_alloc_resource_any
	movq	%rax, 8(%r15,%r12,8)
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	leaq	(%rsi,%rdi,8), %r15
	addq	$8, %r15
	movq	_INTR_TYPE_MISC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	36(%rsi,%rdi,8), %ecx
	leaq	16(%rsi,%rdi,8), %rsi
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	movq	%rsi, (%rsp)
	movl	%r14d, %edi
	movq	%rax, %rsi
	xorl	%r8d, %r8d
	movq	-96(%rbp), %r9                  ## 8-byte Reload
	callq	_bus_setup_intr
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %r12d
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	32(%rax,%rcx,8), %edx
	leaq	L_.str.3(%rip), %rsi
	movl	%r14d, %edi
	movl	%r12d, %ecx
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_10
LBB0_5:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	32(%rax,%rcx,8), %edx
	leaq	L_.str.2(%rip), %rsi
	movl	%r14d, %edi
	xorl	%eax, %eax
	callq	_device_printf
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	-60(%rbp), %r15d                ## 4-byte Reload
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_11
LBB0_8:
	movq	(%r15), %rsi
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edx
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	32(%rax,%rcx,8), %r8d
	leaq	L_.str.4(%rip), %rcx
	movl	%r14d, %edi
	callq	_bus_describe_intr
	movl	(%rbx), %edx
	leaq	-68(%rbp), %rcx
	leaq	-64(%rbp), %r8
	movl	-60(%rbp), %edi                 ## 4-byte Reload
	movl	%r14d, %esi
	callq	_PCIB_MAP_MSI
	testl	%eax, %eax
	je	LBB0_14
## %bb.9:
	movl	%eax, %r12d
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rax,%rcx,8), %rax
	addq	$32, %rax
	movl	(%rax), %edx
	leaq	L_.str.5(%rip), %rsi
	movl	%r14d, %edi
	movl	%r12d, %ecx
	xorl	%eax, %eax
	callq	_device_printf
	movq	(%r15), %rsi
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edx
	movl	%r14d, %edi
	callq	_bus_teardown_intr
LBB0_10:
	movq	_SYS_RES_IRQ@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	movl	(%rbx), %edx
	movq	(%r15), %rcx
	movl	%r14d, %edi
	callq	_bus_release_resource
	movl	-60(%rbp), %r15d                ## 4-byte Reload
LBB0_11:
	movl	(%r13), %esi
	movl	(%rbx), %edx
	movl	%r14d, %edi
	callq	_bus_delete_resource
LBB0_12:
	movq	-104(%rbp), %rbx                ## 8-byte Reload
	movl	(%rbx), %edx
	movl	%r15d, %edi
	movl	%r14d, %esi
	callq	_PCIB_RELEASE_MSIX
	movl	$-1, (%rbx)
LBB0_13:
	movl	%r12d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movl	28(%r14,%r15,8), %esi
	movl	-64(%rbp), %edx
	movq	-96(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_dmar_write4
	movl	24(%r14,%r15,8), %esi
	movl	-68(%rbp), %edx
	movq	%rbx, %rdi
	callq	_dmar_write4
	movl	20(%r14,%r15,8), %esi
	movq	%rbx, %rdi
	callq	_dmar_write4
	xorl	%r12d, %r12d
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cannot allocate %s interrupt, %d\n"

	.comm	_SYS_RES_IRQ,4,2                ## @SYS_RES_IRQ
L_.str.1:                               ## @.str.1
	.asciz	"cannot set %s interrupt resource, %d\n"

	.comm	_RF_ACTIVE,4,2                  ## @RF_ACTIVE
L_.str.2:                               ## @.str.2
	.asciz	"cannot allocate resource for %s interrupt\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_INTR_TYPE_MISC,4,2             ## @INTR_TYPE_MISC
L_.str.3:                               ## @.str.3
	.asciz	"cannot setup %s interrupt, %d\n"

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

L_.str.5:                               ## @.str.5
	.asciz	"cannot map %s interrupt, %d\n"

	.no_dead_strip	_dmar_alloc_irq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dmar_alloc_irq
_dmar_alloc_irq:                        ; @dmar_alloc_irq
	.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, x2
	mov	x23, x1
	mov	x19, x0
	ldr	x27, [x1]
	sxtw	x28, w20
	bl	_device_get_parent
	bl	_device_get_parent
	mov	x21, x0
	mov	w8, #40
	smaddl	x20, w20, w8, x27
	mov	x1, x19
	mov	x2, x20
	bl	_PCIB_ALLOC_MSIX
	cbz	w0, LBB0_2
; %bb.1:
	mov	x24, x0
	mov	w8, #40
	madd	x8, x28, x8, x27
	ldr	w2, [x8, #32]
	str	x24, [sp]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_device_printf
	b	LBB0_13
LBB0_2:
Lloh2:
	adrp	x25, _SYS_RES_IRQ@GOTPAGE
Lloh3:
	ldr	x25, [x25, _SYS_RES_IRQ@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	w8, #40
	madd	x22, x28, x8, x27
	ldr	w2, [x22, #4]!
	ldr	w3, [x20]
	mov	x0, x19
	mov	w4, #1
	bl	_bus_set_resource
	cbz	w0, LBB0_4
; %bb.3:
	mov	x24, x0
	mov	w8, #40
	madd	x8, x28, x8, x27
	ldr	w2, [x8, #32]
	str	x24, [sp]
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_device_printf
                                        ; kill: def $w24 killed $w24 killed $x24 def $x24
	b	LBB0_12
LBB0_4:
	ldr	w1, [x25]
Lloh6:
	adrp	x8, _RF_ACTIVE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _RF_ACTIVE@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
	mov	x0, x19
	mov	x2, x22
	bl	_bus_alloc_resource_any
	mov	w8, #40
	madd	x26, x28, x8, x27
	str	x0, [x26, #8]!
	cbz	x0, LBB0_7
; %bb.5:
	mov	x1, x0
Lloh9:
	adrp	x8, _INTR_TYPE_MISC@GOTPAGE
Lloh10:
	ldr	x8, [x8, _INTR_TYPE_MISC@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	w8, #40
	madd	x8, x28, x8, x27
	ldr	w3, [x8, #36]
	add	x24, x8, #16
	mov	x0, x19
	mov	x4, #0
	mov	x5, x23
	mov	x6, x24
	bl	_bus_setup_intr
	cbz	w0, LBB0_8
; %bb.6:
	mov	x25, x0
	mov	w8, #40
	madd	x8, x28, x8, x27
	ldr	w2, [x8, #32]
	str	x25, [sp]
Lloh12:
	adrp	x1, l_.str.3@PAGE
Lloh13:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_device_printf
	mov	x24, x25
	b	LBB0_10
LBB0_7:
	mov	w8, #40
	madd	x8, x28, x8, x27
	ldr	w2, [x8, #32]
Lloh14:
	adrp	x1, l_.str.2@PAGE
Lloh15:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_device_printf
Lloh16:
	adrp	x8, _ENXIO@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh18:
	ldr	w24, [x8]
	b	LBB0_11
LBB0_8:
	ldr	x1, [x26]
	ldr	w2, [x24]
	mov	w8, #40
	madd	x25, x28, x8, x27
	ldr	w4, [x25, #32]!
Lloh19:
	adrp	x3, l_.str.4@PAGE
Lloh20:
	add	x3, x3, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_bus_describe_intr
	ldr	w2, [x20]
	add	x3, sp, #12
	add	x4, sp, #8
	mov	x0, x21
	mov	x1, x19
	bl	_PCIB_MAP_MSI
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_14
; %bb.9:
	ldr	w2, [x25]
	str	x0, [sp]
Lloh21:
	adrp	x1, l_.str.5@PAGE
Lloh22:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x23, x0
	mov	x0, x19
	bl	_device_printf
	ldr	x1, [x26]
	ldr	w2, [x24]
	mov	x0, x19
	bl	_bus_teardown_intr
	mov	x24, x23
LBB0_10:
Lloh23:
	adrp	x25, _SYS_RES_IRQ@GOTPAGE
Lloh24:
	ldr	x25, [x25, _SYS_RES_IRQ@GOTPAGEOFF]
	ldr	w1, [x25]
	ldr	w2, [x22]
	ldr	x3, [x26]
	mov	x0, x19
	bl	_bus_release_resource
LBB0_11:
	ldr	w1, [x25]
	ldr	w2, [x22]
	mov	x0, x19
	bl	_bus_delete_resource
LBB0_12:
	ldr	w2, [x20]
	mov	x0, x21
	mov	x1, x19
	bl	_PCIB_RELEASE_MSIX
	mov	w8, #-1
	str	w8, [x20]
LBB0_13:
	mov	x0, x24
	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_14:
	mov	w8, #40
	madd	x19, x28, x8, x27
	ldr	w1, [x19, #28]
	ldr	w2, [sp, #8]
	mov	x0, x23
	bl	_dmar_write4
	ldr	w1, [x19, #24]
	ldr	w2, [sp, #12]
	mov	x0, x23
	bl	_dmar_write4
	ldr	w1, [x19, #20]
	mov	x0, x23
	bl	_dmar_write4
	mov	w24, #0
	b	LBB0_13
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cannot allocate %s interrupt, %d\n"

	.comm	_SYS_RES_IRQ,4,2                ; @SYS_RES_IRQ
l_.str.1:                               ; @.str.1
	.asciz	"cannot set %s interrupt resource, %d\n"

	.comm	_RF_ACTIVE,4,2                  ; @RF_ACTIVE
l_.str.2:                               ; @.str.2
	.asciz	"cannot allocate resource for %s interrupt\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_INTR_TYPE_MISC,4,2             ; @INTR_TYPE_MISC
l_.str.3:                               ; @.str.3
	.asciz	"cannot setup %s interrupt, %d\n"

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

l_.str.5:                               ; @.str.5
	.asciz	"cannot map %s interrupt, %d\n"

	.no_dead_strip	_dmar_alloc_irq
.subsections_via_symbols
