	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fgetstr                        ## -- Begin function fgetstr
	.p2align	4, 0x90
_fgetstr:                               ## @fgetstr
	.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
	movl	%esi, %r14d
	movq	%rdi, %r15
	decl	%r14d
	je	LBB0_1
## %bb.2:
	movl	%edx, %r13d
	movl	%r14d, %r12d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r13d, %edi
	leaq	-41(%rbp), %rsi
	movl	$1, %edx
	callq	_read
	movl	%eax, %ecx
	movl	$-1, %eax
	testl	%ecx, %ecx
	js	LBB0_12
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	je	LBB0_5
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movzbl	-41(%rbp), %eax
	cmpb	$10, %al
	je	LBB0_6
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpb	$13, %al
	je	LBB0_6
## %bb.9:                               ##   in Loop: Header=BB0_3 Depth=1
	movb	%al, (%r15,%rbx)
	incq	%rbx
	cmpl	%ebx, %r12d
	jne	LBB0_3
## %bb.10:
	addq	%rbx, %r15
	jmp	LBB0_11
LBB0_1:
	xorl	%r14d, %r14d
	jmp	LBB0_11
LBB0_5:
	testl	%ebx, %ebx
	je	LBB0_12
LBB0_6:
	addq	%rbx, %r15
	movl	%ebx, %r14d
LBB0_11:
	movb	$0, (%r15)
	movl	%r14d, %eax
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fgetstr                        ; -- Begin function fgetstr
	.p2align	2
_fgetstr:                               ; @fgetstr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	subs	w20, w1, #1
	b.eq	LBB0_9
; %bb.1:
	mov	x21, x2
	mov	x22, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	add	x1, sp, #15
	mov	x0, x21
	mov	w2, #1
	bl	_read
	tbnz	w0, #31, LBB0_11
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	cbz	w0, LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	ldrb	w8, [sp, #15]
	cmp	w8, #10
	ccmp	w8, #13, #4, ne
	b.eq	LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	strb	w8, [x19, x22]
	add	x22, x22, #1
	cmp	w20, w22
	b.ne	LBB0_2
; %bb.6:
	add	x19, x19, x22
	b	LBB0_9
LBB0_7:
	cbz	w22, LBB0_11
LBB0_8:
	add	x19, x19, x22
	mov	x20, x22
LBB0_9:
	strb	wzr, [x19]
LBB0_10:
	mov	x0, x20
	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
	add	sp, sp, #64
	ret
LBB0_11:
	mov	w20, #-1
	b	LBB0_10
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
