	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pnv_php_add_devtree
_pnv_php_add_devtree:                   ## @pnv_php_add_devtree
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movl	$65536, %edi                    ## imm = 0x10000
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	(%r14), %rax
	movl	8(%rax), %edi
	movq	%r12, %rsi
	movl	$65536, %edx                    ## imm = 0x10000
	callq	_pnv_pci_get_device_tree
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	movl	32(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_pci_warn
	jmp	LBB0_14
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_15
LBB0_4:
	movq	%r12, %rdi
	callq	_fdt_totalsize
	movl	(%r15), %edx
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_kmemdup
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, %r15
	movq	(%r14), %rsi
	movq	%rax, %rdi
	xorl	%edx, %edx
	callq	_of_fdt_unflatten_tree
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	leaq	8(%r14), %r13
	movq	%r13, %rdi
	callq	_of_changeset_init
	movq	(%r14), %rdi
	callq	_pnv_php_reverse_nodes
	movq	(%r14), %rsi
	movq	%r13, %rdi
	callq	_pnv_php_populate_changeset
	movq	(%r14), %rdi
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movl	%eax, %ebx
	callq	_pnv_php_reverse_nodes
	movl	32(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_pci_warn
	jmp	LBB0_12
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_14
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movl	32(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_pci_warn
	jmp	LBB0_13
LBB0_10:
	movq	$0, (%rdi)
	movq	%r13, %rdi
	callq	_of_changeset_apply
	testl	%eax, %eax
	je	LBB0_16
## %bb.11:
	movl	%eax, %ebx
	movl	32(%r14), %edi
	leaq	L_.str.3(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_pci_warn
	movq	%r13, %rdi
	callq	_of_changeset_destroy
LBB0_12:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_kfree
	movq	(%r14), %rax
	movq	$0, (%rax)
LBB0_13:
	movq	%r15, %rdi
	callq	_kfree
LBB0_14:
	movq	%r12, %rdi
	callq	_kfree
LBB0_15:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movq	%r14, %rdi
	callq	_pnv_php_add_pdns
	movq	%r15, 24(%r14)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 16(%r14)
	movq	%r12, %rdi
	callq	_kfree
	xorl	%ebx, %ebx
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error %d getting FDT blob\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"Cannot unflatten FDT\n"

L_.str.2:                               ## @.str.2
	.asciz	"Error %d populating changeset\n"

L_.str.3:                               ## @.str.3
	.asciz	"Error %d applying changeset\n"

	.no_dead_strip	_pnv_php_add_devtree
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pnv_php_add_devtree
_pnv_php_add_devtree:                   ; @pnv_php_add_devtree
	.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
	mov	x20, x0
Lloh0:
	adrp	x21, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x21, [x21, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	w0, #65536
	bl	_kzalloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	ldr	x8, [x20]
	ldr	w0, [x8, #8]
	mov	x1, x19
	mov	w2, #65536
	bl	_pnv_pci_get_device_tree
	cbz	w0, LBB0_4
; %bb.2:
	mov	x23, x0
	ldr	w0, [x20, #32]
	str	x23, [sp]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_pci_warn
	b	LBB0_14
LBB0_3:
Lloh4:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_15
LBB0_4:
	mov	x0, x19
	bl	_fdt_totalsize
	mov	x1, x0
	ldr	w2, [x21]
	mov	x0, x19
	bl	_kmemdup
	cbz	x0, LBB0_8
; %bb.5:
	mov	x21, x0
	ldr	x1, [x20]
	mov	x2, #0
	bl	_of_fdt_unflatten_tree
	cbz	x0, LBB0_9
; %bb.6:
	mov	x22, x0
	add	x23, x20, #8
	mov	x0, x23
	bl	_of_changeset_init
	ldr	x0, [x20]
	bl	_pnv_php_reverse_nodes
	ldr	x1, [x20]
	mov	x0, x23
	bl	_pnv_php_populate_changeset
	mov	x24, x0
	ldr	x0, [x20]
	cbz	w24, LBB0_10
; %bb.7:
	bl	_pnv_php_reverse_nodes
	ldr	w0, [x20, #32]
	str	x24, [sp]
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_pci_warn
	b	LBB0_12
LBB0_8:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_14
LBB0_9:
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w23, w8
	ldr	w0, [x20, #32]
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_pci_warn
	b	LBB0_13
LBB0_10:
	str	xzr, [x0]
	mov	x0, x23
	bl	_of_changeset_apply
	cbz	w0, LBB0_16
; %bb.11:
	mov	x24, x0
	ldr	w0, [x20, #32]
	str	x24, [sp]
Lloh17:
	adrp	x1, l_.str.3@PAGE
Lloh18:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_pci_warn
	mov	x0, x23
	bl	_of_changeset_destroy
LBB0_12:
	mov	x23, x24
	mov	x0, x22
	bl	_kfree
	ldr	x8, [x20]
	str	xzr, [x8]
LBB0_13:
	mov	x0, x21
	bl	_kfree
LBB0_14:
	mov	x0, x19
	bl	_kfree
LBB0_15:
	mov	x0, x23
	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
LBB0_16:
	mov	x0, x20
	bl	_pnv_php_add_pdns
	stp	x22, x21, [x20, #16]
	mov	x0, x19
	bl	_kfree
	mov	w23, #0
	b	LBB0_15
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error %d getting FDT blob\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"Cannot unflatten FDT\n"

l_.str.2:                               ; @.str.2
	.asciz	"Error %d populating changeset\n"

l_.str.3:                               ; @.str.3
	.asciz	"Error %d applying changeset\n"

	.no_dead_strip	_pnv_php_add_devtree
.subsections_via_symbols
