	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ioapic_pci_alloc_irq           ## -- Begin function ioapic_pci_alloc_irq
	.p2align	4, 0x90
_ioapic_pci_alloc_irq:                  ## @ioapic_pci_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_pci_pins@GOTPCREL(%rip), %r14
	cmpl	$0, (%r14)
	je	LBB0_1
## %bb.2:
	movq	%rdi, %rbx
	xorl	%eax, %eax
	callq	_lpc_bootrom
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movl	(%rbx), %ecx
	movl	4(%rbx), %edx
	leal	(%rcx,%rdx), %eax
	addl	$4, %eax
	addl	%edx, %ecx
	addl	$11, %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	andl	$-8, %ecx
	subl	%ecx, %eax
	jmp	LBB0_5
LBB0_1:
	movl	$-1, %eax
	jmp	LBB0_6
LBB0_4:
	movl	_ioapic_pci_alloc_irq.last_pin(%rip), %eax
	leal	1(%rax), %ecx
	movl	%ecx, _ioapic_pci_alloc_irq.last_pin(%rip)
                                        ## kill: def $eax killed $eax killed $rax
	cltd
	idivl	(%r14)
	movl	%edx, %eax
LBB0_5:
	addl	$16, %eax
LBB0_6:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_ioapic_pci_alloc_irq.last_pin,4,2 ## @ioapic_pci_alloc_irq.last_pin
	.comm	_pci_pins,4,2                   ## @pci_pins
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ioapic_pci_alloc_irq           ; -- Begin function ioapic_pci_alloc_irq
	.p2align	2
_ioapic_pci_alloc_irq:                  ; @ioapic_pci_alloc_irq
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x20, _pci_pins@GOTPAGE
Lloh1:
	ldr	x20, [x20, _pci_pins@GOTPAGEOFF]
	ldr	w8, [x20]
	cbz	w8, LBB0_3
; %bb.1:
	mov	x19, x0
	bl	_lpc_bootrom
	cbz	x0, LBB0_4
; %bb.2:
	ldp	w8, w9, [x19]
	add	w8, w8, w9
	add	w8, w8, #4
	and	w9, w8, #0x7
	negs	w8, w8
	and	w8, w8, #0x7
	csneg	w8, w9, w8, mi
	b	LBB0_5
LBB0_3:
	mov	w0, #-1
	b	LBB0_6
LBB0_4:
	adrp	x8, _ioapic_pci_alloc_irq.last_pin@PAGE
	ldr	w9, [x8, _ioapic_pci_alloc_irq.last_pin@PAGEOFF]
	add	w10, w9, #1
	str	w10, [x8, _ioapic_pci_alloc_irq.last_pin@PAGEOFF]
	ldr	w8, [x20]
	sdiv	w10, w9, w8
	msub	w8, w10, w8, w9
LBB0_5:
	add	w0, w8, #16
LBB0_6:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_ioapic_pci_alloc_irq.last_pin,4,2 ; @ioapic_pci_alloc_irq.last_pin
	.comm	_pci_pins,4,2                   ; @pci_pins
.subsections_via_symbols
