	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dtoverlay_remove
_dtoverlay_remove:                      ## @dtoverlay_remove
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, -68(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r12
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movl	(%rdi), %r14d
	movq	_work_dir@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_chdir
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movl	(%rbx), %esi
	leaq	L_.str(%rip), %rdi
	callq	_fatal_error
LBB0_2:
	testq	%r12, %r12
	je	LBB0_19
## %bb.3:
	movq	%r12, %rdi
	callq	_strlen
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	leaq	-96(%rbp), %rsi
	movq	%r12, %rdi
	movl	$10, %edx
	callq	_strtoul
	movl	%eax, %r13d
	movq	-96(%rbp), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.4:
	cmpb	$0, (%rax)
	je	LBB0_5
LBB0_7:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	testl	%r14d, %r14d
	jle	LBB0_17
## %bb.8:
	movslq	-64(%rbp), %r15                 ## 4-byte Folded Reload
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_9 Depth=1
	leaq	1(%r14), %rax
	movq	%r14, %r13
	cmpq	$1, %rax
	jbe	LBB0_17
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	leaq	-1(%r13), %r14
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movl	%r14d, %ecx
	movq	(%rax,%rcx,8), %rax
	movq	(%rax), %rdi
	movl	$95, %esi
	callq	_strchr
	testq	%rax, %rax
	je	LBB0_10
## %bb.12:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%rax, %rbx
	incq	%rbx
	movq	%rbx, %rdi
	movl	$46, %esi
	callq	_strchr
	testq	%rax, %rax
	je	LBB0_10
## %bb.13:                              ##   in Loop: Header=BB0_9 Depth=1
	subq	%rbx, %rax
	cmpq	%r15, %rax
	jne	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movl	-64(%rbp), %edx                 ## 4-byte Reload
	callq	_memcmp
	testq	%rax, %rax
	jne	LBB0_15
## %bb.22:
	decl	%r13d
	jmp	LBB0_23
LBB0_19:
	testl	%r14d, %r14d
	je	LBB0_20
## %bb.21:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	leal	-1(%r14), %eax
	xorl	%r13d, %r13d
	cmpl	$0, -68(%rbp)                   ## 4-byte Folded Reload
	cmovel	%eax, %r13d
LBB0_23:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	cmpl	%eax, %r13d
	jge	LBB0_56
## %bb.24:
	movslq	%eax, %r15
	movslq	%r13d, %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	_dt_overlays_dir@GOTPCREL(%rip), %r14
	leaq	L_.str.5(%rip), %r12
	.p2align	4, 0x90
LBB0_25:                                ## =>This Inner Loop Header: Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movq	-8(%rax,%r15,8), %rax
	movq	(%rax), %rbx
	movq	%rbx, %rdi
	movl	$46, %esi
	callq	_strrchr
	testq	%rax, %rax
	je	LBB0_10
## %bb.26:                              ##   in Loop: Header=BB0_25 Depth=1
	movl	(%r14), %esi
	subq	%rbx, %rax
	movq	%r12, %rdi
	movq	%rax, %rdx
	movq	%rbx, %rcx
	xorl	%eax, %eax
	callq	_sprintf_dup
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_rmdir
	testq	%rax, %rax
	jne	LBB0_27
## %bb.28:                              ##   in Loop: Header=BB0_25 Depth=1
	decq	%r15
	movq	%rbx, %rdi
	callq	_free_string
	cmpq	-64(%rbp), %r15                 ## 8-byte Folded Reload
	jg	LBB0_25
## %bb.29:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	%r13d, (%rax)
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_30
	.p2align	4, 0x90
LBB0_34:                                ##   in Loop: Header=BB0_30 Depth=1
	movq	%r12, %rdi
	callq	_unlink
LBB0_55:                                ##   in Loop: Header=BB0_30 Depth=1
	incq	%r14
	cmpl	%r14d, %r15d
	je	LBB0_56
LBB0_30:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_44 Depth 2
                                        ##     Child Loop BB0_49 Depth 2
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movq	(%rax,%r14,8), %rax
	movq	(%rax), %r12
	movq	%r12, %rdi
	movl	$95, %esi
	callq	_strchr
	testq	%rax, %rax
	je	LBB0_10
## %bb.31:                              ##   in Loop: Header=BB0_30 Depth=1
	movq	%rax, %rbx
	incq	%rbx
	movq	%rbx, %rdi
	movl	$46, %esi
	callq	_strchr
	testq	%rax, %rax
	je	LBB0_10
## %bb.32:                              ##   in Loop: Header=BB0_30 Depth=1
	cmpl	$0, -68(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_34
## %bb.33:                              ##   in Loop: Header=BB0_30 Depth=1
	cmpq	-64(%rbp), %r14                 ## 8-byte Folded Reload
	je	LBB0_34
## %bb.35:                              ##   in Loop: Header=BB0_30 Depth=1
	movq	%rax, %r13
	subl	%ebx, %r13d
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %esi
	leaq	L_.str.7(%rip), %rdi
	movl	%r13d, %edx
	movq	%rbx, %rcx
	xorl	%eax, %eax
	callq	_sprintf_dup
	leaq	L_.str.8(%rip), %rdi
	movq	%rax, %r15
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	_sprintf_dup
	cmpl	$7, %r13d
	jne	LBB0_51
## %bb.36:                              ##   in Loop: Header=BB0_30 Depth=1
	movq	%rbx, %rdi
	leaq	L_.str.9(%rip), %rsi
	movl	$7, %edx
	movq	%rax, %rbx
	callq	_memcmp
	testq	%rax, %rax
	movq	%rbx, %rax
	je	LBB0_37
LBB0_51:                                ##   in Loop: Header=BB0_30 Depth=1
	movq	%r12, %rdi
	movq	%rax, %rsi
	movq	%rax, %rbx
	callq	_rename
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_apply_overlay
	xorl	%ebx, %ebx
	testl	%eax, %eax
	sete	%bl
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	testl	%ebx, %ebx
	je	LBB0_54
LBB0_53:                                ##   in Loop: Header=BB0_30 Depth=1
	leaq	L_.str.10(%rip), %rdi
	xorl	%eax, %eax
	callq	_error
	jmp	LBB0_55
LBB0_37:                                ##   in Loop: Header=BB0_30 Depth=1
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_dtoverlay_load_dtb
	movq	%rax, %rbx
	movq	%r12, %rdi
	callq	_unlink
	testq	%rbx, %rbx
	je	LBB0_38
## %bb.39:                              ##   in Loop: Header=BB0_30 Depth=1
	movq	%rbx, %rdi
	callq	_dtoverlay_dtb_trailer
	testq	%rax, %rax
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_42
## %bb.40:                              ##   in Loop: Header=BB0_30 Depth=1
	movq	%rax, %r12
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	cmpb	$0, (%rax)
	je	LBB0_41
## %bb.43:                              ##   in Loop: Header=BB0_30 Depth=1
	xorl	%r13d, %r13d
	movq	%r12, %rbx
	leaq	L_.str.11(%rip), %r15
	.p2align	4, 0x90
LBB0_44:                                ##   Parent Loop BB0_30 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	leaq	1(%rbx), %rdi
	movb	$0, (%rbx)
	movq	%r15, %rsi
	callq	_strcspn
	incl	%r13d
	cltq
	cmpb	$0, 1(%rbx,%rax)
	leaq	1(%rbx,%rax), %rbx
	jne	LBB0_44
	jmp	LBB0_45
LBB0_38:                                ##   in Loop: Header=BB0_30 Depth=1
	leaq	L_.str.10(%rip), %rdi
	xorl	%eax, %eax
	callq	_error
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_55
LBB0_42:                                ##   in Loop: Header=BB0_30 Depth=1
	leaq	L_.str.10(%rip), %rdi
	xorl	%eax, %eax
	callq	_error
	movq	%rbx, %rdi
	callq	_dtoverlay_free_dtb
	jmp	LBB0_55
LBB0_41:                                ##   in Loop: Header=BB0_30 Depth=1
	xorl	%r13d, %r13d
LBB0_45:                                ##   in Loop: Header=BB0_30 Depth=1
	leal	8(,%r13,8), %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_46
## %bb.47:                              ##   in Loop: Header=BB0_30 Depth=1
	movq	%rax, %r15
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	movl	%r13d, %r14d
	testl	%r13d, %r13d
	je	LBB0_50
## %bb.48:                              ##   in Loop: Header=BB0_30 Depth=1
	incq	%r12
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_49:                                ##   Parent Loop BB0_30 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r12, (%r15,%rbx,8)
	movq	%r12, %rdi
	callq	_strlen
	cltq
	addq	%rax, %r12
	incq	%r12
	incq	%rbx
	cmpq	%rbx, %r14
	jne	LBB0_49
LBB0_50:                                ##   in Loop: Header=BB0_30 Depth=1
	movq	$0, (%r15,%r14,8)
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str.9(%rip), %rsi
	movl	%r13d, %edx
	movq	%r15, %rcx
	callq	_dtoverlay_add
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_free
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_dtoverlay_free_dtb
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	testl	%ebx, %ebx
	jne	LBB0_53
LBB0_54:                                ##   in Loop: Header=BB0_30 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	incl	(%rax)
	jmp	LBB0_55
LBB0_46:                                ##   in Loop: Header=BB0_30 Depth=1
	leaq	L_.str.12(%rip), %rdi
	xorl	%eax, %eax
	callq	_error
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_dtoverlay_free_dtb
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_55
LBB0_10:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_11
LBB0_56:
	xorl	%eax, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	cmpl	%r14d, %r13d
	jge	LBB0_6
## %bb.16:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	testl	%r13d, %r13d
	jns	LBB0_23
LBB0_17:
	leaq	L_.str.3(%rip), %rdi
	movq	%r12, %rsi
LBB0_18:
	xorl	%eax, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_error                          ## TAILCALL
LBB0_20:
	leaq	L_.str.4(%rip), %rdi
LBB0_11:
	xorl	%eax, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_error                          ## TAILCALL
LBB0_6:
	leaq	L_.str.1(%rip), %rdi
	movl	%r13d, %esi
	xorl	%eax, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_error                          ## TAILCALL
LBB0_27:
	leaq	L_.str.6(%rip), %rdi
	movq	%rbx, %rsi
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_work_dir,4,2                   ## @work_dir
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to chdir to '%s'"

L_.str.1:                               ## @.str.1
	.asciz	"Overlay index (%d) too large"

L_.str.2:                               ## @.str.2
	.asciz	"Internal error"

L_.str.3:                               ## @.str.3
	.asciz	"Overlay '%s' is not loaded"

L_.str.4:                               ## @.str.4
	.asciz	"No overlays loaded"

L_.str.5:                               ## @.str.5
	.asciz	"%s/%.*s"

	.comm	_dt_overlays_dir,4,2            ## @dt_overlays_dir
L_.str.6:                               ## @.str.6
	.asciz	"Failed to remove directory '%s'"

L_.str.7:                               ## @.str.7
	.asciz	"%d_%.*s"

L_.str.8:                               ## @.str.8
	.asciz	"%s.dtbo"

L_.str.9:                               ## @.str.9
	.asciz	"dtparam"

L_.str.10:                              ## @.str.10
	.asciz	"Failed to re-apply dtparam"

L_.str.11:                              ## @.str.11
	.asciz	" "

L_.str.12:                              ## @.str.12
	.asciz	"out of memory re-applying dtparam"

	.no_dead_strip	_dtoverlay_remove
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dtoverlay_remove
_dtoverlay_remove:                      ; @dtoverlay_remove
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	str	w2, [sp, #36]                   ; 4-byte Folded Spill
	mov	x21, x1
	mov	x20, x0
	ldr	w24, [x0]
	sxtw	x26, w24
Lloh0:
	adrp	x19, _work_dir@GOTPAGE
Lloh1:
	ldr	x19, [x19, _work_dir@GOTPAGEOFF]
	ldr	w0, [x19]
	bl	_chdir
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w1, [x19]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_fatal_error
LBB0_2:
	cbz	x21, LBB0_13
; %bb.3:
	mov	x0, x21
	bl	_strlen
	mov	x22, x0
	add	x1, sp, #40
	mov	x0, x21
	mov	w2, #10
	bl	_strtoul
	ldr	x8, [sp, #40]
	cbz	x8, LBB0_5
; %bb.4:
	ldrb	w8, [x8]
	cbz	w8, LBB0_48
LBB0_5:
	cmp	w26, #1
	b.lt	LBB0_50
; %bb.6:
	sxtw	x19, w22
	mov	x25, x24
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	add	x8, x27, #1
	mov	x25, x27
	cmp	x8, #1
	b.ls	LBB0_50
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	sub	x27, x25, #1
	ldr	x8, [x20, #8]
	ldr	x8, [x8, w27, uxtw #3]
	ldr	x0, [x8]
	mov	w1, #95
	bl	_strchr
	cbz	x0, LBB0_46
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	add	x23, x0, #1
	mov	x0, x23
	mov	w1, #46
	bl	_strchr
	cbz	x0, LBB0_46
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	sub	x8, x0, x23
	cmp	x8, x19
	b.ne	LBB0_7
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x21
	mov	x1, x23
	mov	x2, x22
	bl	_memcmp
	cbnz	x0, LBB0_7
; %bb.12:
	sub	w25, w25, #1
	b	LBB0_15
LBB0_13:
	cbz	w26, LBB0_51
; %bb.14:
	sub	w8, w26, #1
	ldr	w9, [sp, #36]                   ; 4-byte Folded Reload
	cmp	w9, #0
	csel	w25, w8, wzr, eq
LBB0_15:
	cmp	w25, w24
	b.ge	LBB0_47
; %bb.16:
	sxtw	x19, w25
Lloh4:
	adrp	x23, _dt_overlays_dir@GOTPAGE
Lloh5:
	ldr	x23, [x23, _dt_overlays_dir@GOTPAGEOFF]
Lloh6:
	adrp	x21, l_.str.5@PAGE
Lloh7:
	add	x21, x21, l_.str.5@PAGEOFF
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #8]
	add	x8, x8, x26, lsl #3
	ldur	x8, [x8, #-8]
	ldr	x22, [x8]
	mov	x0, x22
	mov	w1, #46
	bl	_strrchr
	cbz	x0, LBB0_46
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=1
	sub	x8, x0, x22
	ldr	w9, [x23]
	stp	x8, x22, [sp, #8]
	str	x9, [sp]
	mov	x0, x21
	bl	_sprintf_dup
	mov	x22, x0
	bl	_rmdir
	cbnz	x0, LBB0_54
; %bb.19:                               ;   in Loop: Header=BB0_17 Depth=1
	sub	x26, x26, #1
	mov	x0, x22
	bl	_free_string
	cmp	x26, x19
	b.gt	LBB0_17
; %bb.20:
Lloh8:
	adrp	x22, l_.str.7@PAGE
Lloh9:
	add	x22, x22, l_.str.7@PAGEOFF
	str	w25, [x20]
	mov	x26, x19
	b	LBB0_23
LBB0_21:                                ;   in Loop: Header=BB0_23 Depth=1
	mov	x0, x28
	bl	_unlink
LBB0_22:                                ;   in Loop: Header=BB0_23 Depth=1
	add	x26, x26, #1
	cmp	w24, w26
	b.eq	LBB0_47
LBB0_23:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_35 Depth 2
                                        ;     Child Loop BB0_41 Depth 2
	ldr	x8, [x20, #8]
	ldr	x8, [x8, x26, lsl #3]
	ldr	x28, [x8]
	mov	x0, x28
	mov	w1, #95
	bl	_strchr
	cbz	x0, LBB0_46
; %bb.24:                               ;   in Loop: Header=BB0_23 Depth=1
	add	x23, x0, #1
	mov	x0, x23
	mov	w1, #46
	bl	_strchr
	cbz	x0, LBB0_46
; %bb.25:                               ;   in Loop: Header=BB0_23 Depth=1
	ldr	w8, [sp, #36]                   ; 4-byte Folded Reload
	cbnz	w8, LBB0_21
; %bb.26:                               ;   in Loop: Header=BB0_23 Depth=1
	cmp	x26, x19
	b.eq	LBB0_21
; %bb.27:                               ;   in Loop: Header=BB0_23 Depth=1
	sub	x21, x0, x23
	ldr	w8, [x20]
	stp	x21, x23, [sp, #8]
	str	x8, [sp]
	mov	x0, x22
	bl	_sprintf_dup
	mov	x25, x0
	str	x0, [sp]
Lloh10:
	adrp	x0, l_.str.8@PAGE
Lloh11:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	_sprintf_dup
	mov	x27, x0
	cmp	w21, #7
	b.ne	LBB0_29
; %bb.28:                               ;   in Loop: Header=BB0_23 Depth=1
	mov	x0, x23
Lloh12:
	adrp	x1, l_.str.9@PAGE
Lloh13:
	add	x1, x1, l_.str.9@PAGEOFF
	mov	w2, #7
	bl	_memcmp
	cbz	x0, LBB0_31
LBB0_29:                                ;   in Loop: Header=BB0_23 Depth=1
	mov	x0, x28
	mov	x1, x27
	bl	_rename
	mov	x0, x27
	mov	x1, x25
	bl	_apply_overlay
	cmp	w0, #0
	cset	w25, eq
	cbz	w25, LBB0_43
LBB0_30:                                ;   in Loop: Header=BB0_23 Depth=1
Lloh14:
	adrp	x0, l_.str.10@PAGE
Lloh15:
	add	x0, x0, l_.str.10@PAGEOFF
	bl	_error
	b	LBB0_22
LBB0_31:                                ;   in Loop: Header=BB0_23 Depth=1
	mov	x0, x28
	mov	w1, #0
	bl	_dtoverlay_load_dtb
	mov	x27, x0
	mov	x0, x28
	bl	_unlink
Lloh16:
	adrp	x21, l_.str.11@PAGE
Lloh17:
	add	x21, x21, l_.str.11@PAGEOFF
	cbz	x27, LBB0_30
; %bb.32:                               ;   in Loop: Header=BB0_23 Depth=1
	mov	x0, x27
	bl	_dtoverlay_dtb_trailer
	cbz	x0, LBB0_36
; %bb.33:                               ;   in Loop: Header=BB0_23 Depth=1
	mov	x25, x0
	ldrb	w8, [x0]
	cbz	w8, LBB0_37
; %bb.34:                               ;   in Loop: Header=BB0_23 Depth=1
	mov	w28, #0
	mov	x23, x25
LBB0_35:                                ;   Parent Loop BB0_23 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	strb	wzr, [x23], #1
	mov	x0, x23
	mov	x1, x21
	bl	_strcspn
	add	w28, w28, #1
	add	x23, x23, w0, sxtw
	ldrb	w8, [x23]
	cbnz	w8, LBB0_35
	b	LBB0_38
LBB0_36:                                ;   in Loop: Header=BB0_23 Depth=1
Lloh18:
	adrp	x0, l_.str.10@PAGE
Lloh19:
	add	x0, x0, l_.str.10@PAGEOFF
	b	LBB0_45
LBB0_37:                                ;   in Loop: Header=BB0_23 Depth=1
	mov	w28, #0
LBB0_38:                                ;   in Loop: Header=BB0_23 Depth=1
	lsl	w8, w28, #3
	add	w0, w8, #8
	bl	_malloc
	cbz	x0, LBB0_44
; %bb.39:                               ;   in Loop: Header=BB0_23 Depth=1
	mov	x21, x0
	cbz	w28, LBB0_42
; %bb.40:                               ;   in Loop: Header=BB0_23 Depth=1
	add	x25, x25, #1
	mov	w22, w28
	mov	x23, x21
LBB0_41:                                ;   Parent Loop BB0_23 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	str	x25, [x23], #8
	mov	x0, x25
	bl	_strlen
	add	w8, w0, #1
	add	x25, x25, w8, sxtw
	subs	x22, x22, #1
	b.ne	LBB0_41
LBB0_42:                                ;   in Loop: Header=BB0_23 Depth=1
	str	xzr, [x21, w28, uxtw #3]
	mov	x0, x20
Lloh20:
	adrp	x1, l_.str.9@PAGE
Lloh21:
	add	x1, x1, l_.str.9@PAGEOFF
	mov	x2, x28
	mov	x3, x21
	bl	_dtoverlay_add
	mov	x25, x0
	mov	x0, x21
	bl	_free
	mov	x0, x27
	bl	_dtoverlay_free_dtb
Lloh22:
	adrp	x22, l_.str.7@PAGE
Lloh23:
	add	x22, x22, l_.str.7@PAGEOFF
	cbnz	w25, LBB0_30
LBB0_43:                                ;   in Loop: Header=BB0_23 Depth=1
	ldr	w8, [x20]
	add	w8, w8, #1
	str	w8, [x20]
	b	LBB0_22
LBB0_44:                                ;   in Loop: Header=BB0_23 Depth=1
Lloh24:
	adrp	x0, l_.str.12@PAGE
Lloh25:
	add	x0, x0, l_.str.12@PAGEOFF
LBB0_45:                                ;   in Loop: Header=BB0_23 Depth=1
	bl	_error
	mov	x0, x27
	bl	_dtoverlay_free_dtb
	b	LBB0_22
LBB0_46:
Lloh26:
	adrp	x0, l_.str.2@PAGE
Lloh27:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_52
LBB0_47:
	mov	w0, #0
	b	LBB0_56
LBB0_48:
	mov	x25, x0
	cmp	w0, w24
	b.ge	LBB0_53
; %bb.49:
	tbz	w25, #31, LBB0_15
LBB0_50:
	str	x21, [sp]
Lloh28:
	adrp	x0, l_.str.3@PAGE
Lloh29:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_55
LBB0_51:
Lloh30:
	adrp	x0, l_.str.4@PAGE
Lloh31:
	add	x0, x0, l_.str.4@PAGEOFF
LBB0_52:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	b	_error
LBB0_53:
                                        ; kill: def $w25 killed $w25 killed $x25 def $x25
	str	x25, [sp]
Lloh32:
	adrp	x0, l_.str.1@PAGE
Lloh33:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_55
LBB0_54:
	str	x22, [sp]
Lloh34:
	adrp	x0, l_.str.6@PAGE
Lloh35:
	add	x0, x0, l_.str.6@PAGEOFF
LBB0_55:
	bl	_error
LBB0_56:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_work_dir,4,2                   ; @work_dir
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to chdir to '%s'"

l_.str.1:                               ; @.str.1
	.asciz	"Overlay index (%d) too large"

l_.str.2:                               ; @.str.2
	.asciz	"Internal error"

l_.str.3:                               ; @.str.3
	.asciz	"Overlay '%s' is not loaded"

l_.str.4:                               ; @.str.4
	.asciz	"No overlays loaded"

l_.str.5:                               ; @.str.5
	.asciz	"%s/%.*s"

	.comm	_dt_overlays_dir,4,2            ; @dt_overlays_dir
l_.str.6:                               ; @.str.6
	.asciz	"Failed to remove directory '%s'"

l_.str.7:                               ; @.str.7
	.asciz	"%d_%.*s"

l_.str.8:                               ; @.str.8
	.asciz	"%s.dtbo"

l_.str.9:                               ; @.str.9
	.asciz	"dtparam"

l_.str.10:                              ; @.str.10
	.asciz	"Failed to re-apply dtparam"

l_.str.11:                              ; @.str.11
	.asciz	" "

l_.str.12:                              ; @.str.12
	.asciz	"out of memory re-applying dtparam"

	.no_dead_strip	_dtoverlay_remove
.subsections_via_symbols
