	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ioapic_set_smi                 ## -- Begin function ioapic_set_smi
	.p2align	4, 0x90
_ioapic_set_smi:                        ## @ioapic_set_smi
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	cmpq	%rsi, (%rdi)
	jbe	LBB0_1
## %bb.2:
	movq	%rsi, %rdx
	movq	16(%rdi), %rax
	movq	%rsi, %rcx
	shlq	$5, %rcx
	movq	(%rax,%rcx), %rsi
	movq	_IRQ_SMI@GOTPCREL(%rip), %rbx
	movq	(%rbx), %r8
	xorl	%ebx, %ebx
	cmpq	%r8, %rsi
	je	LBB0_6
## %bb.3:
	testq	%rsi, %rsi
	js	LBB0_1
## %bb.4:
	leaq	(%rax,%rcx), %r9
	movq	_APIC_BUS_UNKNOWN@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	movl	%esi, 24(%rax,%rcx)
	movq	%r8, (%r9)
	movq	$0, 16(%rax,%rcx)
	movabsq	$4294967297, %rsi               ## imm = 0x100000001
	movq	%rsi, 8(%rax,%rcx)
	movq	_bootverbose@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_6
## %bb.5:
	movl	8(%rdi), %esi
	leaq	L_.str(%rip), %rdi
	callq	_printf
	jmp	LBB0_6
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_6:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IRQ_SMI,8,3                    ## @IRQ_SMI
	.comm	_APIC_BUS_UNKNOWN,4,2           ## @APIC_BUS_UNKNOWN
	.comm	_bootverbose,8,3                ## @bootverbose
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ioapic%u: Routing SMI -> intpin %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ioapic_set_smi                 ; -- Begin function ioapic_set_smi
	.p2align	2
_ioapic_set_smi:                        ; @ioapic_set_smi
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	ldr	x8, [x0]
	cmp	x8, x1
	b.ls	LBB0_6
; %bb.1:
	mov	x2, x1
	ldr	x9, [x0, #16]
	add	x8, x9, x1, lsl #5
	ldr	x11, [x8]
Lloh0:
	adrp	x10, _IRQ_SMI@GOTPAGE
Lloh1:
	ldr	x10, [x10, _IRQ_SMI@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
	cmp	x11, x10
	b.eq	LBB0_5
; %bb.2:
	tbnz	x11, #63, LBB0_6
; %bb.3:
Lloh3:
	adrp	x11, _APIC_BUS_UNKNOWN@GOTPAGE
Lloh4:
	ldr	x11, [x11, _APIC_BUS_UNKNOWN@GOTPAGEOFF]
Lloh5:
	ldr	w11, [x11]
	add	x9, x9, x2, lsl #5
	str	w11, [x9, #24]
	str	x10, [x8]
	str	xzr, [x9, #16]
	movi.2s	v0, #1
	str	d0, [x9, #8]
Lloh6:
	adrp	x8, _bootverbose@GOTPAGE
Lloh7:
	ldr	x8, [x8, _bootverbose@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cbz	x8, LBB0_5
; %bb.4:
	ldr	w1, [x0, #8]
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printf
LBB0_5:
	mov	w0, #0
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_6:
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IRQ_SMI,8,3                    ; @IRQ_SMI
	.comm	_APIC_BUS_UNKNOWN,4,2           ; @APIC_BUS_UNKNOWN
	.comm	_bootverbose,8,3                ; @bootverbose
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ioapic%u: Routing SMI -> intpin %d\n"

.subsections_via_symbols
