	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function filtered_write
_filtered_write:                        ## @filtered_write
	.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	%rdx, -56(%rbp)                 ## 8-byte Spill
	movl	%esi, %ebx
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_BUFSIZ@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	%r12, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	testq	%r13, %r13
	je	LBB0_1
## %bb.9:
	movslq	%ebx, %r14
	addq	%r13, %r14
	movb	$0, _filtered_write.lastchar(%rip)
	movb	_filtered_write.savedchar(%rip), %cl
	leaq	_filtered_write.savedchar(%rip), %rax
	testb	%cl, %cl
	cmoveq	%r13, %rax
	cmpq	%r14, %rax
	jae	LBB0_10
## %bb.11:
	addq	%r15, %r12
	cmpb	$1, %cl
	adcq	$0, %r13
	movq	%r15, %rbx
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_25:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	%r13, %rax
	leaq	1(%r13), %rcx
	cmpq	%r14, %r13
	movq	%rcx, %r13
	jae	LBB0_26
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	cmpq	%r14, %r13
	jae	LBB0_19
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	movzbl	(%rax), %eax
	cmpb	$10, %al
	je	LBB0_17
## %bb.14:                              ##   in Loop: Header=BB0_12 Depth=1
	cmpb	$13, %al
	jne	LBB0_22
## %bb.15:                              ##   in Loop: Header=BB0_12 Depth=1
	cmpb	$10, (%r13)
	je	LBB0_18
## %bb.16:                              ##   in Loop: Header=BB0_12 Depth=1
	movb	$10, (%rbx)
	jmp	LBB0_23
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_12 Depth=1
	movb	$0, _filtered_write.savedchar(%rip)
	movzbl	(%rax), %eax
	cmpb	$13, %al
	je	LBB0_21
## %bb.20:                              ##   in Loop: Header=BB0_12 Depth=1
	cmpb	$10, %al
	je	LBB0_21
LBB0_22:                                ##   in Loop: Header=BB0_12 Depth=1
	movb	%al, (%rbx)
LBB0_23:                                ##   in Loop: Header=BB0_12 Depth=1
	incq	%rbx
	cmpq	%r12, %rbx
	jb	LBB0_25
## %bb.24:                              ##   in Loop: Header=BB0_12 Depth=1
	subl	%r15d, %ebx
	movq	%r15, %rdi
	movl	$1, %esi
	movl	%ebx, %edx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	callq	_fwrite
	decl	%ebx
	movslq	%ebx, %rax
	movzbl	(%r15,%rax), %eax
	movb	%al, _filtered_write.lastchar(%rip)
	movq	%r15, %rbx
	jmp	LBB0_25
LBB0_17:                                ##   in Loop: Header=BB0_12 Depth=1
	movb	$10, %al
	cmpb	$13, (%r13)
	jne	LBB0_22
LBB0_18:                                ##   in Loop: Header=BB0_12 Depth=1
	movb	$10, (%rbx)
	incq	%r13
	jmp	LBB0_23
LBB0_1:
	movb	_filtered_write.savedchar(%rip), %al
	testb	%al, %al
	je	LBB0_5
## %bb.2:
	cmpb	$13, %al
	jne	LBB0_4
## %bb.3:
	movb	$10, _filtered_write.savedchar(%rip)
	movb	$10, %al
LBB0_4:
	movsbl	%al, %edi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_fputc
	movb	_filtered_write.savedchar(%rip), %cl
	movb	%cl, _filtered_write.lastchar(%rip)
	movb	$0, _filtered_write.savedchar(%rip)
	jmp	LBB0_6
LBB0_10:
	movq	%r15, %rbx
	jmp	LBB0_26
LBB0_21:
	movb	%al, _filtered_write.savedchar(%rip)
LBB0_26:
	subq	%r15, %rbx
	testl	%ebx, %ebx
	jle	LBB0_29
## %bb.27:
	movq	%r15, %rdi
	movl	$1, %esi
	movl	%ebx, %edx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	callq	_fwrite
	decl	%ebx
	movb	(%r15,%rbx), %al
	jmp	LBB0_28
LBB0_5:
	movb	_filtered_write.lastchar(%rip), %cl
LBB0_6:
	xorl	%eax, %eax
	testb	%cl, %cl
	je	LBB0_28
## %bb.7:
	cmpb	$10, %cl
	je	LBB0_28
## %bb.8:
	movl	$10, %edi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_fputc
	xorl	%eax, %eax
LBB0_28:
	movb	%al, _filtered_write.lastchar(%rip)
LBB0_29:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_31
## %bb.30:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_31:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_filtered_write.lastchar,1,0 ## @filtered_write.lastchar
.zerofill __DATA,__bss,_filtered_write.savedchar,1,0 ## @filtered_write.savedchar
	.comm	_BUFSIZ,4,2                     ## @BUFSIZ
	.no_dead_strip	_filtered_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function filtered_write
_filtered_write:                        ; @filtered_write
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #16
	mov	x19, x2
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x8, _BUFSIZ@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BUFSIZ@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x10, x8, #15
	and	x10, x10, #0x1fffffff0
	sub	x20, x9, x10
	mov	sp, x20
	adrp	x22, _filtered_write.lastchar@PAGE
	cbz	x0, LBB0_16
; %bb.1:
	add	x23, x0, w1, sxtw
	strb	wzr, [x22, _filtered_write.lastchar@PAGEOFF]
Lloh8:
	adrp	x9, _filtered_write.savedchar@PAGE
Lloh9:
	add	x9, x9, _filtered_write.savedchar@PAGEOFF
	ldrb	w10, [x9]
	cmp	w10, #0
	csel	x9, x0, x9, eq
	cmp	x9, x23
	b.hs	LBB0_20
; %bb.2:
	add	x24, x20, x8
	cmp	w10, #0
	cinc	x25, x0, eq
	mov	w26, #10
	adrp	x27, _filtered_write.savedchar@PAGE
	mov	x8, x20
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x9, x25
	add	x10, x25, #1
	cmp	x25, x23
	mov	x25, x10
	b.hs	LBB0_22
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	cmp	x25, x23
	b.hs	LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldrb	w9, [x9]
	cmp	w9, #10
	b.eq	LBB0_13
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w9, #13
	b.ne	LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	ldrb	w9, [x25]
	cmp	w9, #10
	b.eq	LBB0_14
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	strb	w26, [x8]
	b	LBB0_11
LBB0_9:                                 ;   in Loop: Header=BB0_4 Depth=1
	strb	wzr, [x27, _filtered_write.savedchar@PAGEOFF]
	ldrb	w9, [x9]
	cmp	w9, #13
	ccmp	w9, #10, #4, ne
	b.eq	LBB0_21
LBB0_10:                                ;   in Loop: Header=BB0_4 Depth=1
	strb	w9, [x8]
LBB0_11:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x8, x8, #1
	cmp	x8, x24
	b.lo	LBB0_3
; %bb.12:                               ;   in Loop: Header=BB0_4 Depth=1
	sub	w21, w8, w20
	mov	x0, x20
	mov	w1, #1
	mov	x2, x21
	mov	x3, x19
	bl	_fwrite
	sub	w8, w21, #1
	ldrb	w8, [x20, w8, sxtw]
	strb	w8, [x22, _filtered_write.lastchar@PAGEOFF]
	mov	x8, x20
	b	LBB0_3
LBB0_13:                                ;   in Loop: Header=BB0_4 Depth=1
	ldrb	w9, [x25]
	cmp	w9, #13
	b.ne	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_4 Depth=1
	strb	w26, [x8]
	add	x25, x25, #1
	b	LBB0_11
LBB0_15:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w9, #10
	b	LBB0_10
LBB0_16:
	adrp	x20, _filtered_write.savedchar@PAGE
	ldrb	w8, [x20, _filtered_write.savedchar@PAGEOFF]
	cbz	w8, LBB0_24
; %bb.17:
	cmp	w8, #13
	b.ne	LBB0_19
; %bb.18:
	mov	w8, #10
	strb	w8, [x20, _filtered_write.savedchar@PAGEOFF]
LBB0_19:
	sxtb	w0, w8
	mov	x1, x19
	bl	_fputc
	ldrb	w8, [x20, _filtered_write.savedchar@PAGEOFF]
	strb	w8, [x22, _filtered_write.lastchar@PAGEOFF]
	strb	wzr, [x20, _filtered_write.savedchar@PAGEOFF]
	b	LBB0_25
LBB0_20:
	mov	x8, x20
	b	LBB0_22
LBB0_21:
	strb	w9, [x27, _filtered_write.savedchar@PAGEOFF]
LBB0_22:
	sub	x21, x8, x20
	cmp	w21, #1
	b.lt	LBB0_29
; %bb.23:
	mov	x0, x20
	mov	w1, #1
	mov	x2, x21
	mov	x3, x19
	bl	_fwrite
	sub	w8, w21, #1
	ldrb	w8, [x20, w8, uxtw]
	b	LBB0_28
LBB0_24:
	ldrb	w8, [x22, _filtered_write.lastchar@PAGEOFF]
LBB0_25:
	cmp	w8, #0
	ccmp	w8, #10, #4, ne
	b.eq	LBB0_27
; %bb.26:
	mov	w0, #10
	mov	x1, x19
	bl	_fputc
LBB0_27:
	mov	w8, #0
LBB0_28:
	strb	w8, [x22, _filtered_write.lastchar@PAGEOFF]
LBB0_29:
	ldur	x8, [x29, #-88]
Lloh10:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh11:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_31
; %bb.30:
	sub	sp, x29, #80
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_31:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_filtered_write.lastchar,1,0 ; @filtered_write.lastchar
.zerofill __DATA,__bss,_filtered_write.savedchar,1,0 ; @filtered_write.savedchar
	.comm	_BUFSIZ,4,2                     ; @BUFSIZ
	.no_dead_strip	_filtered_write
.subsections_via_symbols
