	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pnv_php_alloc_slot
_pnv_php_alloc_slot:                    ## @pnv_php_alloc_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	leaq	L_.str(%rip), %rsi
	leaq	-48(%rbp), %rdx
	callq	_of_property_read_string
	testl	%eax, %eax
	jne	LBB0_3
## %bb.2:
	leaq	-36(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_pnv_pci_get_slot_id
	testq	%rax, %rax
	je	LBB0_5
LBB0_3:
	xorl	%r14d, %r14d
LBB0_4:
	movq	%r14, %rax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	%rbx, %rdi
	callq	_pci_find_bus_by_node
	testq	%rax, %rax
	je	LBB0_3
## %bb.6:
	movq	%rax, %r15
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movl	$72, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.7:
	movq	%rax, %r14
	movq	-48(%rbp), %rdi
	movl	(%r12), %esi
	callq	_kstrdup
	movl	%eax, 64(%r14)
	testl	%eax, %eax
	je	LBB0_14
## %bb.8:
	movq	(%rbx), %rdi
	movl	$-1, %r12d
	testq	%rdi, %rdi
	je	LBB0_11
## %bb.9:
	callq	_PCI_DN
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movq	(%rbx), %rdi
	callq	_PCI_DN
	movl	(%rax), %edi
	callq	_PCI_SLOT
	movl	%eax, %r12d
LBB0_11:
	movl	%r12d, (%r14)
	leaq	60(%r14), %rdi
	callq	_kref_init
	movq	_PNV_PHP_STATE_INITIALIZED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 56(%r14)
	movq	%rbx, 48(%r14)
	movl	(%r15), %eax
	movl	%eax, 40(%r14)
	movq	%r15, 32(%r14)
	movl	-36(%rbp), %eax
	movl	%eax, 24(%r14)
	movl	$0, 4(%r14)
	movq	_php_slot_ops@GOTPCREL(%rip), %rax
	movq	%rax, 16(%r14)
	leaq	12(%r14), %rdi
	callq	_INIT_LIST_HEAD
	movq	%r14, %rdi
	addq	$8, %rdi
	callq	_INIT_LIST_HEAD
	jmp	LBB0_4
LBB0_14:
	movq	%r14, %rdi
	callq	_kfree
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ibm,slot-label"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_PNV_PHP_STATE_INITIALIZED,4,2  ## @PNV_PHP_STATE_INITIALIZED
	.comm	_php_slot_ops,4,2               ## @php_slot_ops
	.no_dead_strip	_pnv_php_alloc_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_alloc_slot
_pnv_php_alloc_slot:                    ; @pnv_php_alloc_slot
	.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	x19, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	add	x2, sp, #8
	bl	_of_property_read_string
	cbnz	w0, LBB0_2
; %bb.1:
	add	x1, sp, #4
	mov	x0, x19
	bl	_pnv_pci_get_slot_id
	cbz	x0, LBB0_4
LBB0_2:
	mov	x20, #0
LBB0_3:
	mov	x0, x20
	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
LBB0_4:
	mov	x0, x19
	bl	_pci_find_bus_by_node
	cbz	x0, LBB0_2
; %bb.5:
	mov	x21, x0
Lloh2:
	adrp	x22, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x22, [x22, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	w0, #72
	bl	_kzalloc
	mov	x20, x0
	cbz	x0, LBB0_3
; %bb.6:
	ldr	x0, [sp, #8]
	ldr	w1, [x22]
	bl	_kstrdup
	str	w0, [x20, #64]
	cbz	w0, LBB0_10
; %bb.7:
	ldr	x0, [x19]
	cbz	x0, LBB0_11
; %bb.8:
	bl	_PCI_DN
	cbz	x0, LBB0_11
; %bb.9:
	ldr	x0, [x19]
	bl	_PCI_DN
	ldr	w0, [x0]
	bl	_PCI_SLOT
	b	LBB0_12
LBB0_10:
	mov	x0, x20
	bl	_kfree
	b	LBB0_2
LBB0_11:
	mov	w0, #-1
LBB0_12:
	str	w0, [x20]
	add	x0, x20, #60
	bl	_kref_init
Lloh4:
	adrp	x8, _PNV_PHP_STATE_INITIALIZED@GOTPAGE
Lloh5:
	ldr	x8, [x8, _PNV_PHP_STATE_INITIALIZED@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	str	w8, [x20, #56]
	str	x19, [x20, #48]
	ldr	w8, [x21]
	str	w8, [x20, #40]
	str	x21, [x20, #32]
	ldr	w8, [sp, #4]
	str	w8, [x20, #24]
	str	wzr, [x20, #4]
Lloh7:
	adrp	x8, _php_slot_ops@GOTPAGE
Lloh8:
	ldr	x8, [x8, _php_slot_ops@GOTPAGEOFF]
	str	x8, [x20, #16]
	add	x0, x20, #12
	bl	_INIT_LIST_HEAD
	add	x0, x20, #8
	bl	_INIT_LIST_HEAD
	b	LBB0_3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ibm,slot-label"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_PNV_PHP_STATE_INITIALIZED,4,2  ; @PNV_PHP_STATE_INITIALIZED
	.comm	_php_slot_ops,4,2               ; @php_slot_ops
	.no_dead_strip	_pnv_php_alloc_slot
.subsections_via_symbols
