	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function madt_parse_interrupt_override
_madt_parse_interrupt_override:         ## @madt_parse_interrupt_override
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	_acpi_quirks@GOTPCREL(%rip), %rax
	movq	_ACPI_Q_MADT_IRQ0@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_5
## %bb.1:
	cmpl	$0, (%rbx)
	jne	LBB0_5
## %bb.2:
	cmpl	$2, 4(%rbx)
	jne	LBB0_5
## %bb.3:
	movq	_bootverbose@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_17
## %bb.4:
	leaq	L_str(%rip), %rdi
	addq	$40, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_puts                           ## TAILCALL
LBB0_5:
	movl	4(%rbx), %edi
	leaq	-24(%rbp), %rsi
	leaq	-12(%rbp), %rdx
	callq	_madt_find_interrupt
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movl	(%rbx), %edx
	movl	4(%rbx), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	jmp	LBB0_17
LBB0_7:
	leaq	-32(%rbp), %rsi
	leaq	-28(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_madt_parse_interrupt_values
	movl	(%rbx), %edx
	movl	4(%rbx), %edi
	cmpl	%edi, %edx
	je	LBB0_16
## %bb.8:
	cmpl	$16, %edi
	jl	LBB0_11
## %bb.9:
	movq	_AcpiGbl_FADT@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	jne	LBB0_11
## %bb.10:
	callq	_acpi_OverrideInterruptLevel
	jmp	LBB0_12
LBB0_11:
	movq	-24(%rbp), %rdi
	movl	-12(%rbp), %esi
	callq	_ioapic_remap_vector
LBB0_12:
	movl	(%rbx), %edi
	leaq	-40(%rbp), %rsi
	leaq	-16(%rbp), %rdx
	callq	_madt_find_interrupt
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:
	movl	(%rbx), %esi
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	jmp	LBB0_16
LBB0_14:
	movq	-40(%rbp), %rdi
	movl	-16(%rbp), %esi
	callq	_ioapic_get_vector
	cmpl	(%rbx), %eax
	jne	LBB0_16
## %bb.15:
	movq	-40(%rbp), %rdi
	movl	-16(%rbp), %esi
	callq	_ioapic_disable_pin
LBB0_16:
	movq	-24(%rbp), %rdi
	movl	-12(%rbp), %esi
	movl	-32(%rbp), %edx
	callq	_ioapic_set_triggermode
	movq	-24(%rbp), %rdi
	movl	-12(%rbp), %esi
	movl	-28(%rbp), %edx
	callq	_ioapic_set_polarity
LBB0_17:
	addq	$40, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_acpi_quirks,4,2                ## @acpi_quirks
	.comm	_ACPI_Q_MADT_IRQ0,4,2           ## @ACPI_Q_MADT_IRQ0
	.comm	_bootverbose,8,3                ## @bootverbose
	.section	__TEXT,__cstring,cstring_literals
L_.str.1:                               ## @.str.1
	.asciz	"MADT: Could not find APIC for vector %u (IRQ %u)\n"

	.comm	_AcpiGbl_FADT,4,2               ## @AcpiGbl_FADT
L_.str.2:                               ## @.str.2
	.asciz	"MADT: Could not find APIC for source IRQ %u\n"

L_str:                                  ## @str
	.asciz	"MADT: Skipping timer override"

	.no_dead_strip	_madt_parse_interrupt_override
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function madt_parse_interrupt_override
_madt_parse_interrupt_override:         ; @madt_parse_interrupt_override
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh0:
	adrp	x8, _acpi_quirks@GOTPAGE
Lloh1:
	ldr	x8, [x8, _acpi_quirks@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _ACPI_Q_MADT_IRQ0@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ACPI_Q_MADT_IRQ0@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.1:
	ldr	w8, [x19]
	cbnz	w8, LBB0_5
; %bb.2:
	ldr	w8, [x19, #4]
	cmp	w8, #2
	b.ne	LBB0_5
; %bb.3:
Lloh6:
	adrp	x8, _bootverbose@GOTPAGE
Lloh7:
	ldr	x8, [x8, _bootverbose@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cbz	x8, LBB0_17
; %bb.4:
Lloh9:
	adrp	x0, l_str@PAGE
Lloh10:
	add	x0, x0, l_str@PAGEOFF
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	b	_puts
LBB0_5:
	ldr	w0, [x19, #4]
	sub	x1, x29, #24
	add	x2, sp, #28
	bl	_madt_find_interrupt
	cbz	x0, LBB0_7
; %bb.6:
	ldp	w9, w8, [x19]
	stp	x8, x9, [sp]
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_printf
	b	LBB0_17
LBB0_7:
	add	x1, sp, #20
	add	x2, sp, #16
	mov	x0, x19
	bl	_madt_parse_interrupt_values
	ldp	w2, w0, [x19]
	cmp	w2, w0
	b.eq	LBB0_16
; %bb.8:
	cmp	w0, #16
	b.lt	LBB0_11
; %bb.9:
Lloh13:
	adrp	x8, _AcpiGbl_FADT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _AcpiGbl_FADT@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	cmp	w2, w8
	b.ne	LBB0_11
; %bb.10:
	bl	_acpi_OverrideInterruptLevel
	b	LBB0_12
LBB0_11:
	ldur	x0, [x29, #-24]
	ldr	w1, [sp, #28]
	bl	_ioapic_remap_vector
LBB0_12:
	ldr	w0, [x19]
	add	x1, sp, #32
	add	x2, sp, #24
	bl	_madt_find_interrupt
	cbz	x0, LBB0_14
; %bb.13:
	ldr	w8, [x19]
	str	x8, [sp]
Lloh16:
	adrp	x0, l_.str.2@PAGE
Lloh17:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_printf
	b	LBB0_16
LBB0_14:
	ldr	x0, [sp, #32]
	ldr	w1, [sp, #24]
	bl	_ioapic_get_vector
	ldr	w8, [x19]
	cmp	w0, w8
	b.ne	LBB0_16
; %bb.15:
	ldr	x0, [sp, #32]
	ldr	w1, [sp, #24]
	bl	_ioapic_disable_pin
LBB0_16:
	ldur	x0, [x29, #-24]
	ldr	w1, [sp, #28]
	ldr	w2, [sp, #20]
	bl	_ioapic_set_triggermode
	ldur	x0, [x29, #-24]
	ldr	w1, [sp, #28]
	ldr	w2, [sp, #16]
	bl	_ioapic_set_polarity
LBB0_17:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_acpi_quirks,4,2                ; @acpi_quirks
	.comm	_ACPI_Q_MADT_IRQ0,4,2           ; @ACPI_Q_MADT_IRQ0
	.comm	_bootverbose,8,3                ; @bootverbose
	.section	__TEXT,__cstring,cstring_literals
l_.str.1:                               ; @.str.1
	.asciz	"MADT: Could not find APIC for vector %u (IRQ %u)\n"

	.comm	_AcpiGbl_FADT,4,2               ; @AcpiGbl_FADT
l_.str.2:                               ; @.str.2
	.asciz	"MADT: Could not find APIC for source IRQ %u\n"

l_str:                                  ; @str
	.asciz	"MADT: Skipping timer override"

	.no_dead_strip	_madt_parse_interrupt_override
.subsections_via_symbols
