	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function uart_stdio_backend
_uart_stdio_backend:                    ## @uart_stdio_backend
	.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	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_TIOCGETA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -60(%rbp)
	movq	_TIOCSETA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)
	movq	_TIOCGWINSZ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)
	movq	_uart_stdio@GOTPCREL(%rip), %r15
	movl	$-1, %ebx
	cmpl	$0, (%r15)
	jne	LBB0_8
## %bb.1:
	movq	%rdi, %r14
	movq	_STDIN_FILENO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%edi, 4(%r14)
	movq	_STDOUT_FILENO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r14)
	movl	$1, (%r14)
	movq	_F_SETFL@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_O_NONBLOCK@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	callq	_fcntl
	testq	%rax, %rax
	jne	LBB0_8
## %bb.2:
	movl	8(%r14), %edi
	movl	(%r12), %esi
	movl	(%r13), %edx
	callq	_fcntl
	testq	%rax, %rax
	jne	LBB0_8
## %bb.3:
	movq	_CAP_EVENT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CAP_IOCTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_CAP_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-64(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_cap_rights_init
	movl	4(%r14), %edi
	movq	%rbx, %rsi
	callq	_caph_rights_limit
	cmpl	$-1, %eax
	jne	LBB0_5
## %bb.4:
	movq	_EX_OSERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_errx
LBB0_5:
	movl	4(%r14), %ebx
	leaq	-60(%rbp), %r14
	movq	%r14, %rdi
	callq	_nitems
	movl	%ebx, %edi
	movq	%r14, %rsi
	movl	%eax, %edx
	callq	_caph_ioctls_limit
	cmpl	$-1, %eax
	jne	LBB0_7
## %bb.6:
	movq	_EX_OSERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_errx
LBB0_7:
	movl	$1, (%r15)
	xorl	%ebx, %ebx
LBB0_8:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_10
## %bb.9:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_TIOCGETA,4,2                   ## @TIOCGETA
	.comm	_TIOCSETA,4,2                   ## @TIOCSETA
	.comm	_TIOCGWINSZ,4,2                 ## @TIOCGWINSZ
	.comm	_uart_stdio,4,2                 ## @uart_stdio
	.comm	_STDIN_FILENO,4,2               ## @STDIN_FILENO
	.comm	_STDOUT_FILENO,4,2              ## @STDOUT_FILENO
	.comm	_F_SETFL,4,2                    ## @F_SETFL
	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
	.comm	_CAP_EVENT,4,2                  ## @CAP_EVENT
	.comm	_CAP_IOCTL,4,2                  ## @CAP_IOCTL
	.comm	_CAP_READ,4,2                   ## @CAP_READ
	.comm	_EX_OSERR,4,2                   ## @EX_OSERR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to apply rights for sandbox"

	.no_dead_strip	_uart_stdio_backend
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function uart_stdio_backend
_uart_stdio_backend:                    ; @uart_stdio_backend
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
Lloh3:
	adrp	x8, _TIOCGETA@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TIOCGETA@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _TIOCSETA@GOTPAGE
Lloh7:
	ldr	x9, [x9, _TIOCSETA@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
Lloh9:
	adrp	x10, _TIOCGWINSZ@GOTPAGE
Lloh10:
	ldr	x10, [x10, _TIOCGWINSZ@GOTPAGEOFF]
	stp	w8, w9, [sp, #12]
Lloh11:
	ldr	w8, [x10]
	str	w8, [sp, #20]
Lloh12:
	adrp	x20, _uart_stdio@GOTPAGE
Lloh13:
	ldr	x20, [x20, _uart_stdio@GOTPAGEOFF]
	ldr	w8, [x20]
	cbnz	w8, LBB0_3
; %bb.1:
	mov	x19, x0
Lloh14:
	adrp	x8, _STDIN_FILENO@GOTPAGE
Lloh15:
	ldr	x8, [x8, _STDIN_FILENO@GOTPAGEOFF]
Lloh16:
	adrp	x9, _STDOUT_FILENO@GOTPAGE
Lloh17:
	ldr	x9, [x9, _STDOUT_FILENO@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
Lloh19:
	ldr	w8, [x9]
	stp	w0, w8, [x19, #4]
	mov	w8, #1
	str	w8, [x19]
Lloh20:
	adrp	x21, _F_SETFL@GOTPAGE
Lloh21:
	ldr	x21, [x21, _F_SETFL@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh22:
	adrp	x22, _O_NONBLOCK@GOTPAGE
Lloh23:
	ldr	x22, [x22, _O_NONBLOCK@GOTPAGEOFF]
	ldr	w2, [x22]
	bl	_fcntl
	cbnz	x0, LBB0_3
; %bb.2:
	ldr	w0, [x19, #8]
	ldr	w1, [x21]
	ldr	w2, [x22]
	bl	_fcntl
	cbz	x0, LBB0_6
LBB0_3:
	mov	w0, #-1
LBB0_4:
	ldr	x8, [sp, #24]
Lloh24:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh25:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.5:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_6:
Lloh27:
	adrp	x8, _CAP_EVENT@GOTPAGE
Lloh28:
	ldr	x8, [x8, _CAP_EVENT@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
Lloh30:
	adrp	x8, _CAP_IOCTL@GOTPAGE
Lloh31:
	ldr	x8, [x8, _CAP_IOCTL@GOTPAGEOFF]
Lloh32:
	ldr	w2, [x8]
Lloh33:
	adrp	x8, _CAP_READ@GOTPAGE
Lloh34:
	ldr	x8, [x8, _CAP_READ@GOTPAGEOFF]
Lloh35:
	ldr	w3, [x8]
	add	x0, sp, #8
	bl	_cap_rights_init
	ldr	w0, [x19, #4]
	add	x1, sp, #8
	bl	_caph_rights_limit
	cmn	w0, #1
	b.ne	LBB0_8
; %bb.7:
Lloh36:
	adrp	x8, _EX_OSERR@GOTPAGE
Lloh37:
	ldr	x8, [x8, _EX_OSERR@GOTPAGEOFF]
Lloh38:
	ldr	w0, [x8]
Lloh39:
	adrp	x1, l_.str@PAGE
Lloh40:
	add	x1, x1, l_.str@PAGEOFF
	bl	_errx
LBB0_8:
	ldr	w19, [x19, #4]
	add	x0, sp, #12
	bl	_nitems
	mov	x2, x0
	add	x1, sp, #12
	mov	x0, x19
	bl	_caph_ioctls_limit
	cmn	w0, #1
	b.ne	LBB0_10
; %bb.9:
Lloh41:
	adrp	x8, _EX_OSERR@GOTPAGE
Lloh42:
	ldr	x8, [x8, _EX_OSERR@GOTPAGEOFF]
Lloh43:
	ldr	w0, [x8]
Lloh44:
	adrp	x1, l_.str@PAGE
Lloh45:
	add	x1, x1, l_.str@PAGEOFF
	bl	_errx
LBB0_10:
	mov	w0, #0
	mov	w8, #1
	str	w8, [x20]
	b	LBB0_4
LBB0_11:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh18
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_TIOCGETA,4,2                   ; @TIOCGETA
	.comm	_TIOCSETA,4,2                   ; @TIOCSETA
	.comm	_TIOCGWINSZ,4,2                 ; @TIOCGWINSZ
	.comm	_uart_stdio,4,2                 ; @uart_stdio
	.comm	_STDIN_FILENO,4,2               ; @STDIN_FILENO
	.comm	_STDOUT_FILENO,4,2              ; @STDOUT_FILENO
	.comm	_F_SETFL,4,2                    ; @F_SETFL
	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
	.comm	_CAP_EVENT,4,2                  ; @CAP_EVENT
	.comm	_CAP_IOCTL,4,2                  ; @CAP_IOCTL
	.comm	_CAP_READ,4,2                   ; @CAP_READ
	.comm	_EX_OSERR,4,2                   ; @EX_OSERR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to apply rights for sandbox"

	.no_dead_strip	_uart_stdio_backend
.subsections_via_symbols
