	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_flush                          ## -- Begin function flush
	.p2align	4, 0x90
_flush:                                 ## @flush
	.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	_linp@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rcx
	movq	_linbuf@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	cmpq	%rax, %rcx
	je	LBB0_23
## %bb.1:
	movq	_exitset@GOTPCREL(%rip), %r15
	movl	(%r15), %r12d
	movq	_GettingInput@GOTPCREL(%rip), %rdx
	cmpq	$0, (%rdx)
	je	LBB0_4
## %bb.2:
	movq	_Tty_raw_mode@GOTPCREL(%rip), %rdx
	cmpl	$0, (%rdx)
	jne	LBB0_4
## %bb.3:
	leaq	-2(%rax), %rdx
	cmpq	%rdx, %rcx
	jb	LBB0_23
LBB0_4:
	movq	_handle_interrupt@GOTPCREL(%rip), %r13
	cmpq	$0, (%r13)
	je	LBB0_5
## %bb.7:
	movl	$1, (%r15)
	cmpb	$1, _flush.interrupted(%rip)
	jne	LBB0_9
## %bb.8:
	movb	$0, _flush.interrupted(%rip)
	movq	%rax, (%rbx)
	xorl	%eax, %eax
	callq	_fixerror
	jmp	LBB0_9
LBB0_5:
	cmpb	$0, _flush.interrupted(%rip)
	je	LBB0_9
## %bb.6:
	movb	$0, _flush.interrupted(%rip)
	movq	%rax, (%rbx)
	movq	_ERR_SILENT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_stderror
LBB0_9:
	movb	$1, _flush.interrupted(%rip)
	movq	_haderr@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	cmpq	$0, (%rcx)
	sete	%cl
	movq	_didfds@GOTPCREL(%rip), %rdx
	jne	LBB0_10
## %bb.11:
	movq	_SHOUT@GOTPCREL(%rip), %rsi
	cmpq	$0, (%rdx)
	je	LBB0_14
LBB0_13:
	movb	%cl, %al
	movl	$2, %edi
	subl	%eax, %edi
	jmp	LBB0_15
LBB0_10:
	movq	_SHDIAG@GOTPCREL(%rip), %rsi
	cmpq	$0, (%rdx)
	jne	LBB0_13
LBB0_14:
	movl	(%rsi), %edi
LBB0_15:
	movq	(%r14), %rsi
	movl	(%rbx), %edx
	subl	%esi, %edx
	callq	_xwrite
	cmpl	$-1, %eax
	jne	LBB0_22
## %bb.16:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	addl	$-128, %ecx
	movq	(%r13), %rax
	cmpl	$6, %ecx
	ja	LBB0_19
## %bb.17:
	testq	%rax, %rax
	jne	LBB0_19
## %bb.18:
	movl	$1, %edi
	callq	_xexit
	movq	(%r13), %rax
LBB0_19:
	testq	%rax, %rax
	je	LBB0_21
## %bb.20:
	xorl	%eax, %eax
	callq	_fixerror
	jmp	LBB0_22
LBB0_21:
	movq	_ERR_SILENT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_stderror
LBB0_22:
	movl	%r12d, (%r15)
	movq	(%r14), %rax
	movq	%rax, (%rbx)
	movb	$0, _flush.interrupted(%rip)
LBB0_23:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_exitset,4,2                    ## @exitset
.zerofill __DATA,__bss,_flush.interrupted,1,2 ## @flush.interrupted
	.comm	_linp,8,3                       ## @linp
	.comm	_linbuf,8,3                     ## @linbuf
	.comm	_GettingInput,8,3               ## @GettingInput
	.comm	_Tty_raw_mode,4,2               ## @Tty_raw_mode
	.comm	_handle_interrupt,8,3           ## @handle_interrupt
	.comm	_ERR_SILENT,4,2                 ## @ERR_SILENT
	.comm	_haderr,8,3                     ## @haderr
	.comm	_didfds,8,3                     ## @didfds
	.comm	_SHDIAG,4,2                     ## @SHDIAG
	.comm	_SHOUT,4,2                      ## @SHOUT
	.comm	_errno,4,2                      ## @errno
	.comm	_LFLUSHO,4,2                    ## @LFLUSHO
	.comm	_TIOCLBIC,4,2                   ## @TIOCLBIC
	.comm	_TIOCLGET,4,2                   ## @TIOCLGET
	.comm	_lmode,4,2                      ## @lmode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_flush                          ; -- Begin function flush
	.p2align	2
_flush:                                 ; @flush
	.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
Lloh0:
	adrp	x19, _linp@GOTPAGE
Lloh1:
	ldr	x19, [x19, _linp@GOTPAGEOFF]
	ldr	x9, [x19]
Lloh2:
	adrp	x20, _linbuf@GOTPAGE
Lloh3:
	ldr	x20, [x20, _linbuf@GOTPAGEOFF]
	ldr	x8, [x20]
	cmp	x9, x8
	b.eq	LBB0_15
; %bb.1:
Lloh4:
	adrp	x10, _GettingInput@GOTPAGE
Lloh5:
	ldr	x10, [x10, _GettingInput@GOTPAGEOFF]
Lloh6:
	adrp	x11, _Tty_raw_mode@GOTPAGE
Lloh7:
	ldr	x11, [x11, _Tty_raw_mode@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
Lloh9:
	ldr	w11, [x11]
	sub	x12, x8, #2
	cmp	x10, #0
	ccmp	w11, #0, #0, ne
	ccmp	x9, x12, #2, eq
	b.lo	LBB0_15
; %bb.2:
Lloh10:
	adrp	x21, _exitset@GOTPAGE
Lloh11:
	ldr	x21, [x21, _exitset@GOTPAGEOFF]
	ldr	w22, [x21]
Lloh12:
	adrp	x24, _handle_interrupt@GOTPAGE
Lloh13:
	ldr	x24, [x24, _handle_interrupt@GOTPAGEOFF]
	ldr	x9, [x24]
	adrp	x23, _flush.interrupted@PAGE
	cbz	x9, LBB0_5
; %bb.3:
	mov	w9, #1
	str	w9, [x21]
	ldrb	w9, [x23, _flush.interrupted@PAGEOFF]
	cmp	w9, #1
	b.ne	LBB0_7
; %bb.4:
	strb	wzr, [x23, _flush.interrupted@PAGEOFF]
	str	x8, [x19]
	bl	_fixerror
	b	LBB0_7
LBB0_5:
	ldrb	w9, [x23, _flush.interrupted@PAGEOFF]
	tbz	w9, #0, LBB0_7
; %bb.6:
	strb	wzr, [x23, _flush.interrupted@PAGEOFF]
	str	x8, [x19]
Lloh14:
	adrp	x8, _ERR_SILENT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ERR_SILENT@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	bl	_stderror
LBB0_7:
	mov	w8, #1
Lloh17:
	adrp	x9, _haderr@GOTPAGE
Lloh18:
	ldr	x9, [x9, _haderr@GOTPAGEOFF]
	strb	w8, [x23, _flush.interrupted@PAGEOFF]
Lloh19:
	ldr	x9, [x9]
Lloh20:
	adrp	x10, _didfds@GOTPAGE
Lloh21:
	ldr	x10, [x10, _didfds@GOTPAGEOFF]
Lloh22:
	adrp	x11, _SHOUT@GOTPAGE
Lloh23:
	ldr	x11, [x11, _SHOUT@GOTPAGEOFF]
Lloh24:
	ldr	x10, [x10]
Lloh25:
	adrp	x12, _SHDIAG@GOTPAGE
Lloh26:
	ldr	x12, [x12, _SHDIAG@GOTPAGEOFF]
	cmp	x9, #0
	csel	x9, x11, x12, eq
	cinc	w8, w8, ne
	ldr	w9, [x9]
	cmp	x10, #0
	csel	w0, w9, w8, eq
	ldr	x1, [x20]
	ldr	w8, [x19]
	sub	w2, w8, w1
	bl	_xwrite
	cmn	w0, #1
	b.ne	LBB0_14
; %bb.8:
Lloh27:
	adrp	x8, _errno@GOTPAGE
Lloh28:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	sub	w9, w8, #128
	ldr	x8, [x24]
	cmp	w9, #6
	b.hi	LBB0_11
; %bb.9:
	cbnz	x8, LBB0_11
; %bb.10:
	mov	w0, #1
	bl	_xexit
	ldr	x8, [x24]
LBB0_11:
	cbz	x8, LBB0_13
; %bb.12:
	bl	_fixerror
	b	LBB0_14
LBB0_13:
Lloh30:
	adrp	x8, _ERR_SILENT@GOTPAGE
Lloh31:
	ldr	x8, [x8, _ERR_SILENT@GOTPAGEOFF]
Lloh32:
	ldr	w0, [x8]
	bl	_stderror
LBB0_14:
	str	w22, [x21]
	ldr	x8, [x20]
	str	x8, [x19]
	strb	wzr, [x23, _flush.interrupted@PAGEOFF]
LBB0_15:
	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
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh8
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh24
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_exitset,4,2                    ; @exitset
.zerofill __DATA,__bss,_flush.interrupted,1,2 ; @flush.interrupted
	.comm	_linp,8,3                       ; @linp
	.comm	_linbuf,8,3                     ; @linbuf
	.comm	_GettingInput,8,3               ; @GettingInput
	.comm	_Tty_raw_mode,4,2               ; @Tty_raw_mode
	.comm	_handle_interrupt,8,3           ; @handle_interrupt
	.comm	_ERR_SILENT,4,2                 ; @ERR_SILENT
	.comm	_haderr,8,3                     ; @haderr
	.comm	_didfds,8,3                     ; @didfds
	.comm	_SHDIAG,4,2                     ; @SHDIAG
	.comm	_SHOUT,4,2                      ; @SHOUT
	.comm	_errno,4,2                      ; @errno
	.comm	_LFLUSHO,4,2                    ; @LFLUSHO
	.comm	_TIOCLBIC,4,2                   ; @TIOCLBIC
	.comm	_TIOCLGET,4,2                   ; @TIOCLGET
	.comm	_lmode,4,2                      ; @lmode
.subsections_via_symbols
