	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pnv_php_set_slot_power_state   ## -- Begin function pnv_php_set_slot_power_state
	.p2align	4, 0x90
_pnv_php_set_slot_power_state:          ## @pnv_php_set_slot_power_state
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	callq	_to_pnv_php_slot
	movq	%rax, %r14
	movl	16(%rax), %edi
	leaq	-40(%rbp), %rdx
	movq	%r15, %rsi
	callq	_pnv_pci_set_power_state
	movl	%eax, %ebx
	testl	%eax, %eax
	jle	LBB0_5
## %bb.1:
	movq	-40(%rbp), %rax
	movl	4(%rax), %edi
	callq	_be64_to_cpu
	movq	8(%r14), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.2:
	movq	-40(%rbp), %rax
	movl	8(%rax), %edi
	callq	_be64_to_cpu
	cmpq	%r15, %rax
	jne	LBB0_4
## %bb.3:
	movq	-40(%rbp), %rax
	movl	12(%rax), %edi
	callq	_be64_to_cpu
	movq	_OPAL_SUCCESS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
LBB0_4:
	movl	(%r14), %r14d
	movq	-40(%rbp), %rax
	movl	4(%rax), %edi
	callq	_be64_to_cpu
	movq	%rax, %r15
	movq	-40(%rbp), %rax
	movl	8(%rax), %edi
	callq	_be64_to_cpu
	movq	%rax, %r12
	movq	-40(%rbp), %rax
	movl	12(%rax), %edi
	callq	_be64_to_cpu
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movl	%r14d, %edi
	movl	%r15d, %edx
	movq	%r12, %rcx
	movq	%rax, %r8
	xorl	%eax, %eax
	callq	_pci_warn
	movq	_ENOMSG@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_5:
	js	LBB0_6
LBB0_7:
	movq	_OPAL_PCI_SLOT_POWER_OFF@GOTPCREL(%rip), %rax
	cmpq	%r15, (%rax)
	je	LBB0_9
## %bb.8:
	movq	_OPAL_PCI_SLOT_OFFLINE@GOTPCREL(%rip), %rax
	cmpq	%r15, (%rax)
	je	LBB0_9
## %bb.10:
	movq	%r14, %rdi
	callq	_pnv_php_add_devtree
	movl	%eax, %ebx
	jmp	LBB0_11
LBB0_6:
	movl	(%r14), %edi
	movq	_OPAL_PCI_SLOT_POWER_ON@GOTPCREL(%rip), %rax
	cmpq	%r15, (%rax)
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.3(%rip), %rcx
	cmoveq	%rax, %rcx
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_pci_warn
	jmp	LBB0_11
LBB0_9:
	movq	%r14, %rdi
	callq	_pnv_php_rmv_devtree
LBB0_11:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_OPAL_SUCCESS,8,3               ## @OPAL_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Wrong msg (%lld, %lld, %lld)\n"

	.comm	_ENOMSG,4,2                     ## @ENOMSG
L_.str.1:                               ## @.str.1
	.asciz	"Error %d powering %s\n"

	.comm	_OPAL_PCI_SLOT_POWER_ON,8,3     ## @OPAL_PCI_SLOT_POWER_ON
L_.str.2:                               ## @.str.2
	.asciz	"on"

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

	.comm	_OPAL_PCI_SLOT_POWER_OFF,8,3    ## @OPAL_PCI_SLOT_POWER_OFF
	.comm	_OPAL_PCI_SLOT_OFFLINE,8,3      ## @OPAL_PCI_SLOT_OFFLINE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pnv_php_set_slot_power_state   ; -- Begin function pnv_php_set_slot_power_state
	.p2align	2
_pnv_php_set_slot_power_state:          ; @pnv_php_set_slot_power_state
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x20, x1
	bl	_to_pnv_php_slot
	mov	x21, x0
	ldr	w0, [x0, #16]
	add	x2, sp, #8
	mov	x1, x20
	bl	_pnv_pci_set_power_state
	mov	x19, x0
	cmp	w0, #1
	b.lt	LBB0_5
; %bb.1:
	ldr	x8, [sp, #8]
	ldr	w0, [x8, #4]
	bl	_be64_to_cpu
	ldr	x8, [x21, #8]
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_4
; %bb.2:
	ldr	x8, [sp, #8]
	ldr	w0, [x8, #8]
	bl	_be64_to_cpu
	cmp	x0, x20
	b.ne	LBB0_4
; %bb.3:
	ldr	x8, [sp, #8]
	ldr	w0, [x8, #12]
	bl	_be64_to_cpu
Lloh0:
	adrp	x8, _OPAL_SUCCESS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _OPAL_SUCCESS@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_6
LBB0_4:
	ldr	w19, [x21]
	ldr	x8, [sp, #8]
	ldr	w0, [x8, #4]
	bl	_be64_to_cpu
	mov	x20, x0
	ldr	x8, [sp, #8]
	ldr	w0, [x8, #8]
	bl	_be64_to_cpu
	mov	x21, x0
	ldr	x8, [sp, #8]
	ldr	w0, [x8, #12]
	bl	_be64_to_cpu
	str	x0, [sp]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	mov	x3, x21
	bl	_pci_warn
Lloh5:
	adrp	x8, _ENOMSG@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMSG@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_10
LBB0_5:
	tbnz	w19, #31, LBB0_8
LBB0_6:
Lloh8:
	adrp	x8, _OPAL_PCI_SLOT_POWER_OFF@GOTPAGE
Lloh9:
	ldr	x8, [x8, _OPAL_PCI_SLOT_POWER_OFF@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
Lloh11:
	adrp	x9, _OPAL_PCI_SLOT_OFFLINE@GOTPAGE
Lloh12:
	ldr	x9, [x9, _OPAL_PCI_SLOT_OFFLINE@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x20
	mov	x0, x21
	ccmp	x9, x20, #4, ne
	b.ne	LBB0_9
; %bb.7:
	bl	_pnv_php_rmv_devtree
	b	LBB0_10
LBB0_8:
	ldr	w0, [x21]
Lloh14:
	adrp	x8, _OPAL_PCI_SLOT_POWER_ON@GOTPAGE
Lloh15:
	ldr	x8, [x8, _OPAL_PCI_SLOT_POWER_ON@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
Lloh17:
	adrp	x9, l_.str.3@PAGE
Lloh18:
	add	x9, x9, l_.str.3@PAGEOFF
Lloh19:
	adrp	x10, l_.str.2@PAGE
Lloh20:
	add	x10, x10, l_.str.2@PAGEOFF
	cmp	x8, x20
	csel	x3, x10, x9, eq
Lloh21:
	adrp	x1, l_.str.1@PAGE
Lloh22:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x19
	bl	_pci_warn
	b	LBB0_10
LBB0_9:
	bl	_pnv_php_add_devtree
	mov	x19, x0
LBB0_10:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_OPAL_SUCCESS,8,3               ; @OPAL_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Wrong msg (%lld, %lld, %lld)\n"

	.comm	_ENOMSG,4,2                     ; @ENOMSG
l_.str.1:                               ; @.str.1
	.asciz	"Error %d powering %s\n"

	.comm	_OPAL_PCI_SLOT_POWER_ON,8,3     ; @OPAL_PCI_SLOT_POWER_ON
l_.str.2:                               ; @.str.2
	.asciz	"on"

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

	.comm	_OPAL_PCI_SLOT_POWER_OFF,8,3    ; @OPAL_PCI_SLOT_POWER_OFF
	.comm	_OPAL_PCI_SLOT_OFFLINE,8,3      ; @OPAL_PCI_SLOT_OFFLINE
.subsections_via_symbols
