	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pnv_php_enable
_pnv_php_enable:                        ## @pnv_php_enable
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_OPAL_PCI_SLOT_EMPTY@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movq	%rax, -56(%rbp)
	movq	_OPAL_PCI_SLOT_POWER_ON@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	movq	%rax, -48(%rbp)
	movq	(%rdi), %rax
	movq	_PNV_PHP_STATE_REGISTERED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_15
## %bb.1:
	movq	%rdi, %r12
	movl	%esi, -60(%rbp)                 ## 4-byte Spill
	leaq	20(%rdi), %r15
	leaq	-56(%rbp), %rsi
	movq	%r15, %rdi
	callq	_pnv_php_get_adapter_state
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.2:
	movq	-56(%rbp), %rcx
	movl	8(%r12), %eax
	cmpq	(%r14), %rcx
	jne	LBB0_5
## %bb.3:
	testl	%eax, %eax
	je	LBB0_4
LBB0_11:
	movq	-56(%rbp), %rax
	movq	_OPAL_PCI_SLOT_PRESENT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_14
## %bb.12:
	cmpl	$0, -60(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_14
## %bb.13:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_pci_lock_rescan_remove
	movl	16(%r12), %edi
	callq	_pci_hp_add_devices
	xorl	%eax, %eax
	callq	_pci_unlock_rescan_remove
	movq	_PNV_PHP_STATE_POPULATED@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r12)
	movl	12(%r12), %edi
	callq	_pnv_php_register
	jmp	LBB0_16
LBB0_5:
	testl	%eax, %eax
	je	LBB0_6
LBB0_8:
	leaq	-48(%rbp), %rsi
	movq	%r15, %rdi
	callq	_pnv_php_get_power_state
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.9:
	movq	(%r13), %rsi
	cmpq	%rsi, -48(%rbp)
	je	LBB0_11
## %bb.10:
	movq	%r15, %rdi
	callq	_pnv_php_set_slot_power_state
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
	jmp	LBB0_11
LBB0_14:
	movq	_PNV_PHP_STATE_POPULATED@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r12)
	jmp	LBB0_15
LBB0_4:
	movl	$1, 8(%r12)
LBB0_15:
	xorl	%ebx, %ebx
LBB0_16:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movl	$1, 8(%r12)
	leaq	-48(%rbp), %rsi
	movq	%r15, %rdi
	callq	_pnv_php_get_power_state
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.7:
	movq	-48(%rbp), %rax
	cmpq	(%r13), %rax
	je	LBB0_8
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_OPAL_PCI_SLOT_EMPTY,8,3        ## @OPAL_PCI_SLOT_EMPTY
	.comm	_OPAL_PCI_SLOT_POWER_ON,8,3     ## @OPAL_PCI_SLOT_POWER_ON
	.comm	_PNV_PHP_STATE_REGISTERED,8,3   ## @PNV_PHP_STATE_REGISTERED
	.comm	_OPAL_PCI_SLOT_PRESENT,8,3      ## @OPAL_PCI_SLOT_PRESENT
	.comm	_PNV_PHP_STATE_POPULATED,8,3    ## @PNV_PHP_STATE_POPULATED
	.no_dead_strip	_pnv_php_enable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pnv_php_enable
_pnv_php_enable:                        ; @pnv_php_enable
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
Lloh0:
	adrp	x23, _OPAL_PCI_SLOT_EMPTY@GOTPAGE
Lloh1:
	ldr	x23, [x23, _OPAL_PCI_SLOT_EMPTY@GOTPAGEOFF]
	ldr	x8, [x23]
	str	x8, [sp, #8]
	mov	x21, x0
	ldr	x8, [x21], #20
Lloh2:
	adrp	x22, _OPAL_PCI_SLOT_POWER_ON@GOTPAGE
Lloh3:
	ldr	x22, [x22, _OPAL_PCI_SLOT_POWER_ON@GOTPAGEOFF]
	ldr	x9, [x22]
	str	x9, [sp]
Lloh4:
	adrp	x9, _PNV_PHP_STATE_REGISTERED@GOTPAGE
Lloh5:
	ldr	x9, [x9, _PNV_PHP_STATE_REGISTERED@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_15
; %bb.1:
	mov	x20, x1
	mov	x19, x0
	add	x1, sp, #8
	mov	x0, x21
	bl	_pnv_php_get_adapter_state
	cbnz	w0, LBB0_16
; %bb.2:
	ldr	x9, [sp, #8]
	ldr	x10, [x23]
	ldr	w8, [x19, #8]
	cmp	x9, x10
	b.ne	LBB0_7
; %bb.3:
	cbz	w8, LBB0_12
LBB0_4:
	ldr	x8, [sp, #8]
Lloh7:
	adrp	x9, _OPAL_PCI_SLOT_PRESENT@GOTPAGE
Lloh8:
	ldr	x9, [x9, _OPAL_PCI_SLOT_PRESENT@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.5:
	cbz	w20, LBB0_11
; %bb.6:
	bl	_pci_lock_rescan_remove
	ldr	w0, [x19, #16]
	bl	_pci_hp_add_devices
	bl	_pci_unlock_rescan_remove
Lloh10:
	adrp	x8, _PNV_PHP_STATE_POPULATED@GOTPAGE
Lloh11:
	ldr	x8, [x8, _PNV_PHP_STATE_POPULATED@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	str	x8, [x19]
	ldr	w0, [x19, #12]
	bl	_pnv_php_register
	b	LBB0_15
LBB0_7:
	cbz	w8, LBB0_13
LBB0_8:
	mov	x1, sp
	mov	x0, x21
	bl	_pnv_php_get_power_state
	cbnz	w0, LBB0_16
; %bb.9:
	ldr	x8, [sp]
	ldr	x1, [x22]
	cmp	x8, x1
	b.eq	LBB0_4
; %bb.10:
	mov	x0, x21
	bl	_pnv_php_set_slot_power_state
	cbnz	w0, LBB0_16
	b	LBB0_4
LBB0_11:
	mov	w0, #0
Lloh13:
	adrp	x8, _PNV_PHP_STATE_POPULATED@GOTPAGE
Lloh14:
	ldr	x8, [x8, _PNV_PHP_STATE_POPULATED@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	str	x8, [x19]
	b	LBB0_16
LBB0_12:
	mov	w0, #0
	mov	w8, #1
	str	w8, [x19, #8]
	b	LBB0_16
LBB0_13:
	mov	w8, #1
	str	w8, [x19, #8]
	mov	x1, sp
	mov	x0, x21
	bl	_pnv_php_get_power_state
	cbnz	w0, LBB0_16
; %bb.14:
	ldr	x8, [sp]
	ldr	x9, [x22]
	cmp	x8, x9
	b.eq	LBB0_8
LBB0_15:
	mov	w0, #0
LBB0_16:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_OPAL_PCI_SLOT_EMPTY,8,3        ; @OPAL_PCI_SLOT_EMPTY
	.comm	_OPAL_PCI_SLOT_POWER_ON,8,3     ; @OPAL_PCI_SLOT_POWER_ON
	.comm	_PNV_PHP_STATE_REGISTERED,8,3   ; @PNV_PHP_STATE_REGISTERED
	.comm	_OPAL_PCI_SLOT_PRESENT,8,3      ; @OPAL_PCI_SLOT_PRESENT
	.comm	_PNV_PHP_STATE_POPULATED,8,3    ; @PNV_PHP_STATE_POPULATED
	.no_dead_strip	_pnv_php_enable
.subsections_via_symbols
