	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_acpi_hw_set_mode               ## -- Begin function acpi_hw_set_mode
	.p2align	4, 0x90
_acpi_hw_set_mode:                      ## @acpi_hw_set_mode
	.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
	movl	%edi, %r15d
	movq	_hw_set_mode@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ACPI_FUNCTION_TRACE
	movq	_acpi_gbl_FADT@GOTPCREL(%rip), %r14
	cmpl	$0, 4(%r14)
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_ACPI_ERROR
	movq	_AE_NO_HARDWARE_RESPONSE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_return_ACPI_STATUS
LBB0_2:
	movl	8(%r14), %eax
	orl	(%r14), %eax
	jne	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rdi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_ACPI_ERROR
	movq	_AE_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_return_ACPI_STATUS
LBB0_4:
	cmpl	$128, %r15d
	je	LBB0_8
## %bb.5:
	cmpl	$129, %r15d
	jne	LBB0_9
## %bb.6:
	movl	4(%r14), %edi
	movl	8(%r14), %esi
	movl	$8, %edx
	callq	_acpi_hw_write_port
	movl	%eax, %r14d
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_7
LBB0_8:
	movl	(%r14), %esi
	movl	4(%r14), %edi
	movl	$8, %edx
	callq	_acpi_hw_write_port
	movl	%eax, %r14d
	leaq	L_.str.3(%rip), %rdi
LBB0_7:
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_ACPI_DEBUG_PRINT
	jmp	LBB0_10
LBB0_9:
	movq	_AE_BAD_PARAMETER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_return_ACPI_STATUS
                                        ## implicit-def: $r14d
LBB0_10:
	movl	%r14d, %edi
	callq	_ACPI_FAILURE
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	leaq	L_.str.4(%rip), %rdi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_ACPI_EXCEPTION
	movl	%r14d, %edi
	callq	_return_ACPI_STATUS
LBB0_12:
	movl	$-3000, %ebx                    ## imm = 0xF448
	movq	_AE_OK@GOTPCREL(%rip), %r14
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_14 Depth=1
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_acpi_os_stall
	incl	%ebx
	je	LBB0_16
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_acpi_hw_get_mode
	cmpl	%r15d, %eax
	jne	LBB0_13
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	movl	%r15d, %edi
	callq	_ACPI_DEBUG_PRINT
	movl	(%r14), %edi
	callq	_return_ACPI_STATUS
	jmp	LBB0_13
LBB0_16:
	leaq	L_.str.6(%rip), %rdi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_ACPI_ERROR
	movq	_AE_NO_HARDWARE_RESPONSE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_return_ACPI_STATUS             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_hw_set_mode,4,2                ## @hw_set_mode
	.comm	_acpi_gbl_FADT,12,2             ## @acpi_gbl_FADT
	.comm	_AE_INFO,4,2                    ## @AE_INFO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No SMI_CMD in FADT, mode transition failed"

	.comm	_AE_NO_HARDWARE_RESPONSE,4,2    ## @AE_NO_HARDWARE_RESPONSE
L_.str.1:                               ## @.str.1
	.asciz	"No ACPI mode transition supported in this system (enable/disable both zero)"

	.comm	_AE_OK,4,2                      ## @AE_OK
	.comm	_ACPI_DB_INFO,4,2               ## @ACPI_DB_INFO
L_.str.2:                               ## @.str.2
	.asciz	"Attempting to enable ACPI mode\n"

L_.str.3:                               ## @.str.3
	.asciz	"Attempting to enable Legacy (non-ACPI) mode\n"

	.comm	_AE_BAD_PARAMETER,4,2           ## @AE_BAD_PARAMETER
L_.str.4:                               ## @.str.4
	.asciz	"Could not write ACPI mode change"

L_.str.6:                               ## @.str.6
	.asciz	"Hardware did not change modes"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_acpi_hw_set_mode               ; -- Begin function acpi_hw_set_mode
	.p2align	2
_acpi_hw_set_mode:                      ; @acpi_hw_set_mode
	.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
Lloh0:
	adrp	x8, _hw_set_mode@GOTPAGE
Lloh1:
	ldr	x8, [x8, _hw_set_mode@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_ACPI_FUNCTION_TRACE
Lloh3:
	adrp	x20, _acpi_gbl_FADT@GOTPAGE
Lloh4:
	ldr	x20, [x20, _acpi_gbl_FADT@GOTPAGEOFF]
	ldr	w8, [x20, #4]
Lloh5:
	adrp	x21, _AE_NO_HARDWARE_RESPONSE@GOTPAGE
Lloh6:
	ldr	x21, [x21, _AE_NO_HARDWARE_RESPONSE@GOTPAGEOFF]
	cbnz	w8, LBB0_2
; %bb.1:
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_ACPI_ERROR
	ldr	w0, [x21]
	bl	_return_ACPI_STATUS
LBB0_2:
	ldr	w8, [x20, #8]
	ldr	w9, [x20]
Lloh9:
	adrp	x22, _AE_OK@GOTPAGE
Lloh10:
	ldr	x22, [x22, _AE_OK@GOTPAGEOFF]
	orr	w8, w8, w9
	cbnz	w8, LBB0_4
; %bb.3:
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_ACPI_ERROR
	ldr	w0, [x22]
	bl	_return_ACPI_STATUS
LBB0_4:
	cmp	w19, #128
	b.eq	LBB0_7
; %bb.5:
	cmp	w19, #129
	b.ne	LBB0_9
; %bb.6:
	ldp	w0, w1, [x20, #4]
	mov	w2, #8
	bl	_acpi_hw_write_port
	mov	x20, x0
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_8
LBB0_7:
	ldp	w1, w0, [x20]
	mov	w2, #8
	bl	_acpi_hw_write_port
	mov	x20, x0
Lloh15:
	adrp	x0, l_.str.3@PAGE
Lloh16:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_8:
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_ACPI_DEBUG_PRINT
	b	LBB0_10
LBB0_9:
Lloh17:
	adrp	x8, _AE_BAD_PARAMETER@GOTPAGE
Lloh18:
	ldr	x8, [x8, _AE_BAD_PARAMETER@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	bl	_return_ACPI_STATUS
                                        ; implicit-def: $w20
LBB0_10:
	mov	x0, x20
	bl	_ACPI_FAILURE
	cbz	x0, LBB0_12
; %bb.11:
Lloh20:
	adrp	x0, l_.str.4@PAGE
Lloh21:
	add	x0, x0, l_.str.4@PAGEOFF
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_ACPI_EXCEPTION
	mov	x0, x20
	bl	_return_ACPI_STATUS
LBB0_12:
	mov	w20, #-3000
	b	LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_14 Depth=1
	mov	w0, #1000
	bl	_acpi_os_stall
	adds	w20, w20, #1
	b.hs	LBB0_16
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	bl	_acpi_hw_get_mode
	cmp	w0, w19
	b.ne	LBB0_13
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	mov	x0, x19
	bl	_ACPI_DEBUG_PRINT
	ldr	w0, [x22]
	bl	_return_ACPI_STATUS
	b	LBB0_13
LBB0_16:
Lloh22:
	adrp	x0, l_.str.6@PAGE
Lloh23:
	add	x0, x0, l_.str.6@PAGEOFF
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_ACPI_ERROR
	ldr	w0, [x21]
	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	_return_ACPI_STATUS
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_hw_set_mode,4,2                ; @hw_set_mode
	.comm	_acpi_gbl_FADT,12,2             ; @acpi_gbl_FADT
	.comm	_AE_INFO,4,2                    ; @AE_INFO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No SMI_CMD in FADT, mode transition failed"

	.comm	_AE_NO_HARDWARE_RESPONSE,4,2    ; @AE_NO_HARDWARE_RESPONSE
l_.str.1:                               ; @.str.1
	.asciz	"No ACPI mode transition supported in this system (enable/disable both zero)"

	.comm	_AE_OK,4,2                      ; @AE_OK
	.comm	_ACPI_DB_INFO,4,2               ; @ACPI_DB_INFO
l_.str.2:                               ; @.str.2
	.asciz	"Attempting to enable ACPI mode\n"

l_.str.3:                               ; @.str.3
	.asciz	"Attempting to enable Legacy (non-ACPI) mode\n"

	.comm	_AE_BAD_PARAMETER,4,2           ; @AE_BAD_PARAMETER
l_.str.4:                               ; @.str.4
	.asciz	"Could not write ACPI mode change"

l_.str.6:                               ; @.str.6
	.asciz	"Hardware did not change modes"

.subsections_via_symbols
