	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fdt_fixup_stdout               ## -- Begin function fdt_fixup_stdout
	.p2align	4, 0x90
_fdt_fixup_stdout:                      ## @fdt_fixup_stdout
	.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	%r12
	pushq	%rbx
	subq	$112, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	callq	_strlen
	movslq	%eax, %rcx
	leaq	(%rbx,%rcx), %r15
	decq	%r15
	decq	%rcx
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rcx, %r14
	cmpq	%rbx, %r15
	jbe	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movsbl	-1(%rbx), %edi
	decq	%rbx
	callq	_isdigit
	leaq	1(%r14), %rcx
	testq	%rax, %rax
	jne	LBB0_1
LBB0_3:
	testq	%r14, %r14
	je	LBB0_10
## %bb.4:
	movq	_fdtp@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	leaq	L_.str(%rip), %rsi
	callq	_fdt_path_offset
	testl	%eax, %eax
	js	LBB0_10
## %bb.5:
	movl	%eax, %r14d
	movl	(%r12), %edi
	leaq	L_.str.1(%rip), %rdx
	leaq	-132(%rbp), %rcx
	movl	%eax, %esi
	callq	_fdt_get_property
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	cmpl	$0, -132(%rbp)
	jne	LBB0_10
LBB0_7:
	leaq	-128(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$10, %esi
	callq	_bzero
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strcpy
	movq	%r15, %rdi
	callq	_strlen
	cmpl	$3, %eax
	jg	LBB0_10
## %bb.8:
	leaq	-122(%rbp), %rdi
	movq	%r15, %rsi
	movl	$3, %edx
	callq	_strncpy
	movl	(%r12), %edi
	leaq	-128(%rbp), %rsi
	callq	_fdt_path_offset
	testl	%eax, %eax
	js	LBB0_10
## %bb.9:
	movl	(%r12), %ebx
	leaq	-128(%rbp), %r15
	movq	%r15, %rdi
	callq	_strlen
                                        ## kill: def $eax killed $eax def $rax
	leal	1(%rax), %r8d
	leaq	L_.str.1(%rip), %rdx
	movl	%ebx, %edi
	movl	%r14d, %esi
	movq	%r15, %rcx
	callq	_fdt_setprop
	movl	(%r12), %ebx
	movq	%r15, %rdi
	callq	_strlen
                                        ## kill: def $eax killed $eax def $rax
	leal	1(%rax), %r8d
	leaq	L_.str.3(%rip), %rdx
	movl	%ebx, %edi
	movl	%r14d, %esi
	movq	%r15, %rcx
	callq	_fdt_setprop
LBB0_10:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_12
## %bb.11:
	addq	$112, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_fdtp,4,2                       ## @fdtp
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"/chosen"

L_.str.1:                               ## @.str.1
	.asciz	"stdout"

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

L_.str.3:                               ## @.str.3
	.asciz	"stdin"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fdt_fixup_stdout               ; -- Begin function fdt_fixup_stdout
	.p2align	2
_fdt_fixup_stdout:                      ; @fdt_fixup_stdout
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	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
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	bl	_strlen
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
	add	x9, x19, x8
	sub	x20, x9, #1
	sub	x8, x8, #1
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	x21, x8
	cmp	x20, x19
	b.ls	LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldrsb	w0, [x19, #-1]!
	bl	_isdigit
	add	x8, x21, #1
	cbnz	x0, LBB0_1
LBB0_3:
	cbz	x21, LBB0_9
; %bb.4:
Lloh3:
	adrp	x21, _fdtp@GOTPAGE
Lloh4:
	ldr	x21, [x21, _fdtp@GOTPAGEOFF]
	ldr	w0, [x21]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fdt_path_offset
	tbnz	w0, #31, LBB0_9
; %bb.5:
	mov	x19, x0
	ldr	w0, [x21]
Lloh7:
	adrp	x2, l_.str.1@PAGE
Lloh8:
	add	x2, x2, l_.str.1@PAGEOFF
	add	x3, sp, #4
	mov	x1, x19
	bl	_fdt_get_property
	ldr	w8, [sp, #4]
	cmp	x0, #0
	ccmp	w8, #0, #4, ne
	b.ne	LBB0_9
; %bb.6:
	add	x22, sp, #8
	add	x0, sp, #8
	mov	w1, #10
	bl	_bzero
Lloh9:
	adrp	x1, l_.str.2@PAGE
Lloh10:
	add	x1, x1, l_.str.2@PAGEOFF
	add	x0, sp, #8
	bl	_strcpy
	mov	x0, x20
	bl	_strlen
	cmp	w0, #3
	b.gt	LBB0_9
; %bb.7:
	orr	x0, x22, #0x6
	mov	x1, x20
	mov	w2, #3
	bl	_strncpy
	ldr	w0, [x21]
	add	x1, sp, #8
	bl	_fdt_path_offset
	tbnz	w0, #31, LBB0_9
; %bb.8:
	ldr	w20, [x21]
	add	x0, sp, #8
	bl	_strlen
	add	w4, w0, #1
Lloh11:
	adrp	x2, l_.str.1@PAGE
Lloh12:
	add	x2, x2, l_.str.1@PAGEOFF
	add	x3, sp, #8
	mov	x0, x20
	mov	x1, x19
	bl	_fdt_setprop
	ldr	w20, [x21]
	add	x0, sp, #8
	bl	_strlen
	add	w4, w0, #1
Lloh13:
	adrp	x2, l_.str.3@PAGE
Lloh14:
	add	x2, x2, l_.str.3@PAGEOFF
	add	x3, sp, #8
	mov	x0, x20
	mov	x1, x19
	bl	_fdt_setprop
LBB0_9:
	ldur	x8, [x29, #-40]
Lloh15:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh16:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.10:
	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
	add	sp, sp, #144
	ret
LBB0_11:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_fdtp,4,2                       ; @fdtp
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"/chosen"

l_.str.1:                               ; @.str.1
	.asciz	"stdout"

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

l_.str.3:                               ; @.str.3
	.asciz	"stdin"

.subsections_via_symbols
