	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_acpi_get_hp_hw_control_from_firmware ## -- Begin function acpi_get_hp_hw_control_from_firmware
	.p2align	4, 0x90
_acpi_get_hp_hw_control_from_firmware:  ## @acpi_get_hp_hw_control_from_firmware
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	_ACPI_ALLOCATE_BUFFER@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	movq	%rax, -72(%rbp)
	movq	$0, -64(%rbp)
	movl	$0, -56(%rbp)
	movq	(%rdi), %rdi
	callq	_pci_find_host_bridge
	movq	%rax, %rbx
	leaq	8(%rax), %rdi
	callq	_ACPI_HANDLE
	movq	%rax, %rdi
	callq	_acpi_pci_find_root
	xorl	%r14d, %r14d
	testq	%rax, %rax
	je	LBB0_18
## %bb.1:
	cmpq	$0, (%rax)
	je	LBB0_4
## %bb.2:
	cmpq	$0, (%rbx)
	jne	LBB0_18
## %bb.3:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_18
LBB0_4:
	leaq	8(%r13), %rdi
	callq	_ACPI_HANDLE
	movq	%rax, -48(%rbp)
	testq	%rax, %rax
	je	LBB0_5
LBB0_11:
	movq	_ACPI_FULL_PATHNAME@GOTPCREL(%rip), %rbx
	leaq	-72(%rbp), %r14
	leaq	L_.str(%rip), %r15
	leaq	-48(%rbp), %r12
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %esi
	movq	%rax, %rdi
	movq	%r14, %rdx
	callq	_acpi_get_name
	movq	-72(%rbp), %rdx
	movq	%r13, %rdi
	movq	%r15, %rsi
	xorl	%eax, %eax
	callq	_pci_info
	movq	-48(%rbp), %rdi
	callq	_acpi_run_oshp
	movl	%eax, %edi
	callq	_ACPI_SUCCESS
	testq	%rax, %rax
	jne	LBB0_17
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	-48(%rbp), %rdi
	callq	_acpi_is_root_bridge
	testq	%rax, %rax
	jne	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	-48(%rbp), %rdi
	movq	%r12, %rsi
	callq	_acpi_get_parent
	movl	%eax, %edi
	callq	_ACPI_FAILURE
	testq	%rax, %rax
	jne	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	-48(%rbp), %rax
	testq	%rax, %rax
	jne	LBB0_12
	jmp	LBB0_16
LBB0_5:
	movq	(%r13), %rbx
	testq	%rbx, %rbx
	je	LBB0_7
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_acpi_pci_get_bridge_handle
	testq	%rax, %rax
	jne	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_9 Depth=1
	movq	(%rbx), %rbx
	testq	%rbx, %rbx
	jne	LBB0_9
LBB0_7:
	movq	$0, -48(%rbp)
LBB0_16:
	leaq	L_.str.1(%rip), %rsi
	xorl	%r14d, %r14d
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_pci_info
	movq	-72(%rbp), %rdi
	callq	_kfree
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	jmp	LBB0_18
LBB0_17:
	movq	-72(%rbp), %rdx
	leaq	L_.str.2(%rip), %rsi
	xorl	%r14d, %r14d
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_pci_info
	movq	-72(%rbp), %rdi
	callq	_kfree
LBB0_18:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	%rax, -48(%rbp)
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_ACPI_ALLOCATE_BUFFER,4,2       ## @ACPI_ALLOCATE_BUFFER
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_ACPI_FULL_PATHNAME,4,2         ## @ACPI_FULL_PATHNAME
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Requesting control of SHPC hotplug via OSHP (%s)\n"

L_.str.1:                               ## @.str.1
	.asciz	"Cannot get control of SHPC hotplug\n"

L_.str.2:                               ## @.str.2
	.asciz	"Gained control of SHPC hotplug (%s)\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_acpi_get_hp_hw_control_from_firmware ; -- Begin function acpi_get_hp_hw_control_from_firmware
	.p2align	2
_acpi_get_hp_hw_control_from_firmware:  ; @acpi_get_hp_hw_control_from_firmware
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, _ACPI_ALLOCATE_BUFFER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ACPI_ALLOCATE_BUFFER@GOTPAGEOFF]
Lloh2:
	ldrsw	x8, [x8]
	stp	x8, xzr, [sp, #16]
	str	wzr, [sp, #32]
	ldr	x0, [x0]
	bl	_pci_find_host_bridge
	mov	x20, x0
	add	x0, x0, #8
	bl	_ACPI_HANDLE
	bl	_acpi_pci_find_root
	cbz	x0, LBB0_16
; %bb.1:
	ldr	x8, [x0]
	cbz	x8, LBB0_4
; %bb.2:
	ldr	x8, [x20]
	cbz	x8, LBB0_15
LBB0_3:
	mov	w0, #0
	b	LBB0_16
LBB0_4:
	add	x0, x19, #8
	bl	_ACPI_HANDLE
	str	x0, [sp, #40]
	cbz	x0, LBB0_10
LBB0_5:
Lloh3:
	adrp	x21, _ACPI_FULL_PATHNAME@GOTPAGE
Lloh4:
	ldr	x21, [x21, _ACPI_FULL_PATHNAME@GOTPAGEOFF]
Lloh5:
	adrp	x20, l_.str@PAGE
Lloh6:
	add	x20, x20, l_.str@PAGEOFF
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x21]
	add	x2, sp, #16
	bl	_acpi_get_name
	ldr	x8, [sp, #16]
	str	x8, [sp]
	mov	x0, x19
	mov	x1, x20
	bl	_pci_info
	ldr	x0, [sp, #40]
	bl	_acpi_run_oshp
	bl	_ACPI_SUCCESS
	cbnz	x0, LBB0_17
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x0, [sp, #40]
	bl	_acpi_is_root_bridge
	cbnz	x0, LBB0_14
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x0, [sp, #40]
	add	x1, sp, #40
	bl	_acpi_get_parent
	bl	_ACPI_FAILURE
	cbnz	x0, LBB0_14
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x0, [sp, #40]
	cbnz	x0, LBB0_6
	b	LBB0_14
LBB0_10:
	ldr	x20, [x19]
	cbz	x20, LBB0_13
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_acpi_pci_get_bridge_handle
	cbnz	x0, LBB0_18
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	x20, [x20]
	cbnz	x20, LBB0_11
LBB0_13:
	str	xzr, [sp, #40]
LBB0_14:
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_pci_info
	ldr	x0, [sp, #16]
	bl	_kfree
LBB0_15:
Lloh9:
	adrp	x8, _ENODEV@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_16:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_17:
	ldr	x8, [sp, #16]
	str	x8, [sp]
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_pci_info
	ldr	x0, [sp, #16]
	bl	_kfree
	b	LBB0_3
LBB0_18:
	str	x0, [sp, #40]
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_ACPI_ALLOCATE_BUFFER,4,2       ; @ACPI_ALLOCATE_BUFFER
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_ACPI_FULL_PATHNAME,4,2         ; @ACPI_FULL_PATHNAME
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Requesting control of SHPC hotplug via OSHP (%s)\n"

l_.str.1:                               ; @.str.1
	.asciz	"Cannot get control of SHPC hotplug\n"

l_.str.2:                               ; @.str.2
	.asciz	"Gained control of SHPC hotplug (%s)\n"

.subsections_via_symbols
