	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_utilfdt_write_err              ## -- Begin function utilfdt_write_err
	.p2align	4, 0x90
_utilfdt_write_err:                     ## @utilfdt_write_err
	.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	%rsi, %r14
	movq	%rdi, %rbx
	leaq	L_.str(%rip), %rsi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_1
## %bb.4:
	movq	_O_WRONLY@GOTPCREL(%rip), %rax
	movq	_O_CREAT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	_O_TRUNC@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$438, %edx                      ## imm = 0x1B6
	callq	_open
	movl	%eax, %r15d
	testl	%eax, %eax
	jns	LBB0_2
## %bb.5:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	jmp	LBB0_13
LBB0_1:
	movl	$1, %r15d
LBB0_2:
	movq	%r14, %rdi
	callq	_fdt_totalsize
	testl	%eax, %eax
	jle	LBB0_3
## %bb.7:
	movl	%eax, %r12d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movslq	%ebx, %rax
	leaq	(%r14,%rax), %rsi
	movl	%r12d, %edx
	subl	%eax, %edx
	movl	%r15d, %edi
	callq	_write
	testl	%eax, %eax
	js	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_8 Depth=1
	movl	%eax, %r13d
	addl	%eax, %ebx
	cmpl	%ebx, %r12d
	jg	LBB0_8
	jmp	LBB0_10
LBB0_3:
	xorl	%r13d, %r13d
LBB0_10:
	cmpl	$1, %r15d
	je	LBB0_12
LBB0_11:
	movl	%r15d, %edi
	callq	_close
LBB0_12:
	movl	%r13d, %eax
	negl	%eax
	sarl	$31, %r13d
	andl	%eax, %r13d
LBB0_13:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	_errno@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	cmpl	$1, %r15d
	jne	LBB0_11
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"-"

	.comm	_O_WRONLY,4,2                   ## @O_WRONLY
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.comm	_O_TRUNC,4,2                    ## @O_TRUNC
	.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_write_err              ; -- Begin function utilfdt_write_err
	.p2align	2
_utilfdt_write_err:                     ; @utilfdt_write_err
	.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, x1
	mov	x20, x0
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_WRONLY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _O_WRONLY@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _O_CREAT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _O_CREAT@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh8:
	adrp	x9, _O_TRUNC@GOTPAGE
Lloh9:
	ldr	x9, [x9, _O_TRUNC@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w1, w8, w9
	mov	x0, x20
	mov	w2, #438
	bl	_open
	mov	x20, x0
	tbz	w0, #31, LBB0_4
; %bb.2:
Lloh11:
	adrp	x8, _errno@GOTPAGE
Lloh12:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	b	LBB0_12
LBB0_3:
	mov	w20, #1
LBB0_4:
	mov	x0, x19
	bl	_fdt_totalsize
	cmp	w0, #1
	b.lt	LBB0_8
; %bb.5:
	mov	x22, x0
	mov	w23, #0
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	add	x1, x19, w23, sxtw
	sub	w2, w22, w23
	mov	x0, x20
	bl	_write
	tbnz	w0, #31, LBB0_13
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x21, x0
	add	w23, w0, w23
	cmp	w22, w23
	b.gt	LBB0_6
	b	LBB0_9
LBB0_8:
	mov	w21, #0
LBB0_9:
	cmp	w20, #1
	b.eq	LBB0_11
LBB0_10:
	mov	x0, x20
	bl	_close
LBB0_11:
	neg	w8, w21
	and	w0, w8, w21, asr #31
LBB0_12:
	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
LBB0_13:
Lloh14:
	adrp	x8, _errno@GOTPAGE
Lloh15:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w21, w8
	cmp	w20, #1
	b.ne	LBB0_10
	b	LBB0_11
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"-"

	.comm	_O_WRONLY,4,2                   ; @O_WRONLY
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.comm	_O_TRUNC,4,2                    ; @O_TRUNC
	.comm	_errno,4,2                      ; @errno
.subsections_via_symbols
