	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function add_node_to_fdt
_add_node_to_fdt:                       ## @add_node_to_fdt
	.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	$280, %rsp                      ## imm = 0x118
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r13d
	movq	%rsi, %rbx
	movq	%rdi, -320(%rbp)                ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	%rsi, -312(%rbp)
	leaq	-304(%rbp), %rdx
	movq	%rsi, %rdi
	xorl	%esi, %esi
	callq	_OF_nextprop
	testq	%rax, %rax
	jle	LBB0_7
## %bb.1:
	leaq	-304(%rbp), %r12
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	-312(%rbp), %rbx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movq	%r12, %rdx
	callq	_OF_nextprop
	testq	%rax, %rax
	jle	LBB0_7
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r13d, %r15d
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_OF_getproplen
	movl	%eax, %r13d
	testl	%eax, %eax
	movl	$0, %eax
	cmovlel	%eax, %r13d
	cmpl	$1024, %r13d                    ## imm = 0x400
	movl	$1024, %eax                     ## imm = 0x400
	cmovael	%eax, %r13d
	movl	%r13d, %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %r14
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movq	%rax, %rdx
	movl	%r13d, %ecx
	callq	_OF_getprop
	movq	-320(%rbp), %rdi                ## 8-byte Reload
	movl	%r15d, %esi
	movq	%r12, %rdx
	movq	%r14, %rcx
	movl	%r13d, %r8d
	movl	%r15d, %r13d
	callq	_fdt_setprop
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_free
	testl	%ebx, %ebx
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	movq	%r12, %rdx
	movl	%r13d, %ecx
	xorl	%eax, %eax
	callq	_printf
	jmp	LBB0_6
LBB0_7:
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	callq	_OF_hasprop
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movq	-320(%rbp), %r15                ## 8-byte Reload
	jmp	LBB0_12
LBB0_3:
	leaq	L_.str(%rip), %rdi
	leaq	-304(%rbp), %rsi
	xorl	%eax, %eax
	callq	_printf
	jmp	LBB0_18
LBB0_9:
	leaq	L_.str.3(%rip), %rsi
	movq	%rbx, %rdi
	callq	_OF_hasprop
	testl	%eax, %eax
	movq	-320(%rbp), %r15                ## 8-byte Reload
	jne	LBB0_12
## %bb.10:
	leaq	L_.str.4(%rip), %rsi
	movq	%rbx, %rdi
	callq	_OF_hasprop
	testl	%eax, %eax
	jne	LBB0_12
## %bb.11:
	leaq	L_.str.2(%rip), %rdx
	leaq	-312(%rbp), %rcx
	movq	%r15, %rdi
	movl	%r13d, %esi
	movl	$8, %r8d
	callq	_fdt_setprop
	movq	-312(%rbp), %rbx
LBB0_12:
	movq	%rbx, %rdi
	callq	_OF_child
	movq	%rax, -312(%rbp)
	testq	%rax, %rax
	jle	LBB0_18
## %bb.13:
	leaq	-304(%rbp), %r14
	leaq	L_.str.5(%rip), %r12
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_14 Depth=1
	movq	-312(%rbp), %rsi
	movq	%r15, %rdi
	movl	%eax, %edx
	callq	_add_node_to_fdt
LBB0_17:                                ##   in Loop: Header=BB0_14 Depth=1
	movq	-312(%rbp), %rdi
	callq	_OF_peer
	movq	%rax, -312(%rbp)
	testq	%rax, %rax
	jle	LBB0_18
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	%rax, %rdi
	movq	%r14, %rsi
	movl	$255, %edx
	callq	_OF_package_to_path
	movq	%r14, %rdi
	movl	$47, %esi
	callq	_strrchr
	movq	%rax, %rbx
	incq	%rbx
	movq	%r15, %rdi
	movl	%r13d, %esi
	movq	%rbx, %rdx
	callq	_fdt_add_subnode
	testl	%eax, %eax
	jns	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	%r12, %rdi
	movl	%eax, %esi
	movq	%r14, %rdx
	movq	%rbx, %rcx
	xorl	%eax, %eax
	callq	_printf
	jmp	LBB0_17
LBB0_18:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_20
## %bb.19:
	addq	$280, %rsp                      ## imm = 0x118
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot allocate memory for prop %s\n"

L_.str.1:                               ## @.str.1
	.asciz	"Error %d adding property %s to node %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"phandle"

L_.str.3:                               ## @.str.3
	.asciz	"linux,phandle"

L_.str.4:                               ## @.str.4
	.asciz	"ibm,phandle"

L_.str.5:                               ## @.str.5
	.asciz	"Error %d adding node %s (%s), skipping\n"

	.no_dead_strip	_add_node_to_fdt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function add_node_to_fdt
_add_node_to_fdt:                       ; @add_node_to_fdt
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #400
	.cfi_def_cfa_offset 400
	stp	x28, x27, [sp, #304]            ; 16-byte Folded Spill
	stp	x26, x25, [sp, #320]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #336]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #352]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #368]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #384]            ; 16-byte Folded Spill
	add	x29, sp, #384
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
	str	x1, [sp, #32]
	add	x25, sp, #41
	add	x2, sp, #41
	mov	x0, x1
	mov	x1, #0
	bl	_OF_nextprop
	cmp	x0, #1
	b.lt	LBB0_6
; %bb.1:
	mov	w26, #1024
Lloh3:
	adrp	x22, l_.str.1@PAGE
Lloh4:
	add	x22, x22, l_.str.1@PAGEOFF
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x21, [sp, #32]
	add	x1, sp, #41
	add	x2, sp, #41
	mov	x0, x21
	bl	_OF_nextprop
	cmp	x0, #0
	b.le	LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	add	x1, sp, #41
	mov	x0, x21
	bl	_OF_getproplen
	cmp	w0, #0
	csel	w8, w0, wzr, gt
	cmp	w8, #1024
	csel	w23, w8, w26, lo
	mov	x0, x23
	bl	_malloc
	cbz	x0, LBB0_16
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x24, x0
	add	x1, sp, #41
	mov	x0, x21
	mov	x2, x24
	mov	x3, x23
	bl	_OF_getprop
	add	x2, sp, #41
	mov	x0, x20
	mov	x1, x19
	mov	x3, x24
	mov	x4, x23
	bl	_fdt_setprop
	mov	x21, x0
	mov	x0, x24
	bl	_free
	cbz	w21, LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	stp	x25, x19, [sp, #8]
	str	x21, [sp]
	mov	x0, x22
	bl	_printf
	b	LBB0_2
LBB0_6:
Lloh5:
	adrp	x1, l_.str.2@PAGE
Lloh6:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	bl	_OF_hasprop
	cbnz	w0, LBB0_10
; %bb.7:
Lloh7:
	adrp	x1, l_.str.3@PAGE
Lloh8:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x21
	bl	_OF_hasprop
	cbnz	w0, LBB0_10
; %bb.8:
Lloh9:
	adrp	x1, l_.str.4@PAGE
Lloh10:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x21
	bl	_OF_hasprop
	cbnz	w0, LBB0_10
; %bb.9:
Lloh11:
	adrp	x2, l_.str.2@PAGE
Lloh12:
	add	x2, x2, l_.str.2@PAGEOFF
	add	x3, sp, #32
	mov	x0, x20
	mov	x1, x19
	mov	w4, #8
	bl	_fdt_setprop
	ldr	x21, [sp, #32]
LBB0_10:
	mov	x0, x21
	bl	_OF_child
	str	x0, [sp, #32]
	cmp	x0, #1
	b.lt	LBB0_17
; %bb.11:
	add	x23, sp, #41
Lloh13:
	adrp	x21, l_.str.5@PAGE
Lloh14:
	add	x21, x21, l_.str.5@PAGEOFF
	b	LBB0_14
LBB0_12:                                ;   in Loop: Header=BB0_14 Depth=1
	ldr	x1, [sp, #32]
	mov	x0, x20
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_add_node_to_fdt
LBB0_13:                                ;   in Loop: Header=BB0_14 Depth=1
	ldr	x0, [sp, #32]
	bl	_OF_peer
	str	x0, [sp, #32]
	cmp	x0, #0
	b.le	LBB0_17
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	add	x1, sp, #41
	mov	w2, #255
	bl	_OF_package_to_path
	add	x0, sp, #41
	mov	w1, #47
	bl	_strrchr
	add	x22, x0, #1
	mov	x0, x20
	mov	x1, x19
	mov	x2, x22
	bl	_fdt_add_subnode
	mov	x2, x0
	tbz	w0, #31, LBB0_12
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	stp	x23, x22, [sp, #8]
	str	x2, [sp]
	mov	x0, x21
	bl	_printf
	b	LBB0_13
LBB0_16:
	add	x8, sp, #41
	str	x8, [sp]
Lloh15:
	adrp	x0, l_.str@PAGE
Lloh16:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printf
LBB0_17:
	ldur	x8, [x29, #-88]
Lloh17:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh18:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_19
; %bb.18:
	ldp	x29, x30, [sp, #384]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #368]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #352]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #336]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #320]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #304]            ; 16-byte Folded Reload
	add	sp, sp, #400
	ret
LBB0_19:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot allocate memory for prop %s\n"

l_.str.1:                               ; @.str.1
	.asciz	"Error %d adding property %s to node %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"phandle"

l_.str.3:                               ; @.str.3
	.asciz	"linux,phandle"

l_.str.4:                               ; @.str.4
	.asciz	"ibm,phandle"

l_.str.5:                               ; @.str.5
	.asciz	"Error %d adding node %s (%s), skipping\n"

	.no_dead_strip	_add_node_to_fdt
.subsections_via_symbols
