	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_real_tty_cleanup               ## -- Begin function real_tty_cleanup
	.p2align	4, 0x90
_real_tty_cleanup:                      ## @real_tty_cleanup
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	(%rdi), %rax
	movq	_REAL_TTY_NUM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.1:
	movq	%rdi, %rbx
	movq	_STDIN_FILENO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_TCSANOW@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_old_termios@GOTPCREL(%rip), %rdx
	callq	_tcsetattr
	testq	%rax, %rax
	jns	LBB0_4
## %bb.2:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_ENOTTY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rdi
	callq	_ERRNO_DIE
LBB0_4:
	movl	8(%rbx), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_pthread_cancel                 ## TAILCALL
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_REAL_TTY_NUM,8,3               ## @REAL_TTY_NUM
	.comm	_STDIN_FILENO,4,2               ## @STDIN_FILENO
	.comm	_TCSANOW,4,2                    ## @TCSANOW
	.comm	_old_termios,4,2                ## @old_termios
	.comm	_errno,8,3                      ## @errno
	.comm	_ENOTTY,8,3                     ## @ENOTTY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to reset terminal"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_real_tty_cleanup               ; -- Begin function real_tty_cleanup
	.p2align	2
_real_tty_cleanup:                      ; @real_tty_cleanup
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _REAL_TTY_NUM@GOTPAGE
Lloh1:
	ldr	x9, [x9, _REAL_TTY_NUM@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.1:
	mov	x19, x0
Lloh3:
	adrp	x8, _STDIN_FILENO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _STDIN_FILENO@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
Lloh6:
	adrp	x8, _TCSANOW@GOTPAGE
Lloh7:
	ldr	x8, [x8, _TCSANOW@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x2, _old_termios@GOTPAGE
Lloh10:
	ldr	x2, [x2, _old_termios@GOTPAGEOFF]
	bl	_tcsetattr
	tbz	x0, #63, LBB0_4
; %bb.2:
Lloh11:
	adrp	x8, _errno@GOTPAGE
Lloh12:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
Lloh14:
	adrp	x9, _ENOTTY@GOTPAGE
Lloh15:
	ldr	x9, [x9, _ENOTTY@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_4
; %bb.3:
Lloh17:
	adrp	x0, l_.str@PAGE
Lloh18:
	add	x0, x0, l_.str@PAGEOFF
	bl	_ERRNO_DIE
LBB0_4:
	ldr	w0, [x19, #8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_pthread_cancel
LBB0_5:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_REAL_TTY_NUM,8,3               ; @REAL_TTY_NUM
	.comm	_STDIN_FILENO,4,2               ; @STDIN_FILENO
	.comm	_TCSANOW,4,2                    ; @TCSANOW
	.comm	_old_termios,4,2                ; @old_termios
	.comm	_errno,8,3                      ; @errno
	.comm	_ENOTTY,8,3                     ; @ENOTTY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to reset terminal"

.subsections_via_symbols
