	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function piix4_poweroff
_piix4_poweroff:                        ## @piix4_poweroff
	.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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_io_offset@GOTPCREL(%rip), %r14
	movq	_PIIX4_FUNC3IO_PMSTS@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	addq	(%r14), %rdi
	callq	_inw
	movq	_PIIX4_FUNC3IO_PMSTS_PWRBTN_STS@GOTPCREL(%rip), %r15
	testl	%eax, (%r15)
	je	LBB0_3
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rsi
	addq	(%r14), %rsi
	movl	%eax, %edi
	callq	_outw
	movq	(%rbx), %rdi
	addq	(%r14), %rdi
	callq	_inw
	testl	%eax, (%r15)
	jne	LBB0_1
LBB0_3:
	movq	_PIIX4_FUNC3IO_PMCNTRL_SUS_TYP_SOFF@GOTPCREL(%rip), %rax
	movq	_PIIX4_FUNC3IO_PMCNTRL_SUS_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	movq	_PIIX4_FUNC3IO_PMCNTRL@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r14), %rsi
	callq	_outw
	movl	$10, %edi
	callq	_mdelay
	movl	$31, %edi
	movl	$7, %esi
	callq	_PCI_DEVFN
	xorl	%edi, %edi
	movl	%eax, %esi
	callq	_PCI_DEVID
	movq	_pm_dev@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rcx), %edi
	movq	_PIIX4_SUSPEND_MAGIC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_pci_bus_write_config_dword
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_mdelay
	leaq	L_.str(%rip), %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pr_emerg                       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_io_offset,8,3                  ## @io_offset
	.comm	_PIIX4_FUNC3IO_PMSTS,8,3        ## @PIIX4_FUNC3IO_PMSTS
	.comm	_PIIX4_FUNC3IO_PMSTS_PWRBTN_STS,4,2 ## @PIIX4_FUNC3IO_PMSTS_PWRBTN_STS
	.comm	_PIIX4_FUNC3IO_PMCNTRL_SUS_TYP_SOFF,4,2 ## @PIIX4_FUNC3IO_PMCNTRL_SUS_TYP_SOFF
	.comm	_PIIX4_FUNC3IO_PMCNTRL_SUS_EN,4,2 ## @PIIX4_FUNC3IO_PMCNTRL_SUS_EN
	.comm	_PIIX4_FUNC3IO_PMCNTRL,8,3      ## @PIIX4_FUNC3IO_PMCNTRL
	.comm	_pm_dev,8,3                     ## @pm_dev
	.comm	_PIIX4_SUSPEND_MAGIC,4,2        ## @PIIX4_SUSPEND_MAGIC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to poweroff system\n"

	.no_dead_strip	_piix4_poweroff
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function piix4_poweroff
_piix4_poweroff:                        ; @piix4_poweroff
	.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
Lloh0:
	adrp	x19, _io_offset@GOTPAGE
Lloh1:
	ldr	x19, [x19, _io_offset@GOTPAGEOFF]
	ldr	x8, [x19]
Lloh2:
	adrp	x20, _PIIX4_FUNC3IO_PMSTS@GOTPAGE
Lloh3:
	ldr	x20, [x20, _PIIX4_FUNC3IO_PMSTS@GOTPAGEOFF]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_inw
Lloh4:
	adrp	x21, _PIIX4_FUNC3IO_PMSTS_PWRBTN_STS@GOTPAGE
Lloh5:
	ldr	x21, [x21, _PIIX4_FUNC3IO_PMSTS_PWRBTN_STS@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x21]
	tst	w8, w0
	b.eq	LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x8, [x19]
	ldr	x9, [x20]
	add	x1, x9, x8
	bl	_outw
	ldr	x8, [x19]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_inw
	b	LBB0_1
LBB0_3:
Lloh6:
	adrp	x8, _PIIX4_FUNC3IO_PMCNTRL_SUS_TYP_SOFF@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PIIX4_FUNC3IO_PMCNTRL_SUS_TYP_SOFF@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _PIIX4_FUNC3IO_PMCNTRL_SUS_EN@GOTPAGE
Lloh10:
	ldr	x9, [x9, _PIIX4_FUNC3IO_PMCNTRL_SUS_EN@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w0, w9, w8
	ldr	x8, [x19]
Lloh12:
	adrp	x9, _PIIX4_FUNC3IO_PMCNTRL@GOTPAGE
Lloh13:
	ldr	x9, [x9, _PIIX4_FUNC3IO_PMCNTRL@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_outw
	mov	w0, #10
	bl	_mdelay
	mov	w0, #31
	mov	w1, #7
	bl	_PCI_DEVFN
	mov	x1, x0
	mov	w0, #0
	bl	_PCI_DEVID
	mov	x1, x0
Lloh15:
	adrp	x8, _pm_dev@GOTPAGE
Lloh16:
	ldr	x8, [x8, _pm_dev@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	ldr	w0, [x8]
Lloh18:
	adrp	x8, _PIIX4_SUSPEND_MAGIC@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PIIX4_SUSPEND_MAGIC@GOTPAGEOFF]
Lloh20:
	ldr	w3, [x8]
	mov	w2, #0
	bl	_pci_bus_write_config_dword
	mov	w0, #1000
	bl	_mdelay
Lloh21:
	adrp	x0, l_.str@PAGE
Lloh22:
	add	x0, x0, l_.str@PAGEOFF
	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
	b	_pr_emerg
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_io_offset,8,3                  ; @io_offset
	.comm	_PIIX4_FUNC3IO_PMSTS,8,3        ; @PIIX4_FUNC3IO_PMSTS
	.comm	_PIIX4_FUNC3IO_PMSTS_PWRBTN_STS,4,2 ; @PIIX4_FUNC3IO_PMSTS_PWRBTN_STS
	.comm	_PIIX4_FUNC3IO_PMCNTRL_SUS_TYP_SOFF,4,2 ; @PIIX4_FUNC3IO_PMCNTRL_SUS_TYP_SOFF
	.comm	_PIIX4_FUNC3IO_PMCNTRL_SUS_EN,4,2 ; @PIIX4_FUNC3IO_PMCNTRL_SUS_EN
	.comm	_PIIX4_FUNC3IO_PMCNTRL,8,3      ; @PIIX4_FUNC3IO_PMCNTRL
	.comm	_pm_dev,8,3                     ; @pm_dev
	.comm	_PIIX4_SUSPEND_MAGIC,4,2        ; @PIIX4_SUSPEND_MAGIC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to poweroff system\n"

	.no_dead_strip	_piix4_poweroff
.subsections_via_symbols
