	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pci_assign_irq                 ## -- Begin function pci_assign_irq
	.p2align	4, 0x90
_pci_assign_irq:                        ## @pci_assign_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movl	4(%rdi), %edi
	callq	_pci_find_host_bridge
	cmpq	$0, (%rax)
	je	LBB0_10
## %bb.1:
	movq	%rax, %r14
	movq	_PCI_INTERRUPT_PIN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-28(%rbp), %rdx
	movq	%r15, %rdi
	callq	_pci_read_config_byte
	movl	-28(%rbp), %edx
	cmpl	$5, %edx
	jl	LBB0_5
## %bb.2:
	movl	$1, -28(%rbp)
	movl	$1, %edx
	jmp	LBB0_3
LBB0_10:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pci_dbg                        ## TAILCALL
LBB0_5:
	testl	%edx, %edx
	je	LBB0_6
LBB0_3:
	movq	8(%r14), %rcx
	testq	%rcx, %rcx
	je	LBB0_4
## %bb.7:
	leaq	-28(%rbp), %rsi
	movq	%r15, %rdi
	callq	*%rcx
	movl	%eax, %esi
	movl	-28(%rbp), %edx
	jmp	LBB0_8
LBB0_4:
	movl	$-1, %esi
LBB0_8:
	movq	%r15, %rdi
	callq	*(%r14)
	xorl	%ebx, %ebx
	cmpl	$-1, %eax
	cmovnel	%eax, %ebx
	jmp	LBB0_9
LBB0_6:
	xorl	%ebx, %ebx
LBB0_9:
	movl	%ebx, (%r15)
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_pci_dbg
	movq	_PCI_INTERRUPT_LINE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_pci_write_config_byte
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"runtime IRQ mapping not provided by arch\n"

	.comm	_PCI_INTERRUPT_PIN,4,2          ## @PCI_INTERRUPT_PIN
L_.str.1:                               ## @.str.1
	.asciz	"assign IRQ: got %d\n"

	.comm	_PCI_INTERRUPT_LINE,4,2         ## @PCI_INTERRUPT_LINE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pci_assign_irq                 ; -- Begin function pci_assign_irq
	.p2align	2
_pci_assign_irq:                        ; @pci_assign_irq
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
	ldr	w0, [x0, #4]
	bl	_pci_find_host_bridge
	ldr	x8, [x0]
	cbz	x8, LBB0_3
; %bb.1:
	mov	x20, x0
Lloh0:
	adrp	x8, _PCI_INTERRUPT_PIN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PCI_INTERRUPT_PIN@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x19
	bl	_pci_read_config_byte
	ldr	w2, [sp, #12]
	cmp	w2, #5
	b.lt	LBB0_4
; %bb.2:
	mov	w2, #1
	str	w2, [sp, #12]
	b	LBB0_5
LBB0_3:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	b	_pci_dbg
LBB0_4:
	cbz	w2, LBB0_9
LBB0_5:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_7
; %bb.6:
	add	x1, sp, #12
	mov	x0, x19
	blr	x8
	mov	x1, x0
	ldr	w2, [sp, #12]
	b	LBB0_8
LBB0_7:
	mov	w1, #-1
LBB0_8:
	ldr	x8, [x20]
	mov	x0, x19
	blr	x8
	cmn	w0, #1
	csel	w20, wzr, w0, eq
	b	LBB0_10
LBB0_9:
	mov	w20, #0
LBB0_10:
	str	w20, [x19]
	str	x20, [sp]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_pci_dbg
Lloh7:
	adrp	x8, _PCI_INTERRUPT_LINE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PCI_INTERRUPT_LINE@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	bl	_pci_write_config_byte
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"runtime IRQ mapping not provided by arch\n"

	.comm	_PCI_INTERRUPT_PIN,4,2          ; @PCI_INTERRUPT_PIN
l_.str.1:                               ; @.str.1
	.asciz	"assign IRQ: got %d\n"

	.comm	_PCI_INTERRUPT_LINE,4,2         ; @PCI_INTERRUPT_LINE
.subsections_via_symbols
