	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function uart_tty_backend
_uart_tty_backend:                      ## @uart_tty_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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rax
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, -32(%rbp)
	movq	_TIOCGETA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -44(%rbp)
	movq	_TIOCSETA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -40(%rbp)
	movq	_TIOCGWINSZ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -36(%rbp)
	movq	_O_RDWR@GOTPCREL(%rip), %rcx
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	orl	(%rcx), %esi
	movq	%rax, %rdi
	callq	_open
	movl	$-1, %r14d
	testl	%eax, %eax
	js	LBB0_7
## %bb.1:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_isatty
	testl	%eax, %eax
	je	LBB0_2
## %bb.3:
	movl	%ebx, 4(%r15)
	movl	%ebx, (%r15)
	movl	$1, 8(%r15)
	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
	movq	_CAP_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	leaq	-48(%rbp), %r14
	movq	%r14, %rdi
	callq	_cap_rights_init
	movl	%ebx, %edi
	movq	%r14, %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:
	leaq	-44(%rbp), %r14
	movq	%r14, %rdi
	callq	_nitems
	movl	%ebx, %edi
	movq	%r14, %rsi
	movl	%eax, %edx
	callq	_caph_ioctls_limit
	xorl	%r14d, %r14d
	cmpl	$-1, %eax
	jne	LBB0_7
## %bb.6:
	movq	_EX_OSERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_errx
	jmp	LBB0_7
LBB0_2:
	movl	%ebx, %edi
	callq	_close
LBB0_7:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_9
## %bb.8:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_TIOCGETA,4,2                   ## @TIOCGETA
	.comm	_TIOCSETA,4,2                   ## @TIOCSETA
	.comm	_TIOCGWINSZ,4,2                 ## @TIOCGWINSZ
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.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	_CAP_WRITE,4,2                  ## @CAP_WRITE
	.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_tty_backend
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function uart_tty_backend
_uart_tty_backend:                      ; @uart_tty_backend
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
	mov	x8, x1
	mov	x20, x0
Lloh0:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
Lloh3:
	adrp	x10, _TIOCGETA@GOTPAGE
Lloh4:
	ldr	x10, [x10, _TIOCGETA@GOTPAGEOFF]
	str	x9, [sp, #24]
Lloh5:
	ldr	w9, [x10]
Lloh6:
	adrp	x10, _TIOCSETA@GOTPAGE
Lloh7:
	ldr	x10, [x10, _TIOCSETA@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	stp	w9, w10, [sp, #12]
Lloh9:
	adrp	x9, _TIOCGWINSZ@GOTPAGE
Lloh10:
	ldr	x9, [x9, _TIOCGWINSZ@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
Lloh12:
	adrp	x10, _O_RDWR@GOTPAGE
Lloh13:
	ldr	x10, [x10, _O_RDWR@GOTPAGEOFF]
	str	w9, [sp, #20]
Lloh14:
	ldr	w9, [x10]
Lloh15:
	adrp	x10, _O_NONBLOCK@GOTPAGE
Lloh16:
	ldr	x10, [x10, _O_NONBLOCK@GOTPAGEOFF]
Lloh17:
	ldr	w10, [x10]
	orr	w1, w10, w9
	mov	x0, x8
	bl	_open
	tbnz	w0, #31, LBB0_8
; %bb.1:
	mov	x19, x0
	bl	_isatty
	cbz	w0, LBB0_7
; %bb.2:
	stp	w19, w19, [x20]
	mov	w8, #1
	str	w8, [x20, #8]
Lloh18:
	adrp	x8, _CAP_EVENT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _CAP_EVENT@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
Lloh21:
	adrp	x8, _CAP_IOCTL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _CAP_IOCTL@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
Lloh24:
	adrp	x8, _CAP_READ@GOTPAGE
Lloh25:
	ldr	x8, [x8, _CAP_READ@GOTPAGEOFF]
Lloh26:
	ldr	w3, [x8]
Lloh27:
	adrp	x8, _CAP_WRITE@GOTPAGE
Lloh28:
	ldr	x8, [x8, _CAP_WRITE@GOTPAGEOFF]
Lloh29:
	ldr	w4, [x8]
	add	x0, sp, #8
	bl	_cap_rights_init
	add	x1, sp, #8
	mov	x0, x19
	bl	_caph_rights_limit
	cmn	w0, #1
	b.ne	LBB0_4
; %bb.3:
Lloh30:
	adrp	x8, _EX_OSERR@GOTPAGE
Lloh31:
	ldr	x8, [x8, _EX_OSERR@GOTPAGEOFF]
Lloh32:
	ldr	w0, [x8]
Lloh33:
	adrp	x1, l_.str@PAGE
Lloh34:
	add	x1, x1, l_.str@PAGEOFF
	bl	_errx
LBB0_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_6
; %bb.5:
Lloh35:
	adrp	x8, _EX_OSERR@GOTPAGE
Lloh36:
	ldr	x8, [x8, _EX_OSERR@GOTPAGEOFF]
Lloh37:
	ldr	w0, [x8]
Lloh38:
	adrp	x1, l_.str@PAGE
Lloh39:
	add	x1, x1, l_.str@PAGEOFF
	bl	_errx
LBB0_6:
	mov	w0, #0
	b	LBB0_9
LBB0_7:
	mov	x0, x19
	bl	_close
LBB0_8:
	mov	w0, #-1
LBB0_9:
	ldr	x8, [sp, #24]
Lloh40:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh41:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh42:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.10:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_11:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.comm	_TIOCGETA,4,2                   ; @TIOCGETA
	.comm	_TIOCSETA,4,2                   ; @TIOCSETA
	.comm	_TIOCGWINSZ,4,2                 ; @TIOCGWINSZ
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.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	_CAP_WRITE,4,2                  ; @CAP_WRITE
	.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_tty_backend
.subsections_via_symbols
