	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fdt_apply_overlays             ## -- Begin function fdt_apply_overlays
	.p2align	4, 0x90
_fdt_apply_overlays:                    ## @fdt_apply_overlays
	.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	_fdtp@GOTPCREL(%rip), %rbx
	cmpq	$0, (%rbx)
	je	LBB0_27
## %bb.1:
	movq	_fdtp_size@GOTPCREL(%rip), %r14
	cmpq	$0, (%r14)
	je	LBB0_27
## %bb.2:
	movq	_fdt_overlays_applied@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_27
## %bb.3:
	leaq	L_.str(%rip), %rsi
	xorl	%edi, %edi
	callq	_file_findfile
	testq	%rax, %rax
	je	LBB0_27
## %bb.4:
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rdi, %rcx
	movq	(%rax), %rdi
	movq	24(%rax), %rax
	cmpq	%rdi, %rcx
	cmovaq	%rcx, %rdi
	testq	%rax, %rax
	jne	LBB0_5
## %bb.6:
	testq	%rdi, %rdi
	je	LBB0_27
## %bb.7:
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_28
## %bb.8:
	movq	%rax, %r15
	movq	(%rbx), %r12
	movq	(%r14), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	leaq	L_.str(%rip), %rsi
	xorl	%edi, %edi
	callq	_file_findfile
	testq	%rax, %rax
	je	LBB0_24
## %bb.9:
	movq	%rax, %rbx
	jmp	LBB0_13
LBB0_10:                                ##   in Loop: Header=BB0_13 Depth=1
	leaq	L_str.7(%rip), %rdi
LBB0_11:                                ##   in Loop: Header=BB0_13 Depth=1
	callq	_puts
LBB0_12:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	24(%rbx), %rbx
	testq	%rbx, %rbx
	je	LBB0_24
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movl	16(%rbx), %edi
	movq	(%rbx), %rdx
	movq	%r15, %rsi
	callq	_COPYOUT
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_fdt_check_overlay_compatible
	movq	8(%rbx), %rsi
	testl	%eax, %eax
	je	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	leaq	L_.str.2(%rip), %rdi
LBB0_15:                                ##   in Loop: Header=BB0_13 Depth=1
	xorl	%eax, %eax
	callq	_printf
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_13 Depth=1
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	movq	(%rbx), %r13
	addq	-48(%rbp), %r13                 ## 8-byte Folded Reload
	movq	%r13, %rdi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_10
## %bb.17:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	%rax, %r14
	movq	%r12, %rdi
	movq	%rax, %rsi
	movq	%r13, %rdx
	callq	_fdt_open_into
	testl	%eax, %eax
	je	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	%r14, %rdi
	callq	_free
	leaq	L_str(%rip), %rdi
	jmp	LBB0_11
LBB0_19:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_fdt_overlay_apply
	testl	%eax, %eax
	je	LBB0_21
## %bb.20:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	%r14, %rdi
	movl	%eax, %r14d
	callq	_free
	movl	%r14d, %edi
	callq	_fdt_strerror
	leaq	L_.str.6(%rip), %rdi
	movq	%rax, %rsi
	jmp	LBB0_15
LBB0_21:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	_fdtp@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r12
	je	LBB0_23
## %bb.22:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	%r12, %rdi
	callq	_free
LBB0_23:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, %r12
	jmp	LBB0_12
LBB0_24:
	movq	_fdtp@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	cmpq	%rdi, %r12
	je	LBB0_26
## %bb.25:
	callq	_free
	movq	%r12, (%rbx)
	movq	_fdtp_size@GOTPCREL(%rip), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, (%rax)
LBB0_26:
	movq	%r15, %rdi
	callq	_free
	movq	_fdt_overlays_applied@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
LBB0_27:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_28:
	leaq	L_str.8(%rip), %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_puts                           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_fdtp,8,3                       ## @fdtp
	.comm	_fdtp_size,8,3                  ## @fdtp_size
	.comm	_fdt_overlays_applied,4,2       ## @fdt_overlays_applied
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"dtbo"

L_.str.2:                               ## @.str.2
	.asciz	"DTB overlay '%s' not compatible\n"

L_.str.3:                               ## @.str.3
	.asciz	"applying DTB overlay '%s'\n"

L_.str.6:                               ## @.str.6
	.asciz	"failed to apply overlay: %s\n"

L_str:                                  ## @str
	.asciz	"failed to open base dtb into overlay base"

L_str.7:                                ## @str.7
	.asciz	"failed to allocate memory for overlay base"

L_str.8:                                ## @str.8
	.asciz	"failed to allocate memory for DTB blob with overlays"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fdt_apply_overlays             ; -- Begin function fdt_apply_overlays
	.p2align	2
_fdt_apply_overlays:                    ; @fdt_apply_overlays
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
Lloh0:
	adrp	x20, _fdtp@GOTPAGE
Lloh1:
	ldr	x20, [x20, _fdtp@GOTPAGEOFF]
	ldr	x8, [x20]
Lloh2:
	adrp	x21, _fdtp_size@GOTPAGE
Lloh3:
	ldr	x21, [x21, _fdtp_size@GOTPAGEOFF]
	ldr	x9, [x21]
Lloh4:
	adrp	x10, _fdt_overlays_applied@GOTPAGE
Lloh5:
	ldr	x10, [x10, _fdt_overlays_applied@GOTPAGEOFF]
Lloh6:
	ldr	w10, [x10]
	cmp	x8, #0
	ccmp	x9, #0, #4, ne
	ccmp	w10, #0, #0, ne
	b.ne	LBB0_24
; %bb.1:
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, #0
	bl	_file_findfile
	cbz	x0, LBB0_24
; %bb.2:
	mov	x8, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x0]
	cmp	x8, x9
	csel	x8, x8, x9, hi
	ldr	x0, [x0, #24]
	cbnz	x0, LBB0_3
; %bb.4:
	cbz	x8, LBB0_24
; %bb.5:
	mov	x0, x8
	bl	_malloc
	cbz	x0, LBB0_25
; %bb.6:
	mov	x19, x0
	ldr	x20, [x20]
	ldr	x23, [x21]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, #0
	bl	_file_findfile
	cbz	x0, LBB0_21
; %bb.7:
	mov	x21, x0
Lloh11:
	adrp	x24, l_.str.3@PAGE
Lloh12:
	add	x24, x24, l_.str.3@PAGEOFF
Lloh13:
	adrp	x25, l_str@PAGE
Lloh14:
	add	x25, x25, l_str@PAGEOFF
Lloh15:
	adrp	x26, l_.str.2@PAGE
Lloh16:
	add	x26, x26, l_.str.2@PAGEOFF
	b	LBB0_10
LBB0_8:                                 ;   in Loop: Header=BB0_10 Depth=1
	str	x8, [sp]
	mov	x0, x26
	bl	_printf
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	ldr	x21, [x21, #24]
	cbz	x21, LBB0_21
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21, #16]
	ldr	x2, [x21]
	mov	x1, x19
	bl	_COPYOUT
	mov	x0, x20
	mov	x1, x19
	bl	_fdt_check_overlay_compatible
	ldr	x8, [x21, #8]
	cbnz	w0, LBB0_8
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	str	x8, [sp]
	mov	x0, x24
	bl	_printf
	ldr	x8, [x21]
	add	x28, x8, x23
	mov	x0, x28
	bl	_malloc
	cbz	x0, LBB0_14
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x27, x0
	mov	x0, x20
	mov	x1, x27
	mov	x2, x28
	bl	_fdt_open_into
	cbz	w0, LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x0, x27
	bl	_free
	mov	x0, x25
	bl	_puts
	b	LBB0_9
LBB0_14:                                ;   in Loop: Header=BB0_10 Depth=1
Lloh17:
	adrp	x0, l_str.7@PAGE
Lloh18:
	add	x0, x0, l_str.7@PAGEOFF
	bl	_puts
	b	LBB0_9
LBB0_15:                                ;   in Loop: Header=BB0_10 Depth=1
	mov	x22, x24
	mov	x0, x27
	mov	x1, x19
	bl	_fdt_overlay_apply
	cbz	w0, LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x24, x0
	mov	x0, x27
	bl	_free
	mov	x0, x24
	bl	_fdt_strerror
	str	x0, [sp]
Lloh19:
	adrp	x0, l_.str.6@PAGE
Lloh20:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_printf
	b	LBB0_20
LBB0_17:                                ;   in Loop: Header=BB0_10 Depth=1
Lloh21:
	adrp	x8, _fdtp@GOTPAGE
Lloh22:
	ldr	x8, [x8, _fdtp@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
	cmp	x20, x8
	b.eq	LBB0_19
; %bb.18:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x0, x20
	bl	_free
LBB0_19:                                ;   in Loop: Header=BB0_10 Depth=1
	mov	x23, x28
	mov	x20, x27
LBB0_20:                                ;   in Loop: Header=BB0_10 Depth=1
	mov	x24, x22
	b	LBB0_9
LBB0_21:
Lloh24:
	adrp	x21, _fdtp@GOTPAGE
Lloh25:
	ldr	x21, [x21, _fdtp@GOTPAGEOFF]
	ldr	x0, [x21]
	cmp	x20, x0
	b.eq	LBB0_23
; %bb.22:
	bl	_free
	str	x20, [x21]
Lloh26:
	adrp	x8, _fdtp_size@GOTPAGE
Lloh27:
	ldr	x8, [x8, _fdtp_size@GOTPAGEOFF]
Lloh28:
	str	x23, [x8]
LBB0_23:
	mov	x0, x19
	bl	_free
	mov	w8, #1
Lloh29:
	adrp	x9, _fdt_overlays_applied@GOTPAGE
Lloh30:
	ldr	x9, [x9, _fdt_overlays_applied@GOTPAGEOFF]
Lloh31:
	str	w8, [x9]
LBB0_24:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_25:
Lloh32:
	adrp	x0, l_str.8@PAGE
Lloh33:
	add	x0, x0, l_str.8@PAGEOFF
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_puts
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotStr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotStr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_fdtp,8,3                       ; @fdtp
	.comm	_fdtp_size,8,3                  ; @fdtp_size
	.comm	_fdt_overlays_applied,4,2       ; @fdt_overlays_applied
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"dtbo"

l_.str.2:                               ; @.str.2
	.asciz	"DTB overlay '%s' not compatible\n"

l_.str.3:                               ; @.str.3
	.asciz	"applying DTB overlay '%s'\n"

l_.str.6:                               ; @.str.6
	.asciz	"failed to apply overlay: %s\n"

l_str:                                  ; @str
	.asciz	"failed to open base dtb into overlay base"

l_str.7:                                ; @str.7
	.asciz	"failed to allocate memory for overlay base"

l_str.8:                                ; @str.8
	.asciz	"failed to allocate memory for DTB blob with overlays"

.subsections_via_symbols
