	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ioapic_register                ## -- Begin function ioapic_register
	.p2align	4, 0x90
_ioapic_register:                       ## @ioapic_register
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	32(%rdi), %rbx
	movq	_icu_lock@GOTPCREL(%rip), %r12
	movq	%r12, %rdi
	callq	_mtx_lock_spin
	movq	_IOAPIC_VER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_ioapic_read
	movl	%eax, %r14d
	movq	_IOART_VER_VERSION@GOTPCREL(%rip), %rax
	andl	(%rax), %r14d
	movq	_io_next@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_ioapic_list@GOTPCREL(%rip), %rdi
	movq	%r15, %rsi
	callq	_STAILQ_INSERT_TAIL
	movq	%r12, %rdi
	callq	_mtx_unlock_spin
	movl	%r14d, %edx
	sarl	$4, %edx
	andl	$15, %r14d
	movl	(%r15), %esi
	movl	4(%r15), %r8d
	movl	8(%r15), %eax
	leal	(%r8,%rax), %r9d
	decl	%r9d
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %ecx
                                        ## kill: def $r8d killed $r8d killed $r8
	callq	_printf
	leaq	24(%r15), %rdi
	callq	_intr_register_pic
	cmpl	$0, 8(%r15)
	jle	LBB0_3
## %bb.1:
	movq	16(%r15), %r14
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_ioapic_reprogram_intpin
	incl	%ebx
	addq	$4, %r14
	cmpl	8(%r15), %ebx
	jl	LBB0_2
LBB0_3:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_icu_lock,4,2                   ## @icu_lock
	.comm	_IOAPIC_VER,4,2                 ## @IOAPIC_VER
	.comm	_IOART_VER_VERSION,4,2          ## @IOART_VER_VERSION
	.comm	_ioapic_list,4,2                ## @ioapic_list
	.comm	_io_next,4,2                    ## @io_next
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ioapic%u <Version %u.%u> irqs %u-%u\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ioapic_register                ; -- Begin function ioapic_register
	.p2align	2
_ioapic_register:                       ; @ioapic_register
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x0
	ldr	x20, [x0, #32]
Lloh0:
	adrp	x21, _icu_lock@GOTPAGE
Lloh1:
	ldr	x21, [x21, _icu_lock@GOTPAGEOFF]
	mov	x0, x21
	bl	_mtx_lock_spin
Lloh2:
	adrp	x8, _IOAPIC_VER@GOTPAGE
Lloh3:
	ldr	x8, [x8, _IOAPIC_VER@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_ioapic_read
Lloh5:
	adrp	x8, _IOART_VER_VERSION@GOTPAGE
Lloh6:
	ldr	x8, [x8, _IOART_VER_VERSION@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	and	w20, w8, w0
Lloh8:
	adrp	x8, _io_next@GOTPAGE
Lloh9:
	ldr	x8, [x8, _io_next@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
Lloh11:
	adrp	x0, _ioapic_list@GOTPAGE
Lloh12:
	ldr	x0, [x0, _ioapic_list@GOTPAGEOFF]
	mov	x1, x19
	bl	_STAILQ_INSERT_TAIL
	mov	x0, x21
	bl	_mtx_unlock_spin
	asr	w2, w20, #4
	and	w3, w20, #0xf
	ldp	w1, w4, [x19]
	ldr	w8, [x19, #8]
	add	w8, w4, w8
	sub	w5, w8, #1
Lloh13:
	adrp	x0, l_.str@PAGE
Lloh14:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printf
	add	x0, x19, #24
	bl	_intr_register_pic
	ldr	w8, [x19, #8]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.1:
	mov	w21, #0
	ldr	x20, [x19, #16]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_ioapic_reprogram_intpin
	add	w21, w21, #1
	add	x20, x20, #4
	ldr	w8, [x19, #8]
	cmp	w21, w8
	b.lt	LBB0_2
LBB0_3:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_icu_lock,4,2                   ; @icu_lock
	.comm	_IOAPIC_VER,4,2                 ; @IOAPIC_VER
	.comm	_IOART_VER_VERSION,4,2          ; @IOART_VER_VERSION
	.comm	_ioapic_list,4,2                ; @ioapic_list
	.comm	_io_next,4,2                    ; @io_next
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ioapic%u <Version %u.%u> irqs %u-%u\n"

.subsections_via_symbols
