	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_acpi_detect                    ## -- Begin function acpi_detect
	.p2align	4, 0x90
_acpi_detect:                           ## @acpi_detect
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%eax, %eax
	callq	_acpi0_present
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	xorl	%eax, %eax
	callq	_acpi_user_init
	movq	$4, -40(%rbp)
	movq	_machdep_acpi_root@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	leaq	-28(%rbp), %rsi
	leaq	-40(%rbp), %rdx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_sysctlbyname
	testq	%rax, %rax
	je	LBB0_7
## %bb.2:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_4
LBB0_3:
	leaq	L_.str(%rip), %rdi
LBB0_4:
	xorl	%eax, %eax
	callq	_warnx
LBB0_5:
	movl	$-1, %eax
LBB0_6:
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	-28(%rbp), %edi
	callq	_acpi_get_rsdp
	testq	%rax, %rax
	je	LBB0_10
## %bb.8:
	cmpl	$1, (%rax)
	jg	LBB0_11
## %bb.9:
	movl	8(%rax), %edi
	callq	_acpi_map_sdt
	movq	%rax, %r15
	movl	4(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	movl	$4, %edx
	callq	_memcmp
	leaq	L_.str.4(%rip), %r14
	testq	%rax, %rax
	jne	LBB0_13
	jmp	LBB0_12
LBB0_10:
	movl	(%rbx), %esi
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_warnx
	jmp	LBB0_5
LBB0_11:
	movl	4(%rax), %edi
	callq	_acpi_map_sdt
	movq	%rax, %r15
	movl	4(%rax), %edi
	leaq	L_.str.5(%rip), %rsi
	movl	$4, %edx
	callq	_memcmp
	leaq	L_.str.6(%rip), %r14
	testq	%rax, %rax
	jne	LBB0_13
LBB0_12:
	movl	(%r15), %esi
	movq	%r15, %rdi
	callq	_acpi_checksum
	testq	%rax, %rax
	je	LBB0_14
LBB0_13:
	movl	$1, %edi
	movq	%r14, %rsi
	callq	_errx
LBB0_14:
	movq	_addr_size@GOTPCREL(%rip), %rax
	movl	$4, (%rax)
	movq	_ncpu@GOTPCREL(%rip), %rbx
	movl	$0, (%rbx)
	movq	%r15, %rdi
	callq	_acpi_handle_rsdt
	movl	(%rbx), %ecx
	testl	%ecx, %ecx
	movl	$1, %eax
	cmovnel	%ecx, %eax
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no acpi0 device located"

	.comm	_machdep_acpi_root,4,2          ## @machdep_acpi_root
L_.str.1:                               ## @.str.1
	.asciz	"cannot find ACPI information"

L_.str.2:                               ## @.str.2
	.asciz	"cannot find ACPI information: sysctl %s does not point to RSDP"

L_.str.3:                               ## @.str.3
	.asciz	"RSDT"

L_.str.4:                               ## @.str.4
	.asciz	"RSDT is corrupted"

	.comm	_addr_size,4,2                  ## @addr_size
L_.str.5:                               ## @.str.5
	.asciz	"XSDT"

L_.str.6:                               ## @.str.6
	.asciz	"XSDT is corrupted"

	.comm	_ncpu,4,2                       ## @ncpu
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_acpi_detect                    ; -- Begin function acpi_detect
	.p2align	2
_acpi_detect:                           ; @acpi_detect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	bl	_acpi0_present
	cbz	w0, LBB0_3
; %bb.1:
	bl	_acpi_user_init
	mov	w8, #4
	str	x8, [sp, #16]
Lloh0:
	adrp	x19, _machdep_acpi_root@GOTPAGE
Lloh1:
	ldr	x19, [x19, _machdep_acpi_root@GOTPAGEOFF]
	ldr	w0, [x19]
	sub	x1, x29, #20
	add	x2, sp, #16
	mov	x3, #0
	mov	w4, #0
	bl	_sysctlbyname
	cbz	x0, LBB0_6
; %bb.2:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_4
LBB0_3:
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
LBB0_4:
	bl	_warnx
	mov	w0, #-1
LBB0_5:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_6:
	ldur	w0, [x29, #-20]
	bl	_acpi_get_rsdp
	cbz	x0, LBB0_11
; %bb.7:
	ldr	w8, [x0]
	cmp	w8, #1
	b.gt	LBB0_12
; %bb.8:
	ldr	w0, [x0, #8]
	bl	_acpi_map_sdt
	mov	x19, x0
	ldr	w0, [x0, #4]
Lloh6:
	adrp	x1, l_.str.3@PAGE
Lloh7:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w2, #4
	bl	_memcmp
	cbnz	x0, LBB0_10
; %bb.9:
	ldr	w1, [x19]
	mov	x0, x19
	bl	_acpi_checksum
	cbz	x0, LBB0_16
LBB0_10:
Lloh8:
	adrp	x1, l_.str.4@PAGE
Lloh9:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_15
LBB0_11:
	ldr	w8, [x19]
	str	x8, [sp]
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_4
LBB0_12:
	ldr	w0, [x0, #4]
	bl	_acpi_map_sdt
	mov	x19, x0
	ldr	w0, [x0, #4]
Lloh12:
	adrp	x1, l_.str.5@PAGE
Lloh13:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	w2, #4
	bl	_memcmp
	cbnz	x0, LBB0_14
; %bb.13:
	ldr	w1, [x19]
	mov	x0, x19
	bl	_acpi_checksum
	cbz	x0, LBB0_16
LBB0_14:
Lloh14:
	adrp	x1, l_.str.6@PAGE
Lloh15:
	add	x1, x1, l_.str.6@PAGEOFF
LBB0_15:
	mov	w0, #1
	bl	_errx
LBB0_16:
Lloh16:
	adrp	x8, _addr_size@GOTPAGE
Lloh17:
	ldr	x8, [x8, _addr_size@GOTPAGEOFF]
	mov	w9, #4
Lloh18:
	str	w9, [x8]
Lloh19:
	adrp	x20, _ncpu@GOTPAGE
Lloh20:
	ldr	x20, [x20, _ncpu@GOTPAGEOFF]
	str	wzr, [x20]
	mov	x0, x19
	bl	_acpi_handle_rsdt
	ldr	w8, [x20]
	cmp	w8, #0
	csinc	w0, w8, wzr, ne
	b	LBB0_5
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotStr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no acpi0 device located"

	.comm	_machdep_acpi_root,4,2          ; @machdep_acpi_root
l_.str.1:                               ; @.str.1
	.asciz	"cannot find ACPI information"

l_.str.2:                               ; @.str.2
	.asciz	"cannot find ACPI information: sysctl %s does not point to RSDP"

l_.str.3:                               ; @.str.3
	.asciz	"RSDT"

l_.str.4:                               ; @.str.4
	.asciz	"RSDT is corrupted"

	.comm	_addr_size,4,2                  ; @addr_size
l_.str.5:                               ; @.str.5
	.asciz	"XSDT"

l_.str.6:                               ; @.str.6
	.asciz	"XSDT is corrupted"

	.comm	_ncpu,4,2                       ; @ncpu
.subsections_via_symbols
