	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_utilfdt_read_err_len           ## -- Begin function utilfdt_read_err_len
	.p2align	4, 0x90
_utilfdt_read_err_len:                  ## @utilfdt_read_err_len
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %r13
	movq	%rdi, %r14
	movq	$0, (%rsi)
	leaq	L_.str(%rip), %rsi
	callq	_strcmp
	xorl	%ebx, %ebx
	movl	$0, %r12d
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_open
	movl	%eax, %r12d
	testl	%eax, %eax
	js	LBB0_2
LBB0_3:
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movl	$1024, %r15d                    ## imm = 0x400
	movl	$1024, %edi                     ## imm = 0x400
	callq	_xmalloc
	movq	%rax, %r13
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	%r15d, %ebx
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	addl	%r15d, %r15d
	movq	%r13, %rdi
	movl	%r15d, %esi
	callq	_xrealloc
	movq	%rax, %r13
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movslq	%ebx, %rsi
	addq	%r13, %rsi
	movl	%r15d, %edx
	subl	%ebx, %edx
	movl	%r12d, %edi
	callq	_read
	testl	%eax, %eax
	js	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	addl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_4
## %bb.8:
	movl	%r12d, %edi
	callq	_close
	jmp	LBB0_9
LBB0_10:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	%r12d, %edi
	callq	_close
	testl	%r14d, %r14d
	je	LBB0_9
## %bb.11:
	movq	%r13, %rdi
	callq	_free
	jmp	LBB0_12
LBB0_9:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%r13, (%rax)
	xorl	%r14d, %r14d
LBB0_12:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	%r15d, (%rax)
	jmp	LBB0_13
LBB0_2:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
LBB0_13:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"-"

	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_errno,4,2                      ## @errno
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_utilfdt_read_err_len           ; -- Begin function utilfdt_read_err_len
	.p2align	2
_utilfdt_read_err_len:                  ; @utilfdt_read_err_len
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	str	xzr, [x1]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_strcmp
	cbz	x0, LBB0_3
; %bb.1:
Lloh2:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_open
	mov	x22, x0
	tbz	w0, #31, LBB0_4
; %bb.2:
Lloh5:
	adrp	x8, _errno@GOTPAGE
Lloh6:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh7:
	ldr	w24, [x8]
	b	LBB0_14
LBB0_3:
	mov	w22, #0
LBB0_4:
	mov	w21, #1024
	mov	w0, #1024
	bl	_xmalloc
	mov	x23, x0
	mov	w24, #0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w24, w21
	b.ne	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	lsl	w21, w21, #1
	mov	x0, x23
	mov	x1, x21
	bl	_xrealloc
	mov	x23, x0
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x1, x23, w24, sxtw
	sub	w2, w21, w24
	mov	x0, x22
	bl	_read
	tbnz	w0, #31, LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	add	w24, w0, w24
	cbnz	w0, LBB0_5
; %bb.9:
	mov	x0, x22
	bl	_close
	b	LBB0_12
LBB0_10:
Lloh8:
	adrp	x8, _errno@GOTPAGE
Lloh9:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh10:
	ldr	w24, [x8]
	mov	x0, x22
	bl	_close
	cbz	w24, LBB0_12
; %bb.11:
	mov	x0, x23
	bl	_free
	b	LBB0_13
LBB0_12:
	mov	w24, #0
	str	x23, [x20]
LBB0_13:
	str	w21, [x19]
LBB0_14:
	mov	x0, x24
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"-"

	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_errno,4,2                      ; @errno
.subsections_via_symbols
