	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pnv_php_register_slot
_pnv_php_register_slot:                 ## @pnv_php_register_slot
	.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	%rdi, %r14
	movq	48(%rdi), %r15
	movq	%r15, %rdi
	callq	_pnv_php_find_slot
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%rax, %rdi
	callq	_pnv_php_put_slot
	movq	_EEXIST@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_2:
	leaq	40(%r14), %rdi
	movl	36(%r14), %esi
	movl	28(%r14), %ecx
	movl	32(%r14), %edx
	callq	_pci_hp_register
	testl	%eax, %eax
	je	LBB0_3
## %bb.12:
	movl	%eax, %ebx
	movl	24(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_pci_warn
	jmp	LBB0_11
LBB0_3:
	movq	%r15, %rdi
	callq	_of_get_parent
	testq	%rax, %rax
	je	LBB0_9
## %bb.4:
	movq	%rax, %rbx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_PCI_DN
	testl	%eax, %eax
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%rbx, %rdi
	callq	_pnv_php_find_slot
	movq	%rax, %r15
	movq	%rbx, %rdi
	callq	_of_node_put
	testq	%r15, %r15
	jne	LBB0_13
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%rbx, %rdi
	callq	_of_get_parent
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_5
	jmp	LBB0_9
LBB0_6:
	movq	%rbx, %rdi
	callq	_of_node_put
LBB0_9:
	movq	_pnv_php_lock@GOTPCREL(%rip), %rdi
	callq	_spin_lock_irqsave
	movq	$0, 16(%r14)
	leaq	4(%r14), %rdi
	movq	_pnv_php_slot_list@GOTPCREL(%rip), %rsi
	jmp	LBB0_10
LBB0_13:
	movq	_pnv_php_lock@GOTPCREL(%rip), %rdi
	callq	_spin_lock_irqsave
	movq	%r15, 16(%r14)
	leaq	4(%r14), %rdi
	addq	$8, %r15
	movq	%r15, %rsi
LBB0_10:
	callq	_list_add_tail
	movq	_pnv_php_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock_irqrestore
	movq	_PNV_PHP_STATE_REGISTERED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	xorl	%ebx, %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EEXIST,4,2                     ## @EEXIST
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error %d registering slot\n"

	.comm	_pnv_php_lock,4,2               ## @pnv_php_lock
	.comm	_pnv_php_slot_list,4,2          ## @pnv_php_slot_list
	.comm	_PNV_PHP_STATE_REGISTERED,4,2   ## @PNV_PHP_STATE_REGISTERED
	.no_dead_strip	_pnv_php_register_slot
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pnv_php_register_slot
_pnv_php_register_slot:                 ; @pnv_php_register_slot
	.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
	ldr	x21, [x0, #48]
	mov	x0, x21
	bl	_pnv_php_find_slot
	cbz	x0, LBB0_2
; %bb.1:
	bl	_pnv_php_put_slot
Lloh0:
	adrp	x8, _EEXIST@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EEXIST@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_13
LBB0_2:
	add	x0, x19, #40
	ldp	w2, w1, [x19, #32]
	ldr	w3, [x19, #28]
	bl	_pci_hp_register
	cbz	w0, LBB0_4
; %bb.3:
	mov	x20, x0
	ldr	w0, [x19, #24]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_pci_warn
	b	LBB0_13
LBB0_4:
	mov	x0, x21
	bl	_of_get_parent
	cbz	x0, LBB0_10
; %bb.5:
	mov	x20, x0
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_PCI_DN
	cbz	w0, LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x20
	bl	_pnv_php_find_slot
	mov	x21, x0
	mov	x0, x20
	bl	_of_node_put
	cbnz	x21, LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x20
	bl	_of_get_parent
	mov	x20, x0
	cbnz	x0, LBB0_6
	b	LBB0_10
LBB0_9:
	mov	x0, x20
	bl	_of_node_put
LBB0_10:
Lloh5:
	adrp	x0, _pnv_php_lock@GOTPAGE
Lloh6:
	ldr	x0, [x0, _pnv_php_lock@GOTPAGEOFF]
	bl	_spin_lock_irqsave
	str	xzr, [x19, #16]
	add	x0, x19, #4
Lloh7:
	adrp	x1, _pnv_php_slot_list@GOTPAGE
Lloh8:
	ldr	x1, [x1, _pnv_php_slot_list@GOTPAGEOFF]
	b	LBB0_12
LBB0_11:
Lloh9:
	adrp	x0, _pnv_php_lock@GOTPAGE
Lloh10:
	ldr	x0, [x0, _pnv_php_lock@GOTPAGEOFF]
	bl	_spin_lock_irqsave
	str	x21, [x19, #16]
	add	x0, x19, #4
	add	x1, x21, #8
LBB0_12:
	bl	_list_add_tail
Lloh11:
	adrp	x0, _pnv_php_lock@GOTPAGE
Lloh12:
	ldr	x0, [x0, _pnv_php_lock@GOTPAGEOFF]
	bl	_spin_unlock_irqrestore
	mov	w20, #0
Lloh13:
	adrp	x8, _PNV_PHP_STATE_REGISTERED@GOTPAGE
Lloh14:
	ldr	x8, [x8, _PNV_PHP_STATE_REGISTERED@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	str	w8, [x19]
LBB0_13:
	mov	x0, x20
	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
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_EEXIST,4,2                     ; @EEXIST
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error %d registering slot\n"

	.comm	_pnv_php_lock,4,2               ; @pnv_php_lock
	.comm	_pnv_php_slot_list,4,2          ; @pnv_php_slot_list
	.comm	_PNV_PHP_STATE_REGISTERED,4,2   ; @PNV_PHP_STATE_REGISTERED
	.no_dead_strip	_pnv_php_register_slot
.subsections_via_symbols
